gnustep-gui-0.24.0/0000775000076500007650000000000012256227335013751 5ustar brains99brains99gnustep-gui-0.24.0/Version0000664000076500007650000000133612256227272015324 0ustar brains99brains99# This file is included in various Makefile's to get version information. # Compatible with Bourne shell syntax, so it can included there too. # The gcc version required to compile the library. GNUSTEP_GUI_GCC=4.0.0 # Versions for libraries that gnustep-gui is dependent upon GNUSTEP_GUI_BASE=1.24.6 GNUSTEP_GUI_LIBTIFF=3.4 # The version number of this release. GNUSTEP_GUI_MAJOR_VERSION=0 GNUSTEP_GUI_MINOR_VERSION=24 GNUSTEP_GUI_SUBMINOR_VERSION=0 # numeric value should match above VERSION_NUMBER=024.0 GNUSTEP_GUI_VERSION=${GNUSTEP_GUI_MAJOR_VERSION}.${GNUSTEP_GUI_MINOR_VERSION}.${GNUSTEP_GUI_SUBMINOR_VERSION} VERSION=${GNUSTEP_GUI_VERSION} GNUSTEP_GUI_FTP_MACHINE=ftp.gnustep.org GNUSTEP_GUI_FTP_DIRECTORY=pub/gnustep/core gnustep-gui-0.24.0/Themes/0000775000076500007650000000000012256227331015172 5ustar brains99brains99gnustep-gui-0.24.0/Themes/GNUmakefile0000664000076500007650000000263011250225374017243 0ustar brains99brains99# # Themes makefile for GNUstep GUI Library # Copyright (C) 2009 Free Software Foundation, Inc. # # Author: Nicola Pero # Date: September 2009 # # 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 Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-gui GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../gui.make include $(GNUSTEP_MAKEFILES)/common.make include ../Version # # We have no themes to install yet! Once we have them, add them to # the Themes_RESOURCE_FILES variable. # RESOURCE_SET_NAME = Themes Themes_INSTALL_DIR = $(GNUSTEP_LIBRARY)/Themes Themes_RESOURCE_FILES = include $(GNUSTEP_MAKEFILES)/resource-set.make gnustep-gui-0.24.0/.cvsignore0000664000076500007650000000014310377004044015737 0ustar brains99brains99config.log config.status config.cache config.make gnustep-gui.spec gnustep-gui-debug.spec gui.make gnustep-gui-0.24.0/Model/0000775000076500007650000000000012256227331015005 5ustar brains99brains99gnustep-gui-0.24.0/Model/test.m0000664000076500007650000000401111023376255016137 0ustar brains99brains99/* test Copyright (C) 2005 Free Software Foundation, Inc. This file is part of the GNU Objective C User Interface library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include int main (int argc, char** argv, char** env) { id pool = [NSAutoreleasePool new]; NSArray* arguments; NSProcessInfo* processInfo; NSString *model; #ifdef LIB_FOUNDATION_LIBRARY [NSProcessInfo initializeWithArguments:argv count:argc environment:env]; #endif processInfo = [NSProcessInfo processInfo]; arguments = [processInfo arguments]; [NSApplication sharedApplication]; if ([arguments count] < 2) { model = @"test.gmodel"; if (![NSBundle loadNibNamed: model owner: NSApp]) { printf ("Cannot load Interface Modeller file!\n"); exit (1); } } else { NSDictionary *table; table = [NSDictionary dictionaryWithObject: NSApp forKey: @"NSOwner"]; model = [arguments objectAtIndex: 1]; if (![NSBundle loadNibFile: model externalNameTable: table withZone: [NSApp zone]]) { printf ("Cannot load Interface Modeller file!\n"); exit (1); } } [[NSApplication sharedApplication] run]; printf ("exiting...\n"); [pool release]; exit (0); return 0; } gnustep-gui-0.24.0/Model/.cvsignore0000664000076500007650000000010311335044227016775 0ustar brains99brains99*obj *.app *.debug *.profile .gdbinit *.nib~ *.iconheader *.bundle gnustep-gui-0.24.0/Model/Translator.m0000664000076500007650000000433711023376255017324 0ustar brains99brains99/* Translator.m Translate a NIB file to a GNU model file. Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: November 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* The original idea comes from the nib translator in objcX, an Objective-C class library for Motif, translator whose authors are Paul Kunz and Imran Qureshi. */ #include #include "GNUstepGUI/GMArchiver.h" #include "GNUstepGUI/IMLoading.h" #include "IBClasses.h" #include "Translator.h" NSMutableArray* objects; NSMutableArray* connections; @implementation Translator - (void)translateNibFile:(NSString*)nibFile toModelFile:(NSString*)modelFile { GMArchiver* archiver = [[GMArchiver new] autorelease]; GMModel* model = [[GMModel new] autorelease]; objects = [[NSMutableArray new] autorelease]; connections = [[NSMutableArray new] autorelease]; gmodelFile = [modelFile retain]; [NSApplication sharedApplication]; if (![NSBundle loadNibFile:nibFile externalNameTable:[NSDictionary dictionaryWithObjectsAndKeys: NSApp, @"NSOwner", nil] withZone:[NSApp zone]]) { NSLog (@"Cannot load nib file %@!", nibFile); exit (1); } [model _setObjects:objects connections:connections]; [archiver encodeRootObject:model withName:@"RootObject"]; if (![archiver writeToFile:gmodelFile]) NSLog (@"cannot write the model output file %@", gmodelFile); } @end gnustep-gui-0.24.0/Model/GMArchiver.m0000664000076500007650000007263111536254245017167 0ustar brains99brains99/* GMArchiver.m Author: Ovidiu Predescu Date: October 1997 Copyright (C) 1997 Free Software Foundation, Inc. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Portions of the code are based on NSArchiver from libFoundation. See the COPYING file from libFoundation for copyright information. */ #ifndef GNUSTEP #import #else #import #import #import #import #import #import #import #import #import #import #import #import #endif #ifndef AUTORELEASE #define AUTORELEASE(object) [object autorelease] #define RELEASE(object) [object release] #define RETAIN(object) [object retain] #endif #import @interface GMClassInfo : NSObject { NSString* className; int version; BOOL written; } + classInfoWithClassName: (NSString*)className version: (int)version; - (NSString*) className; - (int) version; - (void) setWasWritten: (BOOL)flag; - (BOOL) wasWritten; @end @implementation GMClassInfo + classInfoWithClassName: (NSString*)name version: (int)_version { GMClassInfo* object = [[self new] autorelease]; object->className = [name retain]; object->version = _version; return object; } - (NSString*) className { return className; } - (int) version { return version; } - (void) setWasWritten: (BOOL)flag { written = flag; } - (BOOL) wasWritten { return written; } @end @implementation GMArchiver + (BOOL) archiveRootObject: (id)rootObject toFile: (NSString*)path { GMArchiver* archiver = [[self new] autorelease]; BOOL result; [archiver encodeRootObject: rootObject withName: @"RootObject"]; result = [archiver writeToFile: path]; return result; } - (id) init { propertyList = [NSMutableDictionary new]; topLevelObjects = [NSMutableArray new]; [propertyList setObject: topLevelObjects forKey: @"TopLevelObjects"]; lastObjectRepresentation = propertyList; objects = NSCreateMapTable (NSNonRetainedObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 119); conditionals = NSCreateHashTable (NSNonRetainedObjectHashCallBacks, 19); classes = NSCreateMapTable (NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 19); [propertyList setObject: @"1" forKey: @"Version"]; return self; } - (void) dealloc { [propertyList release]; [topLevelObjects release]; NSFreeMapTable(objects); NSFreeHashTable(conditionals); NSFreeMapTable(classes); [super dealloc]; } - (NSString*) nextLabel { return [NSString stringWithFormat: @"Object%5d", ++counter]; } - (BOOL) writeToFile: (NSString*)path { return [propertyList writeToFile: path atomically: YES]; } - (id) encodeRootObject: (id)rootObject withName: (NSString*)name { id originalPList = propertyList; int oldCounter = counter; id label; if (writingRoot) #if 1 [NSException raise: NSInconsistentArchiveException format: @"CoderHasAlreadyWrittenRootObject"]; #else THROW([CoderHasAlreadyWrittenRootObjectException new]); #endif writingRoot = YES; /* * Prepare for writing the graph objects for which `rootObject' is the root * node. The algorithm consists from two passes. In the first pass it * determines the nodes so-called 'conditionals' - the nodes encoded *only* * with -encodeConditionalObject: . They represent nodes that are not * related directly to the graph. In the second pass objects are encoded * normally, except for the conditional objects which are encoded as nil. */ /* First pass. */ findingConditionals = YES; lastObjectRepresentation = propertyList = nil; NSResetHashTable(conditionals); NSResetMapTable(objects); [self encodeObject: rootObject withName: name]; /* Second pass. */ findingConditionals = NO; counter = oldCounter; lastObjectRepresentation = propertyList = originalPList; NSResetMapTable(objects); label = [self encodeObject: rootObject withName: name]; writingRoot = NO; return label; } - (id) encodeConditionalObject: (id)anObject withName: (NSString*)name { #if 0 if (!writingRoot) THROW([RootObjectHasNotBeenWrittenException new]); #endif if (findingConditionals) { /* * This is the first pass of the determining the conditionals * algorithm. We traverse the graph and insert into the `conditionals' * set. In the second pass all objects that are still in this set will * be encoded as nil when they receive -encodeConditionalObject: . An * object is removed from this set when it receives -encodeObject: . */ id value; if (!anObject) return nil; /* Lookup anObject into the `conditionals' set. If it is then the object is still a conditional object. */ value = (id)NSHashGet(conditionals, anObject); if (value) return value; /* * Maybe it has received -encodeObject: * and now is in the `objects' set. */ value = (id)NSMapGet(objects, anObject); if (value) return value; /* anObject was not written previously. */ NSHashInsert(conditionals, anObject); } else { /* If anObject is in the `conditionals' set, it is encoded as nil. */ if (!anObject || NSHashGet(conditionals, anObject)) return [self encodeObject: nil withName: name]; else return [self encodeObject: anObject withName: name]; } return nil; } - (id) encodeObject: (id)anObject withName: (NSString*)name { if (!anObject) { if (!findingConditionals && name) [lastObjectRepresentation setObject: @"nil" forKey: name]; return @"nil"; } else { NSString *label; id upperObjectRepresentation; anObject = [anObject replacementObjectForModelArchiver: self]; label = NSMapGet(objects, anObject); if (findingConditionals && !label) { /* * Look-up the object in the `conditionals' set. If the object is * there, then remove it because it is no longer a conditional one. */ label = NSHashGet(conditionals, anObject); if (label) { NSHashRemove(conditionals, anObject); NSMapInsert(objects, anObject, [self nextLabel]); return label; } } if (label == nil) { Class archiveClass; /* If the object gets encoded on the top level, set the label to be `name'. */ if (!level) { if (!name) { NSLog (@"Can't encode top level object with a nil name!"); return nil; } label = name; } else label = [self nextLabel]; NSMapInsert(objects, anObject, label); /* Temporary save the last object into upperObjectRepresentation so we can restore the stack of objects being encoded after anObject is encoded. */ upperObjectRepresentation = lastObjectRepresentation; archiveClass = [anObject classForModelArchiver]; if (!findingConditionals) { NSMutableDictionary* objectPList = [NSMutableDictionary dictionary]; /* If anObject is the first object in the graph that receives the -encodeObject: withName: message, save its label into the topLevelObjects array. */ if (!level) [topLevelObjects addObject: (name ? name : label)]; lastObjectRepresentation = objectPList; if (level) { /* Encode 'name = label' in the object's representation and put the description of anObject on the top level like 'label = object'. */ if (name) [upperObjectRepresentation setObject: label forKey: name]; [propertyList setObject: objectPList forKey: label]; } else { /* The encoded object is on the top level so encode it and put it under the key 'name'. */ if (name) label = name; [propertyList setObject: objectPList forKey: label]; } [objectPList setObject: NSStringFromClass(archiveClass) forKey: @"isa"]; } else { /* * This is the first pass of determining the conditionals * objects algorithm. Remove anObject from the `conditionals' * set if it is there and insert it into the `objects' set. */ NSHashRemove(conditionals, anObject); } level++; [anObject encodeWithModelArchiver: self]; level--; lastObjectRepresentation = upperObjectRepresentation; } else if (!findingConditionals) { if (name) [lastObjectRepresentation setObject: label forKey: name]; } return label; } } - (id) encodeString: (NSString*)anObject withName: (NSString*)name { if (!findingConditionals) { if (!anObject) { if (name) [lastObjectRepresentation setObject: @"nil" forKey: name]; return @"nil"; } else { if (name) [lastObjectRepresentation setObject: anObject forKey: name]; return anObject; } } return @"nil"; } - (id) encodeData: (NSData*)anObject withName: (NSString*)name { if (!findingConditionals) { if (!anObject) { if (name) [lastObjectRepresentation setObject: @"nil" forKey: name]; return @"nil"; } else { if (name) [lastObjectRepresentation setObject: anObject forKey: name]; return anObject; } } return @"nil"; } - (id) encodeArray: (NSArray*)array withName: (NSString*)name { if (array) { int i, count = [array count]; NSMutableArray* description = [NSMutableArray arrayWithCapacity: count]; for (i = 0; i < count; i++) { id object = [array objectAtIndex: i]; [description addObject: [self encodeObject: object withName: nil]]; } if (name) [lastObjectRepresentation setObject: description forKey: name]; return description; } else { if (name) [lastObjectRepresentation setObject: @"nil" forKey: name]; return @"nil"; } } - (id) encodeDictionary: (NSDictionary*)dictionary withName: (NSString*)name { if (dictionary) { id enumerator, key; NSMutableDictionary* description = [NSMutableDictionary dictionaryWithCapacity: [dictionary count]]; enumerator = [dictionary keyEnumerator]; while ((key = [enumerator nextObject])) { id value = [dictionary objectForKey: key]; id keyDesc = [self encodeObject: key withName: nil]; id valueDesc = [self encodeObject: value withName: nil]; [description setObject: valueDesc forKey: keyDesc]; } if (name) [lastObjectRepresentation setObject: description forKey: name]; return description; } else { if (name) [lastObjectRepresentation setObject: @"nil" forKey: name]; return @"nil"; } } - (id) propertyList { return propertyList; } - (id) encodeClass: (Class)class withName: (NSString*)name { if (class) return [self encodeString: NSStringFromClass(class) withName: name]; else return [self encodeString: nil withName: name]; } - (id) encodeSelector: (SEL)selector withName: (NSString*)name { if (selector) return [self encodeString: NSStringFromSelector(selector) withName: name]; else return [self encodeString: nil withName: name]; } - (void) encodeChar: (char)value withName: (NSString*)name { if (!findingConditionals && name) { id valueString = [NSString stringWithFormat: @"%c", value]; [lastObjectRepresentation setObject: valueString forKey: name]; } } - (void) encodeUnsignedChar: (unsigned char)value withName: (NSString*)name { if (!findingConditionals && name) { id valueString = [NSString stringWithFormat: @"%uc", value]; [lastObjectRepresentation setObject: valueString forKey: name]; } } - (void) encodeBOOL: (BOOL)value withName: (NSString*)name { if (!findingConditionals && name) { id valueString = [NSString stringWithFormat: @"%s", value ? "YES" : "NO"]; [lastObjectRepresentation setObject: valueString forKey: name]; } } - (void) encodeShort: (short)value withName: (NSString*)name { if (!findingConditionals && name) { id valueString = [NSString stringWithFormat: @"%s", value]; [lastObjectRepresentation setObject: valueString forKey: name]; } } - (void) encodeUnsignedShort: (unsigned short)value withName: (NSString*)name { if (!findingConditionals && name) { id valueString = [NSString stringWithFormat: @"%us", value]; [lastObjectRepresentation setObject: valueString forKey: name]; } } - (void) encodeInt: (int)value withName: (NSString*)name { if (!findingConditionals && name) { id valueString = [NSString stringWithFormat: @"%i", value]; [lastObjectRepresentation setObject: valueString forKey: name]; } } - (void) encodeUnsignedInt: (unsigned int)value withName: (NSString*)name { if (!findingConditionals && name) { id valueString = [NSString stringWithFormat: @"%u", value]; [lastObjectRepresentation setObject: valueString forKey: name]; } } - (void) encodeLong: (long)value withName: (NSString*)name { if (!findingConditionals && name) { id valueString = [NSString stringWithFormat: @"%l", value]; [lastObjectRepresentation setObject: valueString forKey: name]; } } - (void) encodeUnsignedLong: (unsigned long)value withName: (NSString*)name { if (!findingConditionals && name) { id valueString = [NSString stringWithFormat: @"%lu", value]; [lastObjectRepresentation setObject: valueString forKey: name]; } } - (void) encodeFloat: (float)value withName: (NSString*)name { if (!findingConditionals && name) { id valueString = [NSString stringWithFormat: @"%f", value]; [lastObjectRepresentation setObject: valueString forKey: name]; } } - (void) encodeDouble: (double)value withName: (NSString*)name { if (!findingConditionals && name) { id valueString = [NSString stringWithFormat: @"%f", value]; [lastObjectRepresentation setObject: valueString forKey: name]; } } - (void) encodePoint: (NSPoint)point withName: (NSString*)name { if (!findingConditionals && name) { /* Macosx NSStringFromPoint is not OPENstep compliant, so we do it by hand. */ id valueString = [NSString stringWithFormat: @"{x=%f; y=%f}", point.x, point.y]; [lastObjectRepresentation setObject: valueString forKey: name]; } } - (void) encodeSize: (NSSize)size withName: (NSString*)name { if (!findingConditionals) { /* Macosx NSStringFromSize is not OPENstep compliant, so we do it by hand. */ id valueString = [NSString stringWithFormat: @"{width=%f; height=%f}", size.width, size.height]; [lastObjectRepresentation setObject: valueString forKey: name]; } } - (void) encodeRect: (NSRect)rect withName: (NSString*)name { if (!findingConditionals) { /* Macosx NSStringFromRect is not OPENstep compliant, so we do it by hand. */ id valueString = [NSString stringWithFormat: @"{x=%f; y=%f; width=%f; height=%f}", rect.origin.x, rect.origin.y, rect.size.width, rect.size.height]; [lastObjectRepresentation setObject: valueString forKey: name]; } } - (NSString*) classNameEncodedForTrueClassName: (NSString*)trueName { NSString *inArchiveName = [(id)NSMapGet(classes, trueName) className]; return inArchiveName ? inArchiveName : trueName; } /* In the following method the version of class named trueName is written as version for class named inArchiveName. Is this right? It is possible for the inArchiveName class that it could not be linked in the running process at the time the archive is written. */ - (void) encodeClassName: (NSString*)trueName intoClassName: (NSString*)inArchiveName { id classInfo = [GMClassInfo classInfoWithClassName: inArchiveName version: [NSClassFromString(trueName) version]]; NSMapInsert(classes, trueName, classInfo); } @end /* GMArchiver */ @implementation GMUnarchiver static NSMutableDictionary* classToAliasMappings = nil; + (void) initialize { classToAliasMappings = [NSMutableDictionary new]; } + (id) unarchiverWithContentsOfFile: (NSString*)path { id plist = [[NSString stringWithContentsOfFile: path] propertyList]; GMUnarchiver* unarchiver; if (!plist) return nil; unarchiver = [[[self alloc] initForReadingWithPropertyList: plist] autorelease]; return unarchiver; } + (id) unarchiveObjectWithName: (NSString*)name fromPropertyList: (id)plist { GMUnarchiver* unarchiver = [[[self alloc] initForReadingWithPropertyList: plist] autorelease]; return [unarchiver decodeObjectWithName: name]; } + (id) unarchiveObjectWithName: (NSString*)name fromFile: (NSString*)path { GMUnarchiver* unarchiver = [self unarchiverWithContentsOfFile: path]; return [unarchiver decodeObjectWithName: name]; } - init { return [self initForReadingWithPropertyList: nil]; } - (id) initForReadingWithPropertyList: (id)plist { NSString* versionString; propertyList = [plist copy]; currentDecodedObjectRepresentation = propertyList; namesToObjects = RETAIN ([NSMutableDictionary dictionaryWithCapacity: 119]); /* Decode version information */ versionString = [propertyList objectForKey: @"Version"]; [[NSScanner scannerWithString: versionString] scanInt: &version]; objectZone = NSDefaultMallocZone (); return self; } - (void) dealloc { RELEASE (propertyList); RELEASE (namesToObjects); [super dealloc]; } - (id) decodeObjectWithName: (NSString*)name { id object, label, representation, className; id upperObjectRepresentation; BOOL objectOnTopLevel = NO; id newObject; Class class; NSString* decodeAsName; if (!name) return nil; if (level) { /* First try to see if the object has been already decoded */ if ((object = [namesToObjects objectForKey: name])) return object; } /* The object has not been decoded yet. Read its label from the current object dictionary representation. */ label = [currentDecodedObjectRepresentation objectForKey: name]; if (label) { /* Try to see if the object has been decoded using `label' as name */ if ((object = [namesToObjects objectForKey: label])) return object; } else { /* Try to find the object on the top level */ label = [propertyList objectForKey: name]; if (label) objectOnTopLevel = YES; else { /* There is no object with this name within the current object or on the top level. */ #if 0 NSLog (@"No object named '%@' in object representation '%@'", name, currentDecodedObjectRepresentation); #endif return nil; } } /* If we are on the top level the description is really the representation of the object. Otherwise the value is the name of an object on the top level. */ if (currentDecodedObjectRepresentation != propertyList && !objectOnTopLevel) { NSAssert1 ([label isKindOfClass: [NSString class]], @"label is not a string: '%@'!", label); /* label is either a name of an object on the top level dictionary or the string "nil" which means the object has the nil value. */ if ([label isEqual: @"nil"]) return nil; representation = [propertyList objectForKey: label]; } else { representation = label; label = name; } if (!representation) { /* There is no object with such a label on the top level dictionary */ NSLog (@"No object object named '%@' on the top level dictionary! (error " @"within object representation '%@')", label, currentDecodedObjectRepresentation); return nil; } /* Temporary save the current object representation */ upperObjectRepresentation = currentDecodedObjectRepresentation; currentDecodedObjectRepresentation = representation; /* Create the object */ className = [representation objectForKey: @"isa"]; decodeAsName = [classToAliasMappings objectForKey: className]; if ( decodeAsName ) { #if GNU_GUI_LIBRARY NSDebugLLog(@"GMArchiver", @"%@ to be decoded as %@", className, decodeAsName); #endif className = decodeAsName; } class = NSClassFromString(className); object = [class createObjectForModelUnarchiver: self]; if (!class) { NSLog (@"Class %@ not linked into application!", className); return nil; } /* Push it into the dictionary of known objects */ [namesToObjects setObject: object forKey: label]; /* Read it from dictionary */ level++; newObject = [object initWithModelUnarchiver: self]; level--; if (newObject != object) { object = newObject; [namesToObjects setObject: object forKey: label]; } /* Restore the current object representation */ currentDecodedObjectRepresentation = upperObjectRepresentation; return object; } - (NSString*) decodeStringWithName: (NSString*)name { id string; if (!name) return nil; string = [currentDecodedObjectRepresentation objectForKey: name]; if (!string) { #if 0 NSLog (@"Couldn't find the string value for key '%@' (object '%@')", name, currentDecodedObjectRepresentation); #endif return nil; } if (![string isKindOfClass: [NSString class]]) { NSLog (@"Decoded object is not a string: '%@'! (key '%@', object '%@')", string, name, currentDecodedObjectRepresentation); return nil; } if ([string isEqualToString: @"nil"]) return nil; return string; } - (NSData*) decodeDataWithName: (NSString*)name { id data; if (!name) return nil; data = [currentDecodedObjectRepresentation objectForKey: name]; if (!data) { NSLog (@"Couldn't find the data value for key '%@' (object '%@')", name, currentDecodedObjectRepresentation); return nil; } if (![data isKindOfClass: [NSData class]]) { NSLog (@"Decoded object is not a data: '%@'! (key '%@', object '%@')", data, name, currentDecodedObjectRepresentation); return nil; } return data; } - (NSArray*) decodeArrayWithName: (NSString*)name { id array, decodedArray; int i, count; if (!name) return nil; array = [currentDecodedObjectRepresentation objectForKey: name]; if (!array) { NSLog (@"Couldn't find the array value for key '%@' (object '%@')", name, currentDecodedObjectRepresentation); return nil; } if (![array isKindOfClass: [NSArray class]]) { NSLog (@"Decoded object is not an array: '%@'! (key '%@', object '%@')", array, name, currentDecodedObjectRepresentation); return nil; } count = [array count]; decodedArray = [NSMutableArray arrayWithCapacity: count]; for (i = 0; i < count; i++) { id label = [array objectAtIndex: i]; id objectDescription = [propertyList objectForKey: label]; if (!objectDescription) { NSLog (@"warning: couldn't find the description for object labeled '%@' " @"in the array description '%@ = %@'!", label, name, array); continue; } [decodedArray addObject: [self decodeObjectWithName: label]]; } return decodedArray; } - (NSDictionary*) decodeDictionaryWithName: (NSString*)name { id dictionary, decodedDictionary; id enumerator, keyLabel, valueLabel; if (!name) return nil; dictionary = [currentDecodedObjectRepresentation objectForKey: name]; if (!dictionary) { NSLog (@"Couldn't find the dictionary value for key '%@' (object '%@')", name, currentDecodedObjectRepresentation); return nil; } if (![dictionary isKindOfClass: [NSDictionary class]]) { NSLog (@"Decoded object is not a dictionary: '%@'! (key '%@', object '%@')", dictionary, name, currentDecodedObjectRepresentation); return nil; } decodedDictionary = [NSMutableDictionary dictionaryWithCapacity: [dictionary count]]; enumerator = [dictionary keyEnumerator]; while ((keyLabel = [enumerator nextObject])) { id key, value, objectDescription; objectDescription = [propertyList objectForKey: keyLabel]; if (!objectDescription) { NSLog (@"warning: couldn't find the description for object labeled '%@' " @"in the dictionary description '%@ = %@'!", keyLabel, name, dictionary); continue; } key = [self decodeObjectWithName: keyLabel]; valueLabel = [dictionary objectForKey: keyLabel]; objectDescription = [propertyList objectForKey: valueLabel]; if (!objectDescription) { NSLog (@"warning: couldn't find the description for object labeled '%@' " @"in the dictionary description '%@ = %@'!", valueLabel, name, dictionary); continue; } value = [self decodeObjectWithName: valueLabel]; [decodedDictionary setObject: value forKey: key]; } return decodedDictionary; } - (Class) decodeClassWithName: (NSString*)name { NSString* className = [self decodeStringWithName: name]; return className ? NSClassFromString (className) : Nil; } - (SEL) decodeSelectorWithName: (NSString*)name { NSString* selectorName = [self decodeStringWithName: name]; return selectorName ? NSSelectorFromString (selectorName) : (SEL)0; } - (char) decodeCharWithName: (NSString*)name { NSString* valueString; if (!name) return 0; valueString = [currentDecodedObjectRepresentation objectForKey: name]; if (!valueString) return 0; return *[valueString cString]; } - (unsigned char) decodeUnsignedCharWithName: (NSString*)name { NSString* valueString; if (!name) return 0; valueString = [currentDecodedObjectRepresentation objectForKey: name]; if (!valueString) return 0; return *[valueString cString]; } - (BOOL) decodeBOOLWithName: (NSString*)name { NSString* valueString; if (!name) return NO; valueString = [currentDecodedObjectRepresentation objectForKey: name]; if (!valueString) return NO; return [valueString compare: @"YES" options: NSCaseInsensitiveSearch] == NSOrderedSame; } - (short) decodeShortWithName: (NSString*)name { return [self decodeIntWithName: name]; } - (unsigned short) decodeUnsignedShortWithName: (NSString*)name { return [self decodeIntWithName: name]; } - (int) decodeIntWithName: (NSString*)name { NSString* valueString; int value; if (!name) return 0; valueString = [currentDecodedObjectRepresentation objectForKey: name]; if (!valueString) return 0; if (![[NSScanner scannerWithString: valueString] scanInt: &value]) { NSLog (@"Cannot scan integer value '%@' from object '%@' under key '%@'", valueString, currentDecodedObjectRepresentation, name); return 0; } return value; } - (unsigned int) decodeUnsignedIntWithName: (NSString*)name { return [self decodeIntWithName: name]; } - (long) decodeLongWithName: (NSString*)name { return [self decodeIntWithName: name]; } - (unsigned long) decodeUnsignedLongWithName: (NSString*)name { return [self decodeIntWithName: name]; } - (float) decodeFloatWithName: (NSString*)name { NSString* valueString; float value; if (!name) return 0; valueString = [currentDecodedObjectRepresentation objectForKey: name]; if (!valueString) return 0; if (![[NSScanner scannerWithString: valueString] scanFloat: &value]) { NSLog (@"Cannot scan float value '%@' from object '%@' under key '%@'", valueString, currentDecodedObjectRepresentation, name); return 0; } return value; } - (double) decodeDoubleWithName: (NSString*)name { NSString* valueString; double value; if ( !name ) return 0; valueString = [currentDecodedObjectRepresentation objectForKey: name]; if ( !valueString ) return 0; if ( ![[NSScanner scannerWithString: valueString] scanDouble: &value] ) { NSLog(@"Cannot scan double value '%@' from object '%@' under key '%@'", valueString, currentDecodedObjectRepresentation, name); return 0; } return value; } - (NSPoint) decodePointWithName: (NSString*)name { NSString* valueString; if (!name) return NSZeroPoint; valueString = [currentDecodedObjectRepresentation objectForKey: name]; if (!valueString) return NSZeroPoint; return NSPointFromString (valueString); } - (NSSize) decodeSizeWithName: (NSString*)name { NSString* valueString; if (!name) return NSZeroSize; valueString = [currentDecodedObjectRepresentation objectForKey: name]; if (!valueString) return NSZeroSize; return NSSizeFromString (valueString); } - (NSRect) decodeRectWithName: (NSString*)name { NSString* valueString; if (!name) return NSZeroRect; valueString = [currentDecodedObjectRepresentation objectForKey: name]; if (!valueString) return NSZeroRect; return NSRectFromString (valueString); } - (BOOL) isAtEnd { // TODO return NO; } - (void) setObjectZone: (NSZone*)zone { objectZone = zone; } - (unsigned int) systemVersion { return version; } - (NSZone*) objectZone { return objectZone; } + (NSString*) classNameDecodedForArchiveClassName: (NSString*)nameInArchive { NSString* className = [classToAliasMappings objectForKey: nameInArchive]; return className ? className : nameInArchive; } + (void) decodeClassName: (NSString*)nameInArchive asClassName: (NSString*)trueName { [classToAliasMappings setObject: trueName forKey: nameInArchive]; } - (NSString*) classNameDecodedForArchiveClassName: (NSString*)nameInArchive { return nameInArchive; } - (void) decodeClassName: (NSString*)nameInArchive asClassName: (NSString*)trueName { } - (unsigned int) versionForClassName: (NSString*)className { return 1; } @end /* GMUnarchiver */ #import "GMArchiveObjects.m" gnustep-gui-0.24.0/Model/Controller.m0000664000076500007650000000230111023376255017303 0ustar brains99brains99/* Controller Copyright (C) 2005 Free Software Foundation, Inc. This file is part of the GNU Objective C User Interface library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "Controller.h" @implementation Controller - (void)buttonPressed:(id)sender { NSString* text = [NSString stringWithFormat:@"\"%@\" button pressed", [sender title]]; [textField setStringValue:text]; } - (id)window { return [textField window]; } @end gnustep-gui-0.24.0/Model/IMConnectors.h0000664000076500007650000000326511023376255017530 0ustar brains99brains99/* IMConnectors.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: November 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* These classes were inspired by IBConnectors classes from objcX, "an Objective-C class library for a window system". The code was originally written by Scott Francis, Paul Kunz, Imran Qureshi and Libing Wang. */ #ifndef _GNUstep_H_IMConnectors #define _GNUstep_H_IMConnectors #ifndef GNUSTEP #include #else #include #endif @interface IMConnector : NSObject { id source; id destination; NSString* label; } - source; - destination; - label; @end @interface IMControlConnector:IMConnector - (void)establishConnection; @end @interface IMOutletConnector : IMConnector - (void)establishConnection; @end #endif /* _GNUstep_H_IMConnectors */ gnustep-gui-0.24.0/Model/nib2gmodel.m0000664000076500007650000000317211023376255017211 0ustar brains99brains99/* nib2gmodel.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: November 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include "Translator.h" int main () { id pool = [NSAutoreleasePool new]; NSProcessInfo* processInfo = [NSProcessInfo processInfo]; NSArray* arguments = [processInfo arguments]; id translator; if ([arguments count] != 3) { printf ("Convert nib files to GNU model files.\n"); printf ("usage: %s nib-file gmodel-file\n", [[processInfo processName] cString]); return (1); } translator = [[Translator new] autorelease]; [translator translateNibFile:[arguments objectAtIndex:1] toModelFile:[arguments objectAtIndex:2]]; // [pool release]; return 0; } gnustep-gui-0.24.0/Model/Controller.h0000664000076500007650000000206711023376255017307 0ustar brains99brains99/* Controller Copyright (C) 2005 Free Software Foundation, Inc. This file is part of the GNU Objective C User Interface library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include @interface Controller : NSObject { id textField; } - (void)buttonPressed:(id)sender; - (id)window; @end gnustep-gui-0.24.0/Model/IMCustomObject.m0000664000076500007650000001064111023376255020015 0ustar brains99brains99/* IMCustomObject.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: November 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include "GNUstepGUI/GMArchiver.h" #include "GNUstepGUI/IMCustomObject.h" @implementation NSObject(ModelUnarchiving) - (id)nibInstantiate { return self; } @end @implementation IMCustomObject extern id _nibOwner; extern BOOL _fileOwnerDecoded; + (id)createObjectForModelUnarchiver:(GMUnarchiver*)unarchiver { IMCustomObject* customObject = [[self new] autorelease]; Class class; if (!_fileOwnerDecoded) { _fileOwnerDecoded = YES; customObject->className = [unarchiver decodeStringWithName:@"className"]; customObject->extension = [unarchiver decodeObjectWithName:@"extension"]; customObject->realObject = [unarchiver decodeObjectWithName:@"realObject"]; customObject->realObject = _nibOwner; return customObject; } customObject->className = [unarchiver decodeStringWithName:@"className"]; customObject->extension = [unarchiver decodeObjectWithName:@"extension"]; customObject->realObject = [unarchiver decodeObjectWithName:@"realObject"]; class = NSClassFromString (customObject->className); if (class) { customObject->realObject = [[class alloc] init]; } else { NSLog (@"Class %@ not linked into application!", customObject->className); } return customObject; } - (id)nibInstantiate { return realObject; } - (void)encodeWithModelArchiver: (GMArchiver*)archiver { [archiver encodeString:className withName:@"className"]; if (realObject) { [archiver encodeObject:realObject withName:@"realObject"]; } if (extension) { [archiver encodeObject:extension withName:@"extension"]; } } - (id)initWithModelUnarchiver: (GMUnarchiver*)unarchiver { return self; } @end @implementation IMCustomView + (id)createObjectForModelUnarchiver: (GMUnarchiver*)unarchiver { IMCustomView* customView = [[self new] autorelease]; Class class; if (!_fileOwnerDecoded) { _fileOwnerDecoded = YES; customView->className = [unarchiver decodeStringWithName: @"className"]; customView->extension = [unarchiver decodeObjectWithName: @"extension"]; customView->realObject = [unarchiver decodeObjectWithName: @"realObject"]; customView->realObject = _nibOwner; [customView setFrame: [unarchiver decodeRectWithName: @"frame"]]; return customView; } customView->className = [unarchiver decodeStringWithName: @"className"]; customView->extension = [unarchiver decodeObjectWithName: @"extension"]; customView->realObject = [unarchiver decodeObjectWithName: @"realObject"]; [customView setFrame: [unarchiver decodeRectWithName: @"frame"]]; class = NSClassFromString (customView->className); if (class) { customView->realObject = [[class alloc] initWithFrame: [customView frame]]; } else { NSLog (@"Class %@ not linked into application!", customView->className); } return customView->realObject; return customView; } - (id)nibInstantiate { return realObject; } - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [archiver encodeString: className withName: @"className"]; [archiver encodeRect: [self frame] withName: @"frame"]; if (realObject) { [archiver encodeObject:realObject withName:@"realObject"]; } if (extension) { [archiver encodeObject:extension withName:@"extension"]; } } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { return self; } @end gnustep-gui-0.24.0/Model/test.gmodel0000664000076500007650000005434710377004044017166 0ustar brains99brains99{ "Object 1" = { elements = ("Object 2", "Object 31", "Object 55", "Object 56"); isa = NSMutableArray; }; "Object 2" = {className = NSApplication; isa = IMCustomObject; realObject = "Object 3"; }; "Object 3" = { delegate = nil; isa = NSApplication; keyWindow = nil; mainMenu = "Object 34"; mainWindow = nil; windows = "Object 4"; }; "Object 4" = { elements = ("Object 5", "Object 9", "Object 11", "Object 32"); isa = NSMutableArray; }; "Object 5" = { backgroundColor = "Object 8"; backingType = 0; contentView = "Object 6"; frame = "{x = 0; y = 0; width = 256; height = 128}"; frameAutosaveName = nil; hidesOnDeactivate = NO; isAutodisplay = NO; isReleasedWhenClosed = NO; isVisible = NO; isa = NSWindow; level = 0; maxSize = "{width = 16000.0; height = 16000.0}"; minSize = "{width = 0; height = 0}"; representedFilename = ""; styleMask = 0; title = ""; }; "Object 6" = { autoresizesSubviews = YES; autoresizingMask = 0; bounds = "{x = 0; y = 0; width = 256; height = 128}"; frame = "{x = 0; y = 0; width = 256; height = 128}"; isa = NSView; nextResponder = "Object 5"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; subviews = "Object 7"; superview = nil; }; "Object 7" = {elements = (); isa = NSMutableArray; }; "Object 8" = { alpha = 1.000000; blue = 0.666667; brightness = 0.666667; colorSpaceName = NSCalibratedRGBColorSpace; green = 0.666667; hue = 0.000000; isa = NSColor; red = 0.666667; saturation = 0.000000; }; "Object 9" = { backgroundColor = "Object 8"; backingType = 0; contentView = "Object 10"; frame = "{x = 100; y = 100; width = 193; height = 208}"; frameAutosaveName = nil; hidesOnDeactivate = NO; isAutodisplay = NO; isReleasedWhenClosed = NO; isVisible = NO; isa = NSWindow; level = 0; maxSize = "{width = 16000.0; height = 16000.0}"; minSize = "{width = 0; height = 0}"; representedFilename = ""; styleMask = 0; title = ""; }; "Object 10" = { autoresizesSubviews = YES; autoresizingMask = 0; bounds = "{x = 0; y = 0; width = 193; height = 208}"; frame = "{x = 0; y = 0; width = 193; height = 208}"; isa = NSView; nextResponder = "Object 9"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; subviews = "Object 7"; superview = nil; }; "Object 11" = { backgroundColor = "Object 8"; backingType = 2; contentView = "Object 12"; frame = "{x = 100; y = 100; width = 422; height = 304}"; frameAutosaveName = nil; hidesOnDeactivate = NO; isAutodisplay = YES; isReleasedWhenClosed = NO; isVisible = YES; isa = NSWindow; level = 0; maxSize = "{width = 16000.0; height = 16000.0}"; minSize = "{width = 0; height = 0}"; representedFilename = ""; styleMask = 14; title = "My Window"; }; "Object 12" = { autoresizesSubviews = NO; autoresizingMask = 0; bounds = "{x = 0; y = 0; width = 420; height = 272}"; frame = "{x = 1; y = 9; width = 420; height = 272}"; isa = NSView; nextResponder = "Object 11"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; subviews = "Object 13"; superview = nil; }; "Object 13" = { elements = ( "Object 14", "Object 16", "Object 17", "Object 18", "Object 19", "Object 20", "Object 21", "Object 24", "Object 27", "Object 30", "Object 31" ); isa = NSMutableArray; }; "Object 14" = { alignment = 2; alternateImage = nil; alternateTitle = Alternate; autoresizesSubviews = NO; autoresizingMask = 0; bounds = "{x = 0; y = 0; width = 114; height = 24}"; delay = 0.200000; font = "Object 15"; frame = "{x = 16; y = 148; width = 114; height = 24}"; highlightsBy = 12; ignoresMultiClick = NO; image = nil; imagePosition = 0; interval = 0.025000; isBordered = YES; isContinuous = NO; isEnabled = YES; isTransparent = NO; isa = NSButton; keyEquivalent = ""; nextResponder = "Object 12"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; showsStateBy = 0; state = 0; subviews = "Object 7"; superview = "Object 12"; tag = 0; title = "Momentary Light"; }; "Object 15" = {isa = NSFont; name = Helvetica; size = 12.000000; }; "Object 16" = { alignment = 2; alternateImage = nil; alternateTitle = Alternate; autoresizesSubviews = NO; autoresizingMask = 0; bounds = "{x = 0; y = 0; width = 114; height = 24}"; delay = 0.200000; font = "Object 15"; frame = "{x = 16; y = 232; width = 114; height = 24}"; highlightsBy = 14; ignoresMultiClick = NO; image = nil; imagePosition = 0; interval = 0.025000; isBordered = YES; isContinuous = NO; isEnabled = YES; isTransparent = NO; isa = NSButton; keyEquivalent = ""; nextResponder = "Object 12"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; showsStateBy = 0; state = 0; subviews = "Object 7"; superview = "Object 12"; tag = 0; title = "Momentary Push"; }; "Object 17" = { alignment = 2; alternateImage = nil; alternateTitle = Alternate; autoresizesSubviews = NO; autoresizingMask = 0; bounds = "{x = 0; y = 0; width = 114; height = 24}"; delay = 0.200000; font = "Object 15"; frame = "{x = 16; y = 190; width = 114; height = 24}"; highlightsBy = 1; ignoresMultiClick = NO; image = nil; imagePosition = 0; interval = 0.025000; isBordered = YES; isContinuous = NO; isEnabled = YES; isTransparent = NO; isa = NSButton; keyEquivalent = ""; nextResponder = "Object 12"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; showsStateBy = 0; state = 0; subviews = "Object 7"; superview = "Object 12"; tag = 0; title = "Momentary change"; }; "Object 18" = { alignment = 2; alternateImage = nil; alternateTitle = Alternate; autoresizesSubviews = NO; autoresizingMask = 0; bounds = "{x = 0; y = 0; width = 114; height = 24}"; delay = 0.200000; font = "Object 15"; frame = "{x = 17; y = 106; width = 114; height = 24}"; highlightsBy = 14; ignoresMultiClick = NO; image = nil; imagePosition = 0; interval = 0.025000; isBordered = YES; isContinuous = NO; isEnabled = YES; isTransparent = NO; isa = NSButton; keyEquivalent = ""; nextResponder = "Object 12"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; showsStateBy = 12; state = 0; subviews = "Object 7"; superview = "Object 12"; tag = 0; title = PushOn/PushOff; }; "Object 19" = { alignment = 2; alternateImage = nil; alternateTitle = Alternate; autoresizesSubviews = NO; autoresizingMask = 0; bounds = "{x = 0; y = 0; width = 114; height = 24}"; delay = 0.200000; font = "Object 15"; frame = "{x = 15; y = 64; width = 114; height = 24}"; highlightsBy = 12; ignoresMultiClick = NO; image = nil; imagePosition = 0; interval = 0.025000; isBordered = YES; isContinuous = NO; isEnabled = YES; isTransparent = NO; isa = NSButton; keyEquivalent = ""; nextResponder = "Object 12"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; showsStateBy = 12; state = 0; subviews = "Object 7"; superview = "Object 12"; tag = 0; title = On/Off; }; "Object 20" = { alignment = 2; alternateImage = nil; alternateTitle = Alternate; autoresizesSubviews = NO; autoresizingMask = 0; bounds = "{x = 0; y = 0; width = 114; height = 24}"; delay = 0.200000; font = "Object 15"; frame = "{x = 16; y = 22; width = 114; height = 24}"; highlightsBy = 3; ignoresMultiClick = NO; image = nil; imagePosition = 0; interval = 0.025000; isBordered = YES; isContinuous = NO; isEnabled = YES; isTransparent = NO; isa = NSButton; keyEquivalent = ""; nextResponder = "Object 12"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; showsStateBy = 1; state = 0; subviews = "Object 7"; superview = "Object 12"; tag = 0; title = Toggle; }; "Object 21" = { alignment = 0; alternateImage = "Object 23"; alternateTitle = Alternate; autoresizesSubviews = NO; autoresizingMask = 0; bounds = "{x = 0; y = 0; width = 109; height = 15}"; delay = 0.200000; font = "Object 15"; frame = "{x = 204; y = 216; width = 109; height = 15}"; highlightsBy = 3; ignoresMultiClick = NO; image = "Object 22"; imagePosition = 2; interval = 0.025000; isBordered = NO; isContinuous = NO; isEnabled = YES; isTransparent = NO; isa = NSButton; keyEquivalent = ""; nextResponder = "Object 12"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; showsStateBy = 1; state = 0; subviews = "Object 7"; superview = "Object 12"; tag = 0; title = Switch; }; "Object 22" = {isa = NSImage; name = NSSwitch; size = "{width = 15; height = 15}"; }; "Object 23" = { isa = NSImage; name = NSHighlightedSwitch; size = "{width = 15; height = 15}"; }; "Object 24" = { alignment = 2; autoresizesSubviews = NO; autoresizingMask = 0; backgroundColor = "Object 8"; bounds = "{x = 0; y = 0; width = 132; height = 26}"; delegate = nil; drawsBackground = NO; errorAction = nil; font = "Object 25"; frame = "{x = 193; y = 167; width = 132; height = 26}"; ignoresMultiClick = NO; isBezeled = NO; isBordered = YES; isContinuous = NO; isEditable = YES; isEnabled = YES; isScrollable = YES; isSelectable = YES; isa = NSTextField; nextResponder = "Object 12"; nextText = "Object 18"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; previousText = "Object 14"; stringValue = Title; subviews = "Object 7"; superview = "Object 12"; tag = 0; textColor = "Object 26"; }; "Object 25" = {isa = NSFont; name = Helvetica; size = 18.000000; }; "Object 26" = { alpha = 1.000000; blue = 0.000000; brightness = 0.000000; colorSpaceName = NSCalibratedRGBColorSpace; green = 0.000000; hue = 0.000000; isa = NSColor; red = 0.000000; saturation = 0.000000; }; "Object 27" = { alignment = 2; autoresizesSubviews = NO; autoresizingMask = 0; backgroundColor = "Object 29"; bounds = "{x = 0; y = 0; width = 214; height = 21}"; delegate = nil; drawsBackground = YES; errorAction = nil; font = "Object 15"; frame = "{x = 172; y = 108; width = 214; height = 21}"; ignoresMultiClick = NO; isBezeled = YES; isBordered = NO; isContinuous = NO; isEditable = YES; isEnabled = YES; isScrollable = YES; isSelectable = YES; isa = NSTextField; nextResponder = "Object 12"; nextText = "Object 19"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; previousText = "Object 18"; stringValue = Text; subviews = "Object 7"; superview = "Object 12"; tag = 0; textColor = "Object 28"; }; "Object 28" = { alpha = 1.000000; blue = 0.000000; brightness = 0.000000; colorSpaceName = NSCalibratedRGBColorSpace; green = 0.000000; hue = 0.000000; isa = NSColor; red = 0.000000; saturation = 0.000000; }; "Object 29" = { alpha = 1.000000; blue = 1.000000; brightness = 1.000000; colorSpaceName = NSCalibratedRGBColorSpace; green = 1.000000; hue = 0.000000; isa = NSColor; red = 1.000000; saturation = 0.000000; }; "Object 30" = {isa = NSPopUpButton; pullsDown = NO; }; "Object 31" = {className = MyView; isa = NSView; }; "Object 32" = { backgroundColor = "Object 8"; backingType = 2; contentView = "Object 33"; frame = "{x = 178; y = 312; width = 370; height = 357}"; frameAutosaveName = nil; hidesOnDeactivate = NO; isAutodisplay = YES; isReleasedWhenClosed = NO; isVisible = NO; isa = NSWindow; level = 0; maxSize = "{width = 16000.0; height = 16000.0}"; minSize = "{width = 0; height = 0}"; representedFilename = ""; styleMask = 14; title = Window; }; "Object 33" = { autoresizesSubviews = NO; autoresizingMask = 0; bounds = "{x = 0; y = 0; width = 368; height = 325}"; frame = "{x = 1; y = 9; width = 368; height = 325}"; isa = NSView; nextResponder = "Object 32"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; subviews = "Object 7"; superview = nil; }; "Object 34" = { autoenablesItems = YES; isa = NSMenu; itemArray = "Object 35"; title = test; }; "Object 35" = { elements = ("Object 36", "Object 42", "Object 53", "Object 54"); isa = NSMutableArray; }; "Object 36" = { action = "submenuAction:"; isEnabled = YES; isa = NSMenuItem; keyEquivalent = ""; tag = 0; target = "Object 37"; title = Info; }; "Object 37" = { autoenablesItems = YES; isa = NSMenu; itemArray = "Object 38"; title = Info; }; "Object 38" = { elements = ("Object 39", "Object 40", "Object 41"); isa = NSMutableArray; }; "Object 39" = { action = nil; isEnabled = NO; isa = NSMenuItem; keyEquivalent = ""; tag = 0; target = nil; title = "Info Panel..."; }; "Object 40" = { action = nil; isEnabled = NO; isa = NSMenuItem; keyEquivalent = ""; tag = 0; target = nil; title = Preferences...; }; "Object 41" = { action = nil; isEnabled = YES; isa = NSMenuItem; keyEquivalent = "?"; tag = 0; target = nil; title = Help...; }; "Object 42" = { action = "submenuAction:"; isEnabled = YES; isa = NSMenuItem; keyEquivalent = ""; tag = 0; target = "Object 43"; title = Document; }; "Object 43" = { autoenablesItems = YES; isa = NSMenu; itemArray = "Object 44"; title = Document; }; "Object 44" = { elements = ( "Object 45", "Object 46", "Object 47", "Object 48", "Object 49", "Object 50", "Object 51", "Object 52" ); isa = NSMutableArray; }; "Object 45" = { action = nil; isEnabled = NO; isa = NSMenuItem; keyEquivalent = o; tag = 0; target = nil; title = Open...; }; "Object 46" = { action = nil; isEnabled = NO; isa = NSMenuItem; keyEquivalent = n; tag = 0; target = nil; title = New; }; "Object 47" = { action = nil; isEnabled = NO; isa = NSMenuItem; keyEquivalent = s; tag = 0; target = nil; title = Save; }; "Object 48" = { action = nil; isEnabled = NO; isa = NSMenuItem; keyEquivalent = S; tag = 0; target = nil; title = "Save As..."; }; "Object 49" = { action = nil; isEnabled = NO; isa = NSMenuItem; keyEquivalent = ""; tag = 0; target = nil; title = "Save To..."; }; "Object 50" = { action = nil; isEnabled = NO; isa = NSMenuItem; keyEquivalent = ""; tag = 0; target = nil; title = "Save All"; }; "Object 51" = { action = nil; isEnabled = NO; isa = NSMenuItem; keyEquivalent = ""; tag = 0; target = nil; title = "Revert to Saved"; }; "Object 52" = { action = nil; isEnabled = NO; isa = NSMenuItem; keyEquivalent = ""; tag = 0; target = nil; title = Close; }; "Object 53" = { action = nil; isEnabled = YES; isa = NSMenuItem; keyEquivalent = h; tag = 0; target = nil; title = Hide; }; "Object 54" = { action = nil; isEnabled = YES; isa = NSMenuItem; keyEquivalent = q; tag = 0; target = nil; title = Quit; }; "Object 55" = {className = Controller; isa = IMCustomObject; }; "Object 56" = {className = NSFontManager; isa = IMCustomObject; }; "Object 57" = { elements = ( "Object 58", "Object 60", "Object 62", "Object 64", "Object 66", "Object 67", "Object 68", "Object 69", "Object 70", "Object 71", "Object 72" ); isa = NSMutableArray; }; "Object 58" = { destination = "Object 2"; isa = IMControlConnector; label = "Object 59"; source = "Object 54"; }; "Object 59" = {isa = NSString; string = "terminate:"; }; "Object 60" = { destination = "Object 2"; isa = IMControlConnector; label = "Object 61"; source = "Object 53"; }; "Object 61" = {isa = NSString; string = "hide:"; }; "Object 62" = { destination = "Object 27"; isa = IMOutletConnector; label = "Object 63"; source = "Object 55"; }; "Object 63" = {isa = NSString; string = textField; }; "Object 64" = { destination = "Object 55"; isa = IMControlConnector; label = "Object 65"; source = "Object 16"; }; "Object 65" = {isa = NSString; string = "buttonPressed:"; }; "Object 66" = { destination = "Object 55"; isa = IMControlConnector; label = "Object 65"; source = "Object 17"; }; "Object 67" = { destination = "Object 55"; isa = IMControlConnector; label = "Object 65"; source = "Object 14"; }; "Object 68" = { destination = "Object 55"; isa = IMControlConnector; label = "Object 65"; source = "Object 18"; }; "Object 69" = { destination = "Object 55"; isa = IMControlConnector; label = "Object 65"; source = "Object 19"; }; "Object 70" = { destination = "Object 55"; isa = IMControlConnector; label = "Object 65"; source = "Object 20"; }; "Object 71" = { destination = "Object 55"; isa = IMControlConnector; label = "Object 65"; source = "Object 21"; }; "Object 72" = { destination = "Object 55"; isa = IMOutletConnector; label = "Object 73"; source = "Object 2"; }; "Object 73" = {isa = NSString; string = delegate; }; RootObject = {Connections = "Object 57"; Objects = "Object 1"; isa = GMModel; }; TopLevelObjects = (RootObject); Version = 1; } gnustep-gui-0.24.0/Model/IBClasses.h0000664000076500007650000000472511023376255016777 0ustar brains99brains99/* IBClasses.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: November 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* This is a list of classes used internally by the NeXT's NIB stuff. These classes were generated using the class-dump utility. */ #ifndef _GNUstep_H_IBClasses #define _GNUstep_H_IBClasses #ifndef GNUSTEP #include #else #include #endif @class NSString; @interface NSCustomObject : NSObject { NSString *className; id realObject; id extension; } @end @interface NSCustomView : NSView { id className; id realObject; id extension; } - (id)nibInstantiate; @end @interface NSIBConnector : NSObject { id source; id destination; NSString *label; } @end @interface NSIBOutletConnector : NSIBConnector @end @interface NSIBControlConnector : NSIBConnector @end /* Classes used internally by NeXT's AppKit we don't want to appear in the model file */ @interface NSWindowTemplate : NSObject { NSRect windowRect; int windowStyleMask; int windowBacking; id windowTitle; id viewClass; id windowClass; id windowView; id realObject; id extension; NSSize minSize; BOOL _wtFlags; /* Don't know the type of this ivar */ NSRect screenRect; } @end @interface NSMenuTemplate : NSObject { NSString *title; NSPoint location; id view; NSString *menuClassName; id supermenu; id realObject; id extension; BOOL isWindowsMenu; BOOL isRequestMenu; BOOL isFontMenu; char interfaceStyle; char *cMenuClassName; } @end #endif /* _GNUstep_H_IBClasses */ gnustep-gui-0.24.0/Model/IMConnectors.m0000664000076500007650000001153311023376255017532 0ustar brains99brains99/* IMConnectors.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: November 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #ifndef NeXT_Foundation_LIBRARY #include #endif #include #include #include #include "GNUstepGUI/IMCustomObject.h" #include "IMConnectors.h" @implementation IMConnector - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [archiver encodeObject:source withName:@"source"]; [archiver encodeObject:destination withName:@"destination"]; [archiver encodeObject:label withName:@"label"]; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { source = [unarchiver decodeObjectWithName:@"source"]; destination = [unarchiver decodeObjectWithName:@"destination"]; label = [unarchiver decodeObjectWithName:@"label"]; return self; } - (id)source { return source; } - (id)destination { return destination; } - (id)label { return label; } @end /* IMConnector */ @implementation IMControlConnector:IMConnector - (void)establishConnection { id _source = [source nibInstantiate]; id _destination = [destination nibInstantiate]; SEL action = NSSelectorFromString (label); if ([_source respondsToSelector:@selector(setTarget:)]) { // NSLog (@"%@: setting target to %@", _source, _destination); [_source setTarget:_destination]; } #ifndef NeXT_Foundation_LIBRARY else { const char *type; unsigned int size; int offset; /* * Use the GNUstep additional function to set the instance * variable directly. */ if (GSObjCFindVariable(_source, "target", &type, &size, &offset)) { GSObjCSetVariable(_source, offset, size, (void*)&_destination); } } #endif if ([_source respondsToSelector:@selector(setAction:)]) { // NSLog (@"%@: setting action to %@", // _source, NSStringFromSelector(action)); [_source setAction:action]; } #ifndef NeXT_Foundation_LIBRARY else { const char *type; unsigned int size; int offset; /* * Use the GNUstep additional function to set the instance * variable directly. * FIXME - need some way to do this for libFoundation and * Foundation based systems. */ if (GSObjCFindVariable(_source, "action", &type, &size, &offset)) { GSObjCSetVariable(_source, offset, size, (void*)&action); } } #endif } @end /* IMControlConnector:IMConnector */ @implementation IMOutletConnector - (void)establishConnection { id _source = [source nibInstantiate]; id _destination = [destination nibInstantiate]; NSString* setMethodName; SEL setSelector; if ([label length] > 1) { setMethodName = [[[label substringToIndex: 1] capitalizedString] stringByAppendingString: [label substringFromIndex: 1]]; setMethodName = [[@"set" stringByAppendingString: setMethodName] stringByAppendingString:@":"]; } else setMethodName = [[@"set" stringByAppendingString: [label capitalizedString]] stringByAppendingString:@":"]; setSelector = NSSelectorFromString (setMethodName); // NSLog (@"establish connection: source %@, destination %@, label %@", // _source, _destination, label); // NSLog (@"Method Name: %@", setMethodName); if (setSelector && [_source respondsToSelector:setSelector]) { [_source performSelector:setSelector withObject:_destination]; } #ifndef NeXT_Foundation_LIBRARY else { const char *nam = [label cString]; const char *type; unsigned int size; int offset; /* * Use the GNUstep additional function to set the instance * variable directly. * FIXME - need some way to do this for libFoundation and * Foundation based systems. */ if (GSObjCFindVariable(_source, nam, &type, &size, &offset)) { GSObjCSetVariable(_source, offset, size, (void*)&_destination); } } #endif } @end /* IMOutletConnector */ gnustep-gui-0.24.0/Model/Translator.h0000664000076500007650000000264411023376255017316 0ustar brains99brains99/* Translator.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: November 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_Translator #define _GNUstep_H_Translator #ifndef GNUSTEP #include #else #include #endif @class NSMutableArray; extern NSMutableArray* objects; extern NSMutableArray* connections; @interface Translator : NSObject { NSString* gmodelFile; } - (void)translateNibFile:(NSString*)nibFile toModelFile:(NSString*)gmodelFile; @end #endif /* _GNUstep_H_Translator */ gnustep-gui-0.24.0/Model/IMLoading.m0000664000076500007650000001324511531457135016775 0ustar brains99brains99/* IMLoading.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: November 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef GNUSTEP #include #else #include #include #include #include #endif #include "GNUstepGUI/GMArchiver.h" #include "GNUstepGUI/IMLoading.h" #include "GNUstepGUI/IMCustomObject.h" /* For awakeFromNib */ #include void __dummy_IMLoading_functionForLinking() { __dummy_IMLoading_functionForLinking(); } @implementation GMModel id _nibOwner = nil; BOOL _fileOwnerDecoded = NO; + (void)initialize { /* Force linking of AppKit GModel categories */ extern void __dummy_GMAppKit_functionForLinking(); __dummy_GMAppKit_functionForLinking (); } + (BOOL)loadIMFile:(NSString*)path owner:(id)owner { return [self loadIMFile:path owner:owner bundle:[NSBundle mainBundle]]; } + (BOOL)loadIMFile:(NSString*)path owner:(id)owner bundle:(NSBundle*)mainBundle { #ifdef GNU_GUI_LIBRARY NSString* resourcePath = [mainBundle resourcePath]; GMUnarchiver* unarchiver; id previousNibOwner = _nibOwner; GMModel* decoded; if (![[path pathExtension] isEqualToString:@"gmodel"]) { path = [path stringByAppendingPathExtension:@"gmodel"]; } /* First check to see if path is an absolute path; if so try to load the pointed file. */ if ([path isAbsolutePath]) { if (![[NSFileManager defaultManager] fileExistsAtPath:path]) { /* The file is an absolute path name but the model file doesn't exist. */ return NO; } } else { /* The path is a relative path; search it in the current bundle. */ NSString *abspath = [resourcePath stringByAppendingPathComponent:path]; if (![[NSFileManager defaultManager] fileExistsAtPath:abspath]) { NSArray *paths; NSString *root; paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSSystemDomainMask, YES); if ((paths != nil) && ([paths count] > 0)) { root = [paths objectAtIndex: 0]; root = [root stringByAppendingPathComponent:@"Model"]; abspath = [root stringByAppendingPathComponent:path]; if (![[NSFileManager defaultManager] fileExistsAtPath:abspath]) { return NO; } } else { return NO; } } path = abspath; } NSLog (@"loading model file %@...", path); unarchiver = [GMUnarchiver unarchiverWithContentsOfFile:path]; if (!unarchiver) { return NO; } /* Set the _nibOwner to `owner' so that the first decoded custom object replaces itself with `owner'. Also set _fileOwnerDecoded so that the first custom object knows it's the first. */ _nibOwner = owner; _fileOwnerDecoded = NO; decoded = [unarchiver decodeObjectWithName:@"RootObject"]; [decoded _makeConnections]; /* Restore the previous nib owner. We do this because loadIMFile:owner: can be invoked recursively. */ _nibOwner = previousNibOwner; #endif return YES; } - (void)_makeConnections { int i, count; #ifdef __APPLE__ [connections makeObjectsPerformSelector:@selector(establishConnection)]; #else [connections makeObjectsPerform:@selector(establishConnection)]; #endif /* Send the -awakeFromModel method */ for (i = 0, count = [objects count]; i < count; i++) { id object = [[objects objectAtIndex:i] nibInstantiate]; // If the object responds to the awakeFromModel // method, send that message. If it doesn't then // check for the awakeFromNib selector and send that. // This ensures compatibility w/ apps ported from OPENSTEP. if ([object respondsToSelector:@selector(awakeFromModel)]) { [object awakeFromModel]; } else if ([object respondsToSelector:@selector(awakeFromNib)]) { [object awakeFromNib]; } } } - (void)dealloc { [objects release]; [connections release]; [super dealloc]; } - (void)_setObjects:_objects connections:_connections { objects = [_objects retain]; connections = [_connections retain]; } - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [archiver encodeObject:objects withName:@"Objects"]; [archiver encodeObject:connections withName:@"Connections"]; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { objects = [[unarchiver decodeObjectWithName:@"Objects"] retain]; connections = [[unarchiver decodeObjectWithName:@"Connections"] retain]; return self; } - (NSArray *) objects { return objects; } - (NSArray *) connections { return connections; } @end /* GMModel */ #if GNU_RUNTIME #include "IMConnectors.h" __attribute__((unused)) static void __dummyFunctionForLinking (void) { [IMCustomObject new]; [IMConnector new]; __dummyFunctionForLinking(); } #endif gnustep-gui-0.24.0/Model/GNUmakefile.postamble0000664000076500007650000000233711335045223021044 0ustar brains99brains99# GNUmakefile.postamble # # Copyright (C) 1996 Free Software Foundation, Inc. # # Author: Ovidiu Predescu # Date: January 1998 # # This file is part of the GNUstep GUI Library. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. before-libgmodel-all:: \ $(addprefix ../Headers/Additions/GNUstepGUI/, $(libgmodel_HEADER_FILES)) ../Headers/Additions/GNUstepGUI/%.h: %.h cp $^ $@ # Additional dependencies $(GNUSTEP_OBJ_DIR)/GMArchiver.o: GMArchiveObjects.m gnustep-gui-0.24.0/Model/GMAppKit.m0000664000076500007650000017347211357044577016627 0ustar brains99brains99/* GMAppKit.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: November 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import "GNUstepGUI/GMAppKit.h" #ifndef AUTORELEASE #define AUTORELEASE(object) [object autorelease] #define RELEASE(object) [object release] #define RETAIN(object) [object retain] #endif void __dummy_GMAppKit_functionForLinking() {} @implementation NSApplication (GMArchiverMethods) - (void)encodeWithModelArchiver:(GMArchiver*)archiver { #ifndef GNU_GUI_LIBRARY NSArray* windows1 = [self windows]; NSMutableArray* windows2 = [NSMutableArray array]; int i, count = [windows1 count]; for (i = 0; i < count; i++) { NSWindow* window = [windows1 objectAtIndex:i]; if (([window isKindOfClass:[NSMenu class]] == NO) && ([NSStringFromClass ([window class]) isEqualToString: @"NSMenuPanel"] == NO)) [windows2 addObject:window]; } [archiver encodeObject:windows2 withName:@"windows"]; #else [archiver encodeObject:[self windows] withName:@"windows"]; #endif [archiver encodeObject:[self keyWindow] withName:@"keyWindow"]; [archiver encodeObject:[self mainWindow] withName:@"mainWindow"]; [archiver encodeObject:[self mainMenu] withName:@"mainMenu"]; [archiver encodeObject:[self delegate] withName:@"delegate"]; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { NSArray* windows; NSEnumerator *enumerator; NSWindow *win; NSWindow* keyWindow; NSWindow* mainWindow; NSMenu* mainMenu; id anObject; #if GNU_GUI_LIBRARY mainMenu = [unarchiver decodeObjectWithName:@"mainMenu"]; if (mainMenu) [self setMainMenu:mainMenu]; #endif windows = [unarchiver decodeObjectWithName:@"windows"]; enumerator = [windows objectEnumerator]; while ((win = [enumerator nextObject]) != nil) { /* If we did not retain the windows here, they would all get released at the end of the event loop. */ RETAIN (win); } keyWindow = [unarchiver decodeObjectWithName:@"keyWindow"]; mainWindow = [unarchiver decodeObjectWithName:@"mainWindow"]; anObject = [unarchiver decodeObjectWithName:@"delegate"]; if (anObject) [self setDelegate:anObject]; #ifndef GNU_GUI_LIBRARY mainMenu = [unarchiver decodeObjectWithName:@"mainMenu"]; if (mainMenu) [self setMainMenu:mainMenu]; #endif [keyWindow makeKeyWindow]; [mainWindow makeMainWindow]; return self; } - (void)awakeFromModel { NSMenu* mainMenu = [self mainMenu]; [mainMenu update]; #if XDPS_BACKEND_LIBRARY || XRAW_BACKEND_LIBRARY || XGPS_BACKEND_LIBRARY [mainMenu display]; #endif } + (id)createObjectForModelUnarchiver:(GMUnarchiver*)unarchiver { return [NSApplication sharedApplication]; } @end /* NSApplication (GMArchiverMethods) */ @implementation NSBox (GMArchiverMethods) /* NSBox is very special because it always has a single subview, which is the contentview, and it overrides addSubview: to add subviews to the contentview. Make sure we can manage this case properly and portably. */ - (NSArray *)subviewsForModel { return [NSArray array]; } - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [super encodeWithModelArchiver:archiver]; [archiver encodeSize:[self contentViewMargins] withName:@"contentViewMargins"]; [archiver encodeInt:[self borderType] withName:@"borderType"]; [archiver encodeInt:[self titlePosition] withName:@"titlePosition"]; [archiver encodeString:[self title] withName:@"title"]; [archiver encodeObject:[self titleFont] withName:@"titleFont"]; [archiver encodeObject:[self contentView] withName:@"contentView"]; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { self = [super initWithModelUnarchiver:unarchiver]; [self setContentViewMargins:[unarchiver decodeSizeWithName:@"contentViewMargins"]]; [self setBorderType:[unarchiver decodeIntWithName:@"borderType"]]; [self setTitlePosition:[unarchiver decodeIntWithName:@"titlePosition"]]; [self setTitle:[unarchiver decodeStringWithName:@"title"]]; [self setTitleFont:[unarchiver decodeObjectWithName:@"titleFont"]]; [self setContentView: [unarchiver decodeObjectWithName:@"contentView"]]; return self; } @end /* NSBox (GMArchiverMethods) */ #if 0 @implementation NSButton (GMArchiverMethods) - (void)encodeWithModelArchiver:(GMArchiver*)archiver { float delay, interval; id theCell = [self cell]; [archiver encodeInt:[self state] withName:@"state"]; [self getPeriodicDelay:&delay interval:&interval]; [archiver encodeFloat:delay withName:@"delay"]; [archiver encodeFloat:interval withName:@"interval"]; [archiver encodeString:[self title] withName:@"title"]; [archiver encodeString:[self alternateTitle] withName:@"alternateTitle"]; [archiver encodeObject:[self image] withName:@"image"]; [archiver encodeObject:[self alternateImage] withName:@"alternateImage"]; [archiver encodeInt:[self imagePosition] withName:@"imagePosition"]; [archiver encodeBOOL:[self isBordered] withName:@"isBordered"]; [archiver encodeBOOL:[self isTransparent] withName:@"isTransparent"]; [archiver encodeString:[self keyEquivalent] withName:@"keyEquivalent"]; [archiver encodeInt:[theCell highlightsBy] withName:@"highlightsBy"]; [archiver encodeInt:[theCell showsStateBy] withName:@"showsStateBy"]; [super encodeWithModelArchiver:archiver]; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { float delay, interval; id theCell; self = [super initWithModelUnarchiver:unarchiver]; [self setState:[unarchiver decodeIntWithName:@"state"]]; delay = [unarchiver decodeFloatWithName:@"delay"]; interval = [unarchiver decodeFloatWithName:@"interval"]; [self setPeriodicDelay:delay interval:interval]; [self setTitle:[unarchiver decodeStringWithName:@"title"]]; [self setAlternateTitle:[unarchiver decodeStringWithName:@"alternateTitle"]]; [self setImage:[unarchiver decodeObjectWithName:@"image"]]; [self setAlternateImage:[unarchiver decodeObjectWithName:@"alternateImage"]]; [self setImagePosition:[unarchiver decodeIntWithName:@"imagePosition"]]; [self setBordered:[unarchiver decodeBOOLWithName:@"isBordered"]]; [self setTransparent:[unarchiver decodeBOOLWithName:@"isTransparent"]]; [self setKeyEquivalent:[unarchiver decodeStringWithName:@"keyEquivalent"]]; theCell = [self cell]; [theCell setHighlightsBy:[unarchiver decodeIntWithName:@"highlightsBy"]]; [theCell setShowsStateBy:[unarchiver decodeIntWithName:@"showsStateBy"]]; return self; } @end /* NSButton (GMArchiverMethods) */ #endif @implementation NSCell (GMArchiverMethods) - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [archiver encodeInt:[self type] withName:@"type"]; [archiver encodeObject:[self font] withName:@"font"]; [archiver encodeString:[self stringValue] withName:@"stringValue"]; [archiver encodeInt:[self entryType] withName:@"entryType"]; [archiver encodeInt:[self alignment] withName:@"alignment"]; [archiver encodeBOOL:[self wraps] withName:@"wraps"]; [archiver encodeObject:[self image] withName:@"image"]; [archiver encodeInt:[self state] withName:@"state"]; [archiver encodeBOOL:[self isEnabled] withName:@"isEnabled"]; [archiver encodeBOOL:[self isBordered] withName:@"isBordered"]; [archiver encodeBOOL:[self isBezeled] withName:@"isBezeled"]; [archiver encodeBOOL:[self isEditable] withName:@"isEditable"]; [archiver encodeBOOL:[self isSelectable] withName:@"isSelectable"]; [archiver encodeBOOL:[self isScrollable] withName:@"isScrollable"]; [archiver encodeBOOL:[self isContinuous] withName:@"isContinuous"]; [archiver encodeInt:[self sendActionOn: 0] withName:@"sendActionMask"]; { /* NB: this is not decoded so maybe we could just do without encoding it. :-) */ int actionMask = [self sendActionOn: 0]; [archiver encodeInt:actionMask withName:@"sendActionMask"]; [self sendActionOn: actionMask]; } } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { int cellType = [unarchiver decodeIntWithName:@"type"]; NSFont* font = [unarchiver decodeObjectWithName:@"font"]; // this is a tricky object to decode, because a number of its methods // have side-effects; [-setEntryType:] converts the cell to a text-type // cell and sets its font to the system font, so it comes first [self setEntryType:[unarchiver decodeIntWithName:@"entryType"]]; // now set the font [self setFont:font]; // both [-setImage:] and [-setStringValue:] convert the cell to an // image or text cell (respectively), so they must be called in the // correct order for the type of cell desired switch (cellType) { case NSTextCellType: [self setImage:[unarchiver decodeObjectWithName:@"image"]]; [self setStringValue: [unarchiver decodeStringWithName:@"stringValue"]]; break; case NSImageCellType: [self setStringValue: [unarchiver decodeStringWithName:@"stringValue"]]; [self setImage:[unarchiver decodeObjectWithName:@"image"]]; break; case NSNullCellType: [self setType: NSNullCellType]; break; } [self setAlignment:[unarchiver decodeIntWithName:@"alignment"]]; [self setWraps:[unarchiver decodeBOOLWithName:@"wraps"]]; [self setState:[unarchiver decodeIntWithName:@"state"]]; [self setEnabled:[unarchiver decodeBOOLWithName:@"isEnabled"]]; [self setBordered:[unarchiver decodeBOOLWithName:@"isBordered"]]; [self setBezeled:[unarchiver decodeBOOLWithName:@"isBezeled"]]; [self setEditable:[unarchiver decodeBOOLWithName:@"isEditable"]]; [self setSelectable:[unarchiver decodeBOOLWithName:@"isSelectable"]]; [self setScrollable:[unarchiver decodeBOOLWithName:@"isScrollable"]]; [self setContinuous:[unarchiver decodeBOOLWithName:@"isContinuous"]]; /* Temporary commented out so buttons keep on working - new code * fixing this under testing */ // [self sendActionOn:[unarchiver decodeIntWithName:@"sendActionMask"]]; return self; } @end /* NSCell (GMArchiverMethods) */ @implementation NSActionCell (GMArchiverMethods) - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [super encodeWithModelArchiver:archiver]; [archiver encodeInt:[self tag] withName:@"tag"]; [archiver encodeObject:[self target] withName:@"target"]; [archiver encodeSelector:[self action] withName:@"action"]; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { self = [super initWithModelUnarchiver:unarchiver]; // if (model_version >= 2) { [self setTag:[unarchiver decodeIntWithName:@"tag"]]; [self setTarget:[unarchiver decodeObjectWithName:@"target"]]; [self setAction:[unarchiver decodeSelectorWithName:@"action"]]; // } return self; } @end /* NSActionCell (GMArchiverMethods) */ @implementation NSButtonCell (GMArchiverMethods) - (void)encodeWithModelArchiver:(GMArchiver*)archiver { float delay, interval; [super encodeWithModelArchiver:archiver]; [self getPeriodicDelay:&delay interval:&interval]; [archiver encodeFloat:delay withName:@"delay"]; [archiver encodeFloat:interval withName:@"interval"]; [archiver encodeString:[self title] withName:@"title"]; [archiver encodeString:[self alternateTitle] withName:@"alternateTitle"]; [archiver encodeObject:[self alternateImage] withName:@"alternateImage"]; [archiver encodeInt:[self imagePosition] withName:@"imagePosition"]; [archiver encodeBOOL:[self isTransparent] withName:@"isTransparent"]; [archiver encodeString:[self keyEquivalent] withName:@"keyEquivalent"]; [archiver encodeObject:[self keyEquivalentFont] withName:@"keyEquivalentFont"]; [archiver encodeInt:[self keyEquivalentModifierMask] withName:@"keyEquivalentModifierMask"]; [archiver encodeInt:[self highlightsBy] withName:@"highlightsBy"]; [archiver encodeInt:[self showsStateBy] withName:@"showsStateBy"]; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { float delay, interval; id obj; self = [super initWithModelUnarchiver:unarchiver]; // if (model_version >= 2) { delay = [unarchiver decodeFloatWithName:@"delay"]; interval = [unarchiver decodeFloatWithName:@"interval"]; [self setPeriodicDelay:delay interval:interval]; obj = [unarchiver decodeObjectWithName:@"alternateImage"]; [self setAlternateImage:obj]; [self setImagePosition:[unarchiver decodeIntWithName:@"imagePosition"]]; [self setTransparent:[unarchiver decodeBOOLWithName:@"isTransparent"]]; [self setKeyEquivalent:[unarchiver decodeStringWithName:@"keyEquivalent"]]; [self setKeyEquivalentFont:[unarchiver decodeObjectWithName:@"keyEquivalentFont"]]; [self setKeyEquivalentModifierMask:[unarchiver decodeIntWithName:@"keyEquivalentModifierMask"]]; [self setHighlightsBy:[unarchiver decodeIntWithName:@"highlightsBy"]]; [self setShowsStateBy:[unarchiver decodeIntWithName:@"showsStateBy"]]; obj = [unarchiver decodeStringWithName:@"title"]; if (obj) [self setTitle:obj]; obj = [unarchiver decodeStringWithName:@"alternateTitle"]; if (obj) [self setAlternateTitle:obj]; // } return self; } @end /* NSButtonCell (GMArchiverMethods) */ @implementation NSMatrix (GMArchiverMethods) - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [super encodeWithModelArchiver:archiver]; [archiver encodeInt:[self mode] withName:@"mode"]; [archiver encodeBOOL:[self allowsEmptySelection] withName:@"allowsEmptySelection"]; [archiver encodeBOOL:[self isSelectionByRect] withName:@"isSelectionByRect"]; [archiver encodeBOOL:[self autosizesCells] withName:@"autosizesCells"]; [archiver encodeBOOL:[self isAutoscroll] withName:@"isAutoscroll"]; [archiver encodeSize:[self cellSize] withName:@"cellSize"]; [archiver encodeSize:[self intercellSpacing] withName:@"intercellSpacing"]; [archiver encodeObject:[self backgroundColor] withName:@"backgroundColor"]; [archiver encodeObject:[self cellBackgroundColor] withName:@"cellBackgroundColor"]; [archiver encodeBOOL:[self drawsBackground] withName:@"drawsBackground"]; [archiver encodeBOOL:[self drawsCellBackground] withName:@"drawsCellBackground"]; [archiver encodeClass:[self cellClass] withName:@"cellClass"]; [archiver encodeObject:[self prototype] withName:@"prototype"]; [archiver encodeInt:[self numberOfRows] withName:@"numberOfRows"]; [archiver encodeInt:[self numberOfColumns] withName:@"numberOfColumns"]; [archiver encodeObject:[self cells] withName:@"cells"]; [archiver encodeObject:[self delegate] withName:@"delegate"]; [archiver encodeObject:[self target] withName:@"target"]; [archiver encodeSelector:[self action] withName:@"action"]; [archiver encodeSelector:[self doubleAction] withName:@"doubleAction"]; [archiver encodeSelector:[self errorAction] withName:@"errorAction"]; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { int nr, nc; NSArray *cell_array; int i; id decodedDelegate; self = [super initWithModelUnarchiver:unarchiver]; // if (model_version >= 2) { [self setMode:[unarchiver decodeIntWithName:@"mode"]]; [self setAllowsEmptySelection:[unarchiver decodeBOOLWithName:@"allowsEmptySelection"]]; [self setSelectionByRect:[unarchiver decodeBOOLWithName:@"isSelectionByRect"]]; [self setAutosizesCells:[unarchiver decodeBOOLWithName:@"autosizesCells"]]; [self setAutoscroll:[unarchiver decodeBOOLWithName:@"isAutoscroll"]]; [self setCellSize:[unarchiver decodeSizeWithName:@"cellSize"]]; [self setIntercellSpacing:[unarchiver decodeSizeWithName:@"intercellSpacing"]]; [self setBackgroundColor:[unarchiver decodeObjectWithName:@"backgroundColor"]]; [self setCellBackgroundColor:[unarchiver decodeObjectWithName:@"cellBackgroundColor"]]; [self setDrawsBackground:[unarchiver decodeBOOLWithName:@"drawsBackground"]]; [self setDrawsCellBackground:[unarchiver decodeBOOLWithName:@"drawsCellBackground"]]; [self setCellClass:[unarchiver decodeClassWithName:@"cellClass"]]; [self setPrototype:[unarchiver decodeObjectWithName:@"prototype"]]; nr = [unarchiver decodeIntWithName:@"numberOfRows"]; nc = [unarchiver decodeIntWithName:@"numberOfColumns"]; cell_array = [unarchiver decodeObjectWithName:@"cells"]; [self renewRows:nr columns:nc]; #if GNU_GUI_LIBRARY _selectedRow = _selectedColumn = 0; #endif for (i = 0; (i < [cell_array count]) && (i < nr*nc); i++) { id cell = [cell_array objectAtIndex:i]; [self putCell:cell atRow:i/nc column:i%nc]; if ([cell state]) [self selectCellAtRow:i/nc column:i%nc]; } decodedDelegate = [unarchiver decodeObjectWithName:@"delegate"]; if (decodedDelegate) [self setDelegate:decodedDelegate]; [self setTarget:[unarchiver decodeObjectWithName:@"target"]]; [self setAction:[unarchiver decodeSelectorWithName:@"action"]]; [self setDoubleAction:[unarchiver decodeSelectorWithName:@"doubleAction"]]; [self setErrorAction:[unarchiver decodeSelectorWithName:@"errorAction"]]; [self sizeToCells]; // } return self; } @end /* NSMatrix (GMArchiverMethods) */ @implementation NSScrollView (GMArchiverMethods) // do not encode our subviews in NSView (it would encode the clipview and // the scroller, which are not necessary). - (NSArray *)subviewsForModel { return [NSArray array]; } - (void) encodeWithModelArchiver: (GMArchiver*)archiver { [super encodeWithModelArchiver: archiver]; [archiver encodeObject: [self backgroundColor] withName: @"backgroundColor"]; [archiver encodeInt: [self borderType] withName: @"borderType"]; [archiver encodeBOOL: [self hasHorizontalScroller] withName: @"hasHorizontalScroller"]; [archiver encodeBOOL: [self hasVerticalScroller] withName: @"hasVerticalScroller"]; [archiver encodeObject: [self documentView] withName: @"documentView"]; } - (id) initWithModelUnarchiver: (GMUnarchiver*)unarchiver { self = [super initWithModelUnarchiver: unarchiver]; [self setContentView: AUTORELEASE([NSClipView new])]; [self setBorderType: [unarchiver decodeIntWithName: @"borderType"]]; [self setHasHorizontalScroller: [unarchiver decodeBOOLWithName: @"hasHorizontalScroller"]]; [self setHasVerticalScroller: [unarchiver decodeBOOLWithName: @"hasVerticalScroller"]]; [self setDocumentView: [unarchiver decodeObjectWithName: @"documentView"]]; [self setBackgroundColor: [unarchiver decodeObjectWithName: @"backgroundColor"]]; return self; } @end /* NSScrollView (GMArchiverMethods) */ @implementation NSClipView (GMArchiverMethods) - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [super encodeWithModelArchiver:archiver]; [archiver encodeObject:[self documentView] withName:@"documentView"]; [archiver encodeBOOL:[self copiesOnScroll] withName:@"copiesOnScroll"]; if ([self respondsToSelector: @selector(drawsBackground)]) [archiver encodeBOOL:[self drawsBackground] withName:@"drawsBackground"]; [archiver encodeObject:[self backgroundColor] withName:@"backgroundColor"]; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { self = [super initWithModelUnarchiver:unarchiver]; [self setDocumentView:[unarchiver decodeObjectWithName:@"documentView"]]; [self setCopiesOnScroll:[unarchiver decodeBOOLWithName:@"copiesOnScroll"]]; if ([self respondsToSelector: @selector(setDrawsBackground:)]) [self setDrawsBackground:[unarchiver decodeBOOLWithName:@"drawsBackground"]]; [self setBackgroundColor:[unarchiver decodeObjectWithName:@"backgroundColor"]]; return self; } @end /* NSClipView (GMArchiverMethods) */ @implementation NSColor (GMArchiverMethods) - (void)encodeWithModelArchiver:(GMArchiver*)archiver { NSString* colorSpaceName = [self colorSpaceName]; [archiver encodeString:colorSpaceName withName:@"colorSpaceName"]; if ([colorSpaceName isEqual:@"NSDeviceCMYKColorSpace"]) { [archiver encodeFloat:[self cyanComponent] withName:@"cyan"]; [archiver encodeFloat:[self magentaComponent] withName:@"magenta"]; [archiver encodeFloat:[self yellowComponent] withName:@"yellow"]; [archiver encodeFloat:[self blackComponent] withName:@"black"]; [archiver encodeFloat:[self alphaComponent] withName:@"alpha"]; } else if ([colorSpaceName isEqual:@"NSDeviceWhiteColorSpace"] || [colorSpaceName isEqual:@"NSCalibratedWhiteColorSpace"]) { [archiver encodeFloat:[self whiteComponent] withName:@"white"]; [archiver encodeFloat:[self alphaComponent] withName:@"alpha"]; } else if ([colorSpaceName isEqual:@"NSDeviceRGBColorSpace"] || [colorSpaceName isEqual:@"NSCalibratedRGBColorSpace"]) { [archiver encodeFloat:[self redComponent] withName:@"red"]; [archiver encodeFloat:[self greenComponent] withName:@"green"]; [archiver encodeFloat:[self blueComponent] withName:@"blue"]; [archiver encodeFloat:[self alphaComponent] withName:@"alpha"]; [archiver encodeFloat:[self hueComponent] withName:@"hue"]; [archiver encodeFloat:[self saturationComponent] withName:@"saturation"]; [archiver encodeFloat:[self brightnessComponent] withName:@"brightness"]; } else if ([colorSpaceName isEqual:@"NSNamedColorSpace"]) { [archiver encodeString:[self catalogNameComponent] withName:@"catalogName"]; [archiver encodeString:[self colorNameComponent] withName:@"colorName"]; } else if ([colorSpaceName isEqual:@"NSPatternColorSpace"]) { [archiver encodeObject: [self patternImage] withName: @"patternImage"]; } } + (id)createObjectForModelUnarchiver:(GMUnarchiver*)unarchiver { NSString* colorSpaceName = [unarchiver decodeStringWithName:@"colorSpaceName"]; if ([colorSpaceName isEqual:@"NSDeviceCMYKColorSpace"]) { float cyan = [unarchiver decodeFloatWithName:@"cyan"]; float magenta = [unarchiver decodeFloatWithName:@"magenta"]; float yellow = [unarchiver decodeFloatWithName:@"yellow"]; float black = [unarchiver decodeFloatWithName:@"black"]; float alpha = [unarchiver decodeFloatWithName:@"alpha"]; return [NSColor colorWithDeviceCyan:cyan magenta:magenta yellow:yellow black:black alpha:alpha]; } else if ([colorSpaceName isEqual:@"NSDeviceWhiteColorSpace"]) { float white = [unarchiver decodeFloatWithName:@"white"]; float alpha = [unarchiver decodeFloatWithName:@"alpha"]; return [NSColor colorWithDeviceWhite:white alpha:alpha]; } else if ([colorSpaceName isEqual:@"NSCalibratedWhiteColorSpace"]) { float white = [unarchiver decodeFloatWithName:@"white"]; float alpha = [unarchiver decodeFloatWithName:@"alpha"]; return [NSColor colorWithCalibratedWhite:white alpha:alpha]; } else if ([colorSpaceName isEqual:@"NSDeviceRGBColorSpace"]) { float red = [unarchiver decodeFloatWithName:@"red"]; float green = [unarchiver decodeFloatWithName:@"green"]; float blue = [unarchiver decodeFloatWithName:@"blue"]; float alpha = [unarchiver decodeFloatWithName:@"alpha"]; return [self colorWithDeviceRed:red green:green blue:blue alpha:alpha]; } else if ([colorSpaceName isEqual:@"NSCalibratedRGBColorSpace"]) { float red = [unarchiver decodeFloatWithName:@"red"]; float green = [unarchiver decodeFloatWithName:@"green"]; float blue = [unarchiver decodeFloatWithName:@"blue"]; float alpha = [unarchiver decodeFloatWithName:@"alpha"]; return [self colorWithCalibratedRed:red green:green blue:blue alpha:alpha]; } else if ([colorSpaceName isEqual:@"NSNamedColorSpace"]) { NSString *catalog = [unarchiver decodeStringWithName: @"catalogName"]; NSString *colornm = [unarchiver decodeStringWithName: @"colorName"]; return [self colorWithCatalogName: catalog colorName: colornm]; } else if ([colorSpaceName isEqual:@"NSPatternColorSpace"]) { NSImage *image = [unarchiver decodeObjectWithName: @"patternImage"]; if (image == nil) { NSLog(@"Internal: No can't decode colorspace %@", colorSpaceName); NSLog(@" creating generic white color"); return [NSColor colorWithDeviceWhite: 1.0 alpha: 1.0]; } else return [NSColor colorWithPatternImage: image]; } else { NSLog(@"Internal: No decoder for colorspace %@", colorSpaceName); NSLog(@" creating generic white color"); return [NSColor colorWithDeviceWhite: 1.0 alpha: 1.0]; } return nil; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { return self; } - (Class)classForModelArchiver { return [NSColor class]; } @end /* NSColor (GMArchiverMethods) */ @implementation NSControl (GMArchiverMethods) - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [archiver encodeObject:[self cell] withName:@"cell"]; [archiver encodeBOOL:[self isEnabled] withName:@"isEnabled"]; [archiver encodeInt:[self tag] withName:@"tag"]; [archiver encodeBOOL:[self ignoresMultiClick] withName:@"ignoresMultiClick"]; [super encodeWithModelArchiver:archiver]; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { id decodedCell; self = [super initWithModelUnarchiver:unarchiver]; // if (model_version == 1) { //[self setTarget:[unarchiver decodeObjectWithName:@"target"]]; //[self setAction:[unarchiver decodeSelectorWithName:@"action"]]; //[self setEnabled:[unarchiver decodeBOOLWithName:@"isEnabled"]]; //[self setAlignment:[unarchiver decodeIntWithName:@"alignment"]]; //[self setFont:[unarchiver decodeObjectWithName:@"font"]]; //[self setContinuous:[unarchiver decodeBOOLWithName:@"isContinuous"]]; //[self setTag:[unarchiver decodeIntWithName:@"tag"]]; //[self setIgnoresMultiClick: // [unarchiver decodeBOOLWithName:@"ignoresMultiClick"]]; // } else { { // So that custom NSControls, which do not encode the cell, // can still work. decodedCell = [unarchiver decodeObjectWithName:@"cell"]; if (decodedCell) [self setCell: decodedCell]; else [self setCell: AUTORELEASE([[[self class] cellClass] new])]; } [self setEnabled:[unarchiver decodeBOOLWithName:@"isEnabled"]]; [self setTag:[unarchiver decodeIntWithName:@"tag"]]; [self setIgnoresMultiClick: [unarchiver decodeBOOLWithName:@"ignoresMultiClick"]]; // } return self; } @end /* NSControl (GMArchiverMethods) */ @implementation NSFont (GMArchiverMethods) - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [archiver encodeString:[self fontName] withName:@"name"]; [archiver encodeFloat:[self pointSize] withName:@"size"]; } + (id)createObjectForModelUnarchiver:(GMUnarchiver*)unarchiver { NSFont *f = [NSFont fontWithName:[unarchiver decodeStringWithName:@"name"] size:[unarchiver decodeFloatWithName:@"size"]]; if (!f) f = [NSFont systemFontOfSize: [unarchiver decodeFloatWithName:@"size"]]; return f; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { return self; } @end /* NSFont (GMArchiverMethods) */ @implementation NSImage (GMArchiverMethods) extern id _nibOwner; - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [archiver encodeString:[self name] withName:@"name"]; [archiver encodeSize:[self size] withName:@"size"]; } + (id)createObjectForModelUnarchiver:(GMUnarchiver*)unarchiver { id image = nil; NSString *imageName; imageName = [unarchiver decodeStringWithName:@"name"]; if (imageName) { image = [NSImage imageNamed: imageName]; if (image == nil) { NSBundle *bundle = [NSBundle bundleForClass:[_nibOwner class]]; NSString *path = [bundle pathForImageResource:imageName]; image = [[NSImage alloc] initByReferencingFile:path]; } } if (image == nil) image = [NSImage imageNamed:@"GNUstepMenuImage"]; return image; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { [self setSize:[unarchiver decodeSizeWithName:@"size"]]; return self; } @end /* NSImage (GMArchiverMethods) */ @implementation NSMenuItem (GMArchiverMethods) - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [archiver encodeString:[self title] withName:@"title"]; if ([self hasSubmenu] == NO) { if ([self respondsToSelector: @selector(image)]) [archiver encodeObject:[self image] withName:@"image"]; if ([self respondsToSelector: @selector(onStateImage)]) [archiver encodeObject:[self onStateImage] withName:@"onStateImage"]; if ([self respondsToSelector: @selector(offStateImage)]) [archiver encodeObject:[self offStateImage] withName:@"offStateImage"]; if ([self respondsToSelector: @selector(mixedStateImage)]) [archiver encodeObject:[self mixedStateImage] withName:@"mixedStateImage"]; } [archiver encodeString:[self keyEquivalent] withName:@"keyEquivalent"]; if ([self respondsToSelector: @selector(state)]) { [archiver encodeInt:[self state] withName:@"state"]; } [archiver encodeObject:[self target] withName:@"target"]; [archiver encodeSelector:[self action] withName:@"action"]; [archiver encodeInt:[self tag] withName:@"tag"]; [archiver encodeBOOL:[self isEnabled] withName:@"isEnabled"]; if ([self respondsToSelector: @selector(changesState)]) { [archiver encodeBOOL:[self changesState] withName:@"changesState"]; } if ([self respondsToSelector: @selector(submenu)]) { [archiver encodeObject:[self submenu] withName:@"submenu"]; } [archiver encodeConditionalObject:[self representedObject] withName:@"representedObject"]; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { [self setTitle:[unarchiver decodeStringWithName:@"title"]]; [self setImage:[unarchiver decodeObjectWithName:@"image"]]; [self setOnStateImage:[unarchiver decodeObjectWithName:@"onStateImage"]]; [self setOffStateImage:[unarchiver decodeObjectWithName:@"offStateImage"]]; [self setMixedStateImage:[unarchiver decodeObjectWithName:@"mixedStateImage"]]; [self setKeyEquivalent:[unarchiver decodeStringWithName:@"keyEquivalent"]]; [self setState:[unarchiver decodeIntWithName:@"state"]]; [self setAction:[unarchiver decodeSelectorWithName:@"action"]]; [self setTarget: [unarchiver decodeObjectWithName: @"target"]]; [self setTag:[unarchiver decodeIntWithName:@"tag"]]; [self setEnabled:[unarchiver decodeBOOLWithName:@"isEnabled"]]; [self setChangesState:[unarchiver decodeBOOLWithName:@"changesState"]]; [self setRepresentedObject:[unarchiver decodeObjectWithName:@"representedObject"]]; /* * Here we have quite a delicate point. * In OPENSTEP 4.x, NSMenuItems with submenus have their submenu * as target; they do not answer to -submenu, so the encoded submenu * is nil; the submenu is actually encoded as the target. * * In GNUstep the target is instead the menu, and the submenu * is stored in an additional ivar. * * I don't know about MacOS-X. * * This code needs to be able to decode gmodels created on OPENSTEP 4.x too, * that's why we have the following. */ /* Safety assignment. */ [self setMenu: nil]; /* Set submenu ... but not if it's nil, because this assignment * always has side effects on action and target and we don't want to mess * them up if we don't have a submenu! */ { id submenu = [unarchiver decodeObjectWithName: @"submenu"]; if (submenu != nil) { [self setSubmenu: submenu]; } } /* Now we fix the submenu from the target if needed: */ #ifdef GNU_GUI_LIBRARY /* * Set submenu from target if not set (this happens if the gmodel * was created on OPENSTEP). */ if ([NSStringFromSelector ([self action]) isEqualToString: @"submenuAction:"]) { if ([self submenu] == nil) { if ([[self target] isKindOfClass: [NSMenu class]]) { [self setSubmenu: [self target]]; } else { NSLog(@"Error decoding gmodel - submenu not an NSMenu"); } } } #endif /* NB: The target might now be wrong (in case the gmodel was encoded in a platform where the target is the submenu while we now want the target to be the menu) ! This is automatically fixed later, because after the NSMenuItem is decoded, it is added to its container NSMenu, which will fix the target. */ #if 0 NSLog (@"menu item %@: target = %@, isEnabled = %d", [self title], [self target], [self isEnabled]); #endif return self; } @end /* NSMenuItem (GMArchiverMethods) */ @implementation NSMenu (GMArchiverMethods) - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [archiver encodeString:[self title] withName:@"title"]; [archiver encodeObject:[self itemArray] withName:@"itemArray"]; [archiver encodeBOOL:[self autoenablesItems] withName:@"autoenablesItems"]; } /* Define this method here because on OPENSTEP 4.x the NSMenu is inherited from NSWindow and we don't want the NSWindow's method to be called. */ + (id)createObjectForModelUnarchiver:(GMUnarchiver*)unarchiver { NSString* theTitle = [unarchiver decodeStringWithName:@"title"]; return [[[self allocWithZone:[unarchiver objectZone]] initWithTitle:theTitle] autorelease]; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { int i, count; NSMutableArray* decodedItems; decodedItems = [unarchiver decodeObjectWithName: @"itemArray"]; count = [decodedItems count]; for (i = 0; i < count; i++) { id item = [decodedItems objectAtIndex: i]; [self addItem: item]; } [self setAutoenablesItems: [unarchiver decodeBOOLWithName: @"autoenablesItems"]]; [self sizeToFit]; return self; } @end /* NSMenu (GMArchiverMethods) */ /* This class is special - to avoid having the cell encoded we encode it directly. Perhaps it would be wiser to do differently. */ @implementation NSPopUpButton (GMArchiverMethods) - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [archiver encodeRect: [self frame] withName: @"frame"]; [archiver encodeBOOL: [self pullsDown] withName: @"pullsDown"]; [archiver encodeBOOL: [self isEnabled] withName: @"isEnabled"]; [archiver encodeInt: [self tag] withName: @"tag"]; [archiver encodeObject: [self target] withName: @"target"]; [archiver encodeSelector: [self action] withName: @"action"]; [archiver encodeInt: [self autoresizingMask] withName: @"autoresizingMask"]; #if 0 //def __APPLE__ { int i; NSMutableArray *array; array = [NSMutableArray arrayWithCapacity: [self numberOfItems]]; for (i = 0; i < [self numberOfItems]; i++) [array addObject: [self itemAtIndex: i]]; [archiver encodeArray: array withName: @"itemArray"]; } #else [archiver encodeArray:[self itemArray] withName:@"itemArray"]; #endif [archiver encodeString:[[self selectedItem] title] withName:@"selectedItem"]; } + (id)createObjectForModelUnarchiver:(GMUnarchiver*)unarchiver { NSRect rect; NSPopUpButton *popup; BOOL pullsDown; rect = [unarchiver decodeRectWithName: @"frame"]; pullsDown = [unarchiver decodeBOOLWithName: @"pullsDown"]; popup = [NSPopUpButton allocWithZone: [unarchiver objectZone]]; popup = [popup initWithFrame: rect pullsDown: pullsDown]; AUTORELEASE (popup); return popup; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { int i, count; NSString *string; NSArray *decodedItems; decodedItems = [unarchiver decodeArrayWithName: @"itemArray"]; if (decodedItems && [decodedItems count]) { count = [decodedItems count]; for (i = 0; i < count; i++) { id item = [decodedItems objectAtIndex:i]; id myItem; [self addItemWithTitle: [item title]]; myItem = [self itemAtIndex:i]; [myItem setTarget: [item target]]; [myItem setAction: [item action]]; [myItem setEnabled: [item isEnabled]]; [myItem setTag: [item tag]]; [myItem setKeyEquivalent: [item keyEquivalent]]; } string = [unarchiver decodeStringWithName: @"selectedItem"]; [self selectItemWithTitle: string]; } else { /* For old gmodels that didn't support popups */ [self addItemWithTitle: @"Item 1"]; [self selectItemAtIndex: 0]; } [self setEnabled: [unarchiver decodeBOOLWithName: @"isEnabled"]]; [self setTag: [unarchiver decodeIntWithName: @"tag"]]; [self setTarget: [unarchiver decodeObjectWithName: @"target"]]; [self setAction: [unarchiver decodeSelectorWithName: @"action"]]; [self setAutoresizingMask: [unarchiver decodeIntWithName: @"autoresizingMask"]]; return self; } @end /* NSPopUpButton (GMArchiverMethods) */ @implementation NSResponder (GMArchiverMethods) - (void)encodeWithModelArchiver:(GMArchiver*)archiver { id nextResponder; if ((nextResponder = [self nextResponder])) [archiver encodeObject:nextResponder withName:@"nextResponder"]; if ([self respondsToSelector: @selector(interfaceStyle)]) [archiver encodeUnsignedInt: [self interfaceStyle] withName:@"interfaceStyle"]; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { [self setNextResponder:[unarchiver decodeObjectWithName:@"nextResponder"]]; if ([self respondsToSelector: @selector(setInterfaceStyle:)]) [self setInterfaceStyle: [unarchiver decodeUnsignedIntWithName:@"interfaceStyle"]]; return self; } @end /* NSResponder (GMArchiverMethods) */ @implementation NSTextField (GMArchiverMethods) - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [super encodeWithModelArchiver:archiver]; [archiver encodeSelector:[self errorAction] withName:@"errorAction"]; [archiver encodeObject:[self delegate] withName:@"delegate"]; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { self = [super initWithModelUnarchiver:unarchiver]; [self setErrorAction:[unarchiver decodeSelectorWithName:@"errorAction"]]; [self setDelegate:[unarchiver decodeObjectWithName:@"delegate"]]; return self; } @end /* NSTextField (GMArchiverMethods) */ @implementation NSSecureTextFieldCell (GMArchiverMethods) - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [super encodeWithModelArchiver:archiver]; if ([self respondsToSelector: @selector(echosBullets)]) [archiver encodeBOOL:[self echosBullets] withName:@"echosBullets"]; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { self = [super initWithModelUnarchiver:unarchiver]; if ([self respondsToSelector: @selector(setEchosBullets:)]) [self setEchosBullets:[unarchiver decodeBOOLWithName:@"echosBullets"]]; return self; } @end /* NSSecureTextFieldCell (GMArchiverMethods) */ @implementation NSView (GMArchiverMethods) // subclasses may not want to encode all subviews... - (NSArray *)subviewsForModel { #ifdef GNU_GUI_LIBRARY return [self subviews]; #else /* Do not encode Apple's private classes */ NSArray *views; NSMutableArray *viewsToEncode; id e, o; NSString *classString; views = [self subviews]; viewsToEncode = [NSMutableArray array]; e = [views objectEnumerator]; while ((o = [e nextObject])) { classString = NSStringFromClass ([o class]); if ([classString isEqualToString: @"_NSKeyboardFocusClipView"] == NO) [viewsToEncode addObject: o]; } return viewsToEncode; #endif } - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [super encodeWithModelArchiver:archiver]; [archiver encodeConditionalObject:[self superview] withName:@"superview"]; [archiver encodeObject:[self subviewsForModel] withName:@"subviews"]; [archiver encodeRect:[self frame] withName:@"frame"]; [archiver encodeRect:[self bounds] withName:@"bounds"]; [archiver encodeBOOL:[self postsFrameChangedNotifications] withName:@"postsFrameChangedNotifications"]; [archiver encodeBOOL:[self postsBoundsChangedNotifications] withName:@"postsBoundsChangedNotifications"]; [archiver encodeBOOL:[self autoresizesSubviews] withName:@"autoresizesSubviews"]; [archiver encodeUnsignedInt:[self autoresizingMask] withName:@"autoresizingMask"]; [archiver encodeConditionalObject:[self nextKeyView] withName:@"nextKeyView"]; [archiver encodeConditionalObject:[self previousKeyView] withName:@"previousKeyView"]; } + (id)createObjectForModelUnarchiver:(GMUnarchiver*)unarchiver { NSRect rect = [unarchiver decodeRectWithName:@"frame"]; NSView* view = [[[self allocWithZone:[unarchiver objectZone]] initWithFrame:rect] autorelease]; if (!view) NSLog (@"cannot create the requested view!"); return view; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { NSArray* subviews; int i, count; id superview; self = [super initWithModelUnarchiver:unarchiver]; superview = [unarchiver decodeObjectWithName:@"superview"]; /* If we are the content view of an NSBox, don't add ourselves to it. This is done later in the NSBox unachiver method */ if ([superview isKindOfClass: [NSBox class]] == NO) [superview addSubview:self]; subviews = [unarchiver decodeObjectWithName:@"subviews"]; for (i = 0, count = [subviews count]; i < count; i++) [self addSubview:[subviews objectAtIndex:i]]; // [self setBounds:[unarchiver decodeRectWithName:@"bounds"]]; [self setPostsFrameChangedNotifications: [unarchiver decodeBOOLWithName:@"postsFrameChangedNotifications"]]; [self setPostsBoundsChangedNotifications: [unarchiver decodeBOOLWithName:@"postsBoundsChangedNotifications"]]; [self setAutoresizesSubviews: [unarchiver decodeBOOLWithName:@"autoresizesSubviews"]]; [self setAutoresizingMask: [unarchiver decodeUnsignedIntWithName:@"autoresizingMask"]]; [self setNextKeyView: [unarchiver decodeObjectWithName:@"nextKeyView"]]; [self setPreviousKeyView: [unarchiver decodeObjectWithName:@"previousKeyView"]]; #ifdef GNU_GUI_LIBRARY _rFlags.flipped_view = [self isFlipped]; if ([_sub_views count]) _rFlags.has_subviews = 1; #endif return self; } @end /* NSView (GMArchiverMethods) */ @implementation NSWindow (GMArchiverMethods) - (void)encodeWithModelArchiver:(GMArchiver*)archiver { NSPoint wnOrigin = [self frame].origin; NSRect ctFrame = [[self contentView] frame], minRect; unsigned int style; ctFrame.origin = wnOrigin; /* convert minSize to GNUstep frame (without title bar and resize bar) */ minRect.origin = wnOrigin; minRect.size = [self minSize]; minRect = [NSWindow contentRectForFrameRect:minRect styleMask:[self styleMask]]; [archiver encodeRect:ctFrame withName:@"contentFrame"]; [archiver encodeSize:[self maxSize] withName:@"maxSize"]; [archiver encodeSize:minRect.size withName:@"minSize"]; [archiver encodeString:[self frameAutosaveName] withName:@"frameAutosaveName"]; [archiver encodeInt:[self level] withName:@"level"]; [archiver encodeBOOL:[self isVisible] withName:@"isVisible"]; [archiver encodeBOOL:[self isAutodisplay] withName:@"isAutodisplay"]; [archiver encodeString:[self title] withName:@"title"]; [archiver encodeString:[self representedFilename] withName:@"representedFilename"]; [archiver encodeBOOL:[self isReleasedWhenClosed] withName:@"isReleasedWhenClosed"]; [archiver encodeObject:[self contentView] withName:@"contentView"]; [archiver encodeBOOL:[self hidesOnDeactivate] withName:@"hidesOnDeactivate"]; [archiver encodeObject:[self backgroundColor] withName:@"backgroundColor"]; style = [self styleMask]; #ifndef GNU_GUI_LIBRARY /* Work around a bug in OpenStep, which doesn't set the * NSTitledWindowMask properly. If the window is not borderless, * always add the title mask. */ if (style != NSBorderlessWindowMask) { style |= NSTitledWindowMask; } #endif [archiver encodeUnsignedInt: style withName: @"styleMask"]; [archiver encodeUnsignedInt: [self backingType] withName: @"backingType"]; [archiver encodeConditionalObject: [self initialFirstResponder] withName: @"initialFirstResponder"]; } + (id)createObjectForModelUnarchiver:(GMUnarchiver*)unarchiver { unsigned backingType = [unarchiver decodeUnsignedIntWithName:@"backingType"]; unsigned styleMask = [unarchiver decodeUnsignedIntWithName:@"styleMask"]; NSRect ctRect = [unarchiver decodeRectWithName:@"contentFrame"]; NSWindow *win = [[self allocWithZone: [unarchiver objectZone]] initWithContentRect: ctRect styleMask: styleMask backing: backingType defer: YES]; // printf("content: %g, %g -- frame %g, %g\n", ctRect.size.width, ctRect.size.height, [win frame].size.width, [win frame].size.height); return AUTORELEASE(win); } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { NSString* frameAutosaveName; [self setContentView:[unarchiver decodeObjectWithName:@"contentView"]]; [self setMaxSize:[unarchiver decodeSizeWithName:@"maxSize"]]; [self setMinSize:[unarchiver decodeSizeWithName:@"minSize"]]; frameAutosaveName = [unarchiver decodeStringWithName:@"frameAutosaveName"]; if (frameAutosaveName) [self setFrameAutosaveName:frameAutosaveName]; #ifdef GNU_GUI_LIBRARY _windowLevel = [unarchiver decodeIntWithName:@"level"]; #endif [self setInitialFirstResponder: [unarchiver decodeObjectWithName:@"initialFirstResponder"]]; [self setAutodisplay:[unarchiver decodeBOOLWithName:@"isAutodisplay"]]; [self setTitle:[unarchiver decodeStringWithName:@"title"]]; [self setRepresentedFilename: [unarchiver decodeStringWithName:@"representedFilename"]]; [self setReleasedWhenClosed: [unarchiver decodeBOOLWithName:@"isReleasedWhenClosed"]]; [self setHidesOnDeactivate: [unarchiver decodeBOOLWithName:@"hidesOnDeactivate"]]; [self setBackgroundColor: [unarchiver decodeObjectWithName:@"backgroundColor"]]; if ([unarchiver decodeBOOLWithName:@"isVisible"]) { /* If we are the main gmodel of the application, this code is being executed before the app became active, so we have to force ordering front of the window. TODO: Refine the code so that if we are not the main gmodel then a more appropriate [self orderFront:nil] is used.*/ [self orderFrontRegardless]; } #if GNU_GUI_LIBRARY [[self contentView] setNeedsDisplay:YES]; #endif return self; } @end /* NSWindow (GMArchiverMethods) */ @implementation NSPanel (GMArchiverMethods) - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [super encodeWithModelArchiver: archiver]; [archiver encodeBOOL:[self isFloatingPanel] withName:@"isFloatingPanel"]; [archiver encodeBOOL:[self becomesKeyOnlyIfNeeded] withName:@"becomesKeyOnlyIfNeeded"]; [archiver encodeBOOL:[self worksWhenModal] withName:@"worksWhenModal"]; } + (id)createObjectForModelUnarchiver:(GMUnarchiver*)unarchiver { unsigned backingType = [unarchiver decodeUnsignedIntWithName: @"backingType"]; unsigned styleMask = [unarchiver decodeUnsignedIntWithName:@"styleMask"]; NSRect ctRect = [unarchiver decodeRectWithName:@"contentFrame"]; NSPanel* panel = [[[[self class] allocWithZone:[unarchiver objectZone]] initWithContentRect:ctRect styleMask:styleMask backing:backingType defer:YES] autorelease]; // use [self class] here, so it works for subclasses return panel; } -(id)initWithModelUnarchiver :(GMUnarchiver *)unarchiver { [super initWithModelUnarchiver: unarchiver]; [self setFloatingPanel: [unarchiver decodeBOOLWithName: @"isFloatingPanel"]]; [self setBecomesKeyOnlyIfNeeded: [unarchiver decodeBOOLWithName: @"becomesKeyOnlyIfNeeded"]]; [self setWorksWhenModal: [unarchiver decodeBOOLWithName: @"setWorksWhenModal"]]; return self; } @end /* NSPanel (GMArchiverMethods) */ @implementation NSSavePanel (GMArchiverMethods) - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [super encodeWithModelArchiver: archiver]; [archiver encodeString:[self prompt] withName:@"prompt"]; [archiver encodeObject:[self accessoryView] withName:@"accessoryView"]; [archiver encodeString:[self requiredFileType] withName: @"requiredFileType"]; [archiver encodeBOOL:[self treatsFilePackagesAsDirectories] withName: @"treatsFilePackagesAsDirectories"]; [archiver encodeString:[self directory] withName: @"directory"]; } + (id)createObjectForModelUnarchiver:(GMUnarchiver*)unarchiver { unsigned backingType = [unarchiver decodeUnsignedIntWithName: @"backingType"]; unsigned styleMask = [unarchiver decodeUnsignedIntWithName:@"styleMask"]; NSRect aRect = [unarchiver decodeRectWithName:@"frame"]; // Use [self class] here instead of NSSavePanel so as to invoke // +allocWithZone on the correct (if any) sub-class NSSavePanel* panel = [[[[self class] allocWithZone:[unarchiver objectZone]] initWithContentRect:aRect styleMask:styleMask backing:backingType defer:YES] autorelease]; #if GNU_GUI_LIBRARY NSDebugLLog(@"NSSavePanel", @"NSSavePanel +createObjectForModelUnarchiver"); #endif return panel; } -(id)initWithModelUnarchiver :(GMUnarchiver *)unarchiver { [super initWithModelUnarchiver: unarchiver]; //NSSavePanel specifics [self setPrompt:[unarchiver decodeStringWithName:@"prompt"]]; [self setAccessoryView:[unarchiver decodeObjectWithName:@"accessoryView"]]; [self setRequiredFileType: [unarchiver decodeStringWithName:@"requiredFileType"]]; [self setTreatsFilePackagesAsDirectories: [unarchiver decodeBOOLWithName:@"treatsFilePackagesAsDirectories"]]; [self setDirectory: [unarchiver decodeStringWithName:@"directory"]]; #if GNU_GUI_LIBRARY [[self contentView] setNeedsDisplay:YES]; #endif return self; } @end /* NSSavePanel (GMArchiverMethods) */ @implementation NSOpenPanel (GMArchiverMethods) - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [super encodeWithModelArchiver:(GMArchiver*)archiver]; [archiver encodeBOOL:[self canChooseFiles] withName:@"canChooseFiles"]; [archiver encodeBOOL:[self canChooseDirectories] withName:@"canChooseDirectories"]; } - (id)initWithModelUnarchiver:(GMUnarchiver *)unarchiver { [super initWithModelUnarchiver:(GMUnarchiver *)unarchiver]; [self setCanChooseFiles:[unarchiver decodeBOOLWithName:@"canChooseFiles"]]; [self setCanChooseDirectories:[unarchiver decodeBOOLWithName: @"canChooseDirectories"]]; return self; } @end /* NSOpenPanel (GMArchiverMethods) */ @implementation NSBrowser (GMArchiverMethods) - (void)encodeWithModelArchiver :(GMArchiver*)archiver { [super encodeWithModelArchiver:archiver]; //NSBrowser [archiver encodeString:[self path] withName:@"path"]; [archiver encodeString:[self pathSeparator] withName:@"pathSeparator"]; [archiver encodeBOOL:[self allowsBranchSelection] withName:@"allowsBranchSelection"]; [archiver encodeBOOL:[self allowsEmptySelection] withName:@"allowsEmptySelection"]; [archiver encodeBOOL:[self allowsMultipleSelection] withName:@"allowsMultipleSelection"]; [archiver encodeBOOL:[self reusesColumns] withName:@"reusesColumns"]; [archiver encodeUnsignedInt:[self maxVisibleColumns] withName:@"maxVisibleColumns"]; [archiver encodeUnsignedInt:[self minColumnWidth] withName:@"minColumnWidth"]; [archiver encodeBOOL:[self separatesColumns] withName:@"separatesColumns"]; [archiver encodeBOOL:[self takesTitleFromPreviousColumn] withName:@"takesTitleFromPreviousColumn"]; [archiver encodeBOOL:[self isTitled] withName:@"isTitled"]; [archiver encodeBOOL:[self hasHorizontalScroller] withName:@"hasHorizontalScroller"]; [archiver encodeBOOL:[self acceptsArrowKeys] withName:@"acceptsArrowKeys"]; [archiver encodeBOOL:[self sendsActionOnArrowKeys] withName:@"sendsActionOnArrowKeys"]; [archiver encodeObject:[self delegate] withName:@"delegate"]; [archiver encodeSelector:[self doubleAction] withName:@"doubleAction"]; } #if 0 + (id)createObjectForModelUnarchiver:(GMUnarchiver*)unarchiver { unsigned backingType = [unarchiver decodeUnsignedIntWithName: @"backingType"]; unsigned styleMask = [unarchiver decodeUnsignedIntWithName:@"styleMask"]; NSRect aRect = [unarchiver decodeRectWithName:@"frame"]; NSBrowser* browser = [[[NSBrowser allocWithZone:[unarchiver objectZone]] initWithContentRect:aRect styleMask:styleMask backing:backingType defer:YES] autorelease]; return browser; } #endif - (id)initWithModelUnarchiver :(GMUnarchiver *)unarchiver { id delegate; self = [super initWithModelUnarchiver:unarchiver]; [self setPath:[unarchiver decodeStringWithName:@"path"]]; [self setPathSeparator:[unarchiver decodeStringWithName:@"pathSeparator"]]; [self setAllowsBranchSelection:[unarchiver decodeBOOLWithName:@"allowsBranchSelection"]]; [self setAllowsEmptySelection:[unarchiver decodeBOOLWithName:@"allowsEmptySelection"]]; [self setAllowsMultipleSelection:[unarchiver decodeBOOLWithName:@"allowsMultipleSelection"]]; [self setReusesColumns:[unarchiver decodeBOOLWithName:@"reusesColumns"]]; [self setMaxVisibleColumns:[unarchiver decodeUnsignedIntWithName:@"maxVisibleColumns"]]; [self setMinColumnWidth:[unarchiver decodeUnsignedIntWithName:@"minColumnWidth"]]; [self setSeparatesColumns:[unarchiver decodeBOOLWithName:@"separatesColumns"]]; [self setTakesTitleFromPreviousColumn:[unarchiver decodeBOOLWithName:@"takesTitleFromPreviousColumn"]]; [self setTitled:[unarchiver decodeBOOLWithName:@"isTitled"]]; [self setHasHorizontalScroller:[unarchiver decodeBOOLWithName:@"hasHorizontalScroller"]]; [self setAcceptsArrowKeys:[unarchiver decodeBOOLWithName:@"acceptsArrowKeys"]]; [self setSendsActionOnArrowKeys:[unarchiver decodeBOOLWithName:@"sendsActionOnArrowKeys"]]; //avoid an exeption delegate = [unarchiver decodeObjectWithName:@"delegate"]; if (delegate) [self setDelegate:delegate]; [self setDoubleAction:[unarchiver decodeSelectorWithName:@"doubleAction"]]; return self; } @end /* NSBrowser (GMArchiverMethods) */ @implementation NSColorWell (GMArchiverMethods) - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { self = [super initWithModelUnarchiver:unarchiver]; [self setColor:[unarchiver decodeObjectWithName:@"color"]]; [self setBordered:[unarchiver decodeBOOLWithName:@"isBordered"]]; return self; } - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [super encodeWithModelArchiver:archiver]; [archiver encodeObject:[self color] withName:@"color"]; [archiver encodeBOOL:[self isBordered] withName:@"isBordered"]; } @end /* NSColorWell (GMArchiverMethods) */ @implementation NSImageView (GMArchiverMethods) - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [super encodeWithModelArchiver:archiver]; [archiver encodeInt:[self imageAlignment] withName:@"alignment"]; [archiver encodeInt:[self imageFrameStyle] withName:@"frameStyle"]; [archiver encodeObject:[self image] withName:@"image"]; [archiver encodeBOOL:[self isEditable] withName:@"isEditable"]; [archiver encodeInt:[self imageScaling] withName:@"scaling"]; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { self = [super initWithModelUnarchiver:unarchiver]; [self setImageAlignment:[unarchiver decodeIntWithName:@"alignment"]]; [self setImageFrameStyle:[unarchiver decodeIntWithName:@"frameStyle"]]; [self setImage:[unarchiver decodeObjectWithName:@"image"]]; [self setEditable:[unarchiver decodeBOOLWithName:@"isEditable"]]; [self setImageScaling:[unarchiver decodeIntWithName:@"scaling"]]; return self; } @end @implementation NSSliderCell (GMArchiverMethods) - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [super encodeWithModelArchiver:archiver]; [archiver encodeFloat:[self knobThickness] withName:@"knobThickness"]; [archiver encodeObject:[self image] withName:@"image"]; [archiver encodeDouble:[self maxValue] withName:@"maxValue"]; [archiver encodeDouble:[self minValue] withName:@"minValue"]; // title, color, and font info is encoded by the title cell [archiver encodeObject:[self titleCell] withName:@"titleCell"]; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { [super initWithModelUnarchiver:unarchiver]; [self setKnobThickness:[unarchiver decodeFloatWithName:@"knobThickness"]]; [self setImage:[unarchiver decodeObjectWithName:@"image"]]; [self setMaxValue:[unarchiver decodeDoubleWithName:@"maxValue"]]; [self setMinValue:[unarchiver decodeDoubleWithName:@"minValue"]]; // title, color, and font info is encoded by the title cell [self setTitleCell:[unarchiver decodeObjectWithName:@"titleCell"]]; return self; } @end /* NSSliderCell (GMArchiverMethods) */ @implementation NSTextFieldCell (GMArchiverMethods) - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [super encodeWithModelArchiver:archiver]; [archiver encodeObject:[self backgroundColor] withName:@"backgroundColor"]; [archiver encodeBOOL:[self drawsBackground] withName:@"drawsBackground"]; [archiver encodeObject:[self textColor] withName:@"textColor"]; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { self = [super initWithModelUnarchiver:unarchiver]; [self setBackgroundColor: [unarchiver decodeObjectWithName:@"backgroundColor"]]; [self setDrawsBackground: [unarchiver decodeBOOLWithName:@"drawsBackground"]]; [self setTextColor:[unarchiver decodeObjectWithName:@"textColor"]]; return self; } @end /* NSTextFieldCell (GMArchiverMethods) */ @implementation NSFormCell (GMArchiverMethods) - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [super encodeWithModelArchiver:archiver]; [archiver encodeString:[self title] withName:@"title"]; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { self = [super initWithModelUnarchiver:unarchiver]; [self setTitle:[unarchiver decodeStringWithName:@"title"]]; return self; } @end /* NSFormCell (GMArchiverMethods) */ @implementation NSText (GMArchiverMethods) - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [super encodeWithModelArchiver:archiver]; [archiver encodeString: [self string] withName: @"string"]; [archiver encodeConditionalObject: [self backgroundColor] withName: @"backgroundColor"]; [archiver encodeBOOL:[self drawsBackground] withName:@"drawsBackground"]; [archiver encodeObject:[self textColor] withName:@"textColor"]; [archiver encodeBOOL:[self isEditable] withName:@"isEditable"]; [archiver encodeBOOL:[self isSelectable] withName:@"isSelectable"]; [archiver encodeBOOL:[self isFieldEditor] withName:@"isFieldEditor"]; [archiver encodeBOOL:[self isRichText] withName:@"isRichText"]; [archiver encodeBOOL:[self importsGraphics] withName:@"importsGraphics"]; [archiver encodeBOOL:[self usesFontPanel] withName:@"usesFontPanel"]; [archiver encodeObject:[self font] withName:@"font"]; [archiver encodeInt:[self alignment] withName:@"alignment"]; [archiver encodeSize:[self maxSize] withName:@"maxSize"]; [archiver encodeSize:[self minSize] withName:@"minSize"]; [archiver encodeBOOL:[self isVerticallyResizable] withName:@"isVerticallyResizable"]; [archiver encodeBOOL:[self isHorizontallyResizable] withName:@"isHorizontallyResizable"]; [archiver encodeConditionalObject: [self delegate] withName: @"delegate"]; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { self = [super initWithModelUnarchiver: unarchiver]; [self setString: [unarchiver decodeStringWithName: @"string"]]; [self setBackgroundColor: [unarchiver decodeObjectWithName:@"backgroundColor"]]; [self setDrawsBackground: [unarchiver decodeBOOLWithName:@"drawsBackground"]]; [self setTextColor:[unarchiver decodeObjectWithName:@"textColor"]]; [self setEditable:[unarchiver decodeBOOLWithName:@"isEditable"]]; [self setSelectable:[unarchiver decodeBOOLWithName:@"isSelectable"]]; [self setFieldEditor:[unarchiver decodeBOOLWithName:@"isFieldEditor"]]; [self setRichText:[unarchiver decodeBOOLWithName:@"isRichText"]]; [self setImportsGraphics:[unarchiver decodeBOOLWithName:@"importsGraphics"]]; [self setUsesFontPanel:[unarchiver decodeBOOLWithName:@"usesFontPanel"]]; [self setFont:[unarchiver decodeObjectWithName:@"font"]]; [self setAlignment:[unarchiver decodeIntWithName:@"alignment"]]; [self setMaxSize:[unarchiver decodeSizeWithName:@"maxSize"]]; [self setMinSize:[unarchiver decodeSizeWithName:@"minSize"]]; [self setVerticallyResizable: [unarchiver decodeBOOLWithName:@"isVerticallyResizable"]]; [self setHorizontallyResizable: [unarchiver decodeBOOLWithName:@"isHorizontallyResizable"]]; [self setDelegate: [unarchiver decodeObjectWithName: @"delegate"]]; return self; } @end /* NSText (GMArchiverMethods) */ @implementation NSTextView (GMArchiverMethods) - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [super encodeWithModelArchiver:archiver]; // Currently the text container is not encoded [archiver encodeSize:[self textContainerInset] withName:@"textContainerInset"]; if ([self respondsToSelector: @selector(allowsUndo)]) [archiver encodeBOOL:[self allowsUndo] withName:@"allowsUndo"]; [archiver encodeBOOL:[self usesRuler] withName:@"usesRuler"]; [archiver encodeBOOL:[self isRulerVisible] withName:@"isRulerVisible"]; [archiver encodeObject:[self insertionPointColor] withName:@"insertionPointColor"]; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { self = [super initWithModelUnarchiver: unarchiver]; // Currently the text container is not encoded [self setTextContainerInset:[unarchiver decodeSizeWithName:@"textContainerInset"]]; [self setAllowsUndo:[unarchiver decodeBOOLWithName:@"allowsUndo"]]; [self setUsesRuler:[unarchiver decodeBOOLWithName:@"usesRuler"]]; [self setRulerVisible:[unarchiver decodeBOOLWithName:@"isRulerVisible"]]; [self setInsertionPointColor: [unarchiver decodeObjectWithName:@"insertionPointColor"]]; return self; } @end /* NSTextView (GMArchiverMethods) */ gnustep-gui-0.24.0/Model/IBClasses.m0000664000076500007650000001377111023376255017005 0ustar brains99brains99/* IBClasses.m Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: November 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #ifdef GNUSTEP #include #include #endif #include #ifdef __APPLE__ #import #import #import #endif #include "IBClasses.h" #include "Translator.h" #include "IMConnectors.h" #include "GNUstepGUI/IMCustomObject.h" //#define DEBUG #if 0 @implementation NSObject (NibToGModel) - (id)awakeAfterUsingCoder:(NSCoder*)aDecoder { NSLog (@"%x awakeAfterUsingCoder: %@ [%@]", self, [self class], self); return self; } @end #endif #ifndef GNU_GUI_LIBRARY @implementation NSCustomObject (NibToGModel) - (id)awakeAfterUsingCoder:(NSCoder*)aDecoder { #ifdef DEBUG NSLog (@"%x awakeAfterUsingCoder NSCustomObject: className = %@, realObject = %@, " @"extension = %@", self, className, realObject, extension); #endif [objects addObject:self]; return self; } - description { return [NSString stringWithFormat:@"className = %@, realObject = %@, extension = %@", className, realObject, extension]; } - nibInstantiate { return self; } - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [archiver encodeString:className withName:@"className"]; if (realObject) [archiver encodeObject:realObject withName:@"realObject"]; if (extension) [archiver encodeObject:extension withName:@"extension"]; } - (Class)classForModelArchiver { return [IMCustomObject class]; } @end /* NSCustomObject */ @implementation NSCustomView (NibToGModel) - (id)awakeAfterUsingCoder:(NSCoder*)aDecoder { #ifdef DEBUG NSLog (@"%x awakeAfterUsingCoder NSCustomView: className = %@, realObject = %@, " @"extension = %@", self, className, realObject, extension); #endif [objects addObject:self]; return self; } - description { return [NSString stringWithFormat:@"className = %@, realObject = %@, extension = %@", className, realObject, extension]; } - nibInstantiate { return self; } - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [archiver encodeString:className withName:@"className"]; [archiver encodeRect:[self frame] withName:@"frame"]; if (realObject) [archiver encodeObject:realObject withName:@"realObject"]; if (extension) [archiver encodeObject:extension withName:@"extension"]; } - (Class)classForModelArchiver { return [IMCustomView class]; } @end #ifdef __APPLE__ @implementation NSNibConnector (NibToGModel) #else @implementation NSIBConnector (NibToGModel) #endif - (id)awakeAfterUsingCoder:(NSCoder*)aDecoder { #if defined(DEBUG) && !defined(__APPLE__) NSLog (@"%x awakeAfterUsingCoder %@: source = %@, destination = %@, label = %@", self, NSStringFromClass(isa), source, destination, label); #endif #ifdef __APPLE__ [_source retain]; [_destination retain]; [_label retain]; #else [source retain]; [destination retain]; [label retain]; #endif [connections addObject:self]; return self; } - (void)encodeWithModelArchiver:(GMArchiver*)archiver { #ifdef __APPLE__ [archiver encodeObject:_source withName:@"source"]; [archiver encodeObject:_destination withName:@"destination"]; [archiver encodeObject:_label withName:@"label"]; #else [archiver encodeObject:source withName:@"source"]; [archiver encodeObject:destination withName:@"destination"]; [archiver encodeObject:label withName:@"label"]; #endif } - (Class)classForModelArchiver { return [IMConnector class]; } @end /* NSIBConnector */ #ifdef __APPLE__ @implementation NSNibOutletConnector (NibToGModel) #else @implementation NSIBOutletConnector (NibToGModel) #endif - (void)establishConnection { } - (Class)classForModelArchiver { return [IMOutletConnector class]; } @end /* NSIBOutletConnector */ #ifdef __APPLE__ @implementation NSNibControlConnector (NibToGModel) #else @implementation NSIBControlConnector (NibToGModel) #endif - (void)establishConnection { } - (Class)classForModelArchiver { return [IMControlConnector class]; } @end /* NSIBControlConnector */ @implementation NSWindowTemplate (GMArchiverMethods) #ifdef DEBUG - (void)encodeWithModelArchiver:(GMArchiver*)archiver { NSLog (@"%@: %@", NSStringFromClass (isa), NSStringFromSelector (_cmd)); [super encodeWithModelArchiver:archiver]; } #endif - (id)replacementObjectForModelArchiver:(GMArchiver*)archiver { #ifdef DEBUG NSLog (@"realObject = %@", realObject); #endif return realObject; } @end @implementation NSMenuTemplate (NibToGModel) - (id)awakeAfterUsingCoder:(NSCoder*)aDecoder { #ifdef DEBUG NSLog (@"%x awakeAfterUsingCoder NSMenuTemplate: className = %@, realObject = %@, " @"extension = %@", self, menuClassName, realObject, extension); #endif /* This is just a hack till we figure out what's going on */ if ([menuClassName isEqual: @"NSPopUpList"]) [self retain]; return self; } - (void)encodeWithModelArchiver:(GMArchiver*)archiver { [archiver encodeString:menuClassName withName:@"menuClassName"]; if (realObject) [archiver encodeObject:realObject withName:@"realObject"]; if (extension) [archiver encodeObject:extension withName:@"extension"]; } @end #endif gnustep-gui-0.24.0/Model/test.nib/0000775000076500007650000000000012256227331016533 5ustar brains99brains99gnustep-gui-0.24.0/Model/test.nib/objects.nib0000664000076500007650000001047306464220021020654 0ustar brains99brains99 streamtypedè„@„„„NSIBObjectData„„NSObject…’„„„NSCustomObject)”„@@„„„NSString”„+ NSApplication†…†„i+–„„„NSButton„„ NSControl)„„NSView)„„ NSResponder”’„œ’…™„ @@@@ffffffff„„„NSMutableArray„„NSArray”™ ’„š’ž™ž…………”rr’ž’…’…’…„icc@„„„ NSButtonCell9„„ NSActionCell„„NSCell<”„ii‚þ‚„@@@@„˜˜Momentary Light†„„„NSFont”™„[20c] Helvetica„f „cªªª†……„i:…’…’¢„ ssIi@@@@@È‚@‚„˜˜ Alternate†„˜˜†…„©™¨ Helvetica© ªªªª†…††’„š’ž™ž…………èrr’ž’…’…’…¡„¤¥‚þ‚¦„˜˜Momentary Push†¨……«…’…’­¬È‚@‚†„˜˜ Alternate†«…¬…††’„š’ž™ž…………¾rr’ž’…’…’…¡„¤¥‚þ‚¦„˜˜Momentary change†¨……«…’…’±¬È‚@‚„˜˜ Alternate†«…¬…††’„š’ž™ž…………jrr’ž’…’…’…¡„¤¥‚þ‚¦„˜˜PushOn/PushOff†¨……«…’…’µ¬È‚@‚¶„˜˜ Alternate†«…¬…††’„š’ž™ž…………@rr’ž’…’…’…¡„¤¥‚þ‚¦„˜˜On/Off†¨……«…’…’¹¬È‚@‚6„˜˜ Alternate†«…¬…††’™’„š’ž™ž…………ÌØmm’ž’…’…’…¡„¤¥‚þ¦„˜˜Switch†¨……«…’…’½¬È‚@<É„˜˜ Alternate†«„„„NSCustomResource)”–„˜˜NSImage†„˜˜NSSwitch††„–Ę˜NSHighlightedSwitch††…††’„„„ NSTextField›’ž™ž…………Á§„„’ž’…’…’…¡„„„NSTextFieldCell=¥¥‚Aþ±‚¦„˜˜Title†„©™¨ Helvetica©ªªªª†……«…’…’Ç„c@@„„„NSColor”ª„@@@„˜˜System†„˜˜ controlColor†„Ϊ„ffƒ«ª*?††„Ϊ²Ï„˜˜controlTextColor†„Ϊ³†††’…„:…†’„È’ž™ž…………¬lÖÖ’ž’…’…’…¡„Ê¥‚@þq”‚¦„˜˜Text†¨……«…’…’Õ°„Ϊ²Ï„˜˜textBackgroundColor†„Ϊ³††„Ϊ²Ï„˜˜ textColor†Ô††’…´…†’„„„ NSPopUpButtonš’ž™ž…………IYY’ž’…’…’…¡ „¤¥‚`þ¦„˜˜Item1†¨……«„popUp:’„„„NSMenuTemplate)”„ ffccc@@@@'„˜˜ OtherViews†„˜˜ NSPopUpList†„„„NSMatrix<›’…™ž…………Y<Y<’…’…’…’…¡…„#iiii:::ffffi@@@@@„„ NSMenuItem„„ NSMenuCell¤………Y‚(„ ™’„祂þ„¦à¨……«…’…’å¬È‚‚@ª««…¨…’…†’„祂þ¦„˜˜Item2†¨……«…’…’å¬È‚‚@ª««…¨…’…†’„祂þ¦„˜˜Item3†¨……«…’…’å¬È‚‚@ª««…¨…’…††ÚÚ¨…’…’…’ê†„š’…™‚€ž…………©}YY’…’…’…’…¡…†’…†’ݬÈ‚@¬««„–Ę˜NXpopup††„–Ę˜NXpopupH††…†´…’…ª†’„„„ NSCustomView)œ’ž™ž„ ™†………¯ZJZJ’ž’…’…’…–„˜˜MyView†…††……… ¤¤’…’…’…’…†™ž…………rr’ž’…’…’…¡„¤¥‚þ‚¦„˜˜Toggle†¨……«…’…’™¬È‚@‚È„˜˜ Alternate†«…¬…††ž–½ž–„祂þ¦„˜˜Quit†¨……«…’…’„æ’…™ž…………QPQP’…’…’…’…¡…ºçÿÿ………Q‚(„ ™’„祂þ¦„˜˜Info†¨……«„submenuAction:’„â¸]Ï„˜˜Info†„˜˜NSMenu†„æ’…™ž…………g<g<’…’…’…’…¡…ºçÿÿ………g‚(„ ™’„祂þ$¦„˜˜ Info Panel...†¨……«…’…’¬È‚‚@®…«…¨…’…†’„祂þ$¦„˜˜Preferences...†¨……«…’…’¬È‚‚@®…«…¨…’…†’„祂þ¦„˜˜Help...†¨……«…’…’¬È‚‚@®…„˜˜?†…¨…’…††ÚÚ¨…’…’…’…†…’„⸠»„˜˜test†„˜˜NSMenu†ý…’…††’ý¬È‚‚@¬…«„–Ę˜ NSMenuArrow††……’†’„祂þ¦„˜˜Document†¨……«¾’„â¸]k„˜˜Document†„˜˜NSMenu†„æ’…™ž…………s s ’…’…’…’…¡…ºçÿÿ………s‚(„ ™’„祂þ$¦„˜˜Open...†¨……«…’…’¬È‚‚@®…„˜˜o†…¨…’…†’„祂þ$¦„˜˜New†¨……«…’…’¬È‚‚@®…„˜˜n†…¨…’…†’„祂þ$¦„˜˜Save†¨……«…’…’¬È‚‚@®…„˜˜s†…¨…’…†’„祂þ$¦„˜˜ Save As...†¨……«…’…’¬È‚‚@®…„˜˜S†…¨…’…†’„祂þ$¦„˜˜ Save To...†¨……«…’…’¬È‚‚@®…«…¨…’…†’„祂þ$¦„˜˜Save All†¨……«…’…’¬È‚‚@®…«…¨…’…†’„祂þ$¦„˜˜Revert to Saved†¨……«…’…’¬È‚‚@®…«…¨…’…†’„祂þ$¦„˜˜Close†¨……«…’…’¬È‚‚@®…«…¨…’…††ÚÚ¨…’…’…’…†…’ †’ý¬È‚‚@¬…«……’†’„祂þ¦„˜˜Hide†¨……«…’…’ý¬È‚‚@®…„˜˜h†…¨…’…†’û†ÚÚ¨…’…’…’…†¬È‚‚@®…„˜˜q†…¨…’…†ý–Õž–ÿý–­ž–ëå–ý–'–åá–ý –„„„NSWindowTemplate)”„ iiffffi@@@@@c³ApE‚xp„˜˜Window†„˜˜NSWindow†„˜˜View†„œ’…™ž………… pEpE’…’…’…’…†…„ffff<`ª†•–+–¹ž– –Çž–"–„––„˜˜ Controller†…†•–µž–¢ž–íå–áÝ–61––„––„˜˜ NSFontManager†…†•–±ž–„2À¤‚xp„˜˜ My Window†„˜˜NSWindow†„˜˜View†ž…Á<`ª†•– •–Ýž–-ý–)––ž;––ôž––ÿ––––%––êå™–ᄘ˜ PopUpList†–78–•„˜˜ File's Owner†–9„˜˜ Font Manager†–;„˜˜MyWindow†–1„˜˜Window†– „˜˜MainMenu†’„„„ NSMutableSet„„NSSet”„I’;†’„ ™ ’„„„NSIBControlConnector„„ NSIBConnector”²û•„˜˜ terminate:††’„J²-•„˜˜hide:††’„„„NSIBOutletConnectorK²7Õ„˜˜ textField††’„J²­7„˜˜buttonPressed:††’„J²±7S†’„J²¢7S†’„J²µ7S†’„J²¹7S†’„J²™7S†’„J²½7S†’„P²•7„˜˜delegate†††’9™7„@iê È 4Èå ÈTüÈá ÈÇìÈ':ȽëÈ+@ÈRûȹéÈAÈžÈ8È6ȵèÈM#È6Èÿ3ȱçÈ";ȕȭæÈýÈûÈ1ÈÕùÈ ÈI"ÈÝ ÈUýÈVþÈ)BÈOúÈYÈë È;È5È7È<È7øÈWÿÈ9¦È™êÈ%9ÈXÈ- È¢,È>È?ÈZÈôÈCÈ=Èí™™†gnustep-gui-0.24.0/Model/test.nib/data.classes0000664000076500007650000000040710377004044021020 0ustar brains99brains99"Controller" = { ACTIONS = {"buttonPressed:" = id; }; OUTLETS = {textField = id; }; SUPERCLASS = NSObject; }; "FirstResponder" = {ACTIONS = {}; OUTLETS = {}; SUPERCLASS = NSObject; }; "MyView" = {ACTIONS = {}; OUTLETS = {}; SUPERCLASS = NSView; }; gnustep-gui-0.24.0/Model/GNUmakefile0000664000076500007650000000612311335045223017054 0ustar brains99brains99# GNUmakefile # # Copyright (C) 1996 Free Software Foundation, Inc. # # Author: Ovidiu Predescu # Date: November 1997 # # This file is part of the GNUstep GUI Library. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-gui GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../gui.make include $(GNUSTEP_MAKEFILES)/common.make include ../Version ifneq ($(GUI_LIB), gnu) LIBRARY_NAME = libgmodel else BUNDLE_NAME = libgmodel endif ifeq ($(BUILD_NIB2GMODEL), yes) TOOL_NAME = nib2gmodel ADDITIONAL_TOOL_LIBS += -lgmodel endif #APP_NAME = test libgmodel_OBJC_FILES = IMCustomObject.m IMConnectors.m IMLoading.m GMAppKit.m \ GMArchiver.m libgmodel_HEADER_FILES_DIR = ../Headers/Additions/GNUstepGUI libgmodel_HEADER_FILES_INSTALL_DIR = /GNUstepGUI libgmodel_HEADER_FILES = IMConnectors.h IMCustomObject.h IMLoading.h \ GMAppKit.h GMArchiver.h test_OBJC_FILES = test.m Controller.m #test_MAIN_MODEL_FILE = test.gmodel test_RESOURCE_FILES = test.gmodel nib2gmodel_OBJC_FILES = IBClasses.m Translator.m nib2gmodel.m # Additional library directories the linker should search ifneq ($(GUI_LIB), gnu) ADDITIONAL_LIB_DIRS += -framework AppKit endif # Additional flags to pass to the Objective-C compiler ADDITIONAL_OBJCFLAGS = -Wall ADDITIONAL_CPPFLAGS += $(RUNTIME_DEFINE) $(GUI_DEFINE) $(BACKEND_DEFINE) ADDITIONAL_LIB_DIRS += -L$(GNUSTEP_OBJ_DIR) ifeq ($(GUI_LIB), gnu) ADDITIONAL_LIB_DIRS += -L../Source/$(GNUSTEP_OBJ_DIR) ADDITIONAL_INCLUDE_DIRS = -I../Headers/Additions -I../Headers else ADDITIONAL_INCLUDE_DIRS = -I../Headers/Additions endif ADDITIONAL_OBJC_FLAGS += $(BACKEND_DEFINE) # What are the libraries this library depends upon. This is needed for some # systems where building a shared library requires to pass to the linker # all the libraries the target library depends upon. ifeq ($(GUI_LIB), gnu) libgmodel_LIBRARIES_DEPEND_UPON = -lgnustep-gui $(FND_LIBS) $(OBJC_LIBS) else libgmodel_LIBRARIES_DEPEND_UPON = $(FND_LIBS) endif libgmodel_BUNDLE_LIBS += $(libgmodel_LIBRARIES_DEPEND_UPON) nib2gmodel_LIBRARIES_DEPEND_UPON = $(BACKEND_LIBS) $(GUI_LIBS) \ $(FND_LIBS) $(SYSTEM_LIBS) ifeq ($(GUI_LIB), gnu) include $(GNUSTEP_MAKEFILES)/bundle.make else include $(GNUSTEP_MAKEFILES)/library.make endif include $(GNUSTEP_MAKEFILES)/tool.make include $(GNUSTEP_MAKEFILES)/application.make include GNUmakefile.postamble gnustep-gui-0.24.0/Model/GMArchiveObjects.m0000664000076500007650000001055711023376255020313 0ustar brains99brains99/* GMArchiveObjects.m Author: Ovidiu Predescu Date: October 1997 Copyright (C) 1997 Free Software Foundation, Inc. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* This file declares categories to various OpenStep classes so they get archived correctly by GMArchiver. The main things deal with encoding in place of some objects like imutable strings, arrays, dictionaries and data objects (basically the property list classes). This file is included by GMArchiver rather than compiled as a separate file because of the linking problems with categories (they are not linked into the executable even if you refer a method from category; you should refer a symbol from the category's file in order to force it link. */ #ifndef GNUSTEP #include #else #include #endif @implementation NSObject (ModelArchivingMethods) - (id)replacementObjectForModelArchiver:(GMArchiver*)archiver { return [self replacementObjectForCoder:nil]; } - (Class)classForModelArchiver { return [self classForCoder]; } + (id)createObjectForModelUnarchiver:(GMUnarchiver*)unarchiver { return [[[self allocWithZone:[unarchiver objectZone]] init] autorelease]; } /* Works around a bug in MacOSX 10.1.x?. [NSPatternColor -isEqual:] doesn't check if the object is a color before calling colorSpaceName on it */ - (NSString *) colorSpaceName { return nil; } @end @implementation NSString (ModelArchivingMethods) - (void)encodeWithModelArchiver:(id)archiver { [archiver encodeString:self withName:@"string"]; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { return [unarchiver decodeStringWithName:@"string"]; } - (Class)classForModelArchiver { return [NSString class]; } @end @implementation NSMutableString (ModelArchivingMethods) - (Class)classForModelArchiver { return [NSMutableString class]; } - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { return [[[unarchiver decodeStringWithName:@"string"] mutableCopy] autorelease]; } @end @implementation NSArray (ModelArchivingMethods) - (void)encodeWithModelArchiver:(id)archiver { [archiver encodeArray:self withName:@"elements"]; } - (Class)classForModelArchiver { return [NSMutableArray class]; } @end @implementation NSMutableArray (ModelArchivingMethods) - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { id array = [unarchiver decodeArrayWithName:@"elements"]; int i, count; for (i = 0, count = [array count]; i < count; i++) [self addObject:[array objectAtIndex:i]]; return self; } @end @implementation NSDictionary (ModelArchivingMethods) - (void)encodeWithModelArchiver:(id)archiver { [archiver encodeDictionary:self withName:@"elements"]; } - (Class)classForModelArchiver { return [NSMutableDictionary class]; } @end @implementation NSMutableDictionary (ModelArchivingMethods) - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { id dictionary = [unarchiver decodeDictionaryWithName:@"elements"]; id enumerator = [dictionary keyEnumerator]; id key, value; while ((key = [enumerator nextObject])) { value = [dictionary objectForKey:key]; [self setObject:value forKey:key]; } return self; } @end @implementation NSData (ModelArchivingMethods) - (void)encodeWithModelArchiver:(id)archiver { [archiver encodeData:self withName:@"data"]; } - (Class)classForModelArchiver { return [NSMutableData class]; } @end @implementation NSMutableData (ModelArchivingMethods) - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver { id data = [unarchiver decodeDataWithName:@"data"]; [self appendData:data]; return self; } @end gnustep-gui-0.24.0/ANNOUNCE0000664000076500007650000000455312256227272015111 0ustar brains99brains991 ANNOUNCE ********** This is version 0.24.0 of the GNUstep GUI library (`gnustep-gui'). 1.1 What is the GNUstep GUI Library? ==================================== It is a library of graphical user interface classes written completely in the Objective-C language; the classes are based upon Apple's Cocoa framework (which came from the OpenStep specification as release by NeXT Software, Inc). The library has been enhanced in a number of ways to take advantage of the GNU system. These classes include graphical objects such as buttons, text fields, popup lists, browser lists, and windows; there are also many associated classes for handling events, colors, fonts, pasteboards and images. The GNUstep GUI Library is designed in two parts. The first part is the front-end component which is independent of platform and display system. This front-end is combined with a back-end component which handles all of the display system dependent such as specific calls to X/Windows. This design allows the GNUstep applications to have the "look and feel" of the underlying display system without any changes to the application, and the library can be easily ported to other display systems. The GNUstep GUI Library requires the GNU Objective-C compiler, the GNUstep Base Library, the TIFF Graphics library, and a back-end component like the GNUstep 'Back' Backend. 1.2 Noteworthy changes in version `0.24.0' ========================================== New features include: * Require newer base release as we moved the -replaceObject:withObject: of NSKeyedUnarchiver there. * Support for newer releases of the gif library. * NSTabView is now flipped. * Theme improvements and changes to image mapping. Many bugfixes. 1.3 Where can you get it? How can you compile it? ================================================== The gstep-gui-0.24.0.tar.gz distribution file has been placed at `ftp://ftp.gnustep.org/pub/gnustep/core'. Read the INSTALL file or the GNUstep-HOWTO for installation instructions. 1.4 Where do I send bug reports? ================================ Please log bug reports on the GNUstep project page `http://savannah.gnu.org/bugs/?group=gnustep' or send bug reports to . 1.5 Obtaining GNU Software ========================== Check out the GNUstep web site. (`http://www.gnustep.org/'), and the GNU web site. (`http://www.gnu.org/') gnustep-gui-0.24.0/Documentation/0000775000076500007650000000000012256227325016561 5ustar brains99brains99gnustep-gui-0.24.0/Documentation/GuiAdditions.gsdoc0000664000076500007650000000241310512464124022156 0ustar brains99brains99 GuiAdditions $Revision: 23798 $ $Date: 2006-10-09 16:18:44 +0100 (Mon, 09 Oct 2006) $ 2005 Free Software Foundation, Inc. GuiAdditions

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

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

GSDisplayServer GSTheme GSHbox GSTable GSVbox
gnustep-gui-0.24.0/Documentation/ReleaseNotes.gsdoc0000664000076500007650000006470212256065556022212 0ustar brains99brains99 GNUstep Gui Release Notes $Revision: 37492 $ $Date: 2013-12-23 16:57:18 +0000 (Mon, 23 Dec 2013) $ 2005 Free Software Foundation, Inc. Gui Release Notes

The release notes include descriptions of API changes, behavior changes and other information that might help developers and users migrate to using a newer version of the library.

0.24.0

This is a major new stable release of GUI. Require newer base release as we moved the -replaceObject:withObject: of NSKeyedUnarchiver there.
New features include:

GIF library update Newer versions of the GIF library (5.0) have an incompatible interface change. We now support the new interface as well as the old one and detect at configure time which one to use. NSTabView flipped NSTabView was the last view class that still had its flipped state defined incorrectly. This finally got corrected. Theme improvements A lot more of the gui appearance is now changable by a theme. The way image names get mapped to real file names when loading has been clearified.Better support for 9-patch images. Additional Cocoa classes NSTreeController, NSTreeNode, NSStatusBar, NSStatusItem, NSTrackingArea Many bugfixes and tweaks to improve look and feel Cursor display is a lot more consistent.
0.23.1

This is a bugfix release containint many minor bugfixes, but most importantly fixing some coding/archiving bugs introduced in in the NSInteger,NSUInteger,CGFloat changes.

0.23.0

This is a major new stable release of GUI. Note that this version is binary incompatible with previous versions on 64-bit systems due to changes in some variables based on changes in GNUstep base to the type of NSNotFound.
New features include:

NSInteger,NSUInteger,CGFloat API and internals updated to use new types NSBezierPath Keyed encoding/decoding added Many bugfixes and tweaks to improve look and feel Most of the changes in this release are individually small changes fixing UI layout issues, responsiveness etc. The accumulated result should be a significantly smoother look and feel.
0.22.0

This is a major new stable release of GUI. Note that to improve stability, some features that were in previous releases have been removed. Newer and better implementation of these features will be added back soon. These include use of ghostscript and ImageMagic to automatically translate image formats, and an implementation of copy-on-scroll in NSClipView. Also note that this version is binary incompatible with previous versions on 64-bit systems due to changes in some variables based on changes in GNUstep base to the type of NSNotFound. New features include:

Support for drawing the GUI with a scale factor, for high-DPI monitors.

This is enabled automatically on Windows when the system DPI setting is changed from its default of 96 in the Windows control panel. It can be enabled on X11 (or the default overridden on Windows) by setting the GSScaleFactor user default. For example, setting this to 1.5 would make everything appear 50% larger.

The scale factor is implemented in GSWindowDecorationView; we use NSView's built-in scaling support and call -[NSWindow userSpaceScaleFactor] to determine how to manipulate the bounds and frame rect of the window decoration view. NSUnscaledWindowMask is respected, if it is part of a window's style mask. Note that changing the scale factor without restarting applications is currently unsupported, and all screens currently share the same scale factor. Both of these limitations should be reasonably easy to fix in a future release, however.

Character panel There is a character panel accessible from a button in the standard Font panel. It requires libicu. Color picker "Magnifier" tool, for grabbing the color of arbitrary parts of the screen Currently only implemented on X11/cairo. Many new image formats supported for reading using Ghostscript and ImageMagick The Ghostscript image rep provides PS/EPS/PDF support, however it has some limitations. It is quite slow. Only the first page is rendered, because we use the pngalpha Ghostscript device, which is the only device supporting 8-bit alpha.

Other improvements:

NSImage

Mac OS X 10.6 drawing methods (-[NSImage drawInRect:fromRect:operation:fraction:respectFlipped:hints:]). The rep selection code was completely overhauled, and it should work much better with images containing many reps. In particular, the DPI metadata in images is now respected, and TIFF images containing multiple resolutions are now fully supported.

Icons are now better supported. By icon, we mean an NSImage whose representations are not all of the same point size. Icons are usually ICNS or TIFF files. (Note that we aren't talking about a TIFF containing sub-images with different pixel sizes but the same point sizes.) The important thing about icons is -[NSImage size] should not be called, because the icon doesn't have one single size in points, but many sizes, so it's not clear which will be returned from this method. Similarly, -[NSImage drawAtPoint:fromRect:operation:fraction:] should be avoided, as should the -compositeToPoint: family of methods, since these use -[NSImage size] to determine how big to draw the image. The benefit of icons is that when -[NSImage drawInRect:fromRect:operation:fraction:] is called, the rep with the largest point size smaller than or equal to the rect to be drawn in will be chosen, resulting in better looking output. For best results, call drawInRect: with a point size you expect the icons to have, like 16x16 or 64x64.

NSCursor Support for creating 32-bit ARGB cursors on X11 (with the Xcursor library) NSView Autoresizing algorithm reimplemented to be closer to OS X. View frames generated by autoresizing are now rounded to lie on pixel boundaries.
Version 0.20.0

A new stable release. Many improvments with Nib loading, documents and document controllers. Fixed many drawing issues, particularly ones related to flipping. Much improved theming.

NSOutlineView Use NSInteger and CGFloat in method names where appropriate. NSDocument Change result type of method-saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo: from BOOL to void. NSView New 10.5 methods. NSCursor New 10.6 methods.
Version 0.18.0

A new stable release that has had many improvements. Many new Mac OS X methods (10.5 and newer) were added. Many Windows specific improvements were made (particularly with the use of the Windows theme). There is also better compatibility with Mac OS X in terms of usage of NSInteger and other definitions.

NSSliderCell Initial implementaiton of circular sliders. Spanish Translation Added spanish translations in various places. NSDrawers They now work. NSTableColumn New 10.6 methods and constants. Themes Usage of themes to draw UI elements is almost completely implemented.
Version 0.17.1

Bug fixes.

NSFont Add some missing interface methods from 10.5 NSSplitView Add live resize (can be turned off with GSUseGhostResize default)
Version 0.17.0

Many many bug fixes and almost complete reorganization of NSToolbar code.

NSBezierPath, NSAttributedString, NSLayoutManager New Mac OS X 10.5 methods. NSSpeechSynthesizer New class. NSSplitView Added new Mac OS X 10.5 methods and some ivars Toolbars Many improvements. NSToolbar methods rearragned and ivar removed. Menus MS Window-stype menus inside a window implemented Garbage Collection Several improvements to work better with GC HelpViewer GSHelpViewer use default added.
Version 0.16.0

This is an stable release. A lot of improvements and bug fixes went into this release. Thanks to Wolfgang Lux for fixing plenty of bugs. Note that gnustep-core is now installed in the LOCAL domain by default instead of the SYSTEM domain. You may want to remove old installations in the SYSTEM domain to avoid any incompatibility problems. Or you can force installation in SYSTEM using make GNUSTEP_INSTALLATION_DOMAIN=SYSTEM install.

Nib Loading Several methods were added and Nib loading in general was refactored and improved. NSDocument Document autosaving was implemented. NSSavePanel Several methods were added to implement support for document types with multiple allowed file extensions. NSWindow Definitions and skeleton implementation of attachedSheet. NSTextView Renamed and changed types of attributes related to drag and drop. NSLayoutManager New methods added to handle temporary attributes. NSWindowController NSWindowController was made a subclass of NSResponder. NSCell Rearranged somewhat to use GSTheme implemetations. NSTokenField, NSTokenFieldCell New classes added.
Version 0.14.0

This is an stable release.

NSGlyphGenerator New class for glyph generation (separated from other classes). NSControl -mouseDownFlags Added old NeXT method for compatibility. NSSplitView setAutosaveName: implemented and new instance variable added. NSOpenGLView Added some Mac OS X 10.3 methods.
Version 0.13.2

This is an unstable release.

NSPopUpButtonCell The encoding of this object was changed (which is backwards compatible, but not forwards compatible. NSTextView Add new X secondary selection behavior. Other Mac OS X methods added. NSWindow Device interaction with backend has changed. This release of gui requires the coresponding gnustep-back release 0.13.2. NSSegmentedCell New class added to draw and render text in segments. NSDrawer Implemented.
Version 0.13.1

This is an unstable release. Changes to error handling and key-value coding require an update to at least the base library version 1.15.1.

NSMenu Added more MacOS X methods and an ivar. NSView Added support for hiding views. Key-Value bindings Added Key-Value bindings implementation (NSKeyValueBinding) with support in several classes (NSControl, NSTextField, NSView, etc). NSTableView Added some MacOS X 10.4 methods. NSCursor Changed hot point to 0,0 for MacOS X compatibility.
Version 0.13.0

This is an unstable release. Changes to error handling and key-value coding require an update to at least the base library version 1.15.1.

Licence Switched to use LGPL 3 and GPL 3. New Methods added Added new methods from Mac OS X 10.4 for NSDragging, NSFontDescriptor, NSAttributedString, NSImageView, NSStringDrawing, NSParagraphStyle, NSView, NSCell, NSActionCell, NSAlert, NSApplication, NSBitmapImageRep, NSBox, NSColor, NSColorSpace, NSComboBox, NSComboBoxCell, NSDocumentController, NSEvent, NSScreen, NSFont, NSFontManager, NSFormCell, NSForm, NSWindow, NSTextField, NSTextFieldCell. Some ivar names were changed also. Printing Moved Postscript printing methods from NSView to NSGraphicsContext. View drawing Rewrote the NSView drawing mechanism to always use [displayRectIgnoringOpacity:inContext]. Flipped Controls Report more controls as being flipped. (NSTextField, NSTableHeaderView, NSSlider, NSProgressIndicator, NSButton) NSTabView is still missing. Font Attribute Add font attribute fixing to NSAttributedString. To allow for the output of glyphs not present in the current font. Optimization In NSAffineTransform use optimized primitive methods from base. Optimized the validation of edited cells. Key-Value Binding Implementation of special connectors for Key-Value binding.
Version 0.12.0

It has been a long time since the last release and many things have been added and changed, including new classes, new ivars, and new methods.

Tooltips A Tooltip implementation was added. NSBitmapImage Improvements Lots of improvements to the NSBitmapImage subclasses. Theming Improvements GSTheme and other classes were added to improve support of theming. New Methods added Added new methods from Mac OS X 10.4 for NSControl, NSResponder, NSDocument, NSPrintOperation, NSWindowController, NSCell, NSMenuItem, NSView. Some ivar names were changed also. New ivars added Added new ivars for NSMenuItem, NSPrintOperation, NSTableView, NSDrawer, NSScrollView, NSAlert, NSTextView. New Classes Added New classes from Mac OS X 10.4 and earlier were added including NSLevelIndicator, NSObjectController, NSUserDefaultsController, NSKeyValueBinding, NSArrayController, NSController. NSSpellServer moved to base NSSpellServer was moved to GNUstep base for Mac OS X compatibility. NSTabViewType enumerations Enumerations were changed to match values from Mac OS X. GNUstep GUI updated for Make 2.0 GNUstep GUI was updated to work with GNUstep Make 2.0. This includes versioned resources. NSAffineTransform moved to base Much of NSAffineTransform was moved to gnustep-base to match with Mac OS X. Many older methods were marked as deprecated in favor of the more recent Mac OS X methods. NSAlert in alternate threads NSAlerts are performed in the main thread even if called from another thread. NSAnimation Class Added Preliminary code for the NSAnimation class has been added. Only NSAnimationNonBlocking mode implemented.
Version 0.11.0 Keyed Encoding/Archiving Support for keyed encoding has been added to all gui classes. Nib loading Nib loading has been implemented. For the most part, nibs are (or should be) compatible between GNUstep and Mac OS X. Color schemes and Themes Better support for color schemes and themes has been added. In the near future theming should be integrated into gui itself. RTFD Loading and writting of RTFD format was implemented.
Version 0.10.3 Horizontal menus Horizontal (mac)-style menus should now work. Horizontal menus are activated by setting the 'NSMenuInterfaceStyle' user default to 'NSMacintoshInterfaceStyle'. Active applications Better support for tracking active applications was added. Normally a workspace manager should handle this, but the GUI library can handle it on its own if it is not handled any other way.
Version 0.10.2 Power Off The notification center posts a power off notification before sending a terminate: method sent from another app on the assumption that the terminate: is from a session manager.
Version 0.10.1 Sound library GNUstep now uses v19 of portaudio for the sound daemon. Version v19 hasn't been officially released, but it is still used in several distributions (SuSE, etc) as v18 is very old.
Version 0.10.0

The interface version of the gui library has changed in this release. Applications, libraries and tools that wish to use this new version must be recompiled (otherwise, they'll use the older version of the library).

Nib window autopositioning Nib loading has been improved to handle auto-positioning of windows. NSFont An ivar was added to NSFont to cache flipped fonts. NSApplication An ivar was added to track application launch. Keyed Encoding Work was done in many classes to support keyed encoding. It may not be fully implemented in every class, however. Backend Versioning The GUI library now looks for the backend bundle with the corrent interface version. Thus there should not be any problems with the GUI using the wrong backend.
Version 0.9.5

NSColor colors Added new control colors and methods from 10.3 version of Cocoa. NSFont methods Added new font methods from 10.3 version of Cocoa NSApplication -runModalSession Behavior of this method was changed. In particular it deviates from Cocoa documentation. See the GNUstep GUI documentation for specifics. Runtime version discovery of library A developer can discover the version of the gui library that is loaded using the NSBundle methods [[NSBundle bundleForLibrary: @"gnustep-gui"] infoDictionary] and retrieving the GSBundleVersion key.
Version 0.9.4

Interface version change The interface version of the gui library has changed in this release. There is no single reason for this change. Arguably, it should have been done long ago. In the future the interface version will only change with releases that have a new minor version number (that's the second number in the release number). Applications, libraries and tools that wish to use this new version must be recompiled (otherwise, they'll use the older version of the library). PPD's removed All the PPD's have been removed from the gui library into a separate package (gnustep-ppd). There still exists a single Generic Postscript Printer PPD which should work in many cases for printing using the standard lpr interface. In the future, a CUPS interface should be available that provides all the necessary printer information automatically. If you still want use of the PPD's, you must install the gnustep-ppd package, although this is not required for use of gnustep-gui. Printing framework The printing framework was generalized to allow for various types of native printing systems. The lpr system is the only complete one, although CUPS printing is in the works. As such, the printing classes were revamped to handle this, and the actual system-specific code is loaded from a bundle. NSScroller, NSScrollView class size change A new ivar was added to the NSScroller and NSScrollView classes.
Version 0.9.3

Spell checker daemon reimplemented using libaspell If the optional library libaspell is found, the spell checker will use it (otherwise spell checking will not work). New NSComboBox implementation NSComboBox and related classes have been re-implemented and documented. NSToolbar code redone A lot of changes where made to the NSToolbar class to make it more functional. Binary Incompatibilities New ivars were added NSTableView, NSView, NSSavePanel. Applications that use this class and subclasses (e.g. NSOutlineView) may need to be recompiled to work properly.
gnustep-gui-0.24.0/Documentation/.cvsignore0000664000076500007650000000035410377004044020554 0ustar brains99brains99gnustep-gui.texi version.texi version.tmpl.texi install.texi news.texi readme.texi announce.texi todo.texi *.log *.dvi *.ps *.html *.info *.aux *.toc *.cp *.fn *.vr *.tp *.ky *.pg *.ps *.vrs *.cl *.pr ANNOUNCE BUGS INSTALL NEWS README gnustep-gui-0.24.0/Documentation/set_show_service.10000664000076500007650000000201010727033424022203 0ustar brains99brains99.\"set_show_service(1) man page .\"put together by Dennis Leeuw .\"Copyright (C) 2003 Free Software Foundation, Inc. .\" .\"Process this file with .\"groff -man -Tascii set_show_service.1 .\" .TH SET_SHOW_SERVICE 1 "December 2007" GNUstep "GNUstep System Manual" .SH NAME set_show_service \- enable or disable a service for the current user .SH SYNOPSIS .B set_show_service [--enable ] [--disable ] .P .SH DESCRIPTION .B set_show_service enables or disables the display of a specified service item. .SH OPTIONS .TP \fB\--enable\fR \fB\\fR enable the given service for the user running this command. .TP \fB\--disable\fR disables the given service for the user running this command. .SH BUGS None known .P .SH SEE ALSO make_services(1), GNUstep(7) .P .SH HISTORY Work on .B set_show_service started in November 1998. .P .SH AUTHORS set_show_service was written by Richard Frith-Macdonald .P This man page was written by Dennis Leeuw . gnustep-gui-0.24.0/Documentation/news.texi0000664000076500007650000006101312256065556020437 0ustar brains99brains99@c -*-texinfo-*- @ifset TEXT-ONLY @include version.texi @end ifset @ifclear ANNOUNCE-ONLY @chapter NEWS The currently released version of the library is @samp{@value{GNUSTEP-GUI-VERSION}}. @end ifclear @section Noteworthy changes in version @samp{0.24.0} New features include: @itemize @bullet @item Require newer base release as we moved the -replaceObject:withObject: of NSKeyedUnarchiver there. @item Support for newer releases of the gif library. @item NSTabView is now flipped. @item Theme improvements and changes to image mapping. @end itemize Many bugfixes. @ifclear ANNOUNCE-ONLY @section Noteworthy changes in version @samp{0.23.1} This is a bugfix release, primarily to deal with coding/archiving issues. @section Noteworthy changes in version @samp{0.22.0} New features include: @itemize @bullet @item This version is binary incompatible with previous versions due to the change of NSNotFound in GNUstep base. @item Support for drawing the GUI with a scale factor, for high-DPI monitors. @item Character panel @item Color picker ``Magnifier'' tool, for grabbing the color of arbitrary parts of the screen @end itemize Many NSImage improvements (Mac OS X 10.6 drawing methods, better selection of image reps, better support for icons). Many bugfixes, including in Xib loading, printing, and NSView geometry. @section Noteworthy changes in version @samp{0.20.0} A new stable release. Many improvments with Nib loading, documents and document controllers. Fixed many drawing issues, particularly ones related to flipping. Much improved theming. @section Noteworthy changes in version @samp{0.19.0} This is an (unstable) copy of the 0.18.0 release @section Noteworthy changes in version @samp{0.18.0} A new stable release that has had many improvements. Many new Mac OS X methods (10.5 and newer) were added. Many Windows specific improvements were made (particularly with the use of the Windows theme). There is also better compatibility with Mac OS X in terms of usage of NSInteger and other definitions. @section Noteworthy changes in version @samp{0.17.1} @itemize @bullet @item New Mac OS X 10.5 methods in NSFont @item Add live resize in NSSplitView @end itemize @section Noteworthy changes in version @samp{0.17.0} @itemize @bullet @item New Mac OS X 10.5 methods in many classes @item Toolbars have been completely rewritten and improved. @item Several improvements for Garbage Collection @end itemize @section Noteworthy changes in version @samp{0.16.0} @itemize @bullet @item Nib loading refractored and improved. @item Added support for autosaving in NSDocuments @item NSWindowController made a subclass of NSResponder @item NSTokenField and netokenFiledCell classes added. @end itemize @section Noteworthy changes in version @samp{0.14.0} @itemize @bullet @item New class NSGlyphGenerator for glyph generation @item NSSplitView implemented setAutosaveName: @item NSOpenGLView added some Mac OS X 10.3 methods @item Manu bug fixes. @end itemize @section Noteworthy changes in version @samp{0.13.2} @itemize @bullet @item Printing works a little better now. @item NSPopUpButtonCell - object encoding was changed @item NSTextView - several updates and Mac OS X methods added @item NSWindow - devince interaction was changed. You need to use gnustep-back 0.13.2 with this version @item New class NSSegmentedCell. @item NSDrawer was implemented. @end itemize @section Noteworthy changes in version @samp{0.13.1} @itemize @bullet @item NSMenu - Added more MacOS X methods and an ivar. @item Added support for hiding views. @item Added Key-Value bindings implementation (NSKeyValueBinding) with support in several classes (NSControl, NSTextField, NSView, etc). @item Added some MacOS X 10.4 methods to NSTableView. @item Changed the NSCursor hot point to 0,0 for MacOS X compatibility. @end itemize @section Noteworthy changes in version @samp{0.13.0} This is an unstable release. There may be backward compatibility issues with previous releases of the gui library. @itemize @bullet @item Switched to use LGPL 3 and GPL 3. @item Added new methods from Mac OS X 10.4 for NSDragging, NSFontDescriptor, NSAttributedString, NSImageView, NSStringDrawing, NSParagraphStyle, NSView, NSCell, NSActionCell, NSAlert, NSApplication, NSBitmapImageRep, NSBox, NSColor, NSColorSpace, NSComboBox, NSComboBoxCell, NSDocumentController, NSEvent, NSScreen, NSFont, NSFontManager, NSFormCell, NSForm, NSWindow, NSTextField, NSTextFieldCell. Some ivar names were changed also. @item Moved Postscript printing methods from NSView to NSGraphicsContext. @item Rewrote the NSView drawing mechanism to always use [displayRectIgnoringOpacity:inContext]. @item Report more controls as being flipped. (NSTextField, NSTableHeaderView, NSSlider, NSProgressIndicator, NSButton) NSTabView is still missing. @item In NSAffineTransform use optimized primitive methods from base. @item Add font attribute fixing to NSAttributedString. To allow for the output of glyphs not present in the current font. @item Optimized the validation of edited cells. @item Implementation of special connectors for Key-Value binding. @item Base library version 1.15.1 is required for this release @end itemize @section Noteworthy changes in version @samp{0.12.0} It has been a long time since the last release and many things have been added and changed, including new classes, new ivars, and new methods. @itemize @bullet @item Lots of improvements to the NSBitmapImage subclasses thanks to Mark Tracy @item GSTheme and other classes were added to improve support of theming. @item Added new methods from Mac OS X 10.4 for NSControl, NSResponder, NSDocument, NSPrintOperation, NSWindowController, NSCell, NSMenuItem, NSView. Some ivar names were changed also. @item Added new ivars for NSMenuItem, NSPrintOperation, NSTableView, NSDrawer, NSScrollView. @item New classes from Mac OS X 10.4 and earlier were added including NSLevelIndicator, NSObjectController, NSUserDefaultsController, NSKeyValueBinding, NSArrayController, NSController. @item NSSpellServer and NSAffineTransform was moved to GNUstep base for Mac OS X compatibility. @end itemize @section Noteworthy changes in version @samp{0.11.0} @itemize @bullet @item Added support for keyed encoding in all gui classes. @item Added mechanism to allow for dynamic extension of model loading mechanism @item Implemented glue code in GSNibCompatibility for classes such as NSIBObjectData, NSClassSwapper, etc. to facilitate nib loading. @end itemize @section Noteworthy changes in version @samp{0.10.3} @itemize @bullet @item Horizontal menus now work @item Better support for tracking active applications. @end itemize @section Noteworthy changes in version @samp{0.10.2} Mostly bug fixes. @section Noteworthy changes in version @samp{0.10.1} GNUstep now uses v19 of portaudio for the sound daemon. Version v19 hasn't been officially released, but it is still used in several distributions (SuSE, etc) as v18 is very old. @section Noteworthy changes in version @samp{0.10.0} This release is binary incompatible with previous releases. The interface version of the library has changed so that apps, tools and libraries that use the base library need to be recompiled to use this new version. @itemize @bullet @item Model loading supports window auto-positioning @item Keyed encoding is supported in many classes. @end itemize @section Noteworthy changes in version @samp{0.9.5} @itemize @bullet @item Beginnings of CUPS interface were added. @item Added new control colors and methods from 10.3 version of Cocoa. @item Added new font methods from 10.3 version of Cocoa. @item NSApplication -runModalSession behavior changed. @item You can find the GUI library's version using the Info.plist @end itemize @section Noteworthy changes in version @samp{0.9.4} @itemize @bullet @item The printing classes have been completely reorganized to accommodate different native printing systems (Thanks to Chad Hardin). @item PPD files have been moved to a separate package. @item NSToolbar now allows rearranging items. @item NSScroller, NSScrollView has a new ivar. @item Some improvement of NSDataLink classes. @end itemize @section Noteworthy changes in version @samp{0.9.3} @itemize @bullet @item Spell checker reimplemented using libaspell @item New NSComboBox implementation @item NSToolbar much improved @item Binary incompatibilites from ivar additions in NSView and subclasses. @end itemize @section Noteworthy changes in version @samp{0.9.2} @itemize @bullet @item Working NSToolbar implementation @item New Mac OS X methods in NSView and other classes @item Fixed some sheet handling problems. @item Integrated gif, jpg, and png handling in front-end. @item Added overridable button and frame drawing functions @item Add some keyed decode/encoding to some classes @item NSStringDrawing redesigned. @item Much improved loading of gorm files @end itemize @section Noteworthy changes in version @samp{0.9.1} @itemize @bullet @item NSWindow - DnD works on whole window and events are propogated up to first DnD aware view. @item Absolute paths and DnD works in OpenPanels. @end itemize @section Noteworthy changes in version @samp{0.9.0} Improvements in various classes, include NSPopUpButton, NSBitmapImageRep, NSMenu, NSToolbar. Added support for thumbnail images in NSWorkspace. @section Noteworthy changes in version @samp{0.8.9} Note that many headers have moved to new locations (both in the package and when installed), so it is possible, although not likely that some applications may not compile because they cannot find the right header. @itemize @bullet @item New Language Setup documentation. @end itemize @section Noteworthy changes in version @samp{0.8.8} @itemize @bullet @item Updated LanguageSetup documentation @item Improved RTF reader (unicode support, etc). @end itemize @section Noteworthy changes in version @samp{0.8.7} @itemize @bullet @item NSBezierPath glyph methods implemented (depends on backend). @item NSDataLink[Panel/Manager] - some implementation @item Added default to load user-defined bundles (GSAppKitUserBundles default). @end itemize @section Noteworthy changes in version @samp{0.8.6} Updated to install in new locations based on changes in gnustep-make 1.7.0. @itemize @bullet @item New implementation of RTF producer (from Axel "Mikesch" Katerbau) @item Speed improvements, especially in tracking mouses movements. @item Lots of menu improvements. @end itemize @section Noteworthy changes in version @samp{0.8.5} Bug fixes. NSStringDrawing now uses text system implementation. @section Noteworthy changes in version @samp{0.8.4} This release features a brand new text and layout system thanks to Alexander Malmberg. Other improvements include: @itemize @bullet @item Various display optimizations. @item Default border to NSScrollView changed @item Printing fixes. @item NSToolbar partially implemented. @end itemize @section Noteworthy changes in version @samp{0.8.3} @itemize @bullet @item Additions for Gorm support. @item Alpha support for OpenGL @item Better ruler support - dragging of tab markers. @item Document support, recent files, etc. @item Simple printing to printer and print previewing. @item Window focus fixes @item Key view handling rewritten. @end itemize @section Noteworthy changes in version @samp{0.8.2} @itemize @bullet @item Handle fonts that aren't found better. @item Implement pageUp/Down. @item Some window focusing problems fixed. @item Quartz-like interface partially implemented. @item NSSecureTextField partially rewritten. More secure. @item NSBrowser: implement non-separate columns @item Fix firstResponder status in text fields. @end itemize @section Noteworthy changes in version @samp{0.8.1} @itemize @bullet @item Handle scaled curves correctly. @item Handle alpha channel with images correctly @item NSWindow frame string save without flipping coordinates. @item NSSound implemented. gssnd sound server. @item Spell checker starts correctly now. @end itemize @section Noteworthy changes in version @samp{0.8.0} @section Noteworthy changes in version @samp{0.7.9} @itemize @bullet @item NSTableView, NSOutlineView improvements. @item Menus no longer work in modal loop. @item Skeleton implementation of NSToolBar @end itemize @section Noteworthy changes in version @samp{0.7.8} @itemize @bullet @item Wheel color picker, standard color picker (bundles) added. @item System colors now use named colors. Easier configuration @end itemize @section Noteworthy changes in version @samp{0.7.7} The graphics/window interface was completely revamped. Window functions were split into a separate class, GSDisplayServer, and many PS and DPS functions were removed that were never implemented. However, new functionality was added to make things faster and eventually implement Quartz compatibility. In addition, the old backends, xgps and xdps were depreciated in favor of a new backend, simply named back, which can be configured for a variety of window server and graphics implementations, and also allow for improved code sharing. In addition there is now a window server backend for Windows computers, although it is in a very alpha state. Other improvements: @itemize @bullet @item Mutliple screens are now handled properly (untested) @item Better autolayout with GSTable and subclasses. @item NSOutlineView much improved. @end itemize @section Noteworthy changes in version @samp{0.7.6} @itemize @bullet @item NSOutlineView implemented. @item Improvements to NSTableView, NSPopUpButton, NSTextView, NSFontPanel @item Scroll wheel support. @item Fully-functional keybindings, including multi-stroke keybindings. @item Memory panel available from Info Panel. @end itemize @section Noteworthy changes in version @samp{0.7.5} @itemize @bullet @item Drag and drop and image sliding much improved. @item Better handling of remote startup/display. @item Some localization. @item Keybinding support. @item Text handling improvements. @item New gopen command (like MacOSX open command). @item Implemented simple pagination and printing of views. @item Support for rulers. @item Spell checking support. @item Blinking insertion point. @item New NSStepper class. @item Implemented NSOutlineView, NSSelection, NSInputManager. @item Near rewrite of Menu handling code. @item Gmodel code compiled as a separate bundle. @end itemize @section Noteworthy changes in version @samp{0.7.0} @itemize @bullet @item Much improvement in NSBrowser, NSMatrix, NSPopUpButton, combo boxes. @item NSTextAttachement implemented, many other text improvements. @item Fonts cached in the frontend. @item Changes so that backend can be loaded as a bundle at runtime. @item simpler, faster compilation and installation. @item NSColorWell works. @end itemize @section Noteworthy changes in version @samp{0.6.7} @itemize @bullet @item App Icons can support documents dropped using DnD. @item Added color conversions, working color picker and panel. @item Almost complete rewrite of NSBezierPath @item Loads of improvements to Text classes. @item NSImage, NSButton, NSCell, etc, implemented many missing methods. @item ...and even more changes to the Text classes. @item Starting implementation of printing. @item Scrollview fixes. @item Implemented deferred windows. @item NSTableView implemented. @item Implemented object value and formatter support in NSCell @item Support middle mouse button. @end itemize @section Noteworthy changes in version @samp{0.6.6} @itemize @bullet @item Window hints for motif and generic window managers. @item Major improvements to the text handling classes (NSText, NSTextView, etc) @item Pasting of fonts and rulers. @item Much better RTF handling @item DnD for NSColorWell @item Much improved NSSplitView @item New classes - NSColorPanel, NSTableView @item NSScreen rewritten with full support for all methods and functions. @item Can use image reading routines from WindowMaker if available to read a variety of image formats besides TIFF. @item Many fixes to get the AppKit to work better with WindowMaker. @item Much better gmodel support (particularly with nibs translated from NeXT or OPENSTEP 4.2). @item Muh improved font classes and font support. @end itemize In addition both the xgps and xdps backends have seen some large efficiency improvements. Much better font support. The xdps backend itself has seen speed improvements by at least a factor of 4. Note however, that the xdps backend is still considered experimental and you may have to deal with many problems in order to get it working. We recommend sticking with the xgps backend (the default) for now. @section Noteworthy changes in version @samp{0.6.5} Many of the basic GUI classes have been vastly improved or rewritten, thanks to Nicola Pero @email{n.pero@@mi.flashnet.it} and many others. @itemize @bullet @item New Info Panel support @item New NSBezierPath @item Rewrite of several classes including Cell and Button classes. @item Rewrite of NSBrowser, NSSavePanel, menus, text classes, NSTableHeader. @item RTF Parser @item Implemented image caching. @item Implemented editing in Forms, Matricies. @item New autolayout classes GSHBox, GSTable, and GSVBox. @item Almost all back-end classes have been removed and code incorporated in a DPS-like graphics context structure. @item Better keyboard handling. @item NSHelpManager, NSComboBox, ProgressIndicator written. @end itemize In addition a preliminary version of an Interface Builder (Gorm) has been written, thanks to Richard Frith-Macdonald @email{richard@@brainstorm.co.uk} @section Noteworthy changes in version @samp{0.6.0} A Huge amount of progress, although a lot still needs to be done. It's usable for a large base of moderately simple apps. Several NeXT/OpenStep apps and libraries have been ported with little changes. @itemize @bullet @item Drag and Drop support fleshed out but not completed. @item NSText and related classes rewritten. Basic functionality but much needs to be done to finish them off. @item nib2gmodel app works with MacOS-X @item Work done in minimizing the backend which allowed a lot of functionality to move to the GNU library. @item Menu code rewritten. @item PopupButtons now work. @item Many new images @item Basic functionality for NSTabView @item Much better lockFocus support in NSView. Flipped views handled. @item Rewrite of NSSavePanel and NSOpenPanel @item Several fixes that at least double the speed of the gui. @end itemize @section Noteworthy changes in version @samp{0.5.5} Too extensive to list. @itemize @bullet @item A lot of rewritting has been done to the classes, with general cleanup of coordinate conversion code, etc. @end itemize @section Noteworthy changes in version @samp{0.5.0} @itemize @bullet @item NSBrowser and NSBrowserCell have been implemented. There is one odd display artifact; lists which are smaller than the browser column area have the list justified to the bottom of the column versus the top of the column. This is actually an issue with NSMatrix and will be remedied when flip views are implemented. @item Two important optimizations that speed up the displaying of views and flushing of windows have been implemented. Only the views that need display and those that produce visible effects on the screen receive the -drawRect: message. Flushing of windows occurs only in rectangles that get displayed not in the whole window. @item Rotation and scaling of views have been finally implemented. The code requires backend support for changing the state of the graphics context accordingly. @item NSScrollView and NSClipView have been implemented. The current implemented behavior is to call the document view to display the exposed region. Copying on scroll will be supported soon, at least on Solaris DPS, where it seems the Postscript language has provisions for copying drawn regions of screen. Hopefully DGS will also have this facility by the end of the year. @item NSScroller has been completely reworked to gain speed by using timer events. @item NSSlider has been implemented. Thanks to Frank Knobloch for supporting this and the NSScrollView implementation. @item NSBox has been implemented. @item The library has been ported to work under Solaris with the native DPS and the NeXT/Apple's Portable Distributed Objects (PDO) environment. @item The library has been integrated with the makefile package so we now benefit from all of the features the makefile package gives us, especially the possibility to build shared libraries on various systems and having different types (debug and profile) of the library compiled at the same time. @item NSCell is able to continuosly send the action to the target while the user is tracking the mouse. @item Several cleanups and as usual, many bug fixes. @end itemize @section Noteworthy changes in version @samp{0.3.0} @itemize @bullet @item Completely reworked the menu class. The NSMenu class is now inherited from NSObject and using the new implementation menus have been implemented for the XDPS backend (they have the look and feel of the NeXTStep menus!). @item NSRunLoop has been integrated with NSApplication. Using this capability time events have been implemented to NSEvent class. These events allow several improvements in the interaction between user and the graphic interface. @item NSMatrix has been reworked, it is now conforming to the OpenStep specification and it knows all the selection modes. It uses time events to enhance the drawing speed during mouse drags. @item The initial implementation of NSForm has been made although it has not been tested yet. @item NSPrinter has been implemented though it was not throughly tested; thanks to Simon Frankau. @item Configure script has been changed to detect the underlaying Foundation library. The currently supported libraries are gnustep-base and libFoundation. @item Several cleanups have been made in a lot of classes: the retain/release policy has been fixed, the cell classes correctly implement the NSCopying protocol and many others. @end itemize @section Noteworthy changes in version @samp{0.2.0} @itemize @bullet @item Additional NSImage and NSImageRep class work. Incorporated common images for use with controls that were designed by Andrew Lindesay. @item Fill out implementation of NSColorWell class. @item Fill out implementation of NSColorList class. @item Cleaned up the header files and added missing headers, methods, categories, and protocols; thanks to Simon Frankau for much of this work. Major reorganization of header files. Types and constants were moved in the files they belong. Each header file includes only the headers it really needs. Use @samp{@@class} to forward class definitions instead of including the corresponding class file. @item Completely reworked the NSFont and NSFontManager classes so that NSUserDefaults is used for getting defaults and list of known fonts are maintained. @item Initial implementation of NSCursor class. @item Almost complete implementation of NSButton and NSButtonCell class. Buttons can now display images and/or text, handles all of the OpenStep button types and styles. @item Fill out implementation of NSScroller class. @item Put in underlying support for optimizing drawing; flushing of windows, backing store, and only display when needed. @item Many bug fixes and minor enhancements. @end itemize @section Noteworthy changes in version @samp{0.1.1} @itemize @bullet @item Almost complete implementation of the PXKMenu and PXKMenuCell classes. @item Fill out implementation of NSFont and NSFontManager. @item Fill out implementation of NSColor including color spaces other than RGB. Now maintains the common colors as global variables. @item Integration with the Display Ghostscript System. This is mainly related to using the header files in the DPSclient library for defining the PostScript operator functions. @item Initial documentation set. @item Initial implementation of NSImage, NSImageRep, and NSImageRep subclass classes based upon work by Adam Fedor. @item Now requires the TIFF library for reading, writing, and manipulating tiff files and images. @end itemize @section Noteworthy changes in version @samp{0.1.0} @itemize @bullet @item Integration of the GNUstep X/DPS GUI Backend. This has finally produced a set of core code with can display on X/Windows. Much of the X/Windows code has been written by Pascal Forget @email{pascal@@wsc.com} and integration efforts have been lead by Scott Christley @email{scottc@@net-community.com}. @item Some major directory reorganization for the new naming guidelines. Headers previously in AppKit and DPSClient directories have been moved to gnustep/gui and gnustep/dps directores and symbol links are created for the AppKit and DPSClient directories. This should allow both GNUstep and other OpenStep implementations to reside on the same machine without conflicts. @end itemize Also see the @samp{ChangeLog} file for more detail. @end ifclear @c end ifclear ANNOUNCE-ONLY gnustep-gui-0.24.0/Documentation/manual/0000775000076500007650000000000012256227325020036 5ustar brains99brains99gnustep-gui-0.24.0/Documentation/manual/fdl.texi0000664000076500007650000005440310537306212021475 0ustar brains99brains99@c GNUstep AppKit Guide @c @c Copyright (c) 2005-2006 Christopher Armstrong. @c @c Permission is granted to copy, distribute and/or modify this document @c under the terms of the GNU Free Documentation License, Version 1.2 @c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. @c A copy of the license is included in the section entitled "GNU @c Free Documentation License". @c @c This documentation is provided on an "AS IS" BASIS, WITHOUT WARRANTY @c OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED @c TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @c PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND USEFULNESS @c OF THE DOCUMENTATION IS WITH YOU (THE LICENSEE). IN NO EVENT WILL THE COPYRIGHT @c HOLDERS BE LIABLE FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, @c SPECIAL, GENERAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF @c THE USE OR INABILITY TO USE THIS DOCUMENTATION (INCLUDING BUT NOT @c LIMITED TO LOSS OF DATA, USE, OR PROFITS; PROCUREMENT OF SUBSTITUTE @c GOODS AND SERVICES; OR BUSINESS INTERUPTION) HOWEVER CAUSED, EVEN @c IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @node fdl, , images, Top @appendix GNU Free Documentation License @center Version 1.2, November 2002 @display Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @end display This documentation is provided on an "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND USEFULNESS OF THE DOCUMENTATION IS WITH YOU (THE LICENSEE). IN NO EVENT WILL THE COPYRIGHT HOLDERS BE LIABLE FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, SPECIAL, GENERAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENTATION (INCLUDING BUT NOT LIMITED TO LOSS OF DATA, USE, OR PROFITS; PROCUREMENT OF SUBSTITUTE GOODS AND SERVICES; OR BUSINESS INTERUPTION) HOWEVER CAUSED, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @enumerate 0 @item PREAMBLE The purpose of this License is to make a manual, textbook, or other functional and useful document @dfn{free} in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of ``copyleft'', which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. @item APPLICABILITY AND DEFINITIONS This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The ``Document'', below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as ``you''. You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. A ``Modified Version'' of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A ``Secondary Section'' is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The ``Invariant Sections'' are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. The ``Cover Texts'' are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. A ``Transparent'' copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not ``Transparent'' is called ``Opaque''. Examples of suitable formats for Transparent copies include plain @sc{ascii} without markup, Texinfo input format, La@TeX{} input format, @acronym{SGML} or @acronym{XML} using a publicly available @acronym{DTD}, and standard-conforming simple @acronym{HTML}, PostScript or @acronym{PDF} designed for human modification. Examples of transparent image formats include @acronym{PNG}, @acronym{XCF} and @acronym{JPG}. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, @acronym{SGML} or @acronym{XML} for which the @acronym{DTD} and/or processing tools are not generally available, and the machine-generated @acronym{HTML}, PostScript or @acronym{PDF} produced by some word processors for output purposes only. The ``Title Page'' means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, ``Title Page'' means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. A section ``Entitled XYZ'' means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as ``Acknowledgements'', ``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title'' of such a section when you modify the Document means that it remains a section ``Entitled XYZ'' according to this definition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. @item VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. @item COPYING IN QUANTITY If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. @item MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: @enumerate A @item Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. @item List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. @item State on the Title page the name of the publisher of the Modified Version, as the publisher. @item Preserve all the copyright notices of the Document. @item Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. @item Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. @item Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. @item Include an unaltered copy of this License. @item Preserve the section Entitled ``History'', Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled ``History'' in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. @item Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the ``History'' section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. @item For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. @item Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. @item Delete any section Entitled ``Endorsements''. Such a section may not be included in the Modified Version. @item Do not retitle any existing section to be Entitled ``Endorsements'' or to conflict in title with any Invariant Section. @item Preserve any Warranty Disclaimers. @end enumerate If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. You may add a section Entitled ``Endorsements'', provided it contains nothing but endorsements of your Modified Version by various parties---for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. @item COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections Entitled ``History'' in the various original documents, forming one section Entitled ``History''; likewise combine any sections Entitled ``Acknowledgements'', and any sections Entitled ``Dedications''. You must delete all sections Entitled ``Endorsements.'' @item COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. @item AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an ``aggregate'' if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. @item TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. If a section in the Document is Entitled ``Acknowledgements'', ``Dedications'', or ``History'', the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. @item TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. @item FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See @uref{http://www.gnu.org/copyleft/}. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License ``or any later version'' applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. @end enumerate @page @appendixsec ADDENDUM: How to use this License for your documents To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page: @smallexample @group Copyright (C) @var{year} @var{your name}. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''. @end group @end smallexample If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the ``with...Texts.'' line with this: @smallexample @group with the Invariant Sections being @var{list their titles}, with the Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}. @end group @end smallexample If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation. If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software. gnustep-gui-0.24.0/Documentation/manual/LICENSE0000664000076500007650000005144610534730035021047 0ustar brains99brains99 This documentation is licenced under the GNU Free Documentation License Version 1.2. This documentation is provided on an "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND USEFULNESS OF THE DOCUMENTATION IS WITH YOU. IN NO EVENT WILL THE COPYRIGHT HOLDERS BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, SPECIAL, GENERAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENTATION (INCLUDING BUT NOT LIMITED TO LOSS OF DATA, USE OR PROFITS; PROCUREMENT OF SUBSTITUTE GOODS AND SERVICES; OR BUSINESS INTERUPTION) HOWEVER CAUSED, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------------------------------------------------------------------- GNU Free Documentation License Version 1.2, November 2002 Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. 0. PREAMBLE The purpose of this License is to make a manual, textbook, or other functional and useful document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. 1. APPLICABILITY AND DEFINITIONS This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not "Transparent" is called "Opaque". Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only. The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as "Acknowledgements", "Dedications", "Endorsements", or "History".) To "Preserve the Title" of such a section when you modify the Document means that it remains a section "Entitled XYZ" according to this definition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. 2. VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. 3. COPYING IN QUANTITY If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. 4. MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. B. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. C. State on the Title page the name of the publisher of the Modified Version, as the publisher. D. Preserve all the copyright notices of the Document. E. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. F. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. H. Include an unaltered copy of this License. I. Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. J. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. K. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. M. Delete any section Entitled "Endorsements". Such a section may not be included in the Modified Version. N. Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title with any Invariant Section. O. Preserve any Warranty Disclaimers. If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. 5. COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections Entitled "History" in the various original documents, forming one section Entitled "History"; likewise combine any sections Entitled "Acknowledgements", and any sections Entitled "Dedications". You must delete all sections Entitled "Endorsements". 6. COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. 7. AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an "aggregate" if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. 8. TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. 9. TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 10. FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. ADDENDUM: How to use this License for your documents To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page: Copyright (c) YEAR YOUR NAME. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the "with...Texts." line with this: with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation. If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software. gnustep-gui-0.24.0/Documentation/manual/theviewconcept.texi0000664000076500007650000005014610537306212023757 0ustar brains99brains99@c GNUstep AppKit Guide @c @c Copyright (c) 2005-2006 Christopher Armstrong. @c @c Permission is granted to copy, distribute and/or modify this document @c under the terms of the GNU Free Documentation License, Version 1.2 @c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. @c A copy of the license is included in the section entitled "GNU @c Free Documentation License". @c @c This documentation is provided on an "AS IS" BASIS, WITHOUT WARRANTY @c OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED @c TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @c PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND USEFULNESS @c OF THE DOCUMENTATION IS WITH YOU (THE LICENSEE). IN NO EVENT WILL THE COPYRIGHT @c HOLDERS BE LIABLE FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, @c SPECIAL, GENERAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF @c THE USE OR INABILITY TO USE THIS DOCUMENTATION (INCLUDING BUT NOT @c LIMITED TO LOSS OF DATA, USE, OR PROFITS; PROCUREMENT OF SUBSTITUTE @c GOODS AND SERVICES; OR BUSINESS INTERUPTION) HOWEVER CAUSED, EVEN @c IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @anchor{The view concept} @node theviewconcept, eventhandling, controls, Top @chapter The view concept This chapter discusses the concepts surrounding @dfn{views} and goes into some detail what can be done with them. As a result, most of this chapter is concerned with the creation of custom views, which is not necessary for general application development. If you want to create your own view classes or are interested in how GNUstep manages views, then this chapter should be useful. @section Introduction In GNUstep applications, we introduce the idea of a @dfn{view}. A view is a graphical element on the window in your interface. It is much like the idea of a window in the Microsoft Windows C API, except more powerful. Note that views are a @dfn{generalisation} of a control, that is, a control is a special type of view. A view is a subclass of the AppKit @code{NSView} class. You should not instantiate this class directly, but instead use a class that is derived from it. A custom view can be created by inheriting from it. @section The view hierachy A view may contain any number of @dfn{subviews}, which are views that are displayed within it. Those views may also have subviews, and as a result, you can setup a hierachy of views. This can be a powerful model for your interface designs (especially where you create your views programatically instead of just in @command{Gorm.app}). Each window has a primary view, known as the @dfn{content view}, which acts as a top-level view (or @dfn{superview}) to all the views you place on your window. It sits at the top of the view hierachy. Most applications will only have one level of views below the content view, and for most applications, this is all you need. @section Frames and Bounds @cindex views, bounds @cindex views, frame As views can be placed within other views, GNUstep needs to setup some rules to determine how this will work. Due to this, each view has two important properties defining how it is positioned and displayed on the screen. These are it's @dfn{frame} and its @dfn{bounds}. GNUstep uses cartesian coordinate systems for defining positions and sizes. It has the origin of any coordinate system placed at the bottom-left corner and has an x-axis and a y-axis. Like a normal cartesian coordinate system, the x-axis runs from left to right, and the y-axis runs from the bottom to the top. A view is defined within two coordinate systems, not just the coordinate system of the entire screen or window. The frame and the bounds describe the view in terms of a rectanglei placed in a coordinate system. The rectangle has an origin (located at the bottom-left corner of the rectangle) and a width and a height. Programmatically, the concept of a rectangle is tied up in an @code{NSRect} structure, which in turn contains an @code{NSPoint} structure (for the origin) and an @code{NSSize} structure. The contents of your view is not dissimilar to a canvas. You can draw anywhere on this canvas, but only a certain portion of it is displayed. Where it is displayed and what part of it you choose to display is defined in the frame and the bounds rectangle of the view. The @dfn{frame} is the location and size of your view, as defined in its superview. The content view has it's frame defined with it's origin at the bottom-left corner of a window, and it's width and height equal to that of the window it is placed in (ignoring the window decoration). If you change the origin of your frame rectangle, you effectively move your view within it's superview. By changing the frame rectangle's width or height, you resize your view with regards to the coordinate system of it's superview. @c @image{diagrams/viewwithsubview,465pt,345pt,@-,.svg} The @dfn{bounds} rectangle defines what part of your view's internal coordinate system will be displayed. It is therefore defined in the coordinate system of your view. By default, it is set to be a rectangle located at the origin of your view's internal coordinate system, with it's size set to be the same size as your frame rectangle. However, it can be programatically streched, rotated, moved and skewed so that various parts of your view's internal coordinate system are displayed in it's frame rectangle. In essence, the @dfn{frame} is defined by the coordinate system of your view's superview, and the @dfn{bounds} is defined by the coordinate system of your view. These concepts can be difficult to grasp, so we recommend you read over this bit, as well as play around with the various methods in GNUstep that let you modify the bounds and frame rectangles of a view. It is the internal coordinate system where your view does it's drawing and which defines the location and size of any subviews. It is the coordinate system of your view's superview that defines where and how big your view is displayed. @section Manipulating the coordinate system As mentioned earlier, the bounds and frame of a view can be stretched, shrunken, shifted and even rotated. Firstly we will show you how to manipulate these directly, and then briefly describe the mathematics behind coordinate transformations. NSView provides some simple methods for manipulating the coordinates and coordinate systems of the frame and bounds rectangles. Note that after calling any of these methods, you need to get the view to redisplay itself manually. You can do this by calling the @code{-setNeedsDisplay:} and @code{-display:} on the view o bject. We can change where a view is placed within it's superview (most likely the window's content view) by manipulating it's frame origin. This is done using the @code{-setFrameOrigin:} method. For convenience, you can use the @code{NSMakePoint()} function to easily construct a point for the new location. The size of a view's frame can also be adjusted using the @code{-setFrameSize:} method. Similiarly, the @code{NSMakeSize()} method can be used to construct an @code{NSSize} parameter that is needed. Changing this will cutoff whatever is internal to the view, although some classes behave differently. Check the documentation for the class with regards to it's reaction to a change in it's frame size. Where necessary, these can be adjusted as a rectangle, making use of the @code{-setFrame:} method and the @code{NSMakeRect()} function. Methods used for manipulating the bounds have subtly different meanings. Like the frame rectangle, the bounds rectangle can be manipulated as well. The bounds origin and size can be manipulated using the @code{-setBoundsOrigin:} and @code{-setBoundsSize:} methods respectively. Changing the bounds origin effectively sets the new origin to be displayed at the origin of your frame rectangle. Changing the bounds size can be used to skew the coordinate system of the bounds, as it is displayed within the frame rectangle. Another method for skewing the internal coordinate system of a view is to use the @code{-scaleUnitSquareToSize:} method. It's useful when you need to express your transformation as a percentage or fraction, where a size of 1.0 is considered to be 100%. Note that this method is cumulative, so that when you set this, it is effectively the first transformation multiplied by the second. For example, setting it to 0.5 and the 0.75 is the same as setting it to 0.5 x 0.75 = 0.375. To rotate the frame or bounds rectangle counterclockwise, call the @code{-setFrameRotation:} or @code{-setBoundsRotation:} methods respectively. These methods take an angle in degrees. You can specify clockwise rotation with a negetive angle. Alternatively, you can rotate the bounds rectangle by using the @code{-rotateByAngle:} method. This method rotates the bounds on top of what it has already been rotated. @section Subclassing NSView Sometimes the need arises to create a custom view. This is achieved by subclassing NSView. From here, you can override default event handlers and drawing methods to customise your view's representation. Note that in some cases, the @code{NSControl} class may prove to be a better model for your custom view, especially if it behaves more like a control instead of an entire document representation. You should read the chapter on controls and weigh up the options for creating a view vs creating a control. This section is still useful though to understand the drawing code aspect, which is relevant to the display of control's as well. @subsection Drawing code One of the first things you will do is write your own drawing code. All custom drawing code is placed in the @code{NSView} method @code{drawRect:}. NSView's implementation is blank by default. In this section, we will describe the various facilities at your disposal for drawing in a view. @subsection NSBezierPath This class is an abstract representation of a @dfn{bezier path}. A bezier path contains a series of straight and curved lines representations which come together to form a number of shapes that describe the object you wish to draw. This "path" can then be "filled", "stroked" or used as a clipping path within the view you are working on. It also contains the pen width, pen dash information and the current point. A bezier path represents a series of graphical primitives operations. You call methods corresponding to these operations on an @code{NSBezierPath} object, and when it is drawn, these operations are executed in the order that you called them on the object. @cindex bezier paths, current point It also has a concept of a @dfn{current point}. After every graphics operation, a new, internal point is set that will be used as the start point for the next operation. It is the destination point of the previous operation. For example, if you want a bezier path to move to the point origin, then draw a line from the origin to point (10,20), then a line from (10,20) to (20,20) you only require three operations, i.e. (in psuedocode): @smallexample move to (0,0) draw a line to (10,20) draw a line to (20,20) @end smallexample In this case, the bezier path first sets the current point to (0,0). Then, when the line operation is called, you only pass in the destination point, (10,20), which causes it to draw a line from (0,0) to (10,20). After the line operation, the current point is set to the destination of the line operation, i.e. (10,20). Then, the next line operation draws a line from (10,20) to (20,20). In this way, we only need specify the destination point for line and move operations, as the start point is determined by the destination point of the previous operation. There is no need to specify the start point for each drawing operation, as it is implied by the destination point of the previous operation. You can get the current point by calling the @code{currentPoint:} method. These operations are listed in the table below: @cindex bezier paths, operations @table @dfn @item Move Operation A move operation lifts the pen up and puts it at a new location, i.e. changes the current coordinates without drawing. This can be achieved throught the @code{-moveToPoint:} method, which takes a point as it's first parameter. It implicitly begins a new sub-path (see below). @item Line Operation A line operation draws a line from the current point to a new point. The @dfn{current point} is set either through a move operation, or through the last point in a previous line or curve operation. Once the line operation is complete, the @dfn{current point} is set as the destination point. We can draw a line using the @code{lineToPoint:} method. @item Curve Operation This one is more complex, as it involves the real magic of bezier paths. It consists of four points: the start point, the destination point, and two @dfn{control points}. How this works is beyond the scope of this manual@footnote{@cite{Wikipedia} has good information on the mathematics and theory behind bezier curves/paths} and is not required to draw simple circles, ellipses and arcs. We can draw a circle or an ellipse by calling @code{appendBezierPathWithOvalInRect:}, passing in a rectangle for the shape to be drawn in. A few methods are provided for adding arcs, with @code{appendBezierPathWithArcFromPoint: toPoint: radius:} useful for adding an arc between two points and the @code{appendBezierPathWithArcWithCenter: radius: startAngle: endAngle:} method useful for drawing an arc with a particular centre point. For those familiar with bezier curves or who know their control points, the @code{curveToPoint:controlPoint1:controlPoint2:} method can be used to draw curves that way. All curve operations set the current point to the destination of the curve. @item Close Path Operation As bezier paths actually consist of many sub-paths, one can close the current set of path operations with the @code{closePath} method to avoid creating a new NSBezierPath method. @end table A bezier path also consists of a number of @dfn{sub-paths}. After a series of move, line and curve operations, a @dfn{close path} operation is inserted to into the bezier path to indicate the end of a sub path. This concept is important with the filling commands. @subsection Stroking, Filling and Clipping @cindex bezier paths, rendering operations @cindex bezier paths, stroking/filling/clipping Once you've assembled a path, you can render it in a number of ways. It can be drawn (stroked), filled, or turned into a clipping region. This is done by calling the relevant methods on the bezier path when it is ready to be used. You can stroke/fill/clip a bezier path more than once (if necessary), making the paths reusable. A simple stroke operation is induced by calling the @code{stroke} operation. It causes the outline described by the path to be drawn using the current pen (which can be set on the bezier path as well). Filling operations are induced by calling the @code{fill} method. It fills in, using the current background colour or pattern, the areas described by the outline of the path. Two winding rules for filling are provided: the @dfn{even-odd} and @dfn{non-zero} winding rules. These affect what areas within the path that are filled, and correspond to their PostScript definitions. A number of convenience class methods exist for simple drawing operations, setting defaults and getting information about the current state of the drawing view, aka the @dfn{graphics state}.@footnote{A graphics state is a concept inherited from GNUstep's Display Postscript heritage. In Postscript a graphics state object, or @dfn{gstate}, would contain all the information about the current colours, the current affine transform, the width to draw lines with, any fill patterns, and other such information. They could be saved onto a stack and recalled later by name. GNUstep provides a more cut down and logical implementation of similiar concepts across the NSBezierPath class and others.} We can call @code{+strokeRect:} or @code{+fillRect:} directly to add a new rectangle or filled rectangle to the current drawing view. The @code{-clipRect:} method can be used to set a smaller clipping rectangle, intersecting with the current clipping rectangle (which is set by default to be the frame of your view), just before a call to @code{-drawRect:} is made (see below for information about clipping paths). @subsection Text You can also render text within a view. For this, you use an instance of the @code{NSText} class, which provides advanced text rendering capabilities. It acts as a base for the text view system, which should be used where you require rich text input to your application. @subsection Images If you just want to display an image in your application, use the @code{NSImageView} class. If you want to combine it with other elements in a view (e.g. clip an image or draw on top of it), you can make use of the @code{NSImage} class to render an image within your view. It is described in more detail in @xref{Images and Imageviews}. @subsection Affine Transformations @anchor{Affine Transformations} The skewing, rotating, translation and scaling of display objects is represented in the form of an @code{affine transformation}. They are encapsulated in an object of @code{NSAffineTransform}. These objects store a mathematical @dfn{matrix} which describes the translation of points and objects within a coordinate system.@footnote{A mathematical matrix, described here, should not be confused with the @code{NSMatrix} class, which is a type of control that displays cells in grid form.} They are used internally to provide the frame and bounds transformations described earlier, and can be used in your drawing code as well. You can append transformations to the current bounds transformation, to bezier paths and even to text. @cindex matrices, affine transform A @dfn{matrix} is a two-dimensional table of numbers. It may have any number of rows and columns, and like algebraic terms, can be multiplied and added together. We can pretend the numbers in a two by one (2x1) matrix refer to a point in the cartesian coordinate system, and manipulate them like vectors. @dfn{Vectors} is another mathematical concept that takes numbers in pairs to describe a point in the cartesian plane. For example, the vector @math{(1, 1)} can refer to the same numbered point in the cartesian coordinate system. You can also represent this point as the combination of a length (given a magnitude) and a direction (given as a rotation from the x-axis, anticlockwise). Using this, we can represent @math{(1, 1)} as @math{( \sqrt 2, 45 degrees)}. This representation is useful for transformation in a matrix. @footnote{For those that are interested, the distance is found by applying Pythagoras' theorem to the points in the equation @math{x^2 + y^2 = d^2} (where x and y are the cartesian points, and d is the distance). The angle is then found by @math{tan y / x}, where the angle is less than 360 degrees. The transformations are the same as those used for complex numbers. It's often known as a rectangular to polar transformation, and can be performed on most good quality scientific calculators.} Matrices can be combined together to produce a new affine transform that will perform the same transformation as if all the original transformations were applied in order. You usually won't need to combine them, unless you have complicated drawing code. @section Clipping One concept that has been mentioned in this chapter is @dfn{clipping}. It is used extensively throughout the AppKit to control the drawing code that renders it's different graphical elements. When drawing within a view, you often may specify points outside the visible region of your view's bounds, say to blit an image. What prevents that image from obscuring other parts of the window (and indeed the screen) is clipping. A @dfn{clip} defines what region of the screen at any one time may be drawn on. For example, when the AppKit calls your @code{drawRect:} method to draw onto the screen, it first calls @code{lockFocus}. In this method is sets a @dfn{clipping path} defined to the frame of your view's rectangle by default, so that you do not draw outside the frame of your view by accident. You can define your own clipping paths that further clip the output of your drawing code within your view. It may be a simple rectangle (as used in the case of frame clipping by the AppKit), or a complex path defined by the outline of a @code{bezier path}. gnustep-gui-0.24.0/Documentation/manual/applicationpropertylist.texi0000664000076500007650000000573410534730035025740 0ustar brains99brains99@c GNUstep AppKit Guide @c @c Copyright (c) 2005-2006 Christopher Armstrong. @c @c Permission is granted to copy, distribute and/or modify this document @c under the terms of the GNU Free Documentation License, Version 1.2 @c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. @c A copy of the license is included in the section entitled "GNU @c Free Documentation License". @c @c This documentation is provided on an "AS IS" BASIS, WITHOUT WARRANTY @c OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED @c TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @c PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND USEFULNESS @c OF THE DOCUMENTATION IS WITH YOU (THE LICENSEE). IN NO EVENT WILL THE COPYRIGHT @c HOLDERS BE LIABLE FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, @c SPECIAL, GENERAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF @c THE USE OR INABILITY TO USE THIS DOCUMENTATION (INCLUDING BUT NOT @c LIMITED TO LOSS OF DATA, USE, OR PROFITS; PROCUREMENT OF SUBSTITUTE @c GOODS AND SERVICES; OR BUSINESS INTERUPTION) HOWEVER CAUSED, EVEN @c IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @node applicationpropertylist @chapter Application Property List @cindex property list, application property list The application property list is a special file, searched upon your programme's loading to find out some information about your programme. It is used for the Info panel, to load your main interface file and any document types your application handles. Below are listed the various dictonary items that can be placed in the main dictionary of your application's property list. @vtable @code @item ApplicationName The name of the application, as specified in the makefile. @item Application @item NSExecutable The name of the programme executable file in the app wrapper. @item NSMainNibFile The name of your main interface file, with the .gorm extension. @item NSPrincipalClass Set this to @code{NSApplication}. @item NSRole Set this to @code{Application} @item NSTypes This is an array of dictionaries, with each dictionary corresponding to a file type that can be opened with this application. See FIXME: ref Document Based Applications for more details. Each type dictionary contains the following items: @vtable @code @item NSDocumentClass The name of your document class, as specified in it's header file. @item NSHumanReadableName The human readable aka. user name of your document type. @item NSIcon An optional name of an icon that will be associated with your document type, particularly in a workspace application like GWorkspace. @item NSUnixExtensions An array of strings containing the file extensions on Unix systems that are associated with the document type e.g. @code{( "htm", "html")} could be used for HTML documents. @item NSDOSExtensions The file extensions that are associated with this document type on DOS aka Windows based systems, including Windows 2000/XP/2003 Server. @end vtable @end vtable gnustep-gui-0.24.0/Documentation/manual/template.texi0000664000076500007650000000224210534730035022536 0ustar brains99brains99@c GNUstep AppKit Guide @c @c Copyright (c) 2005-2006 Christopher Armstrong. @c @c Permission is granted to copy, distribute and/or modify this document @c under the terms of the GNU Free Documentation License, Version 1.2 @c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. @c A copy of the license is included in the section entitled "GNU @c Free Documentation License". @c @c This documentation is provided on an "AS IS" BASIS, WITHOUT WARRANTY @c OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED @c TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @c PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND USEFULNESS @c OF THE DOCUMENTATION IS WITH YOU (THE LICENSEE). IN NO EVENT WILL THE COPYRIGHT @c HOLDERS BE LIABLE FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, @c SPECIAL, GENERAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF @c THE USE OR INABILITY TO USE THIS DOCUMENTATION (INCLUDING BUT NOT @c LIMITED TO LOSS OF DATA, USE, OR PROFITS; PROCUREMENT OF SUBSTITUTE @c GOODS AND SERVICES; OR BUSINESS INTERUPTION) HOWEVER CAUSED, EVEN @c IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. gnustep-gui-0.24.0/Documentation/manual/images.texi0000664000076500007650000002101410537306212022165 0ustar brains99brains99@c GNUstep AppKit Guide @c @c Copyright (c) 2005-2006 Christopher Armstrong. @c @c Permission is granted to copy, distribute and/or modify this document @c under the terms of the GNU Free Documentation License, Version 1.2 @c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. @c A copy of the license is included in the section entitled "GNU @c Free Documentation License". @c @c This documentation is provided on an "AS IS" BASIS, WITHOUT WARRANTY @c OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED @c TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @c PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND USEFULNESS @c OF THE DOCUMENTATION IS WITH YOU (THE LICENSEE). IN NO EVENT WILL THE COPYRIGHT @c HOLDERS BE LIABLE FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, @c SPECIAL, GENERAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF @c THE USE OR INABILITY TO USE THIS DOCUMENTATION (INCLUDING BUT NOT @c LIMITED TO LOSS OF DATA, USE, OR PROFITS; PROCUREMENT OF SUBSTITUTE @c GOODS AND SERVICES; OR BUSINESS INTERUPTION) HOWEVER CAUSED, EVEN @c IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @node images, fdl, dataexchange, Top @chapter Images and Imageviews @anchor{Images and Imageviews} GNUstep provides mechanisms for the retreival and display of images. A number of objects beginning with @code{NSImage}@footnote{Including NSImage} exist, each with slightly different functions. An @dfn{image} is represented using an instance of the @code{NSImage} class. You can create these using the path or URL of a file, raw image data or a pasteboard. Images may contain zero or more image representations, or @dfn{imagereps}. For example, a photographic image may contain both black and white and colour representations, or representations at different resolutions. The purpose of this is to allow GNUstep to select the best representation for a particular device. GNUstep may select a lower-resolution representation for a screen, while selecting the highest resolution representation for printed output. If there was also a vector representation, it may choose to use it for printed output. An imagerep is represented by an instance of a @code{NSImageRep} subclass. An image by itself is not enough for rendering. Images are rendered on a window using an @code{NSImageView} object. These let you set the alignment and scaling for displaying the image. They also let you set a graphical border using the @code{-setFrameStyle:} method. @code{NSImageView} is a control, so the normal control/cell model applies to it. If you only need to display an image on it's own, use @code{NSImageView}. For more complicated image rendering, e.g. inside of custom views, use @code{NSImage} to draw or composite at a certain point. @section Using NSImage Whether using @code{NSImageView} or not, you will have to create an @code{NSImage} object. It provides a number of constructors for loading an image with a path, a URL or a data object (@code{NSData}). Note that for loading from a file or URL, two sets of methods are provided. These have subtly different meanings, as shown below: @table @code @item -initWithContentsOfFile: @itemx -initWithContentsOfURL: These methods load the image from the specified location, and create image representations for rendering later. @item -initByReferencingFile: @itemx -initByReferencingURL: These methods don't actually load the image straight away. Instead, when you try to composite or draw the image at a location, it loads the image from disk and generates a representation at that time. @end table From here, an image can be drawn within a view using any of the drawing/compositing/dissolving methods. You can also get at the imagereps using the @code{-representations} method (amongst others). @section Drawing Images @code{NSImage} provides a number of methods for drawing an image. It also provides quite a number means to control how an image is composited at its destination.@footnote{Note that many of the mechanisms provided for compositing may not be supported in some backends i.e. the Windows backend.} @dfn{Compositing} refers to the way the image is rendered onto the destination surface. Simply drawing an image into your view may be achieved with the @code{-drawRepresentation:inRect:} method. In other cases, you may wish to draw it onto a destination surface with a compositing operation, in which case you can use the @code{-drawAtPoint:fromRect:operation:fraction:} or @code{-drawInRect:fromRect:operation:fraction:} methods. These take a rectangle from the source image, and composite it onto a destination surface. The compositing operation specifies how the image is blended with the destination surface, and is a constant in @code{NSCompositingOperation}. These constants define what the destination image looks like after a composite, as a result of combining the source and destination image. @footnote{These compositing operations are the same as those described in the (now well-studied) academic paper, @cite{Compositing Digital Images} by Thomas Porter and Tom Duff in 1984.} @table @code @item NSCompositeClear The destination is left transparent. @item NSCompositeCopy The source image appears at the destination. @item NSCompositeSourceOver The source image appears wherever it is opaque, and the destination image elsewhere. @item NSCompositeSourceIn The source image appears wherever both the source and destination are opaque, and is transparent elsewhere. @item NSCompositeSourceOut The source image appears where the source image is opaque but the destination image is transparent, and is transparent elsewhere. @item NSCompositeSourceAtop The source image appears wherever both images are opaque, the destination appears wherever the destination is opaque but the source image is transparent, and the result is transparent elsewhere. @item NSCompositeDestinationOver The destination image appears wherever it is opaque, and the source image elsewhere. @item NSCompositeDestinationIn The destination image appears where both images are opaque, and the result is transparent elsewhere. @item NSCompositeDestinationOut The destination image appears wherever it is opaque but the source image is transparent, and it is transparent elsewhere. @item NSCompositeDestinationAtop The destination image appears wherever both images are opaque, the source image appears wherever the source image is opaque but the destination is transparent, and the result is transparent elsewhere. @item NSCompositeXOR The result of and exclusive OR operation between the bits defining the pixels in bothe images. @item NSCompositePlusDarker The result of adding the values of the colour components of the pixels in both images, with the result approaching zero as a limit. @item NSCompositePlusLighter The result of adding the values of the colour components of the pixels in both images, with the result approaching one as a limit. @end table The @var{fraction} parameter corresponds to the coverage of the source alpha channel with zero making the source transparent and one making the source fully opaque. @section Working with image representations Quite a number of classes inherit from @code{NSImageRep} to provide means to load different types of image formats, such as bitmaps, TIFF images, etc: @table @code @item NSBitmapImageRep For bitmap (raster) images, @code{NSBitmapImageRep} is used. PNG, JPG and TIFF image file formats would be represented with the class. You can retreive information about the image with methods such as @code{-bitsPerPixel} or @code{-isPlanar}. For image formats that can store metadata (such as resolution information or camera settings), the @code{-valueForProperty:} and @code{-setProperty:withValue:} methods can be used to manipulate it. If necessary, it contains initialisers for instantiating it from raw data(@code{-initWithData:}) and from the display (@code{-initWithFocusedViewRect:}. @item NSCachedImageRep This image representation is cached bitmap left over from the result of executing some instructions or data. It lives inside an off-screen window. @item NSCustomImageRep These are representations which can be drawn in a manner that is defined by the application. You initialize these with a selector that is executed against a delegate object when @code{-draw} is called on the representation. @item NSEPSImageRep Unsupported. @end table The @code{NSImageRep} class itself also provides a number of methods for gaining information about what kinds of file formats GNUstep supports, and for instantiating images dynamically based on raw image data or the contents of a file or URL. gnustep-gui-0.24.0/Documentation/manual/controls.texi0000664000076500007650000003742510537306212022600 0ustar brains99brains99@c GNUstep AppKit Guide @c @c Copyright (c) 2005-2006 Christopher Armstrong. @c @c Permission is granted to copy, distribute and/or modify this document @c under the terms of the GNU Free Documentation License, Version 1.2 @c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. @c A copy of the license is included in the section entitled "GNU @c Free Documentation License". @c @c This documentation is provided on an "AS IS" BASIS, WITHOUT WARRANTY @c OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED @c TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @c PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND USEFULNESS @c OF THE DOCUMENTATION IS WITH YOU (THE LICENSEE). IN NO EVENT WILL THE COPYRIGHT @c HOLDERS BE LIABLE FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, @c SPECIAL, GENERAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF @c THE USE OR INABILITY TO USE THIS DOCUMENTATION (INCLUDING BUT NOT @c LIMITED TO LOSS OF DATA, USE, OR PROFITS; PROCUREMENT OF SUBSTITUTE @c GOODS AND SERVICES; OR BUSINESS INTERUPTION) HOWEVER CAUSED, EVEN @c IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @node controls, theviewconcept, interfacefiles, Top @chapter Basic Controls @anchor{Basic Controls} @cindex controls, definition @cindex control One of the first important concepts you will encounter dealing with the widgets in the AppKit is that of a @dfn{control}. A @dfn{control} is just a simple graphical element that you put onto your window, such as a button, a text field or an image. It is a specialisation of a the concept of a view (which are a bit more abstract), and hence introduces its own terminology. Controls can easily be spotted in the @cite{GNUstep GUI Reference Manual} as they are derived from the abstract superclass @code{NSControl}. Every control has two classes, one derived from @code{NSControl}, the control, and one derived from @code{NSCell}, the cell. A control is responsible for it's corresponding cell, and usually contains only one cell (although matrices and tables contain groups of cells). The control hosts an instance of an NSCell subclass. This specific NSCell subclass can be set for a particular type of control by calling it's @code{+setCellClass} method, which will cause that NSControl to use your subclass instead of it's own for creating it's cell. @cindex controls, control value One can set the @dfn{value} of a control either directly or indirectly. You can directly set the value of a control by calling the @code{-setObjectValue:} method, or more specifically, the @code{-setStringValue:}, @code{-setIntValue:}, @code{-setFloatValue:} and @code{-setDoubleValue:} methods. We can also retrieve values using the @code{-objectValue}, @code{-stringValue}, @code{-intValue}, @code{-floatValue} and @code{-doubleValue} methods. @cindex sender/receiver @cindex paradigm, sender/receiver More indirectly, the control can be instructed to take it's value from another control when that control changes. We, the @dfn{receiver}, can take our value from another object, the @dfn{sender}, when the sender is updated. You can set what sender the receiver will take it's value from by calling the @code{-take*ValueFrom:} methods on the receiver, passing in a reference to the sender object. This mechanism only permits one-to-one relationships.@footnote{You would model this in UML using a one-to-one association I think.} The control can be enabled/disabled from receiving mouse events (as well as others) by setting the enabled property (@code{-setEnabled:}). You can tell the control to resize to the minimum needed to comfortably display it's cell by calling the @code{-sizeToFit} method. With regards to the generation of actions, you can set the selector that the control will call on the first responder with the @code{-setAction:} method. For more information with regards to what an "action" is in the context of event generation, see @pxref{Outlets and Actions}. @cindex controls, control classes @section Basic NSControl Classes Classes that leverage the paridgm and concepts provided by NSControl are detailed below. Note that some of the more complex subclasses have dedicated chapters, such as NSTableView, NSTextView and NSMatrix. @cindex controls, buttons @cindex button controls @cindex NSButton @subsection Buttons (NSButton) A button can be more than a simple "push button". This NSControl is used to implement radio buttons, momentary push buttons, radio style buttons, etc. The way the button reacts is specified by the @code{-setButtonType:} method, which takes a constant value of one of the following: @table @code @item NSMomentaryPushInButton @item NSMomentaryPushButton This is the default button type. It is "pushed in" and lit while the mouse is held down on it, and it is "pushed out" and unlit when the button is released. It is used for triggering actions; it doesn't graphically nor internally store an on/off state. It looks like a simple click button that you would find in Microsoft Windows. @item NSMomentaryLightButton @item NSMomentaryLight This type of button simply appears "lit" while the mouse is held down on it. Like the NSMomentaryPushInButton type, it used for simply triggering actions. @item NSPushOnPushOffButton This button is used where you need to show and store an "on/off" state. When the button is first clicked, it is highlight and "pushed in" while the mouse is held down. It maintains this state until it is clicked again, in which it returns to normal. @item NSOnOffButton This is like the NSPushOnPushOffButton, but it only highlights the button's area when clicked on and off. @item NSToggleButton This type is an on/off button like NSPushOnPushOffButton. When it is clicked, it changes it's image to indicate an "on" state. A second click will restore the original button state. @item NSSwitchButton The same as NSToggleButton, but with no border. @item NSRadioButton A variation of NSSwitchButton that is similiar to the radio button control in Microsoft Windows. @end table A button has a "title" property, which is the text either displayed on or next to the button (depending on whether it's of the switch or push variety). This is changed with the @code{-setTitle:} method. The button state, as discussed above, can be read or changed with the @code{-state} and @code{-setState:} methods. You can also set an image to be displayed on the button (@code{-setImage:}) as well as an @dfn{alternate image}, which is displayed when the button changes state (@code{-setAlternateImage:}). Along these lines, the button also has an alternate title which appears when the button changes into it's "on" state (set using the @code{-setAlternateTitle:} method). Both the title and alternate title can be set using attributed strings as well. Another visual feature that can also be set is whether it is bordered (@code{-setBordered:}) and if so, what type of bezel that border takes (@code{-setBezelStyle:}). @cindex text fields @cindex controls, text fields @cindex NSTextField @subsection Text Field (NSTextField) A @dfn{text field} is a simple control that displays and/or allows the editing of text. You can set whether it is editable or not using the @code{-setEditable:} method. It also can take a delegate implementing the @code{NSControlDelegate} protocol, which is described below. @cindex combo boxes @cindex controls, combo boxes @cindex NSComboBox @subsection Combo Boxes (NSComboBox) A @dfn{combo box} is similar to a text box, but it also has a drop-down component that lets the user select from some predefined entries as well as letting them type one it. You can provide the data it uses by calling methods on the object or setting a data source. Objects can be added to the list using @code{-addItemWithObjectValue:} or @code{-addItemWithObjectValues:} (for arrays), and then removed with @code{-removeItemWithObjectValue:} or @code{-removeAllItems}. The items listed can be referenced by index if necessary. If you wish to use a data source, you must first set a data source object that implements the @code{NSComboBoxDataSource} informal protocol, and then call @code{-setUsesDataSource:} with a @code{YES} parameter. @subsection ImageViews (NSImageView) An @dfn{image view}, which displays an image, is also a control. You can set the image to be used with the @code{-setImage:} method. It is also possible to set the alignment, frame style and image scaling. See @pxref{Images and Imageviews} for more information. @subsection Popup Buttons (NSPopupButton) A @dfn{popup button} is a special kind of button that displays a menu while the mouse button is clicked and held down on it. The user selects an item from the menu by moving the cursor over the item they want and releasing the mouse button. It can behave as a pull-down or a pop-up menu. You can change this using the @code{-setPullsDown:} method and providing a boolean. Items can be added and removed using @code{-addItemWithTitle:}/@code{-addItemsWithTitles:}, @code{-insertItemWithTitle:atIndex:} and @code{-removeItemWithTitle:}/@code{-removeAllItems}/@code{-removeItemAtIndex:} methods. The selected item is retrieved via the @code{-selectedItem} method (and others). It posts one notification: @code{NSPopUpButtonWillPopUpNotification}, which is posted just before the menu is shown. @subsection Scroller (NSScroller) @dfn{Scrollers} are scrollbars. You will be unlikely to instantiate these directly, as scrolling functions are handled best by @code{NSScrollView}. Otherwise, their visual appearance and behaviour is very customisable. You can otherwise get where the scroller is positioned by calling @code{-floatValue} which is a number between 0.0 and 1.0 (0 being at the top/left end and 1 at the bottom/right end). Similarly, the position and proportion of the knob that fills the knob slot can be set using the @code{-setFloatValue:knobProportion:} method (the proportion also being between 0.0 and 1.0). @subsection Slider (NSSlider) A @dfn{slider} looks alot like a scroller, but is simply a knob used to allow the user to select a variable value. If you want to allow the user to select a variable value, use this instead of a scroller. It's value is set and retrieved via the @code{-setFloatValue:} and @code{-floatValue} methods defined in @code{NSControl}. It also permits a minimum and maximum value to be set. You can set an image to be displayed in the scroll bar part using @code{-setImage:}, and you can set a title (and/or title cell/font/colour) to be shown with the slider. When the user clicks and drags the slider, it will continually send it's action message as the user drags the slider. This behaviour can be changed using the @code{-setContinuous:} method. @subsection Steppers (NSStepper) A @dfn{stepper} is a control that displays it's current value in a box while permitting the user to change it via a pair of up/down arrows.@footnote{It's like the Microsoft Windows Spin control} Like the slider, you can set a maximum and minimum value. You can also set whether the value wraps, and by how much it is incremented/decremented on each mouse-click. @section Advanced control classes GNUstep also provides more advanced control classes, notable tableviews, matrices and browsers. Many of these are documented in subsequent chapters. A @dfn{matrix} is a grid containing cells. It does not matter what type of cells are put into it, and they can be of different types, as long as they're all the same size (@pxref{Matrix Controls}). They are referenced by a cell coordinate number, and data is added passively via calling methods on the NSMatrix object. @dfn{Tableviews} are different from matrices, essentially displaying grid lines and drawing column headers. They are more useful for displaying records of data from database tables and queries, amongst other things. They are organised by column (fields) and rows (records). Unlike matrices, they use a data source delegate to display their data. For more information, @pxref{Tableviews}. @dfn{Browsers} are a useful control for displaying hierachial information, especially data that is subject to real time change or needs to be navigated in a hierachical fashion. They use a data source that can be either passive or active in the way it gives the browser data, so that you can have hierachies which change as the program runs, e.g. representing a file system (take a look at the GWorkspace program for a example of a browser control in use). For more information, @pxref{Browsers} @dfn{Outline views} are a specialised form of table view that allows the display of hierachial data via rows that can be expanded and collapsed. They too use a special data source. @section Control Notifications Controls provide a few generic notifications, particularly related to text editing. All the following notifications will have the control that posted them as the notification object. The notification has a @code{userInfo} dictionary that has a key @code{@@"NSFieldEditor"}, which is the editing cell's field editor. @table @code @item NSControlTextDidBeginEditingNotification This notification is sent when a control has begun editing. This only applies to controls that are editable. @item NSControlTextDidEndEditingNotification The notification is sent when a control has finished editing. This only applies to controls that are editable. @item NSControlTextDidChangeNotification This notification is sent when the text in a control has changed. This only applies to controls that are editable. @end table @section Control Delegate You can also set a control delegate by calling @code{-setDelegate:} on the control subclass with an object that implements the informal protocol @code{NSControlDelegate}. The delegate receives the notifications defined above. If the control subclass has it's own delegate protocol(s), you may have to use the same object to implement both @code{NSControlDelegate} and the specific control's delegate. @section Cell Classes As previously mentioned, a controls' cell class inherits from @code{NSCell}. @code{NSCell} defines alot of basic functionality and features that cells can customise. @code{NSCell} provides a number of methods for setting/getting the cell value. These correspond to those that are available for their corresponding control. Like most graphical elements, cells can be enabled and disabled using the @code{-setEnabled:} method. They also have the concept of a "state" so that cells such as check boxes and radio buttons can be defined as being "on" or "off". Cells may also have a "mixed" state, but this can only be enabled using the @code{-setAllowsMixedState:} method. The cell state can be retrieved using the @code{-state} method, which returns one of the foloowing constants: @table @code @item NSOnState The cell is "on". @item NSOffState The cell is "off". @item NSMixedState The cell is in a "mixed" state. This may be, e.g. a checkbox representing a group of elements of which some are on and some are off. @end table In line with the target/action paridgm specified in previous chapters, cell's can have an action and a target set on them. The action is a selector, which can be retrieved using the @code{-action} method. The target is an object, which can be retrieved using the @code{-target} method. This stuff is usually setup by Gorm.app when you create your interface. You can set whether an action is continuous via the @code{-setContinuous:} method. Cell's have a generic type. These can be retreived using the @code{-type} method and set using the @code{-setType:} method with one of the constants specified below: @table @code @item NSNullCellType This cell doesn't display anything. @item NSTextCellType This cell displays text. @item NSImageCellType This cell displays an image. @end table The way cells display and format data or text can also be set. A formatter object that changes the way the cell's data is represented after the user has typed iit in is set via the @code{-setFormatter:} method using an object of @code{NSFormatter} derivation. gnustep-gui-0.24.0/Documentation/manual/basicconcepts.texi0000664000076500007650000000772010537306212023550 0ustar brains99brains99@c GNUstep AppKit Guide @c @c Copyright (c) 2005-2006 Christopher Armstrong. @c @c Permission is granted to copy, distribute and/or modify this document @c under the terms of the GNU Free Documentation License, Version 1.2 @c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. @c A copy of the license is included in the section entitled "GNU @c Free Documentation License". @c @c This documentation is provided on an "AS IS" BASIS, WITHOUT WARRANTY @c OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED @c TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @c PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND USEFULNESS @c OF THE DOCUMENTATION IS WITH YOU (THE LICENSEE). IN NO EVENT WILL THE COPYRIGHT @c HOLDERS BE LIABLE FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, @c SPECIAL, GENERAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF @c THE USE OR INABILITY TO USE THIS DOCUMENTATION (INCLUDING BUT NOT @c LIMITED TO LOSS OF DATA, USE, OR PROFITS; PROCUREMENT OF SUBSTITUTE @c GOODS AND SERVICES; OR BUSINESS INTERUPTION) HOWEVER CAUSED, EVEN @c IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @c @c @c Contributions @c @c * Thanks to Damien Pollet for some minor spelling and grammatical fixups. @node basicconcepts, gnustepapplications, Introduction, Top @chapter Basic Concepts Throughout this manual, we refer to a number of concepts that you will need to be familiar with. It may be useful to at least glance over this section and make sure you are familiar with the concepts presented. @table @i @item application wrapper (or appwrapper) GNUstep applications rarely consist of just an executable file. They often contain interface files, property lists and other resources such as images. These are bundled together with the executable into a directory known as an @dfn{application wrapper}. To launch applications, you use the @command{openapp} command. @item delegate A @dfn{delegate} usually refers to an object that handles certain events and methods on behalf of another object. The methods a delegate should implement are declared as either a formal or informal protocol. Many of the view and control classes within the AppKit allow you to supply delegate objects to help them make decisions about different things such as what data to display, how to handle events, whether to permit the user to select things, handling drag and drop, etc. @item formal protocol A @dfn{formal protocol} is a protocol that requires you to implement all the methods that are listed within it. They are used much less often that informal protocols in the AppKit. Formal protocols are declared using their own statement, the @code{@@protocol} identifier. You implement a formal protocol by placing it's name in arrow brackets ('<' and '>') and listing its methods in your interface declaration. @c is it mandatory to list the methods? @item informal protocol Objective-C can have both @dfn{formal} and @dfn{informal} protocols. Informal protocols don't require you to implement all of their methods. Informal protocols are declared as a category of @code{NSObject}. You implement them in your own class by simply declaring and implementing the methods in the protocol you wish to. Always check the documentation of the classes that use the protocol to see which methods you should implement (usually at least one of them is mandatory). @item nib file @dfn{nib files} are your program's interface files, which contain definitions of all the windows, controls and menus as well as their connections to classes from your application. They have the extension @file{.gorm}. See @pxref{Interface Files} for more information. @item notification A @dfn{notification} is an indicator of a certain event. Notifications are objects posted to a @dfn{notification center}. Other objects may register with a notification center to receive notifications. For more information about notifications, refer to the @cite{GNUstep Base Programming Manual}. @end table gnustep-gui-0.24.0/Documentation/manual/interfacefiles.texi0000664000076500007650000003624710537306212023721 0ustar brains99brains99@c GNUstep AppKit Guide @c @c Copyright (c) 2005-2006 Christopher Armstrong. @c @c Permission is granted to copy, distribute and/or modify this document @c under the terms of the GNU Free Documentation License, Version 1.2 @c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. @c A copy of the license is included in the section entitled "GNU @c Free Documentation License". @c @c This documentation is provided on an "AS IS" BASIS, WITHOUT WARRANTY @c OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED @c TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @c PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND USEFULNESS @c OF THE DOCUMENTATION IS WITH YOU (THE LICENSEE). IN NO EVENT WILL THE COPYRIGHT @c HOLDERS BE LIABLE FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, @c SPECIAL, GENERAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF @c THE USE OR INABILITY TO USE THIS DOCUMENTATION (INCLUDING BUT NOT @c LIMITED TO LOSS OF DATA, USE, OR PROFITS; PROCUREMENT OF SUBSTITUTE @c GOODS AND SERVICES; OR BUSINESS INTERUPTION) HOWEVER CAUSED, EVEN @c IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @anchor{Interface Files} @node interfacefiles, controls, applicationmakefiles, Top @chapter Interface Files @cindex interface files, definition @dfn{Interface files} are used to store your applications graphical user interface. It's separation means that you can modify it more easily than other interface generation mechanisms, such as code generators, which generate code that makes it hard to modify the interface or requires you to rewrite your own code. The advantage of a separate interface file is that you can change the interface without having to recompile one bit of code (in most instances). @cindex nibs Interface files are often referred to as "nib" files.@footnote{This is a throwback to the origin's of the GNUstep framework, where it's API specification (OpenStep) was based on NeXTStep, which used "nib" files (NeXT Inteface Builder) to store interfaces.} These are not the same as those appearing on NeXT and MacOS X systems, and are completely incompatible (tagged XML nib's may change this in future). This section is very important to understanding key concepts in the AppKit, especially with regards to manipulation of your user interface. It is strongly recommended you do not skip this section, and refer back to it if you do not understand anything, even if you don't intend to use Gorm (also not recommended). @section Using Gorm @cindex Gorm Gorm is the GNUstep application used to create interface files for applications. It uses a drag and drop interface to place the control's on your window form and menu. See the Gorm manual, currently posted on the @cite{GNUstep Wiki} for further information on using Gorm for the creation of interfaces. This section is also relevant to those using Renaissance. @subsection The Palette The palette contains pictures of various objects that you can drag and drop onto a window or a menu, including a window itself. These are the graphical objects that you may put onto your interface. They can be resized on the window itself by using the resize handles. The graphical elements you place on your window(s) using Gorm, including the window itself, come from the palette. When your nib file is loaded, all the graphical elements are instantiated by GNUstep and all connections are made (see outlets and actions below). You don't need to instantiate objects in code, unless you intend to draw them programatically and add them to your interface. This differs from many other toolkits, where you often need to make connections to your interface in code (e.g. Win32 resource files) as well as instantiate custom objects for them, e.g. in Gtk, you need to add object variables that refer to the objects in your interface such as windows and buttons. In GNUstep, you need only draw your interface and make connections to objects using Gorm, and then provide reference variables in the classes you specify connections (outlets and actions) for. @subsection The Inspector The inspector contains four sections, which let you modify the properties of any object (including those appearing on your window, the windows themselves and objects in the Objects Pane) in four sections: @table @command @item Attributes This contains the attributes of the object you are modifying e.g. it's title, it's colour, tag items, etc. Note that fonts are modified using the Font Panel, which is opened in the menus, separately. @item Connections Connections has three panes: the outlets, actions and object connections that you have made for this object (see @pxref{Outlets and Actions}). @item Size Lets you modify the size using numbers, and the resizing data for this object (the springs at the bottom). See the Gorm manual for more details on this pane. @item Help Help related to this object type. Still being completed. @item Custom class Let's you set the class for this object manually (NOTE: this only appears for some objects where it is possible to set a custom class). @end table @subsection The Objects Pane This is a graphical display of your application's objects. They appear with a subtitled icon, and can be manipulated like the graphical objects on the window forms, as well as be connected to outlets and actions. You can also instantiate subclasses (where necessary) to connect to other objects. The object's here may be representative (for example, NSOwner and NSFirst) or be instances of custom classes you create in your code. @subsection The Classes Pane This permits you to subclass and add actions and outlets to classes that you want Gorm to link up at runtime. The GNUstep class hierachy is shown in this pane, allowing you to see the various views and helper classes (e.g. NSDocument/NSDocumentController, used for document based applications). In here, you can create subclasses of the classes specified, often @code{NSObject} and then add actions (methods) or outlets (instance variables) to them. What you do in here must be reflected in your own code at the time your nib file is loaded. As a result, Gorm can generate the appropriate header and source files for you, or you can create them yourself. However you do this, you must make sure any subclasses you create here can be found at runtime, and that they contain all the instance variables and methods that you specify as outlets and actions at the time that your code loads the nib file (often by calling @code{-loadNibNamed:} on the main bundle). @anchor{Outlets and Actions} @subsection Outlets and Actions: Connecting objects Gorm permits you to connect your graphical objects together using it's interface, to save you the trouble of connecting them at runtime using extra lines of code (and wondering where you should put them). We introduce two concepts here: @dfn{outlets} and @dfn{actions}. They form the basis of event handling and graphical object linkage when using Interface Files for your programme's interface in GNUstep. This outlet and action paradigm is incredibly important, as you will see, as it eliminates the need for subclassing objects of graphical elements (a.k.a widgets) for all but the most complex GUI applications. You don't even need to subclass NSWindow to create a window; you merely need to instantiate it, and that bit is taken care of by GNUstep anyway (unlike most other GUI toolkits, including the Win32 API, Gtk, Qt/KDE, and many others). The concept of @dfn{outlets and actions} is presented in many beginner tutorials to GNUstep and Cocoa. It is well recommended you follow one of these to get a better idea of how these things work. With practice, they become second nature in interface design, and are useful for thinking about how your interface will interact with your code, but still keeping a useful abstract distance between the two. @cindex outlet An @dfn{outlet} is a property of an object, that can be used to store a reference to another object, which is usually some sort of graphical element (like a button or text box). You usually add outlets to your custom subclasses and then connect them to graphical elements on your window, so that you can directly manipulate them in your code. If you were to add an outlet to a class, it would appear in code under the data value declarations part of your class as an object reference. It takes the syntax: @smallexample id myOutlet; @end smallexample (NOTE: @code{id} may also be @code{IBOutlet}, especially if generated by ProjectCenter. It seems not to matter.) For example, if you connect a button to the outlet of one of your objects, say and outlet called @code{myButton}, when that nib is instantiated, @code{myButton} will contain a reference to an @code{NSButton} object, namely the button object on your interface that is connected to that outlet. Another example is creating a main window for your user interface. You may decide later that you wish to customise this window in code, based on user interactions. It would be appropriate to add an outlet to a top level object so that you can access this instance of the window. You will often create a special subclass of @code{NSObject} named something like @var{AppController} or @code{ApplicationController} and instantiate it. You will then add outlets and actions to this so that you can centralise access to your programme's widgets. The default Application project type in ProjectCenter does this for you, and many tutorials will present outlets and actions to you like this. @cindex action An @dfn{action} is a method or function of behaviour that a class may perform. For example, you can connect a button to an action listed in NSOwner, so that when the button is clicked, it will send a message to the NSOwner object that will perform the action you connected. Actions are listed as methods on objects, but they take the form: @smallexample - (void) myAction:(id)sender; @end smallexample Hence they are instance methods, taking one parameter, which is a reference to the object that is connected to the action. You could connect any number of objects to action on one object, so that it could distinguish between it's caller's by checking the sender object with GNUstep's introspection/reflection features. For example, say that you create an action on one of your custom objects called @code{compute:}. If you then connect a button object to your custom object and set @code{compute:} as the action, when the button is clicked, it will call @code{compute:} on your custom object. In short, objects are connected to outlets or actions, but outlets or actions are not connected to each other. To connect an object to an outlet or an action, you first select the object, then hold down the first control key (usually the left @kbd{@key{Ctrl}} key on your keyboard), and select (using the mouse) the object which contains the outlet or action you wish to connect to. In the Inspector window, you select the target outlet or action, and click @command{Connect}. The action or outlet on the latter object will be connected to the first object. @cindex NSOwner @subsection NSOwner: Who controls your interface? @dfn{NSOwner} will appear as an object in the Objects Pane. You will notice that the only property you can set is it's class. NSOwner is an object, decided upon at runtime by your code, that will "own" this instance of your interface. You can instantiate interfaces more than once upon runtime, each time associating an instance with a different object. You can set NSOwner to be a custom class, with your outlets and actions, and then connect NSOwner to other objects or graphical elements or methods in your interface. For example, you may create a custom subclass of NSObject called @code{MyController}. You may then give it a number of outlets, including one called @code{window}. You could set NSOwner to be of your subclass type, then connect @code{window} to the NSWindow object in the Object's pane. Upon runtime, whatever @code{MyController} object you set as NSOwner would have the associated NSWindow instance appear in it's @code{window} instance data value. @cindex NSFirst @subsection NSFirst @cindex first responder NSFirst is an abstract object, and may refer to any number of different graphical elements during the lifetime of your programme. It is what's known as the @dfn{first responder}, the object that is connected in such a way to receive event's first. The first responder may change depending on user interaction with a window, e.g. selecting an object in your window may cause it to become the first responder. What you can do is connect outlets and actions to the first responder, and depending on whether the object that is set as @code{NSFirst}, the use may be able to perform that action. For example, you may connect a menu item to call the @code{print:} action on the NSFirst object. GNUstep will automatically grey out this menu item if the object set as the first responder (decided by the user's currently selected object) is not able to respond to this action. If another object is to be later set as the first responder, and is able to respond to this action, GNUstep will automatically make the menu item available again. This way, you don't have to handle instances where the first responder object cannot respond to your method. GNUstep sets this all up using Objective-C's introspection features, by checking whether your object responds to the method corresponding to the action. @section Loading and Instantiating Interface Files @cindex NSNib Once you've created your interfaces files, you will want to instantiate them and display them. This is relatively simple in code, and merely requires you deal with the @var{NSNib} class. If your application contains only one interface file, it is possible to avoid this step altogether, and set the main interface nib as a property in your application's property list, as well as including it as a resource in your application's makefile. Otherwise, if you would like to instantiate it manually, especially if you have multiple interface files, you first create an NSNib object using the name of your interface file, and then instantiate it with a reference to your NSOwner object. @example id myOwner; NSNib* myNib; NSArray* topLevelObjects; // Assign myOwner to an object of the class that you set as NSOwner. myNib = [[NSNib alloc] initWithNibNamed:@@"MyNibFile" bundle:nil]; [myNib instantiateNibWithOwner:myOwner topLevelObjects:&topLevelObjects]; @end example @cindex interface files, top level objects In this case, we first create the @code{NSNib} object @code{myNib} with a interface file called @file{MyNibFile}. We pass @code{nil} to the bundle parameter to indicate the main bundle; you can otherwise specify another bundle you may have already loaded into your programme. The @code{topLevelObjects:} parameter refers to the objects that appear in the Objects pane in Gorm. You can use Objective-C's reflection features to identify them. The nib is then instantiated with myOwner as the NSOwner object (you have to create this beforehand) and is passed a pointer to an @code{NSArray} reference so that you can receive the top level objects in your interface file. See the NSNib documenation in the AppKit reference manual for more details. There is simpler methods calls available for instantiating nib's as well under @code{NSBundle} (see the @cite{GNUstep GUI Reference Manual}. gnustep-gui-0.24.0/Documentation/manual/AppKit.texi0000664000076500007650000001224210537306212022113 0ustar brains99brains99\input texinfo @c Using the GNUstep AppKit @c @c Copyright (c) 2005-2006 Christopher Armstrong. @c @c Permission is granted to copy, distribute and/or modify this document @c under the terms of the GNU Free Documentation License, Version 1.2 @c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. @c A copy of the license is included in the section entitled "GNU @c Free Documentation License". @c @c This documentation is provided on an "AS IS" BASIS, WITHOUT WARRANTY @c OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED @c TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @c PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND USEFULNESS @c OF THE DOCUMENTATION IS WITH YOU (THE LICENSEE). IN NO EVENT WILL THE COPYRIGHT @c HOLDERS BE LIABLE FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, @c SPECIAL, GENERAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF @c THE USE OR INABILITY TO USE THIS DOCUMENTATION (INCLUDING BUT NOT @c LIMITED TO LOSS OF DATA, USE, OR PROFITS; PROCUREMENT OF SUBSTITUTE @c GOODS AND SERVICES; OR BUSINESS INTERUPTION) HOWEVER CAUSED, EVEN @c IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @c %**start of header @setfilename AppKit.info @settitle Using the GNUstep AppKit 0.1 @afourpaper @c %**end of header @copying @copyright{} 2005-2006 Christopher Armstrong. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2, as published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". This documentation is provided on an "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND USEFULNESS OF THE DOCUMENTATION IS WITH YOU (THE LICENSEE). IN NO EVENT WILL THE COPYRIGHT HOLDERS BE LIABLE FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, SPECIAL, GENERAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENTATION (INCLUDING BUT NOT LIMITED TO LOSS OF DATA, USE, OR PROFITS; PROCUREMENT OF SUBSTITUTE GOODS AND SERVICES; OR BUSINESS INTERUPTION) HOWEVER CAUSED, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @end copying @ifnottex @node Top, Introduction, (dir), (dir) @top Using the GNUstep AppKit @ifnothtml @insertcopying @end ifnothtml @ifhtml Copyright (C) 2005-2006 Christopher Armstrong. Permisssion is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2, as published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". This documentation is provided on an "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND USEFULNESS OF THE DOCUMENTATION IS WITH YOU (THE LICENSEE). IN NO EVENT WILL THE COPYRIGHT HOLDERS BE LIABLE FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, SPECIAL, GENERAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENTATION (INCLUDING BUT NOT LIMITED TO LOSS OF DATA, USE OR PROFITS; PROCUREMENT OF SUBSTITUTE GOODS AND SERVICES; OR BUSINESS INTERUPTION) HOWEVER CAUSED, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @end ifhtml @menu * Introduction:: * basicconcepts:: * gnustepapplications:: * applicationmakefiles:: * interfacefiles:: * controls:: * theviewconcept:: * eventhandling:: * tableview:: * outlineviews:: * matrix:: * browsercontrols:: * dataexchange:: * images:: * fdl:: * conceptindex:: @end menu @end ifnottex @iftex @titlepage @title Using the GNUstep AppKit @subtitle A guide to using various parts of the GNUstep AppKit for application development @author Christopher Armstrong @page @insertcopying @contents @end titlepage @end iftex @c %** Contents of file, one file per chapter @c %** @include helloworld.texi @c // Chapters @include intro.texi @include basicconcepts.texi @include gnustepapplication.texi @c //@include afirstapplication.texi @include applicationmakefiles.texi @include interfacefiles.texi @c @include applicationpropertylist.texi @include controls.texi @include theviewconcept.texi @include eventhandling.texi @c @include drawing.texi @include tableviews.texi @include outlineviews.texi @include matrix.texi @include browsers.texi @include dataexchange.texi @include images.texi @c // Appendices @c @include quickreference.texi @include fdl.texi @c Indexes @node conceptindex, , Top, Top @unnumbered Concept Index @printindex cp @c %** End of file contents specification @bye gnustep-gui-0.24.0/Documentation/manual/quickreference.texi0000664000076500007650000004360210534730035023723 0ustar brains99brains99@c GNUstep AppKit Guide @c @c Copyright (c) 2005-2006 Christopher Armstrong. @c @c Permission is granted to copy, distribute and/or modify this document @c under the terms of the GNU Free Documentation License, Version 1.2 @c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. @c A copy of the license is included in the section entitled "GNU @c Free Documentation License". @c @c This documentation is provided on an "AS IS" BASIS, WITHOUT WARRANTY @c OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED @c TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @c PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND USEFULNESS @c OF THE DOCUMENTATION IS WITH YOU (THE LICENSEE). IN NO EVENT WILL THE COPYRIGHT @c HOLDERS BE LIABLE FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, @c SPECIAL, GENERAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF @c THE USE OR INABILITY TO USE THIS DOCUMENTATION (INCLUDING BUT NOT @c LIMITED TO LOSS OF DATA, USE, OR PROFITS; PROCUREMENT OF SUBSTITUTE @c GOODS AND SERVICES; OR BUSINESS INTERUPTION) HOWEVER CAUSED, EVEN @c IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @node quickreference @appendix Class Quick Reference @anchor{Class Quick Reference} In this section are tables listing the methods in each class described in the manual, along with a brief description of those methods. These are referenced against the information given throughout this manual. Also listed are some of the functions used in this manual, useful for some purposes. Class hierarchies are also given, so that you can refer to the methods that appear in a class's superclass (methods are not listed twice, except where their meaning is substantially changed in a subclass). @section NSBrowser An NSBrowser is an GUI object useful for representing hierachical data that needs be heavily navigated. It is derived from NSControl, and uses @code{NSBrowserCell} as its cell class Class Hierarchy: @i{NSBrowser : NSControl : NSView : NSResponder : NSObject} @subsection NSBrowserDelegate @code{NSBrowserDelegate} is an informal protocol used to supply data and provide dynamic behaviour in a browser object. @table @code @item -(void) browser:(NSBrowser*)sender createRowsForColumn:(int)column inMatrix:(NSMatrix*)matrix This method is implemented by @dfn{active} delegates. It is called by the browser when the user clicks on a branch node and needs to populate the next column. It becomes the delegate's responsibility then to create the browser cells for @var{column} and add them to @var{matrix} in @var{sender}. This method cannot be implemented at the same time as @code{-browser:numberOfRowsInColumn:}. @item -(BOOL) browser:(NSBrowser*)sender isColumnValid:(int)column When the user calls @code{-validateVisibleColumn:} on the browser object, it in turns checks whether a column is "valid" by calling this method on its delegate. A column that is invalid will be marked for redrawing. Use this method when you need to check internal data states or otherwise when a browser's data can become invalid. @item -(int) browser:(NSBrowser*)sender numberOfRowsInColumn:(int)column This method is implemented by @dfn{passive} delegates. It is called by the browser to get the number of rows in a column. The browser object uses this information to create the browser cells for @var{column}. This method cannot be implemented at the same time as @code{-browser:createRowsForColumn:inMatrix:}. @item -(BOOL) browser:(NSBrowser*)sender selectCellWithString:(NSString*)title inColumn:(int)column This method is called by the browser to tell the delegate to select the cell with contents @var{title} in @var{column}. Return @code{YES} to indicate the cell was selected; otherwise, return @code{NO}. @item -(BOOL) browser:(NSBrowser*)sender selectRow:(int)row inColumn:(int)column This method is called by the browser to tell the delegate to select the cell in @var{row} and @var{column}. Return @code{YES} to indicate teh cell was selected; otherwise, return @code{NO}. @item -(NSString*) browser:(NSBrowser*)sender titleOfColumn:(int)column This method is called by the browser object to retrieve the title of @var{column}. @item -(void) browser:(NSBrowser*)sender willDisplayCell:(id)cell atRow:(int)row column:(int)column This method is called just before the browser object is about to display @var{cell}. Use it to do any modifications before the cell is displayed on the screen. @item -(void) browserDidScroll:(NSBrowser*)sender Called by the browser object just after it has updated the screen for a user-initiated scroll operation. @item -(void) browserWillScroll:(NSBrowser*)sender Called just before a browser object will update the screen for a scroll operation. @end table @section NSComboBox Represents a specialised text field that also has a drop-down box displaying a list of possible choices as well as letting the user enter their own. This list can be populated using the methods of @code{NSComboBox} or a data source which implements the @code{NSComboBoxDelegate} informal protocol, described below. Class Hierarchy: @i{NSComboBox : NSTextField : NSControl : NSView : NSResponder : NSObject} @subsection NSComboBoxDataSource @table @code @item -(NSString*) comboBox:(NSComboBox*)@var{aComboBox} completedString:(NSString*)@var{aString} This method is used to implement a sort of "auto-complete" for combo boxes. @var{aString} is what the user has typed in so far and is what you use to match against the items the in the combo box. You may optionally implement this method. @item -(unsigned int) comboBox:(NSComboBox*)@var{aComboBox} indexOfItemWithStringValue:(NSString*)@var{aString} This method returns the index of @var{aString} within the combo box. @var{aString} is what the user has typed in (or what has been auto-completed in the previous method). You may optionally implement this method. @item -(id) comboBox:(NSComboBox*)@var{aComboBox} objectValueForItemAtIndex:(int)@var{index} This method returns the value of the item at @var{index}. This method is not optional. @item -(int) nubmerOfItemsInComboBox:(NSComboBox*)@var{aComboBox} This method returns the number of items in @var{aComboBox}. This method is not optional. @end table @section NSControl Represents simple graphical elements (such as buttons or text fields) that use a @dfn{cell} to implement their internal behaviour (subclasses of @code{NSCell}). Class Hierarchy: @i{NSControl : NSView : NSResponder : NSObject} @table @code @item -(Class) cellClass @itemx -(void) setCellClass:(Class)@var{class} Get/Set the default class used for cell(s) in this control. @item -(id) cell @itemx -(void) setCell:(id)@var{cell} Get/Set the @var{cell} to be displayed in the receiver. @item -(id) objectValue @itemx -(int) intValue @itemx -(float) floatValue @itemx -(double) doubleValue @itemx -(NSString*) stringValue Get the value of the control's cell in the respective form. @item -(void) setObjectValue:(id)@var{value} @itemx -(void) setIntValue:(int)@var{value} @itemx -(void) setFloatValue:(float)@var{value} @itemx -(void) setDoubleValue:(double)@var{value} @itemx -(void) setStringValue:(NSString*)@var{value} Set the value of the control's cell in the respective form. @item -(void) takeDoubleValueFrom:(id)@var{sender} @itemx -(void) takeFloatValueFrom:(id)@var{sender} @itemx -(void) takeIntValueFrom:(id)@var{sender} @itemx -(void) takeObjectValueFrom:(id)@var{sender} @itemx -(void) takeStringValueFrom:(id)@var{sender} Changes the value of the receiver to that of the @var{sender} when the @var{sender} object is updated. @item -(BOOL) enabled @itemx -(void) setEnabled:(BOOL)@var{enabled} Get/Set whether the user can manipulate the control. @end table @section NSMatrix Class Hierarchy: @i{NSMatrix : NSControl : NSView : NSResponder : NSObject} @subheading Modifying cell classes @table @code @item +(Class) cellClass Return the default cell class used to create new cells for each new NSMatrix instance. @item +(void) setCellClass:(Class)@var{class} Sets the default cell class used to create new cells for each new NSMatrix instance. @item -(Class) cellClass Return the default cell class used to create new cells on this particular NSMatrix instance. @item -(void) setCellClass:(Class)@var{class} Set the cell class used to create new cells on this particular NSMatrix instance. @end table @subheading Columns and Rows Manipulation @table @code @item -(void) addColumn @itemx -(void) addRow Adds a column/row to the end of the matrix. @item -(void) addColumnWithCells:(NSArray*)@var{cells} @itemx -(void) addRowWithCells:(NSArray*)@var{cells} Adds a column/row to the end of the matrix, specifying the list of cells to add. @item -(void) insertColumn:(int)@var{column} @item -(void) insertRow:(int)@var{row} Inserts a blank column/row at the specified location. @item -(void) insertColumn:(int)@var{column} withCells:(NSArray*)@var{cells} @itemx -(void) insertRow:(int)@var{row} withCells:(NSArray*)@var{cells} Inserts a column/row, using the cell objects specifed by @var{cells}. @item -(void) removeColumn:(int)@var{column} @itemx -(void) removedRow:(int)@var{row} Removes the column/row specified by @var{column}/@var{row}. @item -(int) numberOfColumns @itemx -(int) numberOfRows Returns the number of columns/rows. @end table @subheading Cell Selection Cell selection behaviour depends on what matrix mode is set (see @code{-mode}) and whether or not it permits empty selection. @table @code @item -(id) selectedCell Returns the selected cell. @item -(NSArray*) selectedCells Returns the array of selected cells. @item -(int) selectedColumn @itemx -(int) selectedRow Returns the column/row the currently selected cell is located in. It returns @code{-1} if no cell is selected. @item -(void) selectAll:(id)@var{sender} Selects all the cells within the matrix. @item -(void) selectCell:(NSCell*)@var{aCell} Selects the cell within the matrix that matches @var{aCell}. @item -(void) selectCellAtRow:(int)@var{row} column:@var{column} Selects the cell at @var{row} and @var{column}. Set either integer to @code{-1} to deselect all the cells. @item -(void) deselectAllCells Deselects all the cells within the matrix (if mode isn't NSRadioModeMatrix and if it permits empty cell selection). @item -(void) deselectSelectedCell Deselects the selected cell, subject to the matrix mode behaviour. @end table @section NSTableView Class Hierarchy: @i{NSTableView : NSControl : NSView : NSResponder : NSObject} @subsection NSTableDataSource (informal protocol) @cindex protocols, NSTableDataSource @table @code @item -(int) numberOfRowsInTableView:(NSTableView*)@var{aTableView} Returns the number of rows that the table view should display. This method is called frequently and is compulsory. @item -(id) tableView:(NSTableView*)@var{tableView} objectValueForTableColumn:(NSTableColumn*)@var{aTableColumn} row:(int)@var{row} Returns an object that should be displayed in @var{tableView}, in column @var{tableColumn} and row @var{tableRow}. This value is usually a string object, but could be number object or similiar. This method is called frequently and is compulsory. @item -(void) tableView:(NSTableView*)@var{aTableColumn} setObjectValue:(id)@var{anObject} forTableColumn:(NSTableColumn*)@var{aTableColumn} row:(int)@var{rowIndex} This is called to indicate that the value in the respective column and row has changed. The data source should update itself with the new object value. Implementation of this method is necessary for allowing your table to be modified. @item -(BOOL) tableView:(NSTableView*)@var{table}View writeRows:(NSArray*)@var{rows} toPasteboard:(NSPasteboard*)@var{pboard} This is method is usually the first stage in a drag and drop operation. It asks the data source to write the rows specified by an array of numbers (@var{rows}) to @var{pboard}. Return @code{NO} to reject the drag operation, or @code{YES} if the rows have been written to the pasteboard to begin the drag. @item -(BOOL) tableView:(NSTableView*)@var{aTableView} acceptDrop:(id)@var{info} row:(int)@var{row} dropOperation:(NSTableViewDropOperation)@var{operation} This is called after a mouse "drag and drop" operation has been completed (and formerly authorised) to indicate what kind of drop operation has occurred, what row it has occurred in and the information associated with the drop operation (the @var{info} parameter). This method is optional. @end table @subsection NSTableViewDelegate (informal protocol) @cindex protocols, NSTableViewDelegate @table @code @item -(BOOL) selectionShouldChangeInTableView: (NSTableView*)aTableView Returns @code{YES} if the user should be permitted to change their current selection (often a row) in @var{aTableView}. Use this for the complex validation of user's changing the current selection. @item -(void) tableView: (NSTableView*)tableView didClickTableColumn: (NSTableColumn*)tableColumn Called by @var{tableView} after the user clicked and released anywhere in @var{tableColumn}. Does not include dragging. @item -(void) tableView: (NSTableView*)tableView didDragTableColumn: (NSTableColumn*)tableColumn Called after the user dragged @var{tableColumn} in @var{tableView}. @item -(void) tableView: (NSTableView*)tableView mouseDownInHeaderOfTableColumn: (NSTableColumn*)tableColumn Called when the user specifically clicks the mouse button down in the area defined by @var{tableColumn} in @var{tableView} @item -(BOOL) tableView: (NSTableView*)aTableView shouldEditTableColumn: (NSTableColumn*)aTableColumn row: (int)rowIndex This is called just after the user indicates they wish to edit the cell specified by @var{rowIndex} and @var{tableColumn}. Return @code{YES} to allow the user to edit this cell, or return @code{NO} disallow editing. @item -(BOOL) tableView: (NSTableView*)aTableView shouldSelectRow: (int)rowIndex This is called when the user tries to select the row indicated by @var{rowIndex} in @var{aTableView}. Return @code{YES} to permit this row to be selected, or @code{NO} otherwise. @item -(BOOL) tableView: (NSTableView*)aTableView shouldSelectTableColumn: (NSTableColumn*)aTableColumn This is called when the user tries to select the column indicated by @var{aTableColumn}. Return @code{YES} to permit this column to be selected, or @code{NO} otherwise. @item -(void) tableView: (NSTableView*)aTableView willDisplayCell: (id)aCell forTableColumn: (NSTableColumn*)aTableColumn row: (int)rowIndex This is called by the tableview just before @var{aCell} is displayed. Use this method to setup any display attributes about a cell just before @var{aTableView} draws it. @item -(void) tableViewColumnDidMove: (NSNotification*)aNotification This is called after the user moved a column. Refer to @var{aNotification} for the information sent with the @code{NSTableViewColumnDidMoveNotification} notification. @item -(void) tableViewColumnDidResize: (NSNotification*)aNotification This is called after the user resized a column. Refer to @var{aNotification} for the information sent with the @code{NSTableViewColumnDidResizeNotification} notification. @item -(void) tableViewSelectionDidChange: (NSNotification*)aNotification This is called after the user changed their selection. Refer to @var{aNotification} for the information sent with the @code{NSTableViewSelectionDidChangeNotification} notification. @item -(void) tableViewSelectionIsChanging: (NSNotification*)aNotification This is called while the user is in the middle of changing the current selection, often by dragging the mouse around the tableview. Refer to @var{aNotification} for the information sent with the @code{NSTableViewSelectionIsChangingNotification} notification. @end table @subsection Notifications All these notifications have the tableview which posted them as their notification object. @table @code @item NSTableViewColumnDidMoveNotification This is posted when a column moved within a tableview as a result of a user action. It contains a userinfo dictionary with two keys: @code{@@"NSOldColumn"} and @code{@@"NSNewColumn"} which are @code{NSNumber} objects referring to the previous and new column indices (respectively). @item NSTableViewColumnDidResizeNotification This is posted when a column is resized within a tableview. It's userinfo dictionary contains two keys: @code{@@"NSTableColumn"} which refers to the resized column and @code{@@"NSOldWidth"} which is a @code{NSNumber} object containing the columns' previous width. @item NSTableViewSelectionDidChangeNotification This is posted when the selection within a tableview has changed. Use the tableview to discover the new selection. @item NSTableViewSelectionIsChangingNotification This is posted as the selection in a tableview is changing, such as when the user drags their mouse over it's cells. @end table @section NSView An abstract representation of a @dfn{view}. Should not be instantiated; instead, subclass and customise it's behaviour. Class Hierarchy: @i{NSView : NSResponder : NSObject} @subheading Superviews and Subviews @table @code @item -(NSView*) superview Returns the superview of this view. @item -(void) addSubview:(NSView*)@var{aview} Adds @var{aview} to the receiver. @end table @subheading Frame and Bounds manipulation @table @code @item -(void) setBoundsOrigin:(NSPoint)@var{origin} Set's the origin of the bounds rectangle @item -(void) setBoundsSize:(NSSize)@var{size} Set the size of the bounds rectangle @item -(void) setFrameOrigin:(NSPoint)@var{origin} Frame origin @item -(void) setFrameSize:(NSPoint)@var{size} Set the frame's size. @end table @subheading Rotation and Scaling @table @code @item -(void) scaleUnitSquareToSize:(NSSize)@var{size} Scales the size of each "pixel" in a view by the fraction given in @var{size}. @item -(void) rotateByAngle:(float)@var{degrees} Rotates the coordinate system counterclockwise in degrees. Negetive values are clockwise. @end table @subheading Drawing @table @code @item -(void) drawRect:(NSRect)@var{rect} Override this method with your drawing code. Note that the origin is set at the bottom-left corner of your view when this method is called, and the clipping rectangle is set at the frame/bounds rectangle. @end table gnustep-gui-0.24.0/Documentation/manual/BasicClasses.texi0000664000076500007650000000521410377004044023263 0ustar brains99brains99@paragraphindent 0 @node Basic Classes @chapter Basic Classes This is a simple introduction to the major classes in the GNUstep GUI library API. If you know nothing about the OpenStep AppKit, it could be a good idea to read this before you start reading the reference documentation. I am very interested in comments regarding this text, particularly from people who are new to the OPENSTEP AppKit API. Send comments and/or suggestions to Nicola Pero (n.pero@@mi.flashnet.it). @section NSView @cindex NSView class NSView is the class of objects representing a rectangular area (usually in a window) with its own coordinate system. Views have methods to draw inside the view, to change the view's coordinate system, and to place the view with arbitrary position and size inside another view. When you place a view inside another view, you are technically making the smaller view a subview of the bigger view. The whole drawable area inside the window itself is represented by a view, called the content view. All the visible views in a window are then subviews of the content view of that window (or of the content view's subviews etc). This gives rise to what is called the "view tree" of the window. @section NSCell @cindex NSCell class NSCell is the class of objects representing a single amount of displayable data. For example, a cell could represent a number, or a string, or an image. Cells have methods to draw the data they represent in a view, to change the way the data is to be drawn (eg the font for a string or the border for an image), and to let the user interact directly (eg editing the data) with the data in a view. @section NSControl @cindex NSControl class NSControl is the class of objects representing a view (i.e., a rectangular area in a window) used to manage one or more cells (i.e., some displayable data). This class is usually designed to work with a subclass of NSCell, called NSActionCell, through a system of target/action. Each actioncell has a target - an object - and an action - a selector - both of which can be arbitrarily set. The control can then ask the cell to send its action to its target (ie, to invoke the method of the target object identified by the selector) as a consequence of user actions in the control. The typical example is a button: a button is a control with a corresponding cell; when the user presses the button, the buttoncell sends its action to its target. Controls are the high-level objects the you usually deal with when designing everyday-life user interfaces. You do not usually need to bother about cells, because the controls manage the cells for you. @page gnustep-gui-0.24.0/Documentation/manual/intro.texi0000664000076500007650000002130010537306212022051 0ustar brains99brains99@paragraphindent 0 @node Introduction, basicconcepts, Top, Top @chapter Introduction This manual documents some configuration and installation issues with the GNUstep GUI Library and also differences between the GUI Library and libraries that implement the OpenStep AppKit specification and the MacOS-X AppKit implementation. @section Overview The GNUstep GUI Library is a library of objects useful for writing graphical applications. For example, it includes classes for drawing and manipulating graphics objects on the screen: windows, menus, buttons, sliders, text fields, and events. There are also many peripheral classes that offer operating-system-independent interfaces to images, cursors, colors, fonts, pasteboards, printing. There are also workspace support classes such as data links, open/save panels, context-dependent help, spell checking. It provides functionality that aims to implement the @samp{AppKit} portion of the OpenStep standard. However the implementation has been written to take advantage of GNUstep enhancements wherever possible. The GNUstep GUI Library is divided into a front and back-end. The front-end contains the majority of implementation, but leaves out the low-level drawing and event code. Different back-ends will make GNUstep available on various platforms. The default GNU back-end currently runs on top of the X Window System and uses only Xlib calls for graphics. Another backend uses a Display Postscript Server for graphics. Much work will be saved by this clean separation between front and back-end, because it allows different platforms to share the large amount of front-end code. Documentation for how the individual backends work is coverered in a separate document. @section Implementation Details Following are some implementation details of the GUI library. These will mostly be of interest to developers of the GUI library itself. @subsection Drag and Drop The drag types info for each view is kept in a global map table (protected by locks) and can be accessed by the backend library using the function - @smallexample NSArray *GSGetDragTypes(Nsview *aView); @end smallexample Drag type information for each window (a union of the drag type info for all the views in the window) is maintained in the graphics context. The backend can get this information (as a counted set) using - @smallexample - (NSCountedSet*) _dragTypesForWindow: (int)winNum; @end smallexample Whenever a DnD aware view is added to, or removed from a window, the type information for that view is added to/removed from the type information for the window, altering the counted set. If the alteration results in a change in the types for the window, the method making the change returns YES. @smallexample - (BOOL) _addDragTypes: (NSArray*)types toWindow: (int)winNum; - (BOOL) _removeDragTypes: (NSArray*)types fromWindow: (int)winNum; @end smallexample The backend library should therefore override these methods and call 'super' to handle the update. If the call to the super method returns YES, the backend should make any changes as appropriate (in the case of the xdnd protocol this means altering the XdndAware property of the X window). You will notice that these methods use the integer window number rather than the NSWindow object - this is for the convenience of the backend library which should (eventually) use window numbers for everything @subsection NSWorkspace Here is (I think) the current state of the code (largely untested) - The make_services tool examines all applications (anything with a .app, .debug, or .profile suffix) in the system, local, and user Apps Directories. In addition to the cache of services information, it builds a cache of information about known applications (including information about file types they handle). NSWorkspace reads the cache and uses it to determine which application to use to open a document and which icon to use to represent that document. The NSWorkspace API has been extended to provide methods for finding/setting the preferred icon/application for a particular file type. NSWorkspace will use the 'best' icon/application available. To determine the executable to launch, if there was an Info-gnustep.plist/Info.plist in the app wrapper and it had an NSExecutable field - use that name. Otherwise, try to use the name of the app - eg. foo.app/foo The executable is launched by NSTask, which handles the addition of machine/os/library path components as necessary. To determine the icon for a file, use the value from the cache of icons for the file extension, or use an 'unknown' icon. To determine the icon for a folder, if the folder has a '.app', '.debug' or '.profile' extension - examine the Info.plist file for an 'NSIcon' value and try to use that. If there is no value specified - try foo.app/foo.tiff' or 'foo.app/.dir.tiff' If the folder was not an application wrapper, just try the .dir.tiff file. If no icon was available, use a default folder icon or a special icon for the root directory. The information about what file types an app can handle needs to be in the MacOS-X format in the Info-gnustep.plist/Info.plist for the app - see @url{http://developer.apple.com/techpubs/macosxserver/System/Documentation/Developer/YellowBox/ReleaseNotes/InfoPlist.html}. In the NSTypes fields, I used NSIcon (the icon to use for the type) NSUnixExtensions (a list of file extensions corresponding to the type) and NSRole (what the app can do with documents of this type). In the AppList cache, I generate a dictionary, keyed by file extension, whose values are the dictionaries containing the NSTypes dictionaries of each of the apps that handle the extension. I tested the code briefly with the FileViewer app, and it seemed to provide the icons as expected. With this model the software doesn't need to monitor loads of different files, just register to recieve notifications when the defaults database changes, and check an appropriate default value. At present, there are four hidden files used by the software: @table @samp @item ~/GNUstep/Services/.GNUstepAppList Cached information about applications and file extensions. @item ~/GNUstep/Services/.GNUstepExtPrefs User preferences for which apps/icons should be used for each file extension. @item ~/GNUstep/Services/.GNUstepServices Cache of services provides by apps and services daemons @item ~/GNUstep/Services/.GNUstepDisabled User settings to determine which services should not appear in the services menu. @end table Each of these is a serialized property list. Almost forgot - Need to modify NSApplication to understand '-GSOpenFile ...' as an instruction to open the specified file on launching. Need to modify NSWorkspace to supply the appropriate arguments when launching a task rather than using the existing mechanism of using DO to request that the app opens the file. When these changes are made, we can turn any program into a pseudo-GNUstep app by creating the appropriate app wrapper. An app wrapper then need only contain a shell-script that understands the -GSOpenFile argument and uses it to start the program - though provision of a GNUstep-info.plist and various icons would obviously make things prettier. For instance - you could set up xv.app to contain a shellscript 'xv' that would start the real xv binary passing it a file to open if the -GSOpenFile argument was given. The Info-gnustep.plist file could look like this: @example @{ NSExecutable = "xv"; NSIcon = "xv.tiff"; NSTypes = ( @{ NSIcon = "tiff.tiff"; NSUnixExtensions = ( tiff, tif ); @}, @{ NSIcon = "xbm.tiff"; NSUnixExtensions = ( xbm ); @} ); @} @end example @section Contributing Contributing code is not difficult. Here are some general guidelines: @itemize @bullet @item FSF must maintain the right to accept or reject potential contributions. Generally, the only reasons for rejecting contributions are cases where they duplicate existing or nearly-released code, contain unremovable specific machine dependencies, or are somehow incompatible with the rest of the library. @item Acceptance of contributions means that the code is accepted for adaptation into libgnustep-gui. FSF must reserve the right to make various editorial changes in code. Very often, this merely entails formatting, maintenance of various conventions, etc. Contributors are always given authorship credit and shown the final version for approval. @item Contributors must assign their copyright to FSF via a form sent out upon acceptance. Assigning copyright to FSF ensures that the code may be freely distributed. @item Assistance in providing documentation, test files, and debugging support is strongly encouraged. @end itemize Extensions, comments, and suggested modifications of existing libgnustep-gui features are also very welcome. @page gnustep-gui-0.24.0/Documentation/manual/browsers.texi0000664000076500007650000001566410537306212022604 0ustar brains99brains99@c GNUstep AppKit Guide @c @c Copyright (c) 2005-2006 Christopher Armstrong. @c @c Permission is granted to copy, distribute and/or modify this document @c under the terms of the GNU Free Documentation License, Version 1.2 @c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. @c A copy of the license is included in the section entitled "GNU @c Free Documentation License". @c @c This documentation is provided on an "AS IS" BASIS, WITHOUT WARRANTY @c OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED @c TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @c PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND USEFULNESS @c OF THE DOCUMENTATION IS WITH YOU (THE LICENSEE). IN NO EVENT WILL THE COPYRIGHT @c HOLDERS BE LIABLE FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, @c SPECIAL, GENERAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF @c THE USE OR INABILITY TO USE THIS DOCUMENTATION (INCLUDING BUT NOT @c LIMITED TO LOSS OF DATA, USE, OR PROFITS; PROCUREMENT OF SUBSTITUTE @c GOODS AND SERVICES; OR BUSINESS INTERUPTION) HOWEVER CAUSED, EVEN @c IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @node browsercontrols, dataexchange, matrix, Top @chapter Browsers @anchor{Browsers} @cindex browsers, definition @cindex controls, browsers A @dfn{browser} is a special type of matrix control, useful for the display of hierachial or tree-like data. They use vertical lists of cells, in which some cells can be selected so that they display the "branches" of a tree in the adjacent pane. In this way, a user can easily navigate a hierachy, such as a filesystem which has many directories and sub-directories. In fact, the textual data in a browser can be accessed using path like string components, such as @file{/path/to/leaf} or @file{/usr/local/lib}. A good example of it's use in filesystems is GWorkspace, GNUstep's file manager application.@footnote{Note that GWorkspace customises it's browser controls significantly}. @cindex leaf @cindex branch @cindex paridgms, leaves and branches We introduce the concept of @dfn{leaves} and @dfn{branches}. A @dfn{leaf} is a simple browser cell that only display's text; it does not open a new browser pane with sub-cells when it is selected. A @dfn{branch} both display text, and when selected, it fills the pane to the right with a list of leaves and/or branches that represent a group of cells logically below this one. A branch shows an arrow to indicate that it can be selected to display sub-cells. It is useful when dealing with tree-structures such as that modelled in Computer Sciencei courses. Each pane in the browser view is actually a one-column matrix (an @code{NSMatrix} object) which can be returned. Like many other controls, browsers define their own cell class, known as @code{NSBrowserCell}. It provides methods that are used to implement the functionality described above. Browsers use a simple delegate to decide how to display your hierachial data, which can be passive or active (see below). @section Browser Cells As mentioned above, @code{NSBrowserCell} is used to implement the cells's placed in a browser. As a class it is quite simple, and warrants little attention. It responds to all the methods in @code{NSCell}, such as @code{setText:} and the set value methods. Additionally, we can find out if it is a leaf using the @code{-isLeaf} method, and set whether or not it is a leaf using the @code{-setLeaf:} method. You can set whether the browser cell is selected using the @code{-set} method, and reset it using the @code{-reset} method. A cell shows that it is selected (or "set") when it is highlighted. @section Browser Methods Browsers provide a number of methods used for customising their behaviour, setting their data and getting information about their state. The path to the currently selected item (as described above) can be found using the @code{-path} method. You can find out the path leading upto a column with the @code{-pathToColumn:} method. An easy way of setting the current path is the @code{-setPath:} operator. You can customize the appearance of a browser and it's columns in various ways. Use @code{-setSeparatesColumns:} to have each column drawn in a separate pane. @code{-setTakesTitleFromPreviousColumn:} has it take the title displayed in the current column from the cell selected in the previous column, while @code{-setTitle:ofColumn:} allows you to set a column title directly. @code{-setTitled:} changes whether column titles are displayed at all. The types of operations permitted by the user can be changed as well. @code{-setAllowsMultipleSelection:} can be used to allow multiple selection, while @code{-setAllowsEmptySelection:} can be used to permit nothing to be selected. Use @code{-setAllowsBranchSelection:} to allow multiple branches to be selected when in multiple selection mode. The first and last column visible in the browser is found via the @code{-firstVisibleColumn} and @code{-lastVisibleColumn} respectively. @section Browser Delegate @cindex browsers, delegate @cindex protocols, NSBrowserDelegate @cindex defintiion, active and passive delegates The delegate for a browser is used to gather it's data. It can be optionally @dfn{passive} or @dfn{active}, the difference being that active delegates instantiate the browser cell's themselves, whilst passive delegates leave this to @code{NSBrowser}. As a result, you can only implement one or the other subset of methods in @code{NSBrowserDelegate} informal protocol.. A @dfn{passive} delegate must implement the @code{-browser:numberOfRowsInColumn:}, returning the number of rows to appear in the specified column number. On the other hand, @dfn{active} delegates must implement @code{-browser:createRowsForColumn:inMatrix:} and create the cells for that column proactively. You can only implement one of these methods; not both. All browser delegates can implement @code{-browser:willDisplayCell:atRow:column:}, a method called by the browser object before a particular cell is displayed so that the delegate can set up its properties. This method is a must for passive delegates. Another method that should be implemented is @code{-browser:selectRow:inColumn:}, as it is the delegate's responsibility to select cells (often by calling @code{-set} on the corresponding @code{NSBrowserCell} object). This method returns whether or not the cell was selected. You can optionally implement a number of other delegate methods if you wish. @code{-browser:titleOfColumn:} is called to get the title for a certain column, returned as a string, before the column is drawn. Keeping track of when the browser scrolls can be accomplished by implementing the @code{-browserWillScroll:} and/or the @code{-browserDidScroll:} methods. You can also specify to the browser whether or not columns are "valid" by implementing the @code{-browser:isColumnValid:} method. This is called by the browser in response to its @code{-validateVisibleColumn:} method, which checks whether a column is invalid and needs redrawing. gnustep-gui-0.24.0/Documentation/manual/gnustepapplication.texi0000664000076500007650000003575210537306212024647 0ustar brains99brains99@c GNUstep AppKit Guide @c @c Copyright (c) 2005-2006 Christopher Armstrong. @c @c Permission is granted to copy, distribute and/or modify this document @c under the terms of the GNU Free Documentation License, Version 1.2 @c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. @c A copy of the license is included in the section entitled "GNU @c Free Documentation License". @c @c This documentation is provided on an "AS IS" BASIS, WITHOUT WARRANTY @c OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED @c TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @c PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND USEFULNESS @c OF THE DOCUMENTATION IS WITH YOU (THE LICENSEE). IN NO EVENT WILL THE COPYRIGHT @c HOLDERS BE LIABLE FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, @c SPECIAL, GENERAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF @c THE USE OR INABILITY TO USE THIS DOCUMENTATION (INCLUDING BUT NOT @c LIMITED TO LOSS OF DATA, USE, OR PROFITS; PROCUREMENT OF SUBSTITUTE @c GOODS AND SERVICES; OR BUSINESS INTERUPTION) HOWEVER CAUSED, EVEN @c IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @c @c Contributions @c @c * Thanks to Damien Pollet for some minor spelling and grammatical fixups. @node gnustepapplications, applicationmakefiles, basicconcepts, Top @chapter GNUstep Applications @cindex AppKit The AppKit provides services to develop complex and modern GUI applications. Some of these services include generic controls and displays, pasteboard and true drag-and-drop, separated interface and code files, etc. @cindex application-centric programming Compared to other platforms and development toolkits, GNUstep takes a slightly different paradigm to development. Operating systems such as Microsoft Windows treat applications in a more window-centric manner, e.g. each document starts a new instance of the application, in a new window with its own menu. In GNUstep, applications are treated in an application centric manner. This means that there is one menu for the application, and documents and other windows are associated with this menu instance. This probably requires a different attitude to development, but the AppKit is quite well integrated and logical to convey some of the ideas it introduces. @section Components @cindex applications, components A GNUstep application has various components that are assembled (from a developer's perspective) into an @dfn{app wrapper}. An app (application) wrapper is a directory with the extension @file{.app} that holds the application's @dfn{executable} and @dfn{resource files}, as noted below. @subsection Interface File(s) An application has one or more @dfn{interface files}. These are separate file entities that are used to display the graphical interface that your application has. They are comparable to .glade interface files used in GNOME or those used in Qt, however they go a bit further, permitting easy linking against your objects, so that you are freed from writing wrapper code. They are created using Gorm, GNUstep's application modelling programme. It allows real drag and drop GUI assembly and direct control editing. Most applications take one interface file, which contains their main menu and their main window, presented to the user. They will also take you preferences and other auxilliary windows that you application requires. They take no Objective-C code (being strictly interface only), but generic class templates are able to be generated for outlets and actions that you set Gorm to integrate with. Interface files are commonly referred to as "nib" files or "gorm" files, taken from the name of programmes used to generate them. They appear as a directory on your filesystem, and often take the name of your application with the extension @file{.gorm}. @subsection Application property list This file is a property list, containing the defaults and some information used to load your application, include the main interface file, supported document types and interapplication services. It usually takes the name @file{Info-gnustep.plist}. See the base manual for more details about the syntax and structure of property lists. We will provide the details of application property lists through this manual. @subsection Makefile @cindex makefiles Like GNUstep tools, applications have a file, @file{GNUmakefile}, for easy application compilation, linking and assembly into an app wrapper. It includes the name and version of your application, source code file, required libraries and frameworks and your resource files (detailed below). @cindex resource files @subsection Resource Files @dfn{Resource Files} are any sorts of resources that your application will need to operate, including interface files and any icons, images, data, etc. that your application uses. They are stored in the @file{Resources} directory in your application's app wrapper. You will most likely ever need only two resources: your interface file, and your application's property list (Info-gnustep.plist). @section Constructing an application @cindex applications, construction Below, we have listed the main steps required in the building of an application from scratch. These steps are listed in a general, but you will generally need to come back to them again e.g. if you add new source or interface files to your application, you will need to come back and modify the makefile. See the chapters on Makefile creation, Interface files and Application property lists for more details on the construction of these various files. @enumerate @item GNUmakefile You will need to create a GNUmakefile to build your application. A generic template is shown in the chapter entitled @pxref{Application Makefiles}. @item Interface Files You will need at least one interface file (@file{.gorm}) for your application, however, you can create your interface programatically if necessary (although this is rarely recommended). @item Application Property List This is generally necessary, especially if you want to define your main interface file, however it is possible to let the @command{make} application generate it for you. @item Other Resource Files These may include icons, images, other property lists, application-specific data files. You can add whatever resource files you like, including directories (which should be added recursively). @end enumerate @section Building a First Application This section attempts to run you through the steps that you would usually go through to assemble an application from scratch. We expect that you have some experience programming with Objective-C, especially with GNUstep, and that you at least have it installed and running with some applications installed. Apart from helping you setup the infrastructure for a basic application, we've provided instructions for a basic control and event handler as an example. You may wish to ignore these steps, but they're useful reminders if you use these instructions in the future. A checklist includes: @enumerate @item GNUstep Make sure that you have gnustep-make, gnustep-base, gnustep-gui and gnustep-back installed and running on your system. There system-specific instructions for installing GNUstep on different systems at the website, @cite{http://www.gnustep.org}. We also expect that you have some experience using it, such as sourcing the GNUstep startup shell file and starting applications. There are various tutorials and instructions available on the internet for getting GNUstep up and running. @item Gorm.app Gorm, as mentioned above, is the GNUstep interface builder. It's available as an application from the GNUstep web site, and is the recommended means to build interfaces for applications. Make sure that it will startup and operate correctly on your system. We will use it to build the interface for our application. @item A text editor Depending on what platform your working on and whether or not you're using a GUI, an editor could be anything simple from @command{vim} to a good quality free editor like @command{gedit} or @command{kate}. You will need it to edit the source code files and makefiles we will use to build the application. @item A shell GNUstep's makefile system depends heavily on the shell environment that @command{make} commands are invoked in. On Unix, this could be @file{sh}, @file{bash}, @file{ksh}, @file{csh} or whatever you prefer to work with. On Windows, you will want to use MSYS which comes with a minimal Unix-like shell (a port of @command{bash}) which is sufficient for use with GNUstep. If you use the installable binary version of GNUstep for Windows, you should have a copy of MSYS installed. We will assume somewhat that you know your way around your filesystem using it, and that you know most basic commands for creating files, starting programmes, manipulating directory structures, etc. @end enumerate @subsection Setup Startup your shell and source GNUstep.sh from your GNUstep installation (if it's not sourced by default). Create a directory for your application sources to be created in. For example: @smallexample > cd ~ > mkdir firstapp > cd firstapp > . /usr/lib/GNUstep/System/Library/Makefiles/GNUstep.sh > @end smallexample In the above, we simply created a new directory under our home directory called @file{firstapp}, changed into it and sourced our GNUstep installation (which in this case is under @file{/usr/lib}@footnote{Replace @file{/usr/lib} with the path to your GNUstep installation}). Next we will create our makefile. Using your favourite editor, create a file called @file{GNUmakefile} (the case is important). In this case we're using @command{vim}: @smallexample touch GNUmakefile vim GNUmakefile @end smallexample And in the makefile, add the following: @smallexample include $(GNUSTEP_MAKEFILES)/common.make APP_NAME = FirstApp FirstApp_OBJC FILES = main.m \ MyController.m FirstApp_MAIN_MODEL_FILE = FirstApp.gorm FirstApp_RESOURCE_FILES = FirstApp.gorm include $(GNUSTEP_MAKEFILES)/application.make @end smallexample The first line of the makefile includes some declarations common to all makefiles (tools, bundles, etc). @var{APP_NAME} contains a space-separated list of the applications to build. In this case we're only building one (FirstApp). The application wrapper that is outputted will be called @file{FirstApp.app}. This name also is used to prefix each of the following variables. If you were to change this value, you would have to change the value of @var{_OBJC_FILES}, @var{_MAIN_MODEL_FILE}, etc. accordingly. @var{FirstApp_OBJC_FILES} contains a list of each of the Objective-C files that will be compiled into this programme. Note that like normal makefiles, you can split a variable declaration like this over a number of lines by using the "\" delimeter. @var{FirstApp_MAIN_MODEL_FILE} is the main interface file wrapper. @var{FirstApp_RESOURCE_FILES} contains a list of all the resources, including interface files, icons, property lists etc. The final line lets the makefile system know we want to build an application. @subsection Interface File Make sure you are familiar with Gorm before using this. Refer to the @cite{Gorm Manual}, a link to which should be at http://www.gnustep.org/experience/Gorm.html. Load up @command{Gorm.app} and create a "New Application". A window should appear with the title and a project called "UNTITLED". @smallexample openapp Gorm.app From the menu, select Document->New Application @end smallexample Save your project as "FirstApp.gorm" by going to Document->Save, navigating to the project directory, typing in "FirstApp" as the filename and clicking "OK". Select your window in the project pane. Switch to the Inspector and give it a new name such as "My First Application". Switch back to the project pane. Select "Classes" from the toolbar. From the class view, select "NSObject", goto the main menu and select Classes->Create Subclass. Double-click the new class in the class view, and double-click to rename it to "MyController" (case is important). Click "OK" if prompted. We're going to use this class as our application's main controller, but you can create as many "controller" classes as you like with whatever names you choose. It just so happens that we've decided to create a file with the name "MyController.m" that will contain the implementation of this class. Note that GNUstep doesn't enforce a strict MVC pattern on your classes; it merely separates the view part into it's own classes which you configure in Gorm.app, and lets you handle data and behaviour (Model and Controller) in your code as you like. Select the button in the "Action" column for "MyController" then goto Classes->Add Outlet/Action. Rename the action to "myAction:". Select the class again, and goto Classes->Instantiate. Again, we could call this action whatever we like, just make sure that it's not something generic like "click:", which are used by the NSResponder class. The name of the button in method name form is often a good choice. For the MyController class, goto the main menu and select Classes->Create Class Files. Save them as "MyController.h" and "MyController.m". Gorm.app fills out the basic details for this class (including the action). If you modify the actions and/or outlets on the class in Gorm.app in the future, you will want to add them to your class interface and implementation manually. Gorm.app will override your modifications to files if you tell it to create the class files at some time in the future.@footnote{If you really don't want to add the outlets/actions to your class by hand if you modify the interface in the future, you could just save the classes to differently named files and then merge the changes back into the original files.} Goto the palette, click the third toolbar button and then click and drag a new button object onto the window. Double-click the button to rename it and call it "My Action". We now want to connect the button to the action on @var{MyController}. First switch to the "Objects" pane in the project view. Note that our @var{MyController} class is listed as an object instance, as we instantiated it before. Select it, switch to the Inspector and then select "Connections" from the drop-down box. Now, make sure that the application window with the button on it and the project window are both visible at the same time. Hold down your first control key (usually left-Ctrl), click the button on the window, and drag the icon to the @var{MyController} object in the Objects pane and release. While you are dragging the mouse, you will note that the icon looks like a small circle with a "T" in it. The source object (the button) will continue to contain the "S" circle while the target object (the @var{MyController} instance) contains the "T" circle. Goto File->Save to save your interface file and then quit Gorm.app. @subsection Code Although we have got Gorm.app to autogenerate our class files, we will want to modify them so that they do something (marginally) useful. Open "MyController.m". At the moment it should look something like: @example #import "MyController.h" #import @@implementation MyController - (void) myAction:(id) sender @{ @} @@end @end example gnustep-gui-0.24.0/Documentation/manual/dataexchange.texi0000664000076500007650000006665510537306212023360 0ustar brains99brains99@c GNUstep AppKit Guide @c @c Copyright (c) 2005-2006 Christopher Armstrong. @c @c Permission is granted to copy, distribute and/or modify this document @c under the terms of the GNU Free Documentation License, Version 1.2 @c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. @c A copy of the license is included in the section entitled "GNU @c Free Documentation License". @c @c This documentation is provided on an "AS IS" BASIS, WITHOUT WARRANTY @c OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED @c TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @c PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND USEFULNESS @c OF THE DOCUMENTATION IS WITH YOU (THE LICENSEE). IN NO EVENT WILL THE COPYRIGHT @c HOLDERS BE LIABLE FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, @c SPECIAL, GENERAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF @c THE USE OR INABILITY TO USE THIS DOCUMENTATION (INCLUDING BUT NOT @c LIMITED TO LOSS OF DATA, USE, OR PROFITS; PROCUREMENT OF SUBSTITUTE @c GOODS AND SERVICES; OR BUSINESS INTERUPTION) HOWEVER CAUSED, EVEN @c IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @node dataexchange, images, browsercontrols, Top @chapter Data Exchange @dfn{Data Exchange} refers to the many high-level options GNUstep provides for allowing different applications to exchange common types of data. The sorts of services include "cut and paste", "drag and drop", service applications, filter services and distributed objects. We begin our discussion with an explanation of pasteboards, which form the basis of data exchange in GNUstep. We will then go on to explain how your application can expose or consume these different sorts of data exchange services. However you receive data, it will most likely involve the use of pasteboards, hence the next section is very important. @section Pasteboards A @dfn{pasteboard} is the helper object used to exchange data between applications. It is an instance of the @code{NSPasteboard} class. Data is written to the pasteboard in different forms that it can be represented, so that the application or service receiving the data can use it. There is a pasteboard server, a service provided with GNUstep which handles pasting between GNUstep applications. You may recognise it as the @command{gpbs} application. @cindex pasteboards, standard names Every pasteboard has a name that can be used to identify it. This is a string, which should be unique, but some standard pasteboard names are defined for certain uses: @vtable @code @item NSGeneralPboard The @dfn{general pasteboard}, often used with copy and paste. @item NSFontPboard Used for the exchange of font data. @item NSRulerPboard Used for the exchange of ruler data. @item NSFindPboard Used for "Find and Replace" editing. @item NSDragPboard Used in the exchange of drag'n'drop data. @end vtable You can retreive a pasteboard by name using the @code{+pasteboardWithName:} method, or with a guaranteed unique name with the @code{+pasteboardWithUniqueName} method. All pasteboards also have any number of @dfn{types}. A @dfn{type} is simply one form of data that the pasteboard will contain, such as HTML data or text data. The supported data types are listed below: @cindex pasteboards, standard types @itemize @bullet @item NSColorPboardType @item NSDataLinkPboardType @item NSFileContentsPboardType @item NSFilenamesPboardType @item NSFontPboardType @item NSGeneralPboardType @item NSHTMLPboardType @item NSPostScriptPboardType @item NSPDFPboardType @item NSPICTPboardType @item NSRTFPboardType @item NSRTFDPboardType @item NSRulerPboardType @item NSStringPboardType @item NSTabularTextPboardType @item NSTIFFPboardType @item NSURLPboardType @end itemize See the AppKit manual for more information about storing these types of data on a pasteboard. Finally a pasteboard may or may not have an @dfn{owner}. An @dfn{owner} is an object implmenting the @code{NSPasteboardOwner} informal protocol that can provide the pasteboard with data of a certain type upon request. If you don't supply an owner object, you should store the data onto the pasteboard straight away. @subsection Constructing a pasteboard You can get a pasteboard using the @code{+pasteboardWithName:} method with one of the standard names above, or the @code{+pasteboardWithUniqueName:} for a pasteboard with a name that is unique to the pasteboard server. You can also get a pasteboard based on the available filter services by calling @code{+pasteboardByFilteringFile:} for a pasteboard containing file, accessible by all the data types that it can be filtered to. If you know the source data type, you can use @code{+pasteboardByFilterData:ofType:} specifying a data object for a pasteboard that can convert data to different types that can be filtered from your data's type. If you are constructing a pasteboard, you will want to call @code{-setData:forType:} method to put the associated data in the pasteboard for another object to read it out. Use @code{-declareTypes:owner:} to declare the types that this pasteboard will contain, and an owner object that will supply the data for those types that you don't explicitly write to the pasteboard. @subsection Using an Owner You can provide a pasteboard owner by implementing the @code{NSPasteboardOwner} informal protocol. This is used for the "lazy" provision of data. The pasteboard will call methods on the owner when it can't find the data being requested already stored on it. The first method to implement is @code{-pasteboard:provideDataForType:}. This is called when the pasteboard doesn't have the data specified by @var{type}. You give it to the pasteboard by calling @code{-setData:forType:} on the pasteboard. We can also implement @code{-pasteboardChangedOwner:}, which informs us that the owner has been changed and we no longer have to provide data to the pasteboard. GNUstep also has an extension, the @code{-pasteboard:provideDataForType:andVersion:} which should be implemented when data of a certain version as well is required. @section Cut and Paste Cut, copy and paste is the most common service you will want to provide in your application. Thankfully, all standard GNUstep objects handle copying and pasting where commonly appropriate, such as the NSText variety of objects. However, in some cases it may be useful to provide copying and pasting services, especially for your own views or on customised GNUstep views. The first thing to to is to provide two methods on your object called @code{-cut:}, @code{-copy:}, and/or @code{-paste:} both taking an object (the sender) as their first parameter. This will enable Gorm's standard "Cut", "Copy" and "Paste" menu items if you place them in your interface. You will usually use the general pasteboard for cut and paste, which can be retreived by going: @smallexample NSPasteboard* generalPB = [NSPasteboard pasteboardWithName:NSGeneralPboard]; @end smallexample The implementation of these methods should then follow. For cutting and copying: @enumerate @item Create a pasteboard Usually we use the general pasteboard, but you can create one with your own name if you like. @item Register types of data to be provided The next thing to do is specify which types of data you will provide on the pasteboard. Use the @code{-declareTypes:owner:} method, passing an array of types, and optionally, an owner object. @item Provide data for pasting You supply data to the pasteboard for pasting by using the @code{-setData:forType:} method. If you have used an owner, make sure that it implements the @code{NSPasteboardOwner} protocol and that it can return data in the form(s) specified in the previous step. @end enumerate If you decide to provide data in a number of types, it is often recommended you supply the @i{richest} type directly to the pasteboard, and use an owner to supply more basic data types. Simply use @code{if/else if} statements in the @code{-pasteboard:provideDataForType:} method on your owner. Pasting data is much simpler. Simply retreive the general pasteboard, and call the @code{-stringForType:} or @code{-propertyListForType:} method, passing in a type. Make sure that you declare the types your pasteboard supports with the @code{-declareTypes:owner:} method. You can specify nil for the owner if you are not using lazy data provision. @section Drag and Drop @dfn{Drag and drop} is often more complex. Many different standard views provide their own delegate protocols for receiving drag and drop events, and you should refer to the documentation for those (especially tableviews and outline views) before following the instructions in this section. However, this is still useful in explaining some important concepts. Such operations consist of both a @dfn{drag} and a @dfn{drop}@footnote{I know this seems really, really obvious, but just play along; I'm not trying to be patronising.}. The @dfn{drag} occurs when the user clicks their mouse button on a visible GUI element, and begins to mouse the mouse away from it. A @dfn{drop} occurs when the user moves the mouse over another GUI element and releases the mouse button. Obviously, dragging and dropping can only occur on visible elements of the screen that take up some real estate. Below, we discuss dragging sources and dragging destinations, and what is required to make your views responsive as such. @subsection Dragging Sources @cindex dragging, sources When a drag event is initiated, the @code{-dragImage:at:offset: event:pasteboard: source:slideBack:} method is called on your subclass of NSView. In this method, you need to supply a dragging image, a pasteboard to hold the data, and and a @dfn{dragging source} object (specified by the @code{source:} parameter). @cindex protocols, NSDraggingSource The @dfn{dragging source} object should implement the @code{NSDraggingSource} protocol. The main method to implement is @code{-draggingSourceOperationMaskForLocal:}, whereas the others are used for dragging session events (and are otherwise optional). In this method, you should return the set of binary or-ed values corresponding to the permitted drag operations on this displayed image representation, listed below: @cindex dragging, operations @table @code @item NSDragOperationNone No drag operations are permitted with this data. @item NSDragOperationCopy This data can be copied. @item NSDragOperationLink This data can be "shared". FIXME: WTF does this mean. @item NSDragOperationGeneric The type of drag operation that this is can be defined by the dragging destination. @item NSDragOperationPrivate This type of drag operation is defined privately by the source and destination objects, and hence negotiated between them. @item NSDragOperationMove The data represented by this drag operation can be moved to the destination. @item NSDragOperationDelete The destination can be responsible for deleting the data. @item NSDragOperationAll @itemx NSDragOperationEvery All the above drag operations are acceptable. @end table You can specify more than one of the above by binary or-ing them together (the single pipe operator). Note that if you permit the @code{NSDragOperationMove} or @code{NSDragOperationDelete} methods, you must implement the @code{-draggedImage:endedAt:operation:} method, which is called when a dragging operation is finished so that your source can cleanup any visual or internal data in the source (such as making the source image disappear). @subsection Dragging Destinations @cindex dragging, destinations @cindex protocols, NSDraggingDestination A view or window that is to act as a @dfn{dragging destination} should be sent the message @code{-registerForDraggedTypes:} with an array of the accepted dragging types. The view or window should then implement some of the methods in the @code{NSDraggingDestination} informal protocol. Some of these methods are listed below: @table @code @item - draggingEntered: This is method is called when the user drags something into the frame of your window or view. Use it to return what dragging types you will permit for the dragging info passed in @code{sender}. @item - prepareForDragOperation: This is called just after the user has dropped the dragged object. Use this method to make any preparations for the drop. Return YES to cancel the drop. @item - performDragOperation: This method is called so that you can perform the drop operation. This method is a must to implement. @item - concludeDragOperation: This is again optional, and can be used to perform any cleanup or post-drop operations. @item - draggingUpdated: This is called periodically as the drag image is moved within your frame. It can be optionally implemented to update the drag operation with different drag types (returned) as the user moves the drag images over various parts of your view. It may be useful if drag operations are context sensitive with respect to the graphical elements that your view displays. @end table Hence to act as a dragging destination, you need to at least implement @code{-draggingEntered:} and @code{-performDragOperation}. Make sure that when you actually perform the drag operation, that you retreive the pasteboard being used from the dragging destination (see below), as opposed to just retreiving the @code{NSDragPboard} named pasteboard, as you cannot be certain which pasteboard the dragging source has used for the drag operation. @subsection Dragging Information Both @code{NSDraggingSource} and @code{NSDraggingDestination} use objects implementing the @code{NSDraggingInformation} protocol to convey information about the drag'n'drop operation. You can use this to make better decisions in many of the above mentioned methods with relation to permitting/disallowing different drag types and drag operations. You never implement this protocol, however. The pasteboard being used for the drag operation can be retreived via the @code{-draggingPasteboard} method. The image being used for the drag operation and its location can be retrieved via the @code{-draggingImage} and @code{-draggingImageLocation} methods respectively. If you need to snap the image during the drag operation, use the @code{-slideDraggedImageTo:} method, but only do this during @code{-prepareForDragOperation:} in the destination object. @section Services and Filter Services A @dfn{service} is a special type of application or tool that can be used to process data outside of the application. An application can both take advantage of services, or provide them to other applications. Like "cut and paste" and "drag'n'drop", services use pasteboard to receive data and send it back to the calling application. A user can usually make use of a service by selecting something in your application (such as some text or an object) and selecting a service from the "Services" menu. You can also invoke services programmatically. One way is to put a @var{Services} sub-menu in your interface file's menu using @command{Gorm} (as mentioned above. The other way is to call the @code{NSPerformService()} function. It takes two parameters, a service name and a pasteboard. If the service invocation is successful, the pasteboard will contain the output data from the service. The latter method is useful for filter services (described below). A service becomes available to any NSResponder object in your application's interface. Most GNUstep classes are setup to consume services, but if you have your own @code{NSView} or @code{NSWindow} subclasses, you will need to implement extra methods so that it can make use of services. A service that isn't available to an object will not appear available in the Services menu. Providing services is a little bit different, and requires a bit more work. You can implement a service as a normal GNUstep application, or as a special command-line type using the @code{service.make} template in your GNUmakefile. Either way, you need to also provide extra information in your @file{Info-gnustep.plist} file that describes what services your application provides. @section Providing Services There are two types of services you can provide: normal services and filter services. Normal services may either send, receive or both send and receive data. They are often useful for initiating outside processes based on simple string information, such as loading up a "New Message" window in your email client with an email address that the user has highlighted in your application. Such as service wouldn't need to return any data. These services also are registered to appear in the "Services" menu of applications. For example, the user would highlight an email address in a text box, and then select "Send Email" from the services menu. GNUstep would then locate the associated service and put the email address on a pasteboard. The pasteboard is sent to the service application (and loaded if necessary), which processes it accordingly. On the other hand, a filter service is much more specific. They are designed to convert data from one type to another, and are only ever invoked programatically i.e. they don't appear in the "Services" menu. We begin making our application or command-line service ready for acting as a service by calling @code{-setServicesProvider:} on the @code{NSApplication} object, or by calling the @code{NSRegisterServicesProvider()} function. Both take an object, which will provide the service, as a parameter, and the latter also takes a @dfn{port name} as a string, which will be used to contact the application. @code{NSApplication} uses the name of your application as the port name. Secondly, the object that will provide the service needs to implement a method in the form of: @code{[methodname]:userData:error:}, where @var{methodname} is a custom, arbitrary name of the method. For example if you were to create a service that encrypts data and you want to call it something like @code{-encryptData}, the method would take the form: @smallexample - (void) encryptData:(NSPasteboard*)pBoard userData:(NSString*)userData error:(NSString**)error; @end smallexample As you can see, the first part is arbitrary, but the rest must be the same for all services. It is the first part that you will use in the @code{NSMessage} key below. Lastly, all services need a special addition to their Info-gnustep.plist file, which should be included as a @command{RESOURCE} in your @file{GNUmakefile}. See the @cite{GNUstep Makefile Manual} for more details. @subsection Normal Services As mentioned before, normal services may either send data, receive data, or both. Their Info-gnustep.plist file must have a top-level key named @code{NSServices}, which becomes an array of dictionaries. This array has one dictionary per service that is provided. Each service dictionary has the following keys: @table @var @item NSMessage This is the first part of the method name (as described above). For example, if your services provider object implements a method called @code{-randomData:userData:error:}, this key should take a string value equal to @code{"randomData"}. @item NSSendTypes This key contains an array of the types of data that your service provider can handle (the types of data that may be sent to it). These types are the string values defined earlier for pasteboard types. Simply use the same name as used in the source code, e.g. @code{NSStringPboardType}. @item NSReturnTypes This is an array of string values that contains the types your service provider can return. @item NSPortName A service must be contacted via a distributed objects port, and this string value must contain the name of the port your application will be listening on for message. Unless you are not writing an application, this is usually set to the name of the application. @item NSMenuItem This is a dictionary used to set the menu item name for this service. Each key in the dictionary is the name of a language, with the value set to a string that will be displayed as the menu item for this service in the set language. You can also provide a @var{default} key, which will be displayed if none of the translations you have provided match the user's language settings. You may also place one forward slash character ('/') in the menu item name, which will be used to split the item into a sub-menu of @command{Services} and the menu item. It is useful for grouping related services in a sub-menu. @item NSUserData This key is optional, and is set to a string value which may be whatever you like. It is passed to the method implementing the service. Use this if you want the one method to handle a number of service implementations, which are selected based on this string. @item NSKeyEquivalent This is an optional dictionary which contains the key equivalents to the menu items you have listed in @var{NSMenuItem}. Each dictionary key is the name of a language (or @var{default} as described above) with its value set to a single letter that corresponds to a keyboard key. @item NSTimeout This key is optional, and specifies how long the system should wait for the service provider to complete providing the service. It is a number in milliseconds. By default, the system waits 30 seconds. @item NSExecutable This is an optional string value that contains the path of the executable which should be launched if the service is not already running. You will not usually need this for normal applications. @end table @subsubheading Example We want to provide a service that turns ordinary string data into coded HTML text. Our service application is called "WebSiteEditor" and the method that provides the HTML translation is called @code{textToHtml:}. It accepts string data, and publishes the HTML back in string form. Our example Info-gnustep.plist array could be: @example @{ .. (application specific keys) .. NSServices = ( @{ NSPortName = WebSiteEditor; NSMessage = textToHtml; NSSendTypes = ( NSStringPboardType ); NSReturnTypes = ( NSStringPboardType ); NSMenuItem = @{ default = "Convert to HTML"; @}; NSTimeout = 25000; NSKeyEquivalent = @{ default = H; @}; NSUserData = "NoBodyTags"; @} .. (More service definitions) ); @} @end example As can be seen above, @var{NSServices} is an array containing one dictionary, which corresponds to one service. The service appears in the menu as "Convert to HTML", which expects string data. A possible code implementation may be: @example - (void) textToHTML:(NSPasteboard*)pboard userData:(NSString*)userData error:(NString**)error @{ NSString* data, *convertedData; if ([[pboard types] containsObject:NSStringPboardType]) @{ // Extract string data from pasteboard data = [pboard stringForType:NSStringPboardType]; // Convert to HTML as a string //.. // Put the result back onto the pasteboard [pboard declareTypes:[NSArrayWithObject:NSStringPboardType] owner:nil [pboard setString:convertedData forType:NSStringPboardType]; @} else *error = @"Incorrect data type provided to textToHTML: service."; @} @end example @subsection Filter Services As mentioned before, filter services are not initiated by the user, but are initiated by programme's to convert data from one type to another. They also have entries in an application's @file{Info-gnustep.plist} @var{NSServices} array. These entries are dictionaries as well, but they contain the following keys: @table @var @item NSFilter This is the equivalent of the @var{NSMessage} key used for normal services. It is the name of the distributed objects port that the filter service will listen on for messages. It again is usually set to the name of the application, but as filter services are more likely to be standalone tools, this one can differ somewhat. @item NSInputMechanism This is an optional key that specifies a string value corresponding to a different input mechanism than the usual distributed objects message passing. These values may be: @table @var @item NSIdentity The data is placed on a pasteboard. It is not changed. @item NSMapFile The data is the name of a file. The contents of this file will be placed on the pasteboard instead. @item NSUnixStdio The data is the name of a file. This file is passed as an argument to a command-line programme, which is executed. The stdout of the programme is placed on the pasteboard instead. @end table @end table @subsection Registering Services Before a service can be consumed by applications, it must be registered programatically and on the command line. An application registers the object that will be providing service(s) by calling @code{-setServicesProvider:} on their @code{NSApplication} object. Tool applications must call @code{NSRegisterServicesProvider()}, which is a function that takes the service object and the port name (as specified by @code{NSMessage} or @code{NSFilter} in the @file{Info-gnustep.plist} file). Once that is in code and your application has been installed, you also need to execute @command{make_services}, which is a script that comes with GNUstep. It locates the Info-gnustep.plist file and builds a list of services. This list of services becomes available to applications started after the script is executed. @section Using Services For the most part, AppKit objects are implemented to take advantage of most service types where appropriate, especially in regard to string data. However, there are situations where you will want to register for service consumption yourself, or where you want to allow your custom views to consume services. An @var{NSResponder} object must first register the pasteboard types it supports. Then, when a user tries to invoke a service, GNUstep first checks the responder chain for an object that can handle the service's input type, and then it queries the object for the data to be processed by the service. If data is returned from the service, GNUstep then gives the pasteboard back to the object for it's own processing. @enumerate @item Registering for service consumption Your object must at some point register it's ability to consume services of certain pasteboard types. It does this by calling @code{-registerServicesMenuSendTypes: returnTypes:} with an array of send types (the pasteboard types the object can send to a service) and return types (the pasteboard types the object can receive from a service). This method is to be only called once for your subclass. It is convenient to put it in your class' @code{+initialize} method, which is usually called after your class is loaded into the runtime (and hence only once). @item Sending data to a Service When sending data to a service, GNUstep must first check that your object can send those types of data before it requests the pasteboard from your object. So that GNUstep can check whether your object is able to export the pasteboard types requested by the service, you must implement the @code{-validRequestorForSendType:returnType:} method. It is passed a send pasteboard type and a return pasteboard type. Your implementation should return an object if it is capable of handling that combination of send and return type (and is ready to do so), or return nil if it can't. It usually returns @code{self}. If GNUstep gets a positive answer to this method, it will then call @code{-writeSelectionToPasteboard:types} on your object. You should implement this method to fill the pasteboard with data (or use lazy provision, as discussed earlier in this chapter). It should return @code{YES} if it suceeds, or @code{NO} if it fails. @item Receiving data from a service If the service being invoked returns data, GNUstep will call @code{-readSelectionFromPasteboard:} on your object when the service returns. This method should retrieve the service data from the pasteboard and use that data to update it's object's state. @end enumerate gnustep-gui-0.24.0/Documentation/manual/eventhandling.texi0000664000076500007650000002071510537306212023555 0ustar brains99brains99@c GNUstep AppKit Guide @c @c Copyright (c) 2005-2006 Christopher Armstrong. @c @c Permission is granted to copy, distribute and/or modify this document @c under the terms of the GNU Free Documentation License, Version 1.2 @c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. @c A copy of the license is included in the section entitled "GNU @c Free Documentation License". @c @c This documentation is provided on an "AS IS" BASIS, WITHOUT WARRANTY @c OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED @c TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @c PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND USEFULNESS @c OF THE DOCUMENTATION IS WITH YOU (THE LICENSEE). IN NO EVENT WILL THE COPYRIGHT @c HOLDERS BE LIABLE FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, @c SPECIAL, GENERAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF @c THE USE OR INABILITY TO USE THIS DOCUMENTATION (INCLUDING BUT NOT @c LIMITED TO LOSS OF DATA, USE, OR PROFITS; PROCUREMENT OF SUBSTITUTE @c GOODS AND SERVICES; OR BUSINESS INTERUPTION) HOWEVER CAUSED, EVEN @c IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @node eventhandling, tableview, theviewconcept, Top @chapter Event handling The way events are handled and passed between objects in GNUstep requires special treatment. It is relatively simple, but generally not well documented as to how it works, and how it is used by default in GNUstep. Before reading this chapter, you may wish to reaquaint yourself with views (@pxref{The view concept}). Event handling can be very complex, or very simple, depending on what your trying to handle and to what extent you're using customised components. We will try to cover some of the basic concepts you may come across in this manual, as well as give a better guide to working with NSResponder and NSEvent. We start with the target/action paridigm (which is used to implement outlets/actions in interface files), and then explain the AppKit's underlying event handling model, which is far more powerful and of interest if you are implementing your own views. It's also relevant to understanding how events are passed around in GNUstep (and a recommended read). @section The Responder Chain @cindex responder @cindex responder chain A @dfn{responder} is an object inheriting from @code{NSResponder}. It defines methods that are overrided by subclasses for receiving events, from simple things such as mouse clicks and keyboard presses, to more abstract events such as text selection or text modification. @code{NSView} inherits from @code{NSResponder} (and in turn @code{NSControl} inherits from @code{NSView}) so in effect, all views and controls can respond to events. Responders are linked together in a chain, whereby a top-level graphical element (usually a window) receives an event, and if it doesn't understand it, it passes it on to higher-level graphical elements, namely views. As views can be placed inside each other, a low-level superview may pass on higher-level events to it's more abstract children. The responder chain is the programmatic linkage between different objects. It is usually setup by GNUstep, but can be modified by the programmer. The object at the top of the focus stack in a window is usually the @dfn{first responder}, meaning that any events will be forwarded to it first, and then along the chain if necessary. You can retrieve the first responder in a window by calling @code{-firstResponder} against the @code{NSWindow} object.@footnote{NSWindow objects are responders as well}. More than responder chain may exist, but only one may be active at a time. It is called a chain, due to the way event messages are passed through successive calls to each consecutive object in the chain. @section Being a responder A responder inherits the @code{NSResponder} class. As @code{NSView} inherits from this, all high-level graphical elements, including all controls and views are considered to be "responders". This class contains a number of methods for maintaining the the responder chain and default methods for handling certain types of events, such as keyboard, mouse and "text" events (for text-processing classes such as NSText). The first method to override is @code{-acceptsFirstResponder}, which returns a boolean indicating whether your class will accept first responder status. You can also override @code{-becomeFirstResponder} and @code{-resignFirstResponder} to be notified of when your class gains and loses the first responder status (respectively). The next thing to do is override the different event messages that are predefined in NSResponder, such as @code{-keyDown:}, @code{-mouseDragged:}, @code{-helpRequested:}, etc. What all these have in common is that they take a single @code{NSEvent} object argument, which contains information about the event. Action messages are messages that have a predefined syntax i.e. they take one object as a parameter, but the name of the method that implements them defines the message. These are passed along the responder chain until a responder implementing that action message is found. This is aided via the @code{-tryToPerform:with:} method, which is used by GNUstep to traverse the responder chain and find an object that can perform the @var{anAction} selector with @var{anObject} as a parameter. Some of the common ones include: @itemize @item -keyDown: @item -keyUp: @item -mouseDown: @item -mouseUp: @item -mouseMoved: @item -mouseEntered: @item -mouseExited: @item -rightMouseDown: @item -rightMouseUp: @end itemize You can also pass your own custom selectors along responder chains, trying to find the first object that responds to a particular method name. Given an object and a selector, call @code{-tryToPerform:with:} on an object in the responder chain, and this method will be tried on each successive responder until one can be found that responds to the selector. If a method cannot be method, it returns @code{NO}. @section Target/Action Paridgm @cindex paridgms, Target/Action Controls use the target/action paridgm for simple events, which only have a sender and a target.@footnote{A @dfn{paridgm} is a mode of thinking, often applied to programming. You may have heard of the "object-oriented programming pardigm" or the "functional programming" paridgm.} The @dfn{target} object is the object notified of an event. It is like a @dfn{sink} in OLE/COM programming and is referred to as the @dfn{receiver}. The @dfn{action} is an event being performed, and takes the form of a selector. The @dfn{sender} is the object generating the action. An action is passed along the responder chain until it is processed or until the end of the responder chain is reached, in which case the message is returned to the sender indicating it couldn't be processed. Messages that are passed as such events are known as @dfn{action messages}, and these events are known as @code{action events}. Let us explain with a simple example. We create a button on a form as an @code{NSButton} that we want to inform our @code{AppController} object instance when it is clicked. The button object is the @dfn{sender} and the @code{AppController} object is the @dfn{target}. We tell the button object to call our target object using the selector @code{-browseForServer:}.@footnote{The name of the selector is purely arbitrary, and can be anything you like. However, it must take one parameter, which is a reference to the sender object.} This selector is the @dfn{action}. Many of these actions are predefined in the @code{NSResponder} class which is implemented by all views. On the other hand, things such as menu items define a number of custom such as @code{-save:} or @code{-print:}, which many, but not all AppKit classes respond to. You can define your own actions for things such as menu buttons. Using the above example of a target, sender (which we will call @var{myButton}) and action, we could manually setup a link between the objects as follows: @example AppController* appCont; NSButton* myButton; // Initialisation of button and target objects [myButton setAction:@@selector(browserForServer:)]; [myButton setTarget:appCont]; @end example In the above example, whenever @var{myButton} is clicked, it will call the @code{invoke:} method on the @code{MyButtonTarget} instance. What you see above is what Gorm.app does when you connect an action and a target. This paradigm is used for simple event handling in classes that derive from NSControl. See @pxref{Basic Controls} and @pxref{Interface Files} for more information as to how this fits together. gnustep-gui-0.24.0/Documentation/manual/drawing.texi0000664000076500007650000002634310534730035022366 0ustar brains99brains99@c GNUstep AppKit Guide @c @c Copyright (c) 2005-2006 Christopher Armstrong. @c @c Permission is granted to copy, distribute and/or modify this document @c under the terms of the GNU Free Documentation License, Version 1.2 @c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. @c A copy of the license is included in the section entitled "GNU @c Free Documentation License". @c @c This documentation is provided on an "AS IS" BASIS, WITHOUT WARRANTY @c OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED @c TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @c PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND USEFULNESS @c OF THE DOCUMENTATION IS WITH YOU (THE LICENSEE). IN NO EVENT WILL THE COPYRIGHT @c HOLDERS BE LIABLE FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, @c SPECIAL, GENERAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF @c THE USE OR INABILITY TO USE THIS DOCUMENTATION (INCLUDING BUT NOT @c LIMITED TO LOSS OF DATA, USE, OR PROFITS; PROCUREMENT OF SUBSTITUTE @c GOODS AND SERVICES; OR BUSINESS INTERUPTION) HOWEVER CAUSED, EVEN @c IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @node drawing @chapter Drawing in Views @anchor{Drawing in Views} Although GNUstep readily provides most of the objects you'll need for creating GUI's, you may sometimes want to create your own view's. The first thing you will need to do is subclass NSView. You may wish to consider first whether or not it is necessary to build a NSView subclass. @code{NSControl} may be more useful for your needs, especially if what you need to achieve fits within the Cell/Control concept that is modelled in those classes. If you decide that you need to subclass @code{NSView}, classes and methods exist to make drawing consistent, especially if you plan to port your code across to Cocoa. GNUstep provides two important classes for drawing: @code{NSAffineTransform} and @code{NSBezierPath}. There is also methods in @code{NSImage} and the @code{NSFont}* classes to render images and text. @section Writing drawing code @cindex drawing @cindex views, drawing in views All drawing code in GNUstep stems from calls to a @code{NSView} method called @code{-drawRect:}. It's in here that most of the drawing magic happens. GNustep sets everything up for your class to begin drawing within it's bounds before this method is called. When this method is called, it becomes your view's responsibility to redraw itself within the rectangle provided. Importantly, it sets the origin of your bounds to the bottom left corner of your view and it sets a clipping rectangle around the frame of your view, to ensure that any drawing code you call does not trash your parent view or any subviews of your parent view. @footnote{The origin for your bounds may have been shifted from the bottom-left corner of the frame rectangle by previous calls to NSView methods made by code in your programme. If you haven't done this, then the defaults apply.} This way, you are not required to calculate your position within the window. Instead, you can assume that your origin is at (0,0) in the bottom-left corner, and one point is approximately 1/72 of an inch, corresponding to a pixel. @section NSAffineTransform @anchor{NSAffineTransform} @cindex matrices, affine transform @code{NSAffineTransform} is used to perform coordinate transformations so that you can transparently resize and shift the elements in views. It is used quite extensively in the internal implementation of the GUI library and the backends, so it's worth taking advantage of. For more information about affine transformations, @pxref{Affine Transformations}. To stretch the coordinate system, use @code{-scaleBy:} method with a scaling factor, or @code{scaleXBy:yBy:} to scale each axis differently. The coordinate system can be rotated counter-clockwise by using the @code{rotateByDegrees:} or the @code{rotateByRadians} methods. It can be shifted using the @code{translateXBy:yBy:} method. A number of methods are provided for transforming rectangles, sizes and points with the affine transform. Take a look at the @code{sizeInMatrixSpace:}, @code{rectInMatrixSpace} and @code{transformPoint} methods. Note that GNUstep provides more convenience methods than Cocoa does. @cindex affine transform, postscript matrices @cindex matrices, postscript matrices For those familiar with Postscript matrices, NSAffineTransforms' can be set and instantiated using those. Check out the @code{NSAffineTransformStruct} for transporting the matrix elements, and @code{-setTransformStruct:} in @code{NSAffineTransform}. @section NSBezierPath @cindex bezier paths, definition This class is an abstract representation of a @dfn{bezier path}. A bezier path contains a series of straight and curved lines, with information on how the shapes constructed by these lines should be drawn, e.g. whether they should be filled, what kind of pen width to use, pen dash information, the current point, etc. A bezier path also consists of a number of @dfn{sub-paths}. After a series of move, line and curve operations, a @dfn{close path} operation is inserted to into the bezier path to indicate the end of a sub path. This concept is important with the filling commands. A number of convenience class methods exist for simple drawing operations, setting defaults and getting information about the current state of the drawing view, aka the @dfn{graphics state}.@footnote{A graphics state is a concept inherited from GNUstep's Display Postscript heritage. In Postscript a graphics state object, or @dfn{gstate}, would contain all the information about the current colours, the current affine transform, the width to draw lines with, any fill patterns, and other such information. They could be saved onto a stack and recalled later by name. GNUstep provides a more cut down and logical implementation of similiar concepts across the NSBezierPath class and others.} We can call @code{+strokeRect:} or @code{+fillRect:} directly to add a new rectangle or filled rectangle to the current drawing view. The @code{-clipRect:} method can be used to set a smaller clipping rectangle, intersecting with the current clipping rectangle (which is set by default to be the frame of your view, just before a call to @code{-drawRect:} is made. @subsection Graphics Operations and the Current Point A bezier path represents a series of graphical primitives operations. You call methods corresponding to these operations on the @code{NSBezierPath} object, and when it is drawn, these operations are executed in the order that you call them on the bezier path. @cindex bezier paths, current point It also has a concept of a @dfn{current point}. After every graphics operation, a new, internal point is set that will be used as the start point for the next operation. This is usually the destinatio point of the previous operation. For example, if you want a bezier path to move to the point origin, then draw a line from the origin to point (10,20), then a line from (10,20) to (20,20) you only require three operations, i.e. (in psuedocode): @smallexample move to (0,0) draw a line to (10,20) draw a line to (20,20) @end smallexample In this case, the bezier path first sets the current point to (0,0). Then, when the line operation is called, you only pass in the destination point, (10,20), which causes it to draw a line from (0,0) to (10,20). After this operation, the current point is set to the destination of the line operation, i.e. (10,20). Then, the next line operation draws a line from (10,20) to (20,20). In this way, we only need specify the destination point for line and move operations, as the start point is determined by the destination point of the previous operation. There is no need to specify the start point for each drawing operation, as this is implied by the destination point of the previous. You can get the current point by calling the @code{currentPoint:} method. These operations are listed in the table below: @cindex bezier paths, operations @table @dfn @item Move Operation A move operation lifts the pen up and puts it at a new location, i.e. changes the current coordinates without drawing. It implicitly starts a new internal path. This can be achieved throught the @code{-moveToPoint:} method, which takes a point as it's first parameter. @item Line Operation A line operation draws a line from the current point to a new point. The @dfn{current point} is set either through a move operation, or through the last point in a previous line or curve operation. Once the line operation is complete, the @dfn{current point} is set as the destination point. We can draw a line using the @code{lineToPoint:} method. @item Curve Operation This one is more complex, as it involves the real magic of bezier paths. It consists of four points: the start point, the destination point, and two @dfn{control points}. How this works is beyond the scope of this manual@footnote{@cite{Wikipedia} has good information on the mathematics and theory behind bezier curves/paths} and is not required to draw simple circles, ellipses and arcs. We can draw a circle or an ellipse by calling @code{appendBezierPathWithOvalInRect:}, passing in a rectangle for the shape to be drawn in. A few methods are provided for adding arcs, with @code{appendBezierPathWithArcFromPoint: toPoint: radius:} useful for adding an arc between two points and the @code{appendBezierPathWithArcWithCenter: radius: startAngle: endAngle:} method useful for drawing an arc with a particular centre point. For those familiar with bezier curves or who know their control points, the @code{curveToPoint:controlPoint1:controlPoint2:} method can be used to draw curves that way. All curve operations set the current point to the destination of the curve. @item Close Path Operation As bezier paths actually consist of many sub-paths, one can close the current set of path operations with the @code{closePath} method to avoid creating a new NSBezierPath method. @end table @subsection Stroking, Filling and Clipping @cindex bezier paths, rendering operations @cindex bezier paths, stroking/filling/clipping Once you've assembled a path, you can render it in a number of ways. It can be drawn (stroked), filled, or turned into a clipping region. A simple stroke operation is induced by calling the @code{stroke} operation. Filling operations are induced by calling the @code{fill} method. Two winding rules for filling are provided: the @dfn{even-odd} and @dfn{non-zero} winding rules. FIXME: explain the difference between the even-odd and non-zero winding fill rules. @cindex clipping, bezier paths for clipping The clip operation (clipping) is a bit different. It takes the bezier path and uses the outline defined by it to set the current @dfn{clipping region}. The @dfn{clipping region} is an area or areas (or series of "regions") that restrict the output of all drawing operations to the region of the device space defined by it's boundaries. A current clipping region is defined for the period of time that you perform drawing operations in your @code{drawRect:} method. The default clipping region is set to the bounds of your view. We can intersect the current clipping region with the bounds of the path with the @code{-addClip} method or we can set the current clipping region with the @code{-setClip} method. It is also affected by the winding rule in the same way as fill operations. gnustep-gui-0.24.0/Documentation/manual/applicationmakefiles.texi0000664000076500007650000001466410537306212025121 0ustar brains99brains99@c GNUstep AppKit Guide @c @c Copyright (c) 2005-2006 Christopher Armstrong. @c @c Permission is granted to copy, distribute and/or modify this document @c under the terms of the GNU Free Documentation License, Version 1.2 @c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. @c A copy of the license is included in the section entitled "GNU @c Free Documentation License". @c @c This documentation is provided on an "AS IS" BASIS, WITHOUT WARRANTY @c OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED @c TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @c PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND USEFULNESS @c OF THE DOCUMENTATION IS WITH YOU (THE LICENSEE). IN NO EVENT WILL THE COPYRIGHT @c HOLDERS BE LIABLE FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, @c SPECIAL, GENERAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF @c THE USE OR INABILITY TO USE THIS DOCUMENTATION (INCLUDING BUT NOT @c LIMITED TO LOSS OF DATA, USE, OR PROFITS; PROCUREMENT OF SUBSTITUTE @c GOODS AND SERVICES; OR BUSINESS INTERUPTION) HOWEVER CAUSED, EVEN @c IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @node applicationmakefiles, interfacefiles, gnustepapplications, Top @chapter Application Makefiles @anchor{Application Makefiles} @cindex makefiles Application makefiles are very similiar to those used to build Tools and Objective-C programmes, but allow extra specifications to build application wrappers and include their resource files. We assume you are already familiar with the GNUstep Makefile system. Below is a generic, but complete application makefile, followed by an explanation of the various parameters. @example include $(GNUSTEP_MAKEFILES)/common.make APP_NAME = ExampleApplication PACKAGE_NAME = ExampleApplication VERSION = 1.0 ExampleApplication_OBJC_FILES = main.m AppController.m \ ExampleClass.m ExampleApplication_C_FILES = regexp.c fun.c ExampleApplication_OBJC_LIBS = -lLibNumberOne -lPDFKit -lFunKit ExampleApplication_RESOURCE_FILES = \ ExampleApplication.gorm \ Info-gnustep.plist -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/application.make -include GNUmakefile.postamble @end example @file{common.make} and @file{application.make} are necessary to build an application, and need to be at the beginning and end respectively to the Makefile to operate properly. The @file{GNUmakefile.preamble} and @file{GNUmakefile.postamble} are optional, and permit you to define extra rules for building your application. You can include those lines without those files containing anything. Templates for those files also exist with the source code for gnustep-gui, which can simply be copied into your project and modified accordingly. The table below describes the makefile variables that you can set to control the output of the make process. Note that @var{appname} refers to the application name that you set with @code{APP_NAME}. It is case sensistive and so are file names. Also, most of the variables listed below are optional if you wish to get a program to compile, but it is recommend you make use of them where appropriate. Where variables ask for flags and compiler options, they should be in the format that @command{gcc} expects, as it is the only compiler currently used with GNUstep. Many variables also take more than one parameter. They are usually separated by a space, and line breaks with a backslash. Please refer to the @cite{GNUstep Makefile Manual} for more details. @cindex makefiles, components @table @code @item APP_NAME [Required] This is the name of your application, and will be used to generate the name of your application wrapper. @item PACKAGE_NAME This is used to generate a rpm or deb package for distribution of your application. See the @cite{GNUstep Makefile Manual} for more details. @item VERSION A version number for your application. @item @var{appname}_OBJC_FILES [Required] Replacing @var{appname} with the name of your application, you list the Objective-C files (.m), separated by a space. As shown above, you can split it across one or more lines by placing a slash at the end of the line to indicate a split. @item @var{appname}_APPLICATION_ICON [Optional] You can place the name of the image file that will be used as your application icon here. @item @var{appname}_MAIN_MODEL_FILE [Recommended] Put the name of your interface file (@file{.gorm}) here. It will then be placed in the property list of your application. @item @var{appname}_PRINCIPAL_CLASS [Optional] If you subclass @code{NSApplication} with your own application class, you should place it's name here. By default, GNUstep uses @code{NSApplication} as the application class. @item @var{appname}_C_FILES [Optional] This is where you list the C source code files (.c) to be compiled into your programme. It takes the same form as @code{@var{appname}_OBJC_FILES}. @item @var{appname}_CC_FILES [Optional] This is where you list your C++ files (*.cpp, *.cc) to be compiled into your programme. It takes the same form as @code{@var{appname}_OBJC_FILES}. @item @var{appname}_OBJCC_FILES [Optional] This is where you list your Objective-C++ files (*.mm) to be compiled into your programme. It takes the same form as the @code{@var{appname}_OBJC_FILES}.@footnote{You will need gcc 4.1 or higher to compile Objective-C++ programmes. This feature of the gcc compiler is quite new and has not been well tested.} @item @var{appname}_RESOURCE_FILES [Recommended] Here you list the @dfn{resource files} that are to be included with your application, including your application property list, interface file(s) and other images, data, etc. You can also list directories here, which should be added recursively (e.g. @file{.gorm} files are actually a directory containing three files, used to describe your interface). @item @var{appname}_RESOURCE_DIRS [Optional] Here you can list directories that will be copied into your application wrapper as resources. @item @var{appname}_OBJC_LIBS Here you list the names of the libraries you need your application to link against. Each one is prefixed by '-l' e.g. @code{-lMyLib}, separated by a space. You do not need to list the gnustep-gui, gnustep-base and Objective-C runtime, as these are included for you. @item @var{appname}_C_FLAGS @itemx @var{appname}_CC_FLAGS @itemx @var{appname}_OBJC_FLAGS @itemx @var{appname}_OBJCC_FLAGS Here you specify the flags to be passed to the compiler when processing this file type. These included warning flags and macro overrides. @end table gnustep-gui-0.24.0/Documentation/manual/tableviews.texi0000664000076500007650000001567010537306212023100 0ustar brains99brains99@c GNUstep AppKit Guide @c @c Copyright (c) 2005-2006 Christopher Armstrong. @c @c Permission is granted to copy, distribute and/or modify this document @c under the terms of the GNU Free Documentation License, Version 1.2 @c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. @c A copy of the license is included in the section entitled "GNU @c Free Documentation License". @c @c This documentation is provided on an "AS IS" BASIS, WITHOUT WARRANTY @c OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED @c TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @c PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND USEFULNESS @c OF THE DOCUMENTATION IS WITH YOU (THE LICENSEE). IN NO EVENT WILL THE COPYRIGHT @c HOLDERS BE LIABLE FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, @c SPECIAL, GENERAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF @c THE USE OR INABILITY TO USE THIS DOCUMENTATION (INCLUDING BUT NOT @c LIMITED TO LOSS OF DATA, USE, OR PROFITS; PROCUREMENT OF SUBSTITUTE @c GOODS AND SERVICES; OR BUSINESS INTERUPTION) HOWEVER CAUSED, EVEN @c IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @node tableview, outlineviews, eventhandling, Top @chapter Tableviews @anchor{Tableviews} @cindex tableview, definition @cindex controls, tableviews A tableview is a grid of rows and columns for the display of data. In the AppKit, you use the @code{NSTableView} class to put a tableview in your application. Gorm already has a palette set up for a tableview, that you can simply drag and drop onto your application window (refer to the sections on Gorm and the Gorm manual). More involved, however, is getting data into your tableview and responding to certain tableview specific events. Both of these are implemented using objects that respond to certain protocols, as described below. @section Columns @cindex tableview, columns Instead of taking an array oriented model of a table, the @code{NSTableView} class uses a column-oriented model, where columns are used as objects of separate classes, @code{NSTableColumn}. These can be instantiated with the @code{-initWithIdentifier:} method, where the identifier is an internal object, not displayed, used by the data source (see below) to identify what column data should be placed in. You can retrieve the table column's identifier from the @code{-identifier} method. This column-oriented model for displaying data makes tableviews useful for information originating from a database, where columns are akin to fields, and each row represents a record in a table or query. FIXME: How do you initialize a table's column's and it's identifiers when a nib is loaded. Do you use one of it's delegates methods to set all this stuff up? @section Supplying Data @cindex tableview, data source When you first create your tableview, Gorm puts some example data into it for you. However, you will want to put in your own data. GNUstep uses a @dfn{data source} model, which means that you need to supply an object that will provide data for your table view. Firstly, you will need to connect the @code{dataSource} outlet of a tableview in Gorm to an instantiated object of a class. Create a class that will have it's objects provide data for your tableview(s), and instantiate it so that it appears as a @dfn{top level object} in the Objects pane. @cindex protocols, NSTableDataSource Your object will need to implement an informal protocol to supply data to the tableview, namely the @code{NSTableDataSource} protocol (for more information on informal protocols, see the @cite{GNUstep Base Programming Manual}). Most of the methods in this protocol are optional. The compulsory methods, however, are called quite often, so you should optimise them so that they run as fast as possible. The @code{-numberOfRowsInTableView:} method is called to determine how many rows are to be shown in your table view. This could change from time to time, and as the data in your table view changes, you will need to inform the @code{NSTableView} object that data has changed (usually via the @code{-update} method). When it performs it's update, it will use this method to determine how many rows to draw. This method is compulsory to implement, and your will experience errors if you don't implement it. Another compulsory method is the @code{-tableView:objectValueForTableColumn:row:}. This is used to get the data that the table view will put in it's cells. It will pass you the table column that the cell appears in, the cell's row, and the associated tableview. The method returns an object to be displayed in the relevant cell; this object is usually a string. Note that if the data to be displayed in a tableview changes, it has no way of knowing if and when it has changed. For this reason, you need to call @code{-update} manually on the tableview to force it to redisplay. Only then will it again invoke the methods above on your data source. If you want your tableview to be editable, you will need to implement the @code{-tableView:setObjectValue: forTableColumn:row:} method. You use this to update your internal representation of what is displayed in the table view to the user. Both these methods supply a reference to a tableview as well, so the same object (or objects of the same class) can be used as a data source for more than one tableview (e.g. across many documents, or for many tables in a database). You can setup your tableview to accept drop operations. It must implement @code{-tableView:writeRows:toPasteboard:}. This method is called first, and is asking you to write the data in the specified rows to the specified pasteboard. This method should return @var{YES} to authorise the drop, or @var{NO} to reject it. More methods that can be implemented to provide information to the tableview during a drop operation include @code{-tableView:acceptDrop:row:dropOperation:} and @code{-tableView:validateDrop: proposedRow:proposedDropOperation:} methods. These are used to validate and accept drop operations, where the latter is called to validate a potential drop operation, the former just before a validated drop operation is about to take place. If the data in your data source changes for any reason, e.g. the action of a user, you must notify the tableview. You could do this by calling @code{-reloadData} on the tableview object, which you can reference by an outlet on your application's controller class (or otherwise). @section Delegates @cindex tableview, delegates @cindex protocols, NSTableViewDelegate Tableviews support a delegate for catching certain events in the lifetime of an @code{NSTableView} object. You will need to implement the informal @code{NSTableViewDelegate} protocol. This is different from the data source - you implement a delegate if you wish to catch tableview specific events created by the user. @section Notifications A tableview many post notifications to indicate changes to it (that otherwise are not sent to the delegate) such as user selection changes or the reordering of columns or rows. gnustep-gui-0.24.0/Documentation/manual/outlineviews.texi0000664000076500007650000000722210537306212023462 0ustar brains99brains99@c GNUstep AppKit Guide @c @c Copyright (c) 2005-2006 Christopher Armstrong. @c @c Permission is granted to copy, distribute and/or modify this document @c under the terms of the GNU Free Documentation License, Version 1.2 @c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. @c A copy of the license is included in the section entitled "GNU @c Free Documentation License". @c @c This documentation is provided on an "AS IS" BASIS, WITHOUT WARRANTY @c OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED @c TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @c PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND USEFULNESS @c OF THE DOCUMENTATION IS WITH YOU (THE LICENSEE). IN NO EVENT WILL THE COPYRIGHT @c HOLDERS BE LIABLE FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, @c SPECIAL, GENERAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF @c THE USE OR INABILITY TO USE THIS DOCUMENTATION (INCLUDING BUT NOT @c LIMITED TO LOSS OF DATA, USE, OR PROFITS; PROCUREMENT OF SUBSTITUTE @c GOODS AND SERVICES; OR BUSINESS INTERUPTION) HOWEVER CAUSED, EVEN @c IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @node outlineviews, matrix, tableview, Top @chapter Outline Views An @dfn{outline view} is a specialised form of table view designed for displaying hierachical data in a tree like format. It looks alot like a Windows' TreeView Control, but operates differently, provides much more powerful functionality and it is less tedious to programme. The node's in the outline view can be collapsed and expanded and display a list of sub-nodes. This makes the outline view hierachical. It uses the @code{NSOutlineView} class, which inherits from @code{NSTableView}. This means that most of the behaviour that applies to tableviews also applies to outline views, such as changing columns/rows and their display, etc. It extends the tableview with a hierachial layout for data, in which nodes can be expanded and contracted. Like the table view, the outline view control uses a data source object to get it's data, as well as a delegate to modify it's behaviour. These are objects implementing the informal protocols @code{NSOutlineViewDataSource} and @code{NSOutlineViewDelegate}. Although a delegate object is optional, outline views require a data source object. See the @cite{GNUstep GUI Reference} for more information about outline views (including class documentation). @section Using a Data Source The data source for an outline view implements the @code{NSOutlineViewDataSource} informal protocol. Some of it's methods are compulsory; some are not. Note that a parameter in many of the delegate's methods is an untyped object @var{item}. This object is supplied by you, and the outline view passes it back to your delegate as a representation of a node or leaf row. The outline view requires you implement the following methods: @table @code @item -(id) outlineView:(NSOutlineView*)outlineView child:(int)index ofItem:(id)item Returns the item that is the child of @var{item} at @var{index}. A @code{nil} item means that you should return the children of the root item. @item -(BOOL) outlineView:(NSOutlineView*)outlineView isItemExpandable:(id)item Returns whether @var{item} is expandable. @item -(int) outlineView:(NSOutlineView*)outlineView numberOfChildrenOfItem:(id)item Returns the number of child items of @var{item}. @item -(id) outlineView:(NSOutlineView*)outlineView objectValueForTableColumn: (NSTableColumn*)tableColumn byItem:(id)item Returns the data object for @var{item} in @var{tableColumn} of the table view. @end table Full defintions of these (and optional methods) can be found in the @cite{GNUstep GUI Manual}. gnustep-gui-0.24.0/Documentation/manual/GNUmakefile0000664000076500007650000000111711122715377022110 0ustar brains99brains99PACKAGE_NAME = gnustep-gui include $(GNUSTEP_MAKEFILES)/common.make DOCUMENT_NAME = AppKit AppKit_TEXI_FILES = \ AppKit.texi \ applicationmakefiles.texi \ applicationpropertylist.texi \ browsers.texi \ controls.texi \ dataexchange.texi \ drawing.texi \ eventhandling.texi \ fdl.texi \ gnustepapplication.texi \ interfacefiles.texi \ intro.texi \ matrix.texi \ quickreference.texi \ tableviews.texi \ theviewconcept.texi AppKit_DOC_INSTALL_DIR = Developer/Gui/ProgrammingManual include $(GNUSTEP_MAKEFILES)/documentation.make gnustep-gui-0.24.0/Documentation/manual/THANKS0000664000076500007650000000014310534730035020741 0ustar brains99brains99Damien Pollet * Spelling and grammatical fixups in gnustepapplications.texi and basicconcepts.texi gnustep-gui-0.24.0/Documentation/manual/matrix.texi0000664000076500007650000001333310537306212022231 0ustar brains99brains99@c GNUstep AppKit Guide @c @c Copyright (c) 2005-2006 Christopher Armstrong. @c @c Permission is granted to copy, distribute and/or modify this document @c under the terms of the GNU Free Documentation License, Version 1.2 @c with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. @c A copy of the license is included in the section entitled "GNU @c Free Documentation License". @c @c This documentation is provided on an "AS IS" BASIS, WITHOUT WARRANTY @c OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED @c TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @c PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND USEFULNESS @c OF THE DOCUMENTATION IS WITH YOU (THE LICENSEE). IN NO EVENT WILL THE COPYRIGHT @c HOLDERS BE LIABLE FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, @c SPECIAL, GENERAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF @c THE USE OR INABILITY TO USE THIS DOCUMENTATION (INCLUDING BUT NOT @c LIMITED TO LOSS OF DATA, USE, OR PROFITS; PROCUREMENT OF SUBSTITUTE @c GOODS AND SERVICES; OR BUSINESS INTERUPTION) HOWEVER CAUSED, EVEN @c IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @node matrix, browsercontrols, outlineviews, Top @chapter Matrix Controls @anchor{Matrix Controls} @cindex matrices, matrix control @cindex matrix controls, definition Matrix controls are groups of cells, arranged in a table like format, with each cell indexed by row and column. It is similar to a table view, but differs in that it doesn't have a predefined cell class. Instead, it uses objects of classes derived from NSCell to be implemented. A matrix is implemented by the NSMatrix class.@footnote{Matrices, as referred to here, are not to be confused with affine transforms, the latter of which is commonly referred to as a matrix, due to it's internal implementation of a mathematical matrix.} It takes it's implementation from NSControl, and hence what applies to controls also applies to matrixes. This matrix control is used to implement browsers as well. Note that it does not use a delegate or a data source to display or obtain it's data or size. Instead, this is done using accessor methods, making the NSMatrix class more passive in it's representation of data. @section Creating Matrix Controls A matrix control can be creating by new @code{NSMatrix} instance and then calling @code{-initWithFrame:mode:prototype:numberOfRows:numberOfColumns:} or @code{-initWithFrame:mode:cellClass:numberOfRows:numberOfColumns:}. The former method uses an instance of a cell to instantiate cells for the rows and columns, while the latter uses a cell class to create the cells. Both these methods require a matrix mode, those of which are specified in @code{NSMatrixMode} and control how the matrix "tracks" the mouse: @table @code @item NSRadioModeMatrix Only permits one cell in the matrix to be selected at a time. @item NSHighlightModeMatrix Performs trackng (as described below) as well as highlighting the cell before tracking commences. @item NSListModeMatrix Cells objects are highlighted without the opportunity to track the mouse. @item NSTrackModeMatrix The cell is able to track the mouse while the cursor is within it's bounds. @end table For more information about cell tracking, @xref{Basic Controls}. @section Using Matrix controls After having placed one on a window using Gorm, we can change what appears in the matrix by using it's methods. @cindex cell class, matrix controls @cindex matrix controls, cell class The @dfn{cell class} is what class is to be used (by default) to create cells. We can use instances of many different cells classes, for example, you may choose to populate your matrix with @code{NSTextCell} instances as well as @code{NSButtonCell} instances if you were creating an interactive form. You set the default cell class by calling either @code{+setCellClass:} on the @code{NSMatrix} class to set the cell class over all new @code{NSMatrix} instances, or you can call @code{-setCellClass:} to set the class used to create new cells on a instance-by-instance basis for each of your matrix instances. We can retrieve information about the cells in a matrix through a variety of methods. To retrieve the cell at a certain location, use the @code{-cellAtRow:column:} method. The size of cells is retrieved using the @code{-cellSize} method. To access specific cells, use @code{-cellAtRow:column:}, or to access all the cells, simple call @code{-cells} to get an array. We can begin adding rows or columns to the end our matrix using the @code{-addColumn} and @code{-addRow} methods. To specify the specific cells, use the @code{-addColumnWithCells:} and @code{-addRowWithCells:} methods, passing an array of the cells for that column/row. Alternatively, rows and columns can be inserted at arbitrary locations using the @code{-insertRow:} and @code{-insertColumn:} methods, specifying a row or column number. @code{-insertRow:withCells:} and @code{-insertColumn:withCells:} lets you pass in the cells to be inserted. Rows and columns can also be removed or replaced. You can remove a column or a row by number using the @code{-removeColumn:} or @code{-removeRow:} methods respectively. To replace a particular cell, use the @code{-putCell:atRow:column:} method. The cell selection and selection behaviour can be modified. A specific cell can be selected with the @code{-selectCellAtRow:column:} by specifying it's location, @code{-selectCellWithTag:} by specifying it's tag, or @code{-selectCell:} with the cell object. You can also select all the cells with the @code{-selectAll:} method. The selected cell is returned from @code{-selectedCell:}, or @code{-selectedCells} if more than one cell is selected. @code{-selectedRow} and @code{-selectedColumn} can be used if an entire row/column is selected. gnustep-gui-0.24.0/Documentation/manual/TODO0000664000076500007650000000260110534730035020517 0ustar brains99brains99Sections -------- / "OutlineViews" section to be started | "Images and ImageViews" to be completed * Reorganise/combine information about views and drawing in views * "Text" classes information * Finish information on data exchange / Quick reference to be filled out more with information for a greater variety of classes * Information about save panels/open panels/font panels etc * Information on rendering fonts and images (in Drawing in Views section). * Documentation for little things such a mouse tracking in cells and little clases that have small amounts of functionality but are easily skipped. * List notifications provided by major classes. Examples -------- * Develop an example that can be used throughout the manual to demonstrate concepts. Finishing/Polishing ------------------- * When manual completed, reorganise sections into a better order * Spend time proofreading and correcting grammatical and spelling errors. * Remove Changelog from manual * Screenshots * Simple examples to demonstrate the use of some classes (particularly complex ones like tableviews and outlineviews and matrices or complex operations like drag and drop). * Replicate class/protocol descriptions in quick reference or elsewhere (maybe turn the quick reference into a page guide for various class descriptions or protocol/notifications layouts.) X - Finished / - Started | - In Progress \ - Almost complete gnustep-gui-0.24.0/Documentation/manual/manual.texi0000664000076500007650000000456710377004044022213 0ustar brains99brains99\input texinfo @c -*-texinfo-*- @c %**start of header @setfilename manual.info @settitle GNUstep GUI, Programming Manual @c %**end of header @ifinfo @format START-INFO-DIR-ENTRY * GNUstepBase: GNUstep GUI Library (OpenStep AppKit) END-INFO-DIR-ENTRY @end format @end ifinfo @ifinfo Copyright @copyright{} 2001 Free Software Foundation Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided also that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions. @end ifinfo @setchapternewpage odd @titlepage @title GNUstep GUI Library (OpenStep AppKit) @title Programming Manual @author Adam Fedor (fedor@@gnu.org) @author Nicola Pero (n.pero@@mi.flashnet.it) @page @vskip 0pt plus 1filll Copyright @copyright{} 2001 Free Software Foundation Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided also that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions. @end titlepage @contents @ignore : No foreword written yet @ifnothtml @iftex @c Foreword @include foreword.texi @end iftex @end ifnothtml @end ignore @ifinfo @c **Top node and master menu @node Top @top Objective-C Programming Manual @ignore : No foreword written yet @include foreword.texi @end ignore @menu * Introduction:: An introduction to the GNUstep GUI library * Basic Classes:: Basic Classes in the Library @end menu @c **end Top node and master menu @end ifinfo @page @c Chapter 1, Introduction @include Introduction.texi @c Chapter 1, Basic Classes @include BasicClasses.texi @unnumbered Concept Index @printindex cp @bye gnustep-gui-0.24.0/Documentation/readme.texi0000664000076500007650000000357711372062630020717 0ustar brains99brains99@c -*-texinfo-*- @chapter README @ifset TEXT-ONLY @include version.texi @end ifset The GNUstep gui library is a library of graphical user interface classes written completely in the Objective-C language; the classes are based upon Apple's Cocoa framwork (which came from the OpenStep specification). These classes include graphical objects such as buttons, text fields, popup lists, browser lists, and windows; there are also many associated classes for handling events, colors, fonts, pasteboards and images. @section Initial reading @itemize @bullet @item The file @file{ANNOUNCE} contains a very brief overview of the library. It also tells you where to get the most recent version. @item The file @file{NEWS} has the library's feature history. @item The file @file{INSTALL} gives instructions for installing the library. @end itemize @section License The GNUstep libraries and library resources are covered under the GNU Lesser Public License. This means you can use these libraries in any program (even non-free programs). If you distribute the libraries along with your program, you must make the improvements you have made to the libraries freely available. You should read the COPYING.LIB file for more information. All files in this package EXCEPT files in the @file{Tools} directories and subdirectories under this are covered under the GLPL. GNUstep tools, test programs, and other files are covered under the GNU General Public License. This means if you make changes to these programs, you cannot charge a fee, other than distribution fees, for others to use the program. You should read the COPYING file for more information. All files in the @file{Tools} directory are covered under the GPL. @section How can you help? @itemize @bullet @item Give us feedback! Tell us what you like; tell us what you think could be better. Send bug reports to @email{bug-gnustep@@gnu.org}. @end itemize gnustep-gui-0.24.0/Documentation/gclose.10000664000076500007650000000131310727033424020111 0ustar brains99brains99.\"gclose(1) man page .\"put together by Dennis Leeuw .\"Copyright (C) 2003 Free Software Foundation, Inc. .\" .\"Process this file with .\"groff -man -Tascii gclose.1 .\" .TH GCLOSE 1 "December 2007" GNUstep "GNUstep System Manual" .SH NAME gclose \- This tool terminates an application .SH SYNOPSIS .B gclose .P .SH DESCRIPTION .B gclose terminates an application from the command line .SH OPTIONS .SH BUGS None known .P .SH SEE ALSO gcloseall(1), gopen(1), GNUstep(7) .P .SH HISTORY Work on .B gclose started in November 2001. .P .SH AUTHORS gclose was written by Gregory Casamento .P This man page was written by Dennis Leeuw . gnustep-gui-0.24.0/Documentation/gopen.10000664000076500007650000000505010732177217017754 0ustar brains99brains99.\"gopen(1) man page .\"put together by Martin Brecher .\"Copyright (C) 2005 Free Software Foundation, Inc. .\" .\"Process this file with .\"groff -man -Tascii gopen.1 .\" .TH GOPEN 1 "August 2003" GNUstep "GNUstep System Manual" .SH NAME gopen \- open files .SH SYNOPSIS .B gopen .RB [ -a .IR application ] .RB [ -o ] .RB [ -p ] .RB [ -NXHost .IR hostname ] .RI [ filename ] .P .SH DESCRIPTION The .B gopen command allows you open a file (or directory) as if you had double clicked the object's icon. .PP It is possible to specify one or more .I filenames which are interpreted relative to the current working directory. .PP By default, .B gopen will open .I filename with the application currently assigned to the file's extension. But by specifing the .B -a flag on the command line you can tell .B gopen to open the file with another application. .PP You can also directly print a file without ( .B -p ) or with ( .B -p -o ) opening it. .PP As with most other GNUstep software, it is easily possible to attach the process to a remote window server using the .B -NXHost flag. .PP .SH OPTIONS .IP "\fB-a \fIapplication" use .I application to open .I filename .IP "\fB-o" open .I filename (may be used in conjunction with .B -p ). .IP "\fB-p" print .I filename instead of opening. .IP "\fB-NXHost \fIhostname" attach to remote window server on .I hostname .PP .SH EXAMPLES Open all files with a .txt extension in the current directory: .PP .I gopen *.txt .PP To open a source file in CodeEditor (instead of the current default application), type: .PP .I gopen -a CodeEditor MySourceFile.m .PP To print the .plan file in your home folder, use the .B -p flag: .PP .I gopen -p ~/.plan .PP .SH BUGS Using the .B -a .I application argument, .B gopen allows you to open any kind of file with any application you want. This does, however, not work with applications employing the NSDocument architecture as they will only receive filenames whose types the application has registered. To circumvent this limitation, applications may advertise their ability to open all kinds of files through the "*" filetype. When .B gopen is used with only the .B -a .I application argument but no .I filename present, the application is simply launched without opening a specific file. .P .SH SEE ALSO GNUstep(7), openapp(1) .P .SH HISTORY .B gopen was written November 2001. .P This manual page was first written July 2003. .P .SH AUTHORS .B gopen was written by Gregory Casamento . .P This man page was written by Martin Brecher . gnustep-gui-0.24.0/Documentation/make_services.10000664000076500007650000000453710377004044021465 0ustar brains99brains99.\"make_services(1) man page .\"put together by Martin Brecher .\"Copyright (C) 2003 Free Software Foundation, Inc. .\" .\"Process this file with .\"groff -man -Tascii make_services.1 .\" .TH MAKE_SERVICES 1 "October 2003" GNUstep "GNUstep System Manual" .SH NAME make_services \- generate GNUstep services info .SH SYNOPSIS .B make_services .RB [ --test .IR filename .RB ] .RB [ "--verbose\fP" | "--quiet\fP" ] .P .SH DESCRIPTION .B make_services builds a validated cache of service information for use by programs that want to access the GNUstep services facility. Additionally, it builds a list of applications and service bundles found in the standard directories. This cache is usually stored in the file named .I .GNUstepServices in the user's GNUstep directory. .P Most commonly, .I make_services is called from within the GNUstep.sh or GNUstep.csh script to update the service information everytime the GNUstep environmet is set up, i.e. in a login script. But of course it is possible to run .I make_services from the command line whenever you wish, for example after having installed a new application or service. .PP The .I Services menu in an application's mainmenu is usually updated automatically. However, it may be neccessary to close an open or torn off menu for the changes to appear. Also, the workspace manager may have to be closed and restarted for file association changes to take effect. .P .SH OPTIONS .IP "\fB--test \fIfilename" check that property list .I filename contains a valid service information. .IP "\fB--quiet" suppress warnings (not recommended but useful in login scripts). .IP "\fB--verbose" give verbose output. .IP "\fB--help" show small help screen. .PP .SH EXAMPLES Simply rebuild the cache of service information: .PP .I make_services .PP Check whether the file ServiceInfo.plist contains a valid service description: .PP .I make_services --test ServiceInfo.plist .P .SH NOTES Giving both .I --quiet and .I --verbose on the command line will result in verbose output, ignoring the .I --quiet argument. .P .SH SEE ALSO GNUstep(7), gopen(1) .P .SH HISTORY Work on .B make_services started November 1998. .P This manual page was first written October 2003. .P .SH AUTHORS make_services was written by Richard Frith-Macdonald . .P This man page was written by Martin Brecher . gnustep-gui-0.24.0/Documentation/General/0000775000076500007650000000000012256227325020136 5ustar brains99brains99gnustep-gui-0.24.0/Documentation/General/OpenStepCompliance.gsdoc0000664000076500007650000001067710512464124024713 0ustar brains99brains99 OpenStep Compliance 2005 Free Software Foundation, Inc. Classes

This file documents the compliance of all the classes in the GNUstep Gui library. Note that the following is just a best guess as to the compliance of the classes. Each class was checked to make sure it implemented all the documented OpenStep methods and functions. In addition, extensive testing has been performed on the GNUstep Gui Library, and it is believed, to the best of our knowledge, that it operates according to the OpenStep specification, with the caveat that there are always bugs in any implementation and there are most likely bugs in the current implementation that we are not aware of.

The following classes conform to the OpenStep specification:

NSActionCell NSBox NSBrowser NSBrowserCell NSBundleAdditions NSButton NSButtonCell NSCachedImageRep NSClipView NSColor NSColorList NSColorPanel NSColorPicker NSColorWell NSControl NSCursor NSCustomImageRep NSEvent NSFont NSFontManager NSFontPanel NSForm NSFormCell NSImage NSImageRep NSMenu NSOpenPanel NSPanel NSPasteboard NSPopUpButton NSPrintInfo NSPrintOperation NSResponder NSScreen NSScroller NSSelection NSSlider NSSliderCell NSSpellChecker NSSpellServer NSSplitView NSText NSTextField NSTextFieldCell NSView All Protocols

The following classes are only partially implemented

NSApplication -preventWindowOrdering not implemented. In -activateIgnoringOtherApps:, the flag is ignored. NSBitmapImageRep +TIFFRepresentationOfImageRepsInArray:usingCompression:factor: not fully implemented. NSCell -setFloatingPointFormat:left:right: not implemented. -setEntryType: not complete. NSDataLinkManager Missing noteDocumentSaved... methods. NSDataLinkPanel -setAccessoryView: not implemented. NSEPSImageRep Cannot interpret/draw EPS images NSMatrix -setValidateSize: not implemented NSPageLayout -setAccessoryView: not implemented. Several methods have been depreciated because they don't do anything useful. NSPrintPanel -setAccessoryView: not implemented. Several methods have been depreciated because they don't do anything useful. NSPrinter Doesn't really get all the information it needs correctly. NSSavePanel NSCoding protocol not implemented. NSScrollView -toggleRuler: and -isRulerVisible: not implemented. (Replaced by similar methods). NSWindow -resizeFlags not implemented. NSWorkspace Many methods require a proper window and workspace manager application to be used. Functions Following are not implemented: NSReadPixel, all text functions.

The following OpenStep classes are not implemented. These classes are either not very useful or have been replaced by classes with better APIs.

NSCStringText (Unecessary NEXTSTEP compatibility) NSCoderAdditions (Unecessary NEXTSTEP compatibility) NSHelpPanel (Replaced by NSHelpManager) NSMenuCell (Replaced by NSMenuItem[Cell])
gnustep-gui-0.24.0/Documentation/General/GNUmakefile0000664000076500007650000000236711122715377022220 0ustar brains99brains99# # Makefile for GNUstep Gui Library documentation. # # Copyright (C) 2002 Free Software Foundation, Inc. # # Written by: Adam Fedor # # This file is part of the GNUstep Gui Library. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-gui include $(GNUSTEP_MAKEFILES)/common.make include ../../config.make DOCUMENT_NAME = General General_DOC_INSTALL_DIR = Developer/Gui General_AGSDOC_FILES = \ OpenStepCompliance.gsdoc include $(GNUSTEP_MAKEFILES)/documentation.make gnustep-gui-0.24.0/Documentation/install.texi0000664000076500007650000000557210711446641021131 0ustar brains99brains99@c -*- texinfo -*- @chapter Installation @node Top, Introduction, (dir), (dir) @include version.texi @menu * Introduction:: * Configuration:: * Compilation:: * Installing:: * Post-Installation:: @end menu @node Introduction, Configuration, Top, Top @section Introduction This file documents the installation of the GNUstep GUI Library, @samp{gnustep-gui}. If you are installing this package as part of the GNUstep core package, read the file GNUstep-HOWTO for more complete instructions on how to install the entire GNUstep package (including this library). GNUstep-HOWTO is located at @url{http://www.gnustep.org} and in the gnustep-make package (which you should install first). You must have installed gnustep-base and gnustep-make before building this library. GNUstep Make version 2.0.0 or greater is required. GNUstep Base version 1.15.0 or greater is required. Other external libraries that you should have installed include: @itemize @item tiff (REQUIRED) @item jpeg (RECOMMENDED) @item png (RECOMMENDED) @item gif or ungif (OPTIONAL) @item aspell (OPTIONAL) @item cups (OPTIONAL) @item audiofile (OPTIONAL) @item portaudio, v19 which has several API changes previous version (OPTIONAL) @end itemize Read the GNUstep-HOWTO for more information. After installing this library, install gnustep-back. @node Configuration, Compilation, Introduction, Top @section Configuration Configuration is performed by running the @file{configure} program at a shell prompt. You may want to use some of the optional arguments to the @file{configure} program. Type @code{configure --help} for a list. GNUstep specific options are at the end of this list (if any). @node Compilation, Installing, Configuration, Top @section Compilation To compile this library, type make. After this is complete, type make install (make sure you are the root user). Some additional options you can use with make are @samp{debug=yes} to make a debugging version of the library and @samp{shared=no} to make a static version of the library. See the gstep-make package for more information on these options. @node Installing, Post-Installation, Compilation, Top @section Installing To install, type @example make install @end example @node Post-Installation, , Installing, Top @section Post Installation GNUstep gui comes with a tool called @samp{make_services} which builds a list of installed applications and services. This list is used to find services for the services menu, for instance. This tool should be run after a new service or application is installed in the system. Theoretically, a workspace application, such as GWorkspace, should do this automatically. But this is not done at the current time. You might consider running this service automatically, perhaps in a login script, to make sure the service and application lists are updated regularly. @bye gnustep-gui-0.24.0/Documentation/GNUmakefile.postamble0000664000076500007650000000705011551460302022611 0ustar brains99brains99# # GNUmakefile.postamble # # Copyright (C) 2002 Free Software Foundation, Inc. # # Author: Adam Fedor # # This file is part of the GNUstep Gui Library. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # Things to do before compiling # before-all:: # After building local documentation, we need to run the special makefile # in the source directory to generate library reference documentation from # the source code. after-all:: $(MAKE) -C ../Source -f DocMakefile # Things to do before installing # before-install:: # Install the library reference documentation manually # after-install:: rm -rf $(GNUSTEP_DOC)/$(Gui_DOC_INSTALL_DIR) $(MKINSTALLDIRS) $(GNUSTEP_DOC)/$(Gui_DOC_INSTALL_DIR) (cd Gui; $(TAR) cf - .) | \ (cd $(GNUSTEP_DOC)/$(Gui_DOC_INSTALL_DIR); $(TAR) xf -) rm -rf $(GNUSTEP_DOC)/$(Gui_DOC_INSTALL_DIR)/CVS rm -rf $(GNUSTEP_DOC)/$(GuiAdditions_DOC_INSTALL_DIR) $(MKINSTALLDIRS) $(GNUSTEP_DOC)/$(GuiAdditions_DOC_INSTALL_DIR) (cd GuiAdditions; $(TAR) cf - .) | \ (cd $(GNUSTEP_DOC)/$(GuiAdditions_DOC_INSTALL_DIR); $(TAR) xf -) rm -rf $(GNUSTEP_DOC)/$(GuiAdditions_DOC_INSTALL_DIR)/CVS ( cd $(GNUSTEP_DOC)/$(GuiUser_DOC_INSTALL_DIR) ; \ mv GuiUser/* . ; \ rm -rf GuiUser ) if [ ! -f $(GNUSTEP_DOC_MAN) ]; then \ $(MKINSTALLDIRS) $(GNUSTEP_DOC_MAN); \ fi; \ if [ ! -f $(GNUSTEP_DOC_MAN)/man1 ]; then \ $(MKINSTALLDIRS) $(GNUSTEP_DOC_MAN)/man1; \ fi; \ for file in $(MAN1_PAGES) __done; do \ if [ $$file != __done ]; then \ $(INSTALL_DATA) $$file $(GNUSTEP_DOC_MAN)/man1/$$file; \ which gzip && rm -f $(GNUSTEP_DOC_MAN)/man1/$$file.gz \ && gzip -9 $(GNUSTEP_DOC_MAN)/man1/$$file; \ fi; \ done; # Things to do before uninstalling # before-uninstall:: # Things to do after uninstalling after-uninstall:: rm -rf $(REF_DOC_INSTALL_DIR) # Things to do before cleaning # before-clean:: # Things to do after cleaning after-clean:: $(MAKE) -C ../Source -f DocMakefile clean rm -rf Gui rm -rf GuiAdditions # Things to do before distcleaning # before-distclean:: # Things to do after distcleaning # after-distclean:: # Things to do before checking # before-check:: # Things to do after checking # after-check:: regenerate: $(DOCUMENT_TEXT_NAME) mv -f $(TOP_DOC_FILES) .. version.texi: ../Version rm -f version.texi echo '@set GNUSTEP-GUI-VERSION' $(GNUSTEP_GUI_VERSION) \ > version.texi echo '@set GNUSTEP-GUI-GCC $(GNUSTEP_GUI_GCC)' \ >> version.texi echo '@set GNUSTEP-GUI-BASE $(GNUSTEP_GUI_BASE)' \ >> version.texi echo '@set GNUSTEP-GUI-LIBTIFF $(GNUSTEP_GUI_LIBTIFF)' \ >> version.texi if [ $(GNUSTEP_GUI_FTP_MACHINE) ]; then \ echo '@set GNUSTEP-GUI-FTP-MACHINE $(GNUSTEP_GUI_FTP_MACHINE)' \ >> version.texi; fi if [ $(GNUSTEP_GUI_FTP_DIRECTORY) ]; then \ echo '@set GNUSTEP-GUI-FTP-DIRECTORY $(GNUSTEP_GUI_FTP_DIRECTORY)' \ >> version.texi; fi gnustep-gui-0.24.0/Documentation/announce.texi0000664000076500007650000000417711372062630021265 0ustar brains99brains99@c -*- texinfo -*- @chapter ANNOUNCE @ifset TEXT-ONLY @include version.texi @end ifset This is version @value{GNUSTEP-GUI-VERSION} of the GNUstep GUI library (@samp{gnustep-gui}). @section What is the GNUstep GUI Library? It is a library of graphical user interface classes written completely in the Objective-C language; the classes are based upon Apple's Cocoa framework (which came from the OpenStep specification as release by NeXT Software, Inc). The library has been enhanced in a number of ways to take advantage of the GNU system. These classes include graphical objects such as buttons, text fields, popup lists, browser lists, and windows; there are also many associated classes for handling events, colors, fonts, pasteboards and images. The GNUstep GUI Library is designed in two parts. The first part is the front-end component which is independent of platform and display system. This front-end is combined with a back-end component which handles all of the display system dependent such as specific calls to X/Windows. This design allows the GNUstep applications to have the "look and feel" of the underlying display system without any changes to the application, and the library can be easily ported to other display systems. The GNUstep GUI Library requires the GNU Objective-C compiler, the GNUstep Base Library, the TIFF Graphics library, and a back-end component like the GNUstep 'Back' Backend. @set ANNOUNCE-ONLY @include news.texi @clear ANNOUNCE-ONLY @section Where can you get it? How can you compile it? @ifset GNUSTEP-GUI-FTP-MACHINE The gstep-gui-@value{GNUSTEP-GUI-VERSION}.tar.gz distribution file has been placed at @url{ftp://@value{GNUSTEP-GUI-FTP-MACHINE}/@value{GNUSTEP-GUI-FTP-DIRECTORY}}. @end ifset Read the INSTALL file or the GNUstep-HOWTO for installation instructions. @section Where do I send bug reports? Please log bug reports on the GNUstep project page @url{http://savannah.gnu.org/bugs/?group=gnustep} or send bug reports to @email{bug-gnustep@@gnu.org}. @section Obtaining GNU Software Check out the GNUstep web site. (@url{http://www.gnustep.org/}), and the GNU web site. (@url{http://www.gnu.org/}) gnustep-gui-0.24.0/Documentation/GNUmakefile0000664000076500007650000000553311540763635020645 0ustar brains99brains99# # Documentation makefile for the GNUstep GUI Library # Copyright (C) 1995 Free Software Foundation, Inc. # # Written by: Adam Fedor # # This file is part of the GNUstep GUI Library. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-gui GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../gui.make include $(GNUSTEP_MAKEFILES)/common.make include ../Version #include ../config.make # The documents to be generated DOCUMENT_NAME = ReleaseNotes SUBPROJECTS = General GuiUser manual # The text documents to be generated DOCUMENT_TEXT_NAME = \ INSTALL NEWS README ANNOUNCE BUGS gnustep-gui_TEXI_FILES = \ version.texi gnustep-gui_DOC_INSTALL_DIR = Developer/Gui/Manual GuiUser_DOC_INSTALL_DIR = User/Gui TOP_DOC_FILES = INSTALL NEWS README ANNOUNCE BUGS INSTALL_TEXI_FILES = version.texi INSTALL_TEXT_MAIN = install.texi INSTALL_DOC_INSTALL_DIR = Developer/Gui/ReleaseNotes/$(VERSION) NEWS_TEXI_FILES = version.texi NEWS_TEXT_MAIN = news.texi NEWS_DOC_INSTALL_DIR = Developer/Gui/ReleaseNotes/$(VERSION) README_TEXI_FILES = version.texi README_TEXT_MAIN = readme.texi README_DOC_INSTALL_DIR = Developer/Gui/ReleaseNotes/$(VERSION) ANNOUNCE_TEXI_FILES = version.texi ANNOUNCE_TEXT_MAIN = announce.texi ANNOUNCE_DOC_INSTALL_DIR = Developer/Gui/ReleaseNotes/$(VERSION) BUGS_TEXI_FILES = version.texi BUGS_TEXT_MAIN = todo.texi BUGS_DOC_INSTALL_DIR = Developer/Gui/ReleaseNotes/$(VERSION) # Manual pages to install MAN1_PAGES = gopen.1 make_services.1 gclose.1 gcloseall.1 set_show_service.1 ReleaseNotes_AGSDOC_FILES = ReleaseNotes.gsdoc ReleaseNotes_DOC_INSTALL_DIR = Developer/Gui # NB. Library reference documentation is generated by rules in the postamble # file using the make file ../Source/DocMakefile. If headers are added to the # library, you need to modify that file to get the autogsdoc tool to use them. # DOCUMENT_NAME += Gui GuiAdditions Gui_DOC_INSTALL_DIR = Developer/Gui/Reference GuiAdditions_DOC_INSTALL_DIR = Developer/Gui/Additions -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/aggregate.make include $(GNUSTEP_MAKEFILES)/documentation.make -include GNUmakefile.postamble gnustep-gui-0.24.0/Documentation/todo.texi0000664000076500007650000000103210770101221020376 0ustar brains99brains99@c -*-texinfo-*- @ifclear GLOBAL-TODO @chapter TODO @ifset TEXT-ONLY @include version.texi @end ifset @section Bugs in the GUI library @end ifclear The following classes are currently unimplemented or unfinished to such a degree to be unusable. @itemize @bullet @item NSFontDescriptor @item NSColorSpace @item NSSearchField and NSSearchFieldCell @end itemize Classes that need work (well every class needs work!) @itemize @bullet @item NSTableView and NSOutlineView @item NSProgressIndicator @item All the Text classes @end itemize gnustep-gui-0.24.0/Documentation/Gui.gsdoc0000664000076500007650000000532010512464124020317 0ustar brains99brains99 Gui $Revision: 23798 $ $Date: 2006-10-09 16:18:44 +0100 (Mon, 09 Oct 2006) $ 2005 Free Software Foundation, Inc. Gui

The GNUstep GUI library is a free software package implementing the API of the OpenStep Application Kit (tm), or "AppKit", including later additions. This documentation package describes the core of the Base library; for documentation on additional classes, see the GuiAdditions documentation package.

Read the Release Notes for the current release.

Compatibility

GNUstep is generally compatible with the OpenStep specification and with recent developments of the Mac OS X (Cocoa) API. Where MacOS deviates from the OpenStep API, GNUstep generally attempts to support both versions. In some cases the newer MacOS APIs are incompatible with OpenStep, and GNUstep usually supports the richer version. See the OpenStep Compliance section for more information on OpenStep Compliance.

Information and Setup

Nicola Pero has begun work on writing an introduction to the basic concepts and use of the GNUstep GUI library.

Useful documentation for setting up GNUstep:

Available User Defaults Language Setup
API Documentation Functions Types and Constants
gnustep-gui-0.24.0/Documentation/GuiUser/0000775000076500007650000000000012256227325020144 5ustar brains99brains99gnustep-gui-0.24.0/Documentation/GuiUser/.cvsignore0000664000076500007650000000000710377004044022132 0ustar brains99brains99*.html gnustep-gui-0.24.0/Documentation/GuiUser/DefaultsSummary.gsdoc0000664000076500007650000003562412224425212024312 0ustar brains99brains99 User Defaults Summary for GNUstep Libraries $Revision: 37200 $ $Date: 2013-10-07 04:29:14 +0100 (Mon, 07 Oct 2013) $ 2005 Free Software Foundation, Inc. Defaults Summary

This document contains a summary of available user default values that one can set to control the operation of the GNUstep libraries. To set a default, use the defaults write (domain) (key) (value) command in a terminal, with the NSGlobalDomain as first argument. E.g.,

defaults write NSGlobalDomain GSBackend libgnustep-art

To read out the value set for the default, use defaults read (domain) [(key)]. If you do not specify the key, every key-value pair in the domain will be printed.

Other domains besides the system level domain "NSGlobalDomain" include the application domains, named for each application that has registered defaults, and the temporary runtime "NSArgumentDomain" for command line arguments. At runtime there is also a "NSRegistrationDomain", a second-chance domain in which "defaults for defaults" can be registered, and possibly also domains for specific locales.

GUI Library Defaults

Below is a list of defaults used to control the gnustep-gui library. You can set them either in NSGlobalDomain, to be used everywhere, or in individual application domains, to be used for those apps only.

GSBackend

A string containing the name of the backend bundle to use for display specific GUI handling. The default is "libgnustep-back". Custom backends can be created during compilation of the libraries. Any other choice for a name is thus system specific.

GSBrowserCellFontify

A boolean value, NO by default. When the feature is on, NSBrowserCell draws non-leaf cells in bold system font. For example, when the feature is on, in a SavePanel (or OpenPanel), directory entries are drawn in bold, while simple files are drawn in non bold.

GSAbortKey

The key used to abort the insertion of multi-stroke keybinding. Default is Control-g.

GSAppKitUserBundles

An array listing the names of bundles that will be automatically loaded into every application at startup. Typically these will be 'theme' bundles that control the look of the application.

GSQuoteKey

The key used to quote the next keystroke (so that it is not interpreted as a keybinding, but just inserted into the text as it is). Default is Control-q.

GSUseGhostResize

A boolean, by default NO. If you set it to YES, NSSplitView uses a 'ghost' bar to show resizing instead of doing a live resizing of the views.

GSHelpViewer

A string which can be used to specify the name of the application to be used to view application help.
If this is not specified (or is an empty string) the 'best' available viewer is used (an application whose Info.plist says that it can view files of the appropriate type ... usually rtp or rtfd files).
If this is set to NSHelpPanel or if no application can be used to view the help file, the help is displayed by the shared help panel object built in to the application.

GSInsertControlKeystrokes

A boolean, by default NO. If you set it to YES, keystrokes containing a Control are inserted into the text when they can't be interpreted as keybindings. By default, they are ignored and cause the computer to beep.

GSKeyBindingsFiles

An array of strings, (DefaultKeyBindings) by default. The strings in this array (with .dict appended) are the names of the files the library reads to load the keybindings. For each of these files (in the order), the library first tries to read the file with that name from the $GNUSTEP_SYSTEM_ROOT/Libraries/Resources/KeyBindings/ directory, loading all the keybindings it finds in the file, then it loads the similar file from $GNUSTEP_LOCAL_ROOT and then the similar one from $GNUSTEP_NETWORK_ROOT and at last the one from $GNUSTEP_USER_ROOT. If you have a single set of customized keybindings which you want to be loaded in addition to the default ones (or overriding some of the default ones), just add a DefaultKeybindings.dict file in your ~/GNUstep/Libraries/Resources/KeyBindings/ directory, and keybindings from this file are automatically loaded in addition to the default ones; you do not need to change this user default. If instead you want more keybinding files to be loaded, or you do not want the system default keybindings file to be loaded, you might well need to change it.

GSKeyBindings

A dictionary, containing keybindings which are loaded by the library after the ones found in the GSKeyBindingsFiles. Might be useful if you have only a couple of keybindings, and don't want to write a custom keybindings file. If you have many keybindings, it is recommended that you keep them in a file. The syntax of keybindings entries and files is documented elsewhere.

GSLPRPrinters

Specifies a dictionary containing printer information for the GSLPR printer bundle. See the bundle source for details.

GSSavePanelShowProgress

A boolean value, NO by default. When the feature is on, the save panel and its subclasses (such as the open panel) displays "Reading Directory ***.." (progressively adding dots) in the window titlebar while reading very big directories (more than 100 entries). This is meant to make things friendlier for slow computers.

GSUnknownFileTool

A string value that defines a program that should be launched when no GNUstep application has been defined for a specific file extension or if an URL could not be opened by a service. This program gets the file name or URL as parameter.

GSUseFreedesktopThumbnails

A boolean value, NO by default. When the feature is on, thumbnail files according to the Freedesktop specification are used in [NSWorkspace iconForFile:] when available.

GSLogWorkspaceTimeout

A boolean value that defaults to NO. This is a obscure and probably not useful default. NSWorkspace tries to receive distributed notifications, but if a distributed objects server cannot be found or some other error occurs, it raises an exception which normally terminates the program. Setting this default causes NSWorkspace to just log the problem without raising an exception.

GSWorkspaceApplication

A string value that defaults to "GWorkspace". This defines the application NSWorkspace will try to connect to process some operations that require an external application. This is a new feature and has not been tested.

GSSuppressAppIcon

A boolean value, NO by default. Specifies wether the application icon window should not be displayed. Set to YES for background server applications.

GSControlKeyString

A string used in the menu to signify that the control key needs to be pressed together with the key equivalent of the menu item. Default "^".

GSAlternateKeyString

A string used in the menu to signify that the alternate key needs to be pressed together with the key equivalent of the menu item. Default "+".

GSScrollerArrowsSameEnd

YES if the scroller arrows are at the same end. NO to get one scroller arrow at each end of the scroller. If not set, the behaviour is delegated to NSScrollerInterfaceStyle. Default YES.

GSScrollerScrollsByPage

YES if clicking in the scroller slot should scroll by one page, NO if the scroller should jump to the location clicked. If not set, the behaviour is delegated to NSScrollerInterfaceStyle. Default NO.

GSShiftKeyString

A string used in the menu to signify that the shift key needs to be pressed together with the key equivalent of the menu item. Default "/".

GSCommandKeyString

A string used in the menu to signify that the command key needs to be pressed together with the key equivalent of the menu item. Default "#".

NSInterfaceStyleDefault

A string describing the interface style. Setting this may change various aspects of how the library draws elements and responds to user interaction. See the NSInterfaceStyle documentation for more information.

NSMenuInterfaceStyle

An interface style specific to menu operation. If not set the NSInterfaceStyleDefault value is used.
Setting this to NSMacintoshInterfaceStyle produces a horizontal menu at the top of the screen.
Setting it to NSNextStepInterfaceStyle reverts to the defaults vertical menu layout.

NSCommandKeys

A dictionary of command key equivalents for menu items. The key contains the title of the menu item and the value is the command key equivalent. For instance, one might set the command key for the menu item "Copy" to "C".

NSHost

Used by NSPasteboard to find the host on which the pasteboard server is running.

NSMeasurementUnit

A string describing the measurement unit for rulers (see the NSRulerView class documentation). The default is Centimeters. Other possible values are Inches, Points, and Picas.

NSPreviewApp

A string value that defaults to "gv". This defines the application NSPrintOperation will try to connect to preview PostScript files, unless there is already an application registed as a Viewer of ps files.

NSShowNonLocalizedStrings

This is mainly a developer option. If "YES", the application will display localization keys instead of strings in its UI. This can be useful during development to see where a given string in the UI is "coming from". Default is "NO".

NSUseRunningCopy

This determines the behavior of an applicationms when a second copy is started up.
If set to YES the newly started copy makes the process which is already running active, then terminates itsself.
If set to NO, the newly started copy runs, but has a different name (so it cannot be contacted to provide services for other applications).

System Colors

System colors are standard colors for drawing various GUI elements, such as buttons, text, scroller, etc. They can be set using the normal user defaults system. An NSColorList called "System" is stored in the users's private color list directory. This color list can also be manipulated through the NSColorList class (typically through a preferences module).

Individual system colors may be set by specifying the name of the system color and giving it a value consisting of aan RGB color specification (three floating point numbers in the range 0.0 to 1.0 and separated by spaces).
eg.
'defaults write NSGlobalDomain controlBackgroundColor "1.0 0.0 0.0"'

System Fonts

System Fonts may be set using the defaults system. System fonts are standard fonts for drawing text in GUI elements. They include NSBoldFont, for instance. The value is the name of the font to use. There is also a cooresponding size key (e.g. NSBoldFontSize) for specifying the point size of the font. The keys that can be used for setting the system fonts are described in the documentation for NSFont.

gnustep-gui-0.24.0/Documentation/GuiUser/LanguageSetup.gsdoc0000664000076500007650000003551310512464124023731 0ustar brains99brains99 How to Set Up GNUstep for the East Asian Languages kazuanobu.kuriyama@nifty.com yjchenx@hotmail.com 2.2 Alpha 2004-04-08 This article illustrates how to set up GNUstep for the East Asian languages with some working examples. It also includes some useful information applicable to other non-European languages. 2004, 2003 Free Software Foundation, Inc. Introduction

This brief article illustrates how to set up your GNUstep for the East Asian languages known as CJK (Chinese, Japanese, and Korean) in literature. We assume that you already know how to set up your X Window System for your language environment such as locale, fonts, and input methods. We also assume that you selected 'art' as the backend of GNUstep's GUI.

Like other computer software made outside the region, GNUstep requires some adjustment to use those languages. The adjustment consists of the following steps:

Prepare one or more true type font files which contain characters of your native language, and organize them in a certain way so that the art backend can use them. Set the environmental variable GNUSTEP_STRING_ENCODING to an appropriate value for the language in use. Set the NSGlobalDomain variables such as NSFont, NSFontSize, NSUserFont, and NSLanguages , to name a few, to appropriate values using the GNUstep's utility defaults.

Now we explain each step in detail and give some working examples.

Fonts

The art backend expects necessary true type font files to be found in the specified directories, which are usually $GNUSTEP_USER_ROOT/Library/Fonts and $GNUSTEP_SYSTEM_ROOT/Library/Fonts. You need to organize font files in a certain way (see below) so that the art backend can recognize them.

For example, suppose you have a hypothetical true type font file called MyFont.ttf and want to allow all other users to use it. Then, as root,

# cd $GNUSTEP_SYSTEM_ROOT/Library/Fonts # mkdir MyFont.nfont # cd MyFont.nfont

With your favorite editor, create a file whose contents are as follows:

{ Faces = ( { PostScriptName = "MyFont"; Name = "Regular"; Files = ("MyFont.ttf"); } ); }

Then save it as FontInfo.plist (the format above is known as property list in GNUstep, which explains why the extension is plist). This small file system you've created just now is referred to as .nfont package.

The FontInfo.plist above is just a bare-bones version. For further details, we strongly recommend the reader to read the file nfont_packages.txt found at http://wiki.gnustep.org/index.php/nfont%20packages.

If you want to use the font file privately, replace GNUSTEP_SYSTEM_ROOT with GNUSTEP_USER_ROOT in the instruction above.

Encoding

GNUstep assumes as default that every character is encoded in ISO8859-1 unless the escape character \u precedes it (This exception applies to other encodings). Hence, if you want to use the characters of your native language with GNUstep, you have to tell it which encoding you use. This can be done by setting the environmental variable GNUSTEP_STRING_ENCODING to an appropriate value.

The possible values for GNUSTEP_STRING_ENCODING are as follows:

NSASCIIStringEncoding NSNEXTSTEPStringEncoding NSJapaneseEUCStringEncoding // Japanese NSUTF8StringEncoding NSISOLatin1StringEncoding // ISO-8859-1; West European NSSymbolStringEncoding NSNonLossyASCIIStringEncoding NSShiftJISStringEncoding // Japanese NSISOLatin2StringEncoding // ISO-8859-2; East European NSUnicodeStringEncoding NSWindowsCP1251StringEncoding NSWindowsCP1252StringEncoding // WinLatin1 NSWindowsCP1253StringEncoding // Greek NSWindowsCP1254StringEncoding // Turkish NSWindowsCP1250StringEncoding // WinLatin2 NSISO2022JPStringEncoding // Japanese NSMacOSRomanStringEncoding NSProprietaryStringEncoding // GNUstep additions NSKOI8RStringEncoding // Russian/Cyrillic NSISOLatin3StringEncoding // ISO-8859-3; South European NSISOLatin4StringEncoding // ISO-8859-4; North European NSISOCyrillicStringEncoding // ISO-8859-5 NSISOArabicStringEncoding // ISO-8859-6 NSISOGreekStringEncoding // ISO-8859-7 NSISOHebrewStringEncoding // ISO-8859-8 NSISOLatin5StringEncoding // ISO-8859-9; Turkish NSISOLatin6StringEncoding // ISO-8859-10; Nordic NSISOThaiStringEncoding // ISO-8859-11 NSISOLatin7StringEncoding // ISO-8859-13 NSISOLatin8StringEncoding // ISO-8859-14 NSISOLatin9StringEncoding // ISO-8859-15; Replaces ISOLatin1 NSGB2312StringEncoding NSUTF7StringEncoding // RFC 2152 NSGSM0338StringEncoding // GSM (mobile phone) default alphabet NSBIG5StringEncoding // Traditional chinese NSKoreanEUCStringEncoding // Korean

Of these values, choose an appropriate one for your purpose and set the environmental variable to it. For example, for sh or bash,

$ export GNUSTEP_STRING_ENCODING=NSBIG5StringEncoding

or, for csh,

% setenv GNUSTEP_STRING_ENCODING NSBIG5StringEncoding
User Default Values

Now that you've specified the encoding, you have to determine which fonts you use to display the characters of your native language.

Becuase the fonts used with GNUstep GUI are initially set to those that are appropriate for European languages, you have to overwrite them to display the characters correctly.

At least, you need to change the user default value NSFont, and NSBoldFont. For example, suppose you have a hypothetical .nfont package called MyFont and MyBoldFont, and want to use it to display the characters. To do this, use the GNUstep's utility defaultsas follows:

$ defaults write NSGlobalDomain NSFont MyFont $ defaults write NSGlobalDomain NSBoldFont MyBoldFont

Depending on a situation, you may also need to set NSUserFont to MyFont. (In GNUstep, a pair of a key and a value such as (NSFont, MyFont) is referred to as a dictionary.)

To confirm the value, use

$ defaults read

If you want to remove the assignment entirely to revert to the original default value, use

$ defaults delete NSGlobalDomain NSFont $ defaults delete NSGlobalDomain NSBoldFont

For further details about the user default values, the reader can refer to the documents DefaultsSummary.html and NSFont.html shipped with the GNUstep core library package.

You can also change the default language (English) into your native language. If an application has a directory called MyLanguage.lproj in the bundle (could be in Resources/ directory), it may be localized for that language. To enable this functionality, which displays the interface in that language, you need to set the user default value NSLanguages to the language. Otherwise, it will fall back to the default one (English). To change the default language, use

$ defaults write NSGlobalDomain NSLanguages "(MyLanguage)"
Examples

In the following examples, we assume that the reader has already set up the X Window System properly for her/his language environment. In particular, the locale the reader wants to use must be supported by both the C starndard library and the X library of the system in use. Before trying some of the examples, make sure the environmental variables governing encoding are set to appropriate values. Such variables include LC_ALL, LC_CTYPE, and LANG.

Traditional Chinese Environmental Variables: GNUSTEP_STRING_ENCODING=NSBIG5StringEncoding LC_CTYPE=zh_TW.Big5 .nfont package:

Here, use Arphic MingTi font as example

First, make a directory for an .nfont package you are going to make:

$ cd $GNUSTEP_USER_ROOT/Library/Fonts (or $GNUSTEP_SYSTEM_ROOT/Library/Fonts) $ mkdir 'MingTi.nfont' $ cd 'MingTi'

Make a copy of the font file in the directory.

$ ln -s /usr/X11R6/lib/X11/fonts/local/bsmi00lp.ttf ./

And write a FontInfo.plist (see below).

MingTi.nfont/FontInfo.plist: { Face = ( { PostScriptName = "MingTi"; Name = "Regular"; Files = ("bsmi00lp.ttf") } ); } User Defaults: $ defaults write NSGlobalDomain NSFont MingTi $ defaults write NSGlobalDomain NSBoldFont MingTi $ defaults write NSGlobalDomain NSLanguages "(TraditionalChinese)"
Japanese Environmental Variables: GNUSTEP_STRING_ENCODING=NSJapaneseEUCStringEncoding LANG=ja_JP .nfont package:

If you are using Windows with Japanese (and have valid owership of it), you may have msgothic.ttc or msmincho.ttc in the Windows machine. If this is the case, you can use them to make your own .nfont packages. We'll give an example below when msgothic.ttc is used.

First, make a directory for an .nfont package you are going to make:

$ cd $GNUSTEP_USER_ROOT/Library/Fonts (or $GNUSTEP_SYSTEM_ROOT/Library/Fonts) $ mkdir 'MS Gothic.nfont' $ cd 'MS Gothic'

Make a copy of the font file in the directory, say, assuming the Windows' partition /dev/hda1 is to be mounted at /mnt/win98:

$ mount -t vfat /dev/hda1 /mnt/win98 $ cp /mnt/win98/windows/fonts/msgothic.ttc .

And write a FontInfo.plist (see below).

MS Gothic.nfont/FontInfo.plist: { Faces = ( { PostScriptName = "MS Gothic"; Name = "Regular"; Files = ("msgothic.ttc") } ); } User Defaults: $ defaults write NSGlobalDomain NSFont 'MS Gothic' $ defaults write NSGlobalDomain NSUserFont 'MS Gothic'

CAVEAT: If you use the font files mentioned above, you must use them within your own right. The instruction given above never changes any rights and duties you have to use these fonts.

Korean Environmental Variables: GNUSTEP_STRING_ENCODING=NSKoreanEUCEncoding .nfont package:

GPL'ed Korean fonts are available at http://chem.skku.ac.kr/~wkpark/project/font/UnFonts/

Create a directory for a .nfont package for Korean fonts, say Un.nfont:

$ cd $GNUSTEP_USER_ROOT/Library/Fonts $ mkdir Un.nfont $ cd Un

And write a FontInfo.plist (see below).

Un.nfont/FontInfo.plist: { Faces = ( { PostScriptName = "Un"; Name = "Regular"; Files = ("UnDotum.ttf"); } ); } User Defaults: $ defaults write NSGlobalDomain NSFont Un
Concluding Remarks

Although this article has focused on the CJK languages, most part of it is also applicable to other languages if GNUstep supports the enconding you need.

If you find a way to set up GNUstep for your native language other than CJK, please consider to contribute it to the GNUstep community to share your invaluable experience with others. We'll greatly appreciate it. Comments or suggestions are also welcome.

gnustep-gui-0.24.0/Documentation/GuiUser/GNUmakefile0000664000076500007650000000243611122715377022223 0ustar brains99brains99# # Makefile for GNUstep Gui Library documentation. # # Copyright (C) 2002 Free Software Foundation, Inc. # # Written by: Adam Fedor # # This file is part of the GNUstep Gui Library. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-gui include $(GNUSTEP_MAKEFILES)/common.make include ../../config.make DOCUMENT_NAME = GuiUser GuiUser_DOC_INSTALL_DIR = User/Gui GuiUser_AGSDOC_FILES = \ DefaultsSummary.gsdoc \ KeyboardSetup.gsdoc \ LanguageSetup.gsdoc include $(GNUSTEP_MAKEFILES)/documentation.make gnustep-gui-0.24.0/Documentation/GuiUser/KeyboardSetup.gsdoc0000664000076500007650000002041311664737102023747 0ustar brains99brains99 User Keyboard Setup for GNUstep Libraries $Revision: 34225 $ $Date: 2011-11-28 17:00:50 +0000 (Mon, 28 Nov 2011) $ 2005 Free Software Foundation, Inc. Keyboard Setup

This document describes how to change the mouse and keyboard mappings so that GNUstep can be used properly. This document applies only to the X-Windows based backend.

Defaults Settings

The OpenStep specification requires 3 main different keyboard modifiers: CONTROL, COMMAND and ALTERNATE.

COMMAND is used to enter key equivalents (keyboard shortcuts for menus or buttons); for example, usually 'Quit' on the main menu of an application is bound to 'q', so you may usually quit a GNUstep application by pressing Command - q. CONTROL and ALTERNATE are two additional modifiers. A typical use of ALTERNATE is to scroll by pages rather than by lines; you have to press ALTERNATE while acting on a scrollbar with the mouse.

By default, GNUstep uses Control_L (left Ctrl) and Control_R (right Ctrl) as CONTROL, Alt_L (left alt) as COMMAND, and Alt_R (right alt, sometimes called AltGr) as ALTERNATE. As a special exception, if Alt_R is not bound to any key on your keyboard, GNUstep will try to use Mode_switch for ALTERNATE instead. Some X server map AltGr onto ISO_Level3_Shift. To allow for this the second code ALTERNATE may be bound to this key.

If this layout does not work for you, because your keyboard misses some of these keys, or they have different X names or they conflict heavily with your window manager shortcuts (or for any other reason), read on.

Changing the Default Settings

Under GNUstep, you may change the default as you wish: you may choose which keys of your keyboard you want to use for CONTROL, COMMAND and ALTERNATE (You may even use different keys for different GNUstep applications, without conflict). These settings are internal to GNUstep, and will not influence the behaviour of other X apps.

You may choose up to 2 keys per modifier.

Note that, if your keyboard is properly set up for X, you should not need to remap your X keyboard to use GNUstep. By changing the defaults, you should be able to use GNUstep whatever the X keyboard mapping might be.

What you have to do, is simply to instruct GNUstep to use different keys for CONTROL, COMMAND and ALTERNATE.

The keys to use are determined at the application startup, by reading the user defaults database.

To set the keys which will act as CONTROL you have to set GSFirstControlKey and GSSecondControlKey; and similarly for the other keys:

CONTROL GSFirstControlKey GSSecondControlKey COMMAND GSFirstCommandKey GSSecondCommandKey ALTERNATE GSFirstAlternateKey GSSecondAlternateKey

Valid values are all the standard strings for X keys. To disable completely a key, use NoSymbol as preference.

Each value which you do not explicity set is substituted with its default value. The default values are:

GSFirstControlKey Control_L GSSecondControlKey Control_R GSFirstCommandKey Alt_L GSSecondCommandKey NoSymbol GSFirstAlternateKey Alt_R (or Mode_switch if there is no Alt_R) GSSecondAlternateKey NoSymbol

What could go wrong is for example that you don't have an Alt_L key. With the default settings, you will not be able to enter the COMMAND key (which is quite an important key). What you can do in this case is to use Control_R as COMMAND, giving the following commands (from the command line):

defaults write NSGlobalDomain GSFirstCommandKey Control_R defaults write NSGlobalDomain GSSecondControlKey NoSymbol

These commands write in the GNUstep user database; the information will be used every time you start a GNUstep application.

The first line sets GSFirstCommandKey to Control_R, which makes Control_R to be read as COMMAND.

The second line disables the second control key, which would otherwise be bound to Control_R by default. If you omit it, Control_R will be used at the same time as COMMAND and as CONTROL, which is not very useful.

To delete these preferences and restore the defaults, use

defaults delete NSGlobalDomain GSFirstCommandKey defaults delete NSGlobalDomain GSSecondControlKey

To get a list of currently set defaults, you may use

defaults read

The list might be very long; you may want to extract only setting for the GSFirstCommandKey, for example:

defaults read | grep GSFirstCommandKey

A thing which could go wrong if you are trying to use a setting different from the default, and you do not know much about X, is that you can't find out the name of one of your key. In this case, you may try having a look at the output of programs like xmodmap or xkeycaps; even if you do not understand it completely, the output can inspire the right guessing.

A problem you are likely to encounter is that of conflicts with the window manager keyboard shortcuts. Good window managers let you change the keyboard shortcuts, so you may move the wm shortcuts that you do not use to keys which do not conflict (at least not too much) with GNUstep.

A final potential worry on X11 has to do with keyboards where hitting 'shift' or another key can affect the interpretation of a modifier key. For example, on some Apple USB keyboards one key to the left of the space bar maps to "Option" without shift pressed, and "Alt" when it IS pressed. Such keyboard mappings are often useful in non-English contexts to access accents or non-Roman characters. However if such a key is used as a modifier in GNUstep problems can occur when trying to use the modifier in conjunction with a shifted character. In particular, you will need to hit and release the modifier and the shift key in a particular order, or else things will not work as expected, and the modifier may become "stuck". If you experience such a problem, set the GNUstep back default GSModifiersAreKeys to YES.

gnustep-gui-0.24.0/Documentation/gcloseall.10000664000076500007650000000143710727033424020611 0ustar brains99brains99.\"gcloseall(1) man page .\"put together by Dennis Leeuw .\"Copyright (C) 2003 Free Software Foundation, Inc. .\" .\"Process this file with .\"groff -man -Tascii closeall.1 .\" .TH GCLOSEALL 1 "December 2007" GNUstep "GNUstep System Manual" .SH NAME gcloseall \- This tool terminates all applications .SH SYNOPSIS .B gcloseall .P .SH DESCRIPTION .B gcloseall terminates all applications. It does this by not asking any questions. It just terminates all applications. You have been warned! .SH OPTIONS .SH BUGS None known .P .SH SEE ALSO gclose(1), gopen(1), GNUstep(7) .P .SH HISTORY Work on .B gcloseall started in January 2006. .P .SH AUTHORS gcloseall was written by Richard Frith-Macdoanld .P This man page was written by Dennis Leeuw . gnustep-gui-0.24.0/configure0000775000076500007650000064460212243761171015671 0ustar brains99brains99#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="Source/NSApplication.m" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='LTLIBOBJS LIBOBJS cross_compiling CONFIG_SYSTEM_INCL CONFIG_SYSTEM_LIB_DIR GNUSTEP_GUI_SUBMINOR_VERSION GNUSTEP_GUI_MINOR_VERSION GNUSTEP_GUI_MAJOR_VERSION GNUSTEP_GUI_VERSION WARN_FLAGS BUILD_GSCUPS GSCUPS_DATADIR GSCUPS_LIBS GSCUPS_LDFLAGS GSCUPS_CFLAGS have_cups BUILD_SPEECH BUILD_SOUND HAVE_ICU ICU_LIBS ICU_CONFIG IMAGEMAGICK_LIBS IMAGEMAGICK_CFLAGS PKG_CONFIG HAVE_LIBPNG_CONFIG EGREP GREP CPP OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC XMKMF target_os target_vendor target_cpu target host_os host_vendor host_cpu host build_os build_vendor build_cpu build target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking with_x with_include_flags with_library_flags enable_jpeg with_jpeg_library with_jpeg_include with_tiff_library with_tiff_include enable_png enable_ungif enable_libgif enable_imagemagick enable_icu enable_icu_config with_icu_library enable_aspell enable_sound enable_speech enable_cups ' ac_precious_vars='build_alias host_alias target_alias XMKMF CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-jpeg Disable JPEG support --disable-png Disable PNG support --disable-ungif Disable libungif-based GIF support --enable-libgif Enable libgif-based GIF support --enable-imagemagick Enable ImageMagick support --disable-icu Disable International Components for Unicode --disable-icu-config Do not use the icu-config script to check for ICU. --disable-aspell Disable aspell for spellchecker --disable-sound Disable sound --disable-speech Disable speech server --disable-cups Disable cups printing support Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-x use the X Window System --with-include-flags=FLAGS specify all include flags at once --with-library-flags=FLAGS specify all library flags at once --with-jpeg-library=DIR JPEG library file are in DIR --with-jpeg-include=DIR JPEG include files are in DIR --with-tiff-library=DIR TIFF library file are in DIR --with-tiff-include=DIR TIFF include files are in DIR --with-icu-library=PATH library path for ICU libraries (only checked if not using icu-config) Some influential environment variables: XMKMF Path to xmkmf, Makefile generator for X Window System CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including # INCLUDES, setting cache variable VAR accordingly. ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 $as_echo_n "checking for $2.$3... " >&6; } if eval \${$4+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else eval "$4=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$4 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # If GNUSTEP_MAKEFILES is undefined, try to use gnustep-config to determine it. if test -z "$GNUSTEP_MAKEFILES"; then GNUSTEP_MAKEFILES=`gnustep-config --variable=GNUSTEP_MAKEFILES 2>&5` fi if test -z "$GNUSTEP_MAKEFILES"; then as_fn_error $? "You must have the gnustep-make package installed and set up the GNUSTEP_MAKEFILES environment variable to contain the path to the makefiles directory before configuring!" "$LINENO" 5 fi #-------------------------------------------------------------------- # Use config.guess, config.sub and install-sh provided by gnustep-make #-------------------------------------------------------------------- ac_aux_dir= for ac_dir in $GNUSTEP_MAKEFILES "$srcdir"/$GNUSTEP_MAKEFILES; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in $GNUSTEP_MAKEFILES \"$srcdir\"/$GNUSTEP_MAKEFILES" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. ac_config_headers="$ac_config_headers Headers/Additions/GNUstepGUI/config.h" #-------------------------------------------------------------------- # Determine the host, build, and target systems #-------------------------------------------------------------------- # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 $as_echo_n "checking target system type... " >&6; } if ${ac_cv_target+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 $as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' set x $ac_cv_target shift target_cpu=$1 target_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: target_os=$* IFS=$ac_save_IFS case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- #-------------------------------------------------------------------- # Add target OS directories as necessary #-------------------------------------------------------------------- CONFIG_SYSTEM_INCL="$CPPFLAGS" CONFIG_SYSTEM_LIB_DIR="$LDFLAGS" case "$target_os" in freebsd* | openbsd* ) CPPFLAGS="$CPPFLAGS -I/usr/local/include" LDFLAGS="$LDFLAGS -L/usr/local/lib";; netbsd*) CPPFLAGS="$CPPFLAGS -I/usr/pkg/include" LDFLAGS="$LDFLAGS -Wl,-R/usr/pkg/lib -L/usr/pkg/lib";; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 $as_echo_n "checking for X... " >&6; } # Check whether --with-x was given. if test "${with_x+set}" = set; then : withval=$with_x; fi # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else case $x_includes,$x_libraries in #( *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : $as_echo_n "(cached) " >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir cat >Imakefile <<'_ACEOF' incroot: @echo incroot='${INCROOT}' usrlibdir: @echo usrlibdir='${USRLIBDIR}' libdir: @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl dylib la dll; do if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && test -f "$ac_im_libdir/libX11.$ac_extension"; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /usr/lib64 | /lib | /lib64) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -f -r conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R7/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R7 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R7/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R7 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # We can compile using X headers with no special include directory. ac_x_includes= else for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.i conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { XrmInitialize () ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else LIBS=$ac_save_LIBS for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl dylib la dll; do if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no case $ac_x_includes,$ac_x_libraries in #( no,* | *,no | *\'*) # Didn't find X, or a directory has "'" in its name. ac_cv_have_x="have_x=no";; #( *) # Record where we found X for the cache. ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ ac_x_libraries='$ac_x_libraries'" esac fi ;; #( *) have_x=yes;; esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 $as_echo "$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes\ ac_x_includes='$x_includes'\ ac_x_libraries='$x_libraries'" { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 $as_echo "libraries $x_libraries, headers $x_includes" >&6; } fi # Added for checking the existence of ungif. Note that # -gui uses the API of the underlying window system ONLY IF # it is definitely necessary. #-------------------------------------------------------------------- # The following is so that headers and custom libraries # in the GNUstep root are used before the standard ones #-------------------------------------------------------------------- # # It looks like we ought to source the whole GNUstep.sh here, and even # ask it to output all variables! That way we have access to (eg) # GNUSTEP_SYSTEM_HEADERS below. # GNUSTEP_SH_EXPORT_ALL_VARIABLES=yes . "$GNUSTEP_MAKEFILES/GNUstep.sh" unset GNUSTEP_SH_EXPORT_ALL_VARIABLES # For backwards compatibility, define GNUSTEP_SYSTEM_HEADERS from # GNUSTEP_SYSTEM_ROOT if not set yet. if test x"$GNUSTEP_SYSTEM_HEADERS" = x""; then GNUSTEP_SYSTEM_HEADERS="$GNUSTEP_SYSTEM_ROOT/Library/Headers" fi if test x"$GNUSTEP_SYSTEM_LIBRARIES" = x""; then GNUSTEP_SYSTEM_LIBRARIES="$GNUSTEP_SYSTEM_ROOT/Library/Libraries" fi if test "$GNUSTEP_IS_FLATTENED" = no; then clean_target_os=`$GNUSTEP_MAKEFILES/clean_os.sh $target_os` clean_target_cpu=`$GNUSTEP_MAKEFILES/clean_cpu.sh $target_cpu` obj_dir=$clean_target_cpu/$clean_target_os GNUSTEP_LDIR=$GNUSTEP_SYSTEM_LIBRARIES/$obj_dir GNUSTEP_HDIR=$GNUSTEP_SYSTEM_HEADERS/$LIBRARY_COMBO else GNUSTEP_LDIR=$GNUSTEP_SYSTEM_LIBRARIES GNUSTEP_HDIR=$GNUSTEP_SYSTEM_HEADERS fi CPPFLAGS="$CPPFLAGS -I$GNUSTEP_HDIR" LDFLAGS="$LDFLAGS -L$GNUSTEP_LDIR/$LIBRARY_COMBO -L$GNUSTEP_LDIR" #-------------------------------------------------------------------- # Find the compiler #-------------------------------------------------------------------- ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lm" >&5 $as_echo_n "checking for main in -lm... " >&6; } if ${ac_cv_lib_m_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_main=yes else ac_cv_lib_m_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_main" >&5 $as_echo "$ac_cv_lib_m_main" >&6; } if test "x$ac_cv_lib_m_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi for ac_func in rint rintf atan2f do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done #-------------------------------------------------------------------- # Support for determining mountpoints #-------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in mntent.h do : ac_fn_c_check_header_mongrel "$LINENO" "mntent.h" "ac_cv_header_mntent_h" "$ac_includes_default" if test "x$ac_cv_header_mntent_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MNTENT_H 1 _ACEOF fi done for ac_header in sys/mntent.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/mntent.h" "ac_cv_header_sys_mntent_h" "$ac_includes_default" if test "x$ac_cv_header_sys_mntent_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_MNTENT_H 1 _ACEOF fi done ac_fn_c_check_member "$LINENO" "struct mntent" "mnt_dir" "ac_cv_member_struct_mntent_mnt_dir" "#include " if test "x$ac_cv_member_struct_mntent_mnt_dir" = xyes; then : $as_echo "#define MNT_MEMB mnt_dir" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct mntent" "mnt_mountp" "ac_cv_member_struct_mntent_mnt_mountp" "#include " if test "x$ac_cv_member_struct_mntent_mnt_mountp" = xyes; then : $as_echo "#define MNT_MEMB mnt_mountp" >>confdefs.h fi # getmntent is in the standard C library on UNICOS, in -lsun on Irix 4, # -lseq on Dynix/PTX, -lgen on Unixware. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getmntent" >&5 $as_echo_n "checking for library containing getmntent... " >&6; } if ${ac_cv_search_getmntent+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char getmntent (); int main () { return getmntent (); ; return 0; } _ACEOF for ac_lib in '' sun seq gen; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_getmntent=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_getmntent+:} false; then : break fi done if ${ac_cv_search_getmntent+:} false; then : else ac_cv_search_getmntent=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getmntent" >&5 $as_echo "$ac_cv_search_getmntent" >&6; } ac_res=$ac_cv_search_getmntent if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" ac_cv_func_getmntent=yes $as_echo "#define HAVE_GETMNTENT 1" >>confdefs.h else ac_cv_func_getmntent=no fi for ac_func in getmntinfo do : ac_fn_c_check_func "$LINENO" "getmntinfo" "ac_cv_func_getmntinfo" if test "x$ac_cv_func_getmntinfo" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETMNTINFO 1 _ACEOF fi done #-------------------------------------------------------------------- # Simple way to add a bunch of paths to the flags #-------------------------------------------------------------------- # Check whether --with-include-flags was given. if test "${with_include_flags+set}" = set; then : withval=$with_include_flags; include_flags="$withval" else include_flags="no" fi if test ${include_flags} != "no"; then CPPFLAGS="$CPPFLAGS ${include_flags}" CONFIG_SYSTEM_INCL="$CONFIG_SYSTEM_INCL ${include_flags}" fi # Check whether --with-library-flags was given. if test "${with_library_flags+set}" = set; then : withval=$with_library_flags; library_flags="$withval" else library_flags="no" fi if test ${library_flags} != "no"; then LDFLAGS="$LDFLAGS ${library_flags}" CONFIG_SYSTEM_LIB_DIR="$CONFIG_SYSTEM_LIB_DIR ${library_flags}" fi #-------------------------------------------------------------------- # Find JPEG #-------------------------------------------------------------------- GRAPHIC_CFLAGS= GRAPHIC_LFLAGS= # Check whether --enable-jpeg was given. if test "${enable_jpeg+set}" = set; then : enableval=$enable_jpeg; else enable_jpeg=yes fi if test $enable_jpeg = yes; then # Check whether --with-jpeg_library was given. if test "${with_jpeg_library+set}" = set; then : withval=$with_jpeg_library; else with_jpeg_library= fi # Check whether --with-jpeg_include was given. if test "${with_jpeg_include+set}" = set; then : withval=$with_jpeg_include; else with_jpeg_include= fi if test -n "$with_jpeg_library"; then with_jpeg_library="-L$with_jpeg_library" fi if test -n "$with_jpeg_include"; then with_jpeg_include="-I$with_jpeg_include" fi CPPFLAGS="$with_jpeg_include ${CPPFLAGS}" LDFLAGS="$with_jpeg_library ${LDFLAGS}" for ac_header in jpeglib.h do : ac_fn_c_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default" if test "x$ac_cv_header_jpeglib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_JPEGLIB_H 1 _ACEOF have_jpeg=yes else have_jpeg=no fi done if test "$have_jpeg" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_destroy_decompress in -ljpeg" >&5 $as_echo_n "checking for jpeg_destroy_decompress in -ljpeg... " >&6; } if ${ac_cv_lib_jpeg_jpeg_destroy_decompress+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ljpeg $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char jpeg_destroy_decompress (); int main () { return jpeg_destroy_decompress (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_jpeg_jpeg_destroy_decompress=yes else ac_cv_lib_jpeg_jpeg_destroy_decompress=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_destroy_decompress" >&5 $as_echo "$ac_cv_lib_jpeg_jpeg_destroy_decompress" >&6; } if test "x$ac_cv_lib_jpeg_jpeg_destroy_decompress" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBJPEG 1 _ACEOF LIBS="-ljpeg $LIBS" fi else ac_cv_lib_jpeg_jpeg_destroy_decompress=no fi if test "$ac_cv_lib_jpeg_jpeg_destroy_decompress" = yes; then GRAPHIC_LFLAGS="$with_jpeg_library $GRAPHIC_LFLAGS" GRAPHIC_CFLAGS="$with_jpeg_include $GRAPHIC_CFLAGS" else echo "GNUstep requires libjpeg to support JPEG images, but this library" echo "can't be found. If you really want to compile GNUstep without" echo "JPEG support, pass the --disable-jpeg option to ./configure." echo "Note that this isn't recommended. For more information, see:" echo "http://gnustep.made-it.com/BuildGuide/index.html#JPEG" as_fn_error $? "libjpeg not found." "$LINENO" 5 fi fi #-------------------------------------------------------------------- # Find TIFF #-------------------------------------------------------------------- # Check whether --with-tiff_library was given. if test "${with_tiff_library+set}" = set; then : withval=$with_tiff_library; else with_tiff_library= fi # Check whether --with-tiff_include was given. if test "${with_tiff_include+set}" = set; then : withval=$with_tiff_include; else with_tiff_include= fi if test -n "$with_tiff_library"; then with_tiff_library="-L$with_tiff_library" fi if test -n "$with_tiff_include"; then with_tiff_include="-I$with_tiff_include" fi CPPFLAGS="$with_tiff_include ${CPPFLAGS}" LDFLAGS="$with_tiff_library ${LDFLAGS}" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lz" >&5 $as_echo_n "checking for main in -lz... " >&6; } if ${ac_cv_lib_z_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_z_main=yes else ac_cv_lib_z_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_main" >&5 $as_echo "$ac_cv_lib_z_main" >&6; } if test "x$ac_cv_lib_z_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBZ 1 _ACEOF LIBS="-lz $LIBS" fi ac_fn_c_check_header_mongrel "$LINENO" "tiffio.h" "ac_cv_header_tiffio_h" "$ac_includes_default" if test "x$ac_cv_header_tiffio_h" = xyes; then : have_tiff=yes else have_tiff=no fi if test "$have_tiff" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFReadScanline in -ltiff" >&5 $as_echo_n "checking for TIFFReadScanline in -ltiff... " >&6; } if ${ac_cv_lib_tiff_TIFFReadScanline+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ltiff $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char TIFFReadScanline (); int main () { return TIFFReadScanline (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_tiff_TIFFReadScanline=yes else ac_cv_lib_tiff_TIFFReadScanline=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFReadScanline" >&5 $as_echo "$ac_cv_lib_tiff_TIFFReadScanline" >&6; } if test "x$ac_cv_lib_tiff_TIFFReadScanline" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBTIFF 1 _ACEOF LIBS="-ltiff $LIBS" fi if test "$ac_cv_lib_tiff_TIFFReadScanline" = yes; then GRAPHIC_LFLAGS="$with_tiff_library $GRAPHIC_LFLAGS" GRAPHIC_CFLAGS="$with_tiff_include $GRAPHIC_CFLAGS" else have_tiff=no fi fi if test "$have_tiff" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find libtiff header and/or library" >&5 $as_echo "$as_me: WARNING: Cannot find libtiff header and/or library" >&2;} echo "* The GUI library reqiures the TIFF library" echo "* Use --with-tiff-library to specify the tiff library" echo "* directory if it is not in the usual place(s)" echo "* You may also have to specify --with-jpeg-library if the jpeg" echo "* library is needed by tiff", as_fn_error $? "gnustep-gui will not compile without tiff" "$LINENO" 5 fi #-------------------------------------------------------------------- # Find PNG #-------------------------------------------------------------------- # Check whether --enable-png was given. if test "${enable_png+set}" = set; then : enableval=$enable_png; else enable_png=yes fi if test $enable_png = yes; then # use libpng-config if available # Extract the first word of "libpng-config", so it can be a program name with args. set dummy libpng-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_HAVE_LIBPNG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$HAVE_LIBPNG_CONFIG"; then ac_cv_prog_HAVE_LIBPNG_CONFIG="$HAVE_LIBPNG_CONFIG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HAVE_LIBPNG_CONFIG="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi HAVE_LIBPNG_CONFIG=$ac_cv_prog_HAVE_LIBPNG_CONFIG if test -n "$HAVE_LIBPNG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_LIBPNG_CONFIG" >&5 $as_echo "$HAVE_LIBPNG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$HAVE_LIBPNG_CONFIG" = "yes"; then PNG_CFLAGS="`libpng-config --I_opts`" PNG_LDFLAGS="`libpng-config --ldflags`" CPPFLAGS="${CPPFLAGS} $PNG_CFLAGS" LDFLAGS="$PNG_LDFLAGS ${LDFLAGS}" for ac_header in png.h do : ac_fn_c_check_header_mongrel "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default" if test "x$ac_cv_header_png_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PNG_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_sig_cmp in -lpng" >&5 $as_echo_n "checking for png_sig_cmp in -lpng... " >&6; } if ${ac_cv_lib_png_png_sig_cmp+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpng $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char png_sig_cmp (); int main () { return png_sig_cmp (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_png_png_sig_cmp=yes else ac_cv_lib_png_png_sig_cmp=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_sig_cmp" >&5 $as_echo "$ac_cv_lib_png_png_sig_cmp" >&6; } if test "x$ac_cv_lib_png_png_sig_cmp" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPNG 1 _ACEOF LIBS="-lpng $LIBS" fi if test "$ac_cv_search_png_sig_cmp" != no; then GRAPHIC_CFLAGS="$PNG_CFLAGS $GRAPHIC_CFLAGS" GRAPHIC_LFLAGS="$PNG_LDFLAGS $GRAPHIC_LFLAGS" $as_echo "#define HAVE_LIBPNG 1" >>confdefs.h fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't find libpng-config, guessing required headers and libraries." >&5 $as_echo "$as_me: WARNING: Can't find libpng-config, guessing required headers and libraries." >&2;} for ac_header in png.h do : ac_fn_c_check_header_mongrel "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default" if test "x$ac_cv_header_png_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PNG_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_sig_cmp in -lpng" >&5 $as_echo_n "checking for png_sig_cmp in -lpng... " >&6; } if ${ac_cv_lib_png_png_sig_cmp+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpng $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char png_sig_cmp (); int main () { return png_sig_cmp (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_png_png_sig_cmp=yes else ac_cv_lib_png_png_sig_cmp=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_sig_cmp" >&5 $as_echo "$ac_cv_lib_png_png_sig_cmp" >&6; } if test "x$ac_cv_lib_png_png_sig_cmp" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPNG 1 _ACEOF LIBS="-lpng $LIBS" fi fi if test "$ac_cv_lib_png_png_sig_cmp" = no && test "$ac_cv_search_png_sig_cmp" = no; then echo "GNUstep requires libpng to support PNG images, but this library" echo "can't be found. If you really want to compile GNUstep without" echo "PNG support, pass the --disable-png option to ./configure." echo "Note that this isn't recommended." as_fn_error $? "libpng not found." "$LINENO" 5 fi fi #-------------------------------------------------------------------- # Find additional image libs #-------------------------------------------------------------------- # Check whether --enable-ungif was given. if test "${enable_ungif+set}" = set; then : enableval=$enable_ungif; else enable_ungif=yes fi # Check whether --enable-libgif was given. if test "${enable_libgif+set}" = set; then : enableval=$enable_libgif; else enable_libgif=no fi if test "${enable_libgif}" = yes; then enable_ungif=no fi have_ungif=no if test "${enable_ungif}" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DGifOpen in -lungif" >&5 $as_echo_n "checking for DGifOpen in -lungif... " >&6; } if ${ac_cv_lib_ungif_DGifOpen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lungif $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char DGifOpen (); int main () { return DGifOpen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ungif_DGifOpen=yes else ac_cv_lib_ungif_DGifOpen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ungif_DGifOpen" >&5 $as_echo "$ac_cv_lib_ungif_DGifOpen" >&6; } if test "x$ac_cv_lib_ungif_DGifOpen" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBUNGIF 1 _ACEOF LIBS="-lungif $LIBS" fi if test "${ac_cv_lib_ungif_DGifOpen}" = yes; then have_ungif=yes fi if test "${with_x}" != no && test "${ac_cv_lib_ungif_DGifOpen}" = no; then orig_CPPFLAGS="${CPPFLAGS}" orig_LDFLAGS="${LDFLAGS}" orig_LIBS="${LIBS}" { $as_echo "$as_me:${as_lineno-$LINENO}: Checking if ungif is linked against -lX11" >&5 $as_echo "$as_me: Checking if ungif is linked against -lX11" >&6;} # This implies either that ungif is not installed at all, or that it # explicitly refers to the symbols defined in X11. Now see if the latter # is the case. CPPFLAGS="${CPPFLAGS} -I${ac_x_includes}" LDFLAGS="${LDFLAGS} -L${ac_x_libraries}" LIBS="${LIBS} -lX11" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DGifCloseFile in -lungif" >&5 $as_echo_n "checking for DGifCloseFile in -lungif... " >&6; } if ${ac_cv_lib_ungif_DGifCloseFile+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lungif $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char DGifCloseFile (); int main () { return DGifCloseFile (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ungif_DGifCloseFile=yes else ac_cv_lib_ungif_DGifCloseFile=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ungif_DGifCloseFile" >&5 $as_echo "$ac_cv_lib_ungif_DGifCloseFile" >&6; } if test "x$ac_cv_lib_ungif_DGifCloseFile" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBUNGIF 1 _ACEOF LIBS="-lungif $LIBS" fi if test "${ac_cv_lib_ungif_DGifCloseFile}" = no; then # This indicates ungif is not installed at all. The flags reverts to # the orignal value. CPPFLAGS="${orig_CPPFLAGS}" LDFLAGS="${orig_LDFLAGS}" LIBS="${orig_LIBS}" else # This indicates ungif actually refers to the X11's symbols. We modify # the flags so that -gui gets linked against the X11 library to support # ungif. { $as_echo "$as_me:${as_lineno-$LINENO}: -gui will be linked against -lX11 to support ungif images" >&5 $as_echo "$as_me: -gui will be linked against -lX11 to support ungif images" >&6;} GRAPHIC_CFLAGS="-I${ac_x_includes} $GRAPHIC_CFLAGS" GRAPHIC_LFLAGS="-L${ac_x_libraries} $GRAPHIC_LFLAGS" have_ungif=yes fi fi fi if test "$have_ungif" = no -o "${enable_libgif}" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DGifOpen in -lgif" >&5 $as_echo_n "checking for DGifOpen in -lgif... " >&6; } if ${ac_cv_lib_gif_DGifOpen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgif $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char DGifOpen (); int main () { return DGifOpen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_gif_DGifOpen=yes else ac_cv_lib_gif_DGifOpen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gif_DGifOpen" >&5 $as_echo "$ac_cv_lib_gif_DGifOpen" >&6; } if test "x$ac_cv_lib_gif_DGifOpen" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBGIF 1 _ACEOF LIBS="-lgif $LIBS" fi if test "${with_x}" != no && test "${ac_cv_lib_gif_DGifOpen}" = no; then orig_CPPFLAGS="${CPPFLAGS}" orig_LDFLAGS="${LDFLAGS}" orig_LIBS="${LIBS}" { $as_echo "$as_me:${as_lineno-$LINENO}: Checking if libgif is linked against -lX11" >&5 $as_echo "$as_me: Checking if libgif is linked against -lX11" >&6;} # This implies either that libgif is not installed at all, or that it # explicitly refers to the symbols defined in X11. Now see if the latter # is the case. CPPFLAGS="${CPPFLAGS} -I${ac_x_includes}" LDFLAGS="${LDFLAGS} -L${ac_x_libraries}" LIBS="${LIBS} -lX11" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DGifCloseFile in -lgif" >&5 $as_echo_n "checking for DGifCloseFile in -lgif... " >&6; } if ${ac_cv_lib_gif_DGifCloseFile+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgif $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char DGifCloseFile (); int main () { return DGifCloseFile (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_gif_DGifCloseFile=yes else ac_cv_lib_gif_DGifCloseFile=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gif_DGifCloseFile" >&5 $as_echo "$ac_cv_lib_gif_DGifCloseFile" >&6; } if test "x$ac_cv_lib_gif_DGifCloseFile" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBGIF 1 _ACEOF LIBS="-lgif $LIBS" fi if test "${ac_cv_lib_gif_DGifCloseFile}" = no; then # This indicates libgif is not installed at all. The flags reverts to # the orignal value. CPPFLAGS="${orig_CPPFLAGS}" LDFLAGS="${orig_LDFLAGS}" LIBS="${orig_LIBS}" else # This indicates libgif actually refers to the X11's symbols. We modify # the flags so that -gui gets linked against the X11 library to support # libgif. { $as_echo "$as_me:${as_lineno-$LINENO}: -gui will be linked against -lX11 to support libgif images" >&5 $as_echo "$as_me: -gui will be linked against -lX11 to support libgif images" >&6;} GRAPHIC_CFLAGS="-I${ac_x_includes} $GRAPHIC_CFLAGS" GRAPHIC_LFLAGS="-L${ac_x_libraries} $GRAPHIC_LFLAGS" fi fi fi # QuantizeBuffer was removed from giflib in version 4.2 but was reintroduced # in the 5.0 release with a new name. If this function is not present # we disable the support to create gif image representations. for ac_func in QuantizeBuffer do : ac_fn_c_check_func "$LINENO" "QuantizeBuffer" "ac_cv_func_QuantizeBuffer" if test "x$ac_cv_func_QuantizeBuffer" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_QUANTIZEBUFFER 1 _ACEOF fi done for ac_func in GifQuantizeBuffer do : ac_fn_c_check_func "$LINENO" "GifQuantizeBuffer" "ac_cv_func_GifQuantizeBuffer" if test "x$ac_cv_func_GifQuantizeBuffer" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GIFQUANTIZEBUFFER 1 _ACEOF fi done #-------------------------------------------------------------------- # Find ImageMagick #-------------------------------------------------------------------- # Check whether --enable-imagemagick was given. if test "${enable_imagemagick+set}" = set; then : enableval=$enable_imagemagick; fi if test "x$enable_imagemagick" = "xyes"; then : succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "$PKG_CONFIG" = "no" ; then echo "pkg-config script not be found" ## We don't want the user to see this warning ## echo "*** The pkg-config script could not be found. Make sure it is" ## echo "*** in your path, or set the PKG_CONFIG environment variable" ## echo "*** to the full path to pkg-config." ## echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MagickCore" >&5 $as_echo_n "checking for MagickCore... " >&6; } if $PKG_CONFIG --exists "MagickCore" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } succeeded=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking IMAGEMAGICK_CFLAGS" >&5 $as_echo_n "checking IMAGEMAGICK_CFLAGS... " >&6; } IMAGEMAGICK_CFLAGS=`$PKG_CONFIG --cflags "MagickCore"` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IMAGEMAGICK_CFLAGS" >&5 $as_echo "$IMAGEMAGICK_CFLAGS" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking IMAGEMAGICK_LIBS" >&5 $as_echo_n "checking IMAGEMAGICK_LIBS... " >&6; } IMAGEMAGICK_LIBS=`$PKG_CONFIG --libs "MagickCore"` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IMAGEMAGICK_LIBS" >&5 $as_echo "$IMAGEMAGICK_LIBS" >&6; } else IMAGEMAGICK_CFLAGS="" IMAGEMAGICK_LIBS="" ## If we have a custom action on failure, don't print errors, but ## do set a variable so people can do so. IMAGEMAGICK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "MagickCore"` fi else echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." echo "*** See http://www.freedesktop.org/software/pkgconfig" fi fi if test $succeeded = yes; then GRAPHIC_CFLAGS="$IMAGEMAGICK_CFLAGS $GRAPHIC_CFLAGS" GRAPHIC_LFLAGS="$IMAGEMAGICK_LIBS $GRAPHIC_LFLAGS" $as_echo "#define HAVE_IMAGEMAGICK 1" >>confdefs.h else $as_echo "#define HAVE_IMAGEMAGICK 0" >>confdefs.h fi fi #-------------------------------------------------------------------- # Check for International Components for Unicode # See DEPENDENCIES POLICY at the start of thsi file. #-------------------------------------------------------------------- HAVE_ICU=0 # Check whether --enable-icu was given. if test "${enable_icu+set}" = set; then : enableval=$enable_icu; else enable_icu=yes fi # Check whether --enable-icu-config was given. if test "${enable_icu_config+set}" = set; then : enableval=$enable_icu_config; else enable_icu_config=yes fi # Check whether --with-icu-library was given. if test "${with_icu_library+set}" = set; then : withval=$with_icu_library; icu_libdir="$withval" else icu_libdir="no" fi if test $enable_icu = yes; then if test "$enable_icu_config" = "yes"; then ok=no if test -z "$ICU_CONFIG"; then # Extract the first word of "icu-config", so it can be a program name with args. set dummy icu-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ICU_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ICU_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ICU_CONFIG="$ICU_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ICU_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ICU_CONFIG" && ac_cv_path_ICU_CONFIG="no" ;; esac fi ICU_CONFIG=$ac_cv_path_ICU_CONFIG if test -n "$ICU_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ICU_CONFIG" >&5 $as_echo "$ICU_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "$ICU_CONFIG" = "no" ; then echo "Could not find the icu-config script." echo "Please ensure that it is in your path." echo "See http://site.icu-project.org/ for help." else ICU_VERSION=`$ICU_CONFIG --version` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ICU >= 4.0" >&5 $as_echo_n "checking for ICU >= 4.0... " >&6; } found=`expr $ICU_VERSION \>= 4.0` if test "$found" = "1" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ok=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking ICU_LIBS" >&5 $as_echo_n "checking ICU_LIBS... " >&6; } ICU_LIBS=`$ICU_CONFIG --ldflags-libsonly` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ICU_LIBS" >&5 $as_echo "$ICU_LIBS" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking ICU_LDFLAGS" >&5 $as_echo_n "checking ICU_LDFLAGS... " >&6; } ICU_LDFLAGS=`$ICU_CONFIG --ldflags-searchpath` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ICU_LDFLAGS" >&5 $as_echo "$ICU_LDFLAGS" >&6; } else ICU_LIBS="" ICU_LDFLAGS="" ## Either perform custom action or print error message fi fi if test $ok = yes; then have_icu=yes else have_icu=no fi else have_icu=no; { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libicu (icu-config disabled)..." >&5 $as_echo "$as_me: checking for libicu (icu-config disabled)..." >&6;} if test "$icu_libdir" != "no"; then ICU_LDFLAGS="-L$icu_libdir"; fi saved_LDFLAGS="$LDFLAGS"; LDFLAGS="$LDFLAGS $LIBS $ICU_LDFLAGS -licui18n -licuuc -licudata -lm" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : have_icu="yes" else have_icu="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext; LDFLAGS="$saved_LDFLAGS"; ICU_LIBS="-licui18n -licuuc -licudata -lm" fi if test "$have_icu" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } for ac_header in unicode/uchar.h unicode/ustring.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done GRAPHIC_LFLAGS="$ICU_LDFLAGS $ICU_LIBS $GRAPHIC_LFLAGS" HAVE_ICU=1 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The International Components for Unicode (ICU) development headers and libraries do not appear to be available on this system." >&5 $as_echo "$as_me: WARNING: The International Components for Unicode (ICU) development headers and libraries do not appear to be available on this system." >&2;} fi fi #-------------------------------------------------------------------- # Check for the spelling lib, for the built-in spell checker... # Note: you might want to disable aspell on MacOSX, as it linkes in # Apple's libobjc.A, screwing up the links to the GNU libobjc. #-------------------------------------------------------------------- # Check whether --enable-aspell was given. if test "${enable_aspell+set}" = set; then : enableval=$enable_aspell; else enable_aspell=yes fi if test "$enable_aspell" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for new_aspell_document_checker in -laspell" >&5 $as_echo_n "checking for new_aspell_document_checker in -laspell... " >&6; } if ${ac_cv_lib_aspell_new_aspell_document_checker+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-laspell $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char new_aspell_document_checker (); int main () { return new_aspell_document_checker (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_aspell_new_aspell_document_checker=yes else ac_cv_lib_aspell_new_aspell_document_checker=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_aspell_new_aspell_document_checker" >&5 $as_echo "$ac_cv_lib_aspell_new_aspell_document_checker" >&6; } if test "x$ac_cv_lib_aspell_new_aspell_document_checker" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBASPELL 1 _ACEOF LIBS="-laspell $LIBS" fi fi if test "${ac_cv_lib_aspell_new_aspell_document_checker}" = yes; then for ac_header in aspell.h do : ac_fn_c_check_header_mongrel "$LINENO" "aspell.h" "ac_cv_header_aspell_h" "$ac_includes_default" if test "x$ac_cv_header_aspell_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ASPELL_H 1 _ACEOF fi done $as_echo "#define HAVE_ASPELL 1" >>confdefs.h fi #-------------------------------------------------------------------- # Check for ICNS library. #-------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for icns_read_family_from_file in -licns" >&5 $as_echo_n "checking for icns_read_family_from_file in -licns... " >&6; } if ${ac_cv_lib_icns_icns_read_family_from_file+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-licns $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char icns_read_family_from_file (); int main () { return icns_read_family_from_file (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_icns_icns_read_family_from_file=yes else ac_cv_lib_icns_icns_read_family_from_file=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_icns_icns_read_family_from_file" >&5 $as_echo "$ac_cv_lib_icns_icns_read_family_from_file" >&6; } if test "x$ac_cv_lib_icns_icns_read_family_from_file" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBICNS 1 _ACEOF LIBS="-licns $LIBS" fi #-------------------------------------------------------------------- # NSSound #-------------------------------------------------------------------- # Check whether --enable-sound was given. if test "${enable_sound+set}" = set; then : enableval=$enable_sound; else enable_sound=yes fi # Initialize to nothing... BUILD_SOUND= # Check for the headers... for ac_header in sndfile.h do : ac_fn_c_check_header_mongrel "$LINENO" "sndfile.h" "ac_cv_header_sndfile_h" "$ac_includes_default" if test "x$ac_cv_header_sndfile_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SNDFILE_H 1 _ACEOF have_sndfile=yes else have_sndfile=no fi done for ac_header in ao/ao.h do : ac_fn_c_check_header_mongrel "$LINENO" "ao/ao.h" "ac_cv_header_ao_ao_h" "$ac_includes_default" if test "x$ac_cv_header_ao_ao_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_AO_AO_H 1 _ACEOF have_ao=yes else have_ao=no fi done # Only if we have both... if test $have_sndfile = yes -a $have_ao = yes -a $enable_sound = yes; then BUILD_SOUND="sound" fi #-------------------------------------------------------------------- # NSSpeechSynthesizer #-------------------------------------------------------------------- # Check whether --enable-speech was given. if test "${enable_speech+set}" = set; then : enableval=$enable_speech; else enable_speech=yes fi BUILD_SPEECH= # has flite, for speech synthesis. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for new_utterance in -lflite" >&5 $as_echo_n "checking for new_utterance in -lflite... " >&6; } if ${ac_cv_lib_flite_new_utterance+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lflite $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char new_utterance (); int main () { return new_utterance (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_flite_new_utterance=yes else ac_cv_lib_flite_new_utterance=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_flite_new_utterance" >&5 $as_echo "$ac_cv_lib_flite_new_utterance" >&6; } if test "x$ac_cv_lib_flite_new_utterance" = xyes; then : have_speech=yes else have_speech=no fi for ac_header in flite/flite.h do : ac_fn_c_check_header_mongrel "$LINENO" "flite/flite.h" "ac_cv_header_flite_flite_h" "$ac_includes_default" if test "x$ac_cv_header_flite_flite_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FLITE_FLITE_H 1 _ACEOF fi done if test $have_speech = yes -a $enable_speech = yes; then BUILD_SPEECH="speech say" fi #-------------------------------------------------------------------- # Find CUPS #-------------------------------------------------------------------- GSCUPS_CFLAGS= GSCUPS_LDFLAGS= GSCUPS_LIBS= GSCUPS_DATADIR= BUILD_GSCUPS=NO # Check whether --enable-cups was given. if test "${enable_cups+set}" = set; then : enableval=$enable_cups; else enable_cups=yes fi if test $enable_cups = yes; then BUILD_GSCUPS=YES # Extract the first word of "cups-config", so it can be a program name with args. set dummy cups-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_have_cups+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$have_cups"; then ac_cv_prog_have_cups="$have_cups" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_have_cups="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_have_cups" && ac_cv_prog_have_cups="no" fi fi have_cups=$ac_cv_prog_have_cups if test -n "$have_cups"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_cups" >&5 $as_echo "$have_cups" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test $have_cups = no; then echo "Could not find cups-config program, cups printing support will not be built." enable_cups=no BUILD_GSCUPS=NO else GSCUPS_CFLAGS=`cups-config --cflags` GSCUPS_LDFLAGS=`cups-config --ldflags` GSCUPS_LIBS=`cups-config --libs` GSCUPS_DATADIR=`cups-config --datadir` orig_CPPFLAGS="${CPPFLAGS}" orig_LDFLAGS="${LDFLAGS}" CPPFLAGS="$GSCUPS_CFLAGS ${CPPFLAGS}" LDFLAGS="$GSCUPS_LDFLAGS ${LDFLAGS}" for ac_header in cups/cups.h do : ac_fn_c_check_header_mongrel "$LINENO" "cups/cups.h" "ac_cv_header_cups_cups_h" "$ac_includes_default" if test "x$ac_cv_header_cups_cups_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_CUPS_CUPS_H 1 _ACEOF have_cups=yes else have_cups=no fi done if test "$have_cups" = no; then enable_cups=no BUILD_GSCUPS=NO echo "Could not find cups.h, cups printing support will not be built." fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cupsServer in -lcups" >&5 $as_echo_n "checking for cupsServer in -lcups... " >&6; } if ${ac_cv_lib_cups_cupsServer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcups $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char cupsServer (); int main () { return cupsServer (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cups_cupsServer=yes else ac_cv_lib_cups_cupsServer=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cups_cupsServer" >&5 $as_echo "$ac_cv_lib_cups_cupsServer" >&6; } if test "x$ac_cv_lib_cups_cupsServer" = xyes; then : have_cups=yes else have_cups=no fi if test "$have_cups" = no; then enable_cups=no BUILD_GSCUPS=NO echo "Could not find the cups library, cups printing support will not be built." fi CPPFLAGS="${orig_CPPFLAGS}" LDFLAGS="${orig_LDFLAGS}" fi fi #-------------------------------------------------------------------- # Check for -Wdeclaration-after-statement #-------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wdeclaration-after-statement" >&5 $as_echo_n "checking whether the compiler supports -Wdeclaration-after-statement... " >&6; } saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wdeclaration-after-statement" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : HAS_W_DECL_AFTER_STATEMENT=yes else HAS_W_DECL_AFTER_STATEMENT=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$saved_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAS_W_DECL_AFTER_STATEMENT" >&5 $as_echo "$HAS_W_DECL_AFTER_STATEMENT" >&6; } if test x"$HAS_W_DECL_AFTER_STATEMENT" = x"yes"; then WARN_FLAGS="-Wall -Wdeclaration-after-statement" else WARN_FLAGS=-Wall fi #-------------------------------------------------------------------- # Record the version #-------------------------------------------------------------------- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the version of gnustep-gui we are compiling" >&5 $as_echo_n "checking for the version of gnustep-gui we are compiling... " >&6; } if test -f "Version"; then . ./Version fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNUSTEP_GUI_VERSION" >&5 $as_echo "$GNUSTEP_GUI_VERSION" >&6; } CONFIG_SYSTEM_INCL="$CONFIG_SYSTEM_INCL $GRAPHIC_CFLAGS" CONFIG_SYSTEM_LIB_DIR="$CONFIG_SYSTEM_LIB_DIR $GRAPHIC_LFLAGS" #-------------------------------------------------------------------- # Configure #-------------------------------------------------------------------- ac_config_files="$ac_config_files config.make gui.make Headers/Additions/GNUstepGUI/GSVersion.h" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Headers/Additions/GNUstepGUI/config.h") CONFIG_HEADERS="$CONFIG_HEADERS Headers/Additions/GNUstepGUI/config.h" ;; "config.make") CONFIG_FILES="$CONFIG_FILES config.make" ;; "gui.make") CONFIG_FILES="$CONFIG_FILES gui.make" ;; "Headers/Additions/GNUstepGUI/GSVersion.h") CONFIG_FILES="$CONFIG_FILES Headers/Additions/GNUstepGUI/GSVersion.h" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi gnustep-gui-0.24.0/Printing/0000775000076500007650000000000012256227331015537 5ustar brains99brains99gnustep-gui-0.24.0/Printing/GSCUPS/0000775000076500007650000000000012256227331016543 5ustar brains99brains99gnustep-gui-0.24.0/Printing/GSCUPS/GSCUPSPrincipalClass.h0000664000076500007650000000241311524032441022541 0ustar brains99brains99/** GSCUPSPrincipalClass Principal class for the GSCUPS Bundle. Copyright (C) 2004 Free Software Foundation, Inc. Author: Chad Hardin Date: October 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GSCUPSPRINCIPALCLASS_H_ #define _GSCUPSPRINCIPALCLASS_H_ #import "GNUstepGUI/GSPrinting.h" @interface GSCUPSPrincipalClass : GSPrintingPrincipalClass { } @end #endif // _GSCUPSPRINCIPALCLASS_H_ gnustep-gui-0.24.0/Printing/GSCUPS/GSCUPSPageLayout.h0000664000076500007650000000241611524032441021707 0ustar brains99brains99/** GSCUPSPageLayout Standard panel for querying user about page layout. Copyright (C) 2004 Free Software Foundation, Inc. Written By: Chad Hardin Date: October 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSCUPSPageLayout #define _GNUstep_H_GSCUPSPageLayout #import "AppKit/NSPageLayout.h" @interface GSCUPSPageLayout: NSPageLayout { } @end #endif // _GNUstep_H_GSCUPSPageLayout gnustep-gui-0.24.0/Printing/GSCUPS/GSCUPSPageLayout.m0000664000076500007650000000253711524032441021720 0ustar brains99brains99/** GSCUPSPageLayout Copyright (C) 2004 Free Software Foundation, Inc. Author: Chad Hardin Date: October 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import "GSCUPSPageLayout.h" @implementation GSCUPSPageLayout // // Class methods // + (void)initialize { if (self == [GSCUPSPageLayout class]) { // Initial version [self setVersion:1]; } } + (id) allocWithZone: (NSZone*)zone { return NSAllocateObject(self, 0, zone); } @end gnustep-gui-0.24.0/Printing/GSCUPS/GSCUPSPrintPanel.m0000664000076500007650000000241611524032441021716 0ustar brains99brains99/** GSCUPSPrintPanel Standard panel for querying user about printing. Copyright (C) 2004 Free Software Foundation, Inc. Author: Chad Hardin Date: October 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import "GSCUPSPrintPanel.h" @implementation GSCUPSPrintPanel // // Class methods // + (id) allocWithZone: (NSZone*)zone { return NSAllocateObject(self, 0, zone); } @end gnustep-gui-0.24.0/Printing/GSCUPS/GSCUPSPrintInfo.h0000664000076500007650000000242111524032441021541 0ustar brains99brains99/** GSCUPSPrintInfo Stores information used in printing. Copyright (C) 2004 Free Software Foundation, Inc. Author: Chad Hardin Date: October 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSCUPSPrintInfo #define _GNUstep_H_GSCUPSPrintInfo #import #import "AppKit/NSPrintInfo.h" @interface GSCUPSPrintInfo: NSPrintInfo { } @end #endif // _GNUstep_H_GSCUPSPrintInfo gnustep-gui-0.24.0/Printing/GSCUPS/GSCUPSPrintOperation.m0000664000076500007650000000702311537252607022632 0ustar brains99brains99/* GSCUPSPrintOperation.m Controls operations generating EPS, PDF or PS print jobs. Copyright (C) 2004 Free Software Foundation, Inc. Author: Chad Hardin Date: June 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #import #import #import #import #import #import #import #import #import #import #import "GSGuiPrivate.h" #import "GSCUPSPrintOperation.h" #include //A subclass of GSPrintOperation, NOT NSPrintOperation. @implementation GSCUPSPrintOperation // // Class methods // + (id) allocWithZone: (NSZone*)zone { return NSAllocateObject(self, 0, zone); } - (id)initWithView:(NSView *)aView printInfo:(NSPrintInfo *)aPrintInfo { self = [super initWithView: aView printInfo: aPrintInfo]; if (self == nil) return nil; _path = [NSTemporaryDirectory() stringByAppendingPathComponent: @"GSCUPSPrintJob-"]; _path = [_path stringByAppendingString: [[NSProcessInfo processInfo] globallyUniqueString]]; _path = [_path stringByAppendingPathExtension: @"ps"]; RETAIN(_path); return self; } - (BOOL) _deliverSpooledResult { NSString *name, *status; name = [[[self printInfo] printer] name]; status = [NSString stringWithFormat: _(@"Spooling to printer %@."), name]; [[self printPanel] _setStatusStringValue: status]; cupsPrintFile( [name UTF8String], [_path UTF8String], [_path UTF8String], 0, NULL ); return YES; } - (NSGraphicsContext*)createContext { NSMutableDictionary *info; NSString *output; if (_context) { NSDebugMLLog(@"GSPrinting", @"Already had context, returning it."); return _context; } NSDebugMLLog(@"GSPrinting", @"Creating context."); info = [[self printInfo] dictionary]; output = [info objectForKey: NSPrintSavePath]; if (output) { ASSIGN(_path, output); } NSDebugMLLog(@"GSPrinting", @"_path is %@", _path); [info setObject: _path forKey: @"NSOutputFile"]; if ([[[_path pathExtension] lowercaseString] isEqualToString: @"pdf"]) { [info setObject: NSGraphicsContextPDFFormat forKey: NSGraphicsContextRepresentationFormatAttributeName]; } else { [info setObject: NSGraphicsContextPSFormat forKey: NSGraphicsContextRepresentationFormatAttributeName]; } _context = RETAIN([NSGraphicsContext graphicsContextWithAttributes: info]); return _context; } @end gnustep-gui-0.24.0/Printing/GSCUPS/GSCUPSPrintPanel.h0000664000076500007650000000235611524032441021714 0ustar brains99brains99/* GSCUPSPrintPanel.h Standard panel to query users for info on a print job Copyright (C) 2004 Free Software Foundation, Inc. Author: Chad Hardin Date: October 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSCUPSPrintPanel #define _GNUstep_H_GSCUPSPrintPanel #import "AppKit/NSPrintPanel.h" @interface GSCUPSPrintPanel : NSPrintPanel { } @end #endif // _GNUstep_H_GSCUPSPrintPanel gnustep-gui-0.24.0/Printing/GSCUPS/GSCUPSPrinter.h0000664000076500007650000000243611524032441021262 0ustar brains99brains99/* GSCUPSPrinter.h Class representing a printer's or printer model's capabilities. Copyright (C) 2004 Free Software Foundation, Inc. Author: Chad Hardin Date: October 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSCUPSPrinter #define _GNUstep_H_GSCUPSPrinter #import "AppKit/NSPrinter.h" @class NSString; extern NSString *GSCUPSDummyPrinterName; @interface GSCUPSPrinter : NSPrinter { } @end #endif // _GNUstep_H_GSCUPSPrinter gnustep-gui-0.24.0/Printing/GSCUPS/GNUmakefile.preamble0000664000076500007650000000205310377004044022377 0ustar brains99brains99# # GNUmakefile.postamble # # Copyright (C) 2004 Free Software Foundation, Inc. # # Additional flags to pass to the preprocessor ADDITIONAL_CPPFLAGS += # Additional flags to pass to the Objective-C compiler ADDITIONAL_OBJCFLAGS += -Wall # Additional flags to pass to the C compiler ADDITIONAL_CFLAGS += $(GSCUPS_CFLAGS) # Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS += -I../../Headers/Additions -I../../Headers \ -I../../Source/$(GNUSTEP_TARGET_DIR) # Additional LDFLAGS to pass to the linker ADDITIONAL_LDFLAGS += $(GSCUPS_LDFLAGS) # Additional library directories the linker should search ADDITIONAL_LIB_DIRS += -L../../Source/$(GNUSTEP_OBJ_DIR) # Additional libraries # GNUstepWeb ADDITIONAL_GSW_LIBS += # GUI apps ADDITIONAL_GUI_LIBS += # Libraries ADDITIONAL_LIBRARY_LIBS += $(GSCUPS_LIBS) # ObjC stuff ADDITIONAL_OBJC_LIBS += #-lgnustep-gui $(SYSTEM_LIBS) # Tools ADDITIONAL_TOOL_LIBS += # WebObjects ADDITIONAL_WO_LIBS += # Additional directories to be created during installation #ADDITIONAL_INSTALL_DIRS += gnustep-gui-0.24.0/Printing/GSCUPS/GNUmakefile.postamble0000664000076500007650000000127710377004044022605 0ustar brains99brains99# # GNUmakefile.postamble # # Copyright (C) 2004 Free Software Foundation, Inc. # # Things to do before compiling # before-all:: # Things to do after compiling # after-all:: # Things to do before installing # before-install:: # Things to do after installing # after-install:: # Things to do before uninstalling # before-uninstall:: # Things to do after uninstalling # after-uninstall:: # Things to do before cleaning # before-clean:: # Things to do after cleaning # after-clean:: # Things to do before distcleaning # before-distclean:: # Things to do after distcleaning # after-distclean:: # Things to do before checking # before-check:: # Things to do after checking # after-check:: gnustep-gui-0.24.0/Printing/GSCUPS/GSCUPSPrintInfo.m0000664000076500007650000000573611524032441021562 0ustar brains99brains99/* GSCUPSPrintInfo.m Stores information used in printing Copyright (C) 2004 Free Software Foundation, Inc. Author: Chad Hardin Date: October 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import "AppKit/NSPrinter.h" #import "GSCUPSPrintInfo.h" #import "GSCUPSPrinter.h" #include @implementation GSCUPSPrintInfo // // Class methods // + (void)initialize { if (self == [GSCUPSPrintInfo class]) { // Initial version [self setVersion:1]; } } + (id) allocWithZone: (NSZone*)zone { return NSAllocateObject(self, 0, zone); } +(NSPrinter*) defaultPrinter { NSString *defaultName; int numDests; cups_dest_t* dests; cups_dest_t* dest = NULL; numDests = cupsGetDests( &dests ); if (dests) { // use NULL to request the default printer dest = cupsGetDest( NULL, NULL, numDests, dests ); } if (dest) { defaultName = [NSString stringWithCString: dest->name]; } else { defaultName = GSCUPSDummyPrinterName; } NSDebugLLog(@"GSCUPS", @"The default printer name is %@", defaultName); cupsFreeDests( numDests, dests ); return [NSPrinter printerWithName: defaultName]; } + (void)setDefaultPrinter:(NSPrinter *)printer { NSString* name; int numDests; cups_dest_t* dests; int n; BOOL found = NO; name = [printer name]; numDests = cupsGetDests( &dests ); for( n = 0; n < numDests; n++ ) { if( [name isEqualToString: [NSString stringWithCString: dests[n].name]] && dests[n].instance == NULL) { found = YES; break; } } if( found == NO ) { NSDebugMLLog(@"GSPrinting", @"Printer %@ not found", name); return; } for( n = 0; n < numDests; n++ ) { dests[n].is_default = 0; } for( n = 0; n < numDests; n++ ) { if( [name isEqualToString: [NSString stringWithCString: dests[n].name]] && dests[n].instance == NULL) { dests[n].is_default = 1; break; } } cupsSetDests( numDests, dests ); cupsFreeDests( numDests, dests ); } @end gnustep-gui-0.24.0/Printing/GSCUPS/GSCUPSPrincipalClass.m0000664000076500007650000000330211524032441022544 0ustar brains99brains99/* GSCUPSPrincipalClass.m Principal class for the GSCUPS Bundle Copyright (C) 2004 Free Software Foundation, Inc. Author: Chad Hardin Date: October 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import "GSCUPSPrincipalClass.h" #import "GSCUPSPageLayout.h" #import "GSCUPSPrintInfo.h" #import "GSCUPSPrintOperation.h" #import "GSCUPSPrintPanel.h" #import "GSCUPSPrinter.h" @implementation GSCUPSPrincipalClass // // Class methods // +(Class) pageLayoutClass { return [GSCUPSPageLayout class]; } +(Class) printInfoClass { return [GSCUPSPrintInfo class]; } +(Class) printOperationClass { return [GSCUPSPrintOperation class]; } +(Class) printPanelClass { return [GSCUPSPrintPanel class]; } +(Class) printerClass { return [GSCUPSPrinter class]; } +(Class) gsPrintOperationClass { return [GSCUPSPrintOperation class]; } @end gnustep-gui-0.24.0/Printing/GSCUPS/GNUmakefile0000664000076500007650000000462011122715377020622 0ustar brains99brains99# # GSCUPS Printing Backend Bundle makefile for GNUstep GUI Library # # Copyright (C) 2004 Free Software Foundation, Inc. # # Author: Chad Hardin or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-gui GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../../gui.make include $(GNUSTEP_MAKEFILES)/common.make include ../../config.make include ../../Version GNUSTEP_INSTALLATION_DIR=$(GNUSTEP_SYSTEM_ROOT) BUNDLE_NAME=GSCUPS BUNDLE_INSTALL_DIR= $(GNUSTEP_BUNDLES)/GSPrinting GSCUPS_PRINCIPAL_CLASS=GSCUPSPrincipalClass ifeq ($(GNUSTEP_TARGET_OS),mingw32) GSCUPS_BUNDLE_LIBS += -lgnustep-gui $(FND_LIBS) $(OBJC_LIBS) endif ifeq ($(GNUSTEP_TARGET_OS),cygwin) GSCUPS_BUNDLE_LIBS += -lgnustep-gui $(FND_LIBS) $(OBJC_LIBS) endif GSCUPS_BUNDLE_LIBS += $(GSCUPS_LIBS) # # Libraries # #GSCUPS_LIBRARIES_DEPEND_UPON += # # Resource files # #GSCUPS_RESOURCE_FILES = # # Header files # GSCUPS_HEADERS= \ GSCUPSPrincipalClass.m \ GSCUPSPageLayout.m \ GSCUPSPrintInfo.m \ GSCUPSPrintOperation \ GSCUPSPrintPanel.m \ GSCUPSPrinter.m # # Class files # GSCUPS_OBJC_FILES= \ GSCUPSPrincipalClass.m \ GSCUPSPageLayout.m \ GSCUPSPrintInfo.m \ GSCUPSPrintOperation.m \ GSCUPSPrintPanel.m \ GSCUPSPrinter.m # # C files # #GSCUPS_C_FILES = # # Languages # #GSCUPS_LANGUAGES= \ # English # # Localized Resource Files # #GSCUPS_LOCALIZED_RESOURCE_FILES= \ # GSCUPSPrintPanel.gorm \ # GSCUPSPageLayout.gorm # # Makefiles # -include GNUmakefile.preamble #include $(GNUSTEP_MAKEFILES)/aggregate.make include $(GNUSTEP_MAKEFILES)/bundle.make -include GNUmakefile.postamble gnustep-gui-0.24.0/Printing/GSCUPS/GSCUPSPrintOperation.h0000664000076500007650000000311211524032441022604 0ustar brains99brains99/** GSCUPSPrintOperation Controls generation of EPS, PDF or PS print jobs. Copyright (C) 2004 Free Software Foundation, Inc. Author: Chad Hardin Date: October 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSCUPSPrintOperation #define _GNUstep_H_GSCUPSPrintOperation #import "GNUstepGUI/GSPrintOperation.h" //GSPrintOperation is subclasses of GSPrintOperation, NOT NSPrintOperation. //NSPrintOperation does a lot of work that is pretty generic. //GSPrintOperation contains the method that does the actual //spooling. A future Win32 printing printing bundle //will likely have to implement much more @interface GSCUPSPrintOperation : GSPrintOperation { } @end #endif // _GNUstep_H_GSCUPSPrintOperation gnustep-gui-0.24.0/Printing/GSCUPS/GSCUPSPrinter.m0000664000076500007650000001007211537506203021270 0ustar brains99brains99/** GSCUPSPrinter Class representing a printer's or printer model's capabilities. Copyright (C) 2004 Free Software Foundation, Inc. Author: Chad Hardin Date: October 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* NB: * There are a few FIXMEs in the functionality left. * Parsing of the PPDs is somewhat suboptimal. * (I think it's best to leave optimisation until more of GNUstep is done). * The *OpenUI, *CloseUI, *OpenGroup and *CloseGroup are not processed. * (This is not required in the OpenStep standard, but could be useful). */ #import "config.h" #import #import #import #import #import #import #import #import #import "AppKit/AppKitExceptions.h" #import "AppKit/NSGraphics.h" #import "GNUstepGUI/GSPrinting.h" #import "GSCUPSPrinter.h" #include NSString *GSCUPSDummyPrinterName = @"GSCUPSDummyPrinter"; @implementation GSCUPSPrinter // // Class methods // +(void) initialize { if (self == [GSCUPSPrinter class]) { // Initial version [self setVersion:1]; } } +(id) allocWithZone: (NSZone*) zone { return NSAllocateObject(self, 0, zone); } // // Finding an NSPrinter // + (NSPrinter*) printerWithName: (NSString*) name { NSPrinter* printer; const char* ppdFile; if ([name isEqual: GSCUPSDummyPrinterName]) { /* Create a dummy printer as a fallback. */ static BOOL didWarn; NSString *ppdPath; if (!didWarn) { NSLog(@"Creating a default printer since no default printer has " @"been set in CUPS."); didWarn = YES; } ppdPath = [NSBundle pathForLibraryResource: @"Generic-PostScript_Printer-Postscript" ofType: @"ppd" inDirectory: @"PostScript/PPD"]; NSAssert(ppdPath, @"Couldn't find the PPD file for the fallback printer."); printer = [(GSCUPSPrinter*)[self alloc] initWithName: name withType: @"Unknown" withHost: @"Unknown" withNote: @"Automatically Generated"]; [printer parsePPDAtPath: ppdPath]; return AUTORELEASE(printer); } printer = [[GSCUPSPrinter alloc] initWithName: name withType: @"Type Unknown" withHost: @"Host Unknown" withNote: @"No Note"]; ppdFile = cupsGetPPD( [name UTF8String] ); if( ppdFile ) { [printer parsePPDAtPath: [NSString stringWithCString: ppdFile]]; unlink( ppdFile ); } else { NSLog(@"Printer %@ does not have a PPD!", name); } return AUTORELEASE(printer); } + (NSArray *)printerNames { NSMutableSet *set; int numDests; cups_dest_t* dests; int n; set = [[NSMutableSet alloc] init]; AUTORELEASE(set); numDests = cupsGetDests(&dests); for (n = 0; n < numDests; n++) { [set addObject: [NSString stringWithCString: dests[n].name]]; } cupsFreeDests(numDests, dests); // No printer found, return at least the dummy printer if ([set count] == 0) { [set addObject: GSCUPSDummyPrinterName]; } return [set allObjects]; } @end gnustep-gui-0.24.0/Printing/GNUmakefile0000664000076500007650000000251411122715377017616 0ustar brains99brains99# # Makefile for the GNUstep Printing Backend Bundles # # Copyright (C) 2004 Free Software Foundation, Inc. # # Author: Chad Hardin or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-gui include $(GNUSTEP_MAKEFILES)/common.make GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../gui.make include ../config.make include ../Version # # The list of subproject directories # SUBPROJECTS = \ GSLPR ifeq ($(BUILD_GSCUPS), YES) SUBPROJECTS += GSCUPS endif include $(GNUSTEP_MAKEFILES)/aggregate.make gnustep-gui-0.24.0/Printing/GSLPR/0000775000076500007650000000000012256227331016426 5ustar brains99brains99gnustep-gui-0.24.0/Printing/GSLPR/GSLPRPrintInfo.m0000664000076500007650000000571211524032441021322 0ustar brains99brains99/* GSLPRPrintInfo.m Stores information used in printing Copyright (C) 1996,1997,2004 Free Software Foundation, Inc. Author: Simon Frankau Date: July 1997 Modified for Printing Backend Support Author: Chad Hardin Date: June 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import "AppKit/NSPrinter.h" #import "GSLPRPrintInfo.h" @implementation GSLPRPrintInfo // // Class methods // + (void)initialize { if (self == [GSLPRPrintInfo class]) { // Initial version [self setVersion:1]; } } + (id) allocWithZone: (NSZone*)zone { return NSAllocateObject(self, 0, zone); } +(NSPrinter*) defaultPrinter { NSUserDefaults *defaults; NSString *name; NSDebugMLLog(@"GSPrinting", @"defaultPrinter"); defaults = [NSUserDefaults standardUserDefaults]; name = [defaults objectForKey: @"GSLPRDefaultPrinter"]; if (name == nil) { name = [[NSPrinter printerNames] objectAtIndex: 0]; } else { if ([NSPrinter printerWithName: name] == nil) { name = [[NSPrinter printerNames] objectAtIndex: 0]; } } return [NSPrinter printerWithName: name]; } + (void)setDefaultPrinter:(NSPrinter *)printer { NSUserDefaults *defaults; NSMutableDictionary *globalDomain; NSDebugMLLog(@"GSPrinting", @"setDefaultPrinter"); defaults = [NSUserDefaults standardUserDefaults]; globalDomain = (NSMutableDictionary*)[defaults persistentDomainForName: NSGlobalDomain]; if (globalDomain) { globalDomain = [globalDomain mutableCopy]; [globalDomain setObject: [printer name] forKey: @"GSLPRDefaultPrinter"]; [defaults setPersistentDomain: globalDomain forName: NSGlobalDomain]; RELEASE(globalDomain); } else { NSDebugMLLog(@"GSPrinting", @"(GSLPR) Could not save default printer named %@ to NSUserDefaults GSLPRDefaultPrinter in NSGlobalDomain.", [printer name]); } } @end gnustep-gui-0.24.0/Printing/GSLPR/GSLPRPageLayout.h0000664000076500007650000000261711524032441021460 0ustar brains99brains99/** GSLPRPageLayout Standard panel for querying user about page layout. Copyright (C) 2001,2004 Free Software Foundation, Inc. Written By: Adam Fedor Date: Oct 2001 Modified for Printing Backend Support Author: Chad Hardin Date: June 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSLPRPageLayout #define _GNUstep_H_GSLPRPageLayout #import "AppKit/NSPageLayout.h" @class NSPrintInfo; @class NSView; @interface GSLPRPageLayout: NSPageLayout { } @end #endif // _GNUstep_H_GSLPRPageLayout gnustep-gui-0.24.0/Printing/GSLPR/GSLPRPrintOperation.h0000664000076500007650000000352011524032441022355 0ustar brains99brains99/** GSLPRPrintOperation Controls generation of EPS, PDF or PS print jobs. Copyright (C) 1996,2004 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Fred Kiefer Date: November 2000 Updated to new specification Author: Adam Fedor Date: Oct 2001 Modified for Printing Backend Support Author: Chad Hardin Date: June 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSLPRPrintOperation #define _GNUstep_H_GSLPRPrintOperation #import "GNUstepGUI/GSPrintOperation.h" //GSPrintOperation is subclasses of GSPrintOperation, NOT NSPrintOperation. //NSPrintOperation does a lot of work that is pretty generic. //GSPrintOperation contains the method that does the actual //spooling. A future Win32 printing printing bundle //will likely have to implement much more @interface GSLPRPrintOperation : GSPrintOperation { } @end #endif // _GNUstep_H_GSLPRPrintOperation gnustep-gui-0.24.0/Printing/GSLPR/GSLPRPrincipalClass.m0000664000076500007650000000326011524032441022315 0ustar brains99brains99/* GSLPRPrincipalClass.m Principal class for the GSLPR Bundle Copyright (C) 2004 Free Software Foundation, Inc. Author: Chad Hardin Date: June 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import "GSLPRPrincipalClass.h" #import "GSLPRPageLayout.h" #import "GSLPRPrintInfo.h" #import "GSLPRPrintOperation.h" #import "GSLPRPrintPanel.h" #import "GSLPRPrinter.h" @implementation GSLPRPrincipalClass // // Class methods // +(Class) pageLayoutClass { return [GSLPRPageLayout class]; } +(Class) printInfoClass { return [GSLPRPrintInfo class]; } +(Class) printOperationClass { return [GSLPRPrintOperation class]; } +(Class) printPanelClass { return [GSLPRPrintPanel class]; } +(Class) printerClass { return [GSLPRPrinter class]; } +(Class) gsPrintOperationClass { return [GSLPRPrintOperation class]; } @end gnustep-gui-0.24.0/Printing/GSLPR/GSLPRPrinter.m0000664000076500007650000001120411524032441021026 0ustar brains99brains99/** GSLPRPrinter Class representing a printer's or printer model's capabilities. Copyright (C) 1996, 1997, 2004 Free Software Foundation, Inc. Authors: Simon Frankau Date: June 1997 Modified for Printing Backend Support Author: Chad Hardin Date: June 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* NB: * There are a few FIXMEs in the functionality left. * Parsing of the PPDs is somewhat suboptimal. * (I think it's best to leave optimisation until more of GNUstep is done). * The *OpenUI, *CloseUI, *OpenGroup and *CloseGroup are not processed. * (This is not required in the OpenStep standard, but could be useful). */ #include "config.h" #import #import #import #import #import #import #import #import "GSLPRPrinter.h" #import "GNUstepGUI/GSPrinting.h" @implementation GSLPRPrinter // // Class methods // +(void) initialize { if (self == [GSLPRPrinter class]) { // Initial version [self setVersion:1]; } } +(id) allocWithZone: (NSZone*) zone { return NSAllocateObject(self, 0, zone); } // // Finding an NSPrinter // + (NSPrinter*) printerWithName: (NSString*) name { NSDictionary* printersDict; NSDictionary* printerEntry; NSPrinter* printer; printersDict = [self printersDictionary]; printerEntry = [printersDict objectForKey: name]; if( printerEntry == nil) { [NSException raise: NSGenericException format: @"(GSLPR) Could not find printer named %@", name]; return nil; } NSDebugMLLog(@"GSPrinting", @"Creating NSPrinter with Printer Entry: %@", [printerEntry description]); printer = [(GSLPRPrinter*)[self alloc] initWithName: name withType: [printerEntry objectForKey: @"Type"] withHost: [printerEntry objectForKey: @"Host"] withNote: [printerEntry objectForKey: @"Note"]]; [printer parsePPDAtPath: [printerEntry objectForKey: @"PPDPath"]]; return AUTORELEASE(printer); } + (NSArray *)printerNames { return [[self printersDictionary] allKeys]; } // // Load the printer setup from NSUserDefaults // + (NSDictionary*) printersDictionary { static BOOL didWarn; NSUserDefaults* defaults; NSDictionary *printers; defaults = [NSUserDefaults standardUserDefaults]; printers = [defaults dictionaryForKey: @"GSLPRPrinters"]; if (!printers) //Not set, make a default printer because we are nice. { NSString *ppdPath; NSMutableDictionary *printerEntry; printers = [NSMutableDictionary dictionary]; printerEntry = [NSMutableDictionary dictionary]; ppdPath = [NSBundle pathForLibraryResource: @"Generic-PostScript_Printer-Postscript" ofType: @"ppd" inDirectory: @"PostScript/PPD"]; NSAssert(ppdPath, @"Couldn't find the PPD file for the fallback printer."); [printerEntry setObject: ppdPath forKey: @"PPDPath"]; [printerEntry setObject: @"localhost" forKey: @"Host"]; [printerEntry setObject: @"Automatically Generated" forKey: @"Note"]; [printerEntry setObject: @"Unknown" forKey: @"Type"]; [(NSMutableDictionary*)printers setObject: printerEntry forKey: @"Unnamed"]; [defaults setObject: printers forKey: @"GSLPRPrinters"]; [defaults synchronize]; if (!didWarn) { NSLog(@"Creating a default printer since no printer has been set " @"in the user defaults (under the GSLPRPrinters key)."); didWarn = YES; } } return printers; } @end gnustep-gui-0.24.0/Printing/GSLPR/GSLPRPrintPanel.m0000664000076500007650000000256211524032441021466 0ustar brains99brains99/** GSLPRPrintPanel Standard panel for querying user about printing. Copyright (C) 2001,2004 Free Software Foundation, Inc. Written By: Adam Fedor Date: Oct 2001 Modified for Printing Backend Support Author: Chad Hardin Date: June 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import "GSLPRPrintPanel.h" @implementation GSLPRPrintPanel // // Class methods // + (id) allocWithZone: (NSZone*)zone { return NSAllocateObject(self, 0, zone); } @end gnustep-gui-0.24.0/Printing/GSLPR/GNUmakefile.preamble0000664000076500007650000000177210377004044022271 0ustar brains99brains99# # GNUmakefile.postamble # # Copyright (C) 2004 Free Software Foundation, Inc. # # Additional flags to pass to the preprocessor ADDITIONAL_CPPFLAGS += # Additional flags to pass to the Objective-C compiler ADDITIONAL_OBJCFLAGS += -Wall # Additional flags to pass to the C compiler ADDITIONAL_CFLAGS += # Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS += -I../../Headers/Additions -I../../Headers \ -I../../Source/$(GNUSTEP_TARGET_DIR) # Additional LDFLAGS to pass to the linker ADDITIONAL_LDFLAGS += # Additional library directories the linker should search ADDITIONAL_LIB_DIRS += -L../../Source/$(GNUSTEP_OBJ_DIR) # Additional libraries # GNUstepWeb ADDITIONAL_GSW_LIBS += # GUI apps ADDITIONAL_GUI_LIBS += # Libraries ADDITIONAL_LIBRARY_LIBS += # ObjC stuff ADDITIONAL_OBJC_LIBS += #-lgnustep-gui $(SYSTEM_LIBS) # Tools ADDITIONAL_TOOL_LIBS += # WebObjects ADDITIONAL_WO_LIBS += # Additional directories to be created during installation #ADDITIONAL_INSTALL_DIRS += gnustep-gui-0.24.0/Printing/GSLPR/GSLPRPrincipalClass.h0000664000076500007650000000242711524032441022314 0ustar brains99brains99/** GSLPRPrincipalClass Principal class for the GSLPR Bundle. Copyright (C) 2004 Free Software Foundation, Inc. Author: Chad Hardin Date: June 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSLPRPrincipalClass #define _GNUstep_H_GSLPRPrincipalClass #import "GNUstepGUI/GSPrinting.h" @interface GSLPRPrincipalClass : GSPrintingPrincipalClass { } @end #endif // _GNUstep_H_GSLPRPrincipalClass gnustep-gui-0.24.0/Printing/GSLPR/GNUmakefile.postamble0000664000076500007650000000127710377004044022470 0ustar brains99brains99# # GNUmakefile.postamble # # Copyright (C) 2004 Free Software Foundation, Inc. # # Things to do before compiling # before-all:: # Things to do after compiling # after-all:: # Things to do before installing # before-install:: # Things to do after installing # after-install:: # Things to do before uninstalling # before-uninstall:: # Things to do after uninstalling # after-uninstall:: # Things to do before cleaning # before-clean:: # Things to do after cleaning # after-clean:: # Things to do before distcleaning # before-distclean:: # Things to do after distcleaning # after-distclean:: # Things to do before checking # before-check:: # Things to do after checking # after-check:: gnustep-gui-0.24.0/Printing/GSLPR/GSLPRPrinter.h0000664000076500007650000000257411524032441021033 0ustar brains99brains99/* GSLPRPrinter.h Class representing a printer's or printer model's capabilities. Copyright (C) 1996, 1997,2004 Free Software Foundation, Inc. Authors: Simon Frankau Date: June 1997 Modified for Printing Backend Support Author: Chad Hardin Date: June 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSLPRPrinter #define _GNUstep_H_GSLPRPrinter #import "AppKit/NSPrinter.h" @interface GSLPRPrinter : NSPrinter { } +(NSDictionary*) printersDictionary; @end #endif // _GNUstep_H_GSLPRPrinter gnustep-gui-0.24.0/Printing/GSLPR/GSLPRPrintInfo.h0000664000076500007650000000267211524032441021317 0ustar brains99brains99/** GSLPRPrintInfo Stores information used in printing. Copyright (C) 1996,1997,2004 Free Software Foundation, Inc. Author: Simon Frankau Date: July 1997 Author: Adam Fedor Date: Oct 2001 Modified for Printing Backend Support Author: Chad Hardin Date: June 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSLPRPrintInfo #define _GNUstep_H_GSLPRPrintInfo #import #import "AppKit/NSPrintInfo.h" @interface GSLPRPrintInfo: NSPrintInfo { } @end #endif // _GNUstep_H_GSLPRPrintInfo gnustep-gui-0.24.0/Printing/GSLPR/GSLPRPageLayout.m0000664000076500007650000000253011524032441021457 0ustar brains99brains99/** GSLPRPageLayout Copyright (C) 2004 Free Software Foundation, Inc. Author: Chad Hardin Date: June 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import "GSLPRPageLayout.h" @implementation GSLPRPageLayout // // Class methods // + (void)initialize { if (self == [GSLPRPageLayout class]) { // Initial version [self setVersion:1]; } } + (id) allocWithZone: (NSZone*)zone { return NSAllocateObject(self, 0, zone); } @end gnustep-gui-0.24.0/Printing/GSLPR/GNUmakefile0000664000076500007650000000441211122715377020504 0ustar brains99brains99# # GSLPR Printing Backend Bundle makefile for GNUstep GUI Library # # Copyright (C) 2004 Free Software Foundation, Inc. # # Author: Chad Hardin or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-gui GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../../gui.make include $(GNUSTEP_MAKEFILES)/common.make include ../../config.make include ../../Version BUNDLE_NAME=GSLPR BUNDLE_INSTALL_DIR= $(GNUSTEP_BUNDLES)/GSPrinting GSLPR_PRINCIPAL_CLASS=GSLPRPrincipalClass ifeq ($(GNUSTEP_TARGET_OS),mingw32) GSLPR_BUNDLE_LIBS += -lgnustep-gui $(FND_LIBS) $(OBJC_LIBS) endif ifeq ($(GNUSTEP_TARGET_OS),cygwin) GSLPR_BUNDLE_LIBS += -lgnustep-gui $(FND_LIBS) $(OBJC_LIBS) endif # # Libraries # #GSLPR_LIBRARIES_DEPEND_UPON += # # Resource files # #GSLPR_RESOURCE_FILES = # # Header files # GSLPR_HEADERS= \ GSLPRPrincipalClass.m \ GSLPRPageLayout.m \ GSLPRPrintInfo.m \ GSLPRPrintOperation \ GSLPRPrintPanel.m \ GSLPRPrinter.m # # Class files # GSLPR_OBJC_FILES= \ GSLPRPrincipalClass.m \ GSLPRPageLayout.m \ GSLPRPrintInfo.m \ GSLPRPrintOperation.m \ GSLPRPrintPanel.m \ GSLPRPrinter.m # # C files # #GSLPR_C_FILES = # # Languages # #GSLPR_LANGUAGES= \ # English # # Localized Resource Files # #GSLPR_LOCALIZED_RESOURCE_FILES= \ # GSLPRPrintPanel.gorm \ # GSLPRPageLayout.gorm # # Makefiles # -include GNUmakefile.preamble #include $(GNUSTEP_MAKEFILES)/aggregate.make include $(GNUSTEP_MAKEFILES)/bundle.make -include GNUmakefile.postamble gnustep-gui-0.24.0/Printing/GSLPR/GSLPRPrintPanel.h0000664000076500007650000000253611524032441021462 0ustar brains99brains99/* GSLPRPrintPanel.h Standard panel to query users for info on a print job Copyright (C) 1996,2004 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Modified for Printing Backend Support Author: Chad Hardin Date: June 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSLPRPrintPanel #define _GNUstep_H_GSLPRPrintPanel #import "AppKit/NSPrintPanel.h" @interface GSLPRPrintPanel : NSPrintPanel { } @end #endif // _GNUstep_H_GSLPRPrintPanel gnustep-gui-0.24.0/Printing/GSLPR/GSLPRPrintOperation.m0000664000076500007650000001023111537252607022373 0ustar brains99brains99/* GLPRSPrintOperation.m Controls operations generating EPS, PDF or PS print jobs. Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Fred Kiefer Date: November 2000 Started implementation. Modified for Printing Backend Support Author: Chad Hardin Date: June 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #import #import #import #import #import #import #import "AppKit/NSGraphicsContext.h" #import "AppKit/NSView.h" #import "AppKit/NSPrinter.h" #import "AppKit/NSPrintPanel.h" #import "AppKit/NSPrintInfo.h" #import "AppKit/NSPrintOperation.h" #import "GSGuiPrivate.h" #import "GSLPRPrintOperation.h" //A subclass of GSPrintOperation, NOT NSPrintOperation. @implementation GSLPRPrintOperation // // Class methods // + (id) allocWithZone: (NSZone*)zone { return NSAllocateObject(self, 0, zone); } - (id)initWithView:(NSView *)aView printInfo:(NSPrintInfo *)aPrintInfo { self = [super initWithView: aView printInfo: aPrintInfo]; if (self == nil) return nil; _path = [NSTemporaryDirectory() stringByAppendingPathComponent: @"GSLPRPrintJob-"]; _path = [_path stringByAppendingString: [[NSProcessInfo processInfo] globallyUniqueString]]; _path = [_path stringByAppendingPathExtension: @"ps"]; RETAIN(_path); return self; } - (BOOL) _deliverSpooledResult { int copies; NSDictionary *dict; NSTask *task; NSString *name, *status; NSMutableArray *args; name = [[[self printInfo] printer] name]; status = [NSString stringWithFormat: _(@"Spooling to printer %@."), name]; [[self printPanel] _setStatusStringValue: status]; dict = [[self printInfo] dictionary]; args = [NSMutableArray array]; copies = [[dict objectForKey: NSPrintCopies] intValue]; if (copies > 1) [args addObject: [NSString stringWithFormat: @"-#%0d", copies]]; if ([name isEqual: @"Unknown"] == NO) { [args addObject: @"-P"]; [args addObject: name]; } [args addObject: _path]; task = [NSTask new]; [task setLaunchPath: @"lpr"]; [task setArguments: args]; [task launch]; [task waitUntilExit]; AUTORELEASE(task); return YES; } - (NSGraphicsContext*)createContext { NSMutableDictionary *info; NSString *output; if (_context) { NSDebugMLLog(@"GSPrinting", @"Already had context, returning it."); return _context; } NSDebugMLLog(@"GSPrinting", @"Creating context."); info = [[self printInfo] dictionary]; output = [info objectForKey: NSPrintSavePath]; if (output) { ASSIGN(_path, output); } NSDebugMLLog(@"GSPrinting", @"_path is %@", _path); [info setObject: _path forKey: @"NSOutputFile"]; if ([[[_path pathExtension] lowercaseString] isEqualToString: @"pdf"]) { [info setObject: NSGraphicsContextPDFFormat forKey: NSGraphicsContextRepresentationFormatAttributeName]; } else { [info setObject: NSGraphicsContextPSFormat forKey: NSGraphicsContextRepresentationFormatAttributeName]; } _context = RETAIN([NSGraphicsContext graphicsContextWithAttributes: info]); return _context; } @end gnustep-gui-0.24.0/Tools/0000775000076500007650000000000012256227332015046 5ustar brains99brains99gnustep-gui-0.24.0/Tools/sound/0000775000076500007650000000000012256227332016176 5ustar brains99brains99gnustep-gui-0.24.0/Tools/sound/AudioOutputSink.m0000664000076500007650000000700411244260736021465 0ustar brains99brains99/* AudioOutputSink.m Sink audio data to libao. Copyright (C) 2009 Free Software Foundation, Inc. Written by: Stefan Bidigaray Date: Jun 2009 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include @interface AudioOutputSink : NSObject { ao_device *_dev; int _driver; ao_sample_format _format; } @end @implementation AudioOutputSink + (void) initialize { /* FIXME: According to the docs, this needs a corresponding ao_shutdown(). */ ao_initialize (); } + (BOOL)canInitWithPlaybackDevice: (NSString *)playbackDevice { // This is currently the only sink in NSSound, just say // YES to everything. /* FIXME: What is OS X's identifier for the main sound? */ return (playbackDevice == nil ? YES : NO); } - (void)dealloc { [super dealloc]; } - (id)initWithEncoding: (int)encoding channels: (NSUInteger)channelCount sampleRate: (NSUInteger)sampleRate byteOrder: (NSByteOrder)byteOrder { self = [super init]; if (self == nil) { return nil; } _format.channels = (int)channelCount; _format.rate = (int)sampleRate; switch (encoding) { case GSSoundFormatPCMS8: _format.bits = 8; break; case GSSoundFormatPCM16: _format.bits = 16; break; case GSSoundFormatPCM24: _format.bits = 24; break; case GSSoundFormatPCM32: _format.bits = 32; break; case GSSoundFormatFloat32: // Float and double not supported by libao. case GSSoundFormatFloat64: default: DESTROY(self); return nil; } if (byteOrder == NS_LittleEndian) { _format.byte_format = AO_FMT_LITTLE; } else if (byteOrder == NS_BigEndian) { _format.byte_format = AO_FMT_BIG; } else { _format.byte_format = AO_FMT_NATIVE; } return self; } - (BOOL)open { _driver = ao_default_driver_id(); _dev = ao_open_live(_driver, &_format, NULL); return ((_dev == NULL) ? NO : YES); } - (void)close { ao_close(_dev); } - (BOOL)playBytes: (void *)bytes length: (NSUInteger)length { int ret = ao_play(_dev, bytes, (uint_32)length); return (ret == 0 ? NO : YES); } /* Functionality not supported by libao */ - (void)setVolume: (float)volume { return; } - (float)volume { return 1.0; } - (void)setPlaybackDeviceIdentifier: (NSString *)playbackDeviceIdentifier { return; } - (NSString *)playbackDeviceIdentifier { return nil; } - (void)setChannelMapping: (NSArray *)channelMapping { return; } - (NSArray *)channelMapping { return nil; } @end gnustep-gui-0.24.0/Tools/sound/SndfileSource.m0000664000076500007650000001352212105272227021120 0ustar brains99brains99/* SndfileSource.m Load and read sound data using libsndfile. Copyright (C) 2009 Free Software Foundation, Inc. Written by: Stefan Bidigaray Date: Jun 2009 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include "GNUstepGUI/GSSoundSource.h" #include @interface SndfileSource : NSObject { NSData *_data; SNDFILE *_snd; SF_INFO _info; NSUInteger _curPos; NSTimeInterval _dur; int _encoding; } - (NSData *)data; - (NSUInteger)currentPosition; - (void)setCurrentPosition: (NSUInteger)curPos; @end /**********************************/ /* Sndfile virtual I/O functions. */ /**********************************/ static inline sf_count_t dataLength (void *user_data) { SndfileSource *snd = (SndfileSource *)user_data; return (sf_count_t)[[snd data] length]; } static inline sf_count_t dataSeek (sf_count_t offset, int whence, void *user_data) { SndfileSource *snd = (SndfileSource *)user_data; switch (whence) { case SEEK_SET: break; case SEEK_END: offset = (sf_count_t)[[snd data] length] + offset; break; case SEEK_CUR: offset = (sf_count_t)[snd currentPosition] + offset; break; default: return 0; } [snd setCurrentPosition: (NSUInteger)offset]; return (sf_count_t)[snd currentPosition]; } static inline sf_count_t dataRead (void *ptr, sf_count_t count, void *user_data) { NSUInteger newPos; SndfileSource *snd = (SndfileSource *)user_data; // Can't read more data that we have available... if (([snd currentPosition] + (NSUInteger)count) > [[snd data] length]) { count = (sf_count_t)([[snd data] length] - [snd currentPosition]); } newPos = [snd currentPosition] + (NSUInteger)count; [[snd data] getBytes: ptr range: NSMakeRange ([snd currentPosition], count)]; [snd setCurrentPosition: newPos]; return count; } static inline sf_count_t dataWrite (const void *ptr, sf_count_t count, void *user_data) { /* FIXME: No write support... do we even need it? */ return 0; } static inline sf_count_t dataTell (void *user_data) { SndfileSource *snd = (SndfileSource *)user_data; return (sf_count_t)[snd currentPosition]; } // The libsndfile virtual I/O function structure static SF_VIRTUAL_IO dataIO = { (sf_vio_get_filelen)dataLength, (sf_vio_seek)dataSeek, (sf_vio_read)dataRead, (sf_vio_write)dataWrite, (sf_vio_tell)dataTell }; /**********************************/ @implementation SndfileSource + (NSArray *)soundUnfilteredFileTypes { return [NSArray arrayWithObjects: @"wav", @"au", @"snd", @"aif", @"aiff", @"aifc", @"paf", @"sf", @"voc", @"w64", @"mat", @"mat4", @"mat5", @"pcf", @"xi", @"caf", @"sd2", @"iff", @"flac", @"ogg", @"oga", nil]; } + (NSArray *)soundUnfilteredTypes { /* FIXME: I'm not sure what the UTI for all the types above are. */ return [NSArray arrayWithObjects: @"com.microsoft.waveform-audio", @"public.ulaw-audio", @"public.aiff-audio", @"public.aifc-audio", @"com.apple.coreaudio-format", @"com.digidesign.sd2-audio", /* FIXME: are these right? */ @"org.xiph.flac-audio", @"org.xiph.vorbis-audio", nil]; } + (BOOL)canInitWithData: (NSData *)data { return YES; } - (void)dealloc { TEST_RELEASE (_data); sf_close (_snd); [super dealloc]; } - (id)initWithData: (NSData *)data { self = [super init]; if (self == nil) { return nil; } _data = data; RETAIN(_data); _info.format = 0; _snd = sf_open_virtual (&dataIO, SFM_READ, &_info, self); if (_snd == NULL) { DESTROY(self); return nil; } // Setup immutable values... /* FIXME: support multiple types */ _encoding = GSSoundFormatPCM16; _dur = (double)_info.frames / (double)_info.samplerate; return self; } - (NSUInteger)readBytes: (void *)bytes length: (NSUInteger)length { return (NSUInteger) (sf_read_short (_snd, bytes, (length>>1))<<1); } - (NSTimeInterval)duration { return _dur; } - (void)setCurrentTime: (NSTimeInterval)currentTime { sf_count_t frames = (sf_count_t)((double)_info.samplerate * currentTime); sf_seek (_snd, frames, SEEK_SET); } - (NSTimeInterval)currentTime { sf_count_t frames; frames = sf_seek (_snd, 0, SEEK_CUR); return (NSTimeInterval)((double)frames / (double)_info.samplerate); } - (int)encoding { return _encoding; } - (NSUInteger)channelCount { return (NSUInteger)_info.channels; } - (NSUInteger)sampleRate; { return (NSUInteger)_info.samplerate; } - (NSByteOrder)byteOrder { // Equivalent to sending native byte order... // Sndfile always reads as native format. return NS_UnknownByteOrder; } - (NSData *)data { return _data; } - (NSUInteger)currentPosition { return _curPos; } - (void)setCurrentPosition: (NSUInteger)curPos { _curPos = curPos; } @end gnustep-gui-0.24.0/Tools/sound/GSOSSSoundSink.m0000664000076500007650000001045711244333074021114 0ustar brains99brains99/* AudioOutputSink.m Sink audio data to the Open Sound System Copyright (C) 2009 Free Software Foundation, Inc. Written by: David Chisnall Date: Jun 2009 This file is part of the GNUstep GUI Library. */ #import #import #import #include #include #include #include #if SOUND_VERSION >= 0x040000 #define OSS_V4 #endif @interface GSOSSSoundSink : NSObject { NSString *devicePath; int dev; int channels; int format; int rate; } @end const static NSString *DefaultDevice = @"/dev/dsp"; @implementation GSOSSSoundSink + (BOOL)canInitWithPlaybackDevice: (NSString *)playbackDevice { if (NULL == playbackDevice) { playbackDevice = DefaultDevice; } const char *device = [playbackDevice UTF8String]; BOOL success = NO; int d = open(device, O_WRONLY, 0); if (-1 != d) { int ver; /* Check that this is an OSS device by trying an OSS ioctl on it */ success = (-1 != ioctl(d, OSS_GETVERSION, &ver)); close(d); } return success; } - (BOOL)configureDevice { /* Close the device if it's open already. */ [self close]; /* Open the device */ if (-1 == (dev = open([devicePath UTF8String], O_WRONLY, 0))) { return NO; } /* Set the number of channels */ if (-1 == ioctl(dev, SNDCTL_DSP_CHANNELS, &channels)) { [self close]; return NO; } /* Set the sample format. */ if (-1 == ioctl(dev, SNDCTL_DSP_SETFMT, &format)) { [self close]; return NO; } if (-1 == ioctl(dev, SNDCTL_DSP_SPEED, &rate)) { [self close]; return NO; } return YES; } - (id)initWithEncoding: (int)encoding channels: (NSUInteger)channelCount sampleRate: (NSUInteger)sampleRate byteOrder: (NSByteOrder)byteOrder { if (nil == (self = [super init])) { return nil; } channels = channelCount; rate = sampleRate; switch (encoding) { case GSSoundFormatPCMS8: format = AFMT_S8; break; case GSSoundFormatPCM16: switch (byteOrder) { case NS_LittleEndian: format = AFMT_S16_LE; break; case NS_BigEndian: format = AFMT_S16_BE; break; default: format = AFMT_S16_NE; } break; case GSSoundFormatPCM24: switch (byteOrder) { case NS_LittleEndian: format = AFMT_S24_LE; break; case NS_BigEndian: format = AFMT_S24_BE; break; default: format = AFMT_S24_NE; } break; case GSSoundFormatPCM32: switch (byteOrder) { case NS_LittleEndian: format = AFMT_S32_LE; break; case NS_BigEndian: format = AFMT_S32_BE; break; default: format = AFMT_S32_NE; } break; case GSSoundFormatFloat32: /* Some OSS implementations (e.g. FreeBSD) don't support AFMT_FLOAT) * Fall through to unsupported formats if this is one of them. */ #ifdef AFMT_FLOAT format = AFMT_FLOAT; break; #endif /* Does this even exist? */ case GSSoundFormatFloat64: default: [self release]; return nil; } /* Try to initialise this device */ if (![self configureDevice]) { [self release]; return nil; } return self; } - (BOOL)open { return [self configureDevice]; } - (void)close { if (-1 != dev) { close(dev); dev = -1; } } - (BOOL)playBytes: (void*)bytes length: (NSUInteger)length { do { int written = write(dev, bytes, (size_t)length); if (-1 == written) { return NO; } length -= written; bytes += written; } while (length > 0); return YES; } - (void)setVolume: (float)volume { #ifdef OSS_V4 char channelVolue = volume * 255; /* OSS uses one byte for left and one byte for right volume */ int vol = (channelVolue << 8) + channelVolue; ioctl(dev, SNDCTL_DSP_SETPLAYVOL, &vol); #endif } - (float)volume { #ifdef OSS_V4 int vol; if (-1 == ioctl(dev, SNDCTL_DSP_SETPLAYVOL, &vol)) { return 0; } /* Mask off the low 8 bits and scale back */ return ((float)(vol & 255) ) / 255; #else return 1; #endif } - (void)setPlaybackDeviceIdentifier: (NSString*)playbackDeviceIdentifier { ASSIGN(devicePath, playbackDeviceIdentifier); [self configureDevice]; } - (NSString*)playbackDeviceIdentifier { return devicePath; } /* Not implemented */ - (void)setChannelMapping: (NSArray*)channelMapping { return; } - (NSArray*)channelMapping { return nil; } @end gnustep-gui-0.24.0/Tools/sound/GNUmakefile0000664000076500007650000000142611244262636020255 0ustar brains99brains99PACKAGE_NAME = gnustep-gui include $(GNUSTEP_MAKEFILES)/common.make BUNDLE_NAME = Sndfile AudioOutput BUNDLE_EXTENSION = .nssound # These are here in case GNUstep is not installed, # otherwise compilation will fail. Sndfile_INCLUDE_DIRS += -I../../Headers \ -I../../Headers/Additions Sndfile_LIB_DIRS += \ -L../../Source/$(GNUSTEP_OBJ_DIR) AudioOutput_INCLUDE_DIRS += -I../../Headers \ -I../../Headers/Additions AudioOutput_LIB_DIRS += \ -L../../Source/$(GNUSTEP_OBJ_DIR) # Build the bundles. Sndfile_OBJC_FILES = SndfileSource.m AudioOutput_OBJC_FILES = AudioOutputSink.m Sndfile_PRINCIPAL_CLASS = SndfileSource AudioOutput_PRINCIPAL_CLASS = AudioOutputSink Sndfile_BUNDLE_LIBS = -lsndfile AudioOutput_BUNDLE_LIBS = -lao include $(GNUSTEP_MAKEFILES)/bundle.make gnustep-gui-0.24.0/Tools/.cvsignore0000664000076500007650000000001710377004044017037 0ustar brains99brains99*obj *.service gnustep-gui-0.24.0/Tools/say/0000775000076500007650000000000012256227332015642 5ustar brains99brains99gnustep-gui-0.24.0/Tools/say/say.m0000664000076500007650000000340211566442460016617 0ustar brains99brains99#import #include #include @interface SpeechDelegate : NSObject @end @implementation SpeechDelegate - (void)speechSynthesizer: (NSSpeechSynthesizer*)sender didFinishSpeaking: (BOOL)success { exit((int)success); } @end int main(int argc, char **argv) { NSAutoreleasePool * p = [NSAutoreleasePool new]; NSMutableString *words = nil; NSString *outFile = nil; NSString *voice = nil; NSString *inFile = nil; NSSpeechSynthesizer *say; int ch; int i; while ((ch = getopt(argc, argv, "o:v:f:")) != -1) { switch (ch) { case 'o': outFile = [NSString stringWithUTF8String: optarg]; break; case 'f': inFile = [NSString stringWithUTF8String: optarg]; break; case 'v': voice = [NSString stringWithUTF8String: optarg]; break; } } if (nil != inFile) { NSData *file = [NSData dataWithContentsOfFile: inFile]; words = [NSString stringWithCString: [file bytes]]; } else { words = [NSMutableString string]; for (i = optind ; i < argc ; i++) { [words appendString: [NSString stringWithUTF8String: argv[i]]]; [words appendString: @" "]; } } // Don't interrupt other apps. while ([NSSpeechSynthesizer isAnyApplicationSpeaking]) { [NSThread sleepForTimeInterval: 0.1]; } say = [[NSSpeechSynthesizer alloc] initWithVoice: voice]; [say setDelegate: [SpeechDelegate new]]; if (nil != outFile) { [say startSpeakingString: words toURL: [NSURL fileURLWithPath: outFile]]; } else { [say startSpeakingString: words]; } [[NSRunLoop currentRunLoop] run]; // Not reached. RELEASE(p); return 0; } gnustep-gui-0.24.0/Tools/say/GNUmakefile0000664000076500007650000000077612150764233017725 0ustar brains99brains99ETOILE_CORE_MODULE = YES include $(GNUSTEP_MAKEFILES)/common.make GSSPEECHENGINE = Flite VERSION = 0.1 TOOL_NAME = say say_LANGUAGES = English say_OBJC_FILES = \ say.m # Add include/lib dirs for currently built headers and libs. say_INCLUDE_DIRS += -I../../Headers -I../../Headers/Additions say_LIB_DIRS += -L../../Source/$(GNUSTEP_OBJ_DIR) \ -L/usr/local/lib #say_OBJCFLAGS += -std=c99 -g -Werror say_TOOL_LIBS += -lgnustep-gui -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/tool.make gnustep-gui-0.24.0/Tools/gopen.m0000664000076500007650000001440611344657622016347 0ustar brains99brains99/* This tool opens the appropriate application from the command line based on what type of file is being accessed. Copyright (C) 2001 Free Software Foundation, Inc. Written by: Gregory Casamento Created: November 2001 This file is part of the GNUstep Project This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static NSString* absolutePath(NSFileManager *fm, NSString *path) { path = [path stringByStandardizingPath]; if ([path isAbsolutePath] == NO) { path = [[fm currentDirectoryPath] stringByAppendingPathComponent: path]; } return path; } int main(int argc, char** argv, char **env_c) { CREATE_AUTORELEASE_POOL(pool); NSEnumerator *argEnumerator = nil; NSWorkspace *workspace = nil; NSFileManager *fm = nil; NSString *arg = nil; NSString *editor = nil; NSString *terminal = nil; NSString *application = nil; NSString *filetoopen = nil; NSString *filetoprint = nil; NSString *nxhost = nil; BOOL isDir; BOOL exists; NSURL *u; #ifdef GS_PASS_ARGUMENTS [NSProcessInfo initializeWithArguments:argv count:argc environment:env_c]; #endif argEnumerator = [[[NSProcessInfo processInfo] arguments] objectEnumerator]; workspace = [NSWorkspace sharedWorkspace]; fm = [NSFileManager defaultManager]; // Default applications for opening unregistered file types.... editor = [[NSUserDefaults standardUserDefaults] stringForKey: @"GSDefaultEditor"]; terminal = [[NSUserDefaults standardUserDefaults] stringForKey: @"GSDefaultTerminal"]; // Process options... application = [[NSUserDefaults standardUserDefaults] stringForKey: @"a"]; filetoopen = [[NSUserDefaults standardUserDefaults] stringForKey: @"o"]; filetoprint = [[NSUserDefaults standardUserDefaults] stringForKey: @"p"]; nxhost = [[NSUserDefaults standardUserDefaults] stringForKey: @"NXHost"]; if (application) { /* Start the application now, * later on we will use it for file opening. */ [workspace launchApplication: application]; } if (filetoopen) { exists = [fm fileExistsAtPath: arg isDirectory: &isDir]; if (exists == NO) { if ([filetoopen hasPrefix: @"/"] == NO && (u = [NSURL URLWithString: filetoopen]) != nil) { [workspace openURL: u]; } } else { filetoopen = absolutePath(fm, filetoopen); [workspace openFile: filetoopen withApplication: application]; } } if (filetoprint) { filetoprint = absolutePath(fm, filetoprint); puts("Not implemented"); } if (nxhost) { puts("Not implemented"); } if (argc == 1) { NSFileHandle *fh = [NSFileHandle fileHandleWithStandardInput]; NSData *data = [fh readDataToEndOfFile]; NSString *tempFile; int processId; tempFile = NSTemporaryDirectory(); tempFile = [tempFile stringByAppendingPathComponent: @"openfiletmp"]; processId = [[NSProcessInfo processInfo] processIdentifier]; tempFile = [tempFile stringByAppendingFormat: @"%d", processId]; tempFile = [tempFile stringByAppendingString: @".txt"]; [data writeToFile: tempFile atomically: YES]; [workspace openFile: tempFile withApplication: editor]; } [argEnumerator nextObject]; // skip the first element, which is empty. while ((arg = [argEnumerator nextObject]) != nil) { NSString *ext = [arg pathExtension]; if ([arg isEqualToString: @"-a"] || [arg isEqualToString: @"-o"] || [arg isEqualToString: @"-NXHost"]) { // skip since this is handled above... arg = [argEnumerator nextObject]; } else // no option specified { NS_DURING { exists = [fm fileExistsAtPath: arg isDirectory: &isDir]; if (exists == YES) { arg = absolutePath(fm, arg); if (isDir == NO && [fm isExecutableFileAtPath: arg]) { [workspace openFile: arg withApplication: terminal]; } else // no argument specified { // First check to see if it's an application if ([ext isEqualToString: @"app"] || [ext isEqualToString: @"debug"] || [ext isEqualToString: @"profile"]) { [workspace launchApplication: arg]; } else { if (![workspace openFile: arg withApplication: application]) { // no recognized extension, // run application indicated by environment var. NSLog(@"Opening %@ with %@",arg,editor); [workspace openFile: arg withApplication: editor]; } } } } else if ([arg hasPrefix: @"/"] == NO && (u = [NSURL URLWithString: arg]) != nil && [u scheme] != nil) { [workspace openURL: u]; } else { arg = absolutePath(fm, arg); GSPrintf(stdout, @"The file %@ does not exist.\n", arg); } } NS_HANDLER { NSLog(@"Exception while attempting open file %@ - %@: %@", arg, [localException name], [localException reason]); } NS_ENDHANDLER } } RELEASE(pool); exit(EXIT_SUCCESS); } gnustep-gui-0.24.0/Tools/GSspellInfo.plist0000664000076500007650000000025710377004044020307 0ustar brains99brains99 NSExtensions = {}; NSPrincipalClass = NSApplication; NSServices = ( { NSExecutable = GSspell; NSLanguages = (AmericanEnglish); NSSpellChecker = GNU; } ); gnustep-gui-0.24.0/Tools/GNUmakefile.preamble0000664000076500007650000000257110377004044020706 0ustar brains99brains99# # Makefile.preamble # # Project specific makefile variables, and additional # # Copyright (C) 2005 Free Software Foundation, Inc. # Do not put any Makefile rules in this file, instead they should # be put into Makefile.postamble. # # # Flags dealing with compiling and linking # # Additional flags to pass to the preprocessor # ADDITIONAL_CPPFLAGS += # Additional flags to pass to the Objective-C compiler # ADDITIONAL_OBJCFLAGS += # Additional flags to pass to the C compiler # ADDITIONAL_CFLAGS += # Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS += -I../Headers/Additions -I../Headers \ -I../Source/$(GNUSTEP_TARGET_DIR) # Additional LDFLAGS to pass to the linker # ADDITIONAL_LDFLAGS += # Additional library directories the linker should search ADDITIONAL_LIB_DIRS += -L../Source/$(GNUSTEP_OBJ_DIR) -L../Model/$(GNUSTEP_OBJ_DIR) # Additional libraries when linking tools gpbs_TOOL_LIBS += -lgnustep-gui $(SYSTEM_LIBS) set_show_service_TOOL_LIBS += -lgnustep-gui $(SYSTEM_LIBS) gopen_TOOL_LIBS += -lgnustep-gui $(SYSTEM_LIBS) gcloseall_TOOL_LIBS += -lgnustep-gui $(SYSTEM_LIBS) GSspell_TOOL_LIBS += $(ADDITIONAL_DEPENDS) # Additional libraries when linking applications # ADDITIONAL_GUI_LIBS += # # Flags dealing with installing and uninstalling # # Additional directories to be created during installation # ADDITIONAL_INSTALL_DIRS += gnustep-gui-0.24.0/Tools/make_services.m0000664000076500007650000010304312110762770020044 0ustar brains99brains99/* This tool builds a cache of service specifications like the NeXTstep/ OPENSTEP 'make_services' tool. In addition it builds a list of applications and services-bundles found in the standard directories. Copyright (C) 1998-2013 Free Software Foundation, Inc. Written by: Richard Frith-Macdonald Created: November 1998 This file is part of the GNUstep Project This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #import #import #import #import #import #import #import #import #import #import #import #import #import static void scanApplications(NSMutableDictionary *services, NSString *path); static void scanServices(NSMutableDictionary *services, NSString *path); static void scanDynamic(NSMutableDictionary *services, NSString *path); static NSMutableArray *validateEntry(id svcs, NSString* path); static NSMutableDictionary *validateService(NSDictionary *service, NSString* path, unsigned i); static NSString *appsName = @".GNUstepAppList"; static NSString *cacheName = @".GNUstepServices"; static int verbose = 1; static NSMutableDictionary *serviceMap; static NSMutableArray *filterList; static NSMutableSet *filterSet; static NSMutableDictionary *printMap; static NSMutableDictionary *spellMap; static NSMutableDictionary *applicationMap; static NSMutableDictionary *extensionsMap; static NSMutableDictionary *schemesMap; static Class aClass; static Class dClass; static Class sClass; static BOOL CheckDirectory(NSString *path, NSError **error) { NSFileManager *mgr; BOOL isDir; mgr = [NSFileManager defaultManager]; if ([mgr fileExistsAtPath: path isDirectory: &isDir] && isDir) { return YES; } else { return [mgr createDirectoryAtPath: path withIntermediateDirectories: YES attributes: nil error: error]; } } int main(int argc, char** argv, char **env_c) { NSAutoreleasePool *pool; NSData *data; NSProcessInfo *proc; NSFileManager *mgr; NSMutableDictionary *services; NSArray *args; NSString *usrRoot; NSString *str; unsigned index; NSMutableDictionary *fullMap; NSDictionary *oldMap; NSEnumerator *enumerator; NSString *path; NSError *error; #ifdef GS_PASS_ARGUMENTS [NSProcessInfo initializeWithArguments:argv count:argc environment:env_c]; #endif pool = [NSAutoreleasePool new]; mgr = [NSFileManager defaultManager]; aClass = [NSArray class]; dClass = [NSDictionary class]; sClass = [NSString class]; proc = [NSProcessInfo processInfo]; if (proc == nil) { NSLog(@"unable to get process information!"); exit(EXIT_SUCCESS); } [NSSerializer shouldBeCompact: YES]; serviceMap = [NSMutableDictionary dictionaryWithCapacity: 64]; filterList = [NSMutableArray arrayWithCapacity: 16]; filterSet = [NSMutableSet setWithCapacity: 64]; printMap = [NSMutableDictionary dictionaryWithCapacity: 8]; spellMap = [NSMutableDictionary dictionaryWithCapacity: 8]; applicationMap = [NSMutableDictionary dictionaryWithCapacity: 64]; extensionsMap = [NSMutableDictionary dictionaryWithCapacity: 64]; schemesMap = [NSMutableDictionary dictionaryWithCapacity: 64]; args = [proc arguments]; for (index = 1; index < [args count]; index++) { if ([[args objectAtIndex: index] isEqual: @"--verbose"]) { verbose++; } if ([[args objectAtIndex: index] isEqual: @"--quiet"]) { verbose--; } if ([[args objectAtIndex: index] isEqual: @"--help"]) { printf( "make_services builds a validated cache of service information for use by\n" "programs that want to use the OpenStep services facility.\n" "This cache is stored in '%s' in the users GNUstep directory.\n" "\n" "You may use 'make_services --test filename' to test that the property list\n" "in 'filename' contains a valid services definition.\n" "You may use 'make_services --verbose' to produce descriptive output.\n" "or --quiet to suppress any output (not recommended)\n", [cacheName cString]); exit(EXIT_SUCCESS); } if ([[args objectAtIndex: index] isEqual: @"--test"]) { while (++index < [args count]) { NSString *file = [args objectAtIndex: index]; NSDictionary *info; info = [NSDictionary dictionaryWithContentsOfFile: file]; if (info) { id svcs = [info objectForKey: @"NSServices"]; if (svcs) { validateEntry(svcs, file); } else if (verbose > 0) { NSLog(@"bad info - %@", file); } } else if (verbose > 0) { NSLog(@"bad info - %@", file); } } exit(EXIT_SUCCESS); } } services = [NSMutableDictionary dictionaryWithCapacity: 200]; /* * Make sure that the users 'Services' directory exists. */ usrRoot = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) lastObject]; usrRoot = [usrRoot stringByAppendingPathComponent: @"Services"]; if (!CheckDirectory(usrRoot, &error)) { if (verbose > 0) NSLog(@"couldn't create %@ error: %@", usrRoot, error); [pool drain]; exit(EXIT_FAILURE); } /* * Before doing the main scan, we examine the 'Services' directory to * see if any application has registered dynamic services - these take * precedence over any listed in an applications Info_gnustep.plist. */ scanDynamic(services, usrRoot); /* * Scan for application information in all standard locations. */ enumerator = [NSSearchPathForDirectoriesInDomains( NSAllApplicationsDirectory, NSAllDomainsMask, YES) objectEnumerator]; while ((path = [enumerator nextObject]) != nil) { if ([path hasPrefix: @"."] == NO) { scanApplications(services, path); } } /* * Scan for service information in all standard locations. */ enumerator = [NSSearchPathForDirectoriesInDomains( NSAllLibrariesDirectory, NSAllDomainsMask, YES) objectEnumerator]; while ((path = [enumerator nextObject]) != nil) { scanServices(services, [path stringByAppendingPathComponent: @"Services"]); } fullMap = [NSMutableDictionary dictionaryWithCapacity: 5]; [fullMap setObject: services forKey: @"ByPath"]; [fullMap setObject: serviceMap forKey: @"ByService"]; [fullMap setObject: filterList forKey: @"ByFilter"]; [fullMap setObject: printMap forKey: @"ByPrint"]; [fullMap setObject: spellMap forKey: @"BySpell"]; str = [usrRoot stringByAppendingPathComponent: cacheName]; if ([mgr fileExistsAtPath: str]) { data = [NSData dataWithContentsOfFile: str]; oldMap = [NSDeserializer deserializePropertyListFromData: data mutableContainers: NO]; } else { oldMap = nil; } if ([fullMap isEqual: oldMap] == NO) { data = [NSSerializer serializePropertyList: fullMap]; if ([data writeToFile: str atomically: YES] == NO) { if (verbose > 0) NSLog(@"couldn't write %@", str); exit(EXIT_FAILURE); } } str = [usrRoot stringByAppendingPathComponent: appsName]; if ([mgr fileExistsAtPath: str]) { data = [NSData dataWithContentsOfFile: str]; oldMap = [NSDeserializer deserializePropertyListFromData: data mutableContainers: NO]; } else { oldMap = nil; } [applicationMap setObject: extensionsMap forKey: @"GSExtensionsMap"]; [applicationMap setObject: schemesMap forKey: @"GSSchemesMap"]; if ([applicationMap isEqual: oldMap] == NO) { data = [NSSerializer serializePropertyList: applicationMap]; if ([data writeToFile: str atomically: YES] == NO) { if (verbose > 0) NSLog(@"couldn't write %@", str); exit(EXIT_FAILURE); } } exit(EXIT_SUCCESS); } /* * Load information about the shemes of URLs that an application supports. * For each scheme found, produce a dictionary, keyed by app name, that * contains dictionaries giving scheme info for that extension. * NB. in order to make schemes case-insensiteve - we always convert * to lowercase. */ static void addSchemesForApplication(NSDictionary *info, NSString *app) { unsigned int i; id o0; NSArray *a0; o0 = [info objectForKey: @"CFBundleURLTypes"]; if (o0) { if ([o0 isKindOfClass: aClass] == NO) { if (verbose > 0) NSLog(@"bad app CFBundleURLTypes (not an array) - %@", app); return; } a0 = (NSArray*)o0; i = [a0 count]; while (i-- > 0) { NSDictionary *t; NSArray *a1; id o1 = [a0 objectAtIndex: i]; unsigned int j; if ([o1 isKindOfClass: dClass] == NO) { if (verbose > 0) NSLog(@"bad app CFBundleURLTypes (type not a dictionary) - %@", app); return; } /* * Set 't' to the dictionary defining a particular file type. */ t = (NSDictionary*)o1; o1 = [t objectForKey: @"CFBundleURLSchemes"]; if (o1 == nil) { continue; } if ([o1 isKindOfClass: aClass] == NO) { if (verbose > 0) NSLog(@"bad app CFBundleURLTypes (schemes not an array) - %@", app); return; } a1 = (NSArray*)o1; j = [a1 count]; while (j-- > 0) { NSString *e; NSMutableDictionary *d; e = [[a1 objectAtIndex: j] lowercaseString]; if ([e length] == 0) { if (verbose > 0) NSLog(@"Illegal (nul) scheme ignored for - %@", app); return; } d = [schemesMap objectForKey: e]; if (d == nil) { d = [NSMutableDictionary dictionaryWithCapacity: 1]; [schemesMap setObject: d forKey: e]; } if ([d objectForKey: app] == nil) { [d setObject: t forKey: app]; } } } } } /* * Load information about the types of files that an application supports. * For each extension found, produce a dictionary, keyed by app name, that * contains dictionaries giving type info for that extension. * NB. in order to make extensions case-insensiteve - we always convert * to lowercase. */ static void addExtensionsForApplication(NSDictionary *info, NSString *app) { unsigned int i; id o0; NSArray *a0; o0 = [info objectForKey: @"NSTypes"]; if (o0 == nil) { o0 = [info objectForKey: @"CFBundleDocumentTypes"]; } if (o0) { if ([o0 isKindOfClass: aClass] == NO) { if (verbose > 0) NSLog(@"bad app NSTypes (not an array) - %@", app); return; } a0 = (NSArray*)o0; i = [a0 count]; while (i-- > 0) { NSDictionary *t; NSArray *a1; id o1 = [a0 objectAtIndex: i]; unsigned int j; if ([o1 isKindOfClass: dClass] == NO) { if (verbose > 0) NSLog(@"bad app NSTypes (type not a dictionary) - %@", app); return; } /* * Set 't' to the dictionary defining a particular file type. */ t = (NSDictionary*)o1; o1 = [t objectForKey: @"NSUnixExtensions"]; if (o1 == nil) { o1 = [t objectForKey: @"CFBundleTypeExtensions"]; } if (o1 == nil) { continue; } if ([o1 isKindOfClass: aClass] == NO) { if (verbose > 0) NSLog(@"bad app NSType (extensions not an array) - %@", app); return; } a1 = (NSArray*)o1; j = [a1 count]; while (j-- > 0) { NSString *e; NSMutableDictionary *d; e = [[a1 objectAtIndex: j] lowercaseString]; if ([e length] == 0) { if (verbose > 0) NSLog(@"Illegal (nul) extension ignored for - %@", app); return; } d = [extensionsMap objectForKey: e]; if (d == nil) { d = [NSMutableDictionary dictionaryWithCapacity: 1]; [extensionsMap setObject: d forKey: e]; } if ([d objectForKey: app] == nil) { [d setObject: t forKey: app]; } } } } else { NSDictionary *extensions; o0 = [info objectForKey: @"NSExtensions"]; if (o0 == nil) { o0 = [info objectForKey: @"CFBundleTypeExtensions"]; } if (o0 == nil) { return; } if ([o0 isKindOfClass: dClass] == NO) { if (verbose > 0) NSLog(@"bad app NSExtensions (not a dictionary) - %@", app); return; } extensions = (NSDictionary *) o0; a0 = [extensions allKeys]; i = [a0 count]; while (i-- > 0) { id tmp = [extensions objectForKey: [a0 objectAtIndex: i]]; id name; id dict; if ([tmp isKindOfClass: dClass] == NO) { if (verbose > 0) NSLog(@"bad app NSExtensions (value isn't a dictionary) - %@", app); continue; } name = [[a0 objectAtIndex: i] lowercaseString]; dict = [extensionsMap objectForKey: name]; if (dict == nil) { dict = [NSMutableDictionary dictionaryWithCapacity: 1]; } [dict setObject: tmp forKey: app]; [extensionsMap setObject: dict forKey: name]; } } } #if 0 // UNUSED static void scanDirectory(NSMutableDictionary *services, NSString *path) { NSFileManager *mgr = [NSFileManager defaultManager]; NSAutoreleasePool *arp = [NSAutoreleasePool new]; NSArray *contents = [mgr directoryContentsAtPath: path]; unsigned index; for (index = 0; index < [contents count]; index++) { NSString *name = [contents objectAtIndex: index]; NSString *ext = [name pathExtension]; NSString *newPath; BOOL isDir; /* * Ignore anything with a leading dot. */ if ([name hasPrefix: @"."] == YES) { continue; } if (ext != nil && ([ext isEqualToString: @"app"] || [ext isEqualToString: @"debug"] || [ext isEqualToString: @"profile"])) { newPath = [path stringByAppendingPathComponent: name]; newPath = [newPath stringByStandardizingPath]; if ([mgr fileExistsAtPath: newPath isDirectory: &isDir] && isDir) { NSString *oldPath; NSBundle *bundle; NSDictionary *info; /* * All application paths are noted by name * in the 'applicationMap' dictionary. */ if ((oldPath = [applicationMap objectForKey: name]) == nil) { [applicationMap setObject: newPath forKey: name]; } else { /* * If we already have an entry for an application with * this name, we skip this one - the first one takes * precedence. */ if (verbose > 0) NSLog(@"duplicate app (%@) at '%@' and '%@'", name, oldPath, newPath); continue; } bundle = [NSBundle bundleWithPath: newPath]; info = [bundle infoDictionary]; if (info) { id obj; /* * Load and validate any services definitions. */ obj = [info objectForKey: @"NSServices"]; if (obj) { NSMutableArray *entry; entry = validateEntry(obj, newPath); if (entry) { [services setObject: entry forKey: newPath]; } } addExtensionsForApplication(info, name); addSchemesForApplication(info, name); } else if (verbose > 0) { NSLog(@"bad app info - %@", newPath); } } else if (verbose > 0) { NSLog(@"bad application - %@", newPath); } } else if (ext != nil && [ext isEqualToString: @"service"]) { newPath = [path stringByAppendingPathComponent: name]; newPath = [newPath stringByStandardizingPath]; if ([mgr fileExistsAtPath: newPath isDirectory: &isDir] && isDir) { NSBundle *bundle; NSDictionary *info; bundle = [NSBundle bundleWithPath: newPath]; info = [bundle infoDictionary]; if (info) { id svcs = [info objectForKey: @"NSServices"]; if (svcs) { NSMutableArray *entry; entry = validateEntry(svcs, newPath); if (entry) { [services setObject: entry forKey: newPath]; } } else if (verbose > 0) { NSLog(@"missing info - %@", newPath); } } else if (verbose > 0) { NSLog(@"bad service info - %@", newPath); } } else if (verbose > 0) { NSLog(@"bad services bundle - %@", newPath); } } else { newPath = [path stringByAppendingPathComponent: name]; newPath = [newPath stringByStandardizingPath]; if ([mgr fileExistsAtPath: newPath isDirectory: &isDir] && isDir) { scanDirectory(services, newPath); } } } [arp release]; } #endif static void scanApplications(NSMutableDictionary *services, NSString *path) { NSFileManager *mgr = [NSFileManager defaultManager]; NSAutoreleasePool *arp = [NSAutoreleasePool new]; NSArray *contents = [mgr directoryContentsAtPath: path]; unsigned index; for (index = 0; index < [contents count]; index++) { NSString *name = [contents objectAtIndex: index]; NSString *ext = [name pathExtension]; NSString *newPath; BOOL isDir; /* * Ignore anything with a leading dot. */ if ([name hasPrefix: @"."] == YES) { continue; } if (ext != nil && ([ext isEqualToString: @"app"] || [ext isEqualToString: @"debug"] || [ext isEqualToString: @"profile"])) { newPath = [path stringByAppendingPathComponent: name]; newPath = [newPath stringByStandardizingPath]; if ([mgr fileExistsAtPath: newPath isDirectory: &isDir] && isDir) { NSString *oldPath; NSBundle *bundle; NSDictionary *info; /* * All application paths are noted by name * in the 'applicationMap' dictionary. */ if ((oldPath = [applicationMap objectForKey: name]) == nil) { [applicationMap setObject: newPath forKey: name]; } else { /* * If we already have an entry for an application with * this name, we skip this one - the first one takes * precedence. */ if (verbose > 0) NSLog(@"duplicate app (%@) at '%@' and '%@'", name, oldPath, newPath); continue; } bundle = [NSBundle bundleWithPath: newPath]; info = [bundle infoDictionary]; if (info) { id obj; /* * Load and validate any services definitions. */ obj = [info objectForKey: @"NSServices"]; if (obj) { NSMutableArray *entry; entry = validateEntry(obj, newPath); if (entry) { [services setObject: entry forKey: newPath]; } } addExtensionsForApplication(info, name); addSchemesForApplication(info, name); } else if (verbose > 0) { NSLog(@"bad app info - %@", newPath); } } else if (verbose > 0) { NSLog(@"bad application - %@", newPath); } } else { newPath = [path stringByAppendingPathComponent: name]; newPath = [newPath stringByStandardizingPath]; if ([mgr fileExistsAtPath: newPath isDirectory: &isDir] && isDir) { scanApplications(services, newPath); } } } [arp drain]; } static void scanDynamic(NSMutableDictionary *services, NSString *path) { NSFileManager *mgr = [NSFileManager defaultManager]; NSAutoreleasePool *arp = [NSAutoreleasePool new]; NSArray *contents = [mgr directoryContentsAtPath: path]; unsigned index; for (index = 0; index < [contents count]; index++) { NSString *name = [contents objectAtIndex: index]; NSString *infPath; NSDictionary *info; /* * Ignore anything with a leading dot. */ if ([name hasPrefix: @"."]) { continue; } /* *.service bundles are handled in scanDirectory */ if ([[name pathExtension] isEqualToString: @"service"]) continue; infPath = [path stringByAppendingPathComponent: name]; info = [NSDictionary dictionaryWithContentsOfFile: infPath]; if (info) { id svcs = [info objectForKey: @"NSServices"]; if (svcs) { NSMutableArray *entry; entry = validateEntry(svcs, infPath); if (entry) { [services setObject: entry forKey: infPath]; } } } else if (verbose > 0) { NSLog(@"bad app info - %@", infPath); } } [arp drain]; } static void scanServices(NSMutableDictionary *services, NSString *path) { NSFileManager *mgr = [NSFileManager defaultManager]; NSAutoreleasePool *arp = [NSAutoreleasePool new]; NSArray *contents = [mgr directoryContentsAtPath: path]; unsigned index; for (index = 0; index < [contents count]; index++) { NSString *name = [contents objectAtIndex: index]; NSString *ext = [name pathExtension]; NSString *newPath; BOOL isDir; /* * Ignore anything with a leading dot. */ if ([name hasPrefix: @"."] == YES) { continue; } if (ext != nil && [ext isEqualToString: @"service"]) { newPath = [path stringByAppendingPathComponent: name]; newPath = [newPath stringByStandardizingPath]; if ([mgr fileExistsAtPath: newPath isDirectory: &isDir] && isDir) { NSBundle *bundle; NSDictionary *info; bundle = [NSBundle bundleWithPath: newPath]; info = [bundle infoDictionary]; if (info) { id svcs = [info objectForKey: @"NSServices"]; if (svcs) { NSMutableArray *entry; entry = validateEntry(svcs, newPath); if (entry) { [services setObject: entry forKey: newPath]; } } else if (verbose > 0) { NSLog(@"missing info - %@", newPath); } } else if (verbose > 0) { NSLog(@"bad service info - %@", newPath); } } else if (verbose > 0) { NSLog(@"bad services bundle - %@", newPath); } } else { newPath = [path stringByAppendingPathComponent: name]; newPath = [newPath stringByStandardizingPath]; if ([mgr fileExistsAtPath: newPath isDirectory: &isDir] && isDir) { scanServices(services, newPath); } } } [arp drain]; } static NSMutableArray* validateEntry(id svcs, NSString *path) { NSMutableArray *newServices; NSArray *services; unsigned pos; if ([svcs isKindOfClass: aClass] == NO) { if (verbose > 0) NSLog(@"NSServices entry not an array - %@", path); return nil; } services = (NSArray*)svcs; newServices = [NSMutableArray arrayWithCapacity: [services count]]; for (pos = 0; pos < [services count]; pos++) { id svc; svc = [services objectAtIndex: pos]; if ([svc isKindOfClass: dClass]) { NSDictionary *service = (NSDictionary*)svc; NSMutableDictionary *newService; newService = validateService(service, path, pos); if (newService) { [newServices addObject: newService]; } } else if (verbose > 0) { NSLog(@"NSServices entry %u not a dictionary - %@", pos, path); } } return newServices; } static NSMutableDictionary* validateService(NSDictionary *service, NSString *path, unsigned pos) { static NSDictionary *fields = nil; NSEnumerator *e; NSMutableDictionary *result; NSString *k; id obj; if (fields == nil) { fields = [NSDictionary dictionaryWithObjectsAndKeys: @"string", @"NSMessage", @"string", @"NSPortName", @"array", @"NSSendTypes", @"array", @"NSReturnTypes", @"dictionary", @"NSMenuItem", @"dictionary", @"NSKeyEquivalent", @"string", @"NSUserData", @"string", @"NSTimeout", @"string", @"NSHost", @"string", @"NSExecutable", @"string", @"NSFilter", @"string", @"NSInputMechanism", @"string", @"NSPrintFilter", @"string", @"NSDeviceDependent", @"array", @"NSLanguages", @"string", @"NSSpellChecker", nil]; [fields retain]; } result = [NSMutableDictionary dictionaryWithCapacity: [service count]]; /* * Step through and check that each field is a known one and of the * correct type. */ e = [service keyEnumerator]; while ((k = [e nextObject]) != nil) { NSString *type = [fields objectForKey: k]; if (type == nil) { if (verbose > 0) NSLog(@"NSServices entry %u spurious field (%@)- %@", pos, k, path); } else { obj = [service objectForKey: k]; if ([type isEqualToString: @"string"]) { if ([obj isKindOfClass: sClass] == NO) { if (verbose > 0) NSLog(@"NSServices entry %u field %@ is not a string " @"- %@", pos, k, path); return nil; } [result setObject: obj forKey: k]; } else if ([type isEqualToString: @"array"]) { NSArray *a; if ([obj isKindOfClass: aClass] == NO) { if (verbose > 0) NSLog(@"NSServices entry %u field %@ is not an array " @"- %@", pos, k, path); return nil; } a = (NSArray*)obj; if ([a count] == 0) { if (verbose > 0) NSLog(@"NSServices entry %u field %@ is an empty array " @"- %@", pos, k, path); } else { unsigned i; for (i = 0; i < [a count]; i++) { if ([[a objectAtIndex: i] isKindOfClass: sClass] == NO) { if (verbose > 0) NSLog(@"NSServices entry %u field %@ element %u is " @"not a string - %@", pos, k, i, path); return nil; } } [result setObject: a forKey: k]; } } else if ([type isEqualToString: @"dictionary"]) { NSDictionary *d; if ([obj isKindOfClass: dClass] == NO) { if (verbose > 0) NSLog(@"NSServices entry %u field %@ is not a dictionary " @"- %@", pos, k, path); return nil; } d = (NSDictionary*)obj; if ([d objectForKey: @"default"] == nil) { if (verbose > 0) NSLog(@"NSServices entry %u field %@ has no default value " @"- %@", pos, k, path); } else { NSEnumerator *e = [d objectEnumerator]; while ((obj = [e nextObject]) != nil) { if ([obj isKindOfClass: sClass] == NO) { if (verbose > 0) NSLog(@"NSServices entry %u field %@ contains " @"non-string value - %@", pos, k, path); return nil; } } } [result setObject: d forKey: k]; } } } /* * Record in this service dictionary where it is to be found. */ [result setObject: path forKey: @"ServicePath"]; /* * Now check that we have the required fields for the service. */ if ((obj = [result objectForKey: @"NSFilter"]) != nil) { NSString *str; NSArray *snd; NSArray *ret; BOOL notPresent = NO; snd = [result objectForKey: @"NSSendTypes"]; ret = [result objectForKey: @"NSReturnTypes"]; str = [result objectForKey: @"NSInputMechanism"]; if (str != nil) { if ([str isEqualToString: @"NSUnixStdio"] == YES || [str isEqualToString: @"NSMapFile"] == YES) { unsigned i = [snd count]; while (i-- > 0) { str = [snd objectAtIndex: i]; /* For UNIX I/O or file mapping, the send type must be a * filename ... which means it must either be the generic * filenames pasteboard type, or one of the pasteboard * types corresponding to names for a particular file type. */ if (NO == [str isEqual: @"NSFilenamesPboardType"] && NO == [str hasPrefix: @"NSTypedFilenamesPboardType:"]) { if (verbose > 0) { NSLog(@"NSServices entry %u bad NSSendTypes " @"(must be file names types) - %@", pos, path); } } } } else if ([str isEqualToString: @"NSIdentity"] == NO) { if (verbose > 0) { NSLog(@"NSServices entry %u bad input mechanism - %@", pos, path); } return nil; } } else if ([result objectForKey: @"NSPortName"] == nil) { if (verbose > 0) NSLog(@"NSServices entry %u NSPortName missing - %@", pos, path); return nil; } if ([snd count] == 0 || [ret count] == 0) { if (verbose > 0) NSLog(@"NSServices entry %u types empty or missing - %@", pos, path); return nil; } else { unsigned i = [snd count]; /* * See if this filter handles any send/return combination * which is not alreadly present. */ while (notPresent == NO && i-- > 0) { unsigned j = [ret count]; while (notPresent == NO && j-- > 0) { str = [NSString stringWithFormat: @"%@==>%@", [snd objectAtIndex: i], [ret objectAtIndex: j]]; if ([filterSet member: str] == nil) { notPresent = YES; [filterSet addObject: str]; [filterList addObject: result]; } } } } if (notPresent == NO) { if (verbose > 0) { NSLog(@"Ignoring duplicate %u in %@ -\n%@", pos, path, result); } return nil; } } else if ((obj = [result objectForKey: @"NSMessage"]) != nil) { NSDictionary *item; NSEnumerator *e; NSString *k; BOOL used = NO; if ([result objectForKey: @"NSPortName"] == nil) { if (verbose > 0) NSLog(@"NSServices entry %u NSPortName missing - %@", pos, path); return nil; } if ([result objectForKey: @"NSSendTypes"] == nil && [result objectForKey: @"NSReturnTypes"] == nil) { if (verbose > 0) NSLog(@"NSServices entry %u types missing - %@", pos, path); return nil; } if ((item = [result objectForKey: @"NSMenuItem"]) == nil) { if (verbose > 0) NSLog(@"NSServices entry %u NSMenuItem missing - %@", pos, path); return nil; } /* * For each language, check to see if we already have a service * by this name - if so - we ignore this one. */ e = [item keyEnumerator]; while ((k = [e nextObject]) != nil) { NSString *name = [item objectForKey: k]; NSMutableDictionary *names; names = [serviceMap objectForKey: k]; if (names == nil) { names = [NSMutableDictionary dictionaryWithCapacity: 1]; [serviceMap setObject: names forKey: k]; } if ([names objectForKey: name] == nil) { [names setObject: result forKey: name]; used = YES; } } if (used == NO) { if (verbose > 0) { NSLog(@"Ignoring entry %u in %@ -\n%@", pos, path, result); } return nil; /* Ignore - already got service with this name */ } } else if ((obj = [result objectForKey: @"NSPrintFilter"]) != nil) { NSDictionary *item; NSEnumerator *e; NSString *k; BOOL used = NO; if ((item = [result objectForKey: @"NSMenuItem"]) == nil) { if (verbose > 0) NSLog(@"NSServices entry %u NSMenuItem missing - %@", pos, path); return nil; } /* * For each language, check to see if we already have a print * filter by this name - if so - we ignore this one. */ e = [item keyEnumerator]; while ((k = [e nextObject]) != nil) { NSString *name = [item objectForKey: k]; NSMutableDictionary *names; names = [printMap objectForKey: k]; if (names == nil) { names = [NSMutableDictionary dictionaryWithCapacity: 1]; [printMap setObject: names forKey: k]; } if ([names objectForKey: name] == nil) { [names setObject: result forKey: name]; used = YES; } } if (used == NO) { if (verbose > 0) { NSLog(@"Ignoring entry %u in %@ -\n%@", pos, path, result); } return nil; /* Ignore - already got filter with this name */ } } else if ((obj = [result objectForKey: @"NSSpellChecker"]) != nil) { NSArray *item; unsigned pos; BOOL used = NO; if ((item = [result objectForKey: @"NSLanguages"]) == nil) { if (verbose > 0) NSLog(@"NSServices entry NSLanguages missing - %@", path); return nil; } /* * For each language, check to see if we already have a spell * checker by this name - if so - we ignore this one. */ pos = [item count]; while (pos-- > 0) { NSString *lang = [item objectAtIndex: pos]; if ([spellMap objectForKey: lang] == nil) { [spellMap setObject: result forKey: lang]; used = YES; } } if (used == NO) { if (verbose > 0) { NSLog(@"Ignoring entry %u in %@ -\n%@", pos, path, result); } return nil; /* Ignore - already got speller with language. */ } } else { if (verbose > 0) NSLog(@"NSServices entry %u unknown service/filter - %@", pos, path); return nil; } return result; } gnustep-gui-0.24.0/Tools/GNUmakefile.postamble0000664000076500007650000000161511335045223021102 0ustar brains99brains99# # Makefile.postamble # # Project specific makefile rules # # Copyright (C) 2005 Free Software Foundation, Inc. # # Uncomment the targets you want. # The double colons (::) are important, do not make them single colons # otherwise the normal makefile rules will not be performed. # # Things to do before compiling # before-all:: # Things to do after compiling # after-all:: # Things to do before installing # before-install:: # Things to do after installing # after-install:: # Things to do before uninstalling # before-uninstall:: # Things to do after uninstalling # after-uninstall:: # Things to do before cleaning # before-clean:: # Things to do after cleaning # after-clean:: # Things to do before distcleaning # before-distclean:: # Things to do after distcleaning # after-distclean:: # Things to do before checking # before-check:: # Things to do after checking # after-check:: gnustep-gui-0.24.0/Tools/GSspell.m0000664000076500007650000003523012011143477016574 0ustar brains99brains99/* GSspell.m GNUstep spell checker facility. Copyright (C) 2001, 2010 Free Software Foundation, Inc. Author: Gregory John Casamento Date: May 2001 Author: Wolfgang Lux Date: January 2010 This file is part of the GNUstep Project This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ // get the configuration. #include "config.h" #import #import #ifdef HAVE_ASPELL_H #import #import #include #endif // A minor category for NSData so that we can convert NSStrings // into data. @interface NSData (MethodsForSpellChecker) + (id)dataWithString: (NSString *)string; @end @implementation NSData (MethodsForSpellChecker) + (id)dataWithString: (NSString *)string { NSData *data = [NSData dataWithBytes: (char *)[string cString] length: [string length]]; return data; } @end // A category for NSBundle so that we can determine the languages // vended by a service bundle @interface NSBundle (MethodsForSpellChecker) - (NSArray *) serviceLanguages; @end @implementation NSBundle (MethodsForSpellChecker) - (NSArray *) serviceLanguages { NSDictionary *infoDict = [self infoDictionary]; if ([infoDict isKindOfClass: [NSDictionary class]]) { NSArray *services = [infoDict objectForKey: @"NSServices"]; if ([services isKindOfClass: [NSArray class]] && [services count] > 0) { NSDictionary *serviceDict = [services objectAtIndex: 0]; if ([serviceDict isKindOfClass: [NSDictionary class]]) { NSArray *languages = [serviceDict objectForKey: @"NSLanguages"]; if ([languages isKindOfClass: [NSArray class]]) { return languages; } } } } return nil; } @end // The base class. Its spell checker just provides a dumb spell checker // for American English as fallback if aspell is not available. @interface GNUSpellChecker : NSObject - (BOOL) registerLanguagesWithServer: (NSSpellServer *)aServer; - (NSArray *) languages; @end @implementation GNUSpellChecker - (BOOL) registerLanguagesWithServer: (NSSpellServer *)aServer { BOOL success = NO; NSEnumerator *langEnum; NSString *language; langEnum = [[self languages] objectEnumerator]; while ((language = [langEnum nextObject]) != nil) { if ([aServer registerLanguage: language byVendor: @"GNU"]) { NSLog(@"Registered spell server for language %@", language); success = YES; } else { NSLog(@"Could not register spell server for language %@", language); } } return success; } - (NSArray *) languages { return [NSArray arrayWithObject: @"AmericanEnglish"]; } - (BOOL) createBundleAtPath: (NSString *)path languages: (NSArray *)languages { NSDictionary *infoDict, *serviceDict; NSFileManager *fm = [NSFileManager defaultManager]; NSString *execPath; if ([fm fileExistsAtPath: path] && ![fm removeFileAtPath: path handler: nil]) { NSLog(@"cannot remove %@", path); return NO; } path = [path stringByAppendingPathComponent: @"Resources"]; if (![fm createDirectoryAtPath: path withIntermediateDirectories: YES attributes: nil error: NULL]) { NSLog(@"cannot not create bundle directory %@", path); return NO; } path = [path stringByAppendingPathComponent: @"Info-gnustep"]; path = [path stringByAppendingPathExtension: @"plist"]; /* FIXME Not sure if the executable path is needed in the service dictionary. However, GSspellInfo.plist has it and so we include it here too. */ execPath = [[NSBundle mainBundle] executablePath]; serviceDict = [NSDictionary dictionaryWithObjectsAndKeys: execPath, @"NSExecutable", languages, @"NSLanguages", @"GNU", @"NSSpellChecker", nil]; infoDict = [NSDictionary dictionaryWithObjectsAndKeys: execPath, @"NSExecutable", [NSArray arrayWithObject: serviceDict], @"NSServices", nil]; if (![infoDict writeToFile: path atomically: YES]) { NSLog(@"cannot save info dictionary to %@", path); return NO; } return YES; } - (BOOL) removeBundleAtPath: (NSString *)path { NSFileManager *fm = [NSFileManager defaultManager]; if (![fm fileExistsAtPath: path]) { return NO; } if (![fm removeFileAtPath: path handler: nil]) { NSLog(@"cannot remove %@", path); return NO; } return YES; } /* The installed services bundle only vends a spelling service for the AmericanEnglish language. In order to make other languages available, we maintain a bundle in the user's Services directory that vends those languages. The bundle shares our server executable through its info dictionary. */ - (void) synchronizeLanguages { NSArray *paths; NSString *path; NSMutableArray *otherLanguages; paths = NSSearchPathForDirectoriesInDomains (NSLibraryDirectory, NSUserDomainMask, YES); path = [paths objectAtIndex:0]; path = [path stringByAppendingPathComponent: @"Services"]; path = [path stringByAppendingPathComponent: @"GSspell"]; path = [path stringByAppendingPathExtension: @"service"]; otherLanguages = [[[self languages] mutableCopy] autorelease]; [otherLanguages removeObject: @"AmericanEnglish"]; [otherLanguages sortUsingSelector: @selector(compare:)]; if ([otherLanguages count]) { if (![otherLanguages isEqual: [[NSBundle bundleWithPath: path] serviceLanguages]]) { if ([self createBundleAtPath: path languages: otherLanguages]) { [[NSWorkspace sharedWorkspace] findApplications]; } } } else { if ([self removeBundleAtPath: path]) { [[NSWorkspace sharedWorkspace] findApplications]; } } } - (NSRange) spellServer: (NSSpellServer *)sender findMisspelledWordInString: (NSString *)stringToCheck language: (NSString *)language wordCount: (int *)wordCount countOnly: (BOOL)countOnly { NSRange r = NSMakeRange(0,0); if (countOnly) { NSScanner *inputScanner = [NSScanner scannerWithString: stringToCheck]; [inputScanner setCharactersToBeSkipped: [NSCharacterSet whitespaceAndNewlineCharacterSet]]; while (![inputScanner isAtEnd]) { [inputScanner scanUpToCharactersFromSet: [NSCharacterSet whitespaceAndNewlineCharacterSet] intoString: NULL]; (*wordCount)++; } } else { NSLog(@"spellServer:findMisspelledWordInString:... invoked, " @"spell server not configured."); } return r; } - (NSArray *) spellServer: (NSSpellServer *)sender suggestGuessesForWord: (NSString *)word inLanguage: (NSString *)language { NSMutableArray *array = [NSMutableArray array]; NSLog(@"spellServer:suggestGuessesForWord:... invoked, " @"spell server not configured"); return array; } - (void) spellServer: (NSSpellServer *)sender didLearnWord: (NSString *)word inLanguage: (NSString *)language { NSLog(@"spellServer:didLearnWord:inLanguage: invoked, " @"spell server not configured"); } - (void) spellServer: (NSSpellServer *)sender didForgetWord: (NSString *)word inLanguage: (NSString *)language { NSLog(@"spellServer:didForgetWord:inLanguage: invoked, " @"spell server not configured"); } @end #ifdef HAVE_ASPELL_H // The real speller checker class provides spelling services for all // languages that aspell has dictionaries installed. #define GNU_SPELL_CHECKER_CLASS GNUAspellSpellChecker @interface GNUAspellSpellChecker : GNUSpellChecker { NSDictionary *dictionaries; NSMutableDictionary *spellers, *documentCheckers; } @end @implementation GNUAspellSpellChecker static NSDictionary * aspell_dictionaries() { AspellConfig *config; AspellDictInfoList *dictList; AspellDictInfoEnumeration *dictEnum; NSMutableDictionary *dictionaries; config = new_aspell_config(); dictList = get_aspell_dict_info_list(config); delete_aspell_config(config); dictionaries = [[NSMutableDictionary alloc] initWithCapacity: 1]; dictEnum = aspell_dict_info_list_elements(dictList); while (!aspell_dict_info_enumeration_at_end(dictEnum)) { const AspellDictInfo *dict = aspell_dict_info_enumeration_next(dictEnum); /* The string encoding does not really matter here, since Aspell represents dictionary languages by a two letter ISO 639 language code followed by an optional two letter ISO 3166 country code, all of which are plain ASCII characters. Note that there may be multiple dictionaries for a language, but we are interested only in the supported languages. FIXME How can the user choose a particular dictionary variant from the Spelling panel? */ NSString *dictLang = [NSString stringWithUTF8String: dict->code]; NSString *language = GSLanguageFromLocale(dictLang); if (!language) language = dictLang; [dictionaries setObject: dictLang forKey: language]; } delete_aspell_dict_info_enumeration(dictEnum); return dictionaries; } - (id) init { if (![super init]) return nil; dictionaries = aspell_dictionaries(); spellers = [[NSMutableDictionary alloc] initWithCapacity: 1]; documentCheckers = [[NSMutableDictionary alloc] initWithCapacity: 1]; return self; } - (NSArray *) languages { return [dictionaries allKeys]; } - (AspellSpeller *) spellerForLanguage: (NSString *)language { AspellSpeller *speller = [[spellers objectForKey: language] pointerValue]; if (!speller) { NSString *dictLang = [dictionaries objectForKey: language]; if (dictLang) { AspellConfig *config = new_aspell_config(); aspell_config_replace(config, "lang", [dictLang UTF8String]); aspell_config_replace(config, "encoding", "UTF-8"); speller = to_aspell_speller(new_aspell_speller(config)); [spellers setObject: [NSValue valueWithPointer: speller] forKey: language]; } } return speller; } - (AspellDocumentChecker *) documentCheckerForLanguage: (NSString *)language { AspellDocumentChecker *checker = [[documentCheckers objectForKey: language] pointerValue]; if (!checker) { AspellSpeller *speller = [self spellerForLanguage: language]; checker = to_aspell_document_checker(new_aspell_document_checker(speller)); [documentCheckers setObject: [NSValue valueWithPointer: checker] forKey: language]; } return checker; } static inline unsigned int uniLength(unsigned char *buf, unsigned int len) { unsigned int i, size; for (i = 0; i < len; i++) { if (buf[i] >= 0x80) { if (GSToUnicode(0, &size, buf, len, NSUTF8StringEncoding, 0, 0)) { len = size; } break; } } return len; } - (NSRange) spellServer: (NSSpellServer *)sender findMisspelledWordInString: (NSString *)stringToCheck language: (NSString *)language wordCount: (int *)wordCount countOnly: (BOOL)countOnly { const char *p; AspellToken token; AspellDocumentChecker *checker; NSRange r; NSString *word; int length; if (countOnly) { return [super spellServer: sender findMisspelledWordInString: stringToCheck language: language wordCount: wordCount countOnly: countOnly]; } p = [stringToCheck UTF8String]; length = strlen(p); checker = [self documentCheckerForLanguage: language]; aspell_document_checker_process(checker, p, length); /* Even though we add learned words to aspell's user dictionary, we must ask the server for words in its user dictionaries so that words that the user has ignored won't be returned as misspelled. */ do { token = aspell_document_checker_next_misspelling(checker); if (token.len == 0) return NSMakeRange(NSNotFound, 0); r = NSMakeRange(uniLength((unsigned char *)p, token.offset), uniLength((unsigned char *)p + token.offset, token.len)); word = [stringToCheck substringWithRange: r]; } while ([sender isWordInUserDictionaries: word caseSensitive: YES]); return r; } - (NSArray *) spellServer: (NSSpellServer *)sender suggestGuessesForWord: (NSString *)word inLanguage: (NSString *)language { NSMutableArray *array = [NSMutableArray array]; const char *p = [word UTF8String]; int len = strlen(p); int words = 0; AspellSpeller *speller = [self spellerForLanguage: language]; const struct AspellWordList *list = aspell_speller_suggest(speller, p, len); AspellStringEnumeration *en; words = aspell_word_list_size(list); en = aspell_word_list_elements(list); // add them to the array. while (!aspell_string_enumeration_at_end(en)) { const char *string = aspell_string_enumeration_next(en); NSString *word = [NSString stringWithUTF8String: string]; [array addObject: word]; } // cleanup. delete_aspell_string_enumeration(en); return array; } - (void) spellServer: (NSSpellServer *)sender didLearnWord: (NSString *)word inLanguage: (NSString *)language { const char *aword = [word UTF8String]; AspellSpeller *speller = [self spellerForLanguage: language]; aspell_speller_add_to_personal(speller, aword, strlen(aword)); } - (void) spellServer: (NSSpellServer *)sender didForgetWord: (NSString *)word inLanguage: (NSString *)language { NSLog(@"Not implemented"); } @end #endif // The main program #ifndef GNU_SPELL_CHECKER_CLASS #define GNU_SPELL_CHECKER_CLASS GNUSpellChecker #endif #ifdef GNUSTEP int main(int argc, char** argv, char **env) #else int main(int argc, char** argv) #endif { CREATE_AUTORELEASE_POOL (_pool); NSSpellServer *aServer = [[NSSpellServer alloc] init]; GNUSpellChecker *aSpellChecker = [[GNU_SPELL_CHECKER_CLASS alloc] init]; NSLog(@"NSLanguages = %@", [aSpellChecker languages]); [aSpellChecker synchronizeLanguages]; if ([aSpellChecker registerLanguagesWithServer: aServer]) { [aServer setDelegate: aSpellChecker]; NSLog(@"Spell server started and waiting."); [aServer run]; NSLog(@"Unexpected death of spell checker"); } else { NSLog(@"Cannot create spell checker instance"); } RELEASE(aSpellChecker); RELEASE(aServer); [_pool drain]; return 0; } gnustep-gui-0.24.0/Tools/speech/0000775000076500007650000000000012256227332016315 5ustar brains99brains99gnustep-gui-0.24.0/Tools/speech/GSSpeechServer.m0000664000076500007650000000241711235157317021330 0ustar brains99brains99#import "GSSpeechServer.h" #import "GSSpeechEngine.h" #import "GSSpeechSynthesizer.h" #import static GSSpeechServer *sharedInstance; @implementation GSSpeechServer + (void)initialize { sharedInstance = [self new]; } + (void)start { NSConnection *connection = [NSConnection defaultConnection]; [connection setRootObject: sharedInstance]; if (NO == [connection registerName: @"GSSpeechServer"]) { return; } [[NSRunLoop currentRunLoop] run]; } + (id)sharedServer { return sharedInstance; } - (id)init { if (nil == (self = [super init])) { return nil; } engine = [GSSpeechEngine defaultSpeechEngine]; if (nil == engine) { [self release]; return nil; } return self; } - (id)newSynthesizer { return [[GSSpeechSynthesizer new] autorelease]; } - (BOOL)startSpeakingString: (NSString*)aString notifyWhenDone: (id)client { [engine stopSpeaking]; [engine startSpeaking: aString notifyWhenDone: client]; return YES; } - (void)stopSpeaking { [engine stopSpeaking]; } - (BOOL)isSpeaking { return [engine isSpeaking]; } - (NSArray*)voices { return [engine voices]; } - (oneway void)setVoice: (NSString*)aVoice { [engine setVoice: aVoice]; } - (NSString*)voice { return [engine voice]; } - (NSString*)defaultVoice { return [engine defaultVoice]; } @end gnustep-gui-0.24.0/Tools/speech/GSSpeechEngine.h0000664000076500007650000000245711620732576021272 0ustar brains99brains99#import /** * GSSpeechEngine is an abstract speech server. One concrete subclass should * be implemented for each speech engine. Currently, only one may be compiled * in to the speech server at any given time. This limitation may be removed * in future if pluggable speech engines are considered beneficial. */ @interface GSSpeechEngine : NSObject /** * Begin speaking the specified string. */ - (void)startSpeaking: (NSString*)aString notifyWhenDone: (id)aDelegate; /** * Stop speaking. */ - (void)stopSpeaking; /** * Returns YES if the engine is currently outputting speech. */ - (BOOL)isSpeaking; /** * Returns an array of voices supported by this speech synthesizer. */ - (NSArray*)voices; /** * Sets the voice. */ - (void)setVoice: (NSString*)aVoice; /** * Returns the current voice. */ - (NSString*)voice; /** * Returns the name of the default voice for this speech engine. */ - (NSString*)defaultVoice; @end @interface NSObject (GSSpeechEngineDelegate) /** * Called when the speech engine has finished speaking a phrase. Should be * used to notify the original caller. */ - (void)didFinishSpeaking: (BOOL)didFinish; @end @interface GSSpeechEngine (Default) /** * Returns a new instance of the default speech engine. */ + (GSSpeechEngine*)defaultSpeechEngine; @end gnustep-gui-0.24.0/Tools/speech/GSSpeechEngine.m0000664000076500007650000000104011235157317021256 0ustar brains99brains99#import "GSSpeechEngine.h" /** * Dummy implementation of a speech engine. Doesn't do anything. */ @implementation GSSpeechEngine + (GSSpeechEngine*)defaultSpeechEngine { return [[self new] autorelease]; } - (void)startSpeaking: (NSString*)aString notifyWhenDone: (id)anObject{} - (void)stopSpeaking {} - (BOOL)isSpeaking { return NO; } - (NSArray*)voices { return [NSArray arrayWithObject: @"default"]; } - (void)setVoice: (NSString*)aVoice {} - (NSString*)voice { return @"default"; } - (NSString*)defaultVoice { return @"default"; } @end gnustep-gui-0.24.0/Tools/speech/GSSpeechServer.h0000664000076500007650000000177411235157317021330 0ustar brains99brains99#import @class GSSpeechEngine; /** * GSSpeechServer handles all of the engine-agnostic operations. Currently, * there aren't any, but when the on-screen text interface is added it should * go in here. */ @interface GSSpeechServer : NSObject { GSSpeechEngine *engine; } /** * Returns a shared instance of the speech server. */ + (id)sharedServer; /** * Begins speaking the string specified by the first argument. Calls the * delegate method on the client when done. */ - (BOOL)startSpeakingString: (NSString*)aString notifyWhenDone: (id)client; /** * Stop speaking. */ - (void)stopSpeaking; /** * Returns YES if the engine is currently outputting speech. */ - (BOOL)isSpeaking; /** * Returns an array of voices supported by this speech synthesizer. */ - (NSArray*)voices; /** * Sets the voice. */ - (void)setVoice: (NSString*)aVoice; /** * Returns the current voice. */ - (NSString*)voice; /** * Returns the name of the default voice. */ - (NSString*)defaultVoice; @end gnustep-gui-0.24.0/Tools/speech/GSSpeechSynthesizer.h0000664000076500007650000000062111235157317022377 0ustar brains99brains99#import "GSSpeechServer.h" #import @interface GSSpeechSynthesizer : NSSpeechSynthesizer { NSString *currentVoice; id delegate; } - (id)initWithVoice: (NSString*)aVoice; - (id)init; - (NSString*)voice; - (id)delegate; - (void)setDelegate: (id)aDelegate; - (void)setVoice: (NSString*)aVoice; - (BOOL)startSpeakingString: (NSString*)aString; - (void)stopSpeaking; @end gnustep-gui-0.24.0/Tools/speech/FliteSpeechEngine.m0000664000076500007650000000504111235157317022015 0ustar brains99brains99#import "GSSpeechEngine.h" #include cst_voice *register_cmu_us_kal(); /** * Implementation of a speech engine using flite. This should be the default * for resource-constrained platforms. */ @interface FliteSpeechEngine : GSSpeechEngine { /** The audio device used for sound output. */ cst_audiodev *ad; /** The current voice. Only one supported at the moment. */ cst_voice *v; /** Flag set to tell the playback thread to exit. */ volatile BOOL shouldEndSpeaking; /** Flag indicating whether the engine is currently speaking. */ volatile BOOL isSpeaking; } @end @implementation FliteSpeechEngine + (void)initialize { flite_init(); } - (id)init { if (nil == (self = [super init])) { return nil; } // Only one voice supported by flite unless others are compiled in. v = register_cmu_us_kal(); if (NULL == v) { [self release]; return nil; } // Each wave should be the same format. cst_wave *w = flite_text_to_wave("test", v); ad = audio_open(w->sample_rate, w->num_channels, CST_AUDIO_LINEAR16); delete_wave(w); if (NULL == ad) { [self release]; return nil; } return self; } - (void)sayString: (NSArray*)args { id pool = [NSAutoreleasePool new]; NSString *aString = [args objectAtIndex: 0]; int i,n,r; int num_shorts; BOOL didFinish = YES; cst_wave *w = flite_text_to_wave([aString UTF8String], v); num_shorts = w->num_samples * w->num_channels; for (i=0; i < num_shorts; i += r/2) { if (num_shorts > i+CST_AUDIOBUFFSIZE) { n = CST_AUDIOBUFFSIZE; } else { n = num_shorts-i; } r = audio_write(ad, &w->samples[i], n*2); if (shouldEndSpeaking) { didFinish = NO; break; } } isSpeaking = NO; NS_DURING [[args objectAtIndex: 1] didFinishSpeaking: didFinish]; NS_HANDLER NS_ENDHANDLER [args release]; [pool release]; delete_wave(w); } - (void)startSpeaking: (NSString*)aString notifyWhenDone: (id)aDelegate { [[[aDelegate delegate] connectionForProxy] enableMultipleThreads]; NSArray *arg = [[NSArray alloc] initWithObjects: aString, aDelegate, nil]; shouldEndSpeaking = NO; isSpeaking = YES; [NSThread detachNewThreadSelector: @selector(sayString:) toTarget: self withObject: arg]; } - (BOOL)isSpeaking { return isSpeaking; } - (void)stopSpeaking { shouldEndSpeaking = YES; // Spin until the other thread has died. while (isSpeaking) {} } - (void)dealloc { [self stopSpeaking]; audio_close(ad); [super dealloc]; } @end @implementation GSSpeechEngine (Flite) + (GSSpeechEngine*)defaultSpeechEngine { return [[[FliteSpeechEngine alloc] init] autorelease]; } @end gnustep-gui-0.24.0/Tools/speech/GNUmakefile0000664000076500007650000000160511241624152020363 0ustar brains99brains99ETOILE_CORE_MODULE = YES include $(GNUSTEP_MAKEFILES)/common.make # Set the default. Eventually this should be conditional. GSSPEECHENGINE = Flite VERSION = 0.1 # This is an app not a tool because, eventually, it will present the user # interface for the GUI part of the speech engine. APP_NAME = GSSpeechServer GSSpeechServer_LANGUAGES = English GSSpeechServer_OBJC_FILES = \ GSSpeechEngine.m \ GSSpeechServer.m \ GSSpeechSynthesizer.m \ main.m ifeq ($(GSSPEECHENGINE), Flite) GSSpeechServer_OBJC_FILES += FliteSpeechEngine.m GSSpeechServer_INCLUDE_DIRS += -I/usr/local/include/flite -I../../Headers \ -I../../Headers/Additions GSSpeechServer_LIB_DIRS += -L../../Source/$(GNUSTEP_OBJ_DIR) \ -L/usr/local/lib -lgnustep-gui -lflite_cmu_us_kal \ -lflite_usenglish -lflite_cmulex -lflite endif GSSpeechServer_OBJCFLAGS = -std=c99 -g -Werror include $(GNUSTEP_MAKEFILES)/application.make gnustep-gui-0.24.0/Tools/speech/GSSpeechSynthesizer.m0000664000076500007650000000542012127075651022407 0ustar brains99brains99#import "GSSpeechSynthesizer.h" static GSSpeechServer *server; static int clients; @interface GSSpeechSynthesizer (Private) + (void)connectionDied: (NSNotification*)aNotification; @end @implementation GSSpeechSynthesizer + (void)initialize { server = [[GSSpeechServer sharedServer] retain]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(connectionDied:) name: NSConnectionDidDieNotification object: nil]; } /** * If the remote end exits before freeing the GSSpeechSynthesizer then we need * to send it a -release message to make sure it dies. */ + (void)connectionDied: (NSNotification*)aNotification { NSEnumerator *e = [[[aNotification object] localObjects] objectEnumerator]; for (NSObject *o = [e nextObject] ; nil != o ; o = [e nextObject]) { if ([o isKindOfClass: self]) { [o release]; } } } /** * If no clients have been active for some time, kill the speech server to * conserve resources. */ + (void)exitIfUnneeded: (NSTimer*)sender { if (clients == 0) { exit(0); } } - (id)initWithVoice: (NSString*)aVoice { clients++; if (nil == (self = [super init])) { return nil; } [self setVoice: currentVoice]; return self; } - (id)init { return [self initWithVoice: nil]; } - (NSString*)voice { return currentVoice; } - (id)delegate { return delegate; } - (void)setDelegate: (id)aDelegate { // Either -retain or -release can throw an exception due to DO. NS_DURING aDelegate = [aDelegate retain]; NS_HANDLER NS_ENDHANDLER NS_DURING [delegate release]; NS_HANDLER NS_ENDHANDLER delegate = aDelegate; } - (void)setVoice: (NSString*)aVoice { if (nil == aVoice) { aVoice = [server defaultVoice]; } ASSIGN(currentVoice, aVoice); } - (BOOL)startSpeakingString: (NSString*)aString { [server setVoice: currentVoice]; return [server startSpeakingString: aString notifyWhenDone: self]; } - (void)didFinishSpeaking: (BOOL)didFinish { // Throw the delegate away if it is throwing exceptions during // notification. NS_DURING [delegate speechSynthesizer: self didFinishSpeaking: didFinish]; NS_HANDLER NS_DURING id d = delegate; delegate = nil; [d release]; NS_HANDLER NS_ENDHANDLER NS_ENDHANDLER } - (void)stopSpeaking { [server stopSpeaking]; } - (void)dealloc { clients--; [currentVoice release]; if (clients == 0) { [NSTimer scheduledTimerWithTimeInterval: 600 target: object_getClass(self) selector: @selector(exitIfUnneeded:) userInfo: nil repeats: NO]; } [super dealloc]; } @end gnustep-gui-0.24.0/Tools/speech/main.m0000664000076500007650000000024311235157317017417 0ustar brains99brains99#import @interface GSSpeechServer + (void)start; @end int main(void) { [NSAutoreleasePool new]; [GSSpeechServer start]; return 0; } gnustep-gui-0.24.0/Tools/gcloseall.m0000664000076500007650000000603610723620323017170 0ustar brains99brains99/* This tool terminates all applications. Copyright (C) 2006 Free Software Foundation, Inc. Written by: Richard Frith-Macdoanld Created: January 2006 This file is part of the GNUstep Project This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include int main(int argc, char** argv, char **env_c) { CREATE_AUTORELEASE_POOL(pool); NSWorkspace *workspace; NSEnumerator *enumerator; NSArray *launched; NSDictionary *info; #ifdef GS_PASS_ARGUMENTS [NSProcessInfo initializeWithArguments:argv count:argc environment:env_c]; #endif workspace = [NSWorkspace sharedWorkspace]; launched = [workspace launchedApplications]; /* * Hack ... if the array is from a workspace application it may actually * be a proxy, and if we terminate that application the proxy will become * invalid while we are iterating through the array. To avoid that * problem we serialize the array into an NSData object and deserialize * that into local memory. */ launched = [NSPropertyListSerialization propertyListFromData: [NSPropertyListSerialization dataFromPropertyList: launched format: NSPropertyListBinaryFormat_v1_0 errorDescription: 0] mutabilityOption: NSPropertyListImmutable format: 0 errorDescription: 0]; enumerator = [launched objectEnumerator]; while ((info = [enumerator nextObject]) != nil) { NSString *port = [info objectForKey: @"NSApplicationName"]; GSPrintf(stdout, @"Terminating '%@'\n", port); NS_DURING { id app; /* * Try to contact a running application. */ app = [NSConnection rootProxyForConnectionWithRegisteredName: port host: @""]; NS_DURING { [app terminate: nil]; } NS_HANDLER { /* maybe it terminated. */ } NS_ENDHANDLER } NS_HANDLER { NSLog(@"Exception while attempting to terminate %@ - %@: %@", port, [localException name], [localException reason]); } NS_ENDHANDLER } RELEASE(pool); exit(EXIT_SUCCESS); } gnustep-gui-0.24.0/Tools/GNUmakefile0000664000076500007650000000344111335045223017114 0ustar brains99brains99# # Tools level makefile for GNUstep GUI Library # # Copyright (C) 1997 Free Software Foundation, Inc. # # This file is part of the GNUstep GUI Library. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-gui GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../gui.make include $(GNUSTEP_MAKEFILES)/common.make include ../config.make include ../Version SUBPROJECTS = $(BUILD_SPEECH) $(BUILD_SOUND) TOOL_NAME = make_services set_show_service gopen gclose gcloseall SERVICE_NAME = GSspell # The source files to be compiled gcloseall_OBJC_FILES = gcloseall.m gclose_OBJC_FILES = gclose.m gopen_OBJC_FILES = gopen.m make_services_OBJC_FILES = make_services.m set_show_service_OBJC_FILES = set_show_service.m GSspell_OBJC_FILES = GSspell.m include GNUmakefile.preamble ifeq ($(CROSS_COMPILING),yes) GNUSTEP_MAKE_SERVICES=: else GNUSTEP_MAKE_SERVICES=./$(GNUSTEP_OBJ_DIR)/make_services endif include $(GNUSTEP_MAKEFILES)/tool.make include $(GNUSTEP_MAKEFILES)/service.make include $(GNUSTEP_MAKEFILES)/aggregate.make include GNUmakefile.postamble gnustep-gui-0.24.0/Tools/gclose.m0000664000076500007650000000563611524611420016502 0ustar brains99brains99/* This tool terminates a named application from the command line Copyright (C) 2001 Free Software Foundation, Inc. Written by: Gregory Casamento Created: November 2001 This file is part of the GNUstep Project This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include #include #include #include int main(int argc, char** argv, char **env_c) { CREATE_AUTORELEASE_POOL(pool); NSEnumerator *argEnumerator = nil; NSString *arg = nil; NSString *host = nil; #ifdef GS_PASS_ARGUMENTS [NSProcessInfo initializeWithArguments:argv count:argc environment:env_c]; #endif argEnumerator = [[[NSProcessInfo processInfo] arguments] objectEnumerator]; host = [[NSUserDefaults standardUserDefaults] stringForKey: @"NSHost"]; [argEnumerator nextObject]; // skip the first element, which is empty. while ((arg = [argEnumerator nextObject]) != nil) { if ([arg isEqualToString: @"-NSHost"]) { // skip since this is handled above... [argEnumerator nextObject]; } else // no option specified { NS_DURING { NSString *port; id app; if (host == nil) { host = @""; } else { NSHost *h = [NSHost hostWithName: host]; if ([h isEqual: [NSHost currentHost]] == YES) { host = @""; } } port = [[arg lastPathComponent] stringByDeletingPathExtension]; /* * Try to contact a running application. */ app = [NSConnection rootProxyForConnectionWithRegisteredName: port host: host]; NS_DURING { [app terminate: nil]; } NS_HANDLER { /* maybe it terminated. */ } NS_ENDHANDLER } NS_HANDLER { NSLog(@"Exception while attempting to terminate %@ - %@: %@", arg, [localException name], [localException reason]); } NS_ENDHANDLER } } RELEASE(pool); exit(EXIT_SUCCESS); } gnustep-gui-0.24.0/Tools/wgetopt.h0000664000076500007650000000360410711446641016713 0ustar brains99brains99/* wgetopt Copyright (C) 2005 Free Software Foundation, Inc. This file is part of the GNU Objective C User Interface library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if (defined __MINGW__) /* A simple implementation of getopt() */ static int indexof(char c, char *string) { int i; for (i = 0; i < strlen(string); i++) { if (string[i] == c) { return i; } } return -1; } static char *optarg; static int optind; static char getopt(int argc, char **argv, char *options) { static char *arg; int index; char retval = '\0'; optarg = NULL; if (optind == 0) { optind = 1; } while (optind < argc) { arg = argv[optind]; if (strlen(arg) == 2) { if (arg[0] == '-') { if ((index = indexof(arg[1], options)) != -1) { retval = arg[1]; if (index < strlen(options)) { if (options[index+1] == ':') { if (optind < argc-1) { optind++; optarg = argv[optind]; } else { return -1; /* ':' given, but argv exhausted */ } } } } } } optind++; return retval; } return -1; } #endif gnustep-gui-0.24.0/Tools/set_show_service.m0000664000076500007650000000534511567716075020621 0ustar brains99brains99/* set_show_service.m GNUstep utility to enable or disable a service for the current user. Copyright (C) 1998 Free Software Foundation, Inc. Author: Richard Frith-Macdonald Date: November 1998 This file is part of the GNUstep Project This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #import #import #import #import #import "AppKit/NSApplication.h" int main(int argc, char** argv, char **env) { NSAutoreleasePool *pool; NSProcessInfo *proc; NSArray *args; unsigned index; // [NSObject enableDoubleReleaseCheck: YES]; #ifdef GS_PASS_ARGUMENTS [NSProcessInfo initializeWithArguments:argv count:argc environment:env]; #endif pool = [NSAutoreleasePool new]; proc = [NSProcessInfo processInfo]; if (proc == nil) { NSLog(@"unable to get process information!\n"); exit(EXIT_SUCCESS); } args = [proc arguments]; for (index = 1; index < [args count]; index++) { if ([[args objectAtIndex: index] isEqual: @"--help"]) { printf( "set_show_service enables or disables the display of a specified service\n" "item. It's should be in the form 'set_show_service --enable name' or \n" "'set_show_service --disable name' where 'name' is a service name.\n"); exit(EXIT_SUCCESS); } if ([[args objectAtIndex: index] isEqual: @"--enable"]) { if (index >= [args count] - 1) { NSLog(@"No name specified for enable.\n"); exit(EXIT_FAILURE); } NSSetShowsServicesMenuItem([args objectAtIndex: ++index], YES); exit(EXIT_SUCCESS); } if ([[args objectAtIndex: index] isEqual: @"--disable"]) { if (index >= [args count] - 1) { NSLog(@"No name specified for disable.\n"); exit(EXIT_FAILURE); } NSSetShowsServicesMenuItem([args objectAtIndex: ++index], NO); exit(EXIT_SUCCESS); } } NSLog(@"Nothing to do.\n"); [pool drain]; return(1); } gnustep-gui-0.24.0/Sounds/0000775000076500007650000000000012256227335015224 5ustar brains99brains99gnustep-gui-0.24.0/Sounds/Frog.wav0000664000076500007650000021123011244333634016633 0ustar brains99brains99RIFFWAVEfmt D¬±datal--àጋaaQP++õÿ÷ÿÖÿÕÿÈÿÈÿ¿ÿ¾ÿ­ÿ­ÿšÿ›ÿ’ÿ’ÿÿÿ‚ÿÿmÿmÿXÿWÿ>ÿ?ÿ"ÿ!ÿûþüþÔþÔþ¯þ°þŒþ‹þoþoþWþXþGþFþDþGþNþMþbþbþ…þ…þ¶þµþìþëþ/ÿ/ÿsÿtÿ¿ÿ½ÿ KIŒÂÂìí  ûûÜܰ¯yz=>ÿÿÄÿÃÿ‹ÿ‹ÿZÿYÿ2ÿ2ÿÿÿÿÿÿÿ ÿ ÿÿÿ1ÿ2ÿMÿLÿiÿkÿÿÿšÿšÿ¬ÿ­ÿ·ÿ·ÿ¼ÿ»ÿµÿ¶ÿ«ÿ¬ÿ˜ÿ˜ÿ‡ÿ†ÿmÿmÿWÿXÿBÿAÿ3ÿ4ÿ,ÿ+ÿ/ÿ0ÿ<ÿ<ÿTÿRÿuÿwÿžÿœÿÌÿÎÿþÿüÿ01_a‰ˆ¨©¹¹¾¼´µ™˜oq;9÷ÿõÿ­ÿ¯ÿaÿ`ÿÿÿ¿þÀþ}þ}þDþCþþþþýþýõýøýþþþþHþGþþƒþÅþÃþÿÿWÿWÿÿœÿÜÿÝÿFEgg~‰ŠŠ‹ƒƒttfeSS@A22,+*+21@@SSgg~€•”¥¥®®ªªš™yzDD±ÿ´ÿXÿVÿñþòþ‰þ‰þ$þ%þÅýÄýoýqý,ý*ýùüùüÚüÚü×üÕüéüëüýýSýTýªý©ý þ þwþxþíþíþdÿcÿ×ÿ×ÿ@@£¥öö99ed……‘‘‘’……rsYYDB(*õõðîæèæåááÙÛÉʰ¯‰‰ST¼ÿ¼ÿUÿTÿäþæþjþiþìýëýlýlýõüóü†ü‡ü,ü-üîûîûÃûÄû¹û¹ûÍûÍûüüMüLüµüµü0ý0ý¾ý½ýVþWþóþóþ’ÿ’ÿ)+¹¸77¡¡ö÷67baxx{zmnWW34ä便œ›}}cbFI32ûûÌÍ™™WW£ÿ¥ÿ5ÿ3ÿ³þ±þ*þ,þýýýý…ü…üüüœû›û>û@ûûûåúåúèúéúûûYûYû¿ûÁûJüIüíüìü ý ý_þaþ"ÿ ÿàÿáÿ”“89ÇÇ??Ÿáß þþ×Ö©©xx?@  ÙÙ­ª„‡`^>?îyy&&ÇÿÆÿVÿWÿÖþÕþIþJþ²ý³ýýý†ü†üøûúûyûzûûû¼ú»úŽúŒú|ú}ú•ú“úÍúÍú*û,û¬ûªûHüIüýüþüÅýÃý“þ”þkÿjÿ77ùú©©>>·¸FD_`YYCDÞÝ  [\Üܧ§vxNM))áẹ†ˆHHÿÿþÿ£ÿ£ÿ6ÿ6ÿºþ»þ1þ0þ¢ý¢ý ý ýqürüâûäûdûbûþúÿú¶úµúúúˆú‰ú«ú«úóúóú^û]ûêûêû’ü’üRýRýþþóþòþÂÿÁÿ‡‡>@ÜÝa`ÄÄ'&)( ÜÛ™—MNùú«ªff%&ö÷Òѹ¹£¤™—‡ˆxvZ[76ûÿýÿ·ÿ¸ÿ^ÿ\ÿ÷þ÷þ~þþýýýývývýîüíününü÷ûøû–û—ûOûNû'û&û û!û@û?û„û„ûíûíûwüxü!ý ýØýØýžþŸþ_ÿ_ÿ ÍÌeeàà;;rs‰Š~|XXÌÌtvÃÂsu33þÿþÿÞÿÝÿÐÿÐÿÒÿÑÿàÿáÿøÿöÿ21EFII<=éÿêÿžÿÿAÿCÿÙþ×þdþdþíýïýzýyýýý¸ü·üvüwüOüQüIüHüaübüžüžüöüôüjýkýòýôýþþ0ÿ0ÿÏÿÏÿdcäæNM—˜»»½¼›`b  ¨©=<ËÿËÿfÿhÿ ÿ ÿ¿þ¾þŒþþqþrþtþsþ‹þþ¼þ»þýþüþKÿJÿŸÿ¡ÿñÿòÿA?€®¯ÈÇÅŪ¬vs**ÑÿÑÿiÿiÿÿÿœþœþEþEþþþÓýÑý¾ýÀýËýËýñýòý3þ2þ‰þ‰þëþëþYÿXÿÆÿÅÿ((~»»áßäæÎΔ“@AÔÿÓÿUÿVÿÍþÌþ@þAþ»ý¼ýDýEýêüéü­ü«üü’üüüÈüÈüýý†ý…ýþþ›þšþ6ÿ7ÿÓÿÔÿhhìêUW§¥ÞßïðêêÄ„98ÛÜ€&%ØÿÙÿœÿÿtÿtÿbÿdÿiÿiÿ‡ÿ‡ÿµÿ²ÿèÿêÿKMon}~vtQQ¯ÿ°ÿ6ÿ6ÿ©þ¨þ þ þ^ýaý·ü´üüü†û…ûûû¼ú½úúú‘ú’ú¿ú¾úûû¡û¡ûMüMüýýûýúýæþåþÖÿØÿº¸„…63ÂÂ+-mmЉ‚‚XYÉÉoqÂÂwx<;  ììÛÜÑÏËÌÄõµ˜˜ii¹ÿ·ÿ0ÿ1ÿŒþþÖýÕý ý ý8ü7üeûcû™ú™úæùçùKùLùàøßø–ø—ø‰ø‰ø¯ø°ø ù ùŸù ù`úaúPûOû\ü[üƒýƒý´þ´þêÿéÿ$%ÜÜvtßâ,+ר‹32ÒÓtsÀÂvt34ûúÃÃŒML¦¦75­ÿ®ÿ ÿ ÿMþMþvýwýü‹ü’û”û™ú˜ú¥ù¤ù¼ø¼øï÷ð÷N÷M÷ÛöÜö§ö¦ö²ö²öýöüöˆ÷‰÷QøQøOùOù}ú}úÌûÍû5ý4ý£þ¦þff¤¤¸¸¡¢\\ßÞ33ZYST,.é茋$$¸ºNLäçƒ&(ÑÏzz »¹CD¿Àhÿgÿ’þ’þ§ý¦ý¤ü¦ü˜û•û}ú~úfùgù[ø[øj÷i÷šöšöõõ÷õ‰õ‰õ]õZõqõrõÒõÒõyöyöh÷i÷‘ø‘øðùíùpûrûýý¢þ¡þ//¨©./*)ñò€€ÜÛ  ÝÞšš@>ØØgiø÷‡ˆ·¸USíï…„óó<;iÿhÿzþ{þqýrýUüTü)û*ûúùùùÐøÐøº÷º÷ÃöÄöøõùõaõaõ õ õüôüô6õ5õ³õµõuötöu÷w÷ªøªø ú ú‡û‡ûýý¢þ¢þ&(‘‘ÚÛ÷÷â⛜fg~ttLL ÁÀkkÃÃqp!!ØÚ?@ææ~~ÿml¸¸êÿêÿüþüþôýôýÕüÕü¦û§ûvúvúMùMù3ø4ø@÷@÷uövöéõçõœõœõ‘õ“õÌõÌõJöIö÷÷õ÷ó÷ùùQúQú¥û£ûÿüýZþ[þ¦ÿ¥ÿÕÕææËˇ‡yzµ³ÐÐË˲³‹‹]^..  çèÏ;¿±²¤£Œge)+×ÖeeÌÎ349ÿ9ÿ+þ*þ ýýêûèûÊúËúÄùÄùÖøÔøøøy÷x÷÷÷ôöñö ÷ ÷]÷\÷æ÷å÷¡ø øƒùƒù…ú…ú”û•û©ü©ü¹ý¹ý´þ³þ”ÿ”ÿZZûý}ÛÛ@@RRWVUUSSWWgh…„«­âà  de§¦ÛÛþþ¿¿UVÀÀ!%$ÿÿþýþíüìüåûäûõúöú)ú(ú„ù„ùù ùÆøÆø³ø³øÌøÎøùù…ù…ùúúµú´úbûbûüü¼ü¾ü\ýZýêýëý^þ_þ½þ»þýþþþ.ÿ-ÿGÿHÿYÿXÿhÿiÿyÿxÿ•ÿ–ÿÅÿÃÿ[ZÇÆEGÕÕts­­65¥¦ö÷$#ññ‹ŒüüDDgfnn``NÿNÿEþDþIýJýlüjü­û®ûûû¥ú§ú^ú^ú>ú<ú>ú@ú[úYúúúÐúÑúûûcûaû§û©ûãûâûüü9ü7üLüKüWüWüXüYü\ü^üdücüwüwüüüÝüÝü9ý8ý³ý³ýQþQþÿÿîÿíÿßßÙÙÐн¾š˜TUæèKJ}}zx?BÔÓ88tušš——Ž’ÿ’ÿ¢þ¢þÎýÍýýýrürüñûðû’û“ûJûJûûûüúþúëúéúØúØúÈúÈú±ú²ú–ú•útúuúOúNú%ú%úþùþùáùßùÍùÎùÒùÒùíùïù2ú0ú—ú—ú(û)ûãûâûÀüÀüÁýÂýãþãþXW–—ÈÇæçââ±±FCŸ¡»»š˜?>·¸34KJQQOOVVih…ÿ„ÿ·þ¸þúýûýWýWýËüÉüMüNüßûÞûyûzûûûÅúÃúhújú ú ú¬ù«ùJùKùêøéøŒøŒøAø@øøøç÷è÷ë÷é÷øøpøoøöøöø°ù°ù˜ú˜ú§û¥ûÚüÛü*þ-þÿŽÿüû^`±±êéö÷ÖÖðï"#ÞÞqpÕÕ==QQ]^ml€£¥ÕÿÒÿÿÿcþaþ½ý½ý$ý&ý˜ü˜ü ü üƒûƒûúúüúoúmúáùãùSùTùËøÌøJøHøÒ÷Ò÷q÷p÷%÷&÷÷÷ÿö÷.÷-÷Œ÷Œ÷ øøçøèøãùâùûû_ü_üÈýÆý;ÿ>ÿ°°nn¡¢¦¥‚"$¿¿Š‰'(ž¡ùö78lm›™ÃÄõõ--po¼ÿ¾ÿÿÿ|þ|þéýéýUýTý¿ü¿ü*ü*üûûñúñúMúNú¬ùªùùùzø{øù÷ø÷Ž÷Ž÷A÷@÷÷÷÷÷M÷M÷³÷²÷LøLøùù úú+û*ûeüfüµý³ýÿÿkj¸¸ôô  ùú²²9:­­¢ ij  ÿÿ`_¸¹  edÁÂ*+™˜‘ÿ’ÿÿÿ™þ™þþþ›ý™ýýýü€üéûéûKûJû¨ú©úú útùuùïøíø€øø5ø5ø øøøøAøCø£ø¡ø+ù+ùáùãù¿ú½ú´û¶ûÇüÆüäýãýÿÿ"!0/&(ýþ´´?>¢¢Ö×âáÇÇŒŽ97ÎÎSUÕÓXYàâsr  ²°^^ÎÿÏÿˆÿˆÿ<ÿ;ÿëþêþþþ'þ&þ¸ý¸ý7ý7ý²ü³ü'ü'üûûûû ú ú=ú=úñùðùÄùÄù½ù¼ùÕùÖùúú…ú„úûûÁûÂû‰ü‡üZý[ý7þ4þÿÿÞÿÞÿŸEEÎÍ89‚ª«²±žqr//ãá‹78åæœ_^// õÿøÿëÿêÿçÿèÿçÿæÿâÿáÿÔÿÕÿ»ÿºÿÿ‘ÿUÿTÿÿÿ³þ³þPþOþßýáýsýpýýýžüžüGüGüüüÒûÒû¿ûÀûÅûÅûêûêû(ü'ü}ü€üìüëüiýjýñýïýyþ{þÿÿ€ÿ‚ÿôÿòÿPR•”¾¿ÐÐËʲ±‡‰ON×ÿÖÿžÿžÿkÿkÿGÿGÿ0ÿ1ÿ)ÿ(ÿ1ÿ2ÿJÿJÿnÿlÿ ÿŸÿÖÿ×ÿEEonœž›š€€UUÂÿÃÿeÿfÿÿÿ£þ¤þIþIþøýöý³ý´ýƒýƒýaý`ýVýXý]ý\ýtýuý™ý™ýÇýÇýüýýý0þ0þ`þ_þƒþ…þŸþþ¤þ¥þœþþ†þ„þYþ[þ#þ#þâýâý ý ý\ý\ý!ý ýôüõüàüÝüåüæüýýHýGý ý¡ýþþ¡þ¢þ=ÿ=ÿãÿáÿ‡†%'·¶65˜šãã  ùø½¿lkŠ‹{zôÿôÿuÿuÿÿÿ™þšþDþDþþþÏýÑý­ý«ýŠýŠýlýmýPýOý4ý4ý ý ýÚüÜüžüžüYüYü ü ü¹û¼ûkûhûû ûÞúßú³ú±úœúžú§ú¥úÓúÔú&û'ûûû:ü:üøüùüÔýÔýÈþÆþÆÿÆÿÌÌÊÌ·¶‹‹>>ÇÇ$#QQPR''ÓÐ\^ÆÇgh«¬ïî99ÿÿõþöþkþkþöý÷ý’ýý4ý3ýäüåü˜ü™üRüQüü ü¹û¸û_ûaûýúýúžúžú8ú:úÙùÙù‚ùù>ù@ùùùùùùù[ù^ùÉùÈùcúdú(û(ûüüýýDþDþzÿzÿº»õò //àßmnÄÃàáÇÅstïîBCww–™±°ÆÅãäKÿLÿ þŸþþþ€ýýý ý©ü©üOüOüøûúû£û¢ûGûIûêúéúƒúƒúúú­ù­ùGùGùåøæø“ø’øVøWø:ø8ø?ø@øvøvøÝøÝøwùxùFúEú>û>ûcücü¤ý£ýþþýþ__¿ÁJK_^DCîîa`“”…„79¸¸00;=87//*+65TÿTÿŽþ‹þãýåýSýSýßüÞü{ü|ü"ü!üÐûÑû‚ûû0û1ûÚúØú{ú|úúú²ù°ùHùGùäøåøŒøøIøJøøøøø=ø=ø’ø“øùùÓùÕùÃúÂúâûàû)ý)ý‘þ‘þ Ž  nn¨¨°¯xxÿ@?66èçYX‘“œ›‹Šdf:9þÿûþüþþþQýRýªü©ü$ü$ü¶û·ûbûbû û ûåúäú¬ú¬úqúqú1ú1úëùêùœùœùIùIùöøøø®ø­øtøtøQøQøRøSøxøyøÔøÑø[ù[ùúúûû5ü5üˆý‰ýÿþÿ‡ˆª©  vt––vv N N ; ; ÔÔ$$()ùùžŸ10º¸CEæþæþ¤ý£ýˆü‡ü’û”ûÈúÈú+ú,ú¶ùµùgùfù0ù0ùùù ù ùùùùùùùùùþøþøôøõøñøðø÷ø÷ø ù ù<ù<ù‰ùˆùÿùú«úªúŠû‹ûŸüŸüßýßýFÿFÿÎÎjj  žZYa b   ƒ ƒ “ ’ B C › š œUUËÉ66OOkþlþüœüñúòútùsù0ø0ø1÷3÷zöyöööÌõËõÈõÉõïõîõ8ö:öö›ö÷÷“÷’÷øøøœøùù£ù¤ù(ú)úºú¹úVûUûüüÍüÍü±ý²ý»þ¼þçÿåÿ45œ ª¬64§¦ó ô   Ë Ë : : K L õ ô 6 7   žžÏÒÆÂ…†('ÃýÄýkûlû1ù1ù*÷*÷aõaõæóæóÁòÀò÷ñøñ‰ñ‰ñtñqñ®ñ®ñ5ò5òùòùòóóóóõõFöFö‡÷‡÷ÈøÉøúú;û;ûcüdüƒýýšþ›þ¯ÿ°ÿËÊåæED‚‚ÊËN L t w  ] ^ ú ù S R U V ý ú = >   Š Š ¥¤efââ+*[ý\ý‹ú‹úØ÷×÷PõRõóóññ”ï”ïsîsîÊíÊí•í•íÎíÎítîuîxïxïËðËðbò`ò&ô&ôöö ø øþùÿùíûëûÂýÃý}ÿ{ÿ‰ŠÚÙ23@A@>0 2   ð ð ° ° Y Y Û Û 1 1 K L ' & ° ° ë ë É Ê X W ‰ˆkkih¨ý¨ýÐúÒúøÿ÷DõDõ¼ò»òzðzðî‘îííìì“ë”ë¡ë¢ë6ì4ìBíCí»î¹î‡ð‰ðžòžòäôãôI÷I÷¶ù¶ùüüaþ`þy{ccÒÕáá¾¾t t   } } Ý Û % # W X w x € k j / 0 Ç Å " B A ""ºº((  ¿þÀþWüWüäùäùt÷u÷õõ÷ò÷òññïƒïTîTî“í’íHíHíwívíî î8ï6ïºð¹ðŽòò±ô°ô÷÷lùmùÚûÛû2þ2þ]\MMøùbd……a_ûüZ[ŽŒ˜—ƒ„[Z%%çè©©ecÈÈnoúúooÂÀîïííÆÇopóþñþTýTý û ûåùåù8ø7ø¡ö¢ö:õ<õôô*ó(ó”ò•òZò[ò~ò}òþòüòØóÙóõõköjöøø¸ùµùvûxû5ý4ýÚþÚþ^_¯­ÆÈ¥¤?>™š¼ºª«pp°°CCßàˆˆFEÿúý$!**#$ýü¼¼XZÓÓ,*aÿbÿ{þ|þˆýˆýüŒü–û˜û±ú°úçùæùFùFùÙøÚø¥ø¥ø¯ø­øìøîøgùgù ú úÎúÍú©ûªûŠü‰ümýný>þ>þûþûþÿÿÿÿHHdcUW"!ÒÿÔÿlÿkÿùþ÷þ‡þˆþþþÉýÉý‘ýýwýzý„ý„ý½ý½ýþþ˜þ—þ2ÿ3ÿáÿàÿ——IJëëvvàà##==)'æé…„üü_`±°þÿPÿQÿ°þ±þ$þ"þ­ý®ýYýYýýýýüýüøü÷ü ý ý'ý%ýJýLýnýmý‰ý‰ý–ý–ýŽýýiýiý0ý/ýßüÞüyü|ü ü ü–û”ûûû²ú´ú^ú\ú"ú#úúúúúNúNú¹ú·úKûMûüüéüëüæýåý÷þ÷þ**76,-©©  ddrrTU  ŸŸ€ÛÚ43Š‹ëíZXÑÿÓÿ]ÿ[ÿñþòþ”þ“þ9þ:þæýèý–ý”ý<ý;ýàüãüxüvüüü„û„ûûúüúkúkúÖù×ùDùEùÀø¿øJøJøò÷ò÷¹÷º÷¬÷¬÷Ê÷È÷øøøø6ù7ùú úûû"ü#üQýRýþ‘þÔÿÓÿ 00@@,-õó•–  PQoohh;=öõ–•!!œœðð[[ÇÆ--–˜÷ÿõÿTÿTÿ£þ£þêýêý%ý&ýYüXü|û}û ú ú»ù¼ùÝøÚøøø3÷2÷}ö}öáõßõdõdõõõ÷ôøô õ õSõSõÚõÙõ™ö™ö÷÷·ø¶øþùúdûcûÝüÝü_þ`þãÿâÿ_]ÆÇJIVV==ø÷‰Šëê& & 7 7   áᆆ  ts¿¿ñó  èè²³iÿgÿþþ¯ü°üEûBûÓùÕùeøeø÷÷°õ®õmônôQóQó]ò^òœññññÍðÍðÉðÊð ñ ñ—ñ–ñiòjò‚óƒóÙôØônönö5ø5ø(ú(ú6ü7ü]þ\þ†„®°Åĺ¸ƒ  x v ™ › u u  \\hh01¸ · þ þ á â Œ ‹ _^˜™ººÆÆÄþÅþ¾ü»ü±ú²ú¯ø®ø·öµöÒôÔô ó óiñgñùïüïÅîÃîÐíÒí"í!í½ì¾ì³ì±ìùìùìœíœí“î”îáïáï‚ñƒñoómóžõõø øœúúTýSýÛÛ”•++˜ — Ç É ³²HG†…deÜÛîï””Ðк¹LL˜ š ª ¨  € 12ÅÃBC¹ÿ¹ÿ0ý0ý²ú³úKøIøþõÿõÏóÐóÒñÒñððtîtî"í!íììIëIëÒêÓê¯ê¯êåêåêrësëZìYìíží=ï=ï3ñ3ñzózóööÄøÆø¯û¯û·þµþÅÆÓÒÈÈ— – + + xxlm'%ØÚÔÔüúii|~? = ½ ¾ ,,>>OÿPÿnülü¬ù­ù÷÷¬ôªô€òòððåîæîíílìlì¡ë ë$ë%ëôêóêëë†ëƒëAìCìMíNí¤î£îFðFð.ò.ò[ôZô¿öÀöVùUùüüíþîþØÖÃÄ Ÿ` ` í ï 64()»¹ßà”“Íψ‡ÇÆŒ‹ßàÏÑg e ¸ ¸ ÔÔÑпÀµýµýÅúÇúøøxõwõ+ó-ó3ñ3ñ‰ïˆï8î8î=í=í™ìšìMìMìUìTì®ì®ìMíNí3î2îPïOï§ð¦ð.ò.òáóâó¿õ¾õ¾÷¿÷àùáùüüiþiþÈÆ$&ÌË   Ù Ø jk©©’‘--×Ö ×Ö--  ² ²  00AALþLþdûfû¢ø øööËóÉóÒñÓñ6ð7ðúîøî%î%î²í³í¤í¤íîíîíîŽî€ï‚ï¯ð°ðòò¥ó¦óUõSõ÷÷íøîøÅúÄúŸü üuþtþGE··ZYçéb`¼ ½ ø ù  í ï š š +)ƒ „ ª ª z x ï ð îï‘‘ jþjþÃûÅû3ù1ùÁöÁö„ô…ô‹ò‰òæðåð¤ï¦ïÓîÑîlînîuîuîåîåî¹ï·ïßðàðRòRòôôÛõÚõÓ÷Õ÷ÛùÛùáûàûÚýÜý»ÿºÿ|{††ÊÊãâÒÓ˜–9 < ¾ ¼   ^ ^ ‚ ‚ „ „ a b   œ ïïññœœOPhhYþYþ6ü4üúúá÷á÷ÖõÖõôóõóKòJòëðëðéïçïJïKïïïWïVïùïûïññjòjòôôöö7ø8øxúwúÄüÄüÿÿ*+%$îívuº»·µm n æ æ !  ' ( ý ý ² ° I J ÌÍ?>£¤÷ö;;st’‘˜˜‚‚NOýÿûÿŒþŒþøüúüTûRûžùžùä÷ä÷5ö6ö ô¡ô3ó2óöñöñññ`ð`ððð.ð/ðªðªð‹ñŠñÍòÍòhôgôMöLöoøoø»ú»ú!ý!ý…ÿ‡ÿ××ôõ¢¡    Æ Å ) * @ ?   — – ñ ô + * PPii€˜—µ´ÕÕúû!!ED[\dÿdÿTþUþ3ý2ý÷ûøû¦ú£ú?ù>ùÐ÷Ñ÷`ö`öõõ¼ó½ó ò ò¸ñ¹ñññÀðÀðËðÌð1ñ2ñýñûñ(ó(ó«ôªô~ö~ö‘ø‘øÓúÔú3ý5ýÿšÿûü::CF  † „ ¤ £ f g Æ Æ È Ç y y é é # # ; > >=44/.--9:WW€º¹õõ/.bÿdÿˆþˆþ›ýšý”ü–üpûoû7ú7úåøåøˆ÷Š÷$ö#öÅôÅô{ó{óUòUòeñfñ½ð¼ðkðlð‚ð‚ðøð÷ðÛñÚñóóÁôÂôºö¸öóøôøcûbûèýêývtôôBBWV  ~ € † † % % b b E E Õ Ô ! < < * *  ÝÛ¶¸ ž¡¡¼½óò:<ŽÞÿßÿ,ÿ*ÿhþiþŠý‹ýŽüŒüjûlû-ú,úÒøÑø]÷\÷ÝõàõgôeôóóÆñÅñÈðÈððð¹ï¹ïÆïÇïFðGð=ñ=ñ¤ò¤òxôwô¯ö¯ö2ù1ùîûðûÇþÇþ›šNNÂÃåæ­ «   ë ë a ` e f   M N Q Q   ÆÇ`^ýý®­vxgfvv¬­eÿeÿÕþÖþBþBþ¢ý¢ýèüéüüüþúýúÆùÈùqøpø÷÷Šõ‰õôôÁòÁò–ñ•ñ±ð±ð"ð$ðúïúïHðHðññWòYòôô:ö;ö¸ø¸øuûtûYþYþFD!ËÊ, , * + ´ ´ à  JJ@@± ² ¬ © J K © ª äâ  :8‚‚÷÷¢ÿ¡ÿŒþŒþ®ý¯ýýý¡ü¢üYüYü)ü)üüüÔûÒû’û•û8û6û²ú³úúú3ù3ù@øAø9÷:÷-ö-ö/õ.õSôSô¾ó½ó‚ó‚ó¯ó¯óJôLôYõXõÑöÐö²ø²øæúçú\ý\ýýÿýÿ§§==£¥» ¼ p o ª © V V q s û ü ÿ þ ‚ ‚ £¤zy°°PÿPÿýýûûƒùƒùRøPø÷÷;÷:÷E÷F÷ ÷ ÷9ø9øÿøÿøÚùÚù³ú³úxûzûüüüüÌüÌüÓüÔü©ü¨ü_ü`üüûýû•û”ûAû@û û ûûûUûXûéûèûÔüÒüþþ™ÿ˜ÿ^_NNQQ@Aýüc b ] ] × × Ä Å   ç ç .-ûüig™™¤ý¥ý¸ú¹úð÷ð÷kõiõKóJóŸñ ñ†ð†ððððð¸ð·ðâñãñó~óuõuõ¤÷¤÷óùôù<ü;ücþcþDCØØùùÙØéèÒÔ¬ª„…mo{zµµ¶·wvQQ-,ýýœ    › š µ·LL[Zéèÿÿÿÿ¿ü¿üQùQùÚõÚõ„ò„òpïoïÃìÅì£ê£ê'é(édèbè^è]èééœêêÅìÆì‚ïï¯ò±ò2ö1ößùáù”ý’ý#$tuffé ë î í o o lmóó  ÊÊMN­ ¬ þ ý Y Z   C C Ù Ú } } # " ´ ´ ' ' cdXVòó-,üýdÿdÿnünü%ù'ùªõ¨õòò{îyîëëûçüçfågåiãhã)â'â»á»áEâEâÌãÍã9æ8ænéoéFíGí ñžñUöUö>û>û"#ÛÚ< > . - GHRR®­\]pqóòÈÇRQ·¸  abà  4 5 ° ° 21¤¥-.%#×þ×þDüFünùnùXöXöóóµïµïXìZì!éé(æ(æ˜ã™ã™ášáBà@à´ß´ßÿßà/á/áIãGã<æ=æêêrîsîtósóÖøÕømþnþn n ljÏÑwvJK??][«¬>@**‚‚--¥¥i h Ö × ^]ÅÄ ¢‰ÿˆÿrýtýUûRû!ù!ùÒöÓöeôeôÜñÛñ7ï7ïˆì‰ìêéèéwçyçUåTå™ãšãhâgâÜáÜáâ âããÌäÌäaç`ç¹ê»êÄîÄîbóaóoøpøÃýÂý*)vxx w ÿåä  Y[ÎË[]üü22ÓÓÿÿÝÜ•”M M FF¹ÿ¹ÿmýný^û]û„ù„ùÒ÷Ò÷?ö?ö¾ô¿ôCóBóÉñÈñIðKðÈîÆîMíMíàëâë˜ê–ê„é…é¿è¿è^è^èwèwèéé\ê\ê@ì@ìÐîÑî ò ò×õÙõúú’þ‘þ'(³³  îïPPWVÁÂbbA@xxA@Ä Æ `^  ããþþýsûsûFùEùu÷v÷ööîôîô"ô#ôŒó‹óóó¯ò­òMòNòñññññŽñ'ñ&ñÅðÅðsðrð>ð?ð:ð;ðsðsðûðýðãñáñ6ó8óþôûô0÷2÷ÔùÑùÈüÉüghÕÕ* * A B IKüú÷ø>?ÏÍ·¶ÏÏ0 0 @ B ,*  úùþþsûtû'ù%ù<÷<÷·õ·õ™ô™ôÕóÖóióióAó?óLóLó{ó|ó¾ó¾ó ô ôLôMô…ô†ô¬ô­ôÍôËôãôäôõõFõEõ®õ­õ[ö\öR÷Q÷™ø™ø3ú6ú!üüVþXþÈÇ`_¥¤% $ d e QOÏÏÐÐNO86Ž[[§¥‡ ˆ   WV{|š™ÐþÒþ=ü:üëùìùî÷ï÷FöGöýôûô ô ôgógó ó óåòãòëòìòóóAó@óvóxó¨ó§óÔóÕóÿóýó%ô&ôWôUôŸôŸôõõ õŸõzöyö÷ž÷ùùÕúÕúéüéüMÿMÿìí¹ºZ [ ý ý `_ce÷õ  ŒŒÝݨ¨ôôÊÊF F u v zyddXXdýeýžúžúøøÎõÐõÙóÙó9ò7òãðäðÖïÖïïïîîîîÞíßí¼í»í³í³íÆíÈíýíûíZî[îçîèî´ï³ïÉðÈð0ò1òìóìóöö€øøNûNûpþpþÏÍZ\ ýœ \[>>«¬†„ÁÁ@Aúúðñ--ÇÈÔÔpp® ¬ ®®pqgühüŒøøôôñô¨ñªñ¿îÀî4ì4ìêêOèPèõæóæ÷åöåOåRåüäüä÷äöä<å<åÐåÐ峿´ææçåçnéoé]ë]ë½í»íˆðˆð¸ó¸óG÷H÷0û0ûdÿeÿÔÒ]_ï ï gf¦¦ûûÔÓô!÷!W#W#â#â#‹#Š#Q"Q"? @ ^]ÃćˆÉÈ© © JKÖÖoûoûCöBöhñjñííééÌåÌåããôàôàfßfßfÞfÞëÝëÝðÝðÝoÞpÞ^ß^ß¹àºà~â|â¨ä¨ä2ç1çêêfígí ñ ñõõOùPùÜýÝý¢¡ˆ‰€  gg+*  ¡¡ " "¹$¹$¢&¢&®'®'Ë'É'ñ&ó&%%$%j"l"ÛÚ„…‡…+ +   þ þøømòlò3í4íŒè‹èŠäŠä:á:á¦Þ¦ÞÑÜÐܺۼÛQÛRÛ”Û“ÛnÜoÜ×Ý×ÝÂßÁßââÅäÄä¾ç¾çþêþêwîxî*ò)ò ö öúúEþDþ‹‹ÜÞ0 . lm…‡ecëë › ’"”"Ö#Õ#Q$R$ø#÷#º"¼"§ ¦ µ´üý†„lkÛ Ý  *ÿ*ÿiùiùìóëóÜîÝî^ê_ê‹æŠærãrã%á%á¡ß ßåÞçÞïÞïޫ߬ßááçâéâAå@åôçóçæêçê î îGñIñ“ô‘ôÚ÷Û÷ûûDþCþYYVT9:þ ü ¤ ¥ ))……©¨! XXkj,,Z[ïîééII"!{ { oo þžþ"ú$úÏõÍõÃñÃñ*î(îëë è¢èææçæöåôåÓåÓåsæuæ½ç¼çžééöëøë²î±îªñªñÆôÅôé÷ë÷øú÷úÝýÞý†…äåòñ®¬/ .  › ›   C C g e r t h h M M   Ö × h i Î Ï ûúççïíØ×þ€þüü‹ùù÷÷Öô×ôÌòÍò!ññâïáï ï"ïèîèîEïEï2ð2ðªñ©ñšóšóüõüõ¯ø¯ø˜û˜ûšþšþ––rq = < ô ó ! Æ Ç î î ” ” Ê Ë œ › ' ( zzµ´âástóþóþ£ý¤ýˆü‰ü¥û¥ûòúñúeúfúýùûù¡ù¡ùPùRùÿøÿø¢ø¢ø;ø9øÄ÷Å÷G÷F÷ËöÌöaöaöööûõüõöö‡ö‡öF÷D÷]ø^øÏùÑù–û–û§ý¦ýøÿ÷ÿqrþ…ƒè é   è æ QQ99–˜caœCDh g   ts†‡}þ{þ’û”ûéøèø’ö‘öŸôŸôó óòò{ñzñHñHñrñuñåñäñ“ò’òfófóVôUôMõOõJöIö9÷9÷øøùøøøÈùÉù•ú•úhûhûGüFüAýCý\þ[þ ÿ ÿ  §§hhKK;<+ * þ ý £ £  ¦¥ÅÅdb{|' ' Î Ð !"ÿÕýÖý¸ú¹úÏ÷Í÷2õ0õõò÷ò2ñ2ñìïìï)ï(ïÞîÞîïï¦ï§ï ð¡ðÝñÝñKóLóËôÊôOöPöÈ÷Æ÷*ù*ùlúmúŒûûüürýsýDþDþ ÿ ÿÈÿÊÿ––ttljyz«­ööVT¾¼  k j ’ | {  fgA@¥ ¥ ‰ ‹ þ þ ÉÈEF™—ÙþÜþ/ü.ü®ù¬ùf÷g÷uõuõàóàó¶òµòùñùñ¨ñªñ½ñºñ+ò,òèòçòàóàóõõ@ö=ö}÷÷µø¶øÕùÔù×ú×ú²û²ûdücüòüóüdýdýÅýÃýþ!þˆþ‡þÿÿžÿžÿ\]DFXW’ççQQ¾¾  Y Y j j / 1 ¬ ª  à w v ¹ ¹ ‘ “ 76!#ãኊ4þ4þúûúû÷ùùù6ø4øÅöÄö§õ¨õåôæôxôyô^ô\ô‰ô‰ôïôðô†õ†õ:ö:ö÷ÿöÈ÷È÷ˆøˆø9ù9ùÖùÖùXúXúÆúÇú$û#ûrûuûÅûÂûüüŠüŠüýýËýÍý­þ¬þ¾ÿ¿ÿvv  ¯²SRãäH H u t R Q Ð Ï ê ì   Ÿ ç ê Ò Ï [ \ —•“•gg%%ßþßþ®ü®ü¦ú¥úÑøÑøD÷C÷ööõõ…ô…ôDôDôRôQô¦ô¦ô1õ4õäõâõ®ö¯ö€÷÷XøVø&ù'ùéùêùœú›ú?û?ûÔûÕûfüeüôüôü‡ý‰ý)þ)þàþáþ¶ÿµÿ§¦µ´Þà  pq¿¿ÿÿ !   Î Î < ; J H ÷ ø B A * + ÂÁ  ÒÿÑÿýžý~û~û†ù…ùÀ÷Á÷GöEöõõOôNôáóàóÌóÍóôô«ô«ôŠõŠõ£ö¢öç÷é÷GùFù­ú­úüüqýpý°þ±þËÿÌÿ¿¾Œ23»º'*ƒ‚ÔÒ!nlº½  ZZ¥¥åæ""  ÌÍZ\±°Ñг²abàÿâÿ>þ=þ‡ü‡üÀú¿úù ùj÷j÷ööàôâôô ô™ó™óó‚óÓóÓó‡ô‡ô–õ•õùöûö¦ø¥øúŽú•ü•ü²þ²þÌÊÔÓµ·ddÐÐìí¼ ½ 6 6 Z Y 1 1 À À   DDJJ;9òñÊÉ«¬‘ÿ‚ÿrþrþcýcýWüWüLûKû;ú<ú+ù*ùøø÷÷üõýõõõ'ô&ôkólóßòßòòŒòòòÂò¿òYóZóLôKôšõšõB÷D÷FùCùû‘ûþþØØ¥¦qp  š š Ê Í  ŸììWWBA±±¨©42` a > ? ââ^]¼½þþýûþû¡ù ùu÷t÷|õ~õ½ó½ó4ò5òïðîðäïäïïïîîîîðíïíøíöí/î2î§î¥îUïVïIðIð|ñ{ñ÷ò÷ò¹ô¹ôÆöÅöùù´û´ûƒþ‚þ††¨ªÝÞ  $#›œÍΊ‰ÀÀaaWUž?=MLÑÒåå• • þþ55Z[†ý…ýÈùÇù>ö@öüòûò ð ðí~í\ë\ë¦é¨éeèdèçç$ç$ç ç ç}çç5è4è;é;éŒêŒêììííííùïøï=ò=ò»ô¼ôi÷h÷CúDúJýHýrs¹¹h i ° ¯ ÙÙÈÊtr¾¾”“æç££ÂÂ88''««šš  µµ*+þþüùüù˜õ–õ|ñ~ñÇíÆí‹êŒêÖçÕç­å®åää%ã&ãÃâÂâèâëâ“ã•ã¸ä¸äFæDæ+è*è]ê_êÑìÐìwïxïDòBò1õ3õ4ø3øLûMûqþoþ™›ÃÃçæ   ð;:üýJK^^€‚RQEEˆ ‡ j k }}èûéûi÷k÷!ó ó&ï&ï”ë•ë†è†è æ æ/ä0äûâûânânâ„â„â?ã?ã‘ä’äeædæ˜è—èëëÒíÕí»ð¹ð´óµó½ö¼ö¿ù¿ù­ü¯üŒÿ‹ÿOPúø…ˆö ô @ A ghee89ÒÑ*+88ñòIH77²³µ¶0/%$œ§ ¥ R T »¹ïð þ þ,ú+únönöçòèò¸ï·ïñìòì­ê­êóèòèÐçÐçDçEçTçSç÷ç÷çééÀêÂêÆìÅìïïªñ¨ñWôYô÷÷½ù¾ùSüQü½þ¿þööþüÊÊffÑÑ  1 2 , -   È Ç h j æ ä ==ijcd#"¤ ¤ Þ Þ Ð Î s u ÊÊÚÛ­¬IIÃÿÂÿ%ý&ýˆúˆúøø§õ§õ“ó’óÛñÛñˆð‰ð«ïªïCïCïSïTïØïÖïËðËðòòÄóÄóŸõžõš÷š÷§ù¦ù§û¨û’ýýRÿRÿàá55FF¨¨ÿÿ().-íì½½jlSRFFCCGGFF>="éæ  ij˜™«ªÿ›ÿ|þ~þTýRý/ü/üûû!ú"úYùXùÉøÊøzø{øyøwø¼ø½øPùPùúú$û$ûOüOü’ý‘ýÙþÙþ%&  ¹¹('VV?@ééZZ¢¢ÉÇßÿßÿòþóþ þ þCýBý˜üšü"ü"üÝûÝûÌûÎûöûõûOüOüËüÌümýjýþ!þØþÖþ‰ÿŠÿ*+­« FGXW@A  ¾Àed »ÿºÿ‚ÿ„ÿiÿiÿnÿmÿ›ÿ›ÿéÿêÿWVÝÞts¡ vtž ——SQÓÓ*+¿þ¿þjýjýüüÙú×ú¸ù¹ùÎøÍøøøº÷º÷¡÷¡÷Ð÷Ò÷EøDøöøöøßùßùîúïúüüUýSý‰þ‰þ®ÿ®ÿµµŒ33ž›ÏÑÓÔ®¯nkÄÅ}~IH//66^a§¦lmØÙ;<ŽŽÃÂÒÒ²±\[ÑÑÍþËþ†ý†ýDüFüûûúúDùDù«ø¬øTøRøAøCø{øzø÷øøø®ù¯ù˜ú—úšûšû¯ü®üÂýÄý¿þ¿þ–ÿ”ÿ55£¢ÖØÚÛ±°a`ùÿúÿƒÿƒÿÿÿªþ¬þfþeþCþCþPþOþþŒþùþúþ“ÿ“ÿTR-/áᢠ,-}}ŽŒ[^èç;:aakjbdVUMÿNÿYþWþý€ýÉüÊüEüFüðûïûÒûÑûâûãûüüvüuüÖüØü6ý3ýzý{ý¡ý¢ýý›ýmýnýýý’ü“üùûøûJûJû–ú–úîùïùcùcùùùÛøÛøñøñøNùMùñùòùÛúÝú ü ütýrýÿÿº»zz0.ÅÆ'&DD  – “ À à ž 8 7 ­¯˜—__×Ù©§œµÿ¶ÿüþüþeþeþæýæýtýuýýýŽüŽü ü üwûuûÌúÍúúú;ù:ùZøZøn÷o÷ƒöƒö¤õ¤õèôèôZôZô ôôúóûó?ô?ôåôçôñõðõ`÷`÷(ù'ù4û6ûzýyýÙÿÚÿCD™˜À¿¬­I I “ ” † …   G F   € ™ ™ b b ÷÷llÙØPRêꤣ‚‚{ÿzÿ†þ‰þ¨ý¥ýÕü×üüüPûQûúŽúÅùÃùíøïøøø÷÷*ö)öDõDõnônô¼ó¼ó8ó8óîòðòõòòòFóIóùóøó õ õööLøJø_ú_ú®ü¯üÿÿ””þÿCC[[+ + « « Å Æ l k › š H K … ƒ Z X è é PQ¨¦{y·¶‡ÿˆÿ‚þ€þ©ýªýüüýü€ü‚ü)ü(üæûçû´û³û{û|û8û7ûÛúÜúhúgúÜùÜù9ù:ùøŒøß÷ß÷<÷=÷½ö¼ököjöWöVööŽö÷÷î÷ì÷ ùùpúnúüü½ý¼ýÿŽÿmmLLº»  ¢ £ ² ± D E ih86ÍÏIH¸·+,³ÿ³ÿTþTþ(ý(ýFüEü¶û¶û…û†û¬û«û!ü!üÒüÓü«ý«ý‘þ’þrÿrÿ<<ÜÜIGxzdd¾ÿ¾ÿÙþÙþèýçýøü÷üü ügûhûÝúÝú„úƒúkúkú›ú›úûûóûõûýýcþbþ¿ÿÁÿ  ×Ö0000ÛÞA?hg_a,ÿ*ÿÕýÖýtütüûûéùéùùù‚ø‚ø}ø|øýøüøùùûùhûhû.ý/ý8ÿ6ÿdc•–°±Œ  4 5 Ú Ú þ ÿ Ÿ Ÿ Ç Æ ……çèÿç黺þ‘þ’üüÚúÜúŠùˆù¶øµøZø[øxøwøéøêø›ù™ù^ú^úûûÇûÆû[ü\üÑüÑüýý(ý'ýßüÞü:ü:ü9û9ûüùúù ø¢øV÷U÷QöQö©õ©õ‚õõâõâõÐöÏöFøFø;ú<ú™üšüQÿOÿEDVXb`; ; ¿ ¿ ËÊ;<þþjkk j ]^ ççíþîþ[üXüDúDú±ø³ø›÷š÷óöóö¨ö¨ö±ö±ö÷÷•÷–÷WøWø1ù0ùúú›úšúáúáú¼ú½ú.ú-ú@ù@ùøøãöâöÊõËõ÷ô÷ôuôuôYô[ô§ô§ôlõlõ¯ö­ölømø§ú§úQýQýOO||´µÈ Ç ” • ôôÑÐ  œwxœœ‚ ƒ ÁÀëì'$‹Œ.þ/þüü<ú?ú½ø»ø ÷Ÿ÷÷÷ùö÷ö^÷`÷øøÍøÎønùnùÒùÓùéùéù¶ù·ùKùKùÃøÂø0ø2ø¤÷£÷÷÷œö™ö*ö+öÐõÐõ¢õ¤õ¸õ·õ%ö%ö÷÷[ø]ø'ú&úTüTüÊþÊþrp,/äãs t ¾ ¾ « « ýüNPhhNOâ ß     ÄÅNMËËcÿbÿCýDý‡û†û?ú?úgùhùîøíø³ø²ø•ø—ø‚ø€øtøtøpøqøˆø…øÅøÇøùùrùrù¡ù ù‹ùŒù(ù(ù‹ø‹øÐ÷Ï÷÷÷zö{öööööCöEöÜöÚöÑ÷Ô÷)ù&ùÙúÚúìüëüHÿJÿäâ  ab € ‚ ¦¥ii´²op{{º»#"Ö Ô   ýüîðWÿVÿæüæüºú¹úÔøÔøC÷C÷ööwõxõ_õ`õ×õÖõÁöÁöö÷÷÷GùHùwúvúYûXûÒûÔûÜûÜûzûyûÂúÂúÇùÇù¡ø ø`÷`÷ööôôóô ô ô•ó”ó®ó°ósôsôöõ÷õ,ø,ø û ûsþrþGF^`ˆ † ˆˆ    ëí¹·‹š—   ¾¾UTíüïüºø¸øõôöôúñøñððdïcïÞïÛï>ñ?ñBóCóšõ—õøøKúLú>ü>ü»ý»ý­þ­þ ÿ ÿËþÌþïýíý}ü~ü”ú•ú[øZø ö ößóßó!ò!ò ñ ñÌðÌðŽñŽñZó[ó8ö9öúúÔþÕþ==÷ ö ••¥¥ÇƼ½ih·¸·µooùúuv ±°wúxúÄôÅôùïøï]ì^ì%ê$êUéTéÜéÝé‰ëŠë#î"îWñWñåôæô‹øŠøü ü,ÿ*ÿ©ªIGÕÖSTÎÍxÿxÿ”ü”üxùxùqöqö×óÖóóñõñññGñFñÄòÄòŒõ‹õxùyù`þ`þñðÓ Ô   ˜š'%oo@ A Ž=>ONØÙ  ˜—âýáý—ö™ö.ð.ðëþê<ç;çþäþäJäKäååççêêïíîíaòaò ÷÷­û«ûÜÿÜÿTUÓÕ10VVQPJK‡‡QþRþ ûûü÷ü÷‹õŠõ ô ôÍóÎóñôðôn÷o÷ û û‹ÿŒÿ Ÿ  ZZMLŠŠÀÁ­­  ·¶ª«-,_]ÉùÉùïòîòæìèìèèää{âzâøáøáôâóâPåRåýèýè«í¬í óó˜ø˜øêýêý¡¢qp  ³ ³ ² ° »¼õþôþ#ü%üîùîù‹øŠø"ø"øÎøÍøŒúúMýMýíí)*À Á vsèê¶µ\ZsvÎÍxxžž‚€ooÍÎ û û‹ô‹ô¨î¨îµé¶éíåíå‚ã€ã‹âŒâããååMèOè³ì³ìîñïñ¥÷¤÷nýmýèꬬo p ø ö #$öö   ÎÎDEÃÄýœýûûUùTùŽøø×øØø;ú;ú§ü§üúÿûÿõõEE€ € CB+,îîXWSUâá ; < OýNý÷÷ùðøðŠë‹ëççûãùã_âbâjâhâþãÿãççiëhëÐðÏðãöäö.ý.ýIIÂÂN O ¢¡˜š(&``kjz z Ø Ù ÊÉœœ•ý”ýúúA÷@÷„õ…õõõáõâõøøŽûûÙÿ×ÿzzëëÈ È ÅÆ±°TT››€~% ' ¿¾Š‹ÞüÞü÷÷‹ñ‹ñšìšìèè³å³å4ä3ä>ä>äÜåÜåéé–í—í;ó=ó¢ù£ùTTØÖ§ ¨ ]\§¨}~ââíí°¯RR  ÓÔ°ü²üøøzôxô"ò$òDñCñçñçñåóåóÿöÿößúßú9ÿ7ÿ¸¸Í Í ½¼—˜@Añ ñ Y W µ·hhÓúÓúTõTõ<ð=ðêëèë¦è¦è¼æ½æ_æ^æœçœçsêtê¤î¢îâóãóÆùÆùèÿçÿááV V ûû  87æèÎÎ@ @ ­­Ž…û‡ûOöMö^ò^òòïòïöîöîQïPïïððð¸óºó÷|÷óûôûÁÁ‹Šó õ ž :9”–žœOP¿ À   ‘ijìúìúvõtõkðlð;ì;ì;é;éªç©ç¹ç¸çkékéŒìŒì½ð¾ð“õ’õ·ú·úõÿöÿé ç ÿ ÇÈ´´þþ, , ¯¯ýüxýyýxùyù6ö4öÙóÚó‹òŠò^ò`òióhóžõ õèøæøýýÃÛ›( ( éè©©))]_BBë ì ‡ … UT­þ¯þþøýø¦ó¦ó ï ïuërëéé÷çùç(è%èŽéŽéìì—ï–ïïóðóèøéø<þ:þŽŽvus s 65ÅÅ‘ ’ wwdfÓýÒý˜ú™úõ÷õ÷+ö+öfõeõ¾õ¿õ8÷6÷´ù´ùýýæç8 8  II­¬üþàâ[Zš š ÖÔ^_ üŸü÷÷òò½íÀícêbêèèîæðæççŸèžèuëwëzïzï_ô`ôÈùÇù9ÿ7ÿNO«ª  jm¥¤ÑÐëë  G H ÚÙ  ÿÿsûpû]ø]ø0ö1öõõ5õ2õSöUöføfø;û;û®þ¯þ|zY[ÿ ÿ $ $ „„êë32JNIH< ; Z[ÚÛ þ þ5ù6ùžôžôzð{ðíí‚ê€ê)é)é;é<éØêØêâíâíòòÊöËöÂûÁûœ-/I H ¸ ¹ =<«­îì    ! ‰†Œ€ÿÿ û û3ø4øiõiõxóvó~òòò‹òóŸó¦õ¥õ€ø€øûûûûÖÿÔÿ·¸STX X å ä HH¾ Á Y X   ""••¦ÿ¨ÿšû™ûÃ÷Ã÷tôuôüñúñ‰ð‰ð3ð5ðððïðœò›òõõ#ø%ø±û°û†ÿ„ÿjm)&m n   ¦©A@¼¼/ 0  Á ¦¨41FüGü…ø…ø0õ1õ{òyò‘ð‘ð‘ï“ïïïððzò{ò6õ6õˆø‡ø8ü7ü´µ&$> > Û Ú ÊÍÀ¿z|ï í P Q —–.,øýúýûûˆø‰øŠö‹ö:õ:õ¶ôµô õ õ=ö=ö0ø2øÎúËúÛýÙý"#gjomý þ è ç    3 6 H H ~{ýýÁûÂû÷Œ÷°ó°órðrðîîì€ìüëûëìì î î›ðšð#ô#ô‰ø‰ø‘ý“ýðï,,Û Ü ™™IH22ÿáßô ô T S  RT‚üü ø øWôWôÀñ¿ñvðxð‰ðˆðáñáñXôWô¸÷º÷ÄûÃû-*©ªàà„ ‚ BCææBAHHö ö r q ïí®±ûû?õ@õ±ï±ïµê´ê«æ¬æää ããNäOä•ç—ç²ì¯ìóóúú$#ÓÔÞ Þ ÚÜ  ‹ŠLNhgÀÀâà ûûÞôßôÉïÇï7ì7ìWêXêGêHêøëöëLïLï ô ôÓùÓù;<ÈÉý ü efŒŒ·´`a  ‰ ˆ ÆÇIùJù­ðªðšèšèÊáËáâÜàÜ\Ú\ÚsÚtÚ"Ý"ÝââÄèÆè§ð¦ð2ù2ù¾ ¿  \\  ‹#‹#\$\$k"j"ýý”“ÎÐ^^äþáþðöòö ðð“ê“êåæææ@å@åºåºå[èZèóìòìBóBóÏúÎú  P Q ùùlk)(· ¸ ª © ÆÆ  ÞÜåæûû+ð*ðCæBæÞÞNØMØ!Õ!ÕžÔžÔ±Ö°ÖÛÛ¦á¨áêêÞóßóµþ¶þó ð ÎÏxw&& + +Ù,Ù,n+m+''I I ÇÇ10'(;ú:úôðóðïèðè¿â¿âîÞïÞÓÝÑ݆߈ßÝãÝãmêmê¬ò¬òèûèûjikl??,+ŸŸ- - µ·ba¤¢&'¹üºüBòAòœè›è‡à‰à|Ú|Ú¶Ö´ÖLÕKÕ^Ö^ÖÚÚnànà]é^ézôxô÷øÎ Î ØÙ$$°+¯+M0N0Í1Ë1C0D0,,d%d%ÓÔÁÁ««1ü1üññøæ÷æÇÞÇÞ)Ù(Ù…Ö…ÖÿÖ×iÚhÚjàkà~è~èòòüüØ×IK¶´¬­ññ””ÃÂÿäå(*køiø-ñ+ñÌêÎê¦å¥åââXàYàïàîàääûéüé„òƒòýýã㥦FEÖ'Ö'½-½-¸0¸0â0ä0€.}.Í)Ð)ñ"ñ"IKolS÷U÷íëíëââfÚhÚ_Õ^Õ)Ó)Ó·Ó·ÓÕÖ×Ö%Ü#Ü2ã0ãcëdëôôŒüˆü#%T U »¹|{  : 9  € FDÏÑ=ü;ü·÷¶÷ ó¡óžððcïdï”ð“ð^ô_ôŒúŒúgfÿ NMvvôõ‹#‹#K%I%M%N%Â#Á#— — ÂÀ· · ÷ø€ø€ø:î8îå å£Ý¤Ý‚Ø€ØÉÕÊÕcÕcÕ&×%×½Ú¾ÚÑßÑßùåùåÇìÇìÂóÃóhúiúLKžé ë , + Š Š 0 / 0 0 ˆ ˆ 14LJ((lþmþÒüÓüýýhÿgÿÜݲ ² ¼»®°ÅÄñò¾¼ÓÓ’’ÞÞegÄĹ ¸ __üü§ô§ô¸í¸íéçêç›ã›ãðàïàÞßÝß4à4à¾á¿áLäLäµç´çÚëÙë‚ð‚ðcõdõ#ú#ú_þ^þÇÈJJ‡‰ÖÕó ö – “ \ ] 3 3 \[po24PPO O R R ('ÚÛÌÍ×Öbb++  rqurˆ‰óòþþðøðø"ó$óÎíÌíñéóéèèèècédéZë[ë¦í¦í)ð)ðßòÝòÉõÉõÐøÑø¿û¿ûWþWþaa½¼{|ÉÊüúOPÙÙooÈÊ¢ ßßÁÂãâ01kj³± !!#QQ£¢t t üýÇǶÿ¶ÿ þ þðûîûÏøÐø¸ô¹ô9ð8ðFìHìÔéÓééƒé`ë^ëáîâî,ó,ó{÷z÷[û[û¯þ°þ¡¡MN¨¦jm4 1 ¿À9;ßá ¾ÿ¼ÿ»þ¾þÇýÆýœüœüDûCûúúÐùÎùûûþþê껹QRWV­®öö¸ · ;:~ÿÿþþØýØýrýqý0û1ûˆöˆöð‘ð\ëYëÅèÇèƒéƒéíí%ò%ò·÷¶÷þüÿü¢£‰ŠÓÒ ³ ³  ^^yxc d \ ] ÏÏ65åþæþ ü üù‹ù ÷!÷ ô ô>ò?ò²ð³ðññôô–ù™ù¿½±²¤ ¥ uv d b ËÊTVžž©§ š™üüýüÝ÷Ü÷½ò¾ò]ï^ïïîïîšñ™ñ{ö{ö)ü*üff~|no¡ ¡ ~ ~ BBvtfg  ÎÏIJÂýÃýúú—÷•÷¶ô·ôòòÁïÃïî€îËîÌîññfõeõûûäãVXàßâàÔÕÁýÂý}ý|ýjj¾¿, . æãrtNûNûˆø‡øÖø×øÅûÄûuwùø! #    » ¼ / - m n BCxyìì¶´!ý"ý£ù¡ùœöö7ô7ôkòkòòðñð¢ï¢ï™îšîXîXî„ï…ïŒò‹òP÷O÷ ý ýqp&&DEÉɤ¥aÿ_ÿ“ý”ý4þ5þ+*jl= >   ××ÿ‘çç)(( * dcBCðñTTP P SSQOùú!þ"þÚùÜùkõiõ5ñ4ñ–í–íàêãê/é/étèsèˆèˆèUéUéâêáêFíFí±ð±ðGõGõßúàúúø°³õ ò Ë Ì Ç Ç ji*-GEff»¹ ’ d d US7 9 ЉGGkkññr r ‘‘..¶·CBKKi g ˆ‡¸þ¹þŽùùôôXîXîíèìèHäGäÙàØà×ÞÖÞMÞQÞßßòàôàÙãÙãÜçÚç íícóbó}úú±¯È Ê SQ°²‹Šê ê ô ó t t }|WW¤£&'ML /0÷øu v €  ==**µµKJ° ± –•98žÿŸÿ²ú±ú~õ}õððÄêÄêèåéååáçáüÞüÞBÝCݼܼÜVÝUÝß ßÐáÑá¯å¯å¤ê¥ê–ð”ð5÷4÷þþec­ ¬ T W (&ŒŽŒŠUU¦¥46ÛÚ45^^TTçç@?wxµ¶m n ö õ twxwfûhûƒööËñÍñ>í<íÝèÞèåäçä¾á½á¶ß¶ßëÞêÞ8ß:ßSàQàââ/ä/äþæþæ…ê…êÂîÁîóóqøpø"ý#ý==ÑÒT T   XYŠˆxy³³ihÐÒd a 79¹·:;rsÜÚÉÉ 78(ú*ú<ó;ó¸ì¸ìÔæÓæÌáÍááÝáÝPÛQÛKÚJÚÒÚÔÚÂÜÁÜÅßÄßpãqãeçeçtërë€ïï›óó×÷Ö÷ ü üóÿôÿ%$ÿÿþþ¹¸ÂɈEF  ¬­ßßÃØ—{|‰ Š ý û ó ô l l ..Üݦ¥Œ Ž ÜúÛúTñWñèè‰ß‰ß6Ø4زҳҒϑÏÏ Ï@Ñ@ÑqÕrÕùÚøÚ#á#áuçvç´í³íÒóÓó×ùÖù ÿ ÿØÚ  ì í 3 3  ½ ¼ ô ô 87ùù~}ßá**d c † ‡ [[wvfh¾½Z[@!?!q"o"²"³"ª!©!îñ87|}ë é îïööëë„à„à\×\×2Ð1Ðˎ˽ɿɽʻÊ3Î3ÎŒÓÓ)Ú*Úsásáùè÷è’ð’ðHøIø0/-,ãä43ÓÓ““  yx  ì î €~µ·† † : 9 ttÃÄÞÜŒŽ¿½XY··¨§--˜—$þ%þòœòýæþæ^Ü\ܳӳӜ͛ÍUÊVÊÆÉÆÉËËÏ ÏøÓøÓ­Ù¬Ù*à)àzç}ç­ï«ïøøÙ×´ µ a_BBüü ¡‹ŒCB10““‚ƒ0/  · · › › ± ³ š ™ ¾ ¾ Ý Þ __ô󇇟¢žñò;:l m ××ùùòïñï,ç,çtßvßVÙVÙÕՉ҈ҬѫÑ%Ò%Ò·Ó·Ó$Ö!ÖpÙrÙêÝèÝöãøãéëêëƒõõèÿçÿà á pnº»Ï Ï ”"”" # #"~"¾ ¿ õö©¨}~˜—óôu t   ùøZ]‡…AAEE!#A?½þ¾þ9ù7ùwówó:î<îÙéØé\æ]æŸãŸãhágáߎßîÝîݎ܎ܘۗÛrÛrÛÜŒÜ[ß]ßääÂêÃêïòïòûûûût t µ¶Ä¸¸µ#¶#©&¨&U(U(‹(‹(L'N'à$Ý$!!âãŒ‹Ç Æ  çèÕþÕþýûýû2ú3úùù*ø,ø÷÷yõzõóžó½ñ¼ñ8ð9ð\ï[ï6ï6ïŒïïúïúïþïþï;ï;ï’í‘íëë3è2èXåYå(ã)ãSâTâdãbãæ‘æ§ë¥ëòò5ù6ùuuƒ„POÑÏîïq p %%|(|(~*~*ð*ð*À)¿)ô&ô&ž"ž"àárrÄÄšÿ™ÿrùrùŒôŒôÈðÈðÊíËí=ë;ëééŒç‹ç(ç&ç;è>èÏêÎêqîpîsòsòöö¬ø«øéùêùÀùÀù_ø`ø#ö öhójó©ð§ðOîNîÂìÃìbìaìaí`íÒïÓïó€ó øøýý``}|ÜÝ™ ˜ -%+%3(5(u)u)Ò(Ò(<&;&Ö!×!åãÖØ9 8 ‰Š/þ0þp÷p÷gñgñìì¦ç¦ç.ä.äââzáyá×âÖâ$æ"æëëÎðÍð…ö„öLûNû’þ’þ55uvÅÿÃÿpþpþ ü¡üqúoú$ø%ø-ö-öúôøôÅôÆôõõ÷÷-ù.ùôûõûdÿdÿ‘‘aa¯ ® 46‚‚•”$!$! ! !DCèé21iiø ú CA˜ý˜ý7÷:÷FñDñóëôë™çšç¤ä¢ä€ããhägä4ç4çqësëdðeðFõDõù~ùÀüÀüÿÿ›™–— !+*¡ mnºþºþçüæümûmûšú›úyúxúÑúÐúwûwû|ü~ü&þ&þ¦§úúÔÓÆ Ä dfaa{zŠˆ†ˆno_^jjà Á ’zþzþüùüùÚõÛõSòQò®ï®ï+î-îîî-ï,ïññwôvôl÷k÷ÅùÄùEûEû-ü-üûüýü þþ_ÿ\ÿ  ÕÔ*ÿ'ÿjþlþþþõýõýþþKþKþ‹þ‹þéþçþÿŽÿ—˜×Ùº¸}}ðñô ó ˆ Š ª ª S R r r BAJIOO‚„úþøþÄýÅýöüöü•ü–ü›ü›üõüõümýnýÈýÈýÃýÄýBýAýQüQü*û+û"ú úˆùˆùxùwùÖùÙùUúSú’ú”úƒú„úVúTúyúyú2û1û‚üƒü þ þgÿfÿTUÛÛ0/~ÝßCD¢¡íê57:8((ÉÈ„†NNDCŒ@Afdãäyxàà× Ù 9 9 í î ÞÞýýMLþÿpýoý ú ú8÷7÷õõ›óœó‹òŒòÎñÌñiñiñŒñŒñmòkòôôköjö+ù+ùüü•þ•þ±°;=JJðð@BMJûû@@Óÿ”ÿoÿpÿîÿíÿ<>wwusÓ Ô   ÕÔžŸFFÃÃ,, œ 7 6 #$Œ­ü­üÕ÷Õ÷fófó¥ï¥ï°ì±ìuêtêðèñèJèJèÓèÒè¼ê½êàíàí×ñÔñöö:ú9úþýþý56ËʺºÓÐÑÑ*)*)ãåvtüüªªËÿÌÿ«ÿ¬ÿ—•±±ðñ  SS˜—‹‹ihç æ ÿ =?ËÿÊÿúúBôBôóîóî^ê^êµæµæää·â·âšâšâÖãØãpæmæ2ê3ê×î×îôôDùEùNþNþÒѯ®É Ë ' ' » » tu£ £   õ ô ppÕÖ—•$&æäýÿOPwuÖ Õ Ý ß NMƒ„ëê°°ñ ñ Š Š <=ÍÌKþMþ øøÙñÛñìì ç çããTàVàÜÞÛÞÔÞÔÞPàPàNãNãçœçèìêìÔòÑòôøöøýþýþ«©Æ Ç ..»»STÙÙ=>mmzy’’þ þ - . ¥¥ãâZY339:í짨ììœýühh  — ˜ £ ¡ ­®jjäâaþbþGùHùôôàîáî*ê*êææËâÌâ‹à‹à•ß•ßàà?â=âéåéåèêèêçðéð‡÷†÷uþuþ[\õ õ ýý&&&&¸¸ÏÏbc­­)*d c 64ÊË)ÿ)ÿ2ý2ý¹ûºû¦ú¥úøùùùáùâùšú™úBüAüÁþÁþ¡¡56ÐÏÁ¿PQÿÿûûÍöÍö7ò7òíœí_é^éñåòå³ã²ãñâñâ¾ã¾ã"æ#æöéôé ï ï&õ&õüüccé é .-ÂÃ54""$$$ $"":;¯ ¯ UVLL±ú²ú—õ—õ5ñ5ñØí×íñëñëÒëÒëííêðìðXõXõ1ú/úÊþËþª«ˆ‡/0““¯¯…„;;üüüüøø óóTîRîpêpê±ç³ç]æ\æ˜æšæèèJìIìªñ«ñhøgøUW‚ƒ@AË"Ê"V%V%Ð%Ð%9$:$Ç Ç ±±VVþ ëýêýûõûõ²î³î‰èˆèää™á™á˜á—áÿãä}è~èyîxîAõ@õüüxvÊË» º „C E s r baxwüüÎöÎöëñëñÜíÛí÷êöê’é“éééêé'ì'ìEðDðöö;ý9ý(*@ > ÙÛcaj l ¤#¤#Ð$Ï$Ø#Ö#¦ ¨ vt\ _ mkCúDú†ñ…ñÓéÓéËãËãÙßÛßAÞAÞßßââçç|í|íËôÉôZüZü‡‰Å Ä ––²²îíWX&&˜ ™ ø÷‰‰®ü­üÞöÞö§ñ¨ñ¥í¤íKëKëúêúêÇìÇì–ð—ðüõýõ{ü|üyxp q éçwyÓÓ¬©ÌÌúû%&_]åæ*(¯ÿ®ÿ÷÷ïïRèQè'ã(ãðßðßæÞæÞEàEàþãþã²é²é²ð²ðBøAø±ÿ²ÿkkþ þ „†hhÕÖéç¶ ¶ p q \]ÔþÓþKùMùZôZôŠð‰ð_î_îîîËïÌï2ó1óà÷â÷YýUýËÌÂÁrrÐÑ~}:<þü± ± ¢¡hûjû“ô‘ô™î™îÓéÓ鋿‹æøäøäCåCådçdç=ë<ërðsð‹ö‹öøüøü%&ŠŠÍ Ì ÊÊ€‚  ^^zzV W »ý»ýÎøÏøàôßôjòkòœñœñjòjò‘ô‘ô«÷«÷[û[ûYÿZÿss€€] ^ ÉÇqröõff$$y { ñî þ þ[ø[ø9ó9óùîöîâëâë-ê0ê ê êlëkë@î?î:ò;òüöüöüüíëGJä㣠£  ~ mmiho q } { š›ôõßÞÍüÍüEùDù½öÀö~õ|õ•õ—õÊöÉö¸ø¹øüúýúiýiýòÿòÿ¹ºÀ¿ÌÌx x N M ì í % $ êéüüøøoõpõóó”ñ–ñþðýðZñ[ñªòªòÐôÑô¥÷¤÷áúàú;þ;þuvWVº¼ŠÃ Ä \ ] K L ƒ ‚ ÿÿ×ÕKL½¼‚þ„þãüáüñûòû¨û¦ûÎûÑû8ü6ü¸üºüIýHýÿýýýÿþÿþ`bó󘘦¤ÕÔœœ¶µ¶·ÑþÑþ'ý&ýÆûÇûÀúÀú ú ú©ù©ùù‹ù³ùµùúúÈúÈú¦û§û­ü¬üÇýÆýãþäþìÿìÿÕך˜:<À¾"#aa€…„|}uu‚ƒ¶µôõÂÃïî²²YX5ÿ6ÿyþzþ#þ#þ þ þûýûýÉýÇýfýiýñüïü‹ü‹ü_ü_üƒü„üýýÝýÜýõþõþ/.fdjl""_^  qssqQQ$ÿ&ÿûýúýÊüÉü•û–ûtútú‘ù‘ù"ù#ùQùPù-ú-úµû¶ûÆýÅý0/»»>>_ ^ ­ ¬ F E   4 6 «ª¤£Y[îìsÿuÿìüíüSúQúÂ÷Â÷‰õŠõÿóôlóióÙóÙó1õ2õV÷W÷úúPýPýªªÖÕ€jj{ | ´ ³ 0 0  [\;:«ª¾þ¿þ ûŸûŽøøåõåõôôBóBóÅóÆóƒõƒõ5ø5øpûpûÛþÜþ43YZ=<É Ê Ö Ö 46ÊɆ…^ ` ^ \ ‘’33'ý)ýRùPùøõùõ_ó^ó¯ñ°ñÿðþðNñOñ”ò’ò¿ô¿ô¨÷©÷ûû«þ¬þjh  1 2 ­ ¬ m m Z [ WV}­ý«ý¨ú©únønø#÷#÷µöµöëöëö‚÷ƒ÷VøVøXùXù©ú©úwüxüÜþÝþÐÐ__3 5 C C ZZoo‰ ˆ Ì Ì ] ^ €[Z((ýý ú ú\÷]÷1õ0õ¯ó¯óõòöòóó½ó¿ó õ õÍöÌöíøìøUûVûúýúýº¼nmÕÓ¦¨ÃÀ  ³³ëé+*8:ÐσƒDþDþ~úúôöôöfôeôLóLó»ó¼ótõsõøøûû4þ1þ_aˆˆ¤¤” “ 2 1 KKžžüû<=QPI I SSµ¶ÎýÍýõøöøvôxôŽðŽðníníFëFëBêBêŒê‰ê+ì,ìïïóòôò’÷“÷–ü—ü½ºØÙ· · ¥¦ÚÚAA†„¦§  SW‰ýˆýs÷r÷«ò¬ò[ï\ïFíEíììÉëÊë•ì–ìûîùîEóEóFùGùwu55pp/0רˆˆ=<BBè é ””­þ­þŸöŸöÞîÝîåçåç*â*âÞÞÜÜiÜiÜßßõãöãÉêÊê/ó-ó¾ü¿üÚÚ¢¡þÿîíË!Ì!i!i!14îî’‘ Á ××ÒýÑýµö·öÉïÈï‘é’éÕäÓäSâTâ â¡âÝåÝåÈëÇë¶ó¹óäüàüqr¦§ÒÒhg # #i%h%R%R% "¡"zy""  õ÷8ø6ø•í”íÌãÍã¹Û¸ÛõÕöÕ Ó Ó1Ó0ÓsÖqÖŒÜŽÜ å å9ï9ïGúHúB@9:tsmm!ÿ W"Y"Õ!Ô!ÕÕstPNþÿwwªû©û*ñ-ñ²è¯èKãKã4á6á3â3â¶å¶å=ë:ë5ò6ò!ú!ú}Ý Ý ¸¶€ÆÆ" "##µ!µ!ÛÝ®­pqŸŸÖúÕúêïëïÀå¿å2Ý1Ý××·Ó¶Ó“Ó’ÓjÖlÖÆÛÆÛîâëâ$ë%ëËóÌódüdü££r s ¿½bbßÞ{#}#q$r$V"U"44³³Ò Ñ Íϸû¶û;õ;õ™ð›ð±í°íBìAìì ìQíOíïïïïôô«ù¬ù<;##© « ;:\\½¼cc–•øúÿýIJ‚øø>ñ@ñðêñêÜåÚåââ¸ß·ßÞ‘Þ˜Þ˜ÞåßæßŸâœââæåæËìÊì^ô]ô„ý„ýÂÃø÷–•L M  " " " " EG+)²²© ª ÿÿMùNùIôGôœððžîîcîdîÚïÙï«ò­òö€öîúîú¤ÿ¤ÿDD}}ï î ONgh**´ ³ 7 9 âá½½¶þµþÁøÂø ò òëëeäfäæÞåÞRÛRÛDÚCÚ)Ü)Üùàúà;è<èññ¡ú¡úàâG F Œ¿À  ‚#ƒ#ø&ø&ï(ï(Ï(Ï( & &~ ~ ŽŽ('op`ü_üˆô‰ôîî5é7é×åÖå-ä,äMäNä?æ?æÙéÙéÐîÑîÅôÃô1û2û­«Á   ––¾ ¿ $%ÓþÓþ«õ«õ¦ì¦ìÅäÆäúÞúÞåÛæÛÁÛÀÛ0Þ/ÞŸâŸâoèoèRïQï3÷2÷ë ì HF}|ž'ž'¯.±.Þ2Ü2·3·33141´+´+Î#Î#<<¨©¬«·ù¹ù?ï?ïÆåÆåàÝßÝ0Ø/Ø&Õ'ÕÕÕì×í×qÝpÝ å åîîš÷œ÷Ä Æ åäÁÀàá#$¾¾:9;<‰ÿ‰ÿÖ÷Õ÷ÃðÄðÒêÓêXæXæ“ãã¢â£â«ãªãÇæÈæììŽóóýýMJgiD D ~*~*æ1ä1½5¿5 6 6 33‘-‘-À%¿%ììÓÔmømø…ì…ìðáïáiÙjىӊӗЖИИÐ`Ó_ÓØØµßµßNèOèÃñÃñeûdûtu3 3 }{||——ˆ ‡ Œ?@'ú&ú¯ô¯ô1ð1ðííyë{ëíëîë˜î˜îžóœóÌúÍú¢¡] ]  ²²‡&†&ú*ú*Ñ,Ð,,,ì(ë(š#›#ZZ‚Y Y YþYþ*ó*ó¨è§èÊßËß'Ù&Ù Õ ÕKÓLÓÊÓÉÓ\Ö\ÖéÚèÚáá{èzè‡ð‡ð›øœøwwH H [Z»¼‡†  • — ˆ‡-.ÅÄ•þ•þÝûÝûåùåùùù¥ù¥ù*ü*ü·¸îìâ ã „ƒëí••bbhhØ×ïïÏÏ£¢x y ‰‰ýý“õ•õxîwî0è1èããbßaß)Ý+ÝtÜsÜ8Ý9Ýlßlßúâùâ¹çºçMíNí;ó:óåøæøÌýÌýZZ54nmFHâáJ H o p P Q èédc CCO N R R %%_`fe•–op¸·“’[\¡ Ÿ Ê Ë ddƒþ‚þUúUúìõîõ¡ñ¡ñÕíÔíÓêÓê¼è¼èŽçç;ç:çªçªçØèØè¨ê¨êíí³ï´ï{òyòõõ?÷@÷ôøöøCúAúYûZû‹ü‹üþþ*)¾¾¤¤™˜E G Œ ‹ vw`_’“?> !²°77 ¢¢ € WU²ÿ³ÿÖúÖúÊöÉö^ó^óiðhðÌíÍížëëê êZéYéÆéÅéBëDë í¡í|ðzð|ó|óUöUöÚøÜøÖúÔú ü!üŒüüüüØúØú)ù'ùy÷z÷XöWö.ö.ö&÷&÷=ù<ù6ü6üÎÿÏÿÍÍg h öö«­rrùø¾"¿"%%Y%X%##;=&$–˜¬©cýeý`öböºð¹ðìì%è%èÇäÇäHâKâáá¡á áþãýãèèOíOí2ó3ó ù ùJþHþЉ‰‹,*Z['(®¬:9BüBüZø[ø"õ#õóójòlò0ó/óDõCõqørø£ü¢ü»¿·´ff~~hkg"d"¤&¦&n(n(h'j'˜#—#onŸž fgAü?üÒôÕô)î&î,è/èìâìâ©Þ¨ÞÝÛÝÛ!Û"ÛæÜåÜFáEáãçäçíïíïEøDøáÿãÿ ƒ … ÅÄMM  yxÕ×ÓþÒþúúÚõÙõÅòÆòûðûððœð·ñ¹ñKôJôTøTø¹ý¸ýFHª ª \Z§¨  ë$ë$‘&’&t%s%³!´!ÏТ£õ ô RSßýßý~ö}ö0ï2ï7è6è+â+âÄÝÄݧ۩ÛEÜCÜ–ß–ß%å'å2ì2ìÎóÍó'û&û¤¦íìà á r p ‹ ¹¸<>2ÿ1ÿ7ú7úàõáõ§ò¦òÓðÔð€ðð¼ñ¼ñ€ôôÃøÄøNþOþÜ <;ÿÿUTââpqººnl€ ‚ " cþcþm÷n÷‚ð‚ðêêÃäÄäIáIáKàKà&â&âæ€ækìmìÈòÆò°ø°øÁýÁýûüjküþ“ ‘ ÿ  . . !!]\üüýøýø1ö/öhôjôÏóÍósôrôOöQöMùMùBýBýóô  ÏÏ·¸wvÅŘ—{|ûúÀ  ÞÛ€åüäüc÷e÷kòkòwîuîøëøë8ë8ë/ì0ìžîîòòÑõÑõˆù‰ùËüÊürÿsÿ‹‹'&ILÔÒ‚#$ÆÇ¹ý¸ý‚úú¹÷º÷ÄõÃõÕôÔôëôìôööð÷ð÷™ú™úËýËýYY ¤¥  æå-.¤¤77ÆÇVWíë± ° ÏЙ™VÿWÿYûXûé÷é÷ZõYõïóñóÏóÎóâôàôÏöÐö)ù)ù…û„û‘ý‘ý(ÿ*ÿIGüþRQCCªªpÿoÿˆýŠýû ûKøOø õžõnónóòò¾ñÁñ‡ò…òLôMôÖöÖöôùôùfýfý¸·TW¸ ¸ ²±®¬YZøø€º ¹ éêùúPQAý?ýû û¸ù¹ùOùNù±ù°ùÄúÄúVüVü5þ7þ"ÔÔ´µ¬«ÃÃàÿÞÿBýDýíùëùöö'ò&ò§î©îìì©êªê•ê”êÍëÍë.î.î€ñ‚ñŽõõúúøþ÷þõ÷çèŸ ž àßbbÝÝÏÏ ØØŽ™ š ww¦¦˜ü—üžùùÍ÷Î÷÷÷V÷V÷XøWøúú,ü.ü®þ­þBB ¡|{‹‰Ÿ™˜xxOOKüKü«÷«÷ÌòÌò+î,î9ê8ê]ç]çáåâåçåéånçmçJêIêUîUî_ó`óEùEùÔÿÓÿÆÈÁ Á QPýüOOç è €!!  ‰ŠffO N ­¯¬ý¬ýœøœøšô™ô­ñ°ñæïãïLïMïððòò?õ=õZù[ùèýèýXW./þüw x s s æåææ¶¶°ü±üP÷N÷òò=í<íSéTé–æ•æFåEå„å…åhçiçßêßêßïàï8ö8ö®ý¬ýÏÏÞÞ„„x!x!K$K$Æ$Ç$ì"ë"ýýa_¦§S S ãäºü¹üööLðKð€ë€ë è èEæEæŒæŽæééŠíŒíˆó‡ó(ú(ú£¢SRÖ × ë ì rqRSœ › u u äæ5û6û}õ|õ"ð"ð‹ë‹ë è è æ æ¼å½åkçkçëë›ðœð§÷¦÷µÿµÿ%$DDaaÚÚP P Š!‰!­ ¬ øúÌÌzxPQƒ‚XYùù9ò:òRìQìýçüçÂåÄåÚåØå+è-èXìXìÖñÖñøøKþJþ()G E Q S ƒ‚ihÃÄž Ÿ " ‹üŠülököËðÊð#ì$ìÛèÝèNçLçŸçŸçÝéÝé×íØí2ó3óvùvù‹Œh f SV¶¶  ééln°¯Ö Ô úú1ô2ôäïãïíícídíÏîÑî\ñ[ñ’ô’ô"ø!øÉûËûbÿbÿÇÈÔÓWW  Ñ Ñ r p ôôqp5ÿ5ÿ&û&û>÷A÷ãóãódñcñúïùïÆïÆïÆðÇðÓòÒò§õ§õùøûø|ü{üëÿêÿ0175   € › › )(öøÞݾ¾ž ž º ¸ jk  ACþþ üŸüØûØû|û|ûVûVû:û:ûûûüúúú û ûnûlû!ü"ü ý ýôýôý™þšþàþáþËþÊþxþyþþþ¼ý½ý‘ý‘ý¢ý£ýðýïýoþnþÿÿœÿ›ÿ <<ÿ‚ÿ¥þ¥þ¦ý¤ý¶ü¸üüüÜûÝû&ü#üèüéü þþvÿtÿïòa^³´þþefÛ Ú     ý þ Ž   T R ‘  ('FýGý©ù©ù…ö…öðóñóòòÍðÍðað`ðÖðÕðCòAò³ô³ôøø:ü9üÍÏzyÌ Í Y Y ¤¤bbonê ê **¹þ¹þ.ù.ùôôžïžïTìSìWêWêÒéÒéÖêÖêWíWí;ñ;ñ_ö`öüŽü„…â á ,,ÊÌm!n!["["¹ ¹ ¢¢–•$$üü´þ´þÆöÇö‘ï‘ïséséÒäÑäââáá9ã:ã2ç0çííHôGôDüDüRTÁ À ëìPQ’wxö÷97 “ –“ãùãù!ñ#ñéé:â:âÝ€ÝSÛUÛêÛëÛ4ß3ßÿäþä ííñöòö((æ æ EFQ#P#"+"+0ÿ/“1”1Í/Î/ü*ú*“#”#76‹‰9;èøèø(î(î¢ä£äñÜðܰױ×SÕRÕÖÖñÙóÙ‘ààAéBé-ó-óVýTýÙÙEH-+lmúùýþãá00¡þ¢þøõùõýíûíTçWç’ââàààà³â´âÒçÒçOïNïËøÍøÅÅpnÚÛ %%ù,ù,É1Ç1ä2æ2\0[0¯*°*´"µ"TVüûŸ÷¡÷êìêì†ã…ãÜÜ××üÔýÔËÕËÕeÙeÙSßTß ç çÝïßïùùÿø ÷ ii××õöœ›àã  ­®…†^ú\úóóóóÄîÄî*ë*ëfégé§é¦éìì€ð‚ðëöëöëþéþÛÛöù[Z, + Ë$Í$Î&Ð&+&)&##ëì98ssIþHþªõªõˆíˆí]æ]æÁàÂàVÝUÝ‚ÜÜMÞNÞTâUâþçüç¢î£î±õ±õ ü üéç½ ¾ ¯ ¯ Ê Ì 4 2 1 1 76ÁÁJüKü@ø@øñôðô ò¡òwñyñ«ñ«ñUóTó‚öƒö/û.û,-$$~~ST®­ÖÕƒƒóõ’íî‚€© « ±²ÀþÀþþøüøóŸóõîõîaëbëAéAéÐèÑèêêòìñìøðùð¥õ¦õlújúÊþÊþTUÂÄêé««&'yýwý’ù•ùùõ÷õóóññ$ð#ðTðUð±ñ°ñGôHôøøúüûüÝÜq r 76™šïð•”!!X X ij±²ÑÐh h  ±ú±úÈõÇõcñbñ½í¿í=ë<ëOêOê8ë8ëîííí ò òûöúöüüvtÒÔÊË88ÝþÜþgúhúªõ¨õññ:í9íbê`êØèÙèÎèÎè\ê\ê}í}í&ò%ò5ø5ø„ÿ„ÿÉÈššSS!!þ&ÿ&^*_*Ù*Û*l(k(o#n#‚rrõ õ ¬¬ôûöûõõöî÷îòéòé'æ)æìãëã‘ã‘ãRåRå;é:é÷î÷îåõæõ"ý"ý·µÛÜ   á á º¹Aþ?þøøòòÓìÕìªè¨èææ&å(åBæ@æZé\étîrîUõVõ¼ý½ý--´´A#B#ö)ô)..C/E/@-?-@(?(  ˆ‰m l 77yùzù’ð‘ð¸è·èââÝÝ%Ú#ÚÅÙÇÙXÜWÜÒáÐá£é¤éçòåòwüxüGGy y tu%%/-ÌÏmlûû–ô–ô/î0îòèñèQåRåÀãÀãwävä™ç™ç)í(í÷ôøôˆþˆþ  ¤¤12í$ì$%*$*i,j,Œ+‹+À'¿'x!v!\_[Z”ü”ü9ó9ó¥ê¥ê2ã2ãGÝHÝmÙmÙ)Ø(ØñÙðÙïÞïÞÊæÊæÅðÄðÀûÁûqpžžVW;;edEE%&BBÒ Ò GF1ü0ü;ô<ô íí=ç<ç`ãaãÖá×áÙâ×â]æ_æ9ì7ìþóôýýÕÕ\[ãâ´µ?$>$!&"&N%N%î!í!hh:<  EFvûxûòòñòëësätä­ß¬ßsÝrÝ<Þ>Þ&â%âÊèÊèeñdñáúâú**C C –•ÔÔøùc_ÚÛ¥¥óõ54ø÷÷÷òïòïÕèÖèPãQãþßýßRßQßrásáææÙìØìõõôýôý‚ƒÁÀBC¯®ë ì ÿ‰‰¥§Õ Ô rsÛüÚütõsõÁîÂîSéSéÏåÎå©ä©ä=æ<æê‘ê.ñ,ñùùÜÚ  ©¨ÃÄyy²³VTh j #"ÎÎõùôù-ó-ó í í_è`èTåUåIäIäVåUågèhè=í<ívówóžúžú./‘ ‘ @@ÌËÑÑijØÕ–˜— ˜ ŒŠ33îúïú3õ3õ}ð|ðWíXí+ì*ì'í)í.ð,ðÉôÊô@úAúÖÿÕÿßàñðÙ Ú ˜ ™ EEÜ Û W V œ › ­­¸ºûûfõhõ;ð;ð<ì;ìÊéÉéééêêìŽìSðTðõõpúqúþÿþÿXY% $ Ö×[\ƒik,-  TSAB8ü9ü×ø×ø?ö?öÃôÃô¯ô®ôBöBöˆù‰ùþþÂÂ] \ « ® ÉÈÕÕì í   \ [ ¿Ànn˜ü™ü÷œ÷æòäòãîåîöëõëWêWê'ê'êOëPë¹í·íññ3õ3õ¥ù¤ù"þ þ\]  ãä¢ ¡ ) ) „ … òò½¼,-‘1ÿ1ÿRýSý ü ü¹û·û7ü9ü¼ý»ýNKáá89è é gekl#%++¥£ÏÐò ñ PRvùtùÃòÄòwìwìçç0ã0ãùàúà”à’àïáïáÓäÔäùèøè îî•ó—óCùAù¡þ£þcc41Ù Ü 8 6 I I ' & ]_tt³ÿ±ÿý€ý1ü0ü÷ûùûôüôüÿÿpoâãM N JK><de ! !®"®"""$&|}† „ ®­fùgù ððUçVç…ß„ß5Ù5ÙÍÔÍÔ«Ò«ÒéÒëÒ‘Õ‘ÕgÚhÚááôèóèžñžñ}ú}úŒ Œ Š‹“”vuQPbb ¼ ½ ||›ÿ›ÿËüÌüOûNûZû[ûöüöü!"µµo n áàuw‚‚C"D" % %c%c% # # ÁÄ +*ÿ÷ÿ÷¶ì¶ìýáýázØ{ØÚÐÚИ˙Ë"É!ɛɚÉÍÍÓÓGÛHÛ,å+å ð ð3û2ûíí“’††WW² ´ ‹!‡!ðó?=ãäµ ´ $$_ý`ýáøàø!ö!öoõpõúöøö™ú˜úúÿüÿŸŸÞ Þ öõww!‘!!!  –˜ãýâý=ó<ó©è«èÃÞÄÞ3Ö2֊ωÏXËYËùÉùɥ˦ËBÐ@Њ׊×áá ì ìÜ÷Û÷——bb}pq×"Ø"¡$ $Ô#Ó#¼ ¾ ÆÇ…†Š‰hh¼½ûûÃöÅöSôRôïóîó¥õ¥õTùSù¢þ¤þ  Ð΄„{{==‹‹jhÉ È 44ÌûÌûòò˜è—èìßì߯رØ~Ó}ӶдИЙÐÓÓØØ+ß+ßÏçÎçcñeñPûNûéè“ – ÕÕBAšœËÊèç/0 ÕÖ  IHôüôüSúSú`ù_ù+ú+ú›üšüii33e f dcŠ‹``ŽŽéë}bbä ä ABßüßüõõ<í:íØåÙåjßjßvÚvÚb×c×}Ö}Öé×ê×›Û›Û@á?áQèPè$ð#ð)ø+øäÿâÿäæÛ Û ttˆ‡  ãࢥ°¯b b   '(ççŽFGé脆¡ ¡ Ö Ô ¯°»¼‹ÔÔƒ…È Å äç>>üüËõËõšï˜ïØéØéâäãäáá¶Þ¶ÞÞÞßßÜáÙáææƒë‚ë¡ñ¢ñøø;þ:þîíËÍ¥ ¥ LKººëë12À Á   ˆŠA@××WX¹¸ÏÐg g - , ÊÊäæ%%HF“”Å Ä åæ@@7ú7ú*ô*ôvîtîménéeåfåœâ›â?á>áwáxáeãdãççFìEì‰ò‹òAù?ùÕÿÖÿÏÎÔ Ó ž÷÷ÚÙLMwwˆ ‰ Î΢¡xy»ü»üÑùÐùøøˆ÷Š÷sørø­ú¬ú þ þ=;Þß• ” åæaa‘ÈǶ¶! __Þá"ú úžóŸóÖíÕí'é(éáåãåGäFäräqänæoæêêMïMï¤õ¥õ´ü²üââ§ ¦ prÇÅUWé胃<;UT ¼ù¾ùóòóòSíSí^é]éiçhçŒççÉéÇéæíæí“ó”óVúVú®¯  Îω†³´LKwwª«00t t ûüfûdûMôNô>î=îŸé éØæ×æææ“ç’ç%ë&ëxðyð÷÷^þ]þ½¼– š NLZYaa22×ÖiiF E ÏМûûHóGóëëêäëäààÝÝpÝpÝàßàß§ä¦ä{ë}ëçóæó_ý_ý..‹¼º  T#T#%%i$h$L!L!85N O òòÏüÏüsõsõgïfïë ë•è–è3è2èØéØé\í\íoòpò©ø¦ø}ÿ~ÿUVˆ ‡ uw¥¤¹¹††z z ZZSüSüôôDìDì™å™å›à›à¾Ý½Ý8Ý9Ý"ß$ßRãRãŠéˆéQñRñ1ú1ú‡‡· ¸ '(JH¦!¥!Ù$Ø$¼%½%?$?$… „ ÞàÄļ º dfiûgûaôbôÏîÎî ë ë@é@éféfélëlëïïôôãùäù äâÜ Ý ||jk|}´³5 6 IIOO¿ù¿ù+ó*óííùçøçSäSävâuâŽâŽâ¦ä§ä©è§èOîOî;õ>õíüìüÈÉE E ßß88..’’`_ë딕À Á æã`þaþ–ù–ùËõÌõ7ó7óôñôñòòó‚óöö ùžù¯ý°ýääÊËáà° ±   ó ô ˜™42 aûaû–ö–öòòîîëë éébèbè é éþêë!î!î;ò:ò ÷ ÷MüLüµ·îì¸ · ÊÊùù&'!#@@º¹Ð Ñ Á Á ÈÈ ¨¥·¸PÿNÿnþqþþþ$þ&þ}þ}þîþìþBÿCÿVÿTÿþþÿ4þ4þôüôüQûQûhùhù\÷[÷CõBõ;ó>ólñkñîïîïçîæînîqî¡îŸî‚ï‚ïññóó™õ™õnønøxûwû¤þ£þÖ×üûüþÈ Ç J I tuBAŸ‘')ÍÍËÌ(*± ³ ïïàà››3ÿ5ÿÃûÂû]ø]øõõòòaï`ï2í2í¥ë¥ëÓêÔê·ê¸êLëMë‚ììBîAîpðqðóòòò£õ£õ^ø_øûûyýxýœÿ›ÿ^_»¼ººqqööonùùª¬•”À¿9 9 è é Ç Å §ªtsùú£ loXWRRNM` ` ¨¨[[µú¶úõõ•ï•ï­ê®ê“æ“æãã´á³áGáJáJâIâ£ä£ä2è1è¼ì¼ìþñÿñ¦÷¦÷XýYý®¯YY ¥ ¤  LL‡‡ì í Ê È \]ööÉÈûûŸž,+üý\[  ã ä srvv¢¡¹¹……Ø × ¿ ¿ ‚‚þþXøYø=ò<ò’ì’ì¿çÀçääåáåáHáHáJâKâìäêäõèøè5î4îLôLôÝúÝú}ÃÄI J ±°»»@@67¯®çè++Ñ Ò <:ÁÁÌüËüùùt÷t÷pöoöžö¡öøø†ú†úßýßýÈÈÙÚ® ® Ü Ý ÿÿÔÔ886 6 ï ï §¦¥¦CûBûàõßõÔðÖðƒì‚ì=é>éQçPçÞæÞæèè»ê»êßîßî"ô$ô$ú#úVWLM– • ààìë‘ÄÄœš@@ó õ û ú ¤£23ùüøü6ù6ù.ö-öôôóóQóPóÍôÎôj÷i÷éúéúÿþþþNL[[ª « Û Û Ô Ó ” – C A ü ý æç64/ÿ.ÿûûB÷A÷ïóîó_ñbñÍïÌïPïOïéïìï’ññ$ô$ôk÷k÷.û.û%ÿ$ÿ–—” ” Í Ì ' ( š ™ ( ( è è ø ø „ƒ¸¸½½ÍþÍþüüÍùÏù.ø.ø\÷]÷r÷q÷_ø^øÿùú$ü#ü…þ…þàßÇÈÒÓ  ½½æç““ÓÑÀÀƒþƒþJüJüMúNú¹ø¸ø±÷±÷H÷H÷t÷s÷#ø%ø@ù@ù´ú³úoünüIþIþ13®®12öõ]_geXWEEàà;<tt¹þ¸þ)ý(ýîûðûûû¯ú¯ú›ú›úÀúÁú û ûkûjûîûïûŸüœü€ý‚ýþþ±ÿ²ÿÑÑÖÕ§§<=˜—»º­­zy!"¨¨@Cgfÿ€ÿ£þ£þâýäý^ý[ýýýýýtýtýþþçþéþðÿñÿ6624îíFE46´´ÐÏ ¡>=³þ´þý ý_û_û¹ù¹ù7ø7øúöúö0ö0öÿõöƒö„öÅ÷Â÷µùµù6ü7üÿÿ!"ñðf f a a ¿ ¾ ^],.% & E E ±²™™<:×þØþ±û±ûöø÷øÓöÒödõeõ¸ô·ôÏôÎô§õ¨õ+÷+÷>ù>ù­û­ûKþJþÒѱ³¶· ¢¡‚·¹_`¬ý«ýáúàúNøPøEöBöüôþô®ô­ôbõcõ÷÷´ù´ùýýÆÆÆÆÉȃ … À¿:;Á¿#$ACÄ Ä w w ƒ‚BÿCÿúú[õ]õiñiñ€î~î¹ì¼ì#ì ì¸ìºìzîyîEñGñëôéôùùeýdýˆ‰0. ö ó Í Î   ¡ Œ¾¾†…*þ+þûÿú[ø[øöŽöÎõÌõ%ö'öŸ÷ ÷úú\ý[ý66WXi h    àßTVutU T : < srYÿYÿKúKú˜õ˜õŽñŽñdîcîAì@ìFëGëŠë‰ëííÎïÍï™óšó-ø,ø-ý-ý&'¸¹q q   PPTS3 4 ! JJîí^^êýìýôúôúµø´øg÷i÷÷÷å÷ä÷˜ù˜ùüü ÿ ÿxyÑÑçèp o / . é è { ~ ì ê C E ½¼¡ PýPý7ù6ù£õ¤õÏòÐòÕðÔðÈïÈï½ï½ï¿ð¿ðÉòÉò¿õÀõnùnù…ý„ý¦¦lm~œ ¢ ¢ ˆ ‰ s s ƒƒ÷öäÿæÿäüãü8ú9ú8ø8ø÷÷óöóöö÷ô÷ úúýý}}ˆˆu w ® ­ ÷ ö $$, .   13öÿöÿ£û¤û÷œ÷2ô0ô¢ñ¢ñðð©ï©ïSðSð ò òºô»ô7ø5øKüKü¾¿;:G G Z Y û ý ö ö q p ² ³ ýþºý»ý®ù®ù(ö'öpóqóËñËñlñmñuòsòèôéô¢ø ødýeýÏÒqnÊ Ì lkêêóõVTíìÌÏ  02ñúðúþóþóõíöíJéHéFæFæååªåªåèèñëïë'ñ'ñS÷S÷ þ þËË  @@Ý܃…  ††==££B@£û¤û^õ^õëïíï½ë½ë2é1é£è£èJêKêAî@î@ô?ôÂûÃû˜ ™ ……=>8 5 þ"#a#`#=!àãÙàÙ®Õ°ÕÆÓÆÓYÔYÔ°×°×ÇÝÇÝ/æ0æ ð ðoúoú€‹ Œ ñó..  €€ÖÖUTnp— — ZW/0‘û‘ûôöõö¹ó¸ó6ò7òŒòŒòÆôÇô¦ø¥øÓýÓýÁ¿Ë Ë ikgfüýµµ“’ÅÆ‹ ‹ 32œøø]ñ]ñÎêÌêVåVåHáIáâÞãÞCÞAÞeßgß8â8â„æ„æúëúë4ò4òÅøÄø,ÿ.ÿè ç   ¡ KLy{ØÖ–•å æ ù ù û ú ——œHH¡ «­ÝÞÏ Ð O O 2 0 q r   ´¶ïïãýáý¬ú¬úh÷i÷GôFômñlñïïRíSíRìRììì¥ì¤ìÏíÎíqïtïfñdñŒóŒóÈõÈõú÷ù÷úúÐûÒûfýgýÒþÏþ,.¤£[Yooéê´ ´ ¬ ¬ ž\\ÄŶ¶Â楌ŒUTÕÖKKããaûaû3õ2õ»ï»ï9ë8ëÜçÛçÀåÂåóäóäoåoå'ç'çýéþé½í¼í ò"òÔöÕötûsû–ÿ–ÿéé((==ÈÈ„ƒ”ÿ”ÿPüRü ù ù2ö0öCôCôÐóÐó,õ.õcøcø%ý&ý  ¤ ¥ …„,+()""b%b%á&â&=&>&K#K#À Á ¥¥ùùÐîÑîå~å¶Ý·Ýò×ò×yÔwÔ‡Ó‰ÓÕÕ Ù ÙBßCßjçiçððððûû¹¼C A ÿÿ€‚„÷ö¢ ¢ 24sürüõõéîçîƒê„ê^è^èÊèÈè¾ë¾ëññkøjø,-ª ª -+{${$ô)õ)À,À,c,c,¯(¯(ë!í!›š€ ^]õõ’é’é߀߅ׄ×ÒÒÏÏ Ð Ð’ÓÓåÙçÙ¥â§â6í4í×øØøŸŸ Ÿ ÿ$$ % %Þ"Ü"ÏÐTTù ø ƒ‚è÷é÷2î4îQæQæìàìàtÞtÞßßÉâÇâ)é+é±ñ±ñ¥û¤ûAA´³31""ˆ'Š'X*Y***Ø&Ú&¹ ¹ 1.Ø Ú ssÙöÙöâëáëUâTâÇÚÉÚÅÕÆÕ¹Ó¹ÓúÔùÔvÙwÙÎàÏàHêGêõõFFþ þ ON~ ®!®!s s …‡ED)&ÙÙ û û‘ñ‘ñ.é.é âžâÞ‚ÞAÝAÝßßãžã·ê¶ê²ó±óÜýÝýb`Z[þþ¢!¢!á%à%l'n'5&3&I"J"  þþÉ È «÷¬÷*ï*ï(è)è%ã#ãdàcàààBâDâ²æ±æúìúìœôœôñüïü24ª ¨ ŸZYÌÌ;<ß à ‡‡ÖúÔúlólóôìöìèèååiägä æ!æêÿé¦ï¦ïŒöŽöþþÇÅô õ 31^^ÐÐVTèè¼½g h =;(û)ûÎôÍô½ï¾ïcìcìòêóêqëpë¨í¨í\ñ\ñ6ö5ö¹ûºûiiµ´  ')±±ŽÖ Õ © « XV56§û§ûööûðýðÂì¿ìÐéÑéŒèèéé’ë’ëÁïÁïIõGõœûû++d d }}NN¼½´²:9^_` ` ‚79þþTùUù«õ©õOóPó{òzò3ó5ó_õ^õºøºø÷üøü½¼ž& ( êꉈ±±""·¸“ ‘ ÆÿÅÿ3ù3ùÕòÔòíí8è8èËäÌäããGãHãfåfåSéRé²î²îõõùûùûÌÌ  jjPPœœfeÀÁ»» ~ÿþœýý ù ùÓõÔõPôQôšô™ô€ööÅùÅùþþÔÕÑÑ• ” ··ÒÔ”’¬«óöfe! ! }}ñüðüõõdídítætæ±à²àÜÜKÚLÚ0Ú1ÚUÜSܯà°àõæõæ¡î î÷÷tÿsÿccde45‘VVkkÏ΋ŒÙØš š áâ­ü¬üÅùÆùgøføŽøŒøúú¬ü«üààÉȇ ‡ ÄÆ"!>?eb» » ¤¤¨ü©üEõEõÿíÿíNçNç¢á¢áYÝYݻںÚÚÚMÛKۋތޔã“ãêê²ñ²ñåùæù768 7 ƒ…ÅĪ«  ¨!¦!„!…!‹çäéè02d d š™%þ%þÀû¿ûcúbúíùîùFúFúKûJûãüäüíþëþ$%DBßßœœ32ƒ…«ªäüåüˆø‡øôóôóoïpïHëGë¸ç¹çûäùäVãVã ã ã?ä@äïæïæûêûêðð öö‚ü‚ü! ž Ÿ ©©dfššutâáè穨acbaÿ… „ 21&(xÿwÿ/ü.üXùZù÷÷–õ•õõõhõhõ‹öŠöøøcùdùZú\úËúÊúÀú¿úUúVú£ù£ù¿ø¾ø°÷±÷}ö~ö0õ/õÖó×ó‹òŠò|ñ|ñÚðÙðÎðÏð|ñ{ñíòïò$õ"õøøyû{ûVÿTÿxz¾½   ˜–nodcjl‡…ÈÇ?B#"«©§ © =; ýýÛøÙøLõKõ—ò™òÍðËðÛïÝïï›ïàïâï‰ðˆðŒññæòæòšôšôšö™ö¸ø¶ø®ú¯ú,ü-ü÷üõüýý‚üƒü¡û¢ûú›ú¢ù¢ùÖøÕøZøYøBøCøŸøŸø~ùùõúôúýýÌÿËÿÜÝå ä ûüÜÝFE  ïïØ×šš+,rrusKK=>ÊÊqûsû©õ¨õ¨ð§ðììgéféGçHçCæDænænæÈçÉçAêAêŸíží”ñ’ñ½õ¾õºù¹ù1ý2ýëÿéÿÉÉÍͳ´ÕÔ™™ÿÿ“ý“ýüüüúüúˆú†úûû¤ü¦ü[ÿZÿSU  ÁÂ31 ôõ¾½0/gh,+‘å ã ‰ˆòúòúŒóóÃìÄìàæáæ.â.âåÞãÞ8Ý;ÝXÝWÝIßJßðâïâùçùçÜíÜíôôýùüùSÿTÿåä„…, - à à S T Ü Û v v TTµµîï^]iþgþZý[ýgýgýžþžþëé ø÷  9: IH¥¦´´$$Êʵ¶#!kküÿýÿNøNøÚðÙðêê-ä-ä¦ß§ßÄÜÄܲ۱ۀ܀ÜßßOãQãÑèÎè0ï2ïööãüâühjI G ;> ’‘ª©;<HH è é uv=;§ÿ©ÿ ýýû€ûû!ûÔûÓû}ý|ýîÿîÿùùmnþ ü d f BA67ïð+*ÔÕ  úú¼úºúTôUô?î>îÑèÒèoäpäwáuá.à0à°à°àèâèâ¤æ¤æ›ëœë€ñ€ñ÷÷õ÷¢þ¢þ  77./À¿ÄÃ,.ÊÊ Ž Ö×  “ÿ“ÿ·û¹û¹ø¸ø®ö¯ö°õ±õÆõÅõûöûöNùMù­ü­üØØVU— š   eeSSÓÔ  %%ŒŽ…ý„ýWøWøGóHóªî«îÕêÕêèèŸææ”æ•æ è èçêæêïïôôÌùËùÞÿÝÿ忆 † <<°±¢¢ÚÛ›ª ª QSÛÛˆþˆþ’ú’ú>÷>÷ÒôÏô€óótótóÅôÅô_÷_÷ûûRÿRÿÏÍ ‘ ’ //¹¹((€º ¹ È È ÂÀÑÑRüTüµö´ögñfñÛìÛìbécéLçJç­æ®æççÛéÛégíeíùñüñR÷Q÷ýýþýœœ ž µµ¥£CD‰ˆtw('ÆÆ‡ ‰ ¢¡fgEüEü½÷»÷IôKôFòFòÏñÎñÍòÌòüôüô ø øŸûŸû{ÿzÿVVöõ% & £ £ 11”“­ ­ f h ááWVþþ©ø¨øgóióÍîËî'ë(ë³è³èŒççÌçÊçséuéŽìŽìòðòðböcö}ü}üØÙ  ¨¨]\ÞÜöø‘‘¦§>=€¦ ¦ 54€üüm÷l÷PóQówðvðìîëî°î²î¬ï«ïÄñÅñÜôÚôÍøÎøXýXý¨¦u v ) ) ||TSÆ Ç rpIJæýåýŽùù„õ„õòòFïFïxívíÔìÖì}í~í|ï}ï¾ò½ò÷÷1ü0ü«¬ hi½½äãŸÍÌvuÓÓB B &'ææãûãûi÷h÷¯ó°óêðëð:ï9ï¿î¿î‚ïƒïxñwñyô{ôOøNø¤ü¥üTTóô¶ µ q p ¶ ´ b d I I €JI8ü:üGøFøÊôÎô&ò%ò‘ðð%ð$ðßðáð“ò‘òõ õøø|ûzû ÿ ÿžŸûüóñQ R æ ç ™ — Z Z > = l m __~}žÿŸÿíüíüžú›úÞøÞø×÷Ø÷ž÷ž÷)ø(øWùXùûûóüóüÿÿù÷§§  ÄÃäåmmNLŒŒ>>žÿÿÛüÜü;ú:úç÷è÷ûõüõ€ô~ôqóqóÉòÈò‘ò‘òìòîò ôô÷õ÷õ¡ø¡øÃûÄû)ÿ'ÿ“ÚÛäá„ … © ª ;:&'\[ÔÕ’‘¥ ¦ $ # /.ñóœ]ý[ýYúYú³÷³÷”õ”õôô\ó[órósóbôaô%ö%ö‹øøNûMûþþ©ªÕÖˆ‡·¶II67hhÒÑ{z‰þ‰þ=û=ûñ÷ð÷úôúô³ò³òWñYñññòòôô.÷.÷+û+ûåÿäÿ     ýþõó…†rr˜˜  øøG I _]>û@ûaô_ô$î%î÷è÷è*å(åãã©â¨âää9ç9çÇëÇësñsñÖ÷Ö÷‡þ…þ"#6 8 _]35WU‚‘±±Q R ’þþcøcøôòôò£î£îºëºë€êêëë¦í§íøñøñØ÷×÷×þÙþsqææA!@! )#*#°#±#Ó!Ò!“•=; "ÆÄËûÌûÝñÝñ¼è¼è á á_Û`ÛØØv×v×sÙsÙêÝêÝ…ä…äæìæìö}ö ¡x w '&›É È n l ªª¶·C A ööÚùÙùò‘ò²ì²ì³è²èÔæÔæ/ç/çÀéÁéGîHîoônô®û¯ûƒ€M M |~––%$ÝÝy y ÁÁ¦¦nm– • ÔÕÚúÙúMòMò¸ê¹ê‡äˆäàà¢Ý¡Ý7Ý7ÝàÞàÞyâxâÀçÀçMîOî­õ«õJýKý®®R Q ÐÑÇÇÿegEELL‡ † vwŽ9ü8üÉøËø{özövõvõ¾õ¾õ8÷9÷ªù¨ùÌüÍü[Y ¢£Ë Ë V V ùûŒðï! " B C “‘[\îýíýŽù‘ù†õ„õ÷ñöñïïÚìÜì¢ë¢ëzëzëfìeì;î;îÄðÆðÌóÊó÷÷ŒúŒúßýßýèç„„°±tuÛÛô ò À  O O œ › ¦ ¦  ~ & ) ¶ ´ ! " m l €HIÄÂ÷öüÿóÿòÿóýñý ü üMúOúÃøÂø÷÷ÊöËö£ö£ö"÷!÷;ø>øÔùÔù·û´û³ý²ý™ÿšÿAB‹ˆNOxyðð¶µÒÿÓÿdýeý—ú•ú¥÷¦÷ÓôÓômòlòÁðÁðððÈðÈðàòßòZö[öóúòúLLÑ Ð VWFF<:××ÔÕhiQPr s ïï7ú9úÏòÎò*ì*ìſĿ ã ãKáMáÉáÆáräsä$é$éxïyïþöýöÿÿ[ZTU‹Š““01LM'& ! ØÕðùñù.ñ-ñVéUé ã ãÝÞÜÞ!Ý"ÝÞÞ—á–áŽçŽç‘ï“ï2ù/ùØÙÞà}{ã"ä"f*h*_/^/K1K1¸/¸/»*º*¶"·"vuÀ  ^\ ô ô¢è¤èßßß×áׯӯÓêÒéÒXÕWÕÆÚÆÚÄâÅâ¥ì¥ì¼÷»÷??`_AB  è$é$]&\&9$9$¤¤46– • ¤ÿ£ÿVóXóÃçÁç÷ÝøÝÅÖÅÖÃÒÃÒ'Ò)Ò Õ Õ8Û7ÛUäVäÖïÕï ý ýü ü —–ž$ž$. .G4E46767 7 7Þ3Þ3‚-„-ë#é#oo úú‹ëŒëšÞ˜ÞÔÔÚÌÛÌÉÉ[ÊZÊäÎäΙ֚ÖñàðàMíNíÊúÊú(&{{¨#¨#D&D&?%>%ã â ¬®GHfd×ùØùîî‹ä‹ä¤Ü¢Üh×j×SÕQ՜֚ÖeÛeÛSãUããíäí‹úŠú¤¥$$õ-õ-ç3è3h6g6H6I6¼3¼3'.).%%ÖÖ« ª üüîîÆáÆáå׿×Ñф͂Í?Í@Í%Ð%ÐÖÖíÞíÞ ê êööùù1143R S { { ¢¢  ˜˜¬ü¬ü:ó;óëë²ä±ä­à­àGßGß³à³àèäéäÅëÅëÏôÏôZÿ[ÿƒ „ IGÎÎ\&]&++..Ú-Ý-Ï*Ï*ú$ù$su›AB®ø­øGíGíää3Ý4ݳرØrÖsÖ½Ö¼ÖûÙúÙàà…è„èòò½û½ûxw° ° DFigddSSh g ! ÿ ÿ øøÎñÎñ·ì·ìDéDé¦ç¦çèè¿ê¾êÁïÃïòöðö«ÿ«ÿé蹸£"£"¬$¬$®$¯$a"`"¦¥¥¥ó ó st#û!ûàòàò ì#ì#ç"çÕãÔã9â:âoâmâ»ä¼äEéEé½ï½ïV÷V÷óþôþ—•ª « û ý ,+û û   ÐÑÂýÂý˜÷š÷ýñýñkíjí6ê6êŸèžèËèÌèãêáêëîìîËôÌô,ü*üsqá ã ¹¸TS? @ O#N#r$q$§#¨#Ð Ð ®­((¿ ¿ ˜˜1÷1÷¦ï§ïJêJêÕæÕæáäàätätäãåâåréséøîùîâõâõIýGý@C +-_^ššïð{ y rs++'ù(ùòò«ëªë‹æ‹æãã™á›á*â(âúäûä%ê&ê’ñ’ñºúºúÑÒÚÛóòtu%%k(m(œ)œ)x(w(Å$Ç$‹Œë ê ;<÷÷xîvîþçýçÏãÑãºá¹á‹áŒá;ã:ãÿæÿæýìýìíôíôôýöýÆÅ$#78ÆÆééæäÕÖø ø §§úúqòròëëååÞàààßÞÝÞ+ß-ßÜáØáÔæÖæúíúíêöêö¤ § ¼»||<%;%”)”)j+i+Ð*Ð*®'­'Æ!Ç!ò ñ þþÝöÞöÞíÞíhçgç4ã5ãëàèàxàzà#â"â-æ,æì€ì¡ô ô§ý§ý……00êèLNML  ¢£;<²þ²þ¼õ»õ í í€ååÙߨßÜ‘ÜÎÛÎی݊ݥá¥áèè¹ð·ðøúøúñ½¾!!&&Æ(Ç())Ó&Ó&ê!ë!mnÙ×tûuû1ò0òëëPæQæ€ã€ãOâOâÒâÑâ–å˜å8ë6ë‡ó‡óaýaý12ˆ‡ôöMNpp\[K M ÕÓºø»øØïÖïèèÖá×á¤Ý¤ÝÛÛ°Û±ÛÞÞèâæâêêXóXó þþ  XX¼ºä!ç!ñ%ð% ( (â'á'Í$Î$eeEEÝ Ý ðð—ø™øòòííiéié9ç:ççç4é3éôíõíÝôÝô ý ýZY» ¼ }{\^\\}{ ¢œ\ [ £ú£ú!ñ"ñÇèÆè5â5âÝݤڥڃكيڊÚ8Þ8Þ±ä°ä†í…íÅ÷Å÷II  ~VV‹ $$^%]%/$1$. / š™A@yy“‘6ú7ú.õ/õÝðÝð-í.íïêïêdëdëïïgõfõÅüÅüÎÐÀ ¿ vtøø,,ÌË~€ž œ ƒ……û„û|ó{ó)ì)ìóåõåááÝŽÝŽÛŽÛ[Û[ÛeÝcÝâ âLéMéŽòò•ü–ü/0é袣cbr"r"Ñ"Ð"  רwv[YAþAþÐùÐù<ö<ö ô ôÀó¾óõ€õùùƒý‚ý./UU¬ ª & & Ø Ø ››  ° ® >>,ú.ú…óƒóÓíÔí5é5étåsåpâpâeàeàØßÚßYáWá"å"åéêêêññññdùeù‰‰þü¬ ­ ¤¢ÍÎÖÕ:;’’óó('@Aí ë   LKDCpq¢þ þrþsþÎÿÎÿpo]_©©\[ŒŒ11åä§ý©ý»ø¼ø²ó±ó)ï)ïˆë‡ëôèóèOçQçkækæ$æ#æœæœæ8è8èxëwëlðlðzözö‡ü‡ü”•^]LMÜ Û   “”àß ˆ ‡  ÿ ã å _ ` U S — ˜   ¹ ¸ ¶ ¶   ÓÓˆ‰ÃÀúúëí Ÿc e €öý÷ýøøªñ«ñKëKëÕåÔåââàà à àXáXá”ã•ãŒæ‹æ9ê8êÃîÄî2ô1ô5ú5ú>=ƒ „ Ì È w y é ç ™ š ÙØ¼¼CD§©|ÿyÿtþvþÿÿghèæ  › ™ aa@AÓÔrp!€!…!†!cc--34È È B@çûéûòò4è5èûÞýÞ@×?×ÀÑÁÑÏÏuÏuϕҕÒÉ×Ê×[Þ[ÞÏåÎå(î(î‚÷ƒ÷—–k k ŠŠÅÇ»¹ääðñá â ))!iüjüÀ÷Á÷ÖôÖô.ô,ôìõìõØùÚùÿ€ÿa`"  %%n*p*V-V-?-@-ä)ä)‰#ˆ#ª«ÕÕMOŠõ‰õ‰çŠçûÚüÚlÑkÑcËcËuÈuÈÉÇÈÇÉɢ̥ÌÊÒÉÒ—Û—Û¬æ¬æwóvójiç"å"ä'æ'))Á&À&""ަ¥t u ‹‹9÷7÷ùïùïíëíë8ë6ëxíyíòòÒøÒø<=é ê ãä3'4'--Ñ/Ð/L/N/”+“+¾$¿$ää@òAòã‘ã}Ö~ÖèÌæÌûÇûÇÇÇÈÈ;É<É Ë˭ϯÏ*Ù(Ùlçmçaøbø] \ <?Ú#Ø#™+š+|/}/ß/Ý/P-P-!("(‰ ‰ äå  ccó÷ò÷¯ð°ðì ìFêGêFëGëâîàîÚôÚôçüèüš™! XWö#ø#ý)þ)Ü,Ú,u,v,æ(æ(V"V"ÔÔª « tþsþ~ï}ïyázáÖÖtÎtÎRÊQÊÉÈÊÈÓÈÒÈ.Ê/Ê’Í’ÍÔÔwÞxÞ&ì&ì¤û£ûæ æ ""M"M"/)/)--p.p.--(œ(-!/!“’L M ÔÕþûþûÿõþõçñåñÛïÛï!ð#ðËòÊò÷œ÷þþš™G H GFòòÍÍ ¢64cd  :;>?ËùËùóíóíóâòâÔÙÒÙÓ ÓŒÎ‹ÎÌÌÀË¿ËîÍîÍ9Ó:Ó¨Û¦Û~æ€ælòlò þ þtuFFljÌÎ>!=!„"„"˜!˜!¡£«¬© © 98kþkþÅüÇüsürü“ý•ý jkg g ü ü ¡¡KIÔÕ ¸ ¸ ååéþêþ]ø\øðñïñ=ì=ì™ç˜çää«á¬áBàBàïßîßâàâàaãaã„çƒçíí„ó„óôùóù½ÿ½ÿœž»º? ? úù¿À‹ŠÉÈßáyv² ° v w J J . -   Ü Ü g f ƒ öøVS9:ÂþÂþ û û+÷+÷HóIóžïœïuìvì9ê9êGéGéËéÌéë‘ë î îÂðÅðƒóƒó]ö[öeùeùüüPÿOÿsu¯®÷øutnm&&êþìþúýúývýxýýŒýbþaþ ÑÓpoµ µ KKÆÇ¿¾ÔÓ°±çæ··ðò\\qøsøÆðÇðØéÖéäääßäߜݜÝsÝsÝoßpßrãsã*é(éðð›÷™÷ÿÿ  µ³¨ª»»°±“‘ GGzþ{þ÷÷ö÷Zò[ò î îdëcë®ê®ê+ì,ìçïæï®õ­õýýkmFFdgæ"ä"k&k&¤'£'g&i&¥"¤"uu  æ å ©þ¨þ4ó5óoèoèßßÎ×Ï×%Ó$Ó—Ñ–ÑPÓQÓAØAØèßèßšéšérôpô‘ÿ’ÿ  A?vw@@P!P!m m ¹º[[  aûbû!ò"òêê¥ã¦ã’ß’ßDÞDÞûßþßÓäÑäqìqìBöBöZ[ª ª 99I I \'\'ù+ù+Ì-Í-w,x,ì'ì'^ ^ []° ° MþJþ#ò$òççÀÝÁÝÑÖÑÖ»ÒºÒÐÑÐÑ5Ô6ÔÃÙÂÙââŽìŽì1ø0øðòààBB€€$$8%:%÷"÷"Љ°°A @ ¼÷»÷îîÔåÕåÄßÃ߀ÜÜTÜSÜKßKß#å#åDíCíïöñöfcã æ ÂÀ``,%-%£)£)R+S+ì)ì)]%\%éé*)  dýcý9ò:òTèSèWàXàÉÚÉÚ Ø ØYØXذ۱ÛÂáÂáîéîéeófóGýFýÆÈ)(ÎÎIHEFÁÁÎÎÀÀ  ‹üŠü ô ôPìQìææââ˜à—àââæælìmì9ô8ôÍüÎü‡…ä å tt³´% $ P"R"þ!ü!((PPd d þþÂúÁúBóBóûìúìPèRèˆå‡åääãäræsæ(ê(ê£ï£ï\ö[ö–ý˜ý¡ ³ ³ 78ÚÛŽŒ‹úû  ðñóÿôÿ¢ù ùóŽó[î\îŒêŠêˆè‰è„è…è~ê|ê(î(î/ó.óùùÿ€ÿïîÿ ÿ `a²´°­ÿ  Ž JJôô5û3ûyö{ööò÷òÅðÄðôïõïŸððËòÌòXöWöâúáúãÿäÿ²³½¼” • ÷ ö è ç ~ € õóqq %ü&üÍöËöyñ{ñ²ì±ìééìæîæÌæËæµè¶èwìwìŸñžñ¦÷§÷þþjk^ ] Љ­­†…íïÍË öõ“•X X ÆÆhþhþÈùÇùLöNö"ôôRóTóÊóÉózõzõPøPøNüOü67||D E §¥)*ÓÐÿ ÿ   ,-hiìüìüøöùöøðøðgëeëÏæÎæ¬ã®ã]â\âÿâã‹å‹åÈéÉéfïgïööýýSP% ' 76"#¦¦§§ÐÏÐÏ*,Y X ûûûû ø øRõQõÒóÓó‹ó‰ó“ô“ôîöïö€ú€úéþéþš›éèB B H H ß Þ  8 7 JKfd›ÿžÿúúóóõóØíÖíZè[è0ä/äÅáÅáRáSáÂâÁâÝåÛåmênê/ð/ðÊöÌöÒýÏýÖ×t v ``ML cc00WWåæ$$¸ ¶ EH>=ÒüÒüùù'ö&ö#ô$ôpóoóRôSô­ö¬öñùðùTýTýGF•—NL„„)( !^üaü+ø*øðóïóððáìâìêêiéié^é]é~ê}êÉìÉì+ð-ð‡ô…ôœùžù/ÿ/ÿóò´ ³ /0%$((ÛÜš˜ÑÑüý[\I H ÏÑâûßû©÷«÷ô€ôròròuñtñWñVñæñåñóó«ô«ôæöæöžùžù˜ü˜üpÿoÿ¾¿++‹ŠáãdcOÿMÿÚüÚü%ú&úZ÷[÷£ô¢ôJòIòðð¬ï®ïÇïÇïìðëð&ó&ójöjö«ú©úÀÿÂÿuuv u STžŸñï²³ì좢¾¾34320 1 ÓÒ¿ûÀû[õYõ×ïØïMëMëççççéåèå‘å‘åõæôæïéñé2î1îBóBó¢ø¤øÔýÓýyxHG  « ª ÿ ÿ þ ÿ ³´?>éÿëÿ%û"ûhökö,ò,òÏîÏî¥ì¦ìûëúëíí$ð"ð õ õ{û{ûööØ Ø ‘’–•on­#­#ù%ø% & &Î#Ï#]\öõ  00ìþíþÆõÄõ4í5í¹å¸åËßÍßñÛòÛ~Ú~Ú¢Û¢Û1ß1ßÖäÖäëëëëÉóËóÎûËûdf( & ™šUT‡ˆøùª ¨  «ªûûÒôÑô_ï_ï,ë,ëÃèÂèwèyèêŒêýîýîŠõ‹õ¼ý¼ýßß&'ãà~ ~ }&~&B*B*3+3+))ï#ð#~VU  þþ ó óàèàèBàBàÒÙÒÙûÕúÕûÔüÔÌÖËÖ/Û0Û®á®áÃéÄéßòàòaü`ü«¬úûÕÕB?@ANM¸ ·  åýæýêõçõÂîÄî3é3éÜåÛå?å?åsçtçQìPìSóTóÖûÖû'&Š‹XXÜÝ$$î'ï'£(¢(‡&‡&º!º!vu45‚‚ûûÎïÌï[åZå•Ü–Ü%Ö%Ö¨Ò©ÒPÒRÒÕÕÚÚ3â3âkëjë•õ”õ û ü ¬¬opØÖ¡¢ÚÚªªuu¢¢±±8ÿ8ÿÚöØöMïNïRéSé•å•å‡äˆä]æ[æÙêÙêññÍùÍùåä  ¹º!!Í$Î$S%R%##''îîí î ÏÍGùIù'ï%ïæ!æÏÞÍÞ°Ù²Ù××"×#×ÊÙÉÙÜÞÛÞöåùå«îªî_ø`ø\\ä ä <;ÐÐ33!!f g ?>'(+ + ’”øø–ð–ðÉêÊê=ç<ç:æ;æ§ç§ç?ë>ëˆðˆð ÷ ÷HþIþÛÙH G €,* ¢¬¬_^õ÷Þ Ý —–ºü»üôóòóìëìëFåFåoàoà»Ý½ÝFÝEÝßß÷â÷â®è¯èÎïÎïÖ÷Ó÷21JK‘„„ÙÛTQÖØee  ˜ ˜ 34ƒý‚ýCöBö@ð?ð ìì×éÙéééíêíê¼í½íæñæñL÷M÷šý™ý;;“ ’ ……+,::þÿŸ Ÿ sqàüßüdödöqðqðpëpëµçµç‹åŠå ååTæTæFéEéÂíÁí|ó}óúúÆÇÚ Ú ñòÌÌ/0Þݬ«  g g SS^ÿ^ÿìùìù=õ=õoñoñ¦î¥îííÛìÚì'î&îòðôðõõúú†ÿ‡ÿÛÛ¯ ® ± ± ¯¯nmµ¶pp·µÔ Õ êé‡ûˆû^ö]ö¿ñÀñîîvëwëBê@ê„ê†êCìDì\ï[ï–ó—óµø³ø`þaþPO jiÄÄÇÆ­¬· · ¦¦'(uýtýÝ÷Þ÷ßòÞòíîîîrìpì”ë•ëVìVì‡î†îëñêñ0ö3ö û û  G I óòYZee  k m © § ìÿïÿ¤ú¢ú‹õ‹õññíšíƒë…ëÿêþê ì ì¡î î†ò‡ò‹÷‹÷KýLý^\; < jjˆ‰QQ¡¢qqÐÑÛÚ¶ ¶ ÞÞßüáü÷÷òò#î$î©ë©ë¼ê»êgëeë‚íƒíñðñðjõjõ úžú#"{I G &'ÔÒìíPMj k w x ¾½šÿ™ÿnúoú¡õ¡õŽñ‘ñ–î•îòìôìÒìÒì6î6î ñ ñõõúúŸÿžÿAC  Ÿ >?ÂÁÎÏKJ;;ÃÂc e  xþxþ'ù&ù…ô†ôêðêðŽîîííñíòí¥ï¤ïyòyò>ö@ö­ú¬úsÿtÿ//ƒ  ˜™äâØØ……  ƒ‚./^ÿ]ÿƒú‚úöö ò òUðTð]ï_ï¸ï¸ïXñYñôôÁ÷Â÷üüÃÁce˜ —   jj££§§€@ @  ¤¦%ý&ýüøùø}õ~õÿòÿò§ñ©ñ‡ñ…ñŒòŽòœôœô÷÷ýúþúÏþÏþ›šÂŸ ž „ … j k U S WX’’33{þ}þÀú¾úZ÷Z÷¨ô¨ôîòîòQòPòÓòÔò[ôZôÂöÁöäùåù£ý£ýÆÇæå 3 3 Ï Ï ]]ï ð – • [ \ iiôôJJ½ü½üŸù ù9÷8÷ªõªõõõaõbõ˜ö—ö‘ø“ø*û)û-þ-þTT]]óòÓÓÏ Ï â â  ffôôÛÚKþKþŸú ú?÷=÷ˆôˆôÄòÅòòòòŽòôÿóRöTö[ù[ùôüóüÞßÔÕ{z{ z ˜ ˜ ©¨«¬­ ­ Á    ÃÂDþCþ«ú«ú§÷¦÷„õƒõnônôuôuôrõqõQ÷R÷êùìù ýýcd­«ŒÉÊ1 .       °±nlvxùÿøÿ/ü.üføføøôùô?ò@òƒðƒðûïûï°ð¯ðƒò‚òNõOõéøèøýý­®0/6 6 c c ƒ„€XYÛ Ý Ô Ô 78RPjþlþ×ú×úß÷Ü÷®õ°õxôxôEôDôõõÕöÕöbùcùü‚üóÿòÿ^]yzùø¥ ¦ U T ü ý ” ’ 9:poü~üžø øõõcòbò¡ð¢ððð”ð”ð6ò6òËôÊô&ø&øüü@AmoJIŽ ÿ ooÐÑn l æ è ½¼()xwýý ú úÒ÷Ò÷qösöùõùõmölö»÷»÷»ù¼ù;ü9ü÷þùþµ³4587˜˜24IGðò!"ýýÿùÿù#÷#÷ÌôÌô8ó7óŒòòàòáò"ô"ô>ö;öùù:ü<ü¢ÿ£ÿýý±³¨ § Ù Ù 4 5 Å Å âã¹¹USãå•ÿ•ÿ™ý™ý ü üûû®ú®úçúçú®û®ûèüçükþkþ´µ""&$žŸwwµ´kl½¼ÏþÏþ»ü»ü±ú°úÐøÐøS÷S÷YöXööödödök÷l÷ùùûûeýdýÏÿÐÿ0/YZ55œ›uv¹¹`_{|*)„„¿¾  ’ÿ’ÿqþoþÂýÂý‹ýŒýÐýÏýþƒþ‹ÿˆÿÆÈVUXY79ääûü‡…—˜XþXþñûîûù’ùj÷g÷¢õ£õfôfôÉóÊóêóèóÒôÓô†ö…öìøíøÔûÓûðþðþýüÉÈ##ìî i j üûVU89ÕÖddþþ5ü4üÖúÖúúúú úÞúÞúGüFüFþHþ¥¢00¶¶úûÉ È Ú Ü  ÿ # # QQ¬¬]]£þ¢þÄúÄú÷÷×ó×óFñFñ˜ïšïîîíî\ï\ïæðåðiókóÊöÇöÂúÃú ÿ ÿNMABš ™ ( ( ºº58œ™ò ó Z [ 23DÿDÿ ûŸû‘ø’øVöUöõõøôøôëõëõÜ÷Ý÷¬ú¬úþþÎÏ••    ""õö‘ ô ÷ TRßÞñýòýìøìø1ô1ô!ð ðüìûì ë ë…ê‡êŒëŠëîîÂñÃñeödöˆû‰ûÓÒäâf f  ›šîîïñ®­;<Ò Ð ´³45¸ý¸ý’ù“ùöö óžóHòIò6ò6òióióÌõÌõ.ù-ùWýWýêé}« « dcomBD% $ ööÒýÑýŸøŸøÕóÖóÌïËïÎìÎìëëÄêÂêãëåëcîcî ò ò öŸöÁûÀû67Í Î ‘DD­®¤¥+*hi¶ ´ lláârýsýuùrù7ö7öøó÷óáòäòóóPôPô±ö°öçùèù»ýºýÖ×îî¥ ¢ ® ° ©¨@@ ƒ ” ’ ´´01dýcý¡ø¡øKôLôÄðÃðPîOî#í#íCíEí«î¬î8ñ7ñ²ô²ôÍøÍøEýEý¿¿óóœ v v WTÉÇ` b    ŠŠàßTýUý4ú2ú»÷¼÷!ö ö~õ€õèõèõR÷R÷™ùšùˆü‡üÕÿÓÿ69ie        ñ ð ìí&%ÔÕ:ÿ9ÿ”û”û,ø,ø?õ@õóó©ñ©ñCñDñâñáñróró×õÖõÛøÚøDüCüÕÿÙÿXW{|  É É ¤ £ “ “ ¨ ¨   ÈÉ1/zyÒþÓþƒüƒü±ú±úƒù‚ùùùXùYùRúTúëûèûöý÷ýRQÇÇ"!žŸg h ^ ^ €ÚÚ˜—áâìþìþùûúû>ù>ùõöõöJõGõWôYô1ô0ôÕôÕô0ö1ö)ø+øŽúŽú7ý7ýîÿîÿ†…ËÎÙ×qp^^§¨caª¬¯®—˜”þ•þÒüÑüxûyû´ú´ú–ú”úûû:ü9üÊýÊý­ÿ«ÿ³¶··îï:9ÐÑÁÁ °®6þ7þÑûÐû¤ù¦ùÛ÷Ù÷ööãõâõßõàõ†ö†öÊ÷Ê÷“ù”ù¾û½ûþþvvª«ŒöôÌË  ¹¹àßšš  SS˜ÿ™ÿþþ¹ü¹üÙûÙû|û{û¤û¥ûYüYüý€ýÿÿÂÂ’’VVääÜÛÿ€[[©¨“”HIöýôý¿û¿ûÐùÑùHøGøB÷B÷ÍöÌöñöóö«÷«÷éøçøúúwüwüþþ}~SSÚÙøø ŸÈÈpp¡¢~‘ÿÿšý˜ýuüwü¾û½û”û”û÷ûöûÜüÝü%þ%þ³ÿ´ÿ_^Ÿ øúõõusffÊÊ££.. !þþüügúfú ù ùø!øµ÷³÷Ù÷Ø÷€ø‚ø¢ù ù#û%ûèüèüÇþÈþ˜˜68€a`ÑÏÅÆPQ…ƒnp//ÛÿÚÿþŽþlýký“ü”üüüüü’ü‘üyýyý¼þ¼þ88ÎÍ`aÖÖüúttbbººŒŒìíþþNüMü¾ú¿úŒùŒùÉøÊø‚ø‚ø¹ø·øaùcùpúqúËûÈûTýUýòþóþ‡ˆëéÈÈ“’ÉÉÃÄ’“LÿLÿþþøü÷ü*ü*üÎûÏûôûôû˜ü–ü§ý¨ýþþýþ~  ‰ŠèéÌÌ$$ÿ\]DDÐÏFFpþpþºü»ü=û=ûúúWùWùù ù0ù/ùÆùÅùÂúÂú ü ü„ý„ýÿÿ†…ÈÇÂÃ]]‘‘ggæç""**îþíþ×ýØýìüëüCüBüûûûû)ü)üÅüÇüËýÉýÿÿŒ‹ãäÒÒ/1hhJKØ×,,jj¬þªþ ýý³û³û¬ú¬úúúÇùÇùõùóùƒúƒúgûiûüüÙýÙý9ÿ8ÿ‡†¨ª‰‰ 43þýmnŸžž}ÿ{ÿRþRþ5ý6ýIüIü±û²û‹ûŒûàûßû«ü«üÖý×ý?ÿ?ÿÇÆUVÓÒ  .-ãã++ÿý[[FGÙ×+,aa™þ™þïüíü‰ûŠû}ú{ú×ùØù¢ù¢ùäùäùŒúŽúšû™ûèüçü\þ]þÕÿÕÿ23RR! ††…„ ddbb/.ÝþÝþŠýŠýLüOüOûNû¥ú¥úqúqúÃúÂúžûžûíüîü–þ–þts__9;éæIK;9¤¥{{¼¼wvÇÊÎ̯®‘þ’þ¢ü¢üøúùú¶ùµùîøîø¦ø¥øâøâøùžùÄúÂúEüFüþþÙÿØÿ  ..cd [X@?þþ`_„ÿ†ÿ™ý—ý»û»û"ú#úõøöø\ø[øjøhø!ù#ùyúxúIüKüwþvþÓÓ43{zwy    ƒ „ 8 7 < ; ››rtðî?A“ý’ýûûóøóøQ÷P÷ZöZööö™ö™ö¾÷¾÷tùtù“û“ûõýôýghºº»¼GF=>‘5675¢£š›?@Àý¿ýLûLûùù^÷^÷PöPö ö ö¥ö£öÿ÷øúú†ü…üZÿ\ÿ\\WX  F G Ò Ó Œ n o x y Ä Â st¬¬¡¢}þ}þ~û~ûËøÍø£ö£öõõ\ô^ôiôjôEõEõÜöÜöùù½û¼û¦þ¨þ¥¥{zêì¹·» ¼ ä å < ; ÒÒÅÅ.-BA9ý;ýhúdú ø ø[öYöpõqõVõVõö öy÷y÷•ù•ùAü@üVÿVÿš™ÎΫ¬û û ’ ‘ O N 1 1 3 5 e d ר¸¶:;°ý°ý`ú]ú‚÷ƒ÷LõLõÔóÕó3ó3óoópóŠôŠôhögöîøïøæûæûÿÿ58~}C C Q P õ õ „…PN€_]6ý7ýUúTúè÷é÷öö õ õ×ôØôŽõõ+÷+÷…ù…ùiügüÿžÿÝÞï½ ¼ . - Ì Î ’ ‘ q q ˆ ˆ ôöèçššGýGý&ú&úh÷h÷9õ9õÃóÁó"ó"ólólóŸô ô¨ö§öPùQùaübü“ÿ“ÿ©©vwÏÏ„ ƒ m o m k ƒ „ ÚÙ—˜üû66qýrýèúçú¾ø¿ø(÷*÷MöKö>ö>ö÷÷‰øˆø®ú­ú@ý@ýùûÎÍTTL K ~  Ë Ì = ; å æ ììqq¦¥¬ÿ¬ÿ¸ü·üûùýù¬÷ª÷÷õ÷õüôþôÐôÐôfõfõ¯ö®öøŽøÜúÜúyý{ý:8ëì\^YZ©¦* , ëëúùtswv !¢ÿ¢ÿ7ý7ýûûù€ù|ø|øøøaø`ø=ù=ù£ú£ú€üü¯þ¯þ [\yx23ef  ýü`_//„ƒnoþ›þ,ü.üúÿùJøIø-÷0÷ÂöÀöõööö¼÷»÷ùù½ú½úÌüÍü ÿÿ==::ÚÛ©©ÃÂUVoo  ƒƒ¸ºòþòþQýOýñûñûóúóúZúXú;ú=ú–ú–úkûkû·üµüVþVþ%&úùœœööò󇆯°gh°°Žfg™ÿ™ÿÖýÕý;ü;üçúèúïùðùfùhùLùKùŸù ùbú`ú~û€ûçüæü|þ}þ!´µ$"ÌÌÔÔA@bcLLÓÿÓÿ þ þý‘ý»üºü0ü0üüûúû%ü&ü¥ü¤üsýtýþþ¯ÿ²ÿìì&(¢£üüµµ  ÓÓggøþøþ¤ý£ý‡üˆü­û¬ûûûÏúÐúÚúÙú5û6ûâûãûÕüÒü÷ýøý3ÿ3ÿopŽ{}00ŸÅÆ¥§A?œœÅÅÈÉ¿ÿ¾ÿ¹þ¹þÓýÒýýý§ü¦ü„ü…ü®ü­ü"ý#ýÓýÓý±þ±þ«ÿ©ÿ­°²±££yy" ‰ŠŸ b`ÅÆãäÇÇ‘QÿQÿ þþýý ü ü<û<û°ú°úúúÄúÃúnûlûiüjü”ý”ýÖþÖþXWyzhipqrptuŠ‹wwEE ÿ ÿêýèýíüîü/ü0üÀûÀû©û¨ûæûèûwüvüMýOýfþdþ²ÿ²ÿ))¯®DCÿ;9øûXWbc''¬«÷ÿöÿ'þ)þbüaüÕúÔú§ù§ùðøðø¼ø¼øùùÀù¿ùâúãú\ü\üþþñð½¾@B`^$'À¾ÎÏa`”–˜—”þ’þµü¶üûûãùäùùùÔøÕøùùéùçùGûGûýýJÿHÿ—˜ÖÖÏÏbaooïïØØ'(××çækj–ÿ—ÿµü¶üúúð÷ï÷döeö†õ†õ[õ\õñõîõA÷C÷9ù9ù¸û¶ûxþxþRT }}stÇ Ç i h < < H H ››UW«¨ÃÿÆÿÞüÞü/ú.úÝ÷Ý÷ö öõõÏôÎô†õ…õ3÷5÷¿ù½ùÓüÕü"!_`^\óõþ ý G H « ª   p q ññÎÌEF¥ý§ý1ú1ú÷÷£ô¤ôôòòò8ò8ò€òòÐóÐóö öùù…ü…üSS.-ÄÄ  ä ä þ þ þ þ ï î é ë ¿¾ 9ý9ý”ù“ùaöcöéóèóbòcòôñóñ£ò¤òfôdô÷÷wúuúMþNþWVONñ ò ÷ ÷ þý––Û Ü ÿ ÿ DD‰þ‰þ4ú3úNöNö,ó+óññðÿï,ð-ð†ñ…ñìóïó:÷7÷*û,û|ÿ{ÿ×Ùðïk j  •˜ýû./A ? K K Œ??¨ý©ý-ù+ù&õ'õò òðð†ï†ï2ð3ðòòóôóô°ø±ø ý ý¨§56M L – — ÆÄ±²QR´±ð ò FGö÷WÿVÿ½ú½ú…ö…öóórðsðïïñîñîðð…òƒòööZúYúÿÿØ×66ã ã ¢¢FE±±ÙÚÑ Ð À  ßßyxàýáýsùsùŠõ‹õmònò`ð_ðïïäïåïˆñ‡ñPôPôøøoümü45÷õH I ½ » êê|{ÁÂð ð ?>÷örÿsÿûû÷÷»ó»óhñiñ2ð2ð7ð:ðrñqñÈóÆó÷ ÷øúøúKÿJÿ©ªÈÆR S ±¯((ffv t i l ……•ý–ýJùLù“õ’õ®ò¯òÜðÜð4ð4ðÈðÇð†ò‡òGõHõÞøÝø÷üùüJIvu& &   ÓÒyz ‰ ‰ DCllOÿQÿBûCû‰÷‰÷ô}ô`òbògñgñ©ñ©ñ ó ófõdõ‚ø„ø)ü)ü”“‹ Š ¬ ® Ø × ñ ñ þ ý   JJãã4ý5ý|ù|ù?ö?öÄóÃó9ò;ò¼ñ¼ñUòTòõó÷ó“ööòùôùÓýÒýÐÏ…‡««  y { î í a a å æ ™š©§OPÙþÙþˆûˆû¢ø¡øYöZö×ôÕô7ô9ôƒôƒô°õ°õ­÷®÷TúSúwýxýØØ..<=¾ ½ ~ € W W 4 3   # " {}TSéÿëÿ‰üˆüpùqùæöåö õ õôôçóæóµô³ô]ö`öÄøÁøªû«ûÕþÖþùú}~h h – • ð ò s q " # ŽþŽþÃûÃûiùiù ÷Ÿ÷ƒöƒö%ö$öŽöŽöº÷»÷ùùëûìû—þ—þ\ZRQ()a b è è ³ ² »½Ö×/-SÿTÿüüïùïùÄ÷Å÷0ö/öUõWõYõWõ;ö<öß÷ß÷úúüœüJÿIÿïïaanpúùÞÞ ‰ˆ]^««ššTSÿÿÕüÓüêúéúcùeùbøbøþ÷ÿ÷EøDø-ù,ù¨úªú›ü›ü×þ×þ-.ji`bëéõ÷aa&%CDÐÏìî¾¼fÿgÿýýûûKùJùøøt÷s÷v÷w÷øø<ù<ùÔúÔúÁüÁüéþçþ<;‡‡trÆÇxw›œGF¥¦ÓÒèÿëÿ þ þ\ü\üþúÿúúú¨ù¨ùÈùÈùgúgúvûvûâüàü‡þˆþKJ¯°    –•¡¡'(33ÒÒ(()þ+þRüQüÊúÈúªù¬ùùùÐøÑøùùÕùÕùýúýú}ü|ü5þ7þÌÊ]^ŸŸ††¿À  ûü®­,-ÿÿþþÈüÇü¾û¿ûûûÙúÜú û û¦û¦ûœüœüÔýÕý9ÿ7ÿ£¤;:68ãâ,-  €‚š˜ef‹ÿŠÿþ þÕüÓü¸û¸ûäúäú`ú_ú:ú;ú€úú)û(û,ü.üvývýäþãþ\\¾¾ôöóñ§©ÍÍ,,FE)*÷ö¿ÿÁÿþšþŸý ýâüäükülü?ü?ücüaüÊüÊüsýtýNþNþJÿJÿZZjiab/-´·ææ·µ77zz——˜™…ÿ…ÿtþsþoýoýœüœüü ü¼û»û½û¼û ü ü—ü˜üXýYý=þ<þ;ÿ;ÿBACC/1ôò……ØÙéé·¶CC››ÏÐêç/ÿ1ÿ~þ€þüýùý¡ý£ýzýyýý€ý¹ýºý$þ#þ´þ²þbÿbÿÇÈRS½½ûú ûú¿¾^]ÜÝ>>ÿ‘ÿåþäþJþIþÓýÔý…ýƒý]ý^ýaýbýýýäýãýUþVþàþâþ~ÿ}ÿ¹ºGH½¼FERQ89¸¶ZY÷ø””/.ÐÿÒÿ}ÿ|ÿ3ÿ4ÿþþÿþçþåþéþëþ ÿ ÿ>ÿ?ÿtÿtÿ¢ÿ ÿÉÿËÿíÿîÿ55MKRTIH12îÿîÿËÿÊÿ©ÿ¨ÿŠÿÿuÿsÿ_ÿaÿQÿRÿIÿHÿGÿGÿNÿLÿXÿYÿlÿkÿˆÿ‰ÿ¨ÿ©ÿÐÿÑÿüÿúÿ$$KKrq™šÄÅõô!!KKdfqohgLN)(øø»¹sv""ÊÿÇÿhÿiÿ ÿÿÀþÀþƒþƒþ_þ^þQþQþ[þZþyþ|þ±þ±þøþ÷þNÿNÿ¯ÿ°ÿyzÍÌ  //64çæžGHæÿåÿƒÿ„ÿ(ÿ'ÿÙþÙþ›þ›þ|þ|þ}þ}þŸþ þìþìþXÿYÿßÿÞÿzy¨¨('ŠŒÎÌèèÐÒ†…YY‘‘ÄÿÅÿõþõþ;þ<þ¡ýŸý,ý-ýéüèüÜüÜüýý\ý]ýáýàý…þ†þ@ÿAÿÇÇrsüüYYqq.-¿¾'(vu³ÿ´ÿðþïþ>þ=þ²ý²ýZýZý>ý=ýeýdýÄýÅýRþSþÿÿäÿãÿÈÉ««wvŒ½½¯®VVÆÆûüÿÿþþBýCý£ü¤üAü>üü üCüCü¯ü®üQýSý*þ)þÿÿÿÊÉeeÉÉòñÙÙ††üýHGuv”ÿ•ÿ¿þ¾þþþqýsýýýüüýü ý!ý†ý…ý#þ"þñþòþàÿßÿçæèéÊÉxyÞÜ÷öËÌ]^¶¶ÚÙáá×ÿ×ÿ×þ×þñýñý8ý9ýµüµürürüpüqü°ü®ü*ý,ýÚýÚý«þ«þÿÿqrBBêëee¬«´´ ee™™ºÿ»ÿåþæþ.þ,þŸý ýGýGý)ý)ýBýAý˜ý™ý*þ*þêþëþÎÿÏÿÁ¿ª«wwxxž††0.žŸÞßùúÿÿ1þ2þwýwýóüòü°ü±ü¶ü·üûüûüzý|ý%þ#þíþíþ¿ÿ¾ÿ‡‰9:ÄÄ$$RQCBýþ‚‚ÜÞVÿUÿ“þ•þñýðýyýyý1ý1ý&ý%ýOýOý°ý±ýNþMþ ÿ!ÿ$%äämjº»ÈÈ–•))€²°ÀÁÌÿÌÿÞþÞþ þþ`ýbýòüñüÃüÂüÓüÕü!ý!ý©ý§ý[þ[þ(ÿ)ÿÒш‰{z  ‡‡,*ÄÄâÿâÿÿÿ/þ/þ„ý„ýýý¾ü¼üµü¶üëüëücýbýþþÿÿ  þý¥¤  ,)£¡('+,ÿÿþþ7ý6ý©ü¨üdüfüiühü´üµü:ý9ýïýñýÇþÆþªÿªÿ‡ŠUTüýwv¶·»¹xyûúIGqq‹ÿŒÿ©þ¨þÜýÜý0ý1ý·ü·üwüwüvütüµü¶üBýBýþþ%ÿ%ÿHHed[^"#¸¶%&ûü‘íê ÿÿ7þ8þ€ý€ýùüùü²ü²ü©ü©üßüÞüIýJýáýáý™þ™þiÿhÿ66üü¤¤""bbkj77ÑÒAB‘‘Öÿ×ÿÿÿpþrþâýâýoýoý,ý-ý"ýýNýPý½ý¼ý\þ[þÿÿõÿõÿÇÇŽ:9ÁÃ)(a`lm><ÔÔ>?~²´ìÿëÿ1ÿ2ÿ”þ”þþþ½ý¾ýýŒý‡ý‡ý¦ý¦ýåýçýFþFþ¹þ¸þ;ÿ<ÿÀÿ½ÿ9:¦¦÷÷..BA46 ÉÉwy»ÿ¼ÿUÿUÿòþóþªþ§þþ‚þ‚þþ§þ¨þæþåþ3ÿ4ÿŠÿŠÿéÿéÿNN·¶ ~~ÌÌìí°°ec  ªª>?×ÿÕÿjÿjÿ ÿ ÿ²þ²þlþlþ:þ;þþþþþ,þ+þRþSþþþÖþ×þ#ÿ%ÿyÿzÿËÿÈÿce§§ÜÜúûøøØÙ¯®€OPäÿãÿ¨ÿ¨ÿsÿsÿLÿKÿ<ÿ<ÿGÿHÿoÿnÿ®ÿ¯ÿøÿøÿHF”•ãã..ut¥§ÆÄÇǬ®vt!"¶¶76°ÿ®ÿÿ ÿ™þ˜þþþ¹ýºýtýuýQýQýUýUý{ý|ýÆýÆý3þ0þ»þ¼þ]ÿ\ÿ ´µJH¼¼  ::GG12ïðŒ‹  xyåÿåÿ`ÿ`ÿõþõþ¦þ¦þ}þ{þrþrþŠþþÅþÄþÿÿ•ÿ•ÿ±³EDÃÃ'&dcstWV  Œ‹ìï43pÿqÿ±þ²þþþqýpýýý¿ü¿ü¬ü­üÏüÏü&ý&ý«ý¬ýXþWþÿÿìÿëÿ¶·nn  ‰ˆÜÛôöÚÙ†‡eb´´dÿgÿÜþÛþpþpþ"þ$þþþþþNþPþ¶þ¶þ>ÿ=ÿÖÿÖÿtv  ””ÿþCDa`KK ™™WU˜ÿ˜ÿáþâþ4þ3þ—ý—ýýýÈüÉü«ü¬üÌüÌü(ý(ý°ý±ýXþWþÿÿÑÿÒÿ’‘EGãáZZœœ°±˜˜RSððxwïí`aÐÿÐÿMÿNÿÜþÛþŒþŒþaþbþaþbþ†þ…þÌþÍþ-ÿ-ÿ ÿŸÿ”–a`£¢ºº¬¬||+,ÇÆPOÌÿÌÿFÿEÿ¿þÀþFþHþèýèý§ý¨ýýýýýÎýÎý!þþ‰þŠþÿÿšÿ˜ÿ-0¾¼;=žžää  þÖÓ‘88ÔÓii¯ÿ­ÿgÿhÿ2ÿ3ÿÿÿÿÿ ÿÿ-ÿ*ÿZÿZÿ–ÿ™ÿÞÿÝÿ&$aa““²²ÅÅÅÅ»ºžžno'&ÒÿÑÿvÿwÿ&ÿ&ÿáþàþ¬þ«þ„þ…þpþqþrþqþ‹þ‹þ¼þ»þüþýþNÿNÿ¨ÿ¦ÿaa··  RS‡†©ª´¶¨¨ˆ†VVÑÏ}}()ÓÿÔÿˆÿ‡ÿJÿKÿ#ÿ"ÿÿÿ ÿ ÿÿÿ1ÿ3ÿRÿQÿ~ÿ~ÿ°ÿ¯ÿæÿçÿ#!TUwwЉ„†mlIIâÿãÿ¦ÿ¥ÿfÿgÿ+ÿ+ÿ÷þ÷þÒþÔþ¾þ½þÁþÂþÖþ×þÿÿBÿCÿÿÿäÿåÿFF¨©OM‡‰±²ÅÃÁ£¢no((ÏÏnl ­ÿ®ÿ\ÿ]ÿÿÿêþéþÌþÌþ¼þ»þ¿þÀþÜþÝþÿÿ^ÿ^ÿ´ÿ²ÿFEpp‡ˆ‘‘Œ‹tuKLÑÿÒÿŒÿŒÿNÿLÿÿÿìþìþØþØþØþ×þíþìþÿÿUÿUÿ§ÿ¦ÿijÎÎ))xx³²ØÙààÈÊ“‘EFèè‚‚ ÂÿÁÿjÿiÿ!ÿ!ÿäþäþºþ»þªþªþµþµþÛþÛþÿÿfÿgÿ¸ÿ¶ÿ:;cc‚‹ˆˆoqDD»ÿ¼ÿqÿoÿ-ÿ/ÿûþùþÚþÙþÏþÐþØþ×þüþûþ8ÿ7ÿƒÿƒÿáÿäÿGF­­ aa££ÍÌÛÜÌÌœžYXüþ•–('ÂÿÃÿdÿcÿÿÿÍþÌþšþšþƒþƒþþþ¿þ¿þÿ ÿoÿnÿÎÿÎÿ!"ee••´´À··–”^_ÁÿÂÿhÿgÿÿÿÓþÔþ¢þ¡þþŒþŽþþ°þ¯þîþíþ@ÿCÿ¯ÿ®ÿ('©¨$&•”ìí$$;9(*ö÷Ÿž/0²²0/²ÿ±ÿ<ÿ=ÿÒþÑþ~þ|þ@þAþ'þ(þ5þ6þkþkþÈþÇþ7ÿ8ÿ¶ÿ¶ÿ**åäGGRR88ûû˜›&#§ÿ§ÿ-ÿ/ÿÃþÄþkþkþ1þ0þþþ þ!þNþMþ¢þ¢þÿÿ ÿžÿ45ÍÎ`^ÝÞBA€–˜€@@ÛÚWXÁ¿|ÿ|ÿãþäþWþUþåýçý¡ýŸý’ý”ý¾ý¾ýþþŽþŽþÿÿ¥ÿ£ÿ33²²#$yv«­½½Ÿ \[óòuvéÿêÿ\ÿ\ÿØþØþfþdþ þ þ×ýØýËýÉýèýéý5þ3þ§þ¦þ<ÿ<ÿãÿãÿ’“77ÎÍCD––¼½´²"!¤¥gh¸ÿ¸ÿ ÿÿnþnþïýñý ýžý€ý~ý‘ý’ýÑýÑý3þ4þ²þ²þ>ÿ=ÿÔÿÔÿiiøúpoÂÂææÝÝ«ªUSäæddÙÿÚÿOÿNÿÑþÐþfþgþþþöýöý÷ýöý!þ#þuþuþæþæþoÿmÿ ¤¤<;»½('nnŽ……PQøøzzÝÞ32„ÿ…ÿéþçþfþeþ þ þÐýÒýÂýÃýØý×ýþþjþiþØþ×þXÿXÿÝÿÞÿa_ØÙ57{{š˜”•pq1/ÚÚllôÿöÿ{ÿyÿ ÿ ÿ­þ¬þkþkþKþLþSþQþyþyþºþ¼þÿÿ‰ÿ‡ÿ~|öø^\µ¶íïþýÓÓ‰‰&&¯®*-ªÿ¨ÿ0ÿ1ÿÈþÆþyþzþFþDþ0þ1þ9þ7þ`þcþ¤þ¢þüþþþeÿdÿÐÿÐÿ75’“ÝÝ,-32!!÷øº»ih½ÿ¾ÿlÿlÿ*ÿ*ÿøþöþÜþÜþÔþÔþåþçþ ÿ ÿ?ÿ@ÿŒÿŒÿãÿäÿHF§¦ùú88ecxyyz_]./æè•“77ßÿßÿŠÿŠÿAÿAÿÿ ÿáþáþÎþÎþÎþÎþßþàþÿÿ6ÿ6ÿwÿuÿ»ÿ¼ÿüÿüÿ99ppž¾½ÊÉÄħ¨KLâÿáÿ¶ÿ´ÿŒÿÿlÿlÿTÿUÿJÿJÿNÿPÿhÿfÿŽÿÿ¾ÿ¾ÿ÷ÿ÷ÿ,,a`‹Œ¶¶ÔÔéèîïààÃÁ•—dc11ÐÿÐÿ£ÿ¡ÿzÿ|ÿaÿbÿRÿQÿMÿNÿSÿSÿcÿcÿ|ÿ|ÿšÿ™ÿºÿ¼ÿßÿÝÿ99DDHIBC;<*)ôÿòÿâÿáÿÍÿÎÿºÿºÿ®ÿ±ÿ°ÿ¯ÿ¼ÿ¼ÿÒÿÑÿìÿíÿ++EE\]ut~‚ywkmXYDC00òÿóÿÝÿÜÿÌÿËÿ»ÿ¼ÿ³ÿ²ÿ¯ÿ®ÿ«ÿ­ÿ¯ÿ¯ÿ¸ÿ¹ÿÃÿÁÿÏÿÑÿÝÿÛÿäÿåÿìÿìÿëÿéÿèÿéÿçÿèÿëÿéÿìÿîÿðÿñÿòÿòÿñÿïÿìÿíÿíÿîÿòÿñÿøÿúÿ$$,,0057=<GFJKHF=@10%% ùÿùÿõÿöÿòÿïÿìÿìÿèÿéÿéÿéÿéÿéÿçÿèÿãÿãÿàÿàÿÜÿÛÿÒÿÓÿÈÿÇÿ¾ÿ¿ÿºÿºÿºÿ»ÿ¾ÿ¼ÿÁÿÃÿÉÿÈÿÐÿÑÿ×ÿØÿáÿßÿìÿíÿúÿûÿ&'65?>BCGFIIJKLKII@B64'( þÿþÿýÿüÿõÿ÷ÿ÷ÿôÿöÿøÿöÿ÷ÿöÿöÿöÿöÿðÿïÿëÿêÿáÿâÿØÿÙÿËÿËÿÂÿÁÿ»ÿ½ÿ¸ÿ·ÿ»ÿ¼ÿÀÿ¿ÿÅÿÄÿÌÿÌÿÑÿÒÿÙÿÚÿæÿæÿõÿõÿ"!./558788<=CBEEEE>?54-,#$#"!"!!÷ÿ÷ÿñÿñÿéÿéÿãÿâÿÝÿÝÿÕÿÔÿÏÿÐÿÇÿÇÿÂÿÂÿÀÿ¿ÿ»ÿ¼ÿ¾ÿ¾ÿÀÿ¿ÿÅÿÆÿÏÿÍÿÛÿÝÿíÿìÿõÿöÿ  !"''/0;:IHQQTUQPHH65#$ öÿ÷ÿãÿâÿÌÿÍÿ´ÿ²ÿŸÿŸÿ’ÿ’ÿ„ÿ…ÿ‚ÿ‚ÿ…ÿ„ÿ‹ÿ‹ÿžÿŸÿµÿµÿÎÿÍÿíÿìÿ #%>=LMSUWTSSNNA@+,öÿöÿÞÿÞÿÊÿÊÿ¿ÿ¿ÿ¾ÿ½ÿÂÿÄÿÌÿËÿÚÿÚÿíÿëÿ ('JJddyz„„‹‰€oqXX:<ïÿîÿÉÿÊÿœÿœÿyÿyÿ[ÿ[ÿIÿIÿCÿBÿGÿHÿgnustep-gui-0.24.0/Sounds/Tink.wav0000664000076500007650000013513411240162532016644 0ustar brains99brains99RIFFTºWAVEfmt D¬ˆXdata0º3H—ÕœP2 -lz< ûÿöÿ:o¯‡LQŠ[2K}˜ƒV3d˜wh`ÐÿôÿD™±Œ:-ÊñÓ­Ÿ†e9W‡Š^U©Ø·¾&êÔ˜DSt¥º®º»±¦ÓýìõìŽéNN´w´/\AéÁ—ºU?Û8"TœR  #ÿ  ÷,ºÛ¦uGD`kZ>CE&3.)NiaåAeGHqks\2#ë c’œi1ùÒ»ËÙÿ5Xƒ¹|2,@22[S  *N[4ñÓÚLQ¶û7̨Ù#ä æÀ¦˜˜¹ÎÕ­•¯Èë ×kFlÑð§±Çˆ¯}J««NF¨ß ë¸]Da€‚¼z?j_fˆy™¨iBÜÃ’n>üÿ;uЫZiJ†‰MA3úÿ%4Gm6$÷ÿ0 e[\×ÿèÿÉÿÕÿ]|…Š‚ÿˆÿúÿóÿÀÿÊÿãÿ´ÿ±ÿ®ÿËÿUNØÿ¹ÿ×ÿ³ÿ•ÿÆÿùÿöÿÓÿÍÿÝÿ×ÿ×ÿ»ÿ ÿ«ÿŠÿ¬ÿðÿâÿ£ÿÙÿ9B3C¦ÿÌÿÛÿÄÿåÿäÿšÿ«ÿ²ÿ–ÿâÿ$.ËÿÞÿçÿ%ëÿòÿÅÿÇÿèÿÒÿÛÿÐÿÍÿôÿ²ÿjÿšÿ½ÿ}ÿ`ÿ­ÿ‡½t²ÿ}ÿ‘ÿÞÿ*F5#2õÿxÿ9ÿtÿäÿõÿ¢ÿWÿXÿ\ÿnÿ¡ÿ“ÿQÿAÿ;ÿPÿHÿÿ"ÿcÿkÿÿÏþÝþÿ2ÿ]ÿnÿlÿ6ÿfÿÌÿ§ÿDÿÿÿøþôþ-ÿ‡ÿÉÿ{ÿ«þgþ¬þâþÿVÿ7ÿ¶þPþ4þóþüÿôÿ$ÿOþLþùþØþcþ þRýý™ýþþaÿËÿ›ÿÊþ¤ýÕü&ýPþ¥ÿÓ}*ÿHþAþØþ>ÿÿ˜þ†þ-þÖýˆýÅýüþZ¬ÿþ+ý;ý+þÖþ ÿðþlþ¦ýý‚ý§þÍÿC±ÿáþ»ýDý„ý8þóÿ]IéÿÉýUüºüwþfP„Øþàý:þ¬þ÷þvÿºÿ³ÿ¢ÿôþ¡ý5ý¸ýyþ‰ÿžÄÈþþýþ®þbÿìlb+Òßï#ÿÆøuë}Ù¬Èþ¾‰¼Å¿åÇìÔžé!ý7;MÖ]«cj^+P=y+ÞÉ"Ìöõç×Þ‹Û5׎ÑnÏ–ÔGã úx ,ŽDæ\s‡{âfÂ?€Cãë´©Š€g¥_€hˆ© /ÍØïL·C%ø.rAO]Ä_1\MN÷9à’ô_Ï ±Nžš’$-˜ò±aÛo< _ùwýº|Ûy¾jÓ@†Pûûà6Æ÷²á?t‹¿‡iˆ<‰’º q»"ØKøÕ „OÂuþ}a}ÿ}Wn?I„ VÚ•¹;¦G©Å¯K»ÝÏuìa+‘="FL5LXKæE6AÇ?L>­9à-•ÜîÆÇŽ¥¡Œ€€=ßDúµö9)¹Q }ý˜{!}ƒuV]¥45 ôDݸÐÈÍÌR̳ÇsÊ;Ì ÑjÛçìø;G^lx|ÔzgjVOÙ!ûæz¨ò‚€ü‚€Œ€œh‰ª ãN¹+•QÃdlqn‰bcý\„[ÆR«@û#»ÇçMÄãòˆ€~„=–¬¶/äÛPœzý˜{ß~}áoÈHmÆã¦ Œ‹ò€:€ƒJ‰zœÁ¯Ä¢Ûéñ[2„Tsÿ¨~õ}¡{zjÝ@‚ÙU®C†€à‡{­Äê 4µU#eXjUa£W‡HÊ5Æ7ïöâå,Ó(¾‹¦ú޵€€ª„€6†TÏö Drý¤}—}ø}>zðb[6¥á̾{¤D¡ ¡2±í¼\Æ¢Ò;âNôúë !0×?Pì[^oNÁ.[3à×µ/€Šä\€Ô‚ÁJº¥ÿ3°S!sê}‹ë}¨{q­VeA53È"þ òøÞ/ÊBº °X®¬¶hËuîÇÝ9íWÈpá~{~Úo;S '`Üô®Ë’Ü‚€S†1‘~¨¯¿îÛRôe*ðEä[nRzn„Ä|HyùfkBœîÄ}¤G¥ƒG†×’¢¯“Ø“é&©?‡Q(Z³\KPF7Qfšì)Óù¼Gª²™ÓŽA‡ç„Hˆ…  M»“ßvÖ2ú[Ôzý¢|Ç~E~­s¹Wæ$:ô4Í3¥+‘Bˆï…±ŽÁó· Íæã?þ%P1AEíQsUþUµN @ +J°ì‹¾;•Ä€€‚E‡M Ï#ö&6R2r^ÿ}fø{p.U×4‹ÉÿÛãÔB¾†®ð¡› -³ŠÑ ï@ L%!@ëXÛháf’WÍA"&:LÖ8³»›C'7’ÍœG±þ̸çîÿeÚ(f<©U5lSy~É{¤tŸiÅU5Ö ‹á³º–š¦„€Þ‚KФóË.éX@*ä?MNK8(óA •÷_åaаÀzµN®¬§È¤¶£¦ß²NÇ¥áKÇ.ãXyÿÅ}©~ó~év'\˜#¬é*Ë©°ãž;™|‘¦›%­[Á“Óéãæõ¥ Ä ñ)š8ú@ÑDoÈeè} (/÷J ]5eLb-RÚ8A ¥ KýVìZÝÖÓÓÕ§âî{ôRýì~X*ÔBLWŠc8hg2dÔ]ªKÄ- NêCÇ金€(†P‘¤µ¿Šâµœ /¶4,; DßH%ER;ö,­\ °ûlíÆàDÖ‰ÊÇÃ¥ÅàͦÜ.ö€ñ7MOE_¶k>rÁjšPÆ+– ðàÖ.½W¥ü’šˆ·‡\ŽD™4¨þ·ðÅ‹ÕIèý%¼3ëI3X*]oVÂIÞ;(‰ ãæøÆüµ·ÊÎPÚKñ= -M@ÇNŸXAZƒSæE%5'Ëà û®éIÔéÀ(³I§š›Ü‘ ޱ™Ü¶tÛÈþ¨;\U÷j—v!s—bùL 5QÛ÷êá•Ùpܲãçç+ìù) ó…"è'Ò0h>[JGO‘K&>´+8¾¢âT½cœ–…€8™HˆÌ¢dÑü÷Ve0æJ½](f_X6H²8n3*ÿ[äÿOóâévààÕAÓÓÏ(ÏgÖöæHúƒ1wMY`[ej\ÃL€7Ãåëe»˜Â† ö€–ƒ-À GºIÓøê=q¶"›0 9 @L°Wm]”[ÝN9!"% ñÙÖ¢À³”¶ÚÌYê#‹7ÌSŸf"j°_cL\5zödØ‹Ç;y·>°Í¨Ä¤|¨Ä°¹JÂbÌÛ”õ;ëWl€w{ywKgžKû* ²ëRÒÖÀF»»ÃžØ÷îý y.96]4%+F! É À òÛÊȲ¶¿¢h)„ƒ‚)‹áš=µøÛ&21‚Oka~jmÀh;Y´û9 '­ JðØè¿Ÿ¤0¯‚½ˆÓ›¤³~É]à„ûb--­@QNHTÑUáSNNçHD9<=1!Þ ±õæå=ÙVÐÚÎ'ÒÜÙ5í¦ »(|;JCCÜ?:¸,é¨û ãgÉd° ¢•  ¥¿«ñ²M»ÉëÛðjP7.?*Rzdr…u¨jïS”;$Z Ùð-Ùyèµg³ºÝÆÎÚYõ O™$E+Ô-¨+—!‡†6øÕêÜÝÍJ½ú©uš€”©˜L£×®™»’Ð>î5t.”MAfÔsOt#jNZH4Ïn¥éF×¢Î1ÏŽÐ=Ï*Ñý×xàŽìUþ¾€Ú!˜#'%°(-&U3õ÷Ü‘ÁÖ«¡Âžß ¦…´›ÎåïwK)“=ÄLjX‚b]iÉi:cÊUöBŸ0•!¿ ðUÜÞɬ¿]½zÁªÍ¸àLôÙ&å*¼9õ>;5ˆ ­ \ÿ”îÅÙùÅж³«Ò¥8¨|²EÂ6Ó±áèñá÷y3]J]\EgZküh1aìT¬Aw$‘-ÞDŸ¼²…®L¬­³¨Ä7نÖC"‹Ä t Bÿ(ðàâ#Õ¦Æ}»¦³X¬ ¦Ç¥S¯gÆpå}°9eS‚jMzÊ~‚yéklU7”ø;ä/Õ™ÊqÁ»2¿wÉ(Ó‹Ù?áÊêïø_ È)1v0,)o"7¡ÃîzÔÀ¾®y£¡¤«ïà«ûpª1XPßfçp’o¸gÊ_áX¢OHAþ-ÎbÃïÝ}Ê©¼8²ï©ý¨K°k¾CÕ²ñ. '½7>>Ü=¹8`*; gé·ÏâÂ…º]³g¯e±h»ÅË|Þ¼ñï(™&«3±?æJ6W#bõfc¿Sz;¤!uéþÇ#©Ü’ï‹ò”¼¥¶ÚÆZÝ—øõË 8'ã&‚#tO ýÖôjïÂæ?ÜhÑúÈ‘ÆAÉXÎÕ4Ý´èNþ> RDy_pšxD}Å|¡qâZg=b”ù£Ø½¶«^¥o¨ð°É·MÁ€Ñ“åú÷ ® C|´+µ36z2%-¸pñ¡ÝcÊ*»³u´x½Ï^ìÊ7ûSŠfuˆ~Ü~ît§^a?Á&z€ýCêåÓ(¾<±‹¨Õ¦A¦ª¬ë²½€ËôÝáôO]&‡5>E;ª.|¾ õÙ(½P­&¬PµÁÁpÏ·á*ûùˆ*8>žO“Ø–¤‘¸|ÍŠßWòiñ*ã2 2Y1¡2¹0* ,ðüÁèîÙ¸Ñ1ÏϹÐ/Úní'  :Ujh€oçk a–R"> #%å“Íý»Y¯À¤e›'–;—šž­ÁãÖrêjüÙ 11‘?QC­>Ì3 !”ƒñðßVÒLÇÀÑÀ·Í˜äçü'â#ð6\GPS`[ó]HXªJï6´"Çþ$ê£Ô?¾<ªãœß•ЕÚ¬P½Òîß .)˜>XIŸJøHmEô;&,u¶ò\ãyÚÎØ™Þ-èÀîúõ¤à†(L:\J/Vˆ\L]ZúRwD+þ äé8Ðg»ªpœL”*”%œ$«}À—Ù)ó½ !Ì&ÿ.œ7>é;Ó3ï*oÕ\‰ó…ãÕsÌTÊtÒaâòñ»þ8•%<&LoTVõOs@)Ì€öAàÊß´s£b˜é•gšó¡p«;·År×ï Ûâ/½:?½AêBý;÷+ÎÙ¯ñšàÓâÍ/Ó™Þ‡éýõ z!3=EAèB£C$Cš>a4%LUø~ã˜ÒIÁe°º¢š}™# 2¬äÀhݵûü=09C¡Q™[Ã\ËPI=È, ™ö)é^ãänç!í(÷¦ƒÑ¨+37¡@¥EqEn=˜,ÛÅí±Ðï±Ì™%x)—ˆ ~®WÃÜÜE÷Ô±!“/!9³>·=!83i/S&­µ dû¡ï3å%ÚÜÑöÎìÏYÙUï‰ FÂ,a7æ@$H„E‹7# þôqØÙ¼ïª$£ ¡i¡ß¢‡¨Ö´IÅoÖäæPö%c¬3‘FRÜWÔTSL C 5B ˆžð«Ü7ѯÌÍÍ;Øíìj)‹ ó-`;ÿAZ>Ž18#8ú}øŽé3ÙOɽçµÄ°®®èµtŬÙÇñð-ûF¼Yÿaæ`l[ÏR~Cþ* ³ùbíàç,äÎÞÀÜÆâ›ëâòüó¹aÕÙ"½%ð#0ÆI<èÙÎNº7©šôŽíŒ”˜%¯2Èåß÷^'=îJÈNHLG½<º-Z qr ¯Vö—åoÙÕ'ÓÐÒQ×\ßÚéžùW¢%ì4Ý9^6[0'dÃüáÃÈá´c¤0š£ší¤Nµ ÆSÕãçoþϨ(7‡?GP«'ç^üÕæªÓÇêÆ1Ïq×ÎÜ„äÆðùü-¦¯ÐE 6Ëù˜éØÅN³–¥àŸ3¢Ž©´ÎÄsß ¼-6HEXOhW[ÐVêJ;š*0§gøDì(änÞóÕÔÍiÍ·ÒÂÚNæåô#D2(ž/b0'&Í„ÿ7ðòßýÌ\¼³î±Ù¶¤À Ð’äñú³ƒ.’=›KWq\8\}XuP¡D7»%†÷âˆÑªÉùÉ·ÌšÐÛîÿ@¸‰(›-+€%‡öpéœÙ¡ÌÅžÁ6Á4ÂcÄCÉ0ÑÝÞð O ¸3ËCNQ8\TaÀ]ËR¿A@+î²õþÝtÍ ÅÁœ¾r¿ÁÉÎÙŽçßð0øíÿs hùIV…Ýú&ñ(äÓÝÂb·²í±v¶ZÃÚèõxQ'=íQageç^S)G’:s+Ñ-|ö!êÐàìׂÐ÷Í^νÏ+Õ¶ßuíoþf¤!°-í3É1ï)ºÌùÝOÇ”½Û¼/¿ÃÍTà.ø!;3ÎBïLŸQKRFQPMüEá:o* $®ò ßoËe»Ž±²6¾ÐááãòÊ®è%©- *{ Ü ÿöââý×çÓ„ÐÍfÊÍËêÒóÛuäií2ø*¾+³AæQ6Z\ŸYîRPC*v Žñ ØBö³æª-¬»·jÇïÓsÞì"ü7 " [] ÇZ` xp÷+ìâ|دσÉÂÉÒ¦ß|ñ7 Û(|F×Zc5fEfr`rP7cRõ*éxÞmÔJÎóÎÒ€ÓÖµÛhâëCõ$ÿË °'Ñ.k0*Â+ˆ÷5ç4ÕÅ8½Â°ÒÅä¹õs[+6ÌE¸MúPTPLšC/7â*« Õ úAæ2ӆĸ¸ú¯çª<ª­°éÀ9Ù*óo %Ø-›1µ+Åÿõ…çÂ×&Ë,È3ÎÝØéábç„ïŠüò­Ê!$…,™6©@HŸIøB[69'ÊOýÁâQɵ¨m£š¥·®ù¿Ž×ï«£ s&Ä$ÒzV #tþ`÷Øð«ë#çAä˜åñé-ð¨ûe $!Ò3bEGVXbíc«ZÿJ9ê$Ž 7ñµØÒÇz¿=½?½±½ß¿ͿÙ,å{ðîúÁÙŠ´(†.Â,›%¬& +øÃåßײÎ×É¶É–ÐæáRûÊÄ&7ŽF¥Q9TDNBF3¢#ëÚþ¿íëÞÒ{Ƕ¼“²{­[­…°t¸nÄ#Óbåú"Æ/$4h/Á'­‰Gû9è›ÚUÓ±ÐdÑs×äõÍÍ Ÿ#(§2œ9_=>{<ê7G0±&9 6ð4Û½Èsº|°NªGªv²ôÁIÕê‘ÿ. %Ü0Ð3#1ï-÷)ñ ëwêøó íîèqçÌèúë ô¢Cî()8OFÊN‰O£J5A»1 ç ÓÂ2´^«™©¯6»ȹÔSâíð&«‚ “'™,i,ª)Ç%K¾ jþRï‘â6Ù¢ÒHÑ.Øå,òãþáÍ$å4s;è:m6Û/5&ÁSuõæÊ×…Ë[Áà¸,³|°½°ªµ/¿°Ë Ü@ð¸Z)ð4f:ô;7}*3Ö7÷ÉìÂãùܳÛ(ã™ïŽúx0»&h+Ÿ/32O3:2l.Ë(íÏŒ¥ïÞÏʨ¸ó«B¨S­A·:ħՌì¥P­1};Ú>?„<&2 $U ¿‡÷ÈðÞî÷î!î—îæñLöLýÞ *T3¶9þ=c>:6$ž EõàÆË¤¸«û§Æ«¦³½úÈÙ“ê?úƒV—Ñ'„+â,¶,ð(¼!Ÿ× íýËí}ßÖµÓýÕNÛ¯ædùý› +¼1ô6Ù6·-íGöØè*Û0ϿƎÁkÀPÂÚÄ%ÈWÍÔóÝPë’ùw ÛŒ-·<¼GJâDŽ:ÿ-ãý õ‚äâÜ€ÝŠá æwîâþeÙ%x*-d,²(L"¾¢7\²ü;ïßßWÑüŇ½O·þ³è¶!ì×èd1ˆBúMUOñFá90-\ ȼö×ñüñîñ‘î¸íàñ»õ¦÷'ûȹ Ò–i%“%i mÅ ÑüÆä Ì„¹i®¨¦r«¡¹XÎ åÆø×6¿%/Ž1W-Î(Ä'ö%?!æ´… Èýúþï†æòÞFÙÝÙÉâ£ïÁü¹ ¡€-õ4à2 +“!ã-ÙìÖÖɘÂÝ¿À¤Ã$Ì<ØÑãÂí÷÷hÛ ‹q(k2À;ïCFHIÈD¦9‡)ZGôUå¾Ù£Ô¥Ù‰æ¸ô²Ú .Í)/6,%Ò«· gü‹òûë¶äaÝøÖãИÌpÊxÊÎçÕHß í•ÿä8*œ;8G™M+OXJ=F)¢;=õpéìßúÚ<ÝëäÇê°í»ó´üÛ_ Ÿ 9 ±Ð Ž =öpé\ÝÑÕ︟´î¸LÃзá^÷Më!²0 ;AmD/C#<&0$”Æyºü¡òÔë&ç€áLÞKàuä=êõóRÅÃ#(¹)‹&®ÿ —ú/ìtÜ{̧Á•¾+ÂCÊGÕ âœñÞ¹— ß,I6Ã=¿CYFÍFòDï=Ç2á%vÃ%öcçÛ ÕÎÔ×=ܧç0øqð,8Ñ óMô ëþ,õfêàÊØ/Ó›ÎQÌbÌÐ×)ßUé¾÷nº(É5?@nGkHÖA 6½'xräô2äžØ Ô^Ô„Õ§×ÎÝÕæÑî§õÀüÓr ÿ_ :Øÿ°÷(ï°ã®Ö ÌõÆSǰÊÑÐWÜ_îJ{%(5»?’FIHuDÌ©;Ó6‰/ï"qýëæÚÏ~ÇÕÃǯÑ#àî<ùãúP£àXÒXû³ð­æáWÞºÜÁÛÚhÙ©ÛÕßMæIð‘üL ™(©7.BE$CÔ=5b&?òûÕç…ÙaÐ ÊxÆ0ÈÑ»Üå˜êñYø®ÿ›ËVX § K ÷ ®ÁüeñýæFÞ—ÖˆÐÏwÖ°åN÷’•\.AûLOcJ±Br9½-Á P–øDòÅë5ãqÜ"ÚÚØ}×IØKÛÝà,êEöhÌ.„#2'>&ý˜ €øáé¨ßÁÖ€ÏIÎÖœä¸ô€ý)(0Ñ1¿0Ó.[-r*û$@(𠤾÷÷çŠ×çÈ ¾i¹àºFÀxÉdØéë“ÿÍ/T¿ã6§ð†çtâWÝÐÙ@Ú'ßÉçôîåò9÷ïü?j ô"F,M4æ:?)=û2.#3þÜè±Ò£¿ñ´þ³Ü¹ÅÂe͹Û]î ;S¢Cp— v C ðÖÿ5ù§òí`èIæ9çüéÚðøþI'x6}AK¥PüLb?k,FÑóö|æ?ØÏL̙ΈÑtÓû×IßæhìƒòAø JÆ_ëÉ' ÝýXî àu×ÖØÙ¹ßÕèäø3 g…).1Ú6¯895­,Ð ‰Ð A‘öËìæâ-Ú]ÓÞË{Äö¿Ý¾/ÂAËØØ_è ø>>Q!(þ%§}û (þ(ïGãŽÞŒßÔâóæ¾ívùçYXf."€&.*:-ç.N.*T#w^Áï&ߥÐöÅ«¾s»w¾ZÈÌÖZæ©õ&)“ <'·&h"[α–~¯þ°ùìõ¿ó]ôæõë÷ÌýœÀ”É%V0È8÷;X9š2ú(dÕ$ô®â5Ö ÍÆ\Â/ÂÇ;ÏuØâ¦ìh÷½Ñ ‹…ÄÙ 4A :ÊúMðmèãásݙކç:õåz u%~-P0Í.0*#EÉ 'ý÷ï䱨uÏ–ÈÄmÂÜņË]Ô.ßäì±ü¦ Ö&'Ç+º+¬*q'õú¬½üºõÄïlëèêØï“÷BþM"ÕMó#(Ë*l+;)µ$ÙãõÚ÷QéòÜ0ÒÉÊÂÂôÇ%ÒÞCëVúÓ „·#å(œ*I+«)µ#<sÙ¢ Àuþúf÷ÕôÓó¾ö¨ü-Í›ð)æ,q,*»%R Mû4ë¿ÝûÐÚŘ¿›¿*ÅVÍÜÔ{ÜæGñÔüU“ÜÄ>%(œ)m' ¯Ï ¡‰öÀëQã`àãÁéðžúÅ 4Û$Ç'µ&N$ð Š  øÇïÿæÚÞÙ×ÝÑΦÌÂÌÂÎØÒÙÒä:ôèS—$Â1<ˆAE>Å2î$’Ž æõÊìDëDðàö¼ûp Qo6A,Øùïx» ª\ý¦ñ†â£ÓZÉÅýÄoÇ:Î%܇ï³Ï!–+õ3Ç8˜6¶--#RP‚ e¼ýû ü¯úÊõCòòóHö¶ü>… öÙ}!í#© µüÐìšÙÈȽ »[¼#À7ÈèÕÊçZøõ 2Ž"a#²#%n%”#2T½ G4÷îëµãéÝÜtá{íÿúy7¹*q,%ï 6*öóç0Ü~Ö3ÕäÕr×—ÙäÝeä¾ê ñø¤ÿ1 Œ ++ö4º;º>O> 8Í*¹Êù°ï‰èãyâWéqõîÁƒŸ.5 éí×ùÂôâï”éãuÜ:ÕÏßËÍÍ7ÕIà>í#ü zÇ/î9<=Í;7@.· øÙö‰ð—ë»ç2æié&ï²ñbñlòõºøýFÆX ò ÷ Ý ÷Äÿò·ãõ×¶Í’Ã;½®¾*Ljӹá‰ñ£Nñ$ -¶/j/T. ,ž&óû Gÿ÷ñì¹æ³äÉæ”êhð+ùAœE$Gkp KúÇí°åÞrÖ=Ò:ÓzØ0àÉèòëüAÙ#*0*4_5ì4!2»+Ð"š¸ xûËí6âšÛ–Ûàaåëeõ© >þ)² ÷ücõ²îUæþÞŽÛMÚÙúØ-ÙÁÛ¹àýætðÒý– `à%z.É4F8Ï6Â/s$ö' ¯ýðhäõÜöÙ*Ú–Ûßöåßí(óòö!û´ÿWmúÒŒëÇøúñÊëUäÜWÕFÓÉÖãÜöã~íµúÔ "ë!l+º2_65{0*€#ó ª âÿzöÆî'è7ã²áúâ¨äûç£ïíù£( üó/˜©¸óþ öì0ágÛ"ÛÙݹá;æóìƒön ‰ØU&<,ö024%5Ö2Ü+ "1 +ÕòdæAÝ¥ØxÖ-Ö Ú ãîÄöüB+§ % ¾AqÿÃûSöñÒìÄçœâkßnÞðß'ãç\íÅ÷É¿ä'p2 8Ò5ù-%*1Š—ø ìçä'â9à;Þ2ÞPáÌåìèÆëðoõKû¬múÍ o © š  úñíÈåâ½à!à…â'ë‡ùç´ *V3Ð8‘8Á3M-Â& Fz Nýñ÷÷ñÈéšá—Ü”ÚÉÛ^à…æ²íËöGmÚ÷Ë~Ø9 õü’ïææ)ãdá½àJã"ëq÷_¡] (&íÉ#:&ì&C'Õ&ÿ$C '. YþÁð'ãÇÖTÌ[ÆÙÆnÌ›ÔïÝŠéNø†r ÚnÚùÌòðð ð5ðîïÒðKó õ(öˆøqüÇÀ #&(>.U3ƒ5»0+$ø‰õô’èv܆ÒÃÍÐë׉à°çÝî~÷oÿ+fGÅ Å Þ N % m  H«üôÂì_éäêwï_õ*þ l‘,¡5„9ø:¹9b3>'æ Óþ!õìâä á9á-ã£âçßyÞ3ßã¼é/ñÔøJC Ü ð¥V} îø ìâÐÞ•á~çZîb÷-øÏ#$€#U" k'p Ÿÿù ð¾ç¡ßË×WÑAÍöËIÏË×Õã&ñþL ¥ùh‘MkûóçíÇíŠñ ÷ÞûU«à È'§Ä‘ @#ý$m%d#3¦~ IþïíàÇÖ˜ÑFÏ´Ï"Õ÷ßLí€ùM„ mDšô¥Î á ík"Rá_ü¼ùaø©ù‘ÿiÁZÅ ”)Æ/Æ0¶,S%Èx<9ðããõÛXÖ™ÒÕÑÃÔ7Û³âNè€ì‘ðˆõüùй ãðp²×Ç ÿ’ü7õ]ðÒì«êkìÙòûÙs õ4 Ã#­!Šç’ (÷ùµñ[ê³ãÞ>Ù;ÖÏÔ‘Ô8ÖÛâ‘ê–ôÒþÑÑýL; ÉE›qþû½øýõsô±õ úÀÜy !¹Ä 6 þë® éÄøuîtäeÛÔÐGÑÎÖŒÞ3ç›ð„û0Lê« ÀªÍ  4¢üíù¾ø÷õõøüS ÐÀ+>A.:géô÷píÀäݳ־Ò0ÑÆÒ«ÖmÛÂá€éFñ$ù«KK‘Ѹ¹4€ ^­þ²÷3ñ6ì¤ëðNöÔû n ,‚Òÿú<dþhøŸòçìqçYá`ÛÄÖòÔ/ÖÚßXå&ïbü8 J‡”%ö)ø+Ó(X!Mõ]û÷÷2üD6NÎO $³ ©EÙ»FL U÷ší4âŸ×üÐ3ÏŽÐTÔñÛèU÷‘3“ ‡‚òÛ7 Q /iþ^úLõÿñCðºï ò”÷vþ= Ô½ ï)ûÏñÙçSÜ ÒKÍ6ÎÒr׌ÝÉäÄí”öýö— J Hd¶ë‘ˆ]§ú)òsìÒèÛæ·ç:î©ù& –«U¯º Lùøñbê•åeäE宿“æÝäžãäçÃì†ósú|5 'í.2~1ó-Û&ŒX 3B÷:ò9ïÝíï#öÍÿmSr Y  EOHØÐÿÑþ¨ý»ùbóìâåoߑٓՂÖCܸäóîDûï ,Y$)M(•$H \O u˜ûîùWùÆ÷®õÍõìövõ ó¢òíò‡ô@ø¹ü¦ÕX ; *ÑüµïfäãÜºÖøÐÁÎÊÒÜŸçIó þ½¡K0rÑ´eÉÓ«ýQõî¶é½èjê„íÐòMûßSb¦ÇÓ÷ÜîÒèMã ßjÞ'âé˜ðŒõKù þŠ£1x<#›&Ü(.(æ#g•³ Èþ¡ôëëÞæ‹æÑèñëGñÿù#~'Çk¦ûö@óùðîýëêé}çÊåâäæìèšíêôþù<‰š#Ž)Z+.(Å ]hÿý•ôÞífêfêÈë¥ìIî!ò¹õX÷ÁøÒú(ýâÿªx ~m%Ÿü^öëîžçåâÐáMã~æ„ëó’ýy øÖ†$€)û*Ÿ)›&¾"A·ùO adrü…÷±ñUîíjíþî‘óeù¿þ,Öô ؽM ¸[Òûõ ïùëÎêÿêìšï¿ôÆû¾Ô²EM­w!n$%¿#1•†' ™ùŠð¡é æ¤äläæ êñ¶öŠûP&`ï¸þ'ý”úÖöµóàðÇí×êé¶é/ìçî}ñöìý¯›kí#Ê'(A% 1¬ÑýÎõrðPí¾êÒç€æßçvêoí=ñ°õ2úÓþîgV Ê à K ü(²üuõzð'î>í„íNð÷D Hß#Ä&'¿$+!Ï3Ý * æVÿWùÉò¥íÊéÅæ9æ`èRìßñúøeÙ …€ c Jûó#ïîï*ðxò8÷#þKhW +«é~Ǭñ4Q'ÖÕüò¥é‹á—ÚÙÖ¬ØýÞ>æ¦ìñòøùÝ;ˆ8'‹ýDù ÷Ð÷ãøoùÜøëömõõŠõ—÷ÂúÒý n ™|$'(Ì&¶!zÔ T÷šïÕè äŒâåtêÛî¹ðKòõ5øâúü ü†ÿ/ýJ ŒY‰ º ÛyùúáôÐñ»ò{ö©ûØ‚ ;Ë#]'D'&L#SÙ¥ 2ÿûøŠôžðîüìÆêÄç×åLå>ç—ëFðöÕýçÌ T_!‡mücöBïeê¿êgï©õlûú36êû¥•9&â m Œ ýôÁêâVÜSØÓՌ՘ÙüáèìÊ÷âÚ c5¤ D£þû\÷löÃøeýÓw•Ó3 ¸: Í I¡NV;è¾ ÿXóé9âðÝèÛzÝãeëpôªûÔÿÅ r j H (pÌ ¾ ¹ à Äå T·ý<üûXü¡ÿ¯ àÇPf"G OÊ# Äéø ï¶çqãaá·à÷à4âàä×ç$êYìÞîxòÖ÷<ýdü‰ _Œ ËAÿ€øôûðPîší¢ð÷"ók x9†¬ Å +Iý¤÷ óñï°ìké+å>áÈÞìÝ-ß|âáæAìBó"ûqÅ &„iÇÓó ͧÊÿBý,ûÈúý¤xqÖ / ¸2h€äãè ‚ [^þàö§ï+é#äXàdÞß/âç(íôô”ý.Ð a™Aþ‚ "äH þÃü5üû¢úçüþÿ> ? ñ `ž ½ ‘Xüàóþì<çœá×ÜãÙ7ÙõÚeÞùâÌè§îÓó ùžþ^ ± ŸtõÎ, y9‘ÿ¼û§÷ûôDõŠø…ü(ÿà_Â ï ” ¹ Ñ Å cþþaú²ôLïHë(èå¦â§áãæàéï[÷c ~xPé@B ø /¥ã– ¹t «7f  _ ‹ ‘ x³_· ÒùØó¼ívæ%àgÝiÞ”áÉå,ë=òiú÷! àȦýÆ_]N± E Òx·ÿéüQúøK÷ðö÷ ú, ^ ± &` û%ÿV÷ôðØêUä–ßNÞÌßãâræ!éEìÓðõ{úæþ>G ÑQ–š• > ‘þøøö3õYõ%÷¦üº "H›°µ ïHšûUøÌõuó"òÈðÌï’ïïŸî¨îBï¹ñqöÌû‰ï“½f"µ%v$$!JHW ’ýòûbüºü/ý´ÿýyaÑQ£ß$ŤmýM÷öï ê†æ´ãÇàºßäâáé±òÇûM QÙ¡'«ÓŠQ wëÃåã’ýÍúýø¯öõžôÔôö}ú~ÿDGØ<„ù·ïƒèuäá«ßºàÚåííçö)þ™ä/TŒóGX3žÏ~Ž øßbü‰÷–ô±ôšöEù}ýͽ øƒ™ ç 5ÝÀüõ3ð1î(í íqîñ¦ôøõúÆý¢šw ¡VT}"P#° Ï j®ýAöáð*ïñ‹ô˜÷‹úºþÈÂm¶»)ÿµüêø[ö×õqõnôVóåñ‚ïí°ë!ì°í4ïWòøÎÿsćŠWHt–n ¢fþÑøíô¦óòôKö÷õöw÷øßøcù>úmûôü þõþq÷Pÿ_üTùöþñ°ísëóëåíúð ö…ý“ù¨¾]¾tTº,Ñ  í(Æýãùö ô³ó¶óûôù÷!ü¨3Õa À : *¥ûüäø¬óGïíãížï!òUõüù¥ÿÀm K}nq·p«†9¾« PþÊú§ôÉïíìJëDêýê\îÃòötùÃû”ýìþ ÿjý»ûú/øÔô©òøññÔïnï{ð©òýô®÷ü8 1¡+ŽÖ<OIúÃ.þðøÀôòUð%ï7ï|ð÷ñŒóéõõø&üÿ2fT€}WÿSý#ùäôíòuó×ôWöùÞýE« )á^0ÁÏ"›z§ ®ïþ,úðõò­î[ì7ë[ìÐïôQø|üQÏ*Bex.¡þ8úpöõÏôõñõk÷¼ùëüJY§ð ú 8Е¼8›awùøAòÆì…èiåbävæ¾êïòô´÷û^ý•ý:ücûü üûÇúÌúSúöù§ùùÚø•øÅø1ûÿKêö äßc¬"i N”ü¼öÄòòïáíÚìníŽï£ñÃòàó]õœ÷Ãúý¦þnµ#íy |¼,zý²ú*÷]ôõbùÿMj ’÷Jp1ê;íN Âç;ÿ—ü]ú÷ÍòöîðëTé©çÞæ"çÿéï¾ô‹ú¶ÿ“ž ` §oÿŸúÖ÷ôôUòÜñéóø÷×üÁNsé ò  þ ; 3 I  ÉëR^þÜø(ò`ë{åßá°à²àOâ½æ­ísõ¶ûìÿvY Æš¤þ¥üü|üDü·üøýÒŤ"N @të[³.7È ïÁ÷ï–éç_ç˜èyê•ílòÑ÷¼û±ýàþ{Ç—ÂNg1 æ  Ä1°‡þœü1û¸úÿüd¬’ G+ °dG `²ýq÷¡ñí®ëEë0ëuêNêGëhìÉíDïÖðXóq÷üi©.Í 6 Çýú=øQ÷*÷zøü¨ ; … øºFÿ ñ ¡^ezþ’û²øÀõ…òöî¤ëëèßæ5æàçìê³îôÁúª ¾Ù<}# SC«§‘ M^   ³ Û ™ n³(ç m ±'mú.õ\ðäëvèZç›èºëüïáôú_ÿaMÇ ¿ 6 Ð c ¯ ] Ëâ$v9a†6¿ˆÂL& ñ : Í T  ‘¹û³õAñíGéòæcæXçKéÓëmîXñÚôÌøïü£}^*  e Ž E ^uP¶ÿïý¦üýóþd|aô q   £ ¤ € F—öþëúöòò]ðŒîáì°ë×ë~íDðÚóª÷ü‡^ ‘œˆ“îWà ó ¨5ïMæž¾h¨ÌK Ê ˆ  È  ®Îñý2ù‚õ¥ñbíXêÓéôê(íRð¼ó„÷4ü ŽZŽ 8 c gé S Ð L £öNÐÿFý‡û¸ûwürýƒÿ(¥Áˆžx^Êúöpò3ïhìê¶éÿéŒë‘í±ï/òõ¡ø¶üýÎ> !м^ìg¦ ¹†ÿØü½üüý ÿ}(öÀ h  EäÜœÿþ4üeú‡ø ökóÆñüð¶ð¨ðñ¥óçøêþã ÆÞ»¿×\õäc vdô‚iÏYq¯ÔC°.~|~Åþìü0ú™õ1ðèëÙé$éØèíé«íÄó±ú™H  V ÈD¿ ê y ‡ ÆÕnÑ VhýÿúèøI÷~÷íøVúmü}ÿ¾#N¤þñù^ô†îÓê,êìê9ìrîèñŠöVû|ÿ£ñ> w x ÏJI´Y ] iÈÿ­û9øi÷RùNüáþQÒm ˜†¥*ýÚødõNô¼ô•õMöšö.÷aøëùÂûcý†þh0Ñ\ ¿&m¢7)5î ß‹Aýdù=÷¨÷\úÎü§ýîýÿ«ÿÿýéûSúÚùyùÞøxø7ø^÷+ö õ&óÇð²îÉíÅîCñ„ô©øþ°` Pý‹^‚?‰ Ì^óãÿ»ýÉûàú2ûKûÅù9ø©÷q÷[÷Î÷Ïøú ýhÿJ.j ÿ!üVù|ö¾ò8ï‘îeð§óG÷*ûGÌ Hlá§žtqΈ ' ® N-·ÿ”üRù,÷üõõgö¦ø}û¢ý-ÿ¼û([ýúþ÷šõÛò{ñòºóõ÷úýñ±ñ ±   pŸËªm y ¼Gªýhùaõ(òðÁïØïqñ5ô…öøžù½ú·ûûûÇú¯øb÷üö öÇô;ô4ôô¥óšó˜ô<ö øú<ý!úŽÌ 䈋@À%É Ð…þû¬ø ÷tõþó‘ó%ôZõ¡ö*øáù—ûðüPý´ýçþmÿqþý?ý¿üêúCù5ùÊùcú ûßý½ ² Ûÿ]ç=l ˜ —ÿIûö÷rõÎóÜò®ò|óõ÷IùûÝü ÿaÎÿ0þÖüüÉúÙøo÷÷èöy÷°øúºû›ý¿ÿŒãÒ* þ œ¾¹z“ ÷ À ¿ýîøõwò ðï"îî=ð•ò2ôgõ&÷\ù6ûßûÑûbü¡ýþžý‚ýÞüªû¤úúøùlúæúBüoÿ¢»ç ï¤ý³ó ï TrÇÿÛü5û%ú}øäöGöbö\ö>ö-ö‚ö6ø9ûàý·ÍÌ}Œ¾€þðü:üÀûêûÄýÂGo ´ °¼Z4ËçÇ ² Ä XAJÐþ—ü‡ù˜õ>òÄïî}îLï™ðáòeö‘ú¾þ|ŒOŸPü úòùúàùGú,ü)ÿów.)14± Î 9 ï ’ T ÞiOþŠùLô)ï}ëlêŸëžíðóÅöÙú"þ¤ÿ‘ÿÿÛf6ûþHÿ£rJ§ûáyQF—ÿ_ ߊPõtf 9dýÉøÛôbòÑñÓò§ôÔõŠöKøôúýýýëýþ};¡p`!tbýÆ)ìÿ ÿ8ÿ¢ÿ䥹, ØPžì< Yñ‘ÿÔü@úä÷áõaôóÅòÈñuðï¥ï—ðÖñ«óªöûÿyŠZ¥»“~ýWý£ûâûèüþéÿ(b ^ W t  ŽŒB¥ìY‹ý—úø€õ“ò ðLîîÃï°ò0öpú÷þ|k$ ß ñ ò[D'gÿ´Ö¸Xº‡ . Ú ´  y Û ´ ™ } u  ?»ø ý¶øõØñ%ïéíiî;ðBóÅöýùÜüÑÿàqØ÷ôv{˜] =ª2ºÿÿãÿTß$ Î C ^_²þPùõBòÊïîyí¬íkî“ï$ñójõ ÷éù=üJþƒ91D 2 PñcìfÕþÿF‡ÎÑ‹õN u E ”@qÆÙÿ/ýrú£÷›õsôhóšò_ò ó‚ôöè÷òúáþjŸõu ­ Hâ ^ ƒ è³òß=J—t‰ÜmÚ¯¶¿þ\û‚øöió ñœïòîPïZð^òUõ;øûÿe2÷ ( ¹ S WÄùlb$ÿþýýÿ¥ÿ]ÿÛ= Zþ üù=÷mõnó¿ñ„ðÃï^ï­ïõðùòâô™öGù¹üa'‹ ˆ ³ f ? ßÚZïkW€„iƒØŠ¶ñ'—Aÿáý'ücúèø^÷4õ óúñò ó ô×õÂøªüm à 3»Â Š _ þÊ#ªœ Èÿßþfþøýþxþ ÿÿËÿ=BCÿ?ýÙú»øGöëòÂî ì ìí¡îàðô6øbüaÿK@3šnk1#ä‚‘!I»ý-û%ùé÷Ÿ÷Þø*ûûü?þ±ÿM¢ÊýûÒø;ö•òjïHîòîqð.ò\ôÖöŸùmü§þ/§tÏ à „ˆÕð Æ )¯ŠöýóûŽúÍúCý]/HoK{ýËû_ú–ø]÷?÷k÷˜÷Ü÷Õ÷ˆ÷æö2÷ùXûeý¯kÀ Ž!ä;q ùoìÂþný+üûú;ûüüþ_ýªüŠü'ü†ûpúù[øªø*ùBù9ùÓøé÷ØöŒõ+ô@òtðcð{òxõ£øçûA—ü Ì _ºÜ § – ­³—wËÅÿ,þŠý³ýÅüâúYù‚ø.øÐø=ú¶ûuý´þ‰ÿÇ&Tÿü(ú|ø×ö…ô"óóó`öpùýȸˆ• … ’& nŒm Ž “ ` gž×Ùÿ²ütúù-ø]øÚùJüÐþenˆÉÑ{ÿaü*úûø×÷rö-öðö$øú`ü6þ¶ÿ+í¥]< »  U_5 ö P ×þÆúž÷Þõúô—ôõÆöÎøgúŒûüZü—üNü8ûÄùÑø•øøP÷÷W÷Ð÷iøùú'ûNüÞý„ÔØž ™ \ãþ0Îx «¨Õÿ>ý=ûâù#ùø°øgùÔù;úëúüûˆýtþ¦þ=ÿmÖGøÿÇÿðþ“ýÈü¼üãüýüÃýªÿ‘øùu ?©›žO„ ² yõ—KþÓû¾ù—øè÷ˆ÷„÷7øùûDü ý\þÆÿ$ÿZÿÿîý^ü!û“ú¡úÞúûöüäþ䛸-; º D ‹ i Ä » £E’yÿ,üiùB÷[õßóAóÈóþôCö‰÷½øúºûýêýtþ ÿgÿKÿ*ÿàþgþwý~üEüü&ýþèÿ N £ ãú«Ì { ÊÅÈDÿ‹ý3ü™ú¼ø‚÷÷_÷,ø ùFúÿûëý³ÿ¯¿ÀýCëÿ©JÿÈþÙþÿžÿ\/ÌÆ\  Ü ÝÎü 7 ùRbœÿÝü½ù´öôKòÂñJòLó–ô˜ö¥ùÌüeÿùY$YzÿDýÏûºûü—üXý½þ|Gi)® õ©" µ [ ò ó Ø ?õ‹éüù]õ"òîïwïˆðOòôBö3ùü?þiÿ ÿÿÿþ«Vá ½ºË0 ÔZ¹ÕhRAO O îÂýé ¢]›ý£ùûöBõ¬ô€õýöè÷+øôøú?ü.ýqý†þ˜D[¡´<Y3 ù ßþuþóþÓÿFÛè @ \ ¹ Æ  æKaþäûÒùøuö#õ|ôÎóòƒñð\ð±ñ¨ó¿õ’øTüôÿËÙž/OóÕXþkü•ûóûWý¶þçÿ4pÑyšmÍÕiJ¦§n±þLü—ù÷·ô‘òÄð¥ïðôñ®ôø„ûúþu…šÙôl}/mY÷÷Ê:D8GöNpâˆ' R ǸC™ÿPûN÷ôjò—ð}ï"ð-òÂô÷\úÑüÁþÞ €~“H&َ׎G8ÿ,þïýÖþ6½osïî)ð<„üþ÷lôéñæï¥îcî·î¯ï-ñÅò“ô^öÙ÷aùEû ýõþYŒíú|O]'œÖÿRþèý–þÓÿ¿ÒµÈÞ´P (¹ÿtýnû7ù ÷jõGô‰ó+ó^ó'ôõùõº÷§úÛýŸ ® £ â  Ž>¶­ªúmŒ6 lY:ˆj¨‰S=ÿÐüúÒ÷öô÷ñÈðÊð2ñò¨ó:ö'ùôû¦þ4tCŠd¢4P`E÷QïÿVÿçþ2þ þ²þ>ÿÿH†I>[Tÿêý üóùø‹ööôNóGòÚñºñâñÏòhô+öZø>û¢þ¤ ƒ³Y  ; A žþ‡(¿*>¢9{-pŠánõ½Jœi2àþ,ý–ûú~øyöîôhô¦ôdõ·ö øOûÂþuåØ ³ × ò F ¤ VFÄ׫|tâÿnÿÿ|ÿ‰ûúè'BTxþKüøù‘÷ ô…ñúï6ðñ>ò6ô·öïùªý­°ré ÞäÕ%šÂCѹþûü¤ûšúÒúü‚ýÇþçÿhÍ{ÿ¶üºúdø~õkóýò[óô¨õ—÷˜ùöûUþ"•á²'• ~ é ï üJ K =8Ï8ÿÎýýý‚ÿkWáœ>ÿÂýdüûúŠù6ùQù²ùÀùFùùßù}û…ýªÿ5‘ y¿?þl› 1ÀòüÿuþTýüýRþFÿ"ÿ¤þWþþ|ý¤üöû÷ûYüeüXüAüœûyúMù)øýö­õô³ôjö¹øjûåþ)™/ $ ÷  C y -òcu©€Hñÿèÿ ÿùýÇüÝû¢ûGü7ýqþÚÿŠpHíþ¸üûHù?÷QöJ÷mùüÿƒUµ  „ qÀǵIƒ Œ ™ × ê ýe’Qþ©ü_ûíúGûwüWþ?ºÂ|›^ý[û%ú"ù@ø&øù»úhü´ýÿÀeì¹Pg«  9 à  V k |Ûþ‚ûùá÷;÷êö.÷¯ø¾úBüýEýŒý“ýÝü¨û˜úqújú§ùÞø ù¤ùåù&ú˜úEû;ü‘ý=ÿ°`]Lÿ i ˜Ø%­ … ”OÎmÿ÷ü†ûèú/úãùAúöú¥ûü\üCýþpþàþ’ÿM‰òÿRÿ ÿ]þfýÀü›üªü@ýDþåÿŒZ¾U Î |N(eV - ª ˜;½=Kÿ=ýQûèùùBøø÷køù úêúÿû2ýSþðþ&ÿ*ÿÒþYþýgû¢úqútú°ú8û€ü\þýÿn} ­¹* 3 ¯ W ¡ê†ÈÜýû«øÐö‹õòôÃôõêõÁö÷°ø:úüsý²ýý1þYþÒý×ýðýnýü·ûƒûJüîü¥ýfÿ¸à !   ž  É#¦@åýnüdûÅùiøÙ÷—÷É÷Røùiúñû+ýèþÚ$³ÛnñTÿšþMþþDþòþ)î\ w – R Z œ ~ edAÜ¡ÐÿxýDûÉøBöIôóŠòâòðóWõ÷Uù¬ûÂýÊþ ÿ6ÿLÿ¹þ%ýŒûîúûoû²ûSü ýEÿRý»v®æxÜ#…«l 2þCû9øõ`òâðÄð²ñó¤ôÙöKùzûýŸýýþOÿ±ÿ.ÿþþkÿÃC™«,‘tÆ|ݰk ì € ö . ÛyÝ™þBû;øLö õ¯õ7öìö÷s÷ŽøÂùÑú°ûwüýÔþ3žøÙS;§‰p&þýmý5þ ÿB€‡  0 { z‘ëþóüEû·ù8ø•ö‰õíôáóðòLòÊñ/òmóõÛö;ùüÖþjhG±œ“Üÿý™ûû÷û1ýmþBˆ¿$m]«TgMA'SÿûýÇû¨ù»÷‹õ‰óÉñ½ðfñvóIöIù,üNÿ={þh¾ò„®HµG1}!åãOwÅw‘2îð{L%ÿUû.øö(ô‘òëñÍòÛô7÷€ùÂûÇýaÿ K¹Ót Ó±§Ç°sl”…ÿÎþòþîÿ@š ÝÓ—äºîüyù¼ö‚ô¼ò³ññ)òCó¨ô+ö«÷÷ø3úßûxýÐþx¤q‘C†K¶“'µtÜÿäÿŽ­‚»_¢AZþ·Êþ#ýkûÔù øŸ÷÷‚öxöüö¡÷ÎøÕú[ýåÿLäØ < 7 Û . åwJGƒc¾»„èõ Ù#$?1ŽSþü!ú”øËöþôòóàó=ô,õ$÷«ù6üyþ¿žÊKú…˵Ⱥ¶ô2Jµÿéÿ}¦½¤ügÙQ©¡ÿôý ü®ú*ùe÷XöÅõ&õíô˜õ÷œøÑù±ûQþéM“) # ¿ ¿ è r=XœvA®ûг¼Ò8ØFv/ì®ÿlþ$ýü¿úiù3ø{÷Š÷tø¦ùGû½ýÒ%êçà W  Ò ü ¶ ˜ 9¯0N¾üU.½o²BÉÿýE5 ÿ%ýWûù„ö‹ôçóçóTôPõäöqù“üAÿ_•Mym¢P=(>À•âUZÿðý½üçûüEýŠþ½ÿýœr_CÿGýãûãùZ÷§õõ3õ,öá÷‰ù\ûhý…ÿP¢£#êp Î »   R ‹ C³DJµÿXþçý¯þ2ö­#ÅM+è$iÿþ°üÉûUûÜúú‹ú›ú‚úDúZú=ûËüuþùÛ¼ ~ ‚ ü ˜ õ … yreÿ\þ’ýþü6ý4þçþŽþþàýrýùü2ü‰û—ûäû´û™û¨ûûú0ù?ø÷§õÐôgõ*÷Tù±û¦þ5Ñ—8 Í ™ & 7 bŒYŽÐòÿÙþuþNþ|ýküÚûZûÿúBû ü5ý^þMÿ2™ÿ>ý6ûÜùoøØö¬öê÷êù ü@þ+uF= p ð  V T , ˜ › °áÇkçþûüxû£ú–úÀú‹û&ýáþ  EˆBþüûú±ùäø:øzøjù±úüYýñþ+ °Ô§á¢ { Ý!%0ý~úyøž÷€÷Q÷J÷0øòùlûüü üDü¿û”ú’ùmùqù?ùù!ù9ùuùÓùcúÏú6ûEüðý `†„€X u Q D ä þ2ü¿úêùªùšùìùúû.û[ûòû»üuý®ýþÃþÜþ9þÊý­ý-ýXüÓû½ûâûyüžý/ÿ s¡„q ä R ) Ó  Ø#WgRlÿÈý#ü¶ú°ùø¢÷^÷û÷ÐøPùú&û üýËýÚý§ý‚ý÷ü²ûsú—ùù ùêùû üaýäþ„Iåk‰ˆ@1.èÑÇ\þ6ü%úRø÷Lö²õZõ¶õ<öíöâ÷èøú€ûüÈüñüŽýÉýOýÁü®ü¯ü#ü¾ûàûŽüRýTþÇÿ¿Ö Iîy  Ö èp9êêöþ5ýü,û1úù|ø®øøøJùÀùÚú`ü©ýËþQrÇÜ»5˜þõýþþJþúþV!äC®;/ ˜  µ ·-“ñRÿÙýü-ú&øRöìôNôºôÐõ-÷9ùûÎü„þŸÿ¤ÿ^ÿQÿÔþÄýÄüIü]üü¸üPýqþØÿþ“H.ÏŽ®º:Q¼¾®·þ~üîù ÷³ô óÉó³ôÜõ†÷ŸùÑûªýÇþ,ÿJÿ¡ÿ00êÿFàˆÖlB z+GØš è ~ ( w ° ¥¤O8ÿ üúùqøføùø‡ùíùúkûiü9ýÑý3þ-ÿ¸ý!NþàsR²?ÿvÿEº{ ^ Ç ™ ßMÊO'þ·ü¶ûuú8ùOøŽ÷Íö?öÞõ¿õCöS÷†ø úüiþÒòT²xÛÙÿàýÙýÎþâÿ¤’z¬ r”YÊü/{Íó„ÿ¹ý ü”ú ùc÷êõõèõ¯÷ŒùéûÔþ›à†«`ºóÓÿkë$£«áÈÙØDîf¯m§ÍEó<ýÝúèø(÷'öWö÷‘ø„ú`üWþòÿ¨k4æ$—ê^iMÇ¿Ù/a»ÇvCÜu5 yßôýûóøL÷óõeõUõ¼õÚö)ø8ù úòúüƒý0ÿÇ[Í ²Þ¬Ûž{†²!ôl2ý&•ÅkA|½¢ÕÍJÿöýfüûú§ùù]ø;ø´øÔùû¢ü¿þ K?A ò ™ ‹;g¾Õ/#v¿Û'ÞrDfH±«‘âÈ®þ”üûKù}÷,ö»õñõ†öy÷äøæúüüÿY7q˜z› ²U`[ˆûxóÿ°ÿ©ÿÜÿR«Ä“1Æÿÿþýšû{ú%ù¹÷˜öÛõtõ‚õ.öW÷wøÆùsû—ýòÿâÕ¤äýµgxw8 — ¹"K˜Ç*Ù ]{ªÿÀþVý2ü.ûßù³øí÷ø›ø1ùùù„ûžý’ ,Çâ \ ܤ½¿}=!3ÛLåÿ¿ÿ¨ÿ°ÿ¹ÿÌÿ(/7Rÿ®ýü–úžø:ö^ô¥ó ôúô+ö¶÷ÚùBüþ˜ 90Èý&+Û¯Q'üþÁÿVþý.üÓûèû‘ü·ý‘þ6ÿRitþcüØúù7÷ßõ›õ.ö)÷@ø¹ùˆûyýÿ0 ]"á/ßI ” }  z€Ž¸ÿ8þ"ýÍü¥ýÿÅSqÇìþ”ýÏüíûîú&ú¸ù­ùÌùæù×ùÕùÙù’úìûLý‡þ˜aô R â  q ×¹Pü0ÿþ<ý%üqûñû&ýyýPýký&ý™üùû/û“úÁúûüúåúÉúGú—ù±ø«÷ÁöÞõGõßõs÷–ù®ûþ2d«œ.) j¾‚¶ÿÿZþ ýý ýÚüÝûûúÏúšû„ü~ýNþºþEÿùÿ¦ÿZþ¤üûäùuøq÷M÷SøBúhü—þÂF£J†Ä # }»TŸç6˜x‘ÿÃý5üXû°ú†úû7üÀýòþÔÿŽÜƒfÿÃý8üû3ú2ùoø™ø©ùüúOüxý»þòÿäá ãÎ  ²:ú]E½ÿý´úQùäøÆø½øCùaú`ûUüñüEýrýSý„ü_ûêú¹ú<úñùIú¸úÈúÛúûzû ü½üìýaÿú³Œ„[Û w  > ‚zkh}þ¾üàû™ûhû’ûñûTü™üËüý¡ýþÕþìþŽÿÔÿaÿjÿpÿ¹þ¥ýýïübý8þOÿÒµye- …   S : ëŠcï @Ôþ¹ý¤üeû{úúú˜ú_û6üÏü_ýþóþ^ÿHÿHÿ}ÿÉþcý=üÛûýûúû üÎü@þ²ÿ…îöÛòÿmHŒ{IóEcvþ“üëú´ùÛøLøCø‹øKù úÏú¡û©üéý¨þñþAÿÑÿôÿ†ÿÿòþ˜þUþþ6þÏþ;ÿ±ÿ ¹)     Q ñþòmhÿ[þ5ýüdûûû†ûü¹üoý‰þ¡ÿžÓ¯,a+Qö¹ÿ°ÿ¾ÿ¬ÿMèÖR~±Ó› ® T Ò*dgõK¶Jÿ×ýüëùcø¾÷¤÷â÷ŽøÜù®ûrýïþDþæø:ŽÿþËýðý þ3þ¼þòÿsjò{L؆fÙðÛÃ}äúÓÿ¹ýPûÜø÷cöö|÷ÃøúÃû…ýÿ!%ì)» j–»Ðý?v=™Z¢m û ^ : Õ±p ‹ÿDýoûú]ù’ùHú¾úFû0ü ý¸ýþ„þ-ÿ06ò«-@~W0>¨ÿÃÿq5ó´´/l]ôÃÞÿþ˜ü~ûªúýù‰ùàøð÷÷œö§ö>÷Qødù×úÈüÓþÓ•vEÀnŽÍþãýÀý4þîþÞÿ1'ò»ˆG¹K‘ÀA£ûÿ—þéüZûú©øóöèõäõ—öä÷ùùNü”þÜ·þt^÷‘˜—‚(°;Ñ宩ã]™¶¶/š> Ø!þŸû‰ù¸÷zö'ö•öm÷µødú ü‚ýÿ­Á´ÒЬ™þVE÷uw ƒÿ ÿ%ÿ×ÿ¨¼U•èªú°óÌþIü&ú•øO÷@öÐõãõöœöÏ÷/ùúÙúÂû ý;þ<ÿ #á|}üg”¤­ÅÿêþðþÌÿÒl%Zpå˜êDtÌãþzý;üÝúÚùeùù”ø.øeøöømù1ú’û0ýáþÅ‘#Ó/VL•Æ ‹ôËKÕß6hÄFáÕÂÿ7ÿ×ýüèúùø÷)ö‹õ·õ8öÜö\øúÆû¯ýdÿõþW¹ƒ2úy¥)`ÿ±þþÜýþ(þþªþzÿÿÿQ ¹ÿ)ÿ[þTýµûJúFùø÷cöÒõ¡õïõ–öˆ÷Íø!úšû<ýðþº=i¿Ã·é÷¹ÈOiÿÿ»ÿ?/Ñý0âªl´çÿwÿùþ‰ýüYû`ú8ùmøø&øÃøDùÃùðúý%ÿNsj³’›g6™çÉŸ]9³ÿVÿWÿ5ÿÿÿíþÿfÿcÿÄÿY Ûþrýü¨úãø÷ïõÀõ ö‡öX÷¦ø“úéüÿÂ" ¯ú¶¹ýI7+ÙâLwÿ˜þÄý ý”üÏüý0þÎþåÿ…׃ÿþÚü•û ú•ø˜÷3÷‹÷˜øßùXûEýâþøÿ³í¨~òÜ‹ ] ; nÔkÛ€`ÿ^þ þÎþM)˜XsœÁÿ´þMýWü·û[û»û>ü^ü-üpüãüNýþÿqqxvpª ý . Ì 8úÓ ÎÃÿÑþuþ‹þÅþAÿ¦ÿOÿÿÆþqþþSýÏüýSýýîüáübüÚûpûÞúú,ùÔøSù«úpüZþ†ôkáv<a_XêˆÂ{+nýÿýÿ‘ÿ|þºýMýåüÚüGýöýÿ®ÿNLÓ8†ÿäýÄüÊû°úçù<ú’ûOýÑþËÁ4\Š Ùï ²ëwàé‹JÆÿªþÅýýöü²ý#ÿ%·T×àè`ÿBþ‹ý±üåû‚ûëûÐüÕýóþðÿùù¤`b0Æì'±Ó”çá5)-&ÿSý3ü±û‡û”ûÍûoü­ý—þÍþÿ2ÿýþ¥þÀýüüÕüÇü„ü…üßü\ýtý½ý_þ·þÿéÿhÉ@×gŇ ¿ ¤ J FˆÍÊáRÿþkþ þý”ýðý!þ#þBþ­þbÿÆÿÅÿòÿYÆ  ØIFÿþˆþÆþAÿ ßúH¦;§ë U Ë " INCö{£®ÿËþ‹ý?ü‡û;ûjûüýü˜ýûýpþBÿ Ïÿ¶ÿjÿÅþ þý0ýìü ýŒýPþ}ÿ±=÷Bn8é^&§Ø“ø6›ÿRþýÚûÂú ú`ù!ù¤ùyú%ûËûoü9ýþSþŽþbÿÔÿ¥ÿVÿCÿñþFþºýÒýŽþÿþÿ½ÿ¶3„î=äõË µV!Á›ÿ™þÆýíü ü|û„ûû¤ûÿû‡üLýTþ>ÿ¢Ú0D¦½rÿ'ÿýþâþ³ÿKË÷ñ ¾áŒè1QI§_ÿüýpü&ûúæø øð÷[øù‚úüfý–þEÿaÿ}ÿÑÿgÿ‘þþ½ý·ýÔýþýRþGÿ_'~è‰ü(ä@ZGtJ×,þ¤üuúxøÚööyö—÷ùú#ü“ý¿þMÿwÿ~ÿàÿ Àÿ>ÿxÿ1ßt¹¶wMð6¶¬üF+¢ ²¾¹ð¦ëÿtý¢ûLú†ùjùùåùFú×ú¥ûUüÝüý²ýÊý±þ¶ÿNöù‰N_öÿÿÎþšþ‚þçþ¿ÿÍ—ñfveöÒáÿéý˜üYûUú¸ùüøCøø÷Á÷d÷ ÷÷v÷ øÉøú´û˜ý¯ÿ1®¨,S@ÿ"þäü4üzü!ý÷ýðþ#®ÞÿIAë"X«Nÿ•þþëü¼ûZúéøÅ÷´öìõ.öC÷»ø‚ú(ü¾ý•ÿÅ(sM¿ÿÆÿ »‚ËÄš¯¹åZÝ=;”ºòê…ÿ`ýÙú±ø~÷ùöÏö1÷)ø–ùûúóû)ýzþkÿ‚?í ,­žùAÀÿyÿ3ÿKÿ“ÿÃÿÔüè.íõvþ†ûù;ø…÷5÷æöÏöa÷'øÁø‰ù¦úºûãü÷ýÉþˆÿ‡o8åÔ’êÍÿ.ÿ"ÿ›ÿP»wu*CÌTâÜOÿcþ\ý'ü!ûJú‘ùQùyù¿ù:úû$üýÿ”*}˜C¸É`ëH‘í@”S’z(›eÖµ*DÚ3«Bÿ¨ý€üXûþùüø;øà÷øÀøØùøúü§ýoÿõ-/ó“›vOóeªêd°ÿJÿOÿ»ÿ?v‡ÙJ?ÏžeÔÿÌþvýQü¥ûöúú0ùØøûø@ù¼ù™úlû!übý;ÿø9i¶ÂM[üq³é‹,' ã4…×N¥x%ñ§ôOÛ< ÿýýNývüÑû\ûËúÖúlûõûÂü"þôÿ¥ˆY—}"s/c¢ÏÔËÏSfweGGJc^“ºÇΞìäÿíþþý‡ûïùãø¦øëø`ùtúöû°ý_ÿ¶Ö~­©”\'ÑOÒIAáæÿ8ÿ«þOþ¼þˆÿ ·™‹«M+ŒÿGþJýBü×ú"úHú¢ú,ûþû ý¾þ/M,ÛÀ¥mûI  }Ê8_J ÿåÿ¥c¾ÖmÆ•l¸ÿ/ÿDþ˜ý8ý0ýNý]ýbýˆýˆýœý8þ*ÿ(+ow' @ ò\F¬; M”ÿ%ÿúþUÿØÿóÿÑÿ¦ÿVÿÞþpþþâýðýþDþ1þýúü‹üSüÂûòúSúñùZúºû?ýêþÕ!”)|cNžréî\:÷dêÿ¬ÿEÿ·þ-þ¶ýfý”ýâýzþJÿ½ÿ"ÔóB ÿþMý„üÒûû(û-ü‘ýîþއKÀÓLpUâÀ«od5¤ÔÿÂþþxýý%ý£ýxþ5ÿëÿ¡öãƒÉÿ¤þ«ýý>ü@ûû_û3übýyþ>ÿÇÿO ݧXé »¥_sçäéþZýLüpûôúáúïú]û`üSýÂý þeþ!þýþülü üÉûºû·ûÎû ü*ü!ü<ü•üIýèýþÑÿCrì›]ù17Ì>Ë5ÿƒý½üµü˜üoüÌü:ý-ý#ý€ý¾ýþ˜þàþsÿÛÿ¸ÿcÿ6ÿÀþâýEý5ý…ýþý¹þÉÿGTFXkVEÌЉa‹„R0ÿ!þéüáûJûûÖúûhûyûñû½ümý)þæþíþoþþþcý|üüåûÒûÒû÷û“ü€ý¾þÎÿºˆ"ƆHäèíñ« ÿÐý¦üsûbúmù­øSørøæø­ùlúâúlû(üýxýzýžýÇý”ýZýeý7ýýàüÒü3ý±ý+þ¤þ~ÿ³ÙúÅäÛ¼VÿþYý©üÄûîúÈú‚ú-úZúû’ûQüGý>þÿƒÿ´ÿëÿ7f#$ÿdþ8þûýý ýPþ¯ÿ4]+ ëq½þ„ó¾Cÿ1þ?ýÖûƒú]ùªøø|ø²øwùwú‘ûûüþåþ,ÿóþÚþÓþ$þfýBýyý£ý¸ý×ýÕý—þ›ÿ,µJÍK¿5•ÍÛÊzŒ-ŠÿÝý(üqúèøº÷U÷Õ÷ëøú ûüpýrþýþ!ÿ8ÿ}ÿYÿÿ_ÿÜÿ?ºß¼×òÈÑ'„Ms›—E·å@\Àÿ%þ¾ü¥ûãúHú*úßúËûuüÆüöü—ý,þ\þ þ‘ÿ²1›`=_ÊîN‰ÿÿÿŸÿ¤—®""u](à‡›:ÿþ’ýhücûÞúÃúCúù ùÐøöøWù%údûÝüvþóÿþœÙº¯<FÿÝþÀþËþõþxÿFzäñaR@9¡Â;ÕOæ ÿ‘ýüÜúúŽùù.ùú û‘ü•þ‚  <CÛ¼¡E ýö0—ï[Ý  oã%À—9³À ÿHýÝû†úWùù¨ùÕúüeý˜þ™ÿy8œã&UÜ110]N/ÐE²7úö"|üõµÚ®3 ~ÓÿöýlüfûiúÄùÖùTúÑú;ûäûgüÝüÃýÎþâÿhO?qv\¶¸,nýžS¡@þl&ž»'Ô”¤ÿ¥þÇýïüüüvü+ü±ûwüÉýxþ'ÿ_ÐÓ4$ÈXáüC‰®¥ ÈU˜ðæµÅìÆñ'æVáÿhþ×ýbýOü%ûÉúÉúŒúœú<û?üÂýÿ öà î¥òº6Ø5þ¬=ŽìŸ¶¢%¨aˆÿÑþ2þ¥ý¬ü‡ûÛú‘ú(ú#úéú›ûöûYüBýœþOYVi:©œsýã„5ÛYéÝeQoÔÏ›KÚ”äÿ°þþäýMý#üNûiû3ü}ücüêüzþ8fƶ:~`™-@ÔŸÙè“bùªj#$ ²ÿ÷ÿ~ƒ/ +¸ÿÿaþ¹ý¬üûžùÃø½øhùNú[û%üý¢þ#D]÷Jz{-áÕéX¶lËÿ¦þÙýéüËü½ýçþ´ÿúÿUµÁDlÿZþ;ý‹üŒû ú^ù»ù@úëúœûµüÙýêþŽ8K­ -|ud§~™iaÿÔþ{þÏþÅÿkÀVÇ‚£„ÿêþŽþÆýçüKü,ü üüœü ýýÐüý¹ý‚þhÿ„ÑF‰kòSpØ‘ø‚ÿÛþŠþçýZýsýþžþpþþþàý‘ý ýüŒüÏü¤ü«üý—üºû@û÷ú•úãù&ùEù0ú+ûjüíý•ÿyO3]IצëÿÍÿSÿ¯þ°þÁþ]þÖý@ý¤üüüOü†üý#þ!ÿ@ÿïþ¸þ\þ—ýwü§ûæúCúíù7úûüþ]ÿà{rþ`z©ºo$»LQäiqÿ‹þœýÔüKüDümü¢ü$ýúýÉþ0ÿ…ÿ²ÿ3ÿ!þéüXü<ü\ûŽúÖú›ûü¼üxýåýÊþÙÿdÇu$»€5¢Ï€ok$VÿÒý¯üRûyúúÙúû^ûmü‡ýãýþýþõýUýNüåûëûÜûãûü=ü üSü±üåüý)ýÀý–þ°ÿ$@ÿêóšÒ‚´¤{’^Ïþßý}ýýÏü ý+ýóüöüJýxýêýþÿÿþÿ&ÿWÿˆÿbÿuÿKÿ¢þïý«ýÔý9þÒþØÿÉ—±ó«U¯(:ENöÿÿ¶þ#þ?ý©üTüôûÚûhü+ý‘ýþýþéþ;ÿOÿúþ ÿ0ÿ¸þþ…ýVýgýlý•ýwþ]ÿ½ÿƒz9 ­\ ,L<8^ÿàý‰üÜûtû­ú\úôúœûJüÚüaýüý¢þ¿þ¹þ@ÿ‰ÿ_ÿsÿSÿìþÿÿkþiþ¹þ€þÍþ …àþ¾‚f»‚ÈèèÃ4ÿ<þ¦ýýÊüôü]ýsý–ýÉýìý§þaÿÐÿ¬ÓÈ×Ï*'Ýÿòÿˆÿ0ÿxÿCÃÓk+#ì‰øì#Ë$Ñ‘ÿ­þwýBü¦ûCû»úûû*ü ýêýÍþØÿ“ÏAjäíÿ)ÿŠþƒþ(ÿvÿ­ÿU8À|Âú÷i"‘xÙp4.ÿÿSý`ü`ûoú•úwû üüHýrþ©ÿYž³`I?˜"td—‘PŸOç§mïQBNšÜ^—ÿþŽý_ýÚüÈüaý£ýŸýþÿ®ÿóÿ2°EÈl¤ïwÊÔô€ìqŒóu‡ã=ÔHBÿ™þ+þ^ý‡ütü]ü»ûZû‘û¡ûŽûäûªüÊý}ÿ#Õ_c÷AC&vÿlÿjÿ•ÿ(^mþð²ÈÛdâ®SÓ èÿöþ[þ`ýüZû±ú`úúpû¸üêýÿC¨é¿´3¸ç~ƒ‰À…Mæ‘k#R»®© â':‰ÿCþPý1üÁúïùúŽúEû[ü-ýþMÿm5 rVÅf¶`ÓÜõ¹s—ñÿÞÿÙ‡ôdüý„/&iþÜü®ûÄúfúú²ùNúÓú¿ú-ûKüý‚ý3þßþ|ÿ´v}ä¦a»ò<‰ÿÿX":4v%Ÿ×³)Þv2Íþ þKý…ü,üÉûLûõú ûPûœûüÍýÙþõÿðm;Yõ}b•=!|%ÊÌS°ž¹W·xÏäºU¬’ÿ%þFý¥üÇûÖúKúKúOú5ú@úRû®ü¾ý×þçÿ š/§×ʼnû)^áÿqÿjÿ;ÿ¾þÿˆÿ`ÿÿ<ÿvÿ¡ÿ°ÿ¤ÿ•ÿDÿOþJýÇü[ü‹ûŸúùùœùù¨ùìùúûzûýûý´þÞh5KË56sˆÿÿÿ¢ÿåÿ¡ÿ©g/¹I×ÿtÿÔþAþ–ýþü¨üüEûÓúú{ú‰úÂú®ûýþH±VÞF- ²Æ.öÿwÿ~ÿÿÝþHþŠþÇþ±þÇþôþMÿ’ÿoÿ5ÿ-ÿ…þCýaüõûûàùÐø/øføìøDùúRûÈüþ¢ÿ¥îMä Ö˜Íã¯2‹üÿYÿßþ{þþýTýý ý3ýšý<þ¿þAÿ¹ÿÌÿnÿÐþéýýüªúùŸùú{ú<ûõûaüoýnþÿîÿ²[€…ø¡ÿÆ…‚üû çØÿÞþ!þÎýHþ"ÿ¼ÿGÝ]V „Ûÿ?ÿèþDþ+ýŒübüZü‡üýoýmýUýŒýþHþÿ &£}³Ú¾êÄ“"Fëÿ`ÿ‡þ#þkþÏþÛþ¾þÌþÿ/ÿÊþþúý(þÏý©ýÚýþÙýcý×ü~üÔû8ûôúûàû!ý”þíÿcÕ½tÛšWm{¤hgÀÿ}ÿPÿDÿ=ÿ™þÓý¥ýÈý,þíþ]ÿÍÿ;]YøÿÿþŒýýnü7ü üTý-þQÿêj{•Biv<É< Þ‚éà¶sÿþ?þ þÛýÌýþ×þÎÿ8Õ p•ÿòþ’þþ=ý›üƒüûüÌý þÿºw·ì<Ñ6ÌOäS¤"¯þˆýìüÍü&ýˆý þ“þÏþ¤þÎþ;ÿ\ÿ ÿ­þ„þ‘þöýKýˆý;þŽþ_þJþzþÛþXÿæÿ¸°¤ž¯’_ëâ|IJ°Ôªq“ÿVÿ%ÿ¥þtþÖþ7ÿeÿÁÿÁÿîÿÿÿòÿ?È6p%Ø£ÓÿoÿÚÿYžá\ClŸ†-œØ·[Ôd÷«Üt›ÿÐþÝþ¹þBþõýrþÿÿ1ÿßÿ™r‰€'’ÿ1ÿTÿtÿ#ÿÿþ^ÿîÿµ~}¥xãþï­‚Ab[dj3ÿ>þæý_ýöü×üÒü×üý¡ýXþßþ=ÿ{ÿ¼ÿ‚l0 ¤ÿ/ÿáþçþlÿJëÑ ýf8ñi¡">\€z‚¹.–ÿÿŒþÜý>ý+ý\ý¡ýìýXþðþÃÿ°^£ÔÒ£„'“øÿóÿþÿÉ¥-Æ—S‡zV©¬C²ÉÿŸþŒýðüFü‡ûpû‚ûÉûeü(ýûýÂþ’ÿ^šnw-Uÿ©þ¥þzþ\þžþóþkÿ¬2„èU[iÛhŽMò0ÔˆÿœþMýÇû‹ú1ú=úiúõúÜûåü þ:ÿÁÿ¸ÿWÿLÿÈÿúÿëÿ>z„òL*èÂ¥ÏI“ôj£ÎÎ[Q(énÿ1þ4ýzüüü‚ü¶ü¹üöüeýþ…þ‡þ}þÿÍÿOè°é; ½9tÿöþ|ÿ÷ÿóÿaw`ªÔø™¢äê¼ÿÙþþ1ýFüãûËû®ûVûûƒú.ú‡úûqûûûýHþvÿ‰n…;ùTeÿ—þ0þbþÍþ ÿÿŒÿž’îK§^§1‹Èÿ ÿšþ5þˆýýdü†û¤úØùjùÇùÖúæûý7þKÿ0ðm‚IÜxÿƒÿÆÿNÂK›´s%6fjy¡ŠKî•ÿAþÃü¾ûû6úæùáù úú£û©ü^ýðý¡þuÿãÿ+=O8,½A¹ÿ¹ÿŸÿñþ…þÖþ!ÿSÿ³ÿ-Ë[uÿþmýüÝúxúTúèùÜù7ú$úDúûúÅûPü¥ü7ýúý—þVÿ!Žé}6ìyõÿ?ÿaþWþëþbÿ»ÿL\L€-›’Òÿ0ÿƒþrý™ücü"ü«û%û ûvûü|üýüvýâý)ÿsMšànûþÙ¦þFö– ‚À®Ó'%Ej ¥VçÿFÿ þŒýRü±ûû»úÇúËú×ú9û´ûfü„ýéþ•å{Ò7°†É ¬o='òÿ‘ÿQÿ˜ÿºÿ‘ÿõÿ‘¬nŽÿPÿ0ÿ«þþªýýrüÚûhûDûKûzû¨û¶ûüÝü¹ýâþ ÂdBîOu€xFI®×za•IG`q[DYgÔc¡ÿÿÇþþhýý±ü„ü’ü²üØüý©ý¹þøÿYrQü¦ì ¾ˆ/¾8bŸt\%?GË€4_Z*Úÿsÿ ÿiþ†ý=üPûúú ûQûÍû–üµýîþøÿ÷³} 5ý»ØïyÌ6ê}®ÿ5ÿLÿÿ>ÿ²ÿ¹ÿÉÿi5²ªÐÿéþ…þ»ýÎüSü8ü>üžü0ýÞý¹þ³ÿ†˜U9Þ<šjÙ¹–l›µÕƒyýÿˆî)| ®‰ƒº‘R´ÿíþ¼þÿþÒþ¦þÔþÿþþàþÿ´ÿ]2.áɹ[—6H?-Fpÿ•ÿ.›¯µuýÿ³ÿŒÿxÿ·ÿ¾ÿ‡ÿ`ÿ;ÿ#ÿÞþzþHþþ“ý ýý‰ýrþ]ÿ9Å”ØX 5SD¼ZŒc¼ÝiÊÿ‘ÿ‡ÿ…ÿ©ÿðÿy»Cø:¯ÿÿ2þNýÇü9ý#þ¿þ&ÿ6´/Sö!11"ûç™3 ß.P¥é_ÿÿÑþ“þœþ>ÿ¦(1(‰ÿÌþ®þhþÌý‘ý·ý þþ:ÿÙÿM³$•# üià7¡Ÿ#{ÀË4ÿþjý<ýeý‹ý‹ýùý„þðþ+ÿNÿFÿÿþþ¡ý­ýÜýþ3þôý§ý¿ýþLþºþ!ÿ¦ÿrvtA¤÷ëglo¹ñ mÿÿþ¨þoþ8þFþnþZþIþjþÞþMÿÿªÿîÿÒÿgÿGÿSÿ€ÿ„ÿƒÿYÿÿßþ±þÝþ|ÿ“]tn3Æï»`sÕHÀ,rÌÿûþþšýBýýüü,ýªýýý(þdþŒþÝþ!ÿÿ ÿÿªþ)þæýþbþ!þ1þƒþ¾þÿ¸ÿb¦[Õü÷À?Òx×ðÿÔþÙýZýåüEüÆûíûZüiücü›ü4ýæýQþkþDþ€þÿ@ÿPÿUÿ"ÿþnþFþ3þRþ”þÿÎÿ†N¶: •´Ì¼˜CƒTÿeþÈý]ýØü\üIüküƒü üÙü,ýˆýþäþÖÿ D{ÿêþ§þfþùý þpþ.ÿÞÿ%âj„t’’JÄ\õjôÿcÿ¯þÂýšütûŽúúMú°úÛúqûkü ýyýþŒþ£þ¾þëþ¸þþ‡ý_ýˆý›ýÉýEþéþKÿxÿ¿ÿ6¡¢Á/feos÷ÿüýñüëû÷úWúúúBú„úû$üSý.þºþÖþ¯þÃþNÿbÿùþäþ€ÿ ÿÿÌÿ¦ÿ¯ÿÊÿâÿ/–Z̵Pƒlî)ÔÿáþÒý¿üùû±ûÄûü8ütüþü¢ýöýþþFþÍþ¨ÿqÌëÎÝ×N¢ÿ`ÿ2ÿòþ ÿPÿ•ÿ6Òßïסæ×êÿ:ÿþÑý$ý‹üäû»ûÀû‘û)ûÔúû:û“û2üÔüÅýúþðÿØ>jKÿYjÿžþþþ\þ÷þœÿO¤¨ÃÞ¤]Ù’ ÿÿ„þþ\ýxüûÈú¹úYû9ü$ý"þêþ¦ÿ¾¹éņãZy‚Ð:7 "KÒ%ä] \ÿþöýýõüü¥û’ûìû”ü{ýzþ*ÿŒÿAf–Úkͳ³•V¸?çÿÛÿÞÿz#Éκ…¥WÿúýýsüüÃû¥ûÙû ü5ü´ü_ýþÓþeÿÛÿã¶ÿfìºF£Ù& %MX¡`)Í,Ì7Äx{Æÿ ÿNþ ýXýzý†ý¤ýÍýþ‡þ.ÿúÿì çMm´ ÎbŒ$ "+UeH\¯Ç­ªŒRG=®X„ÿÁþþoýýúüý,ý‰ýIþ ÿ¾ÿf¿Ò'‚$¦‘Ž]ò‘S.A–ÓºŸÖíMÿìþHþâýýCý(ý@ýTýÑýŸþÿlÿïÝý´qe@¨5*ê¼|—§4·®¡I3©Ínoêÿ¤ÿVÿêþKþ¹ýÆý.þsþþ5ÿ!®rÕã^£‘yúƒüp\"ÅyÇRм®“­×é æ»\±ÿ#ÿjþÅýfýÈü-ü$ütü¼ü>ýQþÿ3üâ˜Ù¡‚—ŽY%íÉ·@‰àÿ2ÿÏþ˜þ§þÿÏÿFF(v•Gýÿ®ÿÎþ“ýšü2ü€üý;ý¨ýþ£þfÿìÿ2ÖÕ8eÎpS£½•ÒYÓÿ6ÿðþ5ÿ•ÿ€™ ƒÿIÿßþ`þ2þ)þ×ý°ý!þHþ þñý/þ„þêþtÿ*þͧvÑ n^Î×ÿ2ÿ¶þuþ¡þÿqÿ€ÿ(ÿÃþƒþ­þ¯þ¢þþLþ*þ"þ4þþþTþ6þpý´ü4üüü™ü¬ý´þ”ÿ‡¼¨·÷H®.`ûÚ„/±ÿÿðþÿ‰þïýþaþDþüýþnþÖþUÿ¸ÿäÿ ÅÿÅþÌý)ýügüªü6ýáý¦þ,ÿâÿðé{~aS„Zj2óm˜ØÿAÿœþåýeýDýaý²ýFþ¬þÀþûþHÿiÿdÿ\ÿëþ þýUý»üjüŒüõü‰ýáýeþÿ]ÿ>ÿqÿ+n^( ÙW´¼ÿ‹þ†ýâüšü„üAüwü0ýuýRýpý˜ýªýnýWýQýýØüýý¼üQüZü¿üüü(ýŽýïýþgþþþ‡ÿúÿ‡E[ûê¶çÕ%ÿ^þàýýzý}ýgýYýpý’ýÂýÉýºý×ý!þþþ™þÖþ_þþCþ^þUþþúý9þ}þ„þÆþ”ÿN®áD¬)eYÜñŒD´ÿÿÊþ+þtýçüÉüÓüÍüçü&ýˆýçý\þÓþMÿ€ÿñþ:þWþVþéýàýþÀýcýºýƒþÿÿÄÿoÒW»AX;é} ³úÿ+ÿvþ£ýàüü£üÀüËüúüHý_ýLýSýãývþþ¦þÄþ ÿ ÿ·þ¼þ»þ˜þÍþÿâþ¾þ´þ÷þÌÿê]’µôöàé힨ŽÁÿOÿÇþþfþðýýˆý°ý×ýìýBþ¢þ ÿxÿçÿ;aµ­+¿ÿ[ÿÿAÿ€ÿãÿÅœHT´öü<HÎHêgã<ñÿ«ÿÿ=þ[ýÙüÕüéüÞüEýýßý”þºÿ`óÿÕÿÈÿYÿôþÿ5ÿfÿ—ÿ—ÿ”ÿïÿ€ú7š²¨í7W±âqå,w³ÿÿAþ.ýü°üêüêüGý¹ýOþÿþÿôÿN^d¢¥''ÜC%=VU•~0&N½k —N©sü}ÙáóPŸÿÁþMþŠþÜþšþdþßþdÿ^ÿiÿóÿ BÜh¡µ¦œph#aƒU×!¤’TëïÒŸN¡¡Ý$Œÿ3ÿÿïþËþƒþúý·ý·ýºýÎý&þ«þ ÿŽÿg¢qGû&'º@γæë0µýPÄ+B!ÿä‚*§wK°þÿMÿÁþ‡þVþ¾ýƒý¹ýþ¥þwÿŸÎ²VQÚ¼¶JL^#9hUj·¶pžÉÀÝÿ1ç–ro5ÿeþþåý¾ýÒýñý"þ•þ ÿãÿŸyÚïù.@51÷¯eñå•}¶j×.nOë¬8•µÿ±þ$þÈýLýñüÆü·üþü¬ý/þqþyþ®þÿ×ÿ|î‘7u´ªc¬ çlxí1#-ªL™vëŒ9®:Îÿoÿÿ³þeþ0þëý˜ý¯ý4þ~þÃþÿƒÿ´~"¬ß÷õ³ºµ“ûUdSèºYMdw]"ŽÌÿÿCþƒý ý¬üü üÅüØüýÅý^þÿ;ü.$G¬ÖÎØ©æQFU`Iõÿúÿÿÿ?•‚ãÿlÿñþpþóý»ýœýývüiüœüàü^ýÈý3þiþ¤þ"ÿËÿ_òhx‡Tœ/:«^AH%5GnnMéÅ+¹ÿ¤ÿ¯ÿJÿ¸þVþñý~ý ýžüüÓüDýØýwþ0ÿÕÿjø `Áæ²>ßF»R¾ÿpÿšÿÔÿÄÿ^ÿ*ÿUÿ@ÿ/ÿÿÿÿ.ÿÿÙþÔþºþgþ¸ýàüü—û,û_û¼ûäû8ü£üýÒý½þgÿàÿ_¨—‡•¶ºu+°ÿlÿÿCÿ¡þ<þþ¦ýˆýåý:þ.þ þ0þ—þßþ ÿëþ£þ'þSýMüŠûvûûÓû$ü™ü%ý«ýíýQþÝþiÿÒÿF³<"Ÿ wÇÿÿÞþÎþcþçý2þ¥þÿRÿ¯ÿ &Ëÿÿpþ þÖý{ý:ýSýLýýóüýýòüúü€ý þtþÿþÿÿ»hÖÃŽÿO¹#aÿÉþƒþOþþ=þ†þÎþÿæþ¦þ`þLþ/þþüýÝýÖý÷ý»ýŒýPýýáüöüµüZüAü‹üý¯ýŠþ­ÿÉ´jpø¯ªEé‡ýÿŒÿ#ÿßþóþÿÿòþžþ`þ3þGþ2þ0þþÜþÿlÿÍÿÇÿ[ÿÅþjþ!þ°ýIýíüèüZýþìþ’ÿJLŽ·µö Å51,ï} t¯ÿ ÿÇþŽþdþoþËþÿ“ÿ)jh8Àÿÿšþcþ?þþóý0þ…þþÃþfÿaË+Y’·×!pÌzÇ@lFÿoþPþ.þ×ýÔýþ€þ­þáþ ÿþþ3ÿ¯ÿ›ÿ'ÿ¡þ”þ£þ›þ¡þëþ'ÿÿÿÿ ÿYÿàÿ2’‹?è¶’9l×EÔÿÿ_ÿ@ÿÿïþÿcÿ[ÿ|ÿÆÿÊÿºÿæÿ4tj#KJ&ðÿãÿ./1©*¸ \7×óì  ¿YˆÏv-œBÙÿFÿðþ™þŠþÉþ6ÿ{ÿÅÿúÿyëùÉXôÿŠÿjÿ’ÿwÿ~ÿ±»ðœe,½³N Î…JíNÜÿÿ¾þ”þVþuþÿ!ÿÿÿ’ÿU¬£‚©ÜБŒ“”v2õÿóÿ/“F=EöZ±Ü[ûŒç *Dþÿ©ÿvÿIÿ,ÿMÿBÿ!ÿ\ÿ¹JºõÙæÍbèñßjLw—áxÝ€åé穉'€ðsö„óÿ)ÿ¹þŒþSþþ,þVþpþhþºþiÿ̹<ÄÿÊÿËÿÈÿòÿTàU§˜Ì/z­°µÀN‚ˆ´ÿÊþ8þÉýLýýhýËýïýWþ4ÿæÿ:üÿ×ÿ1´µv]lõ"8,켎œê‹V % <<Å-l1pÿÿ¬þ.þæý/þ€þþ¨þÙþLÿÿŠÿ†ÿ ÿØÿNÜ"(¿Lýÿàÿ ëÿøÿKÍ<\vLý¹0qáÿ_ÿßþþþÝý¸ýdýýñü ý:ýsý‡ýãý\þÿŸÿ w{qN>7ˆÿÿóþêþÿÁÿ€ºÔY¡/Ý5GÕ……/$ ¦ÿ¶þêý‚ý ýˆü=üœü4ý”ýþþûþ{ÿWï#+ßb8Œ¸šnµèð' }çµ}oIvÒÿÿ'þQý¢ü$üÞûÿû˜ü4ýáýDþÜþsÿÞÿK‘‘_ýÿ¥ÿYÿÿ¿þÇþ ÿ:ÿvÿÕÿNŽsMZÿøþÿ‰þZýuü%üâûˆû]ûÐûXülüoü‘üþü€ý/þ‘þåþKÿ ÿÑÿtžˆ-¨ÿÿwþ.þAþ”þÿAÿxÿÞÿiµ”O2yÿÒþ‘þ-þŒý ýëü«üüÚû+üŒü¼üïüCýÖýYþÈþ[ÿÙÿBªüÖí¦¨ÿpÿÿýþUÿ|ÿtÿoÿŠÿÿ‹ÿÞÿ>>Áÿoÿÿ¤þåýýGý­ü6üÙûxû–û¾û>üýuý(þïþNÿqÿ×ÿShsŸ—=ßÿ¶ÿŒÿ[ÿLÿ6ÿÿîþ›þ}þÈþ\ÿÄÿ¹ÿœÿfÿ.ÿ1ÿÿÓþMþ‰ýýïüÈüŠüdüdü[ü[üµüFýÝý‡þ7ÿ¶ÿïÿe¿ÖSxŠRðSâÿÑÿþÿ ¸ÿŒÿ±ÿK<öÿ9ùÿoÿÿàþ¶þ¬þGþ­ýMý7ý=ýLýxýþíþ¨ÿ³Pд=ÚCõ©hZejœÿ^ÿ‚ÿÖÿáÿãÿðÿÁÿ¢ÿdÿIÿ4ÿýþÊþ:þ;ý’ü`üüßü.ýÍýÄþ±ÿdÅ OkI6<=µ7@ÿ²þÃþ0ÿzÿ©ÿúÿ ùÿýÿ\¦|tÿ‘þ­ýýýHýÞýFþ¿þ1ÿ‘ÿâÿ—€Êšü"Õ S™ÈEÿÿÓÿÓÿ'~±±ÙíS‚ Öÿ«ÿsÿUÿRÿÿÿWÿ0ÿ.ÿAÿKÿMÿ©ÿ u³_9Åù}ÖŽœOKn%*X£¼ŸPØÿ\ÿ1ÿ„ÿ£ÿ¢ÿÎÿ ¹ÿŠÿUÿ¾þ5þXþÿYÿ¤ÿøö°ÚÀUØXÚ_/VD"þéŪ¤µªšŸù2f‰x2Ü“ÿÿ€ÿÿóþ<ÿ´ÿ>´\î˜3Œá‹“!æšGÏ0²žnëg$õÿ*Û]›ÕÙ¬,¶„eÿ'ÿ4ÿ1ÿRÿÚÿŠöE’¾®¦ùmÑ'YN_‡LÝ-²`ÿ!ÿMÿWÿHÿÿàÿëÿc¥‘Kþÿ±ÿjÿDÿ#ÿüþäþÿ[ÿ€ÿ™ÿÆÿèÿfÑFñt“ëD^TÀL¦áh<MÓÿ«ÿ¡ÿ€ÿxÿ…ÿÑÿX¹ J);!òÿAüÿÆÿ›ÿ‹ÿdÿ}ÿ*÷Â:z–ÙøäìêÁY©4ɤJ¶ÿ=ÿ ÿÿÊþ¯þÿpÿ­ÿ²ÿ”ÿxÿ]ÿqÿtÿ•ÿ–ÿkÿ`ÿKÿ:ÿ4ÿQÿyÿ¹ÿ4y»IÕ% þÝ·‡WS"» Uÿîþ}þ>þ=þ^þeþ>þ0þ=þKþlþŸþÎþøþ9ÿjÿWÿ†ÿCäÿ‘ÿgÿEÿ]ÿ¸ÿIË&G8^ãLŽ–,žC#ò{¬ÿ9ÿéþ^þNþ¶þÕþ·þ—þsþZþþÙþ6ÿ±ÿ +%Ke …ÿiÿµÿ´ÿ¦ÿÿ®ÿ+í„Âçé皎¦«zþb|ÿöþþþÌþþaýùüÿü'ýPýƒýñýwþÿxÿ¥ÿ•ÿRÿLÿQÿ3ÿ×þ¹þÏþ­þdþYþÔþeÿ«ÿŸÿ«ÿ˜ÿ¼ÿ1R® æá„ÏÿAÿŠþÒý]ý×ücü.ü9üqüçüjýÁýýý_þ¬þÚþæþ§þˆþ¸þíþ0ÿ–ÿ‡ÿWÿ\ÿvÿsÿdÿÿõþWÿ°ÿ#3îg×zÃLÿ…þÔýlý"ýÅü‹üžüÑüý~ý“ý–ýËýÅý¸ýþ˜þßþÿhÿÒÿÓÿÙÿÌÿÂÿ}ÿ»þBþ9þ|þ¸þ¶þòþªÿ/OYoÄ{qÿÍþgþþºýFý ýýîüŸüpüLüüSüõüpý£ýµýìý}þ@ÿÂÿ0ýÿ«ÿØþ.þþOþšþäþBÿÉÿ@h@5g¡«2§ÿdÿEÿ ÿÉþ¥þªþoþþ?ýYü!üCü®ürýúýcþùþ­ÿ [¤Àì—;èÿEÿgÿ÷ÿhB|ΛN8´-ñ»©Ï÷¬Ìÿ´þ×ý0ýÚüÚüý.ýuýªýÖý4þÉþ`ÿÉÿ0piAedqXYq¥‚8Àÿoÿ¦ÿßÿ p¾;Í—qXÿ©þþ|ýîü·üÜü7ý“ýÅýþuþ–þÓþ*ÿŽÿýÿ6(nÜ6B Û¼„>æÿ¬ÿ®ÿˆ¨¹TLBh Ô‚ÈÿSÿ«þUþ5þþþþ%þ”þëþÿyÿt$¸øóÛ¦Yõا˜°Û;§º¯˜tI>渊Mþÿuÿ»þWþþØýïý6þgþ¡þÉþûþ,ÿ¤ÿc+p[d™•a|ZK¼uesÂÛÁÚD‡OBG™ôÿ¦ÿÿ¾þÝþüþôþ¿þþyþÕþPÿÍÿ4¸þ1d›ìZºù,Ü<ô"Ú´®Ž,€óÚ±õ1ù¤Q——x €ÿ6ÿÿ/ÿ‰ÿæÿ'aÞ*€¤mO'±VÚ©”zP9tm:3E3xɵ]žJÆÿOÿÿÜþÿÿ×þìþAÿ”ÿÑu·âAwDDv{^5þèâ¼›yI.cÎBC ÿ¼>ÃÿPÿüþ²þ‚þ¥þ ÿ|ÿ”òíóY×<½ a‰BÉl Sèm!0\yîF>5a…s–7Þÿ~ÿ1ÿ#ÿAÿoÿxÿRÿ7ÿ\ÿ§ÿm¸Ü'´Tºÿ÷Ѻg×'Ûëæ-ªÿÃÿ÷ÿºÿšÿ¤ÿáÿðÿµÿNÿ3ÿXÿZÿ8ÿ ÿÿÿúþ»þgþþ×ý:þÿiÿxÿ¹ÿ6Û~ ÚyóÓ¯cV\ ñÿàÿ¢ÿ*ÿÆþ•þÍþJÿpÿ_ÿÿ]U8îÿƒÿËþþÙýîý:þ¨þKÿÁÿëÿXÌ. îÏ­Éùé£~.‰ ÏÿFÿëþÕþ§þ‰þ•þÿ‡ÿÔÿ6s>ÿÿ°þ¨þ„þBþ"þ=þþ¶þ²þòþUÿâÿfp›è,P‡É—?ÆHãÿÿóþ’þ8þÑýÇýÜýÎýþ°þíþÛþÿ ÿìþ þDþ=þþàýêýLþhþþþþþ_þ¨þãþCÿ¬ÿÊ{·{%ѳ‰&šÿöþlþÞýŠýýÒýþþþiþ¥þ•þ‚þ³þ°þÃþéþçþ½þ–þ¢þJþòýþCþjþzþ‘þéþ]ÿøÿRiÄß¡gÝÿ¬ÿˆÿÿSÿ½þKþÖýpýNý9ý:ýýÁýÜýcþxþ*þþCþOþKþSþTþAþßýÂýåýÝýÄýèýFþŠþ­þÿÿv ¸ÃÚ¹gÐÿ;ÿ ÿÔþRþãýbýý÷üÇüÆüýŒýžý´ýèýûýèýÃýýýLþÍþ0ÿ,ÿÿïþ¡þmþXþYþ‹þÑþÿÿ8ÿ”ÿ>¦¢ÆUk/–A÷ÿ¸ÿ[ÿ5ÿÏþþfþ%þéýòý,þþ%þ_þ^þˆþúþ‘ÿîÿöÿ§ÿWÿxÿŸÿ\ÿ$ÿ ÿÿìþ-ÿ­ÿA²ûê¹É^ql.»Xûÿ¾ÿfÿÿáþ¶þþSýÜü&ý‰ýÞý%þKþþÒþ&ÿ\ÿhÿxÿ‚ÿ‰ÿ`ÿÿèþÿÿûþ)ÿœÿ!õÿ÷ÿpØíñêñO¢.kïÿ‹ÿÑþþ›ý;ýsýôýRþxþ‰þàþAÿ¦ÿêÿ1Üÿ±ÿÿÞÿŽÀâƆ]zªÅü,ZiÓ"U{ÏYØÿoÿÿýþÚþ£þ¼þèþïþ,ÿŠÿ«ÿ»ÿ¿ÿ¿ÿÍÿúÿaÚ=gjôh../7*=|êkÕ *¥NšN­ÿ,ÿÈþ„þ:þþýýþ6þÅþTÿhÿTÿ„ÿòÿ“6œ–Aää×!×ÿ»ÿÏ@Vª"ðÔØ¥@ PóoGñÿˆÿäþ‘þ¿þÿ3ÿqÿ•þ¡,&&@ln†v¶êüï'JHL†¼¬qŠŸª†„ÿBžD®ÿFÿÿÉþÿ¤ÿ0’ëCŸÊ÷$0ñÇÙÿáÚÌŽnƒD%’[0 c’%½dáK¬ÿÿåþÆþïþbÿªÿ…ÿ“ÿïÿB…˜Ù‚Þdzê(XI笎©LÊá 0J'à‡”€Ðw ÿsÿ©ÿîÿ§ÿ8ÿQÿ”ÿÿ¯ÿ_ý^q«Ô¼o2Ô­áò–"AV+XŠ;("hf;FOuÃÿnÿ7ÿþþÐþ°þþ4þoþÙþ=ÿ¶ÿF´ä)U„ƒn1 ×®ÓÖFÉÿßÿ +8GÀ‘WMýÿgÿÿÿÿ“þ"þ÷ýþUþjþLþSþ}þÈþfÿ}Ü(TŸ§W(ÁvjS-÷ÿ¸ÿÒÿhŨÉÂMÍÿQÿ?ÿwÿ†ÿdÿöþ™þDþ)þþÜýþ[þ5ÿìÿ=n¬ZÌèÖÎÇ EýÿÐÿÄÿ¹ÿŽÿWÿnÿZÿpÿŸÿ xYäÿ¤ÿÄÿuÿÖþpþpþíý"ýòüiý¬ý¨ý®ýåýpþÿþcÿëÿ„ÎòÛ†@FuM0õÿ®ÿ\ÿ ÿáþÿNÿÿ²þÆþVÿ¿ÿÆÿÁÿvÿíþ#þþþ¿ýVýOýýåýùýþý`þ¼þ÷þSÿ¦ÿ 51ާCMx4×jÅÿ&ÿÐþÀþÝþìþñþ÷þ"ÿFÿ&ÿÿÿ ÿÿÍþuþþÚýªý½ýùýþ.þCþþóýþþ<þØþ@ÿÿÿlÿÄÿ!}Ôõ¸2lÿ¼þsþ=þ%þPþ2þ&þ\þFþþþ`þþ|þRþ'þÔý›ýgý€ý¹ýˆýˆýÁýýáüªüàü7ýcý³ýñý þ±þpÿUO (wÿ%ÿ&ÿÿâþÅþ‘þŠþþ“þ€þqþFþçý¸ýÎýåýZþ»þJÿÿÿgþþùý þþÒýËýåýþþðþVÿûÿYqlbŸö ­_{f=òÿ…ÿ!ÿ´þQþAþþ þNþ¼þ ÿÿ/ÿÿõÿ€ÿ(ÿ¨þ%þáýÝýñýJþ#ÿ‡ÿ2ÿæþ%ÿ’ÿ›ÿØÿHÒZj¼¦Y¤ÿÿ´þfþþýý/þpþªþÓþðþøþÄþ»þÿ\ÿ8ÿßþ¼þãþ¡þªþÿ6ÿ6ÿÿöþãþÿFÿŠÿÿÿ»`›¦¾¢wpG~÷ÿÿ+ÿÅþqþˆþéþ=ÿbÿbÿmÿŠÿ¥ÿëÿáÿ¹ÿÓÿ+H2óÿŠÿgÿ^ÿcÿ]ÿDÿnÿÜÿ}éí)T}øC?1ÉNцzÿWÿgÿzÿ_ÿ(ÿÿõþÿcÿ»ÿ÷ÿ,Hÿÿ®ÿ«ÿèÿíÿ¡ÿlÿ‡ÿ¡ÿ¹ÿÑÿéÿ6‚ž±ê9j³×)Á‰\2Úÿfÿ÷þ¨þàþ2ÿÿ-ÿ}ÿ–ÿlÿEÿÿÜÿ3B`HINOœn¯ÿWÖQ{€"«B†ÚÿÚÿËÿãÿ'`?øÿóÿaÖ$9$1C;3ÀºÙâÓ-ï@7㨟¾9÷¹v²6³ÿlÿaÿqÿ’ÿ{ÿ»ÿ<¡ØBX> Ni †jŒ¬ÎSŸ¡€“ýRmŸ¯„s- Õˆ&Óÿ/ÿÜþÿ:ÿÿîÿ=×øèø<gšp-.$Y¦Ë¯±¤`%p¬ØJ^03y•[¦ï;çÿ»ÿiÿwÿÙÿ#÷ÿòÿDæñ¡½þäð:Z7Õ¤§ÐóçÙeà5|_Íym{X¤ÿIÿ#ÿ6ÿ ÿöþÝþËþ¤þÍþ\ÿ»ÿôÿM–·ldå²›+Ãÿ¸ÿàÿÝÿ•b¸ëž=ÿáƒG((üÿôÿêÿ¬ÿCÿ¾þþ‚þ—þÈþÿDÿKÿ“ÿÿÿ‹A©|'J‡›Á­tzóLS1òÃÚ ÛÉôb’ÿøþ§þ«þ£þEþþFþ”þ×þ"ÿbÿzÿ ÿÿÿ$?ci ¨G1FM7ñÿ J…kREºÿiÿèþ8þâýîýôýçý&þ~þ•þRþWþ‡þ°þÙþÿtÿÝÿóÿ+‡˜§²Þ†áÿÿ„ÿcÿqÿŽÿšÿ˜ÿ§ÿéÿ,2^¡zßÿvÿ/ÿ,ÿøþ„þþ¼ý±ýÉý÷ý3þuþ þ°þÐþ#ÿÖÿ!9ucG-$ ÑÿÄÿ÷ÿõÿ¤ÿÿÿÿmÿ‚ÿàÿøÿšÿ)ÿÿÿêþåþ ÿÿèþ­þ_þþÒýýGý.ý\ýuýtýtý‚ýÜýkþÊþ!ÿvÿÂÿÎÿ›ÿrÿ‡ÿÿ®ÿŸÿ[ÿ4ÿ/ÿÿ®þeþtþ þ›þtþ“þÜþåþ®þžþÊþ¼þVþþþßý¯ýÇý‘ý5ý2ýGýOýMýZýˆýÎý]þ¼þÿqÿoÿ¸ÿQkëÿ±ÿµÿ“ÿ\ÿ_ÿaÿÿÞþòþ+ÿúþÈþ.ÿ„ÿ¨ÿgÿÿÿ[ÿQÿOÿ#ÿŸþ'þ"þBþ0þ+þFþ!þåý²ý­ýþýTþ«þBÿôÿE€®×Érž}øÿ·ÿÜÿ¦ÿ2ÿäþÕþÅþøþ<ÿCÿ>ÿ.ÿMÿxÿSÿÿYÿ¯ÿMÿÿíþ=þ„ýsý†ý‰ý¢ý¿ýöýhþ½þ/ÿÖÿ/8J]ju$/wd, ›ÿüþ¬þ¡þ¡þ­þÿ^ÿ‚ÿ·ÿíÿÐÿZÿÓþîþÿ³þ]þþ²ýÇýþZþÃþlÿUÿÿÿçÿKí*=0ó j|3Õ€6Ãÿ;ÿéþ,ÿ|ÿáÿgè[?ÌÿªÿÜÿéÿƒÿÿÐþqþ‡þÿLÿcÿqÿ/ÿÿ2ÿÿ®Ü)O¶‘O)æ‚<)ùÿ˜ÿ\ÿ°ÿÐÿÿ®ÿúÿ½ÿ‚ÿ€ÿ‚ÿµÿêÿèÿÇÿ¹ÿxÿDÿ!ÿõþþþ ÿÕþ¶þ¨þèþJÿÄÿ&Ÿ2Óìãž&ñüæª=)D<ØÿÎÿ 9øÿ“ÿ{ÿÊÿ?›ÔÌ¢cÉÿnÿÿ+ÿ8ÿ~ÿHF¢j·¤Èi·¤Å¾¿œdX?ò’QlwÿÿØÿ=JWÅH3ÜŦcC;C"S¬N[…o:7¡>Å™|i#*` ”E:SsLbÑòŸu°¨?e’‘œ—±ÉéïφŠt¼lpŒÁÞ¢›¼€ÍÎk“¹¢jÊ¿¡ò±‡¹î÷÷&·’ÆÙ'‚ggn]lȇ6Hõˆ$–/oJì~!Üÿçÿ :33ßí¥m/KÀÁR!&k ¸\Yds\„çÈmògãÿÎÿ·ÿÁÿ¯ÿ[ÿ ÿðþ<ÿqÿVÿzÿ¤ÿžÿ¨ÿÜÿ=gsLJ”t,SRR=P¥çÙè7®Ùî£!èÝìájÐÿƒÿbÿ-ÿöþlÿÜÿ¤ÿKÿ+ÿ8ÿeÿ¶ÿ#–ÌÅÐêåÿÈÿøÿ8L êŒtsu&æþ©cO*‹ÿûþØþµþ]þIþiþ®þîþ"ÿÿÿsÿŸÿÌÿòÿ×ÿµÿ ÿeÿ‡ÿŒÿ»ÿþÿ#=vp$…¢µ5¥3ýÿªÿôþLþüý þ þ¶ýºý5þÃþþþÿaÿ ÿCìÿªÿvÿ¦ÿñÿ  íÿÛÿÅÿÜÿ`AãÀÕ¾‘M­ÿòþqþ6þþðýþLþ[þ<þmþœþ¾þÿ4ÿÿ ÿXÿÑÿOU95]ÿ¨þdþcþ±þ+ÿgÿmÿ ÿÏÿÔÿÆÿ×ÿøÿ''àÿ#ÿ;þÒýÖýþåý´ýíý×ýfýý/ýdýaýwýÍý"þþþ¼þfÿnÿ+ÿÿþÿØþ`þrþÅþÂþ¹þ¸þ•þwþmþÎþPÿ¡ÿ•ÿsÿÿ×þÿ&ÿÿÐþ®þ¸þ—þ‚þ1þ®ýVýìüÊüúüýOýßýNþ]þŠþøþbÿ°ÿ›ÿmÿ.ÿùþ÷þÿSÿmÿ,ÿÿÿKÿAÿ ÿÿjÿlÿMÿ†ÿmÿTÿ¾ÿ®ÿ‰ÿÿZÿßþ.þýVýKýtý…ý¦ý þ=þþ6þ{þ—þãþJÿ\ÿEÿvÿ=ÿÿ_ÿuÿ†ÿìÿTÿºþ¤þÀþûþ4ÿíþÁþIÿÖÿ¿ÿÿœÿèÿ›ÿÿþŸþAþþþþÞýÚýþþ/þþþ.þþLþuþ–þ ÿ¥ÿ2J?VzTÏÿsÿ€ÿµÿ]ÿóþCÿœÿ¦ÿºÿãÿàÿ“ÿ|ÿ©Åwòÿÿœþƒþßþ5ÿ ÿÿ ÿpþÏýüý~þÜþVÿ™ÿ‡ÿ‚ÿÛÿO°ç2!‘#õÿ‚xÅÿ¢ÿÌÿÚÿZ±æÓGíÿ—ÿ%ÿÇþ¾þüþÿ­þþ¯þÚþÿ9ÿpÿÀÿa¾ÔÞÒ”s^!\n=ûÿ[‹¥ÂžlYBøÿzÿÿÿÿÍþ¢þÜþÿýþÿCÿ^ÿyÿ»ÿ‰æ<:& îö š¢Û™[YÙÿ'«6uLò³OBˆ~)ûÿóÿÍÿ£ÿdÿ\ÿÀÿ4`‰ÁîÉéF™øáóÀH:GïT4 þ åÁ¤¨Ëÿ²ŸÆ™¶ÿÿ¦ÿ»ÿâÿãÿàÿ ^Å;jy»Û¦‰¢‡_,MÁМY$«~«œ”œÓ&'PhR£‘yãÿÂÿšÿÌÿ@šëýd»Ýɚ킾§ÌÙ‘…BíØÍºã;cžy&øÿRFý¼†-P‚‰¯Í„/+ -ipŸ7}ÈÝÃ+Ѳ­¨m<=Un‹³Ç¬sÃÿëÿ$ZHáÿÖÿ ÿSÿ=ÿcÿÁÿ-¥}þñÑÀ›i<ãØïI "0Æÿ­ÿñÿ[oX¤ÎVÊÿ‹ÿÿ°ÿyÿ=ÿWÿ¶ÿéÿ#vØ4.N Ë̆Q5¶¬{I¦ÿ®ÿ¿ÿ«ÿ‘ÿ©ÿ©ÿçÿC”[ÉÿƒÿÿÊþãþ2ÿbÿWÿOÿzÿ ÿÿrÿâÿ‚äç-n‚³‘#‹ÿ ÿÿÿùþíþäþùþ;ÿyÿ‹ÿ…ÿ¶ÿÎÿÿÿ{ÿ8ÿ ÿ ÿãþ×þÿ ÿ&ÿ;ÿ6ÿÿ?ÿaÿ’ÿu“ÀH*º·ðÝÿ’ÿÿÙþÚþæþðþBÿŒÿ„ÿFÿƒÿ¶ÿÚÿÐÿ|ÿ†ÿqÿlÿ{ÿ^ÿÿ3ÿÿUÿÿ/ÿ­ÿÑÿ«ÿÙÿ H­6XýÜÿ êÿ€ÿÿÆþ«þ¾þ§þ}þbþ~þ®þæþòþûþÔþØþÿÿ«þ´þ3ÿDÿÿçþþ|þ¹þµþ«þúþ|ÿ¾ÿÕÿÑÿ`ÿHÿ¥ÿåÿíÿïÿÚÿ½ÿpÿÿ§þ?þAþYþþ°ýÅýäýïý/þ;þþþKþsþšþ€þzþƒþ®þÌþ¶þXþ;þLþ{þ‘þmþxþåþ;ÿSÿhÿ˜ÿÁÿõÿ@' ûÿÙÿrÿÿýþËþˆþ/þþ þÙýþþ·þNþ þ@þ3þRþŠþÜþÿøþ»þûþ3ÿõþ•þDþUþ–þÌþþþ0ÿ6ÿÿçþ ÿƒÿ!n ±ÿŠÿVÿ>ÿKÿ®ÿ¶ÿgÿöþ1þÁýþ\þ<þNþPþ þ£ýºý.þ„þ›þÞþ ÿþþäþÜþ¨þ¼þôþ·þþâþ ÿýþ=ÿ…ÿ†ÿaÿ[ÿtÿvÿCÿSÿ»ÿ":øÿ«ÿ5ÿšþzþ„þþÆýñýQþmþ|þ¥þ¿þÒþPÿœÿ•ÿKÿkÿ¤ÿnÿmÿ¦ÿÈÿ¦ÿ˜ÿ’ÿ£ÿÀÿ·ÿ—ÿ‡ÿaÿ@ÿÿÉè›A$=–ÿ+ÿÿØþŸþ­þÿ3ÿ8ÿLÿCÿ5ÿUÿ7ÿMÿÿ¿ÿìÿ2P022Êÿ­ÿÂÿÒÿãÿöÿÙÿÃÿxù?Iü‹rc!ãÿ¢ÿWÿDÿÿ‰ÿiÿ1ÿóþñþÝþ¹þêþ"ÿWÿ ÿËÿEa¶µ €VD Ÿÿ¹ÿÕÿ¿ÿÝÿ<Œ¸(Ø„z©ˆb|jðÿ×ÿ“ÿUÿ\ÿPÿóþ¯þ˜þøþ§ÿf©É Õ»‹‡¢š¹òæ¶Ïðî)}ŠK);EMF²ª½Š'©ÿ^ÿVÿKÿIÿtÿŸÿÈÿ0¸ô êú ]aÕÝìîÿúçßé=f‡¢”yá—J8ëÿÊÿˆÿ|ÿžÿ«ÿ¾ÿëÿ!‡mƒyi,ëÖÌx îÿsßÃM"v­³ÖñÊn毨»ÑÏewƒŒ×8uš_/d“„žJ1öô¤@Wd+#‚Óê¼mj´áÛÁ¦u‘ ØÿI+2G*M´LhrxdEczkubæÒ#𚫦â0F,3Ì«Ÿ[;ðÿ¸ÿºÿÚÿ¯ÿgÿHÿŸÿþÿöÿ*»H˜J7a†z/í×î±c‘Ôîñ5%ùáÁŒG(ìÿúÿÀÿ‡ÿgÿcÿ‰ÿæÿL˜Èèò k~aKKµfF’°¦`'/KEKV_QRjFîÿÝÿÕÿqÿÿìþÀþgnustep-gui-0.24.0/Sounds/Bottle.wav0000664000076500007650000005605411235134022017170 0ustar brains99brains99RIFF$\WAVEfmt D¬ˆXdata\ %@ îÿÔÿùÿu¶}8Òÿaÿ>ÿXÿÞÿ^N).dRåÿíÿq…Åÿ™ÿãÿ09;5æÿ¤ÿÉÿ)O<4ÔÿÒÿ#áÿ³ÿúÿ"êÿÒÿûÿÞÿ×ÿ1Jèÿ-çÿöÿ ôÿ4öÿ=W9$cßÿ$@95Þÿ«ÿ±ÿ €ÿ¡ÿÌÿÍÿ /ûÿÛÿÑÿÙÿ#&}†*×ÿaÿuÿÄÿêÿH=úÿ4QPtœåÿÊÿªÿçÿ8ÂÿlÿyÿÑÿ4‚Ïdîÿ÷ÿìÿûÿ,=÷ÿÿaÿoÿÌÿ- l4©ÿPÿ¬ÿ;÷ÿ<œÿÁÿ9Çÿåÿx½Î_5úÿìÿùÿ?RTüÿ=ÿqÿ.½ÿÉÿíÿØÿÇÿÓÿÆÿíÿ1Ÿÿ¯ÿÅÿgÿ¯ÿ;Rúÿxd<Jr?ïÿ…ìÿ÷ÿÞÿêÿÿÿ–ªûÿ¸ÿÿÿøÿùÿ¼ÿ¾ÿZÿ{ÿêÿŸÿÊÿÛÿRÿÿXa!Çÿ‚ÿâÿ:ÀÿÒÿEéÿÜÿæÿ^þÿ¥ÿEÿ¥¿£ÿIÿûÿáÿ¡’ÿ'ÿÞÿçÿÚþfÿ.ªÿÇÿ8Öÿ9ÿÿÿøÿVÿÖÿcÿÖÿkðÿ.ÿ K ‡ÿG-©ÿþÿßÿáÿRWÿnboÿ²ÿØÿ±ÿšåÿLÿg…ÿFÿœ"¿ÿ?Üþ»þ4¨þÞÿq9ÿYÿqJÿ'ÿ"½>ÿìÿ%2ŸkúÿÏþÿȰq¨ÿþ‰þ#½jVh´ÿÔÿÀÿK~…‡þ~þ-ˆÿÿdÿM»Üÿàÿ(JÿÝþðÿ³ÿ1ÿOOÿëÿB:ÿƒÿ2ÁÏÿÓÿXóÿ¡ÿðÿ{e$ÇÿÜÿ(Ôÿ Ñÿýÿ=5 ÿoÿœÿŸÿäÿO~ûÿMÔÿ’ÿzÿÿ Ôÿ›ÿ‚ÿûÿ~ÀL Ûÿ_W?p?ðÿÕÿÙÿõÿ™£4·ÿªÿAÕÿûÿÔÿêÿÒÿpÿYÿÀÿøÿÛÿÍÿ -Ïÿ”ÿ–ÿÂÿKÅÿÛÿHbLÚÿéÿB‹W@IÕÿÍÿåÿîÿõÿ=çÿëÿ'iV%!ïÿ·ÿÎÿöÿÿÿåÿœÿ»ÿðÿC‡¦ÇIXÿÿíÿxlq9wÿZÿÊÿ÷ÿ-Z¨´Xóÿ6"(B¥ÿpÿÿ²ÿÛÿDPLH&IL&ÝÿØÿQ…6õÿ."¼ÿ°ÿßÿ8g‡fØÿžÿÿÿbg[; #76¬–Æÿøÿ,H)×ÿÎÿÕÿÐÿ ¶¦i·ÿ§ÿÈÿ+©“Måÿûÿv’îÿ%WáÿÊÿ6CÑÿ ÿÙÿF?D 2'#~˜„U (€Ï0ýÿ÷ÿûÿ DùÒ; œ1‘õ'í7408ÍX‚@tØ÷>ÿígz%УAè|ˆA˜ÎFîÂ7ö7¦Oœ[l&ãøŠøôQÖÅ´Çà¥!²•&‡KÝ`$nBƒ¯qîÃ2ô?ÃývCÓªÖÄmî1 p }ùr²B·þäìÖ'ÜA$üâÌ]ÅðÝ[õ]õ)èÏé!ûD¨7-D®)2ûô}óÓØñõB1AîùþÒð©^F_N´€ô†‰€n HÕײ :´U¬Ea-k>‰pHDfóôÆ(°ÇŽ€­ˆ_¸(°\¥ ܸäè¦ÀݽéJdLÛ:Ý-àÜ„ ¥…í@ç‹Â9ÆûÍ®üˆ‰3•ϕЙ Š ¤÷Ù9üÝA )ß ÷Ûåy¸¼€ØT“Z€X€&‹­”úg:??’4Òõí6ØãñËõÔïòÑS™ýŠx·åÌÛW×åãîûI$)*)ìtýmå&0‚2/@Þ,ÏçJÅèÅg×9𯵤×0Ý>Y\|¬|¹`Ž@Ë/º$]Ò«!ïœî¡Ùjç°³9'<ÊL«_4yÿ°oÄgŽaÝRµ:&19q¡ÙÍ+ÐI¡Mv@-NHF"^¡RaYx]ÓZˆ_³k©nél¦`ýJu+ã ‰C Œ iý9 „ Ñ/n6ŽOf5_ nGxˆiœTgEN4Ý,vø,îì¯õŸôµû‡L,º,9%’&Í0 -¢`A-í9Ü+R&ê 9‹ · ñƒÝ¨Ë]Ì@ÊË©ËcÝ—ôÜøuáÿÊ:çKÿ ÷#Þcȵ¾¤üž¥ž£”Yž³7ÂÞËkÝOöäüŒùç_ÚÏÌçÈÆÄ´Z£¡¢Å¨0¡p­¼ñÈÇdºk¹Ž¿Q¿­Ç_Ë¿ÉÆ¥ÊÀÉ’¾<¿ÁC½ä²–«:¢D—ãœè«<µ¨½ŸÑ±åté®îzñ?ñï>ènÖ}Á벸­ø©œ±G®È>ÂFÉDÚÊäšñ/ñÎíÑåªåÖç¨åàäÎëÈì¨êÙê¤ò©î…èìïÙõïMñ9õDèçmêö1ÿáÚŽï'É,r+‰,+(§ Ú‰ókîzï.ïzõ*Ø…¢+x3’6;FD N±I <Ö.µ,-*‡Z»&l/@14^;O@1E_HG#NRKV=D:?BÜ>Õ?¨I1H÷FÐM:N$AÞ-Á$ëŸø| 8 ü%U16>øKœZ a}X®KsKU=¶.,ù$¨$L#Ž!p0# %*+.9Ô>§=ËDFE\?ø6Y.u&ì%NÙ; vx ý@÷tüb÷®ð5úJN ¸ ü‹$˜øMíxÝØPÒtÅbÅXÊÈÜæèVïÇõ[ûbùÒøÃô`éyäuàÚS×ìϤÀõ½¡ÈßÌ”Æ ÏÛÛ´ÑÒÊwУΙ¾» À¾¾ñÃÄù¿ÝÆòÍÔËÂÊ“Á;¹Ö³—±á´v¶¶ºå¿¤ÅpÆÏsÔjÛeá¸àÞCÖÍüÁ5¾Ê¸è¹²ÂdÅ‚ËeÍ٥߂àcá¿ß&ã æÏäüáÛþرօÖÑ×2ÙÕÛeáîè!ê.ó,óíêÇæ}ê0ï´ô{õ¿óó‡ùs > ²Yƒ¦þ3ø›ûñû-óßìöõ÷¢´%d%­,©.´+ã(F"#›#N n y %­1ï5ß7ô=æ<76f42Ó4È7“0¯(û)ª,$-/6i8Ò;•< ;©6}2&Ú#†)&)Í)Õ0û>°FFHÇEG©JrHnDœ@¶@9»0¶-ö(¶%,(5C9Ñ=—AéF¢CD9s$%‚!söÆy ò)"6!Z‘wŽRŽÿE Ê If '&J ] € $ûþîwó£ë›åžú<.ì~îÑüÚù ÿ@"ðÝãséÿãçáVß$Õ=ÏÞØÛ Ô7Þ˜ãÙà$áèÞ$ÙzÙ1×mÏòÏ ÑFʵʠ̊Ë[ËôÑ‚Öç׸Ö×1ÒÊ>Ç[ÃY“ÚÄZÉ9ÆÉÉÒIÌÍÑÑ8ͲÏqÍ[DzÆÀR¾éÆàÈmÉ ×e×sÒ:ØbÛ]Þ°á¸ÜqÎèÑ&×(Ó ÕÙìÙwÜÞAßååãíá›êçìzä*çCë^æ•åäânèËòZð2ómû×úø(úHüØöÃõ«ñQñ·÷¢û­øœ:åçé,x­+SH J¦(˜<ì$*Z-_+Ü*˜)#râgLø$+'ú&3*J-n+´/ã3o0W-¥-3(Y#M'Ã,7*&*Å.™29<;³:ß:É443)5k2Œ/¶.z.1ƒ3Q5;6u8Ö8o8P4Ú/ï.ƒ+¥)ò&$5!Ò Ô « 0 Òå"Õ&É#-#W!þ*W€]\+ â|¢5dø ÷ Ë žJú0Ÿý©ýLýŸÿއþfý\úÃøíôÚì}ì!î;ìõèHèdè íåîûêqé‚êAè…è é@à>Û­ÛGÚù×E××ÕôÖÔÛuÛ ÛNÜOÚK×ÙÚØÒvÐüÎÍËË•ËQÎsÒ¶Ò©ÑÒÔÎֻٌÓñÒyÏVÎëÎ2̲ÌÓQÐ7Ñ5ص×HÕhØÚpÚ£ÚkלÔÇÔ‹Ò͘Ñv×´Ö&Ø#ÝKÞ›àLåãáŒâˆâòàÒßFÝ%ÜÅÞzß»âæê‡ðÉîÊðÃó-ôÉôWò=òÏòÞòÚò¯ô¤÷‘øšûÚþÃsLÙ4WöéZÈ6; Ü[Í4Ÿê‡1ãqÊ iz¬#,& )D)â)ä*‰(Y'E&É$0#$~%m&ç)Û)Ç)×-50&/j.‹/4.¨,ê+ )=((˜'Í(‰+,>,l->-›-.¶+¶)Ò)'5$É$ª%+&Ý&(Ø((*:*â(ª(ï'²$‘!ÎØ‚¥ƒ3Q(<u&;åùÓÄ È 4î9MiG³³ü*Ìþèü’ûvúZøî÷Íö!ö]÷8ø/öuõSõ=òÀïTëGçæå=ââ\ã¬ã€ãÅä=åšåºä'áðÞÁÝaÝ•ÛÂÚRØÕÖEØfÚÆÚzÚÍÚKÚÕÛhÜ¥ÙMÙ5ÚÚÓØÅÖ£ÕtÕ3׈ÙéÚKÚÚÜê۲ك׬ÖZÖÉÕTÕ‘ÔùÕ¹ØÞØmרzÛ¢ÞÛà‹àžàáPàܾ݊ÞõÞxàâãå`çëéïíÑï¥îÇî¤îïÚîíEì­íûð;ó ôäô8öùøîúûúBûoüÒû ûåú¼úÝûãþ1å™N ÷  Æ ‹ ý à w Rí#;•»/@æ>&Ž»Ðuçæãa #€$œ$Ê$z$„#ñ"T"p"W#$#®#Ê&s(¨(Ö'¥'Ú'_'ñ'X(Q'%Û%;'''0&T&å&é'°'%&è&û%’#!¨¸n—Ú ó³Æ¦Òouï¡.–§éÿ ” GJ ›  ô3ÅãÄRƒ%ÿ[þý´ú|÷(ôóŽòÂðî4ìiì¾ì\ìÇí‚ðãñÏðšî‘ìòéIçæÿämãÙã ä¤ãQã¯ä¬åæ_ççûä=ãýã•ãàÞ¼Ý,ÞŽÞÞCÞÃÝÜÜpÜ@ÝÏÝ Ü`Ú„ÙLÙNØv×—×ì×QØoÙÞÛvÞ»àUàßFàá|àñÞ×Þôßá|áUáã…æ$èlè–è#é±é’êcê!êÛéÖèé4êìì&ëì;îQðšðØð:ò«óèó£òžóXõ‚ö˜÷ŽøÃú üïüÿýÿ=lÂj¨¸þ¦“Ì Ø b‚"è mwÈbPå.3GRh;EzŒ¦™×ï\ØÒ< 8!Ó !6!¤"Î#&#z" #$$2#"^!!ª ” !"#j#A"r!‹ ζQˬÜ÷(•:*[E€xr9Ú×|„ö:?œH°¦  ‡ ¯ Z {g1¬¢wjÿŒýû˜úÎúÛù÷÷Æ÷ùdù8øö,õµõÉôóÆñwñ<ò.ñÆî0í\í)î íøëÒëÉì¬íoí¥ë½é`éŸçå_äÚä äÑâáâácãkã¡ã%ãzá.áœáýàwßÈÞšÞkÞ¬ÞŠß”à áá`â â+ã\älã áŸàéá¿â4â$â¢âÁâ4ãäÖä†åpæ ç=çSç,ç_æÊå<å)åêæ2éèé"êãê¦ìÛíKíîøï.ñ3ò ó”ó¹ó’óôóºõ+÷g÷ù÷eùðú÷úûûþû,ýaýDý¥þøÿ&ƒ„Œ'¡…– Ÿ~ Ç ( d èh`ˆp“4éÒ»›jL{ZZ2$½ÂÓážj:b6äΊ°º nëm—¬¾wŸÆ7‡«Ø¿»I愦·pþk«ðãØ ` O " 1 < = 2 ^ ® ;Ψ ˜Ä¢ÿƒÿóþ¼þDk¦þ×üûØú@û˜úø†õÍôÇôwô7ô×ôÿôžò˜ðNó=ô/ñ¸ílìì–ìkì–ëPêéûè×èièséõêêèîçÕçNç½ç*ètç;æ¬å´åðåÌå¾å7åÜä äïã%ãnãä*åKä’ãÊãäâã2ä{åµååeåØåeå¦åJæëåPåæ&ç¦çÑçAéÐëNíôì%ìIì¨ìàì¡í«îÍïuðñLñyñ ò¥òƒó½ôñõíõpõõãô>õö ÷Õö*÷ñø)ú˜úöú2ü=þÆ >Kc&áÅ&£{ Z ¾ ˆ2vÁIA@Ë]‡?záñÞ„5\f™ ãÊqð"ó.§ZÏâ‚Cî*ç´Éþ&WÑC+Nôcõ&¸^Ÿƒè’~UŒ•úÜc“© v +   ( q Ó Ë§•=/Ûl«]BÚKôþìýýÛüNüûsúDúºù ù±ø‰øî÷¿öùõ˜õàôˆôæóó òœñÓñ)òò¢ñóðLð ð”ïüîHîkíðì¤ìÊëØêëëëê^éíè_èãç¯ç èÒçÒæ5æååÌåæ×æ«çè°çç•ç£çÚæîæ&èÀè¯èÕèévé7éäèŽéÉêûëVì¡ë÷ëíí™ìÎì[ítí>íí_í¦îLï\ï‰ïðEñäòôhóLònòµóôõ2õ:õ£özøDùùùäùûáûýþŸþöÿ`œædnôd=u‹ó –; Â ß e WNßÌiÊ>ºƒ Àp[aTåËÊ쯴 ¨"·‡ráÅ3¿r …qªŸœy¯JQ¶md6®Guïµ(ò§+£=åWÜûf‹ É Å Ë … MhÉ/YT0BÄÎL×óÐóþŸþ^þŸýýJüûHûïúâùÝøŒøïø­øŽ÷èöÄöuöÀõAõ ô¦ò'òôñ ñ8ð ð'ðïïÍîní ííãì1ì·ëì[ìõëŽë@ëšêåé¼éê<êOê«ê+ë§ë ëòé¸éþé-ê=ê´êëë«êêØêëÜê)ë^ëëëëÛê½êzêpê,ëÔë<ì3ìúëpìní!îàîzï§ï;ðsð¦ð­ñ5òò¯ò¯ónôEõöŠ÷‹÷A÷÷°÷ãøµùú’úûû>ü¯üýËýmþ¹þ:ÿØÿæáÞ êV>è#ûA.Õô B l Ú Õ â O ½ x“ ¹="ŒÑe”*ÿ~˜NrÐ:mú¢ÒGUxŸúiñìL ùáÃa u4h‚ŽÜÆS¥ÛŠÆôé;" VJE¨ ê Á É ÿ X Ñ  âËX\Ç-Ø75{‚M‘YŒÿÿ2þHý=ýgýãü«ûâú‚ú…ù„ø*øÞ÷÷ªõ¤ô©ôºôhôªó$óóóýómóPòfñ”ððÌï¾ï€ïXï&ïÅî?î-îHîDîlî±íçìGììÒë”ëjë…ë¥ësëîêšê½êŒê_ê ëgëËëhì/ì!ë}êøê*ëÙêçê©ëì ìMì½ì¨í°î´î}îÏîeïÈï”ðOññÀðñññuò"òüñ¯ò óhóúóqôŽô°ôfõOö±öÊö‹÷søæøSù]úBûæûTü©üý·ýpþÆþcÿ Ѽ¤¬XŸI?Ô02ªO\a. ® L + ä l S µ ß S ¾ IسQŠ|¨ª°‘×ä2CçøfãZð[sxÅëÀù½»GᛥP¬üÕL|׎ӚV 󛉉÷   Å 6 P © H Ç Ô g õÔr\‚:­œº¸±Ýq›øÿaÿÿþþèþ<þ"ýûû+ûûÝú5ú¹ùµù«ùPùËøøøÌö´õsõÃõÁõ$õ»ôÚôõ[ôKóÂò¦ò÷ñåðð~ðõïï7îËígí6í8í°í,îîíAíäìíÈíî¤í-íÇì^ìÆë—ëÅëÀëSìßì.ívísí[íÉíŒî‚î=îî-ïJï¹î=î~îï1ïðî ï”ï(ðfðoððñÖñ’òó5ó”óŒó®óôÁô¾õëöÃ÷Yø—øJøøý÷ùúÙúøû üVý©ý¤ý¨ýCþÿˆ655`2ÀÕ»nTú¤¸\‹×n } l ƒ  × a M ü $ j f‡Ú¡¢FXiÛ= »°Öõ&[a6;<b°âó}  H¼lüù,y&Ô¸¸G‹»¸Eú ÿÍM Ï ¤ - h C ¹ e T 3 •(¨X°ÍØYL½+è…½c# ½ÿÿÊþ–þþýý·üUü§ûØúúZùçø´øMøî÷²÷ ÷Êõõõ õ{ôô¼ó³óRó€ò•ññéðÆðœðxð%ð«ï~ï¼ïˆïïïHïJïï¶îïïfîôíîZîqî.îaîßîÃîÉíílí‘íríoí|íŽíÉíáíïínîUîiîVïðäï ïðÓðŽñéñ‡ññññ;òóãóÄô[õõÓõñõ1ööœö/÷=øù ùÂøùàù{ú%ûáû&üwüÝü4ýfý¹ýŠþxÿ¶ÿ§ÿ1%šoñÄ•hÙOÂK§v1˜ñæ ´ D I Ê ^ ] ê õ ) V ™ @Ñ-–‹'Ø2žRÿSsš<LÞ‰]&—ÚöpÒȧ^ºH]•ßy ! Ù ÷ ó |  á ÷ Ÿ × N Ä / ·t’MJ }Ù(õÎÝò\TïÉú‘9ÿþÎýþ§ý°üAüùûýúõù‹ùù~ùíøMøÌ÷÷÷÷™ö.öçõ€õüô{ô9ôôÚóÖóuó¦òEòhòXòò¡ññÄðð-ð]ðJððîï£ïOïÖî€î`îYî(îôíçíííÜí§í«íôí^îäî,ï#ïÑî¾î ïwï«ï×ï ðFðµðð_ð–ð4ñõñ…òÎò™ò¤òÝògóøósôô€ôCôÚó1ôõ­õ2öžö:÷á÷º÷…÷ øÛø›ùEú~ú«ú!û¸û›ücýÜý0þÏþTÿŸš'%¼è´Qv±™ûÂÌ$¼n¤šº* ç + w S É ª P t l  …j—šÕr¸º–s…®î[ô®¡v·ñ½ó†ùÖÆœ[L'˜ý Å Ã å Ç 9 î ÿ × f ï Ø Ñ ˜ J # ÷ ^ Š E ÔUŒDýJ»Zç…O=3zÂ6¶ÿŽÿxÿ\ÿôþøýRý^ý+ýeü“ûVûTû¨ú×ù°ùfùžøJøVø øƒ÷$÷&÷(÷ÈöÅõ‹õlõÈô"ôxóóùò¡ò÷ñßñ®ñtñZñ‡ñ>ñÛðZñüñÈñûðeððÃïï\ï±ï:ðð±ð¸ðrðBð8ð‰ðœðXðwð±ð·ð·ðéðñ ñ=ñUñ=ñjñÇñßñüñŒò¾òiò|ò*ó–ó ó½ó]ôwõ²õ¸õ5öãöS÷F÷V÷¹÷ŸøCùªùíù¯ùæùÍúòûzü‹ü/ýÂý ýný#þ>ÿyÿ«ÿLô“~UÖxw!qL/±u¨5_š* w ½ ? ±  v ƒ ° & Í < a € Ó 4S(%Du¯ÛÈü (bix¥¹®{v˜¨§ôÄ;8.åŒN8  ² Í | B  { É p 1 ò s  “EîÌ‹ Õ®Ðu›#„‰È¸ ®õÿfÿVÿ{ÿ+ÿCþ•ý>ýæüvüüÃû’û‹ûðúëùù¬ø@øøøg÷ÛöUöö­õDõ õõõæônôüóüó'ôôÔóólóyóóxò®òÎòEò²ñ˜ñ¼ñåñæññtñØñògñºðñ`ñ ñæðKñ½ñÅñwññ½ñÒñ¡ñ‘ñêñ òòòŒòòò)óWóåó{ôäôõBõuõ®õÁõâõFöêö{÷÷÷køŸø›ø¸ø ù`ùµù,ú5údúìúcûÃûüiüÀüýýBþ­þìþùþtÿ–½1kå›»Ô@€(Žø ÒP…Øp‚’ý” ÿ $ X m ­ Ø I Æ ù Ö ÿ ‚ • ð í ¥ L ¥ Î T̬ªß´ÒÏÛ§#Ü L¦eBŠ€ø n N  ¹ œ › à À H Î V ã ¸   ° T )  ånµÂe*j¼rÿdæ(³3߯_öwL·uYñÿÿtþþ„ýêüÇü«üLüÐû–û_ûKû²úöùÔù×ù’ùÞøTø£øù?ø%÷ÕöÁöyö…öØöÖöböö‘õïôDôôVô…ôQôúózó ó³ò¼òÅò®òÁòøò½òoò;ò,ò?ò.òEòIò…òaò¡òÙòâòµò–òÝòæò¬òºòvóòóéóÎóôôô ôPô¨ô³ô²ôõ´õööö[ö±ööºöR÷ö÷7øøùøÚø¿øÛøTù3ú>ûû°û>ü‡üxü“ü_ý‰þ4ÿ:ÿÿÿÿoÿ4ím“²ãM¬ÏIë:9_Ñ)Ã?˜Ë$¦ ƒ ­ ÷ 8 g Æ á  ˜ ¬ … ~ Š ª ù  ‡ ­ N N » ò  ÷  C ,  Ö « ™ ‚ F  Ä ¾ =  × þ A P ã d d  u ý   è ¥ ‹ k ømPDîq1³!‘oŽR¢#Ÿˆ’d!à )¡òÿ©ÿÕÿêÿ³ÿ[ÿ¸þüý‘ýý¶ü‰ü{üTüÿû¡û'û÷ú±úEúÏù–ù]ùcù‚ù$ùeøÌ÷7÷Äöö”ö°ö¤öPöòõ“õþôÊôâôüôDõyõjõÚôDô-ô~ô—ô¼ôæôzô3ôôêóôfô\ôgôÀôÔôyôô¶óüó}ôôiô€ôwô„ôyô¤ô&õ%õôôõyõáõöMöŸöóö3÷o÷Ž÷¾÷Cø øzøoøøø¡ùúú…úûþúáúìúfû÷ûsüãü$ýSý†ýýßýUþÚþÿÿ0ÿ™ÿ Ú<+!p–}ð7W¨6q#—Nà%pÎ&/vŽŸ˜Õ < R ¤ ä Û Ô ÷ _ › › ¸ ï å ü  5 M M Ž ¢ Ù  Û Ž ¤ í º S " 9 ~ } û ˜  X  õ Û Ó O — R   Ý g ¯4Ì–°Æ„ϯ_¹-vq?äcöÊŸM嚤?ï¥DÐÿœÿHÿÿþ†þþ÷ýÝýgýÌüKüèûåû¯ûÿúIú-údú¬úkúÙù‡ùWùCù2ùèø·øø#øæ÷Þ÷ì÷ó÷™÷Z÷U÷i÷:÷Üö‹ö[ö9öëõÒõÆõ‘õFõ>õ>õõõLõXõƒõFõ¸ôˆô­ô õ>õ&õ3õ{õŠõ[õJõ{õ¹õ¯õö¿ö÷ëöµöÎöæöýö÷ ÷v÷-ø¦ø”ørøaøhø·øGùÚùæùåùòù'úbú¢úû¥ûñûüü:ü×ü&ý(ýmý«ýÌý3þ…þ¦þÿÎÿaºàl£¾ïVä1nä3%»õ(rɶå?†“ðTB/¡ÌÓòM€± | ¤ ™ ¸ Ë µ t œ ç ä ÿ V ” ˜ Ÿ ç  ê Ë Œ £ Æ   w 0 æ Ä Û Ð ƒ „ ƒ l  ‘"45Cp9Შbã­cºEîîò®¤RИ°]ªWÙcFOÝ1çÿÙÿ±ÿ¥ÿ¢ÿdÿ#ÿ·þþ†ýZýýýýªüaü\ü$üØûˆûPûúúÌú’ú^ú úâùŒù ùúøùùËø—ødøø"ø øÔ÷u÷=÷÷¾ö£ö¶ö÷&÷üöõöîö©ö`ö/öEö]ötö©öÛöSöÈõÓõ:öiöeö¢ößöùö%÷öö­öäö÷ ÷÷E÷s÷™÷Á÷à÷»÷ª÷®÷Ó÷:øÊø-ùùÞøÚøhùÙùmúâú6ûRû\û•ûŽû^ûû#üãü^ýý§üÂüAýþÿ^ÿZÿÿÿSÿ`ÿžÿêÿfsE1W¹sß<¡¼œ¹åôÿr<Y¥ñÿ ’#fƒÆðËqÊ  L§ºØåªŽ·å  ÙgRàí D N úŸH"K ~DêÞàæÅyg„aKækƒAɸÁ±` ¯Z: ÂJåÖÈUï™ ˜lW?‡tÁÿiÿìþ³þ]þþ3þ/þîýÅýšýñüfüYü)üóûìû•ûSû9ûâú­ú¨úŠúVú7úú³ùUùBù ùÃøñøÈø¥øëøÁøPø1ø;ø$ø¹÷K÷.÷’÷õ÷É÷~÷X÷c÷p÷p÷S÷÷ç÷Ö÷–÷G÷óöÝöÛöèö÷m÷õ÷ø?øé÷a÷T÷£÷ ø;ø`øUøløÖøuù‹ù}ùˆùoùŠùßùú,úŽú¼ú¾úöúûû2ûtûËûüvüžü£ü»üýqýâý&þ`þ†þ{þœþÐþ7ÿ¨ÿ°ÿ©ÿ²ûe–†‡ÃO­qú °ºië+yyx®Þ¹Û^™”“¿@@4j–×ÌÃæÇSgz›œ€e\s‚ƒwwL÷Ýáßï$ ¸\!ÿܹ{ ³£Š¿¶É³HÖwo{AùÉtD÷äûЄðÖ»oOFßÿ®ÿTÿ1ÿüþþþçýÏý±ý–ýTýýÑüüCü+ü#üüêûøûÉûÓûÊû«û2û–ú2ú(ú`úþù©ùÑùú5úúzùùù-ùùùùÎøø•øzøø×÷Ú÷øEø'ø*øøê÷½÷¢÷Æ÷ ø)ø+ø%ø5øaøfø‚øºøûøPùZùRùùÖøÉøêøùùØùüùú7ú=úUú`ú]ú÷úÀû¸û€ûSû$û0ûRû¼ûwüýýÞüÇüÚü.ý©ýðý6þmþdþWþ¯þúþïþÿSÿíÿ‚Êw¼Âé"@an¼+]ÑãáåMIO–ì1z§£Ñù T¹÷ç©X3g¬ü>^Sá˜ÒÄȶšƒFï×4,)àÒÝÂàâÖ”^AÉÊêìÉ/ך¡“…ˆŽy*³Rê<#š Òôµy\(ωaH.öÿ‰ÿ%ÿôþÓþíþäþþ7þàýýNý.ý$ýý ý»ülüküFüëû¡û|û/ûEûDûøúvúsú¬ú“úmúvúCúúÒùžùkùXù¢ù¥ù\ù!ùùùÊøÉøùù'ùùåøÝøåøäøµøsøYø©øÊø˜ø¼øù]ù`ùùƒø­øùfùÃùâù‘ù+ù&ùMùaù•ùñùAúKú)úYúeú[ú»úCû›ûãû$üüÖûÙûñûQüÖüKýˆýéýþÖý«ý²ýéýCþŒþÁþñþâþßþ1ÿPÿ‹ÿŸ«ohrzµèÿxzpû Ìã´nˆ˜»QÕü=CòÐ.¶Fž²æNKKY…\K)s´fY† ŽmwV!.]m`Eè×àÒŽnmAô¿v* Îâ̤•4RR¯ê ˜?þÇßé{&Ïÿ‹ÿeÿJÿ\ÿYÿ3ÿ(ÿÿpþâýÅý³ýŒýMý ýîüËüâüºüŒüaüüÕûÒûÑû}ûBû?û[ûMûûŽú^úMúkú ú™úHúüù×ù¥ù”ù£ùÐù ú úäù¥ùEùäøÈøÔøþøMùùù¤ùTù?ù6ùûøñø,ùTùrùùsùnùaù~ùŸù°ùÒù¿ùËù!ú úþù)ú‡úÐú$ûVûLûRûaûlûÁû1üiüdüIüü ü%üVülüÃüeýÁýÎý§ý€ýŸýþ„þÃþÈþêþDÿÿ>ÿ2ÿNÿÞÿQ ã>u^z˜¦s„—L‡ýCk½$:90Js ’ºB@Pi./W§Ç,|g9@WXnz’«Æµz+ó ,V@%9RÒÏÅ©‹‡ ´Wû åî©xu€)âά` 󱃑£^Õ¥{7L†v*£ªÿ{ÿ·ÿêÿÌÿÛÿnÿØþ•þJþþôýþ+þþ.þLþþ±ý?ýèü²üü›üŠü>ü"üüÅûsû{û‡ûÀû×ûÈûyûûÜú|úú°úúYúSúsújú$úú4úBúúÛùöù úúØù¾ùãùúøùóùÇù·ùÚùçùéùú;úçùËùóù-úZú±úûfûaûæúˆú«úÄú®úûpûxû|û€û»ûÅû•ûÆû@üˆü­üóüýcý¤ý¦ýýsýƒý®ý.þ°þóþÕþèþÕþ…þŽþÿ¤ÿG™V#›<‰·¾ª²—„ß7qÌFš«‰œØ%l©žorhhrÁö€ÇüÓe&6‰¢’šËµ¥¢¦è ÚÐ÷ÈwTL‹Óú¼šgcR>ÿR~0õìÓŸ„ˆ‚È¿>ÓÛÇQùÛöÀ’s˜FR”±—xòY*$çÿåÿðÿ×ÿÔÿÌÿºÿKÿ;ÿÿ ÿ²þvþyþŠþmþþóý°ýsý1ýýâüŸüTüPümücü7ü ü¹ûû_ûxûkûMûIû(ûøúÄúµú úú»úûû ûÌúxú^úSújúzúdújúŠú¬úrú{ú&úÝù.ú~úú úœúxúTúrúpúeúnú¸úùú ûgûaûûõúûû'ûYû·ûðû%üLü_ü;ü ürüùü#ý5ýXýuýwý¥ý‘ý¸ýþIþlþqþ?þ>þzþ®þÕþÿ(ÿNÿ•ÿÙÿüÿ-—êõÄÇ;j‚Á<Q$/ cÂrrzް—|£íOgGQSGqÒääÔÅÚcŠXüù.'û@C.9p^\Š™e "(à¯TTš»ÂªE!1FåÖ¸Ÿ¦ˆ<óèç¶T þçãÔœJúͤyRU¦ÿ[ÿbÿzÿÿpÿ4ÿÿãþ¨þSþ#þïýÕýÄýÞýÅý}ýwýDý*ý[ý&ýÈü™üZü ü ü2üdüküüÉûûwûDûgûxûVû9û'û û&û_û{ûDûçúíúÜú¿ú‚úƒúhú3ú7ú`ú²úÝú¨úŒúkúZúaú¢úùúìúÖúÜúÝú¡ú§úîú ûûûTûJûFû’û·û¼ûïûÙûåû#üYüjüWüü·üÖü÷üý¤üˆüåü+ýýŽýÎý.þ“þÁþÅþÔþãþ%ÿgÿjÿwÿÿ¡ÿªÿÐÿ C]YoÓ/Øè(zûI"îï6x”óB¢¼Ð¸·³xÔÝ4WZ€]Qj‡Â(á¯é-âøúéîßðàèìP[/ý›l£¬f*ö ¢-'/6F]Ȱv/äÛá­bKß)ý tps)¿ÿšÿÑÿ˜ÿhÿkÿ‰ÿPÿñþ½þÍþÀþ}þ&þþÿýÎýýVý=ýýúüý ýýüü¶ü“ühüèûnû‘ûü;ü%üüûðûºûSûßú¿úBû¢ûµûƒûû×ú úÐúûkûÉû¡û1ûËú´úæú0ûYûyûcû&ûÅú…úäú û"ûHûtû”ûIûû9û…û´ûÒû·ûíûBüüñûïûPü©üÍüÏüëüöüËüäüaýËý«ý‹ýÎýHþoþ þþ_þ–þ¹þ³þßþÿCÿRÿ|ÿ½ÿºÿÊÿÍÿóÿ_‰—âÓÈÔ$V³ÊéMR# ]“µcnQUGp³÷ð@;0\ZÅìD·óƒ1gßA÷“X#U{ÃþîðݯŠ_T|…JÛ”ž±…Aö,XS5ý;.kh÷ë¸_S,ko Пb7„ˆF<óÿ—ÿ‚ÿ|ÿ†ÿŽÿŠÿgÿ9ÿªþ~þZþ)þ*þxþ›þ7þ¹ý}ý¢ýpýYý1ýýøü¸ü–ü¸üƒüüóûüKüjü[üUü]üüêûîû…ûûûhû»û¶û¡ûÂûÂû™û5ûHû¯ûÁû›ûNû6û?ûSû–ûïûïûsûTû}û{û—ûÞûYü“üMüü+üDüzühüLü^üŠü}üŒüËüý&ýíüæüÅüýzýµý»ý|ýbýyýäý*þdþ›þ’þ‘þ›þ¦þÑþÿ~ÿÑÿ¬ÿÿVÿrÿ—ÿ®ÿûk†(ˆ+\ùZZÅ${bøh+O¤5©¼²—~ƒŒ¼[`9ûØÔ¼ÌþS~ihŒ”so›ØÈÕ‡bP„¤¡±®kw@Ýßפ°›^jwEþÐ×Ì‘®É™r“kB ðÔûá¡fYâùÜ»ÄÌv˜ÿ\ÿFÿÿòþõþFÿFÿ ÿßþ—þ>þDþ3þþþýåý€ýXýkýCýPýyýšýDýíüëüÌüãüóüðüÜü¼ü€üSü(üAü9ü2ü4üüðûÓû¦û…ûpû`û…ûµû¾û±ûlûqûœû°ûWû_û£û–ûûmûŒû ûÌûü»ûžûûÙû*üüÿû½ûéûiüÈü½üÜü"ýÿüÁü¹ü×üöüÿü*ýcýzý„ý^ý5ý)ý3ýVý¢ý*þ…þvþyþ½þ§þhþnþúþoÿ|ÿXÿ@ÿÿÛþâþTÿÉÿ1€’†{pvÉ2VYOu€wÈîô.CŠºØãþEKuÀ€3MŒw`X|bZ§ÄàþÝë5< ʹ­y ;<5N6¸dsŸÜÉ|ÓÄëþ亅›\O¸wr…¦‡l’d%evRôÿ±ÿ­ÿ’ÿVÿ“ÿœÿZÿÿÐþÏþ„þ2þ'þ þþþþþ¿ýšý„ý†ýoýwýQý-ý\ýný/ýýÝü‡ü5üüüü]ünükü[ü3üü÷û9ü‚ü{üRü üôûýûüü@ü)üüûû*ü7ü$ü0ü üîûìûÚûÞûUüÔü÷üÙüoü.üü üAü‰üÃüýýãüÏüùü2ýcýšýÁýÆýÍý˜ý|ýàý-þ9þZþHþþäý4þ¨þ½þØþòþßþàþ)ÿoÿ™ÿµÿÔÿ¾ÿ£ÿËÿéÿ(‚jzºËê#WwkI†ÓÜÔïïôñUÈü¨|nH}Å×r+  X¹¾ŽÁ—Š£r·ºÏó3>ßüÉÚÛ¿»}.'BmE2àá(ïÀœ|U8HdP!%0É©ÇzK`ºÅp#×tonrvpbÌÿÐÿ²ÿÿ}ÿ]ÿ/ÿ ÿïþÐþþþ ÿÁþþoþ<þ þ6þ<þþ°ýŒý†ýqýoý—ýÊýôýÄýdýýöüÛü¸üâüõüßü¸ü üŽü¡üÐü¸üªüvü/ü?ü@ü$üîûáû@üxüküQümü{ü~ü©üü|ü˜ü”ülü>ü#üDüxü¸üÏüýü2ýAýý!ý ý$ýIýhýRýKýdý]ý|ý°ý¸ýËýÞýòýþöýÊýÖý7þ`þ7þ;þlþ|þƒþÊþÿ ÿÿFÿFÿRÿkÿ­ÿäÿüÿöÿëÿ3t«à"ä°¼ T”È ô ‘¼cPH& I|œŒœ–·ÖóOsbc\V,'"6ˆ…™çÒ—nz¡µ³ªÒÝ»v ؾÈþ/6Ö”‰…ìÔ¥µ¡a+.8(ññ뽤wSK{|_C.Ô†_D@;CUæÿºÿÃÿžÿdÿHÿXÿ)ÿÜþ·þ¶þàþÚþ·þ›þÉþ§þšþeþþøý2þZþ+þòý¶ýsýýý¨ýíý¼ýŠýrýYýÜüâü0ýQýpýmýLýáü«üütüÅü!ý!ýý%ýÿüdüçû!üNürü¯üÕüõüýëüœü}üœüÐüÉüÜü ý;ý^ý;ý ýýý ý;ý{ý¡ýý>ýý ýIýRý›ýÞýôýþ#þþ#þTþ?þjþvþIþgþuþ{þ¬þþþÿþ#ÿ]ÿtÿFÿÿ9ÿvÿìÿ!Ûÿzÿ¡ÿûÿŠáÂÅ¿‘fƒ³äD‡WQ˱×1X¾â”y]á2¯ ß¡ŠkªuukrRÚ¼Õô·«Ì´ÑøàŠ¢2:,KäMK—½«­¦U 3fC4!ìÃmcI?R/ ÿ)JLËŸ¥¨~YZ6 T=ùÿ¶ÿªÿˆÿ'ÿ"ÿ*ÿ*ÿ ÿ±þWþ[þgþ$þ-þBþmþNþ5þYþpþ=þþðýìýÿýäý‹ý‰ýªýýiýgýrýbýýýJýTý?ý:ýýéüýßüèüý]ýýýÍü–üŸüÌü÷üãüßüÊüü„ü«üäüýÏü¿ü ý3ýFýRýhý‹ýpýý/ý]ý—ýÐýèý÷ýÐý¨ýˆý¡ýãý9þ„þ©þ¼þƒþDþ8þ^þqþ”þwþeþzþ¢þäþ ÿAÿqÿXÿ>ÿAÿ^ÿrÿ“ÿåÿ S~€•ÊÑÏóûîù .?;:úM¶ëè ÞÍÚêóü)@lL"4@flz‚©¿ÎÏÍßûà50ÿøîÁ¤·ÞåÇ×誒\d–± †‚~M5?@;l[ãü ÞÊ»~]fYFI$ùÓúT-ü£Bþÿ 5 üÿÛÿ•ÿ[ÿxÿÿ›ÿ¥ÿ«ÿ<ÿÿþþÃþºþÅþÈþæþÚþpþdþjþDþPþoþXþ7þ6þþþÖýµý»ýØýþ/þ2þáý“ýqý‡ý”ýÅý²ýœýýKýúüïü'ýýCýzý«ý–ývýgýcý&ý3ýhýýkýhýuý•ý´ý¦ý–ývýHýýÜýãýäýþþÅý¾ýãýïýëýÒýôý*þpþ¦þºþ°þ‰þnþcþ­þÑþ»þ¶þùþ;ÿGÿÿóþÿcÿ¦ÿ³ÿãÿ÷ÿîÿæÿßÿöÿ CBU–ƒ†v[Ÿ4/SC81Bcg[_WJžÁ«±áðFœƒNE37C?t´Æ¢šµ¶Ôš`Žˆ,,[E@+GdŠ ™©r<þ_ˆp¸ïœOÁÀùM]5##ÿؾœŒ›šl"ëÏðäÈÅ™mSBKjx:Þÿ¼ÿ’ÿ’ÿÔÿÈÿªÿvÿfÿwÿ¹ÿÆÿcÿ4ÿÿÿÿÿ ÿÔþþ3þþþQþiþBþXþ#þÑý¤ý›ýœý­ýþ3þþþúýîý´ý¸ý™ý²ý¼ýÅý¹ýšýUýgý¨ýÎýìýäýµýyý¯ýÒý£ý‰ýœý—ý‡ý•ý©ýÛýþùýøýãýÇýŸýý˜ý¬ý¿ý¡ý›ýÜýþþEþSþiþŠþ‰þ^þyþ˜þ þŒþ·þßþ³þ’þ›þ¨þ¢þÿWÿbÿ„ÿšÿ—ÿ‚ÿ½ÿ ¼ÿuÿºÿüÿEgƒ]rZGn ax7!ÿå½õ&P«…]“zw¤á徊ªôìÏýü+KSm;   V‰càëûìþV‡5ʤ·Ÿ¢âäÎÏÕÞÖ¸®ÑÖxd795ÞÜ ?<T2ïÚìè¯L6;DF—–ÌÿÀÿŽÿaÿ€ÿxÿœÿõÿ¤ÿÿ ÿõþÜþÿþBÿsÿOÿýþžþhþ|þ“þ¬þëþ ÿÒþ”þ‘þpþSþjþ?þõýöý7þþ'þ:þ-þ þÎý­ý¥ýÆýßýþ þøý±ýƒý¬ýþþ×ýÇý›ýrýbýˆýÔýþøýËýÒýÂý¨ýÂý þOþ;þHþ+þüýþþ þ_þþrþ:þ0þWþyþzþŒþ¯þÔþ¤þŒþþ¤þŸþÀþÿ ÿÿÿ+ÿ2ÿ@ÿ6ÿ ÿ$ÿÿÿ"ÿlÿžÿÒÿ/;,ÞÿëÿäÿŸ°”ˆL|‚t¡ë.bo^TeI.=gya6O·ÚÓÁ‘YO’Û1û÷ÿ6l¥‹m?"Ðí+H'DdZsNWRUiŒe IGìéÒªat¢´ÎÙ¿ŸxetšsQ3ü³Ï%.\iQí¬±µÌÁ°³†2!!õÿëÿÿÿòÿèÿÁÿlÿ:ÿ#ÿjÿ ÿ™ÿŸÿ™ÿjÿQÿ-ÿ-ÿ$ÿúþÿ5ÿÿÉþ«þhþIþpþŸþÇþÍþ’þnþmþ†þþ˜þ‡þNþþþþ<þ_þŠþxþaþ7þóýþ4þ^þ„þ~þnþ þÛý¼ýÐýþþþþ þ*þ,þ2þUþxþþJþ/þ÷ý×ýýýTþ•þ{þoþþ¯þ§þtþþµþ¬þÑþ ÿ ÿ ÿEÿ%ÿÿÿÿÿ:ÿŠÿÉÿËÿéÿÝÿÿšÿ§ÿÉÿòÿ£ÿRÿÿ¨ÿÈÿC2DTen•sU{¢·íU“Ï®n2ïQs‡±²¦ÏÞ¯šÉ±ÄεÛ׳­œ`=½õ  ì²Ìòòçүļ æªu\í#$Ñ„”d8;hP*3ß“dB‘Ç¿âòº«“rP7-5üÿòÿöÿóÿåÿÈÿËÿüÿ .!Ïÿbÿ ÿÔþëþÿÿ!ÿÿÿâþ÷þÁþŒþ¨þÍþÐþÚþ ÿÿ°þ.þÏýàýþ>þ€þPþOþ=þ þ þ1þxþuþ>þ$þþþJþ]þ_þ[þIþ%þ þþ'þþþþþñýöýÙýþƒþÀþ­þ¢þ”þQþ(þ+þcþþ•þ˜þIþCþ9þþCþþžþ‰þ~þ©þ¬þ²þÿ9ÿÿóþÇþ­þÔþBÿÿÿ—ÿÿYÿXÿ{ÿ—ÿÂÿóÿìÿÃÿ¨ÿ²ÿÐÿS‡l$&I…¡¢„M3DKJ†Õ½ŸÅâé**0Hj}‰šoÅÚF†¦¹Þ¹“·Î$B?ê²u—©‘¨å©ƒ‡lq†—‡“ Œ©¼ˆ]nVZ{\Ef¦¥?Û Â#4VHȰœ®öøØsYBiU(úÿ÷ÿðÿïÿÜÿšÿwÿ€ÿmÿeÿUÿJÿvÿzÿÿ£ÿ†ÿVÿ\ÿIÿ3ÿÿÜþØþ-ÿtÿUÿÿåþßþîþ ÿÿéþÖþÌþ|þBþIþqþMþþYþkþ9þ1þþ þ^þ‰þeþ[þbþþÚýæýþþ"þIþDþUþ þßýÕýòý?þzþ…þtþ€þ@þGþfþpþuþŸþŠþMþþCþ™þËþ!ÿ3ÿñþ¹þuþþþŽþÌþÿþðþçþÖþ¤þ´þÿ;ÿ?ÿ1ÿYÿ¢ÿ•ÿhÿdÿeÿjÿ¯ÿìÿÐÿ´ÿÒÿA“ÎŒ+()'Ts–Ч£ÎðÀæå׸屦ß&Io= îüJ£–hM.F<=£à溵£“Y-X•jq‡ntyfE„Ç–hg=! $/!7[=3 Êøï*Z&«€~…“÷Äz„Œ ûÿ<’~;)åÿåÿáÿÎÿòÿÍÿmÿVÿMÿÿ¿ÿ³ÿ—ÿÿÿhÿDÿÿ+ÿ/ÿ ÿþþÿÛþ—þ{þŒþ¾þ ÿ+ÿ1ÿ.ÿúþÞþØþÄþËþÿÿåþ þˆþ„þsþ–þÀþßþÑþ|þTþrþgþ~þ‡þªþ¢þšþ|þkþ4þæýÏý þkþÇþÿ?ÿ ÿŽþ‰þ…þˆþÓþÿRÿEÿïþ§þ†þYþ²þÿ5ÿvÿ™ÿyÿbÿOÿ(ÿ7ÿ2ÿkÿˆÿ¯ÿ¡ÿhÿsÿ—ÿ–ÿÿ¦ÿªÿÆÿÇÿôÿ¾ÿ¬ÿºÿ®ÿÓÿ D[Q= >gy™•\V~¾NMê½Èê#& ý÷]™Ê¼¨gIWWlœ¡b9*u޾ñ¹–‘vnuK9EZœôæ‡ZbLcºÃÇã=)Wpb¹²µÆÙáúì¦pÁIJ›˜˜R:ZG7c¢ž„`îÿþÿþÿ4'Õÿ“ÿkÿ=ÿ0ÿ,ÿYÿ“ÿ£ÿ¯ÿÄÿŸÿ[ÿÿÿ:ÿ&ÿ ÿÞþÌþÙþßþõþþþÿìþÅþºþòþ0ÿÿêþËþµþàþñþºþ™þ•þ†þ£þ¹þ²þœþŽþ²þãþ²þ­þ´þ»þ¤þ|þbþ>þ†þþ_þ˜þÁþßþëþÐþÂþ·þ©þÍþîþñþÿÿÿÿãþˆþŒþëþÿ0ÿ›ÿ­ÿSÿÿðþñþÿ-ÿYÿŸÿÍÿ·ÿ±ÿ˜ÿÿvÿ¯ÿùÿ# Çÿ—ÿ‚ÿ”ÿÝÿ#sÚÏgàÿ£ÿ¡ÿÖÿCž¾™k`h`ƒ©ºÍÜþæÅÛÁ¨»*! óë@}H 1m¹ÜË¡Põ?@'dnUOpcl^N7#C`OE3yjÜÉÇ 9P],ò¯¤Ò3gþ¸e5>fŒ§y>94BT›{f%ãÿ´ÿäÿùÿüÿöÿÞÿ¿ÿÓÿ¼ÿ›ÿªÿàÿ¸ÿ¡ÿ™ÿÿaÿ]ÿÿ™ÿzÿ~ÿUÿOÿCÿ9ÿ!ÿÿ?ÿCÿ ÿâþ ÿÞþþ‡þ–þ¨þÙþÿÿüþÿÿÒþ¤þÇþÎþÜþÛþÿèþÉþÊþÚþÁþ”þ}þ¥þ´þˆþxþ•þºþÁþ¹þ»þ þqþXþþ–þœþîþÿèþÔþ¬þšþ¸þÈþ¨þ¬þÈþðþMÿRÿ.ÿáþÝþèþØþÿrÿ®ÿ¿ÿ¯ÿOÿ4ÿ9ÿ'ÿBÿ{ÿ¸ÿ×ÿ¨ÿ‰ÿ¡ÿôÿ öÿèÿ÷ÿÎÿ·ÿÙÿ3:Íÿ®ÿÄÿÁÿßÿ1§Ö¨F7fƒ‘Øû®•Œ³Íìêæü  9IV‰Uݳ¹)>6Éæ! -A4/þäûôar\/=$ýþ,RЏŠ+óÙÇ]<Ô±|V„Å ö×Ö‘äÿóÿH§ÏÐÏAëÿãÿáÿf_ÛÿµÿÄÿýÿ,(*øÿˆÿhÿ„ÿVÿXÿ{ÿÿÿ¥ÿÀÿ¸ÿ“ÿŠÿbÿ1ÿFÿPÿ^ÿ.ÿÿ9ÿÿ×þÿÿìþ ÿ ÿÿùþ ÿÿáþ¿þõþîþÆþºþ±þ¦þºþÊþ®þÔþñþ¸þ`þvþ˜þÖþ;ÿjÿWÿùþ¥þŸþÔþöþóþùþ ÿ-ÿõþ¿þ¯þßþýþêþÿüþÙþóþ ÿ8ÿ&ÿXÿ^ÿ&ÿöþ"ÿÿÿþJÿ{ÿ2ÿ+ÿkÿ«ÿÏÿÙÿ´ÿÿgÿjÿÿ³ÿöÿ59ôÿ×ÿ÷ÿïÿÔÿ úÿÃÿÇÿÚÿH€L4g{C>¤ÀËÀ¶^Ÿ¶µãõÏ•“‘Óíî?N7$Ƚô 1rŸy-  J„¥¥ˆVïðÂ~¾u~p?.ëô&÷ºèñÆÖÌŒ¬Îåõ×Ê ¢¶¿Éªz[‡÷óûМˆjl^5öÿÕÿêÿïÿÇÿ óÿÞÿ¦ÿ˜ÿ¼ÿÏÿ¶ÿ¡ÿ”ÿ‘ÿ‘ÿ~ÿËÿ!éÿ¡ÿ¦ÿ·ÿÆÿíÿØÿ•ÿbÿÿÞþúþ ÿ/ÿmÿUÿeÿ`ÿ9ÿ<ÿ/ÿÿüþéþõþøþðþùþÙþÐþÔþÜþ×þäþíþþþ ÿÿþ(ÿMÿÿÇþºþðþÿÿ$ÿJÿ7ÿÿýþÞþ ÿýþÿùþÿ]ÿšÿœÿkÿÿùþ<ÿ.ÿPÿwÿ`ÿSÿ?ÿ$ÿÿãþ!ÿ½ÿ+<Êÿ§ÿyÿÿ7ÿgÿ ÿÛÿïÿñÿÌÿ¤ÿÿœÿ¹ÿSY)"D[PspX@q𴯝m\£Ù ýâ½ØíÂÓݧ‰—Ïö 6<7+! ö ³Îú%IZIôê ÛÎø7{ƯYðÂÒ&L< òæÝ %Á¦âëÆ–LMPI‚_gš|KN/:SL0J ýÿ4bm'¸ÿ¿ÿõÿóÿÖÿÈÿ´ÿmÿlÿÿ¢ÿˆÿ{ÿfÿÿ‹ÿ˜ÿwÿ7ÿÿòþýþ ÿ6ÿùþëþïþþþØþ¿þ-ÿ–ÿbÿ!ÿÿéþÑþÿ]ÿVÿ?ÿÿ ÿ3ÿFÿ=ÿÿþþÿÿ'ÿ5ÿAÿ8ÿ&ÿÿ¬þ•þ{þ_þ£þ&ÿWÿdÿQÿæþ®þ“þ³þ¤þÇþ÷þüþBÿ ÿóþæþþþÿÿ:ÿ=ÿNÿRÿ<ÿKÿEÿ@ÿ=ÿRÿrÿžÿ¿ÿÆÿÔÿ½ÿ¬ÿ­ÿÉÿÏÿëÿÿÿÀÿfÿLÿNÿQÿxÿªÿ²ÿÁÿaÿBÿ‘ÿÎÿ¾ÿ1n9ùÿ¾ÿ—Éë°m¤ª¦¹‹g@"†Èº®ÍÏ´ªÎïµW8D\=H:fºß<ƒ4»••ƒã(÷Ï“Q0uæFjSèx7#W´Íͪ˜›ŒvTincœÔÍŒ9ñÿÇÿÒÿ u¿Œ&þÿèÿþÿD^»ÿ˜ÿlÿYÿ‹ÿªÿÇÿÒÿ¬ÿÿ•ÿÚÿòÿd)šÿ_ÿbÿÿ—ÿ™ÿ|ÿsÿiÿ?ÿ ÿóþ&ÿ)ÿjÿ§ÿ~ÿ4ÿ8ÿLÿVÿ*ÿÿ ÿÿ2ÿ(ÿÿÿòþðþÿmÿuÿDÿÿãþ³þþ«þÿ`ÿÿLÿ ÿªþ]þdþžþ+ÿ\ÿWÿÿÐþÿSÿXÿOÿRÿ"ÿ!ÿÿ ÿVÿ}ÿWÿWÿBÿ-ÿÿ ÿLÿeÿkÿšÿuÿ0ÿÿ(ÿMÿhÿ…ÿ·ÿŽÿmÿÿÿ©ÿ”ÿÀÿóÿîÿóÿÿÿÖÿãÿ V’Aæÿ 5ZR_'zvVoˆŠrE/DPM_sp~Ÿ¦«¢—³Ñò2)ÿÆ£ÁEYi<-øû+Vdb%×—zÖBFïÞ˜‘ÂÔ¿D0æ¹°³–©åæó èÜÖò/ù»„"H\o†…VJD TY6ECDtr7ûÿÕÿ·ÿ¼ÿóÿúÿÐÿÍÿøÿòÿíÿýÿ÷ÿãÿÕÿðÿÙÿÿ|ÿoÿ‚ÿhÿPÿ=ÿ\ÿ•ÿÇÿ¾ÿƒÿuÿdÿ+ÿÿWÿ]ÿÿ/ÿ[ÿ‚ÿ…ÿ`ÿgÿ”ÿ{ÿNÿJÿrÿuÿ-ÿþþìþÿÓþßþwÿ¹ÿnÿJÿÿìþÿÿ<ÿÿÞÿšÿ(ÿÿÿ%ÿ:ÿQÿ_ÿÿ¾ÿ–ÿ‰ÿ‰ÿ›ÿ§ÿ¢ÿÿŽÿÌÿîÿÌÿœÿžÿ®ÿÊÿæÿ þÿ«ÿ:ÿÿ7ÿµÿ# Áÿ¤ÿËÿüÿîÿßÿ ßÿÂÿÈÿUT\K<'KÕéëÚº¤†~›¼¹«O;´×ôú·pFz©Ëòû¿tYg‡†ˆÁúÿû»agnustep-gui-0.24.0/Sounds/Hero.wav0000664000076500007650000015451411240162532016637 0ustar brains99brains99RIFFDÙWAVEfmt D¬ˆXdata ÙRÿXÿ\ÿjÿzÿžÿ©ÿÿuÿfÿÿ©ÿ±ÿvÿzÿ“ÿ†ÿfÿzÿÿvÿYÿaÿrÿ{ÿšÿ—ÿÿKÿÿíþ6ÿuÿlÿ`ÿeÿ_ÿ‚ÿšÿ„ÿ§ÿòÿ¾ÿ´ÿÁÿøÿ7Enp³ÿÅÿöÿ+\fNHîÿÿÿo·–ˆLÓÿºÿÂÿÎÿÌÿÅÿÇÿÌÿÕÿ½ÿ´ÿÃÿÕÿÏÿ¹ÿêÿDu{Q$',@‚™N ÒÿÄÿCŸÓÕâåól’yhOôËã1f&ª Ìÿ¡ÿ²ÿÞÿ×ÿ´ÿ~ÿ„ÿ”ÿ°ÿZSþÿvÿ7ÿMÿ=ÿ<ÿÿ¤þDþ6þ þþƒþëþ2ÿDÿgÿŠÿ»ÿñÿ$V[6‘.·ø 8Aþ›+ IOb•Üh)Þ.í67‘vtA {þÿØÿÝÿïÿùÿÝÿ›ÿžÿ²ÿ"6-ƒXέŸÀáõñåÔÞ,»O°Õòàï6ž?- øì˘"˜(“%Ú™*“ÿ:ÿ7ÿhÿ”ÿ€ÿ6ÿçþÒþöþÿ=ÿÿ þÛü¼ûâú¾ú?ûüØübýðýKþ¡þ]ÿA¯ÏʵžŸ'ùµ,ƒtãsÙ"-–ñÈß ·¥ šŽ¿zðÿ’þýý ýXýÅýþ³þKÿ71殬ÿŸýDýöýAÿ5¬•áÿÿFÿ¡Y¡º·#©%åµµq|85l†S|%üÿjÿ<ÿgÿwÿýþãý²ü¡ûòúòú_ûõûƒü|üÑûcûHû±ú«ù_ø÷Wö9ö–öJ÷Cø?ù>ú ûüýþûþªÿ%SF†]!¿ÛŠ÷:êJðÝË[˜æ¤³Ç, vÚÌbž5ŒôœòHÿÃý€ü˜û û§úVúlúÔûõý Bî¯ÿ'þÆü¦übý÷ýþÍývýMýÕý$ÿ¸ûÚ4C;äVéqÌVJô‹IÐ[—¡æöDgâþÅü‡ûçúSúëù`ùDø÷=ö³öø‡úþûhü"ûø_ô{ñbð|ð«ñóÙô+õ¹ô€ôgõƒ÷WúÄü}ýçüüìû‚ýu‹¿²qR!k„ñ_¾Ñ|4_" c öÅÕó; ß K 8WMýÇûdûûçùdø1÷èö øÏúpýŽþõý½ûÁø÷Jø“ûiðÉ9þKûÊúýDÄâÿØýšýúÿdâ„ È U ›S2f† ú?¸þ‹ýfüFú^÷ÿôõóœôeöÇø8ûªüêüxüMû–ùK÷Côpð–ìÙéðè”êüí°ñõîöñööõyôÂôöÊ÷íùÉü"ÆÂ!ü>jZIþIýþý_wíG ~ ” U l+« ô ˜ Ì Q ç ºÆ±<ÊAHÿbýžýìÿ«Õ»ýêøVõ½ôýöú#ünüvû%û“üÛÿ¥k«ÁþÆøÝô1õ,ùùþù˜Í ½ JÛ õ,úa< «{”ÿ[üìûiý8ÿŠÿþâû!úÎùØúÍûåúä÷?ôZñçïŒðlò¡óóˆòñ"ðÏðò#ôIôóúð¿îpî’ðõvúèþB‘J;‚·ðâ×õþ4ÿI=Òõ8ô¿Ò Ì ]¼±CË£‚Å œ é f4~¯Îÿÿ¯ÿ>ì›bO­ex£2þüêúýúäûý¦þöÿ±ÿgýû úÀú.ýva>‡O û ±S °ëì†0KþÂü‹üíüõü-üîúëù ù\úŒû°ûÉù‹öáò’ï’íOíÎíÓíí:ì÷ë)íðôæ÷*úúùä÷õõò»ò©ôøýlù µÿ[ r¸hÅý9þ© µ9Â"è] X ½ç=wSÝ—,û óDÿ<¸ˆéËÿ½þÁ#†œè ú*ö~öaûÊe?=Qÿèûµû]þ;GLÕèË”m # F †‹$)Ž Á ¥   %9ãþ2þKÿÔÿ þèùïô©ñÝñëõû%ÿWÿ‚üñøIö¡õiöÙõsòúìuç»ã¥ãvçíeón÷kù¸ùPùÊùëûÿà þÝT€ÿÿóÿÿVýüËû¶ý6 ¦ î  – Î Ü Ûm*{ Á šñj|ƒù3žQ V d ˜ ÿ î Ä£O”9ÿ¢úÍ÷Ú÷*û_Z6Y·êgþÿÿìýýþ7¢  „ ¤ æ½4»øjÉÑØî,3~&ºUüì÷Sõ•õoøZüœþ*þ¶ûøöþôûôÓôÔò»îÛé*æœåhé„ðøñü ýRúõñrð}ó¼øÍý—Y2þü(û4ü þiÿÓÿ-ÿ(þ%þßÿü' 1 $ ‹ã‰À5 à M X ñòF ž|óùþàüŽþµ† ©8@h Yþ_úàö²õ®÷œü( † ¦ H ƹàü9û‡ü¢ÿ.kËJ, ! ” I PBnþ/þÑþ¢ÿ[ÅÁ›Õþ«ü…üåý©ÿ#¼ýùgô(òóóôÔôñ¡ê«ãêßÕáèpñBøû´úJùYù2üÎÿO×ÿ?ü‚øåöù÷ãú™ý•þÞýüCú¹ùÒúüÎýþiþâž à E îZÞKvÑþpý÷ü)ýÈý}þÂÿ z² ‰v´ÓZ@ ’"aýOøºósñ=óÊøØÿºš ¾ ½ ! a ~ ûæýÁú üÉ@¯ Ü éùÚPrô²0ÿÆù´öü÷ŠýqÅýƒù‰ùÇû¨ý›ü>ø4òˆìÕé ëÜîó­ö÷5õÑòEòGôÓ÷Ðú7û—øôRï}ìòìþïÛó‘÷dúwü}þ©g n¾þ™üûDùööµõˆöfù¢ým6ÝAëÿ$†¸.ýùöã÷6ý$ ¤ 2 Gø8BXì ÔÂÄ‹ È5Ó Z{¢ êHÆG>þþ W\ V F @Bž²¦h¼OÞûŒ¬Œÿýù‘÷ôùâÿ•-þŽ÷0ô3õsø¾ú„ùëô]ïœëpì+òVú@®¿ªù“ñQì4ì™ðùöÀûAü>øòHíÌìgñ…ø]þ10þ?úNøÆúr ¾¬ 4ŽüÔö-õäö%ù¤ù×÷õtô—÷Ýý߃ ] ?ƒü#ö¶ô¾øàè @š‰ÿsþ+x¢¤Ê‘ü”ûÿc3J\ÂÉ ÈÜ š O÷ ?@íÿCë; Ô 6Ñš p 1 „  „¼ÿ›þþ&þÅþ9ÿÚÿ6ªÿÅþƒý üùù©÷°õÿókò[ñ.ñ¬ñòõ‰ù)þêÒþ¦ú÷õ„ò×ðZðQðð±ï¸ï§ð@ó‹÷îü~Œ ð¹oÂþ8Ÿº Â Ú  VûÁøÏøú^úLù˜÷²öNø¸üÃØé¡ÿ”ú‹÷Tø=ü¦ü“ÕýUýþJ†©þ“û<ùú ÿÚ#n¢æž ˆ¶ Š ‚{ h ›_í ' ¢6 tû"Æ€ B£© lÖüˆúˆüE7Mû‡÷ù÷½ý« ‡ ´âúeïEèÆæ¿éŒîáòêõ±÷ïùƒýªK@û²òdì¢êOíµò,øxûTüýûMü[þ}{—ÒEþìþ' ü÷S ¡úþÿ²þ²ühùvöˆõO÷µú‹ýîýsûz÷®ô õZúß1+@ýeùþ÷ÀøÒúlücüSûû¤ýò »›6¾}[ ­øÃ6‹¢ 7–=Ï&ÿUüÏÿÉ— ï6À ¨áÿ~ÿÊbëhÿçü)ý”ùãð^ê9çåçëýîòúósõJ÷%úšýTãÿþ#û‹öóòBõ…ù€ýíþÊüøhó·ñ(ôùðý ¼;Ê…û qFF… Àc(•{fý÷UóÖò+ô­ôòò~ï³ìéíôýÅá Ž Ì?ÿœù=ö_ôXòÍîNêç&èpïiüå Àv¼ƒ) p 9gN‘õ.g«F Oÿ4ÿl(O¬\Ê Høq & 8‡þÎõ5ò)öÿ§ Ôú.í™å¨æöígõ;øŒôãìðæ]ç¤ï0ü5_  ô†èä¡èóHý‡­ý¸ô5íùëÁòÈþ¡ #Ý z’ú¾÷µû1~u N âÿú÷¦÷6ÿ¾ WµÈ ÉÖøöõó÷UûzûØõÎëRânßæ5õYîî– ü†ñìí_ðèóÁó®îëçdåDë~ù: ´Gƒ &ÿýsÝÙAêú# úv!#mY Ãÿúªþ$ g¢i ÊüÏôºõEýCŽ ñ‡ü@üGa v `þ_ìÞâØ+ÝUæ›îòzðûìæë¢ïçö:ý(ÿYûó–ì©ê}îÆõÖüêÿúýPù‘ô òšòªõ^ùøüEÿüÿébòå& €ðå ú.z$  ÷ªwûzö‹óò•ñ,ñdï·íUî˜òûùÕeeýóóPìßè^é]ëÇì¢ìì¬íKóýܲzH É3„•Ÿb¦b(_^*ÿ!þ)nº¨L z‚ƒþ[õ[î“î0÷fÛÅÍT¿ó”åWÞâÞã)å²ã¦à›ÞÛàèòêúŠþâûÅõåïIîió©üæÄŒ2ûN÷—ö÷uø6øáö®ôô^÷³þÔA1§÷… à œâÛ  1ÿ~ôøíÀìÉíäírëç’äxçéï½û—Œ Û KÿúWô[ð&î ìœéeçâæˆèÔìˆóû½á£R% 3" *`,)Œ"y“a Ÿ  y} è Šû @©[Õä ýJû‘ü&¬ž ~{òþíùÇöˆôµñÆíTé{å¿ã>åEéîñçð(îð锿ç2ì*ôvû¼ÿ$ã+8ŽVPHú¯òîtîzówúÁÿ[~þåÿ ã%X ˆÒLG 2Xüiö…ñÝí$ëjézé˜ëðFöäûJÿ·ÿSþyüû¶úúÅ÷•ó=î-êÏèÄéyìKðô^÷úbü"ÿ‘ă @ð!.%«')(>&f!ÙÚäDbJ 7ÕAê  ­­¯w Ãeu® ¸ %ÚúNï‰æ*ãéäðèrëÍê›èôç ëÏòüËtÇ÷ì|äAåµì"öäûRû|ö°ò™ô0ü<v ÑþÞóJíYï‹ùiö K :  p‡+S3ñ. fÏhûµû“þîþVúÀòÉí™ï†ø´Ð  cÿïGâ‚ßùæœóXþž9ýàô4î îlótùcûåõ&ë‘àŠÛ”àï:û0`"G ®š²‚#G&P$Ë…%ó ¹†ïÌWÿ¤ûþ Œ©$¹%cÞIš¢¶êüÀø‚øØújý;ý(øÙîÈãÛÀ×YÚ|áâê7óø4ùøg÷„ø7û¤þJ7týh÷ëñ×î)ïªò¿÷Vû´ûcùáõ¸óTõ¥ú2o ?‰€ñö#0%ý ä*<Í÷þûfõ¿ð‘ï±ñjõkøøôæî†ì³ïm÷<GÔ^`ø—ðí¾í{ï¾îgêÖäýà"âÆéºõl îhUîe'9.¯.O(ÄíDÙ¯l¸NûJ÷ƒû=¯Cönÿrõ ·Bí¯ýçþ®®5úóëÙ”ÊÅÕÌ™Ü:íŒùêþuýhùòöøbünrü²ôƒìyèoêñAùæÿÐ&¨üÉ÷nóðïÓí ífíÍï ö¨Ü¾*]1£0ü)z ‘ üýöÇð…îâïåóƒø[üTþþaüÕúIûµþ·lAýüðáå#à^àwäÈè.ënëëíñòÃûÒ“:ÿ²ù÷ù2¯ üÃ1™žJ#÷(œ)}"[™ú¹ùŸ ì0X Ç’* ¦K2Õî  Q ¨ * ðÿüïàÈÕÚÓŸÙ@ãWëiï¢ðòÙö˜þºXÛMù®íãæÆçcîöCùhôêáŸßès÷´”Àûœì²álâyï81Ë â» Áß µ'F%²OÙ æ¯°Òø²í&ç0è¿ïTùÿÿ`·þ ûûù[üàÿ·EûãïJâ6ØÀÖÝ„çïØðÕìIç)åaé>ô"ã ø-å M ¶ ”â_)Œ*º!ò}ãÁ”\ùeùÞöF5”°cfÛošh!®#MCŒîõâÐã¹íž÷‚ùãðbâØuÙè«þ°“¹ÿ™î¸åIçðºøúÎñ:ã֖Ҍܣï\  rûêë¶âwãgíýúoÛæÛü ö ø¡Ùþ&×dÑÚ.í² ` Ĉ¡5ƒ'œ6ë9«/å ©ÿý¿ÿÿiÿÎøìòÒò²ú"T¤ =ýðñî óèú+þOúrñ€éçgêŒñŒ÷ ÷ïÂäÝ܇ÛïàCêaó|ùý†¹„ ‘¼!Ï).ÿ, &MUrx ; H¡ © JéBS~S C…ÓÇ»°QÏbKL ð‹ûÏôûï¬ìÜê-êÔéëºî¿ó6ùµý’ÿVþûùˆù±ûƒýü÷õ¢ìHãÞPÞ°âÊçê-èã‡ÞåßC顸ÑºÛ e.«9;;ö1ë ÿ ûfîºç°å'æèuì*ô;ÿÇ N¤ O uH ?ûû5÷DóÇî6ê¨ædå!ç¹étêiçfáìÛÏÚ¥à ì/ù¶q¾`¸#|-V-u#v' 3 –’·lø©ø5óÎ÷çL¯#Ý#h$±(1m89 .ÇèÓô ð:öÿ¼ýÂ÷ÅìPæäæîÑöøûDú¸òÁê‰ç|êiòkú4þpû óØé€ã ãwç¨ìÄî3ë ã˜ÛÙqÝ–ç»ó!þÁé%I #{™^`Öä0¦: Ü”,€JÎz?pþŽüÅûÖûòû=ûAù¿ö¶ôkôžö±ùæúš÷üîã¥×ÿÐPÑnØŸãîôLõšô…öþ„ 6"#Á ‘† wéTÉÏ Lø ö# "Öåè k&ø)x'ž~ H µT§m ãþöñ¹îíÓéYäÅÞ‚Û3Ü2àå éªêºéÝçìå·ä;åç=ékê)êéèÐçBéì:ðGò€òò=ò‚ô}ùÕçzÂ10o Ã% (%Y¨ºýÏ1 f ¸Ëþ¢ô0ð%ôLý¼XûQíçâUáèè õõþæù-íUáÛj݈ã\è“èPä­Þ”ÜBáÛë­øÄc´F“* ßá#°*w+«'6#g!°#ƒ(ê+å*²$G…M#.–5F4e*ób ñ šiÒ9/ ÿú÷úþªý;ó‰ß§È£·Ü³o¾÷Ñ%åï|ìÔàÔ³ÎËÓ¯àÝííò~ìÚÝ&Ð$Í(Ø íž² dîøQë é‰õÞ 8!N+Œ&ÿ³ ´ }S-S:˜7²%#aþÝþ– A$âzñèíב×ýäZöãÿWû«ì¿Ý]ØEàÏïÈü1þ¿ñ[ÝëÊUÂ+Ç>ÖEçRòXó íYæáåîÎü1 ƒ ÀÔü°öšüT¡(¥=E¦>Z0Ï%#&Z0°vC©@ÿ:’7;:MBKöP&P‡JèC?Ë<;Š7ä0…'7ᓪ%U-=1!/‹'Ng M±ýÙð¬à¦Ï\Áþ¸é¶¹²¼¿À¨¿…¿žÀWÃŠÆ¼ÈøÈÅÇuÇlÊ€ÒqßÒîgüტýÇöÒó÷©ÿ7 ­*Ô‘!+°5Ž=­?æ:Û14)‰%'‡+Ê+2$B¨ÿíÿá#à×ãXçNæzà÷ÙF×ðÚøâmééXàðÒ’Ça ÄWÊkÑÍ×b݈âžè9ïŽô$÷˜öõ—ô•ö¸ûw [!E*‹2²8 <ì<;=å>ôB2JÜRŠY‡ZGTïH!<œ0Ì(%]$•%ƒ')œ)Ä)u)4(M%¾É?ð àîÔCÏmÍüÌøË;ÉÅnÀ¿»ˆ·¯´R³~²±£¯¥¯>³ž¼kÌ`àsó=ç½ÿùlõù÷Nõ åß±¶ ¬Ào%Ó+.Ç-˜-ð/5¡:ç<78º+  ¡ü-ö•ô±ó ðÎèsßMØ"Ö×ÿذÖÎ/Áд…¯aµÅ Ù2é&ðàíSçIãäå í õö÷òmçŒßYà[ë—ü… ,¹‚ç!ó,6?¨RL`(dÌ^ÄT>L“H HGGèBU:0*Ð)./07=„-DàKeQ½QðLEq><'>ŸAˆC6B>=6ó/ç-H0þ3™4ó/j&µ8Ë  ~ý&ï#ßҺˬ˼ÍHÍðÆ´º­s£©¡¨²²‡¼ÉÁ²Áú¿Í ÎÔß ñ]úŸøªîä'âêªù# ÷Jt' ãç$ 1)5¦0e'§Ê%ï-I3Å0˜&Kñ ;©RûüëîfßíÒYÍ+ΦÑÇÒLÍ0Â)¶K¯Š±(¼?ËgØ3ÝìÙÕÕ_ÝKìƒûh¨÷qîíõØ',n÷ÅÄ&p5cFëS»Y’VYN8GêD HMšPTOˆIÀ@8î1/Ð.Ô-Ç)"¥”Ö Á û & æúújï•ãNØ+Î%Æ·¿ùº¸¤¶·¹X¼$ÀâÃÇbÉâÉ2ÉÊ¼Í Ô«ÛÔâèùëyðöŠþ´Ñ”MµÑ«ê%ƒ,01n2­/*¸"Yýßð1xêˆVýÃúº÷õñ¨è&ÜÐÎUÅVÂÅ«ÉæÊ¹ÅQ»8±I®•¶-È/ÜFëèñ ñêí„í_ñ÷”ûáüóû†û©ý€Eæ´-…9_@fB?@L„9Q2*­!ÿ¡\h ÌÓ8Åøîâô×:Ò]ÑÓÒ„Ó^ÐCÈÙ½«µv³á·éÀ_ËÔ{×ŸÕ ÑÈÍSÏêÕ—ßSéòï_ó°õù¦„ Aa´*¤Gµà#æ(†*{(¬$Y!¢ÅRÍW¯ Œ4gpŸÕünõTëðà·Ø#ÓnÏÌ ÉÄœ½Æ·=µC¸ÁÒÎÌÛå$éé&è¯éºïsùô* o¯ r ‚ ãQó(À1421G-4,G/Ô4Œ9È;™<Ý=Ò@FŠL‹QFR^N Gí>ñ762š,À$v¼ º¡ûûàþ䓵Púhð›çŠâOá\á6ß!Ø›ÌÁuºf»™ÁéÈáÌzË`ÆwÁ¶ÁÔÉ=Ø9è,õÄüМ‰5М½6 ·Ú$n/È3£1t+s%,"b ‡Àw"ý$úùýÝ? ÷Û •þïÄáJÚ!ØS×#ÔPÌëÁA¹¥µi¹=ÃSÎìÕRØÊ׵ػÞWëÊû ÿëm ¬Žø#õKøëÿM 5·–…&°0Y;9B!C6>i6B0ž.y3”= I5QðR\N/F>Ÿ8Ù5Þ2,Û´ <÷žíðòû ‚£ì˜õOéäÁå'êšë0æ(ÚùËÁŒ¾¤Â‹É¥ÍÞËðÅJÀT¿Å3Ó³ä õ[%O;û¸ø,ùGü»…a!º(Î*å%Š ô‘ O»ôý=bã8 óMá•ØnÙ=Þ‰ßeØÊM»ß³O¸ÆÓÕàBá Ü9×_ÙKäGôr%²+øõðvñOúÜ€VAt‹ÕÔ$+}/â0]/H,*^,œ2—;×BÙDA:Ç3[1f24p3£.%?w< ÉÈ(Urÿ’ú[ø=ù¾ú¿øÂðúã×`Î7ËuÌNÏýÐ}ЩÎ&ÎúÐt×àÂèôìöëñæàrÜÂÜåáêò¸úØ‹”• «…4¾„DŒfä hNë )ÿ*ø«÷!üÙ²‹ùŠóó¯÷Tüòúßï ݃ɞ½-¾eÉñ×gáœà2×GÌVÈêÏàÉñýˆý‹õ>ì•éÔñ‹‹( k!¡) D ;†{%Ò&÷#z!]#*`28 8w3Õ.å- 29>d>”8E/-&Œ ”ä Éuú¬ïÝêHî®÷ãàÜÇûùíâ‹ÜöÝäâ€æ”ä.Ü Ñ¯ÈlÇ?ÎAÙÆâqæHãÙÜ|Ø®Ùxàõé^ò öhö@ô ó†ô#ùÒšé³l”X†VYd víøö·÷eüÁÁ{˜ÿ…ü®ûYû~ù;ôuë’àýÖCÒòÒ7Öé×úÕ@Ñ[Í-ÎøÔ­ßùêÛò¾ôƒòCð^ñ÷Eÿ¡z » n ƒ dìì'Ž(í œ L 1Î*¢/º-Ï)a)T/i9A.Aá8ç+ë ‘ £'í+z(T ˜ûtóRôMûž¯´úÁðÞéXêò$ü3üîüÛZÍ®Ç?ÌW×·áÂå ãÕÜëØªÚá(êÄï7ï¨é&ãhàtå™ò/MKÝ33òb S; ©Éû)üN[¤ ÚÍý>ö¹ôwûGЬ¦3ôtçcá5àÑß•ÜgÕkÌ ÆüŚͅÚcèÏòu÷·öEó=ñÐóFúbæRMZ »„ª] ƈ kð$A&^"„›%Ô0;Œ>Ù9…0«(s&*!13=,å5 Ñ·ü}ÿ¤C>üöñôùWÿ`‰úïÜãòÜÍÛLÞNáGâÜàßPßµâÅçëÜé½ä%Þ}ÙhÙ=Þæ ð£øëÿ'ó BÕôq Èÿ¥ú˜÷¹÷*ü\ †" Õ?ýQývÌ Ë¤  ƒ£ù}ó î³èpâiÛ«ÔaÐîÏúÓøÛäÌê¸ííŽëìëˆðÁù ª H À Ù r yCøðEðöú‡ "ü1¸9æ8*3×-Š,//Ï23 .Œ%­·® €(Q.ð,¢"Há—ý ÿT^ >ÿ_øø?ýÐÓ¦ÿ7ó æcÝE܇áè°ê*ç ßÏÖÒ¬Ó+Ú âÝèíìï¾ñMöóü⯠FÒ ìùÊñxìë¿ícóƒúcÔ ©B¥ ޚ̪T h£ @ ê 2•ýï£á{×çÓ=×NÞOäæ—ã}àgá(èóÐýÖŸÿë÷ ñ…ïªô™ýpÕúýP÷¹ô×ööû„¾¹e Táý$ì-_2Ž0)è ¼#ÇëÐ%r,Z01y.*}%>!—׫À Rاö ‡û“ô)ñ~ñÂóMõ;ô4ð;êpä3áëàPâ ãÇá`ߠ݃ÝOßðáäŠå@ç*ë>ò°úcý2õ²í@ëRðUû%¹wÙK _ß#dªfß¡¯=kà r¦ûãõ[ôjõõ×ð—èCÞ¥ÖÖ£ÝÖéõú^ø°ðeèa便Âì‘ò/õþó´ñò:÷ž  Hl.BøÇíÕë¨õbp*ã,,'¤Ìï! #¶Š.´Â6.±:ûèö îäã„Ûž×pײ×ÎÕûÐýÊyÇhÉ€ÒáLñoþû´ózð—ò|ø¾ÿu Ä   ½ rØ%Í O_)stâi–;jôë¢çÞèyë%ì?éOäôà2á³ã½åèägà ÛGÙu݈ç ó>û ýžø<ò†îªïÅôúDüBú“õ@óÞö;ý ßN€ „{@ §-p:¯>*;Ì4Û0Ô0Î3þ5*3ž)N Yí 4Ë.s ­0¦Ø#ürõžñ·òc÷ýúïø"ð âƒÖ¹Ð”ÑÕÖ?ܹÝÛåÖAÕ¨ØUà|éqðÅó­ó†ñ¾ðdô’üj?0êš{ ä“=Éë§€ _¬K–ê×qÌ’ õ¯û\öìï4é•ãmààáOâvá½ÝÐØ×Ô‰ÕîÛ-åSíîð‰ï2ì&ëï ÷âþª$ý.ô¥ì¸ë%ó©ÿ“ JÇ  ûªü/×(Æ4‚9Y8e5›4;74;×^™|A Õ X]Ó 4YUÿ^û.õííEæßÈØáÔ#ÔSÖ¨ÚUßCã‰å,æ9æç¿èÓêì}ì.íºï@ôsù,ý/þOýPüŒü­ýKþhüÍ÷ó7ó“ü.§&,;ÔE‚E>é5õ1C2H3_1Í*¸!¾™ #Î#9 ûVÅ6  äÿªüÎûŒüRüù4òoéµáÝÜ,Þ7àß3ÚÔ¶ÏÆÏTÕ[Þææ‘ëì¥ëEï©ù‘ »<#Ø!úïyûQöŽùnð Ù=ÎŽâñj åëÌ 2Á“ ­,|þXóRéãÉßåÜ/Ù¤Ô.Ð\ÎÐÕ[ÚBÞFßßâPèêñ¤üC”ýQönòÍó:øüü÷îïåëÙïýA·#ì0%4<.%ò€!N( 084á31#/ç/Î294ä0\(*ªV am­¾¶ Q ‹ú ó'ýiôí)éºå!áÐÚ™ÓrÍËÖÌQÑâÕ¥ØwÙõÚ«àxë}ùLÉ`eÎ Æ )ê !ÉU µº0$­$Æ  )) ÀµL¶' åHþzÿPË÷oåÑ…ÃNÁ ˔ڹçÂì¯çoÜÓÅÐׯâPíãñÊïðéÅåæçàïùùƒÎÿžù¸òªð^öc< ,6 j mO"¬!ùNÕ"¯,Ø7Ã>5>7a-Ú%U"[! ŽÂ¸¼¦×§æ½lvS÷4ï†ì|ë¼èŸâøÙùÒ-ÑÖânî›ö¢ö<í;ߎÓ<ÐðÖ:ädòÑûÐýaúèöèøOOŒÜ# [m Ê+ RK ãœüèùEAJ$]+”%jÜÀþÓÿ; ˜cî`ÖáᾉÇÛפæKì¡æÜÙÔÍÕ“Þúè íÂçÞÜ7ÔšÕÙãÇù8 ŠƒÿóâvÛ‹âõñ¼­Î±ÁGD"» Ì;˜ù+9’>[:°/M%²}o! !åû  ³<u#/ ˜ lñOæ-ãNæ‰ë^î'ì^æ/á¢ßãâLéÉíìsãØXϚΡ׈ç6ø~Àëbÿéü”þmdÕ ¦ O*À  Ðâ/üš˜ ³ V ŽsD"ø>‹ òKû ñçæÄÞ¬Ùä×jØíÙÛïÜ¢Þ&áä¥å*äŠàÝþÛöÞNå|ì¯ñ—óÖòÈð¾íAê§ç æßå×çí{õ}ÿ àñMLß`Â×!Á#£"¾ ™ ˆ#©(]-!/-,â$ÍÖ®7=Ý éØU ð`0·üÓômì3æ]äÞçiïx÷gû°ø<ðUåaÜ8ØDÙÿÝÓãRé›îtô{ûˆ µ e È ýƒøûù1¥ 1¦Ù³ ¶„-~@k d¦“ÃÜ {^ôæë®ç’åÝãZâFáPáÏâtåªè¸ëÚíÏí†ê¨ä|ÞæÚPÛÇßnæ¡ì‹ïMî×é‡ä á¾à_ãMç|ëjðØ÷£ü#I °x— n»ÚN„æÚ%$1“6£3-*¼ å?#Ì*-Ã'F?å ;¦ú¼íªç6ë¹öœÍ p aøôMé å[ègîqñæîÓèÜãå(îÿû¦÷ \¤÷ªëHç¼ì¼øý* † f¹þ¦M í”#u'Ð!3Ç O>âÕ®÷Jõ"íií§óBúîû†ö¹ì>ä¡â`éÜô§þr[÷óæ/×ÏdÒÀÜèží½ê›â,ÛÄÙ€à*ìjöÎùõwì˜çŽì-üíƒ+ qâòð_ùX¦&Œ ‘WÏ K m1þ7 1û!®6G{,x8§8=-l[j“·ÃMó1í©ó{—"›TßôfìžîÃ÷jëŠúïí·âßæ¤ñ9û-ýŸöHì[å—æðýØP @þ¤øú”j]B Q Û5û°Rœö7ííõì¶ÅlÂ÷€ñ.ñ‰õ­úGüq÷PìBßÖ ÔUÙbâFê4íê„å2âã¼çí[ï¼íÈéÿæ;ètîô÷æ]=]ÿúøúçÿô  µ m zñaìgài$€*É.>0¼.Ý*|%œ9Êõô™ ¤ ¦ ´ p ¸  ¸ v ñªýÛø_÷âø¬û¿ü ù¡ð]æyßßAä ì×òâõmöÎö ø¦üùÓãuûxôVîÈësîùõÀ0 j zœE ƒ¤û,õHñîïØñÐöÀý5 Š CYÿúôŠìËçAç•è éïærâpÞ¢ÝÎàUæZë-îYî/ìƒé÷çìçéJêõê—êé~éäëeñTù]VŸ ٠ϣBœþhü6ûÕü¯” i¹&1Ò5m4¢.Õ'M#¹!ô!Š!ÙÖêééÄpËïž7 žæúàòÖîï-ñ©òÕñÌîWëüéGì8ñòõ¨øì÷¬óîíéVç?éíxðˆòÝô4úôd uÀ k›øpõÑ÷kýGöGÿ~ú„øèûÄ´ § ¼éø‡óvôˆùý(ú ð@âùÖ-Ó'Øaâ£ë¼î.ëÔäôà:âuç í¶î´ëáæeä`çîö÷úƒû‡øõîópöiûëÿ†kÿ`û—ùJýÔ¾- Ú¶ßDô'é0S4‘/Ù$Vs”È',»'y-â „ŸÐbý÷ñ<õ‹ý,Bù…ëáácâÑíFý<D´ö„ânÒbÍÕãPïdô ñ êúæíýšÙ£?ºñ‹í`ô ‰ ¯ æýgÿ+5A† û5óóÊùA.'öÖçÔݨÛVáŠêËððNé3áKÝ>ßbåì/ïˆíÛè‰å¦æaë•ðNòÝî?èzâ)áKæ ðßú' E Z ° ÔÇL·öñòh#å'ê*J,¤,8-Õ.ƒ0¬0a.J*x%° ‘Gl4p z‹ÿ‚ùžôœñZð ððwðæð¤ðFï[íŸëªê›ëî;òsôóºîêéjæöåžèöìUñìôøûk‚¯ €ÕÅì º y ` ó 52 ÿŽéünübÿ¢CÿR÷¹ï›ìéîôçùûsöšíÂä²àèâ¹èíŸë(ä/Û¨ÖNÚjäÛîßò­íâ ×àÓRÜ&î? RS vþGöIö!ýmw ÷ÀQý < ;&Ž+é*´''º+4Ê;#>m9M0ÿ&ò!9"z%û'+%ÃÕ° Ø {•še÷lô¬í2íÓïóðéìÊã’Úª×aÞí[ü,]ò¶áºÖYÖ¥ßôìò÷ýôüäûuý»z £¨!þ¬õîóÎù°¶ž!™¿Ì È Ì » E M=ýÁô‰ïùîþñ`õÕõ·ò—ìæäæ&ë§ð óOñìë.åýßÞÝÌÞá¦âqâðà!ßPß„ãæëéözþhF÷Æígéí2ød¹lV#â"0!õ Ž"V#i!70m *Õ6x@‰DàA6:31J)ð#E!Ut“^¤ 4 FÌÏýŠ÷ò#îìàêÊêÆëûíÔð¿òÝò³ð4ì„æá©ÝÍݬà4åÊêÛðÛöJü#m]ÿÖûÓù8úíü@¹ (( û!O_¢ »†Ïþ|ôëžè!í’õïû=û¬òçßÆÞ¢årîóGðtç¯Ý´×7ØSÞ§åPésçyáoÛ‹ÙeÝgæñzùÖúÇõŠî®ê)íöþâÖpú»¦± A|$6QB¼EA/9‡3 25¦6 4%-<$ó sTí„úOîIæ¶ä”èÄíÔð›ðäîzîDðó†ô—ñÎéàbØZÖoÚíáÁé=ïªñuò÷òïó8õ¡õ§ô ô öÊüÝË %È$2 ¾n,np )Åûùªö¯òcíèºä…ä7ç?ì¤òØ÷úMûú†öÉð é^àx×ßÎûÇêÃ-ÃAÆÍ·ÖóàÞé£ðWõùÁûý4ýmüÞû~ý‹¯ Þ½×a–V -v ° ,38K?ÍA}A„@L@-@z=K7h. %…«dCJÜBö‚îzî^ôñúýÛøð è[æDìÒö•ÿÛwøŽèØ%ÎúÍ«ÕßGäÁâûÜÓÙbÞðêÆû@ í5o7þéþ* àÉ( .À&¾tJEd Ñ•ý ½úíç)êóºüþÿüÁóEí@í*óú·ûMô§å$Õ É ÅlÈ\Î[ÑÉÎÛÈšÄÇAÒüâeó~ýþ^øsò]ñE÷Œ ; ,›Hú‚øÀü*ˆ œ¾½ Rã‘(î40>^BoA¼=Ð9À6­586 6À2ü*ö ü k - Ú ' édÿî pýèôëì¹æâ Þ²ÙçÔ©ÑÓÑQÕ2Û™áþå#èØèYéëÃîíófú±Ó ­ÈµÑöˆ¤ œ÷ÿ0üöûlܱң >ùºðïâó3úÅü^ùªñlé¨äHä=åxãDÜ8ѸÅt¾}¾xÅÑ+ÝEævêêç?äðâþãUçìÆðÏô™øiýæò [Eç ´Áÿ~þ$M 膿$ˆ(I-4¦;AfAO;J0Ð%Ú ±#s, 5 8³2‹&qá ¿ ^ó ¢ Ø:9xcÙ•…üíòðçÝÜÕxÒ^ÓÚ×Þ§ã9ç èùåHã6â·ã(èî¾óÞøTþ€6=!%#Æäc KmýÄúèú0ý‡Db¸ />ÿ ¦Dþ‡ûRûÜûøùÛó*êußúÖÒÐ"Ï ÍQÉDůÃpÇÐdÛaæ†îò+ó¬ñ¦ï[î©îóñø›þ MLÿcù†ô¶óý÷#¸ >5ôâw&l0”;ÃC„EÔ?52*°#v#(.‹1*0‰)ïe¾Ž25á© ü ÞÆ±ùWì½â­ÝKÝ`ßÄàkàSÞܓۘÝËáñå¡èê³ëJðÈù6&º®Z ‡œüFú8ýœÜ î  ÉO'Ç×]| Ã?ù±÷&ûÌ]ùÇüdõÅî¯èâõÚ–Ó¸ÍÑÊßÊÇÍ;Ò©ÖŽÚÐÝàAã)åQæEçèŠéìþî òõôP÷Ëø‰ù#úÂúçûVþØ ’£= y$˜&¾'\)%,´/Ž2â33b0²--.e1È2â/|(Ø G<fÂR³…^6n|è ÃCú™îWäàÜÙ]ØÒØäØ ØÌ׬ÙðÞÕçóñ0û¡ýøäú5[ØAQ ¸µ·ÿãÍ ë/d»“ϺPÁ yÎ ÇàúÆð¯é½äÀ߷ظϹÆ7Á«Á”Ç6ÑÃÚ3á¦ã2ãÁá"á3â3å‚é'îòýólóð\í ìÐíHòø¶ý€Ík ` $¯'(([&¤$[$¸&,276€6Œ2’,'³#m"ê vÃc¶ Î<e!""Wb" ŒßÑßÿ-úÂñTéÍãPâ”ãŸåõåÄãàôÝÉÞä)ìnõËýîé´9þûbúHü&qÎÔ 'tªÖ ¦I7FÛçHõ±ý Í ðtÿjñ9ã¥ÚðØ¨Û ßEß™Û;׊ԾÔþ×5Û—ÛŒÙ^ճѕÒ+ØáiêQð¸ðÑì¬çÙåÃéÚò›ý¶z 1% Ø Þ ¸ó BàH“O)Õ46:I8¡1Á*æ&=&-'Á&|"ú‡R¼©b, « Fía!]øåûjö”óoó'ôóðîsçåÝÙÕ:Óû×ã8òIþä!¬ùeõDøY ¼ï '2ÿ¾ÿGäyá^ÙŒýùú‘ÿÍT ú Üúüúÿü|êýºò~æbÞ0ÝNá“æ éæAߊ×çЩÍ0ÍÞÍÏwІÓáÙÎâ¯ì=õ4ù«÷”ò›ìègæÌçlìµóŽüçVªÚ8çžx›j o#v&ˆ'£'n'ò&Â%è"ÇJ¿Ì>^X,ŒÒ Š J ý m ) ƒ ˜ôÆþœú¾öÒò¨îë4èæ¬æ(é7íÒñãõ÷÷¿÷’õµò'ñ!òKõlùýšÿV,Õ‡‘ÿ @#üö±÷+ÿ^¯ W½ÿâø–÷êüRœ é/ý‚ïdåÀâ"ç3îòåî‚åÄÙÑ6ÎzжԿÖ<ÕÁÑ_Ï‚ÑßÙTæŽò&úAû÷ ñgíHïçõýýhF«º1 û ˜ ¤  =•¥ Z'±**s&å »…Ìr÷Ù m!¦Œt¨l ³?-g 'Kžÿâhùïó¨ówô®òší†çä‰åAìŠõßüÛÿ¨þ ú*ö"ôÏõÛùçþÔ±ì `’€»8 Â9ÿ‹ùdõ óŸôÈ÷Ÿü7‚w  ¹÷ÚEZÿŽû›ôë áÙ…ÕdÖ!ÙÜÚŠÚëØ›×BØÑÛFálæ×éûê!êåè—èŸéßëæî7òèô÷ˆù+ý8CÐ Ù wêýHî!ã#"%S%i$Ç!µ,g `câ0ͧ*Å!.ÚÚ €X$ ƒ ç+ýâöµózô"øaüþü´÷yó#ò”ô]ùåýéÿ?ÿäý(þz„1v¥\ëºÿ‡ýþú,ùµù4ýL] X|) ç–ÿåýýþcºÿ•û|õrð×îÏð¥ó0ô1ð¹çsÞØô×àÚE޼ߋÞÎÜoÝÜáþéó–ù!û ÷ ï¶çxå!é°ðgøüžú‚öZô ø ö×êe§Ž°ÿ{eÇÀÁ5_] !!+Eú5LÑ" ?¡ ±_²)Ì îûûÙÿªZàðÿ ùÕö7ùKÿZ | æ×ÿÙü“ýÌJ¤‰û õ5òsóàø~ÿÂ"\¶óù}@‘â£9”ÿèû…øöÌöìø€û[üüùmôí.æ“ápà¨áã«ãnãÊãóåßéÍîhò©ò}ïGê å[áŽà#â¬äç é8ìzñ¹øíX& oJ £ Þ r€‹×½j 1 s ù { ½î%¿¢šoN$ Õ ÏMÑ`5öy ¸xÿëýßý–ýšü#üýÎÿT . {Èà ÖFÿû0÷ôPò[òDôm÷³úý]ý3üû•ü˽TÝ< †9ýhùÏøXùøøWöò¢î îÒðíõqû\þ(üáô¥êeá?Ý*ßøäŸëùïèïÅëÔåÅáDâÇæ4ì ï8í¡æ·ÞHÚ»Ûóâˆí*ø÷ÿ:^¶]% Ïø¿e¶ Ï1Ê åŽ Þ µa… ظ#qú–6©É«ÍZ w Á ˜¢X9¤B(úí÷Øù‘þ/±¿ L ž D  l a = HÞþ^ö#ïÀêÙéÑì'óÞú¼S4Tþy•|ÃóRü·òþïsózøúÌößðúëŒìyóüüL¡üôðÄæÚâ?æþìOòóï'êÐçMé{íÏð1ðœêfâÿÚ:×›ØFÞ¼å¬ëÇîûïÃñÛöÓÿ íçà 'Ý%þqÿ.8G§Í¢ à|¡_ }Ü€á½\Ë ; ¸ àá¸fŬ •þGÿúìiMN¶h gžœÄ Ôùóãð„òŒõ÷.øÉ÷±÷£ùyý٠衜‰óÒ„Ãýú3øeøñùçúÓú"ú¯ù?ú½úú1÷Õñïëè­çeêPî¼ð:ñ…ð6ð¦ñCôAö®õrñ!ê[âöÜWÛÿÜ¿ßÞáàâÈãNæzë›ò;ú0Aú¾s©j ë Ù¥Äüçùøû€¢ r: ¿ ‰bDÎ!' e 4´nŒÁ± ×—U Ç:,€þEý¢þû” ·ÏEÐìwÊ + °êüöHñÁðõvüÙõùÀéûQù©û*u“eü»õ5ô¼ø³S .Öý÷lô–ö&û þ†ü‹ö\îÔç‚æ¨êÎñw÷>ø“ôYïŽìÔîRôùKùGóÈèbÞIØ>ØÆÜØâçøçnçEè5í²õaþ×q_ýüƒÿÅ“ ( ³Þýåùü³ e7« © É ^±!_»¶¯­u xØ o Å Ï Èºâ¯ ½¾þ4üˆÿÑ)YÙ r Å | x›ã¸ýÿô?òTõÁü7¸Å{ÿîøJö`ù’%_ „ ©æ+ý"üûüþºýðûˆù¨÷ì÷Kû¿Ì ½'xúòïìì-ð‚ôâöFö)óÎï®î7ðîò·ó–ðêãåÞ”ßqä=êßì¯êØåìáoâ¡è¾òCüC÷Tý—ú¤û? é  ×úXô\õ@þ$ ´Fø¦ Ð BÁ®N ^s »!!â ]DV O²jùüžøLü±i”4Å Ï þœþ|Õ !Û—øµòññöüþ( ÿiúÎ÷HúôO —# ?™øo÷Êü  »ûáõïöºþÓÅï ’MúLó‹òÁö³û<ýCùòÓëê]íKóøø5ò#é©áêÞáæêJê,çOã*âŒåŽìZôÇùûøõHó‰ô ù$þÑ£þÈüuþ “µÞ…ÒY Ñ ¶¬í!@«Ž-Ÿ4ìêF3,c5  ÿbëí@xýDúù%úôüìÿº_þ}û«ùþùöûµýçý ü€øWõ¸ô‰÷­ü4¿Ã¬iþû$úÚû6ÿ  ´—G ‹ D³EàßÉýüöºôØöXû0ÿÑÿ?ýKùYööâ÷@ùý÷óCì7çaæôéÚï,ôÓóîéäˆÜ.ØÙþÝÊãËç7é…é~ëð;ø0Ý[Áúí÷0ú;Ì óƒQ ¸ G 3 Ïcv<ïô#3*Ô*È%«O¤ cóUÿ¶ÿ1à _¨”6Cý-ü„ü"ü5úQ÷ðô¬ô§öòùÜüxý¹úuõ®ïÚë~ëeîûòR÷ÿùþúTûüºýC<Ã%Ê®Ÿ ø ÑÀ´Ö glþñý†þ8ÿ]ÿjÿ?L`y ÜDÌü‚ô9î ìzí[ðòÂðdìæwà»ÝñÝeß;àZß-ÞéÞ¯âÃéómûÄÿŸþNùPóð£ð õÄûPã] Þ R uErþ“6yýqÏ!f*–.-š&‰ž;ò  § ¥ ¶ E ÿ ƒRW ÷Gò"ôûZ©´ÿÜõÛë¼æ¦èìî¾ôéõñzé¤äæïîû’™ RýOô ðóøû ú Tå o £ cTŽ¢¼ ÀJ’Ä Ÿ p xÕÂe Z} "þµòëßê¸îòÄðñé3à‰Ø-׋Ýaçðí½íJè)âà6åð)ûùÿšüéóZëøèî“ù[ \  þYýkk Gâ—,6n'„/E3*0™&~? € Ä íXø sº ú?É[c r‘ú–ø ú´úµ÷/ðgæ-ßíÞwåhî©ô"õ´ð5ë…éòí’ö$ÿIôWúêó¢ñYõ!ý  Ø  M -¦Ø¨å ðÌîº qÝ2 îÀ!€ Bm vÿòzé’çDëðÖñOîCçôá?âÊçÎî¦ò¼ð%êâ¸Þcà>æí¶ð ðpìaèŠç¼ë©ó–üW3¢wÿjp …çèvò"ž&)Ô(Ð%o Gè> Ö h à & afëk°pŠ ë¿ý×ø˜õ°óoñ›í`éæåÑæÆéQìWí>í7íñîáò,øÉü1þ¼û»öêñ4ï.ð¶ôcúeÿ²  ÐO€‹ ¬ å™y¿¸^ÀLA£Äh …€% þ„ù¸õ^óƒòÇòaòxðíUêBèÂçèýé'ëùêçèjå„â¥áÑâ½äæ¯æ€çéNìñ¶öaúyü:ý«ý™þÞÿvH} r5J!Ë#Æ"a?ßÚ=ÅÓÉ]N(kÕ ¨²C ô ç o/ö%î`êMëòî%ñ?ï4êcäqáéã‡ë3õ¿û¥ûõ—ë¿äƒä>ë¥õ þnlýöNñ]óçû \\ Rüÿ: Ú³’cÎ mÂs …ñø¶²þ û>ü•þ®ýÐ÷Àîqæ÷â¢å ì´òÄõåó—î¿è—ä±âtâ«âKâ¥á%áÎáÕãƒæµéßìÐï¦ñIò-òòóêõ¦úª0 ¡ÚÐH¤”Îð"”!¥¾6Rt!Œ!KÃM ¹ ˜ B,ümýXêÀ¤køRî›é4ë—ð!õœô:î`åmß‘ßIåÑí•ô[öïò>íÙé“ëòÐú;áý¦÷ÕóÅôÇú­å æ & ñ Ä ó’ †JU ªÚY «° î0¯êý°÷…ð_ê¤æ¨å·æöèVëPì¯ëÕé­çæ1åžä»ã—âäá;ãÅæ#ëÿî]ñ'òÔòtôY÷ ûjþ¿&;( [ÜkÃÉó$]&&f#k;@±jW  ! , ÓeÊì: wzûüùîõóòwïðëþèç¼æòçåé’ë8ìƒìñìëíõïäòóõ•ø¿ù\ù„ø+ø¨ø¼ú(þlõ°°o1n  £. ‹ ¹ »)Çk-¿:~& epúÌôñHïmî1îdî¼îï?ïñî+î/íBìFë%êè>å]ãã$æoêî_ð+ïÞë"éßè}ëbðµõƒùYûŠüÿ¯z O+! ñ´J!/"·?»‡(¯ƒ 'Í¤á “Äù—ó³ð,ðxðµïûì{éwæBæ©éÂî¾ò•ó£ñØî‰í²ïËôWúþŸþ†üVù÷n÷Êù-üÄýHþ;þÿº# [ÊŽm jÌ•QT ¦>Æuýß÷õô:õ÷ú”ú’÷”ñ[êöääúæëí0ìçäàÞÀàçpíŸðâïKípëíwò‹ù¬ÿjtÿtýEÿIn .Ä5W¢)Ýc ß$§%"ÊñbÀÎQ!é! 5ü•Ù Pâ@ ~!Háýõœê½áCÞ×àóæ¤ìcïœï ïJð¬ôãú"kûýÛ÷žñ{îdðåõûøý üµ÷žôCöþÐ ß©BiM ’4 a]wV ”¾ X! s ¥úÑö ÷/øøBõíï}êÈç;éÚí}ò¸óï[çRÞØ«Ø„Ýäžé6ì=ì˜ìRï¬ô ûÜÿn´üóö…òUò÷LÿìšEÁ36%y+ .µ+)%H”€r ýïâ Dÿu &`—¦“Ý¢ Ú±6÷¸ë€á’Û—Ü/ãë¥ñ,óñQî-î>ò(ùÿKü‰ôí^é&ì ô`ü-mûÈöö"üÕ×è Ríû4úEjï Ià Ò™ qoö‹¬Þùgò…ò÷÷¼ýâÿ¾ürö]ðíÙíñîò?ñpëHãÄÜÅÚºÝ!ãiçèçñä^å ê³óµü0vÿ±ø\ð\ëmìó$ü Âû \ž"É'¿'#3 «Åü0ŽôìF‰s¼ * 6 Ð ™ÿ—ö€ñð”ñÞñXïŠêoæöårêòFø<ùÆôzíÛç1çEìÖôü¥þèüùuö2÷û3v‚þúøSúH: ã0—p«g ìßa · â V N|ö¤”7f‘þøëòñ}òÉôQõÖòÉíwç(â†ßæÞ ß4ß߇ßâá“æ%íhó<÷-ø³öÚóCñðQðñAñØñ)ôù« f7èvc_ ø&¬ ã!!!'”È=ì –2š”  60D% (<ÿ8÷‹ñÝî%îîHíÙëÚêèêì*îð¥ñíð"ïxíJíZïøò÷/ú¦ûÛûKûû…ûÖû2üòüPþ_ÕC‰± ½ 6è'— r€«& ÿ ú&y ¿ v ¼Ð:þàøô,ð&íuëë—ëöëãêèVämáá³ã„ç,ëúìèììGìqîtñÈóïó»ñ’î¿ì;î›ó<ûÒK] < x´š)Ä Á!F%<&·#€‰– áU\l ¹\«1ìIÝûÀú‰ú¢ø¿óíné4êïÜô»÷<õHîeæ®âäåeî9øøþÌÿœûÔõ™ò%ôFù±þEÅÿÿû[ù úêÿÁ ÿ³ ³ BÞî –ü{hÑaÈ As cýzû3ûºúEù»öcó®ï†ìLêÒè­çLæŸäÍãmä1æZè`êÑë­ì‘íªîðxñòøòóøòÜòaóþô2ø ýÒÞÓ j à{¼Ï †"†#¹"›*³J¹Í”6v¼ ? Ä ± ë ΠƧÅþïûõùAøÜõiòfîëÝéëªîIó$ö>öô¤ñýðó÷úúmüxûfùç÷~øû[ÿ<Ï*q1Î £ÜLƒ vûHõ .‘S²c{ªùTìåäåLëÐóºùèùdôÁì\ç*æRèiëŠìêJçÜåèÓígôaøú÷Ëó0î1ê‡é‘ì ò¾÷-ü£ÿüE÷ ¦(œÌ»üP*v%M*z*Æ%­³ $å>¥ƒX „ic‹O9ü@ù-÷Eõgó¾ñNð ïàïðSï+íDêFè$é‡íõ§ýï& õ #ª‰þíüÉû4ûeû`üãþþÏ$ ¨b€ ‹B oÑä«~žÁÈ þÊù(ó3ñKóB÷múÄú|ø¿ôñ>î/ìØêñé&éè™ç¯èÃëðËóÚôòiìƒæÍâ‰â©åäêñ÷‡ü¾Q(N =£3ðT~)¹F I"‚ !cñÓHŽ‚ } – Ì Gsˆ6ó  ÊÀçþLüùÿõ~ógò6òòñðpîëAêUëBï!õû×ÿþq‚©Ý/ÿÌû]ø·õ*ô%ôßõNùÚýgF Í l ¥ ( ` 1œ¶jIteñò + K†NüÀ÷Cõšõâ÷[ú\ûú ÷êógò©òŽó~ójñpí>éæ4æèÏêìéë¼é?çVåäÄåÅèíòŒ÷ýÌ^ ª z h d ?p±O®±fèÿ÷¾ º Õ÷ݦ,°;ÅZ3ÿnÿÕ¸ÿmú‰ó—í—êAëtíKîåííSíðï¶ô û…¼PSC#úÂôŠñ¾ð¢òæöæû…™ w§Bë …b îP‚ ¹ r æ Эÿ±ù ö¡öñø üâýAýºúV÷=ôDòññ ðî¾ëœêýêlìî‚îäì¨éæÙãTãJäRæ0é¬ìØðhõ°ù÷ühÿ¡Å³ Ü ê  ™§ì¤ÙW{š ªyn  •T‰è»¸Écn F£è»&ÿýúÏ÷˜ôFð“ëÿç¸æÅçµê?ïô#ú¥ÿ:&·’›ý!û0øõ˜òUò“ô¡ø(ýƒ6Šÿ¶ýCþÆ¡ a¦¯ä€ 6xI÷ EŸüëô„òPõ‘ú!þÜü0÷ùïnëìÇñ{ùBÿ–ˆý¾ø õ1ôŸõôöýô.î+äÛ¨ÖØ×¦ÝåÍêkíIîÊï›ó™ùÁÂF  ±Y z¢¹nÇ U)W  œ H z² Ïåñ Ä"]Ñ&´Ã»sIÿÇú_ö_óœò«óTõ¢õ”óð[í î&ó,ûúdBêý>ü¬ûû'ùnö6ô­ó\õ–øWü0ÿU‚ÿÙÍ ¡Fi!@AÆ>} ÕÉîýÛødö4÷ ú²ü;ý7û=øœöû÷SüP8íý2÷ò­ðÞñ¿òð é`à!ÚÙ§ÞZç—ïðóëóèñ,ñÁóÝù=ÄdÝþs imŸ  ( | À %£”—h`'¬…k ÞûÉäžsÁû(÷ºôÓô)÷Tù×ùèøökó¦ó§öæû%V*ð“ÿâýýwü‡ûùäõhóÕò'õnù)þsãCJ ý ºIzWæ ¨ è„ý-û·û6þ®ÊYþøùÛö³öÑøüÞþV+)ÿiþ&þyý7ûÔö½ï]çïß}Û˜Ú@Ü·ßä¸èÑídôü Þb ×z© ]õ.ïµþòþ2Št °…ÜÓ0ú€«i æ  &Z„“# Æý¹þúö(ôvóôõ€ö ø"ûcþúÍ&r*B—Y€ªÿàü ù!ö]õA÷¸ú¿ý7ÿyÿ!OÞ ÝÏþ »  z E z?6!Ü^p Ù ¥ø^û­÷¢ö‡÷Çø–ùiúçû}þæ®'þ‘û‚ó?ì“ç¼åÒå4æ¼å7ä8ãäñè˜ï÷ýL«ultiôWßþùû ú<úkü$ò '¤l*Ð Ü«õeÊ ¤— ^ ¢Æ ûÜàûÔù!üÁàûƒWÿAü`û~üþÿäüúøõæóüö$ýy´}Ëû‰ø§ø¦û]ÿÉ&·Aÿåÿj¡û Æ Ž 4‘¢ÿ6 '6ó îyäÄò3DYÆú?÷9÷Cú þTÿðüÇ÷óýñÿôúƒýüUöï-ë(ë¸îóRô¿ðÌé1ã.à}ã©ë­ôÍûžÿÿ6ÿ}ãÍ ¤ûãø6ùuüà º•Âj°%Ä c € g÷Ué Y[¬ýÙü÷ýÿßþPýEûýù¥úÚü?ÿ=·þû~÷$÷§ú%¼[üÅHþ8ü–ûMû-úqø÷u÷ú^›¼ ¨Á ´M Ç3­»¿ÜJGyê^{ûø­÷oúÿRöküôõZñðÜñôùõ=õóXñ‡ñˆóˆõ`õÖñgë~äVà~à¶åîBö¬üŽoÞ‘ñÿ>þøûvùz÷ùöù”ý jÕ Ç  Í  ) }  µ  ‰ y ©ŸÜ¶I ®–ÆÙý)ü‰ü”þ.‹Aoÿàü›û'ûúøyõôXõòø*þG¦(ý)ûûéý|ó5û˜ÉèZéôÞÏÿ"ÿ|ÇÚ Ãö ³ ­†×:ØþpüÎùÁøpúÏý"göÿuúëó,ïÊíwïÿñBóóññsñ«ò‘õTøÍøÇõðëéjæéæØêÔð#öù›ùðøÇøpúýü2ÿ°ÿ!þ¨ûIúAû¹þqµW ® ä h ü Æ Œ 9Å d O Üø1 q Ï ¶ "æSWò jŠ;þqú.ùñù•û;üóú~ø©ö÷¡ú"%)öÒÿúù)ööûÍÈ£ à Ö?‚`•?†ýýÿÿ†Ÿ ýÓ°w Ô ;´þ«üºûüWýŽþMÿ6ÿ™ý]úbö£òðïFñbôR÷­ø>ø£öºô>ó'òSñ\ðæî›í íBïòÿôùön÷~öeõŠõT÷ìú^ÿ X:v)oÅ b « ·uªÆê¤ä” 8ŽJ 4 7 ] d{N  ˆfJ³ò>ÿþúYö€óçò%õ`ù;þv?†»'þšú¦ø<ùuüFÉ] Ò¨û­š˜jwJ<: z1ˆ¯šÝ ¯ƒ`þÅþލk ýøøïõÉôõõõ½öööìöc÷´øÌúôüÕý–üùØó-îÊéççé~ìAñöBù6úTù»÷<öTõ õõ.õªöúØÿ°> àö ™ ŒX“%ÞÐìÊ7 Z¦òŽtS f $  m ´ ß  ëN#ÿ(û¸öÚòñÕò›ø>@  Eqcÿlÿáÿaÿ«ý°ûû‹ü+Ô;  ?ì°a'¦ ü  :  ý  ‹  ? 6¯6º%V™ÕýÜùí÷÷mö&ö1öXö™öñö÷$øãøNùžø_ö¹ò–î?ëõéàëþï*ô¢öIöÈóùðÿïAòa÷¯üÓÿ÷ÿþIü]ü]þ<ïûþ‹þ%-ëÕ 3 Ù ,L¬¥ µR Š  „ U&ý2ú³ø¤ø¿ù0ûËüþ˜ä‚Åþˆÿñûµù=ù¡úVý.ÌJVdõ‹ V:@e Q ìÈé  © ñ5þ„ú`úÃýûšŸ ¨RÔ[£¾ÿ#ü_÷Òò«ï0îî˜îïÔîèí´ìåë°ë£ì¤ïÄó8÷Øø7øöÞó9ó¦ô/÷-ù|ùª÷¾ôþòÝóá÷¾üñÿpîþŒý‰þ=P ¨ 7Y F˜k• ¼Óó TÿuüOüÉýÈþùþÎþbÿ„ ü’ “6üÇö§óéñ¥ðóï{ðƒò`ö ü=.+ ¼ áý½ýÿŠTèK /i·ø=*ûòùþº. 1 I –éÊ ˜ ´é FÀ¯ý­ýõþÃþ0û¾ô’íƒèâç‘êÔí–ïïÀì=ë@ìãï õÂù×û"ûxøhõ¿óöóÜô õßóñ[ïõîºðôz÷ùIøaö²õ¹øáÿ yäVÜ £&ÿÙü<þ·Æ`ÿ¹ýÀþ% ¨ \ A7±ðG9¹”\ „ýúQ÷˜ô$òˆïyí—íFñÁø¬ [ ê “ûÿ"$ãÿ;ü3ûœþ f Ÿé ‡ÿlûþnÔ K…¤óhçIþ ± y o‚ürûWýòÿ×ûpôíJé5ëòú‹þ0ý÷ñï\ìýí ós÷«÷¹òKë`ædçbîø[ÿUú7òŸí½ï.÷æÿtï­ú(ônó¬úñòÀüìü”÷âø;þ—7!Â:å Þ) è¥~ð‡ î © ø‰ÿ~üÌû§üSýéü}ûŠù–øêùÉýÜÙ° þøüýüü”ý¨þjÿ°ÿ$a¤ú?  å z E  ç s ¿ À œ Ê RG‹þY]}}åTK@™ ýôùû÷êö£öïöüö^ö:õôéò¬ñ­ð;ðŽïbîuí£íïhñô’özø§ùúúÁùƒùtùJù¹øó÷ÁöUöà÷ûTÿ2 ¡ b ¢ •%lt‹_q ¯È ‘ :©\Ž[ÎN!ÖÅô0`_?ÿ×ÿõ]ðÿyýÔüRý§þ²¤"’DJês É ¡ ¾*Ýh Y Ú € p Á#=‚ž × H ‚mÌ‹b¯üÚù†øÆø3ùiø®õ‹ñÎí„ì1î°ñÂô§õòó¾ðçí=í”ïAôYùµülýüHútùÙùƒúmúÄø"öšó½òôÈ÷ÐüÙ"Ǭ » N » í   / TpÿDûúøû_B0 ® â … G± ö  ç2CM‰k"týùüaþâ=ñ·ŸõÖ4ÿ{ûø÷ûù=A   È­/Æík¨FãKÙ ì…Ï& Õ Ð … úN—þ@ý·úúû¸üvýNügùÀõòñ)òœô-ö³õ]òåìXçräræÉìCõýÞùaþ†ùîõoô?ôÈóÂñ“îAìZí,óü¨ Ÿ  –vÈš ¢£LþÐøq÷ùú¥ùõ Á íãe^A Eê±6 V©¨gjþnûXúŽüs!ð )ÄÔúøçø<üQ`Ž¿qfZvW.žzKÌÜÇbLµFäa‚ Ý 3 å#¼ o  ¯¨ÿ¨û€ùbøè÷w÷öÿóŒñvïþîmð®ò¦óeòRïâë^êì£ð=ö¡úü ú.ö#ó¢òÛô´÷%ù†÷ójî×ìÞïRö ý³Ìeæf ‹ F )gÿYú;ùòûf0æjjÿ7ÿÁßuJ ,ËíUd‡ü úÆû^_ÏÛÿ}ùOõSõÏù’I¬m>Ï´¼g‹1H¼)ø\GÍßhþ*ÿMµ~/«wÁäS Ù ß ‚ [²RÖÿàüu÷–ðìé'åäÏæ×ëØð ô0õõÖôÀõî÷ úáú¢ùúõŸðxëè˜çôéGî9ós÷ú’ú€ùQøÂ÷~øwú=üLýùý*ÿÖ_ Æ Ü Ú\ZýØúìúhü~ý¿üËú úãü.â öã—9 E~7œ H ° ¶7`þêú1ú™û,ýýóú1ø øòû’‘ ʺSÏW®ûüúïüžÿûøÿÃýòü¯þþ8q [ „uWg" = ; DĈzïTÈãÿkýÔûçú ú”øˆöô¾ñáï±î!îöí‚îÿïºòžöÓúbþÏÿ¥ýøðMé‘åéå{éHî\ò ôBõ$ö²øüîÿUÿ³û–øßøýÃJ ‰ X ë09ýhúŽùùù«ùaúý†% ÓÌ— F 3Ý¥ v ˆ › è Y- þ­ûZù÷Lö¦ø‚þŽ‚¿`Ü» ‚¬ýÜüÑü+ýHþƒƒPòJjµéRîL¥"Ä \ !n“ Âö¡‡Ñ´«Û«þBü÷ù/øÄööKöàö*÷šöNõ»óµòLóÝõù#ûû©øvôñï ìXë9ì#î>ðcò_ô.ö©÷˜øFø~÷ïö†÷úþ+ÓÔ I g ßôØþûüºûŒú@ù-øPøú•þZ! Ô v € tE @ ¶ jÜ.Å œ]þ J‘ý—÷¼ö-û]¿   ë ž Òݾ 1»ûoú/üôÿrakdþ¡þ¸± {Y| ÕPé^P– NÿâûóûHñ[ ·  ð2ûöÈô˜ö­øzøŠõBñ0î;î¡ñÝöÈûÓýŽû!÷8óeñ<òTôwõXôñð}í¸ìxïôÇùàüvý:ü!û üÿüœ°øÍþùûŸü/8ý ÖÿÀû—ú.þõ : Q ] î›P Á ÙÕÃ;ÿÍ"© ù® ê×½"f  ¦oÿËŠ7{áÿ>Ü<  ³ ¸ñýÃý=") ! ‰°?*M‘éèÿÿ¿Q” ê«Î.ÿüÕùùGøàõéòàïŽíÐíºð ôøœùøÄôœñ:ð òkö6û8þÅý¢ùÊóØîíï£ò;õýõæôÇóõ'û¤Ô= ¢…óÿ:ÿ€Ù¶qýCú’øéùNþãËÒ … £êc¹K ^Éâš k ®« ¶ ð¼[ÙÀÁ€±5 ‚ 7  Èòÿ9ý þâKQ¯ ÿ™ü[ýä # h ÍÑýÀýÒÙÄ l\êýÄúŒûÉÿZ] e ÖjþÖøGõyôYõEö ö0ô ñ¹î³îÆðõàú©ÿŠÌÿDûÙõ ò„ð‘ð^ñÿðîî í'í(ðàôiùçû«ûeùu÷øüo 5ëþ_ü¿ürÿ¸Cý‡÷rò•ñHöòþºH W ßI¬ÛJ ¬­÷ Å ‚! ª‰‘ ƒ5ÿÿ£ q , ã ”© ¨:Šî êÿ ýèÿo@³aÿzû ú{ûiÿaŸhÿËþAOR1ýÿ0ýü’ý@ÿÅñsÿÄüõùö÷{÷)øù"ù?ø¬öØô±óOôöQø%úÊúäùl÷šô~ò¨ñØñ¤ñ‡ðïLîï6ò÷^ûý‡ý2ûÀ÷õô%ô%õXöøœúsýiª*´žþYû'ù²÷÷i÷|øœúíý_Ú N ¼ n¤1—ЪS¢Žè  1 v {“£ëJ µÅÌÁ JN¿ÿ þ¤ý²ý"þ/ÿ~Åk³C%ÿSûÛø•ø úPü‚þ^£JQÚ×7ÿèüìú1úÊúiüJÿ—› m{þƒúÈ÷úõªôHó‡ñ=ðÛðºóg÷ðú?ý\ýHûølõKô„ô;õöÿöù÷þøú”úSùýõòDï¡îIð“óêö[ù ú‡ûýõþïfE”mýDùGöcõuö©ùþ¬Y:‡]mP{ c . y # t G ß ^ö6HÈ  â%c r Ëî  ‡Ó ¦ç Uœì½þ7ÿ¹,9O÷üµùjùüwÿ)!¥üÕø÷úKÿÓïèy¨ÿ˜üý Ñ¤}lþO÷Còñƒõ#û/ÿ}þÎø—ñßìSí¯ózýF wæü+ô–ï#ñ1÷Ÿý1xýH÷2ñòí¸îQò-ö¸÷ÿö¾õ{õ÷lú‡þŸ­ôFÃþ†ý¾ûùöôô öaúÀÿÀ? C ñº$ * z  † ˜ q¡º{R– … ‰#éL  ÿãýY²¶ Îf‘ Hœ=›ùÿûk÷Ôö%ùÕü~¶FËÿøü²û¥ü£ÿÞðæÛý9ú…ùÈü ùq Y+ùqõõ)÷Mù§ùš÷ôbñAò»ö2ýw,LìcþîûãúÑùË÷Áô²ñðïnðÒòOõöèöfö!ö²öû÷¢ùÃû0þq5wÙ÷Òý`ù¾ôÃñhñ¡óÎ÷ƒü{ÓNC ¤ r)¨ å }[1þ;ÄÍÕìË ¬Üyð À¶#ß ¯e † A™ ˜-0üªú ü@þ?ÿ·ýäù×õ¯óhôü÷ý§]f†uÿ(bÇ.™·‚þºú]ø6÷Q÷gø»ùºúáúeú=úŠú6û–üˆþ‹?ÒÈܤxÞþ]ú½óþì‡èéç7ëïðÛöZûaý¾ýtý­üüûmùƒ÷?ööú÷•ùaúmúZù/÷Ùôjó7óÐóøô[öaø û8¸‚,hÜ K© bpÆŸ*m­× ëœé— þyס ±Žö[cýZù#ö–õÙøWþCã¬þEùD÷¹øõû™þLþöú÷õ7öôù’þ‡<2þXúÿ÷ìøàüÏKŒø+ü8÷ÿôöúûþ°¥Ëžþ¢üÊüäþTãRÿÓù_óiîtíkð=õ÷øúføõPò}ñóÊõøzù úøùoùø÷Jõ.óßðùîî ï¿ñ‡õQùãû?ýLþ ñåO¡ …  ú ¼¯è+'s º ¢ës’Å k‚ ÔtÂàö tÿõýÿýð¢úû÷¥õ÷6ûNÿò«ÿ–üäù¾ø–ø>ø÷@ôñ)ñô ù*þ:è+þ¶û²ûþL%Ü\þ·øÈôšôƒøÈþºwœ­®tþý0ý ý«ûwùšöyô$ôÉô`õõáó¤òþñòñòûñÜñwò|ôÙ÷QûÅüéúönï¬éºç]ê™ï˜ô ÷FöôBóoõWúRÿö_Ë´À Öœý ¹ x ± .8¹€Ff-“•pî" o™l uýd œ‘ýýdþÖþËü„øôóñôÑùÎÿÁ_ûFôïií§ï'ô/øñùMù#ø’øSû¥ÿEü3Dü;øm÷]úÿñÓSSîÉþdþÝþãþWý.ú ÷+öÇøþ¢LØýHõ(ðïïð£óõƒô¾òññÆò%õ$÷Ä÷]ö´ó²ð™î>îhïMñCóUôcôºóõò1óUõÄøuüõSŠK . :Ž Ë¾r ·½üêUHØ’ò  Ê , у ({`ýPüYüüûúhú«û†ý…ÿbjœ•þXù%óî ì<ípð*ôZöX÷:øÈùý*°¬+,þÖüYþ4ê Jÿßú‘úÂþsn  ¿Åÿúqøòúàþ|¦ýø¬òkñ¦õýÁ›ò^÷í¼æûææì ôñ÷'÷¼ò î§ìmðY÷¬ýZÿû»òïéuå¾ç¹ï@ù]ÿ ]ý«úüúÐÿöÝŒä ×c»YηeX’Ê,â€i…X¤X éó8û¦õ5óÆôùþu…üð÷Yõ·õ ø¬ù¦øõOð$íœíÈñºøßÿ¼*}ïä¸; |%fÿÖü¡ý/4'_èý\ûü ÿ:Û$Ç4þîü‘ýÍþ>þûÕõ0ðì/ìêî±òoõÇõÎó¼ðƒîŒîÒðóó|öt÷wö ô·ñDñ7ó„öÙù©û ûçøI÷Xø:ýÍY ]€!  d RbRlÅÜÐ ”?`, : þ c Á¾‡‡1  3 ë 6+ûöéóïô øûü‹ú÷™óùñÜòƒõhø±ù¯øœö]õ&öùÞþ¯ðbµÿÝþ½?-*h#Ú±YÃ6ó¢6é.,þH·žÿrüû‘ú¹ù¨÷Jô|ðØí¨íèïVóçõö¨óð{íœí^ð=ôìö"÷ÏôIñï¥ïµòSö´ø¤ø´ö±ôƒôx÷.ýÓ0 Ç ® O  t ¯õS}׋ªîøŒ ¥šdZ>š´¥» B Ó £á×þûÏù½úfüWý.üæø õ5ò”ñó³õÝ÷aø*÷¾õËõøÆû ÿÁ2íþ¥üiüîþ' éä܆»X.3I.ˆ¹ B çªþOýÙý@þ\ýËúÛö ó'ñiñ’óãõGö×óUïàêÜè¤êâïîõÁùŠùîõ­ñÂïñ¸ôaøù³õãï6ëµêïùö;ÿ“|­h vઠî 7 %# uÜ€ 7 Ú àÝ–YÉ ~N˜á 5ùüvùeú›þ‡·Vþ4÷¶ðíOî½ñZõ@÷Z÷âöa÷®ùFýv¶,þüoû2üƒýuþ9þýHýÇþ èÊ £†QŽ ¬ }ÌŒþIû½û’ÿh&ÂÐãúëõTóGó}ô õñó(ñîNìUì3îñóHõëõVõ$ôó^òóñ“ñåðÆï|îÃíîˆïíñäôHø"üÛÿK¶= š Ž9 ó |=… 6 „ˆÚ ø u ªµ8ñ2Vð½ ݼ³•‡R«)þ?øùò ðsïóïËðÐñyó]öú‰ý=œÐÀ=ÿXýöúµø%÷¤öž÷ÅùÀü)`;ó ð Œ ÒaQ+±ÙÇA dÙ¢\ÿünùp÷1övõ–ô4óèñZñÒð4ðð†ð”ñówôúô}ôbòÄî÷ëìê&ëºì;ï<ñ»òLóCó(ô•öPú÷þÞG1K÷i |Å¢‰ ï A : ë è à E '‹ž^µ ã ?ú_ ÝþlýŸü«û¯úÀù·ø÷4õôÊóõp÷Ôùû©úýø½öÌõ öéø û%ü:üæû¤û‰ü ÿd' ÚàC28mLÿØÿºë¤Îû#¼ZÐàíþ4ú=öÃôïõì÷cùù½õ·ð‹ëtè­èëÔíï0ðRðˆðòñõ-øàù„ùíöÂòDï îîðQóŸõ2÷ ù€û«þc¼q” ¿ 3 ‚  ú É€# ¨ 2 ® —œ‰y›'"c 2 Bþƒ-ï$•pÿØû-ù¦÷ÖöÎõ‰óðÒìPì@ï”ôû3gôSË…þNü?û,ûZûüýÓþ‰ÍBÎé 7};Ì(£É}ˆ7®ûÕ÷vöÔ÷eúÌûbúþõfð,ìŸêœëIî˜ñ(ô:õ·õcö5÷å÷øY÷éõKóð+íÙëÁìâïºôRúËþã)'ÿ‡ÿÝKf Ê É Ô ‡ v d [ × Ý }p#F7š_×´ª ù   ž]…ªÿ.ý½ú6ø½õoóò@òÏó@öåøû¾üþÿþ¶ÿ€ÿªýKûâù%ú\üPkg´ÃB¼ÉxˆG+Ϭ<¸ Õ 0Ý » Ê5ÿ9ý¦úaø÷³ö‹ö_ö[õWóóð$ï§îð€òÎôöÀõ õõÒöù«úiúøtô>ñ9ï1ï$ñÝó%öøñùxû±ü,þVçì —:;µÍ>ÿ4/  š_¼ V a|'†m„S P  ]žE ¤µ›þïùäöödöìõôÛñàð$òÇõcû ¿«¯xʾ`Åÿ!ÿWÿLäc¼ &iT , A V 5©FCèþ—ù@öõ÷–øXøö¨ò+ðdï3ñ®ôœ÷„ø ÷4ôöñòiôü÷}ûEýrüÁùdö,ó ð\ïÇï¡ñ ôvö­ø÷úý~¬®> þ ø € ¾  Ô ™ÞU! F Å B × ­ 5 À¶Å³éŒÁ0 ÇÒáÿÇÿ€…£þ€ûmøQö õûõö4öõæójôã÷/ý Ð$ ¤úKýÃújûYý-ÿKuÿÁþ¤ÿÐç°2 ˆ ‡ = ÍÔ ò# ¾G[Áýnú ÷…ô ó©òóõÚõ³õQô&òoðžðóoöÊøÖøcö[óÞñ¥òºõdùoû_úKö<ñîiî~ñNö|úñû@û%ûýOˆ µ 4 Æ ‚49 b á-Á  vdèp ù[‘ A u c /‹Eo— yc…mÛ**šÿ¾úÈöôLòóðBððïËð\óÚö~úsþCx«g¡6ÿ:üüúÁû¼ýÀÿp% j^ÊzhAm.:=ñÏtÚÅ4Mû÷bôôóîôcõôlñnîìÒìÇîžñäóõÈõ~ö`÷@ø”øó÷Üö¦õKôýò'ò¼ñ«ñåñ±òXô×ö¡ù5ü ÿÚ!æÉ:ˆ;yý~r í — y , ü Rg+ 2 % » s ˆ ö Á ±ê ŒçdÇþ$þïü5ú„ö¾òð`ï´ð@óÉõâ÷ÆøIù¾ú<ýˆ7zEZþþùú½ø©øàúþhûï›ÿ´ÿ=\T + q RËÿiÿ'C ‡ *ÿñúø¬ö¿õôÃò[ðeî¡íÃíQîhïíðvò¾óõ öööî÷“ø ùàø÷²õôÌòEñ´ïäîØî{ïˆñˆõ”úZÿo5œ(Ô   ÅìÓä    8 {íŒI› ý zd Ï  t a Œ ’ {àžèÕ~üöUñïÔïòÏóÑóÑò„òõûŸî^ Ã&þLüÜýp³’Êýlû=ûhþŸuL Ç E¡ö‹TûBûN¦^@p6|,µüôöòôïÉï]ðÀð«ï<íëê˜êÒìvñ:÷èû\ýÇûùúö£ö:øüùñùM÷²ò;î+ìcíIñDöúÝûYüýTÿ1 Š ~ ýeTˆ¦ ' •ü¬  òÁjI` œ € Ï ¨ ¡ æ(Ld ¯¿ ¦þ”_ü>õïIíîsðÀò#ôõÉöƒúSþ B î ÀˆyþôüÆü¢ü&ü"üOýÿqsít Ü ÃÅi3 N Z  Ât‘þ&–ÿPþ¹ûö÷Žó©ï?í/ìçënìÄíºï`ò‡õªøNû[ý¦þ—þÚü˜ùËõ€òXðëïñÌò%ô õþõj÷$úþñlSÅﯣÃt Œ 'MÙõ Ó ’õˆ>½ ó Èî» ¨ G ½ ²  ƒ u ½ ì S n `Rÿÿú¯÷õ·ò½ððñwóu÷¡ü²jDÂNÁãòãDgý2üýéÿ|`xL&¶4 ¼ Hé © Wy!2×t‹ÿIýEü’ûúß÷LõÆò°ðþîhîïhðòªõÿøˆûIýRþƒþÎýWügú.÷5ó«ïßì¶ëÔìdï©ò›öûNÿ#oq ® ” W 7 ç b"¼ Ô î l Ï ðrÿvº ka1 ä y·ìX ‰†HÂÿø6ò+ïEïbñžó•ômôJõgøNþhá _g[ æÐûøØøvûþþþ7þxýiþIT ª Ð *FŽàF ¦ u ' íËIN<§ŒòÕþLúžõÅñiïHîèí¬î@ðòúó½õ<÷UøOùFúÄû4ýÀýeü3ù“ôKïÕê[è,èIêbîó­÷üÑÿVû7¥$Ê 7 ° ì ’ þt Ž “ ÆØí†« A ­IX  á"Q: ²5ÉÝ Õ²àü8ø-ôïñáðNð–ðõñöô÷ù“¶‡ à €Øÿ{ýîý ÿ‹ÿßþý×û;üÛý2çUÓ1µgÌà ; ú # Ί‹ô¿Çÿ¾þsýºûµùõ÷cöSõ¦ôôSó]òŽñ/ññOñˆò ôK÷4úÀü²ý6ü[øóDí¾èçFé%î–ó¾÷úCû?üCþ}.8œ A @î 'þ i Ô õ . æÿÙþ^È È Ÿ € ß $—g_ Ÿ ` ×U×Sº"Ç÷qþ9ú¼ôFï…ìéínòSø¬ý 'ÿ6ÿ—ÿ-ÿÆý üîúWûCýËÿbÈžþêüý;ÿ¥ŽÜ2C° œ * —ÀÝÐlÿfüYùúö¸ôhò“ðÞï¸ð^òôÌôXô-óóÈôèöï÷ôöRóîê,ékëWï¬òKôõ¦õk÷‰úÜýQ@HÿŸÿQ¾† ¨®Ú¤  E hœ·J÷¤Ù Û ‡ =  ë Ë Þ ˜†ŠÿÃÿÑÿrþšûø:õ5ôyõ#øøúý<þ@þiýŠüžû¢úÞùú‚ü~ÿσc-ÿ¥ýªý@ÿû8€ÿ™ý=ýùÿ¸T Ã,<] Î¯Ñ £ — -xÿ0ù€õZõJøüþ$ýÑùaöUô–óÆóôvó¯ò×òkô ÷ÍøXøŒõñ™ìêêWìÔï­óÃö’ø”ù(úúú©üÿ3¿_—æ=Ì 9 ~ ý ý?æ*Êœ"<Q  Á j€ ³ Æ ;? `ýj_šþ”û$úîùú˜úÚúÈúàúØû2ý÷ýý•úy÷Mõþõ×ù7ÿ{qý_õþÿåÿ°ŠåÿÂÿoðT S oê q M] w ð †À—ÿyý4ýæýýýü"øžó–ðþïòƒõcø“ù´øÞö·õ×ôÕó­òçð÷î–íòìIíøî+òÔõÈøŒú[û¾ûîû3üÉüýý®ÿ-'XÑÎ_ ˆ o _ ¥ ªi C  ÁßIk ß ¦Àtq ¬ò» þ Ü£²þ(ü¸ûüýKþþUýÄüSüÞûúúÍù›øq÷ööÓ÷púiþ±Øó÷™Ýÿ×ÿÛÚxMÛ²5 •c/ ´5 ý •­à 4ìý-üþ©ª£{þðøƒôógôÓö§øëø@ø÷àö#öõó¤ð„îŸíîNïEñYójõd÷ ùkúˆûaüKý,þTþ(þ‹þÿ€R$ 1  ɧ«oB ¢ ( Ü Œ y ökôÝ W   Ù ' o § Á ÃõÿþûIùä÷É÷ÅøŸùKúgûýüÿìF*Åü³ù¤ø#úVý7O þóüýÿ°òoÑ› , L ø 7   z Ø ½ É ä  ç —Ì«ÿQý½ûEúørõTó¦òéóÕöpúýþËü²ùÎõ_òEðXïÌî¨í×ëõé›éìSñæ÷úüÏþýÃùn÷ó÷¤ûÆ)Øk@×ÿw2 Ù ÑÖ¬4v` dùµ Ö˺< ÊoÞ nQúÿÙQ¹ÿˆü”úßù<ú{û=ýþþ)/™þ1ü&úø.ø ùú³ú¯ú³úrû8ý’ÿ‘ØØþçý‡ÿ9 t „þË* M » œ à ã–¼ I ÖR“ýSüêûVûÌù÷ôöñTò„õ úký¤ý`úõÅïéìÁìÜíŸîŒí­êsèé?í–ó³ùŽýþlü·úÕúIýºÀ˜Ù¦þþGê= ' FMªÙ# n Œ Û  ‰¹å ͤ ú—ÅÓ¯2©þ:ù÷ŸøÂüà÷A½ÿ9ýü÷ûæû;úˆöò\ðkñûõ7ü™(~¨›ýýû¼üFÿµ üØF;ï _C5 – sV }¶!YÓjîýCùRõvóôöøùvø‰ö ô’ñËï½îMî.î&îRîÐîFïÁï<ðÅð·ñ!órôÛõx÷"ùzûKþ±&Âÿ®é4“ï‘p3¾I C å | é‹1ÇP Ô É ¤ " óüê`þ*ü¬ú*ú{ú|ûóüíþe•ÿÖû‹÷ÖóÎòôPø$ü³þ'ÿþþQþBÿ³ÿ©þÚü^ûaû&þ4 u+¢çzvã t ®  iF€ Œ Ìò MÿøQô|ô%øšüþ-üpø`õ¢õXù¼ýÞÿ~ýÑöôîøèÓçësñOö¦÷:õ½ðêìÀëmíððäô‘÷»øwùzú`ü.ÿ¬‡ „cþcÿ6IQ Q í ]ˆÐP = Õ  «Õ \Cìw þ?ý2ú=ú.üñýYþ–ý˜ü‡ý¨óȯ úOô©ñóµ÷Zü§þdþ6üéùÔù ü¾e_„ïÿ ÿì|cB°âž@ ³Æ†B [ » Ò  ÆPÿÀû—ûëýàôœóÿÕü úÒøÑùEûü¤úaöÆð?ì~ê&ìzð=õ|ø¸øLökò‰ïKïÄñàõÍùØûKûóøa÷‰ø½üU€õ–Jû|ùøûɲ  `{ ß^~L. ¦2 Ø}©ë ®ä[ê Œƒü[ú×û'ÿ ëeðþ¬ý?ÿ<„ܨÑýÌ÷eô«ôøüZþþÙûòùQú'ýÆ£Ô’k6±´ÁÞ ŽV b 3 ª „  q°7@ñê2Bÿbÿ °Bénþ@ûñ÷ÈôËñ„ï®î¡ï±ñ2ôö$øóøñøjøå÷;÷½öSöÁõÎõ6÷¥ù‹üàþüÿõÿ>ÿ¦þÿ£cU( ­ ª õ ‰   Þ®Æ]ÑÙ ^ V Û , Øs„9þþ¯ÿŒ‡Ï¡„¬þáü4ü ûmú²øïö-ö÷‚úhþ¹öÉ@PÇ*}m#ú$KÑdñë’ © É Ûj ¼÷‹tÒý ü8ýÿù¬ûÿøû÷âò÷ðßñkôÄör÷PöQôÚòRóÆõãø¸úFú0øíõÒô²õ¤øðû£ýÍü)úœ÷"÷wù þ?`—1ëÀË æ ÿ XT~ý‹U ŠßE½c (ê¨'ýTüÒþßëuz=DþÜüýíý%þý8ûnù_ø øwøùsû#þ‚âüåµ0dèý+ÆTÿÿ¯|y­z Ô€&v *ôÓzƒµ‘|=GÕ/Äý=úT÷cõô}ô¬ôåôèôòôxõ0öíö¹÷@øiøø£÷Ñ÷€øùSùPù×øXø_øòøÖùÍú´û¼ü,þ0jÖ „Ù»°x \ ´ ˆ À­“ùDZÿÿØÿ9:ÇtLßµ½Z¢-„.1µRÿŸþ¹þ&ÿåþµýû£ø¶õýó–ô0÷¿úýýa¥¤¬›vÆSǪ8ؘ‡¨ÇÿåÿtW··›\˜ÂÏÝÿÿ)þ§üûùYöÙòéðþð8òôJöøðø=ù¶ùxú&û’ûöûü-û‡ùN÷ªô^òDñôñ~ôÏ÷ ûŒý¥þrþþ1þÿŒÂkÏm°IfÔxo‚ºëxa!þ†ü!ü ýŽÿÒóòxÕo˜ýüfúú±üÿPÿåü4ùpõóLóVõø5ú2ûÜû@ý÷ÿæh q°øàþcýÈý–ÿµS¨„ðôÿ–?C9—×" oôEýýôýîþOÿ8þ…û†÷ëóòxòfô“öoø3ùÈø øÉ÷ømù™ûðýÿþsû7øÃõ9ôýóõÀöNøXù¡úÞüÑÿ!¯m÷þµý<þ·ýD]yÐ ]·ÿý¹ü þw…¸Ê«ÛléV ý%¶™ý>üdüüü’ü*ú>öÂòàñ3ô&ùõþ\Wïñª….ÜÖNÒr  ú-¯ÂþÙýfÿcàw€¶Âü d  = å09þ®üòýÊ'E±ü¤öÅòÔñRóäõè÷ø7÷sö7÷!úmþñ ækü_ø£öf÷êù`üfýÊüMû-ú‹úDü<þ„ÿÿ^ý¯ûüøþ¯£ Š } üÝ¿M´“qÓýýþ&\+‘FO„Ž”Ø– Ú¿ùiÄÿøþ­ýœûüøVö•ôMô`õë÷Úûìÿ{Ûj#)nV8»ÇB¸1˦¯õþAÿÃy‹y cb¬‰õ€ " Ôx›Jÿ[ÿvÿ¿þôü€úrøéö€ö=÷Ùø úþûgüËûÕútúwûKýÎþ9ÿþŽûùƒ÷÷‹ùÃü@ÿÑÿþþ‰ý)üûgüŠþ‹â„Ë]aÝ}†ZÅÜ=.k]@Ò5ÿúþW–§b‹­¸ÊG}£;%0ü>ùÂ÷À÷¬ø4úùûþnªÓÿãþ¡þyÿ|·Kë Jž£Ýÿÿþ¡þgýhœXXm±&¡×lAÎ|?á\ŒþóûùùßøJø ø¶÷€÷o÷ñ÷ ù’úÈü¸þËÿžÿ&þþû×ùÈøùBûõüTþÞþ_þ9ý¾û¬ú™ú4ûÒûküøü›ýËþÏWú›¯Üý÷æ=É´WŽIÿçþqÿêÿ<—’<óv›2…áœqÿýý#üþùrø%ø4ùKûiý¢þ‰þ„ýSüüÂýj(úP ùfC"·þ‘ýÜüñü+þQ3à-† v <™ðÆÖ¾Š ÿOü6û1û|û›ûìú™ùÀøÊø¾ù1û üôûõú{ùì÷³özö†÷ù×ûXþΙM”­lýLùöÑôwõª÷²úwý;ÿÃÿ^ÿÿÅÿ:Ç|¤Ëù¹jv\‹æÿNþþ‡þdÿ>a)øÿ0—‹ÿnþvÿ$=¡Wÿßûù|øúüüðÿ¾ÿ«üAù5÷ß÷VûŠÿJ—ùnÿìÿ{´ k ì ›…`ýGýÞÿcÚüÅÒÿjL ·ËUÿ'þÿ$8íâÛüúHúý”©8OüöNñ®ïoñõXø˜ùçø÷÷ýøýÄ)ÄÈ#ü'÷Ìôœõ1øÄúŠûšú%ùzøµùÑü\¼RUÿÙþî¼CÁ ¹)Ë¡ýÕü\þȦ©Ëžþ¬ýíþä¸êyxùa5þöúŸ÷êõøöÅùÕüÿÔÿQÿÓýtüÜû¶û=üõümýmýWý>ý©ýþ­ÿh4‰[mýxóX}¶´ÃÃí…nCj¾ëÿÿ"þTýýOý?þŸÿbÄÿóýxû=ù)øtøùKúšú/ú¤øŠötõòõÄ÷úü£ýdþPþþñý…ýüfû¿úûwû‰ûÉûþûü,ü)üWütý<ÿM?P‡¤ÉÝø þ6ÿVy’žvY”€“ÛÎýŸøÒõzö\ú›ÿ‹HDÁþ›û‰ú@ûü‘üû=ùPøaù%üÿJ*!èdÏU ¶}  ÿÿOSš³Ooòk ì O zAÿéþ\ÿ¦ÿþ¯ûWø–ö0øNü u°Èûãõ×ñRñpôæø³ü÷þ³ÿÿÿT]UýÞøžõ<ôIõ.ø^ûŒý"þþûýqþ¤ÿÆß0:b„LïØHõ§Ð@·ÿcôÇ蟋íõp~ÿÐýüüWýŸþ³×!êÿpû–÷¨ô ôtöÐúrÿØ j Ö2êÿ9ÿÚÿ>Ëä: (  •iB ÿ°‰Jq†Ì }Tãoÿéÿe÷Ùà;¨ ÿŒüöùk÷sõ¶ô#õ¦öÏùPý 2‹^ÀÿýÏû†úƒù`ùú­ûýýéÿ’ þEý÷ü>þ|GT›Dc°'õÝÅBªÿ½þ1ºLÅ+.ìšU÷S}¦þ„þ]½²ÍÿüÅøÕ÷‹ùþüÒKVÚƒZ†)ãþõü¼ú$ú´ü9  `©ÈS:¬ Û]åÖu, þþÉËÀIüwÔ$ÿû@÷îôõ<÷BúAýuÿ¬ÿBÿXþ‡ýý9üAû2ûü…ýÿ ±þýdüØüáýºþuÿ;ז׋oœÏÉÄnµJ²ÿÙÆ¶ôæë‰’ÿ!ÿÿáþ{þÙþL&Ì4î¥ùÛý5ûÜù1úýû[þ¶Ô¼ýÿ1þõûêùÕømù³ûÁþ"ÌÕú<ì¥QE/Ò`“ríŒWÖÿ´þÙÿÜ ‹•ƒÿè§hþUøÃôøó^õž÷Fù ùš÷èö#øVûHÿzão»þ3û¼ùÀú—ýÆ÷—ÿû÷}õ!÷1ûÿž×uþ›üwüzþ~¤ Ü=¼h‰tý}ü£ý¡ÿwÔ.ÕýñüWþ„ò>‘¹¶ˆ*ÿýžú¶øWø údüÆýeýšû¬ùÍø­ùÎü0þ4s_]E$øŽÃÿrýsüýÿDôŒ©YÜë¹ Ë ì Ô ÛýCü!û¬ùø•öÁõ–öøù°ùÍù¸ù¾ù6úûgüôýÿùÿ×"°âÿ®þÆüÝùòöôØñkñ½òÍõúÖÿÎÉ|/Ù°ÿ{$_eÿzÿГÛ«þü±úUû®ýkXŒOONçÿcÿªÿÖÿÿŒþGþ6þˆþÍþHþSü­ù›÷•öñö¯øû ýÒþ x«aŽôþÜü…ünþoeú$l÷þxü*üÉý) ã¡I FÙ+ÿ‹ûÒø|÷|÷¨øNúdûFûkú÷ø˜÷÷{÷Ÿø…ùÒù"ú<û%ýªÿˆP ÙYþ…ú ÷ØóÕñAñòçóqö£ùýeMtþAš8ø¥yÏþÊüü¸üÍýrþ@þ·ýºýUþ ¯ró.¤Gš(roâ xêÿOý9úÆ÷uö_ö–÷WùûDüýEþE¯ÜŒæGCýïûiüoþàÅÖÿ¨þÀþ´ÿ=›#,° Ùºº J }iÂþJýôüýãü.üAûMú6ùöøÉù±ú:û—û¡ûñûÜüøþí"ǾLÍýÞùžöõÎôrõ‹öŽ÷kø’ùDûxý\ÿ0(~ÿêþ;ÿ~œù‚›±`…£ ÿþmýãü³ü»ý­ÿ}RÑÓ«w¿=‡%ü2RLÜþ þNý7üÉú˜ùƒù¦úÛüRÿÛfA2RÏn„æ>õÿ‰Áç<?®´ÿÿ÷þÖÿYœ±Ýüêê ¢ 3 ý ™ÖyþÌüòû“ûûúùüøúùütþ«é ÿ˜ýYýþøþ:ÿŸþýXû7úúÚúëû5ü?ûäùrù*ú^ûÃüöý×þËÿ_Õl6›°|$àB wÿ»ýüfû;üõþ‚‰SrŒaq mÍ$slê‰ÿ¿þ‰þµþÃþhþ¾ý^ýý“þ3킼ÀÿÿZø¼³ã¯Ù ÇÿXÿÈÿòl}áž8¯êO >¸×«¶D‘jÿùýgü*ûûöûýJÿ—Koúµÿðýˆüeü-ýÅýßý þBþiþÍþÕþþ~üƒúùù€úVüþŽÿϦ¥|öþÈ®ÿ–ý(ý—þzw}h³Ä3<`Gvÿ¢õPþºuÿÿó퀧UZpÿpþiþ¦þ¦þþÝüxûÀúªû$þœüšÙÂ¥‹¾Â/mçþ‰þ‘ÿõ’²ôû5½†}Ê‘$6zÛŒb<þÇúøÅö\÷×ùÁüíþˆÿžþ²üƒûYüŸþôÂü=úµùUûþýöÿ[ýÅùˆ÷†÷›ùÛüÿSÿ»ý.þ§–0øõ "þÜý,ÿ€T‡·ÔþÙý×ýLþñþŽÿuò¢’ŸÃ¶baøþþíýâþ«o%ü^®þý ý…ü ü)ü!ýÑþ¡á‚›A Þ3aÿ‹þNþsþÿ<J0ÁÄ5ŒM UsŸ*«–‹:])‰¥þ#ýü‰üêülý­ýOýÁü ü&ûú¢úŒû›ü~ý¸ý“ýÍýÏþkR˜8þ°úJ÷¨õÁösù ü—ýÂýæü×û=ü–þ¢îŠß´ýmýZÿÆ4ùxþœünüxý·þBÿØþ´ý–üòüäþÓ“Ó ýL'>3–ÿý6ý·ýôýCýèû¢ú¯újü´þ í‹Åø*ÿÏýÅüüžýÖþüÿÔÅ–ÿ¡ÿ[F–ÿnþyýoý5ÿ€ ¡A˜:iÿïý¢ûkùAøŒøþùÅûFý™ýüìúåù-ú„ûtývÿNOÿòþ þ¶ý5üúžøøöØõ«õ~öFø×úVýiÿÛ]çŸÇtLårÿÌüËú úÜúüýQý9ýýfý¦þ8«ÁÈüøÙÿFß*@ê®*ÚÚðÿ+ýIûû_üþ÷ÿ€øáùÇJÿÞý­ü'üÜüqþØÿW ¦ÿrÿÐÿ²h}³êÿM{¯Ñ.ÿÿ„ÿiÔ¥ÿ6ýÓúËùkúøûºý¯þÊþþŠý þ5ÿPFZ °ýáúøÜöfö-÷ùpûâý¢ÿ^Ž4 ÿ¢ÿŒq\~^ÿSþþÿ}ÚÿÔýü{ûùûýÉý/þzþÿs›¼ùšôMÿïýþ`ÿ·ôšÿãý»ü5ý“ÿð‰2@lÞÃP³þÌú4ùyúùý[Ã,ÃF¦ ÎW'þ~þÜæ¿=˜™ÿ¥ýÎý‘úÐ÷˜ÿaþËþ{„d~+iý¼ûÖûKýÿ ‰ÿèýü%ûãû?ý­þ±ÿbÿãýrü²ûËûýVþkÿ×ÿæÿçÿÅÿ›ÿLÿ*ÿ]ÿ%:T³vçþþ þPþ.þþ%þâþ ‹%3‹9ŒÿœÿÚÿÉÿ_ÿ½þ\þþâÿ']i çÝ^ª¥‘÷µ°KÔŸÿsÿ‘ãZg0—[BGVÔÿ†ûÌIÉFÞY=•dT Íÿ­ÿ7²à‘ÓvˆuVÃþuý5ü0û·úAû~üþËÿ¤¾ÿVþaýÕý]ÿ‰°Gÿ‡ýTý5þkÿs°èÿûÿ%ïaýºu lþÌüÄüþ¶ÿÎ-Øÿñþhÿöpb2—ýáû™ûèü[ÿ¿~;'„A¥-”ä=ůåçÿêÿþ"MFr©Å9.–ÿãÿKð{=W¾ÿœþ@þÒþ$y;;Òìÿc‰ïÿ‚þjü<úüø;ùÅú0ý­ÿ;µS>ÿiÿÎsDYý¨ûÅû‚ý˜ÿÓ}ÿýýšþϬçLf$ þüìüŸþO¨xÿ{ýNü¢ühþ\)`:þvû“ùŠù)ûyý^ÿ ­ÿÿ ÿ\ÔØ]`4õÿñþ—ÿ›<ÞùfÍO %€ <w5]ÇÆ²Œ‹ÿ{ÿ4XÒòÿÿ†þ“þÿŠÿ¬ÿyÿ4ÿÿ ÿôþðþ-ÿ‡ÿÒÿËÿ'ÿôý›ü˜û¿úNú‘ú`û_ü,ý«ýgþ?ÿêTKÛ9¥ÿ]ÿIÿBÿÿ¯þwþ¶þ†ÿ«¦Çª›–ŽZ}Tÿ þeþ<þqþ»þrþ×ýý`ülüÉüýÝü üèúú¾ùúÙúµûüöû ü®üåý”ÿx«™ßýž`¯uÍýøw›ÒF“€D•©Ù »]~*æ.æÿ˜þÇýýƒýæýEþ2þ¶ýîüZüfüý·ý,þ þý$ýèüÜüýîü½üü°ú ùš÷"÷à÷ºùðû³ý[þHþ3þ·þ1úJZËWÿLýüCýÊþ\z÷å_öûBi?Éÿþ½ýÊý þzþ²þyþëýýŽü3üàû–ûû?úùÈ÷™ö_ö÷æ÷¹øNùÄù­ú:üþŸÿ«Ì0Vÿ"ÿ±ÿŽk(n#ýŒž®j–S0 œôH‰a%^ÃàSÿ›ý®üšükýªþ€ÿYÿþwüû’ûuüjý¸ýHý„üûûüiüýÒüFû8ù’÷Œö¥ö÷÷Öù¡ûý@þ^ÿg°êgž%]ÿþÝý©þùÿLDµVaZ(|…kMvV@š µþyý-üû}úúÀùúUúú˜ùuùBùãøwøøý÷Fø¨ø4ù|ú2üêý‡ÿºž×ÿ/ÿFÿUÑ=üüÕ}Ô5LÏ@¿~ _ è tvA‰¤CþýÈüþ-¬¡åÿTýôú`ù\ùRú:ûôû÷ûû‚û+üGýtþ:þçüûëø÷¬ö[øû6þvŒÄZÁ£°ñ-ŽfxTÏ¿C±jFæDò/§Õ;ôÿNþ¦üjüïýæÿ¼I»þ`üNú‹ù¶ù˜ù´øV÷Nö›õ¾õÌöÙøCûý6þÿæÿÊÆzõð©–Œ’KOkÞδ áÂ; † ‘  r“7)×Ä×þõÿ$þü_¨ïÿôý“üèûÚû5ü±üêüçü±ü·üûü\ý™ýYýÀüêû´ú“ùù;ùú=ûüÜýKÿ¬ Ýy$ÏŠJ ì"|ütB€ÓñéȪ¦©*,ÿbþœýhý”ýÁýùý"þ2þøý‹ýöü¼ûêùÞ÷öõ±õ•÷úPüñý¢þÿÄÿÑ6ñYO©õTÍF‘jk×§kc’g ï ç –  ! ™ÝÎdíg{ÞÿZýëûûíú/ûˆûü=ü¸üCýÆýEþ0þýsüñú`ù)ø«÷Pø¢ù ûyüýqþgÿŽœb†V23eÂSÈv^hÜè÷FÜPIT|®š#þCü±û~ü-þ¥ÿcJ©ÿ¶þýRüûúBù:÷àôóêò”ô}÷±ú[ý¦þšþçýŒýÔý?þÿðIi>‰=é –ï¦- ž Ù –í]O㡵‘›žy )ÿÇü#ú5øÀ÷”øBú ü¤üþûBû û1û¹ûEüBüûú}ø”÷¦÷ˆøåùrûcü~üCü•üVýÑþ¨riyc¾Ú'ëë˜|·ý #PÙs$Zs­ äýªüý¡þ§HJý:ú]øsøÑù úúCø¤õgóCó+õñ÷Uú€û=û“ú[úûÎü\ÿüùA@¥Òc¹ª}áû Ì(eê\“n ¯  ¶§Û_TøbþûZù–ø&ùLú&ûôú×ùÉøÈøùù)üþOþçüfú—÷îõö^÷°øBùýø'øø…ù‚üþÿ[Iþþ6ÿ³zˆ¸zOñZ*aI¥•zþäý×þÃK¯ÐØÿ´ÿëÿ#äÿzþ4ürúÓù“úêûý ýû”÷Ìóoñöð«ñ?ó`õåö©÷®øÀúxýwR”ÿzýküýÿLøy R·æ¬\ÂHòŒ N >¶  e:˜Ññÿ'þëü¸üLýþ^þ!þNýñû¬úÿùØùèùéùðù:ú¼ú_ûµû–û¸úäøõö9õô ôSõu÷ªù±ûSý±þ~ÿŽË&{§Ø‹Ò>´å 0wŠ@µ-y)æDÒø9©³w ÿŸýü ûÑû¶ûGûúkùÝ÷Oö9õ¯ôÛôõtõ&ö÷´øÚúñüRþ+þáüûöú/ûXüšþ)DžBÓÙ°X ýÄpè¸ ÷ •N ¼ 첩¬‰¾7þƒýþÆþoþÔüOú*øƒ÷Âø¸ûÂþ9Xÿ±üÑùÑ÷‰÷’øîùÀù³÷õãóEõÛøwý±Í+³0þý×ý ò|˜Ç}’Ü<  5YÈx³ûElÄjvè¡yálýûxúúúÑû ûÀùY÷Œõ9õÙö.ùJúûù}øêö ö%ø=ûVþ¬ÿÞþÆüëú‚ú6ü‰ÿÚ¦‹1²2)J‡É¶dÚ ` ¼P$ ù%Q×e»ô¯9ÿþƒþõÿzE2ÿÝüWûûüÒüÇü‹ûïø°ö-ök÷uù‘úLúiù~ørøú7ým=¿gÿ¶þ®ÿMÅá½ù \AÑ€ ó;*‘ÇS—¬>ydù9Æiû•wþŠûÎúRûJüÆüšûÏù·øÆø8úÜûý!ý¯ûÛù¹øžø’ù'ûcü¡ü üxûˆûü‰þ>­ßH›rBÐnS°ýH H à  m î Ÿ ó f/Î`ô²Ó¾Œ=•·uÿðý€ü–ûXû=ûÒú»úxúùÙøáøIù›ù¾ùåùöù`úÉûÜýðÿøÇÉÿçþÓþ‹ÿ‹êxëcYaÙ•¡MÝæå¸ÿû9}{Õ£ÿoSƒþTýÂü‚ü6üû¸úùù8ù#ùÈù«ú†ûúûšû²ú¨ùÍøÍøeùŒùjùrù;úÑûŽýRÿ¯¿äá{Ì]sÖ£4  P » ½M»Ö¶8†¯ðmB•éã=ÿþ§ý þ’þØþþÚü—úÄø øŽøèùû2û8ú?ø·ö÷0ùâûüý9þjüØùøwøûñþ9›­oöþƒÿ÷3ŽÝZ˜Ö'\¢  G½wk\=jÞN%+|(?þ;û_ø÷Ò÷åù§ûü•üzûúùÌøùùùþøœø5øNøù3úbûiüŒý>þEþ‰þ7ÿÕÿ©ca¬Ý½N¢eÞ ñ Œ3°ü îæÙ'ùÿª›À»ÿ5ý„û‚û–üúýmþÛü/úøE÷^øaúúûöûWúï÷öíõ“÷úêûvü‰ûúqù–ú6ý-\Àåÿãÿ3†í,ŠýŽÜPôb{ÞEm”„ÎN{ÿÿÿYý)ûÞø÷øõÜõÎöò÷ùú€ú$ú†ù'ù ùýøÉøYø¸÷k÷ ødùÇúÏûxüÞüŸýþlÿ:ÉT‡¿UÎ#B’ ã ÿN î%1ûzׂK1ÿrþgþ‘þ§þšþPþÔýýàûÅúöùdùáøZøÒ÷’÷÷²÷"øÝø¤ù/úGúúù€ùJùWùÙùñú]üÚý+ÿÇÿôÿ€¢dôcQö–¯0=R¶Õ‰•Ç Q5‹Wéÿ^ý û£ùÞø…ø3øó÷7øùÅù~úáú»ú}úrúOúÎù]ùÍø˜øùéùû‰ûLûÑú»ú ûüÈýXÿcç"·Q§^cÂâe¾€.{ ÌõIC¥Æ<PFÇ$yzÿ¤þ«ýüâúù“÷ÒöB÷Løvùú$úúwúQû>üÏüåü=üûsúûYüþ¿ÿé=2 hý¦9h@ÔŽá†Æ–f{"*/ÓXÊ^,%röÿýþAý‘û´ú^ú—úYûôûëû'ûBúÄùÉùrú~û!üÏûÇúNù9øaø"ú'üáü¢ü7üüžü þM¹š9§XFukt@öÏ c F;l·|'´Ân‰%þ‹ü¾üþXÿ¯ÿ×þÛüû ú]ûNü@ü&ûˆùø×÷ðøßú½ü“ýŒý'ýýzýtþiÿ¨ÿ(ÿLþ¬ýÿý‚ÿþL2Ϩ‰‡Æãî«vÒv´”ë1ä”és®¡¾ž>}ÿCýKülüÈü·üüû2úú¿úcüýý¡þôý)üútø*ø;ù û°ü•ýèý)þÿ—wø‹ »ŒWŸ…õy‘é Ý x ç Î Ý cVø•96ë:*ÿ/ý3ýöþ{3h¡¯ÿ`þ:ýÓûú6øÁöwöÚ÷¶úäýuÿþtý6þ¬ÿè²ÿ¹ý4üü¨ýÉ  ú°DÏkë(KD»ÿÿÊ"…% zßÈHI” [ýû]û.ýéþ{ÿ‰þÞüÉû~ûüDý)þêýüçù„ø%ø=ùûhü·üCü·ûÊû"ý´ÿcP/ÿŸÿ7Ç8K-¦B q k ÚGñŒa‡Ó·º6€£ºô“þ”ü`û™ûÈüÜýýýý—ûVú.úû_ügý™ýµü€ûPûwüôýñþÄþPý{ûúáùsû@þém·žrØþ6v‚¹™ÿúþc¥ë`OcyW#–ÜÉ%&iÿIÿ‘ÿ÷ÿNœÿ÷ýDü‡û´ûhü†ýúýý‡û*úIùåø ù†ùÐùúLúÐúÿû–ýÿãÿçÿ–ÿtÿBÿFÿÏÿ_¹Å<L´8üdžÀˆ`k¹?­B÷í=Y®hyÿ­þøýSýŸüFüÚüþÜþiþäüûÂùƒù\úÓûËü÷ü]üÚûäû5üŒüÏüíüŠüØûOûGû­ûòüÿÕ¥Ô¹wkub,Ó|caÜä…tÜüÿÚþÀþRÿ²1|ÈÿÄÿÝÿ™ÿàþÇýˆü‰û·úùÈøêøÆù€ú¥útúú ùzùEúmûßûÃûÖûüüŽüý¬þIÿôþþÉý·þ¦453ù¡Ù1,kÝ~ÎüAÓCö;ÿÓýýüü¹üîý¨þÿÕþFý6ûÖùùUù„ú—û©ûùú¦ú ûGü™ýþfý|ûrù[øÎøÍúHýäþˆÿ}ÿlþþÿKþ[ößÿ³ÿÝ9©ÃðÿÿœÿÔÿ#Uƒk É•|^ ÿâýãüŒüÄü1ýtýEýuütû5úJùQùãù6ú†úÎúåú^û üTüüîûïû üü•ü›ý…þMÿ?Cq Í|âÒÞ'wÊüôH5ŸpÍ[›†ÐœvQÿûý4üûûšû7üîü(ý ýâü ý‡ýïýšýÑüñûcûÞúåú­ûÍüeýýbüÑûøû;ýÿjõŽA½ÂÓÀ Š0$Þñ—ºþ%ÿ~ýcüVü^ý,ÿ¨ .ÖÒa$ý¯ù;÷¹öŽø^ûuý`þþ‚üŽûÄûNü-ý þ þý üüPý¬þúÿ¬%ýþ*þ÷ýªþh„6„³2÷À§ö.¤ë° ½ ౜µÁþý üàû¶ûü'ý×þ—S¹Îÿàþ5þ÷ý}ýýØü^ü+üÁüvýþ„þBþ%ý±ûjújúÓûõý2H³øšý¶°ª"’j²xDkl ƒÿnþêý€þä¶ßý§ÿZÿýúû´ûrüìý5ÿ[ÿƒþ’ýYýRýRýÀýþÆýkývýÜý’þ½ÿ¸¥ÿ5þØü,üCüAý2ÿ)ìˆtº ‰eä6cáT  n^ ðäò·\[p@Asÿñþ’ÿ}âÂÈÿ“þþhþ§þÉþøþËþ2þ$þÊþsÿ¦ÿÿEþý%ülü…ýÔþ‹0p½ÍY±å†3(nÚj¼á¼{ OÄ’»i^åõßÇÜÊïeÙþ¨ý÷üöü¾ý¬þÿ×þ0þ£ýÁýŸþÔÿöþÅýý0ýÈý…þèþÜþ<þXýÙüÿü«ýØþ^¯ºã×[Rø_²ùâ Aù˧¸3‚‰){„5ÿþ_ý¹ý?ÿþÑAûÿÒþôý•ý+þÿzÿÿ&þAýŸü$üüRüÊüýXýÁý$þÌþýÿc?šâ”ŠJuÿ$ÿGÿBÖâS"•]iÿ$ÿæÿð¸ å» `Â`-_+qþ»üÀû²û`ü€ýþ*ÿBÿÿÏþ¤þÃþãþ¯þkþèýiýÕý¹þ7ÿÿXþýÒû`ûrûü1ýeþ@ÿ#áÄ¡ ¨i‹~­“>S¨ÂÕ#¶“—! Fº–ßùÅ8ÿçýcý^ýÅý†þÿ(ÿ¶þ6þËý'ý[üÑû ûŒû¨û2üIýÖþLY¡+o×ÿ¢ÿåÿp¯³âêÞ?ÝUçNoþPýHý‘þÓËVÌѧþh‚þ$üuûÒû ýsþóþ?þøüüHüÙýûÿΙÐÈþ‹þtÿqSºþäûIù*ø|øöùBü1þôþ ÿ7ÿõÿ”]ƒ}?­ÍÑ»"#oÃY6:åØg}2YÔÆ{þÀGþ¥ü8üjüÍü.ý3ýÐünü¤üWýþpþEþªý¤üÝû!ü¬ý{ÿ _öþ´ý@ýšýþ,þNþ›þâþ›ÿÝñu/åÿëþZþeþàþTÿ¿ÿMÒUîbM€=­þ5ýJü.üÑüçýüþ^ÿ÷þ9þàý.þHÿ«‹ioNÿ‰þ»þxÿ¶ÿÙþ ýæú7ùäø+ú[ünþ¥ÿÛÿ}ÿ.ÿpÿ ºMô!Í'…'#‘²PÃYØ6¤iià ÿ¹ýÐüÀü‡ýpþÍþÊþ\þÏý¦ýÜýjþçþŠþ ýíü³ü2ý%þ\ÿ^Tfÿ þêü¬üýÇý±þrÿÐÿÃÿÇÿ=Ò™Éÿ&ÿÿaÿðÿŠ.JÝ0˜ÿKÿÿÝÿŸÿæþþmý°ýéþPøÉöÿ’þrýuý›þÛÿªÆ^ÿ5ÿ–ÿ#AÿþÍûžúÂú¶û@ý”þØþkþÿýòý›þ×ÿ‘wëÿÿ‰ÿìÿüÉÜ’oïÿ*Û¡ ÌâgL£,W®þýýQþgÿy”'ÿ¦ý›ü„ü[ýqþÒþ8þýùû§ûAü›ýCÿýþý;ûnúúú‚üOþ¾ÿI“ÿvþþÂþ˜ìÿ®þýÇû³ûý%ÿ‹}®rÿsþ+þwþ–þŽþ¬þÕþëþôþÿ¶ÿ2'ðÿVÿüýÂüVüiüèü þ#ÿÀH~ÿîþ•þ¤þàþ©þ°ý†üÌû¾û1üÛüaýìüÏû û+ûsü}þª—Bº¾üDé‹7ÛþþËý7þzÿa\ýx¦¦FÃ<. 'ÿ9þþiþ©þWþæýwýßüjüsüý/þÜþ ÿKÿœÿ¼ÿkÿ³þýWü}û{ûdüNýíýhþ•þ”þÍþÿaÿÀÿÇÿ¯ÿÿfÿ'ÿWÿåÿrì.OÅÎÿ´þþúý þzþÐþ@ÿºÿóÿûÿ¤ÿÿ¯þšþ+ÿÙ}ÃÒÿ¸þUþ,þéý…ý9ý…ýXþVÿøÿÿþ:ý‘üdüÞü…ýEþ<ÿ5I×íøüÿ=ÿÅþœþÿU¼Øëœb—ó&<( ygf²×ÿÿYþIý…ü‡üBýYþxÿ‘}a‹ÿjþnýÒüü¨ü ýËý·þpÿ×ÿAiÊÿðþ·þæþ6ÿSÿÁÿ”µÇuÇN>õÇÿ™þ þ.þÛþðÿò8¨oÿ`þ þKþøþþÿÁ/YôçÕÍÅé·þçü&üäüþøÿâIn­ÿ9ÿâþ'þ“üUû>û_üžþpì {óeT4=ïÿÿxþãþdr¨®ª' .Üz×½åxíñs8´ÿ´þßý^ý¹ýNÿó’&þÚÿiÿ ÿÌÿ¿ÿcÿÉþ(þFþÿÑÿ ´ÿÿTþþ¦þÇÿò†Èñx…ï!U„éÿ•ÿ‰ÿÿÿ‰R¼Šaqps˜–¡¯Ò6~@ïYAÿ{ÿÇÿ<ÇÞüÿáþ\þúþH&EÊÒÿìþpþ¬þ–ÿ30ÐÿÿïÿˆAö[Y%¶C½ ú®!ç;ËMÀ¼$,·ü×ÿLÿdÿíÿQª¶˜ÎL>+ÿþ`ý>ýÑýÙþ½ÿôÿ&ÿþFýöüÔübý×þ`æÅÍõµ2 3”­þDý&ý!þ>ÿQg˜ }‡Äd=ÿ)ÿlÿlÿÿŸÿ[ÿÿØþúþ¥ÿx ²{ÿ½þ›þœþåþÿºþÇýýüüˆý8þ­þËþ—þIþ‹þ–ÿYéG£¼ Ø+Vfêªðÿ$«”__'a¸Vn†äþ|ýüöûoûûûìû€ý<ÿºtEZÿ þ³ý£ý“ý]ýíü„ü£üsý™þ”ÿ¤ÿ¶þ¡ýý9ýœþ’,Ì'kp댻-8¦ÿöÓæOAŸþbýuýFþÅþ®þ)þÉý¡ýüýÿ\aÁ%Òÿ4ÿtþhýoü*üü.ýÈýiþøýæüíû¡û üÝý›¶5^æMÿBþ,þÿBã¦õÿLÿGÿ6ÖQÍCI«¼ÛÁLÁ"ŒZM²þ¸ýîüúûòú*úãùúJûLý‚ÿ§iZÿ5þÁý þ‹þ–þÓý„ü$û>úWú<û•ü“ýHýìû‰úGútûÏý·óõFØÿiÿÀÿM¢3ÿªýüuüZý§þ°ÿœÿþ*ýaüGýiÿ~hÉJÃþîýTþÿ@ûÿ¡þ¯ü8ûûlü=þpÿúþüüÉúýù ûŒýãÄÿ8ýëúxúüâþ}%¥ªýãúÏùâú`ýÀÿ˜I±ÎD9á0=5Ž9Ú¶U7§ÿ†ÿ´ÿ|ÿ»þ°ý›üÈû™û6ü3ý þ¦þæþpþ‡ýíüÜü%ýŽý]ýïü¨üdü üüDüŽü¬üœü®ü*ýõýÿB)±­|²„c¶ÿOÿ ÿ@ÿ·ÿòÿíÿÿYÿHÿ¼ÿBpýI¦ÿ(ÿ ÿ%ÿÿ¾þlþ;þþAþ¾þbÿ ÿÿ ÿþþÅýÃýþwþjþþrýôü3ý6þDÿ»ÿÃÿeÿÿdþïýxþ£ÿÃÛ—¶]2˜<ôBù+ÎHÖÝÑq»·/?¡»þyñþ¿ýý ýƒýþÊý;ýüüÁüüöüøýÑþ0ÿcÿmÿ_ÿüþhþäýYýýàüºüÌüŽýÜþfÀ˜ÞÓ¸^OF©[^dL#ðbÙÿüÿ×›Ð=;ÿÿgÿP>Eisÿ•þŠþ_ÿNß¾YÿÆþhþ¿þcÿŒÿÿ;þ´ý÷ý×þ—ÿœÿ ÿÞþâþÇÿW—µ æõÿßÿ·^þë>ºñ¾ýqdŽ‘n²½ÒïÿðÿÆ©›_ÐÿSÿ˜þýàüjüMü3ýåþ‹Šª“ÿœþþ8þEþ/þÖýuý_ý-þ©ÿrv ‡1Xe"4F×ú+×ÿ;ôæå pºLQüm ¤ÅÿWþŒýâýmÿy)™”Tÿyþ þÜý…ýþüòü¤ýFÿlˆŽèI€;ÿÃþ8ÿ èÚKÝÿ Z0ÁƒàbÈŒF8€G¸¨0a°M¯½ÿwÿ>Šz<ÑÆþÜüÒû ü ýmþ°ÿE8Þÿ«ÿÿ«ÿ~ÿ8ÿÅþÜýýóüqýîý]þèþ#ÿBÿÿ€ÚG!Õzi½l7 :ãÿÞÿøÿŠ#›Z„ßo¬\ÕØÿêþ*ÿ10‹H†Sÿ2þŒý±ý{þÿÿµþGþþzþpÿz&ý1ÿÿÿ{±l´ÿ"ÿ¾ÿE°Då͸{ŠA·2ä:?Ög¹dßþ†ÿþþ[ÿ ‰j¤ÿþðûÉúû!ü£ýÿÓÿVÿyþ%þmþIÿúÿqÿFþ ý_üâü÷ýÌþÂþäý ýØüiýºþSŽäx=z'(àÙzÅ®ºm›˜ãÿeþÝü7ü=ü@ýÿÀóW¡Œ Úd´ÿ¥ý§û_úûù”ú(üÿýœÿ~|J&I…Ràÿ&ÿiþîý7þüþç cuÿ ÿ8ÿ‡}$~ÿúþ^ÿÐÆ]ö“±%ZË'[’,†þOýãüèü ýÉüü}û[ûLücþŠ„EfÿÆýTütû·ûVügü:ü¬ûûJûü_ý–þÏþþ ýüçüþlÿ»¥çáïÀb~sÿyþëýâýþ<þzþ•þJþþSþøþ…ÿ¶ÿ¶ÿÿ•ÿ &åÀþXü+úÁø£ø¯ùLûŽü:ýÆýLþ!ÿ1#m±ÿWý½üDý†þÿ¤ÿWþý£üýýïý3þ7þAþîþF _…¥…‡ k†ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿþÿÿÿÿÿþÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿþÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿþÿÿÿÿÿÿÿþÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿgnustep-gui-0.24.0/Sounds/Pop.wav0000664000076500007650000012441411240162532016474 0ustar brains99brains99RIFF©WAVEfmt D¬ˆXdataà¨ÿ ÿÿñþÿÿ@ÿlÿpÿcÿfÿIÿ@ÿUÿ­ÿÀÿjÿ4ÿ-ÿYÿlÿ…ÿŽÿsÿhÿZÿ`ÿhÿ^ÿ€ÿ¯ÿ¶ÿ•ÿƒÿYÿ+ÿ2ÿMÿzÿÒÿ#Áÿ—ÿˆÿvÿ€ÿšÿ‡ÿªÿ¼ÿÄÿÃÿµÿµÿ¡ÿ©ÿ¢ÿ­ÿÎÿ÷ÿäÿ³ÿ½ÿäÿÖÿžÿ‹ÿ—ÿ»ÿßÿØÿàÿ%(îÿ÷ÿøÿõÿþÿðÿëÿ $øÿÊÿÈÿëÿ ðÿÕÿÓÿÿÿ-' #--ýÿÇÿÄÿ¶ÿ©ÿ¼ÿýÿBWRM2 .WtmSE=(>,ôÿÛÿ@fr]R"$-65DA0.OYeG($/ =biJ%ìÿÃÿËÿýÿ%!,GTM-6%-P[\73>.KasZKgX.5pŒ]t™z^h}‡Z=Nv‡ˆ‰h8'-DN]hmˆ•Ÿž™†P&)/t¦³Ìá¥lXoˆžl35_YRg|fd‘»«|m4)R‹Ž~z•{ŸgãÿÄÿâÿ2FmJ*)UVøÿ)UAÎÿÒÿÍÿ°ÿüÿ>‚r›z.Ùÿ/„äÇé E ¥yŠìýmûˆù$÷{óïíê8çäZâ¯ãêzõdwÚ"*%-'['Ñ"Ñÿå¢ÎÄ?ÇðÒCß3èÜí²òjüd`$í7XEšJ6Gm=È1^(2 ,B› }“k½d{ÅÿïÄÏK­Å£ ¦ï¦X¸Zä) ‹ìûÞúñ&ô'Ö&‰ëæ(Çʹ4Êjç%— â¬Å<¼ÉŠåw=R‘£¸#ù>ƒZêdgcÅ`ëVÍ:üÀ ºåúöç¯Ñó¹ ±z¾ÁÛ—¶(ù?DÒ?ß=—?ôAC?{.úõá ØsÞíJúQþ•÷GêèÝ Ó¯É2¾è³{­¡«Ø¬B­Îª¹¬?»‘Ø«ü{4 üíÁêŽïÿòàë˜ÚbË}Év×ðñøS*v7á:(;¬:œ7¯0Ó$ËÞ|f É[B Ò 6 ë"± {Í+®4¢2u' Ì ' ð.þ3ì/r$´ø ê Ç & áø×Ùû´ªË­…ÀsÓ8ÚШ¸,¡u—žÙ²FËüÛŽßÜãݪí¶Â!K,½"°‡ê¡ÔêË$ÍòÏXÑþÕ4á›ò¾ @4=@™G-NGPYHR6,;Jíié^ñïüJ– ö¦"Š:}LQ¥GÊ36”a¹ìß 4nýÿ$ ןè üF™ø9í}ä1â¸ãæ{åà;Ù)ÖäÙ”á˜çCéæR߯Ùًܨànãùå·é¹ïôøO¨ ] ý€ÿfúl÷»ö¿ô=ïôé.ê^ñPþ# n|=FŸ? =-/ 4§=&Ä'—.í*×½~±óÕ|¹0þ ù&k){$Þ hùÛö=öìô©ó[òðÛî”ðwôoù±þh5OÐè±ýú¢õAîùã¡ÙÓkÑÓØÙÝAålïjûƒ4 Q ±Öÿ3úÀ÷„õEðÇæiÜXÖóÖøß¶î¥ûAW@à æn8õêZúäÛ%¤óÄ ë N ÿEÃê g–ÝtDLº¯ýºùšù)û|ýÎÿ þ±÷†óÍôú©Ó)¦ø;ïéÒåå䮿äé]ëîê±ê<ì{ð^øÜE3õÊåÝTÝ åðhù»úõ÷Lùä ä˜$ þùòËî¾ð[ö“ýº ” À8!$D(w')"5| Zø>ôÞôvúšæôŽ=œ8± ª•ˆüñùèöéòËð)òØôø®üÀNÕ©£.ÿTü9û×ùø4ö6òíØì^ïô ú‡þÆþxú\õKó™ôkùãÿ¥©åSöNÑ]üXðã­ÙeÖMÙ?ßHå#ìô¬ýõ àw!#üó! éZø«ê}â²ã”í®ûW(‚Ç<*¢3ê4/š&ú¾Ü áÿbùìö!÷„ù ýh”G. ¦ yØõ–êšæhêÐôÞÿÌ$‹þæj· Ð’ò7ܪÌQÆÉÐèÖ/ÚDÛäÝJæœñˆûšhv)ýPú¸úÑüºýÈýêýÂþŽ2ÙQ4vkµ f q -Î?æ"…)«*g'%#…°½±- /Wþ^þùÿ|}š:: Dð=¹¡ žLú©í-áÃ×èÔvÙ‚á}è½í¶ñ õ·øóü ÿáüQ÷ƒñcî?îñî\ïjï³ï~ô\þÆú K ›ýõDîßëìèoÜïÍÑÅžËÕàþod'Ê&v á $*+*£ Ê?ûî ë+òÿülÏ ?á|úXù«ý›iÓ²¬ÊÙ'…1d4Ì-x"› …îü®÷Zï‡ãì× Ïõ͓՘ã¸òãþ:® â ; ­ ó yXþQôØêä8àîßÒã.ê‡ñÂøiüöú ö®ï…èêáŠÝ3Üùܓ߂äpêÌñ[ü ˆ(\n¤ K­ËŽû³õhðÅí9ðž÷7 XÌ70!–#¬"PHÞÅôÁtEôgz ¤ ö$Âãú«õàòôh÷±úOýÿq [Š9Ñè %ÿÆõÒñŸòôó=ñÞéáiÛ&Ü6ã4ì}ñð¦éÃâÐÞ-ßßãcêð”ô±ö=øfü²‰ |K Õ]øêñGîCî’ðò»õmü1R ¬ñÌ“’mÌç’ àü:®âoÉï > Ïë +Pp ¥þÿûë¯ º È ¾ Ò 9yÄ ‘¾ýù"òšê×ãÝÞFÝzß·ãèAëƒìÛì“î™ñ*ô¨ô›ó&òêïAíìÈëöêÎêÉë>îlò+öWøxøæöäõP÷—úÞý•þýüÞý Ù6EœÛ:ž J NæTcI ¿3«ƒÜa' ²Ý . p ² q a Ö¥_þØüûÓ÷úó­ïë éqéöëIï›ñbòœò>ó§ôFö}÷Ü÷eöÙòÓîyë8éàè–êsíÞï=ñ*ó÷õ½øŸû:ýü%ùžöwö`øaúü²ýPÿ+Ò¼ œ, Ú»3{q7 « ¦³ò”ñ.2c± Ü* ñ”M´Ó€Æ € ¤ æ¸c™üÓú‹úúÅøIö¾óò¸ðŸð³ò™õøÚøù÷œö¡ôòGò©ò òÕðÖï5ðò÷2ý¬1¶<ý%ú‰øüøçú7ýi ÿ ^u ª ¸ T _w û g°q  8w J´  (6;! °½òU ) ã y — êð ÿþû_ù›ö8ôHóióØô6÷ÆùÛüÔÿÅͪ”HÿGüSù©ö¶ôóññgò¢óÓô÷Èùôû2þ{ ç1ß§”ùþóýÒýEÿ‘,@ÿ¤ýxü°ûû>ú«ùÏú9ýèhÖ âM`‡ù ” ‹ üÞ6ÎÆþCþWÚ÷áN 8 Ø ]Ëõ9?8 ²û²ø ùùcù¡ùqúüûzþ¾³zâ_¨ýŸúþùLû£üÏü½úd÷þôUõxøÄûJüùÉò˜ëÞæ¦åFçëÜïµô›ø?û|ýˆÿB^i(âÓÊþ¥ý‡þN.Âð玾ÿ:ÿ>ží³• Š˜? t¦úâÜJ- Ü Ÿyÿòû…ú¡ûþ9Æód÷À a y  ûöÜòñQñZñò”óÈôÙõ™ö ÷Y÷§öUõ‡óÌðâíÙë.ì´ïúôûŠsÐÞûÞÙÔ7þ•ùMôØðûïñÙôÅøßüŸõÜ P!4~Hï ¸«ÜÎXüÝìÞ‘Œha  C ] # ؇ç‹7À£ÿÐÃû¤ìÿÿDþÄü{úgøWöÃô.ôtô ôvó–ñ­ðÂð3òõôO÷Y÷öõ­ôIôlõ[÷6ù‰ú§ú­ùoø÷tõãó;òÇðþïCðøñðôÅøý(œ %Ì9Zã Ø1*ý¼ùáøâúÑþSHý ¤î}Iz~ éÕ_Pÿþ©üüü{þìÆÐý2ù?÷]÷øô÷ö;ô*ôÏö—ü>§zƒþ¾û7úù1öüðÑëèèøéríñ3ôëööùBý0ÿ¯ÿÌÿAÿKþÌýYþéþ0þJýÀýÊþ¹ÿþ‡×üùö:÷¯û¼/ M  ·=¾¯s >ßþ³üfý1ÿŸ_Fnì·{ ‘ „‡çŒü¶ùuø2ùŽûjþ·£™e‡“zý$øhòåíÏë#ìöíÀïCñùòõ_øáüoÔ2wþ.ý(ü@ûKúEù¾øÀø ùÐø]ø€øÌøwùLû†ý|ÿqëi ,_§æ95 ' c  Î ×  ’ô®ÌþFýœývÿ¿Ýì±xƒV ¥ r¯dd'ÏÎýbûúœùlú¨û&üübü¦ýÔþ„þ"ýûùŒø<ú¦ü!þˆýuûù!÷)÷Lù.ûûqù>÷ö£öLùýhÿ1ÿ¡ýûÙùŠù%ú$û-üìüLý”ý–þûcn Ê œ µ º ÒŠC؉&AüýÈü%þ•DH ·†>5 ¢ [ ±—óÿIûaøØ÷ÖùêýÏÕ…Í_Ê}ÿèýÿüÄüŠüˆûŸúú>ùù{ùäùáùKùåøù?ùEù©øe÷ö{õ ÷cúÕýíÿ¡HÒ(Ø•iidY“¨6ÿÿéÿ¥œ>âc2ë ÿ W  $  À o ¢ – ¸ãþŒÍzzc¶ðú„¾¨þlýÖüãüdýqý‰ýÑþSVUʘ‚þcûÇ÷óåðùðó¼õ¯ø]û(ý.ÿ¼†—¨dýÿLþŽþÆþVýû›ùÉ÷-÷°øtûÁýžÿÜ°Ç ò{<¥Ñšžp>òý-áPœ/“®JØê¡î{÷Oê\íôŸø¥;ÎCøuíJ%þfü†ûÆú²ù¹øRøùÀúýÐÿ]88ýµÒYÿ¢üúëøm÷Þõ‰ôôuôrõž÷múßümÿ+EÂv ªþdýÀýYÿt’s8úãj f T ´‹|y¯^Ûýæþ€ý|ýjþîÿ¯P Ô U ª  6ÂÿÈü?û2ûòûºüÓüjüüþ&ÕÀÏð{Sÿ¾þÑý5ü¿ú·ùYùJúbûÌûÇûöú×ùùíø:ùTùÅùúútüãýwÿÀx;Rü­9ŠÀ^ÿÁþþþMÿÂÿat>4hvö{å94^qÏ+ÜÓ]ÐNþpüüý ÿZõ*šx1<`Oöþõüáû"ûÈúÒúWûüêüªýþýþþŽþÿœþÙühúø¤ö[÷ÿùÉü]þ¸þØþ‡ÿÛþ®÷CÚþ¯ýÌüêûrûüIü³û9ûtû5üžýÛÝÕÔöQuÜâ@÷PL›§uk©£I_Ì/i#¹ÿ¥þŽþ(ÿKÿtþ¯ý¿ýQþèþÿôÿÿmþ³ý þ\ÿïTfÿ¸þBÿ˜ÿýþTýÕúöø]ùsûkýRþ"þdýýqýjþÕþþJüÍú6úeúÕúôúÒú û€ü{þH w;ÿ)þ€ý=ý=ýü¿úøl÷øú®ý¥n•ðöŸ9ÑÇÞýû=ú;úûŠýUÿ¸3—R娬§|›Wþ‘ýþPÿÉ?ë'tÕ[åÿÿ'ýËúÛøó÷øüøGúû;ûû8û×ûÜü-þ,ÿØþ{ýJü«û û‘úãú¢ûíû—ûûlúéùýù›úƒû&üIü üíû­üƒþ­/[-*åç;RÕ› àÿ üÿêLü¸mŒˆºÚg…sõß\¨YÜÿNþMý»üØûHú7øÓöïö1øpú¶ü0þÿwæV´©Éükù˜÷C÷ÚöŽõ}ôÓô3öéøàük£‰Z|ñøÿþÙü¸übýÿV3Êu%Ë­zJ‰hä°7n-¤ Ú3ÏäñÃi$~^&cÍ™,;ÿ€þ™ýcüLû¿ú ûEü¾ýïþÿIÿØþÀþÜþ¥þþGýüûÈúúñù‘ùbùáù?ûýìþjí½ª:óÚ¬¶þÊüòû“üHþãÇheq°†Ç,@éí¾©F*2ŒÄàÛRéÿ=uÞíâ´ú´ TXÿ9ý¥ûáúkú€ú¢û1ý:þkþõývýýƒýÐþ¼ÿfÿEþšýžýþÿƒ^­æÞBêÿSþý!ü(ûÚùtø²÷ø:ú§ýó02mœÌº˜0–ÿLþuþ§ÿ@”:hý7_òá+:&änÒQ1iˆVœpÂ…ýáú0úÕú"üêüÝüxüÉü·ýÓþoÿ¹ÿAÀÿ(ÿ{þEþ¯þ–ÿìÿ‰ÿ³þ¼ýýÊüý`ý+ý–üÿûüRý¿þ8U­ªÑ,~i'.j¯ .‘²V¹•rÞêíf\lÜsiláã˘R²%Ñ4µR5ÿåýoüûXúúŠúãûvý’þÿdÿ·ÿ?–içÿÿþÃýöü¸üÇüýDýýþ¶þÿzÿ¹ÿºÿÿ„ÿÏÿ{ÿ¿þ_þÇþ“r±¿¥ÍyçŒaÊOÿhþ†þkÿ¸c@†|šæóò&ÏU‰"užæˆÿøýþýºþ·ÿ²ÿ‹þ>ýòüØý~ÿÂã*ÿ|þêþÊÿ+Õÿÿ(þÑýöýþ«ýãüÌû ûOûü¶üéüËüü±üUý-þÿlÿ[ÿqÿæÿ—e·&˱F>[ÿ¬þYþ–þùþ\ÿáÿeW¢öÝ) ñöZé¹óÿ­ÿ¡ÿÿÿ þgý7ý•ý0þ“þ×þÕþÆþÿŒÿ(¡œ§ÿ]ÿ ÿxþnýBü‚ûxû üÖüý´ý˜ý—ýÒýTþ“þaþÏýýiüüqüFý"þÊþíþ–þ>þLþÌþ>ÿnÿ8ÿ‚þÆý“ýÔý{þÿ¹ÿ k§ z³×úŠaÚþ’ýý`ýlþƒÿõÿ¤ÿ%ÿæþZÿËŒRG)ne¸Á ßþÑýHýýCýèýŸþñþÞþÒþ¬þÿýý…ü3üCü±üTý¥ýXý¨üü5ýHþ<ÿ•ÿèþ/ý®û4ûjûü„üyüüÊûüÿüIþzÿ5b7þÿÜÿÿÌþ#þ½ýbýXý¹ýåýâý þ¥þŽÿA]q,<Ř?_ƒ÷“Uiÿ¬þþ¹ý®ý0þÿTŸxÓ½f(S£†ÚTÿÔþ›þäþJÿ>ÿ°þéý=ýÏü¶ü÷üý¯üîû4ûØúû2ü°ý ÿ·Þœ6ÿþ¯üû©ú=úLú²úpûuüÕýOÿ†hqºñÌRÇH¯2Òÿ™ÿºÿ9ÒBFä¤7è}Í]©¶˜kä8]”#ÊzúÿPÿqþ ýTýUýný±ýÀýØý.þ«þ9ÿ£ÿîÿÖÿ‹ÿcÿÿÇþdþ™ýNüôúõùtù²ùú°ûªüaý!þÿôÿ°2Ž‘m`O,ÆRýÿ¯ÿ1ÿ‰þðý˜ýÛýæþB­Û¨]Ø4kÇ\“–`:`I++›`䟄 ¤¾ÿÿÝþÿ,ÿ7ÿvÿãÿE­MÖÚ”(wxÿ¿þ[þ*þþ:þAþÊýùüVüEü ý7þIÿ¿ÿIÿ¤þuþÍþSÿÊÿØÿŽÿ^ÿ[ÿÿËÿ4®q Þ%u~¬›o c¶×Ìá®å+&6±FÙñpÿ ÿØÿp¹Ž´+DJô <4`C¹œÿ˜ý¯ügüNünü„üÑüŠýùýçýšýÊýUþQÿt" &$ÿ°þàþ…ÿs d#hÎÿÆÿi1Pÿ€þTþûþE½½En{¨ÉðÌrG"ùÿfÿ™ÿZµFQjÍZ·ÜvŽcB„ 1ÿÞýüÐûÜûðüCþ‰ÿË*¾+åÿÄÿ”ÿ¤ÿÖÿbÿnþ§ýGýCýßýûþwÿ ÿÁþCþ¢ýXýÙý€þÿˆÿ£ÿ“ÿÿªþÞþ‚ÿ?£±/ÿÚþ«þpÿ¬{¥lH¢›²QQ£ÀCWÝc©ŽâmQˆÎÿ:ÿÿ+ÿ{ÿ´ÿ­ÿªÿèÿ·âË>ÆÖ\P%©Šÿêýü"ü¤ü´ýiþªþäþDÿ²ÿ1Õg'ÿiþ!þþfþ¥þjþ›ýþüýµýþôýyýSüBûÎúûJüýjþèþ´ÿ³¼'ÿl€Ûœ]8S'eƒ7Ìÿÿ=þ¾ý°ý þÝþ•ÿ´ÿ~ÿvÿQWäš–%'ëÑaê‡áºþöü0üoü$ýSþIÿ§ÿ…ÿTÿ#ÿ>ÿèJ­2ÿýºûUû§ûJüÔüýŽü‰û¤úGúîúBühýÎý&ýæû?û‚û²üþåþzÿÿ—ÿÖÿ‘c$ÉÛ4™®þý]üàü»ýIþ*þ§ýzý@þïÿìÀì5×Nï´“ÛÿtþËýçý|þ$ÿŽÿïÿr¾NÛÿDÿ—þäýöü·û(ú>ù[ù\úEûîûRüüÏûºû3üðüxýýƒýJý¸üßû9û4ûtû|û3ûûbûpüÎýRÿœz,Ýì¤ÿdþÞýþcþ[þ×ýåüQü×ü}þË©WJص¡Í/üÞT‘Jzbäfášc¼ÿtþQýåüÿüTýJýóü¯üæü¾ý$ÿ.ƒEÿ†þþŸý1ýƒüaû7ú%ùªø•ø.ù4úQûœüý9þÿ :~hM;³<ÿþý„ü=ü#ü üüòüªþ–ýÙÑ"gÂ~Bo„š*ÿÝý9ý©ýðþRkäÝŒKˆá Ywÿ*þ³ýþ¹þ¥þ¦ýü[ü%ý ÿj<ŽU•ÿ4þêýRþyþÞýýxü–üŒý0ÿ«L_OLW1ÿ4þŽýFý:ýìü_ü*üåü­þ¥ÃÖ¿ÿ­þþzÿ%®ÿ%ÿÅþ$ÿ(8æ‡Ékj¢ƒÿÿ0ÿ µÓ«ŠžÔó ÜuR‹÷\…‚[¶…¯ˆ‰m®,¨”Ú"µÿ·ÿ½ÿLÿ¬þLþDþ®þ5ÿrÿÿ`þþPþ ÿØÿ,÷ÿrÿíþ»þæþ ÿ¤þÆýý±ü×üýËþÑÖŽ1‰P™¯ÿµÿ;Ü¥X¶²¢õÎ*jÎ9:QÙÄü¨Ú ÇŒ»:}§µƒ9éØS¢îä3s áe¿ÿÿ3þDý“üüEý<þÿ~ÿëÿ8æ{ ›ÿ¨þqþfþ7þùýoýÚüUüdüóü–ý<þ£þÿWÿØÿÉ~ûFŽÒÄ¢ø "’§ƒC^¹ß‘3ÊÊL™ï“¨õâq Ï}ÚÿÿþÕýÝüyüÊü}ý þ\þ£þÿătF.¸–Êÿðþ°ý{ü]ûWúúŸúÉûýþÀþ.ÿwÿØÿ†€I‡T;sÉF'Låd3…ûœLÜ%;ah´¯üâÃÄ­?Öÿëþ&þåý%þzþ…þ{þðþäÿ¼]Õ·‘xÞ'š…ÿŸþéý6ý¨ülüÙû!ûïúbûTü}ý þªÿfÔ ÞvËÿWÿNÿ ÿþPþ}þËþÿTÿ•ÿ{ÿ´ÿ‘¨q‘†à‡ºêwõÝó˜ÇÿßþOþ!þJþ¡þÿbÿhÿ“ÿßÿC½Ég0j—ŒŽ[ôÿgÿ’þXý÷ûóú°ú&ûçûü„ýŠþ‡ÿª7xÙÖïZôÿÀÿµÿ^ÿõþ–þ†þ±þÿpÿ¹ÿ}ÿ$ÿAÿ:ÿ/ÿkÿ¡ÿœÿ|ÿœÿÀÿòÿ8G=°ÿ,ÿþÚýsý~ýŠýÜýþEÿ8=S@rôÿ±ÿÒÿ+{†jµh–L4“þ@ýzüDü‘üüü®ýWþ2ÿ'EñFuj°þºüûú*úÀú‡û[üßü:ýþ@ÿÍÁó=§ÿ‰ýÆû@û¡ûü9ü>ü~üýUþÓÿ:‰ÿ«þÛý]ý,ýúüÄügüüSüýÿ€æ·‰ÜXü¨ÿmþýöûMûƒûxüÅýþ©þ¿þ,ÿåÿØÃïr 'ÓC¤ÿèþñý%ý‰üýûªû«û.ü·ü(ýªýòýþ4þûýÛýûýþÈýAýèü®ü)ý&þ ÿœÿêÿºÿpÿ‰ÿÔÿêÿ®ÿÿþlý,ý|ýþëþüÿ²dût½C­—e-ÿ!þwýý‚ücüäü¢ýÈþ/¥Í|1yX_¶ÿÜýJüžûÅû”üáý°þÿKÿ˜ÿf»ÿýjûúåù^ú+ûÜû^ü´üý þþÿX^é«ï@,F-XÿþUý@ýƒý5þ:ÿ&9uÿñþ&ÿàÿ ,,+ üG­€ÿþïýYþÞþÿÐþZþ=þ„þÿïÿÂñQ•ÿNÿZÿaÿmÿƒÿ…ÿ”ÿÛÿXÈÈ^©ÿ?ÿÿ—þÈýýjüüØüdþ÷ÿ½0wÎøâ‘´¡¼ÿæþ}þ—þåþÿ!ÿ’ÿ/^†ŸN+¾ÿwÿÿ­þ|þÏþ~ÿ0£ÓÞ{Û#¡È·ÿWþ6ýÚüùü”ý´þÖÿ³<ªgÀ*휠ÿÿVÿÌÿúÿÓÿZÿ¼þ;þSþ9ÿˆj´kÍ[CÆäì`ñ%càÛ*8·œÿDþOýPýMþÁÿlD4œ ä‹JuúšÿÀÿšžÕ/)IÿÕþ$ÿœÿâÿÿ‚þqý•ühüçüþmÿ«Í‘0¢‰Ø°é|Ûÿ°þNþxþ#ÿõœù}=«ðƒM½Ÿdÿô®=ÙˆÒu§Ñ@H|„°6êøt¡÷xÛÜþ¦ýØüÛü¶ý…þ*ÿ!ÿ¢þŠþ ÿígt ®Z‹I6 »@òÿñÿ¶ÿÊÿ`PPïX¦%àtN'e&>8$›ÿ,ÿkÿQz§f_áŸËi³\¸1óüx»Km¯x5íÿ`ÿ¤þþ¾ýáýþ>þRþ^þxþ†þ_þ þ¤ý}ý¥ýöýpþÿˆÿãÿ¾ÿgÿ ÿ×þÉþÚþÿWÿpÿZÿ¹ÿŽF˜S¥H`Õjdìt¤ÏdîP¤Ûäšä(r7ïà¿~MþÂXòÿ³ÿ¦ÿ×ÿ4µÔyÃÿÿªþˆþ™þ¹þ¾þœþEþþÄýHý/ýPý­ý þžþ-ÿyÿŒÿÍÿÙÿhÿÿ¶þkþ5þþLþŽþÙþÿrÿàÿe£¯zãÿUÿ%ÿÿÿÿêþ3ÿ×ÿ§ÀïïH/Ï݈ÿ¯þ$þYþñþ¾ÿÐãóö€çêú W×ÿ¤ÿ‚ÿ=ÿ÷þ®þEþþ·ý`ý]ýGýCýoý”ýÁýòýHþÓþgÿìÿ"9hT yÿ­þwýUü×û÷û#ühü ýäýþÿ°ÿ-ayÅ)݈ˆÿÿ½þ}þDþuþCÿ/ –rTzÝúÑG|øÿ½ÿÙÿ%Jûÿ_ÿ‘þ«ýý$ý€ý²ýÐýÏýÆýÚý:þÿP3nQ ‹1Öÿdÿ•þòýºýªýÃýâýüý÷ý þbþíþÿ€þ ý¡üüüYüãüýÈüGüüvüýåýÁþõþÓþšþ[þQþŠþ ÿ<ÿÿ¢þþ¤ýàýÆþéÿ#î “{Ьk®ÿ¢þÃý|ýíýËþyÿ$‚¬ÿVÿàþßþþþCÿRÿ ÿüþãþðþkÿp,_+qzÿ–þwþ³þ?ÿWÿØþþ}ý§ýþýaþÕþíþ®þ*þmý½ü,üüŽü-ýþ§þÊþìþ'ÿ¥ÿ>0M°þ%ý@üVü:ýþ…þpþ8þ€þ8ÿ&3§ZW9ÿoþþæýþPþÃþÿd#ƒ›’¨T7:eÿÿzÿ–Ƹ®ªÿ{¼Jx–ÿ±þþ6þ“þ×þÝþáþëþÊþÚþôþêþ­þaþþðý×ýýyý•ý þåþÎÿ_mˆÿçþÊþ5ÿËãn‡ÿÍþ¤þèþEÿÔÿäÿ{ÿÿçþ;ÿ4Œ)‘ìÿÿÿ—u8˜‡à©xÿÿKÿ²ÿÚÿ]ÿ ÿ9ÿòÿîø–xÝúm?³,GÿãýWýÐýþþUM,ìë}!Uº‡GÿŠþ6þ‹þAÿ½ÿØÿ½ÿ®ÿÌÿÅÿ¯ÿ¤ÿˆÿvÿ‰ÿ©ÿšÿ<ÿÏþÞþhÿGX_‘¬dtÿÿ=ÿšÿøÿ×ÿÿ›þÿkî/Σ ‡`m¤’Ò…ÿíý+ýúüxý1þýþ×ÿ§9hˆÜ=¡ )ª¿²tí-6lÿ7ÿ> TÐfªD&9.fÿýþáþùþ*ÿÿèþÿþÿs;g[yt1ù­5ÇÿÒÿaºä6‚¡ÆæôÃ[ñv#^Âé¾—™åeãU—Üz [bƒø{¤Z,¡EwŽÕµØôÿ€ÿ¼ÿr!7ƒvÿªþ¨þMÿõÿ2ßÿkÿÿþÀþøþnÿîÿ;<ïÿqÿûþ§þÝþºÿ‚ ¨# ¿p­=>¢ˆ=ÿXþ þ™þyÿD/ûÿ 퀯="§v‚vF»,¾!û¥¬L«à'^†ÿ¾þþþPþþ©þrþ8þŒþÎÿQR^ša@ÿ²þ ÿwÿQÿñþƒþ7þIþüþÌÿ;GÕÿ?ÿ¹þ}þVþ"þ<þ¡þõþ@ÿŸÿÃÿµÿÌÿ¨@x&¨Eœz„n©Ñ©–E»ÿ¡þ±þÙÿ}ôƒ)ošL¹Sn~·þäýýŠý³ý’ýAýRýËý<þƒþÊþ™ÿiñ|èïnù¾¦Wýÿ†ÿäþdþ8þUþþ˜þ#þzýýýbýÔýŒþÿ7ÿ^ÿ¤ÿH×!–—,¯kP/Üÿÿ\ÿÿšþ\þþÿMÿ]ÿÌÿj¸$°¨ô}IúÿÿIÿÿŸþ(þ3þÏþšÿ1„z`UpÅajÓ®‡È[ÄÅMz²ÿãþ=þÜýŸýUýý½üqüAü„ü%ýÒý`þšþwþNþþ@ÿä„ Yÿ ÿQÿ¼ÿ‹ÿ©þBýübû°ûÆüëýdþ)þ©ý}ý@þªÿ­D.\ÿ.ÿXÿDÈÿÕþIþCþ\þxþqþ<þþ>þîþöÿñ…~SOjZÝíÿµþÙý¶ýþºþÿÛþ þ ý£üýÌýLþžþòþlÿ Åþ›ÿRþAýªüŸüËü÷ü ýXýåýˆþcÿ lÿ–þîý®ýËý·ý#ýHüaûûVûKü{ýXþÂþÿTÿæÿ'O—¥ÿþý¦üüóü©ýªþ²ÿ]pS+y¶¬4ƒÿÿ+ÿ”ÿU[æ\ÿ ÿqÿ3Òh¥ÿ ÿÑþ8ÿ®ÿqu(ÆÿnÿSÿaÿ¤ÿ‘ÿåþÝýžüóûüâüÕýFþÿýbý»ü’üçü›ýmþÍþ´þ^þêýùýwþfÿ`ð²fÿüþÊþâþ&ÿPÿÿµþUþ)þ8þ…þHÿe)8Íc0L­5:ÃK-…r«|ªV€ÛhïÿlÿùþÌþèþ&ÿ‘ÿ2ÓOÖ/Ôÿ{þDþþ¢ý¸üßû€ûãûµüÞýËþ ÿÞþ¯þ¶þàþªÿxâÚ|Öÿìÿ>­JÿªþáýfýLý›ý,þ÷þŠÿ¸ÿùÿVïêæz¡3‚õRš‡(~Ú™»ÿ ÛV! 1£"‘ÍŸ¥°VDû_aÿ}þ#þrþÕþ ÿÚþkþþ2þ¿þ{ÿJE ßÿýÿ8‚É$'é›Oôÿ„ÿ>ÿRÿSÿÿÀþTþþþ¨þÿ~:¨÷qø}ø2mµ¿ÇëÌr'趺ä(o¼öJeN?Tè*lŒÞŒ‹¯¹oòÿHÿñþKÿáÿpÕìó&ZqNöZáÿ¶ÿ¸ÿØÿÂÿ©ÿ¤ÿÅÿ$vwûÿOÿÎþÿèÿ·45ïÀï‘ ŽïÔuÓ2ÈNíª¾Šª~Åœ4š?eGòÉïEà ZcŽ(@9(T®E:ÝëæGéÿ•ÿnÿ-ÿþþ·þ„þ—þÐþþþNÿ´ÿ@JA`¯ó Íœ‡lpuel£3¿ ‡‚‘ƒPÞ=€Íÿ-ÿåþÛþ0ÿãÿÏž=‰œ°ÛÝ{üAFVÿ—þþþþkþòþ)ÿ6ÿWÿyÿÇÿ'ÌàÎÄÙ"¾88ÿþDýÛüûüýãý.þ˜þéþKÿÆ[Xù¶œà`¥Üu±óihÙGFÏ"ãv äÿõÿ[¥®y¼ÿfÿZÿQÿLÿÿäþæþëþ÷þÎþxþ)þ:þÒþsÿ¡ÿ}ÿÙþ,þÍý¯ý þsþŸþ‚þzþ§þXÿnqõ¿<üöØ‹%¥ÿ ÿþqþ®þ9ÿ¯ÿsÛx[Ѳ;ñ³÷h¼ÿ´þÉýqýFý6ýþüÓüýºý¸þ×ÿ¨öå……ÿ8ÿ³þþsýáüžü—ü ýÞýfþ²þÎþÿ_ÿÇÿ Åÿ=ÿºþ©þ ÿCÿÜþLþÿý¸ýŒýþØþÿ}ÿñÿi*rðs“ÿ„ÿÝÿ!«ÿFÿ®þÎýTý¸ý5þµþ!ÿÿþÿÿýþÇþüþ!ÿ`ÿÊÿãÿÔÿ‡ÿßþþJýýý\ý¬ýÒýËý ýmýýyýtýÐýþþ þúýþþìþÿ2ÿÔþsþGþ!þþ>þþ~ýEýmý¤ý þLþ˜þÜþ ÿdÿlÓ£àl—ëx«ÿÿÐþìþ¤ÿ;óâÿàþ€þ=þóý˜ýÕü üžûŽû;ü;ý>þæþuÿåÿ‡ž)ÇÿÿSþŽýäüüiû*û¥ûlü<ýØýŽýâüýÿýsÿÍMÙ ¯ÿ÷ÿâÆ¹Òuÿpþ þEþ¯þEÿ}ÿ]ÿQÿuÿæÿ›{9ިý×k™í¶èÿÞþ<þ2þÂþ¿ÿ šÿ`þfýáüÜüý‰ý­ý<ýý˜ýHþKÿ#·.+¤=åÿbÿ°þúý…ýQý.ý3ý\ýýýžý4þºþÿåþ’þcþšþPÿ$ŒpS£å!Ç*Ì}H5»WŸ¯Ëÿk¢kÞ,^Ýÿ¡ÿsÿ¥ÿ ÿnÿÿšþrþ”þ³þ¥þjþ%þöý!þnþRþ8þþhÿh`Õ•Øÿ\ÿ1ÿÿUþPýüHûÔûyý6ÿ¥!•ßÿƒÿ×ÿ½’É12ÿ?ÿÈÿÓå€Ê g¶Îx{ˆŠåÿKÿ ÿcÿiÕ6lwE¶–?ÿ©þãþÚÿë§ÏJ¾Vÿÿéÿ¤ÿçþüýCý6ýoýÇý/þÔþÌÿ\òÊqz[ÿ ÿIÿŸÿIÿdþžýôý|ÿÀ¾œ§(Îÿ„Ë¿å'e˜ˆumŠ´”}äû%ï‡ïÿôÿ8ŠN<³•ikŽ”J´Ôÿ{ÿ¹ÿ^ÅëË®¨<"H9òÿ–(›ËW]3 }Jÿ²þ=ÿ…؇«|3‹†Šðe(ÛûŸxu2Ýÿxÿ§ÿ¤pÏÂ0£¡ÿ&ÿ«þ?þÿý?þ'ÿé¦ðñ I’üØ3mõÿ‰ÿ/ÿ+ÿIÿRÿ¼ÿXÜ>À…¹·‚€ÿ4ÿ-¾Ø"‹ âדG#Tÿ{ÿˆ·Z{+¬†~Wÿÿ>ÿbþÀýBý ýTý¹ý„þjÿpNšÿÿÍþÿÍÿFWE+_ÿEN½>9ÿŒþSþÝþ²ÿÙÿ„ÿ‡ÿ¾ÿ×ÿF Ë?X ¿Oö6Þd-F)=ÿëþiÿY¬8gÿÈþöþ¢ÿ¥ÑLê?¢n›¢yþÿ'ÿƒþ5þáý]ýµü]üJünüÕü<ý_ýrýÑýkþWÿŒ—*\ãuŒ#E~ÿ ÿâþ®þWþ-þþ8þ—þÿþ^ÿùå°÷+Y»p›ç‚½ÿIÿHÿ¨ÿ"\÷ÿÿvþuþ8ÿ4瀦q.æo–ÿªþ²ýý™ü0üñûüyü0ý*þ’þ*þŠýýý´ýÃþíÿ´—·ÿÔÿŒ@3.ßþœýºü·ü_ýEþÒþùþÿ)ÿÿ(æ› ´\·ÿfÿÇÿ:ìÿ ÿðþ@ÿ{ÿ»ÿÑÿ–ÿ'ÿÃþõþ2ÿqÿjÿÿþ8þ þ¼ýŸý¹ýÒýQþÿ¨ÿóÿýÿiÿ¬þþµýÊýþèý)ýaüü±üæý6ÿ# Nÿwþ-þÂþÿ&õÿöþæý,ýýƒýþþÜþÞþÂþçþÚþµþËþ@ÿ¯ÿÞÿnÿÄþþAýÓü]ý\þñþÕþþ¦ýØýÇþêÿÉå®ÿñý¸üxü=ýxþKÿwÿÿ]þÊýßýWþÖþÿKÿ`ÿ]ÿqÿðÿ˃è這gÿxþmþÿÍÿh¹Œþÿ‚ÿœÿýÿ5Iÿ þ—ü²ûþûîüûýjþ5þþÌýçýŠþZÿ¢ÿvÿêþ[þåýšý›ýŸý˜ý{ýkýãýHþ-þíýÝýþ±þ6ÿsÿƒÿSÿ ÿËþÞþ>ÿ­ÿèÿˆÿÿÐþ»þ³þÐþôþÿwÿîÿqÛÖÅQ»JÊV7ÆtÉs2¿ÿÝþÈþ×þÇþÁþ þ`þùýþ„þÜþâþÚþçþFÿ“ÿÞÿ1fl…ßÛ^kÿKþqý2ý•ýüýþ¸ýý²ü ýþ7ÿU™ÿ?ÿlÿAnÿmþyýÕüý|ýþý,þþ5þ¹þrÿWG»›¸×ÑÿE·ô7•-¶”†eµˆÿ©ÿ y­Ì¼ÓG¯’`±ÿwÿ°ÿÏÿ±ÿúþ7þþVþÛþWÿ\ÿ½þÉýý@ýþýÔþZÿPÿÑþuþ•þDÿ|(ÿ(þIýÓüÍüHý+þáþ˜ÿ†÷-”ǯ}¼û’ZC³¿nÖjQt¼°IÏ_:ˆM³›Xûãï÷ÝŽLê.œÿyÿ~ÿ¾ÿN;ë‹m}Ž–ÿüýCý5ýÑý þhÿéÿÓÿ‚ÿgÿ²ÿëÿzÿÿòþRÿ›ÿùÿþÿ9…åmýî¿å4)÷±sxâ;Ÿˆ1ô~EJr±Ù•ñBè»Å¯bòk.Ÿý5QE2tñ;SGaÿ®þþ‹ý5ýÿüRýþÿíÿt£»ÚÕV†ÿ©þþ¾ýþ°þŒÿo-¨Îç¸#•õÿnÿPÿ©ÿ'…ôÚžú¨ƒt©ê¸Ïí7¥UA´ÿ·ÿP®ðûåøÓ xÿRÿ¦ÿ®ÿ2ÿäþšþ–þÿFÿòþkþ þæýþ¬þÎÿ8ôÿnÿ#ÿ)ÿ(ÿFÿIÿ'ÿ@ÿÿéÿ`ífql#~¯ÿÿŠþ0þþþ]þÉþjÿdvVÉÜñ¿J·RÌÿÿéþgþSþ­þÿ ÿûÿÐÿ¾ÿâÿXåFLEι¥€úÿlÿ#ÿWÿÆÿùÿ!I:µÿTÿÿ¶þ‡þfþPþ þîþ_ÿ¥ÿ~ÿxÿ‘ÿýÿ ºÿ*ÿ—þDþVþàþSÿÿ¨ÿžÿzÿmÿ‡ÿ¦ÿ¯ÿìÿGrooÍ&Z#xVÿtþuþ1ÿ³I`NŒ=ß’ŒNI#-VÎÿ‡ÿ[ÿ¨ÿ:Ë1z‰f`JÖZÿÝþ–þvþ3þþýòýÓýßý?þ|þEþþþqþåþXÿ½ÿýÿÏÿLÿüþŠþ0þ¾ýfý(ýýüaýÏýIþÏþ2ÿ1ÿêþaþ þþ^þ˜þnþ?þæý¥ýþÛþ¬ÿ1´?ƒà/%ÊÞºÿºþåýNý"ý ýýXþ‹ÿ¥iš^ÙÌyåÿØþÖýýý<ý ýþþŸý7ýýõüýpýÛýþÚýÃýØý7þ­þ ÿTÿóþþûüNüü@üÎü ýÌü—üŠü¶üJý÷ýtþ‡þTþ#þþ9þiþ¸þúþ0ÿ‰ÿàÿðÿ¸ÿ7ÿÿÿÿèþ•þ:þþþÇþ·ÿ‹3Âð¿‚{]õJSÿíý–üâûü­ü”ýþÿ#ÿ6ÿ ò[qI¹µÿ¤þÌýpý=ýçüŸüü¤üØüeýFþ*ÿºÿÝÿ¹ÿjÿÖþLþ"þþ þÛý¿ýÞýOþöþ–ÿÁÿuÿÿ¯þÖþƒÿ6±½QÒÿ‰ÿ¼ÿ×ÿ´ÿ'ÿ-þaýKýÎý¹þÉÿœH˜­¾ßÿàŠ<â2#ÿDþíý÷ý:þzþõþ`ÿ¢ÿÜÿiTT:â~ÿ€þþVþµþìþúþÕþ©þÿêÿò@Oÿ)þ0þðþñÿ™˜ÒÿÿëþÿÞÖì*ßÿ–þ§ýgý¢ýÅýÀý‹ý™ýÔýnþ„ÿà<TÙ$ªÿ·ÿªÿRÿÎþŒþˆþËþËÿl[ò—œí€yÊä:ìÜÙš šÿ0ÿ:ÿµÿ1¥ÜѤ.yëÿ›ÿnÿiÿPÿ¹þþný0ýýmþàÿ6 KaûÁ– XÿPþMý˜üüuý‚þrÿ/¾Sî{‰’)]F>‘ÿcÿzÿ¿ÿ.Zx¹=Ûc¦–G¢ ÇìaÃÍwÔ.ûÿiY¢Íÿbÿ}ÿÞÿ8©ë§:dütÆÂ€%¹}'éÿ¿ÿÉÿÝÿ-Pq Õ“fÔ–þUÐ…¥-¼·köÿªÿÜÿmó1¼» ¬nó¿ÙêCõæ"nn UÚÿ±Ÿšð5¾¹ÿtÿØÿ„ôê<Pÿ×þuÿ¼æ`\ÊØ!óÿ6š§Oªÿqÿ›ÿ#î’Î 1ê˜u¯Á*4ÿ«þ{þ¦þÿXÿhÿyÿ¿ÿÿÿÁ ©†ê:….wyïKÿÝþÿþ|ÿ"ÈS{]ŠŠ ž£ÇR Ðÿÿ§ÿÙÿêÿðÿÝÿ¥ÿyÿ„ÿÊÿ? Ëvíÿ»ÿØÿY V|ðÿºÿÔÿ%j<˜ÿÿîþ@ÿÓÿMpC»ÿ¸ÿ‚ù$Qmel á_fäS,N®E“Ü §ÿÆÿ9„†Fíÿ¶ÿŠ £ºUÑ¡tzÿûþlþ6þIþ§þüþ!ÿ…ÿwŒV%Þÿ¤ÿ›ÿ¤ÿðÿèÿ­ÿ~ÿNÿOÿ×ÿS4|ÿšþþþþfþ¿þçþÕþòþzÿ8U?MëeK¨…5ÊF5’Ê¥^¼ÿÿŒþ‡þàþ*ÿŽÿÏÿòÿ-¼û%4ß².Ê…¡ÿÿJþaýÚü½üþü·ýwþÿÿÿÝþóþ„ÿäÿ°ÿÿ þfýyýÓý.þœþ»þ_þ$þþ þ þ9þLþFþRþ^þnþÚþ\ÿæÿ¥ôÖGTUÿýþ ÿ=ÿHÿÿ¯þIþ,þqþìþoÿ®ÿ{ÿõþVþ#þ þmÿœÿTÿóþ¢þ‘þðþlÿ|ÿWÿ/ÿáþýþLÿoÿoÿ#ÿ²þVþæý^ý,ýýýýBýçýæþ–ÿ«ÿeÿßþšþ¸þÑþvþŸýÖüNüUüîü…ýóý~þ6ÿ²áÒ°9’ÿÿÎþfþ³ýÿü˜ü†ü«ü*ý÷ý>þÔý~ý¦ýôý'þEþcþ þíý3þÓþÔÿi²Ì¾ˆcõÿfÿöþËþÆþ±þƒþoþCþìýòý`þËþÿñþÎþÒþîþ‚ÿx>!w¬ÿéþAþÕý þ\þCþ»ýýpüTüæüÔýÈþ‚ÿÆÿØÿëÿgèxíÌÝ¢ÿcþnýGý“ýüýFþþcýçüèüýxþÿÿ²þUþHþáþÇÿĆÂYÁ†ˆÊ#0¸øÿkÿ7ÿpÿ ÿ’ÿÿgþæý›ýwýâýÈþ¹ÿ¨j±ÝÛÕbdètÿbþÛý–ývý…ýrý?ýŠýRþHÿ"ÞŸ n»RÐÿjÿnÿ{ÿÀÿûÿGWÚÿRÿøþ¥þCþßý²ý}ýoýâý¸þÈÿ OŸ½ÎËÚÚÎ¥UÓLÿÿ¼ÿ‹ÿsÿBÿÿ/ÿÿ&ÿpÿ«†úœD¦vÈÞóWÿºþoþþªýÄý]þÿÌÿ‰=ŸY8ŒÆ¢yÿÿJÿÕÿ-|ˆSÍÿ–ÿéÿtتK­ÿ,ÿÿ]ÿØlõ^V ÷tˆ§ÿÐþvþ¿þwÿz.¤TŽéchÚÇ•½ÿ9ÿQÿÆÿqòM¯ j‹2–î >ÿÄþ‰þ¶þHÿëÿTñú»rjŠ¡›QÜW(O¤Úœ*Ãÿ§ÿáÿPË({¯¯‚VHK80Ãe*)I–¢Þ LÕîàrj1^æÿ¤ÿÿ³ÿ‹6àrÈî ÒVŽƒ¤ÿ%ÿúþMÿÀÿþÿ ðÿÿÿ†T÷ów.KÑ")ä‰HU—Ô¿•Žj"õÿØÿºÿ¶ÿäÿâÿ¾ÿ¨ÿÐÿ>ï¹b`Ðv>}ÜÿNÿÿÿbÿ#o˜¶ÀªˆdFâÄç'D±-±ÿƒÿ²ÿùÿ'n_/<a¬Ñ¸8oÿ½þ2þ!þpþÝþRÿžÿÔÿÿÿ7[VN/£ÿµþàýrýCýQý¢ýþÆþ¥ÿš²ŽSZ4ÃþÿÝþþ»ý·ýãý`þ4ÿÚqòDG›gêÿˆÿhÿÿÂÿAf™Ä•h 3ÿ=þ€ýXýtý¬ý þaþ„þŸþâþ2ÿºÿ"Êÿmÿ ÿàþÇþ»þ¬þˆþ”þðþZÿ™ÿyÿ2ÿËþmþjþÊþÿ)ÿYÿ‘ÿÚÿ~7²¹Q¯ QÿñþÔþ¬þjþþÞýáýFþÛþ…ÿöÿ6Q%ðÿ­ÿzÿ,ÿ½þ)þ—ýVýhýµý4þÿÉÿuä,èI¹ÿÿ€þ ýÄüü¯û¿û9ü ýõýŸþÿ£ÿÔÿÀÿ¾ÿ“ÿ8ÿ×þ´þ¿þÿ.ÿÿÏþ³þîþ~ÿ: ÈÿSÿÿ}ÿ*Œ lÿíþéþ6ÿ®ÿÎÿ1ÿ¹þŠþ£þéþÿðþ¿þ„þ´þIÿ§ÿ±ÿPÿ»þþºý´ýþ‡þÕþçþèþþVþ%þ9þkþþÛþãþµþ›þÕþÿ/ÿ÷þ—þþ¥ýyý³ý-þ¦þÐþÇþõþeÿšÓ•ÿÿTÿäÿL³ìؽåU˜¹¢ Uçÿ¡ÿ’ÿ_ÿ<ÿÿ ÿÿœÿD¹èÕ™6Àÿ!ÿ–þúýqý2ý0ýcýÛýþùþZÿ­ÿÈÿæÿ7Eöÿ£ÿ2ÿ§þ†þÐþ ÿrÿ¶ÿÀÿuÿ>ÿ>ÿaÿ~ÿwÿOÿÝþ}þrþÉþGÿÌÿH@üÿ«ÿ½ÿUD,£õT A(Ë5’ÿvÿÖÿ>¨¡ ¤ÿDÿ6ÿ[ÿÍÿg°Ò 䥟ð½aÑÿ9ÿÿ³þXþþÝý±ýÓý4þ„þÎþSÿÕÿmô_ªØÔtk7S(ËÿPÿåþÂþÝþ&ÿ»ÿA`MÒÿÔÿÈžK]nz¨•3zizÿäþ¼þëþÿþDÿzÿ¥ÿëÿMƒ|dN!ßÿ„ÿzÿˆÿ—ÿÿÿ–$LW$»MÒÿ™ÿŒÿÿtÿ/ÿEÿ»ÿW Ì!%#BZW]ž×ÿQÿ>ÿ¯ÿzÑ‘ºÖU¹Éd·Ws#ënÜ s½–ÞÿÚÿÈÿ»ÿ‡ÿˆÿÍÿsœ8Èa*C •ãÿlÿ†ÿ*øœÑ &¢• ¤éôÓ¶ÏZçOM¸é&Áì\ÁÚÙ|Þ«õ›bç¯ê#³Ê?“,ŸÅÿ—ç õÏx;âÿ‹ÿkÿ£ÿ€Ø6^:V¸:r@q®VlÒ&ª?Ïÿ•ÿãÿrù!é¾ìOÀ"Bæõ'tÂ~n½ìÿJÿÌþ^þƒþÜþeÿðÿ‘9“ÌÓ]ôx|ÿÿåþ×þ þtþ—þÃþ ÿ\ÿÔÿuä­4Ûÿâÿ1‡šhB8†Ôå87ÿ†þrþòþÇÿˆn¦û+Mmº,Óÿ§ÿÁÿâÿóÿ:~‰}ŒÅ²x=×ÿŒÿ~ÿ†ÿ|ÿoÿqÿgÿ=ÿ)ÿeÿ•ÿÍÿ%Üÿ`ÿãþÀþÍþàþïþ¦þfþEþmþÿÿÿÌã,üÿäÿ÷ÿL\/ Ëÿ—ÿÀÿ"pPÌÿ©ÿ®ÿÍÿûÿ F6Êÿ›ÿéÿÄ—å9E¡ÿ¥ÿäÿ¯ÿùþÍýÐü€üóü!þHÿæÿÿeÿdÿ¯ÿ gCËÿ?ÿ‘þþþ-þ\þþ½ýcýyýÓý}þ°ÿÀ÷—ÿºþvþ•þKÿ-{þÿhÿÿýþ\ÿÀÿêÿŸÿÿ´þ¨þÜþªÿ¸V¹Ã^Ð@ ÿÿdþ˜ýýýGýÅýVþÿµÿ<¶¿`ÿ{þÃý¦ý™ýpýhýLý ýýÈý¦þ:ÿ¨ÿµÿUÿÿ6ÿ.ÿ ÿÿèþoþ"þóýþªþûþÿÞþŒþ'þèýîý6þJþcþ˜þ‘þþ¯þëþCÿzÿKÿ±þ7þüýãýþ#þÈý—ý…ý|ýÕý…þ*ÿ‰ÿ¾ÿÃÿÆÿûÿ8Y8µÿßþôýýÉýþJþPþ.þþ?þ­þoÿôÿøÿjÿžþ4þRþ¸þ?ÿ”ÿwÿÿ‡þQþ³þ-ÿ]ÿQÿÝþîý%ý»üýþëþÿ÷þ ÿ,ÿpÿçÿK>½ÿÿµþŒþþˆýqýoýcý€ýÑý þEþÇþˆÿF½Ê›¡ÿ•ÿÍÿ ÅÿnÿiÿvÿÌÿ;n\÷ÿqÿ+ÿüþÌþ‰þiþOþQþVþTþQþKþoþ­þÿ-ÿêþkþþþXþþþ¾ÿf‘W2'KoFÏÿ'ÿ¤þfþ›þüþgÿÏÿþÿÓÿ¡ÿªÿƒÿmÿoÿ‰ÿÐÿ#QhEÝÿ…ÿ‘ÿÞÿ ¸ÿ1ÿËþçþFÿ©ÿC–*žÿMÿÿ?ÿ±ÿb@Éÿ*ÿüþàþ(ÿ«ÿhF¦ÿïþ‰þ~þáþ‚ÿÙÿÏÿ”ÿjÿ‹ÿåÿ•Ij®>fß}ò×LÄ_*0,+H2ÓÿLÿÿþ ÿ ÿ6ÿ±ÿ]¥jhŒö01¸ýÿ„ÿmÿ®ÿÍÿÿ_ÿÿåþüþlÿèÿ$Lhƒ¢šb0Îÿ¿ÿäÿþÿ-÷ÿ—ÿoÿ˜ÿåÿNš³áñ!*ðš×Ï^1ñš~Ÿ S^ò›&Ræ7¨Ž¼íÆh.èÿ<¦#ü¼”iAD[F Õÿ¾ÿÁ@E¥<øÿ [±êíUÞ}Gï+Mdvb‚·¢r<Ç]R†¬ ö³^.Œi7`ÊÉ•†˜™¢ÅÁiE/ÏÆÉ§o+:ˆµÓûÖ¡ƒeƒ§³Ð듉oƒ€?Lå£5+,;’øá|Ò$žQASzN+“í&P8j«î@˜÷ùÔ«*¶O´?úÿßÿËÿÿYÿ{ÿrÿˆÿªÿØÿL®ôΉ‹™jãÿ8ÿ©þCþÿýëý4þ”þÿÊÿõÿÀÿ»ÿÄÿM 2 Ë?*î’ƒ{\7%'8vêHÇêÅ:Z€(0èÿéÿ÷ÿ=dg=ùÿ½ÿÿ£ÿÚÿæÿíÿ+˜çÌXæÿŽÿTÿNÿDÿÿ'ÿ_ÿmÿŒÿÿ«ÿhÿ%ÿ2ÿ?ÿ9ÿÿÔþrþ?þXþ¬þÿsÿ´ÿíÿïÿºÿ}ÿFÿBÿRÿXÿAÿ.ÿxÿ,ãUÊ!ö€ îõóQj=Ù¿ë(/®jS€ºÑ—‰ÿ ÿÝþÿ‹ÿ=­“?óÿ¡ÿÿdþöýsýòüøübýûý˜þÿ,ÿ:ÿqÿ»ÿóÿÊÿ`ÿÿÑþÝþéþðþÿ3ÿ/ÿ ÿÏþÁþÜþñþxÿ,­9*mf#©'·ÿ„ÿ©ÿ­ÿnÿöþ¹þ²þÕþÖþîþûþ ÿ)ÿ+ÿÿëÿ Óÿµÿ€ÿ(ÿíþÖþöþÿÿ>ÿ‘ÿ}ÿëþ:þÖý©ýòýmþ¬þêþÞþ¶þÊþÿTÿ•ÿÝÿÓÿ^ÿâþzþrþ¤þÞþôþ²þ3þ}ýãüÈü3ýãýpþÍþÊþ[þLþ¨þÿžÿêÿÿUÿ>ÿÿ6ÿ‹ÿÁÿÿéþ|þ/þþVþáþ=ÿaÿBÿÛþˆþhþbþnþiþ$þÝýÖý þ‘þ ÿEÿyÿ…ÿHÿÿªþEþüýñý þXþ©þ¾þ¿þ›þ­þÿŒÿ>"Óÿ_ÿUÿÅÿÇÿ\ÿ³þTþ"þ8þ{þmþFþþ+þoþ¿þ ÿÿ¸þ®þ·þºþßþùþâþœþdþbþ•þ¶þÔþâþÿþ.ÿqÿbF1øÿ¯ÿwÿÿ€þþÎý”ýýïývþ—þ‡þŒþÇþHÿDþ2,ý—S_\*ÈÿfÿëþoþþKþ½þ%ÿ2ÿeÿžÿœÿÜÿ!( 7@7D\a,1Ðÿ*ÿþ5þmþ¸þôþðþ÷þÊþßþ+ÿœÿQ^}»áa;Ñjéÿlÿÿ þ"þ þ;þ~þñþ5ÿYÿkÿšÿøÿ•1r5™úÿœÿùÿd¨˜LøÿÏÿ@@ìÿkÿÿÿUÿ¶ÿîÿäÿ­ÿÅÿbt€§‡PžŽ¹ûÉ~âöÿ>ÿ4ÿvÿŠÿkÿ0ÿyÿ”ûC4»B/A‹‰òÿWÿçþ¬þÀþÿ•ÿèÿ<tUW3Jf—¶›¶ÛSñ= ‚Ègs»„Íÿöþ1þþÿÐêìì3×qî»Ý¤Ž¼üK}[ÛpV|šÁÕ³|@.säZ³Ó•âG@Çÿ}ÿNÿpÿ Çà°‹”•”1rÕA'[±<Ó<Ì–LÔ:Ëÿkÿßþ¼þÿ»ÿ”Wĺ΢$ƒè„ÿºÿ,µ,e{W;¡ãëªUõ͇ó í³X ò´q‘¯ïa ·±e戗œQÈoP_¤ðõÄ”xX×ÿÕÿàÿ§ÿÿ¡ÿèÿvínÆ·uömóÿ¶ÿ×ÿ2?:zßD¬ô«"ç®…T+íÿÀÿ×U°àíì.s{3§C+b|PÖg5/pÏCV?òsäÿÔÿ‡ÿ(ÿÃþ˜þÅþ/ÿ¡ÿ×ÿÄÿ´ÿTÿëþµþ­þÖþ ÿ£ÿ 9*Ft®ÝÔwæÿ"ÿ‰þxþ ÿ¦ÿÞÿäÿÑÿðÿTúd>§/Û¦m‡ÿTÿ‹ÿŒi™ÓÇmÜ.ÈÿÅÿëÿòÿE¬"µ6Þÿÿ^ÿEÿðþ‡þEþÏý±ýþÊþVÿiÿEÿÿÿ3ÿÉÿHgS $¾ÿLÿõþ©þiþ þõþúþÌþ§þ£þüþìÿÍÙl Ö›dÈÿfÿÿ ÿ€ÿþÿ&ôÿ|ÿÿEÿ“ÿóÿKJ>ãgh _¤DQXûÿ1ÿpþäýý½ý"þ‚þðþDÿ¹ÿg»‡t¥H —ÿ†þaý¯ü…üïüÐýzþwþþ¥ýŒý3þ'ÿ°ÿŽÿ»þ¢ýçü´ü+ýâýtþ×þÜþÚþ ÿ:ÿwÿ°ÿ·ÿfÿûþ—þ)þÔýÈýþ„þØþÿúþ ÿÿ8ÿ®ÿ!$Ï2oÿ%ÿŠÿN¢}Éÿíÿ÷ÿÕÿÙÿ¢ÿøþcþ;þMþmþßþ|ÿ¶ÿ“ÿhÿJÿ ÿ«þþ—ýBýÜüËüý,ýmý—ý¿ý,þ•þ¥þÖþìþîþäþ¿þ…þ*þ_ý¬üQü[üžüßü÷üýZýÒýþtÿþÿÓÿ+ÿ›þ@þYþÞþqÿ¤ÿÅÿÅÿ£ÿ¹ÿ7Z[¹ÿ¿ÿøÿWÕ÷½¶Ò7[4¡èÿÿ¤þÅþûþÿóþ­þ_þNþ¡þ*ÿPÿ4ÿ ÿØþ–þ×þ(ÿ$ÿ"ÿÜþ|þþ›ýmýý¡ýÁýÀýÒýÖýþ÷ýæýþ!þ5þ€þÞþ½þzþfþƒþ¨þÏþëþÒþšþOþRþ¤þÿzÿÇÿäÿ×ÿ:õd%Ç_áye[{ú˜Ýß¡‰Y+?5ÊW0+=@¢ÿfÿfÿÛÿ{"j.¼ÿ÷þ‰þgþ÷ýýDýnýÁýôý þ9þŠþ”þYþþÐý{ýcýœýþuþ°þðþ4ÿdÿ†ÿÙÿ4X;øÿ#rÅHPm‡uVøüì©utÇTÅÞ˜•¯…eG «\6_½ @[Là—}‡–{ÿÿgÿ]ÿ¬ÿ÷ÿ ÛÿLÿ°þþÐýNþçþ4ÿ%ÿ­þNþ(þÁþ²ÿ|Ýþ/=öªC¦ÿ%ÿ‡þ þßýþ•þvÿsˆO…=³aN•èç’F†D¹ïálóü¥M« 0‘?.f±Ìó÷¨:à…4æ®RÿÿÃÿ ÿÿÄÿîÿAuXÎÿ!ÿÂþŸþ£þÖþ%ÿLÿÿøÿx–î±,à¯H¹ÿ0ÿÙþçþCÿ­ÿíÿßÿgÂCrTß‹¾pÞËŠHG¶Slö*jÀaŽ|nrzsÃ5rÂÆxÎXã©häÿîÿL{zrwƒhÿ[ÿ:ÿAÿ-ÿdÿ¦ÿ¼ÿÏÿ;,êÿ•ÿ$ÿIþ‡ýgýÆýDþ«þàþëþ5ÿ‡ÿ.°13CŒ¦¬©“N¥t«¸ˆ€ŒRá…A3…Bð_•|fP$æi‰ÿâþ¥þÌþÿ‚ÿÅÿ±ÿ{ÿVÿhÿjÿ¡ÿùÿåÿÃÿ²ÿ‘ÿˆÿŸÿ¿ÿ´ÿEÿºþGþþ&þqþ×þüþßþeþÿýýýUþÿÏÿiÁïÌÌïUŒ˜GŸ/àÿðÿ)X~Ї|~–Ÿµ£e"?˜è&[m2Ï`ñÿìÿÔÿ×ÿæÿÍÿ½ÿÊÿ±É¸Ž<ÌÿmÿÿÙþ­þ|þ&þµýzý’ýêý‹þ<ÿ³ÿÿÿÒÿÍÿàÿàÿ´ÿvÿ4ÿðþºþ¡þ¡þÄþÿHÿšÿ¥ÿŠÿ‘ÿŒÿ¦ÿßÿ'ëÿŸÿƒÿ‘ÿäÿr¼¬?¡ÿ=ÿ*ÿUÿÆÿ9˜§¾ç=1ù ‡ÿ@ÿ1ÿ;ÿ‰ÿ×ÿéÿ§ÿMÿ ÿÿzÿÅÿ¿ÿwÿàþCþüýþmþ¬þîþíþ½þÁþÝþÿSÿ…ÿtÿ+ÿ¶þOþþþþ3þ-þ"þþöýþDþ|þ·þÛþÜþ þaþ.þ!þMþ¶þÿ#ÿ&ÿÿ)ÿyÿåÿ2)îÿ”ÿÿÓþéþ<ÿ;ÿXÿPÿ2ÿQÿŠÿÉÿ9Ýÿ—ÿ6ÿâþ¸þÃþÛþÿñþÊþ þ„þVþþþ"þ&þ þÑý½ýòý!þZþ×þ2ÿ[ÿxÿ˜ÿ±ÿÊÿŸÿ'ÿþÐýMý3ýŽýØýÙý¤ý‡ýÄýþ þ÷þÿÕþþ[þ…þÒþÿIÿTÿIÿÿÑþÐþñþÿ ÿ&ÿ-ÿNÿ{ÿ˜ÿ®ÿŽÿ6ÿ×þ˜þ…þ”þ¸þïþÿ(ÿ4ÿTÿTÿiÿmÿcÿcÿ>ÿêþ†þ'þþþ,þþ¤þ•þ©þ»þÒþ!ÿ’ÿ=$äÿÅÿÌÿ'3üÿ:ÿuþþ&þ1þpþ­þÈþÇþµþ±þèþÿRÿuÿ~ÿ…ÿ[ÿ$ÿÿÿðþ ÿ<ÿBÿ.ÿ7ÿ.ÿ:ÿwÿÚÿ¿ÿnÿBÿ9ÿ]ÿiÿfÿDÿ1ÿÿÿCÿjÿƒÿ¯ÿËÿ ðÿôÿÛÿXÿÜþ«þ¬þËþ,ÿ°ÿ2»ý“Åÿrÿ5ÿ:ÿfÿwÿ¦ÿÛÿöÿéÿ:EKY3çÿ·ÿŸÿŽÿ5ÿîþ ÿÿ"ÿ8ÿ]ÿQÿ^ÿ¬ÿíÿ:p¶êþîïÝÐÍÀ¤vgxW0ÞÿÊÿ†Ò@7æE/ ›ÿTÿ8ÿAÿ”ÿ´<_§ãÇå/±ÿvÿ€ÿ´ÿ³ÿoÿ,ÿ.ÿ„ÿóÿb³ýÖ‹‰¤–-¼ÿoÿZÿŽÿÍÿ(zÀ>3õØü>±08ÖŽ»é(BQ;4%<HÇMÅ%ÎÿÜÿFjµ2{Ò-4Þ†BÍ`ùÿ ÿ¤ÿÚÿíÿñÿ *%8p‚މik}ÔQœ¶×ûðßп¬–§Þ:Q-9×äÜÜ ? %H©)$ Ì`Ì>…±ÿþþHþêý-þ ÿ&6!²(c\þjê|õ”Fïÿ²ÿmÿ+ÿ7ÿoÿ¼ÿ2?@kœæúÔ“:JÃk¤³li¯Á¸•¡¦¸ÝÖµ²ÎÆ…X3 %w„XÜHWærÒÃI€'kÍ"ú„îÿŽÿNÿOÿšÿïÿ2I>AG<ZZWR6÷ÿÿíþ—þ©þûþ3ÿ'ÿÄþIþ/þ~þÿÓÿ‡ËÆ ®CÍ;1Ë;ït çÿ lÜ[ö†«MÓ 9ÿ ÿNÿvÿ~ÿ•ÿÇÿ mÖàzÇÿþþ¢þsþœþÿAÿbÿ¡ÿóÿ/,'óÿÁÿ¿ÿµÿ¤ÿxÿ ÿÄþþ¤þÇþèþöþêþÜþþ_þþ³þßþùþðþÿ}ÿåÿf®ðÔ•OóÖÇUÖÿ^ÿþþÿXÿüÿ€‘|?‡ÿar9°ÿžÿÔÿ,9?$½ÿiÿEÿƒÿzÿ5ÿðþÜþÿ.ÿ1ÿ:ÿlÿ®ÿ0¥×´Vÿ³þzþyþhþþþþþþÿþ‡ÿ·ÿ¶ÿ«ÿªÿÖÿ/sˆ]ÿøþÔþÿqÿ·ÿÿÿ'L‰¦‰YS2êÿcÿòþ´þrþGþEþ€þâþIÿÃÿRÇ¡UDÝÿsÿ.ÿ4ÿŽÿŸÿDÿËþÇþîþ ÿšÿÛÿˆÿ÷þŽþ:þ&þfþÁþþþ#ÿÿõþÿÿÇÿ‹ÿóþ(þ-ý¨ü©üèüýGýTýiý½ýôýþŽþ;ÿ¿ÿ£ÿ‰ÿˆÿKÿÐþUþ:þAþ_þþÎþÈþ~þ[þÈþ€ÿ\¯ÿ»þÖýwý¿ý2þkþþ™þ°þ ÿšÿVÀµ@€ÿÐþ'þËýÑýEþºþéþØþªþ°þêþPÿˆÿ«ÿsÿÒþJþòýµýÓýJþÃþÿÿÿ>ÿ”ÿ Pâÿ6ÿrþ ý ýèüýbýðýUþšþîþ$ÿDÿ}ÿ¸ÿÎÿ™ÿMÿÿƒþ8þ9þkþŠþ¹þÉþ¸þWþéýÙýþTþ¢þ§þ-þ˜ýXýÍý þÿImWÔÿ‚ß±õþ+þ÷ý@þßþ‡ÿ V¨ ^§ìü½<h‰ÿðþŸþþüþcÿ‰ÿÂÿåÿÖÿ³ÿ­ÿhÿÿëþÊþkþ-þKþþ®þåþ*ÿ_ÿ`ÿ@ÿ ÿ¤þnþcþ€þÖþÿÿëþéþÿ_ÿœÿ—ÿ’ÿGÿîþÆþÀþäþMÿºÿ«ÿ`ÿ'ÿLÿçÿ剦¢¢ŽS@%÷µž±˜Oìÿ¢UàÃt ¹9¸ÿ’ÿ„ÿÿ¨ÿ(º7{š¢E¶'|ÿÝþÐþäþ&ÿuÿµÿÿÿH”qBæÿwÿùþ þ‡þnþ[þxþ­þîþGÿðÿã²÷‹Ñ1þÿüÿÏÿMÿ ÿÿ{ÿÂ,î7k`E-4ò’C ê †õ)MZ1r Çÿ’ÿƒÿ×ÿl×*ÔˆÐÇŽ S^Ùÿ¤ÿ¥ÿÐÿ9–Žnÿ€ÿ÷ÿzëíjæÿ~ÿwÿ¡ÿ¿ÿÙÿ>«A­ ÚaÙ<™3Ýÿõÿ6¶#cž¸ªÒD|dê†X]ƒÝ ¿Rû:À7_,â¢n^Y•Ñ÷Ô´†]Ze”iªÀÿÿÿ–ÿ-§Â›Ž¨¶DµÂÿØÿ pµÓöøàÐÑê(””E­Âÿ©ÿàÿcß5: Îî(=TD­ÿ§ÿïÿ†aõ52ÍUúÅiÊ~ÿIÿ.ÿmÿËiØÛ„JOX!©óÿjÿ=ÿdÿÜ…½Ÿ†]2’ÿÿ€þgþ‹þžþòþnÿ¶Èo*ôÿ+„¦9¤ÿ%ÿ ÿ?ÿÿÁÿðÿÿÿÁÿÿŠÿÛÿ]ÊH‡ŸgWÚRô'¬ÿmÿ{ÿÒÿäÿ}ÿ7ÿ)ÿ¬ÿrèä­tPUžÔj(BJÖÿ¥ÿ\ÿ2ÿ8ÿcÿeÿ?ÿ>ÿQÿ{ÿ«ÿÅÿ›ÿÂÿK“¬}$iÿÈþŒþsþUþ+þöýÛýþþ0ÿýÿÐ]b ±‰jP §ÿIÿÿåþ0ÿÿ½ÿöÿ;†â 6òqúÿáÿ±ÿFÿÿ&ÿŽÿ!În‚¨b4üÿñÿÞÿ”ÿ1ÿÎþÏþøþìþØþìþÿÿÈþÁþýþõþ´þ¥þÝþÍþŠþEþ_þ¸þÿOÿwÿyÿÿkþðýàý/þ¤þ3ÿÁÿ5Œ¥vWxˆHÜÿ—ÿÿXþèýþ~þÞþ.ÿEÿEÿ>ÿ@ÿ»ÿTŸ¢C‰ÿÑþ<þþDþjþ4þYþaþhþ”þáþ_ÿ€ÿ¬ÿ¶ÿ¡ÿÿgþþ*þpþ³þöþâþ þ2þþQþÊþêþ¿þWþýÃü‰üÈüSýþÃþ(ÿqÿ’ÿtÿíÿ£÷g®ÿÞþ0þŸýsýºý%þdþgþ˜þŒþTþgþ•þ½þ¾þuþùýýIý€ý(þÑþ#ÿ4ÿÿóþÿ<ÿ}ÿ€ÿÿ{þÓý”ýÆýCþÃþüþ(ÿ>ÿÿ£þƒþºþÿ.ÿÿ‡þ;þ¼ýpý¥ýþ¾þIÿ‰ÿµÿÑÿîÿðÿâÿÁÿBÿ}þãýìýFþ§þÿ~ÿþÿY’èó’üÿgÿûþ þfþ:þôýÌýœý–ýäý^þóþJÿEÿ?ÿ5ÿÿ0ÿ]ÿFÿÿ¢þœþæþÿQÿ¢ÿÒÿØÿ©ÿÿiÿÿæþöþÓþ•þrþŽþ±þÿ“ÿãÿúÿÒÿ‘ÿCÿ7ÿpÿ‰ÿœÿzÿ{ÿsÿ‡ÿ³ÿèÿ(5/(9=<P'ìÿ¨ÿgÿLÿ1ÿ6ÿvÿ¨ 7yøÿ¤ÿIÿ$ÿ"ÿýþŸþ@þþ~þ1ÿæÿQHòÿ³ÿÔÿU€p/Á{‘Öô÷¹Uéÿ~ÿÿÝþÂþÇþÓþãþáþÿ~ÿþÿtâ8P­J#0÷ÿØÿÞÿÝÿ.°O#öÿÊÿÞÿøÿÝÿäÿ/3/* ÆÿÃÿãÿÚÿ°ÿÌÿzÉ^5âš§Ö$ê°½Û;oys#ïÿÄÿ¶ÿÅÿëÿ@­âÌŽÓ+[Z[µ®Ë˜/üÿùÿ1‹»Ä¸e+N9üÿþÿ ¡8«Ò }‹›U ¥;ýÿ!Q›ú:€Ë+BB‘z=¦1øîõ¨”Œ•Ž–}›üY ´Ú÷ççææCÂÿÿzÿ¿ÿ#~··É×ï-CUfa“©ž‚g3ê³1±ÿ²ÿíÿ5 (22`´8ølYögÔ‡i$Ôÿ,ÿ­þ¨þÖþCÿðÿ¼j¿Ë©Èr¼É!2Q½ÿ¬ÿ ’çÝE¡ÿYÿ’ÿ;ÁânÈuj¾6ÈøÂ2´»ª{5áÿWÿ¦þmþùþµÿrÞÕ†0åÿ7ï\:ÅœÇ×ö53ÛnM5D>e‹˜ŒwZQ˜ýJ¡Øß¢Uñ—1Íÿ‚ÿ1ÿÿ_ÿïÿ}ñMŽªˆuÆ`ãÿYÿ ÿ ÿÿIÿqÿ‹ÿƒÿ—ÿ¸ÿ“ÿtÿŸÿÍÿÆÿËÿìÿüÿåÿäÿÚÿÒÿ»ÿïÿJ–Ûå±{9Øÿ—ÿ]ÿIÿiÿ¤ÿ™ÿ>ÿÜþòþhÿ¨×ÆœS^ˆÍß—sÿÿIÿ¤ÿ×ÿðÿøÿùÿèÿA ÁŸq=¿ÿ˜ÿ˜ÿ§ÿ¸ÿÃÿ²ÿ¦ÿ´ÿ¢ÿ›ÿªÿ¿ÿªÿŒÿpÿOÿgÿšÿ±ÿ³ÿnÿÿÛþ¬þ­þ¹þØþôþ ÿGÿÿžÿ¸ÿ©ÿpÿ%ÿâþÿCÿ~ÿ„ÿ=ÿ¯þ3þþ1þiþ¬þÿ”ÿ"ˆºïÿ³6ÃÿŒÿ9ÿùþäþÈþìþ#ÿšÿ,iTßÿ‚ÿZÿGÿGÿjÿpÿ9ÿÿÿ@ÿVÿ>ÿÿÑþúþ/ÿúþ©þHþþ þ6þ]þXþIþéýdýDý˜ýPþ(ÿ³ÿâÿ®ÿ]ÿÿÿôþÖþƒþäý?ýÿüýcýÕýSþ–þ¼þoþKþ‡þÆþ ÿFÿeÿYÿÿ|þþþDþ©þ.ÿ¨ÿˆÿ ÿ¾þÛþBÿ­ÿ ‘ÿžþßýhýŠý þ£þ þXþþûý;þÈþ„ÿáÿøÿªÿÿºþ±þ¸þ˜þþmþþ¿ýäýpþ6ÿ ÿxÿ ÿ­þXþ<þÄþˆÿìÿßÿÿÙþ—þÉþ×þÁþžþ?þ¸ý]ýý>ýšýþ0þþþIþ€þÀþ/ÿrÿÿ¤ÿ Úÿ¬ÿŠÿ>ÿìþÓþäþÜþÃþËþÙþâþêþÿqÿ¶ÿßÿ /üÿÉÿÇÿÜÿ ãÿÕÿaÿ·þOþAþ¿þ;ÿ‡ÿ‰ÿƒÿ¹ÿ!Âdʸj¿€FÒÿ.ÿ‡þþÏýÊýáýþ&þ(þ#þ0þ0þXþ\þWþhþþuþbþªþ?ÿ¥ÿ“éè•KÎÿ¼ÿ«ÿ[ÿòþýþkÿÉÿ #2véøªw‰ãâM¶ÿ‡ÿyÿ|ÿ¤ÿ¿ÿëÿÚÿÈÿG–Û&n‹š§-Òÿ¨ÿ£ÿfÿõþ£þsþQþFþMþnþoþIþrþ¦þ·þäþbÿõÿNfy¿`€žŸIÏ\ßÿlÿ,ÿ3ÿ_ÿpÿ[ÿ‘ÿÒÿ(ŽíSxWA7)â½äÕ«u_%ÙÿÀÿÓÿÚÿÎÿôÿ.2‚*¬åÀ.ì´ÐÀaÔÿxÿ\ÿ{ÿœÿ ÿuÿ‚ÿ‘ÿ¦ÿêÿa”“~‹›¾ËÕ’*¢6&ZvT!]±`‡†Bçs- éÿßÿ²ÿ¯ÿåÿBÏÏœuŸ”ôUnÚ¯•t]QÑ´ z—ñHŽÙ_¥ðá–‚2<#ÐâØç ÚÚ#U3óù0€‘>›èÿ‘ÿ¹ÿóÿôÿ¸ÿWÿ ÿßþÿ¯ÿJŽ‚,Æÿ—ÿñÿZ’¤Kúÿóÿ-¬^®³Õá EDç_##—-—A ฺâ÷Õ¨§·Òâãד¹Báÿ¹ÿÌÿ¸ÿ—ÿŠÿÀÿ²ÿ©ÿÁÿôÿ6ET<íÿ“ÿQÿÿØþÍþÄþÊþèþÿÿùþBÿ‚ÿœÿÌÿ¬ÿ¹ÿwR•˜sx[ej;ëµ»Àã4r—×ûòäüïºv*°YPQFG,õÿ½ÿ…ÿÿîÿ;(Ðÿœÿmÿ„ÿ÷ÿElWÿôþ ÿcÿŠÿ€ÿCÿÿØþÆþÃþÞþÿ4ÿ'ÿ ÿâþ¼þÔþúþÿOÿ›ÿpœ€SãÿÌÿêÿþÿÃÿÖÿ/•¾›Qäÿÿ}ÿòÿ­[ü™°\ ¸}Hè’þÿQÿÀþ…þœþÇþÿmÿâÿ"`Ÿ¶|Úÿ&ÿ™þRþŽþÜþÜþôþÿÿÜþñþQÿ”ÿ{ÿ0ÿ´þwþpþuþÅþ'ÿ"ÿõþùþÿûþ¶þþpþnþ‹þ¸þÜþ½þ–þ¡þ¼þÿ“ÿM]W>h¥ÀÚ¨Z Äÿ»ÿôÿIŽ—g/Ôÿ†ÿkÿ\ÿ7ÿõþ¹þzþ^þ…þ¹þôþVÿ³ÿ‘ÿ8ÿÝþžþþ¡þËþ¸þ¤þkþ4þ&þRþpþcþ*þÖýƒýVý{ýÄýþîýþ>þ9þþÞýãýèý¹ýý·ýÓýÃý³ýÌýÌýäý þvþüþ‚ÿÜÿûÿ!Gsœ•u9çÿÞÿ¸ÿlÿ0ÿÿîþºþuþkþþ¹þÿ0ÿ>ÿOÿsÿžÿÂÿãÿçÿžÿeÿôþcþ þþþìý©ý<ýýüý$ýrýáýYþÀþÿQÿ…ÿœÿºÿ¥ÿÿ)ÿ‹þþ¸ý›ý­ý¾ýÖý þþ®ýý¿ýAþÊþTÿ¶ÿªÿyÿgÿ¶ÿ>ž¨iÓÿ:ÿþþÿgÿÑÿÝÿ·ÿ˜ÿ}ÿ›ÿÁÿáÿºÿÿZÿeÿ„ÿ¥ÿ­ÿÃÿÁÿÁÿÆÿÉÿÔÿàÿ-Æÿ^ÿåþ•þgþiþŽþ¦þ˜þþ¦þÍþ6ÿ¼ÿèÿÔÿ“ÿMÿDÿWÿFÿ'ÿÿÔþ¼þÎþÕþ°þ–þ¥þÞþ=ÿ‘ÿ“ÿKÿÿõþÜþðþRÿµÿßÿøÿ;‡Æ/¾CÆÿžÿ™ÿ¸ÿµÿÿ4ÿ$ÿGÿ„ÿ½ÿÛÿÎÿúÿI¦T‹ÂÇw/ÓrðÿŠÿ,ÿ´þ^þ@þrþÖþAÿ»ÿUÔ%&%Nno"ž9éÿwÿOÿÿ¶ÿ‚ÿDÿÿÿ:ÿ\ÿuÿlÿNÿ ÿÿ,ÿžÿãÿ0c£â!-,íªsWÀÿ`ÿÿÿþÿ(ÿÿ ÿ ÿÿGÿÒÿ®VÙ)RV6 É*–cT"úÿßÿÓÿÓÿàÿûÿ1†Û^–¶|úŸt6ñâ”óÿíÿêÿ¾ÿuÿÿ©þƒþ¢þÿ×ÿDÇk§àÂi'ïÀvÿÿ—ÿWÿTÿ~ÿîÿ6Tˆ¶è7–¯Ú ÃUòàØñ#oÓ;ZLï¼™”md`/)Yj¯Ûîå¶cüÌËÕêÝ´‹kƒÚæø õâþ2Y`B)Óm8EO8#={Œ´’A,_‹JéÿàÿbÈù  !YÀ P@ ÞéÿVrŽ¡ŠAî¤Iè«TÿÿvÛ  íÚºaÊÿ‚ÿuÿXÿ)ÿÿ"ÿÿÿuÿÞÿ )C+Óÿ–ÿ‹ÿ‘ÿØÿ>JèÿÇÿšÿ‰ÿíÿhÊ >dQA$ïÒ¢l*Úÿ«ÿõÿ´@‡|rfctGü—I)¥ÿmÿÿÛÿT—´©]8*7x½¬}U&æÿ­ÿßÿºÿwÿ)ÿ÷þÿOÿšÿÄÿóÿõÿÈÿìÿßÿ£ÿ‘ÿ™ÿ™ÿ=ÿ¨þþúý þRþ»þÿ:ÿZÿŸÿóÿX¤ÂÚì³ss~©±d&îÿÚÿÿÿ?&½ÿ€ÿeÿ}ÿ ÿßÿBv³ØâØnöÿvÿøþ’þYþhþ”þÿžÿÐÿìÿôÿ2z}Lýÿ ÿ@ÿÿñþÿOÿHÿÿŸþ–þªþÿþXÿoÿ5ÿÿMÿÂÿ;kY=Öÿ¹ÿ¹ÿãÿôÿðÿ½ÿAÿ¿þþªþùþÿ.ÿTÿ,ÿ/ÿjÿ¬ÿ­ÿÿ6ÿÝþ‘þoþˆþ£þ¿þÍþÜþÿAÿÿßÿõÿßÿ”ÿdÿBÿ ÿ³þ_þ*þ%þ0þQþ†þÓþDÿ|ÿ‚ÿsÿdÿNÿ4ÿÿ!ÿÿÌþÁþ»þßþ ÿùþ÷þÿ½þ_þmþ“þŠþ_þZþoþ¤þØþÿ ÿÌþ‘þ“þ—þ†þVþBþ*þòýÐýþWþ;þÊý¥ýÖýéýïýþþþþþ\þÀþæþàþ&ÿLÿJÿNÿVÿgÿWÿiÿ·ÿ'. ìÿ„ÿ0ÿøþóþëþ þMþ)þDþrþ™þåþÿàþæþÿOÿÿ³ÿãÿ¯ÿ?ÿæþìþÿ5ÿ™ÿõÿ¿ÿ2ÿ£þfþ†þ»þÒþÜþæþÃþ¼þ°þ¯þÅþÿÿåþÕþ¯þ¦þ¾þÁþ¥þ–þŠþcþHþþ½ýÓýþiþ¿þÿ(ÿ)ÿ=ÿªÿ3S"öÿ“ÿÿ ÿeÿæÿDaQûÿƒÿˆÿ·ÿäÿîÿÇÿ~ÿPÿ*ÿ4ÿ–ÿo’„:Ìÿyÿfÿÿ”ÿwÿYÿKÿLÿLÿ~ÿéÿX—€‚ÿ@ÿ!ÿ7ÿ}ÿ‚ÿ(ÿsþàý”ýèýgþÉþúþÿúþ¶þ¼þÿÃÿJ•_¦ÿÿ.ÿ“ÿðÿNmc»ÿ§ÿ³ÿýÿ•Y÷"cÿcÿåÿhš•]Ýÿ©ÿêÿK­Ôâ¤OáÿÔÿk·¿˜JÒÿÞÿ X‡¡¶Î¬¾,‰ªN«ôÿ€ÿÿÒþ™þ”þƒþ‚þœþþmþ—þÿ’ÿ(ÛéÈÊ]\dPúÃÿÚÿôÿJ‡s<#g©ò)(ÖenžóW¿´; ÿÿéÿïÿèÿçÿ)c‰ÌJì-Ò«l@5S^\åÿ¹ÿºÿŒMÄÿ‡ÿäÿƒAŠ_;`~}–Uý¹ÍÒÖçêùì #Iu‚aáÅæ ?jB'Ny‚¡™m6ï×Ðäè×;Ñ*QƒŸ®‰Dúó¨9½/ÏÿðÿH¹ú3]v”´ò Òkõ³²u©’RîVnUùn2j¬Ì»¢––ˆ¸ûñõݺ·±Ê7ªÚ€ðx.A[i|vX<aÑ@Ì3à›j8Õh> 6†°Î$Md:¿}iNDV–ÀºÜ?|©·–”-ßÿ¤ÿrÿUÿ)ÿAÿšÿØÿ<šùÚå¨Fãÿ]ÿ%ÿÿÿŸÿ<F>B¢ß×…JM~£¡¯škH.9MiYEF6@…å.%å|òÿÈÿèÿ.‡|*Ìÿ”ÿvÿíÿªß¸JÄÿeÿ`ÿšÿöÿêÿÿõþÒþÿQÿªÿKejkkypgEÆÿaÿ1ÿ-ÿƒÿåÿåÿÀÿÝÿ!il&•ÿÿåþÿBÿÿýÿÃÿdÿÿýþ ÿ7ÿeÿÿºÿÆÿÊÿÈÿÇÿ¹ÿéÿþÿ×ÿ{ÿÿøþÿ=ÿ”ÿøÿ1:. óÿÙÿÛÿÐÿ®ÿ~ÿmÿ ÿäÿ*XlB7Zni(ôÿÅÿ¨ÿÉÿ ' Üÿ—ÿ_ÿÿôþÿ&ÿÿ¸þaþ.þúýóýÞýÈýþ5þ/þ_þ‚þ·þåþÿÿ×þ¥þ^þþïýçýÒýÕýâý+þ…þÑþãþØþèþÿ?ÿxÿ£ÿ•ÿhÿQÿ@ÿ?ÿ.ÿ#ÿüþÑþ¹þÁþôþ3ÿ†ÿãÿ+Vxª•9·ÿDÿÊþGþ/þ‰þ×þ$ÿuÿLÿ#ÿÿ\ÿ®ÿªÿ…ÿ^ÿßþ.þ´ýeýRýiý¦ýËý°ýpý4ý1ý¡ýíý2þ‡þ¥þ`þ5þ þÉýÏýþ1þîýÎýØýïý3þŸþÈþÆþ†þŠþ‰þÍþÿ1ÿCÿ#ÿÅþSþPþ¨þóþEÿ«ÿ Jwˆ©Ç¤pÜÿ ÿ>ÿþþ7ÿUÿ9ÿ ÿýþ)ÿÿÌÿÒÿÌÿ§ÿjÿQÿ}ÿ–ÿˆÿfÿ;ÿ#ÿÿõþÿCÿOÿÿúþÿÿ3ÿSÿ„ÿ–ÿvÿhÿÿÃþ¶þ®þ¼þÉþÈþžþ¢þÄþúþ?ÿhÿZÿ-ÿÇþ‹þšþµþóþ ÿûþ—þaþ+þkþúþ{ÿæÿ.`…¸)f+ª(®ÿNÿKÿNÿKÿNÿYÿ«ÿJÄÝÚÅÔ %£Óÿ`ÿ7ÿ0ÿ\ÿvÿ ÿÏÿîÿŠéDZŽso*êÿ¶ÿ„ÿ‡ÿ_ÿ=ÿÿÿØþÎþÿXÿ~ÿwÿƒÿÿ¯ÿíÿìÿíÿåÿÔÿùÿäÿÑÿ%ml; Ÿÿÿÿ/ÿeÿ¤ÿÞÿÖÿ¤ÿÿ¿ÿrƒ t5A—º0´Žÿ ÿêþ<ÿŠÿ »6†Ìð0N8ÖW·Ui½ ØWÕÿ›ÿâÿZ§„€ÿÿõþÿšÿ$•ØÓ·ÈñâÓ§3±ÿKÿðþØþÿoÿÖÿüÿãÿ¼ÿœÿ¼ÿz!¡™OVY›Å×¥r&ûŬÐöNžQƒ…Æ " ÍG·ÀÔ\ÜOéÿ¦2˜€ܸ” Ô ë¶Ê&[jswAÓAÆÿ‡ÿzÿ ÿÍÿ@RžùK›ñDJê†.BdbG«m¡ˆ±µ˜¤ê'0 Þ™\:>pÖe[$Ýx>.3ÂWIv¹!©ë¥gMÞ¥’V/&h—¬‚2 !&Øÿ¥ÿwÿ©ÿ>yÊ•B{ør–e/éËÓÐ×ÐÂÑÏÌÙþüànH• ?VJ ê?&ñ§?D£õ×Ú?Dðµ“Mêÿ¸ÿãÿ÷ÿ=Õ@q$Þ‘üÿ€ÿÿéþþ3þ=þ˜þ ÿeÿÿÔÿûÿËÿÊÿ2³Ø³‰­¶Z ðÿÿEÿ,ÿ7ÿ\ÿÿºÿºÿ±ÿÿÿwÍÑħz‰ž‰„F ;RŽ„cl¤ÚÈ¡•tb ‹ÿFÿ@ÿWÿŽÿâÿ4< ·ÿ€ÿuÿ˜ÿØÿòÿªÿ:ÿþLþxþÊþ ÿ?ÿpÿwÿ†ÿnÿqÿ‹ÿÃÿÕÿ¾ÿÇÿÈÿŠÿgÿŒÿàÿ$%íÿŽÿ ÿ®þ¯þËþ›þ‚þ>þGþ¦þ$ÿŒÿîÿ0ìÿ}—¿ÛÛ€=´ÿ[ÿ ÿûþýþ ÿÿÿ.ÿkÿèÿ>f…2™ÿZÿ"ÿÿ.ÿ>ÿ+ÿÿ8ÿvÿmÿ6ÿïþfþþÞýþ[þ×þPÿÿqÿ#ÿÿ-ÿ:ÿ\ÿÿPþ½ýý¤ýõý9þ]þzþ„þ‡þ–þþFþþðýžýüüˆü€üÎüeý÷ý,þEþrþÿ¦ÿ=ªÐ—¯ÿšÿ‹ÿ~ÿ•ÿÿRÿèþºþØþ ÿfÿkÿ/ÿÿçþõþOÿiÿÿ)ÿ0ÿHÿJÿPÿ’ÿ³ÿÇÿëÿ³ÿVÿÿ±þGþÕýdý.ýý"þ€þïþ'ÿ ÿøþ8ÿ^ÿÿÝþnþìý}ýGý…ý÷ý3þPþtþNþ`þdþCþ þFþþ¸ýý™ý™ý’ýþÇþúþåþõþ!ÿ^ÿrÿzÿ¨ÿçÿ÷ÿÿÿP¾þÀFßÿ¥ÿ¢ÿ¼ÿûÿ Ãÿ‰ÿfÿ›ÿ×ÿh¶ß×ÍÚ¬víÿÿ"ÿÿÿàþþéýdýý%þ×þTÿ†ÿÿvÿiÿtÿ|ÿWÿßþEþ–ýýûüñüGýâýéýÓýþ)þrþµþîþ1ÿ5ÿUÿdÿ+ÿãþôþ^ÿâÿˆû,ØSGW›| ‰ÿ†ÿ×ÿ%{ÙðÞÁÛþ¶†M(ùÿÅÿñÿþÿîÿªÿÿ‡ÿÓÿÂÿkÿ]ÿMÿBÿ4ÿVÿgÿ£ÿ¼ÿàÿâÿ¼ÿÄÿÈÿÂÿ©ÿWÿ¾þHþþ?þ»þçþÿ!ÿIÿ›ÿÕÿPáä«h80d§yˆ¿ ãÔ°w Œs•ª‰“Êô8* ¹‹ÿ™ÿ·ÿ·ÿðÿ%òÿ¾ÿŽÿ¸ÿŠ=f3ÁŠŒ“²’iîÿmÿÿÿ>ÿfÿ¨ÿœÿÎÿòÿ?vÈ;ýéÓêßçâæáÕµ|ž·Ò7Daw—áºk!۽Șu1ùÿ4ŽsBðf?¨ê 0³ÞÛë  ×|=!àg- Ýÿ¯ÿ¸ÿ÷ÿP°8­ó„ÿó <X?쓈¼O‰” Ò¶ƒ©äÅÝö>‡Û#`øVµLñÿµÿòÿ"øÿÛÿJU‰Â±Ä1f_DR…ÓÒÜ̉‘ùPâu,$u£½ÒŽl‹î:›š ·z[pQ[E?Ÿ +÷½¯ˆF Ãÿÿ³ÿÑÿûÿ#0clÎãȇ!Îÿ¹ÿ¯ÿåÿX©È}OmkTbhd^’®µ×ø)hf`k`pŽ{«vd'ÿÿ<QIJj­©‹”†˜ŠšJ([ked|9öÿèÿÈÿzÿWÿ<ÿ%ÿ(ÿVÿ¤ÿqÿfÿ§ÿÛÿ\bÿ:ÿFÿ9ÿpÿÒÿîÿ¸ÿêÿ?L‡Î¯c·ÿrÿyÿÂÿþÿO¨fb`k>åhÛÿûÿzØ»Œn‚Âþú§]íÿtÿ?ÿÿÿ6ÿOÿZÿwÿ˜ÿãÿ3i”…'ÛÿŽÿÿ‰þ>þDþ9þLþ¤þïþÿ÷þ!ÿŽÿåÿ÷ÿÒÿqÿÿíþ ÿpÿõÿTUîÿÿIÿñþáþ÷þÿèþ·þkþ8þ”þ$ÿàÿn½À¶ŸS3q…Cëÿ‡ÿÞþ‹þÁþWÿ²ÿçÿÙÿ´ÿUÿÿÿ8ÿNÿ-ÿ¿þSþ%þPþáþ‰ÿ õÿ¯ÿ9ÿÛþÈþÇþlþíýtýþüÄüýüpý°ý÷ýuþÿtÿÿ~ÿaÿAÿÇþœþ€þ þ¡ýuýý¹ýåýþSþjþ#þÇý«ýóýEþvþºþÿ=ÿ9ÿ'ÿÿÿÿPÿiÿÿ®þ•þÅþÙþÃþÿ]ÿlÿwÿ©ÿ®ÿpÿÿÞþÈþ‘þBþþ4þ“þµþÇþÛþíþûþHÿfÿiÿHÿôþ¼þ¼þÙþÂþvþLþ<þ:þDþ†þÁþëþ ÿ8ÿCÿWÿuÿŸÿÏÿšÿöþ~þcþPþ$þþQþþÄþšþYþ'þ2þ@þXþŽþ‰þ\þ8þTþ–þìþÿ/ÿdÿrÿPÿRÿ‚ÿÓÿÑÿÍÿÌÿÿKÿÿ%ÿ6ÿ3ÿSÿˆÿ®ÿØÿ¾ÿŸÿˆÿ„ÿ›ÿÎÿ Óÿ²ÿ¦ÿ‡ÿvÿvÿMÿJÿMÿGÿvÿÒÿôÿ!þÿÙÿ•ÿfÿiÿjÿ>ÿ?ÿ?ÿLÿLÿ}ÿÿnÿ4ÿ(ÿOÿ‘ÿ«ÿ…ÿcÿLÿ@ÿnÿ©ÿÇÿŸÿ•ÿˆÿ‚ÿ“ÿ¶ÿ .ÙÿÃÿÄÿîÿÌÿÿuÿeÿzÿ¦ÿîÿ=…®¬¬¬z(úÿìÿÜÿJQ©ÿ³ÿðÿ E“¹ÅÞ&F`DB(Ø|×ÿÕÿËÿ³ÿ~ÿ9ÿ ÿÿ5ÿjÿ¬ÿæÿÖÿ¶ÿŸÿ®ÿøÿ,'øÿ/k‹˜¡l9 æÿÅÿÃÿÒÿÎÿêÿ#`©Ø $EYHÔhÂÿ ÿ³ÿT‰§¸ºè4]fJëÔ÷?Icb2Í>çÿÁÿÒÿøÿY°ÓÊ膅Ç%}„JøÓÁÁѺœ„bûÿ(#3q¼ÕäBss›±¦ŒjU;+1U…‘–¤°Ëàùì𴆕¤ˆˆÅ´‡p„r+ÙÀ¢nNUsoê#Vx²¯‰zw@$ @S5œ'vÇ4sR4fƒ~EÓeP TЇJð΀¯Ê Ø‘’£xff/ê¡™ÁX; µQG¸ù69ð”8ýÿ^ŠÄßæ­ƒ{}kpvO ðÿ`¤¸ÓªdQsºùùä¦ÿŒÿÆÿÞÿõÿ.R`—³# ݆0÷ü: ºÿÌÿgŠ™Qïÿ¼ÿäÿ_±¶´wõÿ6^tGäÿµÿ£ÿƒÿ\ÿxÿÑÿæÿÆÿäÿñÿÌÿ¯ÿ¸ÿ3žÌ™0³ÿHÿKÿÍÿ8U¼ÿ¶ÿ³ÿ‹ÿˆÿ¼ÿ½ÿÿ=ÿCÿLÿUÿšÿåÿ2M^•¡ÕöðµO+3&fƒ-çÿöÿ#"Öÿ‰ÿvÿ“ÿhÿ+ÿ]ÿÃÿøÿ-HXE ÅÿaÿÙþ½þÿaÿ$ÿwþ3þwþþþrÿÓÿVa,åÿ½ÿâÿ5x_µÿÇþ=þ.þžþÿŸÿÚÿöÿöÿÝÿÛÿÿÿyª®w©ÿ«ÿýÿ¹ÿ’ÿ§ÿ¡ÿÿzÿyÿ?ÿþþëþ'ÿSÿbÿ•ÿÂÿÉÿ¸ÿšÿÀÿËÿiÿÿÿþþâþàþþþŸýYý®ý\þÑþÿxÿËÿÃÿµÿ³ÿ«ÿsÿNÿGÿÿÑþ}þvþ‡þ|þ†þ•þ†þ…þÓþÿ#ÿ[ÿyÿnÿ0ÿßþ­þþeþ‰þØþÿ"ÿ8ÿ8ÿÿ­þ,þ þ þþþ5þWþoþ¨þÿkÿ§ÿ¡ÿ‚ÿ]ÿÿ¤þuþ‹þEþõý×ýõý1þŠþQÿ¬ÿ­ÿ›ÿkÿ(ÿóþêþÿ)ÿõþ•þþ þßþ-ÿgÿºÿ©ÿÿÖþÎþéþÍþšþ˜þ€þQþNþeþzþ§þÿOÿfÿ`ÿOÿhÿ7ÿ ÿÜþÁþ®þRþ!þþìý,þ¦þíþÿùþ©þ`þ†þŸþsþ^þ\þvþ²þ7ÿiÿJÿ)ÿ)ÿ[ÿ‰ÿ˜ÿÕÿÕÿ}ÿÿ¶þ¬þîþ5ÿ2ÿÿèþÍþ ÿZÿ«ÿõÿ ¿ÿyÿcÿ7ÿ?ÿ;ÿBÿaÿˆÿ›ÿžÿÔÿíÿÎÿéÿÛÿ’ÿÿîþ9ÿÿŽÿlÿCÿÿÕþéþOÿ™ÿòÿ ¨ÿNÿKÿ\ÿzÿ‰ÿnÿ=ÿ ÿáþæþÿþ(ÿOÿ4ÿÿÚþ´þ‡þ€þÙþÿðþÊþôþmÿ-·Hþ9çÿŸÿˆÿ ÿÅÿÉÿ®ÿ_ÿÿCÿ…ÿöÿc˜™tŠÆ i}_7Ö¢Ââ‘Úÿ*ÿ“þ]þ¬þRÿ£ÜÔ®±Óø í†åÿiÿEÿ}ÿàÿèÿfÿÿ*ÿEÿqÿhÿÿ¾þËþ ÿPÿ¨ÿêÿRh™¸œ²¾Ëᚃo98ggB"(|ÇÏ´Œ¥ÅÇÅÎãäÄÉäã÷û"Q#À”‚`0%A2U™œ”¡Ï`ÑØ†*Ü5 ÈÿsÿUÿYÿ>ÿ5ÿ*ÿFÿºÿ/—ñèö„úIÄž©Ûø¹Š—©³ùn¸¶{33:>]`_^jË:ky~:øöîH#áä?ÅËÆ–†š‹qK?<H åÔŽ òÿ9¨ëì¸xJI’Û/;*:>6>L¶QNuµÇµŒ£¤¯ýHd^cÃZË÷¹O×U$7XY*íº´æ?šåó±–°¾“S$°2Ïÿ’ÿŸÿÉÿ-íÿ™ÿ•ÿ­ÿÂÿïÿðÿ«ÿYÿ ÿ ÿ\ÿ™ÿßÿ*8 Il®¶¡~E&$ èÿÁÿèÿ3Š©Ö6z™rXJA;´‰{­îþÈß?4÷¡ZGñÿ­ÿ³ÿ×ÿÛÿŸÿeÿ{ÿìÿV~‰Væÿ¥ÿSÿÿÿ-ÿRÿbÿmÿ¤ÿàÿúÿáÿ°ÿ"ÿµþÓþ!ÿˆÿïÿV’†%±ÿ‚ÿ_ÿNÿhÿ<ÿÜþ£þÄþ%ÿ ÿlªº£‰˜Ä Ìo!(PEH_f0(€Ÿo6Üÿ£ÿ’ÿ–ÿÑÿçÿÄÿäÿ8_[UMìÿ€ÿAÿ1ÿ-ÿ'ÿ0ÿ(ÿ'ÿôþžþþ¨þõþ<ÿ˜ÿæÿÍÿšÿgÿvÿxÿ¦ÿËÿáÿ¯ÿtÿ?ÿ?ÿuÿÊÿñÿÆÿvÿ2ÿñþóþÿÿÿÿúþ:ÿtÿ²ÿòÿãÿ—ÿrÿiÿOÿQÿTÿiÿzÿ“ÿ¢ÿ–ÿpÿaÿbÿ;ÿÿÑþÈþ´þ–þ`þnþáþ[ÿ˜ÿÄÿÂÿ„ÿdÿdÿrÿ‘ÿÉÿ»ÿšÿUÿ ÿçþúþ<ÿkÿfÿ_ÿPÿÿÞþÔþëþÿôþ”þ8þþ"þ9þ`þ|þyþ.þëýíý!þ”þÓþúþØþþcþ’þ¯þ¼þÃþ]þÅýyýSý[ý²ýçýþ[þKþ2þpþÀþÿ-ÿ/ÿ,ÿCÿYÿaÿ„ÿŒÿ ÿ¸ÿ¼ÿpÿëþªþ{þŽþ¾þáþïþ0ÿ¡ÿ¿ÿÃÿ³ÿ¸ÿ´ÿÿ±ÿøÿ!·ÿ‚ÿ[ÿÿâþ°þtþ2þNþwþþ þmþ?þOþyþtþwþ’þªþ“þeþVþþ°þÆþÿ+ÿÿÏþþ|þ‚þ¨þ±þtþTþ'þþHþþÿ@ÿÿþÒþÑþ»þóþEÿ¦ÿËÿŽÇÖ×ü®x¥ÿ-ÿªþNþþ2þˆþçþLÿ“ÿ´ÿëÿeÈÿºxH6¤ÿjÿWÿRÿRÿsÿLÿâþ“þˆþÎþðþÃþ±þ¦þÂþ%ÿ¿ÿ4I#Ãÿÿ›ÿµÿÏÿéÿâÿgÿèþÿþÿÐþlþþ·ýÁýþƒþÿPÿ˜ÿw¶ I Èœw‚µõêÇeòÿ|ÿfÿšÿöÿ8%=osŒÍYH#üÈfV»ìm—ÿVÿBÿLÿEÿ[ÿmÿtÿŸÿÍÿ÷ÿ*h^# @nlS áÿLÿŠþ1þZþ¤þÉþÿaÿºÿéÿ3[›ç0wƒ_(LN¤±ÿmÿ“ÿ€‡„‹‚°V™¢‹‰O2fRÿ®/´ÿ]ÿjÿµÿüÿr®Áú#F=S(Ô‰lx¬¿Õ®Žœ½ÛЖN@bqŠŽ•˜µïÖ¡šŸÐT–½ª{izg Å­Á¶®×öLˆÐ÷òö뽎‹Ã±yeQW‰»Ì£Y÷ȹ¸ò5’ŠtGAu‚½Î¼_ Ù•Š™ÁÇ”ž³}ÀçÑy9;"LrKÐ~agI# òÿãÿq¢>³ÐºkOQS8Ȫ¸ÜñT]’é0úmÃkböÿÅÿ²ÿÌÿHâ`›“XÓ¾¶Ðâ檦˲š×çªt,ñÿúÿ :*áÿ–ÿqÿËÿI€{ ´ÿ«ÿñÿd×ÅoòÿF\P2-4O,6|²À¹ðÙˆWQJ< óÿáÿ+o¾݉…©™rBÿÿ)µÄϨZùÿ¶ÿÿ[ÿ#ÿ«þ.þãýÿý(þ‡þÝþéþÿÿÿ0ÿxÿÎÿRNòÿ¦ÿ©ÿ«ÿÃÿ·ÿÍÿèÿ4fPìÿÿqÿŸÿÛÿäÿùÿýÿ@›àìÝŒU}—{#Ãÿ«ÿÜÿøÿ¾ÿÿsÿbÿuÿÿºÿÉÿõÿ ˜ÿ ÿÿ"ÿ>ÿSÿ$ÿÆþ­þµþÚþ»þþnþRþYþ±þ#ÿQÿVÿfÿ•ÿˆÿwÿ‰ÿÓÿ "ñÿ½ÿÀÿÌÿâÿäÿ¨ÿPÿøþÚþìþôþÿ[ÿ×ÿ'3½ÿrÿ.ÿÿDÿqÿiÿ1ÿÆþþ˜þÿxÿ¹ÿòÿ¯ÿUÿ+ÿ?ÿ#ÿÁþ‰þtþŒþãþSÿÿ¦ÿÿˆÿÿOÿçþpþ þ¼ýýý„ýhý%ý/ý“ýþþ ÿeÿ‚ÿÿpþ þîýãý,þHþ%þÜýÄýþÌþcÿ–ÿ¸ÿÿJÿ%ÿÿáþ©þ~þjþaþNþPþXþpþ˜þÿ…ÿÅÿÛÿ¯ÿZÿ-ÿ-ÿÿîþýþçþÑþ¾þ×þýþÿ8ÿsÿ2ÿèþãþÍþBþ0þ¼þÿÿÿÿæþªþjþfþRþ þ®ývý>ý:ýJýˆýÊýþ]þƒþÈþÿ2ÿ0ÿ2ÿEÿcÿŒÿ‚ÿYÿÿÙþÿMÿiÿ}ÿ’ÿˆÿVÿHÿ\ÿiÿVÿcÿ_ÿPÿÿÑþëþ#ÿTÿÿµÿÖÿ)mDÒÿ†ÿ^ÿ<ÿÉþeþUþ“þÎþçþ'ÿ§ÿÑÿÚÿôÿ 'âÿ¦ÿ—ÿNÿôþ¬þ_þSþŒþ‹þþØþîþøþöþOÿ}ÿºÿÚÿôÿÚÿŸÿÿ³ÿ PÑÿËÿîÿÀÿpÿcÿ„ÿ‘ÿÎÿëÿžÿ‰ÿÔÿ>‹–_÷ÿÄÿ¼ÿþÿ7#»ÿšÿäÿI˜Ú¼3Éÿ£ÿÍÿÕÿ£ÿvÿ¬ÿÌÿÔÿöÿ,kƒ­óÌV×ÿmÿQÿ#ÿÃþ±þ¿þøþ~ÿÓÿ I£ëñ_&õ³VËÿÍÿñÿïÿÝÿ A`ShP÷ÿÜÿOo€=ýÿñÿ;9>. Z™0öÿ½ÿñÿpšqAILçÿóÿ5X{j‚‹uUA 1MhŽ£§Îq°¢lbD9g>ÒcËÿ‡ÿÀÿ [y~en~yt¤¹ÏÓ§¨áØÞ4Wþ±ÄñöÈÉéñ¿…œ_€‹†x\]¨d],ËiE‹ëéæýô1¢3ëÏÍØÁjVNàä 2R‰zÚþ/øYjbXÄ­«”a@D÷ÿ]Å0€uY@1'ô{Aü”Ü8 ıÆß×׺4½¬í>‚’©Ê¨Ðûè©UæeGØøæË¾¯•¤½Ü±Bàÿ¡ÿ¼ÿ|¥†;ÿÿðÿóÿ5ëÿ¸ÿcÿ„ÿ!­Öµ„“¼ýB>@麑žè. VO;í²¥ÑĮϾ˜Œ‡ª«†QS_L+ $ñÿæÿÐÿ½ÿ‚×ç×—>ãÿ¡ÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿgnustep-gui-0.24.0/Sounds/Glass.wav0000664000076500007650000026005411235134022017005 0ustar brains99brains99RIFF$`WAVEfmt D¬ˆXdata`zgF54HAîÿÇÿÒÿMNôÿßÿÅÿáÿ)ViGñÿObP;&FcD2'NH@#þÿòÿúÿ ùÿüÿ+-+.3ÀÿËÿúÿ>$ MJB7 øÿüÿ4 ÛÿØÿêÿýÿ*&#$*F^)èÿÑÿÅÿÛÿ ùÿ >"OM;" 5Y<0ßÿ»ÿåÿ(M"åÿµÿËÿÜÿH*àÿÍÿÀÿÜÿéÿ ÙÿÒÿúÿ%ChP/!ïÿÒÿÊÿÖÿîÿ!¶ÿ¬ÿÄÿîÿøÿ*::)öÿ×ÿÃÿÞÿøÿ!ýÿÚÿâÿüÿûÿ  úÿ÷ÿæÿîÿ ýÿêÿíÿõÿ#+ùÿòÿúÿîÿÌÿ¼ÿóÿ* üÿáÿ=úÿåÿëÿÈÿÓÿöÿ6@2Ýÿëÿøÿüÿ ïÿöÿûÿãÿïÿòÿçÿÖÿíÿ#ýÿôÿØÿýÿüÿøÿøÿîÿàÿÕÿøÿéÿæÿ),½ÿÁÿÎÿÈÿ²ÿ¥ÿ¯ÿßÿúÿÝÿÈÿçÿ"øÿ÷ÿÉÿ¬ÿÿ½ÿ­ÿÆÿàÿ äÿäÿ FXÞÿ`ÿIÿ—ÿªÿ´ÿÄÿíÿñÿåÿ×ÿéÿ& ûÿïÿâÿ½ÿëÿýÿüÿÛÿÒÿÈÿÙÿ ,*-þÿïÿÔÿÂÿÉÿóÿÊÿÌÿØÿÔÿôÿëÿÈÿÌÿÄÿÙÿÏÿÀÿñÿåÿæÿñÿ åÿÕÿÝÿÐÿ¸ÿÜÿ Ðÿ®ÿÆÿÜÿåÿÛÿäÿèÿ íÿ³ÿ™ÿ}ÿvÿ¸ÿ;9þÿÃÿÿrÿ®ÿÄÿ¥ÿ’ÿŠÿ¢ÿ¬ÿ¼ÿìÿßÿ¿ÿ·ÿÅÿD1åÿ¯ÿµÿœÿ¦ÿÁÿöÿöÿçÿùÿèÿýÿ øÿØÿÑÿòÿüÿÁÿ²ÿ¾ÿ±ÿ·ÿÐÿÆÿ·ÿ¸ÿËÿçÿ÷ÿ%-"òÿÇÿÊÿßÿÜÿãÿÜÿïÿ'Öÿ»ÿ¾ÿÈÿ#%'1ÞÿÇÿèÿþÿ)22Ãÿ«ÿ¢ÿÖÿ,Òÿ°ÿÁÿÛÿâÿ»ÿ®ÿ­ÿÔÿ3)/GJW&ðÿîÿÔÿØÿúÿûÿéÿÏÿ¶ÿ¢ÿ ÿ‹ÿÃÿ÷ÿ ùÿëÿëÿßÿâÿèÿþÿþÿèÿÞÿéÿýÿ*A;3ûÿ#,çÿâÿÅÿåÿõÿ%Øÿßÿ*4@0DE#$öÿûÿ#äÿÜÿýÿ! âÿãÿõÿ0ÜÿÉÿ¸ÿÊÿõÿ2< "FB#îÿËÿíÿ7e:îÿóÿûÿéÿÃÿÓÿÃÿ¥ÿ«ÿÀÿÓÿ-fR*ïÿÇÿÓÿ-êÿÆÿ±ÿÿÇÿD^S9-ðÿáÿëÿöÿàÿßÿëÿöÿýÿ÷ÿúÿ+6îÿÔÿÙÿèÿôÿØÿþÿùÿ ûÿûÿ÷ÿüÿ <74.0= þÿâÿæÿåÿòÿÿÿýÿöÿ2D4=XX$=:îÿôÿöÿïÿ .(*D="/0 ùÿøÿ- 3eb?!åÿÞÿèÿìÿøÿïÿïÿ ' *="Ahˆ¥€9 ÞÿÅÿÖÿ ÿÿöÿ0fbhJUNbD*3'óÿòÿ*- 2+ïÿÜÿùÿ?C "FCøÿíÿ!eŠPVi_ñÿÆÿéÿ#MbQùÿ«ÿ¢ÿëÿ#UjZ3'&üÿùÿËÿ¦ÿÅÿìÿ KS-Íÿ°ÿÞÿ>hIïÿÆÿžÿÃÿêÿþÿÓÿÂÿÙÿ8ýÿÁÿ£ÿºÿôÿ÷ÿ,ðÿM‘$àÿÑÿ®ÿàÿ - Ûÿ°ÿ ÿÏÿâÿ#, úÿçÿÉÿ¼ÿÔÿôÿÿÿâÿÏÿÀÿâÿ"X^UK÷ÿ§ÿÿ—ÿÛÿùÿìÿ?[awMÙÿÐÿîÿFßÿ¤ÿÁÿÔÿ FK,åÿäÿÑÿÚÿÍÿ¹ÿ³ÿ¹ÿ·ÿáÿþÿ åÿ7+üÿûÿ÷ÿ²ÿÊÿ 0<@ôÿšÿ†ÿ¦ÿèÿüÿ% èÿ¼ÿ¢ÿ˜ÿÅÿèÿâÿÜÿ àÿ¿ÿÃÿµÿŠÿ¢ÿ¿ÿ¹ÿ¬ÿ³ÿÉÿÒÿÝÿÇÿÐÿöÿ÷ÿÁÿÿ˜ÿ¥ÿÛÿßÿËÿ¼ÿÊÿÒÿÚÿÞÿ÷ÿÞÿÍÿøÿñÿàÿáÿåÿàÿÁÿÅÿÈÿØÿÙÿ¾ÿÍÿÒÿ±ÿ³ÿÑÿõÿ7RD Ùÿµÿªÿ©ÿ•ÿ}ÿƒÿ²ÿ³ÿÍÿûÿ úÿÈÿ·ÿåÿ¹ÿrÿ`ÿiÿžÿ¸ÿÜÿúÿÛÿ¿ÿØÿåÿðÿâÿìÿÛÿÛÿÄÿlÿfÿzÿÿ¹ÿÔÿØÿ¸ÿÿ­ÿâÿ 'åÿ™ÿ~ÿ‘ÿ¹ÿüÿùÿëÿ¼ÿâÿÖÿÞÿÆÿÅÿÖÿ™ÿ•ÿ‚ÿŽÿ ÿºÿàÿÿÿÿÿËÿÎÿÞÿùÿìÿíÿÛÿÂÿºÿÌÿÈÿ·ÿ­ÿ·ÿÍÿåÿÃÿ£ÿnÿrÿŽÿ­ÿÀÿéÿóÿÖÿÍÿÛÿßÿ×ÿûÿ Üÿ¸ÿºÿáÿþÿ?X<úÿÆÿ¬ÿŽÿ™ÿçÿúÿøÿÓÿÃÿÇÿÎÿèÿ,3ÊÿÓÿ¸ÿ®ÿ½ÿáÿòÿûÿ÷ÿäÿèÿõÿäÿÄÿ·ÿßÿ?ïÿÂÿ®ÿ¶ÿÞÿüÿ"5$ûÿÚÿõÿ?bNþÿÆÿ¾ÿ¼ÿÚÿûÿ Øÿµÿ®ÿ×ÿàÿÞÿ /^;.  0<7&-úÿÒÿüÿ!XgN(ðÿÃÿÝÿ6y…nVüÿëÿ 055ÿÿùÿ %i`8=4W`Oñÿúÿ8UkƒO1ôÿh„’LÕÿñÿ'h¦«M õÿ òÿ"<õÿIsj\gr|s€Œd9SY &Z`RiW.2#%ÎÿÐÿ/ ">U^Zc ’ˆQ>9&ìÿ×ÿFG:0(19L_F"60þÿõÿöÿPx{I 6Ze`6þÿ;pe=&üÿîÿÒÿôÿ*Bi®´›ŠnX[Q>=µÿâÿ&5:æÿ K~v/ õÿðÿ$5.2=ãÿýÿ*;,$7T5(Ûÿ×ÿØÿÚÿéÿ(N2//6õÿÅÿ¶ÿäÿ# Ýÿ»ÿÖÿõÿ#7M=$îÿìÿôÿþÿFKûÿôÿ8_;B<'  êÿ·ÿÆÿÿÿ )7"% ðÿÈÿÔÿK24'þÿ$7)8F(* ÷ÿçÿºÿ³ÿÐÿéÿÝÿÎÿØÿ&!ÐÿÁÿèÿ:M<6ÕÿÙÿûÿùÿ-81ÏÿÛÿ"" üÿõÿÓÿ¼ÿ«ÿÇÿ:N,1îÿËÿœÿ¸ÿÕÿîÿJ147,+4"*üÿøÿáÿùÿýÿ  àÿÊÿÂÿÓÿöÿèÿÉÿ¹ÿ³ÿ×ÿëÿáÿñÿ ðÿ÷ÿ0óÿóÿÓÿ®ÿÌÿËÿÏÿøÿóÿ '59%'7^VÈÿÏÿáÿÉÿÇÿæÿ Üÿñÿ øÿãÿßÿÑÿ¡ÿ®ÿÔÿóÿÆÿÁÿ»ÿ¹ÿ»ÿûÿY‰|PU, õÿðÿëÿÍÿ³ÿ¤ÿŸÿ§ÿ’ÿ‡ÿÀÿþÿ5$óÿßÿßÿÊÿÄÿ»ÿÞÿ÷ÿàÿ±ÿ®ÿäÿ$& øÿÛÿÖÿÜÿøÿýÿåÿéÿÛÿÅÿãÿöÿòÿžÿ¬ÿÍÿÛÿ¾ÿ†ÿ™ÿ¬ÿ§ÿÃÿÝÿâÿ×ÿÀÿËÿáÿðÿçÿåÿÿÿ&ÿÿùÿêÿÜÿÃÿÝÿÖÿÌÿ Ëÿ¢ÿšÿ‹ÿ­ÿÃÿÊÿÞÿïÿ1"0åÿæÿ¼ÿ±ÿÐÿÕÿÏÿÔÿàÿÅÿ÷ÿ éÿÐÿ¹ÿÕÿÕÿáÿÜÿÃÿ£ÿ›ÿžÿºÿÙÿùÿõÿÔÿîÿÿÿ3"þÿûÿûÿéÿ×ÿúÿðÿõÿìÿÁÿÓÿÚÿòÿòÿïÿÞÿÊÿ–ÿ«ÿÏÿïÿÜÿËÿóÿôÿ#DüÿíÿôÿûÿûÿÓÿ½ÿÅÿ°ÿ¼ÿôÿþÿëÿ¯ÿ»ÿ://ÙÿÕÿàÿÅÿÇÿýÿ2òÿðÿÎÿŽÿ•ÿþÿM<úÿñÿãÿàÿÉÿéÿ$?M9ñÿØÿÝÿÏÿ5"þÿÒÿºÿ¿ÿ\dMäÿ¿ÿ®ÿÑÿXjd;ûÿØÿâÿE4" þÿÏÿ¿ÿÐÿóÿ"X|MûÿÚÿóÿ+4Ec_^ËÿŸÿÑÿVw[*ÿÿÑÿ×ÿ!0SB-5\\9TnD#üÿp7ÿÿïÿûÿ)P-ÖÿÛÿ"Akt7; $@M-ðÿíÿ9HJ5ïÿÒÿÏÿåÿeŒU&Wv–£döÿÃÿºÿÛÿ*m}Tâÿýÿôÿ÷ÿ2‡ŽBõÿÕÿÑÿâÿ2AYB COY<6,ïÿþÿDC <>5-ýÿêÿýÿòÿ )7 *D[O4&'JTcU$ðÿÏÿ³ÿÐÿ=a?æÿI;;4? ' üÿÒÿçÿ G‰Ÿ[' øÿ%C_; êÿ¿ÿ¼ÿ+@Côÿâÿ+(29/ìÿùÿ åÿÕÿÐÿÒÿãÿ÷ÿ&/&óÿéÿàÿ 2RHBÁÿÀÿÌÿµÿ¯ÿ2ÿÿ$ PaB9ÙÿÏÿÌÿçÿéÿùÿøÿ óÿ=1K0 7!ñÿÞÿçÿ éÿÎÿÜÿH“}IN7 ôÿ 0òÿåÿïÿÁÿÐÿ)ûÿ Öÿ¸ÿ¡ÿÄÿÓÿòÿ)8þÿùÿôÿçÿïÿ (ùÿýÿ$ôÿíÿÛÿèÿýÿøÿÚÿíÿ :/ëÿÜÿÝÿ÷ÿ êÿÒÿPF?«ÿÿsÿ¦ÿÞÿ"æÿ¹ÿ·ÿÅÿøÿ÷ÿÌÿ²ÿ»ÿÞÿÂÿÄÿýÿþÿèÿÛÿÐÿÌÿ&%úÿãÿÛÿF'ñÿÎÿåÿÿÿ%>!ñÿåÿïÿÿÿ#;ãÿ´ÿËÿÕÿÂÿ»ÿÂÿ§ÿÎÿãÿÙÿßÿæÿ !@ öÿÀÿ¾ÿåÿèÿöÿ <"üÿ(öÿ’ÿÿŠÿ²ÿÉÿùÿ@TB$úÿ#àÿ¥ÿ ÿ ÿ±ÿÝÿ .&ÖÿãÿåÿáÿýÿêÿØÿíÿùÿêÿúÿñÿãÿÕÿÛÿ½ÿ¡ÿÆÿýÿÿÿ÷ÿ "úÿõÿúÿ1,÷ÿ <íÿ+#éÿþÿ/íÿ¸ÿ²ÿÿŽÿÀÿüÿ\eÎÿìÿ Ðÿ³ÿ¯ÿ†ÿ™ÿþÿ)áÿµÿ­ÿÈÿòÿùÿèÿÙÿ¿ÿ¾ÿÊÿÝÿôÿëÿôÿîÿâÿöÿñÿºÿÿÅÿÕÿÛÿèÿ 9ëÿÎÿìÿûÿ Ïÿÿ¡ÿÕÿäÿÕÿáÿöÿõÿ÷ÿÛÿÃÿ±ÿÂÿµÿ¿ÿÜÿØÿÈÿßÿãÿ·ÿºÿñÿ<Y,èÿÁÿÏÿÌÿ .ÿÿÜÿÐÿÛÿ÷ÿýÿèÿÌÿÃÿ¶ÿÇÿÒÿÁÿãÿ !)Ðÿ«ÿ×ÿùÿëÿÓÿðÿùÿùÿøÿ3<=!¼ÿÖÿáÿ¦ÿ½ÿÓÿ´ÿbÿrÿÀÿêÿÂÿ8ðÿýÿ-6÷ÿêÿõÿ9c_ ½ÿÎÿïÿçÿ0QÔÿÃÿ£ÿ¯ÿÂÿÈÿ "3Gg=5ãÿÊÿßÿÑÿÊÿóÿÝÿ94FR-ÙÿáÿîÿíÿBF6 ÜÿÇÿÓÿäÿ4T>'\4&:þÿ1$!0'$ ('þÿ$OX øÿýÿ;70,IhƒzhPL5,h_]M ôÿïÿ#=8ER819L›ƒa/I0&;* cOj>õÿýÿ(H;,d‘bDJ?:ADC#"2beJf€nal?;E2!:FSPA%N¦ž_=K14@) áÿöÿEE6&GY~{S3/)óÿÿÿI73 %/A8MTP úÿõÿüÿúÿüÿÞÿ?éÿ*'.?:çÿøÿöÿíÿ24ìÿÿÿF<çÿøÿéÿýÿ!JRM+$$ üÿáÿ>™¶g=1øÿéÿ¹ÿ©ÿ¬ÿÁÿ´ÿ¼ÿÔÿóÿ÷ÿ÷ÿ 3@d[Ëÿ¸ÿÅÿðÿ7]9 +P]kpTýÿÅÿâÿõÿÚÿåÿ:VA áÿîÿE3ñÿåÿáÿèÿÛÿ×ÿîÿ8Z,ýÿ ëÿÉÿ°ÿÙÿ0P0+) ÇÿšÿÚÿíÿ¨ÿŒÿžÿ®ÿÕÿúÿýÿÝÿÑÿÚÿûÿíÿÝÿÊÿçÿòÿ÷ÿ ìÿ¼ÿÌÿêÿùÿôÿìÿûÿüÿóÿìÿõÿÂÿ°ÿ°ÿ·ÿµÿ¶ÿòÿùÿöÿÌÿÅÿÈÿÅÿãÿùÿØÿÌÿçÿ ÷ÿÜÿêÿ!ûÿÀÿ°ÿÉÿÄÿÝÿáÿäÿÍÿïÿ ðÿæÿàÿëÿÓÿÃÿéÿöÿÐÿÉÿÒÿØÿÅÿÀÿâÿÇÿµÿØÿÏÿÉÿ¾ÿÀÿÎÿÎÿÒÿªÿÓÿÎÿËÿÀÿáÿ<:Úÿ¿ÿ©ÿÿµÿÚÿÛÿØÿçÿàÿ±ÿ«ÿÓÿíÿÓÿÆÿ×ÿßÿÏÿÈÿãÿëÿäÿÌÿãÿîÿÓÿµÿËÿôÿõÿÈÿ¼ÿÓÿýÿäÿ¦ÿ¾ÿêÿáÿÑÿñÿæÿØÿÅÿÓÿÁÿ¦ÿ ÿ´ÿµÿ³ÿÀÿÄÿáÿõÿþÿÕÿ´ÿÕÿÒÿêÿßÿºÿ­ÿªÿ½ÿ­ÿËÿÞÿ óÿõÿàÿåÿæÿ¼ÿnÿ„ÿ…ÿ®ÿ-10Øÿ¹ÿ®ÿÂÿÝÿþÿüÿÄÿiÿoÿ¶ÿ¶ÿºÿõÿìÿïÿíÿ·ÿÉÿËÿ¹ÿòÿÔÿ¤ÿ|ÿÿxÿ¥ÿ1)òÿµÿ°ÿÊÿæÿ.ÛÿÖÿÏÿÍÿ×ÿÌÿÁÿÊÿÕÿ«ÿÿ¯ÿçÿ÷ÿ!*% êÿÛÿßÿõÿ¾ÿÍÿÌÿ¼ÿ—ÿ˜ÿšÿÆÿùÿ×ÿ¦ÿ€ÿÿ~ÿÿ·ÿÓÿ.$÷ÿÒÿÎÿÅÿÖÿþÿ 3*úÿÊÿÿRÿlÿ§ÿäÿöÿÓÿ¾ÿ¤ÿÿjÿ‡ÿšÿÙÿðÿñÿÒÿ¦ÿ›ÿ³ÿÎÿïÿûÿåÿ¹ÿÀÿ¸ÿÄÿæÿIeíÿæÿÍÿ®ÿÏÿêÿÆÿ‘ÿ¦ÿ·ÿÌÿåÿêÿÞÿÏÿåÿþÿ Þÿ  àÿØÿ¸ÿ¶ÿÆÿúÿ346Èÿ†ÿˆÿÁÿÎÿÛÿAÉÿ¨ÿ«ÿÍÿëÿøÿÝÿÀÿ©ÿ¡ÿ¿ÿëÿàÿÌÿQT8NB6&&÷ÿíÿøÿÍÿÒÿ­ÿ£ÿ«ÿ¼ÿÀÿäÿõÿåÿÓÿæÿëÿæÿ 7P@0 âÿÛÿìÿðÿíÿüÿ¶ÿ¥ÿ·ÿÇÿüÿ.X`2ÏÿÄÿØÿëÿîÿÕÿÞÿüÿüÿ¹ÿùÿAR75)ÖÿÃÿâÿÃÿ»ÿßÿ 82Elb:@rjf](ÿÿßÿÙÿåÿáÿ$<7FnPQC!ýÿúÿïÿÕÿëÿÓÿÀÿØÿÕÿñÿ#</ øÿ?d'ñÿùÿíÿ'/,.!*#þÿ ëÿëÿáÿÖÿïÿ õÿßÿ±ÿ«ÿ¸ÿåÿ4NHûÿùÿ I`% .>?ùÿÞÿàÿùÿSZ@- >("'øÿÄÿîÿ)H?.øÿâÿâÿÁÿ¿ÿÎÿëÿãÿèÿ$( 0p4&$" 0xAêÿÕÿÒÿÔÿÝÿ;1âÿòÿ !((Þÿ®ÿÑÿ &*æÿáÿÄÿúÿ æÿ¬ÿ¥ÿ®ÿªÿöÿW; ãÿ¢ÿ¸ÿïÿÿÿïÿúÿùÿëÿÖÿ§ÿ²ÿCT,42)úÿ ßÿ©ÿ–ÿ‚ÿšÿÞÿïÿïÿìÿÜÿ°ÿ’ÿËÿ ,=¼ÿ¹ÿéÿ;B1ýÿþÿûÿßÿÈÿ¿ÿÕÿÍÿ½ÿµÿ¹ÿÇÿÛÿäÿÈÿ¬ÿ£ÿ°ÿÒÿßÿìÿ ÛÿŸÿÑÿC+ìÿÝÿÉÿÅÿ¿ÿ³ÿÐÿçÿøÿáÿ÷ÿ8!72ëÿ¼ÿ¯ÿœÿšÿ»ÿ™ÿ€ÿ‚ÿÿÁÿÓÿãÿõÿÜÿ¯ÿÙÿúÿæÿÃÿïÿèÿåÿáÿðÿÿÿïÿÄÿËÿÍÿÙÿ³ÿ¾ÿçÿ òÿäÿïÿêÿðÿÖÿÃÿÐÿÂÿ¸ÿ®ÿšÿ—ÿ°ÿÉÿÁÿØÿñÿ,èÿåÿîÿ¿ÿ“ÿ¢ÿÅÿØÿÍÿµÿÇÿÂÿŸÿÃÿ½ÿ¼ÿÉÿ´ÿ¤ÿ¿ÿòÿöÿ©ÿ‡ÿ»ÿÞÿ!ãÿ¡ÿÿŽÿ·ÿøÿ +åÿÜÿóÿûÿàÿÙÿåÿËÿºÿÂÿâÿËÿ¡ÿ…ÿ]ÿyÿ£ÿãÿ Hc;ëÿÀÿàÿîÿÖÿ½ÿœÿ¬ÿæÿ%äÿ´ÿ‘ÿœÿ©ÿ³ÿüÿ+åÿµÿÿŽÿ§ÿÒÿøÿÒÿÏÿéÿâÿÕÿÍÿßÿÒÿýÿüÿþÿ ×ÿ•ÿŒÿ³ÿ¬ÿ±ÿÇÿÄÿáÿñÿßÿâÿ—ÿŠÿ¼ÿ $üÿÎÿÂÿ¼ÿÈÿóÿÓÿ©ÿ´ÿÃÿÓÿÝÿæÿ " ÔÿÊÿòÿèÿ³ÿÖÿæÿäÿÌÿÖÿýÿþÿ=-àÿÃÿ¥ÿ†ÿÿªÿÍÿÊÿèÿòÿçÿÞÿìÿÚÿØÿ:^:éÿ¾ÿªÿŸÿÉÿ Éÿ³ÿ®ÿÍÿÐÿíÿ÷ÿÒÿÇÿéÿôÿ "üÿÜÿ£ÿ`ÿtÿ±ÿïÿ2÷ÿŸÿ_ÿ\ÿŸÿõÿPxk¸ÿ«ÿÓÿûÿôÿæÿäÿÔÿÊÿïÿ* úÿÎÿ6îÿÄÿ’ÿžÿÄÿ¿ÿØÿâÿÓÿìÿìÿîÿýÿ&Ýÿ«ÿµÿ¿ÿÍÿñÿÿÿÿÿäÿÚÿÜÿúÿ-ImLìÿöÿãÿãÿÚÿÊÿÓÿÀÿ ÿ«ÿÛÿ"óÿÖÿÝÿßÿÙÿéÿÒÿêÿíÿ×ÿÝÿßÿÛÿöÿ CHùÿÿÿëÿáÿæÿúÿÞÿÕÿßÿéÿïÿôÿöÿÛÿÄÿÅÿ£ÿ§ÿâÿ!Òÿ÷ÿ$Ûÿ ÿ¬ÿ¶ÿÅÿéÿîÿIs8<D.ýÿ (OlfYüÿ—ÿŠÿÏÿôÿ&]vZ2åÿóÿòÿâÿúÿîÿúÿ.øÿ¸ÿíÿ8?84"Ëÿ§ÿãÿ--ùÿxm`/ÐÿÀÿÓÿÓÿz¥B-S\+íÿßÿ:hUY1*æÿòÿâÿúÿ+7 ÓÿÐÿÊÿ×ÿ(KOKh[9 %%>X=,ìÿ(:/ þÿ IO-åÿÕÿåÿÖÿíÿßÿöÿ 9Õÿ»ÿìÿ6C:B1ßÿ¸ÿÆÿÛÿÜÿñÿíÿÑÿÄÿÝÿäÿöÿûÿæÿõÿ$2%'?;3JF(2?' ûÿìÿýÿùÿóÿ>'ðÿìÿ ãÿÇÿçÿõÿÐÿÊÿÓÿüÿÂÿÂÿáÿØÿÙÿÍÿÆÿÔÿ±ÿ¾ÿ!5 "J# ÿÿÁÿŠÿ±ÿ·ÿÔÿúÿ èÿðÿëÿ % ãÿÊÿÑÿÅÿÊÿèÿõÿðÿòÿ$f_5;¬ÿ†ÿÈÿüÿÕÿÚÿìÿèÿæÿâÿìÿÖÿæÿ )3ûÿÞÿ·ÿ®ÿÝÿÒÿñÿ×ÿGM4êÿÈÿµÿéÿ÷ÿ÷ÿ  ÅÿÎÿâÿèÿÊÿéÿáÿÕÿ ? øÿºÿ«ÿ»ÿîÿ HÜÿÜÿîÿ(GP'1N«ÿ~ÿ¶ÿ½ÿËÿ -1H(ïÿÍÿ¹ÿÈÿñÿèÿóÿÙÿ¶ÿÍÿ{iGòÿèÿäÿ½ÿŸÿ¡ÿ˜ÿ£ÿ™ÿÁÿÛÿËÿéÿÿÿëÿ'A@ öÿÅÿŒÿÿÄÿÁÿÞÿåÿàÿðÿéÿàÿþÿ Ûÿ°ÿ ÿ©ÿ³ÿÛÿöÿ÷ÿüÿïÿòÿÆÿÝÿæÿñÿ&þÿÖÿÍÿïÿÊÿúÿ"ëÿ A@ãÿ˜ÿ˜ÿÏÿûÿ÷ÿüÿ (/2ÓÿáÿþÿÝÿÍÿäÿÖÿÐÿñÿ åÿ¸ÿäÿìÿôÿ$ÿÿÝÿÉÿ¹ÿŸÿÈÿÖÿ×ÿóÿ %õÿßÿíÿèÿþÿåÿÏÿòÿèÿÎÿåÿ òÿºÿúÿ8íÿÏÿ”ÿµÿÑÿÓÿàÿýÿÍÿºÿÌÿÞÿéÿ ýÿLiSþÿ×ÿ½ÿ¡ÿ–ÿÏÿÿÿßÿÏÿ¸ÿµÿl\H2 ñÿ¿ÿ¡ÿ¯ÿÛÿÞÿØÿëÿêÿÐÿÝÿ×ÿ,RjuWëÿàÿ×ÿÍÿÆÿ 5$ïÿàÿÜÿäÿüÿ#úÿ½ÿ·ÿçÿ :5óÿúÿºÿÏÿ@„~f#úÿ@:çÿ­ÿ±ÿ¾ÿëÿ/L2ÚÿÇÿÛÿáÿ>on5ùÿÌÿ¥ÿ‹ÿÈÿ +þÿ÷ÿ.RW_\ôÿ(3ZU! þÿúÿ !58Üÿ¾ÿãÿ -4*øÿÛÿíÿ%8F!óÿÛÿçÿêÿ-J0éÿäÿ 3IBM; üÿþÿ1QQ6,=åÿ!ãÿÆÿçÿ 8$5ToQ4çÿ¶ÿ¬ÿßÿ 1sŠ_ 6:^P&äÿîÿ0-ÿÿöÿîÿ÷ÿ>ACh.2[om<34#ùÿFF.#M6'FEÖÿõÿ !EG5-,AcJEL%?>,üÿ DHI0*/-'õÿêÿüÿ>4õÿîÿ39 ÿÿýÿùÿóÿúÿôÿ.<, ôÿâÿÝÿíÿÌÿ³ÿ½ÿëÿ-OscI! Çÿ€ÿ™ÿýÿÙš<ôÿÉÿ `]5 Áÿ¡ÿ°ÿ¸ÿÒÿ9AT5.öÿÉÿÞÿûÿ&66*-÷ÿòÿöÿýÿæÿíÿûÿáÿºÿÂÿIADbGåÿšÿîÿ9ýÿßÿûÿ7;E(æÿàÿ úÿøÿ üÿ þÿ¹ÿªÿÇÿòÿ5Aúÿ5Eêÿæÿ*ôÿ¿ÿ»ÿ*=[.ËÿÜÿ$8'ôÿÿÃÿáÿÁÿÁÿäÿ½ÿžÿ¾ÿ÷ÿËÿ¹ÿ éÿáÿ81:@öÿÝÿÉÿ±ÿÈÿ×ÿÝÿ S9  äÿ¾ÿ»ÿªÿ’ÿ’ÿ×ÿôÿöÿÊÿÌÿôÿïÿïÿ?i*"ÄÿÛÿÙÿ¡ÿÆÿ üÿùÿÎÿ¥ÿªÿûÿ#?K(äÿ¢ÿpÿÇÿÅÿ¡ÿÎÿ úÿÞÿKNõÿÂÿÁÿ§ÿÂÿâÿÜÿ²ÿÞÿîÿÒÿëÿÈÿ©ÿÉÿëÿÒÿþÿ åÿñÿ"Þÿmÿ•ÿòÿ&K®ÿ´ÿÙÿÅÿÓÿ äÿ¼ÿßÿ0õÿùÿ+¿ÿ»ÿîÿáÿªÿÓÿäÿ½ÿÕÿ¶ÿ¦ÿâÿþÿÜÿ½ÿÝÿòÿöÿóÿ#'êÿÕÿÕÿÈÿ±ÿ¨ÿµÿ½ÿÝÿÅÿ„ÿ—ÿ¦ÿ–ÿåÿA>7êÿÃÿÅÿÁÿŠÿ–ÿÉÿÊÿçÿýÿÎÿ¬ÿ¡ÿëÿþÿ !öÿáÿ÷ÿðÿ¤ÿ¨ÿÜÿîÿÏÿìÿ¤ÿŸÿÝÿèÿùÿãÿ0ïÿ×ÿåÿÖÿ˜ÿ~ÿÿ¶ÿ­ÿ°ÿ ïÿáÿßÿãÿãÿ99,úÿñÿÅÿžÿ“ÿ¸ÿæÿÌÿ°ÿÏÿÌÿ¸ÿëÿ2ÒÿúÿâÿÆÿG3íÿêÿ½ÿ¾ÿ»ÿÈÿñÿÌÿÄÿßÿÖÿåÿ1%3(üÿÿoÿ¶ÿÌÿÓÿÿÿD3æÿñÿ 255KBqÿ!ÿ4ÿ“ÿ'3ÛÿžÿÃÿéÿCL/ ëÿÂÿ©ÿ±ÿêÿ!ÿÿñÿ/9?9DG1üÿïÿõÿòÿãÿ$>ÿÿÖÿüÿ×ÿµÿÁÿùÿýÿÝÿÕÿÎÿêÿ % '" ýÿÔÿ×ÿ öÿùÿÕÿšÿ¾ÿðÿ×ÿ 0+ ×ÿ©ÿ¨ÿÉÿºÿÒÿ #* -L73CûÿLQßÿÃÿÈÿÖÿèÿ-#QU K!ðÿéÿòÿ÷ÿñÿèÿ 2ýÿÛÿûÿÔÿ¯ÿáÿ.Aš«tEòÿ$.Sóÿ!>6*)-TL/(1%ïÿòÿàÿCC41ëÿ47e~Y÷ÿÿÿ,=Òÿçÿõÿãÿôÿ?\**N? jo <1DU1 ùÿäÿ;’Oàÿ2Röÿ4P73^Lûÿ5OùÿÞÿ ñÿåÿÔÿùÿ þÿÙÿóÿ,Býÿ5!)7*P- BˆŸ²±‘.åÿôÿX=þÿ>IÏÿÙÿl‹`ëÿëÿ \kLèÿ¯ÿÈÿ0 ÐÿÃÿïÿîÿåÿÐÿõÿþÿüÿ-E#åÿ*¡ÿÇÿßÿ»ÿÄÿìÿÒÿÊÿâÿïÿ%%/]WïÿËÿ«ÿzÿ»ÿûÿûÿ&>9×ÿÀÿ÷ÿñÿºÿÈÿ¸ÿâÿóÿèÿ þÿéÿûÿ ÄÿRÿ—ÿ( úÿj8ºÿœÆ* ˜"/P#mÞ%³sG-0¨ÿÊfá€M0ög⯙‹&,ýÆüì˜Á|GœÑ÷ÿU±]Ž–]þ¡ì©9ЯZù-€9þúÏ€ þÜ5?£€FÀíËùm ºˆê!ÿ:z¼ëƒAÿæ þÆXBÿ ÊR¤ëQ­V#ŠªDLÝJæ8ódÁ­„½K'eé¾€sþdY8^úorcËìÒj/;õ¢‹ÏüÿC;ÁÈ•—ÍÝÒ™0•£êv§:­,m§r½Ô½‚‡vÛÍ}•P/r³›ÈRte0~ŠŽ¦ 4HRzºq”mLNð‡n.þä§€Ø û[®(t›•áþsâ®­PïlÇ¥€gy.XšçýôÔSyo³ÅWð €]jb­1º¶Å“hb³TïÁý“‡Så5€:(ÿ[LS<ûá0û°\:&j„ÍÀnÂN6ž€¤É„ð/ªÐ†! çX.ýUè^uÄ€Ú^d²Khñ$àiŒ¸æÿt#€tÇŽ=a ½¦†.¤z2ñ3òþKÆ€^$íjê1t´þl2AÝG¨]Œt³bFC~ºì)ƒþêäiÌ쀬­W»ò–Jдc_i…Äp“@ðk´Æµ!nŒ“‚Ú?ÿQÔ³”R×ëi~#€®Ço€Ô ·³N´C»‚jÔ(Ì­Ì6_FÒìóp`~ВưŽ`‰dÚÃ\‚WüzrQÆ{‚Ù„Ò£ãÜ#P$€öÿÞ ëÉó'E°p¡r5F}Á'ªwÿª6ÚËä¨%Ó68:F?êª=“¸ÿ2 ’€•Ĭá•7ieESïTÐÃE‹ÍG¬u È€U3Lµ[¶1{÷óˆ{Î`^NƒÔVTÀ‹4ìWꧯ‘HrþïQŒ‰ÿ>S³"B÷Qµï•¬ò}vž€ÑoYQ<§…‹KØÞÆ”øøþ¢%„–ÝÇ_r~esæã¬ÏÛ±1‹EêO `È´¦"Jþ\2£€£Ê8è€ï÷Û‰<¦#9Љ­J9)*µÈ±ÓBÁzy CRñ‘µ§})“ç°ýCsw±r®Ó‘Ë™œ†wËð*8 w’­Ïþ²[²äÛ´¦ú4Hýi2t[ >èØC€y:ê€íΔ䞗Õrq IÕ£¯·m<Ú€ Ñm%tWµ|ÂCOýydê|.›ý°½fÖWðÌŸÄw-È€yØI Ôàl¶®ê9ØQÎ!­*lé€îý] E“áÍ9t©u¢2'ùäìÉháy ¹ç¸õ  TZ±i­d†“ùÏdSíJ¢çÄhQÿ®2=ó·. \ÓLƒVa#˜èV¾*²; £€$ÁŠÛ”쥽ÀÏz´ŠüÅ(8Žš>±lÿÊdf\J(ýC ›?$õ ³šb±]ë|ìó– ³“~½Žß$Ј¥¬ C.ÿyܺ.ú,Py!ÏܱXém| ‡]°sïÝFm§Y·²ò¿2ž±ôe&×z¼ì€©©Y*Sû@ Q¾W˜3k©K+ÌS¼ÜW2c&¡1s(ý’š·š/Ñ‚Q˜$ýO¶@;ìÝ—&!=Bú}·mBþ¤KGÏÜN5þ1ÊºîŠØ¹–éç»Î=Õܬ{äK$?œ€áÆ” 'ØF&Pm@‡]|m<.È»„«ö%JÊ"‚üôˆåsî¾çÅ‹”×­u¿B(˜ì`.G4/½îòä²5ÿë[†ó}æ$Á¡÷üðT)ÁÔíKºWàPÉQƬ:+Fpopù¶¸ç¥N5CððÚZÐ,>ù%ûÀ‘©¹ækîf­¨¶M+á1hñö1 iÛô ÕònãaÁEÍSMV1U2:ôÒ¼„ñ´ 0ûEÊÙ¯eàÃí„Ñž¬Á—j¶™ÍQ~rËdò ~BÅ)“¯™® YWs-ª¡¼)棽柉ºíÀÞze6+´¢™Sä>.ÔÎ(‚B²qþ¹I»ÇÞ׎åÊó3ÞÜ¢oô~Ó¼·¤™S€Ý§à=ÌÿîM+T_P3F Šî”Ó/ªmÿv<$ˆGdǙɒ¡»Ò¹éÞ_®~ÛÇÊ:äýÜÛÉsâ{w"ØcþZI¹<î¸*žE ê&¿¾+> <|ëþª€Ï¨Ó­º\«`å'&ð+A$˜3àåÄÓÈë,þ`76´rU°i|Q)_îÚ¤2šsÛF:HÐøÏ«X÷Î¥®šÆ£jæC-ÏSÆQï/:0ñXC¸ûUë_ö: :7%RDuÆÐXɶÜd¸Žƒ—zÄAíy+×7!üêÌNÙã ¬òjçD4)yk{Çh¿@…ièÆèêžëÚØ•!´Öæ¸(’J„eÅ& T  çEm¥w±-0ðËñ1ù…OÒ[ ™WC :™æ§¡¬Ò¥[«ÓÖgâÇ×^Þ± 4úíÌî½wÔ',Ouu2wK‡¬):qúW¿NÏûh%‹;@Æ)‡ßì Âʺ1OkoHT›‹âÀH¼ÆŸ¶¦bÇ©ä+;)ß»×ÈeâÕëÝ÷_R>ºbDtÚhC:Äý¨äíì‰õÜü ¥ª í盀ŸžàËvòóÉÛ%Ñ,­2Æ%ÐõDË-ñÃ9RQ…TÚT5HÉ,èqë¥É§ŸËÏû1 ùÿHðj×ËQËÇÍÈÝÕÚPÿbþ5b&Mj 0Íó*ñ¾ r4$QÊ+øÜ‚¸¶ß¦¤!¸­Ë2éÓ 1ÿ0B JãÜTëi.üDöFîMúc_#]×P²’ÁæüöÁì¨éŽüzùïQÍñ£v”\µöé¾'5E>©G!My6/ ðMä —JaTt;÷rö«é ˃§o˜V›ÄÂM  (úöêsèçî(çæP0VZ–}×oø7´G÷›ó»â›Øyæ“ýŠ S³©ã£©Ž ­òÇÓFî¹2+H»U#4eôºÙ4ý+q2&'::äO?ýPõ‰»‹—§wË‘å2ò ö ¸þéÇÝ(Ö/¿\Ê~ eL)h[]?=ª<%&îûÞ³Ûÿýê0u2b 9ê°ØCÌù²†˜w£7ÄáÝ AÛ:pC{ú÷ý¬ä¾69Xl{ZÞÚ‹ÇoÍϨÌêίäfû„Ù³8¦®¾¦éyaŽ87Y939!£~óùØ8…GK6½¶ÿòqÛ¹¢œª ÚqûGI÷îlìåèå.êï~.ÐU_WSÑ>ïWüôîôñí¡ç3öM¬ôÿ0Ù» «ë°°È"Ú¾äH¶+ÎBÐ2¿\óúã,«+4ò6f>@#4òÈË1¹f¸4Ì/å‚ðÍôöïôëñ3ßÝÆÁÇ_áº0ãL)J5?':Ö1Ñèø:áÌñhÿ!²± §õæã“Ò•½6®[­¿Áè> Ý$=_œöØý Ã´+P;drIøáì°áö֑߯ÑÙvëx$2ó¶ÒÀcÂÍ%Úc÷3ª:qFIFG*ÎÓó6ü;$È(Â!íR Þ·Üĩ螹¨Øìñöz8 qŸÿëùµê;çÊ)ÁFSWN«=å%© ×ùêfÔ|ÓOñ i ”ù¹á ÎÅÀ#À ÉcÏïÛÃO3Fr7„!TA k ŠYö,<ú7nõnÔ&¿¹ðÂ]Ò§áÑí»ù—¤lñ‹ÖoÌ/èa–*z3í=ËH£L€TÅM`'V%9ذ6z’Rþ-Ú×´(«Ü»ÏxßôöBtÛÄ­ñ}ïr)X9ª>ãD>‰*Ï…úæÝ¨Îdϰã½ü¶ÿøóôèÚÛÔrÑ$ÈÃÆ·àD á0Ú@Ê8‚+7%Í&õå##›,*t4øïÕ4Ä«À…ÁyÆÐÒèÐÿ_HxùhâÑã1ûU{O'¸@óOšHÜ4·ù»äƒè¤ó6ø3øøúNýwòÈßcÏܼ±aÄ7ì¤ÖØ,W/ƒ!Ò núœ$ï;Á9ã)`-äîäÔ5Ä™¿øÃŒÙÃúí2õ,èté%éÅâœâ#óF*úBâQ$G,¬€ _ü¹÷Ñúaÿ\ ÐîþnÙ캧·íÂXÍoØ×éSœå'%Õ ¥ýº³ A)5Ã;+;Ô-§Ø÷ÛkÉ+Ê8Û)ï¸õXîìðð èaÖ’ËÝÐåè² ¬*99ô9ï4ù0'ôüÿü\§G>GCõ)ÞÊÐ7Æ„¹¼ÜÓeíÖ´³Ö?öªø_% eÔ!Ð;ßH²F7ƒrö²æ¿è çfßWäx÷®Aö æÖÕ¸ÅkÀdÏékþÙ­'¹5Ù3ƒ*v4 ¼ü] -|'•2HôþÓ©½j¸ÝÆÞ•î¢ö~úCüÇüÀôôéqíÂúF 7%@ÒKyD¶/Rp ŠÿÈïþæÛëAú7 y aôfÛ®ÍÂÇ¡Å3ÈfÓ‡ë; #ç+œ&w© ]^ ï ' .º5/Žó’Ø Ê2ɪÔýß“å5íøkûþïPÞÜÖ1ÞÒî J%:4µ8Q==õ+‘Cü÷dü˜iø|¨õ éÞØÂÄйè½òÎZ鳠Ö /È É ‡¸ ¥5*C@µ/.«ü~ë3âòÖøÒPá;óTù-öíaÞGÐÀËéÖ;êÒû({(À9ƒ=5Y!q ÙÃÛ+øâæ ñÕ‡ÁY»Ã¹Ôºç]öÚÿXÉ÷ãñå÷ê :%Ù9\B>3Ù#ýøæ ßïævõþÑüæóFæò×aÎ_ʙˈÔ;ëG 'ë/©+^"‡Ì‰0 b Ç*n0è$xÙöËÞÁÊsÅÍVÖ­ßgî)þMÝùë°ã#æõ ¦+å8D!Aö)z „ü'ö`ôùË¡7€ù˜ìÜɘ½ŸÀЭé ¢ÙùWD_ r-î+à79n+ ï-í^ÙÆÍˆÍ?Ùëèö ù(ôjçÏ܃Ûßhç³÷ó"+Ã>B&6ê#^wÉ¡2ò Û²I Àó×Yý)ÄOÑà¦òRS¯‰ìþkøîÿ-7,=9ý<å4/&ª“÷¶àçÖÝÛ[èªóç÷ÃôýìsäÛܙҚɞÒÞðãÅ#-32e0o%Pj @oŽ “%•[…ø\ߘÍîÆÃÆwÉ×JñŸ± ö&÷Kòó=ú:hù'¥;TFì>6*ÏüÃîêBíôxùûSûñô{ãâÎW ÄYÔ­ê¼ÿ”ž!h*ë)Evt"Œ+Û+b&˜ãùî<×:ÇÚÅëÐãûóôøà÷‚öðèAæ0ê™÷œÛ'><ÔB&9™)·êZýøKö`üW™0GóÛÚ&ÍDÇbĦÊ2Üió T“áv m<+ ž•$*05D4‡)#ôfÚ Ñ¶Ö»ÞræLïnõ9÷‡ò[åÑ×aÓÜžña  Ý0Ð:8-›| ?ÿ^ý2‹µ _ùænՅLj¾«Ãó×+ñJ Þ^þåü¢J'#ï6A‚= ,$ÎýRìâˆàWäÜì„÷{üø­êØÑË5ÌÖTç<ýšŒ'©3a3i(¨G^ Ð¼Ë D!; –îûÕÅÄîÀÑËKÜoëÆø/ëXþõYîoïa÷„ I&Æ9’?<;0ª\ -÷±éÜèEðºý’„ió¬æªØ-ÌòÅÐÈ7ÙÐòÍ Ðß(U$L8à >n —ô"Í-[0Ž'v(ô‡ÝöÑ8ÎPÑPÚíçª÷†ÿâú~ðŽäÏÝ´ãÅòY“.ž<ô?{5a"a$ýUõØùY q _Cý îSÙhÇä¾ÃÍÕ—îÒ!Œ  ѱù —Þ.Y:|7K+ æì[ÜsÓØþãNïBùßúÔðWä3ÛžÖ‘Ú+æø¤Æ(é7r:æ/n¸ óæA æ^›‰ùðÒ٘ȂÁœÅ–Ówæ¦ø¡R Îâøšô{ù÷¼0:s:Û4Ø%* ró‹â=ßðæòð!øÀû’ùñvä+Ô¡É2ËEØŸïG uµ,Ç/’'C¼xã ðM$·*"Ð/øhâYÒwɇÇÐã…ö=  üwóíÄëýò=G);çA‚9Í&ƒý›ð»í¬óûV€\ªô„àlÍŽÃ>ÆõÓùèçÿÝ#œ ÎåÑâv!€,1ã*üù íרͺÌdØÆè‹õˆüÁúŸñÊèÉâÓß3åXõB å'g:çÛžËHȬÏÞîÕúÁÿ$ùñlê³é°ôZ P!í17:692/¡ eøÇï­ï}÷ü>bù.êMÙU˘ÅçËŸÛ©ð'.="Jã ÛŒw ºÆ$å.Y1×'Q“øIãáÖ%Ó Ö‚ß:íùRýù¾îÑâóÜóáòîJ+Š8Ö8¾.5QÿœøÀû’E¡± ñ&ðÜ\ËVÂgÆÏÖŸì¥6 Ú›p zšûþX ‰)Ã5s8±-dÄïÇß9Ú7Þgçµò¡û`üHó]åÙÚoÖ«×áõ@$71±2€*_N&”¨ ;% î vöá^ÎîŦʀÖGåUö¢m ÙUþìöôø¸%Ë)ƒ4W934z#1 hø¿ê0æÝéXó›üÂþ0ú†ñßäÖÈÌÔÍ×Ú€î<ð„&ƒ(Ã!Éñ ¼bv §Ó"Ã&é"îü{çØφÌmÔLåÅöÿ•ÿ8ûóKëEé&ðõýþ4%‹4\:l4ÿ%9‡EôMòú÷þ¿`÷bãMÒFÉoÉ/ÔÛæ ûÅ å¯ú4( Ú>v+·/**ÖÚ ¥ó.ß1ÔKÕQÝ®èçô}û]ù!òÇéfâß!äªó ‰í.F63ÿ%¿@—ÿ ü^ÿð“l –úè?ÖLÊÈÐß8òsrî° ƒºý|üzÎ=+ü2½3(îû÷éåà‹ßäÍí#÷ û—øýïâã×KÖçܰê´ÿž?'-p+%$@ ;;6 OSÙv˜?ïÝÎÈÏþÞÀï‘üÀQ¸ƒù"ô“ö‚þX l.ß6@5ì)ô:_ôOì°ë—ïTöÔý‡Rù„ëùÝ!ÔíÏ$Ôêâ˜÷= i‘%ù$t•ìq‘ ÷°$í#I ÷Oâ{ÔúÏvÔZß¯ìŒøÔýÒû¯öÏðýê§êcô>ô)3¹4Õ,^Ñ ~þüô8ôŽûŒITüjîÝœÐßÌÏЀÛ*í?Ë.Û£ Ç© Lg Ä*±-Ë$«åþ¥íqßc×TÚ¤äïLö‚ùÜöäî•åØß\â×ìŸý3|#o-œ0,f‰þbZ§ ‹ó ãçó$â÷ÒÌlÎ@ÙLé‚ùñ˜± ü×þÙÿò6%Q/1–*%Ó/öBéyã•ä‰ëéóûøeø òMèÏÞ$Ù©ÚPä†ôÁQ'&*Ÿ$+ Äo‡Ò/0ÿ¾ ú`ç>Ø-ТÐÙ æKóâý±?ýâöÕôÇùË¢"å-r2~.Ê!-ÿqóïí<ïõ_û»þàûFò"æúÚ¯Ó Ô˜ÜDì¼ÿKÿ(ø•íUà WúB#t—¦ñûà§ÖµÕzÜ׿‚ñFùŒû>øññ£ìëÐð³ü 7—+¦1R/I$N`@ýLù`ú‘ÿwd˜õ&çGÙ^Ñ´ÑÙðå?ö ù‰   жn$´(1%‡\ øùdê„à~ÝEâoë™òöÏõÿðÏé.äÈâœçïóÿo$q*F*[#0c ">KÌ Æ2Æ‘ûÁëvÜ-ÓëÑûÖêàDïúý®ê áoOÿÿÿ×Y&"-{+k!#¤¯ó¨ê€çŽêØðö½÷©ôíóãÝæÚ+à¿ìåýòÉÈ"p#K¢ :ç ²D³¢–óÎã]Ø1Ô×là í„÷£ýDÿýù9öÊ÷Qÿ‘ ‡&ˆ- -Ø$¿· |ýõªòõù[üxünöëëß1Ùš×bÛOå²ôÁ@Ã†š  ’´z ­± MûÆêÀÞDÛkÞŽä×ëóò?÷òöEóÉî2ìkîú÷E¥’ ù(m+#& ƒÎ¬þìüîÿmßKú|î^â/Ù*Õz×Xà(î4ý³ø< · #!x áÆl%&žG$gôzé^ã ãé3ï3ó\ôËñ*ìæÜãfç”ð‹ý` æ#&i"tyÅ@0N ( - þ "»óæyÛ¥Õ>סߜêtõ_þ·‰˜þLÿ S!³(©(U".- bý ó+î§íÇðÁõé÷)ôììeæºáµÞþß>è>öv?N°öx¾ × "®Ûì2ûsëüßÛ`Ûáßóçxñù üûû÷Œõ¦ö®ü+ ¯&Š*&œ$süô÷2øcûtýñû‚÷’ðçÞÝÙÛÛâ®î$ý1 ›,)¥R Ë  ɲÅfï¥nlô·èìàÂß±äeë½ð(ô õ‰ò©îŠì¥îõwÿ 6[#¯&4$ÉÀ t ·¤ü4þîò‡ç„Þ8ÙWÙ²ß ê\õqp× } ³Éø æ7>#ª#Çy€ üûað»éoèëÂï_óXó„ð íè-äFåiíù¼£¬!ã•’y¥ + N *M ÕøìÈá$ÜÛ‹ÞçÇñ“úFÿ×îÿAþìýG´/„”#E'$³ùùù«óDòüóïõ4÷aöwñÆéŸâ7ßcàçårðâþã vÞé¤ Y Ì.þtÛ ¦ó\çCßÞãáàçxîóôßø@ø‰õWôÄõ)úKk ãµ!î%l$„mþ ŸCýëúÄüÂÿ:ÿ7úqòÇéÊá1Ü!ÜMâ´ëòö½û ë¾3d û ! g'Ñ\ä{-¼ùCî`çDäÈåVëð;óªóGòðîhë ë·ñhû¾x’"D"†¸ !Ý™æ$žöï÷ÅìãöÜÍÚeÞçòü¿/ç2H,) (´î 8$£ Pì %vö ïZí/îDðIó¤ôòíè­ä¿äêfôßS ÎGöå@  ï  â¶q—þ„òaæxÞ5Ýàæˆî÷<üŒýÂüÒû“û™ýâV¿V ƒ$#ß‘ç²þé÷­ôögù ú ÷uò“ìå˜ßßãì6ø”H8, {Êôü•'4„÷’ìÛäžàHâè îóÍöm÷Šô4ñŸñŸö»þ¨Þš#j#:—È %DÿY…_ºý{öÀílåÁÞ®Û{ÞÞç ô…þ™ ¢ ç s ƒI - p.Âå ºóIë§ç4èMëð®ôÜôõð<íôê˜êÜíâõq 7 ,!•`½ö ÜœÐÒ y axü5òèæ\ÞàÛÈÞ'åîíª÷§ÿ ;ˆ“´¶ WœD"="„0}˜ûóúî5ðdóŸõ°õjóÑî?éäÔâ æoîµúó¡¯–Ñ®ä • Ý ª ç<ÏQ åÁöïëˆã´ÞXßþä²ìQôUúüÉúˆø¤øÙúÛÿ¢Ê#¢#pC ´ ûŒøÃø`ú¹û/û÷¯ï¤çáåÝÌà-é*ô«ÿá @8f± y û àÃ\* ŠþBòœè9ãÔâ—ç~îãópöö6ô¤ñòï ñ™øðPÌS º"|õ#~èÌÿíÞˆÏ3ütò8èÀàOÝ^Þäîí·ù´” ‘ > œ<r£ V1,7åñIù¢î¥éñéâìŽðóŸô2óQï¢ê0èçé½ðÌûnÑ^)^ ®ñÁ | 9 œH÷•ì®ã=Þ¬Ýiâ0ëöôÜü³Ñ"Àÿ©B¦¸Ž â"§Q ·ÿ÷bòAñ3óö]ø¦ö9ò1ì æWâgãçéôöÀ sŽÂqׇ r  õã¶ÿ ÿþò-çþàÌßã¾êDòWøÑûü±ùi÷M÷óú— ÷W ‹#Ñ È‘þ^ù°øàúýÕý|úôóìœä®ßNߣäuî.ú‚<8® ´ ¯ %•¥¶7’úIøiíqæ…äÎæôëÛñdöæ÷èõòïïÌó¶üYR!| kG 9ËpSÝJ#ƒøïæYß/Ý*á*êõ+ÿ…B R °j¾T| –‘¹’dÍ ÆÿíôWíQê÷ëJðœô¸ö õ}ñuìÎè>èšìÁõ4Ñ £  ãÅ} Ô d ¼^þêò&èˆàªÝ‘à«çÀðÚùoø>‘ÿ¬ý¹þ) AA!l Êv]‰ûöóuñþòöVùNùqöñ`êËäÃâ æNîAú=(,TÄ O 1 ‘ cïBh¨øzí%å@áVâ‹ç1ï«öFûüÜù7÷Böý÷kýÏ싞!›"Öä¥ êwüJúû`ý×þ¥ýQùEòêé¡â:ß¡áˆéqôsÿ# z88Ó ±³› ÐÍB;‰Ê …ÿìó×êîå$æoê–ðÆõý÷÷ômðËîÎð§öS… ‹ef IaBÓä½¾OV7nþïôÉêãâÖÞ—ß/å¤îeù­l÷ ïsÜ ã;£ûù(›ú€ñ¶ìì›ï}óIöúöÒô3ðëIè†éYï–ùô9ŽÙ–åG :WF 1 ’ nPúˆï@æ[à”ßPä…ìqõåü© þ^ý¹ÿæÏŽ!‰µ‰ ˜ø,ôcó\õ‡øtú]ùßôñíHçäãåUêióÿq ùèD!  r €OþˆÆ °íô¤êäŽâ æhì,ó{øtûpû1ù³öüõDù»m  ýë : ç`ÿQûûýeÿÀÿ¢ü:öRîêæâáå›í‘øK« ÂrÔ š Š‚˜ I;—Û1¤Äú‘ðÇéLçé¶íóúöøö¿òÜï`ïÄò‘ú%V‰[?©F9 ûÛ\#wò<ûòièµáÛßãfêðóMýq3+Áj ¾Ä½Ç¶Ý ñâ÷PðóìøíòñöøÊöÔò×íøé;é¼ì*ôÚþ# hT“5•ñ ëäcµ À ¥ eOäõšë%äþàâ-èYð)øùýôÎÿƒý*þSš ¦j<Únâý§÷Ïôìô÷gùÐùX÷hòuìçÖäç¾íâ÷Li Ää7S ß \ Ò”ïsSÂû6ñ8éÓäÆäÿèï~õŒùû<úò÷1ö½÷ìüºõ #…K¡© “ÆýÃûqüÝýÅþDþ¤ú¶óìøåÚâõã¦éôò^ýôµ v û R m ªÂ¼þJ •»÷©îÀé6éÂëöïˆôf÷÷ ôéñmðšñ<öÅþ\ íÖ.–¢pÞõïä¾rþ3÷Àî¶æâcâðæ~î{÷ÇÿfPšûáF ]]²{ê¿ý©õ¤ðï¸ðÙó6ö¸öûôñÐìWêVëžðOùmR –¹i[VV Ë&å ‡ æ Ä BóûUòôé“äXãeæiìÇóaú°þ+oÿ0þ`þ¹x ‚}Jœ/ ÑÞû=÷àõ«öRø†ù²øõŽïvêMç?çvëkóìüY'Ý’ã' Ž ä ç µ Éòìƒ û÷øîßèzæ èÆì„ò÷zùéùùÀ÷y÷2ú·9 ©nOñO?ÙXõýÎü×ýºþ'þük÷¹ðùéÔåNåBèCîöörÔ¯ £ à  , þ Þ ¾Û¿ýæôîëì-ï¨òJõŽöÎõWóUñ³ñÞô+ûÝÛ kDsì|ß ¯ QÓC$ûªóqì²æ=ä?æìdó¾ú¼’Èrì:r 3‘m³ aßú¸ôXñêðñò…õ¬ö~õ¶ò‚ï<íªì(ïGõñýbšúrÓCE  ¼A ² y y þ•$ø¢ïPéZæãæiê5ð{öxûPþÿeþ þâÿÜp Þ4†ù>¾ ~Xûê÷?÷€øgùØøyö™ò<îêéÂêWðtød Eýø›  í ¦ Ä 1 Œ\ýþôÑíÆécéÎëóï\ôr÷¬øzø­÷Ò÷ÁùþýÅ l&xíL 8Ýšÿ¾þÊþ¶þ%ý`ùíóîHé׿%è¯ìDó*û·ýx Ð ê þi ª +«æÀbÔ ¢Xú7ó¾îŽíçîŠñîóõÚôÌó•ò$òüó¹øìÿlCá÷­ö \vãTýÔöýïêCçç}ê]ðÕö‰üpÕöp ¶I.MÑøÿ/ùÝôÿò9óFôbõ‹õÖó§ðîqíïió]ú€ #t³Ç¨µ é Ä Æ A 6 YUKû¦óHíéæç0ê“î¾óhø¬ûAýžý­ýôþA "WÎæÛ zÿ~û™ùbù¦ùùòöHó%ïÖë*êåêzîäôÍüŒ; àAµ ‹   D Jm×Å rZ˜ø‡ññìœëqì¹îÍñÖôÏöb÷áö ÷ØøÀü)¹¨Yjýæj §³MÛÿÿòýQúBõðÁëèè•è‹ë6ñøoþ¯$m“¿ : OÅ%³š °ãý"÷­ò.ðÃïñÄòËóéó=ófò+òó:÷ý4f G£0`üì «_ù2:Cÿoùöò8í¡é¹ètêžîôªùïý~©T´& > ÐUEK  6çüPøüõ€õ´õµõ+õtóúð¸î„í8î·ñ¼÷ÿ. Œi… c ë D Ê L ´û¿ýçö–ðæëêÔê®í×ñö$ùøúÄûuü§ýN»T &©ü‹<å æfˆþnüXûÂúÝù¼÷tôpð¶ìsêõê9î`ó¯ù fH & \ à  H ³ Éþ áûlõ“ð î î©ïÃñÌóIõóõÙõ$ö¥÷ðúûÿFÎ F”å’ ÜÇ'cÂ;ÿ'üs÷ òíÞé9éFë¯ï¡õü1ÝT_G * | É î Üú{ú’õ©òÀñoòóôôÿòžñõðòPõÅú˜r)eyÝŸ à E³‚ÊÄÏvûqõËïzë°éºê(îÙòÃ÷úû¬þàÿ¸ó@ ò¢Ðv ·ÜÿUûVøþöâö÷^ölô¾ñ3ï«íîÁðÙõ_ü0 d >>Ð X § » " Œ W ˆ Ø&ú†ó‡îììóíkñõÍ÷@ùõù²ú1üåþs?3a²l ÒRþ-ý ü˜ûù~ö|òlî¦ëëí•ñâ÷|þ1-o è w H < ô ÂiФ à%ÿcøÑòËïÿîúïýñÿócõ¶õõ¶ôðõÝøŸýçŠ !µ¶3ÿ …± yÀëý¶ù®ô»ï¾ë÷éë¥îôúùÿ‰ŽX¼¼Úù ”Õ&ë§• ç ýÓ÷ÕôÀóäówôõÉô˜óþñàð'ñó7ø©þŸÄ cUçzª ˜ 肺…þcøSòŸíëë í¸ñWöKúý¢þgÿ#ˆ“@ £4³¯-q5íýúÎø ø”øñ÷#öwóQðàí4íFïºóúëZï þ ž Ï  6 y Þ ûvðü\öñð¢íÒì[îqñÛôt÷âøùÜù‡ú”ü2V= ôåÓW–­ ‡RêÿßþfþÄýü¾øbôúï`ìÂê»ëšïOõœûmÿΤ w 8 ½ k í (oû3ØÄ“úÑôRñúï™ðŠòÁôö!ö6õ›ôàôÇöÉú–yÖ ktì þ"š ±ôóü¯÷.ò‚í¶ê™ê3íäñ¹÷$ý83vó~t W Ï)Ð |½ÿúNö‹ôÂôõ4öìõxô[òwð¸ï'ñ\õXûL: >lÉ; » Æ' X µ=ª“ûýôSïÎëÛê¡ì‡ðYõù]üÆýlþÚþæÿvˆ <²l„Æ gÿMû~ùùSù'ùø÷!õ—ñŠîîì¶íQñ÷Æý0] ¡ ¤ â q ª ¡ U § ­ u  •¦ù4óÂîíïí{ðÐó÷åøkùùù úõüà*døU7 ¡DÿÞþ£þ~ý»úÓöWòûíë ë±íòÛø=ÿƒÛ0 à@.b é ¾­ 5þâ÷Ió¶ððÿñïóªõö7öÍôèóãô©÷¤üCL …9A«z ÁŽ2aá30ÿlúÚôªï»ëOê»ëÜï6õ”úÿQßü$jµ Ú”6"n« ºüð÷Hõ²ôRõHöö¥õ½ó©ñDð{ð óý÷™þŒ– ¾XRà o ˆŸP s ÷ŽÿqøfòÅísëÉë‰îíò§÷bû ýEþEþ¤þ2zCˆ ò5dZ KtËü+úùäùúmùi÷+ô8ðTíÏìÏî.ó^ù¸— ˜ j  — Ø ì 0 ã ß Ð p Ó ýŠö,ñåíípï]òzõØ÷.ù>ùÊøUùyû!ÿa 9,~¤“ ŸÔÿîþçþšþýÒùšõÿðúì ëìîïµõ?üØiÑ–Q2 ç ¨OÕ ,ìú*õÐñ¹ð‰ñxóSõ›ö´ö“õXô@ôöúÓ! ¦ì\o ‚­mB)q4šýYø—ò¬íàêòêíò?ø8ý¯µ^HÛ·¹€ Œ~¸ èBVú"ösôÃôÛõÏö÷ö©õ<óñEð…ñ÷ô—úÊ…© gâ=c à pd Ï£>ŒüLö¬ð¢ì”ë\íÞðõWùTüÄýþYþ5ÿ{e€ œEÑ×p" ©ÿçûú¾ùïùÀù|øäõ™ò—ï©íòíëð5öÒü¤5 p R · B É T 3 â k ª à jõúôÖï$îÎîOñyô$÷Àø>ù#ùùùù¦ügJ) (áƒÅ@ bí®ÿÐþ¬þºýœûî÷`ó)ïì ìSîÙòíøÿ! Ø Ã¬× ‰ ô“Ú J­ÿ$ùô²ñvñvòxô'ö±ö!ö5õyôõ½÷gü0 ÞAª¦Ù —ƒ­dжÿtûGöÿð í›ë¼ìðÐô ú«þ§ ˜ý=t =„4Í žãý ùö;õÙõ÷b÷©öçôÇò?ñAñzó¶÷˜ýiK &ÙÔ-” T JI­¡zž¹ÿù¢óï¸ìÙì@ïóv÷)ûWý6þþ'ÿË—Ì‘ Ü ñ{ ÚyBþzû;úëùùùTùˆ÷§ôqñÉîî±ï±óù×ÿ’ { ¹ ¸ §  < = „  7 o ™Yþâ÷Àò—ï½î$ðÌò£õç÷!ù`ù:ù§ù^û ÿO ' Àw –Ô>ùþ¯þ:þ¹ü úöØñiîªìGí}ð‘õfûÑõveq/¢X ‡ ¡Ê( o[?ü÷SóíñUò»ó†õ¦ööâõ/õ8õÀönúµÿ¦S Âß·ÈÆ o Ÿø&Äþôfý˜ø²ó–ï íì–îvòm÷<ü×ÿ ôŽd(¶ r²,‰œ IY÷ûøâõ<õÈõ~örö}õÆó:òzñXòƒõàúVJ ä­©Ð Ÿ m}¦ïøÁü$÷øñcî íîñ½ô‹ø¶ûqý%þºþ×ÿ§ qÜ‚™eª t¥%ý,ûUúÈùôø¡÷qõàò‡ðAïÅïqòÕöAüw  > 6 : à R k K ? w ž û—õmñJïrï'ñŠóûõÜ÷Ñø"ù–ùñúªýø- >¿üß ä7TPÿyþ-ý¾úP÷ó=ð2îõíµï!óÒ÷íü§#cÃŽ O x ^À+¬ ªÍÿ.úÀõ(ó`òëòñóåôõžõKõ7õ6öÓø ý L‘¨DE iYåùºÛþäúQöãñ™îEí î¬ðÔôùÛüàÿ÷Þ@~a – G˜Iö §$ÿÐú¹÷ö“õÆõÒõõ¾ócòªñgòÞôÁøØýl‘: Kd ½ C  Ñ+o[Gÿ ú»ô‡ðDîî¨ï|òØõãø û£üÙý.ÿEKDi êò)W½ 0ާÿËüûUúrùø÷öØóñÅïyïûðbôdùäþùùŒ ƒ n ã ª  â Ž y ß ×Sàý’ø7ôfñoðñšò|ôZö¦÷`øù?úˆüýÿ}v _²+f ‹j!ˆêþvý–û²ø'õ»ñ$ïéíœîañÏõ˜ú4ÿ£Óœ€€  # ì·Á !žý¯øQõžó9ó·óUôÕôÌôµôÆô±õá÷]û*i · KÙ™ 9 #p@TêXxü+øâóOðIî,îÏïéòÝöÈúåý6ô[Ò̰ Í ~Bb†Î ñÓ.ý²ù™÷ÇösöÄõêôïóÃòò òðó÷lû¶   ö ø Þ Ù  ‰ Ô~Ýý2ü:÷ ó\ðïðìñ—ô<÷ùXû¹üPþZw# ¹ ŠÝ1¸å »cÿ+ý¾ûŽúûø ÷”ôõñð‚ï¡ðOód÷Jü‘Ä_  s ® Ò c õ ¶ ¤ ? „Žû_öókñ%ñ ò–óõZöu÷ ø2ùSû»þë¤ mOnón L ?9»ùþ²üúùáö’óÊð3ï!ï±ðúó&øwü]qšÉ´ ¨ ‹ @:) Ÿ 1Wû•÷Jõ/ôñóô;ôbô]ôzô5õÙöÍùþü' õ†ò ì ä ªOÈlþùù½õò~ï·îœïÎñõ·ø ü»þ¼•› j‰TBO 2 ‡@üùøT÷˜ö™õ‡ôóòùñó¯õ´ùŸþ¨ ¾ @ é D ª 6 Ä , ÆcKþfù#õÞñðþïZñ¦óúõøëùûþüÜþ»E< îky l ‘Âÿ(ýû°ù¤÷UõøòÛðÅïð(òîõcú ÿ=…ü ®  ¦ ’ ‡ Õ F ü = ºýÃøõâòò+òó3ô2õöçö øóùöüáP ' ÑÜùã 9 ¨7èknþ¿û…øõžñxïûî0ð¹òPöCú1þ—ÿ—@ R 3Pm:Y >jªýùöõ ôžô›ôôôžóÞóEõú÷Ñû¤ÕP F ¬Á  Æ>)Ûÿ”û÷nó—ð#ïïÍð‘ó«öºùhü“þp’Úz] r -òòŒ 8‹kþ?û2ùÞ÷âöðõ·ôVó%òwñãñòóz÷<üeçƒ œ } O Ý ¸ Œ | a i ·‡Êû÷Lóñwðúð†òˆô‰ö9øÀù@û'ý¯ÿ  ‰Ð‰X  £W•€þÄü6ûDùÖö,ô…ñ¼ï†ïöðÏóË÷Gü½> Çè ® c _ J ë ¨ J } :NNûñööó\òò‡ò—óÆôŸõXö÷Cø¥úFþ¨… +…%†< ¯ lœ÷7-8ýˆù·õsò ðæî.ï.ñpôMø4ü™ÿìˆðÍ+ ¡ ‡,Cõ D À!óû©ø‡ömõßôœôRôÓóPóó§óÔõzùÞý½¨” ¥= ’ v ¬ £ôÊïý“ùDõ³ñSï»î ðiòfõqø û3ýöþp\>¤ Öïy¦ ÌÈå ý&ûoùDø ÷–õ£óÊñ¡ð›ðëñýôaù…þexF – Ø Ø á Ù Õ Â ; Š ¤¥çýùÛôÚñˆð‘ðñ[óMõ÷eø“ùSûÝýòÓ ñ »5éÿÖ ¹ãÁÿþSü>ú¯÷Ëô òÐï»îCï~ñ5õ¤ùþô=i¬[ 1 ^ Õ x— @ }æÃý,ùÃõyópòÂòœó$ô‰ôõ}õöÌøü1Ök Z ÆW‚‹ ! ®Ì=ÃÌÿžû·÷‰ógð¢îwîÈï`òòõÐù\ýS‘§|Í ` Ógï« \sÔý)ú„÷ögõÿôqô´óèòSò…òô÷aût•Ø Ô :S” a $ ø ñírléû_÷Gó<ðëîaï*ñçó÷›ù®ûVý ÿ+¹â€ ‚žÙ‹ù ¾©;ÿ˜üËúTùã÷BöDôvòãððàð<ó ÷ÎûµÿJ~ » ò Þ Ü 2 š q z L ¤éÇûýö6óñðbðñŸòXôáõ8÷qøúüëþ”Î Ôú\0© T þޤÿþ*ü™ù§öˆó²ðïîØî4ðó/÷Ñû!¨<Ĩ¨  ¯ å¸ ö ­ÇäûÃ÷Îô<óÔò7óÛó^ô‰ôÐôZõ×ö‚ùqý5w ˆ÷‰ l gœ3&øý<úöFò£ïWî§îÈðýóÃ÷dû‹þÛÔŸc±k $ã:ë / šðæüšù?÷öõ«ôËóóVòòèòGõ×øgýk= M Ò ÿ  E k C¶ÔþqúÖõòÌï0ï ðZòõÊ÷öùÍû”ý€ÿíû–U Œ^‚: ~¾öþšü”úùo÷wõSóuñYðbðÌñ¯ôàø­ýRl€  ¯ ï - w Ú  À  óŠ–þàù±õÞò|ñ6ñóñNó×ô5öY÷­ø`úéü>'f x5WÉà g BÅÂÿòý_ûwø-õéñ~ï‡î8ïVñæôùOý,F+ ² ò Y ¡%cT ²Ý©þåùVö0ôbódó´óáóÍóØóYô˜õî÷Lûÿ`ä˜ J3µ2ñ Ž s¾9NÛÿ‹ü¦øôñ¸î(îŽï ò9õÌø%üÚþíÅû­ N ¼ÖWz X~ðþ9û£øçöÂõõuô`ó2ò¬ñ ò}óxö³ú¢ÿ˜Úí ‚ Ú Ž Å è # c T ‰Ú¦üøîóÐðOïgï ðÁòHõ¼÷äùëûñýQA  l e"?ù ûÖmâýËûóùøaöƒô–òÈðóï‹ð–òöyú*ÿwŠ ù ¤ è D ¸   , ö ZÜâüø$ô´ñîð?ñ/òwó¿ôÒõ÷´øñúþLƒ ñ 4s\– Ž¢ÒØþžüúùÝö°ó³ððî£îãï™òsö´ú¼þŽ®VÇ < œ ì 4Í ö ÍÚçü¹ø¼õ ôLóDóqóKóBó¤ó‘ôLö_ùGý²\’ × vç2¥ w Ü‘þ×ú×ö%óKðºîÑîbð+ó|ö¬ù…üÿFpÁub ù âÓq€÷ Ÿ31þ×údøÃöžõ’ôšó¥ò§ñcñWò¯ô-ø­üuÊ c ´ î z ¹ ì J d Û¦œoÿÃúqöÓòpðTïÂïañËóDö—øúoü—þGxÖ‚ ¬Õ“n… Ï7aýUû[ùq÷gõJó‡ñKðãïãð°ó ÷Düþïе ú Ñ e  – ° & z ~p¶ÿàúµöó¼ññvñšòÍóäôö÷aù#ü­ÿä6 #ÑЀ8 i é¢9þ¡û—økõ]òÙï”îÜîºðÍó±÷Ðû“ÿÁワ L ã MÆ%ê y â|ûÜ÷oõÛó'óûòÿòüòó—ó õ[÷}ú±þQÀ  :cTlþ + K ™ÏŽÈ7ý'ùUõ òîï(ïæïÕñŒôÁ÷Øú¦ýÌÿ9›ñ® € Ÿû§ I (7ýhúøZö1õôÜòÁñ,ñXñ¬ò€õsù'þzØ Ú § ð ¯  u Ë ” ’ÓËýAù õÝñð¤ïsðGòÂô÷ ùõú¼ü*ÿVÙ M ‰AŠÌ | Ó{©ÿEýìúºøUöïóÖñZðÏïCð2òFõ?ù¶ý $ S F . è QÜ ¦ † ¸ þ¢ùøõwóæñzñÖñºò®óÁô(öî÷2úUý A Œ þñ¸ =ξ{ŒýAúýö¿óúðïÌîÂï#ò`õ:ùý@ùQaM ^ ^ 96ê>ƒ ÁkïþÉú~÷Oõô{óó¶òªòàòŽóMõLø5ü¨*[ Ç Çy÷ ¡  ž ׬þ•ÿ¨ûg÷Üó ñfï ïðWòJõLø@ûáýXÛu-V Q<Aù® ÀØ?ýGúøDöô;óòñÝðçñçó ÷Yû‘S ò ° ã ã © 5 f ± ì^FÐû¤÷&ô«ñ{ðmð.ñÀòÛôýöùûoýB«‘S adEÃÒ¬ /‰ÿ;ýÙúKø‘õíòœð<ï9ïðKóúöÿúãþÞ+§z í  ë –µ9 j ¢&ü„ø1õàòÏñ˜ñòÅò§óÃôHömø<ûäþQ "Ï > ÐËpÐÿ¤ü3ùõ8òÞï¹îêîðmóÌöEúý†JÆQË  ó?¢ñ š Á¦ýúF÷õ‹ó²ò/ò òòÅòxô‰öù_ýéK  ­=Êà ¦   '¥uý€ù­õRòÝïï™ïñsóGö ù‰ûêýªŸ¼ × c»Ñ±U . º(œÿnü¢ùM÷EõróòÔð:ððóñ©ôÀøQý§”ùg ° ` ¸ ¬ k Í ° ® ”Åqþú"öóDñtðð·ñ:óêôööù%ûïýhC% X âÅÁ µ h3ZÛþcüØù÷Uô½ñÏïï¸ï®ñÜô™ø‘üRÀ¸` h gב~ ? óhÿ*û„÷Æôäòò‡ñxñ òôòSôOöÿø&ücwö ¥)1+o ^ ! Ö‘ïÓþ@ûn÷ôVñ€ïùîÝï«ñ4ôƒ÷Âúåý «0 › Ç qD¹í ieUmü7ùµöòô’óXòñ0ñQñhòô÷Oû„ÿ¶³ l Õ‡ ] ù Éá>ü¸÷úó?ñ³ïjï+ðäñô–öù¬ûrþ66œ/ ò ¼8 Þwç‰þáû{ùC÷$õóJñ÷ï›ï¨ðñòöú™þì}? w Ý !w97    Š~ýÆø)õòøð˜ðñòaóõïöù‰ûÏþœ” Û ÓkÈ_ ± Cƒ·þ¼û”øhõ®ò…ð2ïï™ðüò ö¡ùeýû-ñk > « +ƒïD ÊB¸ýÑùœöKôÐòò²ñ›ñïñ¶ò&ô{ö¶ùý¾/. 1 @+᪠+ åX§¢IýÁù9ö-óÕð†ïVïZðuòõ9øû×þ»€¥  Y«ÿ/& >IFÿ½ûéø¬öÔôVó-òdññ‘ñ¿òõhø|üö\þª œ ™‘4} Š 3 ; eÿÉú³ö7ó»ð|ï§ïÌð£òïôT÷¸ùZüÿm P ñœ:Cs '&þˆû&ùµöYô3ò°ðõï ðnñ6ô±÷˜ûýÿà÷p ’  6Ý1Ày b R[ªûÎ÷›ôBòEñOñÏñ’ò´óõÎöMù†üQjl ßqå,s0 t ­ÔÿþÔú™÷eôØñíïýîaïEñìó÷Ûúsþ¯´›í ð £ Ï¾ÌÜ © ¥(Ìü ù*ö3ôøò#òÁñÎñNòYó÷ô‡÷ûÿo˜8 ŒÀç Q ´ ð©»w¡üÁøõðñàïï›ï2ñ–ó}ögùfüJÿF_ ‡ ƒÅÙ¸x L mZ¥þKûhø@ö£ôó¥ñ’ðAðñøòûõú™þ ù) ( ’ Jƒd× Ê . À„ȤýšùÖõ½ò¾ðùïLðmñ9ócõ–÷÷ùŽüˆÿöžc ¶ 6ܶ ´ ‚PæýÖúMøñõósñÜïfï'ð ò+õ$ùOý'y… ¸ ù aY™åT ¼ ÙŠþMú±öãóïñ*ñ1ñ²ñ·òôeõ=÷úý­ ~ ˜#K I äež‘ýÖùœö…óñ»ï]ïðºñvôøÜû8ÿ\/£ò ^ _Ä„q¥ õÕµÿÅûƒøÚõéó«òìñlñpñõñ@óNõJø üré& ­ŽvÒ˜  R LÊÐÿ<û ÷óñÓï_ï ðÕñWô7÷=ú3ýçÿ¨x…“ A@ö¤÷ ª@˜ýÛúoøùõÁó$òÇðåï7ð­ñÍóãöèúqÿ–4n ¸ ú y¥ó ÿ *fXüú÷‰ôßñ`ð!ðâðòódõ¦÷)úýJæ¾= êËKª4 . "2U“ý¦úˆ÷˜ôòðï7ï¸ð:óŽöjúWþúU F þ ‡ ž26I@ S ±E·üžøŸõ‡óDò¬ñQñvñòRóõ´÷û¯þç5 ¬"µlŠ 7 ú­öÍÿSüžøõHòðêîïPðÀò‹õ´ø,ü‰ÿš¢I› » ¢ k¤ p z;!þŒúž÷eõ×óŠòvñµð¤ðŽñ_óö‡ùýÉí„ f S%¿Ë 9 Y ûy—ý¡ùÊõvò1ð>ïHïYðnò÷ôË÷úFýBu¬± Ž ˆù=÷ h­ Îü0ú¹÷oõ^órñð|ïùïÚñÂô[øxü™€°! ( Œ b¯‚¬ 5 A _Šÿ ú–öó™ñšðiðÿð'ò¢óqõ²÷…úªý m °"#‰ ¢ƒ&ÿWüœù¿öÊó9ñpï|îñîûðôÀ÷“û^ÿÆÒgš … ®pÊ hPüÿºû ø õ óîñ\ññ1ñúñ^ókõDøÂû»ÿð, FÙ7¿‘u ý ³%¹þ8û„÷üó.ñDïªîzï^ñØóöù«üÌÿôW ‹ t\1"ð o >+`ýçù.÷õuó4ò1ñ‚ð†ðiñióžö¥úÿyCJ § ¦Ølp õ # ¡|º—ü–øÚôùñùïAï¼ïÿðãòEõ%øýúØýéRÐò “ Ò'ý¨Y . ×fÿŒüÅù<÷ õÿòñäïÄïxðZò£õ˜ù¬ý³b‘ï ¯ ÿ À9 -g p ÅÉcý]ùèõIóyñŽð…ðñdòôBöÂøxû¹þgE R ËÎ¥Œ Õ -Bÿ\ü#ùögóèðpï*ï,ð*òõ‡øVü£ÿäë‚Ü ÷ É÷bÍø  dÆþÞú ÷%õOóíñ"ñìðDñDòõó\ö[ùý(ae ¸ 7FUç Å i¾¸þDú{öó›ðNï ï ðþñ€ôŒ÷¯úÉýãå³q  PBçK˜Ö 7cíü¶ù÷ëôó¸ñÌðwðîð/ò’ôß÷Åûb) I ~4¬‘ Þ š»ÿrûf÷ðóTñð¤ïð ñ¨ó×õGøûþHüÃF ÀK—Ã+  ¢LÿêûGùÁö$ôÕñCðïËïñªó÷Ëú»þŠõÆ, D )Wà  œ Ð[ˆüjøóôqòñ¼ð ñ«ñ½òhôö`ø­ûqÿƒµd 'Å…SMA ¨ ¹µ»†þJûÝ÷ÍôùñßïûîIï¿ðóûõiùæüR²¶s Ý Ý EìÝð× Ø WXþEúýöŠôÒòÅñ‰ñuññ|òPôºöñù*þŽÅ ‡ >Ú…­t Ø Ô *)Ù2ý;ùhõ4òðïQïƒðÂòjõRø’û¿þ·ç(¶ MÍÀª ° P˜vüHù öLô€ò!ñðið,ñßòcõ¶øØüe¤ ä Æ ®Ó¬)W  Ì µÚvþ-ú‡ö¢ó„ñ7ððÐðòÉóûõ™ø ûäþƒ›  Yð5E{é ðm&þ!ûhø¸õaó‚ñëïïÃïÂñzôøûûòÿ™Ñ“ ª L “m ïN æ ÍáºÿŠû·÷ƒô]ò/ñæð5ñáñìòJôPöùÁü× ‹ _–çrK é B.þ½ý\úæöÍóeñ¸ïÔîFï ñÊó ÷‘úþROÝ ? VÙa¤, é#9ýœù¤ö-ôHòñÈðÕð]ñ¾òÖô÷û)ÿ•© ° /®de Q 6 G“ÿ¸ûø—ôúñðCï´ïñ(ó£õ‰ø§û½þÚ'MR °PÉ u ïféþ…ûnøßõ¯óÜñ´ðð;ðPñQó1öÖùþJ6} Ú € ŒúIþ ç /çK8ýù{õÐòñýïðñ‘ò„ô¾öXù\ü°ÿ<¦  ¶öî£i ’ xE*+þüúÊ÷³ô2òfð+ï4ïSðWò3õûøùü°_š.  ¿ ÇQ:zª ò ‹¥þYúÍöô#òýðÀðôð¤ñÌò­ô÷ùù·ýÐÙÈ 3 ZŠ¥ªÝ • C`Zý‰ù'öôòˆð(ïïðõñ…ô÷+û›þÙßÖ É Šáo¶î x ü´ÿÝûˆøÎõ¸ó'òôðzðÍð€ñÚò$õøzüœäÁ› ¢ ücI" G ˜°VœþÝú÷‡óñtïíî«ïmñîó¬ö‰ùŽüfÿF¥ @ ù°FvÔ ½J½…þUûRø¦õ`ó~ñ2ðµïðKñÄóe÷7ûŒÿ‡ùá 5 é Ò Ó  P d7ü"øâôNòËðcðÒð©ñôòãô9÷Ôùÿü°Š| O%±Zß   ž)ýóùñöôšñôï=ï¥ïëð?óföøùrý6°¨ý ) î 7ºd?  ks}ýªùHöðóLòñÈðñ¡ñâòûôµ÷5û-ÿ::“ 8 óÇ{* L K‘ÿðû0øËôò7ðMïnïÖðõò’õ¯øúûOÿ‹£¯^ ˆ L6?5 + ºËãþtûføÎõ»óò ñ§ðªð}ñˆóDö©ùŸý“L ( g  £ È !ÿ’ÆýØùSöWóþðâïáïÁðgò‡ô÷öùý1vû„ o Z›ÓÓÅ < +š+þÀú•÷õõò ñ´ïÓïêð¤òJõÄøŽüZñbH } ;7b:½ ) J8ÿûg÷eôòÊð¥ðñâñƒóœõç÷äúWþ « , ¦!^ËS3 e ^J«üŒùöšó=ñ»ï1ï»ïyñ)ôQ÷µú`þæ%?ó ˆƒÕLð Ö ª¯Œüáøøõ»ó ò,ññ^ñåñóPõ_øü&?k Û QÕƒª' ö qlØþ—úH÷6ôÌñ$ðïäïAñtóöù}üôÿ&Xd % UÕRé·^ K ®ãý£ú²÷ õó¹ñ¨ð=ðÂð òô÷ÐúÎþ­Xª  Ò ä<ÿ*é ² Ækq=ü@øþôròÐð"ðað6ñ³òÏôL÷HúŠý0‰þ1 » gXMG, I š?ýú3÷vô9òðÔïÛïÐðó1öÌùý3Ëåt Ž $(l-  \ 6 þúžöôIòkññ:ñôñHó$õ¶÷æú•þœ«L   e P ÔÇ|%ÿÍû˜øµõÚò¡ð¡ï“ïOðDò$õvø×ûJÿ·“h I ݽ½× [ ò-ÿwûø(õóŸñÖð©ð ñ*òÅóöVùý+ÄÏ õ '§;"¯ x Ų\ý¿ùLö\óóð€ïpïCðÎñ ôÜö¿ùÉü!šÞ ½ •ºS® D !¥¼ýrú°÷4õóZñxð4ðÉðDò­ôþ÷Êû™ÿiôÓ í ·Aæ÷ Q Ò rÔÿ,û·÷›ôò‡ð<ð©ðœñDóqõÞ÷Éú þ¦M¶Ø aÝjÞg- U "ÓÿHü@ùoöÜó°ñ7ð‘ïßïoñØóêörúbþ:Œ_Ç Í 6RÄ1 ô pk©üùêõ|óòKñ#ñ“ñ‚òáóÛõøÃû…ÿ~]¹ <  Ãó ­ þô¿]þéúÐ÷²ô3òvðï¤ïíðÿò­õîøJü™ÿÃåД Ÿ 3ì·‚F W ä@£þ$û øfõ@óÒñÛðcðÁð3òcô"÷“údþ`j  ô7ìÑ Q  SúQüÜøõÄòÁðàïãï°ð]ò•ôM÷Uú”ýé;p  ñ3F-6 U³ÆüÈùúöôzòñað=ðñèò£õùÝü^”J X ã Öʉ } ì¶)þiúÛöÏó˜ñsðð‘ðÞñ–óªõCøRû¯þl* Œ ÆÑÿS² D ¡¤l4ÿõûÓøüõ˜ó}ñ-ðØïˆðøñ’ôñ÷Žû ÿgˆWÊ  Ì®Ž° z 2“òÿUü±ø¡õ‚óÌñéð¹ð)ñ2ò ô«ö¾ù$ý×Êiœ d³P$… f Å£Pûýzú÷ ô¤ñ ð‘ï>ðÄñôýöú3ý`´ýØ I +]Ò_ ¢ 9hÄýaúC÷áôóËñóðÉðSñ«òçôû÷›û‡ÿe%K ¦ O%+¬¶  × ú¤æÿüû%øíôòìð9ðŽð–ñóTõ1ø1ûDþø6% • ^%ù  × ˜T ³ü™ùÀöFô\òèð2ð…ð£ñ¤óŠöúôý⇒ û p+<˜+ ð !Ã7ýrù=öÒóò*ñïð‚ñªò^ôö)ùBüåÿ¤D’ , þØåð0 à )8#Ýþ§ûjø›õ3óVñhðNðñ×òªõ ù|ü÷ÿPe h R Ƙ½ØÙ ø o¤äþ8ûê÷}õó.òeñEñºñøòïô®÷­úþÚ½* â Î ùgô¸ é Ä à¥Hý¿ùkö ózñ/ðòï½ðlòÜô¤÷ÕúþCI › ¦>x³ å ^Ô\ ýôùU÷úô÷ò‚ñ®ðvðIñó§õýøÌüÇÉž Ë Å»ö H Þã‘Ûþñúc÷|ôbòùðuðâð+òÌóéõ˜ø¥û×þ1¶øè u€Ü  Ëoÿ üÇøåõ¦óÀñ¨ðNð¡ðò`ôW÷Çú•þI}Xþ  v-K–ÿ — úÿûûRørõWóÔñùðñ½ñêòÁô$÷ÍùîüxžÎ i :œH• a oJ@úý¥ú™÷âôoò´ðð_ðÌñÔó”öÐùUýÓéÐC ~ i ÿ™"Ü   W¨ þ‰ú÷Hõnóúñ*ññºñóFõ%ø†û,ÿç¨ " Ò ÌøRì C E>ÒÿIüªøqõØò ñ,ð€ð—ñEóõø*ûTþ­÷Ù 2 ðõ¶”  î ©zÿ'üaù×ö¢ô¾òNñ„ð­ðÈñÇó‡öÇùˆý:Àø« ³ ü 2 €Q¬àý úxöÉóäñÏðžðpñÒòÀô÷§ùtüšÿðY£ € ™–¨¯Ñ ãã±^þ,ûCøˆõ+ó¡ñÑðsð ñÅòˆõºøqüýÿT‰ 3  PäÜí ( • ’ /ÿuû/øDõóÎñ,ñ1ñòSóõ÷úóýaùm Ï TÖ“ ¢ L ·®WýÚùÔö0ô ò×ðxðóðkòµô„÷£úôýUq?ã  ª ²6ÙY  PR×üÒùËönôÜòÊñ ñ&ñ$ò¢óÞõáølü žóä T ù ËÎb 6 «×wÜþhûøõ{òüð_ð¼ðÙñ©óöõøþûGÿÃÒ¤k – ÿ“=ä v s]Èþ±ûÙø]ö!ôòVñçð+ñ„òÛôº÷ôújþ5µšù ñ -žrÊ X ( gB“ üù*öÇóöñññÂñ+óñôU÷ú'ý}Ð1F Á §˜`J Ø °ý´úÚ÷3õñòcñ“ðð¡ñ ó]ö¨ùjýúMƒ ® L `êÈÅ ¯  µÜþ¬ú›÷õEóòiñ¸ñoòÂó¹õQø0û†þ ˜ û #"G•] d Î#FüÿÏüŒùVö«óÊñÀð²ðñóGõøPûŠþ±áä‡ ¼ kFFB¤ / ñoÑÿbü[ùìö÷ôgó$òyñ”ñ\òôósöù=ýÚ!ç Ü °²ß ;  pz}=þ¯úŽ÷ïôÈò@ñÏðšñóëô<÷öùÇüïÿ*# Ø Ù ÿvÍO í ìƒ>þ*ûTøö(ôŸòƒñFñÍñ%ó`õrø!ü·ÿA¬v ’ = T‹[Ð q  ŒÔÿü øÇõ¡óòLñ@ñþñdójõøÞú þ–0‘c   -Ãi" ¤‰“ý‡ú±÷!õóñÜðñòËô“÷æú=þetQÐ  à Í™W . p.šüýŽú˜÷*õlóqòòüñÔòFôOöéø-üÄÿpÿ t ú ÁÄ$Ê å •µ˜Lÿ÷ûÆøüõŒóßñíðØðÝñÒó<ö;ùüÁÿÒr I çÈt A ÜŒDÿøûûø’ö§ôòòüñßñUò^ó0õ¼÷ËúRþÌøa  Ê # \  E ,¥ýÅù²ö_ô—ò›ñXñòXó2õ´÷aúPýzÚ M#+l $ hYÅýÖúø¹õ—óò;ñPñ7òÇó-ö7ù²üŠÝž ¨ % WÜ Þ ) ¿Ÿ*•þ ûÈ÷'õQóòtñ|ñ`òÂóõ+øDû˜þzÁa J —åK & µÌåÓÿ„üeù¥ö)ô&òêð‡ð?ñÐò<õøTûuþ“Í“ý ¤ bc¸ M å ó§QüùlöbôÞòòØñ ò±ò<ôžö‹ùíü‚üN 0 u N Ç ¹ H|¥«þûÏ÷Þô€ò1ñÕðLñ‹ò€ôúö¤ùlühÿt¾ÆX L û¡H  Pø‰SþDûeøâõØóPò’ñañ¿ñó„õ_ø¦ûÿ£è  ² ˆ Ò ì ´3AìÿHüðø ö¾óòGñiñ9ò£ó§õ øòúýý*AM i í ˜Ç× è ” —{P/ý/ú]÷îô&óÈñÜððð/ò1ô¸öúdýÆú¦ ³ " õ 3–   Œ¶tØý–ú‘÷õ6óBòÜñ!ò%ó¥ôwöËøÁûÿš ` Ú ’ «™  ! ÎBv^ÿýû§øÇõuóÛññ"ñòÜóÿõÔø üDÿiFŒ y ï p$9 ¡ + EýiÿÔû¢ø/öFôÝòòÒñ6òbó&õ÷ƒúòý† É Ô ÿ b õ O 3 Ü÷·ýPúE÷„ôpòOñ%ñÜñ=ó@õ£÷\ú^ýo–•V Á › ªÈò H ú SyBöýìú?øéõ ô•òàñÊñ¦ò;ôöMùzü¿ÿ%Nø; Þ Ñ ° ¤ Ø Í“ÿ¯ûƒø¾õ¯ó`òÎñéñæònôQöÅø¦û½þæŸ Ç ?žW 3 ¬Êßêÿöüúc÷éô óÇñOñÓñKómõøûRþo„hø ' TF‡ %  Ž€×ý¿ùéö¢ôüòò òòƒóíô÷ßùäü?Ù  B ° {x§  Ì ?cZþ ûMø§õ“ócòíñòëòÀôüö¾ùúüå©Xß Ì NÞ Û  ~šTøþíûõøröaôó>ò òòÑóµõTøZû®þ"‘ª.  Û ¡ ¶ . - ·Ôšý¤ù½öGôxòÁñ¿ñ‚òàóÕõpøDû8þSu>Ó ò š _[w Ï œ Ò¯xLýyúü÷¥õ³óò(ò]ò@óñôR÷&úOý¸ © Í " À ­ 2  ½÷Ãzþ&ûâ÷[õžó™ò5ònòLó¹ôðö|ùcüqÿÐñ³&  Ð ô À œ ´ AzO ÿüù‰öfôÓòþñùñžòÿó0öøø÷ûÿZ‰?d  3 à ï 7 € " ñ¨ÿYüDùÃöíô¤óÜò‘òèòÞóŽõð÷¿úåýP£°E 6 u Ù Ó < 2 Ö%þúúø¦õ§óBòÛñ@ò{ójõÑ÷ú‹ý«£TÉÿ ¦ · ø ˆ [ z ¸’Sþ û{ø-ö\ôóCòJò.ó©ôúö¹ùÇü D+Û- Ä „ ª b C “ bã¥ÿ*üÝø6öô”òò8òùò…ô}öåø“û˜þ½ÕÛe c Ø K , ÉÖ°Žÿ‰üÔùa÷1õWóRò5òÁòÊó”õ$øèúèý0•w  1 ¼ ·  « á R.Âaý;ú÷WõÈóâòžòûòþóyõ”÷úÒü÷ÿ\­j — ' ì Û ' Ì â h©×Ùþ¨û¦øOö^ôÃòìñîñãòÀô÷úõüõÿ·ZïC õ + × ¨ … ª ?V?ÿòûùœö ô(ófò`ò ó0ô0ö¨øNû‰þ Dp e Ž Û  T Š ¤>@ý(ú ÷šôóPò òýòiô5öƒø ûåý¿¬½] k û é æ  “ K †r&ìü)úÉ÷¹õ#ôôòlò—ò‚óõ ÷ÄùÛüGƒ   Z    | º R‹·‰þ7ûCøÃõçó¾ò^òºòóõM÷¿ùdüWÿ]?ê’ € G † ¿ ò Í2ÿüfùßöÒôló€òCòºòô?öæøÔûÿ;‡± a „ ý à @ å í+ÎÿƒüŸù÷õ¶óìòÌò`ó@ôžõ×÷‰úý®ÉÁ[ l ð ™ l `   ޾Ëîýâú%øÊõÉóòBò‹ò”óxõÀ÷rúdýtv"‚’ 8 4 Å ¦ º Fuq9þûtø6öfôdóóùòˆóÚô¥ö"ùüpÿ•}A ö å 7 Ú ¬ þ Ù`ž‰ÿqü^ù öwôóYò}òOó½ô³ö6ùöûÃþžŠF“ € á t - C } M•¬¯ÿÃüúe÷]õåóó…ò®òÍó«õë÷Çú*þN^O  ÿ ¶ ï O ÷ 0 ûB¯ý˜úÒ÷tõ²óßòÊò%óþóŸõ·÷úþüôÿá°v¬ < * Z À q ` ]q¥þ³û ù¨ö¬ôLó~ò\ò8óÂô ÷Ùùªü“ÿ‰aý ™ ¡  ×  H™¢Vÿ(ü7ùØöõêóóÈòoó§ô|ö­ømûTþUVG» à < ñ Î 8 BÎmŒýžúð÷‡õ§ó–òSòÍòô6ö®øaû,þíØ¢ ü N ó  j "  ƒ¶»¢ýú8øSö°ô‡ó'óVóéóXõ÷øùÐüòÿ/+ÁÉ  ¶ Þ e M ” F…¯Çþºûùø¡ö¨ôkóØòóëóyõr÷­ùKü$ÿää ý 2 ?   …Ïþÿ{ü ú¦÷¶õ>ôKóðò`óŸô\ö«ø}û£þ­¤…Ù Ø / Ç ñ ± ðk„Zý×ùS÷YõôIó1ó§óÇôvözø"ûþßÄ| } » b  à Ê_Â:þ[ûÕø«ö´ôóóó ôÏõÿ÷ŽúLý6@ gT Ñ ° æ à ¼ à RÃâ®þ»û&ùÅöõôŽó§óNôªõj÷—ù9ü ÿ0u8 í ˜ „  °^§½ÿÃüáùK÷Rõìó0óó»óõ÷ŒùHüÿ¾{m \ ’   ‰ ¢BkMrý¼ú(øö¤ôÓó‡óëóõµöÂø,ûÜýå¼  q ¬ o ë Ð ë¢%Fþ:ûøJöÇôÝó“óÎóÆôKöFø­úpý,úžG ø È ò h ÿ  ÎW„ÝþUüÏù÷±õWô—ólóôtõy÷¼ùVü4ÿ0ã – Š Ø † ‹ Õ ¶€¸°ÿ§üåùo÷Kõô•ó¦ó5ôŠõ`÷yùÆûWþ<Øn ‚ §  ¼ ¸ ( ˜g¢ýûoøKöcôWóódó¥ôöøøoû(þð³0u| ÷ ˆ œ  Í Èhí,6þPû·øöéôô¬óÔó¯ôëõÖ÷CúüüÿÿÇNm Î … ¨ & ¯ ëÍ}Ü!ÿ\ü‹ù ÷õ£óóKó^ôãõª÷øù¤üJÿÒvÀ l h » x z ª ”>knÿ¤üõùŒ÷ÔõÁô"ôáó,ô õÛöùœû®þÕ¶ ¦ Ï /  i 9 _jwzýœú øëõeô‰óló÷óõ¾öÊø<ûåý Rîk„ æ § ¡ Ô y t¬½µýûÅøæö;õôuó…ó0ôÇõø˜úhýX5ÀñŸ Ä ¦ - Î Ê K 8ŸÉÙþÿûfù.÷Hõ ôó¨óxôÀõŽ÷²ùüÇþãçn¦ d w –  ) u I×H€ÿ°üúí÷ö‘ô ó\óýófõM÷wùöû©þYîn´n ¯ T V Š  Ð%dýÏú†øœöGõlôôFô õgöAøúFým‚9§] T ³ ž ú hhk”þÜû4ù·öÒô«óCó¡óÄôqö“ø¨úýÑÿqö›¼   e Û ’ ÿ¸!g¯þÚûDù5÷‡õpôÁó°óGô“õ\÷×ùüoÿ6Ó ¢ › ç ª R hw˜ÿ®üþù›÷»õWôÁóìó¤ôäõi÷hù˜ûþ¿€1­Ä å ;  " ƒ ±{f¥ýû´ø•ö÷ôòó†óæóÉô]örøÞúµýˆVéá P  a : —rãTþ‹ûöøÏöFõBôéóPô>õŒöIøaúÑü¨ÿe.Ùë L ï ¸ C * ½xñXÿÔü<úÛ÷êõ{ôèóÝóoôõõú÷4ú°üjÿ˜è Á œ  Ë ë E 5Ù2Hÿ–üAú"øVöõHôô›ôÄõJ÷@ùžûEþÚŒ¤k ‰ æ »  Ñ 3¢ÈÖý<û´ø‡ö õ8ô(ô„ôŽõ ÷ùGûÊýŽþc¦’ é ã # ­ h jçT›þàû´ùÉ÷1öèôôôôôSö7øŸúMýVGÕí­ - Ê Ÿ G s ö@æûÿMü´ù~÷ëõ½ôGôOôåôüõ¼÷îù]üÿûº2O í ÷  Å Û & á`ÎÿGýÑúø·önõ—ô]ôÅôâõ†÷¤ù(üÃþpš¤K \ Ï ª í ¨ íÍ4x±ýû£øÞöŸõäôºôõ×õ÷ùXûäýÌ“n5 ? ª ­ ( ä ()ì7¦þ üùb÷ÂõÎô}ôôEõßö¶øãújý¿JtC f Æ ¬ Î  ËUºÿmü2úLø«öXõ°ôÆôIõ:öß÷ú›üLÿÙ' – w Ò ª Û o ¤QÐ%Dýjú?øö4õ™ô¦ô3õYöï÷Þùüþ.²!Qö  ¤ t ¦ g Ç«1p¹ýVû9ù_÷ö!õô»ôžõ÷ ù•ûUþ(¡ÒÁw t  " ¶ Ö vz-~þ‰ûù@÷¼õ¯ô‚ôÖôwõÄö¬ø¾ú ý­ÿd÷#0 ± Ÿ   ‡u4ækÿöüŠúcø†öSõ{ôƒôNõsö-ømúæükÿíb²‰ï þ v F • \ €Lzÿ×üŒú‡øýöåõõæô:õ(ö÷uùÇûAþà{ c) 2 ~ U s ! nf'ÎHþ¹ûEùM÷ÚõùôÒô õôõ÷ù°ûþh{ D 8 m ó É CMß9¤þü²ùë÷šö“õçôðôaõ˜öeøàú ýOÊ·ô Ñ U ò ú  ÇyúŠÿý}úø>ö-õªôÖôõÒöaøHú¬ü<ÿÆûW   r +  ¼ê²Tðÿˆý ûù?÷ìõ õÀôõ!ö–÷¹ù?üäþfÍßÅ\ W è é ~ ` špòD¿ýkû:ùE÷öõ>õ^õ:öµ÷ù¤û þK³CŸ^ £ -  o X ×ÿÐs#ÿü úø^ö4õ›ô¾ô¤õñöÂøöú?ý¸ÿ0‘Ù° â ' Í  ²·DÒ=ÿ³üFú;øÃöðõrõ,õuõ“öøÕù#üîþ±H² ÷ · Å r Ï Ð®€ xýíú²øèöõÝôõô€õöøúü{þá[×àŸ n Ë Ê  î31ÊE¼ý‰û{ùµ÷Yölõ õõËõO÷(ù[ûþƒúD5è º À ] ) ˜©f!­þ*üÝùøœöpõÛôõöE÷ùûBýÿùi¨r› ¡  Ñ ² 9S%ÿÖüºúÝø÷ÂõõÎô,õDöÜ÷Øùqü ÿŸGß< B Õ £ ê ¹ú°&¨ÿýëúù÷Bötõ@õ™õjöþ÷æùöûMþÏ;k^îô  ] o `ûÞ³v þ²ûù¼÷=ö3õÜô/õ(öž÷jùŒûöý4’Õð• X  ü‹¨YÔUþÞû¹ùô÷¼öÞõpõbõÐõßöxø”úõüoÿîc’V§ Y ƒ ) P è÷»2ÿÙüŸú¶ø÷Äõ%õõªõöö¬øtúªüùþ>tŽkúF ¶ s ¥ HŒbìÿ…ý'ûùˆ÷}ö õ5õ¥õlö˜÷lùÂûhþöWž Ú *  ˜ ÂWO¤þý¶û­ùÑ÷Xö´õxõÓõÃö%ø¬ùû«ýûÿ[¶èÊ ­ ™ Ø Õp£g+ÿÏü£ú¨ø÷ßõZõeõ!öo÷ù4û‰ým¥Å‘µ u › / 6 äÈoÿàü·úÕø_÷=öºõÓõ^öN÷ÒøÒúèü9ÿ}²ÿ` J À ] [ *Žž\#¼ýŒûùž÷[öõTõÂõôö²ø¹ú§ü¾þÖõï9 Ô É ô §êòÑ2þñûú_øõöõõ­õ#öãöø»ùãû!þa©ìõ„° 7 j ! = Âõ¹HÿÔü®úÎøS÷'ö™õ¡õqöî÷¯ù«û¿ýÖÿ{•Z» § ë q k ËêèÀ›ÿ‡ýiûsùö÷–öÏõ»õXöZ÷ÕøÅúñü`ÿØE6éI # _  Y A¬¤y8´ýwû·ù#øäööòõ‹ö~÷âøú‹üšþïŠõÅ ` m õ ÎæºŠþüùù8øâöýõèõXö÷Zø-ú;üvþ¥ÂþäRm ! P   u²šOàþü„úÄø\÷zö ö ööÅ÷^ù^û˜ý÷ÿk“;Ì ÿ X : ·ÖÙÊŒÿSýMûùÕ÷‹öáõ öäö ø›ùzûšý†ÿxÔÿ¾ Ó þ 7 øj| Äÿ›ýû³ù?øJ÷wö8ö„öi÷{ø1úfüäþ;†ªS°Ç P  “ …ð¨8þêûúlø,÷yö#ö.ö,÷¤ø#úü þ%_‰_ù7 Í ö l jhVB ÿ»üÁúùÙ÷±ööéõ{ö£÷yù®ûÕýÓÿû@ §×‘ Ô ‚ ¤X²à¾kÿ8ýû?ù®÷®ö ö@öèö®÷Ãø~ú¥üöþ~µå¤ûÂ Æ ù¶3½ÿ[ý8û‹ù;øôöWö3öwö6÷‘ø{úƒü®þ'?ð²öŸ ñ ` (¶¸q0þ¼ûúùsø9÷{öJöröþöøÁù¼ûåý;k•pÿ: ë ì / ù¸4]Bÿ²ürú²øl÷Šö4ö„ö÷ø—ùfûbý—ÿÛÈjJÿJ W Ã`‡¨z9ÿ'ý3û›ùøÖöNöjöòöÄ÷ùàúýÿž¾»j‚0 i CQáá pÿWý$ûDùÕ÷õö†ö’öõöÃ÷ëøjú9üEþ~¹é½ ¢ ¥ þÊP•cQþ:ü5úrø÷JööQö÷'øÜùÏûþJgPx[ä ¤èóX(ðºþGü ú‘øv÷Ýöxöö ÷á÷2ù û-ý€ÿÍÝÑbV× â5ºÁnSÿ-ýîúDùÙ÷Ìö0öAöÉöÁ÷Cùû(ýÿ9]1ã%ÿ_ > ŠrÆóòšÿQýmû¤ùø÷¨öÁöD÷þ÷4ù¦úaümþ®°Èšï¾*H cS4ìýÄû3úËø›÷öö¾ö÷–÷ÀømúMü5þKYN!Ëßm p õÓhÔñÈ¢þ™ü¶úùÆ÷ÿööÎös÷døµù}û™ý°ÿó ø‘síì©æÐX¥•Jÿ'ýûUùø÷÷­ööüö øµù‰û‡ýtÿL/ó™ü3 çJC¥­áþüSú÷øÒ÷;÷÷G÷í÷ùú@ü=þrÙâýÔ? Q ±ŸU…sZþ<ü9ú»øë÷Y÷ ÷k÷ì÷öøOúàûÑýgšMŒw úž·dÏü åþÝüâú?ùøs÷÷M÷øùKú÷ûÝýÁÿÉç’. S ÑïlšžkÿNýkûËù{øš÷/÷I÷¾÷…øxùüúý;ÿcª‘Ûâž Å)1Ü  ÿýüaú;ù5øq÷X÷´÷TøkùäúíüØþ¹Ä]UÛ ›õY—°Ñþüü*û—ùAø‚÷.÷u÷ø5ùªúnüNþPgY†“ ޼kÐ>ÿìüû¼ù~øÂ÷}÷¥÷3øùƒú&üÕý¶ÿÐóÔIgõó|êÖ\ŠÕÜÿÜý üUúÓø¹÷T÷Q÷Ù÷ºøöùžû~ýnÿ›ÌŽá ¯Ø½9BòÖÿµýüpúùCøÜ÷÷Æ÷‚ø“ùûý!ÿüãŸÅæÍTŒ'[›Ȭþãü>û•ù?øs÷6÷_÷'øùûªü|þ‚XѪ©zݘèϬ–þ»ü2û'úù>øÓ÷À÷øåødú)üÛýËÿùqÄ÷ƒ…@® !^¬ËÿÛýñûLú÷øø÷™÷ ø÷øðùoûWýGÿI-ÈD€îÙ²B¢Öôÿ&þ<ü±ú6ùü÷/÷÷÷UøzùûýÿÚÓÆG=ÿ[Aê)ã6F.þ<üÚúªù”øø÷Æ÷Û÷gøiùû¸ü~þ;â„ø%Á¤Øa­«×þ>ýœûüù¿øÛ÷÷ƒ÷ÿ÷ùúYü#þùÿÏ L‘_©xä¼Á­Î ÿBýîû“ú9ùø”÷‡÷ë÷Éøú–ûcýOÿQE y~7‰<§;PƒäÿþLüªúHù2øp÷B÷ê÷ÏøãùNû(ý*ÿÔn$Ì .ÓÁ- þRüÜú´ùíøbøøâ÷Qø'ùú_üBþ3I‹ßÑ<BòA-Êíô ÿýZûúùPøÜ÷Ô÷Kø;ùú.üíýßÿÅ„n‚2[Z\ð6[lÿ{ý¤ûKúHùLøž÷Œ÷øþøNúùû¾ý–ÿ‘jñ.£gžjßè¯ÿ­ý ü†úaùÇøAø2ø‚øAùNú£û3ýïþ¤[@ãáN‘Ò„ùúÿ/þ‹üûÈùÀø!øÜ÷ã÷Yø—ù&ûèüžþk4âg¨¢þÉü}¶À¨þÇüûØùóøMø øøløù=úÝû²ýÅÿï¹Dôn¾‡Öä ÝfÿÅý4üÉú—ùuø¸÷÷`øYù[úØû”ýnÿÒdâ÷N!h!´ú&_ÿ¾ýDüÍúùžø+øû÷1øÚøêù_ûýÔþ±s…‘ní”â§-/7þ`üÙúœùÈø+øøø*ùúIûÝüƒþIÔYyMµÓ€˜] sœáþý`ûñùôø€øë÷ ø´ø¨ùôú]üþ ëš%>ëa¾ŒîþÔMflÿ–ýñûqúGùøTøJøšøhùtúÄûnýaÿGêfËÝ’è¬ý.çZÍMþ«ü7ûêùéøCøøMøùCú©û7ýÿç~ìS}B¼Ùv¢lÚû Hþ­ü`û`úšùóø›ø©øù÷ù(û»üþšb¢Ä=T¤†ŒÇáþAýçûúNù„ø.ø2ø°øÝùmûýþ‡¯É舸¨D¾Blÿ¯ýDü ûØùøøƒøŸøáøtù³úFüÞýyÿ:óUW_dΜ  ¸1•äÿ?þ}üïúÆù÷ø­ø øäø¥ùÄúü€ý*ÿ¡\÷m†Aƒgø'5Ú3V›þôü¢ûzúoù¶ø‰øÃøuù›úêû)ý­þ¡kÕ@bzD-ïe² ÿŒýüéúæù*ù½ø·ø ùúhûÜüþ4àQÚŽ‡C¶¯_Ê4mÿËýFü×úøùGù”øcøÏøùÚú{ü,þÃÿDàjyRB­}ÖÍ@ÉzþæüNûøù8ùÁø¨øíø§ùµúçû…ý ÿ}(mBækhÑíìj³“þ ý·û‰ú“ùù¶ø¹øAù9ú¡û ýœþ,à‚Øýå[añ&¯F©ÿýüªú¾ù$ù—øwøùúKûêüþD&¸çËwòé¼uÊ·ojÿqýèû¥úÃù/ù÷øõøkùCú3ûRüÂýZÿ'ÞWjNpcàÇì,²ÿ%þžüqû…ú¢ùùöø4ù¨ù˜úü¸ýJÿ¶þýö€ÿÞDe®KþÈü™ûÅúèù!ùÃøÂø7ùDúŽû:ýÿÊ5­æ´c:­ÜÖœù3±þJýü$û;údùéøëø]ùXú†ûèü}þ ‰ë1K?è0ð6¹/ÝcÿÚýpüNû3úAùÉøÓø;ùßùöúyü$þºÿA„Ê8Pð7úFIöwõ_ÿìýüHû:ú\ùóøÜø8ùéùçú3üšý ÿ¼C¦ÊÓqî=AÓñÿ?þ¶üˆû úàù)ùïø,ù–ùlú›ûýÍþõqŠyCy6„~>³?®þ3ýÀûžú¹ùùÉøÍøLùÿùû™üDþÎÿ]v{SÀ݉Öð¿>ÞFÿ‡ý0üûúújùùúørù?úeûµüþ¹ÿMÓêÕŸ)v–1Jªÿ<þêü–ûoú²ùJùùLùýùÖúü~ýÿ•!¶ y¶ Š’HÝFxþøüƒûyúºùùwùŒùúÖúãûNýÿ¿&Mƒu3‹©\pY*ápÈþCýüû úzù6ù:ù¥ùxú˜ûÙüþ¨ÿgó%C J0þ°ÚXÉÿfýüÿú>úÒùŽù£ùþùaúûlüÿý©ÿVÆëßÑZ†iõ%ÞeÓOÿÖý¥üuûkú–ù)ùùTùúû^üÅý9ÿÐ’çð¬¢$`bÆÿ5þðüü1ûiúÔù«ù×ù'úÝúäûý–þ4¬òýþð`w3Œeít±þkýPü6ûNúŒùKùUùÂù–úÀû/ý¼þ;ŸKFíDyS¯Î™m÷þ¸ýmüLûdú¨ùCùTù¬ùXú‘ûÃü.þÂÿO©ð Ì" ñExŸ±NÅÿOþÌü„ûúùùÌùËùúÂúûüŸý!ÿÐ.O“¨Nsu 3›BäÿVþýüû<ú®ù‡ù’ùþùØúüý3ÿ¿EŽ…Vý*ä~Á‘øgèþfý=üPûjúþù¸ù¤ù!úû(üBý¢þ l©ýöµBw:’È­K±QÿÖýªü¯ûÙúñùù€ùÍùŒú¡ûýlþ÷ÿ~Ð0 ‚œK²áË_ï}ÿûý³ü­û´ú úÏùõù!úÄúèû:ýþÐÿL®‚dÔüë‹éÛy5ñþ–ýü€û•ú úûù+ú®úˆû‘üÖý/ÿvãh¯wZCÓ%, ákÿÞýºü’ûŠúæùÐùôù_úKû…üŠý«þþÿ„RFô=/ÖY”]å•ÿ1þËü¢û®ú+úúGú¦úVû3üUý¦þYk¥™Š!Që!b`1öÿ·þqý3üû>úÞùÌùöù†ú›ûáüþzÿßA„‚HëE,«ÌôËkõÿ°þný5üIû‘úúöù€úûÊûÀüþLÿ‹ÛFh5ù ëö´U*ÿñýŸüûºúúÚùú‡úNûwü×ý&ÿ]«ÞôùÑ,Æ9j*ú†+ÿÓý¹üºûÓú9ú)ú|úÅúFû+üVý{þ­ÿÕÑŽ7AÐ7`p¬ÿCþàüyûúúóù%úšú8ûæûÓü þ¨ÿûX„~&¤³3upZ#×þÂýžü”ûÎúNú!úTúàúÐûíü/þšÿÞ „³•PØ.ÁGúþºýCüXûÀú;úúOúÂúû{üªý ÿg… ò£¡ è±oCÿ.þý·ûúú§úVúGú¨ú:û üIý®þ D½–Ž­˜ø>)ú¶ÿŠþMýüøú~úPúmúÉú–ûqü[ý~þºÿù6P7õ£×£]°‚I­ÿFþ>ýSükûyúùù½ù$úúúéûãüþqÿ¶ÀÙ ö|Ÿ}#¨ëð©Ríþ‰ýCü;ûú}ú‹ú¥úúú€û:üaý«þ“ÐÝšve‘âÌ«¢“ÿKþäüëû!û™úLú…úÒúEû=ü[ý‘þåÿ..$ “¢hÇëÔ¤ckÿcþýöûû­úkúRúàú‡û(ü,ýXþoÿ¬ø·iJ=]ae@þÿ¶þ[ýDü—ûû„úeú›ú û£û¢üòýfÿ£·âÿÎm¢qí6„Q ±þ…ýOüzûåúdú7úxúûÁûÐüþ>ÿU{‰…CÜ-#Ê]¾É†4ÿþþôüüPûÕúqú‹úýúŸûyüqý¥þôÿ*st8ÏÿùvÀûÿ¿\ÿ*þýü9ûûÒúÉúûŸûwüxý”þÅÿ鿿܉ùYC™Ú&ÛËÿ¯þwýü­û&ûØú³ú«ú0ûü ý,þRÿ¢²Ê΋æ2DøZ‰x½ÿ˜þ‘ý˜ü²ûûãúÎúÕú<ûüÚüóý,ÿf¦ß¸{røX£ÑĨ9ÿþåüÓûAûàú«úÑú2ûßû¼üËýüþ,Zk-”ëæ|ƹ¶8ÿþýüoûûãúû>ûôû½ü~ý‘þ¦ÿ÷M‰Jó6A¨û͘ÿ„þ£ý³üÖû,ûÏúÒú!û–û]ü4ý1þCÿ´ô#Å÷ïÆvñGœŸ‚SÿòýµüèûBûÉúÉúùú€û:üýñýçþ@Çèêã#úV|rT)ìþÉýÛüûû^û ûèúëúSûûûèüßýÊþáÿ)Zl&È^+™¤ÉÁ|Bÿ2þ ý&ü‘û(ûû"û‡û$üñüÙý¼þ¹ÿàD<ÁèêÝv¶áÓyÿTþWýwü­û%ûÓú÷ú`ûüÒü½ý¸þ´ÿÈÊÚ eê3{œµõ$çÿ³þÃýØüúûZûûÞú û–û,üý6þ“ÿòð¬9žËÎ iQãþÚýùü,ü„ûû"ûKû¡û=üýþÿ?|HùKrfæV ”Z,ÿþýNüÎûWûû2û®ûBüäü³ýÍþRI9çk«ÒÂ;‹¬§pVÿFþ=ý]ü¯û:ûòúçúBûþûÈüý¡þäÿþÀŒŠF·ò³OŠÉéðÿ×þºý³üáûOû û(û`ûÙûxü`ý5þBÿUƒ}b?¨ÌÄ‚ÞêÿÂþ©ýÀüøû†û4ûþú@ûÐûRüûüÙýôþ-Igs1§‰l/¯%hˆ…kÿ'þýühûûû^ûºû=üéüÂýêþ* è¼b­¹rº R€ž®ÿžþýüüûžû,û-û¡û5üãüµý½þÞÿà ÑŽó?|e~µëÿ¶þý‰ü¡û3û"ûû{û2üîüÅý¨þ§ÿ®ÇÃyþs¤<°Ë­ºÇÿÆþÉý ýrüÖûiûAû—ûôûŠüqý€þ`ÿn”6ÂI››FÒ.bA$ÿþ+ýpüÜû{ûBûOû­ûMüý×ýÒþìÿ-…¶^´l¢£¡ÿ’þ}ý¶üü±û`û}ûÜû\üíü»ýÁþ½ÿ°·µmæ4K\´ø­ÿ~þäý!ýlü ü«ûdûžûü“üLýgþŠÿ¥¨¥køWŠŽa³ öÿèþúý2ýrüÒûû~û¨ûýûªüý‚þ^ÿ7:p0¥0»Œ1Æ,Y[{Oÿ?þ7ý{üÙû‰û]ûZûµû>üëüãýÿF2"þŸn²jÈA}‘…ÿ™þ½ýÊüü ûoû†ûÑûJüåüÀý¸þÌÿÝ÷».\L*ÇQ–˜§§ÿ²þþKýmüÑûjûCûeû üÉü¸ýËþÔÿªo`Vñ-NFÞEœ¬Á»ÿÃþ÷ý4ýwüüûÇûÅû°ûìûŒüUýLþ8ÿkt]Ó2Y-ë›Îå ÿþEý—üîû{û~ûËû2ü­üxý~þUÿÔ‹ø+Ò\òYu¨¦ÿ‡þýÁü ü¼û´ûÀûèûrü#ýöýîþéÿáØxÝ),ݪk¸˜TkÿšþÍýôüTüöûÌûÜûü¬ü/ýêýÿ%òrNà7d–èRŒºÿêþþ^ý³ü1üËû¯ûÒû:üÖü¿ý—þ6ÿ&`i’íìÂrÂLL>ÿUþ.ýküüØûÉûëûUüßü›ý^þ:ÿ ãèä 3„`ÍJžÛÿCdÿ\þuýÐüJüÝûÆûÒûüxü5ý5þ ÿÿÉ9¦äârøiƒÀ·ÿ‘þ®ýúübüBüüñû;ü·ü!ýÞýåþàÿß±h‰çë§!v®Çåÿ ÿ÷ý ývüøû•û±û<üÂü(ýÉý”þ»ÿ·*ä{á.?ä"w³á!ÿ5þqýÐügü#ü üü]üÆüoýEþ&ÿ$,ú…ú%/õ—õ  ýÿÿ-þ‡ý·ü?üü üùûNüüüÆýþ7ÿ÷ÿØÚ9¿4&»„!5"QaÿHþiýôü—üüüNüWüÃü´ý€þGÿ²Ná{Øù¦9iq‘¾ÿÊþøýUý¼üJüýûÙûûûhü@ý2þüþ›ÿ’І;—ÍöÍmðB Ú $ÿ7þ^ýÚüGüìûéûIüåü-ýÙý³þoÿùïÖj²ÔéÊF¢ëæÿØþöý1ýªüNü:üVüdü‹üôü”ýbþcÿRW ÌS~и|Å2,(ÿ#þmýôü–ü9üôû"üqüçüýBþ8ÿFÆb‚œ¯Ân¾H¡‰ÿÏþ+þjý›ü üßûÅûÿûƒü*ýûýÿúÿ±‡DÙ8¹ß™1ÎE‡™ÿ«þÐý ý@üÃûÆûühüîü‚ýõý—þiÿh?Á< f$ÛIn‡kÿŽþìýkýåüˆü-üéûÝû/üèü—ýIþ:ÿ7ä­†9’’y*”&² Bÿ…þžýÇüAüüüOü¬üý‹ý"þ ÿÞ’ú<¡ˆkç,33ÿ@þ]ý¬ü;üìûÍû ürüñü~ý#þóþ×ÿ«^’iŒpCèS—¯Îÿéþþgýêü£ü/ü üiü¹üTýþøþÒÿ»„-¼7D$ætéH”Üÿ!ÿuþ¼ýèü[ü.üü]üÕüYýþÃþwÿ$õÄf ¯¦j‚«µËÿùþnþÉýGýäüÁü€ütüÏüIýÊýBþÿìÿ°¨mÿOŠX Îd¿ü5[ÿ„þÛýlýëüyüXü^ü•üþü•ý'þÕþäÿï¾Pk³ª‰*Œè,D~ÿ¾þþfýÞü\üü1üŽüý¦ý^þ&ÿæÿ°{ª3x{p%Ï:{Ïÿ÷þ(þwý¦üZü9ü[ü£üýEýäý°þ‚ÿsU,·#sœfC€¹"ÿKþ³ý0ýÈüküCüfüÂü\ýþ¬þ‰ÿWÃy _ODío÷5@_ÿþÝýRýýüÞü¯ü¤üâüVýÓý“þ‚ÿgDî† a{ކÇE™ÿÎþ:þ¥ýýÁüwü}ü±ü=ý»ýzþ]ÿ1ñ›%™¦í¸WÅ <~¶ÿ ÿQþýý”ürü¨üûüdýãýlþïþÂÿ²~%¹=š¬~e”ìÝìÿýþ+þ…ýýÌü²ü¬ü°üþüvýAþ>ÿÿÿ´œHËL©ËIË^ßÿþ5þ‘ý:ýýØüóü)ý†ýâý¬þ›ÿ€>°9–º¸r&’ä.s\ÿþäý{ý&ýãüäüýýTýÕýŒþ&ÿÝÿÕ©~4§çؾV½)…ª¯ÿÕþ.þrýûü×üØü½üÍü|ýþÕþ’ÿ<ÑsçaßOv|]æE|¯Ùÿÿtþäýsýý¹ütü›ü'ýÖýpþ9ÿ8÷T¼%_}y7ÑI¼ëùÿ:ÿžþôýWýôü”üü»ü#ýµýOþÉþfÿ^=â~OHieÒ‡×üÿÿ|þ÷ý}ý ý¤üFügüÐüJýûýäþ˜ÿƈ‰A¡>ÉŒçAÿ¢þ þtýýÖüœü…üàüYýàýþTÿÒ†ôxíÕ5¿*o¨ÿÿhþ±ý2ýßü·ü¼üéü7ýçý„þ ÿÂÿ‹3Ý{ò'.L[¶G­éÿÿuþøý‚ýæümü‚üÕü5ý°ýSþÿþÿG+ ¤è>>«o}¤ÛÿÿZþ¼ý2ýèüÁüüƒüÞüxýþÎþ¦ÿi ¶fÏ)*¯>žÈÿ"ÿŸþÞýdý7ýÐü³üÖü\ý—ýþÐþaÿ›c$ÕOb9ÿ¹aÇ@§ÿðþ1þžýý¹üÀüÒü ýBý–ýCþ=ÿÔ¶U°ç 2L‰_Š®ÿÿ‰þÕý&ýüüîüøüýTýÐýNþúþÔÿÇŠ¦ é¨:•×ÿÿ!ÿcþºýIýýèüÍüïü6ý‹ýþËþžÿJЋê)(ì§q&„Åäÿ-ÿ‚þôý€ýMý4ýý ýøü,ýýWþQÿ!¹LúXhBÛR°ü([ÿÎþÿýAýÀü|ü™ü²üþü‰ýþTþÿúÿâˆb´Ýÿ!ù”Ûþ MÿËþYþèý\ýïü­ü›üÇü<ýÒý“þQÿÃÿiM ˆô@O#âˆ/lµÿÈþþ§ýyýBýùüÎüßüý¨ýaþ+ÿÂÿaº+Ÿ*ò¶jçCŽúÿrÿÁþþ¡ý(ý¿üÌüØüýüZýþý©þÿp.µðoÛ&'¿ô:~ºÿÿˆþ þ ýý¬üyü¨üéüHý$þÿÏÿHÆaÍEØCƒnåM’æ&mÿÝþXþÃýýàüìüÕüíümýþÁþXÿä„ €×%5õnÇ"h¶ÿæþqþ"þ‘ýúü­ü¶üçüLýõý¤þSÿÏ•3š×FE-§_¶îÿÿLþÌý…ý@ý ý,ý5ýýïýtþ)ÿ6†$”²½üá~ýŒã:¤ÿÿ€þþ–ýHýWýlýoýÎýFþÏþkÿBÙ_ú“a]A×?¾ôqÿ·þúý‹ýQý8ýý ý)ýuýþÝþŠÿK&èwë/6<DèH±ò*„ÿâþ%þŸý‹ý^ýLýPýšýþJþ±þmÿ ŒFâKÆ%0ò[Ë@Êÿ)ÿyþËýIýöüÉüùü/ý’ýüý‡þ5ÿÅÿ“+îwÞéÒ¦M¾äþÿ&ÿ”þ*þÔý‡ýTý;ýKýŒýþ§þ ÿ—ÿ^ý‡îxû* Ò¨a²ípÏÿèþ>þ½ýGýÉü¶ü ýRýÚýbþÿÆÿŠª0žÿC]­?§ a²ÿÿ•þ5þšýýðüúü'ý…ýCþ×þÿm$©5¬þóéªWÖ]†Àÿÿsþþ™ýFý=ýVýpý¸ý"þ—þÿ°ÿX,Û|ñ'AD´+“ÙüÿEÿŸþþ—ýBýýÚü ýmýïý{þÿÁÿ|<×yÞþû»kåh½‚ÿßþ;þÍýfý4ý)ýKý“ýøýiþóþ©ÿTÖrG”ùÕûM“ÿÙþ1þÆýkýüüÕüØü?ý¶ýaþÿ™ÿAÔRÚA¯ÅÆÑ˜%“bŽÿÇþ/þÌýlýùüÁü×üýýûý´þaÿ#Ïjë`ÄÞ¡5¦ë<¬ÿÿþ6þ¸ýIýýý-ýsýßý|þýþ¦ÿN Á7vÂę̀qúJšàÿÿkþÙý‹ýCý)ýEý,ýKý³ýfþüþ½ÿ‚=Å0àõå¸9¨]Ëÿ/ÿ£þþ²ýdýýýCý]ýÍýhþâþ‰ÿ#Ò•y·÷ï«3½H¨ {ÿÿXþÄýEýèüÊüþü@ý­ý6þ»þLÿáÿ…3ægÄÇ”y;Ï] w–ÿ¿þ3þŒýýèü×üý9ý“ý#þ¿þWÿ £MÎ1‚%ù»LÃ|ÿôþ‰þþ”ý*ýåüÖüáüBýÁý+þÌþ£ÿŠ6¡Çñ×µ|ÁüoüÿOÿ–þòýqýýãüôü.ýoýÐýyþÿÊÿ‚âYýXu­Ê¥7¦„êÿUÿ‘þÜýfý/ýåüàü ýYýÈý,þ¨þMÿ—+ÃSx»¶ŒõrìE‚ÿåþ>þ¸ý/ýÕüßüýwýÓý(þ¦þ ÿÿPÝdàË|,¥ùkôÿrÿÖþSþÉý“ýlýóüäüýfýÔý›þDÿÞÿlóxÎ lÁ¸(£LxÿåþhþÓýýSý4ýEýPý€ýöýkþêþœÿY§v¹»ŽLçfËT²ÿøþ]þ þ„ýýøüùüý%ýýþ£þ0ÿÖÿ•'¬q“{w2À2úÿTÿžþ"þ£ý#ýÜüÎüáüý{ýþµþdÿ‘"™ìV¥±\ôqÅ4ÿiþîýÑýýýßüýü4ýlýþþìþ—ÿNüŽ8¿ë÷Ëlômá>|ÿÝþKþÒýiý5ý ýý4ýý þþBÿûÿ¹Pšág¯šz“ e¬ÿðþSþþÂý›ýcýYýºýìýþ€þ(ÿéÿÒSÆK{–¹–WÎxºÿÿ\þàýqý<ý ýýhý°ýìý8þ“þ(ÿýÿà©S¸þæÓ‹$³Qš‡ÿÐþ&þ›ý<ý3ýFý`ýýÉýAþûþ¯ÿÃTá|̸¹›hmôrÿíþˆþþ}ý/ý#ý>ýrýéý_þÿ²ÿ,"¹!ƒßà¢QœoÏÿ&ÿƒþ4þãýÐý¹ýŒýuý²ýþhþèþ¹ÿ|ò·a£·ßá¬dôj©¶ÿÿ‚þþÄý•ý®ý¬ý´ýÒý0þíþÿ¾gë0n·¨i3˜Q•ÿÿ]þÐýýoýmý~ýÆýþŽþ ÿÃÿŒCÍ&kšÂæí·FÉ0>RÿÔþmþ þÓý¹ý²ý‡ýrýŸý6þ£þYÿ@ù“2˜¹ÛÐÁ¦mç9\˜ÿàþ`þþÒý”ýý†ýžýáýCþÚþqÿì“Þ K¹Ì« ]wÊÿ?ÿ»þ!þÚý¹ýqýWý‚ý³ýÓý.þÿåÿ¢lñR¢§†rô:‚Çÿÿ™þKþÿýÆý©ýqýjý“ýÒýzþ ÿÑÿt÷FµŸw7ãdíD›ÿýþmþîý~ýTýRýIýŽýÔý?þéþšÿ;Ãhd²Æ¯[ë£r¾ÿúþ|þðýýRýaýýÁýûý/þrþÿÅÿ€\L’²·Å4® Y’ÿÛþaþíýý”ýyýZýyý»ýKþÔþSÿ³?¸P¬®¬¼¾R¾AÆ 3ÿtþþ–ýýêüý7ý¢ýþšþ"ÿ¶ÿkŸ_§·_(ÁA‰Ñÿ;ÿ“þ+þèýŽýQýbýwý…ýªýHþ#ÿÏÿUäî5~¡‘€Iõ[Âÿ:ÿ–þ@þ!þìýýýóüûüRýúýÈþ¢ÿQÕ:¢s¯ñâ{×H  qÿÏþCþ×ýsýýý ý;ý½ýSþ¥þ9ÿøÿ¼JËV”¢›a®]¼ÿÿTþýý¶ý`ý8ý`ý®ýùýFþ þÿÿGí„ ~× Ü}ÈMÛÿ)ÿšþêý†ýgýNý1ýUý~ýÝý~þ.ÿÑÿ•\í7K]„Y,Ú>© }ÿØþKþñý¯ýfý'ý)ý]ýÎýþÐþ~ÿÅ>´?›¼ÞÙœ3‚È*pÿ—þðý¦ýhýýÅüÑü ýý8þÐþ¦ÿ_Ök ‰ÈíéË¡‡w”ÿìþ[þØýuý>ýýý;ýŽýóý•þRÿÃD±:¦ÑدiïpøúÿmÿµþþŒý?ýýMý©ýñýYþÑþFÿÒÿeÂO»ÛþΕŒ"«)|ÿÆþBþØýxý=ýý4ý‡ýûý‡þ*ÿ±ÿJðŸe¤ÏÙrt´Qÿ¯þþÜý‹ý/ýý2ýCý”ý>þÿþÿ¥”în¤²GËNáM˜ÿÿUþËýýbýZýXývýÁý'þÅþzÿ%ïlãPœ¿Ç»’A¤:„³ÿÿþfþþŸýHý%ýý_ýÃý!þ¯þNÿæÿ’]Z›ª–”X©&Õÿ'ÿ¨þFþíý‡ýNý1ýCýýþwþJÿìÿhìxéD£ÚúÑ¢fÂH˜ÿ³þþ¼ýYý3ýDý?ýnýãýfþÿ§ÿ5Ø’#_‘æó–þ2˜ uÿûþrþ þ‡ý^ý^ýoýtý¢ý5þÔþyÿÇtÝ(‡¯·˜l»\ËXÿ™þþ¿ý]ýPýrýsý«ý.þ‘þÿÇÿf ‘%m³2àQ¯‡úÿ`ÿ»þþˆý,ý(ýUýný­ýþþRÿ>ØcðzÏõ Þ—]ÌMÿ©þþýýØýÓýßýäýæý þ°þ`ÿóÿaüvpÒûÃAµzøÿ¢ÿ-ÿ™þþ‹ý9ýýýbýóýxþÿ¼ÿ]å{VÎæ¸v)› iÅÿéþAþžýdýoý~ý™ýÃýáýTþÝþZÿ ×zØôñ¢NØ,¢+¬ÿÿZþïý¶ý‚ý]ýhý‡ýÒý'þŸþÿËÿ[ÜŽ.}­ïܬOØ1šúÿTÿŽþòýÁý§ýiý7ý=ý{ýòýƒþ,ÿÎÿu®=s³Ò’YØmõ3ÿ‰þBþÁýaýý3ýmý¶ýþýºþNÿ½ÿgq·|ll„2ÖjîP‡ÿàþ\þþÂýý2ýýýVýÛý—þgÿ™¤.‰ì õ‘ îi¯ÿúþ?þ½ýYýýÿü8ý•ýÿýsþÿxÿš'¼Aޱº¹]ÄE¨)¢ÿÿŠþüýšý]ý)ýýCýËýXþôþhÿñÿhÖOÆ:°Â±ŠTf¯üÿcÿÇþþ¸ýšýýTý[ý˜ýÙý6þ¬þ…ÿNÄqý[ÝÞ¨|.³tYŠÿ”þÿýyý2ýý<ýzýÎý þ~þÿÕÿzª2ƒw‰Ï¨Nñrá7–ÿÿlþºý4ýý$ýýmýöýXþžþ!ÿ«ÿn@ÔPÈäÔÈÍGÂBŒ´ÿ ÿ€þõý’ýAý ýúüýtýãýyþÿÆÿZ ¹"žçÚš` „èW™ÿêþCþóý«ýýKý4ýOýlýÒýWþÿÂÿž0¸.C} }KâAžãÿ'ÿ›þ"þÀýwý9ý!ý6ývýÆýJþÏþyÿ'ê‹àQ…°¦k2ædÃQÿÄþ`þ%þ»ýgý!ýý+ý†ý!þôþÇÿP½X±ä+‹Û¶SîG‹Ñÿ1ÿ¶þWþþý·ýký"ý ýYý¼ýþ¨þrÿ3½GÛHŠÑÒ¥C™ä1wÿÖþ[þâýlýý ýýhýÏýþþÿÿøÿ«|0ªßïáÇH»&mÐÿTÿ´þ+þÙýqýVý#ý?ý†ý þ”þòþ‚ÿ#¶TþŽÏåÚLýt°JÿŽþûýŠý<ýýý&ýtýãýZþõþ€ÿ.ä\Ù<”´ÇœGÕIÍA¹ÿÿrþÇý^ý ýÿü^ýºýæýIþ½þ0ÿ¬ÿJB ™ûЗZŒíC“ÿôþgþþýºýŠý[ý[ýŒý¯ýóýZþ=ÿОn¢½úõ¾t D@nÿ×þ?þÛý¼ýý`ýXý”ýØýþþÿ®ÿe©4à Õe ‡{ÇÿÿAþÑýgýý5ý_ý~ýÉý@þôþ‰ÿZ.Ë]ºËÇÊ… œ]…ÿõþVþÈý•ý†ýeýQýtýÆý-þ®þWÿ£V•·ûôÕ˜mè/Ðÿ.ÿ¸þJþëýœýJýýýý2þÑþnÿ·JÄIæ Ü Ax­úÿVÿÓþRþôýwýkýXýSý”ýþ“þÿÃÿš:žHRDW?Í,‘ÂãÿLÿ×þuþ*þ»ýUý4ýKý‡ýþÌþ¨ÿ2¸xª+.ìw—ú8‹ÿÿ¡þþýVýCý8ýHýÄýqþÿÀÿUãutÄ*_ ˜3ÉlÇÿÿwþüý«ýTýý(ýnýªýLþêþ¡ÿhô¨LÙ ïf·rÜÿWÿ·þæýuý4ý"ý"ýRý²ýþ²þ4ÿÓÿ˜;” žæÑºq ³1¡ 1ÿ—þ&þ¦ýbý>ý7ýCý•ýïýWþäþ¯ÿ^œô@stb@œRÿ«þMþçý8ýÍüçü*ýcý¼ý?þùþ•ÿ6Ùuˆ²©—h?î`ˆãÿVÿ²þþ«ýOý+ýý ýDý¹ý,þþÿõÿ¼e {²©—²–9£Ô•ÿ ÿþ2þÞý{ýý°ü•üýý1þ ÿ«%£$d¡À±F­üZ´ÿ%ÿ¨þ&þ©ý^ýKýý&ý†ýþµþVÿáÿ`×<Æ<°×¥EÅ+tÖÿ'ÿ¡þ&þÃýiý=ýýßü ýoýþÍþqÿ¿V¦öu±®¨túZÐ0€ÿàþOþËý3ýÓü©ü¿üýªýIþÍþdÿ¡V'ޝàúãï;\ÿ¬þ\þßýcý:ýDý]ýjý½ýþ„þ#ÿ¸ÿ8¸F­ÏåÇb“ îÿIÿšþþsý!ýíüëüývýþŒþÿ¼ÿp¸™î)$â€û@íÿoÿ×þJþÈý0ýÞüÅüý`ýþ¤þ0ÿÙÿ~"Ô:ÎðÅjòPÞcxÿþþÍý”ýYý7ýUýžýÎýþÙþŒÿ<ÜeÑT¡·Î§R›ÝJ£ÿÎþEþÏý„ýBýýüûü3ý™ýöýÁþNÿ®FÃXØí¼²c¿>ñb¾ÿ$ÿqþáýJýàü®üÏüýýÜý*þëþÁÿv»I†–ÃÖhÔéN¶ÿ%ÿ©þ^þþhýýÅüÚü ý…ýþœþjÿ0¬i•Ã|ë,ŠäÿlÿÿCþŽý!ýæüçü ýrýôýRþÒþ…ÿ–ßS½þÉWã`ã^ÿëþ/þfýýùüìü ýpýÄýCþÝþpÿïÿ¡mÁ´»¿—uûW™ÿ ÿºþ@þ±ý\ý1ý ýý‹ýþÄþCÿ¢ÿQÒEÞ†êÙxßR¦/jÿ„þ×ýfý3ýý<ýiý|ýÍý6þÌþrÿíš2ñlxp;Î*–ñ+ÿÞþ7þhýöü™üžüÚüCý´ýZþÛþ^ÿñÿÚ¾:£ääöÊP ÔBÿ¥þ,þ²ý>ýAýIýUý‹ý·ýRþïþÿùÿ¶lñ€ÃíÊ’Wø_©ÿÿƒþ×ýsýHý'ýýJýoýìýþ:ÿ×rÖF¿  ã€*‚¨Öÿ#ÿwþàýmý ýýúü9ýmýÍý~þ=ÿÔÿ“5º2×EUZ!–é2ˆ÷ÿoÿîþVþÛýqýý×üýrýÚýTþîþvÿ1±/©9CÊ#ÎR˜¤ÿ»þçýtýGýýý`ýÈý þeþÆþ?ÿáÿ¥Vô“Íææ¶TÜ?t¥ÿìþsþêý€ýýý"ý[ý˜ýþâþlÿ½a½må-Þr ±@‰Âÿ,ÿ€þ¼ýVý5ý#ýBý{ýÀýþ§þ1ÿÊÿˆAß9©óÄ`Ï/„Òÿúþ>þ¾ý\ýýýýNý‡ýÝýYþÚþkÿï¦>›¬´²…Â6•rÿãþ'þ ý;ýÍü®üüüsý¿ý6þÝþ^ÿËÿ‰]ùtÁ÷ɉ)Ðxö]ºÿ ÿDþ¥ý<ýïüãü(ýlý ýõý_þíþ¦ÿ|JÚU¨Âµ©˜ •*‹Àÿóþ_þÄýQýìüÜüÝüýfýëýDþ¼þ—ÿLØT¦ã°;Ê7Ûÿ3ÿšþþý{ýJý@ý>ýKýbýÅýAþÉþ…ÿYŽ—ÖØÑ³hò~ÔXÿÓþþyýýùüÝüñü-ýšýþÄþŠÿÓfæŠ4å«1•Ó5–ÿËþöýcý:ýýßüéüðü>ýÒý}þXÿ2Ð2sË0yÅðÓ4y µÿ4ÿœþþvýùü¶üŠüÅünýÛýMþ ÿÌÿJÛ«pÏHAÐ:ªC©ÜÿþþWþÑý/ýÞüÆüÜüýJý“ý-þêþ™ÿ$Ñow¯ø.×MØEŽcÿ°þþuý6ý%ýûüÛüýSýèý€þBÿ¶H©ÏÑÒ¿d“Jwÿ°þûýkýýïüýüýMý•ýêý`þûþÞÿª8»1x—ÂÆQÊ#{×ÿÿJþ¯ýUýûüÓüÞüÿüAý ý|þ7ÿ»ÿ<æ¥O½øçŸLè‚ú_¸ÿÿrþåýPýý ýÙüÉü&ý—ýþŒþ*ÿ ¿/ü¹îúø¡“‡³ÿÿ°þHþ¼ýoýAýý¼üÚüOýóý‘þFÿ¾{là (“íEÄ0}ÿ£þðýtýýÚüÓüØüýlýþÊþjÿ¾cÙC«Õ½… Š×ÿ7ÿuþ©ýý«üµüÌüëüHýÍýVþÿÍÿªpXe¤åÍ›iÕ6¡ÿÿoþþšý~ý7ýéüÃüýý7þøþÀÿ‰ ŸdˆÎýÔsÌUÃÿBÿ£þþ®ýhýýãüèüIý»ýeþDÿìÿiš$½·»{ð<¡rÿðþþþ¶ý+ýýýýý²ýŠþ`ÿÚ~îE¬ Q;¾ … 6gÿÓþdþºý&ýçü½üÀüý‹ý4þ—þ4ÿðÿ˜D „à̈/¹@®4ˆÿÒþþ|ýüüÊüñülýÓý?þòþpÿïÿYψ8¯ßÀQöcÌSÿÉþ8þÒýŠý9ýÌüõülý1þÂþ$ÿ±ÿp ¼YÞ2O3ÔVÜløZ—ÿûþUþ¥ý5ý ýýSý£ýöýþ|þ1ÿ,ü¹~ BIUBÓ+Ä-¥âÿÿ~þüýý]ýXýgý‡ý½ýþžþ3ÿ »@ŽËÚ0î„î:–ÙÿEÿ§þþ’ý<ýýòü4ý¨ý#þþSÿéÿ–4Ò7—Ý"±#“S±ÿ@ÿZþŠýýýãüùüZýÊývþÿ¨ÿ^¯þPÖEG#ûB“nÄÿ=ÿ³þ þwýýÖüÁüèüSýòýÆþÿp(Àe¾ö¹Fªð1šÿ)ÿ¤þþýKýý ýýïýˆþýþƒÿöÿ‚:µ2  ûÀvñCfœÿîþsþþýXýýùüíü(ýÂý]þïþ´ÿ’LÕQÚ"÷ØRÌkÊ"Rÿ¤þþ¸ýdý*ýýýiýÝýSþ×þoÿÕŽ+™Ï Æg·.b“ÿìþ&þ¨ýQý.ý1ýTý{ý¹ýTþøþ¦ÿj‡ŠÙ(òN­÷-gÿÊþDþÅýeýEýýý>ýtýþ©þ?ÿïÿ«=ö‘Òõó¨ŸF²âÿ!ÿ_þ¨ýUý$ý ýêüÙü*ý³ýiþÿÃÿpA¶ pÕóê¿PÅ(}°ÿÿ–þêýTýýÛüÛüöüFý·ýCþéþ|ÿ?üÈs¾ßÈ}R&Ì{¹ôÿ%ÿnþÜýtýýÑüµüºüäüQýþÅþ|ÿ3Îcœü'7–Ñ‹bÿ›þþ°ý'ýµü«üÇüíüCýïýoþæþÿw$¤CÙ#þá„ùw÷R¬ÿÕþMþúýˆýýÙüý?ýKý›ýUþÿ¬ÿa‹c¤×ò¼DÝK€äÿ6ÿ{þ³ýý¾ü¶üµüÍüCýýý–þèþoÿíÿ…3Ý9Jü“'¯ ¶EiÿKþ†ýýÓüËüý4ý@ý‹ýþ¶þGÿìÿ°QýxßÿïÂowô.Bÿþþ|ý ýÏü¼üÉü ýšýþ›þ%ÿøÿª±iÕϵ–j }ã;¾ÿ ÿgþâýƒýDýýÞüçü^ýÍý…þCÿðÿˆôŸ.¥'Î4—vèÿ5ÿ‚þÓýý‚üpü¬üîüGý»ýAþâþÿ?ןm^]°aÈ3nÿ…þÞý:ýÜü›ü”ü£üý®ýKþïþÿ+¶^‚Ã×ÑÀ‹ H’ÿ#ÿ­þþiýýöüøü:ýÄýSþÀþ)ÿìÿ¦+ÅU»Åû÷ÔŸ?I~ÿ´þ þ§ýný?ýñüÊüûüwýôýbþûþ§ÿ_µaû ý¤$µTÀåÿ2ÿœþþ{ý ýÐüÀüÖü'ý·ý2þÿšÿR´}ô?3éyîT¡LÿžþþYýÈü–ü³üâü!ý­ýIþÇþ~ÿ=ÙW¨JE’+¿SŸâÿ5ÿpþ‘ýÿüìüóüßü"ý®ý=þÓþjÿúÿ¨<×y VV7Ù)€òfÙÿ@ÿªþþ®ýWýý/ýšýôýYþèþZÿÓÿa3ËVØ?P+÷«!„ê$OÿVþžý0ýý÷ü'ýWý§ý þ~þ'ÿÎÿˆFö‰Æå"ú¨rvû[Ãÿ ÿbþ³ý+ýýýeý¶ýþŠþ/ÿ¿ÿ`Æ9€âôûÜ^§þtàÿÿjþÌýIýý&ý-ýQýœýüý˜þfÿ(øÃF±i|n-Ãõÿ2ÿïþcþøý­ýVý(ý*ýGýªýþ²þJÿéÿ•G¾+¯0{oÀA~Å"pÿÃþ/þ¨ýbýAý/ýcý¼ý3þ þ@ÿÇÿW¯X½ 9ð¹‹ýfÖZÿ·þ&þºýký.ýýPý¬ý þ€þ.ÿÜÿLå˜7±!(,ÞpôS˜Üÿ(ÿNþ«ý2ýéü±üõüMý¥ýþ·þaÿ©K•ûJJ¢$°XÄÿÿcþÛýwý2ýý8ýyýòý\þÂþ^ÿˇ+ÞDr+ºOÔF‹Èÿÿ[þÑý\ýýüÜüüüaý×ý0þyþøþ¨ÿLõ¥M¾öúÃ+¨&_QÿŠþ þˆý)ýýûüóüýü6ýÉý‚þzÿh+´9˜ÔÛÇ™EÏR½1•ÿËþïýsýDý1ý'ýAýuýÔýPþ°þKÿ Ü»kå* â“îY‚ÿ¥þÕýQýýûü ý*ý<ý|ýÜýeþ*ÿÔvx¾ýÉzíX³ÙÿÿQþ³ý^ý=ý0ýý1ý‚ý´ý;þàþeÿ3ØnÉÕé¿~"ÄZžêÿTÿxþ¨ýýëüÔüîü=ýýÏýGþÈþOÿÚZœÇÒ³¿°CâAY ÿúþDþÉýuý_ý3ýøüëü<ý¶ýWþÿÝÿ­wxò.Ê–8¼ 1Šÿïþ8þ™ý[ýNýýûü7ý˜ýÐýiþ ÿ˜ÿGï·BÀãâ¿·kãTÜ !ÿŸþþxýýîüÌüéüYýÑýXþÿ«ÿk©ZÒý)ŽÿYÆÿ ÿpþ¸ýAýâüÄüÐüýZýÁýYþáþÿ7 °+Äé çdåEº@ÿÔþ&þýýáüÏüýAýÀýUþÚþwÿ(à^î’ÕÛÛµh›ÿX“ÿéþOþ¶ýDýý"ý+ý5ýsýàýaþ ÿÍÿ†Cº ãnöböf«ÿÿþñýZýâü°üÞüýaýýýŠþ ÿ˜ÿN*Ê6Æ86wýn·=ÿ‡þØý[ýMý(ýúüýPýÁýBþÃþÿ‡VÜUÄåÖ±~wý(Vÿ™þùýpý%ýÚüôüý\ý¬ý'þ´þ=ÿ¶/à}áß)nèVŒÿÄþ\þñýdýýíüúüLý¬ý,þÈþÿ —6ÛN©ÐóìŒé>n‹ÿÂþMþßý}ý;ýýýýIýªýZþ3ÿÏÿpNæ(~Ö%Ó‚þKœwÿ°þýý|ýýýýJý“ý1þžþõþºÿ‚.ÚÐýü»aÒ>²?³ÿÿ|þ'þ¢ý&ýý9ýnýìýƒþþþsÿéÿoÖoËfKùV¨‘*„ÿÞþþ¦ýOý%ýýMý­ý*þ´þEÿöÿƒ„Ý,àvÐ^¼ßÿ)ÿ®þ þ~ý9ýñüÙü ýoýÈýSþ6ÿ Òh÷|ÎJ§ d©Åÿ ÿ›þ$þÅýuýhýuýhý«ý%þšþÿþ‰ÿÜŒ÷zÒ P ¡LÆ OÁÿÿoþ×ýaýýôüý]ýîýŠþ/ÿÂÿv³ð:±-5ò[—Ô0–ÿöþnþþ±ý€ýhýyý°ýüý9þ˜þSÿ$º=ÿƒô -'®ëc½×ÿÿ‰þþ€ý3ýýý9ý³ý1þÈþ‚ÿ=Ýpö~±àHƒBí\©ÿÿ‹þõý‡ýCýýóüýFýÚýcþ ÿËÿ¼X›µûÁtèhÞ%hÿíþ[þóý¥ý\ýý1ý^ýÅý7þ®þQÿòÿ¦b‚´ë$ –Ùˆÿ ÿþþ5ýûüóüýýký(þÞþyÿåÿ»_Ó@Ê9´6ˆâCŸÿÞþþƒýTýýßüÖüýüWýÖýLþòþºÿ,Ê[ôsÖòè‰òw ¢ÿÌþÝýý²ü˜üÆü5ý©ýþýCþ›þZÿ+µ>ý¤ÞzrÎ@|ÿ³þþhý ýÈüÈüÞüBýÄýUþÜþ:ÿòÿ¨YëQHŽà-— ÿëþ9þ™ýýÀü™üÂü!ýýÓý5þãþÄÿœ|5~žåð»>è´C„¿ÿÿ8þ©ý/ýÞüÓüÙüôüPý¸ýDþÉþvÿe9ɃÆÇº•ZÝb¤Òÿ.ÿ£þèýdý2ý!ý÷üý‚ýþ€þÿ×ÿ…è>¥T·ÔÈ{3”ËøÿXÿ¯þùý{ý?ýëü·üÔüýjýþµþvÿ)¦8½MÇá«8ŸpÿÐþ1þÐýlýýàüßü&ýmýçýpþ%ÿ³ÿc0Ä+›ïúÑwûsÞ} Eÿ›þÔý8ý×ü¶ü×ü(ýpýæý‚þ ÿÿ4çgõi°Ç˪+éSÐÿ÷þZþßýKýðüÜüÔüýpýÞýoþ ÿ ÿK°P0®ÖÆŠN¢$­ bÿÇþþ¢ýXýFý@ýSýiý«ý(þšþÿ²ÿ•Néy ±¡†EÔ`â?ÿúþ8þ‡ýJý=ý@ýýDý¯ýJþ½þPÿ‡û‡+«öì±]Ã"•8‹ÿ»þ1þ–ýBý ýìüý6ý§ý.þ¡þÿjÿ Ù¡[ÉåäºbÂ4š÷ÿ=ÿOþ™ýOý-ýý!ý=ý}ý³ý.þæþ^ÿæÿše ŽÔ ÷¡RëV¼fÿ¤þþ ý7ýüü ýGýkýÅý2þ¯þeÿ5ÛzBŒµÏ£e˜ñVÿ•þ#þØýýmý9ýý#ý_ý‘ýþúþÝÿ؆ù>…½äÍŠI Tƒãÿÿ_þÉý~ý3ý$ýDýtý·ýüý{þ ÿÐÿŒ&êT«Å¿«rÃJ•ÿëþhþþý9ýýý5ýŒýúý{þÿèÿ†+¾&„ç%¬~S¶:sÿ…þêýÇýgýèü÷üNýýæýkþÿtÿ¹PÝj¿¾Î¹ŸYH~³ÿ÷þDþÒýuýWý6ý3ý¢ýþUþäþÿÇr°ý⺔5­!yÿ¶þþýKýý$ý[ý³ýæý‡þpÿ*¬=ÔC›ë(#é–{Ç[ÿÑþþ…ýdýWýNýTý˜ý þŸþÿÀÿ§mýA¢Ùݼ¤vÿÉWÿþ,þþ®ýeýXýVýmýÊýRþ$ÿôÿ„˜üS ¼µ–h‘þK©ÿØþ<þíýfý ýý9ýgýŸýþ²þNÿC¼7m£í$¤Hã+r½ÿÿPþÉý}ýlýyý‹ýŸý±ýëý„þ7ÿËÿQÎcŸÃòÂRßd¦Äÿ3ÿäþ”þþ£ýdý6ýýHý ýYþ+ÿ½ÿKù”ü5°ëÅu0ÚkšõÿfÿÊþVþäý‡ý:ý)ý*ýJýÏý=þÓþÿ2Ë` “ÿ%9úžn›àÿ[ÿ¦þþÕýºý\ýý ýOýÁý;þàþÆÿZÛ{Ü<ŒÃØÅmÙfôOŸÿ ÿƒþþ½ývý–ýºýÛýçý>þ»þGÿÉÿY žç$=ã[ª>”ÿ7ÿÑþ4þ™ý4ýäü±ü×üGýÍýIþþþ¬ÿWÒ¯j¾ñ®fð|Ð9zÿºþþ¯ýCýóüíüòüJýÍýQþéþˆÿ!Äw„Ùÿ¿s)|À,}ÿÈþþ°ý~ý4ýý%ý•ýÐý þŠþHÿÊÿ]‹¬×¿…M¬$–ýÿ1ÿ~þÒý[ý!ý)ýJý†ýÓý1þ­þ1ÿ¸ÿeûn°è×Ä`ª’ÿÿ„þ#þ¥ýKýÜüãü8ý«ýþqþÿ§ÿ9â ^Š©–‹XáD•Ûÿ6ÿþþÄýný ýØü ý~ýÉýOþÝþkÿýÿœD¿'|ÌÚ‚­/¸3¨ÿÿuþâýýýÓüÖü,ý‡ý þ¥þBÿÒÿ_îoòKмj+X†æÿiÿ&ÿ¨þ&þ¡ý0ýÿüýEýŠýþ“þ+ÿ©ÿw Šìv¸Ð©bô‚T²ÿÿ£þ:þ¹ý`ýýÔü ýUý¢ýþ«þUÿ ÈgçR­Ñ±’UþP»Tÿ¦þþßý‘ý\ýý:ý¦ýíý8þ¹þkÿ ~´pÏá€Ô‚ëdâÿHÿ¨þ6þÈýOý ýý^ý»ýRþÍþWÿùÿþ€ðH¥­˜MøP ¸ÿVÿÔþAþàýuý ýýü#ý‚ýéý~þ5ÿ»ÿQñ‰'ŠÈèܧ;ŠàRÒÿcÿèþlþëýLýÄüÈüý†ýþÕþmÿþÿÚ^ëaÄíÀBÄdózÿëþLþÑýEýêüØü ý~ýáýþ#ÿ„ÿ»2šPãôiÎ'¡.ÃÿMÿ¦þþƒýFýý ýHý¿ýZþýþ‡ÿ š%ÛžäýÿÖŽ5ÎR­íÿ@ÿ°þþˆý9ýý ýý’ý/þãþ…ÿ,°-šûwÔѺÀtêVÏDÿªþ7þÕýŠý|ý{ýwýƒýàý”þ6ÿàÿyúI»F¤ó üfņðÿMÿÃþ,þÚýrýIýDýWýyýÎýFþÿ¦ÿPæ\í>uÄêÂŽ5”Á&›ÿÿ~þþ…ý9ý!ý=ýxýÙýKþÀþ<ÿþÿÅm°é7«Þшˆówáÿ*ÿšþEþ¼ýxý2ý%ý9ýýþ„þñþ­ÿŽEÐXÑ Ú n¹(}äÿAÿþýý¿ý™ýtý;ý[ý¶ýüý~þ9ÿäÿ8ð¨PªÃm7Æ5yÿ€þÌý]ý+ý<ýyý£ýëý!þeþìþ˜ÿ0Õvã#g¥Õ´u°5~ÿÖþBþøý¶ýqýfýRýQý‡ý2þÑþPÿîÿÓ“ù0k‡—xZ&¹R–ÿñþnþÿý•ýeýOýZýný¸ý"þuþîþèÿ´5·Aˆ‰¢™fõ–v¥ÿàþ\þõý ý‚ý‡ý{ýpý ýýýiþíþÿ1äbêP€¤›g<íFùÿ|ÿÛþ>þÁý\ýôüßü,ýiýæý~þÿ~ÿ •4›ž^M¢-¿#`ÿ˜þüý©ýaýBýNýxýÒýþ'þ„þ ÿÄÿu#´Omi1!ߤ%`ÿéþNþÁýIýüüÑüÖüý]ýÚý\þûþ©ÿ;ê‰óR™Š†Q¡+·ÿÿ˜þþ€ýýÞü ýcý·ýþþ5ÿ®ÿ)Àl¸c¤Ÿ„;à\޳ÿÿ¦þBþÓý\ý@ýPýCýwýÑýEþÉþaÿõÿ4·"„º­O§˜1©ÿÿ¾þJþÏýý…ýlýoý¤ý0þÍþLÿúÿö|ÞG«ÉÚ¼<zÚA•ÿýþƒþþ¥ýUý7ý`ýjý¼ýþŸþÿ—ÿV(å)‹Ÿp=(è€åH½ÿCÿÍþ`þÕýzýmýQýgýºýCþÄþ@ÿ¼ÿ/»Bˆ±Ÿe1²¥ýÿ6ÿ‘þþ”ýSýKýýŠý²ýþlþðþhÿ €…‚Öć(·@Ì9„ÿÐþþýoýbýQý_ýýîýVþÖþlÿÍÿ3ÚeÂd§”0×pùaÝÿ)ÿžþ;þ¼ý8ýùüýOýýþ¢þ3ÿâÿ„)· >f‹‡.º›@Õÿÿ›þFþîýŸýŒýlý]ýkýÇýOþòþ¡ÿov¨£l*©#tÛÿ]ÿëþ~þþ®ý?ýý=ýßýaþÕþPÿÃÿ~|1£Î r,œ¬KµÿøþEþèýŽý&ýÿü!ýfý­ý'þ«þ[ÿÍGÁ"e½ŸGÇ=— —ÿ+ÿÊþ^þøýýEýJý‡ýþšþðþ[ÿÜÿE܆kŽyÀxùO}ÿÃþWþþ¥ý•ý„ýlýCýjýÙýiþÿÂÿf^Ç,šÈª‰8ÑIÂfÿªþ þ±ýlý\ýIýtýÄý%þ þÿ±ÿMö^¬ólŒoÊtÿa¦ÿõþmþþ×ý•ý~ýký„ýáýdþñþžÿ=ÛjæF|´ž:º ÞÿuÿÿÌþaþîýÂý•ýƒýeý¤ý,þçþ›ÿfçFèN¾úÞ„.Ï …ÿÿ«þ=þëýÚý¼ý¤ýýÍý1þ³þ)ÿ—ÿ"ÜqÞ1­ÐǤSœ‡òÿ‚ÿÿÆþ]þêýœýuý‡ýÑýþ‹þOÿ~æjá=‡½¢e¢LÀ?¤ÿÿƒþþ›ýwýfývýýØý`þ÷þ§ÿ\í>ª6™²áÙyéh×I®ÿ(ÿ©þþ¸ýxýuý~ýŸýÔý þþÿÂÿ…IÓJ›œ‰c%×a¬Âÿüþfþþ³ý›ý†ý‘ý‹ýÆýTþìþ„ÿ!ÊV¬ø,Vu.²"{×ÿFÿÅþXþ$þóý¸ý‰ý‚ý¦ýþýnþÝþ¤ÿZåSÃ(l¥œj†ÿBƒÿÿ|þþý¼ýšý£ý­ýºýþiþÁþ6ÿéÿš.­cmL<9ú…PŒÿâþwþñý£ý™ýšýuýuýÐý!þþ'ÿíÿ©iä<«Ò®q1êjÎ@ÿpþäý’ý‰ý¼ýñýäýÜýùýFþùþÒÿ†d»’ÔÊ7¥'®íÿRÿÇþ[þþ¿ý‘ý•ý°ýÛý!þ°þ*ÿ¾ÿaéL©!l®•q\÷ÜhÿÅþoþþÂýªý²ý®ýÉýþHþËþzÿ&¿nÅ (HSCáï_§ÿÿ’þ&þäýÀý©ýšý¶ýÚýþŠþ1ÿÜÿ†@ºz]AÄQÌKÃÿ6ÿÀþ-þÓý¡ý¨ý|ý‰ýÀýþ|þùþžÿgÿ{çAA*,Ä=Æ9†ÿéþƒþþ¯ý`ýNý‡ýçýþŠþ*ÿ»ÿ+ÂO—å@, Þ¤~T¡ÿôþzþ÷ýÄýÆý™ýpýzýÜý0þ·þzÿ¸5¡[†½‡Hâ_Ñ/ÿïþ—þþÊýxývýwý˜ý±ý'þ¶þ3ÿßÿqàJÍ1mwEÝ£X¸.ÿ—þ"þªý_ýHýpý”ý·ýüý}þÿ¢ÿ{jÈ Wl<ä—/«Zÿåþ}þþ±ý¢ýý ýÝýùýmþíþOÿíÿ› ‡_i^(æ~'®|ÿÿþþÂýŠýtýƒýÆýJþ´þEÿ§ÿªAšÌ ]~l)ÍrýiÖÿMÿÉþ„þKþÉýZýDýŽýèýNþÿþžÿ)š{ã5’œi;Ä[ÙSÊÿ\ÿÝþeþþÚýÄýßýàýßý1þ¹þFÿ×ÿræ=¢é6, î«F±óÿWÿÿ¼þ0þêýÅý‘ýoý±ýþ®þFÿÃÿL­-†ÖI”š|-ç{ÞK«ÿÿ®þbþþ·ý­ý•ý«ýþoþçþiÿàÿ@é”õ*nƒob%ÇQŽÇÿ(ÿ™þGþþßý°ý¥ý¸ýøýyþáþdÿöÿ¥3ŒÓ!;V8ú¿9¯?ŽÿÒþ^þ þÿýáýèýØýòýþ\þÿ±ÿN­×^ŒŒZ×džÈÿ0ÿÄþDþõýâýÎý§ý©ýêýþ†þÿÀÿG¬"‹Þ8wuAã‚8Å8Ãÿ3ÿþþþ»ýký‰ý»ýþdþ ÿÙÿb·gÁ :‰–CËnå[ÜÿpÿÝþYþþ°ý›ýäýþ;þ¥þÿ”ÿ(tóE‘š|[´æž#¶ÿ\ÿøþvþþ´ýšýÉý,þ•þÿ\ÿàÿUÞpÐ8–°š^;x·ÿìþ’þ>þþéýßýøý*þSþ•þ&ÿµÿ8ÕHšîIOH4óœ>Ésÿçþƒþ1þäýªýÛýóýþeþ¥þñþrÿ•Šø?=F7ã’^‰òÿ~ÿÐþ"þÂýÇýÀý²ýÎýòý]þÙþgÿùÿ…î`´PudòzçlòÿVÿáþ‚þ3þþÔý¾ý¿ýÑýþ€þÿ½ÿ<ÍgëS<LYý§u>ÅR›ÿÿ€þþØýïý þäýîý>þ«þÿþ‹ÿNÍ(ªþ  Â…4®kÿÒþYþ+þþþþ þþ(þnþôþ‚ÿÒÿYÙhÑ0b?ûÚ¨%›Ÿÿ ÿ¤þ[þ+þáý«ýý©ýÛý6þáþ»ÿ3h·ò3­c‡^õqÃ7Èÿ-ÿåþ þIþÖý¿ýqýmý¹ýCþ½þ0ÿÆÿ Q§@ÓQ¸pÔ>Åv—ÿMÿÿ{þÚý“ý”ýŠý¥ý1þÏþÿjÿßÿcöMÎ?_7çµKàN¹ÿ.ÿ¦þeþDþüýÑýêýþ&þ_þÕþpÿøÿ| a¤Õ#*Ϥ~»?®ÿ4ÿþAþ÷ýÎýéýþAþTþ›þÓþÿˆÿMÞ.³ý+/Ћ#Å3¼ÿGÿÜþ†þþ´ýŸý²ýÎýþnþÄþ?ÿ¼ÿ;Ó(ò $'êÅê”,ªÿ3ÿŸþ1þ³ýƒý‚ý—ýÒý=þ²þ9ÿœÿóÿˆö+³$D'öºl™ªÿBÿÔþ€þ þ—ýý¾ýîýþSþÇþTÿ‚ïfã PfE²A• °ÿ{ÿ)ÿÐþRþêýŒýcý[ýÀýkþöþsÿéÿ8 #›û4Cò°eñFžÿèþPþßýÈýåýØýßýçýþ1þ¥þ$ÿ¾ÿ8ÂG±UvGß’IÊ$¼ÿQÿÖþ|þ)þÜýŽý—ýêýLþxþ°þÿjÿÞÿ†7µ 58!-þ¯,”ùÿ—ÿVÿëþ|þûý¿ýƒýýÀý.þœþÿ¦ÿ$ŒgªîS_-¸Qàh'åÿjÿÿžþEþôýÖýôýÿý8þ‘þ"ÿ›ÿ …ôH‡å ζbé”GÓÿKÿÝþ‡þ#þàý²ý¼ýïý'þmþ«þ2ÿ´ÿ-¬6È/DT)Ä‚A âsòÿVÿ¿þ þ­ývý­ýÖýþ|þçþ1ÿkÿ¸ÿo ù…Ä )Žý›jÌÿpÿÞþQþøýµý§ýàý(þ}þÝþFÿ¿ÿ2’#Â7nwTÝ­1¿cÚÿ]ÿÛþ þ|þOþ*þþ)þUþ¬þÿyÿûÿxînºõâÌ fÿÏþLþ þüýèýÖýàý2þwþûþtÿÞÿTÔ[Æ"AS6è¶vøŽ$Ñÿ7ÿ“þ9þþçýèýþýþ;þ€þúþŽÿDÆ*­úGzÉy—/ßÿaÿáþ_þ+þÙýÃýÏýîý=þ½þMÿ½ÿ”‹í#A$òªGÛQÿÿÖþyþ4þ"þ þ þ:þuþžþÎþÿ ÿrœù,)ü¢I Ÿ{ÿÿuþþåýÙýõýEþ³þÿEÿÿÔÿLÐMÄ$×{I9Ê“ÿ$ÿ¼þ]þkþKþþþ(þvþ©þÿ¥ÿ;¸E¨à?L<ì…÷¥PÁÿBÿÕþjþøýßý×ýßýAþ†þÉþ#ÿqÿîÿŽ+§?F1Ǥ?ê|åÿTÿËþþ þìýÑýÊýûýsþÕþ.ÿvÿÒÿZîb®ó4L ÍCܲ‡:«ÿÿšþTþ3þ#þKþcþþ¤þôþ0ÿÿ Ï[ªª·Ë¯„eözùÿÿúþ†þYþ:þþþLþWþtþ½þ3ÿ¯ÿ=² w÷É€n3øT ÿùþ“þzþ@þ/þþ0þUþ†þËþ9ÿ³ÿ2­8ÝøäÁ”lûs½ÿCÿ±þeþ]þ:þ þþAþiþeþáþ{ÿÜÿ_¡²ã ÷Íf¦5žÿ9ÿÀþ|þeþoþ+þ$þ^þ›þ¤þðþÿøÿ]ÌS¸J]Š>é—-ºÿSÿÜþFþÉýšý¡ýÉýþþÿƒÿ°ÿšð7ÓöÝÀª_ê¯VÊÿIÿÿÀþSþþìýòýþlþÒþÿ“ÿ^²ŒÉÐãÉr*íÍi"zÿËþPþþÙýËýÚý'þzþ’þÈþ ÿ‰ÿ*»,åå–N´Dïÿ‘ÿÿþrþ'þüýŸý¡ýßýþ\þÎþQÿ¨ÿ‘&–ÀçË´‡T¸PÔÿ9ÿÓþþUþ>þ$þ9þCþ2þ=þ„þÝþ}ÿ%Å @sÓé³›G·8êÿŠÿÿ¾þ€þùý¾ýÔý þ:þ{þÇþ1ÿ¬ÿ*œæF’¡‹ŽŽ™YÿºaÖÿoÿòþJþÓýÏýäýÿýþjþÎþÿ>ÿ®ÿ˜7—¹¹ÑsŠ{–(ˆÿúþiþAþ8þþþVþlþ•þÎþ5ÿ¢ÿ9–„ò>^\ÙrÜWÉÿ(ÿ„þ%þúýÔýßýþkþdþbþ‹þÇþZÿæ[¦ÚÈ–™ IïÂj¤ÿ4ÿÇþªþ˜þpþCþ4þ3þ9þ€þøþ‚ÿíÿD¾1}¤ÈèÉÏœVÛ6·ÿIÿßþ‰þfþIþRþ>þ8þ5þtþ¾þIÿ"‘ï2Sv½øôêÄ[úÙÿRÿäþ™þ8þùýþFþfþsþŠþ¡þôþ…ÿ ³Kµó&ì³rMßdëÿ—ÿÿ™þ*þ þ þþIþ¢þÍþÿ„ÿÕÿ3 øV©æ),ûÁOõÂmèÿvÿ ÿÐþ–þeþ]þiþqþxþÑþÿˆÿ ú-‘ÞÞåå«rIõ{›ÿ9ÿäþxþþ þþ.þcþ£þÿQÿ¹ÿLêm­&ò°`ùmµÿ1ÿÎþuþJþ<þSþkþþ˜þ¹þüþxÿ ‚ÏmžªÔý¡¾…9Ýÿ•ÿPÿÿ™þKþ3þþHþþÿjÿ»ÿ’í+“Çæìï̆±.§ÿ@ÿÎþvþPþ>þHþXþbþ€þÝþ:ÿŒÿÝÿSßE’æ$Í|Eö“0¼ÿ7ÿïþþTþ7þ+þþ^þÄþâþ7ÿ·ÿ\¥G‰ðá¨y•Fžÿÿ×þ²þ^þ3þLþoþ©þàþ ÿÿ ŠÄÚ/sŠs¨ÊÌOÏ?§ÿ+ÿÿþîþÍþ¤þ>þ$þ!þDþvþîþcÿâÿT¦~ÃÌ×ô·i>î8³ÿ‰ÿJÿõþ¦þ˜þtþ'þþ_þ~þÐþ`ÿw‹™áF‹ÏöâŽSŸÔÿŽÿ*ÿïþ¦þ\þ%þþþ1þ’þüþlÿíÿ™ ˆÚ6îqÞTÎÿœÿ‚ÿAÿôþ¤þkþ6þþ&þ}þâþ@ÿ¸ÿ7~°v¾ÝÕÌ¥h¹X¾ÿQÿ)ÿøþ›þyþþcþ8þgþ¢þìþhÿæÿW½ùQw”·Xª;Ñÿÿaÿ'ÿÖþþBþ þþlþ¥þÓþ:ÿÂÿ(“ÙÌÍǼdßcïÿ}ÿÿÿÿ¥þaþaþFþþ<þ­þ!ÿmÿ×ÿD·ûEFbœ‘eV+°+Èÿšÿ(ÿÈþ—þnþ:þåýÛý?þœþÕþbÿöÿIg—Ù?gk”†5Î’EÞÿZÿÿ«þ^þþðý þþ9þ}þæþAÿ’ÿ™õ)P{²À… ÁGšÿ%ÿÿÞþŠþ]þþÕýêýþoþÀþ-ÿ¢ÿØÿPˆ©ƒ•h:ÝŸ@àÿ·ÿŽÿUÿæþ…þOþ@þKþ6þtþ¹þåþ.ÿ•ÿøÿR¼Q£‘X7Ð]–ÿÿ§þ”þrþ”þdþ.þþþGþ»þ^ÿžãH…«°Š2Ûs«ÿaÿ%ÿâþwþþôýþ þ(þwþùþ6ÿ„ÿhÁ÷Jƒ­®¥g3å”,Øÿ|ÿÿ£þMþJþEþWþsþ°þçþÿiÿ¼ÿS´1r…¤xÓ„šÿ~ÿiÿÿáþ’þ9þþDþŠþ»þÿUÿÿÂÿ6‡×A›¼¿À…0éƒ ©ÿQÿðþ†þIþ*þþìý þJþ§þÿpÿ¯ÿ¡ç@|“¿Äœ@ó¬™+¸ÿIÿáþ€þoþSþþþXþÓþ(ÿÿÚÿúÿRÐ5ŠÉ׺q2èw>þÿ¢ÿÿ³þ£þ’þVþ\þ”þ›þžþåþkÿéÿH¥ç'nµ¡—}_Ô} ¾ÿPÿöþÀþ¤þvþ<þ:þfþtþ¦þ%ÿ“ÿõÿsÆ]…€›®€Iþ¦Sòÿ·ÿ\ÿÿÖþþRþRþqþ¥þÿ„ÿûÿ5?~ï)i¢Ûæ²M¹d®ÿkÿÿþ’þjþ þBþÃþ'ÿ ÿðÿ4oÀBm¢¶«¡iî²PÅÿcÿÿìþ²þwþZþxþ‘þêþhÿäÿU¾2rÁáôæ}ûµŒv.çÿ‹ÿøþžþuþgþcþ°þêþÿZÿ–ÿëÿaéLŠ¿Ä®Ÿb ðŸBãÿÿ6ÿçþ‰þ_þlþ­þÑþÿ_ÿŸÿéÿuô&Jh{¡³²rñ”O¯ÿyÿ:ÿÿªþ{þTþ~þÖþÿ`ÿ¢ÿÐÿUÈ Wˆ­¦jÚé¸\õÿvÿÿþ—þcþ>þþ,þŠþüþ]ÿÂÿ]¯Ûa£±w`+Ò›YŸÿAÿôþxþ&þ+þPþ}þÅþ!ÿ€ÿÇÿxÐ Fk©¼œOõ™Q7âÿ–ÿCÿûþ¨þaþIþFþlþ´þ ÿJÿ’ÿïÿg¡Ö5}•¦Ñ¶TÈŽ7¦ÿÿµþ}þDþ þ þ/þþøþ&ÿvÿÅÿ0{Å[‘§«†:Σa®ÿPÿîþÈþÂþ¦þ„þwþoþ¡þÔþ2ÿÀÿ5 ë,A`td7Ût µÿZÿ ÿÆþ‘þiþNþQþtþ´þÓþëþ9ÿÖÿ{ÚPQv|n&ЗNÏÿTÿ%ÿ×þ¢þ™þšþ‰þnþþáþÿ6ÿ—ÿ#mÅFƒŠ™~FüìÛyŸÿ4ÿÐþ¸þ·þ‘þ|þ”þ•þÃþÿhÿ£ÿÎÿ(”%Œ¡¦Œ-ð¹f÷ÿ†ÿÿËþ‰þ*þ1þþˆþ“þäþFÿ’ÿÂÿx¿ðFd\nI#à?ßÿƒÿ+ÿ¾þŽþvþ\þ3þLþ»þôþñþ-ÿ˜ÿþÿI‘˜ºõ3s‰v:ÄXÈÿ‚ÿGÿåþŠþjþWþþ²þèþÿUÿƒÿÏÿV¹#ca\m^>ˆ&Éÿ`ÿÿåþÌþ¨þ‡þƒþ˜þ½þõþTÿÇÿáÿîÿMºô]|Ÿ”OÓjÁÿxÿHÿÿœþ]þkþyþuþ¦þÿþ7ÿVÿ¾ÿ2|·ì8v}_0Ö]îÿ°ÿiÿ$ÿµþŒþyþUþlþ±þÿ7ÿFÿ{ÿÂÿ_è@t²ˆ_0'Ýi·ÿ_ÿÿ­þsþbþ`þ‹þÍþìþ$ÿtÿÑÿ/nlšrc/YYͼpÄÿÿ&ÿ™þmþ†þ¦þÌþÿDÿIÿtÿÙÿîÿ5úQvŠf ¼s7òÿ¹ÿ‚ÿÿœþuþ}þ‰þžþÀþôþ$ÿRÿºÿ9È&t’Špc+ÔwNÀÿ=ÿõþ«þwþ…þ®þÃþÙþòþAÿÿ¿ÿéÿ<Ø)CH.üä ænýÿ—ÿÿ³þtþkþ‡þ¡þ®þøþ ÿ@ÿmÿ«ÿŒøI›¶¼oåVÓÿ©ÿOÿõþþvþþ°þÿ?ÿXÿ„ÿÐÿöÿèÿ4Ò;h¦ÍΧjÊÿÌÿÿÿQÿ4ÿÿÉþ–þ³þéþLÿ±ÿúÿ$jlo~· \2ù·^ðÿuÿ7ÿÿÅþ¤þ²þáþÿHÿ™ÿ ÿ²ÿðÿ0ŸkàÙ´”_O«Qùÿ|ÿ6ÿÿØþºþÓþêþ!ÿMÿeÿÿÖÿ A¤Tp…bPßé½Dñÿ ÿNÿÿêþ×þÏþÈþäþDÿUÿ”ÿåÿEœé^À½¬°´k×(µÿ{ÿGÿÿÿ"ÿ,ÿÿÿ,ÿGÿ›ÿ÷ÿ7›Üý W‘q\D,Ê`6ßÿxÿ$ÿêþÑþÉþåþÿAÿIÿ„ÿéÿd¹ý%/:YgAΑQµÿœÿdÿÿºþ£þ¥þ„þ¿þÿAÿ±ÿ$pŸ¼ë/If™@ÿ¶AÄÿsÿ6ÿÿðþÿÿæþãþðþèþÿ¬ÿD‘ÈóFY-õÍ´ŒUØÿ’ÿ"ÿþþþþÿ ÿÝþ·þªþÜþ(ÿ¿ÿ:Q]˜é 8_Z/#ÐDðÿ²ÿcÿ(ÿÿÿúþêþÉþÆþîþ2ÿiÿ¯ÿ(„±Ê @?2 ÕQôÿÌÿŽÿ0ÿ*ÿÿ×þ¼þ·þ¥þÉþúþ_ÿ«ÿP” 8Be]4 רvAîÿ¬ÿ`ÿÿäþþ þ®þÍþÿ@ÿrÿ¾ÿ2Tˆö5)íùæ¨bT¾ÿ¢ÿjÿÿÄþÊþÞþèþÿ ÿ9ÿpÿ§ÿÞÿ“ø._•§_ñ“p2×ÿkÿ ÿÙþ¦þ§þ«þÐþÖþÿoÿ¹ÿûÿ1{Õ TRøíÎ~RF8Ùÿmÿ-ÿàþ¶þÇþâþÿ;ÿ;ÿ:ÿÿR»êD4ýϨn´ÿ¥ÿaÿ>ÿÿÿóþðþÒþáþÿkÿØÿC­áÜî$49D+РgÊÿpÿNÿ4ÿÿÔþºþ þˆþ›þàþAÿœÿýÿ \¸ 4V1îʦ@ùÿþÿÌÿdÿ1ÿëþ¢þ…þŠþÍþôþÿÿpÿÌÿa™Ð %C"ãµÂŠ$Þÿ’ÿ ÿÊþ‡þeþbþ€þ¤þãþ=ÿzÿÒÿÿÿ=s·ZD þéµzy[óÿÿ<ÿ÷þÜþñþÌþ¯þÌþÙþÛþÿ©ÿâÿ7ˆÛéë+åÆÂŒ¹ÿŽÿQÿÿâþ³þŠþŠþ¦þ½þÏþóþXÿ©ÿxÐÛ0çÖÛ©CÙÿ‘ÿGÿ#ÿÿÿâþ¦þ–þ|þ«þÚþ1ÿ‚ÿµÿÒÿJv²õ!ຂ[B÷ÿ ÿ@ÿ ÿ#ÿÿÖþÂþ¬þÃþðþ!ÿHÿjÿ¡ÿU°â-×›ZJ/âÿkÿAÿÿçþ¨þ–þ©þèþFÿ˜ÿÓÿ j š´Ññ  γƒ Ëÿ¢ÿlÿ ÿÄþ¦þ°þÐþÿLÿ\ÿnÿÿ¼ÿóÿq¸ÕÖç óâ̆Åÿ“ÿ}ÿOÿ0ÿ"ÿõþªþ¬þåþ(ÿbÿžÿÔÿ6²ð,C?Y9õµ«‰:Åÿ\ÿ!ÿ ÿÿÿ ÿøþêþÿrÿ¹ÿ N‚›´ÊÝÆçôâ˜'±ÿfÿQÿ'ÿ ÿÜþÖþàþåþKÿ¦ÿäÿj˜ï/%6# 济lHæÿrÿ/ÿÿóþ÷þâþâþ ÿ<ÿ§ÿ 6]„ÅhxsXØ NÇÿœÿ|ÿHÿ!ÿ4ÿ"ÿÿþÿÿÿ7ÿ{ÿÍÿ6ežØ üȘ:Çÿdÿ'ÿ*ÿÿ ÿòþÁþêþÿWÿ³ÿîÿ8W|¼ewbC! å¶WïÿTÿøþÌþÔþÏþÈþãþ ÿ2ÿjÿ¤ÿîÿ&^²ú íãšÍÏ´}éÿÛÿ¡ÿqÿiÿIÿàþÑþèþÿ5ÿÿ _‘¬íáú*Vg†>Øÿ•ÿ`ÿ)ÿ÷þÞþÞþÿ5ÿ{ÿ¬ÿ¥ÿ´ÿîÿ:~öK…xBáʦŠ<ïÿœÿzÿ0ÿ%ÿÿÿÿ4ÿ`ÿ´ÿÿÿ9Iw×ÝÝÿ$%®~H™ÿ;ÿÿ&ÿ ÿðþïþêþÛþ ÿVÿ¨ÿI¦à)HoKêâž"úÿ´ÿIÿôþôþêþêþÿ9ÿ(ÿÿZÿ´ÿîÿE§å<R>ö»q*Ýÿ£ÿMÿBÿ5ÿøþçþÿÿÿ&ÿ]ÿÿ°ÿúÿ8–´·á  ôÌ•dêÿÀÿpÿKÿOÿ$ÿÛþÞþ ÿ ÿ ÿUÿ•ÿØÿE¦ØÃÖ$Ù¶£]Óÿ‚ÿkÿ-ÿÿáþÔþ–þ“þ©þëþÿHÿlÿ±ÿVw•¾ÐÜñè¹ ZüÿÂÿÿÿÇþãþÎþÎþÛþÃþÖþÿPÿ³ÿ9}†µÖøË«™•`)ïÿÏÿ¡ÿ]ÿ.ÿÿ$ÿþþÿÿ×þâþÿ8ÿÿ‰ÒààÑÖÛáÆ oìÿoÿSÿ`ÿÿìþîþøþâþÿjÿqÿqÿšÿ”ÿkÿÿæÿNµìËÉŸmK0 ÍÿŒÿTÿÿçþßþÚþåþîþïþ3ÿŽÿÿœÿÉÿâÿ**F%Í—S)æÿîÿ¿ÿˆÿ@ÿòþÉþ›þ¿þ ÿ3ÿ;ÿ?ÿWÿwÿ­ÿf¯êäÕ°~^OEL'Îÿuÿ>ÿ ÿíþßþÖþñþûþÿTÿlÿŒÿÁÿL“ŸºÆ¸£‚ƒm½ÿŠÿ/ÿïþúþ8ÿDÿ'ÿÿòþÿ*ÿ1ÿMÿÿÉÿIo¤âó·¢nIØÿ{ÿôþÞþÍþÃþóþ>ÿ5ÿ7ÿMÿNÿÿÚÿ6h“®¾½º»¿ÆÁ_îÿÿAÿ ÿ!ÿGÿüþÅþÏþÆþÿþ?ÿŠÿûÿ?~©ÚÚöëŽ; Äÿ¸ÿ´ÿ`ÿþþÞþÃþÀþÖþúþAÿcÿLÿaÿwÿ°ÿ·²¹Æ¯º³O¿ÿlÿ`ÿRÿ0ÿûþóþéþ×þÕþÿiÿ¤ÿúÿ GFp¿íöøÝŸVC'öÿÔÿ}ÿ+ÿÿêþ¹þÃþÿDÿ@ÿDÿmÿ¶ÿýÿKËãÔÕÓª‘pvDöÿÁÿ²ÿ§ÿ”ÿkÿ+ÿ ÿìþóþ.ÿpÿmÿyÿÙÿ3>p²ï#1æ—E õÿ±ÿ„ÿ;ÿ ÿôþÀþ˜þ¨þÿQÿ‹ÿêÿNC"I~Îê+<úºn9óÿ˜ÿÿÿnÿ[ÿHÿDÿ:ÿúþÿMÿ¨ÿZš¶ÆðýëÝ›Q++ ìÿÂÿÿeÿCÿ4ÿ2ÿXÿDÿeÿœÿÜÿ=ŽÚêòòA?7àqçÿ¢ÿÿhÿXÿhÿjÿZÿ7ÿ?ÿdÿÿÇÿ'j®¹Ëì)é…‰çäÌ”$¦ÿZÿFÿ6ÿ6ÿ5ÿ#ÿ<ÿMÿfÿžÿûÿN’Ãï" Ú·¥u4üÿÌÿÿ|ÿgÿ[ÿwÿyÿnÿuÿÿ÷ÿ,Qª£~°ôöÖp;òÿÌÿËÿÛÿ ÿ=ÿÿÿÿQÿxÿšÿÊÿ P”êòâÑÝÒÔ«Ž‰?ïÿºÿqÿ†ÿjÿqÿGÿ'ÿ?ÿ”ÿþÿ6-%\®éèGø±º¢};åÿ¸ÿÿ8ÿ.ÿ4ÿ#ÿ+ÿ:ÿ0ÿAÿjÿ·ÿùÿWƒ•ÇÁ×úåŸkr>ôÿÅÿnÿôþåþ"ÿSÿkÿvÿÿÿ¤ÿ¯ÿãÿ@ˆµó úÂÈLJ[îÿÿ@ÿÿ ÿÿ ÿÿ ÿ;ÿhÿ¦ÿñÿI„°ßêÒÀ›ŽX=åÿ„ÿ@ÿÿ ÿÿýþÿÿ ÿÿaÿ¨ÿûÿUÐô ÀsnJ&Þÿ´ÿlÿFÿÿ4ÿIÿ`ÿlÿsÿœÿ«ÿ¾ÿÔÿAx¡«ºŸv=ïÿÍÿ‚ÿ@ÿCÿEÿ ÿÿRÿpÿYÿzÿ³ÿíÿ I€l‡‚²ÙÝʬ˜p5ßÿ©ÿSÿ÷þÝþºþ´þÿXÿsÿˆÿŒÿ¥ÿÇÿ&CqÅ÷úá†_Y;åÿ­ÿ{ÿeÿ;ÿ0ÿÿöþUÿ«ÿ¦ÿ“ÿ¾ÿAZˆÆâ¹œ§Šmg.ÈÿyÿNÿHÿ0ÿÿîþÿUÿMÿ]ÿ‹ÿÂÿçÿ.6Iy‰ºº§ŽuKâÿŸÿŠÿ•ÿ†ÿRÿGÿ ÿöþÿ7ÿVÿ‡ÿÉÿùÿ%tŽ§âØ®”z~Cðÿ¦ÿpÿdÿRÿ6ÿÿÿÛþëþÿ%ÿ“ÿ N(q¬ÉÔÀZ<3$õÿ¾ÿ†ÿGÿ;ÿ?ÿ+ÿ/ÿÿ ÿCÿ±ÿÝÿáÿöÿBzgŸµ˜±…ba?ôÿ ÿWÿ5ÿ/ÿÿ!ÿ ÿ/ÿFÿNÿ@ÿyÿÊÿüÿ3u ¸æëØ©ƒçÿìÿ˜ÿmÿÿcÿ;ÿÿÿ8ÿuÿ†ÿ°ÿÓÿÉÿéÿ1/]f©»”` Ãÿ«ÿœÿÿaÿlÿxÿDÿ ÿÿ ÿ<ÿyÿÐÿ>,-jˆ‡¹ùÄ—GÈÿ‘ÿgÿMÿ2ÿÿõþñþàþ÷þ ÿÿuÿÕÿ>fiXg™Ÿ°YíÿÛÿÉÿ­ÿšÿqÿ/ÿÿÿ(ÿÿ?ÿ~ÿ¤ÿ¯ÿ»ÿéÿëÿ1mrq†q<"íÿÁÿÿÿÿKÿÿßþæþäþ ÿHÿsÿŸÿÐÿõÿ$ERj©À°–c`d?%´ÿIÿ%ÿÿÿ4ÿ6ÿEÿ…ÿrÿoÿqÿ’ÿ¿ÿ^·îÛâáÄ~Fïÿ±ÿ½ÿ¡ÿ0ÿ ÿ&ÿ3ÿXÿxÿÿ†ÿ¹ÿàÿU„ž¥Á±Â½“oO#õÿ¸ÿŽÿIÿ1ÿ2ÿSÿTÿ‡ÿ†ÿ¤ÿÆÿÛÿúÿHT‡©ÄèéÞɰŒf:Ýÿ¯ÿhÿ.ÿ ÿ?ÿfÿ‡ÿ©ÿÈÿåÿþÿEj‘ÎûÜò¤†‚b>=1èÿ³ÿ¦ÿ°ÿ•ÿiÿHÿXÿiÿžÿòÿ0St…«ÃÛAúå—]Åÿvÿ$ÿÿ&ÿWÿ\ÿzÿÿÔÿýÿ+A…ÇáÚÒÂÛîÆˆ†N)#úÿÒÿ ÿÿ|ÿ‡ÿ³ÿ´ÿ¥ÿÈÿØÿØÿÿÿ$p¸¶Æð# Ï{ ìÿºÿÅÿèÿÅÿµÿ ÿ‹ÿXÿcÿžÿéÿ@h‡‘šËÜÍÉêûОb ÌÿÐÿöÿºÿZÿBÿ7ÿ1ÿYÿmÿ´ÿìÿ>[k©ãçÒÙÏi?@=Åÿ›ÿ‘ÿšÿ¾ÿÍÿÔÿúÿûÿüÿýÿ -T¾f¥š¯Mùÿºÿ€ÿ—ÿ©ÿ—ÿJÿ)ÿ(ÿVÿ€ÿ×ÿ:N43q³'õÊn7?W^Ôÿµÿ~ÿNÿCÿ\ÿnÿqÿ`ÿYÿµÿâÿ×ÿA’¸ÙØÚÐʦt5ôÿÏÿÿÿhÿDÿÿ3ÿOÿtÿ˜ÿ ÿµÿÝÿëÿûÿsªºÇѾŸƒoBãÿªÿ‚ÿIÿÿÿGÿeÿ‚ÿ¦ÿ·ÿôÿ%rlge~ÁÓ±a,øÿÛÿØÿÓÿ ÿ~ÿTÿGÿMÿKÿ[ÿ•ÿÛÿäÿÙÿúÿ4S^¤çôפ‰m"øÿëÿÇÿgÿ.ÿ$ÿUÿGÿJÿxÿ—ÿ·ÿÈÿÄÿîÿE‚ ê¿iéÿÊÿÙÿ«ÿRÿ,ÿÿÿþùþäþ&ÿ`ÿ˜ÿÎÿ<Jai²§„hUeRk„I½ÿlÿLÿÿõþ.ÿtÿnÿ‰ÿšÿÁÿÛÿÚÿçÿ /X‘¤°¼¦eþÿÔÿÿ†ÿsÿVÿaÿUÿGÿ<ÿuÿ–ÿ¼ÿÔÿ $07I^x¤‡…£†Lëÿ­ÿuÿiÿPÿ1ÿ?ÿJÿ=ÿ2ÿAÿoÿËÿ ýÿ0Zw°ÅúÜ¡šFüÿ±ÿ¡ÿ‰ÿ†ÿqÿ`ÿ;ÿÿÿþÿ`ÿ…ÿÌÿ!EH7*Ke…©•Gúÿäÿ½ÿÈÿ­ÿaÿ;ÿÿÿ ÿ7ÿwÿ”ÿ¥ÿÉÿþÿûÿ n²¹³Æ°v-@?G&´ÿgÿUÿtÿŠÿÿ`ÿYÿRÿvÿ±ÿ¨ÿÃÿIGChst}cA íÿÇÿ”ÿwÿfÿVÿIÿ$ÿÿ8ÿ4ÿKÿ‘ÿ¸ÿÆÿíÿMq…yŠ®“a:åÿ¹ÿ“ÿ’ÿiÿ6ÿÿ(ÿPÿ{ÿ«ÿªÿàÿÔÿ¥ÿÜÿ3`^™¡¡±~M(õÿÚÿ—ÿyÿ‰ÿžÿwÿ>ÿ ÿÿÿCÿ{ÿ¹ÿÍÿèÿëÿ<`€«×ŃBãÿ’ÿƒÿŽÿÿlÿgÿyÿaÿ;ÿ=ÿ_ÿfÿ‚ÿÿ©ÿÛÿûÿ &r¾¬°´wE'Ñÿ»ÿ¨ÿ{ÿ@ÿ.ÿÿÿ/ÿdÿzÿœÿîÿãÿ#2K[Agˆy('úÿÌÿ¶ÿ§ÿ|ÿoÿXÿ7ÿGÿOÿaÿhÿÅÿûÿ÷ÿ#\wˆÃÛ¡S%!ýÿßÿÏÿßÿÕÿ·ÿšÿŽÿ‰ÿÿmÿmÿoÿ¯ÿßÿ >I\}¯¤§š†U÷ÿÅÿŒÿ˜ÿÄÿ«ÿxÿQÿ+ÿÿ_ÿxÿ‹ÿÐÿ(/<‘®¼Ñ¸²­})%òÿ¶ÿ‰ÿ‹ÿbÿ[ÿLÿˆÿ‰ÿ‰ÿ~ÿ­ÿôÿ!7r•‰nnsR8äÿÓÿÍÿÖÿ¸ÿªÿÍÿ¬ÿÿ¡ÿÀÿåÿ]‹[kg{¤ÁëÑš1õÿÆÿžÿ†ÿ{ÿrÿcÿCÿ-ÿDÿ£ÿîÿ #[Ї„±à±¯¸™}1 °ÿ^ÿsÿZÿ^ÿyÿŠÿ~ÿ™ÿÊÿÚÿ%EHIlŒÀäûûÜǧFùÿÐÿ·ÿšÿ¤ÿÀÿ›ÿÿ…ÿŒÿ§ÿÙÿ FXTPcˆqc†t\B4ûÿâÿÞÿ´ÿ‘ÿdÿHÿKÿ¶ÿöÿ &4LŽÓ÷òÛÇ¢yF,þÿ¶ÿpÿDÿeÿ—ÿŽÿzÿmÿjÿ…ÿÇÿúÿôÿàÿêÿþÿ?~¥¹Æ¥‹VE1øÿæÿÂÿzÿOÿVÿkÿ^ÿSÿ~ÿ­ÿÊÿ³ÿâÿ2z¿¹†c>>U.æÿÝÿÓÿÂÿ¦ÿÿrÿ^ÿ[ÿLÿgÿ¢ÿÛÿÛÿÊÿÜÿ&>y~€ŠXVU6èÿ½ÿrÿXÿiÿlÿrÿ|ÿ‹ÿ°ÿ·ÿËÿØÿQU[eq°Í¨•`(÷ÿèÿðÿìÿÓÿÃÿ°ÿÿoÿÿÁÿ´ÿ·ÿéÿ(/-Chiq}{c9 êÿåÿ!¸ÿNÿÿ,ÿmÿžÿ´ÿÌÿñÿ»ÿ“ÿâÿ4ºë®qƒ©¢h# óÿÂÿšÿƒÿmÿ7ÿÿÿQÿyÿ»ÿþÿ^|~s›½yD!øÿÞÿôÿÂÿªÿ¦ÿ˜ÿ•ÿ‚ÿrÿkÿ~ÿÌÿËÿ¹ÿÉÿ ;DOlZA?J=5=J1ýÿÈÿšÿ‡ÿzÿ[ÿXÿ5ÿ0ÿjÿyÿxÿ…ÿÏÿíÿÑÿVž¥Øã¬3% ¿ÿ“ÿwÿDÿÿØþàþöþ!ÿcÿ¬ÿ´ÿôÿ"=Z}‚œˆh__`&ðÿÝÿÛÿèÿ¸ÿ{ÿ6ÿ+ÿ-ÿZÿšÿ¾ÿÒÿÅÿH0ElkseG9ùÿ©ÿfÿfÿyÿlÿlÿuÿzÿœÿ¿ÿÖÿÛÿ:"D©¤zXS21<.ýÿÚÿ¬ÿtÿGÿ0ÿ(ÿ+ÿNÿ}ÿ¥ÿ¬ÿ®ÿßÿôÿF}ž…‚m]2ÿÿÈÿ³ÿœÿÿ`ÿaÿƒÿtÿ€ÿzÿWÿPÿdÿ‘ÿÒÿýÿGHI7XlusfEýÿÅÿ‡ÿVÿAÿDÿ[ÿMÿIÿXÿ¤ÿëÿýÿ'38SRP&<6ýÿöÿíÿÏÿ¿ÿ¿ÿ—ÿkÿVÿ{ÿ‡ÿ€ÿbÿXÿ™ÿÕÿ+g¦¦||“m>cpäÿ²ÿ‘ÿªÿ©ÿuÿbÿ^ÿ8ÿNÿvÿ–ÿÉÿáÿøÿL}”Á¿›ƒbe=Îÿ´ÿœÿwÿ_ÿiÿYÿkÿ–ÿ¯ÿÔÿ_qrWcŒ›””X"  ðÿöÿÁÿ†ÿ_ÿjÿwÿŽÿ¬ÿÝÿõÿÖÿëÿôÿ Ns³¸—«À’6ãÿÁÿ”ÿÿ©ÿ¶ÿ‘ÿuÿkÿtÿˆÿ›ÿ¦ÿêÿN†”‰‘«¹Êûø±Šk1ÓÿŸÿnÿ^ÿ0ÿCÿgÿnÿxÿ|ÿ¿ÿçÿ#UŽºÅ¼Ÿ›‹nlaPM5#éÿªÿŸÿ£ÿØÿÖÿšÿ˜ÿÏÿ*%PS@LšÂº±ŠqJ>%âÿßÿÿpÿvÿžÿÄÿÔÿÒÿòÿ.9‡ÀÉÊßÞǧˆvk< ïÿÅÿ¿ÿÅÿÖÿÓÿËÿ£ÿµÿØÿ 1._}Š£¿«Œ‘wl_I7 âÿÕÿàÿÞÿæÿýÿ áÿßÿ 'DaTˆ®ÎõÿÕxX' öÿàÿÃÿ¸ÿ~ÿSÿwÿÿ´ÿ×ÿL[r›Æ·‰uŽ›¢Å°MøÿæÿŸÿzÿ•ÿ±ÿ¼ÿÐÿæÿþÿDag‚•‡y:?]pn>õÿòÿåÿÙÿÃÿ°ÿ¦ÿ¨ÿÜÿäÿñÿÖÿÀÿ¾ÿ¸ÿßÿ÷ÿ*b[Qp–\O`A÷ÿëÿÁÿ{ÿ\ÿBÿUÿkÿ¤ÿÊÿ¬ÿwÿŒÿÉÿ"{£¶¼¨^hu]]SçÿÏÿ¸ÿ¬ÿ¤ÿ‰ÿ“ÿ{ÿtÿ›ÿ»ÿëÿòÿM]HVgaMd–r+ ìÿ–ÿmÿoÿeÿVÿmÿ‹ÿ–ÿˆÿŠÿœÿÁÿÝÿ1L¿Ä¬vC0LW,!ãÿ¼ÿ„ÿiÿNÿÿ ÿ/ÿUÿÿ°ÿÙÿ)4[€Š‚™›”kGíÿÌÿ³ÿ•ÿpÿqÿyÿ‹ÿ¢ÿ·ÿ¬ÿ©ÿ¦ÿ¨ÿ»ÿëÿóÿ.TP/SŽY5èÿ³ÿ¥ÿšÿÿ=ÿVÿhÿpÿ`ÿFÿcÿ¨ÿÆÿÈÿòÿ(œ­«¿¹c6-0÷ÿîÿÒÿ¡ÿ‰ÿ‚ÿ€ÿlÿ`ÿ{ÿtÿ“ÿéÿõÿúÿ+c{ZX~m}zZ5÷ÿÞÿáÿŸÿ~ÿnÿhÿnÿ~ÿÁÿôÿôÿ#?48W`[KXnd/1$íÿÃÿ¹ÿ™ÿ…ÿrÿZÿKÿZÿLÿdÿ¤ÿÆÿâÿ íÿãÿ3JcŠŽX"Áÿ«ÿÞÿìÿåÿ ÿwÿ|ÿcÿkÿƒÿ~ÿÿ“ÿ®ÿºÿåÿ%_t›•“›„K$Åÿ¯ÿ’ÿ’ÿ‚ÿ|ÿƒÿˆÿyÿWÿZÿÿ¬ÿ©ÿÁÿ¿ÿÇÿËÿ@x¤¨Ÿq?6.äÿ‹ÿnÿpÿqÿ`ÿ_ÿ†ÿ€ÿ“ÿ˜ÿ¼ÿÈÿáÿ 7*AjeS\gúÿòÿ æÿ»ÿ§ÿpÿ7ÿ5ÿ1ÿ,ÿaÿyÿcÿsÿÿÓÿ.€‘SPW3,#çÿÊÿÛÿŸÿWÿGÿCÿ_ÿ[ÿÿÿ©ÿÑÿÙÿéÿÒÿåÿ#o Š„oH óÿ×ÿâÿ¯ÿcÿ=ÿIÿoÿsÿ‡ÿ­ÿÃÿ®ÿ¶ÿÃÿÔÿÜÿ-LV\‹’‘câÿßÿáÿæÿÍÿ˜ÿsÿÿŽÿ¦ÿÕÿÅÿÂÿÅÿ¾ÿ¨ÿÀÿòÿ.fwy¤¢so{tNT[ Ìÿ—ÿ“ÿžÿ±ÿÅÿÍÿ¹ÿÏÿ¸ÿ¯ÿÐÿ hn«ÀÄ©¡—lïÿÐÿÈÿ¨ÿœÿqÿOÿIÿJÿvÿ½ÿ 2  Fp®ÂèÖ†vƒd5 ãÿ›ÿ›ÿ“ÿ©ÿ–ÿÿjÿƒÿ’ÿËÿæÿìÿîÿA~€>B€{•|7úÿÒÿ±ÿŽÿxÿˆÿ†ÿ‡ÿmÿˆÿ¼ÿÑÿ¹ÿÎÿ"e™ÎÌŸ‘yª°œs_'ÿÿâÿÉÿ©ÿ›ÿŠÿkÿaÿpÿ­ÿØÿãÿêÿÞÿüÿVЏœ›‡[?ûÿÃÿŸÿÿfÿcÿ?ÿvÿ¼ÿ²ÿ`ÿ`ÿšÿ¼ÿ ^­µ‘q†N1Pd*êÿÄÿÍÿÒÿŸÿnÿ}ÿ’ÿ”ÿ¶ÿøÿ!1Cmx‰tshggZÁÿ¸ÿ¾ÿÑÿøÿäÿ¶ÿÿyÿ†ÿ¦ÿØÿ÷ÿÜÿóÿ O†³¤“©ÄšUOKI4Òÿ¥ÿœÿšÿ˜ÿœÿ°ÿ½ÿÎÿÚÿ0k{•º›£Ø¾ŠbBÜÿ¿ÿáÿÔÿäÿîÿÊÿ‚ÿ€ÿ¸ÿÅÿÄÿóÿ$"q—‡šÅǃFJOH`i*íÿ“ÿgÿjÿuÿÊÿÉÿÌÿÑÿ¹ÿÑÿJ—¦¢Œ«Â¥p=Óÿ½ÿÛÿùÿÃÿ|ÿmÿŠÿ˜ÿ·ÿÖÿ:ZužË¾®…y}r\%Ñÿ¤ÿžÿzÿkÿ|ÿ…ÿqÿmÿ„ÿ¢ÿ¼ÿöÿ1is’–‚¸Õ§k^LPe] Çÿ«ÿ¨ÿšÿ˜ÿ£ÿ™ÿÿsÿzÿ«ÿâÿ]­º‹Zy†oŒ«Š.õÿ´ÿŠÿ ÿ‹ÿrÿOÿGÿmÿlÿzÿÎÿýÿ÷ÿ!/R‹ž‡RWN4 èÿ©ÿ´ÿ½ÿÊÿÐÿ¿ÿŠÿpÿ1ÿ ÿLÿ«ÿöÿ0xr?$>Xf‚^ óÿÖÿÃÿ¸ÿƒÿJÿEÿhÿ~ÿ¤ÿÑÿÓÿÐÿçÿ #[’“‚V9ÿÿãÿäÿñÿòÿàÿ±ÿsÿXÿxÿ˜ÿ¿ÿÚÿÑÿ¢ÿÃÿðÿ U‘~@+=8Aƒ–pEþÿäÿ©ÿsÿ‡ÿyÿAÿCÿˆÿµÿÛÿñÿýÿàÿïÿO~„_^˜­¡j ÿÿÞÿ²ÿ|ÿzÿÿ^ÿNÿ—ÿêÿÜÿÔÿûÿ 3>Rg”¸Î·ƒJ?&«ÿ…ÿ>ÿ3ÿ:ÿQÿfÿÿºÿîÿçÿTjXT^q€{Y<2kSáÿ™ÿ?ÿÿ7ÿ‚ÿ›ÿ‰ÿ™ÿ±ÿµÿ¢ÿÒÿßÿ7‘½À|]vjU@.""Òÿˆÿ\ÿVÿÿƒÿvÿ™ÿÐÿÞÿÐÿéÿPrh|Ž……0ûÿïÿÝÿáÿÓÿ”ÿÿ®ÿ…ÿQÿ|ÿ‰ÿ~ÿpÿ§ÿÜÿ"b…rahˆpVftAèÿžÿ^ÿ4ÿ=ÿNÿDÿGÿYÿtÿ|ÿ‘ÿ¡ÿÎÿðÿQL"øÿ9U• ]Ìÿ”ÿ|ÿzÿ‹ÿ‹ÿšÿÿ‚ÿ}ÿwÿ—ÿÅÿÌÿL=7RJ5QŸ¦büÿÞÿ…ÿdÿlÿjÿaÿPÿ:ÿ"ÿFÿ”ÿÊÿÞÿ" 8–‘}s}SE?3 ¿ÿ¢ÿ­ÿ²ÿ»ÿÈÿÿrÿ_ÿTÿƒÿ¬ÿçÿ4z˜•¸‘G öÿ «ÿnÿjÿcÿcÿvÿ±ÿÏÿöÿ#5czam€OúÿäÿÇÿ¡ÿxÿ^ÿ[ÿ|ÿ–ÿ²ÿÏÿñÿþÿüÿíÿÏÿâÿ+ޝ®©Ã±a÷ÿíÿŽÿÿ‘ÿuÿgÿ’ÿžÿµÿ§ÿ™ÿÓÿÝÿëÿQŽ¥¸¤q@#00øÿúÿóÿÓÿ¹ÿ­ÿzÿDÿ\ÿÿàÿ×ÿÂÿÃÿâÿ.^™™Š…waжSªÿ—ÿ¢ÿŒÿÿ¹ÿ»ÿ¨ÿ©ÿ{ÿ„ÿ»ÿæÿ 8Sp±»––wG6òÿàÿ®ÿ¹ÿâÿãÿµÿºÿÙÿÌÿ•ÿ»ÿ<<Wy žªxqU9* Íÿ•ÿ{ÿšÿžÿ»ÿâÿêÿ,%-;EªÄ¿±Vàÿôÿ õÿ½ÿÿ‚ÿ¶ÿæÿýÿ=d^h‰ŠÂ°~‚‡zh`G?/âÿšÿ¥ÿ¨ÿœÿÿ²ÿ¸ÿ¿ÿúÿ$$cŒŸ©—‘€G23 Æÿœÿ§ÿÿÿ¿ÿ ÿ’ÿ»ÿ³ÿµÿïÿ'1„¦iHo£suZIùÿýÿãÿ³ÿžÿ~ÿ}ÿŒÿ¡ÿžÿËÿáÿØÿôÿ#Gm~œ­z9(ûÿêÿêÿ·ÿÿ|ÿgÿ4ÿ)ÿkÿ‡ÿÄÿÛÿ&QšÆÆeUG+÷ÿáÿÝÿæÿºÿŸÿ›ÿœÿ™ÿÿ{ÿtÿ–ÿÓÿKVYlidjž¦…3ôÿÜÿ±ÿˆÿUÿ-ÿ/ÿ#ÿ_ÿ•ÿÔÿ»ÿ¸ÿÉÿ©ÿŠÿÛÿSx¡Ýû÷ÓI;_O9ñÿ©ÿWÿÿ<ÿXÿÿëÿêÿÈÿöÿóÿäÿáÿ#.B€…‹m_9O'×ÿ§ÿsÿQÿKÿpÿˆÿ«ÿÕÿáÿøÿ"b\0H‚—~rƒr>.¾ÿ_ÿWÿuÿyÿrÿ¥ÿÐÿ¾ÿ™ÿÑÿÚÿâÿ ]h\X|—~sr(öÿ÷ÿÎÿœÿ†ÿjÿ`ÿuÿŠÿvÿ¢ÿÁÿ¢ÿ²ÿjn”µº‘Œ“P ÷ÿ÷ÿäÿÏÿÏÿ±ÿ—ÿlÿTÿ`ÿ‡ÿ‚ÿ˜ÿ¿ÿÕÿ * "Yw‘ƒyqI/5.éÿðÿÐÿ{ÿÿŠÿ‘ÿ§ÿÜÿîÿËÿÊÿÙÿdÄïÒ…L;B=, ÉÿŒÿdÿ^ÿ{ÿ¼ÿÜÿÖÿÙÿÎÿÊÿÆÿÁÿäÿOik~y€{TüÿñÿïÿØÿ—ÿtÿwÿHÿ,ÿCÿeÿVÿ~ÿÝÿ "l‘¦¥‡qxuu7úÿËÿ|ÿ8ÿHÿAÿ1ÿgÿÿ™ÿŠÿ´ÿÙÿøÿ.93E]ohx\F+@3 ÎÿÌÿêÿïÿ®ÿiÿPÿ/ÿKÿ‘ÿÛÿÝÿ¹ÿÌÿ4T~™‹S<0ñÿûÿýÿíÿÇÿÿ‹ÿ_ÿ`ÿ^ÿžÿ§ÿ†ÿ˜ÿÖÿr·´¸ÀŸ‡€j\0Íÿ ÿƒÿŽÿœÿ»ÿÈÿÊÿzÿjÿ¯ÿ¿ÿ¡ÿæÿ.Mo„Œm,‰³±~>þÿþÿîÿœÿ…ÿÿuÿ¤ÿÃÿ¸ÿ¿ÿªÿ‘ÿ£ÿÛÿS•«±Wu„hM3åÿŸÿXÿoÿ…ÿ€ÿšÿÿRÿMÿŠÿÑÿåÿ(cnNUb’‡d2þÿèÿÃÿ]ÿ0ÿKÿVÿ[ÿWÿ_ÿlÿ~ÿ’ÿ˜ÿÒÿP¤¡–ˆqlx~pÁÿÿ‘ÿˆÿåÿ Öÿ¼ÿ„ÿKÿsÿkÿŒÿÆÿ1OM…’{£¿¾³‘(ãÿåÿ×ÿ¾ÿ¸ÿ¦ÿpÿaÿ‘ÿÄÿåÿ>%üÿ òÿ4dœ¬¶|< ýÿÏÿÕÿ¾ÿ}ÿ^ÿlÿ{ÿVÿxÿÆÿ^ª´‡q‹lŠƒßÿËÿ·ÿ¹ÿ¿ÿµÿ’ÿ¦ÿšÿ™ÿ®ÿÝÿÝÿÐÿéÿ %P58DNEgp>ñÿÛÿ½ÿÓÿËÿ‘ÿrÿ`ÿjÿwÿ‹ÿÿÑÿ >Oiz‰¡™h\H''(Éÿ ÿ¦ÿÄÿ·ÿžÿ¶ÿ™ÿuÿVÿcÿ­ÿÇÿUr‰š°«š ¤™X Üÿ¬ÿsÿyÿ”ÿnÿqÿ·ÿíÿÙÿÿÿ!;D\»Ê¨dgw„W-ïÿÇÿŸÿ‹ÿvÿTÿdÿ~ÿ‡ÿ”ÿÃÿêÿýÿ BG}¨‰YDTU ñÿ«ÿ~ÿ”ÿ_ÿMÿ]ÿ°ÿ½ÿ¤ÿyÿˆÿ·ÿøÿ<…«—m\WmiZqXÎÿ«ÿÿÿ­ÿ‡ÿdÿ‡ÿ†ÿ„ÿ†ÿ”ÿœÿÀÿVhmyqŒ¢™I»ÿžÿkÿXÿ„ÿ¢ÿŠÿ¥ÿ¬ÿ·ÿ¡ÿ›ÿÉÿ8c‘†|`NXcV5¿ÿ…ÿcÿbÿaÿxÿˆÿ}ÿwÿfÿ~ÿƒÿ›ÿ½ÿÛÿMsgw€v{vU)ÐÿÈÿÖÿÃÿSÿ*ÿ!ÿÿûþ=ÿ„ÿ¹ÿðÿ-b`W^jxkpjKáÿ¯ÿ™ÿ ÿŽÿqÿÿþþ ÿ/ÿ‡ÿ¼ÿàÿÊÿŸÿ¦ÿàÿ7jh}D/UU1#Ùÿ¥ÿ˜ÿ›ÿƒÿgÿ_ÿrÿ‡ÿ±ÿØÿáÿòÿåÿÖÿåÿ7DrmVJtXïÿÔÿ•ÿiÿXÿIÿ3ÿÿ#ÿ"ÿ9ÿdÿ›ÿ¤ÿÈÿ+CTޤŸ«´‡_+Ýÿºÿ‡ÿGÿ@ÿCÿCÿAÿ5ÿÿÿLÿ«ÿÚÿ÷ÿ>H:P……‘œ‰GûÿÎÿÍÿÉÿªÿ¥ÿ ÿ™ÿsÿ,ÿ&ÿ\ÿwÿ‚ÿÊÿ 1SF:<Y`A/ìÿ´ÿ‰ÿqÿ%ÿ*ÿ@ÿbÿNÿTÿOÿAÿ•ÿÄÿ”ÿ¹ÿõÿ'PjypembE6æÿÂÿ¥ÿÿ‡ÿ}ÿnÿTÿ=ÿ.ÿÿ%ÿÿ",I;]zusS9öÿÏÿ¤ÿ_ÿIÿBÿ/ÿÿÿÿMÿpÿ•ÿÈÿöÿ6]¥šzwR ÔÿÀÿÈÿÛÿ¿ÿ¢ÿ©ÿuÿÿúþ.ÿ`ÿ”ÿ»ÿÂÿÐÿ .<F-1;hV7I7üÿÂÿ”ÿ€ÿrÿ„ÿÿhÿZÿmÿPÿ&ÿFÿŽÿÂÿñÿH@("\gc bRP(÷ÿÞÿ†ÿNÿ?ÿ6ÿOÿbÿfÿŠÿ©ÿœÿ°ÿÝÿÈÿåÿQ›®”š€1õÿFÄÿÈÿ¥ÿdÿXÿqÿPÿ\ÿTÿTÿ†ÿ‹ÿ¶ÿéÿ(5>5CiŒz‰_0Þÿ½ÿ”ÿsÿZÿQÿkÿ˜ÿ˜ÿqÿ|ÿ±ÿ ÿŽÿ¢ÿ¾ÿÓÿÍÿ‚¤rqˆrth>çÿÏÿÿ‰ÿDÿ ÿÿÿÿ=ÿpÿƒÿ¼ÿøÿ!;b€zRcnM5I`[/Õÿqÿ-ÿÿÿcÿ†ÿqÿƒÿ•ÿŠÿŸÿ¡ÿëÿ7}Œ–Žw“rpixN-$öÿ²ÿtÿ8ÿÿÿQÿ†ÿÿžÿÿ†ÿ¤ÿåÿZ‡…p|W6J4 ÒÿvÿJÿxÿŒÿ¦ÿ ÿªÿÿ’ÿ§ÿúÿ->_tx«óüô« ¢ÿŒÿÿÿ¯ÿ°ÿ†ÿ_ÿ6ÿ?ÿƒÿâÿøÿ!Îÿ©ÿÈÿm²ÒÓæ±n$ %þÿæÿ¸ÿ_ÿ`ÿgÿ[ÿ7ÿ‹ÿÛÿéÿÃÿÔÿõÿ9v°ØìÈŸ«ž|a@2ëÿŽÿmÿKÿ*ÿ?ÿOÿGÿXÿxÿ†ÿ“ÿÑÿWމxm|WL‹¥œuS¥ÿxÿpÿiÿ’ÿ“ÿ¤ÿàÿðÿèÿÝÿÇÿÕÿûÿUŽ¾Âª~N)åÿãÿüÿÃÿ‚ÿMÿSÿ{ÿÿŠÿ¥ÿËÿÚÿáÿñÿ=w°µ–}‰˜žv]( àÿ„ÿNÿ~ÿÀÿÐÿ¨ÿ¤ÿ•ÿfÿ}ÿËÿ.Xz„£­¶°Â¦cNÎÿÆÿ­ÿ†ÿtÿgÿ7ÿÿDÿ‰ÿéÿMefB;…¬¦š¢m9¿ÿ€ÿ—ÿÿ‡ÿ¨ÿÉÿ±ÿŒÿmÿbÿsÿ¾ÿáÿ 3Z{—±ª¡›™[îÿüÿÙÿ¹ÿ¤ÿˆÿ]ÿ[ÿkÿžÿ¼ÿÃÿëÿÙÿ7“®ƒ”¥”zb1ãÿØÿÏÿßÿÑÿ¬ÿ„ÿŽÿaÿ[ÿiÿ¤ÿÙÿ ùÿ*{¾¬ºª‡ŠB!!Éÿ¥ÿ^ÿgnustep-gui-0.24.0/Sounds/Basso.wav0000664000076500007650000011005411240162532017000 0ustar brains99brains99RIFF$WAVEfmt D¬ˆXdataŒÿËÿ þÿåÿ?€¡¡«fðÿÚÿõÿÑÿ¿ÿ¾ÿ /ìÿåÿ]§§y’Óè~ Ëÿ si9OEóÿWši%üÿ½ÿ´ÿñÿ0RvÀÍÀŸ”z¢ yw„nQxv¡  ‚}•¡¢ŽÁÍozÄÐÄÚóÔÈH0ûI%×Ô=[T6 Úã&N&&<#̹åXw4ù%V?Nf=7vrdCõò+LNzŒR5OkF*[S  üé'FF`¬·†h]06FT]KHiƒn^;4/®®cŽyCUŒtìùWƒna8"4‚›?õ½.>COƒÄÈȨJÅ\{»ÚE-û$È¬ŽªÔÙÕɯ’o‹¹þ!é­ˆ…ªâþ쥜¬££“‰˜Ã‘e‚½÷ØÓë˜`t9ØÿPõãµ´¶º^»ÿïÿg5hÇw ˜aÐg/ÁÿµÿxǼ“¸ÿçÿy£´5^eêÿÐÿ%\Œ{Z¼ÿÆÿ]–ÿ–ÿÞÿEÔÁoMÿÿE ÀÿÅÿËÿ¿ÿáÿïÿÉÿÛÿ@&J@3ßÿcÿ‡ÿÂÿóÿñÿæÿúÿ5¶‹þÿçÿéÿmÿlÿÇÿ¬ÿÖÿC=ûÿ¹ÿhÿWÿ;ÿÿ´ÿ< TëÿÄÿÛÿ’ÿ¾ÿ26Øÿ†ÿIÿ…ÿ¿ÿôÿOoÿ_ÿ¦ÿâÿ³ÿxÿ«ÿ`ÿÿƒÿÇÿŒÿîÿ>ïÿ©ÿ%ÿ*ÿCÿDÿhÿdÿTÿlÿˆÿIÿoÿÿàþ’þÿ\ÿCÿ8ÿuÿÙÿßÿÉÿôÿ£ÿüþòþ ÿëþîþìþÿUÿ1ÿöþ,ÿ(ÿáþMÿUÿ"ÿxÿzÿ7ÿ¸ÿÏÿLÿ#ÿÇþqþ¡þòþLÿYÿÿöþÑþ†þTþþôþ›ÿfÿ¤¤:2µ:½ýž÷]ïwçräöç(ñý—± \ƒŸöǾ.ñâ©ÛXÞ(äŒæ&äøá‚æðób^%Ï&:!j¿l ”õ²à;ÏÈ4ΣÞíð¨üqÿUý…þ ¥$+á22.î8?òÿüü(øï±á\ÒUƽÙ΄æö#‡9FBLÏI§% $d‰¥¶É}!Ø.52^(tº µ–"¬ŽæjÇK©ô$W§O²tê«/ mÿÆ{ü|ö|îm>)òèµOœï‚Ö†ˆ¡O»Þ܉êIúûÿW 2&Iñe t8q‰dOü9¤# ÅìeÈϧ›°¦bÆ í§à#Á&¼Ú »ýõö?øðÿí d¤ ¶ôœé)ÛÃ[¥xT‘J­mã†)õhþH|ü{}”lEòŽùeé(Ö0ÖsÕŽ×¡ÛØÖŠÔ#ȘÄÔÆÐÂÝŒïØs,ª9Ø<4à 5rï'áxßZåZî÷ÈH Õí&)H!«¼öµÞÇß®/–ȃ€bá€Ç„Iœ¥ÕkGZpýC|Ï|pULà­êóÇ]©'Ÿâšz¢¸¨„¦,¡Y¢…³tÓrû»"ñB.X&_4\†N7^>æÎµ,€0ƒ”’Ƹfïl k@ƒJ#Bû6…'z¥ÎîÐÒñµ.ŸœŽi„€6ƒ±Šê“ñ™›¦qÕñ%%âRˆnÊsðaðC%˜ 3ÿ¼Ó²ýÞìâÙÊË!Ĉ¾ó¸U·@¿RÒÈîjV54R•]>S 8)dûFé­âXè.öŒ!œ¿ ˜©òÊåÿÛìÖ ×ÜêäËîR÷+ýÿvþ¦þ=…ò ´•8\Årîp„U,Éëîç–åàgÔ§Å–·!®·­X¶n–ΓÜ)ósÎHesþD}Py´c`0ÆúqáÍoÀØÁÃÖósxE=`qlxk,fïWõBˆ)D~ìçØÿÊ}ÆÎÊ'ÔNâÃõ§½0ÎT5tþ ~{coqGø9ïŠÜ¢ËÈÃ̺дl¶ÀºÃÆûÏHÛ-ëþ¨¢6ˆQh"tjwM "´óÏɰS¨¯©½^Õ’ó<5Q®cHh[ Cú)+ xØŸsÈ›öAéâÂå6òN׬• ›c8ý±óÌå?ØÐ/ÒÛݪñê]BÛ ¶ó |݆$,Œ*"oTùûôì¥äýâÃèºö@þ˜ÐND N ™‰ž!Ã!ⶤóZèUá^܌ډÝå3ñJßC*7:×6Ë.â!çÙû0ë‹á„Þ–ß„ã;êHñžõŒ÷Ûüâ à˜,k9UC]HZB"1ë3÷@ä¾ÒÉùʇ×ì}m Õ û’` \ | c ÊqÑ÷jªÑüáïâÂÖ-Ò'ײâXîbô–ò‡ëÀã;ÞÜÁݬä©ðVþ¥ ¿Å~ Î&¾%&õáçßíÙøÙþßÎç íUòøû½¬º a n¢®¸€ù.ñŽéðãsàCÝÙÕÌÓ»Ö˜ÜîâzæKã(Ù¹ÍdÈwÊHÎíÏÒQÖfÛà–çºõëÉÙÊÁŽ –R1õpèUÙØÊÈÁÁÉךåºîlðEíëËí*õáþCr¿¢$°'ü%”\ ÷+àÎeÂr¼bº»º½ Ã@ÍÛÝëÿ¾Vv&O*­- .?*¿ þ±ô-æ1ÝüÙ¾ÚßEçðñîû«B åýuùtöÀõwöéö›ôØîÆè åçäèþîúïÎW½,…>ÅNÒV—Qº= lìíÞOØZÕ:ÓÑ¿ÐÖÆâ×ò>Þf ÝL4 Ù–v/f—¤,ëŽ*‘ ü9óôí–éjæSç[îŠûa ;U,8Í>™;è/¤!Ùþ²*­¬mž ¼AÿJýƒþÖÿ?ÿ‹üë÷<ñðéMæNçàéðêLëÌíô$þ ¨å0)@åE¾@%4$¢bÍCûÞïKÝYË“ÂdÉ=ÒåÛ¡å‰ìsñúz $57`?ø=€6j+cÈ%ÐQøÒíå;â_â‰âÖáââå¿æYæ¾æ>éìLíþìðëé¤ä³âZæžî–ùȘ>(î6*>6>l91ú$ŽFŒû²î©àÒÇêÀª¿iÀgÀgÁ»ÆøÏÚ&åàò~óëhÁ^ ï©úã÷&÷Uö„öúüÚ·Îú_ï®ãúÚ.Ø)Û­ßEá Þ ÙÔÓÔ^Û‡æØòlüá|8 w$LB ±ÐÿPõÆëƒã|ÜÙ€Ü æ!ð†öðúË© ëI ê%t*þ-/ -þ(1$¡fÁ— ¤ ± ? D…û=ï<âŽØaÔ†ÔèØèá!íöIúŒû ü‰ûáúCý3% ÅEÙ¼"$ü ®‘ öçýñõªï»ìmë±éZçååæëè!ìåð¡ø'Y ªÿá *ä0œ3›3É3½5Ô8Å<ÐAeE)C8|%áŽú=çùدÓöÖâÞÐè ö´üŽ,-<¥IïRXW0XsWUïPŸJË@ù3œ%û=µùzô#õöõ…ô,ö¬ùýýGN zSF[|z m 7×sÝ~˜!A*^6(CeLÎP4QêLBm3&ïÏÃ7üŠûü™þWi¥ á (  Xr(")Ò+”)ä$í"£$Û&´&[$ê #/ …ÿ‚üYøtô’òMòfôû)Ó › £ö{ð(ðµôÛúPÿjÁ\ÔÀ\ý7õ-ëyà¼×oÓpÔIÙòÞäÝç_éé¨çèå>ä4ãFãmåÖêÜòïúh¹S%eù»íZâÃØYÑ7ÌWÈzÅÄ ÄªÆ!ÌÌÔ”ßWééïÿòwóÌñÅîì¥ìoíôêÈãÇÚ7ÒþɉÁ ºã´± ¬¨¥C Ü4ŸG¤¢¬7¹DÈÖUáêVò'ø¾úÜùÝõAï°çÄáißfà˜á á*ß¿Ü\ÛÛxÛEÞüãdéäê$éËçýçç!ãÞ½Ù”Ö›Ó ÑÁÐgÓ Ø ßŒè‹ô‘# ÑV§z‚ ëYþ(÷ÓïÞç%á@Þ¶ÞÀßqáæ~í\ô7ùýºÿ¨ÿ²ühøéóÅîméå´áñÞ;ÝÜ‚Û#Ýhâ£êÇò˜ù%‚ â…-ÿùõ>ò÷ï¼íèì{ï—ô†ù+þ©k¡6&v.4U8‹9œ5¾-û$eX¯ +Ïÿåû‰ø™ø«üMûÖe ˆˆ.E.² ;_£’ Ò ' ŽûF({ƒwÍ©( ¥ÿÈûâ÷¼óñõðþóÿú®)Ý#12Õ?7K¶RXUÝS÷NÉEâ8º)¢{ dþ÷õÞö½úKÿÁôOL®!×*R3l9¹:Ë6È/(¨ Ê „ p"Àaf Ö b ý * € Ï – L  f Ý  …uÖæ(º/s4˜79û8f7G3E,Œ#Jj «]h¾ z6¦¦þ³üþDA4eÊ(6Q@GAKfL˜I:Cû:¯0æ#¹@áûñésäâÃâIåRêÍñ»ûztÜ!'.¸8GAûF‘IeI2FÌ?¯7¢. #¼á]óæ‰Þ”ÝPãhì-ö¡ÿ1 žf˜GD'ûôð¦éoåiä9æÆè,ëIï×õÜýú• !B[íc¬Úî vJýïõýðÙííŸï©ôªúe) VõÆÉ‡Iº ‰£õåÓƒÁ³?©¤t¢%£X¦~­Q¸ÿÃJÎÎ×:á¬èÊìÕïÆòsôgô[ó"óDô®ôÐó]ò†ð°í”è{áVÚdÕÓÛÑTÑmÑ%ÑSÏËxÆ÷Ã;ÃøÂ˜ÄêÉ Ñ ØÞxäŽí+ø…\ bì$‚ üÿ#ñçàŸÐ5ÂÁ¶×¯—®/±ì¶WÁ›ÏŽÞÿêùó¼ú£þ‘ýøñ>ìÝçzäãâzãçå)é¯ìÉïòð*ðTîCìŠê—éé{èWçÅäcáZÞ—Ü²Ü ßKãéLðùúg ht!ÿ#¯#Èß> àþòûæóÝ+×#Ó"Ò}Ô)Û;åhðtú& Vø>aË qY"Üÿgì”hžÞÊ Z {êÉ Â½4ü#ø¥öå÷Bû- R  (¼#&•(u((&¸"o{’„Ç A ;§ý"üªüzÿý© 3* 2 õ 14ý³V " #É"§ LrÌÀè 4 ¤  ( D d >–Ÿü´ùøt÷Î÷‚ù‡üýÿ”Œ›”ë ) à a ] Ü ú > t $˜· ¸Pìýüáûêü;ÿÚuÝæ-uf ¡‡âZJþ¾öäðîì­ê±êùì*ðQóe÷Âüc?È oö{©X}Æ8¯>^ûcïãäBÜ©ÕÒãÒ¨Õ»Ù´ß(çåíòSôBöÅ÷‰ø–ù™ûIþC-PðÈþ¸øó!ïcî²ð ôwöø,úýÁ/× g qr Ê_©þýüüÑûBý^"À jÔõ'÷-20.å(y…ÿ ±ö´îéæÀäÿäçæŒéAì‡ïnóe÷fû’• -Ô°! 'ì÷ü¿úcùUø÷Íõ[õ¤õ0ö¶÷vúèüÎýdü§ù¼öÁòží¢è–äKâ8â¯äê|ò[ü²4[â W$ª%f%¯#z µ ™»Ô H . hýsƒþ-ÿ‹‹J 5™µÓ§é“â Bª ûÔõCó–ó€õ…ø÷ü¤]3¿®+àa"¯  |=ù› ± ¹ e ë¥ÿëþKþŒþO»¿ Ÿ“wò,½²OÑQÐz † ÊœYÿÿB h>Oa!<ÿæ ô   ÞµÝ-â;ƒì]+¥ÇTþHø:ñêîãLßsÝÔßàäwê4ð‘õ·ùüû‡ü ýþ›þ¥þÑÿ-²éˆ²Ü™]ÿ;ÿÇÿ"„€ # @‰ %û.ó°ë¼åámÜØÕÔdÓíÓ¢Õö×ÔÚ¢ÝÐßâ-äæ1æ¬ã–à[ÝJÚÀØ9ÙŽÛMß&ãñæƒêªìüì2ìÂêÁç•ã]ßÛ×¼ÔGÔ$Õ#ÖŒÖ×ýÖ‡ÖÐÖ0Ù5Ý8â±ç€ìfïñKñðííãëÇ騿pãEàÞ}ÜíÛÜdÜØÝzà(ãìçÿî÷†ÿÒ¨ J‰  ^Kÿµú$öüñÆîuìZë˜éçäÊá÷àâ©ä*èºí"ó:÷ãøø÷ öAó?ïôëYêKêqê(ì4ðyôùþÆ´ªÿý#úI÷ôžð¨íÓêˆé“ê‘îöqÿ„Œ3’#S)V-¦/®/è,:(Y"Ø¿˜\ gVý÷MòCïxïó[ù„å ô” {%•(û'%.!Ô™R~ E_®AôÿmÿØþ”þÿ5ÈIÌj *DFȘ!@$.&'.','ß&Ç%Ž# õ"#LΚ5A¨¼6TìVE;è†ùðò9qw[z ­ re´o”ùÑ]pÀK+f¢Ûòy;ßà ( ³§®H£Ó\  n x Y ƒ7RñU\+Tf@Ø,¡½4a<oª Yè@Ë~•& CÏ  _~< `>½¨%ÖÕ$1(I*2*'.# `x ñÿ°øyókï!ìjépçæËä]ä;åbèªîûö^Š dÞé"Ú%0&Ø$÷!K÷,ÔÇ dˆD¶óй9|Þ Æoüe÷`ó ñŽðEñ‡òô õT÷$ùÂúöûüÜúBùë÷ÉöÛõºôúò€ð`íê_ç‹åÑåËç¢ê¯í ðñ>ò£òäòîò°òÁñmðÍîÜìÀê˜èææÞå&å©äÓä„å`æ?çéè¨ê$ëHê€è¸æQåÏä¬åyç7éë2îöñ õÆ÷Pù£ù£øïõ¾ñüìkè‰äáÞgÜÜ&ÜîÛãÛ¶ÜÜÞ®áå·èìúîañéò„ó9ó>òGñ¸ïRíhêçúäpãã[ã°ãÂãmäŽåÆæOèêSìÓîõðûò—ôöÝööºôËóôðõ`ùËýE â* Ú XzSýmúŽ÷Öó"ïoêšæ…ãláüàMâKåÔéáîKô[újbM …™ý ž ɵŸÿBþÀýþÿ­$ { Ìê7Èn0 Ü b½z(°ÌÿSýû8úwú)ü³ÿ¸$m Ü `DP»L½]UË-ƒ„v™¿sø¼ ñ Ç p3:uÿeûÃ÷ïô¾òPñNñbòÔóõÒ÷áúlþe""` N ì É¡-Oþ.üàúÁúnû üÚüOþLÿyÿûþÏý†üšû{ûü7ýªþâÿ_· æ} U / ÞåXn “ÿý–úß÷×ôéñÙïïžïõð’òNôfõºõöK÷ù/ûBþaÇUS€>éüøøó_ðåíìcêrèæ¢ãÀáÍàGá}ãQçÍë|ð$õ"ù0üéýþÇüVúÚö¶ò–îë]è æFærçÒéØìËðÍõûÏÿÊç  ` ºÞûþáþ—ÿ=©Ôõ ~ ypõLnÆ{_Ëê­m  ì½pŒÿëþþÝý¬ü2ûæùù÷÷ÉõîòGð(îÅì¶ìÆí–ïÎñ]ô]÷œú ý˜® sK q €  å–m²{}r|œ² › Õ7šy½ „#ó¬äú«ì1§ t öÀ§ ï  B |ô†^,mñCàü¬ ˜ © ¤œMg-.ó ¾`«"uAÈÌ@»>¤ xpù8UF4× <©G¶!|%Ñ(6++ê)†&C"Ñ}Üüeü o ¡ Á ø ö g 5  äñ• Kéÿ ýæù÷@õ@ô­óŒóôÌôködùÉüåÿ-Ù¢ç|üéþ&ü&úùÆùÆùèùûæü"ÿÝRíŸ Ž mç Ö ÆG˜ú\õ×ðUìûçOä áÞVÜ_ܵݧßòáj䥿ƒèãéËêÙë•ìí¦íMîKî]í÷ë%êèþåúã8âCàíÝÛ½×åÔ­ÒMÑÙÐÕÐÞÑÔˆÖoÙ÷ÛkÞáýá™âTäÉääã â\àØÝÚóÖ9ÕåÓÓÎÒ„ÓÞÔIÖˆØîÛ9àÔä³éäî[óþõ†÷èøŠùÙù«ùÅømøÿ÷¬÷V÷}öœõ¹ôÝóKóó÷ò†òñð ïžíIëÄérékéŠéêŽê‰ëìDìyì¬ìãì¿ì7ì^ì£ì¾ë¢ê_êVê¿éWéãéë«ìîï¦ð¡ò–ôÈöúþ(ˆ  Ú ,Þ‡LÉ ¸ oB÷×ÕÁm\ãG*Õÿÿ=ÿ~uòÌÜ L ÂÚÔǑΠk ¨šåSÞn£> b ê¬~W¼¡q–b‰k«‚ºS®S::Î'™ö®úÄ0 wŽ^ ¸!/"("p!ºX™SÓx¤ q Ñ ¼u|BcÕü²%™Ê ™  Œçñ,¹arSÔ¸b„$xË y œw.J¸#ÿÊýPýþ·ÿóí8 Z“ 8~ œ!P"ð"c#+#ñ!ï”ÐÓšš–÷ç §I¹p„W* X ºâQÿgüúèù¯ú•üÁþNöõ Öx É A zø+A_; › Xè9  V'%¤^ µ €8bª£Ì¼Èéù†é Ö Ï @ 'N!.fZþ|üëúùÀöô{òæð¼ïïäîïRïIï\ï ï.ðvñŽóö¨ønúû*û_ûåú—ù”÷õKòMï8ì–éOç`å„ä_äZäuäÜä‚åæpæçEébêñêåëíïí¾íDí¢ìRë¾é?éùéÃêýê¨êêBédè¿ç³ç è­è’éë5ìÉìšì¿ë+êèøå äÝáàŠÞ†Ý½ÜwÜ6Ý ßqá¸ãÜå½ç>éfêëbë€ëŒëë—ëëeê´ê›ëZì:íPîhïÙð©òáôÇöx÷;÷AöbôwòÙðï@îÝì;ëeé´ç´æëæèPéßêÊìÌî,ðûðôñóªókôöÁ÷ùHúûëûý³þV€¤¼Alæ‰+eÿþ ü½ùpø2÷Õõõ¿ôõ+öøìúöý•Ö=½»Wû6„*,·3Æé  ó U ˆ L É ‚ ZR£¼T˜žt‚wfR:ƒ4•æ‘ Û ñ›?1ýFúå÷höö–öÅ÷¶ùùû+þÛÿ”D´ÿ'ÿìþÿLÿ¹ÿH³A?+0˜þíJ(N^ç%¥ÿ–þþþîþL—«h(ñ¬6‹lßÿ#ý}ûúuø¾÷ò÷µøÍù0ûÌüDþÿÿÉþ&þùüžûDú¤ø¶öêôôQôZõ>÷úéüQÿ|…ï‚tãIÚ×ýzú÷có¡ïnìÒéçTæ"æ‡æ çùç¤éõë@îšðøò³ôÑõ³öm÷¼÷ë÷º÷ìö¿õ×ôCô+ôÎô¥öeù)üçþà Á ¼ ë Ûž;Âk®ø9^À÷,º „  &*æ+›þeü¿ú¶ùNùùÑøyøÃøfù¨ù?úYû:üµüùüý×üüTûïú‡úEúú$ú@úÐú,üêýªÿqÙv’àT Í ¸O@lí¢ŸŽ]ŽÆÞRO i<>Í?λú6 ݣݩ Œ"”#Å#ó"¿ w,( Yng0tœÆ‡ûÓ › 3Z“§Å-kÉ'h ³”öÓ §Ú î Ujp“¢«t[VÝvv ´ m ÿ÷Œ{òÅÝ  !ïrª^5©xàÇ“î ê û n užBq ì °  T@ÿþ ýbýUý«ýžþäÿo%žËÌt÷ûSX=„U@øÌjRætÅÿõþìý‰üÑúù÷;öîôBô¹ôyõýõ±ö[÷t÷5÷¿ö=öÀõ)õXô#óùñ¶ðXï&î#í ìõê#êœéLéôè2è^ç—æ¦åüä6ärã’âCáüß ß#Þ5ÝHÜ)Û0Ú0Ù[ØØ£×/×8×c×I×ײֵ֧Ö9ÖÃÕÖ©Ö Ø5ÚrÜzßöâ˜æ÷éÚì.ïLñ¥ò”ómôQôôÝó˜óóµò˜ñ@ñ,ññbñXñnñiòeòÍñÅñañ’ðï^í‰ìïê0éAèæ:ä›ãVâpá·áâãŸäÃåÁæíçÅèWé§é¹é“ééyèèæè‹éòêí˜ïÆòÍö9úý(,®^S ˆ‡'ã7ÿeý¼ûúú—ú0úDú°ú>û%üþüÊý}þàþPÿ>~ï7-Ö›~*r2ßeºA×pßq&Öœ’Úz¾’• ¨ K ÚR|i®üû^¬ rÝ~ j{[Q‰–oÐAõ C  8 × ¶  “{*“<»†YáO F$ªëE 9ÀÉ¢N¤—¤íÂfLñYm ,ŠèÍýŠû úfùùAú{ûZý°ÿN£”ÄÎ G º ‚TìYçÐL2ÝÈkˆ‹Uì`éN“Ž¿æqÁ[þ¯Ãá  u Ä ¼ Ì ¯ ï ùœt€›Æ­ó-§;¡ Ê 2 â K Ê 8 z)~1 Ô Ï  ³ ž×/àøÜ÷oÁ È Ÿ ( ïÏß—èãÑ ˜ . ‚   æ P÷Šº†&ÿý³û$ûû{û=ü.ýöýÕþBÿ ÿsþÁýÞü…ûâùøiöôô«ó¶òò•ñoñ&ñ¤ðJð%ðöïÅï˜ï ïgîî,î3î­î–ïtðíð²ðŒðÄð+ñlññ†ñlñ ñyðÛïôîøíÐì«ëñêÁé®ç3åäâíàJß!ÞÝ%ÝÝuÝFÞÀßDáâÿãØåCç‰èfêoìîxïØð òóŸóeóÜòOòBñêï†î<íÅëpê£é é-èçNææñå;æ´æççFè¾è,é‰éžéÃé8ê¤ê ëwë·ë ìÆìŒíî¤îúî1ï™ï+ðÄðŸñÆòô}õ÷+øüøžù¼ùúJú$úIúBûèû¢üÿý²þŸþÍþfþWý®üKüüü—ûÄúnú%úÂùPùbø÷­öòõ5õEõaõ¹õ—ö¢÷~øjù„ú¥û6ý6ÿÜÉýµ÷×Û N ñ =~…ÊÜ&¤CÞp&ë ü wc±.£É¼ÿd:ƒcÁ.´¯ J þªqúaPFNdy%—âEqdÒ‡&¥)á¢'߸`b Ð 5 D — q € 9 ] Ý  '  gÑ3b*NìÏ$ÆC= ¹®*¾m;ÿEþþ0þdþêþ¨ÿt²ˆå­œsöMN°þ,ýüûú+ù+ø1÷öTõòôŠôZôLô—ôÎôìôXõƒõöô‡ôAôÆóÙò²ñNðâîcíCìnë§êñédéøèüèEéŠé@ê·ëÒíƒðÆó÷êùàü³ÿ ¨¦lòbÕg „ P B ÷ |   « a ˜ % « e_Ëí³¥Ê–òÿ|þµü–úÁød÷îõèô>ôó^ó¢óôƒôœôMôwôõôMõ¾õLöãöL÷ø!ùYú$üKþb‹[}î ã[…b1„Fσó‚·Ïn× ´ É v[~fJç$U@à!%â4Ô É ž ƒ ² ÖwîÝæ„Y  Z ÷xÈ ¯ƒ£Ÿ¦ÎU \ ¾ »ÛqáÚù]«û¦ô¿èØ F½R»]Ÿo  2 . [ ² ó b>·¹Ùí¹`ú}¢  £ y A ™ ; L r H ) ‡ ò + ¿ ³ ã *5€ ø ¥ F •Pßš•œË6Üÿ}ÿÿÓþ§þ©þËþ±þAþÈýˆýfý³ý þþþ9þ•þþþûþFÿì¬eGÞ·³néÿ0þZüœúMùø{öÁôpóòpðïîî‚í´ìƒëÌêê»è,çÚåàäaãáòßÞ­ÛzÙ¬×9Ö–ÕªÕöÕÖ)Ö{Ö9׷רfØxØ‚ØòØÕÙjÚ Û0Ü Ý6ßÜàãfåhçxéìÙî@ñdóõZö$÷`÷ëöáõ=ô´ñ*ïÖìŒê^è7æå>äãŠâÌâÎâãöãÅäæ­ç1é8ê\ê.ê…êåê.ëPëëoê£é´èç¢æÝå)åˆäXä›äëäoåhænçÖèÃêmìÃítï×ð1ò×óGõ’ö™÷Pø-ùú)û6üêüšý˜þ‰ÿ²¦Ä·"OshFî*O·I¹!§ÿÊþZýGüÅû&û¤ú3ú™ù ùtøøøøgùµúCüÝýŽÿƒ›¿ 7’‰^1é\Õ }Û¬í +." Ñ ¶ » ´ÍÔ›ixÎ a ï h¸ @`žè*R§m×ñ.ŽË"Óf Ñ×¶®'5ö×r'Éx ^ ý m Ê¥±½¾ÖBøí?Ë„3 òE : ä § þ $N—ô^¸-KIϸ5p/…kl/סÙÿl¬†™Cè  ü ò Ï Bı¿Ýé#â=Ÿ<j±¸®* ÷ À WÜmÔÎ|Ë´i…+ ½ ¬ šÝ©ö„x 8 > ´RÃ×à§™ÎtÏó𓱠o 4  ·ƒzšfMnËDÄÿOÿæþ”þ’þ þ«þþþGÿZÿ¸ÿƒQáÃ…Üw‡?ÿÿõþþlý ýSücûÁúdúÔùùWø÷TõªóiòQñaðµïËî±íóìZì­ëNë‡ëôëCì:ììUìŸìºìÑìïìMíuíJí/í=í­íuîQïïïhðÌðöð:ñïñIò_òàò²ó3ôHô ô›óóvònñðïî«ì0ëééÌè•ç<æ™äòâÒááxà»à.á®á©âÔãKåóæÌèèêí£î<ðòoóÀôVöµ÷ŽøØøwø­÷÷öö¿õpõõ2õ¿õCö±öòö%÷˜÷ï÷ø/ø~øù5ù®øøH÷#ö´ôSóHòñðlðð½ïüïrðóðYñÜñ™òló ôèô>ö¶÷1ùkú·ûâü›ý8þíþªÿŽR®ëßò*p·ý³¼Ý? º Œ}8š“1—~K#þ è ß Ï ° ÑLµBçÊ/ÐõÛÙuç¶LTƒ¼-k‡¯(yÿ¾þþÎýAþÊþËþÇþ‚ÿC™8+P€¯ß¯AÄ/  ßüê‰A¨ÛÏžÄíÇÆ>Þÿzÿ«ÿ’`Äj.‚„|sV'ðÉÃÿÊþþ(ýHü¼û„ûyû…û£ûüüÓûÛûÐûfûÓúú‡útúAúú‹ùžø÷NõÑó1ò ðøí1ìºêŸéÊèèžç`çøæççç¸è“édê<ëHìmíîYïð4ñ^ò_ó5ôZõ§ö"ø½ù û(ü\ýÛþEsW'E/šè·YivÕ˜‹†ÃòÔu ËmÐ0nÿÂþâý ýQüû úóù=ùvø€÷åö½ö¡ö®öõöH÷d÷d÷ˆ÷Î÷ó÷7ø’øëø·ù÷úbüòýºÿ8A ÉÃìþ2   ÿ I ×iSç“`“!ÌwxÃ%Úeæá ê ¨ å Å Ú û T î ð ¸ Ö ù à ÿ  Õ  WNÜ`jvÊA ’ > k ð ×¾ÇÁšíŸMÌ¿Ž•G²zj:¿±`›‡dòjb 9 æ # ° 4 G © 8 · € * Ï Cò['ØžK µ I ¦ — z չŹé. –;À0ܳœXoÿr)ÿÁý"ü9ûúàù:ù›øø¹÷Ö÷ø×øAúèûdýÎþs`žç¡Ìü¢ÓX÷9!ì…¬ÿ)ý‡úAøóõ“óLñ¶îCìçé«çõå¨ä’ãlâášàÔß]ß3ß+ß&ßþÞ÷ÞßßëÞ4ßðßDà:àbà¡àžà³à.á•á-â5ã<äåœå?æ{çKèÂè…éêwêxê•êë<ë/ëcë7ìŸìMìÐëŸëËëìÆì™í6îëî¸ïKð‹ð´ðïðð ð€ï„îxíéë$êéáç¸æÙåÒätãnâšásáëáËáRáá3á’áâ™ã;å*ç1é2ëíîîãððòªôöÕöl÷øÄøóø•ùxúÀú ûÇûnüŒü¨üzýþ-þŠþ±þµþÅþ=þ{ýKüÏú‰ùÇø°ø©ø¨øÊøñø÷øjùTúMûÜûüvü%ýŽýœýþ„þÿ£ÿl|Ø*‰ÛI ? 7  r S $  K Ç L õ ® ] ¼ g ; 롟ˆØMwæ¬ o â `  8 yk¥y9\•|Suß} ø ­PB ~߈TnGIE¸…‰¬ô j  í ) \ – ª Íà÷Ó£ß[ ß* Î w j ± c·"o¡‚æææÕ§<Þ4Žã¥¢ä ì×> ÏéF0ÇL ù ¾ k †RÄ~ÃŽìñ·62/>CPƉµ°Öµ¡ é I „ Ë6K!± ‘íî²KË(ïAu ‘ Ô » á ü . $ í ‹ Ô ? Ô   Jž±Žty—üx1æûè7#ŒM 0WwÚÛK½dÈÇl÷þºý€üû„ùì÷öBõ ô)óZò|ñÈðpðMðYð€ð–ð@ð4ðIðZðtðsð6ððððúï¸ï`ïÌîYî3îHî îïPï™ïýïOð­ðíðÅðkðZðnððï ïî9íKìJë‰êê¢é é™èYè+èÞç-ç;æžåPåJåpå¥åÓåØåÿåLæÐæcç èØèéíèé°éVê¤ê$ëßëuìáì7íâíîîùïÕðañò"ó£ôö7÷&øóø_ùMùAùÃø¼÷uö7õÃóíñìïËí«ëêéÃèéçÔç÷ç è]è ékêîëeíüî{ðŽñJòóôÊôaõîõ‚öðör÷ž÷Ì÷„øMùýùµúJû»û6üýwþúÿN•w­‡˜y` > z € Z \ “  · £ ½ ) Z æ G f e b ’ ð +Ë g ‰ — Ç ë!åÈ}HÒ•2¶Œ½¤fW£—½)ošÝ' ®Ú ÿúSŸ’7ù­Æ .T‚ÅQ¥Òé'¦ÒÓÁÐé Æ‡Cém¢Ïa”rÿÖþþ"ý üAûLúÚø!÷õ'ô®òPñhð÷ïï1ï+ï4ï2ïiïÅï#ð€ðÂð)ñ‘ñõñWòòCòlñyð•ïÃîÿící?íôì›ì±ìQíáí7îî=ïð±ðoñaòBó(ô*õ]ö¯÷¼øZùàùˆúæú(û½û¢üœýþLÿöÿ´{wv[Gò0?6ÑÇpq{þˆüÕú(ùl÷!öõ ô;óÊòžòâòIó»ó`ôAõ"ö÷ö´÷GøÚøxùãùDúú¬ú û«û^ü ýûýÔþ¸ÿÔ lh^Ä; á \ “å1ît²KÌ–UÅ:]|  Î ‘ c W K : I T  ¡ ¬ ð†»èÍ ™ Š L p ß * ( c  † ¼  ' ô ,P~±.;°CåqÄ¥—«¿«Zöš>€wˆžé‰Ä”¨ b  ß ‘ @ i ú  ú¦bÿ%8è¦ÜüMQ?TgX’’‚…a÷ … $ ´ 'w>@+òûÿVÿÿLÿÆPúö Mn˜~ ¹ j  ˆ ×  R ¦  s Å 6^÷ Y Õ p $ Ž § À ~* ƒ¼Q€þôü`ûÕù“øß÷B÷röuõ…ô†óeò-ñðäîbíàë\ê¿è çoå@ä¬ãIãÙâ~â.âááâ–â‚ã}äRå%æòæÄç«è±éæêì#íûífî ï´ïÿïêï÷ïðÿïðòïÜïÅïjï!ïÞîkîšíkívíí¦ì%ìÀëªëÜêÙéÙè‰çÂæ>æåøãMãXâ¡á›áÈáÌáðá‰âfã,äæä—åOæ{ç“è¬éÚêœëcìÍì íîeîîïéïíïÐðWññçð“ððÇð>ð—ðÕðbððððæð’ñ‡ñÝñ1ó³óô‘ôòôeõ¨õóõõöj÷¦÷LøÓø ù‹ùêùú>û¶ûÌû ü’ü¹üêü$ýFý_ýxýˆýPþÿ.ÿ—ÿjè ‚ Å*÷½yÆ>ÑxòÿIÿÿOÿõÿjùõßpø«§pÖ’ » F ß » © |ar¹¨¾ÜÝÄð• ’={Œß÷ÕÐè /Ÿ 5 è  Πñ o QPÏ•âÑYQð>N P 5 Å G  D W E < X r ’ · ¬ ` C b f S ü } Î ª€l†ñÜZªy~¸æÊA¸aÄ3ÊzX jzÖèý G  Ç ´ œ‘² k›¾^$ϳÁƒé,Û MßÕã® O Å R ¨ Ú % ž V ´ î (S¢ zŠû† ( º œ ² ¤ L { ~ ‚ §ø¶?ç©o. ©Š˜w§ÀpˆÌ´fUOÆ—ºÈ+*h²F®ÿìþQþþÌý>ý,ýWý1ýäüü:üüüöûÄûˆûûvú·ù¶øÍ÷M÷wöõîôRôóëñXñ ñºðÂðñ?ñLñŠñÌñññJòïòRóˆó‰ójóƒó³ó'ôlôAôÊópó!óëòîòÜò"òñèï¶îÇíEíÕì=ìXëmê²éØèè¨ç”ç¬çèIèèé§é ê]êëñëŒìöìíÍìˆìxìáìpí¹íúí4îî?ï@ð«ñÇò’ó)ôiôÏôhõäõ…ö>÷÷E÷÷÷úö]ö¶õjõÛô ôÃò·ñaññ‰ð.ðØï@ïkîçíÕíùíãíÇíî–îÌî[ï ð}ð ñsñ±ñ ò²ò<óôõôåõ+÷^øtùFúÇúgû÷û~üFýçýþAÿ€‰º9¼NÄ9¢÷†P"‚kª bÕO ~ œ Œ S a † ½ ; Ï   9 „ \ i æ È î % w í ” à H Ë9:JÏQÐgáOÓH®ÿ:ÿWþký)ý@ý‘ýêýeþHÿt·˜·¿ºÀ… < ¡ Á @ x U z ^  1  X  ð } 0 < ù E ®ZÝ%"è…2×Zÿëý¥ü¡ûçúnú ú•ùù½ø€øhø—øïøùùùÖøoø(øï÷ ÷s÷A÷Ìö@ö¹õ-õ“ôô²óeóûòÆò®òÅòøòóÿòêòÙòÛò+ó¹ó?ô¥ôîô8õEõõõgõÖõƒö¬÷Ûø¤ù úÑú×ûý=þÿAú—íEsd 9 ’ T Ç ÊÚì×{ý®sQÿ'þý3ücûœú[úíù“ùvùJùù§øþ÷b÷÷œö öÇõ¬õ€õ`õ¬õQö÷á÷ùuú ü5ý þ ÿXyM غ‘[õÂ}ùB j n Þ À ‚ } àé48LBÍUÿwóe>V ¦±fKšû¸‚Ô Ê » ~ Ó  ² ^ ¼ Ú k”y‚”\=1à r  Ô Û { 3 (  ô ä $ £  ¨ Qú´´Äµ{ãW÷{ü(ÆTÔkð±€`H6$2Ú!A£=ÒjË $ l á ¶ g Ø ^ a Á ö % 1 5 ù K ç   ; ËR ÷Ϩ]jî§3 õ Ï U  ± Q À=…ìfÞü¶XÔ&A  Ë _ â@Ÿi2Çbÿæý0üvúôør÷Çõôó8òºðñîíKëÐé¬èéçMç©æ[æCæ*æ–æOç#è é)ê#ëì"í îÂîJï£ï¬ï™ï‰ï}ï<ïïïNïZïíîvîîŸííXì•ëÐêê é:è³çMçÀæ)æ‘åÇäQä=ä¤ãtã£ãlã_ãIãhãÆãäXäìäQååöåEæ…æËæµæ ç~çxç«çèµè|é÷éê<êVêwê{ê™êë"ë¹êsêîé‘é‹é™é“éméVé›éØéÇéÕé êvêë†ëüëŽìXíNî=ï-ð/ñiòDó.ô.õ ö öÙ÷Fùàù}ú7ûÂûümüýuý&þ³þ|þ*þ¾ýZýÃü_üÞûüúúÿøFøÕ÷u÷ ÷ö3ö ö örö·öT÷øæøôùîúû\ühýúýþiþ¶þ ÿxÿÌÿg(-K—õ* = µ ¶ … ¹Ü˜7õ ä ò ± l 9 ÿ  ¼ ó ( . a § å 5¨ýËpP” r J  ç ó Ï ø à $ „ M ÷ Œ { s * Ë F ü 3 o ˜ î T ¢   ` 0 " ê ä / ¥ û 9 – 7 ú ú $.úðëÄe”î]Êø¼ú.ˆ©í:Š´åâ Ó è å  E ÂgÛ´z©+®;xiw ¬ % z Ü c ‚ )  i š é g À Ð  ˆ º — † ± · b  b K ! 4 — Ü ž + ç « L æ Á ï * P â D  š q U 6 R f @ ò ± ˆ  w „ ä I 9  ( Ê ! O e¯Aç©)Vˆ| …oR…ÿÿþ‚þúýýDýýîü§üÄü1ýzýþµþòþ<ÿ•ÿ·ÿšÿWÿ'ÿÝþ¬þƒþþ¢ý.ýµüùûû'ú®ùcù$ù®ønø—ø…øUøEøý÷‹÷#÷aö–õÍô%ô¶ó4ófòzññðÅð`ð·ïïŒî>îüí®í¸íìíÔíýíMîQîlîî¼îêî ïTïaïïåïÿïÍïÉï5ð\ðoðØð8ñfñ¤ñÚñRòó¯óô`ô©ôõžõötö˜öÓö;÷B÷^÷,÷´öqö<öýõ£õõ„õJõµôëóóòˆñúð)ðïBïÚî•îyîkî…îÍîïnï ðdðˆðíð‹ñ.òåòËó‘ôcõZö:÷øÁøLùóùƒúíúžû˜ü ýqýþJþ¿þOÿ¦ÿÍÿ¿ÿÇÿºÿ…ÿ¤ÿƒÿ+ÿàþßþÿqÿf½”¯ÇØ "b ¥ v ò D ˆ ° € m „ « ¬ Ž ¸ ñ ¼ y a p ä  < •×êÙ‘ÅÄò4rËÿ[ÿlÿ%ÿËþ±þ¾þØþ9ÿŽÿºÿ pøÃ” }?Ç<Ë7¨ Y†¥ç= s Ê ? Ä ( ö Ü < K ó € é  :”ý㸾щÿ#ÿþÒýhý]ýýTýýãüBüPûú,ùqø½÷Þö˜õŠôBóòHñ ð£ðäðøðñKñIñ8ñŒñ—ñ9ñFñNñ<ñ ñàðÇðÑðÒðÙðíð[ñññ‹ò$óÚó]ôÆô¬õ¯ö„÷_øŠù…ú ûoûüÓü©ý:þ²þdÿâÿ0’£÷ФåÑ’³·>OÿxþÀýýüNü·û8ûuúîùxùÿøø øÀ÷V÷òö÷—÷¸÷ä÷Xø ù%ú&û‚ü¿ý•þJÿ( a‚ŽYÍY4öLâÞÿÛB¼mŸô4¡3À[úÖUÒ–*TAg¾ß /  ´`>4\.Þž<èã–/Ʀ™,ǰ`5BÅcÌ}­¨r ‡ ‡ c   R€É8šï3?ôÑçÙ‰ ìÙ‘$ýWÂi;Î F á „ ÷ Œ W & »  , €p¼Øb))á‰%ïûøç—ÕÙss¢‰é„q€¤ ô  ^ ‚iF j™×0tÿÕí)ð4«è   “ d ãgþv×1Àþxý ü¨ú³ùÊøà÷¯öÑõ$õ¯ô9ôÓó£ó‡ó?óíònòÃñZñUñ•ñæñBòxò™òÖòHó¦ó¢ó}óÂóÙóVóïò¤òò„ñ1ñÚðhð›ï„î§íïìUìêë&ëyêêUécèžçòæKæ­ågååmäQä°äÖäå´å<æ†æûæ`çÑçIèèévéjé…éÕéüéÜéæé#êzê êMêêê×éŒé&é“è9èÈçç¦ææcåýäÔäÙäÒäåVå7å å‚å7æáæçuèéSê5ëoìXíÙíîŸï°ðsñ(òâòÞó5õYöR÷oøù/ùmùæùxúûAûûíúÈú“úgúKúúù8ù7ø¾÷Ê÷ø6øUøÊø/ùùËøËø°ø\ø@øuøwø@ø)ø-ø€øêøÆù¨úàú*ûõûÎüFýåýÜþ³ÿVð¢j)Çy‹Wðãz Ò f õ d Ú Œ : § 2¡Á#”÷·V|l8!,£]®þ T Ñ I í Œ 6 § } ?  - … ô O g Ý ê å ø l ` „ Ÿ ¢ DÇ`§ÜàÖÙ’ZP?C_¢Æšø5ˆšŒ‘ríRßåíˆ÷ Ù £ h ™ ñ ~ Ù ò ƒ } Q þ ¤ f h à 4 ® @ ¶ ò , ‰ ¡ Á   % V h  Ë « · · e % Ç Y ô ö i Î]ú‹æ: Õ g ð n Ø £ ¨Kkœ\ ¸£S A\Nt¯¿ƒ/yÛ m É  ) ú ëöÞ•bVΩÏWŠHP«Ýÿ㬿ï÷ýxñ7GA.(ôª&z²ü²\¹ÿ:ÿ þÔýøüüOûÖú'ú>ùø»÷—ö¹õJõËôáóóYò·ñýðaðDðGð„ð¨ðeð3ððÙïqïLïBïýîÕîÐî·îzîmî`îGîLîŒîèî@ïÉï@ðgð¬ð9ñ¼ñòbò—òó„óºóéóôZôVô7ôQômôŒô|ôsôdôüóóIóóÆòxòtòšò‚òáñ8ñ;ññ–ð‚ð‚ðBððJðVðoðCðâïïpïÎï×ïÄï ððóï ðDð„ðñ†ñMòFó1ôëô[õôõ^öTöJöˆöÏö÷ôöüöZ÷Á÷ø÷?øÎøyùÅùúéúßû^üµü0ý‡ý¹ýuþlÿÿÿ~4ÄùI+ùšÀàv`Ã:‹Âºž ä( ã·š¤?ôÛ¥öʶdO»¤¬ìcƒÂ¸ªaÕñ"§€¿ÿpÿ·ÿ÷ÿ y× ×–F¢"YÝá¹ì ‹ ƒ 7 = v Ì ü  Ñ l ä’=”']«¸†ºTÿ5þý‰ü˜û–úúyùFøööDöÌõýôôjóåòòHò’ñññ#ñ=ññ¥ð›ðwð ðññWðaðñlñbñ‰ñ'òúò|ókôÆõ’ö]÷føãø9ù¼ùÞùãù•úûÇúÄúÎú—úoúIúú-ú+úÞùÐù•ùžùÅù«ù¬ù¯ùIù"ù#ùºøuøIøøøð÷Ô÷*øþø"ù„ù%úúÊù®ù”ùÓù0ú]úû]ûûû@ûœûëûüçûõû~üÙüÏü±ü“ü’ü¥ü«üvüüû°ûÞûÍûëû'üaü¤üµüý þÓþjÿ«ÅØÍo¸SÃÑõ(gÄEä668û%ËHp”zeAà¡­°Vû†ª6æËÓŠG|¯ïC˜žÍ>Å9Ü ‡ > 9 õ c ? ÷ ¦ˆp%«\ ŒY*ka^+ÙÇè¡ãìY}Wý‘›£¾t ” à ž 4 C Ü  Ï ü†qZFÏ4 A–ÓG p ç ² L Ü « )  Àaqð1™¡æ: Y,6åtïKþ¶MÄ à û G U K n Ÿ6R_*>{ž†ÿÌþ«þþ‡ý”ýý$ý”üü'üçûƒû”ûYû×ú©úwú2ú"úÞùfùÞø øS÷6÷œöÍõ$õ1ôó6ò£ññŸð¸ïèî·î=î„í)ííBí:íØìžì¹ìªì”ì›ì]ì1ìLìNììiëëÝêIêDê)ëÝëÏëªë¥ë€ëšëÚëìJìLì‡ì8ìšë9ëêê,ê{é9éQé'é#é éWèÙç¶ç¢ç¡çyçUçRçvçGçàæ¶æÅæÓæçÇçèè˜èJéáéÕêÀëdìfíÆíOîãï³ð!ñHòÁò<óÒó+ôÁôÎôÈôšõUöÆöN÷Ä÷à÷Ž÷Î÷DøŽøÃøùiùLùJùrùÂùúüùÕùú úú‡ùÎø›ø›øˆøøIø´÷ ÷¤ööÇöåöÑöÛöY÷É÷øµø‰ùuúºûñüÃýËþ®ÿtr0ã±ë8Ó 6 t ÿ  V¶¦im®³&à ò  û  Ì Ô Î 2 Ù ™ , È1¨¶Ç¡½”ñïD ¼ ; ¥ å ? Œ Ò = s ¹ C ¤ ì ?iyÓžüï³¢i+oAÔQó Û K A ; $ ö Å Ý À ‚ ‘ ¯ § }  õ á µ ª ¦ q ÿ ÿ ó  &  X T ¬  ì á B õ ?  † ; _ œ Ê ‰ F P ëGå_Ù§–%¢‚‰N1`vS <‰¹÷ƒ’ƒ· $R¡+ ñ ¢ 0 § _ -  œ F’j,Sd/Þ ¹ Ê Ê S Ê g ÷ î û … ÿ Œ ê V ÚV›|ô‚ï—Ï4ûÐÄ3ý>ÅØ'jaòu[šÇúŽ '+­f¶Ö- + D :]hÙ0ðîîþªý¢üºû«úŸù½øÒ÷ ÷qößõ9õvô™óæòiòåñ?ñ*ñŒñ´ññvñžñÅñòòÆñýñDòAòÒñ„ñañ}ñsñ4ñëðöðJñ\ñYñ‡ñ¯ñ«ñ»ñÁññeñÕð4ðßï ð(ðð ðÅïFïïÛî¢î×îMïï®ïØï ðRð6ðØï›ï§ï±ï¦ïoï/ïËîîºî~îòíÐíÀí®íŠí@í íóì¯ì¯ìÎìµìpììßëëë…ì=í¢íîîÝî\ïÎï#ðiðÞðhñÇñJò”òóÒó’ômõ…ö}÷\øCùÛù„úcûOüùüNý/ýüüý<ýgýßýYþ±þßþÿ¦ÿŽ9‹è^¶:•¤÷…†Ò‘‘î ñ©^"ýúãg(̱֨^'ô˸£WÊ‚VÓúÿâÿE‡n#=¸ÆÞBœsaÛî8æ›åEÌ.žõ² € 9  ® ‘ g´<ÅìÝN`q ¢ ø  äØé¿cš–þ+ý$ü0ûèù¯øÁ÷üöö`õ?õîô ôˆóŸóÂóßóôQô»ô)õÞõ±ööög÷Ö÷þ÷ øHømø½øpùúHúúéù)ú”úØúøú ûû"ûÿúOúŠùÛørøFøè÷C÷˜ö8öööö$öþõöUö§öÞö÷³÷Œø!ùNùPù2ùTù|ù¥ùúúÃú–úaú‚ú¤úúRúQúOú7úúîùÜùºùïùÒù¥ù„ù_ùýøù~ù~ù¼ù8úXújúúúµú¹ú¤úÊúûCûeûàûãüçýþÿ·ÿÃÿ‡ÿ¶ÿAÈ[èQ–¿Óå•^§æ1²©W£»”|¸ñ  äeâX)’DE4ܲVDç˜{Yˆó߇pü›=ÇCÄ~ v ƒ „ ,ãÆ^d”ƒçÜçVŽt‘Vt×Ç3šSŒ …„K*§þØ   ¸ ¢ Í"–ü ˆH0t™ÛtÎÄŸ 2 ˜ K % ã » å¾ _“–Ãd6ïúýï¯'Ä6¬…0N=²   Æ ' ª ª t Û | € C À ` óxr¯ð²…æJdu>µ7µMÊBWÿ3þöüAüûaúíùØù$ùøs÷ôöLöƒõÖôô,ô|óÔò‚ò"òáñØñÈñ›ñ|ñhñXñzñËñüñØñŠñ]ñ6ññ­ð«ðÉð;ð´ïaïÔîüí²íöíàísíãìLìÇë˜ë›ëë™ëšëgë*ëéê°êŽê?êêXêlê:ê6ê:êºé·é^êLê§é‰é…éné?éÛèïèé˜è‚è°è­èÀèñèïèécéUéÐé×ê=ëªë0ì§ìí‚ípîõî;ïçïlðëðñùñóòúóÏôqõÓõ öKö©ö¾ö÷;÷ÿöúöU÷,÷žökösöHöKö|ö]öÿõÝõ}õõWõGõ»ôsôwô ô.ô­ôbôèóSôÍôÉôõXõuõçõtöøö¥÷—ø_ùãù úËû˜üÀüYýQþMÿQPlNÊ‹Š4ˆïsÓ $ ) j « Š } ` Ö<³ Ð“V@?t73×p“;J†ÅLª=Sþcù¢ ~òn ø F | à 5 P ™ & F – 3    i ‘ 6 ² % Ï ^ Ò • 4 À¥°×* i q V ]   Ú  š î  H s f ` ‹ ¾ Ð À # A = ' ÷ ë Ä g " Ð v .  F  ³ [ > ' îFä€kV@ë¯^÷Ö*‘úweŽ ãâèÎ×ø²lNN¦í„ý _ Ö „ H • v Æ : G ¬ / 2 û a À p b À ø X 5 8 À ] < ð ; ÄW÷Çmñ^–Ækº`®µ¥Áþ&`Ó=€â`ÅçÞ)£ø D ¡   Q òTÑQ¶Rëñ4¼E&8ÿxþ~ýŒü»û ûˆúAú¿ùòø;øÐ÷÷¹ö½ö‰öRöö/öqö¢öâöÙö²öö£ö÷j÷r÷÷ïöçö³ö™ööžö ö†öbööºõ³õsõ õÌôœôFôôô"ôØóÁóöóTôÎô õLõ‰õvõSõjõîõYöhöNöjö–ö;ööÛõ]õÓôIôÒótóQóhóíòYò/òVò-òÉñgñ ñžð%ððð ð½ïhï&ïµîúíŠíåíZîLî%îUîÃîOïËï%ð¦ð,ñËñ–òóhó"ôõöjödöðö®÷LøôøVùžùMúñúYûwûÝûÌüYýzýÝýbþÆþJÿìÿnÙI© K{ú#B|æR®Øç<ɬ«øÌá³”]/æŽ[§ÂbDõ˜9¦ ¸ÿ¿ÿ+þÿR”²¿Äpýûæì¿s º µ Ë ‰ 2 Ä ›&V"6aW Tu£ ¯ ö I # žW3òš„ÏWk<ÿ?þý(üZûúAúúºùùøSøIøVøyø™ø¥ø€øøÎøãøìømùØùÐùéùú(ú`úWú úûùúäùœù9ùøøØø£ø”ø~øFø øß÷ƒ÷g÷b÷2÷òöúö÷÷ëöÄöëöC÷U÷‚÷Ë÷ø>ø]øaø8ø(ø(øwøÏøÆøÀøáøù&ùCùCùùòùWú…ú{ú|úOú ú_úŸú¶ú´ú|ú!ú›ùùºø„øgø>ø9øŠø­økøˆøÎøùgù¥ùÖùîùú<úSúxúðúQûuû¼û*ü:üŸü5ý™ýÿý—þEÿ)î`‚æu½•Ë›er}Z?`Áí–×PÝgõ¨s3« ¿˜8ò¿OðÿØÿ ãÿµ5…œbW%4)l Ý & Ç Ðø èÖ˜8ªPuJ˜ã‘5Ø­Z„t³ìÿ g  $ ò (  q ‚Ws.¤= CÖ$3¬ïí@ § 6 8 ô K í 9  õ j×9_[25(øÍ›X8_f"´ Ž Š r H * R r a E ü ¶ Ñ  Z  ’  á é ò   ž  ž  S  özÄú0…€Çâ6}ÿ·þæý'ý°ü:ü×ûyûôúaúÕù™ù†ù ù¬øXø=øê÷ ÷vööüõàõÎõ›õYõTõMõAõõüô¦ôFô÷óçóÂówó×ò4ò‰ñÐð!ðsïïËîFîîÕíOíäì€ìtìÇìÚì—ì;ì€ëÆêcêéé8éééâè÷èÊè²èÆèÕè¨è–èÊèéééé±è;è è?è8èßçäç èèòç0è’èûè]éÌéêTêšêàê,ëRë`ë€ë#ìÊì,íÆí‡îÿîµïLð”ð)ñòÁòÈòó‚óçóBô¯ôòôãôÓô·ô…ô€ôlô+ônô±ônôJôlôeôOô'ôôöóô+ôæó×óìóþóõóýóûó7ô¸ôÏô õÊõ°ö_÷”÷©÷Søßø%ù ú%û.üýŸýþý˜þÿ”ÿQK1½ãÇœÉZɧ‡}Vˆ©c ÇPUU?`‚®õÙ›‹n‹ÖÖa ýTØ+ü‘5˜M Ê “ ² ÷  & ÿ £ Ì !  â » ƒ 2  B e   ¥ßª0`ÅÍ : : s ç = V h ² ¹ U ö + ’ § | g p t h ƒ 4  ; ]  Ž Š ?  ¯ % ¾ e L  ¸“…UªûêÔüôšYRpÀ³«º·øTÝmãr ¸  v ’ i z Ì     .  Ü M Þ r ª µ ¿ ¨zŒ£÷ W z u … ì æ ¨ e ® ž ;  ? … ž ‘ S ä q : O ’ ² Æ ë  4 +  W ¡ ® ‹ È »   ‹ « Ò Ì þ > Š î $ 0  Ö ‰ = ô a Ú ` Ì?‡PÎѳ\ò|·1ôž=Xÿkþ‰ýýÌüŽüVüü…û!ûÔú¬úáú.û:û,ûÖúXú9úmú(úüù úôùÂùùÔ÷#÷N÷÷‰÷Ù÷'øø±÷ƒ÷w÷—÷{÷h÷¦÷Ž÷÷üö÷%÷/÷½öö÷Ÿ÷£÷÷ô÷vø™øuø`ø}ø¯øzøøQ÷øöûöèö¯ö…öö3õ¿ô¯ô8ô«óópòÝñFñåðGð\ï ïïÀîdîƒî·îÏîï‡ïóïKð²ð1ñ¢ñ¹ñ©ñ›ñòÞòšó*ô~ô¨ô›ô´ô(õÎõ^öÈö÷a÷Ê÷5ø©ø*ù“ù±ùëùúûZûÎûFümüœüûüÂý2þWþ§þ<ÿÁÿ?r”<ÚD Øà¸®]2M˜~#Írÿ:ê~0Ùÿ ÿ{þåýkýVýçü`ü üüüüQüÑüýýÇü‹üÍüý§ý—þˆÿ%ŒáP¬–Z°,”ïÅ‹þ‹×Ú H T l q – ô ø ’ Ù"çÃ]Ãø‹/^hˆéIÿãþcþiýOüŒûû¦úú¡ùNùèøfø/øøÙ÷›÷l÷²÷ø}øÑø÷ø ùùøøøÖ÷}÷X÷Ž÷ ÷g÷÷¼öŽö¹ö÷:÷J÷÷£ötööpöKöPööéõÀõÅõéõ!öHö”ö÷4÷I÷£÷(øpøsøºø;ùiùNù;ùDù’ùÎùÊùßùþùúnú©úŸúJúõùú5ú>ú-úðùÝùøùÎùCù ùfùŒùNùìøTøþ÷ø*ø^øŸø•ø’øÄø»ø®øðøù)úœúÜú#û¨û3ü;ü}üKýþ£þLÿÆÿ8éàúK«æøC3oß •1 üи:ÄOËeßÿžÿ(ÿmþÄýdý[ý^ý>ýýýUýxý|ý¢ýøýþûþPÿ€ÿÇÿrY XæÂ~-ôùã ˜ b 2 ¬ ÿ } 2£á:gvމlW(¼“›‰X¸ / ì p  B O  º u  ° — Ó å Œ - ; t 4  « Á L  = w — ÿ [  œ ³  R § ý ÿ   > ˆ Å Æ ý V [  Y ±9 £˜”~}¢Êå÷;‡‰€¨¤]ü’F5­ = ²  ¡ I à Ž R þ ž ÓÚ9Íwdñ_vm–Èqûÿqÿ½þþÔý”ý ý»ü¯ümü'ü"üâûzûû¾úzúXú2ú‘ù6ù„ùªùù|ùÃù†ùõøŒøøz÷éöIö—õõWôÝóUóyòÀñYñåð¿ððFðúï¡ïLïÍî&î~íùì^ìÓë”ëkëë’ê0êëé‰é–é»éÊéÌéºé“éŠéœé¸éÏé§éPé<ééKé¤éêBê´é^éìéê6ë@ì¬ì¾ìÐìîì+í©íâíëíúíDî·î ïÝïcðEð/ð-ð†ðñÍñsòVòvòó7óæòóòSóÑóÁó$óó óæòóNó óKóÆóÉó|ó¾óúóÓóHôÜôõôôéôBõûõSö’ö7÷”÷î÷øù±ùú^úÔú7ûÐû”üýRýŽýþ§þEÿ®ÿ>F¡&Á%w+‚láCœÚ¢Xe¹åäUMéà÷>z Ž{;)0%EŸÛr»êì . %  k Ø ¸ … ` h € ª ? ˜ ¬ J  .  4 Š z 6 4 P f ] d  ¯ é   ð · á b £ ~ ’ ø Ô ‡ © ! { · Æ ×  ó ø H Y ò w " Û J ƒ ' é Ù £ OïêÔjÖ}iU<83¦..´…£ÇW¿" Yív Ù 1 – Ä   É   $   ä ™ P R _ N s ª ¤ d & ¿ • C  h1;@‡ÝõÆ¼á  ñ ` Ÿ a ü $ ÁÑ & âªsF|ÅЭ¡’xŒóL l Š š ‹  ¹Ó  À¨žXñÅ’†Gø¹„/µ/Å‚WÇúºWòÿÿ.ÿ¡þþ±ýOýÓü“ücüåûCû®úAúÙù˜ù¤ù„ùJùùÖø›øøi÷÷K÷‡÷Ž÷Ó÷øø#øRøäø2ùùüøù}ùÔù–ùùÇøkøøøUø{øø°÷‰÷„÷¢÷Ú÷.øgøøøøŽ÷÷÷ ÷½öötõõôôÙô¾ô}ôòó˜ó_óóÅò¦ò³òqò)ò:òFòEòÛñ<ñ%ñGñÿð•ðˆð4ðŸï™ïÀïÊïÀïãïäïÙïÞï ð‚ðÑðððûðìðñ[ñ ñ(òÄò9óÇó“ô4õõøõ}öT÷gøþøZù»ùaúmûBüªüøü”ý:þÿòÿrñ^7ð(¢ÙaBã} œb_}VÿÏþ,þäý|ýýÆüŽüxüü9üÑûû…ûFûRû ü“üóüšýÒý‡ý~ý°ýçýdþ ÿ–ÿ¸ÿ…ÿºÿ$£0ÎOzÒ7k_àuº5ŠNgÔ%R™Ú'C|º®XóêÞ¶È÷a.«*¸8Ýt„édÈPòÿ]ÿ’þþ‡ý ý—üBüüÿûþûîûaû«únú8úÅù¨ùÊùÑù§ùVùóø–ø6øÙ÷ø’øvøü÷ä÷ø5ø3ødøŠøcø ø­÷E÷8÷R÷G÷9÷h÷…÷™÷±÷¯÷ð÷,ø=ølø‹øëøvùäù<ú·úÙúuúLúLúú'únú.úßù¬ùMù£ø8ø4øøþ÷Û÷Ÿ÷=÷þöÐöqööåõµõ>õóôõõõ!õKõ‚õÂõñõböãö1÷‚÷$øêøCù‹ù'úêú{ûü•üýBýœý„þˆÿúÿêÿ.Ë,lOЦ†Uýu¹ÿ[ÿÿ`þ×ýÆý½ýýtýýpýRýÿü•üiüwü<üñûüxüŽü¶üýTýiý ýþ6þpþïþgÿÑÿ1 ûmè~?™ÂÝã »cãL¹9Á s Ò % u ý ^ Ê g Ñ  L k v € Á ú 7w‰A_‡_8¯ b O ‚ Ž  – ¬   G Ž Z Ï q m 0 ÷  u ò 6 ‚ ? ç ò Ì ö gØr’ƒè9¸1k+më-,Uš  ° c•ˆyÊHHÌEpñ÷Ìb™4éžo ˜ ‡ò>+    ¥ • X  ¹V·wo(ѧ’òAëîÀUÂ@ºÄûòÏÑÈiÆWdÿÉþ"þJý—üÕûûúù"ø ÷ö.õœôóóôòøññ4ðkïºîÑíí‘ìõë ë.êeéÇèdèèèçöçèßçÙçèèóçãç«çkç”çÅç÷çQè•èuèbèè›èéÐécê²êâêóêåê&ë…ëŽë€ëaëKë ëŒê±ê ëSëqëë©êŸê§ê›êÝêAë,ëëíêwê7ê7ê•êëëïêÂêáêSë¿ëQì í.íí~í!îîïëï˜ðñ³ñüñSòŸòròÿòÂóRô±ôýô¥õÙõÿõæöx÷‚÷·÷â÷ú÷Zøßøaù±ùÀù(ú¡úÍúZûüpüðüTýøý¥þöþ(ÿ~ÿÚÿÍK'h¸'Š=Ë\‘Ÿ¿ù¬ H‚´ÇÎ%)'&ŸÀµŠˆ†s•ßÿ0PNøÒ3ZY›Ý € à  g ( > £ æ å  m £ Ç ö $ \ … · é ? € ¬ × Ü ½ Ð Â « Ô ² { L Ô i ,  í Ž ò K »vEüZƒå¾uäו_…ËúÕfFI‹–®Ê myzš* FzÇ-NX9;üЇ¢` Ñ·ºH Õ¤t-çðw|eeOBË'n™´»ˆšµåôÒ¡Œ–¦×ÃO#"K}xƒfô™v_= kúñÜú;v±é(Q< *0üt"¬Ë¯N:è^ û»’/¾Pÿ‡þäý]ýÌüoü“üYüâû­ûŽû\ûdûnû~ûûœûäûBüpüJüüÜûÐû»ûvû@ûHûOû0û+û1ûûªúdúqúbúÑùmùLùGùéø’ø‚øgø#øî÷õ÷øò÷ð÷:øjøhøŠøxøø‹÷H÷~÷Ã÷Î÷o÷D÷&÷÷·önöGömö©ö¥ö\öþõÚõÞõ”õRõõ¦ô(ôróó¦òòæñåñåñ‡ñ;ñ#ñùðËðœðð¿ðôðÊðÇð2ñ¡ñªñ÷ñ•ò1óÞósôéôLõöµöU÷%øù°ù)ú³úXûüüòüaýþ•þÁþÿÊÿTSh¥ô@Ÿˆey5§ÿªÿžÿCÿõþÌþÅþ³þ^þ=þ5þ þîý/þ>þ<þcþ‰þFþaþyþEþmþÇþ ÿ*ÿ*ÿÿ.ÿXÿ§ÿØÿI§Äî8—>frÛÙÁ¾âÛè2¿/‚ß wd[›4¡†B\§éáëÝ{R¿µ¦.¾ƒ\/*-Ùz[Ê—LÌIÚqN£ÿ+ÿ¾þ<þÂý™ý€ýXý]ýWýpý{ý@ýûüÛü»üü\ü5ü[üxü6üüünüžüœüvüdüŒüÖüýÑüÅüöüWýlýPý3ýýýOý„ý¶ýýtý¯ýýQýMýAýý<ýøü¹ü§üüŸû‘ûVûóúïúÑúEúïù–ù3ùüøÐø²ø•øNøøøö÷ò÷Eøø|øùÌùäùú:úgúÍúDû«ûnüIý¯ýñý2þZþþÇþ)ÿÏÿLS”þÔ¥ï"ÎRÚÿÿ¼ÿÉÿ“ÿ:ÿ/ÿíþ§þiþ4þ?þWþgþ:þ þçýûý-þDþlþ˜þ¥þ–þ^þZþmþ”þ ÿ_ÿ™ÿšÿÏÿ5uŽ¿ð iåù øÛQÎ-4|†•ÌA&>t©ÿ™€•”à7’ Q ¦ ã  ø … ü ¾ ­ ¼ ñ â „ [ ~ ƒ k j ‚ ] ú¼|((X5û©;${´±ÖN`ç ùpÅ|<‚Þ  M n ™ É 8 Ÿ Û = Z G l ß  ( ü È É ® ¸ ² ˜ ° Ë Ü ì ¦ t g ì ¾ V 1 Ô } n  ‰2ØnJãLD9òSº™aô½ÑrÁlV&8£š'æ†5%æÑÖ›/4{[åÿ¦ÿhÿ)ÿ ÿÞþUþÆý$ýü&ü¢ûÍú.úžùù“øøU÷¦ööšõbõ9õ³ô"ô—óóŸòPòæñyñWñDñGñþðð¸ð%ñCñõðñŠñÃñ—ñ°ñÛñÙñ¸ñ‡ñyñ­ñÅñXñmñò6òòjòÃòÏòÊòÎòÙòÍò§ò€òkò;òøñŸñoñ¥ñµñUñ*ñFñzñ¶ñ¥ñ†ñœñ¬ñ²ñÃñ·ñ—ñYñzñŒñÂñòò%ò(ò‹òÌò®òèòióïóLôÐôSõ†õ„õVõVõ«õ öwöíö ÷"÷"÷d÷«÷ø8ønøÕø3ù]ù@ùùüø\ùûùHúPúIúuú¨úáú6û\ûûÙû*üRücüŸüý¼ý)þrþ´þâþÓþ°þÙþuÿv¿áXj•ÐÚΞFøÿýy/’½ „ªÉÌǯ”„¾%o€‰¯Ì¾ö| Tøø v¯ÆÞü UV0Kyà$~Ðj°ƒ`_[Nòˆ`o„¢‹mfèH(,fœŽo&þ˾®t€àû„2w¸ŠP„ÊÙž–Þõè\gxÓG¤¢l_€i5F…|PÄÈÑ¿¥¼O)4ˆÂÖ½~ÑîWj#Ì|Om¼éúÖ®·ÊåþîÜ»ÈÁÆðûÓð\š•‹a'W·”0>>øóæ L;üÏ”y}Z;NgMá›dÑj|ñR€Ê~{aGÓ'¤8×ÿêÿ*™ÿTÿkÿ²ÿïÿ¢ÿuÿ—ÿnÿ1ÿÿðþÕþ¢þ`þ(þÓýêý þþþâý®ý‡ýAýý6ý;ýuýKý9ý:ýýÕüæü3ý*ýìü×üéü°üªüøü?ýMýýêýþéýÞýÞýõýþþçý±ý£ý¥ýsý?ýEý ý¢ü´ü÷ü±ü<üüÔû¨û"ûƒúOúú”ùùÖøÉøuø1ø øøøBøzøKø øç÷Ü÷Ë÷Ó÷ô÷%øjøtøFøHøŸøùƒùúzúú—úùúûüšü&ýLýAý™ýþfþ»þÿ"ÿÿþìþLÿ¢ÿÜÿäÿ?Ukb3óÿ)wX ÍÿnÿVÿ=ÿWÿpÿEÿÿÿëþ¸þ¬þ¼þØþùþùþÙþèþëþÆþ×þÿ ÿSÿÆÿS•à¿ÍïòÛÒÊÔ'!W°Þ5FõÖÀÕôX¦g5QƒºÈúf}v·@…«ÎÓžŠì5<!òèÀŽ5ËÌÞ©u3àrµx"ÓXÊÿRÿ ÿÙþ¸þ¸þšþDþ¼ý*ýüü×üµü»üäüÈü ü•üü·üüzüüÊü-ývý€ý ýÓýÂýýjýxý‡ý’ý×ý/þ+þ»ýJýHýý~ýtýtýrý^ýýŸü‹ü–üŒü‰ü(üßûúû¦ûCûûìúÚúÑúwúAú'úúúú0ú7úñùÕùú2úOúyú¨ú¯ú§ú¢ú·úéúû/û­û!ü_ü`üeüZünü£üÜüíüýsýÇý,þRþEþSþsþ‘þ¾þîþÿÿÿÿ¨þeþ(þùýþBþmþiþjþ,þÖýÌý¸ýßýþýüýðýÒýÛýþøýÉýýŽýÀý×ýíýþMþFþ@þ`þYþŽþíþ4ÿÿËþâþ(ÿ‹ÿ®ÿàÿïÿÞÿàÿãÿýÿùÿØÿªô±˜©ÅP@ÿë*³(pCP¦î>®íÞ;xg«‘;G¡MB™È×É"ÆF(6L$ôóÊ “ïÆ¤¸ƒ}¥ÌȯÎÕù"ƒ¿½|MNSžìR¼¦ˆÇïî×­ŸÄ¼½÷àÑϲ–¾È]-ñÙí$:¥ ËÖÀ­—n3íìÆsH¬s‡¤‘b%éÚÚù7+0N1ÛÀ¨ˆm[Ä»X,%"%óÿÉÿwÿýþ=ÿaÿàþ<þÒýOýÝünü1üCüBüøûbûúLúFúúùùù3ù3ùíø´øÀøµøxøJøqø‡ø/øá÷÷÷!øî÷þ÷Aø?ø7ø1ø\ønø9ø#øDø}øgø™øÎøÅø¥øÃøÚøÂøãøêøøøDø”øƒø7ø0ø`øRø/øøÂ÷Å÷!ø#ø¬÷‰÷»÷˜÷Y÷p÷’÷„÷_÷H÷s÷y÷š÷Ô÷æ÷÷w÷–÷Œ÷º÷0ø›øéø/ù*ùùøØøëø?ùˆùrùIùzù"ú{úƒúœú¿ú»ú³úöúŒûæûØûµûËûü5ü'üüüPü´ü×üÍüíüHývý¤ýÔýþ7þoþ–þÅþÈþ¦þïþrÿ‘ÿqÿ†ÿ»ÿWy£ wˆJaŸž®³¤¬ŒrxH 7©–a“ä"L„ˆ†\_‹’†±å¦• x‰wc¿?ln‘—qf¢UJU~us‰¨ð'TN:N_H.Ú½¼;àxy“nñà‚b²àwRI"òÚ*>Ö˜ÚÒ£Þ- ñʹ°ÎͰªÚ6W;>ž_pf[=óÿ%.8SbLÜ¡šT6]ì7@áÚâÔ°³Òã¦o’”@TžyK„Ö*+ý®\^® ^?/NZ=?CG7ý<*Ñ¢ÁíñëÙʼn~ŸƒŒzxmm‚Zø©xWmƒXNDË?ðÜ•©ßø²xs—gÿÿòÿ¿ÿÊÿÌÿ„ÿ$ÿöþÕþŸþªþÄþèþÐþ‚þ$þ þþ%þIþrþ€þ…þ–þžþ‹þþ„þ€þ£þèþòþÒþ·þ²þÏþâþ­þrþsþ‡þ¥þîþÿõþåþãþÁþ€þ;þ þ3þ…þ\þþÍý]ýýýBýHýÔügüBü=üOüJü ü´ûlûôúÊúûíú¦ú³ú¼úXú0ú/úLú\ú#úðùúùúÎùÇù.úÄúû û!ûûMû€û³û)üYü~üüxüfü…üÉüý(ýbý—ýèý-þ…þÐþÖþËþËþ›þ’þÓþûþÓþ¾þþ„þªþ£þ‚þ†þ·þÁþ¸þvþþÞýÐý¿ýŸý—ýþ þãýíýþþúýÞýâý>þ¥þ–þJþHþeþƒþ­þÿÿÔþÓþÝþÅþÈþóþÿÿåþíþÿPÿyÿ˜ÿšÿÿ™ÿrÿfÿtÿ‘ÿ[ÿEÿqÿ‹ÿŠÿfÿTÿdÿ³ÿóÿ;zÎß\†•§¨ˆªðáÂp{ Ñú¸xO3ÞŇ2 ´ÿ6ÿÍþÄþÍþÃþªþxþ$þÆýÍýáýÜýþý\þ7þÃýeý]ý•ý¡ýªýÓý¦ýzýŒý§ýÎýáýéýþ0þGþþÐýÓýþ8þAþ$þþôýËý¹ý«ý|ýFý0ý:ý>ýêü°ü¢ü ü—üzüŠü™ü¨ü¥üüLüúûÎûþûüØûªû¸ûÝû üûû”û.û>û®ûüü üüèûÓûËûîû>üvüüµüïüóüéüý*ýiýˆý~ýýÀýçýÉýþuþcþþêýØý þ þþKþƒþ°þÛþÒþ©þgþ5þþþ1þ!þ3þƒþÂþÉþÊþ³þdþ5þkþ“þŽþþpþwþ»þ±þ€þSþ9þHþlþìþÿÚþÑþùþÿÿÿÿÿ>ÿZÿ…ÿàÿÜÿÔÿüÿ H]dÃзª­\Wjˆge›Û>6Fc±çǽïÐÄáèù2cO3;$ýÿìø -7ÊÀ¹Ž2[´úóÐØSj^_~¤¡cƒåà¾åEqX}›vYtzwq@t°„T-+þ@¼¦œØ í¶a]O6#5WSG¾•³Ú«w—àöÕnFS=ªÛ’&(æKSF(A¬z­Ê¥:Ô‡F#,>* -ÉÿbÿÿéþÔþ{þ+þ=þvþeþ$þâý•ý}ý¯ý‚ý ýý1ý@ýcýoý<ý$ý"ýåüÞü*ýlýsý‰ý•ýaýðü—üHü`üÆü#ýRýKý;ýïü®üÂü÷üýýýøü«ükü|ü\ügünüâûÞû&üü¾û»ûÔûáûžûpû¥ûãûFüŠüCüÄû¢ûªûÃû³ûûiû¥ûüPüjüpüOüüâûüûTü¡üÅü»ü’ü¯üÃü´üÉüÈü•üÆü#ý'ýý$ýhý¢ý­ý›ývývý™ý™ý’ýºýíýþþþGþŸþìþ@ÿoÿmÿ6ÿFÿŸÿÑÿ)®î»Ë¯L^Íãªht«ØÉ´æÐÞã×è 4fd C=tPVW,«áíØäîÔöì(7+CS„‘Ta»Áá*ïNO£±·½ D1Ö¬  Á'y]þµz¦ÍÒæ4Z4òÉ›¹Ê´›¸ÊxD65<L&Ї’ÐÍ·µmmx— MPPèȬÖ(]O()'4WfL@%ɣͱf.,hw(AîÿÞ¶ÛÒÅÁÈ ÒËà'XQu‹u5 6P4m¨e,8jjT\^Gåíóçò GcEä|m¶ú ÞÄvTmšÅÁËÊ´|NBHNHK ¹ÿÔÿåÿ¤ÿ–ÿlÿ]ÿQÿFÿÿÿ/ÿ'ÿÿ ÿlÿ2ÿ¥þ:þþAþžþˆþ:þþþéýÚýöý=þXþ$þKþ³þÂþLþþúýçý¬ý¶ýóý»ý¶ýþFþ,þEþƒþþoþqþnþsþþ'þJþ¼þ«þNþ=þ(þ¿ý§ýðý2þ;þþÄýŽýœý‹ý¸ýþèý­ýžýqýýÞüçüÅübü>ü0ü ü%ü,ü ü>üyü:üðûâûãûöû%üJüfüŽüVüüÞûÌûÍûšûŠûôû;ü üüüøüýýFý|ý¼ý™ýMýQý¬ýÂýMýýwýÇýÏýåýþý×ý¬ý¶ýýýbþ”þþhþtþrþþ‡þPþOþRþ þþ<þ¯þáþ™þfþwþhþ5þFþjþ¤þ²þŠþ[þ0þþýîý=þ‰þhþsþrþRþ†þÐþùþÿ6ÿ@ÿÿÅþœþ±þ›þªþÎþ ÿìþÌþ©þ¥þÉþÿ[ÿ¾ÿùÿ×ÿ…ÿÉÿÿÿæÿR‹h>M—ñõ¸°é'DM] áΰØ8!Äœ“W 7f]<= Éðîø­‹CÂÿÃÿ:M\P'üÿûÿ?3!CcHf¯^Æÿ™ÿ ÿëÿ¸ÿùÿK|9èÿÕÿèÿ­ÿ˜ÿŠÿƒÿŸÿ›ÿRÿêþãþ8ÿnÿÿhÿGÿ3ÿÿ=ÿ:ÿûþ¹þ³þºþ—þþ™þ¿þÝþôþçþÁþŠþ^þ‚þ¦þ¿þ÷þ&ÿ+ÿ#ÿÿ¿þþ–þÛþûþãþÅþÿ ÿùþÿ@ÿuÿ¢ÿÐÿ³ÿ‘ÿÎÿÃÿ‰ÿ”ÿµÿèÿ.7JIÿÿt¿·‚…¯¿¢“›«~JJGFII^9!0N:7i]?x‡ƒ…¯Ï¿§´´ˆWŒõÖ &%û*•Ò$ݶÆÁ®»Ñþóçý÷ú5vƒ—ú¼¹õ+*ñ£wƒ…µïðúúÚ—²ï ó•i‚ªÎßÖß¾‚`†•t‹rAs²Ýó,ØâÏÞ,ê±¹ÍÕô2’Èoï×&¦£zhCÚYl>-:ùïë­€‡_l¤®”¨»ˆLl­Ÿ¡›iÜ;3öÔ—ò±ss¡ù6á9÷áêÜÒ·ÈÏÈÆ¨hW·ñ¨#øÿ ÿiÿ7ÿïþúþÿ ÿÿ9ÿLÿIÿ&ÿÞþžþŒþ‚þjþ"þæý¼ýŸý´ýÎýÓý°ýý¤ýŠý•ýžý¨ýÖýÎýýkýNý ýãüçüÛüÓü(ýeýŒýqý8ýýCýý…ýQýöü¹ü˜ü±üìü4ýýÚüÒüÎüÀüÙüÊüÀüêüýºühüjü9üüZünüBü>üRüZüNü]üü—üÐüéüŠüLü8ü3üüü<üvü©üÒü½ü…üeüBüoüžüÍüßüý5ýbýMýUýDý"ý,ýQýhýeýCýYýwýdýrý»ýÆý°ý¶ýÐý/þ2þþcþ”þaþUþyþ’þËþÅþ•þ«þïþ÷þ ÿÿÓþ•þ’þÁþÊþÖþ$ÿVÿGÿAÿKÿ`ÿeÿ?ÿÿÍþ›þÄþÿÿöþ&ÿ|ÿqÿDÿ^ÿiÿIÿXÿ®ÿåÿvÿ:ÿÿOÿeÿ¨ÿÝÿÍÿ¤ÿjÿÿ©ÿôÿ38Öÿÿ¯ÿºÿÄÿçÿùÿ\jmvpp†žÀ‚?GЏw±ºÇÙw.3_lf“Æ4#:{nJQU,Úÿàÿ1LiuV#K¡Ž]OmvØÿÿÿNvj< ðÿkÏôÎdXKWn|†NLŽÂ™‹ˆ5 8‡¶oz¡<" ÷ÿ*üÿÖÿ÷ÿöÿw𤼹zOdPn–Âu%P„eBR‹š˜›6õÿ)PZf¤ÏÀ²—¥ÒÆè û£ˆÄ<(#îÌÊÆòçǘ¦yT‡•ާ˜q8+ùÿÊÿ¾ÿÊÿºÿÍÿöÿÑÿÌÿäÿöÿ;9 216éÿéÿ%-ñÿ«ÿ{ÿ©ÿöÿ4VO-G_N6c¦‹D3âÿÙÿ/C'N?Ïÿ«ÿxÿTÿiÿºÿóÿ½ÿ—ÿlÿ/ÿÞþ“þ}þ£þÄþßþGÿ®ÿŽÿÿ¸þÁþ·þ€þ·þÿKÿoÿ™ÿgnustep-gui-0.24.0/Sounds/Ping.wav0000664000076500007650000012605411240162532016635 0ustar brains99brains99RIFF$¬WAVEfmt D¬ˆXdata¬ú¥Âÿ6ÿxÿ¿Å0îÿ°ÿrÿcÿb†Üÿ½ÿèÿXÞò“¨Tûÿ>™~ìÇÿJÿÈÿÄúêbwÿ-ÿ¶ÿUU¥¶%¢ÿ’ÿñÿÕØÙíÿÿúþqÿbŠ+¢ÿ’ÿßÿÌÿÄÿ*NæÿÊÿ¸ÿæsO£; )¸ÿ}ÿ ÿÔÿ)¤¥WàÿÐÿÔ…¯¡…´ÉÜ¡\'S7¾Õ¡œ¥UÒœ?ËF1›ç¥ïöD%–cp>¾öÖ-7!³n†ºÛÿàÊ{Õgh¢šJ‘d8ùþõýýeü8ü`ü¬ü$ý¡ý¹ý¿ý'þÚþÊÿ’ Âýó³»:ïþæýùüAüàû¼ûïû•üjýœþ7<æÿ'ÿœþ^þ|þŸþ ÿÉÿˆ"RvÄ]úßi£•0<‰ øÿa²Ð ]ª©ŒÌsfÌý @ UÊ ßÆû ù CäMycÿCË`=@ˆ»åùÕZ¢ÿiþuüúÏ÷ãõÁô¿ôïõDø6ûYþNªÊ—;ºü‡ùöQô1óÿò‚óBô¶ôëôáô~ôÕócócóÈóðô ÷¸ù«ükÿMË"åþQü½úñø(÷hõkó”ñ¡ï|íì4ìÆíñ¾õ0û\S+ w • Y©Œþ½ù"öïô_öVúqɇ­#˜&Õ'§'&n$€!lm@±Ë  Bî rô ïRÛ§•DAaª ]î“.œ ¦›K®30?ðQû°÷öÇö–ù#ý’påôþŸùüñÍèHÞ^ÓÏɰ¾k»ŸºÝ»#¿ÙÄYÍy×*ã7ð·ý‘ Gwˆ®Ldù6è'×ÉÉ¿ì»"½ÃÃ.Ï"ÝíêöXüýAúõ€îãèæ冿ë©ñ û~"Ú›îè¨eàKó ο6ÿ`üŽúóùûDþAÎ& Ä G X Ôä#5’K[cwþ\¿}©~f~ÂyTlNr07ú Xû°õóñôöú ÿ!Íeþ{ûñôï[æÞ1Õ6ΖÈÍÆÈÞÌÏÔ”ßAëCöbþˆ·þâ÷ïí”á,ÕsʸÂi¿RÀ¥ÄÌKÔFÛAàAâ!ákÞ·ÚœÖ+Õp×IÜ®ä_ïûù½l ëiW/ ÑËö²ê‚ÝãИÅQ¼áµ8²~±Ý´‹»·Å ÕJçUù. >m®±j¯÷¸ìYæÏå­ëù÷W bG1ŒCRóZ¸^ \ÝUDM¬C¦9á0*^$¤ ëŸÊœ¶` žÖU!ä!!e ÙªßåÈ"-)ý-ç/;.(êü2ãó=è?à3Ý¬ß æÛîqøR'üpüIðOàrÏ/¿ý°³¦x `ž‚¡ ¨ñ²ÁÐàGï[ü—ÓRŽŸ Uƒ÷ûè ÙyËIÁ‰»…ºE¿çÈÕÁâ_î_÷„üUý1û÷GòÃî¿ìîÓó€ý† ‘<@%Æ&$·Z Umû©ôð*îî‹ïGòïôb÷ú|ü¶þ©ç¢Ž , ~ ýœ d ¤q¥,^?VT1iíyÿ;~•~ûzãkwNò-5]ôï~êJïâò¥ù–ÿ7ãu)œÿïûö'ò)îJëè¾å#ãëáLá âä]çfëCïTñAñ îèGà=×íΛȳĮÄÉdÐvÚºåÌï)÷€úù5ôðìOäÑÝPÛ®ÜÑâàíòúP‰‘Ï <:ñŠáÄÒÔÆC¾h¹E¸˜¹®½AÅAÏÜ–ëwüå °Ö#d(º'ï!æëèÁüãø,úÂo ™+:1EÊJ¾JãE@=m3*å!Ý_ói&!ñ"ž$í$."%&}¿$Dž¯7*k¿"&9)‘)¤'O"R¿ âý+ï3ãÜ!ÙšÛLãÊîšû—œ ÈÁ r?ó2ãÖÒRÄ\ºå´³Íµ4¼:ļÍì×qáõéëðœö°ûCÿÜàþùºò’êyáVÙØÓûÑaÔ>ÚRâ´ë ô˜ûŠÿMmþÏú2÷†õ8öfùõÿb €†'ð* )´!æÉ “þôÇì«èÜçê?îîóæùÿ'ÃYq « š ¼ £ Î ‘ â !n¿'à7J<[yh¬pÞr«nd´SÉ?ä*äSÞúnõõÂ÷rûÿAUÿýDúÌ÷²õôâóŸôOõëõtõgó)ðëëÛçñä0ã:ã¬äænçåç_æéâ6ÞÐÙùÖ Öð×qÝ!åhí§õæü»ügõüì¡äÓÝÏÚܹâþíµúë§Tu°ý„òÚçÞDÖ#ÑæÍûÌ©ÍxÏñÒoØÂßÇéöœ¡Ÿg T" 8…  &‹áŒ ¼º(¤/À2¢1ð,÷%"v+^| kµ n (ë^ë kîùþþ}# ßÔREUß'èâ !ªÛ¥‰ÚúzïæÀàäß¡ãfë3õ%ÿÙ] ´ ò2õèäÛúÑÁÊDÇÇñȶÌYÑíÕ—Úßuãÿçzì€ñR÷,üøþ¦þÐù#óóëåºßjÜÒÛÙÞÎäòë ó"ùºü¶ýlý¬ü!üùü¯ÿ¼× <ü#K"¿ÿc wý<óíëvè©èÓë’ðãõ*û¦ÿ.B¬ŽO!8'cÿ{'Ùí ê«)+r9GŒR0ZO\ŠXíOgC"4.$¥e`û0ùnù¥úJû.ûþù´÷zõ ô"ôövø¶ú>ýjþdýUúóô{îèrâDÞ³ÛÛ`ÜßçâŒæ èèpç¼åäÈäËæ—êfïšôNùéûÐû#ùôaíhæ§à,Ý»Ü'à¬çò#ýìa Øvúòûé@ãÿÝ;Ú–×ÌÕõÔqÕ…×Û âiëf÷Tê‚Á!3 w‰Z üO`Äï. ÷v"#K"™ âÁª!â#ÿ$k$\"d7± ÕüÎøsøªú„ÿš úä*d=§—`?{5– VüúÁò*ìé£éøìêòaúÙä l õnþô£é%ß]֥ϊËÚÉ–ÉZÊmË7ÍÂЩÕRÛ âœé¾ñùµ+êCбüIô¦ëä ßZݙދâ¨ç1íçòò÷^ûþ°ø¥ , ÁòÄ5f•Ô;üñóîÕêáê®íò¦öBû:ÿô•M<õüí/l€]‡ÓW1ªG ³Ë-(\5:BKM©TDW1UOPEJ9~,¾–= eü!ùB÷ÑõRõŸôªóbô‡öVùMý/¨¥ÿºùðò|ë"ä^ÝøØ\×4ØHÛ¥ßåêêïnñ’òIò×ñòóçôâöç÷Nø÷÷+öãòMîé¢åìâýá“ã è^îõõdþ† ¸%  Dæü¦ö¥ðë¶åÓàÛÜèÙê×o׃Ù)ÞÎäsí¦÷Í ¦± ÈýrÍåþÝýIÿßå ÊÑè ¹#å%Ý'q)(*«)Y'~#¨Hë€ ”ýÍùùîúÖþ] ^Êç·«O'ê>µó¯M údÿùþôFò4òTô ø~üÎ3§†àü¿õní•ä¼ÜöÕ7ÐËËHÉnÈÉËêÎØÔ(Ü–äÌíD÷CÔõ 'À z¨ùñŒéâãôà|àmâçÈí6õhüÉ8o É-zµ!?œ¤ ë ÷Œý›øôññ ò†ôñ÷†û™þFü¹óp”íšùÚ„àc@<¸[ ·ÝÌ}&t1|<$F_MZQfQ­MiFH<^0z#bË ¥xú•õóŒòiórõ¾÷}úîýÿsVNíþŠùLóìäkÞíÙ€×o×tÙ‹Ý9ãÀémðöCúÏü)ýükúTøIö³ôóÆñúðØï×îîJíHìnëëÚë,îÏñ—öüûEU P ®j”ÿèùãó¿íóç1ã<ßDÜ®Úڊܨà@æ²í¸ö|@ Ú6Û@_CëÅÿúùöèöäùbÿ‚ú~Çî$¤)£+t+*g'´#ìzÚXãæûÿ„ýµü¹ýT  ªJÎ]¾ökÒ/𕆠pÀ ÿsú—örôÝóðô÷¼úþÍe^þùäñsé¹àBØéОË9ÈÙÆâÇ&ˆЬ×óß÷è#òôúèV Ì ä A"ü“ó¼ë·å/âÅáHä‘éÔð$ù Pì&Ü« Û ”r| ÿ{ýüXú´ø ÷Rõµó¿òŽòSóþôa÷ú¤ü¬þÑÿ?7ôÿ¨ÿCÿJÿLéoÄú5°p 5 ÜJ ë(D2¿; DÐILcJÌDb;‘/u":* 5ÿö÷{óŸñ ò ô;÷‰ú–ý<Ý)s·ÿÖü ùô£îéhãƒÞºÚÈØlÙÜöà®ç²î˜õ:ûéþ¹6sý úöò ï[íèì‰í%ï#ñhòoò¢ñZðJïiîÁî–ð_ó3÷õûÀ¨%­7V ÿmù óæíHè‚ãà©Ý§Üܪݼà©åìëÀóÅü¤«¹D­Ó ·ÜûyõÇññÎô…ûNÆ Ê¶#t&Ü& %"ªÉX0  ²*Qàa”M ž¾A&/¦°²‚y=Ξ/Ù ¹ & ýdø%ôšñìðKònõmùRývï€)üõ'íNäÎÛ¾ÔÊÏpÌŽÊ5Ë<ÎGÓúÙŒájé8ñîø¡ÿ4Ê Š Ê ’ çCÿÃ÷)ðàéGæråQçì%ó®ûQ ¤GÆÉu A‹vûø1öùõ¼ö÷÷mù;úÊùÎø¯÷ködõ:õö÷fø*úâû8ýBþÅþÀþÂþÿÅÿ?îÛC ½ » \ Jq< "û*04¬<%CmF½EAô8*.¤!§±#ÿ¼øVõÿô»ö¼ù‡ýíŽüüù õDñícé5æXã}á$árâjåêßïHöKü ÖôÒþËùZô8ïÕë_êÙê í“ðôòöùŠùoøVöÞóÑñQñòìóž÷Üü,į F S ºú[ü›öÞðýëqèñå™äpäÀäúå¡è¶ìEòTù»-†RÑ0©’Œ$ù;ôMòºó‘ø `à 3$µ$"4 ”M { ó)­=æÌ·ÀG í Ê ÚIß-^ê¹q‘;¢ô³y¹5–Y ¦üÈö”ò¦ð<ñôjøjýd{ ¡ÿpùñ®è àÐØÁÓÑ|ÐÈÑ ÕÚ,àDæ`ì©ò.ø¬üæÒçX žR:nü—öõñ+ï ïÂñ/ö‚üä ‚Ü9 ~ýù±õôYô×öoúšýåÿF%|ÿÚüÉùèö4õõ3öø÷=úJü†ýþ`þšþ4ÿ!û!í*9  r ä ð % › !Ø$w.o7K>þA&B‹>'7>-&"“ 'áþÂüýáþ7"t’hW°þØûù¥öjô®òñ&ïxíWì‚ë@ëìî7ñ õ‰ùüýDG6þ¾ùô€ï¿ë±éré%ëåîÄóQøNû€ü×ûwù+ööòzðïXïÈñöâûѧ > : ËþpÿûÀöUòpî[ëãèœçZçËç;éöëÆï õûõO iîW^ ‹ûy÷bö’÷.ûVƒDî´Ü´¤˜ j òÝ«âf £ w Q  ¡ ³Ì>öK v;–Ët @ ^£Àßù»óõïîîðNóp÷Ñû¹ÿÈþ$ùò;ëCä)Þ½Ù7×pÖ\×–ÙEܳßíãUè÷ì5ò9÷Çû@ßFñõ6ÿ8ûÂ÷ÔõÎõf÷ÞúlÿêÕ“ ^ :ý¥økõãóQôüõ^ørûrþÆÿêÿ8ÿ'ý_úœ÷1õôóóDô.õ•ö øPùPú û üýVþËÿƸâCY$“åºH Áì.–&>.04’7,8¼50a(îC3 ÊÍþþþ9þMþÆýžüZûHúùË÷âö4ö•õóô4ô7ó5òŠñ=ññ²òÎôX÷‰ù,ûüÁûú÷‡óðKíjëØêúëEîLñxô$÷ù¯ùÈø‘öíó«ñð3ïÎïôñ)õ¤ù»þéòš„¿æ!þ)ú×õyñšíOêôçâæ‰æsçÄéGíTòNøWþåÒ ¨ ! ; é4§ÿ`üPúDú¦ûþŒéÔ 0 à  £ù3¦©øj ¬ í ÷ «-ñµK–_ÝYðëÚ¶@¢ÛB« Û Oû÷æóvòžòûóHöEù1üwþ+ÿþûm÷Xòèì™ç°âßÝÒÛÇÛ;ÝØßjãàçZì)ñö=ú%þà¸W½õ+QkXþúükü“ü½ýcÿïEñ6jõý0ûhø\öõˆô%õ„öLøªú¯üäý¶þNþ‚ü‰ú{øUöúô/ôÐóô ö©÷jù7ûæüUþ¾ÿ²}7œ³þ1ücužG 7£¸#ê( -O/–/¥-H)\#%s… ¢ˆÿ2ý¥üžüýRýNýýüäû$ûúúúiúqúƒúÙúšú*úûùhùõøùAù¹ù(ú úPùøàöuõÔó=òéðvðñ…òõù÷úžû)üXûõùDø>öŸôô[ôÝõ´ø®ü9<+Ê » ñûñüÐø`ô„ðrí#ëDê}êëYíÄïµò£ö!ûè•~ ! â Ù Í-f.ýú÷ø8ùéúžýÑî~¿ë(g9¯ñóˆ í–äÓĽà/¨_7ng[ë\æÅ60N # Aëqü¶ø+öóô2õ0÷–ú þHÉKGÿúõ‡ïê²åÓâUáSáÈâÜä}ç#ëïæò/÷ûÙþçss ´ ‡ › ä “m;¬þÞüüeüAý€þÙÿWÊÿ£þáü°ú˜øÃö¹õö÷ÑùÌüÿ2ÂZ”ÿý,ú÷Óõ@õGõ5ö[ø„úüyþÆÿc“¨žìx÷º-hÌufûS -˜Ô#B)ê,a.®-}*%n1³Íhàÿ2þ§ý…ýþ’þ…þRþLþƒþ¥þ2ÿ¸`#ãSÿSýûxùÏøöø‰ùcú+û›ûvûªúù+÷”õTô}ó¿óìôÞö«ùNüÖý7þŠýÞûüùá÷öDõŸõ\÷Uú@þSóæ~ n fµ—þgú}öYóÎðäî±íÐìIìíâî2ñ™ôùÝýøŸ 4 ü ukÿóúÅ÷ÿõÒõ¿öÄøÇûÿ—;›¥ùè"“cßè  ²—å·Tœ F  ` ͬ‘ºVÚsÄ”ˆ¼vq £  Ôä¿ýHúñ÷ðöU÷ ù×ûÿ@Æåîüø”ò]íêèÍå,äÑãŠä=ædèëî°ò÷KûÿøM K  ¦ i§,ýŸúïøSøûøƒúñûÿüjýæütû‘ùøööö·ö²÷_ù\û&ýBþ™þ6þÉü¬ú‡ø‚öÍôô®ôüõi÷ ùËúqüýÛýþþ˜ý«ýwþ\ÿ§ÿá‚߉ ù .[Ng#â&‰(J(ï%\!mêTUňdþEýôüý…ýþzþ+ÿ¥'ÆOûŠ#ƒƒ2ÿ“üpú‰øJ÷"÷™÷øù2ùUù7ù„ø‹÷”öqõbôrôrõÐöÃøZú›û?ü×ûqúÍøI÷âõ`õ÷õ`÷×ùývÉPŽl ¦±TýâùŸöóçððîGí‡ì|ìäìDîbðKó÷ûEÿì™ )÷š%Cü’øõ´òÅñ ò‹ó`ö¢ùyüÍþ»"-  š6 U ð m  L ’ Ý b [ Ä Ÿ é Þ d¢fï # | 7  ³ ³ Ò á k ºt’gÿ3ü úáø®øôùIü¯þóÀç¨Hÿ×û½÷,óœîÚêbèÔæIæ™æÂçÌé˜ìùïÏóÿ÷Uü—XÂw N í A - þôþÃú ø8öƒõøõ¾ö±÷zø+ù´ùÆùHù5ø ÷…öœö9÷øú3ûüFü¾û§úù–÷Fönõ!õ_õ8öP÷=øù#úßú/ûUûfûaûoûÉû’üWýþÍþ½ÿ•>hR' ¨Öñ5!Ü"#D!#(XF ©pþ\ýMý±ýNþ:ÿ4<³Ë_‰Q@óºÌÿAý(ûÒùÙøhø£ø)ùaú‡ûýûü¬ûpú„ø7÷¥öxöÀöC÷øXù›ú’ûúûü‰ûœúÝùUùAù4úüFþ­ëÁÒ»¤ÕƒÚý û7ø;õÁòñøïUïìîëîîï¶ñôàöOú¤ý¢õ ;ÿ‰ûž÷ ôyñ‹ð)ñÛòˆõëøBüÿ…8¢Ó˜ l j  “ õ «  i 3  " ‹ R G UØÛõhà . œ R ÿ ± ª ¶ 7 þ SW!²›ÿ7þ’ý¥ýþÀ ZŽ#ãþ«ûØ÷ô¾ðöí)ìaëSëyì–îJñÓô­øzü±¯ c 9 â l Ù{ÿbûˆøëö{ö»öS÷‹øú%û×ûÏûû<úWùŸøOø˜ø6ùÁùgúiûDü‘ü–üüûùùþø(øÏ÷ øYøˆø ùùýùú,ûOû…ûâûdü3ý þðþÍÿÝ.aì½ y –þ ‹!J!gI*¨Þ Á‘bjÿÿ„Äe{5¶)PA5¨,… ÿþ6ýÖüûüŒýþ<þRþUþþbý?üû#úùVø®øÂùØúÊûžüvýJþ˜þ(þXý‡ü÷ûÆû>ü…ýMÿ†ëöÃÞÿþüºù™öÒó³ñPðŒïxï ðÈðÛñôÕö½ù…üíþ½ËÕäNÿôüÓù÷ßôMó†ò<óýô‘÷åúeþ¡@x[c • h  èü I  ¹ [ ® à ' R  ¿ › © ° £ © n ó ­ ¬ ² Ó Ã l ¤ Ÿ `f8³iÿ ÿ–ÿ—ø˜:õþÑûSøýôFòNð/ïéî ïIñçó„÷>ûÃþ† ª R [ó¸óFÿsü¦ùn÷ëõìô„ô(õaö°÷–øùðø•øø5÷pöö£õÊõKö3÷sø­ùƒúû=û™úÇùûøø%÷ÚöÒö¶ö÷Ù÷àøúû¸ûnüÁüßüýRýôý©þ…ÿü·’µœ ­ Œ£š:U+ôÍtf»± š¥UbÿÜþËÿ,ŠGdÍûÆ  šBC\†%Úÿ}ÿCÿÿôþ–þLþŒþÑþŽþ8þ–ý¤ü—û•úÉùXù3ùGùÞùËúºûnüýü7ýûüoüÉû ûúŽúû"ü•ýÛþîÿÒå GþÜûJùlöŠóñ_ï4î¬íÛí×î#ðøñðózõ÷«øUúlû.üLü«û€úäø+÷‰õô óõò´óõX÷júÂý)?5Æù¦]æáï Ù ð ¿ Š œ „ F Ö ð G µ  9  ý ¹ „ ¶9pC&ì,¸ÿÀÿ)ÙoféÌNÿéüðù÷uôeòñÆð·ñ¿ó’öÄù ýÆÿÖd¶`@Ç)“VRþYüBúˆø÷Àõ†ôïó7ôºôoõföz÷Þ÷€÷úö(öoõ õÞôÓôóôYõ.öu÷±øù•ùKùÚøø&÷[öøõþõ¨ö€÷Sø;ù`ú8ûxû©ûýûü üŠüFý9þ›ÿ&<Œe\ ± ñ Fd÷`ºñ;2 B Hé‹g¥R­‰,Ë  c„rÆQá­:¢aÿïþÆþÏþ´þ¸þÆþ¯þxþÔýéüüfûÜú“úÀúcûDüý¦ý§ýWýàü üDû!ûûÀûúû™üŠý}þLÿÿÿiý+û½øGöôcò÷ð,ð>ðãðÔñÅòÔóØôœõbö(÷ò÷øùùØùwùÝøHø]÷Œöòõâõ£ö.ø úƒüdÿFèöœÇRý™­Ç Ô ™  ;  á c ñ þ : m ¼ L Û   † Ê 7 Ü | ù š = ²Yû ÎôœÜqÆÆnk6ƒÿýzû£ù%ø7÷Êö÷Qøýù¹û‰ýoÿÞ«zº¡@‡ŠOÿÃýúû+úáø4øê÷ˆ÷S÷^÷÷í÷øþ÷ø©÷ìöŠö“ö²ö ÷·÷>øžøÚøÜøåøÑøƒøÀ÷÷±ö´ö-÷ø0ùKúUû`üdýDþÒþÿ•ÿÃ1yG7/¡8¤n € ¡n|ؽOVíd…Ý « z v ÆTàÑby‚l6²ÛÕÄÔï<ÇË)vlúŽDÝ&0ÿ_þ÷ýÍý§ýØýþ€þÏþêþþþ ÿùþ¸þÑþÿõþòþÿÝþRþ;ýüû;úpùÉø?ø3øŒøxøö÷Í÷Ë÷r÷÷‰ööõÆõököîö¹÷¡ø'ù&ùóøšøû÷÷ö¡õ¤õçõpö÷éø úØú–ûUüÕü#ýÄý'þþ2ÿôÿ­´`[M⸠š s£àáX/ãÓ¨m n ¬ ŽÓWدÖ,{©ÌÇ\ý¬ðèÔÞæöyWDþÿ«ÿ’ÿ†ÿ"ÿÄþrþ'þ ýAý`ýuý3ý(ýný ýµý°ý³ýÈý÷ýaþeþ#þ#þ²ýåü8üšûËúÑùùµø+ø{÷÷Ðö¦ö“ö=öãõ€õˆôžó=óó]óËóLôðôšõ?öîö6÷÷.÷3÷2÷X÷¨÷6ø#ùëù¼úZûïû„ü¼üý>ýýÃý-þäþ u±®‘æ‡ A ¡ ±f©T°Yl8;+ k É |s„ iÙ÷”¡¾z1,—b¯-iož¯Õ¯`IÍ¥ÿÿþêüõûû¤ú’ú›ú»ú>û¢ûüšüãüÉü‚üüDûFúùó÷÷GöÄõö|ö~ö¼ö÷÷Æö­öö>õžôôøó;ô°ô1õ“õËõöõÜõ]õõõïôþôŒõ!ö«öw÷gøIùú•úÔú:ûŠû«û>ü:ýYþ“ÿ¤Âå­Ÿ—¸2ú ºpï®™Úok÷ † ¶w„Ü„ Ð?ô°ñµ#]x„ìi‘íÿÕÿ©ÿ¤ÿ ^jVüÿ’ÿ4ÿNþ0ýü!ûYú´ù\ùLùùú¦ú‡ûdüóüAýý®ýAý¦üöûÀúXù%ø6÷•ö@ö öàõñõñõö¼õ>õÀô0ô‚ó´ò òÖñ òbòöò²óºôŸõRöõöv÷Ä÷Ô÷û÷døÏøWùíùsúìú\û¡ûÙû ü9üüþü{ýbþ‡ÿ€^‰·Ë>µ  Ï A,iýëuhä ± 8‚(ª‚ß"ˆ¹ÓH׌­ô ?¤x¹øÈä—"¯þ+ýQûÌù˜øê÷û÷døZùpúCûÁû9ü‰ü—üYüðû[ûÉúúÚøâ÷s÷}÷ƒ÷™÷“÷²÷ç÷ã÷Ô÷ž÷,÷aö%õôzó9ó0ó‘ótôõoõ.öøöl÷Á÷¢÷ ÷ørø­ø ùÐù–ú-ûPûŒûüüý•ýXþŠÿš”–ˆ/íþ_  ñuø¡kRêè g 5 ¾œ•Ú O À  ¤ ¨ÅîCx›þÇ¥¢ïxç-–Ðp©ŠÈýþfýÀûPúrùjùÀùúÁúµû¿üÄýªþ_ÿ‹ÿ2ÿÇþ&þ*ý²ûMúiùªøø·÷×÷3ø—øæøÕø}øÕ÷D÷žö¦õ¨ô¹ó>ó^óÊódôBõŠöº÷’ø9ùƒùÁùúoúÚúGû•ûíû‚ü ý?ý=ýCý ýþaþÄþ+ÿ ;xjÿ—„“C   "¯$/·iZNy;ä è |  + § 4 =  ä K œ)ÔB†ÔM/zÛ=ã’þöU‘‹ßżþœüú3ùbøJø—øùúcû—üJý¸ý þÍý*ýªü6üyû¯ú(úÓù ùùfù}ù£ùÓùÆù˜ù@ù°ø†÷öÖôåó,ó¼òòòó?ô3õ~ö³÷¬ø]ùÎùúúOú}úÆú>û”ûëû3üKü‘üÖüý˜ý^þÿ ÿbMÑt[¥ê² Í#ÿ}uÏ‚zÏèÍ › ˆ Þ † • à æ õ  ö d ¸F!5|éR7†û“]Ýû—›<ƒ›ÿÓýüSúÕøî÷•÷½÷OøJù£ú¢ûüý?ý%ýýüÌüžüüCûòù²øÞ÷z÷g÷k÷¼÷%ø>ø ø»÷÷âõôŒó·òÍññ3ñÒñáòpô¸õÞöý÷•ø™øÐø1ùsù»ù5úú„úˆúúÍú6ûwûÀû*ü…üÿüÙýÿؤHŸ{¾¿ À a˜v‹îc&>l Õ u z ÊrRfˆkó蟪K»ÞŠJoÓqã4jyÿŸý¤ûù­÷•ö öKö÷ù÷äøŠùú‘úûvû†ûÊû½û%ûGú›ùâø6øÞ÷½÷ª÷×÷ý÷×÷¢÷u÷ðöøõðôÖóò9ñ‡ð=ðSð.ñ‚òÑóõMöG÷ç÷SøøyøwøuøzøèøXù‘ùëùOúŒúÀúûyû5üÞücýßý{þbÿ8M’GdÈ ? z.ƒÞ—ÞÍDI¢ T   œ…f2!ø§]ø$)‚ál×ø2‰}´˜N¢_¨þÄü°úÇø|÷…öÚõÉõö¥ö{÷wøJùú’úÛúþúÝúúYú'úkùjø ÷÷´ö¤ö^öOöfötöö‚õ±ô˜ófòiñÎðGðìï8ðBñOò:ódôœõŠö9÷£÷Ø÷ øIøsø›øîøùíøùoùáù<úÔú…ûèûü‡üKýþÿÑÿǹòc'B„ ¶ ¬wÝË|Θדè5Š  Ý ë?°qcvÃ+-®ò0³X ùü>—ËêòŠ…G‹®ÿ þü"úÈør÷XööEö öK÷=øÚø–ùPúÒú.û[ûIûðú„úõùùAùªøløAøÉ÷™÷¾÷»÷R÷Åö%öWõqô2ó0ò¼ññ„ðñSòmó¸ôö@÷-ø{øÇø%ù3ù3ù$ù/ùmùùùjúÏú}ûóûêûüüåüýtý#þÿ'PŠŸÓk2 < 3®MVòÄ b0n¥~ Y J ¥ ƒ o | ^ I  Ž sµ!Ev‘‰–ŸiUK•Uýa˜ÿÔý;ü³úmùiø…÷üöýö“÷qøRùøùeúýúûðûVü}ü|üüûÕúúMù¿ønøJø$ø¹÷÷pöØõ5õ©ôô0óxò?òXò¾ò˜órôkõö¶÷‰ø ùPù´ùú,ú*úÊù–ùËùWúÉúWûCüôü?ý{ýÔý þoþßþ«ÿÆô.ˆ1±ôi 9 ÷ ˆYØ=L»­(h\ÖBÄ r z  ’ } Á ± R Öv‰Â úß Ù^`öiþFýCüûûù=ùÆø”øÄøù¨ù_úLûü–ü×üêüýùü‚üü&ü9ûú úHùÐørøøì÷¨÷ýöAöõðô†ôô†óPó8óBóøóäôök÷©øDùjù„ùžùÃùÅù©ùÎùkú'ûÚûgüáü4ýYýPýýñüEý¹ý|þ¸ÿ$rû€É0¶ L  “'Ñb´hŒ[Ò’ Ê- Ù á / Ú Ý ü ' L ô 4  A & ñùzÓjÃ"*Çq'üþÞýsü/ûGúoù¯øøç÷ß÷øÌøŸù“úQû¶ûü3üQüYüü½ûYûú»ù!ùpø¥÷Üö ö~õTõõxôÐó<óóòòÇòþòyóÉó0ôàôöŠ÷–øù ùùÂøŒøŒø¿øùhù!úÉúCûŸûûû>üvüˆü®üýâý0ÿVcÕ`ñ_Gs ñ s ØNͨÎ4Tá!e Ú … Ž ÷c:^K[¢Ë°šŸÓûúÉQÑñлØûðžÿâþ¬ýKü÷úÑùñø øx÷5÷÷ûöa÷AøûøHù¼ùQúØú'ûgû’û1ûlú—ùÿømø“÷äötöÂõõÎôôlôMôðó~óóéò¯òeòRòÂò¬ó¼ô¦õcöÈöôöC÷Æ÷5øYøGø[øÂøxùúÞúˆû¬ûûûðúû‘ûLüwýÿ·ÎZzÇ ‰ J ý ‰e#¤»$¡×ë t   1³´ëéÖíw°¹æÚŒr¨ÁÁ‘x²ÙØÿîþJþŸý­üÊûûúÕø¼÷ãö'öÍõØõ7öÓö7÷˜÷yø}ùú?ú”úÙúªú;ú¨ùùøõöÙõµô÷ópóóÞò ó7ó;óó±òòÊñ ñµñQò ó ô<õö¡öéö÷A÷¨÷ ø,øhø½øÂøåøùzù úúàúäú*û€ûü2ý‚þ替JГßv Õ ã㛣U'^:›®í q ` 2 O »lˈ$ d t d '   G4#è]˜.d‚ÿÌþ&þýÑû²ú®ù§ø‘÷Îöuö:öaöëöw÷ö÷¿øÐù´úNû’û´ûaûáú©úýùÑøk÷?ö–õgõõáôüôãôúôÞôlôôÿóÉóÑó²ófó]óÜózôWõEöìö†÷Þ÷ø?ø¶ø0ù‘ùîùú[úÊúû!ûDûŽûü\ü ýÙýßþMô{³åg  g ý ¸ c9Äñ€Š ¶Øç = f è Œ U c ³  ` Õ 3 H  ‰ Ð 7 Ž—_8ürQ£°›Ôÿôþnþ¥ý–üŽûœúœù‚øu÷ÇöÅö3÷Ð÷Šøù˜úûeûïûtü½ü’üùûæúŸùgø~÷ºööõ4õ%õ=õlõhõ8õõ"õÍôƒô†ôÎôõõnõüõcöÄöŽ÷@ø øàøbùÙùHú»úûQûRûNû\û´û`üÓü$ýÃý¹þ®ÿß:•ɺzo‹² ; õ »Ü±Ñ Óö¡èázÐx 8 9 W \ ™ Ý " ‹ Ñ ÿ  Ô V ™  _žPzÿxÌqúrxÿþ£üiûHúùiøøº÷º÷8øéøñùÍú[ûJü4ý…ýlý>ýÎüáûôúúöø÷÷:÷ñö_ögöœöÉö&÷#÷ûöÎö¦ö`öþõªõDõ õ#õõBö%÷%øùùšùðùMú7ú!úgúíúwûðûüVü±üýýJþUÿYFd‚zJYõ) o áqð0%¤¹=Zü?:o O n ª W N ‹ E µ ­ ¬ ö > $ y x  ˜Âá<‚Â~7³¤ÿÐþ¡ý˜üËûÌú¶ùŸø¢÷îö‡öÝöÀ÷Áø¿ù}ú4ûðûiüvüFüÏûÑú´ùvø÷ùöhö öÝõªõ›õØõ ö3ö$ö&öö·õNõÃôzô„ô¾ôõ}õàõö~÷(ø^øËøNù–ù°ù£ùÃù"úPúVúžú1û÷ûœüFýþÙþçÿ"TÜK)Mw«@  w Ð ^ÞCw‚/5˜¯âo 2 ! œ ‘ X 9 Ÿ Û  Ä  Ù{úFuo­•gºÿÿáþºýŠü¡ûnú,ù7øX÷±ö7ö.öËöä÷êø¯ù„úûûñúÎúXúÆù/ùHøt÷÷>öiõÿô õFõgõYõ¾õ öÓõÚõÚõ[õÃôYô»ó~óÚó1ôâôøõÂö}÷øMøšøàøáøùùAùUù“ùUú4ûÇûRüTý[þãþgÿþÿ¥? àè pÁ À _ Ó ’Z Yê„[ {æ a  / ¨ a m ò w Ä % L â  @ 1ì·vJ©F ¶ÿOÿòþ–þþ'ýJü†ûaú ùÿ÷÷UöÔõ°õßõgö+÷ý÷¬ø#ù¡ùîùáùù8ùø÷ÑöIöœõ õ½ôÍôëôõAõ}õÂõÞõwõæôXô­óóÀò¡òÓòióô¼ônõlöM÷­÷Ñ÷ÿ÷ö÷ô÷ ø:øöø¢ù ú³úkûùû übýþ{þÈþoÿ`7<Œ×Ì×%U ¡ _ ­"/à  ¬À3²d 3 : ‡ W m ® Ø  R P ñ 0 9 ࣚºÂ½mãÿ“ÿ„ÿŒÿ[ÿÅþÖýêü<üTû3úúø¸÷¦ö-ö öcö-÷Ò÷Yøù­ùÓùõùMú]ú´ùù“øøg÷¿ö öÏõµõ³õßõöAö}ö­öƒöûõ€õ õSôÑó…ó²óvôõ|õ öâö²÷ø~øêøÃø†ø›øöøˆùúÄúœûnüýýEþúþYÿwÿ¹ÿ}–žÊ>N­ U ¡ ß F¢ó ›U•}n< m B f Æ  æ y É Ü ÀŽ6 8_¼=ݤˆa@¡ÿ·þÁýÑüüJû:ú!ù@ø©÷B÷<÷Ÿ÷ø ø ùfù½ùòùÞù²ù¦ùvùÞø^ø4øí÷—÷K÷<÷d÷n÷÷÷÷1÷@÷9÷×öCöÉõõWôìóôÛôÞõŒöE÷øpø“øìø ùù„ùãùóùRúûüçüýêýSþ ÿÎÿ<²H+E[vÓ6 ‚ ‡ l 8 XìsËनÐüøÞò9ª  ¶ q i V  À  E  ïßá3¡õF®IöÖÞEXŽÿïþ þ ýCü§ûÚúèùùømø‚øÀø6ùßù>úžúÝúåú¶úžú«úoúäù5ùòøËø“øVøøøô÷ø÷øUøŒøiøø¼÷1÷töØõƒõ“õîõ‘öK÷/øóøzù úzúuúúúZúû¦ûDü ýäý‰þ6ÿËÿH ¾êf1/³©º â ô î ¬5X\wqøÕ „².º j C  ¹ O ž ¤ Ÿ Åé &W¤áoïZÑ J«ÿÿfþãýOý«üøû%û.ú@ùžøtø`ø.øjø¨ø½øÀøÚøùø,ù[ùwù¢ù¦ùŽùkùù‹øøë÷ øå÷Â÷É÷¼÷{÷÷Ñö¤ö/öÇõ õ\õõõAõ£õ4öøö‰÷øˆøùøù•ù/úqúþúÂû…üý¯ý5þŸþâþÿ>ÿšÿq,ñ%~Íñׇ * ù K Å çæ"\üÚ|ÂÐÛæ$\ w æ q Û Q Í è¨Ÿ¤ÅP$”ÅëubLâÿ‹ÿ ÿ­þþUýŒü±ûËúåùùKø¦÷:÷ ÷/÷H÷*÷E÷Í÷døÆøýøùúø ùéø`ø3øUøzøcøþ÷ª÷.÷ïö÷÷®öqö=öÿõŸõõ ô9ôô`ôÿô¹õ„ö(÷Å÷wøÃøïø:ùgù¼ù@úôúñû·ü5ý¯ýþsþ¼þÙþAÿëÿŽ ½Ùë–P\ ­ È J » åûÚ'>¿SŠ‹s” Ÿ y Ø Í ÔGÃü .£}å¢$ jÿáþFþñýý(ýàü`üçûuûäú)úMù‡øøW÷§öAö)öö(ö’öËöõö1÷X÷÷ú÷?øøøë÷™÷-÷Üö”öWöLöiöVöìõ‰õEõ,õØô©ôJôôßóœóÜóŒô:õûõ×ö]÷œ÷ò÷Zø øù½ù{úû‹û ü‘üýtýÁýþ‡þÿØÿùöåÚ®fÅɪª  ü Ê – ¦8çM>°ºíä Å ° · µ Ù^¼7ÜDM˜ œ;Û}tÆÿCÿ×þgþþÃýJýºüöû>û¾úú\ùøº÷âöaö0ö#ö>öœö÷[÷¯÷øMøŒø˜ø§øòøöø¼ø[ø,øë÷v÷ñöönö”ö˜öröGöýõ´õnõ$õãôÑôõbõµõâõˆöj÷"ø¯øBùÁùúyúùú¸ûRü÷ü ýþdþ§þÌþÿyÿIÅ££ÑÙ£€gôQ 2 u µ ¨ Ò5c½úàYezuy ? ™ “ h²AÚ|µø&}j¾ü–H¨ÿJÿ#ÿ¾þVþ$þÊýgýýŽüÄû¯ú¿ùù@ø÷³ööäõñõFöäö¿÷uøùKùKù_ùfùZù4ùù·øcøø™÷j÷}÷C÷ûöÌö–ö[öDö:ö"ö0öö·õ×õ;öSöùöÉ÷:øçø­ùú½úÄûòû^üý1ý>ý¸ý9þ£þdÿéÿ£U¶nl42‘N ~? :  # µ ö ƒ„4ùAÞ9)Ç4w "  Á ·Ÿº‹;¡6»*ÑiÌG‚õÿkÿ‘ÿ§ÿ&ÿßþÿ¨þ¾ýÀüÉûíúãùùuøç÷:÷÷<÷`÷ò÷yøèø;ùÓù¦úû/ûXûû‚ú<ú•ùùžø]øSøbø3øøUø*øø$øÛ÷N÷èöÇöÑöÇöâö÷3ø-ù-ú$û÷û‘üýFýjýçýþþþÿ$ÿcÿÂÆ¦×‚ϭبF ö ˜ @ I J m¹w(ŽÑS®T–Ê € g \ «y^ãˆ-”%µì2Â6ÅC©S ÁÿªÿµÿAÿ½þhþ€ýOü€û§úBù3øo÷÷æöÖöúö÷ï÷zøIù0úûEûPûJûËúGú!úèù ù>ùcøÃ÷½÷¬÷¾÷ø/øá÷u÷*÷÷èöìöÙö¿ö¼ö ÷o÷,ø1ù0ú û™ûèû-ü•ü×üÿü¥ý¨þÿyÿEùg¬•'#ï¡Hõ‚R5 ö  = N ¡|Ä– aJz˜ Û _ ^ ÿ¬Zü¯Æ/oC£»&Úÿ¯ÿaÿ#ÿôþ¹þzþ1þÁýgýÌüŸûSú:ù-ø÷/öÉõÀõ ö…öùö^÷ øÉøyùúiúúYúÑùwùþøJø×÷À÷~÷J÷;÷÷2÷”÷œ÷]÷S÷÷uö÷õÓõ±õèõŽö ÷c÷5ø3ùWúgûü=ünü}üŽü ýÞý²þþþÿ‰ÿ#¶7Ànj½lÖJ0þ¸ Ž „ ! ýˆÂ¡"™÷ [ þ ¿ÂcÃdó½í¢ò)Š­ÔÓÿEÿÿéþ½þ¨þ‚þhþ.þÂý ýRüBûðùùHø^÷dö¹õ5õýôõ«õPö÷·÷_ø¹ø¿øðøGù›ù>ùøÜ÷G÷Ðörö:ö)ö?ööÞõæõ;ö‰ö½ö±öCö€õ×ô ôºô'õ—õ!öðöß÷ÔøÜùùú\û_ûzûûòû˜ü ý¯ý—þSÿóÿW”³û[¹™Bß<Ѹ‹l=  h õ ’þ[W|óó¸n½ Û Y 5/M~ãš•fL4ÑNœç1¨Fÿ¨þ[þ&þþ$þXþDþÐý{ý ý`üSûüù¨ø£÷Öö9ö¼õŽõ_õƒõþõ’ö&÷˜÷iøQù×ù'úDúâùHù®ø`øü÷m÷-÷ ÷÷ ÷÷<÷A÷s÷=÷ôö°ö4ö»õ®õÉõÛõ+öÝöÅ÷ÏøðùÖúxûìûCü=ülüý‘ý&þ¿þdÿc™ØVîBÇ÷+·X+ÑØÅ š Å  „áÄ« ·e ¤  ¶¬P%ß¹‹ˆ‚ ŠÒãè“uÊßÿÍÿzÿ*ÿ*ÿ$ÿÚþ¤þþ'ý üØú¾ùíø ø*÷°öEö$öföáö÷Qøáø‹ùúqú¢úÌú£úDúúÉùù’øDøâ÷‡÷ƒ÷ø™øªø„øsøø½÷¡÷u÷M÷B÷÷÷è÷ùúÝú‹ûü6üVü¦ü<ýðýtþÙþ+ÿÀÿ\Ô=¬ `Ì4wñç¿2Ö,îÌ Õ ' ‰ ]`ú€ÄpÓ¶C{ À S  EМMâŽ%»#’Cñ†såDåÿÙÿ¾ÿ×ÿÜÿ¹ÿ[ÿ]þýüùú-úcùzøð÷¦÷Æ÷å÷ß÷Løäø;ùÿù¿ú=û—ûÇû’ûaûKû¯úú¢ùFùõøãø#ùgùHùùóøÿøæø·øÁøøgø(øø”øEùðù™újû üküçü€ýãý3þÖþÚÿnŒŠÓ“ñbþ’ÓV®!еjû€6 å ö « OUU7•«ÀS[Þ&  » îLÔĵ‚|D•£±| Å:µ„’¥:rÿ ÿàþHþ„ýòüNüFû&úõø*øÞ÷Ž÷w÷¢÷9øýøzù°ùúVúúÔú$ûvû_ûõúsúúåùÁù‹ùxùXùù­ø™øxøŒø¦øèøÒøIøñ÷Á÷ð÷¯ørù.ú§úûûRü8ýºýHþÈþÿPÿ¬ÿõÿL¢ôKµF×9‘‡VQ9&   L › ½qæa½¾YÝÍ L  Ð «¼Mê#I˹ÂPØÀ8D%î’. ÿøþþmþ@þ¶ýîüüûúFù°ø1ø~÷ ÷÷2÷k÷ª÷ø¥ø:ùÄùú-ú:úúœùyù~ùbùùƒøIø4øøørøzø-øø8ø4øú÷½÷Ù÷1øløø¸øù„ù(úÎúqû*üÇü<ýªýùý0þºþ‡ÿõÿ&ï>‰×a¶Ç¥*{9[yo@  þ Ó ¤ ‰ Htw^hF î ` ØÀ”x¬ßçÊKõÌS³C çkØÿˆÿ"ÿWþ°ýTýÎüLü¸ûcûûEúfù¤øî÷>÷Çö~ö‚ö‰öòö‘÷øøøDøˆø½øàøù@ùØøXø[øPø+øö÷í÷ø ø±÷÷ÊöÁöÔö÷ ÷6÷C÷ÿöæöW÷ý÷ŠøùËùŠú<û…ûéû·ü‹ýþmþÖþ ÿÿ2ÿ€ÿ!u‚¼<m'elD ([u} µ P ß •  0   | ½  @ B X ‘ƒÏ I°Qçf1õÿaÿªþ<þÝýIýçüÛümü‹ûûÜú4ú’ùúø>øÍ÷h÷ÉösöPöJö…ö$÷º÷ü÷=ø~øø«øù‹ùŠùBùDù ùMøõ÷Ê÷˜÷q÷u÷E÷.÷`÷™÷ï÷Aø…ø˜øšøø„øµø ù\ùõùÖú‰ûüúüÛý8þMþ~þèþ:ÿÿ‡Ê žÔâáJô_åìﶆ`  æ 0   ¤  ( B ò  Ó è ‡ 1 ýÜó`¤0°=Ü…qfA7ÑAÕ2zÿøþÌþDþxýìü¢üüµûPû³úcúúeù¥ø_øøÌ÷‚÷™÷Æ÷¦÷Å÷cø÷øcù¤ùôùFúvú(úÉù¬ùxù(ùðøðøØø›øøløøžøäøNùùÝùòùŒùAùù©ùÞù!úàúºû›üaý þæþ¦ÿßÿÓÿðÿFJ¤äØØ/§u'À(„ âßÅÅ š < Š Ä Ð  Î v Ù )Ñ _ o † ã × ±™ÀðY÷®íeM‚ºlò•å&º>éÿVÿ»þdþ3þÈýEýýýœü·ûôú›úuúËù~ùpù;ù°ønøÔøkù¸ù7ú©úÏúû_ûäûïû£ûWûÍúKúéù™ù¬ùú!ú,ú€ú¡ú¡úáú,ûXû+ûùúû ûQû|ûËûpü’ý@þÃþcÿþÿZ‚±î{ä0cÔôä,¨Ð¶Jvgìª÷! Œ ’ ¶ ð ÷ + £ G Ø 4 › è ­  ` l < 5 K’ÉÓ9ÚŠt`F%›4¶(}¿?…ÿ½þLþþ¡ý8ý ýýýÌü[üµûøú,úqùùùßø¨øßøù[ù§ùOúíúTûvû}û“û…û±û”û÷úvú,úÍùfù8ù[ùÎù3újúÏúôúâúØúû/ûðúþú]ûëûVüºüaý*þ:ÿùÿ@®ãìÞ:³"tâB‚©g<¾IË e ’ — È 2 ¼ T Ï l ü  Ì › i ¶ a  ÓáèŽA­¡~%õòŽÎY*Ü+ÿ}þþŠýUý[ý`ýJý ý‡ü üûùú¤úRúÌùù‚øQøøä÷KøÙø@ùUùlùñùuú½úû*ûþú~úúùÇùšù ù‰ø{ø9ùìùOú]úeúŒú€úŽú³úÚú·ú~ú|úºúmûFüáü‡ý þœþÿ«ÿÜÿÇÿëÿFš´›7²:¶QºE÷ᥠ>j¸û8 ²  ™  f ® Ø ² = — Ì Å±¼3oæf Ûbì€ähíÿXÿþ÷ýÏýnýòü¯üŠüTüCü>üüÂûFûÆú1úÁùþøDøª÷O÷l÷ƒ÷¶÷øUøÄøOùÎùMú¨ú úAúðùØùÍù’ù+ùàøÊøÖø®ø©ø'ùoù¼ùúúïù ùmùOù^ùtù(úKûü¹üLýˆý¶ý2þÔþ'ÿ,ÿ`ÿÿÿÑÿ(“S’Ü1Å‚iîwè>]`‹®â;-ܨ q ­ 2 ¿  #ćÄü3ÔÊÑÒ÷±8½ “ÿRÿÍþ þ;ýˆü*üæûüNü)ü×û}ûkû)ûœú]ú úù ù7ød÷ãö¤öˆö°öóö÷l÷øuøÊøFùÁùúôùtù ù×ø±øÙøïø²ø¬øñøùGù‹ù¿ùãùËù‘ù™ùÂùýùú0úúûpûóû½üAýëýUþ“þºþÄþÚþ.ÿ½ÿ-’ì4˜F «ö9{ý|»UuS7câ–VC  ¦ Û ª b K ¸ ¢X)VÄ—==M?E"ÏHv©ÿ ÿjþÑýwý5ýûüºü…üvümüIüü®ûDûíúÎú’úûù@ù±øø‡÷’÷Þ÷\øêømùÐù@ú†úÖú&û+ûÂúbúúíùªùÏùú4ú?ú9ú\ú”úüúJûwûyûŽûœûiû#û:ûcûœû$üÕüzýEþ¯þBÿÕÿO€¦³æ4}ñ¾oë)fÈ}âCzˆ‘w¤¾¹2׬c  °  B j K À Ê ¸¸¸®µ;î¹käóæÖT“è8Šÿòþuþ:þþýÎýÒý¿ýý^ý|ýŽý…ýOýéüüVû³úèùùžø8øHø•øêø\ùÕùzúøú2û^ûŠû‡û.ûñúû3ûJû8û1ûûõúûMû·ûübüüuü[ü0üüðû:ü¾üý¥ý5þœþÿsÿ¡ÿìÿb±ÂÁþYÁVá¡'k¦Œ‘ÃäõáÜá÷Oæ~ ·  Ÿ n < ’ t ô / 0  +2B}í·¥˜[(Æc¥‚Ó€öÿfÿÌþ„þvþ~þ›þ¸þ þŠþAþåýœý6ý‚üµûû„úwúUúúßùÎùæùQúñúVû¯ûüLüAüÚû‰ûûµûãû ü0üRü\ü@üüÿûeü™ü«üÕüýBýçüüÍü6ýÃýúýAþ´þkÿùÿx]Ž|jeÞ—"uÚ^Ì6y¨é<+俙à ;™CßE¿y / ¿ / \ H é  ù½y³azì†$ŧiÏJZœÿZÿEÿÒþTþþýUýxýšý¼ýúýñývýÝü8ü?ûÈú¿ú.úƒù@ùðøÆøDùuùŠùúžúäúEûRû;ûnûbûIû€ûiû)û:û?ûEû„û–ûÊûWü–üˆü†üüsütü›ü¥ü¬ü¯üýgý¿ýþþTÿãÿiÔcŠ€Æ#mÌtˆëpUÇøÄ²µÑ`ت-yÜ| © D ð  =oª˜¬`éØgȦ`cÿ,q´ÿ)ÿJÿÿ©þ¸þŠþþ¦ýRýýfý[ýFýŒýZýsü²ûBû®úôù=ùôø¶ø@ø(øsø¯øùeù}ù÷ùmúcú¡úÒúÂúúúeûfûRûVûûÔú¾úlúHúoúßúHûšûËûÊûïûüFüVügü–ü±üûüƒý¢ýÊýrþåþÿHÿ§ÿíÿäÿ˜Wúf´pŒz` ™k™å<’ÕOƒïÀW“o'³êï6‚ƒÛ¤WòÞ׬2Äÿpÿ ÿŠþIþþý.ýßü÷üýåüÑüzüü£ûiûyûgûþú-úù'ù¹ø<øè÷¸÷½÷í÷øIøkøÍøJùpùÐù”úîúÊú®úÚúØúú…ú±ú½úŒúSúgú‡úÔúgûÅûæûüüüáûÐû ü]ü”üæü|ýþ’þÿþ8ÿ7ÿ1ÿdÿøÿ¨ \ü;L¿ï‚9<*úÝí1aU”v5Ht ÖhµGý •1Ë<¡Ìù5¥n'‘#žgl=Âÿ-ÿþhþZþOþ^þjþWþÀýGýýÞü`üMüqüSüñûûùúRúÜùšùgù ù‘ø‰ø­øÎøù§ùýùú`úºúûVû™ûü„üxüü–ûjûiû„ûªûõû2ü4üQü•ü©üâüýñüëüäü°üÖü¬ýPþµþ ÿŽÿ/^‹ ¸m“ô_–¬Ò·äe§¿z‹ßS« P¤U%æ8 - çüd‹–Ë]Úf嘣¸žP¨ÿZÿÿÃþpþnþpþ?þþÔýPýÜüáüÉü"ü‡û ûoúIúnúbúúáù ùù—ù˜ù³ùkútûürü›üünüàüïüÒüõü ýÇüü7üüWüòü}ýÏýÿýþCþRþKþíý£ýÂý(þtþÈþ3ÿ§ÿÒH¡òsÍ HkfP(½seQŒ6°Ûótõ*Š"gƒõª*  ( ú „ Ò#{=µdÃØ½"¸—teþt<G1øÿ·ÿ¡ÿ¬ÿlÿÿ™þþýýµýýýüCüßûpûûšúAúNúú¢ú¬úîú[ûùû±üýýýýŒýÃýœýºýÿýîý…ýWýRýQýˆý¹ýéý'þžþ×þ·þƒþ3þ5þ[þgþ«þÜþ ÿ‡ÿ:÷_™ý´?‚®â)Ô~nªtEai…Ñ[³÷:µMÅG¿Èå\Ø: … w  V?-Vt³ÿšvÂ¥±¾Oíÿ©ÿ*ÿÂþ¡þuþ_þþ¸ý‘ýXýýÞüÅüÊüqü§ûæúbúúÉù¹ùûù=ú‚ú¾úþúaû÷ûQü´ü_ýÌý”ýKýBý/ýüüàüÜü»ü¬üÊü-ý³ý þEþ˜þ½þ[þÜý¦ý¢ýºýþ/þ þYþÿsÿÜÿ¾¾*!&p© »¼–X?+nƒ}³á~û2qÍT°Û9×Ež"‘ÅLX³¶kzŠÍ`¯*(G2õÿŸÿ{ÿ\ÿ*ÿðþÄþ’þ1þ«ý?ýýÓüÉüçüÆüMüÓû{û&ûÎúeúúÎù–ùyù+ùùIù¤ùúùÅú„ûÔûÆû÷ûYü£üÓüÛüªüRügüoüMüoüÏüMý´ýˆý~ýýýjý7ý ýëüãüýý0ý¾ý]þÎþcÿ4É8\‡•£}gŠX;ÑÅÛU•ÚF„‹Ñk à<ÇO¢8n ,6SÁÿXÿ ÿðþýþùþóþÿèþ¤þ¥þ„þþÞýŸýývü;üïû’ûtû„ûûjûû~ú5úûù§ù`ùâø]øEøsøVøøGù½ù>úõúuû¯ûõûüü=üAüüþûüüßûúûYüºüxüOü’üÕüÝü°ütüVümüTü^ü¢üýlýþÝþ‡ÿÍÿ&ÜcNýßïÜ ~Wd”¡¢óuŸ™©Ç5ÙjÁdˆ¹px˜hÜ }áÝ͘2ãÿÅÿŒÿ“ÿñÿÐÿ‰ÿÿ†þeþkþ:þþ¸ýýhü.üdü¼üËü¨üQüÊûQûÄúPúåù‰ù6ù"ùù$ùeùÙù›úCû¿ûGüü‡ü‹ü¬üÍüëüöüîü¯üžü»üý0ý9ý`ý”ý¦ý|ýsýýŠýPýPýmýzýzý²ýMþæþ…ÿ'ÃIÂðìúÛT-Dƒr  B9açm§šÏ <~§ä.lÉz9ÌY×<¼6 TkšøõÁ¾Öž],½ÿ}ÿBÿÄþgþ.þÒýýMýöüåüîüÚüÅü’üüŠûû¼úpúCúú1ú`úºúQûüÀü ý ýDýý×ýûýûý þ&þþüýþþ þþÿýGþwþþ¥þÇþ­þsþ.þþ-þˆþÖþ8ÿÊÿ]¼7‘¦nVU ú Îh`¬Ì Q£êëýX½+I« gÂ0¤!Ë! Ô7ntXXwãd@ùù0»“iNˆyã%Õÿˆÿ¿þ%þAþÌþŸþþ!þCþhþFþÓýHýŽüü¸ûlû)û\û¯ûÈû#ü¯üýXýÈýXþœþ«þÍþàþïþùþ ÿ<ÿ(ÿÿ ÿ0ÿÿ1ÿ}ÿ‰ÿ}ÿ¡ÿØÿëÿ¨ÿRÿQÿmÿ“ÿâÿOá—5¢Ýëåè ù‘;ôÀÚ N‚Ú Ü®Ñ˾0Ò R”Ï¥{HŠKÑYèÚ8%Q“ïCÉŸ¢Á·m1(ÁÛÿÓÿ”ÿ÷þˆþ>þþþ*þ7þéýýkýHý®ü$ü%üùûqû/ûOû…ûPû,û_û³û)üŽüòüNýsýªýþ-þþPþØþÿäþþFþBþFþIþrþ®þÎþÙþÖþ´þ¥þ™þŠþþ®þÿ`ÿ ÿ´4}”Ìæˆ 8$ ýÚ>`¦¤ˆÄ3IYÌT^]Û?£¸%vÛ. º7Œ‚nœ$Æ@à¹Ä÷¸Røÿµÿrÿ?ÿôþrþùý­ý}ý/ýôüý7ýý•ýGýÃü"ü¤û`û#ûûû&ûû½ú¤ú¬úöú—ûIü—üÄüýTý¡ýÈýñý;þVþIþ þ¼ýÂý þ%þçý­ýñý>þ%þûýþGþþ°þ°þ£þÊþÿ‹ÿ;Ü(#ムmA)Éÿ|ÿ–ÿÌÿN´¼¨£†”¾ò,?wó_ŽÏFÓJ£wÉãèÔwµàGrÇb<$GÍÿÔÿµÿ@ÿåþ‘þUþ3þþ­ý0ýÊüükükü]ügüSüþûÇû±ûrûüú€ú-úúú.úNúSú0úHú^úú#û“ûäûmüÛüÈü¼ü1ýmýcý>ýAýýÉüÖüúüßüïü(ýMý`ýaýLý8ý:ýOýmý¶ý6þ“þèþÿ ÿHÿwÿ«ÿ³ÿ¼ÿ¶ÿ2ÿÒþ ÿDÿ€ÿ­ÿ­ÿ‘ÿ†ÿ­ÿæÿ öÿ÷ÿ`}‚ÇDœÉømñsÙQã( ÚéùÃ?«ß-}è–vüÿ* õÿœÿóþyþ*þøý»ý¡ýTýýýÏü£ü¤üÔüºümüEü7üåûÆûÞû†ûûûÔúú£úøú<ûˆûéûü(üyü&ýßýeþ«þdþõýþHþOþþãýÄý½ý½ýþ5þ'þþñýþ}þyþzþãþúþ×þÿ¢ÿ#;(*7 ÿÿåÿÊÿ¯ÿ„ÿÀÿWÐçü,µ²už‘¾?‘ ³÷>ŽâS¨êæòà¾cÓP¨N«@CEJ`ƒ>Ô‰;õÿ†ÿ$ÿëþÖþÐþµþÇþ¥þ3þÓý¥ý ýÄý¿ý|ý"ýÈüpüKüaüüEü¦ûPûWû›ûëûmüý“ýÌý(þžþÿÿ´ÿ’ÿ{ÿVÿÿÓþÍþÊþ¤þ’þáþÿþþ5ÿuÿ»ÿîÿõÿÐÿ´ÿ6Œ¬qƒ˜\fsX[V5UÙCNb‘š……¡Þ#B2?zÉæ!k‚g€zh9ðÀyì;šq4ܲ©——¢Z̓L !H+¦ÿ2ÿ¿þyþpþhþ<þ%þyþšþLþäýÛýÛývýýúüêüþü.ý<ýGý†ýþÀþYÿÿ¶ÿG\XËÿ´ÿªÿÿyÿmÿeÿžÿëÿ/sª¬µ9.ðÑÔ̺à Kx‚j;ÿ Ùw™‘£ÎÞÚ¼Ê/vë@€³P|öi„r~´"„hE4Û'­=¶Ü{ÄvOH%3µ‡m¿ÿ·ÿVÿÆþmþOþ<þ]þªþ»þ–þ¦þ‰þþµý³ýƒýXý*ýéüÌüÍüÛüÏüØüýÆý—þ@ÿ‘ÿ³ÿÛÿÒÿßÿ ÂÿPÿÿèþþ|þÙþjÿ±ÿ³ÿýÿSP%sš€RAÍÿ…ÿ±ÿ'[SDðÿËÿ#u„³ð¿È :Kd𲕵Ðý›MP/eœ»÷lÌ*?"ËD}¦$È‹B,%ÂSôÿ©ÿ›ÿ€ÿRÿ-ÿ'ÿîþ¨þeþ0þÊýBý8ýiý|ýýòýåýtý*ýýâü¦üiü^üRü,ü*üzü ý„ý¸ýþYþ-þÿýCþáþ#ÿùþâþÚþÊþ§þyþRþ#þeþÅþÿÿ0ÿqÿ‘ÿ˜ÿ©ÿ¹ÿ†ÿgÿ#ÿäþÓþíþÿRÿVÿhÿ|ÿ…ÿ}ÿ‹ÿËÿôÿöÿìÿO9 O°«X]¤õ1Ix¾÷%ijtªB©]Àýñ¦$ÃSö_£©-¬ÿ ÿrÿ1ÿCÿ9ÿÿþúþèþþnþ•þþcýý ü–üàüý+ýý‹ülüü¬üßüýrüäû”û9ûHûmûnû™ûünü¨ü ý^ý ýÍýíýKþ€þ%þþþµýsývýGý5ý^ý€ýþkþÍþÿýþóþ®þdþ\þ.þ¬ýsýrý„ý¹ý1þ€þ€þ6þ`þ¯þ˜þ‡þÄþÞþãþ÷þÿ ÿôþöþ4ÿ®ÿÞÿÊÿèÿ 3ªµÅ&`M`÷v ˜ÏÑÏãÏsÓ"ÎFÿ<ÿIÿÿ ÿQÿTÿ ÿ<ÿ@ÿ¢þþÃýý™ý”ýDýýøüéüïüöüýü0ýcý=ýýóü¼üjüòûªûµû·û™ûðûsüÇüýEý­ýêýüýWþÙþÚþœþ®þªþ2þþ+þHþEþJþ±þùþ ÿFÿŒÿ°ÿ¨ÿtÿ8ÿüþÌþþ+þþ$þ6þþaþ´þúþUÿÿaÿÿÿNÿbÿsÿ¸ÿÝÿóÿÚÿåÿah¨~Ô>îä3uë©&x?!Ó' Q¹yc’zñÿ¥ÿ˜ÿÇÿ P0ËÿXÿýþ†þþúý,þ8þ*þ)þ;þƒþÓþÏþuþWþ)þ—ýwýŽýýÉüêüâü¨ü ýQý~ýþÇþÿÿ:ÿXÿiÿ‡ÿšÿ[ÿùþåþ2ÿ}ÿ{ÿœÿ`O€§V(<3¢ÿiÿÿÍþÄþÿÐÿÆÿ~ÿ¸ÿ#.Êÿõÿ>h¤ý/ÉÅe¨÷àv€5pÓçRÄ÷³IV˜µC§…`¿+x¢;/áÍ/vT$ú½©¸w%¯ÿ]ÿ@ÿ ÿóþ%ÿ^ÿ7ÿÿ&ÿÿÿJÿ ÿ£þjþþhþþþ#þþMþáþÿÜÿæÿs»÷áÅŵppž¡ÌÒ¯›ÓO¥¢Z ‡·ÿIÿÿþñþmÿþÿMPo¨Öãã¹áB=0~¯åéBXmC'iš¼JõLzß\±`BŒ·]‚6ì¡qSEVM‡xö›¦løÿÅÿÿyÿHÿ/ÿGÿEÿeÿµÿ¦ÿ¡ÿ»ÿ£ÿ<ÿîþÅþ˜þ[þ'þþþ"þ@þ4þŽþöþÿ%ÿDÿ‰ÿ¶ÿÍÿ6i)g‹wd^T]©ê;â5oÿåþ¢þœþ½þºþ³þÿqÿ˜ÿ¹ÿõÿLCH`ôÿÄÿ2,`©¿·›¥—ÍÐ|2\žr—¾*Øf³ûtè4¢ Ò%Àe(Öj]oC:r2«ÿrÿ=ÿìþ¦þ~þTþŠþ“þsþ•þÿÿÇþ’þcþþýòýþôýÀý»ý¼ýýSý3ýŒý þGþXþ˜þÿJÿÿÝþ ÿ'ÿ~ÿÉÿêÿÝÿ´ÿnÿ¬ÿàÿÑÿ÷ÿçÿÍÿ³ÿ{ÿÿœþgþQþqþ~þmþ1þþZþËþ8ÿoÿŸÿ¦ÿoÿWÿGÿ,ÿ;ÿÿÄÿ8N7Sj^-'‚ާµàé®çi¹® 75phU%¹QÈKÃJõÿùÿÍÿ¸ÿÀÿ¨ÿ•ÿPÿüþßþÅþ`þAþgþQþøýãýàý©ý~ýÛý7þJþ!þÇý¡ýhý'ýý+ý7ý ýÍü¼üÁüËüþü>ýlýŽýÍýþ,þhþ­þŽþUþ@þ…þòþÿÿÿÿôþ§þŽþÐþ×þiþ÷ý–ý7ý#ý*ý2ý ýÙüÑü%ýzýÔý?þcþKþ8þþþþýþPþ½þÂþ½þÜþÉþ¬þÃþûþ$ÿÿ?ÿ™ÿ”ÿ‹ÿÂÿòÿ-Z|ç"^—éL^6Î^æhvÿ(ÿÿúþÿEÿ(ÿèþµþMþòýþ,þþ÷ýêýþþðýýeý¤ýøýòýüý þîýÎýhýý7ý&ýùüðü5ýLýýãü(ýsý‹ýýý‡þ˜þjþ¨þÐþéþñþÿ`ÿ‡ÿUÿ;ÿ9ÿOÿ+ÿâþñþ ÿ•þ!þõýÙýØý«ý¡ýÑýÖýùý þãýþFþrþ¦þÜþîþóþÿEÿgÿ8ÿ)ÿ[ÿuÿÿ¬ÿÆÿêÿðÿíÿÇÿœÿ•ÿqÿTÿ·ÿP²^ì^«Á$îÊãÐu jÕ:°P-;'ñÿ†ÿ•ÿ ÿ©ÿÇÿ¼ÿ]ÿÿXÿxÿhÿ'ÿÏþÃþ¹þÂþyþHþpþ›þÊþ$ÿaÿ@ÿ²þ+þâý®ýÀýéýþ þáýèý.þ”þÎþÿ'ÿYÿ´ÿ0‰ŸfiXÙÿèÿÞÿÏÿÃÿ•ÿÿ}ÿJÿ$ÿ×þ¯þ¨þeþþþŒþÒþàþÿFÿ[ÿ@ÿPÿˆÿÄÿ ýÿQkx€¾¸xK(FOTŸ¾§þƒÖÛî?“;¶ |¨yg>­[ÿg½w_; ã½î¾spˆ‡’‰H³ÿmÿÿ§ÿ—ÿ}ÿÚÿ3¼ÿ|ÿƒÿ²ÿÞÿ2ZëÿCÿÚþµþ þ¾þìþNÿxÿVÿ‘ÿ9Ø4iFQhLF3ì’5àÿœÿsÿ‹ÿžÿÿfÿoÿrÿŠÿ¨ÿ¾ÿÏÿpÎÑ©²ÃÉãïE‰t'=>ØÕ\ÑϽ2Cz’“ï€È)•â1c9Ú}óuèp6î¯SÿÇ¡Ñ ë)–YçÑ­}”®¦O ÖÿÖÿC(Ôÿ«ÿyÿ-ÿ-ÿiÿNÿùþ ÿ+ÿÿHÿ¼ÿBÁÙÁ×ï7Œ£ƒøçmìÿèÿýÿùÿÃÿ¼ÿ×ÿžÿÿÞþÜþïþãþÞþNÿÅÿÏÿ¼ÿñÿýÿÇÿ»ÿfB2D]jnƒ—c!àÿÓÿ0–ÓÍ9>dƒÙP?I ®ÛSMšÏ9! °nˆ/»¤Œk°ÿŒÿÝÿJ4Üÿ‘ÿ4ÿÿÿ ÿ”ÿÛÿÄÿÿ2ÿLÿKÿéþ´þzþþØýðýþMþ…þ¿þóþÿSÿwÿëÿ˜zxnF'öÿÅÿ®ÿÿ ÿæþ3ÿÿ³þ³þÜþ•þaþ}þuþþ‚ýUý ýþxþ¯þÿ_ÿeÿ+ÿÿ`ÿ‚ÿ£ÿ°ÿµÿ¬ÿ7ÿ ÿCÿwÿ©ÿ³ÿyÿaÿÿÈÿ .¥ ,!žô1Ù 2Nmqðn]&°c)Ê$”ÿªÿßÿ$*ûÿ¥ÿÿlÿlÿ|ÿ0ÿÿLÿ)ÿ¨þXþKþmþ¶þ$ÿfÿ]ÿóþ­þƒþqþmþbþþÀýyýJý/ýüü^ý'þ—þ«þÍþÿÿ¶ÿ£ÿÕÿ ¹ÿ7ÿýþÇþNþíýÛýÙýÞýþ6þþüýÏý§ý•ýwý4ýêü«üƒüÎüfý¤ýªýÇýéý þDþ‘þÝþÄþ‡þ>þ'þþ-þeþºþÒþŽþ þþ+þYþ©þÿnÿŠÿÁÿÆÿëÿg›íO°ÛÖJNpP¸iC¡ÿŽÿ‚ÿÿÏþ®þ’þ˜þÒþÿ@ÿfÿaÿIÿÿâþÐþŒþPþRþ?þ þ<þMþ|þËþÊþŽþƒþeþþþþýêýÃýuýý-ýýoý”ýþuþ¼þ ÿ ÿÃÿÀÿÃÿêÿàÿ’ÿ8ÿ¯þ@þ þþþþ7þ<þþþöý¹ý¤ý­ý˜ýcý ýý3ýrý³ýþUþ ÿHÿÕþ¿þËþÞþÿÿ<ÿtÿ)ÿÚþÁþÕþÌþ‘þ£þÿÿºÿ¬ÿ|ÿžÿåÿLžß0LfŸ¦Ø6¼ûå£~IÛkK Š Äÿ¼ÿåÿûÿëÿþÿÍÿÍÿÝÿÊÿÄÿ¤ÿtÿzÿ®ÿÃÿ˜ÿZÿKÿ`ÿjÿ}ÿžÿ–ÿBÿ7ÿÿˆþ'þìýþ&þNþxþÎþÿ[ÿóÿio€¨°œ~^CÏÿ6ÿ×þÍþÝþÝþØþÙþöþÛþþŽþªþ¦þ~þVþhþ‰þ_þVþ–þ´þ³þßþSÿÉÿ Åÿ´ÿ½ÿ¦ÿCÿÙþÛþSÿ÷ÿ+Ñÿ™ÿ™ÿ¾ÿ’ \š“©ª‹³Ï5uïEˆ¦Æ±`Eúeð2Ö‚oc|éDZBïÒÀKFgP:96zySX_Óÿÿ·ÿŸÿfÿYÿ`ÿnÿpÿ†ÿ¯ÿ…­çA;F±ƒé]»ÿ„ÿŸÿæÿÿÿ#ðÿ£ÿrÿcÿaÿVÿ?ÿ*ÿ%ÿ&ÿ^ÿu«ÌÊíæ¹ž“ …-<zñ>RƒtJ¶ø/‹¦³å$hö?t¯ˆjR{cÄ;"‡ Q~Î@ñ—q'Bzº ñ§¥±)g^lÌûÇ|åÿåÿ¨ÿp”ã\­Ûµ[U…&€".1b'¸ÿ¯ÿâÿ¢ÿwÿœÿ‚ÿÿÛþíþøþæþ(ÿáÿD M\;1/Þÿgÿ[ÿÑÿ,pnH]y©¦¨åóüFeŽýÛ&gzØiŒ²ÝëIgskBÅ©= #æÐ!› 7A0àòi}d]:¡ÿÿ¡ÿ¤ÿ­ÿ»ÿtÿàþÿþ–ÿœÿ¨ÿCï´h†óÿüÿÌÿ±ÿÿqÿ`ÿ&ÿÿ…ÿ‡ÿ5ÿ`ÿÿ2þUþýþ‡þ/þWþXþþëýÕý þ¬þÚþþþWÿ^ÿ7ÿ3ÿcÿ@ÿ)ÿ3ÿÿ ÿÿçþ ÿQÿHÿQÿÿ‘ÿ¦ÿ/EaZõCÝæï\ðh¢f,¤ç¸m•s^Áº9Îÿ™ÿöÿjS#B'>$$Ûÿ¯ÿ#ƒÿMÿtÿxÿ^ÿŽÿrÿ6ÿÿ…þ&þPþƒþþ<þÍþÝþÿƒÿÿÿºÿÅÿ³ÿ|ÿ€ÿCÿÝþãþâþ€þÉýpý¹ý!þþÆý(þgþ%þåý‹ýRýuý'ý@ýjýfýèýCþÍýýºýþRþ@þEþ(þ¹ý»ýüý¹ý“ý×ý)þcþqþmþ6þþúþìþÑþÿþ ÿÿ[ÿÿÿåÿéÿâÿ7D[‚ö¨ð±Cùs"ûÿÏÿÎÿyÿ,ÿõþôþ]ÿÿ:ÿ1ÿLÿæþ ÿfÿsÿ`ÿÿ}ÿ6ÿýþ-ÿ4ÿÑþÿSÿÿ¯þxþSþDþ*þ þEþRþþþþþìýÀýÛý€þ9ÿ*ÿÝþ þ7þ.þþ.þ þœþçþ·þ[þþ‚ýcýÐý—ýˆýþßýoýãýõýwýSýZýýÿü7ýNýpýþþþþsþéý©ý6þlþþäý6þZþZþhþvþ£þÆþÝþÿþÿGÿ~ÿ/ÿ€ÿ$N O]ɸ䏿$gµXBVÞ©ÈŠeáÿçÿüÿRSm±¨6îÿâÿhÿOÿ«ÿÂÿÞÿ§ÿóþ÷þ=ÿUÿyÿ¶ÿvÿºþ‘þïþõþìþ ÿAÿ¿ÿïÿ–ÿ‡ÿsÿPÿšÿ‘ÿOÿ~ÿ¹ÿ\ÿ<ÿ$ÿÆþ„þ6þOþ²þ¶þžþØþÿ±þ:þ"þïý þKþùýCþTþ2þžþÅþ´þ4ÿhÿYÿ‘ÿ@ÿËþÌþÝþÄþçþÿ;ÿÿ.ÿeÿhÿRÿ{ÿ¼ÿéÿZSôÿ2•¢qO¶17Å6G¹¯ø‚¹OÀw á Ó!€œF•xvi(ôÎ F Þ 3ž9ej^YèÂ_ öÿºÿÿ"s-%Âÿúÿ+'Jz|ºîA‹ÿÕÿçÿ ÿ”ÿÊÿ†ÿSÿzÿbÿÿ&ÿ~ÿÌÿÓÿÅÿ±ÿÿzÿŸÿ²ÿ†ÿ¹ÿÔÿµÿâÿ²ÿ(ÿ&ÿ‚ÿuÿdÿùÿ–º·èÖjZñKAôòLwVJwÅ]bt¯‡£Áîç¾hFY‹©»þî|]áþT\²Ð.êk DDÁ³*IHèƒÝߘ|‰’ƒ’ÅÙ·ŒGêÿ k å¦ÜÿÕÿ™ÿžÿ¯ÿ½ÿ"—ÿ]ÿPÿ>ÿiÿqÿKÿvÿuÿXÿ¼ÿüÿûÿOhH×ÿØÿ/D¢Ã5ëÿ÷ÿ"Äô°€ð8<<D•ÄáìƒçÌå,w¡ŽvlHÔ~?Ê·ØW GQ\ßâ‚n1 84ÜոÂþ¶~Ĺ|xs5Çÿ]ÿvÿ¼ÿ·ÿ¿ÿ²ÿwÿ˜ÿçÿêÿßÿàÿ®ÿOÿJÿÿXÿ#ÿ1ÿÿÉþ¥þƒþ^þþÑþÖþôþéþ·þÜþ–þGþvþšþØþ¯þþºý÷ýˆþÛþ¹þÊþÿùþŽþyþ‘þ²þòþ!ÿ}ÿ§ÿEÿîþñþ0ÿ–ÿÍÿ¤ÿpÿ_ÿ+ÿÿÁÿ=¥ìžœÆaóô"CúA*UŽCJTówq¤ŠœÕ¶nFxF5Ìÿ¶ÿ–ÿÆÿ'YÀÿõþYÿÏÿ”ÿºÿìÿ_ÿéþËþ™þÔþúþœþ¥þUÿˆÿHÿÿ6ÿTÿUÿbÿNÿèþ¦þˆþ;þ÷ýþýþÙýþ1þ þéýþ#þÚý¯ýrý€ýªý²ýþðýýýöý'þ>þþþ&þþþZþ†þªþÔþ§þmþ|þsþSþþ×þŒþoþ»þ,ÿ‹ÿÄÿÐÿúÿ÷ÿðÿ?ón©|R\Ib^ ŽvQÕÿêÿèÿôÿV;úÿ %Ûÿ§ÿÐÿáÿ}ÿóþ¾þñþÐþÁþÿZÿ¼ÿŸÿÿ:ÿ@ÿÿ,ÿÿUþÐýËýéýýýøýÖý?þŸþ^þþGþ®þìþ¦þmþ^þ+þøý”ýPý-ý;ýBýgý·ýÖýøýjþsþàý}ýýýWýEýõüÉü&ýžýžýdýˆý¦ýÀýþþ—þcþ£þâþòþèþ‹þGþŒþšþgþdþ\þlþ°þþþ@ÿZÿ ÿïÿàÿÒÿ.z—Ò:v…×üé*™c›éÏ}Z./™Å©Þ±8e` zŠ3§ÿÿ(%tÿNÿ©ÿØÿýÿQw&ÞÿÖÿÌÿ©ÿÿ¿þÐþÁþfþþþcþ¤þËþæþ ÿlÿ‚ÿ+ÿÿóþáþÿÌþLþþ/þxþÓþ·þdþ:þ,þ0þmþ³þZþúýþýÜý™ýçý?þ<þAþYþ[þˆþ›þ›þ²þÀþÿÝþŠþÿrÿhÿÿ–ÿJÿþþ;ÿrÿUÿ]ÿ¦ÿ7ŸúT ÅÚÖ›ðà+Èí¬à÷Y঄°ƒ&C©VØ Šº¢ˆ+߯óæµ18¸´zÄm™æuÀÎVðÿïÿ2ÿßþûþÁþ‰þÎþCÿˆÿ–ÿ¤ÿ÷ÿD'ýÿ³ÿmÿaÿcÿwÿˆÿ‹ÿ/ÿÜþDÿ—ÿsÿsÿŒÿ[ÿ1ÿéþaþmþÓþÈþéþçþãþÇþÈþ^ÿâÿÄÿÅÿ¯ÿÃÿÖÿ†ÿ™ÿWo 6zd;˜„_kn¸=¤ññ•W p ¢É‘üéúìðîà g^m…|E–](<Ÿh[©þË®èƒÛ^Þ°0ȪuNC|‚!uÛâ°ÑʰձTth9sF’ÿ€ÿÞÿåÿâÿ÷ÿåÿ_ÿìþýþÿ!ÿÿ"ÿVÿ{ÿTÿYÿsÿhÿ±ÿ's¸îÕ‘=ãÿ¬ÿ´ÿ‚rX{£|)ˆ8¨wh¹|_ ˜Ðm›zVhQòtæú÷Ø„å3ð~o–š«Ì­>û)9&m¦^R Œ¤£\~t¾ÿÿéþºþŸþüþŒÿöÿ*úÿžÿoÿÿÿ©ÿÔÿÀÿªÿ@ÿÿ'ÿnÿ‚ÿ}ÿ(ÿÐþ—þsþ¡þÿ#ÿãþ¤þaþEþ,þ þ1þ—þWþ0þ]þ’þ¿þÿ=ÿTÿ*ÿÿ/ÿqÿ•ÿ×ÿ°ÿkÿ_ÿ_ÿ¦ÿÇÿ½ÿÃÿÔÿÞÿÊÿèÿ1{„—íf” ˜­º„»ïÞ˜0Â~Lé÷ëF:/ø”ÌÞî &° Ýÿxéô±¤KëÿÁÿñÿâÿxÿÿþ:þPþŽþÇþfÿÄÿuÿ%ÿKÿ&ÿËþïþSÿNÿ½þfþÂþ¸þBþþKþ‰þ¼þÕþÂþÍþŒþ1þ-þ1þàý­ýƒýký\ývý÷ýLþ8þVþcþ\þ…þzþsþ[þGþ{þ–þŠþŠþiþIþ®þ,ÿ6ÿíþ½þ þ®þøþ.ÿÿÿÿÿÿ<ÿ³ÿ{Vc½”ÅšhAÿ²I)`TÙÿËÿÀÿáÿôÿ×ÿÌÿ·ÿÿ«ÿÿ+ÿÿýÿåÿÙÿæÿÀÿ‰ÿ{ÿšÿšÿKÿÒþþCþþµýý›ýªýÉý¶ýýý«ýþžþ²þgþUþ;þÐý‹ýµýÛýåýþäýãýÐý§ý‘ýƒýšý†ýhý9ý.ýsý€ý>ýàü˜üoü²ü>ý§ý þþèýºý’ýŒýÑýþEþƒþ_þøýúý,þþ þ{þ´þèþ ÿÖþšþ‹þÂþÿ[ÿ\ÿUÿ¶ÿ?ÈGF"R¿þ&Ýfå^4‹ùÓ|bØÜÌÜÆÿÌÿÍÿËÿ+­­i78PØÿ¼ÿ‡ÿ{ÿUÿÓþŠþ¡þwþþþtþ£þQþ5þwþkþ[þxþÂþ"ÿcÿ4ÿÿÿïþXþãý<þbþþ%þ€þPþÒýÑýøý6þþ‰þ7þåý£ý>ý`ý×ý þ2þ†þ’þfþ;þrþåþÿaÿ®ÿÿÿ¬þ‰þuþ‡þÿ©ÿãÿjÿôþüþmÿÃÿöÿÕÿÀÿ!‘Âø'e¥‚^~$\òŒZ_W5³vhD[Ÿx0+æ @\þÖ>7óè/-1\ˆv'¥)Ïÿwÿ2ÿÿÿ ÿ÷þçþÿJÿgÿÈÿúÿÊÿŠÿ“ÿÚÿçÿ·ÿ¡ÿqÿÿKÿ»ÿ«ÿwÿmÿ@ÿRÿ]ÿ;ÿ?ÿEÿèþªþ×þøþŸþiþ£þËþËþøþ3ÿ2ÿ\ÿ…ÿ„ÿ²ÿýÿ×ÿÓÿ÷ÿhäçÀ»5½ÿL`•ÊÓÿp™ÌC|¤³j§ïÒ©¡ÇÍŠãy\0XsDn¨º­ªŠ¤±wI<RD!®r–ÞM.¢ÙßýÈqZJ+Ôÿÿ¾ÿæÿEo:>›wRI€Â€!Æÿÿbÿ‰ÿ¿ÿÆÿ‡ÿŸÿ²ÿœÿsÿHÿ`ÿÀÿU}’ÿlÿòÿL'ÿÿûÿiÝðÈ—4 G@T²òQ–’ÇQ«­ª¶ä)An¤u’q êx)3:'ëÏÛªtOOÀþßã+$ú4¦~Rëÿ§ÿZÿwÿ ÿœÿvÿcÿLÿ8ÿgÿƒÿ‰ÿ|ÿvÿ‘ÿ•ÿoÿ‚ÿƒÿÿƒÿpÿqÿUÿ0ÿûþàþêþüþ¯þxþ—þ®þþþžþ—þ”þ‘þžþµþÎþíþ8ÿwÿeÿ3ÿ÷þÿcÿeÿ#ÿ>ÿDÿ…ÿ¼ÿÿ‘ÿŒÿIÿiÿÈÿÔÿ½ÿÊÿZJ+gµ#O1uÅȆ›É Ôj7Ñœi^T2&øó0*èØîéq ª¢Œ% ÿ_ÿ\ÿ]ÿcÿAÿÍþ•þ–þ¦þ¶þÏþÒþ¸þÕþôþúþöþôþÿÞþóþ)ÿxÿ|ÿ^ÿ9ÿ÷þ¯þuþnþyþYþ(þAþGþ>þ þþþùýÝýþ-þ8þ"þþ)þŒþØþ´þŒþuþ„þ¤þ¤þ·þËþ¢þWþMþzþÂþÔþèþBÿoÿFÿOÿXÿZÿxÿ‰ÿ¿ÿ#I,”ù-¥ ûàÛéÒÆÉ£ SêÿWkG$)g|CR_@ßÿÅÿÌÿ¯ÿaÿ7ÿ<ÿ(ÿàþÕþÙþ–þRþ+þæýÔýÔýþ þÁýýƒý£ýØýâýÇýsýLý~ýàý!þIþlþOþâýý•ý¥ýŠý‡ý±ý©ý+ýÝüýIý•ý¬ý#ýÏüÁüÓüìü-ýyýý”ýÍý¿ýaýZý»ýþýþþþ2þ(þÇýdýfý¥ý#þœþþ1þ&þ2þ/þ6þ€þíþ]ÿ©ÿàÿ HzƒÇ`mv¯˜WUw^-ýÓ|ÜÿI´¶¬¾¦†g=Qk67TÕÿ¯ÿ}ÿWÿ*ÿÿÿúþ ÿÿþÿÝþÖþªþWþ þþ(þOþqþ<þ3þ@þGþ|þÂþÀþÐþôþÜþÁþ™þtþvþfþQþ;þ)þ3þ þãý,þžþMþµý«ýØýÚýÂýÕýßýÔýÖý"þ•þÓþµþnþþŽþrþUþ”þÿþ/ÿ2ÿÿÿ9ÿ\ÿYÿiÿ`ÿ@ÿÿêþÿkÿóÿ‚¹Ç§¨,›ÌþCoz‡ÅÿËnátitvšªX"=uSo¡¿±iE»§ÅÞ²"™ÿžÿêÿ(*.úÿ¸ÿcÿ0ÿÿ¿þÚþÿÿÿÿRÿ‰ÿ£ÿ|ÿ´ÿÖÿºÿÑÿ–ÿ ÿ<ÿ+ÿÔþÚþïþÿIÿ ÿ±þçþÆþtþËþ(ÿèþæþáþwþºþØþ£þXÿõÿÕÿ#™ÿcÿ^ÿ[ÿ¡ÿÐÿkÿÿœÿÿäÿÒÿ›H-”SŒOO‘Œ¥ñˆ ]§æ•“r..{ˆþ˜¢Å°Žz'ñ D`žÒ\ͯÞÚ«|YvZ?;ð•É4óŠs6&BtR:<}°±ÅÕÝÚNïÿ¾ÿÎÿÚÿÍÿ§ÿmÿ·ÿJÑÿÑÿ§ÿhÿ•ÿÆÿËÿéÿäÿÛÿÂÿ§ÿ½ÿîÿçÿ(ˆg>BG‰ÄHbNGÇ»­…œ«‚ˆŠäFP‚hsƒ­ü&ë™J"ôãšH '3>[dv ḋt.9i;Ï‹2Lq!¤ÿmÿŽÿŸÿfÿpÿ²ÿŒÿVÿ]ÿ¡ÿªÿŸÿˆÿ‰ÿòÿñÿªÿ ÿ„ÿBÿ/ÿ>ÿöþªþèþ2ÿ/ÿ ÿðþçþíþøþÿdÿ4ÿÛþºþšþþbþiþÆþ+ÿ4ÿ5ÿ0ÿWÿKÿÿ`ÿ âÿpÿLÿÿöþCÿ‰ÿ£ÿ¶ÿÕÿóÿ!=R’û=d],nNYB”Á‘–¢ƒ\<ÿÑ´œƒ‘‘Y,u¦d9ÙŸµÂɤÔÿhÿ¾ÿ5(ãÿvÿGÿ5ÿãþéþDÿ.ÿÂþ¡þ…þ™þµþºþ—þ£þòþÿõþñþÿ<ÿÿÀþ‡þ`þXþMþIþ‚þ¤þ›þŸþþJþþýþjþþ‹þQþ/þVþ€þlþ(þþBþ}þÀþüþïþ¾þ¾þºþ–þ¥þïþÿÿZÿoÿVÿ`ÿtÿ­ÿÔÿŸÿeÿ£ÿËÿëÿæÿÀÿøÿa¸ÐæZƒ´ÆßA4ñÓf+Å›–þñ‰¡MP´©8âÿºÿÿ‡ÿCÿÿ<ÿ1ÿÁþ³þ!ÿ0ÿ3ÿÿ£þGþóýÂý¾ýÔýÈýèýîýáýïýÄýgýrýåýâýÄýþZþXþnþrþ'þgýúü(ýaýRý?ýgýxýˆýgýEý[ý‰ý|ý‹ýŠýýêü<ý^ý7ý1ý^ýŠýåýþÉýfýtý—ý§ý•ýˆýÇýûýOþƒþŽþpþpþvþ|þ³þÞþÿ6ÿ7ÿ"ÿÿÿQÿçÿn¨ãôÕò~Ó–`*Έh—̺\/^dc¦Ý¨jáÿ üÿÇÿ³ÿÆÿ¢ÿcÿ7ÿ,ÿ)ÿøþÿ.ÿèþ¥þ»þ›þ´þ£þ[þVþPþJþGþYþ)þÆýÀý%þŠþ¬þ¿þëþ´þ@þXþqþBþLþpþ<þ×ýžý·ýûý(þ#þþþäýÒýÙýþBþSþþþý9þýýÌýÝý×ýöýXþ‰þµþóþÿ¥þ^þvþ þ»þÿFÿÿÿâþÂþÿkÿ©ÿùÿÂÿ¹ÿ*|}ƒ©ßQ§ÜÞÛà-K_­„ l†Èt,LPSSdOý¾Ï¸ƒ›±‚0ùÿ B;;/ñÿ™ÿÿ¸ÿÙÿÿWÿÿ°þyþ²þôþúþÿGÿ€ÿ†ÿƒÿDÿ ÿüþ)ÿŠÿŸÿJÿ.ÿ'ÿàþ±þîþÿõþÆþ™þ˜þÖþÿþÿ5ÿ6ÿÿóþÎþ¾þèþÿÿâþ×þ,ÿGÿÿ&ÿhÿrÿVÿ[ÿeÿcÿ¬ÿôÿÑÿàÿ?|‡ˆoGzí?,ÇÌ&KB—u˜žãùÄï ü!ͦ‹^Ec~º˜< жÌÂS?òòÿ*#êÍ—TWC"Rx0Íÿ¨ÿ¨ÿÂÿ<‰‘xDáÿÁÿ []TƒLîÿËÿúÿ íÿìÿ³ÿÊÿþÿ øÿèÿóÿ“ÿXÿ°ÿ æÿËÿâÿ -" ÿÿK_<jè-cn@-G;`ÍùTiaY}–ÉU°ÁÈÇÝ»k`p[ú¥jŽó ÖOF, Õy¯²•p6è´’u‚¤—ƒ‹aäÿ½ÿKJ36úÿÕÿòÿ1þÿÊÿ¼ÿŒÿ„ÿ§ÿÀÿ‡ÿ\ÿ}ÿÿeÿKÿCÿnÿtÿsÿpÿ<ÿîþ ÿgÿ¢ÿrÿÿÕþ˜þ®þÿÿÿAÿÿþ&ÿdÿ‰ÿ±ÿžÿ{ÿ¡ÿËÿåÿãÿîÿîÿ¸ÿÇÿvÑKb&24CP~¿?i“»úáv<*$R0é‰w¢šWUi#ÉÁаŽ_éÿÕÿ}~A$ÝÿÿKÿJÿ9ÿÿÿ8ÿ/ÿ4ÿAÿ7ÿÙþžþ‚þ’þòþZÿdÿ\ÿHÿÿØþ´þØþ!ÿ(ÿÞþ´þÅþÞþÎþÉþÿPÿøþ‡þyþcþ7þnþ‡þXþ;þ9þ}þþ‘þŸþþ«þÚþèþïþùþÿÿcÿ”ÿ ÿ‰ÿ¯ÿÚÿšÿ\ÿ>ÿ8ÿ-ÿdÿÀÿ0ž¶­Ÿ’ŸÇ úÿiØ]dñÏã┳náÁ¾žµ¶3ØÿÜÿ\WöÿÿQÿŸÿ³ÿ“ÿ¢ÿÿ½þÕþØþàþÖþôþìþþþçýóýþ-þ8þ+þâýŸýšýÕýÚýõý,þ=þ+þþžýNý–ýúýüýàýŒýwý€ýSýRý}ý™ý²ýÚýçýÁý{ý3ýýýýý'ýdýSýjý¡ý¶ýßýøýþþ`þwþLþIþEþRþSþpþ|þrþJþOþ_þˆþºþÿ,ÿMÿÿ—ÿÏÿ1B:rvf€œÂàáßèΤt[”¼|X7Q ØÿÿŽÿÕÿÓÿ—ÿ.ÿ:ÿTÿKÿ`ÿyÿIÿÿÑþÔþëþÑþmþwþÓþ¹þpþ_þJþ‚þþõýý˜ýÂýãýÆý·ýþþÊýÚý2þcþlþIþSþ4þþþvþ…þ#þ þþçýèýþþðýþþþþþ×ýïý þöýþ!þúýåýâýþvþËþÝþ~þZþËþáþÿtÿ‹ÿ‘ÿdÿHÿ_ÿWÿKÿ®ÿB”X^‰<îÿC“Ãï  æ²´KdazJߘ°œQ÷m…»Ð̦^>4QX@ÿÿÿÿØÿÿ^ÿRÿrÿÞÿÀÿ°ÿåÿGÿ2ÿxÿbÿ;ÿ ÿúþðþøþ4ÿPÿ0ÿÿæþÿ,ÿÿÿþ6ÿCÿMÿpÿGÿÿÿHÿIÿ0ÿÿìþºþ‡þ²þçþìþ¿þ“þžþ°þ·þµþÿGÿ/ÿÿIÿMÿ2ÿlÿ·ÿÜÿ!h@÷ÿÞÿÀÿØÿ&‚¯QU“IH‹©µv  9Eç£åë µÚ ö1Œß÷éÎN5jˆS$%1 ãI-õ¡rpŽŒˆ“X'%%æÿËÿÄÿÆÿÕÿøÿãÿÇÿÞÿèÿêÿHšF3áÿ¹ÿØÿùÿõÿÞÿØÿÝÿÃÿ·ÿ¬ÿ®ÿÙÿüÿËÿ ÿÓÿ4dbJ5cz_‚£Ðì³Äÿ 2Mt¡our¤Ðݹ‡—à*QŸÌȨ¦€R?[dã—Š†TèÀ÷饄¢“dÏê ðàãüû¿ºýÕuEôÿÿsÿuÿeÿaÿ­ÿôÿ'#ÛÿÑÿ äÿ âÿzÿ8ÿ?ÿQÿrÿ›ÿÒÿòÿ¦ÿqÿvÿÿ—ÿžÿcÿnÿ—ÿ°ÿ¸ÿ§ÿ¾ÿ÷ÿõÿ'zt`†¿¼A9lqtdbšä #H:ëÒEøâø „ª°§¼ÝâÆ¨š4À©¢yaF Φ–§êíåϯfíÿÏÿúÿÞÿ¾ÿÅÿG%Öÿ¯ÿ£ÿnÿÿµþÉþÛþªþ½þÉþÎþêþÜþèþIÿeÿCÿNÿ}ÿIÿñþÕþüþ'ÿ ÿÄþÎþÿEÿ ÿ»þÚþ/ÿÿ½þåþ«þIþ[þŠþ{þfþ‚þ¤þ¦þ•þ¬þýþ=ÿ–ÿÍÿÀÿ±ÿˆÿZÿ6ÿÿ|ÿâÿèÿüÿ/t[ðÿS®켺Œ§ð '3„þ ¼kfVÄ´­‹U\cBiÃïŸ%Æÿ†ÿÿzÿKÿ\ÿhÿÿÿmÿ†ÿ>ÿÿéþ³þŒþ¿þÿ1ÿêþcþùýý…ýíý§þøþªþ?þ3þþøýõýïýíýñýþ þåýìý»ýŽýªýÔý þþþ÷ý ýLý›ýôý¾ý©ýƒýzýŽý¬ý¡ýªý»ý˜ýîýþ°þ­þTþLþnþbþ§þÿMÿÿØþÛþæþÇþ‰þ¡þéþáþöþRÿtÿ‹ÿ®ÿºÿ±ÿ¢ÿºÿ(­ðô@<7×™AòÿÈÿžÿ†ÿ¨ÿ¼ÿ‚ÿ7ÿ#ÿ!ÿ?ÿFÿKÿKÿ^ÿOÿÿåþäþÝþÀþ£þbþ_þ®þ÷þ÷þºþzþtþˆþUþ5þþ¿ý–ýŒýƒý‰ý£ýyýmý“ýÌýþ]þxþZþhþ¯þ°þgþ(þ,þHþ1þîýÝýïýçýñý@þŠþ»þÅþþòý±ýÐýÞýÈýßý-þ'þ,þ|þ¢þíþ&ÿÿüþ:ÿ ÿ§ÿŠÿ›ÿ±ÿNÿûþGÿÂÿäÿäÿàÿîÿ3]vri̽›ðE©'5ùÔ¯Bßa<Cïÿ†¿£$ëÿêÿ >P-ÖÿÜÿÏÿ¢ÿÿ ÿ«ÿ¡ÿœÿ´ÿ€ÿ_ÿ?ÿ ÿ#ÿqÿ>ÿæþ¡þsþžþ¥þ¤þ×þÿ2ÿ"ÿÿÿ*ÿ6ÿQÿ“ÿ|ÿFÿ4ÿ ÿØþâþÿ ÿ-ÿ9ÿòþ°þ¼þÿsÿŽÿ?ÿöþÕþ¯þÁþþþVÿuÿ‹ÿØÿëÿ¦ÿ¹ÿØÿïÿ,50Fy›sºèù#>_¨ÜÔÅ"ªŸ·”j[WWƱ[õ%YK*þ 9éíÚ§ˆoŒhNSn’‘uaDÔÿÎÿÄÿ§ÿ²ÿ»ÿ’ÿ­ÿg} Ëÿïÿ'ED"îÿþÿÜÿíÿ+9üÿ¿ÿÞÿìÿæÿ#XX:òÿÖÿÔÿôÿQ‡c4W·ãIÐ Hl==Y Òùú7b:bŸºõ^‘aE{°…eνvNhÈëöÒ–‹Æ”^©Åh[z?ÿÿÿ½¤µ­Êüy%"Óÿ Ge1 +YPFs‡Nçÿôÿõÿ ðÿŒÿcÿ±ÿïÿôÿÐÿüÿEwiÎÿÖÿ2!èÿßÿÁÿðÿ)~ÅÆ²‘‰…¤ƒWÁ©æX—qZw”|Ð1RK” S(Ja/ýÎûãºð*¦š©”–é ð¼{%ÚÿÍÿÒÿ áÿµÿ¶ÿÖÿÿÿúÿÉÿoÿ=ÿCÿYÿKÿ(ÿ-ÿdÿwÿ)ÿÓþ˜þ¢þÿ?ÿoÿ¡ÿ’ÿOÿCÿ*ÿôþ¼þËþóþÿ'ÿÒþ˜þ¸þÏþÍþÛþêþÚþµþ©þ¾þ×þôþÿ.ÿTÿ”ÿÊÿ×ÿ|ÿ`ÿMÿbÿ¤ÿÍÿëÿ"%ýÿòÿøÿðÿüÿëÿñÿ*X£ý7/=hÈÞϨvôGZJèbS|‰KòÿêÿÄÿzÿÿ™ÿWÿ+ÿyÿ–ÿwÿ‡ÿ¨ÿ–ÿ#ÿèþ#ÿDÿÿÍþßþäþ½þ‘þŸþ©þŽþ_þ3þ<þZþOþtþÏþæþ¯þEþRþ‡þTþ3þZþoþEþ9þ(þþVþþZþ3þ'þúýþ þ÷ýÓýàýõýþý þþþ%þBþ^þcþƒþÔþÀþ¬þîþÿôþïþþþÿ%ÿûþÒþ÷þÿöþÿ3ÿ'ÿ&ÿZÿíÿJ<õÿ;n‹¶mI.!õÿÏÿ¿ÿÿnÿaÿDÿ÷þÿ:ÿ3ÿÿÿXÿÿ_ÿ/ÿ¼þ²þËþ¤þ‘þ¯þÀþ~þ…þ¯þªþ£þþeþaþPþ(þéýÁýØýøýþ%þ\þ8þúýÂý±ýÔýÔýôý%þ^þžþšþ<þüýúýþüý3þWþþÖý¶ýý°ýóýþ.þ<þþý”ýþœþ›þyþqþHþAþoþÒþ*ÿAÿWÿvÿjÿÿ®þÿqÿnÿfÿ^ÿkÿ–ÿxÿ'ÿCÿ”ÿÈÿ×ÿãÿèÿ¨ !ä¡e Õ‘±µmצ‡¿ÂSÍÿqÿ.ÿ}ÿ\mnDØÿuÿÀÿþÿÇÿ½ÿŠÿÿñþ ÿÿ,ÿ7ÿ8ÿuÿ“ÿ„ÿ9ÿ+ÿDÿÿùþÑþ’þËþÿâþËþêþÏþ¿þíþ>ÿ3ÿðþïþÿùþòþ÷þ#ÿEÿçþ¶þüþÿñþëþ"ÿ$ÿÿïþæþñþûþöþçþ>ÿiÿÿäþ.ÿnÿ|ÿ±ÿTrÿÿþÿîÿ!'Nݯß(c‚˜DùïI|Á0íØ¼„Ohˆ1Ì­±Ú¼—Æûæ<0íªjsˆp1pvåÿîÿ´ÿƒÿºÿúÿöÿ¦ÿ€ÿfÿVÿ’ÿAqöÿhÿRÿyÿ[ÿ7ÿwÿB4æÿÙÿC|JAa|lQÂÿ¼ÿ-gsW×ÿíÿ$fœ m?çØáÁýGSHG/†˜žžÄßø(Li`AU”žtWZa|Æ ô‘^^jV0÷È›”ɨq‰œv,6€©¨])Þµ½Çø ã¡dJm}eGWhÓÿÓÿ{¤n+8{›¥½«m ôÿøÿ+[i·ÿ²ÿ rk0ÞÿhR 9ˆ¨Žž«—‚…=ô±®B]U20å”—ô{¶ÆÚ¼M =œ÷í¹õý.hž—]–8#<5ê°o’âîMl"Ë¥ tLq]ßÿÿÃÿóÿLNüÿžÿyÿ¡ÿÇÿÀÿ¥ÿqÿCÿìþ½þÙþ4ÿ„ÿwÿ…ÿÿŒÿqÿÿÿ§ÿ³ÿ¼ÿ§ÿfÿ4ÿ?ÿ?ÿ<ÿ\ÿPÿÿÿ^ÿ‡ÿ„ÿƒÿ›ÿŽÿqÿ-ÿ>ÿmÿÐÿ+(¾ÿlÿÿÌÿëÿëÿ "ÿÿ ÿÿ!m‡†³Ìɯ°ÔC8Ljw›|e>%æ²ÎK|W Ñ£QÞÿ¤ÿèÿ;Y`1õÿøÿ|«^Êÿ‚ÿxÿƒÿ—ÿ­ÿ ÿÿUÿíþÁþîþÿ#ÿGÿxÿtÿ1ÿîþÈþþyþ¥þÔþ÷þÿEÿ7ÿ%ÿùþ–þŸþßþÿ ÿÔþÞþÝþ•þŠþÎþïþÿÁþÁþåþâþÍþÔþøþ·þAþýý þ<þ½þ:ÿAÿ+ÿWÿoÿ1ÿçþÙþÈþÀþýþ,ÿfÿÿ¢ÿ€ÿ4ÿÿÿ_ÿ¬ÿÙÿÃÿ…ÿ£ÿðÿæÿòÿßÿÕÿ·ÿ•ÿyÿvÿƒÿõÿ: Ùÿ#“‰^^>íÿ‘ÿ0ÿÿþéþ(ÿgÿ2ÿ/ÿdÿDÿÿÒþÕþ¹þ”þoþDþDþ{þ©þÑþþþÿžþBþAþþêýõýDþpþ@þ þþ þäý²ýÝýþáý»ýÙýßýþ?þQþXþ1þÞýîýMþTþJþHþIþòýÁý þrþ~þˆþdþÙý‘ýäýzþÂþÃþŒþ`þ'þOþµþ÷þèþ·þÌþÿÿÿÿÿëþñþÿPÿ|ÿ§ÿÌÿÕÿáÿ©ÿxÿÿ¯ÿÉÿïÿ.ñÿÝÿXei|ydÉÃŒ7Y…dAE)Ýÿœÿ®ÿ¢ÿ™ÿºÿÛÿòÿ#8 ËÿŸÿÿÿšÿ–ÿ]ÿ ÿÓþÝþÀþåþAÿ¢ÿzÿÿñþâþÝþÖþ¯þcþ!þ%þgþ™þ®þ¶þæþ ÿ'ÿ ÿ,ÿKÿNÿ\ÿpÿaÿÿ%ÿ;ÿ ÿþþ!ÿÿùþ"ÿUÿKÿ,ÿ9ÿXÿjÿ`ÿBÿEÿ<ÿIÿ=ÿQÿ[ÿ_ÿ]ÿ“ÿæÿÒÿÛÿ 6êÿÔÿckV\d™¸«ÄÐïÁG+0@y×üöêB“—•‡W('Mu5"¹tw™²¸ÞùÁY^l4 4h&Äÿåÿ6J(Øÿâÿ æÿ†ÿ=ÿJÿ•ÿ˜ÿJÿFÿ‹ÿÊÿçÿûÿïÿÌÿÐÿƒÿpÿÌÿúÿìÿýÿûÿ¹ÿ»ÿÿYÿnÿåÿ%TZ4+ëÿ#“›ƒžŠ}·Åâ.Ì‹Ë0‹»™fšÔÐïÉypwй˜¶ØiÍ/>ŠÐ°v+æÓàÈX<l¬ü{s™S/7 ³¿ò'J@’Fk¤¯åè†KHI-MmZ`“„W>H‡’u„F@Á”9#,vÌÑüûgŒ„rÿT'ðΖ°Æñ$*ôêêVj6<|¯—™½«n=+Wdkx•_:q¡ÊÝîöŇŒíÃrPòåìÑäøí﮺!¶¤n>kdßÿvl0=2úÿßÿÍÿÃÿ£ÿ·ÿéÿÛÿ¢ÿÄÿæÿ‚ÿ}ÿ¦ÿ§ÿÆÿÙÿÄÿµÿ´ÿ·ÿžÿ–ÿ˜ÿ«ÿw}qýÿ•ÿ›ÿÁÿƒÿpÿßÿüÿ–ÿqÿxÿTÿXÿ¹ÿZµ©C7d~T;eI96?^„«º‚Nj¥´¤¡¹¯‰½êÖñ+! %èʺ„Dµ»«Ó«ÎÿÛÿÆÿÌÿ $Öÿ¢ÿ–ÿ‚ÿ…ÿÿxÿ‚ÿsÿOÿMÿ…ÿªÿ«ÿÿTÿÿèþÜþÐþþrþåþÿ·þbþzþþŒþÅþÿ=ÿ)ÿ"ÿÿ8ÿNÿ=ÿEÿ=ÿøþˆþgþ·þÙþóþEÿ†ÿoÿ.ÿÿ3ÿjÿ]ÿŠÿ–ÿ@ÿ2ÿ-ÿÿÿ2ÿXÿ<ÿÿòþ)ÿ]ÿƒÿ…ÿ§ÿ÷ÿóÿÿ“ÿÕÿøÿèÿ/$èÿšÿ‡ÿ¹ÿ (îÿÏÿ|ÿJÿ²ÿúÿ õÿôÿàÿGÿCÿ‡ÿrÿgÿ[ÿ(ÿ ÿæþÕþSÿsÿLÿ3ÿ7ÿ.ÿÐþ“þŠþ¨þÓþúþèþ„þeþ¥þŽþ9þ+þþþýïýþýþÌý½ýÖýñýüýþþþ þÛýÞýþMþ›þÉþÂþyþþþýŽþ–þXþJþBþ5þ'þVþŒþHþ>þOþ2þ=þSþþÝþ£þWþLþ8þkþºþÖþçþîþéþ¼þ‡þ¢þíþ*ÿPÿVÿZÿZÿ5ÿEÿJÿHÿ9ÿFÿ7ÿBÿEÿAÿ`ÿ“ÿ‘ÿ·ÿÐÿ™ÿƒÿÿ‘ÿÃÿ:~T,  ùÿîÿÆÿŽÿ¡ÿæÿäÿ”ÿxÿfÿ@ÿÿ ÿQÿ…ÿzÿ–ÿ£ÿ2ÿÎþÍþÿ6ÿÿ!ÿ ÿýþþþ ÿÿúþåþÌþœþžþáþÿÿæþ¬þpþ:þ7þŽþÁþÅþ¬þÍþóþÊþ§þÒþ+ÿGÿ ÿÿbÿfÿ:ÿÿÿÿÿAÿ`ÿbÿqÿdÿTÿ?ÿGÿRÿ[ÿ7ÿ5ÿ[ÿƒÿÿ™ÿ»ÿÏÿßÿÿÿgnustep-gui-0.24.0/Sounds/Sosumi.wav0000664000076500007650000007405411240162532017221 0ustar brains99brains99RIFF$xWAVEfmt D¬ˆXdataxÿTÿeÿvÿ‹ÿ—ÿTÿZÿ”ÿÿÿmÿ]ÿWÿ—ÿrÿ!ÿ!ÿÿ ÿãþüþûþØþÁþÿ)ÿ ÿþþ ÿüþÿÿêþ¿þ¢þ–þ¬þåþÿ1ÿ1ÿëþ®þÐþÿìþõþðþ»þ…þgþ€þšþÙþÿ"ÿðþÑþËþ¦þ—þþªþÙþçþÖþËþ¼þÍþ¶þŸþ†þ}þºþ¸þ”þ¯þ¼þ›þ•þ–þþ¬þ©þ¦þàþ"ÿ>ÿ1ÿÿÕþÉþ»þ”þÃþìþÊþ¼þÜþÙþÎþ¨þ—þ¢þ°þžþŽþ}þ™þéþÿ ÿùþØþ×þÜþÛþßþØþ·þ€þdþgþ¬þ ÿ'ÿÿÿÿÿöþêþÿ3ÿRÿ‚ÿiÿéþ±þÿÿþþÿ ÿíþ¨þºþ ÿôþÈþMÿÌÿ½ÿŽÿ_ÿ8ÿÿèþôþiÿ¹ÿÁÿ[ÿÈþŠþ¼þ5ÿ¯ÿ ÿ~ÿHÿ.ÿ/ÿ8ÿgÿUÿXÿƒÿ]ÿAÿwÿÿ®ÿ§ÿƒÿjÿ\ÿnÿµÿ§ÿ}ÿ€ÿ¸ÿÿtÿuÿqÿÿ³ÿËÿ…ÿ9ÿEÿŒÿ³ÿ—ÿrÿ^ÿcÿ„ÿ¤ÿ›ÿÿÿQÿmÿ•ÿ_ÿ$ÿ7ÿ[ÿ¤ÿöÿ ËÿÊÿÓÿÁÿªÿÉÿ7Eãÿ¨ÿ¾ÿÀÿÝÿ 8Bêÿzÿ?ÿ(ÿJÿ™ÿñÿöÿªÿ—ÿæÿ5W> ýÿïÿ#>=èÿÿšÿ¯ÿÇÿáÿõÿ=A4D''çÿ¶ÿ½ÿ4BT&ìÿýÿ8…¦´¢d]žx9B->vwd9òÿA 3—ßŪ<pÿgÿÞJQ©‹g ÈôB5$ ^ Í- ¯ õxéOäÚè+óbþÀ ]ÌvœG ò ¤-oýö*ðeê}æÜåLéâðTú³n Û ¢ ÅÓ1 , ýóúñÞø‰â á)ü~þÔz­¶Ë JÛùðAí›ñøÉû.û¶ø ÷%öœ÷rÿr™o9ÿŸíãêVø ½s ŸóéëÙëxø¾ »œÅvú†ö$ü Ý!†@`ìNâèá éõôÎá„”üöèõOü]úRéàÿÆöâõJ÷¹øáûqÿ¬ÿ1þL€ à  HKƒËÔûpú”ûýîþ/þîùdøÿ”& Ž Ã jþ§õÕõ’ÿ˜ ¶ú÷¥îèïr÷Èÿ»x  ´½ÿé~‹cü!ø£÷fù>ùáôuðEô«+ˆ©ù°ô ü« ʓΠ¡“’†û)÷pü¹»„ü…ù¥ú;ý™ÞMý1öOö ÿ÷ÍCýhúÖû ýºú”ö§ô$øÇÌWrúùWûñB 9 Œ'ûEû…ýëüÎúû­ÿò?ØA«“d –0þ øcøÑý³˜ÿSûµùˆú†ûŒûFüΑz /ä?Þöý;ø—öÕüÝpñûAöù7 ¥ Õ‚úLó=÷‹ç —9ªþ½ø\÷Bû "8Üøõl÷C’ ´—ýü‹ôÝòOöIü[ù½¾£ýüHþYâ¶ÿËý5ü¦ü ±çô+ÿõ]’V.üÏõDóêõ(úþ­ä t ÷+ùµô ù=œ B*ûó¼ö—Ñîéÿ!ûkþÀ¢ÿÜöPõ†û :Œ-û¾÷™û#²þFús÷¢÷[ü‡º [ð-ìû÷G ¢ ó»ìNðGúý  mýeñÖì&òñüCÝxú:öÚ÷Ýý”KÂÿýþùýÌüÿôAMrøtïôîoö[© « v]üB÷ê÷Áâ  ›÷yìéð²üÂwÜÿó÷àôVùòQ8Çñû_øüù.þA …ýÿÞôzîÖïé÷woóüJýUj£²ÿþ.ÿM ý4ø­ôwòßððóðýù +Íþuûøú§ÿUÑ/÷tò#ö*ÿ„žåù¶î¯ëVô/ºëõ®DBBùû¹ùçøø ùyú1û úù¨ùèýB”X| 8û ý•nª IˆøÇîÈìAóVþT M @œý=WI È Æ e,ÿ;øföhø‡ül…æÿêøšö¯ÿ´vK ýýbùÉüDÿý¼öªîTë òPü¨þûøÊõ%úo"’5% Æ [rú€óñGò\õ€÷^ö$ôÍòÇñTñqóùùÁŽ¡•úÅ÷åùUþ¨þùÌðsêRëAò~û;@wIþ§ý¤’ Îr ÀÃøšðQîóô§ÿÝç'{ÿ=N ƒÚB8ý©ùÍû~ž ™ ß^ü÷öäúO…¦½§ç• £ Å ‚@ ¼ÿ¢öœó‘õMûõÝ n ™˜”LÁ·=ûŠöwòfïï#ñÞóö¼ö÷ùøqý)lµýùÑôõ™øGù&ö/órñÿîËíÍð±õ·ùÿu ý–ûªôáñò õR÷õYòfðÈï„ï|ðúóWøú”úùeø§ûµŒ:z¯èüXø;÷»ù‹ûºù‘øwû[ÿ%¼ •ù´ Pí+ -;£FýÍÿ>R ¿fz PÆGb + Ô €31œ9]»ýæÿ‚² Ÿ€)$Âæ ­ñþþ>ý&ý{ÿC:þÜøO÷+ùçúíü®ÿ\£ý]ùšökõ/ô,ôÐödøšõ¯ðÅìëkë?íð€ôVúÿPL3Rûnõïï‡ë¤é­êì™îtò¼ö0÷Éóüñ‹ôRùXý þ½úPö]ö¶üþ»- á >‘[÷0îãèSéÎïÜøÝÅw¨ûÇqÍAá `ÿüBþ Ë ÛUü«qòòEœ &XN ü¦š¤ª ŸU¿¥% R EÙÃ"u"ð£”÷÷2ù’úöü0ømj…þ‚ý]þþÿ<ÿÒûù,ø^öDònîÙì¬ì&ìÖé å4àß„ãüë1ô$ú8þrþÛÌøñÖë­è+äßSÞÁâÇèí”ïÆî?î"ðÏñ¡ï~ëÝëóýÔg ê Ïì @†÷£í¹æŽãüâ7æðÒÿ'A(d-‹,E$DY0 0 E½Èžl— ¹î©ª¶¯¦H?×k»£ ðÄ¿ûÕô6óíö§ýe?!#+È+¸'' + ‚íöÖïí¢îèñàôž÷úîû®ýÿNÿ¶lÿaý&üEúõ¦í'çóáÜÍÕîÑíÒ¡Øâøìþö‹ÿ•J ¼cÌý¦øáðæwÛäÒÖÍ”Í7Ñ°Ö Ü¾àšåËéÑëíò÷úc—ZÏ…µxöüê¸áâÛÕØÙlÞê¿ú` .-A5U8 7ì1d)¥Ð_ œ•þtÿ,‹ Ùi•ò5ŒF#$)ù-D/,ó$Ä2â PGý!õò«ó3÷DüÍ8Ž 9*-.&,%ùüàùbóÍí–èÃä±âÈáUã„ècï3ô,÷)ú˜ûúåùúûƒþüý¬úõrë¥ÞëÒ‚ÌÙÊŽË ÎþÒ3Ú7ãøíùù…¶ Ù J}„öñì äæÛ:Õ2ÐíÌÌ ÍÎ(ЌөÚêå»ôgC ø$t#á—ç ¬óÝâÓüÈ7ȘÑêâÂöäÓ–&J1>8_;k:6Y/ñ'UGM ®#4¥¯ëƒ e‘» …(Ñ1:9?r@°ë¸æÉèÎïúrÅÈÙ#û(,©*œ$a¯¢½ý‘öñï¬èÒáËÝóÛòÙíØ2ÛÆß™åëìàôÊü»A üÅòÁé5áàØÖÐÊzÅôÆÆÌ‚Ôßòë¾÷5àŒþú3ó¼ìéæŸàzÙ>ѻȵÂÛÂYʶ×"é¨ûá °-"ÑRoÄüó”ëgçÚç‚ì×òµøèýxõ 7T!©)´18¨:O9e5Ò0,'ki×ýüŠÿ0$9*R6í>ÅBBØ<-3P&î 3ÜûøÃ÷ûú  ÿ e©&åMÍ ÙÐÿ÷÷î¡æe߀Ú"ØsÙ·Ý'â‰åÌèßíôCúâüÝûë÷mñPéíàcÙ@ÓÏãÎÑ'ÔôÖLÚvßæ†ì_ñÁó\ôKó5ñÌî‹ëÍæÐàáÙÀÓ1Ñ+ÔuÜWèäõuç RSÎ $Ûÿˆû6ù“ù*ü¾ÿX© È <OÙ û%ø+2M6b6¼2N-œ&€p~¯  f  ¸;Ù&.¡3U65õ/,(±ÎÂW Ï-Œš Âó‡ o z ' ü®ïXMØ åüTö5ï~è½ãäà–ߺß+áãKæRéìrí í~ëéæãæàWß Þ‚ÝÉÝ5Þ‚Þ{ßrá‰ãgää.ãsâ%ãjä`äNâ_ߥÝHÝpÞTâé÷ðÔøsÿ >-úø)Áübùðö©õ¸õUøþ©ç *̼Ñd_ *!a!;"$7&'ö&G&¬#]®*q&Ï: Ñ$](S) (f%š!‚Þ z  æ éÖDÕRWÅ*® ù?lÿ`ûãø›ø×ù™ú)úcù‚ø›öbó.ïŽë4é€ç„æçóèŽéÍçÝäârßÃݶÝrÞèÝdÜöÛéÝ.áþãæðçé é\çä>àèÜÚi×ñÔÏÒ×ÑMÓ?ØEàê¿óšûKgˆ úK9Ïú”ô(ðzî‚ïóªøAþõ‚ ‰­sÞ"µ%'˜'\&~$O"ð£e%#‰ZÚ±X"cj#&µ'ç(R)¾'%$æ³¹l–  , ¥  öØ(` µ¡þ=øôóóóWòDòãò)ó$òXðßî0îÙí@íšìšë®é½ælã“àQÞªÝþÝ_ÝÛØØ?Ø›Ù_Ü.àöäÄéÕìÉí$ìè ãcÝ_׫Ñ>͸ÊVÊö̹ÓÎÝéØóvý‰< ý 0 õëÿ¼û[øõÀñ\ð×òØ÷VüÿùniO š }"y){.Ê0Ê/†,S(t#Œð¹L Ð ûó  “QH L&0*×+û+}+¯)&]!Y>Û ë ¨ \ { P ;'° D 2Éá Ý ßÈþúõEð×ìGëTë®ëÒëâëÝëìÔìHîÐïˆðïTìîéýç·æpåèãáDÞÖÚ{Ø؃ÙXÜàãxåîåsåÿää¨áwÝšØ ÔÈÐMШӻڠãÛëfóûÔ'¹þ¨ü¾ùŸö«ô´ôäö:úýÿuÇ ( ~ ߀—Â#.'Ó*¹-f.Ñ+$&³}}Q · Ž ß®ŽÎØ!û%Ì(d*¶*¸)@'á"ÐKÖc? è g ŽÄ™j e ˜ \ ä ôEQ KýŽø8õórñ=ï´ìqê éýç*ç[çéûëhîPï ïðí!íèìÉëºèýã2à­ÞÞÃÞ«ßáJâ§ââTáNáAáøß¥ÝZÛ\Ù}׊×ÑÚ¥à‚ç+î-ôtù@ýÔþÔý´ûäùø1ö¯õ÷»ùý?¨£yV“Û å·ñh$u(+,1+(Î"WªLP4‡®Íäù>’!H$ù%z&m&8%$#,! ;SG{ *IÒã¡àÐ S D w 3 í$ˆüäùùY÷Éóðjímëûèÿåä…åçQè é€éjêìãí-ïîì‘évçhå²ã½ãàäräðá÷ÞŠÜÛÙ–ÖÚÔ{ÕÿÖ²ØÆÛÔà$çií2óÇøüýásüþFúÎõ€òuð<ðmò×öüìÿ!×S< F n Z|My"&\)?+@*&• 2HmÞ±é`ªT!O"ì"#Ÿ"³![!Ÿ!R"C#k#D!Îôù¼` ü]d…±¥gØ / H ·©µgÿý‘ûÂø¼ô9ðÈì‹ê³èsçòæÒæOæCåånæé^ì)ï³ð˜ð?ï¦í:ì·êéSçíä´áÞµÚ ØñÕÜÓ3ÒÒîÓä× ÞÖå…î“öný:Š¡ªªúWöqò¦îØë‡ëSî@óø§ûãþ@¶ù #޽sb~ "1%''ò"jª÷ñ S Á \þ)´ "$Á$A$#Ó!} Dòµm ª³ÏW'€Ó Þ„+ð„ÿDÿI"46^4p¶Iÿ…ûB÷Šó!ð«ìT鏿åä‰ã¡ãLäXåÁæXèpé‰êžì{ïÐñ™ò}ñïbìdéàåláƒÜ8Ø«ÔaÑuβÌVÎìÓ­Û7ä1íðõÌý,¡ tQ?ý<ù›ô”ï”ìøì ïËð)òÄóbö†úßÿ(æ *â¼RÌ‚!u" #ö#–#J šN ? j ¾ 3æˆ]Ne"$å#Å"°! !˜!½#<%Á#•ÔèB @27$—þìü~ýãÿkÓƒ¨%«”­Müö÷qó¨î.é3äHá"à2ß:ÞSÞÖß1âÀäÜçëíî2ï{ðóðÅð,ð˜îÿêÞå àbÚðÔ¨ÏzËVÉ]ÊÏ‘ÖßߢéLópü¿= ­ ׉²ÿ£ù9ó?ïîîZî_ï ñ^ó÷ºû²ÿf¼% ¿“U$š'Þ({(Þ%Î b6/$ â‡ÔóTI Ƙ±ª è ž"7##³"ã"‡#‰#þ!{æ2  ^¾§nÿªþáýŸý²þæ¹:V¢ç.} =:ÿ}û7÷*òˆì'çÉâJßÏÜ«ÛìÛ!ÝáÞ€á×ä$èëÃíð‘ñÛòJó+ò„ïëÁå›à™Û%ÖÅИ̥ÉúÈ|Ë)шÙcãqí÷p+ z å Ù«íû-öò3ðäïàï”ï ð­òŸöSúâý”ì4¤U@#Å&R*H-·,(¬!züà £Á˧¹* ’ ·‡³Ê!Ì"'#$õ%P(Š))(‡#ë`« _ðy)ÿ~ü7ú6ù¹ùÎû¯þyý®ß"B . …qÆÿ|úÑõ‰ð!ë˜æ^âÞ‡Úߨ•ÙöÛúÞ™â÷æ³êÿì7ïÛñôÃõHöõ¿òIï-êä‡Ý`ÖÎÏËyÈóÈQÌ×ÒêÛ.æûï3ùÆK 5  C ¡YÄüAú¬÷èôuòpñ&òLózô»öÑû´XµÃ$:+q0G2c0‡,Ù'—!m° ªü¶0Oc Œ[°k€X"É%N)§,/$/ö+Ò&Å •¤Ø_ þÐ÷ó4ò7óïõ:ù~ü›ÿP/VC ð Á ž ñšyý–÷ñÕë˜æ2áÇÛÑ×PÖåÖôØ,Ü”ß1ã¿çQì—ðnô7÷Mù ú3øô3ïÒéØãŽÝ¯Ö,ÐªË ÊuËZÏYÕHÝ0æïø‚Ôp > » × T ^LŽ(œýû#ø³ôòÅñLô:øküS¨žÞa#š*T/1y2?1v,S%ÑÇ3]  †Õ$} ` LXä!à%”*/C1r0ü-<*`%ËkfÝ 'úûqöšòfð_ðòJô8÷øúÐþ{Á‡ [ * E iKãûõî.ç¾à‹ÛÍ×^ÕDÔºÔ×ÛqßšäsêŸïOósö†ø÷ø,øö×ò(î½ç>à#Ù^ÓQÏŠÍØÎyÓÚbàšæÔí·õRý<-é ‰ – ” H¤oÈüHùž÷ñ÷ýø·ùZûSÿ¸± v¢ Ô&…+//s0é-)µ%Y"}»Ü Š é r Ždò;: :%ç)±,O-–,M+å(Ð$ŠxL„ýŸ÷'ó‡ïjíˆíîî„ð¢ò$öëúÉÿ ± ž ?¼ÑÿÅù[ó±ìÁå)ßÙÔbÑZКÐþÒF×Ü_â\è|í{ñnôbö÷üõóúî<ê9åˆß(ÙOÔÒÙÓíÖ¹Ú2ßêäÂëRòô÷ùüÿf2 / < Ñ a °\þ;ürûãú…ûˆý“Š h³=l"è'=+–+*b(ú&%½!Æôm«‡Üãç¤_ê‹ ñæi½"M&À(ƒ)¥(Ø&ˆ#4ŠQ Icûêô\ðËí9ìµë`ìOî­ñ€õùôû^þén£W)Çüâ÷£ñ0ê±âÜ Ö;ӜфÑ/ÓÖÙÊÜ\áGærê±íÂðó€óòyï¿ë忣á¶ÜÙ#×êÖ’Ø¿ÛßâmæãìÎó‚ø+ûþ¿øõ®A  ³ râgBýÿºÿzþäý·Ç ûû %U(*])+' %Ê#b"¯Ä_Ø!MP!6Ò›€ö­þôL"Z$,%„%é$Õ"˜ò@ ƒèü,÷Nò~ï¦î5îœíyíÄî5ñ0óõç÷Iûëýÿ(ÿ°þ¹üûømôîï!ë¬å2à˜ÛØÕ½ÒuÑÜÑäÓL×±Ûyàèäkè^ëí8î ígë°é§ç¥äñàqÝ¿ÚÚ‰ÛQÞêàuãDç&ìgðróøõùœüšÿø4AQ l  ¬ÝÕ|>”’\ ¤ù|Ç!%!&ã%Ð$É# #ñ"!¬Üùd(܋̂ÈJŽî "‘"]"u!Fãg „i9û÷Üô—ò¤ðxïøî*ïúïlñïó¢ö¸øúYü¨ü—û úÃ÷>ôÆï7ë¾æ|ârÞßÚØWÖÁÕ,ÖK×ÀØOÚGÜ”ß1ãòåèÖé•ê6êâè²æä8á£ÞÏÝõÞ»à7âäVçUëÝîÝñ,ôÛõ÷úòüÞþ>¥›0 ' b Ž Î•pËu[ ,„ È"˜%?&%%ª$!$s#" ­åo•üî úË×ÁBæÜã4!^"X"Ù!± F-ßB ¬Ìÿÿû-ùÁöxôýò#ò‰ñ4ñµñâòKôöæ÷ZùXúxú„ùô÷_õ®ñ´í ê³æOãà„ÝÁÛ°Ú¶Ù*ÙdÙMÚ®ÛÓÝ¡àãæ•ç?èèBç`æŒå0äÜáËßüÞ°ßsáãÆåHè,ì£ð¼óãôõe÷úülýÿiÎó a  n û Ð ' ºãñ } ìòMeÐ"o&N'4&h%—%U%á#X"R!… ÏøýV°áÇ9»9œæ!­#Ž$ý#§"S dR ZçšýÌù÷bõrôtóÄò}òÏò®óõpöª÷qùûDû„ú ù^öšòJî,êVæâÃÞËÛïÙêØ›ØÙ1ÚÛeÝ{ßKáã(åç èèlçæ`å¨ãvánßœÞdßáõâhå¿è€ìðáòÙôUöÖ÷ôùÍü`ÿKµh K ¾ µ b  ´ I Œ Ì ’ ™/®6Î#À&ã'é'K'ú& 'ß&Ð%Â$ª$‡$-#c!<í®£‚Bn4ÅÑAÕ "?#w#Ú"(! \  3þú]÷ƒõ×ó©òåñ5ñ6ñ2òZó»ôŽö øáøûøSøîöõ”ò!ï"ë€ç˜ä¹áÞ|Ú5ØÒÖÏÕ^ÖÇØ&Û›ÜaÞøà.ãTä åêåæÛärã/â‘à ߉ÞÐßOâ¯ägævè°ëVï®ñ›ò‡ó‹õøZúÐürÿúI ¢ Ð ð v e [ µ ½ V ¯ i ÄçE"%ˆ%% %ˆ%-&4&´%%O$—#˜"ß ÂÙÖ^zš>jAò& D!”!ì ‘i%Xd!× 0füVøÆõúó@ò!ñîðTñãñ‚òIóbômõ ö²õÅô·óJòÖïÕìÿéç äáõÝÖÚ5ØŒÖ+ÖùÖô×ÝØIÚoÜŸÞMà´á×â!ã—â±á«àGß ÝéÜÀÝ à¦â“ä/æ·èRìjïüð£ñ|òÏóö:ùüaþºˆª ê  ý  V b ô ÷ u Þ rñt L#§$°$$S#þ"W$D&x&ô$¨#`#x" wÉ-Cøã+§ód5¸IDœü±e ¼‡0“üùÏöwõ·óõñõð¾ð?ñSòøóqõÖõxõƒôó›ñ/ðîIìé§åíâ@àNÝÒÚÜØ†× Ö°ÕÕËÕZ×éØòÚ;ÝÖÞ¢ßà2àËßß*Þ>Ý ÝÙÝWߨáæã¤åHçªéÐìmïnðþð±òõÌöøšúrþK²²4 Ù C Š 9 V N Ú Ÿë ªì !y#Ü#Ò"="h#%R%ë$þ$ %„$#M!ÐÂH™]ûÀýÛȬ  rRA  ==  æÈÍüÊùÅ÷ÏõÎó"ò‹ð›ï°ïbðnñÂò§ó÷óèó#ó¿ñVð¡î7ì[éoæGãÛßëÜÈÚ_Ù§ØØ×òÖ½Ö|×rÙ¢Û0Ý0ÞßÞJßAßÉÞÓÝÓܤÜãÝ®ßDáÔâ¤ä|æPèÃêíxîïTñ¢óOö1ù#ûƒüAÿ™z' H ó M ¨ ç á · ¥ U›wGïÿ!…"#$h$Q$æ$&8&ð$%$_$v$'#Ø L±ÿÌDÌvVMê —¬+úPcÕ¬ = ”ZþŽû°ùvø÷tõ¶óFò…ñ ñ\òLó:ôŸôeôQóÀñÔïeí”êæçæ(äZá ÞrÛDÚÇÙÑØÿ×اØúØSÙPÚ®ÛåÜ ÝúÝøÝ£Ý ÝýÜ·ÝÎÞSà)âMäÚæõè˜êßìðŒò3ó@ó½ôW÷¡ù¾û/þúvƒñ± $  c 8 Š …z3ÿ€Weà Ð"c$D%%©$%&]&œ%Û$$Œ$õ#Ý"Q"ß!Ü ñWj'Xƒu­ M! !N ïÅ©o*µ0 ‰L¼ þbü³úù÷ÛôðòFò‚òõò¾ó®ôõ„ô½ó óhòëð™îìœé¯æŽãÐà€Þ¿ÜKÛrÚ ÚÙÙPÙhÚºÛûÛÄÛGÜ\ÝÇÝzÝÖÝãÞÎß8àµà;âÏäQçÚè|éáê¡íhðò2ó•ôQöcøÀúýÿ xÜÁ > B  ¤ tÊœÑ ¨ ö"…#T#ñ#%é%w&Í&ˆ&Ê%Ž%Â%k%n$ #¿! † ¨—¾e3ÓÀ˜ñÍиk«é = ­^>‰ýqûÑùë÷Óõ'ôeóFó£ócô ô~ô]ôôDóÿñ?ðRîLìïéçsä(âÐßRÝ+ÛÑÙÆØ½×0×Ð×ýØÕÙÑÚßÛ>Ü6ÜrÜTÝ5Þ‹Þ‘Þ.ß•àÑâ¥å<èÙé>ëWí¡ï·ñÉò÷òUónõ›ø†úøú€ü*êÔ×] ¿ F "j8žÕöÆwJ%!"p"€"\"c"M#ª$%r$Ñ#N$Ù$ $Â""¬!î  £^ò‘œ—c_[iÙ)ÁbM ß§Íý’ûúsø9ö­óäñ³ñ¾òŠóuóKóŽóŒóÑò\ñéïxîíì©êÓç6åëâ¸àŽÞºÜAÛÚOÙnÙ„ÙÙCÙYÚ@ÛFÛ7Û Ü½ÜIÜEÛxÛµÜÞÍßšâ/æìè-ê/ë$íÙïŸñìñºò€ôoöð÷2ùðúý(^8.Jú> ¿ -“1ùBq+l0« €!=! ° P!"¾"##õ"½" "z!$!!î f Íc |4áÊ´žRͽh2ÕÞF Ôä Fÿ„üÐúGù0÷ÞôJóÜò¿òBò2òòòÒñ!ñ]ðqïkî íiëé{æºã*á<ßFÝýÚ=ÙÞØùØ0Ø×ÇÖ©×aØÐء٦Ú5ÛTÛ—Û!ÜܙܯÝ}à·ãæþç³éÊë<î±ïiðTñwòÜó¥õŒ÷ùø>úrüÌÿ®~h¯kR z õ Û—a-¿¥i6}‚êŸ 2+°| Ì Ê Ï !!½ l  à ³ÄW[H4û7jså/”ª 8 ­u‡þbü§úù]÷ˆõôó¯òéò,ó±òGòòñnï/îGíËëðéÛçNåãSá*ßÂÜ Û>ÚÙ»Ø8ØØ9؆ØkÙLÚƒÚ—ÚÛ“ÛˆÛŽÛÜÝøÞ—áÞãæ†èâêíQï{ñ¨òYó1ôxõ÷ÂøGútüSÿ×}9s‚©ƒ á  ‡Ùo¨’]â ð ó {!5!j ¡ Ž!í!­!…!ž!µ!7!” ( Õ{+0$C‹µÆ²ÕFgõ–)ö õðHç«þ±üùúBù¢÷öÀôtôRô>ôCôô»ó8óvòñŒïî?ìCê7è[æ8äâáÂßúÝåÜñÛ&Û±Ú`ÚµÙ©ÙwÚÛÛÛ+ÛlÛ¬Û)Ü(Ý=ÞVßñàPãKæuéÝë¬íðûò³ôÞôõöyøºùkúÃû×ýpZHð¬{ h N ˜ ³}ŠÁRõB!%"."¥!X!h!Ÿ!k!*!b!p!ø r  €Ìxo|6ÌŽ£m !ù  ÍuŠFäÀK  °£þcü û¡ùõ÷´öVöö¶õwõÔõ,öôõ.õ¿óCòQñ#ðlîÌììêÊèéæÎä|â°à‡ßhÞsÝPÝ Ý,ÜþÛ Ü×Ü5ÝÅÝÕÝÊÝdÞ߉ß=à%ávâ“äÖçëáìÝí°ïoòôaôßôÆõ ö÷ ùÆúãühÿì=›È€g Ý SrW““û§€Ý/  Á½5 å x!¥!y!á  º•ò$£ƒÕ:Ÿ(ï Øej/Ä$pž ¾ ÒiGŒþuüSúQù¿øË÷ª÷:ø„ø—øCøˆ÷·ö¿õqô0óÀñ”ïíÔê£ècæä<ãkâyáAà,ß\ÞÞðÝÞ_ÞÝÞ4ßuß”ßPßþÞSßMàLáKâ"äÈæ:éAë?ílï„ñkó±ôsõ6ö‚öööWøúùûqüÎþ/ºç]¡]•= “ ö ó„ë¬ßtm‰ÎÚ æêÄw?› „ }õj¨ƒpãÆï ²¯žkÕW² d àáhTþIüÛúàù{ø÷ööÙö†÷¾÷Þ÷5÷ÏõÇôÝóò%ðkîVì*êêç¨åãããâÿàùßqßEßß÷ÞßßQßQß?ßÅß`àWàyà0áûáã™ä¸æué»ë1í¬îöðˆóõÛõ¬ö[÷3øùú`ûèüåþ30Šæò ú8 ˜ ½ Jdá½Û[üÃvùTAØÁs~#i*nF†ù2Þ 32­Tòö¼rõ\xÆ €ªþüûäùaøöööSõnõoöúööõ×ôIô)óÇñöïîBìXê{è¥æúä£ã…âbáMàIßÎÞ ßßõÞäÞßLߨßÇßËßtàQáâãùãåMç@ê£ìYî±ð8ówôÁôõ ÷øÀø]ùtúÉûúüOþI¾†ðf_œ’ W  5F“ý¿íÄ€µ•wHã~ÒG"âbj¬f3…Ú_¸6hh£ v ÝØ²þüVúœø÷ùõ÷ô¬ôÖôóô,õpõ?õ±ôsôáóaòxð ïîí’ësécç£åÐãcâ¯áåàà–ßOß#ßåÞéÞfßLàáWáVá{áôálâ”ãÅå0èPêì’í¤ïÐñ„óÛôö˜ö§ö÷=ø]ù@úûoý@ÿþÿE0”ð‰HÙ £ ‰ ÍV«yË]:>¨ä ü“z£RÀ4œää³åe±†åã‹]ÎÀ·Ñ ü ®Àá–þÕü°û úWø6÷œö|ö{öÄö'÷/÷÷Íö/ö(õñóœò+ñ‹ï'íÑêSéèçæÊäãåáDá,á&áEá¤áâZâøâjãxã|ãäåwåæ°çÄéÀëzíJï]ñvó0õQö»öÜöÂ÷)ù#úñú]ü=þ ÿ–‡Ô4[ÇtW Ú ë ›Ù‚ª!)ÐÚÝl±°ãñ¡J§îgìÛBOS‘瘆YfkÚ-}› i äÞ÷Ö9ÿºý.üµúYùøÐ÷0÷÷ö÷H÷™÷÷ ÷5övõôótñCðûî…íÇëÖé0èÿæÍåØääuãeãtãMãæâàâ‰ãyäéäÛä‘äÕäÇåçèêåë÷íùïòôäõ÷Í÷=øµøGùäù´ú(üüý•ÿûÒR/ߎG³¿  î"46è‚á%1$R{qÈHbš^޹]Ý‚FIÀH3¯5v,Sˆ– 1 ;:­ÿþcüû"ú7ù—øtøºø ù4ùîøVø^÷@ö?õ*ôó•òæñ†ðîî–íuìBëÂé9èËæùåÓå­åFåÂä¬äåªåPælæQæ’æ*ç³çJè§é£ëŒíï×ðó¾ôö ÷¸÷7øãøiù+ú;û`üîý¦ÿ×¢Mùr¨T¡ÎÜ œ í u…£ÆÁž×i”Õ ìˆÚM,fÔKÐÅ>§ñîkÛtþ­8ö|› B 꺨³ÿýµû0úOùÍøløXøRøfø£ø}øè÷=÷böXõ#ôó:òYñð¿î_í ì¨ê"éÎçÐææYå ååñä¾ä@åøåKæPæjææçëçcèTéðê²ìYîðåñqóõšöµ÷løÒø@ùÏù·úÂûý¸þI=¬K¾\@(%f ~ “ ( ³ yB°7É]y0ú^p±h.Tø$%bÿª¿rYþí8P×-E ü qÎßÿ1ýû÷øm÷ãöX÷ý÷Qø+øAøø:ø ÷öùôæóæòò!ñòï®î#í¶ëÙêðé—èjçÐæååå åoå±åÚå æÇå§åæå|æ4ç¸çèCé ëËìMî±ïñ±òjôÄõ¡öL÷ñ÷éøúû½ûüÊýÿAÿ9fùR¬ÇˆU  ú ³Ÿ†Æsî†+’Ê÷Ý¢NØk¾¶Óë^EíN…òö¤4­Dïñi9£ X íÇÖî&þùûÜùø+÷îöÜöäö$÷A÷ ÷°ö>öÀõ"õ*ôÐò‘ñÙð#ðÿîôí2íñëqê+éèåææØåÕåËå…å,å1å]åˆåíå:æAæ­æç;çøç¢é^ëí¨î`ðòÓó¸õ ÷´÷ø·øÇù¹úŸûÙü'þÿºÿGWtâ]ŽJrƒ > þ ­€hɸ¤+dx´ö/*í$÷ìO dìL$èŸ+Ñÿ±2ã D  ¯sk…Îþñüû›ùpø˜÷÷÷U÷‡÷©÷µ÷‹÷÷ öêôóOò”ññDð`ïFîí½ë\ê.éqèè‘çBçBç(çþæÛæýæ.çpç’ç¡ç…çÂçjèKéšêgìjî,ðòöó\õžö´÷{ø5ùíùöú\ü”ý:þËþÿxÚ×ðaÆkˆúNõÉ k  Ô´ÏÑðtíInЉ\,õm‡c;ŒKf¸ù©qÁU„ú H  %Z‚²ÂÿãýCü’ú5ùãøïøÅøø³ø³ø~øø¢÷C÷Pöøô9ôÑó*óîñ·ðõïúîÉí…ì2ë7ê·éiéCé9éÊè0è4èžèúè2éþèûèIé¤é!êõêì’íïÑð÷ò õö¿÷þøøùåú×ûùüÞýeþÿ¤ÿ.N_…µÝ¼ßn-U # ƒ E Îe©Nm±Ù§Ç ³=HNõP©}â$’ t\ÉaÎ7Ô „ ± ‹78¢åôþlý4ü)û|úþùŸùgù8ùQù´ùÀùùFøZ÷döcõ¬ô.ôeóAò/ñðÖîÅíºì ìÇëTë•êêê êíéÃéê±ê¿êØê7ëƒë‡ëÙëíîîÌðLò ôÑõM÷¨ø_úÏû¦ü0ýöýÆþ:ÿiÿõÿ¸*O­-Vv:v­Zg 0 î ÙúʹFÌJ²É¥lì:Ð:›+Æ/©Hö+Í©)÷^°êâ–$³ L ¼ ¿³ñ/KÊþwýü ûJú³ùHùù ùù1ùÂø9ø„÷ÀöäõõXô¢ó·òŒñ¥ðÏï­îƒí¾ììlëªê:êïééJé_é¥éê…ê®ê¶êˆê‘êëæëíî:ðóñó%õ~öbøýùûûËû üMüý­ý}þCÿÂÿøÿ:uí•rR/kÇ  Š ‹n<‰VéZÈ €ÉbÅ6ª’¨c‰›¼ý{üqºr±J&Þ … - _]c› |ÿþ½üfû6ú¦ù>ùù¸øjø@øøÍ÷Ÿ÷t÷³ö˜õ`ôTó{ò–ñ›ð ð²ïï3îOíkì®ëïê.ê´é×é9ê0êùéúéËéƒééÆéoê7ëì.íoîÕï_ñ:ó9õ÷žø‚ù>úÛúWûÈûpüîüý…ý{þWÿÌÿ #’–•Šò×Á ³ ¾ têMjâçhfD ½ž9˜Ù = ¯bQ—5×;lt° ð)O ? É ' B:oÞ†<ÿ­ý,ü½ú_ù\øî÷ã÷ò÷Ø÷s÷òö™öhööoõqôó´òòWñˆðð“ïïýí®ì’ëþêˆêê¯éééWéVééÃéÒéãé8ê£êåê>ë!ìkí=ïüð§òvôö¡÷ùàùyú›úÇú„û?üüçü{ýþ—þÿMÿËÿ©^ô#qð¶‘ _ UµÔ”!—Õ’K'ó™€Õ7¸"§j`xÿ‰{¼œq²¥ ~ ¹dÚÝ|ìþý¹ûçú6ú¬ùjùïøMøô÷ô÷*øü÷÷Òööõèóüò“ò$òyñÂðYðÝïáîÂíóìWìàëòëÚësëáêXê?ê€êšê™êóê:ëUëëoì²íBïôð·ò<ôèõª÷ýøúñúcû·ûücüý›ýþþÿJÿ«ÿ=ÂD´jx†õ¹¦ - ¸ 7¦ì ÏXÊ´eYbLî‡*~Â’NO‘ä 7H@5%æ_€ d ç ® _–¹óˆKÔþ_ýü+û`úÛùŸù†ù\ùùù¸øUøØ÷+÷döoõµô'ô—ó²òòšññ0ðAïcîßí–í#í½ì¾ìÖìØì¯ì-ìòëìyìÑì íªíIîïRð«ñó¾ôö3ø·ùðúÁû>üpü¿ü>ý¿ý+þûþ¶ÿ×ÿÊÿÃ\ùf&:òã „  —qXWu–‡cp{'ÕŠö,~*-4ïöO”¤Ù"ús®$ep ° Ä k é>ºŒD›åÿ”þgýüÙû5ûÉú˜úWúþùÍù¢ùGùÉøIø¼÷ÓöözõÒôûóaóÿò²òæñÉðð¼ïrïàî„îpî<î¦í<íiíÝí,î†îÆîìîï…ïJðuñóõ‰ö£÷ùsúœûSüÀü.ýŸýöýaþÿòÿ¶qüíÜOêAû3¼: ž G †ÂUYܟܰ²€Rw!€:£Ì¼rçã‘)rÍÐJÙG g  ¹ Y †ªEÜÿ¾þõýÈü‚û¿úHú,ú#úáùÍù§ùù•øò÷÷köÒõ õ\ôýó£óæòòcñêð‚ððŸï.ïxîîí¾í—íªíßíäí©íØí`îXîÓîÏï\ðñRò ô›õøöxøüùûÏû?üšüûü|ý;þ›þ ÿÛÿŠÓO—mÿ¯]àãUôS Ü e ¸Ë€M“¤5úb͇8 } ¦9ÈvRy‚d®ò©\´  š H Õ ù u Î'²˜zÿþÊüÙûûú=ú˜ùjùÏùÀù\ùâøø}÷÷¡öö¦õ!õ…ôÀó(ó«òhòÿñ6ñlðÈïDïÖîbîëíúíî îüíúí1îîýíYîÎîuïð±ñÊòòóõ5öÛ÷mùvúWûü/ü[ü½üqý+þÁþÿnÿ±ÿþÿ—þEÖÝØzÐW ¹ < n ¥íYZyŸ»¼s^ ŸWä à … Š M > N 9 4 6 P T ® $ ‹ b ËÙ«©|Øk#àþ©ýZü0û6útùùìøø"øé÷æ÷Ú÷{÷÷Eö<õô6ôô¯ó+ó¿ò/òrñ¹ðdðãïGï«îîLíí÷ì%íNíPí…íÜíÙí¸í2îñî‹ï:ð²ñzóÎôæõ÷øùÛù‘úUû”ûïûØüqý¬ýûýnþøþwÿw– Ò?ôìL ^ Ä 3 M X+24é¸ÕÙØ n J " ˆ   - k W - 7 N N 0 ü ¶  P æ D!ŠÛ”ÿ~þRý4üTûÁúCú_ùÌø™ø;øMøLø÷÷“÷;÷Îööoõ õÃôô×óFóÝòò1ñÑðuððÙï£ïTï ï§î*îäíî˜îâî:ï¯ïòïèïðñzòëójõØö0øAùSúùúpû*üÍü ýHýðýsþÏþIÿÐÿcÑ`»$µ ˜½Y÷ [ \ ) !²L•a&,YQD1Tã• U  Û ¤ Ž f N j “ \ 4 „ q Õ M £ Ê Æ­¥€eWIP ¹þýüÖû!û|ú+úDúú…ùBùùÙøqøÛ÷U÷Ðö8öÇõ[õ#õ´ôô¡óó«ò ò\ñùðÜð•ð1ðððÒï²ïðnðð™ð$ñ¹ñsò_óôõ(öh÷ù{ú•û_ü»üáüzý÷ý_þæþÿ†ÿ&±QÚK™å²üíY° n × „ qĹ—³æ ôu­ù Ë § Ì Õ Ï ^ - K Ú > ' ¨ ' ¬  Y   ŒŠ¢z½¨ÀÕÿ’þý ü¾ûû;ûµúuúsúŸú«úOúêù|ùÌøø€÷÷°öXöáõjõ¼ôÛóó€ó_óíòªòvòòËñ–ñwñ¢ñîñ òþñòsòÊòóÝóíô[öÜ÷ù'ú_û2üý*þ!ÿ‰ÿZÿ6ÿ}ÿôÿXæEj°ú%‰5º¦ø8 J ; b pWV罦š_³Ÿ j  ù ¾ K - w À m  Ù ] œ í > ,üãæ“ ÆÊÿçþþ?ý}üËû1ûêú»úú~úzú úÊù§ùùø’÷z÷{÷íööËõyõÄôô9óÛòßò¦ò(ò­ñuñYñŠñ½ñóñLòaòòæòIó„óôõTöt÷Zøkù®úÑûèü·ýëýóýþcþ ÿÁÿ5Â(Q¡ë÷SØgò—}°Óç î Ð Ò ½ ]®ÿ¯ ôï˜ÿ ‹  ÿ –  ¾ É ì  N ¬ ä Ç „ þ x ÿ j ÁûÌQ ãùÿ>ÿ`þCýü'û›úkúMú0úúæùèùžù ù±øMøü÷|÷N÷÷šöö­õ õÃôLôóóÇò/òfñùðÕðïðñQññ¥ñØñòLò òâòsóyô¼õ÷,øùúíúŒû©üjý±ýôýiþúþwÿ¹ÿ$¬ÕÕê,“&£#¨4Elªå à Ñ  n ® Ï — V d @  3 $ ½ = ¸ ÿ C  ì è  & k é ¸ ™ D ÝF´,Wÿ¦q]<1ÿfþyýHü‰ûû‰úúˆùSùIùAù ù©ø>øÔ÷a÷÷Úö öaöçõ\õØôOô‹óòò¾òpò&òöñ¾ñ©ñiñäð¡ðÅðíðüðzñ»ñÝñþñ1òçòÖó±ô­õÜö+ø,ùüùûüŒüWü5ü–ü'ýèý¨þRÿnÿUÿ}ÿ¤ÿÞÿ4Çjüo6Hdu¢¬V á Ÿ e ù A T c ” i å o @ « + § ) ¤’¼Ÿy®ñ. & !  Í\ž"´Ú÷{¾OÙ²ÿ³þ¿ý ý€ü›ûžúøù½ù…ùSùGù@ù"ùÒøŠø%øº÷[÷!÷ýö³öhöîõ5õ¬ôJôÐóvóüò©ò{ò˜ò–òAòòêñÈñÍñþñûñ'òvòÚò`ó¯óAôvõÏöø ùùùûÞû„üýü?ý˜ýþNþbþ­þ ÿwÿœáñ2Ö—…LópC:C ` ^ ø ! 0 O b X X < é Æ {  ñ à b Î M  ÓÅ! › ¹ £   k ÷ l›ú '$ðų«ÿ­þÖýèüöûsû)û²úqú@ú úêùâùäùëùæù…ùÙø ø³÷€÷[÷÷¹ööõõõLôåóêóïóÅó–óTóõòÈòÝò"ó™óÁó¯óÔóDô¥ôùô¢õ¡öõ÷üøËùú|ûü“ýþ]þ³þÿDÿ ÿ¿Â­å9…† ¨NRd´•¬ ô  Š ª º _ h c n [ R ) Æ {  Ì / r # "  4 à =  ¨ G 4 7 Ï>ÔZÀôô´¶_Oÿ#þUýÕü*üzû#û3ûûDû™û¼û ûû û\úãù•ùdùù¿øuø øU÷óöšöAö ööáõªõ§õ…õ>õNõ¦õ™õ¦õ¾õõõCöwöìö‰÷_øMùWúaûgüwý'þÌþ°ÿPF8Z«ñ>Û`œ­ð)UÕv÷oùª˜‘ª ¯ Ž + … Ù 9 V   â s . & ¶ þ ¥ w > *  ¶ £ Á ¯ × Q l  à ª K Ç5—Ú2bªÅ£ÿ~þºý(ý—ü;üðû{û^ûû£û¹ûÄû’û1û‹úúðùãù·ùiùôørøø’÷ùö#öÂõ²õ¥õ{õmõvõ"õòô>õ”õœõ½õúõ-öŸö2÷™÷.øù úÒú¤û–ü‘ýþÅþ²þ¬þÑþSÿÏÿ2¼?¾ÓÜ w˱v0Á{ áúç Ú { ¼ ž ¨ º Í Ä w  Ò ­ [ = 0   OZ‡’¤ X % Αhréjç?>AbÏþÿùþþ7ý¤üübû<û*û4û:ûIû%ûæúÍú¤ú9úªùHùùëø øcø<øð÷÷&÷nöîõ¼õSõõõéô¢ô‡ôÏô?õkõyõ¦õèõ4ö¸öR÷ì÷õø¿ù‰ú”ûŸü4ýÌýNþmþŠþÇþÿeÿÝÿ-jÓ ’ГùZ!ß„t`>0 r s » Õ ÷ ä Î µ g è Ç ® z N Á¡GgÙfiÌ9©,äXy²°}Žáÿõþ'þ‰ýîü?üÆûqûîúàúìúûûûúFú(úÈùSùùÙø‘ø~øYøÆ÷A÷ñöRö¦õrõõÊô¡ô ôµôµôrô„ô»ôªôÀôõWõõëõSö´öj÷VøTùiúyû1ü­üý ýæýÃý³ý¿ý=þ°þÖþ!ÿ±ÿV‰±ï#Š%ÀªxÓ[Ô”ÌÐ T q d + ûñÿÓ©[•"Z|WZW×ÊÒŽÙ½½OÁ.ÿOþXýfüÖûEûÀúnú+úîùÖùâùÃù ù ù¡ù{ù+ù£ø.ø ø1øþ÷]÷ÉöÇö¤ößõAõõõÛô¤ô~ô%ôëóéóÿó3ôuô¦ôúôvõ¯õËõ%öúöë÷ø2ùúû»ûNüÙüý>ý¡ýþ_þ§þºþÿƒÿËÿCGYÇ[.`O± ÎfF © ½ ’ K öÐ N ) ýèîÊ|Ȧ“°•ž,"ô·±„ý8F‹ú=€§Ôÿöþ4þ¡ý-ý¶ü%ü¸û£ûcûû#ûRû7ûèú’ú(úúúíù±ù–ù?ù˜ø[økø*ø­÷N÷üöÍöcöéõŒõmõXõ–õÊõãõÚõûõXö¤öçö&÷¼÷‘ø=ùÚù°úaûAüý®ýþšþÑþÝþÿ{ÿ÷ÿ>VnÇvÝXÊtølHP'ׂ* € Š ‘ Ü ú  9 R  Ÿ — o åU`‰4œL?d~еá Uù’i]º;Ü2}ªÐÿ)ÿ*þBý¬üdü4üüúûÜûÇûæû)üFüûûû,û©ú]úYúcúú·ùxùùŒøŒø`øø¬÷8÷Ýö¸öªöÐö+÷F÷&÷6÷C÷ˆ÷ù÷Tøµø6ù úÍúyû-ü*ýþŸþÿvÿØÿöÿëÿ“ô*¦,-.}ó@Œ8"êŠV…   B c Y _ <   ò ù û ø ¯ - ¾9àÆ¶Ãö#5]7ó´qã/ˆi¢ÞPÎL‡Ëÿÿjþþ»ý=ýöüÐü·ü¨ü¢ü·üáü ýúüzüÞûeû2û2ûû•úúÖùuù×øZøIøløZøøÈ÷·÷¨÷d÷r÷Ó÷!øhø­ø ù_ùÅù6úŠúFû@ü"ýÃý9þÙþ<ÿNÿzÿÑÿ+ -©l…Ï%P4NÎ=¨LúÆWÀ1Ô` “ ° ³ ’ ~ U H  ¦Š–DÜgó·}­,wX­+ë·IÕ1Ëd£Ê d˜ÿàþ4þ¬ýWýýÐü¨üŽüuü1ü2üMüüóû§ûXû ûéú¹úŒúIú1úú»ùDùÝøŸøoøø•÷/÷H÷Š÷³÷¤÷€÷Š÷¼÷Ó÷Ø÷þ÷aøñøœù„úZûµû üÌü…ýüýgþÜþ)ÿ`ÿšÿÔÿøÿ 7\eyå>~ÑÝ‚þ aœ¡màKŸÃÎÆ‹_,èç>³~Z1 7>:QM42 ¬]ÎOzÃ2°SØZÿ¹þþrýçü–ürühüBüüªûdûhûžû¡û`û3ûñúyúúBú!ú«ùuù*ùÔø¤ø%ø÷›÷F÷‰öÇöM÷÷@÷Ž÷e÷¸÷Ô÷c÷Š÷í÷ß÷Zø~ù0ú­úîú,ûüõüDýÂýaþŸþ¦þ_þ6þnþ þÍþJÿÄÿU—š¯[ÝKŸOD¦ »îDÈ8~„ú•¤yAÚd%ýõØ“šÝº—ìöà3Fµ‘– cù6GÿËþ-þQýý ý7ü»û§ûïúÔúCûHû[ûSûûËú²úBúúú‰ùYùQùÔø]ø øí÷øÒ÷…÷Y÷þöŸö£ö§ö’ö¸öÌöÐö÷óöÝö÷Y÷¬÷û÷ZøúøúúûæûŠü'ýêýEþ3þ0þþ,þ–þÜþ&ÿ`ÿŽÿÿøÿ3RF‚\ä1¾[ÊjDÜ“O1Qw73]eCò­oâ€ZXd`0 á P€›fÈŠ&áµI­þwžžÿ-ÿÇþþ}ýKý ý…ü*üõûÑûóûTüƒüXüPü&üÃû?ûÆú_ú1úAú!ú&ú"ú¯ùBùöø¦ø:øøøIøOøøé÷¿÷Ë÷$øLø:øjøÀøõøHù÷ù»úPûøûùüµýôý;þÜþ0ÿÿ8ÿ¶ÿÚÿ‰ÿ¤ÿåÿRÐë<|}ŒŽÝ‚òg^ø`A³ª†¡±Ñ.'ÔbL-ýÂPÓë øíÖîG…7‹Á?Å4½Nü›ÿ½þ&þ·ý˜ýuý)ýòü0ý;ýüüÚüÌüÂü„üüóûøûÔû¦ûgû.ûÌú{úVúú«ù´ùµùrùòø’øuø¡øÎøÍøäøÛøù@ùkù«ùú&úcú ûèû¤üý|ý=þøþ$ÿ>ÿãÿŠ“u¤ÃxÞ-]ßón jx–F²É”tk]}ŒÉÖÒ±@¿ÊåŸco›ñïÜù…仄)p²XÙ+ÞQŠÑÿ]ÿYÿýþeþþþþáý¨ý·ýÏýrýýSýýNý ýÚü‚üÒûYûjûgûâúÕú«úKúùù‘ùùÔù”ùˆùúú.úŽúlúLúWúpúžúûòûùüšýÉýXþùþœÿåÿ'@aŒÆÔr–{^Zýw§Ó[(ÿž_¹mï.@/@<±9W¢½¡j0„Ó¡ì BLPPï¼åª|°Cjº‚~ ,Á—á)šÿñþKþÓý¶ý˜ýYýDý8ýOýgýeý,ý8ý0ýÔü”üKüüüðû½ûZûÀúUúñùúúÕù™ùVùúøÑøùgùìù4ú)úú úÜù²ùúù‡ú)ûÝû^üâü‚ýàýþgþÖþ%ÿÿÝÿõÿ-a‹–ÀúVÑ(mü¬tŒª˜ùÞ®Ñϳåá—^ü†S±Ý?Ž´½ŽLªWºHÈ”7‚·b‹ÿÈþCþ›ý$ýÚü»üü§üý2ýÔüuüJüùûèû4ü3üçû™ûLûáúYú8úzúMú úúù“ùLù.ù(ù¬øbøVø—øüø0ùCù’ù»ùnù„ù¨ùú°ú%û…û0ü²üãürý<þ²þ×þåþ7ÿÿHÿ‹ÿÑÿøÿÀÿ±ÿ©ÿ¿ÿÞÿ5NuÝ€á5~wi{Ô»…¤nfŽ¢”=Æ…tb|ÃÌÕ»·Ð˘B4Õ“U¢ÿAÿÿ³þ þiý ýªü?üüóûØûü#üüæûˆû$û6ûûQûåú©ú|úKú/ú=ú'úÓùƒùù´øxø%øû÷øtøø3øû÷_øcø?øuø¬øæøéø9ùèùnú*ûâû`ü®üýjýÀýÿý:þ¤þÜþ¯þšþœþgþGþ¾þÿB? Æ–1¦&”¶²7B^¥=*a–‰ ¼i5 ]‹Gìÿ-9B-÷ĸ×÷Ý¡&Mm¾9Íÿ|ÿ/ÿöþIþtýý(ýðü¿üŠü…üèüóüøü"ýäüCü¸û©û½ûlûû?ûKûøú‘úcú;ú6úDúúüùäù…ùßølø…øÄøùøHùaù#ùúøQùÖùOú°úûÜû¤üý©ýþ$þyþ¼þØþ ÿíþËþ*ÿˆÿ¤ÿ¿ÿ§ÿîÿrvj­å!›þ‚!®UáäñpÕï+3ûðêñ×®©º³…@üËÇÿШ¾á²¾Ç k>T!·1œþ1«ÿ—ÿrÿÿ¼þ„þþ“ý§ýÉýÖýÓý¼ý\ý#ý ý ýÐüÅüÚüŸüübüãûûZûûÄúiúWú“ú³úšúSú÷ùÇùúLúrú„ú}ú’úÚú û4ûûü­übýãý0þ¬þEÿÇÿÿÿýÿ/ @\uu‡ÈóQ¯´šôtª«‡ 8†Ý+F¢=hù¥T, <ÁymŒ“‰‚dZ¼46Û\¹;ç–EÚMÔ.Û_çÿ+ÿþƒþÝþÿÒþìþÄþSþþóý4þ,þÄý ý«ýný ýãüØüÝüçü¼üBüôûšû!ûû<û@û4ûoû¦ûZûHûYûû´ûÁû6ü†ü³ü4ýßýTþ•þ¼þÿPÿÊÿMzfI—ÑÈùl Ï&Gî° }É{ó~úUžÛZ­ ÆoÀÿ,¼(0TÌO.0FI:ONJX4 õÄ3„&ë\¥ÆY[øÿrÿùþäþûþµþKþUþqþ_þ7þäý þþÍýèýÔýJýËü~üCüFüÿûòûüðûÖû‡ûûÎúÏúÍú—ú›úÁúôúðúÑú$ûûÕú,û´ûü!ühüäü‡ý þÌþpÿ¯ÿ§ÿxÿoÿVÿ„ÿÜÿ?‰|jc±Í· ‹èðå aÁ{`â#ZF@8+ BJ?ª'䨸8_^80r]Ö$äöÄ,¬VÏÿ6ÿÑþþ`þ^þ%þæý­ýiýQýiý€ý„ý[ýý&ý0ýý•übü’üŒüQü&üáûJû4ûû¤úú«ú‡úcúpú†ú‰ú¤úÊúªú˜ú¡ú¶úßúëú=û{ûÍû†üý)ý…ýWþêþ#ÿ2ÿ?ÿ-ÿïþÁþ¿þÿÿÐÿ!HN‚l\ÍQv¿P†´ñ!GŠœ‚ ÔXNiCä ef†|fFÿ¼þ %w}²q;1UZÎt#ïÿ¦ÿÿ:þoý÷üÒüîüýýÖüŠüüxü%üüüüü<üü’ûEû1ûûåúôúàú~ú8ú#ú#úñù®ù…ù„ùjùùYù'ù"ùùzù½ùëù-ú‹úûzûÜûBüÙü3ý?ý‡ýêýÐýžý¶ýëýUþ—þ~þµþÿÿ,ÿ8ÿ#ÿRÿsÿˆÿóÿkºŸî M™EI€¯Æú"õ¥žw#®ÇÄr{”§ÿ( úí´x´}1ÂXØÿUÿæþ\þïýÔýÂýœý†ý‹ýý¾ü“üZü£ü!ý-ýýýü»üütülüPü*ü¼ûsû\ûûÃú‰úuúqú“úâúÊúMúÿùú:úˆúÏúÜúÛúäúâú&ûfûãû†üývýéý7þAþfþ†þ¹þüþ@ÿÿÔÿ”ÿWÿvÿ•ÿ†ÿ‰ÿËÿQ¤ TT† IŸ´_«X5B?Œá6!É?.ŠÊ·‘§·–:ý$=/GM쿽›=½u2Öÿ_ÿâþÛþ—þ$þÙýØýåýØýðý!þHþ%þüý¶ýLýý&ýýËüØü±üü‘ü~üüáûÑû©û|ûIû=ûBûKûdûXû†û³û¢ûûÑûPü›üÑübýµýÆýþÊþ2ÿEÿtÿ’ÿ–ÿeÿYÿ§ÿåÿ„ÚÏ¿»—ži–Khs¢!°A×J?Ë¥Ìú1]8òÅÖ(-“í­»Ìvêåp9þËËÔ°“eÇ™¨—QñÿþÿÏÿ’ÿeÿOÿVÿIÿ[ÿmÿ7ÿÿÿÿÛþÅþŠþ!þþýýïýÚýÁýÄýµýŒý‡ýƒý4ýÿüãüÇü{ü]ü’üºüÖü«üÄüÝüûü(ý?ýýþ˜þ ÿ^ÿ“ÿ±ÿ!ß îóÑ´½ô*ShltnŸíL”Í*䤻Ì1ÿ CS†¤ªÁÆÅe)ò»„I+YŒT4>I!ý¹TO'Žï¿EË©j’ÿWÿþþªþƒþþ¯þÎþ ÿ ÿ‘þVþ¢þµþ}þ^þOþCþþÈýrý"ýÏü±ü¿ü¤üŸüœüOüü(üHüJü7ü ü9ü`ü_ü‡ü¾üþü<ýqýôýwþ¼þÿ&ÿÿPÿ»ÿ³ÿtÿ¼ÿJ`I=_¨òÒ²ëjÝ5¥+}z…çtÏ¢èÿ bm:À}ebX6.óÖÇì;—*ßðɈI—ÿ7ÿ;ÿ*ÿãþÎþ¶þaþòý–ýˆý¨ýÅýÄýËýÍý•ý[ý<ýbýŸýTýàüØüÏüSü'üCüüÈûŽû…û™û–ûû’û‰û˜û¶û½û¿ûºûÀûïûTü¿üý:ý’ý,þ‹þÌþáþáþ ÿ ÿÝþÿ‡ÿßÿ¨ÿ‡ÿõÿaA_[P—ö'‹õBk£p»Ñ[h›xjV<ÍÄ› Y(ƒäȧ‡1(@&žøÓ™c{ÿÿëþQþóýèýÉýŸý}ýUý&ý ý>ý]ýlý.ýîüÈü ü`ü3üSüjüPü+üüÝû†ûrû…ûdûøú»ú“úuúƒú©úëúïú×ú¢úzú£úû6û^ûÎûüáûæû]üùüoýÂýþ%þ<þþ+þkþªþ¡þ þ¾þÂþÑþõþ#ÿÿ&ÿWÿ‡ÿÓÿôÿE·+K¨Ñ{À¬½Ð°ÞöÚŽŸsøl‹ëÀ{®ÕÚÀ¼ÑòòÄ–‰AçÖüÿ®ÿyÿcÿÿÁþƒþPþLþþÖý½ýhýAý€ý ý¡ýµý|ýDý=ý ýÄüµü«üÍüØüfüü-üü±ûÅûøû¹û<û;ûvûCûûYûoûrû«ûëûÛûÎûÜûåûÌûü”üøü,ýÆýpþ˜þ¢þþ¡þÿBÿþþJÿ‘ÿpÿ;ÿÿFÿ­ÿÊÿ°ÿÌÿ0hPiØ;“ýP„¿ F‚y6ïêhW¢W0è(Ú«‰}‚º×žt§¹¯BÍ€GÅÿ`ÿ#ÿ÷þ¶þ—þ›þ\þ<þsþŠþhþuþpþgþ@þ þ%þ5þÐý‡ý‹ýfý"ý5ý)ýÖü¸üÙüØü±ü–ü›ü{ügü¬ü ü‹ü üÅüý0ýýûüVý²ýþsþ·þºþÅþÿþ1ÿ#ÿqÿ-VCKaŒ“ÏÞÇœ»#Lsþz­€µòôÐàã³á3:R ο L Bh)î1h¨ÁÁ›„V÷Äé ¸OÝ£‡M¶g8=R,•ÿÿ/ÿiÿFÿdÿˆÿHÿ)ÿÝþ‹þ­þìþÖþôþÿ¹þ*þþ(þEþ.þþ(þöýšýsý\ýpý¤ý—ý_ý]ý{ý|ýuý›ýïýMþêþrÿ¡ÿ¹ÿÕÿXiy‰±œWGˆ eÐTY¥wšöT8^ç E©üGpUH£Àœ~y”Ÿ¡móÝÉØÌ¨œŸoh²»eM+ÖtÀ^ âš*ÑÿÂÿßÿÞÿ½ÿ­ÿŠÿ‚ÿ[ÿtÿ¢ÿ„ÿ<ÿóþØþÞþ×þùþ¦þþéýßýÆýÒý þñýcýý ýOýfý2ýAý;ý:ýTý@ý ýý8ý+ýZýÅýþXþ±þÿ$ÿTÿðÿMY\ojKNDESR)V¢Ðv‹Ùf³ÔËî=€¡ÙøïæÚêÖ¶ºŸYÓÝÓͦ¤µºÁà¤C<DJU(¾=Ì„d¹¾;‚ÿ=ÿXÿøþþŽþ´þ´þuþrþ¼þíþ¿þ‹þpþ>þòý¾ýíýþÝýý©ý¤ýtý;ýëü~üNüXüUüŒü¨üÃü¶üüŸüñü ýÓüýOýýþü*ý‡ýþyþ¸þÕþõþòþ ÿmÿŸÿ@ÿÿ}ÿóÿ +âÿÒÿ§ÿ”ÿ ŸÍÑåbˆÃ!da‚Ë ú«ÆÚš«½Ã›b, ËÒ7‰pJssÞ„Zz€ö‹Ï™5óÿYÿîþÜþºþ€þSþ$þïýþQþYþþÀýÉý´ý]ý_ýxýý•ýQýýºü—üœüÂü³ü²ü¸ülü8üüÇûºû£ûŸûÆûïûEütüCü›ûyûÑûÞûòû?üü‡ü•üòü@ýaýÂý/þ3þþ?þkþJþhþ­þ¬þ¦þíþ#ÿÿíþêþÿxÿéÿñÿþÿ¤ÿžÿ*ÚYyiƒ•»Ùé‘ph&"€¨†LÁ†¨Ó~™Eᢣ£HÊÿŒÿÿ4ÿµþ‰þ°þ­þtþ:þþÜý‹ý–ýèý×ý§ý[ý3ý:ý&ýý6ýeý›ýœýFýùüàüÜü·ü„ü`üMü:üü°ûšûàû/üGü]üIü!üèûßûüû<ü]ü•üŸüÂüý.ýHý´ýWþ£þ£þyþxþ¥þÄþ«þ¯þûþ>ÿÿ ÿYÿhÿ£ÿÜÿ§ÿŽÿ­ÿøÿ/oØJ„Ü.UŠ mw“vM?C½—ÑÇì ¢ykºDDûÃ÷ƒBíÂvîÿ•ÿtÿÿrÿkÿ ÿÑþÉþ©þ³þøþìþ‘þŸþ»þ}þþþþãýÛýKþEþðýäýþÅýsýZýSýý ýý*ý;ý9ýyý€ý,ýý3ý!ýý.ý2ý?ý–ýþ|þ€þUþRþ‘þÿ’ÿ÷ÿ Ðÿ„ÿŠÿÒÿ T~:ñÿúÿ)G«Dye[ƒ°Ø #+CgoŒÃÄÛI1'ÖuyªÔäÐM87j—p%7wf'#60ÇpÂ’z]-èÿÜÿ›ÿuÿ¬ÿÿyÿ•ÿ|ÿPÿAÿqÿKÿîþÜþ×þÿïþÝþ—þAþ,þ;þiþšþÎþÁþþ!þÇý—ýµýþFþ2þþ+þnþ©þÞþ6ÿfÿ9ÿÿÿ+ÿªÿ1CH†¶Ã¼Å6Ize.ÇßF›©¹Ð&y¯×ïý(‘ð42H½¬ÕÛ£…¬©‰‚[ô¬ç*×Ù¨v<ø»Ï¿~C ¿“œŠSùIJf$O` úÿßÿšÿ ÿ°ÿ”ÿ}ÿ;ÿÿþ'ÿÿÿ&ÿ,ÿ'ÿãþ’þ®þáþÖþÀþ~þeþ4þñýIþÄþžþUþ]þ˜þ¶þÅþ ÿTÿÿ«ÿœÿžÿÖÿH™¬lI°% íò&KQ{ ˆQh‡ÂùS¨ê6ycþ+Oby]" ñ¶{x–vfh8ùñB^c\}f ÎÁ¢2©seGôÿ+Ïÿˆÿ5ÿ3ÿ!ÿðþøþÿ'ÿÿ ÿÿþèþÕþÆþ¨þ|þnþfþ?þ2þIþ/þêý’ýˆý¦ýtý†ý«ý¢ý‚ý~ý ýÈý×ý°ý|ý‹ýÌýþþúýúýfþŸþ§þÛþEÿ£ÿ¬ÿ°ÿˆÿZÿkÿÇÿ:H!÷ÿëÿBPlu«×í!DÏ\¶„ô )3GfM,¾ÕÙ‘ìâ¤{L6ts»È­]Õÿˆÿ©ÿ¿ÿnÿóþ±þ¢þtþ^þêþ ÿïþçþ§þmþ"þøýþhþbþþíýôýªýˆý™ý¥ý‹ýdý-ýÕü°üÑüßüúüÛüÈü­ü‹ü¾ü×ü¨üÀüýýñüý ý ýuýÇý þ}þ…þaþ[þ[þ˜þõþ ÿ(ÿCÿ'ÿ8ÿˆÿcÿýþßþÚþÿˆÿ·ÿÆÿ»ÿ¨ÿ®ÿÀÿƒFùºâóöF¯•LöÓ¨V'%øÿnóä¯tY|Ï߀ÚÿŒÿ6ÿ ÿÿÿþþúþØþºþ~þþ‚ýPýiýœýÃýñý\þDþ¿ýjýTýXýWýtý§ý©ýoýý(ýDý,ýýåüÉüÕüÁümü_üüªülü(ü5ü™üêü¹üKü5ümü£üüüËýZþrþxþaþ/þJþ„þ·þ)ÿ—ÿdÿÜþµþèþÙþÊþÿ6ÿHÿhÿ†ÿÚÿ×ÿ«ÿ†®°ë4#þ>ƒ4L³äõü²ƒn”È f7&0XxO1ñéÜÀÝÜ|27ÖÿºÿÕÿ©ÿ8ÿÿ ÿ ÿÿéþ°þÒþæþÍþÖþóþ»þpþ‹þ˜þ‘þ—þ„þkþUþ&þþíý²ýÌýþBþþÀýÅý¾ý‡ý†ýÄýìýÁý˜ýžý¬ý•ýƒýïýBþHþ[þ»þîþîþíþ(ÿnÿ»ÿžÿ‰ÿàÿëÿ¯ÿÈÿ;i‡i)Y‹¦á2'Uó3û=–n&M„¶Ç©s;ðónV ãÍÚ$!g– µvS;?x(Õl&þÿ¥ÿŒÿ•ÿªÿ§ÿÕÿðÿÏÿªÿ™ÿsÿQÿXÿHÿgÿ`ÿIÿcÿ¤ÿ¬ÿyÿ]ÿcÿÿºþþÉþñþÅþ±þËþ¤þRþSþ\þiþ¡þžþþ¸þ”þwþíþŽÿõÿ2j=,˜Ç¬¸­¢ÊìÿB’Ò¢¬°š°’¡CHXfƒ¸å=wTWry5ÒˆRÁ˜Ø  ïîò×ø/ï¿Ï•%4XEA<íjý&!>>î‡V‡ybseNR=g3ìÿ§ÿ£ÿ›ÿ“ÿ´ÿ¸ÿ…ÿ9ÿOÿWÿÿÎþÜþ0ÿ>ÿÿ,ÿ1ÿÿÿÿÿ4ÿ]ÿJÿCÿ‡ÿ¾ÿ¢ÿŠÿÜÿ;L­ÎóëÒ©Âóú õÓì#–-Gë¼» Â×íçµ^#+SL%%A: 2TZe38 !MÉoPt„xAÿÎ`èÿòÿ‰ÿ;ÿ6ÿGÿGÿDÿ’ÿÐÿ­ÿDÿöþÿÿóþÿþ@ÿÿNÿêþªþ®þÆþ°þsþ¡þºþQþþ0þPþ?þ$þMþWþ'þ3þTþ„þ¬þxþ{þÒþ ÿÿèþÿnÿÀÿ¹ÿŽÿÿŒÿœÿ©ÿ·ÿ ]EþÿÐÿþÿ9{b==ˆºÝóô4,‹Î©¥Ê öûÓjgš’hG5áØû/Ñ8$>v#©dHwYÿÿµÿHÿÿÿÿöþÿCÿ|ÿBÿõþÆþÌþÍþ¤þ~þ`þŠþ™þ—þ‰þ‹þ^þûýîý!þJþJþZþ™þuþèý ý­ýºýµý¬ýÁýãýûýðýêýÚýÁýÂý°ý€ýuýÎý)þ“þêþÿÿ^ÿ‡ÿVÿ*ÿ(ÿ1ÿùþÒþÜþÿWÿTÿtÿÿ‘ÿŽÿzÿdÿˆÿÅÿùÿ>j\o”¬ÏГlpŽ”°Ü§8.¬ý€OJ´ÿ~ÿ—ÿÃÿÏÿØÿ_rDÜÿŒÿ?ÿ>ÿdÿwÿÿ¨þKþþþòý$þ+þ8þHþJþFþ'þþþûýæýšý°ýæýòýËýµý·ý…ýAýý0ýFýlý“ýŸýtýýºüÌü;ýqýdýOý.ýýñüÌüýAýAýjýÁýÐý¡ý–ýêý?þzþ¹þçþ ÿ ÿôþÉþÁþýþ*ÿÿÿ,ÿTÿzÿdÿÿ°ÿ¡ÿ²ÿÎÿ÷ÿçÿéÿV‘•Ò46IO(Çat©egm‚OÞ÷âȶ­–“­ÓÿßTçÿtÿEÿkÿ¶ÿ½ÿ­ÿ}ÿLÿðþ±þ¨þ´þÐþçþÿìþþ6þ:þ†þ©þŠþ”þÊþÎþˆþKþþþþ;þ`þJþ þ$þ6þþÞýôý2þ"þþòý¾ý–ý¬ý þAþXþªþìþÄþ˜þgþ“þÿ=ÿ@ÿ4ÿ2ÿfÿ©ÿ×ÿåÿ-I/ýÿÊÿúÿYMøÿÏÿkÈÞÃÓ #Dz”ŠÈ顫ȃ„ÒäÒÊŽQùÏBzl›Ì€Fy›…na=àÏ´hY-öÿñÿ¿ÿŒÿšÿæÿÃÿVÿKÿqÿ{ÿgÿ€ÿþÿW:Êÿjÿtÿeÿ$ÿÿÿÿÿþóþòþñþðþ»þuþ þ\þÃþÖþÀþßþÉþ£þ¡þØþ+ÿ+ÿÿûþ2ÿcÿ‹ÿºÿÛÿÕÿB‘\+÷ÿ6¢ŽØÎ±Üà+o*µ|7…IwãV¬©sj?âæí|AGo]‡‚ˆ¸«{…Dòˆy€Ÿ‹4÷('ïë¯^ú•°ä߇ (–»x8?ež«˜káÿ fX XZãÿ¡ÿ¨ÿÇÿÄÿrÿÿKÿÄÿ»ÿ.ÿöþ*ÿZÿ]ÿmÿ¸ÿIK–ÿ…ÿÄÿýÿF¬:OÀŠñ" \?áÜàß,wwz‡AiÈä'oyIñKS‰±Œ„Nš€Ê×ɵ•®ŸGQµše¯Æ®ý®ÝÌ¥¡–q,'üÿñÿØÿnÿWÿ”ÿ¢ÿ½ÿòÿÅÿ_ÿðþ¡þÖþÿöþ_ÿ¯ÿ—ÿ ÿ}þ|þåþ=ÿHÿIÿÿÇþÀþÞþÇþÓþùþÖþŠþfþƒþÖþÝþÂþðþÿÿ(ÿfÿÙÿúÿ¾ÿÖÿ)7BX^C%òÿ¬ÿ¿ÿ'|³ÙÝÓÒ¶d”¼òOx–â‰VžÂõÙvH,* ïAJû»ícofU¼»ü.‹gnustep-gui-0.24.0/Sounds/Submarine.wav0000664000076500007650000017055411244333634017700 0ustar brains99brains99RIFFdñWAVEfmt D¬ˆXdata@ñÿ±þ\þþý›ý@ýêü¥üyühü|ü¿ü0ýÏýšþ‘ÿ¨Ý%s½íÚq µ   # J‡ª—Kÿãütúø×õàóJò ñuðOð­ðñöò×ô,÷æùüüN¿-v } %V“SZ¥4 € s üø¬óuï¬ësèæ}ä ä´äræ9éßì@ñ6ö—û4Ý] û¤UõìZÌSô NDûöô4ïêŒåïáGß®ÝHÝÞGàÅãèMîêôüm¼ ¾9ñ²"M&€(*)D(Î%å!ž©%:øð>è!áÿÚ*ÖãÒCÑVÑÓ9ÖÎÚ§à¢ç‹ï2øEk Cr«"¹(q-»0ƒ2³291.)’"°Â!,þ@ô¢ê’á[Ù?ҕ̧ȽÆþÆ|ÉÎ{ÔvÜ«åÊï}ú~p÷š$ô,•3>8Å:%;l9Å5N03)– ¬Å I±ôzé+ß!Ö¶Î ÉBÅÃÐÃKÆõʸÑoÚ·äð!üM-e )2à95?;B«Bn@’;P4 +/ /v\úHí¦àëÔ«ÊdÂŒ¼e¹¹‰»‡ÀÃÇÑ÷ÛUèÅõÒî{Ù+x6 ?EE*IªJÜI¶F>Al9h/q#©ÿøêݞаŔ¼’µ±Z¯­°µ†¼”ÆÒÒ¨à™ï!ÿÑ)¥,¹9ÀD*M~R‡TISüNéG‚>)3.&à¢ðøgé®ÚmÍ>Â…¹³@°½¯á±¹¶'¾È/Ô,âlñK/ .}:öD>MSçU£U÷QùJã@74Ž%˜ò>ôðãyÔfÆ?º°ù©²¦ô¦³ªŸ±U»aÇeÕüä®õn#)d8rE·OäVÜZ®[tYlT³LnB¾5þ&§\âóíâ5Ó<Å_¹ê¯ © ¥0¤Ÿ¦r¬|µwÁÒÏåßñŽþÓ$4™BeNRWÔ\‰^c\V{MŸA›3ö#;ÜcðußÂÏÂʶ“®”©ß§B©Œ­…´¾èÉÔ×dçø4 ´)Á7¾C^MdT™XÖYÞW’RîI5>å/­NŽüë‰ÚNË×½š² ªª¤Â¢ˆ¤Û©ƒ²û½¹Ë>Û ì¸ýÁ“!v2¥AFN°Wg]M_ˆ]xXqPéE<9³* x Ñ÷eæñÕǺo°©›¤ê¢$¤k¨¸¯î¹ÊÆÏÕ\æ°÷* 0H*9FØPÖX‰]ˆ^›[éTÍJê=ä.q/ ›ûBê™Ù9Êͼö±4ªà¥ ¥Ÿ§J­´µ~À_ÍÜùëÆüÀ -=-O:àD¡L}QjSbRmN“GÛ=Š1#ìIñ+áTÒ2ź+±Âª(§ ¦M©.¯¸]ÿЄß1ïYÿ‘µ.d<çG•PÛUjWKU¿OFGN¿E&a/¹6<Ò7†1_)ÑG Îþ•óÏèÏÞüÕ³Î\É1Æ]ÅÜÆŽÊ+Ð|×/àêóôr9 Ï»"w,š4Î:ñ>AA(?Y;¹5`.p%?#ž"ù îñãÚÚÓ½ÌÈ_Å×ħÆÝÊSÑÌÙÌãåî˜úu&OŒ'€0Â7÷<Î?$@>¨9[3i+5"" Ø}ö†ëiáŸØÑXÌ@ÉCÈFÉ1ÌøÐŒ×Àßné9ô°ÿV ¤!!k*O2“8=¡?@@>:°3;+&!ê çýüñžæ ÜËÒ ËDÅÖÁúÀÇÂÇÈÍaÖ}àÄëÓ÷^û:Ž(2…:?@yC4D‹B°>Î81È'­÷:ë·ß‘ÕÍÆ‘¿J¿FÁ§ÅaÌHÕà!ìù=,ƒé*5ª=ED‡HJºHgDe= 4á(]û2YóëåWÙ.ÎýÄ?¾Cº&¹Øº'¿½ÅPΖØPä&ñÀþ“ ©&Ì1;8B+GæIZJyH5Dˆ=}4Z)€‚Àñ"ä׋ÌCü.· µÞµ²¹cÀ¡ÉæÔ±ánï¨ý —'î3Ž>öF¡LLOÉNTK!Ež<2ã%bç ñú ìÞÑ9ÇQ¿ ºa·I·y¹ö½—ÄbÍ(ØžäBò‰Î~')v45>.FL–ORPúM}Hê?¨4O'†ñ.ùºéÛÐÍYÂT¹8³i°±Þ´ž»ÉÄÚÏUÜáé2øÝ=$Š1-=ŒFRMEQuRîPÒL5F(=Ü1$¥À¦õæ×¾Êò¿X·2± ­Û¬¯x´Ø¼ìÇ8ÕäÝó÷îS#Ï1ø>HJ%SY—[€ZØUïM>CM6“'Н~õ•ä¥ÔlÆ«ºã±N¬ù©¯ª1®+´m¼ÇÆÓ2áð£ÄD . ;”EóMíSWW×W=UYOLFO:,\ }ú ê„Ú[ÌÀ絘®pªÊ©¨¬Ê²Ê» Ç@Ô¦âëñ±—!–/h<òF´NdSâT]SOHÉ>I3ê% åöçVØSË[À´·„±ä­ó¬Ð®—³N»½ÅƒÒ á©ð·¢í9.%;SF=OXUDX¬W†SýK‹A²4&9£Åô3ä‰Ôlƺˆ±Å«T©&ªí­_´½ÝÇfÔ|â´ñcy 7. :²CîJÁOR®QŒN“H¼?Q4µ&”‚÷îçHÙ Ì„À'·U°¬é«É®î´¾uÉ®Öå9ô‘Îy!/;ØDáKæOÁPƒNuIäA#8s,'”Cºñ³âÖÔÄÈ뾉·ª²X°ž°n³Ë¸»À˘׹åÐô@a¶!Ç.F:ÛC9KôO¹QLP¦KçC€9î,ˬIððàÒ’Åź¬²À­9¬®Û²LºðÃYÏ(Üê½øµrM$©0;ýBlH=KŠKSI Dt=í3I(ñx …ýÉîÛà-Ô É¿¿ƒ¸Ÿ³d±²Âµy¼ãŇÑÄÞ í¼ûn ¯ &`2ç<=EáJ€MþLgIøB:(/’"³é¶ö¨çgÙŸÌêÁ¸¹_´Î±ú±¶´Ö¹6Á¥ÊýÕçâøð˜ÿ,Þ(!4š=EYJ0MUMJÔDD<>17$Ö´^÷SèðÙ®ÌÁz·™°É¬F¬¯ µ®½yÈÕÖâŒñ¿ö²J,"8¤AHL°M+L"HÇA79Ž."!K-ösçÇÙÍMÃýºÖ´ü°¦¯ü°%µ¼ÅŰÑWßîtýÖ ÃÙ)™6’A/JøOR¨QyMKF„<±0O#ЖöµæØÙÊ¿µ¶¤°„­/­Œ¯V´t»³ÄîÏÝÜ/ë]úÎ ÏÓ&[3>FÙL‚PbQCOJÀAÆ6š)ÞB gûÛëÝ=Ïñ‚¸{°K«?©‹ª¯¡¶µÀÐÌ—ÚéVùw `x(ø5+A‰IÇNÏPÇOàKtE¶<ê1@%ãPøéªÚÞÍðÂ*ºœ³[¯„­S®ç±[¸šÁoÍPÛ›ê®úß ¬ );7üBpLøR.V¹UŸQ#J¾?3«$4%èôêä±ÕØÇ÷»¢²@¬©©ì«œ±¶¹ÄwÐ¥Þ/î•þ-/é-´:0E M[RÏTiTQ¼JvAˆ5l'Öw ÷ç%Ø~Ê[¾´¬Ç¦•¤»¥Lª²Ã¼·É€Ø§è´ù0 ˆ- <ŒHíQ©W›YïWùR8K#A5u'ƒ¬xøŒè™Ù=ÌçÀÝ·F±­E«ï«A¯Gµ¾uÉ×MæyöÕÒê%­3»?“IÎPðT U¤R+LBi6a(&M Tù™éÚ´Ì‘ÀÀ¶¸¯Á«øªO­n² ºÙÃ’ÏñÜ¥ë@û, ¼ )Å5@ÓGÙL/OÃNºKýE§=Û2ì%køSøéÔÚÜ͆Âû¸“±¬gªE«X¯¶rÀ±Ì©ÚÛéÆù %•)³7ËCM"SyU(TrOÏGº=¸15$4‡ö0çÎØÌ_Á+¹³g°½¯c±[µµ»oÄmÏ_ÜÚê0ú° ¶±&E3>×F)M¶P&QDN HÇ>ô2F%h¡÷°èÚœÍO¹|²Ë®/®“°Îµr½-Ç҄ߘítü­ ¢¦( 54?·FsKdMšL4IECú:v0$DMøßé{ÜŽÐPÆà½`·õ²è°u±Ü´»óÃÏÜ:êù(g%£2*>aG®M¥PP)L8EÍ;j0¡#Ø…ùßê–ÝÆÑúÇ€À»æ¸¸DºÖ½?ÊʲӞÞëaø‰ +k4À;á@‘C²CA¼;×3Á)„œì÷Õë¬à¦ÖûÍ÷ÆïÁ,¿Ø¾Á€ÅÌUÔóÝœèô 0 <#-ñ4—:¹=U>„<‘8“2à*¥!&¼ ÞÿôðèìÞUÖUÏõÉ0ÆýÃaÂĔǣ̷ӘÜùæcò]þl 6Z!y+.4û:y?GA9@P<á5[-X#bö s:öë¥áýØ×Ñ…Ì)É»Ç!È)Ê—ÍTÒNØ‹ßè´ñ/ü!ñ õ$A,»1<5¾636ª33/ö(4!UÈû¸ò—êRãÿܲ׈ӶÐyÏóÏAÒLÖóÛÿâ%ëô«ýu1a˜"Y)4.ç0R1‘/ß+ž& ÄÙ©q{ø ñeê°äàƒÜñÙXج×ó×XÙ Ü4àÛåïì0õAþ°Æœ!1(*-I0U1;0-ç':!u‘?`øñŠêÁäÝßûÛ?Ù¿×~×دÚÞnâäçkîäõ'þéº žÇ%D*î,µ-¸,*Ñ%[ ݦ \øûõåîké±ä²àoÝùÚqÙÙþÙ]Ü=à„åì¾óüã± !¾$Ø(¬+u,.+(#Ï|âN ýþ€øtóäîÞê[çfäâ`à~ߒߺà,ãç4ì¦òúB   „#c&''ì$t!Ògƒ šÚú!öÈñØíKê(ç•ä®â¡áŽá©âóä}è;íóäùIíe9f!'$<%ª$¤"e<qNû ±€~üª÷óîOê[æÑâêßÝÝíÜSÝ;߯â¡ççí<õIý«ì «uñ!Û%(„(F'•$¬ ßn˜• }rþ’øãòˆíèä7à ÝÈÚŠÙ‡ÙäÚÈÝ*âþçûîÙö3ÿ´$šê"â&_)Y*Ò)Ø'›$G ˜¥]æøñ]ê×ã?ÞÛÙÒÖ@Õ$ÕvÖÙÝâEèTï÷2ÿQ#Q í!"&.)+‡+­*d(¯$¡nIx 8ÇùcñOéÖáDÛ÷Õ<ÒPÐIÐÒ¦Õ¨Úëà$è!ð°øŽz %,?" (d,$/J0Ö/Æ-!*é$>LX Îú°ð÷ç;à¨ÙdÔÐ7΄Í|Î6јÕrÛˆâˆê+ó-ü_œ©P "(Ã.Ã3Ë67(6Š2ú,°%&‡ýƒòè£Þ°Ö|Ð'Ì«ÉêȾÉ̹ÏÎÔIÛ ãìö|! ŒaF(ì/ÿ5$: <ƒ;m8í2A+æ!aB ÿýõëóámÙ4Ò|̃ÈfÆ0ÆÙÇCË\ÐöÖøÞ@è¥òäý’ He q*é2g9=j?Â>¬;56©.O%éõ'÷ìëáÙ‚ÑtËòÆÄÒÂoÃþÅ{ÊÜÐÙ¶â·í¹ùLkÝ*Î4°šEwI"J¥G@Bk:0T%4£ Ëó&èhÝéÓÉËNÅÀ¿½à¼¾fÁùƼΖØ9äCñ!ÿ3 Ðe'p2~;Ê5¨*º’óòåÉØ2ÎwÅξfº}¸>¹Ò¼ÃÏ˃֯âËï\ý q[%Y1õ;—DÐJ2N†NÌKFFA>(4E(÷¨ ÅýêîÊàÔ„ÉÁd¼ºEºÞ¼™ÁEÈ»ÐäÚ|æ-óq² n+&”0p9£@øE6I J7HŒC <*23&ÞÍ ™üÆîÅáöÕØËÊÃE¾»¼`¿`Å‘Íc×_âîDúØ¡€)ý2¦:*@\C,DÂBA?À9i2R)¸åR˜ùEííá ØóϹɊÅuÂÃÒÅ`ÊÑÕÙänïQû?ÛÒÝ'Ç0K8 >³AýBÄA>8#0§&ù€ˆsø¡ìžáÚ×éÏ(ÊãÆƱÇgËÑ'دàLêÆôÈÿ× |;µ'§.ð3Œ7~9¿9U8 5ì/ö(g á ä ö¼ë@âãÙßÒ„Í!ÊóÈ#ÊÃÍ›ÓUÛ‚ä©îUù-Õ u"Â*†1s6O9ý9™8H5Q0ï)b"Ñkn+üòrèäß´Ø'ÓeÏkÍ=ÍÙÎ;Ò]×%ÞeæÈïëù@_Úh Ô'ñ-¤2Å5)7®6<4è/á)o"ë³`ýÀózêßáBÚÔ¢Ï7ÍüÌäÎÂÒYØgß§çÑð¥úÉÜaä ú'd-ü0Ô23¸1 /+Ê%=ð²?üúò;êPâ_Û¥ÕBÑ€ÎÍÎÍÑ×+ÞÄæcð–úçœX!û(&/˜3 6^64÷0±+%‚&2 ßRùäïóæÝÞØÎÒRϱÍÝÍÍÏlÓ®ØyßžçàðÝú_ q'ç,Ò083403¤0_,„&Iÿÿ  1ûíñ éÃàaÙ<Ó³ÎÌŸËdÍDÑ×KÞÁæðú8Y Ü b(>.0234Q4¹2¡/4+‘%ÒNôSûÍñÍè¤à›ÙáӈϽ̟Ë[ÌÏÁÓKÚ~âÞëúõPy ( %Ñ+21â4°6y6:40T*,#óîS[þNô„ê`áWÙÒÒ$ÎxËØÊ0ÌZÏ#ÔlÚâ°ê2ô6þJøÌ"Y)y.244¸4‡30Ä+?%6 ¨ÿSõXëâ“ÙYÒ¦ÌØÈ.ÇÍÇÁÊáÏØÖJßÑèóÊý <GY&ü-×3¢7Q9ç8ˆ6p2Ð,Ë%Œ: iÿµôhê÷à»ØôÑÈÌ@ÉmÇdÇ8ÉͺÒ=ÚMãíbøvZºN"×*2Œ7#;ƒ<ƒ;*8©2R+|"—þ é÷ íÈâ‰ÙÂÑÈËæÇ4Æ®Æ+ÉyÍaÓÄÚgãíš÷‰n ØO!x)05L8­9-9µ6:2Á+‡#Ö)ÐøîùãÚÚìÒfÌÇ¶Ä Ä¸Å«ÉÄϦ×álë¥öU'½ž$E.*6Ö;ö>ˆ?¥=9‘3û+# !Ÿìö‚ëáà~תϘÉ^ÅÿÂyÂâÃDÇ·Ì/ÔÝSè1ô™ø ç$.µ6={BñDÂDËA/<@4p*E;Â9úèí*â`×ùÍqÆÁ@¾â½ÿ¿WÄ­ÊÌÒzÜç¼ó¦Ó Ÿv&Ä097?C¤DçCú@Õ;‘4J+R BHú¶íâx×UÎÂÆÁ\½#¼{½†ÁÈóМۗçmôµ_(`3ŒÛAQCKB©>…80â%YkùôéëÝôÓ…ËðÄ©ÀÒ¾¿ÅÂEȺÏÍØ4ã¡îÅúM½Z*r3:-?†A€AM?;×4ô,ƒ#À ñÚôCéžÞ<Õ\Í*ÇÓƒÀjÀ°Â`Ç^Îk×âî–úRÝų*24Ü;IA*DKD­A<5î+[!Ä ý¬ðÕäûÙ›ÐÉÂïÀá¿EÁ¯ÄÊÑ×Ù äcïtûÇØ$H)è1Ø8ã=é@¦A@<¶5&-Ä"n ŠýÅð—äYÙxÏAÇÁM½¼‰½ƒÁËÇÐêÙýäâðMýä -Ä! ,Ü4”;@ BÑAA?:Ú3Y+A!ä  øüjðyä£Ù/ÐqȌ¼¾½¸½³À ÆŽÍüÖäáÙílúˆY9*½3Š;0AeDòDÉB>à6É-#D ýØï4ã—×ÍÅÆ¿u¼»û¼”À#Ƌ͗ÖáºìùÊ8ï}(’1å8J>’AŸB=As=?7ß.$ïS Rÿmòþå~ÚEнÇ4Áý¼H»8¼¤¿eÅ$͉Ö?áëì1ùÅ5Ý( 2z9ž>eAÆAÓ?¢;a54-_#%÷ Kÿ¤òæ[Û”ÑhÉÃÁ¾‘¼§¼¿ÎÃÄʱÓ3Þ×é/öÐLKg&H0‚8´>‚B¾CWBd>8Ý/ý%ÕÆQõÍèݰÒʈÃT¿~½ï½ƒÀ Å[ËGÓ™Üçkò+þð <¶)û0?7±;>R>9<Õ7?1Æ(ȹMüÁðÅå¶ÛàÒ¡ËIÆÃ(ŠÃÇ̾ÓEÜÚå4ð ûåF$,2"6H8a8‰6Ñ2T-+&žö  ÿ›ôÌêáá$ÚªÓžÎË8É'ÉñÊ—ÎÔõÚ/ãCìîõÙÿÀ ZTd$*+[0¦3ò4=4ª1`-ª'½ äF1éýÇô!ìTä Ý8Ø3ÔÑEÐPвÑhÔ~ØÐÝWäÈëäóVüÑ ÄÊÚ!Ë&`*m,Ñ,Š+¯(v$ Æ×z Þ-û«ó‹ìæ‰à!ÜøØ1×¼Ö™×§ÙëÜFá¤æÚìÂó ûvª gy´ú9#T%A&æ%<$S!BAu" ¯þÛ÷4ñ×ê åàÜ`ÙØؘÙaÜPàXåCëìñ ù 5®>¾#F%E&&Ò$]"É"Dxskù–ò.ìSæ8áÝÚMØþ× Ù®Ûßkä/ê¨ð÷¼þôû –}]" %l&—&w%4#ÇO׋šLêù¿òì-æ>ácÝÆÚtÙ‹ÙÛÑÝááç í«ó¦úÀºg˜#o%i&&]$j!M2E® ŸZýö/ïÝègãߨÛÚ…ÙgÚ•Ü à©äKê¾ðÕ÷=ÿ±î ¨­Õó#à&Œ(ß(Õ'`% !¯¾ü´rùýñëºäcßCÛzØ&×Q×òØõÛ6à’å×ëÛòUú¾ âÙÓ"ª&>)…*\*Å(¾%\!¸œ ·¦ýÁõHîvçšáÌÜGÙ׃Öf×¾ÙxÝsâuèOïËöªþ®•Γ"'4*Ê+Í+R*^'#œ(ï6>VøÄðÐé¤ãzÞnÚ­×MÖYÖð×Û‹ßVå7ìèóüŒß Ðk"Š';+]-Ø-¦,Þ)ª%,  9* ±!ùÀðéèñá(ÜÂ×êÔµÓÔÖŸÙ’ÞÑä)ìfô"ý¹ÖT$I)å,/¨/˜.ã+Œ'Á!µ³  ø4ïÎæ&ß‘ØWÓÎÏ7ίÎ1ÑÕ°Û'ã®ëõÅþªU[Z#ä)Ë.×13`20@, '‰ òmIÓýkôlë*ãèÛÅÕüÐ®Í Ì5ÌUÎ|ÒœØuà§éÆóVþë!£%%a,2ä5«7J7Ð4\08*¸"³¨)ü„ñç>ÝÔ„ÍȽÅSÅ*ÇËќػáì[÷ª™W#ˆ+õ1‰6L9C:u9Ô6L2ä+·# 8»øì{á0×÷ÍÆÀV¼6»û¼µÁ"É×ÒFÞäê,ø£á+ñ4Ñ<(BÍD±DôAá<Ï5-Û"q çýðˆãf×±ÌæÃQ½¹·ž·˜ºÀæÇÒ9ÞÜëKú×ÞÑ#T/!9û@¿F JéJáHD<¨2è&×ç Žýïèà_ÓÇm¼<´¯­®G³âºéÄôЋÞQíÐüŠ ç2*Â6A¥HyM O&OHLG±?6G*Àì gþæîþß=ÒÆ‘»0³ ­Û©ª©Û¬z³d½ÊåØ éÙù¥ î7*8D…MTPWW‡SàL˜C,8+‡÷ ·ü9ì'Ü6Í!À”µü­™©j¨Nª¯§¶ÄÀ9ͯ۰ëœü¯ %c-å:WFrOVÑYŸZ7XkR`Ii=/üë ~üDë´Ú3ËH½|±t¨´¢« ¢+¨:±)½lËvÛÇìâþ:.#4æB/O8X×]ò_´^WZ'SWI=£.UÀ ©úÐèØßÈÞ»L±B©÷£’¡g¢¢¦\®s¹Çü×ÿéÁü’Ó!3£B"PöZzb?/s 3ø‰åªÓZÃYµHªª¢·žrž•¡á§ÿ°Å¼àÊÛÒìÿÊ$¬5zDÇPPZå`Rd|d'aMZãOMB2  ÁùçvÕlÅQ·«Å¢]³›ž-¤ì­«ºÌɲÚßìÈÿê±%V7GT¼]qc-e ci]›TIH;y+Í=õQãÐÒhʸ•¯ƒ©5¦¿¥¨Y­µ£ÀCÎéÝçî„úÊ"t2•@ÇL†VW]·`N`ï[ÎSjHb:r*Q¡èõ¯äƒÔóÅ®¹M°6ª“§a¨d¬1³U¼ŠÇ{ÔñâŽòÚB#¥1V>´H}P—UéWfWûS™MPDM8*I pø4è)Ù½ËAÀû¶6°A¬d«Ê­c³é»öÆùÓZâ–ñ@ÿ` ï.<#GˆOÓTªV"UoPðH? 3k%{µ¤öÿæ{ØÐË€Áҹ崰²³ÈµÞºAÂÕËQ×aä}ò‹jH*è5@OH`NÖQMRƒOjIK@œ4û&Šçø²ébÛgÎTäºÔ´²²ÙµØ»ÄÎgÙþåsó{¢b/*l5²>©E8JSLL9I Dg<‹2–&Œ Êûpí à ÔñÉÀÁ½»¸õ¶¸â¼ÇÃëÌå× ä/ñ•þ Ló%«1ë;+DõIÙL³L•I¶Cy;:1_%@M ÷ûÓíà¨ÔÛÊvç¾^¼}¼¾¾þÂÉãÐTÚ.åñ‹ý# T½!, 5‹ÛËå.ñý8 4“ Ó*ƒ3?:Ñ>+ATAa?b;v5ª-5$Ow "õôxéß3ÖùΆÉõÅhÄñħǃÌ[ÓßÛ¯åOð_ûy]΄%*.c5¸:Õ=}>‘õ=­;P7ÿ0æ(o 5ÿ¡ôŸê{á[Ù‚Ò;ÍÙÉȬÉÍ€ÒßÙÂâÒì´÷º$è$.•6ž¢d£¨¯¯ º~ƪÔäô;°$%Ü2O>GMPP\NÃIµBY9Æ-V ˆð5ò÷â´Ô¶Ç^¼ô²Ø«n§ ¦.¨À­¶YÂYÐêßdðŽ=!¥/;23ï%r)ˆø×èÙöÊå½ë²Çªû¥ä¤u§q­[¶ÂÁÏøÝÝí^þÞ·,-‹9bCcJ‘NüOïN†KôE2>Z4”(3­ –ýŽî%àÈÒÇÆl¼´ý­«ª|ª¦­C´¾mÊÖØèÃøú´r'Å4'@"I=O,RçQ˜N‚H@Ì5ñ)ć“ÿDð:áӄƼ:´¯Å¬:­z°n¶ ¿)ʂ׌æ“öÒ{ð$¹1’;’/Q"ûøªõ`æq×dÉß¼‹²*«E§'§Àª»±»ÞÇîÕWå“õ'uÇ%b3¨>/GÄLxO†O9MËHQBá9|/P#± ø>é2Û^ÎÃt¹õ±÷¬Ïªà«`°D¸;æÐÊßãï86h]-¶9öC¶KyP"R¡P1L#Eî;þ0ž$x@ùÙéÔÚòÌåÀ?·z°¤¬Û«é­Ó²aºsÄÏÐ߸îëþèïi+÷6e@ G¤LSOŒOMêG@á5¯) Žþiïsà ұĹæ¯×©h§Ó¨ì­H¶NÁgÎèÜaìMü3 ½)6@VGÁK|MªL°I¬DÀ=î4D*ß †­òIäåÖýÊ×À³¸Í²v¯à®W±ë¶Œ¿ÎÊؼæüõ?ÿÕ!q.‚9›B^I_MlN|LÃG|@'7,ÀQaõ¿æ¾Ø ÌOÁ¹°³1±‚±z´ì¹•ÁSËàÖùãò°¦ì(–3rNöÌèHÜ,Ñ·Ç"À™ºK·d¶¸w¼yÃËÌØäëñ‹ÿ 0&'1|:ºA|FzH˜GöCÓ=™5®+x GoKúIíîà»Õ7̼ė¿Â¼;¼Ò½€ÁÇÎáײâ·îyûióž +4H;°@DEšC?ü8'0w%n— nÿXò«åºÙïκŒ¾è¹þ·ÿ¸Ã¼ÃeËÕñàdí|úÝ‘!¹, 6(=ÙA%DDëAÀ=¶7ã/_&kdÁöÇémÞUԬ˨Äo¿C¼S»à¼ûÀšÇ‚Ð:ÛEç"ôKZí¨è9Š@DíEmDL@Û9{1¡'¥Öƒý÷®ëà¬ÕéÌ#ÆŒÁ3¿¿ìÀ×ĺÊzÒûÛøæóµÿQ ZK#Ý,É4Þ:? AÍ@->)9ë1Ó(EÂǬúÎîeãÂØ5Ï9Ç8Áœ½¨¼o¾ÌÂzÉÒ3܇ç¬óR SŸ$l..6¨;¼>?>µ:œ5á.§&qoû ðVåªÛSÓiÌ Ç”ÃüÁ‘ÂsŰÊ!Ò}ÛGæøñþ% ̸ …*Ý2W9“=H?W>ç:55¬-»$È1,úûîväæÚ¶ÒNÌçǮśņÇYËöÐ6ØõàõêëõV³ w(!k)0÷4 8H9™8î5C1³*~"ÿ¨î6ùØîåÜ'Ô›ÍÅÈöÅvÅVÇŒË×ÑÜÙ9ã‰í{ø·ã“Z#¸+B2¥6Ã8ª8ˆ6—2!-\&q†Ó ©e÷síHä6܃ÕPй̾Ê|ÊÌrÏÂÔÙÛvä8î¨øPÄ ¬Ä Ê(s/x4’78"7|3Ö-{&ØSK Òõíë«âpÚÓŒÎrËgÊdË:αҜØÑßèVñ7û^\»!è',-º0”2¾2<1.[)#†ï« *ÁöÁígåâÝm×4Ò~Î̸̚ÎÜÒËØ?àÎè(òâûÁq¤ú (Ž-1¤22¡/†+&YÅo›zýgô½ëèã-ÝÔ×ñÓœÑÒЊÑÍÓ’×ßÜ€ãKëÞóØüÓcRex#n(,M.Ý.«-±*&é¡„ßïþöIí$åâÝìךÓ3ÑÀÐ9ÒdÕÚÂßgæ¾í–õÅý “0®!Ò%˜(û)*½(#&E",òÎ øðévã@ÞÚ2ׯնÕ[וÚAßåÙë)óÄúmî %η™"@&~(:)|(W&ð"kä{V «¿ûèó‡ìøå„àVÜ…Ù Øé×Ù]ÛåÞã:éºïÁöþg} )@«J#ã&E)A*²)‹'Ô#½€b¦ ‹XùGñ¹éîâ@ÝÙcÖnÕ ÖHØÀÛHà»åíëÃòú©K ¡ttr"L&è(7*8*Ó(&ê!…±ÔÃþÆö(ï%èõáÏÜáØYÖXÕùÕ2ØèÛéàüæÚíHõýÚˆ 壅 Z%æ(+­+Ô*Š(ß$ëͼñ ­Pú7òºê,ä»Þ ÚÝ×Ö¤Ö%ØüÚ-ßäÚêùñ™ùv> ÇÁ l#¸'¶*>,2,‡*C'"™žß ¦:ýâô÷ìÀå–ß´Úa×ªÕ‘Õ ×úÙ(Þrã©éœðøçÿ¸JNˆ¿!Ê%Œ(**½(ú%×!té€x6þÿõ6îçëàïÛSØ1ÖªÕ½Ö_ÙaÝœâÑè¼ï÷°þK© žêV ¬$º'^){)(7%!—,ø ;?þOö¼îÓçæá)ÝÉÙâ׆ףØ5ÛßäêÐðø\ÿ«¡ ¼["%z&’&E%–"R ªþüsõHîÆç,â´ÝÚíØÌØ-ÚòÜáæòëaò&ù Í> NŽ¿Ë!›"+"‰ ´Ëê7á$Eûƒô-î}è´ãþß}ÝKÜlÜ×݉à]ä/éÅîîô]ûØ× ùRÆEÁ)„Äï m ËÿyùPóírè+äñàåÞ#Þ«Þzàrãlç&ìxñ'÷öü·6K »pAíÄ“w}Ã^ {?ßü“÷†òôíêßæ¢äaã&ãûãÓå£èAì‡ð=õ0ú&ÿâJ6 Ž@?wè}B3n ÏWÿÒúmöMò£î—ëKé×çDç¤çÜèéê¡íøð¿ôßøýdu. W Þ°Ç+àú…Š Å)gý©ùöÉòïï¢íúëüêÀêBëƒìmîïðäó$÷úõýG^+ —  ö :ë ö | ƒ -ƒ¨´þÆûõødö5ôƒòPñ½ðºðFñTòËó¡õÃ÷úwüÓþÔ/.Ë ñ‚¼ªL¬Ùëþéüöú!ù{÷öõ}ôUô¬ô„õÊökøXúkü‰þ—gbo) ~ p ùín§¯‰ÿQýûøø÷‘õzôØó¯óñóŽô|õ«öø³ù‚ûqýwÿze$£ÞÀU ‘ i àö²HSVÿfý™ûôùŽøj÷•öööZö÷,ø…ùûÎü–þW·6~},s[æù¢_‘ÿ³ýæû9úÅø ÷×öoöiö¹öb÷]øŸù!ûáüÈþÇ»–F¶à¼ L ˆ g ã ú° "ÌÿýWû:ùA÷ˆõôó¥ò´òWó‚ô öøJú¥üÿ{Ó  ¾  î Y P Ú ÿ Ì Nw:ãÿˆýIû@ù|÷ö õ\ôô+ô¬ôŽõÚö‚øuú£üéþ<|œ‰6 ˜ ˜ ) G ß  À :#ò²ÿmý8û.ùc÷ñõìôeôaôÙôÀõýö˜øeúpü›þß,dtL Î ÿ É )  › ¤ - Râ2þ•û#ùðöõjó:òñJñ©ñ¢ò'ô2öŸø\ûEþJVL ¡ ÅgnÑ’¯F_  gzYÿêûáø"öÕóùñ­ðÚï‹ïÀïvð®ñró³õgø{ûÌþ3ãð £ß˜›àRøß2  ñGÿ¤û&øéô ò­ïêíêì¥ì,ídî:ðœòyõ¸øLü$ É ( GױŰuä ÀJ±þ0úëõýñîë é?ç?æ-æçéìãïkôfù­þx ª~ÃCÅ!OXEJ€  œÝþú=õÙïëçäúáëàÔàºá ã‡ægê/ïÁôÕú0‚” )![«"/##®!ô !rH ÒIýÍöŒð³ê€åBá&ÞaÜÜ9ݹßhã è¶íôÚú T jðš'!x${&5'¬&ñ$"þÕ±» L§ü.õî¤çöá(ÝZÙ¼ÖÕäÕç× Ûâàtçï9÷Âÿ[ÍØ( &~+Ý.e0 0Ø-*¾$GÞ«çÎü­óáêçâÜŽÖ²Ò{ÐèÏäÐeÓ`×ÐÜ”ã‚ëXô¿ýG‹-ý ³'/-B1·3h4(3ë/À*å#·ŒÐãþ õŠë â ÚÚÓ©ÎcË)ÊËÎìÒXÙáÄéKóZý«Ø…,$}+1è4Ú6ÿ6]52$-¦&²‚v îvömì>ãÛ.ԢΉÊ#ȦÇ4Éí̺ÒjÚ—ãØíÄøóÌ×#Á,-4ª9Ó<‚=°;Œ7q1´)º Ò@ L>ö{ëuá Ø^ÑõËÈ*ǪÇöÉóÍŸÓÜÚ‹ãpí3øXiæp"Ê*¶17¨:U<ç;<9J4J-$is!ÍøßíŒã$ÚüÑpË߯†Ä‘ÄüÆ£Ë2Ò[ÚÇã*îIùË[€Ã%›.¡5„:0=¬=<’8M3e,$Q¥q*ù\îoä­ÛOÔlÎÊYÇiÆtÇ£ÊîÏF×Xà»êòõŒ" Vç"n,4Ù:î>@d?Æ;ã5+.%ð5óùï¶äsÛ­ÓµÍËÉðÇ&È?ÊÎ}ÓlÚÆâPìÈöÈÝ }E!Ï)ù0Š6o:}<<˜:u650(ὃýšòHèÕÞ~Ö‹ÏSÊ.ÇEƶÇkË4ѵؚáyëö$I .e!n*ê1s7Ö:<5;p8î3Ø-^&ªî‡ âþtô±êâœÚ´ÔMÐyÍFÌÏÌ7ωӴوá®ê»ô/ÿ¡ ·%²% -õ27(99 62È+û#xl>ý4ó¨éá¤ÙòÓ0Ð|ÎÌÎÑèÔJÚôàÇèŠñû×êN z'/-T1Þ3Ö44µ1ž-é'¦ -Ò,ûŸñ²è¤à¯Ù ÔÿÏÃ͔̀ÏtÓ?Ù“àéAòêû¼sÆ]!à(ô.S3È586É4—1Ö,¶&_ûÍ .úšðÄçàÓÙ.Õ,ÒÛÐÑôÒ\Ö^ÛÒá…é+ò\û°Ê \,%é*q/v2¶33S0¥+D%‘ߢ "·ø¦ï9ç»ß”ÙÕnÒÊÑÓ*ÖÍÚ®à’çAï÷8 ”†Š F&‘*N-‹.N.¤,•)0%r“¸5nÿÏö¢î0ç½àaÛQ׬ԤÓQÔËÖÿÚ¿à¶ç•ïø÷‰ Aúûþ%½*ì-e//ø,C)-$õÍìƒÖý3õøìƒåAßlÚ0×”Õ…ÕñÖ°Ù²Ýãâ'éWð*øKd0g¯"ê&*ì+W,6+`(ì#óÇÇRÀý^õhíæ¹ß„ÚºÖœÔSÔÓÕ Ù¯ÝãPêÄñ¢ù»× ¬å)7$Ó'ç)t*)R'Ý#E•û¡ ÇÏû ôÔìyæáàÜØÙئףØÛôÞ0äŠê¶ñgùF xaÏ"ß&)¥**ê';$DC `oûœó*ì{åäß±ÛÙ"ؼØÌÚ&Þ¤âèjîcõÈüL‘ K7ì ž#2%©%ù$#ÊYËSBô²ù¹òIì‹æ®áçÝqÛtÚÛ\Ýá æì»ò¸ùÌÊ{µ:Å"$­$Ø#¾!|KG“N °èûEõï”éå±á}ßvÞ¥Þà‹â5æïêšðñö¬ýsö ûSàK!ú"|#¹"£ >¯-ô N{ÿ¯øòìœæ,âèÞ Ý¯ÜÒÝYàäÊèLîkôòú»‚ 3D"!¸"#C"_ x¡êjT ß^ü ö;ðë²æ,ãšàߤÞm߀áÍäIé­îÀô6ûÈAf Â! "ò ‚üƒdÊ åÚÿÉùîó|îºéÛåãƒá'áöáÛã·ævêï5ôéùìÿø½ ˆ6ì­n%Òv³š õüXöóðìÓçYäÏáhà7àRá·ãHçËëñÐöÝü Ý!¤$‰MÙLÑŒž, XSýa÷ÃñÉì›è^å,ãÿáÍá“âHäñæƒêçîôšùoÿ@Ó ö{›Íõð©#†ñ¶ /Wü¶öfñ¡ìèdåKã\â£âäˆæÞéëí}òŒ÷ßüaÒ ´¯»ÌÏÕáLÇ‹¸ ‚&ÿîùõ­ðïìêéšç æOåkåsæwè_ëïtóFøSýhi! |>HbkWÚ¸é™ ó$Lý˜ø4ôQð$íÐêeééèFélê0ìŽîoñÇôŽø¦üç+: ã ùl&"V¿a:[ì üòþ û‚÷\ô²ñïëíîì¢ìí;î!ðò õ ù¯ütDìY TÀmTa™ê@ / ÓMÂþKûøMõóVñLðÙïð­ðÜñƒó•õøçúûý0Wg( ç¾ïsGu  N8ÕþÇûëøbö4ôzòNñ³ðÀðnñ±ò}ô°ö8ùþûìþôîÏf ˜ GWÀ|›" . ÆýUúá÷äõfôtóóó«ó·ô3öøSúÒüƒÿCînµ ¬ E h&s ¥ V •‹S"ýú<÷ÎôÛò~ñÑðÏð€ñÌòœôÖöUùüíþÜЮ_ º ²î%¼Á. t n‹ÿ üµøÉõXóñCð©ïŸï*ð>ñÔòÛôA÷ãù°ü„ÿJû‡ö + $°·³Ž° < Pª4þÒú¦÷ÔôzòÂð¿ï~ïñïñºòÕôB÷êù»ü£ÿ‡IÐ Ö 1 –/> Ç Ã 8B¨ýhún÷×ôÃò>ñMðð[ðTñõò õÀ÷¦ú±ýÀ©iá î YG£cŠ! 8 à@YEýûù÷[ô5ò¯ðÛï¾ïNðiñó÷ô3÷­ùSüÿׄ÷& î M B Æ Ù | ž C e "‚¯Ãþîû<ùËö®ôôòºñññ¥ñòòÎô÷¼ù~üCÿñpÁ½m ¸ ‹ ã µ  ö ‚ ·«iòeþÎûTù÷,õ¸óÈò`òwòó ôpõ,÷7ùvûÙý?‰ v÷ ê W e G žÏÒ¼ þüŸúÐø:÷çõêôZô@ôžô}õÄöcøGúOüqþ• ƒ#iE°¤0pf.Ó_Ð0ÿ‡ýçû`úùî÷(÷µö¤öèö…÷wø²ù0ûßü«þyAâNŠ€/”¢\½¿x÷N–Ûþ2ý¤û9úñøæ÷÷‹ö[ö…ö÷ú÷-ù¥úPüþòÿÆ€ O7ÊóÀ?|~X܉ÿ5þàü™ûiúYùxøÑ÷l÷W÷–÷'øù@ú©û9ýàþxºÁˆ <´ûé§[ºþný;üûúùUøÌ÷ƒ÷…÷Ø÷røQùuúÍûHýÕþbÓ&C#Á+VJ •ö!*ïÀÿ˜þýyüûÅúú¤ù[ùPùùíùšúûŒü·ýøþ4fzdˆ¼µszÛ3“ò^ÐÿGÿËþNþÝýuýýÓü üüüÏü%ý•ý)þÊþsÿ#ÊkŠh·áíÓ“3¶0—uìÿbÿçþlþùýý0ýâü¨üƒüyü„ü­üïüLýÀýHþèþŒÿ7â‡$ºHÊC¬7M;õˆõ4U][Gÿ@þEý\üŸûû úbúOúhúúîú`ûðûœüdýJþHÿSl‡¡·ºªhô/œÇŸ3˜áÿXý£ûúºø ÷ÚöhöKö}öûö¶÷¢øÃùûˆü/þìÿÁLåMƒ q  k Q É Ã Ka"¸1ÿ¿ümúSøxöõôÏó ó¾òíò’ó¢ôöÙ÷ÕùüOþ´'“Ýê ¥ î ¹ þ Ç  Ý E 9Ô(F\ý„úò÷±õÚóxòñññ—ñ“òôïõ=øÜú®ýŸv7 Ä æ.үĻ Ï {Ø ÿ:û‡÷ôñ‰î²ì¥ëRë¸ëÇìmî”ð3ó;öªù_ýF; ¥ Ò‚Ÿèò-‹Îâ Ñý{øô'ð©ìÊé çIæÞåkæèçIêqí6ñ{õúõþêÍp §7ûÝ¿±¶å@ÞÉ  ø–þ-ùôOïLë è¨å"ä‡ãÌã÷ä çúé¼í'ò÷eüÙGˆ s㪖y4¤Ðį¼/ 3ÿÐøÚòQírèuä{á®ß߉ßá®ãçbëUðéõçû)b\Øš„oQ!"²! BEA`í"Pú¬ójíºçÌâÐÞïÛXÚ"ÚgÛÞâçöìƒóvú Ê¸.ጠÿ# &¡&Â%Œ# {åt^Ý>ùÎñéêÔäÐßúÛhÙØ#ØsÙ Üäßøäë ò–ùd+ ¤Ž±ß"á&‡)¡**â'$Õn4 þ²ø¤ð é5âjÜó×ÕÀÓ'Ô/ÖªÙzÞ]ä7ëÂòÖú'f D^x R%Æ(Å*N+^*ü'-$¢F) ±5øðèäáFÜÔ×ÁÔ"ÓÓÃÔØãÜãNêKò»úQÍ åXÚ!$'é*û,B-Á+“(ì#ÿWjþÆõsíÑå/ߨÙÖÆÓÓûÓTÖÚß_å©ìÃôWý ~Y\D#õ'L+*-y-,)Y$4Ú ëý]ôìiä­ÝØñÓnѶÐßÑÖÔnÙißærîôöÅÿ¢78@ &:*Ì,©-Ü,ƒ*Ã&¶!ƒC< §èúRòQê8ãCÝœØXÕ‰Ó7ÓoÔ5×~Û3á"èóïUøìb sâx %c)O,‘--Ò*ç&}!ÕF o±ùñôèœánÛ¿ÖÂÓ¢ÒPÓ©Õ~Ù—ÞÀäÃënó•ûá Àžj ù$4( **´)„'ì#Ý¼ä ªiùuñ ê`ã¦Ý ÙÊÕÔ ÔÍÕRÙqÞÜä;ì<ô†üÕè ‡wp!6&)6+;+©)“&2"²IZ@ÿ ÷HïèèáøÜzÙr×çÖÅ×ÚŒÝVâ4èï™ö†þz"6ˆæ :%d(K*Ã*¶)'ó"{ä}–uÿW÷sïèpáàÛ·×1ÕÔ©Õ”ØþÜ­âTé­ðø‘¡j”Öà"†&º(€)ä( ' $úÓÄæ ÞþP÷-ð»é"ä„ßöÛ‘ÙzØÈؘÚîݵâ·è«ï0÷ûþÁ<:Žú E%0()K)p'"$ý¦Ê ‘$þÈö·ï=é«ã?ß#ÜsÚ'Ú,ÛmÝäàgåøê_ñ~øŠÇc'ë›#&&Ž'µ'•&$G :+^·ÿnøvñë:å[à¡Ü=Ú^ÙÚSÜ÷ßÉäˆêýðê÷"ÿm– KA/Ô"%è%k%°#æ )( ’Êÿùµòôìè äá'ßUÞ«Þ5àüâöæøëÔñDøôþ¥% 4·wN #}$†$*#t –ÈHM ¥ÿNù9ó”í¯è³äØá6àÓß›àtâBåóèsí¥òjøþá ÞU¼' Ž!Þ!!72$>¯ ǶÇûöÏð÷ëÈçQäÒáràVàá ä¤ç/ìjñ#÷'ý@K QÑ\Áòüö<Dz »Tþù6ôâï@ìféPçæ’åælçÏéíJñö]ûÏ3b .xöã¿y¥_iú < Xcÿ~úÌõuñ®í¤ê{èKçç×çréÖëëî©òíö¡ûœ£† ýæˆ3 ^Íf;n" ŽÜ?ýÛøÂôñÝíLëŒéºèåèê^ìuï>ó†÷#üòÃv áÔ3êä; j v CÛüùøõ¯òiðÉîÆí_í–í}îðgòfõøøùü6v” h ÛÓ+ÞÄÑô9¼œ % ýeùüõóÉð5ïkîpî+ïšð”òõø\ûÿßÊ— rS߯¶Û ™ xðÿ›ü›ùûö¿ôôò¥ñÛð±ð0ñdò@ô²ö ùÝüOÙ]¹ Ø ‰±!Ìœ í¨ô î ¶féüÿùu÷xõôPó+óšóŽôöõÂ÷óùyüDÿ<9#Ñ + ¢¨1&„Dg . â¾ÿÏü'úÜ÷ö¥ôÎóŽóíóáôaöUø›ú!ýÄÿy.×d ³ ¨-j  6 y|[=þHû­ø‚öôôô¶ó÷óÀôøõ™÷ùÞûdþÏrå ý ‡·…٬冄 þ ê£hýQú~÷ õó·ñ ñ!ñûñó±õGø(û5þO`Y* º å—µ5>ä¡ Ø¼dóþ”ûnø²õxóÕñÜð~ð¼ð•ñ÷òåôM÷ú:ý‚Èúð › ã¼Üücƒ s xÔþ?ûÚ÷Åôòð¬îîIîHïùðIóöBù¾üe!ÎC XéÏy;\Ö½ ý r«þÏú'÷áóñÙî5í.ìÛëAìqígïòiõ1ùHýw™• D ’\…íxÕ¸êŠ » ¡Y ýÎøÎô>ñMîìÄêXêÏêìî¹ðëó™÷ŸûÞÿ/bB ¥q˜¿»üq'"„ j þOú9ö}ò3ïsìUêùèèétêÙìðòóKøñü³j÷ %ƸÌè -{þá; ° Sû¸özòÅî½ëˆé!è çðçéþêºí ñ$õ™ùKþ’Å ƒ½[O‚äYç†Y & {¢ÿÈúö¢ñ¡íPêÑçPæáå…æ&è±ê÷íÔñ öºú}ÿ?Ù ±›µôZóÑêYO l¶üøÎóëï›ìééðç¹æ]æêæjè×êî ò~ö8û ÏZ gœ ’Œøn Ÿ½ þoùZô—ïjëèšå8äÝãtäõå3è"ë°îÊòU÷*üõy ╆¸•3ૹ 0H2þ,ùWôÖïÌë]è©åÚã ãZã·äçHêîmò÷Èû=¨ § ¥`- LÜÁ  ígªüë÷eóGïÃëíèØæ‰ååKåeæRèë…î–ò÷ÁûrD ‡Md˜ÚS & —Òñû ÷\òî*êçÝä®ãxã@äçåOèhëï!ó›÷Rü°÷ ­ ¼ w•÷ž|œ è`ªýïøZôð1ì×è+æOähããÄäç!êêí-ò¬öOûçÿg§› ÌÆÜÿ8£MVÕ ã˜þšùAõAñÃíïêËèbçºæÆæ–ç'éwë†î/òUöÄúFÿ³Û« ýÐþx#å¿·àl t)¦ÿûuöòî€ê½çÞåýä å0æ"èÉêîâñö«úbÿŒ— Àºïc&-ú H ®ý¢øUôað×ìÏépçÒååk嵿ÿèìâïô¤øBýÞ\” k©-Þ uiŽ ä < #Â(ý–ø;ôIððìOê{èpç/ç¹çéëçí[ñaõÄùXþÛ+# ž‰Û|WWwÀ:e Y±ýBùæôÀðúìÉé_çãåoåþå‚çâéÿì¹ðóô‹ùaþ>ð< çÔñ5²p~ê±Ûz ¦„Dÿ ûÿöDóÝïðì‰êÅèÈç¨ç{èCêîìVðNô›øý£/ þ HÞ¬“©õ–¨D …}Iÿûùö0óéï:íFëêéÏéÂêaì¯îœñõþø%ýXd) ƒ ^®gzÑf-.ƒB ´­ÿšû÷ÑóMðFíæêPé èãèêìÎîòÛõïù7þÄ® ĸÞ>îû}zù ÿ §>ÿŠûÿ÷Èôôñ™ïÊí‚ìÝëëë·ìEî‡ðfó·öPúþ²8|f Þ Ê w” £ ðõËþ£ûø·õ?ó>ñÔï ïèî`ïpðò3ôÊöÃùý`£²[ ‹ 7 ]#Éó ž Õ \Ãýû™øWöjôÖò»ñññŸñ¸òNôGö˜øûÔýœb…• 5 7 ® … é Ð a °º›^Ðý¯ûÈù2øôöö™õ~õ»õZöK÷”ø'úîû×ýËÿ­sb|Wæ% ™ÔÇ—–ÿ3þíüÌûíúMúöùîù1ú´úsû`üsýšþÕÿ[…aøAMü9WgnuŠÿ¶þþoýý¸ü’üŠüžüÕü&ý›ý6þãþ­ÿxG°:£Ûâ¼`Õ&b•×ÿ4ÿ­þWþ0þ:þmþÄþBÿÐÿp´GÈ/{µÔÙÈ_ŒX¤ÝÿÿCþ†ýàü_üüü=ü­ü`ýCþHÿ_wo1Ê6uŽ_«d‡ˆmIÿ%þýü@ûœú8úúEú½ú‰û”üÙý<ÿ¶$‚·Å›2„‰F¾úùÛ™BÝÿgþêüuûú÷øø—÷‡÷Ý÷£øÊùAûüüíþ/±ñ Ì @ Q  { ¤ —F±ãèËÿ§ýûºùøÀö¹õõÚôõÅõöö¡øªúþü|ÿ ƒÜÿÖ _ } %Lñ  Ç  (þ¤)“þîûZù÷ößôFó:òÓñ òåò@ôö]øôúÕýÛðê«  véÖAt H °Ä¬ˆÿoü}ùÉöPô)òxðCï½îñîîï³ñ'ô&÷ú>þ Ù„ ë êVñGÙÔRm @Ñ>£ý"úæöôÆñðï¯îéî¿ï5ñDóæõ ù—üdA ” ÆŠÈps°&–µN €v_RümøËô–ñêîñìÍë‹ë4ì¹íÿïñòjöXú•þ #­|ij„º$ÑÐ4 ¦rüøBôêð4î"ì¶êøéûéÍêwìûîNòBöµúrÿL · æ ‡ç*8#-¶Ò º‘ÿú«õKñŽíªê°è°ç§ç„è%êwìuïó-÷ÌûÁÝß Œ­¾ˆv€™À÷Nåô ±Tÿú!õð©ìcéõæ|ååàå¸çŽêAîò`÷uüÀ[ ^ïÆµ’AËAºQ&V Y”ýó÷ÇòFîê×çüå åéä§å7ç¥éõìñÙõû .Œ «Otáfß !õ‚Þ;ê  þ)øšò‘íAéâå¢ã’âµâøã>æVé#íˆñvöÊûa˜ º6å¤k=óÓ»³Þf ‘¨þàøwó“îQêÌæ*äxâßánâ+äçÖêmï‘ô ú·ÿk V8k¹òüÄ_æƒKjû +,þ7øžòžíxéHæ$äãÛâžã;å¸çë0ïýóIùàþxà îwg¡ „Øï­oiÞ $þ_øØòÏíbéÖåGãëáÌáÕâîäñçªëðÁôåùKÿÂ# &žIË‘W6.CŠ%( ÑZþùônïë8è¶å äTãšãøäiçÊê÷î¿óíø?þ—ɱ ( %)ã¹µü« èË„þ9ù)ô‘ï©ëŸè’æ{åYåæ³çêíÕðõµù†þSÝ ÁÚ[ù–>øó e „„ÿ’úÑõhñ‚íFêÜçlæ æ¿æpèþê<îò)ö’ú-ÿËR‘ [|Ûgù}28 ~ûMÿ§úBöQòðî<ì8êûè‰èíè-êDì!ï£ò˜öÔú0ÿv{ #ªytˆ¯ösYÁ Ù·†ÿYûf÷Èó·ðNî¨ìËë»ëlìËíÎïbòxõ÷øÊü·žAŽ Y›T€&M\Î ³ ;”àÿQüûøöqóañîï$ïï·ïñóŠõlø„ûÌþ&r§Ž "MgÚ¾)' Ä ,!ÿ*üù.÷[õüó óÂòêò‹ó«ôDöNø¯úIý¶UÀî Ô f —W˜YL œ \÷’ýGû6ù|÷-ö[õ õFõòõ÷yø3ú(üCþ‡Èøû½* > û Z i # ‹ ™ R ºàѵ™ÿšýÅû1úáøä÷@÷ýö)÷Â÷½øúÄû¨ýµÿÙ%'ë e t   ´ Õ ú+6* ÿFý«ûNúEùŽø$øø9ø«ø`ùWú˜ûýÔþ¶« {3« ç Í Z ƒ < † h ï1IINcÿšýøûúkù™ø"øømø"ù*útûõüŸþe:äŒô Ô . # à ËQ¬éEÿ—ýüÁú®ùÛøEøè÷Ñ÷ø’øyù¶úDüþê±; r ù  ¯ Û ¨ $i‹™¥·þÜü(ûªùnø‰÷ ÷âö÷«÷€ø™ùéúfüþÓÿ¬|<Ï8Z < Ø   ¢ Ù ²1v‹‘—ÿ±ýîûPúîøÁ÷åöaö?ö‹ö<÷Pø´ùPû!ýÿ÷æÁ~ÿ? $ ° × ¢  F .ã_²ìMþŸüûËù´øà÷E÷æöÏöÿö÷lø¯ù<ûýýþýá›#l i  N 0 ¡ ¾ ‰o¤ÊÜÿòýü`úäø±÷ÙödöLö™ö-÷ø6ù’úüËý•ÿ`&Õ[µÙÀ d ¹ ¼ \ ˜ sõ0:$ ÿ÷üüú%ù…÷)ö&õ…ôVô—ôEõZö»÷mùPûiý›ÿã$F2Ê Â   Œ ¶ ‘ jlG3þ7üdúÓø|÷eö•õõâôõªõ«öøËùÄûêý(j¡¸ E € H O “ e Ú ê´vþCü5ú\øÖö§õáôôôÙôˆõƒöÉ÷Xùûý-ÿHZJ ‘Í À \ U ¦ =*þ»ÿ€ýWûLùu÷äõ­ôëó¡óÙó’ô¹õB÷ù!ûVýÿï-H © Ê } Æ ›   Ö=aLÜþ»üÀúù”÷söªõ0õõMõëõÝö-øÅù™ûŠýÿŽƒWÿk‰ M £ … ï ë„ÐÞÅœÿzýuû¡ùøñö/öÎõÓõ0öØöº÷Öøú‹ûýÎþ†AÜL‚.ˆ•I¦´zþ[¢íþCýÅûtúWù…øê÷¦÷§÷þ÷ ø‚ù¡úåûIý¼þ0¦ Z„z2¹ù+Úròlÿìý‡üMûLúùùÛøãø'ù¡ùMú(û1ü_ý©þZ§ÒÕ¤=›¼¤N¿öüÙ•5ÏþlýüöúýùQùïøáø"ùªùqú^ûhü‰ý³þäÿAeuk7Ñ*I µü¯JÛÿoþýëûìú$ú›ùPùCù|ùìù—únûvü›ýÓþ\’·ÁŸKÃúñ¦ZcF µTÿþ¸ü–û¥úêùmù6ù@ùŠùúÍú¾ûÔü þTÿ¢í)JK"Í@~u3¨âêÄ"¸ÿMþéüžûzúŠùÜø…ø~øÑøqùPújû®üþŽÿ˜k›š^Þ  ÔBhAÛ7i†ÿ¢ýÚû9úÐø­÷ØöXö>ö‡ö6÷Iø³ùaûBýCÿJODÂ) K  ^ E À Ù — EM2Òý·ûÆùøÃöËõ8õ õDõèõñöcø3úYü»þ=Â)ZF é 1 °Íx  O ˆ föZ©ñýIûÂøxöôöòôññÄñ—òöóÒõø¬ú‡ý“²Ñ¾ ` ‹0;´›÷Ñ0  Tøÿœüqù”öôò ð®ïPïïsðúñ ôÉöÚù:ý½QÒ) :âûh ÙÙµÔ ‘ _žþíúi÷@ôñyïî^í\íîCïñ‚óqöÐù•ý”¡ + ctéèp"Y <üÉý¶ùãõWò6ï”ì¡ê€éKéêÔëyî×ñÐõ.úÜþ«u 8ɉSèÇÕ/î" åT”ÿÝúböVòßîì ê¾è*èfèkéKëîñÈõ‚ú‡ÿ›” >„6/Xz€]×È' )ÜýÐø ô±ïñëúèèææåéåèæËètëÍî¿ò=÷%üX¡Å y‘Ò,– ŸM$)n \gyþÄùfõ}ñîNëé¯ç"ççéuëÎîãò€÷pü‰ † )~íH޵æDôé jÂý‡øTô©ð®ízëê‚é®éŒê%ìoîfñõ"ùªý\w ƒWÛ~&Ñ€Nl ÞVý ùõ‚ñ{î ìêâéê5ë'í¾ïëò†ö~ú°þVz B…çï.¯lã´õ ãžeþeúÃöšóùðÙîGíHìêëFì`íIïéñ/õëøùü/nŒ v  kø W'+…V âÖ·ÿ°ûæ÷„ô¼ñ—ï1îxífíæííîzðòõ0ø¬ûrÿ\5Ü ,vJyñžy‹ã©  .@[þ›ú÷éó&ñðîeížì¢ìqíûî%ñ×óôövú4þ"õ Š «:NÊšÄR@šl ÔñõýTùðõüò|ð…î#íeìfì*í¸îüðÝó@÷üúéþñ÷é ‘Ö„rz”Æ%Öø· % ]{•ýÐùPöHóÂðßî¥í íí³íéî¿ð3ó8öµùý›¢ Aðghƒ¿0î) ÃuþAúDö¥òˆïíVëzêêaëíLï$òjõ ùý.g“ u êÂäCà»Ö>ìò_ Lïsÿ ûèö%óÞï)íëµé"épé©êÇì²ïRóf÷ÎûRÙ; c $añ°‚[EV¦Qu 2äþ*ú²õ¨ñFî±ëõéé é¾é)ëBíðfóQ÷°ûKõm ” <QÇ…z—Ìoù ÇýþDúÇõžññíèê¨è[ççËçxéìJïóX÷ãû c b7gËI겪ÙP= ß)Kÿ}úøõçñgî“ëzé"èžçóç3éRë<îØñöõdúÿ¥-‰ ”8>…ß4t°ˆjÔ çËÿ·úÝõvñ»íÙêãèåçÐç“èê2ìîî6òÿõ/ú«þ@Æ ß&ÚÔ„Ó¢¡ë¦ C~üé÷¡óÒï›ìê~èÍçèBéQëîrñ;õXù¦ýx½ °1Fœ#ÆŠ¹: ¿çü9øõó6ðíÆê2é_èWèéšêâìÙïmó{÷Ûûly ³ ‹ÙƒeemuŠ·%è 77þùGôôïNìxéƒçzæ`æ$ç­èòêØíVñZõÇù‚þdBê ,ßå!r×>­,Īù 첊û“öòýí—êõç%æAåMåRæ=è ë•î½òY÷@üNY7 ÅÙGó°u+Û‚A0| NÖLüæöÛñdíŸé³æ»ä²ã¥ãäHæëèPì`ðõúkÿË íW!39$øÑÄø ¡ý;ý™÷@òlí=éëå€ãâÊá‰âOäçêÐî¡óâøgþ‘ ɇ“Æü'7- [ Svþ›øóî©éægã³á áqáãâaåÜè-í6ò½÷Œýu3 ¥‘ÓGÀ[^Cï “ ­ŠþbøhòÚììçàãêà ߎÞ:ßáÛãœç*ì^ñ÷ýP\ B­1¹/ ‹ ÇÞÛÚòZ Dìÿ›ù}óÓíÁètäáÙÞÅÝõÝnßâÛå‚êÚï¹õÝû;x$è¢0 Ÿ–}z¥* 7þÿ½ù³ó'îKéWåaâwà§ßîßIá±ãç\ëkðöðûôÑZ gÓ…]7òyÂÓËÞ; /ßÿùqó²í˜èKäáýÞ:Þ¼ÞxàGãçŠë±ðOöDüY[ "{éW¹xÚ>©3 ;+ û/õ¿ïäêÊæ‡ã8áôßÎߨà ã]æ˜ê“ïõáúÍ¥G ~!øÍ„OqÏL4 Ÿ¼¶úÑôOïoêvæzãšáÏà áKâtä€ç`ëöï*õÃú|#} V–$äǧny×N gŒ¦úèô{ïŒêMæ÷âµà¸ßà”áGäñç[ìbñÔöŽük0­ œÂ÷/@UŠíXŒ >¤û‘õŠðìFè8åùâ¨áYáâ÷ãñæçê²ïõ®úu%‘ –¹}*¯ý1dÈ„à ¢AÂûUö.ñ†ìŸè™åšã¬â¼âÅã»åè+ì‹ð€õèúy- Ýã7Á„mebT?H QÉ&ý—÷AòMíâè<å‰âûà³àµáøãHç|ëXðµõdû:¬ ÑHËE™Üc⤲! £ý¯÷˜ò î!êöæäãâã©äaç(ëÔï1õëú͘ 7Ä ¦°AÅ2©a„G ¹þpø óîÞ釿9äããþãôåÕè…ìððüõ‚ûE{ g˜ý{Ý· †˜ò¸ 3þùÉóìîŽêáæäXâÎáŽâ•ä¾çâë´ð ö«ûp$­ Î[Ïoùmã€Y{þ –ýþmù+ôrïrëJèæ¬ä?äÃä@æ´èìGðõrúñÿvÈ ÅG2j»AI,d@ Ê'zúõèïcë¿çå¦ãZã/ä æÂè<ì[ðþô úRÿ²ï Ð+Ò´¹Õ=v´•– Gâÿžú¤õñýì€é­æÁäÉã÷ãJå¾ç8ëwïVô™ùÿ¨ ;çÖáϧ^î€fØ ãµyûföºñ¬íXêÛç<æuåŽå’æzèIëïîPó=ø{ýÓ ‚zÄ<Ç@•Éö@Þþ Ýš^ûLöˆñCí­éûæGå¤äå|æÌèÝë”ïâó¤øÂýD< «jRUt¡æKЀwå ýõü_÷ó/ïÀëãè©æEåÑäoå,ç÷é¨íòóö#üe£Ÿ =?€Ð 2IpÆt–F ¡Ëâû'÷ÉòþîÝë‡éè?ç:çè~éÆëÍî‰òÖöŠûf9Ë û £µ¢K¹r¾” !˜ ý§øxô£ðLí¦êÅèÐçÇç®èhêÜìñïƒó÷ÉûE¿ û \òq ÷,¿¯  ÙýlùŠõòïŽì¬êkéøèUéŽêšìgïÎòöµúãþ â RA‰ ±|n¦;E ì 8QMþRú™ö=órðHîÎì ìòëxì“íJïñTô÷ûÌþS 7 ´°ó‡3+ U É >þúïö°óÚð•îøììôë“ìÙí¯ï÷ñ›ô‘÷¹úþtÑüÚ C "k&Ÿƒ× ž â¹Nºþ0ûÏ÷¾ôòÍï îÑì3ì8ìëìKîKðÒòÁõòøHü ÿïÿ˜ · L,bÙ«î ® 2"ðþÄû¸øêõ†óšñ9ðeïïAï×ïÚðPò"ôböéø¸ûžþ…DÁøÍ ; 2 § ‘ ã   Ì ˆï 6ÿPü„ùáöyôeò·ð‰ïïîèîxï–ð+ò&ôyöùßûÔþлkº ˆ Á Z g à ç … ¿¬SÆÿvüíù÷‚õ·óIò2ñð9ðpð.ñtò4ôcöÞø”û\þ"ÑVœ‡  ì = å ô v ŒPàG§þ ü„ù/÷!õwó?ò…ñ@ñsñ òóRôöõå÷úüÿ„áÔE P ð  Ú  òZqAù¬þsü]úsøÃöLõô7óÁò´òóëó$õ¶ö‹øŒúµüðþ(SR sr û  Ñ % *ÚO‡zÿZýJûbù­÷;öõ:ô°ózóœóô õWöøòùüPþ޵»U * y ï õ¡=OZZþ[üoú¢ø÷ÀõÇô3ôô>ôÕôÂõùöxø,úüöýìÿÏ’$…¦ˆ- … ˆ 2 |`ñ@YXQþ[ü|úËøT÷ öEõÍôÁôõ×õðöIøÔùûaý@ÿ,ÂMšD “ Ž 5 ›^Ø37ÿ?ý[û®ù=ø÷9ö±õ€õªõ4ö÷ZøãùûzýiÿY<ÇU¤ ¥ I u / o M ÒÝÿ¾ý®ûÙù?ø ÷0öÂõ¬õêõlö+÷ øOù¶úTü!þ íºV¹Û ² 8 ^ ! { p L[M,þü8úø)÷ömõ4õfõö÷KøÎù‡ûYýFÿ=3 È;r J É ö Ë H t Tâ4NJAÿNý{ûãù‹øz÷­ö3ö ö@öÑöÀ÷ ù•úUü>þ<>>/ûš ð å s   H  £ïÿéþÙüôú<ùÏ÷Àöö©õ õïõ—ö‹÷Ñøhú8ü8þSloNó^ ‡ ^ æ Ê  ¡êÿðÕ¸þ«ü¿úù‘÷sö¾õwõ¡õ0ö÷\øÜù—û~ýŠÿ¡¾¼Œ T 1 ´ ß ­ ?  lt;ïþºü­úØøL÷ö;õÃô½ôõãõ ÷„ø5ú ü*þP‰Çý Ý L C ¬ ì Ý q ÂÖÇ“N þØûÕùø®ö«õ õÔôõõö¾÷Nùûý6ÿYt~m0 È   ® Å S ^ æ  ÑeØHÿ¿ühúEøzöõ-ô¾óËóAô õTöÐ÷‘ù‹û¶ýÿÿ]ªÖÀ\ Ÿ ý  Ï " ¶‘6ÂPþöûÉùß÷Aöþô%ô·óÂóDô4õˆö-øúüMþ˜ê6ie G  5 í ,  Œ ÌÔ¬gÿ×ü½úÝøI÷ö'õônô¡ô7õ5ö ÷jù‰ûÚýJµþëy ¦ w × Å 3 . Á ÿÙ^ÿ ýýúýø>÷ÏõÂô.ô ôgô"õJö¾÷}ùyû¨ýûÿV¨Ë°9 c $ ƒ q  /  q˜„RíýäûÿùWøÝöªõÅô@ô*ô‹ôiõµöaø\ú‘üîþaÚC…  ' ° Ÿ  ø ~ «—Wö–ÿKý)ûWùÜ÷¿öþõ–õ{õ£õöàöþ÷€ù[û‚ýÖÿCœÉ¾` ¦ ÿ  ‹ ’ 5 z‚a,úÿÑýÀûÑùø—ösõºôwô¬ô]õwöñ÷·ùÃûüýWÂM< È ð ¨ î Ô W X ÝÌvþÙûÉùô÷nöIõô=ôsô&õPöí÷Ýùüoþä^Ï#L 0 ° ²$üA ^ e 3Ögôÿ„ý=û.ùk÷ö,õ³ô±ôõæõ÷§øˆú¼ü!ÿ¤%‰¸¡ 7 x S¿´& ˆ ˆ .šç5ÿ—ü,ú÷÷ö¨ô­óCógó"ô_õ ÷ù`ûÝýs½>‹ } ““5ç : 6 äV—ÎþüŽùQ÷kõóóïòhòiòôòô¾õà÷aú!ýíÈ€ _ aôÿet@ ¥ ·›d+þû-ø¡õó ò+ñåðAñ%òƒóOõ|÷ úßüîÿ@; ä (ö?Iôw Ü ÖŒ&Æý“ú÷õÑò ñð‹ïÃï®ð7òMôÒö¢ù§üÒÿ N} | &Sܯ½ ­¸C j 9Û`îü¯ùÄöLô]òöð ðØïðëðLò>ô¹ö®ùïümôcž Ž AÜÓ‡7(vO Ð a­üùÑõéò‹ðÒîÜí¨í5îsïPñ¬óvö—ùúüˆ–Ê ™ ä¤Ç\^ÙÂ$ò E 0ÐPÓýzúi÷©ôTò|ð1ïŒî™î]ïÔðïòŠõŠøÅû!ÿŠå  °ÔeE}ã6} ‘` ¥þZûIø’õYó©ñ†ðôïõï…ð›ñ>ólõ øûIþ§ïò t Š%:¬ƒµIRè * -åÿ¿ü½ùñö|ô‚òñ\ðCðËðèñ‚ó‹õå÷‰ú\ýVQ5à; - «°2:ÆÒ` w " ~Ÿ²Îý û‰øUö€ôó&ò¹ñßñ”òÕó’õ²÷%úÍü”ÿa¸  ¼ ÚlnèÝ b IÓ-m¸ýû¸ø«öõÅóó¬òÏòfógô×õª÷Ôù=üÖþz™àá † Ç •ä· è [ w HßPªÿýrú øúõKôóqòXòÂò¯ó õÂöÉøûý ™^i  u \ Ö Ù k Š < “ Yó} þ´ûù¦÷öáô$ôßóôÑô÷õ‚÷cùxû·ýY•«Š& i I ¼ à W € C ¯Ñ·|.éýÀûÉùø¯ö©õõÍôõŸõŸöþ÷¦ùû§ýÛÿDT4Ò   Œ š @ x O ÊýúÓ›gþMüjú½ød÷^öºõsõõöòö*ø±ùtûiýzÿ‘›…DÀ÷ Ù \ ƒ @ ž F©ÑÑ»¦þŸüÃúùÈ÷Ìö2öÿõ3öÇö±÷èø`úüÞýÈÿ´“Sâ4> ú ] l } …B¾3W‚þÈü3ûÐù®øÎ÷A÷÷)÷¥÷yø–ùýú‘üPþ&×™,€ˆ 5 y ] ä  ý§$½ùÿ<þ—ü$ûäùôøFøö÷é÷1øÂø˜ù©úóûaýéþyxÑ Ûo½¼kÌá½i÷vóÿyþýÈûªú¾ùù¿ø¬øíøwùCúIû€üÝýPÿÎM³ñûÆMOÛ9hpY(ãšÿYþ,ýü+ûsúóù±ùÀùú³úû¡üØý%ÿyÏCZCü{°ŸL¬àãÉ“RÕþ¬ý¡üÁûû únúqú¼ú9ûîûÛüðý)ÿyÅ *àk¿ÖÃrôEioY?ÿþýBüûû¨ú|ú–úçúzû?ü5ýNþ€ÿÁCkoIåCdCì\§ÇÈ­ˆW-ÿþ/ýjü×ûtûFûIû}ûáûvü:ý&þ2ÿQx–žŒOèKwm+³ Fdqrpkÿuþ‰ý¹ü üšû]ûaû¥ûü¼ü~ýTþAÿ2,%þÇlà$-£_¡µÆåÿÿ]þ¹ý5ýÄüpüBü7üYü²ü6ýîýÅþ´ÿ¬£‘n<ñƒõ<T=ïzÔ&(þÿéþéý ý]üçûµû¿ûÿûnüý±ýnþ:ÿÚ§l"ÄPÃM\@ù‡â"?KSdÿ„þÀýýü2üüü1üüý²ýpþ>ÿþåÁŒEÑ4a_(À.x¦¹ÀÇÿÐþîý*ý‰üüÄûŸûŸûÀû üoüôü•ýOþÿëÿÅ›r9ï“ `}^n¦·¯tÿ`þZýpü¯ûû¨úiúUújú¤úÿúsûüÑüºý½þÔÿ÷ ýÊZ·×»qõIt‹„zÿ~þ‹ý³üðûGû´ú;úâù©ù¤ùÓù8úÔúžû’üžýÃþùÿ-Xrg%©ßËqÞ! âÿTþýÃûœú¡ùâøaø(ø)øvøôø°ù›ú°ûáü.þ|ÿÆî˜KBúcŽ€Pü¦ÿQþþü½ûú|ù•øã÷r÷P÷|÷ö÷¾øÅùüúgüíýÿ7ÕY¨²qàõÅ?zu2Á+ƒÿßýQüéú³ù¬øÝ÷@÷ßöºöãöY÷&øBù§úEüþÛÿ±x$¦â×j ‘ M Ÿ™KÁS‚ÿ°ýîûDúÉø—÷°ö%öûõ.öºö“÷¹ø!úÁûŒýwÿgE’ßê«  9 û Y WõBXJ8ÿ2ýBû†ùøÅöÖõDõõOõéõÞöøœùFûýÿ÷›â  ,    ¾ …û7B-ÿ÷üûMù×÷²öáõaõ8õ_õéõÆöø‹ùUûOýZÿfc=ós¶ £ 2 P ú / øg‡s1âþüTúIø‹ö5õWôöóô™ô‚õ¸ö1øÝù¼ûÁýÞÿ² 0 ï M N ê ìWe4ÜuþüÙùË÷üõôbó³ò„òØò¯óúô©öœøÆúýbÿ·ü"· ÿ Î (  m p  hq?âoþü¶ù¨÷õõ£ôÁóGó9ó–óRôrõööÂøØú ýUÿ’µ®x Y Z õ È ì “ Ñ´fõ~þüÄù°÷áõqôxóÿòó„óoô±õD÷ùû>ý€ÿÒ"øy ž ] Æ Ç n ¬ ‰ þßyÿþŽüFú6øoöõòóKóó\óôKõÜö±øÀúéüÿR|}2 “ ‹  — « [ ¸Ï²sÿÑüŸú£øïöšõ¨ôôçóô¬ôõäöyøRú[üvþh†¾½ g » ¦ 0 Í ùºÿzýGû7ù`÷Úõµô ôÎóôÂôÍõ.÷Áø’úüþ ®œYÌóà ; a / ¯ Ó£#VW8þ÷ûú@øºöõœô!ôô|ô[õ©öHø*ú2üAþUS9ù†ÑÍ f ¢ o Þ õÀF–ºº°þ§ü½úù÷eö”õõûô2õÈõ¼öø­ùûžý¼ÿÎÃ…]f % ‘ ¢ K Š iì/7ëþ·ü”úøÇöUõKô¾ó¶ó%ôõ=ö¿÷pùQûEýMÿQC¦ôò• ï ï ¢  ÑB|‡~ÿqýzû¥ùú÷ˆöWõvô÷óèóJô)õkö øçùïûþ'Ö`™w ð û ¢ ëè•^}ÿwýxûšùò÷›ö’õéôô¨ôõÕõíöNøøùÑûÄýÀÿ¢fùUvQë+  ‘«hÓõþäüßúûøK÷ßõÉôôÛóôô‹õÇöBøðùÄû´ý¬ÿ¡|(¢ZÀÒŒûõ}Ïìîþêüõú'ù÷+öõCôÎó¾ó ôÄôÛõE÷îøÁúªü”þ|HöÂÊlµ›J,Ë:~£ÿ¼ýÙûúvø÷ öWõñôäô$õ¯õ…ö¤÷ùúNüþäÿ5›ÌÆwàñ£ýóŸAbÿzý›ûÚù<øÖö¾õùôžô¨ôõàõ÷Zøóù¬ûýhÿF¼"<m‚B¼åÉjËøÿ ýûPùÂ÷uöwõÑô{ô€ôàô‘õ–öÞ÷cù ûÉüþl3ál¿Çu¶†öÿ»<жÌþßüøú-ù—÷AöCõŸôYôpôÛô•õ”öà÷dùûõüèþѦRÅùäy¶½(\sˆþ¯üèúHùØ÷—öŸõ÷ô³ôÕôeõWöª÷Aùûýÿ(0¹ ˆ › ? ‹€2­û"1ÿ5ýJû„ùï÷¤ö¤õúô¢ô›ôìô™õ¡öþ÷¨ù—û§ýÀÿÔÄŒb] ý 9 m fWxqYÿ9ý"ûùO÷ÀõôÈó{ó©óPô]õÆözøkú†üÁþ3B–Â Š ò ò Œ º éúш=þüú]øáö²õÃô#ôÚóôó}ôwõÝöªøÀúýmÿÖ,ZLî " å * æ .  €®™Oãÿdýõú®ø«öõçó8óó@óãóçôDöî÷æùüwþêJˆM · Ê w ¶ } Ä “ æßÿý«úsø}öÑô‘óÂò|òÇò˜óãô–öøÌúýyÿÕ)ú ¢ k Ï × ‡ Ý Ù n¨Š+Ÿÿý±ú‘øÁöYõUô¾óóÉólôƒõ÷àøû`ýÖÿBŸÌÈu É ³ $  € q û )ÁH²þü™ùN÷]õêóóºòó¾óíôkö0ø#úHüþÜ)\^ Š § n Ö ß | ž G ~PáF­þ/üâùÜ÷öÃôÆóAó8óµó¯ôöð÷úTüµþ!‚Àצ  . Î û ½  × 7S)ÉTÿáü™úŸø ÷êõ=õõ,õ±õŠö²÷'ùÜúÅüÓþêá” S > È â ‚ ž M œžs+Öÿ•ýlûyùÙ÷öÄõqõõ6ö/÷qøéù”û\ý<ÿ0& ÑY & g Q á " ­ <M\zþ±üû«ù‚ø¥÷÷ðö-÷Ö÷ãøFúäû¯ýˆÿlAþ› 5  ¢ Ê ”  # ¯-’ã0‰þý¥ûˆú©ùùÈø¿øøøuù3ú+ûdüÆýUÿë q­¾•4 ‹ ˜ Z Îùà›1¸2µÿ>þæü¯û®úïù}ùWù„ù÷ù¨úˆûŽüµýîþ6€ÁíîÊkÖâTy{gG"ÿþý;üˆûÿú«úú²úûÃûŸüªýÊþýÿ3[xyXŒ×ïÍ~lªÐйŽZÿ1þ)ý@ü“ûûÞúÕúòú5ûŸû%üÏü™ýþvÿ{€~m?îvËêÒ}üFq€t^ÿOþFýNü~û×újúDúQúœúû¦ûPü ýÊý–þfÿ; ÑŽ*±Wqg.Í;†­½ÁÿÉþÝýÿü>ü“û û®úvúpúšú÷úƒû0üýâýÒþÅÿ»¨„FßP[ófª×àÝÿÎþ¾ý¾üØûû~úúßùÕùòù;ú ú,ûÛû ü}ýdþPÿ2 Ø.´T_8Ô;y—“‚ÿlþSýEüSûzúØùmù>ùPù—ùú¯úkûAü%ýþÿ ÷Ú:¹ 34¬]whLÿ,þ ý.ügûËúaú&úú6ú„úôú‹û<üûüÊý›þmÿCÜ RäQ…AÃ9?+ÿþýü"üjûéúú‹ú§úìúTûÙûuü ýâý±þ†ÿ_4ú°OÑ2qƒm%­Nn‚†ÿþ›ý±üäû2û¶úkú_ú—úÿúšûTü.ýþëþÎÿ¦y=î„öGg\#¼-t¢²¾ÿÌþãýýnüëûŽûYûIûdû¥û ü”ü9ýüýÐþ¬ÿŠd0êt¥¤p z¼æ ÿ5þdý©üü«ûqûZûrû¬ûüxüýªýaþ)ÿöÿË‘@×K•»¹—Mç^ÃY¢ÿîþAþ¢ýý–ü*ü×û¨û§ûÕû1ü¿ümý8þÿÔÿ”:Ç:ÉììÙ©c”{àÿ4ÿ‘þøýnýý´üŠü„ü›üÓü(ý›ý%þÁþlÿÌiíS“°¬ˆIóŒ #¨ÿ/ÿÀþ\þþ²ýrýHý,ý3ýLý…ýÑý3þ¡þÿ•ÿ {Þ4x©ËÛ×ͱ„Hö—*±ÿ5ÿÃþeþþèýÑýÚýÿý;þ’þ÷þkÿãÿYÅ'nœ»»¨…L º`¥ÿLÿøþ³þlþ6þþæýÙýÞýþDþœþ ÿ‚ÿyãCˆ»ÕÕ»ŠDî/ËÿjÿÿÀþvþ6þþìýÝýéýÿý+þ^þœþìþ@ÿ¦ÿŽ] Åʰm—þe½ÿ)ÿ¨þIþ þíýèýõý þþ8þYþ€þ»þÿtÿøÿˆ+Ñv æ ¹7Ê÷.sÿÔþNþàý‡ý?ýýßüÏüÐüúü<ý¥ý1þÜþ›ÿm@ ¿WÏ(_xvQ   V~ ÿ¸þçý;ýµüYü)ü&üMüœüý§ýTþÿéÿÁ˜l5æ…üG_JýŠò?y¦Íóÿ!ÿ_þ¬ýý§üUü0ü0ü^üµüBýúýÝþâÿý.!ìŒø4=ÍVµ4\†³èÿ,ÿuþÈý6ý·üaü6üAü€üùüœýhþVÿO\gk['Ä+[Z"ÈH³?n}’£ÿÃþýýYýØü†üZüTüvü»üý¦ýPþÿîÿÖËÀ­‡JØ9[;ãW§â8jœÐÿ ÿVþ®ý*ýÅüŒü‰ü­üýyýþ¼þÿK ô¹t—Ca]0á`Å3W¬ÿçþ=þ¨ý2ýÝüªüªüÔü5ýÁýoþ=ÿ!ðΠZútÍôï¿lôbµý4g–Ñÿÿ†þþÀý•ýý§ýÙý!þ‚þöþyÿ²]¿j‘Nnc(Á<¢õO ùR°ÿÿ‚þþ§ýsýký˜ýóýtþÿ¼ÿm¿VÚO· NžŸCÞYºOýÿvÿÿµþ}þbþWþgþŠþÁþ ÿdÿÐÿLÕy&ãŸSòi°¿›IÑ< ùR­ vçÿlÿÿ½þ‰þvþuþ“þÊþÿwÿöÿ€ Áj ¡0ª W„‹s1Æ=¤ñD‘ëPÈÿZÿÿÒþÀþÕþÿMÿ°ÿ˜¢1ÀFÉ?ê)#ú²IÑ7•óWÎVûÿµÿÿ]ÿHÿCÿPÿzÿ»ÿš,Ëv!ÈaåV¢Ã¼†$¨l»Y¯~ÿÿ™þYþ:þAþhþ¸þÿªÿGù¶z<îŠ i¡¼²‰=â`Í'v¾ ^Âÿ-ÿ¯þIþöýÉý»ý×ýþþ ÿÏÿ•b:Ï{~¾Ñµnyà,o²ê'jÿ»þ#þ¥ýJý ýùüýCý§ý/þÝþ¥ÿ„mY6µPÀ0"ßmË#3?LcÿŒþÊý"ý›üAüü ü^üÐüjý/þ ÿþÿ÷õäÀ‚”â  ñ¯J¾ /:5,,ÿLþýüüüJü/ü9üiüÄüBýéý¯þ‘ÿ…{mL ©E=þ„á363$ÿþ;ývüÝûyûJûXû’ûÿûüEýþüþìÿèØ¾‰6¿(i‚Gïgµãùÿ+þXýüüŒû>û û6û„ûÿû£ükýNþDÿFC:"ìFR'ÌL¤Ýþÿ.þTý–üôûƒû0ûûû*ûwûïûŽüQý6þ)ÿ+(ò²Hºþ åYަºÂÿÈþÑýæüü\ûÑú~úcú…úßúdûüÓü¬ýþzÿ^= Â\ÌEG%àvëEƒ¶Ûÿÿ1þjý³ü ü€ûûÉú©úÁúû”ûHüý þÿþÿòÔ¦XèL€ƒOìa±äÿ!þ4ý_ü±û(ûÕúµúÅúûfûéû‡ü=ýþýÕþ§ÿy@ô•†ÖýÁVÉ?Ykÿ„þ ýÕü"ü”û"ûãúÐúäú&ûûü´üdý*þöþÄÿ•[¬(}ª²ŒEáZ¿E{ÿ±þñýEý­ü0üÏû‘ûoûoûûÒû9üºüXýþÂþ…ÿK Ãgød°È´oúd¬Üÿÿÿ:þgý«ü üû?ûû%ûVû¦ûüü(ýÈýtþ(ÿäÿžVž!†ÍãÕ˜-õ2l£ÿæþ2þýúüzüüÄû—û“ûµûüqüþü§ýeþ.ÿÿÿÖ¥b ŽèéŒ f¥ÓóÿÿDþ‰ýñü{ü)üýûëûûû"üfü¿ü7ýÇýnþ'ÿëÿ°p&ËZÍ GC·:™æ,e ÿÛþþfýÄü9üÖû û’û²ûü{üýÂý‡þ\ÿ5â¦QßP•º«z—ñ(Mp•ÿËþþ}ýý¥üeüEüEüfü«üý‘ý*þÌþ{ÿ-݃'·3šÙôë½qeÄ$ˆÿòþwþ þ½ýŒýpývý‹ý¼ý þlþíþÿ ÇjõkÃþæ±q"Åcö{ˆÿÿ¦þEþþýÎýÂýÑýþJþ°þÿ”ÿtÚ2}½ìùȆ*¿HÈFÐÿcÿÿ»þ„þ_þKþMþ_þ‡þ½þþþJÿÿîÿDŽâ!d›ÆàìâÍže Õ~,ÔÿŠÿIÿÿ÷þæþçþöþ ÿ$ÿDÿgÿŒÿ¼ÿüÿ>Ú,r²äܬhÅv$àÿŸÿsÿLÿ;ÿ1ÿ=ÿPÿuÿ ÿÊÿ._†²á@qœ¼Î×ʱ†L ¿kÀÿxÿ:ÿÿõþèþíþþþÿ2ÿVÿ|ÿ£ÿÌÿ÷ÿ Js—¾ã&" Þ¢Yµÿoÿ7ÿÿòþîþëþûþÿ-ÿTÿ}ÿ¶ÿóÿ:‹Ù-z»ô'"á©hËp±ÿRÿüþ±þvþSþGþMþiþ—þÑþÿ^ÿ­ÿZ±^³O¼ÙÔ·v“cÃÿ1ÿ­þGþþýÔýËýÚýþ<þƒþÒþ+ÿÿûÿvìsïdÆ 7@%í’ôO­ÿÿþ(þÖýœý~ýuý‡ý¬ýéýHþ¾þGÿâÿ‰-ÇSÎ1ƒ³Ǫ́fÿuÓLvÿ¦þÝý-ý¤üFüü#ü\ü³ü,ý¶ýJþéþ–ÿHÆ€1À.qj+¾6ŽÔ ;pÿ¸þþ„ýýÍü›ü‰ü’üÂüý‡ýþÇþ‰ÿUé²l!ÀA™»¥UË #Ûÿµþ£ýªüáûQûûóú ûzû÷û†ü*ýÛýšþpÿ]Z]\IÀ7vz?à ô¶k/ÿþý'üvûûúªú‰ú¡úîúsû2üý*þ[ÿšÜ!UkS‚°žB°ìûÚ«q9ÿþùüüHû¹ú`ú9úTú«úEûü)ýhþÉÿ5 ö/9ËIŒ…A°Üɇ¢‰þ ý¥ûkúoùÅø€ø˜øùæùøú9ü›ý ÿúkÃç†ÛõÆfÃæÎ}jÆÿ.þ³üjûRúsùÙø~ømø¦ø2ù ú/û“üþÒÿJó~Øð¼ ) 3 ß / .ò…ôP™ãþ2ý£ûDú!ùMøÑ÷«÷Ù÷Xøù!úfûâüþGÜ„þDH  q • _ Ò å©_|­þäüGûÔù«øÊ÷J÷+÷s÷ ø$ùxúýû¢ý]ÿ"Þ‘+ÕË f ¦ ’  ] T ŠØ .Vþ–üû³ù›øÎ÷L÷÷9÷²÷øÅùQûýÿô¢R G ë 9 ' ± Þ µEŸ×ôþ0üpúâøŸ÷ºö9ö/ööP÷nøÕù‡ûpý}ÿ»µrÝï ¦   ï ~ Í Ô<>-þüFú¤øJ÷Kö¨õyõ»õvö™÷ ùìúçüÿ"FUD v Ž @ s > ™ ’ 9 žÌĤqÿGý7ûeùÚ÷¬öåõ~õ}õÛõ™ö«÷ùÃú¯üÀþÙïãª<” £ j Û î ‘ Ð   KGãÿ²ý–ûžùé÷‰ö‰õüôéôEõö'÷–øCú*ü:þe–»°dà À R ‡ ^ Ø  Ù_£¯šzÿdýiûŸù ø¶ö­õ÷ô¨ôÈôcõuöñ÷Ëùåû"þs¾ôâq ¦ e § j ¶ ”  _jOÛþ£ü’ú´ø'÷ïõõ¢ôƒô½ôOõ2öv÷ùþú0ýÿ÷M|i M * ¢ Ÿ " ,  úÉz/ÿéüµúŸø²öõÂóìòŸòÞò­óùô¬ö³øùúbýÙÿQ°áÍ] Œ G — l Ù × k žŸþ»ûŽù¬÷öÐôÛó:óôòó¾óÕôrösøÐú^ýcd I  = á  £ áÏ|oÿÛüZúø÷õOôóbò2ònòó%ôˆõ:÷8ùoûÜý\Ü3V& Ÿ ± ` £ t Ô Á 9 N …ýû»ø¤öÛôoósòüñ ò­òÌó`õJ÷~ùÝû]þèráú v i Ó µ   š ÙÙ¦MÚþvü*úøYöêôãó:óõòó®ó¯ôöå÷úYüÎþ:’À»o × ã | 6 I ß æóRþºû7ùíöõuótòòò³ò·óõ¯öŠø•úÁüÿU”­‚ < z „ ! U  ol!©'þ´ûpùd÷¤õ8ô3ó›ò~òãòÌó%õîöüø@ûžý]ž³Œ 1 Û ¸ ò Æ ?tm7äÿ‡ýAû#ùK÷Òõ¼ôôÕóöórôAõcöÜ÷ ù¥ûÑýOnSýV \  D  m O ÇëÈ}ÿ¼ülúDøPöºô†óÑò¬òóôóFõêöÒøáú ýEÿ†·Êž* M Q ' ˜ § Z½Ù¼|1þýûðù*ø¦ö‚õ©ô.ôôAôØôÍõ÷¹ø–úšü¶þ×èäºUª ˜   s d Ýë°hÿ.ý ûùi÷öõgô1ô]ôâô»õÖö7øÌùšûˆýÿs1ªßÆ]   ˆ  >wŸ›~ÿcýjûùø²ö­õýô¯ô¿ô?õöP÷Óøú{ü†þž¶¶‘#Y ) } a Ð ãšSjh\þYüxúÉøW÷/öUõÔô¢ôËôOõ6ör÷ ùÙúÜüæþè΀B?ñO X þD=å^®ìÿOý”ûìùzøE÷^öÜõ¹õö§ö™÷àøbúüóýçÿÒªN¨±eÇå¼^¿Ý´H›ÁÕþåüûsùøýö6öËõÈõ"öæöøqù ûîü×þänê 0 N  ` b"ªCcþ¡üÝúJùù÷ûö\öö/ö¡ök÷|øÚùpû7ýÿÕ‡C>ûm Ž d ÙþÊT¢ÏîÿþCüžú.ù÷÷÷Šöfö¥öN÷Hø”ùûÓüªþ•aÍ£  * à L qZ™ö5iÿšýèûYúùù÷9÷Ñö½ö÷¬÷¯øú¢ûiýSÿC"èÞ Ô W ~ I µ Æl¡Ïøþ*ýûúËøÜ÷H÷÷!÷÷LøCù{úäûtýÿß™CÉ.ÿ ­ ˆ  A#¸Pr—þÓü6ûÑù§øÒ÷K÷÷B÷Ä÷’ø¦ùûúuüþÅÿw(Ç;€}- € u  QHûzÕ_ÿ¬ýü´ú„ùøà÷w÷S÷t÷Ý÷Œø…ù¿ú8üÚýœÿm3×VŽ~ b P æ-(älÔ!iÿ¶ý#ü¯ú{ù…øÖ÷÷|÷Ê÷cøKùqúÎûWýÿ»}%¸2 ‰ ´ ‰  1ÆHª[ÿÃý@üíúÀùÜø2øØ÷Ð÷ø­øùªúüû|ýÿÀl¢=, Ð   š й`ÑW˜ÿåý`üûåùù`ø øö÷8øÄøù½úü¶ýiÿ5û²B¤Ì¨ 2 b > Æ ÷â–xÄ _þËübû1úCù¥øUøVø¯øNù3úYû·üBþïÿ§d ŽåþÏ ] ˜ ‚  p yHã\»oÿÜýjü.û-úvùùùLùçùÐúóûNýÑþq$݈}« ) q b  Q Z ²qÁþýêûÞúúùZùuùåù©ú¸û ý“þ;õ¶aùb— Š . z w  l } Líe¾ ^ÃþPýü%ûzúú úDú¹úlûZüzýºþ‰kÆ& Û Y l ì  òeÅ0¹þaý8üBû‰úúìù úrúûôûý<þ˜ÿœ(® @0 × ( & Ý D m^¼LÐcÿÜýËüìû4û±ú]ú<úeúÆúnûSügý¦þ yî\Âø‘ × Â Y ™›XåXµþ0ý ü,û“úAú+úHúŒúûúûIü.ý@þzÿÒ<¡ø,.úƒÃµS²É«_›;åþ©ý‡üŒûÄú4úáùÓù ú‚ú<û"ü5ýhþ²ÿ f¹ðþÜzÖéºL¡ÈÈ¢j ×ÿ›þvýlüŽûÝúiú.ú2úqú÷ú¬û“ü¥ýÌþH‚´ØÙ´Y¾Û®2u€^ Ô†Eÿþûü üGû®úTú.úEú™ú#ûèûÚüêý#ÿb¨ÝúõÅjÖâvÔöÒ qÿNþ@ýLü}û×úmú4ú=ú‰ú ûÈû°üÁýâþ;XW<ù‰í.7ÐY·ëüïÉ”ÿhþGýHüpûÐúfúFú^ú°ú>ûôûÐüÆýÈþÔÿÞÛÒ­jƒÍèÍ‚`ޤ¢•‡ÿ~þ‡ý©üëûTûçú±ú­úÝú:ûÉûüMý7þ,ÿ$Õ”4´0-ø•[©²¸ÿ¸þÁýÞüübûßúŽúpúŒúÝú]ûüÝüÌýÆþÀÿºšj´/„Ã×ņˆÈèðìÿåþæýüü2üŠûûÑúÆúìú:û³ûHüòü­ýnþ:ÿ Ý«x3ÓSªÔÑŸ>´A]p‚ÿ”þ¼ýüü_üçû›ûxû†û¼ûü¢üHýþýÍþšÿi4ë™,«Khb0ÓX²ï%,ÿ6þMý€üÔûWû ûêúÿú>û›ûü¾üný:þÿõÿÔ«mŸý6B-îˆa¤ß<ÿoþ±ýýgüæû~ûCû.ûBû„ûïû|ü!ýßý¨þzÿKß”.«48¼?›×õÿþAýˆüíû~û4ûûû(ûaû¹û5üÎüýgþVÿO< é Qs\©c Ëðÿÿ4þ`ýüõûmûûâúçúûqûòûüFýþæþÈÿ§@ésÓ $ ÓwíL‚¬Åÿãþ þ?ý”üÿûû?ûûû?û™û!üÐü¡ýŠþÿzkMÁ@–»°u‹é6w¬Þÿ ÿ=þ}ýÎü<üÉû}ûYûaûûâûVüïü ýnþIÿ( ד2´ES6êwÙEc|ÿ™þÅýÿü[üÑûjû/û!ûCû–ûü·ü{ýPþ8ÿ$úÍ~r¢Ÿrœeµ÷7qÿ°þñýAý£üüºû}ûiûˆûÖûYüýÓý»þ©ÿŸ€W «)…¹Æ¦ZèN•Èíÿ>þký°üü§ûlû_û…ûÚûUüôü­ýxþPÿ. Ú˜;¹Tja4î€öXŸÝMÿþßý@ý·üGüöûËûÉû÷ûUüÙüˆýPþ/ÿëËCÍ6mvPúƒåBKHDÿTþ}ýÜüoü7ü<ükü¹üýœýþºþ\ÿ Àw,ÕszÝ$F?¨`’°Çåÿÿ<þýý²üü§üòüqýþÌþ˜ÿl; Ê„'­Tla0ázíQ˜×5jÿ¼þ&þ¯ýaý6ý-ýQý–ýýý‡þ+ÿàÿ¡^»Uågà@‰¨bó[›ÃÛí&ÿcþÃýTýý ý:ýýþ‘þ'ÿÎÿu Íx»>¥÷(72ÿ¸L¿[޾öÿ;ÿ•þþŸýZý>ýLýŒýóý‚þ.ÿèÿªl$Õ}¬.•Üþë©< ë;aˆÆÿÿ‰þþÕý«ýžý³ýÛýþ~þôþˆÿ3ò¼‰N¨/•ÎáÇ}}Í As¦àÿ(ÿþüý“ýYýKýoý»ý/þÂþiÿ ã¥p/æŠ{¸Ð¼|ˆÛFr¥éÿCÿ·þFþëý¨ýzýiýmý“ýÞýGþÙþ‰ÿS0ë·`Þ!)ü˜tÅR”ÑRÿ þþ„ý&ýùüîüýXýÅýTþÿÈÿ †g>ÿ¦,ŠÅÝËŒ*£K‹ÇQ¢ÿùþ\þÊýVýüüÌüÍü÷üZýßýˆþPÿ.õÖ @·üü»ZàO¡ë&VŠÅÿÿuþìýý2ýþüõüý^ýÓýyþ?ÿéÉ—Rø…ôAe^(Å8ŒÂäôþ ÿFþ•ýý«ü†ü’üÊü2ý½ýoþ:ÿ øÐ'šì,$»[Ö6{±Ø.gÿµþþ¥ý]ýFýhý¸ý<þâþ¡ÿpGï´s"µ.¯³AÍ<ˆÀä,c¬ÿÿ¡þLþþþþNþ¦þÿ¹ÿi/Û´€?éuÚ!ý©5˜î5w·[ÉLíÿ¨ÿƒÿxÿŒÿ¸ÿõÿUÇNð›P±KÅ.r•œ|>ÓQ³ü?€È"·ÿvÿTÿSÿtÿ³ÿ†°[Ú ZŠå á”)¼>Á:µ'— ©Z)EŠñs °Xþ™#VŠª«…EãkÛ?œø[ÅAÑzD*4^¢| ©YÁlýi°Ê½L÷•)³:¶-¤$£6Ô‡Q79b«œ:݃¦ z»æêܬf­@ÊWÝ^Ý\Ûcþÿ·ÿ“ÿ™ÿÉÿ!¤<êŸPõ„úU‰£©”k2åŠ ª%Ÿ €öv¢ÿ\ÿ4ÿ,ÿFÿ€ÿÝÿTßx¾^÷„úW“±°‰Oõˆ ~á=•óVÌÿVÿùþ¶þ”þ’þ©þèþBÿ½ÿOô¡PõŽ…à;=ÉZÌ%i¤ÖOÿœþþ‹ý<ýýýMýžýþ‰þÿ´ÿV¥Qðyì>pzh3áuò]ÀsÓÿBÿÀþNþõý¨ýwý`ýeýŒýÏý1þ®þ=ÿÜÿ~!½PÕC•ÊßÏŸRéi×5‹Öÿ!ÿ~þçýoýýäüÑüßüýDý‘ýöý`þÝþ^ÿëÿrõsåI£é!>;ÈZÇ"l·ÿþþRþ²ý+ý¸üfü0ü"ü0ü`ü¥üýücýËý?þ·þ>ÿÄÿWágÜ0j‚r@ízõU²ÿÿkþÚý`ýýü³ü}üTü8ü'ü"ü1üPüüèüXýáýuþÿ´ÿIÍ7ÃÛÜ‘Nò‰ zÿ×þ2þ‹ýöüyüüÞûÐû×ûÿû>ü’üóü`ýÚý`þçþsÿûÿwâA„­Á°‹Cìwþÿzÿþþþ þ¢ý;ýÜü‹üAüüÛûÊûÕûùû<ü üý§ýIþíþÿ)©]‡–Šf,×môÿaÿÅþ#þýêüeüñû˜û`û>ûCû_ûœûøûiüêüxýþ—þÿÿ rÄ*4$õ¨OÛÿ_ÿØþKþ¼ý/ý¢ü"ü²ûPûûáúÒúãúûZûÅûGüÜü}ý!þÀþLÿ¿ÿa¯¸¸£~Cúÿœÿ0ÿ±þ+þšýýcüÏûIûàú úŠú«ú÷úpûü°üdýþÅþiÿüÿzÛ>?!é™<Õÿeÿçþgþæý`ýßüeüôûû;ûôúÄú¯ú°úØú!û‹ûü²ü[ýþ¨þ@ÿÆÿ;˜â  Ø…ÿüþ`þÁý!ýüüû2ûíúÌúÄúæúûmûÙûWüáüzýþ¹þUÿáÿ]»4NTB$è›.²ÿÿ~þÚý@ý©ü%ü´û[ûûøúõúûNû±û-üºü_ý þ¼þeÿ£$ÐøûÚ Eà_Íÿ)ÿvþ¾ýý[üÉûTûûëúõú#ûkûÐû@üÆüVýðýþ5ÿÚÿ}›o±ÓÓ§UÝJœãÿ ÿbþªýýfüæûƒûCû.û9ûqûÄû7ü¿üUýôýœþEÿôÿ˜9ÃC¥ì!/-¹ZÜ>“Øÿ ÿdþ»ýý‘ü üÐûœû˜ûºû ü‡ü$ýâý±þ’ÿqNÙoå2OC ´>¶cÎÿøþ&þiýÃüJüüåûöû0üŽüýšýBþÿËÿ¨~W ÜxùW•¢‹FßRªð$VªÿØþþhý×ütüHüMüüþü–ýLþÿíÿÏ´“p8ézâ!2Úoé>z§Åã:ÿ€þÙýPýêü¤üŒü©üüüý<þÿÙžB¿ +ÃA˜Îíþ<lÿºþ+þÎýšý“ý´ýÿýhþòþ˜ÿX0ðБ@Ì5|§¥x!šé-ÿnþÙýtýIý[ý©ý*þÛþ§ÿ‰wcP2 Þ+˜ÛíËxøR…¥°¹ÃÝlÿäþ…þCþ+þ9þhþÄþCÿïÿº¢›™“~PŽëÚséB„¿å $Agžÿùþwþ4þ%þUþ²þ5ÿäÿ›e7ç»8×Y¶ïúÞq©Íè4rÉ=Çÿnÿ*ÿÿþþÿWÿ¹ÿB츢œ•s(§êð¼eìeÒ2‰Ö<g—Óÿ.ÿ®þ]þ5þ@þ}þáþwÿ3üíÅ2±]…‡g%»4”âMs’ªÊÿöþNþÔý˜ý¡ýêýpþ!ÿïÿ׿¬‹]¯$uŸ²¦\¸9˜Ïïû !Mÿžþþ»ý™ý­ýþý‰þBÿ& ö½_íV¥ÔáϘAÎ9’Õ-Hh–ÿÛþLþéý¹ý¿ý÷ýXþ×þjÿ¾l½QÙU»Sˆžx1¾:ŠÎ>xÉÿ-ÿ´þXþþþ*þcþ¼þ+ÿ­ÿDè˜Gú¢9­6B'í•]´ jÜÿcÿúþªþoþNþJþZþ‹þÞþFÿÔÿq¿_øðOµ¶Ÿ_‘t×5ŽëÿQÿ¾þAþßý˜ýyý{ý£ýêýSþÕþlÿÇ|&½?Ÿâ â«bŠýb´Zÿ¼þ1þ¿ýtýHýBý_ý˜ýëýLþºþ3ÿ¸ÿCÑm”q§´Këu÷qótôÿyÿÿ—þ6þçý«ý‰ý|ý‡ý±ýïýCþ°þ&ÿ¢ÿ(¢†é9ƒ³ÏÆžYïoàG±ÿÿ“þþ­ýPýýãüÒüÞüý=ýŒýðý_þàþiÿùÿ‘¤g¢¹µ–a¼Uàfèÿnÿ÷þŽþ.þÛý›ýeýGý9ýEýhý¢ýôýVþÇþ@ÿºÿ2¢\¡ÌãÛºƒ3×hôÿuÿ÷þsþ÷ý}ýý¿üüTüJüTü{üºüýýþ‹þ!ÿµÿ9·h”®¨ŽW·O×ÿVÿÌþDþ´ý%ýŸü&ü·ûcû/ûû2ûcû¸û1ü¶üRýîý’þ&ÿ®ÿ${·ÑÒÀ‹O¨ÿDÿÓþ_þàýbýéüvüü¾ûûVûJûZû†ûÎû2ü¥ü%ý¦ýþþëþ>ÿÿµÿàÿ ðÿÂÿ‚ÿ4ÿ×þnþõýuýðüiüïû{û(ûèúÍúÈúæúûaûºûü”üýŒýþyþÝþ/ÿiÿ—ÿ¬ÿ´ÿ¤ÿˆÿTÿÿ·þMþØýYýÚüWüÝûiûû´úvúRúYúyú¹úû|ûøûtü÷ütýïýbþËþ'ÿqÿ©ÿÆÿÊÿ·ÿ‘ÿTÿÿ­þJþÖý^ýáücüæûxûûÁú‚úZúLú[úƒúÇú%û›û ü­ü>ýÆýHþ½þ.ÿ‰ÿÞÿ@=!ÚÿnÿèþJþ£ýúü[üÃûAûÒú{ú>úúú+úWú•úæúCû¬ûü”üýŽýþtþÔþ$ÿcÿ”ÿ¯ÿ½ÿ´ÿ—ÿ\ÿ ÿ”þþlýÊü,üšûû»úoú?ú-ú1úLú‚úÆú!û‹û÷ûqüëügýãýZþÊþ,ÿ}ÿ³ÿÍÿÈÿŸÿ]ÿýþŽþþ~ýìü[üËûJûÙú~ú2úúðùëùú+úkú¼ú"û—û ü¬üBýÎýPþÊþ*ÿrÿ§ÿ¼ÿ¶ÿ—ÿWÿÿŸþ/þ¯ý2ý±ü5üºûEûãú‹úJú%úú)úTú’úàú<û¨ûüüýŽý þzþßþ.ÿfÿÿ‰ÿnÿCÿüþ¥þ7þÄýDýÅüGüÔûjû û¾ú}úPú6ú5úJúyú¾úûûõûoüîüjýåý]þËþ)ÿxÿ«ÿÉÿÄÿ ÿ^ÿÿ“þþ„ýîü\üÌûNûÚúzú7ú úòùñùú*úcú´úû“ûüªüCýÎýTþÉþ)ÿwÿ¢ÿ¶ÿ¯ÿÿUÿÿ¦þ<þÅýAý´üüûßúPúÔù{ùIùGùoù¼ù'ú™úû™ûü›üý”ý þwþÚþ'ÿ`ÿ~ÿ‡ÿnÿBÿüþ¤þ@þËýRýÔüRüÖûYûÞúnúúµù{ùgùwù·ùú›ú1ûÇûaüöüwýõýfþËþ$ÿlÿ¢ÿ¼ÿ¼ÿžÿdÿÿŸþþ‰ýñüUü½û<ûÎúƒúVúJú\ú}ú²úçú*ûnû¼û üoüÕüJýÁý<þ²þÿlÿ©ÿÉÿÄÿ¤ÿaÿÿšþ$þ¢ý1ý¸üSüôû¢ûbû6ûû û;ûvûÂû(üžüý§ý1þ¸þ0ÿ’ÿÚÿ  öÿâÿÎÿ³ÿÿWÿÿ–þþxýØü?ü¹ûLûû×úÌúâúûgûÅû?ü½üIýÔý[þêþgÿâÿR¯ù(:-Àbÿÿ‚ÿÿŒþþ˜ý0ýÖü‹üYüAü:üOürü²üõüSý»ý*þ§þ'ÿ£ÿƒà-lœ·Ã²U/¶ÿ>ÿÄþUþïý•ýWý%ýý ýIýƒýÖý9þ¡þÿ•ÿ’ŠôO’¶Â¬z0Ó^áiîÿÿÿÐþ†þPþ&þþñýéýüý&þdþÂþ3ÿ­ÿ2²1¢U”¸ÌĨz<ñ Qþª^×ÿœÿpÿGÿ'ÿ ÿúþõþôþÿ,ÿeÿµÿ’™Šî?q‹‡n5í.ÉgÀ}Gðÿèÿóÿ!Cp¡Ü_°Y®ýHy¤¹µ¡x=õ¡Gâ‡+Ú’T)ïÿêÿöÿAƒÊ#‚Ü6ç8’ä/p¤¿ºœaš!›š,̆YCDZ~®ì+vÁlÅxÎh¬è,0ç˜5ÃGÌ\ó ]1"Ek¢Û]¥÷JªoÌ[ˆtH¬Nç%ЋS*ùþ6Z†ÃI•ì=†Èþ+"Ö™O¯e×¢pE)ýú÷Br¹`À|×"eœ¼ÉÁ›]œ*®7Ïq*þäÞéÿ Jt¥Ý`«þSªúB{¥¹¶¢|A÷£Iç‹.ß”Z+òíõ?xÃwÚ7•óAŽËÿ(ú¾r œ—'LJecµÿT°qÍ!u¾Aq™®°¢{=ó•3ÌoÅ‚IþëæòBÒ*ŽôcÌ/¼ÚãÏ£g'Ú@ôš@àƒ%ÜžxÀaÈ2”øG‡¹ÜïûÿýôçÏ«u3ÞtލNÜÍØú/q½ `½nËl°æÑ‡)·@ÉXþµ{W9!ñóý@{Å ƒöfØ;Ž¿Î·€.Ëdô‘3܉BþÀŒhK>=I_‚°ï2€Ï&uÉN†­Áí{3〴Sû­f1 ðÿéÿêÿ6Z…²è%k»a´J†¨¶¦s$ÂLÕd´wP3úÿÿÿ <a’Í`º b®é*(ð¼€7é›JÇ’iF-óÿòÿùÿ>yÁh»G}¨ÃÏÓ¿¢w=û¶hÈ{2éÿ°ÿÿ^ÿNÿJÿVÿlÿ‘ÿ½ÿóÿ0wÁ \§ë+aŒ£°£‡R ¶Wõ–@öÿ¹ÿ…ÿcÿIÿ8ÿ,ÿ.ÿ1ÿ;ÿRÿsÿ¡ÿåÿ6ž ‚òUªàýã¼XÊm”#µÿRÿ ÿÐþ¶þ«þºþÓþõþ#ÿPÿ‚ÿ·ÿõÿ6Ò&{ÍEeohK$ð³o(Ú„,Ðÿzÿ/ÿéþ¸þ•þŒþ“þ°þÛþÿbÿ´ÿkÄl³ô$I_eT0õ§Nç|²ÿVÿ ÿÌþžþ}þkþdþrþ…þ§þÙþÿcÿµÿxàBœè*TqztZ3ü¶d ªKìÿ”ÿBÿ÷þºþ‚þ[þAþ;þHþdþ™þÝþ0ÿ”ÿüÿpáO³ Q{“‹tC¶]Ÿ<ßÿ„ÿ4ÿëþ­þ~þUþ<þ2þ6þPþ~þ½þÿoÿ×ÿ@¬n¾<atqRÐqÿ‰ ˜ÿ)ÿÇþxþ<þþþþþ/þZþ“þßþ4ÿ™ÿ úpÖ-r ´°—g!Ä]épøÿ†ÿÿÅþzþ9þþèýÔýÑýæýþJþ˜þûþdÿÚÿOÃ8šï4`ohGÌx«6¿ÿEÿÖþrþþÕý«ý”ý”ý¨ýÏý þQþ¨þÿpÿÚÿCª[£ÜÓŠ,¸:¶ÿ0ÿ°þ=þ×ý€ýDýý ýý7ýjý±ýþgþÐþBÿ»ÿ7®$ˆÛ17àŠ$¨ —ÿÿ•þ0þÛý ýwý`ýUýWý`ýsý—ýÆýþWþ´þÿ„ÿëÿO¨ò0]ns[1ðŸBØÿlÿýþþ*þËý{ý;ýýíüãüðüýDýƒýØý:þ¡þÿÿðÿN¢á  äªb ¥ÿ:ÿÊþZþíý”ýFýýêüÙüàü÷üýRýýÑýþkþ¿þÿqÿÏÿ(zÁóâ¦Xñÿ‹ÿ"ÿ¾þeþþÝýªý‚ýfýRýCý?ý:ýFý\ýý­ýîý4þŠþâþ9ÿÿÜÿPs€d9þÿ¶ÿ`ÿÿ¤þNþìý—ýKýýÖü¹ü³üÇüóü2ý…ýàý>þ›þñþ>ÿÿ²ÿÜÿøÿ ÷ÿãÿÆÿ§ÿÿPÿÿáþ¤þhþ.þÿýØý·ýžý”ýýŽýŸý½ýòý5þþõþbÿÑÿ8Öÿ ï¾|6êÿ¥ÿaÿ(ÿôþÂþ•þfþ5þþÝý¿ý¯ý¯ýÁýãýþJþ‹þÓþÿgÿ¯ÿ÷ÿ8t«Ñò  ó͘]Õÿ›ÿeÿ8ÿÿûþëþ×þÌþÈþÈþ×þóþÿLÿ‰ÿÎÿP†µÓáèØÃ£ƒ^@" óÿßÿ¾ÿ£ÿ…ÿeÿKÿ3ÿ*ÿ(ÿ5ÿNÿuÿ§ÿàÿ%n²ú1_€ŒŽ~eJ%ýÒ£m5õÿ¹ÿ}ÿEÿÿìþÑþÉþÎþåþÿOÿ—ÿîÿHŸó;z©ËßèçÙÅ¢Pí¼…X. òÿÛÿÎÿÈÿ¿ÿºÿ´ÿªÿ²ÿ¹ÿÖÿ?…Û*u´Þõ   þèÄŠIûªcçÿÎÿÇÿÜÿJ™è7|µÝñ  íÌŽGû¤]óÿáÿÜÿëÿ <a†°æ#i·U˜Õ 'ø¿~/Ú‰>ý½Žb:úÿìÿæÿêÿ,c¥ôB•à)i™¼ÏÑʳŒYÖ…3Ý’V% ûÿöÿùÿþÿøÿöÿõÿõÿÿÿDxÁhÅg¦Òã×±w(Ó{)Þ¡jC! ûÿõÿøÿÿÿ "8Sv¥ßk»Yœ×õ€2ãDú¿‰a9ÿÿëÿèÿíÿ*d ñ>’ã*h™¼ÍÒȱYÙ†7á˜Y$ôÿòÿûÿ <b†ºò7Ïk°ç+/ñ·kÈu*é©wK)ñÿäÿêÿ÷ÿ@zÃa±ü>sœ·Èʽ¨TÌv&ÓQ(ýÿúÿøÿøÿóÿôÿôÿüÿ 1`Ÿè9†Æþ)!ëÅ™oG"ýÙ°†X$ðÿ»ÿ†ÿeÿMÿKÿcÿÿÎÿn»EsœÂÜö  ç¹y'ׂ2àÿžÿcÿ9ÿÿÿ ÿ4ÿ`ÿ–ÿ×ÿ(vÌ"n³éøß¿¤zIÏ.Üÿ”ÿWÿ&ÿÿöþïþ÷þÿÿ>ÿdÿ‘ÿÌÿ S¢ïA‰Êü&Ô˜V±PñÿŽÿ,ÿÚþ‘þ]þAþ:þOþqþ©þìþ4ÿˆÿØÿ.zÆ Ep˜²ÇÆÀ©€M»hÃÿÿFÿÿúþîþæþôþÿ"ÿEÿoÿ£ÿÜÿ!j¿f±î1+î¶s$ÜŒ=üÿ¿ÿŒÿgÿGÿ(ÿ ÿüþìþèþÿ,ÿsÿËÿ<½2¦ ]šÁ̾eÅj ªUþÿ®ÿ\ÿ ÿÈþ‰þWþ<þ6þIþoþ­þÿ\ÿÎÿEÈFÈ9—á$ÿÆ{¯6º=Êÿcÿ ÿÀþ…þ^þEþ@þPþyþ¸þÿvÿòÿoå\Äh¡ÌäðèÈ›[ ª=ÈLÔÿgÿÿµþxþQþ9þ3þ:þFþcþ‡þÁþ ÿgÿÓÿHÂ<¥S·Éêv.ÒfòqôÿwÿÿŸþEþþßýÔýàýþý-þnþ¹þ ÿgÿÒÿCÁ<¼1‘à*$É~ª2¹?ÐÿjÿÿÆþþEþþèýÔýÐýêý#þuþÙþTÿÙÿ\ßYÌ-»ãíØ¬j©:ÁFÑÿfÿÿ½þ€þYþBþ6þ4þ9þQþzþºþÿ‘ÿ!¾[ðfÊÿ   å¯kÂ]í{…ÿÿ¥þFþüýÑýÁýÐýþMþ«þÿ—ÿ’ {ã@ƒ´Î͸‡Hó‘#¬1µÿ=ÿÑþkþþÊý‘ý_ý>ý4ý?ýký²ýþ¢þ9ÿÝÿ¡l©ØìòæËšWÿ pÒÿ.ÿþþ›ýNý*ý*ýLý“ýëýRþÉþ>ÿ·ÿ$Šè>‹ÒP‡®¸­|.Â>­€ÿîþmþüýŸý^ý9ý5ýRý†ýÔý9þ§þÿ”ÿ tâ9µÐÔ¿‘DädÔ4”ÿóþlþüý¥ýjýJýDýNýjýœýÙý&þŒþüþxÿ÷ÿtçI£à "&ï¶l´AÈÿJÿÈþIþÏýlýýæüÓüÖüðüýNý‰ýÏý þ}þåþ_ÿÙÿXÉ.zª¹±†Cî~ ÿÿ£þBþîý«ýxýRý8ý.ý.ý?ýaý™ýàý6þ¡þ ÿŠÿzêMšÉÞÊ™HßbÛÿLÿ¹þ(þ¢ýý®üNü üäûÐûâûüEü™üüüpýçýbþÕþCÿ¢ÿøÿC„Âý&@;ÂL¸ÿÿnþÔýHýÛü†üIü%üüü)üEüyü´üýbýÍýCþ·þ3ÿ¥ÿ^šÂʽh%Ôÿmÿÿþ‹þþ‰ýý®ü]üüúûéûðûü*ü`üŸüñüIý°ý&þšþÿ’ÿýÿ^¥ÏÒ¹!²ÿ9ÿ¼þ@þÎýlýýÍü”ü^ü8üüóûáûÜûêûü]üÅüMýæýŠþ&ÿ°ÿs¦¾ÌÉ¿¯‘j0áÿ€ÿÿ”þþžý0ýÎü}üDü$üü3ü_ü¢üúüaýÐýJþÄþFÿÅÿ8žî&@8Ïv–ÿ#ÿ°þIþîýªýmýGý&ýý ýýüüýý.ý`ý›ýéýDþ þÿfÿÅÿ^•¹Å¹™i×ÿ‚ÿ.ÿÜþŽþCþÿýÁý…ýYý4ý#ýý*ýHý}ýÂýþþÿ‚ÿøÿh½ùçÒ¶—q.áÿyÿ ÿŽþþ¯ýTý ýãüÑüÚüõü'ýeý¶ý þfþÆþ!ÿ}ÿ×ÿ.z¿ô%' à¨cÊÿwÿ)ÿâþ¤þpþKþ7þ1þ;þSþuþ þËþýþ+ÿ[ÿ‰ÿ±ÿÜÿ)Rx£Ëñ),ê¦C×ÿ`ÿðþˆþ4þüýÛýÒýÞýøý#þKþ|þ¥þÑþôþÿ9ÿ^ÿŒÿÇÿOŸô8w¢»º¢z>÷¥T®ÿ^ÿÿÔþœþfþ?þ%þþþ7þbþ¤þøþ[ÿÐÿJÅ7šé1/æ§bÅv+æÿ©ÿwÿOÿ4ÿÿÿÿÿÿÿÿ%ÿ@ÿhÿ™ÿØÿm¼ W´Å¾œm&ÛŠ1àÿ”ÿFÿþþ¹þ…þUþ6þ#þ$þ9þUþ†þ¾þÿOÿÿòÿG–ÞU‚¢ºÄÅ»u:ö Púÿ±ÿmÿ9ÿÿûþòþôþøþÿ'ÿJÿvÿ­ÿðÿ7‰Ý.ºí õÜÁ¡r7焞ÿ+ÿÇþ€þQþEþYþ~þÄþ ÿbÿ·ÿ^¨ê!R|£Ìñ %ì®Qêqôÿzÿÿªþaþ/þþ*þQþŽþÔþ-ÿyÿÆÿAo Îù-_†¢²¥‰R ½hÓÿ•ÿhÿIÿ)ÿÿ ÿÿøþýþþþÿ.ÿPÿÿ©ÿÙÿ;d’ÀîLu©²œv9êŠ!·ÿPÿóþ«þuþUþNþYþxþŸþÌþöþ"ÿJÿzÿ¥ÿÜÿc³J‰¹Ìˬz,Ö}#ÏÿŽÿUÿ,ÿÿ ÿÿûþøþðþìþçþóþÿCÿŒÿíÿ]ÙNºZެÀÉʾ§z?ã}±ÿ]ÿÿ÷þãþäþîþÿ$ÿHÿzÿµÿþÿ\Ã9²)“å74ê¬hÈqÁjÅÿzÿFÿÿûþðþðþÿ&ÿ\ÿœÿëÿ@žþ[¸ T¶Ëçr+Ûƒ*Ú‘X-ùÿõÿõÿöÿôÿöÿþÿ*[–â0‡ÖW‡¨»ÈǸŸs:õ¥Vµv;þÿïÿïÿöÿ BoªøYÉDº1‹ÇãÖ¯i»d¹n,)e= õÿíÿóÿ'a¥óE–âX†¯Ñí ðÉŽFö¨R¼|Q0!*9[‰ÀJ•ä<‹ÖV‚¦»ÅŶœq>û«^ ºt;òèå÷.X±Ý :cŽºÝü" ã©jÏ„@ïÞãò0V€ªÐ÷#Ju£Ðÿ.^„©ÄÑÍ»—d'Ý’?ì¡\(üæâìHn–Äì>e‘Âõ'Z‡¤¶©ŒS¼m*÷áÔÞë ùèÛÝíO›ìD«¬Q²e*ëèë÷ý   ÿÿùù'Bk›È9i—¯¹©‡G³l2 ðîìöü9T|®æY‹¶ÐÝÚžtAÛ©wO-ÿòòù7Z~¨Õ4b‹­Ðçø  þêЪ|M鼋`=øöø(Eg”Î\®Iˆ«Àºžl2Þ‘<ç›]+ ùðü "@_ˆ³à@k”¹Øò úâ¾›l? ߪ|Q1üôñø9T§Ö6dЬ¿Ç¾¨…[&ò¹Œa@+úôíêî,`£ô<~±ÌÇ®ƒI Õ¡pF"ý×®‡[4öçåóIŠÛ'u¯ßø  輂7åŽ6åœb9!%Dm—Îþ._Ž·Øö  ùݽœrM!óÈsL-ñÿðÿùÿ 'Irœ¼×êùþþ óÏ™V ¾ÿsÿ3ÿÿëþÛþæþõþÿ9ÿbÿŠÿµÿäÿ9d·×õ þß°r,Ùÿˆÿ6ÿéþªþvþRþ>þ<þGþ]þþ£þÇþæþ÷þÿÿ ÿÿÿ5ÿQÿ}ÿ¤ÿÒÿôÿ$ðÿ¼ÿzÿ3ÿàþ–þKþþîýÚýÛýîýþ+þWþþ§þÊþçþÿ ÿÿÿÿÿÿÿÿ ÿÿèþÉþ¤þwþHþ'þþîýæýßýàýãýêýêýóýøý þþ;þ]þ…þ°þÜþÿ$ÿBÿJÿOÿ?ÿ%ÿÿÒþŸþgþ2þúýÁýŽýZý,ýýèüÔüÍüÕüãüý*ýUý‰ýÄýþý:þrþ¨þÕþýþ%ÿAÿ]ÿkÿqÿfÿLÿ%ÿÝþŒþ1þÕý|ý3ýùüØüÄüÃüÉüØüêüþüý6ýZýƒý¶ýïý)þeþžþÏþúþÿ"ÿ#ÿÿÿòþÚþµþþbþ0þóý´ýuý:ýýîüãüæüõüý(ýIýkýŒý³ýßýþMþŽþÐþÿOÿ|ÿœÿ¯ÿ¦ÿŒÿ]ÿ!ÿÔþ‚þ1þáýýbý4ýý÷üîüæüêüùüý1ý^ý›ýÞý2þ‡þãþ8ÿ„ÿÄÿíÿïÿÒÿ¯ÿÿSÿÿÜþþUþþÅý‰ýNý'ýýõüîüöü ý'ýNý‚ý¶ýôý3þzþÂþ ÿWÿœÿßÿ:IH,ùÿ¹ÿjÿÿ¼þgþþÛý§ý}ýdýVýSýXýfýyýšý¿ýñý&þgþ­þðþ3ÿsÿ§ÿÔÿôÿ íÿÌÿ¤ÿvÿCÿÿÛþ§þoþ=þþÔý¤ýzýXýDý>ýHýhý˜ýØý+þ‹þúþkÿÜÿD˜ÙøÒ™ZËÿ‚ÿ>ÿøþ·þþAþ þÚý¬ýý[ýDý>ýQýyý¿ýþþéþRÿ§ÿôÿ*Qn„–¡§¦œ„a/ñÿ¬ÿ\ÿÿµþ`þþÖý¦ý‹ý€ýý¯ýäý*þyþÕþ5ÿ–ÿòÿ@…³ÏÞÜ϶›pAÃÿxÿ"ÿÒþþ:þþÖý»ý±ý±ýÀýÒýòýþ<þmþ¤þäþ,ÿyÿÍÿf«ÞýêŘf&áÿ•ÿAÿìþ›þTþþïýÒýÓýÛýõýþPþ†þÄþÿ@ÿ{ÿ·ÿëÿFl‰›§¤“{U*öÿÁÿˆÿOÿÿèþ¾þ“þxþ`þWþ]þiþ…þ®þáþÿ]ÿ¤ÿëÿ*c’´ÅËò˜rJãÿ«ÿmÿ2ÿöþÁþ•þpþRþCþ>þFþWþrþ•þ½þéþÿDÿoÿ”ÿºÿÝÿùÿ ,1*áÿ¸ÿŠÿVÿ(ÿùþÔþºþ¦þŸþžþ§þ¬þµþÃþËþ×þæþýþÿ1ÿYÿÿ«ÿÔÿþÿ5==& áÿ³ÿ†ÿYÿ1ÿÿôþÞþÊþ±þ¢þŽþ€þuþwþþ‘þ®þËþðþÿ2ÿIÿdÿqÿƒÿÿ›ÿ§ÿ¬ÿ°ÿ­ÿ¤ÿŒÿqÿHÿÿèþ¾þ•þ{þcþQþMþIþDþCþBþAþLþZþtþ—þ¾þíþÿKÿzÿ”ÿ¬ÿµÿ°ÿ¢ÿ‚ÿeÿ9ÿÿçþ¼þ—þuþVþ>þ%þþþùýñýóýýýþ*þLþsþ¢þÏþþþ!ÿCÿ\ÿoÿyÿxÿqÿ`ÿNÿ6ÿÿýþæþËþ»þ©þœþŽþ~þlþSþ2þþïýÌýµý©ý®ýÃýñý1þxþÉþÿWÿˆÿ©ÿ·ÿ´ÿ«ÿ›ÿŒÿ€ÿsÿbÿRÿ9ÿÿìþ¿þ‡þYþ&þþáýÎý½ý²ý²ý´ý¾ýÉýàýþ*þ]þ›þÙþÿJÿuÿ‘ÿœÿ—ÿˆÿqÿTÿ7ÿÿúþâþÆþ«þŒþpþNþ3þþþúýôý÷ýþþ+þMþrþþÂþòþÿ<ÿ[ÿuÿŠÿ›ÿ£ÿ¦ÿ¨ÿ ÿ“ÿƒÿiÿPÿ3ÿ ÿêþ¼þŽþdþ7þþîýØýÎýÍýØýëýþ!þEþhþþ·þÝþÿ%ÿCÿ[ÿpÿ„ÿ’ÿžÿ§ÿªÿ¥ÿšÿˆÿkÿHÿÿîþ¿þŽþbþ>þ þþ þþ5þ]þŠþÁþôþ"ÿHÿqÿ˜ÿºÿæÿ ;^{’•ŽwP&óÿ¿ÿ‹ÿ^ÿ:ÿÿÿüþüþýþþþÿþþöþëþëþçþöþÿFÿÿËÿYšËïÿøâÀ¡tJóÿÁÿ™ÿjÿEÿÿÿõþèþèþöþÿ ÿ@ÿeÿ‰ÿ·ÿàÿ8e´Óí øÞ¾—nAåÿ»ÿŽÿgÿ>ÿÿûþäþßþèþÿ-ÿlÿ±ÿK”ÈóþùòðÞÊ©‚Yñÿ¿ÿ’ÿjÿNÿ9ÿ3ÿ>ÿTÿzÿ²ÿòÿAã0v²å üã»–b*ç›Hõÿ ÿVÿÿìþÓþÔþåþÿDÿ†ÿÒÿ!m¼ý=n”ºÖî켂8à@õÿ³ÿ|ÿSÿ;ÿ&ÿ,ÿ8ÿ]ÿ‹ÿÆÿ]¬L“Ïöïʧ~KÕˆ;èÿ•ÿTÿÿõþåþäþ÷þÿQÿ˜ÿàÿ0Ë Bq˜Åò$[ޏÓÔ¼‹Aã| š-Éÿ|ÿCÿ&ÿ$ÿ<ÿfÿ™ÿÒÿ4_ƒ²ä)r¿VŽ±Â´“]ÅlÂ{K' öÿîÿäÿãÿîÿI˜úpáP²ú)40 ÒŽDï Q ʘbA# ûÿ3Pz¶]Ë;¬%‰á@@#æŒ!£,²Jì¢e=öÿïÿõÿ@t®ýS¸…ß.h‰Šj:òš8ÔqÃJ%ýÿøÿýÿ>j“Í QžðA™ê0v¤ÁƵ‘U ±OîŠ-׊OñÿöÿK‚ÇnÓ1è5tœº¸©ƒN½g¾n(æªuH"ðÿîÿíÿýÿAu¸WºwÒa“¯º±W ¬BÅOÙg·ÿxÿLÿ9ÿ9ÿMÿ€ÿÅÿˆÿ{÷wðX¶ú(7+¸]ò|ƒ$Íÿ‚ÿVÿ;ÿ>ÿNÿxÿ¯ÿðÿ<Œß3€É An“±ÆÐ˺Où¡&Áÿiÿ&ÿûþéþäþêþÿþÿ>ÿlÿ¤ÿíÿG­&Ÿ‰â@=â”.ÅLÒTÜÿpÿÿÀþ‡þ_þOþPþfþŠþ½þùþ?ÿÿáÿ9îEŸö@‰¹ÔÕ¼…2Ñ^çlõÿÿ)ÿÕþ‘þ]þ=þ)þ$þ-þIþrþ¯þÿdÿØÿTÌ<šÙñÞɧyBñ‘%®ÿ8ÿÉþnþ!þîýÐýÒýãýþGþþáþFÿ¯ÿ)§-°'‰Îíæ¿v§/µ<Åÿ]ÿþþµþ{þUþ@þ7þ;þGþdþŠþÃþ ÿhÿÔÿMÅ;±bœ¿Á£k (¢"®ÿFÿíþœþ^þ+þþéýáýëýþ6þrþºþÿaÿÁÿ#‚á7ƒÄî  üØ©k'ÒzÃÿgÿÿÉþƒþDþþæýÒýÑýìý#þrþßþWÿØÿeä_Ô6‚ÀÝãϦb©;ÅJÖÿbÿûþ¨þlþIþ<þDþcþšþÙþ$ÿ~ÿÛÿ?›òG‰½ä  õزr#Èbêÿpÿòþzþþ§ý_ý5ý*ýIý}ýÖý?þ¶þ3ÿ«ÿ#‰à1p¢Éìþ ñÁ~%¶;»ÿ;ÿÈþ_þþ¿ý†ý[ýBý=ýIýsý»ý!þ¢þ6ÿ×ÿz¦"‡ÇîëǘsÛÿEÿºþ7þÁýeýýìüÓüÝüñüýQýŠýØý#þ„þëþaÿßÿXÐ@•Ý üÈz¡"™ÿÿþ÷ýzýý¥ü\ü.ü"ü=üzüÝüZýïýþ-ÿËÿVÏ2‚µÖåãб~5ØbÕÿ4ÿ”þñýeýîü–üaüCü=üOütü£üäü6ý•ýþxþìþkÿÞÿWÁ$yºàæÉ‡!¨{ÿÜþ>þ«ý)ýºühü:ü*ü:ühü§üìü:ý†ý×ý*þ…þîþcÿßÿ\Í1~­Á±‡9ÑO»ÿÿwþÔý@ý»üJüìû¦ûwû_ûkûŠûÖû3ü±ü@ýÜý„þ$ÿÁÿSÖD”ÌßΟOêdÓÿ1ÿþÑýýuüâûkûûßúÑúßúûGû•ûøûdüáüaýíýtþüþ{ÿëÿO¢è1.Ô•ÿ ÿwþßýOý¾ü:üÆûhû.ûûûNû û üü%ýÄýaþÿŠÿfªÈλ™^Æÿhÿÿþþþ‘ýý¢ü?üáû—ûfûFûHûhû¢ûùûgüîü{ýþœþ%ÿŸÿwÇ,4#ñ§JÓÿZÿÑþGþ¹ý'ý¡üüªûKûû×úÌúÝúû\ûÎûPüìüý-þÊþKÿ¼ÿV…«º¾ª‚3ËÿGÿ­þ þhýÍüEüÓû}ûAûûû0ûcû¨ûühüØüNýÉýGþÈþ<ÿ­ÿa𼯷˜i&Òÿgÿèþ^þ½ýýüïûtûûÜúÆúÛúûkûæûwüý²ý?þ¹þÿ^ÿ•ÿ¹ÿÚÿôÿ!åÿ¢ÿIÿÚþbþàý`ýåümüü«ûkû4û#û"ûAûwûÊû;üÆüZýþ£þ6ÿ¨ÿüÿ&3%æÿËÿ©ÿ…ÿ\ÿ(ÿÝþ}þþýý ü+üÄûpû8ûû$ûNûœûü…üý¥ý8þÉþOÿÐÿ@ ï!6,Çr šÿ#ÿ©þ/þ¿ýRýöü«ürüTüGüJüjüœüåü?ý©ýþ™þÿ~ÿÞÿ)c‘°ÂÌʵ‹Níÿ}ÿôþdþÒýHýÍüiü#üüûôûÿû'ü_ü¨üùüTý¼ý*þ¤þÿ™ÿ tÊ#)üÉ•P¹ÿ^ÿÿ¥þBþìýžý^ý(ýýìüëüÿü#ý\ý¦ýþfþÒþ@ÿ·ÿ(—ýX›ÉÒ¾BÝkòÿsÿÿ‹þ*þÔýý\ýAý3ý<ýQýrý¨ýâý.þ‡þêþUÿÄÿ5˜õ>u¢µÀ³—d½TØÿYÿÜþjþþ¾ý†ýtýzýýÖý þsþÓþ/ÿ“ÿðÿYÁ'Œï@€¢¨ŒWŸ1±8¾ÿTÿøþªþtþNþ:þ6þ7þJþaþ“þÌþÿÿïÿhâX¿a”¹Êͺ•_°EÌLÑÿVÿåþˆþ9þ þïýúýþVþ¨þÿjÿØÿFº*”ý]§á ùȈ6Ùn“&Æÿlÿ#ÿéþ·þ¢þþ þ½þôþFÿ¦ÿ–”n¿1:;ê§Z ·aÁo%ãÿ¡ÿrÿNÿ4ÿ/ÿ8ÿJÿrÿ¢ÿêÿ:–ÿgÎ0‰Ò 4JO:Ü7Ùu»j"íÿÄÿ©ÿ¥ÿ¯ÿÍÿ?‰Ü8”óL¤ð._wxiDχ6ã‘@ø°}P4(!)2Jg¾ù:‹Ú.zÈ9bqqZ1ô§Xý¥Ký®j,æÿØÿéÿ4q½ e¿|Ù/}»ðÛŸZ®ZÀˆX+þÓ¤wR?Ad£þlñqösÞ2oŽŽl4ã„»Xûª]#öÕÇÊ×ð7`ŒÄF•ç>â&]‰¡¢‹_ Ø8ì´€X,ÔªvT76Es´iÐ@© ^ÂÏãp1èžOú©UÌ–jO?<F[w¡Ûe´ \¯ú?y©ÇÝÚÍ«J Ãs&Ò})Ü”b@;Lw°÷F‘ÚRƒ²Þ:dŒ¨´¨‡O³[É‘fD$ ùñìùD}ÆlÂZ•ÁÝäÜÅk/í§W¯]Ë•kM?>EXw¡Ùe±W«ú@}®ÌÓ“Rû3Ðj¾s< ëåëÿ)\™ã9”ûbÅbšŒ]¿Zõ‹+ЈN) ÿýòëíùB{ÂgÃ^™ÇÚ׺…8ß{¥Aç‘O ýÿóÿñÿýÿ /Ii—Ü7£ÿT•¶¶šj#Ó€%Ó=Ç”j@ÿÿèÿâÿêÿ)_¤ñ@’Þ'c—¹ÌÒDzŽ]"Ý@íR Ðÿ¡ÿsÿUÿ;ÿ,ÿ,ÿ?ÿkÿ¡ÿøÿ[ÉCº&…Ï!&úÄ„9Ýs÷qæÿaÿéþ„þAþ#þ'þIþ„þÑþÿjÿ»ÿ `½qË[Ц°¤†\!Ý”Bè’/Ìÿhÿÿ¸þ}þ]þaþ}þÀþÿjÿÂÿT‡µÛ,U| ¼ÌË¿œh!ÅUàÿaÿñþŠþ:þþàýÝý÷ý(þmþÎþ:ÿ°ÿ%—÷D}¨ÆÞí ïÅŒ;æ‚§ÿ=ÿ×þˆþKþ,þ'þBþhþœþÓþýþ(ÿHÿnÿ¢ÿÝÿ2š~îN“¿Ä­v ¸CÁJÓÿoÿÿÎþþbþ>þ'þþ'þAþsþ¼þÿ„ÿúÿwíTªê! õÓ±‡T½]çÿrÿýþ“þ?þþãýÝýëýþDþ‚þÐþÿsÿËÿ"sÊe¨ê68é–(±6ÃÿSÿúþ«þuþCþþþ÷ýïýðýþþ>þpþ¯þúþNÿ«ÿ eÃUŽ°Ã» i³>ÄÿHÿßþ†þDþþþùý÷ýñýìýçýåýóýþAþ’þòþeÿÓÿE¦ê)(÷ϪQÚÿ“ÿDÿóþ¦þeþ0þ þõýðý÷ýþþ4þVþ€þ²þïþ7ÿ…ÿÒÿb’·Â²ZÃÿoÿÿÈþzþ-þéýgnustep-gui-0.24.0/Sounds/Blow.wav0000664000076500007650000007605411235134022016644 0ustar brains99brains99RIFF$|WAVEfmt D¬ˆXdata|\ÿíhÕä‰#^ùM:û‘ö ¼ÿ²ÿPÿ ÿ4ÿtÿßÿWszDèÿÎÿ‘ÿRÿlÿ§ÿâÿÀÿœÿÂÿ/MEºÿeÿ&ÿòþÿ#ÿÑþ—þmþ"þûýþ3þþíýíýÆýÔýPþÿØÿ×ÿ)ÿ<þ²ý°ýþIþøþ¬ÿÜÿÇÿ­ÿ¾ÿ¶ÿÿ§ÿEbÿ†þ«ýý5ýþ·þÈþoþþÜý þ¾þdÿäÿãÿkÿßþpþãýÃýþÖþ§ÿ…€ÛÿTÊ+ÿ•x«ñ|Á•8¥%¾ÿ¨ÿÙÿ]ÿX‹¢EêÐ)mn\2Ýš¶y¨ââŸä sÌÍÌèαùAÏÿ©ÿ¨ÿêÿT^H«ÿ!ÿÏþðþÿcÿÔÿ @&¯ÿ•ÿ[ÿOÿFÿ;ÿÿÿØþDÿ¬{ã!+ÑûI±ÿxÿ\ÿbÿnÿ1ÿ ÿÿBÿ†ÿËÿáÿüÿ¡SÅÆsÕèÿÿöþ6ÿ³ÿI£Ô¹WãÿÉÿ¡ÿºÿoïH•‡%ãÿQÿôþxþÑý ýåü?ýëýªþ9ÿ=ÿ ÿ÷þ4ÿ¦ÿÜÿÒÿwÿýþ¯þmþ%þ,þYþ­þõþÿùþ‘þ.þþqþ÷þRÿÿŽÿ}ÿ$ÿìþÀþxþþ—ýtýþ&ÿÞÿ÷ÿ†ÿºþ7þ÷ý³ýÌý’þ›ÿE“ÎÖê/R\óe±ÿ"ÿ>ÿÂÿlñú¢ø9*K|›HØÿmÿ ÿÌþ¾þYþ˜ýèü_ühüòü¸ýþÿkÿ{ÿ*ÿÇþ3þúýdþwÿ˜ƒö³ú×ÿ_ÿzÿ¼ÿwZ çÿóÿHÕ„èÌ*kÿ–ÿ2êÿ±©Å) Ô ÉuƒÝbwI÷Ñq'%& ÷ R‹‚v· q ‰+džb]YZ{y‹L'QŸ·æu/ó̤”›tC ö­ rÿ”ÿþÿ½ÿTÿçþÿ‘ÿ‰' *çþàýèýúþª[“Ê ¦–ÙÙŠBåÿ3ÿ³þ„þ,þ²ý´üÑûKûõú¬ú0úµù»ùòùsúûˆû†û ûÈú(ûôû\üˆü•üYüÆûmûlû¥û5ü!ýÄýÂý¬ý˜ý½ýþÖÿŠ`êºÿDýžû±ú´úqû›üþÿŽÿ¬ÿ½ÿŸÿ=ÿäþµþ½þÿEØF~ÿFÿVÿ%ÿÎþŸþÅþÿnÿ¹ÿñÿÅÿŒÿÝÿäÿÊÿýÿ@V+ÎÿXÿãþRþþ<þaþKþOþ¦þþþÿ=ÿØÿ¡Ø,ÇþýËû[û ühý©ÿ&lî\ ;‡&McêaLÒÏw¥<™3!ikV>&2!exà©?p\Å>¶‡·ë"nwX„ôÛX]ÿÿ€ÿ*?ç9ƒÄ¶úþ>þIþÿæÿêÿ‰ÿJÿ‹k‚ ‚+`ÖÿAÿ¤þþýýRÿðW 0Åû°œþÐýÄý'þ‡þÿKÿÿŽþšþ ÿ\ÿ«ÿ /¾ÿÞþýü;ûˆûý5ÿ°ÅVÿcþ,þCþØþiÿUÿÀþÁýýýxýÃýÅý®ýÑüvû-ú›ù úðúxû§ú ùÁ÷÷D÷ø®ú»üÛý þeý(üfûCûû©úBúvúKûÉü-þÿC3Tÿ¥ýÞû.ûrûóûOüóûîúúúÓûÚý2[™Èhêÿ»þþŽýýýý-ýÀüÏû´ú¬ùÂùAû¥ýgž½AÿÝý´üíûÖûdü þóÿMj=º7é \ÿyþþÐÿ.¿E#¥h@<jú}N®¨õóš¹<œ]HvÀæé…¿F ™Q ®U0.þq¿›°þtþwÿt'Áß!DÜl1àèÿøÿoËþ»»ïëãÿ‡›ÇmCñúJ¶Ó¤ž5V¬‹=Ud²ÿ þLýý[ý”þÑÿÙ—¡J óÿ‹þÈüMûÂúØú±ûáüÞýæþ ÿRÿ†ý›û7úÓùžúüpýõýÈýÁüŠû´úúù‘ùú«ú-ú}ù˜ùGú)ûÂûŸûû!ûÚûyüZýÙýQý›ü¿üéýÌÿ,»Z­@ÀýüTû§ûtü…ýïþSððþ(ûŠ÷¹õ©õö7ø"úû¸úú`ù’øuø)ùú9úóùÜù¦ù\ù³ùCûåü þ€þYþÑýý…üJüàû û¤úûSü5ý»ýþðýÍü‘ûhúÊù7ú6üÿÿ¤ ^¡’ÿ^ÿ J|dׯԓÿÐþKÿŸÿ)¨ I\yµ «Ù¿‰Ä¹i„P’ ¿+:¾øW¸)çw@f°‘ÄÂY æ  Ê ‡ A /šC´8lŸ•ap BðqZŽ>¡BÇßù·Ì ´ ÿ4þ­²`w d(cô{ã󗵺¯Y¼—Ï!ÿ9ýfüóü¼þyOBõCžewÿ ýTûbúú<úuûMý¼þ`ÿÿý¨ûëúäúeú^ùÝ÷ö—õdöÈ÷„ùÅú~ûêûûûåû­ûøúúAùPøÆ÷:÷…ö öDõ\ôÒôÂõöööuö.÷ˆø3ùøË÷_÷H÷+÷G÷jørú.üEýýýEþþ@ýTûvø¯õÆó,ó?ôD÷çúnýþÎüpúø¼ö:ö¸öà÷.ù%úßù/øòõ&ôÔóâôÍö‚ùÇûòü;ý7ý üùù0ø´÷¨øÝú[ýÜþ÷þ8ÿ«RÁ3}ÐÚoú¤«_f £K›ÿ¡ýÉý'RïWŠ™mJnÀ  r ÉS}gàGˆ'   ·  ,3'Þ§ö§ Y  ¢ § Ð  fÕŽa ;  î:1[4 ¥ ¹ GÜ { ®ü F7 e ³ÅEu¹F˜±«=ÿ±ÿ—÷C¸¾SEã?þàûûÎûaý^ÿTÿQ, ?þ˜üüˆü*ýMý)üóúÞúwûüü£ýÝýÿÒÿÈÿþûSùÂø¦øùúRúåø;÷ðõõCõ~öø®ù^ûüñý:ÿ–ÿŸþÅüÆúú`ûýpþÿÿ–üœù2ö[óòˆñ!òóòÅòiñ&ðÇïØïàðáòpôùôÜôáó˜ò©ñëðšð¢ñ“ó[öùZûýüü~ú•öóeññvòTô[õ»õö¦õÏõ–ö÷àöàöm÷„øú*ü&þYþzü+úOøi÷øóúŠý#Qö_èþ+þFþ<þ:þƒþ³þ»þÿvÿ±ÿƒÒÊXûßDþ*üøüÕÁ^ ȉ¤ J /’ ùëƒS  _ Ä j ø ¾ “nµÍ h U }D)Ã& ¥ 6ƒX² O ‚ ì   ž ä g  r 8è…Œ þj9[A Ø ¾ , 4 Z ' / M¡WŒ|×·Y d ã ¸œ!Ì&]Å?Éÿ¤þyþcÿzÿÁª:"4ÀÉþüÜúÂúxûîü ÿéð§ÿËýšüRü"û ø¾öÍõô|óïóuöú¿ý6Šÿðüûµø9ö–õàöÝ÷õ÷7÷VõÁóqò¦ðˆî~íûíüï_ñ–ð\î@ì¸ëìîVï÷ïŒïúî1î8î=ð2ôjøþú×ú‰÷ìóñð ñ ñÂï«îZîöî-ðñ¯ñTòßò=òÒðÍî%íTíhï*ò8ô–õ>öSö0õóLò‘ñ£ðRñ ô¾öPùJû°û9úvø¹÷ø¼úýD²‘¯BEnŸaC¨$½<67W c'hšÇƒêÿ{Ù _  Ô ÏZw– ™ =išäiÒ  ¥ ¡± È rüN±‘õ p ä "Žen: ºÔRœ Û E  P  ηÀ¢ÇÈDªæpªïܨ3LÍš Ù uWu«u ” + eºI™ÿÊþxÿlòÕCkŒW¬­CMj½âðh¦ ¹), hý_úEø°÷I÷8ø–ûHþþåû£ùVö£óEó ó|ñ‰ï¥ïòõ¸ö øúøÇøà÷Ôõòò…ð”ð¶ò8öUùhú•ù´ø×öyôÍòNñ!ïHíóì}îpð½ñ*ñ;ïíüê”é±é?ëŸíhïÜîÚìê–è=ç\æÕæNéÄêê éè‰çCé¡ìð?òtó´óêòòÅð–ï/îí—ìöí#ñtô‚ö>÷éõÏò­ï í'í î ðóAöËø1ú×ùó÷õ`ò’ð ð^ñ’ô¼øoü¨þÿþ8ü(ûü þÞ‚„ r 8 £% @ M Í ç ¹ Ð ã š 8 R î Ö s Ï % = ™ ¨ A ¢ºU!Õ6 w  ÍIGSûU@¢rNê¬e£Z"õÚH”By'.nY /¶ýA]šñ¸ÂŸ€‘¸æ²*s?åWw B ù £ U²€› p Õd¦ÑuN˜c–|”‚d´ÿ Pÿ¹þ°ýŠûnùJø<ùùú>ûiûÁý÷Õ ©ÿ”ý¨úð÷ÝôQò¸ó±÷öù˜úù8÷Üõô‚ñºð¢ñ­ñDðdídéæçæ¦êwíäì3ëùéUê*ëóê§êÒêpìVî¢ï²ñêó!ôçòÁò[ò¼ñò½ñ ñçïÂíäëÃé¶çæ¢ä³âwá]áöá!äðæ˜èsèç–å‡ã¦ã’å]ç:éëìCì¤ë;ëYìítï@òôâó¬òjñ}ð²ð—ñóöñ÷{ùBûÏüSürúÿø†øÔøúóûÒý’ÿWŸŽX4]J ©²ËèÕH6@=h>Ü 2 \  QæLi  GŸOwÍÒµh¶hïɵ´§˜ê Žï ÑìÑ8´ËÅ'0h½?#Cƒw.Ù¦=úe£úù#%©è`Äõ t jp ` ' ® Ï © î ö • ç ½  àã¹ådÿ¢þ¾ýºü}ûîûLý˜ý,ý<ünûü÷ý þÃû…øßõøõ<ø›ù¶úKû ú¥øøÊõPòWðMï=îÖîÎðUòócóOôÜõNøëûvþôüÛøèõ©óóññ±ï îrî®ðòùñÒï<ëçWäçâ,ãAã-ãüâ–â'ãä5äsâtßÞíÞSâ¸æøê0î"ï(ï;îüí$înî*ïVï¢îhìê¶èþç€ç…çmè4êÊì‹îîíâëéé6éë˜îÄò€ö¢÷Œö»ô òµîƒì ìVìûí ñô®ö ùkúZúUù-ùú)ûhý‚A€‰Ò͉–ŽvD<Ê9‡bM [ o  ë n | Ê µ 0 Ú D "”¯f¡¾Ñ‚£ 'šPý‡J‰#væÉ«L 3T² a-Œ‚.ܲUÌ:ìƒÂðzIÅ_^LÐÝ{¤Ñ=—ovÖ+ ¶   a p Œ š ; ­ÐÅþÁü£ý,rtÈ Þµ8LüûNütþYˆ®áÝùÿ[ý¼ü.þ=ÿ†ÿÏþýAû<ø=õ›óÔðšìêéÁégì€ð‚ò5òñ…ð5ðïDíìë­ë’íÒíÖë¢èåå#æ*é<íŒð–ñïÓéãVÞGÜ¡ÝÛàkåøè¥éUè3æµäãÜàßäÞµàqä¨çJèèæðääÒäÃ塿üçÆèŒédéGç®äã`âèáâ[äçëÃï0óGöãøùvøh÷Ùõ©ôÜôšö/øùÁøäöqô&óójôßöûø«úcû€úçøøÇ÷ø3ú^þ«R*  > ásÓý } ˆ ú ¡Ò Ì ·»¯_æ=a bb  ¶O „ !öíFS²Óž)Å•C…ï&éT¿eìOÈ̤ Ì²ëwߥ!$!î&Ê|<ü5^ [Á…‘[ù{ÄÇór=xJ O Ÿ §Ÿ $ Ð Ö ì  wÊŸÍ…µ·þ*ÿHi[˜@þõüUüDüxûpùt÷÷¡øßúdý=þ þ]ýtýå§¢Çû,öò.î&íï´ðˆòQ÷Êû¦ü-û=øLõsò+ïrë6çJåüãâ¼àëàãÈåâåþäÐãËáIà)ß:ÞÞÎßÝâå›ååŠå*çéÇéñéDëUëXè#ä[áÜààNß­ß»ÝHÙ+Ö¯Ö1ÚÒàdè îxñòlï‹ëÇçå<äRæ”ëoò>ù¬ý%s“þgúßôßï¤ëÓè¹è ëyîQò5÷Iû~ý‡ýËýìý‘ýÚý þXý¼û û£û üåû¾üxþΦ.êÙµ{¥lÜʧ«]º¤y nÖ÷ ð; & O µÐ :â¼c o´ç;9^wl¿ç©x#øoýÚw\8nkÌæ!Ö" #8"Q!YǦCœB»]wè à!µ)œ HÐø  Óš © 9 œ Û¬A ! -  ̰ÈÔ†@†2˜Àª •‚ü"þ7ûýøøñ÷Œ÷XöŸõéõ(÷pöùó—öü¨þ¿ü·÷eóFïîYñ×ôòø'ý4ÿùçþßûrùPöðñÒë‚æîã»âãßÜÆØjÙßVå ç™æ4å¿ãAäÇåLåÊä­æ·ç"ç“å§âçàùâ­çÖë4ì\éoå7àiÛÙJØÅ× Ø‚ÛãÝÃßçâçÛê‚íQï-ð6ð®ï÷í’ì/ízíí^îÅðŽñ¿ñåò}ò¼ïîì¹êwê…êkêaësíWïñóGõn÷5úqü¨ýïý+ÿÜ#p0_ÐÿýþMºê1 q @ ÀÌ´•ëáÒÿØLe× " § úšÊŽg*(ôà$qü-B9BµrrGŒÜ`ÙÿhÁÍç œ¦vocL1¥sé@¬Á!"þ ƒ­ƒPlèÛ4w¶Ã,Ö !>FÕ ˆ ò UC¼ú ™9tt $&Ùq{cþñüïüþ] “îÿÇþÿº¿b¥>þ4ü!ù!øú þÂÛMB|þ3úªööKötõªó¾ïæéåædç5èié™ëòëªëê˜è(ç'æëçAêåêÂèÕå\äÊä»ä<ä äŠä€ãàáÉáâ9áØàåáÔã,æ éì¦ë é çýå%æ—èhê6é0æ†â‡ßzÞãÞsߎáöãåçåìåKå|åRç ë˜îˆïî íëÎè«çÕèOê²í½òxõÔõö1õ$ôOômõÁõoõ5õ?õ(õcô=óåò™ôd÷púýaÿñÿTÿøþ%þ¾þÛ¢<—‡ Þ)jt-nqEÖ} “ _ ¡Ìþ+}pç¦eÁEñ’Kõ´ìåc/J(2—|e©¤5É¥·#!W!:!j Æ}à9< B„"µïïMÌVuìC@nVIÕV> ã /  üúÝò¼^[  á 6 R @ód" ûútA…Ëê'¢þCÿÈÐI 4¦ý¢ù>øÅö õóöüÍÿV0kÿþõüòü,ýšþaÇAÿ`ýœü%ý¨üžù ò†êÝä¯âlã¶ç6ïö&øÝôTí‹á¨ØÕØ+ÜØßßä*èéévêé&æ<ã¶áJàtÝmØhÔÔ]×LÝÿãÏé„ììlêòæâkÜ9زׯÚ\à÷æ!ì±íÀì¢ë|ë ìÍî ñÍñ¹ðøïŽïîÕë(êtéÂèQç¹äéâãçíHóøàûYü úÅõ”ðí¼ìçï\÷Ìÿ[Ç t ƒ ïqÿ?ù,õ(ôTõs÷`ùcü{ê  — Î8KýýGýaþd^ùv“* e j w­Ü:éÄ`· ‘™”´T#9U×%4’ß%x#<'•((Æ'%!ácn­>‘Pb©Ò`dOÛX «R&Û‹ä—)l™/º ` @W æ Ì ®Þ4Iv‹ ¦ #ÍþÐûý¹ÿ8Ö]% '  +ëÄóÏüT÷ˆòðÑð´òäõ'úËÿ§-¦ÿ¿ôÆêõèäïÑøLþ_ü:ö¨ò¢òÀò.ñ£îÄë‹êé"ç™åÀæŽénë¤ìë–éjé é‹ç’æ¯ç©éBêÛçâEÞ)ÞNß¼ßôÞÉ܈Û%ÝDàpâOãáäÆè¼í ñðêŸâúÚ,ÖÎÔÈÕþÙwá~é£ï¯ðkìÔåÌÞ*Ú§ÙÝ®ã“ëbóiù˜û7ûù¬õgñlî^í\íWï`òõ(÷Iø½øƒ÷ïõîõ8÷øž÷øIúOüýütý¥ýªü1ûYúóùú¦ûæûÓüÒý=þ( à7Lh Q†Â…LÐ .ÙZ¤ Š  ®¤8'Q°ÔÊôPý¡Xx½;Ê+AI"k#¢"Ä }½1Óôw»…écå½Ó …!ç àTùù< Õ Eîe- Ûa¢;äþMÚ±8IX o{ëR= ‚iEÿÿÌ€ƒ…ãÜýûúúü–ä­Šý—úÁú>ûýA4KýáûûLûpûäù+ùEû¾ýùýþÿ]§g’þüðùyôßï|ë¤å'ãå©å.ãkà Ý)Ýá“å)éë¹éœå;ájÜCÙWÛâßÏãæ§åááœÝ8ÚõÖ=ÖûØìÜÙá9æ è8çSæ¡åå)å¼äjãlâzâRâ±ázà†àÊàáíâºåbèƒêí¥î…íßëë{ìéíèîAðßò„õö´öŽõ ó¾ñ_òôYùÛÿ·£ ì ‡žtýbøõ¾ó»ôŽ÷úúþ[ÿ€þýüˆû³üÿ!!5çƒwጵ ‚ …±O»Ô!; X ® † Ö Íg€˜ÿ¨¥#u:æKʸ(|lPžÌ ·"œ"!¨Ä«ÛÑuš]ws-Ç gùd‚.Úœ'fHàê뚬—,c À Ú { %? o ? è : â 9 Æ  ‡ â £ ú ‚ !À(þÆûÄûÛüPÿ]j'þúÊ÷BôÆóåõJøYýfõÿôþøþcš£ýûÒùÊöþðGî1ð*õäúÔý¼üÄù6ù9ø|ö•ö+ùúø<ñ3éÒå¿äâ5ÞbÛtÚùÚ„ÜyÞßà'àSàWãÅååªåÂåWãá†àrà"árãÒåÎæöæ«åá3ÝæÛªÚºÛ ß]âæšçåç:é ëì0ì ë/é3ç”æïçÇê¤íÀîAï´îî†îðGò¦õøÄù¬ùû÷,õhñ ížèÃæ?éÈî'ôµø²ûÓýØÿwQþsügûºûDüÈû¼ûsýC$ v w é{ËíÿÐ0PË ‘ ˜U_„T>Ê » ð pqrx3c¨¶˜!"c!fätÕðv Dxÿ³¬L q%Æ7R Æ Ü"=#d!jÚÁ:xþ×UþZIV´+1gØ(,¹V 8 Ù> $ } · = … J Ý µ < îÿßûûÖüŠ‹› Wø µçýEú³ûWJ¬® Y ÓpùwõÒöäú-üÔøzñÝèõæ+ë-ð®õ[øøöYôò”ïìˆçääUãòãRèßëàí¼íWíªëûèiéìñ:ñœéêÜ)ÓYÏ£Ð2×àPäòã†ãÝß9Ú¥Ø]ÚtÞ„â>å`æÕä=á‚ÜÛÛÞ;äèªêçê‘èäçºìpñžòÆò“ò,ðëÌæ•åÓã­âwåºéÅîÓôBùù"öˆóÊòVô;ø=û×ûìøQõåò±ñ{ó-÷,ûÆüíû‘ø¼ó¤ïüîMòeøõÿç« OQ@ 08îõS %ã.¯ gæD Gëz„ ¼·[½>ðIo( ´é)dG㯛í3©9×’Gà b†|`Oq"4"[£0cuM€—âtm0Ó$ï¾¥« i82Ú!'ñÏ X ® r \d ± Ü ö¶éÁ½ÌWÿ ÿB0YÓn·¤þ.ú-÷mù&ÿ&B/.ýtù°÷£õZóõÈùÊýÙ6Œm«ýzù±÷Gõüðøê3æ'è…î7ôìöNôöëçá!۲سهÝMã èÚëÔéå‚ä(åxå×ãàà¯Þ0à@ä6ç&êí%ï;ñòÐîBç…ßXÙ×s×CÚ`àç€êÐë¤ë’é1åëÞöØÕÕB׹ڸߑãøç¯ì°î±ïIð¯ï¾í>ëìèõèíFôØùHüû[÷³òðêî@ïò3÷½ü_¨ÿTøgò@ïî‚ïäòWöžøvúiüþubY^ý¡úöùFû˜þ*¤e  Q°a" Z å   j>³mŸµœhö›g³š0 M´×îFÎÄ\«•vþUPSó‹ÉbB<á¨U÷j‰!&2%¨!^’¬dÙ !g"8$ˆ%%Â"”Ç£ïÒ.χ´Ê³ç:=Çiž]½oaÊ Ê!í³^°Mv±Ï§lê!  ß6:¬ÿYý(þ¢ˆùGôZ´Øj âü¼ü»ýý~ú_ù+ûìüÚýöþ  wìý²ú1ù¢õÕïÄéŸæ‰åðævì ô²ùOürû ù†öónð~ìÃè´åªà*ÜaÜlàhäÖækåÞàáÛ_ØØ×`عÚ'Þ3á‰ã·åèâéêvç%ã¨ß]Þ±ßöâ…äcå9ä*ßTÚŸ×]×WÚùÛ5ÝßÝÌÛëØï×¹×KØGÚpÝ-ßÝçÚÔÙ×Ú&ß‚æ•íkòö3ùû‘ú¨ùÃ÷>óDïìÈë•íãñ#÷úvûÃü8üµøœóÀî—ëèë ïóöçù üðýþqþ`l:à E ï ª §ž‚}ÿÿ‰Ï/ éñ u‹„ä›  © ¡Ïî§5“lP†zµ(˜Iµ§!©üÐJÀ|q> S#x%g&'&A$J!À/&!à"ý!+B_C_¸¥qÐÓUZ}"6 ä !ÍSzäb‰¼Bû ² T ° è®7r û ? ü %öfÿ—ù¬ô"óåô*ùGüGþ[ýÜþ ƒ8ÍòG7 7 l N jûÅóú·÷qöv÷køQù³÷ÜõœôòîÎémæ?æ^éwìzîúílìðéòç¯è‡ë3íåëEê³çÞâäßÎÜ'ØaÖ?Ù€Ý/âtåÍåä9áݹÙߨ)ÚÜZÞFà‰âÃæléréèÒä_âÖáFâŽãÎå®é§ìcíêì¤ê§æðâ¯á©âñå êìÕì±ìùëUë ìÊìöí*îŠîPð|ób÷iúÃûû2øöIö5÷[øëùªû4üüVüSþ‹cåY'I¤[þSû8ûHþÊŠ4 @ 1±  l[³ ” uЮO:ú¨ hïò]\÷Ï!! ã¸9èÜW¥²!1#$O#"_! j ¸"s%W%P"ÁÉqÈ!Ú$¬%Á$¬"D©˜jw‰i‚»nGjÕ¨ENh`Gà dLÜ P ƒù, z R ïÅÅöàj[Ä‘V;JŠÿæûÌúßúæüßNðÿ£ü½ü}ÿ!Êþ×ü¹úBû_ûQûøû‰ü þ!ýAù"öxôåò™óYöbùÖúú4ø¬öøöù1û…ûVö éAÞýÖÂÐwÎ%Ò\Ùóß)âÖàLà ááÂßâÃä´ãQâÚáá à„ßÞÅÛÏÙØÖ×ÚåÚÚEÚÁÝéáå«è_éç`á±ÛÙ9Úuß˜äªæ°åôâÔàÒßµÞoÝLÝÊ߬äüé¿íñõÄø–ûÍû!øûñCì`è忉êñ,÷zü*ÿÔýdüœú\ùLø¸÷Qø¥ùÙúûÁú¬úØú±úoúìúËü¦ÿ\(ìª&Y ú çy8ƃ—œÌ  ­ † ß ¶ -Oº*!„©f Ç/Ry!ô#)$?"€‰ù}Õ"½$&ü&t&H%p$ƒ"ý e õd?™ ïg)­üdNà«N “UF.,Ç ’ «G<¯x GͽøEd äü°/ ‰ ¶ ûh%ÿ÷þ§ÿäüÂøùrý&ÙAç¸iÿÎþ1ý[ûµø)ö•øûªúâö]ò5ì,é¿éhëîñQñ|ð5ð¡ïÈóü=ÿ@ýzúKö8îaå;ßÛÚÚ)Û˜ÜûßÈã¯ä³âÚÞoؽÔòÕÁ×'ÚÖÛóÛqÜ"ÝÉÜkÜ”Ý ß¶àæá:áÏà&å|é¹êOëêªå¬á"ßqÞíáçì(ï©îÇêFå±ßÜåÝáÏå(ç‡æVå´äŠåÚèÌîçõ…ûLý5ú%òééà3Ü Üß¿åŸðEûL (sgþ~ühünþ  5ƒ^W9î|cRÿdþ‹ÿbi5²ˆ<Ë DØè’óÌÊ4 – y QõŽÄR#k)ˆ-/ç.>,f'K"²½¥* -"$9$Š"Zdóf;¿!Ç"½#Ø$ì#!Ãïï0!z!ç éÍ`#Òž#'Ò&ö"Å)u©º * $ýC´  ™ Ð @,YÁ𔑑Ã-þ üŠû0üý 7 /+_‚ÿÿ¼þ®ý®ùIõ]ôôióö|ö]òvê ãËà†æÎîÜô ü^ýöiê‹ÝsÖ³Ú^áŒåÐèÆçéâ”ÞÁݧݻÝôá<èKë`é˜ãûÞPۇضØÚ]Ú¥Ø@Ö{Ô,Ô¢ÖÛÞbàyáâEââÉàáVã}ælé°êIë¿êÙç{å+ç¸ê½ìkí—ëkæuàëÝOá¬èµñ~úÿÇûõ¸îÔé®èíBôú™ýDþ³ü-ù…ôþðÍïóð;õ5úüAýýQüPû'üëý//aG8¸N ¬µ æ Ô  ! O ¹MŒKl^ 3tæðæ× ÞXB Kß#² "—´ Ö"!%È&Ë%“!Á…Þ¥a• #$²%'$_! úô)“±—›§Í”Â_ƒ vVxa~£u=ùÝÐ | ¹ a¯N^ 9Lï 0 7åR#-Ú…þúJøs÷]ùÜþ>(ü¿öáöC÷fúAÿîü‰úzøåúmÿÉÜKƒæU8üüªû û úlùºõÂðYî´î²ð¡ôG÷¨õ×ñKì¥äÆßÞTÝÝ`Ü%Ü=ÞQá„à¹ÝÝoÝvÞ²á©âáà¯Ý~Ø3Ô Ó£ÓÅÕ´Ú:߯âxåxæ\å¸ä6ãà©ÝôÚ»ÙôÙcÜÙâ é¸ë*êÒçÕåÝâñâ$åæ{èµè3åUß¼Ù[×.Ú!ànçÁïˆö`ùùe÷Çó‘ðTïxðôÃöè÷<ùCûû·ø0÷O÷uùbûƒýqþ¤þþlüûú™øø û„µ ï<±U%#Ô Â .P |1Ä ÃIÇj"~ Ü ÇŸŽ:- ˆº<µ“6ˆD[çÍ›#jp²& o"ò#§"¤ÈÀ–”H a R ¥!"ë!#"ï!’ ´Êc3lÕ60d§[ݱÉ5Ñ*çÝáþ!m€4 L .“ Xñä¾ó rúXDö6Ù!_Ž"þ8úŒú_þÖÿÅûN÷.ö³öâ÷Cûêû ûlýŠþCþ|þ—­‡Avýäøžñ×ê0å[âãöäóæ.èvæÊãýà+ßîÜ’ÜÝÝDà6äçÖèÒæcã¥Þ÷ØWÕÃÔ×#Ü âÂåºåå¥ç™êÏë>êëæïã4áߊÛ}ØÖrÔÚÔÅÖ‚Ø‚ÙüÛ áyåÁæ«çÂèËè7èëé(íbïèîâì{éžåJääIåJé§îŸònõD÷Þ÷õ¸ñïŸì¥ëëëŠïSö“üîÿ½Kòý3ú‘÷T÷É÷:ùOürÿ”x€í j é ^ E Ö B üã° ¿ g ’ 5 ñ ä ¦  ÜÍ’;š&¢±•QçæúÕ»ž= ¹%ô)™+.+)§&¥#Ó!à W .Cõîi£r!"*#B"¬!% óñ-jb­zdG7Ü  Ö Ð j﯆ 4 L Ô ½ Þ9„:jUŸ óÓ…ý\ö ó1õ=ùèýÇRAÿxýÊü9úöò@ï¾íîxò+úCúD Ó;‹ÿ¾ÿÕÙýéúXúDöô]ñfìUæEâ·á"åÏêíµí€í†ê½æ‚ãáŽÝ Û)Ü•Þyá´ãüæÒê§ìýìÖí”îÖêõáÛØ‘ÔoÖNÚ0ޠ޾ۘؔØ'Ú+ÛxۨܜÞùß‹àlß»Ü5ÛøÛ–ÞbáªãäþãiâPá$àËÞìßÄãè•ëí¦ê åÐßßÌá@èLð\öú9ûù]ö:òºî=íîÉðØó§öZù+üÿTÞ£?›þ¨ø¢ó òŒô¡øÏýÂMn:ݵ‰‹¸ T îí Œ ¥  Ï ~)lŠÞðsºtí·åeEj𹺟*#'•'é%&"B‡_Q)^!O$t&\()y' %³#a"á #å‚ ?!|!Š!1 ‡Ê?@ìx’·m\G'ŒŒW;/‡ÉT¬2ë,  Z)eÅþ è u² #ÜÆýÙú ûòúë÷Rõôõ§ø5ü9V­þCüÒõ°ó÷uü¤ô¬gü¤õîô”øühz0ýöñ»ñ¦ôÁ÷–ø6öEôöð9îÊîºðññ¹ó]ö¿ôð¥êöæOäâxßIÝ`ÜÚÛðÚêÚXÛ¬Ûlß%å\èäæ$â†ÝìØHÕÂÕÛõáEè‰ëÄéNå–à7Ý=ÜTÝ…Þ‰ßÏÞjÜÛ|Ú‘ÛÌÝxßNà¹ájâ3âÀâ¸ãLæÛê±îŒðqï\ëqçÄäéä:èKìéîvñ+ôÊö øMø÷—ô>òUðÖîŸî×ïñ!ó›õŸø¶ûÊÿ%GTaÿý,üäýØ€´¯ " _ ·Ýø]C   › å  4 ž>3)/Ü.ª|ÁÊ‚?¨eCLGC Ï í[„«Œ —g!Ø#<&ç&\&S&¨%ô"ϰ²åŠÙc">"˜ †þ\nbT ˆÕPæÖQG›Z×h1êX¬ã ~±›[M{ 2 Š ¥ ú v Æ‘oýüùå÷Jùæü¢ý|û}ü£þ`ÿ³4aû;ødõÑôø%þÀT4Ûÿ„þÏûû%û1øÓö¿ö¸òíëhé»ìòŒòfñàðqîHîÇð¼ó3ôìò¦ð!ìqæÚáÚàžâå@æ”å£ãáà!ßOàüáâáôÝ ÙB×ÌÖTקجڧÞLã™åƒæçå­ãâ¸áHâÈáô߸߈ßà¥âºå¸çÄè¸çæjå ä«â÷á»árâFä%éàî/òÝó@õŽô§ò-óêôJö…ö‹õbôYô±ôŸö•ùðúú ù:ù¡ù†ùÝúæýœë6üˆõޱŒ*P ê Œ … å ú L LøÂ °5 –³é!ÓhQÐÜöÿˆÄðàÏAõmÐ"Š$[#2!Ú ÷ 2!s"å#R$î" "“!ˆ!#Á#a#m" !õºóq©Á²/˜àû ˆ!ñ!3#z#u" ûX»Àxï“/tû±5 w Q | ï „ é  âË— â -5`ÐxÝüCú`úÁû4þé°~gýäù<øÔöÍø ülûºùŠùù`ø@ùÄùXúqúfù<öôóãñFðdïmî¯î¬óùûÌ÷òõöõìõ|óîê•èOê4íBîlë.å-ßëܸ܉ÜgÞ|áâˆà¾ßæÞêÜ@Ú-Ø¿×0ٯܘàcäÓæÒåDähâràqÞoÛxØ8ÖvÓ'ÑÑ<ÔNØŸÜÉßâÎåŽè¼êZëêËæãàá%ääçþërïNòÛóØòáïÍëÞèëèVìñôfôjòPîáè æmæÁèIíŠó‡ù—ýZòW#ÖN3L½¯„æZ NÞe‚È"Ø›¥» § XÞÿvy òr¤G¶¨|¨*j·q/“”u!$ã#!½Aô <&!Î!ú"#ù"…#×"!‰ ^µ×H‹ !“$X'’'û$`!GºË€)$^9P1¥ÿ½   *0‹Œ ) ç ’ ãaVû…5m, ¸ ¬‡ÀýüûWüaþÛýÖûÂûÀý½ÿ™ÿAýã÷£óðóYöbø„÷÷ÔùZûÎû¨ûûÛú¶úšûGú9öòjðUò/öwø»öÁòùíãëŽí ðKðíXêõëOïþð3ðÖëÂä ÞíÙØ»×™ÙÞŒâºåÜè长×â ßáܪÚÛ‰ÜBÞøâÒèVêçÚáLÜÑÖrÔÔÕ)ØðÜà!áRáâÛãåäå…åúå?ç@èêyíÑïpð£ïîvìñé€çºæèå*ä´ä5è—íŒòö!ù9úÝøˆöyôàò-óSõÖø ýã,Ò«£ÅÿÝûèùmùqû›ÿœµÝO pí}ÕšÞã® ïÿù¸óþ-(ðºFUxtõ>$bçÜiÆ  R•!ÅE€!û$'Q(›(t'ù$õ"ï!é o Z!\"ç"±#6%%·"ªÞÙá',õ h„œRkâô„}ó;QÝó®‰ Þ Ä”‘Ÿ‡Ò¶õãÇþ‹ûúù¸úýÆÿu&:X•^ÎþÒøŸô/ôÉöúâü…ý¡ûaø÷¤úöýtÿÒüöIïuë§ê—ì£ïCðûïÏò¢÷wøö`óúîëƒéDêUìívìì?é·ã)ßÛÊ×ÛÖŠÙ.Ý3à¸á°àDÞÜ:Ú=Øn׊ØÛšÝVàõâxåçºæ=å'ãõà…ߴ߀àæà‘àÜÞ5ÞÍßLáìãÝæKèæçÀç(çoææåKå 峿æê„ïÍó±õÂó=ïXêúæÜævéÐíâò¼ö®ø™ùÖøQ÷öeõLöù¤üÍÿV€4 ,þÆü§üÖýHÿÿ-C™š¹Eóy”ç« h \cËÑôÄ´DyÎ,»rØ\¿“'âšÜ&rŒÍ!2##."s Å4>uy 5#j$X# !ê´`=ȹ= "+"V yûO®þº4Ï\gbVP Ža\Ö w`í` D ì 47g 4 è› qìØbWjÿrÿÜEò:âþõý•û°÷)ötõö¿øXûâüDý ügû¦ùóõüð+ï‚ðQòÏôÇ÷/úÐú9ûú½öLõŽö ù”ûéû,ù!ô?íNç®áôÝݣݾÝcÝ‚Þ:߽ߛß~á‹ãÒãLãâ áámálâxâáAáhâ¹ä5æEæ$å äCâ[ÞÚ`ÖžÓ>ÓƒÖJܰâ†ç¨èOç«ä¨â%âåãç^ëºïèð©î¿êõæÃãíâÝäöèîÝñuô~õ¥ôHòôî§ìììèî ñ„ônöWö­öoøú¬ûnýÏþÿ’ÿ4ÿ¦þ1þöþpÿÔÿz½kßû †ªW u!jBhV oíR™5c&**_Ü]÷ú¶rÎÃKE œ!©!„nÓ[´*ˆ åeóÑ_j W  7te×#!B y"û#»#"Èú:;Æþ6¦°-zü â ´™{¼lî •  ü = ß S P ¨ ~ !Plp{\ÿ ÿðý=üHû0ûûÞû.ÿa4¨ü!ùûõ‰òkï@ð•ôê÷Âø–ù×ûþülüýúíø°õ®òuòOóŸòNóRöøŒ÷põñÐífìÊìÖï»òxó¸ñ·ð²îðé²åâ¸Þ†Ýçßhä>èèXæãàÓÞéßúá¹ãžä‹äÑä¿äªä§äæîèê—é¶æã;áàŠÝqÛ§ÛƒÜÞ„àûâ‚åçÖæïååÎäPæ)é¤ë)íí[êfæäãZäÃæ«êUðûõÇù¹ú•ù÷™óVðïØîbïSñÉõàùüPþ”þÆý üûúùnùfùû3ý”þ§þÈþ¢ÿÐß­ ù ³ Ò ç Ñ - ü ú / ð ý/vÑî^& –˜Y4×ö´ _ , #+  Iù.‡N÷¿ºäè7@¹E1Ÿéàk=XéÛz  p þxë¸ñùLŽÎ‰åË:Ë3›ÖCÁ‚½ Ü Ð Y E W ì Ð ð ¯ Â Z ÌZ7ÿ0ü˜ûhý· üËþˆü·û6ù"öwó©ñòöÑøùáù®ûŒüûÄ÷Íôô!õÆöÁøñùt÷4ô!ôÄõf÷Ÿø£û¤þèþ8ûdôkî`ë¯ì ð6ñ:îhé…æå©â.à ߓ߇áúãnäÈâîàÅß·ÞZÞ:Þ¸ÜÚ ÙKÛ,àøä5èµé†èyå#âÉÞUÜíÛRÝáðåîèJèåâ"ß÷ÝàËã׿éÐëcìåêôèÁçæèUíŠò€õHôÎï¤ê"çÀåŸçŒëð-ôDöYöCõêóôÂõšøàûÿsDVµ›òkýÿN ‹È¡g¨rlþ¬®BŸ + puÕ U Œ ŽñÜðN¸ô‰:¼Lð¯CE×q·R]ÍôgÖ³ * Î"r#‚"Æ r®vq ¥ ß y!™! Ê´ÿµëõ{z¯t”ƒ¶´>ýšúí·%i­ À r ¯ & é   Æ ? ¤ Í9õ®w×ýküïýÔÿ‘ÿ!þý|ý`þ5ÿÿ/ýFúç÷šö®ö+øwú®ü®ý‚üùžöäó6óUóÎóðõÑ÷8÷Mô«òÛò»óºôÄõÚöÏö5õŠóÚòð+í—êíèoèÒéë›êîçqåYä“勿¤ææŒåKæšçîçUæÙãTâ0â©ááEá§áÕâ'ä)æ&é©éßæWãíà(à–áÜä¨èæêëÏé6èGæ•äƒãMäÂæfè.èçJæŽæ2èÊêîYò_õ©õfôó"ñ¾íñëmìæí­ïçñó³óô0öÜ÷Dùùù°úþûý¨þ¿%C¨íeäÿVÿïº'{Þ«´«äÜÇ  L*ÕpMÿ µ¦^Cò  ¶ – ê ØèÈ h­uˆcPwþ‹$~‰¦mÂþ¥Ÿ†ªË!su6ô>ÝLè4ªÔëЫ±š l—‹œ¼ /­ ¥ ) ¾ º Ó ] q  * # !ÌPûG;Soòþ"þSÿàzÀnÿ¸þÂþTþÉüÈùg÷µ÷-ùåùiú úçø›÷=÷øEøG÷ŠõuôŒôcöWøPø÷õaô`õ%öNô[ðîØíµî«î˜í5ì$ë¸êvêrêmê¿érèÙæÈãDàEÞ,Þßµàyâèâeââ:âã‹ãÀä6æyæ0æFå1ã6á>àààãákã«ã?ãKãÑãäöä¼åœåKå–å‰å±ä“äàåñæŽèYë¤í¥ïAñÓñìðxï:ï!ðñšò.ôîôêôtõëö€øªùúdúú¶ùAø€÷ƒ÷ç÷8øùÚúÊü!þpÿyˆ™Ü} ¯ì†Y)bZ Q ( ö $ š ¬ ý • ì ý?t/ÞÄÂn8¡“SמI£Pu])Ÿ¢‰E…œ†ÚTƒg,G«Gó+^ð!²0èBô* í@ ‡ . ç T 3 ' q × °L¸ À  rf9o€±l  |:jˆZþ¥üÿû4û¿ùùÚù}úÒù†øsödó£ò„ô²öøÙø¨ù5ùªøIùÛøRø*ùÑùîù<ù†øZøóö¡ó ï¶êÒç%çÌç?è‡é×êëíYíµìŒì íqîÈíìméÚæ˜älâ€à@à$áàáãGäöãòããä å)ãá“àoáÒãçKéïéÞèbçaæ„å+å'åöäØåbçºçnæªä[ã]ã•åßècìGï_ñþò¥óýòÇñÔð’ð­ð“ðˆðñòó ôkô¦ôÂõÖöøDù ú(ú!úúÉùcúxüáþÚ‚Ð;éÎzSÍ "è  â  Ž ê 0‰ h  ˆ … F â AVt+ÊM²Ò5uBI(¹+õ¿Òã8iø:¹wöRËíEpKBÓ ¡!! êbºB¨bO0£õ0Îû*8ÁÁzñ"Ví(0 Ò Sî ?8Éj  B¢VQí5>²]ˆAjÿÞýTý)ýÇü¼üùü5ý ýþ…þnþüý½üþú¾ù.ø‘öøôÑñ@îjì»ì–îÛñbõ ÷·öâôóxò4óƒõŒ÷æö~ô¤ñþïVð¾ñôŸöÓøJù÷ô ñ£í%ê"çãä¶ããØâ\ãÄãgãã9ã áôß©ÞèÞæàÝãMæÀç›èéþèèËæ3æËæ¸ç&éë„ëéæÔâ½àá¬ãVç#ë0íÝìžë3ê#éÁétëÁìUíí«ììGëøê…ëðìÎïGó"ö÷öÆôwó‘ñ5ðÖð‘òõ~øxüiÿøØ8þ¼ ÂôW„x‰’² ‡'¤  ¥ × E ° ž§³ ° ^ð¢Ëä,øa…HÔÜǦå,;s`Ú‹ XAm&ã‹Gi²´áÿ]`ĺ Èûƒ¸s“i²wâøcj)tĈ‘2á8[ó Í Ø Á –§Žrµ O r ¬ h N •­®ÿuwÿ›ÿ¹ÿFšätíÿ¤ÿÿúý üùøªø£ùœùßøž÷?ö7õ õöÅö²õçóµòò£ñ]ñHðŒîî_ï$ñóMôÈó.ôöýövõ³òúîûëëÕê‘é¨ççæYççÖæ)ç)ççÒæ*æ8åÉä–ä1äRãIâ=áíàâCäÝæ‡èUèçæ åã,â_ãåçnçç¡æ¢æDçŽèYê;ëvëìJì˜ëóêPêøéUêëfìŽîPñbóWôïó‹ò¤ñ¯ñòoò’òÀòó\ó ô.õDö÷;ø¹ùïúýû×üÑýÿšû¸ÁH+g|= \  ;°øÞbR Ñ  ë © % ‹ ÉMÿ±“U*p*¢+ìÝþôu9s^¤Zµ&‡{)Ò«Ì{Œª÷ Ð ½b> ãQÛôñwRèÉ(†„€Ý­ 5 à — ‚ ´ ß _ Å & “`0§C…ÆÅÝí aÿ¸þÃþYþgý¥üwüüÊû*üüüºúù}÷lö÷ü÷å÷;÷(÷¡÷vøãøÈ÷èõNô¨òÉðïJîèíï›ð1ñññiñ#ñ³ðtðîï±î5î‘îƒîèí0íYì»êßèèvè½èéIê'ë÷êõé~èDçÿæXçè'éäé©éfé«é+ê¾êë‘ëýë¸ëë^êãéIéÞçÙæ¾ç ê›ìtî|îäìØêTéäèVédêäë&íëíeîHï ðððñÖñ¤ò—ó{ôñôÈõÁö#÷åö¨ö@öòõö>÷ÚøpúŽüƒþ²ÿÌÿQÿ£þ8þJþ|þÿ‘ÕZô§,`QèÉC´ < ¨lg_”%n=”ÿm°õÊjaEß)àOØÖÑ&†Ÿ>®Ã$»9?Ï>g-ݳÇÔ³·èÆ?»¦’³¸=?£•N'l‚ß › £÷R Ü „ } å N }œ©¦çÿçþÿtÀâKþtûù<øÝøêùEú5ú¿ùçø@ø:øZø8øÖ÷÷@õBópòòëòÜòÒò–òòÃñ…ñðEïœî—î+ïðäðçñ·òÝòÈòUò¬ññBñ%ñgð/ïúíUíJíäì†ëàéäçõå†ääXä9åaæ?ç‹çÈç˜çWç2çåæÕæ8çüçéÖéùéáéHêÐêë$ë¼ê¹éêèýèuéÆécê3ëÊë–ìÓí¸î*ïïÝîžî|îðîðÁñòóöM÷)÷¦õóóêòógô÷õ[÷ùCû`ýÿöÿC¦Qö¿±¥½v³¤mds_€–Þ“Qr B á Š ‚ ` ° ³ Ê 9—p•u6‘ .³Ê›«òg¡[ZÂè 9ܰ (•¬}»êç59°èv!5ªî4.«8y´XG˜»o,ÕGt‹É…£i ì I  ¡Oë%kìÜÿé}[ˆJ’Þ™kÀÿ(þbý{ý¢ýHýOüÊúqù«øøñ÷Tø\øø øø÷‹öoõÂôñóó–òBò¿ñ:ññHñ&ññ\ñò¸ò™ò«ñzðNð ñòMòññ:ñ‚ðâï§ïðÅðñ¾ð\ðÛï ïGîîÕííeìöëë¾éBèZç§çÁèÕé5êúéþéÔéÕéÔéê'ê³éðèSèUèŽèÊè?éêëêõëêìdíúì ìeëmë)ìcíÝî‹ð¾ñòÑñ‰ñvñüñÍóúõd÷Ü÷_÷Bö9õïôÃõ÷gøù|ù–ù‘ù,úAûÃü)þ“ÿ…‘ñÿÿ¼þñþ¡ÿïƒÇã©]>Fu :  o s o ø »  u Ü ä § o ² ƒƒ³© ­£0!È#À4(B»ô²”ü¢~–CmBÈFé0“‡0U¢„Aû©‰˜2Õã,‰ò⸠Šè 4 Ï f o ˆ C ú £ R ™ 4 × ¡ëÙ¬v*ôÿ2ÿ.ÿ_ÿ$ÿþ·ý ýàü¿üVüÈûNúø#ö~õEöá÷Œøqø4øI÷Põ óùòó|óäóIóòZñ#ñîñþòLó`ócó~óüòÑñøðÜðñ2ñ:ñ#ñõð&ñ”ñò-ò†ñð/ïÎíáìÚìþí(ï£ïBï¯î£íFìÂê=é§è_éïêÙì‚î9ïÿî î3íÉì´ì¨ìíÄíyî|ïfðçðñâðÛð/ñ)ñûð©ðÝïïî”î^ï¿ð\ò*ôNõTõžôÌóäòò‘ñ¾ñ¥òçó}õŠ÷†ùûÊûüüü_üýEþXÿ‹ü3¸Ç™Ãÿ°ÿ8¤Ôex— L,˜Fê ³ e æ ³ o Å †  — J C  ‘EíOøk¼š<ÿ˜ù ä‡J‘€#Ú`{d’î‡V‘è˘óøFðµ{›ÞùáÔïõÞ˜² <  ° Ø 8  È ” H þ*0#Gê[q\÷A<(5r+GÄþî¼ÿãþVþgý`ü€ûû7ûûGúZùoø˜÷Îö,ö|õ{ôéózóûò§òvòpòÕòTóªóºóóAòqñpðjïýîSï3ðNñ.òËòæòªò‡òQòò;ò“òNòVñ0ðHïãîýîoïƒï ï‹î<î-îþíäíîöí±íhí^í9íwíüí£îôîFï±ï“ïkïïûî-ïbïqïÄï6ðÃðõð ñ‰ñ ò òµó õàõ2ööÎõuõûô½ôõeõˆõæõ#ö»õÐõ³ö§÷Šø{ùïùÂùËù[ú û•ûnüaýþ¾þ\ÿ) $÷Œýc½ö ]î®_’ˆžãôýSÀç b € P t © ' * Y  ¸ cµ+ƒ›šÄMžét‹l`ǃ=é´Ïÿ?>é·|{º¸ { r } k z ” ± ú LkxRBÊ „ J ¬  Ñ Ö » – s - ´ 8 ˆ ~ujÄfä„ #ÕD Ï>¸ÿxÿ+ÿÿþiÿÎÿ-Çÿíþ1þŽý9ýþüPüpûáúSúÓùzù`ù'ù×ø­øaøøq÷ËöNöÊõ õJôóñòò[ññ“ððìïðbðsðð¶ð‘ð¨ð.ñŽñÐñSò–òuòQò‚ò‹òžòÜòLóWóóÍò7òÖñ±ñXñžðð¼ïï‡îEî#îîcî¦îwî5î0îYîEî"îDî¨îQïòï¯ð(ñ:ñOññò«ò,ó¦óîóDôÕôõöRö“öÏö ÷6÷’÷ß÷,ø{øÕøEùú»úûKû¢û½ûâûZü ý¢ýìýRþ–þœþöþ’ÿ2ÙÄœ9ö‚c_àø<«à 5 ¤ ?  Ž ¬ « ’ • Ô  ™ X ¯ 4Z,Ú Ï =‘œ¦Ïü.¯.;6{Ðx%Œµ¤£‚,úÔu ¬aíÕÒÒŽþY°  ”  Ý š I A ê õ é ¶ Å Ë ¤ ‚ q E þ ÷ &  O †ônÚ‹*¡ºs9Âã<}—ÿ ÿÚþ¯þzþžþÙþÊþþDþ­ýóühüêû–û˜û¬ûYûûýúÀúaúðùgùÒø„øžø—ø=øÑ÷b÷÷÷6÷F÷ ÷÷ö’öæõõGôsóØò|ò‰ò”òŽòxòLòàññ?ñ¨ðSðwð¸ðþð(ñññÈðwð¯ð&ñÀñcòòŽò²òúòótóÑó­óFóýòæòóóó­òPò-ò[ò’ò±ò¸òò9òRò“ò³òÓòòòeóúó¸ô´õ’ö+÷÷‚÷`÷@÷÷2÷z÷%ø ùêùÖúû6üÆüýPý·ýÁýœý¶ý×ýSþðþUÿaÿxÿ‡ÿ«ÿëÿb§¬EÔ/¿>— wŸÚyD £\ Þ ð × ã ò ç Þ  ~ z Þ W v ! í ë ñ ß Ã ë ÿ . { Ô Û 2 <  ò ¿ ‚ w l ì A » ;5ì Ÿ y Œ Ó O̼˜m÷ Ê ” J º H è P º ~ æ “ B õ¡2ä…9H‰~+Å:Ò^øÏ­9àèרÃÑAqÐ cÓÿrÿÿÿ=ÿÔþFþZýgü(üPüfü ü§û;ûñúû û½úlúøùvùÜø‡øyøMøøä÷Î÷á÷0øøvøøf÷Áöö|ö˜ö÷d÷O÷ ÷Ôöö8öÝõ€õöô;ôÑó¥ó´óÕóëóôó+ô*ôèóšó\óBódóÆóöó8ô²ôõ#õkõ¥õ õõmõtõ¡õûõ•ö÷U÷/÷Ôö ö¹öÃö¯ö«öö‡öÆö&÷Z÷Ž÷Ù÷ì÷ì÷å÷Ð÷“÷¿÷Ç÷Ñ÷Jø¼øXùùùŸúûûôúúúûVûõûªüxý/þËþ.ÿLÿXÿ‡ÿ‘¡¢…z‰³æ[Ó&]žÕÙ×OyìREayŽÃ+|£üB¤=´ç7 B 5 n ˆ ² ã < Ž Í ê  K ! ø y Û ˆ j b i e ž Ç µ · ´ ™ t Œ y 8 Q ™ ‰ 4  ? ~ Ü ý  < ^ N ;  "  ò «XDçµ{“—¯HúvY<"O†‰ò£TäFþÿ÷ÿ d«bâÿÿSÿ ÿºþ þ™þ‹þcþþ¬ý]ýÝü*ü×ûØûûSûdûXûûÂúŠúìù[ù ùÃøZøføhø2ø$øLøÉø)ùqùUùgùùødø€ø“øeø%øøø0øEø>ø0øøâ÷£÷÷ öyöVöWöƒöŠö_öNööÚõíõöWöèöL÷i÷[÷÷êößö÷O÷°÷øŒøæø{ùÕùêùú0ú1ú)ú-úNúYú úú#úZú²úûlû‘û›û‰û\ûûáúûQû¥û üZü¤üÂü ýPý~ý­ý.þCþ2þ„þÿ¨ÿw•ôVÕG}us¯;Wd>-©¼BÊîòê¸a K¥ù'zü/¦ºø*ní< ? [ N  é¿b)óáåÆDJJ* +;ð¬t3IV/aØìÉ·”Žggmw^ê¸w9ôš,}ÓgÈÊ÷Õ<çÿ¦ÿ?ÿÍþ±þ³þìþüþÿ5ÿ%ÿËþ©þ•þ¢þôþÿïþqþÓývýtýý¶ü™üšüƒüBüÇûtûKûûÞúÚúÁú§úXúûù›ù6ùùˆùú úúóù¼ù’ùºùôùú.ú*úÕù´ù°ùÎùåù]úÇúÅúžúwú?úÈù˜ù–ùÒùöùÎùˆùyù`ù[ùšù®ù©ù¢ùšùeùù@ù}ù»ù úƒúuúUú/úúIúœúû¾û(ü;üMü6ütü´üúüCýÂýÌýïý:þ!þ*þ]þ¶þÌþ²þ¶þ¹þŒþWþ:þWþmþƒþ­þØþ ÿZÿ—ÿÆÿÿÿ.]»8€|ŠõQâZœ¨ÈGSw•É((64éÍÅï  :Rhz-M„‡ßD6 ïì'{½*.É®þá”›<úòʳ¼½˜[<á—»¿kíëý̳’‡oI ùÕ¬ÍçæîäZÕÚîæ—`XXÆ›c:Óÿ¥ÿ^ÿÿÓþ›þ?þ)þ'þêýÕý»ýýlý{ýhýýý%ý0ý ýýæüÑüàüþüÖüÇüÐü«üü¤ü™üpüüøûÑûûmûEû7û&û<ûøúÙúçúµú0úú?úLú(úú#úúÜùòùBú®ú û+û=ûAû?û û×úÄúôúû:ûvûlûeûqû}û†ûŸû”û•ûÀûÉûËûÃûªû…û…ûlûLûbû®ûáûÃûÞû,üOüeüŠüŽüœüõü ýý=ýýðýAþWþ¦þíþéþ&ÿƒÿoÿ•ÿ¾ÿ½ÿîÿ?ˆ— ·Ã™TPw²öÑÊË÷ÿXŒÊAh…• ß3†™©æöGu•§­‹‡šqFN9VppMhL4öÎÉ †}§ÀF8ýîöùJc~fFN04†Æ S9(ìÊŸ’aй–£¬rA$îΩ3ô¹fSWDE\jva* õÿºÿŸÿÞÿåÿ³ÿSÿ'ÿ/ÿ7ÿ!ÿýþôþ“þýý¥ý£ý¯ý£ý0ýýýüüýýíüÈüÈüxüHüQü.üþûçûÃû½ûàû.üqü_üIüRümü|üü]ü3üPüAüùûœû–û¹ûÍûôûüáû®ûûyû‹ûfûEûDûtû™û†ûtû{û„ûyû ûÒûõû üìûâûëûÜûÏû-ü•ü¼üÔüýAýýäüý<ýrý©ýÇýæý³ýjýbý®ýþþVþ–þlþuþMþ\þNþEþ3þ1þrþ„þ®þ»þêþ ÿ8ÿ£ÿ&dy\v­ªïmÌ·°ÅÒè 6KOG,õï Sf_(2l¨Øa#õ#1*S„x¬å÷û?(E…pYQ4 íï6-ì¦Y+üöóÑìõÈ’´ÝÚÃ¯ÂæÆ¡ÉççòìÇÇÁvAZ{J$Ü•f]?÷±†’WòÿŒÿkÿ?ÿ5ÿ0ÿ&ÿ÷þºþ•þÿoÿrÿ„ÿ˜ÿ‰ÿÿ»þ‹þþxþ¶þ¨þƒþ+þþóýÌýÐýßý©ý›ýÀý~ý>ý%ýûüàü·ü¢ü…üxürü”üÄüÆüŒüwü‹ü‚ühüFü|ü›ü´üÓüîüíüãüõü$ý,ýYýlý5ýîüàüÆü¥ü®ü®ü¸ü×üêüý"ý#ý&ýýïüøüÔüëüý4ýOýý.ý!ý=ý…ýqýcýtý¹ýãýøýþ5þ"þ#þMþŽþºþ¯þåþÿÿ>ÿmÿfÿ`ÿfÿÿÉÿËÿˆÿˆÿ¿ÿßÿ 6 )&Aa‘Ë Qyš¢¸Çô VAMtÔfR.ùW ‘?,AQ‡r(åÇÍæ 3Läî·fD\¦™w#õû +2ñƨ\3jJþ楾ùݹ“tQýóÅø #êÊ£iCðÿ¾ÿºÿÓÿÑÿØÿ½ÿˆÿ~ÿXÿ<ÿúþºþyþFþFþEþ/þ!þþþDþnþ\þWþ}þqþEþùýÀý¬ýý¬ý¤ý®ýÃý«ý–ýý‹ývý®ýÎýµýmý&ýúü ýùüÐü­ü¶ü¿ü«ü¤ü¹üÐüÓüØü±ürü–üÀü üŽüµüÎüýý ýý#ýòüëüÿüôüýü?ý†ý†ýYý(ýMý[ýSý>ýsý¤ýÐýöýþêýªý°ý³ýæý@þ^þiþjþXþfþˆþ‘þzþŒþuþ`þpþŠþºþìþ/ÿTÿ`ÿ~ÿ°ÿôÿòÿ$z¢‰Šy/Jlzµ 23í¶Æ!Z°Ñ ]w¥ˆ”¤º±Â°‡yŸå)H'ä”´»Íû)Ò±¥£¹±®«35P_r[fjYnnu†|c=FsŒp1&øî¢~r`TIã¶™†Œ|…{A:<@+ ¯ÿkÿkÿtÿ¿ÿéÿ°ÿ–ÿvÿ9ÿÿÿþöþæþÜþêþâþ¬þ{þfþ[þ9þMþ^þbþFþþüýÜýÔýËý ýŽý\ý4ý'ýáüÉüÙüÖüÚüÌüýü6ýýôü ýXýfýdýoýlýcýTýLý7ýýÿüý#ý3ýþü¨ü‚üÒü ýFýýý-ý2ýýîü¿ü ü”ü`ü`üsü‰ü³üòüý<ýwý¥ýÞýâýÔýûýþïýóýþþþ>þiþ„þšþ»þÐþØþÒþÎþÜþ×þ–þmþ–þ×þÿÿÿ ÿÿ<ÿHÿ_ÿvÿmÿfÿƒÿ´ÿÇÿÛÿZzްÁÍÿ,DDLh žÃÀ¬“ª†j^|²åàæêÅ* ./iP:?h«È³¤Õëö©meŒ×  צtQ:;[p€uf#<Ñ¥¾)ì¿Úٯƾ¶Óæ¶z\MY`ƒ’}5é¢|p¥Þ¼•}‚† ²ÿ²ÿáÿÌÿ¬ÿªÿžÿpÿ4ÿCÿÿÔþïþ'ÿ$ÿ ÿ$ÿûþ½þÈþÉþµþÇþÝþÓþñþÿÿÅþ®þºþŒþqþ”þ·þzþ+þþáýÙýäý þðýËý¥ý„ýnýgý®ýÊýœý`ý†ý­ý†ýZýLýoýŸýý‘ýÔýþÞýÏýäýüýçýþkþ’þ‡þ`þQþ=þþèýöýûýÈýàýóýîý0þ6þCþUþ¯þìþÉþÊþ®þŸþ‰þ¹þÿ2ÿ!ÿ*ÿ?ÿDÿ<ÿ7ÿ>ÿGÿ]ÿYÿNÿsÿ¬ÿ›ÿ´ÿçÿ#_™äíØÑÎÌèç¹°Ù·¯Ð 4<MkT&E_†ÖAIOOU'=ojVK+ 9cw²³´°¯ÄÈõ 枬ɘv‹kDuœ°˜ª„ž¥™mlo`_}¢¤vjrPbjD<éÝëð»¶«iHk{Cú 8 ûëûÜÿ3O¢`@%þÿglcg!¯ÿuÿšÿÁÿòÿ÷ÿÚÿ®ÿSÿåþÝþ ÿ.ÿQÿMÿ3ÿÑþšþ¼þ¹þ‰þ´þÙþ™þþ•þ”þ«þ¤þŽþzþ„þyþbþRþmþšþ¬þƒþ[þ_þþ‰þ‰þšþ}þTþ,þþöýðýêý·ýký…ýÌýéýäýäýÉýŽý ýþ5þBþUþlþXþTþkþXþ;þeþxþlþtþíþÕþ¸þËþÃþ‚þ˜þ¸þÚþ(ÿLÿrÿeÿ=ÿÿ ÿ6ÿ9ÿ,ÿÿ4ÿ<ÿ0ÿZÿ‚ÿ|ÿgÿAÿ@ÿUÿ‡ÿ¶ÿÎÿÅÿßÿøÿÿÿ3`x£Õê÷æÓü!<Ø FG€TT„š…‘ªlCn[PiŠž®ïØ¥¦×ÌÎÿÊ>s³ìÕ—…yRNhqob8 ¿Éý5\][0Ðck³ýÁpQ,g…”¹Æ¢«¸‹c‘™¢†n) ÚÃÇüìÙ ñ‡Ka•§t-ëÿ­ÿ{ÿ/ÿ ÿ}ÿ‰ÿÿÓÿ½ÿrÿQÿ ÿòþ&ÿxÿ‘ÿxÿ-ÿÿýþÿ2ÿ×þ¬þ±þ¬þþ«þßþõþªþ{þƒþ|þxþŒþ™þDþøý þ.þûýäýúý þëýÖýÔýÛýÞýßýôýîýÙýÞý›ýTýFýIýwýÞýþþþÌý´ýÖý+þBþPþjþ>þþþ4þ&þþèýÛýâý'þSþ&þõýÿýþNþ“þ¨þ…þfþiþxþ“þªþ¡þ¥þÀþÄþÚþþþ$ÿ.ÿ,ÿMÿªÿÞÿÖÿÖÿ ÿ•ÿÎÿ÷ÿÂÿÍÿØÿÚÿàÿÙÿ´ÿ¦ÿˆÿ•ÿmbr¥Ú鯑k>[‡œ¢°ôÍúl§²ÉÕÖ¤«¬¤yCo¥§”®Ô¾u}™_TWK-jȨ»ÔæüÙ¸×ê)( 𾚊ts“¾®…mkMLgFhk\Y9é²¹ß˹„}kzžÅ¢c‹ÍÒ”²å±xBl›qRxr(æÿÒÿ³ÿ²ÿ«ÿoÿHÿ6ÿ5ÿ.ÿ@ÿJÿÿÓþÇþÄþØþ ÿ"ÿ0ÿÿéþÈþÒþúþÿéþÿõþ£þþ—þvþqþ³þØþ¸þzþWþ*þ,þ\þ—þ“þ›þšþkþ3þ1þTþJþ-þPþRþ9þ=þ>þ5þ0þ?þFþ0þþñýÓýàý þ$þ þ>þzþtþ‡þèþ&ÿ&ÿÿ=ÿHÿÿ/ÿ=ÿ?ÿÿ)ÿBÿÿ ÿÝþÅþéþÿõþÿ`ÿÿ\ÿWÿ[ÿRÿ"ÿ/ÿ}ÿ‹ÿvÿšÿÒÿ±ÿºÿõÿóÿÒÿÈÿÒÿÎÿËÿ j§¸tiƒ³¹Øò ؼͱç3sY`N&ü7fj\c^GJV[;/6O©áΓÁÛÑÛ¼ÙòúùÓ»±´°µº®Š¡©´µèýëÚ½˜ ¨{MYjzt‚aò)&6Ti‹€h7üû帒ªš€>ùÿIŽåæp4:LF ¡ÿkÿhÿZÿJÿ‹ÿ½ÿ¡ÿlÿ¦ÿ†ÿHÿ_ÿ’ÿlÿ0ÿBÿ(ÿÿ!ÿ1ÿCÿ$ÿÿÿìþ×þ±þ§þ}þ~þnþ’þÎþßþ°þ°þºþþiþKþbþuþoþ¡þžþHþþ&þFþ,þBþþ¨þ©þ¤þ¢þvþzþZþqþ—þxþ„þŒþNþþ¿ýÃý*þXþ’þþÓþÞþßþ×þÌþÌþÄþ´þ±þ»þÉþÿÏþ¬þ¬þáþ-ÿ<ÿKÿXÿNÿHÿ1ÿ7ÿGÿ7ÿ.ÿ.ÿrÿ¯ÿ±ÿªÿ¸ÿúÿ»ÿ–ÿ˜ÿ¥ÿßÿæÿäÿ°ÿÑÿÖÿîÿ 2ƒ [AJTk}n‡‰^˜ÁÍä÷áÛ "&0/4JàæJO çïIlA)3-% ÿIr˜zU{•](ñþí‘i‹ÛîäÁ¸œK~ÔŒ¬¶oB+-r¡4ÇÿÄÿÜÿþÿ*B6ôÿÂÿšÿ„ÿŸÿ¤ÿÿUÿÿ:ÿDÿ>ÿ†ÿÅÿÃÿlÿLÿóþÌþÿ:ÿBÿ0ÿÿ ÿÿßþ³þÕþñþÓþ´þÇþÍþ½þÀþ»þ¬þ§þ|þ|þþ<þ"þ<þiþzþaþ?þlþ¼þÙþ þcþwþoþkþ^þþ_þ/þ)þdþ€þšþ–þjþiþoþcþJþBþCþZþtþÜþÿÿÂþsþAþIþeþƒþ–þ¿þâþôþåþ½þbþ;þXþ~þ»þôþDÿVÿÿÜþÂþÛþ÷þÿkÿ—ÿ`ÿpÿ‘ÿŒÿ{ÿZÿsÿkÿrÿ_ÿuÿ}ÿxÿ‘ÿÀÿ›ÿxÿŽÿàÿûÿóÿêÿ¹ÿíÿNYg¶ß3b­e9]‰‘±ØÄ§{_\}Ú3DC>:óÄ8H=TZO0 ä±ä áã×óÔè$[š‹O &ÚÈ9[I(ÿçÌÓèÿóʨpwsk£ÄÕ¦\6EJO%   ïÿùÿÈÿ‘ÿtÿ¯ÿáÿÞÿâÿªÿ”ÿ}ÿ<ÿÿNÿZÿpÿ’ÿœÿjÿfÿMÿ/ÿ ÿÕþÿMÿÿÁþÝþöþæþöþÿÿÿ ÿíþºþþ¦þ®þØþäþ¬þ§þÅþÖþÎþ¿þ²þ¼þ¹þÜþßþæþÃþ°þ¾þëþÿëþ¼þ³þËþ·þÒþÿüþéþÚþÔþÂþÚþÿ-ÿÿíþÑþÚþÛþÌþÊþÂþ×þêþýþÌþÎþÿÿRÿfÿ^ÿ`ÿxÿ˜ÿÆÿêÿÖÿÓÿçÿÐÿ®ÿÃÿÌÿÂÿ¼ÿŒÿ£ÿÒÿåÿðÿ* Úÿüÿ/?91XpZ‚Ÿµ¤~wlj|¢£¸µåûãÎï%NkV,ÚIŸ–†xPüÔ¶éG‘­lR{†Ïýëà§Ÿ}^1PK\]Tjd9û!]_Ibe," Go†¥ŠR&$ôäæà õÿؽ³ Ä™qH##ýÿ <HN]@85L\8(ñÿÂÿ–ÿ—ÿ´ÿ»ÿ¡ÿ¬ÿ¯ÿ‰ÿiÿtÿUÿJÿtÿ~ÿhÿ$ÿbÿ‘ÿ[ÿ ÿõþ ÿÿÿ2ÿPÿEÿ/ÿõþâþÃþ®þ¦þ¨þ´þÈþéþêþÿAÿgnustep-gui-0.24.0/Sounds/GNUmakefile0000664000076500007650000000266611250225374017302 0ustar brains99brains99# # Sounds makefile for GNUstep GUI Library # Copyright (C) 2009 Free Software Foundation, Inc. # # Author: Nicola Pero # Date: September 2009 # # 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 Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-gui GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../gui.make include $(GNUSTEP_MAKEFILES)/common.make include ../Version RESOURCE_SET_NAME = Sounds Sounds_INSTALL_DIR = $(GNUSTEP_LIBRARY)/Sounds Sounds_RESOURCE_FILES = \ Basso.wav \ Blow.wav \ Bottle.wav \ Frog.wav \ Glass.wav \ Hero.wav \ Ping.wav \ Pop.wav \ Sosumi.wav \ Submarine.wav \ Tink.wav include $(GNUSTEP_MAKEFILES)/resource-set.make gnustep-gui-0.24.0/Source/0000775000076500007650000000000012256227324015207 5ustar brains99brains99gnustep-gui-0.24.0/Source/NSTabViewItem.m0000664000076500007650000001423512227164721020012 0ustar brains99brains99/** NSTabViewItem Copyright (C) 2000 Free Software Foundation, Inc. Author: Michael Hanni Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "AppKit/NSAttributedString.h" #import "AppKit/NSColor.h" #import "AppKit/NSFont.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSImage.h" #import "AppKit/NSStringDrawing.h" #import "AppKit/NSTabView.h" #import "AppKit/NSTabViewItem.h" #import "AppKit/PSOperators.h" @implementation NSTabViewItem - (id) init { return [self initWithIdentifier: @""]; } - (id) initWithIdentifier: (id)identifier { self = [super init]; if (self) { ASSIGN(_ident, identifier); _state = NSBackgroundTab; _view = [NSView new]; // Use the window background colour as default, not the control background colour. [self setColor: [NSColor windowBackgroundColor]]; } return self; } - (void) dealloc { TEST_RELEASE(_ident); RELEASE(_label); RELEASE(_view); RELEASE(_color); [super dealloc]; } - (NSString*) description { return [NSString stringWithFormat: @"%@: %@ (ident: %@)", NSStringFromClass([self class]), _label, _ident]; } // Set identifier. - (void) setIdentifier: (id)identifier { ASSIGN(_ident, identifier); } - (id) identifier { return _ident; } // Set label for item. - (void) setLabel: (NSString*)label { ASSIGN(_label, label); } - (NSString *) label { return _label; } - (NSSize) sizeOfLabel: (BOOL)shouldTruncateLabel { NSDictionary * attr = [[NSDictionary alloc] initWithObjectsAndKeys: [_tabview font], NSFontAttributeName, nil]; NSString *string; NSSize rSize; if (shouldTruncateLabel) { string = [self _truncatedLabel]; } else { string = _label; } rSize = [string sizeWithAttributes: attr]; RELEASE(attr); return rSize; } // Set view to display when item is clicked. - (void) setView: (NSView*)view { ASSIGN(_view, view); } - (NSView*) view { return _view; } // Set color of tab surface. - (void) setColor: (NSColor*)color { ASSIGN(_color, color); } - (NSColor*) color { return _color; } // tab state - (NSTabState) tabState { return _state; } // Tab view, this is the "super" view. - (NSTabView*) tabView { return _tabview; } // First responder. - (void) setInitialFirstResponder: (NSView*)view { // We don't retain this. _first_responder = view; } - (id) initialFirstResponder { return _first_responder; } // Draw item. - (void) drawLabel: (BOOL)shouldTruncateLabel inRect: (NSRect)tabRect { NSDictionary *attr; NSString *string; _rect = tabRect; if (shouldTruncateLabel) { string = [self _truncatedLabel]; } else { string = _label; } attr = [[NSDictionary alloc] initWithObjectsAndKeys: [_tabview font], NSFontAttributeName, [NSColor controlTextColor], NSForegroundColorAttributeName, nil]; { NSSize size = [string sizeWithAttributes: attr]; NSRect labelRect = tabRect; labelRect.origin.y = tabRect.origin.y + ((tabRect.size.height - size.height) / 2); labelRect.size.height = size.height; [string drawInRect: labelRect withAttributes: attr]; } RELEASE(attr); } - (void) setToolTip: (NSString*)toolTip { ASSIGN(_toolTip, toolTip); } - (NSString*) toolTip { return _toolTip; } // NSCoding protocol. - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { [aCoder encodeObject: _ident forKey: @"NSIdentifier"]; [aCoder encodeObject: _label forKey: @"NSLabel"]; [aCoder encodeObject: _view forKey: @"NSView"]; [aCoder encodeObject: _color forKey: @"NSColor"]; [aCoder encodeObject: _tabview forKey: @"NSTabView"]; } else { [aCoder encodeObject:_ident]; [aCoder encodeObject:_label]; [aCoder encodeObject:_view]; [aCoder encodeObject:_color]; [aCoder encodeValueOfObjCType: @encode(int) at: &_state]; [aCoder encodeObject:_first_responder]; [aCoder encodeObject:_tabview]; } } - (id) initWithCoder: (NSCoder*)aDecoder { if ([aDecoder allowsKeyedCoding]) { id identifier = [aDecoder decodeObjectForKey: @"NSIdentifier"]; self = [self initWithIdentifier: identifier]; [self setLabel: [aDecoder decodeObjectForKey: @"NSLabel"]]; [self setView: [aDecoder decodeObjectForKey: @"NSView"]]; [self setColor: [aDecoder decodeObjectForKey: @"NSColor"]]; [self _setTabView: [aDecoder decodeObjectForKey: @"NSTabView"]]; } else { [aDecoder decodeValueOfObjCType: @encode(id) at: &_ident]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_label]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_view]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_color]; [aDecoder decodeValueOfObjCType: @encode(int) at:&_state]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_first_responder]; AUTORELEASE(_first_responder); [aDecoder decodeValueOfObjCType: @encode(id) at: &_tabview]; AUTORELEASE(_tabview); } return self; } @end @implementation NSTabViewItem (GNUstep) // Non spec - (NSRect) _tabRect { return _rect; } - (void) _setTabState: (NSTabState)tabState { _state = tabState; } - (void) _setTabView: (NSTabView*)tabView { _tabview = tabView; } - (NSString*) _truncatedLabel { // FIXME: What is the algo to truncate? return _label; } @end gnustep-gui-0.24.0/Source/NSColorSpace.m0000664000076500007650000001015011352512421017644 0ustar brains99brains99/* NSColorSpace.h The color space class Copyright (C) 2007 Free Software Foundation, Inc. Author: H. Nikolaus Schaller Date: 2007 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import "GSGuiPrivate.h" @implementation NSColorSpace - (id) _initWithColorSpaceModel: (NSColorSpaceModel)model { if ((self = [super init])) { // FIXME: Load corresponding data _colorSpaceModel = model; } return self; } #define COLORSPACE(model) \ static NSColorSpace *csp = nil; \ if (!csp) \ csp = [[self alloc] _initWithColorSpaceModel: model]; \ return csp; + (NSColorSpace *) deviceCMYKColorSpace { COLORSPACE(NSCMYKColorSpaceModel); } + (NSColorSpace *) deviceGrayColorSpace { COLORSPACE(NSGrayColorSpaceModel); } + (NSColorSpace *) deviceRGBColorSpace { COLORSPACE(NSRGBColorSpaceModel); } + (NSColorSpace *) genericCMYKColorSpace { COLORSPACE(NSCMYKColorSpaceModel); } + (NSColorSpace *) genericGrayColorSpace { COLORSPACE(NSGrayColorSpaceModel); } + (NSColorSpace *) genericRGBColorSpace { COLORSPACE(NSRGBColorSpaceModel); } - (id) initWithColorSyncProfile: (void *)prof { if ((self = [super init])) { _colorSyncProfile = prof; _colorSpaceModel = NSUnknownColorSpaceModel; } return self; } - (id) initWithICCProfileData: (NSData *)iccData { if ((self = [super init])) { ASSIGN(_iccData, iccData); _colorSpaceModel = NSUnknownColorSpaceModel; } return self; } -(void) dealloc { // FIXME: Free _colorSyncProfile TEST_RELEASE(_iccData); [super dealloc]; } - (NSColorSpaceModel) colorSpaceModel { return _colorSpaceModel; } - (void *) colorSyncProfile { return _colorSyncProfile; } - (NSData *) ICCProfileData { if (!_iccData) { // FIXME: Try to compute this from _colorSyncProfile } return _iccData; } - (NSString *) localizedName { switch (_colorSpaceModel) { default: case NSUnknownColorSpaceModel: return NSLocalizedString(@"unknown", @"color space"); case NSGrayColorSpaceModel: return NSLocalizedString(@"Grayscale", @"color space"); case NSRGBColorSpaceModel: return NSLocalizedString(@"RGB", @"color space"); case NSCMYKColorSpaceModel: return NSLocalizedString(@"CMYK", @"color space"); case NSLABColorSpaceModel: return NSLocalizedString(@"LAB", @"color space"); case NSDeviceNColorSpaceModel: return NSLocalizedString(@"DeviceN", @"color space"); } } - (int) numberOfColorComponents { switch (_colorSpaceModel) { default: case NSUnknownColorSpaceModel: return 0; case NSGrayColorSpaceModel: return 1; case NSRGBColorSpaceModel: return 3; case NSCMYKColorSpaceModel: return 4; case NSLABColorSpaceModel: return 3; // FIXME case NSDeviceNColorSpaceModel: return 3; // FIXME } } - (void) encodeWithCoder: (NSCoder *)coder { // FIXME if ([coder allowsKeyedCoding]) { } else { } } - (id) initWithCoder: (NSCoder *)aDecoder { // FIXME if ([aDecoder allowsKeyedCoding]) { } else { } return self; } @end gnustep-gui-0.24.0/Source/GSPrinting.m0000664000076500007650000001551111376454556017427 0ustar brains99brains99/** GSPrinting.m GSPrinting loads the proper bundle for the printing backend. Copyright (C) 2004 Free Software Foundation, Inc. Author: Chad Elliott Hardin Date: June 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import #import "AppKit/NSPanel.h" #import "GNUstepGUI/GSPrinting.h" static NSBundle *printingBundle = nil; /** Class Description

GSPrinting is used by all of the NSPrint and the NSPageLayout class(es) so that a printing backend bundle can be loaded. It first utilizes NSUserDefaults to find the user's preferred printing backend bundle. It looks for the key GSPrinting. If the user's preferred bundle cannot be loaded, it tries to load any working printing bundle.

*/ @implementation GSPrinting +(NSBundle*) loadPrintingBundle: (NSString*) bundleName { NSString *path; NSEnumerator *libraryPathsEnumerator; bundleName = [bundleName stringByAppendingString: @".bundle"]; NSDebugLLog(@"GSPrinting", @"Looking for %@", bundleName); libraryPathsEnumerator = [NSStandardLibraryPaths() objectEnumerator]; while ((path = [libraryPathsEnumerator nextObject])) { path = [path stringByAppendingPathComponent: @"Bundles"]; path = [path stringByAppendingPathComponent: @"GSPrinting"]; path = [path stringByAppendingPathComponent: bundleName]; if ([[NSFileManager defaultManager] fileExistsAtPath: path]) { NSBundle *bundle; bundle = [NSBundle bundleWithPath: path]; if ([bundle load] == NO) { NSDebugLLog(@"GSPrinting", @"Error loading printing bundle at %@", path); return nil; } //one last check to make sure the principle class can be loaded if ([bundle principalClass] == Nil) { NSDebugLLog(@"GSPrinting", @"Error loading principal class from printing bundle at %@", path); return nil; } //if we get here, finally, then everything should be ok, barring //errors from later in loading resources. NSDebugLLog(@"GSPrinting", @"Loaded printing bundle at %@", path); return bundle; } } NSDebugLLog(@"GSPrinting", @"Unable to find printing bundle %@", bundleName); return nil; } +(NSBundle*) loadAnyWorkingPrintingBundle { NSBundle *bundle; if ((bundle = [GSPrinting loadPrintingBundle: @"GSCUPS"])) return bundle; if ((bundle = [GSPrinting loadPrintingBundle: @"GSLPR"])) return bundle; if ((bundle = [GSPrinting loadPrintingBundle: @"GSWin32"])) return bundle; return nil; } + (NSBundle*) printingBundle { NSString *defaultBundleName; NSBundle *bundle; if (printingBundle) { return printingBundle; } NSDebugLLog(@"GSPrinting", @"Bundle has not been loaded. Loading in progress..."); defaultBundleName = [[NSUserDefaults standardUserDefaults] stringForKey: @"GSPrinting"]; /*Which Printing Bundle?*/ if (defaultBundleName == nil) { NSDebugLLog(@"GSPrinting", @"User did not set a printing bundle, trying till something works"); bundle = [GSPrinting loadAnyWorkingPrintingBundle]; if (bundle == nil) { NSDebugLLog(@"GSPrinting", @"Could not load any working printing bundle"); NSRunAlertPanel(@"GNUstep Printing Backend System", @"Could not open any working printing bundle. Printing will not work.", @"Ok", NULL, NULL); return nil; } } else { NSDebugLLog(@"GSPrinting", @"User set %@ as the printing bundle", defaultBundleName); bundle = [GSPrinting loadPrintingBundle: defaultBundleName]; if (bundle == nil) { NSDebugLLog(@"GSPrinting", @"User set %@ as the printing bundle but that did not work.\ Will try to find anything that will work", defaultBundleName); bundle = [GSPrinting loadAnyWorkingPrintingBundle]; if (bundle == nil) { NSDebugLLog(@"GSPrinting", @"Could not load any working printing bundle"); NSRunAlertPanel(@"GNUstep Printing Backend System", @"Could not open any working printing bundle. Printing will not work.", @"Ok", NULL, NULL); return nil; } else { NSString *msg; msg = [NSString stringWithFormat: @"Your chosen printing bundle, %@, could not be loaded.\ %@ was loaded instead", defaultBundleName, [[bundle bundlePath] lastPathComponent]]; NSRunAlertPanel(@"GNUstep Printing Backend System", msg, @"Ok", NULL, NULL); } } } printingBundle = bundle; [printingBundle retain]; return printingBundle; } @end /** Class Description

GSPrintingPrincipleClass is the base class that all Printing backend bundles should use as their principle class. Subclasses are responsible for the allocating of that bundle's particular NSPrint, NSPageLayout, and GSPrintOperation sublclassed objects.

*/ @implementation GSPrintingPrincipalClass : NSObject { } +(Class) pageLayoutClass { return Nil; } +(Class) printInfoClass { return Nil; } +(Class) printOperationClass { return Nil; } +(Class) printPanelClass { return Nil; } +(Class) printerClass { return Nil; } +(Class) gsPrintOperationClass { return Nil; } @end gnustep-gui-0.24.0/Source/NSImage.m0000664000076500007650000017652112222053547016661 0ustar brains99brains99/** NSImage Load, manipulate and display images Copyright (C) 1996, 2005 Free Software Foundation, Inc. Author: Adam Fedor Date: Feb 1996 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include #include #import #import #import #import #import #import #import #import #import #import #import #import "AppKit/NSImage.h" #import "AppKit/AppKitExceptions.h" #import "AppKit/NSAffineTransform.h" #import "AppKit/NSBitmapImageRep.h" #import "AppKit/NSCachedImageRep.h" #import "AppKit/NSColor.h" #import "AppKit/NSPasteboard.h" #import "AppKit/NSPrintOperation.h" #import "AppKit/NSScreen.h" #import "AppKit/NSView.h" #import "AppKit/NSWindow.h" #import "AppKit/DPSOperators.h" #import "GNUstepGUI/GSDisplayServer.h" #import "GSThemePrivate.h" BOOL NSImageForceCaching = NO; /* use on missmatch */ @implementation NSBundle (NSImageAdditions) - (NSString*) pathForImageResource: (NSString*)name { NSString *ext = [name pathExtension]; NSString *path = nil; if ((ext == nil) || [ext isEqualToString:@""]) { NSArray *types = [NSImage imageUnfilteredFileTypes]; NSUInteger c = [types count]; NSUInteger i; for (i = 0; path == nil && i < c; i++) { ext = [types objectAtIndex: i]; path = [self pathForResource: name ofType: ext]; } } else { name = [name stringByDeletingPathExtension]; path = [self pathForResource: name ofType: ext]; } return path; } @end @interface GSRepData : NSObject { @public NSImageRep *rep; NSImageRep *original; NSColor *bg; } @end @implementation GSRepData - (id) copyWithZone: (NSZone*)z { GSRepData *c = (GSRepData*)NSCopyObject(self, 0, z); if (c->rep) c->rep = [c->rep copyWithZone: z]; if (c->bg) c->bg = [c->bg copyWithZone: z]; return c; } - (void) dealloc { TEST_RELEASE(rep); TEST_RELEASE(bg); [super dealloc]; } @end /* Class variables and functions for class methods */ static NSRecursiveLock *imageLock = nil; static NSMutableDictionary *nameDict = nil; static NSDictionary *nsmapping = nil; static NSColor *clearColor = nil; static Class cachedClass = 0; static Class bitmapClass = 0; // Cache for the supported file types static NSArray *imageUnfilteredFileTypes = nil; static NSArray *imageFileTypes = nil; static NSArray *imageUnfilteredPasteboardTypes = nil; static NSArray *imagePasteboardTypes = nil; static NSArray *iterate_reps_for_types(NSArray *imageReps, SEL method); /* Find the GSRepData object holding a representation */ static GSRepData* repd_for_rep(NSArray *_reps, NSImageRep *rep) { NSEnumerator *enumerator = [_reps objectEnumerator]; IMP nextImp = [enumerator methodForSelector: @selector(nextObject)]; GSRepData *repd; while ((repd = (*nextImp)(enumerator, @selector(nextObject))) != nil) { if (repd->rep == rep) { return repd; } } [NSException raise: NSInternalInconsistencyException format: @"Cannot find stored representation"]; /* NOT REACHED */ return nil; } @interface NSImage (Private) + (void) _clearFileTypeCaches: (NSNotification*)notif; + (NSString *) _pathForImageNamed: (NSString *)aName; + (void) _reloadCachedImages; - (BOOL) _useFromFile: (NSString *)fileName; - (BOOL) _loadFromData: (NSData *)data; - (BOOL) _loadFromFile: (NSString *)fileName; - (BOOL) _resetAndUseFromFile: (NSString *)fileName; - (GSRepData*) _cacheForRep: (NSImageRep*)rep; - (NSCachedImageRep*) _doImageCache: (NSImageRep *)rep; @end @implementation NSImage + (void) initialize { if (imageLock == nil) { NSString *path; imageLock = [NSRecursiveLock new]; [imageLock lock]; // Initial version [self setVersion: 1]; // initialize the class variables nameDict = [[NSMutableDictionary alloc] initWithCapacity: 10]; path = [NSBundle pathForLibraryResource: @"nsmapping" ofType: @"strings" inDirectory: @"Images"]; if (path) nsmapping = RETAIN([[NSString stringWithContentsOfFile: path] propertyListFromStringsFileFormat]); clearColor = RETAIN([NSColor clearColor]); cachedClass = [NSCachedImageRep class]; bitmapClass = [NSBitmapImageRep class]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_clearFileTypeCaches:) name: NSImageRepRegistryChangedNotification object: [NSImageRep class]]; [imageLock unlock]; } } + (id) imageNamed: (NSString *)aName { NSImage *image; NSString *realName; [imageLock lock]; realName = [nsmapping objectForKey: aName]; if (realName == nil) { realName = aName; } image = (NSImage*)[nameDict objectForKey: realName]; if (image == nil && realName != nil) { NSString *path = [self _pathForImageNamed: realName]; if ([path length] != 0) { image = [[[[GSTheme theme] imageClass] alloc] initByReferencingFile: path]; if (image != nil) { [image setName: realName]; image->_flags.archiveByName = YES; AUTORELEASE(image); } } } IF_NO_GC([[image retain] autorelease]); [imageLock unlock]; return image; } + (NSImage *) _standardImageWithName: (NSString *)name { NSImage *image = nil; image = [NSImage imageNamed: name]; if (image == nil) image = [NSImage imageNamed: [@"common_" stringByAppendingString: name]]; return image; } - (id) init { return [self initWithSize: NSMakeSize(0, 0)]; } - (id) initWithSize: (NSSize)aSize { if (!(self = [super init])) return nil; //_flags.archiveByName = NO; //_flags.scalable = NO; //_flags.dataRetained = NO; //_flags.flipDraw = NO; if (aSize.width && aSize.height) { _size = aSize; _flags.sizeWasExplicitlySet = YES; } //_flags.usesEPSOnResolutionMismatch = NO; _flags.colorMatchPreferred = YES; _flags.multipleResolutionMatching = YES; //_flags.cacheSeparately = NO; //_flags.unboundedCacheDepth = NO; //_flags.syncLoad = NO; _reps = [[NSMutableArray alloc] initWithCapacity: 2]; ASSIGN(_color, clearColor); _cacheMode = NSImageCacheDefault; return self; } - (id) initByReferencingFile: (NSString *)fileName { if (!(self = [self init])) return nil; if (![self _useFromFile: fileName]) { RELEASE(self); return nil; } _flags.archiveByName = YES; return self; } - (id) initWithContentsOfFile: (NSString *)fileName { if (!(self = [self init])) return nil; _flags.dataRetained = YES; if (![self _loadFromFile: fileName]) { RELEASE(self); return nil; } return self; } - (id) initWithData: (NSData *)data { if (!(self = [self init])) return nil; _flags.dataRetained = YES; if (![self _loadFromData: data]) { RELEASE(self); return nil; } return self; } - (id) initWithBitmapHandle: (void *)bitmap { NSImageRep *rep; if (!(self = [self init])) return nil; rep = [[NSBitmapImageRep alloc] initWithBitmapHandle: bitmap]; if (rep == nil) { RELEASE(self); return nil; } [self addRepresentation: rep]; RELEASE(rep); return self; } - (id)initWithIconHandle:(void *)icon { // Only needed on MS Windows NSImageRep *rep; if (!(self = [self init])) return nil; rep = [[NSBitmapImageRep alloc] initWithIconHandle: icon]; if (rep == nil) { RELEASE(self); return nil; } [self addRepresentation: rep]; RELEASE(rep); return self; } - (id) initWithContentsOfURL: (NSURL *)anURL { NSArray *array; if (!(self = [self init])) return nil; array = [NSImageRep imageRepsWithContentsOfURL: anURL]; if (!array) { RELEASE(self); return nil; } _flags.dataRetained = YES; [self addRepresentations: array]; return self; } - (id) initWithPasteboard: (NSPasteboard *)pasteboard { NSArray *reps; if (!(self = [self init])) return nil; reps = [NSImageRep imageRepsWithPasteboard: pasteboard]; if (reps != nil) [self addRepresentations: reps]; else { NSArray *array = [pasteboard propertyListForType: NSFilenamesPboardType]; NSString* file; if ((array == nil) || ([array count] == 0) || (file = [array objectAtIndex: 0]) == nil || ![self _loadFromFile: file]) { RELEASE(self); return nil; } } _flags.dataRetained = YES; return self; } - (void) dealloc { if (_name == nil) { RELEASE(_reps); TEST_RELEASE(_fileName); RELEASE(_color); [super dealloc]; } else { [self retain]; NSLog(@"Warning ... attempt to deallocate image with name: %@", _name); } } - (id) copyWithZone: (NSZone *)zone { NSImage *copy; NSArray *reps = [self representations]; NSEnumerator *enumerator = [reps objectEnumerator]; NSImageRep *rep; copy = (NSImage*)NSCopyObject (self, 0, zone); copy->_name = nil; RETAIN(_fileName); RETAIN(_color); copy->_lockedView = nil; // FIXME: maybe we should retain if _flags.dataRetained = NO copy->_reps = [[NSMutableArray alloc] initWithCapacity: [_reps count]]; // Only copy non-cached reps. while ((rep = [enumerator nextObject]) != nil) { if (![rep isKindOfClass: cachedClass]) { [copy addRepresentation: rep]; } } return copy; } - (BOOL) isEqual: (id)anObject { if (self == anObject) return YES; if (![anObject isKindOfClass: [NSImage class]]) return NO; // FIXME return NO; } /* This methd sets the name of an image, updating the global name dictionary * to point to the image (or removing an image from the dictionary if the * new name is nil). */ - (BOOL) setName: (NSString *)aName { [imageLock lock]; /* The name is already set... nothing to do. */ if (aName == _name || [aName isEqual: _name] == YES) { [imageLock unlock]; return YES; } /* If the new name is already in use by another image, * we must do nothing. */ if (aName != nil && [nameDict objectForKey: aName] != nil) { [imageLock unlock]; return NO; } /* If this image had another name, we remove it. */ if (_name != nil) { /* We retain self in case removing from the dictionary releases us */ IF_NO_GC([[self retain] autorelease]); [nameDict removeObjectForKey: _name]; DESTROY(_name); } /* If the new name is null, there is nothing more to do. */ if (aName == nil) { [imageLock unlock]; return NO; } ASSIGN(_name, aName); [nameDict setObject: self forKey: _name]; [imageLock unlock]; return YES; } - (NSString *) name { NSString *name; [imageLock lock]; name = [[_name retain] autorelease]; [imageLock unlock]; return name; } - (void) setSize: (NSSize)aSize { _size = aSize; _flags.sizeWasExplicitlySet = YES; } - (NSSize) size { if (_size.width == 0) { NSImageRep *rep = [self bestRepresentationForDevice: nil]; if (rep) _size = [rep size]; else _size = NSZeroSize; } return _size; } - (BOOL) isFlipped { return _flags.flipDraw; } - (void) setFlipped: (BOOL)flag { _flags.flipDraw = flag; } // Choosing Which Image Representation to Use - (void) setUsesEPSOnResolutionMismatch: (BOOL)flag { _flags.useEPSOnResolutionMismatch = flag; } - (BOOL) usesEPSOnResolutionMismatch { return _flags.useEPSOnResolutionMismatch; } - (void) setPrefersColorMatch: (BOOL)flag { _flags.colorMatchPreferred = flag; } - (BOOL) prefersColorMatch { return _flags.colorMatchPreferred; } - (void) setMatchesOnMultipleResolution: (BOOL)flag { _flags.multipleResolutionMatching = flag; } - (BOOL) matchesOnMultipleResolution { return _flags.multipleResolutionMatching; } // Determining How the Image is Stored - (void) setCachedSeparately: (BOOL)flag { _flags.cacheSeparately = flag; } - (BOOL) isCachedSeparately { return _flags.cacheSeparately; } - (void) setDataRetained: (BOOL)flag { _flags.dataRetained = flag; } - (BOOL) isDataRetained { return _flags.dataRetained; } - (void) setCacheDepthMatchesImageDepth: (BOOL)flag { _flags.unboundedCacheDepth = flag; } - (BOOL) cacheDepthMatchesImageDepth { return _flags.unboundedCacheDepth; } - (void) setCacheMode: (NSImageCacheMode)mode { _cacheMode = mode; } - (NSImageCacheMode) cacheMode { return _cacheMode; } // Determining How the Image is Drawn - (BOOL) isValid { BOOL valid = NO; NSUInteger i, count; if (_flags.syncLoad) { /* Make sure any images that were added with _useFromFile: are loaded in and added to the representation list. */ if (![self _loadFromFile: _fileName]) return NO; _flags.syncLoad = NO; } /* Go through all our representations and determine if at least one is a valid cache */ // FIXME: Not sure if this is correct count = [_reps count]; for (i = 0; i < count; i++) { GSRepData *repd = (GSRepData*)[_reps objectAtIndex: i]; if (repd->bg != nil || [repd->rep isKindOfClass: cachedClass] == NO) { valid = YES; break; } } return valid; } - (void) recache { NSUInteger i; i = [_reps count]; while (i--) { GSRepData *repd; repd = (GSRepData*)[_reps objectAtIndex: i]; if (repd->original != nil) { [_reps removeObjectAtIndex: i]; } } } - (void) setScalesWhenResized: (BOOL)flag { // FIXME: This currently breaks NSImage. // See the test case in GSTest/Image-test that uses this method. // _flags.scalable = flag; } - (BOOL) scalesWhenResized { return _flags.scalable; } - (void) setBackgroundColor: (NSColor *)aColor { if (aColor == nil) { aColor = clearColor; } ASSIGN(_color, aColor); } - (NSColor *) backgroundColor { return _color; } // Using the Image - (void) compositeToPoint: (NSPoint)aPoint operation: (NSCompositingOperation)op { [self compositeToPoint: aPoint fromRect: NSZeroRect operation: op fraction: 1.0]; } - (void) compositeToPoint: (NSPoint)aPoint fromRect: (NSRect)aRect operation: (NSCompositingOperation)op { [self compositeToPoint: aPoint fromRect: aRect operation: op fraction: 1.0]; } - (void) compositeToPoint: (NSPoint)aPoint operation: (NSCompositingOperation)op fraction: (CGFloat)delta { [self compositeToPoint: aPoint fromRect: NSZeroRect operation: op fraction: delta]; } - (void) compositeToPoint: (NSPoint)aPoint fromRect: (NSRect)srcRect operation: (NSCompositingOperation)op fraction: (CGFloat)delta { NSGraphicsContext *ctxt = GSCurrentContext(); // Calculate the user space scale factor of the current window NSView *focusView = [NSView focusView]; CGFloat scaleFactor = 1.0; if (focusView != nil) { scaleFactor = [[focusView window] userSpaceScaleFactor]; } // Set the CTM to the identity matrix with the current translation // and the user space scale factor { NSAffineTransform *backup = [[ctxt GSCurrentCTM] retain]; NSAffineTransform *newTransform = [NSAffineTransform transform]; NSPoint translation = [backup transformPoint: aPoint]; [newTransform translateXBy: translation.x yBy: translation.y]; [newTransform scaleBy: scaleFactor]; [ctxt GSSetCTM: newTransform]; [self drawAtPoint: NSMakePoint(0, 0) fromRect: srcRect operation: op fraction: delta]; [ctxt GSSetCTM: backup]; [backup release]; } } - (void) dissolveToPoint: (NSPoint)aPoint fraction: (CGFloat)aFloat { [self dissolveToPoint: aPoint fromRect: NSZeroRect fraction: aFloat]; } - (void) dissolveToPoint: (NSPoint)aPoint fromRect: (NSRect)aRect fraction: (CGFloat)aFloat { [self compositeToPoint: aPoint fromRect: aRect operation: NSCompositeSourceOver fraction: aFloat]; } - (BOOL) drawRepresentation: (NSImageRep *)imageRep inRect: (NSRect)aRect { BOOL r; NSGraphicsContext *ctxt = GSCurrentContext(); DPSgsave(ctxt); if (_color != nil) { NSRect fillrect = aRect; [_color set]; NSRectFill(fillrect); if ([GSCurrentContext() isDrawingToScreen] == NO) { /* Reset alpha for image drawing. */ [[NSColor colorWithCalibratedWhite: 1.0 alpha: 1.0] set]; } } if (!_flags.scalable) r = [imageRep drawAtPoint: aRect.origin]; else r = [imageRep drawInRect: aRect]; DPSgrestore(ctxt); return r; } - (void) drawAtPoint: (NSPoint)point fromRect: (NSRect)srcRect operation: (NSCompositingOperation)op fraction: (CGFloat)delta { [self drawInRect: NSMakeRect(point.x, point.y, srcRect.size.width, srcRect.size.height) fromRect: srcRect operation: op fraction: delta respectFlipped: NO hints: nil]; } - (void) drawInRect: (NSRect)dstRect fromRect: (NSRect)srcRect operation: (NSCompositingOperation)op fraction: (CGFloat)delta { [self drawInRect: dstRect fromRect: srcRect operation: op fraction: delta respectFlipped: NO hints: nil]; } /** * Base drawing method in NSImage; all other draw methods call this one */ - (void) drawInRect: (NSRect)dstRect // Negative width/height => Nothing draws. fromRect: (NSRect)srcRect operation: (NSCompositingOperation)op fraction: (CGFloat)delta respectFlipped: (BOOL)respectFlipped hints: (NSDictionary*)hints { NSImageRep *rep; NSGraphicsContext *ctxt; NSSize imgSize, repSize; NSRect repSrcRect; ctxt = GSCurrentContext(); imgSize = [self size]; // Handle abbreviated parameters if (NSEqualRects(srcRect, NSZeroRect)) { srcRect.size = imgSize; } if (NSEqualSizes(dstRect.size, NSZeroSize)) // For -drawAtPoint:fromRect:operation:fraction: { dstRect.size = imgSize; } if (imgSize.width <= 0 || imgSize.height <= 0) return; // Select a rep rep = [self bestRepresentationForRect: dstRect context: ctxt hints: hints]; if (rep == nil) return; // Try to cache / get a cached version of the best rep /** * We only use caching on backends that can efficiently draw a rect from the cache * onto the current graphics context respecting the CTM, which is currently cairo. */ if (_cacheMode != NSImageCacheNever && [ctxt supportsDrawGState]) { NSCachedImageRep *cache = [self _doImageCache: rep]; if (cache != nil) { rep = cache; } } repSize = [rep size]; // Convert srcRect from image coordinate space to rep coordinate space { const CGFloat imgToRepWidthScaleFactor = repSize.width / imgSize.width; const CGFloat imgToRepHeightScaleFactor = repSize.height / imgSize.height; repSrcRect = NSMakeRect(srcRect.origin.x * imgToRepWidthScaleFactor, srcRect.origin.y * imgToRepHeightScaleFactor, srcRect.size.width * imgToRepWidthScaleFactor, srcRect.size.height * imgToRepHeightScaleFactor); } // FIXME: Draw background? [rep drawInRect: dstRect fromRect: repSrcRect operation: op fraction: delta respectFlipped: respectFlipped hints: hints]; } - (void) addRepresentation: (NSImageRep *)imageRep { GSRepData *repd; if (imageRep != nil) { repd = [GSRepData new]; repd->rep = RETAIN(imageRep); [_reps addObject: repd]; RELEASE(repd); } } - (void) addRepresentations: (NSArray *)imageRepArray { NSUInteger i, count; GSRepData *repd; count = [imageRepArray count]; for (i = 0; i < count; i++) { repd = [GSRepData new]; repd->rep = RETAIN([imageRepArray objectAtIndex: i]); [_reps addObject: repd]; RELEASE(repd); } } - (void) removeRepresentation: (NSImageRep *)imageRep { NSUInteger i; GSRepData *repd; i = [_reps count]; while (i-- > 0) { repd = (GSRepData*)[_reps objectAtIndex: i]; if (repd->rep == imageRep) { [_reps removeObjectAtIndex: i]; } else if (repd->original == imageRep) { // Remove cached representations for this representation // instead of turning them into real ones //repd->original = nil; [_reps removeObjectAtIndex: i]; } } } - (void) lockFocus { [self lockFocusOnRepresentation: nil]; } - (void) lockFocusOnRepresentation: (NSImageRep *)imageRep { if (_cacheMode != NSImageCacheNever) { NSWindow *window; GSRepData *repd; if (NSEqualSizes(NSZeroSize, [self size])) [NSException raise: NSImageCacheException format: @"Cannot lock focus on image with size (0, 0)"]; if (imageRep == nil) imageRep = [self bestRepresentationForDevice: nil]; repd = [self _cacheForRep: imageRep]; if (repd == nil) return; imageRep = repd->rep; window = [(NSCachedImageRep *)imageRep window]; _lockedView = [window contentView]; if (_lockedView == nil) [NSException raise: NSImageCacheException format: @"Cannot lock focus on nil rep"]; [_lockedView lockFocus]; if (repd->bg == nil) { NSRect fillrect = NSMakeRect(0, 0, _size.width, _size.height); // Clear the background of the cached image, as it is not valid if ([_color alphaComponent] < 1.0) { /* With a Quartz-like alpha model, alpha can't be cleared with a rectfill, so we need to clear the alpha channel explictly. (A compositerect with NSCompositeCopy would be more efficient, but it doesn't seem like it's implemented correctly in all backends yet (as of 2002-08-23). Also, this will work with both the Quartz- and DPS-model.) */ NSRectFillUsingOperation(fillrect, NSCompositeClear); } repd->bg = [_color copy]; if ([repd->bg alphaComponent] == 1.0) { [imageRep setOpaque: YES]; } else { [imageRep setOpaque: [repd->original isOpaque]]; } // Fill with background colour and draw repesentation [self drawRepresentation: repd->original inRect: fillrect]; } } } - (void) unlockFocus { if (_lockedView != nil) { [_lockedView unlockFocus]; _lockedView = nil; } } /* Determine the number of color components in the device and filter out reps with a different number of color components. If the device lacks a color space name, all reps are treated as matching. If a rep lacks a color space name, it is assumed to match the device. WARNING: Be careful not to inadvertently mix greyscale and color representations in a TIFF. The greyscale representations will never be selected as a best rep unless you are drawing on a greyscale surface, or all reps in the TIFF are greyscale. */ - (NSMutableArray *) _bestRep: (NSArray *)reps withColorMatch: (NSDictionary*)deviceDescription { NSMutableArray *breps = [NSMutableArray array]; NSString *deviceColorSpace = [deviceDescription objectForKey: NSDeviceColorSpaceName]; if (deviceColorSpace != nil) { NSUInteger deviceColors = NSNumberOfColorComponents(deviceColorSpace); NSEnumerator *enumerator = [reps objectEnumerator]; NSImageRep *rep; while ((rep = [enumerator nextObject]) != nil) { if ([rep colorSpaceName] == nil || NSNumberOfColorComponents([rep colorSpaceName]) == deviceColors) { [breps addObject: rep]; } } } /* If there are no matches, pass all the reps */ if ([breps count] == 0) { [breps setArray: reps]; } return breps; } /** * Returns YES if x in an integer multiple of y */ static BOOL GSIsMultiple(CGFloat x, CGFloat y) { // FIXME: Test when CGFloat is float and make sure this test isn't // too strict due to floating point rounding errors. return (x/y) == floor(x/y); } /** * Returns YES if there exist integers p and q such that * (baseSize.width * p == size.width) && (baseSize.height * q == size.height) */ static BOOL GSSizeIsIntegerMultipleOfSize(NSSize size, NSSize baseSize) { return NSEqualSizes(size, baseSize) || (GSIsMultiple(size.width, baseSize.width) && GSIsMultiple(size.height, baseSize.height)); } /** * Returns {0, 0} if the image rep doesn't have a size set, * or the pixelsWide or pixelsHigh are NSImageRepMatchesDevice */ static NSSize GSResolutionOfImageRep(NSImageRep *rep) { const int pixelsWide = [rep pixelsWide]; const int pixelsHigh = [rep pixelsHigh]; const NSSize repSize = [rep size]; if (repSize.width == 0 || repSize.height == 0) { return NSMakeSize(0, 0); } else if (pixelsWide == NSImageRepMatchesDevice || pixelsHigh == NSImageRepMatchesDevice) { return NSMakeSize(0, 0); } else { return NSMakeSize(72.0 * (CGFloat)pixelsWide / repSize.width, 72.0 * (CGFloat)pixelsHigh / repSize.height); } } /* Find reps that match the resolution (DPI) of the device (including integer multiples of the device resplition if [self multipleResolutionMatching] is YES). If there are no DPI matches, use any available vector reps if [self usesEPSOnResolutionMismatch] is YES. Otherwise, use the bitmap reps that have the highest DPI. */ - (NSMutableArray *) _bestRep: (NSArray *)reps withResolutionMatch: (NSDictionary*)deviceDescription { NSMutableArray *breps = [NSMutableArray array]; NSValue *resolution = [deviceDescription objectForKey: NSDeviceResolution]; // 1. Look for exact resolution matches, or integer multiples if permitted. if (nil != resolution) { const NSSize dres = [resolution sizeValue]; if (![self matchesOnMultipleResolution]) { NSImageRep *rep; NSEnumerator *enumerator = [reps objectEnumerator]; while ((rep = [enumerator nextObject]) != nil) { if (NSEqualSizes(GSResolutionOfImageRep(rep), dres)) { [breps addObject: rep]; } } } else // [self matchesOnMultipleResolution] { NSMutableArray *integerMultiples = [NSMutableArray array]; NSSize closestRes = NSMakeSize(CGFLOAT_MAX, CGFLOAT_MAX); NSImageRep *rep; NSEnumerator *enumerator; // Iterate through the reps, keeping track of which ones // have a resolution which is an integer multiple of the device // res, and keep track of the cloest resolution enumerator = [reps objectEnumerator]; while ((rep = [enumerator nextObject]) != nil) { const NSSize repRes = GSResolutionOfImageRep(rep); if (GSSizeIsIntegerMultipleOfSize(repRes, dres)) { const NSSize repResDifference = NSMakeSize(fabs(repRes.width - dres.width), fabs(repRes.height - dres.height)); const NSSize closestResolutionDifference = NSMakeSize(fabs(closestRes.width - dres.width), fabs(closestRes.height - dres.height)); if (repResDifference.width < closestResolutionDifference.width && repResDifference.height < closestResolutionDifference.height) { closestRes = repRes; } [integerMultiples addObject: rep]; } } enumerator = [integerMultiples objectEnumerator]; while ((rep = [enumerator nextObject]) != nil) { const NSSize repRes = GSResolutionOfImageRep(rep); if (NSEqualSizes(repRes, closestRes)) { [breps addObject: rep]; } } } } // 2. If no exact matches found, use vector reps, if they are preferred if ([breps count] == 0 && [self usesEPSOnResolutionMismatch]) { NSImageRep *rep; NSEnumerator *enumerator = [reps objectEnumerator]; while ((rep = [enumerator nextObject]) != nil) { if ([rep pixelsWide] == NSImageRepMatchesDevice && [rep pixelsHigh] == NSImageRepMatchesDevice) { [breps addObject: rep]; } } } // 3. If there are still no matches, use all of the bitmaps with the highest // resolution (DPI) if ([breps count] == 0) { NSSize maxRes = NSMakeSize(0,0); NSImageRep *rep; NSEnumerator *enumerator; // Determine maxRes enumerator = [reps objectEnumerator]; while ((rep = [enumerator nextObject]) != nil) { const NSSize res = GSResolutionOfImageRep(rep); if (res.width > maxRes.width && res.height > maxRes.height) { maxRes = res; } } // Use all reps with maxRes enumerator = [reps objectEnumerator]; while ((rep = [enumerator nextObject]) != nil) { const NSSize res = GSResolutionOfImageRep(rep); if (NSEqualSizes(res, maxRes)) { [breps addObject: rep]; } } } // 4. If there are still none, use all available reps. // Note that this handles using vector reps in the case where there are // no bitmap reps, but [self usesEPSOnResolutionMismatch] is NO. if ([breps count] == 0) { [breps setArray: reps]; } return breps; } /* Find the reps that match the bitsPerSample of the device, or if none match exactly, return all that have the highest bitsPerSample. If the device lacks a bps, all reps are treated as matching. If a rep has NSImageRepMatchesDevice as its bps, it is treated as matching. */ - (NSMutableArray *) _bestRep: (NSArray *)reps withBpsMatch: (NSDictionary*)deviceDescription { NSMutableArray *breps = [NSMutableArray array]; NSNumber *bpsValue = [deviceDescription objectForKey: NSDeviceBitsPerSample]; if (bpsValue != nil) { NSInteger deviceBps = [bpsValue integerValue]; NSInteger maxBps = -1; BOOL haveDeviceBps = NO; NSImageRep *rep; NSEnumerator *enumerator; // Determine maxBps enumerator = [reps objectEnumerator]; while ((rep = [enumerator nextObject]) != nil) { if ([rep bitsPerSample] > maxBps) { maxBps = [rep bitsPerSample]; } if ([rep bitsPerSample] == deviceBps) { haveDeviceBps = YES; } } // Use all reps with deviceBps if haveDeviceBps is YES, // otherwise use all reps with maxBps enumerator = [reps objectEnumerator]; while ((rep = [enumerator nextObject]) != nil) { if ([rep bitsPerSample] == NSImageRepMatchesDevice || (!haveDeviceBps && [rep bitsPerSample] == maxBps) || (haveDeviceBps && [rep bitsPerSample] == deviceBps)) { [breps addObject: rep]; } } } /* If there are no matches, pass all the reps */ if ([breps count] == 0) { [breps setArray: reps]; } return breps; } - (NSMutableArray *) _representationsWithCachedImages: (BOOL)flag { NSUInteger count; if (_flags.syncLoad) { /* Make sure any images that were added with _useFromFile: are loaded in and added to the representation list. */ [self _loadFromFile: _fileName]; _flags.syncLoad = NO; } count = [_reps count]; if (count == 0) { return [NSArray array]; } else { id repList[count]; NSUInteger i, j; [_reps getObjects: repList]; j = 0; for (i = 0; i < count; i++) { if (flag || ((GSRepData*)repList[i])->original == nil) { repList[j] = ((GSRepData*)repList[i])->rep; j++; } } return [NSArray arrayWithObjects: repList count: j]; } } - (NSArray *) _bestRepresentationsForDevice: (NSDictionary*)deviceDescription { NSMutableArray *reps = [self _representationsWithCachedImages: NO]; if (deviceDescription == nil) { if ([GSCurrentContext() isDrawingToScreen] == YES) { // Take the device description from the current context. deviceDescription = [[[GSCurrentContext() attributes] objectForKey: NSGraphicsContextDestinationAttributeName] deviceDescription]; } else if ([NSPrintOperation currentOperation]) { /* FIXME: We could try to use the current printer, but there are many cases where might not be printing (EPS, PDF, etc) to a specific device */ } } if (_flags.colorMatchPreferred == YES) { reps = [self _bestRep: reps withColorMatch: deviceDescription]; reps = [self _bestRep: reps withResolutionMatch: deviceDescription]; } else { reps = [self _bestRep: reps withResolutionMatch: deviceDescription]; reps = [self _bestRep: reps withColorMatch: deviceDescription]; } reps = [self _bestRep: reps withBpsMatch: deviceDescription]; return reps; } - (NSImageRep *) bestRepresentationForDevice: (NSDictionary*)deviceDescription { NSArray *reps = [self _bestRepresentationsForDevice: deviceDescription]; /* If we have more than one match check for a representation whose size * matches the image size exactly. Otherwise, arbitrarily choose the first * representation. */ if ([reps count] > 1) { NSImageRep *rep; NSEnumerator *enumerator = [reps objectEnumerator]; while ((rep = [enumerator nextObject]) != nil) { if (NSEqualSizes(_size, [rep size]) == YES) { return rep; } } } if ([reps count] > 0) { return [reps objectAtIndex: 0]; } else { return nil; } } - (NSImageRep *) bestRepresentationForRect: (NSRect)rect context: (NSGraphicsContext *)context hints: (NSDictionary *)deviceDescription { NSArray *reps = [self _bestRepresentationsForDevice: deviceDescription]; const NSSize desiredSize = rect.size; NSImageRep *bestRep = nil; // Pick the smallest rep that is greater than or equal to the // desired size. { NSSize bestSize = NSMakeSize(CGFLOAT_MAX, CGFLOAT_MAX); NSImageRep *rep; NSEnumerator *enumerator = [reps objectEnumerator]; while ((rep = [enumerator nextObject]) != nil) { const NSSize repSize = [rep size]; if ((repSize.width >= desiredSize.width) && (repSize.height >= desiredSize.height) && (repSize.width < bestSize.width) && (repSize.height < bestSize.height)) { bestSize = repSize; bestRep = rep; } } } if (bestRep == nil) { bestRep = [reps lastObject]; } return bestRep; } - (NSArray *) representations { return [self _representationsWithCachedImages: YES]; } - (void) setDelegate: anObject { _delegate = anObject; } - (id) delegate { return _delegate; } // Producing TIFF Data for the Image - (NSData *) TIFFRepresentation { NSData *data; // As a result of using bitmap representations, new drawing wont show on the tiff data. data = [bitmapClass TIFFRepresentationOfImageRepsInArray: [self representations]]; if (!data) { NSBitmapImageRep *rep; NSSize size = [self size]; // If there isn't a bitmap representation to output, create one and store it. [self lockFocus]; rep = [[NSBitmapImageRep alloc] initWithFocusedViewRect: NSMakeRect(0.0, 0.0, size.width, size.height)]; [self unlockFocus]; if (nil != rep) { [self addRepresentation: rep]; data = [rep TIFFRepresentation]; RELEASE(rep); } } return data; } - (NSData *) TIFFRepresentationUsingCompression: (NSTIFFCompression)comp factor: (float)aFloat { NSData *data; // As a result of using bitmap representations, new drawing wont show on the tiff data. data = [bitmapClass TIFFRepresentationOfImageRepsInArray: [self representations] usingCompression: comp factor: aFloat]; if (!data) { NSBitmapImageRep *rep; NSSize size = [self size]; // If there isn't a bitmap representation to output, create one and store it. [self lockFocus]; rep = [[NSBitmapImageRep alloc] initWithFocusedViewRect: NSMakeRect(0.0, 0.0, size.width, size.height)]; [self unlockFocus]; if (nil != rep) { [self addRepresentation: rep]; data = [rep TIFFRepresentationUsingCompression: comp factor: aFloat]; RELEASE(rep); } } return data; } // NSCoding - (void) encodeWithCoder: (NSCoder*)coder { BOOL flag; if ([coder allowsKeyedCoding]) { int flags = 0; if (_flags.archiveByName == NO) { NSMutableArray *container = [NSMutableArray array]; NSMutableArray *reps = [NSMutableArray array]; NSEnumerator *en = [_reps objectEnumerator]; GSRepData *rd = nil; if ([_reps count] > 0) { [reps addObject: [NSNumber numberWithInt: 0]]; while ((rd = [en nextObject]) != nil) { [reps addObject: rd->rep]; } // add the reps to the container... [container addObject: reps]; [coder encodeObject: container forKey: @"NSReps"]; } } else { [coder encodeObject: _name forKey: @"NSName"]; } // encode the rest... if (_color != nil) { [coder encodeObject: _color forKey: @"NSColor"]; } flags |= [self scalesWhenResized] ? 0x8000000 : 0; flags |= _flags.sizeWasExplicitlySet ? 0x2000000 : 0; flags |= [self usesEPSOnResolutionMismatch] ? 0x0200000 : 0; flags |= [self prefersColorMatch] ? 0x0100000 : 0; flags |= [self matchesOnMultipleResolution] ? 0x0080000 : 0; flags |= [self isFlipped] ? 0x0008000 : 0; flags |= [self cacheMode] << 11; [coder encodeInt: flags forKey: @"NSImageFlags"]; if (_flags.sizeWasExplicitlySet) { [coder encodeSize: _size forKey: @"NSSize"]; } } else { flag = _flags.archiveByName; [coder encodeValueOfObjCType: @encode(BOOL) at: &flag]; if (flag == YES) { /* * System image - just encode the name. */ [coder encodeValueOfObjCType: @encode(id) at: &_name]; } else { NSMutableArray *a; NSEnumerator *e; NSImageRep *r; /* * Normal image - encode the ivars */ [coder encodeValueOfObjCType: @encode(NSSize) at: &_size]; [coder encodeValueOfObjCType: @encode(id) at: &_color]; flag = _flags.scalable; [coder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _flags.dataRetained; [coder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _flags.flipDraw; [coder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _flags.sizeWasExplicitlySet; [coder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _flags.useEPSOnResolutionMismatch; [coder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _flags.colorMatchPreferred; [coder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _flags.multipleResolutionMatching; [coder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _flags.cacheSeparately; [coder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _flags.unboundedCacheDepth; [coder encodeValueOfObjCType: @encode(BOOL) at: &flag]; // FIXME: The documentation says to archive only the file name, // if not data retained! /* * Now encode an array of all the image reps (excluding cache) */ a = [NSMutableArray arrayWithCapacity: 2]; e = [[self representations] objectEnumerator]; while ((r = [e nextObject]) != nil) { if ([r isKindOfClass: cachedClass] == NO) { [a addObject: r]; } } [coder encodeValueOfObjCType: @encode(id) at: &a]; } } } - (id) initWithCoder: (NSCoder*)coder { BOOL flag; _reps = [[NSMutableArray alloc] initWithCapacity: 2]; if ([coder allowsKeyedCoding]) { if ([coder containsValueForKey: @"NSName"]) { RELEASE(self); return RETAIN([NSImage imageNamed: [coder decodeObjectForKey: @"NSName"]]); } if ([coder containsValueForKey: @"NSColor"]) { [self setBackgroundColor: [coder decodeObjectForKey: @"NSColor"]]; } if ([coder containsValueForKey: @"NSImageFlags"]) { int flags = [coder decodeIntForKey: @"NSImageFlags"]; [self setScalesWhenResized: ((flags & 0x8000000) != 0)]; // _flags.sizeWasExplicitlySet = ((flags & 0x2000000) != 0); [self setUsesEPSOnResolutionMismatch: ((flags & 0x0200000) != 0)]; [self setPrefersColorMatch: ((flags & 0x0100000) != 0)]; [self setMatchesOnMultipleResolution: ((flags & 0x0080000) != 0)]; [self setFlipped: ((flags & 0x0008000) != 0)]; // ALIASED ((flags & 0x0004000) != 0) [self setCacheMode: ((flags & 0x0001800) >> 11)]; } if ([coder containsValueForKey: @"NSReps"]) { NSArray *reps; NSUInteger i; // FIXME: NSReps is in a strange format. It is a mutable array with one // element which is an array with a first element 0 and than the image rep. reps = [coder decodeObjectForKey: @"NSReps"]; reps = [reps objectAtIndex: 0]; for (i = 1; i < [reps count]; i++) { id rep = [reps objectAtIndex: i]; if ([rep isKindOfClass: [NSImageRep class]]) { [self addRepresentation: rep]; } else { if ([rep isKindOfClass: [NSURL class]]) { NSURL *tmp = (NSURL*)rep; rep = [NSImageRep imageRepWithContentsOfURL: rep]; // If we are unable to resolved the URL, try to get it from the // resources folder. if (rep == nil) { NSString *fileName = [[tmp absoluteString] lastPathComponent]; NSString *path = [[NSBundle mainBundle] pathForImageResource: fileName]; rep = [NSImageRep imageRepWithContentsOfFile: path]; } // If the representation was found, add it... if (rep != nil) { [self addRepresentation: rep]; } } } } } if ([coder containsValueForKey: @"NSSize"]) { [self setSize: [coder decodeSizeForKey: @"NSSize"]]; } } else { [coder decodeValueOfObjCType: @encode(BOOL) at: &flag]; if (flag == YES) { NSString *theName = [coder decodeObject]; RELEASE(self); self = RETAIN([NSImage imageNamed: theName]); } else { NSArray *a; [coder decodeValueOfObjCType: @encode(NSSize) at: &_size]; [coder decodeValueOfObjCType: @encode(id) at: &_color]; [coder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _flags.scalable = flag; [coder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _flags.dataRetained = flag; [coder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _flags.flipDraw = flag; [coder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _flags.sizeWasExplicitlySet = flag; [coder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _flags.useEPSOnResolutionMismatch = flag; [coder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _flags.colorMatchPreferred = flag; [coder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _flags.multipleResolutionMatching = flag; [coder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _flags.cacheSeparately = flag; [coder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _flags.unboundedCacheDepth = flag; /* * get the image reps and add them. */ a = [coder decodeObject]; [self addRepresentations: a]; } } return self; } + (BOOL) canInitWithPasteboard: (NSPasteboard *)pasteboard { int i, count; NSArray* array = [NSImageRep registeredImageRepClasses]; count = [array count]; for (i = 0; i < count; i++) if ([[array objectAtIndex: i] canInitWithPasteboard: pasteboard]) return YES; return NO; } + (NSArray *) imageUnfilteredFileTypes { if (nil == imageUnfilteredFileTypes) { ASSIGN(imageUnfilteredFileTypes, iterate_reps_for_types([NSImageRep registeredImageRepClasses], @selector(imageUnfilteredFileTypes))); } return imageUnfilteredFileTypes; } + (NSArray *) imageFileTypes { if (nil == imageFileTypes) { ASSIGN(imageFileTypes, iterate_reps_for_types([NSImageRep registeredImageRepClasses], @selector(imageFileTypes))); } return imageFileTypes; } + (NSArray *) imageUnfilteredPasteboardTypes { if (nil == imageUnfilteredPasteboardTypes) { ASSIGN(imageUnfilteredPasteboardTypes, iterate_reps_for_types([NSImageRep registeredImageRepClasses], @selector(imageUnfilteredPasteboardTypes))); } return imageUnfilteredPasteboardTypes; } + (NSArray *) imagePasteboardTypes { if (nil == imagePasteboardTypes) { ASSIGN(imagePasteboardTypes, iterate_reps_for_types([NSImageRep registeredImageRepClasses], @selector(imagePasteboardTypes))); } return imagePasteboardTypes; } @end /* For every image rep, call the specified method to obtain an array of objects. Add these together, with duplicates weeded out. Used by imageUnfilteredPasteboardTypes, imageUnfilteredFileTypes, etc. */ static NSArray * iterate_reps_for_types(NSArray* imageReps, SEL method) { NSImageRep *rep; NSEnumerator *e; NSMutableArray *types; types = [NSMutableArray arrayWithCapacity: 2]; // Iterate through all the image reps e = [imageReps objectEnumerator]; rep = [e nextObject]; while (rep) { id e1; id obj; NSArray* pb_list; // Have the image rep perform the operation pb_list = [rep performSelector: method]; // Iterate through the returned array // and add elements to types list, duplicates weeded. e1 = [pb_list objectEnumerator]; obj = [e1 nextObject]; while (obj) { if ([types indexOfObject: obj] == NSNotFound) [types addObject: obj]; obj = [e1 nextObject]; } rep = [e nextObject]; } return (NSArray *)types; } @implementation NSImage (Private) + (void) _clearFileTypeCaches: (NSNotification*)notif { DESTROY(imageUnfilteredFileTypes); DESTROY(imageFileTypes); DESTROY(imageUnfilteredPasteboardTypes); DESTROY(imagePasteboardTypes); } /** * For all NSImage instances cached in nameDict, recompute the * path using +_pathForImageNamed: and if it has changed, * reload the image contents using the new path. */ + (void) _reloadCachedImages { NSString *name; NSEnumerator *e = [nameDict keyEnumerator]; [imageLock lock]; while ((name = [e nextObject]) != nil) { NSImage *image = [nameDict objectForKey: name]; NSString *path = [self _pathForImageNamed: name]; //NSLog(@"Loaded image %@ from %@", name, path); if (path != nil && ![path isEqual: image->_fileName]) { /* Reset the existing image to use the contents of * the specified file. */ [image _resetAndUseFromFile: path]; } } [imageLock unlock]; } + (NSString *) _pathForLibraryImageNamed: (NSString *)aName ofType: (NSString *)ext inDirectory: (NSString *)aDir { if (ext != nil) { return [NSBundle pathForLibraryResource: aName ofType: ext inDirectory: aDir]; } NSEnumerator *e = [[self imageFileTypes] objectEnumerator]; id o = nil; while ((o = [e nextObject]) != nil) { NSString *path = [NSBundle pathForLibraryResource: aName ofType: o inDirectory: aDir]; if (path != nil && [path length] != 0) return path; } return nil; } + (NSString *) _pathForSystemImageNamed: (NSString *)realName ofType: (NSString *)ext { NSString *path = [self _pathForLibraryImageNamed: realName ofType: ext inDirectory: @"Images"]; /* If not found then search in system using the reverse NSImage nsmapping */ if (path == nil) { NSEnumerator *e = [[nsmapping allKeysForObject: realName] objectEnumerator]; NSString *aliasName = nil; while ((aliasName = [e nextObject]) != nil) { path = [self _pathForLibraryImageNamed: aliasName ofType: ext inDirectory: @"Images"]; if (path != nil) break; } } return path; } + (NSString *) _resourceNameForImageNamed: (NSString *)aName type: (NSString **)aType { NSString *name = aName; NSString *ext = [aName pathExtension]; if (ext != nil && [ext length] == 0) { ext = nil; } /* Check if extension is one of the image types */ if (ext != nil && [[self imageFileTypes] indexOfObject: ext] != NSNotFound) { /* Extension is one of the image types, so remove from the name */ name = [aName stringByDeletingPathExtension]; } else { /* Otherwise extension is not an image type, so leave it alone */ ext = nil; } *aType = ext; return name; } + (NSString *) _pathForImageNamed: (NSString *)aName ofType: (NSString *)ext subdirectory: (NSString *)aDir inBundle: (NSBundle *)aBundle { if (ext != nil) { return [aBundle pathForResource: aName ofType: ext inDirectory: aDir]; } NSEnumerator *e = [[self imageFileTypes] objectEnumerator]; id o = nil; while ((o = [e nextObject]) != nil) { NSString * path = [aBundle pathForResource: aName ofType: o inDirectory: aDir]; if (path != nil && [path length] != 0) return path; } return nil; } /* * The type received in argument is meaningfull for searching image files * using the proposed image name, but useless otherwise. */ + (NSString *) _pathForThemeImageNamed: (NSString *)aName ofType: (NSString *)ext { NSDictionary *themeMapping = [[[GSTheme theme] infoDictionary] objectForKey: @"GSThemeImages"]; NSString *mappedName = [themeMapping objectForKey: aName]; NSString *path = nil; /* First search among the theme images using the GSTheme mapping */ if (mappedName != nil) { NSString *extension = nil; NSString *proposedName = [self _resourceNameForImageNamed: mappedName type: &extension]; /* If the image file name from the theme mapping uses an extension, this extension is used to look up the path. If the image file cannot found, _pathForImageNamed:ofType:subdirectory:inBundle: searches an image file for the file extensions from -imageFileTypes. */ path = [self _pathForImageNamed: proposedName ofType: extension subdirectory: @"ThemeImages" inBundle: [[GSTheme theme] bundle]]; } /* If not found, search among the theme images using the reverse NSImage mapping (for GNUstep and OpenStep image names such as common_SwitchOff or NSSwitch) */ if (path == nil) { NSEnumerator *e = [[nsmapping allKeysForObject: aName] objectEnumerator]; NSString *aliasName = nil; while ((aliasName = [e nextObject]) != nil) { NSAssert([[aliasName pathExtension] length] == 0, @"nsmapping.strings " "must include no extensions in image file names"); path = [self _pathForImageNamed: aliasName ofType: nil subdirectory: @"ThemeImages" inBundle: [[GSTheme theme] bundle]]; if (path != nil) break; } } /* If not found, search among the theme images using the image name directly */ if (path == nil) { path = [self _pathForImageNamed: aName ofType: ext subdirectory: @"ThemeImages" inBundle: [[GSTheme theme] bundle]]; } return path; } /* * nsmapping.strings maps alternative image naming schemes to the GSTheme * standard image naming scheme. For example, NSSwitch (from OpenStep) and * common_SwitchOff (from GNUstep) are mapped to GSSwitch. In nameDict that * tracks image instances, the keys are image names from GSTheme such as * GSSwitch or additional icon names such NSApplicationIcon or * NSToolbarShowColors. In the long run, it would be cleaner to move built-in * theme images into a GNUstep.theme bundle. * * If you pass NSSwitch to +imageNamed:, nsmapping is used to get GSSwitch as * the real name, then _pathForImageNamed: will look up the image first in the * theme and fall back on the Library images. For the library images, we do a * reverse lookup in nsmapping (using allKeysForObject:) to get the image file * name (e.g. from GSSwitch to common_SwitchOff). This reverse lookup is * similar to the one supported for getting image file names from the * GSThemeImages section of a theme Info.plist. By creating a GNUstep.theme * bundle, this reverse lookup could be handled by GSTheme rather than being * treated as a special case in -_pathForImageNamed:. */ + (NSString *) _pathForImageNamed: (NSString *)aName { NSString *ext = nil; NSString *proposedName = [self _resourceNameForImageNamed: aName type: &ext]; NSString *path = nil; // FIXME: This should use [NSBundle pathForImageResource] if possible, but // this will only allow imageUnfilteredFileTypes. /* First search locally */ path = [self _pathForImageNamed: proposedName ofType: ext subdirectory: nil inBundle: [NSBundle mainBundle]]; /* If not found then search in theme */ if (path == nil) { path = [self _pathForThemeImageNamed: proposedName ofType: ext]; } /* If not found then search in system */ if (path == nil) { path = [self _pathForSystemImageNamed: proposedName ofType: ext]; } return path; } - (BOOL)_loadFromData: (NSData *)data { BOOL ok; Class rep; ok = NO; rep = [NSImageRep imageRepClassForData: data]; if (rep && [rep respondsToSelector: @selector(imageRepsWithData:)]) { NSArray* array; array = [rep imageRepsWithData: data]; if (array && ([array count] > 0)) ok = YES; [self addRepresentations: array]; } else if (rep) { NSImageRep* image; image = [rep imageRepWithData: data]; if (image) ok = YES; [self addRepresentation: image]; } return ok; } - (BOOL) _loadFromFile: (NSString *)fileName { NSArray *array; array = [NSImageRep imageRepsWithContentsOfFile: fileName]; if (array) [self addRepresentations: array]; return (array && ([array count] > 0)) ? YES : NO; } - (BOOL) _useFromFile: (NSString *)fileName { NSArray *array; NSString *ext; NSFileManager *manager = [NSFileManager defaultManager]; if ([manager fileExistsAtPath: fileName] == NO) { return NO; } ext = [[fileName pathExtension] lowercaseString]; if (!ext) return NO; array = [object_getClass(self) imageFileTypes]; if ([array indexOfObject: ext] == NSNotFound) return NO; ASSIGN(_fileName, fileName); _flags.syncLoad = YES; return YES; } - (BOOL) _resetAndUseFromFile: (NSString *)fileName { [_reps removeAllObjects]; if (!_flags.sizeWasExplicitlySet) { _size = NSZeroSize; } return [self _useFromFile: fileName]; } // Cache the bestRepresentation. If the bestRepresentation is not itself // a cache and no cache exists, create one and draw the representation in it // If a cache exists, but is not valid, redraw the cache from the original // image (if there is one). - (NSCachedImageRep *) _doImageCache: (NSImageRep *)rep { GSRepData *repd; NSCachedImageRep *cache; repd = [self _cacheForRep: rep]; if (repd == nil) return nil; cache = (NSCachedImageRep*)(repd->rep); if ([cache isKindOfClass: cachedClass] == NO) return nil; NSDebugLLog(@"NSImage", @"Cached image rep is %p", cache); /* * if the cache is not valid, it's background color will not exist * and we must draw the background then render from the original * image rep into the cache. */ if (repd->bg == nil) { [self lockFocusOnRepresentation: cache]; [self unlockFocus]; NSDebugLLog(@"NSImage", @"Rendered rep %p on background %@", cache, repd->bg); } return cache; } - (GSRepData*) _cacheForRep: (NSImageRep*)rep { if ([rep isKindOfClass: cachedClass] == YES) { return repd_for_rep(_reps, rep); } else { /* * If this is not a cached image rep - try to find the cache rep * for this image rep. If none is found create a cache to be used to * render the image rep into, and switch to the cached rep. */ NSUInteger count = [_reps count]; if (count > 0) { GSRepData *invalidCache = nil; GSRepData *partialCache = nil; GSRepData *reps[count]; NSUInteger partialCount = 0; NSUInteger i; BOOL opaque = [rep isOpaque]; [_reps getObjects: reps]; /* * Search the cached image reps for any whose original is our * 'best' image rep. See if we can notice any invalidated * cache as we go - if we don't find a valid cache, we want to * re-use an invalidated one rather than creating a new one. * NB. If the image rep is opaque, then any cached rep is valid * irrespective of the background color it was drawn with. */ for (i = 0; i < count; i++) { GSRepData *repd = reps[i]; if (repd->original == rep && repd->rep != nil) { if (repd->bg == nil) { NSDebugLLog(@"NSImage", @"Invalid %@ ... %@ %@", repd->bg, _color, repd->rep); invalidCache = repd; } else if (opaque == YES || [repd->bg isEqual: _color] == YES) { NSDebugLLog(@"NSImage", @"Exact %@ ... %@ %@", repd->bg, _color, repd->rep); return repd; } else { NSDebugLLog(@"NSImage", @"Partial %@ ... %@ %@", repd->bg, _color, repd->rep); partialCache = repd; partialCount++; } } } if (invalidCache != nil) { /* * If there is an unused cache - use it rather than * re-using this one, since we might get a request * to draw with this color again. */ return invalidCache; } else if (partialCache != nil && partialCount > 2) { /* * Only re-use partially correct caches if there are already * a few partial matches - otherwise we fall default to * creating a new cache. */ if (NSImageForceCaching == NO && opaque == NO) { DESTROY(partialCache->bg); } return partialCache; } } // We end here, when no representation are there or no match is found. { NSImageRep *cacheRep = nil; GSRepData *repd; NSSize imageSize = [self size]; NSSize repSize; NSInteger pixelsWide, pixelsHigh; if (rep != nil) { repSize = [rep size]; if (repSize.width <= 0 || repSize.height <= 0) repSize = imageSize; pixelsWide = [rep pixelsWide]; pixelsHigh = [rep pixelsHigh]; if (pixelsWide == NSImageRepMatchesDevice || pixelsHigh == NSImageRepMatchesDevice) { // FIXME: Since the cached rep must be a bitmap, // we must rasterize vector reps at a particular DPI. // Here we hardcode 72, but we should choose the DPI more intelligently. pixelsWide = repSize.width; pixelsHigh = repSize.height; } } else // e.g. when there are no representations at all { repSize = imageSize; // FIXME: assumes 72 DPI. Also truncates, not sure if that is a problem. pixelsWide = imageSize.width; pixelsHigh = imageSize.height; } if (repSize.width <= 0 || repSize.height <= 0 || pixelsWide <= 0 || pixelsHigh <= 0) return nil; // Create a new cached image rep without any contents. cacheRep = [[cachedClass alloc] initWithSize: repSize pixelsWide: pixelsWide pixelsHigh: pixelsHigh depth: [[NSScreen mainScreen] depth] separate: _flags.cacheSeparately alpha: [rep hasAlpha]]; if (cacheRep == nil) { return nil; } repd = [GSRepData new]; repd->rep = cacheRep; repd->original = rep; // may be nil! [_reps addObject: repd]; RELEASE(repd); /* Retained in _reps array. */ return repd; } } } @end gnustep-gui-0.24.0/Source/NSInputServer.m0000664000076500007650000000520011534147002020101 0ustar brains99brains99/** NSInputServer -*-objc-*- Copyright (C) 2001 Free Software Foundation, Inc. Author: Fred Kiefer Date: August 2001 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "AppKit/NSInputServer.h" @implementation NSInputServer - (id) initWithDelegate: (id)aDelegate name: (NSString *)name { return nil; } // NSInputServerMouseTracker protocol - (BOOL) mouseDownOnCharacterIndex: (unsigned)index atCoordinate: (NSPoint)point withModifier: (unsigned int)flags client: (id)sender { return NO; } - (BOOL) mouseDraggedOnCharacterIndex: (unsigned)index atCoordinate: (NSPoint)point withModifier: (unsigned int)flags client: (id)sender { return NO; } - (void) mouseUpOnCharacterIndex: (unsigned)index atCoordinate: (NSPoint)point withModifier: (unsigned int)flags client: (id)sender {} // NSInputServiceProvider protocol - (void) activeConversationChanged: (id)sender toNewConversation: (long)newConversation {} - (void) activeConversationWillChange: (id)sender fromOldConversation: (long)oldConversation {} - (BOOL) canBeDisabled { return NO; } - (void) doCommandBySelector: (SEL)aSelector client: (id)sender {} - (void) inputClientBecomeActive: (id)sender {} - (void) inputClientDisabled: (id)sender {} - (void) inputClientEnabled: (id)sender {} - (void) inputClientResignActive: (id)sender {} - (void) insertText: (id)aString client: (id)sender {} - (void) markedTextAbandoned: (id)sender {} - (void) markedTextSelectionChanged: (NSRange)newSelection client: (id)sender {} - (void) terminate: (id)sender {} - (BOOL) wantsToDelayTextChangeNotifications { return NO; } - (BOOL) wantsToHandleMouseEvents { return NO; } - (BOOL) wantsToInterpretAllKeystrokes { return NO; } @end gnustep-gui-0.24.0/Source/NSBitmapImageRep.m0000664000076500007650000021647512231040020020446 0ustar brains99brains99/** NSBitmapImageRep.m Bitmap image representation. Copyright (C) 1996, 2003, 2004 Free Software Foundation, Inc. Author: Adam Fedor Date: Feb 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #include #include #include #import #import #import #import #import #import #import #import "AppKit/AppKitExceptions.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSGraphicsContext.h" #import "AppKit/NSPasteboard.h" #import "AppKit/NSView.h" #import "AppKit/NSBitmapImageRep.h" #import "NSBitmapImageRep+GIF.h" #import "NSBitmapImageRep+JPEG.h" #import "NSBitmapImageRep+PNG.h" #import "NSBitmapImageRep+PNM.h" #import "NSBitmapImageRep+ICNS.h" #import "GSGuiPrivate.h" #include "nsimage-tiff.h" /* Maximum number of planes */ #define MAX_PLANES 5 /* Backend methods (optional) */ @interface NSBitmapImageRep (GSPrivate) // GNUstep extension - _initFromTIFFImage: (TIFF *)image number: (int)imageNumber; // Internal + (int) _localFromCompressionType: (NSTIFFCompression)type; + (NSTIFFCompression) _compressionTypeFromLocal: (int)type; - (void) _premultiply; - (void) _unpremultiply; - (NSBitmapImageRep *) _convertToFormatBitsPerSample: (NSInteger)bps samplesPerPixel: (NSInteger)spp hasAlpha: (BOOL)alpha isPlanar: (BOOL)isPlanar colorSpaceName: (NSString*)colorSpaceName bitmapFormat: (NSBitmapFormat)bitmapFormat bytesPerRow: (NSInteger)rowBytes bitsPerPixel: (NSInteger)pixelBits; @end /** Class Description

NSBitmapImageRep is an image representation for handling images composed of pixels. The standard image format for NSBitmapImageRep is the TIFF format. However, through the use of image filters and other methods, many other standard image formats can be handled by NSBitmapImageRep. Images are typically handled through the NSImage class and there is often no need to use the NSBitmapImageRep class directly. However there may be cases where you want to manipulate the image bitmap data directly.

*/ @implementation NSBitmapImageRep /** Returns YES if the image stored in data can be read and decoded */ + (BOOL) canInitWithData: (NSData *)data { TIFF *image = NULL; if (data == nil) { return NO; } if ([self _bitmapIsPNG: data]) return YES; if ([self _bitmapIsPNM: data]) return YES; if ([self _bitmapIsJPEG: data]) return YES; if ([self _bitmapIsGIF: data]) return YES; if ([self _bitmapIsICNS: data]) return YES; image = NSTiffOpenDataRead ((char *)[data bytes], [data length]); if (image != NULL) { NSTiffClose (image); return YES; } else { return NO; } } /** Returns a list of image filename extensions that are understood by NSBitmapImageRep. */ + (NSArray *) imageUnfilteredFileTypes { static NSArray *types = nil; if (types == nil) { types = [[NSArray alloc] initWithObjects: @"tiff", @"tif", @"pnm", @"ppm", #if HAVE_LIBUNGIF || HAVE_LIBGIF @"gif", #endif #if HAVE_LIBJPEG @"jpeg", @"jpg", #endif #if HAVE_LIBPNG @"png", #endif @"icns", nil]; } return types; } /** Returns a list of image pasteboard types that are understood by NSBitmapImageRep. */ + (NSArray *) imageUnfilteredPasteboardTypes { static NSArray *types = nil; if (types == nil) { types = [[NSArray alloc] initWithObjects: NSTIFFPboardType, nil]; } return types; } /**

Returns a newly allocated NSBitmapImageRep object representing the image stored in imageData. If the image data contains more than one image, the first one is choosen.

See Also: +imageRepsWithData:

*/ + (id) imageRepWithData: (NSData *)imageData { return AUTORELEASE([[self alloc] initWithData: imageData]); } /**

Returns an array containing newly allocated NSBitmapImageRep objects representing the images stored in imageData.

See Also: +imageRepWithData:

*/ + (NSArray*) imageRepsWithData: (NSData *)imageData { int i, images; TIFF *image; NSMutableArray *array; if (imageData == nil) { NSLog(@"NSBitmapImageRep: nil image data"); return [NSArray array]; } if ([self _bitmapIsPNG: imageData]) { NSBitmapImageRep *rep; NSArray *a; rep = [[self alloc] _initBitmapFromPNG: imageData]; if (!rep) return [NSArray array]; a = [NSArray arrayWithObject: rep]; DESTROY(rep); return a; } if ([self _bitmapIsPNM: imageData]) { NSBitmapImageRep *rep; NSArray *a; rep = [[self alloc] _initBitmapFromPNM: imageData errorMessage: NULL]; if (!rep) return [NSArray array]; a = [NSArray arrayWithObject: rep]; DESTROY(rep); return a; } if ([self _bitmapIsJPEG: imageData]) { NSBitmapImageRep *rep; NSArray *a; rep = [[self alloc] _initBitmapFromJPEG: imageData errorMessage: NULL]; if (!rep) return [NSArray array]; a = [NSArray arrayWithObject: rep]; DESTROY(rep); return a; } if ([self _bitmapIsGIF: imageData]) { NSBitmapImageRep *rep; NSArray *a; rep = [[self alloc] _initBitmapFromGIF: imageData errorMessage: NULL]; if (!rep) return [NSArray array]; a = [NSArray arrayWithObject: rep]; DESTROY(rep); return a; } if ([self _bitmapIsICNS: imageData]) { return [self _imageRepsWithICNSData: imageData]; } image = NSTiffOpenDataRead((char *)[imageData bytes], [imageData length]); if (image == NULL) { NSLog(@"NSBitmapImageRep: unable to parse TIFF data"); return [NSArray array]; } images = NSTiffGetImageCount(image); NSDebugLLog(@"NSImage", @"Image contains %d directories", images); array = [NSMutableArray arrayWithCapacity: images]; for (i = 0; i < images; i++) { NSBitmapImageRep* imageRep; imageRep = [[self alloc] _initFromTIFFImage: image number: i]; if (imageRep) { [array addObject: imageRep]; RELEASE(imageRep); } } NSTiffClose(image); return array; } /** Loads only the default (first) image from the image contained in data. */ - (id) initWithData: (NSData *)imageData { TIFF *image; if (imageData == nil) { RELEASE(self); return nil; } if ([object_getClass(self) _bitmapIsPNG: imageData]) return [self _initBitmapFromPNG: imageData]; if ([object_getClass(self) _bitmapIsPNM: imageData]) return [self _initBitmapFromPNM: imageData errorMessage: NULL]; if ([object_getClass(self) _bitmapIsJPEG: imageData]) return [self _initBitmapFromJPEG: imageData errorMessage: NULL]; if ([object_getClass(self) _bitmapIsGIF: imageData]) return [self _initBitmapFromGIF: imageData errorMessage: NULL]; if ([object_getClass(self) _bitmapIsICNS: imageData]) return [self _initBitmapFromICNS: imageData]; image = NSTiffOpenDataRead((char *)[imageData bytes], [imageData length]); if (image == NULL) { RELEASE(self); NSLog(@"Tiff read invalid TIFF info from data"); return nil; } [self _initFromTIFFImage: image number: -1]; NSTiffClose(image); return self; } /** Initialize with bitmap data from a rect within the focused view */ - (id) initWithFocusedViewRect: (NSRect)rect { NSInteger bps, spp, alpha, format; NSSize size; NSString *space; unsigned char *planes[4]; NSDictionary *dict; dict = [GSCurrentContext() GSReadRect: rect]; if (dict == nil) { NSLog(@"NSBitmapImageRep initWithFocusedViewRect: failed"); RELEASE(self); return nil; } _imageData = RETAIN([dict objectForKey: @"Data"]); if (_imageData == nil || [_imageData length] == 0) { NSLog(@"NSBitmapImageRep initWithFocusedViewRect: failed"); RELEASE(self); return nil; } bps = [[dict objectForKey: @"BitsPerSample"] intValue]; if (bps == 0) bps = 8; spp = [[dict objectForKey: @"SamplesPerPixel"] intValue]; alpha = [[dict objectForKey: @"HasAlpha"] intValue]; size = [[dict objectForKey: @"Size"] sizeValue]; space = [dict objectForKey: @"ColorSpace"]; format = [[dict objectForKey: @"BitmapFormat"] intValue]; planes[0] = (unsigned char *)[_imageData bytes]; self = [self initWithBitmapDataPlanes: planes pixelsWide: size.width pixelsHigh: size.height bitsPerSample: bps samplesPerPixel: spp hasAlpha: (alpha) ? YES : NO isPlanar: NO colorSpaceName: space bitmapFormat: format bytesPerRow: 0 bitsPerPixel: 0]; return self; } /**

Initializes a newly created NSBitmapImageRep object to hold image data specified in the planes buffer and organized according to the additional arguments passed into the method.

The planes argument is an array of char pointers where each array holds a single component or plane of data. Note that if data is passed into the method via planes, the data is NOT copied and not freed when the object is deallocated. It is assumed that the data will always be available. If planes is NULL, then a suitable amount of memory will be allocated to store the information needed. One can then obtain a pointer to the planes data using the -bitmapData or -getBitmapDataPlanes: method.

Each component of the data is in "standard" order, such as red, green, blue for RGB color images. The transparency component, if these is one, should always be last.

The other arguments to the method consist of:

width and height The width and height of the image in pixels bps The bits per sample or the number of bits used to store a number in one component of one pixel of the image. Typically this is 8 (bits) but can be 2 or 4, although not all values are supported. spp Samples per pixel, or the number of components of color in the pixel. For instance this would be 4 for an RGB image with transparency. alpha Set to YES if the image has a transparency component. isPlanar Set to YES if the data is arranged in planes, i.e. one component per buffer as stored in the planes array. If NO, then the image data is mixed in one buffer. For instance, for RGB data, the first sample would contain red, then next green, then blue, followed by red for the next pixel. colorSpaceName This argument specifies how the data values are to be interpreted. Possible values include the typical colorspace names (although not all values are currently supported) rowBytes Specifies the number of bytes contained in a single scan line of the data. Normally this can be computed from the width of the image, the samples per pixel and the bits per sample. However, if the data is aligned along word boundaries, this value may differ from this. If rowBytes is 0, the method will calculate the value assuming there are no extra bytes at the end of the scan line. pixelBits This is normally bps for planar data and bps times spp for non-planar data, but sometimes images have extra bits. If pixelBits is 0 it will be calculated as described above. */ - (id) initWithBitmapDataPlanes: (unsigned char **)planes pixelsWide: (NSInteger)width pixelsHigh: (NSInteger)height bitsPerSample: (NSInteger)bitsPerSample samplesPerPixel: (NSInteger)samplesPerPixel hasAlpha: (BOOL)alpha isPlanar: (BOOL)isPlanar colorSpaceName: (NSString *)colorSpaceName bytesPerRow: (NSInteger)rowBytes bitsPerPixel: (NSInteger)pixelBits { return [self initWithBitmapDataPlanes: planes pixelsWide: width pixelsHigh: height bitsPerSample: bitsPerSample samplesPerPixel: samplesPerPixel hasAlpha: alpha isPlanar: isPlanar colorSpaceName: colorSpaceName bitmapFormat: 0 bytesPerRow: rowBytes bitsPerPixel: pixelBits]; } - (id) initWithBitmapDataPlanes: (unsigned char**)planes pixelsWide: (NSInteger)width pixelsHigh: (NSInteger)height bitsPerSample: (NSInteger)bps samplesPerPixel: (NSInteger)spp hasAlpha: (BOOL)alpha isPlanar: (BOOL)isPlanar colorSpaceName: (NSString*)colorSpaceName bitmapFormat: (NSBitmapFormat)bitmapFormat bytesPerRow: (NSInteger)rowBytes bitsPerPixel: (NSInteger)pixelBits { NSDebugLLog(@"NSImage", @"Creating bitmap image with pw %d ph %d bps %d spp %d alpha %d, planar %d cs %@", (int)width,(int) height, (int)bps, (int)spp, alpha, isPlanar, colorSpaceName); if (!bps || !spp || !width || !height) { [NSException raise: NSInvalidArgumentException format: @"Required arguments not specified creating NSBitmapImageRep"]; } _pixelsWide = width; _pixelsHigh = height; _size.width = width; _size.height = height; _bitsPerSample = bps; _numColors = spp; _hasAlpha = alpha; _isPlanar = isPlanar; _colorSpace = RETAIN(colorSpaceName); _format = bitmapFormat; if (!pixelBits) pixelBits = bps * ((_isPlanar) ? 1 : spp); _bitsPerPixel = pixelBits; if (!rowBytes) rowBytes = ceil((float)width * _bitsPerPixel / 8); _bytesPerRow = rowBytes; _imagePlanes = NSAllocateCollectable(sizeof(unsigned char*) * MAX_PLANES, 0); if (planes) { unsigned int i; for (i = 0; i < MAX_PLANES; i++) _imagePlanes[i] = NULL; for (i = 0; i < ((_isPlanar) ? _numColors : 1); i++) _imagePlanes[i] = planes[i]; } else { unsigned char *bits; NSUInteger length; unsigned int i; // No image data was given, allocate it. length = (NSUInteger)((_isPlanar) ? _numColors : 1) * _bytesPerRow * _pixelsHigh * sizeof(unsigned char); // Create a mutable data object although we never use it as such _imageData = [[NSMutableData alloc] initWithLength: length]; bits = (unsigned char *)[_imageData bytes]; _imagePlanes[0] = bits; if (_isPlanar) { for (i = 1; i < _numColors; i++) _imagePlanes[i] = bits + i * _bytesPerRow * _pixelsHigh; for (i = _numColors; i < MAX_PLANES; i++) _imagePlanes[i] = NULL; } else { for (i = 1; i < MAX_PLANES; i++) _imagePlanes[i] = NULL; } } if (alpha) { unsigned char *bData = (unsigned char*)[self bitmapData]; BOOL allOpaque = YES; unsigned offset = _numColors - 1; unsigned limit = _size.height * _size.width; unsigned i; for (i = 0; i < limit; i++) { unsigned a; bData += offset; a = *bData++; if (a != 255) { allOpaque = NO; break; } } [self setOpaque: allOpaque]; } else { [self setOpaque: YES]; } _properties = [[NSMutableDictionary alloc] init]; return self; } - (void)colorizeByMappingGray:(CGFloat)midPoint toColor:(NSColor *)midPointColor blackMapping:(NSColor *)shadowColor whiteMapping:(NSColor *)lightColor { // TODO } - (id)initWithBitmapHandle:(void *)bitmap { // TODO Only needed on MS Windows RELEASE(self); return nil; } - (id)initWithIconHandle:(void *)icon { // TODO Only needed on MS Windows RELEASE(self); return nil; } - (id) initForIncrementalLoad { // FIXME return self; } - (NSInteger) incrementalLoadFromData: (NSData *)data complete: (BOOL)complete { if (!complete) { // we don't implement it really return NSImageRepLoadStatusWillNeedAllData; } return [self initWithData: data] ? NSImageRepLoadStatusCompleted : NSImageRepLoadStatusUnexpectedEOF; } - (void) dealloc { NSZoneFree([self zone],_imagePlanes); RELEASE(_imageData); RELEASE(_properties); [super dealloc]; } // // Getting Information about the Image // /** Returns the number of bits need to contain one pixels worth of data. This is normally the number of samples per pixel times the number of bits in one sample. */ - (NSInteger) bitsPerPixel { return _bitsPerPixel; } /** Returns the number of samples in a pixel. For instance, a normal RGB image with transparency would have a samplesPerPixel of 4. */ - (NSInteger) samplesPerPixel { return _numColors; } /** Returns YES if the image components are stored separately. Returns NO if the components are meshed (i.e. all the samples for one pixel come before the next pixel). */ - (BOOL) isPlanar { return _isPlanar; } /** Returns the number of planes in an image. Typically this is equal to the number of samples in a planar image or 1 for a non-planar image. */ - (NSInteger) numberOfPlanes { return (_isPlanar) ? _numColors : 1; } /** Returns the number of bytes in a plane. This is the number of bytes in a row times tne height of the image. */ - (NSInteger) bytesPerPlane { return _bytesPerRow*_pixelsHigh; } /** Returns the number of bytes in a row. This is typically based on the width of the image and the bits per sample and samples per pixel (if in medhed configuration). However it may differ from this if set explicitly in -initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bytesPerRow:bitsPerPixel:. */ - (NSInteger) bytesPerRow { return _bytesPerRow; } // // Getting Image Data // /** Returns the first plane of data representing the image. */ - (unsigned char *) bitmapData { unsigned char *planes[MAX_PLANES]; [self getBitmapDataPlanes: planes]; return planes[0]; } /** Files the array data with pointers to each of the data planes representing the image. The data array must be allocated to contain at least -samplesPerPixel pointers. */ - (void) getBitmapDataPlanes: (unsigned char **)data { unsigned int i; if (data) { for (i = 0; i < _numColors; i++) { data[i] = _imagePlanes[i]; } } } - (NSBitmapFormat) bitmapFormat { return _format; } /* * This code was copied over from XGBitmap.m * Here we extract a value a given number of bits wide from a bit * offset into a block of memory starting at "base". The bit numbering * is assumed to be such that a bit offset of zero and a width of 4 gives * the upper 4 bits of the first byte, *not* the lower 4 bits. We do allow * the value to cross a byte boundary, though it is unclear as to whether * this is strictly necessary for OpenStep tiffs. */ static unsigned int _get_bit_value(unsigned char *base, long msb_off, int bit_width) { long lsb_off, byte1, byte2; int shift, value; /* * Firstly we calculate the position of the msb and lsb in terms * of bit offsets and thus byte offsets. The shift is the number of * spare bits left in the byte containing the lsb */ lsb_off= msb_off+bit_width-1; byte1= msb_off/8; byte2= lsb_off/8; shift= 7-(lsb_off%8); /* * We now get the value from the byte array, possibly using two bytes if * the required set of bits crosses the byte boundary. This is then shifted * down to it's correct position and extraneous bits masked off before * being returned. */ value=base[byte2]; if (byte1!=byte2) value|= base[byte1]<<8; value >>= shift; return value & ((1<= _pixelsWide || y >= _pixelsHigh) { // outside return; } line_offset = _bytesPerRow * y; if (_isPlanar) { if (_bitsPerSample == 8) { offset = x + line_offset; for (i = 0; i < _numColors; i++) { pixelData[i] = _imagePlanes[i][offset]; } } else { offset = _bitsPerPixel * x; for (i = 0; i < _numColors; i++) { pixelData[i] = _get_bit_value(_imagePlanes[i] + line_offset, offset, _bitsPerSample); } } } else { if (_bitsPerSample == 8) { offset = (_bitsPerPixel * x) / 8 + line_offset; for (i = 0; i < _numColors; i++) { pixelData[i] = _imagePlanes[0][offset + i]; } } else { offset = _bitsPerPixel * x; for (i = 0; i < _numColors; i++) { pixelData[i] = _get_bit_value(_imagePlanes[0] + line_offset, offset, _bitsPerSample); offset += _bitsPerSample; } } } } static void _set_bit_value(unsigned char *base, long msb_off, int bit_width, unsigned int value) { long lsb_off, byte1, byte2; int shift; int all; /* * Firstly we calculate the position of the msb and lsb in terms * of bit offsets and thus byte offsets. The shift is the number of * spare bits left in the byte containing the lsb */ lsb_off= msb_off+bit_width-1; byte1= msb_off/8; byte2= lsb_off/8; shift= 7-(lsb_off%8); /* * We now set the value in the byte array, possibly using two bytes if * the required set of bits crosses the byte boundary. This value is * first shifted up to it's correct position and extraneous bits are * masked off. */ value &= ((1<> 8) | (base[byte1] & ~(all >> 8)); base[byte2] = (value & 255) | (base[byte2] & ~(all & 255)); } /** * Sets the components of pixel (x,y), where (0,0) is the top-left pixel in * the image, to the given array of pixel components. */ - (void) setPixel: (NSUInteger[])pixelData atX: (NSInteger)x y: (NSInteger)y { NSInteger i; NSInteger offset; NSInteger line_offset; if (x < 0 || y < 0 || x >= _pixelsWide || y >= _pixelsHigh) { // outside return; } if (!_imagePlanes || !_imagePlanes[0]) { // allocate plane memory [self bitmapData]; } line_offset = _bytesPerRow * y; if(_isPlanar) { if (_bitsPerSample == 8) { offset = x + line_offset; for (i = 0; i < _numColors; i++) { _imagePlanes[i][offset] = pixelData[i]; } } else { offset = _bitsPerPixel * x; for (i = 0; i < _numColors; i++) { _set_bit_value(_imagePlanes[i] + line_offset, offset, _bitsPerSample, pixelData[i]); } } } else { if (_bitsPerSample == 8) { offset = (_bitsPerPixel * x) / 8 + line_offset; for (i = 0; i < _numColors; i++) { _imagePlanes[0][offset + i] = pixelData[i]; } } else { offset = _bitsPerPixel * x; for (i = 0; i < _numColors; i++) { _set_bit_value(_imagePlanes[0] + line_offset, offset, _bitsPerSample, pixelData[i]); offset += _bitsPerSample; } } } } /** * Returns an NSColor object representing the color of the pixel (x,y), where * (0,0) is the top-left pixel in the image. */ - (NSColor*) colorAtX: (NSInteger)x y: (NSInteger)y { NSUInteger pixelData[5]; if (x < 0 || y < 0 || x >= _pixelsWide || y >= _pixelsHigh) { // outside return nil; } [self getPixel: pixelData atX: x y: y]; if ([_colorSpace isEqualToString: NSCalibratedRGBColorSpace] || [_colorSpace isEqualToString: NSDeviceRGBColorSpace]) { NSUInteger ir, ig, ib, ia; CGFloat fr, fg, fb, fa; CGFloat scale; scale = (CGFloat)((1 << _bitsPerSample) - 1); if (_hasAlpha) { // This order depends on the bitmap format if (_format & NSAlphaFirstBitmapFormat) { ia = pixelData[0]; ir = pixelData[1]; ig = pixelData[2]; ib = pixelData[3]; } else { ir = pixelData[0]; ig = pixelData[1]; ib = pixelData[2]; ia = pixelData[3]; } // Scale to [0.0 ... 1.0] and undo premultiplication fa = ia / scale; if (_format & NSAlphaNonpremultipliedBitmapFormat) { fr = ir / scale; fg = ig / scale; fb = ib / scale; } else { fr = ir / (scale * fa); fg = ig / (scale * fa); fb = ib / (scale * fa); } } else { ir = pixelData[0]; ig = pixelData[1]; ib = pixelData[2]; // Scale to [0.0 ... 1.0] fr = ir / scale; fg = ig / scale; fb = ib / scale; fa = 1.0; } if ([_colorSpace isEqualToString: NSCalibratedRGBColorSpace]) { return [NSColor colorWithCalibratedRed: fr green: fg blue: fb alpha: fa]; } else { return [NSColor colorWithDeviceRed: fr green: fg blue: fb alpha: fa]; } } else if ([_colorSpace isEqual: NSDeviceWhiteColorSpace] || [_colorSpace isEqual: NSCalibratedWhiteColorSpace]) { NSUInteger iw, ia; CGFloat fw, fa; CGFloat scale; scale = (CGFloat)((1 << _bitsPerSample) - 1); if (_hasAlpha) { // FIXME: This order depends on the bitmap format if (_format & NSAlphaFirstBitmapFormat) { ia = pixelData[0]; iw = pixelData[1]; } else { iw = pixelData[0]; ia = pixelData[1]; } // Scale to [0.0 ... 1.0] and undo premultiplication fa = ia / scale; if (_format & NSAlphaNonpremultipliedBitmapFormat) { fw = iw / scale; } else { fw = iw / (scale * fa); } } else { // FIXME: This order depends on the bitmap format iw = pixelData[0]; // Scale to [0.0 ... 1.0] fw = iw / scale; fa = 1.0; } if ([_colorSpace isEqualToString: NSCalibratedWhiteColorSpace]) { return [NSColor colorWithCalibratedWhite: fw alpha: fa]; } else { return [NSColor colorWithDeviceWhite: fw alpha: fa]; } } else if ([_colorSpace isEqual: NSDeviceBlackColorSpace] || [_colorSpace isEqual: NSCalibratedBlackColorSpace]) { NSUInteger ib, ia; CGFloat fw, fa; CGFloat scale; scale = (CGFloat)((1 << _bitsPerSample) - 1); if (_hasAlpha) { // This order depends on the bitmap format if (_format & NSAlphaFirstBitmapFormat) { ia = pixelData[0]; ib = pixelData[1]; } else { ib = pixelData[0]; ia = pixelData[1]; } // Scale to [0.0 ... 1.0] and undo premultiplication fa = ia / scale; if (_format & NSAlphaNonpremultipliedBitmapFormat) { fw = 1.0 - ib / scale; } else { fw = 1.0 - ib / (scale * fa); } } else { ib = pixelData[0]; // Scale to [0.0 ... 1.0] fw = 1.0 - ib / scale; fa = 1.0; } if ([_colorSpace isEqualToString: NSCalibratedBlackColorSpace]) { return [NSColor colorWithCalibratedWhite: fw alpha: fa]; } else { return [NSColor colorWithDeviceWhite: fw alpha: fa]; } } else if ([_colorSpace isEqual: NSDeviceCMYKColorSpace]) { NSUInteger ic, im, iy, ib, ia; CGFloat fc, fm, fy, fb, fa; CGFloat scale; scale = (CGFloat)((1 << _bitsPerSample) - 1); if (_hasAlpha) { // This order depends on the bitmap format if (_format & NSAlphaFirstBitmapFormat) { ia = pixelData[0]; ic = pixelData[1]; im = pixelData[2]; iy = pixelData[3]; ib = pixelData[4]; } else { ic = pixelData[0]; im = pixelData[1]; iy = pixelData[2]; ib = pixelData[3]; ia = pixelData[4]; } // Scale to [0.0 ... 1.0] and undo premultiplication fa = ia / scale; if (_format & NSAlphaNonpremultipliedBitmapFormat) { fc = ic / scale; fm = im / scale; fy = iy / scale; fb = ib / scale; } else { fc = ic / (scale * fa); fm = im / (scale * fa); fy = iy / (scale * fa); fb = ib / (scale * fa); } } else { ic = pixelData[0]; im = pixelData[1]; iy = pixelData[2]; ib = pixelData[3]; // Scale to [0.0 ... 1.0] fc = ic / scale; fm = im / scale; fy = iy / scale; fb = ib / scale; fa = 1.0; } return [NSColor colorWithDeviceCyan: fc magenta: fm yellow: fy black: fb alpha: fa]; } return nil; } /** * Sets the color of pixel (x,y), where (0,0) is the top-left pixel in the * image. */ - (void) setColor: (NSColor*)color atX: (NSInteger)x y: (NSInteger)y { NSUInteger pixelData[5]; NSColor *conv; if (x < 0 || y < 0 || x >= _pixelsWide || y >= _pixelsHigh) { // outside return; } conv = [color colorUsingColorSpaceName: _colorSpace]; if (!conv) { return; } if ([_colorSpace isEqualToString: NSCalibratedRGBColorSpace] || [_colorSpace isEqualToString: NSDeviceRGBColorSpace]) { NSUInteger ir, ig, ib, ia; CGFloat fr, fg, fb, fa; CGFloat scale; scale = (CGFloat)((1 << _bitsPerSample) - 1); [conv getRed: &fr green: &fg blue: &fb alpha: &fa]; if(_hasAlpha) { // Scale and premultiply alpha if (_format & NSAlphaNonpremultipliedBitmapFormat) { ir = scale * fr; ig = scale * fg; ib = scale * fb; } else { ir = scale * fr * fa; ig = scale * fg * fa; ib = scale * fb * fa; } ia = scale * fa; // This order depends on the bitmap format if (_format & NSAlphaFirstBitmapFormat) { pixelData[0] = ia; pixelData[1] = ir; pixelData[2] = ig; pixelData[3] = ib; } else { pixelData[0] = ir; pixelData[1] = ig; pixelData[2] = ib; pixelData[3] = ia; } } else { // Scale ir = scale * fr; ig = scale * fg; ib = scale * fb; // This order depends on the bitmap format pixelData[0] = ir; pixelData[1] = ig; pixelData[2] = ib; } } else if ([_colorSpace isEqual: NSDeviceWhiteColorSpace] || [_colorSpace isEqual: NSCalibratedWhiteColorSpace]) { NSUInteger iw, ia; CGFloat fw, fa; CGFloat scale; scale = (CGFloat)((1 << _bitsPerSample) - 1); [conv getWhite: &fw alpha: &fa]; if (_hasAlpha) { if (_format & NSAlphaNonpremultipliedBitmapFormat) { iw = scale * fw; } else { iw = scale * fw * fa; } ia = scale * fa; // This order depends on the bitmap format if (_format & NSAlphaFirstBitmapFormat) { pixelData[0] = ia; pixelData[1] = iw; } else { pixelData[0] = iw; pixelData[1] = ia; } } else { iw = scale * fw; pixelData[0] = iw; } } else if ([_colorSpace isEqual: NSDeviceBlackColorSpace] || [_colorSpace isEqual: NSCalibratedBlackColorSpace]) { NSUInteger iw, ia; CGFloat fw, fa; CGFloat scale; scale = (CGFloat)((1 << _bitsPerSample) - 1); [conv getWhite: &fw alpha: &fa]; if (_hasAlpha) { if (_format & NSAlphaNonpremultipliedBitmapFormat) { iw = scale * (1 - fw); } else { iw = scale * (1 - fw) * fa; } ia = scale * fa; // This order depends on the bitmap format if (_format & NSAlphaFirstBitmapFormat) { pixelData[0] = ia; pixelData[1] = iw; } else { pixelData[0] = iw; pixelData[1] = ia; } } else { iw = scale * (1 - fw); pixelData[0] = iw; } } else if ([_colorSpace isEqual: NSDeviceCMYKColorSpace]) { NSUInteger ic, im, iy, ib, ia; CGFloat fc, fm, fy, fb, fa; CGFloat scale; scale = (CGFloat)((1 << _bitsPerSample) - 1); [conv getCyan: &fc magenta: &fm yellow: &fy black: &fb alpha: &fa]; if(_hasAlpha) { if (_format & NSAlphaNonpremultipliedBitmapFormat) { ic = scale * fc; im = scale * fm; iy = scale * fy; ib = scale * fb; } else { ic = scale * fc * fa; im = scale * fm * fa; iy = scale * fy * fa; ib = scale * fb * fa; } ia = scale * fa; // This order depends on the bitmap format if (_format & NSAlphaFirstBitmapFormat) { pixelData[0] = ia; pixelData[1] = ic; pixelData[2] = im; pixelData[3] = iy; pixelData[4] = ib; } else { pixelData[0] = ic; pixelData[1] = im; pixelData[2] = iy; pixelData[3] = ib; pixelData[4] = ia; } } else { ic = scale * fc; im = scale * fm; iy = scale * fy; ib = scale * fb; // This order depends on the bitmap format pixelData[0] = ic; pixelData[1] = im; pixelData[2] = iy; pixelData[3] = ib; } } else { // FIXME: Other colour spaces not implemented return; } [self setPixel: pixelData atX: x y: y]; } /** Draws the image in the current window according the information from the current gState, including information about the current point, scaling, etc. */ - (BOOL) draw { NSRect irect = NSMakeRect(0, 0, _size.width, _size.height); NSGraphicsContext *ctxt = GSCurrentContext(); [self _premultiply]; [ctxt GSDrawImage: irect : self]; return YES; } // // Producing a TIFF Representation of the Image // /** Produces an NSData object containing a TIFF representation of all the images stored in anArray. BUGS: Currently this only works if the images are NSBitmapImageRep objects, and it only creates an TIFF from the first image in the array. */ + (NSData*) TIFFRepresentationOfImageRepsInArray: (NSArray *)anArray { //FIXME: This only outputs one of the ImageReps NSEnumerator *enumerator = [anArray objectEnumerator]; NSImageRep *rep; while ((rep = [enumerator nextObject]) != nil) { if ([rep isKindOfClass: self]) { return [(NSBitmapImageRep*)rep TIFFRepresentation]; } } return nil; } /** Produces an NSData object containing a TIFF representation of all the images stored in anArray. The image is compressed according to the compression type and factor. BUGS: Currently this only works if the images are NSBitmapImageRep objects, and it only creates an TIFF from the first image in the array. */ + (NSData*) TIFFRepresentationOfImageRepsInArray: (NSArray *)anArray usingCompression: (NSTIFFCompression)type factor: (float)factor { //FIXME: This only outputs one of the ImageReps NSEnumerator *enumerator = [anArray objectEnumerator]; NSImageRep *rep; while ((rep = [enumerator nextObject]) != nil) { if ([rep isKindOfClass: self]) { return [(NSBitmapImageRep*)rep TIFFRepresentationUsingCompression: type factor: factor]; } } return nil; } /** Returns an NSData object containing a TIFF representation of the receiver. */ - (NSData*) TIFFRepresentation { if ([self canBeCompressedUsing: _compression] == NO) { [self setCompression: NSTIFFCompressionNone factor: 0]; } return [self TIFFRepresentationUsingCompression: _compression factor: _comp_factor]; } /** Returns an NSData object containing a TIFF representation of the receiver. The TIFF data is compressed using compresssion type and factor. */ - (NSData*) TIFFRepresentationUsingCompression: (NSTIFFCompression)type factor: (float)factor { NSTiffInfo info; TIFF *image; char *bytes = 0; long length = 0; info.imageNumber = 0; info.subfileType = 255; info.width = _pixelsWide; info.height = _pixelsHigh; info.bitsPerSample = _bitsPerSample; info.samplesPerPixel = _numColors; if ([self canBeCompressedUsing: type] == NO) { type = NSTIFFCompressionNone; factor = 0; } if (_isPlanar) info.planarConfig = PLANARCONFIG_SEPARATE; else info.planarConfig = PLANARCONFIG_CONTIG; if ([_colorSpace isEqual: NSDeviceRGBColorSpace] || [_colorSpace isEqual: NSCalibratedRGBColorSpace]) info.photoInterp = PHOTOMETRIC_RGB; else if ([_colorSpace isEqual: NSDeviceWhiteColorSpace] || [_colorSpace isEqual: NSCalibratedWhiteColorSpace]) info.photoInterp = PHOTOMETRIC_MINISBLACK; else if ([_colorSpace isEqual: NSDeviceBlackColorSpace] || [_colorSpace isEqual: NSCalibratedBlackColorSpace]) info.photoInterp = PHOTOMETRIC_MINISWHITE; else { NSWarnMLog(@"Unknown colorspace %@.", _colorSpace); info.photoInterp = PHOTOMETRIC_RGB; } info.extraSamples = (_hasAlpha) ? 1 : 0; info.assocAlpha = (_format & NSAlphaNonpremultipliedBitmapFormat) ? 0 : 1; info.compression = [NSBitmapImageRep _localFromCompressionType: type]; if (factor < 0) factor = 0; if (factor > 255) factor = 255; info.quality = (1 - ((float)factor)/255.0) * 100; info.numImages = 1; info.error = 0; image = NSTiffOpenDataWrite(&bytes, &length); if (image == 0) { [NSException raise: NSTIFFException format: @"Opening data stream for writting"]; } if (NSTiffWrite(image, &info, [self bitmapData]) != 0) { [NSException raise: NSTIFFException format: @"Writing data"]; } NSTiffClose(image); return [NSData dataWithBytesNoCopy: bytes length: length]; } /**

Returns a data object in the selected format with multiple images.

See Also: -setProperty:withValue: for the options supported in the properties.

FIXME: returns only the first image in the array, and only works for NSBitmapImageRep or subclasses thereof.

*/ + (NSData *)representationOfImageRepsInArray:(NSArray *)imageReps usingType:(NSBitmapImageFileType)storageType properties:(NSDictionary *)properties { // Partial implementation only returns data for the first imageRep in the array // and only works for NSBitmapImageRep or subclasses thereof. //FIXME: This only outputs one of the ImageReps NSEnumerator *enumerator = [imageReps objectEnumerator]; NSImageRep *rep; while ((rep = [enumerator nextObject]) != nil) { if ([rep isKindOfClass: self]) { return [(NSBitmapImageRep*)rep representationUsingType: storageType properties: properties]; } } return nil; } /**

Returns a data object in one of the supported bitmap graphics file types. A limited set of options may be passed via the properties. If the passed in properties is nil, it falls back to the options set with -setProperty:withValue:. File types not yet implemented return nil and log an error message.

See Also: -setProperty:withValue: for supported options in the properties.

*/ - (NSData *)representationUsingType:(NSBitmapImageFileType)storageType properties:(NSDictionary *)properties { // if it exists, the passed in properties takes precedence over the internal _properties NSDictionary * __properties; __properties = (properties)? properties : (NSDictionary *)_properties; switch (storageType) { case NSTIFFFileType: { NSNumber * property; float factor = _comp_factor; NSTIFFCompression compression = _compression; if ((property = [__properties objectForKey: NSImageCompressionMethod])) compression = [property unsignedShortValue]; if ((property = [__properties objectForKey: NSImageCompressionFactor])) factor = [property floatValue]; if ([self canBeCompressedUsing: compression] == NO) { factor = 0.0; compression = NSTIFFCompressionNone; } return [self TIFFRepresentationUsingCompression: compression factor: factor]; } case NSBMPFileType: NSLog(@"BMP representation is not yet implemented"); return nil; case NSGIFFileType: return [self _GIFRepresentationWithProperties: __properties errorMessage: NULL]; case NSJPEGFileType: return [self _JPEGRepresentationWithProperties: __properties errorMessage: NULL]; case NSPNGFileType: return [self _PNGRepresentationWithProperties: __properties]; case NSJPEG2000FileType: NSLog(@"JPEG2000 representation is not yet implemented"); return nil; } return nil; } // // Setting and Checking Compression Types // /** Returns a C-array of available TIFF compression types. */ + (void) getTIFFCompressionTypes: (const NSTIFFCompression **)list count: (NSInteger *)numTypes { // the GNUstep supported types static NSTIFFCompression types[] = { NSTIFFCompressionNone, NSTIFFCompressionCCITTFAX3, NSTIFFCompressionCCITTFAX4, NSTIFFCompressionLZW, NSTIFFCompressionJPEG, NSTIFFCompressionNEXT, NSTIFFCompressionPackBits, NSTIFFCompressionOldJPEG }; // check with libtiff to see what is really available NSInteger i, j; static NSTIFFCompression checkedTypes[8]; for (i = 0, j = 0; i < 8; i++) { if (NSTiffIsCodecConfigured([NSBitmapImageRep _localFromCompressionType: types[i]])) { checkedTypes[j] = types[i]; j++; } } if (list) *list = checkedTypes; if (numTypes) *numTypes = j; } /** Returns a localized string describing a TIFF compression type. */ + (NSString*) localizedNameForTIFFCompressionType: (NSTIFFCompression)type { switch (type) { case NSTIFFCompressionNone: return _(@"No Compression"); case NSTIFFCompressionCCITTFAX3: return _(@"CCITTFAX3 Compression"); case NSTIFFCompressionCCITTFAX4: return _(@"CCITTFAX4 Compression"); case NSTIFFCompressionLZW: return _(@"LZW Compression"); case NSTIFFCompressionJPEG: return _(@"JPEG Compression"); case NSTIFFCompressionNEXT: return _(@"NEXT Compression"); case NSTIFFCompressionPackBits: return _(@"PackBits Compression"); case NSTIFFCompressionOldJPEG: return _(@"Old JPEG Compression"); default: return nil; } } /** Returns YES if the receiver can be stored in a representation compressed using the compression type. */ - (BOOL) canBeCompressedUsing: (NSTIFFCompression)compression { BOOL does; int codecConf = NSTiffIsCodecConfigured([NSBitmapImageRep _localFromCompressionType: compression]); switch (compression) { case NSTIFFCompressionCCITTFAX3: case NSTIFFCompressionCCITTFAX4: if (_numColors == 1 && _bitsPerSample == 1 && codecConf != 0) does = YES; else does = NO; break; case NSTIFFCompressionLZW: case NSTIFFCompressionNone: case NSTIFFCompressionJPEG: // this is a GNUstep extension; Cocoa does not support case NSTIFFCompressionPackBits: case NSTIFFCompressionOldJPEG: case NSTIFFCompressionNEXT: default: does = (codecConf != 0); } return does; } /** Returns the receivers compression and compression factor, which is set either when the image is read in or by -setCompression:factor:. Factor is ignored in many compression schemes. For JPEG compression, factor can be any value from 0 to 255, with 255 being the maximum compression. */ - (void) getCompression: (NSTIFFCompression*)compression factor: (float*)factor { *compression = _compression; *factor = _comp_factor; } - (void) setCompression: (NSTIFFCompression)compression factor: (float)factor { _compression = compression; _comp_factor = factor; } /**

Properties are key-value pairs associated with the representation. Arbitrary key-value pairs may be set. If the value is nil, the key is erased from properties. There are standard keys that are used to pass information and options related to the standard file types that may be read from or written to. Certain properties are automatically set when reading in image data. Certain properties may be set by the user prior to writing image data in order to set options for the data format.

NSImageCompressionMethod NSNumber; automatically set when reading TIFF data; writing TIFF data NSImageCompressionFactor NSNumber 0.0 to 255.0; writing JPEG data (GNUstep extension: JPEG-compressed TIFFs too) NSImageProgressive NSNumber boolean; automatically set when reading JPEG data; writing JPEG data. Note: progressive display is not supported in GNUstep at this time. NSImageInterlaced NSNumber boolean; only for writing PNG data NSImageGamma NSNumber 0.0 to 1.0; only for reading or writing PNG data NSImageRGBColorTable NSData; automatically set when reading GIF data; writing GIF data NSImageFrameCount NSNumber integer; automatically set when reading animated GIF data. Not currently implemented. NSImageCurrentFrame NSNumber integer; only for animated GIF files. Not currently implemented. NSImageCurrentFrameDuration NSNumber float; automatically set when reading animated GIF data NSImageLoopCount NSNumber integer; automatically set when reading animated GIF data NSImageDitherTranparency NSNumber boolean; only for writing GIF data. Not currently supported. */ - (void)setProperty:(NSString *)property withValue:(id)value { if (value) { [_properties setObject: value forKey: property]; } else // clear the property { [_properties removeObjectForKey: property]; } } /** Returns the value of a property */ - (id)valueForProperty:(NSString *)property { return [_properties objectForKey: property]; } // NSCopying protocol - (id) copyWithZone: (NSZone *)zone { NSBitmapImageRep *copy; copy = (NSBitmapImageRep*)[super copyWithZone: zone]; copy->_imageData = [_imageData copyWithZone: zone]; copy->_imagePlanes = NSZoneMalloc(zone, sizeof(unsigned char*) * MAX_PLANES); if (_imageData == nil) { memcpy(copy->_imagePlanes, _imagePlanes, sizeof(unsigned char*) * MAX_PLANES); } else { unsigned char *bits; unsigned int i; bits = (unsigned char *)[copy->_imageData bytes]; copy->_imagePlanes[0] = bits; if (_isPlanar) { for (i = 1; i < _numColors; i++) copy->_imagePlanes[i] = bits + i * _bytesPerRow * _pixelsHigh; for (i = _numColors; i < MAX_PLANES; i++) copy->_imagePlanes[i] = NULL; } else { for (i = 1; i < MAX_PLANES; i++) copy->_imagePlanes[i] = NULL; } } return copy; } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder*)aCoder { NSData *data = [self TIFFRepresentation]; [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { [aCoder encodeObject: data forKey: @"NSTIFFRepresentation"]; } else { [aCoder encodeObject: data]; } } - (id) initWithCoder: (NSCoder*)aDecoder { NSData *data; self = [super initWithCoder: aDecoder]; if ([aDecoder allowsKeyedCoding]) { data = [aDecoder decodeObjectForKey: @"NSTIFFRepresentation"]; } else { data = [aDecoder decodeObject]; } return [self initWithData: data]; } @end @implementation NSBitmapImageRep (GSPrivate) + (int) _localFromCompressionType: (NSTIFFCompression)type { switch (type) { case NSTIFFCompressionNone: return COMPRESSION_NONE; case NSTIFFCompressionCCITTFAX3: return COMPRESSION_CCITTFAX3; case NSTIFFCompressionCCITTFAX4: return COMPRESSION_CCITTFAX4; case NSTIFFCompressionLZW: return COMPRESSION_LZW; case NSTIFFCompressionJPEG: return COMPRESSION_JPEG; case NSTIFFCompressionNEXT: return COMPRESSION_NEXT; case NSTIFFCompressionPackBits: return COMPRESSION_PACKBITS; case NSTIFFCompressionOldJPEG: return COMPRESSION_OJPEG; default: break; } return COMPRESSION_NONE; } + (NSTIFFCompression) _compressionTypeFromLocal: (int)type { switch (type) { case COMPRESSION_NONE: return NSTIFFCompressionNone; case COMPRESSION_CCITTFAX3: return NSTIFFCompressionCCITTFAX3; case COMPRESSION_CCITTFAX4: return NSTIFFCompressionCCITTFAX4; case COMPRESSION_LZW: return NSTIFFCompressionLZW; case COMPRESSION_JPEG: return NSTIFFCompressionJPEG; case COMPRESSION_NEXT: return NSTIFFCompressionNEXT; case COMPRESSION_PACKBITS: return NSTIFFCompressionPackBits; case COMPRESSION_OJPEG: return NSTIFFCompressionOldJPEG; default: break; } return NSTIFFCompressionNone; } /* Given a TIFF image (from the libtiff library), load the image information into our data structure. Reads the specified image. */ - _initFromTIFFImage: (TIFF *)image number: (int)imageNumber { NSString* space; NSTiffInfo* info; /* Seek to the correct image and get the dictionary information */ info = NSTiffGetInfo(imageNumber, image); if (!info) { RELEASE(self); NSLog(@"Tiff read invalid TIFF info in directory %d", imageNumber); return nil; } /* 8-bit RGB will be converted to 24-bit by the tiff routines, so account for this. */ space = nil; switch(info->photoInterp) { case PHOTOMETRIC_MINISBLACK: space = NSDeviceWhiteColorSpace; break; case PHOTOMETRIC_MINISWHITE: space = NSDeviceBlackColorSpace; break; case PHOTOMETRIC_RGB: space = NSDeviceRGBColorSpace; break; case PHOTOMETRIC_PALETTE: space = NSDeviceRGBColorSpace; info->samplesPerPixel = 3; break; default: break; } [self initWithBitmapDataPlanes: NULL pixelsWide: info->width pixelsHigh: info->height bitsPerSample: info->bitsPerSample samplesPerPixel: info->samplesPerPixel hasAlpha: (info->extraSamples > 0) isPlanar: (info->planarConfig == PLANARCONFIG_SEPARATE) colorSpaceName: space bitmapFormat: (info->assocAlpha ? 0 : NSAlphaNonpremultipliedBitmapFormat) bytesPerRow: 0 bitsPerPixel: 0]; _compression = [NSBitmapImageRep _compressionTypeFromLocal: info->compression]; _comp_factor = 255 * (1 - ((float)info->quality)/100.0); // Note that Cocoa does not do this, even though the docs say it should [_properties setObject: [NSNumber numberWithUnsignedShort: _compression] forKey: NSImageCompressionMethod]; [_properties setObject: [NSNumber numberWithFloat: _comp_factor] forKey: NSImageCompressionFactor]; if (info->xdpi > 0 && info->xdpi != 72 && info->ydpi > 0 && info->ydpi != 72) { NSSize pointSize = NSMakeSize((double)info->width * (72.0 / (double)info->xdpi), (double)info->height * (72.0 / (double)info->ydpi)); [self setSize: pointSize]; } if (NSTiffRead(image, info, [self bitmapData])) { free(info); RELEASE(self); NSLog(@"Tiff read invalid TIFF image data in directory %d", imageNumber); return nil; } free(info); return self; } - (void) _premultiply { NSInteger x, y; NSUInteger pixelData[5]; NSInteger start, end, i, ai; SEL getPSel = @selector(getPixel:atX:y:); SEL setPSel = @selector(setPixel:atX:y:); IMP getP = [self methodForSelector: getPSel]; IMP setP = [self methodForSelector: setPSel]; if (!_hasAlpha || !(_format & NSAlphaNonpremultipliedBitmapFormat)) return; if (_format & NSAlphaFirstBitmapFormat) { ai = 0; start = 1; end = _numColors; } else { ai = _numColors - 1; start = 0; end = _numColors - 1; } if (_bitsPerSample == 8) { NSUInteger a; for (y = 0; y < _pixelsHigh; y++) { for (x = 0; x < _pixelsWide; x++) { //[self getPixel: pixelData atX: x y: y]; getP(self, getPSel, pixelData, x, y); a = pixelData[ai]; if (a != 255) { for (i = start; i < end; i++) { NSUInteger t = a * pixelData[i] + 0x80; pixelData[i] = ((t >> 8) + t) >> 8; } //[self setPixel: pixelData atX: x y: y]; setP(self, setPSel, pixelData, x, y); } } } } else { CGFloat scale; CGFloat alpha; scale = (CGFloat)((1 << _bitsPerSample) - 1); for (y = 0; y < _pixelsHigh; y++) { for (x = 0; x < _pixelsWide; x++) { //[self getPixel: pixelData atX: x y: y]; getP(self, getPSel, pixelData, x, y); alpha = pixelData[ai] / scale; for (i = start; i < end; i++) { pixelData[i] *= alpha; } //[self setPixel: pixelData atX: x y: y]; setP(self, setPSel, pixelData, x, y); } } } _format &= ~NSAlphaNonpremultipliedBitmapFormat; } - (void) _unpremultiply { NSInteger x, y; NSUInteger pixelData[5]; NSInteger start, end, i, ai; SEL getPSel = @selector(getPixel:atX:y:); SEL setPSel = @selector(setPixel:atX:y:); IMP getP = [self methodForSelector: getPSel]; IMP setP = [self methodForSelector: setPSel]; if (!_hasAlpha || (_format & NSAlphaNonpremultipliedBitmapFormat)) return; if (_format & NSAlphaFirstBitmapFormat) { ai = 0; start = 1; end = _numColors; } else { ai = _numColors - 1; start = 0; end = _numColors - 1; } if (_bitsPerSample == 8) { NSUInteger a; for (y = 0; y < _pixelsHigh; y++) { for (x = 0; x < _pixelsWide; x++) { //[self getPixel: pixelData atX: x y: y]; getP(self, getPSel, pixelData, x, y); a = pixelData[ai]; if ((a != 0) && (a != 255)) { for (i = start; i < end; i++) { NSUInteger c; c = (pixelData[i] * 255) / a; if (c >= 255) { pixelData[i] = 255; } else { pixelData[i] = c; } } //[self setPixel: pixelData atX: x y: y]; setP(self, setPSel, pixelData, x, y); } } } } else { CGFloat scale; CGFloat alpha; scale = (CGFloat)((1 << _bitsPerSample) - 1); for (y = 0; y < _pixelsHigh; y++) { NSUInteger a; for (x = 0; x < _pixelsWide; x++) { //[self getPixel: pixelData atX: x y: y]; getP(self, getPSel, pixelData, x, y); a = pixelData[ai]; if (a != 0) { alpha = scale / a; for (i = start; i < end; i++) { CGFloat new = pixelData[i] * alpha; if (new > scale) { pixelData[i] = scale; } else { pixelData[i] = new; } } //[self setPixel: pixelData atX: x y: y]; setP(self, setPSel, pixelData, x, y); } } } } _format |= NSAlphaNonpremultipliedBitmapFormat; } - (NSBitmapImageRep *) _convertToFormatBitsPerSample: (NSInteger)bps samplesPerPixel: (NSInteger)spp hasAlpha: (BOOL)alpha isPlanar: (BOOL)isPlanar colorSpaceName: (NSString*)colorSpaceName bitmapFormat: (NSBitmapFormat)bitmapFormat bytesPerRow: (NSInteger)rowBytes bitsPerPixel: (NSInteger)pixelBits { if (!pixelBits) pixelBits = bps * ((isPlanar) ? 1 : spp); if (!rowBytes) rowBytes = ceil((float)_pixelsWide * pixelBits / 8); // Do we already have the correct format? if ((bps == _bitsPerSample) && (spp == _numColors) && (alpha == _hasAlpha) && (isPlanar == _isPlanar) && (bitmapFormat == _format) && (rowBytes == _bytesPerRow) && (pixelBits == _bitsPerPixel) && [_colorSpace isEqualToString: colorSpaceName]) { return self; } else { NSBitmapImageRep* new; new = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes: NULL pixelsWide: _pixelsWide pixelsHigh: _pixelsHigh bitsPerSample: bps samplesPerPixel: spp hasAlpha: alpha isPlanar: isPlanar colorSpaceName: colorSpaceName bitmapFormat: bitmapFormat bytesPerRow: rowBytes bitsPerPixel: pixelBits]; if ([_colorSpace isEqualToString: colorSpaceName] || ([_colorSpace isEqualToString: NSDeviceRGBColorSpace] && [colorSpaceName isEqualToString: NSCalibratedRGBColorSpace]) || ([colorSpaceName isEqualToString: NSDeviceRGBColorSpace] && [_colorSpace isEqualToString: NSCalibratedRGBColorSpace])) { SEL getPSel = @selector(getPixel:atX:y:); SEL setPSel = @selector(setPixel:atX:y:); IMP getP = [self methodForSelector: getPSel]; IMP setP = [new methodForSelector: setPSel]; NSUInteger pixelData[5]; NSInteger x, y; CGFloat _scale; CGFloat scale; NSDebugLLog(@"NSImage", @"Converting %@ bitmap data", _colorSpace); if (_bitsPerSample != bps) { _scale = (CGFloat)((1 << _bitsPerSample) - 1); scale = (CGFloat)((1 << bps) - 1); } else { _scale = 1.0; scale = 1.0; } for (y = 0; y < _pixelsHigh; y++) { for (x = 0; x < _pixelsWide; x++) { NSUInteger iv[4], ia; CGFloat fv[4], fa; NSInteger i; //[self getPixel: pixelData atX: x y: y]; getP(self, getPSel, pixelData, x, y); if (_hasAlpha) { // This order depends on the bitmap format if (_format & NSAlphaFirstBitmapFormat) { ia = pixelData[0]; for (i = 0; i < _numColors - 1; i++) { iv[i] = pixelData[i + 1]; } } else { for (i = 0; i < _numColors - 1; i++) { iv[i] = pixelData[i]; } ia = pixelData[_numColors - 1]; } // Scale to [0.0 ... 1.0] for (i = 0; i < _numColors - 1; i++) { fv[i] = iv[i] / _scale; } fa = ia / _scale; if ((_format & NSAlphaNonpremultipliedBitmapFormat) != (bitmapFormat & NSAlphaNonpremultipliedBitmapFormat)) { if (_format & NSAlphaNonpremultipliedBitmapFormat) { for (i = 0; i < _numColors - 1; i++) { fv[i] = fv[i] * fa; } } else { for (i = 0; i < _numColors - 1; i++) { fv[i] = fv[i] / fa; } } } } else { for (i = 0; i < _numColors; i++) { iv[i] = pixelData[i]; } // Scale to [0.0 ... 1.0] for (i = 0; i < _numColors; i++) { fv[i] = iv[i] / _scale; } fa = 1.0; } if (alpha) { // Scale from [0.0 ... 1.0] for (i = 0; i < spp - 1; i++) { iv[i] = fv[i] * scale; } ia = fa * scale; if (bitmapFormat & NSAlphaFirstBitmapFormat) { pixelData[0] = ia; for (i = 0; i < spp - 1; i++) { pixelData[i + 1] = iv[i]; } } else { for (i = 0; i < spp - 1; i++) { pixelData[i] = iv[i]; } pixelData[spp -1] = ia; } } else { // Scale from [0.0 ... 1.0] for (i = 0; i < spp; i++) { pixelData[i] = fv[i] * scale; } } //[new setPixel: pixelData atX: x y: y]; setP(new, setPSel, pixelData, x, y); } } } else if (([colorSpaceName isEqualToString: NSDeviceRGBColorSpace] || [colorSpaceName isEqualToString: NSCalibratedRGBColorSpace]) && ([_colorSpace isEqualToString: NSCalibratedWhiteColorSpace] || [_colorSpace isEqualToString: NSCalibratedBlackColorSpace] || [_colorSpace isEqualToString: NSDeviceWhiteColorSpace] || [_colorSpace isEqualToString: NSDeviceBlackColorSpace])) { SEL getPSel = @selector(getPixel:atX:y:); SEL setPSel = @selector(setPixel:atX:y:); IMP getP = [self methodForSelector: getPSel]; IMP setP = [new methodForSelector: setPSel]; NSUInteger pixelData[4]; NSInteger x, y; CGFloat _scale; CGFloat scale; NSInteger max = (1 << _bitsPerSample) - 1; BOOL isWhite = [_colorSpace isEqualToString: NSCalibratedWhiteColorSpace] || [_colorSpace isEqualToString: NSDeviceWhiteColorSpace]; NSDebugLLog(@"NSImage", @"Converting black/white bitmap data"); if (_bitsPerSample != bps) { _scale = (CGFloat)((1 << _bitsPerSample) - 1); scale = (CGFloat)((1 << bps) - 1); } else { _scale = 1.0; scale = 1.0; } for (y = 0; y < _pixelsHigh; y++) { for (x = 0; x < _pixelsWide; x++) { NSUInteger iv, ia; CGFloat fv, fa; //[self getPixel: pixelData atX: x y: y]; getP(self, getPSel, pixelData, x, y); if (_hasAlpha) { // This order depends on the bitmap format if (_format & NSAlphaFirstBitmapFormat) { ia = pixelData[0]; if (isWhite) iv = pixelData[1]; else iv = max - pixelData[1]; } else { if (isWhite) iv = pixelData[0]; else iv = max - pixelData[0]; ia = pixelData[1]; } // Scale to [0.0 ... 1.0] fv = iv / _scale; fa = ia / _scale; if ((_format & NSAlphaNonpremultipliedBitmapFormat) != (bitmapFormat & NSAlphaNonpremultipliedBitmapFormat)) { if (_format & NSAlphaNonpremultipliedBitmapFormat) { fv = fv * fa; } else { fv = fv / fa; } } } else { if (isWhite) iv = pixelData[0]; else iv = max - pixelData[0]; // Scale to [0.0 ... 1.0] fv = iv / _scale; fa = 1.0; } if (alpha) { // Scale from [0.0 ... 1.0] iv = fv * scale; ia = fa * scale; if (bitmapFormat & NSAlphaFirstBitmapFormat) { pixelData[0] = ia; pixelData[1] = iv; pixelData[2] = iv; pixelData[3] = iv; } else { pixelData[0] = iv; pixelData[1] = iv; pixelData[2] = iv; pixelData[3] = ia; } } else { // Scale from [0.0 ... 1.0] iv = fv * scale; pixelData[0] = iv; pixelData[1] = iv; pixelData[2] = iv; } //[new setPixel: pixelData atX: x y: y]; setP(new, setPSel, pixelData, x, y); } } } else { SEL getCSel = @selector(colorAtX:y:); SEL setCSel = @selector(setColor:atX:y:); IMP getC = [self methodForSelector: getCSel]; IMP setC = [new methodForSelector: setCSel]; NSInteger i, j; NSDebugLLog(@"NSImage", @"Slow converting %@ bitmap data to %@", _colorSpace, colorSpaceName); for (j = 0; j < _pixelsHigh; j++) { CREATE_AUTORELEASE_POOL(pool); for (i = 0; i < _pixelsWide; i++) { NSColor *c; //c = [self colorAtX: i y: j]; c = getC(self, getCSel, i, j); //[new setColor: c atX: i y: j]; setC(new, setCSel, c, i, j); } [pool drain]; } } return AUTORELEASE(new); } } @end gnustep-gui-0.24.0/Source/NSObjectController.m0000664000076500007650000002264112204466636021111 0ustar brains99brains99/** NSObjectController Controller class Copyright (C) 2006 Free Software Foundation, Inc. Author: Fred Kiefer Date: June 2006 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import #import #import "AppKit/NSObjectController.h" #import "AppKit/NSKeyValueBinding.h" #import "GSBindingHelpers.h" @interface _NSManagedProxy : NSObject { NSString *_entity_name_key; } - (void) setEntityName: (NSString *)name; - (NSString *) entityName; @end @implementation _NSManagedProxy - (id) initWithCoder: (NSCoder *)coder { if ((self = [super init]) != nil) { if ([coder allowsKeyedCoding]) { ASSIGN(_entity_name_key,[coder decodeObjectForKey: @"NSEntityName"]); } else { ASSIGN(_entity_name_key,[coder decodeObject]); } } return self; } - (void) encodeWithCoder: (NSCoder *)coder { if ([coder allowsKeyedCoding]) { [coder encodeObject: _entity_name_key forKey: @"NSEntityName"]; } else { [coder encodeObject: _entity_name_key]; } } - (void) dealloc { RELEASE(_entity_name_key); [super dealloc]; } - (void) setEntityName: (NSString *)name { ASSIGN(_entity_name_key, name); } - (NSString *) entityName { return _entity_name_key; } @end @implementation NSObjectController + (void) initialize { if (self == [NSObjectController class]) { [self exposeBinding: NSContentObjectBinding]; [self setKeys: [NSArray arrayWithObject: @"editable"] triggerChangeNotificationsForDependentKey: @"canAdd"]; [self setKeys: [NSArray arrayWithObject: @"editable"] triggerChangeNotificationsForDependentKey: @"canRemove"]; [self setKeys: [NSArray arrayWithObjects: @"content", NSContentObjectBinding, nil] triggerChangeNotificationsForDependentKey: @"selectedObjects"]; [self setKeys: [NSArray arrayWithObjects: @"content", NSContentObjectBinding, nil] triggerChangeNotificationsForDependentKey: @"selection"]; } } - (id) initWithContent: (id)content { if ((self = [super init]) != nil) { [self setContent: content]; [self setObjectClass: [NSMutableDictionary class]]; [self setEditable: YES]; _managed_proxy = nil; } return self; } - (id) init { return [self initWithContent: nil]; } - (void) dealloc { [GSKeyValueBinding unbindAllForObject: self]; RELEASE(_content); RELEASE(_entity_name_key); RELEASE(_fetch_predicate); RELEASE(_selection); [super dealloc]; } - (void) encodeWithCoder: (NSCoder *)coder { [super encodeWithCoder: coder]; if ([coder allowsKeyedCoding]) { [coder encodeBool: _is_editable forKey: @"NSEditable"]; [coder encodeBool: _automatically_prepares_content forKey: @"NSAutomaticallyPreparesContent"]; [coder encodeObject: _managed_proxy forKey: @"_NSManagedProxy"]; [coder encodeObject: NSStringFromClass([self objectClass]) forKey: @"NSObjectClassName"]; } else { [coder encodeValueOfObjCType: @encode(BOOL) at: &_is_editable]; [coder encodeValueOfObjCType: @encode(BOOL) at: &_automatically_prepares_content]; [coder encodeConditionalObject: _managed_proxy]; } } - (id) initWithCoder: (NSCoder *)coder { if ((self = [super initWithCoder: coder]) != nil) { if ([self automaticallyPreparesContent]) { if ([self managedObjectContext] != nil) { [self fetch: coder]; } else { [self prepareContent]; } } if ([coder allowsKeyedCoding]) { _is_editable = [coder decodeBoolForKey: @"NSEditable"]; _automatically_prepares_content = [coder decodeBoolForKey: @"NSAutomaticallyPreparesContent"]; ASSIGN(_managed_proxy, [coder decodeObjectForKey: @"_NSManagedProxy"]); if ([coder containsValueForKey: @"NSObjectClassName"]) { NSString *className = [coder decodeObjectForKey: @"NSObjectClassName"]; [self setObjectClass: NSClassFromString(className)]; } } else { [coder decodeValueOfObjCType: @encode(BOOL) at: &_is_editable]; [coder decodeValueOfObjCType: @encode(BOOL) at: &_automatically_prepares_content]; ASSIGN(_managed_proxy, [coder decodeObject]); } } return self; } - (id) content { return _content; } - (void) setContent: (id)content { if (content != _content) { NSMutableArray *selection; ASSIGN(_content, content); if (content) { selection = [[NSMutableArray alloc] initWithObjects: &content count: 1]; } else { selection = [[NSMutableArray alloc] init]; } ASSIGN(_selection, selection); RELEASE(selection); } } - (void)bind: (NSString *)binding toObject: (id)anObject withKeyPath: (NSString *)keyPath options: (NSDictionary *)options { if ([binding isEqual: NSContentObjectBinding]) { GSKeyValueBinding *kvb; [self unbind: binding]; kvb = [[GSKeyValueBinding alloc] initWithBinding: @"content" withName: binding toObject: anObject withKeyPath: keyPath options: options fromObject: self]; // The binding will be retained in the binding table RELEASE(kvb); } else { [super bind: binding toObject: anObject withKeyPath: keyPath options: options]; } } - (Class) objectClass { return _object_class; } - (void) setObjectClass: (Class)aClass { _object_class = aClass; } - (id) newObject { return [[[self objectClass] alloc] init]; } - (void) prepareContent { id new = [self newObject]; [self setContent: new]; RELEASE(new); } - (BOOL) automaticallyPreparesContent { return _automatically_prepares_content; } - (void) setAutomaticallyPreparesContent: (BOOL)flag { _automatically_prepares_content = flag; } - (void) add: (id)sender { if ([self canAdd]) { id new = [self newObject]; [self addObject: new]; RELEASE(new); } } - (void) addObject: (id)obj { GSKeyValueBinding *theBinding; [self setContent: obj]; theBinding = [GSKeyValueBinding getBinding: NSContentObjectBinding forObject: self]; if (theBinding != nil) [theBinding reverseSetValueFor: @"content"]; } - (void) remove: (id)sender { if ([self canRemove]) { [self removeObject: [self content]]; } } - (void) removeObject: (id)obj { if (obj == [self content]) { GSKeyValueBinding *theBinding; [self setContent: nil]; theBinding = [GSKeyValueBinding getBinding: NSContentObjectBinding forObject: self]; if (theBinding != nil) [theBinding reverseSetValueFor: @"content"]; } } - (BOOL) canAdd { return [self isEditable]; } - (BOOL) canRemove { return [self isEditable] && [[self selectedObjects] count] > 0; } - (BOOL) isEditable { return _is_editable; } - (void) setEditable: (BOOL)flag { _is_editable = flag; } - (NSArray*) selectedObjects { // TODO return _selection; } - (id) selection { // TODO return _content; } - (BOOL) validateMenuItem: (id )item { SEL action = [item action]; if (sel_isEqual(action, @selector(add:))) { return [self canAdd]; } else if (sel_isEqual(action, @selector(remove:))) { return [self canRemove]; } return YES; } - (NSString*) entityNameKey { return _entity_name_key; } - (void) setEntityName: (NSString*)entityName { ASSIGN(_entity_name_key, entityName); } - (NSPredicate*) fetchPredicate { return _fetch_predicate; } - (void) setFetchPredicate: (NSPredicate*)predicate { ASSIGN(_fetch_predicate, predicate); } - (void) fetch: (id)sender { NSError *error; [self fetchWithRequest: nil merge: NO error: &error]; } - (BOOL) fetchWithRequest: (NSFetchRequest*)fetchRequest merge: (BOOL)merge error: (NSError**)error { // TODO //[_managed_object_context executeFetchRequest: fetchRequest error: error]; return NO; } - (NSManagedObjectContext*) managedObjectContext { return _managed_object_context; } - (void) setManagedObjectContext: (NSManagedObjectContext*)managedObjectContext { _managed_object_context = managedObjectContext; } @end gnustep-gui-0.24.0/Source/NSMenuItemCell.m0000664000076500007650000006044712227306115020156 0ustar brains99brains99/** NSMenuItemCell Copyright (C) 1999 Free Software Foundation, Inc. Author: Michael Hanni Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import #import #import //#import #import //#import //#import #import #import #import "AppKit/NSAttributedString.h" #import "AppKit/NSBezierPath.h" #import "AppKit/NSColor.h" #import "AppKit/NSEvent.h" #import "AppKit/NSFont.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSImage.h" #import "AppKit/NSMenu.h" #import "AppKit/NSMenuItemCell.h" #import "AppKit/NSMenuView.h" #import "AppKit/NSParagraphStyle.h" #import "GNUstepGUI/GSTheme.h" #import "GSGuiPrivate.h" static NSString *controlKeyString = @"^"; static NSString *alternateKeyString = @"+"; static NSString *shiftKeyString = @"/"; static NSString *commandKeyString = @"#"; @interface NSMenuItemCell (Private) - (GSThemeControlState) themeControlState; @end @implementation NSMenuItemCell + (void) initialize { if (self == [NSMenuItemCell class]) { NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; NSString *keyString; [self setVersion: 2]; keyString = [userDefaults objectForKey: @"GSControlKeyString"]; if (nil != keyString) { controlKeyString = [keyString retain]; } keyString = [userDefaults objectForKey: @"GSAlternateKeyString"]; if (nil != keyString) { alternateKeyString = [keyString retain]; } keyString = [userDefaults objectForKey: @"GSShiftKeyString"]; if (nil != keyString) { shiftKeyString = [keyString retain]; } keyString = [userDefaults objectForKey: @"GSCommandKeyString"]; if (nil != keyString) { commandKeyString = [keyString retain]; } } } + (NSFocusRingType) defaultFocusRingType { return NSFocusRingTypeNone; } - (id) init { self = [super init]; if (nil == self) return nil; [self setButtonType: NSMomentaryLightButton]; [self setAlignment: NSLeftTextAlignment]; [self setFont: [NSFont menuFontOfSize: 0]]; [self setNeedsSizing: YES]; return self; } - (void) dealloc { RELEASE(_menuItem); [super dealloc]; } - (void) setHighlighted:(BOOL)flag { _cell.is_highlighted = flag; [self setNeedsSizing: YES]; } - (BOOL) isHighlighted { // Same as in super class return _cell.is_highlighted; } - (NSColor *)textColor { if (_cell.is_highlighted && [self isEnabled]) { return [NSColor selectedMenuItemTextColor]; } return [super textColor]; } - (NSColor *) backgroundColor { unsigned mask; NSColor *color; GSThemeControlState state = GSThemeNormalState; if (_cell.is_highlighted) { mask = _highlightsByMask; if (_cell.state) mask &= ~_showAltStateMask; } else if (_cell.state) mask = _showAltStateMask; else mask = NSNoCellMask; // Determine the background color if (mask & (NSChangeGrayCellMask | NSChangeBackgroundCellMask)) { state = GSThemeHighlightedState; } if (mask & NSPushInCellMask) { state = GSThemeSelectedState; } // TODO: Make the color lookup simpler. color = [[GSTheme theme] colorNamed: @"NSMenuItem" state: state]; if (color == nil) { if ((state == GSThemeHighlightedState) || (state == GSThemeSelectedState)) { color = [NSColor selectedMenuItemColor]; } else { color = [[GSTheme theme] menuItemBackgroundColor]; } } return color; } - (void) setMenuItem: (NSMenuItem *)item { ASSIGN(_menuItem, item); [self setEnabled: [_menuItem isEnabled]]; [self setNeedsSizing: YES]; } - (NSMenuItem *) menuItem { return _menuItem; } - (NSInteger) tag { return [[self menuItem] tag]; } - (void) setMenuView: (NSMenuView *)menuView { /* The menu view is retaining us, we should not retain it. */ _menuView = menuView; /* * Determine whether we have horizontal or vertical layout and adjust. */ if ([_menuView isHorizontal] == YES) { [self setAlignment: NSCenterTextAlignment]; [self setBordered: NO]; [self setImagePosition: NSImageLeft]; } else { [self setAlignment: NSLeftTextAlignment]; [self setBordered: YES]; } [self setNeedsSizing: YES]; } - (NSMenuView *) menuView { return _menuView; } - (NSString*) _keyEquivalentString { NSString *key = [_menuItem keyEquivalent]; unsigned int m = [_menuItem keyEquivalentModifierMask]; NSString *ucKey = [key uppercaseString]; unichar uchar; if ((key == nil) || [key isEqualToString: @""]) return key; uchar = [key characterAtIndex: 0]; if (uchar >= 0xF700) { // FIXME: At the moment we are not able to handle function keys // as key equivalent return nil; } if ([key isEqualToString: @"\\r"]) key = @"RET"; else if ([key isEqualToString: @"\\e"]) key = @"ESC"; else if ([key isEqualToString: @"\\d"]) key = @"DEL"; if (m != 0) { BOOL shift; // shift mask and not an upper case string? shift = (m & NSShiftKeyMask) & ![key isEqualToString: ucKey]; key = [NSString stringWithFormat:@"%@%@%@%@%@", (m & NSControlKeyMask) ? controlKeyString : @"", (m & NSAlternateKeyMask) ? alternateKeyString : @"", shift ? shiftKeyString : @"", (m & NSCommandKeyMask) ? commandKeyString : @"", key]; } return key; } - (void) calcSize { NSSize componentSize; NSImage *anImage = nil; CGFloat neededMenuItemHeight = 20; // Check if _mcell_belongs_to_popupbutton = NO while cell owned by // popup button. FIXME if (!_mcell_belongs_to_popupbutton && [[_menuView menu] _ownedByPopUp]) { _mcell_belongs_to_popupbutton = YES; [self setImagePosition: NSImageRight]; } // State Image if ([_menuItem changesState]) { // NSOnState if ([_menuItem onStateImage]) componentSize = [[_menuItem onStateImage] size]; else componentSize = NSMakeSize(0,0); _stateImageWidth = componentSize.width; if (componentSize.height > neededMenuItemHeight) neededMenuItemHeight = componentSize.height; // NSOffState if ([_menuItem offStateImage]) componentSize = [[_menuItem offStateImage] size]; else componentSize = NSMakeSize(0,0); if (componentSize.width > _stateImageWidth) _stateImageWidth = componentSize.width; if (componentSize.height > neededMenuItemHeight) neededMenuItemHeight = componentSize.height; // NSMixedState if ([_menuItem mixedStateImage]) componentSize = [[_menuItem mixedStateImage] size]; else componentSize = NSMakeSize(0,0); if (componentSize.width > _stateImageWidth) _stateImageWidth = componentSize.width; if (componentSize.height > neededMenuItemHeight) neededMenuItemHeight = componentSize.height; } else { _stateImageWidth = 0.0; } // Image if ((anImage = [_menuItem image]) && _cell.image_position == NSNoImage) [self setImagePosition: NSImageLeft]; if (anImage) { componentSize = [anImage size]; _imageWidth = componentSize.width; if (componentSize.height > neededMenuItemHeight) neededMenuItemHeight = componentSize.height; } else { _imageWidth = 0.0; } // Title and Key Equivalent componentSize = [self _sizeText: [_menuItem title]]; _titleWidth = componentSize.width; if (componentSize.height > neededMenuItemHeight) neededMenuItemHeight = componentSize.height; componentSize = [self _sizeText: [self _keyEquivalentString]]; _keyEquivalentWidth = componentSize.width; if (componentSize.height > neededMenuItemHeight) neededMenuItemHeight = componentSize.height; // Submenu Arrow if ([_menuItem hasSubmenu]) { NSImage *arrow = [NSImage imageNamed: @"NSMenuArrow"]; if (arrow != nil) { componentSize = [arrow size]; } else { componentSize = NSMakeSize(0, 0); } _keyEquivalentWidth = componentSize.width; if (componentSize.height > neededMenuItemHeight) neededMenuItemHeight = componentSize.height; } // Cache definitive height _menuItemHeight = neededMenuItemHeight; // At the end we set sizing to NO. _needs_sizing = NO; } - (void) setNeedsSizing:(BOOL)flag { _needs_sizing = flag; } - (BOOL) needsSizing { return _needs_sizing; } - (void) setNeedsDisplay:(BOOL)flag { _needs_display = flag; } - (BOOL) needsDisplay { return _needs_display; } - (CGFloat) imageWidth { if (_needs_sizing) [self calcSize]; return _imageWidth; } - (CGFloat) titleWidth { if (_needs_sizing) [self calcSize]; return _titleWidth; } - (CGFloat) keyEquivalentWidth { if (_needs_sizing) [self calcSize]; return _keyEquivalentWidth; } - (CGFloat) stateImageWidth { if (_needs_sizing) [self calcSize]; return _stateImageWidth; } // // Sizes for drawing taking into account NSMenuView adjustments. // - (NSRect) imageRectForBounds: (NSRect)cellFrame { if (_needs_sizing) [self calcSize]; if (_mcell_belongs_to_popupbutton && _cell.image_position) { // Special case: draw image on the extreme right cellFrame.origin.x += cellFrame.size.width - _imageWidth - 4; cellFrame.size.width = _imageWidth; return cellFrame; } if ([_menuView isHorizontal] == YES) { switch (_cell.image_position) { case NSNoImage: cellFrame = NSZeroRect; break; case NSImageOnly: case NSImageOverlaps: break; case NSImageLeft: cellFrame.origin.x += 4.; // _horizontalEdgePad cellFrame.size.width = _imageWidth; break; case NSImageRight: cellFrame.origin.x += _titleWidth; cellFrame.size.width = _imageWidth; break; case NSImageBelow: cellFrame.size.height /= 2; break; case NSImageAbove: cellFrame.size.height /= 2; cellFrame.origin.y += cellFrame.size.height; break; } } else { // Calculate the image part of cell frame from NSMenuView cellFrame.origin.x += [_menuView imageAndTitleOffset]; cellFrame.size.width = [_menuView imageAndTitleWidth]; switch (_cell.image_position) { case NSNoImage: cellFrame = NSZeroRect; break; case NSImageOnly: case NSImageOverlaps: break; case NSImageLeft: cellFrame.size.width = _imageWidth; break; case NSImageRight: cellFrame.origin.x += _titleWidth + GSCellTextImageXDist; cellFrame.size.width = _imageWidth; break; case NSImageBelow: cellFrame.size.height /= 2; break; case NSImageAbove: cellFrame.size.height /= 2; cellFrame.origin.y += cellFrame.size.height; break; } } return cellFrame; } - (NSRect) keyEquivalentRectForBounds:(NSRect)cellFrame { // Calculate the image part of cell frame from NSMenuView cellFrame.origin.x += [_menuView keyEquivalentOffset]; cellFrame.size.width = [_menuView keyEquivalentWidth]; return cellFrame; } - (NSRect) stateImageRectForBounds:(NSRect)cellFrame { // Calculate the image part of cell frame from NSMenuView cellFrame.origin.x += [_menuView stateImageOffset]; cellFrame.size.width = [_menuView stateImageWidth]; return cellFrame; } - (NSRect) titleRectForBounds:(NSRect)cellFrame { if (_needs_sizing) [self calcSize]; if (_mcell_belongs_to_popupbutton && _cell.image_position) { // Special case: draw image on the extreme right cellFrame.origin.x += [_menuView imageAndTitleOffset]; cellFrame.size.width = _titleWidth; return cellFrame; } if ([_menuView isHorizontal] == YES) { /* This adjust will center us within the menubar. */ cellFrame.size.height -= 2; switch (_cell.image_position) { case NSNoImage: case NSImageOverlaps: break; case NSImageOnly: cellFrame = NSZeroRect; break; case NSImageLeft: cellFrame.origin.x += _imageWidth + GSCellTextImageXDist + 4; cellFrame.size.width = _titleWidth; break; case NSImageRight: cellFrame.size.width = _titleWidth; break; case NSImageBelow: cellFrame.size.height /= 2; cellFrame.origin.y += cellFrame.size.height; break; case NSImageAbove: cellFrame.size.height /= 2; break; } } else { // Calculate the image part of cell frame from NSMenuView cellFrame.origin.x += [_menuView imageAndTitleOffset]; cellFrame.size.width = cellFrame.size.width - [_menuView imageAndTitleOffset]; switch (_cell.image_position) { case NSNoImage: case NSImageOverlaps: break; case NSImageOnly: cellFrame = NSZeroRect; break; case NSImageLeft: cellFrame.origin.x += _imageWidth + GSCellTextImageXDist; cellFrame.size.width = cellFrame.size.width - (_imageWidth + GSCellTextImageXDist); break; case NSImageRight: cellFrame.size.width = cellFrame.size.width - (_imageWidth + GSCellTextImageXDist); break; case NSImageBelow: cellFrame.size.height /= 2; cellFrame.origin.y += cellFrame.size.height; break; case NSImageAbove: cellFrame.size.height /= 2; break; } } return cellFrame; } - (NSRect) drawingRectForBounds: (NSRect)theRect { if (_needs_sizing) [self calcSize]; if ([_menuView isHorizontal] == YES) { /* A horizontal menu does not have borders drawn by the cell, * but it does have a border round the menu as a whole, so we * must inset from that. */ return NSMakeRect (theRect.origin.x, theRect.origin.y + 2, theRect.size.width, theRect.size.height - 2); } else { if (_cell.is_bordered) { CGFloat yDelta = [_control_view isFlipped] ? 1. : 2.; unsigned mask; NSRect interiorFrame; if (_cell.is_highlighted) { mask = _highlightsByMask; if (_cell.state) mask &= ~_showAltStateMask; } else if (_cell.state) mask = _showAltStateMask; else mask = NSNoCellMask; /* * Special case: Buttons have only three different paths for border. * One white path at the top left corner, one black path at the * bottom right and another in dark gray at the inner bottom right. */ interiorFrame = NSMakeRect(theRect.origin.x + 1., theRect.origin.y + yDelta, theRect.size.width - 3., theRect.size.height - 3.); // pushed in buttons contents are displaced to the bottom right 1px if ((mask & NSPushInCellMask)) { interiorFrame = NSOffsetRect(interiorFrame, 1., [_control_view isFlipped] ? 1. : -1.); } return interiorFrame; } else { return theRect; } } } // // Drawing. // - (void) drawBorderAndBackgroundWithFrame: (NSRect)cellFrame inView: (NSView *)controlView { [[GSTheme theme] drawBorderAndBackgroundForMenuItemCell: self withFrame: cellFrame inView: controlView state: [self themeControlState] isHorizontal: [_menuView isHorizontal]]; } - (void) drawImageWithFrame: (NSRect)cellFrame inView: (NSView *)controlView { cellFrame = [self imageRectForBounds: cellFrame]; [self drawImage: _imageToDisplay withFrame: cellFrame inView: controlView]; } - (void) drawKeyEquivalentWithFrame: (NSRect)cellFrame inView: (NSView *)controlView { NSImage *arrow = nil; if (_cell.is_highlighted) { arrow = [NSImage imageNamed: @"NSHighlightedMenuArrow"]; } if (arrow == nil) { arrow = [NSImage imageNamed: @"NSMenuArrow"]; } cellFrame = [self keyEquivalentRectForBounds: cellFrame]; if ([_menuItem hasSubmenu] && arrow != nil) { NSSize size; NSPoint position; size = [arrow size]; position.x = cellFrame.origin.x + cellFrame.size.width - size.width; position.y = MAX(NSMidY(cellFrame) - (size.height/2.), 0.); /* * Images are always drawn with their bottom-left corner at the origin * so we must adjust the position to take account of a flipped view. */ if ([controlView isFlipped]) position.y += size.height; [arrow compositeToPoint: position operation: NSCompositeSourceOver]; } /* FIXME/TODO here - decide a consistent policy for images. * * The reason of the following code is that we draw the key * equivalent, but not if we are a popup button and are displaying * an image (the image is displayed in the title or selected entry * in the popup, it's the small square on the right). In that case, * the image will be drawn in the same position where the key * equivalent would be, so we do not display the key equivalent, * else they would be displayed one over the other one. */ else if (![[_menuView menu] _ownedByPopUp] || (_imageToDisplay == nil)) { [self _drawText: [self _keyEquivalentString] inFrame: cellFrame]; } } - (void) drawSeparatorItemWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { [[GSTheme theme] drawSeparatorItemForMenuItemCell: self withFrame: cellFrame inView: controlView isHorizontal: [_menuView isHorizontal]]; } - (void) drawStateImageWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { NSImage *imageToDisplay; switch ([_menuItem state]) { case NSOnState: imageToDisplay = [_menuItem onStateImage]; break; case NSMixedState: imageToDisplay = [_menuItem mixedStateImage]; break; case NSOffState: default: imageToDisplay = [_menuItem offStateImage]; break; } if (imageToDisplay == nil) { return; } cellFrame = [self stateImageRectForBounds: cellFrame]; [self drawImage: imageToDisplay withFrame: cellFrame inView: controlView]; } - (void) drawTitleWithFrame: (NSRect)cellFrame inView: (NSView *)controlView { [[GSTheme theme] drawTitleForMenuItemCell: self withFrame: cellFrame inView: controlView state: [self themeControlState] isHorizontal: [_menuView isHorizontal]]; } - (void) _drawBorderAndBackgroundWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { [self drawBorderAndBackgroundWithFrame: cellFrame inView: controlView]; } - (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { unsigned mask; // Transparent buttons never draw if (_buttoncell_is_transparent) return; if ([_menuItem isSeparatorItem]) { [self drawSeparatorItemWithFrame: cellFrame inView: controlView]; return; } cellFrame = [self drawingRectForBounds: cellFrame]; // FIXME: I think all this code belongs into calcSize. if (_cell.is_highlighted) { mask = _highlightsByMask; if (_cell.state) mask &= ~_showAltStateMask; } else if (_cell.state) mask = _showAltStateMask; else mask = NSNoCellMask; /* * Determine the image and the title that will be * displayed. If the NSContentsCellMask is set the * image and title are swapped only if state is 1 or * if highlighting is set (when a button is pushed it's * content is changed to the face of reversed state). * The results are saved in two ivars for use in other * drawing methods. */ if (mask & NSContentsCellMask) { _imageToDisplay = _altImage; if (!_imageToDisplay) _imageToDisplay = [_menuItem image]; _titleToDisplay = _altContents; if (_titleToDisplay == nil || [_titleToDisplay isEqual: @""]) _titleToDisplay = [_menuItem title]; } else { _imageToDisplay = [_menuItem image]; _titleToDisplay = [_menuItem title]; } if (_imageToDisplay) { _imageWidth = [_imageToDisplay size].width; } if ([_menuView isHorizontal] == YES) { // Draw the image if (_imageWidth > 0) [self drawImageWithFrame: cellFrame inView: controlView]; // Draw the title if (_titleWidth > 0) [self drawTitleWithFrame: cellFrame inView: controlView]; } else { // Draw the state image if (_stateImageWidth > 0) [self drawStateImageWithFrame: cellFrame inView: controlView]; // Draw the image if (_imageWidth > 0) [self drawImageWithFrame: cellFrame inView: controlView]; // Draw the title if (_titleWidth > 0) [self drawTitleWithFrame: cellFrame inView: controlView]; // Draw the key equivalent if (_keyEquivalentWidth > 0) [self drawKeyEquivalentWithFrame: cellFrame inView: controlView]; } } // // NSCopying protocol // - (id) copyWithZone: (NSZone*)zone { NSMenuItemCell *c = [super copyWithZone: zone]; if (_menuItem) c->_menuItem = [_menuItem copyWithZone: zone]; /* We do not copy _menuView, because _menuView owns the old cell, but not the new one! _menuView knows nothing about c. If we copy the pointer to _menuView into c, then that pointer might become invalid at any point in time (it never becomes invalid for the original cell because _menuView will call [originalCell setMenuView: nil] when it's being deallocated. But it will not do the same for c, because it doesn't even know that c exists!) */ c->_menuView = nil; return c; } /* * NSCoding protocol * * Normally unused since the NSMenu encodes/decodes the NSMenuItems, but * not the NSMenuItemCells. */ - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { [aCoder encodeObject: _menuItem forKey: @"NSMenuItem"]; } else { [aCoder encodeConditionalObject: _menuItem]; } } - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if (nil == self) return nil; if ([aDecoder allowsKeyedCoding]) { [self setMenuItem: [aDecoder decodeObjectForKey: @"NSMenuItem"]]; } else { ASSIGN (_menuItem, [aDecoder decodeObject]); if ([aDecoder versionForClassName: @"NSMenuItemCell"] < 2) { /* In version 1, we used to encode the _menuView here. */ [aDecoder decodeObject]; } } _needs_sizing = YES; return self; } @end gnustep-gui-0.24.0/Source/NSPageLayout.m0000664000076500007650000007550112105235341017677 0ustar brains99brains99/** NSPageLayout Standard panel for querying user about page layout. Copyright (C) 2001,2004 Free Software Foundation, Inc. Written By: Adam Fedor Date: Oct 2001 Modified for Printing Backend Support Author: Chad Hardin Date: June 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSFont.h" #import "AppKit/NSTextField.h" #import "AppKit/NSImage.h" #import "AppKit/NSImageView.h" #import "AppKit/NSBezierPath.h" #import "AppKit/NSBox.h" #import "AppKit/NSButton.h" #import "AppKit/NSColor.h" #import "AppKit/NSComboBox.h" #import "AppKit/NSPopUpButton.h" #import "AppKit/NSMatrix.h" #import "AppKit/NSNibLoading.h" #import "AppKit/NSForm.h" #import "AppKit/NSFormCell.h" #import "AppKit/NSPrintInfo.h" #import "AppKit/NSPageLayout.h" #import "AppKit/NSTableView.h" #import "AppKit/NSTabView.h" #import "AppKit/NSTabViewItem.h" #import "AppKit/NSPrinter.h" #import "GSGuiPrivate.h" #import "GNUstepGUI/GSPrinting.h" static NSPageLayout *shared_instance; // // The buttons on the panel for controlling // the addition, deletion, etc, of custom // papers. // The panel is also filled with NSTextFields // that appear as "un" when opened in GORM. // These have tags that start with 100 and // are numbered up from there. They are programatically // set to text for the user's prefered measuremnt // unit, by looking at NSMeasurementUnit. enum { GSPLNewCustomPaperButton = 200, GSPLDuplicateCustomPaperButton = 201, GSPLDeleteCustomPaperButton = 202, GSPLSaveCustomPaperButton = 203 }; @implementation NSApplication (NSPageLayout) - (void) runPageLayout: sender { [[NSPageLayout pageLayout] runModal]; } @end // // This is the controller for NSPageLayout, it does most of the // work. Implementation is near the end of the file // @interface GSPageLayoutController : NSObject // { NSMutableDictionary *customPapers; //a dictionary of dictionaries BOOL customPapersNeedSaving; NSString *measurementString; //examples are "in", "pt", or "cm" double factorValue; //how to convert from points to cm or in NSTabViewItem *attributesTabViewItem; NSTabViewItem *customTabViewItem; NSTabViewItem *summaryTabViewItem; //IBOutlets id panel; id tabView; id applicationImageButton; id panelTitleField; id printerPopUp; id paperRadioMatrix; id standardPaperSizePopUp; id customPaperSizePopUp; id dimensionsTextField; id paperOrientationMatrix; id paperAttributesPreview; id scaleTextField; id customPaperTableView; id customPaperNameColumn; id customPaperWidthTextField; id customPaperHeightTextField; id customPaperMarginTopTextField; id customPaperMarginBottomTextField; id customPaperMarginRightTextField; id customPaperMarginLeftTextField; id customPaperPreview; id newCustomPaperButton; id duplicateCustomPaperButton; id deleteCustomPaperButton; id saveCustomPaperButton; id summaryTableView; id summarySettingColumn; id summaryValueColumn; //What used to be NSPageLayout's ivars NSPrintInfo *_printInfo; NSView *_accessoryView; } -(NSPageLayout*) panel; //IBActions -(void) okButtonClicked: (id)sender; -(void) cancelButtonClicked: (id)sender; -(void) printerPopUpClicked: (id)sender; -(void) paperRadioMatrixClicked: (id)sender; -(void) paperPopUpClicked: (id)sender; -(void) paperOrientationMatrixClicked: (id) sender; -(void) customPaperButtonsClicked: (id)sender; //internal -(void) determineMeasurements; -(void) processAttributes; -(void) syncInterface; //access to ivars -(NSPrintInfo*) printInfo; -(void) setPrintInfo:(NSPrintInfo*)printInfo; -(NSView*) accessoryView; -(void) setAccessoryView:(NSView*)accessoryView; //Handling of NSPageLayout implementation -(void)readPrintInfo; -(void)writePrintInfo; //A NSTextField delegate handler we care about -(void) controlTextDidChange:(NSNotification*) notification; //NSTableView datasource handlers -(NSInteger) numberOfRowsInTableView:(NSTableView*) tableView; -(id) tableView: (NSTableView*) tableView objectValueForTableColumn: (NSTableColumn*) tableColumn row: (NSInteger) index; //NSTabView delegate handler we care about -(void) tabView: (NSTabView*) tabView willSelectTabViewItem: (NSTabViewItem*) tabViewItem; @end // // This NSView subclass shows a preview of a // page, including the margins. Implementation // is at the end of the file. // @interface GSPageLayoutMiniPageView : NSView { NSSize _paperSize; NSRect _marginsRect; BOOL _drawsMargins; } -(void) setPaperSize: (NSSize) paperSize; -(void) setMarginsRect: (NSRect) marginsRect; -(void) setDrawsMargins: (BOOL) drawsMargins; @end /** NSPageLayout

NSPageLayout provides a panel that allows the user to specify certain information about the printer and how data is formatted for printing. This includes information about the paper size and orientation. Typically you would create a page layout panel with the +pageLayout class method. However, the best way to use the panel is to have the application call the runPageLayout: method in the NSApplication object which would both create a standard NSPageLayout panel and display it in a modal loop. This method would be sent up the responder chain if the user clicked on a Page Layout menu item.

*/ @implementation NSPageLayout // // Class methods // /** Load the appropriate bundle for the PageLayout (eg: GSLPRPageLayout, GSCUPSPageLayout). */ + (id) allocWithZone: (NSZone*) zone { Class principalClass; principalClass = [[GSPrinting printingBundle] principalClass]; if (principalClass == nil) return nil; return [[principalClass pageLayoutClass] allocWithZone: zone]; } /** Creates ( if needed ) and returns a shared instance of the NSPageLayout panel. */ + (NSPageLayout *)pageLayout { if (shared_instance == nil) { GSPageLayoutController *controller; controller = [[GSPageLayoutController alloc] init]; shared_instance = [controller panel]; } return shared_instance; } // // Running the Panel // /**

Display the Page Layout panel in a modal loop. Saves any aquired information in the shared NSPrintInfo object. Returns NSCancelButton if the user clicks the Cancel button or NSOKButton otherwise.

See Also: -runModalWithPrintInfo:

*/ - (NSInteger)runModal { return [self runModalWithPrintInfo: [NSPrintInfo sharedPrintInfo]]; } /**

Displays the Page Layout panel in a modal loop. Saves any aquired information in the indicated NSPrintInfo object. Returns NSCancelButton if the user clicks the Cancel button or NSOKButton otherwise.

See Also: -runModal

*/ - (NSInteger)runModalWithPrintInfo:(NSPrintInfo *)printInfo { NSInteger result; [_controller setPrintInfo: printInfo]; [_controller readPrintInfo]; result = [NSApp runModalForWindow: self]; [self orderOut: self]; return result; } - (void)beginSheetWithPrintInfo:(NSPrintInfo *)printInfo modalForWindow:(NSWindow *)docWindow delegate:(id)delegate didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo { [_controller setPrintInfo: printInfo]; [_controller readPrintInfo]; [NSApp beginSheet: self modalForWindow: docWindow modalDelegate: delegate didEndSelector: didEndSelector contextInfo: contextInfo]; [self orderOut: self]; } // // Customizing the Panel // /**

Returns the accessory view for the page layout panel.

See Also: -setAccessoryView:

*/ - (NSView *)accessoryView { return [_controller accessoryView]; } /**

Sets the accessory view for the page layout panel

See Also: -accessoryView

*/ - (void)setAccessoryView:(NSView *)aView { [_controller setAccessoryView: aView]; } /** This method has been depreciated. It doesn't do anything useful. */ - (void)convertOldFactor:(float *)old newFactor:(float *)newFactor { NSLog(@"[NSPageLayout -convertOldFactor:newFactor:] method depreciated"); } /** This method has been depreciated. It doesn't do anything useful. */ - (void)pickedButton:(id)sender { NSLog(@"[NSPageLayout -pickedButton:] method depreciated"); } /** This method has been depreciated. It doesn't do anything useful. */ - (void)pickedOrientation:(id)sender { NSLog(@"[NSPageLayout -pickedOrientation:] method depreciated"); } /** This method has been depreciated. It doesn't do anything useful. */ - (void)pickedPaperSize:(id)sender { NSLog(@"[NSPageLayout -pickedPaperSize:] method depreciated"); } /** This method has been depreciated. It doesn't do anything useful. */ - (void)pickedLayout:(id)sender { NSLog(@"[NSPageLayout -pickedLayout:] method depreciated"); } /** This method has been depreciated. It doesn't do anything useful. */ - (void)pickedUnits:(id)sender { NSLog(@"[NSPageLayout -pickedUnits:] method depreciated"); } // // Communicating with the NSPrintInfo Object // /** Return the NSPrintInfo object that the receiver stores layout information into. */ - (NSPrintInfo *)printInfo { return [_controller printInfo]; } /**

Updates the receiver panel with information from its NSPrintInfo object.

See Also: -writePrintInfo

*/ - (void)readPrintInfo { [_controller readPrintInfo]; } /**

Writes any layout information set by the user to the receiver's NSPrintInfo object

See Also: -readPrintInfo

*/ - (void)writePrintInfo { [_controller writePrintInfo]; } @end // // Controller for the PageLayout Panel // @implementation GSPageLayoutController - (id) init { NSImage *image; NSNumberFormatter *sizeFormatter; NSNumberFormatter *scaleFormatter; if ((self = [super init]) == nil) return nil; if ([NSBundle loadNibNamed: @"GSPageLayout" owner: self] == NO) { NSRunAlertPanel(@"Error", @"Could not load page layout panel resource", @"OK", NULL, NULL); return nil; } // //find out what the user's preffered measurements are //and what the scaleFactor will be // [self determineMeasurements]; //Put the applications icon image in the panel image = [[NSApplication sharedApplication] applicationIconImage]; [applicationImageButton setImage: image]; // //Put NSNumberFormatters in ALL the NSTextFields //since GORMS is not to good at this yet. //I look forward to the day when this code can //be removed. { //for the Scale field scaleFormatter = AUTORELEASE([[NSNumberFormatter alloc] init]); [scaleFormatter setAllowsFloats: NO]; [scaleFormatter setMinimum: [NSDecimalNumber decimalNumberWithString: @"1.0"]]; [scaleFormatter setMaximum: [NSDecimalNumber decimalNumberWithString: @"1000.0"]]; [scaleFormatter setHasThousandSeparators: NO]; [scaleTextField setFormatter: scaleFormatter]; } { //For the the width and height of custom papers ONLY. //The NSFormatters for the margins are made on the fly //because they change based upon the values of the width //and height. Makes sense, right? sizeFormatter = AUTORELEASE([[NSNumberFormatter alloc] init]); [sizeFormatter setAllowsFloats: YES]; [sizeFormatter setMinimum: [NSDecimalNumber decimalNumberWithString: @"0.00001"]]; [sizeFormatter setHasThousandSeparators: NO]; [customPaperWidthTextField setFormatter: sizeFormatter]; [customPaperHeightTextField setFormatter: sizeFormatter]; } // // Load the custom paper sizes // { NSUserDefaults *defaults; NSDictionary *globalDomain; customPapersNeedSaving = NO; defaults = [NSUserDefaults standardUserDefaults]; globalDomain = [defaults persistentDomainForName: NSGlobalDomain]; customPapers = [globalDomain objectForKey: @"GSPageLayoutCustomPaperSizes"]; if (customPapers) { customPapers = [customPapers mutableCopy]; } else { customPapers = RETAIN([NSMutableDictionary dictionary]); } } // //Set the proper measurement strings on the "Custom Paper Size" tab //There are six NSTextFields with ids ranging from 100 to 105. Set them. //the string used, measurementString, was determined by the call made //to [self determineMeasurements] earlier in -init. measurementString is //an ivar. { int n; for (n = 100; n <= 105; n++) { NSTextField *textField; textField = [[[tabView tabViewItemAtIndex:1] view] viewWithTag: n]; [textField setStringValue: measurementString]; } //doing the above puts selects the 2nd tab, we don't want that. [tabView selectFirstTabViewItem: self]; } //assign the tab views items { attributesTabViewItem = [tabView tabViewItemAtIndex: 0]; customTabViewItem = [tabView tabViewItemAtIndex: 1]; summaryTabViewItem = [tabView tabViewItemAtIndex: 2]; } return self; } -(void) dealloc { RELEASE(customPapers); RELEASE(measurementString); [super dealloc]; } - (NSPageLayout*) panel { return (NSPageLayout*)panel; } - (void) okButtonClicked: (id)sender { [self writePrintInfo]; [NSApp stopModalWithCode: NSOKButton]; } - (void) cancelButtonClicked: (id)sender { [NSApp stopModalWithCode: NSCancelButton]; } -(void) printerPopUpClicked: (id)sender { NSPrinter *printer; NSString *prevPaperName; NSArray *newPaperNames; printer = [NSPrinter printerWithName: [printerPopUp titleOfSelectedItem]]; /* Setup standardPaperSizePopUp for the new printer */ prevPaperName = [standardPaperSizePopUp titleOfSelectedItem]; newPaperNames = [printer stringListForKey:@"PageSize" inTable:@"PPD"]; [standardPaperSizePopUp removeAllItems]; [standardPaperSizePopUp addItemsWithTitles: newPaperNames]; //be nice and try to select the previous selection [standardPaperSizePopUp selectItemWithTitle: prevPaperName]; [self processAttributes]; } -(void) paperRadioMatrixClicked: (id) sender { if ([sender selectedRow] == 0) //Standard Paper Sizes { [customPaperSizePopUp setEnabled: NO]; [standardPaperSizePopUp setEnabled: YES]; } else //Custom Paper Sizes { [standardPaperSizePopUp setEnabled: NO]; [customPaperSizePopUp setEnabled: YES]; } [self processAttributes]; } -(void) paperPopUpClicked: (id) sender { [self processAttributes]; } -(void) paperOrientationMatrixClicked: (id) sender { [self processAttributes]; } -(void) customPaperButtonsClicked: (id) sender { } //determine the measurement string and factor value to use -(void) determineMeasurements { NSUserDefaults *defaults; NSString *string; defaults = [NSUserDefaults standardUserDefaults]; string = [defaults objectForKey: @"NSMeasurementUnit"]; NSDebugLLog(@"NSPageLayout", @"NSMeasurementUnit is %@", string); if (string == nil) //default to cm, most of the world is metric... { measurementString = @"cm"; factorValue = 2.54/72.0; } else { if ([string caseInsensitiveCompare: @"CENTIMETERS"] == NSOrderedSame) { measurementString = @"cm"; factorValue = 2.54/72.0; } else if ([string caseInsensitiveCompare: @"INCHES"] == NSOrderedSame) { measurementString = @"in"; factorValue = 1.0/72.0; } else if ([string caseInsensitiveCompare: @"POINTS"] == NSOrderedSame) { measurementString = @"pt"; factorValue = 1.0; } else if ([string caseInsensitiveCompare: @"PICAS"] == NSOrderedSame) { measurementString = @"pi"; factorValue = 1.0/12.0; } else //default to cm, most of the world is metric... { measurementString = @"cm"; factorValue = 2.54/72.0; } } } // // Reads in the values of the controls and responds accordingly // This updates two ivars: (NSTextField*)dimensionsTextField and // (GSPageLayoutMiniPageView*)paperAttributesPreview. -(void) processAttributes { NSString *paperName; NSPrinter *printer; NSSize paperSize; //Get the printer printer = [NSPrinter printerWithName: [printerPopUp titleOfSelectedItem]]; //Get the paper name and size if ([paperRadioMatrix selectedRow] == 0) //Standard Papers { paperName = [standardPaperSizePopUp titleOfSelectedItem]; paperSize = [printer pageSizeForPaper: paperName]; } else //Custom Papers { NSMutableDictionary *customPaperDict; paperName = [customPaperSizePopUp titleOfSelectedItem]; customPaperDict = [customPapers objectForKey: paperName]; paperSize = [[customPaperDict objectForKey: @"PaperSize"] sizeValue]; } //check if the user selected landscape mode, if so, switch out the //width and height if ([paperOrientationMatrix selectedColumn] > 0) { double temp = paperSize.width; paperSize.width = paperSize.height; paperSize.height = temp; } //construct the string for the dimensions NSTextField and set it { NSString *dimensionsString; dimensionsString = [NSString stringWithFormat: @"%.2f %@ x %.2f %@", paperSize.width * factorValue, measurementString, paperSize.height * factorValue, measurementString]; [dimensionsTextField setStringValue: dimensionsString]; } //tell the preview view what the new paper size is [paperAttributesPreview setPaperSize: paperSize]; } -(NSPrintInfo*) printInfo { return _printInfo; } -(void) setPrintInfo:(NSPrintInfo*)printInfo { ASSIGN(_printInfo, printInfo); } -(NSView*) accessoryView { return _accessoryView; } -(void) setAccessoryView:(NSView*)accessoryView { ASSIGN(_accessoryView, accessoryView); } // // Syncs the interface with the current printers (if any) // and its papers. Also makes sure that the custom papers // pop up is up to date. This method is called by // readPrintInfo. -(void) syncInterface { NSArray *printerNames; id radioButton; [printerPopUp removeAllItems]; [standardPaperSizePopUp removeAllItems]; //Fill in the printers printerNames = [NSPrinter printerNames]; if ([printerNames count] == 0) //NO PRINTERS { [printerPopUp addItemWithTitle: _(@"(none)")]; [printerPopUp setEnabled: NO]; [standardPaperSizePopUp addItemWithTitle: _(@"(none)")]; [standardPaperSizePopUp setEnabled: NO]; radioButton = [paperRadioMatrix cellAtRow: 0 column: 0]; [radioButton setEnabled: NO]; } else //THERE ARE PRINTERS { NSPrinter *printer; NSArray *paperNames; printer = [_printInfo printer]; [printerPopUp addItemsWithTitles: printerNames]; [printerPopUp setEnabled: YES]; [printerPopUp selectItemWithTitle: [printer name]]; //fill in the standardPaperSizePopUp based upon what the printer supports paperNames = [printer stringListForKey:@"PageSize" inTable:@"PPD"]; [standardPaperSizePopUp addItemsWithTitles: paperNames]; [standardPaperSizePopUp setEnabled: YES]; radioButton = [paperRadioMatrix cellAtRow: 0 column: 0]; [radioButton setEnabled: YES]; } } - (void)readPrintInfo { NSString *paperName; NSNumber *scaleNumber; NSDebugLLog(@"NSPageLayout", @"readPrintInfo: %@", [[_printInfo dictionary] description]); [self syncInterface]; //set the paper. Try to set the custom paper first. paperName = [_printInfo paperName]; if (([customPaperSizePopUp isEnabled] == YES) && ([customPaperSizePopUp indexOfItemWithTitle: paperName] != -1)) { [paperRadioMatrix selectCellAtRow: 1 column: 0]; [customPaperSizePopUp selectItemWithTitle: paperName]; } else if ([standardPaperSizePopUp isEnabled] == YES) { [paperRadioMatrix selectCellAtRow: 0 column: 0]; [standardPaperSizePopUp selectItemWithTitle: paperName]; } //set the orientation if ([_printInfo orientation] == NSPortraitOrientation) { [paperOrientationMatrix selectCellAtRow: 0 column: 0]; } else { [paperOrientationMatrix selectCellAtRow: 0 column: 1]; } //set the scaling scaleNumber = [[_printInfo dictionary] objectForKey: NSPrintScalingFactor]; if (scaleNumber == nil) { NSLog(@"NSPrintScalingFactor was nil in NSPrintInfo"); scaleNumber = [NSNumber numberWithDouble: 100.0]; } else { scaleNumber = [NSNumber numberWithDouble: (100.0*[scaleNumber doubleValue])]; } [scaleTextField setObjectValue: scaleNumber]; [self processAttributes]; } - (void)writePrintInfo { NSPrinter *printer; NSString *paperName; NSNumber *scaleNumber; //Write printer object if ([printerPopUp isEnabled] == NO) //NO PRINTERS { printer = nil; } else //HAS PRINTERS { printer = [NSPrinter printerWithName: [printerPopUp titleOfSelectedItem]]; } [_printInfo setPrinter: printer]; //write paper name if (([paperRadioMatrix selectedRow] == 0) && ([standardPaperSizePopUp isEnabled] == YES)) //standard paper sizes { paperName = [standardPaperSizePopUp titleOfSelectedItem]; [_printInfo setPaperName: paperName]; } else if (([paperRadioMatrix selectedRow] == 1) && ([customPaperSizePopUp isEnabled] == YES)) //custom paper size { NSDictionary *customPaper; NSNumber *number; NSSize size; paperName = [customPaperSizePopUp titleOfSelectedItem]; [_printInfo setPaperName: paperName]; customPaper = [customPapers objectForKey: paperName]; number = [customPaper objectForKey: @"TopMargin"]; [_printInfo setTopMargin: [number doubleValue]]; number = [customPaper objectForKey: @"BottomMargin"]; [_printInfo setBottomMargin: [number doubleValue]]; number = [customPaper objectForKey: @"LeftMargin"]; [_printInfo setLeftMargin: [number doubleValue]]; number = [customPaper objectForKey: @"RightMargin"]; [_printInfo setRightMargin: [number doubleValue]]; size = [[customPaper objectForKey: @"PaperSize"] sizeValue]; [_printInfo setPaperSize: size]; } else //NO PAPER CAN BE SET { [_printInfo setPaperName: nil]; } //Write orientation if ([paperOrientationMatrix selectedColumn] == 0) { [_printInfo setOrientation: NSPortraitOrientation]; } else { [_printInfo setOrientation: NSLandscapeOrientation]; } //Write scaling and don't forget to convert from percent scaleNumber = [NSNumber numberWithDouble: [scaleTextField doubleValue]/100.0]; [[_printInfo dictionary] setObject: scaleNumber forKey: NSPrintScalingFactor]; NSDebugLLog(@"NSPageLayout", @"writePrintInfo: %@", [[_printInfo dictionary] description]); } //NSTextField delegate handlers -(void) textDidBeginEditing:(NSNotification*) notification { NSDebugLLog(@"NSPageLayout", @"textDidBeginEditing: %@", [notification description]); } -(void) textDidEndEditing:(NSNotification*) notification { NSDebugLLog(@"NSPageLayout", @"textDidEndEditing: %@", [notification description]); } -(void) textDidChange:(NSNotification*) notification { NSDebugLLog(@"NSPageLayout", @"textDidChange: %@", [notification description]); } -(void) controlTextDidChange:(NSNotification*) notification { NSDebugLLog(@"NSPageLayout", @"controlTextDidChange: %@", [notification description]); } //NSTableView datasource handlers -(NSInteger) numberOfRowsInTableView:(NSTableView*) tableView { if (tableView == customPaperTableView) { return [customPapers count]; } else //summaryTableView { return 8; } } -(id) tableView: (NSTableView*) tableView objectValueForTableColumn: (NSTableColumn*) tableColumn row: (NSInteger) index { if (tableView == customPaperTableView) { return [[customPapers allKeys] objectAtIndex: index]; } else //summaryTableView { if (tableColumn == summarySettingColumn) { switch(index) { case 0: return _(@"Name"); case 1: return _(@"Dimensions"); case 2: return _(@"Orientation"); case 3: return _(@"Scale"); case 4: return _(@"Top Margin"); case 5: return _(@"Bottom Margin"); case 6: return _(@"Left Margin"); case 7: return _(@"Right Margin"); default: return _(@"Unknown"); } } else //The value column { //These vars are used to calculate the margins NSString *printerName; NSPrinter *printer; NSString *paperName; double topMargin, bottomMargin, leftMargin, rightMargin; printerName = [printerPopUp titleOfSelectedItem]; printer = [NSPrinter printerWithName: printerName]; if ([paperRadioMatrix selectedRow] == 0) //standard papers { NSRect imageRect; NSSize paperSize; paperName = [standardPaperSizePopUp titleOfSelectedItem]; paperSize = [printer pageSizeForPaper: paperName]; imageRect = [printer imageRectForPaper: paperName]; topMargin = paperSize.height - imageRect.size.height; bottomMargin = imageRect.origin.x; leftMargin = imageRect.origin.y; rightMargin = paperSize.width - imageRect.size.width; } else //Custom Papers { paperName = [customPaperSizePopUp titleOfSelectedItem]; topMargin = [[customPapers objectForKey: @"TopMargin"] doubleValue]; bottomMargin = [[customPapers objectForKey: @"BottomMargin"] doubleValue]; leftMargin = [[customPapers objectForKey: @"LeftMargin"] doubleValue]; rightMargin = [[customPapers objectForKey: @"RightMargin"] doubleValue]; } switch(index) { case 0: return paperName; case 1: return [dimensionsTextField stringValue]; case 2: if ([paperOrientationMatrix selectedColumn] == 0) { return _(@"Portrait"); } else { return _(@"Landscape") ; } case 3: return [NSString stringWithFormat: @"%@%%", [scaleTextField stringValue]]; case 4: return [NSString stringWithFormat: @"%.2f %@", topMargin, measurementString]; case 5: return [NSString stringWithFormat: @"%.2f %@", bottomMargin, measurementString]; case 6: return [NSString stringWithFormat: @"%.2f %@", leftMargin, measurementString]; case 7: return [NSString stringWithFormat: @"%.2f %@", rightMargin, measurementString]; default: return _(@"Unknown"); } } } } //NSTabView delegate handler we care about -(void) tabView: (NSTabView*) tabView willSelectTabViewItem: (NSTabViewItem*) tabViewItem { if (tabViewItem == summaryTabViewItem) { [summaryTableView sizeToFit]; } } @end // // Show the preview of the page's dimensions // @implementation GSPageLayoutMiniPageView -(void) setPaperSize: (NSSize) paperSize { _paperSize = paperSize; [self setNeedsDisplay: YES]; } -(void) setMarginsRect: (NSRect) marginsRect { _marginsRect = marginsRect; [self setNeedsDisplay: YES]; } -(void) setDrawsMargins: (BOOL) drawsMargins { _drawsMargins = drawsMargins; [self setNeedsDisplay: YES]; } - (void) drawRect: (NSRect)rect { NSRect bounds; NSRect paper; //the size on the screen NSRect shadow; double ratio; double width, height; NSColor *shadowColor; bounds = [self bounds]; // //Figure out if we we should scale according to the //the width or the height // if (_paperSize.width >= _paperSize.height) { ratio = _paperSize.height/ _paperSize.width; width = bounds.size.width; height = width * ratio; } else { ratio = _paperSize.width / _paperSize.height; height = bounds.size.height; width = height * ratio; } //make the page a bit smaller width *= 0.95; height *= 0.95; paper.origin.x = (bounds.size.width - width) / 2; paper.origin.y = (bounds.size.height - height) / 2; paper.size.width = width; paper.size.height = height; shadow = paper; if ([self isFlipped] == NO) shadow.origin.y -= 2; else shadow.origin.y += 2; shadow.origin.x += 2; //first draw the shadow shadowColor = [[NSColor windowBackgroundColor] shadowWithLevel: 0.5]; [shadowColor set]; [NSBezierPath fillRect: shadow]; //now draw the paper [[NSColor whiteColor] set]; [NSBezierPath fillRect: paper]; [[NSColor blackColor] set]; [NSBezierPath strokeRect: paper]; //Draw the margins? if (_drawsMargins == YES) { NSRect margins; double scale; scale = paper.size.width / _paperSize.width; margins.size.height = (_marginsRect.size.height * scale); margins.size.width = (_marginsRect.size.width * scale); margins.origin.x = paper.origin.x + (_marginsRect.origin.x * scale); margins.origin.y = paper.origin.y + (_marginsRect.origin.y * scale); [[NSColor redColor] set]; [NSBezierPath strokeRect: margins]; } } @end gnustep-gui-0.24.0/Source/NSPopover.m0000664000076500007650000001470112135722444017262 0ustar brains99brains99/* NSPopover.m The popover class Copyright (C) 2013 Free Software Foundation, Inc. Author: Gregory Casamento Date: 2013 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import "AppKit/NSPopover.h" #import "AppKit/NSViewController.h" #import "AppKit/NSView.h" #import "AppKit/NSWindow.h" /* Class */ @implementation NSPopover /* Properties */ - (void) setAnimates: (BOOL)flag { _animates = flag; } - (BOOL) animates { return _animates; } - (void) setAppearance: (NSPopoverAppearance)value { _appearance = value; } - (NSPopoverAppearance) appearance { return _appearance; } - (void) setBehavior: (NSPopoverBehavior)value { _behavior = value; } - (NSPopoverBehavior) behavior { return _behavior; } - (void) setContentSize: (NSSize)value { _contentSize = value; } - (NSSize) contentSize { return _contentSize; } - (void) setContentViewController: (NSViewController *)controller { ASSIGN(_contentViewController, controller); } - (NSViewController *) contentViewController { return _contentViewController; } - (void) setDelegate: (id)value { _delegate = value; } - (id) delegate { return _delegate; } - (void) setPositioningRect: (NSRect)value { _positioningRect = value; } - (NSRect) positioningRect { return _positioningRect; } - (BOOL) isShown { return _shown; } /* Methods */ - (void) close { [_realWindow close]; [_realWindow setDelegate:nil]; } - (IBAction) performClose: (id)sender { [_realWindow performClose:sender]; [_realWindow setDelegate:nil]; } - (void) showRelativeToRect: (NSRect)positioningRect ofView: (NSView *)positioningView preferredEdge: (NSRectEdge)preferredEdge { NSView *view = nil; NSRect screenRect; NSRect windowFrame; NSRect viewFrame; [_contentViewController loadView]; view = [_contentViewController view]; viewFrame = [view frame]; _realWindow = [[NSWindow alloc] initWithContentRect: viewFrame styleMask: NSBorderlessWindowMask backing: NSBackingStoreRetained defer: NO]; screenRect = [[positioningView window] convertRectToScreen:positioningRect]; windowFrame = [_realWindow frame]; windowFrame.origin = screenRect.origin; if(NSMinXEdge == preferredEdge) { windowFrame.origin.y -= viewFrame.size.height; } else if(NSMaxXEdge == preferredEdge) { windowFrame.origin.y += viewFrame.size.height; } else if(NSMinYEdge == preferredEdge) { windowFrame.origin.x -= viewFrame.size.width; } else if(NSMaxYEdge == preferredEdge) { windowFrame.origin.x += viewFrame.size.width; } [_realWindow setFrame: windowFrame display: YES]; NSLog(@"Showing relative to in window %@",NSStringFromRect(positioningRect)); NSLog(@"Showing relative to in screen %@",NSStringFromRect(screenRect)); // [_realWindow setBackgroundColor:[NSColor clearColor]]; // [_realWindow setOpaque:NO]; // [_realWindow setLevel:NSFloatingWindowLevel]; // [_realWindow setAlphaValue:0.0]; [[_realWindow contentView] addSubview: view]; [_realWindow setDelegate: self]; [_realWindow makeKeyAndOrderFront:self]; } - (BOOL) windowShouldClose: (id)sender { return [_delegate popoverShouldClose:self]; } - (void) windowDidClose: (NSNotification *)notification { [[NSNotificationCenter defaultCenter] postNotificationName:NSPopoverDidCloseNotification object:self userInfo:nil]; } - (void) windowWillClose: (NSNotification *)notification { [[NSNotificationCenter defaultCenter] postNotificationName:NSPopoverWillCloseNotification object:self userInfo:nil]; } - (id) initWithCoder: (NSCoder *)coder { if (nil != (self = [super initWithCoder:coder])) { if (YES == [coder allowsKeyedCoding]) { _appearance = [coder decodeIntForKey: @"NSAppearance"]; _behavior = [coder decodeIntForKey: @"NSBehavior"]; _animates = [coder decodeBoolForKey: @"NSAnimates"]; _contentSize.width = [coder decodeDoubleForKey: @"NSContentWidth"]; _contentSize.height = [coder decodeDoubleForKey: @"NSContentHeight"]; [self setContentViewController:[coder decodeObjectForKey:@"NSContentViewController"]]; } else { [coder decodeValueOfObjCType: @encode(NSInteger) at: &_appearance]; [coder decodeValueOfObjCType: @encode(NSInteger) at: &_behavior]; [coder decodeValueOfObjCType: @encode(BOOL) at: &_animates]; [coder decodeValueOfObjCType: @encode(CGFloat) at: &_contentSize.width]; [coder decodeValueOfObjCType: @encode(CGFloat) at: &_contentSize.height]; [self setContentViewController:[coder decodeObject]]; } } return self; } - (void) encodeWithCoder: (NSCoder *)coder { [super encodeWithCoder:coder]; if (YES == [coder allowsKeyedCoding]) { [coder encodeInt: _appearance forKey: @"NSAppearance"]; [coder encodeInt: _behavior forKey: @"NSBehavior"]; [coder encodeBool: _animates forKey: @"NSAnimates"]; [coder encodeDouble: _contentSize.width forKey: @"NSContentWidth"]; [coder encodeDouble: _contentSize.height forKey: @"NSContentHeight"]; [coder encodeObject:_contentViewController forKey:@"NSContentViewController"]; } else { [coder encodeValueOfObjCType: @encode(NSInteger) at: &_appearance]; [coder encodeValueOfObjCType: @encode(NSInteger) at: &_behavior]; [coder encodeValueOfObjCType: @encode(BOOL) at: &_animates]; [coder encodeValueOfObjCType: @encode(CGFloat) at: &_contentSize.width]; [coder encodeValueOfObjCType: @encode(CGFloat) at: &_contentSize.height]; [coder encodeObject:_contentViewController]; } } @end gnustep-gui-0.24.0/Source/NSEvent.m0000664000076500007650000010353012121417516016704 0ustar brains99brains99/** NSEvent The event class Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Author: Ovidiu Predescu Date: 1996 Author: Felipe A. Rodriguez Date: Sept 1998 Updated: Richard Frith-Macdonald Date: June 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import #import #import #import #import #import #import #import #import "AppKit/NSEvent.h" #import "AppKit/NSApplication.h" #import "AppKit/NSWindow.h" #import "AppKit/NSGraphicsContext.h" #import "AppKit/NSGraphics.h" #import "AppKit/PSOperators.h" #import "GNUstepGUI/GSDisplayServer.h" /* * gstep-base has a faster mechanism to get the current thread. */ #ifndef GNUSTEP_BASE_LIBRARY #define GSCurrentThread() [NSThread currentThread] #define GSCurrentThreadDictionary() [[NSThread currentThread] threadDictionary] #endif @implementation NSEvent /* * Class variables */ static NSString *timerKey = @"NSEventTimersKey"; static Class dateClass; static Class eventClass; /* * Class methods */ + (void) initialize { if (self == [NSEvent class]) { [self setVersion: 3]; dateClass = [NSDate class]; eventClass = [NSEvent class]; } } /* * Creating NSEvent objects */ + (NSEvent*) enterExitEventWithType: (NSEventType)type location: (NSPoint)location modifierFlags: (NSUInteger)flags timestamp: (NSTimeInterval)time windowNumber: (NSInteger)windowNum context: (NSGraphicsContext*)context eventNumber: (NSInteger)eventNum trackingNumber: (NSInteger)trackingNum userData: (void *)userData { NSEvent *e; if (type == NSCursorUpdate) RETAIN((id)userData); else if ((type != NSMouseEntered) && (type != NSMouseExited)) [NSException raise: NSInvalidArgumentException format: @"enterExitEvent with wrong type"]; e = (NSEvent*)NSAllocateObject(self, 0, NSDefaultMallocZone()); if (self != eventClass) e = [e init]; AUTORELEASE(e); e->event_type = type; e->location_point = location; e->modifier_flags = flags; e->event_time = time; e->window_num = windowNum; e->event_context = context; e->event_data.tracking.event_num = eventNum; e->event_data.tracking.tracking_num = trackingNum; e->event_data.tracking.user_data = userData; return e; } + (NSEvent*) keyEventWithType: (NSEventType)type location: (NSPoint)location modifierFlags: (NSUInteger)flags timestamp: (NSTimeInterval)time windowNumber: (NSInteger)windowNum context: (NSGraphicsContext *)context characters: (NSString *)keys charactersIgnoringModifiers: (NSString *)ukeys isARepeat: (BOOL)repeatKey keyCode: (unsigned short)code { NSEvent *e; if (!(NSEventMaskFromType(type) & GSKeyEventMask)) [NSException raise: NSInvalidArgumentException format: @"keyEvent with wrong type"]; e = (NSEvent*)NSAllocateObject(self, 0, NSDefaultMallocZone()); if (self != eventClass) e = [e init]; AUTORELEASE(e); e->event_type = type; e->location_point = location; e->modifier_flags = flags; e->event_time = time; e->window_num = windowNum; e->event_context = context; RETAIN(keys); e->event_data.key.char_keys = keys; RETAIN(ukeys); e->event_data.key.unmodified_keys = ukeys; e->event_data.key.repeat = repeatKey; e->event_data.key.key_code = code; return e; } + (NSEvent*) mouseEventWithType: (NSEventType)type location: (NSPoint)location modifierFlags: (NSUInteger)flags timestamp: (NSTimeInterval)time windowNumber: (NSInteger)windowNum context: (NSGraphicsContext*)context eventNumber: (NSInteger)eventNum clickCount: (NSInteger)clickNum pressure: (float)pressureValue { NSEvent *e; if (!(NSEventMaskFromType(type) & GSMouseEventMask)) [NSException raise: NSInvalidArgumentException format: @"mouseEvent with wrong type"]; e = (NSEvent*)NSAllocateObject(self, 0, NSDefaultMallocZone()); if (self != eventClass) e = [e init]; AUTORELEASE(e); e->event_type = type; e->location_point = location; e->modifier_flags = flags; e->event_time = time; e->window_num = windowNum; e->event_context = context; e->event_data.mouse.event_num = eventNum; e->event_data.mouse.click = clickNum; e->event_data.mouse.pressure = pressureValue; return e; } + (NSEvent*) mouseEventWithType: (NSEventType)type location: (NSPoint)location modifierFlags: (NSUInteger)flags timestamp: (NSTimeInterval)time windowNumber: (NSInteger)windowNum context: (NSGraphicsContext*)context eventNumber: (NSInteger)eventNum clickCount: (NSInteger)clickNum pressure: (float)pressureValue buttonNumber: (NSInteger)buttonNum deltaX: (CGFloat)deltaX deltaY: (CGFloat)deltaY deltaZ: (CGFloat)deltaZ { NSEvent *e; if (!(NSEventMaskFromType(type) & GSMouseEventMask)) [NSException raise: NSInvalidArgumentException format: @"mouseEvent with wrong type"]; e = (NSEvent*)NSAllocateObject(self, 0, NSDefaultMallocZone()); if (self != eventClass) e = [e init]; AUTORELEASE(e); e->event_type = type; e->location_point = location; e->modifier_flags = flags; e->event_time = time; e->window_num = windowNum; e->event_context = context; e->event_data.mouse.event_num = eventNum; e->event_data.mouse.click = clickNum; e->event_data.mouse.button = buttonNum; e->event_data.mouse.pressure = pressureValue; e->event_data.mouse.deltaX = deltaX; e->event_data.mouse.deltaY = deltaY; e->event_data.mouse.deltaZ = deltaZ; return e; } /** * Returns the current mouse location. */ + (NSPoint) mouseLocation { return [GSCurrentServer() mouselocation]; } + (NSEvent*) otherEventWithType: (NSEventType)type location: (NSPoint)location modifierFlags: (NSUInteger)flags timestamp: (NSTimeInterval)time windowNumber: (NSInteger)windowNum context: (NSGraphicsContext*)context subtype: (short)subType data1: (NSInteger)data1 data2: (NSInteger)data2 { NSEvent *e; if (!(NSEventMaskFromType(type) & GSOtherEventMask)) [NSException raise: NSInvalidArgumentException format: @"otherEvent with wrong type"]; e = (NSEvent*)NSAllocateObject(self, 0, NSDefaultMallocZone()); if (self != eventClass) e = [e init]; AUTORELEASE(e); e->event_type = type; e->location_point = location; e->modifier_flags = flags; e->event_time = time; e->window_num = windowNum; e->event_context = context; e->event_data.misc.sub_type = subType; e->event_data.misc.data1 = data1; e->event_data.misc.data2 = data2; return e; } /* * Requesting Periodic Events */ + (void) startPeriodicEventsAfterDelay: (NSTimeInterval)delaySeconds withPeriod: (NSTimeInterval)periodSeconds { NSTimer *timer; NSMutableDictionary *dict = GSCurrentThreadDictionary(); NSDebugLLog (@"NSEvent", @"startPeriodicEventsAfterDelay: withPeriod: "); if ([dict objectForKey: timerKey]) [NSException raise: NSInternalInconsistencyException format: @"Periodic events are already being generated for " @"this thread %x", GSCurrentThread()]; /* * Register a timer that will fire in delaySeconds. * This timer will fire the first event and register * a repeat timer that will send the following events */ timer = [NSTimer timerWithTimeInterval: delaySeconds target: self selector: @selector(_registerRealTimer:) userInfo: [NSNumber numberWithDouble: periodSeconds] repeats: NO]; [[NSRunLoop currentRunLoop] addTimer: timer forMode: NSEventTrackingRunLoopMode]; [dict setObject: timer forKey: timerKey]; } + (void) _timerFired: (NSTimer*)timer { NSTimeInterval timeInterval; NSEvent *periodicEvent; timeInterval = [dateClass timeIntervalSinceReferenceDate]; periodicEvent = [self otherEventWithType: NSPeriodic location: NSZeroPoint modifierFlags: 0 timestamp: timeInterval windowNumber: 0 context: [NSApp context] subtype: 0 data1: 0 data2: 0]; NSDebugLLog (@"NSEvent", @"_timerFired: "); [NSApp postEvent: periodicEvent atStart: NO]; } /* * This method provides a means of delaying the start of periodic events */ + (void) _registerRealTimer: (NSTimer*)timer { NSTimer *realTimer; NSMutableDictionary *dict = GSCurrentThreadDictionary(); NSDebugLLog (@"NSEvent", @"_registerRealTimer: "); { NSTimeInterval timeInterval; NSEvent *periodicEvent; timeInterval = [dateClass timeIntervalSinceReferenceDate]; periodicEvent = [self otherEventWithType: NSPeriodic location: NSZeroPoint modifierFlags: 0 timestamp: timeInterval windowNumber: 0 context: [NSApp context] subtype: 0 data1: 0 data2: 0]; [NSApp postEvent: periodicEvent atStart: NO]; } realTimer = [NSTimer timerWithTimeInterval: [[timer userInfo] doubleValue] target: self selector: @selector(_timerFired:) userInfo: nil repeats: YES]; [dict setObject: realTimer forKey: timerKey]; [[NSRunLoop currentRunLoop] addTimer: realTimer forMode: NSEventTrackingRunLoopMode]; } + (void) stopPeriodicEvents { NSTimer *timer; NSMutableDictionary *dict = GSCurrentThreadDictionary(); NSDebugLLog (@"NSEvent", @"stopPeriodicEvents"); timer = [dict objectForKey: timerKey]; [timer invalidate]; [dict removeObjectForKey: timerKey]; } /** * Returns the button number for the mouse button pressed in a mouse * event. Intended primarily for the case where a mouse has three or * more buttons, and you want to know which button an 'other' mouse * event refers to. */ - (NSInteger) buttonNumber { if (!(NSEventMaskFromType(event_type) & GSMouseEventMask)) { [NSException raise: NSInternalInconsistencyException format: @"buttonNumber requested for non-mouse event"]; } return event_data.mouse.button; } /** * Returns the string of characters for a keyboard event. *
Raises an NSInternalInconsistencyException if applied to any * other type of event. */ - (NSString *) characters { if ((event_type != NSKeyUp) && (event_type != NSKeyDown)) { [NSException raise: NSInternalInconsistencyException format: @"characters requested for non-keyboard event"]; } return event_data.key.char_keys; } /** * Returns the string of characters for a keyboard event, as if no modifier * keys had been pressed when the keyboard event occirred. *
Raises an NSInternalInconsistencyException if applied to any * other type of event. */ - (NSString *) charactersIgnoringModifiers { if ((event_type != NSKeyUp) && (event_type != NSKeyDown)) { [NSException raise: NSInternalInconsistencyException format: @"charactersIgnoringModifiers requested for " @"non-keyboard event"]; } return event_data.key.unmodified_keys; } /** * Return the number of clicks associated with the mouse down or up * event. This method is not applicable for any event type other * than a mouse down or mouse up. *
Raises an NSInternalInconsistencyException if applied to any * other type of event. */ - (NSInteger) clickCount { /* Make sure it is one of the right event types */ if (!(NSEventMaskFromType(event_type) & GSMouseEventMask)) { [NSException raise: NSInternalInconsistencyException format: @"clickCount requested for non-mouse event"]; } return event_data.mouse.click; } /** * Returns the graphics context for which this event was generated. */ - (NSGraphicsContext*) context { return event_context; } - (id) copyWithZone: (NSZone*)zone { NSEvent *e = (NSEvent*)NSCopyObject (self, 0, zone); if ((NSEventMaskFromType(event_type) & GSKeyEventMask)) { event_data.key.char_keys = [event_data.key.char_keys copyWithZone: zone]; event_data.key.unmodified_keys = [event_data.key.unmodified_keys copyWithZone: zone]; } else if (event_type == NSCursorUpdate) { event_data.tracking.user_data = (void *)[(id)event_data.tracking.user_data copyWithZone: zone]; } return e; } /** * Returns the 'data1' item associated with the event. *
Raises NSInternalInconsistencyException if the event is not * of type NSAppKitDefined, NSSystemDefined, NSApplicationDefined, * or NSPeriodic */ - (NSInteger) data1 { if (event_type < NSAppKitDefined || event_type > NSPeriodic) { [NSException raise: NSInternalInconsistencyException format: @"data1 requested for invalid event type"]; } return event_data.misc.data1; } /** * Returns the 'data2' item associated with the event. *
Raises NSInternalInconsistencyException if the event is not * of type NSAppKitDefined, NSSystemDefined, NSApplicationDefined, * or NSPeriodic */ - (NSInteger) data2 { if (event_type < NSAppKitDefined || event_type > NSPeriodic) { [NSException raise: NSInternalInconsistencyException format: @"data2 requested for invalid event type"]; } return event_data.misc.data2; } - (void) dealloc { if ((NSEventMaskFromType(event_type) & GSKeyEventMask)) { RELEASE(event_data.key.char_keys); RELEASE(event_data.key.unmodified_keys); } else if (event_type == NSCursorUpdate) { RELEASE((id)event_data.tracking.user_data); } [super dealloc]; } /**

Returns the movement of the mouse on the X axis.

This method is only valid for NSMouseMoved, NS*MouseDragged and NSScrollWheel events, otherwise it will return 0.

*/ - (CGFloat) deltaX { if (!(NSEventMaskFromType(event_type) & GSMouseMovedEventMask)) { return 0.0; } return event_data.mouse.deltaX; } /**

Returns the movement of the mouse on the Y axis.

This method is only valid for NSMouseMoved, NS*MouseDragged and NSScrollWheel events, otherwise it will return 0.

*/ - (CGFloat) deltaY { if (!(NSEventMaskFromType(event_type) & GSMouseMovedEventMask)) { return 0.0; } return event_data.mouse.deltaY; } /**

Returns the movement of the mouse on the Z axis.

This method is only valid for NSMouseMoved, NS*MouseDragged and NSScrollWheel events, otherwise it will return 0.

The value returned is 0.0 in most cases.

*/ - (CGFloat) deltaZ { if (!(NSEventMaskFromType(event_type) & GSMouseMovedEventMask)) { return 0.0; } return event_data.mouse.deltaZ; } - (NSString*) description { static const char *eventTypes[] = { "nullEvent", "leftMouseDown", "leftMouseUp", "rightMouseDown", "rightMouseUp", "mouseMoved", "leftMouseDragged", "rightMouseDragged", "mouseEntered", "mouseExited", "keyDown", "keyUp", "flagsChanged", "appKitDefined", "systemDefined", "applicationDefined", "periodic", "cursorUpdate", "", "", "", "", "scrollWheel", "tabletPoint", "tabletProximity", "otherMouseDown", "otherMouseUp", "otherMouseDragged" }; switch (event_type) { case NSLeftMouseDown: case NSLeftMouseUp: case NSOtherMouseDown: case NSOtherMouseUp: case NSRightMouseDown: case NSRightMouseUp: return [NSString stringWithFormat: @"NSEvent: eventType = %s, point = { %f, %f }, modifiers = %u," @" time = %f, window = %d, dpsContext = %p," @" event number = %d, click = %d, pressure = %f", eventTypes[event_type], location_point.x, location_point.y, modifier_flags, event_time, window_num, event_context, event_data.mouse.event_num, event_data.mouse.click, event_data.mouse.pressure]; break; case NSMouseEntered: case NSMouseExited: return [NSString stringWithFormat: @"NSEvent: eventType = %s, point = { %f, %f }, modifiers = %u," @" time = %f, window = %d, dpsContext = %p, " @" event number = %d, tracking number = %d, user data = %p", eventTypes[event_type], location_point.x, location_point.y, modifier_flags, event_time, window_num, event_context, event_data.tracking.event_num, event_data.tracking.tracking_num, event_data.tracking.user_data]; break; case NSKeyDown: case NSKeyUp: case NSFlagsChanged: return [NSString stringWithFormat: @"NSEvent: eventType = %s, point = { %f, %f }, modifiers = %u," @" time = %f, window = %d, dpsContext = %p, " @" repeat = %s, keys = %@, ukeys = %@, keyCode = 0x%x", eventTypes[event_type], location_point.x, location_point.y, modifier_flags, event_time, window_num, event_context, (event_data.key.repeat ? "YES" : "NO"), event_data.key.char_keys, event_data.key.unmodified_keys, event_data.key.key_code]; break; case NSPeriodic: case NSCursorUpdate: case NSAppKitDefined: case NSSystemDefined: case NSApplicationDefined: return [NSString stringWithFormat: @"NSEvent: eventType = %s, point = { %f, %f }, modifiers = %u," @" time = %f, window = %d, dpsContext = %p, " @" subtype = %d, data1 = %p, data2 = %p", eventTypes[event_type], location_point.x, location_point.y, modifier_flags, event_time, window_num, event_context, event_data.misc.sub_type, event_data.misc.data1, event_data.misc.data2]; break; case NSScrollWheel: case NSMouseMoved: case NSLeftMouseDragged: case NSOtherMouseDragged: case NSRightMouseDragged: return [NSString stringWithFormat: @"NSEvent: eventType = %s, point = { %f, %f }, modifiers = %u," @" time = %f, window = %d, dpsContext = %p," @" event number = %d, click = %d, pressure = %f" @" button = %d, deltaX = %f, deltaY = %f, deltaZ = %f", eventTypes[event_type], location_point.x, location_point.y, modifier_flags, event_time, window_num, event_context, event_data.mouse.event_num, event_data.mouse.click, event_data.mouse.pressure, event_data.mouse.button, event_data.mouse.deltaX, event_data.mouse.deltaY, event_data.mouse.deltaZ]; break; // FIXME: Tablet events case NSTabletPoint: case NSTabletProximity: break; default: return [NSString stringWithFormat: @"NSEvent: eventType = UNKNOWN!, point = { %f, %f }, modifiers = %u," @" time = %f, window = %d", location_point.x, location_point.y, modifier_flags, event_time, window_num]; break; } return [super description]; } - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { // FIXME } else { [aCoder encodeValueOfObjCType: @encode(NSInteger) at: &event_type]; [aCoder encodePoint: location_point]; [aCoder encodeValueOfObjCType: @encode(NSUInteger) at: &modifier_flags]; [aCoder encodeValueOfObjCType: @encode(NSTimeInterval) at: &event_time]; [aCoder encodeValueOfObjCType: @encode(NSInteger) at: &window_num]; switch (event_type) { case NSLeftMouseDown: case NSLeftMouseUp: case NSOtherMouseDown: case NSOtherMouseUp: case NSRightMouseDown: case NSRightMouseUp: case NSScrollWheel: case NSMouseMoved: case NSLeftMouseDragged: case NSOtherMouseDragged: case NSRightMouseDragged: [aCoder encodeValuesOfObjCTypes: "iififff", &event_data.mouse.event_num, &event_data.mouse.click, &event_data.mouse.pressure, &event_data.mouse.button, &event_data.mouse.deltaX, &event_data.mouse.deltaY, &event_data.mouse.deltaZ]; break; 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]; break; case NSKeyDown: case NSKeyUp: case NSFlagsChanged: [aCoder encodeValueOfObjCType: @encode(BOOL) at: &event_data.key.repeat]; [aCoder encodeObject: event_data.key.char_keys]; [aCoder encodeObject: event_data.key.unmodified_keys]; [aCoder encodeValueOfObjCType: "S" at: &event_data.key.key_code]; break; case NSPeriodic: case NSAppKitDefined: case NSSystemDefined: case NSApplicationDefined: [aCoder encodeValuesOfObjCTypes: "sii", &event_data.misc.sub_type, &event_data.misc.data1, &event_data.misc.data2]; break; case NSTabletPoint: case NSTabletProximity: // FIXME: Tablet events break; } } } /** * Returns the event number associated with any mouse event or tracking * event. Event numbers are allocated sequentially when the system * creates these events. *
Raises an NSInternalInconsistencyException if applied to any * other type of event. */ - (NSInteger) eventNumber { /* Make sure it is one of the right event types */ if (!(NSEventMaskFromType(event_type) & GSMouseEventMask) && !(NSEventMaskFromType(event_type) & GSEnterExitEventMask)) [NSException raise: NSInternalInconsistencyException format: @"eventNumber requested for non-tracking event"]; if ((event_type == NSMouseEntered) || (event_type == NSMouseExited)) return event_data.tracking.event_num; else return event_data.mouse.event_num; } - (id) initWithCoder: (NSCoder*)aDecoder { if ([aDecoder allowsKeyedCoding]) { // FIXME } else { int version = [aDecoder versionForClassName: @"NSEvent"]; [aDecoder decodeValueOfObjCType: @encode(NSInteger) at: &event_type]; location_point = [aDecoder decodePoint]; [aDecoder decodeValueOfObjCType: @encode(NSUInteger) at: &modifier_flags]; [aDecoder decodeValueOfObjCType: @encode(NSTimeInterval) at: &event_time]; [aDecoder decodeValueOfObjCType: @encode(NSInteger) at: &window_num]; if (version == 1) { // For the unlikely case that old events have been stored, convert them. switch ((int)event_type) { case 0: event_type = NSLeftMouseDown; break; case 1: event_type = NSLeftMouseUp; break; case 2: event_type = NSOtherMouseDown; break; case 3: event_type = NSOtherMouseUp; break; case 4: event_type = NSRightMouseDown; break; case 5: event_type = NSRightMouseUp; break; case 6: event_type = NSMouseMoved; break; case 7: event_type = NSLeftMouseDragged; break; case 8: event_type = NSOtherMouseDragged; break; case 9: event_type = NSRightMouseDragged; break; case 10: event_type = NSMouseEntered; break; case 11: event_type = NSMouseExited; break; case 12: event_type = NSKeyDown; break; case 13: event_type = NSKeyUp; break; case 14: event_type = NSFlagsChanged; break; case 15: event_type = NSAppKitDefined; break; case 16: event_type = NSSystemDefined; break; case 17: event_type = NSApplicationDefined; break; case 18: event_type = NSPeriodic; break; case 19: event_type = NSCursorUpdate; break; case 20: event_type = NSScrollWheel; break; default: break; } } // Previously flag change events where encoded wrongly if ((version == 2) && (event_type == NSFlagsChanged)) { [aDecoder decodeValuesOfObjCTypes: "sii", &event_data.misc.sub_type, &event_data.misc.data1, &event_data.misc.data2]; return self; } // Decode the event date based upon the event type switch (event_type) { case NSLeftMouseDown: case NSLeftMouseUp: case NSOtherMouseDown: case NSOtherMouseUp: case NSRightMouseDown: case NSRightMouseUp: case NSScrollWheel: case NSMouseMoved: case NSLeftMouseDragged: case NSOtherMouseDragged: case NSRightMouseDragged: [aDecoder decodeValuesOfObjCTypes: "iififff", &event_data.mouse.event_num, &event_data.mouse.click, &event_data.mouse.pressure, &event_data.mouse.button, &event_data.mouse.deltaX, &event_data.mouse.deltaY, &event_data.mouse.deltaZ]; break; 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]; break; case NSKeyDown: case NSKeyUp: case NSFlagsChanged: [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &event_data.key.repeat]; event_data.key.char_keys = [aDecoder decodeObject]; event_data.key.unmodified_keys = [aDecoder decodeObject]; [aDecoder decodeValueOfObjCType: "S" at: &event_data.key.key_code]; break; case NSPeriodic: case NSAppKitDefined: case NSSystemDefined: case NSApplicationDefined: [aDecoder decodeValuesOfObjCTypes: "sii", &event_data.misc.sub_type, &event_data.misc.data1, &event_data.misc.data2]; break; case NSTabletPoint: case NSTabletProximity: // FIXME: Tablet events break; } } return self; } /** * Returns a flag to say if this is a keyboard repeat event. *
Raises an NSInternalInconsistencyException if applied to any * other type of event than an NSKeyUp or NSKeyDown. */ - (BOOL) isARepeat { if ((event_type != NSKeyUp) && (event_type != NSKeyDown)) [NSException raise: NSInternalInconsistencyException format: @"isARepeat requested for non-keyboard event"]; return event_data.key.repeat; } /** * Returns the numeric key code of a keyboard event. *
Raises an NSInternalInconsistencyException if applied to any * other type of event than an NSKeyUp or NSKeyDown. */ - (unsigned short) keyCode { if (!(NSEventMaskFromType(event_type) & GSKeyEventMask)) { [NSException raise: NSInternalInconsistencyException format: @"keyCode requested for non-keyboard event"]; } return event_data.key.key_code; } /** * Returns the window location for which this event was generated (in the * base coordinate system of the window). */ - (NSPoint) locationInWindow { return location_point; } /** * Returns the modifier flag bits associated with the event. */ - (NSUInteger) modifierFlags { return modifier_flags; } /** * Returns the pressure associated with a mouse event. This is a value * in the range 0.0 to 1.0 and for mormal mouse events should be set to * one of those extremes. This is used by pressure sensitive input devices. *
Raises an NSInternalInconsistencyException if applied to any * other type of event than a mouse event. */ - (float) pressure { /* Make sure it is one of the right event types */ if (!(NSEventMaskFromType(event_type) & GSMouseEventMask)) { [NSException raise: NSInternalInconsistencyException format: @"pressure requested for non-mouse event"]; } return event_data.mouse.pressure; } /** * Returns the 'subtype' item associated with the event. *
Raises NSInternalInconsistencyException if the event is not * of type NSAppKitDefined, NSSystemDefined, NSApplicationDefined, * NSPeriodic or a mouve event. */ - (short) subtype { if (!(NSEventMaskFromType(event_type) & GSOtherEventMask) && !(NSEventMaskFromType(event_type) & GSMouseEventMask)) { [NSException raise: NSInternalInconsistencyException format: @"subtype requested for invalid event type"]; } if (NSEventMaskFromType(event_type) & GSOtherEventMask) return event_data.misc.sub_type; else { if (event_type == NSTabletPoint) return NSTabletPointEventSubtype; else if (event_type == NSTabletProximity) return NSTabletProximityEventSubtype; else return NSMouseEventSubtype; } } /** * Returns the time interval since system startup at which this * event was generated. */ - (NSTimeInterval) timestamp { return event_time; } /** * Returns a number identifying the tracking rectangle entered or exited. *
Raises an NSInternalInconsistencyException if applied to any * other type of event than a mouse entered or exited event. */ - (NSInteger) trackingNumber { if (event_type != NSMouseEntered && event_type != NSMouseExited && event_type != NSCursorUpdate) { [NSException raise: NSInternalInconsistencyException format: @"trackingNumber requested for non-tracking event"]; } return event_data.tracking.tracking_num; } /** * returns the type of this event. */ - (NSEventType) type { return event_type; } /** * Returns usder data associated with a tracking event... the data assigned to * the tracking rectangle concerned when it was created.. *
Raises an NSInternalInconsistencyException if applied to any * other type of event than a mouse entered or exited event. */ - (void *) userData { if (event_type != NSMouseEntered && event_type != NSMouseExited && event_type != NSCursorUpdate) { [NSException raise: NSInternalInconsistencyException format: @"userData requested for non-tracking event"]; } return event_data.tracking.user_data; } /** * Returns the window for which this event was generated.
* Periodic events have no associated window, and you should not call * this method for those events. */ - (NSWindow *) window { return GSWindowWithNumber(window_num); } /** * Returns the window number of the window for which this event was generated. *
Periodic events have no associated window, and you should not call * this method for those events. */ - (NSInteger) windowNumber { return window_num; } /* * Methods for tablet events */ - (NSInteger) absoluteX { // FIXME return 0; } - (NSInteger) absoluteY { // FIXME return 0; } - (NSInteger) absoluteZ { // FIXME return 0; } - (NSUInteger) buttonMask { // FIXME return 0; } - (NSUInteger) capabilityMask { // FIXME return 0; } - (NSUInteger) deviceID { // FIXME return 0; } - (BOOL) isEnteringProximity { // FIXME return NO; } - (NSUInteger) pointingDeviceID { // FIXME return 0; } - (NSUInteger) pointingDeviceSerialNumber { // FIXME return 0; } - (NSPointingDeviceType) pointingDeviceType { // FIXME return NSUnknownPointingDevice; } - (float) rotation { // FIXME return 0.0; } - (NSUInteger) systemTabletID { // FIXME return 0; } - (NSUInteger) tabletID { // FIXME return 0; } - (float) tangentialPressure { // FIXME return 0.0; } - (NSPoint) tilt { // FIXME return NSMakePoint(0.0, 0.0); } - (unsigned long long) uniqueID { // FIXME return 0; } - (id) vendorDefined { // FIXME return nil; } - (NSUInteger) vendorID { // FIXME return 0; } - (NSUInteger) vendorPointingDeviceType { // FIXME return 0; } @end gnustep-gui-0.24.0/Source/GSToolbarCustomizationPalette.m0000664000076500007650000002541211661536371023341 0ustar brains99brains99/* GSToolbarCustomizationPalette.m The palette which allows to customize toolbar Copyright (C) 2007 Free Software Foundation, Inc. Author: Quentin Mathe Date: January 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import "AppKit/NSNibLoading.h" #import "AppKit/NSWindow.h" #import "AppKit/NSToolbar.h" #import "AppKit/NSToolbarItem.h" #import "AppKit/NSPopUpButton.h" #import "NSToolbarFrameworkPrivate.h" #import "GSToolbarCustomizationPalette.h" #define DEBUG_LEVEL @"Toolbar" /* Customization View */ @interface GSToolbarCustomizationView : NSView { NSArray *_paletteItems; } - (void) setToolbarItems: (NSArray *)items; - (NSArray *) paletteItemsWithToolbarItems: (NSArray *)items; - (void) layout; @end @implementation GSToolbarCustomizationView - (void)dealloc { [_paletteItems release]; [super dealloc]; } /* If the toolbar item has a custom view and the item is in use in the toolbar, this view has already a superview. We need to make a copy of it in order to be able to put it in the customization view. As a safety measure, we make a copy of all toolbar items, thereby of all views. This ensures the toolbar items displayed in the palette don't reference a toolbar. */ - (NSArray *) paletteItemsWithToolbarItems: (NSArray *)items { NSMutableArray *paletteItems = [NSMutableArray array]; NSEnumerator *e = [items objectEnumerator]; NSToolbarItem *item = nil; while ((item = [e nextObject]) != nil) { NSToolbarItem *newItem = [item copy]; if ([newItem paletteLabel] != nil) [newItem setLabel: [newItem paletteLabel]]; [newItem setEnabled: YES]; [newItem _layout]; [paletteItems addObject: newItem]; RELEASE(newItem); } NSDebugLLog(DEBUG_LEVEL, @"Generated palette items %@ from toolbar items %@", paletteItems, items); return paletteItems; } - (void) layout { NSSize boundsSize = [self bounds].size; float maxWidth = boundsSize.width; float maxHeight = boundsSize.height; float hAccumulator = 0.0; float vAccumulator = 0.0; NSEnumerator *e = [[self subviews] objectEnumerator]; NSView *layoutedView = nil; int index = 0; // Loop over all subviews while ((layoutedView = [e nextObject]) != nil) { NSRect frame; NSSize size; float height; float width; [(id)layoutedView layout]; frame = [layoutedView frame]; size = frame.size; height = size.height; width = size.width; if ((hAccumulator + width) <= maxWidth) { // Position view in row if (vAccumulator < height) { vAccumulator = height; // FIXME: need to adjust all other elements of row } } else { // Move on to next row maxHeight -= vAccumulator; hAccumulator = 0.0; vAccumulator = height; } [layoutedView setFrameOrigin: NSMakePoint(hAccumulator, maxHeight - vAccumulator)]; [layoutedView setAutoresizingMask:NSViewMinYMargin]; hAccumulator += width; index++; } maxHeight -= vAccumulator; // adjust for final row if (maxHeight != 0) // need to grow (or shrink) the window to accommodate more (or fewer) items { NSRect windowFrame = [[self window] frame]; windowFrame.origin.y += maxHeight; windowFrame.size.height -= maxHeight; [[self window] setFrame:windowFrame display:NO]; } } - (void) setToolbarItems: (NSArray *)items { NSEnumerator *e; NSView *itemView; NSToolbarItem *item; [_paletteItems release]; _paletteItems = [[self paletteItemsWithToolbarItems: items] retain]; // Remove all old subviews e = [[self subviews] objectEnumerator]; while ((itemView = [e nextObject]) != nil) { [itemView removeFromSuperview]; } NSDebugLLog(DEBUG_LEVEL, @"Will insert the views of toolbar items %@ in \ customization view", _paletteItems); e = [_paletteItems objectEnumerator]; while ((item = [e nextObject]) != nil) { itemView = [item _backView]; if (itemView != nil) { [self addSubview: itemView]; } else { NSLog(@"Toolbar item %@ will not be visible in the customization \ view or if you insert it in a toolbar now. The view is already in \ use in superview or does not implement NSCoding protocol", item); } } [self layout]; } @end /* Main implementation */ @implementation GSToolbarCustomizationPalette + (id) palette { return AUTORELEASE([[GSToolbarCustomizationPalette alloc] init]); } - (id) init { self = [super init]; if (self != nil) { BOOL nibLoaded = [NSBundle loadNibNamed: @"GSToolbarCustomizationPalette" owner: self]; if (nibLoaded == NO) { NSLog(@"Failed to load GSToolbarCustomizationPalette"); RELEASE(self); return nil; } _allowedItems = [NSMutableArray new]; _defaultItems = [NSMutableArray new]; } return self; } - (void) dealloc { NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; [nc removeObserver: self]; // DESTROY(_customizationWindow); // DESTROY(_customizationView); // DESTROY(_defaultTemplateView); // DESTROY(_sizeCheckBox); // DESTROY(_displayPopup); // DESTROY(_doneButton); DESTROY(_defaultItems); DESTROY(_allowedItems); [super dealloc]; } - (void) awakeFromNib { NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; NSDebugLLog(DEBUG_LEVEL, @"GSToolbarCustomizationPalette awaking from nib"); [_defaultTemplateView setAutoresizingMask:NSViewWidthSizable | NSViewMaxYMargin]; { NSRect dtvFrame; NSRect cvFrame; // for now, _defaultTemplateView isn't implemented, so remove it dtvFrame = [_defaultTemplateView frame]; [_defaultTemplateView removeFromSuperview]; // expand _customizationView to fill the space cvFrame = [_customizationView frame]; cvFrame.size.height += dtvFrame.size.height; cvFrame.origin.y -= dtvFrame.size.height; [_customizationView setFrame:cvFrame]; } [nc addObserver: self selector: @selector(paletteDidEnd:) name: NSWindowWillCloseNotification object: _customizationWindow]; } /* It's safer to keep no reference on the toolbar itself. The customization palette isn't bound to the toolbar passed as parameter, in other words the palette can be used to customize other toolbars with the same identifier. In spite of this, a reference must be kept on the toolbar which initiated the customization to let it know when the customization has ended. */ - (void) showForToolbar: (NSToolbar *)toolbar { NSArray *itemIdentifiers = nil; NSEnumerator *e = nil; NSString *identifier = nil; NSToolbarDisplayMode tag = [toolbar displayMode]; NSToolbarSizeMode size = [toolbar sizeMode]; NSView *toolbarView; NSRect toolbarFrame; NSPoint bottomCenter; NSRect windowFrame; NSPoint topCenter; [_allowedItems removeAllObjects]; [_defaultItems removeAllObjects]; [_displayPopup selectItemWithTag: tag]; // Set toolbar size checkbox... if(size == NSToolbarSizeModeSmall) { [_sizeCheckBox setState: NSOnState]; } else { [_sizeCheckBox setState: NSOffState]; } itemIdentifiers = [toolbar _allowedItemIdentifiers]; e = [itemIdentifiers objectEnumerator]; while ((identifier = [e nextObject]) != nil) { NSToolbarItem *item = [toolbar _toolbarItemForIdentifier: identifier willBeInsertedIntoToolbar: NO]; NSLog(@"item %@ for ident %@", item, identifier); [_allowedItems addObject: item]; } itemIdentifiers = [toolbar _defaultItemIdentifiers]; e = [itemIdentifiers objectEnumerator]; while ((identifier = [e nextObject]) != nil) { NSToolbarItem *item = [toolbar _toolbarItemForIdentifier: identifier willBeInsertedIntoToolbar: NO]; [_defaultItems addObject: item]; } [_customizationView setToolbarItems: _allowedItems]; /* We retain ourself to keep us alive until the palette is closed (this is useful in case nobody retains us). */ RETAIN(self); /* No need to retain the toolbar because it will first request us to close when it goes away. */ _toolbar = toolbar; // position the customization window centered just below the toolbar toolbarView = [_toolbar _toolbarView]; toolbarFrame = [toolbarView convertRect:[toolbarView bounds] toView:nil]; bottomCenter = NSMakePoint(toolbarFrame.origin.x + (toolbarFrame.size.width/2), toolbarFrame.origin.y); bottomCenter = [[toolbarView window] convertBaseToScreen:bottomCenter]; windowFrame = [_customizationWindow frame]; topCenter = NSMakePoint(windowFrame.origin.x + (windowFrame.size.width/2), windowFrame.origin.y + windowFrame.size.height); windowFrame.origin.x += bottomCenter.x-topCenter.x; windowFrame.origin.y += bottomCenter.y-topCenter.y; [_customizationWindow setFrame:windowFrame display:NO]; [_customizationWindow setLevel:NSFloatingWindowLevel]; [_customizationWindow makeKeyAndOrderFront: self]; } - (void) close { [_customizationWindow close]; } - (void) reset: (id) sender { // reset the toolbar to it's defaults. [_toolbar _resetConfig]; } - (void) size: (id) sender { NSToolbarSizeMode mode = NSToolbarSizeModeRegular; if([sender state] == NSOnState) { mode = NSToolbarSizeModeSmall; } [_toolbar setSizeMode: mode]; [_toolbar _saveConfig]; } - (void) paletteDidEnd: (NSNotification *)notif { [_toolbar _setCustomizationPaletteIsRunning: NO]; _toolbar = nil; /* We can now get rid safely of the extra retain done in -showForToolbar: */ RELEASE(self); } - (void) show: (id) sender { NSToolbarDisplayMode displayMode = (NSToolbarDisplayMode) [[sender selectedItem] tag]; [_toolbar setDisplayMode: displayMode]; [_toolbar _saveConfig]; } @end gnustep-gui-0.24.0/Source/NSButtonCell.m0000664000076500007650000016023512227306115017702 0ustar brains99brains99/** NSButtonCell The button cell class Copyright (C) 1996-1999 Free Software Foundation, Inc. Author: Scott Christley Ovidiu Predescu Date: 1996 Author: Felipe A. Rodriguez Date: August 1998 Modified: Richard Frith-Macdonald This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import #import #import #import #import #import #import "AppKit/AppKitExceptions.h" #import "AppKit/NSApplication.h" #import "AppKit/NSBezierPath.h" #import "AppKit/NSButtonCell.h" #import "AppKit/NSButton.h" #import "AppKit/NSColor.h" #import "AppKit/NSEvent.h" #import "AppKit/NSFont.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSImage.h" #import "AppKit/NSSound.h" #import "AppKit/NSStringDrawing.h" #import "AppKit/NSWindow.h" #import "GNUstepGUI/GSTheme.h" #import "GNUstepGUI/GSNibLoading.h" #import "GSGuiPrivate.h" #include typedef struct _GSButtonCellFlags { #if GS_WORDS_BIGENDIAN == 1 unsigned int isPushin:1; unsigned int changeContents:1; unsigned int changeBackground:1; unsigned int changeGray:1; unsigned int highlightByContents:1; unsigned int highlightByBackground:1; unsigned int highlightByGray:1; unsigned int drawing:1; unsigned int isBordered:1; unsigned int imageDoesOverlap:1; unsigned int isHorizontal:1; unsigned int isBottomOrLeft:1; unsigned int isImageAndText:1; unsigned int isImageSizeDiff:1; unsigned int hasKeyEquiv:1; unsigned int lastState:1; unsigned int isTransparent:1; unsigned int unused1:6; // inset:2 doesn't dim:1 gradient:3 unsigned int useButtonImageSource:1; unsigned int unused2:8; // alt mnemonic loc. #else unsigned int unused2:8; // alt mnemonic loc. unsigned int useButtonImageSource:1; unsigned int unused1:6; // inset:2 doesn't dim:1 gradient:3 unsigned int isTransparent:1; unsigned int lastState:1; unsigned int hasKeyEquiv:1; unsigned int isImageSizeDiff:1; unsigned int isImageAndText:1; unsigned int isBottomOrLeft:1; unsigned int isHorizontal:1; unsigned int imageDoesOverlap:1; unsigned int isBordered:1; unsigned int drawing:1; unsigned int highlightByGray:1; unsigned int highlightByBackground:1; unsigned int highlightByContents:1; unsigned int changeGray:1; unsigned int changeBackground:1; unsigned int changeContents:1; unsigned int isPushin:1; #endif } GSButtonCellFlags; @interface NSCell (Private) - (NSSize) _scaleImageWithSize: (NSSize)imageSize toFitInSize: (NSSize)canvasSize scalingType: (NSImageScaling)scalingType; @end /**

TODO Description

*/ @implementation NSButtonCell /* * Class methods */ + (void) initialize { if (self == [NSButtonCell class]) [self setVersion: 3]; } /* * Instance methods */ - (id) _init { // Implicitly performed by allocation: // //_buttoncell_is_transparent = NO; [self setAlignment: NSCenterTextAlignment]; _cell.is_bordered = YES; [self setButtonType: NSMomentaryPushInButton]; _delayInterval = 0.4; _repeatInterval = 0.075; _keyEquivalentModifierMask = 0; _keyEquivalent = @""; _altContents = @""; _gradient_type = NSGradientNone; [self setImageScaling: NSImageScaleNone]; return self; } - (id) init { self = [self initTextCell: @"Button"]; return self; } - (id) initImageCell: (NSImage*)anImage { self = [super initImageCell: anImage]; if (!self) return nil; return [self _init]; } - (id) initTextCell: (NSString*)aString { self = [super initTextCell: aString]; if (!self) return nil; return [self _init]; } - (void) dealloc { RELEASE(_altContents); RELEASE(_altImage); RELEASE(_keyEquivalent); RELEASE(_keyEquivalentFont); RELEASE(_sound); RELEASE(_backgroundColor); [super dealloc]; } /** *

The GNUstep implementation does nothing here * (to match the Mac OS X behavior) because with * NSButtonCell GNUstep implementation the cell type is bound to the image * position. We implemented this behavior because it permits to have * -setFont: -setTitle -setImage: methods which are symetrical by not altering * directly the cell type and to validate the fact that the cell type is more * characterized by the potential visibility of the image (which is under the * control of the method -setImagePosition:) than by the value of the image * ivar itself (related to -setImage: method). * On Mac OS X, the NSButtonCell cell type is NSTextCellType by default or * NSImageCellType if the initialization has been done with -initImageCell:, * it should be noted that the cell type never changes later.

*/ - (void) setType: (NSCellType)aType { } /**

Returns the NSButtonCell's title.

*/ - (NSString*) title { if (nil == _contents) { return @""; } if (_cell.contents_is_attributed_string == NO) { // If we have a formatter this is also the string of the _object_value return (NSString *)_contents; } else { return [(NSAttributedString *)_contents string]; } } /**

Returns the NSButtonCell's alternate title ( used when highlighted ).

See Also: -setAlternateTitle:

*/ - (NSString*) alternateTitle { if (_altContents != nil) { return _altContents; } else { return @""; } } - (NSInteger) cellAttribute: (NSCellAttribute)aParameter { NSInteger value = 0; switch (aParameter) { case NSPushInCell: if (_highlightsByMask & NSPushInCellMask) value = 1; break; case NSChangeGrayCell: if (_showAltStateMask & NSChangeGrayCellMask) value = 1; break; case NSCellLightsByGray: if (_highlightsByMask & NSChangeGrayCellMask) value = 1; break; case NSChangeBackgroundCell: if (_showAltStateMask & NSChangeBackgroundCellMask) value = 1; break; case NSCellLightsByBackground: if (_highlightsByMask & NSChangeBackgroundCellMask) value = 1; break; case NSCellChangesContents: if (_showAltStateMask & NSContentsCellMask) value = 1; break; case NSCellLightsByContents: if (_highlightsByMask & NSContentsCellMask) value = 1; break; default: value = [super cellAttribute: aParameter]; break; } return value; } - (void) setCellAttribute: (NSCellAttribute)aParameter to: (NSInteger)value { switch (aParameter) { case NSPushInCell: if (value) _highlightsByMask |= NSPushInCellMask; else _highlightsByMask &= ~NSPushInCellMask; break; case NSChangeGrayCell: if (value) _showAltStateMask |= NSChangeGrayCellMask; else _showAltStateMask &= ~NSChangeGrayCellMask; break; case NSChangeBackgroundCell: if (value) _showAltStateMask |= NSChangeBackgroundCellMask; else _showAltStateMask &= ~NSChangeBackgroundCellMask; break; case NSCellChangesContents: if (value) _showAltStateMask |= NSContentsCellMask; else _showAltStateMask &= ~NSContentsCellMask; break; case NSCellLightsByGray: if (value) _highlightsByMask |= NSChangeGrayCellMask; else _highlightsByMask &= ~NSChangeGrayCellMask; break; case NSCellLightsByBackground: if (value) _highlightsByMask |= NSChangeBackgroundCellMask; else _highlightsByMask &= ~NSChangeBackgroundCellMask; break; case NSCellLightsByContents: if (value) _highlightsByMask |= NSContentsCellMask; else _highlightsByMask &= ~NSContentsCellMask; break; default: [super setCellAttribute: aParameter to: value]; } } /**

Sets the NSButtonCell's font to fontObject. The key equivalent font size is changed to match the fontObject if needed.

See Also: [NSCell-font] -keyEquivalentFont -setKeyEquivalentFont: -setKeyEquivalentFont:size:

*/ - (void) setFont: (NSFont*)fontObject { int size; [super setFont: fontObject]; if ((_keyEquivalentFont != nil) && (fontObject != nil) && ((size = [fontObject pointSize]) != [_keyEquivalentFont pointSize])) { [self setKeyEquivalentFont: [_keyEquivalentFont fontName] size: size]; } } /**

Sets the NSButtonCell's title to aString.

*/ - (void) setTitle: (NSString*)aString { ASSIGNCOPY(_contents, aString); _cell.contents_is_attributed_string = NO; if (_control_view) { if ([_control_view isKindOfClass: [NSControl class]]) { [(NSControl*)_control_view updateCell: self]; } } } /**

Sets the NSButtonCell's alternate title ( used when highlighted ) to aString and update the cell if it contains a NSControl view.

See Also: -alternateTitle

*/ - (void) setAlternateTitle: (NSString*)aString { ASSIGNCOPY(_altContents, aString); if (_control_view) { if ([_control_view isKindOfClass: [NSControl class]]) { [(NSControl*)_control_view updateCell: self]; } } } - (NSAttributedString *)attributedAlternateTitle { // TODO NSDictionary *dict; NSAttributedString *attrStr; dict = [self _nonAutoreleasedTypingAttributes]; attrStr = [[NSAttributedString alloc] initWithString: [self alternateTitle] attributes: dict]; RELEASE(dict); return AUTORELEASE(attrStr); } - (void)setAttributedAlternateTitle:(NSAttributedString *)aString { // TODO [self setAlternateTitle: [aString string]]; } - (NSAttributedString *)attributedTitle { if (_cell.contents_is_attributed_string && nil != _contents) { return (NSAttributedString *)_contents; } else { NSDictionary *dict; NSAttributedString *attrStr; dict = [self _nonAutoreleasedTypingAttributes]; attrStr = [[NSAttributedString alloc] initWithString: [self title] attributes: dict]; RELEASE(dict); return AUTORELEASE(attrStr); } } - (void)setAttributedTitle:(NSAttributedString *)aString { ASSIGNCOPY(_contents, aString); _cell.contents_is_attributed_string = YES; if (_control_view) { if ([_control_view isKindOfClass: [NSControl class]]) { [(NSControl*)_control_view updateCell: self]; } } } - (void)setTitleWithMnemonic:(NSString *)aString { // TODO [super setTitleWithMnemonic: aString]; } - (NSString *)alternateMnemonic { // TODO return @""; } - (NSUInteger)alternateMnemonicLocation { // TODO return NSNotFound; } - (void)setAlternateMnemonicLocation:(NSUInteger)location { // TODO } - (void)setAlternateTitleWithMnemonic:(NSString *)aString { NSUInteger location = [aString rangeOfString: @"&"].location; [self setAlternateTitle: [aString stringByReplacingString: @"&" withString: @""]]; // TODO: We should underline this character [self setAlternateMnemonicLocation: location]; } /**

Returns the NSButtonCell's alternate image.

See Also: -setAlternateImage:

*/ - (NSImage*) alternateImage { return _altImage; } /**

Returns the NSButtonCell's image position. See NSCellImagePosition for more information.

See Also: -setImagePosition:

*/ - (NSCellImagePosition) imagePosition { return _cell.image_position; } - (NSImageScaling) imageScaling { return _imageScaling; } - (void) setImageScaling: (NSImageScaling)scaling { _imageScaling = scaling; } - (void) setImage: (NSImage *)anImage { if (_cell.image_position == NSNoImage) { [self setImagePosition: NSImageOnly]; } [super setImage: anImage]; } /**

Sets the NSButtonCell's alternate image to anImage.

See Also: -alternateImage

*/ - (void) setAlternateImage: (NSImage*)anImage { ASSIGN(_altImage, anImage); if (_control_view) { if ([_control_view isKindOfClass: [NSControl class]]) { [(NSControl*)_control_view updateCell: self]; } } } /**

Sets the image position. The GNUstep implementation depends only on the image position. If the image position is set to NSNoImage then the type is set to NSTextCellType, to NSImageCellType otherwise

See Also: -imagePosition

*/ - (void) setImagePosition: (NSCellImagePosition)aPosition { _cell.image_position = aPosition; // In the GNUstep NSButtonCell implementation, the cell type depends only on // the image position. /* NOTE: We set the cell type attribute directly here instead of calling NSCell's -setType: method because it may change the title or image of the button cell. This is to make our implementation compatible with the behavior of Mac OS X, which does not change the cell's type and hence does not involve any of the side effects of -setType: either. */ if (_cell.image_position == NSNoImage) { _cell.type = NSTextCellType; } else { _cell.type = NSImageCellType; } if (_control_view) { if ([_control_view isKindOfClass: [NSControl class]]) { [(NSControl*)_control_view updateCell: self]; } } } /**

Gets the NSButtonCell's delay and the interval parameters used when NSButton sends continouly action messages. By default delay is 0.4 and interval is 0.075.

See Also: -setPeriodicDelay:interval: [NSCell-trackMouse:inRect:ofView:untilMouseUp:]

*/ - (void) getPeriodicDelay: (float*)delay interval: (float*)interval { *delay = _delayInterval; *interval = _repeatInterval; } /**

Sets the NSButtonCell's delay and interval parameters used when NSButton sends continouly action messages. By default delay is 0.4 and interval is 0.075.

See Also: -getPeriodicDelay:interval: [NSCell-trackMouse:inRect:ofView:untilMouseUp:]

*/ - (void) setPeriodicDelay: (float)delay interval: (float)interval { _delayInterval = delay; _repeatInterval = interval; } /**

Returns the NSButtonCell's key equivalent. The key equivalent and its modifier mask are used to simulate the click of the button in [NSButton-performKeyEquivalent:]. Returns an empty string if no key equivalent is defined. By default NSButtonCell hasn't key equivalent.

See Also: -setKeyEquivalent: [NSButton-performKeyEquivalent:] -keyEquivalentModifierMask [NSButtonCell-keyEquivalent]

*/ - (NSString*) keyEquivalent { if (nil == _keyEquivalent) { return @""; } else { return _keyEquivalent; } } /**

Returns the NSFont of the key equivalent.

*

See Also: -setKeyEquivalentFont:

*/ - (NSFont*) keyEquivalentFont { return _keyEquivalentFont; } /**

Returns the modifier mask of the NSButtonCell's key equivalent. The key equivalent and its modifier mask are used to simulate the click of the button in [NSButton-performKeyEquivalent:]. The default mask is 0.

See Also: -setKeyEquivalentModifierMask: -keyEquivalent [NSButton-performKeyEquivalent:]

*/ - (NSUInteger) keyEquivalentModifierMask { return _keyEquivalentModifierMask; } /**

Sets the NSButtonCell's key equivalent to key. The key equivalent and its modifier mask are used to simulate the click of the button in [NSButton-performKeyEquivalent:]. By default NSButton hasn't key equivalent.

See Also: -keyEquivalent -setKeyEquivalentModifierMask: [NSButton-performKeyEquivalent:]

*/ - (void) setKeyEquivalent: (NSString*)key { [[GSTheme theme] setKeyEquivalent: key forButtonCell: self]; ASSIGNCOPY(_keyEquivalent, key); } /**

Sets the modifier mask of the NSButtonCell's key equivalent to mask. The key equivalent and its modifier mask are used to simulate the click of the button in [NSButton-performKeyEquivalent:]. By default the mask is 0.

See Also: -keyEquivalentModifierMask -setKeyEquivalent: [NSButton-performKeyEquivalent:]

*/ - (void) setKeyEquivalentModifierMask: (NSUInteger)mask { _keyEquivalentModifierMask = mask; } /**

Sets the NSFont of the key equivalent to fontObject.

*

See Also: -keyEquivalentFont -setFont:

*/ - (void) setKeyEquivalentFont: (NSFont*)fontObj { ASSIGN(_keyEquivalentFont, fontObj); } /**

Sets the NSFont with size fontSize of the key equivalent to fontName.

See Also: -keyEquivalentFont -setKeyEquivalentFont: -setFont:

*/ - (void) setKeyEquivalentFont: (NSString*)fontName size: (float)fontSize { ASSIGN(_keyEquivalentFont, [NSFont fontWithName: fontName size: fontSize]); } /**

Returns whether the button cell is transparent.

See Also: -setTransparent:

*/ - (BOOL) isTransparent { return _buttoncell_is_transparent; } /**

Sets whether the button cell is transparent.

See Also: -isTransparent

*/ - (void) setTransparent: (BOOL)flag { _buttoncell_is_transparent = flag; } /**

Returns whether the NSButtonCell is opaque. Currently always returns NO

*/ - (BOOL) isOpaque { // May not be opaque, due to themes return NO; // return !_buttoncell_is_transparent && _cell.is_bordered && // _bezel_style == 0; } - (NSBezelStyle) bezelStyle { return _bezel_style; } - (void) setBezelStyle: (NSBezelStyle)bezelStyle { _bezel_style = bezelStyle; } - (BOOL) showsBorderOnlyWhileMouseInside { return _shows_border_only_while_mouse_inside; } - (void) setShowsBorderOnlyWhileMouseInside: (BOOL)show { if (_shows_border_only_while_mouse_inside == show) { return; } _shows_border_only_while_mouse_inside = show; // FIXME Switch mouse tracking on } - (NSGradientType) gradientType { return _gradient_type; } - (void) setGradientType: (NSGradientType)gradientType { _gradient_type = gradientType; } - (BOOL) imageDimsWhenDisabled { return _image_dims_when_disabled; } - (void) setImageDimsWhenDisabled:(BOOL)flag { _image_dims_when_disabled = flag; } /**

Returns a mask describing how the button cell is highlighted :

NSNoCellMask, NSContentsCellMask,NSPushInCellMask,NSChangeGrayCellMask, NSChangeBackgroundCellMask

See Also : -setHighlightsBy:

*/ - (NSInteger) highlightsBy { return _highlightsByMask; } /**

Sets a mask describing how the button cell is highlighted :

NSNoCellMask, NSContentsCellMask,NSPushInCellMask,NSChangeGrayCellMask, NSChangeBackgroundCellMask

See Also : -highlightsBy

*/ - (void) setHighlightsBy: (NSInteger)mask { _highlightsByMask = mask; } - (void) setShowsStateBy: (NSInteger)mask { _showAltStateMask = mask; } - (void) setButtonType: (NSButtonType)buttonType { // Don't store the button type anywhere switch (buttonType) { case NSMomentaryLightButton: [self setHighlightsBy: NSChangeBackgroundCellMask]; [self setShowsStateBy: NSNoCellMask]; [self setImageDimsWhenDisabled: YES]; break; case NSMomentaryPushInButton: [self setHighlightsBy: NSPushInCellMask | NSChangeGrayCellMask]; [self setShowsStateBy: NSNoCellMask]; [self setImageDimsWhenDisabled: YES]; break; case NSMomentaryChangeButton: [self setHighlightsBy: NSContentsCellMask]; [self setShowsStateBy: NSNoCellMask]; [self setImageDimsWhenDisabled: YES]; break; case NSPushOnPushOffButton: [self setHighlightsBy: NSPushInCellMask | NSChangeGrayCellMask]; [self setShowsStateBy: NSChangeBackgroundCellMask]; [self setImageDimsWhenDisabled: YES]; break; case NSOnOffButton: [self setHighlightsBy: NSChangeBackgroundCellMask]; [self setShowsStateBy: NSChangeBackgroundCellMask]; [self setImageDimsWhenDisabled: YES]; break; case NSToggleButton: [self setHighlightsBy: NSPushInCellMask | NSContentsCellMask]; [self setShowsStateBy: NSContentsCellMask]; [self setImageDimsWhenDisabled: YES]; break; case NSSwitchButton: [self setHighlightsBy: NSContentsCellMask]; [self setShowsStateBy: NSContentsCellMask]; [self setImage: [NSImage imageNamed: @"NSSwitch"]]; [self setAlternateImage: [NSImage imageNamed: @"NSHighlightedSwitch"]]; [self setImagePosition: NSImageLeft]; [self setAlignment: NSLeftTextAlignment]; [self setBordered: NO]; [self setBezeled: NO]; [self setImageDimsWhenDisabled: NO]; break; case NSRadioButton: [self setHighlightsBy: NSContentsCellMask]; [self setShowsStateBy: NSContentsCellMask]; [self setImage: [NSImage imageNamed: @"NSRadioButton"]]; [self setAlternateImage: [NSImage imageNamed: @"NSHighlightedRadioButton"]]; [self setImagePosition: NSImageLeft]; [self setAlignment: NSLeftTextAlignment]; [self setBordered: NO]; [self setBezeled: NO]; [self setImageDimsWhenDisabled: NO]; break; } } - (NSInteger) showsStateBy { return _showAltStateMask; } - (void) setIntValue: (int)anInt { [self setState: (anInt != 0)]; } - (void) setFloatValue: (float)aFloat { [self setState: (aFloat != 0)]; } - (void) setDoubleValue: (double)aDouble { [self setState: (aDouble != 0)]; } - (int) intValue { return _cell.state; } - (float) floatValue { return _cell.state; } - (double) doubleValue { return _cell.state; } - (void) setObjectValue: (id)object { if (object == nil) { [self setState: NSOffState]; } else if ([object respondsToSelector: @selector(intValue)]) { [self setState: [object intValue]]; } else { [self setState: NSOnState]; } } - (id) objectValue { if (_cell.state == NSOffState) { return [NSNumber numberWithBool: NO]; } else if (_cell.state == NSOnState) { return [NSNumber numberWithBool: YES]; } else // NSMixedState { return [NSNumber numberWithInt: -1]; } } - (void) setStringValue: (NSString *)aString { [self setState: ([aString length] != 0)]; } - (NSString *) stringValue { return _cell.state ? @"1" : @""; } - (void) setAttributedStringValue: (NSAttributedString *)attrString { [self setState: ([attrString length] != 0)]; } - (NSAttributedString *) attributedStringValue { return AUTORELEASE([[NSAttributedString alloc] initWithString: [self stringValue]]); } /* * Displaying */ - (NSColor*) textColor { if (_cell.is_disabled == YES) return [NSColor disabledControlTextColor]; if ((_cell.state && (_showAltStateMask & NSChangeGrayCellMask)) || (_cell.is_highlighted && (_highlightsByMask & NSChangeGrayCellMask))) return [NSColor selectedControlTextColor]; return [NSColor controlTextColor]; } - (NSColor *) backgroundColor { return _backgroundColor; } - (void) setBackgroundColor: (NSColor *)color { ASSIGN(_backgroundColor, color); } - (GSThemeControlState) themeControlState { unsigned mask; GSThemeControlState buttonState = GSThemeNormalState; // set the mask if (_cell.is_highlighted) { mask = _highlightsByMask; if (_cell.state) { mask &= ~_showAltStateMask; } } else if (_cell.state) mask = _showAltStateMask; else mask = NSNoCellMask; /* Determine the background color. We draw when there is a border or when highlightsByMask is NSChangeBackgroundCellMask or NSChangeGrayCellMask, as required by our nextstep-like look and feel. */ if (mask & (NSChangeGrayCellMask | NSChangeBackgroundCellMask)) { buttonState = GSThemeHighlightedState; } /* Pushed in buttons contents are displaced to the bottom right 1px. */ if (mask & NSPushInCellMask) { buttonState = GSThemeSelectedState; } if (_cell.is_disabled && buttonState != GSThemeHighlightedState) { buttonState = GSThemeDisabledState; } /* If we are first responder, change to the corresponding first responder state. Note that GSThemeDisabledState doesn't have a first responder variant, currently. */ if (_cell.shows_first_responder && [[[self controlView] window] firstResponder] == [self controlView] && [self controlView] != nil) { if (buttonState == GSThemeSelectedState) buttonState = GSThemeSelectedFirstResponderState; else if (buttonState == GSThemeHighlightedState) buttonState = GSThemeHighlightedFirstResponderState; else if (buttonState == GSThemeNormalState) buttonState = GSThemeFirstResponderState; } return buttonState; } - (void) drawBezelWithFrame: (NSRect)cellFrame inView: (NSView *)controlView { GSThemeControlState buttonState = [self themeControlState]; [[GSTheme theme] drawButton: cellFrame in: self view: controlView style: _bezel_style state: buttonState]; } - (void) drawImage: (NSImage*)imageToDisplay withFrame: (NSRect)cellFrame inView: (NSView*)controlView { // Draw image if (imageToDisplay != nil) { NSPoint offset; NSRect rect; CGFloat fraction; NSSize size = [self _scaleImageWithSize: [imageToDisplay size] toFitInSize: cellFrame.size scalingType: _imageScaling]; /* Pixel-align size */ if (controlView) { NSSize sizeInBase = [controlView convertSizeToBase: size]; sizeInBase.width = GSRoundTowardsInfinity(sizeInBase.width); sizeInBase.height = GSRoundTowardsInfinity(sizeInBase.height); size = [controlView convertSizeFromBase: sizeInBase]; } /* Calculate an offset from the cellFrame origin */ offset = NSMakePoint((NSWidth(cellFrame) - size.width) / 2.0, (NSHeight(cellFrame) - size.height) / 2.0); /* Pixel-align the offset */ if (controlView) { NSPoint inBase = [controlView convertPointToBase: offset]; // By convention we will round down and to the right. // With the standard button design this looks good // because the bottom and right edges of the button look 'heavier' // so if the image's center must be offset from the button's geometric // center, it looks beter if it's closer to the 'heavier' part inBase.x = GSRoundTowardsInfinity(inBase.x); inBase.y = [controlView isFlipped] ? GSRoundTowardsInfinity(inBase.y) : GSRoundTowardsNegativeInfinity(inBase.y); offset = [controlView convertPointFromBase: inBase]; } /* Draw the image */ rect = NSMakeRect(cellFrame.origin.x + offset.x, cellFrame.origin.y + offset.y, size.width, size.height); fraction = (![self isEnabled] && [self imageDimsWhenDisabled]) ? 0.5 : 1.0; [imageToDisplay drawInRect: rect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: fraction respectFlipped: YES hints: nil]; } } - (void) drawTitle: (NSAttributedString*)titleToDisplay withFrame: (NSRect)cellFrame inView: (NSView*)controlView { [self _drawAttributedText: titleToDisplay inFrame: cellFrame]; } // Private helper method overridden in subclasses - (void) _drawBorderAndBackgroundWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { /* The background color is used for borderless cells (the MacOS-X * documentation of the NSButtonCell -backgroundColor method says * it's only used for borderless cells). */ if (!_cell.is_bordered) { NSColor *c = [self backgroundColor]; if (c != nil) { [c set]; NSRectFill(cellFrame); } } // Draw gradient if (!_cell.is_highlighted) { [[GSTheme theme] drawGradientBorder: _gradient_type inRect: cellFrame withClip: NSZeroRect]; } // The inside check could also be done via a track rect, but then this would // only work with specially prepared controls. Therefore we dont use // _mouse_inside here. if ((_cell.is_bordered) && (!_shows_border_only_while_mouse_inside || [controlView mouse: [[controlView window] mouseLocationOutsideOfEventStream] inRect: cellFrame])) { [self drawBezelWithFrame: cellFrame inView: controlView]; } } - (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { unsigned mask; NSImage *imageToDisplay; NSRect imageRect; NSAttributedString *titleToDisplay; NSRect titleRect; NSSize imageSize = {0, 0}; NSSize titleSize = {0, 0}; BOOL flippedView = [controlView isFlipped]; NSCellImagePosition ipos = _cell.image_position; // transparent buttons never draw if (_buttoncell_is_transparent) return; _control_view = controlView; cellFrame = [self drawingRectForBounds: cellFrame]; if (_cell.is_highlighted) { mask = _highlightsByMask; if (_cell.state) mask &= ~_showAltStateMask; } else if (_cell.state) mask = _showAltStateMask; else mask = NSNoCellMask; /* * Determine the image and the title that will be * displayed. If the NSContentsCellMask is set the * image and title are swapped only if state is 1 or * if highlighting is set (when a button is pushed it's * content is changed to the face of reversed state). */ if (mask & NSContentsCellMask) { imageToDisplay = _altImage; if (!imageToDisplay) { imageToDisplay = _cell_image; } titleToDisplay = [self attributedAlternateTitle]; if (titleToDisplay == nil || [titleToDisplay length] == 0) { titleToDisplay = [self attributedTitle]; } } else { imageToDisplay = _cell_image; titleToDisplay = [self attributedTitle]; } if (imageToDisplay && ipos != NSNoImage) { imageSize = [imageToDisplay size]; } else { // When there is no image to display, ignore it in the calculations imageToDisplay = nil; ipos = NSNoImage; } if (titleToDisplay && ipos != NSImageOnly) { titleSize = [titleToDisplay size]; } else { // When there is no text to display, ignore it in the calculations titleToDisplay = nil; ipos = NSImageOnly; } if (flippedView == YES) { if (ipos == NSImageAbove) { ipos = NSImageBelow; } else if (ipos == NSImageBelow) { ipos = NSImageAbove; } } /* The size calculations here should be changed very carefully, and _must_ be kept in sync with -cellSize. Changing the calculations to require more space isn't OK; this breaks interfaces designed using the old sizes by clipping away parts of the title. The current size calculations ensure that for bordered or bezeled cells, there's always at least a three point margin between the size returned by -cellSize and the minimum size required not to clip text. (In other words, the text can become three points wider (due to eg. font mismatches) before you lose the last character.) */ switch (ipos) { default: case NSNoImage: imageToDisplay = nil; titleRect = cellFrame; imageRect = NSZeroRect; if (titleSize.width + 6 <= titleRect.size.width) { titleRect.origin.x += 3; titleRect.size.width -= 6; } break; case NSImageOnly: titleToDisplay = nil; imageRect = cellFrame; titleRect = NSZeroRect; break; case NSImageLeft: imageRect.origin = cellFrame.origin; imageRect.size.width = imageSize.width; imageRect.size.height = cellFrame.size.height; if (_cell.is_bordered || _cell.is_bezeled) { imageRect.origin.x += 3; } titleRect = imageRect; titleRect.origin.x += imageSize.width + GSCellTextImageXDist; titleRect.size.width = NSMaxX(cellFrame) - titleRect.origin.x; if (titleSize.width + 3 <= titleRect.size.width) { titleRect.size.width -= 3; } break; case NSImageRight: imageRect.origin.x = NSMaxX(cellFrame) - imageSize.width; imageRect.origin.y = cellFrame.origin.y; imageRect.size.width = imageSize.width; imageRect.size.height = cellFrame.size.height; if (_cell.is_bordered || _cell.is_bezeled) { imageRect.origin.x -= 3; } titleRect.origin = cellFrame.origin; titleRect.size.width = imageRect.origin.x - titleRect.origin.x - GSCellTextImageXDist; titleRect.size.height = cellFrame.size.height; if (titleSize.width + 3 <= titleRect.size.width) { titleRect.origin.x += 3; titleRect.size.width -= 3; } break; case NSImageAbove: /* * In this case, imageRect is all the space we can allocate * above the text. * The drawing code below will then center the image in imageRect. */ titleRect.origin = cellFrame.origin; titleRect.size.width = cellFrame.size.width; titleRect.size.height = titleSize.height; if (_cell.is_bordered || _cell.is_bezeled) { titleRect.origin.y += 3; } imageRect.origin.x = cellFrame.origin.x; imageRect.origin.y = NSMaxY(titleRect) + GSCellTextImageYDist; imageRect.size.width = cellFrame.size.width; imageRect.size.height = NSMaxY(cellFrame) - imageRect.origin.y; if (_cell.is_bordered || _cell.is_bezeled) { imageRect.size.height -= 3; } if (titleSize.width + 6 <= titleRect.size.width) { titleRect.origin.x += 3; titleRect.size.width -= 6; } break; case NSImageBelow: /* * In this case, imageRect is all the space we can allocate * below the text. * The drawing code below will then center the image in imageRect. */ titleRect.origin.x = cellFrame.origin.x; titleRect.origin.y = NSMaxY(cellFrame) - titleSize.height; titleRect.size.width = cellFrame.size.width; titleRect.size.height = titleSize.height; if (_cell.is_bordered || _cell.is_bezeled) { titleRect.origin.y -= 3; } imageRect.origin.x = cellFrame.origin.x; imageRect.origin.y = cellFrame.origin.y; imageRect.size.width = cellFrame.size.width; imageRect.size.height = titleRect.origin.y - GSCellTextImageYDist - imageRect.origin.y; if (_cell.is_bordered || _cell.is_bezeled) { imageRect.origin.y += 3; imageRect.size.height -= 3; } if (titleSize.width + 6 <= titleRect.size.width) { titleRect.origin.x += 3; titleRect.size.width -= 6; } break; case NSImageOverlaps: imageRect = cellFrame; titleRect = cellFrame; if (titleSize.width + 6 <= titleRect.size.width) { titleRect.origin.x += 3; titleRect.size.width -= 6; } break; } // Draw image if (imageToDisplay != nil) { [self drawImage: imageToDisplay withFrame: imageRect inView: controlView]; } // Draw title if (titleToDisplay != nil) { [self drawTitle: titleToDisplay withFrame: titleRect inView: controlView]; } } - (NSSize) cellSize { NSSize s; GSThemeMargins border; unsigned mask; NSImage *imageToDisplay; NSAttributedString *titleToDisplay; NSSize imageSize = NSZeroSize; NSSize titleSize = NSZeroSize; /* The size calculations here must be kept in sync with -drawInteriorWithFrame. */ if (_cell.is_highlighted) { mask = _highlightsByMask; if (_cell.state) mask &= ~_showAltStateMask; } else if (_cell.state) mask = _showAltStateMask; else mask = NSNoCellMask; if (mask & NSContentsCellMask) { imageToDisplay = _altImage; if (!imageToDisplay) { imageToDisplay = _cell_image; } titleToDisplay = [self attributedAlternateTitle]; if (titleToDisplay == nil || [titleToDisplay length] == 0) { titleToDisplay = [self attributedTitle]; } } else { imageToDisplay = _cell_image; titleToDisplay = [self attributedTitle]; } if (imageToDisplay) { imageSize = [imageToDisplay size]; } if (titleToDisplay != nil) { titleSize = [titleToDisplay size]; } switch (_cell.image_position) { default: case NSNoImage: s = titleSize; break; case NSImageOnly: s = imageSize; break; case NSImageLeft: case NSImageRight: s.width = imageSize.width + titleSize.width + GSCellTextImageXDist; s.height = MAX(imageSize.height, titleSize.height); break; case NSImageBelow: case NSImageAbove: s.width = MAX(imageSize.width, titleSize.width); s.height = imageSize.height + titleSize.height + GSCellTextImageYDist; break; case NSImageOverlaps: s.width = MAX(imageSize.width, titleSize.width); s.height = MAX(imageSize.height, titleSize.height); break; } // Get border size if (_cell.is_bordered) { GSThemeControlState buttonState = GSThemeNormalState; /* Determine the background color. We draw when there is a border or when highlightsByMask is NSChangeBackgroundCellMask or NSChangeGrayCellMask, as required by our nextstep-like look and feel. */ if (mask & (NSChangeGrayCellMask | NSChangeBackgroundCellMask)) { buttonState = GSThemeHighlightedState; } /* Pushed in buttons contents are displaced to the bottom right 1px. */ if (mask & NSPushInCellMask) { buttonState = GSThemeSelectedState; } border = [[GSTheme theme] buttonMarginsForCell: self style: _bezel_style state: buttonState]; } else { border.left = 0; border.top = 0; border.right = 0; border.bottom = 0; } /* Add an additional 6 pixels horizontally so that the text is not * too near the boundaries of the button. Without them, autosized * buttons look too tiny and crammed. This might be made * configurable by the theme, but most likely only because themes * might want to have even more space here (to make buttons more * clear and readable) rather than less! Eg. Apple by default has * huge amounts of empty space between the text and the borders of * their push buttons. */ if ((_cell.is_bordered && (_cell.image_position != NSImageOnly)) || _cell.is_bezeled) { border.left += 6; border.right += 6; } // Add border size s.width += border.left + border.right; s.height += border.top + border.bottom; return s; } - (NSRect) drawingRectForBounds: (NSRect)theRect { if (_cell.is_bordered) { GSThemeMargins border; unsigned mask; GSThemeControlState buttonState = GSThemeNormalState; NSRect interiorFrame; if (_cell.is_highlighted) { mask = _highlightsByMask; if (_cell.state) mask &= ~_showAltStateMask; } else if (_cell.state) mask = _showAltStateMask; else mask = NSNoCellMask; /* Determine the background color. We draw when there is a border or when highlightsByMask is NSChangeBackgroundCellMask or NSChangeGrayCellMask, as required by our nextstep-like look and feel. */ if (mask & (NSChangeGrayCellMask | NSChangeBackgroundCellMask)) { buttonState = GSThemeHighlightedState; } if (mask & NSPushInCellMask) { buttonState = GSThemeSelectedState; } border = [[GSTheme theme] buttonMarginsForCell: self style: _bezel_style state: buttonState]; interiorFrame = theRect; interiorFrame.origin.x += border.left; interiorFrame.size.width -= border.left + border.right; interiorFrame.origin.y += ([_control_view isFlipped] ? border.top : border.bottom); interiorFrame.size.height -= border.bottom + border.top; /* Pushed in buttons contents are displaced to the bottom right 1px. */ if (mask & NSPushInCellMask) { interiorFrame = NSOffsetRect(interiorFrame, 1.0, [_control_view isFlipped] ? 1.0 : -1.0); } return interiorFrame; } else { return theRect; } } - (void) setSound: (NSSound *)aSound { ASSIGN(_sound, aSound); } - (NSSound *) sound { return _sound; } - (void) mouseEntered: (NSEvent *)event { _mouse_inside = YES; [(NSView *)[event userData] setNeedsDisplay: YES]; } - (void) mouseExited: (NSEvent *)event { _mouse_inside = NO; [(NSView *)[event userData] setNeedsDisplay: YES]; } /**Simulates a single mouse click on the button cell. This method overrides the cell method performClickWithFrame:inView: to add the possibility to play a sound associated with the click. */ - (void) performClickWithFrame: (NSRect)cellFrame inView: (NSView *)controlView { if (_sound != nil) { [_sound play]; } [super performClickWithFrame: cellFrame inView: controlView]; } /* * Comparing to Another NSButtonCell */ - (NSComparisonResult) compare: (id)otherCell { if ([otherCell isKindOfClass: [NSButtonCell class]] == NO) { [NSException raise: NSBadComparisonException format: @"NSButtonCell comparison with non-NSButtonCell"]; } return [super compare: otherCell]; } /* * NSCopying protocol */ - (id) copyWithZone: (NSZone*)zone { NSButtonCell *c = [super copyWithZone: zone]; c->_altContents = [_altContents copyWithZone: zone]; _altImage = TEST_RETAIN(_altImage); _keyEquivalent = TEST_RETAIN(_keyEquivalent); _keyEquivalentFont = TEST_RETAIN(_keyEquivalentFont); _sound = TEST_RETAIN(_sound); _backgroundColor = TEST_RETAIN(_backgroundColor); return c; } /* * NSCoding protocol */ - (void) encodeWithCoder: (NSCoder*)aCoder { BOOL tmp; [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { GSButtonCellFlags buttonCellFlags; unsigned int bFlags = 0; unsigned int bFlags2 = 0; NSImage *image = [self image]; NSButtonImageSource *bi = nil; if ([[self keyEquivalent] length] > 0) { [aCoder encodeObject: [self keyEquivalent] forKey: @"NSKeyEquivalent"]; } if ([self image] != nil) { [aCoder encodeObject: [self image] forKey: @"NSNormalImage"]; } if ([[self alternateTitle] length] > 0) { [aCoder encodeObject: [self alternateTitle] forKey: @"NSAlternateContents"]; } buttonCellFlags.useButtonImageSource = (([NSImage imageNamed: @"NSSwitch"] == image) || ([NSImage imageNamed: @"NSRadioButton"] == image)); buttonCellFlags.isTransparent = [self isTransparent]; buttonCellFlags.isBordered = [self isBordered]; buttonCellFlags.imageDoesOverlap = (_cell.image_position == NSImageOverlaps) || (_cell.image_position == NSImageOnly); buttonCellFlags.isHorizontal = (_cell.image_position == NSImageLeft) || (_cell.image_position == NSImageRight); buttonCellFlags.isBottomOrLeft = (_cell.image_position == NSImageAbove) || (_cell.image_position == NSImageBelow); buttonCellFlags.isImageAndText = (image != nil) && (_cell.image_position != NSImageOnly); buttonCellFlags.hasKeyEquiv = ([self keyEquivalent] != nil); // cell attributes... buttonCellFlags.isPushin = [self cellAttribute: NSPushInCell]; buttonCellFlags.highlightByBackground = [self cellAttribute: NSCellLightsByBackground]; buttonCellFlags.highlightByContents = [self cellAttribute: NSCellLightsByContents]; buttonCellFlags.highlightByGray = [self cellAttribute: NSCellLightsByGray]; buttonCellFlags.changeBackground = [self cellAttribute: NSChangeBackgroundCell]; buttonCellFlags.changeContents = [self cellAttribute: NSCellChangesContents]; buttonCellFlags.changeGray = [self cellAttribute: NSChangeGrayCell]; // set these to zero... buttonCellFlags.unused1 = 0; // 32; buttonCellFlags.unused2 = 0; // 255; buttonCellFlags.lastState = 0; buttonCellFlags.isImageSizeDiff = 0; buttonCellFlags.drawing = 0; memcpy((void *)&bFlags, (void *)&buttonCellFlags,sizeof(unsigned int)); [aCoder encodeInt: bFlags forKey: @"NSButtonFlags"]; // style and border. bFlags2 |= [self showsBorderOnlyWhileMouseInside] ? 0x8 : 0; bFlags2 |= (([self bezelStyle] & 0x7) | (([self bezelStyle] & 0x18) << 2)); bFlags2 |= [self keyEquivalentModifierMask] << 8; switch ([self imageScaling]) { case NSImageScaleProportionallyDown: bFlags2 |= (2 << 6); break; case NSImageScaleAxesIndependently: bFlags2 |= (3 << 6); break; case NSImageScaleNone: default: break; case NSImageScaleProportionallyUpOrDown: bFlags2 |= (1 << 6); break; } [aCoder encodeInt: bFlags2 forKey: @"NSButtonFlags2"]; // alternate image encoding... if (image != nil) { if ([image isKindOfClass: [NSImage class]] && buttonCellFlags.useButtonImageSource) { if ([NSImage imageNamed: @"NSSwitch"] == image) { bi = [[NSButtonImageSource alloc] initWithImageNamed: @"NSHighlightedSwitch"]; } else if ([NSImage imageNamed: @"NSRadioButton"] == image) { bi = [[NSButtonImageSource alloc] initWithImageNamed: @"NSHighlightedRadioButton"]; } } } // encode button image source, if it exists... if (bi != nil) { [aCoder encodeObject: bi forKey: @"NSAlternateImage"]; RELEASE(bi); } else if (_altImage != nil) { [aCoder encodeObject: _altImage forKey: @"NSAlternateImage"]; } // repeat and delay [aCoder encodeInt: (int)_delayInterval forKey: @"NSPeriodicDelay"]; [aCoder encodeInt: (int)_repeatInterval forKey: @"NSPeriodicInterval"]; } else { [aCoder encodeObject: _keyEquivalent]; [aCoder encodeObject: _keyEquivalentFont]; [aCoder encodeObject: _altContents]; [aCoder encodeObject: _altImage]; tmp = _buttoncell_is_transparent; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &tmp]; if([NSButtonCell version] <= 2) { unsigned int ke = _keyEquivalentModifierMask << 16; [aCoder encodeValueOfObjCType: @encode(unsigned int) at: &ke]; } else { [aCoder encodeValueOfObjCType: @encode(unsigned int) at: &_keyEquivalentModifierMask]; } [aCoder encodeValueOfObjCType: @encode(unsigned int) at: &_highlightsByMask]; [aCoder encodeValueOfObjCType: @encode(unsigned int) at: &_showAltStateMask]; if([NSButtonCell version] >= 2) { [aCoder encodeObject: _sound]; [aCoder encodeObject: _backgroundColor]; [aCoder encodeValueOfObjCType: @encode(float) at: &_delayInterval]; [aCoder encodeValueOfObjCType: @encode(float) at: &_repeatInterval]; [aCoder encodeValueOfObjCType: @encode(unsigned int) at: &_bezel_style]; [aCoder encodeValueOfObjCType: @encode(unsigned int) at: &_gradient_type]; tmp = _image_dims_when_disabled; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &tmp]; tmp = _shows_border_only_while_mouse_inside; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &tmp]; } } } - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if (!self) return nil; if ([aDecoder allowsKeyedCoding]) { int delay = 0; int interval = 0; // NSControl *control = [aDecoder decodeObjectForKey: @"NSControlView"]; if ([aDecoder containsValueForKey: @"NSKeyEquivalent"]) { [self setKeyEquivalent: [aDecoder decodeObjectForKey: @"NSKeyEquivalent"]]; } if ([aDecoder containsValueForKey: @"NSNormalImage"]) { [self setImage: [aDecoder decodeObjectForKey: @"NSNormalImage"]]; } if ([aDecoder containsValueForKey: @"NSAlternateContents"]) { [self setAlternateTitle: [aDecoder decodeObjectForKey: @"NSAlternateContents"]]; } if ([aDecoder containsValueForKey: @"NSButtonFlags"]) { unsigned int bFlags = [aDecoder decodeIntForKey: @"NSButtonFlags"]; GSButtonCellFlags buttonCellFlags; memcpy((void *)&buttonCellFlags,(void *)&bFlags,sizeof(struct _GSButtonCellFlags)); [self setTransparent: buttonCellFlags.isTransparent]; [self setBordered: buttonCellFlags.isBordered]; [self setCellAttribute: NSPushInCell to: buttonCellFlags.isPushin]; [self setCellAttribute: NSCellLightsByBackground to: buttonCellFlags.highlightByBackground]; [self setCellAttribute: NSCellLightsByContents to: buttonCellFlags.highlightByContents]; [self setCellAttribute: NSCellLightsByGray to: buttonCellFlags.highlightByGray]; [self setCellAttribute: NSChangeBackgroundCell to: buttonCellFlags.changeBackground]; [self setCellAttribute: NSCellChangesContents to: buttonCellFlags.changeContents]; [self setCellAttribute: NSChangeGrayCell to: buttonCellFlags.changeGray]; if (buttonCellFlags.imageDoesOverlap) if (buttonCellFlags.isImageAndText) [self setImagePosition: NSImageOverlaps]; else [self setImagePosition: NSImageOnly]; else if (buttonCellFlags.isImageAndText) if (buttonCellFlags.isHorizontal) if (buttonCellFlags.isBottomOrLeft) [self setImagePosition: NSImageLeft]; else [self setImagePosition: NSImageRight]; else if (buttonCellFlags.isBottomOrLeft) [self setImagePosition: NSImageBelow]; else [self setImagePosition: NSImageAbove]; else [self setImagePosition: NSNoImage]; } if ([aDecoder containsValueForKey: @"NSButtonFlags2"]) { NSUInteger imageScale; int bFlags2; bFlags2 = [aDecoder decodeIntForKey: @"NSButtonFlags2"]; [self setShowsBorderOnlyWhileMouseInside: (bFlags2 & 0x8)]; [self setBezelStyle: (bFlags2 & 0x7) | ((bFlags2 & 0x20) >> 2)]; [self setKeyEquivalentModifierMask: ((bFlags2 >> 8) & NSDeviceIndependentModifierFlagsMask)]; switch (bFlags2 & (3 << 6)) { case 2: imageScale = NSImageScaleProportionallyDown; break; case 3: imageScale = NSImageScaleAxesIndependently; break; case 0: default: imageScale = NSImageScaleNone; break; case 1: imageScale = NSImageScaleProportionallyUpOrDown; break; } [self setImageScaling: imageScale]; } if ([aDecoder containsValueForKey: @"NSAlternateImage"]) { id image; // // NOTE: Okay... this is a humongous kludge. It seems as though // Cocoa is doing something very odd here. It doesn't seem to // encode system images for buttons normally, if it is using // images at all. Until I figure out what, this will stay. // Danger, Will Robinson! :) // image = [aDecoder decodeObjectForKey: @"NSAlternateImage"]; if ([image isKindOfClass: [NSImage class]]) { if ([NSImage imageNamed: @"NSSwitch"] == image) { image = [NSImage imageNamed: @"NSHighlightedSwitch"]; if ([self image] == nil) { [self setImage: [NSImage imageNamed: @"NSSwitch"]]; } } else if ([NSImage imageNamed: @"NSRadioButton"] == image) { image = [NSImage imageNamed: @"NSHighlightedRadioButton"]; if ([self image] == nil) { [self setImage: [NSImage imageNamed: @"NSRadioButton"]]; } } [self setAlternateImage: image]; } } if ([aDecoder containsValueForKey: @"NSPeriodicDelay"]) { delay = [aDecoder decodeIntForKey: @"NSPeriodicDelay"]; } if ([aDecoder containsValueForKey: @"NSPeriodicInterval"]) { interval = [aDecoder decodeIntForKey: @"NSPeriodicInterval"]; } [self setPeriodicDelay: delay interval: interval]; } else { BOOL tmp; int version = [aDecoder versionForClassName: @"NSButtonCell"]; NSString *key = nil; [aDecoder decodeValueOfObjCType: @encode(id) at: &key]; [self setKeyEquivalent: key]; // Set the key equivalent... [aDecoder decodeValueOfObjCType: @encode(id) at: &_keyEquivalentFont]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_altContents]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_altImage]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &tmp]; _buttoncell_is_transparent = tmp; [aDecoder decodeValueOfObjCType: @encode(unsigned int) at: &_keyEquivalentModifierMask]; if (version <= 2) { _keyEquivalentModifierMask = _keyEquivalentModifierMask << 16; } [aDecoder decodeValueOfObjCType: @encode(unsigned int) at: &_highlightsByMask]; [aDecoder decodeValueOfObjCType: @encode(unsigned int) at: &_showAltStateMask]; if (version >= 2) { [aDecoder decodeValueOfObjCType: @encode(id) at: &_sound]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_backgroundColor]; [aDecoder decodeValueOfObjCType: @encode(float) at: &_delayInterval]; [aDecoder decodeValueOfObjCType: @encode(float) at: &_repeatInterval]; [aDecoder decodeValueOfObjCType: @encode(unsigned int) at: &_bezel_style]; [aDecoder decodeValueOfObjCType: @encode(unsigned int) at: &_gradient_type]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &tmp]; _image_dims_when_disabled = tmp; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &tmp]; _shows_border_only_while_mouse_inside = tmp; } // Not encoded in non-keyed archive _imageScaling = NSImageScaleNone; } // Hack to correct a Gorm problem, there "\n" is used instead of "\r". if ([_keyEquivalent isEqualToString: @"\n" ]) { [self setKeyEquivalent: @"\r"]; } return self; } @end gnustep-gui-0.24.0/Source/NSBezierPath.m0000664000076500007650000016757412116324146017702 0ustar brains99brains99/** NSBezierPath.m The NSBezierPath class Copyright (C) 1999, 2005 Free Software Foundation, Inc. Author: Enrico Sersale Date: Dec 1999 Modified: Fred Kiefer Date: January 2001 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import "AppKit/NSAffineTransform.h" #import "AppKit/NSFont.h" #import "AppKit/NSImage.h" #import "AppKit/PSOperators.h" #import "GNUstepGUI/GSFontInfo.h" #import "GSGuiPrivate.h" #include #ifndef M_PI #define M_PI 3.1415926535897932384626434 #endif typedef struct _PathElement { /*NSBezierPathElement*/int type; NSPoint points[3]; } PathElement; //#define GSUNION_TYPES GSUNION_OBJ #define GSI_ARRAY_TYPES 0 #define GSI_ARRAY_TYPE PathElement #define GSI_ARRAY_NO_RETAIN #define GSI_ARRAY_NO_RELEASE #ifdef GSIArray #undef GSIArray #endif #include #define _IN_NSBEZIERPATH_M 1 #import "AppKit/NSBezierPath.h" #undef _IN_NSBEZIERPATH_M // This magic number is 4 *(sqrt(2) -1)/3 #define KAPPA 0.5522847498 #define INVALIDATE_CACHE() [self _invalidateCache] static void flatten(NSPoint coeff[], CGFloat flatness, NSBezierPath *path); static NSWindingRule default_winding_rule = NSNonZeroWindingRule; static CGFloat default_line_width = 1.0; static CGFloat default_flatness = 0.6; static NSLineJoinStyle default_line_join_style = NSMiterLineJoinStyle; static NSLineCapStyle default_line_cap_style = NSButtLineCapStyle; static CGFloat default_miter_limit = 10.0; @interface NSBezierPath (PrivateMethods) - (void)_invalidateCache; - (void)_recalculateBounds; @end #if 0 @interface GSBezierPath : NSBezierPath { GSIArray pathElements; BOOL flat; } @end #endif @implementation NSBezierPath + (void)initialize { if (self == [NSBezierPath class]) { [self setVersion: 2]; } } // // Creating common paths // + (NSBezierPath *)bezierPath { return AUTORELEASE([[self alloc] init]); } + (NSBezierPath *)bezierPathWithRect: (NSRect)aRect { NSBezierPath *path; path = [self bezierPath]; [path appendBezierPathWithRect: aRect]; return path; } + (NSBezierPath *)bezierPathWithOvalInRect: (NSRect)aRect { NSBezierPath *path; path = [self bezierPath]; [path appendBezierPathWithOvalInRect: aRect]; return path; } + (NSBezierPath *)bezierPathWithRoundedRect: (NSRect)aRect xRadius: (CGFloat)xRadius yRadius: (CGFloat)yRadius { NSBezierPath *path; path = [self bezierPath]; [path appendBezierPathWithRoundedRect: aRect xRadius: xRadius yRadius: yRadius]; return path; } // // Immediate mode drawing of common paths // + (void)fillRect: (NSRect)aRect { PSrectfill(NSMinX(aRect), NSMinY(aRect), NSWidth(aRect), NSHeight(aRect)); } + (void)strokeRect: (NSRect)aRect { PSrectstroke(NSMinX(aRect), NSMinY(aRect), NSWidth(aRect), NSHeight(aRect)); } + (void)clipRect: (NSRect)aRect { PSrectclip(NSMinX(aRect), NSMinY(aRect), NSWidth(aRect), NSHeight(aRect)); } + (void)strokeLineFromPoint: (NSPoint)point1 toPoint: (NSPoint)point2 { NSBezierPath *path = [[self alloc] init]; [path moveToPoint: point1]; [path lineToPoint: point2]; [path stroke]; RELEASE(path); } + (void)drawPackedGlyphs: (const char *)packedGlyphs atPoint: (NSPoint)aPoint { NSBezierPath *path = [[self alloc] init]; [path moveToPoint: aPoint]; [path appendBezierPathWithPackedGlyphs: packedGlyphs]; [path fill]; RELEASE(path); } // // Default path rendering parameters // + (void)setDefaultMiterLimit:(CGFloat)limit { default_miter_limit = limit; // Do we need this? PSsetmiterlimit(limit); } + (CGFloat)defaultMiterLimit { return default_miter_limit; } + (void)setDefaultFlatness:(CGFloat)flatness { default_flatness = flatness; PSsetflat(flatness); } + (CGFloat)defaultFlatness { return default_flatness; } + (void)setDefaultWindingRule:(NSWindingRule)windingRule { default_winding_rule = windingRule; } + (NSWindingRule)defaultWindingRule { return default_winding_rule; } + (void)setDefaultLineCapStyle:(NSLineCapStyle)lineCapStyle { default_line_cap_style = lineCapStyle; PSsetlinecap(lineCapStyle); } + (NSLineCapStyle)defaultLineCapStyle { return default_line_cap_style; } + (void)setDefaultLineJoinStyle:(NSLineJoinStyle)lineJoinStyle { default_line_join_style = lineJoinStyle; PSsetlinejoin(lineJoinStyle); } + (NSLineJoinStyle)defaultLineJoinStyle { return default_line_join_style; } + (void)setDefaultLineWidth:(CGFloat)lineWidth { default_line_width = lineWidth; PSsetlinewidth(lineWidth); } + (CGFloat)defaultLineWidth { return default_line_width; } - (id) init { NSZone *zone; self = [super init]; if (self == nil) return nil; // Those values come from the default. [self setLineWidth: default_line_width]; [self setFlatness: default_flatness]; [self setLineCapStyle: default_line_cap_style]; [self setLineJoinStyle: default_line_join_style]; [self setMiterLimit: default_miter_limit]; [self setWindingRule: default_winding_rule]; // Set by allocation //_bounds = NSZeroRect; //_controlPointBounds = NSZeroRect; //_cachesBezierPath = NO; //_cacheImage = nil; //_dash_count = 0; //_dash_phase = 0; //_dash_pattern = NULL; zone = [self zone]; _pathElements = NSZoneMalloc(zone, sizeof(GSIArray_t)); GSIArrayInitWithZoneAndCapacity(_pathElements, zone, 8); _flat = YES; return self; } - (void) dealloc { GSIArrayEmpty(_pathElements); NSZoneFree([self zone], _pathElements); if (_cacheImage != nil) RELEASE(_cacheImage); if (_dash_pattern != NULL) NSZoneFree([self zone], _dash_pattern); [super dealloc]; } // // Path construction // - (void)moveToPoint:(NSPoint)aPoint { PathElement elem; elem.type = NSMoveToBezierPathElement; elem.points[0] = aPoint; elem.points[1] = NSZeroPoint; elem.points[2] = NSZeroPoint; GSIArrayAddItem(_pathElements, (GSIArrayItem)elem); INVALIDATE_CACHE(); } - (void)lineToPoint:(NSPoint)aPoint { PathElement elem; elem.type = NSLineToBezierPathElement; elem.points[0] = aPoint; elem.points[1] = NSZeroPoint; elem.points[2] = NSZeroPoint; GSIArrayAddItem(_pathElements, (GSIArrayItem)elem); INVALIDATE_CACHE(); } - (void)curveToPoint:(NSPoint)aPoint controlPoint1:(NSPoint)controlPoint1 controlPoint2:(NSPoint)controlPoint2 { PathElement elem; elem.type = NSCurveToBezierPathElement; elem.points[0] = controlPoint1; elem.points[1] = controlPoint2; elem.points[2] = aPoint; GSIArrayAddItem(_pathElements, (GSIArrayItem)elem); _flat = NO; INVALIDATE_CACHE(); } - (void)closePath { PathElement elem; elem.type = NSClosePathBezierPathElement; elem.points[0] = NSZeroPoint; elem.points[1] = NSZeroPoint; elem.points[2] = NSZeroPoint; GSIArrayAddItem(_pathElements, (GSIArrayItem)elem); INVALIDATE_CACHE(); } - (void)removeAllPoints { GSIArrayRemoveAllItems(_pathElements); _flat = YES; INVALIDATE_CACHE(); } // // Relative path construction // - (void)relativeMoveToPoint:(NSPoint)aPoint { NSPoint p = [self currentPoint]; p.x = p.x + aPoint.x; p.y = p.y + aPoint.y; [self moveToPoint: p]; } - (void)relativeLineToPoint:(NSPoint)aPoint { NSPoint p = [self currentPoint]; p.x = p.x + aPoint.x; p.y = p.y + aPoint.y; [self lineToPoint: p]; } - (void)relativeCurveToPoint:(NSPoint)aPoint controlPoint1:(NSPoint)controlPoint1 controlPoint2:(NSPoint)controlPoint2 { NSPoint p = [self currentPoint]; aPoint.x = p.x + aPoint.x; aPoint.y = p.y + aPoint.y; controlPoint1.x = p.x + controlPoint1.x; controlPoint1.y = p.y + controlPoint1.y; controlPoint2.x = p.x + controlPoint2.x; controlPoint2.y = p.y + controlPoint2.y; [self curveToPoint: aPoint controlPoint1: controlPoint1 controlPoint2: controlPoint2]; } // // Path rendering parameters // - (CGFloat)lineWidth { return _lineWidth; } - (void)setLineWidth:(CGFloat)lineWidth { _lineWidth = lineWidth; } - (NSLineCapStyle)lineCapStyle { return _lineCapStyle; } - (void)setLineCapStyle:(NSLineCapStyle)lineCapStyle { _lineCapStyle = lineCapStyle; } - (NSLineJoinStyle)lineJoinStyle { return _lineJoinStyle; } - (void)setLineJoinStyle:(NSLineJoinStyle)lineJoinStyle { _lineJoinStyle = lineJoinStyle; } - (NSWindingRule)windingRule { return _windingRule; } - (void)setWindingRule:(NSWindingRule)windingRule { _windingRule = windingRule; } - (void)setFlatness:(CGFloat)flatness { _flatness = flatness; } - (CGFloat)flatness { return _flatness; } - (void)setMiterLimit:(CGFloat)limit { _miterLimit = limit; } - (CGFloat)miterLimit { return _miterLimit; } - (void)getLineDash:(CGFloat *)pattern count:(NSInteger *)count phase:(CGFloat *)phase { // FIXME: How big is the pattern array? // We assume that this value is in count! if (count != NULL) { if (*count < _dash_count) { *count = _dash_count; return; } *count = _dash_count; } if (phase != NULL) *phase = _dash_phase; memcpy(pattern, _dash_pattern, _dash_count * sizeof(CGFloat)); } - (void)setLineDash:(const CGFloat *)pattern count:(NSInteger)count phase:(CGFloat)phase { NSZone *myZone = [self zone]; if ((pattern == NULL) || (count == 0)) { if (_dash_pattern != NULL) { NSZoneFree(myZone, _dash_pattern); _dash_pattern = NULL; } _dash_count = 0; _dash_phase = 0.0; return; } if (_dash_pattern == NULL) _dash_pattern = NSZoneMalloc(myZone, count * sizeof(CGFloat)); else NSZoneRealloc(myZone, _dash_pattern, count * sizeof(CGFloat)); _dash_count = count; _dash_phase = phase; memcpy(_dash_pattern, pattern, _dash_count * sizeof(CGFloat)); } // // Path operations // - (void)stroke { NSGraphicsContext *ctxt = GSCurrentContext(); if (_cachesBezierPath) { NSRect bounds = [self bounds]; NSPoint origin = bounds.origin; // FIXME: I don't see how this should work with color changes if (_cacheImage == nil) { _cacheImage = [[NSImage alloc] initWithSize: bounds.size]; [_cacheImage lockFocus]; DPStranslate(ctxt, -origin.x, -origin.y); [ctxt GSSendBezierPath: self]; DPSstroke(ctxt); [_cacheImage unlockFocus]; } [_cacheImage compositeToPoint: origin operation: NSCompositeCopy]; } else { [ctxt GSSendBezierPath: self]; DPSstroke(ctxt); } } - (void)fill { NSGraphicsContext *ctxt = GSCurrentContext(); if (_cachesBezierPath) { NSRect bounds = [self bounds]; NSPoint origin = bounds.origin; // FIXME: I don't see how this should work with color changes if (_cacheImage == nil) { _cacheImage = [[NSImage alloc] initWithSize: bounds.size]; [_cacheImage lockFocus]; DPStranslate(ctxt, -origin.x, -origin.y); [ctxt GSSendBezierPath: self]; if ([self windingRule] == NSNonZeroWindingRule) DPSfill(ctxt); else DPSeofill(ctxt); [_cacheImage unlockFocus]; } [_cacheImage compositeToPoint: origin operation: NSCompositeCopy]; } else { [ctxt GSSendBezierPath: self]; if ([self windingRule] == NSNonZeroWindingRule) DPSfill(ctxt); else DPSeofill(ctxt); } } - (void)addClip { NSGraphicsContext *ctxt = GSCurrentContext(); [ctxt GSSendBezierPath: self]; if ([self windingRule] == NSNonZeroWindingRule) DPSclip(ctxt); else DPSeoclip(ctxt); } - (void)setClip { NSGraphicsContext *ctxt = GSCurrentContext(); DPSinitclip(ctxt); [ctxt GSSendBezierPath: self]; if ([self windingRule] == NSNonZeroWindingRule) DPSclip(ctxt); else DPSeoclip(ctxt); } // // Path modifications. // - (NSBezierPath *)bezierPathByFlatteningPath { NSBezierPath *path; NSBezierPathElement type; NSPoint pts[3]; NSPoint coeff[4]; NSPoint p, last_p; NSInteger i, count; BOOL first = YES; if (_flat) return self; /* Silence compiler warnings. */ p = NSZeroPoint; last_p = NSZeroPoint; path = [[self class] bezierPath]; count = [self elementCount]; for (i = 0; i < count; i++) { type = [self elementAtIndex: i associatedPoints: pts]; switch(type) { case NSMoveToBezierPathElement: [path moveToPoint: pts[0]]; last_p = p = pts[0]; first = NO; break; case NSLineToBezierPathElement: [path lineToPoint: pts[0]]; p = pts[0]; if (first) { last_p = pts[0]; first = NO; } break; case NSCurveToBezierPathElement: coeff[0] = p; coeff[1] = pts[0]; coeff[2] = pts[1]; coeff[3] = pts[2]; flatten(coeff, [self flatness], path); p = pts[2]; if (first) { last_p = pts[2]; first = NO; } break; case NSClosePathBezierPathElement: [path closePath]; p = last_p; break; default: break; } } return path; } - (NSBezierPath *) bezierPathByReversingPath { NSBezierPath *path = [object_getClass(self) bezierPath]; NSBezierPathElement type, last_type; NSPoint pts[3]; NSPoint p, cp1, cp2; NSInteger i, count; BOOL closed = NO; /* Silence compiler warnings. */ p = NSZeroPoint; last_type = NSMoveToBezierPathElement; count = [self elementCount]; for (i = count - 1; i >= 0; i--) { type = [self elementAtIndex: i associatedPoints: pts]; switch(type) { case NSMoveToBezierPathElement: p = pts[0]; break; case NSLineToBezierPathElement: p = pts[0]; break; case NSCurveToBezierPathElement: cp1 = pts[0]; cp2 = pts[1]; p = pts[2]; break; case NSClosePathBezierPathElement: p = pts[0]; break; default: break; } switch(last_type) { case NSMoveToBezierPathElement: if (closed) { [path closePath]; closed = NO; } [path moveToPoint: p]; break; case NSLineToBezierPathElement: [path lineToPoint: p]; break; case NSCurveToBezierPathElement: [path curveToPoint: p controlPoint1: cp2 controlPoint2: cp1]; break; case NSClosePathBezierPathElement: closed = YES; break; default: break; } last_type = type; } if (closed) [path closePath]; return path; } // // Applying transformations. // - (void) transformUsingAffineTransform: (NSAffineTransform *)transform { NSBezierPathElement type; NSPoint pts[3]; NSInteger i, count; SEL transformPointSel = @selector(transformPoint:); NSPoint (*transformPointImp)(NSAffineTransform*, SEL, NSPoint); transformPointImp = (NSPoint (*)(NSAffineTransform*, SEL, NSPoint)) [transform methodForSelector: transformPointSel]; count = [self elementCount]; for (i = 0; i < count; i++) { type = [self elementAtIndex: i associatedPoints: pts]; switch(type) { case NSMoveToBezierPathElement: case NSLineToBezierPathElement: pts[0] = (*transformPointImp)(transform, transformPointSel, pts[0]); [self setAssociatedPoints: pts atIndex: i]; break; case NSCurveToBezierPathElement: pts[0] = (*transformPointImp)(transform, transformPointSel, pts[0]); pts[1] = (*transformPointImp)(transform, transformPointSel, pts[1]); pts[2] = (*transformPointImp)(transform, transformPointSel, pts[2]); [self setAssociatedPoints: pts atIndex: i]; break; case NSClosePathBezierPathElement: break; default: break; } } INVALIDATE_CACHE(); } // // Path info // - (BOOL) isEmpty { return ([self elementCount] == 0); } - (NSPoint) currentPoint { NSBezierPathElement type; NSPoint points[3]; NSInteger count; count = [self elementCount]; if (!count) [NSException raise: NSGenericException format: @"No current Point in NSBezierPath"]; type = [self elementAtIndex: count - 1 associatedPoints: points]; switch(type) { case NSMoveToBezierPathElement: case NSLineToBezierPathElement: return points[0]; break; case NSCurveToBezierPathElement: return points[2]; break; case NSClosePathBezierPathElement: return points[0]; break; default: break; } return NSZeroPoint; } - (NSRect) controlPointBounds { if (_shouldRecalculateBounds) [self _recalculateBounds]; return _controlPointBounds; } - (NSRect) bounds { if (_shouldRecalculateBounds) [self _recalculateBounds]; return _bounds; } // // Elements // - (NSInteger) elementCount { return GSIArrayCount(_pathElements); } - (NSBezierPathElement) elementAtIndex: (NSInteger)index associatedPoints: (NSPoint *)points { PathElement elm = GSIArrayItemAtIndex(_pathElements, index).ext; NSBezierPathElement type = elm.type; NSInteger i; if (points != NULL) { switch(type) { case NSMoveToBezierPathElement: case NSLineToBezierPathElement: points[0] = elm.points[0]; break; case NSCurveToBezierPathElement: points[0] = elm.points[0]; points[1] = elm.points[1]; points[2] = elm.points[2]; break; case NSClosePathBezierPathElement: // We have to find the last move element and take its point for (i = index - 1; i >= 0; i--) { elm = GSIArrayItemAtIndex(_pathElements, i).ext; if (elm.type == NSMoveToBezierPathElement) { points[0] = elm.points[0]; break; } } // FIXME: What to do if we don't find a move element? break; default: break; } } return type; } - (NSBezierPathElement) elementAtIndex: (NSInteger)index { return [self elementAtIndex: index associatedPoints: NULL]; } - (void)setAssociatedPoints:(NSPoint *)points atIndex:(NSInteger)index { PathElement elm = GSIArrayItemAtIndex(_pathElements, index).ext; NSBezierPathElement type = elm.type; switch(type) { case NSMoveToBezierPathElement: case NSLineToBezierPathElement: elm.points[0] = points[0]; break; case NSCurveToBezierPathElement: elm.points[0] = points[0]; elm.points[1] = points[1]; elm.points[2] = points[2]; break; case NSClosePathBezierPathElement: break; default: break; } GSIArraySetItemAtIndex(_pathElements, (GSIArrayItem)elm, index); INVALIDATE_CACHE(); } // // Appending common paths // - (void) appendBezierPath: (NSBezierPath *)aPath { NSBezierPathElement type; NSPoint points[3]; NSInteger i, count; count = [aPath elementCount]; for (i = 0; i < count; i++) { type = [aPath elementAtIndex: i associatedPoints: points]; switch(type) { case NSMoveToBezierPathElement: [self moveToPoint: points[0]]; break; case NSLineToBezierPathElement: [self lineToPoint: points[0]]; break; case NSCurveToBezierPathElement: [self curveToPoint: points[2] controlPoint1: points[0] controlPoint2: points[1]]; break; case NSClosePathBezierPathElement: [self closePath]; break; default: break; } } } - (void)appendBezierPathWithRect:(NSRect)aRect { NSPoint p; [self moveToPoint: aRect.origin]; p.x = aRect.origin.x + aRect.size.width; p.y = aRect.origin.y; [self lineToPoint: p]; p.x = aRect.origin.x + aRect.size.width; p.y = aRect.origin.y + aRect.size.height; [self lineToPoint: p]; p.x = aRect.origin.x; p.y = aRect.origin.y + aRect.size.height; [self lineToPoint: p]; [self closePath]; } - (void)appendBezierPathWithPoints:(NSPoint *)points count:(NSInteger)count { NSInteger i; if (!count) return; if ([self isEmpty]) { [self moveToPoint: points[0]]; } else { [self lineToPoint: points[0]]; } for (i = 1; i < count; i++) { [self lineToPoint: points[i]]; } } - (void) appendBezierPathWithOvalInRect: (NSRect)aRect { NSPoint p, p1, p2; double originx = aRect.origin.x; double originy = aRect.origin.y; double width = aRect.size.width; double height = aRect.size.height; double hdiff = width / 2 * KAPPA; double vdiff = height / 2 * KAPPA; p = NSMakePoint(originx + width / 2, originy + height); [self moveToPoint: p]; p = NSMakePoint(originx, originy + height / 2); p1 = NSMakePoint(originx + width / 2 - hdiff, originy + height); p2 = NSMakePoint(originx, originy + height / 2 + vdiff); [self curveToPoint: p controlPoint1: p1 controlPoint2: p2]; p = NSMakePoint(originx + width / 2, originy); p1 = NSMakePoint(originx, originy + height / 2 - vdiff); p2 = NSMakePoint(originx + width / 2 - hdiff, originy); [self curveToPoint: p controlPoint1: p1 controlPoint2: p2]; p = NSMakePoint(originx + width, originy + height / 2); p1 = NSMakePoint(originx + width / 2 + hdiff, originy); p2 = NSMakePoint(originx + width, originy + height / 2 - vdiff); [self curveToPoint: p controlPoint1: p1 controlPoint2: p2]; p = NSMakePoint(originx + width / 2, originy + height); p1 = NSMakePoint(originx + width, originy + height / 2 + vdiff); p2 = NSMakePoint(originx + width / 2 + hdiff, originy + height); [self curveToPoint: p controlPoint1: p1 controlPoint2: p2]; } /* startAngle and endAngle are in degrees, counterclockwise, from the x axis */ - (void) appendBezierPathWithArcWithCenter: (NSPoint)center radius: (CGFloat)radius startAngle: (CGFloat)startAngle endAngle: (CGFloat)endAngle clockwise: (BOOL)clockwise { CGFloat startAngle_rad, endAngle_rad, diff; NSPoint p0, p1, p2, p3; /* We use the Postscript prescription for managing the angles and drawing the arc. See the documentation for `arc' and `arcn' in the Postscript Reference. */ if (clockwise) { /* This modification of the angles is the postscript prescription. */ while (startAngle < endAngle) endAngle -= 360; /* This is used when we draw a clockwise quarter of circumference. By adding diff at the starting angle of the quarter, we get the ending angle. diff is negative because we draw clockwise. */ diff = - M_PI / 2; } else { /* This modification of the angles is the postscript prescription. */ while (endAngle < startAngle) endAngle += 360; /* This is used when we draw a counterclockwise quarter of circumference. By adding diff at the starting angle of the quarter, we get the ending angle. diff is positive because we draw counterclockwise. */ diff = M_PI / 2; } /* Convert the angles to radians */ startAngle_rad = M_PI * startAngle / 180; endAngle_rad = M_PI * endAngle / 180; /* Start point */ p0 = NSMakePoint (center.x + radius * cos (startAngle_rad), center.y + radius * sin (startAngle_rad)); if ([self elementCount] == 0) { [self moveToPoint: p0]; } else { NSPoint ps = [self currentPoint]; if (p0.x != ps.x || p0.y != ps.y) { [self lineToPoint: p0]; } } while ((clockwise) ? (startAngle_rad > endAngle_rad) : (startAngle_rad < endAngle_rad)) { /* Add a quarter circle */ if ((clockwise) ? (startAngle_rad + diff >= endAngle_rad) : (startAngle_rad + diff <= endAngle_rad)) { CGFloat sin_start = sin (startAngle_rad); CGFloat cos_start = cos (startAngle_rad); CGFloat sign = (clockwise) ? -1.0 : 1.0; p1 = NSMakePoint (center.x + radius * (cos_start - KAPPA * sin_start * sign), center.y + radius * (sin_start + KAPPA * cos_start * sign)); p2 = NSMakePoint (center.x + radius * (-sin_start * sign + KAPPA * cos_start), center.y + radius * (cos_start * sign + KAPPA * sin_start)); p3 = NSMakePoint (center.x + radius * (-sin_start * sign), center.y + radius * cos_start * sign); [self curveToPoint: p3 controlPoint1: p1 controlPoint2: p2]; startAngle_rad += diff; } else { /* Add the missing bit * We require that the arc be less than a semicircle. * The arc may go either clockwise or counterclockwise. * The approximation is a very simple one: a single curve * whose middle two control points are a fraction F of the way * to the intersection of the tangents, where * F = (4/3) / (1 + sqrt (1 + (d / r)^2)) * where r is the radius and d is the distance from either tangent * point to the intersection of the tangents. This produces * a curve whose center point, as well as its ends, lies on * the desired arc. */ NSPoint ps = [self currentPoint]; /* tangent is the tangent of half the angle */ CGFloat tangent = tan ((endAngle_rad - startAngle_rad) / 2); /* trad is the distance from either tangent point to the intersection of the tangents */ CGFloat trad = radius * tangent; /* pt is the intersection of the tangents */ NSPoint pt = NSMakePoint (ps.x - trad * sin (startAngle_rad), ps.y + trad * cos (startAngle_rad)); /* This is F - in this expression we need to compute (trad/radius)^2, which is simply tangent^2 */ CGFloat f = (4.0 / 3.0) / (1.0 + sqrt (1.0 + (tangent * tangent))); p1 = NSMakePoint (ps.x + (pt.x - ps.x) * f, ps.y + (pt.y - ps.y) * f); p3 = NSMakePoint(center.x + radius * cos (endAngle_rad), center.y + radius * sin (endAngle_rad)); p2 = NSMakePoint (p3.x + (pt.x - p3.x) * f, p3.y + (pt.y - p3.y) * f); [self curveToPoint: p3 controlPoint1: p1 controlPoint2: p2]; break; } } } - (void) appendBezierPathWithArcWithCenter: (NSPoint)center radius: (CGFloat)radius startAngle: (CGFloat)startAngle endAngle: (CGFloat)endAngle { [self appendBezierPathWithArcWithCenter: center radius: radius startAngle: startAngle endAngle: endAngle clockwise: NO]; } - (void) appendBezierPathWithArcFromPoint: (NSPoint)point1 toPoint: (NSPoint)point2 radius: (CGFloat)radius { CGFloat x1, y1; CGFloat dx1, dy1, dx2, dy2; CGFloat l, a1, a2; NSPoint p; p = [self currentPoint]; x1 = point1.x; y1 = point1.y; dx1 = p.x - x1; dy1 = p.y - y1; l= dx1*dx1 + dy1*dy1; if (l <= 0) { [self lineToPoint: point1]; return; } l = 1/sqrt(l); dx1 *= l; dy1 *= l; dx2 = point2.x - x1; dy2 = point2.y - y1; l = dx2*dx2 + dy2*dy2; if (l <= 0) { [self lineToPoint: point1]; return; } l = 1/sqrt(l); dx2 *= l; dy2 *= l; l = dx1*dx2 + dy1*dy2; if (l < -0.999) { [self lineToPoint: point1]; return; } l = radius/sin(acos(l)); p.x = x1 + (dx1 + dx2)*l; p.y = y1 + (dy1 + dy2)*l; if (dx1 < -1) a1 = 180; else if (dx1 > 1) a1 = 0; else a1 = acos(dx1) / M_PI*180; if (dy1 < 0) { a1 = -a1; } if (dx2 < -1) a2 = 180; else if (dx2 > 1) a2 = 0; else a2 = acos(dx2) / M_PI*180; if (dy2 < 0) { a2 = -a2; } l = dx1*dy2 - dx2*dy1; if (l < 0) { a2 = a2 - 90; a1 = a1 + 90; [self appendBezierPathWithArcWithCenter: p radius: radius startAngle: a1 endAngle: a2 clockwise: NO]; } else { a2 = a2 + 90; a1 = a1 - 90; [self appendBezierPathWithArcWithCenter: p radius: radius startAngle: a1 endAngle: a2 clockwise: YES]; } } - (void)appendBezierPathWithGlyph:(NSGlyph)glyph inFont:(NSFont *)font { [[font fontInfo] appendBezierPathWithGlyphs: &glyph count: 1 toBezierPath: self]; } - (void)appendBezierPathWithGlyphs:(NSGlyph *)glyphs count:(NSInteger)count inFont:(NSFont *)font { [[font fontInfo] appendBezierPathWithGlyphs: glyphs count: count toBezierPath: self]; } - (void)appendBezierPathWithPackedGlyphs:(const char *)packedGlyphs { [GSCurrentContext() appendBezierPathWithPackedGlyphs: packedGlyphs path: self]; } - (void) appendBezierPathWithRoundedRect: (NSRect)aRect xRadius: (CGFloat)xRadius yRadius: (CGFloat)yRadius { NSPoint startp, endp, controlp1, controlp2, topLeft, topRight, bottomRight; xRadius = MIN(xRadius, aRect.size.width / 2.0); yRadius = MIN(yRadius, aRect.size.height / 2.0); if (xRadius == 0.0 || yRadius == 0.0) { [self appendBezierPathWithRect: aRect]; return; } topLeft = NSMakePoint(NSMinX(aRect), NSMaxY(aRect)); topRight = NSMakePoint(NSMaxX(aRect), NSMaxY(aRect)); bottomRight = NSMakePoint(NSMaxX(aRect), NSMinY(aRect)); startp = NSMakePoint(topLeft.x + xRadius, topLeft.y); endp = NSMakePoint(topLeft.x, topLeft.y - yRadius); controlp1 = NSMakePoint(startp.x - (KAPPA * xRadius), startp.y); controlp2 = NSMakePoint(endp.x, endp.y + (KAPPA * yRadius)); [self moveToPoint: startp]; [self curveToPoint: endp controlPoint1: controlp1 controlPoint2: controlp2]; startp = NSMakePoint(aRect.origin.x, aRect.origin.y + yRadius); endp = NSMakePoint(aRect.origin.x + xRadius, aRect.origin.y); controlp1 = NSMakePoint(startp.x, startp.y - (KAPPA * yRadius)); controlp2 = NSMakePoint(endp.x - (KAPPA * xRadius), endp.y); [self lineToPoint: startp]; [self curveToPoint: endp controlPoint1: controlp1 controlPoint2: controlp2]; startp = NSMakePoint(bottomRight.x - xRadius, bottomRight.y); endp = NSMakePoint(bottomRight.x, bottomRight.y + yRadius); controlp1 = NSMakePoint(startp.x + (KAPPA * xRadius), startp.y); controlp2 = NSMakePoint(endp.x, endp.y - (KAPPA * yRadius)); [self lineToPoint: startp]; [self curveToPoint: endp controlPoint1: controlp1 controlPoint2: controlp2]; startp = NSMakePoint(topRight.x, topRight.y - yRadius); endp = NSMakePoint(topRight.x - xRadius, topRight.y); controlp1 = NSMakePoint(startp.x, startp.y + (KAPPA * yRadius)); controlp2 = NSMakePoint(endp.x + (KAPPA * xRadius), endp.y); [self lineToPoint: startp]; [self curveToPoint: endp controlPoint1: controlp1 controlPoint2: controlp2]; [self closePath]; } /* We use our own point structure with double elements while recursing to avoid losing accuracy at really fine subdivisions of curves. */ typedef struct { double x, y; } double_point; static int winding_line(double_point from, double_point to, double_point p) { int y_dir; double k, x; if (from.y == to.y) return 0; if (to.y < from.y) { y_dir = -2; if (p.y < to.y) return 0; if (p.y > from.y) return 0; } else { y_dir = 2; if (p.y < from.y) return 0; if (p.y > to.y) return 0; } if (p.y == from.y || p.y == to.y) y_dir /= 2; /* The line is intersected. Check if the intersection is outside the line's bounding box. */ if (to.x < from.x) { if (p.x < to.x) return 0; if (p.x > from.x) return y_dir; } else { if (p.x < from.x) return 0; if (p.x > to.x) return y_dir; } /* Determine the exact x coordinate of the intersection. */ k = (double)(from.x - to.x) / (double)(from.y - to.y); x = to.x + k * (double)(p.y - to.y); if (x < p.x) return y_dir; return 0; } static int winding_curve(double_point from, double_point to, double_point c1, double_point c2, double_point p, int depth) { double x0, x1; double y0, y1; double scale; /* Get the vertical extents of the convex hull. */ y0 = y1 = from.y; if (to.y < y0) y0 = to.y; else if (to.y > y1) y1 = to.y; if (c1.y < y0) y0 = c1.y; else if (c1.y > y1) y1 = c1.y; if (c2.y < y0) y0 = c2.y; else if (c2.y > y1) y1 = c2.y; /* If the point is outside the convex hull, the line can't intersect the curve. */ if (p.y < y0 || p.y > y1) return 0; /* Get the horizontal convex hull. */ x0 = x1 = from.x; if (to.x < x0) x0 = to.x; else if (to.x > x1) x1 = to.x; if (c1.x < x0) x0 = c1.x; else if (c1.x > x1) x1 = c1.x; if (c2.x < x0) x0 = c2.x; else if (c2.x > x1) x1 = c2.x; /* If the point is left of the convex hull, the line doesn't intersect the curve. */ if (p.x < x0) return 0; /* If the point is right of the convex hull, the net winding count is 0, 1, or -1, and it depends only on how the end-points are placed in relation to the point. Essentially, it's equivalent to a line. */ if (p.x > x1) return winding_line(from, to, p); /* Limit the recursion, just to be safe. */ if (depth >= 40) return winding_line(from, to, p); /* The line possibly intersects the curve in some interesting way. If the curve is flat enough, we can pretend it's a line. Otherwise, we subdivide and recurse. First, calculate a suitable scale based on the coordinates of the convex hull. This is used to get a good cutoff for the subdivision. Since it's based on the coordinates in the curve, scaling the curve up or down won't affect relative accuracy. Note that if the scale is zero, the convex hull, and thus the curve, has no extent. */ scale = fabs(x0) + fabs(x1) + fabs(y0) + fabs(y1); if (!scale) return 0; scale /= 40000000.0; /* Deal with the degenerate case to == from. */ if (to.x == from.x && to.y == from.y) { if (x1 - x0 < scale && y1 - y0 < scale) return winding_line(from, to, p); } else { double dx, dy; double nx, ny; double d0, d1, d2, d3; /* Get the direction vector and the normal vector. */ dx = to.x - from.x; dy = to.y - from.y; d0 = sqrt(dx * dx + dy * dy); dx /= d0; dy /= d0; nx = dy; ny = -dx; /* Check that the distances along the direction vector are monotone. */ d0 = from.x * dx + from.y * dy; d1 = c1.x * dx + c1.y * dy; d2 = c2.x * dx + c2.y * dy; d3 = to.x * dx + to.y * dy; if ((d3 > d2 && d2 > d1 && d1 > d0) || (d3 < d2 && d2 < d1 && d1 < d0)) { /* Check that the control points are close to the straigt line between from and to. */ d0 = to.x * nx + to.y * ny; d1 = c1.x * nx + c1.y * ny; d2 = c2.x * nx + c2.y * ny; if (fabs(d0 - d1) < scale && fabs(d0 - d2) < scale) { /* It's flat enough. */ return winding_line(from, to, p); } } } { /* Subdivide. */ double_point m, l1, l2, r1, r2; m.x = (from.x + to.x + 3 * (c1.x + c2.x)) / 8; m.y = (from.y + to.y + 3 * (c1.y + c2.y)) / 8; l1.x = (from.x + c1.x) / 2; l1.y = (from.y + c1.y) / 2; l2.x = (from.x + 2 * c1.x + c2.x) / 4; l2.y = (from.y + 2 * c1.y + c2.y) / 4; r2.x = (to.x + c2.x) / 2; r2.y = (to.y + c2.y) / 2; r1.x = (to.x + 2 * c2.x + c1.x) / 4; r1.y = (to.y + 2 * c2.y + c1.y) / 4; return winding_curve(from, m, l1, l2, p, depth + 1) + winding_curve(m, to, r1, r2, p, depth + 1); } } - (int) windingCountAtPoint: (NSPoint)point { int total; NSBezierPathElement type; NSInteger count; BOOL first; NSPoint pts[3]; NSPoint first_p, last_p; NSInteger i; /* We trace a line from (-INF, point.y) to (point) and count the intersections. Simple, really. ;) Lines are trivially checked with a few complications: a. Tangent lines, i.e. horizontal lines. These can be ignored since the winding count is undefined on edges. b. Lines whose endpoints are touched by our infinite line. To get these right, we return half a winding for such intersections. Except for intermediate horizontal lines, which are ignored, the next line will also be intersected in one endpoint. If it's going in the same direction as the first line, the two half intersections will add up to one real intersection. If it isn't, the two half intersections with opposite signs will cancel out. Either way, we get the right results. (If this happens for the first element, s/next/previous/ in the explanation. In practice, we double the winding counts while working and divide by 2 just before returning.) Curves are checked first using the convex hull, and if necessary, by subdividing until they are flat enough to check as lines. We use a very fine subdivision, and thus get good accuracy. This is possible because only the parts of the curve that might intersect the line are subdivided (due to the convex hull checks). */ total = 0; count = [self elementCount]; if (count == 0) return 0; /* 'Unroll' the first element to avoid compiler warnings. It has to be a MoveTo, anyway. */ type = [self elementAtIndex: 0 associatedPoints: pts]; if (type != NSMoveToBezierPathElement) { NSWarnLog(@"Invalid path, first element isn't MoveTo."); return 0; } last_p = first_p = pts[0]; first = NO; #define D(a) (double_point){a.x,a.y} for (i = 1; i < count; i++) { type = [self elementAtIndex: i associatedPoints: pts]; switch(type) { case NSMoveToBezierPathElement: if (!first) { total += winding_line(D(last_p), D(first_p), D(point)); } last_p = first_p = pts[0]; first = NO; break; case NSLineToBezierPathElement: if (first) { NSWarnLog(@"Invalid path, LineTo without MoveTo."); return 0; } total += winding_line(D(last_p), D(pts[0]), D(point)); last_p = pts[0]; break; case NSCurveToBezierPathElement: if (first) { NSWarnLog(@"Invalid path, CurveTo without MoveTo."); return 0; } total += winding_curve(D(last_p), D(pts[2]), D(pts[0]), D(pts[1]), D(point), 0); last_p = pts[2]; break; case NSClosePathBezierPathElement: if (first) { NSWarnLog(@"Invalid path, ClosePath with no open subpath."); return 0; } first = YES; total += winding_line(D(last_p), D(first_p), D(point)); break; default: NSWarnLog(@"Invalid element in path."); return 0; } } if (!first) total += winding_line(D(last_p), D(first_p), D(point)); #undef D if (total & 1) { /* This should only happen for points on edges, and the winding count is undefined at such points. */ NSDebugLLog(@"NSBezierPath", @"winding count total is odd"); } return total / 2; } - (BOOL) containsPoint: (NSPoint)point { int sum; if (![self elementCount]) return NO; if (!NSPointInRect(point, [self bounds])) return NO; sum = [self windingCountAtPoint: point]; if ([self windingRule] == NSNonZeroWindingRule) { if (sum == 0) return NO; else return YES; } else { if ((sum % 2) == 0) return NO; else return YES; } } // // Caching paths // // // Caching // - (BOOL)cachesBezierPath { return _cachesBezierPath; } - (void)setCachesBezierPath:(BOOL)flag { _cachesBezierPath = flag; if (!flag) INVALIDATE_CACHE(); } // // NSCoding protocol // - (void)encodeWithCoder:(NSCoder *)aCoder { NSBezierPathElement type; NSPoint pts[3]; if ([aCoder allowsKeyedCoding]) { NSUInteger count, i; NSMutableData *d; float x,y; char ctype; [aCoder encodeFloat: [self flatness] forKey: @"NSFlatness"]; [aCoder encodeFloat: [self lineWidth] forKey: @"NSLineWidth"]; [aCoder encodeInt: [self lineCapStyle] forKey: @"NSLineCapStyle"]; [aCoder encodeInt: [self lineJoinStyle] forKey: @"NSLineJoinStyle"]; [aCoder encodeInt: [self windingRule] forKey: @"NSWindingRule"]; [aCoder encodeFloat: [self miterLimit] forKey: @"NSMiterLimit"]; count = [self elementCount]; d = [[NSMutableData alloc] init]; for (i = 0; i < count; i++) { type = [self elementAtIndex: i associatedPoints: pts]; ctype = type; [d serializeDataAt: &ctype ofObjCType: "c" context: nil]; switch (type) { case NSMoveToBezierPathElement: case NSLineToBezierPathElement: x = pts[0].x; y = pts[0].y; [d serializeDataAt: &x ofObjCType: "f" context: nil]; [d serializeDataAt: &y ofObjCType: "f" context: nil]; break; case NSCurveToBezierPathElement: x = pts[0].x; y = pts[0].y; [d serializeDataAt: &x ofObjCType: "f" context: nil]; [d serializeDataAt: &y ofObjCType: "f" context: nil]; [d serializeDataAt: &ctype ofObjCType: "c" context: nil]; x = pts[1].x; y = pts[1].y; [d serializeDataAt: &x ofObjCType: "f" context: nil]; [d serializeDataAt: &y ofObjCType: "f" context: nil]; [d serializeDataAt: &ctype ofObjCType: "c" context: nil]; x = pts[2].x; y = pts[2].y; [d serializeDataAt: &x ofObjCType: "f" context: nil]; [d serializeDataAt: &y ofObjCType: "f" context: nil]; break; case NSClosePathBezierPathElement: x = pts[0].x; y = pts[0].y; [d serializeDataAt: &x ofObjCType: "f" context: nil]; [d serializeDataAt: &y ofObjCType: "f" context: nil]; [d serializeDataAt: &ctype ofObjCType: "c" context: nil]; x = pts[0].x; y = pts[0].y; [d serializeDataAt: &x ofObjCType: "f" context: nil]; [d serializeDataAt: &y ofObjCType: "f" context: nil]; break; default: break; } } [aCoder encodeBytes: [d bytes] length: [d length] forKey: @"NSSegments"]; RELEASE(d); } else { int i, count; float f; f = [self lineWidth]; [aCoder encodeValueOfObjCType: @encode(float) at: &f]; i = [self lineCapStyle]; [aCoder encodeValueOfObjCType: @encode(int) at: &i]; i = [self lineJoinStyle]; [aCoder encodeValueOfObjCType: @encode(int) at: &i]; i = [self windingRule]; [aCoder encodeValueOfObjCType: @encode(int) at: &i]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_cachesBezierPath]; // version 2 f = [self flatness]; [aCoder encodeValueOfObjCType: @encode(float) at: &f]; f = [self miterLimit]; [aCoder encodeValueOfObjCType: @encode(float) at: &f]; count = [self elementCount]; [aCoder encodeValueOfObjCType: @encode(int) at: &count]; for (i = 0; i < count; i++) { type = [self elementAtIndex: i associatedPoints: pts]; [aCoder encodeValueOfObjCType: @encode(int) at: &type]; switch(type) { case NSMoveToBezierPathElement: case NSLineToBezierPathElement: [aCoder encodePoint: pts[0]]; break; case NSCurveToBezierPathElement: [aCoder encodePoint: pts[0]]; [aCoder encodePoint: pts[1]]; [aCoder encodePoint: pts[2]]; break; case NSClosePathBezierPathElement: break; default: break; } } } } - (id)initWithCoder:(NSCoder *)aCoder { // We have to init the place to store the elements [self init]; _cacheImage = nil; _shouldRecalculateBounds = YES; if ([aCoder allowsKeyedCoding]) { float f; int i; if ([aCoder containsValueForKey: @"NSFlatness"]) { f = [aCoder decodeFloatForKey: @"NSFlatness"]; [self setFlatness: f]; } if ([aCoder containsValueForKey: @"NSLineWidth"]) { f = [aCoder decodeFloatForKey: @"NSLineWidth"]; [self setLineWidth: f]; } if ([aCoder containsValueForKey: @"NSLineCapStyle"]) { i = [aCoder decodeIntForKey: @"NSLineCapStyle"]; [self setLineCapStyle: i]; } if ([aCoder containsValueForKey: @"NSLineJoinStyle"]) { i = [aCoder decodeIntForKey: @"NSLineJoinStyle"]; [self setLineJoinStyle: i]; } if ([aCoder containsValueForKey: @"NSWindingRule"]) { i = [aCoder decodeIntForKey: @"NSWindingRule"]; [self setWindingRule: i]; } if ([aCoder containsValueForKey: @"NSMiterLimit"]) { f = [aCoder decodeFloatForKey: @"NSMiterLimit"]; [self setMiterLimit: f]; } if ([aCoder containsValueForKey: @"NSSegments"]) { NSUInteger length; const uint8_t *data; NSData *d; unsigned int cursor = 0; data = [aCoder decodeBytesForKey: @"NSSegments" returnedLength: &length]; d = [NSData dataWithBytes: data length: length]; //NSLog(@"decoded segments %@", d); while (cursor < length) { char c; float f, g; NSPoint p, cp1, cp2; [d deserializeDataAt: &c ofObjCType: "c" atCursor: &cursor context: nil]; switch (c) { case NSMoveToBezierPathElement: [d deserializeDataAt: &f ofObjCType: "f" atCursor: &cursor context: nil]; [d deserializeDataAt: &g ofObjCType: "f" atCursor: &cursor context: nil]; p = NSMakePoint(f, g); [self moveToPoint: p]; //NSLog(@"Decoded move %@", NSStringFromPoint(p)); break; case NSLineToBezierPathElement: [d deserializeDataAt: &f ofObjCType: "f" atCursor: &cursor context: nil]; [d deserializeDataAt: &g ofObjCType: "f" atCursor: &cursor context: nil]; p = NSMakePoint(f, g); [self lineToPoint: p]; //NSLog(@"Decoded line %@", NSStringFromPoint(p)); break; case NSCurveToBezierPathElement: [d deserializeDataAt: &f ofObjCType: "f" atCursor: &cursor context: nil]; [d deserializeDataAt: &g ofObjCType: "f" atCursor: &cursor context: nil]; cp1 = NSMakePoint(f, g); [d deserializeDataAt: &c ofObjCType: "c" atCursor: &cursor context: nil]; [d deserializeDataAt: &f ofObjCType: "f" atCursor: &cursor context: nil]; [d deserializeDataAt: &g ofObjCType: "f" atCursor: &cursor context: nil]; cp2 = NSMakePoint(f, g); [d deserializeDataAt: &c ofObjCType: "c" atCursor: &cursor context: nil]; [d deserializeDataAt: &f ofObjCType: "f" atCursor: &cursor context: nil]; [d deserializeDataAt: &g ofObjCType: "f" atCursor: &cursor context: nil]; p = NSMakePoint(f, g); [self curveToPoint: p controlPoint1: cp1 controlPoint2: cp2]; //NSLog(@"Decoded curve %@ %@ %@", NSStringFromPoint(p), NSStringFromPoint(cp1), NSStringFromPoint(cp2)); break; case NSClosePathBezierPathElement: [d deserializeDataAt: &f ofObjCType: "f" atCursor: &cursor context: nil]; [d deserializeDataAt: &g ofObjCType: "f" atCursor: &cursor context: nil]; p = NSMakePoint(f, g); [d deserializeDataAt: &c ofObjCType: "c" atCursor: &cursor context: nil]; [d deserializeDataAt: &f ofObjCType: "f" atCursor: &cursor context: nil]; [d deserializeDataAt: &g ofObjCType: "f" atCursor: &cursor context: nil]; cp1 = NSMakePoint(f, g); //NSLog(@"Decoded close %@ %@", NSStringFromPoint(p), NSStringFromPoint(cp1)); [self closePath]; break; default: //NSLog(@"Unable to decode unknown bezier path element type %d", c); break; } } } } else { NSBezierPathElement type; NSPoint pts[3]; int i, count; float f; int version = [aCoder versionForClassName: @"NSBezierPath"]; [aCoder decodeValueOfObjCType: @encode(float) at: &f]; [self setLineWidth: f]; [aCoder decodeValueOfObjCType: @encode(int) at: &i]; [self setLineCapStyle: i]; [aCoder decodeValueOfObjCType: @encode(int) at: &i]; [self setLineJoinStyle: i]; [aCoder decodeValueOfObjCType: @encode(int) at: &i]; [self setWindingRule: i]; [aCoder decodeValueOfObjCType: @encode(BOOL) at: &_cachesBezierPath]; if (version >= 2) { [aCoder decodeValueOfObjCType: @encode(float) at: &f]; [self setFlatness: f]; [aCoder decodeValueOfObjCType: @encode(float) at: &f]; [self setMiterLimit: f]; } [aCoder decodeValueOfObjCType: @encode(int) at: &count]; for (i = 0; i < count; i++) { [aCoder decodeValueOfObjCType: @encode(int) at: &type]; switch(type) { case NSMoveToBezierPathElement: pts[0] = [aCoder decodePoint]; [self moveToPoint: pts[0]]; break; case NSLineToBezierPathElement: pts[0] = [aCoder decodePoint]; [self lineToPoint: pts[0]]; break; case NSCurveToBezierPathElement: pts[0] = [aCoder decodePoint]; pts[1] = [aCoder decodePoint]; pts[2] = [aCoder decodePoint]; [self curveToPoint: pts[2] controlPoint1: pts[0] controlPoint2: pts[1]]; break; case NSClosePathBezierPathElement: [self closePath]; break; default: break; } } } return self; } // // NSCopying Protocol // - (id)copyWithZone:(NSZone *)zone { NSBezierPath *path = (NSBezierPath*)NSCopyObject (self, 0, zone); if (_cachesBezierPath && _cacheImage) path->_cacheImage = [_cacheImage copy]; if (_dash_pattern != NULL) { CGFloat *pattern = NSZoneMalloc(zone, _dash_count * sizeof(CGFloat)); memcpy(pattern, _dash_pattern, _dash_count * sizeof(CGFloat)); _dash_pattern = pattern; } path->_pathElements = GSIArrayCopyWithZone(_pathElements, zone); return path; } @end @implementation NSBezierPath (PrivateMethods) - (void) _invalidateCache { _shouldRecalculateBounds = YES; DESTROY(_cacheImage); } /* Helper for -_recalculateBounds. */ static NSPoint point_on_curve(double t, NSPoint a, NSPoint b, NSPoint c, NSPoint d) { double ti = 1.0 - t; return NSMakePoint(ti * ti * ti * a.x + 3 * ti * ti * t * b.x + 3 * ti * t * t * c.x + t * t * t * d.x, ti * ti * ti * a.y + 3 * ti * ti * t * b.y + 3 * ti * t * t * c.y + t * t * t * d.y); } - (void)_recalculateBounds { NSBezierPathElement type; NSPoint p; /* Current point. */ NSPoint pts[3]; NSPoint min, max; /* Path bounding box. */ NSPoint cmin, cmax; /* Control-point bounding box. */ int i, count, num_curves; count = [self elementCount]; if (!count) { _bounds = NSZeroRect; _controlPointBounds = NSZeroRect; _shouldRecalculateBounds = NO; return; } p = min = max = cmin = cmax = NSMakePoint(0, 0); #define CHECK_MAX(max, p) \ if (p.x > max.x) max.x = p.x; \ if (p.y > max.y) max.y = p.y; #define CHECK_MIN(min, p) \ if (p.x < min.x) min.x = p.x; \ if (p.y < min.y) min.y = p.y; num_curves = 0; for (i = 0; i < count; i++) { type = [self elementAtIndex: i associatedPoints: pts]; if (i == 0) { cmin = cmax = min = max = p = pts[0]; } switch (type) { case NSClosePathBezierPathElement: p = pts[0]; continue; case NSMoveToBezierPathElement: case NSLineToBezierPathElement: CHECK_MAX(max, pts[0]) CHECK_MIN(min, pts[0]) p = pts[0]; break; case NSCurveToBezierPathElement: { double t0, t1, t; NSPoint q; num_curves++; CHECK_MAX(cmax, pts[0]) CHECK_MIN(cmin, pts[0]) CHECK_MAX(cmax, pts[1]) CHECK_MIN(cmin, pts[1]) CHECK_MAX(max, pts[2]) CHECK_MIN(min, pts[2]) #define CHECK_CURVE_EXTREMES(x) \ t = (p.x * (pts[2].x - pts[1].x) \ + pts[0].x * (-pts[2].x - pts[1].x) \ + pts[1].x * pts[1].x + pts[0].x * pts[0].x); \ if (t >= 0.0) \ { \ t = sqrt(t); \ t0 = (pts[1].x - 2 * pts[0].x + p.x + t) \ / (-pts[2].x + 3 * pts[1].x - 3 * pts[0].x + p.x); \ t1 = (pts[1].x - 2 * pts[0].x + p.x - t) \ / (-pts[2].x + 3 * pts[1].x - 3 * pts[0].x + p.x); \ \ if (t0 > 0.0 && t0 < 1.0) \ { \ q = point_on_curve(t0, p, pts[0], pts[1], pts[2]); \ CHECK_MAX(max, q) \ CHECK_MIN(min, q) \ } \ if (t1 > 0.0 && t1 < 1.0) \ { \ q = point_on_curve(t1, p, pts[0], pts[1], pts[2]); \ CHECK_MAX(max, q) \ CHECK_MIN(min, q) \ } \ } CHECK_CURVE_EXTREMES(x) CHECK_CURVE_EXTREMES(y) #undef CHECK_CURVE_EXTREMES p = pts[2]; break; } } } /* If there were no curve elements, the control-point bounding box is the same as the path bounding box. Otherwise, the control-point bounding box is the union of the path bounding box and the bounding box of the curve control points. */ if (num_curves) { CHECK_MAX(cmax, max) CHECK_MIN(cmin, min) } else { cmin = min; cmax = max; } _bounds = NSMakeRect(min.x, min.y, max.x - min.x, max.y - min.y); _controlPointBounds = NSMakeRect(cmin.x, cmin.y, cmax.x - cmin.x, cmax.y - cmin.y); _shouldRecalculateBounds = NO; #undef CHECK_MAX #undef CHECK_MIN } @end #if 0 @implementation GSBezierPath - (void) appendBezierPath: (NSBezierPath *)aPath { PathElement elem; int i, count; if (![aPath isKindOfClass: object_getClass(self)]) { [super appendBezierPath: aPath]; return; } flat = flat && ((GSBezierPath*)aPath)->flat; count = [aPath elementCount]; for (i = 0; i < count; i++) { elem = GSIArrayItemAtIndex(((GSBezierPath*)aPath)->pathElements, i).ext; GSIArrayAddItem(pathElements, (GSIArrayItem)elem); } INVALIDATE_CACHE(); } @end // GSBezierPath #endif static void flatten(NSPoint coeff[], CGFloat flatness, NSBezierPath *path) { // Check if the Bezier path defined by the four points has the given flatness. // If not split it up in the middle and recurse. // Otherwise add the end point to the path. BOOL flat = YES; // This criteria for flatness is based on code from Libart which has the // following copyright: /* Libart_LGPL - library of basic graphic primitives * Copyright (C) 1998 Raph Levien * * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ double x1_0, y1_0; double x3_2, y3_2; double x3_0, y3_0; double z3_0_dot; double z1_dot, z2_dot; double z1_perp, z2_perp; double max_perp_sq; x3_0 = coeff[3].x - coeff[0].x; y3_0 = coeff[3].y - coeff[0].y; x3_2 = coeff[3].x - coeff[2].x; y3_2 = coeff[3].y - coeff[2].y; x1_0 = coeff[1].x - coeff[0].x; y1_0 = coeff[1].y - coeff[0].y; z3_0_dot = x3_0 * x3_0 + y3_0 * y3_0; if (z3_0_dot < 0.001) flat = YES; else { max_perp_sq = flatness * flatness * z3_0_dot; z1_perp = y1_0 * x3_0 - x1_0 * y3_0; if (z1_perp * z1_perp > max_perp_sq) flat = NO; else { z2_perp = y3_2 * x3_0 - x3_2 * y3_0; if (z2_perp * z2_perp > max_perp_sq) flat = NO; else { z1_dot = x1_0 * x3_0 + y1_0 * y3_0; if (z1_dot < 0 && z1_dot * z1_dot > max_perp_sq) flat = NO; else { z2_dot = x3_2 * x3_0 + y3_2 * y3_0; if (z2_dot < 0 && z2_dot * z2_dot > max_perp_sq) flat = NO; else { if ((z1_dot + z1_dot > z3_0_dot) || (z2_dot + z2_dot > z3_0_dot)) flat = NO; } } } } } if (!flat) { NSPoint bleft[4], bright[4]; bleft[0] = coeff[0]; bleft[1].x = (coeff[0].x + coeff[1].x) / 2; bleft[1].y = (coeff[0].y + coeff[1].y) / 2; bleft[2].x = (coeff[0].x + 2*coeff[1].x + coeff[2].x) / 4; bleft[2].y = (coeff[0].y + 2*coeff[1].y + coeff[2].y) / 4; bleft[3].x = (coeff[0].x + 3*(coeff[1].x + coeff[2].x) + coeff[3].x) / 8; bleft[3].y = (coeff[0].y + 3*(coeff[1].y + coeff[2].y) + coeff[3].y) / 8; bright[0].x = bleft[3].x; bright[0].y = bleft[3].y; bright[1].x = (coeff[3].x + 2*coeff[2].x + coeff[1].x) / 4; bright[1].y = (coeff[3].y + 2*coeff[2].y + coeff[1].y) / 4; bright[2].x = (coeff[3].x + coeff[2].x) / 2; bright[2].y = (coeff[3].y + coeff[2].y) / 2; bright[3] = coeff[3]; flatten(bleft, flatness, path); flatten(bright, flatness, path); } else { //[path lineToPoint: coeff[1]]; //[path lineToPoint: coeff[2]]; [path lineToPoint: coeff[3]]; } } gnustep-gui-0.24.0/Source/NSInterfaceStyle.m0000664000076500007650000001514311534147002020543 0ustar brains99brains99/** NSInterfaceStyle Copyright (C) 1999 Free Software Foundation, Inc. Author: Richard Frith-Macdonald Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import #import #import #import #import #import #import "AppKit/NSResponder.h" #import "AppKit/NSInterfaceStyle.h" #import "GNUstepGUI/GSTheme.h" NSString *NSInterfaceStyleDefault = @"NSInterfaceStyleDefault"; static NSMapTable *styleMap = 0; static NSInterfaceStyle defStyle; static NSInterfaceStyle styleFromString(NSString* str) { if ([str isEqualToString: @"NSNextStepInterfaceStyle"]) return NSNextStepInterfaceStyle; if ([str isEqualToString: @"NSMacintoshInterfaceStyle"]) return NSMacintoshInterfaceStyle; if ([str isEqualToString: @"NSWindows95InterfaceStyle"]) return NSWindows95InterfaceStyle; if ([str isEqualToString: @"GSWindowMakerInterfaceStyle"]) return GSWindowMakerInterfaceStyle; return NSNoInterfaceStyle; } @interface GSInterfaceStyle : NSObject + (void) defaultsDidChange: (NSNotification*)notification; @end /* typedef struct { @defs(NSResponder) } *accessToResponder; */ typedef NSResponder* accessToResponder; /**

Returns the interface style the responder should use, which affects how a UI element (such as a button or menu) is displayed. If the responder has an interface style set, the key is ignored and the responder's interface style is returned. Otherwise the style associated with the key is returned (if set), otherwise the default style is returned. In no case will the style NSNoInterfaceStyle be returned.

Styles can be set using the user defaults system. Currently available styles are

NSNextStepInterfaceStyle NSMacintoshInterfaceStyle NSWindows95InterfaceStyle GSWindowMakerInterfaceStyle

You can set a default style for all UI elements using the NSInterfaceStyleDefault key:

defaults write NSGlobalDomain NSInterfaceStyleDefault GSWindowMakerInterfaceStyle */ extern NSInterfaceStyle NSInterfaceStyleForKey(NSString *key, NSResponder *responder) { NSInterfaceStyle style; /* * If the specified responder has a style set, return it. */ if (responder) { style = (NSInterfaceStyle)((accessToResponder)responder)->_interface_style; if (style != NSNoInterfaceStyle) { return style; } } /* * If there is no style map, the defaults/cache management class must be * initialised. */ if (styleMap == 0) [GSInterfaceStyle class]; /* * If there is a style for the given defaults key, return it - after * caching it in a map table if necessary. */ if (key) { /* * First try the cache - then, if no style is found, use the * defaults system and add the results into the cache. */ style = (NSInterfaceStyle)NSMapGet(styleMap, key); if (style == NSNoInterfaceStyle) { NSUserDefaults *defs; NSString *def; defs = [NSUserDefaults standardUserDefaults]; def = [defs stringForKey: key]; if (def == nil || (style = styleFromString(def)) == NSNoInterfaceStyle) { style = defStyle; } if (style != NSNoInterfaceStyle) NSMapInsert(styleMap, (void*)key, (void*)style); } return style; } /* * No responder and no key - return the default style. */ return defStyle; } /* * The GSInterfaceStyle class is used solely to maintain our map of * know interface styles by updating when user defaults change. */ @implementation GSInterfaceStyle + (void) initialize { if (self == [GSInterfaceStyle class]) { styleMap = NSCreateMapTable(NSObjectMapKeyCallBacks, NSIntMapValueCallBacks, 8); [NSUserDefaults standardUserDefaults]; [self defaultsDidChange: nil]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(defaultsDidChange:) name: NSUserDefaultsDidChangeNotification object: nil]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(defaultsDidChange:) name: GSThemeDidActivateNotification object: nil]; } } + (void) defaultsDidChange: (NSNotification*)notification { NSUserDefaults *defs; NSMapEnumerator enumerator; NSString *key; void *val; /* * We ignore the actual notification, which may be nil (when called at * initialization), or may contain a user defaults object (if a persistent * domain changed), or may contain a theme object (if a theme activated). * What we need to do is examine the current state of the standard defaults. */ defs = [NSUserDefaults standardUserDefaults]; /* * Determine the default interface style for the application. */ key = [defs stringForKey: NSInterfaceStyleDefault]; if (key == nil || (defStyle = styleFromString(key)) == NSNoInterfaceStyle) defStyle = NSNextStepInterfaceStyle; /* * Now check the interface styles for all the keys in use and adjust our * map table for any changes. */ enumerator = NSEnumerateMapTable(styleMap); while (NSNextMapEnumeratorPair(&enumerator, (void**)&key, (void**)&val)) { NSInterfaceStyle newStyle; NSString *def = [defs stringForKey: key]; if (def == nil) { newStyle = defStyle; } else { newStyle = styleFromString(def); if (newStyle == NSNoInterfaceStyle) { newStyle = defStyle; } } if (newStyle != ((NSInterfaceStyle)val)) { NSMapInsert(styleMap, (void*)key, (void*)newStyle); } } } @end gnustep-gui-0.24.0/Source/NSMenu.m0000664000076500007650000015616512167707046016555 0ustar brains99brains99/** NSMenu Copyright (C) 1999 Free Software Foundation, Inc. Author: Fred Kiefer Date: Aug 2001 Author: David Lazaro Saz Date: Oct 1999 Author: Michael Hanni Date: 1999 Author: Felipe A. Rodriguez Date: July 1998 and: Author: Ovidiu Predescu Date: May 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import #import #import #import #import #import #import #import #import #import #import #import "AppKit/NSMatrix.h" #import "AppKit/NSApplication.h" #import "AppKit/NSCursor.h" #import "AppKit/NSWindow.h" #import "AppKit/NSEvent.h" #import "AppKit/NSFont.h" #import "AppKit/NSImage.h" #import "AppKit/NSMenu.h" #import "AppKit/NSMenuItem.h" #import "AppKit/NSMenuView.h" #import "AppKit/NSPanel.h" #import "AppKit/NSPopUpButton.h" #import "AppKit/NSPopUpButtonCell.h" #import "AppKit/NSScreen.h" #import "AppKit/NSAttributedString.h" #import "GSGuiPrivate.h" #import "NSDocumentFrameworkPrivate.h" #import "GNUstepGUI/GSTheme.h" /* Drawing related: NSMenu superMenu (if not root menu, the parent meu) ^ | | +------------------> NSMenuView view (content, draws the menu items) | | NSMenu +----------+-------> NSMenuPanel A (regular window, torn off window) | | `-------> NSMenuPanel B (transient window) | | | +------------------> NSString title (title) | v NSMenu attachedMenu (the menu attached to this one, during navigation) +--[NSMenuPanel]------+ | +-[NSMenuView]----+ | | | title if applic | | | | +-------------+ | | | | | NSMenuItem- | | | | | | Cell | | | | | +-------------+ | | | | . | | | | . | | | +-----------------+ | +---------------------+ The two windows --------------- Basically we have for a menu two windows, window A and window B. Window A is the regular window and Window B is used for transient windows. At any one time, the views, like title view, NSMenuView are put either in window A or in window B. They are moved over from one window to the oter when needed. the code is supposed to know when it is using window A or B. But it will probably only work correctly when window A correspond to transient == NO window B correspond to transient == YES */ /* Subclass of NSPanel since menus cannot become key */ @interface NSMenuPanel : NSPanel { NSMenu *_the_menu; } - (void) _setmenu: (NSMenu *)menu; @end @interface NSMenuView (GNUstepPrivate) - (NSArray *)_itemCells; @end static NSZone *menuZone = NULL; static NSString *NSMenuLocationsKey = @"NSMenuLocations"; static NSString *NSEnqueuedMenuMoveName = @"EnqueuedMoveNotificationName"; static NSNotificationCenter *nc; static BOOL menuBarVisible = YES; @interface NSMenu (GNUstepPrivate) - (NSString *) _name; - (void) _setName: (NSString *)name; - (NSMenuPanel *) _createWindow; - (NSString *) _locationKey; - (void) _rightMouseDisplay: (NSEvent*)theEvent; - (void) _setGeometry; - (void) _updateUserDefaults: (id) notification; - (void) _organizeMenu; @end @implementation NSMenuPanel - (void) _setmenu: (NSMenu *)menu { _the_menu = menu; } - (BOOL) canBecomeKeyWindow { /* See [NSWindow-_lossOfKeyOrMainWindow] */ if (self == (NSMenuPanel *)[[NSApp mainMenu] window]) return YES; return NO; } - (void) orderFrontRegardless { NSInterfaceStyle style = NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil); if (style == NSWindows95InterfaceStyle) { // if we're the top level menu in Windows mode, don't show it. if([_the_menu supermenu] == nil && [_the_menu _ownedByPopUp] == NO) { return; } } [super orderFrontRegardless]; } @end @implementation NSMenu (GNUstepPrivate) - (NSString *) _name; { return _name; } - (void) _setName: (NSString *)aName { ASSIGNCOPY(_name, aName); } - (NSString*) _locationKey { NSInterfaceStyle style = NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil); if (style == NSMacintoshInterfaceStyle || style == NSWindows95InterfaceStyle) { return nil; } if (_superMenu == nil) { if ([NSApp mainMenu] == self) { return @"\033"; /* Root menu. */ } else { return nil; /* Unused menu. */ } } else if (_superMenu->_superMenu == nil) { return [NSString stringWithFormat: @"\033%@", [self title]]; } else { return [[_superMenu _locationKey] stringByAppendingFormat: @"\033%@", [self title]]; } } /* Create a non autorelease window for this menu. */ - (NSMenuPanel*) _createWindow { NSMenuPanel *win = [[NSMenuPanel alloc] initWithContentRect: NSZeroRect styleMask: NSBorderlessWindowMask backing: NSBackingStoreBuffered defer: YES]; [win setBackgroundColor: [NSColor clearColor]]; [win setLevel: NSSubmenuWindowLevel]; [win setWorksWhenModal: NO]; [win setBecomesKeyOnlyIfNeeded: YES]; [win _setmenu: self]; return win; } /** Will track the mouse movement. It will trigger the updating of the user defaults in due time. */ - (void) _menuMoved: (id) notification { NSNotification *resend; resend = [NSNotification notificationWithName: NSEnqueuedMenuMoveName object: self]; [[NSNotificationQueue defaultQueue] enqueueNotification: resend postingStyle: NSPostASAP coalesceMask: NSNotificationCoalescingOnSender forModes: [NSArray arrayWithObject: NSDefaultRunLoopMode]]; } - (void) _organizeMenu { NSString *infoString = _(@"Info"); NSString *servicesString = _(@"Services"); int i; if ([self isEqual: [NSApp mainMenu]] == YES) { NSString *appTitle; NSMenu *appMenu; id appItem; appTitle = [[[NSBundle mainBundle] localizedInfoDictionary] objectForKey: @"ApplicationName"]; if (nil == appTitle) { appTitle = [[NSProcessInfo processInfo] processName]; } appItem = [self itemWithTitle: appTitle]; appMenu = [appItem submenu]; if (_menu.horizontal == YES) { NSMutableArray *itemsToMove; itemsToMove = [NSMutableArray new]; if (appMenu == nil) { [self insertItemWithTitle: appTitle action: NULL keyEquivalent: @"" atIndex: 0]; appItem = [self itemAtIndex: 0]; appMenu = [NSMenu new]; [self setSubmenu: appMenu forItem: appItem]; RELEASE(appMenu); } else { int index = [self indexOfItem: appItem]; if (index != 0) { RETAIN (appItem); [self removeItemAtIndex: index]; [self insertItem: appItem atIndex: 0]; RELEASE (appItem); } } if ([[GSTheme theme] menuShouldShowIcon]) { NSImage *ti; float bar; ti = [[NSApp applicationIconImage] copy]; if (ti == nil) { ti = [[NSImage imageNamed: @"GNUstep"] copy]; } [ti setScalesWhenResized: YES]; bar = [NSMenuView menuBarHeight] - 4; [ti setSize: NSMakeSize(bar, bar)]; [appItem setImage: ti]; RELEASE(ti); } // Collect all simple items plus "Info" and "Services" for (i = 1; i < [_items count]; i++) { NSMenuItem *anItem = [_items objectAtIndex: i]; NSString *title = [anItem title]; NSMenu *submenu = [anItem submenu]; if (submenu == nil) { [itemsToMove addObject: anItem]; } else { // The menu may not be localized, so we have to // check both the English and the local version. if ([title isEqual: @"Info"] || [title isEqual: @"Services"] || [title isEqual: infoString] || [title isEqual: servicesString]) { [itemsToMove addObject: anItem]; } } } for (i = 0; i < [itemsToMove count]; i++) { NSMenuItem *anItem = [itemsToMove objectAtIndex: i]; [self removeItem: anItem]; [appMenu addItem: anItem]; } RELEASE(itemsToMove); } else { [appItem setImage: nil]; if (appMenu != nil) { NSArray *array = [NSArray arrayWithArray: [appMenu itemArray]]; /* * Everything above the Serives menu goes into the info submenu, * the rest into the main menu. */ int k = [appMenu indexOfItemWithTitle: servicesString]; // The menu may not be localized, so we have to // check both the English and the local version. if (k == -1) k = [appMenu indexOfItemWithTitle: @"Services"]; if ((k > 0) && ([[array objectAtIndex: k - 1] isSeparatorItem])) k--; if (k == 1) { // Exactly one info item NSMenuItem *anItem = [array objectAtIndex: 0]; [appMenu removeItem: anItem]; [self insertItem: anItem atIndex: 0]; } else if (k > 1) { id infoItem; NSMenu *infoMenu; // Multiple info items, add a submenu for them [self insertItemWithTitle: infoString action: NULL keyEquivalent: @"" atIndex: 0]; infoItem = [self itemAtIndex: 0]; infoMenu = [NSMenu new]; [self setSubmenu: infoMenu forItem: infoItem]; RELEASE(infoMenu); for (i = 0; i < k; i++) { NSMenuItem *anItem = [array objectAtIndex: i]; [appMenu removeItem: anItem]; [infoMenu addItem: anItem]; } } else { // No service menu, or it is the first item. // We still look for an info item. NSMenuItem *anItem = [array objectAtIndex: 0]; NSString *title = [anItem title]; // The menu may not be localized, so we have to // check both the English and the local version. if ([title isEqual: @"Info"] || [title isEqual: infoString]) { [appMenu removeItem: anItem]; [self insertItem: anItem atIndex: 0]; k = 1; } else { k = 0; } } // Copy the remaining entries. for (i = k; i < [array count]; i++) { NSMenuItem *anItem = [array objectAtIndex: i]; [appMenu removeItem: anItem]; [self addItem: anItem]; } [self removeItem: appItem]; } } } // recurse over all submenus for (i = 0; i < [_items count]; i++) { NSMenuItem *anItem = [_items objectAtIndex: i]; NSMenu *submenu = [anItem submenu]; if (submenu != nil) { if ([submenu isTransient]) { [submenu closeTransient]; } [submenu close]; [submenu _organizeMenu]; } } [[self menuRepresentation] update]; [self sizeToFit]; } - (void) _setGeometry { NSPoint origin; if (_menu.horizontal == YES) { origin = NSMakePoint (0, [[NSScreen mainScreen] frame].size.height - [_aWindow frame].size.height); [_aWindow setFrameOrigin: origin]; [_bWindow setFrameOrigin: origin]; } else { NSString *key; if (nil != (key = [self _locationKey])) { NSUserDefaults *defaults; NSDictionary *menuLocations; NSString *location; defaults = [NSUserDefaults standardUserDefaults]; menuLocations = [defaults objectForKey: NSMenuLocationsKey]; if ([menuLocations isKindOfClass: [NSDictionary class]]) location = [menuLocations objectForKey: key]; else location = nil; if (location && [location isKindOfClass: [NSString class]]) { [_aWindow setFrameFromString: location]; [_bWindow setFrameFromString: location]; return; } } origin = NSMakePoint(0, [[_aWindow screen] visibleFrame].size.height - [_aWindow frame].size.height); [_aWindow setFrameOrigin: origin]; [_bWindow setFrameOrigin: origin]; } } /** Save the current menu position in the standard user defaults */ - (void) _updateUserDefaults: (id) notification { if (_menu.horizontal == NO) { NSString *key; NSDebugLLog (@"NSMenu", @"Synchronizing user defaults"); key = [self _locationKey]; if (key != nil) { NSUserDefaults *defaults; NSMutableDictionary *menuLocations; NSString *locString; defaults = [NSUserDefaults standardUserDefaults]; menuLocations = [defaults objectForKey: NSMenuLocationsKey]; if ([menuLocations isKindOfClass: [NSDictionary class]]) menuLocations = AUTORELEASE([menuLocations mutableCopy]); else menuLocations = nil; if ([_aWindow isVisible] && ([self isTornOff] || ([NSApp mainMenu] == self))) { if (menuLocations == nil) { menuLocations = AUTORELEASE([[NSMutableDictionary alloc] initWithCapacity: 2]); } locString = [[self window] stringWithSavedFrame]; [menuLocations setObject: locString forKey: key]; } else { [menuLocations removeObjectForKey: key]; } if ([menuLocations count] > 0) { [defaults setObject: menuLocations forKey: NSMenuLocationsKey]; } else { [defaults removeObjectForKey: NSMenuLocationsKey]; } [defaults synchronize]; } } } - (void) _rightMouseDisplay: (NSEvent*)theEvent { [[GSTheme theme] rightMouseDisplay: self forEvent: theEvent]; } @end @implementation NSMenu /* * Class Methods */ + (void) initialize { if (self == [NSMenu class]) { [self setVersion: 1]; nc = [NSNotificationCenter defaultCenter]; } } + (void) setMenuZone: (NSZone*)zone { menuZone = zone; } + (NSZone*) menuZone { return menuZone; } + (BOOL) menuBarVisible { return menuBarVisible; } + (void) setMenuBarVisible: (BOOL)flag { menuBarVisible = flag; } /* * */ - (id) init { return [self initWithTitle: [[NSProcessInfo processInfo] processName]]; } - (void) dealloc { [nc removeObserver: self]; // Now clean the pointer to us stored each _items element [_items makeObjectsPerformSelector: @selector(setMenu:) withObject: nil]; RELEASE(_notifications); RELEASE(_title); RELEASE(_items); [_view setMenu: nil]; RELEASE(_view); RELEASE(_aWindow); RELEASE(_bWindow); RELEASE(_name); [super dealloc]; } /* */ - (id) initWithTitle: (NSString*)aTitle { NSMenuView *menuRep; self = [super init]; if (!self) return nil; // Keep the title. ASSIGN(_title, aTitle); // Create an array to store our menu items. _items = [[NSMutableArray alloc] init]; _menu.changedMessagesEnabled = YES; _notifications = [[NSMutableArray alloc] init]; _menu.needsSizing = YES; // According to the spec, menus do autoenable by default. _menu.autoenable = YES; /* Please note that we own all this menu network of objects. So, none of these objects should be retaining us. When we are deallocated, we release all the objects we own, and that should cause deallocation of the whole menu network. */ // Create the windows that will display the menu. _aWindow = [self _createWindow]; _bWindow = [self _createWindow]; [_bWindow setLevel: NSPopUpMenuWindowLevel]; // Create a NSMenuView to draw our menu items. menuRep = [[NSMenuView alloc] initWithFrame: NSZeroRect]; [self setMenuRepresentation: menuRep]; RELEASE(menuRep); /* Set up the notification to start the process of redisplaying the menus where the user left them the last time. Use NSApplicationDidFinishLaunching, and not NSApplicationWillFinishLaunching, so that the programmer can set up menus in NSApplicationWillFinishLaunching. */ [nc addObserver: self selector: @selector(applicationDidFinishLaunching:) name: NSApplicationDidFinishLaunchingNotification object: NSApp]; [nc addObserver: self selector: @selector(_showOnActivateApp:) name: NSApplicationWillBecomeActiveNotification object: NSApp]; [nc addObserver: self selector: @selector (_menuMoved:) name: NSWindowDidMoveNotification object: _aWindow]; [nc addObserver: self selector: @selector (_updateUserDefaults:) name: NSEnqueuedMenuMoveName object: self]; return self; } /* * Setting Up the Menu Commands */ - (void) menuChanged { // propagate notification up to the main menu if (self == [NSApp mainMenu]) _menu.mainMenuChanged = YES; else [[self supermenu] menuChanged]; } - (void) insertItem: (id )newItem atIndex: (NSInteger)index { NSNotification *inserted; NSDictionary *d; if (![(id)newItem conformsToProtocol: @protocol(NSMenuItem)]) { NSLog(@"You must use an object that conforms to NSMenuItem.\n"); return; } /* * If the item is already attached to another menu it * isn't added. */ if ([newItem menu] != nil) { NSLog(@"The object %@ is already attached to a menu, then it isn't possible to add it.\n", newItem); return; } [_items insertObject: newItem atIndex: index]; _menu.needsSizing = YES; [(NSMenuView*)_view setNeedsSizing: YES]; // Create the notification for the menu representation. d = [NSDictionary dictionaryWithObject: [NSNumber numberWithInt: index] forKey: @"NSMenuItemIndex"]; inserted = [NSNotification notificationWithName: NSMenuDidAddItemNotification object: self userInfo: d]; if (_menu.changedMessagesEnabled) [nc postNotification: inserted]; else [_notifications addObject: inserted]; [self menuChanged]; // Set this after the insert notification has been sent. [newItem setMenu: self]; } - (id ) insertItemWithTitle: (NSString*)aString action: (SEL)aSelector keyEquivalent: (NSString*)charCode atIndex: (NSInteger)index { NSMenuItem *anItem = [[NSMenuItem alloc] initWithTitle: aString action: aSelector keyEquivalent: charCode]; // Insert the new item into the menu. [self insertItem: anItem atIndex: index]; // For returns sake. return AUTORELEASE(anItem); } - (void) addItem: (id )newItem { [self insertItem: newItem atIndex: [_items count]]; } - (id ) addItemWithTitle: (NSString*)aString action: (SEL)aSelector keyEquivalent: (NSString*)keyEquiv { return [self insertItemWithTitle: aString action: aSelector keyEquivalent: keyEquiv atIndex: [_items count]]; } - (void) removeItem: (id )anItem { int index = [self indexOfItem: anItem]; if (-1 == index) return; [self removeItemAtIndex: index]; } - (void) removeItemAtIndex: (NSInteger)index { NSNotification *removed; NSDictionary *d; id anItem = [_items objectAtIndex: index]; if (!anItem) return; [anItem setMenu: nil]; [_items removeObjectAtIndex: index]; _menu.needsSizing = YES; [(NSMenuView*)_view setNeedsSizing: YES]; d = [NSDictionary dictionaryWithObject: [NSNumber numberWithInt: index] forKey: @"NSMenuItemIndex"]; removed = [NSNotification notificationWithName: NSMenuDidRemoveItemNotification object: self userInfo: d]; if (_menu.changedMessagesEnabled) [nc postNotification: removed]; else [_notifications addObject: removed]; [self menuChanged]; } - (void) itemChanged: (id )anObject { NSNotification *changed; NSDictionary *d; NSInteger index = [self indexOfItem: anObject]; if (-1 == index) return; _menu.needsSizing = YES; [(NSMenuView*)_view setNeedsSizing: YES]; d = [NSDictionary dictionaryWithObject: [NSNumber numberWithInt: index] forKey: @"NSMenuItemIndex"]; changed = [NSNotification notificationWithName: NSMenuDidChangeItemNotification object: self userInfo: d]; if (_menu.changedMessagesEnabled) [nc postNotification: changed]; else [_notifications addObject: changed]; [self menuChanged]; // Update the menu. [self update]; } /* * Finding Menu Items */ - (id ) itemWithTag: (NSInteger)aTag { unsigned i; unsigned count = [_items count]; for (i = 0; i < count; i++) { id menuItem = [_items objectAtIndex: i]; if ([menuItem tag] == aTag) return menuItem; } return nil; } - (id ) itemWithTitle: (NSString*)aString { unsigned i; unsigned count = [_items count]; for (i = 0; i < count; i++) { id menuItem = [_items objectAtIndex: i]; if ([[menuItem title] isEqualToString: aString]) return menuItem; } return nil; } - (id ) itemAtIndex: (NSInteger)index { if (index >= [_items count] || index < 0) [NSException raise: NSRangeException format: @"Range error in method -itemAtIndex: "]; return [_items objectAtIndex: index]; } - (NSInteger) numberOfItems { return [_items count]; } - (NSArray*) itemArray { return (NSArray*)_items; } /* * Finding Indices of Menu Items */ - (NSInteger) indexOfItem: (id )anObject { NSUInteger index; index = [_items indexOfObjectIdenticalTo: anObject]; if (index == NSNotFound) return -1; else return index; } - (NSInteger) indexOfItemWithTitle: (NSString*)aTitle { id anItem; if ((anItem = [self itemWithTitle: aTitle])) return [_items indexOfObjectIdenticalTo: anItem]; else return -1; } - (NSInteger) indexOfItemWithTag: (NSInteger)aTag { id anItem; if ((anItem = [self itemWithTag: aTag])) return [_items indexOfObjectIdenticalTo: anItem]; else return -1; } - (NSInteger) indexOfItemWithTarget: (id)anObject andAction: (SEL)actionSelector { unsigned i; unsigned count = [_items count]; for (i = 0; i < count; i++) { NSMenuItem *menuItem = [_items objectAtIndex: i]; if (actionSelector == 0 || sel_isEqual([menuItem action], actionSelector)) { // There are different possibilities to implement the check here if ([menuItem target] == anObject) { return i; } } } return -1; } - (NSInteger) indexOfItemWithRepresentedObject: (id)anObject { NSInteger i, count = [_items count]; for (i = 0; i < count; i++) { if ([[[_items objectAtIndex: i] representedObject] isEqual: anObject]) { return i; } } return -1; } - (NSInteger) indexOfItemWithSubmenu: (NSMenu *)anObject { NSInteger i, count = [_items count]; for (i = 0; i < count; i++) { id item = [_items objectAtIndex: i]; if ([item hasSubmenu] && [[item submenu] isEqual: anObject]) { return i; } } return -1; } // // Managing Submenus. // - (void) setSubmenu: (NSMenu *)aMenu forItem: (id )anItem { [anItem setSubmenu: aMenu]; } - (void) submenuAction: (id)sender { } - (NSMenu *) attachedMenu { if (_attachedMenu && _menu.transient && !_attachedMenu->_menu.transient) return nil; return _attachedMenu; } /** Look for the semantics in the header. Note that this implementation works because there are ... cases: This menu is transient, its supermenu is also transient. In this case we just do the check between the transient windows and everything is fine The menu is transient, its supermenu is not transient. This can go WRONG */ - (BOOL) isAttached { return _superMenu && [_superMenu attachedMenu] == self; } - (BOOL) isTornOff { return _menu.is_tornoff; } - (NSPoint) locationForSubmenu: (NSMenu*)aSubmenu { return [_view locationForSubmenu: aSubmenu]; } - (NSMenu *) supermenu { return _superMenu; } - (void) setSupermenu: (NSMenu *)supermenu { /* The supermenu retains us (indirectly). Do not retain it. */ _superMenu = supermenu; } // // Enabling and Disabling Menu Items // - (void) setAutoenablesItems: (BOOL)flag { _menu.autoenable = flag; } - (BOOL) autoenablesItems { return _menu.autoenable; } - (void) update { if (_delegate) { if ([_delegate respondsToSelector:@selector(menuNeedsUpdate:)]) { [_delegate menuNeedsUpdate:self]; } else if ([_delegate respondsToSelector:@selector(numberOfItemsInMenu:)]) { NSInteger num; num = [_delegate numberOfItemsInMenu: self]; if (num > 0) { BOOL cont = YES; NSInteger i = 0; NSInteger curr = [self numberOfItems]; while (num < curr) { [self removeItemAtIndex: --curr]; } while (num > curr) { [self insertItemWithTitle: @"" action: NULL keyEquivalent: @"" atIndex: curr++]; } // FIXME: Should only process the items we display while (cont && i < num) { cont = [_delegate menu: self updateItem: (NSMenuItem*)[self itemAtIndex: i] atIndex: i shouldCancel: NO]; i++; } } } } // We use this as a recursion check. if (!_menu.changedMessagesEnabled) return; if ([self autoenablesItems]) { unsigned i, count; count = [_items count]; // Temporary disable automatic displaying of menu. [self setMenuChangedMessagesEnabled: NO]; NS_DURING { for (i = 0; i < count; i++) { NSMenuItem *item = [_items objectAtIndex: i]; SEL action = [item action]; id validator = nil; BOOL wasEnabled = [item isEnabled]; BOOL shouldBeEnabled; // Update the submenu items if any. if ([item hasSubmenu]) [[item submenu] update]; // If there is no action - there can be no validator for the item. if (action) { validator = [NSApp targetForAction: action to: [item target] from: item]; } else if (_popUpButtonCell != nil) { if (NULL != (action = [_popUpButtonCell action])) { validator = [NSApp targetForAction: action to: [_popUpButtonCell target] from: [_popUpButtonCell controlView]]; } } if (validator == nil) { if ((action == NULL) && (_popUpButtonCell != nil)) { shouldBeEnabled = YES; } else { shouldBeEnabled = NO; } } else if ([validator respondsToSelector: @selector(validateMenuItem:)]) { shouldBeEnabled = [validator validateMenuItem: item]; } else if ([validator respondsToSelector: @selector(validateUserInterfaceItem:)]) { shouldBeEnabled = [validator validateUserInterfaceItem: item]; } else { shouldBeEnabled = YES; } if (shouldBeEnabled != wasEnabled) { [item setEnabled: shouldBeEnabled]; } } } NS_HANDLER { NSLog(@"Error Occurred While Updating Menu %@: %@", [self title], localException); } NS_ENDHANDLER // Reenable displaying of menus [self setMenuChangedMessagesEnabled: YES]; // this will send pending _notifications } if (_menu.mainMenuChanged) { if (NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil) == NSWindows95InterfaceStyle) { [[GSTheme theme] updateAllWindowsWithMenu: self]; } _menu.mainMenuChanged = NO; } if (_menu.needsSizing && ([_aWindow isVisible] || [_bWindow isVisible])) { NSDebugLLog (@"NSMenu", @" Calling Size To Fit (A)"); [self sizeToFit]; } return; } // // Handling Keyboard Equivalents // - (BOOL) performKeyEquivalent: (NSEvent*)theEvent { unsigned i; unsigned count = [_items count]; NSEventType type = [theEvent type]; unsigned int modifiers = [theEvent modifierFlags]; NSString *keyEquivalent = [theEvent charactersIgnoringModifiers]; unsigned int relevantModifiersMask = NSCommandKeyMask | NSAlternateKeyMask | NSControlKeyMask; /* Take shift key into account only for control keys and arrow and function keys */ if ((modifiers & NSFunctionKeyMask) || ([keyEquivalent length] > 0 && [[NSCharacterSet controlCharacterSet] characterIsMember:[keyEquivalent characterAtIndex:0]])) relevantModifiersMask |= NSShiftKeyMask; if ((type != NSKeyDown && type != NSKeyUp) || [keyEquivalent length] == 0) return NO; for (i = 0; i < count; i++) { NSMenuItem *item = [_items objectAtIndex: i]; if ([item hasSubmenu]) { /* Ignore the Services submenu during menu traversal so that its key equivalents do not accidentally shadow standard key equivalents in the application's own menus. NSApp calls -performKeyEquivalent: explicitly for the Services menu when no matching key equivalent was found here (see NSApplication -sendEvent:). Note: Shadowing is no problem for a standard OpenStep menu, where the Services menu appears close to the end of the main menu, but is very likely for Macintosh or Windows 95 interface styles, where the Services menu appears in the first submenu of the main menu. */ // FIXME Should really remove conflicting key equivalents from the // menus so that users don't get confused. if ([item submenu] == [NSApp servicesMenu]) continue; // Recurse through submenus whether active or not. // Recurse through submenus whether active or not. if ([[item submenu] performKeyEquivalent: theEvent]) { // The event has been handled by an item in the submenu. return YES; } } else { unsigned int mask = [item keyEquivalentModifierMask]; if ([[item keyEquivalent] isEqualToString: keyEquivalent] && (modifiers & relevantModifiersMask) == (mask & relevantModifiersMask)) { if ([item isEnabled]) { [_view performActionWithHighlightingForItemAtIndex: i]; } return YES; } } } return NO; } // // Simulating Mouse Clicks // - (void) performActionForItemAtIndex: (NSInteger)index { id item = [_items objectAtIndex: index]; NSDictionary *d; SEL action; if (![item isEnabled]) return; // Send the actual action and the stipulated notifications. d = [NSDictionary dictionaryWithObject: item forKey: @"MenuItem"]; [nc postNotificationName: NSMenuWillSendActionNotification object: self userInfo: d]; if (_popUpButtonCell != nil) { // Tell the popup button, which item was selected [_popUpButtonCell selectItemAtIndex: index]; } if ((action = [item action]) != NULL) { [NSApp sendAction: action to: [item target] from: item]; } else if (_popUpButtonCell != nil) { if ((action = [_popUpButtonCell action]) != NULL) [NSApp sendAction: action to: [_popUpButtonCell target] from: [_popUpButtonCell controlView]]; } [nc postNotificationName: NSMenuDidSendActionNotification object: self userInfo: d]; } // // Setting the Title // - (void) setTitle: (NSString*)aTitle { ASSIGN(_title, aTitle); _menu.needsSizing = YES; [(NSMenuView*)_view setNeedsSizing: YES]; if ([_aWindow isVisible] || [_bWindow isVisible]) { [self sizeToFit]; } } - (NSString*) title { return _title; } - (id) delegate { return _delegate; } - (void) setDelegate: (id)delegate { _delegate = delegate; } - (float) menuBarHeight { // FIXME return [NSMenuView menuBarHeight]; } // // Setting the Representing Object // - (void) setMenuRepresentation: (id)menuRep { NSView *contentView; if (![menuRep isKindOfClass: [NSMenuView class]]) { NSLog(@"You must use an NSMenuView, or a derivative thereof.\n"); return; } /* If we are replacing a menu representation with a new version, * we should display it in the same view as the old representation. * If we can't find a view for that, we display in the content view * of our default window. */ if ([_view superview] == nil) { contentView = [_aWindow contentView]; } else { contentView = [_view superview]; } if (_view == menuRep) { /* Hack ... if the representation was 'borrowed' for an in-window * menu, we will still have it recorded as ours, but it won't be * in our view hierarchy, so we have to re-add it. */ /* if (contentView != [menuRep superview]) { [contentView addSubview: menuRep]; } */ return; } _menu.horizontal = [menuRep isHorizontal]; if (_view != nil) { // remove the old representation [_view removeFromSuperview]; [_view setMenu: nil]; } ASSIGN(_view, menuRep); [_view setMenu: self]; // add the new representation [contentView addSubview: _view]; } - (id) menuRepresentation { return _view; } - (id) contextMenuRepresentation { return nil; } - (void) setContextMenuRepresentation: (id)representation { } - (id) tearOffMenuRepresentation { return nil; } - (void) setTearOffMenuRepresentation: (id)representation { } // // Updating the Menu Layout // // Wim 20030301: Question, what happens when the notification trigger // new notifications? I think it is not allowed to add items // to the _notifications array while enumerating it. - (void) setMenuChangedMessagesEnabled: (BOOL)flag { if (_menu.changedMessagesEnabled != flag) { if (flag) { if ([_notifications count]) { NSEnumerator *enumerator = [_notifications objectEnumerator]; id aNotification; while ((aNotification = [enumerator nextObject])) [nc postNotification: aNotification]; } // Clean the notification array. [_notifications removeAllObjects]; } _menu.changedMessagesEnabled = flag; } } - (BOOL) menuChangedMessagesEnabled { return _menu.changedMessagesEnabled; } - (void) sizeToFit { NSRect oldWindowFrame; NSRect newWindowFrame; NSRect menuFrame; [_view sizeToFit]; menuFrame = [_view frame]; // Main oldWindowFrame = [_aWindow frame]; newWindowFrame = [NSWindow frameRectForContentRect: menuFrame styleMask: [_aWindow styleMask]]; if (oldWindowFrame.size.height > 1) { newWindowFrame.origin = NSMakePoint (oldWindowFrame.origin.x, oldWindowFrame.origin.y + oldWindowFrame.size.height - newWindowFrame.size.height); } [_aWindow setFrame: newWindowFrame display: NO]; // Transient oldWindowFrame = [_bWindow frame]; newWindowFrame = [NSWindow frameRectForContentRect: menuFrame styleMask: [_bWindow styleMask]]; if (oldWindowFrame.size.height > 1) { newWindowFrame.origin = NSMakePoint (oldWindowFrame.origin.x, oldWindowFrame.origin.y + oldWindowFrame.size.height - newWindowFrame.size.height); } [_bWindow setFrame: newWindowFrame display: NO]; if (_popUpButtonCell == nil) { [_view setFrameOrigin: NSMakePoint (0, 0)]; } [_view setNeedsDisplay: YES]; _menu.needsSizing = NO; } /* * Displaying Context Sensitive Help */ - (void) helpRequested: (NSEvent *)event { // TODO: Won't be implemented until we have NSHelp* } + (void) popUpContextMenu: (NSMenu*)menu withEvent: (NSEvent*)event forView: (NSView*)view { [self popUpContextMenu: menu withEvent: event forView: view withFont: nil]; } + (void) popUpContextMenu: (NSMenu *)menu withEvent: (NSEvent *)event forView: (NSView *)view withFont: (NSFont *)font { [menu _rightMouseDisplay: event]; } /* * NSObject Protocol */ - (BOOL) isEqual: (id)anObject { if (self == anObject) return YES; if ([anObject isKindOfClass: [NSMenu class]]) { if (![_title isEqualToString: [anObject title]]) return NO; return [[self itemArray] isEqual: [anObject itemArray]]; } return NO; } /* * NSCoding Protocol */ - (void) encodeWithCoder: (NSCoder*)encoder { if ([encoder allowsKeyedCoding]) { [encoder encodeObject: _title forKey: @"NSTitle"]; [encoder encodeObject: _items forKey: @"NSMenuItems"]; // if there is no supermenu, make it the main menu. if ([self supermenu] == nil && ![self _ownedByPopUp]) { [encoder encodeObject: @"_NSMainMenu" forKey: @"NSName"]; } } else { BOOL autoenable = _menu.autoenable; [encoder encodeObject: _title]; [encoder encodeObject: _items]; [encoder encodeValueOfObjCType: @encode(BOOL) at: &autoenable]; } } - (id) initWithCoder: (NSCoder*)aDecoder { NSString *dTitle; NSString *dName; NSArray *dItems; BOOL dAuto; unsigned i; if ([aDecoder allowsKeyedCoding]) { // // NSNoAutoenable is present when the "Autoenable" option is NOT checked. // NO = Autoenable menus, YES = Don't auto enable menus. We, therefore, // have to invert the values of this flag in order to get the value of // dAuto. // if ([aDecoder containsValueForKey: @"NSNoAutoenable"]) { dAuto = ![aDecoder decodeBoolForKey: @"NSNoAutoenable"]; } else { dAuto = YES; } dTitle = [aDecoder decodeObjectForKey: @"NSTitle"]; dItems = [aDecoder decodeObjectForKey: @"NSMenuItems"]; if ([aDecoder containsValueForKey: @"NSName"]) { dName = [aDecoder decodeObjectForKey: @"NSName"]; } else { dName = nil; } } else { dTitle = [aDecoder decodeObject]; dItems = [aDecoder decodeObject]; dName = nil; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &dAuto]; } self = [self initWithTitle: dTitle]; [self setAutoenablesItems: dAuto]; [self _setName: dName]; [self setMenuChangedMessagesEnabled: NO]; /* * Make sure that items and submenus are set correctly. */ for (i = 0; i < [dItems count]; i++) { NSMenuItem *item = [dItems objectAtIndex: i]; [self addItem: item]; } [self setMenuChangedMessagesEnabled: YES]; return self; } - (void) awakeFromNib { NSString *name = [self _name]; if (name) { if ([name isEqualToString: @"_NSMainMenu"]) { // NB This is already handled by the nib loading code //[NSApp setMainMenu: self]; } else if ([name isEqualToString: @"_NSAppleMenu"]) { // GNUstep does not handle Apple's application menu specially } else if ([name isEqualToString: @"_NSWindowsMenu"]) { [NSApp setWindowsMenu: self]; } else if ([name isEqualToString: @"_NSServicesMenu"]) { [NSApp setServicesMenu: self]; } else if ([name isEqualToString: @"_NSRecentDocumentsMenu"]) { [[NSDocumentController sharedDocumentController] _setRecentDocumentsMenu: self]; } else if ([name isEqualToString: @"_NSFontMenu"]) { [[NSFontManager sharedFontManager] setFontMenu: self]; } } } /* * NSCopying Protocol */ - (id) copyWithZone: (NSZone*)zone { NSMenu *new = [[NSMenu allocWithZone: zone] initWithTitle: _title]; unsigned i; unsigned count = [_items count]; [new setAutoenablesItems: _menu.autoenable]; for (i = 0; i < count; i++) { // This works because the copy on NSMenuItem sets the menu to nil!!! NSMenuItem *item = [[_items objectAtIndex: i] copyWithZone: zone]; [new insertItem: item atIndex: i]; RELEASE(item); } return new; } @end @implementation NSMenu (GNUstepExtra) - (void) setTornOff: (BOOL)flag { NSMenu *supermenu; _menu.is_tornoff = flag; if (flag) { supermenu = [self supermenu]; if (supermenu != nil) { [[supermenu menuRepresentation] setHighlightedItemIndex: -1]; supermenu->_attachedMenu = nil; } } [_view update]; } - (void) _showTornOffMenuIfAny: (NSNotification*)notification { NSInterfaceStyle style = NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil); if (style == NSMacintoshInterfaceStyle || style == NSWindows95InterfaceStyle) { return; } if ([NSApp mainMenu] != self) { NSString *key; key = [self _locationKey]; if (key != nil) { NSString *location; NSUserDefaults *defaults; NSDictionary *menuLocations; defaults = [NSUserDefaults standardUserDefaults]; menuLocations = [defaults objectForKey: NSMenuLocationsKey]; if ([menuLocations isKindOfClass: [NSDictionary class]]) location = [menuLocations objectForKey: key]; else location = nil; if (location && [location isKindOfClass: [NSString class]]) { [self setTornOff: YES]; [self display]; } } } } - (void) applicationDidFinishLaunching:(NSNotification *)notification { if (NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil) == NSWindows95InterfaceStyle) { [[GSTheme theme] updateAllWindowsWithMenu: [NSApp mainMenu]]; } [self _showTornOffMenuIfAny:notification]; } - (void) _showOnActivateApp: (NSNotification*)notification { if ([NSApp mainMenu] == self) { [self display]; // we must make sure that any attached submenu is visible too. [[self attachedMenu] display]; } } - (BOOL) isTransient { return _menu.transient; } - (BOOL) isPartlyOffScreen { NSWindow *window; window = [self window]; return !NSContainsRect([[window screen] visibleFrame], [window frame]); } - (void) _performMenuClose: (id)sender { if (_attachedMenu) [_view detachSubmenu]; [_view setHighlightedItemIndex: -1]; [self close]; [self setTornOff: NO]; [self _updateUserDefaults: nil]; } - (void) display { if (_menu.transient) { NSDebugLLog (@"NSMenu", @"trying to display while already displayed transient"); } if (_menu.needsSizing) { [self sizeToFit]; } if (_superMenu && ![self isTornOff]) { // query super menu for position [_aWindow setFrameOrigin: [_superMenu locationForSubmenu: self]]; _superMenu->_attachedMenu = self; } else if ([_aWindow frame].origin.y <= 0 && _popUpButtonCell == nil) // get geometry only if not set { [self _setGeometry]; } NSDebugLLog (@"NSMenu", @"Display, origin: %@", NSStringFromPoint ([_aWindow frame].origin)); [_aWindow orderFrontRegardless]; } - (void) displayTransient { NSPoint location; NSView *contentView; if (_menu.transient) { NSDebugLLog (@"NSMenu", @"displaying transient while it is transient"); return; } if (_menu.needsSizing) { [self sizeToFit]; } _oldHiglightedIndex = [[self menuRepresentation] highlightedItemIndex]; _menu.transient = YES; /* * Cache the old submenu if any and query the supermenu our position. * Otherwise, raise menu under the mouse. */ if (_superMenu != nil) { _oldAttachedMenu = _superMenu->_attachedMenu; _superMenu->_attachedMenu = self; location = [_superMenu locationForSubmenu: self]; } else { NSRect frame = [_aWindow frame]; NSInterfaceStyle style; location = [_aWindow mouseLocationOutsideOfEventStream]; location = [_aWindow convertBaseToScreen: location]; location.y -= frame.size.height; /* When using the standard NextStep/OpenStep interface style, the center of the menu's title view is placed below the mouse cursor. However, in Macintosh and Windows95 styles, menus have no visible title. To prevent the user from accidentally selecting the first item, the top left edge is placed below the mouse cursor for them. */ style = NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil); if (style != NSWindows95InterfaceStyle && style != NSMacintoshInterfaceStyle) { location.x -= frame.size.width/2; if (location.x < 0) location.x = 0; location.y += 10; } } [_bWindow setFrameOrigin: location]; [_view removeFromSuperviewWithoutNeedingDisplay]; contentView = [_bWindow contentView]; [contentView addSubview: _view]; [_view update]; [_bWindow orderFront: self]; /* Right mouse buttons which display transient menus don't update * the cursor. So, the current cursor is displayed over the * contextual menu (for example an I beam). However, when menu is * closed the cursor pop, this can set a wrong cursor. We push here * an arrow cursor, the cursor we want at menus. Being sure that * this will pop when menu closes. */ [[NSCursor arrowCursor] push]; } - (void) close { NSMenu *sub = [self attachedMenu]; if (_menu.transient) { NSDebugLLog (@"NSMenu", @"We should not close ordinary menu while transient version is still open"); } /* * If we have an attached submenu, we must close that too - but then make * sure we still have a record of it so that it can be re-displayed if we * are redisplayed. */ if (sub != nil) { [sub close]; _attachedMenu = sub; } [_aWindow orderOut: self]; if (_superMenu && ![self isTornOff]) { _superMenu->_attachedMenu = nil; [[_superMenu menuRepresentation] setHighlightedItemIndex: -1]; } } - (void) closeTransient { NSView *contentView; if (_menu.transient == NO) { NSDebugLLog (@"NSMenu", @"Closing transient: %@ while it is NOT transient now", _title); return; } [_bWindow orderOut: self]; [_view removeFromSuperviewWithoutNeedingDisplay]; contentView = [_aWindow contentView]; [contentView addSubview: _view]; [contentView setNeedsDisplay: YES]; // Restore the old submenu (if any). if (_superMenu != nil) { _superMenu->_attachedMenu = _oldAttachedMenu; [[_superMenu menuRepresentation] setHighlightedItemIndex: [_superMenu indexOfItemWithSubmenu: _superMenu->_attachedMenu]]; } [[self menuRepresentation] setHighlightedItemIndex: _oldHiglightedIndex]; _menu.transient = NO; [_view update]; } - (NSWindow*) window { if (_menu.transient) return (NSWindow *)_bWindow; else return (NSWindow *)_aWindow; } - (void) setMain: (BOOL)isMain { if (isMain) { NSMenuView *oldRep; NSInterfaceStyle oldStyle; NSInterfaceStyle newStyle; oldRep = [self menuRepresentation]; oldStyle = [oldRep interfaceStyle]; newStyle = NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil); /* * If necessary, rebuild menu for (different) style */ if (oldStyle != newStyle) { NSMenuView *newRep; if (oldStyle == NSWindows95InterfaceStyle) { /* Remove the menu from all main windows. */ [[GSTheme theme] updateAllWindowsWithMenu: nil]; } if (newStyle == NSWindows95InterfaceStyle) { [self close]; } newRep = [[NSMenuView alloc] initWithFrame: NSZeroRect]; if (newStyle == NSMacintoshInterfaceStyle || newStyle == NSWindows95InterfaceStyle) { [newRep setHorizontal: YES]; } else { [newRep setHorizontal: NO]; } [newRep setInterfaceStyle: newStyle]; [self setMenuRepresentation: newRep]; [self _organizeMenu]; RELEASE(newRep); if (newStyle == NSWindows95InterfaceStyle) { /* Put menu in all main windows for microsoft style. */ [[GSTheme theme] updateAllWindowsWithMenu: self]; } } /* Adjust the menu window to suit the menu view unless the menu * is being displayed in the application main window. */ if (newStyle != NSWindows95InterfaceStyle) { [[self window] setTitle: [[NSProcessInfo processInfo] processName]]; [[self window] setLevel: NSMainMenuWindowLevel]; [self _setGeometry]; [self sizeToFit]; if ([NSApp isActive]) { [self display]; } } } else { [[self window] setLevel: NSSubmenuWindowLevel]; } } /** Set the frame origin of the receiver to aPoint. If a submenu of the receiver is attached. The frame origin of the submenu is set appropriately. */ - (void) nestedSetFrameOrigin: (NSPoint) aPoint { NSWindow *theWindow = [self window]; // Move ourself and get our width. [theWindow setFrameOrigin: aPoint]; // Do the same for attached menus. if (_attachedMenu) { aPoint = [self locationForSubmenu: _attachedMenu]; [_attachedMenu nestedSetFrameOrigin: aPoint]; } } #define SHIFT_DELTA 18.0 - (void) shiftOnScreen { NSWindow *theWindow = [self window]; NSRect frameRect = [theWindow frame]; NSRect screenRect = [[theWindow screen] visibleFrame]; NSPoint vector = {0.0, 0.0}; BOOL moveIt = NO; NSPoint location = [theWindow mouseLocationOutsideOfEventStream]; NSPoint pointerLoc = [theWindow convertBaseToScreen: location]; NSInterfaceStyle style = NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil); // Don't move the main menu bar in Macintosh interface style, this is // annoying (in particular, since the effective screen range is reduced // by the height of the menu bar!) if (style == NSMacintoshInterfaceStyle && [self isEqual: [NSApp mainMenu]]) return; // 1 - determine the amount we need to shift in the y direction. if (pointerLoc.y <= 1 && NSMinY (frameRect) < 0) { vector.y = MIN (SHIFT_DELTA, -NSMinY (frameRect)); moveIt = YES; } /* Note: pointerLoc.y may be greater than NSMaxY(screenRect) if we have a horizontal menu bar at the top of the screen (Macintosh interface style) */ // FIXME Don't move the horizontal menu bar downward in this case! else if (pointerLoc.y >= NSMaxY(screenRect) && NSMaxY (frameRect) > NSMaxY (screenRect)) { vector.y = -MIN (SHIFT_DELTA, NSMaxY (frameRect) - NSMaxY (screenRect)); moveIt = YES; } // 2 - determine the amount we need to shift in the x direction. if (pointerLoc.x == 0 && NSMinX (frameRect) < 0) { vector.x = MIN (SHIFT_DELTA, -NSMinX (frameRect)); moveIt = YES; } // Note the -3. This is done so the menu, after shifting completely // has some spare room on the right hand side. This is needed otherwise // the user can never access submenus of this menu. else if (pointerLoc.x == NSMaxX(screenRect) - 1 && NSMaxX (frameRect) > NSMaxX (screenRect) - 3) { vector.x = -MIN (SHIFT_DELTA, NSMaxX (frameRect) - NSMaxX (screenRect) + 3); moveIt = YES; } if (moveIt) { NSPoint masterLocation; NSPoint destinationPoint; if (style == NSMacintoshInterfaceStyle || _menu.horizontal) { masterLocation = frameRect.origin; destinationPoint.x = masterLocation.x + vector.x; destinationPoint.y = masterLocation.y + vector.y; [self nestedSetFrameOrigin: destinationPoint]; } else { NSMenu *candidateMenu; NSMenu *masterMenu; // Look for the "master" menu, i.e. the one to move from. for (candidateMenu = masterMenu = self; (candidateMenu = masterMenu->_superMenu) && !candidateMenu->_menu.horizontal && (!masterMenu->_menu.is_tornoff || masterMenu->_menu.transient); masterMenu = candidateMenu); masterLocation = [[masterMenu window] frame].origin; destinationPoint.x = masterLocation.x + vector.x; destinationPoint.y = masterLocation.y + vector.y; [masterMenu nestedSetFrameOrigin: destinationPoint]; } } } - (BOOL)_ownedByPopUp { return _popUpButtonCell != nil; } - (NSPopUpButtonCell *)_owningPopUp { return _popUpButtonCell; } - (void)_setOwnedByPopUp: (NSPopUpButtonCell*)popUp { if (_popUpButtonCell != popUp) { _popUpButtonCell = popUp; if (popUp != nil) { [_aWindow setLevel: NSPopUpMenuWindowLevel]; [_bWindow setLevel: NSPopUpMenuWindowLevel]; } } [self update]; } - (NSString*) description { return [NSString stringWithFormat: @"NSMenu: %@ (%@)", _title, _menu.transient ? @"Transient": @"Normal"]; } @end gnustep-gui-0.24.0/Source/NSFormCell.m0000664000076500007650000003300212144502350017316 0ustar brains99brains99/** NSFormCell The cell class for the NSForm control Copyright (C) 1996, 1999 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: March 1997 Author: Nicola Pero Date: November 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import #import "AppKit/NSAttributedString.h" #import "AppKit/NSColor.h" #import "AppKit/NSFormCell.h" #import "AppKit/NSFont.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSTextFieldCell.h" #import "GNUstepGUI/GSTheme.h" /**

TODO Description

*/ @implementation NSFormCell + (void) initialize { if (self == [NSFormCell class]) { [self setVersion: 1]; } } /* The title attributes are those inherited from the NSActionCell class. */ - (id) init { return [self initTextCell: @"Field:"]; } /**

Initializes and returns new NSFormCell with aString as its title and the text cell with an empty NSString.

See Also: [NSCell-initTextCell:]

*/ - (id) initTextCell: (NSString *)aString { self = [super initTextCell: @""]; if (nil == self) return nil; _cell.is_bezeled = YES; _cell.is_editable = YES; [self setAlignment: NSLeftTextAlignment]; _titleCell = [[NSCell alloc] initTextCell: aString]; [_titleCell setAlignment: NSRightTextAlignment]; _formcell_auto_title_width = YES; _displayedTitleWidth = -1; return self; } - (void)dealloc { RELEASE(_titleCell); TEST_RELEASE(_placeholder); [super dealloc]; } /**

Returns whether the NSFormCell is Opaque. Returns YES if the textCell and the title cell are both Opaque, NO otherwise

See Also: [NSCell-isOpaque]

*/ - (BOOL)isOpaque { return [_titleCell isOpaque] && [super isOpaque]; } - (void)setAttributedTitle: (NSAttributedString *)anAttributedString { [_titleCell setAttributedStringValue: anAttributedString]; if (_formcell_auto_title_width) { // Invalidates title width _displayedTitleWidth = -1; // Update the control(s) [[NSNotificationCenter defaultCenter] postNotificationName: _NSFormCellDidChangeTitleWidthNotification object: self]; } } /**

Sets the NSFormCell title to aString. TODO => _formcell_auto_title_width / Update the control(s)

*/ - (void)setTitle: (NSString*)aString { [_titleCell setStringValue: aString]; if (_formcell_auto_title_width) { // Invalidates title width _displayedTitleWidth = -1; // Update the control(s) [[NSNotificationCenter defaultCenter] postNotificationName: _NSFormCellDidChangeTitleWidthNotification object: self]; } } - (void)setTitleWithMnemonic:(NSString *)titleWithAmpersand { [_titleCell setTitleWithMnemonic: titleWithAmpersand]; if (_formcell_auto_title_width) { // Invalidates title width _displayedTitleWidth = -1; // Update the control(s) [[NSNotificationCenter defaultCenter] postNotificationName: _NSFormCellDidChangeTitleWidthNotification object: self]; } } /**

Sets the text alignment of the NSFormCell's title to mode. NSRightTextAlignment by default. See NSTextAlignment for more informations.

See Also: -titleAlignment [NSCell-setAlignment:]

*/ - (void)setTitleAlignment: (NSTextAlignment)mode { [_titleCell setAlignment: mode]; } /**

Set the text font of the NSFormCell's title to fontObject.

See Also: -titleFont [NSCell-setFont:]

*/ - (void)setTitleFont: (NSFont*)fontObject { [_titleCell setFont: fontObject]; if (_formcell_auto_title_width) { // Invalidates title width _displayedTitleWidth = -1; // Update the control(s) [[NSNotificationCenter defaultCenter] postNotificationName: _NSFormCellDidChangeTitleWidthNotification object: self]; } } /**

Sets the width of the NSFormCell's title to width. All NSFormCell of the NSForm are updated

See Also: -titleWidth

*/ - (void)setTitleWidth: (CGFloat)width { if (width >= 0) { _formcell_auto_title_width = NO; _displayedTitleWidth = width; } else { _formcell_auto_title_width = YES; _displayedTitleWidth = -1; } // TODO: Don't updated the control if nothing changed. // Update the control(s) [[NSNotificationCenter defaultCenter] postNotificationName: _NSFormCellDidChangeTitleWidthNotification object: self]; } - (NSAttributedString *)attributedTitle { return [_titleCell attributedStringValue]; } /**

Returns the NSFormCell's title.

See Also: -setTitle: [NSCell-stringValue]

*/ - (NSString*)title { return [_titleCell stringValue]; } /**

Returns the text alignment of the NSFormCell's title. NSRightTextAlignment by default. See NSTextAlignment for more informations

See Also: -setTitleAlignment:

*/ - (NSTextAlignment)titleAlignment { return [_titleCell alignment]; } /**

Returns the text font of the NSFormCell's title

See Also: -setTitleFont: [NSCell-font]

*/ - (NSFont*)titleFont { return [_titleCell font]; } /**

Returns the writing direction of the NSFormCell's title

See Also: -setTitleBaseWritingDirection: [NSCell-baseWritingDirection]

*/ - (NSWritingDirection)titleBaseWritingDirection { return [_titleCell baseWritingDirection]; } /**

Sets the writing direction of the NSFormCell's title

See Also: -titleBaseWritingDirection: [NSCell-setBaseWritingDirection]

*/ - (void)setTitleBaseWritingDirection: (NSWritingDirection)writingDirection { [_titleCell setBaseWritingDirection: writingDirection]; } // // Warning: this method returns the width of the title; the width the // title would have if the cell was the only cell in the form. This // is used by NSForm to align all the cells in its form. This is to // say that this title width is *not* what you are going to see on the // screen if more than one cell is present. Setting a titleWidth // manually with setTitleWidth: disables any alignment with other // cells. // - (CGFloat)titleWidth { if (_formcell_auto_title_width == NO) return _displayedTitleWidth; else { NSSize titleSize = [_titleCell cellSize]; return titleSize.width; } } - (CGFloat)titleWidth: (NSSize)aSize { if (_formcell_auto_title_width == NO) return _displayedTitleWidth; else { NSSize titleSize = [_titleCell cellSize]; if (aSize.width > titleSize.width) return titleSize.width; else return aSize.width; } } - (NSAttributedString*)placeholderAttributedString { if (_formcell_placeholder_is_attributed_string == YES) { return (NSAttributedString*)_placeholder; } else { return nil; } } - (NSString*)placeholderString { if (_formcell_placeholder_is_attributed_string == YES) { return nil; } else { return (NSString*)_placeholder; } } - (void)setPlaceholderAttributedString: (NSAttributedString*)string { ASSIGN(_placeholder, string); _formcell_placeholder_is_attributed_string = YES; } - (void)setPlaceholderString: (NSString*)string { ASSIGN(_placeholder, string); _formcell_placeholder_is_attributed_string = NO; } // Updates the title width. The width of aRect is the new title width // to display. Invoked by NSForm to align the editable parts of the // cells. - (void) calcDrawInfo: (NSRect)aRect { if (_formcell_auto_title_width == NO) return; _displayedTitleWidth = aRect.size.width; } - (NSSize)cellSize { NSSize returnedSize; NSSize titleSize = [_titleCell cellSize]; NSSize textSize; if (_contents != nil) textSize = [super cellSize]; else { ASSIGN (_contents, @"Minimum"); _cell.contents_is_attributed_string = NO; textSize = [super cellSize]; DESTROY (_contents); } returnedSize.width = titleSize.width + 3 + textSize.width; if (titleSize.height > textSize.height) returnedSize.height = titleSize.height; else returnedSize.height = textSize.height; return returnedSize; } - (NSRect) drawingRectForBounds: (NSRect)theRect { // Safety check if (_displayedTitleWidth == -1) _displayedTitleWidth = [self titleWidth]; theRect.origin.x += _displayedTitleWidth + 3; theRect.size.width -= _displayedTitleWidth + 3; return [super drawingRectForBounds: theRect]; } - (void) resetCursorRect: (NSRect)cellFrame inView: (NSView *)controlView { NSRect rect = NSMakeRect(cellFrame.origin.x + 3 + [self titleWidth], NSMinY(cellFrame), NSWidth(cellFrame) - 3 - [self titleWidth], NSHeight(cellFrame)); [super resetCursorRect: rect inView: controlView]; } - (void) _drawBorderAndBackgroundWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { NSRect borderedFrame = cellFrame; // // Draw border // borderedFrame.origin.x += _displayedTitleWidth + 3; borderedFrame.size.width -= _displayedTitleWidth + 3; [super _drawBorderAndBackgroundWithFrame: borderedFrame inView: controlView]; // Draw text background [[NSColor textBackgroundColor] set]; NSRectFill([self drawingRectForBounds: cellFrame]); } - (void) drawWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { NSRect titleFrame = cellFrame; // Safety check if (_displayedTitleWidth == -1) _displayedTitleWidth = [self titleWidth]; // Draw title titleFrame.size.width = _displayedTitleWidth; [_titleCell drawWithFrame: titleFrame inView: controlView]; // Draw text [super drawWithFrame: cellFrame inView: controlView]; } /* Attributed string that will be displayed. */ - (NSAttributedString*)_drawAttributedString { NSAttributedString *attrStr; attrStr = [super _drawAttributedString]; if (attrStr == nil) { attrStr = [self placeholderAttributedString]; if (attrStr == nil) { NSString *string; NSDictionary *attributes; NSMutableDictionary *newAttribs; string = [self placeholderString]; if (string == nil) { return nil; } attributes = [self _nonAutoreleasedTypingAttributes]; newAttribs = [NSMutableDictionary dictionaryWithDictionary: attributes]; [newAttribs setObject: [NSColor disabledControlTextColor] forKey: NSForegroundColorAttributeName]; return AUTORELEASE([[NSAttributedString alloc] initWithString: string attributes: newAttribs]); } else { return attrStr; } } else { return attrStr; } } /* * Copying */ - (id) copyWithZone: (NSZone*)zone { NSFormCell *c = (NSFormCell *)[super copyWithZone:zone]; /* We need to copy the title cell (as opposed to simply copying the pointer to it), otherwise if eg we change the string value of the title cell of the copied cell, the string value of the title cell of the original cell would be changed too ! */ c->_titleCell = [_titleCell copyWithZone: zone]; c->_placeholder = [_placeholder copyWithZone: zone]; return c; } - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { /* if ([self stringValue] != nil) { [aCoder encodeObject: [self stringValue] forKey: @"NSContents"]; } */ [aCoder encodeFloat: [self titleWidth] forKey: @"NSTitleWidth"]; [aCoder encodeObject: _titleCell forKey: @"NSTitleCell"]; } else { BOOL tmp = _formcell_auto_title_width; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &tmp]; [aCoder encodeValueOfObjCType: @encode(float) at: &_displayedTitleWidth]; [aCoder encodeObject: _titleCell]; } } - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if (nil == self) return nil; if ([aDecoder allowsKeyedCoding]) { if ([aDecoder containsValueForKey: @"NSContents"]) { [self setStringValue: [aDecoder decodeObjectForKey: @"NSContents"]]; } if ([aDecoder containsValueForKey: @"NSTitleWidth"]) { [self setTitleWidth: [aDecoder decodeFloatForKey: @"NSTitleWidth"]]; } if ([aDecoder containsValueForKey: @"NSTitleCell"]) { ASSIGN(_titleCell, [aDecoder decodeObjectForKey: @"NSTitleCell"]); } } else { BOOL tmp; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &tmp]; _formcell_auto_title_width = tmp; [aDecoder decodeValueOfObjCType: @encode(float) at: &_displayedTitleWidth]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_titleCell]; } return self; } @end gnustep-gui-0.24.0/Source/NSDataLinkPanel.m0000664000076500007650000001300212121417516020264 0ustar brains99brains99/** NSDataLinkPanel Copyright (C) 1996, 2003, 2004 Free Software Foundation, Inc. Author: Gregory John Casamento Author: Scott Christley Date: 1996, 2003, 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import "AppKit/NSApplication.h" #import "AppKit/NSDataLinkPanel.h" #import "AppKit/NSDataLinkManager.h" #import "AppKit/NSDataLink.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSView.h" #import "AppKit/NSNibLoading.h" #import "GSGuiPrivate.h" static NSDataLinkPanel *_sharedDataLinkPanel; @interface GSDataLinkPanelController : NSObject { id panel; } - (id) panel; @end @implementation GSDataLinkPanelController - (id) init { if ((self = [super init]) != nil) { if ([NSBundle loadNibNamed: @"GSDataLinkPanel" owner: self] == NO) { NSRunAlertPanel(@"Error", @"Could not load data link panel resource", @"OK", NULL, NULL); return nil; } } return self; } - (id) panel { return panel; } - (void) dealloc { RELEASE(panel); [super dealloc]; } @end @implementation NSApplication (NSDataLinkPanel) /** * Order the data link panel to the front. If it has not already * been instantiated, instantiate it. */ - (void) orderFrontDataLinkPanel: sender { NSDataLinkPanel *dataLinkPanel = [NSDataLinkPanel sharedDataLinkPanel]; if (dataLinkPanel) [dataLinkPanel orderFront: nil]; else NSBeep(); } @end @implementation NSDataLinkPanel + (void)initialize { if (self == [NSDataLinkPanel class]) { // Initial version [self setVersion: 0]; } } /** * Initializes and returns the shared panel. */ + (NSDataLinkPanel *)sharedDataLinkPanel { if (_sharedDataLinkPanel == nil) { id controller = [[GSDataLinkPanelController alloc] init]; ASSIGN(_sharedDataLinkPanel, [controller panel]); RELEASE(controller); } return _sharedDataLinkPanel; } /** * Get the currently selected array of links and thier respective managers. * Return the whether or not multiple links are selected in flag. */ + (void)getLink:(NSDataLink **)link manager:(NSDataLinkManager **)linkManager isMultiple:(BOOL *)flag { [[NSDataLinkPanel sharedDataLinkPanel] getLink: link manager: linkManager isMultiple: flag]; } /** * Set the currently selected array of links and their respective managers. * If all of the given links should be selected flag should be YES. */ + (void)setLink:(NSDataLink *)link manager:(NSDataLinkManager *)linkManager isMultiple:(BOOL)flag { [[NSDataLinkPanel sharedDataLinkPanel] setLink: link manager: linkManager isMultiple: flag]; } // // Instance methods // /** * Get the currently selected array of links and thier respective managers. * Return the whether or not multiple links are selected in flag. */ - (void)getLink:(NSDataLink **)link manager:(NSDataLinkManager **)linkManager isMultiple:(BOOL *)flag { ASSIGN(*link, _currentDataLink); ASSIGN(*linkManager, _currentDataLinkManager); *flag = _multipleSelection; } /** * Set the currently selected array of links and their respective managers. * If all of the given links should be selected flag should be YES. */ - (void)setLink:(NSDataLink *)link manager:(NSDataLinkManager *)linkManager isMultiple:(BOOL)flag { ASSIGN(_currentDataLink, link); ASSIGN(_currentDataLinkManager, linkManager); _multipleSelection = flag; } // // Customizing the Panel // /** * Add an accessory view to the panel. */ - (NSView *)accessoryView { // not yet implemented. return nil; } /** * Get the accessory view. */ - (void)setAccessoryView:(NSView *)aView { // not yet implemented. } // // Responding to User Input // /** * Called when the user presses the Break All Links button. * Invokes breakAllLinks on the current link manager. */ - (void)pickedBreakAllLinks:(id)sender { [_currentDataLinkManager breakAllLinks]; } /** * Called when the user presses the Break button. * Invokes break on the current link. */ - (void)pickedBreakLink:(id)sender { [_currentDataLink break]; } /** * Called when the user presses the Open Source button. * Invokes openSource on the current link. */ - (void)pickedOpenSource:(id)sender { [_currentDataLink openSource]; } /** * Called when the Update Destination button * Invokes updateDestination on the current link. */ - (void)pickedUpdateDestination:(id)sender { [_currentDataLink updateDestination]; } /** * Called when the user selects an update mode from the pull down. * Invokes setUpdateMode: on the current link. */ - (void)pickedUpdateMode:(id)sender { NSDataLinkUpdateMode mode = (NSDataLinkUpdateMode)[sender tag]; [_currentDataLink setUpdateMode: mode]; } @end gnustep-gui-0.24.0/Source/NSForm.m0000664000076500007650000002654612121417516016541 0ustar brains99brains99/** NSForm Form class, a matrix of text fields with labels Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: March 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import #import "AppKit/NSForm.h" #import "AppKit/NSFormCell.h" @implementation NSForm /* Class variables */ static Class defaultCellClass = nil; + (void) initialize { if (self == [NSForm class]) { /* Set the initial version */ [self setVersion: 1]; /* Set the default cell class */ defaultCellClass = [NSFormCell class]; } } + (Class) cellClass { return defaultCellClass; } + (void) setCellClass: (Class)classId { defaultCellClass = classId; } - (id) initWithFrame: (NSRect)frameRect mode: (NSMatrixMode)aMode cellClass: (Class)class numberOfRows: (NSInteger)rowsHigh numberOfColumns: (NSInteger)colsWide { self = [super initWithFrame: frameRect mode: aMode cellClass: class numberOfRows: rowsHigh numberOfColumns: colsWide]; if (nil == self) return nil; [self setIntercellSpacing: NSMakeSize (0, 4)]; return self; } - (id) initWithFrame: (NSRect)frameRect mode: (NSMatrixMode)aMode prototype: (NSCell*)prototype numberOfRows: (NSInteger)rowsHigh numberOfColumns: (NSInteger)colsWide { self = [super initWithFrame: frameRect mode: aMode prototype: prototype numberOfRows: rowsHigh numberOfColumns: colsWide]; if (nil == self) return nil; [self setIntercellSpacing: NSMakeSize (0, 4)]; return self; } /**

Adds a new entry with title as its title at the end of the NSForm and returns the NSFormCell.

See Also: -insertEntry:atIndex: -removeEntryAtIndex:

*/ - (NSFormCell*) addEntry: (NSString*)title { return [self insertEntry: title atIndex: [self numberOfRows]]; } /**

Inserts a new entry with title as its title at the index index of the NSForm and returns the NSFormCell.

See Also: -addEntry: -removeEntryAtIndex:

*/ - (NSFormCell*) insertEntry: (NSString*)title atIndex: (NSInteger)index { NSFormCell *new_cell = [[[object_getClass(self) cellClass] alloc] initTextCell: title]; [self insertRow: index]; [self putCell: new_cell atRow: index column: 0]; RELEASE (new_cell); return new_cell; } /**

Removes the entry at index index.

See Also: -insertEntry:atIndex: -addEntry:

*/ - (void) removeEntryAtIndex: (NSInteger)index { [[NSNotificationCenter defaultCenter] removeObserver: self name: _NSFormCellDidChangeTitleWidthNotification object: [self cellAtRow: index column: 0]]; [self removeRow: index]; } /* Overriding this method allows decoding stuff to be inherited simpler by NSForm */ - (void) putCell: (NSCell*)newCell atRow: (NSInteger)row column: (NSInteger)column { if (column > 0) { NSLog (@"Warning: NSForm: tried to add a cell in a column > 0"); return; } [super putCell: newCell atRow: row column: column]; [self setValidateSize: YES]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_setTitleWidthNeedsUpdate:) name: _NSFormCellDidChangeTitleWidthNotification object: newCell]; } - (void) dealloc { [[NSNotificationCenter defaultCenter] removeObserver: self name: _NSFormCellDidChangeTitleWidthNotification object: nil]; [super dealloc]; } /**

Sets whether then NSForm's entries have bezeled border.

See Also: [NSCell-setBezeled:]

*/ - (void) setBezeled: (BOOL)flag { NSInteger i, count = [self numberOfRows]; /* Set the bezeled attribute to the cell prototype */ [[self prototype] setBezeled: flag]; for (i = 0; i < count; i++) [[self cellAtRow: i column: 0] setBezeled: flag]; } /**

Sets whether then NSForm's entries have border

See Also: [NSCell-setBordered:]

*/ - (void) setBordered: (BOOL)flag { NSInteger i, count = [self numberOfRows]; /* Set the bordered attribute to the cell prototype */ [[self prototype] setBordered: flag]; for (i = 0; i < count; i++) [[self cellAtRow: i column: 0] setBordered: flag]; } /**

Sets the width of all entries to width

See Also: [NSMatrix-setCellSize:]

*/ - (void) setEntryWidth: (float)width { NSSize size = [self cellSize]; size.width = width; [self setCellSize: size]; } /**

Sets the size of the frame to aSize

See Also: [NSView-setFrameSize:]

*/ - (void) setFrameSize: (NSSize)aSize { [super setFrameSize: aSize]; // Set the width of the entries independent of autosizesCells _cellSize.width = _bounds.size.width; } /**

Sets the spacing between all entries to spacing. By default the spacing is 4.

See Also: [NSMatrix-setIntercellSpacing:]

*/ - (void) setInterlineSpacing: (CGFloat)spacing { [self setIntercellSpacing: NSMakeSize(0, spacing)]; } /* For the title attributes we use the corresponding attributes from the cell. For the text attributes we use instead the attributes inherited from the NSCell class. */ /**

Sets the text alignment of the title to aMode for all entries. See NSTextAlignment for more informations. The default title alignment is NSLeftTextAlignment

See Also: [NSFormCell-setTitleAlignment:] -setTextAlignment:

*/ - (void) setTitleAlignment: (NSTextAlignment)aMode { NSInteger i, count = [self numberOfRows]; /* Set the title alignment attribute to the cell prototype */ [[self prototype] setTitleAlignment: aMode]; for (i = 0; i < count; i++) [[self cellAtRow: i column: 0] setTitleAlignment: aMode]; } /**

Sets the text alignment to aMode for all entries. See NSTextAlignment for more informations. The default text alignment is NSRightTextAlignment

See Also: -setTitleAlignment: [NSCell-setAlignment:]

*/ - (void) setTextAlignment: (NSTextAlignment)aMode { NSInteger i, count = [self numberOfRows]; /* Set the text alignment attribute to the cell prototype */ [[self prototype] setAlignment: aMode]; for (i = 0; i < count; i++) [[self cellAtRow: i column: 0] setAlignment: aMode]; } /**

Sets the text font of the title to fontObject for all entries

See Also: [NSFormCell-setTitleFont:] -setTextFont:

*/ - (void) setTitleFont: (NSFont*)fontObject { NSInteger i, count = [self numberOfRows]; /* Set the title font attribute to the cell prototype */ [[self prototype] setTitleFont: fontObject]; for (i = 0; i < count; i++) [[self cellAtRow: i column: 0] setTitleFont: fontObject]; } /**

Sets the text font to fontObject for all entries

See Also: [NSCell-setFont:] -setTitleFont:

*/ - (void) setTextFont: (NSFont*)fontObject { NSInteger i, count = [self numberOfRows]; /* Set the text font attribute to the cell prototype */ [[self prototype] setFont: fontObject]; for (i = 0; i < count; i++) [[self cellAtRow: i column: 0] setFont: fontObject]; } /**

Sets the title writing direction to direction for all entries

See Also: [NSFormCell-setTitleBaseWritingDirection:] -setTextBaseWritingDirection:

*/ - (void) setTitleBaseWritingDirection: (NSWritingDirection)direction { NSInteger i, count = [self numberOfRows]; /* Set the writing direction attribute to the cell prototype */ [[self prototype] setTitleBaseWritingDirection: direction]; for (i = 0; i < count; i++) [[self cellAtRow: i column: 0] setTitleBaseWritingDirection: direction]; } /**

Sets the contents writing direction to direction for all entries

See Also: [NSCell-setBaseWritingDirection:] -setTitleBaseWritingDirection:

*/ - (void) setTextBaseWritingDirection: (NSWritingDirection)direction { NSInteger i, count = [self numberOfRows]; /* Set the writing direction attribute to the cell prototype */ [[self prototype] setBaseWritingDirection: direction]; for (i = 0; i < count; i++) [[self cellAtRow: i column: 0] setBaseWritingDirection: direction]; } /**

Returns the index of the entry specified by aTag or -1 if aTag is not found in entries.

See Also: [NSMatrix-cellAtRow:column:]

*/ - (NSInteger) indexOfCellWithTag: (NSInteger)aTag { NSInteger i, count = [self numberOfRows]; for (i = 0; i < count; i++) if ([[self cellAtRow: i column: 0] tag] == aTag) return i; return -1; } /**

Returns the index of the current selected entry.

[NSMatrix-selectedRow]

*/ - (NSInteger) indexOfSelectedItem { return [self selectedRow]; } /**

Returns the NSFormCell at index index

See Also: [NSMatrix-cellAtRow:column:]

*/ - (id) cellAtIndex: (NSInteger)index { return [self cellAtRow: index column: 0]; } -(void) _setTitleWidthNeedsUpdate: (NSNotification*)notification { [self setValidateSize: YES]; } - (void) setValidateSize: (BOOL)flag { _title_width_needs_update = flag; // TODO: Think about reducing redisplaying if (flag) [self setNeedsDisplay]; } - (void) calcSize { NSInteger i, count = [self numberOfRows]; CGFloat new_title_width = 0; CGFloat candidate_title_width = 0; NSRect rect; // Compute max of title width in the cells for (i = 0; i < count; i++) { candidate_title_width = [_cells[i][0] titleWidth]; if (candidate_title_width > new_title_width) new_title_width = candidate_title_width; } // Suggest this max as title width to all cells rect = NSMakeRect (0, 0, new_title_width, 0); for (i = 0; i < count; i++) { [_cells[i][0] calcDrawInfo: rect]; } _title_width_needs_update = NO; } - (void) drawRect: (NSRect)rect { if (_title_width_needs_update) [self calcSize]; [super drawRect: rect]; } /**

Draws the NSFormCell at the specified index

See Also: -cellAtIndex: [NSCell-drawWithFrame:inView:] [NSMatrix-cellFrameAtRow:column:]

*/ - (void) drawCellAtIndex: (NSInteger)index { id theCell = [self cellAtIndex: index]; [theCell drawWithFrame: [self cellFrameAtRow: index column: 0] inView: self]; } - (void) drawCellAtRow: (NSInteger)row column: (NSInteger)column { [self drawCellAtIndex: row]; } /**

Selects the text in the entry specified by index.

[NSMatrix-selectTextAtRow:column:]

*/ - (void) selectTextAtIndex: (NSInteger)index { [self selectTextAtRow: index column: 0]; } @end gnustep-gui-0.24.0/Source/NSCollectionView.m0000664000076500007650000007273212135015226020557 0ustar brains99brains99/** NSCollectionView Copyright (C) 2013 Free Software Foundation, Inc. Author: Doug Simons (doug.simons@testplant.com) Frank LeGrand (frank.legrand@testplant.com) Date: February 2013 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "Foundation/NSKeyedArchiver.h" #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSClipView.h" #import "AppKit/NSCollectionView.h" #import "AppKit/NSCollectionViewItem.h" #import "AppKit/NSEvent.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSImage.h" #import "AppKit/NSPasteboard.h" #import "AppKit/NSWindow.h" #include static NSString* NSCollectionViewMinItemSizeKey = @"NSMinGridSize"; static NSString* NSCollectionViewMaxItemSizeKey = @"NSMaxGridSize"; //static NSString* NSCollectionViewVerticalMarginKey = @"NSCollectionViewVerticalMarginKey"; static NSString* NSCollectionViewMaxNumberOfRowsKey = @"NSMaxNumberOfGridRows"; static NSString* NSCollectionViewMaxNumberOfColumnsKey = @"NSMaxNumberOfGridColumns"; static NSString* NSCollectionViewSelectableKey = @"NSSelectable"; static NSString* NSCollectionViewAllowsMultipleSelectionKey = @"NSAllowsMultipleSelection"; static NSString* NSCollectionViewBackgroundColorsKey = @"NSBackgroundColors"; /* * Class variables */ static NSString *placeholderItem = nil; @interface NSCollectionView (CollectionViewInternalPrivate) - (void) _initDefaults; - (void) _resetItemSize; - (void) _removeItemsViews; - (NSInteger) _indexAtPoint: (NSPoint)point; - (NSRect) _frameForRowOfItemAtIndex: (NSUInteger)theIndex; - (NSRect) _frameForRowsAroundItemAtIndex: (NSUInteger)theIndex; - (void) _modifySelectionWithNewIndex: (NSUInteger)anIndex direction: (int)aDirection expand: (BOOL)shouldExpand; - (void) _moveDownAndExpandSelection: (BOOL)shouldExpand; - (void) _moveUpAndExpandSelection: (BOOL)shouldExpand; - (void) _moveLeftAndExpandSelection: (BOOL)shouldExpand; - (void) _moveRightAndExpandSelection: (BOOL)shouldExpand; - (BOOL) _writeItemsAtIndexes: (NSIndexSet *)indexes toPasteboard: (NSPasteboard *)pasteboard; - (BOOL) _startDragOperationWithEvent: (NSEvent*)event clickedIndex: (NSUInteger)index; - (void) _selectWithEvent: (NSEvent *)theEvent index: (NSUInteger)index; @end @implementation NSCollectionView // // Class methods // + (void) initialize { placeholderItem = @"Placeholder"; } - (id) initWithFrame: (NSRect)frame { if ((self = [super initWithFrame:frame])) { [self _initDefaults]; } return self; } -(void) _initDefaults { // _draggingSourceOperationMaskForLocal = NSDragOperationCopy | NSDragOperationLink | NSDragOperationGeneric | NSDragOperationPrivate; _draggingSourceOperationMaskForLocal = NSDragOperationGeneric | NSDragOperationMove | NSDragOperationCopy; _draggingSourceOperationMaskForRemote = NSDragOperationGeneric | NSDragOperationMove | NSDragOperationCopy; [self _resetItemSize]; _content = [[NSArray alloc] init]; _items = [[NSMutableArray alloc] init]; _selectionIndexes = [[NSIndexSet alloc] init]; _draggingOnIndex = NSNotFound; } - (void) _resetItemSize { if (itemPrototype) { _itemSize = [[itemPrototype view] frame].size; _minItemSize = NSMakeSize (_itemSize.width, _itemSize.height); _maxItemSize = NSMakeSize (_itemSize.width, _itemSize.height); } else { // FIXME: This is just arbitrary. // What are we suppose to do when we don't have a prototype? _itemSize = NSMakeSize(120.0, 100.0); _minItemSize = NSMakeSize(120.0, 100.0); _maxItemSize = NSMakeSize(120.0, 100.0); } } - (void) drawRect: (NSRect)dirtyRect { // TODO: Implement "use Alternating Colors" if (_backgroundColors && [_backgroundColors count] > 0) { NSColor *bgColor = [_backgroundColors objectAtIndex: 0]; [bgColor set]; NSRectFill(dirtyRect); } NSPoint origin = dirtyRect.origin; NSSize size = dirtyRect.size; NSPoint oppositeOrigin = NSMakePoint (origin.x + size.width, origin.y + size.height); NSInteger firstIndexInRect = MAX(0, [self _indexAtPoint: origin]); NSInteger lastIndexInRect = MIN([_items count] - 1, [self _indexAtPoint: oppositeOrigin]); NSInteger index; for (index = firstIndexInRect; index <= lastIndexInRect; index++) { // Calling itemAtIndex: will eventually instantiate the collection view item, // if it hasn't been done already. NSCollectionViewItem *collectionItem = [self itemAtIndex: index]; NSView *view = [collectionItem view]; [view setFrame: [self frameForItemAtIndex: index]]; } } - (void) dealloc { //[[NSNotificationCenter defaultCenter] removeObserver: self]; DESTROY (_content); // FIXME: Not clear if we should destroy the top-level item "itemPrototype" loaded in the nib file. DESTROY (itemPrototype); DESTROY (_backgroundColors); DESTROY (_selectionIndexes); DESTROY (_items); //DESTROY (_mouseDownEvent); [super dealloc]; } - (BOOL) isFlipped { return YES; } - (BOOL) allowsMultipleSelection { return _allowsMultipleSelection; } - (void) setAllowsMultipleSelection: (BOOL)flag { _allowsMultipleSelection = flag; } - (NSArray *) backgroundColors { return _backgroundColors; } - (void) setBackgroundColors: (NSArray *)colors { _backgroundColors = [colors copy]; [self setNeedsDisplay: YES]; } - (NSArray *) content { return _content; } - (void) setContent: (NSArray *)content { NSInteger i; ASSIGN(_content, content); [self _removeItemsViews]; RELEASE (_items); _items = [[NSMutableArray alloc] initWithCapacity: [_content count]]; for (i = 0; i < [_content count]; i++) { [_items addObject: placeholderItem]; } if (!itemPrototype) { return; } else { // Force recalculation of each item's frame _itemSize = _minItemSize; _tileWidth = -1.0; [self tile]; } } - (id < NSCollectionViewDelegate >) delegate { return delegate; } - (void) setDelegate: (id < NSCollectionViewDelegate >)aDelegate { delegate = aDelegate; } - (NSCollectionViewItem *) itemPrototype { return itemPrototype; } - (void) setItemPrototype: (NSCollectionViewItem *)prototype { ASSIGN(itemPrototype, prototype); [self _resetItemSize]; } - (CGFloat) verticalMargin { return _verticalMargin; } - (void) setVerticalMargin: (CGFloat)margin { if (_verticalMargin == margin) return; _verticalMargin = margin; [self tile]; } - (NSSize) maxItemSize { return _maxItemSize; } - (void) setMaxItemSize: (NSSize)size { if (NSEqualSizes(_maxItemSize, size)) return; _maxItemSize = size; [self tile]; } - (NSUInteger) maxNumberOfColumns { return _maxNumberOfColumns; } - (void) setMaxNumberOfColumns: (NSUInteger)number { _maxNumberOfColumns = number; } - (NSUInteger) maxNumberOfRows { return _maxNumberOfRows; } - (void) setMaxNumberOfRows: (NSUInteger)number { _maxNumberOfRows = number; } - (NSSize) minItemSize { return _minItemSize; } - (void) setMinItemSize: (NSSize)size { if (NSEqualSizes(_minItemSize, size)) return; _minItemSize = size; [self tile]; } - (BOOL) isSelectable { return _isSelectable; } - (void) setSelectable: (BOOL)flag { _isSelectable = flag; if (!_isSelectable) { NSInteger index = -1; while ((index = [_selectionIndexes indexGreaterThanIndex: index]) != NSNotFound) { id item = [_items objectAtIndex: index]; if ([item respondsToSelector: @selector(setSelected:)]) { [item setSelected:NO]; } } } } - (NSIndexSet *) selectionIndexes { return _selectionIndexes; } - (void) setSelectionIndexes: (NSIndexSet *)indexes { if (!_isSelectable) { return; } if (![_selectionIndexes isEqual: indexes]) { ASSIGN(_selectionIndexes, indexes); } NSUInteger index = 0; while (index < [_items count]) { id item = [_items objectAtIndex: index]; if ([item respondsToSelector: @selector(setSelected:)]) { [item setSelected:NO]; } index++; } index = -1; while ((index = [_selectionIndexes indexGreaterThanIndex: index]) != NSNotFound) { id item = [_items objectAtIndex: index]; if ([item respondsToSelector: @selector(setSelected:)]) { [item setSelected: YES]; } } } - (NSRect) frameForItemAtIndex: (NSUInteger)theIndex { NSRect itemFrame = NSMakeRect (0,0,0,0); NSInteger index; NSUInteger count = [_items count]; CGFloat x = _horizontalMargin; CGFloat y = -_itemSize.height; if (_maxNumberOfColumns > 0 && _maxNumberOfRows > 0) { count = MIN(count, _maxNumberOfColumns * _maxNumberOfRows); } for (index = 0; index < count; ++index) { if (index % _numberOfColumns == 0) { x = _horizontalMargin; y += _verticalMargin + _itemSize.height; } if (index == theIndex) { NSInteger draggingOffset = 0; if (_draggingOnIndex != NSNotFound) { NSInteger draggingOnRow = (_draggingOnIndex / _numberOfColumns); NSInteger currentIndexRow = (theIndex / _numberOfColumns); if (draggingOnRow == currentIndexRow) { if (index < _draggingOnIndex) { draggingOffset = -20; } else { draggingOffset = 20; } } } itemFrame = NSMakeRect ((x + draggingOffset), y, _itemSize.width, _itemSize.height); break; } x += _itemSize.width + _horizontalMargin; } return itemFrame; } - (NSRect) _frameForRowOfItemAtIndex: (NSUInteger)theIndex { NSRect itemFrame = [self frameForItemAtIndex: theIndex]; return NSMakeRect (0, itemFrame.origin.y, [self bounds].size.width, itemFrame.size.height); } // Returns the frame of an item's row with the row above and the row below - (NSRect) _frameForRowsAroundItemAtIndex: (NSUInteger)theIndex { NSRect itemRowFrame = [self _frameForRowOfItemAtIndex: theIndex]; CGFloat y = MAX (0, itemRowFrame.origin.y - itemRowFrame.size.height); CGFloat height = MIN (itemRowFrame.size.height * 3, [self bounds].size.height); return NSMakeRect(0, y, itemRowFrame.size.width, height); } - (NSCollectionViewItem *) itemAtIndex: (NSUInteger)index { id item = [_items objectAtIndex: index]; if (item == placeholderItem) { item = [self newItemForRepresentedObject: [_content objectAtIndex: index]]; [_items replaceObjectAtIndex: index withObject: item]; if ([[self selectionIndexes] containsIndex: index]) { [item setSelected: YES]; } [self addSubview: [item view]]; } return item; } - (NSCollectionViewItem *) newItemForRepresentedObject: (id)object { NSCollectionViewItem *collectionItem = nil; if (itemPrototype) { ASSIGN(collectionItem, [itemPrototype copy]); [collectionItem setRepresentedObject: object]; } return AUTORELEASE (collectionItem); } - (void) _removeItemsViews { if (!_items) return; NSUInteger count = [_items count]; while (count--) { id item = [_items objectAtIndex: count]; if ([item respondsToSelector: @selector(view)]) { [[item view] removeFromSuperview]; [item setSelected: NO]; } } } - (void) tile { // TODO: - Animate items, Add Fade-in/Fade-out (as in Cocoa) // - Put the tiling on a delay if (!_items) return; CGFloat width = [self bounds].size.width; if (width == _tileWidth) return; NSSize itemSize = NSMakeSize(_minItemSize.width, _minItemSize.height); _numberOfColumns = MAX(1.0, floor(width / itemSize.width)); if (_maxNumberOfColumns > 0) { _numberOfColumns = MIN(_maxNumberOfColumns, _numberOfColumns); } CGFloat remaining = width - _numberOfColumns * itemSize.width; if (remaining > 0 && itemSize.width < _maxItemSize.width) { itemSize.width = MIN(_maxItemSize.width, itemSize.width + floor(remaining / _numberOfColumns)); } if (_maxNumberOfColumns == 1 && itemSize.width < _maxItemSize.width && itemSize.width < width) { itemSize.width = MIN(_maxItemSize.width, width); } if (!NSEqualSizes(_itemSize, itemSize)) { _itemSize = itemSize; } NSInteger index; NSUInteger count = [_items count]; if (_maxNumberOfColumns > 0 && _maxNumberOfRows > 0) { count = MIN(count, _maxNumberOfColumns * _maxNumberOfRows); } _horizontalMargin = floor((width - _numberOfColumns * itemSize.width) / (_numberOfColumns + 1)); CGFloat y = -itemSize.height; for (index = 0; index < count; ++index) { if (index % _numberOfColumns == 0) { y += _verticalMargin + itemSize.height; } } id superview = [self superview]; CGFloat proposedHeight = y + itemSize.height + _verticalMargin; if ([superview isKindOfClass: [NSClipView class]]) { NSSize superviewSize = [superview bounds].size; proposedHeight = MAX(superviewSize.height, proposedHeight); } _tileWidth = width; [self setFrameSize: NSMakeSize(width, proposedHeight)]; [self setNeedsDisplay: YES]; } - (void) resizeSubviewsWithOldSize: (NSSize)aSize { NSSize currentSize = [self frame].size; if (!NSEqualSizes(currentSize, aSize)) { [self tile]; } } - (id) initWithCoder: (NSCoder *)aCoder { self = [super initWithCoder:aCoder]; if (self) { if ([aCoder allowsKeyedCoding]) { _itemSize = NSMakeSize(0, 0); _tileWidth = -1.0; _minItemSize = [aCoder decodeSizeForKey: NSCollectionViewMinItemSizeKey]; _maxItemSize = [aCoder decodeSizeForKey: NSCollectionViewMaxItemSizeKey]; _maxNumberOfRows = [aCoder decodeInt64ForKey: NSCollectionViewMaxNumberOfRowsKey]; _maxNumberOfColumns = [aCoder decodeInt64ForKey: NSCollectionViewMaxNumberOfColumnsKey]; //_verticalMargin = [aCoder decodeFloatForKey: NSCollectionViewVerticalMarginKey]; _isSelectable = [aCoder decodeBoolForKey: NSCollectionViewSelectableKey]; _allowsMultipleSelection = [aCoder decodeBoolForKey: NSCollectionViewAllowsMultipleSelectionKey]; [self setBackgroundColors: [aCoder decodeObjectForKey: NSCollectionViewBackgroundColorsKey]]; } else { } } [self _initDefaults]; return self; } - (void) encodeWithCoder: (NSCoder *)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { if (!NSEqualSizes(_minItemSize, NSMakeSize(0, 0))) { [aCoder encodeSize: _minItemSize forKey: NSCollectionViewMinItemSizeKey]; } if (!NSEqualSizes(_maxItemSize, NSMakeSize(0, 0))) { [aCoder encodeSize: _maxItemSize forKey: NSCollectionViewMaxItemSizeKey]; } [aCoder encodeInt64: _maxNumberOfRows forKey: NSCollectionViewMaxNumberOfRowsKey]; [aCoder encodeInt64: _maxNumberOfColumns forKey: NSCollectionViewMaxNumberOfColumnsKey]; [aCoder encodeBool: _isSelectable forKey: NSCollectionViewSelectableKey]; [aCoder encodeBool: _allowsMultipleSelection forKey: NSCollectionViewAllowsMultipleSelectionKey]; //[aCoder encodeCGFloat: _verticalMargin forKey: NSCollectionViewVerticalMarginKey]; [aCoder encodeObject: _backgroundColors forKey: NSCollectionViewBackgroundColorsKey]; } else { } } - (void) mouseDown: (NSEvent *)theEvent { NSPoint initialLocation = [theEvent locationInWindow]; NSPoint location = [self convertPoint: initialLocation fromView: nil]; NSInteger index = [self _indexAtPoint: location]; NSEvent *lastEvent = theEvent; BOOL done = NO; NSUInteger eventMask = (NSLeftMouseUpMask | NSLeftMouseDownMask | NSLeftMouseDraggedMask | NSPeriodicMask); NSDate *distantFuture = [NSDate distantFuture]; while (!done) { lastEvent = [NSApp nextEventMatchingMask: eventMask untilDate: distantFuture inMode: NSEventTrackingRunLoopMode dequeue: YES]; NSEventType eventType = [lastEvent type]; NSPoint mouseLocationWin = [lastEvent locationInWindow]; switch (eventType) { case NSLeftMouseDown: break; case NSLeftMouseDragged: if (fabs(mouseLocationWin.x - initialLocation.x) >= 2 || fabs(mouseLocationWin.y - initialLocation.y) >= 2) { if ([self _startDragOperationWithEvent: theEvent clickedIndex: index]) { done = YES; } } break; case NSLeftMouseUp: [self _selectWithEvent: theEvent index: index]; done = YES; break; default: done = NO; break; } } } - (void) _selectWithEvent: (NSEvent *)theEvent index: (NSUInteger)index { NSMutableIndexSet *currentIndexSet = [[NSMutableIndexSet alloc] initWithIndexSet: [self selectionIndexes]]; if (_isSelectable && (index < [_items count])) { if (_allowsMultipleSelection && (([theEvent modifierFlags] & NSControlKeyMask) || ([theEvent modifierFlags] & NSShiftKeyMask))) { if ([theEvent modifierFlags] & NSControlKeyMask) { if ([currentIndexSet containsIndex: index]) { [currentIndexSet removeIndex: index]; } else { [currentIndexSet addIndex: index]; } [self setSelectionIndexes: currentIndexSet]; } else if ([theEvent modifierFlags] & NSShiftKeyMask) { NSUInteger firstSelectedIndex = [currentIndexSet firstIndex]; NSRange selectedRange; if (firstSelectedIndex == NSNotFound) { selectedRange = NSMakeRange(index, index); } else if (index < firstSelectedIndex) { selectedRange = NSMakeRange(index, (firstSelectedIndex - index + 1)); } else { selectedRange = NSMakeRange(firstSelectedIndex, (index - firstSelectedIndex + 1)); } [currentIndexSet addIndexesInRange: selectedRange]; [self setSelectionIndexes: currentIndexSet]; } } else { [self setSelectionIndexes: [NSIndexSet indexSetWithIndex: index]]; } [[self window] makeFirstResponder: self]; } else { [self setSelectionIndexes: [NSIndexSet indexSet]]; } RELEASE (currentIndexSet); } - (NSInteger) _indexAtPoint: (NSPoint)point { NSInteger row = floor(point.y / (_itemSize.height + _verticalMargin)); NSInteger column = floor(point.x / (_itemSize.width + _horizontalMargin)); return (column + (row * _numberOfColumns)); } - (BOOL) acceptsFirstResponder { return YES; } /* MARK: Keyboard Interaction */ - (void) keyDown: (NSEvent *)theEvent { [self interpretKeyEvents: [NSArray arrayWithObject: theEvent]]; } -(void) moveUp: (id)sender { [self _moveUpAndExpandSelection: NO]; } -(void) moveUpAndModifySelection: (id)sender { [self _moveUpAndExpandSelection: YES]; } - (void) _moveUpAndExpandSelection: (BOOL)shouldExpand { NSInteger index = [[self selectionIndexes] firstIndex]; if (index != NSNotFound && index >= _numberOfColumns) { [self _modifySelectionWithNewIndex: index - _numberOfColumns direction: -1 expand: shouldExpand]; } } -(void) moveDown: (id)sender { [self _moveDownAndExpandSelection: NO]; } -(void) moveDownAndModifySelection: (id)sender { [self _moveDownAndExpandSelection: YES]; } -(void) _moveDownAndExpandSelection: (BOOL)shouldExpand { NSInteger index = [[self selectionIndexes] lastIndex]; if (index != NSNotFound && (index + _numberOfColumns) < [_items count]) { [self _modifySelectionWithNewIndex: index + _numberOfColumns direction: 1 expand: shouldExpand]; } } -(void) moveLeft: (id)sender { [self _moveLeftAndExpandSelection: NO]; } -(void) moveLeftAndModifySelection: (id)sender { [self _moveLeftAndExpandSelection: YES]; } -(void) moveBackwardAndModifySelection: (id)sender { [self _moveLeftAndExpandSelection: YES]; } -(void) _moveLeftAndExpandSelection: (BOOL)shouldExpand { NSUInteger index = [[self selectionIndexes] firstIndex]; if (index != NSNotFound && index != 0) { [self _modifySelectionWithNewIndex: index - 1 direction: -1 expand: shouldExpand]; } } -(void) moveRight: (id)sender { [self _moveRightAndExpandSelection: NO]; } -(void) moveRightAndModifySelection: (id)sender { [self _moveRightAndExpandSelection: YES]; } -(void) moveForwardAndModifySelection: (id)sender { [self _moveRightAndExpandSelection: YES]; } -(void) _moveRightAndExpandSelection: (BOOL)shouldExpand { NSUInteger index = [[self selectionIndexes] lastIndex]; if (index != NSNotFound && index != ([_items count] - 1)) { [self _modifySelectionWithNewIndex: index + 1 direction: 1 expand: shouldExpand]; } } - (void) _modifySelectionWithNewIndex: (NSUInteger)anIndex direction: (int)aDirection expand: (BOOL)shouldExpand { anIndex = MIN(MAX(anIndex, 0), [_items count] - 1); if (_allowsMultipleSelection && shouldExpand) { NSMutableIndexSet *newIndexSet = [[NSMutableIndexSet alloc] initWithIndexSet: _selectionIndexes]; NSUInteger firstIndex = [newIndexSet firstIndex]; NSUInteger lastIndex = [newIndexSet lastIndex]; if (aDirection == -1) { [newIndexSet addIndexesInRange:NSMakeRange (anIndex, firstIndex - anIndex + 1)]; } else { [newIndexSet addIndexesInRange:NSMakeRange (lastIndex, anIndex - lastIndex + 1)]; } [self setSelectionIndexes: newIndexSet]; RELEASE (newIndexSet); } else { [self setSelectionIndexes: [NSIndexSet indexSetWithIndex: anIndex]]; } [self scrollRectToVisible: [self frameForItemAtIndex: anIndex]]; } /* MARK: Drag & Drop */ -(NSDragOperation) draggingSourceOperationMaskForLocal: (BOOL)isLocal { if (isLocal) { return _draggingSourceOperationMaskForLocal; } else { return _draggingSourceOperationMaskForRemote; } } -(void) setDraggingSourceOperationMask: (NSDragOperation)mask forLocal: (BOOL)isLocal { if (isLocal) { _draggingSourceOperationMaskForLocal = mask; } else { _draggingSourceOperationMaskForRemote = mask; } } - (BOOL) _startDragOperationWithEvent: (NSEvent*)event clickedIndex: (NSUInteger)index { NSIndexSet *dragIndexes = _selectionIndexes; if (![dragIndexes containsIndex: index] && (index < [_items count])) { dragIndexes = [NSIndexSet indexSetWithIndex: index]; } if (![dragIndexes count]) return NO; if (![delegate respondsToSelector: @selector(collectionView:writeItemsAtIndexes:toPasteboard:)]) return NO; if ([delegate respondsToSelector: @selector(collectionView:canDragItemsAtIndexes:withEvent:)]) { if (![delegate collectionView: self canDragItemsAtIndexes: dragIndexes withEvent: event]) { return NO; } } NSPoint downPoint = [event locationInWindow]; NSPoint convertedDownPoint = [self convertPoint: downPoint fromView: nil]; NSPasteboard *pasteboard = [NSPasteboard pasteboardWithName: NSDragPboard]; if ([self _writeItemsAtIndexes:dragIndexes toPasteboard: pasteboard]) { NSImage *dragImage = [self draggingImageForItemsAtIndexes: dragIndexes withEvent: event offset: NULL]; [self dragImage: dragImage at: convertedDownPoint offset: NSMakeSize(0,0) event: event pasteboard: pasteboard source: self slideBack: YES]; return YES; } return NO; } - (NSImage *) draggingImageForItemsAtIndexes: (NSIndexSet *)indexes withEvent: (NSEvent *)event offset: (NSPointPointer)dragImageOffset { if ([delegate respondsToSelector: @selector(collectionView:draggingImageForItemsAtIndexes:withEvent:offset:)]) { return [delegate collectionView: self draggingImageForItemsAtIndexes: indexes withEvent: event offset: dragImageOffset]; } else { return [[NSImage alloc] initWithData: [self dataWithPDFInsideRect: [self bounds]]]; } } - (BOOL) _writeItemsAtIndexes: (NSIndexSet *)indexes toPasteboard: (NSPasteboard *)pasteboard { if (![delegate respondsToSelector: @selector(collectionView:writeItemsAtIndexes:toPasteboard:)]) { return NO; } else { return [delegate collectionView: self writeItemsAtIndexes: indexes toPasteboard: pasteboard]; } } - (void) draggedImage: (NSImage *)image endedAt: (NSPoint)point operation: (NSDragOperation)operation { } - (NSDragOperation) _draggingEnteredOrUpdated: (id)sender { NSDragOperation result = NSDragOperationNone; if ([delegate respondsToSelector: @selector(collectionView:validateDrop:proposedIndex:dropOperation:)]) { NSPoint location = [self convertPoint: [sender draggingLocation] fromView: nil]; NSInteger index = [self _indexAtPoint: location]; index = (index > [_items count] - 1) ? [_items count] - 1 : index; _draggingOnIndex = index; NSInteger *proposedIndex = &index; NSInteger dropOperationInt = NSCollectionViewDropOn; NSCollectionViewDropOperation *dropOperation = &dropOperationInt; // TODO: We currently don't do anything with the proposedIndex & dropOperation that // may get altered by the delegate. result = [delegate collectionView: self validateDrop: sender proposedIndex: proposedIndex dropOperation: dropOperation]; if (result == NSDragOperationNone) { _draggingOnIndex = NSNotFound; } [self setNeedsDisplayInRect: [self _frameForRowsAroundItemAtIndex: index]]; } return result; } - (NSDragOperation) draggingEntered: (id)sender { return [self _draggingEnteredOrUpdated: sender]; } - (void) draggingExited: (id)sender { [self setNeedsDisplayInRect: [self _frameForRowsAroundItemAtIndex: _draggingOnIndex]]; _draggingOnIndex = NSNotFound; } - (NSDragOperation) draggingUpdated: (id)sender { return [self _draggingEnteredOrUpdated: sender]; } - (BOOL) prepareForDragOperation: (id)sender { NSPoint location = [self convertPoint: [sender draggingLocation] fromView: nil]; NSInteger index = [self _indexAtPoint: location]; _draggingOnIndex = NSNotFound; [self setNeedsDisplayInRect: [self _frameForRowsAroundItemAtIndex: index]]; return YES; } - (BOOL) performDragOperation: (id)sender { NSPoint location = [self convertPoint: [sender draggingLocation] fromView: nil]; NSInteger index = [self _indexAtPoint: location]; index = (index > [_items count] - 1) ? [_items count] - 1 : index; BOOL result = NO; if ([delegate respondsToSelector: @selector(collectionView:acceptDrop:index:dropOperation:)]) { // TODO: dropOperation should be retrieved from the validateDrop delegate method. result = [delegate collectionView: self acceptDrop: sender index: index dropOperation: NSCollectionViewDropOn]; } return result; } - (BOOL) wantsPeriodicDraggingUpdates { return YES; } @end gnustep-gui-0.24.0/Source/GSTextFinder.h0000664000076500007650000000464011425612374017672 0ustar brains99brains99/* -*-objc-*- GSTextFinder.h The private text finder class for NSTextView Copyright (C) 2010 Free Software Foundation, Inc. Author: Wolfgang Lux Date: 2010 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GS_TEXT_FINDER_H #define _GS_TEXT_FINDER_H #import @class NSString; @class NSButton; @class NSMatrix; @class NSPanel; @class NSTextField; @interface GSTextFinder : NSObject { // local attributes NSString *findString; NSString *replaceString; // GUI NSPanel *panel; NSTextField *findText; NSTextField *replaceText; NSTextField *messageText; NSMatrix *replaceScopeMatrix; NSButton *ignoreCaseButton; } // return shared panel instance + (GSTextFinder *) sharedTextFinder; // UI actions - (void) findNext: (id)sender; - (void) findPrevious: (id)sender; - (void) replaceAndFind: (id)sender; - (void) replace: (id)sender; - (void) replaceAll: (id)sender; - (void) performFindPanelAction: (id)sender; - (void) performFindPanelAction: (id)sender withTextView: (NSTextView *)aTextView; - (BOOL) validateFindPanelAction: (id)sender withTextView: (NSTextView *)aTextView; // text finder methods - (void) showFindPanel; - (void) takeFindStringFromTextView: (NSText *)aTextView; - (BOOL) findStringInTextView: (NSText *)aTextView forward: (BOOL)forward; - (void) replaceStringInTextView: (NSTextView *)aTextView; - (void) replaceAllInTextView: (NSTextView *)aTextView onlyInSelection: (BOOL)flag; - (NSTextView *) targetView: (NSTextView *)aTextView; @end #endif /* _GS_TEXT_FINDER_H */ gnustep-gui-0.24.0/Source/GSThemePanel.m0000664000076500007650000002346711712333655017656 0ustar brains99brains99/** GSThemePanel Theme management utility Copyright (C) 2008-2012 Free Software Foundation, Inc. Author: Richard Frith-Macdonald Date: 2007-2008 This file is part of the GNU Objective C User interface library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import "AppKit/NSButton.h" #import "AppKit/NSMatrix.h" #import "AppKit/NSScrollView.h" #import "GSThemePrivate.h" #import "GSGuiPrivate.h" @implementation GSThemePanel static GSThemePanel *sharedPanel = nil; + (GSThemePanel*) sharedThemePanel { if (sharedPanel == nil) { sharedPanel = [self new]; } return sharedPanel; } - (id) init { NSRect winFrame; NSRect sideFrame; NSRect bottomFrame; NSRect frame; NSView *container; NSButtonCell *proto; winFrame = NSMakeRect(0, 0, 367, 420); sideFrame = NSMakeRect(0, 0, 95, 420); bottomFrame = NSMakeRect(95, 0, 272, 32); self = [super initWithContentRect: winFrame styleMask: (NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask) backing: NSBackingStoreBuffered defer: NO]; [self setReleasedWhenClosed: NO]; container = [self contentView]; sideView = [[NSScrollView alloc] initWithFrame: sideFrame]; [sideView setHasHorizontalScroller: NO]; [sideView setHasVerticalScroller: YES]; [sideView setBorderType: NSBezelBorder]; [sideView setAutoresizingMask: (NSViewHeightSizable | NSViewMaxXMargin)]; [container addSubview: sideView]; RELEASE(sideView); proto = [[NSButtonCell alloc] init]; [proto setBordered: NO]; [proto setAlignment: NSCenterTextAlignment]; [proto setImagePosition: NSImageAbove]; [proto setSelectable: NO]; [proto setEditable: NO]; [matrix setPrototype: proto]; frame = [sideView frame]; frame.origin = NSZeroPoint; matrix = [[NSMatrix alloc] initWithFrame: frame mode: NSRadioModeMatrix prototype: proto numberOfRows: 1 numberOfColumns: 1]; RELEASE(proto); [matrix setAutosizesCells: NO]; [matrix setCellSize: NSMakeSize(72,72)]; [matrix setIntercellSpacing: NSMakeSize(8,8)]; [matrix setAutoresizingMask: NSViewNotSizable]; [matrix setMode: NSRadioModeMatrix]; [matrix setAction: @selector(changeSelection:)]; [matrix setTarget: self]; [sideView setDocumentView: matrix]; RELEASE(matrix); bottomView = [[NSView alloc] initWithFrame: bottomFrame]; [bottomView setAutoresizingMask: (NSViewWidthSizable | NSViewMaxYMargin)]; [container addSubview: bottomView]; RELEASE(bottomView); [self setTitle: _(@"Themes")]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(notified:) name: GSThemeDidActivateNotification object: nil]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(notified:) name: GSThemeDidDeactivateNotification object: nil]; /* Fake a notification to set the initial value for the inspector. */ [self notified: [NSNotification notificationWithName: GSThemeDidActivateNotification object: [GSTheme theme] userInfo: nil]]; return self; } - (void) changeSelection: (id)sender { NSButtonCell *cell = [sender selectedCell]; NSString *name = [cell title]; [GSTheme setTheme: [GSTheme loadThemeNamed: name]]; } - (void) notified: (NSNotification*)n { NSView *cView; GSThemeInspector *inspector; inspector = (GSThemeInspector*)[[n object] themeInspector]; cView = [self contentView]; if ([[n name] isEqualToString: GSThemeDidActivateNotification] == YES) { NSView *iView; NSRect frame; NSButton *button; NSString *dName; /* Ask the inspector to ensure that it is up to date. */ [inspector update: self]; /* Move the inspector view into our window. */ iView = RETAIN([inspector contentView]); [inspector setContentView: nil]; [cView addSubview: iView]; RELEASE(iView); /* Set inspector view to fill the frame to the right of our * scrollview and above the bottom view */ frame.origin.x = [sideView frame].size.width; frame.origin.y = [bottomView frame].size.height; frame.size = [cView frame].size; frame.size.width -= [sideView frame].size.width; frame.size.height -= [bottomView frame].size.height; [iView setFrame: frame]; button = [[bottomView subviews] lastObject]; if (button == nil) { button = [NSButton new]; [button setTarget: self]; [button setAction: @selector(setDefault:)]; [bottomView addSubview: button]; RELEASE(button); } dName = [[NSUserDefaults standardUserDefaults] stringForKey: @"GSTheme"]; if ([[[n object] name] isEqual: dName] == YES) { [button setTitle: _(@"Revert default theme")]; } else { [button setTitle: _(@"Make this the default theme")]; } [button sizeToFit]; frame = [button frame]; frame.origin.x = ([bottomView frame].size.width - frame.size.width) / 2; frame.origin.y = ([bottomView frame].size.height - frame.size.height) / 2; frame = [bottomView centerScanRect: frame]; [button setFrame: frame]; } else { /* Restore the inspector content view. */ [inspector setContentView: [[cView subviews] lastObject]]; } [cView setNeedsDisplay: YES]; } - (void) setDefault: (id)sender { NSButton *button = (NSButton*)sender; NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; NSString *cName; NSString *dName; NSRect frame; dName = [defs stringForKey: @"GSTheme"]; cName = [[GSTheme theme] name]; if ([cName isEqual: dName] == YES) { [defs removeObjectForKey: @"GSTheme"]; [button setTitle: _(@"Make this the default theme")]; } else { [defs setObject: cName forKey: @"GSTheme"]; [button setTitle: _(@"Revert default theme")]; } [defs synchronize]; [button sizeToFit]; frame = [button frame]; frame.origin.x = ([bottomView frame].size.width - frame.size.width) / 2; frame.origin.y = ([bottomView frame].size.height - frame.size.height) / 2; [button setFrame: frame]; [bottomView setNeedsDisplay: YES]; } - (void) update: (id)sender { NSArray *array; GSTheme *theme = [GSTheme loadThemeNamed: @"GNUstep.theme"]; /* Avoid [NSMutableSet set] that confuses GCC 3.3.3. It seems to confuse * this static +(id)set method with the instance -(void)set, so it would * refuse to compile saying * GSTheme.m:1565: error: void value not ignored as it ought to be */ NSMutableSet *set = AUTORELEASE([NSMutableSet new]); NSString *selected = RETAIN([[matrix selectedCell] title]); unsigned existing = [[matrix cells] count]; NSFileManager *mgr = [NSFileManager defaultManager]; NSEnumerator *enumerator; NSString *path; NSString *name; NSButtonCell *cell; unsigned count = 0; /* Ensure the first cell contains the default theme. */ cell = [matrix cellAtRow: count++ column: 0]; [cell setImage: [theme icon]]; [cell setTitle: [theme name]]; /* Go through all the themes in the standard locations and find their names. */ enumerator = [NSSearchPathForDirectoriesInDomains (NSAllLibrariesDirectory, NSAllDomainsMask, YES) objectEnumerator]; while ((path = [enumerator nextObject]) != nil) { NSEnumerator *files; NSString *file; path = [path stringByAppendingPathComponent: @"Themes"]; files = [[mgr directoryContentsAtPath: path] objectEnumerator]; while ((file = [files nextObject]) != nil) { NSString *ext = [file pathExtension]; name = [file stringByDeletingPathExtension]; if ([ext isEqualToString: @"theme"] == YES && [name isEqualToString: @"GNUstep"] == NO && [[name pathExtension] isEqual: @"backup"] == NO) { [set addObject: name]; } } } /* Sort theme names alphabetically, and add each theme to the matrix. */ array = [[set allObjects] sortedArrayUsingSelector: @selector(caseInsensitiveCompare:)]; enumerator = [array objectEnumerator]; while ((name = [enumerator nextObject]) != nil) { GSTheme *loaded; loaded = [GSTheme loadThemeNamed: name]; if (loaded != nil) { if (count >= existing) { [matrix addRow]; existing++; } cell = [matrix cellAtRow: count column: 0]; [cell setImage: [loaded icon]]; [cell setTitle: [loaded name]]; count++; } } /* Empty any unused cells. */ while (count < existing) { cell = [matrix cellAtRow: count column: 0]; [cell setImage: nil]; [cell setTitle: @""]; count++; } /* Restore the selected cell. */ array = [matrix cells]; count = [array count]; while (count-- > 0) { cell = [matrix cellAtRow: count column: 0]; if ([[cell title] isEqual: selected]) { [matrix selectCellAtRow: count column: 0]; break; } } RELEASE(selected); [matrix sizeToCells]; [matrix setNeedsDisplay: YES]; } @end gnustep-gui-0.24.0/Source/NSFont.m0000664000076500007650000012315112076562165016544 0ustar brains99brains99/** NSFont The font class Copyright (C) 1996 Free Software Foundation, Inc. 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. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import #import #import #import #import #import #import #import #import #import #import "AppKit/NSGraphicsContext.h" #import "AppKit/NSFont.h" #import "AppKit/NSFontDescriptor.h" #import "AppKit/NSFontManager.h" #import "AppKit/NSView.h" #import "GNUstepGUI/GSFontInfo.h" @interface NSFont (Private) - (id) initWithName: (NSString*)name matrix: (const CGFloat*)fontMatrix screenFont: (BOOL)screenFont role: (int)role; + (NSFont*) _fontWithName: (NSString*)aFontName size: (CGFloat)fontSize role: (int)role; @end static int currentVersion = 3; /* Instances of GSFontMapKey are used to find cached font instances in globalFontMap. */ @interface GSFontMapKey : NSObject { @public NSString *name; BOOL screenFont; int role; int matrix[6]; unsigned int hash; } @end @implementation GSFontMapKey -(NSUInteger) hash { return hash; } -(BOOL) isEqual: (id)other { GSFontMapKey *o; if (![other isKindOfClass: object_getClass(self)]) return NO; o = other; if (hash != o->hash || screenFont != o->screenFont || role != o->role) return NO; if (![name isEqualToString: o->name]) return NO; if (matrix[0] != o->matrix[0] || matrix[1] != o->matrix[1] || matrix[2] != o->matrix[2] || matrix[3] != o->matrix[3] || matrix[4] != o->matrix[4] || matrix[5] != o->matrix[5]) return NO; return YES; } -(void) dealloc { DESTROY(name); [super dealloc]; } @end static GSFontMapKey * keyForFont(NSString *name, const CGFloat *matrix, BOOL screenFont, int role) { GSFontMapKey *d; d=[GSFontMapKey alloc]; d->name = [name copy]; d->screenFont = screenFont; d->role = role; d->matrix[0] = matrix[0] * 1000; d->matrix[1] = matrix[1] * 1000; d->matrix[2] = matrix[2] * 1000; d->matrix[3] = matrix[3] * 1000; d->matrix[4] = matrix[4] * 1000; d->matrix[5] = matrix[5] * 1000; d->hash = [d->name hash] + screenFont + role * 4 + d->matrix[0] + d->matrix[1] + d->matrix[2] + d->matrix[3]; return d; } /** NSFont

The NSFont class allows control of the fonts used for displaying text anywhere on the screen. The primary methods for getting a particular font are +fontWithName:matrix: and +fontWithName:size: which take the name and size of a particular font and return the NSFont object associated with that font. In addition there are several convenience mathods which make it easier to get certain types of fonts.

In particular, there are several methods to get the standard fonts used by the Application to display text for a partiuclar purpose. See the class methods listed below for more information. These default fonts can be set using the user defaults system. The default font names available are:

NSBoldFont Helvetica-Bold (System bold font) NSControlContentFont System font NSFont Helvetica (System Font) NSLabelFont System font NSMenuFont System font NSMenuBarFont System font NSMessageFont System font NSPaletteFont System bold font NSTitleBarFont System bold font NSToolTipsFont System font NSUserFixedPitchFont Courier NSUserFont System font

The default sizes are:

NSBoldFontSize (none) NSControlContentFontSize (none) NSFontSize 12 (System Font Size) NSLabelFontSize (none) NSMenuFontSize (none) NSMiniFontSize 6 NSMessageFontSize (none) NSPaletteFontSize (none) NSSmallFontSize 9 NSTitleBarFontSize (none) NSToolTipsFontSize (none) NSUserFixedPitchFontSize (none) NSUserFontSize (none)

Font sizes list with (none) default to NSFontSize.

*/ @implementation NSFont /* Class variables*/ /* See comments in +initialize. */ static NSFont *placeHolder = nil; /* Fonts that are preferred by the application */ static NSArray *_preferredFonts; /* Class for fonts */ static Class NSFontClass = 0; /* Cache all created fonts for reuse. */ static NSMapTable* globalFontMap = 0; static NSUserDefaults *defaults = nil; /* The valid font roles. Note that these values are used when encoding and decoding, so entries may never be removed. Entries may be added after the last entry, and entries don't have to actually be handled. Note that these values are multiplied by two before they are used since the lowest bit is used to indicate an explicit size. If the lowest bit is set, the size is explicitly specified and encoded. */ enum FontRoles { RoleExplicit=0, RoleBoldSystemFont, RoleSystemFont, RoleUserFixedPitchFont, RoleUserFont, RoleTitleBarFont, RoleMenuFont, RoleMessageFont, RolePaletteFont, RoleToolTipsFont, RoleControlContentFont, RoleLabelFont, RoleMenuBarFont, RoleMax }; typedef struct { /* Defaults key for this font. */ NSString *key; /* If there's no defaults key, fall back to the font for this role. */ int fallback; /* If there's no other role to fall back to, use this font. */ NSString *defaultFont; /* Cached font for the default size of this role. */ NSFont *cachedFont; } font_role_info_t; /* This table, through getNSFont, controls the behavior of getting the standard fonts, and must match the table in the documentation above. Each entry should have a fallback or a defaultFont. There must be a default font for the system font. Bad Things will happen if entries are invalid. */ static font_role_info_t font_roles[RoleMax]={ {nil , 0 , nil, nil}, {@"NSBoldFont" , 0 , nil /* set by init_font_roles */, nil}, {@"NSFont" , 0 , nil /* set by init_font_roles */, nil}, {@"NSUserFixedPitchFont", 0 , nil /* set by init_font_roles */, nil}, {@"NSUserFont" , RoleSystemFont , nil, nil}, {@"NSTitleBarFont" , RoleBoldSystemFont, nil, nil}, {@"NSMenuFont" , RoleSystemFont , nil, nil}, {@"NSMessageFont" , RoleSystemFont , nil, nil}, {@"NSPaletteFont" , RoleBoldSystemFont, nil, nil}, {@"NSToolTipsFont" , RoleSystemFont , nil, nil}, {@"NSControlContentFont", RoleSystemFont , nil, nil}, {@"NSLabelFont" , RoleSystemFont , nil, nil}, {@"NSMenuBarFont" , RoleSystemFont , nil, nil} }; static BOOL did_init_font_roles; /* Called by getNSFont, since font_roles is only accessed from that function (or fontNameForRole, which is only called by getNSFont). This assures that the function is called before the table is used, and that it's called _after_ the backend has been loaded (or, if it isn't, the _fontWithName:... calls will fail anyway). */ static void init_font_roles(void) { GSFontEnumerator *e = [GSFontEnumerator sharedEnumerator]; font_roles[RoleSystemFont].defaultFont = [e defaultSystemFontName]; font_roles[RoleBoldSystemFont].defaultFont = [e defaultBoldSystemFontName]; font_roles[RoleUserFixedPitchFont].defaultFont = [e defaultFixedPitchFontName]; } static NSString *fontNameForRole(int role, int *actual_entry) { int i; NSString *fontName; i = role; while (1) { fontName = [defaults stringForKey: font_roles[i].key]; if (fontName) { break; } else if (font_roles[i].fallback) { i = font_roles[i].fallback; } else if (font_roles[i].defaultFont) { fontName = font_roles[i].defaultFont; break; } else { NSCAssert(NO, @"Invalid font role table entry."); } } if (actual_entry) *actual_entry = i; return fontName; } static NSFont *getNSFont(CGFloat fontSize, int role) { NSString *fontName; NSFont *font; BOOL defaultSize; int i; int font_role; NSCAssert(role > RoleExplicit && role < RoleMax, @"Invalid font role."); if (!did_init_font_roles) { init_font_roles(); did_init_font_roles = YES; } font_role = role * 2; defaultSize = (fontSize <= 0.0); if (defaultSize) { if (font_roles[role].cachedFont) return AUTORELEASE(RETAIN(font_roles[role].cachedFont)); fontSize = [defaults floatForKey: [NSString stringWithFormat: @"%@Size", font_roles[role].key]]; if (!fontSize) fontSize = [NSFont systemFontSize]; } else { font_role |= 1; } fontName = fontNameForRole(role, &i); font = [NSFontClass _fontWithName: fontName size: fontSize role: font_role]; /* That font couldn't be found. */ if (font == nil) { /* Warn using the role that specified the invalid font. */ NSLog(@"The font specified for %@, %@, can't be found.", font_roles[i].key, fontName); /* Try the system font. */ fontName = fontNameForRole(RoleSystemFont, NULL); font = [NSFontClass _fontWithName: fontName size: fontSize role: font_role]; if (font == nil) { /* Try the default system font and size. */ fontName = font_roles[RoleSystemFont].defaultFont; font = [NSFontClass _fontWithName: fontName size: 12.0 role: font_role]; /* It seems we can't get any font here! Try some well known * fonts as a last resort. */ if (font == nil) { font = [NSFontClass _fontWithName: @"Helvetica" size: 12.0 role: font_role]; } if (font == nil) { font = [NSFontClass _fontWithName: @"Courier" size: 12.0 role: font_role]; } if (font == nil) { font = [NSFontClass _fontWithName: @"Fixed" size: 12.0 role: font_role]; } } } if (defaultSize) ASSIGN(font_roles[role].cachedFont, font); return font; } static void setNSFont(NSString *key, NSFont *font) { int i; [defaults setObject: [font fontName] forKey: key]; [defaults setObject: [NSNumber numberWithFloat: [font pointSize]] forKey: [NSString stringWithFormat: @"%@Size",key]]; for (i = 1; i < RoleMax; i++) { DESTROY(font_roles[i].cachedFont); } /* Don't care about errors */ [defaults synchronize]; } // // Class methods // + (void) initialize { if (self == [NSFont class]) { NSFontClass = self; /* * The placeHolder is a dummy NSFont instance which is never used * as a font ... the initialiser knows that whenever it gets the * placeHolder it should either return a cached font or return a * newly allocated font to replace it. This mechanism stops the * +fontWithName:... methods from having to allocate fonts instances * which would immediately have to be released for replacement by * a cache object. */ placeHolder = [self alloc]; globalFontMap = NSCreateMapTable(NSObjectMapKeyCallBacks, NSNonRetainedObjectMapValueCallBacks, 64); if (defaults == nil) { defaults = RETAIN([NSUserDefaults standardUserDefaults]); } _preferredFonts = [defaults objectForKey: @"NSPreferredFonts"]; [self setVersion: currentVersion]; } } /* Getting the preferred user fonts. */ /**

Returns the default bold font for use in menus and heading in standard gui components. If fontSize is <= 0, the default size is used.

See Also: +fontWithName:size:

*/ + (NSFont*) boldSystemFontOfSize: (CGFloat)fontSize { return getNSFont(fontSize, RoleBoldSystemFont); } /**

Returns the default font for use in menus and heading in standard gui components. If fontSize is <= 0, the default size is used.

See Also: +boldSystemFontOfSize: userFontOfSize: userFixedPitchFontOfSize: +fontWithName:size:

*/ + (NSFont*) systemFontOfSize: (CGFloat)fontSize { return getNSFont(fontSize, RoleSystemFont); } /**

Returns the default fixed pitch font for use in locations other than standard gui components. If fontSize is <= 0, the default size is used.

See Also: +setUserFixedPitchFont: +userFontOfSize: +boldSystemFontOfSize: +systemFontOfSize: +fontWithName:size:

*/ + (NSFont*) userFixedPitchFontOfSize: (CGFloat)fontSize { return getNSFont(fontSize, RoleUserFixedPitchFont); } /**

Returns the default font for use in locations other than standard gui components. If fontSize is <= 0, the default size is used.

See Also: +setUserFont: +boldSystemFontOfSize: systemFontOfSize: userFixedPitchFontOfSize: +fontWithName:size:

*/ + (NSFont*) userFontOfSize: (CGFloat)fontSize { return getNSFont(fontSize, RoleUserFont); } + (NSFont *) fontWithDescriptor: (NSFontDescriptor *)descriptor size: (CGFloat)size { NSArray *a; descriptor = [descriptor matchingFontDescriptorWithMandatoryKeys: [NSSet setWithArray: [[descriptor fontAttributes] allKeys]]]; if (descriptor == nil) return nil; a = [[NSFontManager sharedFontManager] availableFontNamesMatchingFontDescriptor: descriptor]; if ((a == nil) || ([a count] == 0)) return nil; return [self fontWithName: [a objectAtIndex: 0] size: size]; } + (NSFont*) fontWithDescriptor: (NSFontDescriptor*)descriptor textTransform: (NSAffineTransform*)transform { NSArray *a; CGFloat fontMatrix[6]; NSAffineTransformStruct ats; descriptor = [descriptor matchingFontDescriptorWithMandatoryKeys: [NSSet setWithArray: [[descriptor fontAttributes] allKeys]]]; if (descriptor == nil) return nil; a = [[NSFontManager sharedFontManager] availableFontNamesMatchingFontDescriptor: descriptor]; if ((a == nil) || ([a count] == 0)) return nil; ats = [transform transformStruct]; fontMatrix[0] = ats.m11; fontMatrix[1] = ats.m12; fontMatrix[2] = ats.m21; fontMatrix[3] = ats.m22; fontMatrix[4] = ats.tX; fontMatrix[5] = ats.tY; return [self fontWithName: [a objectAtIndex: 0] matrix: fontMatrix]; } + (NSFont *) fontWithDescriptor: (NSFontDescriptor *)descriptor size: (CGFloat)size textTransform: (NSAffineTransform *)transform { if (transform) { return [self fontWithDescriptor: descriptor textTransform: transform]; } else { return [self fontWithDescriptor: descriptor size: size]; } } /**

Returns an array of the names of preferred fonts.

See Also: +setPreferredFontNames:

*/ + (NSArray*) preferredFontNames { return _preferredFonts; } /* Setting the preferred user fonts*/ + (void) setUserFixedPitchFont: (NSFont*)aFont { setNSFont (@"NSUserFixedPitchFont", aFont); } + (void) setUserFont: (NSFont*)aFont { setNSFont (@"NSUserFont", aFont); } /**

Sets an array of the names of preferred fonts to fontsNames/

See Also: +preferredFontNames

*/ + (void) setPreferredFontNames: (NSArray*)fontNames { ASSIGN(_preferredFonts, fontNames); // FIXME: Should this store back the preferred fonts in the user defaults? } /* Getting various fonts*/ + (NSFont*) controlContentFontOfSize: (CGFloat)fontSize { return getNSFont(fontSize, RoleControlContentFont); } + (NSFont*) labelFontOfSize: (CGFloat)fontSize { return getNSFont(fontSize, RoleLabelFont); } + (NSFont*) menuFontOfSize: (CGFloat)fontSize { return getNSFont(fontSize, RoleMenuFont); } + (NSFont*) menuBarFontOfSize: (CGFloat)fontSize { return getNSFont(fontSize, RoleMenuBarFont); } + (NSFont*) titleBarFontOfSize: (CGFloat)fontSize { return getNSFont(fontSize, RoleTitleBarFont); } + (NSFont*) messageFontOfSize: (CGFloat)fontSize { return getNSFont(fontSize, RoleMessageFont); } + (NSFont*) paletteFontOfSize: (CGFloat)fontSize { return getNSFont(fontSize, RolePaletteFont); } + (NSFont*) toolTipsFontOfSize: (CGFloat)fontSize { return getNSFont(fontSize, RoleToolTipsFont); } // // Font Sizes // + (CGFloat) labelFontSize { CGFloat fontSize = [defaults floatForKey: @"NSLabelFontSize"]; if (fontSize == 0) { return [self systemFontSize]; } return fontSize; } + (CGFloat) smallSystemFontSize { CGFloat fontSize = [defaults floatForKey: @"NSSmallFontSize"]; if (fontSize == 0) { fontSize = 9; } return fontSize; } + (CGFloat) systemFontSize { CGFloat fontSize = [defaults floatForKey: @"NSFontSize"]; if (fontSize == 0) { fontSize = 12; } return fontSize; } + (CGFloat) systemFontSizeForControlSize: (NSControlSize)controlSize { switch (controlSize) { case NSMiniControlSize: { CGFloat fontSize = [defaults floatForKey: @"NSMiniFontSize"]; if (fontSize == 0) { fontSize = 6; } return fontSize; } case NSSmallControlSize: return [self smallSystemFontSize]; case NSRegularControlSize: default: return [self systemFontSize]; } } /**

Returns an autoreleased font with name aFontName and matrix fontMatrix .

The fontMatrix is a standard size element matrix as used in PostScript to describe the scaling of the font, typically it just includes the font size as [fontSize 0 0 fontSize 0 0]. You can use the constant NSFontIdentityMatrix in place of [1 0 0 1 0 0]. If NSFontIdentityMatrix, then the font will automatically flip itself when set in a flipped view.

*/ + (NSFont*) fontWithName: (NSString*)aFontName matrix: (const CGFloat*)fontMatrix { NSFont *font; font = [placeHolder initWithName: aFontName matrix: fontMatrix screenFont: NO role: RoleExplicit]; return AUTORELEASE(font); } /**

Returns an autoreleased font with name aFontName and size fontSize.

*

Fonts created using this method will automatically flip themselves * when set in a flipped view.

*/ + (NSFont*) fontWithName: (NSString*)aFontName size: (CGFloat)fontSize { return [self _fontWithName: aFontName size: fontSize role: RoleExplicit]; } + (NSFont*) _fontWithName: (NSString*)aFontName size: (CGFloat)fontSize role: (int)aRole { NSFont *font; CGFloat fontMatrix[6] = { 0, 0, 0, 0, 0, 0 }; if (fontSize == 0) { fontSize = [defaults floatForKey: @"NSUserFontSize"]; if (fontSize == 0) { fontSize = 12; } } fontMatrix[0] = fontSize; fontMatrix[3] = fontSize; font = [placeHolder initWithName: aFontName matrix: fontMatrix screenFont: NO role: aRole]; return AUTORELEASE(font); } /** */ + (void) useFont: (NSString*)aFontName { [GSCurrentContext() useFont: aFontName]; } // // Instance methods // - (id) init { [NSException raise: NSInternalInconsistencyException format: @"Called -init on NSFont ... illegal"]; return self; } /* Last fallback: If a system font was explicitly requested and this font does not exist, try to replace it with the corresponding font in the current setup. */ - (NSString*) _replacementFontName { if (([fontName isEqualToString: @"Helvetica"] && ![font_roles[RoleSystemFont].defaultFont isEqualToString: @"Helvetica"]) || ([fontName isEqualToString: @"LucidaGrande"])) { return font_roles[RoleSystemFont].defaultFont; } else if (([fontName isEqualToString: @"Helvetica-Bold"] && ![font_roles[RoleBoldSystemFont].defaultFont isEqualToString: @"Helvetica-Bold"]) || ([fontName isEqualToString: @"LucidaGrande-Bold"])) { return font_roles[RoleBoldSystemFont].defaultFont; } else if ([fontName isEqualToString: @"Courier"] && ![font_roles[RoleUserFixedPitchFont].defaultFont isEqualToString: @"Courier"]) { return font_roles[RoleUserFixedPitchFont].defaultFont; } else if ([fontName hasPrefix: @"Helvetica-"] && ![font_roles[RoleSystemFont].defaultFont isEqualToString: @"Helvetica"]) { return [NSString stringWithFormat: @"%@-%@", font_roles[RoleSystemFont].defaultFont, [fontName substringFromIndex: 10]]; } return nil; } /** * Initializes a newly created font instance from the name and * information given in the fontMatrix. The fontMatrix is a standard * size element matrix as used in PostScript to describe the scaling * of the font, typically it just includes the font size as * [fontSize 0 0 fontSize 0 0].
* This method may destroy the receiver and return a cached instance. */ - (id) initWithName: (NSString*)name matrix: (const CGFloat*)fontMatrix screenFont: (BOOL)screen role: (int)aRole { GSFontMapKey *key; NSFont *font; /* Should never be called on an initialised font! */ NSAssert(fontName == nil, NSInternalInconsistencyException); /* Check whether the font is cached */ key = keyForFont(name, fontMatrix, screen, aRole); font = (id)NSMapGet(globalFontMap, (void *)key); if (font == nil) { if (self == placeHolder) { /* * If we are initialising the placeHolder, we actually want to * leave it be (for later re-use) and initialise a newly created * instance instead. */ self = [NSFontClass alloc]; } fontName = [name copy]; memcpy(matrix, fontMatrix, sizeof(matrix)); screenFont = screen; role = aRole; fontInfo = RETAIN([GSFontInfo fontInfoForFontName: fontName matrix: fontMatrix screenFont: screen]); if ((fontInfo == nil) && (aRole == RoleExplicit)) { NSString *replacementFontName = [self _replacementFontName]; if (replacementFontName != nil) { fontInfo = RETAIN([GSFontInfo fontInfoForFontName: replacementFontName matrix: fontMatrix screenFont: screen]); } } if (fontInfo == nil) { DESTROY(fontName); DESTROY(key); RELEASE(self); return nil; } /* Cache the font for later use */ NSMapInsert(globalFontMap, (void *)key, (void *)self); } else { if (self != placeHolder) { RELEASE(self); } self = RETAIN(font); } RELEASE(key); return self; } - (void) dealloc { if (fontName != nil) { GSFontMapKey *key; key = keyForFont(fontName, matrix, screenFont, role); NSMapRemove(globalFontMap, (void *)key); RELEASE(key); RELEASE(fontName); } TEST_RELEASE(fontInfo); DESTROY(cachedFlippedFont); DESTROY(cachedScreenFont); [super dealloc]; } - (NSString *) description { NSString *nameWithMatrix; NSString *description; nameWithMatrix = [[NSString alloc] initWithFormat: @"%@ %.3f %.3f %.3f %.3f %.3f %.3f %c %i", fontName, matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], screenFont ? 'S' : 'P', role]; description = [[super description] stringByAppendingFormat: @" %@", nameWithMatrix]; RELEASE(nameWithMatrix); return description; } - (BOOL) isEqual: (id)anObject { if (anObject == self) return YES; if ([anObject isKindOfClass: object_getClass(self)] == NO) return NO; if ([[anObject fontName] isEqual: fontName] == NO) return NO; if (memcmp(matrix, [(NSFont*)anObject matrix], sizeof(matrix)) != 0) return NO; return YES; } - (NSUInteger) hash { int i, sum; sum = 0; for (i = 0; i < 6; i++) sum += matrix[i] * ((i+1) * 17); return ([fontName hash] + sum); } /** * The NSFont class caches instances ... to actually make copies * of instances would defeat the whole point of caching, so the * effect of copying an NSFont is imply to retain it. */ - (id) copyWithZone: (NSZone*)zone { return RETAIN(self); } - (NSFont *)_flippedViewFont { if (cachedFlippedFont == nil) { CGFloat fontMatrix[6]; memcpy(fontMatrix, matrix, sizeof(matrix)); fontMatrix[3] *= -1; cachedFlippedFont = [placeHolder initWithName: fontName matrix: fontMatrix screenFont: screenFont role: role]; } return AUTORELEASE(RETAIN(cachedFlippedFont)); } static BOOL flip_hack; +(void) _setFontFlipHack: (BOOL)flip { flip_hack = flip; } // // Setting the Font // /** Sets the receiver as the font used for text drawing operations. If the current view is a flipped view, the reciever automatically flips itself to display correctly in the flipped view */ - (void) set { [self setInContext: GSCurrentContext()]; } - (void) setInContext: (NSGraphicsContext*)context { if ([[NSView focusView] isFlipped] || flip_hack) [context GSSetFont: [[self _flippedViewFont] fontRef]]; else [context GSSetFont: [self fontRef]]; [context useFont: fontName]; } // // Querying the Font // - (CGFloat) pointSize { return [fontInfo pointSize]; } - (NSString*) fontName { return fontName; } - (const CGFloat*) matrix { return matrix; } - (NSAffineTransform*) textTransform { NSAffineTransform *transform; NSAffineTransformStruct tstruct; tstruct.m11 = matrix[0]; tstruct.m12 = matrix[1]; tstruct.m21 = matrix[2]; tstruct.m22 = matrix[3]; tstruct.tX = matrix[4]; tstruct.tY = matrix[5]; transform = [NSAffineTransform transform]; [transform setTransformStruct: tstruct]; return transform; } - (NSString*) encodingScheme { return [fontInfo encodingScheme]; } - (NSString*) familyName { return [fontInfo familyName]; } - (NSRect) boundingRectForFont { return [fontInfo boundingRectForFont]; } - (BOOL) isFixedPitch { return [fontInfo isFixedPitch]; } - (BOOL) isBaseFont { return [fontInfo isBaseFont]; } /* Usually the display name of font is the font name.*/ - (NSString*) displayName { return fontName; } - (NSDictionary*) afmDictionary { return [fontInfo afmDictionary]; } /**

This method returns nil in the GNUstep implementation

*/ - (NSString*) afmFileContents { return [fontInfo afmFileContents]; } - (NSFont*) printerFont { if (!screenFont) return self; return AUTORELEASE([placeHolder initWithName: fontName matrix: matrix screenFont: NO role: role]); } - (NSFont*) screenFont { if (screenFont) return self; /* If we haven't already created the real screen font instance, do so now. Note that if the font has no corresponding screen font, cachedScreenFont will be set to nil. */ if (cachedScreenFont == nil) cachedScreenFont = [placeHolder initWithName: fontName matrix: matrix screenFont: YES role: role]; return AUTORELEASE(RETAIN(cachedScreenFont)); } - (NSFont*) screenFontWithRenderingMode: (NSFontRenderingMode)mode { // FIXME return [self screenFont]; } - (NSFontRenderingMode) renderingMode { // FIXME return NSFontDefaultRenderingMode; } - (CGFloat) ascender { return [fontInfo ascender]; } - (CGFloat) descender { return [fontInfo descender]; } - (CGFloat) capHeight { return [fontInfo capHeight]; } - (CGFloat) italicAngle { return [fontInfo italicAngle]; } - (NSSize) maximumAdvancement { return [fontInfo maximumAdvancement]; } - (NSSize) minimumAdvancement { return [fontInfo minimumAdvancement]; } - (CGFloat) underlinePosition { return [fontInfo underlinePosition]; } - (CGFloat) underlineThickness { return [fontInfo underlineThickness]; } - (CGFloat) xHeight { return [fontInfo xHeight]; } - (CGFloat) defaultLineHeightForFont { return [fontInfo defaultLineHeightForFont]; } - (CGFloat) leading { // FIXME return 0.0; } /* Computing font metrics attributes*/ - (CGFloat) widthOfString: (NSString*)string { return [fontInfo widthOfString: string]; } - (NSUInteger) numberOfGlyphs { return [fontInfo numberOfGlyphs]; } - (NSCharacterSet*) coveredCharacterSet { return [fontInfo coveredCharacterSet]; } - (NSFontDescriptor*) fontDescriptor { return [fontInfo fontDescriptor]; } /* The following methods have to be implemented by backends */ // // Manipulating Glyphs // - (NSSize) advancementForGlyph: (NSGlyph)aGlyph { return [fontInfo advancementForGlyph: aGlyph]; } - (NSRect) boundingRectForGlyph: (NSGlyph)aGlyph { return [fontInfo boundingRectForGlyph: aGlyph]; } - (BOOL) glyphIsEncoded: (NSGlyph)aGlyph { return [fontInfo glyphIsEncoded: aGlyph]; } - (NSMultibyteGlyphPacking) glyphPacking { return [fontInfo glyphPacking]; } - (NSGlyph) glyphWithName: (NSString*)glyphName { return [fontInfo glyphWithName: glyphName]; } - (NSPoint) positionOfGlyph: (NSGlyph)curGlyph precededByGlyph: (NSGlyph)prevGlyph isNominal: (BOOL*)nominal { return [fontInfo positionOfGlyph: curGlyph precededByGlyph: prevGlyph isNominal: nominal]; } - (NSPoint) positionOfGlyph: (NSGlyph)aGlyph forCharacter: (unichar)aChar struckOverRect: (NSRect)aRect { return [fontInfo positionOfGlyph: aGlyph forCharacter: aChar struckOverRect: aRect]; } - (NSPoint) positionOfGlyph: (NSGlyph)aGlyph struckOverGlyph: (NSGlyph)baseGlyph metricsExist: (BOOL *)flag { return [fontInfo positionOfGlyph: aGlyph struckOverGlyph: baseGlyph metricsExist: flag]; } - (NSPoint) positionOfGlyph: (NSGlyph)aGlyph struckOverRect: (NSRect)aRect metricsExist: (BOOL *)flag { return [fontInfo positionOfGlyph: aGlyph struckOverRect: aRect metricsExist: flag]; } - (NSPoint) positionOfGlyph: (NSGlyph)aGlyph withRelation: (NSGlyphRelation)relation toBaseGlyph: (NSGlyph)baseGlyph totalAdvancement: (NSSize *)offset metricsExist: (BOOL *)flag { return [fontInfo positionOfGlyph: aGlyph withRelation: relation toBaseGlyph: baseGlyph totalAdvancement: offset metricsExist: flag]; } - (int) positionsForCompositeSequence: (NSGlyph *)glyphs numberOfGlyphs: (int)numGlyphs pointArray: (NSPoint *)points { int i; NSGlyph base = glyphs[0]; points[0] = NSZeroPoint; for (i = 1; i < numGlyphs; i++) { BOOL flag; // This only places the glyphs relative to the base glyph // not to each other points[i] = [self positionOfGlyph: glyphs[i] struckOverGlyph: base metricsExist: &flag]; if (!flag) return i - 1; } return i; } - (void) getAdvancements: (NSSizeArray)advancements forGlyphs: (const NSGlyph*)glyphs count: (NSUInteger)count { // FIXME int i; for (i = 0; i < count; i++) { advancements[i] = [self advancementForGlyph: glyphs[i]]; } } - (void) getAdvancements: (NSSizeArray)advancements forPackedGlyphs: (const void*)glyphs count: (NSUInteger)count { // FIXME } - (void) getBoundingRects: (NSRectArray)bounds forGlyphs: (const NSGlyph*)glyphs count: (NSUInteger)count { // FIXME int i; for (i = 0; i < count; i++) { bounds[i] = [self boundingRectForGlyph: glyphs[i]]; } } - (NSStringEncoding) mostCompatibleStringEncoding { return [fontInfo mostCompatibleStringEncoding]; } // // NSCoding protocol // - (Class) classForCoder { return NSFontClass; } - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { [aCoder encodeObject: fontName forKey: @"NSName"]; [aCoder encodeFloat: [self pointSize] forKey: @"NSSize"]; switch (role >> 1) { // FIXME: Many cases still missing case RoleControlContentFont: [aCoder encodeInt: 16 forKey: @"NSfFlags"]; break; case RoleLabelFont: [aCoder encodeInt: 20 forKey: @"NSfFlags"]; break; case RoleTitleBarFont: [aCoder encodeInt: 22 forKey: @"NSfFlags"]; break; default: break; } } else { [aCoder encodeValueOfObjCType: @encode(int) at: &role]; if (role == 0) { float fontMatrix[6]; BOOL fix = NO; fontMatrix[0] = matrix[0]; fontMatrix[1] = matrix[1]; fontMatrix[2] = matrix[2]; fontMatrix[3] = matrix[3]; fontMatrix[4] = matrix[4]; fontMatrix[5] = matrix[5]; [aCoder encodeObject: fontName]; [aCoder encodeArrayOfObjCType: @encode(float) count: 6 at: fontMatrix]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &fix]; } else if (role & 1) { float size = matrix[0]; [aCoder encodeValueOfObjCType: @encode(float) at: &size]; } } } - (id) initWithCoder: (NSCoder*)aDecoder { if ([aDecoder allowsKeyedCoding]) { NSString *name = [aDecoder decodeObjectForKey: @"NSName"]; float size = [aDecoder decodeFloatForKey: @"NSSize"]; DESTROY(self); self = RETAIN([NSFont fontWithName: name size: size]); if (self == nil) { if ([aDecoder containsValueForKey: @"NSfFlags"]) { int flags = [aDecoder decodeIntForKey: @"NSfFlags"]; // FIXME if (flags == 16) { return RETAIN([NSFont controlContentFontOfSize: size]); } else if (flags == 20) { return RETAIN([NSFont labelFontOfSize: size]); } else if (flags == 22) { return RETAIN([NSFont titleBarFontOfSize: size]); } } self = RETAIN([NSFont systemFontOfSize: size]); } return self; } else { int version = [aDecoder versionForClassName: @"NSFont"]; id name; float fontMatrix[6]; CGFloat cgMatrix[6]; int the_role; if (version == 3) { [aDecoder decodeValueOfObjCType: @encode(int) at: &the_role]; } else { the_role = RoleExplicit; } if (the_role == RoleExplicit) { /* The easy case: an explicit font, or a font encoded with version <= 2. */ name = [aDecoder decodeObject]; [aDecoder decodeArrayOfObjCType: @encode(float) count: 6 at: fontMatrix]; if (version >= 2) { BOOL fix; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &fix]; } cgMatrix[0] = fontMatrix[0]; cgMatrix[1] = fontMatrix[1]; cgMatrix[2] = fontMatrix[2]; cgMatrix[3] = fontMatrix[3]; cgMatrix[4] = fontMatrix[4]; cgMatrix[5] = fontMatrix[5]; self = [self initWithName: name matrix: cgMatrix screenFont: NO role: RoleExplicit]; if (self) return self; self = [NSFont userFontOfSize: fontMatrix[0]]; NSAssert(self != nil, @"Couldn't find a valid font when decoding."); return RETAIN(self); } else { /* A non-explicit font. */ float size; NSFont *new; if (the_role & 1) { [aDecoder decodeValueOfObjCType: @encode(float) at: &size]; } else { size = 0.0; } switch (the_role >> 1) { case RoleBoldSystemFont: new = [NSFont boldSystemFontOfSize: size]; break; case RoleSystemFont: new = [NSFont systemFontOfSize: size]; break; case RoleUserFixedPitchFont: new = [NSFont userFixedPitchFontOfSize: size]; break; case RoleTitleBarFont: new = [NSFont titleBarFontOfSize: size]; break; case RoleMenuFont: new = [NSFont menuFontOfSize: size]; break; case RoleMessageFont: new = [NSFont messageFontOfSize: size]; break; case RolePaletteFont: new = [NSFont paletteFontOfSize: size]; break; case RoleToolTipsFont: new = [NSFont toolTipsFontOfSize: size]; break; case RoleControlContentFont: new = [NSFont controlContentFontOfSize: size]; break; case RoleLabelFont: new = [NSFont labelFontOfSize: size]; break; case RoleMenuBarFont: new = [NSFont menuBarFontOfSize: size]; break; default: NSDebugLLog(@"NSFont", @"unknown role %i", the_role); /* fall through */ case RoleUserFont: new = [NSFont userFontOfSize: size]; break; } RELEASE(self); if (new) return RETAIN(new); new = [NSFont userFontOfSize: size]; NSAssert(new != nil, @"Couldn't find a valid font when decoding."); return RETAIN(new); } } } @end /* NSFont */ @implementation NSFont (GNUstep) // // Private method for NSFontManager and backend // - (GSFontInfo*) fontInfo { return fontInfo; } - (void *) fontRef { if (_fontRef == nil) _fontRef = fontInfo; return _fontRef; } // This is a private but popular Cocoa method. - (NSGlyph) _defaultGlyphForChar: (unichar)theChar { return [fontInfo glyphForCharacter: theChar]; } @end int NSConvertGlyphsToPackedGlyphs(NSGlyph *glBuf, int count, NSMultibyteGlyphPacking packing, char *packedGlyphs) { int i; int j; j = 0; // Store the number of glyphs in the first byte. packedGlyphs[j++] = count; for (i = 0; i < count; i++) { NSGlyph g = glBuf[i]; switch (packing) { case NSOneByteGlyphPacking: packedGlyphs[j++] = (char)(g & 0xFF); break; case NSTwoByteGlyphPacking: packedGlyphs[j++] = (char)((g & 0xFF00) >> 8) ; packedGlyphs[j++] = (char)(g & 0xFF); break; case NSFourByteGlyphPacking: packedGlyphs[j++] = (char)((g & 0xFF000000) >> 24) ; packedGlyphs[j++] = (char)((g & 0xFF0000) >> 16); packedGlyphs[j++] = (char)((g & 0xFF00) >> 8) ; packedGlyphs[j++] = (char)(g & 0xFF); break; case NSJapaneseEUCGlyphPacking: case NSAsciiWithDoubleByteEUCGlyphPacking: default: // FIXME break; } } return j; } gnustep-gui-0.24.0/Source/GSNibLoading.m0000664000076500007650000016163212144252273017633 0ustar brains99brains99/** GSNibLoading These are templates for use with OSX Nib files. These classes are the templates and other things which are needed for reading/writing nib files. Copyright (C) 1997, 1999 Free Software Foundation, Inc. Author: Gregory John Casamento Date: 2003, 2005 Author: Fred Kiefer Date: 2003, 2010 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #define EXPOSE_NSKeyedUnarchiver_IVARS #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import "GNUstepGUI/GSNibLoading.h" #import "AppKit/NSApplication.h" #import "AppKit/NSImage.h" #import "AppKit/NSMenuItem.h" #import "AppKit/NSMenuView.h" #import "AppKit/NSNib.h" #import "AppKit/NSScreen.h" #import "AppKit/NSSound.h" #import "AppKit/NSToolbar.h" #import "GNUstepGUI/GSInstantiator.h" #import "GSGuiPrivate.h" static BOOL _isInInterfaceBuilder = NO; @interface NSKeyedUnarchiver (NSClassSwapperPrivate) - (Class) replacementClassForClassName: (NSString *)className; @end @interface NSApplication (NibCompatibility) - (void) _setMainMenu: (NSMenu*)aMenu; @end @interface NSView (NibCompatibility) - (void) _fixSubviews; @end /* Correct some instances where the ":" is missing from the method name in the label */ @interface NSNibControlConnector (NibCompatibility) - (void) instantiateWithInstantiator: (id)instantiator; @end @interface NSNibConnector (NibCompatibility) - (void) instantiateWithInstantiator: (id)instantiator; @end @interface NSDecimalNumberPlaceholder : NSObject @end @interface _NSCornerView : NSView @end @interface NSMenu (NibCompatibility) - (void) _setMain: (BOOL)isMain; @end @interface NSMenu (GNUstepPrivate) - (void) _setGeometry; @end @implementation NSMenu (NibCompatibility) // FIXME: Why can't this be merged with setMain: ? - (void) _setMain: (BOOL)isMain { if (isMain) { NSMenuView *oldRep; NSInterfaceStyle oldStyle; NSInterfaceStyle newStyle; NSString *processName; if ([self numberOfItems] == 0) return; oldRep = [self menuRepresentation]; oldStyle = [oldRep interfaceStyle]; newStyle = NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil); processName = [[NSProcessInfo processInfo] processName]; /* * If necessary, rebuild menu for (different) style */ if (oldStyle != newStyle) { NSMenuView *newRep; newRep = [[NSMenuView alloc] initWithFrame: NSZeroRect]; if (newStyle == NSMacintoshInterfaceStyle || newStyle == NSWindows95InterfaceStyle) { [newRep setHorizontal: YES]; } else { [newRep setHorizontal: NO]; } [newRep setInterfaceStyle: newStyle]; [self setMenuRepresentation: newRep]; RELEASE(newRep); } [[self window] setTitle: processName]; [[self window] setLevel: NSMainMenuWindowLevel]; // if it's a standard menu, transform it to be more NeXT'ish/GNUstep-like if (_menu.horizontal == NO) { NSMenuItem *appItem; NSMenu *sub; SEL sel = @selector(terminate:); /* The title of the main menu should be the process name. */ [self setTitle: processName]; /* If there is no 'quite' item (one which sends a -terminate: * actions) we add one. */ if ([self indexOfItemWithTarget: nil andAction: sel] < 0 && [self indexOfItemWithTarget: NSApp andAction: sel] < 0) { NSString *quitString; NSMenuItem *quitItem; quitString = [NSString stringWithFormat: @"%@ %@", NSLocalizedString (@"Quit", @"Quit"), processName]; quitItem = [[NSMenuItem alloc] initWithTitle: quitString action: @selector(terminate:) keyEquivalent: @"q"]; [self addItem: quitItem]; } /* An OSX main menu has the first item pointing to a submenu * whose contents are much the same as a GNUstep info menu. */ appItem = (NSMenuItem*)[self itemAtIndex: 0]; // Info item. sub = [appItem submenu]; if (sub != nil) { NSString *infoString; NSInteger index; infoString = NSLocalizedString (@"Info", @"Info"); [appItem setTitle: infoString]; [sub setTitle: infoString]; /* The submenu may contain a 'quit' item ... if so we need to * remove it as we already added one to the main menu. */ index = [sub indexOfItemWithTarget: nil andAction: sel]; if (index < 0) { index = [sub indexOfItemWithTarget: NSApp andAction: sel]; } if (index >= 0) { [sub removeItemAtIndex: index]; } } } [self _setGeometry]; [self sizeToFit]; if ([NSApp isActive]) { [self display]; } } else { [self close]; [[self window] setLevel: NSSubmenuWindowLevel]; } } @end @implementation NSApplication (NibCompatibility) - (void) _setMainMenu: (NSMenu*)aMenu { if (_main_menu == aMenu) { return; } if (_main_menu != nil) { [_main_menu setMain: NO]; } ASSIGN(_main_menu, aMenu); if (_main_menu != nil) { [_main_menu _setMain: YES]; } } @end @implementation NSView (NibCompatibility) - (void) _setWindow: (id) w { _window = w; } - (void) _fixSubviews { NSEnumerator *en = [[self subviews] objectEnumerator]; id v = nil; while ((v = [en nextObject]) != nil) { if ([v window] != [self window] || [v superview] != self) { [v _setWindow: [self window]]; RETAIN(v); [_sub_views removeObject: v]; [self addSubview: v]; RELEASE(v); } [v _fixSubviews]; } } @end /** * NSWindowTemplate * * Instances of this class take the place of all windows in the nib file. */ @implementation NSWindowTemplate + (void) initialize { if (self == [NSWindowTemplate class]) { [self setVersion: 0]; } } - (void) dealloc { RELEASE(_title); RELEASE(_viewClass); RELEASE(_windowClass); RELEASE(_view); RELEASE(_autosaveName); RELEASE(_realObject); [super dealloc]; } /** * Designated initializer for NSWindowTemplate. */ - (id) initWithWindow: (NSWindow *)window className: (NSString *)windowClass isDeferred: (BOOL) deferred isOneShot: (BOOL) oneShot isVisible: (BOOL) visible wantsToBeColor: (BOOL) wantsToBeColor autoPositionMask: (int) autoPositionMask { if ((self = [super init]) != nil) { if (window != nil) { // object members ASSIGN(_title, [window title]); ASSIGN(_viewClass, NSStringFromClass([[window contentView] class])); ASSIGN(_windowClass, windowClass); ASSIGN(_view, [window contentView]); ASSIGN(_autosaveName, [window frameAutosaveName]); // style & size _windowStyle = [window styleMask]; _backingStoreType = [window backingType]; _maxSize = [window maxSize]; _minSize = [window minSize]; _windowRect = [window frame]; _screenRect = [[NSScreen mainScreen] frame]; // flags _flags.isHiddenOnDeactivate = [window hidesOnDeactivate]; _flags.isNotReleasedOnClose = (![window isReleasedWhenClosed]); _flags.isDeferred = deferred; _flags.isOneShot = oneShot; _flags.isVisible = visible; _flags.wantsToBeColor = wantsToBeColor; _flags.dynamicDepthLimit = [window hasDynamicDepthLimit]; _flags.autoPositionMask = autoPositionMask; _flags.savePosition = YES; // not yet implemented. } } return self; } - (id) initWithCoder: (NSCoder *)coder { if ([coder allowsKeyedCoding]) { if ([coder containsValueForKey: @"NSViewClass"]) { ASSIGN(_viewClass, [coder decodeObjectForKey: @"NSViewClass"]); } if ([coder containsValueForKey: @"NSWindowClass"]) { ASSIGN(_windowClass, [coder decodeObjectForKey: @"NSWindowClass"]); } if ([coder containsValueForKey: @"NSWindowStyleMask"]) { _windowStyle = [coder decodeIntForKey: @"NSWindowStyleMask"]; } if ([coder containsValueForKey: @"NSWindowBacking"]) { _backingStoreType = [coder decodeIntForKey: @"NSWindowBacking"]; } if ([coder containsValueForKey: @"NSWindowView"]) { ASSIGN(_view, [coder decodeObjectForKey: @"NSWindowView"]); } if ([coder containsValueForKey: @"NSWTFlags"]) { unsigned long flags = [coder decodeIntForKey: @"NSWTFlags"]; memcpy((void *)&_flags,(void *)&flags,sizeof(struct _GSWindowTemplateFlags)); } if ([coder containsValueForKey: @"NSMinSize"]) { _minSize = [coder decodeSizeForKey: @"NSMinSize"]; } if ([coder containsValueForKey: @"NSMaxSize"]) { _maxSize = [coder decodeSizeForKey: @"NSMaxSize"]; } else { _maxSize = NSMakeSize (10e4, 10e4); } if ([coder containsValueForKey: @"NSWindowRect"]) { _windowRect = [coder decodeRectForKey: @"NSWindowRect"]; } if ([coder containsValueForKey: @"NSFrameAutosaveName"]) { ASSIGN(_autosaveName, [coder decodeObjectForKey: @"NSFrameAutosaveName"]); } if ([coder containsValueForKey: @"NSWindowTitle"]) { ASSIGN(_title, [coder decodeObjectForKey: @"NSWindowTitle"]); _windowStyle |= NSTitledWindowMask; } _baseWindowClass = [NSWindow class]; } else { [NSException raise: NSInvalidArgumentException format: @"Can't decode %@ with %@.",NSStringFromClass([self class]), NSStringFromClass([coder class])]; } return self; } - (void) encodeWithCoder: (NSCoder *)aCoder { if ([aCoder allowsKeyedCoding]) { unsigned long flags = 0; NSRect rect = [NSWindow contentRectForFrameRect: _windowRect styleMask: _windowStyle]; memcpy((void *)&flags,(void *)&_flags,sizeof(unsigned long)); [aCoder encodeObject: _viewClass forKey: @"NSViewClass"]; [aCoder encodeObject: _windowClass forKey: @"NSWindowClass"]; [aCoder encodeInt: _windowStyle forKey: @"NSWindowStyleMask"]; [aCoder encodeInt: _backingStoreType forKey: @"NSWindowBacking"]; [aCoder encodeObject: _view forKey: @"NSWindowView"]; [aCoder encodeInt: flags forKey: @"NSWTFlags"]; [aCoder encodeSize: _minSize forKey: @"NSMinSize"]; [aCoder encodeSize: _maxSize forKey: @"NSMaxSize"]; [aCoder encodeRect: rect forKey: @"NSWindowRect"]; [aCoder encodeObject: _title forKey: @"NSWindowTitle"]; [aCoder encodeObject: _autosaveName forKey: @"NSFrameAutosaveName"]; } } /** * This method is used to get the real object when connections are established. */ - (id) nibInstantiate { if (_realObject == nil) { Class aClass; if ([NSClassSwapper isInInterfaceBuilder]) { aClass = [self baseWindowClass]; } else { aClass = NSClassFromString(_windowClass); } if (aClass == nil) { [NSException raise: NSInternalInconsistencyException format: @"Unable to find class '%@'", _windowClass]; } _realObject = [[aClass allocWithZone: NSDefaultMallocZone()] initWithContentRect: _windowRect styleMask: _windowStyle backing: _backingStoreType defer: _flags.isDeferred]; // set flags... [_realObject setHidesOnDeactivate: _flags.isHiddenOnDeactivate]; [_realObject setReleasedWhenClosed: !(_flags.isNotReleasedOnClose)]; [_realObject setOneShot: _flags.isOneShot]; // [_realObject setVisible: _flags.isVisible]; // this is determined by whether it's in the visible windows array... // [_realObject setWantsToBeColor: _flags.wantsToBeColor]; // not applicable on GNUstep. [_realObject setAutodisplay: YES]; [_realObject setDynamicDepthLimit: _flags.dynamicDepthLimit]; // [_realObject setAutoPositionMask: _flags.autoPositionMask]; // currently not implemented for nibs // [_realObject setAutoPosition: _flags.autoPosition]; [_realObject setDynamicDepthLimit: _flags.dynamicDepthLimit]; // [_realObject setFrameAutosaveName: _autosaveName]; // done after setting the min/max sizes // reset attributes... [_realObject setContentView: _view]; [_realObject setMinSize: _minSize]; [_realObject setMaxSize: _maxSize]; [_realObject setTitle: _title]; if ([_viewClass isKindOfClass: [NSToolbar class]]) { // FIXME: No idea what is going on here [_realObject setToolbar: (NSToolbar*)_viewClass]; } [_view _fixSubviews]; // FIXME What is the point of calling -setFrame:display: here? It looks // like an effective no op to me. // resize the window... [_realObject setFrame: [NSWindow frameRectForContentRect: [self windowRect] styleMask: [self windowStyle]] display: NO]; [_realObject setFrameAutosaveName: _autosaveName]; } return _realObject; } // setters and getters /** * sets the type of backing store the window uses. */ - (void) setBackingStoreType: (NSBackingStoreType)type { _backingStoreType = type; } /** * Returns the type of backing store which is used. */ - (NSBackingStoreType) backingStoreType { return _backingStoreType; } /** * Sets whether or not the window is deferred. */ - (void) setDeferred: (BOOL)flag { _flags.isDeferred = flag; } /** * Returns YES, if the window is deferred, NO otherwise. */ - (BOOL) isDeferred { return _flags.isDeferred; } /** * Sets the maximum size of the window. */ - (void) setMaxSize: (NSSize)maxSize { _maxSize = maxSize; } /** * Returns the maximum size of the window. */ - (NSSize) maxSize { return _maxSize; } /** * Sets the minimum size of the window. */ - (void) setMinSize: (NSSize)minSize { _minSize = minSize; } /** * Returns the maximum size of the window. */ - (NSSize) minSize { return _minSize; } /** * Sets the window style. */ - (void) setWindowStyle: (unsigned)style { _windowStyle = style; } /** * Returns the window style. */ - (unsigned) windowStyle { return _windowStyle; } /** * Sets the window title. */ - (void) setTitle: (NSString *) title { ASSIGN(_title, title); } /** * Returns the window style. */ - (NSString *)title; { return _title; } /** * Sets the class used for the content view. */ - (void) setViewClass: (NSString *)viewClass { ASSIGN(_viewClass,viewClass); } /** * Returns the name of the class used for the content view. */ - (NSString *)viewClass { return _viewClass; } /** * Sets the window rect. */ - (void) setWindowRect: (NSRect)rect { _windowRect = rect; } /** * Returns the window rect. */ - (NSRect)windowRect { return _windowRect; } /** * Sets the screen rect. */ - (void) setScreenRect: (NSRect)rect { _screenRect = rect; } /** * Returns the screen rect. */ - (NSRect) screenRect { return _screenRect; } /** * Sets the instantiated object/real object. */ - (void) setRealObject: (id)o { ASSIGN(_realObject,o); } /** * Returns the real object represented by this template. */ - (id) realObject { return _realObject; } /** * Sets the view instance. */ - (void) setView: (id)view { ASSIGN(_view,view); } /** * Gets the view instance. */ - (id) view { return _view; } /** * sets the class name to be used when unarchiving the window. */ - (void) setClassName: (NSString *)name { ASSIGN(_windowClass, name); } /** * Returns the class instance. */ - (NSString *)className { return _windowClass; } /** * Returns the base window class. This is usually NSWindow, but this method * is overriden in the editor so that a different class may be used to take the * place of the window. In the case of Gorm, this is GormNSWindow. */ - (Class) baseWindowClass { return _baseWindowClass; } @end /* * NSViewTemplate * * Template for any classes which derive from NSView */ @implementation NSViewTemplate + (void) initialize { if (self == [NSViewTemplate class]) { [self setVersion: 0]; } } - (void) dealloc { RELEASE(_className); RELEASE(_realObject); [super dealloc]; } /** * Designated initializer for NSViewTemplate. */ - (id) initWithObject: (id)o className: (NSString *)name { if ((self = [super init]) != nil) { [self setRealObject: o]; [self setClassName: name]; } return self; } - (id) initWithCoder: (NSCoder *)coder { self = [super initWithCoder: coder]; if (self != nil) { if ([coder allowsKeyedCoding]) { _className = [coder decodeObjectForKey: @"NSClassName"]; } if (_realObject == nil) { Class aClass = NSClassFromString(_className); if (aClass == nil) { [NSException raise: NSInternalInconsistencyException format: @"Unable to find class '%@'", _className]; } else { ASSIGN(_realObject, [[aClass allocWithZone: NSDefaultMallocZone()] initWithCoder: coder]); [[self superview] replaceSubview: self with: _realObject]; // replace the old view... } } AUTORELEASE(self); return _realObject; } else { [NSException raise: NSInvalidArgumentException format: @"Can't decode %@ with %@.",NSStringFromClass([self class]), NSStringFromClass([coder class])]; } return nil; } - (void) encodeWithCoder: (NSCoder *)coder { if ([coder allowsKeyedCoding]) { [coder encodeObject: (id)_className forKey: @"NSClassName"]; [_realObject encodeWithCoder: coder]; } else { [NSException raise: NSInvalidArgumentException format: @"Can't encode %@ with %@.",NSStringFromClass([self class]), NSStringFromClass([coder class])]; } } // setters and getters /** * Set the class name to be used by the NSView subclass. */ - (void) setClassName: (NSString *)name { ASSIGN(_className, name); } /** * Returns the classname. */ - (NSString *)className { return _className; } /** * Set the real object of the template. */ - (void) setRealObject: (id)o { ASSIGN(_realObject, o); } /** * Get the real object represented by the template. */ - (id) realObject { return _realObject; } @end // Template for any classes which derive from NSText @implementation NSTextTemplate + (void) initialize { if (self == [NSTextTemplate class]) { [self setVersion: 0]; } } @end /** * NSTextViewTemplate * * Template for any classes which derive from NSTextView */ @implementation NSTextViewTemplate + (void) initialize { if (self == [NSTextViewTemplate class]) { [self setVersion: 0]; } } @end // Template for any classes which derive from NSMenu. @implementation NSMenuTemplate + (void) initialize { if (self == [NSMenuTemplate class]) { [self setVersion: 0]; } } - (void) dealloc { RELEASE(_menuClass); RELEASE(_realObject); [super dealloc]; } - (id) initWithCoder: (NSCoder *)aCoder { RELEASE(self); return nil; } - (void) encodeWithCoder: (NSCoder *)aCoder { } - (void) setClassName: (NSString *)className { ASSIGN(_menuClass, className); } - (NSString *)className { return _menuClass; } - (void) setRealObject: (id)o { ASSIGN(_realObject,o); } - (id) realObject { return _realObject; } @end @implementation NSCustomObject - (void) setClassName: (NSString *)name { ASSIGNCOPY(_className, name); } - (NSString *)className { return _className; } - (void) setExtension: (NSString *)name { ASSIGNCOPY(_extension, name); } - (NSString *)extension { return _extension; } - (void) setRealObject: (id)obj { ASSIGN(_object, obj); } - (id) realObject { return _object; } - (id) initWithCoder: (NSCoder *)coder { if ([coder allowsKeyedCoding]) { ASSIGN(_className, [coder decodeObjectForKey: @"NSClassName"]); ASSIGN(_extension, [coder decodeObjectForKey: @"NSExtension"]); ASSIGN(_object, [coder decodeObjectForKey: @"NSObject"]); } else { [NSException raise: NSInvalidArgumentException format: @"Can't decode %@ with %@.",NSStringFromClass([self class]), NSStringFromClass([coder class])]; } return self; } - (void) encodeWithCoder: (NSCoder *)coder { if ([coder allowsKeyedCoding]) { [coder encodeObject: (id)_className forKey: @"NSClassName"]; [coder encodeConditionalObject: (id)_extension forKey: @"NSExtension"]; [coder encodeConditionalObject: (id)_object forKey: @"NSObject"]; } else { [NSException raise: NSInvalidArgumentException format: @"Keyed coding not implemented for %@.", NSStringFromClass([self class])]; } } - (id) nibInstantiate { if (_object == nil) { Class aClass; if ([NSClassSwapper isInInterfaceBuilder]) { aClass = [self class]; } else { aClass = NSClassFromString(_className); } if (aClass == nil) { [NSException raise: NSInternalInconsistencyException format: @"Unable to find class '%@'", _className]; } if (GSObjCIsKindOf(aClass, [NSApplication class]) || [_className isEqual: @"NSApplication"]) { _object = RETAIN([aClass sharedApplication]); } else { _object = [[aClass allocWithZone: NSDefaultMallocZone()] init]; } } return _object; } - (void) awakeFromNib { NSDebugLog(@"Called awakeFromNib on an NSCustomObject instance: %@", self); if ([_object respondsToSelector: @selector(awakeFromNib)]) { [_object awakeFromNib]; } } - (NSString *) description { return [NSString stringWithFormat: @"<%s: %lx> = <>", GSClassNameFromObject(self), (unsigned long)self, _className,_object]; } - (void) dealloc { RELEASE(_className); RELEASE(_extension); RELEASE(_object); [super dealloc]; } @end @implementation NSCustomView - (void) setClassName: (NSString *)name { ASSIGNCOPY(_className, name); } - (NSString *)className { return _className; } - (void) setExtension: (NSString *)ext; { ASSIGNCOPY(_extension, ext); } - (NSString *)extension { return _extension; } - (id) nibInstantiate { if ([NSClassSwapper isInInterfaceBuilder]) { _view = self; return self; } if (_view == nil) { Class aClass; // If the class name is nil, assume NSView. if (_className == nil) { aClass = [NSView class]; } else { aClass = NSClassFromString(_className); } if (aClass == nil) { [NSException raise: NSInternalInconsistencyException format: @"Unable to find class '%@'", _className]; } else { _view = [[aClass allocWithZone: NSDefaultMallocZone()] initWithFrame: [self frame]]; } } return _view; } - (id) nibInstantiateWithCoder: (NSCoder *)coder { if ([NSClassSwapper isInInterfaceBuilder]) { return _view; } else if ([coder allowsKeyedCoding]) { NSArray *subs = nil; id nextKeyView = nil; id prevKeyView = nil; NSEnumerator *en = nil; id v = nil; // Tell the decoder that the object gets replaced before decoding subviews [(NSKeyedUnarchiver *)coder replaceObject: self withObject: _view]; prevKeyView = [coder decodeObjectForKey: @"NSPreviousKeyView"]; nextKeyView = [coder decodeObjectForKey: @"NSNextKeyView"]; if (nextKeyView != nil) { [_view setNextKeyView: nextKeyView]; } if (prevKeyView != nil) { [_view setPreviousKeyView: prevKeyView]; } if ([coder containsValueForKey: @"NSvFlags"]) { int vFlags = [coder decodeIntForKey: @"NSvFlags"]; [_view setAutoresizingMask: vFlags & 0x3F]; [_view setAutoresizesSubviews: ((vFlags & 0x100) == 0x100)]; [_view setHidden: ((vFlags & 0x80000000) == 0x80000000)]; } /* if ([coder containsValueForKey: @"NSNextResponder"]) { [_view setNextResponder: [coder decodeObjectForKey: @"NSNextResponder"]]; } */ // reset the bounds... // [_view setBounds: [_view frame]]; subs = [coder decodeObjectForKey: @"NSSubviews"]; en = [subs objectEnumerator]; while((v = [en nextObject]) != nil) { [_view addSubview: v]; } } else { [NSException raise: NSInternalInconsistencyException format: @"Called NSCustomView awakeAfterUsingCoder with non-keyed archiver."]; } return _view; } - (id) initWithCoder: (NSCoder *)coder { // if in interface builder, then initialize as normal. if ([NSClassSwapper isInInterfaceBuilder]) { self = [super initWithCoder: coder]; if (self == nil) { return nil; } } if ([coder allowsKeyedCoding]) { // get the super stuff without calling super... if ([coder containsValueForKey: @"NSFrame"]) { _frame = [coder decodeRectForKey: @"NSFrame"]; } else { _frame = NSZeroRect; if ([coder containsValueForKey: @"NSFrameSize"]) { _frame.size = [coder decodeSizeForKey: @"NSFrameSize"]; } } ASSIGN(_className, [coder decodeObjectForKey: @"NSClassName"]); ASSIGN(_extension, [coder decodeObjectForKey: @"NSExtension"]); if ([self nibInstantiate] != nil) { [self nibInstantiateWithCoder: coder]; } if (self != _view) { AUTORELEASE(self); } } else { [NSException raise: NSInvalidArgumentException format: @"Can't decode %@ with %@.",NSStringFromClass([self class]), NSStringFromClass([coder class])]; } return (id)_view; } - (void) encodeWithCoder: (NSCoder *)coder { [super encodeWithCoder: coder]; if ([coder allowsKeyedCoding]) { [coder encodeObject: _className forKey: @"NSClassName"]; [coder encodeObject: _extension forKey: @"NSExtension"]; } else { [NSException raise: NSInvalidArgumentException format: @"Can't encode %@ with %@.",NSStringFromClass([self class]), NSStringFromClass([coder class])]; } } @end /** * This class represents an image or a sound which is referenced by the nib file. */ @implementation NSCustomResource - (void) setClassName: (NSString *)className { ASSIGNCOPY(_className, className); } - (NSString *)className { return _className; } - (void) setResourceName: (NSString *)resourceName { ASSIGNCOPY(_resourceName, resourceName); } - (NSString *)resourceName { return _resourceName; } - (id) initWithCoder: (NSCoder *)coder { id realObject = nil; if ([coder allowsKeyedCoding]) { ASSIGN(_className, [coder decodeObjectForKey: @"NSClassName"]); ASSIGN(_resourceName, [coder decodeObjectForKey: @"NSResourceName"]); // FIXME: this is a hack, but for now it should do. if ([_className isEqual: @"NSSound"]) { realObject = RETAIN([NSSound soundNamed: _resourceName]); } else if ([_className isEqual: @"NSImage"]) { realObject = RETAIN([NSImage imageNamed: _resourceName]); } if (realObject == nil) { NSLog(@"Could not load NSCustomResource %@ for class %@", _resourceName, _className); // Use a default instead of the missing object if ([_className isEqual: @"NSSound"]) { realObject = RETAIN([NSSound soundNamed: @"Ping"]); } else if ([_className isEqual: @"NSImage"]) { realObject = RETAIN([NSImage imageNamed: @"GNUstep"]); } } // The object has been substituted, release the placeholder. RELEASE(self); } else { [NSException raise: NSInvalidArgumentException format: @"Can't decode %@ with %@.",NSStringFromClass([self class]), NSStringFromClass([coder class])]; } return realObject; } - (void) encodeWithCoder: (NSCoder *)coder { if ([coder allowsKeyedCoding]) { [coder encodeObject: (id)_className forKey: @"NSClassName"]; [coder encodeObject: (id)_resourceName forKey: @"NSResourceName"]; } } @end /** * Category to add methods to NSKeyedUnarchiver which are needed during * nib reading. */ @implementation NSKeyedUnarchiver (NSClassSwapperPrivate) /** * This method returns the class which replaces the class named * by className. It uses the classes map to do this. */ - (Class) replacementClassForClassName: (NSString *)className { Class aClass; if ((aClass = [self classForClassName: className]) == nil) { if ((aClass = [[self class] classForClassName: className]) == nil) { aClass = NSClassFromString(className); if (aClass == nil) { [NSException raise: NSInternalInconsistencyException format: @"NSClassSwapper unable to find class '%@'", className]; } } } return aClass; } @end /** * NSClassSwapper * * This class is used to stand-in for objects which need to be replaced by another object. * When this class is loaded in the live application, it unarchives and immediately replaces * itself with the instance of the object requested. This is necessary since IB/Gorm does * have objects this is used for in palettes, so there is no "live" or actual instance saved * in the gorm file... only this object as a stand in. */ @implementation NSClassSwapper - (id) initWithObject: (id)object withClassName: (NSString *)className originalClassName: (NSString *)origClassName { if ((self = [super init]) != nil) { [self setTemplate: object]; [self setClassName: className]; [self setOriginalClassName: origClassName]; } return self; } /** * This class method keeps track of whether or not we are operating within IB/Gorm. * When unarchiving in IB/Gorm some behavior may need to be surpressed for some objects * or it */ + (void) setIsInInterfaceBuilder: (BOOL)flag { _isInInterfaceBuilder = flag; } /** * returns YES, if we are currently in IB/Gorm. */ + (BOOL) isInInterfaceBuilder { return _isInInterfaceBuilder; } /** * Sets the template represented by temp. */ - (void) setTemplate: (id)temp { ASSIGN(_template, temp); } /** * Returns the template. */ - (id) template { return _template; } /** * Sets the class name. */ - (void) setClassName: (NSString *)className { ASSIGNCOPY(_className, className); } /** * Returns the class name. */ - (NSString *)className { return _className; } /** * Sets the original class name. */ - (void) setOriginalClassName: (NSString *)className { ASSIGNCOPY(_originalClassName, className); } /** * Returns the original class name. */ - (NSString *)originalClassName { return _originalClassName; } /** * Instantiates the real object using className. */ - (void) instantiateRealObject: (NSCoder *)coder withClassName: (NSString *)className { Class newClass = nil; id object = nil; NSKeyedUnarchiver *decoder = (NSKeyedUnarchiver *)coder; if ([NSClassSwapper isInInterfaceBuilder] == YES) { newClass = [decoder replacementClassForClassName: _originalClassName]; } else { newClass = [decoder replacementClassForClassName: className]; } // swap the class... object = [newClass allocWithZone: NSDefaultMallocZone()]; [decoder setDelegate: self]; // set the delegate... [decoder replaceObject: self withObject: object]; [self setTemplate: [object initWithCoder: decoder]]; if (object != _template) { [decoder replaceObject: object withObject: _template]; } [decoder setDelegate: nil]; // unset the delegate... } /** * This delegate method makes the proper substitution for cellClass * when the object needs to have it's own cell. An example of this * is NSSecureTextField/NSSecureTextFieldCell. */ - (id) unarchiver: (NSKeyedUnarchiver *)coder didDecodeObject: (id)obj { Class newClass = nil; id result = obj; // if we are in an interface builder, then return the original object. if ([NSClassSwapper isInInterfaceBuilder] == YES) { newClass = [coder replacementClassForClassName: _originalClassName]; } else { newClass = [coder replacementClassForClassName: _className]; } // if this is a class which uses cells, override with the new cellClass, if the // subclass responds to cellClass. if ([obj isKindOfClass: [NSCell class]] && [newClass respondsToSelector: @selector(cellClass)] && [_className isEqualToString: _originalClassName] == NO) { Class newCellClass = [newClass cellClass]; if (newCellClass != [NSCell class]) { RELEASE(obj); result = [[newCellClass alloc] initWithCoder: coder]; } } return result; } /** * Decode NSClassSwapper. */ - (id) initWithCoder: (NSCoder *)coder { if ([coder allowsKeyedCoding]) { ASSIGN(_className, [coder decodeObjectForKey: @"NSClassName"]); ASSIGN(_originalClassName, [coder decodeObjectForKey: @"NSOriginalClassName"]); // build the real object... if ([NSClassSwapper isInInterfaceBuilder] == YES) { [self instantiateRealObject: coder withClassName: _originalClassName]; } else { [self instantiateRealObject: coder withClassName: _className]; } { id object; object = RETAIN(_template); RELEASE(self); return AUTORELEASE(object); } } else { [NSException raise: NSInvalidArgumentException format: @"Can't decode %@ with %@.",NSStringFromClass([self class]), NSStringFromClass([coder class])]; } return self; } /** * Encode NSClassSwapper. */ - (void) encodeWithCoder: (NSCoder *)coder { if ([coder allowsKeyedCoding]) { [coder encodeObject: _originalClassName forKey: @"NSOriginalClassName"]; [coder encodeObject: _className forKey: @"NSClassName"]; [_template encodeWithCoder: coder]; // encode the actual object; } else { [NSException raise: NSInvalidArgumentException format: @"Can't encode %@ with %@.",NSStringFromClass([self class]), NSStringFromClass([coder class])]; } } /** * Deallocate NSClassSwapper instance. */ - (void) dealloc { RELEASE(_className); RELEASE(_originalClassName); RELEASE(_template); [super dealloc]; } @end @implementation NSNibConnector (NibCompatibility) /** * This method causes the connection to instantiate the objects in it's source * and destination. The instantiator is the object which holds any custom * class information which might be needed to do the proprer substitution of * objects based on the contents of the maps. */ - (void) instantiateWithInstantiator: (id)instantiator { [self setSource: [instantiator instantiateObject: _src]]; [self setDestination: [instantiator instantiateObject: _dst]]; } - (id) nibInstantiate { if ([_src respondsToSelector: @selector(nibInstantiate)]) { [self setSource: [_src nibInstantiate]]; } if ([_dst respondsToSelector: @selector(nibInstantiate)]) { [self setDestination: [_dst nibInstantiate]]; } return self; } @end @implementation NSNibControlConnector (NibCompatibility) /** * This method overrides the default implementation of instantiate with * instantiator. It also corrects a common issue in some nib files * by adding a colon to the end if none was given. It then calls the * superclass with the corrected label. */ - (void) instantiateWithInstantiator: (id)instantiator { NSRange colonRange = [_tag rangeOfString: @":"]; NSUInteger location = colonRange.location; if (location == NSNotFound) { NSString *newTag = [NSString stringWithFormat: @"%@:",_tag]; [self setLabel: (id)newTag]; } [super instantiateWithInstantiator: instantiator]; } @end /** * NSIBObjectData * * This class is the container for all of the nib data. It contains several maps. * The maps are the following: * * name -> object (name table) * object -> name (name table reverse lookup) * classes -> object (for custom class storage) * oids -> object (for relating the oid to each object) * accessibilityOids -> object * * The maps are stored in the nib itself as a set of synchronized * arrays one array containing the keys and the other the values. This is why, in the * initWithCoder: and encodeWithCoder: methods they are saved as arrays and then * loaded into NSMapTables. */ @implementation NSIBObjectData /** * Get the values from the map in the same order as the keys. */ - (NSArray *) _valuesForKeys: (NSArray *)keys inMap: (NSMapTable *)map { NSMutableArray *result = [NSMutableArray array]; NSEnumerator *en = [keys objectEnumerator]; id key = nil; while ((key = [en nextObject]) != nil) { id value = (id)NSMapGet(map,key); [result addObject: value]; } return result; } /** * Build a map with two arrays of keys and values. */ - (void) _buildMap: (NSMapTable *)mapTable withKeys: (NSArray *)keys andValues: (NSArray *)values { NSEnumerator *ken = [keys objectEnumerator]; NSEnumerator *ven = [values objectEnumerator]; id key = nil; id value = nil; while ((key = [ken nextObject]) != nil && (value = [ven nextObject]) != nil) { NSMapInsert(mapTable, key, value); if (value == nil) { NSLog(@"==> WARNING: Value for key %@ is %@",key , value); } } } /** * Encode the NSIBObjectData container */ - (void) encodeWithCoder: (NSCoder *)coder { if ([coder allowsKeyedCoding]) { NSArray *accessibilityOidsKeys = (NSArray *)NSAllMapTableKeys(_accessibilityOids); NSArray *accessibilityOidsValues = [self _valuesForKeys: accessibilityOidsKeys inMap: _accessibilityOids]; NSArray *classKeys = (NSArray *)NSAllMapTableKeys(_classes); NSArray *classValues = [self _valuesForKeys: classKeys inMap: _classes]; NSArray *nameKeys = (NSArray *)NSAllMapTableKeys(_names); NSArray *nameValues = [self _valuesForKeys: nameKeys inMap: _names]; NSArray *objectsKeys = (NSArray *)NSAllMapTableKeys(_objects); NSArray *objectsValues = [self _valuesForKeys: objectsKeys inMap: _objects]; NSArray *oidsKeys = (NSArray *)NSAllMapTableKeys(_oids); NSArray *oidsValues = [self _valuesForKeys: oidsKeys inMap: _oids]; [(NSKeyedArchiver *)coder setClassName: @"_NSCornerView" forClass: NSClassFromString(@"GSTableCornerView")]; [coder encodeObject: (id)_accessibilityConnectors forKey: @"NSAccessibilityConnectors"]; [coder encodeObject: (id) accessibilityOidsKeys forKey: @"NSAccessibilityOidsKeys"]; [coder encodeObject: (id) accessibilityOidsValues forKey: @"NSAccessibilityOidsValues"]; [coder encodeObject: (id) classKeys forKey: @"NSClassesKeys"]; [coder encodeObject: (id) classValues forKey: @"NSClassesValues"]; [coder encodeObject: (id) nameKeys forKey: @"NSNamesKeys"]; [coder encodeObject: (id) nameValues forKey: @"NSNamesValues"]; [coder encodeObject: (id) objectsKeys forKey: @"NSObjectsKeys"]; [coder encodeObject: (id) objectsValues forKey: @"NSObjectsValues"]; [coder encodeObject: (id) oidsKeys forKey: @"NSOidsKeys"]; [coder encodeObject: (id) oidsValues forKey: @"NSOidsValues"]; [coder encodeObject: (id) _connections forKey: @"NSConnections"]; [coder encodeObject: (id) _fontManager forKey: @"NSFontManager"]; [coder encodeObject: (id) _framework forKey: @"NSFramework"]; [coder encodeObject: (id) _visibleWindows forKey: @"NSVisibleWindows"]; [coder encodeInt: _nextOid forKey: @"NSNextOid"]; [coder encodeConditionalObject: (id) _root forKey: @"NSRoot"]; } else { [NSException raise: NSInvalidArgumentException format: @"Can't encode %@ with %@.",NSStringFromClass([self class]), NSStringFromClass([coder class])]; } } /** * Decode the NSIBObjectData container. */ - (id) initWithCoder: (NSCoder *)coder { if ([coder allowsKeyedCoding]) { NSArray *nameKeys = nil; NSArray *nameValues = nil; NSArray *classKeys = nil; NSArray *classValues = nil; NSArray *objectsKeys = nil; NSArray *objectsValues = nil; NSArray *oidsKeys = nil; NSArray *oidsValues = nil; NSArray *accessibilityOidsKeys = nil; NSArray *accessibilityOidsValues = nil; [(NSKeyedUnarchiver *)coder setClass: NSClassFromString(@"GSTableCornerView") forClassName: @"_NSCornerView"]; // // Get root, font, framwork and oid. // Retain objects since NSKeyedUnarchiver autoreleases unarchived objects. // ASSIGN(_root, [coder decodeObjectForKey: @"NSRoot"]); ASSIGN(_fontManager, [coder decodeObjectForKey: @"NSFontManager"]); ASSIGN(_framework, [coder decodeObjectForKey: @"NSFramework"]); _nextOid = [coder decodeIntForKey: @"NSNextOid"]; // get connections. ASSIGN(_connections, (NSMutableArray *) [coder decodeObjectForKey: @"NSConnections"]); ASSIGN(_accessibilityConnectors, (NSMutableArray *) [coder decodeObjectForKey: @"NSAccessibilityConnectors"]); // get visible windows ASSIGN(_visibleWindows, (NSMutableArray *) [coder decodeObjectForKey: @"NSVisibleWindows"]); // instantiate the maps.. _classes = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 2); _names = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 2); _objects = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 2); _oids = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 2); // // Get the maps. There is no need to retain these, // since they are going to be placed into the NSMapTable // structures anyway. // nameKeys = (NSArray *) [coder decodeObjectForKey: @"NSNamesKeys"]; nameValues = (NSArray *) [coder decodeObjectForKey: @"NSNamesValues"]; classKeys = (NSArray *) [coder decodeObjectForKey: @"NSClassesKeys"]; classValues = (NSArray *) [coder decodeObjectForKey: @"NSClassesValues"]; objectsKeys = (NSArray *) [coder decodeObjectForKey: @"NSObjectsKeys"]; objectsValues = (NSArray *) [coder decodeObjectForKey: @"NSObjectsValues"]; oidsKeys = (NSArray *) [coder decodeObjectForKey: @"NSOidsKeys"]; oidsValues = (NSArray *) [coder decodeObjectForKey: @"NSOidsValues"]; // Fill in the maps... [self _buildMap: _classes withKeys: classKeys andValues: classValues]; [self _buildMap: _names withKeys: nameKeys andValues: nameValues]; [self _buildMap: _objects withKeys: objectsKeys andValues: objectsValues]; [self _buildMap: _oids withKeys: oidsKeys andValues: oidsValues]; // // Only get these maps when in the editor. They // aren't useful outside of it and only waste memory if // unarchived in the live application. // if ([NSClassSwapper isInInterfaceBuilder]) { // Only get these when in the editor... accessibilityOidsKeys = (NSArray *) [coder decodeObjectForKey: @"NSAccessibilityOidsKeys"]; accessibilityOidsValues = (NSArray *) [coder decodeObjectForKey: @"NSAccessibilityOidsValues"]; _accessibilityOids = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 2); [self _buildMap: _accessibilityOids withKeys: accessibilityOidsKeys andValues: accessibilityOidsValues]; } // instantiate... _topLevelObjects = [[NSMutableSet alloc] init]; } else { [NSException raise: NSInvalidArgumentException format: @"Can't decode %@ with %@.",NSStringFromClass([self class]), NSStringFromClass([coder class])]; } return self; } /** * Initialize a new NSIBObjectData. */ - (id) init { if ((self = [super init]) != nil) { // instantiate the maps.. _objects = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 2); _names = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 2); _oids = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 2); _classes = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 2); _accessibilityOids = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 2); // initialize the objects... _accessibilityConnectors = [[NSMutableArray alloc] init]; _connections = [[NSMutableArray alloc] init]; _visibleWindows = [[NSMutableArray alloc] init]; _framework = nil; _fontManager = nil; _root = nil; _nextOid = 0; } return self; } /** * Deallocate NSIBObjectData. */ - (void) dealloc { // free the maps. NSFreeMapTable(_objects); NSFreeMapTable(_names); NSFreeMapTable(_classes); NSFreeMapTable(_oids); // these are not allocated when not in interface builder. if ([NSClassSwapper isInInterfaceBuilder]) { NSFreeMapTable(_accessibilityOids); } // free other objects. RELEASE(_accessibilityConnectors); RELEASE(_connections); RELEASE(_fontManager); RELEASE(_framework); RELEASE(_visibleWindows); RELEASE(_root); RELEASE(_topLevelObjects); [super dealloc]; } /** * Call nibInstantiate on an object, if it responds to the nibInstantiate selector. */ - (id)instantiateObject: (id)obj { id newObject = obj; if ([obj respondsToSelector: @selector(nibInstantiate)]) { newObject = [obj nibInstantiate]; } return newObject; } /** * Instantiate all of the objects in the nib file. */ - (void) nibInstantiateWithOwner: (id)owner topLevelObjects: (NSMutableArray *)topLevelObjects { NSEnumerator *en; NSArray *objs; id obj = nil; id menu = nil; // set the new root object. [_root setRealObject: owner]; // iterate over all objects, instantiate them and fill in top level array. /* Note: We instantiate all objects before establishing any connections between them, so that any shared instances defined in the nib are initialized before being used. This sequence is important when, e.g., the nib defines a shared document controller that is an instance of a subclass of NSDocumentController. */ objs = NSAllMapTableKeys(_objects); en = [objs objectEnumerator]; while ((obj = [en nextObject]) != nil) { id v = NSMapGet(_objects, obj); NSInteger oid = [(id)NSMapGet(_oids, obj) intValue]; obj = [self instantiateObject: obj]; // Object is top level if it isn't the owner but points to it. /* Don't record proxy objects in the top level array. The only reliable way to identify proxy objects seems to look at their object ID. Apparently, Apple is using fixed negative IDs for proxy objects (-1 = File's Owner, -2 = First Responder, -3 = NSApplication). */ if (oid >= 0) { if ((v == owner || v == _root) && (obj != owner) && (obj != _root)) { [topLevelObjects addObject: obj]; // All top level objects must be released by the caller to avoid // leaking, unless they are going to be released by other nib // objects on behalf of the owner. RETAIN(obj); } } } // iterate over connections, instantiate and then establish them. en = [_connections objectEnumerator]; while ((obj = [en nextObject]) != nil) { if ([obj respondsToSelector: @selector(instantiateWithInstantiator:)]) { [obj instantiateWithInstantiator: self]; [obj establishConnection]; } } // awaken all objects except proxy objects. objs = NSAllMapTableKeys(_objects); en = [objs objectEnumerator]; while ((obj = [en nextObject]) != nil) { NSInteger oid = [(id)NSMapGet(_oids, obj) intValue]; if (oid >= 0) { if ([obj respondsToSelector: @selector(realObject)]) { obj = [obj realObject]; } if ([obj respondsToSelector: @selector(awakeFromNib)]) { [obj awakeFromNib]; } } } // awaken the owner if ([owner respondsToSelector: @selector(awakeFromNib)]) { [owner awakeFromNib]; } // bring visible windows to front... en = [_visibleWindows objectEnumerator]; while ((obj = [en nextObject]) != nil) { id w = [obj realObject]; [w orderFront: self]; } // add the menu... menu = [self objectForName: @"MainMenu"]; if (menu != nil) { menu = [self instantiateObject: menu]; [NSApp _setMainMenu: menu]; } } /** * Awake after loading the nib and extract the top level and owner for nib instantiation, * then call nibInstantateWithOwner:topLevelObjects: */ - (void) awakeWithContext: (NSDictionary *)context { NSMutableArray *tlo = [context objectForKey: NSNibTopLevelObjects]; id owner = [context objectForKey: NSNibOwner]; // instantiate... [self nibInstantiateWithOwner: owner topLevelObjects: tlo]; } /** * Retrieve an object by name from the map. */ - (id) objectForName: (NSString *)name { NSArray *nameKeys = (NSArray *)NSAllMapTableKeys(_names); NSArray *nameValues = (NSArray *)NSAllMapTableValues(_names); NSUInteger i = [nameValues indexOfObject: name]; id result = nil; if (i != NSNotFound) { result = [nameKeys objectAtIndex: i]; } return result; } /** * Get the name for an object. */ - (NSString *) nameForObject: (id)obj { NSArray *nameKeys = (NSArray *)NSAllMapTableKeys(_names); NSArray *nameValues = (NSArray *)NSAllMapTableValues(_names); int i = [nameKeys indexOfObject: obj]; NSString *result = [nameValues objectAtIndex: i]; return result; } /** * Set the root object. */ - (void) setRoot: (id) root { ASSIGN(_root, root); } /** * Return the root object. */ - (id) root { return _root; } /** * Set the value of the next available oid. */ - (void) setNextOid: (int)noid { _nextOid = noid; } /** * Get the value of the next available oid. */ - (int) nextOid { return _nextOid; } /** * Connections between objects. */ - (NSMutableArray *) connections { return _connections; } /** * Set of top level objects. */ - (NSMutableSet *) topLevelObjects { return _topLevelObjects; } /** * Names to objects */ - (NSMutableDictionary *) nameTable { return nil; } /** * Set of all visible windows. */ - (NSMutableArray *) visibleWindows { return _visibleWindows; } /** * Objects to names table. */ - (NSMapTable *) objects { return _objects; } /** * Names to objects table. */ - (NSMapTable *) names { return _names; } /** * Classes to objects table. */ - (NSMapTable *) classes { return _classes; } /** * Oids to objects table. */ - (NSMapTable *) oids { return _oids; } @end /** * NSButtonImageSource * * This class is used by buttons to pull the correct image based on a given state. */ @implementation NSButtonImageSource - (id) initWithCoder: (NSCoder *)coder { if ([coder allowsKeyedCoding]) { ASSIGN(imageName, [coder decodeObjectForKey: @"NSImageName"]); } else { [NSException raise: NSInvalidArgumentException format: @"Can't decode %@ with %@.",NSStringFromClass([self class]), NSStringFromClass([coder class])]; } AUTORELEASE(self); return RETAIN([NSImage imageNamed: imageName]); } - (void) encodeWithCoder: (NSCoder *)coder { if ([coder allowsKeyedCoding]) { [coder encodeObject: imageName forKey: @"NSImageName"]; } else { [NSException raise: NSInvalidArgumentException format: @"Can't encode %@ with %@.",NSStringFromClass([self class]), NSStringFromClass([coder class])]; } } /** * Initializes with image name. */ - (id) initWithImageNamed: (NSString *)name { if ((self = [super init]) != nil) { ASSIGN(imageName,name); } return self; } /** * Returns imageName. */ - (NSString *)imageName { return imageName; } - (void) dealloc { RELEASE(imageName); [super dealloc]; } @end @implementation NSIBHelpConnector - (id) init { if ((self = [super init]) != nil) { _file = nil; ASSIGN(_marker, @"NSToolTipHelpKey"); } return self; } - (void) dealloc { RELEASE(_file); RELEASE(_marker); [super dealloc]; } - (id) initWithCoder: (NSCoder *)coder { if ((self = [super initWithCoder: coder]) != nil) { if ([coder allowsKeyedCoding]) { if ([coder containsValueForKey: @"NSFile"]) { ASSIGN(_file, [coder decodeObjectForKey: @"NSFile"]); } if ([coder containsValueForKey: @"NSMarker"]) { ASSIGN(_marker, [coder decodeObjectForKey: @"NSMarker"]); } } else { ASSIGN(_file, [coder decodeObject]); ASSIGN(_marker, [coder decodeObject]); } } return self; } - (void) encodeWithCoder: (NSCoder *)coder { [super encodeWithCoder: coder]; if ([coder allowsKeyedCoding]) { if (_file != nil) { [coder encodeObject: _file forKey: @"NSFile"]; } if (_marker != nil) { [coder encodeObject: _file forKey: @"NSMarker"]; } } else { [coder encodeObject: _file]; [coder encodeObject: _marker]; } } - (void) establishConnection { if ([_dst respondsToSelector: @selector(setToolTip:)]) { [_dst setToolTip: _marker]; } } - (void) setFile: (id)file { ASSIGN(_file, file); } - (id) file { return _file; } - (void) setMarker: (id)marker { ASSIGN(_marker, marker); } - (id) marker { return _marker; } @end @implementation NSDecimalNumberPlaceholder - (id) initWithCoder: (NSCoder *)coder { NSDecimalNumber *dn = nil; if ([coder allowsKeyedCoding]) { NSUInteger len = 0; short exponent = (short)[coder decodeIntForKey: @"NS.exponent"]; NSByteOrder bo = [coder decodeIntForKey: @"NS.mantissa.bo"]; BOOL negative = [coder decodeBoolForKey: @"NS.negative"]; void *mantissaBytes = (void *)[coder decodeBytesForKey: @"NS.mantissa" returnedLength: &len]; unsigned long long unswapped = 0; unsigned long long mantissa = 0; // BOOL compact = [coder decodeBoolForKey: @"NS.compact"]; // int length = [coder decodeIntForKey: @"NS.length"]; memcpy((void *)&unswapped, (void *)mantissaBytes, sizeof(unsigned long long)); switch(bo) { case NS_BigEndian: mantissa = NSSwapBigLongLongToHost(unswapped); break; case NS_LittleEndian: mantissa = NSSwapLittleLongLongToHost(unswapped); break; default: break; } dn = [[NSDecimalNumber alloc] initWithMantissa: mantissa exponent: exponent isNegative: negative]; } RELEASE(self); return (id)dn; } @end /** * NSCornerView * * Overridden in NSTableView to be GSTableCornerView, * but the class needs to be present to be overridden. * * Currently this is a place-holder class. */ @implementation _NSCornerView @end /** * NSPSMatrix. * * This class is needed for nib encoding/decoding by transforms. * Currently it's only referenced in the NSProgressIndicator, * as far as I can tell. * * Place holder class. */ @implementation NSPSMatrix - (void) encodeWithCoder: (NSCoder *)coder { // do nothing... just encoding the presence of the class. } - (id) initWithCoder: (NSCoder *)coder { return self; } @end gnustep-gui-0.24.0/Source/NSAnimation.m0000664000076500007650000012410712216021543017541 0ustar brains99brains99/* NSAnimation.m Created by Dr. H. Nikolaus Schaller on Sat Mar 06 2006. Copyright (c) 2007 Free Software Foundation, Inc. Author: Xavier Glattard (xgl) This file used to be part of the mySTEP Library. This file now 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import #import #import #import #import "AppKit/NSAnimation.h" #import "AppKit/NSApplication.h" // needed by NSViewAnimation #import "AppKit/NSView.h" #import "AppKit/NSWindow.h" #include NSString* NSAnimationBlockingRunLoopMode = @"NSAnimationBlockingRunLoopMode"; /*===================* * NSAnimation class * *===================*/ #define GSI_ARRAY_NO_RETAIN #define GSI_ARRAY_NO_RELEASE #define GSIArrayItem NSAnimationProgress #include // 'reasonable value' ? #define GS_ANIMATION_DEFAULT_FRAME_RATE 25.0 static NSArray* _NSAnimationDefaultRunLoopModes; static inline void _GSBezierComputeCoefficients(_GSBezierDesc *b) { b->a[0] = b->p[0]; b->a[1] =-3.0*b->p[0] + 3.0*b->p[1]; b->a[2] = 3.0*b->p[0] - 6.0*b->p[1] + 3.0*b->p[2]; b->a[3] =- b->p[0] + 3.0*b->p[1] - 3.0*b->p[2] + b->p[3]; b->areCoefficientsComputed = YES; } static inline float _GSBezierEval(_GSBezierDesc *b, float t) { if (!b->areCoefficientsComputed) _GSBezierComputeCoefficients(b); return b->a[0] + t * (b->a[1] + t * (b->a[2] + t * b->a[3])); } static inline float _GSBezierDerivEval(_GSBezierDesc *b, float t) { if (!b->areCoefficientsComputed) _GSBezierComputeCoefficients(b); return b->a[1] + t * (2.0 * b->a[2] + t * 3.0 * b->a[3]); } static inline void _GSRationalBezierComputeBezierDesc(_GSRationalBezierDesc *rb) { unsigned i; for (i = 0; i < 4; i++) rb->n.p[i] = (rb->d.p[i] = rb->w[i]) * rb->p[i]; _GSBezierComputeCoefficients(&rb->n); _GSBezierComputeCoefficients(&rb->d); rb->areBezierDescComputed = YES; } static inline float _GSRationalBezierEval(_GSRationalBezierDesc *rb, float t) { if (!rb->areBezierDescComputed) _GSRationalBezierComputeBezierDesc(rb); return _GSBezierEval(&(rb->n), t) / _GSBezierEval(&(rb->d), t); } static inline float _GSRationalBezierDerivEval(_GSRationalBezierDesc *rb, float t) { float h; if (!rb->areBezierDescComputed) _GSRationalBezierComputeBezierDesc(rb); h = _GSBezierEval(&(rb->d), t); return (_GSBezierDerivEval(&(rb->n), t) * h - _GSBezierEval (&(rb->n), t) * _GSBezierDerivEval(&(rb->d), t)) / (h*h); } static _NSAnimationCurveDesc _gs_animationCurveDesc[] = { // easeInOut : endGrad = startGrad & startGrad <= 1/3 { 0.0,1.0, 1.0/3,1.0/3 , {{2.0,2.0/3,2.0/3,2.0}} }, // easeIn : endGrad = 1/startGrad & startGrad >= 1/6 { 0.0,1.0, 0.25,4.0 , {{4.0,3.0,2.0,1.0}} }, // easeOut : endGrad = 1/startGrad & startGrad <= 6 { 0.0,1.0, 4.0 ,0.25, {{1.0,2.0,3.0,4.0}} }, // linear (not used) { 0.0,1.0, 1.0 ,1.0 , {{1.0,1.0,1.0,1.0}} }, // speedInOut: endGrad = startGrad & startGrad >=3 { 0.0,1.0, 3.0 ,3.0 , {{2.0/3,2.0,2.0,2.0/3}} } }; /* Translate the NSAnimationCurveDesc data (start/end points and start/end * gradients) to GSRBezier data (4 control points), then evaluate it. */ static inline float _gs_animationValueForCurve(_NSAnimationCurveDesc *c, float t, float t0) { if (!c->isRBezierComputed) { c->rb.p[0] = c->s; c->rb.p[1] = c->s + (c->sg*c->rb.w[0]) / (3*c->rb.w[1]); c->rb.p[2] = c->e - (c->eg*c->rb.w[3]) / (3*c->rb.w[2]); c->rb.p[3] = c->e; _GSRationalBezierComputeBezierDesc (&c->rb); c->isRBezierComputed = YES; } return _GSRationalBezierEval ( &(c->rb), (t-t0) / (1.0-t0) ); } @interface NSAnimation (PrivateNotificationCallbacks) - (void) _gs_startAnimationReachesProgressMark: (NSNotification*)notification; - (void) _gs_stopAnimationReachesProgressMark: (NSNotification*)notification; @end @interface NSAnimation (Private) - (void) _gs_didReachProgressMark: (NSAnimationProgress)progress; - (void) _gs_startAnimationInOwnLoop; - (void) _gs_startThreadedAnimation; - (_NSAnimationCurveDesc*) _gs_curveDesc; - (NSAnimationProgress) _gs_curveShift; @end NSComparisonResult nsanimation_progressMarkSorter(NSAnimationProgress first, NSAnimationProgress second) { float diff = first - second; return (NSComparisonResult)(diff / fabs(diff)); } /* Thread locking/unlocking support macros. * _isThreaded flag is an ivar that records whether the * NSAnimation is running in thread mode. * __gs_isLocked flag is local to each method and records * whether the thread is locked and must be locked before * the method exits. * Both are needed because _isThreaded is reset when the * NSAnimation stops : that may happen at any time between * a lock/unlock pair. */ #define _NSANIMATION_LOCKING_SETUP \ BOOL __gs_isLocked = NO; #define _NSANIMATION_LOCK \ if (_isThreaded) \ { \ NSAssert(__gs_isLocked == NO, NSInternalInconsistencyException); \ NSDebugMLLog(@"NSAnimationLock",\ @"LOCK %@", [NSThread currentThread]);\ [_isAnimatingLock lock]; \ __gs_isLocked = YES; \ } #define _NSANIMATION_UNLOCK \ if (__gs_isLocked) \ { \ /* NSAssert(__gs_isLocked == YES, NSInternalInconsistencyException); */ \ NSDebugMLLog(@"NSAnimationLock",\ @"UNLOCK %@", [NSThread currentThread]);\ __gs_isLocked = NO; \ [_isAnimatingLock unlock]; \ } @implementation NSAnimation + (void) initialize { unsigned i; for (i = 0; i < 5; i++) // compute Bezier curve parameters... _gs_animationValueForCurve(&_gs_animationCurveDesc[i], 0.0, 0.0); _NSAnimationDefaultRunLoopModes = [[NSArray alloc] initWithObjects: NSDefaultRunLoopMode, NSModalPanelRunLoopMode, NSEventTrackingRunLoopMode, nil]; } - (void) addProgressMark: (NSAnimationProgress)progress { _NSANIMATION_LOCKING_SETUP; if (progress < 0.0) progress = 0.0; if (progress > 1.0) progress = 1.0; _NSANIMATION_LOCK; if (GSIArrayCount(_progressMarks) == 0) { // First mark GSIArrayAddItem (_progressMarks,progress); NSDebugMLLog (@"NSAnimationMark", @"Insert 1st mark for %f (next:#%d)", progress, _nextMark); _nextMark = (progress >= [self currentProgress])? 0 : 1; } else { unsigned index; index = GSIArrayInsertionPosition (_progressMarks, progress, &nsanimation_progressMarkSorter); if (_nextMark < GSIArrayCount(_progressMarks)) if (index <= _nextMark && progress < GSIArrayItemAtIndex(_progressMarks,_nextMark)) _nextMark++; GSIArrayInsertItem (_progressMarks,progress,index); NSDebugMLLog (@"NSAnimationMark", @"Insert mark #%d/%d for %f (next:#%d)", index,GSIArrayCount(_progressMarks),progress,_nextMark); } _isCachedProgressMarkNumbersValid = NO; _NSANIMATION_UNLOCK; } - (NSAnimationBlockingMode) animationBlockingMode { NSAnimationBlockingMode m; _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; m = _blockingMode; _NSANIMATION_UNLOCK; return m; } - (NSAnimationCurve) animationCurve { NSAnimationCurve c; _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; c = _curve; _NSANIMATION_UNLOCK; return c; } - (void) clearStartAnimation { _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; [[NSNotificationCenter defaultCenter] removeObserver: self name: NSAnimationProgressMarkNotification object: _startAnimation]; [_startAnimation removeProgressMark: _startMark]; _startAnimation = nil; _NSANIMATION_UNLOCK; } - (void) clearStopAnimation { _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; [[NSNotificationCenter defaultCenter] removeObserver: self name: NSAnimationProgressMarkNotification object: _stopAnimation]; [_stopAnimation removeProgressMark: _stopMark]; _stopAnimation = nil; _NSANIMATION_UNLOCK; } - (NSAnimationProgress) currentProgress { NSAnimationProgress p; _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; p = _currentProgress; _NSANIMATION_UNLOCK; return p; } - (float) currentValue { float value; _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; if (_delegate_animationValueForProgress) { // method is cached (the animation is running) NSDebugMLLog (@"NSAnimationDelegate", @"[delegate animationValueForProgress] (cached)"); value = (*_delegate_animationValueForProgress) (GS_GC_UNHIDE (_currentDelegate), @selector (animation:valueForProgress:), self, _currentProgress); } else // method is not cached (the animation did not start yet) if ( _delegate != nil && [GS_GC_UNHIDE (_delegate) respondsToSelector: @selector (animation:valueForProgress:)] ) { NSDebugMLLog (@"NSAnimationDelegate", @"[delegate animationValueForProgress]"); value = [GS_GC_UNHIDE (_delegate) animation: self valueForProgress: _currentProgress]; } else // default -- FIXME ?? /* switch (_curve) { case NSAnimationEaseInOut: case NSAnimationEaseIn: case NSAnimationEaseOut: case NSAnimationSpeedInOut:*/ value = _gs_animationValueForCurve ( &_curveDesc, _currentProgress, _curveProgressShift ); /* break; case NSAnimationLinear: value = _currentProgress; break; }*/ _NSANIMATION_UNLOCK; return value; } - (id) delegate { id d; _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; d = (_delegate == nil)? nil : GS_GC_UNHIDE (_delegate); _NSANIMATION_UNLOCK; return d; } - (NSTimeInterval) duration { NSTimeInterval d; _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; d = _duration; _NSANIMATION_UNLOCK; return d; } - (float) frameRate { float f; _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; f = _frameRate; _NSANIMATION_UNLOCK; return f; } - (id) initWithDuration: (NSTimeInterval)duration animationCurve: (NSAnimationCurve)curve { if ((self = [super init])) { if (duration<=0.0) [NSException raise: NSInvalidArgumentException format: @"%@ Duration must be > 0.0 (passed: %f)",self,duration]; _duration = duration; _frameRate = GS_ANIMATION_DEFAULT_FRAME_RATE; _curve = curve; _curveDesc = _gs_animationCurveDesc[_curve]; _curveProgressShift = 0.0; _currentProgress = 0.0; _progressMarks = NSZoneMalloc ([self zone], sizeof(GSIArray_t)); GSIArrayInitWithZoneAndCapacity (_progressMarks, [self zone], 16); _cachedProgressMarkNumbers = NULL; _cachedProgressMarkNumberCount = 0; _isCachedProgressMarkNumbersValid = NO; _nextMark = 0; _startAnimation = _stopAnimation = nil; _startMark = _stopMark = 0.0; _blockingMode = NSAnimationBlocking; _animator = nil; _isANewAnimatorNeeded = YES; _delegate = nil; _delegate_animationDidReachProgressMark = (void (*)(id,SEL,NSAnimation*,NSAnimationProgress)) NULL; _delegate_animationValueForProgress = (float (*)(id,SEL,NSAnimation*,NSAnimationProgress)) NULL; _delegate_animationDidEnd = (void (*)(id,SEL,NSAnimation*)) NULL; _delegate_animationDidStop = (void (*)(id,SEL,NSAnimation*)) NULL; _delegate_animationShouldStart = (BOOL (*)(id,SEL,NSAnimation*)) NULL; _isThreaded = NO; _isAnimatingLock = [GSLazyRecursiveLock new]; } return self; } - (id) copyWithZone: (NSZone*)zone { NSAnimation *c = (NSAnimation*)NSCopyObject (self, 0, zone); c->_progressMarks = GSIArrayCopyWithZone(_progressMarks, zone); c->_animator = nil; c->_isANewAnimatorNeeded = YES; c->_isAnimatingLock = [GSLazyRecursiveLock new]; return c; } - (void) dealloc { [self stopAnimation]; GSIArrayEmpty(_progressMarks); NSZoneFree([self zone], _progressMarks); if (_cachedProgressMarkNumbers != NULL) { unsigned i; for (i = 0; i < _cachedProgressMarkNumberCount; i++) RELEASE(_cachedProgressMarkNumbers[i]); NSZoneFree([self zone], _cachedProgressMarkNumbers); } [self clearStartAnimation]; [self clearStopAnimation]; TEST_RELEASE(_animator); RELEASE(_isAnimatingLock); [super dealloc]; } - (BOOL) isAnimating { BOOL f; _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; f = (_animator != nil) ? [_animator isAnimationRunning] : NO; _NSANIMATION_UNLOCK; return f; } - (NSArray*) progressMarks { NSNumber **cpmn; unsigned count; _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; count = GSIArrayCount(_progressMarks); if (!_isCachedProgressMarkNumbersValid) { unsigned i; if (_cachedProgressMarkNumbers != NULL) { for (i = 0; i < _cachedProgressMarkNumberCount; i++) RELEASE(_cachedProgressMarkNumbers[i]); _cachedProgressMarkNumbers = (NSNumber**)NSZoneRealloc([self zone], _cachedProgressMarkNumbers, count * sizeof(NSNumber*)); } else { _cachedProgressMarkNumbers = (NSNumber**)NSZoneMalloc([self zone], count * sizeof(NSNumber*)); } for (i = 0; i < count; i++) { _cachedProgressMarkNumbers[i] = [NSNumber numberWithFloat: GSIArrayItemAtIndex (_progressMarks,i)]; } _cachedProgressMarkNumberCount = count; _isCachedProgressMarkNumbersValid = YES; } cpmn = _cachedProgressMarkNumbers; _NSANIMATION_UNLOCK; return [NSArray arrayWithObjects: cpmn count: count]; } - (void) removeProgressMark: (NSAnimationProgress)progress { NSUInteger index; _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; index = GSIArraySearch(_progressMarks, progress, nsanimation_progressMarkSorter); if (index < GSIArrayCount(_progressMarks) && progress == GSIArrayItemAtIndex (_progressMarks,index)) { GSIArrayRemoveItemAtIndex(_progressMarks,index); _isCachedProgressMarkNumbersValid = NO; if (_nextMark > index) _nextMark--; NSDebugMLLog(@"NSAnimationMark",@"Remove mark #%lu (%f) for (next:#%d)", (unsigned long)index, progress, _nextMark); } else NSWarnMLog(@"Unexistent progress mark"); _NSANIMATION_UNLOCK; } - (NSArray*) runLoopModesForAnimating { return nil; } - (void) setAnimationBlockingMode: (NSAnimationBlockingMode)mode { _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; _isANewAnimatorNeeded |= (_blockingMode != mode); _blockingMode = mode; _NSANIMATION_UNLOCK; } - (void) setAnimationCurve: (NSAnimationCurve)curve { _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; if (_currentProgress <= 0.0f || _currentProgress >= 1.0f) { _curveDesc = _gs_animationCurveDesc[curve]; } else { // FIXME ?? _GSRationalBezierDesc newrb; _GSRationalBezierDesc *rb1 = &(_curveDesc.rb); float t1 = (_currentProgress - _curveProgressShift) / (1.0 - _curveProgressShift); _GSRationalBezierDesc *rb2 = &(_gs_animationCurveDesc[curve].rb); float t2 = _currentProgress; float K; newrb.p[0] = _GSRationalBezierEval ( rb1, t1 ); newrb.w[0] = _GSBezierEval (&rb1->d,t1 ); newrb.w[1] = rb1->w[1] + t1*( 2*( rb1->w[2] - rb1->w[1] ) + t1*( rb1->w[1] - 2*rb1->w[2] + rb1->w[3] )); newrb.p[1] = ( rb1->w[1]*rb1->p[1] + t1*( 2*( rb1->w[2]*rb1->p[2] - rb1->w[1]*rb1->p[1] ) + t1*( rb1->w[1]*rb1->p[1] - 2*rb1->w[2]*rb1->p[2] + rb1->w[3]*rb1->p[3] )) ) / newrb.w[1]; newrb.w[2] = rb2->w[2] + t2*(rb2->w[3] - rb2->w[2] ); newrb.p[2] = ( rb2->w[2]*rb2->p[2] + t2*(rb2->w[3]*rb2->p[3] - rb2->w[2]*rb2->p[2]) ) / newrb.w[2]; // 3rd point is moved to the right by scaling : w3*p3 = w1*p1 + (w1*p1 - w0*p0) K = ( 2*newrb.w[1]*newrb.p[1]-newrb.w[0]*newrb.p[0] ) / (newrb.w[2]*newrb.p[2]); newrb.p[3] = rb2->p[3]; newrb.w[3] = rb2->w[3] * K; newrb.w[2] = newrb.w[2]* K; _GSRationalBezierComputeBezierDesc (&newrb); #if 0 NSLog (@"prgrss = %f shift = %f",_currentProgress,_curveProgressShift); switch (curve) { case 0:NSLog (@"EaseInOut t=%f - %f",t1,t2);break; case 1:NSLog (@"EaseIn t=%f - %f",t1,t2);break; case 2:NSLog (@"EaseOut t=%f - %f",t1,t2);break; case 3:NSLog (@"Linear t=%f - %f",t1,t2);break; default:NSLog (@"???"); } NSLog (@"a=%f b=%f c=%f d=%f",newrb.p[0],newrb.p[1],newrb.p[2],newrb.p[3]); NSLog (@" %f %f %f %f",newrb.w[0],newrb.w[1],newrb.w[2],newrb.w[3]); #endif _curveProgressShift = _currentProgress; _curveDesc.rb = newrb; _curveDesc.isRBezierComputed = YES; } _curve = curve; _NSANIMATION_UNLOCK; } - (void) setCurrentProgress: (NSAnimationProgress)progress { BOOL needSearchNextMark = NO; NSAnimationProgress markedProgress; _NSANIMATION_LOCKING_SETUP; if (progress < 0.0) progress = 0.0; if (progress > 1.0) progress = 1.0; _NSANIMATION_LOCK; // NOTE: In the case of a forward jump the marks between the // previous progress value and the new (excluded) progress // value are never reached. // In the case of a backward jump (rewind) the marks will // be reached again ! if (_nextMark < GSIArrayCount(_progressMarks)) { markedProgress = GSIArrayItemAtIndex (_progressMarks,_nextMark); if (markedProgress == progress) [self _gs_didReachProgressMark: markedProgress]; else { // the following should never happens if the progress // is reached during the normal run of the animation // (method called from animatorStep) if (markedProgress < progress) // forward jump ? needSearchNextMark = YES; } } needSearchNextMark |= progress < _currentProgress; // rewind ? if (needSearchNextMark) { _nextMark = GSIArrayInsertionPosition (_progressMarks,progress,&nsanimation_progressMarkSorter); if (_nextMark < GSIArrayCount(_progressMarks)) NSDebugMLLog(@"NSAnimationMark",@"Next mark #%d for %f", _nextMark, GSIArrayItemAtIndex(_progressMarks,_nextMark)); } NSDebugMLLog(@"NSAnimation",@"Progress = %f", progress); _currentProgress = progress; if (progress >= 1.0 && _animator != nil) [_animator stopAnimation]; _NSANIMATION_UNLOCK; } - (void) setDelegate: (id)delegate { _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; _delegate = (delegate == nil)? nil : GS_GC_HIDE (delegate); _NSANIMATION_UNLOCK; } - (void) setDuration: (NSTimeInterval)duration { _NSANIMATION_LOCKING_SETUP; if (duration<=0.0) [NSException raise: NSInvalidArgumentException format: @"%@ Duration must be > 0.0 (passed: %f)",self,duration]; _NSANIMATION_LOCK; _duration = duration; _NSANIMATION_UNLOCK; } - (void) setFrameRate: (float)fps { _NSANIMATION_LOCKING_SETUP; if (fps<0.0) [NSException raise: NSInvalidArgumentException format: @"%@ Framerate must be >= 0.0 (passed: %f)",self,fps]; _NSANIMATION_LOCK; _isANewAnimatorNeeded |= (_frameRate != fps); if ( _frameRate != fps && [self isAnimating] ) { // a new animator is needed *now* // FIXME : should I have been smarter ? [self stopAnimation]; [self startAnimation]; } _frameRate = fps; _NSANIMATION_UNLOCK; } - (void) setProgressMarks: (NSArray*)marks { _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; GSIArrayEmpty(_progressMarks); _nextMark = 0; if (marks != nil) { unsigned i, count = [marks count]; for (i = 0; i < count; i++) [self addProgressMark: [(NSNumber*)[marks objectAtIndex:i] floatValue]]; } _isCachedProgressMarkNumbersValid = NO; _NSANIMATION_UNLOCK; } - (void) startAnimation { unsigned i; if ([self isAnimating]) return; NSDebugMLLog(@"NSAnimationStart",@""); for (i = 0; i < GSIArrayCount(_progressMarks); i++) NSDebugMLLog(@"NSAnimationMark", @"Mark #%d : %f", i, GSIArrayItemAtIndex(_progressMarks,i)); if ([self currentProgress] >= 1.0) { [self setCurrentProgress: 0.0]; _nextMark = 0; } _curveDesc = _gs_animationCurveDesc[_curve]; _curveProgressShift = 0.0; if (_delegate != nil) { id delegate; NSDebugMLLog(@"NSAnimationDelegate", @"Cache delegation methods"); // delegation methods are cached while the animation is running delegate = GS_GC_UNHIDE(_delegate); _delegate_animationDidReachProgressMark = ([delegate respondsToSelector: @selector (animation:didReachProgressMark:)]) ? (void (*)(id,SEL,NSAnimation*,NSAnimationProgress)) [delegate methodForSelector: @selector (animation:didReachProgressMark:)] : NULL; _delegate_animationValueForProgress = ([delegate respondsToSelector: @selector (animation:valueForProgress:)]) ? (float (*)(id,SEL,NSAnimation*,NSAnimationProgress)) [delegate methodForSelector: @selector (animation:valueForProgress:)] : NULL; _delegate_animationDidEnd = ([delegate respondsToSelector: @selector (animationDidEnd:)]) ? (void (*)(id,SEL,NSAnimation*)) [delegate methodForSelector: @selector (animationDidEnd:)] : NULL; _delegate_animationDidStop = ([delegate respondsToSelector: @selector (animationDidStop:)]) ? (void (*)(id,SEL,NSAnimation*)) [delegate methodForSelector: @selector (animationDidStop:)] : NULL; _delegate_animationShouldStart = ([delegate respondsToSelector: @selector (animationShouldStart:)]) ? (BOOL (*)(id,SEL,NSAnimation*)) [delegate methodForSelector: @selector (animationShouldStart:)] : NULL; NSDebugMLLog(@"NSAnimationDelegate", @"Delegation methods : %x %x %x %x %x", _delegate_animationDidReachProgressMark, _delegate_animationValueForProgress, _delegate_animationDidEnd, _delegate_animationDidStop, _delegate_animationShouldStart); _currentDelegate = _delegate; } else { NSDebugMLLog(@"NSAnimationDelegate", @" No delegate : clear delegation methods"); _delegate_animationDidReachProgressMark = (void (*)(id,SEL,NSAnimation*,NSAnimationProgress)) NULL; _delegate_animationValueForProgress = (float (*)(id,SEL,NSAnimation*,NSAnimationProgress)) NULL; _delegate_animationDidEnd = (void (*)(id,SEL,NSAnimation*)) NULL; _delegate_animationDidStop = (void (*)(id,SEL,NSAnimation*)) NULL; _delegate_animationShouldStart = (BOOL (*)(id,SEL,NSAnimation*)) NULL; _currentDelegate = nil; } if (_animator == nil || _isANewAnimatorNeeded) { TEST_RELEASE(_animator); _animator = [[GSAnimator allocWithZone: [self zone]] initWithAnimation: self frameRate: _frameRate]; NSAssert(_animator,@"Can not create a GSAnimator"); NSDebugMLLog(@"NSAnimationAnimator", @"New GSAnimator: %@", _animator); _isANewAnimatorNeeded = NO; } switch (_blockingMode) { case NSAnimationBlocking: [self _gs_startAnimationInOwnLoop]; //[_animator setRunLoopModesForAnimating: // [NSArray arrayWithObject: NSAnimationBlockingRunLoopMode]]; //[_animator startAnimation]; break; case NSAnimationNonblocking: { NSArray *runLoopModes; runLoopModes = [self runLoopModesForAnimating]; if (runLoopModes == nil) runLoopModes = _NSAnimationDefaultRunLoopModes; [_animator setRunLoopModesForAnimating: runLoopModes]; } [_animator startAnimation]; break; case NSAnimationNonblockingThreaded: _isThreaded = YES; [NSThread detachNewThreadSelector: @selector (_gs_startThreadedAnimation) toTarget: self withObject: nil]; } } - (void) startWhenAnimation: (NSAnimation*)animation reachesProgress: (NSAnimationProgress)start { _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; _startAnimation = animation; _startMark = start; [_startAnimation addProgressMark: _startMark]; NSDebugMLLog (@"NSAnimationMark",@"register for progress %f", start); [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector (_gs_startAnimationReachesProgressMark:) name: NSAnimationProgressMarkNotification object: _startAnimation]; _NSANIMATION_UNLOCK; } - (void) stopAnimation { _NSANIMATION_LOCKING_SETUP; if ([self isAnimating]) { _NSANIMATION_LOCK; [_animator stopAnimation]; _NSANIMATION_UNLOCK; } } - (void) stopWhenAnimation: (NSAnimation*)animation reachesProgress: (NSAnimationProgress)stop { _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; _stopAnimation = animation; _stopMark = stop; [_stopAnimation addProgressMark: _stopMark]; NSDebugMLLog (@"NSAnimationMark",@"register for progress %f", stop); [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector (_gs_stopAnimationReachesProgressMark:) name: NSAnimationProgressMarkNotification object: _stopAnimation]; _NSANIMATION_UNLOCK; } - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { [aCoder encodeInt: (int)[self animationCurve] forKey: @"NSAnimationAnimationCurve"]; [aCoder encodeDouble: [self duration] forKey: @"NSAnimationDuration"]; } else { [self notImplemented: _cmd]; } } - (id) initWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { NSTimeInterval duration = 1.0; NSAnimationCurve animationCurve = 0; if ([aCoder containsValueForKey: @"NSAnimationAnimationCurve"]) { animationCurve = [aCoder decodeIntForKey: @"NSAnimationAnimationCurve"]; } if ([aCoder containsValueForKey: @"NSAnimationDuration"]) { duration = [aCoder decodeDoubleForKey: @"NSAnimationDuration"]; } return [self initWithDuration: duration animationCurve: animationCurve]; } else { [self notImplemented: _cmd]; } return self; } /* * protocol GSAnimation (callbacks) */ - (void) animatorDidStart { id delegate; _NSANIMATION_LOCKING_SETUP; NSDebugMLLog(@"NSAnimationAnimator",@""); _NSANIMATION_LOCK; delegate = GS_GC_UNHIDE (_currentDelegate); if (_delegate_animationShouldStart) // method is cached (the animation is running) { NSDebugMLLog(@"NSAnimationDelegate",@"[delegate animationShouldStart] (cached)"); _delegate_animationShouldStart (delegate,@selector(animationShouldStart:),self); } RETAIN (self); _NSANIMATION_UNLOCK; } - (void) animatorDidStop { id delegate; _NSANIMATION_LOCKING_SETUP; NSDebugMLLog(@"NSAnimationAnimator",@"Progress = %f", _currentProgress); _NSANIMATION_LOCK; delegate = GS_GC_UNHIDE (_currentDelegate); if (_currentProgress < 1.0) { if (_delegate_animationDidStop) // method is cached (the animation is running) { NSDebugMLLog(@"NSAnimationDelegate",@"[delegate animationDidStop] (cached)"); _delegate_animationDidStop (delegate,@selector(animationDidStop:),self); } } else { if (_delegate_animationDidEnd) // method is cached (the animation is running) { NSDebugMLLog(@"NSAnimationDelegate",@"[delegate animationDidEnd] (cached)"); _delegate_animationDidEnd (delegate,@selector(animationDidEnd:),self); } } RELEASE (self); _NSANIMATION_UNLOCK; } - (void) animatorStep: (NSTimeInterval) elapsedTime; { NSAnimationProgress progress; _NSANIMATION_LOCKING_SETUP; NSDebugMLLog(@"NSAnimationAnimator", @"Elapsed time : %f", elapsedTime); _NSANIMATION_LOCK; progress = (elapsedTime / _duration); { // have some marks been passed ? // NOTE: the case where progress == markedProgress is // treated in [-setCurrentProgress] unsigned count = GSIArrayCount (_progressMarks); NSAnimationProgress markedProgress; while ( _nextMark < count && progress > (markedProgress = GSIArrayItemAtIndex (_progressMarks,_nextMark)) ) // is a mark reached ? { [self _gs_didReachProgressMark: markedProgress]; } } [self setCurrentProgress: progress]; _NSANIMATION_UNLOCK; } @end //implementation NSAnimation @implementation NSAnimation (PrivateNotificationCallbacks) - (void) _gs_startAnimationReachesProgressMark: (NSNotification*)notification { NSAnimation *animation; NSAnimationProgress mark; _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; animation = [notification object]; mark = [[[notification userInfo] objectForKey: NSAnimationProgressMark] floatValue]; NSDebugMLLog(@"NSAnimationMark", @"Start Animation %@ reaches %f", animation, mark); if ( animation == _startAnimation && mark == _startMark) { // [self clearStartAnimation]; [self startAnimation]; } _NSANIMATION_UNLOCK; } - (void) _gs_stopAnimationReachesProgressMark: (NSNotification*)notification { NSAnimation *animation; NSAnimationProgress mark; _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; animation = [notification object]; mark = [[[notification userInfo] objectForKey: NSAnimationProgressMark] floatValue]; NSDebugMLLog(@"NSAnimationMark", @"Stop Animation %@ reaches %f",animation, mark); if ( animation == _stopAnimation && mark == _stopMark) { // [self clearStopAnimation]; [self stopAnimation]; } _NSANIMATION_UNLOCK; } @end // implementation NSAnimation (PrivateNotificationCallbacks) @implementation NSAnimation (Private) - (void) _gs_didReachProgressMark: (NSAnimationProgress) progress { _NSANIMATION_LOCKING_SETUP; NSDebugMLLog(@"NSAnimationMark", @"progress %f", progress); _NSANIMATION_LOCK; // calls delegate's method if (_delegate_animationDidReachProgressMark) // method is cached (the animation is running) { NSDebugMLLog(@"NSAnimationDelegate", @"[delegate animationdidReachProgressMark] (cached)"); _delegate_animationDidReachProgressMark (GS_GC_UNHIDE(_currentDelegate), @selector(animation:didReachProgressMark:), self,progress); } else // method is not cached (the animation did not start yet) if ( _delegate != nil && [GS_GC_UNHIDE (_delegate) respondsToSelector: @selector(animation:didReachProgressMark:)] ) { NSDebugMLLog(@"NSAnimationDelegate", @"[delegate animationdidReachProgressMark]"); [GS_GC_UNHIDE (_delegate) animation: self didReachProgressMark: progress]; } // posts a notification NSDebugMLLog(@"NSAnimationNotification", @"Post NSAnimationProgressMarkNotification : %f", progress); [[NSNotificationCenter defaultCenter] postNotificationName: NSAnimationProgressMarkNotification object: self userInfo: [NSDictionary dictionaryWithObject: [NSNumber numberWithFloat: progress] forKey: NSAnimationProgressMark ] ]; // skips marks with the same progress value while ( (++_nextMark) < GSIArrayCount(_progressMarks) && GSIArrayItemAtIndex(_progressMarks, _nextMark) == progress ) ; _NSANIMATION_UNLOCK; NSDebugMLLog(@"NSAnimationMark", @"Next mark #%d for %f", _nextMark, GSIArrayItemAtIndex(_progressMarks, _nextMark - 1)); } - (void) _gs_startThreadedAnimation { // NSAssert(_isThreaded); CREATE_AUTORELEASE_POOL(pool); NSDebugMLLog(@"NSAnimationThread", @"Start of %@", [NSThread currentThread]); [self _gs_startAnimationInOwnLoop]; NSDebugMLLog(@"NSAnimationThread", @"End of %@", [NSThread currentThread]); [pool drain]; _isThreaded = NO; } - (void) _gs_startAnimationInOwnLoop { NSRunLoop *loop; NSDate *end; [_animator setRunLoopModesForAnimating: [NSArray arrayWithObject: NSAnimationBlockingRunLoopMode]]; [_animator startAnimation]; loop = [NSRunLoop currentRunLoop]; end = [NSDate distantFuture]; for (;;) { if ([loop runMode: NSAnimationBlockingRunLoopMode beforeDate: end] == NO) { NSDate *d; CREATE_AUTORELEASE_POOL(pool); d = [loop limitDateForMode: NSAnimationBlockingRunLoopMode]; if (d == nil) { [pool drain]; break; // No inputs and no timers. } [NSThread sleepUntilDate: d]; [pool drain]; } } } - (_NSAnimationCurveDesc*) _gs_curveDesc { return &self->_curveDesc; } - (NSAnimationProgress) _gs_curveShift { return _curveProgressShift; } @end // implementation NSAnimation (Private) @implementation NSAnimation (GNUstep) - (unsigned int) frameCount { unsigned c; _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; c = (_animator != nil)? [_animator frameCount] : 0; _NSANIMATION_UNLOCK; return c; } - (void) resetCounters { _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; if (_animator != nil) [_animator resetCounters]; _NSANIMATION_UNLOCK; } - (float) actualFrameRate; { float r; _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; r = (_animator != nil)? [_animator frameRate] : 0.0; _NSANIMATION_UNLOCK; return r; } @end /*=======================* * NSViewAnimation class * *=======================*/ @interface _GSViewAnimationBaseDesc : NSObject { id _target; NSRect _startFrame; NSRect _endFrame; NSString* _effect; } - (id) initWithProperties: (NSDictionary*)properties; - (void) setCurrentProgress: (float)progress; - (void) setTargetFrame: (NSRect) frame; @end @interface _GSViewAnimationDesc : _GSViewAnimationBaseDesc { BOOL _shouldHide; BOOL _shouldUnhide; } @end @interface _GSWindowAnimationDesc : _GSViewAnimationBaseDesc { float _startAlpha; } @end @implementation _GSViewAnimationBaseDesc - (id) initWithProperties: (NSDictionary*)properties { if ([self isMemberOfClass: [_GSViewAnimationBaseDesc class]]) { NSZone* zone; id target; zone = [self zone]; RELEASE (self); target = [properties objectForKey: NSViewAnimationTargetKey]; if (target != nil) { if ([target isKindOfClass: [NSView class]]) self = [[_GSViewAnimationDesc allocWithZone: zone] initWithProperties: properties]; else if ([target isKindOfClass: [NSWindow class]]) self = [(_GSWindowAnimationDesc*)[_GSWindowAnimationDesc allocWithZone: zone] initWithProperties: properties]; else [NSException raise: NSInvalidArgumentException format: @"Invalid viewAnimation property :" @"target is neither a NSView nor a NSWindow"]; } else [NSException raise: NSInvalidArgumentException format: @"Invalid viewAnimation property :" @"target is nil"]; } else { // called from a subclass if ((self = [super init])) { NSValue* startValue; NSValue* endValue; _target = [properties objectForKey: NSViewAnimationTargetKey]; startValue = [properties objectForKey: NSViewAnimationStartFrameKey]; endValue = [properties objectForKey: NSViewAnimationEndFrameKey]; _effect = [properties objectForKey: NSViewAnimationEffectKey]; _startFrame = (startValue!=nil) ? [startValue rectValue] : [_target frame]; _endFrame = (endValue!=nil) ? [endValue rectValue] : [_target frame]; } } return self; } - (void) setCurrentProgress: (float)progress { if (progress < 1.0f) { NSRect r; r.origin.x = _startFrame.origin.x + progress*( _endFrame.origin.x - _startFrame.origin.x ); r.origin.y = _startFrame.origin.y + progress*( _endFrame.origin.y - _startFrame.origin.y ); r.size.width = _startFrame.size.width + progress*( _endFrame.size.width - _startFrame.size.width ); r.size.height = _startFrame.size.height + progress*( _endFrame.size.height - _startFrame.size.height ); [self setTargetFrame: r]; if (_effect == NSViewAnimationFadeOutEffect) { [self subclassResponsibility: _cmd]; } if (_effect == NSViewAnimationFadeInEffect) { [self subclassResponsibility: _cmd]; } } else { [self setTargetFrame: _endFrame]; } } - (void) setTargetFrame: (NSRect)frame { [self subclassResponsibility: _cmd]; } @end // implementation _GSViewAnimationDesc @implementation _GSViewAnimationDesc - (id) initWithProperties: (NSDictionary*)properties { if ((self = [super initWithProperties: properties])) { _shouldHide = ([properties objectForKey: NSViewAnimationEndFrameKey] == nil); _shouldUnhide = ( _effect == NSViewAnimationFadeInEffect && [_target isHidden] && !_shouldHide); } return self; } - (void) setCurrentProgress: (float)progress { [super setCurrentProgress: progress]; if (_effect == NSViewAnimationFadeOutEffect) {} /* ??? TODO */; if (_effect == NSViewAnimationFadeInEffect) {} /* ??? TODO */; if (progress>=1.0f) { if (_shouldHide) [_target setHidden:YES]; else if (_shouldUnhide) [_target setHidden:NO]; } } - (void) setTargetFrame: (NSRect)frame { [_target setFrame: frame]; } @end // implementation _GSViewAnimationDesc @implementation _GSWindowAnimationDesc - (id) initWithProperties: (NSDictionary*)properties { if ((self = [super initWithProperties: properties])) { _startAlpha = [_target alphaValue]; } return self; } - (void) setCurrentProgress: (float)progress { [super setCurrentProgress: progress]; if (_effect == NSViewAnimationFadeOutEffect) [_target setAlphaValue: _startAlpha * (1.0f - progress)]; if (_effect == NSViewAnimationFadeInEffect) [_target setAlphaValue: _startAlpha + (1.0f - _startAlpha) * progress]; if (progress >= 1.0f) { if (_effect == NSViewAnimationFadeOutEffect) [_target orderBack: self]; if (_effect == NSViewAnimationFadeInEffect) [_target orderFront: self]; } } - (void) setTargetFrame: (NSRect) frame { [_target setFrame: frame display: YES]; } @end // implementation _GSWindowAnimationDesc @implementation NSViewAnimation - (id) initWithViewAnimations: (NSArray*)animations { self = [self initWithDuration: 0.5 animationCurve: NSAnimationEaseInOut]; if (self) { [self setAnimationBlockingMode: NSAnimationNonblocking]; [self setViewAnimations: animations]; } return self; } - (void) dealloc { DESTROY(_viewAnimations); DESTROY(_viewAnimationDesc); [super dealloc]; } - (void) setViewAnimations: (NSArray*)animations { _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; if (_viewAnimations != animations) DESTROY(_viewAnimationDesc); ASSIGN(_viewAnimations, animations) ; _NSANIMATION_UNLOCK; } - (NSArray*) viewAnimations { NSArray *a; _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; a = _viewAnimations; _NSANIMATION_UNLOCK; return a; } - (void) startAnimation { _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; if (_viewAnimationDesc == nil) { unsigned int i, c; c = [_viewAnimations count]; _viewAnimationDesc = [[NSMutableArray alloc] initWithCapacity: c]; for (i = 0; i < c; i++) { _GSViewAnimationBaseDesc *vabd; vabd = [[_GSViewAnimationBaseDesc alloc] initWithProperties: [_viewAnimations objectAtIndex:i]]; [_viewAnimationDesc addObject: vabd]; RELEASE(vabd); } } [super startAnimation]; _NSANIMATION_UNLOCK; } - (void) stopAnimation { _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; [super stopAnimation]; [self setCurrentProgress: 1.0]; _NSANIMATION_UNLOCK; } - (void) _gs_updateViewsWithValue: (NSNumber*) value { // Runs in main thread : must not call any NSAnimation method to avoid a deadlock unsigned int i, c; float v; v = [value floatValue]; if (_viewAnimationDesc != nil) for (i = 0, c = [_viewAnimationDesc count]; i < c; i++) [[_viewAnimationDesc objectAtIndex: i] setCurrentProgress: v]; } - (void) setCurrentProgress: (NSAnimationProgress)progress { _NSANIMATION_LOCKING_SETUP; _NSANIMATION_LOCK; [super setCurrentProgress: progress]; [self performSelectorOnMainThread: @selector (_gs_updateViewsWithValue:) withObject: [NSNumber numberWithFloat:[self currentValue]] waitUntilDone: YES]; _NSANIMATION_UNLOCK; } @end // implementation NSViewAnimation gnustep-gui-0.24.0/Source/NSImageCell.m0000664000076500007650000002165411711650606017456 0ustar brains99brains99/** NSImageCell The image cell class Copyright (C) 1999, 2005 Free Software Foundation, Inc. Author: Jonathan Gapen Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import #import "AppKit/NSAffineTransform.h" #import "AppKit/NSCell.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSImageCell.h" #import "AppKit/NSImage.h" #import "GNUstepGUI/GSTheme.h" #import "GSGuiPrivate.h" @interface NSCell (Private) - (NSSize) _scaleImageWithSize: (NSSize)imageSize toFitInSize: (NSSize)canvasSize scalingType: (NSImageScaling)scalingType; @end @implementation NSImageCell // // Class methods // + (void) initialize { if (self == [NSImageCell class]) { [self setVersion: 1]; } } // // Instance methods // - (id) init { return [self initImageCell: nil]; } - (void) setImage:(NSImage *)anImage { [super setImage:anImage]; if (anImage) _original_image_size = [anImage size]; else _original_image_size = NSMakeSize(1,1); } - (void)setObjectValue:(id)object { if ((object == nil) || ([object isKindOfClass:[NSImage class]])) { [self setImage: object]; } else { [super setObjectValue: object]; } } // // Aligning and scaling the image // - (NSImageAlignment) imageAlignment { return _imageAlignment; } - (void) setImageAlignment: (NSImageAlignment)anAlignment { NSDebugLLog(@"NSImageCell", @"NSImageCell -setImageAlignment"); _imageAlignment = anAlignment; } - (NSImageScaling) imageScaling { return _imageScaling; } - (void) setImageScaling: (NSImageScaling)scaling { _imageScaling = scaling; } // // Choosing the frame // - (NSImageFrameStyle) imageFrameStyle { return _frameStyle; } - (void) setImageFrameStyle: (NSImageFrameStyle)aFrameStyle { // We could set _cell.is_bordered and _cell.is_bezeled here to // reflect the border type, but this wont be used. _frameStyle = aFrameStyle; } // // Displaying // - (void) _drawBorderAndBackgroundWithFrame: (NSRect)cellFrame inView: (NSView *)controlView { NSDebugLLog(@"NSImageCell", @"NSImageCell -_drawBorderAndBackgroundWithFrame"); [[GSTheme theme] drawBorderForImageFrameStyle: _frameStyle frame: cellFrame view: controlView]; } static inline float xLeftInRect(NSSize innerSize, NSRect outerRect) { return NSMinX(outerRect); } static inline float xCenterInRect(NSSize innerSize, NSRect outerRect) { return MAX(NSMidX(outerRect) - (innerSize.width/2.0), 0.0); } static inline float xRightInRect(NSSize innerSize, NSRect outerRect) { return MAX(NSMaxX(outerRect) - innerSize.width, 0.0); } static inline float yTopInRect(NSSize innerSize, NSRect outerRect, BOOL flipped) { if (flipped) return NSMinY(outerRect); else return MAX(NSMaxY(outerRect) - innerSize.height, 0.0); } static inline float yCenterInRect(NSSize innerSize, NSRect outerRect, BOOL flipped) { return MAX(NSMidY(outerRect) - innerSize.height/2.0, 0.0); } static inline float yBottomInRect(NSSize innerSize, NSRect outerRect, BOOL flipped) { if (flipped) return MAX(NSMaxY(outerRect) - innerSize.height, 0.0); else return NSMinY(outerRect); } - (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView *)controlView { NSPoint position; BOOL is_flipped = [controlView isFlipped]; NSSize imageSize, realImageSize; NSRect rect; NSDebugLLog(@"NSImageCell", @"NSImageCell drawInteriorWithFrame called"); if (!_cell_image) return; // leave room for the frame cellFrame = [self drawingRectForBounds: cellFrame]; realImageSize = [_cell_image size]; imageSize = [self _scaleImageWithSize: realImageSize toFitInSize: cellFrame.size scalingType: _imageScaling]; switch (_imageAlignment) { default: case NSImageAlignLeft: position.x = xLeftInRect(imageSize, cellFrame); position.y = yCenterInRect(imageSize, cellFrame, is_flipped); break; case NSImageAlignRight: position.x = xRightInRect(imageSize, cellFrame); position.y = yCenterInRect(imageSize, cellFrame, is_flipped); break; case NSImageAlignCenter: position.x = xCenterInRect(imageSize, cellFrame); position.y = yCenterInRect(imageSize, cellFrame, is_flipped); break; case NSImageAlignTop: position.x = xCenterInRect(imageSize, cellFrame); position.y = yTopInRect(imageSize, cellFrame, is_flipped); break; case NSImageAlignBottom: position.x = xCenterInRect(imageSize, cellFrame); position.y = yBottomInRect(imageSize, cellFrame, is_flipped); break; case NSImageAlignTopLeft: position.x = xLeftInRect(imageSize, cellFrame); position.y = yTopInRect(imageSize, cellFrame, is_flipped); break; case NSImageAlignTopRight: position.x = xRightInRect(imageSize, cellFrame); position.y = yTopInRect(imageSize, cellFrame, is_flipped); break; case NSImageAlignBottomLeft: position.x = xLeftInRect(imageSize, cellFrame); position.y = yBottomInRect(imageSize, cellFrame, is_flipped); break; case NSImageAlignBottomRight: position.x = xRightInRect(imageSize, cellFrame); position.y = yBottomInRect(imageSize, cellFrame, is_flipped); break; } rect = NSMakeRect(position.x, position.y, imageSize.width, imageSize.height); if (nil != controlView) { rect = [controlView centerScanRect: rect]; } CGFloat fraction = 1.0; if (_frameStyle == NSImageFrameNone && ![self isEnabled]) { fraction = 0.5; } // draw! [_cell_image drawInRect: rect fromRect: NSMakeRect(0, 0, realImageSize.width, realImageSize.height) operation: NSCompositeSourceOver fraction: fraction respectFlipped: YES hints: nil]; } - (NSSize) cellSize { NSSize borderSize, s; // Get border size borderSize = [[GSTheme theme] sizeForImageFrameStyle: _frameStyle]; // Get Content Size s = _original_image_size; // Add in border size s.width += 2 * borderSize.width; s.height += 2 * borderSize.height; return s; } - (NSRect) drawingRectForBounds: (NSRect)theRect { NSSize borderSize; // Get border size borderSize = [[GSTheme theme] sizeForImageFrameStyle: _frameStyle]; return NSInsetRect (theRect, borderSize.width, borderSize.height); } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder *)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { [aCoder encodeInt: _imageAlignment forKey: @"NSAlign"]; [aCoder encodeInt: _imageScaling forKey: @"NSScale"]; [aCoder encodeInt: _frameStyle forKey: @"NSStyle"]; [aCoder encodeBool: NO forKey: @"NSAnimates"]; } else { [aCoder encodeValueOfObjCType: @encode(int) at: &_imageAlignment]; [aCoder encodeValueOfObjCType: @encode(int) at: &_frameStyle]; [aCoder encodeValueOfObjCType: @encode(int) at: &_imageScaling]; [aCoder encodeSize: _original_image_size]; } } - (id) initWithCoder: (NSCoder *)aDecoder { if ((self = [super initWithCoder: aDecoder]) != nil) { if ([aDecoder allowsKeyedCoding]) { if ([aDecoder containsValueForKey: @"NSAlign"]) { [self setImageAlignment: [aDecoder decodeIntForKey: @"NSAlign"]]; } if ([aDecoder containsValueForKey: @"NSScale"]) { [self setImageScaling: [aDecoder decodeIntForKey: @"NSScale"]]; } if ([aDecoder containsValueForKey: @"NSStyle"]) { [self setImageFrameStyle: [aDecoder decodeIntForKey: @"NSStyle"]]; } if ([aDecoder containsValueForKey: @"NSAnimates"]) { //BOOL animates = [aDecoder decodeBoolForKey: @"NSAnimates"]; } } else { [aDecoder decodeValueOfObjCType: @encode(int) at: &_imageAlignment]; [aDecoder decodeValueOfObjCType: @encode(int) at: &_frameStyle]; [aDecoder decodeValueOfObjCType: @encode(int) at: &_imageScaling]; _original_image_size = [aDecoder decodeSize]; } } return self; } @end gnustep-gui-0.24.0/Source/NSSound.m0000664000076500007650000004466311607514004016724 0ustar brains99brains99/** NSSound Load, manipulate and play sounds Copyright (C) 2002, 2009 Free Software Foundation, Inc. Author: Enrico Sersale , Stefan Bidigaray Date: Jul 2002, Jul 2009 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import "AppKit/NSPasteboard.h" #import "AppKit/NSSound.h" #import "GNUstepGUI/GSSoundSource.h" #import "GNUstepGUI/GSSoundSink.h" // Private NSConditionLock conditions used for streaming enum { SOUND_SHOULD_PLAY = 1, SOUND_SHOULD_PAUSE }; #define BUFFER_SIZE 4096 /* Class variables and functions for class methods */ static NSMutableDictionary *nameDict = nil; static NSDictionary *nsmapping = nil; static NSArray *sourcePlugIns = nil; static NSArray *sinkPlugIns = nil; static inline void _loadNSSoundPlugIns (void) { NSString *path; NSArray *paths; NSBundle *bundle; NSEnumerator *enumerator; NSMutableArray *all, *_sourcePlugIns, *_sinkPlugIns; Class plugInClass; /* Gather up the paths */ paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSAllDomainsMask, YES); enumerator = [paths objectEnumerator]; all = [NSMutableArray array]; while ((path = [enumerator nextObject]) != nil) { bundle = [NSBundle bundleWithPath: path]; paths = [bundle pathsForResourcesOfType: @"nssound" inDirectory: @"Bundles"]; [all addObjectsFromArray: paths]; } enumerator = [all objectEnumerator]; _sourcePlugIns = [NSMutableArray array]; _sinkPlugIns = [NSMutableArray array]; while ((path = [enumerator nextObject]) != nil) { NSBundle *nssoundBundle = [NSBundle bundleWithPath: path]; plugInClass = [nssoundBundle principalClass]; if ([plugInClass conformsToProtocol: @protocol(GSSoundSource)]) { [_sourcePlugIns addObject:plugInClass]; } else if ([plugInClass conformsToProtocol: @protocol(GSSoundSink)]) { [_sinkPlugIns addObject:plugInClass]; } else { NSLog (@"Bundle %@ does not conform to GSSoundSource or GSSoundSink", path); } } sourcePlugIns = [[NSArray alloc] initWithArray: _sourcePlugIns]; sinkPlugIns = [[NSArray alloc] initWithArray: _sinkPlugIns]; } @implementation NSBundle (NSSoundAdditions) - (NSString *) pathForSoundResource: (NSString *)name { NSString *ext = [name pathExtension]; NSString *path = nil; if ((ext == nil) || [ext isEqualToString:@""]) { NSArray *types = [NSSound soundUnfilteredFileTypes]; unsigned c = [types count]; unsigned i; for (i = 0; path == nil && i < c; i++) { ext = [types objectAtIndex: i]; path = [self pathForResource: name ofType: ext]; } } else { name = [name stringByDeletingPathExtension]; path = [self pathForResource: name ofType: ext]; } return path; } @end @interface NSSound (PrivateMethods) - (void)_stream; - (void)_finished: (NSNumber *)finishedPlaying; @end @implementation NSSound (PrivateMethods) - (void)_stream { NSUInteger bytesRead; BOOL success = NO; void *buffer; // Exit with success = NO if device could not be open. if ([_sink open]) { // Allocate space for buffer and start writing. buffer = NSZoneMalloc(NSDefaultMallocZone(), BUFFER_SIZE); do { do { // If not SOUND_SHOULD_PLAY block thread [_readLock lockWhenCondition: SOUND_SHOULD_PLAY]; if (_shouldStop) { [_readLock unlock]; break; } bytesRead = [_source readBytes: buffer length: BUFFER_SIZE]; [_readLock unlock]; [_playbackLock lock]; success = [_sink playBytes: buffer length: bytesRead]; [_playbackLock unlock]; } while ((!_shouldStop) && (bytesRead > 0) && success); [_source setCurrentTime: 0.0]; } while (_shouldLoop == YES && _shouldStop == NO); [_sink close]; NSZoneFree (NSDefaultMallocZone(), buffer); } RETAIN(self); [self performSelectorOnMainThread: @selector(_finished:) withObject: [NSNumber numberWithBool: success] waitUntilDone: YES]; RELEASE(self); } - (void)_finished: (NSNumber *)finishedPlaying { DESTROY(_readLock); DESTROY(_playbackLock); /* FIXME: should I call -sound:didFinishPlaying: when -stop was sent? */ if ([_delegate respondsToSelector: @selector(sound:didFinishPlaying:)]) { [_delegate sound: self didFinishPlaying: [finishedPlaying boolValue]]; } } @end @implementation NSSound + (void) initialize { if (self == [NSSound class]) { NSString *path = [NSBundle pathForLibraryResource: @"nsmapping" ofType: @"strings" inDirectory: @"Sounds"]; [self setVersion: 2]; nameDict = [[NSMutableDictionary alloc] initWithCapacity: 10]; if (path) { nsmapping = RETAIN([[NSString stringWithContentsOfFile: path] propertyListFromStringsFileFormat]); } /* FIXME: Not sure if this is the best way... */ _loadNSSoundPlugIns (); } } - (void) dealloc { // Make sure sound is stopped before deallocating. [self stop]; RELEASE (_data); if (self == [nameDict objectForKey: _name]) { [nameDict removeObjectForKey: _name]; } RELEASE (_name); RELEASE (_playbackDeviceIdentifier); RELEASE (_channelMapping); RELEASE (_source); RELEASE (_sink); [super dealloc]; } // // Creating an NSSound // - (id) initWithContentsOfFile: (NSString *)path byReference:(BOOL)byRef { NSData *fileData; // Problem here: should every NSSound instance have a _name set? // The Apple docs are a bit confusing here. For now, the only way // _name will be set is if -setName: is called, or if the sound already // exists in on of the Sounds/ directories. _onlyReference = byRef; fileData = [NSData dataWithContentsOfMappedFile: path]; if (!fileData) { NSLog (@"Could not get sound data from: %@", path); DESTROY(self); return nil; } return [self initWithData: fileData]; } - (id) initWithContentsOfURL: (NSURL *)url byReference:(BOOL)byRef { _onlyReference = byRef; return [self initWithData: [NSData dataWithContentsOfURL: url]]; } - (id) initWithData: (NSData *)data { NSEnumerator *enumerator; Class sourceClass, sinkClass; _data = data; RETAIN(_data); // Search for an GSSoundSource bundle that can play this data. enumerator = [sourcePlugIns objectEnumerator]; while ((sourceClass = [enumerator nextObject]) != nil) { if ([sourceClass canInitWithData: _data]) { _source = [[sourceClass alloc] initWithData: _data]; if (_source == nil) { NSLog (@"Could not read sound data!"); DESTROY(self); return nil; } break; } } enumerator = [sinkPlugIns objectEnumerator]; /* FIXME: Grab the first available sink/device for now. In the future look for what is set in the GSSoundDeviceBundle default first. */ while ((sinkClass = [enumerator nextObject]) != nil) { if ([sinkClass canInitWithPlaybackDevice: nil]) { _sink = [[sinkClass alloc] initWithEncoding: [_source encoding] channels: [_source channelCount] sampleRate: [_source sampleRate] byteOrder: [_source byteOrder]]; if (_sink == nil) { NSLog (@"Could not open sound sink!"); DESTROY(self); return nil; } break; } } /* FIXME: There has to be a better way to do this check??? */ if (sourceClass == nil || sinkClass == nil) { NSLog (@"Could not find suitable sound plug-in"); DESTROY(self); return nil; } return self; } - (id) initWithPasteboard: (NSPasteboard *)pasteboard { if ([object_getClass(self) canInitWithPasteboard: pasteboard] == YES) { /* FIXME: Should this be @"NSGeneralPboardType" or @"NSSoundPboardType"? Apple also defines "NSString *NSSoundPboardType". */ NSData *d = [pasteboard dataForType: @"NSGeneralPboardType"]; return [self initWithData: d]; } return nil; } // // Playing and Information // - (BOOL) pause { // Do nothing if sound is already paused. if ([_readLock condition] == SOUND_SHOULD_PAUSE) { return NO; } if ([_readLock tryLock] == NO) { return NO; } [_readLock unlockWithCondition: SOUND_SHOULD_PAUSE]; return YES; } - (BOOL) play { // If the locks exists this instance is already playing if (_readLock != nil && _playbackLock != nil) { return NO; } _readLock = [[NSConditionLock alloc] initWithCondition: SOUND_SHOULD_PAUSE]; _playbackLock = [[NSLock alloc] init]; if ([_readLock tryLock] != YES) { return NO; } _shouldStop = NO; [NSThread detachNewThreadSelector: @selector(_stream) toTarget: self withObject: nil]; [_readLock unlockWithCondition: SOUND_SHOULD_PLAY]; return YES; } - (BOOL) resume { // Do nothing if sound is already playing. if ([_readLock condition] == SOUND_SHOULD_PLAY) { return NO; } if ([_readLock tryLock] == NO) { return NO; } [_readLock unlockWithCondition: SOUND_SHOULD_PLAY]; return YES; } - (BOOL) stop { if (_readLock == nil) { return NO; } if ([_readLock tryLock] != YES) { return NO; } _shouldStop = YES; // Set to SOUND_SHOULD_PLAY so that thread isn't blocked. [_readLock unlockWithCondition: SOUND_SHOULD_PLAY]; return YES; } - (BOOL) isPlaying { if (_readLock == nil) { return NO; } if ([_readLock condition] == SOUND_SHOULD_PLAY) { return YES; } return NO; } - (float) volume { return [_sink volume]; } - (void) setVolume: (float) volume { [_playbackLock lock]; [_sink setVolume: volume]; [_playbackLock unlock]; } - (NSTimeInterval) currentTime { return [_source currentTime]; } - (void) setCurrentTime: (NSTimeInterval) currentTime { [_readLock lock]; [_source setCurrentTime: currentTime]; [_readLock unlock]; } - (BOOL) loops { return _shouldLoop; } - (void) setLoops: (BOOL) loops { _shouldLoop = loops; } - (NSTimeInterval) duration { return [_source duration]; } // // Working with pasteboards // + (BOOL) canInitWithPasteboard: (NSPasteboard *)pasteboard { NSArray *pbTypes = [pasteboard types]; NSArray *myTypes = [NSSound soundUnfilteredPasteboardTypes]; return ([pbTypes firstObjectCommonWithArray: myTypes] != nil); } + (NSArray *) soundUnfilteredPasteboardTypes { return [NSArray arrayWithObjects: @"NSGeneralPboardType", nil]; } - (void) writeToPasteboard: (NSPasteboard *)pasteboard { NSData *d = [NSArchiver archivedDataWithRootObject: self]; if (d != nil) { [pasteboard declareTypes: [NSSound soundUnfilteredPasteboardTypes] owner: nil]; [pasteboard setData: d forType: @"NSGeneralPboardType"]; } } // // Working with delegates // - (id) delegate { return _delegate; } - (void) setDelegate: (id)aDelegate { _delegate = aDelegate; } // // Naming Sounds // + (id) soundNamed: (NSString*)name { NSString *realName = [nsmapping objectForKey: name]; NSSound *sound; if (realName) { name = realName; } sound = (NSSound *)[nameDict objectForKey: name]; if (sound == nil) { NSString *extension; NSString *path = nil; NSBundle *main_bundle; NSArray *array; NSString *the_name = name; // FIXME: This should use [NSBundle pathForSoundResource], but this will // only allow soundUnfilteredFileTypes. /* If there is no sound with that name, search in the main bundle */ main_bundle = [NSBundle mainBundle]; extension = [name pathExtension]; if (extension != nil && [extension length] == 0) { extension = nil; } /* Check if extension is one of the sound types */ array = [NSSound soundUnfilteredFileTypes]; if ([array indexOfObject: extension] != NSNotFound) { /* Extension is one of the sound types So remove from the name */ the_name = [name stringByDeletingPathExtension]; } else { /* Otherwise extension is not an sound type So leave it alone */ the_name = name; extension = nil; } /* First search locally */ if (extension) { path = [main_bundle pathForResource: the_name ofType: extension]; } else { id o, e; e = [array objectEnumerator]; while ((o = [e nextObject])) { path = [main_bundle pathForResource: the_name ofType: o]; if (path != nil && [path length] != 0) { break; } } } /* If not found then search in system */ if (!path) { if (extension) { path = [NSBundle pathForLibraryResource: the_name ofType: extension inDirectory: @"Sounds"]; } else { id o, e; e = [array objectEnumerator]; while ((o = [e nextObject])) { path = [NSBundle pathForLibraryResource: the_name ofType: o inDirectory: @"Sounds"]; if (path != nil && [path length] != 0) { break; } } } } if ([path length] != 0) { sound = [[self allocWithZone: NSDefaultMallocZone()] initWithContentsOfFile: path byReference: NO]; if (sound != nil) { [sound setName: name]; RELEASE(sound); sound->_onlyReference = YES; } return sound; } } return sound; } + (NSArray *) soundUnfilteredFileTypes { Class sourceClass; NSMutableArray *array; NSEnumerator *enumerator; array = [NSMutableArray arrayWithCapacity: 10]; enumerator = [sourcePlugIns objectEnumerator]; while ((sourceClass = [enumerator nextObject]) != nil) { [array addObjectsFromArray: [sourceClass soundUnfilteredFileTypes]]; } return array; } + (NSArray *) soundUnfilteredTypes { Class sourceClass; NSMutableArray *array; NSEnumerator *enumerator; array = [NSMutableArray arrayWithCapacity: 10]; enumerator = [sourcePlugIns objectEnumerator]; while ((sourceClass = [enumerator nextObject]) != nil) { [array addObjectsFromArray: [sourceClass soundUnfilteredTypes]]; } return array; } - (NSString *) name { return _name; } - (BOOL) setName: (NSString *)aName { if (!aName || [nameDict objectForKey: aName]) { return NO; } if ((_name != nil) && self == [nameDict objectForKey: _name]) { [nameDict removeObjectForKey: _name]; } ASSIGN(_name, aName); [nameDict setObject: self forKey: _name]; return YES; } - (NSString *) playbackDeviceIdentifier { return [_sink playbackDeviceIdentifier]; } - (void) setPlaybackDeviceIdentifier: (NSString *)playbackDeviceIdentifier { if ([[_sink class] canInitWithPlaybackDevice: playbackDeviceIdentifier]) { [_playbackLock lock]; [_sink setPlaybackDeviceIdentifier: playbackDeviceIdentifier]; [_playbackLock unlock]; } } - (NSArray *) channelMapping { return [_sink channelMapping]; } - (void) setChannelMapping: (NSArray *)channelMapping { [_playbackLock lock]; [_sink setChannelMapping: channelMapping]; [_playbackLock unlock]; } // // NSCoding // - (void) encodeWithCoder: (NSCoder *)coder { if ([coder allowsKeyedCoding]) { // TODO_NIB: Determine keys for NSSound. } else { [coder encodeValueOfObjCType: @encode(BOOL) at: &_onlyReference]; [coder encodeObject: _name]; if (_onlyReference == YES) { return; } [coder encodeConditionalObject: _delegate]; [coder encodeObject: _data]; [coder encodeObject: _playbackDeviceIdentifier]; [coder encodeObject: _channelMapping]; } } - (id) initWithCoder: (NSCoder*)decoder { if ([decoder allowsKeyedCoding]) { // TODO_NIB: Determine keys for NSSound. } else { [decoder decodeValueOfObjCType: @encode(BOOL) at: &_onlyReference]; if (_onlyReference == YES) { NSString *theName = [decoder decodeObject]; RELEASE (self); self = RETAIN ([NSSound soundNamed: theName]); [self setName: theName]; } else { _name = RETAIN ([decoder decodeObject]); [self setDelegate: [decoder decodeObject]]; _data = RETAIN([decoder decodeObject]); _playbackDeviceIdentifier = RETAIN([decoder decodeObject]); _channelMapping = RETAIN([decoder decodeObject]); } /* FIXME: Need to prepare the object for playback before going further. */ } return self; } // // NSCopying // - (id) copyWithZone: (NSZone *)zone { NSSound *newSound = (NSSound *)NSCopyObject(self, 0, zone); /* FIXME: Is all this correct? And is this all that needs to be copied? */ newSound->_name = [_name copyWithZone: zone]; newSound->_data = [_data copyWithZone: zone]; newSound->_playbackDeviceIdentifier = [_playbackDeviceIdentifier copyWithZone: zone]; newSound->_channelMapping = [_channelMapping copyWithZone: zone]; /* FIXME: Need to prepare the object for playback before going further. */ return newSound; } @end gnustep-gui-0.24.0/Source/NSColor.m0000664000076500007650000024064212223465703016713 0ustar brains99brains99/** NSColor The colorful color class Copyright (C) 1996, 1998, 2001, 2002 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Fred Kiefer Date: 2001, 2002 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import #import #import #import #import #import #import #import #import #import "AppKit/NSBezierPath.h" #import "AppKit/NSColor.h" #import "AppKit/NSColorList.h" #import "AppKit/NSColorSpace.h" #import "AppKit/NSPasteboard.h" #import "AppKit/NSView.h" #import "AppKit/NSImage.h" #import "AppKit/NSGraphics.h" #import "AppKit/PSOperators.h" #import "GNUstepGUI/GSTheme.h" #import "GSGuiPrivate.h" static Class NSColorClass; /* This interface must be provided in NSColorList to let us manage * system colors. */ @interface NSColorList (GNUstepPrivate) + (void) _setDefaultSystemColorList: (NSColorList*)aList; + (void) _setThemeSystemColorList: (NSColorList*)aList; @end @interface GSNamedColor : NSColor { NSString *_catalog_name; NSString *_color_name; NSString *_cached_name_space; NSColor *_cached_color; } - (NSColor*) initWithCatalogName: (NSString *)listName colorName: (NSString *)colorName; - (void) recache; @end @interface GSWhiteColor : NSColor { CGFloat _white_component; CGFloat _alpha_component; } @end @interface GSDeviceWhiteColor : GSWhiteColor - (NSColor*) initWithDeviceWhite: (CGFloat)white alpha: (CGFloat)alpha; @end @interface GSCalibratedWhiteColor : GSWhiteColor - (NSColor*) initWithCalibratedWhite: (CGFloat)white alpha: (CGFloat)alpha; @end @interface GSDeviceCMYKColor : NSColor { CGFloat _cyan_component; CGFloat _magenta_component; CGFloat _yellow_component; CGFloat _black_component; CGFloat _alpha_component; } - (NSColor*) initWithDeviceCyan: (CGFloat)cyan magenta: (CGFloat)magenta yellow: (CGFloat)yellow black: (CGFloat)black alpha: (CGFloat)alpha; @end @interface GSRGBColor : NSColor { CGFloat _red_component; CGFloat _green_component; CGFloat _blue_component; CGFloat _hue_component; CGFloat _saturation_component; CGFloat _brightness_component; CGFloat _alpha_component; } @end @interface GSDeviceRGBColor : GSRGBColor - (NSColor*) initWithDeviceRed: (CGFloat)red green: (CGFloat)green blue: (CGFloat)blue alpha: (CGFloat)alpha; - (NSColor*) initWithDeviceHue: (CGFloat)hue saturation: (CGFloat)saturation brightness: (CGFloat)brightness alpha: (CGFloat)alpha; @end @interface GSCalibratedRGBColor : GSRGBColor - (NSColor*) initWithCalibratedRed: (CGFloat)red green: (CGFloat)green blue: (CGFloat)blue alpha: (CGFloat)alpha; - (NSColor*) initWithCalibratedHue: (CGFloat)hue saturation: (CGFloat)saturation brightness: (CGFloat)brightness alpha: (CGFloat)alpha; @end // FIXME: This is not described in the specification @interface GSPatternColor : NSColor { NSImage *_pattern; } - (NSColor*) initWithPatternImage: (NSImage*) pattern; @end @interface NSColor (GNUstepPrivate) + (NSColor*) colorFromString: (NSString*)string; + (void) defaultsDidChange: (NSNotification*)notification; + (void) themeDidActivate: (NSNotification*)notification; @end // Class variables static BOOL gnustep_gui_ignores_alpha = YES; static NSColorList *systemColors = nil; static NSColorList *defaultSystemColors = nil; static NSMutableDictionary *colorStrings = nil; static NSMutableDictionary *systemDict = nil; static void initSystemColors(void) { NSString *white; NSString *lightGray; NSString *gray; NSString *darkGray; NSString *black; // Set up a dictionary containing the names of all the system colors // as keys and with colors in string format as values. white = [NSString stringWithFormat: @"%g %g %g", (double)NSWhite, (double)NSWhite, (double)NSWhite]; lightGray = [NSString stringWithFormat: @"%g %g %g", (double)NSLightGray, (double)NSLightGray, (double)NSLightGray]; gray = [NSString stringWithFormat: @"%g %g %g", (double)NSGray, (double)NSGray, (double)NSGray]; darkGray = [NSString stringWithFormat: @"%g %g %g", (double)NSDarkGray, (double)NSDarkGray, (double)NSDarkGray]; black = [NSString stringWithFormat: @"%g %g %g", (double)NSBlack, (double)NSBlack, (double)NSBlack]; colorStrings = [[NSMutableDictionary alloc] initWithObjectsAndKeys: lightGray, @"controlBackgroundColor", lightGray, @"controlColor", lightGray, @"controlHighlightColor", white, @"controlLightHighlightColor", darkGray, @"controlShadowColor", black, @"controlDarkShadowColor", black, @"controlTextColor", darkGray, @"disabledControlTextColor", gray, @"gridColor", lightGray, @"headerColor", black, @"headerTextColor", white, @"highlightColor", black, @"keyboardFocusIndicatorColor", lightGray, @"knobColor", gray, @"scrollBarColor", white, @"selectedControlColor", black, @"selectedControlTextColor", lightGray, @"selectedKnobColor", white, @"selectedMenuItemColor", black, @"selectedMenuItemTextColor", lightGray, @"selectedTextBackgroundColor", black, @"selectedTextColor", black, @"shadowColor", white, @"textBackgroundColor", black, @"textColor", lightGray, @"windowBackgroundColor", black, @"windowFrameColor", white, @"windowFrameTextColor", black, @"alternateSelectedControlColor", white, @"alternateSelectedControlTextColor", white, @"rowBackgroundColor", lightGray, @"alternateRowBackgroundColor", lightGray, @"secondarySelectedControlColor", //gray, @"windowFrameColor", //black, @"windowFrameTextColor", nil]; systemColors = RETAIN([NSColorList colorListNamed: @"System"]); defaultSystemColors = [[NSColorList alloc] initWithName: @"System"]; [NSColorList _setDefaultSystemColorList: defaultSystemColors]; if (systemColors == nil) { ASSIGN(systemColors, defaultSystemColors); } { NSEnumerator *enumerator; NSString *key; // Set up default system colors enumerator = [colorStrings keyEnumerator]; while ((key = (NSString *)[enumerator nextObject])) { NSColor *color; if ((color = [systemColors colorWithKey: key]) == nil) { NSString *aColorString; aColorString = [colorStrings objectForKey: key]; color = [NSColorClass colorFromString: aColorString]; NSCAssert1(color, @"couldn't get default system color %@", key); [systemColors setColor: color forKey: key]; } if (defaultSystemColors != systemColors) { [defaultSystemColors setColor: color forKey: key]; } } } systemDict = [NSMutableDictionary new]; } static NSColor* systemColorWithName(NSString *name) { NSColor *col = [systemDict objectForKey: name]; if (col == nil) { col = [NSColor colorWithCatalogName: @"System" colorName: name]; [systemDict setObject: col forKey: name]; } return col; } /** *

TODO NSColor description

* */ @implementation NSColor // // Class methods // + (void) initialize { if (self == [NSColor class]) { NSColorClass = self; // Set the version number [self setVersion: 3]; // ignore alpha by default gnustep_gui_ignores_alpha = YES; // Load or define the system colour list initSystemColors(); // ensure user defaults are loaded, then use them and watch for changes. [self defaultsDidChange: nil]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(defaultsDidChange:) name: NSUserDefaultsDidChangeNotification object: nil]; // watch for themes which may provide new system color lists [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(themeDidActivate:) name: GSThemeDidActivateNotification object: nil]; } } /**

Creates and returns a new NSColor in a NSCalibratedRGBColorSpace space name, with hue, saturation, brightness and alpha as specified. Valid values are the range 0.0 to 1.0. Out of range values will be clipped.

*/ + (NSColor*) colorWithCalibratedHue: (CGFloat)hue saturation: (CGFloat)saturation brightness: (CGFloat)brightness alpha: (CGFloat)alpha { id color; color = [GSCalibratedRGBColor allocWithZone: NSDefaultMallocZone()]; color = [color initWithCalibratedHue: hue saturation: saturation brightness: brightness alpha: alpha]; return AUTORELEASE(color); } /**

Creates and returns a new NSColor in a NSCalibratedRGBColorSpace space name, with red, green, blue and alpha as specified. Valid values are the range 0.0 to 1.0. Out of range values will be clipped.

*/ + (NSColor*) colorWithCalibratedRed: (CGFloat)red green: (CGFloat)green blue: (CGFloat)blue alpha: (CGFloat)alpha { id color; color = [GSCalibratedRGBColor allocWithZone: NSDefaultMallocZone()]; color = [color initWithCalibratedRed: red green: green blue: blue alpha: alpha]; return AUTORELEASE(color); } /**

Creates and returns a new NSColor in a NSCalibratedWhiteColorSpace space name, with red, green, blue and alpha as specified. Valid values are the range 0.0 to 1.0. Out of range values will be clipped.

*/ + (NSColor*) colorWithCalibratedWhite: (CGFloat)white alpha: (CGFloat)alpha { id color; color = [GSCalibratedWhiteColor allocWithZone: NSDefaultMallocZone()] ; color = [color initWithCalibratedWhite: white alpha: alpha]; return AUTORELEASE(color); } /** *

TODO

*/ + (NSColor*) colorWithCatalogName: (NSString *)listName colorName: (NSString *)colorName { id color; color = [GSNamedColor allocWithZone: NSDefaultMallocZone()] ; color = [color initWithCatalogName: listName colorName: colorName]; return AUTORELEASE(color); } /**

Creates and returns a new NSColor in a NSDeviceCMYKColorSpace space name, with cyan, magenta, yellow, black and alpha as specified. Valid values are the range 0.0 to 1.0. Out of range values will be clipped.

*/ + (NSColor*) colorWithDeviceCyan: (CGFloat)cyan magenta: (CGFloat)magenta yellow: (CGFloat)yellow black: (CGFloat)black alpha: (CGFloat)alpha { id color; color = [GSDeviceCMYKColor allocWithZone: NSDefaultMallocZone()]; color = [color initWithDeviceCyan: cyan magenta: magenta yellow: yellow black: black alpha: alpha]; return AUTORELEASE(color); } /**

Creates and returns a new NSColor in a NSDeviceCMYKColorSpace space name, with hue, saturation, brightness and alpha as specified. Valid values are the range 0.0 to 1.0. Out of range values will be clipped.

*/ + (NSColor*) colorWithDeviceHue: (CGFloat)hue saturation: (CGFloat)saturation brightness: (CGFloat)brightness alpha: (CGFloat)alpha { id color; color = [GSDeviceRGBColor allocWithZone: NSDefaultMallocZone()]; color = [color initWithDeviceHue: hue saturation: saturation brightness: brightness alpha: alpha]; return AUTORELEASE(color); } /**

Creates and returns a new NSColor in a NSDeviceCMYKColorSpace space name, with red, green, blue and alpha as specified. Valid values are the range 0.0 to 1.0. Out of range values will be clipped.

*/ + (NSColor*) colorWithDeviceRed: (CGFloat)red green: (CGFloat)green blue: (CGFloat)blue alpha: (CGFloat)alpha { id color; color = [GSDeviceRGBColor allocWithZone: NSDefaultMallocZone()]; color = [color initWithDeviceRed: red green: green blue: blue alpha: alpha]; return AUTORELEASE(color); } /**

Creates and returns a new NSColor in a NSDeviceWhiteColorSpace space name, with red, green, blue and alpha as specified. Valid values are the range 0.0 to 1.0. Out of range values will be clipped.

*/ + (NSColor*) colorWithDeviceWhite: (CGFloat)white alpha: (CGFloat)alpha { id color; color = [GSDeviceWhiteColor allocWithZone: NSDefaultMallocZone()]; color = [color initWithDeviceWhite: white alpha: alpha]; return AUTORELEASE(color); } + (NSColor*) colorForControlTint: (NSControlTint)controlTint { switch (controlTint) { default: case NSDefaultControlTint: return [self colorForControlTint: [self currentControlTint]]; case NSGraphiteControlTint: // FIXME case NSClearControlTint: // FIXME case NSBlueControlTint: return [NSColor blueColor]; } } + (NSControlTint) currentControlTint { // FIXME: should be made a system setting return NSBlueControlTint; } + (NSColor*) colorWithPatternImage: (NSImage*)image { id color; color = [GSPatternColor allocWithZone: NSDefaultMallocZone()]; color = [color initWithPatternImage: image]; return AUTORELEASE(color); } /**

Returns a NSColor in a NSCalibratedWhiteColorSpace space name. with white and alpha values set as NSBlack and 1.0 respectively.

See Also : +colorWithCalibratedWhite:alpha:

*/ + (NSColor*) blackColor { return [self colorWithCalibratedWhite: NSBlack alpha: 1.0]; } /**

Returns an NSColor in a NSCalibratedRGBColorSpace space name. with red, green, blue and alpha values set as 0.0, 0.0, 1.0 and 1.0 respectively.

See Also : +colorWithCalibratedRed:green:blue:alpha:

*/ + (NSColor*) blueColor { return [self colorWithCalibratedRed: 0.0 green: 0.0 blue: 1.0 alpha: 1.0]; } /**

Returns a NSColor in a NSCalibratedRGBColorSpace space name. with red, green, blue and alpha values set as 0.6, 0.4, 0.2 and 1.0 respectively.

See Also: +colorWithCalibratedRed:green:blue:alpha:

*/ + (NSColor*) brownColor { return [self colorWithCalibratedRed: 0.6 green: 0.4 blue: 0.2 alpha: 1.0]; } /**

Returns a NSColor in a NSCalibratedWhiteColorSpace space name. with white and alpha values set as 0.0 and 1.0 respectively.

See Also : +colorWithCalibratedWhite:alpha:

*/ + (NSColor*) clearColor { return [self colorWithCalibratedWhite: 0.0 alpha: 0.0]; } /**

Returns a NSColor in a NSCalibratedRGBColorSpace space name. with red, green, blue and alpha values set as 0.0, 1.0, 1.0 and 1.0 respectively.

See Also : +colorWithCalibratedRed:green:blue:alpha:

*/ + (NSColor*) cyanColor { return [self colorWithCalibratedRed: 0.0 green: 1.0 blue: 1.0 alpha: 1.0]; } /**

Returns a NSColor in a NSCalibratedWhiteColorSpace space name. with white and alpha values set as NSDarkGray and 1.0 respectively.

See Also : +colorWithCalibratedWhite:alpha:

*/ + (NSColor*) darkGrayColor { return [self colorWithCalibratedWhite: NSDarkGray alpha: 1.0]; } /**

Returns a NSColor in a NSCalibratedWhiteColorSpace space name. with white and alpha values set as NSGray and 1.0 respectively.

See Also: +colorWithCalibratedWhite:alpha:

*/ + (NSColor*) grayColor { return [self colorWithCalibratedWhite: NSGray alpha: 1.0]; } /**

Returns a NSColor in a NSCalibratedRGBColorSpace space name. with red, green, blue and alpha values set as 0.0, 1.0, 0.0 and 1.0 respectively

See Also: +colorWithCalibratedRed:green:blue:alpha:

*/ + (NSColor*) greenColor { return [self colorWithCalibratedRed: 0.0 green: 1.0 blue: 0.0 alpha: 1.0]; } /**

Returns a NSColor in a NSCalibratedWhiteColorSpace space name. with white and alpha values set as NSLightGray and 1.0 respectively

See Also : +colorWithCalibratedRed:green:blue:alpha:

*/ + (NSColor*) lightGrayColor { return [self colorWithCalibratedWhite: NSLightGray alpha: 1]; } /**

Returns a NSColor in a NSCalibratedRGBColorSpace space name. with red, green, blue and alpha values set as 1.0, 0.0, 1.0 and 1.0 respectively.

See Also : +colorWithCalibratedRed:green:blue:alpha:

*/ + (NSColor*) magentaColor { return [self colorWithCalibratedRed: 1.0 green: 0.0 blue: 1.0 alpha: 1.0]; } /**

Returns a NSColor in a NSCalibratedRGBColorSpace space name. with red, green, blue and alpha values set as 1.0, 0.5, 0.0 and 1.0 respectively.

See Also: +colorWithCalibratedRed:green:blue:alpha:

*/ + (NSColor*) orangeColor { return [self colorWithCalibratedRed: 1.0 green: 0.5 blue: 0.0 alpha: 1.0]; } /**

Returns a NSColor in a NSCalibratedRGBColorSpace space name. with red, green, blue and alpha values set as 0.5, 0.0, 0.5 and 1.0 respectively.

See Also : +colorWithCalibratedRed:green:blue:alpha:

*/ + (NSColor*) purpleColor { return [self colorWithCalibratedRed: 0.5 green: 0.0 blue: 0.5 alpha: 1.0]; } /**

Returns a NSColor in a NSCalibratedRGBColorSpace space name. with red, green, blue and alpha values set as 1.0, 0.0, 0.0 and 1.0 respectively

See Also: +colorWithCalibratedRed:green:blue:alpha:

*/ + (NSColor*) redColor { return [self colorWithCalibratedRed: 1.0 green: 0.0 blue: 0.0 alpha: 1.0]; } /**

Returns a NSColor in a NSCalibratedWhiteColorSpace space name. with white and alpha values set as NSWhite and 1.0 respectively.

See Also : +colorWithCalibratedWhite:alpha:

*/ + (NSColor*) whiteColor { return [self colorWithCalibratedWhite: NSWhite alpha: 1.0]; } /**

Returns a NSColor in a NSCalibratedRGBColorSpace space name. with red, green, blue and alpha values set as 1.0, 0.0, 0.0 and 1.0 respectively.

See Also : +colorWithCalibratedRed:green:blue:alpha:

*/ + (NSColor*) yellowColor { return [self colorWithCalibratedRed: 1.0 green: 1.0 blue: 0.0 alpha: 1.0]; } /** Returns whether TODO *

See Also: +setIgnoresAlpha:

*/ + (BOOL) ignoresAlpha { return gnustep_gui_ignores_alpha; } /** TODO *

See Also: +ignoresAlpha

*/ + (void) setIgnoresAlpha: (BOOL)flag { gnustep_gui_ignores_alpha = flag; } /**

Returns the NSColor on the NSPasteboard pasteBoard or nil if it does not exists.

See Also: -writeToPasteboard:

*/ + (NSColor*) colorFromPasteboard: (NSPasteboard *)pasteBoard { NSData *colorData = [pasteBoard dataForType: NSColorPboardType]; // FIXME: This should better use the description format if (colorData != nil) return [NSUnarchiver unarchiveObjectWithData: colorData]; return nil; } // // System colors stuff. // + (NSColor*) alternateSelectedControlColor { return systemColorWithName(@"alternateSelectedControlColor"); } + (NSColor*) alternateSelectedControlTextColor { return systemColorWithName(@"alternateSelectedControlTextColor"); } + (NSColor*) controlBackgroundColor { return systemColorWithName(@"controlBackgroundColor"); } + (NSColor*) controlColor { return systemColorWithName(@"controlColor"); } + (NSColor*) controlHighlightColor { return systemColorWithName(@"controlHighlightColor"); } + (NSColor*) controlLightHighlightColor { return systemColorWithName(@"controlLightHighlightColor"); } + (NSColor*) controlShadowColor { return systemColorWithName(@"controlShadowColor"); } + (NSColor*) controlDarkShadowColor { return systemColorWithName(@"controlDarkShadowColor"); } + (NSColor*) controlTextColor { return systemColorWithName(@"controlTextColor"); } + (NSColor*) disabledControlTextColor { return systemColorWithName(@"disabledControlTextColor"); } + (NSColor*) gridColor { return systemColorWithName(@"gridColor"); } + (NSColor*) headerColor { return systemColorWithName(@"headerColor"); } + (NSColor*) headerTextColor { return systemColorWithName(@"headerTextColor"); } + (NSColor*) highlightColor { return systemColorWithName(@"highlightColor"); } + (NSColor*) keyboardFocusIndicatorColor { return systemColorWithName(@"keyboardFocusIndicatorColor"); } + (NSColor*) knobColor { return systemColorWithName(@"knobColor"); } + (NSColor*) scrollBarColor { return systemColorWithName(@"scrollBarColor"); } + (NSColor*) secondarySelectedControlColor { return systemColorWithName(@"secondarySelectedControlColor"); } + (NSColor*) selectedControlColor { return systemColorWithName(@"selectedControlColor"); } + (NSColor*) selectedControlTextColor { return systemColorWithName(@"selectedControlTextColor"); } + (NSColor*) selectedKnobColor { return systemColorWithName(@"selectedKnobColor"); } + (NSColor*) selectedMenuItemColor { return systemColorWithName(@"selectedMenuItemColor"); } + (NSColor*) selectedMenuItemTextColor { return systemColorWithName(@"selectedMenuItemTextColor"); } + (NSColor*) selectedTextBackgroundColor { return systemColorWithName(@"selectedTextBackgroundColor"); } + (NSColor*) selectedTextColor { return systemColorWithName(@"selectedTextColor"); } + (NSColor*) shadowColor { return systemColorWithName(@"shadowColor"); } + (NSColor*) textBackgroundColor { return systemColorWithName(@"textBackgroundColor"); } + (NSColor*) textColor { return systemColorWithName(@"textColor"); } + (NSColor *)windowBackgroundColor { return systemColorWithName(@"windowBackgroundColor"); } + (NSColor*) windowFrameColor { return systemColorWithName(@"windowFrameColor"); } + (NSColor*) windowFrameTextColor { return systemColorWithName(@"windowFrameTextColor"); } + (NSArray*) controlAlternatingRowBackgroundColors { return [NSArray arrayWithObjects: systemColorWithName(@"rowBackgroundColor"), systemColorWithName(@"alternateRowBackgroundColor"), nil]; } //////////////////////////////////////////////////////////// // // Instance methods // - (id) copyWithZone: (NSZone*)aZone { if (NSShouldRetainWithZone(self, aZone)) { return RETAIN(self); } else { return NSCopyObject(self, 0, aZone); } } - (NSString*) description { [self subclassResponsibility: _cmd]; return nil; } /**

Gets the cyan, magenta, yellow,black and alpha values from the NSColor. Raises a NSInternalInconsistencyException if the NSColor is not a CYMK color

*/ - (void) getCyan: (CGFloat*)cyan magenta: (CGFloat*)magenta yellow: (CGFloat*)yellow black: (CGFloat*)black alpha: (CGFloat*)alpha { [NSException raise: NSInternalInconsistencyException format: @"Called getCyan:magenta:yellow:black:alpha: on non-CMYK colour"]; } /**

Gets the hue, saturation, brightness and alpha values from the NSColor. Raises a NSInternalInconsistencyException if the NSColor is not a RGB color

*/ - (void) getHue: (CGFloat*)hue saturation: (CGFloat*)saturation brightness: (CGFloat*)brightness alpha: (CGFloat*)alpha { [NSException raise: NSInternalInconsistencyException format: @"Called getHue:saturation:brightness:alpha: on non-RGB colour"]; } /**

Gets the red, green, blue and alpha values from the NSColor. Raises a NSInternalInconsistencyException if the NSColor is not a RGB color

*/ -(void) getRed: (CGFloat*)red green: (CGFloat*)green blue: (CGFloat*)blue alpha: (CGFloat*)alpha { [NSException raise: NSInternalInconsistencyException format: @"Called getRed:green:blue:alpha: on non-RGB colour"]; } /**

Gets the white alpha values from the NSColor. Raises a NSInternalInconsistencyException if the NSColor is not a greyscale color

*/ - (void) getWhite: (CGFloat*)white alpha: (CGFloat*)alpha { [NSException raise: NSInternalInconsistencyException format: @"Called getWhite:alpha: on non-grayscale colour"]; } - (BOOL) isEqual: (id)other { if (other == self) return YES; if ([other isKindOfClass: NSColorClass] == NO) return NO; else { [self subclassResponsibility: _cmd]; return NO; } } /**

Returns the alpha component.

*/ - (CGFloat) alphaComponent { return 1.0; } /**

Returns the black component. Raises a NSInternalInconsistencyException if NSColor is not a CMYK color.

*/ - (CGFloat) blackComponent { [NSException raise: NSInternalInconsistencyException format: @"Called blackComponent on non-CMYK colour"]; return 0.0; } /**

Returns the blue component. Raises a NSInternalInconsistencyException if NSColor is not a RGB color.

*/ - (CGFloat) blueComponent { [NSException raise: NSInternalInconsistencyException format: @"Called blueComponent on non-RGB colour"]; return 0.0; } /**

Returns the brightness component. Raises a NSInternalInconsistencyException if NSColor space is not a RGB color

*/ - (CGFloat) brightnessComponent { [NSException raise: NSInternalInconsistencyException format: @"Called brightnessComponent on non-RGB colour"]; return 0.0; } - (NSString *) catalogNameComponent { [NSException raise: NSInternalInconsistencyException format: @"Called catalogNameComponent on colour with name"]; return nil; } - (NSString *) colorNameComponent { [NSException raise: NSInternalInconsistencyException format: @"Called colorNameComponent on colour with name"]; return nil; } /**

Returns the cyan component. Raises a NSInternalInconsistencyException if NSColor is not a CYMK color

*/ - (CGFloat) cyanComponent { [NSException raise: NSInternalInconsistencyException format: @"Called cyanComponent on non-CMYK colour"]; return 0.0; } /**

Returns the green component. Raises a NSInternalInconsistencyException if NSColor is not a RGB color

*/ - (CGFloat) greenComponent { [NSException raise: NSInternalInconsistencyException format: @"Called greenComponent on non-RGB colour"]; return 0.0; } /**

Returns the hue component. Raises a NSInternalInconsistencyException if NSColor is not a RGB color

*/ - (CGFloat) hueComponent { [NSException raise: NSInternalInconsistencyException format: @"Called hueComponent on non-RGB colour"]; return 0.0; } - (NSString *) localizedCatalogNameComponent { [NSException raise: NSInternalInconsistencyException format: @"Called localizedCatalogNameComponent on colour with name"]; return nil; } - (NSString *) localizedColorNameComponent { [NSException raise: NSInternalInconsistencyException format: @"Called localizedColorNameComponent on colour with name"]; return nil; } /**

Returns the magenta component. Raises a NSInternalInconsistencyException if NSColor is not a CMYK color

*/ - (CGFloat) magentaComponent { [NSException raise: NSInternalInconsistencyException format: @"Called magentaComponent on non-CMYK colour"]; return 0.0; } /**

Returns the red component. Raises a NSInternalInconsistencyException if NSColor is not a RGB color

*/ - (CGFloat) redComponent { [NSException raise: NSInternalInconsistencyException format: @"Called redComponent on non-RGB colour"]; return 0.0; } /**

Returns the saturation component. Raises a NSInternalInconsistencyException if NSColor is not a RGB color

*/ - (CGFloat) saturationComponent { [NSException raise: NSInternalInconsistencyException format: @"Called saturationComponent on non-RGB colour"]; return 0.0; } /**

Returns the white component. Raises a NSInternalInconsistencyException if NSColor is not a grayscale color

*/ - (CGFloat) whiteComponent { [NSException raise: NSInternalInconsistencyException format: @"Called whiteComponent on non-grayscale colour"]; return 0.0; } - (NSImage*) patternImage { [NSException raise: NSInternalInconsistencyException format: @"Called patternImage on non-pattern colour"]; return nil; } /**

Returns the yellow component. Raises a NSInternalInconsistencyException if NSColor is not a RGB color

*/ - (CGFloat) yellowComponent { [NSException raise: NSInternalInconsistencyException format: @"Called yellowComponent on non-CMYK colour"]; return 0.0; } // // Converting to Another Color Space // - (NSString *) colorSpaceName { [self subclassResponsibility: _cmd]; return nil; } - (NSColor*) colorUsingColorSpaceName: (NSString *)colorSpace { return [self colorUsingColorSpaceName: colorSpace device: nil]; } - (NSColor*) colorUsingColorSpaceName: (NSString *)colorSpace device: (NSDictionary *)deviceDescription { if (colorSpace == nil) { if (deviceDescription != nil) colorSpace = [deviceDescription objectForKey: NSDeviceColorSpaceName]; if (colorSpace == nil) colorSpace = NSDeviceRGBColorSpace; } if ([colorSpace isEqualToString: [self colorSpaceName]]) { return self; } if ([colorSpace isEqualToString: NSNamedColorSpace]) { // FIXME: We cannot convert to named color space. return nil; } [self subclassResponsibility: _cmd]; return nil; } + (NSColor *) colorWithColorSpace: (NSColorSpace *)space components: (const CGFloat *)comp count: (NSInteger)number { // FIXME if (space == [NSColorSpace genericRGBColorSpace] && (number == 4)) { return [self colorWithCalibratedRed: comp[0] green: comp[1] blue: comp[2] alpha: comp[3]]; } if (space == [NSColorSpace deviceRGBColorSpace] && (number == 4)) { return [self colorWithDeviceRed: comp[0] green: comp[1] blue: comp[2] alpha: comp[3]]; } if (space == [NSColorSpace genericGrayColorSpace] && (number == 2)) { return [NSColor colorWithCalibratedWhite: comp[0] alpha: comp[1]]; } if (space == [NSColorSpace deviceGrayColorSpace] && (number == 2)) { return [NSColor colorWithDeviceWhite: comp[0] alpha: comp[1]]; } if (space == [NSColorSpace genericCMYKColorSpace] && (number == 5)) { return [NSColor colorWithDeviceCyan: comp[0] magenta: comp[1] yellow: comp[2] black: comp[3] alpha: comp[4]]; } if (space == [NSColorSpace deviceCMYKColorSpace] && (number == 5)) { return [NSColor colorWithDeviceCyan: comp[0] magenta: comp[1] yellow: comp[2] black: comp[3] alpha: comp[4]]; } return nil; } /* FIXME: This method does it the wrong way around. We should store the actual colour space and get the colour space name from there. */ - (NSColorSpace *) colorSpace { NSString *name = [self colorSpaceName]; if ([name isEqualToString: NSCalibratedRGBColorSpace]) return [NSColorSpace genericRGBColorSpace]; if ([name isEqualToString: NSDeviceRGBColorSpace]) return [NSColorSpace deviceRGBColorSpace]; if ([name isEqualToString: NSCalibratedBlackColorSpace] || [name isEqualToString: NSCalibratedWhiteColorSpace]) return [NSColorSpace genericGrayColorSpace]; if ([name isEqualToString: NSDeviceBlackColorSpace] || [name isEqualToString: NSDeviceWhiteColorSpace]) return [NSColorSpace deviceGrayColorSpace]; if ([name isEqualToString: NSDeviceCMYKColorSpace]) return [NSColorSpace deviceCMYKColorSpace]; return nil; } - (NSColor *) colorUsingColorSpace: (NSColorSpace *)space { // FIXME NSString *colorSpaceName; if (space == [self colorSpace]) { return self; } switch ([space colorSpaceModel]) { default: case NSUnknownColorSpaceModel: return nil; case NSGrayColorSpaceModel: colorSpaceName = NSDeviceWhiteColorSpace; break; case NSRGBColorSpaceModel: colorSpaceName = NSDeviceRGBColorSpace; break; case NSCMYKColorSpaceModel: colorSpaceName = NSDeviceCMYKColorSpace; break; case NSLABColorSpaceModel: return nil; case NSDeviceNColorSpaceModel: return nil; } return [self colorUsingColorSpaceName: colorSpaceName device: nil]; } - (NSUInteger) hash { int nums = [self numberOfComponents]; CGFloat floats[nums]; NSUInteger h = 0; unsigned i; [self getComponents: &floats[0]]; for (i = 0; i < sizeof(floats); i++) { h = (h << 5) + h + *(uint8_t*)(((uintptr_t)&floats[0])+(i*sizeof(uint8_t))); } return h; } - (NSInteger) numberOfComponents { [NSException raise: NSInternalInconsistencyException format: @"Called numberOfComponents on non-standard colour"]; return 0; } - (void) getComponents: (CGFloat *)components { [NSException raise: NSInternalInconsistencyException format: @"Called getComponents: on non-standard colour"]; } // // Changing the Color // - (NSColor*) blendedColorWithFraction: (CGFloat)fraction ofColor: (NSColor*)aColor { NSColor *myColor = [self colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; NSColor *other = [aColor colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; CGFloat mr, mg, mb, ma, or, og, ob, oa, red, green, blue, alpha; if (fraction <= 0.0) { return self; } if (fraction >= 1.0) { return aColor; } if (myColor == nil || other == nil) { return nil; } [myColor getRed: &mr green: &mg blue: &mb alpha: &ma]; [other getRed: &or green: &og blue: &ob alpha: &oa]; red = fraction * or + (1 - fraction) * mr; green = fraction * og + (1 - fraction) * mg; blue = fraction * ob + (1 - fraction) * mb; alpha = fraction * oa + (1 - fraction) * ma; return [NSColorClass colorWithCalibratedRed: red green: green blue: blue alpha: alpha]; } - (NSColor*) colorWithAlphaComponent: (CGFloat)alpha { return self; } - (NSColor*) highlightWithLevel: (CGFloat)level { return [self blendedColorWithFraction: level ofColor: [NSColorClass highlightColor]]; } - (NSColor*) shadowWithLevel: (CGFloat)level { return [self blendedColorWithFraction: level ofColor: [NSColorClass shadowColor]]; } /**

Writes the NSColor into the NSPasteboard specified by pasteBoard

*

See Also: +colorFromPasteboard:

*/ - (void) writeToPasteboard: (NSPasteboard *)pasteBoard { // FIXME: We should better use the description NSData *colorData = [NSArchiver archivedDataWithRootObject: self]; if (colorData != nil) [pasteBoard setData: colorData forType: NSColorPboardType]; } // // Drawing // - (void) drawSwatchInRect: (NSRect)rect { if ([self alphaComponent] < 1.0) { NSBezierPath *triangle = [NSBezierPath bezierPath]; [[NSColor whiteColor] set]; NSRectFill(rect); [triangle moveToPoint: NSMakePoint(rect.origin.x, rect.origin.y + rect.size.height)]; [triangle lineToPoint: NSMakePoint(rect.origin.x + rect.size.width, rect.origin.y + rect.size.height)]; [triangle lineToPoint: rect.origin]; [triangle closePath]; [[NSColor blackColor] set]; [triangle fill]; } [self set]; NSRectFill(rect); } - (void) set { // This is here to keep old code working [[self colorUsingColorSpaceName: NSDeviceRGBColorSpace] set]; } - (void) setFill { [[self colorUsingColorSpaceName: NSDeviceRGBColorSpace] setFill]; } - (void) setStroke { [[self colorUsingColorSpaceName: NSDeviceRGBColorSpace] setStroke]; } // // NSCoding protocol // - (Class) classForCoder { return NSColorClass; } - (void) encodeWithCoder: (NSCoder*)aCoder { [self subclassResponsibility: _cmd]; } - (id) initWithCoder: (NSCoder*)aDecoder { if ([aDecoder allowsKeyedCoding]) { int colorSpace = [aDecoder decodeIntForKey: @"NSColorSpace"]; DESTROY(self); if ((colorSpace == 1) || (colorSpace == 2)) { NSUInteger length; const uint8_t *data; double red = 0.0; double green = 0.0; double blue = 0.0; double alpha = 1.0; NSString *str; NSScanner *scanner; if ([aDecoder containsValueForKey: @"NSRGB"]) { data = [aDecoder decodeBytesForKey: @"NSRGB" returnedLength: &length]; str = [[NSString alloc] initWithCString: (const char*)data length: length]; scanner = [[NSScanner alloc] initWithString: str]; [scanner scanDouble: &red]; [scanner scanDouble: &green]; [scanner scanDouble: &blue]; [scanner scanDouble: &alpha]; RELEASE(scanner); RELEASE(str); } if (colorSpace == 1) { self = RETAIN([NSColor colorWithCalibratedRed: red green: green blue: blue alpha: alpha]); } else { self = RETAIN([NSColor colorWithDeviceRed: red green: green blue: blue alpha: alpha]); } } else if ((colorSpace == 3) || (colorSpace == 4)) { NSUInteger length; const uint8_t *data; double white = 0.0; double alpha = 1.0; NSString *str; NSScanner *scanner; if ([aDecoder containsValueForKey: @"NSWhite"]) { data = [aDecoder decodeBytesForKey: @"NSWhite" returnedLength: &length]; str = [[NSString alloc] initWithCString: (const char*)data length: length]; scanner = [[NSScanner alloc] initWithString: str]; [scanner scanDouble: &white]; [scanner scanDouble: &alpha]; RELEASE(scanner); RELEASE(str); } if (colorSpace == 3) { self = RETAIN([NSColor colorWithCalibratedWhite: white alpha: alpha]); } else { self = RETAIN([NSColor colorWithDeviceWhite: white alpha: alpha]); } } else if (colorSpace == 5) { NSUInteger length; const uint8_t *data; double cyan = 0.0; double yellow = 0.0; double magenta = 0.0; double black = 0.0; double alpha = 1.0; NSString *str; NSScanner *scanner; if ([aDecoder containsValueForKey: @"NSCYMK"]) { data = [aDecoder decodeBytesForKey: @"NSCYMK" returnedLength: &length]; str = [[NSString alloc] initWithCString: (const char*)data length: length]; scanner = [[NSScanner alloc] initWithString: str]; [scanner scanDouble: &cyan]; [scanner scanDouble: &yellow]; [scanner scanDouble: &magenta]; [scanner scanDouble: &black]; [scanner scanDouble: &alpha]; RELEASE(scanner); RELEASE(str); } self = RETAIN([NSColor colorWithDeviceCyan: cyan magenta: magenta yellow: yellow black: black alpha: alpha]); } else if (colorSpace == 6) { NSString *catalog = [aDecoder decodeObjectForKey: @"NSCatalogName"]; NSString *name = [aDecoder decodeObjectForKey: @"NSColorName"]; //NSColor *color = [aDecoder decodeObjectForKey: @"NSColor"]; self = RETAIN([NSColor colorWithCatalogName: catalog colorName: name]); } else if (colorSpace == 10) { NSImage *image = [aDecoder decodeObjectForKey: @"NSImage"]; self = RETAIN([NSColor colorWithPatternImage: image]); } return self; } else if ([aDecoder versionForClassName: @"NSColor"] < 3) { float red; float green; float blue; float cyan; float magenta; float yellow; float black; float hue; float saturation; float brightness; float alpha; float white; int active_component; int valid_components; NSString *colorspace_name; NSString *catalog_name; NSString *color_name; BOOL is_clear; DESTROY(self); // Version 1 [aDecoder decodeValueOfObjCType: @encode(float) at: &red]; [aDecoder decodeValueOfObjCType: @encode(float) at: &green]; [aDecoder decodeValueOfObjCType: @encode(float) at: &blue]; [aDecoder decodeValueOfObjCType: @encode(float) at: &alpha]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &is_clear]; // Version 2 [aDecoder decodeValueOfObjCType: @encode(id) at: &colorspace_name]; [aDecoder decodeValueOfObjCType: @encode(id) at: &catalog_name]; [aDecoder decodeValueOfObjCType: @encode(id) at: &color_name]; [aDecoder decodeValueOfObjCType: @encode(float) at: &cyan]; [aDecoder decodeValueOfObjCType: @encode(float) at: &magenta]; [aDecoder decodeValueOfObjCType: @encode(float) at: &yellow]; [aDecoder decodeValueOfObjCType: @encode(float) at: &black]; [aDecoder decodeValueOfObjCType: @encode(float) at: &hue]; [aDecoder decodeValueOfObjCType: @encode(float) at: &saturation]; [aDecoder decodeValueOfObjCType: @encode(float) at: &brightness]; [aDecoder decodeValueOfObjCType: @encode(float) at: &white]; [aDecoder decodeValueOfObjCType: @encode(int) at: &active_component]; [aDecoder decodeValueOfObjCType: @encode(int) at: &valid_components]; if ([colorspace_name isEqualToString: @"NSDeviceCMYKColorSpace"]) { self = [NSColorClass colorWithDeviceCyan: cyan magenta: magenta yellow: yellow black: black alpha: alpha]; } else if ([colorspace_name isEqualToString: @"NSDeviceWhiteColorSpace"]) { self = [NSColorClass colorWithDeviceWhite: white alpha: alpha]; } else if ([colorspace_name isEqualToString: @"NSCalibratedWhiteColorSpace"]) { self = [NSColorClass colorWithCalibratedWhite:white alpha: alpha]; } else if ([colorspace_name isEqualToString: @"NSDeviceRGBColorSpace"]) { self = [NSColorClass colorWithDeviceRed: red green: green blue: blue alpha: alpha]; } else if ([colorspace_name isEqualToString: @"NSCalibratedRGBColorSpace"]) { self = [NSColorClass colorWithCalibratedRed: red green: green blue: blue alpha: alpha]; } else if ([colorspace_name isEqualToString: @"NSNamedColorSpace"]) { self = [NSColorClass colorWithCatalogName: catalog_name colorName: color_name]; } return RETAIN(self); } else { NSString *csName = [aDecoder decodeObject]; RELEASE(self); if ([csName isEqualToString: @"NSDeviceCMYKColorSpace"]) { self = [GSDeviceCMYKColor alloc]; } else if ([csName isEqualToString: @"NSDeviceRGBColorSpace"]) { self = [GSDeviceRGBColor alloc]; } else if ([csName isEqualToString: @"NSDeviceWhiteColorSpace"]) { self = [GSDeviceWhiteColor alloc]; } else if ([csName isEqualToString: @"NSCalibratedWhiteColorSpace"]) { self = [GSCalibratedWhiteColor alloc]; } else if ([csName isEqualToString: @"NSCalibratedRGBColorSpace"]) { self = [GSCalibratedRGBColor alloc]; } else if ([csName isEqualToString: @"NSNamedColorSpace"]) { self = [GSNamedColor alloc]; } else { NSLog(@"Unknown colorspace name in decoded color"); return nil; } return [self initWithCoder: aDecoder]; } } @end // // Private methods // @implementation NSColor (GNUstepPrivate) + (NSColor*) colorFromString: (NSString*)str { if ([str hasPrefix: @"{"]) { NSDictionary *dict; NSString *space; CGFloat alpha; dict = [str propertyList]; if (dict == nil) return nil; if ((space = [dict objectForKey: @"ColorSpace"]) == nil) return nil; str = [dict objectForKey: @"Alpha"]; if (str == nil || [str isEqualToString: @""]) { alpha = 1.0; } else { alpha = [str doubleValue]; } if ([space isEqual: NSCalibratedWhiteColorSpace]) { CGFloat white = [[dict objectForKey: @"W"] doubleValue]; return [self colorWithCalibratedWhite: white alpha: alpha]; } if ([space isEqual: NSCalibratedBlackColorSpace]) { CGFloat white = [[dict objectForKey: @"W"] doubleValue]; return [self colorWithCalibratedWhite: white alpha: alpha]; } if ([space isEqual: NSCalibratedRGBColorSpace]) { if ([dict objectForKey: @"H"] != nil) { CGFloat hue = [[dict objectForKey: @"H"] doubleValue]; CGFloat saturation = [[dict objectForKey: @"S"] doubleValue]; CGFloat brightness = [[dict objectForKey: @"B"] doubleValue]; return [self colorWithCalibratedHue: hue saturation: saturation brightness: brightness alpha: alpha]; } else { CGFloat red = [[dict objectForKey: @"R"] doubleValue]; CGFloat green = [[dict objectForKey: @"G"] doubleValue]; CGFloat blue = [[dict objectForKey: @"B"] doubleValue]; return [self colorWithCalibratedRed: red green: green blue: blue alpha: alpha]; } } if ([space isEqual: NSDeviceCMYKColorSpace]) { CGFloat cyan = [[dict objectForKey: @"C"] doubleValue]; CGFloat magenta = [[dict objectForKey: @"M"] doubleValue]; CGFloat yellow = [[dict objectForKey: @"Y"] doubleValue]; CGFloat black = [[dict objectForKey: @"B"] doubleValue]; return [self colorWithDeviceCyan: cyan magenta: magenta yellow: yellow black: black alpha: alpha]; } if ([space isEqual: NSNamedColorSpace]) { NSString *cat = [dict objectForKey: @"Catalog"]; NSString *col = [dict objectForKey: @"Color"]; return [self colorWithCatalogName: cat colorName: col]; } } else if (str != nil) { double r, g, b; NSScanner *scanner = [[NSScanner alloc] initWithString: str]; if ([scanner scanDouble: &r] && [scanner scanDouble: &g] && [scanner scanDouble: &b] && [scanner isAtEnd]) { RELEASE(scanner); return [self colorWithCalibratedRed: r green: g blue: b alpha: 1.0]; } RELEASE(scanner); } return nil; } /* * Go through all the names of system colors - for each color where * there is a value in the defaults database, see if the current * value of the color differs from the old one. * Where there is a difference, update the color strings dictionary * and update the system colors list to contain the new color. * Finally, issue a notification if appropriate. */ + (void) defaultsDidChange: (NSNotification*)notification { NSUserDefaults *defs; NSEnumerator *enumerator; NSString *key; BOOL didChange = NO; defs = [NSUserDefaults standardUserDefaults]; enumerator = [colorStrings keyEnumerator]; while ((key = [enumerator nextObject]) != nil) { NSString *def = [[defs objectForKey: key] description]; if (def != nil) { NSColor *old = [systemColors colorWithKey: key]; NSColor *color = [NSColor colorFromString: def]; if (color == nil) { NSLog(@"System color '%@' has bad string rep - '%@'\n", key, def); } else if ([color isEqual: old] == NO) { didChange = YES; [colorStrings setObject: def forKey: key]; [systemColors setColor: color forKey: key]; // Refresh the cache for this named colour [[systemDict objectForKey: key] recache]; } } } if (didChange) { [[NSNotificationCenter defaultCenter] postNotificationName: NSSystemColorsDidChangeNotification object: nil]; } } /* * Handle activation of a new theme ... look for a 'System' color list * in the theme bundle and use it instead of the default system color * list if it is present. */ + (void) themeDidActivate: (NSNotification*)notification { GSTheme *theme = [notification object]; NSColorList *list = [theme colors]; NSEnumerator *enumerator; NSString *name; if (list == nil) { list = defaultSystemColors; } NSAssert([[list name] isEqual: @"System"], NSInvalidArgumentException); [NSColorList _setThemeSystemColorList: list]; /* We always update the system dictionary and send a notification, since * the theme may have given us a pre-existing color list, but have changed * one or more of the colors in it. */ list = [NSColorList colorListNamed: @"System"]; ASSIGN(systemColors, list); enumerator = [systemDict keyEnumerator]; while ((name = [enumerator nextObject]) != nil) { [[systemDict objectForKey: name] recache]; } [[NSNotificationCenter defaultCenter] postNotificationName: NSSystemColorsDidChangeNotification object: nil]; } @end // Named colours @implementation GSNamedColor static NSMutableDictionary *namedColors = nil; static NSRecursiveLock *namedColorLock = nil; + (void) initialize { namedColorLock = [NSRecursiveLock new]; namedColors = [NSMutableDictionary new]; } - (NSColor*) initWithCatalogName: (NSString *)listName colorName: (NSString *)colorName { NSMutableDictionary *d; NSColor *c; _catalog_name = [listName copy]; _color_name = [colorName copy]; [namedColorLock lock]; d = [namedColors objectForKey: _catalog_name]; if (d == nil) { d = [NSMutableDictionary new]; [namedColors setObject: d forKey: _catalog_name]; [d release]; } c = [d objectForKey: _color_name]; if (c == nil) { [d setObject: self forKey: _color_name]; } else { [self release]; self = (GSNamedColor*)[c retain]; } [namedColorLock unlock]; return self; } - (void) dealloc { RELEASE(_catalog_name); RELEASE(_color_name); RELEASE(_cached_name_space); RELEASE(_cached_color); [super dealloc]; } - (NSString *) colorSpaceName { return NSNamedColorSpace; } - (id) copyWithZone: (NSZone*)aZone { return RETAIN(self); } - (NSString*) description { NSMutableString *desc; /* * We encode information in a dictionary * format with meaningful keys. */ desc = [NSMutableString stringWithCapacity: 128]; [desc appendFormat: @"{ ColorSpace = \"%@\";", [self colorSpaceName]]; [desc appendFormat: @" Catalog = \"%@\";", _catalog_name]; [desc appendFormat: @" Color = \"%@\"; }", _color_name]; return desc; } - (NSString *) catalogNameComponent { return _catalog_name; } - (NSString *) colorNameComponent { return _color_name; } - (NSString *) localizedCatalogNameComponent { // FIXME: How do we localize? return NSLocalizedString(_catalog_name, @"colour list name"); } - (NSString *) localizedColorNameComponent { // FIXME: How do we localize? return NSLocalizedString(_color_name, @"colour name"); } - (NSUInteger) hash { return [_catalog_name hash] + [_color_name hash]; } - (BOOL) isEqual: (id)other { if (other == self) return YES; if ([other isKindOfClass: [self class]] == NO || [[other catalogNameComponent] isEqualToString: _catalog_name] == NO || [[other colorNameComponent] isEqualToString: _color_name] == NO) { return NO; } return YES; } - (NSColor*) colorUsingColorSpaceName: (NSString *)colorSpace device: (NSDictionary *)deviceDescription { NSColorList *list; NSColor *real; if (colorSpace == nil) { if (deviceDescription != nil) colorSpace = [deviceDescription objectForKey: NSDeviceColorSpaceName]; // FIXME: If the deviceDescription is nil, we should get it from the // current view or printer if (colorSpace == nil) colorSpace = NSCalibratedRGBColorSpace; } if ([colorSpace isEqualToString: [self colorSpaceName]]) { return self; } // Is there a cache hit? // FIXME How would we detect that the cache has become invalid by a // change to the colour list? [namedColorLock lock]; if (NO == [colorSpace isEqualToString: _cached_name_space]) { list = [NSColorList colorListNamed: _catalog_name]; real = [list colorWithKey: _color_name]; ASSIGN(_cached_color, [real colorUsingColorSpaceName: colorSpace device: deviceDescription]); ASSIGN(_cached_name_space, colorSpace); } real = [[_cached_color retain] autorelease]; [namedColorLock unlock]; return real; } - (void) recache { [namedColorLock lock]; DESTROY(_cached_name_space); DESTROY(_cached_color); [namedColorLock unlock]; } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { [aCoder encodeInt: 6 forKey: @"NSColorSpace"]; [aCoder encodeObject: _catalog_name forKey: @"NSCatalogName"]; [aCoder encodeObject: _color_name forKey: @"NSColorName"]; } else { [aCoder encodeObject: [self colorSpaceName]]; [aCoder encodeObject: _catalog_name]; [aCoder encodeObject: _color_name]; } } - (id) initWithCoder: (NSCoder*)aDecoder { NSString *listName; NSString *colorName; listName = [aDecoder decodeObject]; colorName = [aDecoder decodeObject]; return [self initWithCatalogName: listName colorName: colorName]; } @end // Grayscale colours @implementation GSWhiteColor - (CGFloat) alphaComponent { return _alpha_component; } - (CGFloat) whiteComponent { return _white_component; } - (void) getComponents: (CGFloat *)components; { components[0] = _white_component; components[1] = _alpha_component; } - (NSInteger) numberOfComponents { return 2; } - (NSString*) description { NSMutableString *desc; /* * We encode information in a dictionary * format with meaningful keys. */ desc = [NSMutableString stringWithCapacity: 128]; [desc appendFormat: @"{ ColorSpace = \"%@\";", [self colorSpaceName]]; [desc appendFormat: @" W = \"%g\";", (double)_white_component]; [desc appendFormat: @" Alpha = \"%g\"; }", (double)_alpha_component]; return desc; } - (void) getWhite: (CGFloat*)white alpha: (CGFloat*)alpha { // Only set what is wanted if (white) *white = _white_component; if (alpha) *alpha = _alpha_component; } - (BOOL) isEqual: (id)other { if (other == self) return YES; if ([other isKindOfClass: [self class]] == NO || [other whiteComponent] != _white_component || [other alphaComponent] != _alpha_component) { return NO; } return YES; } - (NSColor*) colorWithAlphaComponent: (CGFloat)alpha { GSWhiteColor *aCopy; if (alpha < 0.0) alpha = 0.0; else if (alpha > 1.0) alpha = 1.0; if (alpha == _alpha_component) return self; aCopy = (GSWhiteColor*)NSCopyObject(self, 0, NSDefaultMallocZone()); if (aCopy) { aCopy->_alpha_component = alpha; } return AUTORELEASE(aCopy); } - (NSColor*) colorUsingColorSpaceName: (NSString *)colorSpace device: (NSDictionary *)deviceDescription { if (colorSpace == nil) { if (deviceDescription != nil) colorSpace = [deviceDescription objectForKey: NSDeviceColorSpaceName]; if (colorSpace == nil) colorSpace = NSCalibratedRGBColorSpace; } if ([colorSpace isEqualToString: [self colorSpaceName]]) { return self; } if ([colorSpace isEqualToString: NSNamedColorSpace]) { // FIXME: We cannot convert to named color space. return nil; } if ([colorSpace isEqualToString: NSDeviceWhiteColorSpace] || [colorSpace isEqualToString: NSDeviceBlackColorSpace]) { return [NSColor colorWithDeviceWhite: _white_component alpha: _alpha_component]; } if ([colorSpace isEqualToString: NSCalibratedWhiteColorSpace] || [colorSpace isEqualToString: NSCalibratedBlackColorSpace]) { return [NSColor colorWithCalibratedWhite: _white_component alpha: _alpha_component]; } if ([colorSpace isEqualToString: NSCalibratedRGBColorSpace]) { return [NSColor colorWithCalibratedRed: _white_component green: _white_component blue: _white_component alpha: _alpha_component]; } if ([colorSpace isEqualToString: NSDeviceRGBColorSpace]) { return [NSColor colorWithDeviceRed: _white_component green: _white_component blue: _white_component alpha: _alpha_component]; } if ([colorSpace isEqualToString: NSDeviceCMYKColorSpace]) { return [NSColor colorWithDeviceCyan: 0.0 magenta: 0.0 yellow: 0.0 black: 1.0 - _white_component alpha: _alpha_component]; } return nil; } - (void) set { // This should be in GSDeviceWhiteColor, but is here to keep old code working NSDebugLLog(@"NSColor", @"Gray %g\n", (double)_white_component); PSsetgray(_white_component); // Should we check the ignore flag here? PSsetalpha(_alpha_component); } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { NSString *str; if ([[self colorSpaceName] isEqualToString: NSCalibratedWhiteColorSpace]) { [aCoder encodeInt: 3 forKey: @"NSColorSpace"]; } else { [aCoder encodeInt: 4 forKey: @"NSColorSpace"]; } if (_alpha_component == 1.0) { str = [[NSString alloc] initWithFormat: @"%g", (double)_white_component]; } else { str = [[NSString alloc] initWithFormat: @"%g %g", (double)_white_component, (double)_alpha_component]; } [aCoder encodeBytes: (const uint8_t*)[str cString] length: [str cStringLength] forKey: @"NSWhite"]; RELEASE(str); } else { float white = _white_component; float alpha = _alpha_component; [aCoder encodeObject: [self colorSpaceName]]; [aCoder encodeValueOfObjCType: @encode(float) at: &white]; [aCoder encodeValueOfObjCType: @encode(float) at: &alpha]; } } - (id) initWithCoder: (NSCoder*)aDecoder { float white, alpha; [aDecoder decodeValueOfObjCType: @encode(float) at: &white]; [aDecoder decodeValueOfObjCType: @encode(float) at: &alpha]; _white_component = white; _alpha_component = alpha; return self; } @end @implementation GSDeviceWhiteColor - (NSString *) colorSpaceName { return NSDeviceWhiteColorSpace; } - (NSColor*) initWithDeviceWhite: (CGFloat)white alpha: (CGFloat)alpha { if (white < 0.0) white = 0.0; else if (white > 1.0) white = 1.0; _white_component = white; if (alpha < 0.0) alpha = 0.0; else if (alpha > 1.0) alpha = 1.0; _alpha_component = alpha; return self; } @end @implementation GSCalibratedWhiteColor - (NSString *) colorSpaceName { return NSCalibratedWhiteColorSpace; } - (NSColor*) initWithCalibratedWhite: (CGFloat)white alpha: (CGFloat)alpha { if (white < 0.0) white = 0.0; else if (white > 1.0) white = 1.0; _white_component = white; if (alpha < 0.0) alpha = 0.0; else if (alpha > 1.0) alpha = 1.0; _alpha_component = alpha; return self; } @end @implementation GSDeviceCMYKColor - (NSColor*) initWithDeviceCyan: (CGFloat)cyan magenta: (CGFloat)magenta yellow: (CGFloat)yellow black: (CGFloat)black alpha: (CGFloat)alpha { if (cyan < 0.0) cyan = 0.0; else if (cyan > 1.0) cyan = 1.0; _cyan_component = cyan; if (magenta < 0.0) magenta = 0.0; else if (magenta > 1.0) magenta = 1.0; _magenta_component = magenta; if (yellow < 0.0) yellow = 0.0; else if (yellow > 1.0) yellow = 1.0; _yellow_component = yellow; if (black < 0.0) black = 0.0; else if (black > 1.0) black = 1.0; _black_component = black; if (alpha < 0.0) alpha = 0.0; else if (alpha > 1.0) alpha = 1.0; _alpha_component = alpha; return self; } - (NSString *) colorSpaceName { return NSDeviceCMYKColorSpace; } - (CGFloat) alphaComponent { return _alpha_component; } - (CGFloat) blackComponent { return _black_component; } - (CGFloat) cyanComponent { return _cyan_component; } - (CGFloat) magentaComponent { return _magenta_component; } - (CGFloat) yellowComponent { return _yellow_component; } - (void) getComponents: (CGFloat *)components; { components[0] = _cyan_component; components[1] = _magenta_component; components[2] = _yellow_component; components[3] = _black_component; components[4] = _alpha_component; } - (NSInteger) numberOfComponents { return 5; } - (NSString*) description { NSMutableString *desc; /* * We encode information in a dictionary * format with meaningful keys. */ desc = [NSMutableString stringWithCapacity: 128]; [desc appendFormat: @"{ ColorSpace = \"%@\";", [self colorSpaceName]]; [desc appendFormat: @" C = \"%g\";", (double)_cyan_component]; [desc appendFormat: @" M = \"%g\";", (double)_magenta_component]; [desc appendFormat: @" Y = \"%g\";", (double)_yellow_component]; [desc appendFormat: @" K = \"%g\";", (double)_black_component]; [desc appendFormat: @" Alpha = \"%g\"; }", (double)_alpha_component]; return desc; } - (void) getCyan: (CGFloat*)cyan magenta: (CGFloat*)magenta yellow: (CGFloat*)yellow black: (CGFloat*)black alpha: (CGFloat*)alpha { // Only set what is wanted if (cyan) *cyan = _cyan_component; if (magenta) *magenta = _magenta_component; if (yellow) *yellow = _yellow_component; if (black) *black = _black_component; if (alpha) *alpha = _alpha_component; } - (BOOL) isEqual: (id)other { if (other == self) return YES; if ([other isKindOfClass: [self class]] == NO || [other cyanComponent] != _cyan_component || [other magentaComponent] != _magenta_component || [other yellowComponent] != _yellow_component || [other blackComponent] != _black_component || [other alphaComponent] != _alpha_component) { return NO; } return YES; } - (NSColor*) colorWithAlphaComponent: (CGFloat)alpha { GSDeviceCMYKColor *aCopy; if (alpha < 0.0) alpha = 0.0; else if (alpha > 1.0) alpha = 1.0; if (alpha == _alpha_component) return self; aCopy = (GSDeviceCMYKColor*)NSCopyObject(self, 0, NSDefaultMallocZone()); if (aCopy) { aCopy->_alpha_component = alpha; } return AUTORELEASE(aCopy); } - (NSColor*) colorUsingColorSpaceName: (NSString *)colorSpace device: (NSDictionary *)deviceDescription { if (colorSpace == nil) { if (deviceDescription != nil) colorSpace = [deviceDescription objectForKey: NSDeviceColorSpaceName]; if (colorSpace == nil) colorSpace = NSCalibratedRGBColorSpace; } if ([colorSpace isEqualToString: [self colorSpaceName]]) { return self; } if ([colorSpace isEqualToString: NSNamedColorSpace]) { // FIXME: We cannot convert to named color space. return nil; } if ([colorSpace isEqualToString: NSCalibratedRGBColorSpace]) { double c = _cyan_component; double m = _magenta_component; double y = _yellow_component; double white = 1 - _black_component; return [NSColor colorWithCalibratedRed: (c > white ? 0 : white - c) green: (m > white ? 0 : white - m) blue: (y > white ? 0 : white - y) alpha: _alpha_component]; } if ([colorSpace isEqualToString: NSDeviceRGBColorSpace]) { double c = _cyan_component; double m = _magenta_component; double y = _yellow_component; double white = 1 - _black_component; return [NSColor colorWithDeviceRed: (c > white ? 0 : white - c) green: (m > white ? 0 : white - m) blue: (y > white ? 0 : white - y) alpha: _alpha_component]; } if ([colorSpace isEqualToString: NSCalibratedWhiteColorSpace] || [colorSpace isEqualToString: NSCalibratedBlackColorSpace]) { return [NSColor colorWithCalibratedWhite: 1 - _black_component - (_cyan_component + _magenta_component + _yellow_component)/3 alpha: _alpha_component]; } if ([colorSpace isEqualToString: NSDeviceWhiteColorSpace] || [colorSpace isEqualToString: NSDeviceBlackColorSpace]) { return [NSColor colorWithDeviceWhite: 1 - _black_component - (_cyan_component + _magenta_component + _yellow_component)/3 alpha: _alpha_component]; } return nil; } - (void) set { NSDebugLLog(@"NSColor", @"CMYK %g %g %g %g\n", (double)_cyan_component, (double)_magenta_component, (double)_yellow_component, (double)_black_component); PSsetcmykcolor(_cyan_component, _magenta_component, _yellow_component, _black_component); // Should we check the ignore flag here? PSsetalpha(_alpha_component); } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { NSString *str; [aCoder encodeInt: 5 forKey: @"NSColorSpace"]; if (_alpha_component == 1.0) { str = [[NSString alloc] initWithFormat: @"%g %g %g %g", (double)_cyan_component, (double)_magenta_component, (double)_yellow_component, (double)_black_component]; } else { str = [[NSString alloc] initWithFormat: @"%g %g %g %g %g", (double)_cyan_component, (double)_magenta_component, (double)_yellow_component, (double)_black_component, (double)_alpha_component]; } [aCoder encodeBytes: (const uint8_t*)[str cString] length: [str cStringLength] forKey: @"NSCYMK"]; RELEASE(str); } else { float c = _cyan_component; float m = _magenta_component; float y = _yellow_component; float k = _black_component; float a = _alpha_component; [aCoder encodeObject: [self colorSpaceName]]; [aCoder encodeValueOfObjCType: @encode(float) at: &c]; [aCoder encodeValueOfObjCType: @encode(float) at: &m]; [aCoder encodeValueOfObjCType: @encode(float) at: &y]; [aCoder encodeValueOfObjCType: @encode(float) at: &k]; [aCoder encodeValueOfObjCType: @encode(float) at: &a]; } } - (id) initWithCoder: (NSCoder*)aDecoder { // FIXME: Implement keyed decoding! float c, m, y, k, a; [aDecoder decodeValueOfObjCType: @encode(float) at: &c]; [aDecoder decodeValueOfObjCType: @encode(float) at: &m]; [aDecoder decodeValueOfObjCType: @encode(float) at: &y]; [aDecoder decodeValueOfObjCType: @encode(float) at: &k]; [aDecoder decodeValueOfObjCType: @encode(float) at: &a]; _cyan_component = c; _magenta_component = m; _yellow_component = y; _black_component = k; _alpha_component = a; return self; } @end // RGB/HSB colours @implementation GSRGBColor - (CGFloat) alphaComponent { return _alpha_component; } - (CGFloat) redComponent { return _red_component; } - (CGFloat) greenComponent { return _green_component; } - (CGFloat) blueComponent { return _blue_component; } - (CGFloat) hueComponent { return _hue_component; } - (CGFloat) saturationComponent { return _saturation_component; } - (CGFloat) brightnessComponent { return _brightness_component; } - (void) getComponents: (CGFloat *)components; { components[0] = _red_component; components[1] = _green_component; components[2] = _blue_component; components[3] = _alpha_component; } - (NSInteger) numberOfComponents { return 4; } - (void) getHue: (CGFloat*)hue saturation: (CGFloat*)saturation brightness: (CGFloat*)brightness alpha: (CGFloat*)alpha { // Only set what is wanted if (hue) *hue = _hue_component; if (saturation) *saturation = _saturation_component; if (brightness) *brightness = _brightness_component; if (alpha) *alpha = _alpha_component; } - (void) getRed: (CGFloat*)red green: (CGFloat*)green blue: (CGFloat*)blue alpha: (CGFloat*)alpha { // Only set what is wanted if (red) *red = _red_component; if (green) *green = _green_component; if (blue) *blue = _blue_component; if (alpha) *alpha = _alpha_component; } - (BOOL) isEqual: (id)other { if (other == self) return YES; if ([other isKindOfClass: [self class]] == NO || [other redComponent] != _red_component || [other greenComponent] != _green_component || [other blueComponent] != _blue_component || [other alphaComponent] != _alpha_component) { return NO; } return YES; } - (NSColor*) colorWithAlphaComponent: (CGFloat)alpha { GSRGBColor *aCopy; if (alpha < 0.0) alpha = 0.0; else if (alpha > 1.0) alpha = 1.0; if (alpha == _alpha_component) return self; aCopy = (GSRGBColor*)NSCopyObject(self, 0, NSDefaultMallocZone()); if (aCopy) { aCopy->_alpha_component = alpha; } return AUTORELEASE(aCopy); } - (NSColor*) colorUsingColorSpaceName: (NSString *)colorSpace device: (NSDictionary *)deviceDescription { if (colorSpace == nil) { if (deviceDescription != nil) colorSpace = [deviceDescription objectForKey: NSDeviceColorSpaceName]; if (colorSpace == nil) colorSpace = NSCalibratedRGBColorSpace; } if ([colorSpace isEqualToString: [self colorSpaceName]]) { return self; } if ([colorSpace isEqualToString: NSNamedColorSpace]) { // FIXME: We cannot convert to named color space. return nil; } if ([colorSpace isEqualToString: NSCalibratedRGBColorSpace]) { return [NSColor colorWithCalibratedRed: _red_component green: _green_component blue: _blue_component alpha: _alpha_component]; } if ([colorSpace isEqualToString: NSDeviceRGBColorSpace]) { return [NSColor colorWithDeviceRed: _red_component green: _green_component blue: _blue_component alpha: _alpha_component]; } if ([colorSpace isEqualToString: NSCalibratedWhiteColorSpace] || [colorSpace isEqualToString: NSCalibratedBlackColorSpace]) { return [NSColor colorWithCalibratedWhite: (_red_component + _green_component + _blue_component)/3 alpha: _alpha_component]; } if ([colorSpace isEqualToString: NSDeviceWhiteColorSpace] || [colorSpace isEqualToString: NSDeviceBlackColorSpace]) { return [NSColor colorWithDeviceWhite: (_red_component + _green_component + _blue_component)/3 alpha: _alpha_component]; } if ([colorSpace isEqualToString: NSDeviceCMYKColorSpace]) { return [NSColor colorWithDeviceCyan: 1 - _red_component magenta: 1 - _green_component yellow: 1 - _blue_component black: 0.0 alpha: _alpha_component]; } return nil; } - (NSString*) description { NSMutableString *desc; /* * For a simple RGB color without alpha, we use a shorthand description * consisting of the three component values in a quoted string. */ if (_alpha_component == 1.0) return [NSString stringWithFormat: @"%g %g %g", (double)_red_component, (double)_green_component, (double)_blue_component]; /* * For more complex color values - we encode information in a dictionary * format with meaningful keys. */ desc = [NSMutableString stringWithCapacity: 128]; [desc appendFormat: @"{ ColorSpace = \"%@\";", [self colorSpaceName]]; [desc appendFormat: @" R = \"%g\";", (double)_red_component]; [desc appendFormat: @" G = \"%g\";", (double)_green_component]; [desc appendFormat: @" B = \"%g\";", (double)_blue_component]; [desc appendFormat: @" Alpha = \"%g\"; }", (double)_alpha_component]; return desc; } - (void) set { /* This should only be in GSDeviceRGBColor, * but is here to keep old code working. */ NSDebugLLog(@"NSColor", @"RGB %g %g %g\n", (double)_red_component, (double)_green_component, (double)_blue_component); PSsetrgbcolor(_red_component, _green_component, _blue_component); // Should we check the ignore flag here? PSsetalpha(_alpha_component); } - (void) setFill { int num = [self numberOfComponents]; CGFloat values[num]; NSGraphicsContext *ctxt = GSCurrentContext(); [ctxt GSSetFillColorspace: [self colorSpace]]; [self getComponents: values]; [ctxt GSSetFillColor: values]; } - (void) setStroke { int num = [self numberOfComponents]; CGFloat values[num]; NSGraphicsContext *ctxt = GSCurrentContext(); [ctxt GSSetStrokeColorspace: [self colorSpace]]; [self getComponents: values]; [ctxt GSSetStrokeColor: values]; } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { NSString *str; if ([[self colorSpaceName] isEqualToString: NSCalibratedRGBColorSpace]) { [aCoder encodeInt: 1 forKey: @"NSColorSpace"]; } else { [aCoder encodeInt: 2 forKey: @"NSColorSpace"]; } if (_alpha_component == 1.0) { str = [[NSString alloc] initWithFormat: @"%g %g %g", (double)_red_component, (double)_green_component, (double)_blue_component]; } else { str = [[NSString alloc] initWithFormat: @"%g %g %g %g", (double)_red_component, (double)_green_component, (double)_blue_component, (double)_alpha_component]; } [aCoder encodeBytes: (const uint8_t*)[str cString] length: [str cStringLength] forKey: @"NSRGB"]; RELEASE(str); } else { float red = _red_component; float green = _green_component; float blue = _blue_component; float hue = _hue_component; float saturation = _saturation_component; float brightness = _brightness_component; float alpha = _alpha_component; [aCoder encodeObject: [self colorSpaceName]]; [aCoder encodeValueOfObjCType: @encode(float) at: &red]; [aCoder encodeValueOfObjCType: @encode(float) at: &green]; [aCoder encodeValueOfObjCType: @encode(float) at: &blue]; [aCoder encodeValueOfObjCType: @encode(float) at: &hue]; [aCoder encodeValueOfObjCType: @encode(float) at: &saturation]; [aCoder encodeValueOfObjCType: @encode(float) at: &brightness]; [aCoder encodeValueOfObjCType: @encode(float) at: &alpha]; } } - (id) initWithCoder: (NSCoder*)aDecoder { float red, green, blue, hue, saturation, brightness, alpha; [aDecoder decodeValueOfObjCType: @encode(float) at: &red]; [aDecoder decodeValueOfObjCType: @encode(float) at: &green]; [aDecoder decodeValueOfObjCType: @encode(float) at: &blue]; [aDecoder decodeValueOfObjCType: @encode(float) at: &hue]; [aDecoder decodeValueOfObjCType: @encode(float) at: &saturation]; [aDecoder decodeValueOfObjCType: @encode(float) at: &brightness]; [aDecoder decodeValueOfObjCType: @encode(float) at: &alpha]; _red_component = red; _green_component = green; _blue_component = blue; _hue_component = hue; _saturation_component = saturation; _brightness_component = brightness; _alpha_component = alpha; return self; } @end @implementation GSDeviceRGBColor - (NSString *) colorSpaceName { return NSDeviceRGBColorSpace; } - (NSColor*) initWithDeviceRed: (CGFloat)red green: (CGFloat)green blue: (CGFloat)blue alpha: (CGFloat)alpha { if (red < 0.0) red = 0.0; else if (red > 1.0) red = 1.0; _red_component = red; if (green < 0.0) green = 0.0; else if (green > 1.0) green = 1.0; _green_component = green; if (blue < 0.0) blue = 0.0; else if (blue > 1.0) blue = 1.0; _blue_component = blue; { CGFloat r = _red_component; CGFloat g = _green_component; CGFloat b = _blue_component; if (r == g && r == b) { _hue_component = 0; _saturation_component = 0; _brightness_component = r; } else { double H; double V; double Temp; double diff; V = (r > g ? r : g); V = (b > V ? b : V); Temp = (r < g ? r : g); Temp = (b < Temp ? b : Temp); diff = V - Temp; if (V == r) { H = (g - b)/diff; } else if (V == g) { H = (b - r)/diff + 2; } else { H = (r - g)/diff + 4; } if (H < 0) { H += 6; } _hue_component = H/6; _saturation_component = diff/V; _brightness_component = V; } } if (alpha < 0.0) alpha = 0.0; else if (alpha > 1.0) alpha = 1.0; _alpha_component = alpha; return self; } - (NSColor*) initWithDeviceHue: (CGFloat)hue saturation: (CGFloat)saturation brightness: (CGFloat)brightness alpha: (CGFloat)alpha; { if (hue < 0.0) hue = 0.0; else if (hue > 1.0) hue = 1.0; _hue_component = hue; if (saturation < 0.0) saturation = 0.0; else if (saturation > 1.0) saturation = 1.0; _saturation_component = saturation; if (brightness < 0.0) brightness = 0.0; else if (brightness > 1.0) brightness = 1.0; _brightness_component = brightness; { int I = (int)(hue * 6); double V = brightness; double S = saturation; double F = (hue * 6) - I; double M = V * (1 - S); double N = V * (1 - S * F); double K = M - N + V; double R, G, B; switch (I) { default: R = V; G = K; B = M; break; case 1: R = N; G = V; B = M; break; case 2: R = M; G = V; B = K; break; case 3: R = M; G = N; B = V; break; case 4: R = K; G = M; B = V; break; case 5: R = V; G = M; B = N; break; } _red_component = (CGFloat)R; _green_component = (CGFloat)G; _blue_component = (CGFloat)B; } if (alpha < 0.0) alpha = 0.0; else if (alpha > 1.0) alpha = 1.0; _alpha_component = alpha; return self; } @end @implementation GSCalibratedRGBColor - (NSString *) colorSpaceName { return NSCalibratedRGBColorSpace; } - (NSColor*) initWithCalibratedRed: (CGFloat)red green: (CGFloat)green blue: (CGFloat)blue alpha: (CGFloat)alpha { if (red < 0.0) red = 0.0; else if (red > 1.0) red = 1.0; _red_component = red; if (green < 0.0) green = 0.0; else if (green > 1.0) green = 1.0; _green_component = green; if (blue < 0.0) blue = 0.0; else if (blue > 1.0) blue = 1.0; _blue_component = blue; { CGFloat r = _red_component; CGFloat g = _green_component; CGFloat b = _blue_component; if (r == g && r == b) { _hue_component = 0; _saturation_component = 0; _brightness_component = r; } else { double H; double V; double Temp; double diff; V = (r > g ? r : g); V = (b > V ? b : V); Temp = (r < g ? r : g); Temp = (b < Temp ? b : Temp); diff = V - Temp; if (V == r) { H = (g - b)/diff; } else if (V == g) { H = (b - r)/diff + 2; } else { H = (r - g)/diff + 4; } if (H < 0) { H += 6; } _hue_component = H/6; _saturation_component = diff/V; _brightness_component = V; } } if (alpha < 0.0) alpha = 0.0; else if (alpha > 1.0) alpha = 1.0; _alpha_component = alpha; return self; } - (NSColor*) initWithCalibratedHue: (CGFloat)hue saturation: (CGFloat)saturation brightness: (CGFloat)brightness alpha: (CGFloat)alpha; { if (hue < 0.0) hue = 0.0; else if (hue > 1.0) hue = 1.0; _hue_component = hue; if (saturation < 0.0) saturation = 0.0; else if (saturation > 1.0) saturation = 1.0; _saturation_component = saturation; if (brightness < 0.0) brightness = 0.0; else if (brightness > 1.0) brightness = 1.0; _brightness_component = brightness; { int I = (int)(hue * 6); double V = brightness; double S = saturation; double F = (hue * 6) - I; double M = V * (1 - S); double N = V * (1 - S * F); double K = M - N + V; double R, G, B; switch (I) { default: R = V; G = K; B = M; break; case 1: R = N; G = V; B = M; break; case 2: R = M; G = V; B = K; break; case 3: R = M; G = N; B = V; break; case 4: R = K; G = M; B = V; break; case 5: R = V; G = M; B = N; break; } _red_component = (CGFloat)R; _green_component = (CGFloat)G; _blue_component = (CGFloat)B; } if (alpha < 0.0) alpha = 0.0; else if (alpha > 1.0) alpha = 1.0; _alpha_component = alpha; return self; } @end @implementation GSPatternColor - (NSColor*) initWithPatternImage: (NSImage*) pattern; { ASSIGN(_pattern, pattern); return self; } - (void) dealloc { RELEASE(_pattern); [super dealloc]; } - (NSString *) colorSpaceName { return NSPatternColorSpace; } - (NSImage*) patternImage { return _pattern; } - (NSString*) description { NSMutableString *desc; /* * We encode information in a dictionary * format with meaningful keys. */ desc = [NSMutableString stringWithCapacity: 128]; [desc appendFormat: @"{ ColorSpace = \"%@\";", [self colorSpaceName]]; [desc appendFormat: @" Pattern = \"%@\"; }", [_pattern description]]; return desc; } - (NSUInteger) hash { return [_pattern hash]; } - (BOOL) isEqual: (id)other { if (other == self) return YES; if ([other isKindOfClass: [self class]] == NO || [[other patternImage] isEqual: _pattern] == NO) { return NO; } return YES; } - (id) copyWithZone: (NSZone*)aZone { if (NSShouldRetainWithZone(self, aZone)) { return RETAIN(self); } else { GSPatternColor *aCopy = (GSPatternColor*)NSCopyObject(self, 0, aZone); aCopy->_pattern = [_pattern copyWithZone: aZone]; return aCopy; } } - (void) set { [GSCurrentContext() GSSetPatterColor: _pattern]; } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { [aCoder encodeInt: 10 forKey: @"NSColorSpace"]; [aCoder encodeObject: _pattern forKey: @"NSImage"]; } else { [aCoder encodeObject: [self colorSpaceName]]; [aCoder encodeObject: _pattern]; } } - (id) initWithCoder: (NSCoder*)aDecoder { [aDecoder decodeValueOfObjCType: @encode(id) at: &_pattern]; return self; } @end // // Implementation of the NSCoder additions // @implementation NSCoder (NSCoderAdditions) // // Converting an archived NXColor to an NSColor // - (NSColor*) decodeNXColor { // FIXME return nil; } @end gnustep-gui-0.24.0/Source/.cvsignore0000664000076500007650000000000510377004044017174 0ustar brains99brains99*obj gnustep-gui-0.24.0/Source/NSLayoutManager.m0000664000076500007650000025732712216150175020411 0ustar brains99brains99/* NSLayoutManager.m Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc. Author: Alexander Malmberg Date: November 2002 - February 2003 Parts based on the old NSLayoutManager.m: Author: Jonathan Gapen Date: July 1999 Author: Michael Hanni Date: August 1999 Author: Richard Frith-Macdonald Date: January 2001 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* TODO: document exact requirements on typesetting for this class Roughly: Line frag rects arranged in lines in which all line frag rects have same y-origin and height. Lines must not overlap vertically, and must be arranged with strictly increasing y-origin. Line frag rects go left->right, as do points inside line frag rects. "Nominally spaced", to this layout manager, is described at: http://wiki.gnustep.org/index.php/NominallySpacedGlyphs Lines are laid out as one unit. Ie. we never do layout for only a part of a line, or invalidate only some line frags in a line. Also, we assume that the limit of context on layout is the previous line. Thus, when we invalidate layout, we invalidate all lines with invalidated characters, and the line before the first invalidated line, and soft-invalidate everything after the last invalidated line. Consider: |... | |foo bar zot | |abcdefghij | |... | If we insert a space between the 'a' and the 'b' in "abcd...", the correct result is: |... | |foo bar zot a | |bcdefghij | |... | and to get this, we must invalidate the previous line. TODO: This is an important assumption, and the typesetter needs to make sure that it holds. I'm not entirely convinced that it holds for standard latin-text layout, but I haven't been able to come up with any counter-examples. If it turns out not to hold, we'll have to fix invalidation here (invalidate the entire paragraph? not good for performance, but correctness is more important), or change the typesetter behavior. Another assumption is that each text container will contain at least one line frag (unless there are no more glyphs to typeset). TODO: this doesn't hold for containers with 0 height or 0 width. need to test. rare case, though TODO: We often need to deal with the case where a glyph can't be typeset (because there's nowhere to typeset it, eg. all text containers are full). Need to figure out how to handle it. TODO: Don't do linear searches through the line frags if avoidable. Some cases are considerably more important than others, and should be fixed first. Remaining cases, highest priority first: -glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph: Used when selecting with the mouse, and called for every event. -characterIndexMoving:fromCharacterIndex:originalCharacterIndex:distance: Keyboard insertion point movement. Performance isn't important. */ #include #import #import #import #import "AppKit/NSAttributedString.h" #import "AppKit/NSBezierPath.h" #import "AppKit/NSColor.h" #import "AppKit/NSImage.h" #import "AppKit/NSKeyValueBinding.h" #import "AppKit/NSLayoutManager.h" #import "AppKit/NSParagraphStyle.h" #import "AppKit/NSRulerMarker.h" #import "AppKit/NSTextContainer.h" #import "AppKit/NSTextStorage.h" #import "AppKit/NSWindow.h" #import "AppKit/DPSOperators.h" #import "GNUstepGUI/GSLayoutManager_internal.h" #import "GSBindingHelpers.h" @interface NSLayoutManager (spelling) -(void) _drawSpellingState: (NSInteger)spellingState forGylphRange: (NSRange)range lineFragmentRect: (NSRect)fragmentRect lineFragmentGlyphRange: (NSRange)fragmentGlyphRange containerOrigin: (NSPoint)containerOrigin; @end @interface NSLayoutManager (LayoutHelpers) -(void) _doLayoutToContainer: (int)cindex point: (NSPoint)p; @end @implementation NSLayoutManager (LayoutHelpers) -(void) _doLayoutToContainer: (int)cindex point: (NSPoint)p { [self _doLayout]; } @end /** * Temporary attributes are implemented using an NSMutableAttributedString * stored in the _temporaryAttributes ivar. We only care about this attributed * string's attributes, not its characters, so to save space, * _temporaryAttributes is initialized with an instance of the following * NSMutableString subclass, which doesn't store any character data. * * WARNING ... it's an unofficial implementation detail that the * GSMutableAttributedString class creates it's internal storage by taking * a mutable copy of its initialisation argument, and we have a comment in * the source to warn about it. If we change the behavior here, we should * remove the warning comment from the source in base. */ @interface GSDummyMutableString : NSMutableString { NSUInteger _length; } - (id)initWithLength: (NSUInteger)aLength; @end /* Helper for searching for the line frag of a glyph. */ #define LINEFRAG_FOR_GLYPH(glyph) \ do { \ int lo, hi, mid; \ \ lf = tc->linefrags; \ for (lo = 0, hi = tc->num_linefrags - 1; lo < hi;) \ { \ mid = (lo + hi) / 2; \ if (lf[mid].pos > glyph) \ hi = mid - 1; \ else if (lf[mid].pos + lf[mid].length <= glyph) \ lo = mid + 1; \ else \ lo = hi = mid; \ } \ lf = &lf[lo]; \ i = lo; \ } while (0) @implementation NSLayoutManager (layout) -(NSPoint) locationForGlyphAtIndex: (NSUInteger)glyphIndex { NSRange r; NSPoint p; NSFont *f; NSUInteger i; r = [self rangeOfNominallySpacedGlyphsContainingIndex: glyphIndex startLocation: &p]; if (r.location == NSNotFound) { /* The glyph hasn't been typeset yet, probably because there isn't enough space in the text containers to fit it. */ return NSMakePoint(0, 0); } i = r.location; f = [self effectiveFontForGlyphAtIndex: i range: &r]; /* TODO: this is rather inefficient and doesn't deal with non-shown glyphs */ for (; i < glyphIndex; i++) { if (i == r.location + r.length) { f = [self effectiveFontForGlyphAtIndex: i range: &r]; } p.x += [f advancementForGlyph: [self glyphAtIndex: i]].width; } return p; } -(void) textContainerChangedTextView: (NSTextContainer *)aContainer { /* TODO: what do we do here? invalidate the displayed range for that container? necessary? */ int i; /* NSTextContainer will send the necessary messages to update the text view that was disconnected from us. */ for (i = 0; i < num_textcontainers; i++) { [[textcontainers[i].textContainer textView] _updateMultipleTextViews]; if (textcontainers[i].textContainer == aContainer) { [[aContainer textView] setNeedsDisplay: YES]; } } } -(NSRect *) rectArrayForGlyphRange: (NSRange)glyphRange withinSelectedGlyphRange: (NSRange)selGlyphRange inTextContainer: (NSTextContainer *)container rectCount: (NSUInteger *)rectCount { NSUInteger last; int i; textcontainer_t *tc; linefrag_t *lf; int num_rects; float x0, x1; NSRect r; *rectCount = 0; for (tc = textcontainers, i = 0; i < num_textcontainers; i++, tc++) if (tc->textContainer == container) break; //printf("container %i %@, %i+%i\n",i,tc->textContainer,tc->pos,tc->length); [self _doLayoutToGlyph: NSMaxRange(glyphRange) - 1]; //printf(" now %i+%i\n",tc->pos,tc->length); if (i == num_textcontainers) { if (i == num_textcontainers) NSLog(@"%s: invalid text container", __PRETTY_FUNCTION__); return NULL; } /* Silently clamp range to the text container. TODO: is this good? */ if (tc->pos > glyphRange.location) { if (tc->pos > NSMaxRange(glyphRange)) return NULL; glyphRange.length = NSMaxRange(glyphRange) - tc->pos; glyphRange.location = tc->pos; } if (tc->pos + tc->length < NSMaxRange(glyphRange)) { if (tc->pos + tc->length < glyphRange.location) return NULL; glyphRange.length = tc->pos + tc->length - glyphRange.location; } if (!glyphRange.length) { return NULL; } last = NSMaxRange(glyphRange); num_rects = 0; LINEFRAG_FOR_GLYPH(glyphRange.location); /* Main loop. Work through all line frag rects and build the array of rects. */ while (1) { /* Determine the starting x-coordinate for this line frag rect. */ if (lf->pos <= glyphRange.location) { /* The start index is inside the line frag rect, so we need to search through it to find the exact starting location. */ unsigned int i; int j; linefrag_point_t *lp; glyph_run_t *r; unsigned int gpos, cpos; for (j = 0, lp = lf->points; j < lf->num_points; j++, lp++) if (lp->pos + lp->length > glyphRange.location) break; NSAssert(j < lf->num_points, @"can't find starting point of glyph"); x0 = lp->p.x + lf->rect.origin.x; r = run_for_glyph_index(lp->pos, glyphs, &gpos, &cpos); i = lp->pos - gpos; while (i + gpos < glyphRange.location) { if (!r->glyphs[i].isNotShown && r->glyphs[i].g && r->glyphs[i].g != NSControlGlyph) { x0 += [r->font advancementForGlyph: r->glyphs[i].g].width; } GLYPH_STEP_FORWARD(r, i, gpos, cpos) } } else { /* The start index was before the this line frag, so the starting x-coordinate is the left edge of the line frag. */ x0 = NSMinX(lf->rect); } /* Determine the end x-coordinate for this line frag. */ if (lf->pos + lf->length > last) { /* The end index is inside the line frag, so we need to find the exact end location. */ NSUInteger i; int j; linefrag_point_t *lp; glyph_run_t *r; unsigned int gpos, cpos; /* At this point there is a glyph in our range that is in this line frag rect. If we're on the first line frag rect, it's trivially true. If not, the check before the lf++; ensures it. */ for (j = 0, lp = lf->points; j < lf->num_points; j++, lp++) if (lp->pos + lp->length > last) break; NSAssert(j < lf->num_points, @"can't find starting point of glyph"); x1 = lp->p.x + lf->rect.origin.x; r = run_for_glyph_index(lp->pos, glyphs, &gpos, &cpos); i = lp->pos - gpos; while (i + gpos < last) { if (!r->glyphs[i].isNotShown && r->glyphs[i].g && r->glyphs[i].g != NSControlGlyph) { x1 += [r->font advancementForGlyph: r->glyphs[i].g].width; } GLYPH_STEP_FORWARD(r, i, gpos, cpos) } } else if (lf->pos + lf->length == last) { /* The range ends in the last glyph of the line frag, so the end x-coordinate is the right edge of this glyph. This egde is equal to the right edge of the line fragment's rectangle if the glyph is invisible or a control glyph, e.g., a newline, and to the right edge of the line fragment's used rectangle otherwise. */ NSUInteger i; glyph_run_t *r; unsigned int gpos, cpos; r = run_for_glyph_index(last - 1, glyphs, &gpos, &cpos); i = (last - 1) - gpos; if (!r->glyphs[i].isNotShown && r->glyphs[i].g && r->glyphs[i].g != NSControlGlyph) x1 = NSMaxX(lf->used_rect); else x1 = NSMaxX(lf->rect); } else { /* The range continues beyond the end of the line frag, so the end x-coordinate is the right edge of the line frag. */ x1 = NSMaxX(lf->rect); } /* We have the start and end x-coordinates, and use the height of the line frag for the y-coordinates. */ r = NSMakeRect(x0, lf->rect.origin.y, x1 - x0, lf->rect.size.height); /* As an optimization of the rectangle array, we check if the previous rectangle had the same x-coordinates as the new rectangle and touches it vertically. If so, we combine them. */ if (num_rects && r.origin.x == rect_array[num_rects - 1].origin.x && r.size.width == rect_array[num_rects - 1].size.width && r.origin.y == NSMaxY(rect_array[num_rects - 1])) { rect_array[num_rects - 1].size.height += r.size.height; } else { if (num_rects == rect_array_size) { rect_array_size += 4; rect_array = realloc(rect_array, sizeof(NSRect) * rect_array_size); } rect_array[num_rects++] = r; } if (lf->pos + lf->length >= last) break; lf++; } *rectCount = num_rects; return rect_array; } -(NSRect *) rectArrayForCharacterRange: (NSRange)charRange withinSelectedCharacterRange: (NSRange)selCharRange inTextContainer: (NSTextContainer *)container rectCount: (NSUInteger *)rectCount { NSRange r1, r2; // FIXME: should accept {NSNotFound, 0} for selCharRange to ignore that parameter /* TODO: we can actually do better than this by using the insertion point positioning behavior */ r1 = [self glyphRangeForCharacterRange: charRange actualCharacterRange: NULL]; r2 = [self glyphRangeForCharacterRange: selCharRange actualCharacterRange: NULL]; return [self rectArrayForGlyphRange: r1 withinSelectedGlyphRange: r2 inTextContainer: container rectCount: rectCount]; } -(NSRect) boundingRectForGlyphRange: (NSRange)glyphRange inTextContainer: (NSTextContainer *)aTextContainer { NSRect *r; NSRect result; NSUInteger i, c; /* TODO: This isn't correct. Need to handle glyphs that extend outside the line frag rect. */ r = [self rectArrayForGlyphRange: glyphRange withinSelectedGlyphRange: NSMakeRange(NSNotFound, 0) inTextContainer: aTextContainer rectCount: &c]; if (!c) return NSZeroRect; result = r[0]; for (r++, i = 1; i < c; i++, r++) result = NSUnionRect(result, *r); return result; } -(NSRange) glyphRangeForBoundingRect: (NSRect)bounds inTextContainer: (NSTextContainer *)container { int i; unsigned int j; int low, high, mid; textcontainer_t *tc; linefrag_t *lf; NSRange range; for (tc = textcontainers, i = 0; i < num_textcontainers; i++, tc++) if (tc->textContainer == container) break; if (i == num_textcontainers) { NSLog(@"%s: invalid text container", __PRETTY_FUNCTION__); return NSMakeRange(0, 0); } [self _doLayoutToContainer: i point: NSMakePoint(NSMaxX(bounds), NSMaxY(bounds))]; tc = textcontainers + i; if (!tc->num_linefrags) return NSMakeRange(0, 0); /* Find first glyph in bounds. */ /* Find right "line", ie. the first "line" not above bounds. */ for (low = 0, high = tc->num_linefrags - 1; low < high;) { mid = (low + high) / 2; lf = &tc->linefrags[mid]; if (NSMaxY(lf->rect) > NSMinY(bounds)) { high = mid; } else { low = mid + 1; } } i = low; lf = &tc->linefrags[i]; if (NSMaxY(lf->rect) < NSMinY(bounds)) { return NSMakeRange(0, 0); } /* Scan to first line frag intersecting bounds horizontally. */ while (i < tc->num_linefrags - 1 && NSMinY(lf[0].rect) == NSMinY(lf[1].rect) && NSMaxX(lf[0].rect) < NSMinX(bounds)) i++, lf++; /* TODO: find proper position in line frag rect */ range.location = lf->pos; /* Find last glyph in bounds. */ /* Find right "line", ie. last "line" not below bounds. */ for (low = 0, high = tc->num_linefrags - 1; low < high;) { mid = (low + high) / 2; lf = &tc->linefrags[mid]; if (NSMinY(lf->rect) > NSMaxY(bounds)) { high = mid; } else { low = mid + 1; } } i = low; lf = &tc->linefrags[i]; if (i && NSMinY(lf->rect) > NSMaxY(bounds)) i--, lf--; if (NSMinY(lf->rect) > NSMaxY(bounds)) { return NSMakeRange(0, 0); } /* Scan to last line frag intersecting bounds horizontally. */ while (i > 0 && NSMinY(lf[0].rect) == NSMinY(lf[-1].rect) && NSMinX(lf[-1].rect) > NSMaxX(bounds)) i--, lf--; /* TODO: find proper position in line frag rect */ j = lf->pos + lf->length; if (j <= range.location) { return NSMakeRange(0, 0); } range.length = j - range.location; return range; } -(NSRange) glyphRangeForBoundingRectWithoutAdditionalLayout: (NSRect)bounds inTextContainer: (NSTextContainer *)container { /* TODO: this should be the same as -glyphRangeForBoundingRect:inTextContainer: but without the _doLayout... call. In other words, it returns the range of glyphs in the rect that have already been laid out. */ return [self glyphRangeForBoundingRect: bounds inTextContainer: container]; } -(unsigned int) glyphIndexForPoint: (NSPoint)aPoint inTextContainer: (NSTextContainer *)aTextContainer { return [self glyphIndexForPoint: aPoint inTextContainer: aTextContainer fractionOfDistanceThroughGlyph: NULL]; } /* TODO: decide on behavior wrt. invisible glyphs and pointer far away from anything visible */ -(NSUInteger) glyphIndexForPoint: (NSPoint)point inTextContainer: (NSTextContainer *)container fractionOfDistanceThroughGlyph: (CGFloat *)partialFraction { int i; textcontainer_t *tc; linefrag_t *lf; linefrag_point_t *lp; CGFloat dummy; if (!partialFraction) partialFraction = &dummy; for (tc = textcontainers, i = 0; i < num_textcontainers; i++, tc++) if (tc->textContainer == container) break; if (i == num_textcontainers) { NSLog(@"%s: invalid text container", __PRETTY_FUNCTION__); return NSNotFound; } [self _doLayoutToContainer: i point: point]; tc = textcontainers + i; /* Find the line frag rect that contains the point, and handle the case where the point isn't inside a line frag rect. */ for (i = 0, lf = tc->linefrags; i < tc->num_linefrags; i++, lf++) { /* The point is inside a rect; we're done. */ if (NSPointInRect(point, lf->rect)) break; /* If the current line frag rect is below the point, the point must be between the line with the current line frag rect and the line with the previous line frag rect. */ if (NSMinY(lf->rect) > point.y) { /* If this is not the first line frag rect in the text container, we consider the point to be after the last glyph on the previous line. Otherwise, we consider it to be before the first glyph on the current line. */ if (i > 0) { *partialFraction = 1.0; if (lf->pos == 0) { return NSNotFound; } else { return lf->pos - 1; } } else { *partialFraction = 0.0; return lf->pos; } } /* We know that NSMinY(lf->rect) <= point.y. If the point is on the current line and to the left of the current line frag rect, we consider the point to be before the first glyph in the current line frag rect. (This will happen if the point is between two line frag rects, or before the first line frag rect. If the point is to the right of the current line frag rect, it will be inside a subsequent line frag rect on this line, or to the left of one, which will be handled by the here or by the first check in the loop, or it will be after all line frag rects on the line, which will be detected and handled as a 'between two lines' case, or by the 'after all line frags' code below.) */ if (NSMaxY(lf->rect) >= point.y && NSMinX(lf->rect) > point.x) { *partialFraction = 0.0; return lf->pos; } } /* Point is after all line frags. */ if (i == tc->num_linefrags) { *partialFraction = 1.0; /* TODO: this should return the correct thing even if the container is empty */ if (tc->pos + tc->length == 0) { return NSNotFound; } else { return tc->pos + tc->length - 1; } } /* only interested in x from here on */ point.x -= lf->rect.origin.x; /* scan to the first point beyond the target */ for (i = 0, lp = lf->points; i < lf->num_points; i++, lp++) if (lp->p.x > point.x) break; if (!i) { /* Before the first glyph on the line. */ /* TODO: what if it isn't shown? */ *partialFraction = 0; return lp->pos; } else { /* There are points in this line frag before the point we're looking for. */ float cur, prev, next; glyph_run_t *r; unsigned int glyph_pos, char_pos, last_visible; unsigned j; if (i < lf->num_points) next = lp->p.x; else next = NSMinX(lf->rect); lp--; /* Valid since we checked for !i above. */ r = run_for_glyph_index(lp->pos, glyphs, &glyph_pos, &char_pos); prev = lp->p.x; last_visible = lf->pos; for (j = lp->pos - glyph_pos; j + glyph_pos < lp->pos + lp->length;) { // Don't ignore invisble glyphs. // if (r->glyphs[j].isNotShown || r->glyphs[j].g == NSControlGlyph || if (!r->glyphs[j].g) { GLYPH_STEP_FORWARD(r, j, glyph_pos, char_pos) continue; } last_visible = j + glyph_pos; cur = prev + [r->font advancementForGlyph: r->glyphs[j].g].width; if (j + glyph_pos + 1 == lp->pos + lp->length && next > cur) cur = next; if (cur >= point.x) { *partialFraction = (point.x - prev) / (cur - prev); if (*partialFraction < 0) *partialFraction = 0; return j + glyph_pos; } prev = cur; GLYPH_STEP_FORWARD(r, j, glyph_pos, char_pos) } *partialFraction = 1; return last_visible; } } /*** Insertion point positioning and movement. ***/ /* Determines at which glyph, and how far through it, the insertion point should be placed for a certain character index. */ -(unsigned int) _glyphIndexForCharacterIndex: (unsigned int)cindex fractionThrough: (float *)fraction { if (cindex == [[_textStorage string] length]) { *fraction = 0.0; return (unsigned int)-1; } else { NSRange glyphRange, charRange; unsigned int glyph_index; float fraction_through; glyphRange = [self glyphRangeForCharacterRange: NSMakeRange(cindex, 1) actualCharacterRange: &charRange]; /* Deal with composite characters and ligatures. We determine how far through the character range this character is a part of the character is, and then determine the glyph index and fraction that is the same distance through the glyph range it is mapped to. (This gives good behavior when dealing with ligatures, at least.) Eg. if the character index is at character 3 in a 5 character range, we are 3/5=0.6 through the entire character range. If this range was mapped to 4 glyphs, we get 0.6*4=2.4, so the glyph index is 2 and the fraction is 0.4. */ fraction_through = (cindex - charRange.location) / (float)charRange.length; fraction_through *= glyphRange.length; glyph_index = glyphRange.location + floor(fraction_through); fraction_through -= floor(fraction_through); *fraction = fraction_through; return glyph_index; } } /* Note: other methods rely a lot on the fact that the rectangle returned here has the same y origin and height as the line frag rect it is in. */ -(NSRect) _insertionPointRectForCharacterIndex: (unsigned int)cindex textContainer: (int *)textContainer { int i; textcontainer_t *tc; linefrag_t *lf; float x0, x1; NSRect r; unsigned int glyph_index; float fraction_through; glyph_index = [self _glyphIndexForCharacterIndex: cindex fractionThrough: &fraction_through]; if (glyph_index == (unsigned int)-1) { /* Need complete layout information. */ [self _doLayout]; if (extra_textcontainer) { for (tc = textcontainers, i = 0; i < num_textcontainers; i++, tc++) if (tc->textContainer == extra_textcontainer) break; NSAssert(i < num_textcontainers, @"invalid extraTextContainer"); *textContainer = i; r = extra_rect; r.size.width = 1; return r; } glyph_index = [self numberOfGlyphs] - 1; if (glyph_index == (unsigned int)-1) { /* No information is available. Get default font height. */ NSFont *f = [_typingAttributes objectForKey:NSFontAttributeName]; /* will be -1 if there are no text containers */ *textContainer = num_textcontainers - 1; r = NSMakeRect(0, 0, 1, [f boundingRectForFont].size.height); if (num_textcontainers > 0) { tc = textcontainers + num_textcontainers - 1; r.origin.x += [tc->textContainer lineFragmentPadding]; } return r; } fraction_through = 1.0; } else [self _doLayoutToGlyph: glyph_index]; for (tc = textcontainers, i = 0; i < num_textcontainers; i++, tc++) if (tc->pos + tc->length > glyph_index) break; if (i == num_textcontainers) { *textContainer = -1; return NSZeroRect; } *textContainer = i; LINEFRAG_FOR_GLYPH(glyph_index); /* Special case if we are asked for the insertion point rectangle at the end of text, since the standard code yields an incorrect result if the last line fragment ends with an invisible character (e.g., a tab). Note that fraction_through is always less than 1 except when -_glyphIndexForCharacterIndex:fractionThrough: is called for cindex == [_textStorage length], in which case we set it to 1. */ if (fraction_through == 1.0) { r = (lf == 0) ? NSZeroRect : lf->used_rect; r.origin.x += r.size.width; r.size.width = 1; return r; } { unsigned int i; int j; linefrag_point_t *lp; glyph_run_t *r; unsigned int gpos, cpos; for (j = 0, lp = lf->points; j < lf->num_points; j++, lp++) if (lp->pos + lp->length > glyph_index) break; x0 = lp->p.x + lf->rect.origin.x; r = run_for_glyph_index(lp->pos, glyphs, &gpos, &cpos); i = lp->pos - gpos; while (i + gpos < glyph_index) { if (!r->glyphs[i].isNotShown && r->glyphs[i].g && r->glyphs[i].g != NSControlGlyph) { x0 += [r->font advancementForGlyph: r->glyphs[i].g].width; } GLYPH_STEP_FORWARD(r, i, gpos, cpos) } x1 = x0; if (!r->glyphs[i].isNotShown && r->glyphs[i].g && r->glyphs[i].g != NSControlGlyph) { x1 += [r->font advancementForGlyph: r->glyphs[i].g].width; } } r = lf->rect; r.origin.x = x0 + (x1 - x0) * fraction_through; r.size.width = 1; return r; } -(NSRect) insertionPointRectForCharacterIndex: (unsigned int)cindex inTextContainer: (NSTextContainer *)textContainer { int i; NSRect r; r = [self _insertionPointRectForCharacterIndex: cindex textContainer: &i]; if (i == -1 || textcontainers[i].textContainer != textContainer) return NSZeroRect; return r; } -(unsigned int) characterIndexMoving: (GSInsertionPointMovementDirection)direction fromCharacterIndex: (unsigned int)from originalCharacterIndex: (unsigned int)original distance: (float)distance { NSRect from_rect, new_rect; int from_tc, new_tc; unsigned int new; unsigned int length = [_textStorage length]; /* This call will ensure that layout is built to 'from', and that layout for the line 'from' is in is built. */ from_rect = [self _insertionPointRectForCharacterIndex: from textContainer: &from_tc]; if (from_tc == -1) { /* The from character index is not in a text container, so move the cursor to the start of the text. */ return 0; } /* Simple case which moves one character left/right or one line up/down, but supports moving between text containers. */ if (distance == 0.0) { if (direction == GSInsertionPointMoveLeft || direction == GSInsertionPointMoveRight) { new = from; if (direction == GSInsertionPointMoveLeft && new > 0) new--; if (direction == GSInsertionPointMoveRight && new < length) new++; return new; } else if (direction == GSInsertionPointMoveUp || direction == GSInsertionPointMoveDown) { int orig_tc; const float target = [self _insertionPointRectForCharacterIndex: original textContainer: &orig_tc].origin.x; const int delta = (direction == GSInsertionPointMoveUp) ? -1 : 1; /* First scan forward or backwards until we end up on a new line */ for (new = from; (direction == GSInsertionPointMoveUp) ? (new > 0) : (new < length); new += delta) { new_rect = [self _insertionPointRectForCharacterIndex: new textContainer: &new_tc]; if (new_rect.origin.y != from_rect.origin.y || new_tc != from_tc) break; } /* We found the start of the line, now find the target character on that line. */ new_rect = [self _insertionPointRectForCharacterIndex: new textContainer: &new_tc]; while ((direction == GSInsertionPointMoveUp) ? (new > 0) : (new < length)) { int prev_tc = new_tc; NSRect prev_rect = new_rect; new_rect = [self _insertionPointRectForCharacterIndex: new + delta textContainer: &new_tc]; /* 'new+delta' is on a different line than the target line, so the target character must be 'new'.*/ if (new_rect.origin.y != prev_rect.origin.y || new_tc != prev_tc) return new; /* If we pass the target point, the character we want is either 'new' or 'new+delta' */ if ((direction == GSInsertionPointMoveDown && NSMinX(new_rect) >= target) || (direction == GSInsertionPointMoveUp && NSMinX(new_rect) <= target)) { if (fabs(NSMinX(new_rect) - target) > fabs(NSMinX(prev_rect) - target)) return new; return new + delta; } new += delta; } return new; } } /* The following more complex cases are for when a minimum distance is specified. However, they will not move out of from's text container. */ if (direction == GSInsertionPointMoveLeft || direction == GSInsertionPointMoveRight) { float target; /* This is probably very inefficient, but it shouldn't be a bottleneck, and it guarantees that insertion point movement matches insertion point positioning. It also lets us do this by character instead of by glyph. */ new = from; if (direction == GSInsertionPointMoveLeft) { target = from_rect.origin.x - distance; while (new > 0) { new_rect = [self _insertionPointRectForCharacterIndex: new - 1 textContainer: &new_tc]; if (new_tc != from_tc) break; if (new_rect.origin.y != from_rect.origin.y) break; new--; if (NSMaxX(new_rect) <= target) break; } return new; } else { target = from_rect.origin.x + distance; while (new < length) { new_rect = [self _insertionPointRectForCharacterIndex: new + 1 textContainer: &new_tc]; if (new_tc != from_tc) break; if (new_rect.origin.y != from_rect.origin.y) break; new++; if (NSMinX(new_rect) >= target) break; } return new; } } if (direction == GSInsertionPointMoveUp || direction == GSInsertionPointMoveDown) { NSRect orig_rect, prev_rect; int orig_tc; float target; textcontainer_t *tc; linefrag_t *lf; int i; orig_rect = [self _insertionPointRectForCharacterIndex: original textContainer: &orig_tc]; if (orig_tc == from_tc) target = orig_rect.origin.x; else target = from_rect.origin.x; tc = &textcontainers[from_tc]; /* Find first line frag rect on the from line. */ for (i = 0, lf = tc->linefrags; i < tc->num_linefrags; i++, lf++) { if (lf->rect.origin.y == from_rect.origin.y) break; } /* If we don't have a line frag rect that matches the from position, the from position is probably on the last line, in the extra rect, and i == tc->num_linefrags. The movement direction specific code handles this case, as long as tc->num_linefrags > 0. */ if (!tc->num_linefrags) return from; /* Impossible? Should be, since from_tc!=-1. */ if (direction == GSInsertionPointMoveDown) { [self _doLayoutToContainer: from_tc point: NSMakePoint(target, distance + NSMaxY(from_rect))]; tc = textcontainers + from_tc; /* Find the target line. Move at least (should be up to?) distance, and at least one line. */ for (; i < tc->num_linefrags; i++, lf++) if (NSMaxY(lf->rect) >= distance + NSMaxY(from_rect) && NSMinY(lf->rect) != NSMinY(from_rect)) break; if (i == tc->num_linefrags) { /* Special case for moving into the extra line at the end */ if (tc->textContainer == extra_textcontainer && NSMaxY(extra_rect) >= distance + NSMaxY(from_rect) && NSMinY(extra_rect) != NSMinY(from_rect)) return length; /* We can't move as far as we want to. In fact, we might not have been able to move at all. TODO: figure out how to handle this */ return from; } } else { if (i == tc->num_linefrags) i--, lf--; /* Find the target line. Move at least (should be up to?) distance, and at least one line. */ for (; i >= 0; i--, lf--) if (NSMinY(lf->rect) <= NSMinY(from_rect) - distance && NSMinY(lf->rect) != NSMinY(from_rect)) break; /* Now we have the last line frag of the target line. Move backwards to the first one. */ for (; i > 0; i--, lf--) if (NSMinY(lf->rect) != NSMinY(lf[-1].rect)) break; if (i == -1) { /* We can't move as far as we want to. In fact, we might not have been able to move at all. TODO: figure out how to handle this */ return from; } } /* Now we have the first line frag of the target line and the target x position. */ new = [self characterRangeForGlyphRange: NSMakeRange(lf->pos, 1) actualGlyphRange: NULL].location; /* The first character index might not actually be in this line rect, so move forwards to the first character in the target line. */ while (new < length) { new_rect = [self _insertionPointRectForCharacterIndex: new + 1 textContainer: &new_tc]; if (new_tc > from_tc) break; if (new_rect.origin.y >= lf->rect.origin.y) break; new++; } /* Now find the target character in the line. */ new_rect = [self _insertionPointRectForCharacterIndex: new textContainer: &new_tc]; while (new < length) { prev_rect = new_rect; new_rect = [self _insertionPointRectForCharacterIndex: new + 1 textContainer: &new_tc]; if (new_tc != from_tc) break; if (new_rect.origin.y != lf->rect.origin.y) break; if (NSMinX(new_rect) >= target) { /* 'new+1' is beyond 'target', so either 'new' or 'new+1' is the character we want. Pick the closest one. (Note that 'new' might also be beyond 'target'.) */ if (fabs(NSMinX(new_rect) - target) < fabs(NSMinX(prev_rect) - target)) new++; return new; } new++; } return new; } NSLog(@"(%s): invalid direction %i (distance %g)", __PRETTY_FUNCTION__, direction, distance); return from; } - (void) ensureGlyphsForGlyphRange: (NSRange)glyphRange { [self _generateGlyphsUpToGlyph: NSMaxRange(glyphRange) - 1]; } - (void) ensureGlyphsForCharacterRange: (NSRange)charRange { [self _generateGlyphsUpToCharacter: NSMaxRange(charRange) - 1]; } - (void) ensureLayoutForGlyphRange: (NSRange)glyphRange { [self _doLayoutToGlyph: NSMaxRange(glyphRange) - 1]; } - (void) ensureLayoutForCharacterRange: (NSRange)charRange { NSRange glyphRange; glyphRange = [self glyphRangeForCharacterRange: charRange actualCharacterRange: NULL]; [self ensureLayoutForGlyphRange: glyphRange]; } - (void) ensureLayoutForTextContainer: (NSTextContainer*)container { int i; textcontainer_t *tc; NSSize size; for (tc = textcontainers, i = 0; i < num_textcontainers; i++, tc++) if (tc->textContainer == container) break; if (i == num_textcontainers) { NSLog(@"%s: invalid text container", __PRETTY_FUNCTION__); return; } size = [container containerSize]; [self _doLayoutToContainer: i point: NSMakePoint(size.width, size.height)]; } - (void) ensureLayoutForBoundingRect: (NSRect)bounds inTextContainer: (NSTextContainer*)container { int i; textcontainer_t *tc; for (tc = textcontainers, i = 0; i < num_textcontainers; i++, tc++) if (tc->textContainer == container) break; if (i == num_textcontainers) { NSLog(@"%s: invalid text container", __PRETTY_FUNCTION__); return; } [self _doLayoutToContainer: i point: NSMakePoint(NSMaxX(bounds), NSMaxY(bounds))]; } - (void) invalidateLayoutForCharacterRange: (NSRange)charRange actualCharacterRange: (NSRangePointer)actualCharRange { [self invalidateLayoutForCharacterRange: charRange isSoft: NO actualCharacterRange: actualCharRange]; } - (void) invalidateGlyphsOnLayoutInvalidationForGlyphRange: (NSRange)glyphRange { // FIXME } - (BOOL) allowsNonContiguousLayout { return NO; } - (void) setAllowsNonContiguousLayout: (BOOL)flag; { } - (BOOL) hasNonContiguousLayout; { return NO; } @end @implementation NSLayoutManager (drawing) /** Drawing **/ /* If a range passed to a drawing function isn't contained in the text container that contains its first glyph, the range is silently clamped. My thought with this is that the requested glyphs might not fit in the text container (if it's the last text container, or there's only one). In that case, it isn't really the caller's fault, and drawing as much as will fit in the text container makes sense. TODO: reconsider silently clamping ranges in these methods; might want to make sure we don't do it if part of the range is in a second container */ -(void) drawBackgroundForGlyphRange: (NSRange)range atPoint: (NSPoint)containerOrigin { NSTextContainer *textContainer; glyph_run_t *glyph_run; unsigned int glyph_pos, char_pos, first_char_pos; int i, j; NSRect *rects; NSUInteger count; NSColor *color, *last_color; NSGraphicsContext *ctxt = GSCurrentContext(); if (!range.length) return; [self _doLayoutToGlyph: range.location + range.length - 1]; { int i; textcontainer_t *tc; for (i = 0, tc = textcontainers; i < num_textcontainers; i++, tc++) if (tc->pos + tc->length > range.location) break; if (i == num_textcontainers) { NSLog(@"%s: can't find text container for glyph (internal error)", __PRETTY_FUNCTION__); return; } if (range.location + range.length > tc->pos + tc->length) range.length = tc->pos + tc->length - range.location; textContainer = tc->textContainer; } glyph_run = run_for_glyph_index(range.location, glyphs, &glyph_pos, &char_pos); i = range.location - glyph_pos; last_color = nil; first_char_pos = char_pos; while (1) { NSRange r = NSMakeRange(glyph_pos + i, glyph_run->head.glyph_length - i); if (NSMaxRange(r) > NSMaxRange(range)) r.length = NSMaxRange(range) - r.location; color = [_textStorage attribute: NSBackgroundColorAttributeName atIndex: char_pos effectiveRange: NULL]; if (color) { rects = [self rectArrayForGlyphRange: r withinSelectedGlyphRange: NSMakeRange(NSNotFound, 0) inTextContainer: textContainer rectCount: &count]; if (count) { if (last_color != color) { [color set]; last_color = color; } for (j = 0; j < count; j++, rects++) { DPSrectfill(ctxt, rects->origin.x + containerOrigin.x, rects->origin.y + containerOrigin.y, rects->size.width, rects->size.height); } } } glyph_pos += glyph_run->head.glyph_length; char_pos += glyph_run->head.char_length; i = 0; glyph_run = (glyph_run_t *)glyph_run->head.next; if (i + glyph_pos >= range.location + range.length) break; } if (!_selected_range.length || _selected_range.location == NSNotFound) return; if (_selected_range.location >= char_pos || _selected_range.location + _selected_range.length <= first_char_pos) { return; } /* The selection (might) intersect our glyph range. */ { NSRange r = [self glyphRangeForCharacterRange: _selected_range actualCharacterRange: NULL]; NSRange sel = r; NSTextView *ftv; if (r.location < range.location) { if (range.location - r.location > r.length) return; r.length -= range.location - r.location; r.location = range.location; } if (r.location + r.length > range.location + range.length) { if (r.location > range.location + range.length) return; r.length = range.location + range.length - r.location; } /* Use the text view's selected text attributes */ if ((ftv = [self textViewForBeginningOfSelection])) color = [[ftv selectedTextAttributes] objectForKey: NSBackgroundColorAttributeName]; if (!color) color = [NSColor selectedTextBackgroundColor]; if (!color) return; rects = [self rectArrayForGlyphRange: r withinSelectedGlyphRange: sel inTextContainer: textContainer rectCount: &count]; if (count) { [color set]; for (j = 0; j < count; j++, rects++) { DPSrectfill(ctxt, rects->origin.x + containerOrigin.x, rects->origin.y + containerOrigin.y, rects->size.width, rects->size.height); } } } } static inline NSSize attachmentSize(linefrag_t *lf, NSUInteger glyphIndex) { linefrag_attachment_t *la; int la_i; la = lf->attachments; la_i = 0; if (la) { while (la->pos != glyphIndex && la_i < lf->num_attachments) { la++; la_i++; } } if (la_i >= lf->num_attachments) return NSMakeSize(-1.0, -1.0); return la->size; } - (NSSize) attachmentSizeForGlyphAtIndex: (NSUInteger)glyphIndex { textcontainer_t *tc; int i; linefrag_t *lf; for (i = 0, tc = textcontainers; i < num_textcontainers; i++, tc++) if (tc->pos + tc->length > glyphIndex) break; if (i == num_textcontainers) { NSLog(@"%s: can't find text container for glyph (internal error)", __PRETTY_FUNCTION__); return NSMakeSize(-1.0, -1.0); } LINEFRAG_FOR_GLYPH(glyphIndex); return attachmentSize(lf, glyphIndex); } - (void) showAttachmentCell: (NSCell *)cell inRect: (NSRect)rect characterIndex: (NSUInteger)attachmentIndex { [(id )cell drawWithFrame: rect inView: [NSView focusView] characterIndex: attachmentIndex layoutManager: self]; } -(void) drawGlyphsForGlyphRange: (NSRange)range atPoint: (NSPoint)containerOrigin { int i, j; textcontainer_t *tc; linefrag_t *lf; linefrag_point_t *lp; NSPoint p; unsigned int g; NSDictionary *attributes; NSFont *f; NSColor *color, *run_color; NSRange selectedGlyphRange; BOOL currentGlyphIsSelected; glyph_run_t *glyph_run; unsigned int glyph_pos, char_pos; glyph_t *glyph; NSGraphicsContext *ctxt = GSCurrentContext(); /* For performance, it might (if benchmarks or profiling backs it up) be worthwhile to cache this across calls to this method. However, this color can change at runtime, so care would have to be taken to keep the cache in sync with the actual color. */ NSColor *defaultTextColor = [NSColor textColor]; NSColor *selectedTextColor = defaultTextColor; NSColor *link_color = nil; id linkValue; #define GBUF_SIZE 16 /* TODO: tweak */ NSGlyph gbuf[GBUF_SIZE]; NSSize advancementbuf[GBUF_SIZE]; int gbuf_len, gbuf_size; NSPoint gbuf_point = NSZeroPoint; if (!range.length) return; [self _doLayoutToGlyph: range.location + range.length - 1]; /* Find the selected range of glyphs as it overlaps with the range we * are about to display. */ if (_selected_range.length == 0) { selectedGlyphRange.location = 0; selectedGlyphRange.length = 0; } else { selectedGlyphRange = [self glyphRangeForCharacterRange: _selected_range actualCharacterRange: 0]; } selectedGlyphRange = NSIntersectionRange(selectedGlyphRange, range); if ([ctxt isDrawingToScreen]) gbuf_size = GBUF_SIZE; else gbuf_size = 1; for (i = 0, tc = textcontainers; i < num_textcontainers; i++, tc++) if (tc->pos + tc->length > range.location) break; if (i == num_textcontainers) { NSLog(@"%s: can't find text container for glyph (internal error)", __PRETTY_FUNCTION__); return; } if (range.location + range.length > tc->pos + tc->length) range.length = tc->pos + tc->length - range.location; LINEFRAG_FOR_GLYPH(range.location); j = 0; lp = lf->points; while (lp->pos + lp->length < range.location) lp++, j++; glyph_run = run_for_glyph_index(lp->pos, glyphs, &glyph_pos, &char_pos); currentGlyphIsSelected = NSLocationInRange(lp->pos, selectedGlyphRange); glyph = glyph_run->glyphs + lp->pos - glyph_pos; attributes = [_textStorage attributesAtIndex: char_pos effectiveRange: NULL]; run_color = [attributes valueForKey: NSForegroundColorAttributeName]; if (run_color == nil) run_color = defaultTextColor; linkValue = [attributes objectForKey: NSLinkAttributeName]; if (linkValue != nil) { if (link_color == nil) { NSDictionary *link_attributes = [[self firstTextView] linkTextAttributes]; link_color = [link_attributes valueForKey: NSForegroundColorAttributeName]; } if (link_color != nil) run_color = link_color; } if (selectedGlyphRange.length > 0) { /* Get the text view's color setting for selected text as we will * be needing to draw some selected glyphs. */ selectedTextColor = [[[self textViewForBeginningOfSelection] selectedTextAttributes] objectForKey: NSForegroundColorAttributeName]; /* FIXME ... should we fall back to using selectedTextColor or * defaultTextColor? */ if (selectedTextColor == nil) { selectedTextColor = [NSColor selectedTextColor]; } } color = (currentGlyphIsSelected ? selectedTextColor : run_color); [color set]; f = glyph_run->font; [f set]; p = lp->p; p.x += lf->rect.origin.x + containerOrigin.x; p.y += lf->rect.origin.y + containerOrigin.y; gbuf_len = 0; for (g = lp->pos; g < range.location + range.length; g++, glyph++) { if (currentGlyphIsSelected != NSLocationInRange(g, selectedGlyphRange)) { /* When we change between drawing selected and unselected glyphs * we must flush any glyphs from the buffer and change trhe color * we use for the text. */ if (gbuf_len) { DPSmoveto(ctxt, gbuf_point.x, gbuf_point.y); GSShowGlyphsWithAdvances(ctxt, gbuf, advancementbuf, gbuf_len); DPSnewpath(ctxt); gbuf_len = 0; } if (currentGlyphIsSelected == YES) { currentGlyphIsSelected = NO; if (color != run_color) { color = run_color; [color set]; } } else { currentGlyphIsSelected = YES; if (color != selectedTextColor) { color = selectedTextColor; [color set]; } } } if (g == lp->pos + lp->length) { if (gbuf_len) { DPSmoveto(ctxt, gbuf_point.x, gbuf_point.y); GSShowGlyphsWithAdvances(ctxt, gbuf, advancementbuf, gbuf_len); DPSnewpath(ctxt); gbuf_len = 0; } j++; lp++; if (j == lf->num_points) { i++; lf++; j = 0; lp = lf->points; } p = lp->p; p.x += lf->rect.origin.x + containerOrigin.x; p.y += lf->rect.origin.y + containerOrigin.y; } if (g == glyph_pos + glyph_run->head.glyph_length) { glyph_pos += glyph_run->head.glyph_length; char_pos += glyph_run->head.char_length; glyph_run = (glyph_run_t *)glyph_run->head.next; attributes = [_textStorage attributesAtIndex: char_pos effectiveRange: NULL]; run_color = [attributes valueForKey: NSForegroundColorAttributeName]; if (run_color == nil) { run_color = defaultTextColor; } linkValue = [attributes objectForKey: NSLinkAttributeName]; if (linkValue != nil) { if (link_color == nil) { NSDictionary *link_attributes = [[self firstTextView] linkTextAttributes]; link_color = [link_attributes valueForKey: NSForegroundColorAttributeName]; } if (link_color != nil) run_color = link_color; } glyph = glyph_run->glyphs; /* If the font has changed or the color has changed (and we are * not drawing using the selected text color) then we must flush * any buffered glyphs and set the new font and color. */ if (glyph_run->font != f || (currentGlyphIsSelected == NO && run_color != color)) { if (gbuf_len) { DPSmoveto(ctxt, gbuf_point.x, gbuf_point.y); GSShowGlyphsWithAdvances(ctxt, gbuf, advancementbuf, gbuf_len); DPSnewpath(ctxt); gbuf_len = 0; } if (f != glyph_run->font) { f = glyph_run->font; [f set]; } if (currentGlyphIsSelected == NO && run_color != color) { color = run_color; [color set]; } } } if (!glyph->isNotShown && glyph->g && glyph->g != NSControlGlyph) { if (glyph->g == GSAttachmentGlyph) { if (g >= range.location) { unsigned int char_index = [self characterRangeForGlyphRange: NSMakeRange(g, 1) actualGlyphRange: NULL].location; NSObject *cell = [[_textStorage attribute: NSAttachmentAttributeName atIndex: char_index effectiveRange: NULL] attachmentCell]; NSRect cellFrame; cellFrame.origin = p; cellFrame.size = attachmentSize(lf, g); cellFrame.origin.y -= cellFrame.size.height; /* Silently ignore if we don't have any size information for it. */ if (NSEqualSizes(cellFrame.size, NSMakeSize(-1.0, -1.0))) continue; /* Drawing the cell might mess up our state, so we reset the font and color afterwards. */ /* TODO: optimize this? collect attachments and draw them in bunches of eg. 4? probably not worth effort. better to optimize font and color setting :) should they really be drawn in our coordinate system? */ [self showAttachmentCell: (NSCell*)cell inRect: cellFrame characterIndex: char_index]; [f set]; [color set]; } continue; } if (g >= range.location) { if (!gbuf_len) { gbuf[0] = glyph->g; advancementbuf[0] = [f advancementForGlyph: glyph->g]; gbuf_point = p; gbuf_len = 1; } else { if (gbuf_len == gbuf_size) { DPSmoveto(ctxt, gbuf_point.x, gbuf_point.y); GSShowGlyphsWithAdvances(ctxt, gbuf, advancementbuf, gbuf_size); DPSnewpath(ctxt); gbuf_len = 0; gbuf_point = p; } gbuf[gbuf_len] = glyph->g; advancementbuf[gbuf_len] = [f advancementForGlyph: glyph->g]; gbuf_len++; } } p.x += [f advancementForGlyph: glyph->g].width; } } if (gbuf_len) { /*int i; printf("%i at (%g %g) 4\n", gbuf_len, gbuf_point.x, gbuf_point.y); for (i = 0; i < gbuf_len; i++) printf(" %3i : %04x\n", i, gbuf[i]); */ DPSmoveto(ctxt, gbuf_point.x, gbuf_point.y); GSShowGlyphsWithAdvances(ctxt, gbuf, advancementbuf, gbuf_len); DPSnewpath(ctxt); } #undef GBUF_SIZE // Draw underline where necessary // FIXME: Also draw strikeout { const NSRange characterRange = [self characterRangeForGlyphRange: range actualGlyphRange: NULL]; id linkUnderlineValue = nil; for (i=characterRange.location; i= fragmentGlyphRange.location && NSMaxRange(underlineRange) <= NSMaxRange(fragmentGlyphRange))) { NSLog(@"Error, underlineRange must be inside fragmentGlyphRange"); return; } for (i = characterRange.location; i < NSMaxRange(characterRange); ) { NSRange underlineColorCharacterRange, foregroundColorCharacterRange, rangeToDraw; NSColor *underlineColor = nil; NSRange glyphRangeToDraw; NSRange linkCharacterRange; id linkValue; linkValue = [_textStorage attribute: NSLinkAttributeName atIndex: i longestEffectiveRange: &linkCharacterRange inRange: NSMakeRange(i, NSMaxRange(characterRange)-i)]; if (linkValue != nil) { if (link_color == nil) { NSDictionary *link_attributes = [[self firstTextView] linkTextAttributes]; link_color = [link_attributes valueForKey: NSForegroundColorAttributeName]; } if (link_color != nil) underlineColor = link_color; underlineColorCharacterRange = linkCharacterRange; } else { underlineColor = (NSColor*)[[self textStorage] attribute: NSUnderlineColorAttributeName atIndex: i longestEffectiveRange: &underlineColorCharacterRange inRange: NSMakeRange(i, NSMaxRange(characterRange)-i)]; underlineColorCharacterRange = NSIntersectionRange(underlineColorCharacterRange, linkCharacterRange); } if (underlineColor != nil) { [underlineColor set]; rangeToDraw = underlineColorCharacterRange; } else { NSColor *foregroundColor = (NSColor*)[[self textStorage] attribute: NSForegroundColorAttributeName atIndex: i longestEffectiveRange: &foregroundColorCharacterRange inRange: NSMakeRange(i, NSMaxRange(characterRange)-i)]; if (foregroundColor != nil) { [foregroundColor set]; } else { [[NSColor textColor] set]; } // Draw the smaller range rangeToDraw = underlineColorCharacterRange.length < foregroundColorCharacterRange.length ? underlineColorCharacterRange : foregroundColorCharacterRange; } glyphRangeToDraw = [self glyphRangeForCharacterRange: rangeToDraw actualCharacterRange: NULL]; if (glyphRangeToDraw.length > 0) { // do the actual underline // FIXME: find the largest font within the range to underline // NOTE: GS private method NSFont *largestFont = [self effectiveFontForGlyphAtIndex: glyphRangeToDraw.location range: NULL]; const CGFloat underlineWidth = [largestFont pointSize] * (((type & NSUnderlineStyleDouble) != 0) ? 0.05 : 0.07); NSPoint start = [self locationForGlyphAtIndex: glyphRangeToDraw.location]; NSPoint end = [self locationForGlyphAtIndex: NSMaxRange(glyphRangeToDraw) - 1]; // FIXME: remove this hack lowers the underline slightly start.y += [largestFont pointSize] * 0.07; end.y += [largestFont pointSize] * 0.07; end.x += [largestFont advancementForGlyph: [self glyphAtIndex: (NSMaxRange(glyphRangeToDraw) - 1)]].width; start = NSMakePoint(start.x + containerOrigin.x + fragmentRect.origin.x, start.y + containerOrigin.y + fragmentRect.origin.y); end = NSMakePoint(end.x + containerOrigin.x + fragmentRect.origin.x, end.y + containerOrigin.y + fragmentRect.origin.y); if ((type & NSUnderlineStyleDouble) == NSUnderlineStyleDouble) { GSDrawPatternLine(NSMakePoint(start.x, start.y - (underlineWidth / 2)), NSMakePoint(end.x, end.y - (underlineWidth / 2)), type, underlineWidth / 2, start.x); GSDrawPatternLine(NSMakePoint(start.x, start.y + (underlineWidth / 2)), NSMakePoint(end.x, end.y + (underlineWidth / 2)), type, underlineWidth / 2, start.x); } else { GSDrawPatternLine(start, end, type, underlineWidth, start.x); } } i += rangeToDraw.length; } } @end @implementation NSLayoutManager (spelling) -(void) _drawSpellingState: (NSInteger)spellingState forGylphRange: (NSRange)range lineFragmentRect: (NSRect)fragmentRect lineFragmentGlyphRange: (NSRange)fragmentGlyphRange containerOrigin: (NSPoint)containerOrigin { NSBezierPath *path; const CGFloat pattern[2] = {2.5, 1.0}; NSFont *largestFont = [self effectiveFontForGlyphAtIndex: range.location // NOTE: GS private method range: NULL]; NSPoint start = [self locationForGlyphAtIndex: range.location]; NSPoint end = [self locationForGlyphAtIndex: NSMaxRange(range) - 1]; //FIXME: check length > 0 if (spellingState == 0) { return; } // FIXME: calculate the underline position correctly, using the font on both the start and end glyph start.y += [largestFont pointSize] * 0.07; end.y += [largestFont pointSize] * 0.07; end.x += [largestFont advancementForGlyph: [self glyphAtIndex: (NSMaxRange(range) - 1)]].width; start = NSMakePoint(start.x + containerOrigin.x + fragmentRect.origin.x, start.y + containerOrigin.y + fragmentRect.origin.y); end = NSMakePoint(end.x + containerOrigin.x + fragmentRect.origin.x, end.y + containerOrigin.y + fragmentRect.origin.y); path = [NSBezierPath bezierPath]; [path setLineDash: pattern count: 2 phase: 0]; [path setLineWidth: 1.5]; [path moveToPoint: start]; [path lineToPoint: end]; if ((spellingState & NSSpellingStateGrammarFlag) != 0) { [[NSColor greenColor] set]; } else { [[NSColor redColor] set]; } [path stroke]; } @end @implementation NSLayoutManager /* * Class methods */ + (void) initialize { if (self == [NSLayoutManager class]) { [self exposeBinding: @"hyphenationFactor"]; } } -(void) insertTextContainer: (NSTextContainer *)aTextContainer atIndex: (unsigned int)index { int i; [super insertTextContainer: aTextContainer atIndex: index]; for (i = 0; i < num_textcontainers; i++) [[textcontainers[i].textContainer textView] _updateMultipleTextViews]; } -(void) removeTextContainerAtIndex: (unsigned int)index { int i; NSTextView *tv = [textcontainers[index].textContainer textView]; RETAIN(tv); [super removeTextContainerAtIndex: index]; [tv _updateMultipleTextViews]; RELEASE(tv); for (i = 0; i < num_textcontainers; i++) [[textcontainers[i].textContainer textView] _updateMultipleTextViews]; } -(void) dealloc { // Remove all key value bindings for this object. [GSKeyValueBinding unbindAllForObject: self]; DESTROY(_typingAttributes); DESTROY(_temporaryAttributes); [super dealloc]; } /* TODO: Add a general typesetterAttributes dictionary. Implement the hyphenation factor methods by setting/getting an attribute in this dictionary. */ -(float) hyphenationFactor { return 0.0; } -(void) setHyphenationFactor: (float)factor { NSLog(@"Warning: (NSLayoutManager) %s not implemented", __PRETTY_FUNCTION__); } -(NSTextView *) firstTextView { int i; NSTextView *tv; for (i = 0; i < num_textcontainers; i++) { tv = [textcontainers[i].textContainer textView]; if (tv) return tv; } return nil; } -(NSTextView *) textViewForBeginningOfSelection { /* TODO */ return [self firstTextView]; } -(BOOL) layoutManagerOwnsFirstResponderInWindow: (NSWindow *)window { int i; NSResponder *tv; NSResponder *v = [window firstResponder]; for (i = 0; i < num_textcontainers; i++) { tv = [textcontainers[i].textContainer textView]; if (tv == v) return YES; } return NO; } -(NSArray *) rulerMarkersForTextView: (NSTextView *)textView paragraphStyle: (NSParagraphStyle *)paragraphStyle ruler: (NSRulerView *)aRulerView { NSRulerMarker *marker; NSTextTab *tab; NSImage *image; NSArray *tabs = [paragraphStyle tabStops]; NSEnumerator *enumerator = [tabs objectEnumerator]; NSMutableArray *markers = [NSMutableArray arrayWithCapacity: [tabs count]]; while ((tab = [enumerator nextObject]) != nil) { switch ([tab tabStopType]) { case NSLeftTabStopType: image = [NSImage imageNamed: @"common_LeftTabStop"]; break; case NSRightTabStopType: image = [NSImage imageNamed: @"common_RightTabStop"]; break; case NSCenterTabStopType: image = [NSImage imageNamed: @"common_CenterTabStop"]; break; case NSDecimalTabStopType: image = [NSImage imageNamed: @"common_DecimalTabStop"]; break; default: image = nil; break; } marker = [[NSRulerMarker alloc] initWithRulerView: aRulerView markerLocation: [tab location] image: image imageOrigin: NSMakePoint(0, 0)]; [marker setRepresentedObject: tab]; [markers addObject: marker]; RELEASE(marker); } return markers; } -(NSView *) rulerAccessoryViewForTextView: (NSTextView *)textView paragraphStyle: (NSParagraphStyle *)style ruler: (NSRulerView *)ruler enabled: (BOOL)isEnabled { /* TODO */ return nil; } /* TODO: not really clear what these should do */ -(void) invalidateDisplayForGlyphRange: (NSRange)aRange { int i; unsigned int m; NSRange r; NSRect rect; NSPoint p; NSTextView *tv; for (i = 0; i < num_textcontainers; i++) { if (!textcontainers[i].num_linefrags) break; if (textcontainers[i].pos >= aRange.location + aRange.length) break; /* we're past the end of the range */ m = textcontainers[i].pos + textcontainers[i].length; if (m < aRange.location) continue; r.location = textcontainers[i].pos; if (aRange.location > r.location) r.location = aRange.location; if (m > aRange.location + aRange.length) m = aRange.location + aRange.length; r.length = m - r.location; /* Range r in this text view should be invalidated. */ rect = [self boundingRectForGlyphRange: r inTextContainer: textcontainers[i].textContainer]; tv = [textcontainers[i].textContainer textView]; p = [tv textContainerOrigin]; rect.origin.x += p.x; rect.origin.y += p.y; [tv setNeedsDisplayInRect: rect]; } } -(void) invalidateDisplayForCharacterRange: (NSRange)aRange { if (layout_char <= aRange.location) return; if (layout_char < aRange.location + aRange.length) aRange.length = layout_char - aRange.location; [self invalidateDisplayForGlyphRange: [self glyphRangeForCharacterRange: aRange actualCharacterRange: NULL]]; } -(void) _didInvalidateLayout { unsigned int g; int i; /* Invalidate from the first glyph not laid out (which will generally be the first glyph to have been invalidated). */ g = layout_glyph; [super _didInvalidateLayout]; for (i = 0; i < num_textcontainers; i++) { if (textcontainers[i].complete && g < textcontainers[i].pos + textcontainers[i].length) continue; [[textcontainers[i].textContainer textView] _layoutManagerDidInvalidateLayout]; } } -(void) _dumpLayout { int i, j, k; textcontainer_t *tc; linefrag_t *lf; linefrag_point_t *lp; linefrag_attachment_t *la; for (i = 0, tc = textcontainers; i < num_textcontainers; i++, tc++) { printf("tc %2i, %5i+%5i (complete %i)\n", i,tc->pos,tc->length,tc->complete); printf(" lfs: (%3i)\n", tc->num_linefrags); for (j = 0, lf = tc->linefrags; j < tc->num_linefrags; j++, lf++) { printf(" %3i : %5i+%5i (%g %g)+(%g %g)\n", j,lf->pos,lf->length, lf->rect.origin.x,lf->rect.origin.y, lf->rect.size.width,lf->rect.size.height); for (k = 0, lp = lf->points; k < lf->num_points; k++, lp++) printf(" p%3i : %5i+%5i\n",k,lp->pos,lp->length); for (k = 0, la = lf->attachments; k < lf->num_attachments; k++, la++) printf(" a%3i : %5i+%5i\n",k,la->pos,la->length); } printf(" softs: (%3i)\n", tc->num_soft); for (; j < tc->num_linefrags + tc->num_soft; j++, lf++) { printf(" %3i : %5i+%5i (%g %g)+(%g %g)\n", j,lf->pos,lf->length, lf->rect.origin.x,lf->rect.origin.y, lf->rect.size.width,lf->rect.size.height); for (k = 0, lp = lf->points; k < lf->num_points; k++, lp++) printf(" p%3i : %5i+%5i\n",k,lp->pos,lp->length); for (k = 0, la = lf->attachments; k < lf->num_attachments; k++, la++) printf(" a%3i : %5i+%5i\n",k,la->pos,la->length); } } printf("layout to: char %i, glyph %i\n",layout_char,layout_glyph); } /* We completely override this method and use the extra information we have about layout to do smarter invalidation. The comments at the beginning of this file describes this. */ - (void) textStorage: (NSTextStorage *)aTextStorage edited: (unsigned int)mask range: (NSRange)range changeInLength: (int)lengthChange invalidatedRange: (NSRange)invalidatedRange { NSRange r; unsigned int original_last_glyph; /* printf("\n*** invalidating\n"); [self _dumpLayout];*/ /* Using -glyphRangeForChara... here would be safer, but we must make absolutely sure that we don't cause any glyph generation until the invalidation is done. TODO: make sure last_glyph is set as expected */ original_last_glyph = layout_glyph; if (!(mask & NSTextStorageEditedCharacters)) lengthChange = 0; if (_temporaryAttributes != nil && (mask & NSTextStorageEditedCharacters) != 0) { int i; NSArray *attrs; NSRange oldRange = NSMakeRange(range.location, range.length - lengthChange); NSString *replacementString = [[GSDummyMutableString alloc] initWithLength: range.length]; [_temporaryAttributes replaceCharactersInRange: oldRange withString: replacementString]; [replacementString release]; // In addition, clear any temporary attributes that may have been extended // over the affected range if (range.length > 0) { attrs = [[self temporaryAttributesAtCharacterIndex: range.location effectiveRange: NULL] allKeys]; for (i=0; i<[attrs count]; i++) { [self removeTemporaryAttribute: [attrs objectAtIndex: i] forCharacterRange: range]; } } } [self invalidateGlyphsForCharacterRange: invalidatedRange changeInLength: lengthChange actualCharacterRange: &r]; /* If we had layout information and we had layout information for the range of characters that was modified, we need to invalidate layout information. TODO: This is broken. Even if we don't have layout for the modified characters, we might have layout for the preceeding line, and we then need to invalidate that line. Need to rework this a bit... I really really need to know the glyph length change here. :/ (Alexander Malmberg 2004-03-22) */ if (layout_char > 0 && layout_char >= r.location) { unsigned int glyph_index, last_glyph; textcontainer_t *tc; linefrag_t *lf; int i, j, k; int new_num; NSRange char_range; unsigned int new_last_glyph; int glyph_delta; /* If we had layout beyond the modified characters, update layout_char. Otherwise, just pretend that we have layout up to the end of the range after the change. This will give glyph_delta and last_glyph incorrect values, strictly speaking, but glyph_delta is only used if we have layout beyond the modified range, and last_glyph is used in a way that makes it safe to overestimate it (as we do here). When I can get exact information about the modified glyphs (TODO above), all this will become much cleaner... */ if (layout_char >= r.location + r.length - lengthChange) layout_char += lengthChange; else layout_char = r.location + r.length; if (!layout_char) new_last_glyph = 0; else if (layout_char == [_textStorage length]) new_last_glyph = [self numberOfGlyphs]; else new_last_glyph = [self glyphRangeForCharacterRange: NSMakeRange(layout_char, 1) actualCharacterRange: NULL].location; glyph_delta = new_last_glyph - original_last_glyph; /* Note that r.location might not actually have any text container or line frag. */ if (!r.location) { glyph_index = 0; } else if (r.location == [_textStorage length]) { /* Since layout was built beyond r.location, glyphs must have been too, so invalidation only removed trailing glyphs and we still have glyphs built up to the end. Thus, -numberOfGlyphs is cheap to call. */ glyph_index = [self numberOfGlyphs]; char_range.location = [_textStorage length]; } else { /* Will cause generation of glyphs, but I consider that acceptable for now. Soft-invalidation will cause even more glyph generation, anyway. */ glyph_index = [self glyphRangeForCharacterRange: NSMakeRange(r.location,1) actualCharacterRange: &char_range].location; } /* For soft invalidation, we need to know where to stop hard-invalidating. This will cause immediate glyph generation to fill the gaps the invalidation caused. */ if (NSMaxRange(r) == [_textStorage length]) { last_glyph = [self numberOfGlyphs]; } else { last_glyph = [self glyphRangeForCharacterRange: NSMakeRange(NSMaxRange(r),1) actualCharacterRange: NULL].location; } last_glyph -= glyph_delta; /* glyph_index is the first index we should invalidate for. */ for (j = 0, tc = textcontainers; j < num_textcontainers; j++, tc++) if (tc->pos + tc->length >= glyph_index) break; LINEFRAG_FOR_GLYPH(glyph_index); /* We invalidate the entire line containing lf, and the entire previous line. Thus, we scan backwards to find the first line frag on the previous line. */ while (i > 0 && lf[-1].rect.origin.y == lf->rect.origin.y) lf--, i--; /* Now we have the first line frag on this line. */ if (i > 0) { lf--, i--; } else { /* The previous line isn't in this text container, so we move to the previous text container. */ if (j > 0) { j--; tc--; i = tc->num_linefrags - 1; lf = tc->linefrags + i; } } /* Last line frag on previous line. */ while (i > 0 && lf[-1].rect.origin.y == lf->rect.origin.y) lf--, i--; /* First line frag on previous line. */ /* Invalidate all line frags that intersect the invalidated range. */ new_num = i; while (1) { for (; i < tc->num_linefrags + tc->num_soft; i++, lf++) { /* Since we must invalidate whole lines, we can only stop if the line frag is beyond the invalidated range, and the line frag is the first line frag in a line. */ if (lf->pos >= last_glyph && (!i || lf[-1].rect.origin.y != lf->rect.origin.y)) { break; } if (lf->points) { free(lf->points); lf->points = NULL; } if (lf->attachments) { free(lf->attachments); lf->attachments = NULL; } } if (i < tc->num_linefrags + tc->num_soft) break; tc->num_linefrags = new_num; tc->num_soft = 0; tc->was_invalidated = YES; tc->complete = NO; if (new_num) { tc->length = tc->linefrags[new_num-1].pos + tc->linefrags[new_num-1].length - tc->pos; } else { tc->pos = tc->length = 0; } j++, tc++; if (j == num_textcontainers) break; new_num = 0; i = 0; lf = tc->linefrags; } if (j == num_textcontainers) goto no_soft_invalidation; if (new_num != i) { /* There's a gap between the last valid line frag and the first soft line frag. Compact the linefrags. */ memmove(tc->linefrags + new_num, lf, sizeof(linefrag_t) * (tc->num_linefrags + tc->num_soft - i)); tc->num_linefrags -= i - new_num; i = new_num; lf = tc->linefrags + i; } tc->num_soft += tc->num_linefrags - new_num; tc->num_linefrags = new_num; tc->was_invalidated = YES; tc->complete = NO; if (new_num) { tc->length = tc->linefrags[new_num - 1].pos + tc->linefrags[new_num - 1].length - tc->pos; } else { tc->pos = tc->length = 0; } /* Soft invalidate all remaining layout. Update their glyph positions and set the soft-invalidate markers in the text containers. */ while (1) { for (; i < tc->num_linefrags + tc->num_soft; i++, lf++) { lf->pos += glyph_delta; for (k = 0; k < lf->num_points; k++) lf->points[k].pos += glyph_delta; for (k = 0; k < lf->num_attachments; k++) lf->attachments[k].pos += glyph_delta; } j++, tc++; if (j == num_textcontainers) break; i = 0; lf = tc->linefrags; tc->num_soft += tc->num_linefrags; tc->num_linefrags = 0; tc->was_invalidated = YES; tc->complete = NO; } no_soft_invalidation: /* Set layout_glyph and layout_char. */ for (i = num_textcontainers - 1, tc = textcontainers + i; i >= 0; i--, tc--) { if (tc->num_linefrags) { layout_glyph = tc->pos + tc->length; if (layout_glyph == glyphs->glyph_length) layout_char = glyphs->char_length; else layout_char = [self characterIndexForGlyphAtIndex: layout_glyph]; /* TODO? */ break; } } if (i < 0) layout_glyph = layout_char = 0; } else { int i, j; linefrag_t *lf; textcontainer_t *tc; /* TODO: could handle this better, but it should be a rare case, handling it efficiently is tricky. For now, we simply clear out all soft invalidation information. */ for (i = 0, tc = textcontainers; i < num_textcontainers; i++, tc++) { for (j = 0, lf = tc->linefrags + tc->num_linefrags; j < tc->num_soft; j++, lf++) { if (lf->points) { free(lf->points); lf->points = NULL; } if (lf->attachments) { free(lf->attachments); lf->attachments = NULL; } } tc->num_soft = 0; if (tc->pos + tc->length == r.location) { tc->complete = NO; } } } /* Clear the extra line fragment information. */ extra_textcontainer = nil; /* [self _dumpLayout]; printf("*** done\n");*/ [self _didInvalidateLayout]; if (mask & NSTextStorageEditedCharacters) { /* Adjust the selected range so it's still valid. We don't try to be smart here (smart adjustments will have to be done by whoever made the change), we just want to keep it in range to avoid crashes. TODO: It feels slightly ugly to be doing this here, but there aren't many other places that can do this, and it gives reasonable behavior for select-only text views. One option is to only adjust when absolutely necessary to keep the selected range valid. Current behavior for all cases: Start End Action (of selection, wrt range, before change) -------------------------- after after location += lengthChange; in after length = NSMaxRange(sel)-NSMaxRange(range)-lengthChange; location=NSMaxRange(range); in in length = 0; location=NSMaxRange(range); before after length += lengthChange; before in length = range.location-location; before before do nothing In other words, unless the selection spans over the entire changed range, the changed range is deselected. One important property of this behavior is that if length is 0 before, it will be 0 after. */ NSRange newRange = _selected_range; if (_selected_range.location >= NSMaxRange(range) - lengthChange) { /* after after */ newRange.location += lengthChange; } else if (_selected_range.location >= range.location) { if (NSMaxRange(_selected_range) > NSMaxRange(range) - lengthChange) { /* in after */ newRange.length = NSMaxRange(_selected_range) - NSMaxRange(range) - lengthChange; newRange.location = NSMaxRange(range); } else { /* in in */ newRange.length = 0; newRange.location = NSMaxRange(range); } } else if (NSMaxRange(_selected_range) > NSMaxRange(range) - lengthChange) { /* before after */ newRange.length += lengthChange; } else if (NSMaxRange(_selected_range) > range.location) { /* before in */ newRange.length = range.location - _selected_range.location; } else { /* before before */ } /* If there are text views attached to us, let them handle the change. */ if ([self firstTextView]) [[self firstTextView] setSelectedRange: newRange]; else _selected_range = newRange; } } - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { int flags = // FIXME attribute not yet supported by GNUstep //defaultAttachementScaling | (backgroundLayoutEnabled ? 0x04 : 0) | (showsInvisibleCharacters ? 0x08 : 0) | (showsControlCharacters ? 0x10 : 0); [aCoder encodeObject: [self textContainers] forKey: @"NSTextContainers"]; [aCoder encodeObject: [self textStorage] forKey: @"NSTextStorage"]; [aCoder encodeObject: [self delegate] forKey: @"NSDelegate"]; [aCoder encodeInt: flags forKey: @"NSLMFlags"]; } } - (id) initWithCoder: (NSCoder*)aDecoder { self = [self init]; if ([aDecoder allowsKeyedCoding]) { int i; int flags; NSArray *array = [aDecoder decodeObjectForKey: @"NSTextContainers"]; NSTextStorage *storage = [aDecoder decodeObjectForKey: @"NSTextStorage"]; id delegate = [aDecoder decodeObjectForKey: @"NSDelegate"]; if ([aDecoder containsValueForKey: @"NSLMFlags"]) { flags = [aDecoder decodeIntForKey: @"NSLMFlags"]; // FIXME attribute not yet supported by GNUstep //defaultAttachementScaling = (NSImageScaling)(flags & 0x03); backgroundLayoutEnabled = (flags & 0x04) != 0; showsInvisibleCharacters = (flags & 0x08) != 0; showsControlCharacters = (flags & 0x10) != 0; } [self setDelegate: delegate]; [storage addLayoutManager: self]; for (i = 0; i < [array count]; i++) { [self addTextContainer: [array objectAtIndex: i]]; } return self; } else { return self; } } @end @implementation GSDummyMutableString - (id)initWithLength: (NSUInteger)aLength { self = [super init]; if (self != nil) { self->_length = aLength; } return self; } - (NSUInteger)length { return _length; } - (unichar)characterAtIndex: (NSUInteger)index { return 0; } - (void)replaceCharactersInRange:(NSRange)range withString:(NSString *)aString { _length = (_length - range.length) + [aString length]; } - (id) copyWithZone: (NSZone*)zone { return [self mutableCopyWithZone: zone]; } - (id) mutableCopyWithZone: (NSZone*)zone { return [[GSDummyMutableString allocWithZone: zone] initWithLength: _length]; } @end @implementation NSLayoutManager (temporaryattributes) - (NSMutableAttributedString*) _temporaryAttributes { if (_temporaryAttributes == nil) { NSString *dummyString = [[GSDummyMutableString alloc] initWithLength: [[self textStorage] length]]; _temporaryAttributes = [[NSMutableAttributedString alloc] initWithString: dummyString]; [dummyString release]; } return _temporaryAttributes; } - (void) setTemporaryAttributes: (NSDictionary *)attrs forCharacterRange: (NSRange)range { [[self _temporaryAttributes] setAttributes: attrs range: range]; [self invalidateDisplayForCharacterRange: range]; } - (NSDictionary *) temporaryAttributesAtCharacterIndex: (NSUInteger)index effectiveRange: (NSRange*)longestRange { return [[self _temporaryAttributes] attributesAtIndex: index effectiveRange: longestRange]; } - (void) addTemporaryAttributes: (NSDictionary *)attrs forCharacterRange: (NSRange)range { [[self _temporaryAttributes] addAttributes: attrs range: range]; [self invalidateDisplayForCharacterRange: range]; } - (void) addTemporaryAttribute: (NSString *)attr value: (id)value forCharacterRange: (NSRange)range { [[self _temporaryAttributes] addAttribute: attr value: value range: range]; [self invalidateDisplayForCharacterRange: range]; } - (void) removeTemporaryAttribute: (NSString *)attr forCharacterRange: (NSRange)range { [[self _temporaryAttributes] removeAttribute: attr range: range]; [self invalidateDisplayForCharacterRange: range]; } - (id) temporaryAttribute: (NSString *)attr atCharacterIndex: (NSUInteger)index effectiveRange: (NSRange*)range { return [[self _temporaryAttributes] attribute: attr atIndex: index effectiveRange: range]; } - (id) temporaryAttribute: (NSString *)attr atCharacterIndex: (NSUInteger)index longestEffectiveRange: (NSRange*)longestRange inRange: (NSRange)range { return [[self _temporaryAttributes] attribute: attr atIndex: index longestEffectiveRange: longestRange inRange: range]; } - (NSDictionary *) temporaryAttributesAtCharacterIndex: (NSUInteger)index longestEffectiveRange: (NSRange*)longestRange inRange: (NSRange)range { return [[self _temporaryAttributes] attributesAtIndex: index longestEffectiveRange: longestRange inRange: range]; } /** * Most of this is implemented in GSLayoutManager */ - (void) setTextStorage: (NSTextStorage *)aTextStorage { DESTROY(_temporaryAttributes); [super setTextStorage: aTextStorage]; } @end gnustep-gui-0.24.0/Source/NSBitmapImageRep+PNM.m0000664000076500007650000000750011376454556021117 0ustar brains99brains99/* NSBitmapImageRep+PNM Methods for reading PNM images Copyright (C) 2003 Free Software Foundation, Inc. Written by: Adam Fedor Date: Oct 2003 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import "AppKit/NSGraphics.h" #import "NSBitmapImageRep+PNM.h" @implementation NSBitmapImageRep (PNM) /* Return YES if this is a pgm or ppm file (raw only for now) */ + (BOOL) _bitmapIsPNM: (NSData *)imageData { const char *bytes = [imageData bytes]; /* 3/4 bytes header line, 4/5 bytes size, 2/3 bytes depth. Thus, the image must have a least 9 bytes. */ if ([imageData length]<9) return NO; if (bytes[0] == 'P' && (bytes[2]=='\n' || bytes[2]=='\r')) { if (bytes[1] == '5' || bytes[1] == '6') return YES; } return NO; } #define GET_LINE() \ do \ { \ char *p = buffer; \ while (*ptr != '\n' && *ptr != '\r' && (ptr-bytes) < length) \ { \ *p++ = *ptr++; \ if (p == &buffer[sizeof(buffer)]) \ { \ ERRMSG(@"PNM header line too long"); \ } \ } \ ptr++; \ *p = '\0'; \ } while (0) #define ERRMSG(msg) \ do { NSLog(@"Error loading PNM: %@", msg); if (error) *error = msg; RELEASE(self); return nil; } while (0) /* Read the ppm image. Assume it is a ppm file and imageData is not nil */ -(id) _initBitmapFromPNM: (NSData *)imageData errorMessage: (NSString **)error { int num, xsize, ysize, levels; char ptype; char buffer[256]; unsigned char *pchar; unsigned length; id colorspace; const char *ptr; const char *bytes = [imageData bytes]; /* magic number */ ptr = bytes; length = [imageData length]; GET_LINE(); if (bytes[0] != 'P') ERRMSG(@"Invalid PNM header (magic number)"); ptype = bytes[1]; if (ptype != '5' && ptype != '6') ERRMSG(@"Unsupported PNM type"); do { GET_LINE(); } while (buffer[0] == '#'); num = sscanf(buffer, "%d %d", &xsize, &ysize); if (num != 2 || xsize <= 0 || ysize <= 0) ERRMSG(@"Invalid PNM header (xsize/ysize)"); if (xsize * ysize > (1 << 31)) ERRMSG(@"Invalid PNM header (image size:xsize*ysize too large)"); GET_LINE(); num = sscanf(buffer, "%d", &levels); if (num != 1) ERRMSG(@"Invalid PNM header (levels)"); colorspace = (ptype == '5') ? NSDeviceBlackColorSpace : NSDeviceRGBColorSpace; self = [self initWithBitmapDataPlanes: NULL pixelsWide: xsize pixelsHigh: ysize bitsPerSample: 8 samplesPerPixel: (ptype == '5') ? 1 : 3 hasAlpha: NO isPlanar: NO colorSpaceName: colorspace bytesPerRow: 0 bitsPerPixel: 0]; if ([self bytesPerRow] * ysize > (length - (ptr - bytes))) ERRMSG(@"Invalid PNM file (short data)"); pchar = [self bitmapData]; if (levels < 256) { memcpy(pchar, ptr, [self bytesPerRow] * ysize); } else { ERRMSG(@"Cannot handle > 256 level PNM files"); } return self; } @end gnustep-gui-0.24.0/Source/GSThemeInspector.m0000664000076500007650000001350511712303602020542 0ustar brains99brains99/** GSThemeInspector Utility fgor inspecting themes Copyright (C) 2008 Free Software Foundation, Inc. Author: Richard Frith-Macdonald Date: 2007,2008 This file is part of the GNU Objective C User interface library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "AppKit/NSImageView.h" #import "AppKit/NSClipView.h" #import "AppKit/NSScrollView.h" #import "AppKit/NSTextField.h" #import "AppKit/NSTextContainer.h" #import "AppKit/NSTextView.h" #import "AppKit/NSWindow.h" #import "GSThemePrivate.h" #import "GSGuiPrivate.h" static NSTextField * new_label (NSString *value) { NSTextField *t; t = AUTORELEASE([NSTextField new]); [t setStringValue: value]; [t setDrawsBackground: NO]; [t setEditable: NO]; [t setSelectable: NO]; [t setBezeled: NO]; [t setBordered: NO]; [t setAlignment: NSLeftTextAlignment]; return t; } /* Implemented in GSInfoPanel.m * An object that displays a list of left-aligned strings (used for the authors) */ @interface _GSLabelListView: NSView { } /* After initialization, its size is the size it needs, just move it where we want it to show */ - (id) initWithStringArray: (NSArray *)array font: (NSFont *)font; @end @implementation GSThemeInspector static GSThemeInspector *sharedInspector = nil; + (GSThemeInspector*) sharedThemeInspector { if (sharedInspector == nil) { sharedInspector = [self new]; } return sharedInspector; } - (id) init { NSRect frame; frame.size = NSMakeSize(272,388); frame.origin = NSZeroPoint; self = [super initWithContentRect: frame styleMask: (NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask) backing: NSBackingStoreBuffered defer: NO]; [self setReleasedWhenClosed: NO]; return self; } - (void) update: (id)sender { GSTheme *theme = [GSTheme theme]; NSString *version; NSString *details; NSArray *authors; NSView *content = [self contentView]; NSRect cFrame = [content frame]; NSView *view; NSImageView *iv; NSTextField *tf; NSRect nameFrame; NSRect frame; int width; int fsize = 32; while ((view = [[content subviews] lastObject]) != nil) { [view removeFromSuperview]; } frame = NSMakeRect(cFrame.size.width - 58, cFrame.size.height - 58, 48, 48); iv = [[NSImageView alloc] initWithFrame: frame]; [iv setImage: [[GSTheme theme] icon]]; [content addSubview: iv]; RELEASE(iv); width = cFrame.size.width - 58; tf = new_label([theme name]); do { [tf setFont: [NSFont boldSystemFontOfSize: fsize]]; fsize -= 2; [tf sizeToFit]; nameFrame = [tf frame]; } while (nameFrame.size.width > width && fsize > 8); nameFrame.origin.x = (width - nameFrame.size.width) / 2; nameFrame.origin.y = cFrame.size.height - nameFrame.size.height - 25; [tf setFrame: nameFrame]; [content addSubview: tf]; version = [[theme infoDictionary] objectForKey: @"GSThemeVersion"]; if ([version length] > 0) { version = [NSString stringWithFormat: _(@"Version: %@"), version]; tf = new_label(version); [tf setFont: [NSFont systemFontOfSize: 12]]; [tf sizeToFit]; frame = [tf frame]; frame.origin.x = (cFrame.size.width - frame.size.width) / 2; frame.origin.y = nameFrame.origin.y - frame.size.height - 25; [tf setFrame: frame]; [content addSubview: tf]; nameFrame = [tf frame]; } authors = [[theme infoDictionary] objectForKey: @"GSThemeAuthors"]; if ([authors count] > 0) { view = [[_GSLabelListView alloc] initWithStringArray: authors font: [NSFont systemFontOfSize: 14]]; frame = [view frame]; frame.origin.x = (cFrame.size.width - frame.size.width) / 2; frame.origin.y = nameFrame.origin.y - frame.size.height - 25; [view setFrame: frame]; [content addSubview: view]; RELEASE(view); } details = [[theme infoDictionary] objectForKey: @"GSThemeDetails"]; if ([details length] > 0) { NSScrollView *s; NSTextView *v; NSRect r; r = NSMakeRect(10, 10, cFrame.size.width - 20, frame.origin.y - 20); s = [[NSScrollView alloc] initWithFrame: r]; [s setHasHorizontalScroller: NO]; [s setHasVerticalScroller: YES]; [s setBorderType: NSBezelBorder]; [s setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)]; [content addSubview: s]; RELEASE(s); r = [[s contentView] bounds]; v = [[NSTextView alloc] initWithFrame: r]; [v setBackgroundColor: [self backgroundColor]]; [v setHorizontallyResizable: YES]; [v setVerticallyResizable: YES]; [v setEditable: NO]; [v setRichText: YES]; [v setMinSize: NSMakeSize (0, 0)]; [v setMaxSize: NSMakeSize (1E7, 1E7)]; [v setAutoresizingMask: NSViewHeightSizable | NSViewWidthSizable]; [[v textContainer] setContainerSize: NSMakeSize (r.size.width, 1e7)]; [[v textContainer] setWidthTracksTextView: YES]; [v setString: details]; [s setDocumentView: v]; RELEASE(v); } [content setNeedsDisplay: YES]; } @end gnustep-gui-0.24.0/Source/NSLevelIndicator.m0000664000076500007650000000556711673147131020546 0ustar brains99brains99/* NSLevelIndicator.m The level indicator class Copyright (C) 2007 Free Software Foundation, Inc. Author: H. Nikolaus Schaller Date: 2006 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "AppKit/NSLevelIndicator.h" static Class cellClass; @implementation NSLevelIndicator /* * Class methods */ + (void) initialize { if (self == [NSLevelIndicator class]) { // Initial version [self setVersion: 1]; cellClass = [NSLevelIndicatorCell class]; } } /**

Returns the cell Class used by NSLevelIndicator. Used by subclasses.

See Also: +setCellClass:

*/ + (Class) cellClass { return cellClass; } /**

Sets the cell Class used by NSLevelIndicator to factoryId. Used by subclasses.

See Also: +setCellClass:

*/ + (void) setCellClass: (Class)class { cellClass = class; } - (double) maxValue { return [_cell maxValue]; } - (void) setMaxValue: (double) val { [_cell setMaxValue:val]; } - (double) minValue { return [_cell minValue]; } - (void) setMinValue: (double)val { [_cell setMinValue: val]; } - (double) warningValue { return [_cell warningValue]; } - (void) setWarningValue: (double)val { [_cell setWarningValue: val]; } - (double) criticalValue { return [_cell criticalValue]; } - (void) setCriticalValue: (double)val { [_cell setCriticalValue: val]; } - (NSInteger) numberOfMajorTickMarks { return [_cell numberOfMajorTickMarks]; } - (void) setNumberOfMajorTickMarks: (NSInteger)count { [_cell setNumberOfMajorTickMarks: count]; } - (NSInteger) numberOfTickMarks { return [_cell numberOfTickMarks]; } - (void) setNumberOfTickMarks: (NSInteger)count { [_cell setNumberOfTickMarks: count]; } - (NSTickMarkPosition) tickMarkPosition { return [_cell tickMarkPosition]; } - (void) setTickMarkPosition: (NSTickMarkPosition)pos { [_cell setTickMarkPosition:pos]; } - (double) tickMarkValueAtIndex: (NSInteger)index { return [_cell tickMarkValueAtIndex:index]; } - (NSRect) rectOfTickMarkAtIndex: (NSInteger)index { return [_cell rectOfTickMarkAtIndex:index]; } @end gnustep-gui-0.24.0/Source/NSFontDescriptor.m0000664000076500007650000001631711771356024020604 0ustar brains99brains99/** NSFontDescriptor The font descriptor class Copyright (C) 2007 Free Software Foundation, Inc. Author: H. Nikolaus Schaller Date: 2006 Extracted from NSFont: Fred Kiefer Date August 2007 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import #import #import #import #import #import #import #import "AppKit/NSFontDescriptor.h" #import "AppKit/NSFontManager.h" @interface NSFontManager (GNUstep) - (NSArray *) matchingFontDescriptorsFor: (NSDictionary *)attributes; @end @implementation NSFontDescriptor + (id) fontDescriptorWithFontAttributes: (NSDictionary *)attributes { return AUTORELEASE([[self alloc] initWithFontAttributes: attributes]); } + (id) fontDescriptorWithName: (NSString *)name matrix: (NSAffineTransform *)matrix { return [self fontDescriptorWithFontAttributes: [NSDictionary dictionaryWithObjectsAndKeys: name, NSFontNameAttribute, matrix, NSFontMatrixAttribute, nil]]; } + (id) fontDescriptorWithName: (NSString *)name size: (CGFloat)size { return [self fontDescriptorWithFontAttributes: [NSDictionary dictionaryWithObjectsAndKeys: name, NSFontNameAttribute, [NSString stringWithFormat: @"%f", size], NSFontSizeAttribute, nil]]; } - (NSDictionary *) fontAttributes { return _attributes; } - (NSFontDescriptor *) fontDescriptorByAddingAttributes: (NSDictionary *)attributes { NSMutableDictionary *m = [_attributes mutableCopy]; NSFontDescriptor *new; [m addEntriesFromDictionary: attributes]; new = [object_getClass(self) fontDescriptorWithFontAttributes: m]; RELEASE(m); return new; } - (NSFontDescriptor *) fontDescriptorWithFace: (NSString *)face { return [self fontDescriptorByAddingAttributes: [NSDictionary dictionaryWithObject: face forKey: NSFontFaceAttribute]]; } - (NSFontDescriptor *) fontDescriptorWithFamily: (NSString *)family { return [self fontDescriptorByAddingAttributes: [NSDictionary dictionaryWithObject: family forKey: NSFontFamilyAttribute]]; } - (NSFontDescriptor *) fontDescriptorWithMatrix: (NSAffineTransform *)matrix { return [self fontDescriptorByAddingAttributes: [NSDictionary dictionaryWithObject: matrix forKey: NSFontMatrixAttribute]]; } - (NSFontDescriptor *) fontDescriptorWithSize: (CGFloat)size { return [self fontDescriptorByAddingAttributes: [NSDictionary dictionaryWithObject: [NSString stringWithFormat:@"%f", size] forKey: NSFontSizeAttribute]]; } - (NSFontDescriptor *) fontDescriptorWithSymbolicTraits: (NSFontSymbolicTraits)symbolicTraits { NSDictionary *traits; traits = [self objectForKey: NSFontTraitsAttribute]; if (traits == nil) { traits = [NSDictionary dictionaryWithObject: [NSNumber numberWithUnsignedInt: symbolicTraits] forKey: NSFontSymbolicTrait]; } else { traits = AUTORELEASE([traits mutableCopy]); [(NSMutableDictionary*)traits setObject: [NSNumber numberWithUnsignedInt: symbolicTraits] forKey: NSFontSymbolicTrait]; } return [self fontDescriptorByAddingAttributes: [NSDictionary dictionaryWithObject: traits forKey: NSFontTraitsAttribute]]; } - (id) initWithFontAttributes: (NSDictionary *)attributes { if ((self = [super init]) != nil) { if (attributes) _attributes = [attributes copy]; else _attributes = [NSDictionary new]; } return self; } - (void) encodeWithCoder: (NSCoder *)aCoder { if ([aCoder allowsKeyedCoding]) { [aCoder encodeObject: _attributes forKey: @"NSAttributes"]; } else { [aCoder encodeObject: _attributes]; } } - (id) initWithCoder: (NSCoder *)aDecoder { if ([aDecoder allowsKeyedCoding]) { _attributes = RETAIN([aDecoder decodeObjectForKey: @"NSAttributes"]); } else { [aDecoder decodeValueOfObjCType: @encode(id) at: &_attributes]; } return self; } - (void) dealloc; { RELEASE(_attributes); [super dealloc]; } - (id) copyWithZone: (NSZone *)z { NSFontDescriptor *f = [object_getClass(self) allocWithZone: z]; if (f != nil) { f->_attributes = [_attributes copyWithZone: z]; } return f; } - (NSArray *) matchingFontDescriptorsWithMandatoryKeys: (NSSet *)keys { NSMutableDictionary *attributes= [NSMutableDictionary dictionaryWithCapacity: 4]; NSEnumerator *keyEnumerator; NSString *key; if (keys == nil) { keys = [NSSet setWithObjects: NSFontNameAttribute, NSFontFamilyAttribute, NSFontFaceAttribute, NSFontTraitsAttribute, nil]; } keyEnumerator = [keys objectEnumerator]; while ((key = [keyEnumerator nextObject]) != nil) { id value = [_attributes objectForKey: key]; if (value != nil) { [attributes setObject: value forKey: key]; } } return [[NSFontManager sharedFontManager] matchingFontDescriptorsFor: attributes]; } - (NSFontDescriptor *) matchingFontDescriptorWithMandatoryKeys: (NSSet *)keys { NSArray *found = [self matchingFontDescriptorsWithMandatoryKeys: keys]; if (found && ([found count] > 0)) { return [found objectAtIndex: 0]; } else { return nil; } } - (NSAffineTransform *) matrix { return [self objectForKey: NSFontMatrixAttribute]; } - (id) objectForKey: (NSString *)attribute { return [_attributes objectForKey: attribute]; } - (CGFloat) pointSize { id size = [self objectForKey: NSFontSizeAttribute]; if (size) { return [size doubleValue]; } else { return 0.0; } } - (NSString *) postscriptName { NSMutableString *family; NSString *face; family = AUTORELEASE([[self objectForKey: NSFontFamilyAttribute] mutableCopy]); face = [self objectForKey: NSFontFaceAttribute]; [family replaceOccurrencesOfString: @" " withString: @"" options: 0 range: NSMakeRange(0, [family length])]; if ([face isEqualToString: @"Regular"]) return family; return [NSString stringWithFormat: @"%@-%@", family, face]; } - (NSFontSymbolicTraits) symbolicTraits { NSDictionary *traits; traits = [self objectForKey: NSFontTraitsAttribute]; if (traits == nil) { return 0; } else { return [[traits objectForKey: NSFontSymbolicTrait] unsignedIntValue]; } } @end gnustep-gui-0.24.0/Source/NSScreen.m0000664000076500007650000002501612013442034017035 0ustar brains99brains99/** NSScreen Copyright (C) 1996, 2000 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Major modifications and updates Author: Gregory John Casamento Date: 2000 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import #import #import #import "AppKit/AppKitExceptions.h" #import "AppKit/NSApplication.h" #import "AppKit/NSInterfaceStyle.h" #import "AppKit/NSMenu.h" #import "AppKit/NSMenuView.h" #import "AppKit/NSScreen.h" #import "AppKit/NSWindow.h" #import "GNUstepGUI/GSDisplayServer.h" @interface NSScreen (Private) - (id) _initWithScreenNumber: (int)screen; @end @implementation NSScreen /* * Class methods */ + (void) initialize { if (self == [NSScreen class]) { [self setVersion: 1]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_resetScreens:) name: NSApplicationDidChangeScreenParametersNotification object: nil]; } } static NSMutableArray *screenArray = nil; /** * Resets the cached list of screens. */ + (void) _resetScreens: (NSNotification*)notification { [self resetScreens]; } + (void) resetScreens { DESTROY(screenArray); } /** * Returns an NSArray containing NSScreen instances representing all of the * screen devices attached to the computer. */ + (NSArray*) screens { int count = 0, index = 0; NSArray *screens; GSDisplayServer *srv; if (screenArray != nil) return screenArray; srv = GSCurrentServer(); screens = [srv screenList]; count = [screens count]; if (count == 0) { // something is wrong. This shouldn't happen. [NSException raise: NSWindowServerCommunicationException format: @"Unable to retrieve list of screens from window server."]; return nil; } screenArray = [NSMutableArray new]; // Iterate over the list for (index = 0; index < count; index++) { NSScreen *screen = nil; screen = [[NSScreen alloc] _initWithScreenNumber: [[screens objectAtIndex: index] intValue]]; [screenArray addObject: screen]; RELEASE(screen); } return [NSArray arrayWithArray: screenArray]; } // Creating NSScreen Instances /** * Gets information about the main screen. */ + (NSScreen*) mainScreen { NSWindow *keyWindow; keyWindow = [NSApp keyWindow]; if (keyWindow != nil) { return [keyWindow screen]; } else { NSArray *screenArray = [self screens]; if (screenArray != nil) { return [screenArray objectAtIndex: 0]; } else { return nil; } } } /** * Gets information about the screen with the highest depth (i.e. bits per pixel). */ + (NSScreen*) deepestScreen { NSArray *screenArray = [self screens]; NSEnumerator *screenEnumerator = nil; NSScreen *deepestScreen = nil, *screen = nil; int maxBits = 0; // Iterate over the list of screens and find the // one with the most depth. screenEnumerator = [screenArray objectEnumerator]; while ((screen = [screenEnumerator nextObject]) != nil) { int bits = 0; bits = [screen depth]; if (bits > maxBits) { maxBits = bits; deepestScreen = screen; } } return deepestScreen; } /* * Instance methods */ /** * NSScreen does not respond to the init method. */ - (id) init { [self doesNotRecognizeSelector: _cmd]; return nil; } /** * Get all of the infomation for a given screen. */ - (id) _initWithScreenNumber: (int)screen { GSDisplayServer *srv; if (!(self = [super init])) { return nil; } // Check for problems if (screen < 0) { NSLog(@"Internal error: Invalid screen number %d\n", screen); RELEASE(self); return nil; } srv = GSCurrentServer(); if (srv == nil) { NSLog(@"Internal error: No current context\n"); RELEASE(self); return nil; } // Fill in all of the i-vars with appropriate values. _screenNumber = screen; _frame = [srv boundsForScreen: _screenNumber]; _depth = [srv windowDepthForScreen: _screenNumber]; _supportedWindowDepths = NULL; return self; } - (BOOL) isEqual: (id)anObject { if (anObject == self) return YES; if ([anObject isKindOfClass: [self class]] == NO) return NO; if (_screenNumber == ((NSScreen *)anObject)->_screenNumber) return YES; return NO; } /** * Returns the depth of the screen in bits. */ - (NSWindowDepth) depth { return _depth; } /** * The full frame of the screen. */ - (NSRect) frame { return _frame; } - (NSString*) description { return [NSString stringWithFormat: @"%@ number: %ld frame: %@", [super description], (long)_screenNumber, NSStringFromRect(_frame)]; } /** *

* This method generates a dictionary containing information * about the screen device. The resulting dictionary will have the following * entires: NSScreenNumber, NSDeviceSize, NSDeviceResolution, NSDeviceBitsPerSample, * NSDeviceColorSpaceName. *

*/ - (NSDictionary*) deviceDescription { if (_reserved == 0) { NSMutableDictionary *devDesc; int bps = 0; NSSize screenResolution; NSString *colorSpaceName = nil; CGFloat scaleFactor; /* * This method generates a dictionary from the * information we have gathered from the screen. */ // Set the screen number in the current object. devDesc = [[NSMutableDictionary alloc] initWithCapacity: 8]; [devDesc setObject: [NSNumber numberWithInt: _screenNumber] forKey: @"NSScreenNumber"]; // This is assumed since we are in NSScreen. [devDesc setObject: @"YES" forKey: NSDeviceIsScreen]; // Add the NSDeviceSize dictionary item [devDesc setObject: [NSValue valueWithSize: _frame.size] forKey: NSDeviceSize]; // Add the NSDeviceResolution dictionary item scaleFactor = [self userSpaceScaleFactor]; screenResolution = NSMakeSize(72.0 * scaleFactor, 72.0 * scaleFactor); [devDesc setObject: [NSValue valueWithSize: screenResolution] forKey: NSDeviceResolution]; // Add the bits per sample entry bps = NSBitsPerSampleFromDepth(_depth); [devDesc setObject: [NSNumber numberWithInt: bps] forKey: NSDeviceBitsPerSample]; // Add the color space entry. colorSpaceName = NSColorSpaceFromDepth(_depth); [devDesc setObject: colorSpaceName forKey: NSDeviceColorSpaceName]; _reserved = (void*)[devDesc copy]; RELEASE(devDesc); } return (NSDictionary*)_reserved; } // Mac OS X methods /** * Returns the window depths this screen will support. */ - (const NSWindowDepth*) supportedWindowDepths { // If the variable isn't initialized, get the info and // store it for the future. if (_supportedWindowDepths == NULL) { _supportedWindowDepths = (NSWindowDepth*)[GSCurrentServer() availableDepthsForScreen: _screenNumber]; // Check the results if (_supportedWindowDepths == NULL) { NSLog(@"Internal error: no depth list returned from window server."); return NULL; } } return _supportedWindowDepths; } /** * Returns the NSRect representing the visible area of the screen. */ - (NSRect) visibleFrame { NSRect visFrame = _frame; float menuHeight; switch (NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil)) { case NSMacintoshInterfaceStyle: if ([NSApp mainMenu] == nil) { // No menu yet ... assume a standard height menuHeight = [NSMenuView menuBarHeight]; } else { menuHeight = [[[NSApp mainMenu] window] frame].size.height; } visFrame.size.height -= menuHeight; break; case GSWindowMakerInterfaceStyle: case NSNextStepInterfaceStyle: /* FIXME: Menu width will vary from app to app and there is no * fixed position for the menu ... should we be making room for * a menu top left, or something else? */ #if 0 if ([NSApp mainMenu] != nil) { float menuWidth = [[[NSApp mainMenu] window] frame].size.width; visFrame.size.width -= menuWidth; visFrame.origin.x += menuWidth; } #endif break; default: break; } return visFrame; } /** Returns the screen number */ - (int) screenNumber { return _screenNumber; } // Release the memory for the depths array. - (void) dealloc { // _supportedWindowDepths can be NULL since it may or may not // be necessary to get this info. The most common use of NSScreen // is to get the depth and frame attributes. if (_supportedWindowDepths != NULL) { NSZoneFree(NSDefaultMallocZone(), _supportedWindowDepths); } if (_reserved != 0) { [(id)_reserved release]; } [super dealloc]; } - (float) userSpaceScaleFactor { NSNumber *factor = [[NSUserDefaults standardUserDefaults] objectForKey: @"GSScaleFactor"]; if (factor != nil) { return [factor floatValue]; } else { GSDisplayServer *srv = GSCurrentServer(); if (srv != nil) { NSSize dpi = [GSCurrentServer() resolutionForScreen: _screenNumber]; // average the width and height return (dpi.width + dpi.height) / 144.0; } else { return 1.0; } } } @end gnustep-gui-0.24.0/Source/CompatibilityHeaders.make0000664000076500007650000000461411023376255022157 0ustar brains99brains99# -*-makefile-*- # CompatibilityHeaders.make # # Create compatibility headers so that code written before the big header # move will continue to compile (for a while). # # Copyright (C) 2003 Free Software Foundation, Inc. # # Author: Alexander Malmberg # Date: 2003-07-29 # # This file is part of the GNUstep project. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # The usage should be fairly obvious. For each pair of OLD_DIR and NEW_DIR, # make a copy and set OLD_DIR, NEW_DIR, and LIST. Note that LIST must be # non-empty; if there are no files for a pair, remove it completely. after-install:: @echo Installing compatibility headers... $(ECHO_NOTHING)OLD_DIR=AppKit; NEW_DIR=GNUstepGUI; \ LIST="$(GUI_HEADERS)" ;\ $(MKDIRS) $(GNUSTEP_HEADERS)/$$OLD_DIR; \ for I in $$LIST ; do \ (echo "#warning $$I is now included using the path <$$NEW_DIR/$$I>";\ echo "#include <$$NEW_DIR/$$I>" ) \ > $(GNUSTEP_HEADERS)/$$OLD_DIR/$$I; \ done$(END_ECHO) $(ECHO_NOTHING)OLD_DIR=gnustep/gui; NEW_DIR=GNUstepGUI; \ LIST="$(GUI_HEADERS)" ;\ $(MKDIRS) $(GNUSTEP_HEADERS)/$$OLD_DIR; \ for I in $$LIST ; do \ (echo "#warning $$I is now included using the path <$$NEW_DIR/$$I>";\ echo "#include <$$NEW_DIR/$$I>" ) \ > $(GNUSTEP_HEADERS)/$$OLD_DIR/$$I; \ done$(END_ECHO) after-uninstall:: @echo Uninstalling compatibility headers... $(ECHO_NOTHING)OLD_DIR=AppKit; \ LIST="$(GUI_HEADERS)" ;\ for I in $$LIST ; do \ rm -f $(GNUSTEP_HEADERS)/$$OLD_DIR/$$I; \ done$(END_ECHO) $(ECHO_NOTHING)OLD_DIR=gnustep/gui; \ LIST="$(GUI_HEADERS)" ;\ for I in $$LIST ; do \ rm -f $(GNUSTEP_HEADERS)/$$OLD_DIR/$$I; \ done$(END_ECHO) gnustep-gui-0.24.0/Source/NSSegmentedCell.m0000664000076500007650000004025312110205434020330 0ustar brains99brains99/* NSSegmentedCell.m * * Copyright (C) 2007 Free Software Foundation, Inc. * * Author: Gregory John Casamento * Date: 2007 * * This file is part of GNUstep. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 * USA. */ #import #import #import #import "AppKit/NSColor.h" #import "AppKit/NSEvent.h" #import "AppKit/NSFont.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSImage.h" #import "AppKit/NSMenu.h" #import "AppKit/NSSegmentedCell.h" #import "AppKit/NSStringDrawing.h" #import "GNUstepGUI/GSTheme.h" @interface NSSegmentItem : NSObject { BOOL _selected; BOOL _enabled; NSInteger _tag; CGFloat _width; NSMenu *_menu; NSString *_label; NSString *_tool_tip; NSImage *_image; NSRect _frame; } - (BOOL) isSelected; - (void) setSelected: (BOOL)flag; - (BOOL) isEnabled; - (void) setEnabled: (BOOL)flag; - (NSMenu *) menu; - (void) setMenu: (NSMenu *)menu; - (NSString *) label; - (void) setLabel: (NSString *)label; - (NSString *) toolTip; - (void) setToolTip: (NSString *)toolTip; - (NSImage *) image; - (void) setImage: (NSImage *)image; - (NSInteger) tag; - (void) setTag: (NSInteger)tag; - (CGFloat) width; - (void) setWidth: (CGFloat)width; - (NSRect) frame; - (void) setFrame: (NSRect)frame; @end @implementation NSSegmentItem - (id) init { self = [super init]; if (nil == self) return nil; _enabled = YES; return self; } - (void) dealloc { TEST_RELEASE(_label); TEST_RELEASE(_image); TEST_RELEASE(_menu); TEST_RELEASE(_tool_tip); [super dealloc]; } - (BOOL) isSelected { return _selected; } - (void) setSelected: (BOOL)flag { _selected = flag; } - (BOOL) isEnabled { return _enabled; } - (void) setEnabled: (BOOL)flag { _enabled = flag; } - (NSMenu *) menu { return _menu; } - (void) setMenu: (NSMenu *)menu { ASSIGN(_menu, menu); } - (NSString *) label { return _label; } - (void) setLabel: (NSString *)label { ASSIGN(_label, label); } - (NSString *) toolTip { return _tool_tip; } - (void) setToolTip: (NSString *)toolTip { ASSIGN(_tool_tip, toolTip); } - (NSImage *) image { return _image; } - (void) setImage: (NSImage *)image { ASSIGN(_image, image); } - (NSInteger) tag { return _tag; } - (void) setTag: (NSInteger)tag { _tag = tag; } - (CGFloat) width { return _width; } - (void) setWidth: (CGFloat)width { _width = width; } - (NSRect) frame { return _frame; } - (void) setFrame: (NSRect)frame { _frame = frame; } - (void) encodeWithCoder:(NSCoder *) aCoder { if ([aCoder allowsKeyedCoding]) { if (_label != nil) [aCoder encodeObject: _label forKey: @"NSSegmentItemLabel"]; if (_image != nil) [aCoder encodeObject: _image forKey: @"NSSegmentItemImage"]; if (_menu != nil) [aCoder encodeObject: _menu forKey: @"NSSegmentItemMenu"]; if (_enabled) [aCoder encodeBool: YES forKey: @"NSSegmentItemEnabled"]; else [aCoder encodeBool: YES forKey: @"NSSegmentItemDisabled"]; if (_selected) [aCoder encodeBool: YES forKey: @"NSSegmentItemSelected"]; if (_width != 0.0) [aCoder encodeFloat: _width forKey: @"NSSegmentItemWidth"]; if (_tag != 0) [aCoder encodeInt: _tag forKey: @"NSSegmentItemTag"]; } else { [aCoder encodeObject: _label]; [aCoder encodeObject: _image]; [aCoder encodeObject: _menu]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_enabled]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_selected]; [aCoder encodeValueOfObjCType: @encode(CGFloat) at: &_width]; [aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_tag]; } } - (id) initWithCoder: (NSCoder *)aDecoder { if ([aDecoder allowsKeyedCoding]) { if ([aDecoder containsValueForKey: @"NSSegmentItemLabel"]) [self setLabel: [aDecoder decodeObjectForKey: @"NSSegmentItemLabel"]]; if ([aDecoder containsValueForKey: @"NSSegmentItemImage"]) [self setImage: [aDecoder decodeObjectForKey: @"NSSegmentItemImage"]]; if ([aDecoder containsValueForKey: @"NSSegmentItemMenu"]) [self setMenu: [aDecoder decodeObjectForKey: @"NSSegmentItemMenu"]]; if ([aDecoder containsValueForKey: @"NSSegmentItemEnabled"]) _enabled = [aDecoder decodeBoolForKey: @"NSSegmentItemEnabled"]; else if ([aDecoder containsValueForKey: @"NSSegmentItemDisabled"]) _enabled = ![aDecoder decodeBoolForKey: @"NSSegmentItemDisabled"]; else _enabled = YES; if ([aDecoder containsValueForKey: @"NSSegmentItemSelected"]) _selected = [aDecoder decodeBoolForKey: @"NSSegmentItemSelected"]; if ([aDecoder containsValueForKey: @"NSSegmentItemWidth"]) _width = [aDecoder decodeFloatForKey: @"NSSegmentItemWidth"]; if ([aDecoder containsValueForKey: @"NSSegmentItemTag"]) _tag = [aDecoder decodeIntForKey: @"NSSegmentItemTag"]; } else { ASSIGN(_label,[aDecoder decodeObject]); ASSIGN(_image,[aDecoder decodeObject]); ASSIGN(_menu, [aDecoder decodeObject]); [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_enabled]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_selected]; [aDecoder decodeValueOfObjCType: @encode(CGFloat) at: &_width]; [aDecoder decodeValueOfObjCType: @encode(NSInteger) at: &_tag]; } return self; } @end @implementation NSSegmentedCell - (id) init { self = [super initTextCell: @""]; if (!self) return nil; _segmentCellFlags._tracking_mode = NSSegmentSwitchTrackingSelectOne; _items = [[NSMutableArray alloc] initWithCapacity: 2]; _selected_segment = -1; [self setAlignment: NSCenterTextAlignment]; return self; } - (id) initImageCell: (NSImage*)anImage { self = [super initImageCell: anImage]; if (!self) return nil; _segmentCellFlags._tracking_mode = NSSegmentSwitchTrackingSelectOne; _items = [[NSMutableArray alloc] initWithCapacity: 2]; _selected_segment = -1; [self setAlignment: NSCenterTextAlignment]; return self; } - (id) initTextCell: (NSString*)aString { self = [super initTextCell: aString]; if (!self) return nil; _segmentCellFlags._tracking_mode = NSSegmentSwitchTrackingSelectOne; _items = [[NSMutableArray alloc] initWithCapacity: 2]; _selected_segment = -1; [self setAlignment: NSCenterTextAlignment]; return self; } - (id) copyWithZone: (NSZone *)zone; { NSSegmentedCell *c = (NSSegmentedCell *)[super copyWithZone: zone]; if (c) { // FIXME: Need a deep copy here c->_items = [_items copyWithZone: zone]; } return c; } - (void) dealloc { TEST_RELEASE(_items); [super dealloc]; } // Specifying number of segments... - (void) setSegmentCount: (NSInteger)count { NSInteger size; if ((count < 0) || (count > 2048)) { [NSException raise: NSRangeException format: @"Illegal segment count."]; } size = [_items count]; if (count < size) [_items removeObjectsInRange: NSMakeRange(count, size - count)]; while (count-- > size) { NSSegmentItem *item = [[NSSegmentItem alloc] init]; [_items addObject: item]; RELEASE(item); } } - (NSInteger) segmentCount { return [_items count]; } // Specifying selected segment... - (void) setSelectedSegment: (NSInteger)segment { [self setSelected: YES forSegment: segment]; } - (void) setSelected: (BOOL)flag forSegment: (NSInteger)seg { NSSegmentItem *segment = [_items objectAtIndex: seg]; NSSegmentItem *previous = nil; if (_selected_segment != -1) { previous = [_items objectAtIndex: _selected_segment]; if(_segmentCellFlags._tracking_mode == NSSegmentSwitchTrackingSelectOne) { [previous setSelected: NO]; } } if ([segment isEnabled]) { [segment setSelected: flag]; if (flag) { _selected_segment = seg; } else if (seg == _selected_segment) { _selected_segment = -1; } } } - (NSInteger) selectedSegment { return _selected_segment; } - (void) selectSegmentWithTag: (NSInteger)tag { NSEnumerator *en = [_items objectEnumerator]; id o = nil; NSInteger segment = 0; while ((o = [en nextObject]) != nil) { if([o tag] == tag) { break; } segment++; } [self setSelected: YES forSegment: segment]; } - (void) makeNextSegmentKey { NSInteger next; if (_selected_segment < [_items count]) { next = _selected_segment + 1; } else { next = 0; } [self setSelected: NO forSegment: _selected_segment]; [self setSelected: YES forSegment: next]; } - (void) makePreviousSegmentKey { NSInteger prev; if (_selected_segment > 0) { prev = _selected_segment - 1; } else { prev = 0; } [self setSelected: NO forSegment: _selected_segment]; [self setSelected: YES forSegment: prev]; } // Specify tracking mode... - (void) setTrackingMode: (NSSegmentSwitchTracking)mode { _segmentCellFlags._tracking_mode = mode; } - (NSSegmentSwitchTracking) trackingMode { return _segmentCellFlags._tracking_mode; } // Working with individual segments... - (void) setWidth: (CGFloat)width forSegment: (NSInteger)seg { id segment = [_items objectAtIndex: seg]; [segment setWidth: width]; } - (CGFloat) widthForSegment: (NSInteger)seg { id segment = [_items objectAtIndex: seg]; return [segment width]; } - (void) setImage: (NSImage *)image forSegment: (NSInteger)seg { id segment = [_items objectAtIndex: seg]; [segment setImage: image]; } - (NSImage *) imageForSegment: (NSInteger)seg { id segment = [_items objectAtIndex: seg]; return [segment image]; } - (void) setLabel: (NSString *)label forSegment: (NSInteger)seg { id segment = [_items objectAtIndex: seg]; [segment setLabel: label]; } - (NSString *) labelForSegment: (NSInteger)seg { id segment = [_items objectAtIndex: seg]; return [segment label]; } - (BOOL) isSelectedForSegment: (NSInteger)seg { id segment = [_items objectAtIndex: seg]; return [segment isSelected]; } - (void) setEnabled: (BOOL)flag forSegment: (NSInteger)seg { id segment = [_items objectAtIndex: seg]; return [segment setEnabled: flag]; } - (BOOL) isEnabledForSegment: (NSInteger)seg { id segment = [_items objectAtIndex: seg]; return [segment isEnabled]; } - (void) setMenu: (NSMenu *)menu forSegment: (NSInteger)seg { id segment = [_items objectAtIndex: seg]; return [segment setMenu: menu]; } - (NSMenu *) menuForSegment: (NSInteger)seg { id segment = [_items objectAtIndex: seg]; return [segment menu]; } - (void) setToolTip: (NSString *) toolTip forSegment: (NSInteger)seg { id segment = [_items objectAtIndex: seg]; return [segment setToolTip: toolTip]; } - (NSString *) toolTipForSegment: (NSInteger)seg { id segment = [_items objectAtIndex: seg]; return [segment toolTip]; } - (void) setTag: (NSInteger)tag forSegment: (NSInteger)seg { id segment = [_items objectAtIndex: seg]; return [segment setTag: tag]; } - (NSInteger) tagForSegment: (NSInteger)seg { id segment = [_items objectAtIndex: seg]; return [segment tag]; } // Drawing custom content - (void) drawSegment: (NSInteger)seg inFrame: (NSRect)frame withView: (NSView *)view { id segment = [_items objectAtIndex: seg]; NSString *label = [segment label]; NSSize textSize = [label sizeWithAttributes: [NSDictionary dictionary]]; NSRect textFrame = frame; CGFloat x_offset = (frame.size.width - textSize.width) / 2; GSThemeControlState state = GSThemeNormalState; BOOL roundedLeft = NO; BOOL roundedRight = NO; textFrame.origin.x += x_offset; textFrame.size.width -= x_offset; [segment setFrame: frame]; if([segment isSelected]) { state = GSThemeSelectedState; } if (seg == 0) roundedLeft = YES; if (seg == ([_items count] - 1)) roundedRight = YES; [[GSTheme theme] drawSegmentedControlSegment: self withFrame: frame inView: [self controlView] style: [self segmentStyle] state: state roundedLeft: roundedLeft roundedRight: roundedRight]; [self _drawText: [segment label] inFrame: textFrame]; } - (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { NSInteger i; NSUInteger count = [_items count]; NSRect frame = cellFrame; NSRect controlFrame = [controlView frame]; for (i = 0; i < count;i++) { frame.size.width = [[_items objectAtIndex: i] width]; if(frame.size.width == 0.0) { frame.size.width = (controlFrame.size.width - frame.origin.x) / (count - i); } [self drawSegment: i inFrame: frame withView: controlView]; frame.origin.x += frame.size.width; if (frame.origin.x >= cellFrame.size.width) break; } } // Setting the style of the segments - (void) setSegmentStyle: (NSSegmentStyle)style { _segmentCellFlags._style = style; } - (NSSegmentStyle) segmentStyle { return _segmentCellFlags._style; } - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { [aCoder encodeObject: _items forKey: @"NSSegmentImages"]; if (_selected_segment != -1) [aCoder encodeInt: _selected_segment forKey: @"NSSelectedSegment"]; [aCoder encodeInt: _segmentCellFlags._style forKey: @"NSSegmentStyle"]; } else { int style; [aCoder encodeObject: _items]; [aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_selected_segment]; style = _segmentCellFlags._style; [aCoder encodeValueOfObjCType: @encode(int) at: &style]; } } - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if (!self) return nil; if ([aDecoder allowsKeyedCoding]) { NSUInteger i; _selected_segment = -1; _segmentCellFlags._tracking_mode = NSSegmentSwitchTrackingSelectOne; if ([aDecoder containsValueForKey: @"NSSegmentImages"]) ASSIGN(_items, [aDecoder decodeObjectForKey: @"NSSegmentImages"]); else _items = [[NSMutableArray alloc] initWithCapacity: 2]; for (i = 0; i < [_items count]; i++) { if ([self isSelectedForSegment: i]) _selected_segment = i; } if ([aDecoder containsValueForKey: @"NSSelectedSegment"]) { _selected_segment = [aDecoder decodeIntForKey: @"NSSelectedSegment"]; if (_selected_segment != -1) [self setSelectedSegment: _selected_segment]; } _segmentCellFlags._style = [aDecoder decodeIntForKey: @"NSSegmentStyle"]; } else { int style; _segmentCellFlags._tracking_mode = NSSegmentSwitchTrackingSelectOne; ASSIGN(_items,[aDecoder decodeObject]); [aDecoder decodeValueOfObjCType: @encode(NSInteger) at: &_selected_segment]; if (_selected_segment != -1) [self setSelectedSegment: _selected_segment]; [aDecoder decodeValueOfObjCType: @encode(int) at: &style]; _segmentCellFlags._style = style; } return self; } - (void) stopTracking: (NSPoint)lastPoint at: (NSPoint)stopPoint inView: (NSView*)controlView mouseIsUp: (BOOL)flag { NSInteger count = [self segmentCount]; NSInteger i = 0; [super stopTracking: lastPoint at: stopPoint inView: controlView mouseIsUp: (BOOL)flag]; for (i = 0; i < count; i++) { id segment = [_items objectAtIndex: i]; NSRect frame = [segment frame]; if(NSPointInRect(lastPoint,frame)) { [self setSelectedSegment: i]; break; } } } @end gnustep-gui-0.24.0/Source/NSImageRep.m0000664000076500007650000006055112220073171017314 0ustar brains99brains99/** NSImageRep Abstract representation of an image. Copyright (C) 1996 Free Software Foundation, Inc. Author: Adam Fedor Date: Feb 1996 This file is part of the GNUstep Application Kit Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include #import #import #import #import #import #import #import #import #import #import "AppKit/NSAffineTransform.h" #import "AppKit/NSImageRep.h" #import "AppKit/NSBitmapImageRep.h" #import "AppKit/NSCachedImageRep.h" #import "AppKit/NSEPSImageRep.h" #import "AppKit/NSPasteboard.h" #import "AppKit/NSGraphicsContext.h" #import "AppKit/NSView.h" #import "AppKit/NSColor.h" #import "AppKit/NSWindow.h" #import "AppKit/NSScreen.h" #import "AppKit/DPSOperators.h" #import "AppKit/PSOperators.h" #import "GNUstepGUI/GSImageMagickImageRep.h" static NSMutableArray *imageReps = nil; static Class NSImageRep_class = NULL; @implementation NSImageRep + (void) initialize { /* While there are four imageRep subclasses, in practice, only two of them can load in data from an external source. */ if (self == [NSImageRep class]) { NSImageRep_class = self; imageReps = [[NSMutableArray alloc] initWithCapacity: 4]; [imageReps addObject: [NSBitmapImageRep class]]; #if HAVE_IMAGEMAGICK [imageReps addObject: [GSImageMagickImageRep class]]; #endif } } // Managing NSImageRep Subclasses + (Class) imageRepClassForData: (NSData *)data { int i, count; count = [imageReps count]; for (i = 0; i < count; i++) { Class rep = [imageReps objectAtIndex: i]; if ([rep canInitWithData: data]) return rep; } return Nil; } + (Class) imageRepClassForFileType: (NSString *)type { int i, count; count = [imageReps count]; for (i = 0; i < count; i++) { Class rep = [imageReps objectAtIndex: i]; if ([[rep imageFileTypes] indexOfObject: type] != NSNotFound) { return rep; } } return Nil; } + (Class) imageRepClassForPasteboardType: (NSString *)type { int i, count; count = [imageReps count]; for (i = 0; i < count; i++) { Class rep = [imageReps objectAtIndex: i]; if ([[rep imagePasteboardTypes] indexOfObject: type] != NSNotFound) { return rep; } } return Nil; } + (void) registerImageRepClass: (Class)imageRepClass { if ([imageReps containsObject: imageRepClass] == NO) { Class c = imageRepClass; while (c != nil && c != [NSObject class] && c != [NSImageRep class]) { c = [c superclass]; } if (c != [NSImageRep class]) { [NSException raise: NSInvalidArgumentException format: @"Attempt to register non-imagerep class"]; } [imageReps addObject: imageRepClass]; } [[NSNotificationCenter defaultCenter] postNotificationName: NSImageRepRegistryChangedNotification object: self]; } + (NSArray *) registeredImageRepClasses { return (NSArray *)imageReps; } + (void) unregisterImageRepClass: (Class)imageRepClass { [imageReps removeObject: imageRepClass]; [[NSNotificationCenter defaultCenter] postNotificationName: NSImageRepRegistryChangedNotification object: self]; } // Creating an NSImageRep + (id) imageRepWithContentsOfFile: (NSString *)filename { NSArray* array; array = [self imageRepsWithContentsOfFile: filename]; if ([array count]) return [array objectAtIndex: 0]; return nil; } /* Helper for +imageRepsWithContentsOfFile: and imageRepsWithContentsOfURL:. It would make sense (and make initialization of images from data more natural for the user) to make this a real method and call it +imageRepsWithData:, but that's already the name of one of the method concrete image reps need to implement, so we can't do that. */ + (NSArray *) _imageRepsWithData: (NSData *)data { Class rep; if (self == NSImageRep_class) { rep = [self imageRepClassForData: data]; } else if ([self canInitWithData: data]) { rep = self; } else return nil; if ([rep respondsToSelector: @selector(imageRepsWithData:)]) return [rep imageRepsWithData: data]; else if ([rep respondsToSelector: @selector(imageRepWithData:)]) { NSImageRep *imageRep = [rep imageRepWithData: data]; if (imageRep != nil) return [NSArray arrayWithObject: imageRep]; } return nil; } + (NSArray *) imageRepsWithContentsOfFile: (NSString *)filename { NSString *ext; Class rep; NSData* data; // Is the file extension already the file type? ext = [filename pathExtension]; if (!ext) { /* With no extension, we can't tell the type from the file name. Use the data instead. */ data = [NSData dataWithContentsOfFile: filename]; return [self _imageRepsWithData: data]; } ext = [ext lowercaseString]; if (self == NSImageRep_class) { rep = [self imageRepClassForFileType: ext]; } else if ([[self imageFileTypes] containsObject: ext]) { rep = self; } else return nil; // filter non-native types to native format if (![[rep imageUnfilteredFileTypes] containsObject: ext]) { NSPasteboard *p = [NSPasteboard pasteboardByFilteringFile: filename]; NSArray *nativeTypes = [rep imageUnfilteredFileTypes]; NSMutableArray *ptypes = [NSMutableArray arrayWithCapacity: [nativeTypes count]]; NSEnumerator *enumerator = [nativeTypes objectEnumerator]; NSString *type; // Convert the native types to pasteboard types while ((type = [enumerator nextObject]) != nil) { NSString *type2 = NSCreateFileContentsPboardType(type); [ptypes addObject: type2]; } type = [p availableTypeFromArray: ptypes]; data = [p dataForType: type]; NSDebugLLog(@"NSImage", @"Filtering data for %@ from %@ of type %@ to %@", filename, p, type, data); } else { data = [NSData dataWithContentsOfFile: filename]; } if (nil == data) return nil; if ([rep respondsToSelector: @selector(imageRepsWithData:)]) { return [rep imageRepsWithData: data]; } else if ([rep respondsToSelector: @selector(imageRepWithData:)]) { NSImageRep *imageRep = [rep imageRepWithData: data]; if (imageRep != nil) return [NSArray arrayWithObject: imageRep]; } return nil; } + (id)imageRepWithContentsOfURL:(NSURL *)anURL { NSArray* array; array = [self imageRepsWithContentsOfURL: anURL]; if ([array count]) return [array objectAtIndex: 0]; return nil; } + (NSArray *)imageRepsWithContentsOfURL:(NSURL *)anURL { NSData *data; // FIXME: Should we use the file type for URLs or only check the data? data = [anURL resourceDataUsingCache: YES]; return [self _imageRepsWithData: data]; } + (id) imageRepWithPasteboard: (NSPasteboard *)pasteboard { NSArray* array; array = [self imageRepsWithPasteboard: pasteboard]; if ([array count]) return [array objectAtIndex: 0]; return nil; } + (NSArray *) imageRepsWithPasteboard: (NSPasteboard *)pasteboard { int i, count; NSMutableArray* array; NSArray *reps; if (self == NSImageRep_class) { reps = imageReps; } else { reps = [NSArray arrayWithObject: self]; } array = [NSMutableArray arrayWithCapacity: 1]; count = [reps count]; for (i = 0; i < count; i++) { NSString* ptype; Class rep = [reps objectAtIndex: i]; ptype = [pasteboard availableTypeFromArray: [rep imagePasteboardTypes]]; if (ptype != nil) { NSData* data = [pasteboard dataForType: ptype]; if ([rep respondsToSelector: @selector(imageRepsWithData:)]) [array addObjectsFromArray: [rep imageRepsWithData: data]]; else if ([rep respondsToSelector: @selector(imageRepWithData:)]) { NSImageRep *imageRep = [rep imageRepWithData: data]; if (rep != nil) [array addObject: imageRep]; } } } if ([array count] == 0) return nil; return (NSArray *)array; } // Checking Data Types + (BOOL) canInitWithData: (NSData *)data { /* Subclass responsibility */ return NO; } + (BOOL) canInitWithPasteboard: (NSPasteboard *)pasteboard { NSArray *pbTypes = [pasteboard types]; NSArray *myTypes = [self imageUnfilteredPasteboardTypes]; return ([pbTypes firstObjectCommonWithArray: myTypes] != nil); } + (NSArray *) imageFileTypes { NSArray *nativeTypes = [self imageUnfilteredFileTypes]; NSEnumerator *enumerator = [nativeTypes objectEnumerator]; NSMutableArray *filteredTypes = [[NSMutableArray alloc] initWithCapacity: [nativeTypes count]]; NSString *type; while ((type = [enumerator nextObject]) != nil) { NSEnumerator *enum2 = [[NSPasteboard typesFilterableTo: NSCreateFileContentsPboardType(type)] objectEnumerator]; NSString *type2; while ((type2 = [enum2 nextObject]) != nil) { NSString *fileType = NSGetFileType(type2); if (nil != fileType) { type2 = fileType; } if ([filteredTypes indexOfObject: type2] == NSNotFound) { [filteredTypes addObject: type2]; } } } return AUTORELEASE(filteredTypes); } + (NSArray *) imagePasteboardTypes { // FIXME: We should check what conversions are defined by services. return [self imageUnfilteredPasteboardTypes]; } + (NSArray *) imageUnfilteredFileTypes { /* Subclass responsibility */ return nil; } + (NSArray *) imageUnfilteredPasteboardTypes { /* Subclass responsibility */ return nil; } // Instance methods - (void) dealloc { RELEASE(_colorSpace); [super dealloc]; } // Setting the Size of the Image - (void) setSize: (NSSize)aSize { _size = aSize; } - (NSSize) size { return _size; } // Specifying Information about the Representation - (NSInteger) bitsPerSample { return _bitsPerSample; } - (NSString *) colorSpaceName { return _colorSpace; } - (BOOL) hasAlpha { return _hasAlpha; } - (BOOL) isOpaque { return _isOpaque; } - (NSInteger) pixelsWide { return _pixelsWide; } - (NSInteger) pixelsHigh { return _pixelsHigh; } - (void) setAlpha: (BOOL)flag { _hasAlpha = flag; } - (void) setBitsPerSample: (NSInteger)anInt { _bitsPerSample = anInt; } - (void) setColorSpaceName: (NSString *)aString { ASSIGN(_colorSpace, aString); } - (void) setOpaque: (BOOL)flag { _isOpaque = flag; } - (void) setPixelsWide: (NSInteger)anInt { _pixelsWide = anInt; } - (void) setPixelsHigh: (NSInteger)anInt { _pixelsHigh = anInt; } // Drawing the Image - (BOOL) draw { /* Subclass should implement this. */ return YES; } - (BOOL) drawAtPoint: (NSPoint)aPoint { BOOL ok, reset; NSGraphicsContext *ctxt; NSAffineTransform *ctm = nil; if (_size.width == 0 && _size.height == 0) return NO; NSDebugLLog(@"NSImage", @"Drawing at point %f %f\n", aPoint.x, aPoint.y); reset = 0; ctxt = GSCurrentContext(); if (aPoint.x != 0 || aPoint.y != 0) { ctm = GSCurrentCTM(ctxt); DPStranslate(ctxt, aPoint.x, aPoint.y); reset = 1; } ok = [self draw]; if (reset) GSSetCTM(ctxt, ctm); return ok; } - (BOOL) drawInRect: (NSRect)aRect { NSSize scale; BOOL ok; NSGraphicsContext *ctxt; NSAffineTransform *ctm; NSDebugLLog(@"NSImage", @"Drawing in rect (%f %f %f %f)\n", NSMinX(aRect), NSMinY(aRect), NSWidth(aRect), NSHeight(aRect)); if (_size.width == 0 && _size.height == 0) return NO; ctxt = GSCurrentContext(); scale = NSMakeSize(NSWidth(aRect) / _size.width, NSHeight(aRect) / _size.height); ctm = GSCurrentCTM(ctxt); DPStranslate(ctxt, NSMinX(aRect), NSMinY(aRect)); DPSscale(ctxt, scale.width, scale.height); ok = [self draw]; GSSetCTM(ctxt, ctm); return ok; } /* New code path that delegates as much as possible to the backend and whose behavior precisely matches Cocoa. */ - (void) nativeDrawInRect: (NSRect)dstRect fromRect: (NSRect)srcRect operation: (NSCompositingOperation)op fraction: (CGFloat)delta { NSGraphicsContext *ctxt = GSCurrentContext(); /* An intermediate image used to scale the image to be drawn as needed */ NSCachedImageRep *cache; /* The scaled image graphics state we used as the source from which we draw into the destination (the current graphics context)*/ int gState; /* The context of the cache window */ NSGraphicsContext *cacheCtxt; const NSSize repSize = [self size]; /* The size of the cache window */ NSSize cacheSize; CGFloat repToCacheWidthScaleFactor; CGFloat repToCacheHeightScaleFactor; NSRect srcRectInCache; NSAffineTransform *transform, *backup; // FIXME: Revisit this calculation of cache size if (([self pixelsWide] == NSImageRepMatchesDevice && [self pixelsHigh] == NSImageRepMatchesDevice) && (dstRect.size.width > repSize.width || dstRect.size.height > repSize.height)) { cacheSize = [[ctxt GSCurrentCTM] transformSize: dstRect.size]; } else { cacheSize = [[ctxt GSCurrentCTM] transformSize: repSize]; } if (cacheSize.width < 0) cacheSize.width *= -1; if (cacheSize.height < 0) cacheSize.height *= -1; repToCacheWidthScaleFactor = cacheSize.width / repSize.width; repToCacheHeightScaleFactor = cacheSize.height / repSize.height; srcRectInCache = NSMakeRect(srcRect.origin.x * repToCacheWidthScaleFactor, srcRect.origin.y * repToCacheHeightScaleFactor, srcRect.size.width * repToCacheWidthScaleFactor, srcRect.size.height * repToCacheHeightScaleFactor); cache = [[NSCachedImageRep alloc] initWithSize: NSMakeSize(ceil(cacheSize.width), ceil(cacheSize.height)) depth: [[NSScreen mainScreen] depth] separate: YES alpha: YES]; [[[cache window] contentView] lockFocus]; cacheCtxt = GSCurrentContext(); /* Clear the cache window surface */ DPScompositerect(cacheCtxt, 0, 0, ceil(cacheSize.width), ceil(cacheSize.height), NSCompositeClear); gState = [cacheCtxt GSDefineGState]; //NSLog(@"Draw in cache size %@", NSStringFromSize(cacheSize)); [self drawInRect: NSMakeRect(0, 0, cacheSize.width, cacheSize.height)]; [[[cache window] contentView] unlockFocus]; //NSLog(@"Draw in %@ from %@ from cache rect %@", NSStringFromRect(dstRect), // NSStringFromRect(srcRect), NSStringFromRect(srcRectInCache)); backup = [ctxt GSCurrentCTM]; transform = [NSAffineTransform transform]; [transform translateXBy: dstRect.origin.x yBy: dstRect.origin.y]; [transform scaleXBy: dstRect.size.width / srcRectInCache.size.width yBy: dstRect.size.height / srcRectInCache.size.height]; [transform concat]; [ctxt GSdraw: gState toPoint: NSMakePoint(0,0) fromRect: srcRectInCache operation: op fraction: delta]; [ctxt GSSetCTM: backup]; [ctxt GSUndefineGState: gState]; DESTROY(cache); } /* Old code path that can probably partially be merged with the new native implementation. Fallback for backends other than Cairo. */ - (void) guiDrawInRect: (NSRect)dstRect fromRect: (NSRect)srcRect operation: (NSCompositingOperation)op fraction: (CGFloat)delta { NSGraphicsContext *ctxt = GSCurrentContext(); NSAffineTransform *transform; NSSize repSize; repSize = [self size]; if (![ctxt isDrawingToScreen]) { /* We can't composite or dissolve if we aren't drawing to a screen, so we'll just draw the right part of the image in the right place. This code will only get used by the GSStreamContext. */ NSPoint p; double fx, fy; fx = dstRect.size.width / srcRect.size.width; fy = dstRect.size.height / srcRect.size.height; p.x = dstRect.origin.x / fx - srcRect.origin.x; p.y = dstRect.origin.y / fy - srcRect.origin.y; DPSgsave(ctxt); DPSrectclip(ctxt, dstRect.origin.x, dstRect.origin.y, dstRect.size.width, dstRect.size.height); DPSscale(ctxt, fx, fy); [self drawInRect: NSMakeRect(p.x, p.y, repSize.width, repSize.height)]; DPSgrestore(ctxt); return; } /* Figure out what the effective transform from rep space to 'window space' is. */ transform = [ctxt GSCurrentCTM]; [transform scaleXBy: dstRect.size.width / srcRect.size.width yBy: dstRect.size.height / srcRect.size.height]; /* We can't composite or dissolve directly from the image reps, so we create a temporary off-screen window large enough to hold the transformed image, draw the image rep there, and composite from there to the destination. Optimization: Since we do the entire image at once, we might need a huge buffer. If this starts hurting too much, there are a couple of things we could do to: 1. Take srcRect into account and only process the parts of the image we really need. 2. Take the clipping path into account. Desirable, especially if we're being drawn as lots of small strips in a scrollview. We don't have the clipping path here, though. 3. Allocate a permanent but small buffer and process the image piecewise. */ { NSCachedImageRep *cache; NSAffineTransformStruct ts; NSPoint p; CGFloat x0, y0, x1, y1, w, h; NSInteger gState; NSGraphicsContext *ctxt1; /* Figure out how big we need to make the window that'll hold the transformed image. */ p = [transform transformPoint: NSMakePoint(0, repSize.height)]; x0 = x1 = p.x; y0 = y1 = p.y; p = [transform transformPoint: NSMakePoint(repSize.width, 0)]; x0 = MIN(x0, p.x); y0 = MIN(y0, p.y); x1 = MAX(x1, p.x); y1 = MAX(y1, p.y); p = [transform transformPoint: NSMakePoint(repSize.width, repSize.height)]; x0 = MIN(x0, p.x); y0 = MIN(y0, p.y); x1 = MAX(x1, p.x); y1 = MAX(y1, p.y); p = [transform transformPoint: NSMakePoint(0, 0)]; x0 = MIN(x0, p.x); y0 = MIN(y0, p.y); x1 = MAX(x1, p.x); y1 = MAX(y1, p.y); x0 = floor(x0); y0 = floor(y0); x1 = ceil(x1); y1 = ceil(y1); w = x1 - x0; h = y1 - y0; /* This is where we want the origin of image space to be in our window. */ p.x -= x0; p.y -= y0; cache = [[NSCachedImageRep alloc] initWithSize: NSMakeSize(w, h) depth: [[NSScreen mainScreen] depth] separate: YES alpha: YES]; [[[cache window] contentView] lockFocus]; // The context of the cache window ctxt1 = GSCurrentContext(); DPScompositerect(ctxt1, 0, 0, w, h, NSCompositeClear); /* Set up the effective transform. We also save a gState with this transform to make it easier to do the final composite. */ ts = [transform transformStruct]; ts.tX = p.x; ts.tY = p.y; [transform setTransformStruct: ts]; [ctxt1 GSSetCTM: transform]; gState = [ctxt1 GSDefineGState]; { // Hack for xlib. Without it, transparent parts of images are black [[NSColor clearColor] set]; NSRectFill(NSMakeRect(0, 0, repSize.width, repSize.height)); } [self drawInRect: NSMakeRect(0, 0, repSize.width, repSize.height)]; /* If we're doing a dissolve, use a DestinationIn composite to lower the alpha of the pixels. */ if (delta != 1.0) { DPSsetalpha(ctxt1, delta); DPScompositerect(ctxt1, 0, 0, repSize.width, repSize.height, NSCompositeDestinationIn); } [[[cache window] contentView] unlockFocus]; DPScomposite(ctxt, srcRect.origin.x, srcRect.origin.y, srcRect.size.width, srcRect.size.height, gState, dstRect.origin.x, dstRect.origin.y, op); [ctxt GSUndefineGState: gState]; DESTROY(cache); } } /** * Fallback implementation for subclasses which don't implement their * own direct drawing * TODO: explain how -draw, -drawInRect:, -drawAtPoint: clear their background */ - (BOOL) drawInRect: (NSRect)dstRect fromRect: (NSRect)srcRect operation: (NSCompositingOperation)op fraction: (CGFloat)delta respectFlipped: (BOOL)respectFlipped hints: (NSDictionary*)hints { NSAffineTransform *backup = nil; NSGraphicsContext *ctx = GSCurrentContext(); const BOOL compensateForFlip = (respectFlipped && [ctx isFlipped]); const NSSize repSize = [self size]; // Handle abbreviated parameters if (NSEqualRects(srcRect, NSZeroRect)) { srcRect.size = repSize; } if (NSEqualSizes(dstRect.size, NSZeroSize)) { dstRect.size = repSize; } if (dstRect.size.width <= 0 || dstRect.size.height <= 0 || srcRect.size.width <= 0 || srcRect.size.height <= 0) return NO; // Clip to image bounds if (srcRect.origin.x < 0) srcRect.origin.x = 0; if (srcRect.origin.y < 0) srcRect.origin.y = 0; if (NSMaxX(srcRect) > repSize.width) srcRect.size.width = repSize.width - srcRect.origin.x; if (NSMaxY(srcRect) > repSize.height) srcRect.size.height = repSize.height - srcRect.origin.y; // FIXME: Hints are currently ignored // Compensate for flip if (compensateForFlip) { NSAffineTransform *newXform; backup = [[ctx GSCurrentCTM] retain]; newXform = [backup copy]; [newXform translateXBy: dstRect.origin.x yBy: dstRect.origin.y + dstRect.size.height]; [newXform scaleXBy: 1 yBy: -1]; [ctx GSSetCTM: newXform]; [newXform release]; dstRect.origin = NSMakePoint(0, 0); } // Draw if ([ctx supportsDrawGState]) { [self nativeDrawInRect: dstRect fromRect: srcRect operation: op fraction: delta]; } else { [self guiDrawInRect: dstRect fromRect: srcRect operation: op fraction: delta]; } // Undo flip compensation if (compensateForFlip) { [ctx GSSetCTM: backup]; [backup release]; } return YES; } // NSCopying protocol - (id) copyWithZone: (NSZone *)zone { NSImageRep *copy; copy = (NSImageRep*)NSCopyObject(self, 0, zone); copy->_colorSpace = [_colorSpace copyWithZone: zone]; return copy; } // NSCoding protocol - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { // FIXME } else { [aCoder encodeObject: _colorSpace]; [aCoder encodeSize: _size]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_hasAlpha]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isOpaque]; [aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_bitsPerSample]; [aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_pixelsWide]; [aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_pixelsHigh]; } } - (id) initWithCoder: (NSCoder*)aDecoder { if ([aDecoder allowsKeyedCoding]) { // FIXME } else { [aDecoder decodeValueOfObjCType: @encode(id) at: &_colorSpace]; _size = [aDecoder decodeSize]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_hasAlpha]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isOpaque]; [aDecoder decodeValueOfObjCType: @encode(NSInteger) at: &_bitsPerSample]; [aDecoder decodeValueOfObjCType: @encode(NSInteger) at: &_pixelsWide]; [aDecoder decodeValueOfObjCType: @encode(NSInteger) at: &_pixelsHigh]; } return self; } - (NSString*)description { return [NSString stringWithFormat: @"<%@: %p size: %@ pixelsWide: %d pixelsHigh: %d colorSpaceName: %@ bps: %d>", [self class], self, NSStringFromSize([self size]), (int)[self pixelsWide], (int)[self pixelsHigh], [self colorSpaceName], (int)[self bitsPerSample]]; } @end gnustep-gui-0.24.0/Source/NSPopUpButton.m0000664000076500007650000003520212133060426020057 0ustar brains99brains99/** NSPopUpButton Popup list class Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Michael Hanni Date: June 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSEvent.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSKeyValueBinding.h" #import "AppKit/NSPopUpButton.h" #import "AppKit/NSPopUpButtonCell.h" #import "AppKit/NSMenu.h" #import "AppKit/NSMenuItem.h" #import "AppKit/NSMenuView.h" #import "AppKit/NSWindow.h" /* * class variables */ Class _nspopupbuttonCellClass = 0; /* * NSPopUpButton implementation */ @implementation NSPopUpButton /* * Class methods */ + (void) initialize { if (self == [NSPopUpButton class]) { // Initial version [self setVersion: 1]; [self setCellClass: [NSPopUpButtonCell class]]; [self exposeBinding: NSSelectedIndexBinding]; [self exposeBinding: NSSelectedObjectBinding]; [self exposeBinding: NSSelectedTagBinding]; [self exposeBinding: NSContentValuesBinding]; } } + (Class) cellClass { return _nspopupbuttonCellClass; } + (void) setCellClass: (Class)classId { _nspopupbuttonCellClass = classId; } /* * Initializing an NSPopUpButton */ - (id) init { return [self initWithFrame: NSZeroRect pullsDown: NO]; } - (id) initWithFrame: (NSRect)frameRect { return [self initWithFrame: frameRect pullsDown: NO]; } /**

Initialize and returns a new NSPopUpButton into the frame frameRect and specified by flag if the NSPopUpButton is a pull-down list

See Also: -setPullsDown: [NSView-initWithFrame:]

*/ - (id) initWithFrame: (NSRect)frameRect pullsDown: (BOOL)flag { if ( ! ( self = [super initWithFrame: frameRect] ) ) return nil; [self setPullsDown: flag]; return self; } /* In NSView, -menuForEvent: returns [self menu] as the context menu of the view. Since our -menu returns the menu for our pop-up, we need to override this to return nil to indicate that we have no context menu. */ - (NSMenu *)menuForEvent:(NSEvent *)theEvent { return nil; } - (void) setMenu: (NSMenu*)menu { [_cell setMenu: menu]; } - (NSMenu*) menu { return [_cell menu]; } /**

Sets whether the NSPopUpButton's cell has a pulls-down list ( YES ) or a pop-up list (NO)

See Also: -pullsDown [NSPopUpButtonCell-setPullsDown:]

*/ - (void) setPullsDown: (BOOL)flag { [_cell setPullsDown: flag]; } /**

Returns whether the NSPopUpButton's cell has a pulls-down list ( YES ) or a pop-up list (NO)

See Also: -setPullsDown: [NSPopUpButtonCell-pullsDown]

*/ - (BOOL) pullsDown { return [_cell pullsDown]; } - (void) setAutoenablesItems: (BOOL)flag { [_cell setAutoenablesItems: flag]; } - (BOOL) autoenablesItems { return [_cell autoenablesItems]; } /**

Inserts a new item with title as its title at the end of the list and synchronizes the NSPopUpButton's title with the title of the selected item.

See Also: [NSPopUpButtonCell-addItemWithTitle:] -synchronizeTitleAndSelectedItem

*/ - (void) addItemWithTitle: (NSString *)title { [_cell addItemWithTitle: title]; [self synchronizeTitleAndSelectedItem]; } /**

Inserts a new list of items with titles as titles at the end of the list and synchronizes the NSPopUpButton's title with the title of the selected item.

See Also: [NSPopUpButtonCell-addItemsWithTitles:] -synchronizeTitleAndSelectedItem

*/ - (void) addItemsWithTitles: (NSArray*)itemTitles { [_cell addItemsWithTitles: itemTitles]; [self synchronizeTitleAndSelectedItem]; } /**

Inserts a new item with title as its title at the specified index and synchronizes the NSPopUpButton's title with the title of the selected item.

See Also: [NSPopUpButtonCell-insertItemWithTitle:atIndex:] -synchronizeTitleAndSelectedItem

*/ - (void) insertItemWithTitle: (NSString*)title atIndex: (NSInteger)index { [_cell insertItemWithTitle: title atIndex: index]; [self synchronizeTitleAndSelectedItem]; } /**

Removes all items from the item list and synchronizes the NSPopUpButton's title with the title of the selected

See Also: [NSPopUpButtonCell-removeAllItems] -removeItemWithTitle: -synchronizeTitleAndSelectedItem

*/ - (void) removeAllItems { [_cell removeAllItems]; [self synchronizeTitleAndSelectedItem]; } /**

Removes the item specified with title as its title from the item list and synchronizes the NSPopUpButton's title with the title of the selected

See Also: [NSPopUpButtonCell-removeItemWithTitle:] -removeAllItems -removeItemAtIndex: -synchronizeTitleAndSelectedItem

*/ - (void) removeItemWithTitle: (NSString*)title { [_cell removeItemWithTitle: title]; [self synchronizeTitleAndSelectedItem]; } /**

Removes the item at the specified index index from the item list and synchronizes the NSPopUpButton's title with the title of the selected

See Also: [NSPopUpButtonCell-removeItemAtIndex:] -removeAllItems -removeItemWithTitle: -synchronizeTitleAndSelectedItem

*/ - (void) removeItemAtIndex: (NSInteger)index { [_cell removeItemAtIndex: index]; [self synchronizeTitleAndSelectedItem]; } /**

Returns the selected item

See Also: [NSPopUpButtonCell-selectedItem]

*/ - (id ) selectedItem { return [_cell selectedItem]; } /**

Returns the title of the selected item

See Also: [NSPopUpButtonCell-titleOfSelectedItem]

*/ - (NSString*) titleOfSelectedItem { return [_cell titleOfSelectedItem]; } /**

Returns the index of the selected item

See Also: [NSPopUpButtonCell-indexOfSelectedItem]

*/ - (NSInteger) indexOfSelectedItem { return [_cell indexOfSelectedItem]; } /**

Returns the tag of the selected item

See Also: [NSPopUpButtonCell-indexOfSelectedItem]

*/ - (NSInteger) selectedTag { return [[_cell selectedItem] tag]; } - (void) selectItem: (id )anObject { [_cell selectItem: anObject]; [self synchronizeTitleAndSelectedItem]; } /**

Select the item at index index and synchronizes the NSPopUpButton's title with the title of the selected

See Also: [NSPopUpButtonCell-selectItemAtIndex:] -synchronizeTitleAndSelectedItem

*/ - (void) selectItemAtIndex: (NSInteger)index { [_cell selectItemAtIndex: index]; [self synchronizeTitleAndSelectedItem]; } /**

Select the item with title title and synchronizes the NSPopUpButton's title with the title of the selected

See Also: [NSPopUpButtonCell-selectItemWithTitle:] -synchronizeTitleAndSelectedItem

*/ - (void) selectItemWithTitle: (NSString*)title { [_cell selectItemWithTitle: title]; [self synchronizeTitleAndSelectedItem]; } - (BOOL) selectItemWithTag: (NSInteger)tag { NSInteger index = [self indexOfItemWithTag: tag]; if (index >= 0) { [self selectItemAtIndex: index]; return YES; } else { return NO; } } /**

Returns the number of items in the item list

See Also: [NSPopUpButtonCell-numberOfItems]

*/ - (NSInteger) numberOfItems { return [_cell numberOfItems]; } - (NSArray*) itemArray { return [_cell itemArray]; } /**

Returns the NSMenuItem at index index or nil if index is out of range

See Also: [NSPopUpButtonCell-itemAtIndex:]

*/ - (id ) itemAtIndex: (NSInteger)index { return [_cell itemAtIndex: index]; } /**

Returns the item's title at index index

*/ - (NSString*) itemTitleAtIndex: (NSInteger)index { return [_cell itemTitleAtIndex: index]; } /**

Returns an array containing the items's titles

*/ - (NSArray*) itemTitles { return [_cell itemTitles]; } /**

Returns the NSMenuItem with title as its title

*/ - (id ) itemWithTitle: (NSString*)title { return [_cell itemWithTitle: title]; } /**

Returns the last NSMenuItem of the list

*/ - (id ) lastItem { return [_cell lastItem]; } - (NSInteger) indexOfItem: (id )anObject { return [_cell indexOfItem: anObject]; } /**

Returns the index of the item with tag as its tag. Returns -1 if the cell is not found

See Also: [NSPopUpButtonCell-indexOfItemWithTag:] -indexOfItemWithTitle: -indexOfItemWithRepresentedObject:

*/ - (NSInteger) indexOfItemWithTag: (NSInteger)tag { return [_cell indexOfItemWithTag: tag]; } /**

Returns the index of the item with title as its title. Returns -1 if the cell is not found

See Also: [NSPopUpButtonCell-indexOfItemWithTitle:] -indexOfItemWithTag: -indexOfItemWithRepresentedObject:

*/ - (NSInteger) indexOfItemWithTitle: (NSString*)title { return [_cell indexOfItemWithTitle: title]; } - (NSInteger) indexOfItemWithRepresentedObject: (id)anObject { return [_cell indexOfItemWithRepresentedObject: anObject]; } - (NSInteger) indexOfItemWithTarget: (id)target andAction: (SEL)actionSelector { return [_cell indexOfItemWithTarget: target andAction: actionSelector]; } - (void) setPreferredEdge: (NSRectEdge)edge { [_cell setPreferredEdge: edge]; } - (NSRectEdge) preferredEdge { return [_cell preferredEdge]; } - (void) setTitle: (NSString*)aString { [_cell setTitle: aString]; [self synchronizeTitleAndSelectedItem]; } - (void) synchronizeTitleAndSelectedItem { [_cell synchronizeTitleAndSelectedItem]; [self setNeedsDisplay: YES]; } - (BOOL) resignFirstResponder { [_cell dismissPopUp]; return [super resignFirstResponder]; } - (BOOL) performKeyEquivalent: (NSEvent*)theEvent { NSMenu *m = [self menu]; NSMenuItem *oldSelectedItem = (NSMenuItem *)[_cell selectedItem]; if (m != nil) { if ([m performKeyEquivalent: theEvent]) { // pullsDown does not change selected item if ([_cell pullsDown]) { [self selectItem: oldSelectedItem]; } else { /* If the key equivalent was performed, redisplay ourselves * to account for potential changes in the selected item. */ [self setNeedsDisplay: YES]; } return YES; } } return NO; } - (void) mouseDown: (NSEvent*)theEvent { [_cell trackMouse: theEvent inRect: [self bounds] ofView: self untilMouseUp: YES]; } - (void) keyDown: (NSEvent*)theEvent { // FIXME: This method also handles the key events for the popup menu window, // as menu windows cannot become key window. if ([self isEnabled]) { NSString *characters = [theEvent characters]; unichar character = 0; if ([characters length] > 0) { character = [characters characterAtIndex: 0]; } switch (character) { case NSNewlineCharacter: case NSEnterCharacter: case NSCarriageReturnCharacter: /* Handle Enter and Return keys only when the menu is visible. The button's action to pop up the menu is initiated only by the Space key similar to other buttons. */ { NSMenuView *menuView = [[_cell menu] menuRepresentation]; if ([[menuView window] isVisible] == NO) break; } case ' ': { NSInteger selectedIndex; NSMenuView *menuView; // Beep, as on OS, and then return. if ([[_cell menu] numberOfItems] == 0) { NSBeep(); return; } menuView = [[_cell menu] menuRepresentation]; if ([[menuView window] isVisible] == NO) { // Attach the popUp [_cell attachPopUpWithFrame: _bounds inView: self]; } else { selectedIndex = [menuView highlightedItemIndex]; if (selectedIndex >= 0) { [[_cell menu] performActionForItemAtIndex: selectedIndex]; } } } return; case '\e': [_cell dismissPopUp]; return; case NSUpArrowFunctionKey: { NSMenuView *menuView; NSInteger selectedIndex, numberOfItems; menuView = [[_cell menu] menuRepresentation]; selectedIndex = [menuView highlightedItemIndex]; numberOfItems = [self numberOfItems]; switch (selectedIndex) { case -1: selectedIndex = numberOfItems - 1; break; case 0: return; default: selectedIndex--; break; } [menuView setHighlightedItemIndex: selectedIndex]; } return; case NSDownArrowFunctionKey: { NSMenuView *menuView; NSInteger selectedIndex, numberOfItems; menuView = [[_cell menu] menuRepresentation]; selectedIndex = [menuView highlightedItemIndex]; numberOfItems = [self numberOfItems]; if (selectedIndex < numberOfItems-1) [menuView setHighlightedItemIndex: selectedIndex + 1]; } return; } } [super keyDown: theEvent]; } - (void) setValue: (id)anObject forKey: (NSString*)aKey { if ([aKey isEqual: NSSelectedIndexBinding]) { [self selectItemAtIndex: [anObject intValue]]; } else if ([aKey isEqual: NSSelectedTagBinding]) { [self selectItemWithTag: [anObject integerValue]]; } else if ([aKey isEqual: NSSelectedObjectBinding]) { [self selectItemWithTag: [anObject intValue]]; } else if ([aKey isEqual: NSContentValuesBinding]) { [self removeAllItems]; [self addItemsWithTitles: (NSArray*)anObject]; } else { [super setValue: anObject forKey: aKey]; } } - (id) valueForKey: (NSString*)aKey { if ([aKey isEqual: NSSelectedIndexBinding]) { return [NSNumber numberWithInt: [self indexOfSelectedItem]]; } else if ([aKey isEqual: NSSelectedTagBinding]) { return [NSNumber numberWithInteger: [self selectedTag]]; } else if ([aKey isEqual: NSSelectedObjectBinding]) { return [NSNumber numberWithInt: [self selectedTag]]; } else if ([aKey isEqual: NSContentValuesBinding]) { return [self itemTitles]; } else { return [super valueForKey: aKey]; } } @end gnustep-gui-0.24.0/Source/GSEPSPrintOperation.m0000664000076500007650000001006011376454556021154 0ustar brains99brains99/* GSEPSPrintOperation.m Controls operations generating EPS output files. Copyright (C) 1996, 2004 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Fred Kiefer Date: November 2000 Started implementation. Author: Chad Hardin Date: June 2004 Modified for printing backend support, split off from NSPrintOperation.m 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import "AppKit/NSView.h" #import "AppKit/NSPrintInfo.h" #import "AppKit/NSPrintOperation.h" #import "GNUstepGUI/GSEPSPrintOperation.h" /** Class Description

GSEPSPrintOperation is a subclass of NSPrintOperation that can create eps files suitable for saving, previewing, etc.

*/ @implementation GSEPSPrintOperation - (id)initWithView:(NSView *)aView insideRect:(NSRect)rect toData:(NSMutableData *)data printInfo:(NSPrintInfo *)aPrintInfo { self = [super initWithView: aView insideRect: rect toData: data printInfo: aPrintInfo]; _path = [NSTemporaryDirectory() stringByAppendingPathComponent: @"GSPrint-"]; _path = [_path stringByAppendingString: [[NSProcessInfo processInfo] globallyUniqueString]]; _path = [_path stringByAppendingPathExtension: @"ps"]; RETAIN(_path); return self; } - (id) initWithView:(NSView *)aView insideRect:(NSRect)rect toPath:(NSString *)path printInfo:(NSPrintInfo *)aPrintInfo { NSMutableData *data = [NSMutableData data]; self = [super initWithView: aView insideRect: rect toData: data printInfo: aPrintInfo]; ASSIGN(_path, path); return self; } - (void) _print { /* Save this for the view to look at. Seems like there should be a better way to pass it to beginDocument */ [[[self printInfo] dictionary] setObject: [NSValue valueWithRect: _rect] forKey: @"NSPrintSheetBounds"]; [_view beginDocument]; [_view beginPageInRect: _rect atPlacement: NSMakePoint(0,0)]; [_view displayRectIgnoringOpacity: _rect inContext: [self context]]; [_view endPage]; [_view endDocument]; } - (BOOL)isEPSOperation { return YES; } - (BOOL)deliverResult { if (_data != nil && _path != nil) { NSString *eps; eps = [NSString stringWithContentsOfFile: _path]; [_data setData: [eps dataUsingEncoding: NSASCIIStringEncoding]]; } return YES; } - (NSGraphicsContext*)createContext { NSMutableDictionary *info; if (_context) return _context; info = [[self printInfo] dictionary]; [info setObject: _path forKey: @"NSOutputFile"]; [info setObject: NSGraphicsContextPSFormat forKey: NSGraphicsContextRepresentationFormatAttributeName]; _context = RETAIN([NSGraphicsContext graphicsContextWithAttributes: info]); return _context; } @end gnustep-gui-0.24.0/Source/GSHelpManagerPanel.m0000664000076500007650000001034011376454556020773 0ustar brains99brains99/** GSHelpManagerPanel.m GSHelpManagerPanel displays a help message for an item. Copyright (C) 1999 Free Software Foundation, Inc. Author: Pedro Ivo Andrade Tavares Date: September 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "AppKit/NSApplication.h" #import "AppKit/NSAttributedString.h" #import "AppKit/NSTextView.h" #import "AppKit/NSTextContainer.h" #import "AppKit/NSTextStorage.h" #import "AppKit/NSScrollView.h" #import "AppKit/NSButton.h" #import "AppKit/NSClipView.h" #import "AppKit/NSColor.h" #import "AppKit/NSImage.h" #import "GNUstepGUI/GSHelpManagerPanel.h" #import "GSGuiPrivate.h" @implementation GSHelpManagerPanel static GSHelpManagerPanel* _GSsharedGSHelpPanel; + (id) sharedHelpManagerPanel { if (!_GSsharedGSHelpPanel) _GSsharedGSHelpPanel = [[GSHelpManagerPanel alloc] init]; return _GSsharedGSHelpPanel; } - (id)init { self = [super initWithContentRect: NSMakeRect(100, 100, 470, 200) styleMask: NSTitledWindowMask | NSResizableWindowMask backing: NSBackingStoreRetained defer: NO]; if (self) { NSRect scrollViewRect = {{8, 40}, {454, 152}}; NSRect buttonRect = {{390, 6}, {72, 27}}; NSRect r; NSScrollView *scrollView; NSButton *button; [self setReleasedWhenClosed: NO]; [self setFloatingPanel: YES]; [self setTitle: NSLocalizedString(@"Help", @"")]; scrollView = [[NSScrollView alloc] initWithFrame: scrollViewRect]; [scrollView setBorderType: NSBezelBorder]; [scrollView setHasHorizontalScroller: NO]; [scrollView setHasVerticalScroller: YES]; [scrollView setAutoresizingMask: NSViewHeightSizable | NSViewWidthSizable]; r = [[scrollView contentView] frame]; textView = [[NSTextView alloc] initWithFrame: r]; [textView setRichText: YES]; [textView setEditable: NO]; [textView setSelectable: NO]; [textView setHorizontallyResizable: NO]; [textView setVerticallyResizable: YES]; [textView setMinSize: NSMakeSize (0, 0)]; [textView setMaxSize: NSMakeSize (1E7, 1E7)]; [textView setAutoresizingMask: NSViewHeightSizable | NSViewWidthSizable]; [[textView textContainer] setContainerSize: NSMakeSize(r.size.width, 1e7)]; [[textView textContainer] setWidthTracksTextView: YES]; [textView setUsesRuler: NO]; [scrollView setDocumentView: textView]; RELEASE (textView); [[self contentView] addSubview: scrollView]; RELEASE (scrollView); button = [[NSButton alloc] initWithFrame: buttonRect]; [button setAutoresizingMask: NSViewMinXMargin | NSViewMaxYMargin]; [button setButtonType: NSMomentaryLight]; [button setTitle: NSLocalizedString(@"OK", @"")]; [button setKeyEquivalent: @"\r"]; [button setImagePosition: NSImageRight]; [button setImage: [NSImage imageNamed: @"common_ret"]]; [button setAlternateImage: [NSImage imageNamed: @"common_retH"]]; [button setTarget: self]; [button setAction: @selector(buttonAction:)]; [[self contentView] addSubview: button]; RELEASE (button); [self makeFirstResponder: button]; } return self; } - (void)setHelpText:(NSAttributedString *)helpText { [[textView textStorage] setAttributedString: helpText]; } - (void)buttonAction:(id)sender { [self close]; } - (void) close { if ([self isVisible]) { [NSApp stopModal]; } [super close]; } @end gnustep-gui-0.24.0/Source/libgnustep-gui.def0000664000076500007650000001650211245336555020635 0ustar brains99brains99; ; libgnustep-gui.def ; ; Exports for libgnustep-gui DLL ; Specific to WIN32 operating systems ; ; Copyright (C) 2003 Free Software Foundation, Inc. ; ; This file is part of the GNUstep GUI Library. ; ; This library is free software; you can redistribute it and/or ; modify it under the terms of the GNU Lesser 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 ; Lesser General Public License for more details. ; ; You should have received a copy of the GNU Lesser General Public ; License along with this library; see the file COPYING.LIB. ; If not, see or write to the ; Free Software Foundation, 51 Franklin Street, Fifth Floor, ; Boston, MA 02110-1301, USA. ; LIBRARY libgnustep-gui EXPORTS __objc_class_name_GSDisplayServer __objc_class_name_GSFontEnumerator __objc_class_name_GSFontInfo __objc_class_name_GSHbox __objc_class_name_GSHelpManagerPanel __objc_class_name_GSHorizontalTypesetter __objc_class_name__GSLabelListView __objc_class_name_GSInfoPanel __objc_class_name_GSKeyBindingAction __objc_class_name_GSKeyBindingActionQuoteNextKeyStroke __objc_class_name_GSKeyBindingActionSelector __objc_class_name_GSKeyBindingActionSelectorArray __objc_class_name_GSKeyBindingTable __objc_class_name_GSLayoutManager __objc_class_name_GSMemoryPanel __objc_class_name_GSMemoryPanelEntry __objc_class_name_GSClassSwapper __objc_class_name_GSControlTemplate __objc_class_name_GSCustomView __objc_class_name_GSMenuTemplate __objc_class_name_GSNibContainer __objc_class_name_GSNibItem __objc_class_name_GSObjectTemplate __objc_class_name_GSTemplateFactory __objc_class_name_GSTextTemplate __objc_class_name_GSTextViewTemplate __objc_class_name_GSViewTemplate __objc_class_name_GSWindowTemplate __objc_class_name_NSWindowTemplate __objc_class_name_GSListener __objc_class_name_GSServicesManager __objc_class_name_GSSlideView __objc_class_name_GSTable __objc_class_name_GSTextInfo __objc_class_name_GSTextStorage __objc_class_name_GSTrackingRect __objc_class_name_GSTypesetter __objc_class_name_GSVbox __objc_class_name_NSActionCell __objc_class_name_NSAffineTransform __objc_class_name_NSAppIconView __objc_class_name_NSApplication __objc_class_name_NSIconWindow __objc_class_name_GSBezierPath __objc_class_name_NSBezierPath __objc_class_name_NSBitmapImageRep __objc_class_name_NSBox __objc_class_name_GSBrowserTitleCell __objc_class_name_NSBrowser __objc_class_name_NSBrowserColumn __objc_class_name_NSBrowserCell __objc_class_name_NSNibConnector __objc_class_name_NSNibControlConnector __objc_class_name_NSNibOutletConnector __objc_class_name_NSButton __objc_class_name_NSButtonCell __objc_class_name_GSCacheW __objc_class_name_NSCachedImageRep __objc_class_name_NSCell __objc_class_name_NSClipView __objc_class_name_GSCalibratedRGBColor __objc_class_name_GSCalibratedWhiteColor __objc_class_name_GSDeviceCMYKColor __objc_class_name_GSDeviceRGBColor __objc_class_name_GSDeviceWhiteColor __objc_class_name_GSNamedColor __objc_class_name_GSPatternColor __objc_class_name_GSRGBColor __objc_class_name_GSWhiteColor __objc_class_name_NSColor __objc_class_name_NSColorList __objc_class_name_NSColorPanel __objc_class_name_NSColorPicker __objc_class_name_NSColorWell __objc_class_name_NSComboBox __objc_class_name_GSComboWindow __objc_class_name_NSComboBoxCell __objc_class_name_NSControl __objc_class_name_NSCursor __objc_class_name_NSCustomImageRep __objc_class_name_NSDataLink __objc_class_name_NSDataLinkManager __objc_class_name_GSDataLinkPanelController __objc_class_name_NSDataLinkPanel __objc_class_name_NSDocument __objc_class_name_NSDocumentController __objc_class_name_NSDrawer __objc_class_name_NSEPSImageRep __objc_class_name_NSEvent __objc_class_name_NSFileWrapper __objc_class_name_NSFont __objc_class_name_NSFontManager __objc_class_name_NSFontPanel __objc_class_name_NSForm __objc_class_name_NSFormCell __objc_class_name_NSGraphicsContext __objc_class_name_NSHelpManager __objc_class_name_NSHelpPanel __objc_class_name_GSRepData __objc_class_name_NSImage __objc_class_name_NSImageCell __objc_class_name_NSImageRep __objc_class_name_NSImageView __objc_class_name_NSInputManager __objc_class_name_NSInputServer __objc_class_name_GSInterfaceStyle __objc_class_name_NSLayoutManager __objc_class_name_NSMatrix __objc_class_name_NSMenu __objc_class_name_NSMenuPanel __objc_class_name_GSMenuSeparator __objc_class_name_NSMenuItem __objc_class_name_NSMenuItemCell __objc_class_name_NSMenuView __objc_class_name_NSMenuWindowTitleView __objc_class_name_NSOpenGLContext __objc_class_name_NSOpenGLPixelFormat __objc_class_name_NSOpenGLView __objc_class_name_NSOpenPanel __objc_class_name_NSOutlineView __objc_class_name_NSPageLayout __objc_class_name_GSAlertPanel __objc_class_name_NSPanel __objc_class_name_NSMutableParagraphStyle __objc_class_name_NSParagraphStyle __objc_class_name_NSTextTab __objc_class_name_GSFiltered __objc_class_name_NSPasteboard __objc_class_name_NSPasteboardObjectDummy __objc_class_name_NSPasteboardServerDummy __objc_class_name_NSPopUpButton __objc_class_name_NSPopUpButtonCell __objc_class_name_NSPrintInfo __objc_class_name_GSEPSPrintOperation __objc_class_name_GSPDFPrintOperation __objc_class_name_GSPrintOperation __objc_class_name_NSPrintOperation __objc_class_name_NSPrintPanel __objc_class_name_NSPrinter __objc_class_name_NSProgressIndicator __objc_class_name_NSResponder __objc_class_name_NSRulerMarker __objc_class_name_GSRulerUnit __objc_class_name_NSRulerView __objc_class_name_NSSavePanel __objc_class_name_NSScreen __objc_class_name_NSScrollView __objc_class_name_NSScroller __objc_class_name_GSSimpleSecureLayoutManager __objc_class_name_NSSecureTextField __objc_class_name_NSSecureTextFieldCell __objc_class_name_NSSecureTextView __objc_class_name_NSSelection __objc_class_name_NSSlider __objc_class_name_NSSliderCell __objc_class_name_NSSound __objc_class_name_NSSpellChecker __objc_class_name_NSSpellServer __objc_class_name_NSSplitView __objc_class_name_NSStepper __objc_class_name_NSStepperCell __objc_class_name_NSTabView __objc_class_name_NSTabViewItem __objc_class_name_NSTableColumn __objc_class_name_NSTableHeaderCell __objc_class_name_NSTableHeaderView __objc_class_name_GSTableCornerView __objc_class_name_NSTableView __objc_class_name_NSText __objc_class_name_NSTextAttachment __objc_class_name_NSTextAttachmentCell __objc_class_name_NSTextContainer __objc_class_name_NSTextField __objc_class_name_NSTextFieldCell __objc_class_name_NSTextStorage __objc_class_name_NSTextView __objc_class_name_GSToolbarButton __objc_class_name_GSToolbarView __objc_class_name_NSToolbar __objc_class_name_GSToolbarCustomizeToolbarItem __objc_class_name_GSToolbarFlexibleSpaceItem __objc_class_name_GSToolbarPrintItem __objc_class_name_GSToolbarSeperatorItem __objc_class_name_GSToolbarShowColorsItem __objc_class_name_GSToolbarShowFontsItem __objc_class_name_GSToolbarSpaceItem __objc_class_name_NSToolbarItem __objc_class_name_NSView __objc_class_name_GSWindowView __objc_class_name_NSMiniWindow __objc_class_name_NSMiniWindowView __objc_class_name_NSWindow __objc_class_name_NSWindowController __objc_class_name__GSWorkspaceCenter __objc_class_name_NSWorkspace __objc_class_name_GSTheme gnustep-gui-0.24.0/Source/NSCell.m0000664000076500007650000025134112221646125016507 0ustar brains99brains99/** NSCell The abstract cell class Copyright (C) 1996-2012 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Modifications: Felipe A. Rodriguez Date: August 1998 Rewrite: Multiple authors Date: 1999 Editing, formatters: Nicola Pero Date: 2000 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import #import #import #import #import #import #import #import #import #import "AppKit/AppKitExceptions.h" #import "AppKit/NSAttributedString.h" #import "AppKit/NSApplication.h" #import "AppKit/NSControl.h" #import "AppKit/NSCell.h" #import "AppKit/NSClipView.h" #import "AppKit/NSColor.h" #import "AppKit/NSCursor.h" #import "AppKit/NSEvent.h" #import "AppKit/NSFont.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSImage.h" #import "AppKit/NSMenu.h" #import "AppKit/NSParagraphStyle.h" #import "AppKit/NSStringDrawing.h" #import "AppKit/NSTextView.h" #import "AppKit/NSTextContainer.h" #import "AppKit/NSView.h" #import "AppKit/NSWindow.h" #import "AppKit/NSKeyValueBinding.h" #import "GSBindingHelpers.h" #import "GNUstepGUI/GSTheme.h" #import "GSGuiPrivate.h" static Class colorClass; static Class cellClass; static Class fontClass; static Class imageClass; static NSColor *txtCol; static NSColor *dtxtCol; @interface NSCell (PrivateColor) + (void) _systemColorsChanged: (NSNotification*)n; @end @implementation NSCell (PrivateColor) + (void) _systemColorsChanged: (NSNotification*)n { ASSIGN (txtCol, [colorClass controlTextColor]); ASSIGN (dtxtCol, [colorClass disabledControlTextColor]); } @end /** *

TODO Desctiption

*/ @implementation NSCell /* * Class methods */ + (void) initialize { if (self == [NSCell class]) { [self setVersion: 3]; colorClass = [NSColor class]; cellClass = [NSCell class]; fontClass = [NSFont class]; imageClass = [NSImage class]; /* * Watch for changes to system colors, and simulate an initial change * in order to set up our defaults. */ [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_systemColorsChanged:) name: NSSystemColorsDidChangeNotification object: nil]; [self _systemColorsChanged: nil]; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) [self exposeBinding: NSTitleBinding]; #endif } } + (NSMenu*) defaultMenu { return nil; } + (NSFocusRingType) defaultFocusRingType { return NSFocusRingTypeDefault; } /**

This class method returns NO. This method should be overrided by subclasses.

*/ + (BOOL) prefersTrackingUntilMouseUp { return NO; } /* * Instance methods */ - (id) init { return [self initTextCell: @""]; } /**

Initializes and returns a new NSCell with a NSImage anImage. This method sets the image position to NSImageOnly and the cell's type to NSImageCellType.

See Also: -initTextCell:

*/ - (id) initImageCell: (NSImage*)anImage { _cell.type = NSImageCellType; _cell_image = RETAIN (anImage); _cell.image_position = NSImageOnly; _font = RETAIN ([fontClass systemFontOfSize: 0]); // Implicitly set by allocation: // //_font = nil; //_cell.contents_is_attributed_string = NO; //_cell.is_highlighted = NO; //_cell.is_disabled = NO; //_cell.is_editable = NO; //_cell.is_rich_text = NO; //_cell.imports_graphics = NO; //_cell.shows_first_responder = NO; //_cell.refuses_first_responder = NO; //_cell.sends_action_on_end_editing = NO; //_cell.is_bordered = NO; //_cell.is_bezeled = NO; //_cell.is_scrollable = NO; //_cell.is_selectable = NO; //_cell.state = 0; //_cell.line_break_mode = NSLineBreakByWordWrapping; _action_mask = NSLeftMouseUpMask; _menu = [object_getClass(self) defaultMenu]; [self setFocusRingType: [object_getClass(self) defaultFocusRingType]]; return self; } /**

Initializes and returns a new NSCell with a NSString aString. This method sets the cell's type to NSTextCellType.

See Also: -initImageCell:

*/ - (id) initTextCell: (NSString*)aString { _cell.type = NSTextCellType; _contents = RETAIN (aString); _font = RETAIN ([fontClass systemFontOfSize: 0]); // Implicitly set by allocation: // //_cell.contents_is_attributed_string = NO; //_cell_image = nil; //_cell.image_position = NSNoImage; //_cell.is_disabled = NO; //_cell.state = 0; //_cell.is_highlighted = NO; //_cell.is_editable = NO; //_cell.is_bordered = NO; //_cell.is_bezeled = NO; //_cell.is_scrollable = NO; //_cell.is_selectable = NO; //_cell.line_break_mode = NSLineBreakByWordWrapping; _action_mask = NSLeftMouseUpMask; _menu = [object_getClass(self) defaultMenu]; [self setFocusRingType: [object_getClass(self) defaultFocusRingType]]; return self; } - (void) dealloc { // Remove all key value bindings for this object. [GSKeyValueBinding unbindAllForObject: self]; TEST_RELEASE (_contents); TEST_RELEASE (_cell_image); TEST_RELEASE (_font); TEST_RELEASE (_represented_object); TEST_RELEASE (_object_value); TEST_RELEASE (_formatter); TEST_RELEASE (_menu); [super dealloc]; } /* * Setting the NSCell's Value */ - (id) objectValue { if (_cell.has_valid_object_value) { return _object_value; } else { return nil; } } - (BOOL) hasValidObjectValue { return _cell.has_valid_object_value; } /**

Returns the NSCell's value as a double.

*

See Also: -setDoubleValue:

*/ - (double) doubleValue { if ((_cell.has_valid_object_value == YES) && ([_object_value respondsToSelector: @selector(doubleValue)])) { return [_object_value doubleValue]; } else { return [[self stringValue] doubleValue]; } } /**

Returns the cell's value as a float.

*

See Also: -setFloatValue:

*/ - (float) floatValue { if ((_cell.has_valid_object_value == YES) && ([_object_value respondsToSelector: @selector(floatValue)])) { return [_object_value floatValue]; } else { return [[self stringValue] floatValue]; } } /**

Returns the cell's value as an int.

*

See Also: -setIntValue:

*/ - (int) intValue { if ((_cell.has_valid_object_value == YES) && ([_object_value respondsToSelector: @selector(intValue)])) { return [_object_value intValue]; } else { return [[self stringValue] intValue]; } } /**

Returns the cell's value as an NSInteger.

*

See Also: -setIntegerValue:

*/ - (NSInteger) integerValue { if ((_cell.has_valid_object_value == YES) && ([_object_value respondsToSelector: @selector(integerValue)])) { return [_object_value integerValue]; } else { return [[self stringValue] integerValue]; } } /**

Returns the cell's value as a NSString.

*

See Also: -setStringValue:

*/ - (NSString*) stringValue { if (nil == _contents) { return @""; } if (_cell.contents_is_attributed_string == NO) { // If we have a formatter this is also the string of the _object_value return (NSString *)_contents; } else { return [(NSAttributedString *)_contents string]; } } - (void) setObjectValue: (id)object { id newContents; ASSIGN (_object_value, object); if (_formatter == nil) { if (object == nil || [object isKindOfClass: [NSString class]] == YES) { newContents = object; _cell.contents_is_attributed_string = NO; _cell.has_valid_object_value = YES; } else if ([object isKindOfClass: [NSAttributedString class]] == YES) { newContents = object; _cell.contents_is_attributed_string = YES; _cell.has_valid_object_value = YES; } else if ([_object_value respondsToSelector: @selector(attributedStringValue)]) { newContents = [_object_value attributedStringValue]; _cell.contents_is_attributed_string = YES; _cell.has_valid_object_value = YES; } else if ([_object_value respondsToSelector: @selector(stringValue)]) { // If the thing that was assigned is not a string, but // responds to stringValue then get that. newContents = [_object_value stringValue]; _cell.contents_is_attributed_string = NO; _cell.has_valid_object_value = YES; } else { newContents = [_object_value description]; _cell.contents_is_attributed_string = NO; _cell.has_valid_object_value = YES; } } else { newContents = [_formatter stringForObjectValue: _object_value]; _cell.contents_is_attributed_string = NO; if (newContents != nil) { _cell.has_valid_object_value = YES; } else { _cell.has_valid_object_value = NO; } } ASSIGNCOPY(_contents, newContents); } /**

Sets the NSCell's value to aDouble.

*

See Also: -doubleValue

*/ - (void) setDoubleValue: (double)aDouble { NSNumber *number; // NB: GNUstep can set a double value for an image cell number = [NSNumber numberWithDouble: aDouble]; [self setObjectValue: number]; } /** *

Sets the NSCell's value to a aFloat. This used for example in NSSliderCell

*

See Also: -floatValue

*/ - (void) setFloatValue: (float)aFloat { NSNumber *number; // NB: GNUstep can set a float value for an image cell. // NSSliderCell is an example of it! number = [NSNumber numberWithFloat: aFloat]; [self setObjectValue: number]; } /** *

Sets the NSCell's value to anInt.

*

See Also: -intValue

*/ - (void) setIntValue: (int)anInt { NSNumber *number; // NB: GNUstep can set an int value for an image cell. number = [NSNumber numberWithInt: anInt]; [self setObjectValue: number]; } /** *

Sets the NSCell's value to anInt.

*

See Also: -integerValue

*/ - (void) setIntegerValue: (NSInteger)anInt { NSNumber *number; // NB: GNUstep can set an int value for an image cell. number = [NSNumber numberWithInteger: anInt]; [self setObjectValue: number]; } /**

Sets the cell's value to a NSString. The NSCell's type is set to NSTextCellType if needed

See Also: -stringValue

*/ - (void) setStringValue: (NSString*)aString { /* We warn about nil for compatibiliy with MacOS X, which refuses nil. */ if (aString == nil) { NSDebugMLLog (@"MacOSXCompatibility", @"Attempt to use nil as string value"); } if (_cell.type != NSTextCellType) { [self setType: NSTextCellType]; } if (_formatter == nil) { [self setObjectValue: aString]; } else { id newObjectValue; if ([_formatter getObjectValue: &newObjectValue forString: aString errorDescription: NULL]) { [self setObjectValue: newObjectValue]; } else { ASSIGNCOPY(_contents, aString); _cell.contents_is_attributed_string = NO; _cell.has_valid_object_value = NO; } } } /**

Returns some NSCell's attributes for the specified NSCellAttribute

See Also: -setCellAttribute:to:

*/ - (NSInteger) cellAttribute: (NSCellAttribute)aParameter { switch (aParameter) { case NSCellDisabled: return _cell.is_disabled; case NSCellState: return _cell.state; case NSCellEditable: return _cell.is_editable; case NSCellHighlighted: return _cell.is_highlighted; case NSCellIsBordered: return _cell.is_bordered; case NSCellAllowsMixedState: return _cell.allows_mixed_state; /* case NSPushInCell: return 0; case NSChangeGrayCell: return 0; case NSCellLightsByContents: return 0; case NSCellLightsByGray: return 0; case NSChangeBackgroundCell: return 0; case NSCellLightsByBackground: return 0; case NSCellChangesContents: return 0; case NSCellIsInsetButton: return 0; */ case NSCellHasOverlappingImage: { return _cell.image_position == NSImageOverlaps; } case NSCellHasImageHorizontal: { return (_cell.image_position == NSImageRight) || (_cell.image_position == NSImageLeft); } case NSCellHasImageOnLeftOrBottom: { return (_cell.image_position == NSImageBelow) || (_cell.image_position == NSImageLeft); } default: { NSWarnLog (@"cell attribute %d not supported", (int)aParameter); break; } } return 0; } /**

TODO

*

See Also: -cellAttribute:

*/ - (void) setCellAttribute: (NSCellAttribute)aParameter to: (NSInteger)value { switch (aParameter) { case NSCellDisabled: { _cell.is_disabled = value; break; } case NSCellState: { _cell.state = value; break; } case NSCellEditable: { _cell.is_editable = value; break; } case NSCellHighlighted: { _cell.is_highlighted = value; break; } case NSCellHasOverlappingImage: { if (value) { _cell.image_position = NSImageOverlaps; } else { if (_cell.image_position == NSImageOverlaps) { _cell.image_position = NSImageLeft; } } break; } case NSCellHasImageHorizontal: { if (value) { if (_cell.image_position != NSImageLeft && _cell.image_position != NSImageRight) { _cell.image_position = NSImageLeft; } } else { if (_cell.image_position == NSImageLeft) { _cell.image_position = NSImageAbove; } else if (_cell.image_position == NSImageRight) { _cell.image_position = NSImageBelow; } } break; } case NSCellHasImageOnLeftOrBottom: { if (value) { if (_cell.image_position == NSImageAbove) { _cell.image_position = NSImageBelow; } else { _cell.image_position = NSImageLeft; } } else { if (_cell.image_position == NSImageBelow) { _cell.image_position = NSImageAbove; } else { _cell.image_position = NSImageRight; } } break; } /* case NSCellChangesContents: _cell. = value; break; case NSCellIsInsetButton: _cell. = value; break; */ case NSCellIsBordered: { _cell.is_bordered = value; break; } case NSCellAllowsMixedState: { _cell.allows_mixed_state = value; break; } default: { NSWarnLog (@"cell attribute %d not supported", (int)aParameter); break; } } } /**

Sets the NSCell's type. See NSCellType .If the cell is set to NSTextCellType, the cell is given a default title and is reset to the default system font.

See Also: -type

*/ - (void) setType: (NSCellType)aType { if (_cell.type == aType) { return; } _cell.type = aType; switch (_cell.type) { case NSTextCellType: { ASSIGN (_contents, @"title"); _cell.contents_is_attributed_string = NO; /* Doc says we have to reset the font too. */ ASSIGN (_font, [fontClass systemFontOfSize: 0]); break; } case NSImageCellType: { TEST_RELEASE (_cell_image); _cell_image = nil; break; } } } /**

Returns the cell's type. Returns NSNullCellType if the cell's type flag is set to NSImageCellType and if the cell's image is nil. See NSCellType for more information.

See Also -setType:

*/ - (NSCellType) type { if (_cell.type == NSImageCellType && _cell_image == nil) return NSNullCellType; return _cell.type; } /**

Returns whether the NSCell can respond to mouse events.

*

See Also: -setEnabled:

*/ - (BOOL) isEnabled { return !_cell.is_disabled; } /**

Sets whether the NSCell can respond to mouse events

See Also: -isEnabled

*/ - (void) setEnabled: (BOOL)flag { _cell.is_disabled = !flag; } /**

Returns whether the NSCell has a bezeled border. By default a NSCell has no bezeled border

See Also: -setBezeled:

*/ - (BOOL) isBezeled { return _cell.is_bezeled; } /**

Returns whether the NSCell has a border. By default a NSCell has border

See Also: -setBordered: -setBezeled: -isBezeled

*/ - (BOOL) isBordered { return _cell.is_bordered; } /**

Returns whether the cell is opaque. Return NO by default

*/ - (BOOL) isOpaque { return NO; } /**

Sets whether the cell has a bezeled border. If this method is called, the bordered flag is turn off. By default a NSCell has no bezeled border

See Also: -isBezeled -setBordered: -isBordered

*/ - (void) setBezeled: (BOOL)flag { _cell.is_bezeled = flag; _cell.is_bordered = NO; } /**

Sets whether the cell has a border. If this method is called, the bezeled flag is turn off. By default a NSCell has no border

See Also: -isBordered -setBezeled: -isBezeled

*/ - (void) setBordered: (BOOL)flag { _cell.is_bordered = flag; _cell.is_bezeled = NO; } - (NSFocusRingType) focusRingType { return _cell.focus_ring_type; } - (void) setFocusRingType: (NSFocusRingType)type { _cell.focus_ring_type = type; } /**

Sets the NSCell's state. Please use always symbolic constants when calling this method. The integer values could be changed in the this implementation. (Currently they match the Cocoa values but they are quite strange)

See Also: -state

*/ - (void) setState: (NSInteger)value { /* We do exactly as in macosx when value is not NSOnState, * NSOffState, NSMixedState, even if their behaviour (value < 0 ==> * NSMixedState) is a bit strange. We could decide to do * differently in the future, so please use always symbolic * constants when calling this method, this way your code won't be * broken by changes. */ if (value > 0 || (value < 0 && _cell.allows_mixed_state == NO)) { _cell.state = NSOnState; } else if (value == 0) { _cell.state = NSOffState; } else { _cell.state = NSMixedState; } } /**

Returns the NSCell's state

See Also: -setState:

*/ - (NSInteger) state { return _cell.state; } - (BOOL) allowsMixedState { return _cell.allows_mixed_state; } - (void) setAllowsMixedState: (BOOL)flag { _cell.allows_mixed_state = flag; if (!flag && _cell.state == NSMixedState) { [self setNextState]; } } - (NSInteger) nextState { switch (_cell.state) { case NSOnState: { return NSOffState; } case NSOffState: { if (_cell.allows_mixed_state) { return NSMixedState; } else { return NSOnState; } } case NSMixedState: default: { return NSOnState; } } } - (void) setNextState { [self setState: [self nextState]]; } /**

Returns the alignment of the text used in the NSCell. See NSTextAlignment for more informations. By default the text alignment is NSJustifiedTextAlignment

See Also: -setAlignment:

*/ - (NSTextAlignment) alignment { return _cell.text_align; } /**

Returns the font of the text used in the NSCell

See Also: -setFont:

*/ - (NSFont*) font { return _font; } /**

Returns whether the cell is editable.By default a NSCell is not editable.

See Also: -setEditable:

*/ - (BOOL) isEditable { return _cell.is_editable; } /**

Returns whether the cell is selectable. This method returns YES if the cell is selectable or editable. NO otherwise

See Also: -setSelectable: -isEditable -setEditable:

*/ - (BOOL) isSelectable { return _cell.is_selectable || _cell.is_editable; } /**

Returns whether the NSCell is scrollable. By default a NSCell is not scrollable

See Also: -setScrollable:

*/ - (BOOL) isScrollable { return _cell.is_scrollable; } /**

Sets the alignment of the text. See NSTextAlignment.

See Also: -alignment

*/ - (void) setAlignment: (NSTextAlignment)mode { // This does not have any influence on attributed strings _cell.text_align = mode; } /**

Sets whether the NSCell's text is editable.

See Also: -isEditable -setSelectable: -isSelectable

*/ - (void) setEditable: (BOOL)flag { /* * The cell_editable flag is also checked to see if the cell is * selectable so turning edit on also turns selectability on (until * edit is turned off again). */ _cell.is_editable = flag; } /**

Sets the text font. The NSCell's type is set to NSTextCellType if needed

See Also: -font -setType: -type

*/ - (void) setFont: (NSFont*)fontObject { if (_cell.type != NSTextCellType) { [self setType: NSTextCellType]; } // This does not have any influence on attributed strings ASSIGN (_font, fontObject); } /**

Sets whether the cell selectable. Making a cell unselectable also * makes it uneditable until a -setEditable: re-enables it.

*

See Also: -isSelectable -setEditable: -isEditable

*/ - (void) setSelectable: (BOOL)flag { _cell.is_selectable = flag; if (!flag) _cell.is_editable = NO; } /**

Sets whether the NCell is scrollable. By default a NSCell is not scrollable

See Also: -isSelectable

*/ - (void) setScrollable: (BOOL)flag { _cell.is_scrollable = flag; if (flag) { [self setWraps: NO]; } } - (void) setWraps: (BOOL)flag { if (flag) { if (![self wraps]) [self setLineBreakMode: NSLineBreakByWordWrapping]; } else { if ([self wraps]) [self setLineBreakMode: NSLineBreakByClipping]; } } - (BOOL) wraps { return _cell.line_break_mode == NSLineBreakByWordWrapping || _cell.line_break_mode == NSLineBreakByCharWrapping; } - (void) setAttributedStringValue: (NSAttributedString*)attribStr { /* Hmm. FIXME. Not sure what to do here. */ if (_formatter != nil) { id newObjectValue; if ([_formatter getObjectValue: &newObjectValue forString: [attribStr string] errorDescription: NULL] == YES) { [self setObjectValue: newObjectValue]; /* What about the attributed string ? We are loosing it. */ return; } _cell.has_valid_object_value = NO; } else { _cell.has_valid_object_value = YES; ASSIGN (_object_value, attribStr); } ASSIGN (_contents, attribStr); _cell.contents_is_attributed_string = YES; } - (NSAttributedString*) attributedStringValue { if (_formatter != nil) { NSDictionary *attributes; NSAttributedString *attrStr; attributes = [self _nonAutoreleasedTypingAttributes]; attrStr = [_formatter attributedStringForObjectValue: _object_value withDefaultAttributes: attributes]; RELEASE(attributes); if (attrStr != nil) { return attrStr; } } /* In all other cases */ if (_cell.contents_is_attributed_string && nil != _contents) { return (NSAttributedString *)_contents; } else { NSDictionary *dict; NSAttributedString *attrStr; dict = [self _nonAutoreleasedTypingAttributes]; attrStr = [[NSAttributedString alloc] initWithString: [self stringValue] attributes: dict]; RELEASE(dict); return AUTORELEASE(attrStr); } } - (void) setAllowsEditingTextAttributes: (BOOL)flag { _cell.is_rich_text = flag; if (!flag) _cell.imports_graphics = NO; } - (BOOL) allowsEditingTextAttributes { return _cell.is_rich_text; } - (void) setImportsGraphics: (BOOL)flag { _cell.imports_graphics = flag; if (flag) _cell.is_rich_text = YES; } - (BOOL) importsGraphics { return _cell.imports_graphics; } - (NSString*) title { return [self stringValue]; } - (void) setTitle: (NSString*)aString { [self setStringValue: aString]; } - (NSLineBreakMode) lineBreakMode { return _cell.line_break_mode; } - (void) setLineBreakMode: (NSLineBreakMode)mode { if (mode == NSLineBreakByCharWrapping || mode == NSLineBreakByWordWrapping) { _cell.is_scrollable = NO; } _cell.line_break_mode = mode; } - (NSWritingDirection) baseWritingDirection { return _cell.base_writing_direction; } - (void) setBaseWritingDirection: (NSWritingDirection)direction { _cell.base_writing_direction = direction; } /**

Implemented by subclasses to return the action method. The NSCell implementaiton returns NULL.

See Also: -setAction: -setTarget: -target

*/ - (SEL) action { return NULL; } /**

Implemented by subclasses to set the action method. The NSCell implementation raises a NSInternalInconsistencyException

See Also: -action -setTarget: -target

*/ - (void) setAction: (SEL)aSelector { [NSException raise: NSInternalInconsistencyException format: @"attempt to set an action in an NSCell"]; } /**

Implemented by subclasses to set the target object. The NSCell implementation raises a NSInternalInconsistencyException

See Also: -target -setAction: -action

*/ - (void) setTarget: (id)anObject { [NSException raise: NSInternalInconsistencyException format: @"attempt to set a target in an NSCell"]; } /**

Implemented by subclass to return the target object. The NSCell implementation returns nil

See Also: -setTarget: -setAction: -action

*/ - (id) target { return nil; } /**

Returns whether the cell can continuously send its action messages.

See Also: -setContinuous:

*/ - (BOOL) isContinuous { // Some subclasses should redefine this with NSLeftMouseDraggedMask return (_action_mask & NSPeriodicMask) != 0; } /**

Sets whether the cell can continuously send its action messages.

*

See Also: -isContinuous

*/ - (void) setContinuous: (BOOL)flag { // Some subclasses should redefine this with NSLeftMouseDraggedMask if (flag) { _action_mask |= NSPeriodicMask; } else { _action_mask &= ~NSPeriodicMask; } } /**

TODO Explain

*/ - (NSInteger) sendActionOn: (NSInteger)mask { NSUInteger previousMask = _action_mask; _action_mask = mask; return previousMask; } /**

Returns the NSCell's image if the NSCell's type is NSImageCellType, returns nil otherwise.

See Also: -setImage: -setType: -type

*/ - (NSImage*) image { if (_cell.type == NSImageCellType) { return _cell_image; } else return nil; } /**

Sets the NSCell's image to anImage. This method sets the cell's type to NSImageCellType if needed. Raises an NSInvalidArgumentException if the anImage is not an NSImage (sub)class. The new image is retained and the old one is released

See Also: -image

*/ - (void) setImage: (NSImage*)anImage { if (anImage) { NSAssert ([anImage isKindOfClass: imageClass], NSInvalidArgumentException); } if (_cell.type != NSImageCellType) { [self setType: NSImageCellType]; } ASSIGN (_cell_image, anImage); } /**

Implemented by sublclasses to assigns the tag anInt. The NSCell implementation raises an NSInvalidArgumentException.

See Also: -tag

*/ - (void) setTag: (NSInteger)anInt { [NSException raise: NSInternalInconsistencyException format: @"attempt to set a tag in an NSCell"]; } /**

Implemented by subclasses to Return the tag. The NSCell implementation returns -1

See Also: -setTag:

*/ - (NSInteger) tag { return -1; } /* * Formatting Data */ - (void) setFloatingPointFormat: (BOOL)autoRange left: (NSUInteger)leftDigits right: (NSUInteger)rightDigits { NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; NSMutableString *format = [[NSMutableString alloc] init]; if (autoRange) { NSUInteger fieldWidth = leftDigits + rightDigits + 1; // FIXME: this does not fully match the documentation. while (fieldWidth--) { [format appendString: @"#"]; } } else { while (leftDigits--) { [format appendString: @"#"]; } [format appendString: @"."]; while (rightDigits--) { [format appendString: @"0"]; } } [formatter setFormat: format]; RELEASE(format); [self setFormatter: formatter]; RELEASE(formatter); } - (void) setFormatter: (NSFormatter*)newFormatter { ASSIGN(_formatter, newFormatter); } - (id) formatter { return _formatter; } /**

TODO

*/ - (NSInteger) entryType { return _cell.entry_type; } /**

TODO

*/ - (void) setEntryType: (NSInteger)aType { [self setType: NSTextCellType]; // TODO: This should select a suitable formatter _cell.entry_type = aType; } - (BOOL) isEntryAcceptable: (NSString*)aString { if ((_formatter != nil) && ![aString isEqualToString: @""]) { id newObjectValue; return [_formatter getObjectValue: &newObjectValue forString: aString errorDescription: NULL]; } else { return YES; } } /* * Menu */ - (void) setMenu: (NSMenu*)aMenu { ASSIGN (_menu, aMenu); } - (NSMenu*) menu { return _menu; } - (NSMenu*) menuForEvent: (NSEvent*)anEvent inRect: (NSRect)cellFrame ofView: (NSView*)aView { return [self menu]; } /** * Compares the reciever to another to another NSCell. * The argument must be an NSCell sublclass and have * the NSCellType NSTextCellType. Returns the result * of the comparison of each cell's stringValue. */ - (NSComparisonResult) compare: (id)otherCell { if ([otherCell isKindOfClass: cellClass] == NO) { [NSException raise: NSBadComparisonException format: @"NSCell comparison with non-NSCell"]; } if (_cell.type != NSTextCellType || ((NSCell*)otherCell)->_cell.type != NSTextCellType) { [NSException raise: NSBadComparisonException format: @"Comparison between non-text cells"]; } /* We shouldn't access instance variables directly as subclasses may override stringValue to retrieve the value from somewhere else. */ return [[self stringValue] compare: [(NSCell*)otherCell stringValue]]; } /* * Should this cell respond to keyboard input? */ - (BOOL) acceptsFirstResponder { return _cell.is_disabled == NO && _cell.refuses_first_responder == NO; } - (void) setShowsFirstResponder: (BOOL)flag { _cell.shows_first_responder = flag; } - (BOOL) showsFirstResponder { return _cell.shows_first_responder; } - (void) setTitleWithMnemonic: (NSString*)aString { NSRange r = [aString rangeOfString: @"&"]; if (r.length > 0) { NSUInteger location = r.location; [self setTitle: [[aString substringToIndex: location] stringByAppendingString: [aString substringFromIndex: NSMaxRange(r)]]]; // TODO: We should underline this character [self setMnemonicLocation: location]; } } - (NSString*) mnemonic { NSUInteger location = [self mnemonicLocation]; NSString *c = [self title]; if ((location == NSNotFound) || location >= [c length]) return @""; return [c substringWithRange: NSMakeRange (location, 1)]; } - (void) setMnemonicLocation: (NSUInteger)location { _cell.mnemonic_location = location; } - (NSUInteger) mnemonicLocation { return _cell.mnemonic_location; } - (BOOL) refusesFirstResponder { return _cell.refuses_first_responder; } - (void) setRefusesFirstResponder: (BOOL)flag { _cell.refuses_first_responder = flag; } /** * Simulates a single click in the cell (only works with controls which have * no more than one cell). This method is deprecated, * performClickWithFrame:inView: is the right method to use now. */ - (void) performClick: (id)sender { NSView *cv = [self controlView]; if (cv != nil) [self performClickWithFrame: [cv bounds] inView: cv]; } /* * Helper method used to send actions. Sender normally is [self controlView]. */ - (BOOL) _sendActionFrom: (id)sender { SEL action = [self action]; if ([sender respondsToSelector: @selector(sendAction:to:)]) { return [sender sendAction: action to: [self target]]; } else { if (sender == nil) sender = self; if (action) { return [NSApp sendAction: action to: [self target] from: sender]; } } return NO; } /** * Simulates a single click in the cell. * The display of the cell with this event * occurs in the area delimited by cellFrame within * controlView. */ - (void) performClickWithFrame: (NSRect)cellFrame inView: (NSView *)controlView { if (_cell.is_disabled == YES) { return; } [self setNextState]; if (controlView != nil) { NSWindow *cvWin = [controlView window]; NSDate *limit = [NSDate dateWithTimeIntervalSinceNow: 0.1]; [controlView lockFocus]; [self highlight: YES withFrame: cellFrame inView: controlView]; [cvWin flushWindow]; // Wait approx 1/10 seconds [[NSRunLoop currentRunLoop] runUntilDate: limit]; [self highlight: NO withFrame: cellFrame inView: controlView]; [cvWin flushWindow]; [controlView unlockFocus]; } [self _sendActionFrom: controlView]; } /* * Deriving values from other objects (not necessarily cells) */ - (void) takeObjectValueFrom: (id)sender { [self setObjectValue: [sender objectValue]]; } /**

Sets the NSCell's double value to sender's double value

See Also: -setDoubleValue:

*/ - (void) takeDoubleValueFrom: (id)sender { [self setDoubleValue: [sender doubleValue]]; } /**

Sets the NSCell's float value to sender's float value

See Also: -setFloatValue:

*/ - (void) takeFloatValueFrom: (id)sender { [self setFloatValue: [sender floatValue]]; } /**

Sets the NSCell's int value to sender's int value

See Also: -setIntValue:

*/ - (void) takeIntValueFrom: (id)sender { [self setIntValue: [sender intValue]]; } /**

Sets the NSCell's NSInteger value to sender's NSInteger value

See Also: -setIntegerValue:

*/ - (void) takeIntegerValueFrom: (id)sender { [self setIntegerValue: [sender integerValue]]; } /**

Sets the NSCell's NSString value to sender's NSSting value

See Also: -setStringValue:

*/ - (void) takeStringValueFrom: (id)sender { [self setStringValue: [sender stringValue]]; } /**

Returns the NSCell's represented object

See Also: -setRepresentedObject:

*/ - (id) representedObject { return _represented_object; } /**

Sets the NSCell's represented object to anObject. anObject will be retain.

See Also: -representedObject

*/ - (void) setRepresentedObject: (id)anObject { /* Ahm - not nice - the RETAIN here could cause retain cycles - anyway. */ ASSIGN (_represented_object, anObject); } /**

Returns YES. Subclasses should overrided this method if you want stop tracking the mouse. This method is call in the -trackMouse:inRect:ofView:untilMouseUp: main loop.

See Also: -trackMouse:inRect:ofView:untilMouseUp:

*/ - (BOOL) continueTracking: (NSPoint)lastPoint at: (NSPoint)currentPoint inView: (NSView*)controlView { return YES; } /**

Returns the mouse flags. This flags are usally sets in the -trackMouse:inRect:ofView:untilMouseUp: method

*/ - (NSInteger) mouseDownFlags { return _mouse_down_flags; } /**

Gets the NSCell's delay and the interval parameters used when NSCell sends continouly action messages. The NSCell implementation sets both delay and interval to 0.1.

See Also: -trackMouse:inRect:ofView:untilMouseUp:

*/ - (void) getPeriodicDelay: (float*)delay interval: (float*)interval { *delay = 0.1; *interval = 0.1; } /**

Returns whether tracking starts. The NSCell implementation returns YES when the startPoint is into the control view retangle, NO otherwise. This method is call at the early stage of -trackMouse:inRect:ofView:untilMouseUp:

See Also: [NSView-mouse:inRect:] -trackMouse:inRect:ofView:untilMouseUp:

*/ - (BOOL) startTrackingAt: (NSPoint)startPoint inView: (NSView*)controlView { // If the point is in the view then yes start tracking if ([controlView mouse: startPoint inRect: [controlView bounds]]) return YES; else return NO; } /**

Default implementation of this method in NSCell does nothing.

*/ - (void) stopTracking: (NSPoint)lastPoint at: (NSPoint)stopPoint inView: (NSView*)controlView mouseIsUp: (BOOL)flag { } - (BOOL) trackMouse: (NSEvent*)theEvent inRect: (NSRect)cellFrame ofView: (NSView*)controlView untilMouseUp: (BOOL)flag { NSApplication *theApp = [NSApplication sharedApplication]; NSUInteger event_mask = NSLeftMouseDownMask | NSLeftMouseUpMask | NSMouseMovedMask | NSLeftMouseDraggedMask | NSOtherMouseDraggedMask | NSRightMouseDraggedMask; NSPoint location = [theEvent locationInWindow]; NSPoint point = [controlView convertPoint: location fromView: nil]; float delay; float interval; NSPoint last_point = point; BOOL done; BOOL mouseWentUp; unsigned periodCount = 0; NSDebugLLog(@"NSCell", @"cell start tracking in rect %@ initial point %f %f", NSStringFromRect(cellFrame), point.x, point.y); _mouse_down_flags = [theEvent modifierFlags]; if (![self startTrackingAt: point inView: controlView]) return NO; if (![controlView mouse: point inRect: cellFrame]) return NO; // point is not in cell if ((_action_mask & NSLeftMouseDownMask) && [theEvent type] == NSLeftMouseDown) [self _sendActionFrom: controlView]; if (_action_mask & NSPeriodicMask) { [self getPeriodicDelay: &delay interval: &interval]; [NSEvent startPeriodicEventsAfterDelay: delay withPeriod: interval]; event_mask |= NSPeriodicMask; } NSDebugLLog(@"NSCell", @"cell get mouse events\n"); mouseWentUp = NO; done = NO; if (theEvent != [NSApp currentEvent]) theEvent = [NSApp currentEvent]; else theEvent = [theApp nextEventMatchingMask: event_mask untilDate: [NSDate distantFuture] inMode: NSEventTrackingRunLoopMode dequeue: YES]; while (!done) { NSEventType eventType; BOOL pointIsInCell; eventType = [theEvent type]; if (eventType != NSPeriodic || periodCount == 4) { last_point = point; if (eventType == NSPeriodic) { NSWindow *w = [controlView window]; /* * Too many periodic events in succession - * update the mouse location and reset the counter. */ location = [w mouseLocationOutsideOfEventStream]; periodCount = 0; } else { location = [theEvent locationInWindow]; } point = [controlView convertPoint: location fromView: nil]; NSDebugLLog(@"NSCell", @"location %f %f\n", location.x, location.y); NSDebugLLog(@"NSCell", @"point %f %f\n", point.x, point.y); } else { periodCount++; NSDebugLLog (@"NSCell", @"cell got a periodic event"); } if (![controlView mouse: point inRect: cellFrame]) { NSDebugLLog(@"NSCell", @"point not in cell frame\n"); pointIsInCell = NO; if (flag == NO) { NSDebugLLog(@"NSCell", @"cell return immediately\n"); done = YES; } } else { pointIsInCell = YES; } if (!done && ![self continueTracking: last_point // should continue at: point // tracking? inView: controlView]) { NSDebugLLog(@"NSCell", @"cell stop tracking\n"); done = YES; } // Did the mouse go up? if (eventType == NSLeftMouseUp) { NSDebugLLog(@"NSCell", @"cell mouse went up\n"); mouseWentUp = YES; done = YES; } else { if (pointIsInCell && ((eventType == NSLeftMouseDragged && (_action_mask & NSLeftMouseDraggedMask)) || ((eventType == NSPeriodic) && (_action_mask & NSPeriodicMask)))) [self _sendActionFrom: controlView]; } if (!done) theEvent = [theApp nextEventMatchingMask: event_mask untilDate: [NSDate distantFuture] inMode: NSEventTrackingRunLoopMode dequeue: YES]; } // Hook called when stop tracking [self stopTracking: last_point at: point inView: controlView mouseIsUp: mouseWentUp]; if (_action_mask & NSPeriodicMask) [NSEvent stopPeriodicEvents]; if (mouseWentUp) { [self setNextState]; if ((_action_mask & NSLeftMouseUpMask)) [self _sendActionFrom: controlView]; } // Return YES only if the mouse went up within the cell if (mouseWentUp && (flag || [controlView mouse: point inRect: cellFrame])) { NSDebugLLog(@"NSCell", @"mouse went up in cell\n"); return YES; } NSDebugLLog(@"NSCell", @"mouse did not go up in cell\n"); return NO; // Otherwise return NO } /**

TODO

*/ - (void) resetCursorRect: (NSRect)cellFrame inView: (NSView*)controlView { if (_cell.type == NSTextCellType && _cell.is_disabled == NO && (_cell.is_selectable == YES || _cell.is_editable == YES)) { static NSCursor *cursor = nil; NSRect rect; if (cursor== nil) { cursor = RETAIN([NSCursor IBeamCursor]); } rect = NSIntersectionRect(cellFrame, [controlView visibleRect]); /* * Here we depend on an undocumented feature of NSCursor which may or * may not exist in OPENSTEP or MacOS-X ... * If we add a cursor rect to a view and don't set it to be set on * either entry to or exit from the view, we push it on entry and * pop it from the cursor stack on exit. */ [controlView addCursorRect: rect cursor: cursor]; } } /**

Implemented by subclasses to returns the key equivalent. The NSCell implementation returns an empty NSString.

*/ - (NSString*) keyEquivalent { return @""; } /**

Does nothing. This method is used by subclasses to recalculate sizes

It is usally called from a NSControl object

See Also: [NSControl-calcSize]

*/ - (void) calcDrawInfo: (NSRect)aRect { } /**Returns the minimun size needed to display the NSCell. This size is calculate by adding : the borders (plain or bezeled) size the spacing between the border and inside the cell the TODO ... if the cell is type of NSTextCellType or the image size if the cell has a NSImageCellType type.

This method returns NSZeroSize if the cell has a NSNullCellType type (Cocoa returns a very big size instead).

*/ - (NSSize) cellSize { NSSize borderSize, s; NSBorderType aType; // Get border size if (_cell.is_bordered) aType = NSLineBorder; else if (_cell.is_bezeled) aType = NSBezelBorder; else aType = NSNoBorder; borderSize = [[GSTheme theme] sizeForBorderType: aType]; // Add spacing between border and inside if (_cell.is_bordered || _cell.is_bezeled) { borderSize.height += 1; borderSize.width += 3; } // Get Content Size switch (_cell.type) { case NSTextCellType: { NSAttributedString *attrStr; attrStr = [self attributedStringValue]; if ([attrStr length] != 0) { s = [attrStr size]; } else { s = [self _sizeText: @"A"]; } } break; case NSImageCellType: if (_cell_image == nil) { s = NSZeroSize; } else { s = [_cell_image size]; } break; default: case NSNullCellType: // macosx instead returns a 'very big size' here; we return NSZeroSize s = NSZeroSize; break; } // Add in border size s.width += 2 * borderSize.width; s.height += 2 * borderSize.height; return s; } /**

TODO. Currently the GNUstep implementation returns -cellSize

See Also: -cellSize

*/ - (NSSize) cellSizeForBounds: (NSRect)aRect { if (_cell.type == NSTextCellType) { // TODO: Resize the text to fit } return [self cellSize]; } /**

TODO

*/ - (NSRect) drawingRectForBounds: (NSRect)theRect { NSSize borderSize; NSBorderType aType; // Get border size if (_cell.is_bordered) aType = NSLineBorder; else if (_cell.is_bezeled) aType = NSBezelBorder; else aType = NSNoBorder; borderSize = [[GSTheme theme] sizeForBorderType: aType]; return NSInsetRect(theRect, borderSize.width, borderSize.height); } /**

The GNUstep implementation returns -drawingRectForBounds:

*/ - (NSRect) imageRectForBounds: (NSRect)theRect { return [self drawingRectForBounds: theRect]; } /**

TODO

*/ - (NSRect) titleRectForBounds: (NSRect)theRect { if (_cell.type == NSTextCellType) { NSRect frame = [self drawingRectForBounds: theRect]; // Add spacing between border and inside if (_cell.is_bordered || _cell.is_bezeled) { frame.origin.x += 3; frame.size.width -= 6; frame.origin.y += 1; frame.size.height -= 2; } return frame; } else { return theRect; } } - (void) setControlSize: (NSControlSize)controlSize { _cell.control_size = controlSize; } - (NSControlSize) controlSize { return _cell.control_size; } - (void) setControlTint: (NSControlTint)controlTint { _cell.control_tint = controlTint; } - (NSControlTint) controlTint { return _cell.control_tint; } /**

This method is used by subclasses to get the control view. This method returns nil.

*/ - (NSView*) controlView { return nil; } /**

This method is used by subclasses to specify the control view.

*/ - (void) setControlView: (NSView*)view { // Do nothing } /**

This drawing is minimal and with no background, * to make it easier for subclass to customize drawing.

*/ - (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { NSRect drawingRect = [self drawingRectForBounds: cellFrame]; //FIXME: Check if this is also neccessary for images, // Add spacing between border and inside if (_cell.is_bordered || _cell.is_bezeled) { drawingRect.origin.x += 3; drawingRect.size.width -= 6; drawingRect.origin.y += 1; drawingRect.size.height -= 2; } switch (_cell.type) { case NSTextCellType: if (_cell.in_editing) [self _drawEditorWithFrame: cellFrame inView: controlView]; else [self _drawAttributedText: [self _drawAttributedString] inFrame: drawingRect]; break; case NSImageCellType: if (_cell_image) { NSSize size; NSPoint position; size = [_cell_image size]; position.x = MAX(NSMidX(drawingRect) - (size.width/2.),0.); position.y = MAX(NSMidY(drawingRect) - (size.height/2.),0.); [_cell_image drawInRect: NSMakeRect(position.x, position.y, size.width, size.height) fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0 respectFlipped: YES hints: nil]; } break; case NSNullCellType: break; } // NB: We don't do any highlighting to make it easier for subclasses // to reuse this code while doing their own custom highlighting and // prettyfying } /**

Draws the cell in controlView

*/ - (void) drawWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { // do nothing if cell's frame rect is zero if (NSIsEmptyRect(cellFrame)) return; // draw the border if needed [self _drawBorderAndBackgroundWithFrame: cellFrame inView: controlView]; // draw interior [self drawInteriorWithFrame: cellFrame inView: controlView]; // Draw first responder [self _drawFocusRingWithFrame: cellFrame inView: controlView]; } /**

Sets whether the NSCell is highlighted.

See Also: -isHighlighted

*/ - (void) setHighlighted: (BOOL) flag { _cell.is_highlighted = flag; } /**

Returns whether the cell is highlighted. By default NO

See Also: -setHighlighted:

*/ - (BOOL) isHighlighted { return _cell.is_highlighted; } /** *

TODO explain

*/ - (void) highlight: (BOOL)lit withFrame: (NSRect)cellFrame inView: (NSView*)controlView { if (_cell.is_highlighted != lit) { _cell.is_highlighted = lit; // Disabling this because when combined with making // -[NSButtonCell isOpaque] return NO, it was causing scroller buttons // to stay stuck down. --Eric (2013-09-28) #if 0 /* * NB: This has a visible effect only if subclasses override * drawWithFrame:inView: to draw something special when the * cell is highlighted. * NSCell simply draws border+text/image and makes no highlighting, * for easier subclassing. */ if ([self isOpaque] == NO) { /* FIXME - This looks like potentially generating an * infinite loop! The control asking the cell to draw * itself in the rect, the cell asking the control to draw * the rect, the control asking the cell to draw itself in * the rect, the cell ... * * I think we should remove it. The control is responsible * for using the cell to draw, not vice versa. */ [controlView displayRect: cellFrame]; } #endif [self drawWithFrame: cellFrame inView: controlView]; } } - (NSColor*) highlightColorWithFrame: (NSRect)cellFrame inView: (NSView *)controlView { return [NSColor selectedControlColor]; } - (NSText*) setUpFieldEditorAttributes: (NSText*)textObject { NSDictionary *attr; // Reset the string to have a well defined state. The real string gets set later on. [textObject setString: @""]; [textObject setTextColor: [self textColor]]; if ([self isBezeled]) { [textObject setBackgroundColor: [NSColor textBackgroundColor]]; [textObject setDrawsBackground: YES]; } else { [textObject setDrawsBackground: NO]; } [textObject setFont: [self font]]; [textObject setAlignment: [self alignment]]; // FIXME: Add base writing direction [textObject setEditable: [self isEditable]]; [textObject setSelectable: [self isSelectable]]; [textObject setRichText: [self allowsEditingTextAttributes]]; [textObject setImportsGraphics: [self importsGraphics]]; [(NSTextView*)textObject setAllowsUndo: [self allowsUndo]]; attr = [self _nonAutoreleasedTypingAttributes]; [(NSTextView*)textObject setTypingAttributes: attr]; RELEASE(attr); return textObject; } - (void) _setupTextWithFrame: (NSRect)aRect inView: (NSView*)controlView editor: (NSText*)textObject delegate: (id)anObject range: (NSRange)selection { BOOL needsClipView; BOOL wraps = [self wraps]; NSTextContainer *ct; NSSize maxSize; NSRect titleRect = [self titleRectForBounds: aRect]; /* We always add a clip view if the cell is editable so that the user can edit the whole contents even if the cell's contents normally is clipped. */ needsClipView = [self isScrollable] || [self isEditable]; if (needsClipView) { NSClipView *cv; cv = [[NSClipView alloc] initWithFrame: titleRect]; [cv setDocumentView: textObject]; [controlView addSubview: cv]; RELEASE(cv); } else [controlView addSubview: textObject]; /* Note: The order of statements matters here. We must set the text object's horizontallyResizable and verticallyResizable attributes before setting its frame size. Otherwise, the text object's width and/or height might incorrectly be reduced to zero (since the text object has no contents at this point) if the text object was resizable by its text container before. Of course we could also have set the text object's minimum size to the intended frame size, but then we must update the minimum size whenever the field editor's frame is changed in -_drawEditorWithFrame:inView:. Note that the minimum size is not relevant when a clip view is used. */ [textObject setMinSize: NSZeroSize]; [textObject setMaxSize: NSMakeSize(1e6, 1e6)]; [textObject setHorizontallyResizable: needsClipView && !wraps]; [textObject setVerticallyResizable: needsClipView]; [textObject setFrame: titleRect]; if (needsClipView) [textObject setAutoresizingMask: NSViewWidthSizable + NSViewHeightSizable]; else [textObject setAutoresizingMask: NSViewNotSizable]; /* Note: Order of statements matters again. The heightTracksTextView and widthTracksTextView container attributes must be set after setting the horizontallyResizable and verticallyResizable text view attributes because NSTextView's setter methods include "safety code", which always updates the container attributes along with the text view attributes. FIXME Fix NSTextView to only reset the text container attributes, but never set them. However note that this may break some sloppily written code which forgets to set the text container attributes. */ /* See comments in NSStringDrawing.m about the choice of maximum size. */ ct = [(NSTextView*)textObject textContainer]; if (wraps) maxSize = NSMakeSize(NSWidth(titleRect), 1e6); else maxSize = NSMakeSize(1e6, 1e6); [ct setContainerSize: maxSize]; [ct setWidthTracksTextView: wraps]; [ct setHeightTracksTextView: NO]; [self _updateFieldEditor: textObject]; [textObject setSelectedRange: selection]; [textObject scrollRangeToVisible: selection]; [textObject setDelegate: anObject]; [[controlView window] makeFirstResponder: textObject]; _cell.in_editing = YES; } /**

Ends any text editing. This method sets the text object's delegate to nil, and remove the NSClipView and the text object used for editing

See Also: -editWithFrame:inView:editor:delegate:event:

*/ - (void) endEditing: (NSText*)textObject { NSClipView *clipView; _cell.in_editing = NO; [textObject setString: @""]; [textObject setDelegate: nil]; clipView = (NSClipView*)[textObject superview]; if ([clipView isKindOfClass: [NSClipView class]]) { [clipView setDocumentView: nil]; [clipView removeFromSuperview]; } else [textObject removeFromSuperview]; } /* * Editing Text */ /**

.This method does nothing if a the controlView is nil, if text object does not exist or if the cell's type is not NSTextCellType

*/ - (void) editWithFrame: (NSRect)aRect inView: (NSView*)controlView editor: (NSText*)textObject delegate: (id)anObject event: (NSEvent*)theEvent { if (!controlView || !textObject || (_cell.type != NSTextCellType)) return; [self _setupTextWithFrame: aRect inView: controlView editor: textObject delegate: anObject range: NSMakeRange(0, 0)]; if ([theEvent type] == NSLeftMouseDown) { [textObject mouseDown: theEvent]; } } /**

This method does nothing if the controlView is nil, if text object does not exist or if the cell's type is not NSTextCellType

*/ - (void) selectWithFrame: (NSRect)aRect inView: (NSView*)controlView editor: (NSText*)textObject delegate: (id)anObject start: (NSInteger)selStart length: (NSInteger)selLength { if (!controlView || !textObject || (_cell.type != NSTextCellType)) return; [self _setupTextWithFrame: aRect inView: controlView editor: textObject delegate: anObject range: NSMakeRange(selStart, selLength)]; } - (BOOL) sendsActionOnEndEditing { return _cell.sends_action_on_end_editing; } - (void) setSendsActionOnEndEditing: (BOOL)flag { _cell.sends_action_on_end_editing = flag; } - (BOOL) allowsUndo { return _cell.allows_undo; } - (void) setAllowsUndo: (BOOL)flag { _cell.allows_undo = flag; } /* * Copying */ - (id) copyWithZone: (NSZone*)zone { NSCell *c = (NSCell*)NSCopyObject (self, 0, zone); /* Hmmm. */ c->_contents = [_contents copyWithZone: zone]; /* Because of performance issues (and because so the doc says) only pointers to the objects are copied. We need to RETAIN them all though. */ _font = TEST_RETAIN (_font); _object_value = TEST_RETAIN (_object_value); _menu = TEST_RETAIN (_menu); _cell_image = TEST_RETAIN (_cell_image); _formatter = TEST_RETAIN (_formatter); _formatter = TEST_RETAIN (_represented_object); return c; } /* * NSCoding protocol */ - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { unsigned long cFlags = 0; unsigned int cFlags2 = 0; id contents; // encode contents if (_cell.type == NSTextCellType) { contents = _contents; } else if (_cell.type == NSImageCellType) { contents = _cell_image; } else { contents = [self objectValue]; } [aCoder encodeObject: contents forKey: @"NSContents"]; // flags cFlags |= [self focusRingType]; cFlags |= [self showsFirstResponder] ? 0x4 : 0; cFlags |= (_action_mask & NSLeftMouseUpMask) ? 0 : 0x20; cFlags |= [self wraps] ? 0x40 : 0; cFlags |= (_action_mask & NSLeftMouseDraggedMask) ? 0x100 : 0; cFlags |= (_action_mask & NSLeftMouseDownMask) ? 0x40000 : 0; cFlags |= [self isContinuous] ? 0x80000 : 0; cFlags |= [self isScrollable] ? 0x100000 : 0; cFlags |= [self isSelectable] ? 0x200000 : 0; cFlags |= [self isBezeled] ? 0x400000 : 0; cFlags |= [self isBordered] ? 0x800000 : 0; cFlags |= ([self type] << 26); cFlags |= [self isEditable] ? 0x10000000 : 0; cFlags |= ([self isEnabled] == NO) ? 0x20000000 : 0; cFlags |= [self isHighlighted] ? 0x40000000 : 0; cFlags |= ([self state] == NSOnState) ? 0x80000000 : 0; [aCoder encodeInt: cFlags forKey: @"NSCellFlags"]; // flags part 2 cFlags2 |= ([self controlTint] << 5); cFlags2 |= ([self lineBreakMode] << 9); cFlags2 |= ([self controlSize] << 17); cFlags2 |= [self sendsActionOnEndEditing] ? 0x400000 : 0; cFlags2 |= [self allowsMixedState] ? 0x1000000 : 0; cFlags2 |= [self refusesFirstResponder] ? 0x2000000 : 0; cFlags2 |= ([self alignment] << 26); cFlags2 |= [self importsGraphics] ? 0x20000000 : 0; cFlags2 |= [self allowsEditingTextAttributes] ? 0x40000000 : 0; [aCoder encodeInt: cFlags2 forKey: @"NSCellFlags2"]; if (_cell.type == NSTextCellType) { // font and formatter. if ([self font]) { [aCoder encodeObject: [self font] forKey: @"NSSupport"]; } if ([self formatter]) { [aCoder encodeObject: [self formatter] forKey: @"NSFormatter"]; } } else if ([self image]) { [aCoder encodeObject: [self image] forKey: @"NSSupport"]; } } else { BOOL flag; unsigned int tmp_int; [aCoder encodeObject: _contents]; [aCoder encodeObject: _cell_image]; [aCoder encodeObject: _font]; [aCoder encodeObject: _object_value]; flag = _cell.contents_is_attributed_string; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _cell.is_highlighted; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _cell.is_disabled; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _cell.is_editable; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _cell.is_rich_text; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _cell.imports_graphics; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _cell.shows_first_responder; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _cell.refuses_first_responder; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _cell.sends_action_on_end_editing; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _cell.is_bordered; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _cell.is_bezeled; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _cell.is_scrollable; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _cell.is_selectable; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; // This used to be is_continuous, which has been replaced. /* Ayers 20.03.2003: But we must continue to encode it for backward compatibility or current releases will have undefined behavior when decoding archives (i.e. .gorm files) encoded by this version. */ flag = [self isContinuous]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _cell.allows_mixed_state; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = [self wraps]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; tmp_int = _cell.text_align; [aCoder encodeValueOfObjCType: @encode(unsigned int) at: &tmp_int]; tmp_int = _cell.type; [aCoder encodeValueOfObjCType: @encode(unsigned int) at: &tmp_int]; tmp_int = _cell.image_position; [aCoder encodeValueOfObjCType: @encode(unsigned int) at: &tmp_int]; tmp_int = _cell.entry_type; [aCoder encodeValueOfObjCType: @encode(unsigned int) at: &tmp_int]; // FIXME: State may be -1, why do we encode it as unsigned? tmp_int = _cell.state; [aCoder encodeValueOfObjCType: @encode(unsigned int) at: &tmp_int]; tmp_int = _cell.mnemonic_location; [aCoder encodeValueOfObjCType: @encode(unsigned int) at: &tmp_int]; [aCoder encodeValueOfObjCType: @encode(NSUInteger) at: &_mouse_down_flags]; [aCoder encodeValueOfObjCType: @encode(NSUInteger) at: &_action_mask]; [aCoder encodeValueOfObjCType: @encode(id) at: &_formatter]; [aCoder encodeValueOfObjCType: @encode(id) at: &_menu]; [aCoder encodeValueOfObjCType: @encode(id) at: &_represented_object]; tmp_int = _cell.allows_undo; [aCoder encodeValueOfObjCType: @encode(unsigned int) at: &tmp_int]; tmp_int = _cell.line_break_mode; [aCoder encodeValueOfObjCType: @encode(unsigned int) at: &tmp_int]; tmp_int = _cell.control_tint; [aCoder encodeValueOfObjCType: @encode(unsigned int) at: &tmp_int]; tmp_int = _cell.control_size; [aCoder encodeValueOfObjCType: @encode(unsigned int) at: &tmp_int]; tmp_int = _cell.focus_ring_type; [aCoder encodeValueOfObjCType: @encode(unsigned int) at: &tmp_int]; tmp_int = _cell.base_writing_direction; [aCoder encodeValueOfObjCType: @encode(unsigned int) at: &tmp_int]; } } - (id) initWithCoder: (NSCoder*)aDecoder { if ([aDecoder allowsKeyedCoding]) { id contents = [aDecoder decodeObjectForKey: @"NSContents"]; // initialize based on content... if ([contents isKindOfClass: [NSString class]]) { self = [self initTextCell: contents]; } else if ([contents isKindOfClass: [NSImage class]]) { self = [self initImageCell: contents]; } else { self = [self init]; [self setObjectValue: contents]; } if ([aDecoder containsValueForKey: @"NSCellFlags"]) { unsigned long cFlags; NSUInteger mask = 0; cFlags = [aDecoder decodeIntForKey: @"NSCellFlags"]; [self setFocusRingType: (cFlags & 0x3)]; [self setShowsFirstResponder: ((cFlags & 0x4) == 0x4)]; // This bit flag is the other way around! if ((cFlags & 0x20) != 0x20) mask |= NSLeftMouseUpMask; // This bit flag is the other way around! [self setWraps: ((cFlags & 0x40) != 0x40)]; if ((cFlags & 0x100) == 0x100) mask |= NSLeftMouseDraggedMask; if ((cFlags & 0x40000) == 0x40000) mask |= NSLeftMouseDownMask; if ((cFlags & 0x80000) == 0x80000) mask |= NSPeriodicMask; [self sendActionOn: mask]; [self setScrollable: ((cFlags & 0x100000) == 0x100000)]; [self setSelectable: ((cFlags & 0x200000) == 0x200000)]; [self setBezeled: ((cFlags & 0x400000) == 0x400000)]; [self setBordered: ((cFlags & 0x800000) == 0x800000)]; [self setType: ((cFlags & 0xC000000) >> 26)]; [self setEditable: ((cFlags & 0x10000000) == 0x10000000)]; // This bit flag is the other way around! [self setEnabled: ((cFlags & 0x20000000) != 0x20000000)]; [self setHighlighted: ((cFlags & 0x40000000) == 0x40000000)]; [self setState: ((cFlags & 0x80000000) == 0x80000000) ? NSOnState : NSOffState]; } if ([aDecoder containsValueForKey: @"NSCellFlags2"]) { int cFlags2; cFlags2 = [aDecoder decodeIntForKey: @"NSCellFlags2"]; [self setControlTint: ((cFlags2 & 0xE0) >> 5)]; [self setLineBreakMode: ((cFlags2 & 0xE00) >> 9)]; [self setControlSize: ((cFlags2 & 0xE0000) >> 17)]; [self setSendsActionOnEndEditing: ((cFlags2 & 0x400000) == 0x400000)]; [self setAllowsMixedState: ((cFlags2 & 0x1000000) == 0x1000000)]; [self setRefusesFirstResponder: ((cFlags2 & 0x2000000) == 0x2000000)]; [self setAlignment: ((cFlags2 & 0x1C000000) >> 26)]; [self setImportsGraphics: ((cFlags2 & 0x20000000) == 0x20000000)]; [self setAllowsEditingTextAttributes: ((cFlags2 & 0x40000000) == 0x40000000)]; } if ([aDecoder containsValueForKey: @"NSSupport"]) { id support = [aDecoder decodeObjectForKey: @"NSSupport"]; if ([support isKindOfClass: [NSFont class]]) { [self setFont: support]; } else if ([support isKindOfClass: [NSImage class]]) { [self setImage: support]; } } if ([aDecoder containsValueForKey: @"NSFormatter"]) { NSFormatter *formatter = [aDecoder decodeObjectForKey: @"NSFormatter"]; [self setFormatter: formatter]; } } else { BOOL flag, wraps; unsigned int tmp_int; id formatter, menu; int version = [aDecoder versionForClassName: @"NSCell"]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_contents]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_cell_image]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_font]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_object_value]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _cell.contents_is_attributed_string = flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _cell.is_highlighted = flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _cell.is_disabled = flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _cell.is_editable = flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _cell.is_rich_text = flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _cell.imports_graphics = flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _cell.shows_first_responder = flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _cell.refuses_first_responder = flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _cell.sends_action_on_end_editing = flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _cell.is_bordered = flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _cell.is_bezeled = flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _cell.is_scrollable = flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _cell.is_selectable = flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; // This used to be is_continuous, which has been replaced. //_cell.is_continuous = flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _cell.allows_mixed_state = flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; /* The wraps attribute has been superseded by lineBreakMode. However, we may need it to set lineBreakMode when reading old archives. */ wraps = flag; [aDecoder decodeValueOfObjCType: @encode(unsigned int) at: &tmp_int]; _cell.text_align = tmp_int; [aDecoder decodeValueOfObjCType: @encode(unsigned int) at: &tmp_int]; _cell.type = tmp_int; [aDecoder decodeValueOfObjCType: @encode(unsigned int) at: &tmp_int]; _cell.image_position = tmp_int; [aDecoder decodeValueOfObjCType: @encode(unsigned int) at: &tmp_int]; _cell.entry_type = tmp_int; [aDecoder decodeValueOfObjCType: @encode(unsigned int) at: &tmp_int]; _cell.state = tmp_int; [aDecoder decodeValueOfObjCType: @encode(unsigned int) at: &tmp_int]; _cell.mnemonic_location = tmp_int; [aDecoder decodeValueOfObjCType: @encode(NSUInteger) at: &_mouse_down_flags]; [aDecoder decodeValueOfObjCType: @encode(NSUInteger) at: &_action_mask]; if (version < 3) { unsigned int mask = 0; // Convert old GNUstep mask value to Cocoa values if ((_action_mask & 0x1) == 0x1) { mask |= NSLeftMouseDownMask; } if ((_action_mask & 0x2) == 0x2) { mask |= NSLeftMouseUpMask; } if ((_action_mask & 0x4) == 0x4) { mask |= NSOtherMouseDownMask; } if ((_action_mask & 0x8) == 0x8) { mask |= NSOtherMouseUpMask; } if ((_action_mask & 0x10) == 0x10) { mask |= NSRightMouseDownMask; } if ((_action_mask & 0x20) == 0x20) { mask |= NSRightMouseUpMask; } if ((_action_mask & 0x40) == 0x40) { mask |= NSMouseMovedMask; } if ((_action_mask & 0x80) == 0x80) { mask |= NSLeftMouseDraggedMask; } if ((_action_mask & 0x100) == 0x100) { mask |= NSOtherMouseDraggedMask; } if ((_action_mask & 0x200) == 0x200) { mask |= NSRightMouseDraggedMask; } if ((_action_mask & 0x400) == 0x400) { mask |= NSMouseEnteredMask; } if ((_action_mask & 0x800) == 0x800) { mask |= NSMouseExitedMask; } if ((_action_mask & 0x1000) == 0x1000) { mask |= NSKeyDownMask; } if ((_action_mask & 0x2000) == 0x2000) { mask |= NSKeyUpMask; } if ((_action_mask & 0x4000) == 0x4000) { mask |= NSFlagsChangedMask; } if ((_action_mask & 0x8000) == 0x8000) { mask |= NSAppKitDefinedMask; } if ((_action_mask & 0x10000) == 0x10000) { mask |= NSSystemDefinedMask; } if ((_action_mask & 0x20000) == 0x20000) { mask |= NSApplicationDefinedMask; } if ((_action_mask & 0x40000) == 0x40000) { mask |= NSPeriodicMask; } if ((_action_mask & 0x80000) == 0x80000) { mask |= NSCursorUpdateMask; } if ((_action_mask & 0x100000) == 0x100000) { mask |= NSScrollWheelMask; } _action_mask = mask; } _action_mask |= NSLeftMouseUpMask; [aDecoder decodeValueOfObjCType: @encode(id) at: &formatter]; [self setFormatter: formatter]; [aDecoder decodeValueOfObjCType: @encode(id) at: &menu]; [self setMenu: menu]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_represented_object]; if (_formatter != nil) { NSString *contents; contents = [_formatter stringForObjectValue: _object_value]; if (contents != nil) { _cell.has_valid_object_value = YES; ASSIGN (_contents, contents); _cell.contents_is_attributed_string = NO; } } if (version >= 2) { [aDecoder decodeValueOfObjCType: @encode(unsigned int) at: &tmp_int]; _cell.allows_undo = tmp_int; [aDecoder decodeValueOfObjCType: @encode(unsigned int) at: &tmp_int]; _cell.line_break_mode = tmp_int; [aDecoder decodeValueOfObjCType: @encode(unsigned int) at: &tmp_int]; _cell.control_tint = tmp_int; [aDecoder decodeValueOfObjCType: @encode(unsigned int) at: &tmp_int]; _cell.control_size = tmp_int; [aDecoder decodeValueOfObjCType: @encode(unsigned int) at: &tmp_int]; _cell.focus_ring_type = tmp_int; [aDecoder decodeValueOfObjCType: @encode(unsigned int) at: &tmp_int]; _cell.base_writing_direction = tmp_int; } else { /* Backward compatibility: Derive lineBreakMode from the superseded wraps attribute. */ [self setWraps: wraps]; } } return self; } @end @implementation NSCell (PrivateMethods) - (NSColor*) textColor { if (_cell.is_disabled) return dtxtCol; else return txtCol; } /* This method is an exception and returns a non-autoreleased dictionary, so that calling methods can deallocate it immediately using release. Otherwise if many cells are drawn/their size computed, we pile up hundreds or thousands of these objects before they are deallocated at the end of the run loop. */ - (NSDictionary*) _nonAutoreleasedTypingAttributes { NSDictionary *attr; NSColor *color; NSMutableParagraphStyle *paragraphStyle; color = [self textColor]; /* Note: There are only a few possible paragraph styles for cells. TODO: Cache them and reuse them for the whole app lifetime. */ paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; [paragraphStyle setLineBreakMode: [self lineBreakMode]]; [paragraphStyle setBaseWritingDirection: [self baseWritingDirection]]; [paragraphStyle setAlignment: [self alignment]]; attr = [[NSDictionary alloc] initWithObjectsAndKeys: _font, NSFontAttributeName, color, NSForegroundColorAttributeName, paragraphStyle, NSParagraphStyleAttributeName, nil]; RELEASE (paragraphStyle); return attr; } - (NSSize) _sizeText: (NSString*)title { NSSize size; NSDictionary *dict; if (title == nil) { return NSMakeSize (0,0); } dict = [self _nonAutoreleasedTypingAttributes]; size = [title sizeWithAttributes: dict]; RELEASE (dict); return size; } /** * Private internal method, returns an attributed string to display. */ - (NSAttributedString*) _drawAttributedString { if (!_cell.is_disabled) { return [self attributedStringValue]; } else { NSAttributedString *attrStr = [self attributedStringValue]; NSDictionary *attribs; NSMutableDictionary *newAttribs; attribs = [attrStr attributesAtIndex: 0 effectiveRange: NULL]; newAttribs = [NSMutableDictionary dictionaryWithDictionary: attribs]; [newAttribs setObject: [NSColor disabledControlTextColor] forKey: NSForegroundColorAttributeName]; return AUTORELEASE([[NSAttributedString alloc] initWithString: [attrStr string] attributes: newAttribs]); } } /** * Private internal method to display an attributed string. */ - (void) _drawAttributedText: (NSAttributedString*)aString inFrame: (NSRect)aRect { NSSize titleSize; if (aString == nil) return; titleSize = [aString size]; /** Important: text should always be vertically centered without * considering descender [as if descender did not exist]. * This is particularly important for single line texts. * Please make sure the output remains always correct. */ aRect.origin.y = NSMidY (aRect) - titleSize.height/2; aRect.size.height = titleSize.height; [aString drawInRect: aRect]; } - (void) _drawText: (NSString*)aString inFrame: (NSRect)cellFrame { NSSize titleSize; NSDictionary *attributes; if (aString == nil) return; attributes = [self _nonAutoreleasedTypingAttributes]; titleSize = [aString sizeWithAttributes: attributes]; /** Important: text should always be vertically centered without * considering descender [as if descender did not exist]. * This is particularly important for single line texts. * Please make sure the output remains always correct. */ cellFrame.origin.y = NSMidY (cellFrame) - titleSize.height/2; cellFrame.size.height = titleSize.height; [aString drawInRect: cellFrame withAttributes: attributes]; RELEASE (attributes); } // Private helper method overridden in subclasses - (void) _drawBorderAndBackgroundWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { NSBorderType aType; // Get border size if (_cell.is_bordered) aType = NSLineBorder; else if (_cell.is_bezeled) aType = NSBezelBorder; else aType = NSNoBorder; [[GSTheme theme] drawBorderType: aType frame: cellFrame view: controlView]; } // Private helper method - (void) _drawFocusRingWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { if (_cell.shows_first_responder && [[controlView window] firstResponder] == controlView) { switch (_cell.focus_ring_type) { case NSFocusRingTypeDefault: [[GSTheme theme] drawFocusFrame: [self drawingRectForBounds: cellFrame] view: controlView]; break; case NSFocusRingTypeExterior: [[GSTheme theme] drawFocusFrame: cellFrame view: controlView]; break; case NSFocusRingTypeNone: default: break; } } } - (void) _drawEditorWithFrame: (NSRect)cellFrame inView: (NSView *)controlView { /* Look Ma', no drawing here... */ if ([controlView isKindOfClass: [NSControl class]]) { /* Adjust the text editor's frame to match cell's frame (w/o border) */ NSRect titleRect = [self titleRectForBounds: cellFrame]; NSText *textObject = [(NSControl*)controlView currentEditor]; NSView *clipView = [textObject superview]; if ([clipView isKindOfClass: [NSClipView class]]) { [clipView setFrame: titleRect]; } else { [textObject setFrame: titleRect]; } } } - (BOOL) _sendsActionOn:(NSUInteger)eventTypeMask { return (_action_mask & eventTypeMask); } - (void) _setInEditing: (BOOL)flag { _cell.in_editing = flag; } - (void) _updateFieldEditor: (NSText*)textObject { if (_formatter != nil) { NSString *contents; contents = [_formatter editingStringForObjectValue: _object_value]; if (contents == nil) { // We cannot call the stringValue method as this will call // validateEditing in NSActionCell subclasses if (nil == _contents) { contents = @""; } else { if (_cell.contents_is_attributed_string == NO) { contents = (NSString *)_contents; } else { contents = [(NSAttributedString *)_contents string]; } } } if (![contents isEqualToString: [textObject string]]) [textObject setText: contents]; } else { NSString *contents; if (nil == _contents) { contents = @""; } else { if (_cell.contents_is_attributed_string == NO) { contents = (NSString *)_contents; } else { contents = [(NSAttributedString *)_contents string]; } } if (![contents isEqualToString: [textObject string]]) { if (_cell.contents_is_attributed_string == NO) { [textObject setText: contents]; } else { // FIXME what about attribute changes? NSRange range = NSMakeRange(0, [[textObject string] length]); [textObject replaceCharactersInRange: range withAttributedString: (NSAttributedString *)_contents]; } } } } /** * Private method used by NSImageCell and NSButtonCell for calculating * scaled image size */ static inline NSSize scaleProportionally(NSSize imageSize, NSSize canvasSize, BOOL scaleUpOrDown) { CGFloat ratio; if (imageSize.width <= 0 || imageSize.height <= 0) { return NSMakeSize(0, 0); } /* Get the smaller ratio and scale the image size by it. */ ratio = MIN(canvasSize.width / imageSize.width, canvasSize.height / imageSize.height); /* Only scale down, unless scaleUpOrDown is YES */ if (ratio < 1.0 || scaleUpOrDown) { imageSize.width *= ratio; imageSize.height *= ratio; } return imageSize; } - (NSSize) _scaleImageWithSize: (NSSize)imageSize toFitInSize: (NSSize)canvasSize scalingType: (NSImageScaling)scalingType { NSSize result; switch (scalingType) { case NSImageScaleProportionallyDown: // == NSScaleProportionally { result = scaleProportionally (imageSize, canvasSize, NO); break; } case NSImageScaleAxesIndependently: // == NSScaleToFit { result = canvasSize; break; } default: case NSImageScaleNone: // == NSScaleNone { result = imageSize; break; } case NSImageScaleProportionallyUpOrDown: { result = scaleProportionally (imageSize, canvasSize, YES); break; } } return result; } @end gnustep-gui-0.24.0/Source/NSDataLinkManager.m0000664000076500007650000002322512023534215020604 0ustar brains99brains99/** NSDataLinkManager Copyright (C) 1996, 2005 Free Software Foundation, Inc. Author: Gregory John Casamento Date: 2005 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import #import #import #import #import "AppKit/NSDataLinkManager.h" #import "AppKit/NSDataLink.h" #import "AppKit/NSPasteboard.h" @interface NSDataLink (Private) - (void) setLastUpdateTime: (NSDate *)date; - (void) setSourceFilename: (NSString *)src; - (void) setDestinationFilename: (NSString *)dst; - (void) setSourceManager: (id)src; - (void) setDestinationManager: (id)dst; - (void) setSourceSelection: (id)src; - (void) setDestinationSelection: (id)dst; @end @implementation NSDataLink (Private) - (void) setLastUpdateTime: (NSDate *)date { ASSIGN(lastUpdateTime, date); } - (void) setSourceFilename: (NSString *)src { ASSIGN(sourceFilename,src); } - (void) setDestinationFilename: (NSString *)dst { ASSIGN(destinationFilename, dst); } - (void) setSourceManager: (id)src { ASSIGN(sourceManager,src); } - (void) setDestinationManager: (id)dst { ASSIGN(destinationManager,dst); } - (void) setSourceSelection: (id)src { ASSIGN(sourceSelection,src); } - (void) setDestinationSelection: (id)dst { ASSIGN(destinationSelection,dst); } - (void) setIsMarker: (BOOL)flag { _flags.isMarker = flag; } @end @implementation NSDataLinkManager // // Class methods // + (void)initialize { if (self == [NSDataLinkManager class]) { // Initial version [self setVersion: 0]; } } // // Instance methods // // // Initializing and Freeing a Link Manager // - (id)initWithDelegate:(id)anObject { self = [super init]; if (self != nil) { ASSIGN(delegate,anObject); filename = nil; _flags.delegateVerifiesLinks = NO; _flags.interactsWithUser = NO; _flags.isEdited = NO; _flags.areLinkOutlinesVisible = NO; } return self; } - (id)initWithDelegate:(id)anObject fromFile:(NSString *)path { self = [super init]; if (self != nil) { ASSIGN(delegate,anObject); ASSIGN(filename,path); _flags.delegateVerifiesLinks = NO; _flags.interactsWithUser = NO; _flags.isEdited = NO; _flags.areLinkOutlinesVisible = NO; } return self; } // // Adding and Removing Links // - (BOOL)addLink:(NSDataLink *)link at:(NSSelection *)selection { BOOL result = NO; [link setDestinationSelection: selection]; [link setDestinationManager: self]; if ([destinationLinks containsObject: link] == NO) { [destinationLinks addObject: link]; result = YES; } return result; } - (BOOL)addLinkAsMarker:(NSDataLink *)link at:(NSSelection *)selection { [link setIsMarker: YES]; return [self addLink: link at: selection]; } - (NSDataLink *)addLinkPreviouslyAt:(NSSelection *)oldSelection fromPasteboard:(NSPasteboard *)pasteboard at:(NSSelection *)selection { NSData *data = [pasteboard dataForType: NSDataLinkPboardType]; NSArray *links = [NSUnarchiver unarchiveObjectWithData: data]; NSEnumerator *en = [links objectEnumerator]; NSDataLink *link = nil; while ((link = [en nextObject]) != nil) { if ([link destinationSelection] == oldSelection) { } } return nil; } - (void)breakAllLinks { NSArray *allLinks = [sourceLinks arrayByAddingObjectsFromArray: destinationLinks]; NSEnumerator *en = [allLinks objectEnumerator]; id obj = nil; while ((obj = [en nextObject]) != nil) { [obj break]; } } - (void)writeLinksToPasteboard:(NSPasteboard *)pasteboard { NSArray *allLinks = [sourceLinks arrayByAddingObjectsFromArray: destinationLinks]; NSEnumerator *en = [allLinks objectEnumerator]; id obj = nil; while ((obj = [en nextObject]) != nil) { [obj writeToPasteboard: pasteboard]; } } // // Informing the Link Manager of Document Status // - (void)noteDocumentClosed { if ([delegate respondsToSelector: @selector(dataLinkManagerCloseDocument:)]) { [delegate dataLinkManagerCloseDocument: self]; } } - (void)noteDocumentEdited { if ([delegate respondsToSelector: @selector(dataLinkManagerDidEditLinks:)]) { [delegate dataLinkManagerDidEditLinks: self]; } } - (void)noteDocumentReverted { if ([delegate respondsToSelector: @selector(dataLinkManagerDidEditLinks:)]) { [delegate dataLinkManagerDidEditLinks: self]; } } - (void)noteDocumentSaved { // implemented by subclass } - (void)noteDocumentSavedAs:(NSString *)path { // implemented by subclass } - (void)noteDocumentSavedTo:(NSString *)path { // implemented by subclass } // // Getting and Setting Information about the Link Manager // - (id)delegate { return delegate; } - (BOOL)delegateVerifiesLinks { return _flags.delegateVerifiesLinks; } - (NSString *)filename { return filename; } - (BOOL)interactsWithUser { return _flags.interactsWithUser; } - (BOOL)isEdited { return _flags.isEdited; } - (void)setDelegateVerifiesLinks:(BOOL)flag { _flags.delegateVerifiesLinks = flag; } - (void)setInteractsWithUser:(BOOL)flag { _flags.interactsWithUser = flag; } // // Getting and Setting Information about the Manager's Links // - (BOOL)areLinkOutlinesVisible { return _flags.areLinkOutlinesVisible; } - (NSEnumerator *)destinationLinkEnumerator { return [destinationLinks objectEnumerator]; } - (NSDataLink *)destinationLinkWithSelection:(NSSelection *)destSel { NSEnumerator *en = [self destinationLinkEnumerator]; id obj = nil; while ((obj = [en nextObject]) != nil) { if ([obj destinationSelection] == destSel) { break; } } return obj; } - (void)setLinkOutlinesVisible:(BOOL)flag { _flags.areLinkOutlinesVisible = flag; } - (NSEnumerator *)sourceLinkEnumerator { return [sourceLinks objectEnumerator]; } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder*)aCoder { BOOL flag = NO; if ([aCoder allowsKeyedCoding]) { [aCoder encodeObject: filename forKey: @"GSFilename"]; [aCoder encodeObject: sourceLinks forKey: @"GSSourceLinks"]; [aCoder encodeObject: destinationLinks forKey: @"GSDestinationLinks"]; flag = _flags.areLinkOutlinesVisible; [aCoder encodeBool: flag forKey: @"GSAreLinkOutlinesVisible"]; flag = _flags.delegateVerifiesLinks; [aCoder encodeBool: flag forKey: @"GSDelegateVerifiesLinks"]; flag = _flags.interactsWithUser; [aCoder encodeBool: flag forKey: @"GSInteractsWithUser"]; flag = _flags.isEdited; [aCoder encodeBool: flag forKey: @"GSIsEdited"]; } else { [aCoder encodeValueOfObjCType: @encode(id) at: &filename]; [aCoder encodeValueOfObjCType: @encode(id) at: &sourceLinks]; [aCoder encodeValueOfObjCType: @encode(id) at: &destinationLinks]; flag = _flags.areLinkOutlinesVisible; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _flags.delegateVerifiesLinks; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _flags.interactsWithUser; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _flags.isEdited; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; } } - (id) initWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { BOOL flag = NO; id obj; obj = [aCoder decodeObjectForKey: @"GSFilename"]; ASSIGN(filename,obj); obj = [aCoder decodeObjectForKey: @"GSSourceLinks"]; ASSIGN(sourceLinks,obj); obj = [aCoder decodeObjectForKey: @"GSDestinationLinks"]; ASSIGN(destinationLinks,obj); flag = [aCoder decodeBoolForKey: @"GSAreLinkOutlinesVisible"]; _flags.areLinkOutlinesVisible = flag; flag = [aCoder decodeBoolForKey: @"GSDelegateVerifiesLinks"]; _flags.delegateVerifiesLinks = flag; flag = [aCoder decodeBoolForKey: @"GSInteractsWithUser"]; _flags.interactsWithUser = flag; flag = [aCoder decodeBoolForKey: @"GSIsEdited"]; _flags.isEdited = flag; } else { int version = [aCoder versionForClassName: @"NSDataLinkManager"]; if (version == 0) { BOOL flag = NO; [aCoder decodeValueOfObjCType: @encode(id) at: &filename]; [aCoder decodeValueOfObjCType: @encode(id) at: &sourceLinks]; [aCoder decodeValueOfObjCType: @encode(id) at: &destinationLinks]; [aCoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _flags.areLinkOutlinesVisible = flag; [aCoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _flags.delegateVerifiesLinks = flag; [aCoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _flags.interactsWithUser = flag; [aCoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _flags.isEdited = flag; } else return nil; } return self; } @end gnustep-gui-0.24.0/Source/NSColorPanel.m0000664000076500007650000005213012143525324017661 0ustar brains99brains99/** NSColorPanel System generic color panel Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import #import #import #import #import #import #import #import "AppKit/NSBox.h" #import "AppKit/NSButton.h" #import "AppKit/NSButtonCell.h" #import "AppKit/NSBezierPath.h" #import "AppKit/NSColor.h" #import "AppKit/NSColorPanel.h" #import "AppKit/NSColorPicker.h" #import "AppKit/NSColorPicking.h" #import "AppKit/NSColorWell.h" #import "AppKit/NSCursor.h" #import "AppKit/NSEvent.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSImage.h" #import "AppKit/NSMatrix.h" #import "AppKit/NSPasteboard.h" #import "AppKit/NSPanel.h" #import "AppKit/NSSlider.h" #import "AppKit/NSScreen.h" #import "AppKit/NSSplitView.h" #import "AppKit/NSWindow.h" #import "GNUstepGUI/GSDisplayServer.h" #import "GNUstepGUI/IMLoading.h" #import "GSGuiPrivate.h" #define MAX_ALPHA_VALUE 100.0 static NSLock *_gs_gui_color_panel_lock = nil; static NSColorPanel *_gs_gui_color_panel = nil; static int _gs_gui_color_picker_mask = NSColorPanelAllModesMask; // FIXME: This should be NSWheelModeColorPanel static int _gs_gui_color_picker_mode = NSRGBModeColorPanel; @implementation NSApplication (NSColorPanel) - (void) orderFrontColorPanel: sender { NSColorPanel *colorPanel = [NSColorPanel sharedColorPanel]; if (colorPanel) [colorPanel orderFront: nil]; else NSBeep(); } @end @interface NSColorPanel (PrivateMethods) - (void) _loadPickers; - (void) _loadPickerAtPath: (NSString *)path; - (void) _fixupMatrix; - (void) _setupPickers; - (void) _showNewPicker: (id)sender; - (id) _initWithoutGModel; - (void) _magnify: (id)sender; @end @implementation NSColorPanel (PrivateMethods) - (void) _loadPickers { NSArray *paths; NSString *path; NSEnumerator *pathEnumerator; NSArray *bundles; NSEnumerator *bundleEnumerator; NSString *bundleName; _pickers = [NSMutableArray new]; paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSAllDomainsMask, YES); pathEnumerator = [paths objectEnumerator]; while ((path = [pathEnumerator nextObject])) { path = [path stringByAppendingPathComponent: @"ColorPickers"]; bundles = [[NSFileManager defaultManager] directoryContentsAtPath: path]; bundleEnumerator = [bundles objectEnumerator]; while ((bundleName = [bundleEnumerator nextObject])) { [self _loadPickerAtPath: [path stringByAppendingPathComponent: bundleName]]; } } paths = [[NSBundle mainBundle] pathsForResourcesOfType: @"bundle" inDirectory: @"ColorPickers"]; pathEnumerator = [paths objectEnumerator]; while ((path = [pathEnumerator nextObject])) { [self _loadPickerAtPath: path]; } } - (void) _loadPickerAtPath: (NSString *)path { NSBundle *bundle; Class pickerClass; NSColorPicker *picker; bundle = [NSBundle bundleWithPath: path]; if (bundle && (pickerClass = [bundle principalClass])) { picker = [[pickerClass alloc] initWithPickerMask:_gs_gui_color_picker_mask colorPanel: self]; if (picker && [picker conformsToProtocol:@protocol(NSColorPickingCustom)]) { [(id)picker provideNewView: YES]; [_pickers addObject: picker]; } else { NSLog(@"%@ does not contain a valid color picker.", path); } } } // FIXME - this is a HACK to get around problems in the gmodel code - (void) _fixupMatrix { NSButtonCell *prototype; [_pickerMatrix setFrame: NSMakeRect(4, 190, 192, 36)]; prototype = [[NSButtonCell alloc] initImageCell: nil]; [prototype setButtonType: NSOnOffButton]; [_pickerMatrix setPrototype: prototype]; RELEASE(prototype); } - (void) _setupPickers { id picker; NSButtonCell *cell; NSMutableArray *cells = [NSMutableArray new]; int i, count; NSSize size = [_pickerMatrix frame].size; count = [_pickers count]; for (i = 0; i < count; i++) { cell = [[_pickerMatrix prototype] copy]; [cell setTag: i]; picker = [_pickers objectAtIndex: i]; [picker insertNewButtonImage: [picker provideNewButtonImage] in: cell]; [cells addObject: cell]; } [_pickerMatrix addRowWithCells: cells]; RELEASE(cells); [_pickerMatrix setCellSize: NSMakeSize(size.width / count, size.height)]; [_pickerMatrix setTarget: self]; [_pickerMatrix setAction: @selector(_showNewPicker:)]; // use the space occupied by the matrix of color picker buttons if the // button matrix is useless, i.e. it contains only one button if (count < 2) { [_pickerBox setFrame: NSUnionRect([_pickerBox frame], [_pickerMatrix frame])]; [_pickerBox setNeedsDisplay: YES]; // Display the only picker if (count == 1) [self _showNewPicker: _pickerMatrix]; } } - (void) _showNewPicker: (id)sender { _currentPicker = [_pickers objectAtIndex: [sender selectedColumn]]; [_currentPicker setColor: [_colorWell color]]; [_pickerBox setContentView: [_currentPicker provideNewView: NO]]; } - (id) _initWithoutGModel { NSRect contentRect = {{352, 519}, {200, 270}}; NSSize maxContentSize = {500, 675}; NSRect topViewRect = {{0, 0}, {200, 270}}; NSRect magnifyRect = {{4, 230}, {50, 36}}; NSRect wellRect = {{58, 230}, {138, 36}}; NSRect matrixRect = {{4, 190}, {192, 36}}; NSRect splitRect = {{0, 0}, {200, 190}}; NSRect pickerViewRect = {{0, 40}, {200, 150}}; NSRect pickerRect = {{0, 20}, {200, 130}}; NSRect alphaRect = {{4, 4}, {160, 16}}; NSRect swatchRect = {{4, 4}, {200, 30}}; NSView *v; NSButtonCell *pickerButton; NSView *pickerView; NSView *swatchView; NSColorWell *well; int i; unsigned int style = NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask | NSUtilityWindowMask; self = [super initWithContentRect: contentRect styleMask: style backing: NSBackingStoreRetained defer: NO screen: nil]; if (nil == self) return nil; [self setTitle: _(@"Colors")]; [self setBecomesKeyOnlyIfNeeded: YES]; [self setContentMinSize: contentRect.size]; [self setContentMaxSize: maxContentSize]; v = [self contentView]; _topView = [[NSView alloc] initWithFrame: topViewRect]; [_topView setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)]; [v addSubview: _topView]; RELEASE(_topView); _magnifyButton = [[NSButton alloc] initWithFrame: magnifyRect]; [_magnifyButton setAutoresizingMask: (NSViewMaxXMargin | NSViewMinYMargin)]; [_magnifyButton setImage: [NSImage imageNamed: @"MagnifyGlass"]]; [_magnifyButton setBordered: YES]; [_magnifyButton setAction: @selector(_magnify:)]; [_magnifyButton setTarget: self]; [_topView addSubview: _magnifyButton]; _colorWell = [[NSColorWell alloc] initWithFrame: wellRect]; [_colorWell setAutoresizingMask: (NSViewWidthSizable | NSViewMinYMargin)]; [_colorWell setBordered: NO]; [_colorWell setTarget: self]; [_colorWell setAction: @selector(_updatePicker:)]; [_topView addSubview: _colorWell]; // Prototype cell for the matrix pickerButton = [[NSButtonCell alloc] initImageCell: nil]; [pickerButton setButtonType: NSOnOffButton]; [pickerButton setBordered: YES]; _pickerMatrix = [[NSMatrix alloc] initWithFrame: matrixRect mode: NSRadioModeMatrix prototype: pickerButton numberOfRows: 0 numberOfColumns: 0]; RELEASE(pickerButton); [_pickerMatrix setAutoresizingMask: (NSViewWidthSizable | NSViewMinYMargin)]; [_pickerMatrix setCellSize: matrixRect.size]; [_pickerMatrix setIntercellSpacing: NSMakeSize(1, 0)]; [_pickerMatrix setAutosizesCells: YES]; [_topView addSubview: _pickerMatrix]; _splitView = [[NSSplitView alloc] initWithFrame: splitRect]; [_splitView setVertical: NO]; [_splitView setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)]; [_topView addSubview: _splitView]; pickerView = [[NSView alloc] initWithFrame: pickerViewRect]; [pickerView setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)]; _pickerBox = [[NSBox alloc] initWithFrame: pickerRect]; [_pickerBox setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)]; [_pickerBox setBorderType: NSNoBorder]; [_pickerBox setTitle: @""]; [_pickerBox setTitlePosition: NSNoTitle]; [pickerView addSubview: _pickerBox]; _alphaSlider = [[NSSlider alloc] initWithFrame: alphaRect]; [_alphaSlider setAutoresizingMask: (NSViewWidthSizable | NSViewMaxYMargin)]; [_alphaSlider setMinValue: 0.0]; [_alphaSlider setMaxValue: MAX_ALPHA_VALUE]; [_alphaSlider setFloatValue: MAX_ALPHA_VALUE]; [_alphaSlider setContinuous: YES]; [_alphaSlider setTitle: _(@"Opacity")]; [[_alphaSlider cell] setBezeled: YES]; [_alphaSlider setTarget: self]; [_alphaSlider setAction: @selector(_alphaChanged:)]; [pickerView addSubview: _alphaSlider]; _showsAlpha = YES; swatchView = [[NSView alloc] initWithFrame: swatchRect]; [swatchView setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)]; // Add all the subviews at the end [_splitView addSubview: pickerView]; [_splitView addSubview: swatchView]; RELEASE(pickerView); RELEASE(swatchView); // FIXME: This should be loaded form somewhere. // Perhaps a colour list called "custom"? for (i = 0; i < 14; i++) { NSColor *colour; switch (i) { default: case 0: colour = [NSColor greenColor]; break; case 1: colour = [NSColor whiteColor]; break; case 2: colour = [NSColor blackColor]; break; case 3: colour = [NSColor blueColor]; break; case 4: colour = [NSColor brownColor]; break; case 5: colour = [NSColor cyanColor]; break; case 6: colour = [NSColor darkGrayColor]; break; case 7: colour = [NSColor grayColor]; break; case 8: colour = [NSColor lightGrayColor]; break; case 9: colour = [NSColor magentaColor]; break; case 10: colour = [NSColor orangeColor]; break; case 11: colour = [NSColor purpleColor]; break; case 12: colour = [NSColor redColor]; break; case 13: colour = [NSColor yellowColor]; break; } well = [[NSColorWell alloc] initWithFrame: NSMakeRect(i * 13 + 5, 5, 12, 12)]; [well setColor: colour]; [well setBordered: NO]; [well setEnabled: YES]; [well setTarget: _colorWell]; [well setAction: @selector(_bottomWellAction:)]; [swatchView addSubview: well]; RELEASE(well); } return self; } - (void) _alphaChanged: (id) sender { [self setColor: [[self color] colorWithAlphaComponent: [self alpha]]]; } - (void) _apply: (id) sender { // This is currently not used } - (void) _magnify: (id) sender { NSEvent *currentEvent; NSCursor *cursor; [self _captureMouse: self]; /** * There was code here to dynamically generate a magnifying glass * cursor with a magnified portion of the screenshot in it, * but changing the cursor rapidly on X seems to cause flicker, * so we just use a plain magnifying glass. (dynamic code is in r33543) */ cursor = [[[NSCursor alloc] initWithImage: [NSImage imageNamed: @"MagnifyGlass"] hotSpot: NSMakePoint(12, 13)] autorelease]; [cursor push]; NS_DURING { do { NSPoint mouseLoc; NSImage *img; CREATE_AUTORELEASE_POOL(pool); currentEvent = [NSApp nextEventMatchingMask: NSLeftMouseDownMask | NSLeftMouseUpMask | NSMouseMovedMask untilDate: [NSDate distantFuture] inMode: NSEventTrackingRunLoopMode dequeue: YES]; mouseLoc = [self convertBaseToScreen: [self mouseLocationOutsideOfEventStream]]; img = [GSCurrentServer() contentsOfScreen: [[self screen] screenNumber] inRect: NSMakeRect(mouseLoc.x, mouseLoc.y, 1, 1)]; if (img != nil) { NSBitmapImageRep *rep = (NSBitmapImageRep *)[img bestRepresentationForDevice: nil]; NSColor *color = [rep colorAtX: 0 y: 0]; [self setColor: color]; } [pool drain]; } while ([currentEvent type] != NSLeftMouseUp && [currentEvent type] != NSLeftMouseDown); } NS_HANDLER { NSLog(@"Exception occurred in -[NSColorPanel _magnify:]: %@", localException); } NS_ENDHANDLER [NSCursor pop]; [self _releaseMouse: self]; } - (void) _updatePicker: (id) sender { [self setColor: [_colorWell color]]; } - (void) _bottomWellAction: (id) sender { [self setColor: [sender color]]; } @end /**

TODO Description

*/ @implementation NSColorPanel /* * Class methods */ + (void) initialize { if (self == [NSColorPanel class]) { // Initial version [self setVersion: 1]; _gs_gui_color_panel_lock = [NSLock new]; } } /**

Creates ( if needed ) and returns the shared NSColorPanel.

*/ + (NSColorPanel *)sharedColorPanel { if (_gs_gui_color_panel == nil) { [_gs_gui_color_panel_lock lock]; if (!_gs_gui_color_panel) { // Keep this two lines separated so the check in [init] works. _gs_gui_color_panel = [self alloc]; [_gs_gui_color_panel init]; } [_gs_gui_color_panel_lock unlock]; } return _gs_gui_color_panel; } /**

Returns whether the NSColorPanel has been already created.

*/ + (BOOL) sharedColorPanelExists { return (_gs_gui_color_panel == nil) ? NO : YES; } + (void) setPickerMask: (int)mask { _gs_gui_color_picker_mask = mask; } /** */ + (void) setPickerMode: (int)mode { _gs_gui_color_picker_mode = mode; } /**

Drags aColor frome sourceView at the location give by the event anEvent ( [NSView-convertPoint:fromView:] ). The type declare into the pasteboard is NSColorPboardType

See Also: [NSView-convertPoint:fromView:] [NSView-dragImage:at:offset:event:pasteboard:source:slideBack:

*/ + (BOOL) dragColor: (NSColor *)aColor withEvent: (NSEvent *)anEvent fromView: (NSView *)sourceView { NSPasteboard *pb = [NSPasteboard pasteboardWithName: NSDragPboard]; NSImage *image = [NSImage imageNamed: @"common_ColorSwatch"]; NSSize size; NSPoint point; [pb declareTypes: [NSArray arrayWithObjects: NSColorPboardType, nil] owner: aColor]; [aColor writeToPasteboard: pb]; [image setBackgroundColor: aColor]; size = [image size]; point = [sourceView convertPoint: [anEvent locationInWindow] fromView: nil]; point.x -= size.width/2; point.y -= size.width/2; [sourceView dragImage: image at: point offset: NSMakeSize(0,0) event: anEvent pasteboard: pb source: sourceView slideBack: NO]; return YES; } /* * Instance methods */ - (id) init { if (self != _gs_gui_color_panel) { RELEASE(self); return _gs_gui_color_panel; } // if (![NSBundle loadNibNamed: @"ColorPanel" owner: self]); [self _initWithoutGModel]; [self _loadPickers]; [self _setupPickers]; [self setMode: _gs_gui_color_picker_mode]; [self setShowsAlpha: ![NSColor ignoresAlpha]]; return self; } - (void) dealloc { // As there is only one this will never be called RELEASE(_topView); RELEASE(_colorWell); RELEASE(_magnifyButton); RELEASE(_pickerMatrix); RELEASE(_pickerBox); RELEASE(_alphaSlider); RELEASE(_splitView); RELEASE(_pickers); [super dealloc]; } /**

Returns the NSColorPanel's accessory view if it exists, nil otherwise.

See Also: -setAccessoryView:

*/ - (NSView *) accessoryView { return _accessoryView; } /**

Returns whether the NSColorPanel continuously sends its action message.

See Also: -setContinuous:-setAction: -setTarget:

*/ - (BOOL) isContinuous { return _isContinuous; } /**

Returns the current mode of the NSColorPanel.

See Also: -setMode:

*/ - (int) mode { if (_currentPicker != nil) return [_currentPicker currentMode]; else return 0; } /**

Sets the accessoryView to a view. The old view ( if exists ) will be remove ( and release ). You need to retain it if you want to use it later

See Also: -accessoryView

*/ - (void) setAccessoryView: (NSView *)aView { if (_accessoryView == aView) return; if (_accessoryView != nil) [_accessoryView removeFromSuperview]; _accessoryView = aView; [_splitView addSubview: _accessoryView]; } /**

Sets the NSColorPanl action method to aSelector The action message is usally send in -setColor:, when the picker is updated, when a new picker is show, when the alpha is changed or when one of the color well at the bottom is selected.

*/ - (void) setAction: (SEL)aSelector { _action = aSelector; } /**

Sets whether the NSColorPanel sends continuously action messages

See Also: -isContinuous

*/ - (void) setContinuous: (BOOL)flag { _isContinuous = flag; } /**

Set the NSColorPanel mode to mode.

See Also: -mode

*/ - (void) setMode: (int)mode { int i, count; if (mode == [self mode]) return; count = [_pickers count]; for (i = 0; i < count; i++) { if ([[_pickers objectAtIndex: i] supportsMode: mode]) { [_pickerMatrix selectCellWithTag: i]; [self _showNewPicker: _pickerMatrix]; [_currentPicker setMode: mode]; break; } } } /**

Sets whether the NSColorPanel shows alpha values and the alpha slider.

See Also: -showsAlpha

*/ - (void) setShowsAlpha: (BOOL)flag { if (flag == _showsAlpha) return; if (flag) { NSRect newFrame = [_pickerBox frame]; float offset = [_alphaSlider frame].size.height + 4; [_alphaSlider setFrameOrigin: newFrame.origin]; [[_pickerBox superview] addSubview: _alphaSlider]; newFrame.origin.y += offset; newFrame.size.height -= offset; [_pickerBox setFrame: newFrame]; } else { // Remove the alpha slider, and add its size to the pickeBox [_alphaSlider removeFromSuperview]; [_pickerBox setFrame: NSUnionRect([_pickerBox frame], [_alphaSlider frame])]; } _showsAlpha = flag; [_pickers makeObjectsPerformSelector: @selector(alphaControlAddedOrRemoved:) withObject: self]; [_topView setNeedsDisplay: YES]; } /**

Sets the target object to anObject

*/ - (void) setTarget: (id)anObject { _target = anObject; } /**

Returns whether the NSColorPanel shows alpha values and the alpha slider

See Also: -setShowsAlpha:

*/ - (BOOL) showsAlpha { return _showsAlpha; } // // Attaching a Color List // - (void) attachColorList: (NSColorList *)aColorList { [_pickers makeObjectsPerformSelector: @selector(attachColorList:) withObject: aColorList]; } - (void) detachColorList: (NSColorList *)aColorList { [_pickers makeObjectsPerformSelector: @selector(detachColorList:) withObject: aColorList]; } /**

Returns the alpha value of the NSColorPanel. Returns 1.0 if the NSColorPanel does not show alpha

See Also: -showsAlpha -setShowsAlpha:

*/ - (float) alpha { if ([self showsAlpha]) return [_alphaSlider floatValue] / MAX_ALPHA_VALUE; else return 1.0; } /**

Returns the current NSColor displayed by the NSColorPanel.

See Also : -setColor:

*/ - (NSColor *) color { return [_colorWell color]; } /**

Sets the NSColor displayed to aColor. This method post a NSColorPanelColorDidChangeNotification notification if needed.

See Also: -color [NSColorWell-setColor:]

*/ - (void) setColor: (NSColor *)aColor { [_colorWell setColor: aColor]; [_currentPicker setColor: aColor]; if ([self showsAlpha]) [_alphaSlider setFloatValue: [aColor alphaComponent] * MAX_ALPHA_VALUE]; // FIXME: to support [self isContinuous] the API between color pickers // and NSColorPanel needs some changes. Currently the color panel is // always continuous [NSApp sendAction: @selector(changeColor:) to: nil from: self]; if ((_action) && (_target != nil)) [NSApp sendAction: _action to: _target from: self]; [[NSNotificationCenter defaultCenter] postNotificationName: NSColorPanelColorDidChangeNotification object: (id)self]; } - (BOOL) worksWhenModal { return YES; } @end gnustep-gui-0.24.0/Source/NSWindowController.m0000664000076500007650000003224712107126360021142 0ustar brains99brains99/** NSWindowController Copyright (C) 2000 Free Software Foundation, Inc. Author: Carl Lindberg Date: 1999 Author: Fred Kiefer Date: Aug 2003 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import #import "AppKit/NSNib.h" #import "AppKit/NSNibLoading.h" #import "AppKit/NSPanel.h" #import "AppKit/NSWindowController.h" #import "NSDocumentFrameworkPrivate.h" @implementation NSWindowController + (void) initialize { if (self == [NSWindowController class]) { [self setVersion: 1]; } } - (id) initWithWindowNibName: (NSString *)windowNibName { return [self initWithWindowNibName: windowNibName owner: self]; } - (id) initWithWindowNibName: (NSString *)windowNibName owner: (id)owner { if (windowNibName == nil) { [NSException raise: NSInvalidArgumentException format: @"attempt to init NSWindowController with nil windowNibName"]; } if (owner == nil) { [NSException raise: NSInvalidArgumentException format: @"attempt to init NSWindowController with nil owner"]; } self = [self initWithWindow: nil]; if (!self) return nil; ASSIGN(_window_nib_name, windowNibName); _owner = owner; return self; } - (id) initWithWindowNibPath: (NSString *)windowNibPath owner: (id)owner { if (windowNibPath == nil) { [NSException raise: NSInvalidArgumentException format: @"attempt to init NSWindowController with nil windowNibPath"]; } if (owner == nil) { [NSException raise: NSInvalidArgumentException format: @"attempt to init NSWindowController with nil owner"]; } self = [self initWithWindow: nil]; if (!self) return nil; ASSIGN(_window_nib_path, windowNibPath); _owner = owner; return self; } - (id) initWithWindow: (NSWindow *)window { self = [super init]; if (!self) return nil; ASSIGN(_window_frame_autosave_name, @""); _wcFlags.should_cascade = YES; //_wcFlags.should_close_document = NO; _owner = self; [self setWindow: window]; if (_window != nil) { [self _windowDidLoad]; [self setDocument: nil]; } return self; } - (id) init { return [self initWithWindow: nil]; } - (void) dealloc { // Window Controllers are expect to release their own top-level objects [_top_level_objects makeObjectsPerformSelector: @selector(release)]; [self setWindow: nil]; RELEASE(_window_nib_name); RELEASE(_window_nib_path); RELEASE(_window_frame_autosave_name); RELEASE(_top_level_objects); [super dealloc]; } - (NSString *) windowNibName { if ((_window_nib_name == nil) && (_window_nib_path != nil)) { return [[_window_nib_path lastPathComponent] stringByDeletingPathExtension]; } return _window_nib_name; } - (NSString *)windowNibPath { if ((_window_nib_name != nil) && (_window_nib_path == nil)) { NSString *path; path = [[NSBundle bundleForClass: [_owner class]] pathForNibResource: _window_nib_name]; if (path == nil) path = [[NSBundle mainBundle] pathForNibResource: _window_nib_name]; return path; } return _window_nib_path; } - (id) owner { return _owner; } /** Sets the document associated with this controller. A document automatically calls this method when adding a window controller to its list of window controllers. You should not call this method directly when using NSWindowController with an NSDocument or subclass. */ - (void) setDocument: (NSDocument *)document { // As the document retains us, we only keep a week reference. _document = document; [self synchronizeWindowTitleWithDocumentName]; if (_document == nil) { /* If you want the window to be deallocated when closed, you need to observe the NSWindowWillCloseNotification (or implement the window's delegate windowWillClose: method) and autorelease the window controller in that method. That will then release the window when the window controller is released. */ [_window setReleasedWhenClosed: NO]; } else { /* When a window owned by a document is closed, it is released and the window controller is removed from the documents list of controllers. */ [_window setReleasedWhenClosed: YES]; } } - (id) document { return _document; } - (void) setDocumentEdited: (BOOL)flag { if ([self isWindowLoaded]) [[self window] setDocumentEdited: flag]; } - (void) setWindowFrameAutosaveName:(NSString *)name { ASSIGN(_window_frame_autosave_name, name); if ([self isWindowLoaded]) { [[self window] setFrameAutosaveName: name ? (id)name : (id)@""]; } } - (NSString *) windowFrameAutosaveName { return _window_frame_autosave_name; } - (void) setShouldCloseDocument: (BOOL)flag { _wcFlags.should_close_document = flag; } - (BOOL) shouldCloseDocument { return _wcFlags.should_close_document; } - (void) setShouldCascadeWindows: (BOOL)flag { _wcFlags.should_cascade = flag; } - (BOOL) shouldCascadeWindows { return _wcFlags.should_cascade; } - (void) close { [_window close]; } - (void) _windowWillClose: (NSNotification *)notification { if ([notification object] == _window) { /* We only need to do something if the window is set to be released when closed (which should only happen if _document != nil). In this case, we release everything; otherwise, well the window is closed but nothing is released so there's nothing to do here. */ if ([_window isReleasedWhenClosed]) { RETAIN(self); if ([_window delegate] == self) { [_window setDelegate: nil]; } if ([_window windowController] == self) { [_window setWindowController: nil]; } /* * If the window is set to isReleasedWhenClosed, it will release * itself, so we have to retain it once more. * * Apple's implementation doesn't seem to deal with this case, and * crashes if isReleaseWhenClosed is set. */ RETAIN(_window); [self setWindow: nil]; [_document _removeWindowController: self]; AUTORELEASE(self); } } } - (NSWindow *) window { if (_window == nil && ![self isWindowLoaded]) { // Do all the notifications. Yes, the docs say this should // be implemented here instead of in -loadWindow itself. // Note: The docs say that windowController{Will,Did}LoadNib: are sent // to the window controller's document, but Apple's implementation // really sends them to the owner of the nib. Since this behavior is // more useful, in particular when non-document classes use a window // controller, we implement it here too. [self windowWillLoad]; if (_owner != self && [_owner respondsToSelector: @selector(windowControllerWillLoadNib:)]) { [_owner windowControllerWillLoadNib: self]; } [self loadWindow]; if ([self isWindowLoaded]) { [self _windowDidLoad]; if (_owner != self && [_owner respondsToSelector: @selector(windowControllerDidLoadNib:)]) { [_owner windowControllerDidLoadNib: self]; } } } return _window; } /** Sets the window that this controller managers to aWindow. The old window is released. */ - (void) setWindow: (NSWindow *)aWindow { NSNotificationCenter *nc; if (_window == aWindow) { return; } nc = [NSNotificationCenter defaultCenter]; if (_window != nil) { NSResponder *responder; [nc removeObserver: self name: NSWindowWillCloseNotification object: _window]; // Remove self from the responder chain responder = _window; while (responder && [responder nextResponder] != self) { responder = [responder nextResponder]; } [responder setNextResponder: [self nextResponder]]; [_window setWindowController: nil]; } ASSIGN(_window, aWindow); if (_window != nil) { [_window setWindowController: self]; // Put self into the responder chain [self setNextResponder: [_window nextResponder]]; [_window setNextResponder: self]; [nc addObserver: self selector: @selector(_windowWillClose:) name: NSWindowWillCloseNotification object: _window]; /* For information on the following, see the description in -setDocument: */ if (_document == nil) { [_window setReleasedWhenClosed: NO]; } else { [_window setReleasedWhenClosed: YES]; [_window setDocumentEdited: [_document isDocumentEdited]]; } /* Make sure window sizes itself right */ if ([_window_frame_autosave_name length] > 0) { [_window setFrameAutosaveName: _window_frame_autosave_name]; } } } - (IBAction) showWindow: (id)sender { NSWindow *window = [self window]; if ([window isKindOfClass: [NSPanel class]] && [(NSPanel*)window becomesKeyOnlyIfNeeded]) { [window orderFront: sender]; } else { [window makeKeyAndOrderFront: sender]; } } - (NSString *) windowTitleForDocumentDisplayName: (NSString *)displayName { return displayName; } - (void) synchronizeWindowTitleWithDocumentName { if ((_document != nil) && [self isWindowLoaded]) { NSString *filename = [_document fileName]; NSString *displayName = [_document displayName]; NSString *title = [self windowTitleForDocumentDisplayName: displayName]; /* If they just want to display the filename, use the fancy method */ /* NB For compatibility with Mac OS X, a document's display name is equal to its last path component, so we check for that here too */ if (filename != nil && ([title isEqualToString: filename] || [title isEqualToString: [filename lastPathComponent]])) { [_window setTitleWithRepresentedFilename: filename]; } else { if (filename) [_window setRepresentedFilename: filename]; [_window setTitle: title]; } } } - (BOOL) isWindowLoaded { return _wcFlags.nib_is_loaded; } - (void) windowDidLoad { } - (void) windowWillLoad { } - (void) _windowDidLoad { _wcFlags.nib_is_loaded = YES; [self synchronizeWindowTitleWithDocumentName]; if ([self shouldCascadeWindows]) { static NSPoint nextWindowLocation = { 0.0, 0.0 }; /* * cascadeTopLeftFromPoint will "wrap" the point back to the * top left if the normal cascading will cause the window to go * off the screen. In Apple's implementation, this wraps to the * extreme top of the screen, and offset only a small amount * from the left. */ nextWindowLocation = [_window cascadeTopLeftFromPoint: nextWindowLocation]; } [self windowDidLoad]; } - (void) loadWindow { NSDictionary *table; if ([self isWindowLoaded]) { return; } table = [NSDictionary dictionaryWithObject: _owner forKey: NSNibOwner]; if ([NSBundle loadNibFile: [self windowNibPath] externalNameTable: table withZone: [_owner zone]]) { _wcFlags.nib_is_loaded = YES; if (_window == nil && _document != nil && _owner == _document) { [self setWindow: [_document _transferWindowOwnership]]; } else { // The window was already retained by the NIB loading. RELEASE(_window); } } else { if (_window_nib_name != nil) { NSLog (@"%@: could not load nib named %@.nib", [self class], _window_nib_name); } } } - (id) initWithCoder: (NSCoder *)coder { if ([coder allowsKeyedCoding] || [coder versionForClassName: @"NSWindowController"] >= 1) { self = [super initWithCoder: coder]; if (!self) return nil; ASSIGN(_window_frame_autosave_name, @""); _wcFlags.should_cascade = YES; //_wcFlags.should_close_document = NO; return self; } else { /* backward compatibility: old NSWindowController instances are not subclasses of NSResponder, but of NSObject */ return [self init]; } } - (void) encodeWithCoder: (NSCoder *)coder { // What are we supposed to encode? Window nib name? Or should these // be empty, just to conform to NSCoding, so we do an -init on // unarchival. ? [super encodeWithCoder: coder]; } @end gnustep-gui-0.24.0/Source/GSToolbarView.m0000664000076500007650000006212011673147131020054 0ustar brains99brains99/* GSToolbarView.m The toolbar view class. Copyright (C) 2004 Free Software Foundation, Inc. Author: Quentin Mathe Date: January 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import #import #import "AppKit/NSButton.h" #import "AppKit/NSClipView.h" #import "AppKit/NSDragging.h" #import "AppKit/NSEvent.h" #import "AppKit/NSImage.h" #import "AppKit/NSMenu.h" #import "AppKit/NSPasteboard.h" // It contains GSMovableToolbarItemPboardType declaration #import "AppKit/NSToolbarItem.h" #import "AppKit/NSView.h" #import "AppKit/NSWindow.h" #import "GNUstepGUI/GSTheme.h" #import "GNUstepGUI/GSToolbarView.h" #import "NSToolbarFrameworkPrivate.h" typedef enum { ToolbarViewDefaultHeight = 62, ToolbarViewRegularHeight = 62, ToolbarViewSmallHeight = 52 } ToolbarViewHeight; // Borrow this from NSToolbarItem.m static const int InsetItemViewX = 10; static const int ClippedItemsViewWidth = 28; // Internal static const int current_version = 1; static NSInteger draggedItemIndex = NSNotFound; /* * Toolbar related code */ @interface GSToolbarButton - (NSToolbarItem *) toolbarItem; @end @interface GSToolbarBackView - (NSToolbarItem *) toolbarItem; @end @interface GSToolbarClippedItemsButton : NSButton { NSToolbar *_toolbar; } - (id) init; // Accessors - (NSMenu *) overflowMenu; /* This method cannot be called "menu" otherwise it would override NSResponder method with the same name. */ - (void) layout; - (void) setToolbar: (NSToolbar *)toolbar; @end @implementation GSToolbarClippedItemsButton - (id) init { NSImage *image = [NSImage imageNamed: @"common_ToolbarClippedItemsMark"]; NSRect dummyRect = NSMakeRect(0, 0, ClippedItemsViewWidth, 100); // The correct height will be set by the layout method if ((self = [super initWithFrame: dummyRect]) != nil) { [self setBordered: NO]; [[self cell] setHighlightsBy: NSChangeGrayCellMask | NSChangeBackgroundCellMask]; [self setAutoresizingMask: NSViewNotSizable]; [self setImagePosition: NSImageOnly]; [image setScalesWhenResized: YES]; // [image setSize: NSMakeSize(20, 20)]; [self setImage: image]; return self; } return nil; } /* * Not really used, it is here to be used by the developer who want to adjust * easily a toolbar view attached to a toolbar which is not bind to a window. */ - (void) layout { NSSize layoutSize = NSMakeSize([self frame].size.width, [[_toolbar _toolbarView] _heightFromLayout]); [self setFrameSize: layoutSize]; } - (void) mouseDown: (NSEvent *)event { NSMenu *clippedItemsMenu = [self menuForEvent: event]; [super highlight: YES]; if (clippedItemsMenu != nil) { [NSMenu popUpContextMenu: clippedItemsMenu withEvent: event forView: self]; } [super highlight: NO]; } - (NSMenu *) menuForEvent: (NSEvent *)event { if ([event type] == NSLeftMouseDown) { return [self overflowMenu]; } return nil; } - (NSMenu *) overflowMenu { /* This method cannot be called "menu" otherwise it would override NSResponder method with the same name. */ NSMenu *menu = [[NSMenu alloc] initWithTitle: @""]; NSEnumerator *e; id item; NSArray *visibleItems; visibleItems = [_toolbar visibleItems]; e = [[_toolbar items] objectEnumerator]; while ((item = [e nextObject]) != nil) { if (![visibleItems containsObject: item]) { id menuItem; menuItem = [item menuFormRepresentation]; if (menuItem == nil) menuItem = [item _defaultMenuFormRepresentation]; if (menuItem != nil) { [item validate]; [menu addItem: menuItem]; } } } return AUTORELEASE(menu); } // Accessors - (void) setToolbar: (NSToolbar *)toolbar { // Don't do an ASSIGN here, the toolbar view retains us. _toolbar = toolbar; } @end // --- // Implementation GSToolbarView @implementation GSToolbarView + (void) initialize { if (self == [GSToolbarView class]) { } } - (id) initWithFrame: (NSRect)frame { if ((self = [super initWithFrame: frame]) == nil) { return nil; } _heightFromLayout = ToolbarViewDefaultHeight; [self setFrame: NSMakeRect(frame.origin.x, frame.origin.y, frame.size.width, _heightFromLayout)]; _clipView = [[NSClipView alloc] initWithFrame: NSMakeRect(0, 0, frame.size.width, _heightFromLayout)]; [_clipView setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)]; [_clipView setDrawsBackground: NO]; [self addSubview: _clipView]; // Adjust the clip view frame [self setBorderMask: GSToolbarViewTopBorder | GSToolbarViewBottomBorder | GSToolbarViewRightBorder | GSToolbarViewLeftBorder]; _clippedItemsMark = [[GSToolbarClippedItemsButton alloc] init]; [self registerForDraggedTypes: [NSArray arrayWithObject: GSMovableToolbarItemPboardType]]; return self; } - (void) dealloc { //NSLog(@"Toolbar view dealloc"); [[NSNotificationCenter defaultCenter] removeObserver: self]; RELEASE(_clippedItemsMark); RELEASE(_clipView); [super dealloc]; } // Dragging related methods + (int) draggedItemIndex { return draggedItemIndex; } + (void) setDraggedItemIndex:(int)sourceIndex { draggedItemIndex = sourceIndex; } - (int) _insertionIndexAtPoint: (NSPoint)location { int index; NSArray *visibleBackViews = [self _visibleBackViews]; location = [_clipView convertPoint:location fromView:nil]; if (draggedItemIndex == NSNotFound) { //simply locate the nearest location between existing items for (index=0; index < [visibleBackViews count]; index++) { NSRect itemRect = [[visibleBackViews objectAtIndex:index] frame]; if (location.x < (itemRect.origin.x + (itemRect.size.width/2))) { NSLog(@"AT location %d", index); return index; } } return [visibleBackViews count]; } else { // don't return a different index unless drag has crossed the midpoint of its neighbor NSRect itemRect; BOOL draggingLeft = YES; if (draggedItemIndex < [visibleBackViews count]) { itemRect = [[visibleBackViews objectAtIndex:draggedItemIndex] frame]; draggingLeft = (location.x < (itemRect.origin.x + (itemRect.size.width/2))); } if (draggingLeft) { // dragging to the left of dragged item's current location for (index=0; index < draggedItemIndex; index++) { itemRect = [[visibleBackViews objectAtIndex:index] frame]; if (location.x < (itemRect.origin.x + (itemRect.size.width/2))) { NSLog(@"To the LEFT of %d", index); return index; } } } else { // dragging to the right of current location for (index=[visibleBackViews count]-1; index > draggedItemIndex; index--) { itemRect = [[visibleBackViews objectAtIndex:index] frame]; if (location.x > (itemRect.origin.x + (itemRect.size.width/2))) { NSLog(@"To the RIGHT of %d", index); return index; } } } return draggedItemIndex; } } - (NSDragOperation) updateItemWhileDragging:(id )info exited:(BOOL)exited { NSToolbarItem *item = [[info draggingSource] toolbarItem]; NSString *identifier = [item itemIdentifier]; NSToolbar *toolbar = [self toolbar]; NSArray *allowedItemIdentifiers = [toolbar _allowedItemIdentifiers]; int newIndex; // don't accept any dragging if the customization palette isn't running for this toolbar if (![toolbar customizationPaletteIsRunning] || ![allowedItemIdentifiers containsObject: identifier]) { return NSDragOperationNone; } if (draggedItemIndex == NSNotFound) // initialize the index for this drag session { // if duplicate items aren't allowed, see if we already have such an item if (![item allowsDuplicatesInToolbar]) { NSArray *items = [toolbar items]; NSInteger index; for (index=0; index<[items count]; index++) { NSToolbarItem *anItem = [items objectAtIndex:index]; if ([[anItem itemIdentifier] isEqual:identifier]) { draggedItemIndex = index; // drag the existing item break; } } } } else if (draggedItemIndex == -1) { // re-entering after being dragged off -- treat as unknown location draggedItemIndex = NSNotFound; } newIndex = [self _insertionIndexAtPoint: [info draggingLocation]]; if (draggedItemIndex != NSNotFound) { // existing item being dragged -- either move or remove it if (exited) { [toolbar _removeItemAtIndex:draggedItemIndex broadcast:YES]; draggedItemIndex = -1; // no longer in our items } else { if (newIndex != draggedItemIndex) { [toolbar _moveItemFromIndex: draggedItemIndex toIndex: newIndex broadcast: YES]; draggedItemIndex = newIndex; } } } else if (!exited) { // new item being dragged in -- add it [toolbar _insertItemWithItemIdentifier: identifier atIndex: newIndex broadcast: YES]; draggedItemIndex = newIndex; } return NSDragOperationGeneric; } - (NSDragOperation) draggingEntered: (id )info { return [self updateItemWhileDragging: info exited: NO]; } - (NSDragOperation) draggingUpdated: (id )info { return [self updateItemWhileDragging: info exited: NO]; } - (void) draggingEnded: (id )info { draggedItemIndex = NSNotFound; } - (void) draggingExited: (id )info { [self updateItemWhileDragging: info exited: YES]; } - (BOOL) prepareForDragOperation: (id )info { return YES; } - (BOOL) performDragOperation: (id )info { NSToolbar *toolbar = [self toolbar]; [self updateItemWhileDragging: info exited: NO]; draggedItemIndex = NSNotFound; // save the configuration... [toolbar _saveConfig]; return YES; } - (void) concludeDragOperation: (id )info { // Nothing to do currently } // More overrided methods - (void) drawRect: (NSRect)aRect { [[GSTheme theme] drawToolbarRect: aRect frame: [self frame] borderMask: _borderMask]; } - (BOOL) isOpaque { if ([[[GSTheme theme] toolbarBackgroundColor] alphaComponent] < 1.0) { return NO; } else { return YES; } } - (void) windowDidResize: (NSNotification *)notification { if ([self superview] == nil) return; [self _reload]; } - (void) viewWillMoveToSuperview: (NSView *)newSuperview { [super viewWillMoveToSuperview: newSuperview]; [_toolbar _toolbarViewWillMoveToSuperview: newSuperview]; // Allow to update the validation system which is window specific } - (void) viewDidMoveToWindow { NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; /* NSView method called when a view is moved to a window (NSView has a variable _window). */ [super viewDidMoveToWindow]; [nc removeObserver: self name: NSWindowDidResizeNotification object: nil]; [nc addObserver: self selector: @selector(windowDidResize:) name: NSWindowDidResizeNotification object: _window]; } // Accessors - (unsigned int) borderMask { return _borderMask; } - (NSToolbar *) toolbar { return _toolbar; } - (void) setBorderMask: (unsigned int)borderMask { NSRect toolbarViewFrame = [self frame]; NSRect rect = NSMakeRect(0, 0, toolbarViewFrame.size.width, toolbarViewFrame.size.height); _borderMask = borderMask; // Take in account the border if (_borderMask & GSToolbarViewBottomBorder) { rect = NSMakeRect(rect.origin.x, ++rect.origin.y, rect.size.width, --rect.size.height); } if (_borderMask & GSToolbarViewTopBorder) { rect = NSMakeRect(rect.origin.x, rect.origin.y, rect.size.width, --rect.size.height); } if (_borderMask & GSToolbarViewLeftBorder) { rect = NSMakeRect(++rect.origin.x, rect.origin.y, --rect.size.width, rect.size.height); } if (_borderMask & GSToolbarViewRightBorder) { rect = NSMakeRect(rect.origin.x, rect.origin.y, --rect.size.width, rect.size.height); } [_clipView setFrame: rect]; } - (void) setToolbar: (NSToolbar *)toolbar { if (_toolbar == toolbar) return; _toolbar = toolbar; [_clippedItemsMark setToolbar: _toolbar]; // Load the toolbar in the toolbar view [self _reload]; } // Private methods - (void) _handleBackViewsFrame { float x = 0; float newHeight = 0; NSArray *subviews = [_clipView subviews]; NSEnumerator *e = [[_toolbar items] objectEnumerator]; NSToolbarItem *item; while ((item = [e nextObject]) != nil) { NSView *itemBackView; NSRect itemBackViewFrame; itemBackView = [item _backView]; if ([subviews containsObject: itemBackView] == NO || [item _isModified] || [item _isFlexibleSpace]) { // When a label is changed, _isModified returns YES to let us known we // must recalculate the text length and then the size for the edited // item back view [item _layout]; } itemBackViewFrame = [itemBackView frame]; [itemBackView setFrame: NSMakeRect(x, itemBackViewFrame.origin.y, itemBackViewFrame.size.width, itemBackViewFrame.size.height)]; x += [itemBackView frame].size.width; if (itemBackViewFrame.size.height > newHeight) newHeight = itemBackViewFrame.size.height; } if (newHeight > 0) _heightFromLayout = newHeight; } - (void) _takeInAccountFlexibleSpaces { NSArray *items = [_toolbar items]; NSEnumerator *e; NSToolbarItem *item; NSView *backView, *view; CGFloat lengthAvailable; BOOL mustAdjustNext = NO; CGFloat x = 0, visibleItemsMinWidth = 0, backViewsWidth = 0; NSMutableArray *variableWidthItems = [NSMutableArray array]; int flexibleItemsCount = 0, maxWidthItemsCount = 0; CGFloat spacePerFlexItem, extraSpace = 0; CGFloat toolbarWidth = [self frame].size.width; int i, n = [items count]; NSMutableArray *visibleItems = [NSMutableArray array]; static const int FlexItemWeight = 4; // non-space flexible item counts as much as 4 flexible spaces if (n == 0) return; // First determine which items can fit in toolbar if all are at their minimum width. // We'd like to show as many items as possible. These are our visibleItems. for (i=0; i < n; i++) { item = [items objectAtIndex:i]; backView = [item _backView]; view = [item view]; if (view != nil) backViewsWidth += [item minSize].width + 2*InsetItemViewX; else backViewsWidth += [backView frame].size.width; if ((backViewsWidth + ClippedItemsViewWidth <= toolbarWidth) || (i == n - 1 && backViewsWidth <= toolbarWidth)) { visibleItemsMinWidth = backViewsWidth; [visibleItems addObject:item]; } else { break; } } // next, figure out how much additional space there is for expanding flexible items lengthAvailable = toolbarWidth - visibleItemsMinWidth; if ([visibleItems count] < n) lengthAvailable -= ClippedItemsViewWidth; if (lengthAvailable < 1) return; // We want to divide available space evenly among all flexible items, but some items may // reach their maximum width, making more space available for the other items. // To do this, first we count the flexible items, gathering a list of those that may // have a maximum width. // To match observed behavior on Cocoa (which is NOT as documented!) we allocate only 1/4 // as much space to flexible spaces as we do to other flexible items. e = [visibleItems objectEnumerator]; while ((item = [e nextObject]) != nil) { if ([item _isFlexibleSpace]) { flexibleItemsCount++; } else { CGFloat minWidth = [item minSize].width; CGFloat maxWidth = [item maxSize].width; if (minWidth < maxWidth) { [variableWidthItems addObject:item]; flexibleItemsCount += FlexItemWeight; // gets FlexItemWeight times the weight of a flexible space } } } if (flexibleItemsCount == 0) return; // Now go through any variableWidthItems to see if the available space per item would // cause any of them to exceed their maximum width, and calculate the extra space available spacePerFlexItem = MAX(lengthAvailable / flexibleItemsCount, 0); e = [variableWidthItems objectEnumerator]; while ((item = [e nextObject]) != nil) { CGFloat minWidth = [item minSize].width; CGFloat maxWidth = [item maxSize].width; if (maxWidth-minWidth < spacePerFlexItem * FlexItemWeight) { extraSpace += spacePerFlexItem * FlexItemWeight - (maxWidth-minWidth); // give back unneeded space maxWidthItemsCount += FlexItemWeight; } } // Recalculate spacePerFlexItem (unless all flexible items are going to their max width) if (flexibleItemsCount > maxWidthItemsCount) spacePerFlexItem += extraSpace / (flexibleItemsCount-maxWidthItemsCount); // Finally, go through all items, adjusting their width and positioning them as needed e = [items objectEnumerator]; while ((item = [e nextObject]) != nil) { backView = [item _backView]; if ([item _isFlexibleSpace]) { NSRect backViewFrame = [backView frame]; [backView setFrame: NSMakeRect(x, backViewFrame.origin.y, spacePerFlexItem, backViewFrame.size.height)]; mustAdjustNext = YES; } else if ([variableWidthItems indexOfObjectIdenticalTo:item] != NSNotFound) { NSRect backViewFrame = [backView frame]; CGFloat maxFlex = [item maxSize].width - [item minSize].width; CGFloat flexAmount = MIN(maxFlex, spacePerFlexItem * FlexItemWeight); CGFloat newWidth = [item minSize].width + flexAmount + 2 * InsetItemViewX; [backView setFrame: NSMakeRect(x, backViewFrame.origin.y, newWidth, backViewFrame.size.height)]; mustAdjustNext = YES; } else if (mustAdjustNext) { NSRect backViewFrame = [backView frame]; [backView setFrame: NSMakeRect(x, backViewFrame.origin.y, backViewFrame.size.width, backViewFrame.size.height)]; } view = [item view]; if (view != nil) { NSRect viewFrame = [view frame]; // Subtract InsetItemViewX viewFrame.size.width = [backView frame].size.width - 2 * InsetItemViewX; viewFrame.origin.x = InsetItemViewX; [view setFrame: viewFrame]; } x += [backView frame].size.width; } } - (void) _handleViewsVisibility { NSArray *backViews; NSArray *subviews; NSEnumerator *e; NSView *backView; /* The back views which are associated with each toolbar item (the toolbar items doesn't reflect the toolbar view content) */ backViews = [[_toolbar items] valueForKey: @"_backView"]; // We remove each back view associated with a removed toolbar item e = [[_clipView subviews] objectEnumerator]; while ((backView = [e nextObject]) != nil) { if ([backViews containsObject: backView] == NO) { if ([backView superview] != nil) [backView removeFromSuperview]; } } // We add each backView associated with an added toolbar item subviews = [_clipView subviews]; e = [backViews objectEnumerator]; while ((backView = [e nextObject]) != nil) { if ([subviews containsObject: backView] == NO) { [_clipView addSubview: backView]; } } } - (void) _manageClipView { NSRect clipViewFrame = [_clipView frame]; int count = [[_toolbar items] count]; // Retrieve the back views which should be visible now that the resize // process has been taken in account NSArray *visibleBackViews = [self _visibleBackViews]; if ([visibleBackViews count] < count) { NSView *lastVisibleBackView = [visibleBackViews lastObject]; float width = 0; // Resize the clip view if (lastVisibleBackView != nil) width = NSMaxX([lastVisibleBackView frame]); [_clipView setFrame: NSMakeRect(clipViewFrame.origin.x, clipViewFrame.origin.y, width, clipViewFrame.size.height)]; // Adjust the clipped items mark frame handling [_clippedItemsMark layout]; // We get the new _clipView frame clipViewFrame = [_clipView frame]; [_clippedItemsMark setFrameOrigin: NSMakePoint( [self frame].size.width - ClippedItemsViewWidth, clipViewFrame.origin.y)]; if ([_clippedItemsMark superview] == nil) [self addSubview: _clippedItemsMark]; } else if (([_clippedItemsMark superview] != nil) && ([visibleBackViews count] == count)) { [_clippedItemsMark removeFromSuperview]; [_clipView setFrame: NSMakeRect(clipViewFrame.origin.x, clipViewFrame.origin.y, [self frame].size.width, clipViewFrame.size.height)]; } } - (void) _reload { // First, we resize [self _handleBackViewsFrame]; [self _takeInAccountFlexibleSpaces]; [self _handleViewsVisibility]; /* We manage the clipped items view in the case it should become visible or invisible */ [self _manageClipView]; [self setNeedsDisplay: YES]; } // Accessors private methods - (float) _heightFromLayout { float height = _heightFromLayout; if (_borderMask & GSToolbarViewBottomBorder) { height++; } if (_borderMask & GSToolbarViewTopBorder) { height++; } return height; } /* * Will return the visible (not clipped) back views in the toolbar view even * when the toolbar is not visible. * May be should be renamed _notClippedBackViews method. */ - (NSArray *) _visibleBackViews { NSArray *items = [_toolbar items]; NSView *backView, *view; int i, n = [items count]; float backViewsWidth = 0, toolbarWidth = [self frame].size.width; NSMutableArray *visibleBackViews = [NSMutableArray array]; for (i = 0; i < n; i++) { NSToolbarItem *item = [items objectAtIndex:i]; backView = [item _backView]; view = [item view]; if (view != nil) backViewsWidth += [item minSize].width + 2*InsetItemViewX; else backViewsWidth += [backView frame].size.width; if ((backViewsWidth + ClippedItemsViewWidth <= toolbarWidth) || (i == n - 1 && backViewsWidth <= toolbarWidth)) { [visibleBackViews addObject: backView]; } } return visibleBackViews; } - (NSColor *) standardBackgroundColor { NSLog(@"Use of deprecated method %@", NSStringFromSelector(_cmd)); return nil; } - (BOOL) _usesStandardBackgroundColor { NSLog(@"Use of deprecated method %@", NSStringFromSelector(_cmd)); return NO; } - (void) _setUsesStandardBackgroundColor: (BOOL)standard { NSLog(@"Use of deprecated method %@", NSStringFromSelector(_cmd)); } - (NSMenu *) menuForEvent: (NSEvent *)event { NSMenu *menu = [[[NSMenu alloc] initWithTitle: @""] autorelease]; NSMenuItem *customize = [menu insertItemWithTitle: _(@"Customize Toolbar") action:@selector(runCustomizationPalette:) keyEquivalent:@"" atIndex:0]; [customize setTarget: _toolbar]; return menu; } @end gnustep-gui-0.24.0/Source/NSNib.m0000664000076500007650000001633611353745424016352 0ustar brains99brains99/** NSNib This class serves as a container for a nib file. It's possible to load a nib file from a URL or from a bundle. Using this class the nib file can now be "preloaded" and instantiated multiple times when/if needed. Also, since it's possible to initialize this class using a NSURL it's possible to load nib files from remote locations.
This class uses: NSNibOwner and NSNibTopLevelObjects to allow the caller to specify the owner of the nib during instantiation and receive an array containing the top level objects of the nib file.
Copyright (C) 2004 Free Software Foundation, Inc. Author: Gregory John Casamento Date: 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import #import #import #import #import #import #import #import #import "AppKit/NSNib.h" #import "AppKit/NSNibLoading.h" #import "GNUstepGUI/GSModelLoaderFactory.h" @implementation NSNib // private method to read in the data... - (void) _readNibData: (NSString *)fileName { NSDebugLog(@"Loading model `%@'...\n", fileName); NS_DURING { NSString *newFileName = [GSModelLoaderFactory supportedModelFileAtPath: fileName]; ASSIGN(_loader, [GSModelLoaderFactory modelLoaderForFileType: [newFileName pathExtension]]); ASSIGN(_nibData, [_loader dataForFile: newFileName]); NSDebugLog(@"Loaded data from %@...", newFileName); } NS_HANDLER { NSLog(@"Exception occured while loading model: %@", [localException reason]); } NS_ENDHANDLER } // Public methods... /** * Load the NSNib object from the specified URL. This location can be * any type of resource capable of being pointed to by the NSURL object. * A file in the local file system or a file on an ftp site. */ - (id)initWithContentsOfURL: (NSURL *)nibFileURL { if ((self = [super init]) != nil) { ASSIGN(_url, nibFileURL); if ([nibFileURL isFileURL]) { [self _readNibData: [nibFileURL path]]; } else { NS_DURING { ASSIGN(_loader, [GSModelLoaderFactory modelLoaderForFileType: [[nibFileURL path] pathExtension]]); // load the nib data into memory... _nibData = [NSData dataWithContentsOfURL: nibFileURL]; } NS_HANDLER { NSLog(@"Exception occured while loading model: %@", [localException reason]); } NS_ENDHANDLER } } return self; } /** * Load the nib indicated by nibNamed. If the bundle * argument is nil, then the main bundle is used to resolve * the path, otherwise the bundle which is supplied will be used. */ - (id)initWithNibNamed: (NSString *)nibNamed bundle: (NSBundle *)bundle { if ((self = [super init]) != nil) { NSString *fileName = nil; // Keep the bundle for resource creation ASSIGN(_bundle, bundle); if (bundle == nil) { bundle = [NSBundle mainBundle]; } // initialize the bundle... fileName = [bundle pathForNibResource: nibNamed]; if (fileName == nil) { DESTROY(self); return nil; } // load the nib data into memory... [self _readNibData: fileName]; } return self; } /** * This is a GNUstep specific method. This method is used when the caller * wants the objects instantiated in the nib to be stored in the given * zone. */ - (BOOL)instantiateNibWithExternalNameTable: (NSDictionary *)externalNameTable withZone: (NSZone *)zone { return [_loader loadModelData: _nibData externalNameTable: externalNameTable withZone: zone]; } /** * This method instantiates the nib file. The externalNameTable dictionary * accepts the NSNibOwner and NSNibTopLevelObjects entries described earlier. * It is recommended, for subclasses whose purpose is to change the behaviour * of nib loading, to override this method. */ - (BOOL)instantiateNibWithExternalNameTable: (NSDictionary *)externalNameTable { return [self instantiateNibWithExternalNameTable: externalNameTable withZone: NSDefaultMallocZone()]; } /** * This method instantiates the nib file. It utilizes the * instantiateNibWithExternalNameTable: method to, in a convenient way, * allow the user to specify both keys accepted by the * nib loading process. */ - (BOOL)instantiateNibWithOwner: (id)owner topLevelObjects: (NSArray **)topLevelObjects { NSMutableDictionary *externalNameTable = [NSMutableDictionary dictionary]; // add the necessary things to the table... [externalNameTable setObject: owner forKey: NSNibOwner]; if (topLevelObjects != 0) { *topLevelObjects = [NSMutableArray array]; [externalNameTable setObject: *topLevelObjects forKey: NSNibTopLevelObjects]; } return [self instantiateNibWithExternalNameTable: externalNameTable]; } - (id) initWithCoder: (NSCoder *)coder { if ((self = [super init]) != nil) { // // NOTE: This is okay, since the only encodings which will ever be built into // the gui library are nib and gorm. GModel only supports certain // objects and is going to be deprecated in the future. There just so // happens to be a one to one correspondence here. // if ([coder allowsKeyedCoding]) { // TODO_NIB: Need to verify this key... ASSIGN(_nibData, [coder decodeObjectForKey: @"NSData"]); ASSIGN(_loader, [GSModelLoaderFactory modelLoaderForFileType: @"nib"]); } else { // this is sort of a kludge... [coder decodeValueOfObjCType: @encode(id) at: &_nibData]; ASSIGN(_loader, [GSModelLoaderFactory modelLoaderForFileType: @"gorm"]); } } return self; } - (void) encodeWithCoder: (NSCoder *)coder { if ([coder allowsKeyedCoding]) { // TODO_NIB: Need to verify this key... [coder encodeObject: _nibData forKey: @"NSData"]; } else { [coder encodeValueOfObjCType: @encode(id) at: &_nibData]; } } - (void) dealloc { RELEASE(_nibData); RELEASE(_loader); TEST_RELEASE(_bundle); TEST_RELEASE(_url); [super dealloc]; } @end gnustep-gui-0.24.0/Source/win32-entry.c0000664000076500007650000000426511023376255017462 0ustar brains99brains99/* DLL entry routine Copyright (C) 1997 Free Software Foundation, Inc. Original Author: Scott Christley Created: August 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include /* Only if using Microsoft's tools and libraries */ #ifdef __MS_WIN32__ #include WINBOOL WINAPI _CRT_INIT( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved ); // Global errno isn't defined in Microsoft's thread safe C library void errno() {} int _MB_init_runtime() { return 0; } #endif /* __MS_WIN32__ */ // // DLL entry function for GNUstep GUI Library // This function gets called everytime a process/thread attaches to DLL // WINBOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) { if (ul_reason_for_call == DLL_PROCESS_ATTACH) { #ifdef __MS_WIN32__ /* Initialize the Microsoft C stdio DLL */ _CRT_INIT(hInst, ul_reason_for_call, lpReserved); /* Initialize the GNUstep Base Library runtime structures */ gnustep_base_init_runtime(); #endif /* __MS_WIN32__ */ } if (ul_reason_for_call == DLL_PROCESS_DETACH) { } if (ul_reason_for_call == DLL_THREAD_ATTACH) { #ifdef __MS_WIN32__ /* Initialize C stdio DLL */ _CRT_INIT(hInst, ul_reason_for_call, lpReserved); #endif /* __MS_WIN32__ */ } if (ul_reason_for_call == DLL_THREAD_DETACH) { } return TRUE; } gnustep-gui-0.24.0/Source/NSStepper.m0000664000076500007650000000506511276011274017252 0ustar brains99brains99/** NSStepper Copyright (C) 2001 Free Software Foundation, Inc. Author: Pierre-Yves Rivaille Date: August 2001 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import "AppKit/NSStepper.h" #import "AppKit/NSEvent.h" #import "AppKit/NSStepperCell.h" // // class variables // id _nsstepperCellClass = nil; @implementation NSStepper // // Class methods // + (void) initialize { if (self == [NSStepper class]) { [self setVersion: 1]; [self setCellClass: [NSStepperCell class]]; } } // // Initializing the NSStepper Factory // + (Class) cellClass { return _nsstepperCellClass; } + (void) setCellClass: (Class)classId { _nsstepperCellClass = classId; } // // Instance methods // // // Determining the first responder // - (BOOL) becomeFirstResponder { [_cell setShowsFirstResponder: YES]; [self setNeedsDisplay: YES]; return YES; } - (BOOL) resignFirstResponder { [_cell setShowsFirstResponder: NO]; [self setNeedsDisplay: YES]; return YES; } - (void) keyDown: (NSEvent*)theEvent { // FIXME [super keyDown: theEvent]; } - (double) maxValue { return [_cell maxValue]; } - (void) setMaxValue: (double)maxValue { [_cell setMaxValue: maxValue]; } - (double) minValue { return [_cell minValue]; } - (void) setMinValue: (double)minValue { [_cell setMinValue: minValue]; } - (double) increment { return [_cell increment]; } - (void) setIncrement: (double)increment { [_cell setIncrement: increment]; } - (BOOL)autorepeat { return [_cell autorepeat]; } - (void)setAutorepeat: (BOOL)autorepeat { [_cell setAutorepeat: autorepeat]; } - (BOOL)valueWraps { return [_cell valueWraps]; } - (void)setValueWraps: (BOOL)valueWraps { [_cell setValueWraps: valueWraps]; } @end gnustep-gui-0.24.0/Source/NSCollectionViewItem.m0000664000076500007650000000645112134764617021407 0ustar brains99brains99/** NSCollectionViewItem Copyright (C) 2013 Free Software Foundation, Inc. Author: Doug Simons (doug.simons@testplant.com) Frank LeGrand (frank.legrand@testplant.com) Date: February 2013 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import "AppKit/NSCollectionView.h" #import "AppKit/NSCollectionViewItem.h" #import "AppKit/NSImageView.h" #import "AppKit/NSTextField.h" @implementation NSCollectionViewItem - (void) awakeFromNib { } - (BOOL) isSelected { return _isSelected; } - (void) dealloc { DESTROY(textField); DESTROY(imageView); [super dealloc]; } - (NSCollectionView *) collectionView { return (NSCollectionView *)[[self view] superview]; } - (NSArray *) draggingImageComponents { // FIXME: We don't have NSDraggingImageComponent return [NSArray array]; } - (void) setSelected: (BOOL)flag { if (_isSelected != flag) { _isSelected = flag; } } - (id) representedObject { return [super representedObject]; } - (void) setRepresentedObject: (id)anObject { [super setRepresentedObject:anObject]; //[textField setStringValue:[self representedObject]]; } - (NSTextField *) textField { return textField; } - (void) setTextField: (NSTextField *)aTextField { if (textField != aTextField) { textField = aTextField; } } - (NSImageView *) imageView { return imageView; } - (void) setImageView: (NSImageView *)anImageView { if (imageView != anImageView) { imageView = anImageView; } } - (id) initWithCoder: (NSCoder *)aCoder { self = [super initWithCoder: aCoder]; if (nil != self) { if (YES == [aCoder allowsKeyedCoding]) { textField = [aCoder decodeObjectForKey: @"textField"]; imageView = [aCoder decodeObjectForKey: @"imageView"]; } else { textField = [aCoder decodeObject]; imageView = [aCoder decodeObject]; } } return self; } - (void)encodeWithCoder:(NSCoder *)aCoder { [super encodeWithCoder: aCoder]; if (YES == [aCoder allowsKeyedCoding]) { [aCoder encodeObject: textField forKey: @"textField"]; [aCoder encodeObject: imageView forKey: @"imageView"]; } else { [aCoder encodeObject: textField]; [aCoder encodeObject: imageView]; } } - (id) copyWithZone: (NSZone *)zone { NSData *itemAsData = [NSKeyedArchiver archivedDataWithRootObject: self]; NSCollectionViewItem *newItem = [NSKeyedUnarchiver unarchiveObjectWithData: itemAsData]; return newItem; } @end gnustep-gui-0.24.0/Source/NSMovie.m0000664000076500007650000000675712121417516016717 0ustar brains99brains99/** NSMovie Encapsulate a Quicktime movie Copyright (C) 2003 Free Software Foundation, Inc. Author: Fred Kiefer Date: March 2003 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import "AppKit/NSMovie.h" #import "AppKit/NSPasteboard.h" @implementation NSMovie + (NSArray*) movieUnfilteredFileTypes { return [NSArray arrayWithObject: @"mov"]; } + (NSArray*) movieUnfilteredPasteboardTypes { // FIXME return [NSArray arrayWithObject: @"QuickTimeMovie"]; } + (BOOL) canInitWithPasteboard: (NSPasteboard*)pasteboard { NSArray *pbTypes = [pasteboard types]; NSArray *myTypes = [self movieUnfilteredPasteboardTypes]; return ([pbTypes firstObjectCommonWithArray: myTypes] != nil); } - (id) initWithData: (NSData *)movie { if (movie == nil) { RELEASE(self); return nil; } [super init]; ASSIGN(_movie, movie); return self; } - (id) initWithMovie: (void*)movie { //FIXME return self; } - (id) initWithURL: (NSURL*)url byReference: (BOOL)byRef { NSData* data = [url resourceDataUsingCache: YES]; self = [self initWithData: data]; if (byRef) { ASSIGN(_url, url); } return self; } - (id) initWithPasteboard: (NSPasteboard*)pasteboard { NSString *type; NSData* data; type = [pasteboard availableTypeFromArray: [object_getClass(self) movieUnfilteredPasteboardTypes]]; if (type == nil) { //NSArray *array = [pasteboard propertyListForType: NSFilenamesPboardType]; // FIXME data = nil; } else { data = [pasteboard dataForType: type]; } if (data == nil) { RELEASE(self); return nil; } self = [self initWithData: data]; return self; } - (void) dealloc { TEST_RELEASE(_url); TEST_RELEASE(_movie); [super dealloc]; } - (void*) QTMovie { return (void*)[_movie bytes]; } - (NSURL*) URL { return _url; } // NSCopying protocoll - (id) copyWithZone: (NSZone *)zone { NSMovie *new = (NSMovie*)NSCopyObject (self, 0, zone); new->_movie = [_movie copyWithZone: zone]; new->_url = [_url copyWithZone: zone]; return new; } // NSCoding protocoll - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { // FIXME } else { [aCoder encodeObject: _movie]; [aCoder encodeObject: _url]; } } - (id) initWithCoder: (NSCoder*)aDecoder { if ([aDecoder allowsKeyedCoding]) { // FIXME } else { ASSIGN (_movie, [aDecoder decodeObject]); ASSIGN (_url, [aDecoder decodeObject]); } return self; } @end gnustep-gui-0.24.0/Source/nsimage-tiff.h0000664000076500007650000000536111554126532017735 0ustar brains99brains99/* nsimage-tiff.h Functions for dealing with tiff images Copyright (C) 1996 Free Software Foundation, Inc. Written by: Adam Fedor Date: Feb 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Warning: This header file should not be used for reading and writing tiff files. You should use the NSImage and NSBitmapImageRep classes for general reading/writting of tiff files. */ #ifndef _GNUstep_H_tiff #define _GNUstep_H_tiff #include #include /* Structure to store common information about a tiff. */ typedef struct { uint32 imageNumber; uint32 subfileType; uint32 width; uint32 height; uint16 bitsPerSample; /* number of bits per data channel */ uint16 samplesPerPixel; /* number of channels per pixel */ uint16 planarConfig; /* meshed or separate */ uint16 photoInterp; /* photometric interpretation of bitmap data, */ uint16 compression; uint16 extraSamples; /* Alpha */ int assocAlpha; int quality; /* compression quality (for jpeg) 1 to 255 */ int numImages; /* number of images in tiff */ int error; float xdpi; float ydpi; } NSTiffInfo; typedef struct { uint32 size; uint16 *red; uint16 *green; uint16 *blue; } NSTiffColormap; typedef char* realloc_data_callback(char* data, long size); extern TIFF* NSTiffOpenDataRead(const char* data, long size); extern TIFF* NSTiffOpenDataWrite(char **data, long *size); extern int NSTiffClose(TIFF* image); extern int NSTiffGetImageCount(TIFF* image); extern int NSTiffWrite(TIFF *image, NSTiffInfo *info, unsigned char *data); extern int NSTiffRead(TIFF *image, NSTiffInfo *info, unsigned char *data); extern NSTiffInfo* NSTiffGetInfo(int imageNumber, TIFF* image); extern NSTiffColormap* NSTiffGetColormap(TIFF* image); extern int NSTiffIsCodecConfigured(unsigned int codec); #endif // _GNUstep_H_tiff gnustep-gui-0.24.0/Source/NSButtonImageSource.h0000664000076500007650000000326711534147002021220 0ustar brains99brains99/* NSButtonImageSource.h Copyright (C) 2006 Free Software Foundation, Inc. Author: Richard Frith-Macdonald Date: 2006 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSImageSource #define _GNUstep_H_NSImageSource #import #import @class NSString, NSMutableDictionary; /** * Handle images for button cell theming. */ @interface NSButtonImageSource : NSObject { NSString *imageName; NSMutableDictionary *images; } + (BOOL) archiveButtonImageSourceWithName: (NSString*)name toDirectory: (NSString*)path; + (id) buttonImageSourceWithName: (NSString*)name; - (id) imageForState: (struct NSButtonState)state; @end @interface NSButtonCell (NSButtonImageSource) - (id) _buttonImageSource; - (void) _setButtonImageSource: (id)source; @end #endif /* _GNUstep_H_NSImageSource */ gnustep-gui-0.24.0/Source/NSGraphicsContext.m0000664000076500007650000014756412104255431020744 0ustar brains99brains99/** NSGraphicsContext GNUstep drawing context class. Copyright (C) 1998 Free Software Foundation, Inc. Written by: Adam Fedor Date: Nov 1998 Updated by: Richard Frith-Macdonald Date: Feb 1999 This file is part of the GNUStep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #define EXPOSE_NSThread_IVARS #import #import #import #import #import #import #import #import #import #import #import #import #import #import "AppKit/AppKitExceptions.h" #import "AppKit/NSGraphicsContext.h" #import "AppKit/NSAffineTransform.h" #import "AppKit/NSBezierPath.h" #import "AppKit/NSPrintInfo.h" #import "AppKit/NSPrintOperation.h" #import "AppKit/NSWindow.h" #import "AppKit/NSView.h" #import "AppKit/DPSOperators.h" #import "GNUstepGUI/GSVersion.h" #import "GNUstepGUI/GSDisplayServer.h" /* The memory zone where all global objects are allocated from (Contexts are also allocated from this zone) */ static NSZone *_globalGSZone = NULL; /* The current concrete class */ static Class defaultNSGraphicsContextClass = NULL; /* Class variable for holding pointers to method functions */ static NSMutableDictionary *classMethodTable; /* Lock for use when creating contexts */ static NSRecursiveLock *contextLock = nil; #ifndef GNUSTEP_BASE_LIBRARY static NSString *NSGraphicsContextThreadKey = @"NSGraphicsContextThreadKey"; #endif static NSString *NSGraphicsContextStackKey = @"NSGraphicsContextStackKey"; /* Colorspace constants */ NSString *GSColorSpaceName = @"GSColorSpaceName"; NSString *GSColorSpaceWhitePoint = @"GSColorSpaceWhitePoint"; NSString *GSColorSpaceBlackPoint = @"GSColorSpaceBlackPoint"; NSString *GSColorSpaceGamma = @"GSColorSpaceGamma"; NSString *GSColorSpaceMatrix = @"GSColorSpaceMatrix"; NSString *GSColorSpaceRange = @"GSColorSpaceRange"; NSString *GSColorSpaceComponents = @"GSColorSpaceComponents"; NSString *GSColorSpaceProfile = @"GSColorSpaceProfile"; NSString *GSAlternateColorSpace = @"GSAlternateColorSpace"; NSString *GSBaseColorSpace = @"GSBaseColorSpace"; NSString *GSColorSpaceColorTable = @"GSColorSpaceColorTable"; /* * Function for rapid access to current graphics context. */ NSGraphicsContext *GSCurrentContext(void) { #ifdef GNUSTEP_BASE_LIBRARY /* * gstep-base has a faster mechanism to get the current thread. */ NSThread *th = GSCurrentThread(); return (NSGraphicsContext*) th->_gcontext; #else NSMutableDictionary *dict = [[NSThread currentThread] threadDictionary]; return (NSGraphicsContext*) [dict objectForKey: NSGraphicsContextThreadKey]; #endif } @interface NSGraphicsContext (Private) + (gsMethodTable *) _initializeMethodTable; @end /** NSGraphicsContext

This is an abstract class which provides a framework for a device independant drawing.

In addition, this class provides methods to perform the actual drawing. As a convenience, you can also access these through various function interfaces. One is a Display Postscript interface using PS and DPS operations. Another is a Quartz interface (not yet written).

*/ @implementation NSGraphicsContext + (void) initialize { if (contextLock == nil) { [gnustep_global_lock lock]; if (contextLock == nil) { contextLock = [NSRecursiveLock new]; defaultNSGraphicsContextClass = [NSGraphicsContext class]; _globalGSZone = NSDefaultMallocZone(); classMethodTable = [[NSMutableDictionary allocWithZone: _globalGSZone] init]; } [gnustep_global_lock unlock]; } } + (void) initializeBackend { [self subclassResponsibility: _cmd]; } /** Set the concrete subclass that will provide the device dependant implementation. */ + (void) setDefaultContextClass: (Class)defaultContextClass { defaultNSGraphicsContextClass = defaultContextClass; } /** Set the current context that will handle drawing. */ + (void) setCurrentContext: (NSGraphicsContext *)context { #ifdef GNUSTEP_BASE_LIBRARY /* * gstep-base has a faster mechanism to get the current thread. */ NSThread *th = GSCurrentThread(); ASSIGN(th->_gcontext, context); #else NSMutableDictionary *dict = [[NSThread currentThread] threadDictionary]; [dict setObject: context forKey: NSGraphicsContextThreadKey]; #endif } /** Returns the current context. Also see the convienience function GSCurrentContext() */ + (NSGraphicsContext *) currentContext { return GSCurrentContext(); } /** Returns YES if the current context is a display context */ + (BOOL) currentContextDrawingToScreen { return [GSCurrentContext() isDrawingToScreen]; } /**

Create a graphics context with attributes, which contains key/value pairs which describe the specifics of how the context is to be initialized.

*/ + (NSGraphicsContext *) graphicsContextWithAttributes: (NSDictionary *)attributes { NSGraphicsContext *ctxt; ctxt = [[self alloc] initWithContextInfo: attributes]; return AUTORELEASE(ctxt); } /** Create graphics context with attributes speficied by aWindow's device description. */ + (NSGraphicsContext *) graphicsContextWithWindow: (NSWindow *)aWindow { return [self graphicsContextWithAttributes: [NSDictionary dictionaryWithObject: aWindow forKey: NSGraphicsContextDestinationAttributeName]]; } + (NSGraphicsContext *) graphicsContextWithBitmapImageRep: (NSBitmapImageRep *)bitmap { return [self graphicsContextWithAttributes: [NSDictionary dictionaryWithObject: bitmap forKey: NSGraphicsContextDestinationAttributeName]]; } + (NSGraphicsContext *) graphicsContextWithGraphicsPort: (void *)port flipped: (BOOL)flag { NSGraphicsContext *new; // FIXME new = [self graphicsContextWithAttributes: nil]; new->_graphicsPort = port; new->_isFlipped = flag; return new; } + (void) restoreGraphicsState { NSGraphicsContext *ctxt; NSMutableDictionary *dict = [[NSThread currentThread] threadDictionary]; NSMutableArray *stack = [dict objectForKey: NSGraphicsContextStackKey]; if (stack == nil) { [NSException raise: NSGenericException format: @"restoreGraphicsState without previous save"]; } // might be nil, i.e. no current context ctxt = [stack lastObject]; [NSGraphicsContext setCurrentContext: ctxt]; if (ctxt) { [stack removeLastObject]; [ctxt restoreGraphicsState]; } } + (void) saveGraphicsState { NSGraphicsContext *ctxt; NSMutableDictionary *dict = [[NSThread currentThread] threadDictionary]; NSMutableArray *stack = [dict objectForKey: NSGraphicsContextStackKey]; if (stack == nil) { stack = [[NSMutableArray allocWithZone: _globalGSZone] init]; [dict setObject: stack forKey: NSGraphicsContextStackKey]; RELEASE(stack); } // might be nil, i.e. no current context ctxt = GSCurrentContext(); if (ctxt) { [ctxt saveGraphicsState]; [stack addObject: ctxt]; } } + (void) setGraphicsState: (NSInteger)graphicsState { /* FIXME: Need to keep a table of which context goes with a graphicState, or perhaps we could rely on the backend? */ [self notImplemented: _cmd]; } + (id) alloc { return [self allocWithZone: _globalGSZone]; } + (id) allocWithZone: (NSZone*)z { if (self == [NSGraphicsContext class]) { NSAssert(defaultNSGraphicsContextClass, @"Internal Error: No default NSGraphicsContext set\n"); return [defaultNSGraphicsContextClass allocWithZone: z]; } else return [super allocWithZone: z]; } - (void) dealloc { DESTROY(usedFonts); DESTROY(focus_stack); DESTROY(context_data); DESTROY(context_info); [super dealloc]; } - (id) init { return [self initWithContextInfo: nil]; } /** */ - (id) initWithContextInfo: (NSDictionary *)info { self = [super init]; if (self != nil) { ASSIGN(context_info, info); focus_stack = [[NSMutableArray allocWithZone: [self zone]] initWithCapacity: 1]; usedFonts = nil; /* * The classMethodTable dictionary and the list of all contexts must both * be protected from other threads. */ [contextLock lock]; methods = [[classMethodTable objectForKey: [self class]] pointerValue]; if (methods == 0) { methods = [[self class] _initializeMethodTable]; [classMethodTable setObject: [NSValue valueWithPointer: methods] forKey: [self class]]; } [contextLock unlock]; } return self; } - (NSDictionary *) attributes { return context_info; } - (void) flushGraphics { [self subclassResponsibility: _cmd]; } - (void *) graphicsPort { return _graphicsPort; } - (BOOL) isDrawingToScreen { return NO; } - (void) restoreGraphicsState { [self DPSgrestore]; } - (void) saveGraphicsState { [self DPSgsave]; } - (void *) focusStack { return focus_stack; } - (void) setFocusStack: (void *)stack { ASSIGN(focus_stack, (id)stack); } - (void) setImageInterpolation: (NSImageInterpolation)interpolation { _interp = interpolation; } - (NSImageInterpolation) imageInterpolation { return _interp; } - (void) setShouldAntialias: (BOOL)antialias { _antialias = antialias; } - (BOOL) shouldAntialias { return _antialias; } - (NSPoint) patternPhase { return _patternPhase; } - (void) setPatternPhase: (NSPoint)phase { _patternPhase = phase; } - (BOOL) isFlipped { NSView *focusView = [self focusView]; if (focusView) return [focusView isFlipped]; else return _isFlipped; } - (NSCompositingOperation) compositingOperation { return _compositingOperation; } - (void) setCompositingOperation: (NSCompositingOperation)operation { _compositingOperation = operation; } - (NSView*) focusView { return [focus_stack lastObject]; } - (void) lockFocusView: (NSView*)aView inRect: (NSRect)rect { [focus_stack addObject: aView]; } - (void) unlockFocusView: (NSView*)aView needsFlush: (BOOL)flush { [focus_stack removeLastObject]; } - (void) useFont: (NSString*)name { if ([self isDrawingToScreen] == YES) return; if (usedFonts == nil) usedFonts = [[NSMutableSet alloc] initWithCapacity: 2]; [usedFonts addObject: name]; } - (void) resetUsedFonts { [usedFonts removeAllObjects]; } - (NSSet *) usedFonts { return usedFonts; } /* Private backend methods */ /** Private backend method. Typically this is called by the window server to tell the graphics context that it should flush output to a window indicated by the device pointer. The device pointer is an opaque type setup by the context so that it knows which context and/or buffer should be. */ + (void) handleExposeRect: (NSRect)rect forDriver: (void *)driver { } @end @implementation NSGraphicsContext (Private) /* Build up method table for fast access to methods. Cast to (void *) to avoid compiler warnings */ + (gsMethodTable *) _initializeMethodTable { gsMethodTable methodTable; gsMethodTable *mptr; #define GET_IMP(X) ((void*) [self instanceMethodForSelector: (X)]) /* ----------------------------------------------------------------------- */ /* Color operations */ /* ----------------------------------------------------------------------- */ methodTable.DPScurrentalpha_ = GET_IMP(@selector(DPScurrentalpha:)); methodTable.DPScurrentcmykcolor____ = GET_IMP(@selector(DPScurrentcmykcolor::::)); methodTable.DPScurrentgray_ = GET_IMP(@selector(DPScurrentgray:)); methodTable.DPScurrenthsbcolor___ = GET_IMP(@selector(DPScurrenthsbcolor:::)); methodTable.DPScurrentrgbcolor___ = GET_IMP(@selector(DPScurrentrgbcolor:::)); methodTable.DPSsetalpha_ = GET_IMP(@selector(DPSsetalpha:)); methodTable.DPSsetcmykcolor____ = GET_IMP(@selector(DPSsetcmykcolor::::)); methodTable.DPSsetgray_ = GET_IMP(@selector(DPSsetgray:)); methodTable.DPSsethsbcolor___ = GET_IMP(@selector(DPSsethsbcolor:::)); methodTable.DPSsetrgbcolor___ = GET_IMP(@selector(DPSsetrgbcolor:::)); methodTable.GSSetFillColorspace_ = GET_IMP(@selector(GSSetFillColorspace:)); methodTable.GSSetStrokeColorspace_ = GET_IMP(@selector(GSSetStrokeColorspace:)); methodTable.GSSetFillColor_ = GET_IMP(@selector(GSSetFillColor:)); methodTable.GSSetStrokeColor_ = GET_IMP(@selector(GSSetStrokeColor:)); /* ----------------------------------------------------------------------- */ /* Text operations */ /* ----------------------------------------------------------------------- */ methodTable.DPSashow___ = GET_IMP(@selector(DPSashow:::)); methodTable.DPSawidthshow______ = GET_IMP(@selector(DPSawidthshow::::::)); methodTable.DPScharpath__ = GET_IMP(@selector(DPScharpath::)); methodTable.DPSshow_ = GET_IMP(@selector(DPSshow:)); methodTable.DPSwidthshow____ = GET_IMP(@selector(DPSwidthshow::::)); methodTable.DPSxshow___ = GET_IMP(@selector(DPSxshow:::)); methodTable.DPSxyshow___ = GET_IMP(@selector(DPSxyshow:::)); methodTable.DPSyshow___ = GET_IMP(@selector(DPSyshow:::)); methodTable.GSSetCharacterSpacing_ = GET_IMP(@selector(GSSetCharacterSpacing:)); methodTable.GSSetFont_ = GET_IMP(@selector(GSSetFont:)); methodTable.GSSetFontSize_ = GET_IMP(@selector(GSSetFontSize:)); methodTable.GSGetTextCTM = GET_IMP(@selector(GSGetTextCTM)); methodTable.GSGetTextPosition = GET_IMP(@selector(GSGetTextPosition)); methodTable.GSSetTextCTM_ = GET_IMP(@selector(GSSetTextCTM:)); methodTable.GSSetTextDrawingMode_ = GET_IMP(@selector(GSSetTextDrawingMode:)); methodTable.GSSetTextPosition_ = GET_IMP(@selector(GSSetTextPosition:)); methodTable.GSShowText__ = GET_IMP(@selector(GSShowText::)); methodTable.GSShowGlyphs__ = GET_IMP(@selector(GSShowGlyphs::)); methodTable.GSShowGlyphsWithAdvances__ = GET_IMP(@selector(GSShowGlyphsWithAdvances:::)); /* ----------------------------------------------------------------------- */ /* Gstate Handling */ /* ----------------------------------------------------------------------- */ methodTable.DPSgrestore = GET_IMP(@selector(DPSgrestore)); methodTable.DPSgsave = GET_IMP(@selector(DPSgsave)); methodTable.DPSinitgraphics = GET_IMP(@selector(DPSinitgraphics)); methodTable.DPSsetgstate_ = GET_IMP(@selector(DPSsetgstate:)); methodTable.GSDefineGState = GET_IMP(@selector(GSDefineGState)); methodTable.GSUndefineGState_ = GET_IMP(@selector(GSUndefineGState:)); methodTable.GSReplaceGState_ = GET_IMP(@selector(GSReplaceGState:)); /* ----------------------------------------------------------------------- */ /* Gstate operations */ /* ----------------------------------------------------------------------- */ methodTable.DPScurrentflat_ = GET_IMP(@selector(DPScurrentflat:)); methodTable.DPScurrentlinecap_ = GET_IMP(@selector(DPScurrentlinecap:)); methodTable.DPScurrentlinejoin_ = GET_IMP(@selector(DPScurrentlinejoin:)); methodTable.DPScurrentlinewidth_ = GET_IMP(@selector(DPScurrentlinewidth:)); methodTable.DPScurrentmiterlimit_ = GET_IMP(@selector(DPScurrentmiterlimit:)); methodTable.DPScurrentpoint__ = GET_IMP(@selector(DPScurrentpoint::)); methodTable.DPScurrentstrokeadjust_ = GET_IMP(@selector(DPScurrentstrokeadjust:)); methodTable.DPSsetdash___ = GET_IMP(@selector(DPSsetdash:::)); methodTable.DPSsetflat_ = GET_IMP(@selector(DPSsetflat:)); methodTable.DPSsethalftonephase__ = GET_IMP(@selector(DPSsethalftonephase::)); methodTable.DPSsetlinecap_ = GET_IMP(@selector(DPSsetlinecap:)); methodTable.DPSsetlinejoin_ = GET_IMP(@selector(DPSsetlinejoin:)); methodTable.DPSsetlinewidth_ = GET_IMP(@selector(DPSsetlinewidth:)); methodTable.DPSsetmiterlimit_ = GET_IMP(@selector(DPSsetmiterlimit:)); methodTable.DPSsetstrokeadjust_ = GET_IMP(@selector(DPSsetstrokeadjust:)); /* ----------------------------------------------------------------------- */ /* Matrix operations */ /* ----------------------------------------------------------------------- */ methodTable.DPSconcat_ = GET_IMP(@selector(DPSconcat:)); methodTable.DPSinitmatrix = GET_IMP(@selector(DPSinitmatrix)); methodTable.DPSrotate_ = GET_IMP(@selector(DPSrotate:)); methodTable.DPSscale__ = GET_IMP(@selector(DPSscale::)); methodTable.DPStranslate__ = GET_IMP(@selector(DPStranslate::)); methodTable.GSCurrentCTM = GET_IMP(@selector(GSCurrentCTM)); methodTable.GSSetCTM_ = GET_IMP(@selector(GSSetCTM:)); methodTable.GSConcatCTM_ = GET_IMP(@selector(GSConcatCTM:)); /* ----------------------------------------------------------------------- */ /* Paint operations */ /* ----------------------------------------------------------------------- */ methodTable.DPSarc_____ = GET_IMP(@selector(DPSarc:::::)); methodTable.DPSarcn_____ = GET_IMP(@selector(DPSarcn:::::)); methodTable.DPSarct_____ = GET_IMP(@selector(DPSarct:::::)); methodTable.DPSclip = GET_IMP(@selector(DPSclip)); methodTable.DPSclosepath = GET_IMP(@selector(DPSclosepath)); methodTable.DPScurveto______ = GET_IMP(@selector(DPScurveto::::::)); methodTable.DPSeoclip = GET_IMP(@selector(DPSeoclip)); methodTable.DPSeofill = GET_IMP(@selector(DPSeofill)); methodTable.DPSfill = GET_IMP(@selector(DPSfill)); methodTable.DPSflattenpath = GET_IMP(@selector(DPSflattenpath)); methodTable.DPSinitclip = GET_IMP(@selector(DPSinitclip)); methodTable.DPSlineto__ = GET_IMP(@selector(DPSlineto::)); methodTable.DPSmoveto__ = GET_IMP(@selector(DPSmoveto::)); methodTable.DPSnewpath = GET_IMP(@selector(DPSnewpath)); methodTable.DPSpathbbox____ = GET_IMP(@selector(DPSpathbbox::::)); methodTable.DPSrcurveto______ = GET_IMP(@selector(DPSrcurveto::::::)); methodTable.DPSrectclip____ = GET_IMP(@selector(DPSrectclip::::)); methodTable.DPSrectfill____ = GET_IMP(@selector(DPSrectfill::::)); methodTable.DPSrectstroke____ = GET_IMP(@selector(DPSrectstroke::::)); methodTable.DPSreversepath = GET_IMP(@selector(DPSreversepath)); methodTable.DPSrlineto__ = GET_IMP(@selector(DPSrlineto::)); methodTable.DPSrmoveto__ = GET_IMP(@selector(DPSrmoveto::)); methodTable.DPSstroke = GET_IMP(@selector(DPSstroke)); methodTable.DPSshfill = GET_IMP(@selector(DPSshfill:)); methodTable.GSSendBezierPath_ = GET_IMP(@selector(GSSendBezierPath:)); methodTable.GSRectClipList__ = GET_IMP(@selector(GSRectClipList::)); methodTable.GSRectFillList__ = GET_IMP(@selector(GSRectFillList::)); /* ----------------------------------------------------------------------- */ /* Window system ops */ /* ----------------------------------------------------------------------- */ methodTable.GSCurrentDevice___ = GET_IMP(@selector(GSCurrentDevice:::)); methodTable.DPScurrentoffset__ = GET_IMP(@selector(DPScurrentoffset::)); methodTable.GSSetDevice___ = GET_IMP(@selector(GSSetDevice:::)); methodTable.DPSsetoffset__ = GET_IMP(@selector(DPSsetoffset::)); /*-------------------------------------------------------------------------*/ /* Graphics Extensions Ops */ /*-------------------------------------------------------------------------*/ methodTable.DPScomposite________ = GET_IMP(@selector(DPScomposite::::::::)); methodTable.DPScompositerect_____ = GET_IMP(@selector(DPScompositerect:::::)); methodTable.DPSdissolve________ = GET_IMP(@selector(DPSdissolve::::::::)); methodTable.GSDrawImage__ = GET_IMP(@selector(GSDrawImage::)); /* ----------------------------------------------------------------------- */ /* Postscript Client functions */ /* ----------------------------------------------------------------------- */ methodTable.DPSPrintf__ = GET_IMP(@selector(DPSPrintf::)); methodTable.DPSWriteData__ = GET_IMP(@selector(DPSWriteData::)); /* ----------------------------------------------------------------------- */ /* NSGraphics Ops */ /* ----------------------------------------------------------------------- */ methodTable.GSReadRect_ = GET_IMP(@selector(GSReadRect:)); methodTable.NSBeep = GET_IMP(@selector(NSBeep)); /* Context helper wraps */ methodTable.GSWSetViewIsFlipped_ = GET_IMP(@selector(GSWSetViewIsFlipped:)); methodTable.GSWViewIsFlipped = GET_IMP(@selector(GSWViewIsFlipped)); /* * Render Bitmap Images */ methodTable.NSDrawBitmap___________ = GET_IMP(@selector(NSDrawBitmap:::::::::::)); mptr = NSZoneMalloc(_globalGSZone, sizeof(gsMethodTable)); memcpy(mptr, &methodTable, sizeof(gsMethodTable)); return mptr; } - (id) subclassResponsibility: (SEL)aSel { [NSException raise: GSWindowServerInternalException format: @"subclass %s(%s) should override %s", class_getName(object_getClass(self)), GSObjCIsInstance(self) ? "instance" : "class", sel_getName(aSel)]; return nil; } @end /* * The 'Ops' catagory contains the methods to implement all the * PostScript functions. In this abstract class, these will all * raise an exception. Concrete instances of the NSGraphicsContext * class should override these methods in order to implement the * PostScript functions. */ @implementation NSGraphicsContext (Ops) /* ----------------------------------------------------------------------- */ /* Color operations */ /* ----------------------------------------------------------------------- */ /** Returns the current alpha component (DPS). */ - (void) DPScurrentalpha: (CGFloat *)a { [self subclassResponsibility: _cmd]; } /** Returns the current color according to the CMYK color model (DPS). */ - (void) DPScurrentcmykcolor: (CGFloat*)c : (CGFloat*)m : (CGFloat*)y : (CGFloat*)k { [self subclassResponsibility: _cmd]; } /** Returns the gray-level equivalent in the current color space. The value may depend on the current color space and may be 0 if the current color space has no notion of a gray value (DPS) */ - (void) DPScurrentgray: (CGFloat*)gray { [self subclassResponsibility: _cmd]; } /** Returns the current color according to the HSB color model (DPS). */ - (void) DPScurrenthsbcolor: (CGFloat*)h : (CGFloat*)s : (CGFloat*)b { [self subclassResponsibility: _cmd]; } /** Returns the current color according to the RGB color model (DPS). */ - (void) DPScurrentrgbcolor: (CGFloat*)r : (CGFloat*)g : (CGFloat*)b { [self subclassResponsibility: _cmd]; } /** Sets the alpha drawing component. For this and other color setting commands that have no differentiation between fill and stroke colors, both the fill and stroke alpha are set (DPS). */ - (void) DPSsetalpha: (CGFloat)a { [self subclassResponsibility: _cmd]; } /** Sets the current colorspace to Device CMYK and the current color based on the indicated values. For this and other color setting commands that have no differentiation between fill and stroke colors, both the fill and stroke colors are set (DPS). */ - (void) DPSsetcmykcolor: (CGFloat)c : (CGFloat)m : (CGFloat)y : (CGFloat)k { [self subclassResponsibility: _cmd]; } /** Sets the current colorspace to Device Gray and the current gray value (DPS). */ - (void) DPSsetgray: (CGFloat)gray { [self subclassResponsibility: _cmd]; } /** Sets the current colorspace to Device RGB and the current color based on the indicated values (DPS). */ - (void) DPSsethsbcolor: (CGFloat)h : (CGFloat)s : (CGFloat)b { [self subclassResponsibility: _cmd]; } /** Sets the current colorspace to Device RGB and the current color based on the indicated values (DPS). */ - (void) DPSsetrgbcolor: (CGFloat)r : (CGFloat)g : (CGFloat)b { [self subclassResponsibility: _cmd]; } - (void) GSSetPatterColor: (NSImage*)image { [self subclassResponsibility: _cmd]; } /**

Sets the colorspace for fill operations based on values in the supplied dictionary dict.

For device colorspaces (GSDeviceGray, GSDeviceRGB, GSDeviceCMYK), only the name of the colorspace needs to be set using the GSColorSpaceName key.

Other colorspaces will be documented later (Quartz).

*/ - (void) GSSetFillColorspace: (void *)spaceref { [self subclassResponsibility: _cmd]; } /** Sets the colorspace for stroke operations based on the values in the supplied dictionary. See -GSSetFillColorspace: for a description of the values that need to be supplied (Quartz). */ - (void) GSSetStrokeColorspace: (void *)spaceref { [self subclassResponsibility: _cmd]; } /** Sets the current color for fill operations. The values array should have n components, where n corresponds to the number of color components required to specify the color in the current colorspace (Quartz). */ - (void) GSSetFillColor: (const CGFloat *)values { [self subclassResponsibility: _cmd]; } /** Sets the current color for stroke operations. The values array should have n components, where n corresponds to the number of color components required to specify the color in the current colorspace (Quartz). */ - (void) GSSetStrokeColor: (const CGFloat *)values { [self subclassResponsibility: _cmd]; } /* ----------------------------------------------------------------------- */ /* Text operations */ /* ----------------------------------------------------------------------- */ /** Displays a string as in DPSshow, except that (x,y) is added to the advancement of every glyph. An alternative means of achieving the same effect is to use the -GSSetCharacterSpacing: method. Either approach should be more efficient that using -DPSshow: with appropriate -DPSrmoveto:: operations. */ - (void) DPSashow: (CGFloat)x : (CGFloat)y : (const char *)s { [self subclassResponsibility: _cmd]; } /** Displays a string as in a combination of DPSashow and DPSwidthshow: (ax,ay) is added to the advancement of every glyph, while (cx,cy) is also added to the advancement for character c's glyph specifically. Using this method should be more efficient that using -DPSshow: with appropriate -DPSrmoveto:: operations. */ - (void) DPSawidthshow: (CGFloat)cx : (CGFloat)cy : (int)c : (CGFloat)ax : (CGFloat)ay : (const char *)s { [self subclassResponsibility: _cmd]; } /** Appends to the current path a path that is equivalent to the outlines of the glyphs in the string. This results in a path that can be used for stroking, filling or clipping (DPS). */ - (void) DPScharpath: (const char *)s : (int)b { [self subclassResponsibility: _cmd]; } - (void) appendBezierPathWithPackedGlyphs: (const char *)packedGlyphs path: (NSBezierPath*)aPath { [self subclassResponsibility: _cmd]; } /** Display the string s using the current font (DPS). */ - (void) DPSshow: (const char *)s { [self subclassResponsibility: _cmd]; } /** Displays a string as in DPSshow, except that, for character c only, the glpyh x and y advancement is determined by the values (x,y), instead of by the glyph itself. This is often used to adjust the length of a line of text by changing the width of the space character. Using this method should be more efficient than using -DPSshow: with appropriate -DPSrmoveto:: operations. */ - (void) DPSwidthshow: (CGFloat)x : (CGFloat)y : (int)c : (const char *)s { [self subclassResponsibility: _cmd]; } /** Displays a string as in DPSshow, except that the glyph x advancement is determined by the values in numarray, one for each glyph, instead of by the glyphs themselves. size should be equal to the length of s in glyphs. Using this method should be more efficient than using -DPSshow: with appropriate -DPSrmoveto:: operations. */ - (void) DPSxshow: (const char *)s : (const CGFloat*)numarray : (int)size { [self subclassResponsibility: _cmd]; } /** Displays a string as in DPSshow, except that the glyph x and y advancement is determined by the values in numarray, one x and one y for each glyph, in alternating order, instead of by the glyphs themselves. size should be equal to the length of s in glyphs. Using this method should be more efficient than using -DPSshow: with appropriate -DPSrmoveto:: operations. */ - (void) DPSxyshow: (const char *)s : (const CGFloat*)numarray : (int)size { [self subclassResponsibility: _cmd]; } /** Displays a string as in DPSshow, except that the glyph y advancement is determined by the values in numarray, one for each glyph, instead of by the glyphs themselves. size should be equal to the length of s in glyphs. Using this method should be more efficient than using -DPSshow: with appropriate -DPSrmoveto:: operations. */ - (void) DPSyshow: (const char *)s : (const CGFloat*)numarray : (int)size { [self subclassResponsibility: _cmd]; } /** Use this method to set the additional spacing between characters (glyphs). This spacing is added to the normal spacing for each character. Units are in text-space coordinate system. (Quartz). */ - (void) GSSetCharacterSpacing: (CGFloat)extra { [self subclassResponsibility: _cmd]; } /** Set the current font for drawing glyphs. (DPS, Quartz). */ - (void) GSSetFont: (void *)fontref { [self subclassResponsibility: _cmd]; } /** Set the font size of the current NSFont used for drawing glyphs. (DPS, Quartz). */ - (void) GSSetFontSize: (CGFloat)size { [self subclassResponsibility: _cmd]; } /**

Returns the transfer function for transforming text from text space to user space. See -GSSetTextCTM: for additiona information. (Quartz).

*/ - (NSAffineTransform *) GSGetTextCTM { [self subclassResponsibility: _cmd]; return nil; } /** Returns the location at which text will be drawn. In text-space coordinates. (Quartz). */ - (NSPoint) GSGetTextPosition { [self subclassResponsibility: _cmd]; return NSMakePoint(0,0); } /**

Set the transfer function for transforming text from text space to user space. This transform is only applied to text objects and is in addition to the normal coordinate transform matrix. When drawing text, this transform is applied before the normal CTM.

The text matrix can be changed by either modifying it directly, or just by drawing text, in which case the tx and ty offset veriables are modified to point to the location of the next character that could be rendered (Quartz).

*/ - (void) GSSetTextCTM: (NSAffineTransform *)ctm { [self subclassResponsibility: _cmd]; } /** Set the current text drawing mode. The mode can be one of several values that fill/stroke the text or add it to the current clipping path. (Quartz). */ - (void) GSSetTextDrawingMode: (GSTextDrawingMode)mode { [self subclassResponsibility: _cmd]; } /** Set the location at which text will be drawn, in text-space coordinates. This routine updates the current text coordinate matrix. (Quartz). */ - (void) GSSetTextPosition: (NSPoint)loc { [self subclassResponsibility: _cmd]; } /** Paints text represented by the characters in string in the current font. (Quartz). */ - (void) GSShowText: (const char *)string : (size_t) length { [self subclassResponsibility: _cmd]; } /** Paints the glyphs using the current font. (Quartz). */ - (void) GSShowGlyphs: (const NSGlyph *)glyphs : (size_t) length { [self subclassResponsibility: _cmd]; } /** Paints the glyphs with the specified advances using the current font. (Quartz). */ - (void) GSShowGlyphsWithAdvances: (const NSGlyph *)glyphs : (const NSSize *)advances : (size_t) length { [self subclassResponsibility: _cmd]; } /* ----------------------------------------------------------------------- */ /* Gstate Handling */ /* ----------------------------------------------------------------------- */ /** Pops a previously saved gstate from the gstate stack and makes it current. Drawing information in the previously saved gstate becomes the current information. (DPS, Quartz). */ - (void) DPSgrestore { [self subclassResponsibility: _cmd]; } /** Saves (pushes) a copy of the current gstate information onto the gstate stack. This saves drawing information contained in the gstate, such as the current path, ctm and colors. (DPS, Quartz). */ - (void) DPSgsave { [self subclassResponsibility: _cmd]; } - (void) DPSinitgraphics { [self subclassResponsibility: _cmd]; } /** Makes the gstate indicated by the tag gst the current gstate. Note that the gstate is copied, so that changes to either gstate do not affect the other. (DPS, Quartz). */ - (void) DPSsetgstate: (NSInteger)gst { [self subclassResponsibility: _cmd]; } /** Creates a copy of the current gstate and associates it with a tag, which is given in the return value. This tag can later be used in -DPSsetgstate: to set the gstate as being current again. (DPS, Quartz). */ - (NSInteger) GSDefineGState { [self subclassResponsibility: _cmd]; return 0; } /** Disassociates the tag gst with it's gstate and destroys the gstate object. The tag will no longer be valid and should not be used to refer to the gstate again. (DPS, Quartz). */ - (void) GSUndefineGState: (NSInteger)gst { [self subclassResponsibility: _cmd]; } /** Replaces the gstate refered to by the tag gst with the current gstate. The former gstate is destroyed. (DPS, Quartz). */ - (void) GSReplaceGState: (NSInteger)gst { [self subclassResponsibility: _cmd]; } /* ----------------------------------------------------------------------- */ /* Gstate operations */ /* ----------------------------------------------------------------------- */ /** Returns the current flattness parameter, which controls how curved lines are drawn. (DPS, Quartz). */ - (void) DPScurrentflat: (CGFloat*)flatness { [self subclassResponsibility: _cmd]; } /** Returns the current linecap value. (DPS, Quartz). */ - (void) DPScurrentlinecap: (int*)linecap { [self subclassResponsibility: _cmd]; } /** Returns the current linejoin value. (DPS, Quartz). */ - (void) DPScurrentlinejoin: (int*)linejoin { [self subclassResponsibility: _cmd]; } /** Returns the current line width. (DPS, Quartz). */ - (void) DPScurrentlinewidth: (CGFloat*)width { [self subclassResponsibility: _cmd]; } /** Returns the current linecap value. (DPS, Quartz). */ - (void) DPScurrentmiterlimit: (CGFloat*)limit { [self subclassResponsibility: _cmd]; } /** Returns the current point. (DPS, Quartz). */ - (void) DPScurrentpoint: (CGFloat*)x : (CGFloat*)y { [self subclassResponsibility: _cmd]; } /** Returns the strokeadjust value. (DPS). */ - (void) DPScurrentstrokeadjust: (int*)b { [self subclassResponsibility: _cmd]; } /** Set the pattern for line dashes like the Postscript setdash operator. (DPS, Quartz). */ - (void) DPSsetdash: (const CGFloat*)pat : (NSInteger)size : (CGFloat)offset { [self subclassResponsibility: _cmd]; } /** Sets the current flattness parameter, which controls how curved lines are drawn. (DPS, Quartz). */ - (void) DPSsetflat: (CGFloat)flatness { [self subclassResponsibility: _cmd]; } - (void) DPSsethalftonephase: (CGFloat)x : (CGFloat)y { [self subclassResponsibility: _cmd]; } /** Set the current linecap value. (DPS, Quartz). */ - (void) DPSsetlinecap: (int)linecap { [self subclassResponsibility: _cmd]; } /** Set the current linejoin value. (DPS, Quartz). */ - (void) DPSsetlinejoin: (int)linejoin { [self subclassResponsibility: _cmd]; } /** Set the current line width. (DPS, Quartz). */ - (void) DPSsetlinewidth: (CGFloat)width { [self subclassResponsibility: _cmd]; } /** Set the current meter limit value. (DPS, Quartz). */ - (void) DPSsetmiterlimit: (CGFloat)limit { [self subclassResponsibility: _cmd]; } - (void) DPSsetstrokeadjust: (int)b { [self subclassResponsibility: _cmd]; } /* ----------------------------------------------------------------------- */ /* Matrix operations */ /* ----------------------------------------------------------------------- */ /** Concatenates the coordinate transform represented by the matrix m with the current coordinate transform. (DPS). */ - (void) DPSconcat: (const CGFloat*)m { [self subclassResponsibility: _cmd]; } /** Sets the coordinate transform matrix to the initial values for the particular context */ - (void) DPSinitmatrix { [self subclassResponsibility: _cmd]; } /** Rotate the coordinate system. (DPS). */ - (void) DPSrotate: (CGFloat)angle { [self subclassResponsibility: _cmd]; } /** Scale the coordinate system. (DPS). */ - (void) DPSscale: (CGFloat)x : (CGFloat)y { [self subclassResponsibility: _cmd]; } /** Translate the coordinate system. (DPS). */ - (void) DPStranslate: (CGFloat)x : (CGFloat)y { [self subclassResponsibility: _cmd]; } /** Returns the current coordinate transform matrix. (Quartz). */ - (NSAffineTransform *) GSCurrentCTM { [self subclassResponsibility: _cmd]; return nil; } /** Sets the coordinate transform matrix which describes how graphics will be transformed into device coordinates. (Quartz). */ - (void) GSSetCTM: (NSAffineTransform *)ctm { [self subclassResponsibility: _cmd]; } /** Concatenates the matrix ctm onto the current coordinate transform matrix. (Quartz). */ - (void) GSConcatCTM: (NSAffineTransform *)ctm { [self subclassResponsibility: _cmd]; } /* ----------------------------------------------------------------------- */ /* Paint operations */ /* ----------------------------------------------------------------------- */ - (void) DPSarc: (CGFloat)x : (CGFloat)y : (CGFloat)r : (CGFloat)angle1 : (CGFloat)angle2 { [self subclassResponsibility: _cmd]; } - (void) DPSarcn: (CGFloat)x : (CGFloat)y : (CGFloat)r : (CGFloat)angle1 : (CGFloat)angle2 { [self subclassResponsibility: _cmd]; } - (void) DPSarct: (CGFloat)x1 : (CGFloat)y1 : (CGFloat)x2 : (CGFloat)y2 : (CGFloat)r { [self subclassResponsibility: _cmd]; } /** Clip to the current path. (DPS, Quartz). */ - (void) DPSclip { [self subclassResponsibility: _cmd]; } - (void) DPSclosepath { [self subclassResponsibility: _cmd]; } - (void) DPScurveto: (CGFloat)x1 : (CGFloat)y1 : (CGFloat)x2 : (CGFloat)y2 : (CGFloat)x3 : (CGFloat)y3 { [self subclassResponsibility: _cmd]; } - (void) DPSeoclip { [self subclassResponsibility: _cmd]; } - (void) DPSeofill { [self subclassResponsibility: _cmd]; } /** Fill the current path. (DPS, Quartz). */ - (void) DPSfill { [self subclassResponsibility: _cmd]; } - (void) DPSflattenpath { [self subclassResponsibility: _cmd]; } - (void) DPSinitclip { [self subclassResponsibility: _cmd]; } - (void) DPSlineto: (CGFloat)x : (CGFloat)y { [self subclassResponsibility: _cmd]; } - (void) DPSmoveto: (CGFloat)x : (CGFloat)y { [self subclassResponsibility: _cmd]; } - (void) DPSnewpath { [self subclassResponsibility: _cmd]; } - (void) DPSpathbbox: (CGFloat*)llx : (CGFloat*)lly : (CGFloat*)urx : (CGFloat*)ury { [self subclassResponsibility: _cmd]; } - (void) DPSrcurveto: (CGFloat)x1 : (CGFloat)y1 : (CGFloat)x2 : (CGFloat)y2 : (CGFloat)x3 : (CGFloat)y3 { [self subclassResponsibility: _cmd]; } - (void) DPSrectclip: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h { [self subclassResponsibility: _cmd]; } - (void) DPSrectfill: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h { [self subclassResponsibility: _cmd]; } - (void) DPSrectstroke: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h { [self subclassResponsibility: _cmd]; } - (void) DPSreversepath { [self subclassResponsibility: _cmd]; } - (void) DPSrlineto: (CGFloat)x : (CGFloat)y { [self subclassResponsibility: _cmd]; } - (void) DPSrmoveto: (CGFloat)x : (CGFloat)y { [self subclassResponsibility: _cmd]; } - (void) DPSstroke { [self subclassResponsibility: _cmd]; } - (void) DPSshfill: (NSDictionary *)shaderDictionary { [self subclassResponsibility: _cmd]; } /** Set the bezier path as the current path */ - (void) GSSendBezierPath: (NSBezierPath *)path { [self subclassResponsibility: _cmd]; } /** Append the array of rects to the current clip path (DPS, Quartz). */ - (void) GSRectClipList: (const NSRect *)rects : (int) count { [self subclassResponsibility: _cmd]; } /** Draw and fill the array of rects. (DPS, Quartz) */ - (void) GSRectFillList: (const NSRect *)rects : (int) count { [self subclassResponsibility: _cmd]; } /* ----------------------------------------------------------------------- */ /* Window system ops */ /* ----------------------------------------------------------------------- */ /** This is a private method used between the window server and the context. It should not be used in any application. Typically used by the window server to find out what window the context is drawing graphics to. The device pointer is an opaque type that contains information about the window. The x and y pointers indicate the offset of the origin of the window from the lower left-hand corner */ - (void) GSCurrentDevice: (void **)device : (int *)x : (int *)y { [self subclassResponsibility: _cmd]; } - (void) DPScurrentoffset: (int *)x : (int *)y { [self subclassResponsibility: _cmd]; } /** This is a private method used between the window server and the context. It should not be used in any application. Typically called by the window server to tell the context what window it should draw graphics to. The device pointer is an opaque type that contains information about the window. The x and y values tell the context that it should put the origin of the transform matrix at the indicated x and y values from the lower left-hand corner of the window */ - (void) GSSetDevice: (void *)device : (int)x : (int)y { [self subclassResponsibility: _cmd]; } - (void) DPSsetoffset: (short int)x : (short int)y { [self subclassResponsibility: _cmd]; } /*-------------------------------------------------------------------------*/ /* Graphics Extension Ops */ /*-------------------------------------------------------------------------*/ - (void) DPScomposite: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h : (NSInteger)gstateNum : (CGFloat)dx : (CGFloat)dy : (NSCompositingOperation)op { [self subclassResponsibility: _cmd]; } - (void) DPScompositerect: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h : (NSCompositingOperation)op { [self subclassResponsibility: _cmd]; } - (void) DPSdissolve: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h : (NSInteger)gstateNum : (CGFloat)dx : (CGFloat)dy : (CGFloat)delta { [self subclassResponsibility: _cmd]; } /* As currently not all backends support mixed composite and dissolve operations, this method is here to dispatch to the best suited one implemented */ - (void) GScomposite: (NSInteger)gstateNum toPoint: (NSPoint)aPoint fromRect: (NSRect)srcRect operation: (NSCompositingOperation)op fraction: (CGFloat)delta { [self subclassResponsibility: _cmd]; } /** Returns whether the backend supports a GSDraw operator. By default, returns NO.
When a GSContext backend subclass overrides this method to return YES, the backend must also implement -drawGState:fromRect:toPoint:op:fraction: in its GSState subclass. When YES is returned, -[NSImage drawXXX] methods that involves rotation, scaling etc. will delegate as much as possible the image drawing to the backend, rather than trying to emulate the resulting image in Gui by using intermediate images to rotate and scale the content, and then composite the result with -GScomposite:toPoint:fromRect:operation:fraction:. Backends which doesn't implement -compositeGState:fromRect:toPoint:op:fraction: can draw rotated or scaled images, but the semantic won't exactly match the NSImage documentation in non-trivial cases. */ - (BOOL) supportsDrawGState { return NO; } /** Draws a gstate in a way that fully respects the destination transform, unlike the GSComposite operator which ignores the rotation and the scaling effect on the content. Note: For the GScomposite operator, the scaling and rotation affects the destination point but not the content. */ - (void) GSdraw: (NSInteger)gstateNum toPoint: (NSPoint)aPoint fromRect: (NSRect)srcRect operation: (NSCompositingOperation)op fraction: (CGFloat)delta { [self subclassResponsibility: _cmd]; } /** Generic method to draw an image into a rect. The image is defined by imageref, an opaque structure. Support for this method hasn't been implemented yet, so it should not be used anywhere. */ - (void) GSDrawImage: (NSRect)rect : (void *)imageref { [self subclassResponsibility: _cmd]; } /* ----------------------------------------------------------------------- */ /* Client functions */ /* ----------------------------------------------------------------------- */ /** Write the string (with printf substitutions) to a PostScript context. Other output contexts will likely ignore this */ - (void) DPSPrintf: (const char *)fmt : (va_list)args { [self subclassResponsibility: _cmd]; } /** Write the encoded data to a PostScript context. Other output contexts will likely ignore this */ - (void) DPSWriteData: (const char *)buf : (unsigned int)count { [self subclassResponsibility: _cmd]; } @end /* ----------------------------------------------------------------------- */ /* NSGraphics Ops */ /* ----------------------------------------------------------------------- */ @implementation NSGraphicsContext (NSGraphics) - (NSDictionary *) GSReadRect: (NSRect) rect { return nil; } /** Generic method to render bitmap images. This method shouldn't be used anywhere except in the AppKit itself. It will be replaced by the more flexible GSDrawImage method sometime in the future. (Quartz). */ - (void) NSDrawBitmap: (NSRect) rect : (NSInteger) pixelsWide : (NSInteger) pixelsHigh : (NSInteger) bitsPerSample : (NSInteger) samplesPerPixel : (NSInteger) bitsPerPixel : (NSInteger) bytesPerRow : (BOOL) isPlanar : (BOOL) hasAlpha : (NSString *) colorSpaceName : (const unsigned char *const [5]) data { [self subclassResponsibility: _cmd]; } /** Play the System Beep */ - (void) NSBeep { [GSCurrentServer() beep]; } /** This method is used by the backend, but has been rendered obsolete. Do not use it in any code or in any backend implementation as it may disappear at any point. */ - (void) GSWSetViewIsFlipped: (BOOL) flipped { } /** Returns YES if the current focused view is flipped. This is an obsolete method. Use [[NSView focusView] isFlipped] instead */ - (BOOL) GSWViewIsFlipped { return [[self focusView] isFlipped]; } @end @implementation NSGraphicsContext (Printing) - (void) beginPage: (int)ordinalNum label: (NSString*)aString bBox: (NSRect)pageRect fonts: (NSString*)fontNames { if (aString == nil) aString = [[NSNumber numberWithInt: ordinalNum] description]; DPSPrintf(self, "%%%%Page: %s %d\n", [aString lossyCString], ordinalNum); if (NSIsEmptyRect(pageRect) == NO) DPSPrintf(self, "%%%%PageBoundingBox: %d %d %d %d\n", (int)NSMinX(pageRect), (int)NSMinY(pageRect), (int)NSMaxX(pageRect), (int)NSMaxY(pageRect)); if (fontNames) DPSPrintf(self, "%%%%PageFonts: %s\n", [fontNames lossyCString]); DPSPrintf(self, "%%%%BeginPageSetup\n"); } - (void) beginPrologueBBox: (NSRect)boundingBox creationDate: (NSString*)dateCreated createdBy: (NSString*)anApplication fonts: (NSString*)fontNames forWhom: (NSString*)user pages: (int)numPages title: (NSString*)aTitle { NSPrintOperation *printOp = [NSPrintOperation currentOperation]; NSPrintingOrientation orient; BOOL epsOp; epsOp = [printOp isEPSOperation]; orient = [[printOp printInfo] orientation]; if (epsOp) DPSPrintf(self, "%%!PS-Adobe-3.0 EPSF-3.0\n"); else DPSPrintf(self, "%%!PS-Adobe-3.0\n"); DPSPrintf(self, "%%%%Title: %s\n", [aTitle lossyCString]); DPSPrintf(self, "%%%%Creator: %s\n", [anApplication lossyCString]); DPSPrintf(self, "%%%%CreationDate: %s\n", [[dateCreated description] lossyCString]); DPSPrintf(self, "%%%%For: %s\n", [user lossyCString]); if (fontNames) DPSPrintf(self, "%%%%DocumentFonts: %s\n", [fontNames lossyCString]); else DPSPrintf(self, "%%%%DocumentFonts: (atend)\n"); if (NSIsEmptyRect(boundingBox) == NO) DPSPrintf(self, "%%%%BoundingBox: %d %d %d %d\n", (int)NSMinX(boundingBox), (int)NSMinY(boundingBox), (int)NSMaxX(boundingBox), (int)NSMaxY(boundingBox)); else DPSPrintf(self, "%%%%BoundingBox: (atend)\n"); if (epsOp == NO) { if (numPages) DPSPrintf(self, "%%%%Pages: %d\n", numPages); else DPSPrintf(self, "%%%%Pages: (atend)\n"); if ([printOp pageOrder] == NSDescendingPageOrder) DPSPrintf(self, "%%%%PageOrder: Descend\n"); else if ([printOp pageOrder] == NSAscendingPageOrder) DPSPrintf(self, "%%%%PageOrder: Ascend\n"); else if ([printOp pageOrder] == NSSpecialPageOrder) DPSPrintf(self, "%%%%PageOrder: Special\n"); if (orient == NSPortraitOrientation) DPSPrintf(self, "%%%%Orientation: Portrait\n"); else DPSPrintf(self, "%%%%Orientation: Landscape\n"); } DPSPrintf(self, "%%%%GNUstepVersion: %d.%d.%d\n", GNUSTEP_GUI_MAJOR_VERSION, GNUSTEP_GUI_MINOR_VERSION, GNUSTEP_GUI_SUBMINOR_VERSION); } - (void) beginSetup { DPSPrintf(self, "%%%%BeginSetup\n"); } - (void) beginTrailer { DPSPrintf(self, "%%%%Trailer\n"); } - (void) endDocumentPages: (int)pages documentFonts: (NSSet*)fontNames { if (pages != 0) { DPSPrintf(self, "%%%%Pages: %d\n", pages); } if (fontNames && [fontNames count]) { NSString *name; NSEnumerator *e = [fontNames objectEnumerator]; DPSPrintf(self, "%%%%DocumentFonts: %@\n", [e nextObject]); while ((name = [e nextObject])) { DPSPrintf(self, "%%%%+ %@\n", name); } } } - (void) endHeaderComments { DPSPrintf(self, "%%%%EndComments\n\n"); } - (void) endPageSetup { DPSPrintf(self, "%%%%EndPageSetup\n"); } - (void) endPrologue { DPSPrintf(self, "%%%%EndProlog\n\n"); } - (void) endSetup { DPSPrintf(self, "%%%%EndSetup\n\n"); } - (void) endSheet { NSPrintOperation *printOp = [NSPrintOperation currentOperation]; if ([printOp isEPSOperation] == NO) { [self showPage]; } DPSPrintf(self, "%%%%PageTrailer\n\n"); } - (void) endTrailer { DPSPrintf(self, "%%%%EOF\n"); } - (void) printerProlog { NSString *prolog; DPSPrintf(self, "%%%%BeginProlog\n"); prolog = [NSBundle pathForLibraryResource: @"GSProlog" ofType: @"ps" inDirectory: @"PostScript"]; if (prolog == nil) { NSLog(@"Cannot find printer prolog file"); return; } prolog = [NSString stringWithContentsOfFile: prolog]; DPSPrintf(self, [prolog cString]); } - (void) showPage { DPSPrintf(self, "showpage\n"); } @end @implementation NSGraphicsContext (NSGradient) - (void) drawGradient: (NSGradient*)gradient fromCenter: (NSPoint)startCenter radius: (CGFloat)startRadius toCenter: (NSPoint)endCenter radius: (CGFloat)endRadius options: (NSUInteger)options { [self subclassResponsibility: _cmd]; } - (void) drawGradient: (NSGradient*)gradient fromPoint: (NSPoint)startPoint toPoint: (NSPoint)endPoint options: (NSUInteger)options { [self subclassResponsibility: _cmd]; } @end gnustep-gui-0.24.0/Source/NSSearchFieldCell.m0000664000076500007650000004762112142032646020604 0ustar brains99brains99/* NSSearchFieldCell.h Text field cell class for text search Copyright (C) 2004 Free Software Foundation, Inc. Author: H. Nikolaus Schaller Date: Dec 2004 Author: Fred Kiefer Date: Mar 2006 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSButtonCell.h" #import "AppKit/NSEvent.h" #import "AppKit/NSImage.h" #import "AppKit/NSMenu.h" #import "AppKit/NSMenuView.h" #import "AppKit/NSPopUpButtonCell.h" #import "AppKit/NSSearchField.h" #import "AppKit/NSSearchFieldCell.h" #import "AppKit/NSWindow.h" @interface NSSearchFieldCell (Private) - (NSMenu *) _buildTemplate; - (void) _openPopup: (id)sender; - (void) _clearSearches: (id)sender; - (void) _loadSearches; - (void) _saveSearches; @end /* NSSearchFieldCell Private */ @implementation NSSearchFieldCell #define ICON_WIDTH 16 // Inlined method static inline NSRect textCellFrameFromRect(NSRect cellRect) // Not the drawed part, precises just the part which receives events { return NSMakeRect(cellRect.origin.x + ICON_WIDTH, NSMinY(cellRect), NSWidth(cellRect) - 2*ICON_WIDTH, NSHeight(cellRect)); } - (id) initTextCell:(NSString *)aString { self = [super initTextCell: aString]; if (self) { NSButtonCell *c; // NSMenu *template; c = [[NSButtonCell alloc] initImageCell: nil]; [self setCancelButtonCell: c]; RELEASE(c); [self resetCancelButtonCell]; c = [[NSButtonCell alloc] initImageCell: nil]; [self setSearchButtonCell: c]; RELEASE(c); [self resetSearchButtonCell]; /* Don't set the searchMenuTemplate unless it is explicitly set in code or by a nib connection template = [self _buildTemplate]; [self setSearchMenuTemplate: template]; RELEASE(template); */ //_recent_searches = [[NSMutableArray alloc] init]; //_recents_autosave_name = nil; _max_recents = 10; [self _loadSearches]; } return self; } - (void) dealloc { RELEASE(_cancel_button_cell); RELEASE(_search_button_cell); RELEASE(_recent_searches); RELEASE(_recents_autosave_name); RELEASE(_menu_template); [super dealloc]; } - (id) copyWithZone:(NSZone *) zone; { NSSearchFieldCell *c = [super copyWithZone: zone]; c->_cancel_button_cell = [_cancel_button_cell copyWithZone: zone]; c->_search_button_cell = [_search_button_cell copyWithZone: zone]; c->_recent_searches = [_recent_searches mutableCopyWithZone: zone]; c->_recents_autosave_name = [_recents_autosave_name copyWithZone: zone]; c->_menu_template = [_menu_template copyWithZone: zone]; return c; } - (BOOL) isOpaque { // only if all components are opaque return [super isOpaque] && [_cancel_button_cell isOpaque] && [_search_button_cell isOpaque]; } - (void) drawWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { [_search_button_cell drawWithFrame: [self searchButtonRectForBounds: cellFrame] inView: controlView]; [super drawWithFrame: [self searchTextRectForBounds: cellFrame] inView: controlView]; if ([[self stringValue] length] > 0) [_cancel_button_cell drawWithFrame: [self cancelButtonRectForBounds: cellFrame] inView: controlView]; } - (BOOL) sendsWholeSearchString { return _sends_whole_search_string; } - (void) setSendsWholeSearchString: (BOOL)flag { _sends_whole_search_string = flag; } - (BOOL) sendsSearchStringImmediately { return _sends_search_string_immediatly; } - (void) setSendsSearchStringImmediately: (BOOL)flag { _sends_search_string_immediatly = flag; } - (NSInteger) maximumRecents { return _max_recents; } - (void) setMaximumRecents: (NSInteger)max { if (max > 254) { max = 254; } else if (max < 0) { max = 10; } _max_recents = max; } - (NSArray *) recentSearches { return _recent_searches; } - (NSString *) recentsAutosaveName { return _recents_autosave_name; } - (void) setRecentsAutosaveName: (NSString *)name { ASSIGN(_recents_autosave_name, name); [self _loadSearches]; } - (void) setRecentSearches: (NSArray *)searches { int max; NSMutableArray *mutableSearches; max = [self maximumRecents]; if ([searches count] > max) { id buffer[max]; [searches getObjects: buffer range: NSMakeRange(0, max)]; mutableSearches = [[NSMutableArray alloc] initWithObjects: buffer count: max]; } else { mutableSearches = [[NSMutableArray alloc] initWithArray: searches]; } [_recent_searches release]; _recent_searches = mutableSearches; [self _saveSearches]; } - (void) addToRecentSearches:(NSString *)searchTerm { if (!_recent_searches) { ASSIGN(_recent_searches, [NSMutableArray array]); } if (searchTerm != nil && [searchTerm length] > 0 && [_recent_searches indexOfObject: searchTerm] == NSNotFound) { [_recent_searches addObject: searchTerm]; [self _saveSearches]; } } - (NSMenu *) searchMenuTemplate { return _menu_template; } - (void) setSearchMenuTemplate: (NSMenu *)menu { ASSIGN(_menu_template, menu); if (menu) { [[self searchButtonCell] setTarget: self]; [[self searchButtonCell] setAction: @selector(_openPopup:)]; [[self searchButtonCell] sendActionOn: NSLeftMouseDownMask]; } else { [self resetSearchButtonCell]; } } - (NSButtonCell *) cancelButtonCell { return _cancel_button_cell; } - (void) setCancelButtonCell: (NSButtonCell *)cell { ASSIGN(_cancel_button_cell, cell); } - (NSButtonCell *) searchButtonCell { return _search_button_cell; } - (void) setSearchButtonCell: (NSButtonCell *)cell { ASSIGN(_search_button_cell, cell); } - (void) resetCancelButtonCell { NSButtonCell *c; c = [self cancelButtonCell]; // configure the button [c setButtonType: NSMomentaryChangeButton]; [c setBezelStyle: NSRegularSquareBezelStyle]; [c setBordered: NO]; [c setBezeled: NO]; [c setEditable: NO]; [c setImagePosition: NSImageOnly]; [c setImage: [NSImage imageNamed: @"GSStop"]]; [c setAction: @selector(clearSearch:)]; [c setTarget: self]; [c setKeyEquivalent: @"\e"]; [c setKeyEquivalentModifierMask: 0]; } - (void) resetSearchButtonCell { NSButtonCell *c; c = [self searchButtonCell]; // configure the button [c setButtonType: NSMomentaryChangeButton]; [c setBezelStyle: NSRegularSquareBezelStyle]; [c setBordered: NO]; [c setBezeled: NO]; [c setEditable: NO]; [c setImagePosition: NSImageOnly]; [c setImage: [NSImage imageNamed: @"GSSearch"]]; // [c setAction: [self action]]; // [c setTarget: [self target]]; [c setAction: @selector(performClick:)]; [c setTarget: self]; [c sendActionOn: NSLeftMouseUpMask]; [c setKeyEquivalent: @"\r"]; [c setKeyEquivalentModifierMask: 0]; } - (NSRect) cancelButtonRectForBounds: (NSRect)rect { NSRect part, clear; NSDivideRect(rect, &clear, &part, ICON_WIDTH, NSMaxXEdge); return clear; } - (NSRect) searchTextRectForBounds: (NSRect)rect { NSRect search, text, clear, part; if (!_search_button_cell) { // nothing to split off part = rect; } else { NSDivideRect(rect, &search, &part, ICON_WIDTH, NSMinXEdge); } if (!_cancel_button_cell) { // nothing to split off text = part; } else { NSDivideRect(part, &clear, &text, ICON_WIDTH, NSMaxXEdge); } return text; } - (NSRect) searchButtonRectForBounds: (NSRect)rect; { NSRect search, part; NSDivideRect(rect, &search, &part, ICON_WIDTH, NSMinXEdge); return search; } - (void) editWithFrame: (NSRect)aRect inView: (NSView*)controlView editor: (NSText*)textObject delegate: (id)anObject event: (NSEvent*)theEvent { // constrain to visible text area [super editWithFrame: [self searchTextRectForBounds: aRect] inView: controlView editor: textObject delegate: anObject event: theEvent]; } - (void) endEditing: (NSText *)editor { [self addToRecentSearches: [[[editor string] copy] autorelease]]; [super endEditing: editor]; [[NSNotificationCenter defaultCenter] removeObserver: self name: NSTextDidChangeNotification object: editor]; } - (void) selectWithFrame: (NSRect)aRect inView: (NSView*)controlView editor: (NSText*)textObject delegate: (id)anObject start: (NSInteger)selStart length: (NSInteger)selLength { // constrain to visible text area [super selectWithFrame: [self searchTextRectForBounds: aRect] inView: controlView editor: textObject delegate: anObject start: selStart length: selLength]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(textDidChange:) name: NSTextDidChangeNotification object: textObject]; } - (BOOL) trackMouse: (NSEvent *)event inRect: (NSRect)cellFrame ofView: (NSView *)controlView untilMouseUp: (BOOL)untilMouseUp { NSRect rect; NSPoint thePoint; NSPoint location = [event locationInWindow]; NSText *currentEditor; thePoint = [controlView convertPoint: location fromView: nil]; // check if we are within the search/stop buttons rect = [self searchButtonRectForBounds: cellFrame]; if ([controlView mouse: thePoint inRect: rect]) { return [[self searchButtonCell] trackMouse: event inRect: rect ofView: controlView untilMouseUp: untilMouseUp]; } rect = [self cancelButtonRectForBounds: cellFrame]; if ([controlView mouse: thePoint inRect: rect]) { return [[self cancelButtonCell] trackMouse: event inRect: rect ofView: controlView untilMouseUp: untilMouseUp]; } currentEditor = ([controlView isKindOfClass:[NSControl class]] ? [(NSControl *)controlView currentEditor] : nil); if (currentEditor) { [currentEditor mouseDown: event]; return YES; } return [super trackMouse: event inRect: [self searchTextRectForBounds: cellFrame] ofView: controlView untilMouseUp: untilMouseUp]; } - (void) resetCursorRect: (NSRect)cellFrame inView: (NSView *)controlView { [super resetCursorRect: textCellFrameFromRect(cellFrame) inView: controlView]; } - (void) textDidChange: (NSNotification *)notification { NSText *textObject; [_control_view setNeedsDisplay:YES]; // make textChanged send action (unless disabled) if (_sends_whole_search_string) { // ignore return; } textObject = [notification object]; // copy the current NSTextEdit string so that it can be read from the NSSearchFieldCell! [self setStringValue: [textObject string]]; [NSApp sendAction:[self action] to:[self target] from:_control_view]; } - (void) clearSearch:(id)sender { [self setStringValue:@""]; [NSApp sendAction:[self action] to:[self target] from:_control_view]; [_control_view setNeedsDisplay:YES]; } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder*)aCoder { NSInteger max = [self maximumRecents]; [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { [aCoder encodeObject: _search_button_cell forKey: @"NSSearchButtonCell"]; [aCoder encodeObject: _cancel_button_cell forKey: @"NSCancelButtonCell"]; [aCoder encodeObject: _recents_autosave_name forKey: @"NSRecentsAutosaveName"]; [aCoder encodeBool: _sends_whole_search_string forKey: @"NSSendsWholeSearchString"]; [aCoder encodeInt: max forKey: @"NSMaximumRecents"]; } else { [aCoder encodeObject: _search_button_cell]; [aCoder encodeObject: _cancel_button_cell]; [aCoder encodeObject: _recents_autosave_name]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_sends_whole_search_string]; [aCoder encodeValueOfObjCType: @encode(unsigned int) at: &max]; } } - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if (self != nil) { if ([aDecoder allowsKeyedCoding]) { [self setSearchButtonCell: [aDecoder decodeObjectForKey: @"NSSearchButtonCell"]]; [self setCancelButtonCell: [aDecoder decodeObjectForKey: @"NSCancelButtonCell"]]; [self setRecentsAutosaveName: [aDecoder decodeObjectForKey: @"NSRecentsAutosaveName"]]; [self setSendsWholeSearchString: [aDecoder decodeBoolForKey: @"NSSendsWholeSearchString"]]; [self setMaximumRecents: [aDecoder decodeIntForKey: @"NSMaximumRecents"]]; } else { NSInteger max; [self setSearchButtonCell: [aDecoder decodeObject]]; [self setCancelButtonCell: [aDecoder decodeObject]]; [self setRecentsAutosaveName: [aDecoder decodeObject]]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_sends_whole_search_string]; [aDecoder decodeValueOfObjCType: @encode(unsigned int) at: &max]; [self setMaximumRecents: max]; } [self resetCancelButtonCell]; [self resetSearchButtonCell]; } return self; } @end /* NSSearchFieldCell */ @implementation NSSearchFieldCell (Private) /* Set up a default template */ - (NSMenu *) _buildTemplate { NSMenu *template; NSMenuItem *item; template = [[NSMenu alloc] init]; item = [[NSMenuItem alloc] initWithTitle: @"Recent searches" action: NULL keyEquivalent: @""]; [item setTag: NSSearchFieldRecentsTitleMenuItemTag]; [template addItem: item]; RELEASE(item); item = [[NSMenuItem alloc] initWithTitle: @"Recent search item" action: @selector(search:) keyEquivalent: @""]; [item setTag: NSSearchFieldRecentsMenuItemTag]; [template addItem: item]; RELEASE(item); item = [[NSMenuItem alloc] initWithTitle: @"Clear recent searches" action: @selector(_clearSearches:) keyEquivalent: @""]; [item setTag: NSSearchFieldClearRecentsMenuItemTag]; [item setTarget: self]; [template addItem: item]; RELEASE(item); item = [[NSMenuItem alloc] initWithTitle: @"No recent searches" action: NULL keyEquivalent: @""]; [item setTag: NSSearchFieldNoRecentsMenuItemTag]; [template addItem: item]; RELEASE(item); return template; } - (void) _openPopup: (id)sender { NSMenu *template; NSMenu *popupmenu; NSMenuView *mr; NSWindow *cvWin; NSRect cellFrame; int i; int recentCount = [_recent_searches count]; NSPopUpButtonCell *pbcell = [[NSPopUpButtonCell alloc] initTextCell:nil pullsDown:NO]; int selectedItemIndex = -1, newSelectedItemIndex; template = [self searchMenuTemplate]; popupmenu = [[NSMenu alloc] init]; // Fill the popup menu for (i = 0; i < [template numberOfItems]; i++) { int tag; NSMenuItem *item, *newItem = nil; item = (NSMenuItem*)[template itemAtIndex: i]; if ([item state]) selectedItemIndex = [popupmenu numberOfItems]; // remember index of previously selected item tag = [item tag]; if (tag == NSSearchFieldRecentsTitleMenuItemTag) { if (recentCount > 0) // only show items with this tag if there are recent searches { newItem = [[item copy] autorelease]; } } else if (tag == NSSearchFieldClearRecentsMenuItemTag) { if (recentCount > 0) // only show items with this tag if there are recent searches { newItem = [[item copy] autorelease]; [newItem setTarget:self]; [newItem setAction:@selector(_clearSearches:)]; } } else if (tag == NSSearchFieldNoRecentsMenuItemTag) { if (recentCount == 0) // only show items with this tag if there are NO recent searches { newItem = [[item copy] autorelease]; } } else if (tag == NSSearchFieldRecentsMenuItemTag) { int j; for (j = 0; j < recentCount; j++) { id searchItem = [popupmenu addItemWithTitle: [_recent_searches objectAtIndex: j] action: @selector(_searchForRecent:) keyEquivalent: [item keyEquivalent]]; [searchItem setTarget: self]; } } else // copy all other items without special tags from the template into the popup { newItem = [[item copy] autorelease]; } if (newItem != nil) { [popupmenu addItem: newItem]; } } [pbcell setMenu:popupmenu]; [pbcell selectItemAtIndex:selectedItemIndex]; [[popupmenu itemAtIndex:selectedItemIndex] setState:NSOffState]; // ensure that state resets fully [[popupmenu itemAtIndex:selectedItemIndex] setState:NSOnState]; // Prepare to display the popup cvWin = [_control_view window]; cellFrame = [_control_view frame]; cellFrame = [[_control_view superview] convertRect:cellFrame toView:nil]; // convert to window coordinates cellFrame.origin = [cvWin convertBaseToScreen:cellFrame.origin]; // convert to screen coordinates mr = [popupmenu menuRepresentation]; // Ask the MenuView to attach the menu to this rect [mr setWindowFrameForAttachingToRect: cellFrame onScreen: [cvWin screen] preferredEdge: NSMinYEdge popUpSelectedItem: -1]; // Last, display the window [[mr window] orderFrontRegardless]; [mr mouseDown: [NSApp currentEvent]]; newSelectedItemIndex = [pbcell indexOfSelectedItem]; if (newSelectedItemIndex != selectedItemIndex && newSelectedItemIndex != -1 && newSelectedItemIndex < [template numberOfItems]) { int tag = [[template itemAtIndex:newSelectedItemIndex] tag]; if (tag != NSSearchFieldRecentsTitleMenuItemTag && tag != NSSearchFieldClearRecentsMenuItemTag && tag != NSSearchFieldNoRecentsMenuItemTag && tag != NSSearchFieldRecentsMenuItemTag && ![[template itemAtIndex:newSelectedItemIndex] isSeparatorItem]) { //new selected item within the template that's not a template special item [[template itemAtIndex:selectedItemIndex] setState:NSOffState]; [[template itemAtIndex:newSelectedItemIndex] setState:NSOnState]; } } AUTORELEASE(popupmenu); AUTORELEASE(pbcell); } - (void) _searchForRecent: (id)sender { NSString *searchTerm = [sender title]; [self setStringValue: searchTerm]; [self performClick: self]; // do the search [(id)_control_view selectText: self]; } - (void) _clearSearches: (id)sender { [self setRecentSearches: [NSArray array]]; } - (void) _loadSearches { NSArray *list; NSString *name = [self recentsAutosaveName]; if (name) { list = [[NSUserDefaults standardUserDefaults] stringArrayForKey: name]; [self setRecentSearches: list]; } } - (void) _saveSearches { NSArray *list = [self recentSearches]; NSString *name = [self recentsAutosaveName]; if (name && list) { [[NSUserDefaults standardUserDefaults] setObject: list forKey: name]; } } @end /* NSSearchFieldCell Private */ gnustep-gui-0.24.0/Source/NSScrollView.m0000664000076500007650000013106112227347473017727 0ustar brains99brains99/** NSScrollView Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: July 1997 Author: Felipe A. Rodriguez Date: October 1998 Author: Richard Frith-Macdonald Date: February 1999 Table View Support: Nicola Pero Date: March 2000 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import "AppKit/NSColor.h" #import "AppKit/NSColorList.h" #import "AppKit/NSCell.h" #import "AppKit/NSClipView.h" #import "AppKit/NSEvent.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSInterfaceStyle.h" #import "AppKit/NSRulerView.h" #import "AppKit/NSScroller.h" #import "AppKit/NSScrollView.h" #import "AppKit/NSTableHeaderView.h" #import "AppKit/NSTableView.h" #import "AppKit/NSWindow.h" #import "AppKit/PSOperators.h" #import "GNUstepGUI/GSTheme.h" @interface NSClipView (Private) - (void) _scrollToPoint: (NSPoint)aPoint; @end // // For nib compatibility, this is used to properly // initialize the object from a OS X nib file in initWithCoder:. // typedef struct _scrollViewFlags { #if GS_WORDS_BIGENDIAN == 1 unsigned int __unused6:14; unsigned int __unused5:1; unsigned int autohidesScrollers:1; unsigned int __unused4:1; unsigned int __unused3:1; unsigned int __unused2:1; unsigned int doesNotDrawBackground:1; unsigned int __unused1:1; unsigned int hasVRuler:1; unsigned int hasHRuler:1; unsigned int showRulers:1; unsigned int oldRulerInstalled:1; unsigned int nonDynamic:1; unsigned int hasHScroller:1; unsigned int hasVScroller:1; unsigned int hScrollerRequired:1; unsigned int vScrollerRequired:1; NSBorderType border:2; #else NSBorderType border:2; unsigned int vScrollerRequired:1; unsigned int hScrollerRequired:1; unsigned int hasVScroller:1; unsigned int hasHScroller:1; unsigned int nonDynamic:1; unsigned int oldRulerInstalled:1; unsigned int showRulers:1; unsigned int hasHRuler:1; unsigned int hasVRuler:1; unsigned int __unused1:1; unsigned int doesNotDrawBackground:1; unsigned int __unused2:1; unsigned int __unused3:1; unsigned int __unused4:1; unsigned int autohidesScrollers:1; unsigned int __unused5:1; unsigned int __unused6:14; #endif } GSScrollViewFlags; @interface NSScrollView (GSPrivate) /* GNUstep private methods */ - (void) _synchronizeHeaderAndCornerView; - (void) _themeDidActivate: (NSNotification*)notification; @end @implementation NSScrollView /* * Class variables */ static Class rulerViewClass = nil; static CGFloat scrollerWidth; /* * Class methods */ + (void) initialize { if (self == [NSScrollView class]) { [self setRulerViewClass: [NSRulerView class]]; scrollerWidth = [NSScroller scrollerWidth]; [self setVersion: 2]; } } + (void) setRulerViewClass: (Class)aClass { rulerViewClass = aClass; } + (Class) rulerViewClass { return rulerViewClass; } + (NSSize) contentSizeForFrameSize: (NSSize)frameSize hasHorizontalScroller: (BOOL)hFlag hasVerticalScroller: (BOOL)vFlag borderType: (NSBorderType)borderType { NSSize size = frameSize; NSSize border = [[GSTheme theme] sizeForBorderType: borderType]; CGFloat innerBorderWidth = [[NSUserDefaults standardUserDefaults] boolForKey: @"GSScrollViewNoInnerBorder"] ? 0.0 : 1.0; /* * Substract 1 from the width and height of * the line that separates the horizontal * and vertical scroller from the clip view */ if (hFlag) { size.height -= scrollerWidth + innerBorderWidth; } if (vFlag) { size.width -= scrollerWidth + innerBorderWidth; } size.width -= 2 * border.width; size.height -= 2 * border.height; return size; } + (NSSize) frameSizeForContentSize: (NSSize)contentSize hasHorizontalScroller: (BOOL)hFlag hasVerticalScroller: (BOOL)vFlag borderType: (NSBorderType)borderType { NSSize size = contentSize; NSSize border = [[GSTheme theme] sizeForBorderType: borderType]; CGFloat innerBorderWidth = [[NSUserDefaults standardUserDefaults] boolForKey: @"GSScrollViewNoInnerBorder"] ? 0.0 : 1.0; /* * Add 1 to the width and height for the line that separates the * horizontal and vertical scroller from the clip view. */ if (hFlag) { size.height += scrollerWidth + innerBorderWidth; } if (vFlag) { size.width += scrollerWidth + innerBorderWidth; } size.width += 2 * border.width; size.height += 2 * border.height; return size; } /* * Instance methods */ - (id) initWithFrame: (NSRect)rect { NSClipView *clipView; self = [super initWithFrame: rect]; if (!self) return nil; clipView = [NSClipView new]; [self setContentView: clipView]; RELEASE(clipView); _hLineScroll = 10; _hPageScroll = 10; _vLineScroll = 10; _vPageScroll = 10; _borderType = NSNoBorder; _scrollsDynamically = YES; //_autohidesScrollers = NO; // FIXME: Not sure here Apple says by default all scrollers are off. // For compatibility the ruler should be present but not visible. [self setHasHorizontalRuler: YES]; [self tile]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_themeDidActivate:) name: GSThemeDidActivateNotification object: nil]; return self; } - (void) dealloc { [[NSNotificationCenter defaultCenter] removeObserver: self]; DESTROY(_horizScroller); DESTROY(_vertScroller); DESTROY(_horizRuler); DESTROY(_vertRuler); [super dealloc]; } - (BOOL) isFlipped { return YES; } - (void) setContentView: (NSClipView *)aView { if (aView == nil) [NSException raise: NSInvalidArgumentException format: @"Attempt to set nil content view"]; if ([aView isKindOfClass: [NSView class]] == NO) [NSException raise: NSInvalidArgumentException format: @"Attempt to set non-view object as content view"]; if (aView != _contentView) { NSView *docView = [aView documentView]; [_contentView removeFromSuperview]; [self addSubview: aView]; // This must be done after adding it as a subview, // otherwise it will get unset again. _contentView = aView; if (docView != nil) { [self setDocumentView: docView]; } } [_contentView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [self tile]; } - (void) willRemoveSubview: (NSView *)aView { if (aView == _contentView) { _contentView = nil; } if (aView == _headerClipView) { _headerClipView = nil; } if (aView == _cornerView) { _cornerView = nil; } [super willRemoveSubview: aView]; } - (void) setHorizontalScroller: (NSScroller*)aScroller { [_horizScroller removeFromSuperview]; /* * Do not add the scroller view to the subviews array yet; * -setHasHorizontalScroller must be invoked first */ ASSIGN(_horizScroller, aScroller); if (_horizScroller) { [_horizScroller setAutoresizingMask: NSViewWidthSizable]; [_horizScroller setTarget: self]; [_horizScroller setAction: @selector(_doScroll:)]; } } - (void) setHasHorizontalScroller: (BOOL)flag { if (_hasHorizScroller == flag) return; _hasHorizScroller = flag; if (_hasHorizScroller) { if (!_horizScroller) { NSScroller *scroller = [NSScroller new]; [self setHorizontalScroller: scroller]; RELEASE(scroller); } [self addSubview: _horizScroller]; } else [_horizScroller removeFromSuperview]; [self tile]; } - (void) setVerticalScroller: (NSScroller*)aScroller { [_vertScroller removeFromSuperview]; /* * Do not add the scroller view to the subviews array yet; * -setHasVerticalScroller must be invoked first */ ASSIGN(_vertScroller, aScroller); if (_vertScroller) { [_vertScroller setAutoresizingMask: NSViewHeightSizable]; [_vertScroller setTarget: self]; [_vertScroller setAction: @selector(_doScroll:)]; } } - (void) setHasVerticalScroller: (BOOL)flag { if (_hasVertScroller == flag) return; _hasVertScroller = flag; if (_hasVertScroller) { if (!_vertScroller) { NSScroller *scroller = [NSScroller new]; [self setVerticalScroller: scroller]; RELEASE(scroller); if (_contentView && ![_contentView isFlipped]) [_vertScroller setFloatValue: 1]; } [self addSubview: _vertScroller]; } else [_vertScroller removeFromSuperview]; [self tile]; } /**

Return wether scroller autohiding is set or not.

See Also: -setAutohidesScrollers:

*/ - (BOOL) autohidesScrollers { return _autohidesScrollers; } /**

Sets whether the view hides the scrollers (horizontal and/or vertical independendently) if they are not needed.

If the content fits inside the clip view on the X or Y axis or both, the respective scroller is removed and additional space is gained.

See Also: -autohidesScrollers

*/ - (void) setAutohidesScrollers: (BOOL)flag { _autohidesScrollers = flag; } - (void) scrollWheel: (NSEvent *)theEvent { NSRect clipViewBounds; CGFloat deltaY = [theEvent deltaY]; CGFloat deltaX = [theEvent deltaX]; CGFloat amount; NSPoint point; if (_contentView == nil) { clipViewBounds = NSZeroRect; } else { clipViewBounds = [_contentView bounds]; } point = clipViewBounds.origin; // Holding shift converts vertical scrolling to horizontal if (([theEvent modifierFlags] & NSShiftKeyMask) == NSShiftKeyMask) { deltaX = -deltaY; deltaY = 0; } // Scroll horizontally if (([theEvent modifierFlags] & NSAlternateKeyMask) == NSAlternateKeyMask) { amount = (clipViewBounds.size.width - _hPageScroll) * deltaX; } else { amount = _hLineScroll * deltaX; } NSDebugLLog (@"NSScrollView", @"increment/decrement: amount = %f, horizontal", amount); point.x = clipViewBounds.origin.x + amount; // Scroll vertically if (([theEvent modifierFlags] & NSAlternateKeyMask) == NSAlternateKeyMask) { amount = - (clipViewBounds.size.height - _vPageScroll) * deltaY; } else { amount = - _vLineScroll * deltaY; } if (_contentView != nil && ![_contentView isFlipped]) { /* If view is flipped reverse the scroll direction */ amount = -amount; } NSDebugLLog (@"NSScrollView", @"increment/decrement: amount = %f, flipped = %d", amount, _contentView ? [_contentView isFlipped] : 0); point.y = clipViewBounds.origin.y + amount; /* scrollToPoint: will call reflectScrolledClipView:, which will * update rules, headers, and scrollers. */ [_contentView _scrollToPoint: point]; } - (void) keyDown: (NSEvent *)theEvent { NSString *chars = [theEvent characters]; unichar c = [chars length] == 1 ? [chars characterAtIndex: 0] : '\0'; switch (c) { case NSUpArrowFunctionKey: [self scrollLineUp: self]; break; case NSDownArrowFunctionKey: [self scrollLineDown: self]; break; case NSPageUpFunctionKey: [self scrollPageUp: self]; break; case NSPageDownFunctionKey: [self scrollPageDown: self]; break; default: [super keyDown: theEvent]; break; } } /* * This code is based on _doScroll: and still may need some tuning. */ - (void) scrollLineUp: (id)sender { NSRect clipViewBounds; NSPoint point; CGFloat amount; if (_contentView == nil) { clipViewBounds = NSZeroRect; } else { clipViewBounds = [_contentView bounds]; } point = clipViewBounds.origin; amount = _vLineScroll; if (_contentView != nil && ![_contentView isFlipped]) { amount = -amount; } point.y = clipViewBounds.origin.y - amount; [_contentView _scrollToPoint: point]; } /* * This code is based on _doScroll: and still may need some tuning. */ - (void) scrollLineDown: (id)sender { NSRect clipViewBounds; NSPoint point; CGFloat amount; if (_contentView == nil) { clipViewBounds = NSZeroRect; } else { clipViewBounds = [_contentView bounds]; } point = clipViewBounds.origin; amount = _vLineScroll; if (_contentView != nil && ![_contentView isFlipped]) { amount = -amount; } point.y = clipViewBounds.origin.y + amount; [_contentView _scrollToPoint: point]; } /** * Scrolls the receiver by simply invoking scrollPageUp: */ - (void) pageUp: (id)sender { [self scrollPageUp: sender]; } /* * This code is based on _doScroll: and still may need some tuning. */ - (void) scrollPageUp: (id)sender { NSRect clipViewBounds; NSPoint point; CGFloat amount; if (_contentView == nil) { clipViewBounds = NSZeroRect; } else { clipViewBounds = [_contentView bounds]; } point = clipViewBounds.origin; /* * Take verticalPageScroll into accout, but try to make sure * that amount is never negative (ie do not scroll backwards.) * * FIXME: It seems _doScroll and scrollWheel: should also take * care not to do negative scrolling. */ amount = clipViewBounds.size.height - _vPageScroll; amount = (amount < 0) ? 0 : amount; if (_contentView != nil && ![_contentView isFlipped]) { amount = -amount; } point.y = clipViewBounds.origin.y - amount; [_contentView _scrollToPoint: point]; } /** * Scrolls the receiver by simply invoking scrollPageUp: */ - (void) pageDown: (id)sender { [self scrollPageDown: sender]; } /* * This code is based on _doScroll:. and still may need some tuning. */ - (void) scrollPageDown: (id)sender { NSRect clipViewBounds; NSPoint point; CGFloat amount; if (_contentView == nil) { clipViewBounds = NSZeroRect; } else { clipViewBounds = [_contentView bounds]; } point = clipViewBounds.origin; /* * Take verticalPageScroll into accout, but try to make sure * that amount is never negativ (ie do not scroll backwards.) * * FIXME: It seems _doScroll and scrollWheel: should also take * care not to do negative scrolling. */ amount = clipViewBounds.size.height - _vPageScroll; amount = (amount < 0) ? 0 : amount; if (_contentView != nil && ![_contentView isFlipped]) { amount = -amount; } point.y = clipViewBounds.origin.y + amount; [_contentView _scrollToPoint: point]; } - (void) _doScroll: (NSScroller*)scroller { float floatValue = [scroller floatValue]; NSScrollerPart hitPart = [scroller hitPart]; NSRect clipViewBounds; NSRect documentRect; CGFloat amount = 0; NSPoint point; if (_contentView == nil) { clipViewBounds = NSZeroRect; documentRect = NSZeroRect; } else { clipViewBounds = [_contentView bounds]; documentRect = [_contentView documentRect]; } point = clipViewBounds.origin; NSDebugLLog (@"NSScrollView", @"_doScroll: float value = %f", floatValue); /* do nothing if scroller is unknown */ if (scroller != _horizScroller && scroller != _vertScroller) return; _knobMoved = NO; if (hitPart == NSScrollerKnob || hitPart == NSScrollerKnobSlot) _knobMoved = YES; else { if (hitPart == NSScrollerIncrementLine) { if (scroller == _horizScroller) amount = _hLineScroll; else amount = _vLineScroll; } else if (hitPart == NSScrollerDecrementLine) { if (scroller == _horizScroller) amount = -_hLineScroll; else amount = -_vLineScroll; } else if (hitPart == NSScrollerIncrementPage) { if (scroller == _horizScroller) amount = clipViewBounds.size.width - _hPageScroll; else amount = clipViewBounds.size.height - _vPageScroll; } else if (hitPart == NSScrollerDecrementPage) { if (scroller == _horizScroller) amount = _hPageScroll - clipViewBounds.size.width; else amount = _vPageScroll - clipViewBounds.size.height; } else { return; } } if (!_knobMoved) /* button scrolling */ { if (scroller == _horizScroller) { point.x = clipViewBounds.origin.x + amount; } else { if (_contentView != nil && ![_contentView isFlipped]) { /* If view is flipped reverse the scroll direction */ amount = -amount; } NSDebugLLog (@"NSScrollView", @"increment/decrement: amount = %f, flipped = %d", amount, _contentView ? [_contentView isFlipped] : 0); point.y = clipViewBounds.origin.y + amount; } } else /* knob scolling */ { if (scroller == _horizScroller) { point.x = floatValue * (documentRect.size.width - clipViewBounds.size.width); point.x += documentRect.origin.x; } else { if (_contentView != nil && ![_contentView isFlipped]) floatValue = 1 - floatValue; point.y = floatValue * (documentRect.size.height - clipViewBounds.size.height); point.y += documentRect.origin.y; } } /* scrollToPoint will call reflectScrollerClipView, and that will * update scrollers, rulers and headers */ [_contentView _scrollToPoint: point]; } - (void) scrollToBeginningOfDocument: (id)sender { NSRect clipViewBounds, documentRect; NSPoint point; if (_contentView == nil) { clipViewBounds = NSZeroRect; documentRect = NSZeroRect; } else { clipViewBounds = [_contentView bounds]; documentRect = [_contentView documentRect]; } point = documentRect.origin; if (_contentView != nil && ![_contentView isFlipped]) { point.y = NSMaxY(documentRect) - NSHeight(clipViewBounds); if (point.y < 0) point.y = 0; } [_contentView _scrollToPoint: point]; } - (void) scrollToEndOfDocument: (id)sender { NSRect clipViewBounds, documentRect; NSPoint point; if (_contentView == nil) { clipViewBounds = NSZeroRect; documentRect = NSZeroRect; } else { clipViewBounds = [_contentView bounds]; documentRect = [_contentView documentRect]; } point = documentRect.origin; if (_contentView == nil || [_contentView isFlipped]) { point.y = NSMaxY(documentRect) - NSHeight(clipViewBounds); if (point.y < 0) point.y = 0; } [_contentView _scrollToPoint: point]; } // // This method is here purely for nib compatibility. This is the action // connected to by NSScrollers in IB when building a scrollview. // - (void) _doScroller: (NSScroller *)scroller { [self _doScroll: scroller]; } - (void) reflectScrolledClipView: (NSClipView *)aClipView { NSRect documentFrame = NSZeroRect; NSRect clipViewBounds = NSZeroRect; float floatValue; CGFloat knobProportion; id documentView; if (aClipView != _contentView) { return; } NSDebugLLog (@"NSScrollView", @"reflectScrolledClipView:"); if (_contentView) { clipViewBounds = [_contentView bounds]; } if ((documentView = [_contentView documentView])) { documentFrame = [documentView frame]; } // FIXME: Should we just hide the scroll bar or remove it? if ((_autohidesScrollers) && (documentFrame.size.height > clipViewBounds.size.height)) { [self setHasVerticalScroller: YES]; } if (_hasVertScroller) { if (documentFrame.size.height <= clipViewBounds.size.height) { if (_autohidesScrollers) { [self setHasVerticalScroller: NO]; } else { [_vertScroller setEnabled: NO]; } } else { [_vertScroller setEnabled: YES]; knobProportion = clipViewBounds.size.height / documentFrame.size.height; floatValue = (clipViewBounds.origin.y - documentFrame.origin.y) / (documentFrame.size.height - clipViewBounds.size.height); if (![_contentView isFlipped]) { floatValue = 1 - floatValue; } [_vertScroller setFloatValue: floatValue knobProportion: knobProportion]; } } if ((_autohidesScrollers) && (documentFrame.size.width > clipViewBounds.size.width)) { [self setHasHorizontalScroller: YES]; } if (_hasHorizScroller) { if (documentFrame.size.width <= clipViewBounds.size.width) { if (_autohidesScrollers) { [self setHasHorizontalScroller: NO]; } else { [_horizScroller setEnabled: NO]; } } else { [_horizScroller setEnabled: YES]; knobProportion = clipViewBounds.size.width / documentFrame.size.width; floatValue = (clipViewBounds.origin.x - documentFrame.origin.x) / (documentFrame.size.width - clipViewBounds.size.width); [_horizScroller setFloatValue: floatValue knobProportion: knobProportion]; } } if (_hasHeaderView) { NSPoint headerClipViewOrigin; headerClipViewOrigin = [_headerClipView bounds].origin; /* If needed, scroll the headerview too. */ if (headerClipViewOrigin.x != clipViewBounds.origin.x) { headerClipViewOrigin.x = clipViewBounds.origin.x; [_headerClipView scrollToPoint: headerClipViewOrigin]; } } if (_rulersVisible == YES) { if (_hasHorizRuler) { [_horizRuler setNeedsDisplay: YES]; } if (_hasVertRuler) { [_vertRuler setNeedsDisplay: YES]; } } } - (void) setHorizontalRulerView: (NSRulerView *)aRulerView { if (_rulersVisible && _horizRuler != nil) { [_horizRuler removeFromSuperview]; } ASSIGN(_horizRuler, aRulerView); if (_horizRuler == nil) { _hasHorizRuler = NO; } else if (_rulersVisible) { [self addSubview:_horizRuler]; } if (_rulersVisible) { [self tile]; } } - (void) setHasHorizontalRuler: (BOOL)flag { if (_hasHorizRuler == flag) return; _hasHorizRuler = flag; if (_hasHorizRuler && _horizRuler == nil) { _horizRuler = [[object_getClass(self) rulerViewClass] alloc]; _horizRuler = [_horizRuler initWithScrollView: self orientation: NSHorizontalRuler]; } if (_rulersVisible) { if (_hasHorizRuler) { [self addSubview: _horizRuler]; } else { [_horizRuler removeFromSuperview]; } [self tile]; } } - (void) setVerticalRulerView: (NSRulerView *)aRulerView { if (_rulersVisible && _vertRuler != nil) { [_vertRuler removeFromSuperview]; } ASSIGN(_vertRuler, aRulerView); if (_vertRuler == nil) { _hasVertRuler = NO; } else if (_rulersVisible) { [self addSubview:_vertRuler]; } if (_rulersVisible) { [self tile]; } } - (void) setHasVerticalRuler: (BOOL)flag { if (_hasVertRuler == flag) return; _hasVertRuler = flag; if (_hasVertRuler && _vertRuler == nil) { _vertRuler = [[object_getClass(self) rulerViewClass] alloc]; _vertRuler = [_vertRuler initWithScrollView: self orientation: NSVerticalRuler]; } if (_rulersVisible) { if (_hasVertRuler) { [self addSubview: _vertRuler]; } else { [_vertRuler removeFromSuperview]; } [self tile]; } } - (void) setRulersVisible: (BOOL)flag { if (_rulersVisible == flag) return; _rulersVisible = flag; if (flag) { if (_hasVertRuler) [self addSubview: _vertRuler]; if (_hasHorizRuler) [self addSubview: _horizRuler]; } else { if (_hasVertRuler) [_vertRuler removeFromSuperview]; if (_hasHorizRuler) [_horizRuler removeFromSuperview]; } [self tile]; } - (void) setFrame: (NSRect)rect { [super setFrame: rect]; [self tile]; } - (void) setFrameSize: (NSSize)size { [super setFrameSize: size]; [self tile]; } static NSRectEdge GSOppositeEdge(NSRectEdge edge) { return (edge == NSMinXEdge) ? NSMaxXEdge : NSMinXEdge; } - (void) tile { NSRect headerRect, contentRect; NSSize border = [[GSTheme theme] sizeForBorderType: _borderType]; NSRectEdge bottomEdge, topEdge; CGFloat headerViewHeight = 0; NSRectEdge verticalScrollerEdge = NSMinXEdge; NSInterfaceStyle style; CGFloat innerBorderWidth = [[NSUserDefaults standardUserDefaults] boolForKey: @"GSScrollViewNoInnerBorder"] ? 0.0 : 1.0; const BOOL useBottomCorner = [[GSTheme theme] scrollViewUseBottomCorner]; const BOOL overlapBorders = [[GSTheme theme] scrollViewScrollersOverlapBorders]; style = NSInterfaceStyleForKey(@"NSScrollViewInterfaceStyle", nil); if (style == NSMacintoshInterfaceStyle || style == NSWindows95InterfaceStyle) { verticalScrollerEdge = NSMaxXEdge; } /* Determine edge positions. */ if ([self isFlipped]) { topEdge = NSMinYEdge; bottomEdge = NSMaxYEdge; } else { topEdge = NSMaxYEdge; bottomEdge = NSMinYEdge; } /* Prepare the contentRect by insetting the borders. */ contentRect = _bounds; if (!overlapBorders) contentRect = NSInsetRect(contentRect, border.width, border.height); if (contentRect.size.width < 0 || contentRect.size.height < 0) { /* FIXME ... should we do something else when given * too small a size to tile? */ return; } [self _synchronizeHeaderAndCornerView]; if (overlapBorders) { if (_borderType != NSNoBorder) { if (!(_hasHeaderView || _hasCornerView)) { // Inset 1px on the top NSDivideRect(contentRect, NULL, &contentRect, 1, topEdge); } if (!_hasVertScroller) { // Inset 1px on the edge where the vertical scroller would be NSDivideRect(contentRect, NULL, &contentRect, 1, verticalScrollerEdge); } if (!_hasHorizScroller) { NSDivideRect(contentRect, NULL, &contentRect, 1, bottomEdge); } // The vertical edge without a scroller { NSDivideRect(contentRect, NULL, &contentRect, 1, GSOppositeEdge(verticalScrollerEdge)); } } } /* First, allocate vertical space for the headerView / cornerView (but - NB - the headerView needs to be placed above the clipview later on, we can't place it now). */ if (_hasHeaderView == YES) { headerViewHeight = [[_headerClipView documentView] frame].size.height; } if (_hasCornerView == YES) { if (headerViewHeight == 0) { headerViewHeight = [_cornerView frame].size.height; } } /* Remove the vertical slice used by the header/corner view. Save the height and y position of headerRect for later reuse. */ NSDivideRect (contentRect, &headerRect, &contentRect, headerViewHeight, topEdge); /* Ok - now go on with drawing the actual scrollview in the remaining space. Just consider contentRect to be the area in which we draw, ignoring header/corner view. */ /* Prepare the vertical scroller. */ if (_hasVertScroller) { NSRect vertScrollerRect; NSDivideRect (contentRect, &vertScrollerRect, &contentRect, scrollerWidth, verticalScrollerEdge); /* If the theme requests it, leave a square gap in the bottom- * left (or bottom-right) corner where the horizontal and vertical * scrollers meet. */ if (_hasHorizScroller && !useBottomCorner) { NSDivideRect (vertScrollerRect, NULL, &vertScrollerRect, scrollerWidth, bottomEdge); } /** Vertically expand the scroller by 1pt on each end */ if (overlapBorders) { vertScrollerRect.origin.y -= 1; vertScrollerRect.size.height += 2; } [_vertScroller setFrame: vertScrollerRect]; /* Substract 1 for the line that separates the vertical scroller * from the clip view (and eventually the horizontal scroller), * unless the GSScrollViewNoInnerBorder default is set. */ NSDivideRect (contentRect, NULL, &contentRect, innerBorderWidth, verticalScrollerEdge); } /* Prepare the horizontal scroller. */ if (_hasHorizScroller) { NSRect horizScrollerRect; NSDivideRect (contentRect, &horizScrollerRect, &contentRect, scrollerWidth, bottomEdge); /** Horizontall expand the scroller by 1pt on each end */ if (overlapBorders) { horizScrollerRect.origin.x -= 1; horizScrollerRect.size.width += 2; } [_horizScroller setFrame: horizScrollerRect]; /* Substract 1 for the width for the line that separates the * horizontal scroller from the clip view, * unless the GSScrollViewNoInnerBorder default is set. */ NSDivideRect (contentRect, NULL, &contentRect, innerBorderWidth, bottomEdge); } /* Now place and size the header view to be exactly above the resulting clipview. */ if (_hasHeaderView) { NSRect rect = headerRect; rect.origin.x = contentRect.origin.x; rect.size.width = contentRect.size.width; [_headerClipView setFrame: rect]; } /* Now place the corner view. */ if (_hasCornerView) { NSPoint p = headerRect.origin; if (verticalScrollerEdge == NSMaxXEdge) { p.x += contentRect.size.width; } [_cornerView setFrameOrigin: p]; } /* Now place the rulers. */ if (_rulersVisible) { if (_hasHorizRuler) { NSRect horizRulerRect; NSDivideRect (contentRect, &horizRulerRect, &contentRect, [_horizRuler requiredThickness], topEdge); [_horizRuler setFrame: horizRulerRect]; } if (_hasVertRuler) { NSRect vertRulerRect; NSDivideRect (contentRect, &vertRulerRect, &contentRect, [_vertRuler requiredThickness], NSMinXEdge); [_vertRuler setFrame: vertRulerRect]; } } [_contentView setFrame: contentRect]; [self setNeedsDisplay: YES]; } - (void) drawRect: (NSRect)rect { [[GSTheme theme] drawScrollViewRect: rect inView: self]; } - (NSRect) documentVisibleRect { return [_contentView documentVisibleRect]; } - (void) setBackgroundColor: (NSColor*)aColor { [_contentView setBackgroundColor: aColor]; } - (NSColor*) backgroundColor { return [_contentView backgroundColor]; } - (void) setDrawsBackground: (BOOL)flag { [_contentView setDrawsBackground: flag]; if ((flag == NO) && [_contentView respondsToSelector: @selector(setCopiesOnScroll:)]) [_contentView setCopiesOnScroll: NO]; } - (BOOL) drawsBackground { return [_contentView drawsBackground]; } - (void) setBorderType: (NSBorderType)borderType { _borderType = borderType; [self tile]; } - (void) setDocumentView: (NSView *)aView { [_contentView setDocumentView: aView]; if (_contentView && ![_contentView isFlipped]) { [_vertScroller setFloatValue: 1]; } [self tile]; } - (void) resizeSubviewsWithOldSize: (NSSize)oldSize { [super resizeSubviewsWithOldSize: oldSize]; [self tile]; } - (id) documentView { return [_contentView documentView]; } - (NSCursor*) documentCursor { return [_contentView documentCursor]; } - (void) setDocumentCursor: (NSCursor*)aCursor { [_contentView setDocumentCursor: aCursor]; } - (BOOL) isOpaque { // FIXME: Only needs to be NO in a corner case, // when [[GSTheme theme] scrollViewUseBottomCorner] is NO // and the theme tile for the bottom corner is transparent. // So maybe cache the value of // [[GSTheme theme] scrollViewUseBottomCorner] and check it here. return NO; } - (NSBorderType) borderType { return _borderType; } /**

Returns whether the NSScrollView has a horizontal ruler

See Also: -setHasHorizontalRuler:

*/ - (BOOL) hasHorizontalRuler { return _hasHorizRuler; } /**

Returns whether the NSScrollView has a horizontal scroller

See Also: -setHasHorizontalScroller:

*/ - (BOOL) hasHorizontalScroller { return _hasHorizScroller; } /**

Returns whether the NSScrollView has a vertical ruler

See Also: -setHasVerticalRuler:

*/ - (BOOL) hasVerticalRuler { return _hasVertRuler; } /**

Returns whether the NSScrollView has a vertical scroller

See Also: -setHasVerticalScroller:

*/ - (BOOL) hasVerticalScroller { return _hasVertScroller; } /**

Returns the size of the NSScrollView's content view

*/ - (NSSize) contentSize { return [_contentView bounds].size; } - (NSClipView *) contentView { return _contentView; } - (NSRulerView *) horizontalRulerView { return _horizRuler; } - (NSRulerView *) verticalRulerView { return _vertRuler; } - (BOOL) rulersVisible { return _rulersVisible; } - (void) setLineScroll: (CGFloat)aFloat { _hLineScroll = aFloat; _vLineScroll = aFloat; } - (void) setHorizontalLineScroll: (CGFloat)aFloat { _hLineScroll = aFloat; } - (void) setVerticalLineScroll: (CGFloat)aFloat { _vLineScroll = aFloat; } - (CGFloat) lineScroll { if (_hLineScroll != _vLineScroll) [NSException raise: NSInternalInconsistencyException format: @"horizontal and vertical values not same"]; return _vLineScroll; } - (CGFloat) horizontalLineScroll { return _hLineScroll; } - (CGFloat) verticalLineScroll { return _vLineScroll; } - (void) setPageScroll: (CGFloat)aFloat { _hPageScroll = aFloat; _vPageScroll = aFloat; } - (void) setHorizontalPageScroll: (CGFloat)aFloat { _hPageScroll = aFloat; } - (void) setVerticalPageScroll: (CGFloat)aFloat { _vPageScroll = aFloat; } - (CGFloat) pageScroll { if (_hPageScroll != _vPageScroll) [NSException raise: NSInternalInconsistencyException format: @"horizontal and vertical values not same"]; return _vPageScroll; } - (CGFloat) horizontalPageScroll { return _hPageScroll; } - (CGFloat) verticalPageScroll { return _vPageScroll; } - (void) setScrollsDynamically: (BOOL)flag { // FIXME: This should change the behaviour of the scrollers _scrollsDynamically = flag; } - (BOOL) scrollsDynamically { return _scrollsDynamically; } - (NSScroller*) horizontalScroller { return _horizScroller; } - (NSScroller*) verticalScroller { return _vertScroller; } /* * NSCoding protocol */ - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { unsigned long flags = 0; [aCoder encodeObject: _horizScroller forKey: @"NSHScroller"]; [aCoder encodeObject: _vertScroller forKey: @"NSVScroller"]; [aCoder encodeObject: _contentView forKey: @"NSContentView"]; // only encode this, if it's not null... if (_headerClipView != nil) { [aCoder encodeObject: _headerClipView forKey: @"NSHeaderClipView"]; } flags = _borderType; if (_hasVertScroller) flags |= 16; if (_hasHorizScroller) flags |= 32; if (_autohidesScrollers) flags |= 512; [aCoder encodeInt: flags forKey: @"NSsFlags"]; } else { [aCoder encodeObject: _contentView]; // Was int, we need to stay compatible [aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_borderType]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_scrollsDynamically]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_rulersVisible]; [aCoder encodeValueOfObjCType: @encode(float) at: &_hLineScroll]; [aCoder encodeValueOfObjCType: @encode(float) at: &_hPageScroll]; [aCoder encodeValueOfObjCType: @encode(float) at: &_vLineScroll]; [aCoder encodeValueOfObjCType: @encode(float) at: &_vPageScroll]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_hasHorizScroller]; if (_hasHorizScroller) [aCoder encodeObject: _horizScroller]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_hasVertScroller]; if (_hasVertScroller) [aCoder encodeObject: _vertScroller]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_hasHorizRuler]; if (_hasHorizRuler) [aCoder encodeObject: _horizRuler]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_hasVertRuler]; if (_hasVertRuler) [aCoder encodeObject: _vertRuler]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_hasHeaderView]; if (_hasHeaderView) [aCoder encodeObject: _headerClipView]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_hasCornerView]; /* We do not need to encode headerview, cornerview stuff */ } } - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if (!self) return nil; if ([aDecoder allowsKeyedCoding]) { NSScroller *hScroller = [aDecoder decodeObjectForKey: @"NSHScroller"]; NSScroller *vScroller = [aDecoder decodeObjectForKey: @"NSVScroller"]; NSClipView *content = [aDecoder decodeObjectForKey: @"NSContentView"]; NSView *docView = [content documentView]; BOOL post_frame = [docView postsFrameChangedNotifications]; BOOL post_bound = [docView postsBoundsChangedNotifications]; [docView setPostsFrameChangedNotifications: NO]; [docView setPostsBoundsChangedNotifications: NO]; _hLineScroll = 10; _hPageScroll = 10; _vLineScroll = 10; _vPageScroll = 10; _scrollsDynamically = YES; /* _autohidesScroller, _rulersVisible, _hasHorizRuler and _hasVertRuler implicitly set to NO */ if ([aDecoder containsValueForKey: @"NSsFlags"]) { int flags = [aDecoder decodeInt32ForKey: @"NSsFlags"]; _borderType = flags & 3; _hasVertScroller = (flags & 16) == 16; _hasHorizScroller = (flags & 32) == 32; _autohidesScrollers = (flags & 512) == 512; } /* FIXME: This should only happen when we load a Mac NIB file. And as far as I can tell tile is handling this correctly. if (vScroller != nil && _hasVertScroller && content != nil) { // Move the content view since it is not moved when we retile. NSRect frame = [content frame]; float w = [vScroller frame].size.width; // // Slide the content view over, since on Mac OS X the scroller is on the // right, the content view is not properly positioned since our scroller // is on the left. // frame.origin.x += w; [content setFrame: frame]; } */ if (hScroller != nil && _hasHorizScroller) { [self setHorizontalScroller: hScroller]; [hScroller setHidden: NO]; } if (vScroller != nil && _hasVertScroller) { [self setVerticalScroller: vScroller]; [vScroller setHidden: NO]; } if ([aDecoder containsValueForKey: @"NSHeaderClipView"]) { _hasHeaderView = YES; _headerClipView = [aDecoder decodeObjectForKey: @"NSHeaderClipView"]; } // set the document view into the content. [self setContentView: content]; [self tile]; // Reenable notification sending. [docView setPostsFrameChangedNotifications: post_frame]; [docView setPostsBoundsChangedNotifications: post_bound]; } else { int version = [aDecoder versionForClassName: @"NSScrollView"]; NSDebugLLog(@"NSScrollView", @"NSScrollView: start decoding\n"); _contentView = [aDecoder decodeObject]; // Was int, we need to stay compatible [aDecoder decodeValueOfObjCType: @encode(NSInteger) at: &_borderType]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_scrollsDynamically]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_rulersVisible]; [aDecoder decodeValueOfObjCType: @encode(float) at: &_hLineScroll]; [aDecoder decodeValueOfObjCType: @encode(float) at: &_hPageScroll]; [aDecoder decodeValueOfObjCType: @encode(float) at: &_vLineScroll]; [aDecoder decodeValueOfObjCType: @encode(float) at: &_vPageScroll]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_hasHorizScroller]; if (_hasHorizScroller) [aDecoder decodeValueOfObjCType: @encode(id) at: &_horizScroller]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_hasVertScroller]; if (_hasVertScroller) [aDecoder decodeValueOfObjCType: @encode(id) at: &_vertScroller]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_hasHorizRuler]; if (_hasHorizRuler) [aDecoder decodeValueOfObjCType: @encode(id) at: &_horizRuler]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_hasVertRuler]; if (_hasVertRuler) [aDecoder decodeValueOfObjCType: @encode(id) at: &_vertRuler]; if (version == 2) { [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_hasHeaderView]; if (_hasHeaderView) _headerClipView = [aDecoder decodeObject]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_hasCornerView]; } else if (version == 1) { /* This recreates all the info about headerView, cornerView, etc */ [self setDocumentView: [_contentView documentView]]; } else { NSLog(@"unknown NSScrollView version (%d)", version); DESTROY(self); return nil; } [self tile]; NSDebugLLog(@"NSScrollView", @"NSScrollView: finish decoding\n"); } [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_themeDidActivate:) name: GSThemeDidActivateNotification object: nil]; return self; } @end @implementation NSScrollView (GSPrivate) /* GNUstep private method */ /* we update both of these at the same time during -tile so there is no reason in seperating them that'd just add message passing */ - (void) _synchronizeHeaderAndCornerView { BOOL hadHeaderView = _hasHeaderView; BOOL hadCornerView = _hasCornerView; NSView *aView = nil; _hasHeaderView = ([[self documentView] respondsToSelector: @selector(headerView)] && (aView=[(NSTableView *)[self documentView] headerView])); if (_hasHeaderView == YES) { if (hadHeaderView == NO) { _headerClipView = [NSClipView new]; [self addSubview: _headerClipView]; RELEASE(_headerClipView); } [_headerClipView setDocumentView: aView]; } else if (hadHeaderView == YES) { [self removeSubview: _headerClipView]; } if (_hasHeaderView == YES && _hasVertScroller == YES) { aView = nil; _hasCornerView = ([[self documentView] respondsToSelector: @selector(cornerView)] && (aView=[(NSTableView *)[self documentView] cornerView])); if (aView == _cornerView) return; if (_hasCornerView == YES) { if (hadCornerView == NO) { [self addSubview: aView]; } else { [self replaceSubview: _cornerView with: aView]; } } else if (hadCornerView == YES) { [self removeSubview: _cornerView]; } _cornerView = aView; } else if (_cornerView != nil) { [self removeSubview: _cornerView]; _cornerView = nil; _hasCornerView = NO; } } - (void) _themeDidActivate: (NSNotification*)notification { // N.B. Reload cached [NSScroller scrollerWidth] since the // new theme may have a different scroller width. // // Since scrollerWidth is a static, it will get overwritten // several times; doesn't matter though. scrollerWidth = [NSScroller scrollerWidth]; [self tile]; } @end gnustep-gui-0.24.0/Source/NSAffineTransform.m0000664000076500007650000001755512104255431020717 0ustar brains99brains99/** NSAffineTransform.m This class provides a way to perform affine transforms. It provides a matrix for transforming from one coordinate system to another. Copyright (C) 1996,1999 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: August 1997 Author: Richard Frith-Macdonald Date: March 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #include #import #import #import #import #import "AppKit/NSAffineTransform.h" #import "AppKit/NSBezierPath.h" #import "AppKit/PSOperators.h" /* Private definitions */ #define A matrix.m11 #define B matrix.m12 #define C matrix.m21 #define D matrix.m22 #define TX matrix.tX #define TY matrix.tY /* A Postscript matrix looks like this: / a b 0 \ | c d 0 | \ tx ty 1 / */ static const CGFloat pi = 3.1415926535897932384626434; @implementation NSAffineTransform (GUIAdditions) /** * Concatenates the receiver's matrix with the one in the current graphics * context. */ - (void) concat { // FIXME Should use GSConcatCTM: NSAffineTransformStruct ats = [self transformStruct]; CGFloat floatMatrix[6]; floatMatrix[0] = ats.m11; floatMatrix[1] = ats.m12; floatMatrix[2] = ats.m21; floatMatrix[3] = ats.m22; floatMatrix[4] = ats.tX; floatMatrix[5] = ats.tY; PSconcat(floatMatrix); } /** * Get the currently active graphics context's transformation * matrix and set it into the receiver. */ - (void) set { GSSetCTM(GSCurrentContext(), self); } /** *

Applies the receiver's transformation matrix to each point in * the bezier path, then returns the result. The original bezier * path is not modified. *

*/ - (NSBezierPath*) transformBezierPath: (NSBezierPath*)aPath { NSBezierPath *path = [aPath copy]; [path transformUsingAffineTransform: self]; return AUTORELEASE(path); } @end /* NSAffineTransform (GUIAdditions) */ @implementation NSAffineTransform (GNUstep) - (void) scaleTo: (CGFloat)sx : (CGFloat)sy { NSAffineTransformStruct matrix = [self transformStruct]; /* If it's rotated. */ if (B != 0 || C != 0) { // FIXME: This case does not handle shear. CGFloat angle = [self rotationAngle]; // Keep the translation and add scaling A = sx; B = 0; C = 0; D = sy; [self setTransformStruct: matrix]; // Prepend the rotation to the scaling and translation [self rotateByDegrees: angle]; } else { A = sx; B = 0; C = 0; D = sy; [self setTransformStruct: matrix]; } } - (void) translateToPoint: (NSPoint)point { [self translateXBy: point.x yBy: point.y]; } - (void) makeIdentityMatrix { [self init]; } - (void) setFrameOrigin: (NSPoint)point { NSAffineTransformStruct matrix = [self transformStruct]; CGFloat dx = point.x - TX; CGFloat dy = point.y - TY; [self translateXBy: dx yBy: dy]; } - (void) setFrameRotation: (CGFloat)angle { [self rotateByDegrees: angle - [self rotationAngle]]; } - (CGFloat) rotationAngle { NSAffineTransformStruct matrix = [self transformStruct]; CGFloat rotationAngle = atan2(-C, A); rotationAngle *= 180.0 / pi; if (rotationAngle < 0.0) rotationAngle += 360.0; return rotationAngle; } - (void) concatenateWith: (NSAffineTransform*)anotherMatrix { GSOnceMLog(@"deprecated ... use -prependTransform:"); [self prependTransform: anotherMatrix]; } - (void) concatenateWithMatrix: (const float[6])anotherMatrix { NSAffineTransformStruct amat; NSAffineTransform *other; GSOnceMLog(@"deprecated ... use -prependTransform:"); amat.m11 = anotherMatrix[0]; amat.m12 = anotherMatrix[1]; amat.m21 = anotherMatrix[2]; amat.m22 = anotherMatrix[3]; amat.tX = anotherMatrix[4]; amat.tY = anotherMatrix[5]; other = [NSAffineTransform new]; [other setTransformStruct: amat]; [self prependTransform: other]; RELEASE(other); } - (void)inverse { GSOnceMLog(@"deprecated ... use -invert:"); [self invert]; } - (BOOL) isRotated { NSAffineTransformStruct matrix = [self transformStruct]; if (B == 0 && C == 0) { return NO; } else { return YES; } } - (void) boundingRectFor: (NSRect)rect result: (NSRect*)newRect { NSAffineTransformStruct matrix = [self transformStruct]; /* Shortcuts of the usual rect values */ CGFloat x = rect.origin.x; CGFloat y = rect.origin.y; CGFloat width = rect.size.width; CGFloat height = rect.size.height; CGFloat xc[3]; CGFloat yc[3]; CGFloat min_x; CGFloat max_x; CGFloat min_y; CGFloat max_y; int i; max_x = A * x + C * y + TX; max_y = B * x + D * y + TY; xc[0] = max_x + A * width; yc[0] = max_y + B * width; xc[1] = max_x + C * height; yc[1] = max_y + D * height; xc[2] = max_x + A * width + C * height; yc[2] = max_y + B * width + D * height; min_x = max_x; min_y = max_y; for (i = 0; i < 3; i++) { if (xc[i] < min_x) min_x = xc[i]; if (xc[i] > max_x) max_x = xc[i]; if (yc[i] < min_y) min_y = yc[i]; if (yc[i] > max_y) max_y = yc[i]; } newRect->origin.x = min_x; newRect->origin.y = min_y; newRect->size.width = max_x -min_x; newRect->size.height = max_y -min_y; } - (NSPoint) pointInMatrixSpace: (NSPoint)point { GSOnceMLog(@"deprecated ... use -transformPoint:"); return [self transformPoint: point]; } - (NSPoint) deltaPointInMatrixSpace: (NSPoint)point { NSAffineTransformStruct matrix = [self transformStruct]; NSPoint new; new.x = A * point.x + C * point.y; new.y = B * point.x + D * point.y; return new; } - (NSSize) sizeInMatrixSpace: (NSSize)size { GSOnceMLog(@"deprecated ... use -transformSize:"); return [self transformSize: size]; } - (NSRect) rectInMatrixSpace: (NSRect)rect { NSRect new; new.origin = [self transformPoint: rect.origin]; new.size = [self transformSize: rect.size]; if (new.size.width < 0) { new.origin.x += new.size.width; new.size.width *= -1; } if (new.size.height < 0) { new.origin.y += new.size.height; new.size.height *= -1; } return new; } - (void) setMatrix: (const float[6])replace { NSAffineTransformStruct matrix; GSOnceMLog(@"deprecated ... use -setTransformStruct:"); matrix.m11 = replace[0]; matrix.m12 = replace[1]; matrix.m21 = replace[2]; matrix.m22 = replace[3]; matrix.tX = replace[4]; matrix.tY = replace[5]; [self setTransformStruct: matrix]; } - (void) getMatrix: (float[6])replace { NSAffineTransformStruct matrix = [self transformStruct]; GSOnceMLog(@"deprecated ... use -transformStruct"); replace[0] = matrix.m11; replace[1] = matrix.m12; replace[2] = matrix.m21; replace[3] = matrix.m22; replace[4] = matrix.tX; replace[5] = matrix.tY; } - (void) takeMatrixFromTransform: (NSAffineTransform *)aTransform { NSAffineTransformStruct matrix; GSOnceMLog(@"deprecated ... use -transformStruct and setTransformStruct:"); matrix = [aTransform transformStruct]; [self setTransformStruct: matrix]; } @end /* NSAffineTransform (GNUstep) */ gnustep-gui-0.24.0/Source/NSOpenGLView.m0000664000076500007650000001444312066646726017625 0ustar brains99brains99/** NSOpenGLView.m Context for openGL drawing Copyright (C) 1996 Free Software Foundation, Inc. Author: Frederic De Jaeger Date: 2002 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import "AppKit/NSOpenGL.h" #import "AppKit/NSOpenGLView.h" // Declare a private method of NSView @interface NSView (Private) - (void) _lockFocusInContext: (NSGraphicsContext *)ctxt inRect: (NSRect)rect; - (void) _viewWillMoveToWindow: (NSWindow*)newWindow; @end /** NSOpenGLView

This class is simply a view with a NSOpenGLContext attached to it. This is the simplest way to initialize a GL context within GNUstep.

There is a mechanism to update the context when the view is moved or resize.

*/ static NSOpenGLPixelFormat *fmt = nil; static NSOpenGLPixelFormatAttribute attrs[] = { NSOpenGLPFADoubleBuffer, NSOpenGLPFADepthSize, 16, NSOpenGLPFAColorSize, 1, 0 }; // NSOpenGLPixelFormatAttribute attrs[] = // { // NSOpenGLPFADoubleBuffer, // NSOpenGLPFADepthSize, 32, // 0 // }; @implementation NSOpenGLView /** return a standard NSOpenGLPixelFormat you can pass to the initWithFrame: pixelFormat: method */ + (NSOpenGLPixelFormat*) defaultPixelFormat { // Initialize it once if (!fmt) fmt = [[NSOpenGLPixelFormat alloc] initWithAttributes: attrs]; if (fmt) return fmt; else { NSWarnMLog(@"could not find a reasonable pixel format..."); return nil; } } /** detach from the current context. You should call it before releasing this object. */ - (void) clearGLContext { if (glcontext) { [glcontext clearDrawable]; DESTROY(glcontext); prepared = NO; } } - (void) setOpenGLContext: (NSOpenGLContext*)context { if ( context != glcontext ) { [self clearGLContext]; ASSIGN(glcontext, context); } } - (void) prepareOpenGL { } /** return the current gl context associated with this view */ - (NSOpenGLContext*) openGLContext { if (glcontext == nil) { NSOpenGLContext *context = [[NSOpenGLContext alloc] initWithFormat: pixel_format shareContext: nil]; [self setOpenGLContext: context]; [context setView: self]; RELEASE(context); } return glcontext; } -(id) initWithFrame: (NSRect)frameRect { return [self initWithFrame: frameRect pixelFormat: [[self class] defaultPixelFormat]]; } /** default initializer. Can be passed [NSOpenGLContext defaultPixelFormat] as second argument */ - (id) initWithFrame: (NSRect)frameRect pixelFormat: (NSOpenGLPixelFormat*)format { self = [super initWithFrame: frameRect]; if (!self) return nil; ASSIGN(pixel_format, format); [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_frameChanged:) name: NSViewGlobalFrameDidChangeNotification object: self]; [self setPostsFrameChangedNotifications: YES]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_frameChanged:) name: NSViewFrameDidChangeNotification object: self]; return self; } - (void) dealloc { [[NSNotificationCenter defaultCenter] removeObserver: self]; [self clearGLContext]; RELEASE(pixel_format); NSDebugMLLog(@"GL", @"deallocating"); [super dealloc]; } - (NSOpenGLPixelFormat*) pixelFormat { return pixel_format; } - (void) setPixelFormat: (NSOpenGLPixelFormat*)pixelFormat { ASSIGN(pixel_format, pixelFormat); } - (void) reshape { } - (void) update { NSOpenGLContext *context; context = [self openGLContext]; if ([context view] == self) { [context update]; } } - (BOOL) isOpaque { return YES; } - (void) _frameChanged: (NSNotification *) aNot { if (prepared) { [[self openGLContext] makeCurrentContext]; [self update]; [self reshape]; } } /* FIXME: this should be done in [lockFocus] or [lockFocusInRect:]. */ - (void) _lockFocusInContext: (NSGraphicsContext *)ctxt inRect: (NSRect)rect { NSOpenGLContext *context; context = [self openGLContext]; [super _lockFocusInContext: ctxt inRect: rect]; [context makeCurrentContext]; if ([context view] != self) { [context setView:self]; } if (!prepared) { [self prepareOpenGL]; prepared = YES; [self reshape]; } } -(void) _viewWillMoveToWindow: (NSWindow *) newWindow { [super _viewWillMoveToWindow: newWindow]; if ([self window] != newWindow) { // the context will be recreated in the new window if needed [[self openGLContext] clearDrawable]; } } - (id) initWithCoder: (NSCoder *)aDecoder { self = [super initWithCoder: aDecoder]; if (!self) return nil; if ([aDecoder allowsKeyedCoding]) { [self setPixelFormat: [aDecoder decodeObjectForKey: @"NSPixelFormat"]]; } else { [self setPixelFormat: [[self class] defaultPixelFormat]]; } [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_frameChanged:) name: NSViewGlobalFrameDidChangeNotification object: self]; [self setPostsFrameChangedNotifications: YES]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_frameChanged:) name: NSViewFrameDidChangeNotification object: self]; return self; } @end gnustep-gui-0.24.0/Source/GSSlideView.h0000664000076500007650000000260111534147002017474 0ustar brains99brains99/** -*- mode: ObjC -*- GSSlideView View that is slid by NSWorkspace Copyright (C) 2002 Free Software Foundation, Inc. Written By: enrico@imago.ro Date: Jan 2002 This file is part of the GNU Objective C User Interface library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import "AppKit/NSView.h" @class NSCell; @interface GSSlideView : NSView { NSCell *slideCell; } + (BOOL) _slideImage: (NSImage*)image from: (NSPoint)fromPoint to: (NSPoint)toPoint; @end gnustep-gui-0.24.0/Source/NSShadow.m0000664000076500007650000000645311352624326017062 0ustar brains99brains99/* NSShadow.m GUI implementation of a shadow effect. Copyright (C) 2009 Free Software Foundation, Inc. Author: Eric Wasylishen Date: Dec 2009 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import "AppKit/NSShadow.h" #import "AppKit/NSColor.h" @implementation NSShadow - (id) init { if ((self = [super init])) { _offset = NSMakeSize(0,0); _radius = 0; ASSIGN(_color, [[NSColor blackColor] colorWithAlphaComponent: 0.333]); } return self; } - (id) copyWithZone: (NSZone*)zone { NSShadow *s = (NSShadow*)NSCopyObject(self, 0, zone); RETAIN(s->_color); return s; } - (void) dealloc { DESTROY(_color); [super dealloc]; } - (NSString *) description { return [NSString stringWithFormat: @"NSShadow {%f, %f} blur = %f color = %@", (float)_offset.width, (float)_offset.height, (float)_radius, [_color description]]; } - (NSSize) shadowOffset { return _offset; } - (void) setShadowOffset: (NSSize)offset { _offset = offset; } - (CGFloat) shadowBlurRadius { return _radius; } - (void) setShadowBlurRadius: (CGFloat)radius { _radius = radius; } - (NSColor *) shadowColor { return _color; } - (void) setShadowColor: (NSColor *)color { ASSIGN(_color, color); } - (void) set { // FIXME: Implement } - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { [aCoder encodeFloat: _radius forKey: @"NSShadowBlurRadius"]; [aCoder encodeFloat: _offset.width forKey: @"NSShadowHoriz"]; [aCoder encodeFloat: _offset.height forKey: @"NSShadowVert"]; [aCoder encodeObject: _color forKey: @"NSShadowColor"]; } else { float radius = _radius; [aCoder encodeValueOfObjCType: @encode(float) at: &radius]; [aCoder encodeSize: _offset]; [aCoder encodeObject: _color]; } } - (id) initWithCoder: (NSCoder*)aDecoder { self = [super init]; if (self == nil) return nil; if ([aDecoder allowsKeyedCoding]) { _radius = [aDecoder decodeFloatForKey: @"NSShadowBlurRadius"]; _offset = NSMakeSize([aDecoder decodeFloatForKey: @"NSShadowHoriz"], [aDecoder decodeFloatForKey: @"NSShadowVert"]); _color = [[aDecoder decodeObjectForKey: @"NSShadowColor"] retain]; } else { float radius; [aDecoder decodeValueOfObjCType: @encode(float) at: &radius]; _radius = radius; _offset = [aDecoder decodeSize]; _color = [[aDecoder decodeObject] retain]; } return self; } @end gnustep-gui-0.24.0/Source/DocMakefile0000664000076500007650000001255111530272521017272 0ustar brains99brains99# # Makefile for GNUstep Base Library documentation. # # Copyright (C) 2002 Free Software Foundation, Inc. # # Written by: Richard Frith-Macdonald # # This file is part of the GNUstep Base Library. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. MAKEFILE_NAME = DocMakefile include $(GNUSTEP_MAKEFILES)/common.make ADD_THESE_QUESTION_MARK = \ NSColorPicking.h \ NSGraphics.h \ NSNibConnector.h \ NSNibDeclarations.h \ NSNibLoading.h \ NSSpellProtocol.h \ NSUserInterfaceValidation.h \ # These are gui headers that are also classes documented with autogsdoc AUTOGSDOC_HEADERS_GUI = \ NSActionCell.h \ NSAffineTransform.h \ NSApplication.h \ NSAttributedString.h \ NSBezierPath.h \ NSBitmapImageRep.h \ NSBox.h \ NSBrowser.h \ NSBrowserCell.h \ NSButton.h \ NSButtonCell.h \ NSCachedImageRep.h \ NSCell.h \ NSClipView.h \ NSColor.h \ NSColorList.h \ NSColorPanel.h \ NSColorPicker.h \ NSColorWell.h \ NSComboBox.h \ NSComboBoxCell.h \ NSControl.h \ NSCursor.h \ NSCustomImageRep.h \ NSDataLink.h \ NSDataLinkManager.h \ NSDataLinkPanel.h \ NSDocument.h \ NSDocumentController.h \ NSDrawer.h \ NSEPSImageRep.h \ NSEvent.h \ NSFileWrapper.h \ NSFont.h \ NSFontManager.h \ NSFontPanel.h \ NSForm.h \ NSFormCell.h \ NSGraphicsContext.h \ NSHelpManager.h \ NSHelpPanel.h \ NSImage.h \ NSImageCell.h \ NSImageRep.h \ NSImageView.h \ NSInputManager.h \ NSInputServer.h \ NSInterfaceStyle.h \ NSLayoutManager.h \ NSMatrix.h \ NSMenu.h \ NSMenuItem.h \ NSMenuItemCell.h \ NSMenuView.h \ NSNib.h \ NSOpenGL.h \ NSOpenGLView.h \ NSOpenPanel.h \ NSOutlineView.h \ NSPageLayout.h \ NSPanel.h \ NSParagraphStyle.h \ NSPasteboard.h \ NSPopUpButton.h \ NSPopUpButtonCell.h \ NSPrintInfo.h \ NSPrintOperation.h \ NSPrintPanel.h \ NSPrinter.h \ NSProgressIndicator.h \ NSResponder.h \ NSRulerMarker.h \ NSRulerView.h \ NSSavePanel.h \ NSScreen.h \ NSScrollView.h \ NSScroller.h \ NSSecureTextField.h \ NSSelection.h \ NSSlider.h \ NSSliderCell.h \ NSSound.h \ NSSpellChecker.h \ NSSpellServer.h \ NSSplitView.h \ NSStepper.h \ NSStepperCell.h \ NSStringDrawing.h \ NSTabView.h \ NSTabViewItem.h \ NSTableColumn.h \ NSTableHeaderCell.h \ NSTableHeaderView.h \ NSTableView.h \ NSText.h \ NSTextAttachment.h \ NSTextContainer.h \ NSTextField.h \ NSTextFieldCell.h \ NSTextStorage.h \ NSTextView.h \ NSToolbar.h \ NSToolbarItem.h \ NSView.h \ NSWindow.h \ NSWindowController.h \ NSWorkspace.h AUTOGSDOC_HEADERS_GUIADD = \ GSDisplayServer.h \ GSTheme.h \ GSTable.h \ GSHbox.h \ GSVbox.h \ DOCUMENT_NAME = Gui GuiAdditions Gui_DOC_INSTALL_DIR = Developer/Gui/Reference GuiAdditions_DOC_INSTALL_DIR = Developer/Gui/Reference Gui_AGSDOC_FILES = ../Documentation/Gui.gsdoc \ $(AUTOGSDOC_HEADERS_GUI) GuiAdditions_AGSDOC_FILES = $(AUTOGSDOC_HEADERS_GUIADD) \ ../Documentation/GuiAdditions.gsdoc # # Hack ... using the -DocumentationDirectory flag overrides the value # used by the make package, and puts our output in the documentation # directory. # Gui_AGSDOC_FLAGS = \ -MakeFrames YES \ -DocumentationDirectory ../Documentation/Gui \ -HeaderDirectory ../Headers/AppKit \ -Declared AppKit \ -Standards YES \ -ConstantsTemplate TypesAndConstants \ -FunctionsTemplate Functions \ -MacrosTemplate Functions \ -TypedefsTemplate TypesAndConstants \ -VariablesTemplate TypesAndConstants \ -WordMap '{\ APPKIT_EXPORT=extern;APPKIT_DECLARE="";\ DEFINE_RINT_IF_MISSING=""; \ }' -Up Gui GuiAdditions_AGSDOC_FLAGS = \ -MakeFrames YES \ -DocumentationDirectory ../Documentation/GuiAdditions \ -HeaderDirectory ../Headers/Additions/GNUstepGUI \ -Declared GNUstepGUI \ -Standards YES \ -ConstantsTemplate TypesAndConstants \ -FunctionsTemplate Functions \ -MacrosTemplate Functions \ -TypedefsTemplate TypesAndConstants \ -VariablesTemplate TypesAndConstants \ -WordMap '{\ APPKIT_EXPORT=extern;APPKIT_DECLARE="";\ DEFINE_RINT_IF_MISSING=""; \ }' -Up GuiAdditions include $(GNUSTEP_MAKEFILES)/documentation.make before-all:: ../Documentation/Gui \ ../Documentation/GuiAdditions cp ../Documentation/Gui.gsdoc . cp ../Documentation/GuiAdditions.gsdoc . ../Documentation/Gui: $(MKDIRS) ../Documentation/Gui ../Documentation/GuiAdditions: $(MKDIRS) ../Documentation/GuiAdditions # # Work around our screwy doc generation implementation, sigh... # before-clean:: if [ -e obj ]; then \ mv obj obj-save-link; \ fi # # Clean up temporary files used while generating documentation. # after-clean:: $(RM) Gui.gsdoc $(RM) GuiAdditions.gsdoc if [ -d Gui ]; then \ $(RM) Gui/stamp; \ $(RM) Gui/dependencies; \ rmdir Gui; \ $(RM) GuiAdditions/stamp; \ $(RM) GuiAdditions/dependencies; \ rmdir GuiAdditions; \ fi if [ -e obj-save-link ]; then \ mv obj-save-link obj; \ fi gnustep-gui-0.24.0/Source/NSOpenGLContext.m0000664000076500007650000000700512010277645020320 0ustar brains99brains99/** NSOpenGLContext.m Context for openGL drawing Copyright (C) 1996 Free Software Foundation, Inc. Author: Frederic De Jaeger Date: 2002 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import "AppKit/NSOpenGL.h" #import "GNUstepGUI/GSDisplayServer.h" @implementation NSOpenGLContext + _classContext { Class glContextClass = [GSCurrentServer() glContextClass]; if (glContextClass == nil) { NSWarnMLog(@"Backend doesn't have any gl context"); return nil; } else { NSDebugMLLog(@"GLX", @"found something"); return glContextClass; } } + allocWithZone: (NSZone *) z { Class c = [self _classContext]; if (c) return NSAllocateObject(c, 0, z); else return nil; } + (void)clearCurrentContext { [[self _classContext] clearCurrentContext]; } + (NSOpenGLContext *)currentContext { /* FIXME - There doesn't seem to be a way to fix the following * warning. */ return [[self _classContext] currentContext]; } - (void *)CGLContextObj { [self subclassResponsibility: _cmd]; return NULL; } - (void)clearDrawable { [self subclassResponsibility: _cmd]; } - (void)copyAttributesFromContext:(NSOpenGLContext *)context withMask:(unsigned long)mask { [self subclassResponsibility: _cmd]; } - (void)createTexture:(unsigned long)target fromView:(NSView*)view internalFormat:(unsigned long)format { [self subclassResponsibility: _cmd]; } - (int)currentVirtualScreen { [self subclassResponsibility: _cmd]; return 0; } - (void)flushBuffer { [self subclassResponsibility: _cmd]; } - (void)getValues:(long *)vals forParameter:(NSOpenGLContextParameter)param { [self subclassResponsibility: _cmd]; } - (id)initWithCGLContextObj:(void *)context { [self subclassResponsibility: _cmd]; return nil; } - (id)initWithFormat:(NSOpenGLPixelFormat *)format shareContext:(NSOpenGLContext *)share { [self subclassResponsibility: _cmd]; return nil; } - (void)makeCurrentContext { [self subclassResponsibility: _cmd]; } - (void)setCurrentVirtualScreen:(int)screen { [self subclassResponsibility: _cmd]; } - (void)setFullScreen { [self subclassResponsibility: _cmd]; } - (void)setOffScreen:(void *)baseaddr width:(long)width height:(long)height rowbytes:(long)rowbytes { [self subclassResponsibility: _cmd]; } - (void)setValues:(const long *)vals forParameter:(NSOpenGLContextParameter)param { [self subclassResponsibility: _cmd]; } - (void)setView:(NSView *)view { [self subclassResponsibility: _cmd]; } - (void)update { [self subclassResponsibility: _cmd]; } - (NSView *)view { [self subclassResponsibility: _cmd]; return nil; } @end gnustep-gui-0.24.0/Source/GSKeyBindingAction.h0000664000076500007650000000657611376454556021024 0ustar brains99brains99/* GSKeyBindingAction.h -*-objc-*- Copyright (C) 2002 Free Software Foundation, Inc. Author: Nicola Pero Date: February 2002 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GS_KEYBINDING_ACTION_H #define _GS_KEYBINDING_ACTION_H #import @class NSInputManager; /* A GSKeyBindingAction represents a special action to perform. This * action can be bound to any sequence of keystrokes. When the * approrpriate sequence of keystrokes is read from the keyboard, the * GSKeyBindingAction object is retrieved, and it is executed. Once * the action object is performed, all the keystrokes which caused the * action to be performed are forgotten. Normally, we store into * action objects only actions which we want to be able to store in * our complicated keybinding tables ... so the default action of * inserting a keystroke into the text is not stored into an action * object. */ @interface GSKeyBindingAction: NSObject {} /* To execute the action, call the following method. The * implementation of the GSKeyBindingAction class does nothing - * actually, it raises an exception. Subclasses should implement this * to do what they need - in the implementation they can call any * methods of the input manager, to execute selectors (by calling * doCommandBySelector: one or multiple times), or to influence the * interpretation of further keystrokes (by modifying the input * manager context) - for example to cause the next keystroke to be * quoted (inserted literally into the text), or the next action to be * repeated N times [or, conceptually, also stuff like starting/ending * the recording of a keyboard macro, even if we don't need that]. */ - (void) performActionWithInputManager: (NSInputManager *)manager; @end /* This subclass represents a keybinding where the keystroke is bound * to a single selector. */ @interface GSKeyBindingActionSelector : GSKeyBindingAction { SEL _selector; } - (id) initWithSelectorName: (NSString *)sel; @end /* This subclass represents a keybinding where the keystroke is bound * to an array of selectors. */ @interface GSKeyBindingActionSelectorArray : GSKeyBindingAction { /* Array of selectors. */ SEL *_selectors; /* Lenght of the array of selectors. */ int _selectorsCount; } - (id) initWithSelectorNames: (NSArray *)sels; @end /* This subclass represents the action of quoting literally the next * keystroke. It is normally bound to Control-q. */ @interface GSKeyBindingActionQuoteNextKeyStroke : GSKeyBindingAction {} @end #endif /* _GS_KEYBINDING_ACTION_H */ gnustep-gui-0.24.0/Source/GSAutocompleteWindow.h0000664000076500007650000000376212160375434021453 0ustar brains99brains99/* Copyright (C) 2013 Free Software Foundation, Inc. Author: German A. Arias Date: 2013 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import @class GSAutocompleteView; @class NSArray; @class NSString; @class NSNotification; @class NSNotificationCenter; @class NSTableColumn; @class NSTableView; @class NSTextView; @interface GSAutocompleteWindow : NSPanel { BOOL _stopped; NSRange _range; NSTextView *_textView; GSAutocompleteView *_tableView; //Retained NSString *_originalWord; NSArray *_words; } + (GSAutocompleteWindow *) defaultWindow; - (void) layout; - (void) computePosition; - (void) displayForTextView: (NSTextView *)textView; - (NSArray *) words; - (void) runModalWindow; - (void) runLoop; - (void) onWindowEdited: (NSNotification *)notification; - (void) reloadData; - (void) updateTextViewWithMovement: (NSInteger)movement isFinal: (BOOL)flag; - (void) clickItem: (id)sender; - (void) moveUpSelection; - (void) moveDownSelection; // Delegate - (int) numberOfRowsInTableView: (NSTableView*)aTableView; - (id) tableView: (NSTableView*)aTableView objectValueForTableColumn: (NSTableColumn*)aTableColumn row: (int)rowIndex; @end gnustep-gui-0.24.0/Source/NSNibBindingConnector.m0000664000076500007650000001016312102166206021474 0ustar brains99brains99/** NSNibBindingConnector Copyright (C) 2007 Free Software Foundation, Inc. Author: Gregory John Casamento Date: 2007 Author: Fred Kiefer Date: Nov 2007 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import @implementation NSNibBindingConnector - (id) init { if((self = [super init]) != nil) { _binding = @""; _keyPath = @""; _options = RETAIN([NSMutableDictionary dictionary]); } return self; } - (void) dealloc { RELEASE(_binding); RELEASE(_keyPath); RELEASE(_options); [super dealloc]; } - (NSString *) binding { return _binding; } - (NSString *) keyPath { return _keyPath; } - (NSDictionary *) options { return _options; } - (void) setBinding: (NSString *)binding { ASSIGN(_binding, binding); } - (void) setKeyPath: (NSString *)keyPath { ASSIGN(_keyPath, keyPath); } - (void) setOptions: (NSDictionary *)options { ASSIGN(_options, options); } - (void) replaceObject: (id)anObject withObject: (id)anotherObject { if (_binding == anObject) { ASSIGN(_binding, anotherObject); } if (_keyPath == anObject) { ASSIGN(_keyPath, anotherObject); } if (_options == anObject) { ASSIGN(_options, anotherObject); } [super replaceObject: anObject withObject: anotherObject]; } - (void) establishConnection { [_src bind: _binding toObject: _dst withKeyPath: _keyPath options: _options]; } - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { if (_binding != nil) { [aCoder encodeObject: _binding forKey: @"NSBinding"]; } if (_keyPath != nil) { [aCoder encodeObject: _keyPath forKey: @"NSKeyPath"]; } if (_options != nil) { [aCoder encodeObject: _options forKey: @"NSOptions"]; } } else { [aCoder encodeObject: _binding]; [aCoder encodeObject: _keyPath]; [aCoder encodeObject: _options]; } } - (id) initWithCoder: (NSCoder*)aDecoder { if (!(self = [super initWithCoder: aDecoder])) { return nil; } if ([aDecoder allowsKeyedCoding]) { if ([aDecoder decodeIntForKey: @"NSNibBindingConnectorVersion"] != 2) { RELEASE(self); return nil; } if ([aDecoder containsValueForKey: @"NSBinding"]) { ASSIGN(_binding, [aDecoder decodeObjectForKey: @"NSBinding"]); } if ([aDecoder containsValueForKey: @"NSKeyPath"]) { ASSIGN(_keyPath, [aDecoder decodeObjectForKey: @"NSKeyPath"]); } if ([aDecoder containsValueForKey: @"NSOptions"]) { ASSIGN(_options, [aDecoder decodeObjectForKey: @"NSOptions"]); } } else { ASSIGN(_binding,[aDecoder decodeObject]); ASSIGN(_keyPath,[aDecoder decodeObject]); ASSIGN(_options,[aDecoder decodeObject]); } return self; } - (NSString *) description { return [NSString stringWithFormat: @"<%@ binding=%@ keypath=%@ options=%@>", [super description], [self binding], [self keyPath], [self options]]; } @end gnustep-gui-0.24.0/Source/GSTable.m0000664000076500007650000007756511537516710016673 0ustar brains99brains99/** GSTable.m The GSTable class (a GNU extension) Copyright (C) 1999 Free Software Foundation, Inc. Author: Nicola Pero Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "GNUstepGUI/GSTable.h" @interface GSTable (Private) -(void) _updateForNewFrameSize: (NSSize)newFrameSize; -(void) _updateRowSize: (int)row; -(void) _updateColumnSize: (int)column; -(void) _updateRowOrigin: (int)row; -(void) _updateColumnOrigin: (int)column; -(void) _updateWholeTable; @end @implementation GSTable: NSView // // Class Methods // +(void) initialize { if (self == [GSTable class]) [self setVersion: 1]; } /* It was reported that the inherited +new implementation doesn't work * on OSX. Override it with a sane implementation to get portability * to OSX. */ +(id) new { return [[self alloc] init]; } // // Instance Methods // // Designated initializer -(id) initWithNumberOfRows: (int)rows numberOfColumns: (int)columns { int i; self = [super init]; if (nil == self) return nil; [super setAutoresizesSubviews: NO]; if (!(rows > 0)) { NSLog (@"Warning: Argument rows <= 0"); rows = 2; } if (!(columns > 0)) { NSLog (@"Warning: Argument columns <= 0"); columns = 2; } _numberOfRows = rows; _numberOfColumns = columns; _minXBorder = 0; _maxXBorder = 0; _minYBorder = 0; _maxYBorder = 0; _jails = NSZoneMalloc (NSDefaultMallocZone (), sizeof (NSView *) * (rows * columns)); _expandRow = NSZoneMalloc (NSDefaultMallocZone (), sizeof (BOOL) * rows); _expandColumn = NSZoneMalloc (NSDefaultMallocZone (), sizeof (BOOL) * columns); _columnDimension = NSZoneMalloc (NSDefaultMallocZone (), sizeof (float) * columns); _rowDimension = NSZoneMalloc (NSDefaultMallocZone (), sizeof (float) * rows); _columnXOrigin = NSZoneMalloc (NSDefaultMallocZone (), sizeof (float) * columns); _rowYOrigin = NSZoneMalloc (NSDefaultMallocZone (), sizeof (float) * rows); _minColumnDimension = NSZoneMalloc (NSDefaultMallocZone (), sizeof (float) * columns); _minRowDimension = NSZoneMalloc (NSDefaultMallocZone (), sizeof (float) * rows); _havePrisoner = NSZoneMalloc (NSDefaultMallocZone (), sizeof (BOOL) * (rows * columns)); for (i = 0; i < (rows * columns); i++) { _jails[i] = NULL; _havePrisoner[i] = NO; } for (i = 0; i < rows; i++) { _expandRow[i] = YES; _rowDimension[i] = 0; _rowYOrigin[i] = 0; _minRowDimension[i] = 0; } _expandingRowNumber = rows; for (i = 0; i < columns; i++) { _expandColumn[i] = YES; _columnDimension[i] = 0; _columnXOrigin[i] = 0; _minColumnDimension[i] = 0; } _expandingColumnNumber = columns; _minimumSize = NSZeroSize; return self; } -(id) init { return [self initWithNumberOfRows: 2 numberOfColumns: 2]; } -(void) dealloc { NSZoneFree (NSDefaultMallocZone (), _jails); NSZoneFree (NSDefaultMallocZone (), _expandColumn); NSZoneFree (NSDefaultMallocZone (), _expandRow); NSZoneFree (NSDefaultMallocZone (), _columnDimension); NSZoneFree (NSDefaultMallocZone (), _rowDimension); NSZoneFree (NSDefaultMallocZone (), _columnXOrigin); NSZoneFree (NSDefaultMallocZone (), _rowYOrigin); NSZoneFree (NSDefaultMallocZone (), _minColumnDimension); NSZoneFree (NSDefaultMallocZone (), _minRowDimension); NSZoneFree (NSDefaultMallocZone (), _havePrisoner); [super dealloc]; } - (void) setAutoresizesSubviews: (BOOL)flag { NSLog (@"Warning: attempt to setAutoresizesSubviews for a GSTable!\n"); return; } // // Setting Border. // -(void) setBorder: (float)aBorder { [self setMinXBorder: aBorder]; [self setMaxXBorder: aBorder]; [self setMinYBorder: aBorder]; [self setMaxYBorder: aBorder]; } -(void) setXBorder: (float)aBorder { [self setMinXBorder: aBorder]; [self setMaxXBorder: aBorder]; } -(void) setYBorder: (float)aBorder { [self setMinYBorder: aBorder]; [self setMaxYBorder: aBorder]; } -(void) setMinXBorder: (float)aBorder { float borderChange; NSSize tableSize = [self frame].size; int i; if (aBorder < 0) aBorder = 0; borderChange = aBorder - _minXBorder; for (i = 0; i < _numberOfColumns; i++) { _columnXOrigin[i] += borderChange; [self _updateColumnOrigin: i]; } _minimumSize.width += borderChange; tableSize.width += borderChange; [super setFrameSize: tableSize]; _minXBorder = aBorder; } -(void) setMaxXBorder: (float)aBorder { float borderChange; NSSize tableSize = [self frame].size; if (aBorder < 0) aBorder = 0; borderChange = aBorder - _maxXBorder; _minimumSize.width += borderChange; tableSize.width += borderChange; [super setFrameSize: tableSize]; _maxXBorder = aBorder; } -(void) setMinYBorder: (float)aBorder { float borderChange; NSSize tableSize = [self frame].size; int i; if (aBorder < 0) aBorder = 0; borderChange = aBorder - _minYBorder; for (i = 0; i < _numberOfRows; i++) { _rowYOrigin[i] += borderChange; [self _updateRowOrigin: i]; } _minimumSize.height += borderChange; tableSize.height += borderChange; [super setFrameSize: tableSize]; _minYBorder = aBorder; } -(void) setMaxYBorder: (float)aBorder { float borderChange; NSSize tableSize = [self frame].size; if (aBorder < 0) aBorder = 0; borderChange = aBorder - _maxYBorder; _minimumSize.height += borderChange; tableSize.height += borderChange; [super setFrameSize: tableSize]; _maxYBorder = aBorder; } // // Adding Views // -(void) putView: (NSView *)aView atRow: (int)row column: (int)column { [self putView: aView atRow: row column: column withMinXMargin: 0 maxXMargin: 0 minYMargin: 0 maxYMargin: 0]; } -(void) putView: (NSView *)aView atRow: (int)row column: (int)column withMargins: (float)margins { [self putView: aView atRow: row column: column withMinXMargin: margins maxXMargin: margins minYMargin: margins maxYMargin: margins]; } -(void) putView: (NSView *)aView atRow: (int)row column: (int)column withXMargins: (float)xMargins yMargins: (float)yMargins { [self putView: aView atRow: row column: column withMinXMargin: xMargins maxXMargin: xMargins minYMargin: yMargins maxYMargin: yMargins]; } // The other methods are only wrappers for this one. -(void) putView: (NSView *)aView atRow: (int)row column: (int)column withMinXMargin: (float)minXMargin maxXMargin: (float)maxXMargin minYMargin: (float)minYMargin maxYMargin: (float)maxYMargin { int jailNumber; NSRect oldFrame; NSRect theFrame; NSRect tableFrame = [self frame]; int i; // YES if the GSTable needs to be resized BOOL tableNeedResize = NO; // YES if the {prisoner + margins} needs to be resized to fill the jail. // This is accomplished by creating the jail with the old size (of // {prisoner + margins}), putting the prisoner inside and the resizing // the jail to the new size. BOOL prisonerNeedResize = NO; if (row > (_numberOfRows - 1)) { NSLog (@"Warning: argument row is > (numberOfRows - 1)\n"); return; } if (row < 0) { NSLog (@"Warning: argument row is < 0\n"); return; } if (column > (_numberOfColumns - 1)) { NSLog (@"Warning: argument column is > (numberOfColumns - 1)\n"); return; } if (column < 0) { NSLog (@"Warning: argument column is < 0\n"); return; } oldFrame = [aView frame]; oldFrame.size.width += (minXMargin + maxXMargin); oldFrame.size.height += (minYMargin + maxYMargin); theFrame = oldFrame; jailNumber = row * (_numberOfColumns) + column; // // // Manage Column/Row and aView Sizes // // // // Column // if (theFrame.size.width > _columnDimension[column]) { float xShift = theFrame.size.width - _columnDimension[column]; // Compute new size tableFrame.size tableFrame.size.width += xShift; tableNeedResize = YES; // Resize the column _columnDimension[column] = theFrame.size.width; [self _updateColumnSize: column]; // Shift the columns on the right for (i = column + 1; i < _numberOfColumns; i++) { _columnXOrigin[i] += xShift; [self _updateColumnOrigin: i]; } } else // theFrame.size.width <= _columnDimension[column] { theFrame.size.width = _columnDimension[column]; prisonerNeedResize = YES; } // // Row // if (theFrame.size.height > _rowDimension[row]) { float yShift = theFrame.size.height - _rowDimension[row]; // Compute new size tableFrame.size.height += yShift; tableNeedResize = YES; // Resize the row _rowDimension[row] = theFrame.size.height; [self _updateRowSize: row]; // Shift the rows on the top for (i = row + 1; i < _numberOfRows; i++) { _rowYOrigin[i] += yShift; [self _updateRowOrigin: i]; } } else // theFrame.size.height <= _rowDimension[row] { theFrame.size.height = _rowDimension[row]; prisonerNeedResize = YES; } if (tableNeedResize) { [super setFrameSize: tableFrame.size]; } if (_minColumnDimension[column] < theFrame.size.width) { _minimumSize.width += (theFrame.size.width - _minColumnDimension[column]); _minColumnDimension[column] = theFrame.size.width; } if (_minRowDimension[row] < theFrame.size.height) { _minimumSize.height += (theFrame.size.height - _minRowDimension[row]); _minRowDimension[row] = theFrame.size.height; } // // // Put the jail in the GSTable // // theFrame.origin = NSMakePoint (tableFrame.origin.x + _columnXOrigin[column], tableFrame.origin.y + _rowYOrigin[row]); if (_havePrisoner[jailNumber]) { if (prisonerNeedResize) [_jails[jailNumber] setFrame: oldFrame]; else // !prisonerNeedResize [_jails[jailNumber] setFrame: theFrame]; } else // !_havePrisoner { if (prisonerNeedResize) _jails[jailNumber] = [[NSView alloc] initWithFrame: oldFrame]; else // !prisonerNeedResize _jails[jailNumber] = [[NSView alloc] initWithFrame: theFrame]; [_jails[jailNumber] setAutoresizingMask: NSViewNotSizable]; [_jails[jailNumber] setAutoresizesSubviews: YES]; [self addSubview: _jails[jailNumber]]; [_jails[jailNumber] release]; } // // // Put the prisoner in the jail // // if (!_havePrisoner[jailNumber]) { [_jails[jailNumber] addSubview: aView]; } else // _havePrisoner[jailNumber] { [_jails[jailNumber] replaceSubview: [[_jails[jailNumber] subviews] objectAtIndex: 0] with: aView]; } [aView setFrameOrigin: NSMakePoint (minXMargin, minYMargin)]; if (prisonerNeedResize) [_jails[jailNumber] setFrame: theFrame]; _havePrisoner[jailNumber] = YES; } /* resizeWithOldSuperviewSize: automatically calls setFrame: */ - (void) setFrame: (NSRect)frame { [self _updateForNewFrameSize: frame.size]; [super setFrame: frame]; } - (void) setFrameSize: (NSSize)newFrameSize { [self _updateForNewFrameSize: newFrameSize]; [super setFrameSize: newFrameSize]; } // // Minimum Size // -(NSSize) minimumSize { return _minimumSize; } // // Resizing // -(void) sizeToFit { int i; // This should never happen but anyway. if ((_numberOfColumns == 0) || (_numberOfRows == 0)) { [super setFrameSize: NSZeroSize]; return; } _columnXOrigin[0] = _minXBorder; _columnDimension[0] = _minColumnDimension[0]; _rowYOrigin[0] = _minYBorder; _rowDimension[0] = _minRowDimension[0]; for (i = 1; i < _numberOfColumns; i++) { _columnXOrigin[i] = _columnXOrigin[i - 1] + _columnDimension[i - 1]; _columnDimension[i] = _minColumnDimension[i]; } for (i = 1; i < _numberOfRows; i++) { _rowYOrigin[i] = _rowYOrigin[i - 1] + _rowDimension[i - 1]; _rowDimension[i] = _minRowDimension[i]; } [self _updateWholeTable]; [super setFrameSize: _minimumSize]; } // // Adding Rows and Columns // These should be used to add more rows and columns to the GSTable. // Of course it is faster to create a GSTable with the right number of rows // and columns from the beginning. // -(void) addRow { int j; _numberOfRows++; _havePrisoner = NSZoneRealloc (NSDefaultMallocZone (), _havePrisoner, (_numberOfRows * _numberOfColumns) * (sizeof (BOOL))); _jails = NSZoneRealloc (NSDefaultMallocZone (), _jails, (_numberOfRows * _numberOfColumns) * sizeof (NSView *)); for (j = (_numberOfRows - 1) * _numberOfColumns; j < (_numberOfRows * _numberOfColumns); j++) { _jails[j] = NULL; _havePrisoner[j] = NO; } _expandRow = NSZoneRealloc (NSDefaultMallocZone (), _expandRow, (_numberOfRows) * (sizeof (BOOL))); _expandRow[_numberOfRows - 1] = YES; _expandingRowNumber++; _rowDimension = NSZoneRealloc (NSDefaultMallocZone (), _rowDimension, (_numberOfRows) * (sizeof (float))); _rowDimension[_numberOfRows - 1] = 0; _rowYOrigin = NSZoneRealloc (NSDefaultMallocZone (), _rowYOrigin, (_numberOfRows) * (sizeof (float))); _rowYOrigin[_numberOfRows - 1] = (_rowYOrigin[_numberOfRows - 2] + _rowDimension[_numberOfRows - 2]); _minRowDimension = NSZoneRealloc (NSDefaultMallocZone (), _minRowDimension, (_numberOfRows) * (sizeof (float))); _minRowDimension[_numberOfRows - 1] = 0; } // TODO: -(void) insertRow: (int)row; // TODO: -(void) removeRow: (int)row; -(void) addColumn { int i, j; _numberOfColumns++; _havePrisoner = NSZoneRealloc (NSDefaultMallocZone (), _havePrisoner, (_numberOfRows * _numberOfColumns) * (sizeof (BOOL))); _jails = NSZoneRealloc (NSDefaultMallocZone (), _jails, (_numberOfRows * _numberOfColumns) * sizeof (NSView *)); // Reorder the jails for (j = (_numberOfRows - 1); j >= 0; j--) { _jails[(_numberOfColumns * (j + 1)) - 1] = NULL; _havePrisoner[(_numberOfColumns * (j + 1)) - 1] = NO; for (i = (_numberOfColumns - 2); i >= 0; i--) { _jails[(_numberOfColumns * j) + i] = _jails[((_numberOfColumns - 1) * j) + i]; _havePrisoner[(_numberOfColumns * j) + i] = _havePrisoner[((_numberOfColumns - 1) * j) + i]; } } _expandColumn = NSZoneRealloc (NSDefaultMallocZone (), _expandColumn, (_numberOfColumns) * (sizeof (BOOL))); _expandColumn[_numberOfColumns - 1] = YES; _expandingColumnNumber++; _columnDimension = NSZoneRealloc (NSDefaultMallocZone (), _columnDimension, (_numberOfColumns) * (sizeof (float))); _columnDimension[_numberOfColumns - 1] = 0; _columnXOrigin = NSZoneRealloc (NSDefaultMallocZone (), _columnXOrigin, (_numberOfColumns) * (sizeof (float))); _columnXOrigin[_numberOfColumns - 1] = (_columnXOrigin[_numberOfColumns - 2] + _columnDimension[_numberOfColumns - 2]); _minColumnDimension = NSZoneRealloc (NSDefaultMallocZone (), _minColumnDimension, (_numberOfColumns) * (sizeof (float))); _minColumnDimension[_numberOfColumns - 1] = 0; } // TODO: -(void) insertColumn: (int)column; // TODO: -(void) removeColumn: (int)column; // // Setting Row and Column Expand Flag // -(void) setXResizingEnabled: (BOOL)aFlag forColumn: (int)aColumn { if (aColumn > (_numberOfColumns - 1)) { NSLog (@"Warning: argument column is > (numberOfColumns - 1)\n"); return; } if (aColumn < 0) { NSLog (@"Warning: argument column is < 0\n"); return; } if ((_expandColumn[aColumn] == YES) && (aFlag == NO)) { _expandingColumnNumber--; _expandColumn[aColumn] = aFlag; } else if ((_expandColumn[aColumn] == NO) && (aFlag == YES)) { _expandingColumnNumber++; _expandColumn[aColumn] = aFlag; } } -(BOOL) isXResizingEnabledForColumn: (int)aColumn { if (aColumn > (_numberOfColumns - 1)) { NSLog (@"Warning: argument column is > (numberOfColumns - 1)\n"); return NO; } if (aColumn < 0) { NSLog (@"Warning: argument column is < 0\n"); return NO; } return _expandColumn[aColumn]; } -(void) setYResizingEnabled: (BOOL)aFlag forRow: (int)aRow { if (aRow > (_numberOfRows - 1)) { NSLog (@"Warning: argument row is > (numberOfRows - 1)\n"); return; } if (aRow < 0) { NSLog (@"Warning: argument row is < 0\n"); return; } if ((_expandRow[aRow] == YES) && (aFlag == NO)) { _expandingRowNumber--; _expandRow[aRow] = aFlag; } else if ((_expandRow[aRow] == NO) && (aFlag == YES)) { _expandingRowNumber++; _expandRow[aRow] = aFlag; } } -(BOOL) isYResizingEnabledForRow: (int)aRow { if (aRow > (_numberOfRows - 1)) { NSLog (@"Warning: argument row is > (numberOfRows - 1)\n"); return NO; } if (aRow < 0) { NSLog (@"Warning: argument row is < 0\n"); return NO; } return _expandRow[aRow]; } // // Getting Row and Column Number // -(int) numberOfRows { return _numberOfRows; } -(int) numberOfColumns { return _numberOfColumns; } // // NSCoding protocol // -(void) encodeWithCoder: (NSCoder*)aCoder { int i; [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { [aCoder encodeInt: _numberOfRows forKey: @"GSNumberOfRows"]; [aCoder encodeInt: _numberOfColumns forKey: @"GSNumberOfColumns"]; for (i = 0; i < _numberOfRows * _numberOfColumns; i++) { [aCoder encodeObject: _jails[i] forKey: [NSString stringWithFormat: @"GSJail%d",i]]; [aCoder encodeBool: _havePrisoner[i] forKey: [NSString stringWithFormat: @"GSHavePrisoner%d",i]]; } [aCoder encodeFloat: _minXBorder forKey: @"GSMinXBorder"]; [aCoder encodeFloat: _maxXBorder forKey: @"GSMaxXBorder"]; [aCoder encodeFloat: _minYBorder forKey: @"GSMinYBorder"]; [aCoder encodeFloat: _maxYBorder forKey: @"GSMaxYBorder"]; for (i = 0; i < _numberOfColumns; i++) { [aCoder encodeBool: _expandColumn[i] forKey: [NSString stringWithFormat: @"GSExpandColumn%d",i]]; [aCoder encodeFloat: _columnDimension[i] forKey: [NSString stringWithFormat: @"GSColumnDimension%d",i]]; [aCoder encodeFloat: _minColumnDimension[i] forKey: [NSString stringWithFormat: @"GSMinColumnDimension%d",i]]; } for (i = 0; i < _numberOfRows; i++) { [aCoder encodeBool: _expandRow[i] forKey: [NSString stringWithFormat: @"GSExpandRow%d",i]]; [aCoder encodeFloat: _rowDimension[i] forKey: [NSString stringWithFormat: @"GSRowDimension%d",i]]; [aCoder encodeFloat: _minRowDimension[i] forKey: [NSString stringWithFormat: @"GSMinRowDimension%d",i]]; } } else { [aCoder encodeValueOfObjCType: @encode(int) at: &_numberOfRows]; [aCoder encodeValueOfObjCType: @encode(int) at: &_numberOfColumns]; for (i = 0; i < _numberOfRows * _numberOfColumns; i++) { [aCoder encodeObject: _jails[i]]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_havePrisoner[i]]; } [aCoder encodeValueOfObjCType: @encode(float) at: &_minXBorder]; [aCoder encodeValueOfObjCType: @encode(float) at: &_maxXBorder]; [aCoder encodeValueOfObjCType: @encode(float) at: &_minYBorder]; [aCoder encodeValueOfObjCType: @encode(float) at: &_maxYBorder]; for (i = 0; i < _numberOfColumns; i++) { [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_expandColumn[i]]; [aCoder encodeValueOfObjCType: @encode(float) at: &_columnDimension[i]]; [aCoder encodeValueOfObjCType: @encode(float) at: &_minColumnDimension[i]]; } for (i = 0; i < _numberOfRows; i++) { [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_expandRow[i]]; [aCoder encodeValueOfObjCType: @encode(float) at: &_rowDimension[i]]; [aCoder encodeValueOfObjCType: @encode(float) at: &_minRowDimension[i]]; } } } -(id) initWithCoder: (NSCoder*)aDecoder { int i; self = [super initWithCoder: aDecoder]; if (nil == self) return self; [super setAutoresizesSubviews: NO]; if ([aDecoder allowsKeyedCoding]) { _numberOfRows = [aDecoder decodeIntForKey: @"GSNumberOfRows"]; _numberOfColumns = [aDecoder decodeIntForKey: @"GSNumberOfColumns"]; // create the jails... _jails = NSZoneMalloc (NSDefaultMallocZone (), sizeof (NSView *) * (_numberOfRows * _numberOfColumns)); _havePrisoner = NSZoneMalloc (NSDefaultMallocZone (), sizeof (BOOL) * (_numberOfRows * _numberOfColumns)); for (i = 0; i < _numberOfRows * _numberOfColumns; i++) { _jails[i] = [aDecoder decodeObjectForKey: [NSString stringWithFormat: @"GSJail%d",i]]; _havePrisoner[i] = [aDecoder decodeBoolForKey: [NSString stringWithFormat: @"GSHavePrisoner%d",i]]; } _minXBorder = [aDecoder decodeFloatForKey: @"GSMinXBorder"]; _maxXBorder = [aDecoder decodeFloatForKey: @"GSMaxXBorder"]; _minYBorder = [aDecoder decodeFloatForKey: @"GSMinYBorder"]; _maxYBorder = [aDecoder decodeFloatForKey: @"GSMaxYBorder"]; // We compute _minimumSize, _expandingRowNumber // and _expandingColumnNumber during deconding. _minimumSize = NSZeroSize; _expandingRowNumber = 0; _expandingColumnNumber = 0; // Columns _expandColumn = NSZoneMalloc (NSDefaultMallocZone (), sizeof (BOOL) * _numberOfColumns); _columnDimension = NSZoneMalloc (NSDefaultMallocZone (), sizeof (float) * _numberOfColumns); _minColumnDimension = NSZoneMalloc (NSDefaultMallocZone (), sizeof (float) * _numberOfColumns); _minimumSize.width += _minXBorder; for (i = 0; i < _numberOfColumns; i++) { _expandColumn[i] = [aDecoder decodeBoolForKey: [NSString stringWithFormat: @"GSExpandColumn%d",i]]; if (_expandColumn[i]) _expandingColumnNumber++; _columnDimension[i] = [aDecoder decodeFloatForKey: [NSString stringWithFormat: @"GSColumnDimension%d",i]]; _minColumnDimension[i] = [aDecoder decodeFloatForKey: [NSString stringWithFormat: @"GSMinColumnDimension%d",i]]; _minimumSize.width += _minColumnDimension[i]; } _minimumSize.width += _maxXBorder; // Calculate column origins _columnXOrigin = NSZoneMalloc (NSDefaultMallocZone (), sizeof (float) * _numberOfColumns); _columnXOrigin[0] = _minXBorder; for (i = 1; i < _numberOfColumns; i++) _columnXOrigin[i] = _columnXOrigin[i - 1] + _columnDimension[i - 1]; // Rows _expandRow = NSZoneMalloc (NSDefaultMallocZone (), sizeof (BOOL) * _numberOfRows); _rowDimension = NSZoneMalloc (NSDefaultMallocZone (), sizeof (float) * _numberOfRows); _minRowDimension = NSZoneMalloc (NSDefaultMallocZone (), sizeof (float) * _numberOfRows); _minimumSize.height += _minYBorder; for (i = 0; i < _numberOfRows; i++) { _expandRow[i] = [aDecoder decodeBoolForKey: [NSString stringWithFormat: @"GSExpandRow%d",i]]; if (_expandRow[i]) _expandingRowNumber++; _rowDimension[i] = [aDecoder decodeFloatForKey: [NSString stringWithFormat: @"GSRowDimension%d",i]]; _minRowDimension[i] = [aDecoder decodeFloatForKey: [NSString stringWithFormat: @"GSMinRowDimension%d",i]]; _minimumSize.height += _minRowDimension[i]; } _minimumSize.height += _maxYBorder; // Calculate row origins _rowYOrigin = NSZoneMalloc (NSDefaultMallocZone (), sizeof (float) * _numberOfRows); _rowYOrigin[0] = _minYBorder; for (i = 1; i < _numberOfRows; i++) _rowYOrigin[i] = _rowYOrigin[i - 1] + _rowDimension[i - 1]; } else { [aDecoder decodeValueOfObjCType: @encode(int) at: &_numberOfRows]; [aDecoder decodeValueOfObjCType: @encode(int) at: &_numberOfColumns]; // _jails = NSZoneMalloc (NSDefaultMallocZone (), sizeof (NSView *) * (_numberOfRows * _numberOfColumns)); _havePrisoner = NSZoneMalloc (NSDefaultMallocZone (), sizeof (BOOL) * (_numberOfRows * _numberOfColumns)); for (i = 0; i < _numberOfRows * _numberOfColumns; i++) { _jails[i] = [aDecoder decodeObject]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_havePrisoner[i]]; } [aDecoder decodeValueOfObjCType: @encode(float) at: &_minXBorder]; [aDecoder decodeValueOfObjCType: @encode(float) at: &_maxXBorder]; [aDecoder decodeValueOfObjCType: @encode(float) at: &_minYBorder]; [aDecoder decodeValueOfObjCType: @encode(float) at: &_maxYBorder]; // We compute _minimumSize, _expandingRowNumber // and _expandingColumnNumber during deconding. _minimumSize = NSZeroSize; _expandingRowNumber = 0; _expandingColumnNumber = 0; // Columns _expandColumn = NSZoneMalloc (NSDefaultMallocZone (), sizeof (BOOL) * _numberOfColumns); _columnDimension = NSZoneMalloc (NSDefaultMallocZone (), sizeof (float) * _numberOfColumns); _minColumnDimension = NSZoneMalloc (NSDefaultMallocZone (), sizeof (float) * _numberOfColumns); _minimumSize.width += _minXBorder; for (i = 0; i < _numberOfColumns; i++) { [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_expandColumn[i]]; if (_expandColumn[i]) _expandingColumnNumber++; [aDecoder decodeValueOfObjCType: @encode(float) at: &_columnDimension[i]]; [aDecoder decodeValueOfObjCType: @encode(float) at: &_minColumnDimension[i]]; _minimumSize.width += _minColumnDimension[i]; } _minimumSize.width += _maxXBorder; // Calculate column origins _columnXOrigin = NSZoneMalloc (NSDefaultMallocZone (), sizeof (float) * _numberOfColumns); _columnXOrigin[0] = _minXBorder; for (i = 1; i < _numberOfColumns; i++) _columnXOrigin[i] = _columnXOrigin[i - 1] + _columnDimension[i - 1]; // Rows _expandRow = NSZoneMalloc (NSDefaultMallocZone (), sizeof (BOOL) * _numberOfRows); _rowDimension = NSZoneMalloc (NSDefaultMallocZone (), sizeof (float) * _numberOfRows); _minRowDimension = NSZoneMalloc (NSDefaultMallocZone (), sizeof (float) * _numberOfRows); _minimumSize.height += _minYBorder; for (i = 0; i < _numberOfRows; i++) { [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_expandRow[i]]; if (_expandRow[i]) _expandingRowNumber++; [aDecoder decodeValueOfObjCType: @encode(float) at: &_rowDimension[i]]; [aDecoder decodeValueOfObjCType: @encode(float) at: &_minRowDimension[i]]; _minimumSize.height += _minRowDimension[i]; } _minimumSize.height += _maxYBorder; // Calculate row origins _rowYOrigin = NSZoneMalloc (NSDefaultMallocZone (), sizeof (float) * _numberOfRows); _rowYOrigin[0] = _minYBorder; for (i = 1; i < _numberOfRows; i++) _rowYOrigin[i] = _rowYOrigin[i - 1] + _rowDimension[i - 1]; } return self; } @end @implementation GSTable (Private) /* Updates the subviews and locations for a new frame size. */ - (void) _updateForNewFrameSize: (NSSize)newFrameSize { NSSize oldFrameSize = [self frame].size; float originShift; float dimensionIncrement; int i; // YES if the whole GSTable needs an update BOOL tableNeedUpdate = NO; // // Width // if (newFrameSize.width <= _minimumSize.width) { if (oldFrameSize.width > _minimumSize.width) { originShift = _minXBorder; for (i = 0; i < _numberOfColumns; i++) { _columnDimension[i] = _minColumnDimension[i]; _columnXOrigin[i] = originShift; originShift += _minColumnDimension[i]; } tableNeedUpdate = YES; } } else // newFrameSize.width > _minimumSize.width { if (oldFrameSize.width < _minimumSize.width) oldFrameSize.width = _minimumSize.width; if ((newFrameSize.width != oldFrameSize.width) && _expandingColumnNumber) { originShift = 0; dimensionIncrement = newFrameSize.width - oldFrameSize.width; dimensionIncrement = dimensionIncrement / _expandingColumnNumber; for (i = 0; i < _numberOfColumns; i++) { _columnXOrigin[i] += originShift; if (_expandColumn[i]) { _columnDimension[i] += dimensionIncrement; originShift += dimensionIncrement; } } tableNeedUpdate = YES; } } // // Height // if (newFrameSize.height <= _minimumSize.height) { if (oldFrameSize.height > _minimumSize.height) { originShift = _minYBorder; for (i = 0; i < _numberOfRows; i++) { _rowDimension[i] = _minRowDimension[i]; _rowYOrigin[i] = originShift; originShift += _minRowDimension[i]; } tableNeedUpdate = YES; } } else // newFrameSize.height > _minimumSize.height { if (oldFrameSize.height < _minimumSize.height) oldFrameSize.height = _minimumSize.height; if ((newFrameSize.height != oldFrameSize.height) && _expandingRowNumber) { originShift = 0; dimensionIncrement = newFrameSize.height - oldFrameSize.height; dimensionIncrement = dimensionIncrement / _expandingRowNumber; for (i = 0; i < _numberOfRows; i++) { _rowYOrigin[i] += originShift; if (_expandRow[i]) { _rowDimension[i] += dimensionIncrement; originShift += dimensionIncrement; } } tableNeedUpdate = YES; } } if (tableNeedUpdate) { [self _updateWholeTable]; } } // // After computing new theoretical sizes/positions, // use the following methods to update the real table view // to the new sizes/positions. // -(void) _updateRowSize: (int)row { // NB: This (and the following) is for private use, // so we do not check that row exists. int i; int startIndex = row * _numberOfColumns; for (i = 0; i < _numberOfColumns; i++) { if (_havePrisoner[startIndex + i]) { [_jails[startIndex + i] setFrameSize: NSMakeSize (_columnDimension[i], _rowDimension[row])]; } } } -(void) _updateColumnSize: (int)column { int i; for (i = 0; i < _numberOfRows; i++) { if (_havePrisoner[(i * _numberOfColumns) + column]) { [_jails[(i * _numberOfColumns) + column] setFrameSize: NSMakeSize (_columnDimension[column], _rowDimension[i])]; } } } -(void) _updateRowOrigin: (int)row { int i; int startIndex = row * _numberOfColumns; for (i = 0; i < _numberOfColumns; i++) { if (_havePrisoner[startIndex + i]) { [_jails[startIndex + i] setFrameOrigin: NSMakePoint (_columnXOrigin[i], _rowYOrigin[row])]; } } } -(void) _updateColumnOrigin: (int)column { int i; for (i = 0; i < _numberOfRows; i++) { if (_havePrisoner[(i * _numberOfColumns) + column]) { [_jails[(i * _numberOfColumns) + column] setFrameOrigin: NSMakePoint (_columnXOrigin[column], _rowYOrigin[i])]; } } } -(void) _updateWholeTable { int i,j; for (j = 0; j < _numberOfColumns; j++) for (i = 0; i < _numberOfRows; i++) { if (_havePrisoner[(i * _numberOfColumns) + j]) { [_jails[(i * _numberOfColumns) + j] setFrameOrigin: NSMakePoint (_columnXOrigin[j], _rowYOrigin[i])]; [_jails[(i * _numberOfColumns) + j] setFrameSize: NSMakeSize (_columnDimension[j], _rowDimension[i])]; } } } @end gnustep-gui-0.24.0/Source/NSBrowserCell.m0000664000076500007650000002517312221301677020055 0ustar brains99brains99/** NSBrowserCell Cell class for the NSBrowser Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Nicola Pero Date: December 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import "AppKit/NSBrowserCell.h" #import "AppKit/NSColor.h" #import "AppKit/NSFont.h" #import "AppKit/NSImage.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSEvent.h" #import "AppKit/NSWindow.h" #import "GSGuiPrivate.h" /* * Class variables */ static NSImage *_branch_image; static NSImage *_highlight_image; static Class _colorClass; // GNUstep user default to have NSBrowserCell in bold if non leaf static BOOL _gsFontifyCells = NO; static NSFont *_nonLeafFont; static NSFont *_leafFont; /**

TODO Description

*/ @implementation NSBrowserCell /* * Class methods */ + (void) initialize { if (self == [NSBrowserCell class]) { [self setVersion: 1]; ASSIGN(_branch_image, [NSImage imageNamed: @"common_3DArrowRight"]); ASSIGN(_highlight_image, [NSImage imageNamed: @"common_3DArrowRightH"]); /* * Cache classes to avoid overheads of poor compiler implementation. */ _colorClass = [NSColor class]; // A GNUstep experimental feature if ([[NSUserDefaults standardUserDefaults] boolForKey: @"GSBrowserCellFontify"]) { _gsFontifyCells = YES; _nonLeafFont = RETAIN ([NSFont boldSystemFontOfSize: 0]); _leafFont = RETAIN ([NSFont systemFontOfSize: 0]); } } } /**

Returns the default branch image. Currently, it's an arrow.

*

See Also: +highlightedBranchImage

*/ + (NSImage*) branchImage { return _branch_image; } /**

Returns the default hightlited branch image

*

See Also: +branchImage

*/ + (NSImage*) highlightedBranchImage { return _highlight_image; } /* * Instance methods */ - (id) initTextCell: (NSString *)aString { self = [super initTextCell: aString]; if (nil == self) return self; //_alternateImage = nil; //_browsercell_is_leaf = NO; //_browsercell_is_loaded = NO; [self setLineBreakMode: NSLineBreakByTruncatingTail]; if (_gsFontifyCells) [self setFont: _nonLeafFont]; return self; } - (id) initImageCell: (NSImage *)anImage { self = [super initImageCell: anImage]; if (nil == self) return self; //_alternateImage = nil; //_browsercell_is_leaf = NO; //_browsercell_is_loaded = NO; [self setLineBreakMode: NSLineBreakByTruncatingTail]; if (_gsFontifyCells) [self setFont: _nonLeafFont]; return self; } - (void) dealloc { TEST_RELEASE (_alternateImage); [super dealloc]; } - (id) copyWithZone: (NSZone*)zone { NSBrowserCell *c = [super copyWithZone: zone]; _alternateImage = TEST_RETAIN (_alternateImage); //c->_browsercell_is_leaf = _browsercell_is_leaf; //c->_browsercell_is_loaded = _browsercell_is_loaded; return c; } /**

Returns the alternate image in the NSBrowserCell (used when the cell is highlighted)

See Also: -setAlternateImage:

*/ - (NSImage*) alternateImage { return _alternateImage; } /**

Sets the altenate image (used when the cell is highlighted) to anImage *

See Also: -alternateImage

*/ - (void) setAlternateImage: (NSImage *)anImage { ASSIGN(_alternateImage, anImage); } - (NSImage*) image { /** * NSCell implementation requires our type to be an image cell which * is not desirable for NSBrowserCell. See also comment in setType: */ return _cell_image; } - (void) setImage: (NSImage*)anImage { /** * NSCell implementation changes our type to an image cell which * is not desirable for NSBrowserCell. See also comment in setType: */ ASSIGN (_cell_image, anImage); } - (NSColor *)highlightColorInView: (NSView *)controlView { return [_colorClass selectedControlColor]; } /**

Returns whether the browserCell is a leaf. A leaf cell has usually no * image. This method is used by NSBrowser in several methods, for example * to know if a column should be added; when the user selects a browser cell * (a branch or a leaf)

*

See Also: -setLeaf:

*/ - (BOOL) isLeaf { return _browsercell_is_leaf; } /**

Sets whether the cell is a leaf. This method is usally used in the * NSBrowser's delegate methods

*

See Also: -isLeaf

*/ - (void) setLeaf: (BOOL)flag { if (_browsercell_is_leaf == flag) return; _browsercell_is_leaf = flag; if (_gsFontifyCells) { if (_browsercell_is_leaf) { [self setFont: _leafFont]; } else { [self setFont: _nonLeafFont]; } } } /**

Returns whether the NSBrowseCell state is set and is ready for display

See Also: -setLoaded:

*/ - (BOOL) isLoaded { return _browsercell_is_loaded; } /**

Sets whether the NSBrowseCell state is set and is ready for display

*

See Also: -isLoaded

*/ - (void) setLoaded: (BOOL)flag { _browsercell_is_loaded = flag; } /** *

Unhighlights the cell and sets the cell's state to NO

*

See Also: -set

*/ - (void) reset { _cell.is_highlighted = NO; _cell.state = NO; } /**

Highlights the cell and sets the cell's state to YES

*

See Also: -reset

*/ - (void) set { _cell.is_highlighted = YES; _cell.state = YES; } - (void) setType: (NSCellType)aType { /* We do nothing here (we match the Mac OS X behavior) because with * NSBrowserCell GNUstep implementation the cell may contain an image * and text at the same time. */ } - (NSRect) titleRectForBounds: (NSRect)theRect { NSRect titleRect = [super titleRectForBounds: theRect]; NSImage *branch_image = nil; NSImage *cell_image = [self image]; if (_cell.is_highlighted || _cell.state) { if (!_browsercell_is_leaf) { branch_image = [object_getClass(self) highlightedBranchImage]; } if (nil != [self alternateImage]) { cell_image = [self alternateImage]; } } else { if (!_browsercell_is_leaf) { branch_image = [object_getClass(self) branchImage]; } } if (branch_image) { NSRect imgRect; imgRect.size = [branch_image size]; titleRect.size.width -= imgRect.size.width + 8; } if (cell_image) { NSRect imgRect; imgRect.size = [cell_image size]; titleRect.origin.x += imgRect.size.width + 4; titleRect.size.width -= imgRect.size.width + 4; } // Skip 2 points from the left border titleRect.origin.x += 2; titleRect.size.width -= 2; return titleRect; } /* * Displaying */ - (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView *)controlView { NSRect title_rect = cellFrame; NSImage *branch_image = nil; NSImage *cell_image = [self image]; if (_cell.is_highlighted || _cell.state) { if (!_browsercell_is_leaf) branch_image = [object_getClass(self) highlightedBranchImage]; if (nil != [self alternateImage]) cell_image = [self alternateImage]; // If we are highlighted, fill the background [[self highlightColorInView: controlView] setFill]; NSRectFill(cellFrame); } else { if (!_browsercell_is_leaf) branch_image = [object_getClass(self) branchImage]; // (Don't fill the background) } // Draw the branch image if there is one if (branch_image) { NSRect imgRect; imgRect.size = [branch_image size]; imgRect.origin.x = MAX(NSMaxX(title_rect) - imgRect.size.width - 4.0, 0.); imgRect.origin.y = MAX(NSMidY(title_rect) - (imgRect.size.height/2.), 0.); if (controlView != nil) { imgRect = [controlView centerScanRect: imgRect]; } [branch_image drawInRect: imgRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0 respectFlipped: YES hints: nil]; title_rect.size.width -= imgRect.size.width + 8; } // Skip 2 points from the left border title_rect.origin.x += 2; title_rect.size.width -= 2; // Draw the cell image if there is one if (cell_image) { NSRect imgRect; imgRect.size = [cell_image size]; imgRect.origin.x = NSMinX(title_rect); imgRect.origin.y = MAX(NSMidY(title_rect) - (imgRect.size.height/2.),0.); if (controlView != nil) { imgRect = [controlView centerScanRect: imgRect]; } [cell_image drawInRect: imgRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0 respectFlipped: YES hints: nil]; title_rect.origin.x += imgRect.size.width + 4; title_rect.size.width -= imgRect.size.width + 4; } // Draw the body of the cell if (_cell.in_editing) { [self _drawEditorWithFrame: cellFrame inView: controlView]; } else { [self _drawAttributedText: [self attributedStringValue] inFrame: title_rect]; } } /* * NSCoding protocol */ - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { // simply encodes prescence... } else { BOOL tmp; tmp = _browsercell_is_leaf; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &tmp]; tmp = _browsercell_is_loaded; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &tmp]; [aCoder encodeObject: _alternateImage]; } } - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if (nil == self) return self; if ([aDecoder allowsKeyedCoding]) { // Nothing to decode... } else { BOOL tmp; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &tmp]; [self setLeaf: tmp]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &tmp]; [self setLoaded: tmp]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_alternateImage]; } return self; } @end gnustep-gui-0.24.0/Source/GSTypesetter.m0000664000076500007650000000417711534147002017770 0ustar brains99brains99/* GSTypesetter.m Copyright (C) 2002 Free Software Foundation, Inc. Author: Alexander Malmberg Date: 2002 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import "AppKit/NSAttributedString.h" #import "GNUstepGUI/GSTypesetter.h" #import "GNUstepGUI/GSLayoutManager.h" #import "GNUstepGUI/GSHorizontalTypesetter.h" @implementation GSTypesetter + (NSSize) printingAdjustmentsInLayoutManager: (GSLayoutManager *)layoutManager forNominallySpacedGlyphRange: (NSRange)glyphRange packedGlyphs: (const unsigned char *)glyphs count: (unsigned)packedGlyphCount { return NSMakeSize(0,0); } +(GSTypesetter *) sharedSystemTypesetter { return [GSHorizontalTypesetter sharedInstance]; } -(NSFont *) fontForCharactersWithAttributes: (NSDictionary *)attributes { NSFont *f = [attributes valueForKey: NSFontAttributeName]; if (!f) f = [NSFont userFontOfSize: 0]; return f; } -(int) layoutGlyphsInLayoutManager: (GSLayoutManager *)layoutManager inTextContainer: (NSTextContainer *)textContainer startingAtGlyphIndex: (unsigned int)glyphIndex previousLineFragmentRect: (NSRect)previousLineFragRect nextGlyphIndex: (unsigned int *)nextGlyphIndex numberOfLineFragments: (unsigned int)howMany { [self subclassResponsibility: _cmd]; return 0; } @end gnustep-gui-0.24.0/Source/GSThemeMenu.m0000664000076500007650000001076512221205232017501 0ustar brains99brains99/** GSThemePanel Theme management utility Copyright (C) 2010 Free Software Foundation, Inc. Author: Gregory John Casamento Date: 2010 This file is part of the GNU Objective C User interface library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import "AppKit/NSMenu.h" #import "AppKit/NSPanel.h" #import "AppKit/NSWindow.h" #import "AppKit/NSMenuView.h" #import "AppKit/NSApplication.h" #import "GNUstepGUI/GSTheme.h" #import "GNUstepGUI/GSWindowDecorationView.h" #import "NSToolbarFrameworkPrivate.h" #import "GSGuiPrivate.h" @interface NSWindow (Private) - (GSWindowDecorationView *) windowView; - (void) _setMenu: (NSMenu *)menu; @end @implementation NSWindow (Private) - (GSWindowDecorationView *) windowView { return _wv; } - (void) _setMenu: (NSMenu *)menu { [super setMenu: menu]; } @end @implementation GSTheme (Menu) - (void) setMenu: (NSMenu *)menu forWindow: (NSWindow *)window { GSWindowDecorationView *wv = [window windowView]; // protect against stupid calls from updateAllWindowsWithMenu: if ([window menu] == menu) return; // Prevent recursion [window _setMenu: menu]; // Remove any possible old menu view [wv removeMenuView]; //NSLog(@"Adding menu %@ to window %@", menu, window); if (menu != nil) { NSMenuView *menuView = [[NSMenuView alloc] initWithFrame: NSZeroRect]; [menuView setMenu: menu]; [menuView setHorizontal: YES]; [menuView setInterfaceStyle: NSWindows95InterfaceStyle]; [wv addMenuView: menuView]; [menuView sizeToFit]; RELEASE(menuView); } } - (void) rightMouseDisplay: (NSMenu *)menu forEvent: (NSEvent *)theEvent { NSMenuView *mv = [menu menuRepresentation]; if ([mv isHorizontal] == NO) { [menu displayTransient]; [mv mouseDown: theEvent]; [menu closeTransient]; } } - (void) displayPopUpMenu: (NSMenuView *)mr withCellFrame: (NSRect)cellFrame controlViewWindow: (NSWindow *)cvWin preferredEdge: (NSRectEdge)edge selectedItem: (int)selectedItem { BOOL pe = [[GSTheme theme] doesProcessEventsForPopUpMenu]; /* Ensure the window responds when run in modal and should * process events. Or revert this if theme has changed. */ if (pe && ![[mr window] worksWhenModal]) { [(NSPanel *)[mr window] setWorksWhenModal: YES]; } if (!pe && [[mr window] worksWhenModal]) { [(NSPanel *)[mr window] setWorksWhenModal: NO]; } // Ask the MenuView to attach the menu to this rect [mr setWindowFrameForAttachingToRect: cellFrame onScreen: [cvWin screen] preferredEdge: edge popUpSelectedItem: selectedItem]; // Set to be above the main window [cvWin addChildWindow: [mr window] ordered: NSWindowAbove]; // Last, display the window [[mr window] orderFrontRegardless]; } - (void) processCommand: (void *)context { // this is only implemented when we handle native menus. // put code in here to handle commands from the native menu structure. } - (float) menuHeightForWindow: (NSWindow *)window { return [NSMenuView menuBarHeight]; } - (void) updateMenu: (NSMenu *)menu forWindow: (NSWindow *)window { [self setMenu: menu forWindow: window]; } - (void) updateAllWindowsWithMenu: (NSMenu *) menu { NSEnumerator *en = [[NSApp windows] objectEnumerator]; id o = nil; while ((o = [en nextObject]) != nil) { if([o canBecomeMainWindow]) { [self updateMenu: menu forWindow: o]; } } } - (BOOL) doesProcessEventsForPopUpMenu { return NO; // themes that handle events in a popUpMenu should return YES } - (BOOL) menuShouldShowIcon { return YES; // override whether or not to show the icon in the menu. } @end gnustep-gui-0.24.0/Source/NSHelpManager.m0000664000076500007650000002521112102166206020001 0ustar brains99brains99/** NSHelpManager NSHelpManager is the class responsible for managing context help for the application, and its mapping to the graphic elements. Copyright (C) 1999 Free Software Foundation, Inc. Author: Pedro Ivo Andrade Tavares Date: September 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import #import #import "AppKit/NSAttributedString.h" #import "AppKit/NSApplication.h" #import "AppKit/NSWorkspace.h" #import "AppKit/NSFileWrapper.h" #import "AppKit/NSHelpManager.h" #import "AppKit/NSHelpPanel.h" #import "AppKit/NSHelpPanel.h" #import "AppKit/NSCursor.h" #import "AppKit/NSImage.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSScrollView.h" #import "AppKit/NSTextView.h" #import "AppKit/NSTextStorage.h" #import "GNUstepGUI/GSHelpManagerPanel.h" @implementation NSBundle (NSHelpManager) - (NSString *) pathForHelpResource: (NSString *)fileName { NSFileManager *fm = [NSFileManager defaultManager]; NSMutableArray *array = [NSMutableArray array]; NSArray *languages; NSString *rootPath = [self bundlePath]; NSString *primary; NSString *language; NSEnumerator *enumerator; languages = [[NSUserDefaults standardUserDefaults] stringArrayForKey: @"NSLanguages"]; primary = [rootPath stringByAppendingPathComponent: @"Resources"]; enumerator = [languages objectEnumerator]; while ((language = [enumerator nextObject])) { NSString *langDir = [NSString stringWithFormat: @"%@.lproj", language]; [array addObject: [primary stringByAppendingPathComponent: langDir]]; } [array addObject: primary]; primary = rootPath; enumerator = [languages objectEnumerator]; while ((language = [enumerator nextObject])) { NSString *langDir = [NSString stringWithFormat: @"%@.lproj", language]; [array addObject: [primary stringByAppendingPathComponent: langDir]]; } [array addObject: primary]; enumerator = [array objectEnumerator]; while ((rootPath = [enumerator nextObject]) != nil) { NSString *helpDir; NSString *helpPath; BOOL isdir; helpPath = [rootPath stringByAppendingPathComponent: fileName]; if ([fm fileExistsAtPath: helpPath]) { return helpPath; } helpDir = [rootPath stringByAppendingPathComponent: @"Help"]; if ([fm fileExistsAtPath: helpDir isDirectory: & isdir] && isdir) { helpPath = [helpDir stringByAppendingPathComponent: fileName]; if ([fm fileExistsAtPath: helpPath]) { return helpPath; } } } return nil; } - (NSAttributedString *) contextHelpForKey: (NSString *)key { NSFileManager *fm = [NSFileManager defaultManager]; NSString *dictPath = [self pathForResource: @"Help" ofType: @"plist"]; NSDictionary *contextHelp = nil; id helpFile = nil; if (dictPath && [fm fileExistsAtPath: dictPath]) { contextHelp = [NSDictionary dictionaryWithContentsOfFile: dictPath]; } if (contextHelp) { helpFile = [contextHelp objectForKey: key]; } if (helpFile) { NSData *data = [helpFile objectForKey: @"NSHelpRTFContents"]; return ((data != nil) ? [NSUnarchiver unarchiveObjectWithData: data] : nil); } else { helpFile = [self pathForHelpResource: key]; if (helpFile) { NSAttributedString *helpstr; helpstr = [[NSAttributedString alloc] initWithPath: helpFile documentAttributes: NULL]; return TEST_AUTORELEASE (helpstr); } } return nil; } @end @implementation NSApplication (NSHelpManager) - (void) showHelp: (id)sender { NSBundle *mb = [NSBundle mainBundle]; NSDictionary *info = [mb infoDictionary]; NSString *help = [info objectForKey: @"GSHelpContentsFile"]; if (help == nil) { /* If there's no specification, we look for a files named * "appname.rtfd" or "appname.rtf" */ help = [info objectForKey: @"NSExecutable"]; } if (help != nil) { NSString *file; if ([[help pathExtension] length] == 0) { file = [mb pathForHelpResource: [help stringByAppendingPathExtension: @"rtfd"]]; if (file == nil) { file = [mb pathForHelpResource: [help stringByAppendingPathExtension: @"rtf"]]; } } else { file = [mb pathForHelpResource: help]; } if (file != nil) { BOOL result = NO; NSString *ext = [file pathExtension]; NSWorkspace *ws = [NSWorkspace sharedWorkspace]; NSString *viewer; viewer = [[NSUserDefaults standardUserDefaults] stringForKey: @"GSHelpViewer"]; if ([viewer isEqual: @"NSHelpPanel"] == NO) { if ([viewer length] == 0) { viewer = [ws getBestAppInRole: @"Viewer" forExtension: ext]; } if (viewer != nil) { result = [[NSWorkspace sharedWorkspace] openFile: file withApplication: viewer]; } } if (result == NO) { NSHelpPanel *panel; NSTextView *tv; id object = nil; panel = [NSHelpPanel sharedHelpPanel]; tv = [(NSScrollView*)[panel contentView] documentView]; if (ext == nil || [ext isEqualToString: @""] || [ext isEqualToString: @"txt"] || [ext isEqualToString: @"text"]) { object = [NSString stringWithContentsOfFile: file]; } else if ([ext isEqualToString: @"rtf"]) { NSData *data = [NSData dataWithContentsOfFile: file]; object = [[NSAttributedString alloc] initWithRTF: data documentAttributes: 0]; AUTORELEASE (object); } else if ([ext isEqualToString: @"rtfd"]) { NSFileWrapper *wrapper; wrapper = [[NSFileWrapper alloc] initWithPath: file]; AUTORELEASE (wrapper); object = [[NSAttributedString alloc] initWithRTFDFileWrapper: wrapper documentAttributes: 0]; AUTORELEASE (object); } if (object != nil) { [[tv textStorage] setAttributedString: object]; [tv sizeToFit]; } [tv setNeedsDisplay: YES]; [panel makeKeyAndOrderFront: self]; return; } } } NSBeep(); } - (void) activateContextHelpMode: (id)sender { [NSHelpManager setContextHelpModeActive: YES]; } @end @implementation NSHelpManager static NSHelpManager *_gnu_sharedHelpManager = nil; static BOOL _gnu_contextHelpActive = NO; static NSCursor *helpCursor = nil; // // Class methods // + (NSHelpManager*) sharedHelpManager { if (!_gnu_sharedHelpManager) { _gnu_sharedHelpManager = [NSHelpManager alloc]; [_gnu_sharedHelpManager init]; } return _gnu_sharedHelpManager; } + (BOOL) isContextHelpModeActive { return _gnu_contextHelpActive; } + (void) setContextHelpModeActive: (BOOL) flag { if (flag != _gnu_contextHelpActive) { _gnu_contextHelpActive = flag; if (flag) { if (helpCursor == nil) { helpCursor = [[NSCursor alloc] initWithImage: [NSImage imageNamed: @"common_HelpCursor"] hotSpot: NSMakePoint(8, 2)]; [helpCursor setOnMouseEntered: NO]; [helpCursor setOnMouseExited: NO]; } [helpCursor push]; [[NSNotificationCenter defaultCenter] postNotificationName: NSContextHelpModeDidActivateNotification object: [self sharedHelpManager]]; } else { [helpCursor pop]; [[NSNotificationCenter defaultCenter] postNotificationName: NSContextHelpModeDidDeactivateNotification object: [self sharedHelpManager]]; } } } // // Instance methods // - (id) init { contextHelpTopics = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 64); return self; } - (NSAttributedString*) contextHelpForObject: (id)object { /* Help is kept on the contextHelpTopics NSMapTable, with the object for it as the key. Help is loaded on demand: If it's an NSAttributedString which is stored, then it's already loaded. If it's nil, there's no help for this object, and that's what we return. If it's an NSString, it's the path for the help, and we ask NSBundle for it. */ // FIXME: Check this implementation when NSResponders finally store what // their context help is. id hc = NSMapGet(contextHelpTopics, object); if (hc) { if (![hc isKindOfClass: [NSAttributedString class]]) { hc = [[NSBundle mainBundle] contextHelpForKey: hc]; /* We store the retrieved value, or remove the key from the table if nil returns (note that it's OK if the key does not exist already. */ if (hc) NSMapInsert(contextHelpTopics, object, hc); else NSMapRemove(contextHelpTopics, object); } } return hc; } - (void) removeContextHelpForObject: (id)object { NSMapRemove(contextHelpTopics, object); } - (void) setContextHelp: (NSAttributedString *)help forObject: (id)object { NSMapInsert(contextHelpTopics, object, help); } /** * Deprecated ... do not use. * Use -setContextHelp:forObject: instead. */ - (void) setContextHelp: (NSAttributedString*) help withObject: (id) object { NSMapInsert(contextHelpTopics, object, help); } - (BOOL) showContextHelpForObject: (id)object locationHint: (NSPoint) point { NSAttributedString *contextHelp = [self contextHelpForObject: object]; if (contextHelp) { GSHelpManagerPanel *helpPanel; // FIXME: We should position the window at point! // runModalForWindow will centre the window. helpPanel = [GSHelpManagerPanel sharedHelpManagerPanel]; [helpPanel setHelpText: contextHelp]; [NSApp runModalForWindow: helpPanel]; return YES; } else return NO; } @end gnustep-gui-0.24.0/Source/NSStatusBar.m0000664000076500007650000000361212203676404017537 0ustar brains99brains99/* NSStatusBar.m The status bar class Copyright (C) 2013 Free Software Foundation, Inc. Author: Dr. H. Nikolaus Schaller Date: 2013 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import @interface NSStatusItem (Private) - (id) _initForStatusBar: (NSStatusBar*)bar withLength: (CGFloat)len; @end @implementation NSStatusBar - (id) init { self = [super init]; if (self) { _items = [[NSMutableArray alloc] init]; } return self; } - (void) dealloc { RELEASE(_items); [super dealloc]; } + (NSStatusBar*) systemStatusBar { return nil; } - (BOOL) isVertical { return NO; } - (void) removeStatusItem: (NSStatusItem*)item { [_items removeObjectIdenticalTo: item]; } - (NSStatusItem*) statusItemWithLength: (CGFloat)length { NSStatusItem *item = [[NSStatusItem alloc] _initForStatusBar: self withLength: length]; [_items addObject: item]; return AUTORELEASE(item); } - (CGFloat) thickness { return 22; } @end gnustep-gui-0.24.0/Source/GSMemoryPanel.m0000664000076500007650000002626012102166206020044 0ustar brains99brains99/* GSMemoryPanel.m -*-objc-*- A GNUstep panel for tracking memory leaks. Copyright (C) 2000, 2002 Free Software Foundation, Inc. Author: Nicola Pero Date: 2000, 2002 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import "AppKit/NSButton.h" #import "AppKit/NSScrollView.h" #import "AppKit/NSTableColumn.h" #import "AppKit/NSTableView.h" #import "GNUstepGUI/GSMemoryPanel.h" #import "GNUstepGUI/GSHbox.h" #import "GNUstepGUI/GSVbox.h" enum { OrderByClassName, OrderByCount, OrderByTotal, OrderByPeak }; static inline NSComparisonResult invertComparison (NSComparisonResult comparison) { /* invert comparison */ if (comparison == NSOrderedAscending) { comparison = NSOrderedDescending; } else if (comparison == NSOrderedDescending) { comparison = NSOrderedAscending; } return comparison; } /* * Internal private class used in reordering entries. * */ @interface GSMemoryPanelEntry : NSObject { NSString *string; NSNumber *count; NSNumber *total; NSNumber *peak; } - (id) initWithString: (NSString *)aString count: (int)aCount total: (int)aTotal peak: (int)aPeak; - (NSString *) string; - (NSNumber *) count; - (NSNumber *) total; - (NSNumber *) peak; - (NSComparisonResult) compareByTotal: (GSMemoryPanelEntry *)aEntry; - (NSComparisonResult) compareByCount: (GSMemoryPanelEntry *)aEntry; - (NSComparisonResult) compareByPeak: (GSMemoryPanelEntry *)aEntry; - (NSComparisonResult) compareByClassName: (GSMemoryPanelEntry *)aEntry; @end @implementation GSMemoryPanelEntry - (id) initWithString: (NSString *)aString count: (int)aCount total: (int)aTotal peak: (int)aPeak { ASSIGN (string, aString); ASSIGN (count, [NSNumber numberWithInt: aCount]); ASSIGN (total, [NSNumber numberWithInt: aTotal]); ASSIGN (peak, [NSNumber numberWithInt: aPeak]); return self; } - (void) dealloc { RELEASE (string); RELEASE (count); RELEASE (total); RELEASE (peak); [super dealloc]; } - (NSString *) string { return string; } - (NSNumber *) count { return count; } - (NSNumber *) total { return total; } - (NSNumber *) peak { return peak; } - (NSComparisonResult) compareByCount: (GSMemoryPanelEntry *)aEntry { NSComparisonResult comparison = [count compare: aEntry->count]; return invertComparison (comparison); } - (NSComparisonResult) compareByTotal: (GSMemoryPanelEntry *)aEntry { NSComparisonResult comparison = [total compare: aEntry->total]; return invertComparison (comparison); } - (NSComparisonResult) compareByPeak: (GSMemoryPanelEntry *)aEntry { NSComparisonResult comparison = [peak compare: aEntry->peak]; return invertComparison (comparison); } - (NSComparisonResult) compareByClassName: (GSMemoryPanelEntry *)aEntry { return [string compare: aEntry->string]; } @end /* * The Memory Panel code */ static GSMemoryPanel *sharedGSMemoryPanel = nil; @implementation GSMemoryPanel + (id) sharedMemoryPanel { if (sharedGSMemoryPanel == nil) { sharedGSMemoryPanel = [GSMemoryPanel new]; } return sharedGSMemoryPanel; } + (void) update: (id)sender { [[self sharedMemoryPanel] update: sender]; } - (id) init { NSRect winFrame; NSTableColumn *classColumn; NSTableColumn *countColumn; NSTableColumn *totalColumn; NSTableColumn *peakColumn; NSScrollView *scrollView; GSVbox *vbox; GSHbox *hbox; NSButton *button; /* Activate debugging of allocation. */ GSDebugAllocationActive (YES); hbox = [GSHbox new]; [hbox setDefaultMinXMargin: 5]; [hbox setBorder: 5]; [hbox setAutoresizingMask: NSViewWidthSizable]; /* Button updating the table. */ button = [NSButton new]; [button setBordered: YES]; [button setButtonType: NSMomentaryPushButton]; [button setTitle: @"Update"]; [button setImagePosition: NSNoImage]; [button setTarget: self]; [button setAction: @selector(update:)]; [button setAutoresizingMask: NSViewMaxXMargin]; [button sizeToFit]; [button setTag: 1]; [hbox addView: button]; RELEASE (button); /* Button taking snapshot of the table. */ button = [NSButton new]; [button setBordered: YES]; [button setButtonType: NSMomentaryPushButton]; [button setTitle: @"Snapshot"]; [button setImagePosition: NSNoImage]; [button setTarget: self]; [button setAction: @selector(snapshot:)]; [button setAutoresizingMask: NSViewMinXMargin]; [button sizeToFit]; [button setTag: 2]; [hbox addView: button]; RELEASE (button); classColumn = [[NSTableColumn alloc] initWithIdentifier: @"Class"]; [classColumn setEditable: NO]; [[classColumn headerCell] setStringValue: @"Class Name"]; [classColumn setMinWidth: 200]; countColumn = [[NSTableColumn alloc] initWithIdentifier: @"Count"]; [countColumn setEditable: NO]; [[countColumn headerCell] setStringValue: @"Current"]; [countColumn setMinWidth: 50]; totalColumn = [[NSTableColumn alloc] initWithIdentifier: @"Total"]; [totalColumn setEditable: NO]; [[totalColumn headerCell] setStringValue: @"Total"]; [totalColumn setMinWidth: 50]; peakColumn = [[NSTableColumn alloc] initWithIdentifier: @"Peak"]; [peakColumn setEditable: NO]; [[peakColumn headerCell] setStringValue: @"Peak"]; [peakColumn setMinWidth: 50]; table = [[NSTableView alloc] initWithFrame: NSMakeRect (0, 0, 300, 300)]; [table addTableColumn: classColumn]; RELEASE (classColumn); [table addTableColumn: countColumn]; RELEASE (countColumn); [table addTableColumn: totalColumn]; RELEASE (totalColumn); [table addTableColumn: peakColumn]; RELEASE (peakColumn); [table setDataSource: self]; [table setDelegate: self]; [table setDoubleAction: @selector (reorder:)]; scrollView = [[NSScrollView alloc] initWithFrame: NSMakeRect (0, 0, 350, 300)]; [scrollView setDocumentView: table]; [scrollView setHasHorizontalScroller: YES]; [scrollView setHasVerticalScroller: YES]; [scrollView setBorderType: NSBezelBorder]; [scrollView setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)]; [table sizeToFit]; RELEASE (table); vbox = [GSVbox new]; [vbox setDefaultMinYMargin: 5]; [vbox setBorder: 5]; [vbox addView: hbox enablingYResizing: NO]; RELEASE (hbox); [vbox addView: scrollView]; RELEASE (scrollView); /* FIXME - should actually autosave the memory panel position and frame ! */ winFrame.size = [vbox frame].size; winFrame.origin = NSMakePoint (100, 200); self = [super initWithContentRect: winFrame styleMask: (NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask) backing: NSBackingStoreBuffered defer: NO]; if (nil == self) return nil; array = [NSMutableArray new]; orderingBy = @selector(compareByCount:); [self setReleasedWhenClosed: NO]; [self setContentView: vbox]; RELEASE (vbox); [self setTitle: @"Memory Panel"]; return self; } - (void) dealloc { RELEASE(array); [super dealloc]; } - (NSInteger) numberOfRowsInTableView: (NSTableView *)aTableView { return [array count]; } - (id) tableView: (NSTableView *)aTableView objectValueForTableColumn: (NSTableColumn *)aTableColumn row:(NSInteger)rowIndex { GSMemoryPanelEntry *entry = [array objectAtIndex: rowIndex]; id identifier = [aTableColumn identifier]; if ([identifier isEqual: @"Class"]) { return [entry string]; } else if ([identifier isEqual: @"Count"]) { return [entry count]; } else if ([identifier isEqual: @"Total"]) { return [entry total]; } else if ([identifier isEqual: @"Peak"]) { return [entry peak]; } NSLog (@"Hi, I am a bug in your table view"); return @""; } - (void) snapshot: (id)sender { GSMemoryPanel *snapshot = [GSMemoryPanel new]; [snapshot setTitle: [NSString stringWithFormat: @"Memory Snapshot at %@", [NSDate date]]]; [[[snapshot contentView] viewWithTag: 1] removeFromSuperview]; [[[snapshot contentView] viewWithTag: 2] removeFromSuperview]; [snapshot setReleasedWhenClosed: YES]; [snapshot makeKeyAndOrderFront: self]; [snapshot update: self]; } - (void) update: (id)sender { Class *classList = GSDebugAllocationClassList (); Class *pointer; GSMemoryPanelEntry *entry; int i, count, total, peak; NSString *className; pointer = classList; i = 0; [array removeAllObjects]; while (pointer[i] != NULL) { className = NSStringFromClass (pointer[i]); count = GSDebugAllocationCount (pointer[i]); total = GSDebugAllocationTotal (pointer[i]); peak = GSDebugAllocationPeak (pointer[i]); /* Insert into array */ entry = [[GSMemoryPanelEntry alloc] initWithString: className count: count total: total peak: peak]; [array addObject: entry]; RELEASE (entry); i++; } NSZoneFree(NSDefaultMallocZone(), classList); [array sortUsingSelector: orderingBy]; [table reloadData]; } - (void) reorder: (id)sender { int selectedColumn = [table clickedColumn]; NSArray *tableColumns = [table tableColumns]; id identifier; SEL newOrderingBy = @selector(compareByCount:); if (selectedColumn == -1) { return; } identifier = [(NSTableColumn*)[tableColumns objectAtIndex: selectedColumn] identifier]; if ([identifier isEqual: @"Class"]) { newOrderingBy = @selector(compareByClassName:); } else if ([identifier isEqual: @"Count"]) { newOrderingBy = @selector(compareByCount:); } else if ([identifier isEqual: @"Total"]) { newOrderingBy = @selector(compareByTotal:); } else if ([identifier isEqual: @"Peak"]) { newOrderingBy = @selector(compareByPeak:); } if (newOrderingBy == orderingBy) { return; } else { orderingBy = newOrderingBy; [array sortUsingSelector: orderingBy]; [table reloadData]; } } @end @implementation NSApplication (memoryPanel) - (void) orderFrontSharedMemoryPanel: (id)sender { GSMemoryPanel *memoryPanel; memoryPanel = [GSMemoryPanel sharedMemoryPanel]; [memoryPanel update: self]; [memoryPanel orderFront: self]; } @end gnustep-gui-0.24.0/Source/NSToolbarItem.m0000664000076500007650000012531111673147131020051 0ustar brains99brains99/* NSToolbarItem.m The Toolbar item class. Copyright (C) 2002 Free Software Foundation, Inc. Author: Gregory John Casamento , Fabien Vallon , Quentin Mathe Date: May 2002 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSAttributedString.h" #import "AppKit/NSButton.h" #import "AppKit/NSButtonCell.h" #import "AppKit/NSDragging.h" #import "AppKit/NSEvent.h" #import "AppKit/NSFont.h" #import "AppKit/NSImage.h" #import "AppKit/NSMenu.h" #import "AppKit/NSMenuItem.h" #import "AppKit/NSParagraphStyle.h" #import "AppKit/NSPasteboard.h" #import "AppKit/NSStringDrawing.h" #import "AppKit/NSToolbar.h" #import "AppKit/NSView.h" #import "GNUstepGUI/GSToolbarView.h" #import "AppKit/NSToolbarItem.h" #import "NSToolbarFrameworkPrivate.h" #import "GSGuiPrivate.h" /* * Each NSToolbarItem object are coupled with a backView which is their * representation on the screen. * backView for the standard toolbar item (without custom view) are NSButton * subclass called GSToolbarButton. * backView for the toolbar item with a custom view are NSView subclass called * GSToolbarBackView. * GSToolbarButton and GSToolbarBackView are adjusted according to their content * and their title when the method layout is called. * The predefined GNUstep toolbar items are implemented with a class cluster * pattern: initWithToolbarItemIdentifier: returns differents concrete subclass * in accordance with the item identifier. */ typedef enum { ItemBackViewDefaultHeight = 60, ItemBackViewRegularHeight = 60, ItemBackViewSmallHeight = 50 } ItemBackViewHeight; typedef enum { ItemBackViewDefaultWidth = 60, ItemBackViewRegularWidth = 60, ItemBackViewSmallWidth = 50 } ItemBackViewWidth; static const int ItemBackViewX = 0; static const int ItemBackViewY = 0; static const int InsetItemViewX = 10; static const int InsetItemViewY = 26; static const int InsetItemTextX = 3; static const int InsetItemTextY = 4; // See NSToolbarItem -initialize method static NSFont *NormalFont = nil; static NSFont *SmallFont = nil; NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType"; /* * NSButton subclass is the toolbar buttons _backView */ @interface GSToolbarButton : NSButton { NSToolbarItem *_toolbarItem; } - (id) initWithToolbarItem: (NSToolbarItem *)toolbarItem; - (void) layout; // Accessors - (NSToolbarItem *) toolbarItem; @end @interface GSToolbarButtonCell : NSButtonCell { NSRect titleRect; NSRect imageRect; } @end // --- @implementation GSToolbarButton + (Class) cellClass { return [GSToolbarButtonCell class]; } - (id) initWithToolbarItem: (NSToolbarItem *)toolbarItem { // Frame will be reset by the layout method self = [super initWithFrame: NSMakeRect(ItemBackViewX, ItemBackViewY, ItemBackViewDefaultWidth, ItemBackViewDefaultHeight)]; if (self != nil) { // Don't do an ASSIGN here, the toolbar item itself retains us. _toolbarItem = toolbarItem; [self setTitle: @""]; [self setEnabled: NO]; [_cell setBezeled: YES]; [self setImagePosition: NSImageAbove]; [self setHighlightsBy: NSChangeGrayCellMask | NSChangeBackgroundCellMask]; [self setFont: NormalFont]; } return self; } /* * The code below should be kept in sync with GSToolbarBackView methods which * have identical names. */ - (void) layout { float textWidth, layoutedWidth = -1, layoutedHeight = -1; NSFont *font; unsigned int borderMask = [[[_toolbarItem toolbar] _toolbarView] borderMask]; NSSize labelSize = NSZeroSize; font = NormalFont; // Adjust the layout in accordance with NSToolbarSizeMode switch ([[_toolbarItem toolbar] sizeMode]) { case NSToolbarSizeModeDefault: layoutedWidth = ItemBackViewDefaultWidth; layoutedHeight = ItemBackViewDefaultHeight; [[_toolbarItem image] setSize: NSMakeSize(32, 32)]; break; case NSToolbarSizeModeRegular: layoutedWidth = ItemBackViewRegularWidth; layoutedHeight = ItemBackViewRegularHeight; [[_toolbarItem image] setSize: NSMakeSize(32, 32)]; break; case NSToolbarSizeModeSmall: layoutedWidth = ItemBackViewSmallWidth; layoutedHeight = ItemBackViewSmallHeight; /* Not use [self image] here because it can return nil, when image position is set to NSNoImage. Even if NSToolbarDisplayModeTextOnly is not true anymore -setImagePosition: is only called below, then [self image] can still returns nil. */ [[_toolbarItem image] setSize: NSMakeSize(24, 24)]; font = SmallFont; break; default: NSLog(@"Invalid NSToolbarSizeMode"); // Invalid } [self setFont: font]; // Adjust the layout in accordance with the border if (!(borderMask & GSToolbarViewBottomBorder)) { layoutedHeight++; layoutedWidth++; } if (!(borderMask & GSToolbarViewTopBorder)) { layoutedHeight++; layoutedWidth++; } // Adjust the layout in accordance with the label { NSAttributedString *attrStr; NSDictionary *attr; NSString *label = [_toolbarItem label]; attr = [NSDictionary dictionaryWithObject: font forKey: NSFontAttributeName]; if (label == nil || [label isEqualToString: @""]) label = @"Dummy"; attrStr = [[NSAttributedString alloc] initWithString: label attributes: attr]; labelSize = [attrStr size]; DESTROY(attrStr); } textWidth = labelSize.width + 2 * InsetItemTextX; if ([[_toolbarItem toolbar] displayMode] != NSToolbarDisplayModeIconOnly && layoutedWidth != -1 && textWidth > layoutedWidth) layoutedWidth = textWidth; // Adjust the layout in accordance with NSToolbarDisplayMode switch ([[_toolbarItem toolbar] displayMode]) { case NSToolbarDisplayModeDefault: [self setImagePosition: NSImageAbove]; break; case NSToolbarDisplayModeIconAndLabel: [self setImagePosition: NSImageAbove]; break; case NSToolbarDisplayModeIconOnly: [self setImagePosition: NSImageOnly]; layoutedHeight -= labelSize.height + InsetItemTextY; break; case NSToolbarDisplayModeLabelOnly: [self setImagePosition: NSNoImage]; layoutedHeight = labelSize.height + InsetItemTextY * 2; break; default: ; // Invalid } // Set the frame size to use the new layout [self setFrameSize: NSMakeSize(layoutedWidth, layoutedHeight)]; } - (void) mouseDown: (NSEvent *)event { NSToolbar *toolbar = [_toolbarItem toolbar]; if (([event modifierFlags] == NSCommandKeyMask && [toolbar allowsUserCustomization]) || [toolbar customizationPaletteIsRunning] || toolbar == nil) { NSSize viewSize = [self frame].size; NSImage *image = [[NSImage alloc] initWithSize: viewSize]; NSCell *cell = [self cell]; NSPasteboard *pboard; NSInteger index = NSNotFound; // Prepare the drag /* We need to keep this view (aka self) to be able to draw the drag image. */ RETAIN(self); // Draw the drag content in an image /* The code below is only partially supported by GNUstep, then NSImage needs to be improved. */ [image lockFocus]; [cell setShowsFirstResponder: NO]; // To remove the dotted rect [cell drawWithFrame: NSMakeRect(0, 0, viewSize.width, viewSize.height) inView: nil]; [cell setShowsFirstResponder: YES]; [image unlockFocus]; pboard = [NSPasteboard pasteboardWithName: NSDragPboard]; [pboard declareTypes: [NSArray arrayWithObject: GSMovableToolbarItemPboardType] owner: nil]; if (toolbar != nil) { index = [toolbar _indexOfItem: _toolbarItem]; } [GSToolbarView setDraggedItemIndex:index]; [pboard setString: [NSString stringWithFormat:@"%d", index] forType: GSMovableToolbarItemPboardType]; [self dragImage: image at: NSMakePoint(0.0, viewSize.height) offset: NSMakeSize(0.0, 0.0) event: event pasteboard: pboard source: self slideBack: NO]; RELEASE(image); } else if ([event modifierFlags] != NSCommandKeyMask) { [super mouseDown: event]; } } - (void) draggedImage: (NSImage *)dragImage beganAt: (NSPoint)location { //nothing to do } - (void) draggedImage: (NSImage *)dragImage endedAt: (NSPoint)location operation: (NSDragOperation)operation { //nothing to do } - (NSDragOperation) draggingSourceOperationMaskForLocal: (BOOL)isLocal { return isLocal ? NSDragOperationGeneric : NSDragOperationNone; } - (NSToolbarItem *) toolbarItem { return _toolbarItem; } /* * End of the code to keep in sync */ - (BOOL) sendAction: (SEL)action to: (id)target { if ([_toolbarItem _selectable]) { [[_toolbarItem toolbar] setSelectedItemIdentifier: [_toolbarItem itemIdentifier]]; } if (action) { // Send from toolbar item not self return [NSApp sendAction: action to: target from: _toolbarItem]; } else { return NO; } } @end @implementation GSToolbarButtonCell /* Overriden NSButtonCell method to handle cell type in a basic way which avoids to lose image or empty title on new image position (when this involves a cell type switch) and the need to reset it. That would happen in GSToolbarButton -layout method (on toolbar display mode switch). Note that empty title are used with space or separator toolbar items. */ - (void) setImagePosition: (NSCellImagePosition)aPosition { _cell.image_position = aPosition; if (_cell.image_position == NSNoImage) { _cell.type = NSTextCellType; } else { _cell.type = NSImageCellType; } } /* Allways return the image, even when no image gets displayed. */ - (NSImage*) image { return _cell_image; } // Overriden NSButtonCell method to make sure all text is at the same height. - (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { BOOL flippedView = [controlView isFlipped]; NSCellImagePosition ipos = _cell.image_position; // We ignore alternateAttributedTitle, it is not needed NSSize titleSize = [[self attributedTitle] size]; if (flippedView == YES) { if (ipos == NSImageAbove) { ipos = NSImageBelow; } else if (ipos == NSImageBelow) { ipos = NSImageAbove; } } /* We store the values we need to customize the drawing into titleRect and imageRect. */ switch (ipos) { case NSNoImage: titleRect = cellFrame; break; case NSImageOnly: imageRect = cellFrame; break; default: case NSImageBelow: titleRect.origin.x = cellFrame.origin.x; titleRect.origin.y = NSMaxY(cellFrame) - titleSize.height - InsetItemTextY; titleRect.size.width = cellFrame.size.width; titleRect.size.height = titleSize.height; imageRect.origin.x = cellFrame.origin.x; imageRect.origin.y = cellFrame.origin.y; imageRect.size.width = cellFrame.size.width; imageRect.size.height = cellFrame.size.height - titleRect.size.height; break; case NSImageAbove: titleRect.origin.x = cellFrame.origin.x; titleRect.origin.y = cellFrame.origin.y + InsetItemTextY; titleRect.size.width = cellFrame.size.width; titleRect.size.height = titleSize.height; imageRect.origin.x = cellFrame.origin.x; imageRect.origin.y = cellFrame.origin.y + titleRect.size.height; imageRect.size.width = cellFrame.size.width; imageRect.size.height = cellFrame.size.height - titleRect.size.height; break; } [super drawInteriorWithFrame: cellFrame inView: controlView]; } // Overriden NSCell method - (void) _drawAttributedText: (NSAttributedString*)aString inFrame: (NSRect)aRect { if (aString == nil) return; /* Important: text should always be vertically centered without considering descender (as if descender did not exist). This is particularly important for single line texts.Please make sure the output remains always correct. */ [aString drawInRect: titleRect]; // We ignore aRect value } // Overriden NSButtonCell method - (void) drawImage: (NSImage *)anImage withFrame: (NSRect)aRect inView: (NSView*)controlView { // We ignore aRect value [super drawImage: anImage withFrame: imageRect inView: controlView]; } @end /* * Back view used to enclose toolbar item's custom view */ @interface GSToolbarBackView : NSView { NSToolbarItem *_toolbarItem; NSFont *_font; BOOL _enabled; BOOL _showLabel; // record the fact that the view responds to these // to save time. struct __flags { // gets unsigned int _isEnabled:1; unsigned int _action:1; unsigned int _target:1; unsigned int _image:1; // sets unsigned int _setEnabled:1; unsigned int _setAction:1; unsigned int _setTarget:1; unsigned int _setImage:1; // to even out the int. unsigned int RESERVED:24; } _flags; } - (id) initWithToolbarItem: (NSToolbarItem *)toolbarItem; - (void) layout; - (NSToolbarItem *) toolbarItem; - (BOOL) isEnabled; - (void) setEnabled: (BOOL)enabled; @end @implementation GSToolbarBackView - (id) initWithToolbarItem: (NSToolbarItem *)toolbarItem { self = [super initWithFrame: NSMakeRect(ItemBackViewX, ItemBackViewY, ItemBackViewDefaultWidth, ItemBackViewDefaultHeight)]; // Frame will be reset by the layout method if (self != nil) { NSView *view; // Don't do an ASSIGN here, the toolbar item itself retains us. _toolbarItem = toolbarItem; view = [toolbarItem view]; // gets _flags._isEnabled = [view respondsToSelector: @selector(isEnabled)]; _flags._action = [view respondsToSelector: @selector(action)]; _flags._target = [view respondsToSelector: @selector(target)]; _flags._image = [view respondsToSelector: @selector(image)]; // sets _flags._setEnabled = [view respondsToSelector: @selector(setEnabled:)]; _flags._setAction = [view respondsToSelector: @selector(setAction:)]; _flags._setTarget = [view respondsToSelector: @selector(setTarget:)]; _flags._setImage = [view respondsToSelector: @selector(setImage:)]; } return self; } - (void) drawRect: (NSRect)rect { if (_showLabel) { NSAttributedString *attrString; NSDictionary *attr; NSColor *color; NSMutableParagraphStyle *pStyle; NSRect titleRect; NSRect viewBounds = [self bounds]; if (_enabled) { color = [NSColor blackColor]; } else { color = [NSColor disabledControlTextColor]; } pStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; [pStyle setAlignment: NSCenterTextAlignment]; // We draw the label attr = [NSDictionary dictionaryWithObjectsAndKeys: _font, NSFontAttributeName, color, NSForegroundColorAttributeName, pStyle, NSParagraphStyleAttributeName, nil]; RELEASE(pStyle); attrString = [[NSAttributedString alloc] initWithString: [_toolbarItem label] attributes: attr]; titleRect.origin.x = viewBounds.origin.x; titleRect.origin.y = viewBounds.origin.y + InsetItemTextY; titleRect.size.width = viewBounds.size.width; titleRect.size.height = [attrString size].height; [attrString drawInRect: titleRect]; DESTROY(attrString); } } - (NSView *) hitTest: (NSPoint)point { if (_super_view && [_super_view mouse: point inRect: _frame]) { NSEvent *event = [NSApp currentEvent]; NSToolbar *toolbar = [_toolbarItem toolbar]; if (([event type] == NSLeftMouseDown) && (([event modifierFlags] == NSCommandKeyMask && [toolbar allowsUserCustomization]) || [toolbar customizationPaletteIsRunning] || toolbar == nil)) { return self; } } return [super hitTest: point]; } /* * The code below should be kept in sync with GSToolbarButton methods which * have identical names. */ - (void) layout { NSView *view = [_toolbarItem view]; float textWidth, layoutedWidth = -1, layoutedHeight = -1; NSFont *font; unsigned int borderMask = [[[_toolbarItem toolbar] _toolbarView] borderMask]; NSSize labelSize = NSZeroSize; font = NormalFont; if ([view superview] == nil) // Show the view to eventually hide it later [self addSubview: view]; if ([view respondsToSelector: @selector(sizeToFit)]) { NSSize newSize, minSize = [_toolbarItem minSize]; [(id)view sizeToFit]; newSize = [view frame].size; if (minSize.width > 0 || newSize.height < minSize.height) { if (minSize.width > 0) newSize.width = minSize.width; newSize.height = MAX(newSize.height, minSize.height); [view setFrameSize: newSize]; } } // Adjust the layout in accordance with NSToolbarSizeMode switch ([[_toolbarItem toolbar] sizeMode]) { case NSToolbarSizeModeDefault: layoutedWidth = ItemBackViewDefaultWidth; layoutedHeight = ItemBackViewDefaultHeight; if ([view frame].size.height > 32) [view removeFromSuperview]; break; case NSToolbarSizeModeRegular: layoutedWidth = ItemBackViewRegularWidth; layoutedHeight = ItemBackViewRegularHeight; if ([view frame].size.height > 32) [view removeFromSuperview]; break; case NSToolbarSizeModeSmall: layoutedWidth = ItemBackViewSmallWidth; layoutedHeight = ItemBackViewSmallHeight; font = SmallFont; if ([view frame].size.height > 24) [view removeFromSuperview]; break; default: NSLog(@"Invalid NSToolbarSizeMode"); // Invalid } _font = font; // Adjust the layout in accordance with the border if (!(borderMask & GSToolbarViewBottomBorder)) { layoutedHeight++; layoutedWidth++; } if (!(borderMask & GSToolbarViewTopBorder)) { layoutedHeight++; layoutedWidth++; } // Adjust the layout in accordance with the label { NSAttributedString *attrStr; NSDictionary *attr; NSString *label = [_toolbarItem label]; attr = [NSDictionary dictionaryWithObject: font forKey: NSFontAttributeName]; if (label == nil || [label isEqualToString: @""]) label = @"Dummy"; attrStr = [[NSAttributedString alloc] initWithString: label attributes: attr]; labelSize = [attrStr size]; DESTROY(attrStr); } textWidth = labelSize.width + 2 * InsetItemTextX; if (textWidth > layoutedWidth) layoutedWidth = textWidth; _enabled = YES; /* This boolean variable is used to known when it's needed to draw the label in the -drawRect: method. */ _showLabel = YES; // Adjust the layout in accordance with NSToolbarDisplayMode switch ([[_toolbarItem toolbar] displayMode]) { case NSToolbarDisplayModeDefault: break; // Nothing to do case NSToolbarDisplayModeIconAndLabel: break; // Nothing to do case NSToolbarDisplayModeIconOnly: _showLabel = NO; layoutedHeight -= labelSize.height + InsetItemTextY; break; case NSToolbarDisplayModeLabelOnly: _enabled = NO; layoutedHeight = labelSize.height + InsetItemTextY * 2; if ([view superview] != nil) [view removeFromSuperview]; break; default: ; // Invalid } /* If the view is visible... Adjust the layout in accordance with the view width in the case it is needed. */ if ([view superview] != nil) { if (layoutedWidth < [view frame].size.width + 2 * InsetItemViewX) layoutedWidth = [view frame].size.width + 2 * InsetItemViewX; } // Set the frame size to use the new layout [self setFrameSize: NSMakeSize(layoutedWidth, layoutedHeight)]; /* If the view is visible... Adjust the view position in accordance with the new layout. */ if ([view superview] != nil) { float insetItemViewY = ([self frame].size.height - [view frame].size.height) / 2; if (_showLabel) { insetItemViewY += (labelSize.height + InsetItemTextY) / 2; } [view setFrameOrigin: NSMakePoint((layoutedWidth - [view frame].size.width) / 2, insetItemViewY)]; } } - (void) mouseDown: (NSEvent *)event { NSToolbar *toolbar = [_toolbarItem toolbar]; if (([event modifierFlags] == NSCommandKeyMask && [toolbar allowsUserCustomization]) || [toolbar customizationPaletteIsRunning] || toolbar == nil) { NSSize viewSize = [self frame].size; NSImage *image = [[NSImage alloc] initWithSize: viewSize]; NSPasteboard *pboard; NSInteger index = NSNotFound; // Prepare the drag /* We need to keep this view (aka self) to be able to draw the drag image. */ RETAIN(self); // Draw the drag content in an image /* The code below is only partially supported by GNUstep, then NSImage needs to be improved. */ [image lockFocus]; [self drawRect: NSMakeRect(0, 0, viewSize.width, viewSize.height)]; [image unlockFocus]; pboard = [NSPasteboard pasteboardWithName: NSDragPboard]; [pboard declareTypes: [NSArray arrayWithObject: GSMovableToolbarItemPboardType] owner: nil]; if (toolbar != nil) { index = [toolbar _indexOfItem: _toolbarItem]; } [GSToolbarView setDraggedItemIndex:index]; [pboard setString: [NSString stringWithFormat:@"%d", index] forType: GSMovableToolbarItemPboardType]; [self dragImage: image //at: NSMakePoint(0.0, viewSize.height) at: NSMakePoint(0.0, 0.0) offset: NSMakeSize(0.0, 0.0) event: event pasteboard: pboard source: self slideBack: NO]; RELEASE(image); } else if ([event modifierFlags] != NSCommandKeyMask) { [super mouseDown: event]; } } - (void) draggedImage: (NSImage *)dragImage beganAt: (NSPoint)location { //nothing to do } - (void) draggedImage: (NSImage *)dragImage endedAt: (NSPoint)location operation: (NSDragOperation)operation { //nothing to do } - (NSDragOperation) draggingSourceOperationMaskForLocal: (BOOL)isLocal { return isLocal ? NSDragOperationGeneric : NSDragOperationNone; } - (NSToolbarItem *) toolbarItem { return _toolbarItem; } /* * End of the code to keep in sync */ - (BOOL) isEnabled { if (_flags._isEnabled) { id view = [_toolbarItem view]; return [view isEnabled]; } else { return _enabled; } } - (void) setEnabled: (BOOL)enabled { if (_flags._setEnabled) { id view = [_toolbarItem view]; [view setEnabled: enabled]; } else { _enabled = enabled; } } - (NSImage *) image { if (_flags._image) { id view = [_toolbarItem view]; return [view image]; } else { return nil; } } - (void) setImage: (NSImage *)image { if (_flags._setImage) { id view = [_toolbarItem view]; [view setImage: image]; } } - (void) setAction: (SEL)action { if (_flags._setAction) { id view = [_toolbarItem view]; [view setAction: action]; } } - (SEL) action { if (_flags._action) { id view = [_toolbarItem view]; return [view action]; } else { return 0; } } - (void) setTarget: (id)target { if (_flags._setTarget) { id view = [_toolbarItem view]; [view setTarget: target]; } } - (id) target { if (_flags._target) { id view = [_toolbarItem view]; return [view target]; } else { return nil; } } @end /* * Standard toolbar items. */ // ---- NSToolbarSeparatorItemIdentifier @interface NSToolbarSeparatorItem : NSToolbarItem { } @end @implementation NSToolbarSeparatorItem - (id) initWithItemIdentifier: (NSString *)itemIdentifier { self = [super initWithItemIdentifier: itemIdentifier]; if (!self) return nil; [(NSButton *)[self _backView] setImagePosition: NSImageOnly]; [(NSButton *)[self _backView] setImage: [NSImage imageNamed: @"common_ToolbarSeparatorItem"]]; /* We bypass the toolbar item accessor to set the image in order to have it (48 * 48) not resized. */ [self setPaletteLabel: _(@"Separator")]; [[self _backView] setFrameSize: NSMakeSize(30, ItemBackViewDefaultHeight)]; return self; } - (NSMenuItem *) _defaultMenuFormRepresentation { return nil; // Override the default implementation in order to do nothing } - (void) _layout { NSView *backView = [self _backView]; // Override the default implementation [(id)backView layout]; if ([self toolbar] != nil) [backView setFrameSize: NSMakeSize(30, [backView frame].size.height)]; } - (BOOL) allowsDuplicatesInToolbar { return YES; } @end // ---- NSToolbarSpaceItemIdentifier @interface NSToolbarSpaceItem : NSToolbarItem { } @end @implementation NSToolbarSpaceItem - (id) initWithItemIdentifier: (NSString *)itemIdentifier { self = [super initWithItemIdentifier: itemIdentifier]; if (!self) return nil; [self setPaletteLabel: _(@"Space")]; return self; } // Override the default implementation in order to do nothing - (NSMenuItem *) _defaultMenuFormRepresentation { return nil; } - (BOOL) allowsDuplicatesInToolbar { return YES; } @end // ---- NSToolbarFlexibleSpaceItemIdentifier @interface NSToolbarFlexibleSpaceItem : NSToolbarItem { } @end @implementation NSToolbarFlexibleSpaceItem - (id) initWithItemIdentifier: (NSString *)itemIdentifier { self = [super initWithItemIdentifier: itemIdentifier]; if (!self) return nil; [self setPaletteLabel: _(@"Flexible Space")]; [self _layout]; return self; } // Override the default implementation in order to do nothing - (NSMenuItem *) _defaultMenuFormRepresentation { return nil; } // Override the default implementation in order to reset the _backView to a zero width - (void) _layout { NSView *backView = [self _backView]; NSSize size; [(id)backView layout]; size = [backView frame].size; /* If the item is not part of a toolbar, this usually means it is used by customization palette, we shouldn't resize it in this case. */ if ([self toolbar] != nil) [backView setFrameSize: NSMakeSize(0, size.height)]; [self setMinSize: NSMakeSize(0, size.height)]; [self setMaxSize: NSMakeSize(10000, size.height)]; } - (BOOL) _isFlexibleSpace { return YES; } - (BOOL) allowsDuplicatesInToolbar { return YES; } @end // ---- NSToolbarShowColorsItemIdentifier @interface GSToolbarShowColorsItem : NSToolbarItem { } @end @implementation GSToolbarShowColorsItem - (id) initWithItemIdentifier: (NSString *)itemIdentifier { self = [super initWithItemIdentifier: itemIdentifier]; if (!self) return nil; [self setImage: [NSImage imageNamed: @"common_ToolbarShowColorsItem"]]; [self setLabel: _(@"Colors")]; // Set action... [self setTarget: nil]; // Goes to first responder.. [self setAction: @selector(orderFrontColorPanel:)]; return self; } @end // ---- NSToolbarShowFontsItemIdentifier @interface GSToolbarShowFontsItem : NSToolbarItem { } @end @implementation GSToolbarShowFontsItem - (id) initWithItemIdentifier: (NSString *)itemIdentifier { self = [super initWithItemIdentifier: itemIdentifier]; if (!self) return nil; [self setImage: [NSImage imageNamed: @"common_ToolbarShowFontsItem"]]; [self setLabel: _(@"Fonts")]; // Set action... [self setTarget: nil]; // Goes to first responder.. [self setAction: @selector(orderFrontFontPanel:)]; return self; } @end // ---- NSToolbarCustomizeToolbarItemIdentifier @interface GSToolbarCustomizeToolbarItem : NSToolbarItem { } @end @implementation GSToolbarCustomizeToolbarItem - (id) initWithItemIdentifier: (NSString *)itemIdentifier { self = [super initWithItemIdentifier: itemIdentifier]; if (!self) return nil; [self setImage: [NSImage imageNamed: @"common_ToolbarCustomizeToolbarItem"]]; [self setLabel: _(@"Customize")]; // Set action... [self setTarget: nil]; // Goes to first responder.. [self setAction: @selector(runToolbarCustomizationPalette:)]; return self; } @end // ---- NSToolbarPrintItemIdentifier @interface GSToolbarPrintItem : NSToolbarItem { } @end @implementation GSToolbarPrintItem - (id) initWithItemIdentifier: (NSString *)itemIdentifier { self = [super initWithItemIdentifier: itemIdentifier]; if (!self) return nil; [self setImage: [NSImage imageNamed: @"common_Printer"]]; [self setLabel: _(@"Print...")]; // Set action... [self setTarget: nil]; // goes to first responder.. [self setAction: @selector(printDocument:)]; return self; } @end @implementation NSToolbarItem + (void) initialize { // This used to be size 11. NormalFont = RETAIN([NSFont systemFontOfSize: [NSFont systemFontSize]]); // [NSFont smallSystemFontSize] or better should be NSControlContentFontSize SmallFont = RETAIN([NSFont systemFontOfSize: [NSFont smallSystemFontSize]]); } - (id) initWithItemIdentifier: (NSString *)itemIdentifier { // GNUstep predefined toolbar items if ([itemIdentifier isEqualToString: NSToolbarSeparatorItemIdentifier] && [self isKindOfClass: [NSToolbarSeparatorItem class]] == NO) { RELEASE(self); return [[NSToolbarSeparatorItem alloc] initWithItemIdentifier: itemIdentifier]; } else if ([itemIdentifier isEqualToString: NSToolbarSpaceItemIdentifier] && [self isKindOfClass: [NSToolbarSpaceItem class]] == NO) { RELEASE(self); return [[NSToolbarSpaceItem alloc] initWithItemIdentifier: itemIdentifier]; } else if ([itemIdentifier isEqualToString: NSToolbarFlexibleSpaceItemIdentifier] && [self isKindOfClass: [NSToolbarFlexibleSpaceItem class]] == NO) { RELEASE(self); return [[NSToolbarFlexibleSpaceItem alloc] initWithItemIdentifier: itemIdentifier]; } else if ([itemIdentifier isEqualToString: NSToolbarShowColorsItemIdentifier] && [self isKindOfClass: [GSToolbarShowColorsItem class]] == NO) { RELEASE(self); return [[GSToolbarShowColorsItem alloc] initWithItemIdentifier: itemIdentifier]; } else if ([itemIdentifier isEqualToString: NSToolbarShowFontsItemIdentifier] && [self isKindOfClass: [GSToolbarShowFontsItem class]] == NO) { RELEASE(self); return [[GSToolbarShowFontsItem alloc] initWithItemIdentifier: itemIdentifier]; } else if ([itemIdentifier isEqualToString: NSToolbarCustomizeToolbarItemIdentifier] && [self isKindOfClass: [GSToolbarCustomizeToolbarItem class]] == NO) { RELEASE(self); return [[GSToolbarCustomizeToolbarItem alloc] initWithItemIdentifier: itemIdentifier]; } else if ([itemIdentifier isEqualToString: NSToolbarPrintItemIdentifier] && [self isKindOfClass: [GSToolbarPrintItem class]] == NO) { RELEASE(self); return [[GSToolbarPrintItem alloc] initWithItemIdentifier: itemIdentifier]; } else { if ((self = [super init]) != nil) { // Normal toolbar items ASSIGN(_itemIdentifier, itemIdentifier); [self setAutovalidates: YES]; // Set the backview to an GSToolbarButton, will get reset to a // GSToolbarBackView when setView: gets called. [self setView: nil]; } } return self; } - (void) dealloc { RELEASE(_itemIdentifier); RELEASE(_label); RELEASE(_image); RELEASE(_menuFormRepresentation); RELEASE(_paletteLabel); RELEASE(_toolTip); TEST_RELEASE(_view); RELEASE(_backView); [super dealloc]; } - (BOOL) allowsDuplicatesInToolbar { return NO; } - (BOOL) isEnabled { return [(GSToolbarButton*)_backView isEnabled]; } - (NSImage *) image { // return [(GSToolbarButton*)_backView image]; return _image; } - (NSString *) itemIdentifier { return _itemIdentifier; } - (NSString *) label { // FIXME: I think this is not needed if ([[self toolbar] displayMode] == NSToolbarDisplayModeLabelOnly) { NSMenuItem *menuItem = [self menuFormRepresentation]; if (menuItem != nil) return [menuItem title]; } if (nil != _label) { return _label; } else { return @""; } } - (NSSize) maxSize { return _maxSize; } - (NSMenuItem *) menuFormRepresentation { return _menuFormRepresentation; } - (NSSize) minSize { return _minSize; } - (NSString *) paletteLabel { return _paletteLabel; } - (void) setAction: (SEL)action { [(GSToolbarButton *)_backView setAction: action]; [self setEnabled: (action != NULL)]; } - (void) setEnabled: (BOOL)enabled { [(GSToolbarButton*)_backView setEnabled: enabled]; } - (void) setImage: (NSImage *)image { ASSIGN(_image, image); [_image setScalesWhenResized: YES]; //[_image setSize: NSMakeSize(32, 32)]; [(GSToolbarButton*)_backView setImage: image]; } - (void) setLabel: (NSString *)label { ASSIGN(_label, label); if (!_view) [(GSToolbarButton *)_backView setTitle: _label]; _modified = YES; if (_toolbar != nil) [[_toolbar _toolbarView] _reload]; } - (void) setMaxSize: (NSSize)maxSize { _maxSize = maxSize; } - (void) setMenuFormRepresentation: (NSMenuItem *)menuItem { ASSIGN(_menuFormRepresentation, menuItem); } - (void) setMinSize: (NSSize)minSize { _minSize = minSize; } - (void) setPaletteLabel: (NSString *)paletteLabel { ASSIGN(_paletteLabel, paletteLabel); } - (void) setTag: (NSInteger)tag { _tag = tag; } - (void) setTarget: (id)target { [(NSButton *)_backView setTarget: target]; } - (void) setToolTip: (NSString *)toolTip { ASSIGN(_toolTip, toolTip); [_view setToolTip: _toolTip]; } - (void) setView: (NSView *)view { if ((_view == view) && (_backView != nil)) return; ASSIGN(_view, view); if (view) { NSSize size; size = [view frame].size; if (NSEqualSizes(NSZeroSize, _minSize)) [self setMinSize: size]; if (NSEqualSizes(NSZeroSize, _maxSize)) [self setMaxSize: size]; [_view setToolTip: _toolTip]; RELEASE(_backView); _backView = [[GSToolbarBackView alloc] initWithToolbarItem: self]; } else { RELEASE(_backView); _backView = [[GSToolbarButton alloc] initWithToolbarItem: self]; } } - (NSInteger) tag { return _tag; } - (NSString *) toolTip { return _toolTip; } - (NSToolbar *) toolbar { return _toolbar; } - (void) validate { BOOL enabled = YES; id target; /* No validation for custom views */ if (_view) return; target = [NSApp targetForAction: [self action] to: [self target] from: self]; if (target == nil || ![target respondsToSelector: [self action]]) { enabled = NO; } else if ([target respondsToSelector: @selector(validateToolbarItem:)]) { enabled = [target validateToolbarItem: self]; } else if ([target respondsToSelector: @selector(validateUserInterfaceItem:)]) { enabled = [target validateUserInterfaceItem: self]; } [self setEnabled: enabled]; } - (NSView *) view { return _view; } // Private or package like visibility methods - (NSView *) _backView { return _backView; } // // This method invokes using the toolbar item as the sender. // When invoking from the menu, it shouldn't send the menuitem as the // sender since some applications check this and try to get additional // information about the toolbar item which this is coming from. Since // we implement the menu's action, we must also validate it. // - (void) _sendAction: (id)sender { [NSApp sendAction: [self action] to: [self target] from: self]; } - (BOOL) validateMenuItem: (NSMenuItem *)menuItem { return [self isEnabled]; } - (NSMenuItem *) _defaultMenuFormRepresentation { NSMenuItem *menuItem; menuItem = [[NSMenuItem alloc] initWithTitle: [self label] action: @selector(_sendAction:) keyEquivalent: @""]; [menuItem setTarget: self]; AUTORELEASE(menuItem); return menuItem; } - (void) _layout { [(id)_backView layout]; } - (BOOL) _isModified { return _modified; } - (BOOL) _isFlexibleSpace { return NO; } - (BOOL) _selectable { return _selectable; } - (BOOL) _selected { return [(GSToolbarButton *)_backView state]; } - (void) _setSelected: (BOOL)selected { if (_selectable) { if ([self _selected] != selected) [(GSToolbarButton *)_backView setState: selected]; } else { NSLog(@"The toolbar item %@ is not selectable", self); } } - (void) _setSelectable: (BOOL)selectable { if ([_backView isKindOfClass: [GSToolbarButton class]]) { _selectable = selectable; [(GSToolbarButton *)_backView setButtonType: NSOnOffButton]; } else { NSLog(@"The toolbar item %@ is not selectable", self); } } - (void) _setToolbar: (NSToolbar *)toolbar { // Don't do an ASSIGN here, the toolbar itself retains us. _toolbar = toolbar; } - (BOOL) autovalidates { return _autovalidates; } - (void) setAutovalidates: (BOOL)autovalidates { _autovalidates = autovalidates; } - (NSInteger) visibilityPriority { return _visibilityPriority; } - (void) setVisibilityPriority: (NSInteger)visibilityPriority { _visibilityPriority = visibilityPriority; } // NSValidatedUserInterfaceItem protocol - (SEL) action { return [(GSToolbarButton *)_backView action]; } - (id) target { return [(GSToolbarButton *)_backView target]; } // NSCopying protocol - (id) copyWithZone: (NSZone *)zone { NSToolbarItem *new = [[NSToolbarItem allocWithZone: zone] initWithItemIdentifier: _itemIdentifier]; NSString *toolTip; NSImage *image; NSString *label; NSMenuItem *item; // Copy all items individually... [new setTarget: [self target]]; [new setAction: [self action]]; toolTip = [[self toolTip] copyWithZone: zone]; [new setToolTip: toolTip]; RELEASE(toolTip); [new setTag: [self tag]]; image = [[self image] copyWithZone: zone]; [new setImage: image]; RELEASE(image); [new setEnabled: [self isEnabled]]; label = [[self paletteLabel] copyWithZone: zone]; [new setPaletteLabel: label]; RELEASE(label); label = [[self label] copyWithZone: zone]; [new setLabel: label]; RELEASE(label); [new setMinSize: [self minSize]]; [new setMaxSize: [self maxSize]]; [new setAutovalidates: [self autovalidates]]; [new setVisibilityPriority: [self visibilityPriority]]; item = [[self menuFormRepresentation] copyWithZone: zone]; [new setMenuFormRepresentation: item]; RELEASE(item); if ([self view] != nil) { NSData *encodedView = nil; NSView *superview = nil; /* NSView doesn't implement -copyWithZone:, that's why we encode then decode the view to create a copy of it. */ superview = [[self view] superview]; /* We must avoid to encode view hierarchy */ [[self view] removeFromSuperviewWithoutNeedingDisplay]; NSLog(@"Encode toolbar item with label %@, view %@ and superview %@", [self label], [self view], superview); // NOTE: Keyed archiver would fail on NSSlider here. encodedView = [NSArchiver archivedDataWithRootObject: [self view]]; [new setView: [NSUnarchiver unarchiveObjectWithData: encodedView]]; // Re-add the view to its hierarchy [superview addSubview: [self view]]; } return new; } - (NSString *) description { return [NSString stringWithFormat: @"<%@ - <%@>>",[super description],[self itemIdentifier]]; } - (id) initWithCoder: (NSCoder *)aCoder { self = [self initWithItemIdentifier: [aCoder decodeObjectForKey:@"NSToolbarItemIdentifier"]]; if ([aCoder containsValueForKey: @"NSToolbarItemTarget"]) [self setTarget: [aCoder decodeObjectForKey:@"NSToolbarItemTarget"]]; if ([aCoder containsValueForKey: @"NSToolbarItemAction"]) [self setAction: NSSelectorFromString([aCoder decodeObjectForKey:@"NSToolbarItemAction"])]; if ([aCoder containsValueForKey: @"NSToolbarItemToolTip"]) [self setToolTip: [aCoder decodeObjectForKey:@"NSToolbarItemToolTip"]]; if ([aCoder containsValueForKey: @"NSToolbarItemTag"]) [self setTag: [aCoder decodeIntForKey:@"NSToolbarItemTag"]]; if ([aCoder containsValueForKey: @"NSToolbarItemImage"]) [self setImage: [aCoder decodeObjectForKey:@"NSToolbarItemImage"]]; if ([aCoder containsValueForKey: @"NSToolbarItemEnabled"]) [self setEnabled: [aCoder decodeBoolForKey:@"NSToolbarItemEnabled"]]; if ([aCoder containsValueForKey: @"NSToolbarItemPaletteLabel"]) [self setPaletteLabel: [aCoder decodeObjectForKey:@"NSToolbarItemPaletteLabel"]]; if ([aCoder containsValueForKey: @"NSToolbarItemLabel"]) [self setLabel: [aCoder decodeObjectForKey:@"NSToolbarItemLabel"]]; if ([aCoder containsValueForKey: @"NSToolbarItemMinSize"]) [self setMinSize: NSSizeFromString([aCoder decodeObjectForKey:@"NSToolbarItemMinSize"])]; if ([aCoder containsValueForKey: @"NSToolbarItemMaxSize"]) [self setMaxSize: NSSizeFromString([aCoder decodeObjectForKey:@"NSToolbarItemMaxSize"])]; if ([aCoder containsValueForKey: @"NSToolbarItemAutovalidates"]) [self setAutovalidates: [aCoder decodeBoolForKey:@"NSToolbarItemAutovalidates"]]; if ([aCoder containsValueForKey: @"NSToolbarItemVisibilityPriority"]) [self setVisibilityPriority: [aCoder decodeIntForKey:@"NSToolbarItemVisibilityPriority"]]; if ([aCoder containsValueForKey: @"NSToolbarItemView"]) [self setView: [aCoder decodeObjectForKey: @"NSToolbarItemView"]]; return self; } @end gnustep-gui-0.24.0/Source/NSOutlineView.m0000664000076500007650000017664612121442562020116 0ustar brains99brains99/** NSOutlineView This class is a subclass of NSTableView which provides the user with a way to display tree structured data in an outline format. It is particularly useful for show hierarchical data such as a class inheritance tree or any other set of relationships. Copyright (C) 2001 Free Software Foundation, Inc. Author: Gregory John Casamento Date: October 2001 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import #import #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSBezierPath.h" #import "AppKit/NSCell.h" #import "AppKit/NSClipView.h" #import "AppKit/NSColor.h" #import "AppKit/NSEvent.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSImage.h" #import "AppKit/NSOutlineView.h" #import "AppKit/NSScroller.h" #import "AppKit/NSTableColumn.h" #import "AppKit/NSTableHeaderView.h" #import "AppKit/NSText.h" #import "AppKit/NSTextFieldCell.h" #import "AppKit/NSWindow.h" #import "GSGuiPrivate.h" #include static NSNotificationCenter *nc = nil; static const int current_version = 1; const int NSOutlineViewDropOnItemIndex = -1; static int lastVerticalQuarterPosition; static int lastHorizontalHalfPosition; static NSDragOperation dragOperation; static NSRect oldDraggingRect; static id oldDropItem; static id currentDropItem; static int oldDropIndex; static int currentDropIndex; static NSMutableSet *autoExpanded = nil; static NSDate *lastDragUpdate = nil; static NSDate *lastDragChange = nil; // Cache the arrow images... static NSImage *collapsed = nil; static NSImage *expanded = nil; static NSImage *unexpandable = nil; @interface NSOutlineView (NotificationRequestMethods) - (void) _postSelectionIsChangingNotification; - (void) _postSelectionDidChangeNotification; - (void) _postColumnDidMoveNotificationWithOldIndex: (int) oldIndex newIndex: (int) newIndex; // FIXME: There is a method with a similar name.but this is never called //- (void) _postColumnDidResizeNotification; - (BOOL) _shouldSelectTableColumn: (NSTableColumn *)tableColumn; - (BOOL) _shouldSelectRow: (int)rowIndex; - (BOOL) _shouldSelectionChange; - (BOOL) _shouldEditTableColumn: (NSTableColumn *)tableColumn row: (int) rowIndex; - (void) _willDisplayCell: (NSCell*)cell forTableColumn: (NSTableColumn *)tb row: (int)index; - (BOOL) _writeRows: (NSIndexSet *)rows toPasteboard: (NSPasteboard *)pboard; - (BOOL) _isDraggingSource; - (id) _objectValueForTableColumn: (NSTableColumn *)tb row: (int)index; - (void) _setObjectValue: (id)value forTableColumn: (NSTableColumn *)tb row: (int) index; - (int) _numRows; @end // These methods are private... @interface NSOutlineView (TableViewInternalPrivate) - (void) _initOutlineDefaults; - (void) _autosaveExpandedItems; - (void) _autoloadExpandedItems; - (void) _collectItemsStartingWith: (id)startitem into: (NSMutableArray *)allChildren; - (void) _loadDictionaryStartingWith: (id) startitem atLevel: (int) level; - (void) _openItem: (id)item; - (void) _closeItem: (id)item; - (void) _removeChildren: (id)startitem; - (void) _noteNumberOfRowsChangedBelowItem: (id)item by: (int)n; @end @interface NSOutlineView (Private) - (void) _autoCollapse; @end @implementation NSOutlineView // Initialize the class when it is loaded + (void) initialize { if (self == [NSOutlineView class]) { [self setVersion: current_version]; nc = [NSNotificationCenter defaultCenter]; #if 0 /* Old Interface Builder style. */ collapsed = [NSImage imageNamed: @"common_outlineCollapsed"]; expanded = [NSImage imageNamed: @"common_outlineExpanded"]; unexpandable = [NSImage imageNamed: @"common_outlineUnexpandable"]; #else /* Current OSX style images. */ // FIXME ... better ones? collapsed = [NSImage imageNamed: @"common_ArrowRightH"]; expanded = [NSImage imageNamed: @"common_ArrowDownH"]; unexpandable = [[NSImage alloc] initWithSize: [expanded size]]; #endif autoExpanded = [NSMutableSet new]; } } // Instance methods /** * Initalizes the outline view with the given frame. Invokes * the superclass method initWithFrame: as well to initialize the object. * */ - (id) initWithFrame: (NSRect)frame { self = [super initWithFrame: frame]; if (self != nil) { [self _initOutlineDefaults]; //_outlineTableColumn = nil; } return self; } - (void) dealloc { RELEASE(_items); RELEASE(_expandedItems); NSFreeMapTable(_itemDict); NSFreeMapTable(_levelOfItems); if (_autosaveExpandedItems) { // notify when an item expands... [nc removeObserver: self name: NSOutlineViewItemDidExpandNotification object: self]; // notify when an item collapses... [nc removeObserver: self name: NSOutlineViewItemDidCollapseNotification object: self]; } [super dealloc]; } /** * Causes the outline column, the column containing the expand/collapse * gadget, to resize based on the amount of space needed by widest content. */ - (BOOL)autoResizesOutlineColumn { return _autoResizesOutlineColumn; } /** * Causes the outline column, the column containing the expand/collapse * gadget, to resize based on the amount of space needed by widest content. */ - (BOOL)autosaveExpandedItems { return _autosaveExpandedItems; } /** * Collapses the given item only. This is the equivalent of calling * [NSOutlineView-collapseItem:collapseChildren:] with NO. */ - (void) collapseItem: (id)item { [self collapseItem: item collapseChildren: NO]; } /** * Collapses the specified item. If collapseChildren is set to YES, * then all of the expandable children of this item all also collapsed * in a recursive fashion (i.e. all children, grandchildren and etc). */ - (void) collapseItem: (id)item collapseChildren: (BOOL)collapseChildren { const SEL shouldSelector = @selector(outlineView:shouldCollapseItem:); BOOL canCollapse = YES; if ([_delegate respondsToSelector: shouldSelector]) { canCollapse = [_delegate outlineView: self shouldCollapseItem: item]; } if ([self isExpandable: item] && [self isItemExpanded: item] && canCollapse) { NSMutableDictionary *infoDict = [NSMutableDictionary dictionary]; [infoDict setObject: item forKey: @"NSObject"]; // Send out the notification to let observers know that this is about // to occur. [nc postNotificationName: NSOutlineViewItemWillCollapseNotification object: self userInfo: infoDict]; // recursively find all children and call this method to close them. // Note: The children must be collapsed before their parent item so // that the selected row indexes are properly updated (and in particular // are valid when we post our notifications). if (collapseChildren) // collapse all { int index, numChildren; NSMutableArray *allChildren; id sitem = (item == nil) ? (id)[NSNull null] : (id)item; allChildren = NSMapGet(_itemDict, sitem); numChildren = [allChildren count]; for (index = 0; index < numChildren; index++) { id child = [allChildren objectAtIndex: index]; if ([self isExpandable: child]) { [self collapseItem: child collapseChildren: collapseChildren]; } } } // collapse... [self _closeItem: item]; // Send out the notification to let observers know that this has // occured. [nc postNotificationName: NSOutlineViewItemDidCollapseNotification object: self userInfo: infoDict]; // Should only mark the rect below the closed item for redraw [self setNeedsDisplay: YES]; } } /** * Expands the given item only. This is the equivalent of calling * [NSOutlineView-expandItem:expandChildren:] with NO. */ - (void) expandItem: (id)item { [self expandItem: item expandChildren: NO]; } /** * Expands the specified item. If expandChildren is set to YES, then all * of the expandable children of this item all also expanded in a recursive * fashion (i.e. all children, grandchildren and etc). */ - (void) expandItem: (id)item expandChildren: (BOOL)expandChildren { const SEL shouldExpandSelector = @selector(outlineView:shouldExpandItem:); BOOL canExpand = YES; if ([_delegate respondsToSelector: shouldExpandSelector]) { canExpand = [_delegate outlineView: self shouldExpandItem: item]; } // if the item is expandable if ([self isExpandable: item]) { // if it is not already expanded and it can be expanded, then expand if (![self isItemExpanded: item] && canExpand) { NSMutableDictionary *infoDict = [NSMutableDictionary dictionary]; [infoDict setObject: item forKey: @"NSObject"]; // Send out the notification to let observers know that this is about // to occur. [nc postNotificationName: NSOutlineViewItemWillExpandNotification object: self userInfo: infoDict]; // insert the root element, if necessary otherwise insert the // actual object. [self _openItem: item]; // Send out the notification to let observers know that this has // occured. [nc postNotificationName: NSOutlineViewItemDidExpandNotification object: self userInfo: infoDict]; } // recursively find all children and call this method to open them. if (expandChildren) // expand all { int index, numChildren; NSMutableArray *allChildren; id sitem = (item == nil) ? (id)[NSNull null] : (id)item; allChildren = NSMapGet(_itemDict, sitem); numChildren = [allChildren count]; for (index = 0; index < numChildren; index++) { id child = [allChildren objectAtIndex: index]; if ([self isExpandable: child]) { [self expandItem: child expandChildren: expandChildren]; } } } // Should only mark the rect below the expanded item for redraw [self setNeedsDisplay: YES]; } } - (NSRect) frameOfOutlineCellAtRow: (NSInteger)row { NSRect frameRect; if (![self isExpandable: [self itemAtRow: row]]) return NSZeroRect; frameRect = [self frameOfCellAtColumn: 0 row: row]; if (_indentationMarkerFollowsCell) { frameRect.origin.x += _indentationPerLevel * [self levelForRow: row]; } return frameRect; } /** * Returns whether or not the indentation marker or "knob" is indented * along with the content inside the cell. */ - (BOOL) indentationMarkerFollowsCell { return _indentationMarkerFollowsCell; } /** * Returns the amount of indentation, in points, for each level * of the tree represented by the outline view. */ - (CGFloat) indentationPerLevel { return _indentationPerLevel; } /** * Returns YES, if the item is able to be expanded, NO otherwise. * * Returns NO when the item is nil (as Cocoa does). */ - (BOOL) isExpandable: (id)item { if (item == nil) { return NO; } return [_dataSource outlineView: self isItemExpandable: item]; } /** * Returns YES if the item is expanded or open, NO otherwise. * * Returns YES when the item is nil (as Cocoa does). */ - (BOOL) isItemExpanded: (id)item { if (item == nil) { return YES; } // Check the array to determine if it is expanded. return([_expandedItems containsObject: item]); } /** * Returns the item at a given row. If no item exists for the given row, * returns nil. */ - (id) itemAtRow: (NSInteger)row { if ((row >= [_items count]) || (row < 0)) { return nil; } return [_items objectAtIndex: row]; } /** * Returns the level for a given item. */ - (NSInteger) levelForItem: (id)item { if (item != nil) { id object = NSMapGet(_levelOfItems, item); return [object integerValue]; } return -1; } /** * Returns the level for the given row. */ - (NSInteger) levelForRow: (NSInteger)row { return [self levelForItem: [self itemAtRow: row]]; } /** * Returns the outline table column. */ - (NSTableColumn *) outlineTableColumn { return _outlineTableColumn; } /** * Returns the parent of the given item or nil */ - (id) parentForItem: (id)item { NSArray *allKeys = NSAllMapTableKeys(_itemDict); NSEnumerator *en = [allKeys objectEnumerator]; NSInteger index; id parent; while ((parent = [en nextObject])) { NSMutableArray *childArray = NSMapGet(_itemDict, parent); if ((index = [childArray indexOfObject: item]) != NSNotFound) { return (parent == [NSNull null]) ? (id)nil : (id)parent; } } return nil; } /** * Causes an item to be reloaded. This is the equivalent of calling * [NSOutlineView-reloadItem:reloadChildren:] with reloadChildren set to NO. */ - (void) reloadItem: (id)item { [self reloadItem: item reloadChildren: NO]; } /** * Causes an item and all of it's children to be reloaded if reloadChildren is * set to YES, if it's set to NO, then only the item itself is refreshed * from the datasource. */ - (void) reloadItem: (id)item reloadChildren: (BOOL)reloadChildren { NSInteger index; id parent; BOOL expanded; id dsobj = nil; id object = (item == nil) ? (id)[NSNull null] : (id)item; NSArray *allKeys = NSAllMapTableKeys(_itemDict); NSEnumerator *en = [allKeys objectEnumerator]; expanded = [self isItemExpanded: item]; // find the parent of the item while ((parent = [en nextObject])) { NSMutableArray *childArray = NSMapGet(_itemDict, parent); if ((index = [childArray indexOfObject: object]) != NSNotFound) { parent = (parent == [NSNull null]) ? (id)nil : (id)parent; dsobj = [_dataSource outlineView: self child: index ofItem: parent]; if (dsobj != item) { [childArray replaceObjectAtIndex: index withObject: dsobj]; // FIXME We need to correct _items, _itemDict, _levelOfItems, // _expandedItems and _selectedItems } break; } } if (reloadChildren) { [self _removeChildren: dsobj]; [self _loadDictionaryStartingWith: dsobj atLevel: [self levelForItem: dsobj]]; if (expanded) { [self _openItem: dsobj]; } } [self setNeedsDisplay: YES]; } /** * Returns the corresponding row in the outline view for the given item. * Returns -1 if item is nil or not found. */ - (NSInteger) rowForItem: (id)item { NSInteger row; if (item == nil) return -1; row = [_items indexOfObject: item]; return (row == NSNotFound) ? -1 : row; } /** * When set to YES this causes the outline column, the column containing * the expand/collapse gadget, to resize based on the amount of space * needed by widest content. */ - (void) setAutoresizesOutlineColumn: (BOOL)resize { _autoResizesOutlineColumn = resize; } /** * When set to YES, the outline view will save the state of all expanded or * collapsed items in the view to the users defaults for the application the * outline view is running in. */ - (void) setAutosaveExpandedItems: (BOOL)flag { if (flag == _autosaveExpandedItems) { return; } _autosaveExpandedItems = flag; if (flag) { [self _autoloadExpandedItems]; // notify when an item expands... [nc addObserver: self selector: @selector(_autosaveExpandedItems) name: NSOutlineViewItemDidExpandNotification object: self]; // notify when an item collapses... [nc addObserver: self selector: @selector(_autosaveExpandedItems) name: NSOutlineViewItemDidCollapseNotification object: self]; } else { // notify when an item expands... [nc removeObserver: self name: NSOutlineViewItemDidExpandNotification object: self]; // notify when an item collapses... [nc removeObserver: self name: NSOutlineViewItemDidCollapseNotification object: self]; } } /** * If set to YES, the indentation marker will follow the content at each level. * Otherwise, the indentation marker will remain at the left most position of * the view regardless of how many levels in the content is indented. */ - (void) setIndentationMarkerFollowsCell: (BOOL)followsCell { _indentationMarkerFollowsCell = followsCell; } /** * Sets the amount, in points, that each level is to be indented by. */ - (void)setIndentationPerLevel: (CGFloat)newIndentLevel { _indentationPerLevel = newIndentLevel; } /** * Sets the outline table column in which to place the indentation marker. */ - (void)setOutlineTableColumn: (NSTableColumn *)outlineTableColumn { _outlineTableColumn = outlineTableColumn; } /** * Returns YES, by default. Subclasses should override this method if * a different behaviour is required. */ - (BOOL)shouldCollapseAutoExpandedItemsForDeposited: (BOOL)deposited { return YES; } /** * Sets the data source for this outline view. */ - (void) setDataSource: (id)anObject { #define CHECK_REQUIRED_METHOD(selector_name) \ if (anObject && ![anObject respondsToSelector: @selector(selector_name)]) \ [NSException raise: NSInternalInconsistencyException \ format: @"data source does not respond to %@", @#selector_name] CHECK_REQUIRED_METHOD(outlineView:child:ofItem:); CHECK_REQUIRED_METHOD(outlineView:isItemExpandable:); CHECK_REQUIRED_METHOD(outlineView:numberOfChildrenOfItem:); CHECK_REQUIRED_METHOD(outlineView:objectValueForTableColumn:byItem:); // Is the data source editable? _dataSource_editable = [anObject respondsToSelector: @selector(outlineView:setObjectValue:forTableColumn:byItem:)]; /* We do *not* retain the dataSource, it's like a delegate */ _dataSource = anObject; [self tile]; [self reloadData]; } /** * Forces a from scratch reload of all data in the outline view. */ - (void) reloadData { // release the old array if (_items != nil) { RELEASE(_items); } if (_itemDict != NULL) { NSFreeMapTable(_itemDict); } if (_levelOfItems != NULL) { NSFreeMapTable(_levelOfItems); } // create a new empty one _items = [[NSMutableArray alloc] init]; _itemDict = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 64); _levelOfItems = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 64); // reload all the open items... [self _openItem: nil]; [super reloadData]; } /** * Sets the delegate of the outlineView. */ - (void) setDelegate: (id)anObject { const SEL sel = @selector(outlineView:willDisplayCell:forTableColumn:item:); if (_delegate) [nc removeObserver: _delegate name: nil object: self]; _delegate = anObject; #define SET_DELEGATE_NOTIFICATION(notif_name) \ if ([_delegate respondsToSelector: @selector(outlineView##notif_name:)]) \ [nc addObserver: _delegate \ selector: @selector(outlineView##notif_name:) \ name: NSOutlineView##notif_name##Notification object: self] SET_DELEGATE_NOTIFICATION(ColumnDidMove); SET_DELEGATE_NOTIFICATION(ColumnDidResize); SET_DELEGATE_NOTIFICATION(SelectionDidChange); SET_DELEGATE_NOTIFICATION(SelectionIsChanging); SET_DELEGATE_NOTIFICATION(ItemDidExpand); SET_DELEGATE_NOTIFICATION(ItemDidCollapse); SET_DELEGATE_NOTIFICATION(ItemWillExpand); SET_DELEGATE_NOTIFICATION(ItemWillCollapse); _del_responds = [_delegate respondsToSelector: sel]; } - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding] == NO) { float indentation = _indentationPerLevel; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_autoResizesOutlineColumn]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_indentationMarkerFollowsCell]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_autosaveExpandedItems]; [aCoder encodeValueOfObjCType: @encode(float) at: &indentation]; [aCoder encodeConditionalObject: _outlineTableColumn]; } } - (id) initWithCoder: (NSCoder *)aDecoder { // Since we only have one version.... self = [super initWithCoder: aDecoder]; if (self == nil) return self; [self _initOutlineDefaults]; if ([aDecoder allowsKeyedCoding]) { // init the table column... (this can't be chosen on IB either)... if ([_tableColumns count] > 0) { _outlineTableColumn = [_tableColumns objectAtIndex: 0]; } } else { float indentation; // overrides outline defaults with archived values [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_autoResizesOutlineColumn]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_indentationMarkerFollowsCell]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_autosaveExpandedItems]; [aDecoder decodeValueOfObjCType: @encode(float) at: &indentation]; _indentationPerLevel = indentation; _outlineTableColumn = [aDecoder decodeObject]; } return self; } - (void) mouseDown: (NSEvent *)theEvent { NSPoint location = [theEvent locationInWindow]; location = [self convertPoint: location fromView: nil]; _clickedRow = [self rowAtPoint: location]; _clickedColumn = [self columnAtPoint: location]; if (_clickedRow != -1 && [_tableColumns objectAtIndex: _clickedColumn] == _outlineTableColumn) { NSImage *image; id item = [self itemAtRow:_clickedRow]; int level = [self levelForRow: _clickedRow]; int position = 0; if ([self isItemExpanded: item]) { image = expanded; } else { image = collapsed; } if (_indentationMarkerFollowsCell) { position = _indentationPerLevel * level; } position += _columnOrigins[_clickedColumn]; if ([self isExpandable:item] && location.x >= position && location.x <= position + [image size].width) { BOOL withChildren = ([theEvent modifierFlags] & NSAlternateKeyMask) ? YES : NO; if (![self isItemExpanded: item]) { [self expandItem: item expandChildren: withChildren]; } else { [self collapseItem: item collapseChildren: withChildren]; } return; } } [super mouseDown: theEvent]; } - (void)keyDown: (NSEvent*)event { NSString *characters = [event characters]; if ([characters length] == 1) { unichar c = [characters characterAtIndex: 0]; NSIndexSet *selected = [self selectedRowIndexes]; NSInteger i; for (i = [selected firstIndex]; i != NSNotFound; i = [selected indexGreaterThanIndex: i]) { id item = [self itemAtRow: i]; switch (c) { case NSLeftArrowFunctionKey: { if ([self isItemExpanded: item]) { [self collapseItem: item]; } else { id parent = [self parentForItem: item]; if (parent != nil) { NSInteger parentRow = [self rowForItem: parent]; [self selectRow: parentRow byExtendingSelection: NO]; [self scrollRowToVisible: parentRow]; } } return; } case NSRightArrowFunctionKey: [self expandItem: item]; return; default: break; } } } [super keyDown: event]; } /* * Drawing */ - (void) drawRow: (NSInteger)rowIndex clipRect: (NSRect)aRect { int startingColumn; int endingColumn; NSRect drawingRect; NSCell *imageCell = nil; NSRect imageRect; int i; float x_pos; if (_dataSource == nil) { return; } /* Using columnAtPoint: here would make it called twice per row per drawn rect - so we avoid it and do it natively */ if (rowIndex >= _numberOfRows) { return; } /* Determine starting column as fast as possible */ x_pos = NSMinX (aRect); i = 0; while ((i < _numberOfColumns) && (x_pos > _columnOrigins[i])) { i++; } startingColumn = (i - 1); if (startingColumn == -1) startingColumn = 0; /* Determine ending column as fast as possible */ x_pos = NSMaxX (aRect); // Nota Bene: we do *not* reset i while ((i < _numberOfColumns) && (x_pos > _columnOrigins[i])) { i++; } endingColumn = (i - 1); if (endingColumn == -1) endingColumn = _numberOfColumns - 1; /* Draw the row between startingColumn and endingColumn */ for (i = startingColumn; i <= endingColumn; i++) { id item = [self itemAtRow: rowIndex]; NSTableColumn *tb = [_tableColumns objectAtIndex: i]; NSCell *cell = [self preparedCellAtColumn: i row: rowIndex]; if (i == _editedColumn && rowIndex == _editedRow) { [cell _setInEditing: YES]; [cell setShowsFirstResponder: YES]; } [self _willDisplayCell: cell forTableColumn: tb row: rowIndex]; [cell setObjectValue: [_dataSource outlineView: self objectValueForTableColumn: tb byItem: item]]; drawingRect = [self frameOfCellAtColumn: i row: rowIndex]; if (tb == _outlineTableColumn) { NSImage *image = nil; NSInteger level = 0; CGFloat indentationFactor = 0.0; // float originalWidth = drawingRect.size.width; // display the correct arrow... if ([self isItemExpanded: item]) { image = expanded; } else { image = collapsed; } if (![self isExpandable: item]) { image = unexpandable; } level = [self levelForItem: item]; indentationFactor = _indentationPerLevel * level; imageCell = [[NSCell alloc] initImageCell: image]; imageRect = [self frameOfOutlineCellAtRow: rowIndex]; if ([_delegate respondsToSelector: @selector(outlineView:willDisplayOutlineCell:forTableColumn:item:)]) { [_delegate outlineView: self willDisplayOutlineCell: imageCell forTableColumn: tb item: item]; } /* Do not indent if the delegate set the image to nil. */ if ([imageCell image]) { imageRect.size.width = [image size].width; imageRect.size.height = [image size].height; [imageCell drawWithFrame: imageRect inView: self]; drawingRect.origin.x += indentationFactor + imageRect.size.width + 5; drawingRect.size.width -= indentationFactor + imageRect.size.width + 5; } else { drawingRect.origin.x += indentationFactor; drawingRect.size.width -= indentationFactor; } RELEASE(imageCell); } [cell drawWithFrame: drawingRect inView: self]; if (i == _editedColumn && rowIndex == _editedRow) { [cell _setInEditing: NO]; [cell setShowsFirstResponder: NO]; } } } - (void) drawRect: (NSRect)aRect { int index = 0; if (_autoResizesOutlineColumn) { float widest = 0; for (index = 0; index < _numberOfRows; index++) { float offset = [self levelForRow: index] * [self indentationPerLevel]; NSRect drawingRect = [self frameOfCellAtColumn: 0 row: index]; float length = drawingRect.size.width + offset; if (widest < length) widest = length; } // [_outlineTableColumn setWidth: widest]; } [super drawRect: aRect]; } - (void) setDropItem: (id)item dropChildIndex: (NSInteger)childIndex { if (item != nil && [_items indexOfObject: item] == NSNotFound) { /* FIXME raise an exception, or perhaps we should support * setting an item which is not visible (inside a collapsed * item presumably), or perhaps we should treat this as * cancelling the drop? */ return; } currentDropItem = item; currentDropIndex = childIndex; } /* * Drag'n'drop support */ - (NSDragOperation) draggingEntered: (id ) sender { //NSLog(@"draggingEntered"); oldDropItem = currentDropItem = nil; oldDropIndex = currentDropIndex = -1; lastVerticalQuarterPosition = -1; dragOperation = NSDragOperationCopy; oldDraggingRect = NSMakeRect(0.,0., 0., 0.); return NSDragOperationCopy; } - (void) draggingExited: (id ) sender { [self setNeedsDisplayInRect: oldDraggingRect]; [self _autoCollapse]; [self displayIfNeeded]; DESTROY(lastDragUpdate); DESTROY(lastDragChange); } // TODO: Move the part that starts at 'Compute the indicator rect area' to GSTheme - (void) drawDropAboveIndicatorWithDropItem: (id)currentDropItem atRow: (int)row childDropIndex: (int)currentDropIndex { int level = 0; NSBezierPath *path = nil; NSRect newRect = NSZeroRect; /* Compute the indicator rect area */ if (currentDropItem == nil && currentDropIndex == 0) { newRect = NSMakeRect([self visibleRect].origin.x, 0, [self visibleRect].size.width, 2); } else if (row == _numberOfRows) { newRect = NSMakeRect([self visibleRect].origin.x, row * _rowHeight - 2, [self visibleRect].size.width, 2); } else { newRect = NSMakeRect([self visibleRect].origin.x, row * _rowHeight - 1, [self visibleRect].size.width, 2); } level = [self levelForItem: currentDropItem] + 1; newRect.origin.x += level * _indentationPerLevel; newRect.size.width -= level * _indentationPerLevel; [[NSColor darkGrayColor] set]; /* The rectangle is a line across the cell indicating the * insertion position. We adjust by enough pixels to allow for * a ring drawn on the left end. */ newRect.size.width -= 7; newRect.origin.x += 7; NSRectFill(newRect); /* We make the redraw rectangle big enough to hold both the * line and the circle (8 pixels high). */ newRect.size.width += 7; newRect.origin.x -= 7; newRect.size.height = 8; newRect.origin.y -= 3; oldDraggingRect = newRect; if (newRect.size.width < 8) oldDraggingRect.size.width = 8; /* We draw the circle at the left of the line, and make it * a little smaller than the redraw rectangle so that the * bezier path will draw entirely inside the redraw area * and we won't leave artifacts behind on the screen. */ newRect.size.width = 7; newRect.size.height = 7; newRect.origin.x += 0.5; newRect.origin.y += 0.5; path = [NSBezierPath bezierPath]; [path appendBezierPathWithOvalInRect: newRect]; [path stroke]; } /* When the drop item is nil and the drop child index is -1 */ - (void) drawDropOnRootIndicator { NSRect indicatorRect = [self visibleRect]; /* Remember indicator area to be redrawn next time */ oldDraggingRect = indicatorRect; [[NSColor darkGrayColor] set]; NSFrameRectWithWidth(indicatorRect, 2.0); } // TODO: Move a method common to -drapOnRootIndicator and the one below to GSTheme - (void) drawDropOnIndicatorWithDropItem: (id)currentDropItem { int row = [_items indexOfObject: currentDropItem]; int level = [self levelForItem: currentDropItem]; NSRect newRect = [self frameOfCellAtColumn: 0 row: row]; newRect.origin.x = _bounds.origin.x; newRect.size.width = _bounds.size.width + 2; newRect.origin.x -= _intercellSpacing.height / 2; newRect.size.height += _intercellSpacing.height; /* Remember indicator area to be redrawn next time */ oldDraggingRect = newRect; oldDraggingRect.origin.y -= 1; oldDraggingRect.size.height += 2; newRect.size.height -= 1; newRect.origin.x += 3; newRect.size.width -= 3; if (_drawsGrid) { //newRect.origin.y += 1; //newRect.origin.x += 1; //newRect.size.width -= 2; newRect.size.height += 1; } newRect.origin.x += level * _indentationPerLevel; newRect.size.width -= level * _indentationPerLevel; [[NSColor darkGrayColor] set]; NSFrameRectWithWidth(newRect, 2.0); } /* Returns the row whose item is the parent that owns the child at the given row. Also returns the child index relative to this parent. */ - (NSInteger) _parentRowForRow: (NSInteger)row atLevel: (NSInteger)level andReturnChildIndex: (NSInteger *)childIndex { NSInteger i; NSInteger lvl; *childIndex = 0; for (i = row - 1; i >= 0; i--) { BOOL foundParent; BOOL foundSibling; lvl = [self levelForRow: i]; foundParent = (lvl == level - 1); foundSibling = (lvl == level); if (foundParent) { break; } else if (foundSibling) { (*childIndex)++; } } return i; } - (NSDragOperation) draggingUpdated: (id ) sender { NSPoint p = [self convertPoint: [sender draggingLocation] fromView: nil]; /* The insertion row. * The insertion row is identical to the hovered row, except when p is in * the hovered row bottom part (the last quarter). */ NSInteger row; /* A row can be divided into 4 vertically stacked portions. * We call each portion a quarter. * verticalQuarterPosition is the number of quarters that exists between the * top left origin (NSOutlineView is flipped) and the hovered row (precisely * up to the quarter occupied by the pointer in this row). */ NSInteger verticalQuarterPosition; /* An indentation unit can be divided into 2 portions (left and right). * We call each portion a half. * We use it to compute the insertion level. */ NSInteger horizontalHalfPosition; /* The quarter (0, 1, 2 or 3) occupied by the pointer within the hovered row * (not in the insertion row). */ NSInteger positionInRow; /* The previous row level (the row before the insertion row) */ NSInteger levelBefore; /* The next row level (the row after the insertion row) */ NSInteger levelAfter; /* The insertion level that may vary with the horizontal pointer position, * when the pointer is between two rows and the bottom row is a parent. */ NSInteger level; ASSIGN(lastDragUpdate, [NSDate date]); //NSLog(@"draggingUpdated"); /* _bounds.origin is (0, 0) when the outline view is not clipped. * When the view is scrolled, _bounds.origin.y returns the scrolled height. */ verticalQuarterPosition = GSRoundTowardsInfinity(((p.y + _bounds.origin.y) / _rowHeight) * 4.); horizontalHalfPosition = GSRoundTowardsInfinity(((p.x + _bounds.origin.y) / _indentationPerLevel) * 2.); /* We add an extra quarter to shift the insertion row below the hovered row. */ row = (verticalQuarterPosition + 1) / 4; positionInRow = verticalQuarterPosition % 4; if (row > _numberOfRows) { row = _numberOfRows; // beyond the last real row positionInRow = 1; // inside the root item (we could also use 2) } //NSLog(@"horizontalHalfPosition = %d", horizontalHalfPosition); //NSLog(@"verticalQuarterPosition = %d", verticalQuarterPosition); //NSLog(@"insertion row = %d", row); if (row == 0) { levelBefore = 0; } else { levelBefore = [self levelForRow: (row - 1)]; } if (row == _numberOfRows) { levelAfter = 0; } else { levelAfter = [self levelForRow: row]; } //NSLog(@"level before = %d", levelBefore); //NSLog(@"level after = %d", levelAfter); if ((lastVerticalQuarterPosition != verticalQuarterPosition) || (lastHorizontalHalfPosition != horizontalHalfPosition)) { NSInteger minInsertionLevel = levelAfter; NSInteger maxInsertionLevel = levelBefore; NSInteger pointerInsertionLevel = GSRoundTowardsInfinity((float)horizontalHalfPosition / 2.); /* Save positions to avoid executing this code when the general * position of the mouse is unchanged. */ lastVerticalQuarterPosition = verticalQuarterPosition; lastHorizontalHalfPosition = horizontalHalfPosition; /* When the row before is an empty parent, we allow to insert the dragged * item as its child. */ if ([self isExpandable: [self itemAtRow: (row - 1)]]) { maxInsertionLevel++; } /* Find the insertion level to be used with a drop above * * In the outline below, when the pointer moves horizontally on * the dashed line, it can insert at three levels: x level, C level or * B/D level but not at A level. * * + A * + B * + C * - x * --- pointer --- * + D */ if (pointerInsertionLevel < minInsertionLevel) { level = minInsertionLevel; } else if (pointerInsertionLevel > maxInsertionLevel) { level = maxInsertionLevel; } else { level = pointerInsertionLevel; } //NSLog(@"min insert level = %d", minInsertionLevel); //NSLog(@"max insert level = %d", maxInsertionLevel); //NSLog(@"insert level = %d", level); //NSLog(@"row = %d and position in row = %d", row, positionInRow); if (positionInRow > 0 && positionInRow < 3) /* Drop on */ { /* We are directly over the middle of a row ... so the drop * should be directory on the item in that row. */ currentDropItem = [self itemAtRow: row]; currentDropIndex = NSOutlineViewDropOnItemIndex; } else /* Drop above */ { NSInteger childIndex = 0; NSInteger parentRow = [self _parentRowForRow: row atLevel: level andReturnChildIndex: &childIndex]; //NSLog(@"found %d (proposed childIndex = %d)", parentRow, childIndex); currentDropItem = (parentRow == -1 ? nil : [self itemAtRow: parentRow]); currentDropIndex = childIndex; } if ([_dataSource respondsToSelector: @selector(outlineView:validateDrop:proposedItem:proposedChildIndex:)]) { dragOperation = [_dataSource outlineView: self validateDrop: sender proposedItem: currentDropItem proposedChildIndex: currentDropIndex]; } //NSLog(@"Drop on %@ %d", currentDropItem, currentDropIndex); if ((currentDropItem != oldDropItem) || (currentDropIndex != oldDropIndex)) { oldDropItem = currentDropItem; oldDropIndex = currentDropIndex; ASSIGN(lastDragChange, lastDragUpdate); [self lockFocus]; [self setNeedsDisplayInRect: oldDraggingRect]; [self displayIfNeeded]; if (dragOperation != NSDragOperationNone) { if (currentDropIndex != NSOutlineViewDropOnItemIndex && currentDropItem != nil) { [self drawDropAboveIndicatorWithDropItem: currentDropItem atRow: row childDropIndex: currentDropIndex]; } else if (currentDropIndex == NSOutlineViewDropOnItemIndex && currentDropItem == nil) { [self drawDropOnRootIndicator]; } else { [self drawDropOnIndicatorWithDropItem: currentDropItem]; } } [_window flushWindow]; [self unlockFocus]; } } else if (row != _numberOfRows) { /* If we have been hovering over an item for more than half a second, * we should expand it. */ if (lastDragChange != nil && [lastDragUpdate timeIntervalSinceDate: lastDragChange] >= 0.5) { id item = [_items objectAtIndex: row]; if ([self isExpandable: item] && ![self isItemExpanded: item]) { [self expandItem: item expandChildren: NO]; if ([self isItemExpanded: item]) { [autoExpanded addObject: item]; } } /* Set the change date even if we didn't actually expand ... so * we don't keep trying to expand the same item unnecessarily. */ ASSIGN(lastDragChange, lastDragUpdate); } } return dragOperation; } - (BOOL) performDragOperation: (id)sender { BOOL result = NO; if ([_dataSource respondsToSelector: @selector(outlineView:acceptDrop:item:childIndex:)]) { result = [_dataSource outlineView: self acceptDrop: sender item: currentDropItem childIndex: currentDropIndex]; } [self _autoCollapse]; return result; } - (BOOL) prepareForDragOperation: (id)sender { [self setNeedsDisplayInRect: oldDraggingRect]; [self displayIfNeeded]; return YES; } - (NSArray*) namesOfPromisedFilesDroppedAtDestination: (NSURL *)dropDestination { if ([_dataSource respondsToSelector: @selector(outlineView:namesOfPromisedFilesDroppedAtDestination:forDraggedItems:)]) { NSUInteger count = [_selectedRows count]; NSMutableArray *itemArray = [NSMutableArray arrayWithCapacity: count]; NSUInteger index = [_selectedRows firstIndex]; while (index != NSNotFound) { [itemArray addObject: [self itemAtRow: index]]; index = [_selectedRows indexGreaterThanIndex: index]; } return [_dataSource outlineView: self namesOfPromisedFilesDroppedAtDestination: dropDestination forDraggedItems: itemArray]; } else { return nil; } } // Autosave methods... - (void) setAutosaveName: (NSString *)name { [super setAutosaveName: name]; [self _autoloadExpandedItems]; } - (void) editColumn: (NSInteger) columnIndex row: (NSInteger) rowIndex withEvent: (NSEvent *) theEvent select: (BOOL) flag { NSText *t; NSTableColumn *tb; NSRect drawingRect; unsigned length = 0; int level = 0; float indentationFactor = 0.0; // We refuse to edit cells if the delegate can not accept results // of editing. if (_dataSource_editable == NO) { flag = YES; } [self scrollRowToVisible: rowIndex]; [self scrollColumnToVisible: columnIndex]; if (rowIndex < 0 || rowIndex >= _numberOfRows || columnIndex < 0 || columnIndex >= _numberOfColumns) { [NSException raise: NSInvalidArgumentException format: @"Row/column out of index in edit"]; } if (_textObject != nil) { [self validateEditing]; [self abortEditing]; } // Now (_textObject == nil) t = [_window fieldEditor: YES forObject: self]; if ([t superview] != nil) { if ([t resignFirstResponder] == NO) { return; } } _editedRow = rowIndex; _editedColumn = columnIndex; // Prepare the cell // NB: need to be released when no longer used _editedCell = [[self preparedCellAtColumn: columnIndex row: rowIndex] copy]; [_editedCell setEditable: _dataSource_editable]; tb = [_tableColumns objectAtIndex: columnIndex]; [_editedCell setObjectValue: [self _objectValueForTableColumn: tb row: rowIndex]]; // But of course the delegate can mess it up if it wants [self _willDisplayCell: _editedCell forTableColumn: tb row: rowIndex]; /* Please note the important point - calling stringValue normally causes the _editedCell to call the validateEditing method of its control view ... which happens to be this object :-) but we don't want any spurious validateEditing to be performed before the actual editing is started (otherwise you easily end up with the table view picking up the string stored in the field editor, which is likely to be the string resulting from the last edit somewhere else ... getting into the bug that when you TAB from one cell to another one, the string is copied!), so we must call stringValue when _textObject is still nil. */ if (flag) { length = [[_editedCell stringValue] length]; } _textObject = [_editedCell setUpFieldEditorAttributes: t]; // FIXME: Which background color do we want here? [_textObject setBackgroundColor: [NSColor selectedControlColor]]; [_textObject setDrawsBackground: YES]; drawingRect = [self frameOfCellAtColumn: columnIndex row: rowIndex]; if (tb == [self outlineTableColumn]) { id item = nil; NSImage *image = nil; NSCell *imageCell = nil; NSRect imageRect; item = [self itemAtRow: rowIndex]; // determine which image to use... if ([self isItemExpanded: item]) { image = expanded; } else { image = collapsed; } if (![self isExpandable: item]) { image = unexpandable; } level = [self levelForItem: item]; indentationFactor = _indentationPerLevel * level; // create the image cell.. imageCell = [[NSCell alloc] initImageCell: image]; imageRect = [self frameOfOutlineCellAtRow: rowIndex]; if ([_delegate respondsToSelector: @selector(outlineView:willDisplayOutlineCell:forTableColumn:item:)]) { [_delegate outlineView: self willDisplayOutlineCell: imageCell forTableColumn: tb item: item]; } if ([imageCell image]) { imageRect.size.width = [image size].width; imageRect.size.height = [image size].height; // draw... [self lockFocus]; [imageCell drawWithFrame: imageRect inView: self]; [self unlockFocus]; // move the drawing rect over like in the drawRow routine... drawingRect.origin.x += indentationFactor + 5 + imageRect.size.width; drawingRect.size.width -= indentationFactor + 5 + imageRect.size.width; } else { // move the drawing rect over like in the drawRow routine... drawingRect.origin.x += indentationFactor; drawingRect.size.width -= indentationFactor; } RELEASE(imageCell); } if (flag) { [_editedCell selectWithFrame: drawingRect inView: self editor: _textObject delegate: self start: 0 length: length]; } else { [_editedCell editWithFrame: drawingRect inView: self editor: _textObject delegate: self event: theEvent]; } return; } @end /* implementation of NSOutlineView */ @implementation NSOutlineView (NotificationRequestMethods) /* * (NotificationRequestMethods) */ - (void) _postSelectionIsChangingNotification { [nc postNotificationName: NSOutlineViewSelectionIsChangingNotification object: self]; } - (void) _postSelectionDidChangeNotification { [nc postNotificationName: NSOutlineViewSelectionDidChangeNotification object: self]; } - (void) _postColumnDidMoveNotificationWithOldIndex: (int) oldIndex newIndex: (int) newIndex { [nc postNotificationName: NSOutlineViewColumnDidMoveNotification object: self userInfo: [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt: newIndex], @"NSNewColumn", [NSNumber numberWithInt: oldIndex], @"NSOldColumn", nil]]; } - (void) _postColumnDidResizeNotificationWithOldWidth: (float) oldWidth { [nc postNotificationName: NSOutlineViewColumnDidResizeNotification object: self userInfo: [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithFloat: oldWidth], @"NSOldWidth", nil]]; } - (BOOL) _shouldSelectTableColumn: (NSTableColumn *)tableColumn { if ([_delegate respondsToSelector: @selector (outlineView:shouldSelectTableColumn:)] == YES) { if ([_delegate outlineView: self shouldSelectTableColumn: tableColumn] == NO) { return NO; } } return YES; } - (BOOL) _shouldSelectRow: (int)rowIndex { id item = [self itemAtRow: rowIndex]; if ([_delegate respondsToSelector: @selector (outlineView:shouldSelectItem:)] == YES) { if ([_delegate outlineView: self shouldSelectItem: item] == NO) { return NO; } } return YES; } - (BOOL) _shouldSelectionChange { if ([_delegate respondsToSelector: @selector (selectionShouldChangeInTableView:)] == YES) { if ([_delegate selectionShouldChangeInTableView: self] == NO) { return NO; } } return YES; } - (void) _didChangeSortDescriptors: (NSArray *)oldSortDescriptors { if ([_dataSource respondsToSelector: @selector(outlineView:sortDescriptorsDidChange:)]) { [_dataSource outlineView: self sortDescriptorsDidChange: oldSortDescriptors]; } } - (void) _didClickTableColumn: (NSTableColumn *)tc { if ([_delegate respondsToSelector: @selector(outlineView:didClickTableColumn:)]) { [_delegate outlineView: self didClickTableColumn: tc]; } } - (BOOL) _shouldEditTableColumn: (NSTableColumn *)tableColumn row: (int) rowIndex { if ([_delegate respondsToSelector: @selector(outlineView:shouldEditTableColumn:item:)]) { id item = [self itemAtRow: rowIndex]; if ([_delegate outlineView: self shouldEditTableColumn: tableColumn item: item] == NO) { return NO; } } return YES; } - (void) _willDisplayCell: (NSCell*)cell forTableColumn: (NSTableColumn *)tb row: (int)index { if (_del_responds) { id item = [self itemAtRow: index]; [_delegate outlineView: self willDisplayCell: cell forTableColumn: tb item: item]; } } - (BOOL) _writeRows: (NSIndexSet *)rows toPasteboard: (NSPasteboard *)pboard { NSUInteger count = [rows count]; NSMutableArray *itemArray = [NSMutableArray arrayWithCapacity: count]; NSUInteger index = [rows firstIndex]; while (index != NSNotFound) { [itemArray addObject: [self itemAtRow: index]]; index = [rows indexGreaterThanIndex: index]; } if ([_dataSource respondsToSelector: @selector(outlineView:writeItems:toPasteboard:)] == YES) { return [_dataSource outlineView: self writeItems: itemArray toPasteboard: pboard]; } return NO; } - (BOOL) _isDraggingSource { return [_dataSource respondsToSelector: @selector(outlineView:writeItems:toPasteboard:)]; } - (id) _objectValueForTableColumn: (NSTableColumn *)tb row: (int) index { id result = nil; if ([_dataSource respondsToSelector: @selector(outlineView:objectValueForTableColumn:byItem:)]) { id item = [self itemAtRow: index]; result = [_dataSource outlineView: self objectValueForTableColumn: tb byItem: item]; } return result; } - (void) _setObjectValue: (id)value forTableColumn: (NSTableColumn *)tb row: (int) index { if ([_dataSource respondsToSelector: @selector(outlineView:setObjectValue:forTableColumn:byItem:)]) { id item = [self itemAtRow: index]; [_dataSource outlineView: self setObjectValue: value forTableColumn: tb byItem: item]; } } - (int) _numRows { return [_items count]; } @end @implementation NSOutlineView (TableViewInternalPrivate) - (void) _initOutlineDefaults { _itemDict = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 64); _items = [[NSMutableArray alloc] init]; _expandedItems = [[NSMutableArray alloc] init]; _levelOfItems = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 64); _indentationMarkerFollowsCell = YES; _autoResizesOutlineColumn = NO; _autosaveExpandedItems = NO; _indentationPerLevel = 10.0; } - (void) _autosaveExpandedItems { if (_autosaveExpandedItems && _autosaveName != nil) { NSUserDefaults *defaults; NSString *tableKey; defaults = [NSUserDefaults standardUserDefaults]; tableKey = [NSString stringWithFormat: @"NSOutlineView Expanded Items %@", _autosaveName]; [defaults setObject: _expandedItems forKey: tableKey]; [defaults synchronize]; } } - (void) _autoloadExpandedItems { if (_autosaveExpandedItems && _autosaveName != nil) { NSUserDefaults *defaults; id config; NSString *tableKey; defaults = [NSUserDefaults standardUserDefaults]; tableKey = [NSString stringWithFormat: @"NSOutlineView Expanded Items %@", _autosaveName]; config = [defaults objectForKey: tableKey]; if (config != nil) { NSEnumerator *en = [config objectEnumerator]; id item = nil; while ((item = [en nextObject]) != nil) { [self expandItem: item]; } } } } // Collect all of the items under a given element. - (void)_collectItemsStartingWith: (id)startitem into: (NSMutableArray *)allChildren { int num; int i; id sitem = (startitem == nil) ? (id)[NSNull null] : (id)startitem; NSMutableArray *anarray; anarray = NSMapGet(_itemDict, sitem); num = [anarray count]; for (i = 0; i < num; i++) { id anitem = [anarray objectAtIndex: i]; // Only collect the children if the item is expanded if ([self isItemExpanded: startitem]) { [allChildren addObject: anitem]; } [self _collectItemsStartingWith: anitem into: allChildren]; } } - (BOOL) _isItemLoaded: (id)item { id sitem = (item == nil) ? (id)[NSNull null] : (id)item; id object = NSMapGet(_itemDict, sitem); // NOTE: We could store the loaded items in a map to ensure we only load // the children of item when it gets expanded for the first time. This would // allow to write: return (NSMapGet(_loadedItemDict, sitem) != nil); // The last line isn't truly correct because it implies an item without // children will get incorrectly reloaded automatically on each // expand/collapse. return ([object count] != 0); } - (void) _loadDictionaryStartingWith: (id) startitem atLevel: (int) level { int num = 0; int i = 0; id sitem = (startitem == nil) ? (id)[NSNull null] : (id)startitem; NSMutableArray *anarray = nil; /* Check to see if item is expandable and expanded before getting the number * of items. For macos compatibility the topmost item (startitem==nil) * is always considered expandable and must not be checked. * We must load the item only if expanded, otherwise an outline view is not * usable with a big tree structure. For example, an outline view to browse * file system would try to traverse every file/directory on -reloadData. */ if ((startitem == nil || [_dataSource outlineView: self isItemExpandable: startitem]) && [self isItemExpanded: startitem]) { num = [_dataSource outlineView: self numberOfChildrenOfItem: startitem]; } if (num > 0) { anarray = [NSMutableArray array]; NSMapInsert(_itemDict, sitem, anarray); } NSMapInsert(_levelOfItems, sitem, [NSNumber numberWithInt: level]); for (i = 0; i < num; i++) { id anitem = [_dataSource outlineView: self child: i ofItem: startitem]; [anarray addObject: anitem]; [self _loadDictionaryStartingWith: anitem atLevel: level + 1]; } } - (void)_closeItem: (id)item { NSUInteger i, numChildren; NSMutableArray *removeAll = [NSMutableArray array]; [self _collectItemsStartingWith: item into: removeAll]; numChildren = [removeAll count]; // close the item... if (item != nil) { [_expandedItems removeObject: item]; } // For the close method it doesn't matter what order they are // removed in. for (i = 0; i < numChildren; i++) { id child = [removeAll objectAtIndex: i]; [_items removeObject: child]; } [self _noteNumberOfRowsChangedBelowItem: item by: -numChildren]; } - (void)_openItem: (id)item { NSUInteger insertionPoint, numChildren, numDescendants; NSInteger i; id object; id sitem = (item == nil) ? (id)[NSNull null] : (id)item; // open the item... if (item != nil) { [_expandedItems addObject: item]; } // Load the children of the item if needed if ([self _isItemLoaded: item] == NO) { [self _loadDictionaryStartingWith: item atLevel: [self levelForItem: item]]; } object = NSMapGet(_itemDict, sitem); numChildren = numDescendants = [object count]; insertionPoint = [_items indexOfObject: item]; if (insertionPoint == NSNotFound) { insertionPoint = 0; } else { insertionPoint++; } for (i = numChildren-1; i >= 0; i--) { id obj = NSMapGet(_itemDict, sitem); id child = [obj objectAtIndex: i]; // Add all of the children... if ([self isItemExpanded: child]) { NSUInteger numItems; NSInteger j; NSMutableArray *insertAll = [NSMutableArray array]; [self _collectItemsStartingWith: child into: insertAll]; numItems = [insertAll count]; numDescendants += numItems; for (j = numItems-1; j >= 0; j--) { [_items insertObject: [insertAll objectAtIndex: j] atIndex: insertionPoint]; } } // Add the parent [_items insertObject: child atIndex: insertionPoint]; } [self _noteNumberOfRowsChangedBelowItem: item by: numDescendants]; } - (void) _removeChildren: (id)startitem { NSUInteger i, numChildren; id sitem = (startitem == nil) ? (id)[NSNull null] : (id)startitem; NSMutableArray *anarray; anarray = NSMapGet(_itemDict, sitem); numChildren = [anarray count]; for (i = 0; i < numChildren; i++) { id child = [anarray objectAtIndex: i]; [self _removeChildren: child]; NSMapRemove(_itemDict, child); [_items removeObject: child]; [_expandedItems removeObject: child]; } [anarray removeAllObjects]; [self _noteNumberOfRowsChangedBelowItem: startitem by: -numChildren]; } - (void) _noteNumberOfRowsChangedBelowItem: (id)item by: (int)numItems { BOOL selectionDidChange = NO; NSUInteger rowIndex, nextIndex; // check for trivial case if (numItems == 0) return; // if a row below item is selected, update the selected row indexes /* Note: We update the selected row indexes directly instead of calling * -selectRowIndexes:extendingSelection: to avoid posting bogus selection * did change notifications. */ rowIndex = [_items indexOfObject: item]; rowIndex = (rowIndex == NSNotFound) ? 0 : rowIndex + 1; nextIndex = [_selectedRows indexGreaterThanOrEqualToIndex: rowIndex]; if (nextIndex != NSNotFound) { if (numItems > 0) { [_selectedRows shiftIndexesStartingAtIndex: rowIndex by: numItems]; if (_selectedRow >= rowIndex) { _selectedRow += numItems; } } else { numItems = -numItems; [_selectedRows shiftIndexesStartingAtIndex: rowIndex + numItems by: -numItems]; if (nextIndex < rowIndex + numItems) { /* Don't post the notification here, as the table view is in * an inconsistent state. */ selectionDidChange = YES; } /* If the selection becomes empty after removing items and the * receiver does not allow empty selections, select the root item. */ if ([_selectedRows firstIndex] == NSNotFound && [self allowsEmptySelection] == NO) { [_selectedRows addIndex: 0]; } if (_selectedRow >= rowIndex + numItems) { _selectedRow -= numItems; } else if (_selectedRow >= rowIndex) { /* If the item at _selectedRow was removed, we arbitrarily choose * another selected item (if there is still any). The policy * implemented below chooses the index most close to item. */ NSUInteger r1 = [_selectedRows indexLessThanIndex: rowIndex]; NSUInteger r2 = [_selectedRows indexGreaterThanOrEqualToIndex: rowIndex]; if (r1 != NSNotFound && r2 != NSNotFound) { _selectedRow = (rowIndex - r1) <= (r2 - rowIndex) ? r1 : r2; } else if (r1 != NSNotFound) { _selectedRow = r1; } else if (r2 != NSNotFound) { _selectedRow = r2; } else { _selectedRow = -1; } } } } [self noteNumberOfRowsChanged]; if (selectionDidChange) { [self _postSelectionDidChangeNotification]; } } - (NSCell *) preparedCellAtColumn: (NSInteger)columnIndex row: (NSInteger)rowIndex { NSCell *cell = nil; NSTableColumn *tb = [_tableColumns objectAtIndex: columnIndex]; if ([_delegate respondsToSelector: @selector(outlineView:dataCellForTableColumn:item:)]) { id item = [self itemAtRow: rowIndex]; cell = [_delegate outlineView: self dataCellForTableColumn: tb item: item]; } if (cell == nil) { cell = [tb dataCellForRow: rowIndex]; } return cell; } @end @implementation NSOutlineView (Private) /* Collapse all the items which were automatically expanded to allow drop. */ - (void) _autoCollapse { NSEnumerator *e; id item; e = [autoExpanded objectEnumerator]; while ((item = [e nextObject]) != nil) { [self collapseItem: item collapseChildren: YES]; } [autoExpanded removeAllObjects]; } @end gnustep-gui-0.24.0/Source/NSSecureTextField.m0000664000076500007650000002202211707505215020661 0ustar brains99brains99/** NSSecureTextField Secure Text field control class for hidden text entry Copyright (C) 1999 Free Software Foundation, Inc. Author: Gregory John Casamento Date: 2000 Author: Nicola Pero Date: October 2002 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import "AppKit/NSAttributedString.h" #import "AppKit/NSEvent.h" #import "AppKit/NSFont.h" #import "AppKit/NSImage.h" #import "AppKit/NSGlyphGenerator.h" #import "AppKit/NSLayoutManager.h" #import "AppKit/NSSecureTextField.h" #import "AppKit/NSStringDrawing.h" #import "AppKit/NSTextContainer.h" #import "AppKit/NSTextView.h" #import "AppKit/NSWindow.h" #import "GNUstepGUI/GSFontInfo.h" // the Unicode code point for a bullet #define BULLET 0x2022 /* 'Secure' subclasses */ @interface NSSecureTextView : NSTextView { } - (void) setEchosBullets:(BOOL)flag; - (BOOL) echosBullets; @end @interface GSSimpleSecureGlyphGenerator : NSGlyphGenerator @end @interface NSGlyphGenerator (Private) - (NSFont *) fontForCharactersWithAttributes: (NSDictionary *)attributes; @end @interface GSSimpleSecureLayoutManager : NSLayoutManager { BOOL _echosBullets; } - (void) setEchosBullets:(BOOL)flag; - (BOOL) echosBullets; @end @implementation NSSecureTextField + (void) initialize { if (self == [NSSecureTextField class]) { [self setVersion:2]; } } + (Class) cellClass { /* Hard code here to make sure no other class is used. */ return [NSSecureTextFieldCell class]; } + (void) setCellClass: (Class)factoryId { /* Ward off interlopers with a stern message. */ [NSException raise: NSInvalidArgumentException format: @"NSSecureTextField only uses NSSecureTextFieldCells."]; } - (id) initWithCoder: (NSCoder *)coder { if((self = [super initWithCoder: coder]) != nil) { [self setEchosBullets: YES]; } return self; } - (id) initWithFrame:(NSRect)frameRect { self = [super initWithFrame: frameRect]; if (nil == self) return nil; [self setEchosBullets: YES]; return self; } - (void) setEchosBullets: (BOOL)flag { [_cell setEchosBullets: flag]; } - (BOOL) echosBullets { return [_cell echosBullets]; } @end /* NSSecureTextField */ @implementation NSSecureTextFieldCell + (void)initialize { if (self == [NSSecureTextFieldCell class]) { [self setVersion:2]; } } - (BOOL) echosBullets { return _echosBullets; } /* Functionality not implemented. */ - (void) setEchosBullets: (BOOL)flag { _echosBullets = flag; } /* Substitute a fixed-pitch font for correct bullet drawing */ - (void) setFont: (NSFont *) f { if (![f isFixedPitch]) { f = [NSFont userFixedPitchFontOfSize: [f pointSize]]; } [super setFont: f]; } - (NSAttributedString *)_replacementAttributedString { NSDictionary *attributes; NSMutableString *string; unsigned int length; unsigned int i; unichar *buf; length = [[self stringValue] length]; buf = NSZoneMalloc (NSDefaultMallocZone (), length * sizeof (unichar)); for (i = 0; i < length; i++) { buf[i] = BULLET; } string = [[NSMutableString alloc] initWithCharactersNoCopy: buf length: length freeWhenDone: YES]; AUTORELEASE (string); attributes = [self _nonAutoreleasedTypingAttributes]; return AUTORELEASE([[NSAttributedString alloc] initWithString: string attributes: attributes]); } - (NSAttributedString*) _drawAttributedString { if (_echosBullets) { if (!_cell.is_disabled) { return [self _replacementAttributedString]; } else { NSAttributedString *attrStr = [self _replacementAttributedString]; NSDictionary *attribs; NSMutableDictionary *newAttribs; attribs = [attrStr attributesAtIndex: 0 effectiveRange: NULL]; newAttribs = [NSMutableDictionary dictionaryWithDictionary: attribs]; [newAttribs setObject: [NSColor disabledControlTextColor] forKey: NSForegroundColorAttributeName]; return AUTORELEASE([[NSAttributedString alloc] initWithString: [attrStr string] attributes: newAttribs]); } } else { /* .. do nothing. */ return nil; } } - (NSText *) setUpFieldEditorAttributes: (NSText *)textObject { NSSecureTextView *secureView; /* Replace the text object with a secure instance. It's not shared. */ secureView = AUTORELEASE([[NSSecureTextView alloc] init]); [secureView setEchosBullets: [self echosBullets]]; return [super setUpFieldEditorAttributes: secureView]; } - (id) initWithCoder: (NSCoder *)decoder { self = [super initWithCoder: decoder]; if (nil == self) return nil; if ([decoder allowsKeyedCoding]) { _echosBullets = [decoder decodeBoolForKey: @"GSEchoBullets"]; } else { [decoder decodeValueOfObjCType: @encode(BOOL) at: &_echosBullets]; } return self; } - (void) encodeWithCoder: (NSCoder *)coder { [super encodeWithCoder: coder]; if([coder allowsKeyedCoding]) { [coder encodeBool: _echosBullets forKey: @"GSEchoBullets"]; } else { [coder encodeValueOfObjCType: @encode(BOOL) at: &_echosBullets]; } } @end @implementation GSSimpleSecureGlyphGenerator - (void) generateGlyphsForGlyphStorage: (id )storage desiredNumberOfCharacters: (NSUInteger)num glyphIndex: (NSUInteger*)glyph characterIndex: (NSUInteger*)index { NSGlyph glyphs[num]; NSGlyph gl; NSAttributedString *attrstr = [storage attributedString]; GSFontInfo *fi; int i; NSRange maxRange = NSMakeRange(*index, num); NSRange curRange; NSDictionary *attributes; attributes = [attrstr attributesAtIndex: *index longestEffectiveRange: &curRange inRange: maxRange]; fi = [[self fontForCharactersWithAttributes: attributes] fontInfo]; if (!fi) { [NSException raise: NSGenericException format: @"Glyph generation with no font."]; return; } gl = [fi glyphForCharacter: BULLET]; for (i = 0; i < num; i++) { glyphs[i] = gl; } [storage insertGlyphs: glyphs length: num forStartingGlyphAtIndex: *glyph characterIndex: *index]; } @end @implementation GSSimpleSecureLayoutManager - (BOOL) echosBullets { return _echosBullets; } - (void) setEchosBullets: (BOOL)flag { _echosBullets = flag; } - (void) drawGlyphsForGlyphRange: (NSRange)glyphRange atPoint: (NSPoint)containerOrigin { if ([self echosBullets]) { [super drawGlyphsForGlyphRange: glyphRange atPoint: containerOrigin]; } else { /* Do nothing. */ } } @end @implementation NSSecureTextView - (id) initWithFrame: (NSRect)frameRect textContainer: (NSTextContainer*)aTextContainer { GSSimpleSecureLayoutManager *m; GSSimpleSecureGlyphGenerator *g; /* Perform the normal init. */ self = [super initWithFrame: frameRect textContainer: aTextContainer]; if (nil == self) return nil; /* Then, replace the layout manager with a * GSSimpleSecureLayoutManager. */ m = [[GSSimpleSecureLayoutManager alloc] init]; g = [[GSSimpleSecureGlyphGenerator alloc] init]; [m setGlyphGenerator: g]; RELEASE(g); [[self textContainer] replaceLayoutManager: m]; RELEASE(m); [self setFieldEditor: YES]; return self; } - (BOOL) echosBullets { return [(GSSimpleSecureLayoutManager*)[self layoutManager] echosBullets]; } - (void) setEchosBullets: (BOOL)flag { [(GSSimpleSecureLayoutManager*)[self layoutManager] setEchosBullets: flag]; } - (BOOL) writeSelectionToPasteboard: (NSPasteboard*)pboard types: (NSArray*)types { /* Return NO since the selection should never be written to the * pasteboard */ return NO; } - (id) validRequestorForSendType: (NSString*) sendType returnType: (NSString*) returnType { /* Return nil to indicate that no type can be sent to the pasteboard * for an object of this class. */ return nil; } @end gnustep-gui-0.24.0/Source/NSPanel.m0000664000076500007650000001324312101306763016662 0ustar brains99brains99/** NSPanel Panel window class and related functions 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import "AppKit/NSButton.h" #import "AppKit/NSEvent.h" #import "AppKit/NSImage.h" #import "AppKit/NSPanel.h" #import "AppKit/NSTextField.h" @implementation NSPanel /* * Class methods */ + (void)initialize { if (self == [NSPanel class]) { [self setVersion: 1]; } } /* * Instance methods */ - (id) init { int style = NSTitledWindowMask | NSClosableWindowMask; return [self initWithContentRect: NSZeroRect styleMask: style backing: NSBackingStoreBuffered defer: NO]; } - (id) initWithContentRect: (NSRect)contentRect styleMask: (NSUInteger)aStyle backing: (NSBackingStoreType)bufferingType defer: (BOOL)flag { self = [super initWithContentRect: contentRect styleMask: aStyle backing: bufferingType defer: flag]; if (nil == self) { return nil; } if ((_styleMask & NSUtilityWindowMask) == NSUtilityWindowMask) { [self setFloatingPanel: YES]; } return self; } - (void) _initDefaults { [super _initDefaults]; [self setReleasedWhenClosed: NO]; [self setHidesOnDeactivate: YES]; [self setExcludedFromWindowsMenu: YES]; } - (BOOL) canBecomeKeyWindow { return YES; } - (BOOL) canBecomeMainWindow { return NO; } /* * If we receive an escape, close. */ - (void) keyDown: (NSEvent*)theEvent { if ([@"\e" isEqual: [theEvent charactersIgnoringModifiers]] && ([self styleMask] & NSClosableWindowMask) == NSClosableWindowMask) [self close]; else [super keyDown: theEvent]; } /**

Returns whether the NSPanel is a floating panel, e.g. the window level is NSFloatingWindowLevel instead of NSNormalWindowLevel.

See Also: -setFloatingPanel:

*/ - (BOOL) isFloatingPanel { return _isFloatingPanel; } /**

Sets whether the NSPanel is a floating panel, e.g. the window level is NSFloatingWindowLevel instead of NSNormalWindowLevel.

See Also: -isFloatingPanel [NSWindow-setLevel:]

*/ - (void) setFloatingPanel: (BOOL)flag { if (_isFloatingPanel != flag) { _isFloatingPanel = flag; if (flag == YES) { [self setLevel: NSFloatingWindowLevel]; } else { [self setLevel: NSNormalWindowLevel]; } } } /**

Returns whether the NSPanel can receive events when another window/panel runs modally.

See Also: -setWorksWhenModal: [NSApplication-runModalSession:]

*/ - (BOOL) worksWhenModal { return _worksWhenModal; } /**

Sets whether the NSPanel can receive events when another window/panel runs modally.

See Also: -worksWhenModal [NSApplication-runModalSession:] */ - (void) setWorksWhenModal: (BOOL)flag { _worksWhenModal = flag; } /**

Returns whether if the NSPanel becomes key window only when a view require to be the first responder.

See Also: -setBecomesKeyOnlyIfNeeded: [NSView-needsPanelToBecomeKey] [NSWindow-sendEvent:]

*/ - (BOOL) becomesKeyOnlyIfNeeded { return _becomesKeyOnlyIfNeeded; } /**

Sets whether if the NSPanel becomes key window only when a view require to be the first responder.

See Also: -setBecomesKeyOnlyIfNeeded: [NSView-needsPanelToBecomeKey] [NSWindow-sendEvent:]

*/ - (void) setBecomesKeyOnlyIfNeeded: (BOOL)flag { _becomesKeyOnlyIfNeeded = flag; } /* * NSCoding protocol */ - (void) encodeWithCoder: (NSCoder*)aCoder { BOOL flag; [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { // Nothing to do here, for keyed coding this is handled by NSWindowTemplate. // Calling the above method should throw an NSInvalidArgumentException. } else { flag = _becomesKeyOnlyIfNeeded; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _isFloatingPanel; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _worksWhenModal; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; } } - (id) initWithCoder: (NSCoder*)aDecoder { BOOL flag; self = [super initWithCoder: aDecoder]; if (nil == self) return nil; if ([aDecoder allowsKeyedCoding]) { // Nothing to do here, for keyed coding this is handled by NSWindowTemplate. // Calling the above method should throw an NSInvalidArgumentException. } else { [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; [self setBecomesKeyOnlyIfNeeded: flag]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; [self setFloatingPanel: flag]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; [self setWorksWhenModal: flag]; } return self; } @end /* NSPanel */ gnustep-gui-0.24.0/Source/NSWindow.m0000664000076500007650000046415112243727236017113 0ustar brains99brains99/** NSWindow The window class Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Venkat Ajjanagadde Date: 1996 Author: Felipe A. Rodriguez Date: June 1998 Author: Richard Frith-Macdonald Date: December 1998 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #include #include #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import "AppKit/NSAnimation.h" #import "AppKit/NSApplication.h" #import "AppKit/NSButton.h" #import "AppKit/NSButtonCell.h" #import "AppKit/NSCachedImageRep.h" #import "AppKit/NSColor.h" #import "AppKit/NSColorList.h" #import "AppKit/NSCursor.h" #import "AppKit/NSDocumentController.h" #import "AppKit/NSDocument.h" #import "AppKit/NSDragging.h" #import "AppKit/NSEvent.h" #import "AppKit/NSFont.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSHelpManager.h" #import "AppKit/NSKeyValueBinding.h" #import "AppKit/NSImage.h" #import "AppKit/NSMenu.h" #import "AppKit/NSPasteboard.h" #import "AppKit/NSScreen.h" #import "AppKit/NSTextField.h" #import "AppKit/NSTextFieldCell.h" #import "AppKit/NSView.h" #import "AppKit/NSWindow.h" #import "AppKit/NSWindowController.h" #import "AppKit/PSOperators.h" #import "GNUstepGUI/GSTheme.h" #import "GNUstepGUI/GSTrackingRect.h" #import "GNUstepGUI/GSDisplayServer.h" #import "GNUstepGUI/GSWindowDecorationView.h" #import "GSBindingHelpers.h" #import "GSGuiPrivate.h" #import "GSToolTips.h" #import "GSIconManager.h" #import "NSToolbarFrameworkPrivate.h" #import "NSViewPrivate.h" #define GSI_ARRAY_TYPES 0 #define GSI_ARRAY_TYPE NSWindow * #define GSI_ARRAY_NO_RELEASE 1 #define GSI_ARRAY_NO_RETAIN 1 #ifdef GSIArray #undef GSIArray #endif #include static GSToolTips *toolTipVisible = nil; static id windowDecorator = nil; BOOL GSViewAcceptsDrag(NSView *v, id dragInfo); @interface NSObject (DragInfoBackend) - (void) dragImage: (NSImage*)anImage at: (NSPoint)screenLocation offset: (NSSize)initialOffset event: (NSEvent*)event pasteboard: (NSPasteboard*)pboard source: (id)sourceObject slideBack: (BOOL)slideFlag; - (void) postDragEvent: (NSEvent*)event; @end @interface NSView (MoveToWindow) // Normally this method is only used internally. - (void) _viewWillMoveToWindow: (NSWindow*)newWindow; @end @interface NSScreen (PrivateMethods) - (id) _initWithScreenNumber: (int)screen; @end @interface NSApplication(Inactive) - (BOOL) _isWindowInactive: (NSWindow *)window; - (void) _setWindow: (NSWindow *)window inactive: (BOOL)inactive; @end @interface GSWindowAnimationDelegate : NSObject { } @end @implementation GSWindowAnimationDelegate - (void) animationDidEnd: (NSAnimation *)animation { AUTORELEASE(animation); } - (void) animationDidStop: (NSAnimation *)animation { AUTORELEASE(animation); } @end static GSWindowAnimationDelegate *animationDelegate; /* * Category for internal methods (for use only within the NSWindow class itself * or with other AppKit classes. */ @interface NSWindow (GNUstepPrivate) + (void) _addAutodisplayedWindow: (NSWindow *)w; + (void) _removeAutodisplayedWindow: (NSWindow *)w; + (void) _setToolTipVisible: (GSToolTips*)t; + (GSToolTips*) _toolTipVisible; - (void) _lossOfKeyOrMainWindow; - (NSView *) _windowView; - (NSScreen *) _screenForFrame: (NSRect)frame; @end @implementation NSWindow (GNUstepPrivate) + (void) _setToolTipVisible: (GSToolTips*)t { toolTipVisible = t; } + (GSToolTips*) _toolTipVisible { return toolTipVisible; } /* Window autodisplay machinery. */ - (void) _handleAutodisplay { if (_f.is_autodisplay && _f.views_need_display) { [self disableFlushWindow]; [self displayIfNeeded]; [self enableFlushWindow]; [self flushWindowIfNeeded]; } } static NSArray *modes = nil; /* Array of windows we might need to handle autodisplay for (in practice a list of windows that are, wrt. -gui, on-screen). */ static GSIArray_t autodisplayedWindows; /* This method handles all normal displaying. It is set to be run on each runloop iteration when the first window is created The reason why this performer is always added, as opposed to adding it when display is needed and not re-adding it here, is that -setNeedsDisplay* might be called from a method invoked by -performSelector:target:argument:order:modes:, and if it is, the display needs to happen in the same runloop iteration, before blocking for events. If the performer were added in a call to another performer, it wouldn't be called until the next runloop iteration, ie. after the runloop has blocked and waited for events. */ +(void) _handleAutodisplay: (id)bogus { int i; for (i = 0; i < GSIArrayCount(&autodisplayedWindows); i++) [GSIArrayItemAtIndex(&autodisplayedWindows, i).ext _handleAutodisplay]; [[NSRunLoop currentRunLoop] performSelector: @selector(_handleAutodisplay:) target: self argument: nil order: 600000 modes: modes]; } +(void) _addAutodisplayedWindow: (NSWindow *)w { int i; /* If it's the first time we're called, set up the performer and modes array. */ if (!modes) { modes = [[NSArray alloc] initWithObjects: NSDefaultRunLoopMode, NSModalPanelRunLoopMode, NSEventTrackingRunLoopMode, nil]; [[NSRunLoop currentRunLoop] performSelector: @selector(_handleAutodisplay:) target: self argument: nil order: 600000 modes: modes]; GSIArrayInitWithZoneAndCapacity(&autodisplayedWindows, NSDefaultMallocZone(), 1); } /* O(n), but it's much more important that _handleAutodisplay: can iterate quickly over the array. (_handleAutodisplay: is called once for every event, this method is only called when windows are ordered in or out.) */ for (i = 0; i < GSIArrayCount(&autodisplayedWindows); i++) if (GSIArrayItemAtIndex(&autodisplayedWindows, i).ext == w) return; GSIArrayAddItem(&autodisplayedWindows, (GSIArrayItem)w); } +(void) _removeAutodisplayedWindow: (NSWindow *)w { int i; for (i = 0; i < GSIArrayCount(&autodisplayedWindows); i++) if (GSIArrayItemAtIndex(&autodisplayedWindows, i).ext == w) { GSIArrayRemoveItemAtIndex(&autodisplayedWindows, i); return; } /* This happens eg. if a window is ordered out twice. In such cases, the window has already been removed from the list, so we don't need to do anything here. */ } /* We get here if we were ordered out or miniaturized. In this case if we were the key or main window, go through the list of all windows and try to find another window that can take our place as key and/or main. Automatically ignore windows that cannot become key/main and skip the main menu window (which is the only non-obvious window that can become key) unless we have no choice (i.e. all the candidate windows were ordered out.) */ - (void) _lossOfKeyOrMainWindow { NSArray *windowList = GSOrderedWindows(); NSUInteger pos = [windowList indexOfObjectIdenticalTo: self]; NSUInteger c = [windowList count]; NSUInteger i; // Don't bother when application is closing. if ([NSApp isRunning] == NO) return; if (!c) return; if (pos == NSNotFound) { pos = c; } if ([self isKeyWindow]) { NSWindow *w = [NSApp mainWindow]; [self resignKeyWindow]; if (w != nil && w != self && [w canBecomeKeyWindow]) { [w makeKeyWindow]; } else { NSWindow *menu_window = [[NSApp mainMenu] window]; // try all windows front to back except self and menu for (i = 0; i < c; i++) { if (i != pos) { w = [windowList objectAtIndex: i]; if ([w isVisible] && [w canBecomeKeyWindow] && w != menu_window) { [w makeKeyWindow]; break; } } } /* * if we didn't find a possible key window - use the main menu window */ if (i == c) { if (menu_window != nil) { // FIXME: Why this call and not makeKeyWindow? [GSServerForWindow(menu_window) setinputfocus: [menu_window windowNumber]]; } } } } if ([self isMainWindow]) { NSWindow *w = [NSApp keyWindow]; [self resignMainWindow]; if (w != nil && [w canBecomeMainWindow]) { [w makeMainWindow]; } else { // try all windows front to back except self for (i = 0; i < c; i++) { if (i != pos) { w = [windowList objectAtIndex: i]; if ([w isVisible] && [w canBecomeMainWindow]) { [w makeMainWindow]; break; } } } } } } - (NSView *) _windowView { return _wv; } /* * This is just the Apple name for our _windowView method. */ - (NSView *) _borderView { return _wv; } /* Support method to properly implement the 'screen' method for NSWindow. According to documentation the 'screen' method should return the screen that the window "show up the most or nil". This method supports the 'screen' method and internal requests for the correct 'screen' based on the supplied frame request. */ - (NSScreen *) _screenForFrame: (NSRect)frame { NSInteger largest = -1; NSArray *screens = [NSScreen screens]; NSInteger index = 0; NSScreen *theScreen = nil; for (index = 0; index < [screens count]; ++index) { NSScreen *screen = [screens objectAtIndex: index]; NSRect sframe = [screen frame]; NSRect iframe = NSIntersectionRect(frame, sframe); NSInteger isize = NSWidth(iframe) * NSHeight(iframe); if (isize > largest) { largest = isize; theScreen = screen; } } NSDebugLLog(@"NSWindow", @"%s: frame: %@ screen: %@ size: %ld\n", __PRETTY_FUNCTION__, NSStringFromRect(frame), theScreen, (long)largest); return theScreen; } @end @interface NSMiniWindow : NSWindow @end @implementation NSMiniWindow - (BOOL) canBecomeMainWindow { return NO; } - (BOOL) canBecomeKeyWindow { return NO; } - (void) _initDefaults { [super _initDefaults]; [self setExcludedFromWindowsMenu: YES]; [self setReleasedWhenClosed: NO]; /* App icons and mini windows are displayed at dock level by default. Yet, with the current window level mapping in -back, some window managers will order pop up and context menus behind app icons and mini windows. Therefore, it is possible to have app icons and mini windows displayed at normal window level under control of a user preference. */ // See also NSIconWindow _initDefaults in NSApplication.m if ([[NSUserDefaults standardUserDefaults] boolForKey: @"GSAllowWindowsOverIcons"] == YES) _windowLevel = NSDockWindowLevel; } @end @interface NSMiniWindowView : NSView { NSCell *imageCell; NSTextFieldCell *titleCell; } - (void) setImage: (NSImage*)anImage; - (void) setTitle: (NSString*)aString; @end static NSCell *tileCell = nil; static NSSize scaledIconSizeForSize(NSSize imageSize) { NSSize iconSize, retSize; iconSize = GSGetIconSize(); retSize.width = imageSize.width * iconSize.width / 64; retSize.height = imageSize.height * iconSize.height / 64; return retSize; } @implementation NSMiniWindowView + (void) initialize { NSImage *tileImage; NSSize iconSize; iconSize = GSGetIconSize(); tileImage = [[GSCurrentServer() iconTileImage] copy]; [tileImage setScalesWhenResized: YES]; [tileImage setSize: iconSize]; tileCell = [[NSCell alloc] initImageCell: tileImage]; RELEASE(tileImage); [tileCell setBordered: NO]; } - (BOOL) acceptsFirstMouse: (NSEvent*)theEvent { return YES; } - (void) dealloc { TEST_RELEASE(imageCell); TEST_RELEASE(titleCell); [super dealloc]; } - (void) drawRect: (NSRect)rect { NSSize iconSize = GSGetIconSize(); [tileCell drawWithFrame: NSMakeRect(0, 0, iconSize.width, iconSize.height) inView: self]; [imageCell drawWithFrame: NSMakeRect(iconSize.width / 8, (iconSize.height / 16), iconSize.width - ((iconSize.width / 8) * 2), iconSize.height - ((iconSize.height / 8) * 2)) inView: self]; [titleCell drawWithFrame: NSMakeRect(1, iconSize.height - 12, iconSize.width - 2, 11) inView: self]; } - (void) mouseDown: (NSEvent*)theEvent { if ([theEvent clickCount] >= 2) { NSWindow *w = [_window counterpart]; [w deminiaturize: self]; } else { NSPoint lastLocation; NSPoint location; NSUInteger eventMask = NSLeftMouseDownMask | NSLeftMouseUpMask | NSPeriodicMask | NSOtherMouseUpMask | NSRightMouseUpMask; NSDate *theDistantFuture = [NSDate distantFuture]; BOOL done = NO; lastLocation = [theEvent locationInWindow]; [NSEvent startPeriodicEventsAfterDelay: 0.02 withPeriod: 0.02]; while (!done) { theEvent = [NSApp nextEventMatchingMask: eventMask untilDate: theDistantFuture inMode: NSEventTrackingRunLoopMode dequeue: YES]; switch ([theEvent type]) { case NSRightMouseUp: case NSOtherMouseUp: case NSLeftMouseUp: /* right mouse up or left mouse up means we're done */ done = YES; break; case NSPeriodic: location = [_window mouseLocationOutsideOfEventStream]; if (NSEqualPoints(location, lastLocation) == NO) { NSPoint origin = [_window frame].origin; origin.x += (location.x - lastLocation.x); origin.y += (location.y - lastLocation.y); [_window setFrameOrigin: origin]; } break; default: break; } } [NSEvent stopPeriodicEvents]; } } - (void) setImage: (NSImage*)anImage { NSImage *imgCopy = [anImage copy]; [imgCopy setScalesWhenResized: YES]; [imgCopy setSize: scaledIconSizeForSize([imgCopy size])]; if (imageCell == nil) { imageCell = [[NSCell alloc] initImageCell: imgCopy]; [imageCell setBordered: NO]; } else { [imageCell setImage: imgCopy]; } RELEASE(imgCopy); [self setNeedsDisplay: YES]; } - (void) setTitle: (NSString*)aString { if (titleCell == nil) { titleCell = [[NSTextFieldCell alloc] initTextCell: aString]; [titleCell setSelectable: NO]; [titleCell setEditable: NO]; [titleCell setBordered: NO]; [titleCell setAlignment: NSCenterTextAlignment]; [titleCell setDrawsBackground: YES]; [titleCell setBackgroundColor: [NSColor blackColor]]; [titleCell setTextColor: [NSColor whiteColor]]; [titleCell setFont: [NSFont systemFontOfSize: 8]]; } else { [titleCell setStringValue: aString]; } [self setNeedsDisplay: YES]; } @end /***************************************************************************** * * NSWindow * *****************************************************************************/ /** NSWindow

Instances of the NSWindow class handle on-screen windows, their associated NSViews, and events generate by the user. An NSWindow's size is defined by its frame rectangle, which encompasses its entire structure, and its content rectangle, which includes only the content.

Every NSWindow has a content view, the NSView which forms the root of the window's view hierarchy. This view can be set using the setContentView: method, and accessed through the contentView method. setContentView: replaces the default content view created by NSWindow.

Other views may be added to the window by using the content view's addSubview: method. These subviews can also have subviews added, forming a tree structure, the view hierarchy. When an NSWindow must display itself, it causes this hierarchy to draw itself. Leaf nodes in the view hierarchy are drawn last, causing them to potentially obscure views further up in the hierarchy.

A delegate can be specified for an NSWindow, which will receive notifications of events pertaining to the window. The delegate is set using setDelegate:, and can be retrieved using delegate. The delegate can restrain resizing by implementing the windowWillResize: toSize: method, or control the closing of the window by implementing windowShouldClose:.

*/ @implementation NSWindow /* * Class variables */ static SEL ccSel; static SEL ctSel; static IMP ccImp; static IMP ctImp; static Class responderClass; static Class viewClass; static NSMutableSet *autosaveNames; static NSMapTable *windowmaps = NULL; static NSMapTable *windowUndoManagers = NULL; static NSNotificationCenter *nc = nil; /* * Class methods */ + (void) initialize { if (self == [NSWindow class]) { [self setVersion: 2]; ccSel = @selector(_checkCursorRectangles:forEvent:); ctSel = @selector(_checkTrackingRectangles:forEvent:); ccImp = [self instanceMethodForSelector: ccSel]; ctImp = [self instanceMethodForSelector: ctSel]; responderClass = [NSResponder class]; viewClass = [NSView class]; autosaveNames = [NSMutableSet new]; windowmaps = NSCreateMapTable(NSIntMapKeyCallBacks, NSNonRetainedObjectMapValueCallBacks, 20); nc = [NSNotificationCenter defaultCenter]; [self exposeBinding: NSTitleBinding]; } } + (void) removeFrameUsingName: (NSString*)name { if (name != nil) { NSString *key; key = [NSString stringWithFormat: @"NSWindow Frame %@", name]; [[NSUserDefaults standardUserDefaults] removeObjectForKey: key]; } } + (NSRect) contentRectForFrameRect: (NSRect)aRect styleMask: (NSUInteger)aStyle { if (!windowDecorator) windowDecorator = [GSWindowDecorationView windowDecorator]; return [windowDecorator contentRectForFrameRect: aRect styleMask: aStyle]; } + (NSRect) frameRectForContentRect: (NSRect)aRect styleMask: (NSUInteger)aStyle { if (!windowDecorator) windowDecorator = [GSWindowDecorationView windowDecorator]; return [windowDecorator frameRectForContentRect: aRect styleMask: aStyle]; } + (CGFloat) minFrameWidthWithTitle: (NSString *)aTitle styleMask: (NSUInteger)aStyle { if (!windowDecorator) windowDecorator = [GSWindowDecorationView windowDecorator]; return [windowDecorator minFrameWidthWithTitle: aTitle styleMask: aStyle]; } /* default Screen and window depth */ + (NSWindowDepth) defaultDepthLimit { return [[NSScreen deepestScreen] depth]; } + (void)menuChanged: (NSMenu*)aMenu { // FIXME: This method is for MS Windows only, does nothing // on other window systems } /* * Instance methods */ - (id) init { NSUInteger style; style = NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask; return [self initWithContentRect: NSZeroRect styleMask: style backing: NSBackingStoreBuffered defer: NO]; } /* It is important to make sure that the window is in a meaningful state after this has been called, and that the backend window can be recreated later, since one-shot windows may have their backend windows created and terminated many times. */ - (void) _terminateBackendWindow { if (_windowNum) { [_wv setWindowNumber: 0]; /* Check for context also as it might have disappeared before us */ if (_context && _gstate) { GSUndefineGState(_context, _gstate); _gstate = 0; } if (_context) { /* If there was a context, clear it and let it remove the window in that process. This indirection is needed so solve the circular references between the window and the context. But first undo the release call in _startBackendWindow. */ RETAIN(self); DESTROY(_context); } [GSServerForWindow(self) termwindow: _windowNum]; NSMapRemove(windowmaps, (void*)(intptr_t)_windowNum); _windowNum = 0; } } - (void) dealloc { // Remove all key value bindings for this object. [GSKeyValueBinding unbindAllForObject: self]; DESTROY(_toolbar); [nc removeObserver: self]; [[self class] _removeAutodisplayedWindow: self]; [NSApp removeWindowsItem: self]; [NSApp _windowWillDealloc: self]; NSAssert([NSApp keyWindow] != self, @"window being deallocated is key"); NSAssert([NSApp mainWindow] != self, @"window being deallocated is main"); if (windowUndoManagers != NULL) NSMapRemove(windowUndoManagers, self); if (_autosaveName != nil) { [autosaveNames removeObject: _autosaveName]; _autosaveName = nil; } if (_counterpart != 0 && (_styleMask & NSMiniWindowMask) == 0) { NSWindow *mini = [NSApp windowWithWindowNumber: _counterpart]; _counterpart = 0; DESTROY(mini); } /* Terminate backend window early so that the receiver is no longer returned from GSOrderedWindows() or GSAllWindows(). This helps to prevent crashes due to a race with some lame window managers under X that do not update the _NET_CLIENT_LIST_STACKING property quickly enough. GSOrderedWindows() may be called (indirectly) when a tooltip is visible while a window is deallocated. */ if (_windowNum) { [self _terminateBackendWindow]; } /* Clean references to this window - important if some of the views are not deallocated now */ [_wv _viewWillMoveToWindow: nil]; /* NB: releasing the window view does not necessarily result in the deallocation of the window's views ! - some of them might be retained for some other reason by the programmer or by other parts of the code */ DESTROY(_wv); DESTROY(_fieldEditor); DESTROY(_backgroundColor); DESTROY(_representedFilename); DESTROY(_miniaturizedTitle); DESTROY(_miniaturizedImage); DESTROY(_windowTitle); DESTROY(_rectsBeingDrawn); DESTROY(_initialFirstResponder); DESTROY(_defaultButtonCell); DESTROY(_cachedImage); DESTROY(_children); DESTROY(_lastLeftMouseDownView); DESTROY(_lastRightMouseDownView); DESTROY(_lastOtherMouseDownView); DESTROY(_lastDragView); DESTROY(_screen); /* * FIXME This should not be necessary - the views should have removed * their drag types, so we should already have been removed. */ [GSServerForWindow(self) removeDragTypes: nil fromWindow: self]; if (_delegate != nil) { [nc removeObserver: _delegate name: nil object: self]; _delegate = nil; } [super dealloc]; } - (NSString*) description { return [[super description] stringByAppendingFormat: @"Number: %d Title: %@", [self windowNumber], [self title]]; } - (void) _startBackendWindow { NSDictionary *info; NSMapInsert(windowmaps, (void*)(intptr_t)_windowNum, self); // Make sure not to create an autoreleased object, // as this will lead to problems when the window is deallocated. info = [[NSDictionary alloc] initWithObjects: &self forKeys: &NSGraphicsContextDestinationAttributeName count: 1]; _context = [[NSGraphicsContext alloc] initWithContextInfo: info]; RELEASE(info); if (_context) { // Now the context retains the window, release it once to make up RELEASE(self); } // Set window in new _gstate _gstate = GSDefineGState(_context); { NSRect frame = _frame; frame.origin = NSZeroPoint; [_wv setFrame: frame]; [_wv setWindowNumber: _windowNum]; [_wv setDocumentEdited: _f.is_edited]; [_wv setNeedsDisplay: YES]; } } - (void) _initBackendWindow { NSCountedSet *dragTypes; GSDisplayServer *srv = GSCurrentServer(); /* If we were deferred or one shot, our drag types may not have been registered properly in the backend. Remove them then re-add them when we create the window */ dragTypes = [srv dragTypesForWindow: self]; if (dragTypes) { // As this is the original entry, it will change soon. // We use a copy to reregister the same types later on. dragTypes = [dragTypes copy]; /* Now we need to remove all the drag types for this window. */ [srv removeDragTypes: nil fromWindow: self]; } _windowNum = [srv window: _frame : _backingType : _styleMask : [_screen screenNumber]]; if (_windowNum == 0) [NSException raise:@"No Window" format:@"Failed to obtain window from the back end"]; [srv setwindowlevel: [self level] : _windowNum]; if (_parent != nil) [srv setParentWindow: [_parent windowNumber] forChildWindow: _windowNum]; // Set up context [self _startBackendWindow]; /* Ok, now add the drag types back */ if (dragTypes) { id type; NSMutableArray *dragTypesArray = [NSMutableArray array]; NSEnumerator *enumerator = [dragTypes objectEnumerator]; NSDebugLLog(@"NSWindow", @"Resetting drag types for window"); /* Now we need to restore the drag types. */ /* Put all the drag types to the dragTypesArray - counted * with their multiplicity. */ while ((type = [enumerator nextObject]) != nil) { NSUInteger i, count = [dragTypes countForObject: type]; for (i = 0; i < count; i++) { [dragTypesArray addObject: type]; } } /* Now store the array. */ [srv addDragTypes: dragTypesArray toWindow: self]; // Free our local copy. RELEASE(dragTypes); } /* Other stuff we need to do for deferred windows */ if (!NSEqualSizes(_minimumSize, NSZeroSize)) [self setMinSize: _minimumSize]; if (!NSEqualSizes(_maximumSize, NSZeroSize)) [self setMaxSize: _maximumSize]; if (!NSEqualSizes(_increments, NSZeroSize)) [self setResizeIncrements: _increments]; NSDebugLLog(@"NSWindow", @"Created NSWindow window frame %@", NSStringFromRect(_frame)); } /* * Initializing and getting a new NSWindow object */ /**

Initializes the receiver with a content rect of contentRect, a style mask of styleMask, and a backing store type of backingType. This is the designated initializer.

The style mask values are NSTitledWindowMask, for a window with a title, NSClosableWindowMask, for a window with a close widget, NSMiniaturizableWindowMask, for a window with a miniaturize widget, and NSResizableWindowMask, for a window with a resizing widget. These mask values can be OR'd in any combination.

Backing store values are NSBackingStoreBuffered, NSBackingStoreRetained and NSBackingStoreNonretained.

*/ - (id) initWithContentRect: (NSRect)contentRect styleMask: (NSUInteger)aStyle backing: (NSBackingStoreType)bufferingType defer: (BOOL)flag { NSRect cframe; NSInterfaceStyle style = NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil); NSAssert(NSApp, @"The shared NSApplication instance must be created before windows " @"can be created."); NSDebugLLog(@"NSWindow", @"NSWindow start of init\n"); // FIXME: This hack is here to work around a gorm decoding problem. if (_windowNum) { NSLog(@"Window already initialized %d", (int)_windowNum); return self; } /* Initialize attributes and flags */ [super init]; [self _initDefaults]; _attachedSheet = nil; _backingType = bufferingType; _styleMask = aStyle; ASSIGN(_screen, [NSScreen mainScreen]); _depthLimit = [_screen depth]; _frame = [NSWindow frameRectForContentRect: contentRect styleMask: aStyle]; _minimumSize = NSMakeSize(_frame.size.width - contentRect.size.width + 1, _frame.size.height - contentRect.size.height + 1); _maximumSize = NSMakeSize (10e4, 10e4); [self setNextResponder: NSApp]; _f.cursor_rects_enabled = YES; _f.cursor_rects_valid = NO; /* Create the window view */ cframe.origin = NSZeroPoint; cframe.size = _frame.size; if (!windowDecorator) windowDecorator = [GSWindowDecorationView windowDecorator]; _wv = [windowDecorator newWindowDecorationViewWithFrame: cframe window: self]; [_wv _viewWillMoveToWindow: self]; [_wv setNextResponder: self]; /* Create the content view */ cframe.origin = NSZeroPoint; cframe.size = contentRect.size; [self setContentView: AUTORELEASE([[NSView alloc] initWithFrame: cframe])]; /* rectBeingDrawn is variable used to optimize flushing the backing store. It is set by NSGraphicsContext during a lockFocus to tell NSWindow what part a view is drawing in, so NSWindow only has to flush that portion */ _rectsBeingDrawn = RETAIN([NSMutableArray arrayWithCapacity: 10]); /* Create window (if not deferred) */ _windowNum = 0; _gstate = 0; if (flag == NO) { NSDebugLLog(@"NSWindow", @"Creating NSWindow\n"); [self _initBackendWindow]; } else NSDebugLLog(@"NSWindow", @"Deferring NSWindow creation\n"); [nc addObserver: self selector: @selector(colorListChanged:) name: NSColorListDidChangeNotification object: nil]; if (style == NSWindows95InterfaceStyle) { if([self canBecomeMainWindow]) { [self setMenu: [NSApp mainMenu]]; } } NSDebugLLog(@"NSWindow", @"NSWindow end of init\n"); return self; } /**

Initializes the receiver with a content rect of contentRect, a style mask of styleMask, a backing store type of backingType and a boolean flag. flag specifies whether the window should be created now (NO), or when it is displayed (YES).

The style mask values are NSTitledWindowMask, for a window with a title, NSClosableWindowMask, for a window with a close widget, NSMiniaturizableWindowMask, for a window with a miniaturize widget, and NSResizableWindowMask, for a window with a resizing widget. These mask values can be OR'd in any combination.

Backing store values are NSBackingStoreBuffered, NSBackingStoreRetained and NSBackingStoreNonretained.

*/ - (id) initWithContentRect: (NSRect)contentRect styleMask: (NSUInteger)aStyle backing: (NSBackingStoreType)bufferingType defer: (BOOL)flag screen: (NSScreen*)aScreen { self = [self initWithContentRect: contentRect styleMask: aStyle backing: bufferingType defer: flag]; if (self && aScreen != nil) { ASSIGN(_screen, aScreen); _depthLimit = [_screen depth]; } return self; } - (id) initWithWindowRef: (void *)windowRef { NSRect contentRect; unsigned int aStyle; NSBackingStoreType bufferingType; NSScreen* aScreen; int screen; NSInteger winNum; GSDisplayServer *srv = GSCurrentServer(); // Get the properties for the underlying window winNum = [srv nativeWindow: windowRef : &contentRect : &bufferingType : &aStyle : &screen]; // Get the screen for the right screen number. aScreen = [[NSScreen alloc] _initWithScreenNumber: screen]; // Set up a NSWindow with the same properties self = [self initWithContentRect: contentRect styleMask: aStyle backing: bufferingType defer: YES screen: aScreen]; RELEASE(aScreen); // Fake the initialisation of the backend _windowNum = winNum; // Set up context [self _startBackendWindow]; return self; } -(void) colorListChanged:(NSNotification*)notif { if ([[notif object] isEqual: [NSColorList colorListNamed:@"System"]]) { [_wv setNeedsDisplay:YES]; } } - (NSRect) contentRectForFrameRect: (NSRect)frameRect { return [_wv contentRectForFrameRect: frameRect styleMask: _styleMask]; } - (NSRect) frameRectForContentRect: (NSRect)contentRect { return [_wv frameRectForContentRect: contentRect styleMask: _styleMask]; } /* * Accessing the content view */ - (id) contentView { return _contentView; } /** Sets the window's content view to aView, replacing any previous content view. */ - (void) setContentView: (NSView*)aView { if (aView == _contentView) return; if (_contentView != nil) { [_contentView removeFromSuperview]; } _contentView = aView; if (_contentView != nil) { [_wv setContentView: _contentView]; } } /* * Window graphics */ - (NSColor*) backgroundColor { return _backgroundColor; } - (NSString*) representedFilename { return _representedFilename; } - (void) setBackgroundColor: (NSColor*)color { ASSIGN(_backgroundColor, color); [_wv setBackgroundColor: color]; } - (void) setRepresentedFilename: (NSString*)aString { ASSIGN(_representedFilename, aString); } /** Sets the window's title to the string aString. */ - (void) setTitle: (NSString*)aString { if ([_windowTitle isEqual: aString] == NO) { ASSIGNCOPY(_windowTitle, aString); [self setMiniwindowTitle: _windowTitle]; [_wv setTitle: _windowTitle]; if (_f.menu_exclude == NO && _f.has_opened == YES) { [NSApp changeWindowsItem: self title: _windowTitle filename: NO]; } } } static NSString * titleWithRepresentedFilename(NSString *representedFilename) { return [NSString stringWithFormat: @"%@ -- %@", [representedFilename lastPathComponent], [[representedFilename stringByDeletingLastPathComponent] stringByAbbreviatingWithTildeInPath]]; } - (BOOL) _hasTitleWithRepresentedFilename { NSString *aString = titleWithRepresentedFilename (_representedFilename); return [_windowTitle isEqualToString: aString]; } - (void) setTitleWithRepresentedFilename: (NSString*)aString { [self setRepresentedFilename: aString]; aString = titleWithRepresentedFilename(aString); if ([_windowTitle isEqual: aString] == NO) { ASSIGNCOPY(_windowTitle, aString); [self setMiniwindowTitle: _windowTitle]; [_wv setTitle: _windowTitle]; if (_f.menu_exclude == NO && _f.has_opened == YES) { [NSApp changeWindowsItem: self title: _windowTitle filename: YES]; } } } - (NSUInteger) styleMask { return _styleMask; } /** Returns an NSString containing the text of the window's title. */ - (NSString*) title { return _windowTitle; } - (void) setHasShadow: (BOOL)hasShadow { _f.has_shadow = hasShadow; if (_windowNum) { [GSServerForWindow(self) setShadow: hasShadow : _windowNum]; } } - (BOOL) hasShadow { return _f.has_shadow; } - (void) invalidateShadow { // FIXME } - (void) setAlphaValue: (CGFloat)windowAlpha { _alphaValue = windowAlpha; if (_windowNum) { [GSServerForWindow(self) setalpha: _alphaValue : _windowNum]; } } - (CGFloat) alphaValue { return _alphaValue; } - (void) setOpaque: (BOOL)isOpaque { // FIXME _f.is_opaque = isOpaque; } - (BOOL) isOpaque { return _f.is_opaque; } /* * Window device attributes */ - (NSBackingStoreType) backingType { return _backingType; } - (NSDictionary*) deviceDescription { return [[self screen] deviceDescription]; } - (NSGraphicsContext*) graphicsContext { return _context; } - (CGFloat) userSpaceScaleFactor { if (_styleMask & NSUnscaledWindowMask) { return 1.0; } else { return [_screen userSpaceScaleFactor]; } } - (NSInteger) gState { if (_gstate <= 0) NSDebugLLog(@"NSWindow", @"gState called on deferred window"); return _gstate; } - (BOOL) isOneShot { return _f.is_one_shot; } - (void) setBackingType: (NSBackingStoreType)type { _backingType = type; } - (void) setOneShot: (BOOL)flag { _f.is_one_shot = flag; } - (NSInteger) windowNumber { if (_windowNum <= 0) NSDebugLLog(@"NSWindow", @"windowNumber called on deferred window"); return _windowNum; } /* * The miniwindow */ - (NSImage*) miniwindowImage { return _miniaturizedImage; } - (NSString*) miniwindowTitle { return _miniaturizedTitle; } - (void) setMiniwindowImage: (NSImage*)image { ASSIGN(_miniaturizedImage, image); if (_counterpart != 0 && (_styleMask & NSMiniWindowMask) == 0) { NSMiniWindow *mini; id v; mini = (NSMiniWindow*)[NSApp windowWithWindowNumber: _counterpart]; v = [mini contentView]; if ([v respondsToSelector: @selector(setImage:)]) { [v setImage: [self miniwindowImage]]; } } } - (void) setMiniwindowTitle: (NSString*)title { ASSIGN(_miniaturizedTitle, title); if (_counterpart != 0 && (_styleMask & NSMiniWindowMask) == 0) { NSMiniWindow *mini; id v; mini = (NSMiniWindow*)[NSApp windowWithWindowNumber: _counterpart]; v = [mini contentView]; if ([v respondsToSelector: @selector(setTitle:)]) { [v setTitle: [self miniwindowTitle]]; } } } - (NSWindow*) counterpart { if (_counterpart == 0) return nil; return [NSApp windowWithWindowNumber: _counterpart]; } /* * The field editor */ - (void) endEditingFor: (id)anObject { NSText *t = [self fieldEditor: NO forObject: anObject]; if (t && (_firstResponder == t)) { // Change first responder first to avoid recusion. _firstResponder = self; [_firstResponder becomeFirstResponder]; [nc postNotificationName: NSTextDidEndEditingNotification object: t]; [t setText: @""]; [t setDelegate: nil]; [t removeFromSuperview]; } } - (NSText*) fieldEditor: (BOOL)createFlag forObject: (id)anObject { /* ask delegate if it can provide a field editor */ if ((_delegate != anObject) && [_delegate respondsToSelector: @selector(windowWillReturnFieldEditor:toObject:)]) { NSText *editor; editor = [_delegate windowWillReturnFieldEditor: self toObject: anObject]; if (editor != nil) { return editor; } } /* * Each window has a global text field editor, if it doesn't exist create it * if create flag is set */ if (!_fieldEditor && createFlag) { _fieldEditor = [NSText new]; [_fieldEditor setFieldEditor: YES]; } return _fieldEditor; } /* * Window controller */ - (void) setWindowController: (NSWindowController*)windowController { /* The window controller owns us, we only keep a weak reference to it */ _windowController = windowController; } - (id) windowController { return _windowController; } /* * Window status and ordering */ - (void) becomeKeyWindow { if (_f.is_key == NO) { _f.is_key = YES; if ((!_firstResponder) || (_firstResponder == self)) { if (!_initialFirstResponder) { [self recalculateKeyViewLoop]; } if (_initialFirstResponder) { [self makeFirstResponder: _initialFirstResponder]; } } [_firstResponder becomeFirstResponder]; if ((_firstResponder != self) && [_firstResponder respondsToSelector: @selector(becomeKeyWindow)]) { [_firstResponder becomeKeyWindow]; } [_wv setInputState: GSTitleBarKey]; [GSServerForWindow(self) setinputfocus: _windowNum]; [self resetCursorRects]; [nc postNotificationName: NSWindowDidBecomeKeyNotification object: self]; NSDebugLLog(@"NSWindow", @"%@ is now key window", [self title]); } } - (void) becomeMainWindow { if (_f.is_main == NO) { _f.is_main = YES; if (_f.is_key == NO) { [_wv setInputState: GSTitleBarMain]; } [nc postNotificationName: NSWindowDidBecomeMainNotification object: self]; NSDebugLLog(@"NSWindow", @"%@ is now main window", [self title]); } } /** Returns YES if the receiver can be made key. If this method returns NO, the window will not be made key. This implementation returns YES if the window is resizable or has a title bar. You can override this method to change it's behavior */ - (BOOL) canBecomeKeyWindow { if ((NSResizableWindowMask | NSTitledWindowMask) & _styleMask) return YES; else return NO; } /** Returns YES if the receiver can be the main window. If this method returns NO, the window will not become the main window. This implementation returns YES if the window is resizable or has a title bar and is visible and is not an NSPanel. You can override this method to change it's behavior */ - (BOOL) canBecomeMainWindow { if (!_f.visible) return NO; if ((NSResizableWindowMask | NSTitledWindowMask) & _styleMask) return YES; else return NO; } - (BOOL) hidesOnDeactivate { return _f.hides_on_deactivate; } - (void) setCanHide: (BOOL)flag { _f.can_hide = flag; } - (BOOL) canHide { return _f.can_hide; } - (BOOL) isKeyWindow { return _f.is_key; } - (BOOL) isMainWindow { return _f.is_main; } - (BOOL) isMiniaturized { return _f.is_miniaturized; } - (BOOL) isVisible { return _f.visible; } - (NSInteger) level { return _windowLevel; } - (void) makeKeyAndOrderFront: (id)sender { [self deminiaturize: self]; /* * If a window is ordered in, make sure that the application isn't hidden, * and is active. */ if ([self canBecomeKeyWindow]) [NSApp unhide: self]; [self orderFrontRegardless]; [self makeKeyWindow]; /* * OPENSTEP makes a window the main window when it makes it the key window. * So we do the same (though the documentation doesn't mention it). */ [self makeMainWindow]; } - (void) makeKeyWindow { if (!_f.visible || _f.is_miniaturized || _f.is_key == YES) { return; } if (![self canBecomeKeyWindow]) return; [[NSApp keyWindow] resignKeyWindow]; [self becomeKeyWindow]; } - (void) makeMainWindow { if (!_f.visible || _f.is_miniaturized || _f.is_main == YES) { return; } if (![self canBecomeMainWindow]) return; [[NSApp mainWindow] resignMainWindow]; [self becomeMainWindow]; } /** * Orders the window to the back of its level. Equivalent to * -orderWindow:relativeTo: with arguments NSWindowBelow and 0. */ - (void) orderBack: (id)sender { [self orderWindow: NSWindowBelow relativeTo: 0]; } /** * If the application is active, orders the window to the front in its * level. If the application is not active, the window is ordered in as * far forward as possible in its level without being ordered in front * of the key or main window of the currently active app. The current key * and main window status is not changed. Equivalent to * -orderWindow:relativeTo: with arguments NSWindowAbove and 0. */ - (void) orderFront: (id)sender { [self orderWindow: NSWindowAbove relativeTo: 0]; } /** Orders the window to the front in its level (even in front of the key and main windows of the current app) regardless of whether the app is current or not. This method should only be used in rare cases where the app is cooperating with another app that is displaying data for it. The current key and main window status is not changed. */ - (void) orderFrontRegardless { [self orderWindow: NSWindowAbove relativeTo: -1]; } /** * Orders the window out from the screen. Equivalent to * -orderWindow:relativeTo: with arguments NSWindowOut and 0. */ - (void) orderOut: (id)sender { [self orderWindow: NSWindowOut relativeTo: 0]; } /**

If place is NSWindowOut, removes the window from the screen. If place is NSWindowAbove, places the window directly above otherWin, or directly above all windows in its level if otherWin is 0. If place is NSWindowBelow, places the window directly below otherWin, or directly below all windows in its level if otherWin is 0.

If otherWin is zero and the key window is at the same window level as the receiver, the receiver cannot be positioned above the key window.

If place is NSWindowAbove or NSWindowBelow and the application is hidden, the application is unhidden.

*/ /* As a special undocumented case (for -orderFrontRegardless), if otherWin is minus one, then the backend should not try to keep the window below the current key/main window */ - (void) orderWindow: (NSWindowOrderingMode)place relativeTo: (NSInteger)otherWin { GSDisplayServer *srv = GSServerForWindow(self); BOOL display = NO; if (YES == [[NSUserDefaults standardUserDefaults] boolForKey: @"GSBackgroundApp"]) { return; } if (place == NSWindowOut) { if (_windowNum == 0) { return; /* This deferred window was never ordered in. */ } _f.visible = NO; /* * Don't keep trying to update the window while it is ordered out */ [[self class] _removeAutodisplayedWindow: self]; [self _lossOfKeyOrMainWindow]; } else { /* Windows need to be constrained when displayed or resized - but only titled windows are constrained. Also, and this is the tricky part, don't constrain if we are merely unhiding the window or if it's already visible and is just being reordered. */ if ((_styleMask & NSTitledWindowMask) && [NSApp isHidden] == NO && _f.visible == NO) { NSRect nframe = [self constrainFrameRect: _frame toScreen: [self screen]]; [self setFrame: nframe display: NO]; } // create deferred window if (_windowNum == 0) { [self _initBackendWindow]; display = YES; } } /* If a hide on deactivate window is explicitly ordered in or out while the application is not active, remove it from the list of inactive windows. */ if ([self hidesOnDeactivate] && ![NSApp isActive]) { [NSApp _setWindow: self inactive: NO]; } // Draw content before backend window ordering if (display) [_wv display]; else if (place != NSWindowOut) [_wv displayIfNeeded]; /* The backend will keep us below the current key window unless we force it not too */ if ((otherWin == 0 || otherWin == [[NSApp keyWindow] windowNumber] || otherWin == [[NSApp mainWindow] windowNumber]) && [NSApp isActive]) otherWin = -1; [srv orderwindow: place : otherWin : _windowNum]; if (display) [self display]; if (place != NSWindowOut) { /* * Once we are ordered back in, we will want to update the window * whenever there is anything to do. */ [[self class] _addAutodisplayedWindow: self]; if (_f.has_closed == YES) { _f.has_closed = NO; /* A closed window has re-opened */ } if (_f.has_opened == NO) { _f.has_opened = YES; if (_f.menu_exclude == NO) { [NSApp addWindowsItem: self title: _windowTitle filename: [self _hasTitleWithRepresentedFilename]]; } } if ([self isKeyWindow] == YES) { [_wv setInputState: GSTitleBarKey]; [srv setinputfocus: _windowNum]; } _f.visible = YES; } else if ([self isOneShot]) { [self _terminateBackendWindow]; } } - (void) resignKeyWindow { if (_f.is_key == YES) { if ((_firstResponder != self) && [_firstResponder respondsToSelector: @selector(resignKeyWindow)]) [_firstResponder resignKeyWindow]; _f.is_key = NO; if (_f.is_main == YES) { [_wv setInputState: GSTitleBarMain]; } else { [_wv setInputState: GSTitleBarNormal]; } [self discardCursorRects]; [nc postNotificationName: NSWindowDidResignKeyNotification object: self]; } } - (void) resignMainWindow { if (_f.is_main == YES) { _f.is_main = NO; if (_f.is_key == YES) { [_wv setInputState: GSTitleBarKey]; } else { [_wv setInputState: GSTitleBarNormal]; } [nc postNotificationName: NSWindowDidResignMainNotification object: self]; } } - (void) setHidesOnDeactivate: (BOOL)flag { if (flag != _f.hides_on_deactivate) { _f.hides_on_deactivate = flag; if (![NSApp isActive]) { if (flag) { if (_f.visible) { /* Order is important here. We must first order out the window and then add it to the inactive list, since -orderOut: removes the receiver from the inactive list. */ [self orderOut: nil]; [NSApp _setWindow: self inactive: YES]; } } else { if ([NSApp _isWindowInactive: self]) { [NSApp _setWindow: self inactive: NO]; [self orderFront: nil]; } } } } } - (void) setLevel: (NSInteger)newLevel { if (_windowLevel != newLevel) { _windowLevel = newLevel; if (_windowNum > 0) { GSDisplayServer *srv = GSServerForWindow(self); [srv setwindowlevel: _windowLevel : _windowNum]; } } } - (NSPoint) cascadeTopLeftFromPoint: (NSPoint)topLeftPoint { NSRect cRect; if (NSEqualPoints(topLeftPoint, NSZeroPoint) == YES) { topLeftPoint.x = NSMinX(_frame); topLeftPoint.y = NSMaxY(_frame); } [self setFrameTopLeftPoint: topLeftPoint]; cRect = [self contentRectForFrameRect: _frame]; topLeftPoint.x = NSMinX(cRect); topLeftPoint.y = NSMaxY(cRect); /* make sure the new point is inside the screen */ if ([self screen]) { NSRect screenRect; screenRect = [[self screen] visibleFrame]; if (topLeftPoint.x >= NSMaxX(screenRect)) { topLeftPoint.x = NSMinX(screenRect); } if (topLeftPoint.y <= NSMinY(screenRect)) { topLeftPoint.y = NSMaxY(screenRect); } } return topLeftPoint; } - (BOOL) showsResizeIndicator { // TODO NSLog(@"Method %s is not implemented for class %s", "showsResizeIndicator", "NSWindow"); return YES; } - (void) setShowsResizeIndicator: (BOOL)show { // TODO NSLog(@"Method %s is not implemented for class %s", "setShowsResizeIndicator:", "NSWindow"); } - (BOOL) preservesContentDuringLiveResize { return _f.preserves_content_during_live_resize; } - (void) setPreservesContentDuringLiveResize: (BOOL)flag { _f.preserves_content_during_live_resize = flag; } - (void) setFrame: (NSRect)frameRect display: (BOOL)displayFlag animate: (BOOL)animationFlag { if (animationFlag && !NSEqualRects(_frame, frameRect)) { // time that the resize is expected to take in seconds NSTimeInterval resizeTime; NSArray *animations; NSViewAnimation *viewAnimation; resizeTime = [self animationResizeTime: frameRect]; animations = [NSArray arrayWithObject: [NSDictionary dictionaryWithObjectsAndKeys: self, NSViewAnimationTargetKey, [NSValue valueWithRect: frameRect], NSViewAnimationEndFrameKey, nil]]; viewAnimation = [[NSViewAnimation alloc] initWithViewAnimations: animations]; [viewAnimation setAnimationBlockingMode: NSAnimationNonblocking]; [viewAnimation setDuration: resizeTime]; if (animationDelegate == nil) { animationDelegate = [[GSWindowAnimationDelegate alloc] init]; } // The delegate handles the release of the viewAnimation [viewAnimation setDelegate: animationDelegate]; [viewAnimation startAnimation]; //AUTORELEASE(viewAnimation); } else { [self setFrame: frameRect display: displayFlag]; } } - (NSTimeInterval) animationResizeTime: (NSRect)newFrame { static float resizeTime = 0; float maxDiff; if (resizeTime == 0) { NSNumber *num; num = [[NSUserDefaults standardUserDefaults] objectForKey: @"NSWindowResizeTime"]; if (num != nil) { resizeTime = [num floatValue]; } else { resizeTime = 0.20; } } // Find the biggest difference maxDiff = abs(newFrame.origin.x - _frame.origin.x); maxDiff = MAX(maxDiff, abs(newFrame.origin.y - _frame.origin.y)); maxDiff = MAX(maxDiff, abs(newFrame.size.width - _frame.size.width)); maxDiff = MAX(maxDiff, abs(newFrame.size.height - _frame.size.height)); return (maxDiff * resizeTime) / 150; } - (void) center { NSScreen *screen = [self screen]; NSSize screenSize; NSPoint origin = _frame.origin; if (screen == nil) { screen = [NSScreen mainScreen]; } screenSize = [screen visibleFrame].size; origin.x = (screenSize.width - _frame.size.width) / 2; origin.y = (screenSize.height - _frame.size.height) / 2; [self setFrameOrigin: origin]; } /** * Given a proposed frame rectangle, return a modified version * which will fit inside the screen. */ - (NSRect) constrainFrameRect: (NSRect)frameRect toScreen: (NSScreen*)screen { NSRect screenRect = [screen visibleFrame]; CGFloat difference; /* Move top edge of the window inside the screen */ difference = NSMaxY (frameRect) - NSMaxY (screenRect); if (difference > 0) { frameRect.origin.y -= difference; } /* If the window is resizable, resize it (if needed) so that the bottom edge is on the screen or can be on the screen when the user moves the window */ difference = NSMaxY (screenRect) - NSMaxY (frameRect); if (_styleMask & NSResizableWindowMask) { float difference2; difference2 = screenRect.origin.y - frameRect.origin.y; difference2 -= difference; // Take in account the space between the top of window and the top of the // screen which can be used to move the bottom of the window on the screen if (difference2 > 0) { frameRect.size.height -= difference2; frameRect.origin.y += difference2; } /* Ensure that resizing doesn't makewindow smaller than minimum */ difference2 = _minimumSize.height - frameRect.size.height; if (difference2 > 0) { frameRect.size.height += difference2; frameRect.origin.y -= difference2; } } return frameRect; } - (NSRect) frame { return _frame; } - (NSSize) minSize { return _minimumSize; } - (NSSize) maxSize { return _maximumSize; } - (void) setContentSize: (NSSize)aSize { NSRect r = _frame; r.size = aSize; r = [self frameRectForContentRect: r]; r.origin = _frame.origin; [self setFrame: r display: YES]; } - (void) setFrame: (NSRect)frameRect display: (BOOL)flag { if (_maximumSize.width > 0 && frameRect.size.width > _maximumSize.width) { frameRect.size.width = _maximumSize.width; } if (_maximumSize.height > 0 && frameRect.size.height > _maximumSize.height) { frameRect.size.height = _maximumSize.height; } if (frameRect.size.width < _minimumSize.width) { frameRect.size.width = _minimumSize.width; } if (frameRect.size.height < _minimumSize.height) { frameRect.size.height = _minimumSize.height; } /* Windows need to be constrained when displayed or resized - but only titled windows are constrained */ if (_styleMask & NSTitledWindowMask) { frameRect = [self constrainFrameRect: frameRect toScreen: [self screen]]; } // If nothing changes, don't send it to the backend and don't redisplay if (NSEqualRects(_frame, frameRect)) return; if (NSEqualPoints(_frame.origin, frameRect.origin) == NO) [nc postNotificationName: NSWindowWillMoveNotification object: self]; /* * Now we can tell the graphics context to do the actual resizing. * We will recieve an event to tell us when the resize is done. */ if (_windowNum) [GSServerForWindow(self) placewindow: frameRect : _windowNum]; else { _frame = frameRect; frameRect.origin = NSZeroPoint; [_wv setFrame: frameRect]; } if (flag) [self display]; } - (void) setFrameOrigin: (NSPoint)aPoint { NSRect r = _frame; r.origin = aPoint; [self setFrame: r display: NO]; } - (void) setFrameTopLeftPoint: (NSPoint)aPoint { NSRect r = _frame; r.origin = aPoint; r.origin.y -= _frame.size.height; [self setFrame: r display: NO]; } - (void) setMinSize: (NSSize)aSize { if (aSize.width < 1) aSize.width = 1; if (aSize.height < 1) aSize.height = 1; _minimumSize = aSize; if (_windowNum > 0) [GSServerForWindow(self) setminsize: aSize : _windowNum]; } - (void) setMaxSize: (NSSize)aSize { /* * Documented maximum size for macOS-X - do we need this restriction? */ if (aSize.width > 10000) aSize.width = 10000; if (aSize.height > 10000) aSize.height = 10000; _maximumSize = aSize; if (_windowNum > 0) [GSServerForWindow(self) setmaxsize: aSize : _windowNum]; } - (NSSize) resizeIncrements { return _increments; } - (void) setResizeIncrements: (NSSize)aSize { _increments = aSize; if (_windowNum > 0) [GSServerForWindow(self) setresizeincrements: aSize : _windowNum]; } - (NSSize) aspectRatio { // FIXME: This method is missing return NSMakeSize(1, 1); } - (void) setAspectRatio: (NSSize)ratio { // FIXME: This method is missing } - (NSSize) contentMaxSize { // FIXME NSRect rect; rect.origin = NSMakePoint(0, 0); rect.size = [self maxSize]; rect = [self contentRectForFrameRect: rect]; return rect.size; } - (void) setContentMaxSize: (NSSize)size { // FIXME NSRect rect; rect.origin = NSMakePoint(0, 0); rect.size = size; rect = [self frameRectForContentRect: rect]; [self setMaxSize: rect.size]; } - (NSSize) contentMinSize { // FIXME NSRect rect; rect.origin = NSMakePoint(0, 0); rect.size = [self minSize]; rect = [self contentRectForFrameRect: rect]; return rect.size; } - (void) setContentMinSize: (NSSize)size { // FIXME NSRect rect; rect.origin = NSMakePoint(0, 0); rect.size = size; rect = [self frameRectForContentRect: rect]; [self setMinSize: rect.size]; } - (NSSize) contentAspectRatio { // FIXME return NSMakeSize(1, 1); } - (void) setContentAspectRatio: (NSSize)ratio { // FIXME } - (NSSize) contentResizeIncrements { // FIXME return [self resizeIncrements]; } - (void) setContentResizeIncrements: (NSSize)increments { // FIXME [self setResizeIncrements: increments]; } /** * Convert from a point in the base coordinate system for the window * to a point in the screen coordinate system. */ - (NSPoint) convertBaseToScreen: (NSPoint)aPoint { NSPoint screenPoint; screenPoint.x = _frame.origin.x + aPoint.x; screenPoint.y = _frame.origin.y + aPoint.y; return screenPoint; } /** * Convert from a point in the screen coordinate system to a point in the * screen coordinate system of the receiver. */ - (NSPoint) convertScreenToBase: (NSPoint)aPoint { NSPoint basePoint; basePoint.x = aPoint.x - _frame.origin.x; basePoint.y = aPoint.y - _frame.origin.y; return basePoint; } /** * Converts aRect from the coordinate system of the screen * to the coordinate system of the window. */ - (NSRect) convertRectFromScreen: (NSRect)aRect { NSRect result = aRect; NSPoint origin = result.origin; NSPoint newOrigin = [self convertScreenToBase: origin]; result.origin = newOrigin; return result; } /** * Converts aRect from the window coordinate system to a rect in * the screen coordinate system. */ - (NSRect) convertRectToScreen: (NSRect)aRect { NSRect result = aRect; NSPoint origin = result.origin; NSPoint newOrigin = [self convertBaseToScreen: origin]; result.origin = newOrigin; return result; } /* * Managing the display */ - (void) disableFlushWindow { _disableFlushWindow++; } - (void) display { if (_gstate == 0 || _f.visible == NO) return; [_wv display]; [self discardCachedImage]; _f.views_need_display = NO; } - (void) displayIfNeeded { if (_gstate == 0 || _f.visible == NO) return; if (_f.views_need_display) { [_wv displayIfNeeded]; [self discardCachedImage]; _f.views_need_display = NO; } } - (void) update { [nc postNotificationName: NSWindowDidUpdateNotification object: self]; } - (void) flushWindowIfNeeded { if (_disableFlushWindow == 0 && _f.needs_flush == YES) { [self flushWindow]; } } /** * Flush all drawing in the windows buffer to the screen unless the window * is not buffered or flushing is not enabled. */ - (void) flushWindow { NSUInteger i; /* * If flushWindow is called while flush is disabled * mark self as needing a flush, then return */ if (_disableFlushWindow) { _f.needs_flush = YES; return; } /* * Just flush graphics if backing is not buffered. * The documentation actually says that this is wrong ... the method * should do nothing when the backingType is NSBackingStoreNonretained */ if (_backingType == NSBackingStoreNonretained) { [_context flushGraphics]; return; } /* Check for special case of flushing while we are lock focused. For instance, when we are highlighting a button. */ if (NSIsEmptyRect(_rectNeedingFlush)) { if ([_rectsBeingDrawn count] == 0) { _f.needs_flush = NO; return; } } /* * Accumulate the rectangles from all nested focus locks. */ i = [_rectsBeingDrawn count]; while (i-- > 0) { _rectNeedingFlush = NSUnionRect(_rectNeedingFlush, [[_rectsBeingDrawn objectAtIndex: i] rectValue]); } if (_windowNum > 0) { [GSServerForWindow(self) flushwindowrect: _rectNeedingFlush : _windowNum]; } _f.needs_flush = NO; _rectNeedingFlush = NSZeroRect; } - (void) enableFlushWindow { if (_disableFlushWindow > 0) { _disableFlushWindow--; } } - (BOOL) isAutodisplay { return _f.is_autodisplay; } - (BOOL) isFlushWindowDisabled { return _disableFlushWindow == 0 ? NO : YES; } - (void) setAutodisplay: (BOOL)flag { _f.is_autodisplay = flag; } - (void) setViewsNeedDisplay: (BOOL)flag { if (_f.views_need_display != flag) { _f.views_need_display = flag; if (flag) { /* TODO: this call most likely shouldn't be here */ [NSApp setWindowsNeedUpdate: YES]; } } } - (BOOL) viewsNeedDisplay { return _f.views_need_display; } - (void) cacheImageInRect: (NSRect)aRect { NSView *cacheView; NSRect cacheRect; aRect = NSIntegralRect (NSIntersectionRect (aRect, [_wv frame])); _cachedImageOrigin = aRect.origin; DESTROY(_cachedImage); if (NSIsEmptyRect (aRect)) { return; } cacheRect.origin = NSZeroPoint; cacheRect.size = aRect.size; _cachedImage = [[NSCachedImageRep alloc] initWithWindow: nil rect: cacheRect]; cacheView = [[_cachedImage window] contentView]; [cacheView lockFocus]; NSCopyBits (_gstate, aRect, NSZeroPoint); [cacheView unlockFocus]; } - (void) discardCachedImage { DESTROY(_cachedImage); } - (void) restoreCachedImage { if (_cachedImage == nil) { return; } [_wv lockFocus]; NSCopyBits ([[_cachedImage window] gState], [_cachedImage rect], _cachedImageOrigin); [_wv unlockFocus]; } - (void) useOptimizedDrawing: (BOOL)flag { _f.optimize_drawing = flag; } - (BOOL) canStoreColor { if (NSNumberOfColorComponents(NSColorSpaceFromDepth(_depthLimit)) > 1) { return YES; } else { return NO; } } /** Returns the screen the window is on. Unlike (apparently) OpenStep and MacOSX, GNUstep does not support windows being split across multiple screens */ - (NSScreen *) deepestScreen { return [self screen]; } - (NSWindowDepth) depthLimit { return _depthLimit; } - (BOOL) hasDynamicDepthLimit { return _f.dynamic_depth_limit; } /** Returns the screen the window is on. */ - (NSScreen *) screen { // Only recompute the screen if the current screen // doesn't contain the whole window. // FIXME: Containing half the window would be enough if (_screen != nil) { NSRect sframe = [_screen frame]; if (NSContainsRect(sframe, _frame)) { return _screen; } } ASSIGN(_screen, [self _screenForFrame: _frame]); return _screen; } - (void) setDepthLimit: (NSWindowDepth)limit { if (limit == 0) { limit = [[self class] defaultDepthLimit]; } _depthLimit = limit; } - (void) setDynamicDepthLimit: (BOOL)flag { _f.dynamic_depth_limit = flag; } /* * Cursor management */ - (BOOL) areCursorRectsEnabled { return _f.cursor_rects_enabled; } - (void) disableCursorRects { _f.cursor_rects_enabled = NO; } static void discardCursorRectsForView(NSView *theView) { if (theView != nil) { if (theView->_rFlags.has_currects) { [theView discardCursorRects]; } if (theView->_rFlags.has_subviews) { NSArray *s = theView->_sub_views; NSUInteger count = [s count]; if (count) { NSView *subs[count]; NSUInteger i; [s getObjects: subs]; for (i = 0; i < count; i++) { discardCursorRectsForView(subs[i]); } } } } } - (void) discardCursorRects { discardCursorRectsForView(_wv); } - (void) enableCursorRects { _f.cursor_rects_enabled = YES; } - (void) invalidateCursorRectsForView: (NSView*)aView { if (aView->_rFlags.valid_rects) { [aView discardCursorRects]; if (_f.cursor_rects_valid) { if (_f.is_key && _f.cursor_rects_enabled) { NSEvent *e = [NSEvent otherEventWithType: NSAppKitDefined location: NSMakePoint(-1, -1) modifierFlags: 0 timestamp: 0 windowNumber: _windowNum context: GSCurrentContext() subtype: -1 data1: 0 data2: 0]; [self postEvent: e atStart: YES]; } _f.cursor_rects_valid = NO; } } } static void resetCursorRectsForView(NSView *theView) { if (theView != nil) { [theView resetCursorRects]; if (theView->_rFlags.has_subviews) { NSArray *s = theView->_sub_views; NSUInteger count = [s count]; if (count) { NSView *subs[count]; NSUInteger i; [s getObjects: subs]; for (i = 0; i < count; i++) { resetCursorRectsForView(subs[i]); } } } } } static void checkCursorRectanglesEntered(NSView *theView, NSEvent *theEvent, NSPoint lastPoint) { /* * Check cursor rectangles for the subviews */ if (theView->_rFlags.has_subviews) { NSArray *sb = theView->_sub_views; NSUInteger count = [sb count]; if (count > 0) { NSView *subs[count]; NSUInteger i; [sb getObjects: subs]; for (i = 0; i < count; ++i) { if (![subs[i] isHidden]) { checkCursorRectanglesEntered(subs[i], theEvent, lastPoint); } } } } if (theView->_rFlags.valid_rects) { NSArray *tr = theView->_cursor_rects; NSUInteger count = [tr count]; // Loop through cursor rectangles if (count > 0) { GSTrackingRect *rects[count]; NSPoint loc = [theEvent locationInWindow]; NSUInteger i; [tr getObjects: rects]; for (i = 0; i < count; ++i) { GSTrackingRect *r = rects[i]; BOOL last; BOOL now; if ([r isValid] == NO) continue; /* * Check for presence of point in rectangle. */ last = NSMouseInRect(lastPoint, r->rectangle, NO); now = NSMouseInRect(loc, r->rectangle, NO); // Mouse entered if ((!last) && (now)) { NSEvent *e; 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]; [NSApp postEvent: e atStart: YES]; //NSLog(@"Add enter event %@ for view %@ rect %@", e, theView, NSStringFromRect(r->rectangle)); } } } } } static void checkCursorRectanglesExited(NSView *theView, NSEvent *theEvent, NSPoint lastPoint) { if (theView->_rFlags.valid_rects) { NSArray *tr = theView->_cursor_rects; NSUInteger count = [tr count]; // Loop through cursor rectangles if (count > 0) { GSTrackingRect *rects[count]; NSPoint loc = [theEvent locationInWindow]; NSUInteger i; [tr getObjects: rects]; for (i = 0; i < count; ++i) { GSTrackingRect *r = rects[i]; BOOL last; BOOL now; if ([r isValid] == NO) continue; /* * Check for presence of point in rectangle. */ last = NSMouseInRect(lastPoint, r->rectangle, NO); now = NSMouseInRect(loc, r->rectangle, NO); // Mouse exited if ((last) && (!now)) { NSEvent *e; 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]; [NSApp postEvent: e atStart: YES]; //[NSApp postEvent: e atStart: NO]; //NSLog(@"Add exit event %@ for view %@ rect %@", e, theView, NSStringFromRect(r->rectangle)); } } } } /* * Check cursor rectangles for the subviews */ if (theView->_rFlags.has_subviews) { NSArray *sb = theView->_sub_views; NSUInteger count = [sb count]; if (count > 0) { NSView *subs[count]; NSUInteger i; [sb getObjects: subs]; for (i = 0; i < count; ++i) { if (![subs[i] isHidden]) { checkCursorRectanglesExited(subs[i], theEvent, lastPoint); } } } } } - (void) resetCursorRects { [self discardCursorRects]; resetCursorRectsForView(_wv); _f.cursor_rects_valid = YES; if (_f.is_key && _f.cursor_rects_enabled) { NSPoint loc = [self mouseLocationOutsideOfEventStream]; if (NSMouseInRect(loc, [_wv bounds], NO)) { NSEvent *e = [NSEvent mouseEventWithType: NSMouseMoved location: loc modifierFlags: 0 timestamp: 0 windowNumber: _windowNum context: GSCurrentContext() eventNumber: 0 clickCount: 0 pressure: 0]; _lastPoint = NSMakePoint(-1,-1); checkCursorRectanglesEntered(_wv, e, _lastPoint); _lastPoint = loc; } } } /* * Handling user actions and events */ - (void) close { if (_f.has_closed == NO) { CREATE_AUTORELEASE_POOL(pool); _f.has_closed = YES; /* The NSWindowCloseNotification might result in us being deallocated. To make sure self stays valid as long as is necessary, we retain ourselves here and balance it with a release later (unless we're supposed to release ourselves when we close). */ if (!_f.is_released_when_closed) { RETAIN(self); } [nc postNotificationName: NSWindowWillCloseNotification object: self]; _f.has_opened = NO; [NSApp removeWindowsItem: self]; [self orderOut: self]; if (_f.is_miniaturized == YES) { NSWindow *mini = GSWindowWithNumber(_counterpart); GSRemoveIcon(mini); } [pool drain]; RELEASE(self); } } /* Private Method. Many X Window managers will just deminiaturize us without telling us to do it ourselves. Deal with it. */ - (void) _didDeminiaturize: sender { if (_f.is_miniaturized == YES) { _f.is_miniaturized = NO; _f.visible = YES; if (self == [NSApp iconWindow]) { [self orderOut: self]; if ([NSApp isActive] == NO) { [NSApp activateIgnoringOtherApps: YES]; } if ([NSApp isHidden] == YES) { [NSApp unhide: self]; } } [nc postNotificationName: NSWindowDidDeminiaturizeNotification object: self]; } } /** Causes the window to deminiaturize. Normally you would not call this method directly. A window is automatically deminiaturized by the user via a mouse click event. Does nothing it the window isn't miniaturized. */ - (void) deminiaturize: sender { if (!_f.is_miniaturized) return; /* At least with X-Windows, the counterpart is tied to us, so it will automatically be ordered out when we are deminiaturized */ if (_counterpart != 0) { NSWindow *mini = GSWindowWithNumber(_counterpart); GSRemoveIcon(mini); [mini orderOut: self]; } _f.is_miniaturized = NO; [self makeKeyAndOrderFront: self]; [self _didDeminiaturize: sender]; } /** Returns YES, if the document has been changed. */ - (BOOL) isDocumentEdited { return _f.is_edited; } /** Returns YES, if the window is released when it is closed. */ - (BOOL) isReleasedWhenClosed { return _f.is_released_when_closed; } /** Causes the window to miniaturize, that is the window is removed from the screen and it's counterpart (mini)window is displayed. Does nothing if the window can't be miniaturized (eg. because it's already miniaturized). */ - (void) miniaturize: (id)sender { GSDisplayServer *srv = GSServerForWindow(self); NSSize iconSize = [GSCurrentServer() iconSize]; if (_f.is_miniaturized || (_styleMask & NSMiniWindowMask)) { /* Can't miniaturize a miniwindow or a miniaturized window. */ return; } if (self == [NSApp iconWindow]) { if (NO == [[NSUserDefaults standardUserDefaults] boolForKey: @"GSSuppressAppIcon"]) { return; } } else if ((!(_styleMask & (NSIconWindowMask | NSMiniaturizableWindowMask))) || (_styleMask & NSMiniWindowMask) || (![self isVisible])) { return; } [nc postNotificationName: NSWindowWillMiniaturizeNotification object: self]; _f.is_miniaturized = YES; /* Make sure we're not defered */ if (_windowNum == 0) { [self _initBackendWindow]; } /* * Ensure that we have a miniwindow counterpart. */ if (_counterpart == 0 && [srv appOwnsMiniwindow]) { NSWindow *mini; NSMiniWindowView *v; NSRect rect = NSMakeRect(0, 0, iconSize.height, iconSize.width); mini = [[NSMiniWindow alloc] initWithContentRect: rect styleMask: NSMiniWindowMask backing: NSBackingStoreBuffered defer: NO]; mini->_counterpart = [self windowNumber]; _counterpart = [mini windowNumber]; v = [[NSMiniWindowView alloc] initWithFrame: rect]; [v setImage: [self miniwindowImage]]; [v setTitle: [self miniwindowTitle]]; [mini setContentView: v]; RELEASE(v); } [self _lossOfKeyOrMainWindow]; [srv miniwindow: _windowNum]; _f.visible = NO; /* * We must order the miniwindow in so that we will start sending * it messages to tell it to display itsself when neccessary. */ if (_counterpart != 0) { NSRect iconRect; NSWindow *mini = GSWindowWithNumber(_counterpart); iconRect = GSGetIconFrame(mini); [mini setFrame: iconRect display: YES]; [mini orderFront: self]; } [nc postNotificationName: NSWindowDidMiniaturizeNotification object: self]; } /** Causes the window to close. Calls the windowShouldClose: method on the delegate to determine if it should close and calls shouldCloseWindowController on the controller for the receiver. */ - (void) performClose: (id)sender { /* Don't close if a modal session is running and we are not the modal window */ if ([NSApp modalWindow] && self != [NSApp modalWindow]) { /* Panel that work in modal session can be closed nevertheless */ if (![self worksWhenModal]) return; } /* self must have a close button in order to be closed */ if (!(_styleMask & NSClosableWindowMask)) { NSBeep(); return; } if (_windowController) { NSDocument *document = [_windowController document]; if (document && ![document shouldCloseWindowController: _windowController]) { NSBeep(); return; } } if ([_delegate respondsToSelector: @selector(windowShouldClose:)]) { /* * if delegate responds to windowShouldClose query it to see if * it's ok to close the window */ if (![_delegate windowShouldClose: self]) { NSBeep(); return; } } else { /* * else if self responds to windowShouldClose query * self to see if it's ok to close self */ if ([self respondsToSelector: @selector(windowShouldClose:)]) { if (![self windowShouldClose: self]) { NSBeep(); return; } } } // FIXME: The button should be highlighted [self close]; } /** Performs the key equivalent represented by theEvent. */ - (BOOL) performKeyEquivalent: (NSEvent*)theEvent { if (_contentView) return [_contentView performKeyEquivalent: theEvent]; return NO; } /** * Miniaturize the receiver ... as long as its style mask includes * NSMiniaturizableWindowMask (and as long as the receiver is not an * icon or mini window itsself). Calls -miniaturize: to do this.
* Beeps if the window can't be miniaturised.
* Should ideally provide visual feedback (highlighting the miniaturize * button as if it had been clicked) first ... but that's not yet implemented. */ - (void) performMiniaturize: (id)sender { if ((!(_styleMask & NSMiniaturizableWindowMask)) || (_styleMask & (NSIconWindowMask | NSMiniWindowMask))) { NSBeep(); return; } // FIXME: The button should be highlighted [self miniaturize: sender]; } + (NSButton *) standardWindowButton: (NSWindowButton)button forStyleMask: (NSUInteger) mask { NSButton *newButton; newButton = [[NSButton alloc] init]; [newButton setRefusesFirstResponder: YES]; [newButton setButtonType: NSMomentaryChangeButton]; [newButton setImagePosition: NSImageOnly]; [newButton setBordered: YES]; [newButton setTag: button]; switch (button) { case NSWindowCloseButton: [newButton setImage: [NSImage imageNamed: @"common_Close"]]; [newButton setAlternateImage: [NSImage imageNamed: @"common_CloseH"]]; /* TODO: -performClose: should (but doesn't currently) highlight the button, which is wrong here. When -performClose: is fixed, we'll need a different method here. */ [newButton setAction: @selector(performClose:)]; break; case NSWindowMiniaturizeButton: [newButton setImage: [NSImage imageNamed: @"common_Miniaturize"]]; [newButton setAlternateImage: [NSImage imageNamed: @"common_MiniaturizeH"]]; [newButton setAction: @selector(miniaturize:)]; break; case NSWindowZoomButton: // FIXME [newButton setAction: @selector(zoom:)]; break; case NSWindowToolbarButton: // FIXME [newButton setAction: @selector(toggleToolbarShown:)]; break; case NSWindowDocumentIconButton: default: // FIXME break; } return AUTORELEASE(newButton); } - (NSButton *) standardWindowButton: (NSWindowButton)button { return [_wv viewWithTag: button]; } - (BOOL) showsToolbarButton { return _f.shows_toolbar_button; } - (void) setShowsToolbarButton: (BOOL)flag { _f.shows_toolbar_button = flag; } - (NSInteger) resizeFlags { // FIXME: The implementation is missing return 0; } /** Set document edit status. If YES, then, if the receiver has a close button, the close button will show a broken X. If NO, then, if the reciever has a close button, the close button will show a solid X. */ - (void) setDocumentEdited: (BOOL)flag { if (_f.is_edited != flag) { _f.is_edited = flag; if (_f.menu_exclude == NO && _f.has_opened == YES) { [NSApp updateWindowsItem: self]; } [_wv setDocumentEdited: flag]; } } /** Get an undo manager from the delegate or create one. */ - (NSUndoManager*) undoManager { NSUndoManager *undo = nil; if ([_delegate respondsToSelector: @selector(windowWillReturnUndoManager:)]) { undo = [_delegate windowWillReturnUndoManager: self]; } else if (_windowController) { NSDocument *document = [_windowController document]; if (document) undo = [document undoManager]; } if (undo == nil) { if (windowUndoManagers == NULL) windowUndoManagers = NSCreateMapTable(NSNonRetainedObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 0); else undo = NSMapGet(windowUndoManagers, self); if (undo == nil) { undo = [[NSUndoManager alloc] init]; NSMapInsertKnownAbsent(windowUndoManagers, self, undo); [undo release]; } } return undo; } - (void) undo: (id)sender { [[_firstResponder undoManager] undo]; } - (void) redo: (id)sender { [[_firstResponder undoManager] redo]; } /** If YES, then the window is released when the close method is called. */ - (void) setReleasedWhenClosed: (BOOL)flag { _f.is_released_when_closed = flag; } /* * Aiding event handling */ - (BOOL) acceptsMouseMovedEvents { return _f.accepts_mouse_moved; } - (void) setAcceptsMouseMovedEvents: (BOOL)flag { _f.accepts_mouse_moved = flag; } - (BOOL) ignoresMouseEvents { return _f.ignores_mouse_events; } - (void) setIgnoresMouseEvents: (BOOL)flag { _f.ignores_mouse_events = flag; [GSServerForWindow(self) setIgnoreMouse: flag : _windowNum]; } - (NSEvent*) currentEvent { return [NSApp currentEvent]; } - (void) discardEventsMatchingMask: (NSUInteger)mask beforeEvent: (NSEvent*)lastEvent { [NSApp discardEventsMatchingMask: mask beforeEvent: lastEvent]; } /** Returns the first responder of the window. */ - (NSResponder*) firstResponder { return _firstResponder; } /** Returns YES, if the window can accept first responder. The default implementation of this method returns YES. */ - (BOOL) acceptsFirstResponder { return YES; } /** Makes aResponder the first responder within the receiver. */ - (BOOL) makeFirstResponder: (NSResponder*)aResponder { if (_firstResponder == aResponder) return YES; if (aResponder != nil) { if (![aResponder isKindOfClass: responderClass]) return NO; if (![aResponder acceptsFirstResponder]) { return NO; } } /* So that the implementation of -resignFirstResponder in _firstResponder might ask for what will be the new first responder by calling our method _futureFirstResponder */ _futureFirstResponder = aResponder; /* * If there is a first responder tell it to resign. * Change only if it replies YES. */ if ((_firstResponder) && (![_firstResponder resignFirstResponder])) { return NO; } _firstResponder = aResponder; if ((aResponder == nil) || ![_firstResponder becomeFirstResponder]) { _firstResponder = self; [_firstResponder becomeFirstResponder]; return (aResponder == nil); } return YES; } /** Sets the initial first responder of the receiver. */ - (void) setInitialFirstResponder: (NSView*)aView { if ([aView isKindOfClass: viewClass]) { ASSIGN(_initialFirstResponder, aView); } } /** returns the initial first responder of the receiver. */ - (NSView*) initialFirstResponder { return _initialFirstResponder; } /** Processes theEvent when a key is pressed while within the window. */ - (void) keyDown: (NSEvent*)theEvent { NSString *characters = [theEvent characters]; unichar character = 0; if ([characters length] > 0) { character = [characters characterAtIndex: 0]; } if (character == NSHelpFunctionKey) { [NSHelpManager setContextHelpModeActive: YES]; return; } // If this is a BACKTAB event, move to the previous key view if (character == NSBackTabCharacter) { [self selectPreviousKeyView: self]; return; } // If this is a TAB or TAB+SHIFT event, move to the next key view if (character == NSTabCharacter) { if ([theEvent modifierFlags] & NSShiftKeyMask) [self selectPreviousKeyView: self]; else [self selectNextKeyView: self]; return; } // If this is an ESC event, abort modal loop if (character == 0x001b) { if ([NSApp modalWindow] == self) { // NB: The following *never* returns. [NSApp abortModal]; } return; } if (character == NSEnterCharacter || character == NSFormFeedCharacter || character == NSCarriageReturnCharacter) { if (_defaultButtonCell && _f.default_button_cell_key_disabled == NO) { [_defaultButtonCell performClick: self]; return; } } // Discard null character events such as a Shift event after a tab key if ([characters length] == 0) return; // FIXME: Why is this here, is the code still needed or a left over hack? // Try to process the event as a key equivalent // without Command having being pressed { NSEvent *new_event = [NSEvent keyEventWithType: [theEvent type] location: NSZeroPoint modifierFlags: ([theEvent modifierFlags] | NSCommandKeyMask) timestamp: [theEvent timestamp] windowNumber: [theEvent windowNumber] context: [theEvent context] characters: characters charactersIgnoringModifiers: [theEvent charactersIgnoringModifiers] isARepeat: [theEvent isARepeat] keyCode: [theEvent keyCode]]; if ([self performKeyEquivalent: new_event]) return; } // Otherwise, pass the event up [super keyDown: theEvent]; } - (void) keyUp: (NSEvent*)theEvent { if ([NSHelpManager isContextHelpModeActive]) { NSString *characters = [theEvent characters]; unichar character = 0; if ([characters length] > 0) { character = [characters characterAtIndex: 0]; } if (character == NSHelpFunctionKey) { [NSHelpManager setContextHelpModeActive: NO]; return; } } [super keyUp: theEvent]; } /* Return mouse location in reciever's base coord system, ignores event * loop status */ - (NSPoint) mouseLocationOutsideOfEventStream { int screen; NSPoint p; screen = [_screen screenNumber]; p = [GSServerForWindow(self) mouseLocationOnScreen: screen window: NULL]; if (p.x != -1) p = [self convertScreenToBase: p]; return p; } - (NSEvent*) nextEventMatchingMask: (NSUInteger)mask { return [NSApp nextEventMatchingMask: mask untilDate: [NSDate distantFuture] inMode: NSEventTrackingRunLoopMode dequeue: YES]; } - (NSEvent*) nextEventMatchingMask: (NSUInteger)mask untilDate: (NSDate*)expiration inMode: (NSString*)mode dequeue: (BOOL)deqFlag { return [NSApp nextEventMatchingMask: mask untilDate: expiration inMode: mode dequeue: deqFlag]; } - (void) postEvent: (NSEvent*)event atStart: (BOOL)flag { [NSApp postEvent: event atStart: flag]; } - (void) _checkTrackingRectangles: (NSView*)theView forEvent: (NSEvent*)theEvent { if (theView == nil) return; if (theView->_rFlags.has_trkrects) { BOOL isFlipped = [theView isFlipped]; NSArray *tr = theView->_tracking_rects; NSUInteger count = [tr count]; /* * Loop through the tracking rectangles */ if (count > 0) { GSTrackingRect *rects[count]; NSPoint loc = [theEvent locationInWindow]; NSPoint lastPoint = _lastPoint; NSUInteger i; lastPoint = [theView convertPoint: lastPoint fromView: nil]; loc = [theView convertPoint: loc fromView: nil]; [tr getObjects: rects]; for (i = 0; i < count; ++i) { BOOL last; BOOL now; GSTrackingRect *r = rects[i]; if ([r isValid] == NO) continue; /* Check mouse at last point */ last = NSMouseInRect(lastPoint, r->rectangle, isFlipped); /* Check mouse at current point */ now = NSMouseInRect(loc, r->rectangle, isFlipped); if ((!last) && (now)) // Mouse entered event { if (r->flags.checked == NO) { if ([r->owner respondsToSelector: @selector(mouseEntered:)]) r->flags.ownerRespondsToMouseEntered = YES; if ([r->owner respondsToSelector: @selector(mouseExited:)]) r->flags.ownerRespondsToMouseExited = YES; r->flags.checked = YES; } if (r->flags.ownerRespondsToMouseEntered) { NSEvent *e; e = [NSEvent enterExitEventWithType: NSMouseEntered location: loc modifierFlags: [theEvent modifierFlags] timestamp: 0 windowNumber: [theEvent windowNumber] context: NULL eventNumber: 0 trackingNumber: r->tag userData: r->user_data]; [r->owner mouseEntered: e]; } } if ((last) && (!now)) // Mouse exited event { if (r->flags.checked == NO) { if ([r->owner respondsToSelector: @selector(mouseEntered:)]) r->flags.ownerRespondsToMouseEntered = YES; if ([r->owner respondsToSelector: @selector(mouseExited:)]) r->flags.ownerRespondsToMouseExited = YES; r->flags.checked = YES; } if (r->flags.ownerRespondsToMouseExited) { NSEvent *e; e = [NSEvent enterExitEventWithType: NSMouseExited location: loc modifierFlags: [theEvent modifierFlags] timestamp: 0 windowNumber: [theEvent windowNumber] context: NULL eventNumber: 0 trackingNumber: r->tag userData: r->user_data]; [r->owner mouseExited: e]; } } } } } /* * Check tracking rectangles for the subviews */ if (theView->_rFlags.has_subviews) { NSArray *sb = theView->_sub_views; NSUInteger count = [sb count]; if (count > 0) { NSView *subs[count]; NSUInteger i; [sb getObjects: subs]; for (i = 0; i < count; ++i) { if (![subs[i] isHidden]) (*ctImp)(self, ctSel, subs[i], theEvent); } } } } - (void) _checkCursorRectangles: (NSView*)theView forEvent: (NSEvent*)theEvent { // As we add the events to the front of the queue, we need to add the last // events first. That is, first the enter evnts from inner to outer and // then the exit events checkCursorRectanglesEntered(theView, theEvent, _lastPoint); checkCursorRectanglesExited(theView, theEvent, _lastPoint); //[GSServerForWindow(self) _printEventQueue]; } - (void) _processResizeEvent { if (_windowNum && _gstate) { [GSServerForWindow(self) setWindowdevice: _windowNum forContext: _context]; GSReplaceGState(_context, _gstate); } [self update]; } - (void) mouseDown: (NSEvent*)theEvent { // Quietly discard an unused mouse down. } - (BOOL) becomesKeyOnlyIfNeeded { return NO; } /** Handles mouse and other events sent to the receiver by NSApplication. Do not invoke this method directly. */ - (void) sendEvent: (NSEvent*)theEvent { NSView *v; NSEventType type; /* If the backend reacts slowly, events (eg. mouse down) might arrive for a window that has been ordered out (and thus is logically invisible). We need to ignore those events. Otherwise, eg. clicking twice on a button that ends a modal session and closes the window with the button might cause the button to be pressed twice, which causes Bad Things to happen when it tries to stop a modal session twice. We let NSAppKitDefined events through since they deal with window ordering. */ if (!_f.visible && [theEvent type] != NSAppKitDefined) { NSDebugLLog(@"NSEvent", @"Discard (window not visible) %@", theEvent); return; } if (!_f.cursor_rects_valid) { [self resetCursorRects]; } type = [theEvent type]; if ([self ignoresMouseEvents] && GSMouseEventMask == NSEventMaskFromType(type)) { NSDebugLLog(@"NSEvent", @"Discard (window ignoring mouse) %@", theEvent); return; } switch (type) { case NSLeftMouseDown: { BOOL wasKey = _f.is_key; if (_f.has_closed == NO) { v = [_wv hitTest: [theEvent locationInWindow]]; if (_f.is_key == NO && _windowLevel != NSDesktopWindowLevel) { /* NSPanel modification: check becomesKeyOnlyIfNeeded. */ if (![self becomesKeyOnlyIfNeeded] || [v needsPanelToBecomeKey]) { v = nil; [self makeKeyAndOrderFront: self]; } } /* Activate the app *after* making the receiver key, as app activation tries to make the previous key window key. However, don't activate the app after a single click into the app icon or a miniwindow. This allows dragging app icons and miniwindows without unnecessarily switching applications (cf. Sect. 4 of the OpenStep UI Guidelines). */ if ((_styleMask & (NSIconWindowMask | NSMiniWindowMask)) == 0 && [NSApp isActive] == NO) { v = nil; [NSApp activateIgnoringOtherApps: YES]; } // Activating the app may change the window layout. if (v == nil) { v = [_wv hitTest: [theEvent locationInWindow]]; } if (_lastLeftMouseDownView) { DESTROY(_lastLeftMouseDownView); } // Don't make buttons first responder otherwise they cannot // send actions to the current first responder. // TODO: First responder status update would more cleanly // handled by -mouseDown in each control subclass (Mac OS X // seems to do that). if (_firstResponder != v && ![v isKindOfClass: [NSButton class]]) { // Only try to set first responder, when the view wants it. if ([v acceptsFirstResponder] && ![self makeFirstResponder: v]) { return; } } if (wasKey == YES || [v acceptsFirstMouse: theEvent] == YES) { if ([NSHelpManager isContextHelpModeActive]) { [v helpRequested: theEvent]; } else { ASSIGN(_lastLeftMouseDownView, v); if (toolTipVisible != nil) { /* Inform the tooltips system that we have had * a mouse down so it should stop displaying. */ [toolTipVisible mouseDown: theEvent]; } [v mouseDown: theEvent]; } } else { [self mouseDown: theEvent]; } } else { NSDebugLLog(@"NSEvent", @"Discard (window closed) %@", theEvent); } _lastPoint = [theEvent locationInWindow]; break; } case NSLeftMouseUp: v = AUTORELEASE(RETAIN(_lastLeftMouseDownView)); DESTROY(_lastLeftMouseDownView); if (v == nil) break; [v mouseUp: theEvent]; _lastPoint = [theEvent locationInWindow]; break; case NSOtherMouseDown: v = [_wv hitTest: [theEvent locationInWindow]]; ASSIGN(_lastOtherMouseDownView, v); [v otherMouseDown: theEvent]; _lastPoint = [theEvent locationInWindow]; break; case NSOtherMouseUp: v = AUTORELEASE(RETAIN(_lastOtherMouseDownView)); DESTROY(_lastOtherMouseDownView); if (v == nil) break; [v otherMouseUp: theEvent]; _lastPoint = [theEvent locationInWindow]; break; case NSRightMouseDown: v = [_wv hitTest: [theEvent locationInWindow]]; ASSIGN(_lastRightMouseDownView, v); [v rightMouseDown: theEvent]; _lastPoint = [theEvent locationInWindow]; break; case NSRightMouseUp: v = AUTORELEASE(RETAIN(_lastRightMouseDownView)); DESTROY(_lastRightMouseDownView); if (v == nil) break; [v rightMouseUp: theEvent]; _lastPoint = [theEvent locationInWindow]; break; case NSLeftMouseDragged: case NSOtherMouseDragged: case NSRightMouseDragged: case NSMouseMoved: switch (type) { case NSLeftMouseDragged: [_lastLeftMouseDownView mouseDragged: theEvent]; break; case NSOtherMouseDragged: [_lastOtherMouseDownView otherMouseDragged: theEvent]; break; case NSRightMouseDragged: [_lastRightMouseDownView rightMouseDragged: theEvent]; break; default: if (_f.accepts_mouse_moved) { /* * If the window is set to accept mouse movements, we need to * forward the mouse movement to the correct view. */ v = [_wv hitTest: [theEvent locationInWindow]]; /* If the view is displaying a tooltip, we should * send mouse movements to the tooltip system so * that the window can track the mouse. */ if (toolTipVisible != nil) { [toolTipVisible mouseMoved: theEvent]; } else { [v mouseMoved: theEvent]; } } break; } /* * We need to go through all of the views, and if there is any with * a tracking rectangle then we need to determine if we should send * a NSMouseEntered or NSMouseExited event. */ (*ctImp)(self, ctSel, _wv, theEvent); if (_f.is_key) { /* * We need to go through all of the views, and if there is any with * a cursor rectangle then we need to determine if we should send a * cursor update event. */ if (_f.cursor_rects_enabled) { (*ccImp)(self, ccSel, _wv, theEvent); } } _lastPoint = [theEvent locationInWindow]; break; case NSMouseEntered: case NSMouseExited: break; case NSKeyDown: /* Always shift keyboard focus to the next and previous key view, * respectively, upon receiving Ctrl-Tab and Ctrl-Shift-Tab keyboard * events. This means that the key view loop won't get stuck in views * that interpret the Tab key differently, e.g., NSTextView. (cf. the * Keyboard Interface Control section in Apple's Cocoa Event-Handling * Guide). */ if (([theEvent modifierFlags] & NSControlKeyMask) && [[theEvent charactersIgnoringModifiers] isEqualToString: @"\t"]) { if ([theEvent modifierFlags] & NSShiftKeyMask) [self selectPreviousKeyView: self]; else [self selectNextKeyView: self]; } else [_firstResponder keyDown: theEvent]; break; case NSKeyUp: [_firstResponder keyUp: theEvent]; break; case NSFlagsChanged: [_firstResponder flagsChanged: theEvent]; break; case NSCursorUpdate: { GSTrackingRect *r =(GSTrackingRect*)[theEvent userData]; NSCursor *c = (NSCursor*)[r owner]; // Don't update the cursor if the window isn't the key window. if (!_f.is_key) { break; } if ([theEvent trackingNumber]) // It's a mouse entered { /* Only send the event mouse entered if the * cursor rectangle is valid. */ if ([r isValid]) { [c mouseEntered: theEvent]; /* This could seems redundant, but ensure the correct * value to use in events mouse moved. And avoids strange * issues with cursor. */ _lastPoint = [theEvent locationInWindow]; } } else // it is a mouse exited { [c mouseExited: theEvent]; } } break; case NSScrollWheel: v = [_wv hitTest: [theEvent locationInWindow]]; [v scrollWheel: theEvent]; break; case NSAppKitDefined: { id dragInfo; int action; NSEvent *e; GSAppKitSubtype sub = [theEvent subtype]; switch (sub) { case GSAppKitWindowMoved: _frame.origin.x = (CGFloat)[theEvent data1]; _frame.origin.y = (CGFloat)[theEvent data2]; NSDebugLLog(@"Moving", @"Move event: %d %@", (int)_windowNum, NSStringFromPoint(_frame.origin)); if (_autosaveName != nil) { [self saveFrameUsingName: _autosaveName]; } [nc postNotificationName: NSWindowDidMoveNotification object: self]; break; case GSAppKitWindowResized: { NSRect newFrame; newFrame.size.width = [theEvent data1]; newFrame.size.height = [theEvent data2]; /* Resize events always move the frame origin. The new origin is stored in the event location field. */ newFrame.origin = [theEvent locationInWindow]; /* FIXME: For a user resize we should call windowWillResize:toSize: on the delegate. */ _frame = newFrame; newFrame.origin = NSZeroPoint; [_wv setFrame: newFrame]; [_wv setNeedsDisplay: YES]; if (_autosaveName != nil) { [self saveFrameUsingName: _autosaveName]; } [self _processResizeEvent]; [nc postNotificationName: NSWindowDidResizeNotification object: self]; break; } case GSAppKitRegionExposed: { NSRect region; region.size.width = [theEvent data1]; region.size.height = [theEvent data2]; region.origin = [theEvent locationInWindow]; switch (_backingType) { case NSBackingStoreBuffered: case NSBackingStoreRetained: /* * The backend may have the region buffered ... * so we add it to the rectangle to be flushed * and set the flag to say that a flush is required. */ _rectNeedingFlush = NSUnionRect(_rectNeedingFlush, region); _f.needs_flush = YES; /* Some or all of the window has not been drawn, * so we must at least make sure that the exposed * region gets drawn before its backing store is * flushed ... otherwise we might actually flush * bogus data from an out of date buffer. * Maybe we should call * [_wv displayIfNeededInRect: region] * but why not do all drawing at this point so * that if we get another expose event immediately * (eg. something is dragged over the window and * we get a series of expose events) we can just * flush without having to draw again. */ [self displayIfNeeded]; [self flushWindowIfNeeded]; break; default: /* non-retained ... so we need to redraw the exposed * region here. */ [_wv setNeedsDisplayInRect: region]; break; } } break; case GSAppKitWindowClose: [self performClose: NSApp]; break; case GSAppKitWindowDeminiaturize: [self _didDeminiaturize: NSApp]; break; case GSAppKitWindowMiniaturize: [self performMiniaturize: NSApp]; break; case GSAppKitWindowFocusIn: if (_f.is_miniaturized) { /* Window Manager just deminiaturized us */ [self deminiaturize: self]; } if ([NSApp modalWindow] && self != [NSApp modalWindow] && ![self worksWhenModal]) { /* Ignore this request. We're in a modal loop and the user pressed on the title bar of another window. */ break; } if ([self canBecomeKeyWindow] == YES) { NSDebugLLog(@"Focus", @"Making %d key", (int)_windowNum); [self makeKeyWindow]; [self makeMainWindow]; [NSApp activateIgnoringOtherApps: YES]; } if (self == [[NSApp mainMenu] window]) { /* We should really find another window that can become key (if possible) */ [self _lossOfKeyOrMainWindow]; } break; case GSAppKitWindowFocusOut: break; case GSAppKitWindowLeave: /* we ignore this event for a window that is already closed */ if (_f.has_closed == YES) break; /* * We need to go through all of the views, and if there * is any with a tracking rectangle then we need to * determine if we should send a NSMouseExited event. */ (*ctImp)(self, ctSel, _wv, theEvent); if (_f.is_key) { /* * We need to go through all of the views, and if * there is any with a cursor rectangle then we need * to determine if we should send a cursor update * event. */ if (_f.cursor_rects_enabled) { checkCursorRectanglesExited(_wv, theEvent, _lastPoint); } } _lastPoint = NSMakePoint(-1, -1); break; case GSAppKitWindowEnter: break; #define GSPerformDragSelector(view, sel, info, action) \ if ([view window] == self) \ { \ id target = view; \ \ if (target == _wv) \ { \ if (_delegate != nil \ && [_delegate respondsToSelector: sel] == YES) \ { \ target = _delegate; \ } \ else \ { \ target = self; \ } \ } \ \ if ([target respondsToSelector: sel]) \ { \ action = (intptr_t)[target performSelector: sel \ withObject: info]; \ } \ } #define GSPerformVoidDragSelector(view, sel, info) \ if ([view window] == self) \ { \ id target = view; \ \ if (target == _wv) \ { \ if (_delegate != nil \ && [_delegate respondsToSelector: sel] == YES) \ { \ target = _delegate; \ } \ else \ { \ target = self; \ } \ } \ \ if ([target respondsToSelector: sel]) \ { \ [target performSelector: sel withObject: info]; \ } \ } case GSAppKitDraggingEnter: case GSAppKitDraggingUpdate: { BOOL isEntry; dragInfo = [GSServerForWindow(self) dragInfo]; v = [_wv hitTest: [theEvent locationInWindow]]; while (v != nil) { if (v->_rFlags.has_draginfo != 0 && GSViewAcceptsDrag(v, dragInfo)) break; v = [v superview]; } if (v == nil) { v = _wv; } if (_lastDragView == v) { isEntry = NO; } else { isEntry = YES; if (_lastDragView != nil && _f.accepts_drag) { NSDebugLLog(@"NSDragging", @"Dragging exit"); GSPerformVoidDragSelector(_lastDragView, @selector(draggingExited:), dragInfo); } ASSIGN(_lastDragView, v); _f.accepts_drag = GSViewAcceptsDrag(v, dragInfo); } if (_f.accepts_drag) { if (isEntry == YES) { action = NSDragOperationNone; NSDebugLLog(@"NSDragging", @"Dragging entered"); GSPerformDragSelector(v, @selector(draggingEntered:), dragInfo, action); } else { action = _lastDragOperationMask; NSDebugLLog(@"NSDragging", @"Dragging updated"); GSPerformDragSelector(v, @selector(draggingUpdated:), dragInfo, action); } } else { action = NSDragOperationNone; } e = [NSEvent otherEventWithType: NSAppKitDefined location: [theEvent locationInWindow] modifierFlags: 0 timestamp: 0 windowNumber: _windowNum context: GSCurrentContext() subtype: GSAppKitDraggingStatus data1: [theEvent data1] data2: action]; _lastDragOperationMask = action; [dragInfo postDragEvent: e]; break; } case GSAppKitDraggingStatus: NSDebugLLog(@"NSDragging", @"Internal: dropped GSAppKitDraggingStatus event"); break; case GSAppKitDraggingExit: NSDebugLLog(@"NSDragging", @"GSAppKitDraggingExit"); dragInfo = [GSServerForWindow(self) dragInfo]; if (_lastDragView && _f.accepts_drag) { NSDebugLLog(@"NSDragging", @"Dragging exit"); GSPerformVoidDragSelector(_lastDragView, @selector(draggingExited:), dragInfo); } _lastDragOperationMask = NSDragOperationNone; DESTROY(_lastDragView); break; case GSAppKitDraggingDrop: NSDebugLLog(@"NSDragging", @"GSAppKitDraggingDrop"); dragInfo = [GSServerForWindow(self) dragInfo]; if (_lastDragView && _f.accepts_drag && _lastDragOperationMask != NSDragOperationNone) { action = YES; GSPerformDragSelector(_lastDragView, @selector(prepareForDragOperation:), dragInfo, action); if (action) { action = NO; GSPerformDragSelector(_lastDragView, @selector(performDragOperation:), dragInfo, action); } if (action) { GSPerformVoidDragSelector(_lastDragView, @selector(concludeDragOperation:), dragInfo); } } _lastDragOperationMask = NSDragOperationNone; DESTROY(_lastDragView); e = [NSEvent otherEventWithType: NSAppKitDefined location: [theEvent locationInWindow] modifierFlags: 0 timestamp: 0 windowNumber: _windowNum context: GSCurrentContext() subtype: GSAppKitDraggingFinished data1: [theEvent data1] data2: 0]; [dragInfo postDragEvent: e]; break; case GSAppKitDraggingFinished: _lastDragOperationMask = NSDragOperationNone; DESTROY(_lastDragView); NSDebugLLog(@"NSDragging", @"Internal: dropped GSAppKitDraggingFinished event"); break; default: break; } } break; case NSPeriodic: case NSSystemDefined: case NSApplicationDefined: break; case NSTabletPoint: case NSTabletProximity: // FIXME: Tablet events break; } } - (BOOL) shouldBeTreatedAsInkEvent: (NSEvent *)theEvent { NSView *v; v = [_wv hitTest: [theEvent locationInWindow]]; if (![self isMainWindow]) { return (v != _wv); } else { return [v shouldBeTreatedAsInkEvent: theEvent]; } } - (BOOL) tryToPerform: (SEL)anAction with: (id)anObject { if ([super tryToPerform: anAction with: anObject]) return YES; else if (_delegate && [_delegate respondsToSelector: anAction]) { [_delegate performSelector: anAction withObject: anObject]; return YES; } else return NO; } - (BOOL) worksWhenModal { return NO; } /** If aView responds to -nextValidKeyView with a new NSView, call -makeFirstResponder: for the returned view. */ - (void) selectKeyViewFollowingView: (NSView*)aView { NSView *theView = nil; if ([aView isKindOfClass: viewClass]) theView = [aView nextValidKeyView]; if (theView) { if (![self makeFirstResponder: theView]) { return; } if ([theView respondsToSelector:@selector(selectText:)]) { _f.selectionDirection = NSSelectingNext; [(id)theView selectText: self]; _f.selectionDirection = NSDirectSelection; } } } /** If aView responds to -previousValidKeyView with a new NSView, call -makeFirstResponder: for this view. */ - (void) selectKeyViewPrecedingView: (NSView*)aView { NSView *theView = nil; if ([aView isKindOfClass: viewClass]) theView = [aView previousValidKeyView]; if (theView) { if (![self makeFirstResponder: theView]) { return; } if ([theView respondsToSelector:@selector(selectText:)]) { _f.selectionDirection = NSSelectingPrevious; [(id)theView selectText: self]; _f.selectionDirection = NSDirectSelection; } } } /** This method checks if: _firstResponder answers to -nextValidKeyView _initialFirstResponder answers to -acceptsFirstResponder _initialFirstResponder answers to -previousValidKeyView If any of these checks return a NSView, call -makeFirstResponder: on this NSView. */ - (void) selectNextKeyView: (id)sender { NSView *theView = nil; if ([_firstResponder isKindOfClass: viewClass]) theView = [_firstResponder nextValidKeyView]; if ((theView == nil) && (_initialFirstResponder)) { if ([_initialFirstResponder acceptsFirstResponder]) theView = _initialFirstResponder; else theView = [_initialFirstResponder nextValidKeyView]; } if (theView) { if (![self makeFirstResponder: theView]) { return; } if ([theView respondsToSelector:@selector(selectText:)]) { _f.selectionDirection = NSSelectingNext; [(id)theView selectText: self]; _f.selectionDirection = NSDirectSelection; } } } /** This method checks if: _firstResponder answers to -previousValidKeyView _initialFirstResponder answers to -acceptsFirstResponder _initialFirstResponder answers to -previousValidKeyView If any of these checks return a NSView, call -makeFirstResponder: on this NSView. */ - (void) selectPreviousKeyView: (id)sender { NSView *theView = nil; if ([_firstResponder isKindOfClass: viewClass]) theView = [_firstResponder previousValidKeyView]; if ((theView == nil) && (_initialFirstResponder)) { if ([_initialFirstResponder acceptsFirstResponder]) theView = _initialFirstResponder; else theView = [_initialFirstResponder previousValidKeyView]; } if (theView) { if (![self makeFirstResponder: theView]) { return; } if ([theView respondsToSelector:@selector(selectText:)]) { _f.selectionDirection = NSSelectingPrevious; [(id)theView selectText: self]; _f.selectionDirection = NSDirectSelection; } } } // This is invoked by selectText: of some views (eg matrixes), // to know whether they have received it from the window, and // if so, in which direction is the selection moving (so that they know // if they should select the last or the first editable cell). /** Returns the value of _selectionDirection, the direction of the current key view.
See Also: -selectKeyViewFollowingView: -selectKeyViewPrecedingView: -selectNextKeyView: -selectPreviousKeyView: */ - (NSSelectionDirection) keyViewSelectionDirection { return _f.selectionDirection; } - (BOOL) autorecalculatesKeyViewLoop { return _f.autorecalculates_keyview_loop; } - (void) setAutorecalculatesKeyViewLoop: (BOOL)flag { _f.autorecalculates_keyview_loop = flag; } - (void) recalculateKeyViewLoop { // Should be called from NSView viewWillMoveToWindow (but only if // -autorecalculatesKeyViewLoop returns YES) [_contentView _setUpKeyViewLoopWithNextKeyView: _contentView]; [self setInitialFirstResponder: [_contentView nextValidKeyView]]; } /* * Dragging */ - (void) dragImage: (NSImage*)anImage at: (NSPoint)baseLocation offset: (NSSize)initialOffset event: (NSEvent*)event pasteboard: (NSPasteboard*)pboard source: (id)sourceObject slideBack: (BOOL)slideFlag { id dragView = [GSServerForWindow(self) dragInfo]; [NSApp preventWindowOrdering]; [dragView dragImage: anImage at: [self convertBaseToScreen: baseLocation] offset: initialOffset event: event pasteboard: pboard source: sourceObject slideBack: slideFlag]; } - (void) registerForDraggedTypes: (NSArray*)newTypes { [_wv registerForDraggedTypes: newTypes]; } - (void) unregisterDraggedTypes { [_wv unregisterDraggedTypes]; } /* * Services and windows menu support */ - (BOOL) isExcludedFromWindowsMenu { return _f.menu_exclude; } - (void) setExcludedFromWindowsMenu: (BOOL)flag { if (_f.menu_exclude != flag) { _f.menu_exclude = flag; if (flag == YES) { [NSApp removeWindowsItem: self]; } else if (_f.has_opened == YES && flag == NO) { [NSApp addWindowsItem: self title: _windowTitle filename: [self _hasTitleWithRepresentedFilename]]; } } } - (id) validRequestorForSendType: (NSString*)sendType returnType: (NSString*)returnType { id result = nil; if (_delegate && [_delegate respondsToSelector: _cmd] && ![_delegate isKindOfClass: [NSResponder class]]) result = [_delegate validRequestorForSendType: sendType returnType: returnType]; if (result == nil) result = [NSApp validRequestorForSendType: sendType returnType: returnType]; return result; } /* * Saving and restoring the frame */ - (NSString*) frameAutosaveName { return _autosaveName; } - (void) saveFrameUsingName: (NSString*)name { NSUserDefaults *defs; NSString *key; id obj; defs = [NSUserDefaults standardUserDefaults]; obj = [self stringWithSavedFrame]; key = [NSString stringWithFormat: @"NSWindow Frame %@", name]; [defs setObject: obj forKey: key]; } - (BOOL) setFrameAutosaveName: (NSString*)name { if ([name isEqual: _autosaveName]) { return YES; /* That's our name already. */ } if ([autosaveNames member: name] != nil) { return NO; /* Name in use elsewhere. */ } if (_autosaveName != nil) { [[self class] removeFrameUsingName: _autosaveName]; [autosaveNames removeObject: _autosaveName]; _autosaveName = nil; } if (name != nil && [name isEqual: @""] == NO) { name = [name copy]; [autosaveNames addObject: name]; _autosaveName = name; RELEASE(name); if (![self setFrameUsingName: _autosaveName]) { [self saveFrameUsingName: _autosaveName]; } } return YES; } - (void) setFrameFromString: (NSString*)string { NSScanner *scanner = [NSScanner scannerWithString: string]; NSRect nRect; NSRect sRect; NSRect fRect; int value; NSScreen *screen; /* * Scan in the window frame (flipped coordinate system). */ if ([scanner scanInt: &value] == NO) { NSLog(@"Bad window frame format - x-coord missing"); return; } fRect.origin.x = value; if ([scanner scanInt: &value] == NO) { NSLog(@"Bad window frame format - y-coord missing"); return; } fRect.origin.y = value; if ([scanner scanInt: &value] == NO) { NSLog(@"Bad window frame format - width missing"); return; } fRect.size.width = value; if ([scanner scanInt: &value] == NO) { NSLog(@"Bad window frame format - height missing"); return; } fRect.size.height = value; /* * Check that the window will come up on screen */ #if 0 // Not valid since screen frame x/y values can be negative... if (fRect.origin.x + fRect.size.width < 0) { NSLog(@"Bad screen frame - window is off screen"); return; } #endif // if toolbar is showing, adjust saved frame to add the toolbar back in if ([_toolbar isVisible]) { CGFloat toolbarHeight = [[_toolbar _toolbarView] frame].size.height; fRect.size.height += toolbarHeight; fRect.origin.y -= toolbarHeight; } // if window has a menu, adjust saved frame to add the menu back in if ([_wv hasMenu]) { CGFloat menuBarHeight = [[GSTheme theme] menuHeightForWindow: self]; fRect.size.height += menuBarHeight; fRect.origin.y -= menuBarHeight; } /* * Scan in the frame for the area the window was placed in in screen. */ if ([scanner scanInt: &value] == NO) { NSLog(@"Bad screen frame format - x-coord missing"); return; } sRect.origin.x = value; if ([scanner scanInt: &value] == NO) { NSLog(@"Bad screen frame format - y-coord missing"); return; } sRect.origin.y = value; if ([scanner scanInt: &value] == NO) { NSLog(@"Bad screen frame format - width missing"); return; } sRect.size.width = value; if ([scanner scanInt: &value] == NO) { NSLog(@"Bad screen frame format - height missing"); return; } sRect.size.height = value; /* * The screen rectangle gives the area of the screen in which * the window could be placed (ie a rectangle excluding the dock). */ screen = [self _screenForFrame: fRect]; // Check whether a portion is showing somewhere... if (screen == nil) { // If the window doesn't show up on any screen then we need // to move it so it can be seen and assign it to the main // screen... screen = [NSScreen mainScreen]; NSDebugLLog(@"NSWindow", @"%s: re-assigning to main screen\n", __PRETTY_FUNCTION__); } nRect = [screen visibleFrame]; /* * If the new screen drawable area has moved relative to the one in * which the window was saved, adjust the window position accordingly. */ if (NSEqualPoints(nRect.origin, sRect.origin) == NO) { fRect.origin.x += nRect.origin.x - sRect.origin.x; fRect.origin.y += nRect.origin.y - sRect.origin.y; } /* * If the stored screen area is not the same as that currently * available, we adjust the window frame (position) to try to * make layout sensible. */ if (nRect.size.width != sRect.size.width) { fRect.origin.x = nRect.origin.x + (fRect.origin.x - nRect.origin.x) * (nRect.size.width / sRect.size.width); } if (nRect.size.height != sRect.size.height) { fRect.origin.y = nRect.origin.y + (fRect.origin.y - nRect.origin.y) * (nRect.size.height / sRect.size.height); /* * If height of the window goes above the screen height, then adjust the window down. */ if ((fRect.size.height + fRect.origin.y) > nRect.size.height) { fRect.origin.y = nRect.size.height - fRect.size.height; } } // FIXME: Is this check needed? /* If we aren't resizable (ie. if we don't have a resize bar), make sure we don't change the size. */ if (!(_styleMask & NSResizableWindowMask)) fRect.size = _frame.size; if (NSEqualSizes(fRect.size, _frame.size) == NO) { if ([_delegate respondsToSelector: @selector(windowWillResize:toSize:)]) { fRect.size = [_delegate windowWillResize: self toSize: fRect.size]; } } // Make sure we are using the new screen we are applying to... ASSIGN(_screen, screen); /* * Set frame. */ [self setFrame: fRect display: (_f.visible) ? YES : NO]; } - (BOOL) setFrameUsingName: (NSString*)name { NSUserDefaults *defs; id obj; NSString *key; defs = [NSUserDefaults standardUserDefaults]; key = [NSString stringWithFormat: @"NSWindow Frame %@", name]; obj = [defs objectForKey: key]; if (obj == nil) return NO; [self setFrameFromString: obj]; return YES; } - (BOOL) setFrameUsingName: (NSString *)name force: (BOOL)force { // FIXME if ((_styleMask & NSResizableWindowMask) || force) return [self setFrameUsingName: name]; else return NO; } - (NSString *) stringWithSavedFrame { NSRect fRect; NSRect sRect; NSString *autosaveString; fRect = _frame; // if toolbar is showing, adjust saved frame to not include the toolbar if ([_toolbar isVisible]) { CGFloat toolbarHeight = [[_toolbar _toolbarView] frame].size.height; fRect.size.height -= toolbarHeight; fRect.origin.y += toolbarHeight; } // if window has a menu, adjust saved frame to not include the menu if ([_wv hasMenu]) { CGFloat menuBarHeight = [[GSTheme theme] menuHeightForWindow: self]; fRect.size.height -= menuBarHeight; fRect.origin.y += menuBarHeight; } /* * The screen rectangle should give the area of the screen in which * the window could be placed (ie a rectangle excluding the dock). */ sRect = [[self screen] visibleFrame]; autosaveString = [NSString stringWithFormat: @"%d %d %d %d %d %d % d %d ", (int)fRect.origin.x, (int)fRect.origin.y, (int)fRect.size.width, (int)fRect.size.height, (int)sRect.origin.x, (int)sRect.origin.y, (int)sRect.size.width, (int)sRect.size.height]; NSDebugLLog(@"NSWindow", @"%s:autosaveName: %@ frame string: %@", __PRETTY_FUNCTION__, _autosaveName, autosaveString); return autosaveString; } /* * Printing and postscript */ - (NSData *) dataWithEPSInsideRect: (NSRect)rect { return [_wv dataWithEPSInsideRect: [_wv convertRect: rect fromView: nil]]; } - (NSData *) dataWithPDFInsideRect:(NSRect)aRect { return [_wv dataWithPDFInsideRect: [_wv convertRect: aRect fromView: nil]]; } /** Opens the fax panel to allow the user to fax the contents of the window view. */ - (void) fax: (id)sender { [_wv fax: sender]; } /** Opens the print panel to allow the user to print the contents of the window view. */ - (void) print: (id)sender { [_wv print: sender]; } /* * Zooming */ #define DIST 3 /** Returns yes, if the receiver is zoomed. */ - (BOOL) isZoomed { NSRect maxRect = [[self screen] visibleFrame]; if ([_delegate respondsToSelector: @selector(windowWillUseStandardFrame:defaultFrame:)]) { maxRect = [_delegate windowWillUseStandardFrame: self defaultFrame: maxRect]; } else if ([self respondsToSelector: @selector(windowWillUseStandardFrame:defaultFrame:)]) { maxRect = [self windowWillUseStandardFrame: self defaultFrame: maxRect]; } else if ([_delegate respondsToSelector: @selector(windowWillResize:toSize:)]) { maxRect.size = [_delegate windowWillResize: self toSize: maxRect.size]; } else if ([self respondsToSelector: @selector(windowWillResize:toSize:)]) { maxRect.size = [self windowWillResize: self toSize: maxRect.size]; } // Compare the new frame with the current one return NSEqualRects(maxRect, _frame); } /** Performs the zoom method on the receiver. */ - (void) performZoom: (id)sender { // FIXME: We should check for the style and highlight the button [self zoom: sender]; } /** Zooms the receiver. This method calls the delegate method windowShouldZoom:toFrame: to determine if the window should be allowed to zoom to full screen. */ - (void) zoom: (id)sender { NSRect maxRect = [[self screen] visibleFrame]; if ([_delegate respondsToSelector: @selector(windowWillUseStandardFrame:defaultFrame:)]) { maxRect = [_delegate windowWillUseStandardFrame: self defaultFrame: maxRect]; } else if ([self respondsToSelector: @selector(windowWillUseStandardFrame:defaultFrame:)]) { maxRect = [self windowWillUseStandardFrame: self defaultFrame: maxRect]; } maxRect = [self constrainFrameRect: maxRect toScreen: [self screen]]; // Compare the new frame with the current one if ((abs(NSMaxX(maxRect) - NSMaxX(_frame)) < DIST) && (abs(NSMaxY(maxRect) - NSMaxY(_frame)) < DIST) && (abs(NSMinX(maxRect) - NSMinX(_frame)) < DIST) && (abs(NSMinY(maxRect) - NSMinY(_frame)) < DIST)) { // Already in zoomed mode, reset user frame, if stored if (_autosaveName != nil) { [self setFrameUsingName: _autosaveName]; } return; } if ([_delegate respondsToSelector: @selector(windowShouldZoom:toFrame:)]) { if (![_delegate windowShouldZoom: self toFrame: maxRect]) return; } else if ([self respondsToSelector: @selector(windowShouldZoom:toFrame:)]) { if (![self windowShouldZoom: self toFrame: maxRect]) return; } if (_autosaveName != nil) { [self saveFrameUsingName: _autosaveName]; } [self setFrame: maxRect display: YES]; } /* * Default botton */ - (NSButtonCell *) defaultButtonCell { return _defaultButtonCell; } - (void) setDefaultButtonCell: (NSButtonCell *)aCell { ASSIGN(_defaultButtonCell, aCell); _f.default_button_cell_key_disabled = NO; [aCell setKeyEquivalent: @"\r"]; [aCell setKeyEquivalentModifierMask: 0]; } - (void) disableKeyEquivalentForDefaultButtonCell { _f.default_button_cell_key_disabled = YES; } - (void) enableKeyEquivalentForDefaultButtonCell { _f.default_button_cell_key_disabled = NO; } - (NSArray *) childWindows { return _children; } - (void) addChildWindow: (NSWindow *)child ordered: (NSWindowOrderingMode)place { if (_children == nil) { _children = [[NSMutableArray alloc] init]; } [_children addObject: child]; [child setParentWindow: self]; } - (void) removeChildWindow: (NSWindow *)child { [_children removeObject: child]; [child setParentWindow: nil]; } - (NSWindow *) parentWindow { return _parent; } - (void) setParentWindow: (NSWindow *)window { _parent = window; if (_windowNum) { [GSServerForWindow(self) setParentWindow: [_parent windowNumber] forChildWindow: _windowNum]; } } - (BOOL) allowsToolTipsWhenApplicationIsInactive { return _f.allows_tooltips_when_inactive; } - (void) setAllowsToolTipsWhenApplicationIsInactive: (BOOL)flag { _f.allows_tooltips_when_inactive = flag; } - (BOOL) isMovableByWindowBackground { return _f.is_movable_by_window_background; } - (void) setMovableByWindowBackground: (BOOL)flag { _f.is_movable_by_window_background = flag; } - (BOOL) displaysWhenScreenProfileChanges { return _f.displays_when_screen_profile_changes; } - (void) setDisplaysWhenScreenProfileChanges: (BOOL)flag { _f.displays_when_screen_profile_changes = flag; } /* * Menu item validation */ - (BOOL) validateUserInterfaceItem: (id )anItem { BOOL result = YES; SEL action = [anItem action]; if (sel_isEqual(action, @selector(performClose:))) { result = ([self styleMask] & NSClosableWindowMask) ? YES : NO; } else if (sel_isEqual(action, @selector(performMiniaturize:))) { result = ([self styleMask] & NSMiniaturizableWindowMask) ? YES : NO; } else if (sel_isEqual(action, @selector(performZoom:))) { result = ([self styleMask] & NSResizableWindowMask) ? YES : NO; } else if (sel_isEqual(action, @selector(undo:))) { NSUndoManager *undo = [_firstResponder undoManager]; if (undo == nil) { result = NO; } else { result = [undo canUndo]; if ([(id)anItem respondsToSelector: @selector(setTitle:)]) { if (result) [(id)anItem setTitle: [undo undoMenuItemTitle]]; else [(id)anItem setTitle: [undo undoMenuTitleForUndoActionName: @""]]; } } } else if (sel_isEqual(action, @selector(redo:))) { NSUndoManager *undo = [_firstResponder undoManager]; if (undo == nil) { result = NO; } else { result = [undo canRedo]; if ([(id)anItem respondsToSelector: @selector(setTitle:)]) { if (result) [(id)anItem setTitle: [undo redoMenuItemTitle]]; else [(id)anItem setTitle: [undo redoMenuTitleForUndoActionName: @""]]; } } } else if (sel_isEqual(action, @selector(toggleToolbarShown:))) { NSToolbar *toolbar = [self toolbar]; if (toolbar == nil) { result = NO; } else { result = YES; if ([(id)anItem respondsToSelector: @selector(setTitle:)]) { if ([toolbar isVisible]) [(id)anItem setTitle: _(@"Hide Toolbar")]; else [(id)anItem setTitle: _(@"Show Toolbar")]; } } } else if (sel_isEqual(action, @selector(runToolbarCustomizationPalette:))) { NSToolbar *toolbar = [self toolbar]; if (toolbar == nil) { result = NO; } else { result = [toolbar allowsUserCustomization]; } } return result; } - (BOOL) validateMenuItem: (NSMenuItem *)anItem { return [self validateUserInterfaceItem: anItem]; } /* * Assigning a delegate */ /** Returns the delegate. */ - (id) delegate { return _delegate; } /** Sets the delegate to anObject. */ - (void) setDelegate: (id)anObject { if (anObject == _delegate) { // don't remove previously registered notifications if delegate is unchanged! return; } if (_delegate) { [nc removeObserver: _delegate name: nil object: self]; } _delegate = anObject; #define SET_DELEGATE_NOTIFICATION(notif_name) \ if ([_delegate respondsToSelector: @selector(window##notif_name:)]) \ [nc addObserver: _delegate \ selector: @selector(window##notif_name:) \ name: NSWindow##notif_name##Notification object: self] SET_DELEGATE_NOTIFICATION(DidBecomeKey); SET_DELEGATE_NOTIFICATION(DidBecomeMain); SET_DELEGATE_NOTIFICATION(DidChangeScreen); SET_DELEGATE_NOTIFICATION(DidDeminiaturize); SET_DELEGATE_NOTIFICATION(DidExpose); SET_DELEGATE_NOTIFICATION(DidMiniaturize); SET_DELEGATE_NOTIFICATION(DidMove); SET_DELEGATE_NOTIFICATION(DidResignKey); SET_DELEGATE_NOTIFICATION(DidResignMain); SET_DELEGATE_NOTIFICATION(DidResize); SET_DELEGATE_NOTIFICATION(DidUpdate); SET_DELEGATE_NOTIFICATION(WillClose); SET_DELEGATE_NOTIFICATION(WillMiniaturize); SET_DELEGATE_NOTIFICATION(WillMove); } /* * NSCoding protocol */ - (void) encodeWithCoder: (NSCoder*)aCoder { BOOL flag; // If were're being initialized from a keyed coder... if ([aCoder allowsKeyedCoding]) { // The docs indicate that there should be an error when directly encoding with // a keyed coding archiver. We should only encode NSWindow and subclasses // using NSWindowTemplate. [NSException raise: NSInvalidArgumentException format: @"Keyed coding not implemented for %@.", NSStringFromClass([self class])]; } [super encodeWithCoder: aCoder]; [aCoder encodeRect: [[self contentView] frame]]; [aCoder encodeValueOfObjCType: @encode(NSUInteger) at: &_styleMask]; // This used to be int, we need to stay compatible [aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_backingType]; [aCoder encodePoint: NSMakePoint(NSMinX([self frame]), NSMaxY([self frame]))]; [aCoder encodeObject: _contentView]; [aCoder encodeObject: _backgroundColor]; [aCoder encodeObject: _representedFilename]; [aCoder encodeObject: _miniaturizedTitle]; [aCoder encodeObject: _windowTitle]; [aCoder encodeSize: _minimumSize]; [aCoder encodeSize: _maximumSize]; [aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_windowLevel]; flag = _f.menu_exclude; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _f.is_one_shot; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _f.is_autodisplay; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _f.optimize_drawing; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _f.dynamic_depth_limit; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _f.cursor_rects_enabled; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _f.is_released_when_closed; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _f.hides_on_deactivate; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _f.accepts_mouse_moved; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; [aCoder encodeObject: _miniaturizedImage]; [aCoder encodeConditionalObject: _initialFirstResponder]; } - (id) initWithCoder: (NSCoder*)aDecoder { id oldself = self; BOOL flag; // If were're being initialized from a keyed coder... if ([aDecoder allowsKeyedCoding]) { // The docs indicate that there should be an error when directly encoding with // a keyed coding archiver. We should only encode NSWindow and subclasses // using NSWindowTemplate. [NSException raise: NSInvalidArgumentException format: @"Keyed coding not implemented for %@.", NSStringFromClass([self class])]; } if ((self = [super initWithCoder: aDecoder]) == oldself) { NSSize aSize; NSRect aRect; NSPoint p; NSUInteger aStyle; NSBackingStoreType aBacking; NSInteger level; id obj; aRect = [aDecoder decodeRect]; [aDecoder decodeValueOfObjCType: @encode(NSUInteger) at: &aStyle]; // This used to be int, we need to stay compatible [aDecoder decodeValueOfObjCType: @encode(NSInteger) at: &aBacking]; // call the designated initializer.... self = [self initWithContentRect: aRect styleMask: aStyle backing: aBacking defer: NO]; p = [aDecoder decodePoint]; obj = [aDecoder decodeObject]; [self setContentView: obj]; obj = [aDecoder decodeObject]; [self setBackgroundColor: obj]; obj = [aDecoder decodeObject]; [self setRepresentedFilename: obj]; obj = [aDecoder decodeObject]; [self setMiniwindowTitle: obj]; obj = [aDecoder decodeObject]; [self setTitle: obj]; aSize = [aDecoder decodeSize]; [self setMinSize: aSize]; aSize = [aDecoder decodeSize]; [self setMaxSize: aSize]; [aDecoder decodeValueOfObjCType: @encode(NSInteger) at: &level]; [self setLevel: level]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; [self setExcludedFromWindowsMenu: flag]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; [self setOneShot: flag]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; [self setAutodisplay: flag]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; [self useOptimizedDrawing: flag]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; [self setDynamicDepthLimit: flag]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; if (flag) [self enableCursorRects]; else [self disableCursorRects]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; [self setReleasedWhenClosed: flag]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; [self setHidesOnDeactivate: flag]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; [self setAcceptsMouseMovedEvents: flag]; /* If the image has been specified, use it, if not use the default. */ obj = [aDecoder decodeObject]; if (obj != nil) { ASSIGN(_miniaturizedImage, obj); } [aDecoder decodeValueOfObjCType: @encode(id) at: &_initialFirstResponder]; [self setFrameTopLeftPoint: p]; } return self; } - (void) bind: (NSString *)binding toObject: (id)anObject withKeyPath: (NSString *)keyPath options: (NSDictionary *)options { if ([binding isEqual: NSTitleBinding]) { GSKeyValueBinding *kvb; [self unbind: binding]; kvb = [[GSKeyValueBinding alloc] initWithBinding: @"title" withName: NSTitleBinding toObject: anObject withKeyPath: keyPath options: options fromObject: self]; // The binding will be retained in the binding table RELEASE(kvb); } else { [super bind: binding toObject: anObject withKeyPath: keyPath options: options]; } } /** Returns all drawers associated with this window. */ - (NSArray *) drawers { // TODO NSLog(@"Method %s is not implemented for class %s", "drawers", "NSWindow"); return nil; } - (void *)windowRef { GSDisplayServer *srv = GSServerForWindow(self); return [srv windowDevice: _windowNum]; } - (void *) windowHandle { // Should only be defined on MS Windows return (void *)(intptr_t)_windowNum; } - (NSWindow *) attachedSheet { return _attachedSheet; } @end @implementation NSWindow (Toolbar) - (void) runToolbarCustomizationPalette: (id)sender { [[self toolbar] runCustomizationPalette: sender]; } - (void) toggleToolbarShown: (id)sender { NSToolbar *toolbar = [self toolbar]; BOOL isVisible = [toolbar isVisible]; if (!toolbar) return; // We do this again on a lower level, but doing it here is faster. if (isVisible) { [_wv removeToolbarView: [toolbar _toolbarView]]; } else { [_wv addToolbarView: [toolbar _toolbarView]]; } [toolbar setVisible: !isVisible]; [self display]; } // Accessors - (NSToolbar *) toolbar { return _toolbar; } - (void) setToolbar: (NSToolbar*)toolbar { if (toolbar == _toolbar) return; if (_toolbar != nil) { if ([_toolbar isVisible]) { // Throw the last toolbar view out [_wv removeToolbarView: [_toolbar _toolbarView]]; } } ASSIGN(_toolbar, toolbar); if (_toolbar != nil) { if ([_toolbar isVisible]) { // Make the new toolbar view visible [_wv addToolbarView: [_toolbar _toolbarView]]; } } // To show the changed toolbar [self displayIfNeeded]; } @end @implementation NSWindow (Menu) - (void) setMenu: (NSMenu *)menu { // Do theme specific logic... [[GSTheme theme] setMenu: menu forWindow: self]; if([self menu] != menu) [super setMenu: menu]; } @end /* * GNUstep backend methods */ @implementation NSWindow (GNUstepBackend) /* * Mouse capture/release */ - (void) _captureMouse: sender { NSDebugLLog(@"CaptureMouse", @"Capturing the mouse"); [GSCurrentServer() capturemouse: _windowNum]; } - (void) _releaseMouse: sender { NSDebugLLog(@"CaptureMouse", @"Releasing the mouse"); [GSCurrentServer() releasemouse]; } - (void) _setVisible: (BOOL)flag { _f.visible = flag; } - (void) performDeminiaturize: sender { [self deminiaturize: sender]; } /* * Allow subclasses to init without the backend * class attempting to create an actual window */ - (void) _initDefaults { _firstResponder = self; // _initialFirstResponder = nil; // _delegate = nil; // _windowNum = 0; // _gstate = 0; _backgroundColor = RETAIN([NSColor windowBackgroundColor]); _representedFilename = @"Window"; _miniaturizedTitle = @"Window"; _miniaturizedImage = RETAIN([NSApp applicationIconImage]); _windowTitle = @"Window"; _lastPoint = NSZeroPoint; _windowLevel = NSNormalWindowLevel; _depthLimit = NSDefaultDepth; _disableFlushWindow = 0; _alphaValue = 1.0; // _f.accepts_drag = NO; // _f.is_one_shot = NO; // _f.needs_flush = NO; _f.is_autodisplay = YES; // _f.optimize_drawing = NO; _f.dynamic_depth_limit = YES; // _f.cursor_rects_enabled = NO; // _f.cursor_rects_valid = NO; // _f.visible = NO; // _f.is_key = NO; // _f.is_main = NO; // _f.is_edited = NO; _f.is_released_when_closed = YES; // _f.is_miniaturized = NO; // _f.menu_exclude = NO; // _f.hides_on_deactivate = NO; // _f.accepts_mouse_moved = NO; // _f.has_opened = NO; // _f.has_closed = NO; // _f.default_button_cell_key_disabled = NO; _f.can_hide = YES; // _f.has_shadow = NO; _f.is_opaque = YES; _f.views_need_display = YES; _f.selectionDirection = NSDirectSelection; } @end @implementation NSWindow (GNUstepTextView) - (id) _futureFirstResponder { return _futureFirstResponder; } @end @implementation NSApplication(Inactive) - (BOOL) _isWindowInactive: (NSWindow *)window { return [_inactive containsObject: window]; } - (void) _setWindow: (NSWindow *)window inactive: (BOOL)inactive { if (inactive) { [_inactive addObject: window]; } else { [_inactive removeObject: window]; } } @end BOOL GSViewAcceptsDrag(NSView *v, id dragInfo) { NSPasteboard *pb = [dragInfo draggingPasteboard]; if ([pb availableTypeFromArray: GSGetDragTypes(v)]) return YES; return NO; } void NSCountWindows(NSInteger *count) { *count = [[GSCurrentServer() windowlist] count]; } void NSWindowList(NSInteger size, NSInteger list[]) { NSArray *windowList = [GSCurrentServer() windowlist]; NSUInteger i, c; for (i = 0, c = [windowList count]; i < size && i < c; i++) { list[i] = [[windowList objectAtIndex: i] integerValue]; } } NSArray *GSOrderedWindows(void) { NSArray *window_list = [GSCurrentServer() windowlist]; NSMutableArray *ret = [NSMutableArray array]; NSUInteger i, c; for (i = 0, c = [window_list count]; i < c; i++) { NSInteger windowNumber = [[window_list objectAtIndex: i] integerValue]; NSWindow *win = GSWindowWithNumber(windowNumber); [ret addObject: win]; } return ret; } NSArray* GSAllWindows(void) { if (windowmaps) return NSAllMapTableValues(windowmaps); return nil; } NSWindow* GSWindowWithNumber(NSInteger num) { if (windowmaps) return (NSWindow*)NSMapGet(windowmaps, (void*)(intptr_t)num); return nil; } gnustep-gui-0.24.0/Source/NSSlider.m0000664000076500007650000002325612110256537017055 0ustar brains99brains99/** NSSlider Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: September 1997 Author: Felipe A. Rodriguez Date: August 1998 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "math.h" // fabs #import #import "AppKit/NSEvent.h" #import "AppKit/NSSlider.h" #import "AppKit/NSSliderCell.h" /** Class Description

An NSSlider displays, and allows control of, some value in the application. It represents a continuous stream of values of type float, which can be retrieved by the method floatValue and set by the method setFloatValue:.

This control is a continuous control. It sends its action message as long as the user is manipulating it. This can be changed by passing NO to the setContinuous: message of a given NSSlider.

Although methods for adding and managing a title are provided, the slider's knob can cover this title, so it is recommended that a label be added near the slider, for identification.

As with many controls, NSSlider relies on its cell counterpart, NSSliderCell. For more information, please see the specification for NSSliderCell.

Use of an NSSlider to do the role of an NSScroller is not recommended. A scroller is intended to represent the visible portion of a view, whereas a slider is intended to represent some value.

*/ @implementation NSSlider static Class cellClass; + (void) initialize { if (self == [NSSlider class]) { // Initial version [self setVersion: 1]; // Set our cell class to NSSliderCell [self setCellClass: [NSSliderCell class]]; } } + (void) setCellClass: (Class)class { cellClass = class; } + (Class) cellClass { return cellClass; } - (id) initWithFrame: (NSRect)frameRect { self = [super initWithFrame: frameRect]; if (self == nil) return nil; [_cell setState: 1]; [_cell setContinuous: YES]; return self; } - (BOOL) isFlipped { return YES; } /**

Returns the value by which the slider will be incremented if the user holds down the ALT key.

See Also: -setAltIncrementValue:

*/ - (double) altIncrementValue { return [_cell altIncrementValue]; } /**

Returns the image drawn in the slider's track. Returns nil if this has not been set.

See Also: -setImage:

*/ - (NSImage *) image { return [_cell image]; } /** Returns whether or not the slider is vertical. If, for some reason, this cannot be determined, for such reasons as the slider is not yet displayed, this method returns -1. Generally, a slider is considered vertical if its height is greater than its width. */ - (NSInteger) isVertical { return [_cell isVertical]; } /** Returns the thickness of the slider's knob. This value is in pixels, and is the size of the knob along the slider's track. */ - (CGFloat) knobThickness { return [_cell knobThickness]; } /**

Sets the value by which the slider will be incremented, when the ALT key is held down, to increment.

See Also: -altIncrementValue

*/ - (void) setAltIncrementValue: (double)increment { [_cell setAltIncrementValue: increment]; } /**

Sets the image to be displayed in the slider's track to barImage.

See Also: -image

*/ - (void) setImage: (NSImage *)backgroundImage { [_cell setImage: backgroundImage]; } /**

Sets the thickness of the knob to aFloat, in pixels. This value sets the amount of space which the knob takes up in the slider's track.

See Also: -knobThickness

*/ - (void) setKnobThickness: (CGFloat)aFloat { [_cell setKnobThickness: aFloat]; } /**

Sets the title of the slider to aString. This title is displayed on the slider's track, behind the knob.

See Also: -title

*/ - (void) setTitle: (NSString *)aString { [_cell setTitle: aString]; } /**

Sets the cell used to draw the title to aCell.

See Also: -titleCell

*/ - (void) setTitleCell: (NSCell *)aCell { [_cell setTitleCell: aCell]; } /**

Sets the colour with which the title will be drawn to aColor.

See Also -titleColor

*/ - (void) setTitleColor: (NSColor *)aColor { [_cell setTitleColor: aColor]; } /**

Sets the font with which the title will be drawm to fontObject.

See Also: -titleFont

*/ - (void) setTitleFont: (NSFont *)fontObject { [_cell setTitleFont: fontObject]; } /**

Returns the title of the slider as an NSString.

See Also: -setTitle:

*/ - (NSString *) title { return [_cell title]; } /**

Returns the cell used to draw the title.

See Also: -setTitleCell:

*/ - (id) titleCell { return [_cell titleCell]; } /**

Returns the colour used to draw the title.

See Also: -setTitleColor:

*/ - (NSColor *) titleColor { return [_cell titleColor]; } /**

Returns the font used to draw the title.

See Also: -setTitleFont:

*/ - (NSFont *) titleFont { return [_cell titleFont]; } /**

Returns the maximum value that the slider represents.

See Also: -setMaxValue:

*/ - (double) maxValue { return [_cell maxValue]; } /**

Returns the minimum value that the slider represents.

See Also: -setMinValue:

*/ - (double) minValue { return [_cell minValue]; } /**

Sets the maximum value that the sliders represents to aDouble.

See Also: -maxValue

*/ - (void) setMaxValue: (double)aDouble { [_cell setMaxValue: aDouble]; } /**

Sets the minimum value that the slider represents to aDouble.

See Also: -minValue

*/ - (void) setMinValue: (double)aDouble { [_cell setMinValue: aDouble]; } /** Returns YES by default. This will allow the first click sent to the slider, when in an inactive window, to both bring the window into focus and manipulate the slider. */ - (BOOL) acceptsFirstMouse: (NSEvent *)theEvent { return YES; } - (void) keyDown: (NSEvent *)ev { NSString *characters = [ev characters]; int i, length = [characters length]; double value = [self doubleValue]; double min = [_cell minValue]; double max = [_cell maxValue]; double altValue = [_cell altIncrementValue]; NSUInteger alt_down = ([ev modifierFlags] & NSAlternateKeyMask); BOOL only_ticks = [_cell allowsTickMarkValuesOnly]; BOOL valueChanged = NO; double diff; if (alt_down && altValue != -1) { diff = altValue; } else if (only_ticks) { if ([_cell numberOfTickMarks]) { double tick0 = [_cell tickMarkValueAtIndex: 0]; double tick1 = [_cell tickMarkValueAtIndex: 1]; diff = tick1 - tick0; } else { diff = 0.0; } } else { diff = fabs(min - max) / 20; } for (i = 0; i < length; i++) { switch ([characters characterAtIndex: i]) { case NSLeftArrowFunctionKey: case NSDownArrowFunctionKey: value -= diff; valueChanged = YES; break; case NSUpArrowFunctionKey: case NSRightArrowFunctionKey: value += diff; valueChanged = YES; break; case NSPageDownFunctionKey: value -= diff * 2; valueChanged = YES; break; case NSPageUpFunctionKey: value += diff * 2; valueChanged = YES; break; case NSHomeFunctionKey: value = min; valueChanged = YES; break; case NSEndFunctionKey: value = max; valueChanged = YES; break; } } if (valueChanged) { if (only_ticks) value = [_cell closestTickMarkValueToValue: value]; if (value < min) { value = min; } else if (value > max) { value = max; } [self setDoubleValue: value]; [self sendAction: [self action] to: [self target]]; return; } [super keyDown: ev]; } // ticks - (BOOL) allowsTickMarkValuesOnly { return [_cell allowsTickMarkValuesOnly]; } - (double) closestTickMarkValueToValue: (double)aValue { return [_cell closestTickMarkValueToValue: aValue]; } - (NSInteger) indexOfTickMarkAtPoint: (NSPoint)point { return [_cell indexOfTickMarkAtPoint: point]; } - (NSInteger) numberOfTickMarks { return [_cell numberOfTickMarks]; } - (NSRect) rectOfTickMarkAtIndex: (NSInteger)index { return [_cell rectOfTickMarkAtIndex: index]; } - (void) setAllowsTickMarkValuesOnly: (BOOL)flag { [_cell setAllowsTickMarkValuesOnly: flag]; } - (void) setNumberOfTickMarks: (NSInteger)numberOfTickMarks { [_cell setNumberOfTickMarks: numberOfTickMarks]; } - (void) setTickMarkPosition: (NSTickMarkPosition)position { [_cell setTickMarkPosition: position]; } - (NSTickMarkPosition) tickMarkPosition { return [_cell tickMarkPosition]; } - (double) tickMarkValueAtIndex: (NSInteger)index { return [_cell tickMarkValueAtIndex: index]; } @end gnustep-gui-0.24.0/Source/NSImageView.m0000664000076500007650000002143411705631651017507 0ustar brains99brains99/** NSImageView Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: January 1998 Updated by: Jonathan Gapen Date: May 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "AppKit/NSDragging.h" #import "AppKit/NSEvent.h" #import "AppKit/NSImage.h" #import "AppKit/NSImageCell.h" #import "AppKit/NSImageView.h" #import "AppKit/NSMenuItem.h" #import "AppKit/NSPasteboard.h" #import "AppKit/NSWindow.h" /* * Class variables */ static Class usedCellClass; static Class imageCellClass; @implementation NSImageView // // Class methods // + (void) initialize { if (self == [NSImageView class]) { [self setVersion: 2]; imageCellClass = [NSImageCell class]; usedCellClass = imageCellClass; } } /* * Setting the Cell class */ + (Class) cellClass { return usedCellClass; } + (void) setCellClass: (Class)factoryId { usedCellClass = factoryId ? factoryId : imageCellClass; } - (id) initWithFrame: (NSRect)aFrame { self = [super initWithFrame: aFrame]; if (!self) return self; // set the default values [self setImageAlignment: NSImageAlignCenter]; [self setImageFrameStyle: NSImageFrameNone]; [self setImageScaling: NSScaleProportionally]; [self setEditable: NO]; return self; } - (void) setImage: (NSImage *)image { [_cell setImage: image]; [self updateCell: _cell]; } - (void) setImageAlignment: (NSImageAlignment)align { [_cell setImageAlignment: align]; [self updateCell: _cell]; } - (void) setImageScaling: (NSImageScaling)scaling { [_cell setImageScaling: scaling]; [self updateCell: _cell]; } - (void) setImageFrameStyle: (NSImageFrameStyle)style { [_cell setImageFrameStyle: style]; [self updateCell: _cell]; } - (void) setEditable: (BOOL)flag { [_cell setEditable: flag]; if (flag) { [self registerForDraggedTypes: [NSImage imagePasteboardTypes]]; } else { [self unregisterDraggedTypes]; } } - (NSImage *) image { return [_cell image]; } - (NSImageAlignment) imageAlignment { return [_cell imageAlignment]; } - (NSImageScaling) imageScaling { return [_cell imageScaling]; } - (NSImageFrameStyle) imageFrameStyle { return [_cell imageFrameStyle]; } - (BOOL) isEditable { return [_cell isEditable]; } - (BOOL) animates { // FIXME: Should be passed on to cell. return NO; } - (void) setAnimates: (BOOL) flag { // FIXME: Should be passed on to cell. } - (BOOL) allowsCutCopyPaste { return _ivflags.allowsCutCopyPaste; } - (void) setAllowsCutCopyPaste: (BOOL)flag { _ivflags.allowsCutCopyPaste = flag; } - (void) delete: (id)sender { if ([self allowsCutCopyPaste]) [self setImage: nil]; } - (void) deleteBackward: (id)sender { if ([self allowsCutCopyPaste]) [self setImage: nil]; } - (void) copy: (id)sender { if ([self allowsCutCopyPaste]) { NSImage *anImage = [self image]; if (anImage != nil) { // copy to pasteboard NSPasteboard *pboard = [NSPasteboard generalPasteboard]; [pboard declareTypes: [NSArray arrayWithObject: NSTIFFPboardType] owner: self]; [pboard setData: [anImage TIFFRepresentation] forType: NSTIFFPboardType]; } } } - (void) cut: (id)sender { if ([self allowsCutCopyPaste]) { [self copy: sender]; [self setImage: nil]; } } - (void) paste: (id)sender { if ([self allowsCutCopyPaste]) { // paste from pasteboard NSPasteboard *pboard = [NSPasteboard generalPasteboard]; NSImage *image = [[NSImage alloc] initWithPasteboard: pboard]; if (image != nil) { [self setImage: image]; RELEASE(image); } } } - (BOOL) validateUserInterfaceItem: (id )anItem { SEL action = [anItem action]; if ([self allowsCutCopyPaste]) { if (sel_isEqual(action, @selector(cut:)) || sel_isEqual(action, @selector(copy:)) || sel_isEqual(action, @selector(deleteBackward:)) || sel_isEqual(action, @selector(delete:))) return [self image] != nil; if (sel_isEqual(action, @selector(paste:))) { return [NSImage canInitWithPasteboard: [NSPasteboard generalPasteboard]]; } } return NO; } - (BOOL) validateMenuItem: (NSMenuItem *)anItem { return [self validateUserInterfaceItem: anItem]; } - (NSDragOperation) draggingEntered: (id )sender { if (([sender draggingSource] != self) && ([self isEditable]) && ([NSImage canInitWithPasteboard: [sender draggingPasteboard]])) { [_cell setHighlighted: YES]; return NSDragOperationCopy; } else { return NSDragOperationNone; } } // NSDraggingDestination protocol - (void) draggingExited: (id )sender { [_cell setHighlighted: NO]; } - (BOOL) prepareForDragOperation: (id )sender { if (([sender draggingSource] != self) && ([self isEditable])) { return YES; } else { return NO; } } - (BOOL) performDragOperation: (id )sender { NSImage *image; image = [[NSImage alloc] initWithPasteboard: [sender draggingPasteboard]]; if (image == nil) { return NO; } else { [self setImage: image]; [self sendAction: _action to: _target]; RELEASE(image); return YES; } } - (void) concludeDragOperation: (id )sender { [_cell setHighlighted: NO]; } - (void) mouseDown: (NSEvent*)theEvent { if ([self initiatesDrag]) { NSPasteboard *pboard; NSImage *anImage = [self image]; if (anImage != nil) { pboard = [NSPasteboard pasteboardWithName: NSDragPboard]; [pboard declareTypes: [NSArray arrayWithObject: NSTIFFPboardType] owner: self]; if ([pboard setData: [anImage TIFFRepresentation] forType: NSTIFFPboardType]) { NSSize s; NSPoint p; // Center the image on the mouse position ... is this right? s = [anImage size]; p = [theEvent locationInWindow]; p.x -= s.width/2; p.y -= s.height/2; [_window dragImage: anImage at: p offset: NSMakeSize(0, 0) event: theEvent pasteboard: pboard source: self slideBack: YES]; return; } } } [super mouseDown: theEvent]; } - (NSDragOperation) draggingSourceOperationMaskForLocal: (BOOL)isLocal { return NSDragOperationCopy; } // // Target and Action // // Target and action are handled by NSImageView itself, not its own cell. // - (id) target { return _target; } - (void) setTarget: (id)anObject { _target = anObject; } - (SEL) action { return _action; } - (void) setAction: (SEL)aSelector { _action = aSelector; } // // NSCoding Protocol // - (void) encodeWithCoder: (NSCoder *)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { [aCoder encodeObject: [NSImage imagePasteboardTypes] forKey: @"NSDragTypes"]; [aCoder encodeBool: [self isEditable] forKey: @"NSEditable"]; } else { [aCoder encodeConditionalObject: _target]; [aCoder encodeValueOfObjCType: @encode(SEL) at: &_action]; } } - (id) initWithCoder: (NSCoder *)aDecoder { self = [super initWithCoder: aDecoder]; if (!self) return self; if ([aDecoder allowsKeyedCoding]) { //NSArray *dragType = [aDecoder decodeObjectForKey: @"NSDragTypes"]; if ([aDecoder containsValueForKey: @"NSEditable"]) { [self setEditable: [aDecoder decodeBoolForKey: @"NSEditable"]]; } } else { if ([aDecoder versionForClassName: @"NSImageView"] >= 2) { _target = [aDecoder decodeObject]; [aDecoder decodeValueOfObjCType: @encode(SEL) at: &_action]; } } return self; } @end @implementation NSImageView (GNUstep) - (BOOL)initiatesDrag { return _ivflags.initiatesDrag; } - (void)setInitiatesDrag: (BOOL)flag { _ivflags.initiatesDrag = flag; } @end gnustep-gui-0.24.0/Source/NSTrackingArea.m0000664000076500007650000000501512243757125020165 0ustar brains99brains99/* NSTrackingArea.h Track mouse movements in and out of a rectangle on screen. Copyright (C) 2013 Free Software Foundation, Inc. Written by: Gregory Casamento Date: September 2013 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import "AppKit/NSTrackingArea.h" #import "GNUstepGUI/GSTrackingRect.h" @implementation NSTrackingArea - (id)initWithRect: (NSRect)rect options: (NSTrackingAreaOptions)options owner: (id)owner userInfo: (NSDictionary *)userInfo { if ((self = [super init]) != nil) { BOOL flag = (BOOL)(options & NSTrackingAssumeInside); _userInfo = RETAIN(_userInfo); _options = options; _trackingRect = [[GSTrackingRect alloc] initWithRect:rect tag:0 owner:owner userData:(void *)userInfo inside:flag]; } return self; } - (void) dealloc { [_userInfo release]; [_trackingRect release]; [super dealloc]; } - (NSTrackingAreaOptions) options { return _options; } - (id) owner { return [_trackingRect owner]; } - (NSRect) rect { return [_trackingRect rectangle]; } - (NSDictionary *) userInfo { return _userInfo; } - (void) encodeWithCoder: (NSCoder *)coder { // [super encodeWithCoder:coder]; } - (id) initWithCoder: (NSCoder *)coder { //[super initWithCoder:coder]; return self; } - (id) copyWithZone: (NSZone *)zone { NSRect rect = [self rect]; NSTrackingAreaOptions options = [self options]; id owner = [self owner]; id info = [self userInfo]; NSTrackingArea *newArea = [[NSTrackingArea allocWithZone:zone] initWithRect: rect options: options owner: owner userInfo: info]; return newArea; } @end gnustep-gui-0.24.0/Source/NSTreeController.m0000664000076500007650000001365712204466636020611 0ustar brains99brains99/* NSTreeController.h The tree controller class. Copyright (C) 2012 Free Software Foundation, Inc. Author: Gregory Casamento Date: 2012 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* NSTreeController.h The tree controller class. Copyright (C) 2012 Free Software Foundation, Inc. Author: Gregory Casamento Date: 2012 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import @implementation NSTreeController - (id) initWithContent: (id)content { if ((self = [super initWithContent: content]) != nil) { } return self; } - (void) dealloc { RELEASE(_childrenKeyPath); RELEASE(_countKeyPath); RELEASE(_leafKeyPath); RELEASE(_sortDescriptors); [super dealloc]; } - (BOOL) addSelectionIndexPaths: (NSArray*)indexPaths { // FIXME return NO; } - (BOOL) alwaysUsesMultipleValuesMarker { return _alwaysUsesMultipleValuesMarker; } - (BOOL) avoidsEmptySelection { return _avoidsEmptySelection; } - (BOOL) canAddChid { // FIXME return NO; } - (BOOL) canInsert { // FIXME return NO; } - (BOOL) canInsertChild { // FIXME return NO; } - (BOOL) preservesSelection { return _preservesSelection; } - (BOOL) selectsInsertedObjects { return _selectsInsertedObjects; } - (BOOL) setSelectionIndexPath: (NSIndexPath*)indexPath { // FIXME return NO; } - (BOOL) setSelectionIndexPaths: (NSArray*)indexPaths { // FIXME return NO; } - (id) arrangedObjects { // FIXME return nil; } - (id) content { // FIXME return [super content]; } - (NSArray*) selectedObjects { // FIXME return [super selectedObjects]; } - (NSIndexPath*) selectionIndexPath { // FIXME return nil; } - (NSArray*) selectionIndexPaths { // FIXME return nil; } - (NSArray*) sortDescriptors { return _sortDescriptors; } - (NSString*) childrenKeyPath { return _childrenKeyPath; } - (NSString*) countKeyPath { return _countKeyPath;; } - (NSString*) leafKeyPath { return _leafKeyPath; } - (void) addChild: (id)sender { // FIXME } - (void) add: (id)sender { // FIXME [super add: sender]; } - (void) insertChild: (id)sender { // FIXME } - (void) insertObject: (id)object atArrangedObjectIndexPath: (NSIndexPath*)indexPath { // FIXME } - (void) insertObjects: (NSArray*)objects atArrangedObjectIndexPaths: (NSArray*)indexPaths { // FIXME } - (void) insert: (id)sender { // FIXME } - (void) rearrangeObjects { // FIXME } - (void) removeObjectAtArrangedObjectIndexPath: (NSIndexPath*)indexPath { // FIXME } - (void) removeObjectsAtArrangedObjectIndexPaths: (NSArray*)indexPaths { // FIXME } - (void) removeSelectionIndexPaths: (NSArray*)indexPaths { // FIXME } - (void) remove: (id)sender { // FIXME [super remove: sender]; } - (void) setAlwaysUsesMultipleValuesMarker: (BOOL)flag { _alwaysUsesMultipleValuesMarker = flag; } - (void) setAvoidsEmptySelection: (BOOL)flag { _avoidsEmptySelection = flag; } - (void) setChildrenKeyPath: (NSString*)path { ASSIGN(_childrenKeyPath, path); } - (void) setContent: (id)content { // FIXME [super setContent: content]; } - (void) setCountKeyPath: (NSString*)path { ASSIGN(_countKeyPath, path); } - (void) setLeafPathKey: (NSString*)key { ASSIGN(_leafKeyPath, key); } - (void) setPreservesSelection: (BOOL)flag { _preservesSelection = flag; } - (void) setSelectsInsertedObjects: (BOOL)flag { _selectsInsertedObjects = flag; } - (void) setSortDescriptors: (NSArray*)descriptors { ASSIGN(_sortDescriptors, descriptors); } - (NSString*) childrenKeyPathForNode: (NSTreeNode*)node { // FIXME return nil; } - (NSString*) countKeyPathForNode: (NSTreeNode*)node { // FIXME return nil; } - (NSString*) leafKeyPathForNode: (NSTreeNode*)node { // FIXME return nil; } - (void) moveNode: (NSTreeNode*)node toIndexPath: (NSIndexPath*)indexPath { // FIXME } - (void) moveNodes: (NSArray*)nodes toIndexPath: (NSIndexPath*)startingIndexPath { // FIXME } - (NSArray*) selectedNodes { // FIXME return nil; } - (id) initWithCoder: (NSCoder*)coder { return self; } - (void) encodeWithCoder: (NSCoder*)coder { // Do nothing... } - (id) copyWithZone: (NSZone*)zone { return [self retain]; } @end gnustep-gui-0.24.0/Source/NSTableHeaderCell.m0000664000076500007650000000711712223423224020563 0ustar brains99brains99/** NSTableHeaderCell Copyright (C) 1999 Free Software Foundation, Inc. Author: Nicola Pero Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "AppKit/NSColor.h" #import "AppKit/NSFont.h" #import "AppKit/NSImage.h" #import "AppKit/NSTableHeaderCell.h" #import "GNUstepGUI/GSTheme.h" @implementation NSTableHeaderCell // Default appearance of NSTableHeaderCell - (id) initTextCell: (NSString *)aString { self = [super initTextCell: aString]; if (!self) return nil; [self setAlignment: NSCenterTextAlignment]; [self setTextColor: [[GSTheme theme] tableHeaderTextColorForState: GSThemeNormalState]]; [self setBackgroundColor: [NSColor controlShadowColor]]; [self setDrawsBackground: YES]; [self setFont: [NSFont titleBarFontOfSize: 0]]; [self setWraps: NO]; // This is not exactly true _cell.is_bezeled = YES; _cell.is_bordered = NO; return self; } - (NSRect) drawingRectForBounds: (NSRect)theRect { return [[GSTheme theme] tableHeaderCellDrawingRectForBounds: theRect]; } - (void) _drawBorderAndBackgroundWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { GSThemeControlState state; if (_cell.is_highlighted == YES) { state = GSThemeHighlightedState; } else { state = GSThemeNormalState; } [[GSTheme theme] drawTableHeaderCell: self withFrame: cellFrame inView: controlView state: state]; } - (void) drawSortIndicatorWithFrame: (NSRect)cellFrame inView: (NSView *)controlView ascending: (BOOL)ascending priority: (int)priority { NSImage *img; cellFrame = [self sortIndicatorRectForBounds: cellFrame]; if (ascending) img = [NSImage imageNamed: @"NSAscendingSortIndicator"]; else img = [NSImage imageNamed: @"NSDescendingSortIndicator"]; [img drawAtPoint: cellFrame.origin fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0]; } - (NSRect) sortIndicatorRectForBounds: (NSRect)theRect { NSImage *img = [NSImage imageNamed: @"NSAscendingSortIndicator"]; NSSize size = [img size]; theRect.origin.x = NSMaxX(theRect) - size.width; theRect.size = size; return theRect; } - (void) setHighlighted: (BOOL)flag { _cell.is_highlighted = flag; if (flag == YES) { [self setBackgroundColor: [NSColor controlHighlightColor]]; [self setTextColor: [[GSTheme theme] tableHeaderTextColorForState: GSThemeHighlightedState]]; } else { [self setBackgroundColor: [NSColor controlShadowColor]]; [self setTextColor: [[GSTheme theme] tableHeaderTextColorForState: GSThemeNormalState]]; } } @end gnustep-gui-0.24.0/Source/GSImageMagickImageRep.m0000664000076500007650000001505311607211116021362 0ustar brains99brains99/** GSImageMagickImageRep ImageMagick image representation. Copyright (C) 2011 Free Software Foundation, Inc. Author: Eric Wasylishen Date: June 2011 This file is part of the GNUstep Application Kit Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import #import #import #import #import #import #import "AppKit/NSBitmapImageRep.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSPasteboard.h" #import "AppKit/NSGraphicsContext.h" #import "GNUstepGUI/GSImageMagickImageRep.h" #if HAVE_IMAGEMAGICK #include @implementation GSImageMagickImageRep + (void) initialize { NSArray *argv = [[NSProcessInfo processInfo] arguments]; MagickCoreGenesis([[argv objectAtIndex: 0] UTF8String], 0); } // Private methods + (NSBitmapImageRep *) imageRepWithImageMagickImage: (Image *)image { ExceptionInfo *exception = AcquireExceptionInfo(); MagickBooleanType success; NSBitmapImageRep *bmp = [[[self alloc] initWithBitmapDataPlanes: NULL pixelsWide: image->columns pixelsHigh: image->rows bitsPerSample: 8 samplesPerPixel: 4 hasAlpha: YES isPlanar: NO colorSpaceName: NSDeviceRGBColorSpace bitmapFormat: NSAlphaNonpremultipliedBitmapFormat bytesPerRow: image->columns * 4 bitsPerPixel: 32] autorelease]; // Set the resolution metadata if (image->units == PixelsPerInchResolution || image->units == PixelsPerCentimeterResolution) { NSSize res; if (image->units == PixelsPerCentimeterResolution) { res = NSMakeSize(image->x_resolution * 2.54, image->y_resolution * 2.54); } else { res = NSMakeSize(image->x_resolution, image->y_resolution); } if (res.width > 0 && res.height > 0) { const NSSize sizeInPoints = NSMakeSize(((CGFloat)image->columns / res.width) * 72.0, ((CGFloat)image->rows / res.height) * 72.0); [bmp setSize: sizeInPoints]; } } // Copy the pixel data to the NSBitmapImageRep success = ExportImagePixels(image, 0, 0, image->columns, image->rows, "RGBA", CharPixel, [bmp bitmapData], exception); if (!success || exception->severity != UndefinedException) { bmp = nil; } DestroyExceptionInfo(exception); return bmp; } + (NSArray*) imageRepsWithData: (NSData *)data allImages: (BOOL)allImages { NSMutableArray *reps = [NSMutableArray array]; ExceptionInfo *exception = AcquireExceptionInfo(); ImageInfo *imageinfo = CloneImageInfo(NULL); Image *images, *image; // Set the background color to transparent // (otherwise SVG's are rendered against a white background by default) QueryColorDatabase("none", &imageinfo->background_color, exception); images = BlobToImage(imageinfo, [data bytes], [data length], exception); if (exception->severity != UndefinedException) { NSWarnLog(@"ImageMagick: %s", GetLocaleExceptionMessage(exception->severity, exception->reason)); } for (image = images; image != NULL; image = image->next) { NSBitmapImageRep *bmp = [[self class] imageRepWithImageMagickImage: image]; if (bmp != nil) { [reps addObject: bmp]; } if (!allImages) { break; } } DestroyExceptionInfo(exception); DestroyImageInfo(imageinfo); if (images != NULL) { DestroyImage(images); } return reps; } // NSImageRep overrides + (BOOL) canInitWithData: (NSData *)data { char buf[32]; ExceptionInfo *exception; const MagicInfo *info; memset(buf, 0, 32); [data getBytes: buf length: 32]; exception = AcquireExceptionInfo(); info = GetMagicInfo((const unsigned char *)buf, 32, exception); DestroyExceptionInfo(exception); return (info != NULL); } + (NSArray *) imageUnfilteredFileTypes { static NSArray *types = nil; if (types == nil) { NSMutableArray *array = [NSMutableArray array]; size_t size = 0; ExceptionInfo *exception = AcquireExceptionInfo(); const MagickInfo **list = GetMagickInfoList("*", &size, exception); size_t i; for (i=0; iname] lowercaseString]]; } RelinquishMagickMemory(list); DestroyExceptionInfo(exception); types = [[NSArray alloc] initWithArray: array]; } return types; } + (NSArray *) imageUnfilteredPasteboardTypes { static NSArray *types = nil; if (types == nil) { NSMutableArray *array = [NSMutableArray array]; NSDictionary *fileTypeToPboardType = [NSDictionary dictionaryWithObjectsAndKeys: NSPostScriptPboardType, @"ps", NSPDFPboardType, @"pdf", NSPICTPboardType, @"pict", NSTIFFPboardType, @"tiff", nil]; NSEnumerator *enumerator = [[self imageUnfilteredFileTypes] objectEnumerator]; NSString *fileType; while (nil != (fileType = [enumerator nextObject])) { NSString *pboardType = [fileTypeToPboardType objectForKey: fileType]; if (pboardType != nil) { [array addObject: pboardType]; } } types = [[NSArray alloc] initWithArray: array]; } return types; } // NSBitmapImageRep overrides + (id) imageRepWithData: (NSData *)data { return [[[self alloc] initWithData: data] autorelease]; } - (id) initWithData: (NSData *)data { NSArray *reps = [[self class] imageRepsWithData: data allImages: NO]; [self release]; if ([reps count] != 0) { return [[reps objectAtIndex: 0] retain]; } else { return nil; } } + (NSArray *) imageRepsWithData: (NSData *)data { return [self imageRepsWithData: data allImages: YES]; } @end #endif gnustep-gui-0.24.0/Source/NSSelection.m0000664000076500007650000001474511534147002017556 0ustar brains99brains99/** NSSelection NSSelection is used by NSDataLink to refer to a selection within a document. Copyright (C) 1996 Free Software Foundation, Inc. Author: Gregory John Casamento Date: 2001 Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import #import #import "AppKit/NSSelection.h" #import "AppKit/NSPasteboard.h" // // Global instances of these selections // static NSSelection *_sharedAllSelection = nil; static NSSelection *_sharedCurrentSelection = nil; static NSSelection *_sharedEmptySelection = nil; // Private methods and variables for NSSelection typedef enum { GSCustomSelection, GSAllSelection, GSCurrentSelection, GSEmptySelection } GSSelectionType; @interface NSSelection (PrivateMethods) - (void)_setIsWellKnownSelection: (BOOL)wellknown; - (GSSelectionType)_selectionType; - (void)_setSelectionType: (GSSelectionType)type; + (NSSelection *)_wellKnownSelection: (char *)description; @end @implementation NSSelection (PrivateMethods) - (void)_setIsWellKnownSelection: (BOOL)wellknown { _isWellKnownSelection = wellknown; } - (void)_setSelectionType: (GSSelectionType)type { _selectionType = type; } - (GSSelectionType)_selectionType { return _selectionType; } + (NSSelection *)_wellKnownSelection: (char *)description { NSData *selectionData = [NSData dataWithBytes: description length: strlen(description)]; NSSelection *selection = [NSSelection selectionWithDescriptionData: selectionData]; [selection _setIsWellKnownSelection: YES]; return selection; } @end @implementation NSSelection // // Class methods // + (void)initialize { if (self == [NSSelection class]) { // Initial version [self setVersion: 0]; } } // // Returning Special Selection Shared Instances // // // NOTE: The description returned for each of these is similar to the one // returned under OPENSTEP. // + (NSSelection *)allSelection { if (!_sharedAllSelection) { _sharedAllSelection = [NSSelection _wellKnownSelection: "GNUstep All selection marker"]; [_sharedEmptySelection _setSelectionType: GSAllSelection]; } return _sharedAllSelection; } + (NSSelection *)currentSelection { if (!_sharedCurrentSelection) { _sharedCurrentSelection = [NSSelection _wellKnownSelection: "GNUstep Current selection marker"]; [_sharedCurrentSelection _setSelectionType: GSCurrentSelection]; } return _sharedCurrentSelection; } + (NSSelection *)emptySelection { if (!_sharedEmptySelection) { _sharedEmptySelection = [NSSelection _wellKnownSelection: "GNUstep Empty selection marker"]; [_sharedEmptySelection _setSelectionType: GSEmptySelection]; } return _sharedEmptySelection; } // // Creating and Initializing a Selection // + (NSSelection *)selectionWithDescriptionData:(NSData *)data { NSSelection *selection = AUTORELEASE([[NSSelection alloc] initWithDescriptionData: data]); return selection; } // // Instance methods // // // Creating and Initializing a Selection // - (id)initWithDescriptionData:(NSData *)newData { [super init]; ASSIGN(_descriptionData, newData); _isWellKnownSelection = NO; _selectionType = GSCustomSelection; return self; } - (id)initWithPasteboard:(NSPasteboard *)pasteboard { [super init]; ASSIGN(_descriptionData, [pasteboard dataForType: NSGeneralPboardType]); _isWellKnownSelection = NO; return self; } - (void) dealloc { RELEASE(_descriptionData); [super dealloc]; } // // Describing a Selection // - (NSData *)descriptionData { return _descriptionData; } - (BOOL)isWellKnownSelection { return _isWellKnownSelection; } // // Writing a Selection to the Pasteboard // - (void)writeToPasteboard:(NSPasteboard *)pasteboard { [pasteboard setData: _descriptionData forType: NSGeneralPboardType]; } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { [aCoder encodeBool: _isWellKnownSelection forKey: @"GSIsWellKnownSelection"]; [aCoder encodeBool: _selectionType forKey: @"GSSelectionType"]; [aCoder encodeObject: _descriptionData forKey: @"GSDescriptionData"]; } else { [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isWellKnownSelection]; [aCoder encodeValueOfObjCType: @encode(int) at: &_selectionType]; [aCoder encodeValueOfObjCType: @encode(id) at: _descriptionData]; } } - (id) initWithCoder: (NSCoder*)aDecoder { [super init]; if ([aDecoder allowsKeyedCoding]) { _isWellKnownSelection = [aDecoder decodeBoolForKey: @"GSIsWellKnownSelection"]; _selectionType = [aDecoder decodeIntForKey: @"GSSelectionType"]; ASSIGN(_descriptionData, [aDecoder decodeObjectForKey: @"GSDescriptionData"]); } else { id obj; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isWellKnownSelection]; [aDecoder decodeValueOfObjCType: @encode(int) at: &_selectionType]; [aDecoder decodeValueOfObjCType: @encode(id) at: &obj]; ASSIGN(_descriptionData, obj); } // if it's a well known selection then determine which one it is. if (_isWellKnownSelection) { switch(_selectionType) { case GSAllSelection: RELEASE(self); self = RETAIN([NSSelection allSelection]); break; case GSCurrentSelection: RELEASE(self); self = RETAIN([NSSelection currentSelection]); break; case GSEmptySelection: RELEASE(self); self = RETAIN([NSSelection emptySelection]); break; default: // Shouldn't get here. break; } } return self; } @end gnustep-gui-0.24.0/Source/GSModelLoaderFactory.m0000664000076500007650000001236512246625344021350 0ustar brains99brains99/** GSModelLoaderFactory Model loader framework Copyright (C) 1997, 1999 Free Software Foundation, Inc. Author: Gregory John Casamento Date: 2005 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import #import #import #import #import #import #import "GNUstepGUI/GSModelLoaderFactory.h" @implementation GSModelLoader + (NSString *) type { return nil; } + (float) priority { return 0.0; } - (BOOL) loadModelData: (NSData *)data externalNameTable: (NSDictionary *)context withZone: (NSZone *)zone { [NSException raise: NSInternalInconsistencyException format: @"Abstract model loader."]; return NO; } - (BOOL) loadModelFile: (NSString *)fileName externalNameTable: (NSDictionary *)context withZone: (NSZone *)zone { NSData *data = [self dataForFile: fileName]; if (data != nil) { BOOL loaded = [self loadModelData: data externalNameTable: context withZone: zone]; if (!loaded) NSLog(@"Could not load Nib file: %@", fileName); return loaded; } else { return NO; } } - (NSData *) dataForFile: (NSString *)fileName { return [NSData dataWithContentsOfFile: fileName]; } + (NSComparisonResult) _comparePriority: (Class)loader { NSComparisonResult result = NSOrderedSame; if ([self priority] < [loader priority]) { result = NSOrderedAscending; } if ([self priority] > [loader priority]) { result = NSOrderedDescending; } return result; } @end static NSMutableDictionary *_modelMap = nil; @implementation GSModelLoaderFactory + (void) initialize { NSArray *classes = GSObjCAllSubclassesOfClass([GSModelLoader class]); NSEnumerator *en = [classes objectEnumerator]; Class cls = nil; while ((cls = [en nextObject]) != nil) { [self registerModelLoaderClass: cls]; } } + (void) registerModelLoaderClass: (Class)aClass { if (_modelMap == nil) { _modelMap = [[NSMutableDictionary alloc] initWithCapacity: 5]; } [_modelMap setObject: aClass forKey: (NSString *)[aClass type]]; } + (Class)classForType: (NSString *)type { return [_modelMap objectForKey: type]; } + (NSArray *) supportedTypes { NSArray *objectArray = [_modelMap allValues]; NSArray *sortedArray = [objectArray sortedArrayUsingSelector: @selector(_comparePriority:)]; NSEnumerator *oen = [sortedArray objectEnumerator]; Class cls = nil; NSMutableArray *types = [[NSMutableArray alloc] init]; while ((cls = [oen nextObject]) != nil) { [types addObject: [cls type]]; } return AUTORELEASE(types); } + (NSString *) supportedModelFileAtPath: (NSString *)modelPath { NSString *result = nil; NSFileManager *mgr = [NSFileManager defaultManager]; NSString *ext = [modelPath pathExtension]; if ([ext isEqual: @""]) { NSArray *objectArray = [_modelMap allValues]; NSArray *sortedArray = [objectArray sortedArrayUsingSelector: @selector(_comparePriority:)]; NSEnumerator *oen = [sortedArray objectEnumerator]; Class cls = nil; while ((cls = [oen nextObject]) != nil && result == NO) { NSString *path = [modelPath stringByAppendingPathExtension: (NSString *)[cls type]]; if ([mgr isReadableFileAtPath: path]) { result = path; } } } else { if ([_modelMap objectForKey: ext] != nil) { if ([mgr isReadableFileAtPath: modelPath]) { result = modelPath; } } } return result; } + (GSModelLoader *) modelLoaderForFileType: (NSString *)type { Class aClass = [GSModelLoaderFactory classForType: type]; GSModelLoader *loader = nil; if (aClass != nil) { loader = AUTORELEASE([[aClass alloc] init]); } else { [NSException raise: NSInternalInconsistencyException format: @"Unable to find model loader class."]; } return loader; } + (GSModelLoader *) modelLoaderForFileName: (NSString *)modelPath { NSString *path = [GSModelLoaderFactory supportedModelFileAtPath: modelPath]; GSModelLoader *result = nil; if (path != nil) { NSString *ext = [path pathExtension]; result = [self modelLoaderForFileType: ext]; } return result; } @end gnustep-gui-0.24.0/Source/tiff.m0000664000076500007650000004154011554126532016320 0ustar brains99brains99/* tiff.m Functions for dealing with tiff images. Copyright (C) 1996,1999-2010 Free Software Foundation, Inc. Author: Adam Fedor Date: Feb 1996 Support for writing tiffs: Richard Frith-Macdonald This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Code in NSTiffRead, NSTiffGetInfo, and NSTiffGetColormap is derived from tif_getimage, by Sam Leffler. See the copyright below. */ /* * Copyright (c) 1991, 1992, 1993, 1994 Sam Leffler * Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. * * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ #include "config.h" #include "nsimage-tiff.h" #import #import #import #import #import #import "GSGuiPrivate.h" #include #include #include #ifndef __WIN32__ #include /* for L_SET, etc definitions */ #endif /* !__WIN32__ */ typedef struct { char* data; long size; long position; char mode; char **outdata; long *outposition; } chandle_t; static int tiff_error_handler_set = 0; static void NSTiffError(const char *func, const char *msg, va_list ap) { NSString *format; format = [NSString stringWithFormat: @"Tiff Error (%s) %s", func, msg]; NSLogv (format, ap); } static void NSTiffWarning(const char *func, const char *msg, va_list ap) { NSString *format; format = [NSString stringWithFormat: @"Tiff Warning (%s) %s", func, msg]; format = [NSString stringWithFormat: format arguments: ap]; NSDebugLLog (@"NSTiff", @"%@", format); } /* Client functions that provide reading/writing of data for libtiff */ static tsize_t TiffHandleRead(thandle_t handle, tdata_t buf, tsize_t count) { chandle_t* chand = (chandle_t *)handle; if (chand->position >= chand->size) return 0; if (chand->position + count > chand->size) count = chand->size - chand->position; memcpy(buf, chand->data + chand->position, count); return count; } static tsize_t TiffHandleWrite(thandle_t handle, tdata_t buf, tsize_t count) { chandle_t* chand = (chandle_t *)handle; if (chand->mode == 'r') return 0; if (chand->position + count > chand->size) { chand->size = chand->position + count + 1; chand->data = realloc(chand->data, chand->size); *(chand->outdata) = chand->data; if (chand->data == NULL) return 0; } memcpy(chand->data + chand->position, buf, count); chand->position += count; if (chand->position > *(chand->outposition)) *(chand->outposition) = chand->position; return count; } static toff_t TiffHandleSeek(thandle_t handle, toff_t offset, int mode) { chandle_t* chand = (chandle_t *)handle; switch(mode) { case SEEK_SET: chand->position = offset; break; case SEEK_CUR: chand->position += offset; break; case SEEK_END: if (offset > 0 && chand->mode == 'r') return 0; chand->position += offset; break; break; } return chand->position; } static int TiffHandleClose(thandle_t handle) { chandle_t* chand = (chandle_t *)handle; /* Presumably, we don't need the handle anymore */ free(chand); return 0; } static toff_t TiffHandleSize(thandle_t handle) { chandle_t* chand = (chandle_t *)handle; return chand->size; } static int TiffHandleMap(thandle_t handle, tdata_t* data, toff_t* size) { chandle_t* chand = (chandle_t *)handle; *data = chand->data; *size = chand->size; return 1; } static void TiffHandleUnmap(thandle_t handle, tdata_t data, toff_t size) { /* Nothing to unmap. */ } /* Open a tiff from a stream. Returns NULL if can't read tiff information. */ TIFF* NSTiffOpenDataRead(const char* data, long size) { chandle_t* handle; if (tiff_error_handler_set == 0) { tiff_error_handler_set = 1; TIFFSetErrorHandler(NSTiffError); TIFFSetWarningHandler(NSTiffWarning); } handle = malloc(sizeof(chandle_t)); handle->data = (char*)data; handle->outdata = 0; handle->position = 0; handle->outposition = 0; handle->size = size; handle->mode = 'r'; return TIFFClientOpen("GSTiffReadData", "r", (thandle_t)handle, TiffHandleRead, TiffHandleWrite, TiffHandleSeek, TiffHandleClose, TiffHandleSize, TiffHandleMap, TiffHandleUnmap); } TIFF* NSTiffOpenDataWrite(char **data, long *size) { chandle_t* handle; handle = malloc(sizeof(chandle_t)); handle->data = *data; handle->outdata = data; handle->position = 0; handle->outposition = size; handle->size = *size; handle->mode = 'w'; return TIFFClientOpen("GSTiffWriteData", "w", (thandle_t)handle, TiffHandleRead, TiffHandleWrite, TiffHandleSeek, TiffHandleClose, TiffHandleSize, TiffHandleMap, TiffHandleUnmap); } int NSTiffClose(TIFF* image) { TIFFClose(image); return 0; } int NSTiffGetImageCount(TIFF* image) { int dircount = 1; if (image == NULL) return 0; while (TIFFReadDirectory(image)) { dircount++; } return dircount; } /* Read some information about the image. Note that currently we don't determine numImages. */ NSTiffInfo * NSTiffGetInfo(int imageNumber, TIFF* image) { NSTiffInfo* info; uint16 *sample_info = NULL; if (image == NULL) return NULL; info = malloc(sizeof(NSTiffInfo)); memset(info, 0, sizeof(NSTiffInfo)); if (imageNumber >= 0) { if (TIFFSetDirectory(image, imageNumber) == 0) return NULL; info->imageNumber = imageNumber; } TIFFGetField(image, TIFFTAG_IMAGEWIDTH, &info->width); TIFFGetField(image, TIFFTAG_IMAGELENGTH, &info->height); TIFFGetField(image, TIFFTAG_COMPRESSION, &info->compression); if (info->compression == COMPRESSION_JPEG) TIFFGetField(image, TIFFTAG_JPEGQUALITY, &info->quality); TIFFGetField(image, TIFFTAG_SUBFILETYPE, &info->subfileType); TIFFGetField(image, TIFFTAG_EXTRASAMPLES, &info->extraSamples, &sample_info); info->extraSamples = (info->extraSamples == 1 && ((sample_info[0] == EXTRASAMPLE_ASSOCALPHA) || (sample_info[0] == EXTRASAMPLE_UNASSALPHA))); info->assocAlpha = (info->extraSamples == 1 && sample_info[0] == EXTRASAMPLE_ASSOCALPHA); /* If the following tags aren't present then use the TIFF defaults. */ TIFFGetFieldDefaulted(image, TIFFTAG_BITSPERSAMPLE, &info->bitsPerSample); TIFFGetFieldDefaulted(image, TIFFTAG_SAMPLESPERPIXEL, &info->samplesPerPixel); TIFFGetFieldDefaulted(image, TIFFTAG_PLANARCONFIG, &info->planarConfig); /* If TIFFTAG_PHOTOMETRIC is not present then assign a reasonable default. The TIFF 5.0 specification doesn't give a default. */ if (!TIFFGetField(image, TIFFTAG_PHOTOMETRIC, &info->photoInterp)) { switch (info->samplesPerPixel) { case 1: info->photoInterp = PHOTOMETRIC_MINISBLACK; break; case 3: case 4: info->photoInterp = PHOTOMETRIC_RGB; break; default: TIFFError(TIFFFileName(image), "Missing needed \"PhotometricInterpretation\" tag"); return NULL; } TIFFError(TIFFFileName(image), "No \"PhotometricInterpretation\" tag, assuming %s\n", info->photoInterp == PHOTOMETRIC_RGB ? "RGB" : "min-is-black"); } { uint16 resolution_unit; float xres, yres; if (TIFFGetField(image, TIFFTAG_XRESOLUTION, &xres) && TIFFGetField(image, TIFFTAG_YRESOLUTION, &yres)) { TIFFGetFieldDefaulted(image, TIFFTAG_RESOLUTIONUNIT, &resolution_unit); if (resolution_unit == 2) // Inch { info->xdpi = xres; info->ydpi = yres; } else if (resolution_unit == 3) // Centimeter { info->xdpi = xres * 2.54; info->ydpi = yres * 2.54; } } } return info; } #define READ_SCANLINE(sample) \ if (TIFFReadScanline(image, buf, row, sample) != 1) \ { \ error = 1; \ break; \ } /* Read an image into a data array. The data array is assumed to have been already allocated to the correct size. Note that palette images are implicitly coverted to 24-bit contig direct color images. Thus the data array should be large enough to hold this information. */ int NSTiffRead(TIFF *image, NSTiffInfo *info, unsigned char *data) { int i; unsigned int row, col; int error = 0; uint8* outP; uint8* buf; uint8* raster; NSTiffColormap* map; int scan_line_size; if (data == NULL) return -1; map = NULL; if (info->photoInterp == PHOTOMETRIC_PALETTE) { map = NSTiffGetColormap(image); if (!map) return -1; } scan_line_size = TIFFScanlineSize(image); buf = _TIFFmalloc(scan_line_size); raster = (uint8 *)data; outP = raster; switch (info->photoInterp) { case PHOTOMETRIC_MINISBLACK: case PHOTOMETRIC_MINISWHITE: if (info->planarConfig == PLANARCONFIG_CONTIG) { for (row = 0; row < info->height; ++row) { READ_SCANLINE(0); memcpy(outP, buf, scan_line_size); outP += scan_line_size; } } else { for (i = 0; i < info->samplesPerPixel; i++) for (row = 0; row < info->height; ++row) { READ_SCANLINE(i); memcpy(outP, buf, scan_line_size); outP += scan_line_size; } } break; case PHOTOMETRIC_PALETTE: { for (row = 0; row < info->height; ++row) { uint8 *inP; READ_SCANLINE(0); inP = buf; for (col = 0; col < info->width; col++) { *outP++ = map->red[*inP] / 256; *outP++ = map->green[*inP] / 256; *outP++ = map->blue[*inP] / 256; inP++; } } free(map); } break; case PHOTOMETRIC_RGB: if (info->planarConfig == PLANARCONFIG_CONTIG) { for (row = 0; row < info->height; ++row) { READ_SCANLINE(0); memcpy(outP, buf, scan_line_size); outP += scan_line_size; } } else { for (i = 0; i < info->samplesPerPixel; i++) for (row = 0; row < info->height; ++row) { READ_SCANLINE(i); memcpy(outP, buf, scan_line_size); outP += scan_line_size; } } break; default: NSLog(@"Tiff: reading photometric %d not supported", info->photoInterp); error = 1; break; } _TIFFfree(buf); return error; } #define WRITE_SCANLINE(sample) \ if (TIFFWriteScanline(image, buf, row, sample) != 1) { \ error = 1; \ break; \ } int NSTiffWrite(TIFF *image, NSTiffInfo *info, unsigned char *data) { tdata_t buf = (tdata_t)data; uint16 sample_info[2]; int i; unsigned int row; int error = 0; int scan_line_size; TIFFSetField(image, TIFFTAG_IMAGEWIDTH, info->width); TIFFSetField(image, TIFFTAG_IMAGELENGTH, info->height); TIFFSetField(image, TIFFTAG_COMPRESSION, info->compression); if (info->compression == COMPRESSION_JPEG) TIFFSetField(image, TIFFTAG_JPEGQUALITY, info->quality); TIFFSetField(image, TIFFTAG_SUBFILETYPE, info->subfileType); TIFFSetField(image, TIFFTAG_BITSPERSAMPLE, info->bitsPerSample); TIFFSetField(image, TIFFTAG_SAMPLESPERPIXEL, info->samplesPerPixel); TIFFSetField(image, TIFFTAG_PLANARCONFIG, info->planarConfig); TIFFSetField(image, TIFFTAG_PHOTOMETRIC, info->photoInterp); if (info->assocAlpha) sample_info[0] = EXTRASAMPLE_ASSOCALPHA; else sample_info[0] = EXTRASAMPLE_UNASSALPHA; TIFFSetField(image, TIFFTAG_EXTRASAMPLES, info->extraSamples, sample_info); scan_line_size = TIFFScanlineSize(image); switch (info->photoInterp) { case PHOTOMETRIC_MINISBLACK: case PHOTOMETRIC_MINISWHITE: if (info->planarConfig == PLANARCONFIG_CONTIG) { for (row = 0; row < info->height; ++row) { WRITE_SCANLINE(0) buf += scan_line_size; } } else { for (i = 0; i < info->samplesPerPixel; i++) { for (row = 0; row < info->height; ++row) { WRITE_SCANLINE(i) buf += scan_line_size; } } } break; case PHOTOMETRIC_RGB: if (info->planarConfig == PLANARCONFIG_CONTIG) { for (row = 0; row < info->height; ++row) { WRITE_SCANLINE(0) buf += scan_line_size; } } else { for (i = 0; i < info->samplesPerPixel; i++) { for (row = 0; row < info->height; ++row) { WRITE_SCANLINE(i) buf += scan_line_size; } } } break; default: NSLog(@"Tiff: photometric %d for image %s not supported", info->photoInterp, TIFFFileName(image)); return -1; break; } return error; } /*------------------------------------------------------------------------*/ /* Many programs get TIFF colormaps wrong. They use 8-bit colormaps instead of 16-bit colormaps. This function is a heuristic to detect and correct this. */ static int CheckAndCorrectColormap(NSTiffColormap* map) { register unsigned int i; for (i = 0; i < map->size; i++) if ((map->red[i] > 255)||(map->green[i] > 255)||(map->blue[i] > 255)) return 16; #define CVT(x) (((x) * 255) / ((1L<<16)-1)) for (i = 0; i < map->size; i++) { map->red[i] = CVT(map->red[i]); map->green[i] = CVT(map->green[i]); map->blue[i] = CVT(map->blue[i]); } return 8; } /* Gets the colormap for the image if there is one. Returns a NSTiffColormap if one was found. */ NSTiffColormap * NSTiffGetColormap(TIFF* image) { NSTiffInfo* info; NSTiffColormap* map; /* Re-read the tiff information. We pass -1 as the image number which means just read the current image. */ info = NSTiffGetInfo(-1, image); if (info->photoInterp != PHOTOMETRIC_PALETTE) return NULL; map = malloc(sizeof(NSTiffColormap)); map->size = 1 << info->bitsPerSample; if (!TIFFGetField(image, TIFFTAG_COLORMAP, &map->red, &map->green, &map->blue)) { TIFFError(TIFFFileName(image), "Missing required \"Colormap\" tag"); free(map); return NULL; } if (CheckAndCorrectColormap(map) == 8) TIFFWarning(TIFFFileName(image), "Assuming 8-bit colormap"); free(info); return map; } int NSTiffIsCodecConfigured(unsigned int codec) { #if (TIFFLIB_VERSION >= 20041016) // starting with version 3.7.0 we can ask libtiff what it is configured to do return TIFFIsCODECConfigured(codec); #else // we check the tiffconf.h #include #ifndef CCITT_SUPPORT # define CCITT_SUPPORT 0 #else # define CCITT_SUPPORT 1 #endif #ifndef PACKBITS_SUPPORT # define PACKBITS_SUPPORT 0 #else # define PACKBITS_SUPPORT 1 #endif #ifndef OJPEG_SUPPORT # define OJPEG_SUPPORT 0 #else # define OJPEG_SUPPORT 1 #endif #ifndef LZW_SUPPORT # define LZW_SUPPORT 0 #else # define LZW_SUPPORT 1 #endif #ifndef NEXT_SUPPORT # define NEXT_SUPPORT 0 #else # define NEXT_SUPPORT 1 #endif #ifndef JPEG_SUPPORT # define JPEG_SUPPORT 0 #else # define JPEG_SUPPORT 1 #endif /* If this fails, your libtiff is obsolete! Come to think of it * if you even are compiling this part your libtiff is obsolete. */ switch (codec) { case COMPRESSION_NONE: return 1; case COMPRESSION_CCITTFAX3: return CCITT_SUPPORT; case COMPRESSION_CCITTFAX4: return CCITT_SUPPORT; case COMPRESSION_JPEG: return JPEG_SUPPORT; case COMPRESSION_PACKBITS: return PACKBITS_SUPPORT; case COMPRESSION_OJPEG: return OJPEG_SUPPORT; case COMPRESSION_LZW: return LZW_SUPPORT; case COMPRESSION_NEXT: return NEXT_SUPPORT; default: return 0; } #endif } gnustep-gui-0.24.0/Source/NSTokenFieldCell.m0000664000076500007650000000502711534147002020446 0ustar brains99brains99/** NSTokenFieldCell Cell class for the token field entry control Copyright (C) 2008 Free Software Foundation, Inc. Author: Gregory Casamento Date: July 2008 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import #import #import "AppKit/NSControl.h" #import "AppKit/NSEvent.h" #import "AppKit/NSTokenField.h" #import "AppKit/NSTokenFieldCell.h" @implementation NSTokenFieldCell + (void) initialize { if (self == [NSTokenFieldCell class]) { [self setVersion: 1]; } } - (void) dealloc { RELEASE(tokenizingCharacterSet); [super dealloc]; } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { } else { } } - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if ([aDecoder allowsKeyedCoding]) { } else { } return self; } // Style... - (NSTokenStyle)tokenStyle { return tokenStyle; } - (void)setTokenStyle:(NSTokenStyle)style { tokenStyle = style; } // Completion delay... + (NSTimeInterval)defaultCompletionDelay { return 0; } - (NSTimeInterval)completionDelay { return completionDelay; } - (void)setCompletionDelay:(NSTimeInterval)delay { completionDelay = delay; } // Character set... + (NSCharacterSet *)defaultTokenizingCharacterSet { return [NSCharacterSet characterSetWithCharactersInString: @","]; } - (void)setTokenizingCharacterSet:(NSCharacterSet *)characterSet { ASSIGN(tokenizingCharacterSet, characterSet); } - (NSCharacterSet *)tokenizingCharacterSet { return tokenizingCharacterSet; } @end gnustep-gui-0.24.0/Source/GSPrintOperation.m0000664000076500007650000001116111537161034020570 0ustar brains99brains99/* GSPrintOperation.m Controls operations generating print jobs. Copyright (C) 1996,2004 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Fred Kiefer Date: November 2000 Started implementation. Author: Chad Hardin Date: June 2004 Modified for printing backend support, split off from NSPrintOperation.m 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import "AppKit/NSPrintPanel.h" #import "AppKit/NSPrintInfo.h" #import "AppKit/NSView.h" #import "AppKit/NSWorkspace.h" #import "GNUstepGUI/GSPrinting.h" #import "GNUstepGUI/GSPrintOperation.h" #import "GSGuiPrivate.h" /** Class Description

GSPrintOperation is a generic class that should be subclasses by printing backend classes for the purpose of controlling and sending print jobs to a printing system.

*/ @implementation GSPrintOperation /** Load the appropriate bundle for the PrintInfo (eg: GSLPRPrintInfo, GSCUPSPrintInfo). */ + (id) allocWithZone: (NSZone*) zone { Class principalClass; principalClass = [[GSPrinting printingBundle] principalClass]; if (principalClass == nil) return nil; return [[principalClass gsPrintOperationClass] allocWithZone: zone]; } - (id)initWithView:(NSView *)aView printInfo:(NSPrintInfo *)aPrintInfo { self = [self initWithView: aView insideRect: [aView bounds] toData: [NSMutableData data] printInfo: aPrintInfo]; [self setShowPanels: YES]; return self; } - (NSGraphicsContext*)createContext { [self subclassResponsibility: _cmd]; return nil; } /** / !!!Here is the method that will be overridden in the printer bundle */ - (BOOL) _deliverSpooledResult { [self subclassResponsibility: _cmd]; return NO; } - (BOOL) deliverResult { BOOL success; NSString *job; success = YES; job = [[self printInfo] jobDisposition]; if ([job isEqual: NSPrintPreviewJob]) { /* Check to see if there is a GNUstep app that can preview PS files. It's not likely at this point, so also check for a standards previewer, like gv. */ NSTask *task; NSString *preview; NSWorkspace *ws = [NSWorkspace sharedWorkspace]; [[self printPanel] _setStatusStringValue: @"Opening in previewer..."]; preview = [ws getBestAppInRole: @"Viewer" forExtension: @"ps"]; if (preview) { [ws openFile: _path withApplication: preview]; } else { NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; preview = [def objectForKey: @"NSPreviewApp"]; if (preview == nil || [preview length] == 0) preview = @"gv"; NS_DURING { task = AUTORELEASE([NSTask new]); [task setLaunchPath: preview]; [task setArguments: [NSArray arrayWithObject: _path]]; [task launch]; } NS_HANDLER { NSRunAlertPanel(_(@"Preview"), _(@"Problem running the preview application '%@' perhaps you need to set your NSPreviewApp user default"), _(@"Dismiss"), nil, nil, preview); } NS_ENDHANDLER } } else if ([job isEqual: NSPrintSpoolJob]) { success = [self _deliverSpooledResult]; } else if ([job isEqual: NSPrintFaxJob]) { } /* We can't remove the temp file because the previewer might still be using it, perhaps the printer is also? if (_path) { [[NSFileManager defaultManager] removeFileAtPath: _path handler: nil]; } */ return success; } @end gnustep-gui-0.24.0/Source/NSScroller.m0000664000076500007650000010325012247447445017424 0ustar brains99brains99/** NSScroller Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu A completely rewritten version of the original source by Scott Christley. Date: July 1997 Author: Felipe A. Rodriguez Date: August 1998 Author: Richard Frith-Macdonald Date: Mar 1999 - Use flipped views and make conform to spec 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #import #import #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSButtonCell.h" #import "AppKit/NSColor.h" #import "AppKit/NSEvent.h" #import "AppKit/NSImage.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSScroller.h" #import "AppKit/NSScrollView.h" #import "AppKit/NSWindow.h" #import "GNUstepGUI/GSTheme.h" /**

TODO Description

*/ @implementation NSScroller /* * Class variables */ /* button cells used by scroller instances to draw scroller buttons and knob. */ static NSButtonCell *upCell = nil; static NSButtonCell *downCell = nil; static NSButtonCell *leftCell = nil; static NSButtonCell *rightCell = nil; static NSCell *horizontalKnobCell = nil; static NSCell *verticalKnobCell = nil; static NSCell *horizontalKnobSlotCell = nil; static NSCell *verticalKnobSlotCell = nil; static CGFloat scrollerWidth = 0.0; /** * This is the amount (in userspace points) by which the knob slides over the * button ends of the track. Typical use would be to set it to 1 when both * the knob and the buttons have a 1-point border, so that when the knob is * at its maximum, it overlaps the button by 1 point giving a resulting * 1-point wide border. */ static CGFloat scrollerKnobOvershoot = 0.0; /* This is the distance by which buttons are offset inside the scroller slot. */ static float buttonsOffset = 1.0; // buttonsWidth = sw - 2*buttonsOffset + (void) _themeWillDeactivate: (NSNotification*)n { /* Clear cached information from the old theme ... will get info from * the new theme as required. */ scrollerWidth = 0.0; upCell = nil; downCell = nil; leftCell = nil; rightCell = nil; horizontalKnobCell = nil; verticalKnobCell = nil; horizontalKnobSlotCell = nil; verticalKnobSlotCell = nil; } /* * Class methods */ + (void) initialize { if (self == [NSScroller class]) { [self setVersion: 1]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_themeWillDeactivate:) name: GSThemeWillDeactivateNotification object: nil]; } } /**

Returns the NSScroller's width. By default 18.

Subclasses can override this to provide different scrollbar width. But you may need to also override -drawParts .

*/ + (CGFloat) scrollerWidth { return [self scrollerWidthForControlSize: NSRegularControlSize]; } + (CGFloat) scrollerWidthForControlSize: (NSControlSize)controlSize { // FIXME if (scrollerWidth == 0.0) { scrollerWidth = [[GSTheme theme] defaultScrollerWidth]; } return scrollerWidth; } - (BOOL) isFlipped { return YES; } - (BOOL) acceptsFirstMouse: (NSEvent *)theEvent { return YES; } - (BOOL) acceptsFirstResponder { return NO; } /**

Returns the position of the NSScroller's arrows used for scrolling By default the arrow position is set to NSScrollerArrowsMinEnd if the scrolletr is a horizontal scroller and NSScrollerArrowsMaxEnd if the scroller is a vertical scroller. See NSScrollArrowPosition for more informations.

See Also: -arrowsPosition

*/ - (NSScrollArrowPosition) arrowsPosition { return _arrowsPosition; } - (NSUsableScrollerParts) usableParts { return _usableParts; } /**

Returns a float value ( between 0.0 and 1.0 ) indicating the ratio between the NSScroller length and the knob length

*/ - (CGFloat) knobProportion { return _knobProportion; } /**

Returns the part of the NSScroller that have been hit ( mouse down ) See NSScrollerPart for more information

See Also: -highlight: [NSResponder-mouseDown:]

*/ - (NSScrollerPart) hitPart { return _hitPart; } - (double) doubleValue { return _doubleValue; } - (float) floatValue { return _doubleValue; } - (void) setAction: (SEL)action { _action = action; } - (SEL) action { return _action; } - (void) setTarget: (id)target { _target = target; } - (id) target { return _target; } - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { if (_target) { [aCoder encodeObject: _target forKey: @"NSTarget"]; } if (_action != NULL) { [aCoder encodeObject: NSStringFromSelector(_action) forKey: @"NSAction"]; } [aCoder encodeFloat: [self floatValue] forKey: @"NSCurValue"]; [aCoder encodeFloat: [self knobProportion] * 100.0 forKey: @"NSPercent"]; } else { BOOL flag; [aCoder encodeValueOfObjCType: @encode(NSUInteger) at: &_arrowsPosition]; flag = _scFlags.isEnabled; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; [aCoder encodeConditionalObject: _target]; [aCoder encodeValueOfObjCType: @encode(SEL) at: &_action]; /* We do not save float value, knob proportion. */ } } - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if(nil == self) return nil; if ([aDecoder allowsKeyedCoding]) { if (_frame.size.width > _frame.size.height) { _scFlags.isHorizontal = YES; } else { _scFlags.isHorizontal = NO; } if (_scFlags.isHorizontal) { _doubleValue = 0.0; } else { _doubleValue = 1.0; } if ([aDecoder containsValueForKey: @"NSAction"]) { NSString *action = [aDecoder decodeObjectForKey: @"NSAction"]; if (action != nil) { [self setAction: NSSelectorFromString(action)]; } } if ([aDecoder containsValueForKey: @"NSTarget"]) { id target = [aDecoder decodeObjectForKey: @"NSTarget"]; [self setTarget: target]; } if ([aDecoder containsValueForKey: @"NSCurValue"]) { float value = [aDecoder decodeFloatForKey: @"NSCurValue"]; [self setFloatValue: value]; } if ([aDecoder containsValueForKey: @"NSPercent"]) { float percent = [aDecoder decodeFloatForKey: @"NSPercent"]; [self setKnobProportion: percent / 100.0]; } if ([aDecoder containsValueForKey: @"NSsFlags"]) { int flags; flags = [aDecoder decodeIntForKey: @"NSsFlags"]; // is horiz is set above... [self setControlTint: ((flags >> 16) & 7)]; [self setArrowsPosition: ((flags >> 29) & 3)]; _usableParts = ((flags >> 27) & 3); } if ([aDecoder containsValueForKey: @"NSsFlags2"]) { int flags2; flags2 = [aDecoder decodeIntForKey: @"NSsFlags2"]; [self setControlSize: ((flags2 >> 26) & 3)]; } // setup... _hitPart = NSScrollerNoPart; [self drawParts]; [self checkSpaceForParts]; } else { BOOL flag; if (_frame.size.width > _frame.size.height) { _scFlags.isHorizontal = YES; } else { _scFlags.isHorizontal = NO; } if (_scFlags.isHorizontal) { _doubleValue = 0.0; } else { _doubleValue = 1.0; } [aDecoder decodeValueOfObjCType: @encode(NSUInteger) at: &_arrowsPosition]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _scFlags.isEnabled = flag; [aDecoder decodeValueOfObjCType: @encode(id) at: &_target]; // Undo RETAIN by decoder TEST_RELEASE(_target); [aDecoder decodeValueOfObjCType: @encode(SEL) at: &_action]; _hitPart = NSScrollerNoPart; [self drawParts]; [self checkSpaceForParts]; } return self; } - (BOOL) isOpaque { return YES; } - (id) initWithFrame: (NSRect)frameRect { BOOL isHorizontal; /* * determine the orientation of the scroller and adjust it's size accordingly */ if (frameRect.size.width > frameRect.size.height) { isHorizontal = YES; frameRect.size.height = [[self class] scrollerWidth]; } else { isHorizontal = NO; frameRect.size.width = [[self class] scrollerWidth]; } self = [super initWithFrame: frameRect]; if (!self) return nil; _scFlags.isHorizontal = isHorizontal; if (_scFlags.isHorizontal) { _arrowsPosition = NSScrollerArrowsMinEnd; _doubleValue = 0.0; } else { _arrowsPosition = NSScrollerArrowsMaxEnd; _doubleValue = 1.0; } _hitPart = NSScrollerNoPart; [self setEnabled: NO]; [self drawParts]; [self checkSpaceForParts]; return self; } /** * Cache images for scroll arrows and knob. If you override +scrollerWidth * you may need to override this as well (to provide images for the new * width). However, if you do so, you must currently also override * -drawArrow:highlight: and -drawKnob: . */ - (void) drawParts { NSUserDefaults *defs; GSTheme *theme; if (upCell) return; theme = [GSTheme theme]; defs = [NSUserDefaults standardUserDefaults]; if ([defs objectForKey: @"GSScrollerButtonsOffset"] != nil) { buttonsOffset = [defs floatForKey: @"GSScrollerButtonsOffset"]; } else { buttonsOffset = 1.0; } if ([defs objectForKey: @"GSScrollerKnobOvershoot"] != nil) { scrollerKnobOvershoot = [defs floatForKey: @"GSScrollerKnobOvershoot"]; } else { scrollerKnobOvershoot = 0.0; } upCell = [theme cellForScrollerArrow: NSScrollerDecrementArrow horizontal:NO]; downCell = [theme cellForScrollerArrow: NSScrollerIncrementArrow horizontal:NO]; leftCell = [theme cellForScrollerArrow: NSScrollerDecrementArrow horizontal:YES]; rightCell = [theme cellForScrollerArrow: NSScrollerIncrementArrow horizontal:YES]; verticalKnobCell = [theme cellForScrollerKnob: NO]; horizontalKnobCell = [theme cellForScrollerKnob: YES]; verticalKnobSlotCell = [theme cellForScrollerKnobSlot: NO]; horizontalKnobSlotCell = [theme cellForScrollerKnobSlot: YES]; [downCell setContinuous: YES]; [downCell sendActionOn: (NSLeftMouseDownMask | NSPeriodicMask)]; [downCell setPeriodicDelay: 0.3 interval: 0.03]; [leftCell setContinuous: YES]; [leftCell sendActionOn: (NSLeftMouseDownMask | NSPeriodicMask)]; [leftCell setPeriodicDelay: 0.3 interval: 0.03]; [rightCell setContinuous: YES]; [rightCell sendActionOn: (NSLeftMouseDownMask | NSPeriodicMask)]; [rightCell setPeriodicDelay: 0.3 interval: 0.03]; [upCell setContinuous: YES]; [upCell sendActionOn: (NSLeftMouseDownMask | NSPeriodicMask)]; [upCell setPeriodicDelay: 0.3 interval: 0.03]; } - (void) _setTargetAndActionToCells { [upCell setTarget: _target]; [upCell setAction: _action]; [downCell setTarget: _target]; [downCell setAction: _action]; [leftCell setTarget: _target]; [leftCell setAction: _action]; [rightCell setTarget: _target]; [rightCell setAction: _action]; [horizontalKnobCell setTarget: _target]; [horizontalKnobCell setAction: _action]; [verticalKnobCell setTarget:_target]; [horizontalKnobCell setTarget:_target]; } - (void) checkSpaceForParts { NSSize frameSize = _frame.size; CGFloat size = (_scFlags.isHorizontal ? frameSize.width : frameSize.height); CGFloat buttonsWidth = [[self class] scrollerWidth] - 2*buttonsOffset; if (_arrowsPosition == NSScrollerArrowsNone) { if (size >= buttonsWidth + 3) { _usableParts = NSAllScrollerParts; } else { _usableParts = NSNoScrollerParts; } } else { if (size >= 4 /* spacing */ + 1 /* min. scroll area */ + buttonsWidth * 3) { _usableParts = NSAllScrollerParts; } else if (size >= 3 /* spacing */ + buttonsWidth * 2) { _usableParts = NSOnlyScrollerArrows; } else { _usableParts = NSNoScrollerParts; } } } - (void) setEnabled: (BOOL)flag { if (_scFlags.isEnabled == flag) { return; } _scFlags.isEnabled = flag; [self setNeedsDisplay: YES]; } /**

Sets the position of the NSScroller arrows used for scrolling to where and marks self for display. By default the arrow position is set to NSScrollerArrowsMinEnd if the scroller is a horizontal scroller and NSScrollerArrowsMaxEnd if the scroller is a vertical scroller. See NSScrollArrowPosition for more informations.

See Also: -arrowsPosition

*/ - (void) setArrowsPosition: (NSScrollArrowPosition)where { if (_arrowsPosition == where) { return; } _arrowsPosition = where; [self setNeedsDisplay: YES]; } - (void) setFloatValue: (float)aFloat { [self setDoubleValue: aFloat]; } - (void) setDoubleValue: (double)aDouble { if (_doubleValue == aDouble) { /* Most likely our trackKnob method initiated this via NSScrollView */ return; } if (aDouble < 0.0) { _doubleValue = 0.0; } else if (aDouble > 1.0) { _doubleValue = 1.0; } else { _doubleValue = aDouble; } [self setNeedsDisplayInRect: [self rectForPart: NSScrollerKnobSlot]]; } - (void) setKnobProportion: (CGFloat)proportion { if (_knobProportion == proportion) { /* Most likely our trackKnob method initiated this via NSScrollView */ return; } if (proportion < 0.0) { _knobProportion = 0.0; } else if (proportion > 1.0) { _knobProportion = 1.0; } else { _knobProportion = proportion; } [self setNeedsDisplayInRect: [self rectForPart: NSScrollerKnobSlot]]; // Handle the case when parts should disappear if (_knobProportion == 1.0) { [self setEnabled: NO]; } else { [self setEnabled: YES]; } } - (void) setFloatValue: (float)aFloat knobProportion: (CGFloat)ratio { if (_hitPart == NSScrollerNoPart) { [self setKnobProportion: ratio]; } else { _pendingKnobProportion = ratio; } // Don't set float value if knob is being dragged if (_hitPart != NSScrollerKnobSlot && _hitPart != NSScrollerKnob) { /* Make sure we mark ourselves as needing redisplay. */ _doubleValue = -1; [self setFloatValue: aFloat]; } } - (void) setFrame: (NSRect)frameRect { /* * determine the orientation of the scroller and adjust it's size accordingly */ if (frameRect.size.width > frameRect.size.height) { _scFlags.isHorizontal = YES; frameRect.size.height = [[self class] scrollerWidth]; } else { _scFlags.isHorizontal = NO; frameRect.size.width = [[self class] scrollerWidth]; } [super setFrame: frameRect]; if (_arrowsPosition != NSScrollerArrowsNone) { if (_scFlags.isHorizontal) { _arrowsPosition = NSScrollerArrowsMinEnd; } else { _arrowsPosition = NSScrollerArrowsMaxEnd; } } _hitPart = NSScrollerNoPart; [self checkSpaceForParts]; } - (void) setFrameSize: (NSSize)size { /* * determine the orientation of the scroller and adjust it's size accordingly */ if (size.width > size.height) { _scFlags.isHorizontal = YES; size.height = [[self class] scrollerWidth]; } else { _scFlags.isHorizontal = NO; size.width = [[self class] scrollerWidth]; } [super setFrameSize: size]; if (_arrowsPosition != NSScrollerArrowsNone) { if (_scFlags.isHorizontal) { _arrowsPosition = NSScrollerArrowsMinEnd; } else { _arrowsPosition = NSScrollerArrowsMaxEnd; } } _hitPart = NSScrollerNoPart; [self checkSpaceForParts]; } /**

Returns the NSScroller's part under the point thePoint. See NSScrollerPart for more informations

*/ - (NSScrollerPart) testPart: (NSPoint)thePoint { /* * return what part of the scroller the mouse hit */ NSRect rect; /* thePoint is in window's coordinate system; convert it to * our own coordinate system. */ thePoint = [self convertPoint: thePoint fromView: nil]; if (thePoint.x <= 0 || thePoint.x >= _frame.size.width || thePoint.y <= 0 || thePoint.y >= _frame.size.height) return NSScrollerNoPart; rect = [self rectForPart: NSScrollerDecrementLine]; if ([self mouse: thePoint inRect: rect]) return NSScrollerDecrementLine; rect = [self rectForPart: NSScrollerIncrementLine]; if ([self mouse: thePoint inRect: rect]) return NSScrollerIncrementLine; rect = [self rectForPart: NSScrollerKnob]; if ([self mouse: thePoint inRect: rect]) return NSScrollerKnob; rect = [self rectForPart: NSScrollerDecrementPage]; if ([self mouse: thePoint inRect: rect]) return NSScrollerDecrementPage; rect = [self rectForPart: NSScrollerIncrementPage]; if ([self mouse: thePoint inRect: rect]) return NSScrollerIncrementPage; rect = [self rectForPart: NSScrollerKnobSlot]; if ([self mouse: thePoint inRect: rect]) return NSScrollerKnobSlot; return NSScrollerNoPart; } - (double) _doubleValueForMousePoint: (NSPoint)point { NSRect knobRect = [self rectForPart: NSScrollerKnob]; NSRect slotRect = [self rectForPart: NSScrollerKnobSlot]; float position; float min_pos; float max_pos; /* * Compute limits and mouse position */ if (_scFlags.isHorizontal) { min_pos = NSMinX(slotRect) + NSWidth(knobRect) / 2; max_pos = NSMaxX(slotRect) - NSWidth(knobRect) / 2; position = point.x; } else { min_pos = NSMinY(slotRect) + NSHeight(knobRect) / 2; max_pos = NSMaxY(slotRect) - NSHeight(knobRect) / 2; position = point.y; } /* * Compute float value */ if (position <= min_pos) return 0; if (position >= max_pos) return 1; return (position - min_pos) / (max_pos - min_pos); } - (void) mouseDown: (NSEvent*)theEvent { if (!_scFlags.isEnabled) { [super mouseDown: theEvent]; return; } NSPoint location = [theEvent locationInWindow]; _hitPart = [self testPart: location]; [self _setTargetAndActionToCells]; switch (_hitPart) { case NSScrollerIncrementLine: case NSScrollerDecrementLine: case NSScrollerIncrementPage: case NSScrollerDecrementPage: [self trackScrollButtons: theEvent]; break; case NSScrollerKnob: [self trackKnob: theEvent]; break; case NSScrollerKnobSlot: { double doubleValue = [self _doubleValueForMousePoint: [self convertPoint: location fromView: nil]]; if (doubleValue != _doubleValue) { const BOOL scrollsToPoint = ![[GSTheme theme] scrollerScrollsByPageForScroller: self]; if (scrollsToPoint) { /* NeXTstep style is to scroll to point. */ [self setDoubleValue: doubleValue]; [self sendAction: _action to: _target]; // And then track the knob [self trackKnob: theEvent]; } else { /* Windows style is to scroll by a page. */ if (doubleValue > _doubleValue) { _hitPart = NSScrollerIncrementPage; } else { _hitPart = NSScrollerDecrementPage; } [self sendAction: _action to: _target]; /* FIXME: Here we should not track the knob but keep on moving it towards the mouse until the button goes up. If the mouse moves, move towards it, but only if this is in the original direction. */ } } break; } case NSScrollerNoPart: break; } _hitPart = NSScrollerNoPart; if (_pendingKnobProportion) { [self setKnobProportion: _pendingKnobProportion]; _pendingKnobProportion = 0.0; } else { [self setNeedsDisplay:YES]; } } - (void) trackKnob: (NSEvent*)theEvent { NSUInteger eventMask = NSLeftMouseDownMask | NSLeftMouseUpMask | NSLeftMouseDraggedMask | NSFlagsChangedMask; NSPoint point; float lastPosition; float newPosition; double doubleValue; float offset; float initialOffset; NSEvent *presentEvent = theEvent; NSEventType eventType = [theEvent type]; NSRect knobRect; NSUInteger flags = [theEvent modifierFlags]; knobRect = [self rectForPart: NSScrollerKnob]; point = [self convertPoint: [theEvent locationInWindow] fromView: nil]; if (_scFlags.isHorizontal) { lastPosition = NSMidX(knobRect); offset = lastPosition - point.x; } else { lastPosition = NSMidY(knobRect); offset = lastPosition - point.y; } initialOffset = offset; /* Save the initial offset value */ _hitPart = NSScrollerKnob; do { /* Inner loop that gets and (quickly) handles all events that have already arrived. */ while (theEvent && eventType != NSLeftMouseUp) { /* Note the event here. Don't do any expensive handling. */ if (eventType == NSFlagsChanged) flags = [theEvent modifierFlags]; presentEvent = theEvent; theEvent = [NSApp nextEventMatchingMask: eventMask untilDate: [NSDate distantPast] /* Only get events that have already arrived. */ inMode: NSEventTrackingRunLoopMode dequeue: YES]; eventType = [theEvent type]; } /* * No more events right now. Do expensive handling, like drawing, * here. */ point = [self convertPoint: [presentEvent locationInWindow] fromView: nil]; if (_scFlags.isHorizontal) newPosition = point.x + offset; else newPosition = point.y + offset; if (newPosition != lastPosition) { if (flags & NSAlternateKeyMask) { float diff; diff = newPosition - lastPosition; diff = diff * 3 / 4; offset -= diff; newPosition -= diff; } else /* Ok, we are no longer doing slow scrolling, lets go back to our original offset. */ { offset = initialOffset; } // only one coordinate (X or Y) is used to compute doubleValue. point = NSMakePoint(newPosition, newPosition); doubleValue = [self _doubleValueForMousePoint: point]; if (doubleValue != _doubleValue) { [self setDoubleValue: doubleValue]; [self sendAction: _action to: _target]; } lastPosition = newPosition; } /* * If our current event is actually the mouse up (perhaps the inner * loop got to this point) we want to update with the last info and * then quit. */ if (eventType == NSLeftMouseUp) break; /* Get the next event, blocking if necessary. */ theEvent = [NSApp nextEventMatchingMask: eventMask untilDate: [NSDate distantFuture] /* No limit, block until we get an event. */ inMode: NSEventTrackingRunLoopMode dequeue: YES]; eventType = [theEvent type]; } while (eventType != NSLeftMouseUp); } - (void) trackScrollButtons: (NSEvent*)theEvent { id theCell = nil; NSDebugLog (@"trackScrollButtons"); _hitPart = [self testPart: [theEvent locationInWindow]]; /* * A hit on a scroller button should be a page movement * if the alt key is pressed. */ switch (_hitPart) { case NSScrollerIncrementLine: if ([theEvent modifierFlags] & NSAlternateKeyMask) { _hitPart = NSScrollerIncrementPage; } /* Fall through to next case */ case NSScrollerIncrementPage: theCell = (_scFlags.isHorizontal ? rightCell : downCell); break; case NSScrollerDecrementLine: if ([theEvent modifierFlags] & NSAlternateKeyMask) { _hitPart = NSScrollerDecrementPage; } /* Fall through to next case */ case NSScrollerDecrementPage: theCell = (_scFlags.isHorizontal ? leftCell : upCell); break; default: theCell = nil; break; } /* * If we don't find a cell this has been all for naught, but we * shouldn't ever be in that situation. */ if (theCell) { NSRect rect = [self rectForPart: _hitPart]; [self lockFocus]; [theCell highlight: YES withFrame: rect inView: self]; [_window flushWindow]; NSDebugLog (@"tracking cell %@", theCell); /* * The "tracking" in this method actually takes place within * NSCell's trackMouse: method. */ [theCell trackMouse: theEvent inRect: rect ofView: self untilMouseUp: YES]; [theCell highlight: NO withFrame: rect inView: self]; [_window flushWindow]; [self unlockFocus]; } NSDebugLog (@"return from trackScrollButtons"); } /* * draw the scroller */ - (void) drawRect: (NSRect)rect { if (!_scFlags.isEnabled) { NSRect rect1 = NSIntersectionRect(rect, NSInsetRect(_bounds, buttonsOffset, buttonsOffset)); [self drawKnobSlotInRect: rect1 highlight: NO]; } else { [[GSTheme theme] drawScrollerRect: rect inView: self hitPart: _hitPart isHorizontal: _scFlags.isHorizontal]; } } /**

(Un)Highlight the button specified by whichButton. whichButton should be NSScrollerDecrementArrow or NSScrollerIncrementArrow

See Also: [NSCell-setHighlighted:] [NSCell-drawWithFrame:inView:]

*/ - (void) drawArrow: (NSScrollerArrow)whichButton highlight: (BOOL)flag { NSRect rect = [self rectForPart: (whichButton == NSScrollerIncrementArrow ? NSScrollerIncrementLine : NSScrollerDecrementLine)]; id theCell = nil; NSDebugLLog (@"NSScroller", @"position of %s cell is (%f, %f)", (whichButton == NSScrollerIncrementArrow ? "increment" : "decrement"), rect.origin.x, rect.origin.y); if (upCell == nil) { [self drawParts]; [self checkSpaceForParts]; } switch (whichButton) { case NSScrollerDecrementArrow: theCell = (_scFlags.isHorizontal ? leftCell : upCell); break; case NSScrollerIncrementArrow: theCell = (_scFlags.isHorizontal ? rightCell : downCell); break; } [theCell setHighlighted: flag]; [theCell drawWithFrame: rect inView: self]; } /**

Draws the knob

*/ - (void) drawKnob { if (!_scFlags.isEnabled) { return; } if (upCell == nil) { [self drawParts]; [self checkSpaceForParts]; } if (_scFlags.isHorizontal) [horizontalKnobCell drawWithFrame: [self rectForPart: NSScrollerKnob] inView: self]; else [verticalKnobCell drawWithFrame: [self rectForPart: NSScrollerKnob] inView: self]; } - (void) drawKnobSlot { [self drawKnobSlotInRect: [self rectForPart: NSScrollerKnobSlot] highlight: NO]; } - (void) drawKnobSlotInRect: (NSRect)slotRect highlight: (BOOL)flag { // FIXME: Not sure whether this method does the right thing if (upCell == nil) { [self drawParts]; [self checkSpaceForParts]; } if (_scFlags.isHorizontal) { [horizontalKnobSlotCell setHighlighted: flag]; [horizontalKnobSlotCell drawWithFrame: slotRect inView: self]; } else { [verticalKnobSlotCell setHighlighted: flag]; [verticalKnobSlotCell drawWithFrame: slotRect inView: self]; } } /**

Highlights the button whose under the mouse. Does nothing if the mouse is not under a button

See Also: -drawArrow:highlight:

*/ - (void) highlight: (BOOL)flag { switch (_hitPart) { case NSScrollerIncrementLine: case NSScrollerIncrementPage: [self drawArrow: NSScrollerIncrementArrow highlight: flag]; break; case NSScrollerDecrementLine: case NSScrollerDecrementPage: [self drawArrow: NSScrollerDecrementArrow highlight: flag]; break; default: /* No button currently hit for highlighting. */ break; } } /** */ - (NSRect) rectForPart: (NSScrollerPart)partCode { NSRect scrollerFrame = _frame; CGFloat x, y; CGFloat width, height; CGFloat buttonsWidth; CGFloat buttonsSize; BOOL arrowsSameEnd = [[GSTheme theme] scrollerArrowsSameEndForScroller: self]; if (upCell == nil) { [self drawParts]; [self checkSpaceForParts]; } buttonsWidth = ([[self class] scrollerWidth] - 2 * buttonsOffset); x = y = buttonsOffset; buttonsSize = 2 * buttonsWidth + 2 * buttonsOffset; /* * Assign to `width' and `height' values describing * the width and height of the scroller regardless * of its orientation. * but keeps track of the scroller's orientation. */ if (_scFlags.isHorizontal) { width = scrollerFrame.size.height - 2 * buttonsOffset; height = scrollerFrame.size.width - 2 * buttonsOffset; } else { width = scrollerFrame.size.width - 2 * buttonsOffset; height = scrollerFrame.size.height - 2 * buttonsOffset; } /* * The x, y, width and height values are computed below for the vertical * scroller. The height of the scroll buttons is assumed to be equal to * the width. */ switch (partCode) { case NSScrollerKnob: { CGFloat knobHeight, knobPosition, slotHeight; if (_usableParts == NSNoScrollerParts || _usableParts == NSOnlyScrollerArrows) { return NSZeroRect; } /* calc the slot Height */ slotHeight = height - (_arrowsPosition == NSScrollerArrowsNone ? 0 : buttonsSize); knobHeight = _knobProportion * slotHeight; knobHeight = floor(knobHeight); if (knobHeight < buttonsWidth) knobHeight = buttonsWidth; /* calc knob's position */ { CGFloat knobOvershootAbove = scrollerKnobOvershoot; CGFloat knobOvershootBelow = scrollerKnobOvershoot; if (arrowsSameEnd && _arrowsPosition == NSScrollerArrowsMinEnd) { knobOvershootBelow = 0; } else if (arrowsSameEnd && _arrowsPosition == NSScrollerArrowsMaxEnd) { knobOvershootAbove = 0; } else if (_arrowsPosition == NSScrollerArrowsNone) { knobOvershootAbove = 0; knobOvershootBelow = 0; } knobPosition = floor((float)_doubleValue * (slotHeight - knobHeight + knobOvershootAbove + knobOvershootBelow)) - knobOvershootAbove; } if (arrowsSameEnd) { if (_arrowsPosition == NSScrollerArrowsMinEnd) { y += buttonsSize; } } else { y += buttonsWidth + buttonsOffset; } y += knobPosition; width = buttonsWidth; height = knobHeight; break; } case NSScrollerKnobSlot: /* * if the scroller does not have buttons the slot completely * fills the scroller. */ if (_usableParts == NSNoScrollerParts || _arrowsPosition == NSScrollerArrowsNone) { break; } width = buttonsWidth; height -= buttonsSize; if (arrowsSameEnd) { if (_arrowsPosition == NSScrollerArrowsMinEnd) { y += buttonsSize; } } else { y += buttonsWidth + buttonsOffset; } break; case NSScrollerDecrementLine: case NSScrollerDecrementPage: if (_usableParts == NSNoScrollerParts || _arrowsPosition == NSScrollerArrowsNone) { return NSZeroRect; } else if (arrowsSameEnd && _arrowsPosition == NSScrollerArrowsMaxEnd) { y += (height - buttonsSize + buttonsOffset); } width = buttonsWidth; height = buttonsWidth; break; case NSScrollerIncrementLine: case NSScrollerIncrementPage: if (_usableParts == NSNoScrollerParts || _arrowsPosition == NSScrollerArrowsNone) { return NSZeroRect; } else if (arrowsSameEnd) { if (_arrowsPosition == NSScrollerArrowsMaxEnd) { y += (height - buttonsWidth); } else if (_arrowsPosition == NSScrollerArrowsMinEnd) { y += (buttonsWidth + buttonsOffset); } } else { y += (height - buttonsWidth); } height = buttonsWidth; width = buttonsWidth; break; case NSScrollerNoPart: return NSZeroRect; } if (_scFlags.isHorizontal) { return NSMakeRect (y, x, height, width); } else { return NSMakeRect (x, y, width, height); } } - (void) setControlSize: (NSControlSize)controlSize { if (_scFlags.control_size == controlSize) return; _scFlags.control_size = controlSize; [self setNeedsDisplay: YES]; } - (NSControlSize) controlSize { return _scFlags.control_size; } - (void) setControlTint: (NSControlTint)controlTint { if (_scFlags.control_tint == controlTint) return; _scFlags.control_tint = controlTint; [self setNeedsDisplay: YES]; } - (NSControlTint) controlTint { return _scFlags.control_tint; } @end gnustep-gui-0.24.0/Source/GSDisplayServer.m0000664000076500007650000007604112210100616020403 0ustar brains99brains99/** GSDisplayServer Abstract display server class. Copyright (C) 2002 Free Software Foundation, Inc. Author: Adam Fedor Date: Mar 2002 This file is part of the GNU Objective C User interface library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSEvent.h" #import "AppKit/NSImage.h" #import "AppKit/NSWindow.h" #import "GNUstepGUI/GSDisplayServer.h" #import "GNUstepGUI/GSDragView.h" #import "GSSlideView.h" /* Display attributes */ NSString * GSDisplayName = @"DisplayName"; NSString * GSDisplayNumber = @"DisplayNumber"; NSString * GSScreenNumber = @"ScreenNumber"; /* The memory zone where all server objects are allocated from (Contexts are also allocated from this zone) */ static NSZone *_globalGSZone = NULL; /* The current concrete class */ static Class defaultServerClass = NULL; /* Maps windows to a server */ static NSMapTable *windowmaps = NULL; /* Lock for use when creating contexts */ static NSRecursiveLock *serverLock = nil; static NSString *NSCurrentServerThreadKey; /** Returns the GSDisplayServer that created the interal representation for window. If the internal representation has not yet been created (for instance, if the window is deferred), it returns the current server */ GSDisplayServer * GSServerForWindow(NSWindow *window) { int num; if (windowmaps == NULL) { NSLog(@"GSServerForWindow: No window server"); return nil; } num = [window windowNumber]; if (num == 0) { /* Backend window hasn't been initialized yet, assume current server. */ return GSCurrentServer(); } return NSMapGet(windowmaps, (void *)(intptr_t)num); } /** Returns the current GSDisplayServer */ GSDisplayServer * GSCurrentServer(void) { NSMutableDictionary *dict = [[NSThread currentThread] threadDictionary]; return (GSDisplayServer*) [dict objectForKey: NSCurrentServerThreadKey]; } /** GSDisplayServer

This is an abstract class which provides a framework for a device independant window server. A window server handles the very basic control of the computer display and input. This includes basic window creation and handling, event handling, cursors, and providing miscellaneous information about the display.

Typically a backend library will provide a concrete subclass which implements the device specific methods described below.

In almost all cases, you should not call these methods directly in an application. You should use the equivalent methods available elsewhere in the library (e.g. NSWindow, NSScreen, etc).

*/ @implementation GSDisplayServer + (void) initialize { if (serverLock == nil) { [gnustep_global_lock lock]; if (serverLock == nil) { serverLock = [NSRecursiveLock new]; _globalGSZone = NSDefaultMallocZone(); defaultServerClass = [GSDisplayServer class]; NSCurrentServerThreadKey = @"NSCurrentServerThreadKey"; windowmaps = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks, NSNonOwnedPointerMapValueCallBacks, 20); } [gnustep_global_lock unlock]; } } /** Set the concrete subclass that will provide the device dependant implementation. */ + (void) setDefaultServerClass: (Class)aClass { defaultServerClass = aClass; } /**

Create a window server with attributes, which contains key/value pairs which describe the specifics of how the window server is to be initialized. Typically these values are specific to the concrete implementation. The current set of attributes that can be used with GSDisplayServer is.

GSDisplayName GSDisplayNumber GSScreenNumber

GSDisplayName is window server specific and shouldn't be used when creating a GSDisplayServer (although you can retrieve the value with the -attributes method). On X-Windows the value might be set to something like "host:d.s" where host is the host name, d is the display number and s is the screen number. GSDisplayNumber indicates the number of the display to open. GSScreenNumber indicates the number of the screen to display on. If not explicitly set, these attributes may be taked from environment variables or from other operating specific information.

In almost all applications one would only create a single instance of a window server. Although it is possible, it is unlikely that you would need more than one window server (and you would have to be very careful how you handled window creation and events in this case).

*/ + (GSDisplayServer *) serverWithAttributes: (NSDictionary *)attributes { GSDisplayServer *server; if (self == [GSDisplayServer class]) { server = [[defaultServerClass allocWithZone: _globalGSZone] initWithAttributes: attributes]; } else server = [[self allocWithZone: _globalGSZone] initWithAttributes: attributes]; return AUTORELEASE(server); } /** Sets the current server that will be handling windows, events, etc. This method must be called after a window server is created in order to make it available to the rest of the GUI library */ + (void) setCurrentServer: (GSDisplayServer *)server { NSMutableDictionary *dict = [[NSThread currentThread] threadDictionary]; if (server) [dict setObject: server forKey: NSCurrentServerThreadKey]; else [dict removeObjectForKey: NSCurrentServerThreadKey]; } /** Initializes the server. This typically causes the receiver to connect to the display (e.g. XOpenDisplay () on an X-Windows server). */ - (id) initWithAttributes: (NSDictionary *)attributes { self = [super init]; if (nil == self) return nil; server_info = [attributes mutableCopy]; event_queue = [[NSMutableArray allocWithZone: [self zone]] initWithCapacity: 32]; drag_types = NSCreateMapTable(NSIntMapKeyCallBacks, NSObjectMapValueCallBacks, 0); return self; } /** Return information used to create the server */ - (NSDictionary *) attributes { return AUTORELEASE([server_info copy]); } /** Causes the server to disconnect from the display. If the receiver is the current server, it removes itself and sets the current server to nil. Sending any more messages to the receiver after this is likely to cause severe problems and probably crash the application. */ - (void) closeServer { if (self == GSCurrentServer()) [GSDisplayServer setCurrentServer: nil]; } - (void) dealloc { NSMapEnumerator enumerator; void *key; void *val; if (windowmaps != NULL) { /* * Remove the display server from the windows map. * This depends on a property of GNUstep map tables, that an * enumerated object can safely be removed from the map. */ enumerator = NSEnumerateMapTable(windowmaps); while (NSNextMapEnumeratorPair(&enumerator, &key, &val)) { if (val == (void*)self) { NSMapRemove(windowmaps, key); } } NSEndMapTableEnumeration(&enumerator); } DESTROY(server_info); DESTROY(event_queue); NSFreeMapTable(drag_types); [super dealloc]; } - glContextClass { return nil; } - glPixelFormatClass { return nil; } /** Returns YES if the backend handles window decorations and NO * if the gui library must do that instead. */ - (BOOL) handlesWindowDecorations { return YES; } /* Drag and drop support. */ /** Convienience method that calls -addDragTypes:toWindow: using the server that controls win. */ + (BOOL) addDragTypes: (NSArray*)types toWindow: (NSWindow *)win { return [GSServerForWindow(win) addDragTypes: types toWindow: win]; } /** Convienience method that calls -removeDragTypes:fromWindow: using the server that controls win. */ + (BOOL) removeDragTypes: (NSArray*)types fromWindow: (NSWindow *)win { return [GSServerForWindow(win) removeDragTypes: types fromWindow: win]; } /** Convienience method that calls -dragTypesForWindow: using the server that controls win. */ + (NSCountedSet*) dragTypesForWindow: (NSWindow *)win { return [GSServerForWindow(win) dragTypesForWindow: win]; } /** * Add (increment count by 1) each drag type to those registered * for the window. If this results in a change to the types registered * in the counted set, return YES, otherwise return NO. * Subclasses should override this method, call 'super' and take * appropriate action if the method returns 'YES'. */ - (BOOL) addDragTypes: (NSArray*)types toWindow: (NSWindow *)win { NSCountedSet *old = (NSCountedSet*)NSMapGet(drag_types, (void*)win); NSEnumerator *drag_enum = [types objectEnumerator]; id type; NSUInteger originalCount; /* * Make sure the set exists. */ if (old == nil) { old = [NSCountedSet new]; NSMapInsert(drag_types, (void*)win, (void*)(gsaddr)old); RELEASE(old); } originalCount = [old count]; while ((type = [drag_enum nextObject])) { [old addObject: type]; } if ([old count] == originalCount) return NO; return YES; } /** * Remove (decrement count by 1) each drag type from those registered * for the window. If this results in a change to the types registered * in the counted set, return YES, otherwise return NO. * If given 'nil' as the array of types, remove ALL. * Subclasses should override this method, call 'super' and take * appropriate action if the method returns 'YES'. */ - (BOOL) removeDragTypes: (NSArray*)types fromWindow: (NSWindow *)win { NSCountedSet *old = (NSCountedSet*)NSMapGet(drag_types, (void*)win); NSEnumerator *drag_enum = [types objectEnumerator]; if (types == nil) { if (old == nil) return NO; NSMapRemove(drag_types, (void*)win); return YES; } else if (old == nil) { return NO; } else { unsigned originalCount = [old count]; id o; while ((o = [drag_enum nextObject])) { [old removeObject: o]; } if ([old count] == originalCount) return NO; return YES; } } /** Returns the drag types set for the window win. */ - (NSCountedSet*) dragTypesForWindow: (NSWindow *)win { return (NSCountedSet*)NSMapGet(drag_types, (void *)win); } /** Returns an instance of a class which implements the NSDraggingInfo protocol. */ - (id ) dragInfo { return [GSDragView sharedDragView]; } - (BOOL) slideImage: (NSImage*)image from: (NSPoint)from to: (NSPoint)to { return [GSSlideView _slideImage: image from: from to: to]; } - (void) restrictWindow: (int)win toImage: (NSImage*)image { [self subclassResponsibility: _cmd]; } - (int) findWindowAt: (NSPoint)screenLocation windowRef: (int*)windowRef excluding: (int)win { [self subclassResponsibility: _cmd]; return 0; } /* Screen information */ /** Returns the resolution, in points, for the indicated screen of the display. */ - (NSSize) resolutionForScreen: (int)screen { /*[self subclassResponsibility: _cmd];*/ return NSMakeSize(72, 72); } /** Returns the bounds, in pixels, for the indicated screen of the display. */ - (NSRect) boundsForScreen: (int)screen { [self subclassResponsibility: _cmd]; return NSZeroRect; } /** Returns the default depth of windows that are created on screen. */ - (NSWindowDepth) windowDepthForScreen: (int)screen { [self subclassResponsibility: _cmd]; return 0; } /** Returns a null terminated list of possible window depths for screen. */ - (const NSWindowDepth *) availableDepthsForScreen: (int)screen { [self subclassResponsibility: _cmd]; return NULL; } /** Returns an array of NSNumbers, where each number describes a screen that is available on this display. The default screen is listed first. */ - (NSArray *) screenList { [self subclassResponsibility: _cmd]; return nil; } /** Returns a display dependant pointer that describes the internal connection to the display. On X-Windows, for example, this is a pointer to the Display variable. */ - (void *) serverDevice { [self subclassResponsibility: _cmd]; return NULL; } /** Returns a display dependant pointer that describes the internal window representation for win. On X-Windows, for example, this is a pointer to the Window variable. */ - (void *) windowDevice: (int)win { [self subclassResponsibility: _cmd]; return NULL; } /** Play the System Beep */ - (void) beep { [self subclassResponsibility: _cmd]; } /** Returns a display dependent NSImage which will be used as the background image for AppIcons and MiniWindows. Under Windowmaker, for example this could be a user specified gradient. */ - (NSImage *) iconTileImage { return [NSImage imageNamed: @"common_Tile"]; } /** Returns the size of icons and miniwindows for screen. */ - (NSSize) iconSize { return NSMakeSize(64.0, 64.0); } /** * Returns a screenshot of the specified rectangle of the specified screen. * The mouse cursor should be ommitted from the returned image. */ - (NSImage *) contentsOfScreen: (int)screen inRect: (NSRect)rect { return nil; } @end /* ----------------------------------------------------------------------- */ /* GNUstep Window operations */ /* ----------------------------------------------------------------------- */ @implementation GSDisplayServer (WindowOps) /** Tells the receiver that it owns the window described by win. Concrete subclasses must call this function when creating a window. Do not call this method in any other case, particularly for a window that has already been created */ - (void) _setWindowOwnedByServer: (int)win { if (windowmaps != NULL) { NSMapInsert(windowmaps, (void*)(intptr_t)win, self); } } /** Creates a window whose location and size is described by frame and whose backing store is described by type. This window is not mapped to the screen by this call.
Note that frame is the frame of the entire GNUstep window including borders, titlebar and other standard decorations.
If -handlesWindowDecorations returns YES, the backend will produce (and return the identifier of) a smaller drawable window inside this decorated area.
Use -styleoffsets::::: to determine the extent of the decorations and determine the size of the drawable area inside them. */ - (int) window: (NSRect)frame : (NSBackingStoreType)type : (unsigned int)style { int sn = [[server_info objectForKey: GSScreenNumber] intValue]; return [self window: frame : type : style : sn]; } /** Like -window::: only there is an additional argument to specify which screen the window will display on */ - (int) window: (NSRect)frame : (NSBackingStoreType)type : (unsigned int)style : (int)screen { [self subclassResponsibility: _cmd]; return 0; } /** Destroys the representation of the window and frees and memory associated with it. */ - (void) termwindow: (int) win { [self subclassResponsibility: _cmd]; } /** Create all the backend structures for a reference to a native window and return the extend, backing type, style and screen for that window. */ - (int) nativeWindow: (void *)winref : (NSRect*)frame : (NSBackingStoreType*)type : (unsigned int*)style : (int*)screen { [self subclassResponsibility: _cmd]; return 0; } /** Sets the style of the window. See [NSWindow-styleMask] for a description of the available styles */ - (void) stylewindow: (unsigned int) style : (int) win { [self subclassResponsibility: _cmd]; } /** Changes window's the backing store to type */ - (void) windowbacking: (NSBackingStoreType)type : (int) win { [self subclassResponsibility: _cmd]; } /** Sets the window title */ - (void) titlewindow: (NSString *) window_title : (int) win { [self subclassResponsibility: _cmd]; } /** Miniaturizes the window */ - (void) miniwindow: (int) win { [self subclassResponsibility: _cmd]; } /** Returns YES if the application should create the miniwindow counterpart to the full size window and own it. Some display systems handle the miniwindow themselves. In this case the backend subclass should override this method to return NO. */ - (BOOL) appOwnsMiniwindow { return YES; } /** Sets the window device information for the current NSGraphicsContext, typically by calling [NSGraphicsContext-GSSetDevice:::], although depending on the concrete implmentation, more information than this may need to be exchanged. */ - (void) windowdevice: (int)winNum { [self setWindowdevice: winNum forContext: GSCurrentContext()]; } /** Sets the window device information for the NSGraphicsContext, typically by calling [NSGraphicsContext-GSSetDevice:::], although depending on the concrete implmentation, more information than this may need to be exchanged. */ - (void) setWindowdevice: (int)win forContext: (NSGraphicsContext *)ctxt { [self subclassResponsibility: _cmd]; } /** *

Causes the window to be ordered onto or off the screen depending * on the value of op. The window is ordered relative to otherWin. *

*

The effect of the various combinations of op and otherWin are: *

* * op is NSWindowOut * * The window is removed from the display and otherWinm is ignored. * * op is NSWindowAbove and otherWin is zero * * The window is placed above all other windows at the same level * unless doing the current key window is at this level (in which * case the window will be placed immediately below that). * * op is NSWindowAbove and otherWin is minus one * * The window is placed above all other windows at the same level * even if doing that would place it above the current key window.
* This is a special feature that [NSWindow-orderWindow:relativeTo:] uses * to place the window correctly. *
* op is NSWindowBelow and otherWin is zero * * The window is placed above all other windows at the same level. * * op is NSWindowAbove and otherWin is a window on the display * * The level of the window is set to be the same as that of * otherWin and the window is placed immediately above otherWin. * * op is NSWindowBelow and otherWin is a window on the display * * The level of the window is set to be the same as that of * otherWin and the window is placed immediately below otherWin. * *
*/ - (void) orderwindow: (int) op : (int) otherWin : (int) win { [self subclassResponsibility: _cmd]; } /** Moves the bottom left corner of the window (including any border) * to loc.
* The position is expressed as an offset from the bottom left * corner of the screen. */ - (void) movewindow: (NSPoint)loc : (int) win { [self subclassResponsibility: _cmd]; } /** Moves and resizes the window on the screen as described by frame. * The value of frame is a rectangle containing the entire window, including * any border/decorations. Its position is expressed as an offset from * the bottom left corner of the screen. */ - (void) placewindow: (NSRect)frame : (int) win { [self subclassResponsibility: _cmd]; } /** Returns the frame of the window on the screen.
* The value of frame is a rectangle containing the entire window, including * any border/decorations. Its position is expressed as an offset from * the bottom left corner of the screen. */ - (NSRect) windowbounds: (int) win { [self subclassResponsibility: _cmd]; return NSZeroRect; } /** Set the level of the window as in the [NSWindow -setLevel] method.
* The use of window levels organises the window hierarchy into groups * of windows at each level. It effects the operation of the * -orderwindow::: method in the case where the position is 'above' or * 'below' and the other window number is zero. */ - (void) setwindowlevel: (int) level : (int) win { [self subclassResponsibility: _cmd]; } /** Returns the window level as in [NSWindow -level] */ - (int) windowlevel: (int) win { [self subclassResponsibility: _cmd]; return 0; } /** Backends can override this method to return an array of window numbers ordered front to back. The front most window being the first object in the array. The default implementation returns the visible windows in an unspecified order. */ - (NSArray *) windowlist { NSMutableArray *list = [NSMutableArray arrayWithArray:[NSApp windows]]; int c = [list count]; while (c-- > 0) { if (![[list objectAtIndex:c] isVisible]) { [list removeObjectAtIndex:c]; } } return [list valueForKey:@"windowNumber"]; } /** Returns the depth of the window */ - (int) windowdepth: (int) win { [self subclassResponsibility: _cmd]; return 0; } /** Set the maximum size (pixels) of the window */ - (void) setmaxsize: (NSSize)size : (int) win { [self subclassResponsibility: _cmd]; } /** Set the minimum size (pixels) of the window */ - (void) setminsize: (NSSize)size : (int) win { [self subclassResponsibility: _cmd]; } /** Set the resize incremenet of the window */ - (void) setresizeincrements: (NSSize)size : (int) win { [self subclassResponsibility: _cmd]; } /** Causes buffered graphics to be flushed to the screen. * The value of rect is expressed in OpenStep window coordinates. */ - (void) flushwindowrect: (NSRect)rect : (int) win { [self subclassResponsibility: _cmd]; } /** * Returns the dimensions of window decorations added outside the drawable * window frame by a window manager or equivalent. For instance, t * gives the height of the title bar for the window.
* If -handlesWindowDecorations returns NO, there * are no decorations outside the drawable window frame and this method * shouldn't be called. * */ - (void) styleoffsets: (float*) l : (float*) r : (float*) t : (float*) b : (unsigned int) style { [self subclassResponsibility: _cmd]; } /** Sets the document edited flag for the window */ - (void) docedited: (int) edited : (int) win { [self subclassResponsibility: _cmd]; } /** Sets the input state for the window given by the GSWindowInputState constant. Instructs the window manager that the specified window is 'key', 'main', or just a normal window. */ - (void) setinputstate: (int)state : (int)win { [self subclassResponsibility: _cmd]; } /** Forces focus to the window so that all key events are sent to this window */ - (void) setinputfocus: (int) win { [self subclassResponsibility: _cmd]; } /** Sets the transparancy value for the whole window */ - (void) setalpha: (float)alpha : (int) win { //[self subclassResponsibility: _cmd]; } /** Sets the window shadow */ - (void) setShadow: (BOOL)hasShadow : (int)win { //[self subclassResponsibility: _cmd]; } /** Returns the current mouse location on the default screen. If the * pointer is not on the default screen, an invalid point (-1,-1} is * returned.
* The location is expressed as an offset from the bottom left corner * of the screen. */ - (NSPoint) mouselocation { [self subclassResponsibility: _cmd]; return NSZeroPoint; } /** Returns the current mouse location on aScreen. If the pointer is * not on aScreen, this method acts like -mouselocation. If aScreen is -1, * then the location of the mouse on any screen is returned. The * win pointer returns the window number of the GNUstep window * that the mouse is in or 0 if it is not in a window.
* The location is expressed as an offset from the bottom left corner * of the screen. */ - (NSPoint) mouseLocationOnScreen: (int)aScreen window: (int *)win { [self subclassResponsibility: _cmd]; return NSZeroPoint; } /** Grabs the pointer device so that all future mouse events will be directed only to the window win. If successful, the return value is YES and this message must be balanced by a -releasemouse message. */ - (BOOL) capturemouse: (int) win { [self subclassResponsibility: _cmd]; return NO; } /** Release a previous captured mouse from -capturemouse: */ - (void) releasemouse { [self subclassResponsibility: _cmd]; } /** Set mouse cursor position. */ - (void) setMouseLocation: (NSPoint)mouseLocation onScreen: (int)aScreen { [self subclassResponsibility: _cmd]; } /** Hides the cursor */ - (void) hidecursor { [self subclassResponsibility: _cmd]; } /** Show a previously hidden cursor */ - (void) showcursor { [self subclassResponsibility: _cmd]; } /** Create a standard cursor (such as an arror or IBeam). Returns a pointer to the internal device representation that can be used later to make this cursor the current one */ - (void) standardcursor: (int) style : (void**) cid { [self subclassResponsibility: _cmd]; } /** Create a cursor from an image. Returns a pointer to the internal device representation that can be used later to make this cursor the current one */ - (void) imagecursor: (NSPoint)hotp : (NSImage *) image : (void**) cid { [self subclassResponsibility: _cmd]; } /** Set the cursor given by the cid representation as being the current cursor. The cursor has a foreground color fg and a background color bg. To keep the default color for the cursor, pass nil for fg and bg. */ - (void) setcursorcolor: (NSColor *)fg : (NSColor *)bg : (void*) cid { NSLog(@"Call to obsolete method -setcursorcolor:::"); [self recolorcursor: fg : bg : cid]; [self setcursor: cid]; } /** Recolour the cursor given by the cid representation into having a foreground color fg and a background color bg. */ - (void) recolorcursor: (NSColor *)fg : (NSColor *)bg : (void*) cid { [self subclassResponsibility: _cmd]; } /** Set the cursor given by the cid representation as being the current cursor. */ - (void) setcursor: (void*) cid { [self subclassResponsibility: _cmd]; } /** Free the cursor given by the cid representation. */ - (void) freecursor: (void*) cid { [self subclassResponsibility: _cmd]; } - (void) setParentWindow: (int)parentWin forChildWindow: (int)childWin { [self subclassResponsibility: _cmd]; } - (void) setIgnoreMouse: (BOOL)ignoreMouse : (int)win { // Do nothing if not overridden by subclass } @end /* ----------------------------------------------------------------------- */ /* GNUstep Event Operations */ /* ----------------------------------------------------------------------- */ @implementation GSDisplayServer (EventOps) /** * Scans through the event queue to find the first event whose type matches * mask. If no event is found, then the current run loop is run in the * specified mode to allow more events to arrive.
* If a matching event is found, it is returned and either removed from or * left in the queue according to flag.
* If no matching event is found and the limit date is reached, this method * returns nil. */ - (NSEvent*) getEventMatchingMask: (unsigned)mask beforeDate: (NSDate*)limit inMode: (NSString*)mode dequeue: (BOOL)flag { NSUInteger pos = 0; /* Position in queue scanned so far */ NSRunLoop *loop = nil; do { NSUInteger count = [event_queue count]; NSEvent *event; NSUInteger i = 0; if (count == 0) { event = nil; } else if (mask == NSAnyEventMask) { /* * Special case - if the mask matches any event, we just get the * first event on the queue. */ event = [event_queue objectAtIndex: 0]; } else { event = nil; /* * Scan the queue from the last position we have seen, up to the end. */ if (count > pos) { NSUInteger end = count - pos; NSRange r = NSMakeRange(pos, end); NSEvent *events[end]; [event_queue getObjects: events range: r]; for (i = 0; i < end; i++) { if (mask & NSEventMaskFromType([events[i] type])) { event = events[i]; break; } } } } /* * Note the position we have read up to. */ pos += i; /* * If we found a matching event, we (depending on the flag) de-queue it. * We return the event RETAINED - the caller must release it. */ if (event) { RETAIN(event); if (flag) { [event_queue removeObjectAtIndex: pos]; } return AUTORELEASE(event); } if (loop == nil) { loop = [NSRunLoop currentRunLoop]; } if ([loop runMode: mode beforeDate: limit] == NO) { break; // Nothing we can do ... no input handlers. } } while ([limit timeIntervalSinceNow] > 0.0); return nil; /* No events in specified time */ } /** * Steps through the event queue and removes all events whose timestamp * is earlier than that of limit wand which match the supplied mask * of event types. */ - (void) discardEventsMatchingMask: (unsigned)mask beforeEvent: (NSEvent*)limit { NSUInteger index = [event_queue count]; /* * If there is a range to use - remove all the matching events in it * which were created before the specified event. */ if (index > 0) { NSTimeInterval when = [limit timestamp]; NSEvent *events[index]; [event_queue getObjects: events]; while (index-- > 0) { NSEvent *event = events[index]; if ([event timestamp] < when) { if ((mask == NSAnyEventMask) || (mask & NSEventMaskFromType([event type]))) { [event_queue removeObjectAtIndex: index]; } } } } } /** Posts an event to the event queue. The value of flag determines * whether the event is inserted at the start of the queue or appended * at the end. */ - (void) postEvent: (NSEvent*)anEvent atStart: (BOOL)flag { if (flag) [event_queue insertObject: anEvent atIndex: 0]; else [event_queue addObject: anEvent]; } - (void) _printEventQueue { NSUInteger index = [event_queue count]; if (index > 0) { NSEvent *events[index]; NSUInteger i; NSLog(@"Dumping events from queue"); [event_queue getObjects: events]; for (i = 0; i < index; i++) { NSEvent *event = events[i]; NSLog(@"index %d %@", i, event); } } else { NSLog(@"Event queue is empty"); } } @end gnustep-gui-0.24.0/Source/win32-def.top0000664000076500007650000000215711023376255017435 0ustar brains99brains99; This file is automatically generated (make libgnustep-gui.def.new) ; libgnustep-gui.def ; ; Exports for libgnustep-gui DLL ; Specific to WIN32 operating systems ; ; Copyright (C) 1997-2003 Free Software Foundation, Inc. ; ; This file is part of the GNUstep GUI Library. ; ; This library is free software; you can redistribute it and/or ; modify it under the terms of the GNU Lesser 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 ; Lesser General Public License for more details. ; ; You should have received a copy of the GNU Lesser General Public ; License along with this library; see the file COPYING.LIB. ; If not, see or write to the ; Free Software Foundation, 51 Franklin Street, Fifth Floor, ; Boston, MA 02110-1301, USA. ; LIBRARY libgnustep-gui EXPORTS gnustep-gui-0.24.0/Source/NSUserDefaultsController.m0000664000076500007650000001740311657771656022325 0ustar brains99brains99/** NSUserDefaultsController Controller class for user defaults Copyright (C) 2006 Free Software Foundation, Inc. Author: Fred Kiefer Date: September 2006 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import #import "AppKit/NSUserDefaultsController.h" static id shared = nil; @interface GSUserDefaultsHelper : NSObject { @public NSUserDefaultsController *controller; NSMutableDictionary *values; } - (id) initWithController: (NSUserDefaultsController*)udc; - (id) valueForKey: (NSString*)key; - (void) setValue: (id)value forKey: (NSString*)key; - (void) revert; - (void) revertToInitialValues: (NSDictionary *)initial; - (void) defaultsDidChange: (NSUserDefaults *)defaults; @end @implementation GSUserDefaultsHelper - (id) initWithController: (NSUserDefaultsController*)udc { if ((self = [super init]) != nil) { // We are retained by the controller controller = udc; values = [[NSMutableDictionary alloc] init]; } return self; } - (void) dealloc { RELEASE(values); [super dealloc]; } - (id) valueForKey: (NSString*)key { id value = [values objectForKey: key]; if (!value) { // If the value isn't cached, get it from the controller and cache it. value = [[controller defaults] objectForKey: key]; if (!value) { value = [[controller initialValues] objectForKey: key]; } // We need to cache the values we return to be able to // report changes to them when the defaults change. if (value) { [values setObject: value forKey: key]; } else { // Use a marker for missing values [values setObject: [NSNull null] forKey: key]; } } else if ([[NSNull null] isEqual: value]) { // filter out our marker value return nil; } return value; } - (void) setValue: (id)value forKey: (NSString*)key { [self willChangeValueForKey: key]; [values setObject: value forKey: key]; if ([controller appliesImmediately]) [[controller defaults] setObject: value forKey: key]; [self didChangeValueForKey: key]; } - (void) revert { NSEnumerator *e; NSString *key; e = [values keyEnumerator]; while ((key = (NSString *)[e nextObject])) { [self willChangeValueForKey: key]; [values removeObjectForKey: key]; [self didChangeValueForKey: key]; } } - (void) revertToInitialValues: (NSDictionary *)initial { NSEnumerator *e; NSString *key; e = [values keyEnumerator]; while ((key = (NSString *)[e nextObject])) { id val = [values objectForKey: key]; id oldVal = [initial objectForKey: key]; if (oldVal && ![val isEqual: oldVal]) { [self willChangeValueForKey: key]; [values setObject: oldVal forKey: key]; // When appliesImmediately is YES, should we save these values? [self didChangeValueForKey: key]; } } } - (void) defaultsDidChange: (NSUserDefaults *)defaults { NSEnumerator *e; NSString *key; e = [values keyEnumerator]; while ((key = (NSString *)[e nextObject])) { id val = [values objectForKey: key]; id newVal = [defaults objectForKey: key]; if (newVal && ![val isEqual: newVal]) { [self willChangeValueForKey: key]; [values setObject: newVal forKey: key]; [self didChangeValueForKey: key]; } } } @end @implementation NSUserDefaultsController + (id) sharedUserDefaultsController { if (shared == nil) { shared = [[NSUserDefaultsController alloc] initWithDefaults: nil initialValues: nil]; } return shared; } - (id) initWithDefaults: (NSUserDefaults*)defaults initialValues: (NSDictionary*)initialValues { if ((self = [super init]) != nil) { if (defaults == nil) { defaults = [NSUserDefaults standardUserDefaults]; } ASSIGN(_defaults, defaults); [self setAppliesImmediately: YES]; [self setInitialValues: initialValues]; _values = [[GSUserDefaultsHelper alloc] initWithController: self]; // Watch for user default change notifications [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(defaultsDidChange:) name: NSUserDefaultsDidChangeNotification object: _defaults]; } return self; } - (void) dealloc { if (self == shared) { // Should never get here shared = nil; } [[NSNotificationCenter defaultCenter] removeObserver: self]; RELEASE(_values); RELEASE(_defaults); RELEASE(_initial_values); [super dealloc]; } - (NSUserDefaults*) defaults { return _defaults; } - (id) values { return _values; } - (NSDictionary*) initialValues { return _initial_values; } - (void) setInitialValues: (NSDictionary*)values { ASSIGNCOPY(_initial_values, values); } - (BOOL) appliesImmediately { return _applies_immediately; } - (void) setAppliesImmediately: (BOOL)flag { _applies_immediately = flag; } - (void) revert: (id)sender { [self discardEditing]; if (![self appliesImmediately]) { [_values revert]; } } - (void) revertToInitialValues: (id)sender { [self discardEditing]; [_values revertToInitialValues: _initial_values]; } - (void) save: (id)sender { if (![self appliesImmediately]) { NSDictionary *values = ((GSUserDefaultsHelper*)_values)->values; NSEnumerator *e; NSString *key; e = [values keyEnumerator]; while ((key = (NSString *)[e nextObject])) { [_defaults setObject: [values objectForKey: key] forKey: key]; } } } - (BOOL) hasUnappliedChanges { NSDictionary *values = ((GSUserDefaultsHelper*)_values)->values; NSEnumerator *e; NSString *key; e = [values keyEnumerator]; while ((key = (NSString *)[e nextObject])) { id val = [values objectForKey: key]; id newVal = [_defaults objectForKey: key]; if (![val isEqual: newVal]) { return YES; } } return NO; } - (void) defaultsDidChange: (NSNotification*)notification { [_values defaultsDidChange: _defaults]; } - (void) encodeWithCoder: (NSCoder *)aCoder { if ([aCoder allowsKeyedCoding]) if (self == shared) { [aCoder encodeBool: YES forKey: @"NSSharedInstance"]; return; } [super encodeWithCoder: aCoder]; } - (id) initWithCoder: (NSCoder *)aDecoder { if ([aDecoder allowsKeyedCoding]) if ([aDecoder decodeBoolForKey: @"NSSharedInstance"]) { RELEASE(self); return RETAIN([NSUserDefaultsController sharedUserDefaultsController]); } return [super initWithCoder: aDecoder]; } @end gnustep-gui-0.24.0/Source/NSResponder.m0000664000076500007650000002367011534147002017567 0ustar brains99brains99/** NSResponder Abstract class which is basis of command and event processing Copyright (C) 1996,1999 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import #import #import #import "AppKit/NSResponder.h" #import "AppKit/NSApplication.h" #import "AppKit/NSMenu.h" #import "AppKit/NSEvent.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSHelpManager.h" #import "AppKit/NSInputManager.h" @implementation NSResponder /* * Class methods */ + (void) initialize { if (self == [NSResponder class]) { [self setVersion: 1]; /* Gets the current input manager - this forces it to read the key binding files at this stage. */ [NSInputManager currentInputManager]; } } /* * Instance methods */ /* * Managing the next responder */ - (NSResponder*) nextResponder { return _next_responder; } - (void) setNextResponder: (NSResponder*)aResponder { _next_responder = aResponder; } /** * Returns YES if the receiver is able to become the first responder, * NO otherwise. */ - (BOOL) acceptsFirstResponder { return NO; } - (BOOL) becomeFirstResponder { return YES; } - (BOOL) resignFirstResponder { return YES; } /* * Aid event processing */ - (BOOL) performKeyEquivalent: (NSEvent*)theEvent { return NO; } /** * If the receiver responds to anAction, it performs that method with * anObject as its argument, discards any return value, and return YES.
* Otherwise, the next responder in the chain is asked to perform * anAction and the result of that is returned.
* If no responder in the chain is able to respond to anAction, then * NO is returned. */ - (BOOL) tryToPerform: (SEL)anAction with: (id)anObject { /* Can we perform the action -then do it */ if ([self respondsToSelector: anAction]) { IMP actionIMP = [self methodForSelector: anAction]; if (0 != actionIMP) { actionIMP(self, anAction, anObject); return YES; } return YES; } else { /* If we cannot perform then try the next responder */ if (!_next_responder) return NO; else return [_next_responder tryToPerform: anAction with: anObject]; } } - (BOOL) performMnemonic: (NSString*)aString { return NO; } - (void) interpretKeyEvents:(NSArray*)eventArray { [[NSInputManager currentInputManager] handleKeyboardEvents: eventArray client: self]; } - (void) flushBufferedKeyEvents { } - (void) doCommandBySelector:(SEL)aSelector { if (![self tryToPerform: aSelector with: nil]) { NSBeep(); } } - (void) insertText: (id)aString { if (_next_responder) [_next_responder insertText: aString]; else { NSBeep (); } } /* * Forwarding event messages */ - (void) flagsChanged: (NSEvent*)theEvent { if (_next_responder) [_next_responder flagsChanged: theEvent]; else [self noResponderFor: @selector(flagsChanged:)]; } - (void) helpRequested: (NSEvent*)theEvent { if ([[NSHelpManager sharedHelpManager] showContextHelpForObject: self locationHint: [theEvent locationInWindow]] == NO) { if (_next_responder) { [_next_responder helpRequested: theEvent]; return; } } [NSHelpManager setContextHelpModeActive: NO]; } - (void) keyDown: (NSEvent*)theEvent { if (_next_responder) [_next_responder keyDown: theEvent]; else [self noResponderFor: @selector(keyDown:)]; } - (void) keyUp: (NSEvent*)theEvent { if (_next_responder) [_next_responder keyUp: theEvent]; else [self noResponderFor: @selector(keyUp:)]; } - (void) otherMouseDown: (NSEvent*)theEvent { if (_next_responder) [_next_responder otherMouseDown: theEvent]; else [self noResponderFor: @selector(otherMouseDown:)]; } - (void) otherMouseDragged: (NSEvent*)theEvent { if (_next_responder) [_next_responder otherMouseDragged: theEvent]; else [self noResponderFor: @selector(otherMouseDragged:)]; } - (void) otherMouseUp: (NSEvent*)theEvent { if (_next_responder) [_next_responder otherMouseUp: theEvent]; else [self noResponderFor: @selector(otherMouseUp:)]; } - (void) mouseDown: (NSEvent*)theEvent { if (_next_responder) [_next_responder mouseDown: theEvent]; else [self noResponderFor: @selector(mouseDown:)]; } - (void) mouseDragged: (NSEvent*)theEvent { if (_next_responder) [_next_responder mouseDragged: theEvent]; else [self noResponderFor: @selector(mouseDragged:)]; } - (void) mouseEntered: (NSEvent*)theEvent { if (_next_responder) [_next_responder mouseEntered: theEvent]; else [self noResponderFor: @selector(mouseEntered:)]; } - (void) mouseExited: (NSEvent*)theEvent { if (_next_responder) [_next_responder mouseExited: theEvent]; else [self noResponderFor: @selector(mouseExited:)]; } - (void) mouseMoved: (NSEvent*)theEvent { if (_next_responder) [_next_responder mouseMoved: theEvent]; else [self noResponderFor: @selector(mouseMoved:)]; } - (void) mouseUp: (NSEvent*)theEvent { if (_next_responder) [_next_responder mouseUp: theEvent]; else [self noResponderFor: @selector(mouseUp:)]; } - (void) noResponderFor: (SEL)eventSelector { /* Only beep for key down events */ if (sel_isEqual(eventSelector, @selector(keyDown:))) NSBeep(); } - (void) rightMouseDown: (NSEvent*)theEvent { if (_next_responder != nil) [_next_responder rightMouseDown: theEvent]; else [self noResponderFor: @selector(rightMouseDown:)]; } - (void) rightMouseDragged: (NSEvent*)theEvent { if (_next_responder) [_next_responder rightMouseDragged: theEvent]; else [self noResponderFor: @selector(rightMouseDragged:)]; } - (void) rightMouseUp: (NSEvent*)theEvent { if (_next_responder) [_next_responder rightMouseUp: theEvent]; else [self noResponderFor: @selector(rightMouseUp:)]; } - (void) scrollWheel: (NSEvent *)theEvent { if (_next_responder) [_next_responder scrollWheel: theEvent]; else [self noResponderFor: @selector(scrollWheel:)]; } /* * Services menu support */ - (id) validRequestorForSendType: (NSString*)typeSent returnType: (NSString*)typeReturned { if (_next_responder) return [_next_responder validRequestorForSendType: typeSent returnType: typeReturned]; else return nil; } /* * NSCoding protocol * NB. Don't encode responder chain - it's transient information that should * be reconstructed from else where in the encoded archive. */ - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { if (_interface_style != NSNoInterfaceStyle) { [aCoder encodeInt: _interface_style forKey: @"NSInterfaceStyle"]; } if ([self menu] != nil) { [aCoder encodeObject: [self menu] forKey: @"NSMenu"]; } if ([self nextResponder] != nil) { [aCoder encodeConditionalObject: [self nextResponder] forKey: @"NSNextResponder"]; } } else { [aCoder encodeValueOfObjCType: @encode(int) at: &_interface_style]; [aCoder encodeObject: _menu]; } } - (id) initWithCoder: (NSCoder*)aDecoder { id obj = nil; if ([aDecoder allowsKeyedCoding]) { if ([aDecoder containsValueForKey: @"NSInterfaceStyle"]) { _interface_style = [aDecoder decodeIntForKey: @"NSInterfaceStyle"]; } if ([aDecoder containsValueForKey: @"NSMenu"]) { obj = [aDecoder decodeObjectForKey: @"NSMenu"]; } if ([aDecoder containsValueForKey: @"NSNextResponder"]) { [self setNextResponder: [aDecoder decodeObjectForKey: @"NSNextResponder"]]; } } else { [aDecoder decodeValueOfObjCType: @encode(int) at: &_interface_style]; obj = [aDecoder decodeObject]; } [self setMenu: obj]; return self; } - (void) dealloc { RELEASE(_menu); [super dealloc]; } - (NSMenu*) menu { return _menu; } - (void) setMenu: (NSMenu*)aMenu { ASSIGN(_menu, aMenu); } - (NSInterfaceStyle) interfaceStyle { return _interface_style; } - (void) setInterfaceStyle: (NSInterfaceStyle)aStyle { _interface_style = aStyle; } - (NSUndoManager*) undoManager { if (_next_responder) return [_next_responder undoManager]; else return nil; } - (BOOL) shouldBeTreatedAsInkEvent: (NSEvent *)theEvent { return NO; } - (BOOL)presentError:(NSError *)error { error = [self willPresentError: error]; if (_next_responder) { return [_next_responder presentError: error]; } else { return [NSApp presentError: error]; } } - (void)presentError:(NSError *)error modalForWindow:(NSWindow *)window delegate:(id)delegate didPresentSelector:(SEL)sel contextInfo:(void *)context { error = [self willPresentError: error]; if (_next_responder) { [_next_responder presentError: error modalForWindow: window delegate: delegate didPresentSelector: sel contextInfo: context]; } else { [NSApp presentError: error modalForWindow: window delegate: delegate didPresentSelector: sel contextInfo: context]; } } - (NSError *) willPresentError: (NSError *)error { return error; } @end gnustep-gui-0.24.0/Source/GSTheme.m0000664000076500007650000010716712227420270016666 0ustar brains99brains99/** GSTheme Useful/configurable drawing functions Copyright (C) 2004 Free Software Foundation, Inc. Author: Adam Fedor Date: Jan 2004 This file is part of the GNU Objective C User interface library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import #import #import #import #import #import #import #import "GNUstepBase/GSObjCRuntime.h" #import "GNUstepGUI/GSTheme.h" #import "AppKit/NSApplication.h" #import "AppKit/NSButtonCell.h" #import "AppKit/NSButton.h" #import "AppKit/NSColor.h" #import "AppKit/NSColorList.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSImage.h" #import "AppKit/NSImageView.h" #import "AppKit/NSMatrix.h" #import "AppKit/NSMenu.h" #import "AppKit/NSPanel.h" #import "AppKit/NSScrollView.h" #import "AppKit/NSSegmentedControl.h" #import "AppKit/NSTextContainer.h" #import "AppKit/NSTextField.h" #import "AppKit/NSTextView.h" #import "AppKit/NSScrollView.h" #import "AppKit/NSView.h" #import "AppKit/NSWindow.h" #import "AppKit/NSBezierPath.h" #import "AppKit/PSOperators.h" #import "GSThemePrivate.h" NSString *GSSwitch = @"GSSwitch"; NSString *GSRadio = @"GSRadio"; // Scroller part names NSString *GSScrollerDownArrow = @"GSScrollerDownArrow"; NSString *GSScrollerHorizontalKnob = @"GSScrollerHorizontalKnob"; NSString *GSScrollerHorizontalSlot = @"GSScrollerHorizontalSlot"; NSString *GSScrollerLeftArrow = @"GSScrollerLeftArrow"; NSString *GSScrollerRightArrow = @"GSScrollerRightArrow"; NSString *GSScrollerUpArrow = @"GSScrollerUpArrow"; NSString *GSScrollerVerticalKnob = @"GSScrollerVerticalKnob"; NSString *GSScrollerVerticalSlot = @"GSScrollerVerticalSlot"; // Table view part names NSString *GSTableHeader = @"GSTableHeader"; NSString *GSTableCorner = @"GSTableCorner"; // Browser part names NSString *GSBrowserHeader = @"GSBrowserHeader"; // Menu part names NSString *GSMenuHorizontalBackground = @"GSMenuHorizontalBackground"; NSString *GSMenuVerticalBackground = @"GSMenuVerticalBackground"; NSString *GSMenuTitleBackground = @"GSMenuTitleBackground"; NSString *GSMenuHorizontalItem = @"GSMenuHorizontalItem"; NSString *GSMenuVerticalItem = @"GSMenuVerticalItem"; NSString *GSMenuSeparatorItem = @"GSMenuSeparatorItem"; // NSPopUpButton part names NSString *GSPopUpButton = @"GSPopUpButton"; // Progress indicator part names NSString *GSProgressIndicatorBezel = @"GSProgressIndicatorBezel"; NSString *GSProgressIndicatorBarDeterminate = @"GSProgressIndicatorBarDeterminate"; // Color well part names NSString *GSColorWell = @"GSColorWell"; NSString *GSColorWellInnerBorder = @"GSColorWellInnerBorder"; // Slider part names NSString *GSSliderHorizontalTrack = @"GSSliderHorizontalTrack"; NSString *GSSliderVerticalTrack = @"GSSliderVerticalTrack"; // NSBox parts NSString *GSBoxBorder = @"GSBoxBorder"; /* NSTabView parts */ NSString *GSTabViewSelectedTabFill = @"GSTabViewSelectedTabFill"; NSString *GSTabViewUnSelectedTabFill = @"GSTabViewUnSelectedTabFill"; NSString *GSTabViewBackgroundTabFill = @"GSTabViewBackgroundTabFill"; NSString *GSTabViewBottomSelectedTabFill = @"GSTabViewBottomSelectedTabFill"; NSString *GSTabViewBottomUnSelectedTabFill = @"GSTabViewBottomUnSelectedTabFill"; NSString *GSTabViewBottomBackgroundTabFill = @"GSTabViewBottomBackgroundTabFill"; NSString *GSTabViewLeftSelectedTabFill = @"GSTabViewLeftSelectedTabFill"; NSString *GSTabViewLeftUnSelectedTabFill = @"GSTabViewLeftUnSelectedTabFill"; NSString *GSTabViewLeftBackgroundTabFill = @"GSTabViewLeftBackgroundTabFill"; NSString *GSTabViewRightSelectedTabFill = @"GSTabViewRightSelectedTabFill"; NSString *GSTabViewRightUnSelectedTabFill = @"GSTabViewRightUnSelectedTabFill"; NSString *GSTabViewRightBackgroundTabFill = @"GSTabViewRightBackgroundTabFill"; NSString *GSThemeDidActivateNotification = @"GSThemeDidActivateNotification"; NSString *GSThemeDidDeactivateNotification = @"GSThemeDidDeactivateNotification"; NSString *GSThemeWillActivateNotification = @"GSThemeWillActivateNotification"; NSString *GSThemeWillDeactivateNotification = @"GSThemeWillDeactivateNotification"; NSString * GSThemeStringFromFillStyle(GSThemeFillStyle s) { switch (s) { case GSThemeFillStyleNone: return @"None"; case GSThemeFillStyleScale: return @"Scale"; case GSThemeFillStyleRepeat: return @"Repeat"; case GSThemeFillStyleCenter: return @"Center"; case GSThemeFillStyleMatrix: return @"Matrix"; case GSThemeFillStyleScaleAll: return @"ScaleAll"; } return nil; } GSThemeFillStyle GSThemeFillStyleFromString(NSString *s) { if (s == nil || [s isEqualToString: @"None"]) { return GSThemeFillStyleNone; } if ([s isEqualToString: @"Scale"]) { return GSThemeFillStyleScale; } if ([s isEqualToString: @"Repeat"]) { return GSThemeFillStyleRepeat; } if ([s isEqualToString: @"Center"]) { return GSThemeFillStyleCenter; } if ([s isEqualToString: @"Matrix"]) { return GSThemeFillStyleMatrix; } if ([s isEqualToString: @"ScaleAll"]) { return GSThemeFillStyleScaleAll; } return GSThemeFillStyleNone; } NSString * GSStringFromSegmentStyle(NSSegmentStyle segmentStyle) { switch (segmentStyle) { case NSSegmentStyleAutomatic: return @"NSSegmentStyleAutomatic"; case NSSegmentStyleRounded: return @"NSSegmentStyleRounded"; case NSSegmentStyleTexturedRounded: return @"NSSegmentStyleTexturedRounded"; case NSSegmentStyleRoundRect: return @"NSSegmentStyleRoundRect"; case NSSegmentStyleTexturedSquare: return @"NSSegmentStyleTexturedSquare"; case NSSegmentStyleCapsule: return @"NSSegmentStyleCapsule"; case NSSegmentStyleSmallSquare: return @"NSSegmentStyleSmallSquare"; default: return nil; } } NSString * GSStringFromBezelStyle(NSBezelStyle bezelStyle) { switch (bezelStyle) { case NSRoundedBezelStyle: return @"NSRoundedBezelStyle"; case NSRegularSquareBezelStyle: return @"NSRegularSquareBezelStyle"; case NSThickSquareBezelStyle: return @"NSThickSquareBezelStyle"; case NSThickerSquareBezelStyle: return @"NSThickerSquareBezelStyle"; case NSDisclosureBezelStyle: return @"NSDisclosureBezelStyle"; case NSShadowlessSquareBezelStyle: return @"NSShadowlessSquareBezelStyle"; case NSCircularBezelStyle: return @"NSCircularBezelStyle"; case NSTexturedSquareBezelStyle: return @"NSTexturedSquareBezelStyle"; case NSHelpButtonBezelStyle: return @"NSHelpButtonBezelStyle"; case NSSmallSquareBezelStyle: return @"NSSmallSquareBezelStyle"; case NSTexturedRoundedBezelStyle: return @"NSTexturedRoundedBezelStyle"; case NSRoundRectBezelStyle: return @"NSRoundRectBezelStyle"; case NSRecessedBezelStyle: return @"NSRecessedBezelStyle"; case NSRoundedDisclosureBezelStyle: return @"NSRoundedDisclosureBezelStyle"; case NSNeXTBezelStyle: return @"NSNeXTBezelStyle"; case NSPushButtonBezelStyle: return @"NSPushButtonBezelStyle"; case NSSmallIconButtonBezelStyle: return @"NSSmallIconButtonBezelStyle"; case NSMediumIconButtonBezelStyle: return @"NSMediumIconButtonBezelStyle"; case NSLargeIconButtonBezelStyle: return @"NSLargeIconButtonBezelStyle"; default: return nil; } } NSString * GSStringFromBorderType(NSBorderType borderType) { switch (borderType) { case NSNoBorder: return @"NSNoBorder"; case NSLineBorder: return @"NSLineBorder"; case NSBezelBorder: return @"NSBezelBorder"; case NSGrooveBorder: return @"NSGrooveBorder"; default: return nil; } } NSString * GSStringFromTabViewType(NSTabViewType type) { switch (type) { case NSTopTabsBezelBorder: return @"NSTopTabsBezelBorder"; case NSBottomTabsBezelBorder: return @"NSBottomTabsBezelBorder"; case NSLeftTabsBezelBorder: return @"NSLeftTabsBezelBorder"; case NSRightTabsBezelBorder: return @"NSRightTabsBezelBorder"; case NSNoTabsBezelBorder: return @"NSNoTabsBezelBorder"; case NSNoTabsLineBorder: return @"NSNoTabsLineBorder"; case NSNoTabsNoBorder: return @"NSNoTabsNoBorder"; default: return nil; } } NSString * GSStringFromImageFrameStyle(NSImageFrameStyle type) { switch (type) { case NSImageFrameNone: return @"NSImageFrameNone"; case NSImageFramePhoto: return @"NSImageFramePhoto"; case NSImageFrameGrayBezel: return @"NSImageFrameGrayBezel"; case NSImageFrameGroove: return @"NSImageFrameGroove"; case NSImageFrameButton: return @"NSImageFrameButton"; default: return nil; } } @interface NSImage (Private) + (void) _setImagePath: (NSString*)path name: (NSString*)name; + (void) _reloadCachedImages; @end @interface GSTheme (Private) - (void) _revokeOwnerships; @end /* This private internal class is used to store information about a method * in some other class which is overridden while the current theme is * active. */ @interface GSThemeMethod : NSObject { @public Class cls; SEL sel; IMP imp; // The new method implementation IMP old; // The original method implementation Method mth; // The method information } @end @implementation GSThemeMethod @end @implementation GSTheme static GSTheme *defaultTheme = nil; static GSTheme *theTheme = nil; static NSMutableDictionary *themes = nil; static NSNull *null = nil; static NSMapTable *names = 0; typedef struct { NSBundle *bundle; NSColorList *colors; NSColorList *extraColors[GSThemeSelectedState+1]; NSMutableSet *imageNames; NSMutableDictionary *tiles[GSThemeSelectedState+1]; NSMutableSet *owned; NSImage *icon; NSString *name; Class colorClass; Class imageClass; NSMutableArray *overrides; } internal; #define _internal ((internal*)_reserved) #define _bundle _internal->bundle #define _colors _internal->colors #define _extraColors _internal->extraColors #define _imageNames _internal->imageNames #define _tiles _internal->tiles #define _owned _internal->owned #define _icon _internal->icon #define _name _internal->name #define _colorClass _internal->colorClass #define _imageClass _internal->imageClass #define _overrides _internal->overrides + (void) defaultsDidChange: (NSNotification*)n { NSUserDefaults *defs; NSString *name; defs = [NSUserDefaults standardUserDefaults]; name = [defs stringForKey: @"GSTheme"]; if (0 == [name length]) { name = @"GNUstep"; } else if ([[name pathExtension] isEqual: @"theme"]) { name = [name stringByDeletingPathExtension]; } if (NO == [[name lastPathComponent] isEqual: [theTheme name]]) { [self setTheme: [self loadThemeNamed: name]]; } } + (void) initialize { if (themes == nil) { themes = [NSMutableDictionary new]; null = RETAIN([NSNull null]); defaultTheme = [[self alloc] initWithBundle: nil]; ASSIGN(theTheme, defaultTheme); names = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks, NSIntMapValueCallBacks, 0); /* Establish the theme specified by the user defaults (if any); */ [self defaultsDidChange: nil]; } } + (GSTheme*) loadThemeNamed: (NSString*)aName { NSBundle *bundle; Class cls; GSTheme *instance; NSString *theme; if ([[aName pathExtension] isEqual: @"theme"]) { aName = [aName stringByDeletingPathExtension]; } if ([aName length] == 0 || [[aName lastPathComponent] isEqual: @"GNUstep"]) { return defaultTheme; } if ([aName isAbsolutePath] == YES) { theme = aName; } else { aName = [aName lastPathComponent]; } /* Ensure that the theme name has the 'theme' extension. */ if ([[aName pathExtension] isEqualToString: @"theme"] == YES) { theme = aName; } else { theme = [aName stringByAppendingPathExtension: @"theme"]; } bundle = [themes objectForKey: theme]; if (bundle == nil) { NSString *path = nil; NSFileManager *mgr = [NSFileManager defaultManager]; BOOL isDir; /* A theme may be either an absolute path or a filename to be located * in the Themes subdirectory of one of the standard Library directories. */ if ([theme isAbsolutePath] == YES) { if ([mgr fileExistsAtPath: theme isDirectory: &isDir] == YES && isDir == YES) { path = theme; } } else { NSEnumerator *enumerator; enumerator = [NSSearchPathForDirectoriesInDomains (NSAllLibrariesDirectory, NSAllDomainsMask, YES) objectEnumerator]; while ((path = [enumerator nextObject]) != nil) { path = [path stringByAppendingPathComponent: @"Themes"]; path = [path stringByAppendingPathComponent: theme]; if ([mgr fileExistsAtPath: path isDirectory: &isDir]) { break; } } } if (path == nil) { NSLog (@"No theme named '%@' found", aName); return nil; } else { bundle = [NSBundle bundleWithPath: path]; [themes setObject: bundle forKey: theme]; [bundle load]; // Ensure code is loaded. } } cls = [bundle principalClass]; if (cls == 0) { cls = self; } instance = [[cls alloc] initWithBundle: bundle]; return AUTORELEASE(instance); } + (void) orderFrontSharedThemePanel: (id)sender { GSThemePanel *panel; panel = [GSThemePanel sharedThemePanel]; [panel update: self]; [panel center]; [panel orderFront: self]; } + (void) setTheme: (GSTheme*)theme { if (theme == nil) { theme = defaultTheme; } if (theme != theTheme) { /* * Remove any previous observers... */ [[NSNotificationCenter defaultCenter] removeObserver: self]; [theTheme deactivate]; ASSIGN (theTheme, theme); [theTheme activate]; /* * Listen to notifications... */ [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(defaultsDidChange:) name: NSUserDefaultsDidChangeNotification object: nil]; } } + (GSTheme*) theme { return theTheme; } - (void) activate { NSUserDefaults *defs; NSMutableArray *searchList; NSEnumerator *enumerator; NSDictionary *infoDict; NSWindow *window; GSThemeControlState state; NSDebugMLLog(@"GSTheme", @"%@ %p", [self name], self); /* Get rid of any cached colors list so that we regenerate it when needed */ [_colors release]; _colors = nil; for (state = 0; state <= GSThemeSelectedState; state++) { [_extraColors[state] release]; _extraColors[state] = nil; } /* * Reload NSImage's cache of image by name */ [NSImage _reloadCachedImages]; /* * Use the GSThemeDomain key in the info dictionary of the theme to * set a defaults domain which will establish user defaults values * but will not override any defaults set explicitly by the user. * NB. For subclasses, the theme info dictionary may not be the same * as that of the bundle, so we don't use the bundle method directly. */ infoDict = [self infoDictionary]; defs = [NSUserDefaults standardUserDefaults]; searchList = [[defs searchList] mutableCopy]; if ([[infoDict objectForKey: @"GSThemeDomain"] isKindOfClass: [NSDictionary class]] == YES) { [defs removeVolatileDomainForName: @"GSThemeDomain"]; [defs setVolatileDomain: [infoDict objectForKey: @"GSThemeDomain"] forName: @"GSThemeDomain"]; if ([searchList containsObject: @"GSThemeDomain"] == NO) { NSUInteger index; /* * Higher priority than GSConfigDomain and NSRegistrationDomain, * but lower than NSGlobalDomain, NSArgumentDomain, and others * set by the user to be application specific. */ index = [searchList indexOfObject: GSConfigDomain]; if (index == NSNotFound) { index = [searchList indexOfObject: NSRegistrationDomain]; if (index == NSNotFound) { index = [searchList count]; } } [searchList insertObject: @"GSThemeDomain" atIndex: index]; [defs setSearchList: searchList]; } } else { [searchList removeObject: @"GSThemeDomain"]; [defs removeVolatileDomainForName: @"GSThemeDomain"]; } RELEASE(searchList); /* Install any overridden methods. */ if (_overrides != nil) { NSEnumerator *e = [_overrides objectEnumerator]; GSThemeMethod *m; while ((m = [e nextObject]) != nil) { method_setImplementation(m->mth, m->imp); } } /* * Tell subclass that basic activation is done and it can do its own. */ [[NSNotificationCenter defaultCenter] postNotificationName: GSThemeWillActivateNotification object: self userInfo: nil]; /* * Tell all other classes that new theme information is present. */ [[NSNotificationCenter defaultCenter] postNotificationName: GSThemeDidActivateNotification object: self userInfo: nil]; /* * Reset main menu to change between styles if necessary */ [[NSApp mainMenu] setMain: YES]; /* * Mark all windows as needing redisplaying to show the new theme. */ enumerator = [[NSApp windows] objectEnumerator]; while ((window = [enumerator nextObject]) != nil) { [[[window contentView] superview] setNeedsDisplay: YES]; } } - (NSArray*) authors { return [[self infoDictionary] objectForKey: @"GSThemeAuthors"]; } - (NSBundle*) bundle { return _bundle; } - (Class) colorClass { return [NSColorList class]; } - (void) colorFlush: (NSString*)aName state: (GSThemeControlState)elementState { int pos; int end; if (elementState > GSThemeSelectedState) { pos = 0; end = GSThemeSelectedState; } else { pos = elementState; end = elementState; } while (pos <= end) { if (_extraColors[pos] != nil) { [_extraColors[pos] release]; _extraColors[pos] = nil; } pos++; } } - (NSColor*) colorNamed: (NSString*)aName state: (GSThemeControlState)elementState { NSColor *c = nil; NSAssert(elementState <= GSThemeSelectedState, NSInvalidArgumentException); NSAssert(elementState >= 0, NSInvalidArgumentException); if (aName != nil) { if (_extraColors[elementState] == nil) { NSString *colorsPath; NSString *listName; NSString *resourceName; /* Attempt to load color list ... if the list is not found * or the load fails, set a null marker. */ switch (elementState) { default: case GSThemeNormalState: listName = @"ThemeExtra"; break; case GSThemeHighlightedState: listName = @"ThemeExtraHighlighted"; break; case GSThemeSelectedState: listName = @"ThemeExtraSelected"; break; } resourceName = [listName stringByAppendingString: @"Colors"]; colorsPath = [_bundle pathForResource: resourceName ofType: @"clr"]; if (colorsPath != nil) { _extraColors[elementState] = [[_colorClass alloc] initWithName: listName fromFile: colorsPath]; /* If the list is actually empty, we get rid of it to avoid * unnecessary lookups. */ if ([[_extraColors[elementState] allKeys] count] == 0) { [_extraColors[elementState] release]; _extraColors[elementState] = nil; } } if (_extraColors[elementState] == nil) { _extraColors[elementState] = (id)[null retain]; } } if (_extraColors[elementState] != (id)null) { c = [_extraColors[elementState] colorWithKey: aName]; } } return c; } - (NSColorList*) colors { if (_colors == nil) { NSString *colorsPath; colorsPath = [_bundle pathForResource: @"ThemeColors" ofType: @"clr"]; if (colorsPath == nil) { _colors = (id)[null retain]; } else { _colors = [[_colorClass alloc] initWithName: @"System" fromFile: colorsPath]; } } if ((id)_colors == (id)null) { return nil; } return _colors; } - (void) deactivate { NSDebugMLLog(@"GSTheme", @"%@ %p", [self name], self); /* Tell everything that we will become inactive. */ [[NSNotificationCenter defaultCenter] postNotificationName: GSThemeWillDeactivateNotification object: self userInfo: nil]; /* Remove any overridden methods. */ if (_overrides != nil) { NSEnumerator *e = [_overrides objectEnumerator]; GSThemeMethod *m; while ((m = [e nextObject]) != nil) { method_setImplementation(m->mth, m->old); } } [self _revokeOwnerships]; /* Tell everything that we have become inactive. */ [[NSNotificationCenter defaultCenter] postNotificationName: GSThemeDidDeactivateNotification object: self userInfo: nil]; } - (void) dealloc { if (_reserved != 0) { GSThemeControlState state; for (state = 0; state <= GSThemeSelectedState; state++) { RELEASE(_extraColors[state]); RELEASE(_tiles[state]); } RELEASE(_bundle); RELEASE(_colors); RELEASE(_imageNames); RELEASE(_icon); [self _revokeOwnerships]; RELEASE(_overrides); RELEASE(_owned); NSZoneFree ([self zone], _reserved); } [super dealloc]; } - (NSImage*) icon { if (_icon == nil) { NSString *path; path = [[self infoDictionary] objectForKey: @"GSThemeIcon"]; if (path != nil) { NSString *ext = [path pathExtension]; path = [path stringByDeletingPathExtension]; path = [_bundle pathForResource: path ofType: ext]; if (path != nil) { _icon = [[_imageClass alloc] initWithContentsOfFile: path]; } } if (_icon == nil) { _icon = RETAIN([_imageClass imageNamed: @"GNUstep"]); } else { NSSize s = [_icon size]; float scale = 1.0; if (s.height > 48.0) scale = 48.0 / s.height; if (48.0 / s.width < scale) scale = 48.0 / s.width; if (scale != 1.0) { [_icon setScalesWhenResized: YES]; s.height *= scale; s.width *= scale; [_icon setSize: s]; } } } return _icon; } - (Class) imageClass { return [NSImage class]; } - (id) initWithBundle: (NSBundle*)bundle { Class c = [self class]; unsigned int count; Method *methods; GSThemeMethod *mth; GSThemeControlState state; _reserved = NSZoneCalloc ([self zone], 1, sizeof(internal)); ASSIGN(_bundle, bundle); _imageNames = [NSMutableSet new]; for (state = 0; state <= GSThemeSelectedState; state++) { _tiles[state] = [NSMutableDictionary new]; } _owned = [NSMutableSet new]; ASSIGN(_name, [[[_bundle bundlePath] lastPathComponent] stringByDeletingPathExtension]); _colorClass = [self colorClass]; _imageClass = [self imageClass]; /* Now we look through our methods to find those which are actually * replacements to override methods in other classes. * That's determined by method name ... any method of the form * '_override' 'Method_' * is used to replace the original method in the class. * We maintain dictionaries (keyed by class) for instance and class * methods, so we can look up the original methods at runtime if the * replacement methods want to call them. */ methods = class_copyMethodList(c, &count); if (methods != NULL) { int counter = 0; while (methods[counter] != 0) { Method method = methods[counter++]; const char *name = sel_getName(method_getName(method)); const char *ptr; if (strncmp(name, "_override", 9) == 0 && (ptr = strstr(name, "Method_")) > 0) { char buf[strlen(name)]; const char *types; mth = [[GSThemeMethod new] autorelease]; types = method_getTypeEncoding(method); mth->imp = method_getImplementation(method); memcpy(buf, name + 9, (ptr - name) + 9); buf[(ptr - name) + 9] = '\0'; mth->cls = objc_lookUpClass(buf); if (mth->cls == 0) { NSLog(@"Unable to find class '%s' for '%s'", buf, name); continue; } memcpy(buf, ptr + 7, strlen(ptr + 7)); buf[strlen(ptr + 7)] = '\0'; mth->sel = sel_getUid(buf); if (mth->sel == 0) { NSLog(@"Unable to find selector '-%s' for '%s'", buf, name); continue; } if (NO == [mth->cls instancesRespondToSelector: mth->sel]) { NSLog(@"Instances do not respond for '%s'", name); continue; } mth->old = [mth->cls instanceMethodForSelector: mth->sel]; class_addMethod(mth->cls, mth->sel, mth->imp, types); mth->mth = class_getInstanceMethod(mth->cls, mth->sel); if (_overrides == nil) { _overrides = [NSMutableArray new]; } [_overrides addObject: mth]; } } free(methods); } methods = class_copyMethodList(object_getClass(c), &count); if (methods != NULL) { int counter = 0; while (methods[counter] != 0) { Method method = methods[counter++]; const char *name = sel_getName(method_getName(method)); const char *ptr; if (strncmp(name, "_override", 9) == 0 && (ptr = strstr(name, "Method_")) > 0) { char buf[strlen(name)]; const char *types; Class cls; mth = [[GSThemeMethod new] autorelease]; types = method_getTypeEncoding(method); mth->imp = method_getImplementation(method); memcpy(buf, name + 9, (ptr - name) + 9); buf[(ptr - name) + 9] = '\0'; cls = objc_lookUpClass(buf); if (cls == 0) { NSLog(@"Unable to find class '%s' for '%s'", buf, name); continue; } mth->cls = object_getClass(cls); memcpy(buf, ptr + 7, strlen(ptr + 7)); buf[strlen(ptr + 7)] = '\0'; mth->sel = sel_getUid(buf); if (mth->sel == 0) { NSLog(@"Unable to find selector '-%s' for '%s'", buf, name); continue; } if (NO == [cls respondsToSelector: mth->sel]) { NSLog(@"Class does not respond for '%s'", name); continue; } mth->old = [cls methodForSelector: mth->sel]; class_addMethod(mth->cls, mth->sel, mth->imp, types); mth->mth = class_getClassMethod(cls, mth->sel); if (_overrides == nil) { _overrides = [NSMutableArray new]; } [_overrides addObject: mth]; } } free(methods); } return self; } - (NSDictionary*) infoDictionary { return [_bundle infoDictionary]; } - (NSString*) name { if (self == defaultTheme) { _name = @"GNUstep"; } return _name; } - (NSString*) nameForElement: (id)anObject { NSString *name = (NSString*)NSMapGet(names, (void*)anObject); return name; } - (IMP) overriddenMethod: (SEL)selector for: (id)receiver { Class cls = object_getClass(receiver); NSEnumerator *e = [_overrides objectEnumerator]; GSThemeMethod *m; while ((m = [e nextObject]) != nil) { if (m->cls == cls && sel_isEqual(selector, m->sel)) { return m->old; } } return (IMP)0; } - (void) setName: (NSString*)aString { if (self != defaultTheme) { ASSIGNCOPY(_name, aString); } } - (void) setName: (NSString*)aString forElement: (id)anObject temporary: (BOOL)takeOwnership { if (aString == nil) { if (anObject == nil) { /* Ignore this ... it's most likely a partially initialised * control being deallocated and removing the name for a * subsidiary item which was never allocated in the first place. */ return; } NSMapRemove(names, (void*)anObject); [_owned removeObject: anObject]; } else { if (anObject == nil) { [NSException raise: NSInvalidArgumentException format: @"[%@-%@] nil object supplied", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; } NSMapInsert(names, (void*)anObject, (void*)aString); if (takeOwnership == YES) { [_owned addObject: anObject]; } else { [_owned removeObject: anObject]; } } } - (NSWindow*) themeInspector { return [GSThemeInspector sharedThemeInspector]; } - (void) tilesFlush: (NSString*)aName state: (GSThemeControlState)elementState { int pos; int end; if (elementState > GSThemeSelectedState) { pos = 0; end = GSThemeSelectedState; } else { pos = elementState; end = elementState; } while (pos <= end) { NSMutableDictionary *cache; cache = _tiles[pos++]; if (aName == nil) { return [cache removeAllObjects]; } else { [cache removeObjectForKey: aName]; } } } - (GSDrawTiles*) tilesNamed: (NSString*)aName state: (GSThemeControlState)elementState { GSDrawTiles *tiles; NSMutableDictionary *cache; NSAssert(elementState <= GSThemeSelectedState, NSInvalidArgumentException); NSAssert(elementState >= 0, NSInvalidArgumentException); if (aName == nil) { return nil; } cache = _tiles[elementState]; tiles = [cache objectForKey: aName]; if (tiles == nil) { NSDictionary *info; NSImage *image; NSString *fullName; switch (elementState) { default: case GSThemeNormalState: fullName = aName; break; case GSThemeFirstResponderState: fullName = [aName stringByAppendingString: @"FirstResponder"]; break; case GSThemeDisabledState: fullName = [aName stringByAppendingString: @"Disabled"]; break; case GSThemeHighlightedFirstResponderState: fullName = [aName stringByAppendingString: @"HighlightedFirstResponder"]; break; case GSThemeHighlightedState: fullName = [aName stringByAppendingString: @"Highlighted"]; break; case GSThemeSelectedFirstResponderState: fullName = [aName stringByAppendingString: @"SelectedFirstResponder"]; break; case GSThemeSelectedState: fullName = [aName stringByAppendingString: @"Selected"]; break; } /* The GSThemeTiles entry in the info dictionary should be a * dictionary containing information about each set of tiles. * Keys are: * FileName Name of the file in the ThemeTiles directory * HorizontalDivision Where to divide the image into columns. * VerticalDivision Where to divide the image into rows. */ info = [self infoDictionary]; info = [[info objectForKey: @"GSThemeTiles"] objectForKey: fullName]; if ([info isKindOfClass: [NSDictionary class]] == YES) { float x; float y; NSString *name; NSString *path; NSString *file; NSString *ext; GSThemeFillStyle style; name = [info objectForKey: @"FillStyle"]; style = GSThemeFillStyleFromString(name); if (style < GSThemeFillStyleNone) style = GSThemeFillStyleNone; x = [[info objectForKey: @"HorizontalDivision"] floatValue]; y = [[info objectForKey: @"VerticalDivision"] floatValue]; file = [info objectForKey: @"FileName"]; ext = [file pathExtension]; file = [file stringByDeletingPathExtension]; path = [_bundle pathForResource: file ofType: ext inDirectory: @"ThemeTiles"]; if (path == nil) { NSLog(@"File %@.%@ not found in ThemeTiles", file, ext); } else { image = [[_imageClass alloc] initWithContentsOfFile: path]; if (image != nil) { if ([[info objectForKey: @"NinePatch"] boolValue] || [file hasSuffix: @".9"]) { tiles = [[GSDrawTiles alloc] initWithNinePatchImage: image]; [tiles setFillStyle: GSThemeFillStyleScaleAll]; } else { tiles = [[GSDrawTiles alloc] initWithImage: image horizontal: x vertical: y]; [tiles setFillStyle: style]; } RELEASE(image); } } } if (tiles == nil) { NSString *imagePath; // Try 9-patch first imagePath = [_bundle pathForResource: fullName ofType: @"9.png" inDirectory: @"ThemeTiles"]; if (imagePath != nil) { image = [[_imageClass alloc] initWithContentsOfFile: imagePath]; if (image != nil) { tiles = [[GSDrawTiles alloc] initWithNinePatchImage: image]; [tiles setFillStyle: GSThemeFillStyleScaleAll]; RELEASE(image); } } } if (tiles == nil) { NSArray *imageTypes; NSString *imagePath; unsigned count; imageTypes = [_imageClass imageFileTypes]; for (count = 0; count < [imageTypes count]; count++) { NSString *ext = [imageTypes objectAtIndex: count]; imagePath = [_bundle pathForResource: fullName ofType: ext inDirectory: @"ThemeTiles"]; if (imagePath != nil) { image = [[_imageClass alloc] initWithContentsOfFile: imagePath]; if (image != nil) { tiles = [[GSDrawTiles alloc] initWithImage: image]; RELEASE(image); break; } } } } if (tiles == nil) { [cache setObject: null forKey: aName]; } else { [cache setObject: tiles forKey: aName]; RELEASE(tiles); } } if (tiles == (id)null) { tiles = nil; } return tiles; } - (NSString*) versionString { return [[self infoDictionary] objectForKey: @"GSThemeVersion"]; } - (NSString *) license { return [[self infoDictionary] objectForKey: @"GSThemeLicense"]; } @end @implementation GSTheme (Private) /* Remove all temporarily named objects from our registry, releasing them. */ - (void) _revokeOwnerships { id o; while ((o = [_owned anyObject]) != nil) { [self setName: nil forElement: o temporary: YES]; } } @end @implementation GSThemeProxy - (id) _resource { return _resource; } - (void) _setResource: (id)resource { ASSIGN(_resource, resource); } - (void) dealloc { DESTROY(_resource); [super dealloc]; } - (NSString*) description { return [_resource description]; } - (id) forwardingTargetForSelector:(SEL)aSelector { return _resource; } - (void) forwardInvocation: (NSInvocation*)anInvocation { [anInvocation invokeWithTarget: _resource]; } - (NSMethodSignature*) methodSignatureForSelector: (SEL)aSelector { if (_resource != nil) { return [_resource methodSignatureForSelector: aSelector]; } else { /* * Evil hack to prevent recursion - if we are asking a remote * object for a method signature, we can't ask it for the * signature of methodSignatureForSelector:, so we hack in * the signature required manually :-( */ if (sel_isEqual(aSelector, _cmd)) { static NSMethodSignature *sig = nil; if (sig == nil) { sig = RETAIN([NSMethodSignature signatureWithObjCTypes: "@@::"]); } return sig; } return nil; } } @end gnustep-gui-0.24.0/Source/NSTabView.m0000664000076500007650000004465312227167160017202 0ustar brains99brains99/** NSTabView The tabular view class Copyright (C) 1999,2000 Free Software Foundation, Inc. Author: Michael Hanni Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import "AppKit/NSColor.h" #import "AppKit/NSEvent.h" #import "AppKit/NSFont.h" #import "AppKit/NSFontManager.h" #import "AppKit/NSForm.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSImage.h" #import "AppKit/NSKeyValueBinding.h" #import "AppKit/NSMatrix.h" #import "AppKit/NSTabView.h" #import "AppKit/NSTabViewItem.h" #import "AppKit/NSWindow.h" #import "GNUstepGUI/GSTheme.h" #import "GSBindingHelpers.h" #import "NSViewPrivate.h" @interface NSTabViewItem (KeyViewLoop) - (void) _setUpKeyViewLoopWithNextKeyView: (NSView *)nextKeyView; - (NSView *) _lastKeyView; @end @implementation NSTabView /* * Class methods */ + (void) initialize { if (self == [NSTabView class]) { [self setVersion: 3]; [self exposeBinding: NSSelectedIndexBinding]; [self exposeBinding: NSFontBinding]; [self exposeBinding: NSFontNameBinding]; [self exposeBinding: NSFontSizeBinding]; } } - (id) initWithFrame: (NSRect)rect { self = [super initWithFrame: rect]; if (self) { // setup variables ASSIGN(_items, [NSMutableArray array]); ASSIGN(_font, [NSFont systemFontOfSize: 0]); _selected = nil; //_truncated_label = NO; } return self; } - (void) dealloc { // Reset the _selected attribute to prevent crash when -dealloc calls // -setNextKeyView: _selected = nil; RELEASE(_items); RELEASE(_font); [super dealloc]; } - (BOOL) isFlipped { return YES; } // tab management. - (void) addTabViewItem: (NSTabViewItem*)tabViewItem { [self insertTabViewItem: tabViewItem atIndex: [_items count]]; } - (void) insertTabViewItem: (NSTabViewItem*)tabViewItem atIndex: (NSInteger)index { if (tabViewItem == nil) return; [tabViewItem _setTabView: self]; [_items insertObject: tabViewItem atIndex: index]; // If this is the first inserted then select it... if ([_items count] == 1) [self selectTabViewItem: tabViewItem]; if ([_delegate respondsToSelector: @selector(tabViewDidChangeNumberOfTabViewItems:)]) { [_delegate tabViewDidChangeNumberOfTabViewItems: self]; } /* TODO (Optimize) - just mark the tabs rect as needing redisplay */ [self setNeedsDisplay: YES]; } - (void) removeTabViewItem: (NSTabViewItem*)tabViewItem { NSUInteger i = [self indexOfTabViewItem: tabViewItem]; if (i == NSNotFound) return; RETAIN(tabViewItem); // Do this BEFORE removing from array...in case it gets released... [tabViewItem _setTabView: nil]; [_items removeObjectAtIndex: i]; if (tabViewItem == _selected) { if ([_items count] == 0) { [self selectTabViewItem: nil]; } else { // Select a new tab index... NSUInteger newIndex = ((i < [_items count]) ? i : (i-1)); [self selectTabViewItem: [_items objectAtIndex: newIndex]]; } } RELEASE(tabViewItem); if ([_delegate respondsToSelector: @selector(tabViewDidChangeNumberOfTabViewItems:)]) { [_delegate tabViewDidChangeNumberOfTabViewItems: self]; } } - (NSInteger) indexOfTabViewItem: (NSTabViewItem*)tabViewItem { return [_items indexOfObject: tabViewItem]; } - (NSInteger) indexOfTabViewItemWithIdentifier: (id)identifier { NSUInteger howMany = [_items count]; NSUInteger i; for (i = 0; i < howMany; i++) { id anItem = [_items objectAtIndex: i]; if ([[anItem identifier] isEqual: identifier]) return i; } return NSNotFound; } - (NSInteger) numberOfTabViewItems { return [_items count]; } - (NSTabViewItem*) tabViewItemAtIndex: (NSInteger)index { return [_items objectAtIndex: index]; } - (NSArray*) tabViewItems { return (NSArray*)_items; } - (void) selectFirstTabViewItem: (id)sender { [self selectTabViewItemAtIndex: 0]; } - (void) selectLastTabViewItem: (id)sender { [self selectTabViewItem: [_items lastObject]]; } - (void) selectNextTabViewItem: (id)sender { NSUInteger selected_item = [self indexOfTabViewItem:_selected]; if (selected_item != NSNotFound) { [self selectTabViewItemAtIndex: selected_item + 1]; } } - (void) selectPreviousTabViewItem: (id)sender { NSUInteger selected_item = [self indexOfTabViewItem:_selected]; if (selected_item != NSNotFound) { [self selectTabViewItemAtIndex: selected_item - 1]; } } - (NSTabViewItem*) selectedTabViewItem { return _selected; } - (void) selectTabViewItem: (NSTabViewItem*)tabViewItem { BOOL canSelect = YES; NSView *selectedView = nil; if ([_delegate respondsToSelector: @selector(tabView:shouldSelectTabViewItem:)]) { canSelect = [_delegate tabView: self shouldSelectTabViewItem: tabViewItem]; } if (canSelect) { if ([_delegate respondsToSelector: @selector(tabView:willSelectTabViewItem:)]) { [_delegate tabView: self willSelectTabViewItem: tabViewItem]; } if (_selected != nil) { [_selected _setTabState: NSBackgroundTab]; /* NB: If [_selected view] is nil this does nothing, which is fine. */ [[_selected view] removeFromSuperview]; } _selected = tabViewItem; [_selected _setTabState: NSSelectedTab]; selectedView = [_selected view]; if (selectedView != nil) { NSView *firstResponder; [self addSubview: selectedView]; // FIXME: We should not change this mask [selectedView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [selectedView setFrame: [self contentRect]]; firstResponder = [_selected initialFirstResponder]; if (firstResponder == nil) { firstResponder = [_selected view]; [_selected setInitialFirstResponder: firstResponder]; [firstResponder _setUpKeyViewLoopWithNextKeyView: _original_nextKeyView]; } [self setNextKeyView: firstResponder]; [_window makeFirstResponder: firstResponder]; } /* Will need to redraw tabs and content area. */ [self setNeedsDisplay: YES]; if ([_delegate respondsToSelector: @selector(tabView:didSelectTabViewItem:)]) { [_delegate tabView: self didSelectTabViewItem: _selected]; } } } - (void) selectTabViewItemAtIndex: (NSInteger)index { if (index < 0 || index >= [_items count]) [self selectTabViewItem: nil]; else [self selectTabViewItem: [_items objectAtIndex: index]]; } - (void) selectTabViewItemWithIdentifier: (id)identifier { NSInteger index = [self indexOfTabViewItemWithIdentifier: identifier]; [self selectTabViewItemAtIndex: index]; } - (void) takeSelectedTabViewItemFromSender: (id)sender { NSInteger index = -1; if ([sender respondsToSelector: @selector(indexOfSelectedItem)] == YES) { index = [sender indexOfSelectedItem]; } else if ([sender isKindOfClass: [NSMatrix class]] == YES) { NSInteger cols = [sender numberOfColumns]; NSInteger row = [sender selectedRow]; NSInteger col = [sender selectedColumn]; if (row >= 0 && col >= 0) { index = row * cols + col; } } [self selectTabViewItemAtIndex: index]; } - (void) setFont: (NSFont*)font { ASSIGN(_font, font); } - (NSFont*) font { return _font; } - (void) setTabViewType: (NSTabViewType)tabViewType { _type = tabViewType; } - (NSTabViewType) tabViewType { return _type; } - (void) setDrawsBackground: (BOOL)flag { _draws_background = flag; } - (BOOL) drawsBackground { return _draws_background; } - (void) setAllowsTruncatedLabels: (BOOL)allowTruncatedLabels { _truncated_label = allowTruncatedLabels; } - (BOOL) allowsTruncatedLabels { return _truncated_label; } - (void) setDelegate: (id)anObject { _delegate = anObject; } - (id) delegate { return _delegate; } // content and size - (NSSize) minimumSize { switch (_type) { case NSTopTabsBezelBorder: return NSMakeSize(3, 19); case NSNoTabsBezelBorder: return NSMakeSize(3, 3); case NSNoTabsLineBorder: return NSMakeSize(2, 2); case NSBottomTabsBezelBorder: return NSMakeSize(3, 19); case NSLeftTabsBezelBorder: return NSMakeSize(21, 3); case NSRightTabsBezelBorder: return NSMakeSize(21, 3); case NSNoTabsNoBorder: default: return NSZeroSize; } } - (NSRect) contentRect { NSRect result = [[GSTheme theme] tabViewContentRectForBounds: _bounds tabViewType: [self tabViewType] tabView: self]; return result; } // Drawing. - (void) drawRect: (NSRect)rect { // Make sure some tab is selected if ((_selected == nil) && ([_items count] > 0)) { [self selectFirstTabViewItem: nil]; } [[GSTheme theme] drawTabViewRect: rect inView: self withItems: _items selectedItem: _selected]; } - (BOOL) isOpaque { return NO; } // Event handling. /* * Find the tab view item containing the NSPoint point. This point * is expected to be alreay in the coordinate system of the tab view. */ - (NSTabViewItem*) tabViewItemAtPoint: (NSPoint)point { NSInteger howMany = [_items count]; NSInteger i; for (i = 0; i < howMany; i++) { NSTabViewItem *anItem = [_items objectAtIndex: i]; if (NSPointInRect(point, [anItem _tabRect])) return anItem; } return nil; } - (void) mouseDown: (NSEvent *)theEvent { NSPoint location = [self convertPoint: [theEvent locationInWindow] fromView: nil]; NSTabViewItem *anItem = [self tabViewItemAtPoint: location]; if (anItem != nil && ![anItem isEqual: _selected]) { [self selectTabViewItem: anItem]; GSKeyValueBinding *theBinding = [GSKeyValueBinding getBinding: NSSelectedIndexBinding forObject: self]; if (theBinding != nil) [theBinding reverseSetValueFor: NSSelectedIndexBinding]; } } - (NSControlSize) controlSize { // FIXME return NSRegularControlSize; } /** * Not implemented. */ - (void) setControlSize: (NSControlSize)controlSize { // FIXME } - (NSControlTint) controlTint { // FIXME return NSDefaultControlTint; } /** * Not implemented. */ - (void) setControlTint: (NSControlTint)controlTint { // FIXME } // Coding. - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { unsigned int type = _type; // no flags set... [aCoder encodeBool: [self allowsTruncatedLabels] forKey: @"NSAllowTruncatedLabels"]; [aCoder encodeBool: [self drawsBackground] forKey: @"NSDrawsBackground"]; [aCoder encodeObject: [self font] forKey: @"NSFont"]; [aCoder encodeObject: _items forKey: @"NSTabViewItems"]; [aCoder encodeObject: [self selectedTabViewItem] forKey: @"NSSelectedTabViewItem"]; [aCoder encodeInt: type forKey: @"NSTvFlags"]; } else { NSUInteger selected_item = [self indexOfTabViewItem:_selected]; [aCoder encodeObject: _items]; [aCoder encodeObject: _font]; [aCoder encodeValueOfObjCType: @encode(int) at: &_type]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_draws_background]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_truncated_label]; [aCoder encodeConditionalObject: _delegate]; [aCoder encodeValueOfObjCType: @encode(NSUInteger) at: &selected_item]; } } - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if ([aDecoder allowsKeyedCoding]) { if ([aDecoder containsValueForKey: @"NSAllowTruncatedLabels"]) { [self setAllowsTruncatedLabels: [aDecoder decodeBoolForKey: @"NSAllowTruncatedLabels"]]; } if ([aDecoder containsValueForKey: @"NSDrawsBackground"]) { [self setDrawsBackground: [aDecoder decodeBoolForKey: @"NSDrawsBackground"]]; } if ([aDecoder containsValueForKey: @"NSFont"]) { [self setFont: [aDecoder decodeObjectForKey: @"NSFont"]]; } if ([aDecoder containsValueForKey: @"NSTvFlags"]) { int vFlags = [aDecoder decodeIntForKey: @"NSTvFlags"]; [self setControlTint: ((vFlags & 0x70000000) >> 28)]; [self setControlSize: ((vFlags & 0x0c000000) >> 26)]; [self setTabViewType: (vFlags & 0x00000007)]; } if ([aDecoder containsValueForKey: @"NSTabViewItems"]) { ASSIGN(_items, [aDecoder decodeObjectForKey: @"NSTabViewItems"]); } if ([aDecoder containsValueForKey: @"NSSelectedTabViewItem"]) { // N.B.: As a side effect, this discards the subview frame // and sets it to [self contentRect]. // // This is desirable because the subview frame will be different // depending on whether the arcive is from Cocoa or GNUstep, // and which GNUstep theme was active at save time. // // However, it does mean that the tab view contents should be // prepared to resize slightly. [self selectTabViewItem: [aDecoder decodeObjectForKey: @"NSSelectedTabViewItem"]]; } } else { int version = [aDecoder versionForClassName: @"NSTabView"]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_items]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_font]; [aDecoder decodeValueOfObjCType: @encode(int) at: &_type]; if (version < 2) { switch(_type) { case 0: _type = NSTopTabsBezelBorder; break; case 5: _type = NSLeftTabsBezelBorder; break; case 1: _type = NSBottomTabsBezelBorder; break; case 6: _type = NSRightTabsBezelBorder; break; case 2: _type = NSNoTabsBezelBorder; break; case 3: _type = NSNoTabsLineBorder; break; case 4: _type = NSNoTabsNoBorder; break; default: break; } } [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_draws_background]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_truncated_label]; _delegate = [aDecoder decodeObject]; NSUInteger selected_item = NSNotFound; if (version < 3) { int tmp; [aDecoder decodeValueOfObjCType: @encode(int) at: &tmp]; selected_item = tmp; } else { [aDecoder decodeValueOfObjCType: @encode(NSUInteger) at: &selected_item]; } // N.B. Recalculates subview frame; see comment above. [self selectTabViewItemAtIndex: selected_item]; } return self; } - (void) setValue: (id)anObject forKey: (NSString*)aKey { if ([aKey isEqual: NSSelectedIndexBinding]) { [self selectTabViewItemAtIndex: [anObject intValue]]; } else if ([aKey isEqual: NSFontNameBinding]) { [self setFont: [[NSFontManager sharedFontManager] convertFont: [self font] toFace: anObject]]; } else if ([aKey isEqual: NSFontSizeBinding]) { [self setFont: [[NSFontManager sharedFontManager] convertFont: [self font] toSize: [anObject doubleValue]]]; } else { [super setValue: anObject forKey: aKey]; } } - (id) valueForKey: (NSString*)aKey { if ([aKey isEqual: NSSelectedIndexBinding]) { return [NSNumber numberWithInt: [self indexOfTabViewItem: [self selectedTabViewItem]]]; } else if ([aKey isEqual: NSFontNameBinding]) { return [[self font] fontName]; } else if ([aKey isEqual: NSFontSizeBinding]) { return [NSNumber numberWithDouble: (double)[[self font] pointSize]]; } else { return [super valueForKey: aKey]; } } @end @implementation NSTabViewItem (KeyViewLoop) - (void) _setUpKeyViewLoopWithNextKeyView: (NSView *)nextKeyView { [self setInitialFirstResponder: [self view]]; [[self view] _setUpKeyViewLoopWithNextKeyView: nextKeyView]; } - (NSView *) _lastKeyView { NSView *keyView = [self initialFirstResponder]; NSView *itemView = [self view]; NSView *lastKeyView = nil; NSMutableArray *views = // cycle protection [[NSMutableArray alloc] initWithCapacity: 1 + [[itemView subviews] count]]; if (keyView == nil && itemView != nil) { [self _setUpKeyViewLoopWithNextKeyView: itemView]; } while ([keyView isDescendantOf: itemView] && ![views containsObject: keyView]) { [views addObject: keyView]; lastKeyView = keyView; keyView = [keyView nextKeyView]; } [views release]; return lastKeyView; } @end @implementation NSTabView (KeyViewLoop) - (void) _setUpKeyViewLoopWithNextKeyView: (NSView *)nextKeyView { [_items makeObjectsPerform: @selector(_setUpKeyViewLoopWithNextKeyView:) withObject: nextKeyView]; if (_selected) { [super setNextKeyView: [_selected initialFirstResponder]]; } [self setNextKeyView: nextKeyView]; } - (void) setNextKeyView: (NSView *)nextKeyView { _original_nextKeyView = nextKeyView; if (_selected) { [[_selected _lastKeyView] setNextKeyView: nextKeyView]; } else { [super setNextKeyView: nextKeyView]; } } @end gnustep-gui-0.24.0/Source/GSGhostscriptImageRep.m0000664000076500007650000001721011703102746021537 0ustar brains99brains99/** GSGhostscriptImageRep Ghostscript image representation. Copyright (C) 2011 Free Software Foundation, Inc. Author: Eric Wasylishen Date: June 2011 This file is part of the GNUstep Application Kit Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import #import #import #import #import #import "AppKit/NSImageRep.h" #import "AppKit/NSPasteboard.h" #import "AppKit/NSGraphicsContext.h" #import "GNUstepGUI/GSGhostscriptImageRep.h" @implementation GSGhostscriptImageRep + (BOOL) canInitWithData: (NSData *)data { char buf[4]; if ([data length] < 4) { return NO; } [data getBytes: buf length: 4]; // Simple check for PostScript or EPS, Windows EPS, PDF if ((buf[0] == '%' && buf[1] == '!' && buf[2] == 'P' && buf[3] == 'S') || (buf[0] == '\xc5' && buf[1] == '\xd0' && buf[2] == '\xd3' && buf[3] == '\xc6') || (buf[0] == '%' && buf[1] == 'P' && buf[2] == 'D' && buf[3] == 'F')) { return YES; } else { return NO; } } + (NSArray *) imageUnfilteredFileTypes { static NSArray *types = nil; if (types == nil) { types = [[NSArray alloc] initWithObjects: @"ps", @"eps", @"pdf", nil]; } return types; } + (NSArray *) imageUnfilteredPasteboardTypes { static NSArray *types = nil; if (types == nil) { types = [[NSArray alloc] initWithObjects: NSPostScriptPboardType, NSPDFPboardType, nil]; } return types; } // Locating Ghostscript - (NSString *) _PATHSeparator { NSProcessInfo *pinfo = [NSProcessInfo processInfo]; const NSInteger os = [pinfo operatingSystem]; if (os == NSWindowsNTOperatingSystem || os == NSWindows95OperatingSystem) { return @";"; } else { return @":"; } } - (NSArray *) _PATHDirectories { NSProcessInfo *pinfo = [NSProcessInfo processInfo]; NSString *PATH = [[pinfo environment] objectForKey: @"PATH"]; NSString *separator = [self _PATHSeparator]; if (PATH != nil) { return [PATH componentsSeparatedByString: separator]; } else { return [NSArray array]; } } - (NSString *) _pathForExecutable: (NSString *)executable { NSFileManager *fm = [NSFileManager defaultManager]; NSArray *PATHDirectories = [self _PATHDirectories]; NSEnumerator *enumerator = [PATHDirectories objectEnumerator]; id object; while ((object = [enumerator nextObject]) != nil) { NSString *path = [object stringByAppendingPathComponent: executable]; if ([fm isExecutableFileAtPath: path]) { return path; } } return nil; } - (NSString *) _ghostscriptExecutablePath { NSString *result = [[NSUserDefaults standardUserDefaults] stringForKey: @"GSGhostscriptExecutablePath"]; if (result == nil) { static BOOL searched = NO; static NSString *resultOfSearch = nil; // Only search PATH once. if (!searched) { searched = YES; ASSIGN(resultOfSearch, [self _pathForExecutable: @"gs"]); if (resultOfSearch == nil) { ASSIGN(resultOfSearch, [self _pathForExecutable: @"gswin32c.exe"]); } if (resultOfSearch == nil) { NSLog(@"GNUstep was unable to locate the Ghostscript executable in your PATH. If you would like to use Ghostscript to render PDF, PS, or PS images, please set the GSGhostscriptExecutablePath user default to the full path to the gs executable or ensure Ghostscript is installed and located in your PATH."); } } result = resultOfSearch; } return result; } // Launching Ghostscript - (NSData *) _pngWithGhostscriptData: (NSData *)psData atResolution: (CGFloat)res { NSTask *task = [[[NSTask alloc] init] autorelease]; NSPipe *inputPipe = [NSPipe pipe]; NSPipe *outputPipe = [NSPipe pipe]; NSFileHandle *inputHandle = [inputPipe fileHandleForWriting]; NSFileHandle *outputHandle = [outputPipe fileHandleForReading]; NSData *result = nil; NSString *launchPath = [self _ghostscriptExecutablePath]; NS_DURING { [task setLaunchPath: launchPath]; [task setArguments: [NSArray arrayWithObjects: @"-dSAFER", @"-q", @"-o", @"-", // Write output image to stdout @"-sDEVICE=pngalpha", [NSString stringWithFormat: @"-r%d", (int)res], @"-dTextAlphaBits=4", @"-dGraphicsAlphaBits=4", @"-dDOINTERPOLATE", @"-dFirstPage=1", @"-dLastPage=1", // pngalpha device can only print 1 page @"-", // Read input from stdin nil]]; [task setStandardInput: inputPipe]; [task setStandardOutput: outputPipe]; [task launch]; [inputHandle writeData: psData]; [inputHandle closeFile]; result = [outputHandle readDataToEndOfFile]; [outputHandle closeFile]; if (![task isRunning] && [task terminationStatus] != 0) { NSLog(@"Ghostscript returned exit status %d", [task terminationStatus]); } } NS_HANDLER { static BOOL warned = NO; if (!warned) { warned = YES; NSLog(@"An error occurred while attempting to invoke Ghostscript at the following path: %@", launchPath); } } NS_ENDHANDLER return result; } // Initializing a New Instance + (id) imageRepWithData: (NSData *)psData { return AUTORELEASE([[self alloc] initWithData: psData]); } - (id) initWithData: (NSData *)psData { NSData *pngData; ASSIGN(_psData, psData); pngData = [self _pngWithGhostscriptData: _psData atResolution: 72.0]; if (pngData == nil) { [self release]; return nil; } ASSIGN(_bitmap, [NSBitmapImageRep imageRepWithData: pngData]); [self setSize: [_bitmap size]]; [self setAlpha: [_bitmap hasAlpha]]; [self setBitsPerSample: NSImageRepMatchesDevice]; [self setPixelsWide: NSImageRepMatchesDevice]; [self setPixelsHigh: NSImageRepMatchesDevice]; // FIXME: Other properties? return self; } // Drawing the Image - (BOOL) draw { if (_bitmap != nil) { // FIXME: Re-cache at a higher resolution if needed return [_bitmap draw]; } return NO; } // NSCopying protocol - (id) copyWithZone: (NSZone *)zone { GSGhostscriptImageRep *copy = [super copyWithZone: zone]; copy->_psData = [_psData copyWithZone: zone]; copy->_bitmap = [_bitmap copyWithZone: zone]; return copy; } // NSCoding protocol - (void) encodeWithCoder: (NSCoder*)aCoder { // FIXME: [super encodeWithCoder: aCoder]; [_psData encodeWithCoder: aCoder]; } - (id) initWithCoder: (NSCoder*)aDecoder { // FIXME: NSData *data; self = [super initWithCoder: aDecoder]; data = [aDecoder decodeObject]; return [self initWithData: data]; } @end gnustep-gui-0.24.0/Source/GSStandardWindowDecorationView.m0000664000076500007650000002462512107547001023413 0ustar brains99brains99/** GSStandardWindowDecorationView Copyright (C) 2004 Free Software Foundation, Inc. Author: Alexander Malmberg Date: 2004-03-24 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSAttributedString.h" #import "AppKit/NSButton.h" #import "AppKit/NSEvent.h" #import "AppKit/NSImage.h" #import "AppKit/NSParagraphStyle.h" #import "AppKit/NSScreen.h" #import "AppKit/NSStringDrawing.h" #import "AppKit/NSWindow.h" #import "AppKit/PSOperators.h" #import "GNUstepGUI/GSDisplayServer.h" #import "GNUstepGUI/GSTheme.h" #import @interface GSStandardWindowDecorationView (GSTheme) - (void) _themeDidActivate: (NSNotification*)notification; @end @implementation GSStandardWindowDecorationView + (void) offsets: (float *)l : (float *)r : (float *)t : (float *)b forStyleMask: (NSUInteger)style { GSTheme *theme = [GSTheme theme]; if (style & (NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask)) { *l = *r = *t = *b = 1.0; } else { *l = *r = *t = *b = 0.0; } if (style & (NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask)) { *t = [theme titlebarHeight]; } if (style & NSResizableWindowMask) { *b = [theme resizebarHeight]; } } + (CGFloat) minFrameWidthWithTitle: (NSString *)aTitle styleMask: (NSUInteger)aStyle { float l, r, t, b, width; [self offsets: &l : &r : &t : &b forStyleMask: aStyle]; width = l + r; if (aStyle & NSTitledWindowMask) { width += [aTitle sizeWithAttributes: nil].width; } return width; } - (void) updateRects { GSTheme *theme = [GSTheme theme]; if (hasTitleBar) { CGFloat titleHeight = [theme titlebarHeight]; titleBarRect = NSMakeRect(0.0, [self bounds].size.height - titleHeight, [self bounds].size.width, titleHeight); } if (hasResizeBar) { resizeBarRect = NSMakeRect(0.0, 0.0, [self bounds].size.width, [theme resizebarHeight]); } if (hasCloseButton) { closeButtonRect = NSMakeRect( [self bounds].size.width - 15 - 4, [self bounds].size.height - 15 - 4, 15, 15); [closeButton setFrame: closeButtonRect]; } if (hasMiniaturizeButton) { miniaturizeButtonRect = NSMakeRect( 4, [self bounds].size.height - 15 - 4, 15, 15); [miniaturizeButton setFrame: miniaturizeButtonRect]; } } - (id) initWithFrame: (NSRect)frame window: (NSWindow *)w { NSUInteger styleMask; self = [super initWithFrame: frame window: w]; if (!self) return nil; styleMask = [w styleMask]; if (styleMask & (NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask)) { hasTitleBar = YES; } if (styleMask & NSTitledWindowMask) { isTitled = YES; } if (styleMask & NSClosableWindowMask) { hasCloseButton = YES; closeButton = [NSWindow standardWindowButton: NSWindowCloseButton forStyleMask: styleMask]; [closeButton setTarget: window]; [self addSubview: closeButton]; } if (styleMask & NSMiniaturizableWindowMask) { hasMiniaturizeButton = YES; miniaturizeButton = [NSWindow standardWindowButton: NSWindowMiniaturizeButton forStyleMask: styleMask]; [miniaturizeButton setTarget: window]; [self addSubview: miniaturizeButton]; } if (styleMask & NSResizableWindowMask) { hasResizeBar = YES; } [self updateRects]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_themeDidActivate:) name: GSThemeDidActivateNotification object: nil]; return self; } - (void) dealloc { [[NSNotificationCenter defaultCenter] removeObserver: self]; [super dealloc]; } - (void) drawRect: (NSRect)rect { [[GSTheme theme] drawWindowBorder: rect withFrame: [self bounds] forStyleMask: [window styleMask] state: inputState andTitle: [window title]]; [super drawRect: rect]; } - (void) setTitle: (NSString *)newTitle { if (isTitled) [self setNeedsDisplayInRect: titleBarRect]; [super setTitle: newTitle]; } - (void) setInputState: (int)state { NSAssert(state >= 0 && state <= 2, @"Invalid state!"); [super setInputState: state]; if (hasTitleBar) [self setNeedsDisplayInRect: titleBarRect]; } - (void) setDocumentEdited: (BOOL)flag { if (flag) { [closeButton setImage: [NSImage imageNamed: @"common_CloseBroken"]]; [closeButton setAlternateImage: [NSImage imageNamed: @"common_CloseBrokenH"]]; } else { [closeButton setImage: [NSImage imageNamed: @"common_Close"]]; [closeButton setAlternateImage: [NSImage imageNamed: @"common_CloseH"]]; } [super setDocumentEdited: flag]; } - (NSPoint) mouseLocationOnScreenOutsideOfEventStream { int screen = [[window screen] screenNumber]; return [GSServerForWindow(window) mouseLocationOnScreen: screen window: NULL]; } - (void) moveWindowStartingWithEvent: (NSEvent *)event { NSUInteger mask = NSLeftMouseDraggedMask | NSLeftMouseUpMask; NSEvent *currentEvent = event; NSDate *distantPast = [NSDate distantPast]; NSPoint delta, point; delta = [event locationInWindow]; [window _captureMouse: nil]; do { while (currentEvent && [currentEvent type] != NSLeftMouseUp) { currentEvent = [_window nextEventMatchingMask: mask untilDate: distantPast inMode: NSEventTrackingRunLoopMode dequeue: YES]; } point = [self mouseLocationOnScreenOutsideOfEventStream]; [window setFrameOrigin: NSMakePoint(point.x - delta.x, point.y - delta.y)]; if (currentEvent && [currentEvent type] == NSLeftMouseUp) break; currentEvent = [_window nextEventMatchingMask: mask untilDate: [NSDate distantFuture] inMode: NSEventTrackingRunLoopMode dequeue: YES]; } while ([currentEvent type] != NSLeftMouseUp); [window _releaseMouse: nil]; } static NSRect calc_new_frame(NSRect frame, NSPoint point, NSPoint firstPoint, int mode, NSSize minSize, NSSize maxSize) { NSRect newFrame = frame; newFrame.origin.y = point.y - firstPoint.y; newFrame.size.height = NSMaxY(frame) - newFrame.origin.y; if (newFrame.size.height < minSize.height) { newFrame.size.height = minSize.height; newFrame.origin.y = NSMaxY(frame) - newFrame.size.height; } if (mode == 0) { newFrame.origin.x = point.x - firstPoint.x; newFrame.size.width = NSMaxX(frame) - newFrame.origin.x; if (newFrame.size.width < minSize.width) { newFrame.size.width = minSize.width; newFrame.origin.x = NSMaxX(frame) - newFrame.size.width; } } else if (mode == 1) { newFrame.size.width = point.x - frame.origin.x + frame.size.width - firstPoint.x; if (newFrame.size.width < minSize.width) { newFrame.size.width = minSize.width; newFrame.origin.x = frame.origin.x; } } return newFrame; } - (void) resizeWindowStartingWithEvent: (NSEvent *)event { NSUInteger mask = NSLeftMouseDraggedMask | NSLeftMouseUpMask | NSPeriodicMask; NSEvent *currentEvent = event; NSDate *distantPast = [NSDate distantPast]; NSDate *distantFuture = [NSDate distantFuture]; NSPoint firstPoint, point; NSRect newFrame, frame; NSSize minSize, maxSize; int num = 0; /* 0 drag lower left corner 1 drag lower right corner 2 drag lower edge */ int mode; firstPoint = [event locationInWindow]; if (resizeBarRect.size.width < 30 * 2 && firstPoint.x < resizeBarRect.size.width / 2) mode = 0; else if (firstPoint.x > resizeBarRect.size.width - 29) mode = 1; else if (firstPoint.x < 29) mode = 0; else mode = 2; frame = [window frame]; minSize = [window minSize]; maxSize = [window maxSize]; [window _captureMouse: nil]; [NSEvent startPeriodicEventsAfterDelay: 0.1 withPeriod: 0.1]; do { while (currentEvent && [currentEvent type] != NSLeftMouseUp) { currentEvent = [_window nextEventMatchingMask: mask untilDate: distantPast inMode: NSEventTrackingRunLoopMode dequeue: YES]; } point = [self mouseLocationOnScreenOutsideOfEventStream]; newFrame = calc_new_frame(frame, point, firstPoint, mode, minSize, maxSize); if (currentEvent && [currentEvent type] == NSLeftMouseUp) break; num++; if (num == 5) { [window setFrame: newFrame display: YES]; num = 0; } currentEvent = [_window nextEventMatchingMask: mask untilDate: distantFuture inMode: NSEventTrackingRunLoopMode dequeue: YES]; } while ([currentEvent type] != NSLeftMouseUp); [NSEvent stopPeriodicEvents]; [window _releaseMouse: nil]; [window setFrame: newFrame display: YES]; } - (BOOL) acceptsFirstMouse: (NSEvent*)theEvent { return YES; } - (void) mouseDown: (NSEvent *)event { NSPoint p = [self convertPoint: [event locationInWindow] fromView: nil]; if (NSPointInRect(p, contentRect)) { [super mouseDown: event]; return; } if (NSPointInRect(p, titleBarRect)) { [self moveWindowStartingWithEvent: event]; return; } if (NSPointInRect(p, resizeBarRect)) { [self resizeWindowStartingWithEvent: event]; return; } [super mouseDown: event]; } - (void) setFrame: (NSRect)frameRect { [super setFrame: frameRect]; [self updateRects]; } @end @implementation GSStandardWindowDecorationView (GSTheme) - (void) _themeDidActivate: (NSNotification*)notification { [self updateRects]; [self setNeedsDisplay: YES]; } @end gnustep-gui-0.24.0/Source/GSTextStorage.h0000664000076500007650000000254011534147002020054 0ustar brains99brains99/* GSTextStorage.h Implementation of concrete subclass of a string class with attributes Copyright (C) 1999 Free Software Foundation, Inc. Based on code by: ANOQ of the sun Written by: Richard Frith-Macdonald Date: July 1999 This file is part of GNUStep-gui This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "AppKit/NSTextStorage.h" @class NSMutableString; @class NSMutableArray; @interface GSTextStorage : NSTextStorage { NSMutableString *_textChars; NSMutableArray *_infoArray; NSString *_textProxy; } @end gnustep-gui-0.24.0/Source/GSNibLoader.m0000664000076500007650000000746711707267156017503 0ustar brains99brains99/** GSNibLoader Nib (Cocoa XML) model loader Copyright (C) 1997, 1999 Free Software Foundation, Inc. Author: Gregory John Casamento Date: 2005 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import #import #import #import #import #import #import #import #import "GNUstepGUI/GSModelLoaderFactory.h" #import "GNUstepGUI/GSNibLoading.h" @interface GSNibLoader : GSModelLoader @end @implementation GSNibLoader + (void) initialize { // should do something... } + (NSString *)type { return @"nib"; } + (float) priority { return 3.0; } - (BOOL) loadModelData: (NSData *)data externalNameTable: (NSDictionary *)context withZone: (NSZone *)zone; { BOOL loaded = NO; CREATE_AUTORELEASE_POOL(pool); NS_DURING { if (data != nil) { NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData: data]; if (unarchiver != nil) { id obj; NSDebugLog(@"Invoking unarchiver"); [unarchiver setObjectZone: zone]; obj = [unarchiver decodeObjectForKey: @"IB.objectdata"]; if (obj != nil) { if ([obj isKindOfClass: [NSIBObjectData class]]) { NSDebugLog(@"Calling awakeWithContext"); [obj awakeWithContext: context]; loaded = YES; } else { NSLog(@"Nib without container object!"); } } else { NSLog(@"IB.objectdata not found when loading nib."); } RELEASE(unarchiver); } else { NSLog(@"Could not instantiate unarchiver."); } } else { NSLog(@"Data passed to nib loading method is nil."); } } NS_HANDLER { NSLog(@"Exception occured while loading model: %@",[localException reason]); // TEST_RELEASE(unarchiver); } NS_ENDHANDLER if (loaded == NO) { NSLog(@"Failed to load Nib\n"); } RELEASE(pool); return loaded; } - (NSData *) dataForFile: (NSString *)fileName { NSFileManager *mgr = [NSFileManager defaultManager]; BOOL isDir = NO; NSDebugLog(@"Loading Nib `%@'...\n", fileName); if ([mgr fileExistsAtPath: fileName isDirectory: &isDir]) { NSData *data = nil; // if the data is in a directory, then load from keyedobjects.nib in the directory if (isDir == NO) { data = [NSData dataWithContentsOfFile: fileName]; NSDebugLog(@"Loaded data from file..."); } else { NSString *newFileName = [fileName stringByAppendingPathComponent: @"keyedobjects.nib"]; data = [NSData dataWithContentsOfFile: newFileName]; NSDebugLog(@"Loaded data from %@...", newFileName); } return data; } else { NSLog(@"NIB file specified %@, could not be found.", fileName); } return nil; } @end gnustep-gui-0.24.0/Source/NSCustomImageRep.m0000664000076500007650000001121512121417516020505 0ustar brains99brains99/** NSCustomImageRep Custom image representation. Copyright (C) 1996 Free Software Foundation, Inc. Author: Adam Fedor Date: Mar 1996 This file is part of the GNUstep Application Kit Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import #import #import "AppKit/NSCustomImageRep.h" #import "AppKit/NSGraphicsContext.h" #import "AppKit/NSView.h" #import "AppKit/NSColor.h" #import "AppKit/DPSOperators.h" /**

TODO : Desciption

*/ @implementation NSCustomImageRep /**

Initializes a new NSCustomImageRep with. When a -draw message is recieved it send aSelector message to the delegate anObject. The delegate is not retained, so it is the caller's responsibility to ensure the delegate remains valid for the life of the receiver.

See Also: -delegate -drawSelector [NSImageRep-draw]

*/ - (id) initWithDrawSelector: (SEL)aSelector delegate: (id)anObject { if ( ! ( self = [super init] ) ) return nil; _delegate = anObject; _selector = aSelector; return self; } - (void) dealloc { [super dealloc]; } /**

Returns the NSCustomImageRep's delegate.

See Also: -initWithDrawSelector:delegate:

*/ - (id) delegate { return _delegate; } /**

Returns the draw method sent to the delegate when NSCustomImageRep recieved a -draw message.

See Also: -initWithDrawSelector:delegate: [NSImageRep-draw]

*/ - (SEL) drawSelector { return _selector; } - (BOOL) draw { [_delegate performSelector: _selector withObject: self]; return YES; } // // TODO: For both of the following methods we can extract the // logic in the superclass to another method and call it here // if the delegate is set from both places. // - (BOOL) drawAtPoint: (NSPoint)aPoint { BOOL ok, reset; NSGraphicsContext *ctxt; NSAffineTransform *ctm = nil; // if both are zero and the delegate isn't set, return no. if (_size.width == 0 && _size.height == 0 && _delegate == nil) return NO; NSDebugLLog(@"NSImage", @"Drawing at point %f %f\n", aPoint.x, aPoint.y); reset = 0; ctxt = GSCurrentContext(); if (aPoint.x != 0 || aPoint.y != 0) { ctm = GSCurrentCTM(ctxt); DPStranslate(ctxt, aPoint.x, aPoint.y); reset = 1; } ok = [self draw]; if (reset) GSSetCTM(ctxt, ctm); return ok; } - (BOOL) drawInRect: (NSRect)aRect { NSSize scale; BOOL ok; NSGraphicsContext *ctxt; NSAffineTransform *ctm; NSDebugLLog(@"NSImage", @"Drawing in rect (%f %f %f %f)\n", NSMinX(aRect), NSMinY(aRect), NSWidth(aRect), NSHeight(aRect)); // if both are zero and the delegate isn't set. if (_size.width == 0 && _size.height == 0 && _delegate == nil) return NO; ctxt = GSCurrentContext(); // if either is zero, don't scale at all. if (_size.width == 0 || _size.height == 0) { scale = NSMakeSize(1, 1); } else { scale = NSMakeSize(NSWidth(aRect) / _size.width, NSHeight(aRect) / _size.height); } ctm = GSCurrentCTM(ctxt); DPStranslate(ctxt, NSMinX(aRect), NSMinY(aRect)); DPSscale(ctxt, scale.width, scale.height); ok = [self draw]; GSSetCTM(ctxt, ctm); return ok; } // NSCoding protocol - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { // FIXME } else { // FIXME: Should this be changed to encodeConditionalObject: ? [aCoder encodeObject: _delegate]; [aCoder encodeValueOfObjCType: @encode(SEL) at: &_selector]; } } - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if ([aDecoder allowsKeyedCoding]) { // FIXME } else { [aDecoder decodeValueOfObjCType: @encode(id) at: &_delegate]; [aDecoder decodeValueOfObjCType: @encode(SEL) at: &_selector]; } return self; } @end gnustep-gui-0.24.0/Source/NSFontManager.m0000664000076500007650000007657111534147002020037 0ustar brains99brains99/** NSFontManager Manages system and user fonts Copyright (C) 1996 Free Software Foundation, Inc. Author: Fred Kiefer Date: January 2000 Almost complete rewrite. This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import #import #import #import #import #import #import "AppKit/NSFontDescriptor.h" #import "AppKit/NSFontManager.h" #import "AppKit/NSApplication.h" #import "AppKit/NSFont.h" #import "AppKit/NSFontPanel.h" #import "AppKit/NSMenu.h" #import "AppKit/NSMenuItem.h" #import "GNUstepGUI/GSFontInfo.h" /* * Class variables */ static NSFontManager *sharedFontManager = nil; static NSFontPanel *fontPanel = nil; static Class fontManagerClass = Nil; static Class fontPanelClass = Nil; @implementation NSFontManager /* * Class methods */ + (void) initialize { if (self == [NSFontManager class]) { // Initial version [self setVersion: 1]; // Set the factories [self setFontManagerFactory: [NSFontManager class]]; [self setFontPanelFactory: [NSFontPanel class]]; } } /**

Sets the class used to create the NSFontManager to aClass. By default it is a NSFontManager class. You can change this behavour by implementing your own class ( a subclass of NSFontManager )

This class is init into +sharedFontManager

See Also: +sharedFontManager

*/ + (void) setFontManagerFactory: (Class)aClass { fontManagerClass = aClass; } /**

Sets the class used to create a NSFontPanel. If you want to use a custom class it should be NSFontPanel subclass

See Also: -fontPanel:

*/ + (void) setFontPanelFactory: (Class)aClass { fontPanelClass = aClass; } /**

Creates ( if needed ) and returns the NSFontManager shared instance. This method init the font manager class defined in +setFontManagerFactory: ( it is usally a NSFontManager class )

*/ + (NSFontManager*) sharedFontManager { if (!sharedFontManager) { sharedFontManager = [[fontManagerClass alloc] init]; } return sharedFontManager; } /* * Instance methods */ - (id) init { if (sharedFontManager && self != sharedFontManager) { RELEASE(self); return sharedFontManager; } self = [super init]; _action = @selector(changeFont:); _storedTag = NSNoFontChangeAction; _fontEnumerator = RETAIN([GSFontEnumerator sharedEnumerator]); _collections = [[NSMutableDictionary alloc] initWithCapacity: 3]; return self; } - (void) dealloc { TEST_RELEASE(_selectedFont); TEST_RELEASE(_selectedAttributes); TEST_RELEASE(_fontMenu); TEST_RELEASE(_fontEnumerator); RELEASE(_collections); [super dealloc]; } /**

Returns an array of available fonts.

*/ - (NSArray*) availableFonts { return [_fontEnumerator availableFonts]; } - (NSArray*) availableFontFamilies { return [_fontEnumerator availableFontFamilies]; } - (NSArray*) availableFontNamesWithTraits: (NSFontTraitMask)fontTraitMask { unsigned int i, j; NSArray *fontFamilies = [self availableFontFamilies]; NSMutableArray *fontNames = [NSMutableArray array]; NSFontTraitMask traits; if (fontTraitMask == (NSUnitalicFontMask | NSUnboldFontMask)) { fontTraitMask = 0; } for (i = 0; i < [fontFamilies count]; i++) { NSArray *fontDefs = [self availableMembersOfFontFamily: [fontFamilies objectAtIndex: i]]; for (j = 0; j < [fontDefs count]; j++) { NSArray *fontDef = [fontDefs objectAtIndex: j]; traits = [[fontDef objectAtIndex: 3] unsignedIntValue]; // Check if the font has exactly the given mask if (traits == fontTraitMask) [fontNames addObject: [fontDef objectAtIndex: 0]]; } } return fontNames; } - (NSArray*) availableMembersOfFontFamily: (NSString*)family { return [_fontEnumerator availableMembersOfFontFamily: family]; } - (NSArray *) availableFontNamesMatchingFontDescriptor: (NSFontDescriptor *)descriptor { return [_fontEnumerator availableFontNamesMatchingFontDescriptor: descriptor]; } // GNUstep extension - (NSArray *) matchingFontDescriptorsFor: (NSDictionary *)attributes { return [_fontEnumerator matchingFontDescriptorsFor: attributes]; } - (NSString*) localizedNameForFamily: (NSString*)family face: (NSString*)face { // TODO return [NSString stringWithFormat: @"%@-%@", family, face]; } /** */ - (void) setSelectedFont: (NSFont*)fontObject isMultiple: (BOOL)flag { if (_selectedFont == fontObject) { if (flag != _multiple) { _multiple = flag; // The panel should also know if multiple changed if (fontPanel != nil) { [fontPanel setPanelFont: fontObject isMultiple: flag]; } } return; } _multiple = flag; ASSIGN(_selectedFont, fontObject); DESTROY(_selectedAttributes); if (fontPanel != nil) { [fontPanel setPanelFont: fontObject isMultiple: flag]; } if (_fontMenu != nil) { id menuItem; NSFontTraitMask trait = [self traitsOfFont: fontObject]; /* * FIXME: We should check if that trait is available * We keep the tag, to mark the item */ if (trait & NSItalicFontMask) { menuItem = [_fontMenu itemWithTag: NSItalicFontMask]; if (menuItem != nil) { [menuItem setTitle: @"Unitalic"]; [menuItem setAction: @selector(removeFontTrait:)]; } } else { menuItem = [_fontMenu itemWithTag: NSItalicFontMask]; if (menuItem != nil) { [menuItem setTitle: @"Italic"]; [menuItem setAction: @selector(addFontTrait:)]; } } if (trait & NSBoldFontMask) { menuItem = [_fontMenu itemWithTag: NSBoldFontMask]; if (menuItem != nil) { [menuItem setTitle: @"Unbold"]; [menuItem setAction: @selector(removeFontTrait:)]; } } else { menuItem = [_fontMenu itemWithTag: NSBoldFontMask]; if (menuItem != nil) { [menuItem setTitle: @"Bold"]; [menuItem setAction: @selector(addFontTrait:)]; } } // TODO Update the rest of the font menu to reflect this font } } /**

Returns the selected font

See Also: -setSelectedFont:isMultiple:

*/ - (NSFont*) selectedFont { return _selectedFont; } /**

Returns whether the current selection contains multiple fonts

*/ - (BOOL) isMultiple { return _multiple; } /* * Action methods */ - (void) addFontTrait: (id)sender { _storedTag = NSAddTraitFontAction; _trait = [sender tag]; [self sendAction]; // We update our own selected font if (_selectedFont != nil) { NSFont *newFont = [self convertFont: _selectedFont]; if (newFont != nil) { [self setSelectedFont: newFont isMultiple: _multiple]; } } } - (void) removeFontTrait: (id)sender { _storedTag = NSRemoveTraitFontAction; _trait = [sender tag]; [self sendAction]; // We update our own selected font if (_selectedFont != nil) { NSFont *newFont = [self convertFont: _selectedFont]; if (newFont != nil) { [self setSelectedFont: newFont isMultiple: _multiple]; } } } - (void) modifyFont: (id)sender { _storedTag = [sender tag]; [self sendAction]; // We update our own selected font if (_selectedFont != nil) { NSFont *newFont = [self convertFont: _selectedFont]; if (newFont != nil) { [self setSelectedFont: newFont isMultiple: _multiple]; } } } - (void) modifyFontViaPanel: (id)sender { _storedTag = NSViaPanelFontAction; [self sendAction]; // We update our own selected font if (_selectedFont != nil) { NSFont *newFont = [self convertFont: _selectedFont]; if (newFont != nil) { [self setSelectedFont: newFont isMultiple: _multiple]; } } } /**

Converts the NSFont fontObject according to user changes in the Font panel or the font menu

See Also: -addFontTrait: -removeFontTrait: -modifyFont: -modifyFontViaPanel: -convertFont:toHaveTrait: -convertFont:toNotHaveTrait: -convertFont:toSize: -convertFont:toFamily: -convertWeight:ofFont:

*/ - (NSFont*) convertFont: (NSFont*)fontObject { NSFont *newFont = fontObject; int i; float size; float sizes[] = {4.0, 6.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 16.0, 18.0, 24.0, 36.0, 48.0, 64.0}; if (fontObject == nil) return nil; switch (_storedTag) { case NSNoFontChangeAction: break; case NSViaPanelFontAction: if (fontPanel != nil) { newFont = [fontPanel panelConvertFont: fontObject]; } break; case NSAddTraitFontAction: newFont = [self convertFont: fontObject toHaveTrait: _trait]; break; case NSRemoveTraitFontAction: newFont = [self convertFont: fontObject toNotHaveTrait: _trait]; break; case NSSizeUpFontAction: size = [fontObject pointSize]; for (i = 0; i < sizeof(sizes)/sizeof(float); i++) { if (sizes[i] > size) { size = sizes[i]; break; } } newFont = [self convertFont: fontObject toSize: size]; break; case NSSizeDownFontAction: size = [fontObject pointSize]; for (i = sizeof(sizes)/sizeof(float) -1; i >= 0; i--) { if (sizes[i] < size) { size = sizes[i]; break; } } newFont = [self convertFont: fontObject toSize: size]; break; case NSHeavierFontAction: newFont = [self convertWeight: YES ofFont: fontObject]; break; case NSLighterFontAction: newFont = [self convertWeight: NO ofFont: fontObject]; break; } return newFont; } - (NSFont*) convertFont: (NSFont*)fontObject toFamily: (NSString*)family { if ([family isEqualToString: [fontObject familyName]]) { // If already of that family then just return it return fontObject; } else { // Else convert it NSFont *newFont; NSFontTraitMask trait = [self traitsOfFont: fontObject]; int weight = [self weightOfFont: fontObject]; float size = [fontObject pointSize]; newFont = [self fontWithFamily: family traits: trait weight: weight size: size]; if (newFont == nil) return fontObject; else return newFont; } } - (NSFont*) convertFont: (NSFont*)fontObject toFace: (NSString*)typeface { NSFont *newFont; // This conversion just retains the point size if ([[fontObject fontName] isEqualToString: typeface]) { return fontObject; } newFont = [NSFont fontWithName: typeface size: [fontObject pointSize]]; if (newFont == nil) return fontObject; else return newFont; } - (NSFont*) convertFont: (NSFont*)fontObject toHaveTrait: (NSFontTraitMask)trait { NSFontTraitMask t = [self traitsOfFont: fontObject]; if (t & trait) { // If already have that trait then just return it return fontObject; } else { // Else convert it NSFont *newFont; int weight = [self weightOfFont: fontObject]; float size = [fontObject pointSize]; NSString *family = [fontObject familyName]; if (trait & NSBoldFontMask) { // We cannot reuse the weight in a bold weight = 9; t = t & ~NSUnboldFontMask; } else if (trait & NSUnboldFontMask) { // We cannot reuse the weight in an unbold weight = 5; t = t & ~NSBoldFontMask; } if (trait == NSItalicFontMask) { t = t & ~NSUnitalicFontMask; } else if (trait & NSUnitalicFontMask) { t = t & ~NSItalicFontMask; } t = t | trait; newFont = [self fontWithFamily: family traits: t weight: weight size: size]; if (newFont == nil) return fontObject; else return newFont; } } - (NSFont*) convertFont: (NSFont*)fontObject toNotHaveTrait: (NSFontTraitMask)trait { NSFontTraitMask t = [self traitsOfFont: fontObject]; if (!(t & trait)) { // If already do not have that trait then just return it return fontObject; } else { // Else convert it NSFont *newFont; int weight = [self weightOfFont: fontObject]; float size = [fontObject pointSize]; NSString *family = [fontObject familyName]; if (trait & NSBoldFontMask) { // We cannot reuse the weight in an unbold weight = 5; t = (t | NSUnboldFontMask); } else if (trait & NSUnboldFontMask) { // We cannot reuse the weight in a bold weight = 9; t = (t | NSBoldFontMask); } if (trait & NSItalicFontMask) { t = (t | NSUnitalicFontMask); } else if (trait & NSUnitalicFontMask) { t = (t | NSItalicFontMask); } t &= ~trait; newFont = [self fontWithFamily: family traits: t weight: weight size: size]; if (newFont == nil) return fontObject; else return newFont; } } - (NSFont*) convertFont: (NSFont*)fontObject toSize: (float)size { if ([fontObject pointSize] == size) { // If already that size then just return it return fontObject; } else { // Else convert it NSFont *newFont; newFont = [NSFont fontWithName: [fontObject fontName] size: size]; if (newFont == nil) return fontObject; else return newFont; } } - (NSFont*) convertWeight: (BOOL)upFlag ofFont: (NSFont*)fontObject { NSFont *newFont = nil; NSString *fontName = nil; NSFontTraitMask trait = [self traitsOfFont: fontObject]; float size = [fontObject pointSize]; NSString *family = [fontObject familyName]; int w = [self weightOfFont: fontObject]; // We check what weights we have for this family. We must // also check to see if that font has the correct traits! NSArray *fontDefs = [self availableMembersOfFontFamily: family]; if (upFlag) { unsigned int i; // The documentation is a bit unclear about the range of weights // sometimes it says 0 to 9 and sometimes 0 to 15 int next_w = 15; for (i = 0; i < [fontDefs count]; i++) { NSArray *fontDef = [fontDefs objectAtIndex: i]; int w1 = [[fontDef objectAtIndex: 2] intValue]; if (w1 > w && w1 < next_w && [[fontDef objectAtIndex: 3] unsignedIntValue] == trait) { next_w = w1; fontName = [fontDef objectAtIndex: 0]; } } if (fontName == nil) { // Not found, try again with changed trait trait |= NSBoldFontMask; for (i = 0; i < [fontDefs count]; i++) { NSArray *fontDef = [fontDefs objectAtIndex: i]; int w1 = [[fontDef objectAtIndex: 2] intValue]; if (w1 > w && w1 < next_w && [[fontDef objectAtIndex: 3] unsignedIntValue] == trait) { next_w = w1; fontName = [fontDef objectAtIndex: 0]; } } } } else { unsigned int i; int next_w = 0; for (i = 0; i < [fontDefs count]; i++) { NSArray *fontDef = [fontDefs objectAtIndex: i]; int w1 = [[fontDef objectAtIndex: 2] intValue]; if (w1 < w && w1 > next_w && [[fontDef objectAtIndex: 3] unsignedIntValue] == trait) { next_w = w1; fontName = [fontDef objectAtIndex: 0]; } } if (fontName == nil) { // Not found, try again with changed trait trait &= ~NSBoldFontMask; for (i = 0; i < [fontDefs count]; i++) { NSArray *fontDef = [fontDefs objectAtIndex: i]; int w1 = [[fontDef objectAtIndex: 2] intValue]; if (w1 < w && w1 > next_w && [[fontDef objectAtIndex: 3] unsignedIntValue] == trait) { next_w = w1; fontName = [fontDef objectAtIndex: 0]; } } } } if (fontName != nil) { newFont = [NSFont fontWithName: fontName size: size]; } if (newFont == nil) return fontObject; else return newFont; } /* * Getting a font */ - (NSFont*) fontWithFamily: (NSString*)family traits: (NSFontTraitMask)traits weight: (int)weight size: (float)size { NSArray *fontDefs = [self availableMembersOfFontFamily: family]; unsigned int i; //NSLog(@"Searching font %@: %i: %i size %.0f", family, weight, traits, size); // First do an exact match search for (i = 0; i < [fontDefs count]; i++) { NSArray *fontDef = [fontDefs objectAtIndex: i]; //NSLog(@"Testing font %@: %i: %i", [fontDef objectAtIndex: 0], // [[fontDef objectAtIndex: 2] intValue], // [[fontDef objectAtIndex: 3] unsignedIntValue]); if (([[fontDef objectAtIndex: 2] intValue] == weight) && ([[fontDef objectAtIndex: 3] unsignedIntValue] == traits)) { //NSLog(@"Found font"); return [NSFont fontWithName: [fontDef objectAtIndex: 0] size: size]; } } // Try to find something close by ignoring some trait flags traits &= ~(NSNonStandardCharacterSetFontMask | NSFixedPitchFontMask | NSUnitalicFontMask | NSUnboldFontMask); for (i = 0; i < [fontDefs count]; i++) { NSArray *fontDef = [fontDefs objectAtIndex: i]; NSFontTraitMask t = [[fontDef objectAtIndex: 3] unsignedIntValue]; t &= ~(NSNonStandardCharacterSetFontMask | NSFixedPitchFontMask | NSUnitalicFontMask | NSUnboldFontMask); if (([[fontDef objectAtIndex: 2] intValue] == weight) && (t == traits)) { //NSLog(@"Found font"); return [NSFont fontWithName: [fontDef objectAtIndex: 0] size: size]; } } if (traits & NSBoldFontMask) { //NSLog(@"Trying ignore weights for bold font"); for (i = 0; i < [fontDefs count]; i++) { NSArray *fontDef = [fontDefs objectAtIndex: i]; NSFontTraitMask t = [[fontDef objectAtIndex: 3] unsignedIntValue]; t &= ~(NSNonStandardCharacterSetFontMask | NSFixedPitchFontMask | NSUnitalicFontMask | NSUnboldFontMask); if (t == traits) { //NSLog(@"Found font"); return [NSFont fontWithName: [fontDef objectAtIndex: 0] size: size]; } } } if (weight == 5 || weight == 6) { //NSLog(@"Trying alternate non-bold weights for non-bold font"); for (i = 0; i < [fontDefs count]; i++) { NSArray *fontDef = [fontDefs objectAtIndex: i]; NSFontTraitMask t = [[fontDef objectAtIndex: 3] unsignedIntValue]; t &= ~(NSNonStandardCharacterSetFontMask | NSFixedPitchFontMask | NSUnitalicFontMask | NSUnboldFontMask); if ((([[fontDef objectAtIndex: 2] intValue] == 5) || ([[fontDef objectAtIndex: 2] intValue] == 6)) && (t == traits)) { //NSLog(@"Found font"); return [NSFont fontWithName: [fontDef objectAtIndex: 0] size: size]; } } } //NSLog(@"Didnt find font"); return nil; } // // Examining a font // - (NSFontTraitMask) traitsOfFont: (NSFont*)aFont { return [[aFont fontInfo] traits]; } /**

Returns the weight of the NSFont fontObject

*/ - (int) weightOfFont: (NSFont*)fontObject { return [[fontObject fontInfo] weight]; } - (BOOL) fontNamed: (NSString*)typeface hasTraits: (NSFontTraitMask)fontTraitMask { // TODO: This method is implemented very slow, but I dont // see any use for it, so why change it? unsigned int i, j; NSArray *fontFamilies = [self availableFontFamilies]; NSFontTraitMask traits; for (i = 0; i < [fontFamilies count]; i++) { NSArray *fontDefs = [self availableMembersOfFontFamily: [fontFamilies objectAtIndex: i]]; for (j = 0; j < [fontDefs count]; j++) { NSArray *fontDef = [fontDefs objectAtIndex: j]; if ([[fontDef objectAtIndex: 0] isEqualToString: typeface]) { traits = [[fontDef objectAtIndex: 3] unsignedIntValue]; // FIXME: This is not exactly the right condition if ((traits & fontTraitMask) == fontTraitMask) { return YES; } else return NO; } } } return NO; } /**

Returns whether the NSFontPanel is enabled ( if exists )

*/ - (BOOL) isEnabled { if (fontPanel != nil) { return [fontPanel isEnabled]; } else return NO; } /**

Enables/disables the NSFontPanel and the font menu ( if they exist )

See Also: -isEnabled

*/ - (void) setEnabled: (BOOL)flag { int i; if (_fontMenu != nil) { for (i = 0; i < [_fontMenu numberOfItems]; i++) { [[_fontMenu itemAtIndex: i] setEnabled: flag]; } } if (fontPanel != nil) [fontPanel setEnabled: flag]; } /**

Returns the font menu, creates it (if needed ) if create is YES.

See Also: -setFontMenu:

*/ - (NSMenu*) fontMenu: (BOOL)create { if (create && _fontMenu == nil) { id menuItem; // As the font menu is stored in a instance variable we // dont autorelease it _fontMenu = [NSMenu new]; [_fontMenu setTitle: @"Font Menu"]; // First an entry to start the font panel menuItem = [_fontMenu addItemWithTitle: @"Font Panel" action: @selector(orderFrontFontPanel:) keyEquivalent: @"t"]; [menuItem setTarget: self]; // Entry for italic menuItem = [_fontMenu addItemWithTitle: @"Italic" action: @selector(addFontTrait:) keyEquivalent: @"i"]; [menuItem setTag: NSItalicFontMask]; [menuItem setTarget: self]; // Entry for bold menuItem = [_fontMenu addItemWithTitle: @"Bold" action: @selector(addFontTrait:) keyEquivalent: @"b"]; [menuItem setTag: NSBoldFontMask]; [menuItem setTarget: self]; // Entry to increase weight menuItem = [_fontMenu addItemWithTitle: @"Heavier" action: @selector(modifyFont:) keyEquivalent: @""]; [menuItem setTag: NSHeavierFontAction]; [menuItem setTarget: self]; // Entry to decrease weight menuItem = [_fontMenu addItemWithTitle: @"Lighter" action: @selector(modifyFont:) keyEquivalent: @""]; [menuItem setTag: NSLighterFontAction]; [menuItem setTarget: self]; // Entry to increase size menuItem = [_fontMenu addItemWithTitle: @"Larger" action: @selector(modifyFont:) keyEquivalent: @"+"]; [menuItem setTag: NSSizeUpFontAction]; [menuItem setTarget: self]; // Entry to decrease size menuItem = [_fontMenu addItemWithTitle: @"Smaller" action: @selector(modifyFont:) keyEquivalent: @"-"]; [menuItem setTag: NSSizeDownFontAction]; [menuItem setTarget: self]; } return _fontMenu; } /**

Sets the font menu to newMenu

See Also: -fontMenu:

*/ - (void) setFontMenu: (NSMenu*)newMenu { ASSIGN(_fontMenu, newMenu); } /**

Returns the NSFontPanel, creates it ( if needed ) if create is YES.

See Also: +setFontPanelFactory:

*/ - (NSFontPanel*) fontPanel: (BOOL)create { if ((fontPanel == nil) && (create)) { fontPanel = [[fontPanelClass alloc] init]; } return fontPanel; } - (void) orderFrontFontPanel: (id)sender { if (fontPanel == nil) fontPanel = [self fontPanel: YES]; [fontPanel orderFront: sender]; } /**

Returns the NSFontManager's delegate

*/ - (id) delegate { return _delegate; } /**

Sets the NSFontManager's delegate to anObject

* FIXME: This is extremely unclear. At the moment, the * NSFontManager's delegate is never used. This can't be right. */ - (void) setDelegate: (id)anObject { _delegate = anObject; } /**

Returns the action sents by the NSFontManager.

See Also: -setAction:

*/ - (SEL) action { return _action; } /**

Sents the action sents by the NSFontManager to aSelector.

See Also: -action

*/ - (void) setAction: (SEL)aSelector { _action = aSelector; } - (BOOL) sendAction { NSApplication *theApp = [NSApplication sharedApplication]; if (_action) { /* FIXME - shouldn't we try our own delegate first ?? It seems * what every programmer would expect, but it looks like Apple * doesn't do it! Or maybe they fixed it in recent releases ? */ return [theApp sendAction: _action to: nil from: self]; } else { return NO; } } - (BOOL) addCollection: (NSString *)name options: (int)options { [_collections setObject: [NSMutableArray arrayWithCapacity: 10] forKey: name]; return YES; } - (BOOL) removeCollection:(NSString *) collection { if ([_collections objectForKey: collection]) { [_collections removeObjectForKey: collection]; return YES; } else { return NO; } } - (NSArray *) collectionNames { return [_collections allKeys]; } - (void) addFontDescriptors: (NSArray *)descriptors toCollection: (NSString *)collection { NSMutableArray *a = [_collections objectForKey: collection]; if (a) { [a addObjectsFromArray: descriptors]; } } - (void) removeFontDescriptor: (NSFontDescriptor *)descriptor fromCollection: (NSString *)collection { NSMutableArray *a = [_collections objectForKey: collection]; if (a) { [a removeObject: descriptor]; } } - (NSArray *) fontDescriptorsInCollection: (NSString *)collection { return [_collections objectForKey: collection]; } - (NSDictionary *) convertAttributes: (NSDictionary *)attributes { NSMutableDictionary *newAttributes; int i; float size; float sizes[] = {4.0, 6.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 16.0, 18.0, 24.0, 36.0, 48.0, 64.0}; NSFontTraitMask t; if (attributes == nil) return nil; newAttributes = AUTORELEASE([attributes mutableCopy]); switch (_storedTag) { case NSNoFontChangeAction: break; case NSViaPanelFontAction: // FIXME break; case NSAddTraitFontAction: t = [[attributes objectForKey: NSFontSymbolicTrait] unsignedIntValue]; if (t & _trait) { return newAttributes; } else if (_trait == NSUnboldFontMask) { t &= ~NSBoldFontMask; } else if (_trait == NSUnitalicFontMask) { t &= ~NSItalicFontMask; } else { t &= _trait; // FIXME: What about weight for NSBoldFontMask? } [newAttributes setObject: [NSNumber numberWithUnsignedInt: t] forKey: NSFontSymbolicTrait]; break; case NSRemoveTraitFontAction: t = [[attributes objectForKey: NSFontSymbolicTrait] unsignedIntValue]; if (!(t & _trait)) { return newAttributes; } else if (_trait == NSUnboldFontMask) { t = (t | NSBoldFontMask) & ~NSUnboldFontMask; } else if (_trait == NSUnitalicFontMask) { t = (t | NSItalicFontMask) & ~NSUnitalicFontMask; } else { t &= ~_trait; // FIXME: What about weight for NSBoldFontMask? } [newAttributes setObject: [NSNumber numberWithUnsignedInt: t] forKey: NSFontSymbolicTrait]; break; case NSSizeUpFontAction: size = [[attributes objectForKey: NSFontSizeAttribute] floatValue]; for (i = 0; i < sizeof(sizes)/sizeof(float); i++) { if (sizes[i] > size) { size = sizes[i]; break; } } [newAttributes setObject: [NSString stringWithFormat: @"%f", size] forKey: NSFontSizeAttribute]; break; case NSSizeDownFontAction: size = [[attributes objectForKey: NSFontSizeAttribute] floatValue]; for (i = sizeof(sizes)/sizeof(float) -1; i >= 0; i--) { if (sizes[i] < size) { size = sizes[i]; break; } } [newAttributes setObject: [NSString stringWithFormat: @"%f", size] forKey: NSFontSizeAttribute]; break; case NSHeavierFontAction: // FIXME break; case NSLighterFontAction: // FIXME break; } return newAttributes; } - (void) setSelectedAttributes: (NSDictionary *)attributes isMultiple: (BOOL)flag { ASSIGN(_selectedAttributes, attributes); _multiple = flag; DESTROY(_selectedFont); } @end @implementation NSApplication(NSFontPanel) - (void) orderFrontFontPanel: (id)sender { [[NSFontManager sharedFontManager] orderFrontFontPanel: sender]; } @end gnustep-gui-0.24.0/Source/NSColorWell.m0000664000076500007650000003037412226152204017526 0ustar brains99brains99/** NSColorWell Control for selecting and display a single color value. Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Felipe A. Rodriguez Date: May 1998 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import "AppKit/NSActionCell.h" #import "AppKit/NSApplication.h" #import "AppKit/NSBezierPath.h" #import "AppKit/NSColorPanel.h" #import "AppKit/NSColorWell.h" #import "AppKit/NSColor.h" #import "AppKit/NSDragging.h" #import "AppKit/NSEvent.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSPasteboard.h" #import "AppKit/NSWindow.h" #import "GNUstepGUI/GSTheme.h" #import #import #include static NSString *GSColorWellDidBecomeExclusiveNotification = @"GSColorWellDidBecomeExclusiveNotification"; @implementation NSColorWell /* * Class methods */ + (void) initialize { if (self == [NSColorWell class]) { [self setVersion: 1]; } } /* * Instance methods */ - (BOOL) acceptsFirstMouse: (NSEvent *)event { return YES; } - (SEL) action { return _action; } /**

Activates the NSColorWell and displays the NSColorPanel with the current NSColorWell's color. The NSColorWell can take color from the NSColorPanel. If exclusive is YES other NSColorWells are desacivated (through notifications).

See Also: -deactivate

*/ - (void) activate: (BOOL)exclusive { NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; NSColorPanel *colorPanel = [NSColorPanel sharedColorPanel]; if (exclusive == YES) { [nc postNotificationName: GSColorWellDidBecomeExclusiveNotification object: self]; } [nc addObserver: self selector: @selector(deactivate) name: GSColorWellDidBecomeExclusiveNotification object: nil]; [nc addObserver: self selector: @selector(_takeColorFromPanel:) name: NSColorPanelColorDidChangeNotification object: nil]; [nc addObserver: self selector: @selector(deactivate) name: NSWindowWillCloseNotification object: colorPanel]; _is_active = YES; [colorPanel setColor: _the_color]; [colorPanel orderFront: self]; [self setNeedsDisplay: YES]; } /**

Returns the current NSColor of the NSColorWell.

See Also: -setColor:

*/ - (NSColor *) color { return _the_color; } /**

Deactivates the NSColorWell and marks self for display. It is usally call from an observer, when another NSColorWell is activate.

See Also: -activate:

*/ - (void) deactivate { _is_active = NO; [[NSNotificationCenter defaultCenter] removeObserver: self]; [self setNeedsDisplay: YES]; } - (void) dealloc { if (_is_active == YES) { [self deactivate]; } TEST_RELEASE(_the_color); [self unregisterDraggedTypes]; [super dealloc]; } - (NSDragOperation) draggingEntered: (id )sender { NSPasteboard *pb; NSDragOperation sourceDragMask; NSDebugLLog(@"NSColorWell", @"%@: draggingEntered", self); if ([self isEnabled] == NO) return NSDragOperationNone; sourceDragMask = [sender draggingSourceOperationMask]; pb = [sender draggingPasteboard]; if ([[pb types] indexOfObject: NSColorPboardType] != NSNotFound) { if (sourceDragMask & NSDragOperationCopy) { return NSDragOperationCopy; } } return NSDragOperationNone; } - (NSDragOperation) draggingSourceOperationMaskForLocal: (BOOL)flag { return NSDragOperationCopy; } - (void) drawRect: (NSRect)clipRect { if (NSIntersectsRect(_bounds, clipRect) == NO) { return; } _wellRect = [[GSTheme theme] drawColorWellBorder: self withBounds: _bounds withClip: clipRect]; [self drawWellInside: _wellRect]; } /**

Draws the NSColorWell inside the rectangle insideRect.

See Also: [NSColor-drawSwatchInRect:]

*/ - (void) drawWellInside: (NSRect)insideRect { if (NSIsEmptyRect(insideRect)) { return; } [_the_color drawSwatchInRect: insideRect]; } - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { [aCoder encodeObject: _the_color forKey: @"NSColor"]; // [aCoder encodeBool: _is_active forKey: @"NSEnabled"]; [aCoder encodeBool: _is_bordered forKey: @"NSIsBordered"]; [aCoder encodeConditionalObject: _target forKey: @"NSTarget"]; [aCoder encodeConditionalObject: NSStringFromSelector(_action) forKey: @"NSAction"]; } else { [aCoder encodeObject: _the_color]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_is_active]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_is_bordered]; [aCoder encodeConditionalObject: _target]; [aCoder encodeValueOfObjCType: @encode(SEL) at: &_action]; } } - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if (self != nil) { if ([aDecoder allowsKeyedCoding]) { NSString *action; ASSIGN(_the_color, [aDecoder decodeObjectForKey: @"NSColor"]); // _is_active = [aDecoder decodeBoolForKey: @"NSEnabled"]; _is_bordered = [aDecoder decodeBoolForKey: @"NSIsBordered"]; _target = [aDecoder decodeObjectForKey: @"NSTarget"]; action = [aDecoder decodeObjectForKey: @"NSAction"]; _action = NSSelectorFromString(action); [self registerForDraggedTypes: [NSArray arrayWithObjects: NSColorPboardType, nil]]; } else { [aDecoder decodeValueOfObjCType: @encode(id) at: &_the_color]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_is_active]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_is_bordered]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_target]; // Undo RETAIN by decoder TEST_RELEASE(_target); [aDecoder decodeValueOfObjCType: @encode(SEL) at: &_action]; [self registerForDraggedTypes: [NSArray arrayWithObjects: NSColorPboardType, nil]]; } } return self; } - (id) initWithFrame: (NSRect)frameRect { self = [super initWithFrame: frameRect]; if (self != nil) { _is_bordered = YES; _is_active = NO; _the_color = RETAIN([NSColor blackColor]); [self registerForDraggedTypes: [NSArray arrayWithObjects: NSColorPboardType, nil]]; } return self; } /**

Returns whether the NSColorWell is active. By default a NSColorWell is not active.

See Also: -activate: -deactivate

*/ - (BOOL) isActive { return _is_active; } /**

Returns whether the NSColorWell has border. By default a NSColorWell has border.

See Also: -setBordered:

*/ - (BOOL) isBordered { return _is_bordered; } - (BOOL) isOpaque { // May not be opaque, due to themes return NO; } - (void) mouseDown: (NSEvent *)theEvent { // // OPENSTEP 4.2 and OSX behavior indicates that the colorwell doesn't // work when the widget is marked as disabled. // if ([self isEnabled] == NO) return; // Unbordered color wells start a drag immediately upon mouse down if ([self isBordered] == NO) { [NSColorPanel dragColor: _the_color withEvent: theEvent fromView: self]; return; } _mouseDownPoint = [self convertPoint: [theEvent locationInWindow] fromView: nil]; [[self cell] setHighlighted: YES]; [self setNeedsDisplay: YES]; } - (void) mouseDragged: (NSEvent *)theEvent { NSPoint point = [self convertPoint: [theEvent locationInWindow] fromView: nil]; BOOL inside = [self mouse: point inRect: [self bounds]]; BOOL startedInWell = [self mouse: _mouseDownPoint inRect: _wellRect]; NSSize delta = NSMakeSize(_mouseDownPoint.x - point.x, _mouseDownPoint.y - point.y); double distance = sqrt(delta.width*delta.width + delta.height*delta.height); // FIXME: Make the dragging threshold a user default if (distance < 4) return; if ([self isEnabled] == NO) return; if (startedInWell) { [[self cell] setHighlighted: NO]; [self setNeedsDisplay: YES]; [NSColorPanel dragColor: _the_color withEvent: theEvent fromView: self]; return; } else { [[self cell] setHighlighted: inside]; [self setNeedsDisplay: YES]; } } - (void) mouseUp: (NSEvent *)theEvent { NSPoint point = [self convertPoint: [theEvent locationInWindow] fromView: nil]; BOOL inside = [self mouse: point inRect: [self bounds]]; if ([self isEnabled] == NO) return; [[self cell] setHighlighted: NO]; [self setNeedsDisplay: YES]; if (inside) { if (_is_active == NO) { [self activate: YES]; } else { [self deactivate]; } } } - (id) objectValue { return [self color]; } - (BOOL) performDragOperation: (id )sender { NSPasteboard *pb = [sender draggingPasteboard]; NSDebugLLog(@"NSColorWell", @"%@: performDragOperation", self); [self setColor: [NSColor colorFromPasteboard: pb]]; /* When our color is changed by having a new color dropped on us, * we send our action. */ [self sendAction: _action to: _target]; return YES; } - (BOOL) prepareForDragOperation: (id )sender { return YES; } - (void) setAction: (SEL)action { _action = action; } /**

Sets whether the NSColorWell has border and marks self for display. By default a NSColorWell has border.

See Also: -isBordered

*/ - (void) setBordered: (BOOL)bordered { _is_bordered = bordered; [self setNeedsDisplay: YES]; } /**

Sets the NSColorWell to color and marks self for display.
* Sets the NSColorPanel if active.
* Does NOT notify target of color change. *

*

See Also: -color

*/ - (void) setColor: (NSColor *)color { ASSIGN(_the_color, color); [self setNeedsDisplay: YES]; /* * Experimentation with NeXTstep shows that when the color of an active * colorwell is set, the color of the shared color panel is set too, * though this does not raise the color panel, only the event of * activation does that. */ if ([self isActive]) { NSColorPanel *colorPanel = [NSColorPanel sharedColorPanel]; [colorPanel setColor: _the_color]; } } - (void) setObjectValue: (id)anObject { [self setColor: anObject]; } - (void) setTarget: (id)target { _target = target; } /**

Sets the NSColorWell's color to the sender color.

*

See Also: -setColor:

*/ - (void) takeColorFrom: (id)sender { if ([sender respondsToSelector: @selector(color)]) { [self setColor: [sender color]]; } } - (void) _takeColorFromPanel: (NSNotification *) notification { id sender = [notification object]; if ([sender respondsToSelector: @selector(color)]) { NSColor *c = [(id)sender color]; /* Don't use -setColor: as that would send a message back to the * panel telling it to se its color again. * Instead we assign the color and mark for redisplay directly. * NB. For MacOS-X compatibility, we only send the action if the * coor has actually changed. */ if (c != nil && [c isEqual: _the_color] == NO) { ASSIGN(_the_color, [(id)sender color]); [self setNeedsDisplay: YES]; /* When our color is changed from the color panel, we should * send our action. */ [self sendAction: _action to: _target]; } } } - (void) takeObjectValueFrom: (id)sender { [self takeColorFrom: sender]; } - (id) target { return _target; } @end gnustep-gui-0.24.0/Source/NSSpellChecker.m0000664000076500007650000004455212235471766020214 0ustar brains99brains99/** NSSpellChecker Class to provide the graphical interface to the spell checking service. Copyright (C) 2001, 1996 Free Software Foundation, Inc. Author: Gregory John Casamento Date: 2001,2003 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import #import #import #import #import #import #import #import #import #import #import #import #import "AppKit/NSBrowser.h" #import "AppKit/NSBrowserCell.h" #import "AppKit/NSEvent.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSImage.h" #import "AppKit/NSMatrix.h" #import "AppKit/NSNib.h" #import "AppKit/NSNibLoading.h" #import "AppKit/NSPanel.h" #import "AppKit/NSPopUpButton.h" #import "AppKit/NSSpellChecker.h" #import "AppKit/NSApplication.h" #import "AppKit/NSTextField.h" #import "AppKit/NSWindow.h" #import "GSGuiPrivate.h" #import "GNUstepGUI/GSServicesManager.h" // prototype for function to create name for server NSString *GSSpellServerName(NSString *checkerDictionary, NSString *language); // These are methods which we only want the NSSpellChecker to call. // The protocol is defined here so that the outside world does not // have access to these internal methods. @protocol NSSpellServerPrivateProtocol - (NSRange) _findMisspelledWordInString: (NSString *)stringToCheck language: (NSString *)language ignoredWords: (NSArray *)ignoredWords wordCount: (int *)wordCount countOnly: (BOOL)countOnly; - (BOOL) _learnWord: (NSString *)word inDictionary: (NSString *)language; - (BOOL) _forgetWord: (NSString *)word inDictionary: (NSString *)language; - (NSArray *) _suggestGuessesForWord: (NSString *)word inLanguage: (NSString *)language; @end // Methods needed to get the GSServicesManager @interface NSApplication(NSSpellCheckerMethods) - (GSServicesManager *)_listener; @end @implementation NSApplication(NSSpellCheckerMethods) - (GSServicesManager *)_listener { return _listener; } @end // Methods in the GSServicesManager to launch the spell server. @interface GSServicesManager(NSSpellCheckerMethods) - (id)_launchSpellCheckerForLanguage: (NSString *)language; - (NSArray *)_languagesForPopUpButton; @end @implementation GSServicesManager(NSSpellCheckerMethods) - (id)_launchSpellCheckerForLanguage: (NSString *)language { id proxy = nil; NSDictionary *spellCheckers = [_allServices objectForKey: @"BySpell"]; NSDictionary *checkerDictionary = [spellCheckers objectForKey: language]; NSString *spellServicePath = [checkerDictionary objectForKey: @"ServicePath"]; NSString *vendor = [checkerDictionary objectForKey: @"NSSpellChecker"]; NSDate *finishBy; NSString *port = GSSpellServerName(vendor, language); double seconds = 30.0; NSLog(@"Language: %@", language); NSLog(@"Service to start: %@", spellServicePath); NSLog(@"Port: %@",port); finishBy = [NSDate dateWithTimeIntervalSinceNow: seconds]; proxy = GSContactApplication(spellServicePath, port, finishBy); if (proxy == nil) { NSLog(@"Failed to contact spell checker for language '%@'", language); } else { NSLog(@"Set proxy"); [(NSDistantObject *)proxy setProtocolForProxy: @protocol(NSSpellServerPrivateProtocol)]; } return proxy; } - (NSArray *)_languagesForPopUpButton { NSDictionary *spellCheckers = [_allServices objectForKey: @"BySpell"]; NSArray *allKeys = [spellCheckers allKeys]; return allKeys; } @end // Shared spell checker instance.... static NSSpellChecker *__sharedSpellChecker = nil; static int __documentTag = 0; // Implementation of spell checker class @implementation NSSpellChecker // // Class methods // + (void)initialize { if (self == [NSSpellChecker class]) { // Initial version [self setVersion:1]; } } // // Making a Checker available // + (NSSpellChecker *)sharedSpellChecker { // Create the shared instance. if (__sharedSpellChecker == nil) { __sharedSpellChecker = [[NSSpellChecker alloc] init]; } return __sharedSpellChecker; } + (BOOL)sharedSpellCheckerExists { // If the spell checker has been created, the // variable will not be nil. return (__sharedSpellChecker != nil); } // // Managing the Spelling Process // + (int)uniqueSpellDocumentTag { return ++__documentTag; } // // Internal methods for use by the spellChecker GUI // // Support function to start the spell server - (id)_startServerForLanguage: (NSString *)language { id proxy = nil; // Start the service for this language proxy = [[NSApp _listener] _launchSpellCheckerForLanguage: language]; if (proxy == nil) { NSLog(@"Failed to get the spellserver"); } else { // remove any previous notifications we are observing. [[NSNotificationCenter defaultCenter] removeObserver: self]; // Make sure that we handle the death of the server correctly. [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_handleServerDeath:) name: NSConnectionDidDieNotification object: [(NSDistantObject *)proxy connectionForProxy]]; } return proxy; } - (id)_serverProxy { if (_serverProxy == nil) { // Start the server and retain the reference to the // proxy. id proxy = [self _startServerForLanguage: _language]; if (proxy != nil) { _serverProxy = proxy; RETAIN(_serverProxy); } } return _serverProxy; } - (void)_populateDictionaryPulldown: (NSArray *)dictionaries { [_dictionaryPulldown removeAllItems]; [_dictionaryPulldown addItemsWithTitles: [dictionaries sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]]; [_dictionaryPulldown selectItemWithTitle: _language]; } - (void)_populateAccessoryView { // refresh the columns in the browser [_accessoryView reloadColumn: 0]; } - (void)_handleServerDeath: (NSNotification *)notification { NSLog(@"Spell server died"); DESTROY(_serverProxy); } // // Instance methods // - init { NSArray *languages; self = [super init]; if (self == nil) return nil; languages = [[NSUserDefaults standardUserDefaults] stringArrayForKey: @"NSLanguages"]; // Set the language to the default for the user. _language = RETAIN([languages objectAtIndex: 0]); _wrapFlag = NO; _position = 0; _spellPanel = nil; _serverProxy = nil; _currentTag = 0; _ignoredWords = [NSMutableDictionary new]; // Load the NIB file from the GUI bundle if (![GSGuiBundle() loadNibFile: @"GSSpellPanel" externalNameTable: [NSDictionary dictionaryWithObject: self forKey: NSNibOwner] withZone: [self zone]]) { NSLog(@"Model file load failed for GSSpellPanel"); return nil; } return self; } - (void)dealloc { RELEASE(_language); RELEASE(_ignoredWords); RELEASE(_serverProxy); [super dealloc]; } // // Managing the Spelling Panel // - (NSView *)accessoryView { return _accessoryView; } - (void)setAccessoryView:(NSView *)aView { _accessoryView = aView; } - (NSPanel *)spellingPanel { return _spellPanel; } // // Checking Spelling // - (int)countWordsInString:(NSString *)aString language:(NSString *)language { int count = 0; id proxy = [self _serverProxy]; if (proxy != nil) [proxy _findMisspelledWordInString: aString language: _language ignoredWords: nil wordCount: &count countOnly: YES]; return count; } - (NSRange)checkSpellingOfString:(NSString *)stringToCheck startingAt:(int)startingOffset { int wordCount = 0; NSRange r; r = [self checkSpellingOfString: stringToCheck startingAt: startingOffset language: _language wrap: NO inSpellDocumentWithTag: _currentTag wordCount: &wordCount]; return r; } - (NSRange)checkSpellingOfString:(NSString *)stringToCheck startingAt:(int)startingOffset language:(NSString *)language wrap:(BOOL)wrapFlag inSpellDocumentWithTag:(int)tag wordCount:(int *)wordCount { NSRange r; NSArray *dictForTag = [self ignoredWordsInSpellDocumentWithTag: tag]; _currentTag = tag; // We have no string to work with if (stringToCheck == nil) { return NSMakeRange(0,0); } else // The string is zero length if ([stringToCheck length] == 0) { return NSMakeRange(0,0); } // Do this in an exception handling block in ensure that a failure of the // spellserver does not bring down the application. NS_DURING { id proxy = [self _serverProxy]; // Get the substring and check it. NSString *substringToCheck = [stringToCheck substringFromIndex: startingOffset]; if (proxy == nil) NS_VALUERETURN(NSMakeRange(0,0), NSRange); r = [proxy _findMisspelledWordInString: substringToCheck language: _language ignoredWords: dictForTag wordCount: wordCount countOnly: NO]; if (r.length != 0) { // Adjust results relative to the original string r.location += startingOffset; } else { if (wrapFlag) { // Check the second half of the string NSString *firstHalfOfString = [stringToCheck substringToIndex: startingOffset]; r = [proxy _findMisspelledWordInString: firstHalfOfString language: _language ignoredWords: dictForTag wordCount: wordCount countOnly: NO]; } } NS_VALUERETURN(r, NSRange); } NS_HANDLER { NSLog(@"%@",[localException reason]); } NS_ENDHANDLER return NSMakeRange(0,0); } - (NSArray *)guessesForWord:(NSString *)word { NSArray *guesses; // Make the call to the server to get the guesses. NS_DURING { guesses = [[self _serverProxy] _suggestGuessesForWord: word inLanguage: _language]; NS_VALUERETURN(guesses, id); } NS_HANDLER { NSLog(@"%@",[localException reason]); } NS_ENDHANDLER return nil; } // // Setting the Language // - (NSString *)language { return _language; } - (BOOL)setLanguage:(NSString *)aLanguage { int index = 0; BOOL result = NO; index = [_dictionaryPulldown indexOfItemWithTitle: aLanguage]; if (index != -1) { [_dictionaryPulldown selectItemAtIndex: index]; result = YES; } return result; } // // Managing the Spelling Process // // Remove the ignored word list for this // document from the dictionary - (void)closeSpellDocumentWithTag:(int)tag { NSNumber *key = [NSNumber numberWithInt: tag]; [_ignoredWords removeObjectForKey: key]; } // Add a word to the ignored list. - (void) ignoreWord:(NSString *)wordToIgnore inSpellDocumentWithTag:(int)tag { NSNumber *key = [NSNumber numberWithInt: tag]; NSMutableSet *words = [_ignoredWords objectForKey: key]; if (![wordToIgnore isEqualToString: @""]) { // If there is a dictionary add to it, if not create one. if (words == nil) { words = [NSMutableSet setWithObject: wordToIgnore]; [_ignoredWords setObject: words forKey: key]; } else { [words addObject: wordToIgnore]; } } } // get the list of ignored words. - (NSArray *)ignoredWordsInSpellDocumentWithTag:(int)tag { NSNumber *key = [NSNumber numberWithInt: tag]; NSSet *words = [_ignoredWords objectForKey: key]; return [words allObjects]; } // set the list of ignored words for a given document - (void)setIgnoredWords:(NSArray *)someWords inSpellDocumentWithTag:(int)tag { NSNumber *key = [NSNumber numberWithInt: tag]; NSSet *words = [NSSet setWithArray: someWords]; [_ignoredWords setObject: words forKey: key]; } - (void)setWordFieldStringValue:(NSString *)aString { [_wordField setStringValue: aString]; } - (void)updateSpellingPanelWithMisspelledWord:(NSString *)word { if ((word == nil) || ([word isEqualToString: @""])) { [_ignoreButton setEnabled: NO]; [_guessButton setEnabled: NO]; NSBeep(); return; } [_ignoreButton setEnabled: YES]; [_guessButton setEnabled: NO]; [self setWordFieldStringValue: word]; [self _populateAccessoryView]; } - (void) _findNext: (id)sender { BOOL processed = [[[NSApp mainWindow] firstResponder] tryToPerform: @selector(checkSpelling:) with: _spellPanel]; if (!processed) { NSLog(@"No responder found"); } } - (void) _learn: (id)sender { NSString *word = [_wordField stringValue]; // Call server and record the learned word. NS_DURING { [[self _serverProxy] _learnWord: word inDictionary: _language]; } NS_HANDLER { NSLog(@"%@",[localException reason]); } NS_ENDHANDLER [self _findNext: sender]; } - (void) _forget: (id)sender { NSString *word = [_wordField stringValue]; // Call the server and remove the word from the learned // list. NS_DURING { [[self _serverProxy] _forgetWord: word inDictionary: _language]; } NS_HANDLER { NSLog(@"%@",[localException reason]); } NS_ENDHANDLER [self _findNext: sender]; } - (void) _ignore: (id)sender { BOOL processed = [[[NSApp mainWindow] firstResponder] tryToPerform: @selector(ignoreSpelling:) with: _wordField]; if (!processed) { NSLog(@"_ignore: No responder found"); } [self _findNext: sender]; } - (void) _guess: (id)sender { // Fill in the view... [self _populateAccessoryView]; } - (void) _correct: (id)sender { BOOL processed = [[[NSApp mainWindow] firstResponder] tryToPerform: @selector(changeSpelling:) with: _wordField]; if (!processed) { NSLog(@"No responder found"); } [self _findNext: sender]; } - (void) _switchDictionary: (id)sender { id proxy = nil; NSString *language = nil; // Start the service for this language language = [_dictionaryPulldown stringValue]; if (![language isEqualToString: _language]) { NSLog(@"Language = %@",language); proxy = [self _startServerForLanguage: language]; if (proxy != nil) { ASSIGN(_language, language); ASSIGN(_serverProxy, (id)proxy); } else { // Reset the pulldown to the proper language. [_dictionaryPulldown selectItemWithTitle: _language]; } } } - (void) _highlightGuess: (id)sender { NSString *selectedGuess = nil; selectedGuess = [[_accessoryView selectedCell] stringValue]; [_ignoreButton setEnabled: NO]; [_guessButton setEnabled: YES]; [_wordField setStringValue: selectedGuess]; } - (void) awakeFromNib { [self _populateDictionaryPulldown: [[NSApp _listener] _languagesForPopUpButton]]; [_accessoryView setDelegate: self]; [_accessoryView setDoubleAction: @selector(_correct:)]; [_findNextButton setKeyEquivalent: @"n"]; [_findNextButton setKeyEquivalentModifierMask: NSCommandKeyMask]; [_ignoreButton setKeyEquivalent: @"i"]; [_ignoreButton setKeyEquivalentModifierMask: NSCommandKeyMask]; [_learnButton setKeyEquivalent: @"l"]; [_learnButton setKeyEquivalentModifierMask: NSCommandKeyMask]; [_forgetButton setKeyEquivalent: @"f"]; [_forgetButton setKeyEquivalentModifierMask: NSCommandKeyMask]; [_guessButton setKeyEquivalent: @"g"]; [_guessButton setKeyEquivalentModifierMask: NSCommandKeyMask]; [_correctButton setKeyEquivalent: @"c"]; [_correctButton setKeyEquivalentModifierMask: NSCommandKeyMask]; [_correctButton setImagePosition: NSImageRight]; [_correctButton setImage: [NSImage imageNamed: @"common_ret"]]; [_correctButton setAlternateImage: [NSImage imageNamed: @"common_retH"]]; [_spellPanel makeFirstResponder: _correctButton]; [_spellPanel setBecomesKeyOnlyIfNeeded: YES]; [_spellPanel setFloatingPanel: YES]; } @end @interface NSSpellChecker(SpellBrowserDelegate) - (BOOL) browser: (NSBrowser*)sender selectRow: (NSInteger)row inColumn: (NSInteger)column; - (void) browser: (NSBrowser *)sender createRowsForColumn: (NSInteger)column inMatrix: (NSMatrix *)matrix; - (NSString*) browser: (NSBrowser*)sender titleOfColumn: (NSInteger)column; - (void) browser: (NSBrowser *)sender willDisplayCell: (id)cell atRow: (NSInteger)row column: (NSInteger)column; - (BOOL) browser: (NSBrowser *)sender isColumnValid: (NSInteger)column; @end @implementation NSSpellChecker(SpellBrowserDelegate) - (BOOL) browser: (NSBrowser*)sender selectRow: (NSInteger)row inColumn: (NSInteger)column { return YES; } - (void) browser: (NSBrowser *)sender createRowsForColumn: (NSInteger)column inMatrix: (NSMatrix *)matrix { NSArray *guesses = [self guessesForWord: [_wordField stringValue]]; NSEnumerator *e = [guesses objectEnumerator]; NSString *word = nil; NSBrowserCell *cell= nil; NSInteger i = 0; while ((word = [e nextObject]) != nil) { [matrix insertRow: i withCells: nil]; cell = [matrix cellAtRow: i column: 0]; [cell setLeaf: YES]; i++; [cell setStringValue: word]; } } - (NSString*) browser: (NSBrowser*)sender titleOfColumn: (NSInteger)column { return _(@"Guess"); } - (void) browser: (NSBrowser *)sender willDisplayCell: (id)cell atRow: (NSInteger)row column: (NSInteger)column { } - (BOOL) browser: (NSBrowser *)sender isColumnValid: (NSInteger)column { return NO; } @end gnustep-gui-0.24.0/Source/NSTextBlock.m0000664000076500007650000003017012110256537017523 0ustar brains99brains99/* NSTextBlock.m Copyright (C) 2008 Free Software Foundation, Inc. Author: H. Nikolaus Schaller Date: 2007 Author: Fred Kiefer Date: January 2008 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import "AppKit/NSColor.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSTextTable.h" #import "GSGuiPrivate.h" @implementation NSTextBlock - (id) init { // FIXME return self; } - (void) dealloc { RELEASE(_backgroundColor); RELEASE(_borderColorForEdge[NSMinXEdge]); RELEASE(_borderColorForEdge[NSMinYEdge]); RELEASE(_borderColorForEdge[NSMaxXEdge]); RELEASE(_borderColorForEdge[NSMaxYEdge]); [super dealloc]; } - (NSColor *) backgroundColor { return _backgroundColor; } - (void) setBackgroundColor: (NSColor *)color { ASSIGN(_backgroundColor, color); } - (NSColor *) borderColorForEdge: (NSRectEdge)edge { return _borderColorForEdge[edge]; } - (void) setBorderColor: (NSColor *)color forEdge: (NSRectEdge)edge { if (edge >= sizeof(_borderColorForEdge) / sizeof(_borderColorForEdge[0])) [NSException raise: NSInvalidArgumentException format: @"invalid edge %d", edge]; ASSIGN(_borderColorForEdge[edge], color); } - (void) setBorderColor: (NSColor *)color { ASSIGN(_borderColorForEdge[NSMinXEdge], color); ASSIGN(_borderColorForEdge[NSMinYEdge], color); ASSIGN(_borderColorForEdge[NSMaxXEdge], color); ASSIGN(_borderColorForEdge[NSMaxYEdge], color); } - (CGFloat) contentWidth { return [self valueForDimension: NSTextBlockWidth]; } - (NSTextBlockValueType) contentWidthValueType { return [self valueTypeForDimension: NSTextBlockWidth]; } - (void) setContentWidth: (CGFloat)val type: (NSTextBlockValueType)type { [self setValue: val type: type forDimension: NSTextBlockWidth]; } - (NSTextBlockVerticalAlignment) verticalAlignment { return _verticalAlignment; } - (void) setVerticalAlignment: (NSTextBlockVerticalAlignment)alignment { _verticalAlignment = alignment; } - (CGFloat) valueForDimension: (NSTextBlockDimension)dimension { if (dimension >= sizeof(_valueType) / sizeof(_valueType[0])) [NSException raise: NSInvalidArgumentException format: @"invalid dimension %d", dimension]; return _value[dimension]; } - (NSTextBlockValueType) valueTypeForDimension: (NSTextBlockDimension)dimension { if (dimension >= sizeof(_valueType) / sizeof(_valueType[0])) [NSException raise: NSInvalidArgumentException format: @"invalid dimension %d", dimension]; return _valueType[dimension]; } - (CGFloat) _scaledValue: (NSTextBlockDimension)dimension : (NSSize)size { if (_valueType[dimension] == NSTextBlockAbsoluteValueType) { return _value[dimension]; } else { // specified in percent switch(dimension) { case NSTextBlockWidth: case NSTextBlockMinimumWidth: case NSTextBlockMaximumWidth: return _value[dimension] * size.width; case NSTextBlockHeight: case NSTextBlockMinimumHeight: case NSTextBlockMaximumHeight: return _value[dimension] * size.height; } } return 0.0; } - (void) setValue: (CGFloat)val type: (NSTextBlockValueType)type forDimension: (NSTextBlockDimension)dimension { if (dimension >= sizeof(_valueType) / sizeof(_valueType[0])) [NSException raise: NSInvalidArgumentException format: @"invalid dimension %d", dimension]; _value[dimension] = val; _valueType[dimension] = type; } - (CGFloat) widthForLayer: (NSTextBlockLayer)layer edge: (NSRectEdge)edge { if (layer >= sizeof(_width) / sizeof(_width[0])) [NSException raise: NSInvalidArgumentException format: @"invalid layer %d", layer]; if (edge >= sizeof(_width[0]) / sizeof(_width[0][0])) [NSException raise: NSInvalidArgumentException format: @"invalid edge %d", edge]; return _width[layer][edge]; } - (NSTextBlockValueType) widthValueTypeForLayer: (NSTextBlockLayer)layer edge: (NSRectEdge)edge { if (layer >= sizeof(_width) / sizeof(_width[0])) [NSException raise: NSInvalidArgumentException format: @"invalid layer %d", layer]; if (edge >= sizeof(_width[0]) / sizeof(_width[0][0])) [NSException raise: NSInvalidArgumentException format: @"invalid edge %d", edge]; return _widthType[layer][edge]; } - (void) setWidth: (CGFloat)val type: (NSTextBlockValueType)type forLayer: (NSTextBlockLayer)layer edge: (NSRectEdge)edge { if (layer >= sizeof(_width) / sizeof(_width[0])) [NSException raise: NSInvalidArgumentException format: @"invalid layer %d", layer]; if (edge >= sizeof(_width[0]) / sizeof(_width[0][0])) [NSException raise: NSInvalidArgumentException format: @"invalid edge %d", edge]; _width[layer][edge] = val; _widthType[layer][edge] = type; } - (void) setWidth: (CGFloat)val type: (NSTextBlockValueType)type forLayer: (NSTextBlockLayer)layer { if (layer >= sizeof(_width) / sizeof(_width[0])) [NSException raise: NSInvalidArgumentException format: @"invalid layer %d", layer]; _width[layer][NSMinXEdge] = val; _widthType[layer][NSMinXEdge] = type; _width[layer][NSMinYEdge] = val; _widthType[layer][NSMinYEdge] = type; _width[layer][NSMaxXEdge] = val; _widthType[layer][NSMaxXEdge] = type; _width[layer][NSMaxYEdge] = val; _widthType[layer][NSMaxYEdge] = type; } - (CGFloat) _scaledWidthValue: (NSTextBlockLayer) layer : (NSRectEdge) edge : (NSSize) size { if (_widthType[layer][edge] == NSTextBlockAbsoluteValueType) { // absolute return _width[layer][edge]; } else { // specified in percent switch(edge) { case NSMinXEdge: case NSMaxXEdge: return _widthType[layer][edge]*size.width; case NSMinYEdge: case NSMaxYEdge: return _widthType[layer][edge]*size.height; } } return 0.0; } - (NSRect) boundsRectForContentRect: (NSRect)cont inRect: (NSRect)rect textContainer: (NSTextContainer *)container characterRange: (NSRange)range { CGFloat minx = [self _scaledWidthValue: NSTextBlockPadding : NSMinXEdge: rect.size] + [self _scaledWidthValue: NSTextBlockBorder : NSMinXEdge : rect.size] + [self _scaledWidthValue: NSTextBlockMargin : NSMinXEdge : rect.size]; CGFloat maxx = [self _scaledWidthValue: NSTextBlockPadding: NSMaxXEdge: rect.size] + [self _scaledWidthValue: NSTextBlockBorder : NSMaxXEdge : rect.size] + [self _scaledWidthValue: NSTextBlockMargin : NSMaxXEdge : rect.size]; CGFloat miny= [self _scaledWidthValue: NSTextBlockPadding : NSMinYEdge: rect.size] + [self _scaledWidthValue: NSTextBlockBorder : NSMinYEdge : rect.size] + [self _scaledWidthValue: NSTextBlockMargin : NSMinYEdge : rect.size]; CGFloat maxy = [self _scaledWidthValue: NSTextBlockPadding: NSMaxYEdge: rect.size] + [self _scaledWidthValue: NSTextBlockBorder : NSMaxYEdge : rect.size] + [self _scaledWidthValue: NSTextBlockMargin : NSMaxYEdge : rect.size]; cont.origin.x -= minx; cont.size.width += minx + maxx; cont.origin.y -= miny; cont.size.height += miny + maxy; return cont; } /** * POINT is the point in NSTextContainer where the TextBlock should be laid out. * RECT is the bounding rect (e.g. the rect of the container or the rect of the * outer table cell) * what are we doing with CONT? Do we limit to width of container? * what are we doing with RANGE? We don't know the layout manager * This is the default implementation for a single-cell * (NSTextTableBlock can handle cell span) * raises internal inconsisteny exception if the layout manager * (the one owning the textContainer) * does not have a table at the given characterRange */ - (NSRect) rectForLayoutAtPoint: (NSPoint)point inRect: (NSRect)rect textContainer: (NSTextContainer *)cont characterRange: (NSRange)range { NSRect r; NSSize size = (NSSize){[self _scaledValue: NSTextBlockWidth : rect.size], [self _scaledValue: NSTextBlockHeight : rect.size]}; // when and how do we define size by content? If size is (0, 0)? // or is this the input to calculating size of enclosed text? size.width = MAX(size.width, [self _scaledValue: NSTextBlockMinimumWidth : rect.size]); // not smaller than minimum size.height = MAX(size.height, [self _scaledValue: NSTextBlockMinimumHeight : rect.size]); size.width = MIN(size.width, [self _scaledValue: NSTextBlockMaximumWidth : rect.size]); // but also not larger than maximum size.height = MIN(size.height, [self _scaledValue: NSTextBlockMaximumHeight : rect.size]); r = (NSRect){point, size}; // who handles vertical alignment? // limit to what is available return NSIntersectionRect(r, rect); } - (void) drawBackgroundWithFrame: (NSRect)rect // this is the frame of the cell inView: (NSView *)view characterRange: (NSRange)range layoutManager: (NSLayoutManager *)lm { CGFloat minx = [self _scaledWidthValue: NSTextBlockPadding : NSMinXEdge : rect.size]; CGFloat maxx = [self _scaledWidthValue: NSTextBlockPadding : NSMaxXEdge : rect.size]; CGFloat miny = [self _scaledWidthValue: NSTextBlockPadding : NSMinYEdge : rect.size]; CGFloat maxy = [self _scaledWidthValue: NSTextBlockPadding : NSMaxYEdge : rect.size]; // FIXME - inset from frame by margin in the first step rect.origin.x -= minx; rect.size.width += minx + maxx; rect.origin.y -= miny; rect.size.height += miny + maxy; [_backgroundColor set]; // fill inner rect NSRectFill(rect); minx = [self _scaledWidthValue: NSTextBlockBorder : NSMinXEdge : rect.size]; maxx = [self _scaledWidthValue: NSTextBlockBorder : NSMaxXEdge : rect.size]; miny = [self _scaledWidthValue: NSTextBlockBorder : NSMinYEdge : rect.size]; maxy = [self _scaledWidthValue: NSTextBlockBorder : NSMaxYEdge : rect.size]; [_borderColorForEdge[NSMinXEdge] set]; NSRectFill(NSMakeRect(rect.origin.x - minx, rect.origin.y, minx, rect.size.height)); [_borderColorForEdge[NSMaxYEdge] set]; NSRectFill(NSMakeRect(rect.origin.x, rect.origin.y + rect.size.height + maxy, rect.size.width, maxy)); [_borderColorForEdge[NSMaxXEdge] set]; NSRectFill(NSMakeRect(rect.origin.x + rect.size.width, rect.origin.y, maxx, rect.size.height)); [_borderColorForEdge[NSMinYEdge] set]; NSRectFill(NSMakeRect(rect.origin.x, rect.origin.y - maxy, rect.size.width, miny)); // FIXME: how do we handle the corners of differenly sized and colored borders? // Do we have to fill trapezoids? } - (id) copyWithZone: (NSZone*)zone { NSTextBlock *t = (NSTextBlock*)NSCopyObject(self, 0, zone); _backgroundColor = TEST_RETAIN(_backgroundColor); _borderColorForEdge[NSMinXEdge] = TEST_RETAIN(_borderColorForEdge[NSMinXEdge]); _borderColorForEdge[NSMinYEdge] = TEST_RETAIN(_borderColorForEdge[NSMinYEdge]); _borderColorForEdge[NSMaxXEdge] = TEST_RETAIN(_borderColorForEdge[NSMaxXEdge]); _borderColorForEdge[NSMaxYEdge] = TEST_RETAIN(_borderColorForEdge[NSMaxYEdge]); return t; } - (void) encodeWithCoder: (NSCoder*)aCoder { // FIXME if ([aCoder allowsKeyedCoding]) { } else { } } - (id) initWithCoder: (NSCoder*)aDecoder { // FIXME if ([aDecoder allowsKeyedCoding]) { } else { } return self; } @end gnustep-gui-0.24.0/Source/GSGModelLoader.m0000664000076500007650000000655211537161034020121 0ustar brains99brains99/** GSGModelLoader GModel loader Copyright (C) 1997, 1999 Free Software Foundation, Inc. Author: Gregory John Casamento Date: 2005 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import #import #import #import "AppKit/NSNib.h" #import "GNUstepGUI/GSModelLoaderFactory.h" #import "GNUstepGUI/IMLoading.h" static Class gmodel_class(void) { static Class gmclass = Nil; if (gmclass == Nil) { NSBundle *theBundle; NSEnumerator *benum; NSString *path; /* Find the bundle */ benum = [NSStandardLibraryPaths() objectEnumerator]; while ((path = [benum nextObject])) { path = [path stringByAppendingPathComponent: @"Bundles"]; path = [path stringByAppendingPathComponent: @"libgmodel.bundle"]; if ([[NSFileManager defaultManager] fileExistsAtPath: path]) break; } NSCAssert(path != nil, @"Unable to load gmodel bundle"); NSDebugLog(@"Loading gmodel from %@", path); theBundle = [NSBundle bundleWithPath: path]; NSCAssert(theBundle != nil, @"Can't init gmodel bundle"); gmclass = [theBundle classNamed: @"GMModel"]; NSCAssert(gmclass, @"Can't load gmodel bundle"); } return gmclass; } @interface GSGModelLoader : GSModelLoader @end @implementation GSGModelLoader + (void) initialize { // register for the gmodel type. } + (NSString *) type { return @"gmodel"; } + (float) priority { return 2.0; } - (NSData *) dataForFile: (NSString *)fileName { // Horrible hack return (NSData*)fileName; } - (BOOL) loadModelData: (NSData *)data externalNameTable: (NSDictionary *)context withZone: (NSZone *)zone { // Horrible hack return [self loadModelFile: (NSString *)data externalNameTable: context withZone: zone]; } - (BOOL) loadModelFile: (NSString *)fileName externalNameTable: (NSDictionary *)context withZone: (NSZone *)zone; { NSString *ext = [fileName pathExtension]; /* * If the file to be read is a gmodel, use the GMModel method to * read it in and skip the dearchiving below. */ if ([ext isEqualToString: @"gmodel"]) { return [gmodel_class() loadIMFile: fileName owner: [context objectForKey: NSNibOwner]]; } return NO; } @end gnustep-gui-0.24.0/Source/NSTextTable.m0000664000076500007650000000733012110256537017522 0ustar brains99brains99/* NSTextTable.m Copyright (C) 2008 Free Software Foundation, Inc. Author: H. Nikolaus Schaller Date: 2007 Author: Fred Kiefer Date: January 2008 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import "AppKit/NSTextTable.h" @implementation NSTextTable - (BOOL) collapsesBorders { return _collapsesBorders; // if true: ??? } - (void) setCollapsesBorders: (BOOL)flag { _collapsesBorders = flag; } - (BOOL) hidesEmptyCells { return _hidesEmptyCells; // if true: don't draw border and fill } - (void) setHidesEmptyCells: (BOOL)flag { _hidesEmptyCells = flag; } - (NSTextTableLayoutAlgorithm) layoutAlgorithm { return _layoutAlgorithm; } - (void) setLayoutAlgorithm: (NSTextTableLayoutAlgorithm)algorithm { _layoutAlgorithm = algorithm; } - (NSUInteger) numberOfColumns { return _numberOfColumns; } - (void) setNumberOfColumns: (NSUInteger)numCols { _numberOfColumns = numCols; } - (NSRect) boundsRectForBlock: (NSTextTableBlock *)block contentRect: (NSRect)content inRect: (NSRect)rect textContainer: (NSTextContainer *)container characterRange: (NSRange)range { // FIXME return NSZeroRect; } - (NSRect) rectForBlock: (NSTextTableBlock *)block layoutAtPoint: (NSPoint)start inRect: (NSRect)rect textContainer: (NSTextContainer *)container characterRange: (NSRange)range { // FIXME return NSZeroRect; } - (void) drawBackgroundForBlock: (NSTextTableBlock *)block withFrame: (NSRect)frame inView: (NSView *)controlView characterRange: (NSRange)range layoutManager: (NSLayoutManager *)manager { // FIXME } // are these called for the whole table? - (NSRect) boundsRectForContentRect: (NSRect)cont inRect: (NSRect)rect textContainer: (NSTextContainer *)container characterRange: (NSRange)range { // FIXME return [super boundsRectForContentRect: cont inRect: rect textContainer: container characterRange: range]; } - (NSRect) rectForLayoutAtPoint: (NSPoint)point inRect: (NSRect)rect textContainer: (NSTextContainer *)cont characterRange: (NSRange)range { return [super rectForLayoutAtPoint: point inRect: rect textContainer: cont characterRange: range]; } - (void) drawBackgroundWithFrame: (NSRect)rect inView: (NSView *)view characterRange: (NSRange)range layoutManager: (NSLayoutManager *)lm { return [super drawBackgroundWithFrame: rect inView: view characterRange: range layoutManager: lm]; } @end gnustep-gui-0.24.0/Source/GSGormLoading.m0000664000076500007650000007454011537161034020027 0ustar brains99brains99/** GSGormLoading Contains all of the private classes used in .gorm files. Copyright (C) 2003 Free Software Foundation, Inc. Author: Gregory John Casamento Date: July 2003. This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSControl.h" #import "AppKit/NSMenu.h" #import "AppKit/NSNib.h" #import "AppKit/NSNibLoading.h" #import "AppKit/NSNibConnector.h" #import "AppKit/NSScreen.h" #import "AppKit/NSTextView.h" #import "AppKit/NSView.h" #import "AppKit/NSWindow.h" #import "GNUstepGUI/GSGormLoading.h" #import "NSDocumentFrameworkPrivate.h" static const int currentVersion = 1; // GSNibItem version number... @interface NSObject (GSNibPrivateMethods) - (BOOL) isInInterfaceBuilder; @end /* * This private class is used to collect the nib items while the * .gorm file is being unarchived. This is done to allow only * the top level items to be retained in a clean way. The reason it's * being done this way is because old .gorm files don't have any * array within the nameTable which indicates the objects which are * considered top level, so there is no clean and generic way to determine * this. Basically the top level items are any instances of or instances * of subclasses of NSMenu, NSWindow, or any controller class. * It's the last one that's hairy. Controller classes are * represented in .gorm files by the GSNibItem class, but once they transform * into the actual class instance it's not easy to tell if it should be * retained or not since there are a lot of other things stored in the nameTable * as well. GJC */ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedNotification"; @interface GSNibItemCollector : NSObject { NSMutableArray *items; } - (void) handleNotification: (NSNotification *)notification; - (NSMutableArray *)items; @end @implementation GSNibItemCollector - (void) handleNotification: (NSNotification *)notification; { id obj = [notification object]; [items addObject: obj]; } - init { if ((self = [super init]) != nil) { NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; // add myself as an observer and initialize the items array. [nc addObserver: self selector: @selector(handleNotification:) name: GSInternalNibItemAddedNotification object: nil]; items = [[NSMutableArray alloc] init]; } return self; } - (void) dealloc { [[NSNotificationCenter defaultCenter] removeObserver: self]; RELEASE(items); [super dealloc]; } - (NSMutableArray *)items { return items; } @end /* * The GSNibContainer class manages the internals of a nib file. */ @implementation GSNibContainer + (void) initialize { if (self == [GSNibContainer class]) { [self setVersion: GNUSTEP_NIB_VERSION]; } } - (void) awakeWithContext: (NSDictionary *)context { if (isAwake == NO) { NSEnumerator *enumerator; NSNibConnector *connection; NSString *key; NSMenu *menu; NSMutableArray *topObjects; id obj; // Add these objects with there old names as the code expects them context = AUTORELEASE([context mutableCopyWithZone: [context zone]]); isAwake = YES; /* * Add local entries into name table. */ if ([context count] > 0) { [nameTable addEntriesFromDictionary: context]; } /* * Now establish all connections by taking the names * stored in the connection objects, and replaciong them * with the corresponding values from the name table * before telling the connections to establish themselves. */ enumerator = [connections objectEnumerator]; while ((connection = [enumerator nextObject]) != nil) { id val; val = [nameTable objectForKey: [connection source]]; [connection setSource: val]; val = [nameTable objectForKey: [connection destination]]; [connection setDestination: val]; [connection establishConnection]; } /* * See if there is a main menu to be set. Report #4815, mainMenu * should be initialized before awakeFromNib is called. */ menu = [nameTable objectForKey: @"NSMenu"]; if (menu != nil && [menu isKindOfClass: [NSMenu class]] == YES) { [NSApp setMainMenu: menu]; } /* * Set the Services menu. * Report #5205, Services/Window menu does not behave correctly. */ menu = [nameTable objectForKey: @"NSServicesMenu"]; if (menu != nil && [menu isKindOfClass: [NSMenu class]] == YES) { [NSApp setServicesMenu: menu]; } /* * Set the Services menu. * Report #5205, Services/Window menu does not behave correctly. */ menu = [nameTable objectForKey: @"NSWindowsMenu"]; if (menu != nil && [menu isKindOfClass: [NSMenu class]] == YES) { [NSApp setWindowsMenu: menu]; } /* * Set the Recent Documents menu. */ menu = [nameTable objectForKey: @"NSRecentDocumentsMenu"]; if (menu != nil && [menu isKindOfClass: [NSMenu class]] == YES) { [[NSDocumentController sharedDocumentController] _setRecentDocumentsMenu: menu]; } /* * See if the user has passed in the NSNibTopLevelObjects key. * This is an implementation of a commonly used feature to give access to * all top level objects of a nib file. */ obj = [context objectForKey: NSNibTopLevelObjects]; if ([obj isKindOfClass: [NSMutableArray class]]) { topObjects = obj; } else { topObjects = nil; } /* * Now tell all the objects that they have been loaded from * a nib. */ enumerator = [nameTable keyEnumerator]; while ((key = [enumerator nextObject]) != nil) { if ([context objectForKey: key] == nil || [key isEqualToString: NSNibOwner]) // we want to send the message to the owner { // we don't want to send a message to these menus twice, if they're custom classes. if ([key isEqualToString: @"NSWindowsMenu"] == NO && [key isEqualToString: @"NSServicesMenu"] == NO && [key isEqualToString: NSNibTopLevelObjects] == NO) { id o = [nameTable objectForKey: key]; // send the awake message, if it responds... if ([o respondsToSelector: @selector(awakeFromNib)]) { [o awakeFromNib]; } /* * Retain all "top level" items so that, when the container * is released, they will remain. The GSNibItems instantiated in the gorm need * to be retained, since we are deallocating the container. * We don't want to retain the owner. * * Please note: It is encumbent upon the developer of an application to * release these objects. Instantiating a window manually or loading in a .gorm * file are equivalent processes. These objects need to be released in their * respective controllers. If the developer has used the NSNibTopLevelObjects feature, * then she will get the objects back in an array. She will will have to first release * all the objects in the array and then the array itself in order to release the * objects held within. */ if ([key isEqualToString: NSNibOwner] == NO) { if ([topLevelObjects containsObject: o]) // anything already designated a top level item.. { [topObjects addObject: o]; // All top level objects must be released by the // caller to avoid leaking, unless they are going // to be released by other nib objects on behalf // of the owner. RETAIN(o); } } } } } /* * See if there are objects that should be made visible. * This is the last thing we should do since changes might be made * in the awakeFromNib methods which are called on all of the objects. */ if (visibleWindows != nil) { unsigned pos = [visibleWindows count]; while (pos-- > 0) { NSWindow *win = [visibleWindows objectAtIndex: pos]; [win orderFront: self]; } } /* * Now remove any objects added from the context dictionary. */ if ([context count] > 0) { [nameTable removeObjectsForKeys: [context allKeys]]; } } } - (void) dealloc { RELEASE(nameTable); RELEASE(connections); RELEASE(topLevelObjects); RELEASE(visibleWindows); RELEASE(deferredWindows); RELEASE(customClasses); [super dealloc]; } - (id) init { if ((self = [super init]) != nil) { nameTable = [[NSMutableDictionary alloc] initWithCapacity: 8]; connections = [[NSMutableArray alloc] initWithCapacity: 8]; topLevelObjects = [[NSMutableSet alloc] initWithCapacity: 8]; customClasses = [[NSMutableDictionary alloc] initWithCapacity: 8]; deferredWindows = [[NSMutableArray alloc] initWithCapacity: 8]; visibleWindows = [[NSMutableArray alloc] initWithCapacity: 8]; } return self; } - (void) encodeWithCoder: (NSCoder*)aCoder { int version = [GSNibContainer version]; if (version == GNUSTEP_NIB_VERSION) { [aCoder encodeObject: topLevelObjects]; [aCoder encodeObject: visibleWindows]; [aCoder encodeObject: deferredWindows]; [aCoder encodeObject: nameTable]; [aCoder encodeObject: connections]; [aCoder encodeObject: customClasses]; } else if (version == 1) { NSMutableDictionary *nt = [NSMutableDictionary dictionaryWithDictionary: nameTable]; [nt setObject: [NSMutableArray arrayWithArray: visibleWindows] forKey: @"NSVisible"]; [nt setObject: [NSMutableArray arrayWithArray: deferredWindows] forKey: @"NSDeferred"]; [nt setObject: [NSMutableDictionary dictionaryWithDictionary: customClasses] forKey: @"GSCustomClassMap"]; [aCoder encodeObject: nt]; [aCoder encodeObject: connections]; [aCoder encodeObject: topLevelObjects]; } else if (version == 0) { NSMutableDictionary *nt = [NSMutableDictionary dictionaryWithDictionary: nameTable]; [nt setObject: [NSMutableArray arrayWithArray: visibleWindows] forKey: @"NSVisible"]; [nt setObject: [NSMutableArray arrayWithArray: deferredWindows] forKey: @"NSDeferred"]; [nt setObject: [NSMutableDictionary dictionaryWithDictionary: customClasses] forKey: @"GSCustomClassMap"]; [aCoder encodeObject: nt]; [aCoder encodeObject: connections]; } else { [NSException raise: NSInternalInconsistencyException format: @"Unable to write GSNibContainer version #%d. GSNibContainer version for the installed gui lib is %d.", version, GNUSTEP_NIB_VERSION]; } } - (id) initWithCoder: (NSCoder*)aCoder { int version = [aCoder versionForClassName: @"GSNibContainer"]; // save the version to the ivar, we need it later. if (version == GNUSTEP_NIB_VERSION) { [aCoder decodeValueOfObjCType: @encode(id) at: &topLevelObjects]; [aCoder decodeValueOfObjCType: @encode(id) at: &visibleWindows]; [aCoder decodeValueOfObjCType: @encode(id) at: &deferredWindows]; [aCoder decodeValueOfObjCType: @encode(id) at: &nameTable]; [aCoder decodeValueOfObjCType: @encode(id) at: &connections]; [aCoder decodeValueOfObjCType: @encode(id) at: &customClasses]; } else if (version == 1) { [aCoder decodeValueOfObjCType: @encode(id) at: &nameTable]; [aCoder decodeValueOfObjCType: @encode(id) at: &connections]; [aCoder decodeValueOfObjCType: @encode(id) at: &topLevelObjects]; // initialize with special entries... ASSIGN(visibleWindows, [NSMutableArray arrayWithArray: [nameTable objectForKey: @"NSVisible"]]); ASSIGN(deferredWindows, [NSMutableArray arrayWithArray: [nameTable objectForKey: @"NSDeferred"]]); ASSIGN(customClasses, [NSMutableDictionary dictionaryWithDictionary: [nameTable objectForKey: @"GSCustomClassMap"]]); // then remove them from the name table. [nameTable removeObjectForKey: @"NSVisible"]; [nameTable removeObjectForKey: @"NSDeferred"]; [nameTable removeObjectForKey: @"GSCustomClassMap"]; } else if (version == 0) { GSNibItemCollector *nibitems = [[GSNibItemCollector alloc] init]; NSEnumerator *en; NSString *key; // initialize the set of top level objects... topLevelObjects = [[NSMutableSet alloc] initWithCapacity: 8]; // unarchive... [aCoder decodeValueOfObjCType: @encode(id) at: &nameTable]; [aCoder decodeValueOfObjCType: @encode(id) at: &connections]; [topLevelObjects addObjectsFromArray: [nibitems items]]; // get the top level items here... RELEASE(nibitems); // iterate through the objects returned en = [nameTable keyEnumerator]; while ((key = [en nextObject]) != nil) { id o = [nameTable objectForKey: key]; if (([o isKindOfClass: [NSMenu class]] && [key isEqual: @"NSMenu"]) || [o isKindOfClass: [NSWindow class]]) { [topLevelObjects addObject: o]; // if it's a top level object, add it. } } // initialize with special entries... ASSIGN(visibleWindows, [NSMutableArray arrayWithArray: [nameTable objectForKey: @"NSVisible"]]); ASSIGN(deferredWindows, [NSMutableArray arrayWithArray: [nameTable objectForKey: @"NSDeferred"]]); ASSIGN(customClasses, [NSMutableDictionary dictionaryWithDictionary: [nameTable objectForKey: @"GSCustomClassMap"]]); // then remove them from the name table. [nameTable removeObjectForKey: @"NSVisible"]; [nameTable removeObjectForKey: @"NSDeferred"]; [nameTable removeObjectForKey: @"GSCustomClassMap"]; } else { [NSException raise: NSInternalInconsistencyException format: @"Unable to read GSNibContainer version #%d. GSNibContainer version for the installed gui lib is %d. Please upgrade to a more recent version of the gui library.", version, GNUSTEP_NIB_VERSION]; } return self; } - (NSMutableDictionary*) nameTable { return nameTable; } - (NSMutableSet*) topLevelObjects { return topLevelObjects; } - (NSMutableArray*) connections { return connections; } - (NSMutableArray*) visibleWindows { return visibleWindows; } - (NSMutableArray*) deferredWindows { return deferredWindows; } - (NSMutableDictionary *) customClasses { return customClasses; } @end // The first standin objects here are for views and normal objects like controllers // or data sources. @implementation GSNibItem + (void) initialize { if (self == [GSNibItem class]) { [self setVersion: currentVersion]; } } - (void) dealloc { RELEASE(theClass); [super dealloc]; } - (void) encodeWithCoder: (NSCoder*)aCoder { [aCoder encodeObject: theClass]; [aCoder encodeRect: theFrame]; [aCoder encodeValueOfObjCType: @encode(unsigned int) at: &autoresizingMask]; } - (id) initWithCoder: (NSCoder*)aCoder { int version = [aCoder versionForClassName: NSStringFromClass([self class])]; id obj = nil; if (version == 1) { Class cls; unsigned int mask; [aCoder decodeValueOfObjCType: @encode(id) at: &theClass]; theFrame = [aCoder decodeRect]; [aCoder decodeValueOfObjCType: @encode(unsigned int) at: &mask]; cls = NSClassFromString(theClass); if (cls == nil) { [NSException raise: NSInternalInconsistencyException format: @"Unable to find class '%@', it is not linked into the application.", theClass]; } if (theFrame.size.height > 0 && theFrame.size.width > 0) { obj = [[cls allocWithZone: [self zone]] initWithFrame: theFrame]; } else { if(GSObjCIsKindOf(cls, [NSApplication class])) { obj = RETAIN([cls sharedApplication]); } else { obj = [[cls allocWithZone: [self zone]] init]; } } if ([obj respondsToSelector: @selector(setAutoresizingMask:)]) { [obj setAutoresizingMask: mask]; } } else if (version == 0) { Class cls; [aCoder decodeValueOfObjCType: @encode(id) at: &theClass]; theFrame = [aCoder decodeRect]; cls = NSClassFromString(theClass); if (cls == nil) { [NSException raise: NSInternalInconsistencyException format: @"Unable to find class '%@', it is not linked into the application.", theClass]; } obj = [cls allocWithZone: [self zone]]; if (theFrame.size.height > 0 && theFrame.size.width > 0) { obj = [obj initWithFrame: theFrame]; } else { obj = [obj init]; } } else { NSLog(@"no initWithCoder for this version"); } // If this is a nib item and not a custom view, then we need to add it to // the set of things to be retained. Also, the initial version of the nib container // needed this code, but subsequent versions don't, so don't send the notification, // if the version isn't zero. if (obj != nil && [aCoder versionForClassName: NSStringFromClass([GSNibContainer class])] == 0) { if ([self isKindOfClass: [GSNibItem class]] == YES && [self isKindOfClass: [GSCustomView class]] == NO) { NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; [nc postNotificationName: GSInternalNibItemAddedNotification object: obj]; } } // release self and return the object this represents... RELEASE(self); return obj; } @end @implementation GSCustomView + (void) initialize { if (self == [GSCustomView class]) { [self setVersion: currentVersion]; } } - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; } - (id) initWithCoder: (NSCoder*)aCoder { return [super initWithCoder: aCoder]; } @end /* These stand-ins are here for use by GUI elements within Gorm. Since each gui element has it's own "designated initializer" it's important to provide a division between these so that when they are loaded, the application will call the correct initializer. Some "tricks" are employed in this code. For instance the use of initWithCoder and encodeWithCoder directly as opposed to using the encodeObjC.. methods is the obvious standout. To understand this it's necessary to explain a little about how encoding itself works. When the model is saved by the Interface Builder (whether Gorm or another IB equivalent) these classes should be used to substitute for the actual classes. The actual classes are encoded as part of it, but since they are being replaced we can't use the normal encode methods to do it and must encode it directly. Also, the reason for encoding the superclass itself is that by doing so the unarchiver knows what version is referred to by the encoded object. This way we can replace the object with a substitute class which will allow it to create itself as the custom class when read it by the application, and using the encoding system to do it in a clean way. */ @implementation GSClassSwapper + (void) initialize { if (self == [GSClassSwapper class]) { [self setVersion: GSSWAPPER_VERSION]; } } - (id) initWithObject: (id)object className: (NSString *)className superClassName: (NSString *)superClassName { if ((self = [self init]) != nil) { NSDebugLog(@"Created template %@ -> %@",NSStringFromClass([self class]), className); ASSIGN(_object, object); ASSIGN(_className, className); _superClass = NSClassFromString(superClassName); if (_superClass == nil) { [NSException raise: NSInternalInconsistencyException format: @"Unable to find class '%@', it is not linked into the application.", superClassName]; } } return self; } - init { if ((self = [super init]) != nil) { _className = nil; _superClass = nil; _object = nil; } return self; } - (void) dealloc { RELEASE(_object); RELEASE(_className); [super dealloc]; } - (void) setClassName: (NSString *)name { ASSIGN(_className, name); } - (NSString *)className { return _className; } - (id) initWithCoder: (NSCoder *)coder { id obj = nil; int version = [coder versionForClassName: @"GSClassSwapper"]; if (version == 0) { if ((self = [super init]) != nil) { NSUnarchiver *unarchiver = (NSUnarchiver *)coder; // decode class/superclass... [coder decodeValueOfObjCType: @encode(id) at: &_className]; [coder decodeValueOfObjCType: @encode(Class) at: &_superClass]; // if we are living within the interface builder app, then don't try to // morph into the subclass. if ([self shouldSwapClass]) { Class aClass = NSClassFromString(_className); if (aClass == nil) { [NSException raise: NSInternalInconsistencyException format: @"Unable to find class '%@', it is not linked into the application.", _className]; } // Initialize the object... dont call decode, since this wont // allow us to instantiate the class we want. obj = [aClass alloc]; } else { obj = [_superClass alloc]; } // inform the coder that this object is to replace the template in all cases. [unarchiver replaceObject: self withObject: obj]; obj = [obj initWithCoder: coder]; // unarchive the object... } } // change the class of the instance to the one we want to see... return obj; } - (void) encodeWithCoder: (NSCoder *)aCoder { [aCoder encodeValueOfObjCType: @encode(id) at: &_className]; [aCoder encodeValueOfObjCType: @encode(Class) at: &_superClass]; if (_object != nil) { // Don't call encodeValue, the way templates are used will prevent // it from being saved correctly. Just call encodeWithCoder directly. [_object encodeWithCoder: aCoder]; } } - (BOOL) shouldSwapClass { BOOL result = YES; if ([self respondsToSelector: @selector(isInInterfaceBuilder)]) { result = !([self isInInterfaceBuilder]); } return result; } @end @implementation GSWindowTemplate + (void) initialize { if (self == [GSWindowTemplate class]) { [self setVersion: GSWINDOWT_VERSION]; } } - (unsigned int) autoPositionMask { return _autoPositionMask; } - (void)setAutoPositionMask: (unsigned int)flag { _autoPositionMask = flag; } - (BOOL)deferFlag { return _deferFlag; } - (void)setDeferFlag: (BOOL)flag { _deferFlag = flag; } - (void) autoPositionWindow: (NSWindow *)window { int options = 0; NSRect currentScreenFrame = [[window screen] frame]; NSRect windowFrame = [window frame]; NSPoint origin = windowFrame.origin; NSSize newSize = currentScreenFrame.size; NSSize oldSize = _screenRect.size; BOOL changedOrigin = NO; // reposition the window on the screen. if (_autoPositionMask == GSWindowAutoPositionNone) return; /* * determine if and how the X axis can be resized */ if (_autoPositionMask & GSWindowMinXMargin) options++; if (_autoPositionMask & GSWindowMaxXMargin) options++; /* * adjust the X axis if any X options are set in the mask */ if (options > 0) { float change = newSize.width - oldSize.width; float changePerOption = change / options; if (_autoPositionMask & GSWindowMinXMargin) { origin.x += changePerOption; changedOrigin = YES; } } /* * determine if and how the Y axis can be resized */ options = 0; if (_autoPositionMask & GSWindowMinYMargin) options++; if (_autoPositionMask & GSWindowMaxYMargin) options++; /* * adjust the Y axis if any Y options are set in the mask */ if (options > 0) { float change = newSize.height - oldSize.height; float changePerOption = change / options; if (_autoPositionMask & (GSWindowMaxYMargin | GSWindowMinYMargin)) { if (_autoPositionMask & GSWindowMinYMargin) { origin.y += changePerOption; changedOrigin = YES; } } } // change the origin of the window. if (changedOrigin) { [window setFrameOrigin: origin]; } } // NSCoding... - (id) initWithCoder: (NSCoder *)coder { id obj = [super initWithCoder: coder]; if (obj != nil) { int version = [coder versionForClassName: @"GSWindowTemplate"]; if (version == GSWINDOWT_VERSION) { // decode the defer flag... [coder decodeValueOfObjCType: @encode(BOOL) at: &_deferFlag]; [coder decodeValueOfObjCType: @encode(unsigned int) at: &_autoPositionMask]; _screenRect = [coder decodeRect]; } else if (version == 0) { // decode the defer flag... [coder decodeValueOfObjCType: @encode(BOOL) at: &_deferFlag]; _autoPositionMask = GSWindowAutoPositionNone; _screenRect = [[_object screen] frame]; } // FIXME: The designated initializer logic for NSWindow is in the initWithCoder: method of // NSWindow. Unfortunately, this means that the "defer" flag for NSWindows and NSWindow // subclasses in gorm files will be ignored. This shouldn't have a great impact, // but it is not the correct behavior. // // Set all of the attributes into the object, if it // responds to any of these methods. // if ([obj respondsToSelector: @selector(setAutoPositionMask:)]) { [obj setAutoPositionMask: [self autoPositionMask]]; } RELEASE(self); } return obj; } - (void) encodeWithCoder: (NSCoder *)coder { int version = [[self class] version]; [super encodeWithCoder: coder]; if (version == GSWINDOWT_VERSION) { _screenRect = [[_object screen] frame]; [coder encodeValueOfObjCType: @encode(BOOL) at: &_deferFlag]; [coder encodeValueOfObjCType: @encode(unsigned int) at: &_autoPositionMask]; [coder encodeRect: _screenRect]; } else if (version == 0) { [coder encodeValueOfObjCType: @encode(BOOL) at: &_deferFlag]; } } @end @implementation GSViewTemplate + (void) initialize { if (self == [GSViewTemplate class]) { [self setVersion: GSVIEWT_VERSION]; } } - (id) initWithCoder: (NSCoder *)coder { id obj = [super initWithCoder: coder]; if (obj != nil) { RELEASE(self); } return obj; } @end // Template for any classes which derive from NSText @implementation GSTextTemplate + (void) initialize { if (self == [GSTextTemplate class]) { [self setVersion: GSTEXTT_VERSION]; } } - (id) initWithCoder: (NSCoder *)coder { id obj = [super initWithCoder: coder]; if (obj != nil) { RELEASE(self); } return obj; } @end // Template for any classes which derive from GSTextView @implementation GSTextViewTemplate + (void) initialize { if (self == [GSTextViewTemplate class]) { [self setVersion: GSTEXTVIEWT_VERSION]; } } - (id) initWithCoder: (NSCoder *)coder { id obj = [super initWithCoder: coder]; if (obj != nil) { RELEASE(self); } return obj; } @end // Template for any classes which derive from NSMenu. @implementation GSMenuTemplate + (void) initialize { if (self == [GSMenuTemplate class]) { [self setVersion: GSMENUT_VERSION]; } } - (id) initWithCoder: (NSCoder *)coder { id obj = [super initWithCoder: coder]; if (obj != nil) { RELEASE(self); } return obj; } @end // Template for any classes which derive from NSControl @implementation GSControlTemplate + (void) initialize { if (self == [GSControlTemplate class]) { [self setVersion: GSCONTROLT_VERSION]; } } - (id) initWithCoder: (NSCoder *)coder { id obj = [super initWithCoder: coder]; if (obj != nil) { RELEASE(self); } return obj; } @end @implementation GSObjectTemplate + (void) initialize { if (self == [GSObjectTemplate class]) { [self setVersion: GSOBJECTT_VERSION]; } } - (id) initWithCoder: (NSCoder *)coder { id obj = [super initWithCoder: coder]; if (obj != nil) { RELEASE(self); } return obj; } @end // Order in this factory method is very important. // Which template to create must be determined // in sequence because of the class hierarchy. @implementation GSTemplateFactory + (id) templateForObject: (id) object withClassName: (NSString *)className withSuperClassName: (NSString *)superClassName { id template = nil; if (object != nil) { if ([object isKindOfClass: [NSWindow class]]) { template = [[GSWindowTemplate alloc] initWithObject: object className: className superClassName: superClassName]; } else if ([object isKindOfClass: [NSTextView class]]) { template = [[GSTextViewTemplate alloc] initWithObject: object className: className superClassName: superClassName]; } else if ([object isKindOfClass: [NSText class]]) { template = [[GSTextTemplate alloc] initWithObject: object className: className superClassName: superClassName]; } else if ([object isKindOfClass: [NSControl class]]) { template = [[GSControlTemplate alloc] initWithObject: object className: className superClassName: superClassName]; } else if ([object isKindOfClass: [NSView class]]) { template = [[GSViewTemplate alloc] initWithObject: object className: className superClassName: superClassName]; } else if ([object isKindOfClass: [NSMenu class]]) { template = [[GSMenuTemplate alloc] initWithObject: object className: className superClassName: superClassName]; } else if ([object isKindOfClass: [NSObject class]]) { // for gui elements derived from NSObject template = [[GSObjectTemplate alloc] initWithObject: object className: className superClassName: superClassName]; } } return AUTORELEASE(template); } @end gnustep-gui-0.24.0/Source/NSMenuView.m0000664000076500007650000016226612232570752017402 0ustar brains99brains99/** NSMenuView Copyright (C) 1999 Free Software Foundation, Inc. Author: Fred Kiefer Date: Sep 2001 Author: David Lazaro Saz Date: Oct 1999 Author: Michael Hanni Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSEvent.h" #import "AppKit/NSFont.h" #import "AppKit/NSImage.h" #import "AppKit/NSMenuView.h" #import "AppKit/NSMenu.h" #import "AppKit/NSButton.h" #import "AppKit/NSPopUpButtonCell.h" #import "AppKit/NSScreen.h" #import "AppKit/NSWindow.h" #import "AppKit/PSOperators.h" #import "GNUstepGUI/GSTheme.h" #import "GNUstepGUI/GSTitleView.h" typedef struct _GSCellRect { NSRect rect; } GSCellRect; #define GSI_ARRAY_TYPES 0 #define GSI_ARRAY_TYPE GSCellRect #define GSI_ARRAY_NO_RETAIN #define GSI_ARRAY_NO_RELEASE #ifdef GSIArray #undef GSIArray #endif #include static NSMapTable *viewInfo = 0; #define cellRects ((GSIArray)NSMapGet(viewInfo, self)) #define HORIZONTAL_MENU_LEFT_PADDING 8 /* NSMenuView contains: a) Title, if needed, this is a subview b) menu items */ /* A menu's title is an instance of this class */ @class NSButton; @interface NSMenu (Private) - (void) _attachMenu: (NSMenu*)aMenu; @end @implementation NSMenu (Private) - (void) _attachMenu: (NSMenu*)aMenu { _attachedMenu = aMenu; } @end @interface NSMenuView (Private) - (BOOL) _rootIsHorizontal: (BOOL*)isAppMenu; @end @implementation NSMenuView (Private) - (BOOL) _rootIsHorizontal: (BOOL*)isAppMenu { NSMenu *m = _attachedMenu; /* Determine root menu of this menu hierarchy */ while ([m supermenu] != nil) { m = [m supermenu]; } if (isAppMenu != 0) { if (m == [NSApp mainMenu]) { *isAppMenu = YES; } else { *isAppMenu = NO; } } return [[m menuRepresentation] isHorizontal]; } @end @implementation NSMenuView /* * Class methods. */ static float menuBarHeight = 0.0; + (void) _themeWillDeactivate: (NSNotification*)n { /* Clear cached information from the old theme ... will get info from * the new theme as required. */ menuBarHeight = 0; } + (void) initialize { if (viewInfo == 0) { viewInfo = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks, NSNonOwnedPointerMapValueCallBacks, 20); [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_themeWillDeactivate:) name: GSThemeWillDeactivateNotification object: nil]; } } + (float) menuBarHeight { if (menuBarHeight == 0.0) { const CGFloat themeHeight = [[GSTheme theme] menuBarHeight]; NSFont *font = [NSFont menuBarFontOfSize: 0.0]; menuBarHeight = [font boundingRectForFont].size.height; if (menuBarHeight < themeHeight) menuBarHeight = themeHeight; } return menuBarHeight; } /* * NSView overrides */ - (BOOL) acceptsFirstMouse: (NSEvent*)theEvent { return YES; } // We do not want to popup menus in this menu view. - (NSMenu *) menuForEvent: (NSEvent*) theEvent { NSDebugLLog (@"NSMenu", @"Query for menu in view"); return nil; } /* * Init methods. */ - (id) initWithFrame: (NSRect)aFrame { self = [super initWithFrame: aFrame]; if (!self) return nil; [self setFont: [NSFont menuFontOfSize: 0.0]]; _highlightedItemIndex = -1; _horizontalEdgePad = 4.; /* Set the necessary offset for the menuView. That is, how many pixels * do we need for our left side border line. */ _leftBorderOffset = 1; // Create an array to store our menu item cells. _itemCells = [NSMutableArray new]; // FIXME: Should this go in NSMenu instead of here? [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_themeDidActivate:) name: GSThemeDidActivateNotification object: nil]; return self; } - (id) initAsTearOff { self = [self initWithFrame: NSZeroRect]; if (nil == self) return nil; if (_attachedMenu) [_attachedMenu setTornOff: YES]; return self; } - (void) dealloc { [[NSNotificationCenter defaultCenter] removeObserver: self]; // We must remove the menu view from the menu list of observers. if (_attachedMenu != nil) { [[NSNotificationCenter defaultCenter] removeObserver: self name: nil object: _attachedMenu]; } /* Clean the pointer to us stored into the _itemCells. */ [_itemCells makeObjectsPerformSelector: @selector(setMenuView:) withObject: nil]; RELEASE(_itemCells); RELEASE(_font); /* * Get rid of any cached cell rects. */ { GSIArray a = NSMapGet(viewInfo, self); if (a != 0) { GSIArrayEmpty(a); NSZoneFree(NSDefaultMallocZone(), a); NSMapRemove(viewInfo, self); } } [super dealloc]; } /* * Getting and Setting Menu View Attributes */ - (void) setMenu: (NSMenu*)menu { NSNotificationCenter *theCenter = [NSNotificationCenter defaultCenter]; unsigned count; unsigned i; if (_attachedMenu != nil) { // Remove this menu view from the old menu list of observers. [theCenter removeObserver: self name: nil object: _attachedMenu]; } /* menu is retaining us, so we should not be retaining menu. */ _attachedMenu = menu; _items_link = [_attachedMenu itemArray]; if (_attachedMenu != nil) { // Add this menu view to the menu's list of observers. [theCenter addObserver: self selector: @selector(itemChanged:) name: NSMenuDidChangeItemNotification object: _attachedMenu]; [theCenter addObserver: self selector: @selector(itemAdded:) name: NSMenuDidAddItemNotification object: _attachedMenu]; [theCenter addObserver: self selector: @selector(itemRemoved:) name: NSMenuDidRemoveItemNotification object: _attachedMenu]; } count = [[[self menu] itemArray] count]; for (i = 0; i < count; i++) { NSNumber *n = [NSNumber numberWithInt: i]; NSDictionary *d; d = [NSDictionary dictionaryWithObject: n forKey: @"NSMenuItemIndex"]; [self itemAdded: [NSNotification notificationWithName: NSMenuDidAddItemNotification object: self userInfo: d]]; } // Force menu view's layout to be recalculated. [self setNeedsSizing: YES]; [self update]; } - (NSMenu*) menu { return _attachedMenu; } - (void) setHorizontal: (BOOL)flag { if (flag == YES && _horizontal == NO) { NSRect scRect = [[NSScreen mainScreen] frame]; GSIArray a = NSZoneMalloc(NSDefaultMallocZone(), sizeof(GSIArray_t)); GSIArrayInitWithZoneAndCapacity(a, NSDefaultMallocZone(), 8); NSMapInsert(viewInfo, self, a); scRect.size.height = [NSMenuView menuBarHeight]; [self setFrameSize: scRect.size]; [self setNeedsSizing: YES]; } else if (flag == NO && _horizontal == YES) { GSIArray a = NSMapGet(viewInfo, self); if (a != 0) { GSIArrayEmpty(a); NSZoneFree(NSDefaultMallocZone(), a); NSMapRemove(viewInfo, self); } [self setNeedsSizing: YES]; } _horizontal = flag; } - (BOOL) isHorizontal { return _horizontal; } - (void) setFont: (NSFont*)font { ASSIGN(_font, font); if (_font != nil) { const CGFloat themeHeight = [[GSTheme theme] menuItemHeight]; NSRect r; r = [_font boundingRectForFont]; /* Should make up 110, 20 for default font */ _cellSize = NSMakeSize (r.size.width * 10., r.size.height + 3.); if (_cellSize.height < themeHeight) _cellSize.height = themeHeight; [self setNeedsSizing: YES]; } } - (NSFont*) font { return _font; } - (void) setHighlightedItemIndex: (NSInteger)index { NSMenuItemCell *aCell; if (index == _highlightedItemIndex) return; // Unhighlight old if (_highlightedItemIndex != -1) { aCell = [self menuItemCellForItemAtIndex: _highlightedItemIndex]; [aCell setHighlighted: NO]; [self setNeedsDisplayForItemAtIndex: _highlightedItemIndex]; } // Set ivar to new index. _highlightedItemIndex = index; // Highlight new if (_highlightedItemIndex != -1) { aCell = [self menuItemCellForItemAtIndex: _highlightedItemIndex]; [aCell setHighlighted: YES]; [self setNeedsDisplayForItemAtIndex: _highlightedItemIndex]; } } - (NSInteger) highlightedItemIndex { return _highlightedItemIndex; } - (void) setMenuItemCell: (NSMenuItemCell *)cell forItemAtIndex: (NSInteger)index { NSMenuItem *anItem = [_items_link objectAtIndex: index]; [_itemCells replaceObjectAtIndex: index withObject: cell]; [cell setMenuItem: anItem]; [cell setMenuView: self]; if ([self highlightedItemIndex] == index) [cell setHighlighted: YES]; else [cell setHighlighted: NO]; // Mark the new cell and the menu view as needing resizing. [cell setNeedsSizing: YES]; [self setNeedsSizing: YES]; [self setNeedsDisplayForItemAtIndex: index]; } - (NSMenuItemCell*) menuItemCellForItemAtIndex: (NSInteger)index { if ((index >= 0) && (index < [_itemCells count])) return [_itemCells objectAtIndex: index]; else return nil; } - (NSMenuView*) attachedMenuView { return [[_attachedMenu attachedMenu] menuRepresentation]; } - (NSMenu*) attachedMenu { return [_attachedMenu attachedMenu]; } - (BOOL) isAttached { return [_attachedMenu isAttached]; } - (BOOL) isTornOff { return [_attachedMenu isTornOff]; } - (void) setHorizontalEdgePadding: (float)pad { _horizontalEdgePad = pad; [self setNeedsSizing: YES]; } - (float) horizontalEdgePadding { return _horizontalEdgePad; } /* * Notification Methods */ - (void) itemChanged: (NSNotification*)notification { int index = [[[notification userInfo] objectForKey: @"NSMenuItemIndex"] intValue]; NSMenuItemCell *aCell = [self menuItemCellForItemAtIndex: index]; // Enabling of the item may have changed [aCell setEnabled: [[aCell menuItem] isEnabled]]; // Mark the cell associated with the item as needing resizing. [aCell setNeedsSizing: YES]; // Mark the menu view as needing to be resized. [self setNeedsSizing: YES]; [self setNeedsDisplayForItemAtIndex: index]; } - (void) itemAdded: (NSNotification*)notification { int index = [[[notification userInfo] objectForKey: @"NSMenuItemIndex"] intValue]; NSMenuItem *anItem = [_items_link objectAtIndex: index]; id aCell = [NSMenuItemCell new]; int wasHighlighted = _highlightedItemIndex; // FIXME do we need to differentiate between popups and non popups [aCell setMenuItem: anItem]; [aCell setMenuView: self]; [aCell setFont: _font]; /* Unlight the previous highlighted cell if the index of the highlighted * cell will be ruined up by the insertion of the new cell. */ if (wasHighlighted >= index) { [self setHighlightedItemIndex: -1]; } [_itemCells insertObject: aCell atIndex: index]; /* Restore the highlighted cell, with the new index for it. */ if (wasHighlighted >= index) { /* Please note that if wasHighlighted == -1, it shouldn't be possible * to be here. */ [self setHighlightedItemIndex: ++wasHighlighted]; } [aCell setNeedsSizing: YES]; RELEASE(aCell); // Mark the menu view as needing to be resized. [self setNeedsSizing: YES]; [self setNeedsDisplay: YES]; } - (void) itemRemoved: (NSNotification*)notification { int wasHighlighted = [self highlightedItemIndex]; int index = [[[notification userInfo] objectForKey: @"NSMenuItemIndex"] intValue]; if (index <= wasHighlighted) { [self setHighlightedItemIndex: -1]; } [_itemCells removeObjectAtIndex: index]; if (wasHighlighted > index) { [self setHighlightedItemIndex: --wasHighlighted]; } // Mark the menu view as needing to be resized. [self setNeedsSizing: YES]; [self setNeedsDisplay: YES]; } /* * Working with Submenus. */ - (void) detachSubmenu { NSMenu *attachedMenu = [_attachedMenu attachedMenu]; NSMenuView *attachedMenuView; if (!attachedMenu) return; attachedMenuView = [attachedMenu menuRepresentation]; [attachedMenuView detachSubmenu]; NSDebugLLog (@"NSMenu", @"detach submenu: %@ from: %@", attachedMenu, _attachedMenu); if ([attachedMenu isTransient]) { [attachedMenu closeTransient]; } else { [attachedMenu close]; // Unselect the active item [self setHighlightedItemIndex: -1]; } } - (void) attachSubmenuForItemAtIndex: (NSInteger)index { /* * Transient menus are used for torn-off menus, which are already on the * screen and for sons of transient menus. As transients disappear as * soon as we release the mouse the user will be able to leave submenus * open on the screen and interact with other menus at the same time. */ NSMenu *attachableMenu; if (index < 0) { return; } attachableMenu = [[_items_link objectAtIndex: index] submenu]; if ([attachableMenu isTornOff] || [_attachedMenu isTransient]) { NSDebugLLog (@"NSMenu", @"Will open transient: %@", attachableMenu); [attachableMenu displayTransient]; [[attachableMenu menuRepresentation] setHighlightedItemIndex: -1]; } else { NSDebugLLog (@"NSMenu", @"Will open normal: %@", attachableMenu); // FIXME: Only resize when needed [attachableMenu sizeToFit]; [[attachableMenu window] setFrameOrigin: [self locationForSubmenu: attachableMenu]]; [_attachedMenu _attachMenu: attachableMenu]; [[attachableMenu window] orderFrontRegardless]; } } /* * Calculating Menu Geometry */ - (void) update { BOOL needTitleView; BOOL rootIsAppMenu; NSInterfaceStyle style; NSDebugLLog (@"NSMenu", @"update called on menu view"); /* * Ensure that a title view exists only if needed. */ style = NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil); if (style == NSWindows95InterfaceStyle || style == NSMacintoshInterfaceStyle) { needTitleView = NO; } else if (_attachedMenu == nil) { needTitleView = NO; } else if ([self _rootIsHorizontal: &rootIsAppMenu] == YES) { needTitleView = NO; } else if (rootIsAppMenu == YES) { needTitleView = YES; } else { // Popup menu doesn't need title bar needTitleView = ([_attachedMenu _ownedByPopUp] == YES) ? NO : YES; } if (needTitleView == YES && _titleView == nil) { Class titleViewClass = [[GSTheme theme] titleViewClassForMenuView: self]; _titleView = [[titleViewClass alloc] initWithOwner: _attachedMenu]; [self addSubview: _titleView]; RELEASE(_titleView); } if (needTitleView == NO && _titleView != nil) { [_titleView removeFromSuperview]; _titleView = nil; } if (_titleView != nil) { if ([_attachedMenu isTornOff] && ![_attachedMenu isTransient]) { [_titleView addCloseButtonWithAction: @selector(_performMenuClose:)]; } else { [_titleView removeCloseButton]; } } // Ask the menu to update itself. This will call sizeToFit if needed. [_attachedMenu update]; } - (void) setNeedsSizing: (BOOL)flag { _needsSizing = flag; } - (BOOL) needsSizing { return _needsSizing; } - (CGFloat) heightForItem: (NSInteger)idx { NSMenuItemCell *cell = [self menuItemCellForItemAtIndex: idx]; if (cell != nil) { NSMenuItem *item = [cell menuItem]; if ([item isSeparatorItem]) { return [[GSTheme theme] menuSeparatorHeight]; } } return _cellSize.height; } - (CGFloat) yOriginForItem: (NSInteger)item { const NSInteger count = [_itemCells count]; CGFloat total = 0; if (item >= 0) { NSInteger i = 0; for (i = (count - 1); i > item; i--) { total += [self heightForItem: i]; } } return total; } - (CGFloat) totalHeight { CGFloat total = 0; NSUInteger i = 0; for (i = 0; i < [_itemCells count]; i++) { total += [self heightForItem: i]; } return total; } - (void) sizeToFit { BOOL isPullDown = [_attachedMenu _ownedByPopUp] && [[_attachedMenu _owningPopUp] pullsDown]; if (_horizontal == YES) { unsigned i; unsigned howMany = [_itemCells count]; float currentX = HORIZONTAL_MENU_LEFT_PADDING; // NSRect scRect = [[NSScreen mainScreen] frame]; GSIArrayRemoveAllItems(cellRects); /* scRect.size.height = [NSMenuView menuBarHeight]; [self setFrameSize: scRect.size]; _cellSize.height = scRect.size.height; */ _cellSize.height = [NSMenuView menuBarHeight]; if (howMany && isPullDown) { GSCellRect elem; elem.rect = NSMakeRect (currentX, 0, (2 * _horizontalEdgePad), [self heightForItem: 0]); GSIArrayAddItem(cellRects, (GSIArrayItem)elem); currentX += 2 * _horizontalEdgePad; } for (i = isPullDown ? 1 : 0; i < howMany; i++) { GSCellRect elem; NSMenuItemCell *aCell = [self menuItemCellForItemAtIndex: i]; float titleWidth = [aCell titleWidth]; if ([aCell imageWidth]) { titleWidth += [aCell imageWidth] + GSCellTextImageXDist; } elem.rect = NSMakeRect (currentX, 0, (titleWidth + (2 * _horizontalEdgePad)), [self heightForItem: i]); GSIArrayAddItem(cellRects, (GSIArrayItem)elem); currentX += titleWidth + (2 * _horizontalEdgePad); } } else { unsigned i; unsigned howMany = [_itemCells count]; unsigned wideTitleView = 1; float neededImageAndTitleWidth = 0.0; float neededKeyEquivalentWidth = 0.0; float neededStateImageWidth = 0.0; float accumulatedOffset = 0.0; float popupImageWidth = 0.0; float menuBarHeight = 0.0; if (_titleView) { NSMenu *m = [_attachedMenu supermenu]; NSMenuView *r = [m menuRepresentation]; neededImageAndTitleWidth = [_titleView titleSize].width; if (r != nil && [r isHorizontal] == YES) { NSMenuItemCell *msr; msr = [r menuItemCellForItemAtIndex: [m indexOfItemWithTitle: [_attachedMenu title]]]; neededImageAndTitleWidth = [msr titleWidth] + GSCellTextImageXDist; } if (_titleView) menuBarHeight = [[self class] menuBarHeight]; else menuBarHeight += _leftBorderOffset; } else { menuBarHeight += _leftBorderOffset; } for (i = isPullDown ? 1 : 0; i < howMany; i++) { float aStateImageWidth; float aTitleWidth; float anImageWidth; float anImageAndTitleWidth; float aKeyEquivalentWidth; NSMenuItemCell *aCell = [self menuItemCellForItemAtIndex: i]; // State image area. aStateImageWidth = [aCell stateImageWidth]; // Title and Image area. aTitleWidth = [aCell titleWidth]; anImageWidth = [aCell imageWidth]; // Key equivalent area. aKeyEquivalentWidth = [aCell keyEquivalentWidth]; switch ([aCell imagePosition]) { case NSNoImage: anImageAndTitleWidth = aTitleWidth; break; case NSImageOnly: anImageAndTitleWidth = anImageWidth; break; case NSImageLeft: case NSImageRight: anImageAndTitleWidth = anImageWidth + aTitleWidth + GSCellTextImageXDist; break; case NSImageBelow: case NSImageAbove: case NSImageOverlaps: default: if (aTitleWidth > anImageWidth) anImageAndTitleWidth = aTitleWidth; else anImageAndTitleWidth = anImageWidth; break; } if (aStateImageWidth > neededStateImageWidth) neededStateImageWidth = aStateImageWidth; if (anImageAndTitleWidth > neededImageAndTitleWidth) neededImageAndTitleWidth = anImageAndTitleWidth; if (aKeyEquivalentWidth > neededKeyEquivalentWidth) neededKeyEquivalentWidth = aKeyEquivalentWidth; // Title view width less than item's left part width if ((anImageAndTitleWidth + aStateImageWidth) > neededImageAndTitleWidth) wideTitleView = 0; // Popup menu has only one item with nibble or arrow image if (anImageWidth) popupImageWidth = anImageWidth; } if (isPullDown && howMany) howMany -= 1; // Cache the needed widths. _stateImageWidth = neededStateImageWidth; _imageAndTitleWidth = neededImageAndTitleWidth; _keyEqWidth = neededKeyEquivalentWidth; accumulatedOffset = _horizontalEdgePad; if (howMany) { // Calculate the offsets and cache them. if (neededStateImageWidth) { _stateImageOffset = accumulatedOffset; accumulatedOffset += neededStateImageWidth += _horizontalEdgePad; } if (neededImageAndTitleWidth) { _imageAndTitleOffset = accumulatedOffset; accumulatedOffset += neededImageAndTitleWidth; } if (wideTitleView) { _keyEqOffset = accumulatedOffset = neededImageAndTitleWidth + (3 * _horizontalEdgePad); } else { _keyEqOffset = accumulatedOffset += (2 * _horizontalEdgePad); } accumulatedOffset += neededKeyEquivalentWidth + _horizontalEdgePad; if ([_attachedMenu supermenu] != nil && neededKeyEquivalentWidth < 8) { accumulatedOffset += 8 - neededKeyEquivalentWidth; } } else { accumulatedOffset += neededImageAndTitleWidth + 3 + 2; if ([_attachedMenu supermenu] != nil) accumulatedOffset += 15; } // Calculate frame size. if (_needsSizing) { // Add the border width: 1 for left, 2 for right sides _cellSize.width = accumulatedOffset + 3; } if ([_attachedMenu _ownedByPopUp]) { _keyEqOffset = _cellSize.width - _keyEqWidth - popupImageWidth; } [self setFrameSize: NSMakeSize(_cellSize.width + _leftBorderOffset, [self totalHeight] + menuBarHeight)]; [_titleView setFrame: NSMakeRect (0, [self totalHeight], NSWidth (_bounds), menuBarHeight)]; } _needsSizing = NO; } - (float) stateImageOffset { if (_needsSizing) [self sizeToFit]; return _stateImageOffset; } - (float) stateImageWidth { if (_needsSizing) [self sizeToFit]; return _stateImageWidth; } - (float) imageAndTitleOffset { if (_needsSizing) [self sizeToFit]; return _imageAndTitleOffset; } - (float) imageAndTitleWidth { if (_needsSizing) [self sizeToFit]; return _imageAndTitleWidth; } - (float) keyEquivalentOffset { if (_needsSizing) [self sizeToFit]; return _keyEqOffset; } - (float) keyEquivalentWidth { if (_needsSizing) [self sizeToFit]; return _keyEqWidth; } - (NSRect) innerRect { if (_horizontal == NO) { return NSMakeRect (_bounds.origin.x + _leftBorderOffset, _bounds.origin.y, _bounds.size.width - _leftBorderOffset, _bounds.size.height); } else { return NSMakeRect (_bounds.origin.x, _bounds.origin.y + _leftBorderOffset, _bounds.size.width, _bounds.size.height - _leftBorderOffset); } } - (NSRect) rectOfItemAtIndex: (NSInteger)index { if (_needsSizing == YES) { [self sizeToFit]; } // The first item of a pull down menu holds its title and isn't displayed if (index == 0 && [_attachedMenu _ownedByPopUp] && [[_attachedMenu _owningPopUp] pullsDown]) { return NSZeroRect; } if (_horizontal == YES) { GSCellRect aRect; aRect = GSIArrayItemAtIndex(cellRects, index).ext; return aRect.rect; } else { NSRect theRect; theRect.origin.y = [self yOriginForItem: index]; theRect.origin.x = _leftBorderOffset; theRect.size = _cellSize; theRect.size.height = [self heightForItem: index]; /* NOTE: This returns the correct NSRect for drawing cells, but nothing * else (unless we are a popup). This rect will have to be modified for * event calculation, etc.. */ return theRect; } } - (NSInteger) indexOfItemAtPoint: (NSPoint)point { unsigned howMany = [_itemCells count]; unsigned i; for (i = 0; i < howMany; i++) { NSRect aRect = [self rectOfItemAtIndex: i]; //NSLog(@"indexOfItemAtPoint called for %@ %@ %d %@", self, NSStringFromPoint(point), i, NSStringFromRect(aRect)); aRect.origin.x -= _leftBorderOffset; aRect.size.width += _leftBorderOffset; // For horizontal menus, clicking in the left padding should be treated // as hitting the first menu item. if (_horizontal == YES && i == 0) { aRect.origin.x -= HORIZONTAL_MENU_LEFT_PADDING; aRect.size.width += HORIZONTAL_MENU_LEFT_PADDING; } if (NSMouseInRect(point, aRect, NO)) return (int)i; } return -1; } - (void) setNeedsDisplayForItemAtIndex: (NSInteger)index { NSRect aRect; aRect = [self rectOfItemAtIndex: index]; aRect.origin.x -= _leftBorderOffset; aRect.size.width += _leftBorderOffset; [self setNeedsDisplayInRect: aRect]; } - (NSPoint) locationForSubmenu: (NSMenu *)aSubmenu { NSRect frame = [_window frame]; NSRect submenuFrame; const CGFloat submenuHorizOverlap = [[GSTheme theme] menuSubmenuHorizontalOverlap]; const CGFloat submenuVertOverlap = [[GSTheme theme] menuSubmenuVerticalOverlap]; if (_needsSizing) [self sizeToFit]; if (aSubmenu) submenuFrame = [[[aSubmenu menuRepresentation] window] frame]; else submenuFrame = NSZeroRect; if (_horizontal == NO) { if (NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", [aSubmenu menuRepresentation]) == GSWindowMakerInterfaceStyle) { NSRect aRect = [self convertRect: [self rectOfItemAtIndex: [_attachedMenu indexOfItemWithSubmenu: aSubmenu]] toView: nil]; NSPoint subOrigin = [_window convertBaseToScreen: aRect.origin]; return NSMakePoint (NSMaxX(frame) - submenuHorizOverlap, subOrigin.y - NSHeight(submenuFrame) - 2 + 2*[NSMenuView menuBarHeight]); } else if ([self _rootIsHorizontal: 0] == YES) { NSRect aRect = [self convertRect: [self rectOfItemAtIndex: [_attachedMenu indexOfItemWithSubmenu: aSubmenu]] toView: nil]; NSPoint subOrigin = [_window convertBaseToScreen: aRect.origin]; // FIXME ... why is the offset +1 needed below? return NSMakePoint (NSMaxX(frame) - submenuHorizOverlap, subOrigin.y - NSHeight(submenuFrame) + aRect.size.height + 1); } else { return NSMakePoint(NSMaxX(frame) - submenuHorizOverlap, NSMaxY(frame) - NSHeight(submenuFrame)); } } else { NSRect aRect = [self convertRect: [self rectOfItemAtIndex: [_attachedMenu indexOfItemWithSubmenu: aSubmenu]] toView: nil]; NSPoint subOrigin = [_window convertBaseToScreen: aRect.origin]; /* If menu is in window, we add +1 for don't lose the track when the user move the mouse from the horizontal menu to a submenu.*/ if (NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil) == NSWindows95InterfaceStyle) { return NSMakePoint(subOrigin.x, subOrigin.y - NSHeight(submenuFrame) + 1 + submenuVertOverlap); } else { return NSMakePoint(subOrigin.x, subOrigin.y - NSHeight(submenuFrame) + submenuVertOverlap); } } } - (void) resizeWindowWithMaxHeight: (float)maxHeight { // FIXME set the menuview's window to max height in order to keep on screen? } - (void) setWindowFrameForAttachingToRect: (NSRect)screenRect onScreen: (NSScreen*)screen preferredEdge: (NSRectEdge)edge popUpSelectedItem: (NSInteger)selectedItemIndex { NSRect r; NSRect cellFrame; NSRect popUpFrame; int items = [_itemCells count]; BOOL growHeight = YES; BOOL resizeCell = NO; CGFloat borderOffsetInBaseCoords; // Our window needs to have a nonzero size for the // -convertRect:fromView: and relatead methods to work. [_window setFrame: NSMakeRect(0,0,1,1) display: NO]; // Make sure the menu entries are up to date [self update]; if (_needsSizing) [self sizeToFit]; /* FIXME: Perhaps all of this belongs into NSPopupButtonCell and should be used to determine the proper screenRect to pass on into this method. */ /* certain style of pulldowns don't want sizing on the _cellSize.height */ if ([_attachedMenu _ownedByPopUp]) { NSPopUpButtonCell *bcell; bcell = [_attachedMenu _owningPopUp]; if ([bcell pullsDown]) { if ([bcell isBordered] == NO) { growHeight = NO; } else { switch ([bcell bezelStyle]) { case NSRegularSquareBezelStyle: case NSShadowlessSquareBezelStyle: growHeight = NO; break; default: break; } } } } cellFrame = screenRect; /* we should have the calculated cell size, grow the width if needed to match the screenRect and vice versa */ if (cellFrame.size.width > [self convertSizeToBase: _cellSize].width) { _cellSize.width = [self convertSizeFromBase: cellFrame.size].width; resizeCell = YES; } else { cellFrame.size.width = [self convertSizeToBase: _cellSize].width; } /* certain pop-ups don't want the height resized */ if (growHeight && cellFrame.size.height > [self convertSizeToBase: _cellSize].height) { _cellSize.height = [self convertSizeFromBase: cellFrame.size].height; resizeCell = YES; } else { cellFrame.size.height = [self convertSizeToBase: _cellSize].height; } /* now sizeToFit again with needs sizing = NO so it doesn't overwrite _cellSize just recalculate the offsets. */ if (resizeCell) [self sizeToFit]; /* * Compute the frame. popUpFrame is in screen coordinates */ popUpFrame = cellFrame; borderOffsetInBaseCoords = [self convertSizeToBase: NSMakeSize(_leftBorderOffset, 0)].width; if (items > 0) { float f; if (_horizontal == NO) { f = cellFrame.size.height * (items - 1); popUpFrame.size.height += f + borderOffsetInBaseCoords; popUpFrame.origin.y -= f; popUpFrame.size.width += borderOffsetInBaseCoords; popUpFrame.origin.x -= borderOffsetInBaseCoords; // If the menu is a pull down menu the first item, which would // appear at the top of the menu, holds the title and is omitted if ([_attachedMenu _ownedByPopUp]) { if ([[_attachedMenu _owningPopUp] pullsDown]) { popUpFrame.size.height -= cellFrame.size.height; popUpFrame.origin.y += cellFrame.size.height; } } // Compute position for popups, if needed if (selectedItemIndex != -1) { popUpFrame.origin.y += cellFrame.size.height * selectedItemIndex; } } else { f = cellFrame.size.width * (items - 1); popUpFrame.size.width += f; // If the menu is a pull down menu the first item holds the // title and is omitted if ([_attachedMenu _ownedByPopUp]) { if ([[_attachedMenu _owningPopUp] pullsDown]) { popUpFrame.size.width -= cellFrame.size.width; } } // Compute position for popups, if needed if (selectedItemIndex != -1) { popUpFrame.origin.x -= cellFrame.size.width * selectedItemIndex; } } } // Update position, if needed, using the preferredEdge if (selectedItemIndex == -1) { NSRect screenFrame; if (screen == nil) screen = [NSScreen mainScreen]; screenFrame = [screen frame]; popUpFrame.origin.y -= cellFrame.size.height; if (edge == NSMinYEdge || edge == NSMaxYEdge) { NSRect minYFrame = popUpFrame; NSRect maxYFrame = popUpFrame; // show menu above or below the cell depending on the preferred edge // if the menu would be partially off screen on that edge use the // opposite edge or at least the one where more space is left maxYFrame.origin.y += maxYFrame.size.height + screenRect.size.height - _leftBorderOffset; if (edge == NSMinYEdge) { if ((NSMinY(minYFrame) < NSMinY(screenFrame)) && ((NSMaxY(maxYFrame) <= NSMaxY(screenFrame)) || (NSMaxY(screenFrame) - NSMaxY(screenRect) > NSMinY(screenRect) - NSMinY(screenFrame)))) { edge = NSMaxYEdge; } } else { if ((NSMaxY(maxYFrame) > NSMaxY(screenFrame)) && ((NSMinY(minYFrame) >= NSMinY(screenFrame)) || (NSMaxY(screenFrame) - NSMaxY(screenRect) < NSMinY(screenRect) - NSMinY(screenFrame)))) { edge = NSMinYEdge; } } popUpFrame = edge == NSMinYEdge ? minYFrame : maxYFrame; } else { NSRect minXFrame = popUpFrame; NSRect maxXFrame = popUpFrame; minXFrame.origin.y += screenRect.size.height; minXFrame.origin.x -= minXFrame.size.width; maxXFrame.origin.y += screenRect.size.height; maxXFrame.origin.x += screenRect.size.width + _leftBorderOffset; // show menu on the opposite edge if it does not fit on screen on // the preferred edge if (edge == NSMinXEdge) { if ((NSMinX(minXFrame) < NSMinX(screenFrame)) && ((NSMaxX(maxXFrame) <= NSMaxX(screenFrame)) || (NSMaxX(screenFrame) - NSMaxX(screenRect) > NSMinX(screenRect) - NSMinX(screenFrame)))) { edge = NSMaxXEdge; } } else { if ((NSMaxX(maxXFrame) > NSMaxX(screenFrame)) && ((NSMinX(minXFrame) >= NSMinX(screenFrame)) || (NSMaxX(screenFrame) - NSMaxX(screenRect) < NSMinX(screenRect) - NSMinX(screenFrame)))) { edge = NSMinXEdge; } } popUpFrame = edge == NSMinXEdge ? minXFrame : maxXFrame; } } // Get the frameRect { NSSize contentSize = [self convertSizeFromBase: popUpFrame.size]; NSRect contentRect = NSMakeRect(popUpFrame.origin.x, popUpFrame.origin.y, contentSize.width, contentSize.height); r = [_window frameRectForContentRect: contentRect]; // Set the window frame. r should be identical to popUpFrame except with // any borders the window wanted to add. [_window setFrame: r display: NO]; } } /* * Drawing. */ - (BOOL) isOpaque { return NO; } - (void) drawRect: (NSRect)rect { [[GSTheme theme] drawMenuRect: rect inView: self isHorizontal: _horizontal itemCells: _itemCells]; } /* * Event Handling */ - (void) performActionWithHighlightingForItemAtIndex: (NSInteger)index { NSMenu *candidateMenu = _attachedMenu; NSMenuView *targetMenuView; int indexToHighlight = index; int oldHighlightedIndex; for (;;) { NSMenu *superMenu = [candidateMenu supermenu]; if (superMenu == nil || [candidateMenu isAttached] || [candidateMenu isTornOff]) { targetMenuView = [candidateMenu menuRepresentation]; break; } else { indexToHighlight = [superMenu indexOfItemWithSubmenu: candidateMenu]; candidateMenu = superMenu; } } oldHighlightedIndex = [targetMenuView highlightedItemIndex]; [targetMenuView setHighlightedItemIndex: indexToHighlight]; /* We need to let the run loop run a little so that the fact that * the item is highlighted gets displayed on screen. */ [[NSRunLoop currentRunLoop] runUntilDate: [NSDate dateWithTimeIntervalSinceNow: 0.1]]; [_attachedMenu performActionForItemAtIndex: index]; if (![_attachedMenu _ownedByPopUp]) { [targetMenuView setHighlightedItemIndex: oldHighlightedIndex]; } } #define MOVE_THRESHOLD_DELTA 2.0 #define DELAY_MULTIPLIER 10 - (BOOL) _executeItemAtIndex: (int)indexOfActionToExecute removeSubmenu: (BOOL)subMenusNeedRemoving { NSInterfaceStyle style = NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", self); if (indexOfActionToExecute >= 0 && [_attachedMenu attachedMenu] != nil && [_attachedMenu attachedMenu] == [[_items_link objectAtIndex: indexOfActionToExecute] submenu]) { if (style == NSMacintoshInterfaceStyle) { // On Macintosh, clicking on or releasing the mouse over a // submenu item always closes the menu (if it is open) and // ends menu tracking. We do the same here, too. [self detachSubmenu]; return YES; } if (style == NSWindows95InterfaceStyle) { return YES; } if (subMenusNeedRemoving) { [self detachSubmenu]; } // Clicked on a submenu. return NO; } return YES; } - (BOOL) _trackWithEvent: (NSEvent*)event startingMenuView: (NSMenuView*)mainWindowMenuView { NSUInteger eventMask = NSPeriodicMask; NSDate *theDistantFuture = [NSDate distantFuture]; NSPoint lastLocation = {0,0}; BOOL justAttachedNewSubmenu = NO; BOOL subMenusNeedRemoving = YES; BOOL shouldFinish = YES; BOOL popUpProcessEvents = [[GSTheme theme] doesProcessEventsForPopUpMenu]; int delayCount = 0; int indexOfActionToExecute = -1; int firstIndex = -1; NSInterfaceStyle style = NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", self); NSEvent *original; NSEventType type; /* * The original event is unused except to determine whether the method * was invoked in response to a right or left mouse down. * We pass the same event on when we want tracking to move into a * submenu. */ original = AUTORELEASE(RETAIN(event)); type = [event type]; /** * The following event tracking run loop can run for a long time, during * which new windows (for submenus) are created and put on screen. The * window manager might not place the menus where we ask them to be placed * (e.g. Metacity will move menus so they don't overlap the GNOME * top-of-screen panel). * * The mechanism which updates an NSWindow's frame when an external force * (such as the window manager) moves a window is an NSAppKitDefined event. * Since we need the frames of the menu windows to be accurate to know which * menu item the cursor is actually over, and since we are running our own * event loop and the NSAppKitDefined events aren't handled for us, we need * to request them ourselves and forward them to the relevant window. * * NOTE: While it seems messy to have to handle these events, Cocoa doesn't * handle them automatically either for code which goes in to an event * tracking loop. */ eventMask |= NSAppKitDefinedMask; eventMask |= NSRightMouseUpMask | NSRightMouseDraggedMask; eventMask |= NSRightMouseDownMask; eventMask |= NSOtherMouseUpMask | NSOtherMouseDraggedMask; eventMask |= NSOtherMouseDownMask; eventMask |= NSLeftMouseUpMask | NSLeftMouseDraggedMask; eventMask |= NSLeftMouseDownMask; /* We need know if the user press a modifier key to close the menu when the menu is in a window or when is owned by a popup and theme process events. */ if (style == NSWindows95InterfaceStyle || popUpProcessEvents) { eventMask |= NSFlagsChangedMask; } // Ignore the first mouse up if menu is horizontal. if ([self isHorizontal] == YES || // Or if menu is transient and style is NSWindows95InterfaceStyle. ([[self menu] isTransient] && style == NSWindows95InterfaceStyle) || /* Or to mimic Mac OS X behavior for pop up menus. If the user presses the mouse button over a pop up button and then drags the mouse over the menu, the menu is closed when the user releases the mouse. On the other hand, when the user clicks on the button and then moves the mouse the menu is closed upon the next mouse click. */ ([[self menu] _ownedByPopUp] && (style == NSMacintoshInterfaceStyle || popUpProcessEvents))) { /* * Ignore the first mouse up if nothing interesting has happened. */ shouldFinish = NO; } do { if (type == NSFlagsChanged) { /* Close the menu if the user press a modifier key and menu is in a window */ if (mainWindowMenuView != nil) { [self setHighlightedItemIndex: -1]; [[[mainWindowMenuView menu] attachedMenu] close]; return NO; } /* Close the menu if is owned by a popup and theme process events */ if ([[self menu] _ownedByPopUp] && popUpProcessEvents) { [[[self menu] _owningPopUp] dismissPopUp]; return NO; } } if (type == NSLeftMouseUp || type == NSRightMouseUp || type == NSOtherMouseUp) { shouldFinish = YES; } if (type == NSPeriodic || event == original) { NSPoint location; int index; location = [_window mouseLocationOutsideOfEventStream]; index = [self indexOfItemAtPoint: [self convertPoint: location fromView: nil]]; if (event == original) { firstIndex = index; } if (index != firstIndex) { shouldFinish = YES; } /* * 1 - if menus is only partly visible and the mouse is at the * edge of the screen we move the menu so it will be visible. */ if ([_attachedMenu isPartlyOffScreen]) { NSPoint pointerLoc = [_window convertBaseToScreen: location]; NSRect screenFrame = [[_window screen] visibleFrame]; /* * The +/-1 in the y - direction is because the flipping * between X-coordinates and GNUstep coordinates let the * GNUstep screen coordinates start with 1. */ if (pointerLoc.x == 0 || pointerLoc.y == 1 || pointerLoc.x == screenFrame.size.width - 1 || pointerLoc.y == screenFrame.size.height) [_attachedMenu shiftOnScreen]; } /* * 2 - Check if we have to reset the justAttachedNewSubmenu * flag to NO. */ if (justAttachedNewSubmenu && index != -1 && index != _highlightedItemIndex) { if (location.x - lastLocation.x > MOVE_THRESHOLD_DELTA) { delayCount ++; if (delayCount >= DELAY_MULTIPLIER) { justAttachedNewSubmenu = NO; } } else { justAttachedNewSubmenu = NO; } } // 3 - If we have moved outside this menu, take appropriate action if (index == -1) { NSPoint locationInScreenCoordinates; NSWindow *windowUnderMouse; NSMenu *candidateMenu; subMenusNeedRemoving = NO; locationInScreenCoordinates = [_window convertBaseToScreen: location]; /* * 3a - Check if moved into one of the ancestor menus. * This is tricky, there are a few possibilities: * We are a transient attached menu of a * non-transient menu * We are a non-transient attached menu * We are a root: isTornOff of AppMenu */ candidateMenu = [_attachedMenu supermenu]; while (candidateMenu && !NSMouseInRect (locationInScreenCoordinates, [[candidateMenu window] frame], NO) // not found yet && (! ([candidateMenu isTornOff] && ![candidateMenu isTransient])) // no root of display tree && [candidateMenu isAttached]) // has displayed parent { candidateMenu = [candidateMenu supermenu]; } if (candidateMenu != nil && NSMouseInRect (locationInScreenCoordinates, [[candidateMenu window] frame], NO)) { BOOL candidateMenuResult; NSMenuView *subMenuView = [[candidateMenu attachedMenu] menuRepresentation]; // The call to fetch attachedMenu is not needed. But putting // it here avoids flicker when we go back to an ancestor // menu and the attached menu is already correct. [subMenuView detachSubmenu]; // Reset highlighted index for this menu. // This way if we return to this submenu later there // won't be a highlighted item. [subMenuView setHighlightedItemIndex: -1]; candidateMenuResult = [[candidateMenu menuRepresentation] _trackWithEvent: original startingMenuView: mainWindowMenuView]; return candidateMenuResult; } // 3b - Check if we enter the attached submenu windowUnderMouse = [[_attachedMenu attachedMenu] window]; if (windowUnderMouse != nil && NSMouseInRect (locationInScreenCoordinates, [windowUnderMouse frame], NO)) { BOOL wasTransient = [_attachedMenu isTransient]; BOOL subMenuResult; subMenuResult = [[self attachedMenuView] _trackWithEvent: original startingMenuView: mainWindowMenuView]; if (subMenuResult && wasTransient == [_attachedMenu isTransient]) { [self detachSubmenu]; } return subMenuResult; } /* We track the menu correctly when this is located in a window */ if (mainWindowMenuView != nil) { // If the user moves the mouse into the main window // horizontal menu, start tracking again. NSWindow *mainWindow = [mainWindowMenuView window]; NSPoint locationInMainWindow = [mainWindow convertScreenToBase: locationInScreenCoordinates]; if ([mainWindowMenuView hitTest: locationInMainWindow] != nil) { int index = [mainWindowMenuView indexOfItemAtPoint: [mainWindowMenuView convertPoint: locationInMainWindow fromView: nil]]; if (index != -1 && index != [mainWindowMenuView highlightedItemIndex]) { [self setHighlightedItemIndex: -1]; return [mainWindowMenuView _trackWithEvent: original startingMenuView: mainWindowMenuView]; } } } } // 4 - We changed the selected item and should update. if (!justAttachedNewSubmenu && index != _highlightedItemIndex) { subMenusNeedRemoving = NO; [self detachSubmenu]; [self setHighlightedItemIndex: index]; // WO: Question? Why the ivar _items_link if (index >= 0 && [[_items_link objectAtIndex: index] submenu]) { [self attachSubmenuForItemAtIndex: index]; justAttachedNewSubmenu = YES; delayCount = 0; } } // Update last seen location for the justAttachedNewSubmenu logic. lastLocation = location; } do { event = [NSApp nextEventMatchingMask: eventMask untilDate: theDistantFuture inMode: NSEventTrackingRunLoopMode dequeue: YES]; type = [event type]; if (type == NSAppKitDefined) { [[event window] sendEvent: event]; } } while (type == NSAppKitDefined); } while ((type != NSLeftMouseUp && type != NSRightMouseUp && type != NSOtherMouseUp) || shouldFinish == NO); /* * Ok, we released the mouse * There are now a few possibilities: * A - We released the mouse outside the menu. * Then we want the situation as it was before * we entered everything. * B - We released the mouse on a submenu item * (i) - this was highlighted before we started clicking: * Remove attached menus * (ii) - this was not highlighted before pressed the mouse button; * Keep attached menus. * C - We released the mouse above an ordinary action: * Execute the action. * * In case A, B and C we want the transient menus to be removed * In case A and C we want to remove the menus that were created * during the dragging. * * So we should do the following things: * * 1 - Stop periodic events, * 2 - Determine the action. * 3 - Remove the Transient menus from the screen. * 4 - Perform the action if there is one. */ // FIXME [NSEvent stopPeriodicEvents]; /* * We need to store this, because _highlightedItemIndex * will not be valid after we removed this menu from the screen. */ indexOfActionToExecute = _highlightedItemIndex; // remove transient menus. -------------------------------------------- { NSMenu *currentMenu = _attachedMenu; while (currentMenu && ![currentMenu isTransient]) { currentMenu = [currentMenu attachedMenu]; } while ([currentMenu isTransient] && [currentMenu supermenu]) { currentMenu = [currentMenu supermenu]; } [[currentMenu menuRepresentation] detachSubmenu]; if ([currentMenu isTransient]) { [currentMenu closeTransient]; } } if (indexOfActionToExecute == -1) { return YES; } // Before executing the action, uncapture the mouse [_window _releaseMouse: self]; /* If we have menu in window, close the menu after select an option */ if (mainWindowMenuView != nil) { if (self != mainWindowMenuView) { [mainWindowMenuView setHighlightedItemIndex: -1]; } [[[mainWindowMenuView menu] attachedMenu] close]; } if ([self _executeItemAtIndex: indexOfActionToExecute removeSubmenu: subMenusNeedRemoving] == NO) { return NO; } [_attachedMenu performActionForItemAtIndex: indexOfActionToExecute]; /* * Remove highlighting. * We first check if it still highlighted because it could be the * case that we choose an action in a transient window which * has already dissappeared. */ if (_highlightedItemIndex >= 0) { [self setHighlightedItemIndex: -1]; } return YES; } - (BOOL) trackWithEvent: (NSEvent*)event { BOOL result = NO; NSMenuView *mainWindowMenuView = nil; if (NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", self) == NSWindows95InterfaceStyle && ![[self menu] isTransient] && ![[self menu] _ownedByPopUp]) { mainWindowMenuView = self; } // Capture the mouse so we get clicks outside the menus and // GNUstep windows. [_window _captureMouse: self]; NS_DURING result = [self _trackWithEvent: event startingMenuView: mainWindowMenuView]; NS_HANDLER [_window _releaseMouse: self]; [localException raise]; NS_ENDHANDLER [_window _releaseMouse: self]; return result; } /** This method is called when the user clicks on a button in the menu. Or, if a right click happens and the app menu is brought up. The original position is stored, so we can restore the position of menu. The position of the menu can change during the event tracking because the menu will automatillay move when parts are outside the screen and the user move the mouse pointer to the edge of the screen. */ - (void) mouseDown: (NSEvent*)theEvent { NSRect currentFrame; NSRect originalFrame; NSPoint currentTopLeft; NSPoint originalTopLeft = NSZeroPoint; /* Silence compiler. */ BOOL restorePosition; /* * Only for non transient menus do we want * to remember the position. */ restorePosition = ![_attachedMenu isTransient]; if (restorePosition) { // store old position; originalFrame = [_window frame]; originalTopLeft = originalFrame.origin; originalTopLeft.y += originalFrame.size.height; } [NSEvent startPeriodicEventsAfterDelay: 0.1 withPeriod: 0.01]; [self trackWithEvent: theEvent]; [NSEvent stopPeriodicEvents]; if (restorePosition) { currentFrame = [_window frame]; currentTopLeft = currentFrame.origin; currentTopLeft.y += currentFrame.size.height; if (NSEqualPoints(currentTopLeft, originalTopLeft) == NO) { NSPoint origin = currentFrame.origin; origin.x += (originalTopLeft.x - currentTopLeft.x); origin.y += (originalTopLeft.y - currentTopLeft.y); [_attachedMenu nestedSetFrameOrigin: origin]; } } } - (void) rightMouseDown: (NSEvent*) theEvent { [self mouseDown: theEvent]; } - (void) otherMouseDown: (NSEvent*) theEvent { [self mouseDown: theEvent]; } - (BOOL) performKeyEquivalent: (NSEvent *)theEvent { return [_attachedMenu performKeyEquivalent: theEvent]; } - (void) _themeDidActivate: (NSNotification*)notification { // The new theme may have different menu item sizes, // so the window size for the menu needs to be recalculated. [[self menu] sizeToFit]; } /* * NSCoding Protocol * * Normally unused because NSMenu does not encode its NSMenuView since * NSMenuView is considered a platform specific way of rendering the menu. */ - (void) encodeWithCoder: (NSCoder*)encoder { [super encodeWithCoder: encoder]; if ([encoder allowsKeyedCoding] == NO) { [encoder encodeObject: _itemCells]; [encoder encodeObject: _font]; [encoder encodeValueOfObjCType: @encode(BOOL) at: &_horizontal]; [encoder encodeValueOfObjCType: @encode(float) at: &_horizontalEdgePad]; [encoder encodeValueOfObjCType: @encode(NSSize) at: &_cellSize]; } } - (id) initWithCoder: (NSCoder*)decoder { self = [super initWithCoder: decoder]; if (!self) return nil; if ([decoder allowsKeyedCoding] == NO) { [decoder decodeValueOfObjCType: @encode(id) at: &_itemCells]; [_itemCells makeObjectsPerformSelector: @selector(setMenuView:) withObject: self]; [decoder decodeValueOfObjCType: @encode(id) at: &_font]; [decoder decodeValueOfObjCType: @encode(BOOL) at: &_horizontal]; [decoder decodeValueOfObjCType: @encode(float) at: &_horizontalEdgePad]; [decoder decodeValueOfObjCType: @encode(NSSize) at: &_cellSize]; _highlightedItemIndex = -1; _needsSizing = YES; } return self; } @end @implementation NSMenuView (GNUstepPrivate) - (NSArray *)_itemCells { return _itemCells; } @end gnustep-gui-0.24.0/Source/GSInfoPanel.m0000664000076500007650000004725612036032401017472 0ustar brains99brains99/** GSInfoPanel.m Standard GNUstep info panel Copyright (C) 2000 Free Software Foundation, Inc. Author: Nicola Pero Date: January 2000 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSButton.h" #import "AppKit/NSEvent.h" #import "AppKit/NSFont.h" #import "AppKit/NSImage.h" #import "AppKit/NSImageView.h" #import "AppKit/NSPasteboard.h" #import "AppKit/NSTextField.h" #import "GNUstepGUI/GSInfoPanel.h" #import "GNUstepGUI/GSTheme.h" #import "GSGuiPrivate.h" static id value_from_info_plist_for_key (NSString *key) { static NSDictionary *d = nil; /* We use this additional BOOL so that if loading Info-gnustep.plist fails once, we do not try again. */ static BOOL load_failed = NO; if ((d == nil) && (load_failed == NO)) { d = [[NSBundle mainBundle] localizedInfoDictionary]; if (d == nil) load_failed = YES; } if (d) return [d objectForKey: key]; return nil; } static BOOL nil_or_not_of_class (id object, Class class) { return ((object == nil) || ([object isKindOfClass: class] == NO)); } static NSTextField * new_label (NSString *value) { NSTextField *t; t = AUTORELEASE([NSTextField new]); [t setStringValue: value]; [t setDrawsBackground: NO]; [t setEditable: NO]; [t setSelectable: NO]; [t setBezeled: NO]; [t setBordered: NO]; [t setAlignment: NSLeftTextAlignment]; return t; } /* * An object that displays a list of left-aligned strings (used for the authors) */ @interface _GSLabelListView: NSView { } /* After initialization, its size is the size it needs, just move it where we want it to show */ - (id) initWithStringArray: (NSArray *)array font: (NSFont *)font; @end @implementation _GSLabelListView - (id) initWithStringArray: (NSArray *)array font: (NSFont *)font { self = [super init]; if (self != nil) { unsigned int count; NSTextField *field; float height = 2; float width = 0; NSRect r; count = [array count]; /* * We go through the array in reverse order, adding items from * the bottom of the view working upwards. This means that the * order of strings in the array will appear orderd from top to * bottom in the view. */ while (count-- > 0) { id item = [array objectAtIndex: count]; if ([item isKindOfClass: [NSString class]] == NO) continue; field = new_label (item); [field setFont: font]; [field sizeToFit]; [field setAutoresizingMask: NSViewNotSizable]; r = [field frame]; r.origin.x = 0; r.origin.y = height; if (r.size.width > width) width = r.size.width; height += r.size.height + 2; [field setFrame: r]; [self setFrameSize: NSMakeSize (width, height)]; [self addSubview: field]; } [self setFrameSize: NSMakeSize (width, height - 2)]; } return self; } @end @implementation GSInfoPanel: NSPanel + (void) initialize { if (self == [GSInfoPanel class]) { [self setVersion: 1]; } } - (void) dealloc { [[NSNotificationCenter defaultCenter] removeObserver: self]; [super dealloc]; } /* When the current theme changes, we need to update the info panel to match. */ - (void) _themeDidActivate: (NSNotification*)n { NSView *c = [self contentView]; NSEnumerator *e = [[c subviews] objectEnumerator]; NSView *v; NSButton *b; while ((v = [e nextObject]) != nil) { if ([v isKindOfClass: [NSButton class]] && [(b = (NSButton*)v) target] == [GSTheme class]) { NSString *s; NSRect f; s = [NSString stringWithFormat: @"%@: %@", _(@"Current theme"), [[GSTheme theme] name]]; [b setTitle: s]; [b sizeToFit]; f = [b frame]; f.origin.x = ([c frame].size.width - f.size.width) / 2; [b setFrame: f]; [c setNeedsDisplay: YES]; } } } - (id) initWithDictionary: (NSDictionary *)dictionary; { /* Info to show */ NSString *name = nil; NSString *description = nil; NSImage *icon = nil; NSString *release = nil; NSString *fullVersionID = nil; NSArray *authors = nil; NSString *url = nil; NSString *copyright = nil; NSString *copyrightDescription = nil; NSString *theme = nil; /* GUI Objects used to show the Info */ NSButton *iconButton; NSTextField *nameLabel; NSTextField *descriptionLabel = nil; NSTextField *versionLabel; _GSLabelListView *authorsList; NSTextField *authorTitleLabel; NSTextField *urlLabel = nil; NSTextField *copyrightLabel; NSTextField *copyrightDescriptionLabel = nil; NSButton *themeLabel = nil; NSFont *smallFont; /* Minimum size we use for the panel */ float width = 241; float height = 107; /* Used for computations */ float tmp_A; float tmp_a; float tmp_b; float tmp_c; NSRect f; NSView *cv; /* * Gets what we need to show */ /* Application Name */ if (dictionary) name = [dictionary objectForKey: @"ApplicationName"]; if (nil_or_not_of_class (name, [NSString class])) { name = value_from_info_plist_for_key (@"ApplicationName"); if (nil_or_not_of_class (name, [NSString class])) { name = value_from_info_plist_for_key (@"NSHumanReadableShortName"); if (nil_or_not_of_class (name, [NSString class])) { name = value_from_info_plist_for_key (@"CFBundleName"); if (nil_or_not_of_class (name, [NSString class])) { name = [[NSProcessInfo processInfo] processName]; } } } } /* Application Description */ if (dictionary) description = [dictionary objectForKey: @"ApplicationDescription"]; if (nil_or_not_of_class (description, [NSString class])) { description = value_from_info_plist_for_key (@"ApplicationDescription"); if ([description isKindOfClass: [NSString class]] == NO) description = nil; } /* NB: description might be nil */ /* Application Icon */ if (dictionary) icon = [dictionary objectForKey: @"ApplicationIcon"]; if (nil_or_not_of_class (icon, [NSImage class])) { icon = [NSImage imageNamed: value_from_info_plist_for_key (@"ApplicationIcon")]; if (nil_or_not_of_class (icon, [NSImage class])) { icon = [NSImage imageNamed: @"NSApplicationIcon"]; if (nil_or_not_of_class (icon, [NSImage class])) icon = [NSApp applicationIconImage]; } } /* Release */ if (dictionary) release = [dictionary objectForKey: @"ApplicationRelease"]; if (nil_or_not_of_class (release, [NSString class])) { if (dictionary) release = [dictionary objectForKey: @"ApplicationVersion"]; if (nil_or_not_of_class (release, [NSString class])) { release = value_from_info_plist_for_key (@"ApplicationRelease"); if (nil_or_not_of_class (release, [NSString class])) { release = value_from_info_plist_for_key (@"NSAppVersion"); if (nil_or_not_of_class (release, [NSString class])) { release = value_from_info_plist_for_key (@"CFBundleVersion"); if (nil_or_not_of_class (release, [NSString class])) { release = @"Unknown"; } } } } } /* FullVersionID */ if (dictionary) fullVersionID = [dictionary objectForKey: @"FullVersionID"]; if (nil_or_not_of_class (fullVersionID, [NSString class])) { if (dictionary) fullVersionID = [dictionary objectForKey: @"Version"]; if (nil_or_not_of_class (fullVersionID, [NSString class])) { fullVersionID = value_from_info_plist_for_key (@"NSBuildVersion"); if ([fullVersionID isKindOfClass: [NSString class]] == NO) fullVersionID = nil; } } /* NB: fullVersionID can be nil! */ /* Now we prepare the complete release string */ release = [_(@"Release: ") stringByAppendingString: release]; if (fullVersionID) { release = [release stringByAppendingString: @" ("]; release = [release stringByAppendingString: fullVersionID]; release = [release stringByAppendingString: @")"]; } /* Authors */ if (dictionary) authors = [dictionary objectForKey: @"Authors"]; if (nil_or_not_of_class (authors, [NSArray class])) { if ([authors isKindOfClass: [NSString class]]) { authors = [NSArray arrayWithObject: authors]; } else { authors = value_from_info_plist_for_key (@"Authors"); if (nil_or_not_of_class (authors, [NSArray class])) { if ([authors isKindOfClass: [NSString class]]) { authors = [NSArray arrayWithObject: authors]; } else { authors = [NSArray arrayWithObject: @"Unknown"]; } } } } /* URL */ if (dictionary) url = [dictionary objectForKey: @"URL"]; if (nil_or_not_of_class (url, [NSString class])) { url = value_from_info_plist_for_key (@"URL"); } // URL can be nil /* Copyright */ if (dictionary) copyright = [dictionary objectForKey: @"Copyright"]; if (nil_or_not_of_class (copyright, [NSString class])) { copyright = value_from_info_plist_for_key (@"Copyright"); if (nil_or_not_of_class (copyright, [NSString class])) { copyright = value_from_info_plist_for_key (@"NSHumanReadableCopyright"); if (nil_or_not_of_class (copyright, [NSString class])) copyright = _(@"Copyright Information Not Available"); } } /* Copyright Description */ if (dictionary) copyrightDescription = [dictionary objectForKey: @"CopyrightDescription"]; if (nil_or_not_of_class (copyrightDescription, [NSString class])) { copyrightDescription = value_from_info_plist_for_key (@"CopyrightDescription"); if ([copyrightDescription isKindOfClass: [NSString class]] == NO) copyrightDescription = nil; } /* NB: copyrightDescription can be nil */ /* * Create GUI Objects */ f = NSMakeRect(0, 0, 48, 48); iconButton = AUTORELEASE([[NSButton alloc] initWithFrame: f]); [[iconButton cell] setImageScaling: NSImageScaleProportionallyUpOrDown]; [iconButton setImage: icon]; [iconButton setBordered: NO]; [iconButton setImagePosition: NSImageOnly]; /* Clicking on the iconButton starts the GSMemoryPanel. */ [iconButton setEnabled: YES]; [iconButton setTarget: NSApp]; [iconButton setAction: @selector(orderFrontSharedMemoryPanel:)]; nameLabel = new_label (name); [nameLabel setFont: [NSFont boldSystemFontOfSize: 32]]; [nameLabel sizeToFit]; if (description) { descriptionLabel = new_label (description); [descriptionLabel setFont: [NSFont boldSystemFontOfSize: 14]]; [descriptionLabel sizeToFit]; } smallFont = [NSFont systemFontOfSize: 12]; versionLabel = new_label (release); [versionLabel setFont: smallFont]; [versionLabel sizeToFit]; if ([authors count] == 0) { authorTitleLabel = new_label (@""); } else if ([authors count] == 1) { authorTitleLabel = new_label (_(@"Author: ")); } else { authorTitleLabel = new_label (_(@"Authors: ")); } [authorTitleLabel setFont: smallFont]; [authorTitleLabel sizeToFit]; authorsList = AUTORELEASE([[_GSLabelListView alloc] initWithStringArray: authors font: smallFont]); if (url) { urlLabel = new_label (url); [urlLabel setFont: smallFont]; [urlLabel sizeToFit]; } copyrightLabel = new_label (copyright); [copyrightLabel setFont: smallFont]; [copyrightLabel sizeToFit]; if (copyrightDescription) { copyrightDescriptionLabel = new_label (copyrightDescription); [copyrightDescriptionLabel setFont: smallFont]; [copyrightDescriptionLabel sizeToFit]; } theme = [NSString stringWithFormat: @"%@: %@", _(@"Current theme"), [[GSTheme theme] name]]; themeLabel = AUTORELEASE([NSButton new]); [themeLabel setTitle: theme]; [themeLabel setBordered: NO]; [themeLabel setAlignment: NSLeftTextAlignment]; [themeLabel setFont: smallFont]; [themeLabel setButtonType: NSMomentaryLightButton]; [themeLabel setFocusRingType: NSFocusRingTypeNone]; [themeLabel sizeToFit]; /* * Compute width and height of the panel */ /** width **/ tmp_A = f.size.width; /* distance between icon and title */ tmp_A += 10; /* compute the maximum of the following three sizes */ tmp_a = [nameLabel frame].size.width; if (description) { tmp_b = [descriptionLabel frame].size.width; if (tmp_a < tmp_b) tmp_a = tmp_b; } tmp_b = [versionLabel frame].size.width; if (tmp_a < tmp_b) tmp_a = tmp_b; /* Add in to tmp_A */ tmp_A += tmp_a; /* Update width */ if (width < tmp_A) width = tmp_A; tmp_A = [authorTitleLabel frame].size.width; tmp_A += [authorsList frame].size.width; if (width < tmp_A) width = tmp_A; /* FIXME depending on where we put url */ if (url) { tmp_A = [urlLabel frame].size.width; if (tmp_A > width) width = tmp_A; } tmp_A = [copyrightLabel frame].size.width; if (tmp_A > width) width = tmp_A; if (copyrightDescription) { tmp_A = [copyrightDescriptionLabel frame].size.width; if (tmp_A > width) width = tmp_A; } tmp_A = [themeLabel frame].size.width; if (tmp_A > width) width = tmp_A; /* height */ /* Warning: we implicitly assume icon height is approx of the standard height of 48. The code tries to be nice so that 50 or 47 should more or less work -- but beware that 200 or 20 will *not* work. */ tmp_A = f.size.height; if (description) tmp_A += 10; else tmp_A += 5; tmp_A += [versionLabel frame].size.height; tmp_A += 20; tmp_A += [authorsList frame].size.height; if (url) { tmp_A += [urlLabel frame].size.height + 2; } tmp_A += 25; tmp_A += [copyrightLabel frame].size.height; if (copyrightDescription) { tmp_A += 2; tmp_A += [copyrightDescriptionLabel frame].size.height; } tmp_A += 5; tmp_A += [themeLabel frame].size.height; if (tmp_A > height) height = tmp_A; /* Add border to both width and height */ width += 32; height += 36; /* * TODO: Adjust/check obtained width and height ? * (NB: If they are adjusted, code putting views in the panel * has to be adjusted too!) */ /* * Creates the panel with the right width and height */ self = [super initWithContentRect: NSMakeRect (100, 100, width, height) styleMask: (NSTitledWindowMask | NSClosableWindowMask) backing: NSBackingStoreRetained defer: YES]; if (!self) return nil; /* * Add objects to the panel in their position */ cv = [self contentView]; { NSImageView* backgroundImage = [[NSImageView alloc] initWithFrame: NSMakeRect(0, 0, width, height)]; //[backgroundImage setImageAlignment: NSImageAlignCenter]; //[backgroundImage setImageScaling: NSScaleProportionally]; [backgroundImage setImage: [NSImage imageNamed: @"LogoGNUstep"]]; [backgroundImage setEditable: NO]; [cv addSubview: backgroundImage]; RELEASE(backgroundImage); } f = [iconButton frame]; f.origin.x = 16; f.origin.y = height - 18 - f.size.height; tmp_a = f.origin.x + f.size.width + 10; tmp_b = f.origin.y; tmp_c = f.size.height; [cv addSubview: iconButton]; [iconButton setFrame: f]; f = [nameLabel frame]; f.origin.x = tmp_a; /* NB: We rely upon the fact that the text in a text field is vertically centered in its frame */ if (description) f.origin.y = tmp_b + 10; else f.origin.y = tmp_b; f.size.height = tmp_c; [cv addSubview: nameLabel]; [nameLabel setFrame: f]; if (description) { f = [descriptionLabel frame]; f.origin.x = tmp_a; f.origin.y = tmp_b - 5; [cv addSubview: descriptionLabel]; [descriptionLabel setFrame: f]; } f = [versionLabel frame]; f.origin.x = width - 16 - f.size.width; if (description) f.origin.y = tmp_b - 10 - f.size.height; else f.origin.y = tmp_b - 5 - f.size.height; tmp_b = f.origin.y; [cv addSubview: versionLabel]; [versionLabel setFrame: f]; tmp_b -= 20; tmp_a = [authorTitleLabel frame].size.width; tmp_a += [authorsList frame].size.width; tmp_a = (width - tmp_a) / 2; f = [authorTitleLabel frame]; f.origin.x = tmp_a; tmp_c = tmp_a + f.size.width; f.origin.y = tmp_b - f.size.height; [cv addSubview: authorTitleLabel]; [authorTitleLabel setFrame: f]; f = [authorsList frame]; f.origin.x = tmp_c; f.origin.y = tmp_b - f.size.height; tmp_b = f.origin.y; [cv addSubview: authorsList]; [authorsList setFrame: f]; if (url) { /* FIXME position of this thing */ f = [urlLabel frame]; f.origin.x = tmp_a; f.origin.y = tmp_b - 2 - f.size.height; tmp_b = f.origin.y; [cv addSubview: urlLabel]; [urlLabel setFrame: f]; } f = [copyrightLabel frame]; f.origin.x = (width - f.size.width) / 2; f.origin.y = tmp_b - 25 - f.size.height; tmp_b = f.origin.y; [cv addSubview: copyrightLabel]; [copyrightLabel setFrame: f]; if (copyrightDescription) { f = [copyrightDescriptionLabel frame]; f.origin.x = (width - f.size.width) / 2; f.origin.y = tmp_b - 2 - f.size.height; tmp_b = f.origin.y; [cv addSubview: copyrightDescriptionLabel]; [copyrightDescriptionLabel setFrame: f]; } f = [themeLabel frame]; f.origin.x = (width - f.size.width) / 2; f.origin.y = tmp_b - 5 - f.size.height; [cv addSubview: themeLabel]; [themeLabel setFrame: f]; [themeLabel setTarget: [GSTheme class]]; [themeLabel setAction: @selector(orderFrontSharedThemePanel:)]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_themeDidActivate:) name: GSThemeDidActivateNotification object: nil]; [self center]; return self; } - (void) copy: (id)sender { NSArray *types = [NSArray arrayWithObject: NSStringPboardType]; NSPasteboard *pboard = [NSPasteboard generalPasteboard]; NSMutableString *text = [[NSMutableString alloc] init]; NSView *cv = [self contentView]; NSEnumerator *enumerator = [[cv subviews] objectEnumerator]; NSView *subview; // Loop over all the text subviews and collect the information while ((subview = [enumerator nextObject]) != nil) { if ([subview isKindOfClass: [NSTextField class]]) { [text appendString: [(NSTextField*)subview stringValue]]; [text appendString: @"\n"]; } } [pboard declareTypes: types owner: self]; [pboard setString: text forType: NSStringPboardType]; RELEASE(text); } - (void) keyDown: (NSEvent*)theEvent { NSString *characters = [theEvent characters]; unichar character = 0; if ([characters length] > 0) { character = [characters characterAtIndex: 0]; } // FIXME: Hard coded if (character == 'c' && ([theEvent modifierFlags] & NSCommandKeyMask)) { [self copy: nil]; return; } [super keyDown: theEvent]; } @end gnustep-gui-0.24.0/Source/GSGuiPrivate.h0000664000076500007650000000557311622323745017703 0ustar brains99brains99/* GSGuiPrivate.h Define private functions for use in the GNUstep GUI Library Copyright (C) 2001 Free Software Foundation, Inc. Author: Nicola Pero Date: 2001 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSGuiPrivate #define _GNUstep_H_GSGuiPrivate #import #include "GNUstepBase/GSConfig.h" #include /* * Return the gnustep-gui bundle used to load gnustep-gui resources. * Should be only used inside the gnustep-gui library. Implemented * in Source/NSApplication.m */ NSBundle *GSGuiBundle (void); /* * Localize a message of the gnustep-gui library. */ static inline NSString *GSGuiLocalizedString (NSString *key, NSString *comment) { NSBundle *b = GSGuiBundle (); if (b != nil) { return [b localizedStringForKey: key value: @"" table: nil]; } else { return key; } } /* * Redefine _() to be our own GSGuiLocalizedString(). This is so that * make_strings will recognize it, and for easy typing. */ #ifdef _ # undef _ #endif #define _(X) GSGuiLocalizedString (X, @"") #ifdef NSLocalizedString # undef NSLocalizedString #endif #define NSLocalizedString(key,comment) GSGuiLocalizedString (key, comment) /** * Rounds to the nearest integer, and in the case of ties, round to the * larger integer. This is the recommended rounding function for rounding * graphics points. * * For example: * GSRoundTowardsInfinity(0.8) == 1.0 * GSRoundTowardsInfinity(0.5) == 1.0 * GSRoundTowardsInfinity(0.1) == 0.0 * GSRoundTowardsInfinity(-2.5) == -2.0 */ static inline CGFloat GSRoundTowardsInfinity(CGFloat x) { return floor(x + 0.5); } /** * Rounds to the nearest integer, and in the case of ties, round to the * smaller integer. * * For example: * GSRoundTowardsNegativeInfinity(0.8) == 1.0 * GSRoundTowardsNegativeInfinity(0.5) == 0.0 * GSRoundTowardsNegativeInfinity(0.1) == 0.0 * GSRoundTowardsNegativeInfinity(-2.5) == -3.0 */ static inline CGFloat GSRoundTowardsNegativeInfinity(CGFloat x) { return ceil(x - 0.5); } #endif /* _GNUstep_H_GSGuiPrivate */ gnustep-gui-0.24.0/Source/GSDragView.m0000664000076500007650000007535312110507426017335 0ustar brains99brains99/* GSDragView - Generic Drag and Drop code. Copyright (C) 2004 Free Software Foundation, Inc. Author: Fred Kiefer Date: May 2004 Based on X11 specific code from: Created by: Wim Oudshoorn Date: Nov 2001 Written by: Adam Fedor Date: Nov 1998 This file is part of the GNU Objective C User Interface Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSCell.h" #import "AppKit/NSCursor.h" #import "AppKit/NSEvent.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSImage.h" #import "AppKit/NSPasteboard.h" #import "AppKit/NSView.h" #import "AppKit/NSWindow.h" #import "GNUstepGUI/GSDisplayServer.h" #import "GNUstepGUI/GSDragView.h" #include /* Size of the dragged window */ #define DWZ 48 #define SLIDE_TIME_STEP .02 /* in seconds */ #define SLIDE_NR_OF_STEPS 20 @interface GSRawWindow : NSWindow @end @interface NSApplication (GNUstepPrivate) - (void) _postAndSendEvent: (NSEvent *)anEvent; @end @interface NSCursor (BackendPrivate) - (void *)_cid; - (void) _setCid: (void *)val; @end @interface GSDragView (Private) - (void) _setupWindowFor: (NSImage*)anImage mousePosition: (NSPoint)mPoint imagePosition: (NSPoint)iPoint; - (void) _clearupWindow; - (BOOL) _updateOperationMask: (NSEvent*) theEvent; - (void) _setCursor; - (void) _sendLocalEvent: (GSAppKitSubtype)subtype action: (NSDragOperation)action position: (NSPoint)eventLocation timestamp: (NSTimeInterval)time toWindow: (NSWindow*)dWindow; - (void) _handleDrag: (NSEvent*)theEvent slidePoint: (NSPoint)slidePoint; - (void) _handleEventDuringDragging: (NSEvent *)theEvent; - (void) _updateAndMoveImageToCorrectPosition; - (void) _moveDraggedImageToNewPosition; - (void) _slideDraggedImageTo: (NSPoint)screenPoint numberOfSteps: (int) steps delay: (float) delay waitAfterSlide: (BOOL) waitFlag; @end @implementation GSRawWindow - (BOOL) canBecomeMainWindow { return NO; } - (BOOL) canBecomeKeyWindow { return NO; } - (void) _initDefaults { [super _initDefaults]; [self setReleasedWhenClosed: NO]; [self setExcludedFromWindowsMenu: YES]; } - (void) orderWindow: (NSWindowOrderingMode)place relativeTo: (NSInteger)otherWin { [super orderWindow: place relativeTo: otherWin]; [self setLevel: NSPopUpMenuWindowLevel]; } @end @implementation GSDragView static GSDragView *sharedDragView = nil; + (id) sharedDragView { if (sharedDragView == nil) { sharedDragView = [GSDragView new]; } return sharedDragView; } + (Class) windowClass { return [GSRawWindow class]; } - (id) init { self = [super init]; if (self != nil) { NSRect winRect = {{0, 0}, {DWZ, DWZ}}; NSWindow *sharedDragWindow = [[[object_getClass(self) windowClass] alloc] initWithContentRect: winRect styleMask: NSBorderlessWindowMask backing: NSBackingStoreNonretained defer: NO]; dragCell = [[NSCell alloc] initImageCell: nil]; [dragCell setBordered: NO]; [sharedDragWindow setContentView: self]; [sharedDragWindow setBackgroundColor: [NSColor clearColor]]; // Kept alive by the window RELEASE(self); } return self; } - (void) dealloc { [super dealloc]; RELEASE(cursors); } /* NSDraggingInfo protocol */ - (NSWindow*) draggingDestinationWindow { return destWindow; } - (NSPoint) draggingLocation { return dragPoint; } - (NSPasteboard*) draggingPasteboard { return dragPasteboard; } - (NSInteger) draggingSequenceNumber { return dragSequence; } - (id) draggingSource { return dragSource; } - (NSDragOperation) draggingSourceOperationMask { // Mix in possible modifiers return dragMask & operationMask; } - (NSImage*) draggedImage { if (dragSource) return [dragCell image]; else return nil; } - (NSPoint) draggedImageLocation { NSPoint loc = dragPoint; if (dragSource) { loc.x -= offset.width; loc.y -= offset.height; } return loc; } - (NSArray *) namesOfPromisedFilesDroppedAtDestination: (NSURL *)dropDestination { if ([dragSource respondsToSelector: @selector(namesOfPromisedFilesDroppedAtDestination:)]) { return [dragSource namesOfPromisedFilesDroppedAtDestination: dropDestination]; } else { return nil; } } - (BOOL) isDragging { return isDragging; } - (void) drawRect: (NSRect)rect { [dragCell drawWithFrame: [self frame] inView: self]; } - (void) dragImage: (NSImage*)anImage at: (NSPoint)screenLocation offset: (NSSize)initialOffset event: (NSEvent*)event pasteboard: (NSPasteboard*)pboard source: (id)sourceObject slideBack: (BOOL)slideFlag { NSPoint eventPoint; NSPoint imagePoint; ASSIGN(dragPasteboard, pboard); ASSIGN(dragSource, sourceObject); dragSequence = [event timestamp]; slideBack = slideFlag; // Unset the target window targetWindowRef = 0; targetMask = NSDragOperationEvery; destExternal = NO; NSDebugLLog(@"NSDragging", @"Start drag with %@", [pboard types]); /* * The position of the mouse is the event location plus any offset * provided. We convert this from window coordinates to screen * coordinates. */ eventPoint = [event locationInWindow]; eventPoint = [[event window] convertBaseToScreen: eventPoint]; eventPoint.x += initialOffset.width; eventPoint.y += initialOffset.height; /* * Adjust image location to match the mose adjustment. */ imagePoint = screenLocation; imagePoint.x += initialOffset.width; imagePoint.y += initialOffset.height; [self _setupWindowFor: anImage mousePosition: eventPoint imagePosition: imagePoint]; isDragging = YES; [self _handleDrag: event slidePoint: screenLocation]; isDragging = NO; DESTROY(dragSource); DESTROY(dragPasteboard); } - (void) slideDraggedImageTo: (NSPoint)point { float distx = point.x - dragPosition.x; float disty = point.y - dragPosition.y; float dist = sqrt((distx * distx) + (disty * disty)); NSSize imgSize = [[dragCell image] size]; float imgDist = sqrt((imgSize.width * imgSize.width) + (imgSize.height * imgSize.height)); int steps = (int)(dist/imgDist); /* * Convert point from coordinates of image to coordinates of mouse * cursor for internal use. */ point.x += offset.width; point.y += offset.height; /* [self _slideDraggedImageTo: point numberOfSteps: SLIDE_NR_OF_STEPS delay: SLIDE_TIME_STEP waitAfterSlide: YES];*/ [self _slideDraggedImageTo: point numberOfSteps: steps delay: SLIDE_TIME_STEP waitAfterSlide: YES]; } /* Called by NSWindow. Sends drag events to external sources */ - (void) postDragEvent: (NSEvent *)theEvent { if ([theEvent subtype] == GSAppKitDraggingStatus) { NSDragOperation action = [theEvent data2]; if (destExternal) { } else { if (action != targetMask) { targetMask = action; [self _setCursor]; } } } } - (void) sendExternalEvent: (GSAppKitSubtype)subtype action: (NSDragOperation)action position: (NSPoint)eventLocation timestamp: (NSTimeInterval)time toWindow: (int)dWindowNumber { } /* Return the window that lies below the cursor and accepts drag and drop. In mouseWindowRef the OS reference for this window is returned, this is even set, if there is a native window, but no GNUstep window at this location. */ - (NSWindow*) windowAcceptingDnDunder: (NSPoint)mouseLocation windowRef: (int*)mouseWindowRef { NSInteger win; *mouseWindowRef = 0; win = [GSServerForWindow(_window) findWindowAt: mouseLocation windowRef: mouseWindowRef excluding: [_window windowNumber]]; return GSWindowWithNumber(win); } @end @implementation GSDragView (Private) /* Method to initialize the dragview before it is put on the screen. It only initializes the instance variables that have to do with moving the image over the screen and variables that are used to keep track where we are. So it is typically used just before the dragview is actually displayed. Post conditions: - dragCell is initialized with the image to drag. - all instance variables pertaining to moving the window are initialized */ - (void) _setupWindowFor: (NSImage*)anImage mousePosition: (NSPoint)mPoint imagePosition: (NSPoint)iPoint { NSSize imageSize; if (anImage == nil) { anImage = [NSImage imageNamed: @"common_Close"]; } imageSize = [anImage size]; [dragCell setImage: anImage]; /* setup the coordinates, used for moving the view around */ dragPosition = mPoint; newPosition = mPoint; offset.width = mPoint.x - iPoint.x; offset.height = mPoint.y - iPoint.y; [_window setFrame: NSMakeRect (iPoint.x, iPoint.y, imageSize.width, imageSize.height) display: NO]; // Only display the image [GSServerForWindow(_window) restrictWindow: [_window windowNumber] toImage: [dragCell image]]; [_window orderFront: nil]; } - (void) _clearupWindow { [_window setFrame: NSZeroRect display: NO]; [_window orderOut: nil]; } /* updates the operationMask by examining modifier keys pressed during -theEvent-. If the current value of operationMask == NSDragOperationIgnoresModifiers it will return immediately without updating the operationMask This method will return YES if the operationMask is changed, NO if it is still the same. */ - (BOOL) _updateOperationMask: (NSEvent*) theEvent { NSUInteger mod = [theEvent modifierFlags]; NSDragOperation oldOperationMask = operationMask; if (operationMask == NSDragOperationIgnoresModifiers) { return NO; } if (mod & NSControlKeyMask) { operationMask = NSDragOperationLink; } else if (mod & NSAlternateKeyMask) { operationMask = NSDragOperationCopy; } else if (mod & NSCommandKeyMask) { operationMask = NSDragOperationGeneric; } else { operationMask = NSDragOperationEvery; } return (operationMask != oldOperationMask); } /** _setCursor examines the state of the dragging and update the cursor accordingly. It will not save the current cursor, if you want to keep the original you have to save it yourself. The code recogines 4 cursors: - NONE - when the source does not allow dragging - COPY - when the current operation is ONLY Copy - LINK - when the current operation is ONLY Link - GENERIC - all other cases And two colors - GREEN - when the target accepts the drop - BLACK - when the target does not accept the drop Note that the code to figure out which of the 4 cursor to use depends on the fact that {NSDragOperationNone, NSDragOperationCopy, NSDragOperationLink} = {0, 1, 2} */ - (void) _setCursor { NSCursor *newCursor; NSString *name; NSString *iname; NSDragOperation mask; mask = dragMask & operationMask; if (targetWindowRef != 0) mask &= targetMask; NSDebugLLog (@"NSDragging", @"drag, operation, target mask = (%x, %x, %x), dnd aware = %d\n", (unsigned int)dragMask, (unsigned int)operationMask, (unsigned int)targetMask, (targetWindowRef != 0)); if (cursors == nil) cursors = RETAIN([NSMutableDictionary dictionary]); name = nil; newCursor = nil; iname = nil; switch (mask) { case NSDragOperationNone: name = @"NoCursor"; iname = @"common_noCursor"; break; case NSDragOperationCopy: name = @"CopyCursor"; iname = @"common_copyCursor"; break; case NSDragOperationLink: name = @"LinkCursor"; iname = @"common_linkCursor"; break; case NSDragOperationGeneric: break; default: // FIXME: Should not happen, add warning? break; } if (name != nil) { newCursor = [cursors objectForKey: name]; if (newCursor == nil) { NSImage *image = [NSImage imageNamed: iname]; newCursor = [[NSCursor alloc] initWithImage: image]; [cursors setObject: newCursor forKey: name]; RELEASE(newCursor); } } if (newCursor == nil) { name = @"ArrowCursor"; newCursor = [cursors objectForKey: name]; if (newCursor == nil) { /* Make our own arrow cursor, since we want to color it */ void *c; newCursor = [[NSCursor alloc] initWithImage: nil]; [GSCurrentServer() standardcursor: GSArrowCursor : &c]; [newCursor _setCid: c]; [cursors setObject: newCursor forKey: name]; RELEASE(newCursor); } } if ((targetWindowRef != 0) && mask != NSDragOperationNone) { [GSCurrentServer() recolorcursor: [NSColor greenColor] : [NSColor blackColor] : [newCursor _cid]]; } else { [GSCurrentServer() recolorcursor: [NSColor blackColor] : [NSColor whiteColor] : [newCursor _cid]]; } [newCursor set]; } - (void) _sendLocalEvent: (GSAppKitSubtype)subtype action: (NSDragOperation)action position: (NSPoint)eventLocation timestamp: (NSTimeInterval)time toWindow: (NSWindow*)dWindow { NSEvent *e; NSGraphicsContext *context = GSCurrentContext(); // FIXME: Should store this once NSInteger dragWindowRef = (NSInteger)(intptr_t)[GSServerForWindow(_window) windowDevice: [_window windowNumber]]; eventLocation = [dWindow convertScreenToBase: eventLocation]; e = [NSEvent otherEventWithType: NSAppKitDefined location: eventLocation modifierFlags: 0 timestamp: time windowNumber: [dWindow windowNumber] context: context subtype: subtype data1: dragWindowRef data2: action]; [NSApp _postAndSendEvent: e]; } /* The dragging support works by hijacking the NSApp event loop. - this function loops until the dragging operation is finished and consumes all NSEvents during the drag operation. - It sets up periodic events. The drawing and communication with DraggingSource and DraggingTarget is handled in the periodic event code. The use of periodic events is purely a performance improvement. If no periodic events are used the system can not process them all on time. At least on a 333Mhz laptop, using fairly simple DraggingTarget code. PROBLEMS: - No autoreleasePools are created. So long drag operations can consume memory - It seems that sometimes a periodic event get lost. */ - (void) _handleDrag: (NSEvent*)theEvent slidePoint: (NSPoint)slidePoint { // Caching some often used values. These values do not // change in this method. // Use eWindow for coordination transformation NSWindow *eWindow = [theEvent window]; NSDate *theDistantFuture = [NSDate distantFuture]; NSUInteger eventMask = NSLeftMouseDownMask | NSLeftMouseUpMask | NSLeftMouseDraggedMask | NSMouseMovedMask | NSPeriodicMask | NSAppKitDefinedMask | NSFlagsChangedMask; NSPoint startPoint; // Storing values, to restore after we have finished. NSCursor *cursorBeforeDrag = [NSCursor currentCursor]; BOOL deposited; startPoint = [eWindow convertBaseToScreen: [theEvent locationInWindow]]; startPoint.x -= offset.width; startPoint.y -= offset.height; NSDebugLLog(@"NSDragging", @"Drag window origin %@\n", NSStringFromPoint(startPoint)); // Notify the source that dragging has started if ([dragSource respondsToSelector: @selector(draggedImage:beganAt:)]) { [dragSource draggedImage: [self draggedImage] beganAt: startPoint]; } // --- Setup up the masks for the drag operation --------------------- if ([dragSource respondsToSelector: @selector(ignoreModifierKeysWhileDragging)] && [dragSource ignoreModifierKeysWhileDragging]) { operationMask = NSDragOperationIgnoresModifiers; } else { operationMask = 0; [self _updateOperationMask: theEvent]; } if ([dragSource respondsToSelector: @selector(draggingSourceOperationMaskForLocal:)]) { dragMask = [dragSource draggingSourceOperationMaskForLocal: !destExternal]; } else { dragMask = NSDragOperationCopy | NSDragOperationLink | NSDragOperationGeneric | NSDragOperationPrivate; } // --- Setup the event loop ------------------------------------------ [self _updateAndMoveImageToCorrectPosition]; [NSEvent startPeriodicEventsAfterDelay: 0.02 withPeriod: 0.03]; // --- Loop that handles all events during drag operation ----------- while ([theEvent type] != NSLeftMouseUp) { [self _handleEventDuringDragging: theEvent]; theEvent = [NSApp nextEventMatchingMask: eventMask untilDate: theDistantFuture inMode: NSEventTrackingRunLoopMode dequeue: YES]; } // --- Event loop for drag operation stopped ------------------------ [NSEvent stopPeriodicEvents]; [self _updateAndMoveImageToCorrectPosition]; NSDebugLLog(@"NSDragging", @"dnd ending %d\n", targetWindowRef); // --- Deposit the drop ---------------------------------------------- if ((targetWindowRef != 0) && ((targetMask & dragMask & operationMask) != NSDragOperationNone)) { /* FIXME: * We remove the dragged image from the screen before * sending the dnd drop event to the destination. * This code should actually be rewritten, because * the depositing of the drop consist of three steps * - prepareForDragOperation * - performDragOperation * - concludeDragOperation. * The dragged image should be removed from the screen * between the prepare and the perform operation. * The three steps are now executed in the NSWindow class * and the NSWindow class does not have access to * the image. */ [self _clearupWindow]; [cursorBeforeDrag set]; NSDebugLLog(@"NSDragging", @"sending dnd drop\n"); if (!destExternal) { [self _sendLocalEvent: GSAppKitDraggingDrop action: 0 position: dragPosition timestamp: [theEvent timestamp] toWindow: destWindow]; } else { [self sendExternalEvent: GSAppKitDraggingDrop action: 0 position: dragPosition timestamp: [theEvent timestamp] toWindow: targetWindowRef]; } deposited = YES; } else { if (slideBack) { [self slideDraggedImageTo: slidePoint]; } [self _clearupWindow]; [cursorBeforeDrag set]; deposited = NO; } if ([dragSource respondsToSelector: @selector(draggedImage:endedAt:operation:)]) { NSPoint point; point = [theEvent locationInWindow]; // Convert from mouse cursor coordinate to image coordinate point.x -= offset.width; point.y -= offset.height; point = [[theEvent window] convertBaseToScreen: point]; [dragSource draggedImage: [self draggedImage] endedAt: point operation: targetMask & dragMask & operationMask]; } else if ([dragSource respondsToSelector: @selector(draggedImage:endedAt:deposited:)]) { NSPoint point; point = [theEvent locationInWindow]; // Convert from mouse cursor coordinate to image coordinate point.x -= offset.width; point.y -= offset.height; point = [[theEvent window] convertBaseToScreen: point]; [dragSource draggedImage: [self draggedImage] endedAt: point deposited: deposited]; } } /* * Handle the events for the event loop during drag and drop */ - (void) _handleEventDuringDragging: (NSEvent *)theEvent { switch ([theEvent type]) { case NSAppKitDefined: { GSAppKitSubtype sub = [theEvent subtype]; switch (sub) { case GSAppKitWindowMoved: case GSAppKitWindowResized: case GSAppKitRegionExposed: /* * Keep window up-to-date with its current position. */ [NSApp sendEvent: theEvent]; break; case GSAppKitDraggingStatus: NSDebugLLog(@"NSDragging", @"got GSAppKitDraggingStatus\n"); if ((int)[theEvent data1] == targetWindowRef) { NSDragOperation newTargetMask = (NSDragOperation)[theEvent data2]; if (newTargetMask != targetMask) { targetMask = newTargetMask; [self _setCursor]; } } break; case GSAppKitDraggingFinished: NSLog(@"Internal: got GSAppKitDraggingFinished out of seq"); break; case GSAppKitWindowFocusIn: case GSAppKitWindowFocusOut: case GSAppKitWindowLeave: case GSAppKitWindowEnter: break; default: NSDebugLLog(@"NSDragging", @"dropped NSAppKitDefined (%d) event", sub); break; } } break; case NSMouseMoved: case NSLeftMouseDragged: case NSLeftMouseDown: case NSLeftMouseUp: newPosition = [[theEvent window] convertBaseToScreen: [theEvent locationInWindow]]; break; case NSFlagsChanged: if ([self _updateOperationMask: theEvent]) { // If flags change, send update to allow // destination to take note. if (destWindow) { [self _sendLocalEvent: GSAppKitDraggingUpdate action: dragMask & operationMask position: newPosition timestamp: [theEvent timestamp] toWindow: destWindow]; } else { [self sendExternalEvent: GSAppKitDraggingUpdate action: dragMask & operationMask position: newPosition timestamp: [theEvent timestamp] toWindow: targetWindowRef]; } [self _setCursor]; } break; case NSPeriodic: newPosition = [NSEvent mouseLocation]; if (newPosition.x != dragPosition.x || newPosition.y != dragPosition.y) { [self _updateAndMoveImageToCorrectPosition]; } else if (destWindow) { [self _sendLocalEvent: GSAppKitDraggingUpdate action: dragMask & operationMask position: newPosition timestamp: [theEvent timestamp] toWindow: destWindow]; } else { [self sendExternalEvent: GSAppKitDraggingUpdate action: dragMask & operationMask position: newPosition timestamp: [theEvent timestamp] toWindow: targetWindowRef]; } break; default: NSLog(@"Internal: dropped event (%d) during dragging", (int)[theEvent type]); } } /* * This method will move the drag image and update all associated data */ - (void) _updateAndMoveImageToCorrectPosition { //--- Store old values ----------------------------------------------------- NSWindow *oldDestWindow = destWindow; BOOL oldDestExternal = destExternal; int mouseWindowRef; BOOL changeCursor = NO; //--- Move drag image to the new position ----------------------------------- [self _moveDraggedImageToNewPosition]; if ([dragSource respondsToSelector: @selector(draggedImage:movedTo:)]) { [dragSource draggedImage: [self draggedImage] movedTo: dragPosition]; } //--- Determine target window --------------------------------------------- destWindow = [self windowAcceptingDnDunder: dragPosition windowRef: &mouseWindowRef]; // If we are not hovering above a window that we own // we are dragging to an external application. destExternal = (mouseWindowRef != 0) && (destWindow == nil); if (destWindow != nil) { dragPoint = [destWindow convertScreenToBase: dragPosition]; } NSDebugLLog(@"NSDragging", @"mouse window %d (%@) at %@\n", mouseWindowRef, destWindow, NSStringFromPoint(dragPosition)); //--- send exit message if necessary ------------------------------------- if ((mouseWindowRef != targetWindowRef) && targetWindowRef) { /* If we change windows and the old window is dnd aware, we send an dnd exit */ NSDebugLLog(@"NSDragging", @"sending dnd exit\n"); if (oldDestWindow != nil) { [self _sendLocalEvent: GSAppKitDraggingExit action: dragMask & operationMask position: NSZeroPoint timestamp: dragSequence toWindow: oldDestWindow]; } else { [self sendExternalEvent: GSAppKitDraggingExit action: dragMask & operationMask position: NSZeroPoint timestamp: dragSequence toWindow: targetWindowRef]; } } // Reset drag mask when we switch from external to internal or back if (oldDestExternal != destExternal) { NSDragOperation newMask; if ([dragSource respondsToSelector: @selector(draggingSourceOperationMaskForLocal:)]) { newMask = [dragSource draggingSourceOperationMaskForLocal: !destExternal]; } else { newMask = NSDragOperationCopy | NSDragOperationLink | NSDragOperationGeneric | NSDragOperationPrivate; } if (newMask != dragMask) { dragMask = newMask; changeCursor = YES; } } if (mouseWindowRef == targetWindowRef && targetWindowRef) { // same window, sending update NSDebugLLog(@"NSDragging", @"sending dnd pos\n"); // FIXME: We should only send this when the destination wantsPeriodicDraggingUpdates if (destWindow != nil) { [self _sendLocalEvent: GSAppKitDraggingUpdate action: dragMask & operationMask position: dragPosition timestamp: dragSequence toWindow: destWindow]; } else { [self sendExternalEvent: GSAppKitDraggingUpdate action: dragMask & operationMask position: dragPosition timestamp: dragSequence toWindow: targetWindowRef]; } } else if (mouseWindowRef != 0) { // FIXME: We might force the cursor update here, if the // target wants to change the cursor. NSDebugLLog(@"NSDragging", @"sending dnd enter/pos\n"); if (destWindow != nil) { [self _sendLocalEvent: GSAppKitDraggingEnter action: dragMask position: dragPosition timestamp: dragSequence toWindow: destWindow]; } else { [self sendExternalEvent: GSAppKitDraggingEnter action: dragMask position: dragPosition timestamp: dragSequence toWindow: mouseWindowRef]; } } if (targetWindowRef != mouseWindowRef) { targetWindowRef = mouseWindowRef; changeCursor = YES; } if (changeCursor) { [self _setCursor]; } } /* * Move the dragged image immediately to the position indicated by * the instance variable newPosition. * * In doing so it will update the dragPosition instance variables. */ - (void) _moveDraggedImageToNewPosition { dragPosition = newPosition; [GSServerForWindow(_window) movewindow: NSMakePoint(newPosition.x - offset.width, newPosition.y - offset.height) : [_window windowNumber]]; } /* * NB. screenPoint here is the position of the mouse cursor. */ - (void) _slideDraggedImageTo: (NSPoint)screenPoint numberOfSteps: (int)steps delay: (float)delay waitAfterSlide: (BOOL)waitFlag { /* If we do not need multiple redrawing, just move the image immediately * to its desired spot. */ if (steps < 2) { newPosition = screenPoint; [self _moveDraggedImageToNewPosition]; } else { [NSEvent startPeriodicEventsAfterDelay: delay withPeriod: delay]; // Use the event loop to redraw the image repeatedly. // Using the event loop to allow the application to process // expose events. while (steps) { NSEvent *theEvent = [NSApp nextEventMatchingMask: NSPeriodicMask untilDate: [NSDate distantFuture] inMode: NSEventTrackingRunLoopMode dequeue: YES]; if ([theEvent type] != NSPeriodic) { NSDebugLLog (@"NSDragging", @"Unexpected event type: %d during slide", (int)[theEvent type]); } newPosition.x = (screenPoint.x + ((float) steps - 1.0) * dragPosition.x) / ((float) steps); newPosition.y = (screenPoint.y + ((float) steps - 1.0) * dragPosition.y) / ((float) steps); [self _moveDraggedImageToNewPosition]; steps--; } [NSEvent stopPeriodicEvents]; } if (waitFlag) { [NSThread sleepUntilDate: [NSDate dateWithTimeIntervalSinceNow: delay * 2.0]]; } } @end gnustep-gui-0.24.0/Source/NSBitmapImageRep+ICNS.m0000664000076500007650000004376611574355114021225 0ustar brains99brains99/* NSBitmapImageRep+ICNS.m Methods for loading .icns images. Copyright (C) 2008 Free Software Foundation, Inc. Written by: Gregory Casamento Date: 2008-08-12 Author: Fred Kiefer Date: September 2008 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import "NSBitmapImageRep+ICNS.h" #import #import #import #import #import "AppKit/NSGraphics.h" #import "GSGuiPrivate.h" #define ICNS_HEADER "icns" #if HAVE_LIBICNS #include #else /* !HAVE_LIBICNS */ /* The following code is a drop in replacement for libicns. It may be used when the library is not available. This code was mostly build based on the documentation found at http://icns.sourceforge.net/apidocs.html. It also includes icns decoding ideas based on code in mySTEP. Only limited formats are implemented and some errors still exist. */ typedef unsigned char icns_byte_t; // must be a 32 bit integer typedef unsigned int icns_size_t; typedef struct _icns_type_t { char c[4]; } icns_type_t; typedef struct _icns_element_t { icns_type_t elementType; icns_size_t elementSize; } icns_element_t; typedef struct _icns_icon_info_t { unsigned int iconHeight; unsigned int iconWidth; unsigned int iconDepth; unsigned int iconChannels; } icns_icon_info_t; typedef struct _icns_image_t { unsigned int imageWidth; unsigned int imageHeight; unsigned int imageChannels; unsigned int imagePixelDepth; unsigned int imageDataSize; icns_byte_t *imageData; } icns_image_t; typedef struct _icns_family_t { icns_type_t resourceType; icns_size_t resourceSize; icns_element_t elements[1]; } icns_family_t; #define ICNS_HEADER_SIZE 8 /* // ics# 0x69637323 static icns_type_t ICNS_16x16_1BIT_DATA = {{'i', 'c', 's', '#'}}; // ich# 0x69636823 static icns_type_t ICNS_48x48_1BIT_DATA = {{'i', 'c', 'h', '#'}}; */ // is32 0x69733332 static icns_type_t ICNS_16x16_32BIT_DATA = {{'i', 's', '3', '2'}}; // il32 0x696c3332 static icns_type_t ICNS_32x32_32BIT_DATA = {{'i', 'l', '3', '2'}}; // ih32 0x69683332 static icns_type_t ICNS_48x48_32BIT_DATA = {{'i', 'h', '3', '2'}}; // it32 0x69743332 static icns_type_t ICNS_128X128_32BIT_DATA = {{'i', 't', '3', '2'}}; // s8mk 0x73386d6b static icns_type_t ICNS_16x16_8BIT_MASK = {{'s', '8', 'm', 'k'}}; // l8mk 0x6c386d6b static icns_type_t ICNS_32x32_8BIT_MASK = {{'l', '8', 'm', 'k'}}; // h8mk 0x68386d6b static icns_type_t ICNS_48x48_8BIT_MASK = {{'h', '8', 'm', 'k'}}; // t8mk 0x74386d6b static icns_type_t ICNS_128X128_8BIT_MASK = {{'t', '8', 'm', 'k'}}; static icns_type_t ICNS_FAMILY_TYPE = {{'i','c','n','s'}}; static icns_type_t ICNS_NULL_TYPE = {{0 , 0 , 0 , 0 }}; #define ICNS_STATUS_OK 0 static int icns_types_equal(icns_type_t type1, icns_type_t type2) { return (strncmp((char*)&type1.c, (char*)&type2.c, 4) == 0); } static icns_type_t icns_get_mask_type_for_icon_type(icns_type_t type) { if (icns_types_equal(type, ICNS_16x16_32BIT_DATA)) { return ICNS_16x16_8BIT_MASK; } else if (icns_types_equal(type, ICNS_32x32_32BIT_DATA)) { return ICNS_32x32_8BIT_MASK; } else if (icns_types_equal(type, ICNS_48x48_32BIT_DATA)) { return ICNS_48x48_8BIT_MASK; } else if (icns_types_equal(type, ICNS_128X128_32BIT_DATA)) { return ICNS_128X128_8BIT_MASK; } else { return ICNS_NULL_TYPE; } } static icns_icon_info_t icns_get_image_info_for_type(icns_type_t type) { icns_icon_info_t info; if (icns_types_equal(type, ICNS_16x16_32BIT_DATA)) { info.iconHeight = 16; info.iconWidth = 16; info.iconDepth = 8; info.iconChannels = 4; } else if (icns_types_equal(type, ICNS_32x32_32BIT_DATA)) { info.iconHeight = 32; info.iconWidth = 32; info.iconDepth = 8; info.iconChannels = 4; } else if (icns_types_equal(type, ICNS_48x48_32BIT_DATA)) { info.iconHeight = 48; info.iconWidth = 48; info.iconDepth = 8; info.iconChannels = 4; } else if (icns_types_equal(type, ICNS_128X128_32BIT_DATA)) { info.iconHeight = 128; info.iconWidth = 128; info.iconDepth = 8; info.iconChannels = 4; } else { info.iconHeight = 0; info.iconWidth = 0; info.iconDepth = 0; info.iconChannels = 0; } return info; } static int icns_get_element_from_family(icns_family_t *iconFamily, icns_type_t iconType, icns_element_t **iconElement) { icns_byte_t *bytes = (icns_byte_t *)iconFamily->elements; unsigned long size = iconFamily->resourceSize; icns_element_t *element; icns_byte_t *data; data = bytes; element = (icns_element_t *)data; while ((bytes + size > data) && element->elementSize) { if (icns_types_equal(element->elementType, iconType)) { *iconElement = element; return ICNS_STATUS_OK; } data += element->elementSize; element = (icns_element_t *)data; } return 1; } static int icns_import_family_data(int size, icns_byte_t *bytes, icns_family_t **iconFamily) { icns_element_t *element = NULL; icns_family_t *family; unsigned long el_size; icns_byte_t *data; icns_byte_t *end; data = bytes; family = (icns_family_t *)data; while ((bytes + size > data) && family->resourceSize) { if (icns_types_equal(family->resourceType, ICNS_FAMILY_TYPE)) { element = (icns_element_t *)family; break; } el_size = NSSwapBigIntToHost(family->resourceSize); data += el_size; family = (icns_family_t *)data; } if (element == NULL) { return 1; } el_size = NSSwapBigIntToHost(element->elementSize); family = malloc(el_size); if (!family) { return 1; } strncpy((char*)&family->resourceType.c, (char*)&element->elementType.c, 4); family->resourceSize = el_size; memcpy((char*)(family->elements), (char*)element + ICNS_HEADER_SIZE, el_size - ICNS_HEADER_SIZE); data = (icns_byte_t *)family->elements; end = data + el_size - ICNS_HEADER_SIZE; element = family->elements; while ((data < end) && element->elementSize) { el_size = NSSwapBigIntToHost(element->elementSize); element->elementSize = el_size; data += el_size; element = (icns_element_t *)data; } *iconFamily = family; return ICNS_STATUS_OK; } static int icns_init_image(unsigned int iconWidth, unsigned int iconHeight, unsigned int iconChannels, unsigned int iconPixelDepth, icns_image_t *imageOut) { imageOut->imageWidth = iconWidth; imageOut->imageHeight = iconHeight; imageOut->imageChannels = iconChannels; imageOut->imagePixelDepth = iconPixelDepth; imageOut->imageDataSize = (iconHeight * iconWidth * iconPixelDepth * iconChannels) / 8; imageOut->imageData = malloc(imageOut->imageDataSize); if (!imageOut->imageData) return 1; else return ICNS_STATUS_OK; } static int icns_init_image_for_type(icns_type_t iconType, icns_image_t *imageOut) { icns_icon_info_t info; info = icns_get_image_info_for_type(iconType); if (info.iconChannels == 0) { return 1; } return icns_init_image(info.iconWidth, info.iconHeight, info.iconChannels, info.iconDepth, imageOut); } static int icns_free_image(icns_image_t *imageIn) { free(imageIn->imageData); imageIn->imageData = NULL; return ICNS_STATUS_OK; } static int icns_get_image32_with_mask_from_family(icns_family_t *iconFamily, icns_type_t type, icns_image_t *iconImage) { icns_element_t *element; unsigned int samplesPerPixel = 4; icns_byte_t *b; icns_byte_t *end; int j; int res; icns_type_t mask_type; unsigned int imageDataSize; if (icns_types_equal(type, ICNS_NULL_TYPE)) return 1; res = icns_get_element_from_family(iconFamily, type, &element); if (res != ICNS_STATUS_OK) return res; res = icns_init_image_for_type(type, iconImage); if (res != ICNS_STATUS_OK) return res; b = (icns_byte_t *)element + ICNS_HEADER_SIZE; end = b + element->elementSize - ICNS_HEADER_SIZE; // Safety check if (end > (icns_byte_t *)iconFamily->elements + iconFamily->resourceSize) { icns_free_image(iconImage); return 1; } imageDataSize = iconImage->imageDataSize; if ((element->elementSize - ICNS_HEADER_SIZE) < 3 * iconImage->imageHeight * iconImage->imageWidth) { unsigned int plane; // Run length encoded planar data for (plane = 0; plane < 3; plane++) { unsigned int offset; offset = 0; while ((offset < iconImage->imageHeight * iconImage->imageWidth) && (b < end)) { icns_byte_t bv = *b++; int runLen; unsigned int index = samplesPerPixel * offset + plane; if (bv & 0x80) { // Compressed run icns_byte_t val = *b++; runLen = bv - 125; for (j = 0; (j < runLen) && (index < imageDataSize); j++) { iconImage->imageData[index] = val; index += samplesPerPixel; } } else { // Uncompressed run int j; runLen = bv + 1; for (j = 0; (j < runLen) && (index < imageDataSize); j++) { iconImage->imageData[index] = *b++; index += samplesPerPixel; } } offset += runLen; } } } else { for (j = 0; j < iconImage->imageHeight * iconImage->imageWidth; j++) { iconImage->imageData[samplesPerPixel * j + 0] = *b++; iconImage->imageData[samplesPerPixel * j + 1] = *b++; iconImage->imageData[samplesPerPixel * j + 2] = *b++; } } // Fill in the mask mask_type = icns_get_mask_type_for_icon_type(type); res = icns_get_element_from_family(iconFamily, mask_type, &element); if (res == ICNS_STATUS_OK) { b = (icns_byte_t *)element + ICNS_HEADER_SIZE; end = b + element->elementSize - ICNS_HEADER_SIZE; // Safety check if (end > (icns_byte_t *)iconFamily->elements + iconFamily->resourceSize) { icns_free_image(iconImage); return 1; } for (j = 0; j < iconImage->imageHeight * iconImage->imageWidth; j++) { iconImage->imageData[samplesPerPixel * j + 3] = *b++; } } else { for (j = 0; j < iconImage->imageHeight * iconImage->imageWidth; j++) { iconImage->imageData[samplesPerPixel * j + 3] = 255; } } return ICNS_STATUS_OK; } #endif /* !HAVE_LIBICNS */ // Define the pixel typedef struct pixel_t { uint8_t r; uint8_t g; uint8_t b; uint8_t a; } pixel_t; @implementation NSBitmapImageRep (ICNS) + (BOOL) _bitmapIsICNS: (NSData *)imageData { char header[5]; /* * If the data is 0, return immediately. */ if ([imageData length] < 8) { return NO; } /* * Check the beginning of the data for * the string "icns". */ [imageData getBytes: header length: 4]; if(strncmp(header, ICNS_HEADER, 4) == 0) { return YES; } return NO; } - (id) _initBitmapFromICNSImage: (icns_image_t*)iconImage { unsigned int iconWidth = 0, iconHeight = 0; unsigned int rgbBufferPos = 0; unsigned int rgbBufferSize = 0; unsigned char *rgbBuffer = NULL; /* image converted to rgb */ int i = 0, j = 0; int imageChannels = 0; int sPP = 4; iconWidth = iconImage->imageWidth; iconHeight = iconImage->imageHeight; // allocate the buffer... rgbBufferSize = iconHeight * (iconWidth * sizeof(unsigned char) * sPP); rgbBuffer = NSZoneMalloc([self zone], rgbBufferSize); if (rgbBuffer == NULL) { NSLog(@"Couldn't allocate memory for image data from ICNS."); RELEASE(self); return nil; } imageChannels = iconImage->imageChannels; rgbBufferPos = 0; for (i = 0; i < iconHeight; i++) { for (j = 0; j < iconWidth; j++) { pixel_t *src_rgb_pixel; src_rgb_pixel = (pixel_t *)&(iconImage->imageData[i*iconWidth*imageChannels+j*imageChannels]); rgbBuffer[rgbBufferPos++] = src_rgb_pixel->r; rgbBuffer[rgbBufferPos++] = src_rgb_pixel->g; rgbBuffer[rgbBufferPos++] = src_rgb_pixel->b; rgbBuffer[rgbBufferPos++] = src_rgb_pixel->a; } } /* initialize self */ [self initWithBitmapDataPlanes: &rgbBuffer pixelsWide: iconWidth pixelsHigh: iconHeight bitsPerSample: 8 samplesPerPixel: sPP hasAlpha: YES isPlanar: NO colorSpaceName: NSCalibratedRGBColorSpace // FIXME: Not sure whether this format is pre-multiplied bitmapFormat: NSAlphaNonpremultipliedBitmapFormat bytesPerRow: iconWidth * sPP bitsPerPixel: 8 * sPP]; _imageData = [[NSData alloc] initWithBytesNoCopy: rgbBuffer length: rgbBufferSize]; return self; } - (id) _initBitmapFromICNS: (NSData *)imageData { int error = 0; int size = [imageData length]; icns_byte_t *bytes = (icns_byte_t *)[imageData bytes]; icns_family_t *iconFamily = NULL; unsigned long dataOffset = 0; icns_byte_t *data = NULL; icns_type_t typeStr = ICNS_NULL_TYPE; icns_image_t iconImage; error = icns_import_family_data(size, bytes, &iconFamily); if (error != ICNS_STATUS_OK) { NSLog(@"Error reading ICNS data."); RELEASE(self); return nil; } // skip the header... dataOffset = sizeof(icns_type_t) + sizeof(icns_size_t); data = (icns_byte_t *)iconFamily; // read each icon... while (((dataOffset + 8) < iconFamily->resourceSize)) { icns_element_t element; memcpy(&element, (data + dataOffset), 8); // Temporarily limit to 48 until we can find a way to // utilize the other representations in the icns file. if (icns_types_equal(element.elementType, ICNS_48x48_32BIT_DATA) || (icns_types_equal(typeStr, ICNS_NULL_TYPE) && (icns_types_equal(element.elementType, ICNS_32x32_32BIT_DATA) || icns_types_equal(element.elementType, ICNS_128X128_32BIT_DATA)))) { memcpy(&typeStr, &(element.elementType), 4); } // next... dataOffset += element.elementSize; } // extract the image... memset(&iconImage, 0, sizeof(icns_image_t)); error = icns_get_image32_with_mask_from_family(iconFamily, typeStr, &iconImage); if (error) { NSLog(@"Error while extracting image from ICNS data."); RELEASE(self); free(iconFamily); return nil; } self = [self _initBitmapFromICNSImage: &iconImage]; icns_free_image(&iconImage); free(iconFamily); return self; } + (NSArray*) _imageRepsWithICNSData: (NSData *)imageData { NSMutableArray *array = [NSMutableArray array]; int error = 0; int size = [imageData length]; icns_byte_t *bytes = (icns_byte_t *)[imageData bytes]; icns_family_t *iconFamily = NULL; unsigned long dataOffset = 0; icns_byte_t *data = NULL; error = icns_import_family_data(size, bytes, &iconFamily); if (error != ICNS_STATUS_OK) { NSLog(@"Error reading ICNS data."); RELEASE(self); return array; } // skip the header... dataOffset = sizeof(icns_type_t) + sizeof(icns_size_t); data = (icns_byte_t *)iconFamily; // read each icon... while (((dataOffset + 8) < iconFamily->resourceSize)) { icns_element_t element; icns_type_t typeStr = ICNS_NULL_TYPE; icns_image_t iconImage; memcpy(&element, (data + dataOffset), 8); memcpy(&typeStr, &(element.elementType), 4); // extract the image... memset(&iconImage, 0, sizeof(icns_image_t)); error = icns_get_image32_with_mask_from_family(iconFamily, typeStr, &iconImage); //NSLog(@"Read image %c %c %c %c result %d size %d", typeStr.c[0], typeStr.c[1], typeStr.c[2], typeStr.c[3], error, element.elementSize); if (!error) { NSBitmapImageRep* imageRep; imageRep = [[self alloc] _initBitmapFromICNSImage: &iconImage]; if (imageRep) { [array addObject: imageRep]; RELEASE(imageRep); } icns_free_image(&iconImage); } // next... dataOffset += element.elementSize; } free(iconFamily); return array; } @end gnustep-gui-0.24.0/Source/GSKeyBindingAction.m0000664000076500007650000000475411532730071021004 0ustar brains99brains99/* GSKeyBindingAction.m -*-objc-*- Copyright (C) 2002 Free Software Foundation, Inc. Author: Nicola Pero Date: February 2002 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "AppKit/NSInputManager.h" #import "GSKeyBindingAction.h" @implementation GSKeyBindingAction - (void) performActionWithInputManager: (NSInputManager *)manager { [self subclassResponsibility: _cmd]; } @end @implementation GSKeyBindingActionSelector - (id) initWithSelectorName: (NSString *)sel { _selector = NSSelectorFromString (sel); if (_selector == NULL) { DESTROY (self); return nil; } return [super init]; } - (void) performActionWithInputManager: (NSInputManager *)manager { [manager doCommandBySelector: _selector]; } @end @implementation GSKeyBindingActionSelectorArray - (id) initWithSelectorNames: (NSArray *)sels { int i; _selectorsCount = [sels count]; _selectors = malloc (sizeof (SEL) * _selectorsCount); for (i = 0; i < _selectorsCount; i++) { NSString *name = [sels objectAtIndex: i]; _selectors[i] = NSSelectorFromString (name); if (_selectors[i] == NULL) { /* DESTROY (self) will dealloc the selectors array. */ DESTROY (self); return nil; } } return [super init]; } - (void) dealloc { free (_selectors); [super dealloc]; } - (void) performActionWithInputManager: (NSInputManager *)manager { int i; for (i = 0; i < _selectorsCount; i++) { [manager doCommandBySelector: _selectors[i]]; } } @end @implementation GSKeyBindingActionQuoteNextKeyStroke - (void) performActionWithInputManager: (NSInputManager *)manager { [manager quoteNextKeyStroke]; } @end gnustep-gui-0.24.0/Source/NSController.m0000664000076500007650000000642611534147002017751 0ustar brains99brains99/** NSController abstract base class for controllers Copyright (C) 2006 Free Software Foundation, Inc. Author: Fred Kiefer Date: June 2006 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import "AppKit/NSController.h" @implementation NSController - (id) init { if((self = [super init]) != nil) { _editors = [[NSMutableArray alloc] init]; _declared_keys = [[NSMutableArray alloc] init]; } return self; } - (void) dealloc { RELEASE(_editors); RELEASE(_declared_keys); [super dealloc]; } - (void) encodeWithCoder: (NSCoder *)aCoder { if([aCoder allowsKeyedCoding]) { [aCoder encodeObject: _declared_keys forKey: @"NSDeclaredKeys"]; } else { [aCoder encodeObject: _declared_keys]; } } - (id) initWithCoder: (NSCoder *)aDecoder { if((self = [super init]) != nil) { if([aDecoder allowsKeyedCoding]) { ASSIGN(_declared_keys,[aDecoder decodeObjectForKey: @"NSDeclaredKeys"]); } else { ASSIGN(_declared_keys,[aDecoder decodeObject]); } } return self; } - (BOOL) isEditing { return [_editors count] > 0; } - (BOOL) commitEditing { unsigned c = [_editors count]; unsigned i; for (i = 0; i < c; i++) { if (![[_editors objectAtIndex: i] commitEditing]) { return NO; } } return YES; } - (void) commitEditingWithDelegate: (id)delegate didCommitSelector: (SEL)didCommitSelector contextInfo: (void*)contextInfo { unsigned c = [_editors count]; unsigned i; for (i = 0; i < c; i++) { BOOL didCommit = [[_editors objectAtIndex: i] commitEditing]; if (delegate != nil && didCommitSelector != NULL) { void (*meth)(id, SEL, id, BOOL, void*); meth = (void (*)(id, SEL, id, BOOL, void*))[delegate methodForSelector: didCommitSelector]; if (meth) meth(delegate, didCommitSelector, self, didCommit, contextInfo); } } } - (void) discardEditing { [_editors makeObjectsPerformSelector: @selector(discardEditing)]; } - (void) objectDidBeginEditing: (id)editor { [_editors addObject: editor]; } - (void) objectDidEndEditing: (id)editor { [_editors removeObject: editor]; } @end gnustep-gui-0.24.0/Source/NSEPSImageRep.m0000664000076500007650000000621712121417516017670 0ustar brains99brains99/** NSEPSImageRep EPS image representation. Copyright (C) 1996 Free Software Foundation, Inc. Author: Adam Fedor Date: Feb 1996 This file is part of the GNUstep Application Kit Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import "AppKit/NSPasteboard.h" #import "AppKit/NSEPSImageRep.h" @implementation NSEPSImageRep + (BOOL) canInitWithData: (NSData *)data { char buffer[2]; [data getBytes: buffer length: 2]; // Simple check for Postscript if (buffer[0] == '%' && buffer[1] == '!') return YES; else return NO; } + (NSArray *) imageUnfilteredFileTypes { static NSArray *types = nil; if (types == nil) { types = [[NSArray alloc] initWithObjects: @"eps", nil]; } return types; } + (NSArray *) imageUnfilteredPasteboardTypes { static NSArray *types = nil; if (types == nil) { types = [[NSArray alloc] initWithObjects: NSPostScriptPboardType, nil]; } return types; } // Initializing a New Instance + (id) imageRepWithData: (NSData *)epsData { return AUTORELEASE([[self alloc] initWithData: epsData]); } - (id) initWithData: (NSData *)epsData { [self notImplemented: _cmd]; _epsData = epsData; // Set bounds from parsed header //_bounds = NSMakeRect(); return self; } // Getting Image Data - (NSRect) boundingBox { return _bounds; } - (NSData *) EPSRepresentation { return _epsData; } - (void) prepareGState { // This is for subclasses only } // Drawing the Image - (BOOL) draw { [self notImplemented: _cmd]; [self prepareGState]; return YES; } // NSCopying protocol - (id) copyWithZone: (NSZone *)zone { NSEPSImageRep *copy = [super copyWithZone: zone]; copy->_epsData = [_epsData copyWithZone: zone]; return copy; } // NSCoding protocol - (void) encodeWithCoder: (NSCoder*)aCoder { NSData *data = [self EPSRepresentation]; [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { // FIXME } else { [data encodeWithCoder: aCoder]; } } - (id) initWithCoder: (NSCoder*)aDecoder { NSData *data = nil; self = [super initWithCoder: aDecoder]; if ([aDecoder allowsKeyedCoding]) { // FIXME } else { data = [aDecoder decodeObject]; } return [self initWithData: data]; } @end gnustep-gui-0.24.0/Source/GSHorizontalTypesetter.m0000664000076500007650000010233512233270541022037 0ustar brains99brains99/* GSHorizontalTypesetter.m Copyright (C) 2002, 2003 Free Software Foundation, Inc. Author: Alexander Malmberg Date: November 2002 - February 2003 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #import #import #import #import #import #import #import "AppKit/NSAttributedString.h" #import "AppKit/NSParagraphStyle.h" #import "AppKit/NSTextAttachment.h" #import "AppKit/NSTextContainer.h" #import "AppKit/NSTextStorage.h" #import "GNUstepGUI/GSLayoutManager.h" #import "GNUstepGUI/GSHorizontalTypesetter.h" /* Note that unless the user creates extra instances, there will only be one instance of GSHorizontalTypesetter for all text typesetting, so we can cache fairly aggressively without having to worry about memory consumption. */ @implementation GSHorizontalTypesetter - init { if (!(self = [super init])) return nil; lock = [[NSLock alloc] init]; return self; } -(void) dealloc { if (cache) { free(cache); cache = NULL; } if (line_frags) { free(line_frags); line_frags = NULL; } DESTROY(lock); [super dealloc]; } +(GSHorizontalTypesetter *) sharedInstance { NSMutableDictionary *threadDict = [[NSThread currentThread] threadDictionary]; GSHorizontalTypesetter *shared = [threadDict objectForKey: @"sharedHorizontalTypesetter"]; if (!shared) { shared = [[self alloc] init]; [threadDict setObject: shared forKey: @"sharedHorizontalTypesetter"]; RELEASE(shared); } return shared; } #define CACHE_INITIAL 192 #define CACHE_STEP 192 struct GSHorizontalTypesetter_glyph_cache_s { /* These fields are filled in by the caching: */ NSGlyph g; unsigned int char_index; NSFont *font; struct { BOOL explicit_kern; float kern; float baseline_offset; int superscript; } attributes; /* These fields are filled in during layout: */ BOOL nominal; NSPoint pos; /* relative to the line's baseline */ NSSize size; /* height is used only for attachments */ BOOL dont_show, outside_line_frag; }; typedef struct GSHorizontalTypesetter_glyph_cache_s glyph_cache_t; /* TODO: if we could know whether the layout manager had been modified since the last time or not, we wouldn't need to clear the cache every time */ -(void) _cacheClear { cache_length = 0; } -(void) _cacheAttributes { NSNumber *n; n = [curAttributes objectForKey: NSKernAttributeName]; if (!n) attributes.explicit_kern = NO; else { attributes.explicit_kern = YES; attributes.kern = [n floatValue]; } n = [curAttributes objectForKey: NSBaselineOffsetAttributeName]; if (n) attributes.baseline_offset = [n floatValue]; else attributes.baseline_offset = 0.0; n = [curAttributes objectForKey: NSSuperscriptAttributeName]; if (n) attributes.superscript = [n intValue]; else attributes.superscript = 0; } -(void) _cacheMoveTo: (unsigned int)glyph { BOOL valid; if (cache_base <= glyph && cache_base + cache_length > glyph) { int delta = glyph - cache_base; cache_length -= delta; memmove(cache, &cache[delta], sizeof(glyph_cache_t) * cache_length); cache_base = glyph; return; } cache_base = glyph; cache_length = 0; [curLayoutManager glyphAtIndex: glyph isValidIndex: &valid]; if (valid) { unsigned int i; at_end = NO; i = [curLayoutManager characterIndexForGlyphAtIndex: glyph]; curAttributes = [curTextStorage attributesAtIndex: i effectiveRange: &attributeRange]; [self _cacheAttributes]; paragraphRange = NSMakeRange(i, [curTextStorage length] - i); curParagraphStyle = [curTextStorage attribute: NSParagraphStyleAttributeName atIndex: i longestEffectiveRange: ¶graphRange inRange: paragraphRange]; if (curParagraphStyle == nil) { curParagraphStyle = [NSParagraphStyle defaultParagraphStyle]; } curFont = [curLayoutManager effectiveFontForGlyphAtIndex: glyph range: &fontRange]; } else at_end = YES; } -(void) _cacheGlyphs: (unsigned int)new_length { glyph_cache_t *g; BOOL valid; if (cache_size < new_length) { cache_size = new_length; cache = realloc(cache, sizeof(glyph_cache_t) * cache_size); } for (g = &cache[cache_length]; cache_length < new_length; cache_length++, g++) { g->g = [curLayoutManager glyphAtIndex: cache_base + cache_length isValidIndex: &valid]; if (!valid) { at_end = YES; break; } g->char_index = [curLayoutManager characterIndexForGlyphAtIndex: cache_base + cache_length]; if (g->char_index >= paragraphRange.location + paragraphRange.length) { at_end = YES; break; } /* cache attributes */ if (g->char_index >= attributeRange.location + attributeRange.length) { curAttributes = [curTextStorage attributesAtIndex: g->char_index effectiveRange: &attributeRange]; [self _cacheAttributes]; } g->attributes.explicit_kern = attributes.explicit_kern; g->attributes.kern = attributes.kern; g->attributes.baseline_offset = attributes.baseline_offset; g->attributes.superscript = attributes.superscript; if (cache_base + cache_length >= fontRange.location + fontRange.length) { curFont = [curLayoutManager effectiveFontForGlyphAtIndex: cache_base + cache_length range: &fontRange]; } g->font = curFont; g->dont_show = NO; g->outside_line_frag = NO; // FIXME: This assumes the layout manager implements this GNUstep extension g->size = [curLayoutManager advancementForGlyphAtIndex: cache_base + cache_length]; } } /* Should return the first glyph on the next line, which must be <=gi and >=cache_base (TODO: not enough. actually, it probably is now. the wrapping logic below will fall back to char wrapping if necessary). Glyphs up to and including gi will have been cached. */ -(unsigned int) breakLineByWordWrappingBefore: (unsigned int)gi { glyph_cache_t *g; unichar ch; NSString *str = [curTextStorage string]; gi -= cache_base; g = cache + gi; while (gi > 0) { if (g->g == NSControlGlyph) return gi + cache_base; ch = [str characterAtIndex: g->char_index]; /* TODO: paragraph/line separator */ if (ch == 0x20 || ch == 0x0a || ch == 0x0d) { g->dont_show = YES; if (gi > 0) { g->pos = g[-1].pos; g->pos.x += g[-1].size.width; } else g->pos = NSMakePoint(0, 0); g->size.width = 0; return gi + 1 + cache_base; } /* Each CJK glyph should be treated as a word when wrapping word. The range should work for most cases */ else if ((ch > 0x2ff0) && (ch < 0x9fff)) { g->dont_show = NO; if (gi > 0) { g->pos = g[-1].pos; g->pos.x += g[-1].size.width; } else g->pos = NSMakePoint(0,0); return gi + cache_base; } gi--; g--; } return gi + cache_base; } struct GSHorizontalTypesetter_line_frag_s { NSRect rect; CGFloat last_used; unsigned int last_glyph; /* last_glyph+1, actually */ }; typedef struct GSHorizontalTypesetter_line_frag_s line_frag_t; /* Apple uses this as the maximum width of an NSTextContainer. For bigger values the width gets ignored. */ #define LARGE_SIZE 1e7 -(void) fullJustifyLine: (line_frag_t *)lf : (int)num_line_frags { unsigned int i, start; CGFloat extra_space, delta; unsigned int num_spaces; NSString *str = [curTextStorage string]; glyph_cache_t *g; unichar ch; if (lf->rect.size.width >= LARGE_SIZE) { return; } for (start = 0; num_line_frags; num_line_frags--, lf++) { num_spaces = 0; for (i = start, g = cache + i; i < lf->last_glyph; i++, g++) { if (g->dont_show) continue; ch = [str characterAtIndex: g->char_index]; if (ch == 0x20) num_spaces++; } if (!num_spaces) continue; extra_space = lf->rect.size.width - lf->last_used; extra_space /= num_spaces; delta = 0; for (i = start, g = cache + i; i < lf->last_glyph; i++, g++) { g->pos.x += delta; if (!g->dont_show && [str characterAtIndex: g->char_index] == 0x20) { if (i < lf->last_glyph) g[1].nominal = NO; delta += extra_space; } } start = lf->last_glyph; lf->last_used = lf->rect.size.width; } } -(void) rightAlignLine: (line_frag_t *)lf : (int)num_line_frags { unsigned int i; CGFloat delta; glyph_cache_t *g; if (lf->rect.size.width >= LARGE_SIZE) { return; } for (i = 0, g = cache; num_line_frags; num_line_frags--, lf++) { delta = lf->rect.size.width - lf->last_used; for (; i < lf->last_glyph; i++, g++) g->pos.x += delta; lf->last_used += delta; } } -(void) centerAlignLine: (line_frag_t *)lf : (int)num_line_frags { unsigned int i; CGFloat delta; glyph_cache_t *g; if (lf->rect.size.width >= LARGE_SIZE) { return; } for (i = 0, g = cache; num_line_frags; num_line_frags--, lf++) { delta = (lf->rect.size.width - lf->last_used) / 2.0; for (; i < lf->last_glyph; i++, g++) g->pos.x += delta; lf->last_used += delta; } } -(BOOL) _reuseSoftInvalidatedLayout { /* We only handle the simple-horizontal-text-container case currently. */ NSRect r0, r; NSSize shift; int i; unsigned int g, g2, first; CGFloat container_height; /* Ask the layout manager for soft-invalidated layout for the current glyph. If there is a set of line frags starting at the current glyph, and we can get rects with the same size and horizontal position, we tell the layout manager to use the soft-invalidated information. */ r0 = [curLayoutManager _softInvalidateLineFragRect: 0 firstGlyph: &first nextGlyph: &g inTextContainer: curTextContainer]; container_height = [curTextContainer containerSize].height; if (!(curPoint.y + r0.size.height <= container_height)) return NO; /* We can shift the rects and still have things fit. Find all the line frags in the line and shift them. */ shift.width = 0; shift.height = curPoint.y - r0.origin.y; i = 1; curPoint.y = NSMaxY(r0) + shift.height; for (; 1; i++) { r = [curLayoutManager _softInvalidateLineFragRect: i firstGlyph: &first nextGlyph: &g2 inTextContainer: curTextContainer]; /* If there's a gap in soft invalidated information, we need to fill it in before we can continue. */ if (first != g) { break; } if (NSIsEmptyRect(r) || NSMaxY(r) + shift.height > container_height) break; g = g2; curPoint.y = NSMaxY(r) + shift.height; } [curLayoutManager _softInvalidateUseLineFrags: i withShift: shift inTextContainer: curTextContainer]; curGlyph = g; return YES; } - (NSRect)_getProposedRectFor: (BOOL)newParagraph withLineHeight: (CGFloat) line_height { CGFloat hindent; CGFloat tindent = [curParagraphStyle tailIndent]; if (newParagraph) hindent = [curParagraphStyle firstLineHeadIndent]; else hindent = [curParagraphStyle headIndent]; if (tindent <= 0.0) { NSSize size; size = [curTextContainer containerSize]; tindent = size.width + tindent; } return NSMakeRect(hindent, curPoint.y, tindent - hindent, line_height + [curParagraphStyle lineSpacing]); } /* Return values 0, 1, 2 are mostly the same as from -layoutGlyphsInLayoutManager:.... Additions: 0 Last typeset character was not a newline; next glyph does not start a new paragraph. 3 Last typeset character was a newline; next glyph starts a new paragraph. 4 Last typeset character may or may not have been a newline; must test before next call. */ -(int) layoutLineNewParagraph: (BOOL)newParagraph { NSRect rect, remain; /* Baseline and line height handling. */ CGFloat line_height; /* Current line height. */ CGFloat max_line_height; /* Maximum line height (usually from the paragraph style). */ CGFloat baseline; /* Baseline position (0 is top of line-height, positive is down). */ CGFloat ascender; /* Amount of space we want above the baseline (always>=0). */ CGFloat descender; /* Amount of space we want below the baseline (always>=0). */ /* These are values for the line as a whole. We start out by initializing for the first glyph on the line and then update these as we add more glyphs. If we need to increase the line height, we jump back to 'restart:' and rebuild our array of line frag rects. (TODO (optimization): if we're dealing with a "simple rectangular text container", we should try to extend the existing line frag in place before jumping back to do all the expensive checking). */ /* This calculation should match the calculation in [GSFontInfo -defaultLineHeightForFont], or text will look odd. */ #define COMPUTE_BASELINE baseline = line_height - descender /* TODO: doesn't have to be a simple horizontal container, but it's easier to handle that way. */ if ([curTextContainer isSimpleRectangularTextContainer] && [curLayoutManager _softInvalidateFirstGlyphInTextContainer: curTextContainer] == curGlyph) { if ([self _reuseSoftInvalidatedLayout]) return 4; } [self _cacheMoveTo: curGlyph]; if (!cache_length) [self _cacheGlyphs: CACHE_INITIAL]; if (!cache_length && at_end) { /* We've typeset all glyphs, and thus return 2. If we ended with a new-line, we set the extra line frag rect here so the insertion point will be properly positioned after a trailing newline in the text. */ NSRect r, r2, remain; if (!newParagraph || !curGlyph) { return 2; } /* We aren't actually interested in the glyph data, but we want the attributes for the final character so we can make the extra line frag rect match it. This call makes sure that cur* are set. */ [self _cacheMoveTo: curGlyph - 1]; line_height = [curFont defaultLineHeightForFont]; r = [self _getProposedRectFor: newParagraph withLineHeight: line_height]; r = [curTextContainer lineFragmentRectForProposedRect: r sweepDirection: NSLineSweepRight movementDirection: NSLineMovesDown remainingRect: &remain]; if (!NSIsEmptyRect(r)) { r2 = r; r2.size.width = 1; [curLayoutManager setExtraLineFragmentRect: r usedRect: r2 textContainer: curTextContainer]; } return 2; } /* Set up our initial baseline info. */ { CGFloat min = [curParagraphStyle minimumLineHeight]; max_line_height = [curParagraphStyle maximumLineHeight]; /* sanity */ if (max_line_height > 0 && max_line_height < min) max_line_height = min; line_height = [cache->font defaultLineHeightForFont]; ascender = [cache->font ascender]; descender = -[cache->font descender]; COMPUTE_BASELINE; if (line_height < min) line_height = min; if (max_line_height > 0 && line_height > max_line_height) line_height = max_line_height; } /* If we find out that we need to increase the line height, we have to start over. The increased line height might give _completely_ different line frag rects, so we can't reuse the layout information. OPT: However, we could recreate the line frag rects and see if they match before throwing away layout information, since most of the time they will be equivalent. Also, in the very common case of a simple rectangular text container, we can always extend the current line frag rects as long as they don't extend past the bottom of the container. */ #define WANT_LINE_HEIGHT(h) \ do { \ CGFloat __new_height = (h); \ if (max_line_height > 0 && __new_height > max_line_height) \ __new_height = max_line_height; \ if (__new_height > line_height) \ { \ line_height = __new_height; \ COMPUTE_BASELINE; \ goto restart; \ } \ } while (0) restart: ; remain = [self _getProposedRectFor: newParagraph withLineHeight: line_height]; /* Build a list of all line frag rects for this line. TODO: it's very convenient to do this in advance, but it might be inefficient, and in theory, we might end up with an insane number of line rects (eg. a text container with "hole"-columns every 100 points and width 1e8) */ line_frags_num = 0; while (1) { rect = [curTextContainer lineFragmentRectForProposedRect: remain sweepDirection: NSLineSweepRight movementDirection: line_frags_num?NSLineDoesntMove:NSLineMovesDown remainingRect: &remain]; if (NSIsEmptyRect(rect)) break; line_frags_num++; if (line_frags_num > line_frags_size) { line_frags_size += 2; line_frags = realloc(line_frags, sizeof(line_frag_t) * line_frags_size); } line_frags[line_frags_num - 1].rect = rect; } if (!line_frags_num) { if (curPoint.y == 0.0 && line_height > [curTextContainer containerSize].height && [curTextContainer containerSize].height > 0.0) { /* Try to make sure each container contains at least one line frag rect by shrinking our line height. */ line_height = [curTextContainer containerSize].height; max_line_height = line_height; goto restart; } return 1; } { unsigned int i = 0; glyph_cache_t *g; NSPoint p; NSFont *f = cache->font; CGFloat f_ascender = [f ascender], f_descender = -[f descender]; NSGlyph last_glyph = NSNullGlyph; NSPoint last_p; unsigned int first_glyph; line_frag_t *lf = line_frags; int lfi = 0; BOOL prev_had_non_nominal_width; last_p = p = NSMakePoint(0, 0); g = cache; first_glyph = 0; prev_had_non_nominal_width = NO; /* Main glyph layout loop. */ /* TODO: handling of newParagraph is ugly. must be set on all exits from this loop */ while (1) { // printf("at %3i+%3i\n", cache_base, i); /* Update the cache. */ if (i >= cache_length) { if (at_end) { newParagraph = NO; break; } [self _cacheGlyphs: cache_length + CACHE_STEP]; if (i >= cache_length) { newParagraph = NO; break; } g = cache + i; } /*printf("at %3i+%2i, glyph %08x, char %04x (%i)\n", cache_base, i, g->g, [[curTextStorage string] characterAtIndex: g->char_index], g->char_index);*/ /* At this point: p is the current point (sortof); the point where a nominally spaced glyph would be placed. g is the current glyph. i is the current glyph index, relative to the start of the cache. last_p and last_glyph are used for kerning and hold the previous glyph and its position. If there's no previous glyph (for kerning purposes), last_glyph is NSNullGlyph and last_p is undefined. lf and lfi track the current line frag rect. first_glyph is the first glyph in the current line frag rect. Note that the variables tracking the previous glyph shouldn't be updated until we know that the current glyph will fit in the line frag rect. */ /* If there's a font change, check if the baseline or line height needs adjusting. We update the ascender and descender too, even though there might not actually be any glyphs for this font. (TODO?) */ if (g->font != f) { CGFloat new_height; f = g->font; f_ascender = [f ascender]; f_descender = -[f descender]; last_glyph = NSNullGlyph; new_height = [f defaultLineHeightForFont]; if (f_ascender > ascender) ascender = f_ascender; if (f_descender > descender) descender = f_descender; COMPUTE_BASELINE; WANT_LINE_HEIGHT(new_height); } if (g->g == NSControlGlyph) { unichar ch = [[curTextStorage string] characterAtIndex: g->char_index]; /* TODO: need to handle other control characters */ g->pos = p; g->size.width = 0; g->dont_show = YES; g->nominal = !prev_had_non_nominal_width; i++; g++; last_glyph = NSNullGlyph; prev_had_non_nominal_width = NO; if (ch == 0xa) { newParagraph = YES; break; } if (ch == 0x9) { /* Handle tabs. This is a very basic and stupid implementation. TODO: implement properly */ NSArray *tabs = [curParagraphStyle tabStops]; NSTextTab *tab = nil; int i, c = [tabs count]; /* Find first tab beyond our current position. */ for (i = 0; i < c; i++) { tab = [tabs objectAtIndex: i]; /* We cannot use a tab at our exact location; we must use one beyond it. The reason is that several tabs in a row would get very odd behavior. Eg. given "\t\t", the first tab would move (exactly) to the next tab stop, and the next tab stop would move to the same tab, thus having no effect. */ if ([tab location] > p.x + lf->rect.origin.x) break; } if (i == c) { /* TODO: we're already past all the tab stops. what should we do? Pretend that we have tabs every 100 points. */ p.x = (floor(p.x / 100.0) + 1.0) * 100.0; } else { p.x = [tab location] - lf->rect.origin.x; } prev_had_non_nominal_width = YES; continue; } NSDebugLLog(@"GSHorizontalTypesetter", @"ignoring unknown control character %04x\n", ch); continue; } /* Set up glyph information. */ /* TODO: Currently, the attributes of the attachment character (eg. font) affect the layout. Think hard about this. */ g->nominal = !prev_had_non_nominal_width; if (g->attributes.explicit_kern && g->attributes.kern != 0) { p.x += g->attributes.kern; g->nominal = NO; } /* Baseline adjustments. */ { CGFloat y = 0; /* Attributes are up-side-down in our coordinate system. */ if (g->attributes.superscript) { y -= g->attributes.superscript * [f xHeight]; } if (g->attributes.baseline_offset) { /* And baseline_offset is up-side-down again. TODO? */ y += g->attributes.baseline_offset; } if (y != p.y) { p.y = y; g->nominal = NO; } /* The y==0 case is taken care of when the font is changed. */ if (y < 0 && f_ascender - y > ascender) ascender = f_ascender - y; if (y > 0 && f_descender + y > descender) descender = f_descender + y; COMPUTE_BASELINE; WANT_LINE_HEIGHT(ascender + descender); } if (g->g == GSAttachmentGlyph) { NSTextAttachment *attach; NSTextAttachmentCell *cell; NSRect r; attach = [curTextStorage attribute: NSAttachmentAttributeName atIndex: g->char_index effectiveRange: NULL]; cell = (NSTextAttachmentCell*)[attach attachmentCell]; if (!cell) { g->pos = p; g->size = NSMakeSize(0, 0); g->dont_show = YES; g->nominal = YES; i++; g++; last_glyph = NSNullGlyph; continue; } r = [cell cellFrameForTextContainer: curTextContainer proposedLineFragment: lf->rect glyphPosition: NSMakePoint(p.x, lf->rect.size.height - baseline) characterIndex: g->char_index]; /* printf("cell at %i, (%g %g) in (%g %g)+(%g %g), got rect (%g %g)+(%g %g)\n", g->char_index,p.x,p.y, lf->rect.origin.x,lf->rect.origin.y, lf->rect.size.width,lf->rect.size.height, r.origin.x,r.origin.y, r.size.width,r.size.height);*/ /* For some obscure reason, the rectangle we get is up-side-down compared to everything else here, and has it's origin in p. (Makes sense from the cell's pov, though.) */ if (-NSMinY(r) > descender) descender = -NSMinY(r); if (NSMaxY(r) > ascender) ascender = NSMaxY(r); /* Update ascender and descender. Adjust line height and baseline if necessary. */ COMPUTE_BASELINE; WANT_LINE_HEIGHT(ascender + descender); g->size = r.size; g->pos.x = p.x + r.origin.x; g->pos.y = p.y + r.origin.y; p.x = g->pos.x + g->size.width; /* An attachment is always in a point range of its own. */ g->nominal = NO; } else { /* TODO: this is a major bottleneck */ /* if (last_glyph) { BOOL n; p = [f positionOfGlyph: g->g precededByGlyph: last_glyph isNominal: &n]; if (!n) g->nominal = NO; p.x += last_p.x; p.y += last_p.y; }*/ last_p = g->pos = p; /* Only the width is used. */ p.x += g->size.width; } /* Did the glyph fit in the line frag rect? */ if (p.x > lf->rect.size.width) { /* It didn't. Try to break the line. */ switch ([curParagraphStyle lineBreakMode]) { /* TODO: implement all modes */ default: case NSLineBreakByCharWrapping: char_wrapping: lf->last_glyph = i; break; case NSLineBreakByWordWrapping: lf->last_glyph = [self breakLineByWordWrappingBefore: cache_base + i] - cache_base; if (lf->last_glyph <= first_glyph) goto char_wrapping; break; case NSLineBreakByTruncatingHead: case NSLineBreakByTruncatingMiddle: case NSLineBreakByTruncatingTail: /* Pretending that these are clipping is far from prefect, but it's the closest we've got. */ case NSLineBreakByClipping: /* Scan forward to the next paragraph separator and mark all the glyphs up to there as not visible. */ g->outside_line_frag = YES; while (1) { i++; g++; /* Update the cache. */ if (i >= cache_length) { if (at_end) { newParagraph = NO; i--; break; } [self _cacheGlyphs: cache_length + CACHE_STEP]; if (i >= cache_length) { newParagraph = NO; i--; break; } g = cache + i; } g->dont_show = YES; g->pos = p; if (g->g == NSControlGlyph && [[curTextStorage string] characterAtIndex: g->char_index] == 0xa) break; } lf->last_glyph = i + 1; break; } /* We force at least one glyph into each line frag rect. This ensures that typesetting will never get stuck (ie. if the text container is too narrow to fit even a single glyph). */ if (lf->last_glyph <= first_glyph) lf->last_glyph = i + 1; last_p = p = NSMakePoint(0, 0); i = lf->last_glyph; g = cache + i; /* The -1 is always valid since there's at least one glyph in the line frag rect (see above). */ lf->last_used = g[-1].pos.x + g[-1].size.width; last_glyph = NSNullGlyph; prev_had_non_nominal_width = NO; lf++; lfi++; if (lfi == line_frags_num) { newParagraph = NO; break; } first_glyph = i; } else { /* Move to next glyph. */ last_glyph = g->g; if (last_glyph == GSAttachmentGlyph) { last_glyph = NSNullGlyph; prev_had_non_nominal_width = YES; } else { prev_had_non_nominal_width = NO; } i++; g++; } } /* Basic layout is done. */ /* Take care of the alignments. */ if (lfi != line_frags_num) { lf->last_glyph = i; lf->last_used = p.x; /* TODO: incorrect if there is more than one line frag */ if ([curParagraphStyle alignment] == NSRightTextAlignment) [self rightAlignLine: line_frags : line_frags_num]; else if ([curParagraphStyle alignment] == NSCenterTextAlignment) [self centerAlignLine: line_frags : line_frags_num]; } else { if ([curParagraphStyle lineBreakMode] == NSLineBreakByWordWrapping && [curParagraphStyle alignment] == NSJustifiedTextAlignment) [self fullJustifyLine: line_frags : line_frags_num]; else if ([curParagraphStyle alignment] == NSRightTextAlignment) [self rightAlignLine: line_frags : line_frags_num]; else if ([curParagraphStyle alignment] == NSCenterTextAlignment) [self centerAlignLine: line_frags : line_frags_num]; lfi--; } /* Layout is complete. Package it and give it to the layout manager. */ [curLayoutManager setTextContainer: curTextContainer forGlyphRange: NSMakeRange(cache_base, i)]; curGlyph = i + cache_base; { line_frag_t *lf; NSPoint p; unsigned int i, j; glyph_cache_t *g; NSRect used_rect; for (lf = line_frags, i = 0, g = cache; lfi >= 0; lfi--, lf++) { used_rect.origin.x = g->pos.x + lf->rect.origin.x; used_rect.size.width = lf->last_used - g->pos.x; /* TODO: be pickier about height? */ used_rect.origin.y = lf->rect.origin.y; used_rect.size.height = lf->rect.size.height; [curLayoutManager setLineFragmentRect: lf->rect forGlyphRange: NSMakeRange(cache_base + i, lf->last_glyph - i) usedRect: used_rect]; p = g->pos; p.y += baseline; j = i; while (i < lf->last_glyph) { if (g->outside_line_frag) { [curLayoutManager setDrawsOutsideLineFragment: YES forGlyphAtIndex: cache_base + i]; } if (g->dont_show) { [curLayoutManager setNotShownAttribute: YES forGlyphAtIndex: cache_base + i]; } if (!g->nominal && i != j) { [curLayoutManager setLocation: p forStartOfGlyphRange: NSMakeRange(cache_base + j, i - j)]; if (g[-1].g == GSAttachmentGlyph) { [curLayoutManager setAttachmentSize: g[-1].size forGlyphRange: NSMakeRange(cache_base + j, i - j)]; } p = g->pos; p.y += baseline; j = i; } i++; g++; } if (i != j) { [curLayoutManager setLocation: p forStartOfGlyphRange: NSMakeRange(cache_base + j, i - j)]; if (g[-1].g == GSAttachmentGlyph) { [curLayoutManager setAttachmentSize: g[-1].size forGlyphRange: NSMakeRange(cache_base + j, i - j)]; } } } } } curPoint = NSMakePoint(0, NSMaxY(line_frags->rect)); if (newParagraph) return 3; else return 0; } -(int) layoutGlyphsInLayoutManager: (GSLayoutManager *)layoutManager inTextContainer: (NSTextContainer *)textContainer startingAtGlyphIndex: (unsigned int)glyphIndex previousLineFragmentRect: (NSRect)previousLineFragRect nextGlyphIndex: (unsigned int *)nextGlyphIndex numberOfLineFragments: (unsigned int)howMany { int ret, real_ret; BOOL newParagraph; if (![lock tryLock]) { /* Since we might be the shared system typesetter, we must be reentrant. Thus, if we are already in use and can't lock our lock, we create a new instance and let it handle the call. */ GSHorizontalTypesetter *temp; temp = [[object_getClass(self) alloc] init]; ret = [temp layoutGlyphsInLayoutManager: layoutManager inTextContainer: textContainer startingAtGlyphIndex: glyphIndex previousLineFragmentRect: previousLineFragRect nextGlyphIndex: nextGlyphIndex numberOfLineFragments: howMany]; DESTROY(temp); return ret; } NS_DURING curLayoutManager = layoutManager; curTextContainer = textContainer; curTextStorage = [layoutManager textStorage]; /* printf("*** layout some stuff |%@|\n", curTextStorage); [curLayoutManager _glyphDumpRuns];*/ curGlyph = glyphIndex; [self _cacheClear]; real_ret = 4; curPoint = NSMakePoint(0, NSMaxY(previousLineFragRect)); while (1) { if (real_ret == 4) { /* -layoutLineNewParagraph: needs to know if the starting glyph is the first glyph of a paragraph so it can apply eg. -firstLineHeadIndent and paragraph spacing properly. */ if (!curGlyph) { newParagraph = YES; } else { unsigned int chi; unichar ch; chi = [curLayoutManager characterRangeForGlyphRange: NSMakeRange(curGlyph - 1, 1) actualGlyphRange: NULL].location; ch = [[curTextStorage string] characterAtIndex: chi]; if (ch == '\n') newParagraph = YES; else newParagraph = NO; } } else if (real_ret == 3) { newParagraph = YES; } else { newParagraph = NO; } ret = [self layoutLineNewParagraph: newParagraph]; real_ret = ret; if (ret == 3 || ret == 4) ret = 0; if (ret) break; if (howMany) if (!--howMany) break; } *nextGlyphIndex = curGlyph; NS_HANDLER NSLog(@"GSHorizontalTypesetter - %@", [localException reason]); [lock unlock]; [localException raise]; ret=0; /* This is never reached, but it shuts up the compiler. */ NS_ENDHANDLER [lock unlock]; return ret; } @end gnustep-gui-0.24.0/Source/GSIconManager.m0000664000076500007650000000605211330147655020005 0ustar brains99brains99/* Copyright (C) 2009 Free Software Foundation, Inc. Written by: German Arias Created: December 2009 This file is part of the GNUstep Project This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import "AppKit/NSGraphics.h" #import "GSIconManager.h" @protocol GSIconManager - (NSRect) setWindow: (unsigned int)aWindowNumber appProcessId: (int)aProcessId; - (void) removeWindow: (unsigned int)aWindowNumber; - (NSSize) getSizeWindow; - (id) retain; - (void) release; @end static BOOL verify = NO; static id gsim = nil; static int appId = 0; static int iconCount = 0; static void GSGetIconManager(void) { if ([[NSUserDefaults standardUserDefaults] boolForKey: @"GSUseIconManager"]) { appId = [[NSProcessInfo processInfo] processIdentifier]; gsim = (id )[NSConnection rootProxyForConnectionWithRegisteredName: @"GSIconManager" host: @""]; if (gsim == nil) { NSLog (@"Error: could not connect to server GSIconManager"); } [gsim retain]; } } static inline void checkVerify() { if (!verify) { GSGetIconManager(); verify = YES; } } NSSize GSGetIconSize(void) { NSSize iconSize; checkVerify(); if (gsim != nil) { iconSize = [gsim getSizeWindow]; } else { iconSize = [GSCurrentServer() iconSize]; } return iconSize; } void GSRemoveIcon(NSWindow *window) { checkVerify(); if (gsim != nil) { unsigned int winNum = 0; NSConvertWindowNumberToGlobal([window windowNumber], &winNum); [gsim removeWindow: winNum]; iconCount--; if (iconCount == 0) { DESTROY(gsim); verify = NO; } } } NSRect GSGetIconFrame(NSWindow *window) { NSRect iconRect; checkVerify(); if (gsim != nil) { unsigned int winNum = 0; NSConvertWindowNumberToGlobal([window windowNumber], &winNum); iconRect = [gsim setWindow: winNum appProcessId: appId]; iconCount++; } else { iconRect = [window frame]; iconRect.size = [GSCurrentServer() iconSize]; } return iconRect; } gnustep-gui-0.24.0/Source/NSBundleAdditions.m0000664000076500007650000002113212246625344020700 0ustar brains99brains99/** NSBundleAdditions Implementation of NSBundle Additions Copyright (C) 1997, 1999 Free Software Foundation, Inc. Author: Simon Frankau Date: 1997 Author: Richard Frith-Macdonald Date: 1999 Author: Gregory John Casamento Date: 2000 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import #import #import #import #import #import #import #import #import #import #import "AppKit/NSControl.h" #import "AppKit/NSNib.h" #import "AppKit/NSNibConnector.h" #import "AppKit/NSNibLoading.h" #import "GNUstepGUI/GSModelLoaderFactory.h" @implementation NSNibConnector - (void) dealloc { RELEASE(_src); RELEASE(_dst); RELEASE(_tag); [super dealloc]; } - (id) destination { return _dst; } - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { if (_src != nil) { [aCoder encodeObject: _src forKey: @"NSSource"]; } if (_dst != nil) { [aCoder encodeObject: _dst forKey: @"NSDestination"]; } if (_tag != nil) { [aCoder encodeObject: _tag forKey: @"NSLabel"]; } } else { [aCoder encodeObject: _src]; [aCoder encodeObject: _dst]; [aCoder encodeObject: _tag]; } } - (void) establishConnection { } - (id) initWithCoder: (NSCoder*)aDecoder { if ([aDecoder allowsKeyedCoding]) { if ([aDecoder containsValueForKey: @"NSDestination"]) { ASSIGN(_dst, [aDecoder decodeObjectForKey: @"NSDestination"]); } if ([aDecoder containsValueForKey: @"NSSource"]) { ASSIGN(_src, [aDecoder decodeObjectForKey: @"NSSource"]); } if ([aDecoder containsValueForKey: @"NSLabel"]) { ASSIGN(_tag, [aDecoder decodeObjectForKey: @"NSLabel"]); } } else { [aDecoder decodeValueOfObjCType: @encode(id) at: &_src]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_dst]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_tag]; } return self; } - (NSString*) label { return _tag; } - (void) replaceObject: (id)anObject withObject: (id)anotherObject { if (_src == anObject) { ASSIGN(_src, anotherObject); } if (_dst == anObject) { ASSIGN(_dst, anotherObject); } if (_tag == anObject) { ASSIGN(_tag, anotherObject); } } - (id) source { return _src; } - (void) setDestination: (id)anObject { ASSIGN(_dst, anObject); } - (void) setLabel: (NSString*)label { ASSIGN(_tag, label); } - (void) setSource: (id)anObject { ASSIGN(_src, anObject); } - (NSString *)description { NSString *desc = [NSString stringWithFormat: @"<%@ src=%@ dst=%@ label=%@>", [super description], [self source], [self destination], [self label]]; return desc; } @end @implementation NSNibControlConnector - (void) establishConnection { SEL sel = NSSelectorFromString(_tag); [_src setTarget: _dst]; [_src setAction: sel]; } @end @implementation NSNibOutletConnector - (void) establishConnection { NS_DURING { if (_src != nil) { NSString *selName; SEL sel; selName = [NSString stringWithFormat: @"set%@%@:", [[_tag substringToIndex: 1] uppercaseString], [_tag substringFromIndex: 1]]; sel = NSSelectorFromString(selName); if (sel && [_src respondsToSelector: sel]) { [_src performSelector: sel withObject: _dst]; } else { const char *nam = [_tag cString]; const char *type; unsigned int size; int offset; /* * Use the GNUstep additional function to set the instance * variable directly. * FIXME - need some way to do this for libFoundation and * Foundation based systems. */ if (GSObjCFindVariable(_src, nam, &type, &size, &offset)) { GSObjCSetVariable(_src, offset, size, (void*)&_dst); } } } } NS_HANDLER { NSLog(@"Error while establishing connection %@: %@",self,[localException reason]); } NS_ENDHANDLER; } @end @implementation NSBundle (NSBundleAdditions) + (BOOL) loadNibFile: (NSString*)fileName externalNameTable: (NSDictionary*)context withZone: (NSZone*)zone { NSNib *nib = [[NSNib alloc] initWithContentsOfURL: [NSURL fileURLWithPath: fileName]]; BOOL loaded = [nib instantiateNibWithExternalNameTable: context withZone: zone]; RELEASE(nib); return loaded; } + (BOOL) loadNibNamed: (NSString *)aNibName owner: (id)owner { NSDictionary *table; NSBundle *bundle; if (owner == nil || aNibName == nil) { return NO; } table = [NSDictionary dictionaryWithObject: owner forKey: NSNibOwner]; /* * First look for the NIB in the bundle corresponding to the owning class, * since the class may have been loaded dynamically and the bundle may * contain class-specific NIB resources as well as code. * If that fails, try to load the NIB from the main application bundle, * which is where most NIB resources are to be found. * Possibly this is the wrong order ... since it's conceivable that an * application may supply an alternative NIB which it would like to have * used in preference to the one in the classes bundle. However I could * not find the behavior documented anywhere and the current order is * most consistent with the the way the code behaved before I changed it. */ bundle = [self bundleForClass: [owner class]]; if (bundle != nil && [bundle loadNibFile: aNibName externalNameTable: table withZone: [owner zone]] == YES) { return YES; } else { bundle = [self mainBundle]; } return [bundle loadNibFile: aNibName externalNameTable: table withZone: [owner zone]]; } - (NSString *) pathForNibResource: (NSString *)fileName { NSEnumerator *enumerator; NSArray *types = [GSModelLoaderFactory supportedTypes]; NSString *ext = [fileName pathExtension]; NSDebugLLog(@"NIB", @"Path for NIB file %@", fileName); if ((ext == nil) || [ext isEqualToString:@""]) { NSString *type; enumerator = [types objectEnumerator]; while ((type = [enumerator nextObject])) { NSDebugLLog(@"NIB", @"Checking type %@", fileName); NSString *path = [self pathForResource: fileName ofType: type]; if (path != nil) { return path; } } } else { if ([types containsObject: ext]) { NSString *path = [self pathForResource: [fileName stringByDeletingPathExtension] ofType: ext]; if (path != nil) { return path; } } } NSDebugLLog(@"NIB", @"Did not find NIB resource %@", fileName); return nil; } - (BOOL) loadNibFile: (NSString*)fileName externalNameTable: (NSDictionary*)context withZone: (NSZone*)zone { NSString *path = [self pathForNibResource: fileName]; if (path != nil) { return [NSBundle loadNibFile: path externalNameTable: context withZone: (NSZone*)zone]; } else { return NO; } } @end // end of NSBundleAdditions gnustep-gui-0.24.0/Source/GSAnimator.m0000664000076500007650000001556411376454556017417 0ustar brains99brains99/* GSAnimator.m Author: Xavier Glattard (xgl) Copyright (c) 2007 Free Software Foundation, Inc. This file used to be part of the mySTEP Library. This file now 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import "AppKit/NSEvent.h" #import "GNUstepGUI/GSAnimator.h" @interface GSAnimator (private) - (void) _animationBegin; - (void) _animationLoop; - (void) _animationEnd; @end @implementation GSAnimator + (GSAnimator*) animatorWithAnimation: (id)anAnimation frameRate: (float)fps zone: (NSZone*)aZone { return AUTORELEASE([[self allocWithZone: aZone] initWithAnimation: anAnimation frameRate: fps]); } + (GSAnimator*) animatorWithAnimation: (id)anAnimation frameRate: (float)fps { return [self animatorWithAnimation: anAnimation frameRate: fps zone: NULL]; } + (GSAnimator*) animatorWithAnimation: (id)anAnimation { return [self animatorWithAnimation: anAnimation frameRate: 0.0]; } - (GSAnimator*) initWithAnimation: (id)anAnimation frameRate: (float)fps { if ((self = [super init])) { _running = NO; _animation = anAnimation; ASSIGN(_runLoopModes, [NSArray arrayWithObject: NSDefaultRunLoopMode]); _timerInterval = (fps == 0.0) ? 0.0 : (1.0 / fps); [self resetCounters]; } return self; } - (GSAnimator*) initWithAnimation: (id)anAnimation { return [self initWithAnimation: anAnimation frameRate: 0.0]; } - (void) dealloc { [self stopAnimation]; TEST_RELEASE(_runLoopModes); [super dealloc]; } - (unsigned int) frameCount { return _frameCount; } - (void) resetCounters { _elapsed = 0.0; _frameCount = 0; _lastFrame = [NSDate timeIntervalSinceReferenceDate]; } - (float) frameRate { return ((float)[self frameCount]) / ((float)_elapsed); } - (NSArray*) runLoopModesForAnimating { return _runLoopModes; } - (void) setRunLoopModesForAnimating: (NSArray*)modes { ASSIGN(_runLoopModes, modes); } - (void) startAnimation { if (!_running) { _running = YES; [self resetCounters]; [_animation animatorDidStart]; [self _animationBegin]; [self _animationLoop]; NSDebugMLLog(@"GSAnimator", @"Started !"); } } - (void) stopAnimation { if (_running) { _running = NO; [self _animationEnd]; [_animation animatorDidStop]; } } - (void) startStopAnimation { if (_running) [self stopAnimation]; else [self startAnimation]; } - (BOOL) isAnimationRunning { return _running; } - (void) stepAnimation { NSTimeInterval thisFrame = [NSDate timeIntervalSinceReferenceDate]; NSTimeInterval sinceLastFrame = (thisFrame - _lastFrame); _elapsed += sinceLastFrame; _lastFrame = thisFrame; [_animation animatorStep: _elapsed]; _frameCount++; } @end static NSTimer *_GSTimerBasedAnimator_timer = nil; static NSMutableSet *_GSTimerBasedAnimator_animators = nil; static GSAnimator *_GSTimerBasedAnimator_the_one_animator = nil; static int _GSTimerBasedAnimator_animator_count = 0; @implementation GSAnimator (private) + (void) loopsAnimators { switch (_GSTimerBasedAnimator_animator_count) { case 0: break; case 1: [_GSTimerBasedAnimator_the_one_animator _animationLoop]; break; default: [_GSTimerBasedAnimator_animators makeObjectsPerform: @selector(_animationLoop)]; } } - (void) _animationBegin { NSTimer *newTimer = nil; if (_timerInterval == 0.0) { NSDebugMLLog(@"GSAnimator", @"AFAP start"); if (!_GSTimerBasedAnimator_animator_count++) _GSTimerBasedAnimator_the_one_animator = self; if (nil == _GSTimerBasedAnimator_animators) _GSTimerBasedAnimator_animators = [[NSMutableSet alloc] initWithCapacity: 5]; [_GSTimerBasedAnimator_animators addObject: self]; if (nil == _GSTimerBasedAnimator_timer) { newTimer = [NSTimer timerWithTimeInterval: 0.0 target: [self class] selector: @selector(loopsAnimators) userInfo: nil repeats: YES]; ASSIGN(_GSTimerBasedAnimator_timer, newTimer); } } else { NSDebugMLLog(@"GSAnimator", @"Fixed frame rate start"); newTimer = [NSTimer timerWithTimeInterval: _timerInterval target: self selector: @selector(_animationLoop) userInfo: nil repeats: YES]; ASSIGN(_timer, newTimer); } if (newTimer != nil) { unsigned i,c; for (i = 0, c = [_runLoopModes count]; i < c; i++) { [[NSRunLoop currentRunLoop] addTimer: newTimer forMode: [_runLoopModes objectAtIndex:i]]; } NSDebugMLLog(@"GSAnimator",@"addTimer in %d mode(s)", c); } } - (void) _animationLoop { NSDebugMLLog(@"GSAnimator", @"Loop"); [self stepAnimation]; } - (void) _animationEnd { if (_timerInterval == 0.0) { NSDebugMLLog(@"GSAnimator", @"AFAP end"); [_GSTimerBasedAnimator_animators removeObject: self]; if (!--_GSTimerBasedAnimator_animator_count) { [_GSTimerBasedAnimator_timer invalidate]; DESTROY(_GSTimerBasedAnimator_timer); _GSTimerBasedAnimator_the_one_animator = nil; } else if (_GSTimerBasedAnimator_the_one_animator == self) _GSTimerBasedAnimator_the_one_animator = [_GSTimerBasedAnimator_animators anyObject]; } else { NSDebugMLLog(@"GSAnimator", @"Fixed frame rate end"); if (_timer != nil) { [_timer invalidate]; DESTROY(_timer); } } } @end // implementation GSAnimator (private) gnustep-gui-0.24.0/Source/externs.m0000664000076500007650000010350112135055364017054 0ustar brains99brains99/* externs.m External data Copyright (C) 1997 Free Software Foundation, Inc. Author: Scott Christley Date: August 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import "AppKit/NSApplication.h" #import "AppKit/NSEvent.h" // Global strings NSString *NSModalPanelRunLoopMode = @"ModalPanelMode"; NSString *NSEventTrackingRunLoopMode = @"EventTrackingMode"; const double NSAppKitVersionNumber = NSAppKitVersionNumber10_4; // // Global Exception Strings // NSString *NSAbortModalException = @"AbortModal"; NSString *NSAbortPrintingException = @"AbortPrinting"; NSString *NSAppKitIgnoredException = @"AppKitIgnored"; NSString *NSAppKitVirtualMemoryException = @"AppKitVirtualMemory"; NSString *NSBadBitmapParametersException = @"BadBitmapParameters"; NSString *NSBadComparisonException = @"BadComparison"; NSString *NSBadRTFColorTableException = @"BadRTFColorTable"; NSString *NSBadRTFDirectiveException = @"BadRTFDirective"; NSString *NSBadRTFFontTableException = @"BadRTFFontTable"; NSString *NSBadRTFStyleSheetException = @"BadRTFStyleSheet"; NSString *NSBrowserIllegalDelegateException = @"BrowserIllegalDelegate"; NSString *NSColorListIOException = @"ColorListIO"; NSString *NSColorListNotEditableException = @"ColorListNotEditable"; NSString *NSDraggingException = @"Draggin"; NSString *NSFontUnavailableException = @"FontUnavailable"; NSString *NSIllegalSelectorException = @"IllegalSelector"; NSString *NSImageCacheException = @"ImageCache"; NSString *NSNibLoadingException = @"NibLoading"; NSString *NSPPDIncludeNotFoundException = @"PPDIncludeNotFound"; NSString *NSPPDIncludeStackOverflowException = @"PPDIncludeStackOverflow"; NSString *NSPPDIncludeStackUnderflowException = @"PPDIncludeStackUnderflow"; NSString *NSPPDParseException = @"PPDParse"; NSString *NSPrintOperationExistsException = @"PrintOperationExists"; NSString *NSPrintPackageException = @"PrintPackage"; NSString *NSPrintingCommunicationException = @"PrintingCommunication"; NSString *NSRTFPropertyStackOverflowException = @"RTFPropertyStackOverflow"; NSString *NSTIFFException = @"TIFF"; NSString *NSTextLineTooLongException = @"TextLineTooLong"; NSString *NSTextNoSelectionException = @"TextNoSelection"; NSString *NSTextReadException = @"TextRead"; NSString *NSTextWriteException = @"TextWrite"; NSString *NSTypedStreamVersionException = @"TypedStreamVersion"; NSString *NSWindowServerCommunicationException = @"WindowServerCommunication"; NSString *NSWordTablesReadException = @"WordTablesRead"; NSString *NSWordTablesWriteException = @"WordTablesWrite"; NSString *GSWindowServerInternalException = @"WindowServerInternal"; // NSAnimation NSString* NSAnimationProgressMarkNotification = @"NSAnimationProgressMarkNotification"; NSString *NSAnimationProgressMark = @"NSAnimationProgressMark"; NSString *NSAnimationTriggerOrderIn = @"NSAnimationTriggerOrderIn"; NSString *NSAnimationTriggerOrderOut = @"NSAnimationTriggerOrderOut"; // Application notifications NSString *NSApplicationDidBecomeActiveNotification = @"ApplicationDidBecomeActive"; NSString *NSApplicationDidChangeScreenParametersNotification = @"NSApplicationDidChangeScreenParameters"; NSString *NSApplicationDidFinishLaunchingNotification = @"ApplicationDidFinishLaunching"; NSString *NSApplicationDidHideNotification = @"ApplicationDidHide"; NSString *NSApplicationDidResignActiveNotification = @"ApplicationDidResignActive"; NSString *NSApplicationDidUnhideNotification = @"ApplicationDidUnhide"; NSString *NSApplicationDidUpdateNotification = @"ApplicationDidUpdate"; NSString *NSApplicationWillBecomeActiveNotification = @"ApplicationWillBecomeActive"; NSString *NSApplicationWillFinishLaunchingNotification = @"ApplicationWillFinishLaunching"; NSString *NSApplicationWillTerminateNotification = @"ApplicationWillTerminate"; NSString *NSApplicationWillHideNotification = @"ApplicationWillHide"; NSString *NSApplicationWillResignActiveNotification = @"ApplicationWillResignActive"; NSString *NSApplicationWillUnhideNotification = @"ApplicationWillUnhide"; NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate"; // NSBitmapImageRep Global strings NSString *NSImageCompressionMethod = @"NSImageCompressionMethod"; NSString *NSImageCompressionFactor = @"NSImageCompressionFactor"; NSString *NSImageDitherTransparency = @"NSImageDitherTransparency"; NSString *NSImageRGBColorTable = @"NSImageRGBColorTable"; NSString *NSImageInterlaced = @"NSImageInterlaced"; NSString *NSImageColorSyncProfileData = @"NSImageColorSyncProfileData"; // Mac OS X only //NSString *GSImageICCProfileData = @"GSImageICCProfileData"; // if & when GNUstep supports color management NSString *NSImageFrameCount = @"NSImageFrameCount"; NSString *NSImageCurrentFrame = @"NSImageCurrentFrame"; NSString *NSImageCurrentFrameDuration = @"NSImageCurrentFrameDuration"; NSString *NSImageLoopCount = @"NSImageLoopCount"; NSString *NSImageGamma = @"NSImageGamma"; NSString *NSImageProgressive = @"NSImageProgressive"; NSString *NSImageEXIFData = @"NSImageEXIFData"; // No support yet in GNUstep // NSBrowser notification NSString *NSBrowserColumnConfigurationDidChangeNotification = @"NSBrowserColumnConfigurationDidChange"; // NSColor Global strings NSString *NSCalibratedWhiteColorSpace = @"NSCalibratedWhiteColorSpace"; NSString *NSCalibratedBlackColorSpace = @"NSCalibratedBlackColorSpace"; NSString *NSCalibratedRGBColorSpace = @"NSCalibratedRGBColorSpace"; NSString *NSDeviceWhiteColorSpace = @"NSDeviceWhiteColorSpace"; NSString *NSDeviceBlackColorSpace = @"NSDeviceBlackColorSpace"; NSString *NSDeviceRGBColorSpace = @"NSDeviceRGBColorSpace"; NSString *NSDeviceCMYKColorSpace = @"NSDeviceCMYKColorSpace"; NSString *NSNamedColorSpace = @"NSNamedColorSpace"; NSString *NSPatternColorSpace = @"NSPatternColorSpace"; NSString *NSCustomColorSpace = @"NSCustomColorSpace"; // NSColor Global gray values const CGFloat NSBlack = 0; const CGFloat NSDarkGray = .333; const CGFloat NSGray = 0.5; const CGFloat NSLightGray = .667; const CGFloat NSWhite = 1; // NSColor notification NSString *NSSystemColorsDidChangeNotification = @"NSSystemColorsDidChangeNotification"; // NSColorList notifications NSString *NSColorListDidChangeNotification = @"NSColorListDidChange"; // NSColorPanel notifications NSString *NSColorPanelColorDidChangeNotification = @"NSColorPanelColorDidChange"; #if GNUSTEP_GUI_MAJOR_VERSION == 0 && GNUSTEP_GUI_MINOR_VERSION < 20 /* The above notifications had been misspelled in GNUstep. We keep them around here to preserve binary compatibility until the next release. */ NSString *NSColorListChangedNotification = @"NSColorListDidChange"; NSString *NSColorPanelColorChangedNotification = @"NSColorPanelColorDidChange"; #endif // NSComboBox notifications NSString *NSComboBoxWillPopUpNotification = @"NSComboBoxWillPopUpNotification"; NSString *NSComboBoxWillDismissNotification = @"NSComboBoxWillDismissNotification"; NSString *NSComboBoxSelectionDidChangeNotification = @"NSComboBoxSelectionDidChangeNotification"; NSString *NSComboBoxSelectionIsChangingNotification = @"NSComboBoxSelectionIsChangingNotification"; // NSControl notifications NSString *NSControlTextDidBeginEditingNotification = @"NSControlTextDidBeginEditingNotification"; NSString *NSControlTextDidEndEditingNotification = @"NSControlTextDidEndEditingNotification"; NSString *NSControlTextDidChangeNotification = @"NSControlTextDidChangeNotification"; // NSDataLink global strings NSString *NSDataLinkFilenameExtension = @"dlf"; // NSDrawer notifications NSString *NSDrawerDidCloseNotification = @"NSDrawerDidCloseNotification"; NSString *NSDrawerDidOpenNotification = @"NSDrawerDidOpenNotification"; NSString *NSDrawerWillCloseNotification = @"NSDrawerWillCloseNotification"; NSString *NSDrawerWillOpenNotification = @"NSDrawerWillOpenNotification"; // NSForm private notification NSString *_NSFormCellDidChangeTitleWidthNotification = @"_NSFormCellDidChangeTitleWidthNotification"; // NSGraphicContext constants NSString *NSGraphicsContextDestinationAttributeName = @"NSGraphicsContextDestinationAttributeName"; NSString *NSGraphicsContextPDFFormat = @"NSGraphicsContextPDFFormat"; NSString *NSGraphicsContextPSFormat = @"NSGraphicsContextPSFormat"; NSString *NSGraphicsContextRepresentationFormatAttributeName = @"NSGraphicsContextRepresentationFormatAttributeName"; NSString *NSImageInterpolationDefault = @"NSImageInterpolationDefault"; NSString *NSImageInterpolationNone = @"NSImageInterpolationNone"; NSString *NSImageInterpolationLow = @"NSImageInterpolationLow"; NSString *NSImageInterpolationHigh = @"NSImageInterpolationHigh"; // NSHelpManager notifications; NSString *NSContextHelpModeDidActivateNotification = @"NSContextHelpModeDidActivateNotification"; NSString *NSContextHelpModeDidDeactivateNotification = @"NSContextHelpModeDidDeactivateNotification"; // NSFont Global Strings 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"; // NSFontDescriptor global strings NSString *NSFontFamilyAttribute = @"Family"; NSString *NSFontNameAttribute = @"Name"; NSString *NSFontFaceAttribute = @"Face"; NSString *NSFontSizeAttribute = @"Size"; NSString *NSFontVisibleNameAttribute = @"VisibleName"; NSString *NSFontColorAttribute = @"Color"; NSString *NSFontMatrixAttribute = @"Matrix"; NSString *NSFontVariationAttribute = @"Variation"; NSString *NSFontCharacterSetAttribute = @"CharacterSet"; NSString *NSFontCascadeListAttribute = @"CascadeList"; NSString *NSFontTraitsAttribute = @"Traits"; NSString *NSFontFixedAdvanceAttribute = @"FixedAdvance"; NSString *NSFontSymbolicTrait = @"SymbolicTrait"; NSString *NSFontWeightTrait = @"WeightTrait"; NSString *NSFontWidthTrait = @"WidthTrait"; NSString *NSFontSlantTrait = @"SlantTrait"; NSString *NSFontVariationAxisIdentifierKey = @"VariationAxisIdentifier"; NSString *NSFontVariationAxisMinimumValueKey = @"VariationAxisMinimumValue"; NSString *NSFontVariationAxisMaximumValueKey = @"VariationAxisMaximumValue"; NSString *NSFontVariationAxisDefaultValueKey = @"VariationAxisDefaultValue"; NSString *NSFontVariationAxisNameKey = @"VariationAxisName"; // NSScreen Global device dictionary key strings NSString *NSDeviceResolution = @"NSDeviceResolution"; NSString *NSDeviceColorSpaceName = @"NSDeviceColorSpaceName"; NSString *NSDeviceBitsPerSample = @"NSDeviceBitsPerSample"; NSString *NSDeviceIsScreen = @"NSDeviceIsScreen"; NSString *NSDeviceIsPrinter = @"NSDeviceIsPrinter"; NSString *NSDeviceSize = @"NSDeviceSize"; // NSImageRep notifications NSString *NSImageRepRegistryChangedNotification = @"NSImageRepRegistryChangedNotification"; // Pasteboard Type Globals 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 *NSRTFDPboardType = @"NSRTFDPboardType"; NSString *NSTIFFPboardType = @"NSTIFFPboardType"; NSString *NSDataLinkPboardType = @"NSDataLinkPboardType"; NSString *NSGeneralPboardType = @"NSGeneralPboardType"; NSString *NSPDFPboardType = @"NSPDFPboardType"; NSString *NSPICTPboardType = @"NSPICTPboardType"; NSString *NSURLPboardType = @"NSURLPboardType"; NSString *NSHTMLPboardType = @"NSHTMLPboardType"; NSString *NSVCardPboardType = @"NSVCardPboardType"; NSString *NSFilesPromisePboardType = @"NSFilesPromisePboardType"; // Pasteboard Name Globals NSString *NSDragPboard = @"NSDragPboard"; NSString *NSFindPboard = @"NSFindPboard"; NSString *NSFontPboard = @"NSFontPboard"; NSString *NSGeneralPboard = @"NSGeneralPboard"; NSString *NSRulerPboard = @"NSRulerPboard"; // // Pasteboard Exceptions // NSString *NSPasteboardCommunicationException = @"NSPasteboardCommunicationException"; // Printing Information Dictionary Keys NSString *NSPrintAllPages = @"PrintAllPages"; NSString *NSPrintBottomMargin = @"PrintBottomMargin"; NSString *NSPrintCopies = @"PrintCopies"; NSString *NSPrintFaxCoverSheetName = @"PrintFaxCoverSheetName"; NSString *NSPrintFaxHighResolution = @"PrintFaxHighResolution"; NSString *NSPrintFaxModem = @"PrintFaxModem"; NSString *NSPrintFaxReceiverNames = @"PrintFaxReceiverNames"; NSString *NSPrintFaxReceiverNumbers = @"PrintFaxReceiverNumbers"; NSString *NSPrintFaxReturnReceipt = @"PrintFaxReturnReceipt"; NSString *NSPrintFaxSendTime = @"PrintFaxSendTime"; NSString *NSPrintFaxTrimPageEnds = @"PrintFaxTrimPageEnds"; NSString *NSPrintFaxUseCoverSheet = @"PrintFaxUseCoverSheet"; NSString *NSPrintFirstPage = @"PrintFirstPage"; NSString *NSPrintHorizonalPagination = @"PrintHorizonalPagination"; NSString *NSPrintHorizontallyCentered = @"PrintHorizontallyCentered"; NSString *NSPrintJobDisposition = @"PrintJobDisposition"; NSString *NSPrintJobFeatures = @"PrintJobFeatures"; NSString *NSPrintLastPage = @"PrintLastPage"; NSString *NSPrintLeftMargin = @"PrintLeftMargin"; NSString *NSPrintManualFeed = @"PrintManualFeed"; NSString *NSPrintMustCollate = @"PrintMustCollate"; NSString *NSPrintOrientation = @"PrintOrientation"; NSString *NSPrintPagesPerSheet = @"PrintPagesPerSheet"; NSString *NSPrintPaperFeed = @"PrintPaperFeed"; NSString *NSPrintPaperName = @"PrintPaperName"; NSString *NSPrintPaperSize = @"PrintPaperSize"; NSString *NSPrintPrinter = @"PrintPrinter"; NSString *NSPrintReversePageOrder = @"PrintReversePageOrder"; NSString *NSPrintRightMargin = @"PrintRightMargin"; NSString *NSPrintSavePath = @"PrintSavePath"; NSString *NSPrintScalingFactor = @"PrintScalingFactor"; NSString *NSPrintTopMargin = @"PrintTopMargin"; NSString *NSPrintHorizontalPagination = @"PrintHorizontalPagination"; NSString *NSPrintVerticalPagination = @"PrintVerticalPagination"; NSString *NSPrintVerticallyCentered = @"PrintVerticallyCentered"; NSString *NSPrintPagesAcross = @"PrintPagesAcross"; NSString *NSPrintPagesDown = @"PrintPagesDown"; NSString *NSPrintTime = @"PrintTime"; NSString *NSPrintDetailedErrorReporting = @"PrintDetailedErrorReporting"; NSString *NSPrintFaxNumber = @"PrintFaxNumber"; NSString *NSPrintPrinterName = @"PrintPrinterName"; NSString *NSPrintHeaderAndFooter = @"PrintHeaderAndFooter"; NSString *NSPrintPageDirection = @"NSPrintPageDirection"; // Print Job Disposition Values NSString *NSPrintCancelJob = @"PrintCancelJob"; NSString *NSPrintFaxJob = @"PrintFaxJob"; NSString *NSPrintPreviewJob = @"PrintPreviewJob"; NSString *NSPrintSaveJob = @"PrintSaveJob"; NSString *NSPrintSpoolJob = @"PrintSpoolJob"; // Print Panel NSString *NSPrintPanelAccessorySummaryItemNameKey = @"name"; NSString *NSPrintPanelAccessorySummaryItemDescriptionKey = @"description"; NSString *NSPrintPhotoJobStyleHint = @"Photo"; // NSSplitView notifications NSString *NSSplitViewDidResizeSubviewsNotification = @"NSSplitViewDidResizeSubviewsNotification"; NSString *NSSplitViewWillResizeSubviewsNotification = @"NSSplitViewWillResizeSubviewsNotification"; // NSTableView notifications NSString *NSTableViewColumnDidMove = @"NSTableViewColumnDidMoveNotification"; NSString *NSTableViewColumnDidResize = @"NSTableViewColumnDidResizeNotification"; NSString *NSTableViewSelectionDidChange = @"NSTableViewSelectionDidChangeNotification"; NSString *NSTableViewSelectionIsChanging = @"NSTableViewSelectionIsChangingNotification"; // NSText notifications NSString *NSTextDidBeginEditingNotification = @"NSTextDidBeginEditingNotification"; NSString *NSTextDidEndEditingNotification = @"NSTextDidEndEditingNotification"; NSString *NSTextDidChangeNotification = @"NSTextDidChangeNotification"; // NSTextStorage Notifications NSString *NSTextStorageWillProcessEditingNotification = @"NSTextStorageWillProcessEditingNotification"; NSString *NSTextStorageDidProcessEditingNotification = @"NSTextStorageDidProcessEditingNotification"; // NSTextView notifications NSString *NSTextViewDidChangeSelectionNotification = @"NSTextViewDidChangeSelectionNotification"; NSString *NSTextViewWillChangeNotifyingTextViewNotification = @"NSTextViewWillChangeNotifyingTextViewNotification"; NSString *NSTextViewDidChangeTypingAttributesNotification = @"NSTextViewDidChangeTypingAttributesNotification"; // NSView notifications NSString *NSViewFocusDidChangeNotification = @"NSViewFocusDidChangeNotification"; NSString *NSViewFrameDidChangeNotification = @"NSViewFrameDidChangeNotification"; NSString *NSViewBoundsDidChangeNotification = @"NSViewBoundsDidChangeNotification"; NSString *NSViewGlobalFrameDidChangeNotification = @"NSViewGlobalFrameDidChangeNotification"; // NSViewAnimation NSString *NSViewAnimationTargetKey = @"NSViewAnimationTargetKey"; NSString *NSViewAnimationStartFrameKey = @"NSViewAnimationStartFrameKey"; NSString *NSViewAnimationEndFrameKey = @"NSViewAnimationEndFrameKey"; NSString *NSViewAnimationEffectKey = @"NSViewAnimationEffectKey"; NSString *NSViewAnimationFadeInEffect = @"NSViewAnimationFadeInEffect"; NSString *NSViewAnimationFadeOutEffect = @"NSViewAnimationFadeOutEffect"; // NSMenu notifications NSString* const NSMenuDidSendActionNotification = @"MenuDidSendAction"; NSString* const NSMenuWillSendActionNotification = @"MenuWillSendAction"; NSString* const NSMenuDidAddItemNotification = @"MenuDidAddItem"; NSString* const NSMenuDidRemoveItemNotification = @"MenuDidRemoveItem"; NSString* const NSMenuDidChangeItemNotification = @"MenuDidChangeItem"; // NSPopUpButton notification NSString *NSPopUpButtonWillPopUpNotification = @"PopUpButtonWillPopUp"; NSString *NSPopUpButtonCellWillPopUpNotification = @"PopUpButtonCellWillPopUp"; // NSPopover notifications NSString *NSPopoverWillShowNotification = @"NSPopoverWillShowNotification"; NSString *NSPopoverDidShowNotification = @"NSPopoverDidShowNotification"; NSString *NSPopoverWillCloseNotification = @"NSPopoverWillCloseNotification"; NSString *NSPopoverDidCloseNotification = @"NSPopoverDidCloseNotification"; // NSPopover keys NSString *NSPopoverCloseReasonKey = @"NSPopoverCloseReasonKey"; NSString *NSPopoverCloseReasonStandard = @"NSPopoverCloseReasonStandard"; NSString *NSPopoverCloseReasonDetachToWindow = @"NSPopoverCloseReasonDetachToWindow"; // NSTable notifications NSString *NSTableViewSelectionDidChangeNotification = @"TableViewSelectionDidChange"; NSString *NSTableViewColumnDidMoveNotification = @"TableViewColumnDidMove"; NSString *NSTableViewColumnDidResizeNotification = @"TableViewColumnDidResize"; NSString *NSTableViewSelectionIsChangingNotification = @"TableViewSelectionIsChanging"; // NSOutlineView notifications NSString *NSOutlineViewSelectionDidChangeNotification = @"OutlineViewSelectionDidChange"; NSString *NSOutlineViewColumnDidMoveNotification = @"OutlineViewColumnDidMove"; NSString *NSOutlineViewColumnDidResizeNotification = @"OutlineViewColumnDidResize"; NSString *NSOutlineViewSelectionIsChangingNotification = @"OutlineViewSelectionIsChanging"; NSString *NSOutlineViewItemDidExpandNotification = @"OutlineViewItemDidExpand"; NSString *NSOutlineViewItemDidCollapseNotification = @"OutlineViewItemDidCollapse"; NSString *NSOutlineViewItemWillExpandNotification = @"OutlineViewItemWillExpand"; NSString *NSOutlineViewItemWillCollapseNotification = @"OutlineViewItemWillCollapse"; // NSWindow notifications NSString *NSWindowDidBecomeKeyNotification = @"WindowDidBecomeKey"; NSString *NSWindowDidBecomeMainNotification = @"WindowDidBecomeMain"; NSString *NSWindowDidChangeScreenNotification = @"WindowDidChangeScreen"; NSString *NSWindowDidChangeScreenProfileNotification = @"NSWindowDidChangeScreenProfile"; NSString *NSWindowDidDeminiaturizeNotification = @"WindowDidDeminiaturize"; NSString *NSWindowDidEndSheetNotification = @"NSWindowDidEndSheet"; NSString *NSWindowDidExposeNotification = @"WindowDidExpose"; NSString *NSWindowDidMiniaturizeNotification = @"WindowDidMiniaturize"; NSString *NSWindowDidMoveNotification = @"WindowDidMove"; NSString *NSWindowDidResignKeyNotification = @"WindowDidResignKey"; NSString *NSWindowDidResignMainNotification = @"WindowDidResignMain"; NSString *NSWindowDidResizeNotification = @"WindowDidResize"; NSString *NSWindowDidUpdateNotification = @"WindowDidUpdate"; NSString *NSWindowWillBeginSheetNotification = @"NSWindowWillBeginSheet"; NSString *NSWindowWillCloseNotification = @"WindowWillClose"; NSString *NSWindowWillMiniaturizeNotification = @"WindowWillMiniaturize"; NSString *NSWindowWillMoveNotification = @"WindowWillMove"; // Workspace File Type Globals NSString *NSPlainFileType = @"NSPlainFileType"; NSString *NSDirectoryFileType = @"NSDirectoryFileType"; NSString *NSApplicationFileType = @"NSApplicationFileType"; NSString *NSFilesystemFileType = @"NSFilesystemFileType"; NSString *NSShellCommandFileType = @"NSShellCommandFileType"; // Workspace File Operation Globals 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 = @"NSWorkspaceDidLaunchApplicationNotification"; NSString *NSWorkspaceDidMountNotification = @"NSWorkspaceDidMountNotification"; NSString *NSWorkspaceDidPerformFileOperationNotification = @"NSWorkspaceDidPerformFileOperationNotification"; NSString *NSWorkspaceDidTerminateApplicationNotification = @"NSWorkspaceDidTerminateApplicationNotification"; NSString *NSWorkspaceDidUnmountNotification = @"NSWorkspaceDidUnmountNotification"; NSString *NSWorkspaceWillLaunchApplicationNotification = @"NSWorkspaceWillLaunchApplicationNotification"; NSString *NSWorkspaceWillPowerOffNotification = @"NSWorkspaceWillPowerOffNotification"; NSString *NSWorkspaceWillUnmountNotification = @"NSWorkspaceWillUnmountNotification"; NSString *NSWorkspaceDidWakeNotification = @"NSWorkspaceDidWakeNotification"; NSString *NSWorkspaceSessionDidBecomeActiveNotification = @"NSWorkspaceSessionDidBecomeActiveNotification"; NSString *NSWorkspaceSessionDidResignActiveNotification = @"NSWorkspaceSessionDidResignActiveNotification"; NSString *NSWorkspaceWillSleepNotification = @"NSWorkspaceWillSleepNotification"; /* * NSStringDrawing NSAttributedString additions */ NSString *NSAttachmentAttributeName = @"NSAttachmentAttributeName"; NSString *NSBackgroundColorAttributeName = @"NSBackgroundColorAttributeName"; NSString *NSBaselineOffsetAttributeName = @"NSBaselineOffsetAttributeName"; NSString *NSCursorAttributeName = @"NSCursorAttributeName"; NSString *NSExpansionAttributeName = @"NSExpansionAttributeName"; NSString *NSFontAttributeName = @"NSFontAttributeName"; NSString *NSForegroundColorAttributeName = @"NSForegroundColorAttributeName"; NSString *NSKernAttributeName = @"NSKernAttributeName"; NSString *NSLigatureAttributeName = @"NSLigatureAttributeName"; NSString *NSLinkAttributeName = @"NSLinkAttributeName"; NSString *NSObliquenessAttributeName = @"NSObliquenessAttributeName"; NSString *NSParagraphStyleAttributeName = @"NSParagraphStyleAttributeName"; NSString *NSShadowAttributeName = @"NSShadowAttributeName"; NSString *NSStrikethroughColorAttributeName = @"NSStrikethroughColorAttributeName"; NSString *NSStrikethroughStyleAttributeName = @"NSStrikethroughStyleAttributeName"; NSString *NSStrokeColorAttributeName = @"NSStrokeColorAttributeName"; NSString *NSStrokeWidthAttributeName = @"NSStrokeWidthAttributeName"; NSString *NSSuperscriptAttributeName = @"NSSuperscriptAttributeName"; NSString *NSToolTipAttributeName = @"NSToolTipAttributeName"; NSString *NSUnderlineColorAttributeName = @"NSUnderlineColorAttributeName"; NSString *NSUnderlineStyleAttributeName = @"NSUnderlineStyleAttributeName"; NSString *NSCharacterShapeAttributeName = @"CharacterShape"; NSString *NSGlyphInfoAttributeName = @"GlyphInfo"; NSString *NSPaperSizeDocumentAttribute = @"PaperSize"; NSString *NSLeftMarginDocumentAttribute = @"LeftMargin"; NSString *NSRightMarginDocumentAttribute = @"RightMargin"; NSString *NSTopMarginDocumentAttribute = @"TopMargin"; NSString *NSBottomMarginDocumentAttribute = @"BottomMargin"; NSString *NSHyphenationFactorDocumentAttribute = @"HyphenationFactor"; NSString *NSDocumentTypeDocumentAttribute = @"DocumentType"; NSString *NSCharacterEncodingDocumentAttribute = @"CharacterEncoding"; NSString *NSViewSizeDocumentAttribute = @"ViewSize"; NSString *NSViewZoomDocumentAttribute = @"ViewZoom"; NSString *NSViewModeDocumentAttribute = @"ViewMode"; NSString *NSBackgroundColorDocumentAttribute = @"BackgroundColor"; NSString *NSCocoaVersionDocumentAttribute = @"CocoaVersion"; NSString *NSReadOnlyDocumentAttribute = @"ReadOnly"; NSString *NSConvertedDocumentAttribute = @"Converted"; NSString *NSDefaultTabIntervalDocumentAttribute = @"DefaultTabInterval"; NSString *NSTitleDocumentAttribute = @"Title"; NSString *NSCompanyDocumentAttribute = @"Company"; NSString *NSCopyrightDocumentAttribute = @"Copyright"; NSString *NSSubjectDocumentAttribute = @"Subject"; NSString *NSAuthorDocumentAttribute = @"Author"; NSString *NSKeywordsDocumentAttribute = @"Keywords"; NSString *NSCommentDocumentAttribute = @"Comment"; NSString *NSEditorDocumentAttribute = @"Editor"; NSString *NSCreationTimeDocumentAttribute = @"CreationTime"; NSString *NSModificationTimeDocumentAttribute = @"ModificationTime"; const unsigned NSUnderlineByWordMask = 0x01; NSString *NSSpellingStateAttributeName = @"NSSpellingState"; const unsigned NSSpellingStateSpellingFlag = 1; const unsigned NSSpellingStateGrammarFlag = 2; NSString *NSPlainTextDocumentType = @"PlainText"; NSString *NSRTFTextDocumentType = @"RTF"; NSString *NSRTFDTextDocumentType = @"RTFD"; NSString *NSMacSimpleTextDocumentType = @"SimpleText"; NSString *NSHTMLTextDocumentType = @"HTML"; NSString *NSDocFormatTextDocumentType = @"Doc"; NSString *NSWordMLTextDocumentType = @"WordML"; NSString *NSExcludedElementsDocumentAttribute = @"ExcludedElements"; NSString *NSTextEncodingNameDocumentAttribute = @"TextEncoding"; NSString *NSPrefixSpacesDocumentAttribute = @"PrefixSpaces"; NSString *NSBaseURLDocumentOption = @"BaseURL"; NSString *NSCharacterEncodingDocumentOption = @"CharacterEncoding"; NSString *NSDefaultAttributesDocumentOption = @"DefaultAttributes"; NSString *NSDocumentTypeDocumentOption = @"DocumentType"; NSString *NSTextEncodingNameDocumentOption = @"TextEncoding"; NSString *NSTextSizeMultiplierDocumentOption = @"TextSizeMultiplier"; NSString *NSTimeoutDocumentOption = @"Timeout"; NSString *NSWebPreferencesDocumentOption = @"WebPreferences"; NSString *NSWebResourceLoadDelegateDocumentOption = @"WebResourceLoadDelegate"; // NSTextTab NSString *NSTabColumnTerminatorsAttributeName = @"TabColumnTerminatorsAttributeName"; // NSToolbar notifications NSString *NSToolbarDidRemoveItemNotification = @"NSToolbarDidRemoveItemNotification"; NSString *NSToolbarWillAddItemNotification = @"NSToolbarWillAddItemNotification"; // NSToolbarItem constants NSString *NSToolbarSeparatorItemIdentifier = @"NSToolbarSeparatorItemIdentifier"; NSString *NSToolbarSpaceItemIdentifier = @"NSToolbarSpaceItemIdentifier"; NSString *NSToolbarFlexibleSpaceItemIdentifier = @"NSToolbarFlexibleSpaceItemIdentifier"; NSString *NSToolbarShowColorsItemIdentifier = @"NSToolbarShowColorsItemIdentifier"; NSString *NSToolbarShowFontsItemIdentifier = @"NSToolbarShowFontsItemIdentifier"; NSString *NSToolbarCustomizeToolbarItemIdentifier = @"NSToolbarCustomizeToolbarItemIdentifier"; NSString *NSToolbarPrintItemIdentifier = @"NSToolbarPrintItemIdentifier"; /* * NSTextView userInfo for notifications */ NSString *NSOldSelectedCharacterRange = @"NSOldSelectedCharacterRange"; /* NSFont matrix */ const CGFloat NSFontIdentityMatrix[] = {1, 0, 0, 1, 0, 0}; /* Drawing engine externs */ NSString *NSBackendContext = @"NSBackendContext"; typedef int NSWindowDepth; /**** Color function externs ****/ /* Since these are constants it was not possible to do the OR directly. If you change the _GS*BitValue numbers, please remember to change the corresponding depth values */ const NSWindowDepth _GSGrayBitValue = 256; const NSWindowDepth _GSRGBBitValue = 512; const NSWindowDepth _GSCMYKBitValue = 1024; const NSWindowDepth _GSNamedBitValue = 2048; const NSWindowDepth _GSCustomBitValue = 4096; const NSWindowDepth NSDefaultDepth = 0; // GRAY = 256, RGB = 512 const NSWindowDepth NSTwoBitGrayDepth = 258; // 0100000010 GRAY | 2bps const NSWindowDepth NSEightBitGrayDepth = 264; // 0100001000 GRAY | 8bps const NSWindowDepth NSEightBitRGBDepth = 514; // 1000000010 RGB | 2bps const NSWindowDepth NSTwelveBitRGBDepth = 516; // 1000000100 RGB | 4bps const NSWindowDepth GSSixteenBitRGBDepth = 517; // 1000000101 RGB | 5bps GNUstep specific const NSWindowDepth NSTwentyFourBitRGBDepth = 520; // 1000001000 RGB | 8bps const NSWindowDepth _GSWindowDepths[7] = { 258, 264, 514, 516, 517, 520, 0 }; /* End of color functions externs */ // NSKeyValueBinding NSString *NSObservedObjectKey = @"NSObservedObject"; NSString *NSObservedKeyPathKey = @"NSObservedKeyPath"; NSString *NSOptionsKey = @"NSOptions"; NSString *NSAllowsEditingMultipleValuesSelectionBindingOption = @"NSAllowsEditingMultipleValuesSelection"; NSString *NSAllowsNullArgumentBindingOption = @"NSAllowsNullArgument"; NSString *NSConditionallySetsEditableBindingOption = @"NSConditionallySetsEditable"; NSString *NSConditionallySetsEnabledBindingOption = @"NSConditionallySetsEnabled"; NSString *NSConditionallySetsHiddenBindingOption = @"NSConditionallySetsHidden"; NSString *NSContinuouslyUpdatesValueBindingOption = @"NSContinuouslyUpdatesValue"; NSString *NSCreatesSortDescriptorBindingOption = @"NSCreatesSortDescriptor"; NSString *NSDeletesObjectsOnRemoveBindingsOption = @"NSDeletesObjectsOnRemove"; NSString *NSDisplayNameBindingOption = @"NSDisplayName"; NSString *NSDisplayPatternBindingOption = @"NSDisplayPattern"; NSString *NSHandlesContentAsCompoundValueBindingOption = @"NSHandlesContentAsCompoundValue"; NSString *NSInsertsNullPlaceholderBindingOption = @"NSInsertsNullPlaceholder"; NSString *NSInvokesSeparatelyWithArrayObjectsBindingOption = @"NSInvokesSeparatelyWithArrayObjects"; NSString *NSMultipleValuesPlaceholderBindingOption = @"NSMultipleValuesPlaceholder"; NSString *NSNoSelectionPlaceholderBindingOption = @"NSNoSelectionPlaceholder"; NSString *NSNotApplicablePlaceholderBindingOption = @"NSNotApplicablePlaceholder"; NSString *NSNullPlaceholderBindingOption = @"NSNullPlaceholder"; NSString *NSPredicateFormatBindingOption = @"NSPredicateFormat"; NSString *NSRaisesForNotApplicableKeysBindingOption = @"NSRaisesForNotApplicableKeys"; NSString *NSSelectorNameBindingOption = @"NSSelectorName"; NSString *NSSelectsAllWhenSettingContentBindingOption = @"NSSelectsAllWhenSettingContent"; NSString *NSValidatesImmediatelyBindingOption = @"NSValidatesImmediately"; NSString *NSValueTransformerNameBindingOption = @"NSValueTransformerName"; NSString *NSValueTransformerBindingOption = @"NSValueTransformer"; NSString *NSAlignmentBinding = @"alignment"; NSString *NSContentArrayBinding = @"contentArray"; NSString *NSContentBinding = @"content"; NSString *NSContentObjectBinding = @"contentObject"; NSString *NSContentValuesBinding = @"contentValues"; NSString *NSEditableBinding = @"editable"; NSString *NSEnabledBinding = @"enabled"; NSString *NSFontBinding = @"font"; NSString *NSFontNameBinding = @"fontName"; NSString *NSFontSizeBinding = @"fontSize"; NSString *NSHiddenBinding = @"hidden"; NSString *NSSelectedIndexBinding = @"selectedIndex"; NSString *NSSelectedObjectBinding = @"selectedObject"; NSString *NSSelectedTagBinding = @"selectedTag"; NSString *NSSelectionIndexesBinding = @"selectionIndexes"; NSString *NSTextColorBinding = @"textColor"; NSString *NSTitleBinding = @"title"; NSString *NSToolTipBinding = @"toolTip"; NSString *NSValueBinding = @"value"; // FIXME: Need to defined! id NSMultipleValuesMarker = @"NSMultipleValuesMarker"; id NSNoSelectionMarker = @"NSNoSelectionMarker"; id NSNotApplicableMarker = @"NSNotApplicableMarker"; // NSNib NSString *NSNibTopLevelObjects = @"NSTopLevelObjects"; NSString *NSNibOwner = @"NSOwner"; extern void __objc_gui_force_linking (void); void __objc_gui_force_linking (void) { extern void __objc_gui_linking (void); __objc_gui_linking (); } gnustep-gui-0.24.0/Source/NSDocumentController.m0000664000076500007650000013551512011143477021455 0ustar brains99brains99/** NSDocumentController The document controller class Copyright (C) 1999 Free Software Foundation, Inc. Author: Carl Lindberg Date: 1999 Modifications: Fred Kiefer Date: June 2000 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import #import #import #import "AppKit/NSDocumentController.h" #import "AppKit/NSOpenPanel.h" #import "AppKit/NSApplication.h" #import "AppKit/NSKeyValueBinding.h" #import "AppKit/NSMenu.h" #import "AppKit/NSMenuItem.h" #import "AppKit/NSWorkspace.h" #import "NSDocumentFrameworkPrivate.h" #import "GSGuiPrivate.h" #import "GSBindingHelpers.h" static NSString *NSTypesKey = @"NSTypes"; static NSString *NSNameKey = @"NSName"; static NSString *NSRoleKey = @"NSRole"; static NSString *NSHumanReadableNameKey = @"NSHumanReadableName"; static NSString *NSUnixExtensionsKey = @"NSUnixExtensions"; static NSString *NSDOSExtensionsKey = @"NSDOSExtensions"; //static NSString *NSMacOSTypesKey = @"NSMacOSTypes"; //static NSString *NSMIMETypesKey = @"NSMIMETypes"; static NSString *NSDocumentClassKey = @"NSDocumentClass"; static NSString *NSExportableAsKey = @"NSExportableAs"; static NSString *CFBundleDocumentTypes = @"CFBundleDocumentTypes"; static NSString *CFBundleTypeExtensions = @"CFBundleTypeExtensions"; static NSString *CFBundleTypeName = @"CFBundleTypeName"; static NSString *CFBundleTypeRole = @"CFBundleTypeRole"; // FIXME: Looks like this was changed to @"NSRecentDocumentRecords" static NSString *NSRecentDocuments = @"NSRecentDocuments"; static NSString *NSMaximumRecentDocumentCount = @"NSMaximumRecentDocumentCount"; static NSString *NSEditorRole = @"Editor"; static NSString *NSViewerRole = @"Viewer"; //static NSString *NSNoRole = @"None"; //static NSString *NSShellRole = @"Shell"; static NSDocumentController *sharedController = nil; static NSArray *allTypes = nil; static NSArray *classNames = nil; #define TYPE_INFO(name) TypeInfoForName(_types, name) #define HR_TYPE_INFO(name) TypeInfoForHumanReadableName(_types, name) static NSDictionary *TypeInfoForName (NSArray *types, NSString *typeName) { int i, count = [types count]; for (i = 0; i < count; i++) { NSDictionary *dict = [types objectAtIndex: i]; if ([[dict objectForKey: NSNameKey] isEqualToString: typeName]) { return dict; } else if ([[dict objectForKey: CFBundleTypeName] isEqualToString: typeName]) { return dict; } } return nil; } /* static NSDictionary * TypeInfoForHumanReadableName (NSArray *types, NSString *typeName) { int i, count = [types count]; for (i = 0; i < count; i++) { NSDictionary *dict = [types objectAtIndex: i]; if ([[dict objectForKey: NSHumanReadableNameKey] isEqualToString: typeName]) { return dict; } else if ([[dict objectForKey: CFBundleTypeName] isEqualToString: typeName]) { return dict; } } return nil; } */ /**

NSDocumentController is a class that controls a set of NSDocuments for an application. As an application delegate, it responds to the typical File Menu commands for opening and creating new documents, and making sure all documents have been saved when an application quits. It also registers itself for the NSWorkspaceWillPowerOffNotification. Note that NSDocumentController isn't truly the application delegate, but it works in a similar way. You can still have your own application delegate - but beware, if it responds to the same methods as NSDocumentController, your delegate methods will get called, not the NSDocumentController's.

NSDocumentController also manages document types and the related NSDocument subclasses that handle them. This information comes from the custom info property list ({ApplicationName}Info.plist) loaded when NSDocumentController is initialized. The property list contains an array of dictionarys with the key NSTypes. Each dictionary contains a set of keys:

NSDocumentClass - The name of the subclass NSName - Short name of the document type NSHumanReadableName - Longer document type name NSUnixExtensions - Array of strings NSDOSExtensions - Array of strings NSIcon - Icon name for these documents NSRole - Viewer or Editor

You can use NSDocumentController to get a list of all open documents, the current document (The one whose window is Key) and other information about these documents. It also remembers the most recently opened documents (through the user default key NSRecentDocuments). .

You can subclass NSDocumentController to customize the behavior of certain aspects of the class, but it is very rare that you would need to do this.

*/ @implementation NSDocumentController + (void) initialize { static BOOL beenHere = NO; if (beenHere == NO) { NSArray *types; beenHere = YES; types = [[[NSBundle mainBundle] infoDictionary] objectForKey: NSTypesKey]; if (types == nil) { types = [[[NSBundle mainBundle] infoDictionary] objectForKey: CFBundleDocumentTypes]; } if (YES == [types isKindOfClass: [NSArray class]]) { unsigned count = [types count]; unsigned i; unsigned nNames = 0; unsigned nValid = 0; NSString *names[count]; NSDictionary *valid[count]; for (i = 0; i < count; i++) { NSDictionary *d = [types objectAtIndex: i]; if (YES == [d isKindOfClass: [NSDictionary class]]) { NSString *name = [d objectForKey: NSDocumentClassKey]; valid[nValid++] = d; /* Is this type handled by an NSDocument subclass? */ if (YES == [name isKindOfClass: [NSString class]]) { Class c = NSClassFromString(name); if (YES == [c isSubclassOfClass: [NSDocument class]]) { names[nNames++] = name; } else if (c == 0) { NSLog(@"NSDocumentClass %@ not found", name); } else { NSLog(@"NSDocumentClass %@ not NSDocument subclass", name); } } } else { NSLog(@"Bad item at index %u in %@", i, CFBundleDocumentTypes); } } if (nNames > 0) { classNames = [[NSArray alloc] initWithObjects: names count: nNames]; } if (nValid > 0) { allTypes = [[NSArray alloc] initWithObjects: valid count: nValid]; } } [self exposeBinding: @"autosavingDelay"]; } } /** Returns the shared instance of the document controller class. You should always use this method to get the NSDocumentController. */ + (id) sharedDocumentController { if (sharedController == nil) { // -init sets sharedController [[self alloc] init]; } return sharedController; } /**
Initializes the document controller class. The first instance of a document controller class that gets initialized becomes the shared instance. */ - init { _types = RETAIN(allTypes); _documents = [[NSMutableArray alloc] init]; /* Get list of recent documents */ _recent_documents = [[NSUserDefaults standardUserDefaults] objectForKey: NSRecentDocuments]; if (_recent_documents) { int i, count, max; _recent_documents = [_recent_documents mutableCopy]; count = [_recent_documents count]; for (i = 0; i < count; i++) { NSString *str; NSURL *url; str = [_recent_documents objectAtIndex: i]; url = [NSURL URLWithString: str]; if (url == nil) { NSLog(@"NSRecentItems value '%@' is not valid ... ignored", str); [_recent_documents removeObjectAtIndex: i]; i--; count--; } else { [_recent_documents replaceObjectAtIndex: i withObject: url]; } } max = [self maximumRecentDocumentCount]; if (count > max) { [_recent_documents removeObjectsInRange: NSMakeRange(0, count - max)]; } } else _recent_documents = RETAIN([NSMutableArray array]); [self setShouldCreateUI: YES]; [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver: self selector: @selector(_workspaceWillPowerOff:) name: NSWorkspaceWillPowerOffNotification object: nil]; if (sharedController == nil) sharedController = self; return self; } - (void) dealloc { // Remove all key value bindings for this object. [GSKeyValueBinding unbindAllForObject: self]; [[[NSWorkspace sharedWorkspace] notificationCenter] removeObserver: self]; RELEASE (_documents); RELEASE (_recent_documents); RELEASE (_types); RELEASE (_recent_documents_menu); [super dealloc]; } /* * Private helper macro to check, if the method given via the selector sel * has been overridden in the current subclass. */ #define OVERRIDDEN(sel) ([self methodForSelector: @selector(sel)] != [[NSDocumentController class] instanceMethodForSelector: @selector(sel)]) - (BOOL) shouldCreateUI { return _controller_flags.should_create_ui; } - (void) setShouldCreateUI: (BOOL)flag { _controller_flags.should_create_ui = flag; } - (NSTimeInterval) autosavingDelay { return _autosavingDelay; } - (void) setAutosavingDelay: (NSTimeInterval)autosavingDelay { static NSTimer *autosavingTimer = nil; if (autosavingTimer) { [autosavingTimer invalidate]; DESTROY (autosavingTimer); } _autosavingDelay = autosavingDelay; if (autosavingDelay > 0) { autosavingTimer = [NSTimer scheduledTimerWithTimeInterval: autosavingDelay target: self selector: @selector(_autosaveDocuments:) userInfo: nil repeats: YES]; RETAIN (autosavingTimer); } } - (id) makeUntitledDocumentOfType: (NSString *)type { Class documentClass = [self documentClassForType: type]; id document = AUTORELEASE ([[documentClass alloc] init]); [document setFileType: type]; return document; } - (id) makeDocumentWithContentsOfFile: (NSString *)fileName ofType: (NSString *)type { Class documentClass = [self documentClassForType:type]; return AUTORELEASE ([[documentClass alloc] initWithContentsOfFile: fileName ofType: type]); } - (id) makeDocumentWithContentsOfURL: (NSURL *)url ofType: (NSString *)type { Class documentClass = [self documentClassForType: type]; return AUTORELEASE ([[documentClass alloc] initWithContentsOfURL: url ofType: type]); } - (id) makeDocumentForURL: (NSURL *)url withContentsOfURL: (NSURL *)contents ofType: (NSString *)type error: (NSError **)err { Class documentClass = [self documentClassForType: type]; if (documentClass == nil) { // FIXME: Set err return nil; } return AUTORELEASE([[documentClass alloc] initForURL: url withContentsOfURL: contents ofType: type error: err]); } - (id) makeDocumentWithContentsOfURL: (NSURL *)url ofType: (NSString *)type error: (NSError **)err { if (OVERRIDDEN(makeDocumentWithContentsOfFile:ofType:) && [url isFileURL]) { return [self makeDocumentWithContentsOfFile: [url path] ofType: type]; } else { Class documentClass = [self documentClassForType: type]; if (documentClass == nil) { // FIXME: Set err return nil; } return AUTORELEASE([[documentClass alloc] initWithContentsOfURL: url ofType: type error: err]); } } - (id) makeUntitledDocumentOfType: (NSString *)type error: (NSError **)err { if (OVERRIDDEN(makeUntitledDocumentOfType:)) { return [self makeUntitledDocumentOfType: type]; } else { Class documentClass = [self documentClassForType: type]; return AUTORELEASE([[documentClass alloc] initWithType: type error: err]); } } - (BOOL) presentError: (NSError *)err { err = [self willPresentError: err]; return [NSApp presentError: err]; } - (void) presentError: (NSError *)err modalForWindow: (NSWindow *)win delegate: (id)delegate didPresentSelector: (SEL)sel contextInfo: (void *)context { err = [self willPresentError: err]; [NSApp presentError: err modalForWindow: win delegate: delegate didPresentSelector: sel contextInfo: context]; } - (NSError *) willPresentError: (NSError *)err { return err; } - (NSString*) defaultType { NSString *defaultName = nil; int i, count = [_types count]; for (i = 0; i < count; i++) { NSDictionary *typeInfo = (NSDictionary*)[_types objectAtIndex: i]; NSString *role; role = [typeInfo objectForKey: NSRoleKey]; if (role == nil) role = [typeInfo objectForKey: CFBundleTypeRole]; if ([role isEqual: NSEditorRole]) { defaultName = [typeInfo objectForKey: NSNameKey]; if (defaultName == nil) { defaultName = [typeInfo objectForKey: CFBundleTypeName]; } return defaultName; } } // none found return nil; } - (void) addDocument: (NSDocument *)document { [_documents addObject: document]; } - (void) removeDocument: (NSDocument *)document { [_documents removeObject: document]; } - (id) openUntitledDocumentOfType: (NSString*)type display: (BOOL)display { NSDocument *document = [self makeUntitledDocumentOfType: type]; if (document == nil) { return nil; } [self addDocument: document]; if ([self shouldCreateUI]) { [document makeWindowControllers]; if (display) { [document showWindows]; } } return document; } /** * Creates an [NSDocument] object from the data at the absolute path * given in fileName. Causes the document to be displayed if display * is YES, unless the -shouldCreateUI method returns NO. */ - (id) openDocumentWithContentsOfFile: (NSString*)fileName display: (BOOL)display { NSDocument *document = [self documentForFileName: fileName]; if (document == nil) { NSString *type = [self typeFromFileExtension: [fileName pathExtension]]; document = [self makeDocumentWithContentsOfFile: fileName ofType: type]; if (document == nil) { return nil; } [self addDocument: document]; if ([self shouldCreateUI]) { [document makeWindowControllers]; } } // remember this document as opened [self noteNewRecentDocument: document]; if (display && [self shouldCreateUI]) { [document showWindows]; } return document; } /** * Creates an [NSDocument] object from the data at the supplied url.
* Causes the document to be displayed if display * is YES, unless the -shouldCreateUI method returns NO. */ - (id) openDocumentWithContentsOfURL: (NSURL *)url display: (BOOL)display { NSDocument *document = [self documentForURL: url]; if (document == nil) { NSString *type = [self typeForContentsOfURL: url error: NULL]; document = [self makeDocumentWithContentsOfURL: url ofType: type]; if (document == nil) { return nil; } [self addDocument: document]; if ([self shouldCreateUI]) { [document makeWindowControllers]; } } // remember this document as opened [self noteNewRecentDocument: document]; if (display && [self shouldCreateUI]) { [document showWindows]; } return document; } - (id) openUntitledDocumentAndDisplay: (BOOL)flag error: (NSError **)err { NSString *type; type = [self defaultType]; if (OVERRIDDEN(openUntitledDocumentOfType:display:)) { return [self openUntitledDocumentOfType: type display: flag]; } else { NSDocument *document = [self makeUntitledDocumentOfType: type error: err]; if (document == nil) { return nil; } [self addDocument: document]; if ([self shouldCreateUI]) { [document makeWindowControllers]; if (flag) { [document showWindows]; } } return document; } } - (id) openDocumentWithContentsOfURL: (NSURL *)url display: (BOOL)flag error: (NSError **)err { if (OVERRIDDEN(openDocumentWithContentsOfFile:display:) && [url isFileURL]) { return [self openDocumentWithContentsOfFile: [url path] display: flag]; } else { NSDocument *document = [self documentForURL: url]; if (document == nil) { NSString *type = [self typeForContentsOfURL: url error: err]; if (type == nil) { return nil; } document = [self makeDocumentWithContentsOfURL: url ofType: type error: err]; if (document == nil) { return nil; } [self addDocument: document]; if ([self shouldCreateUI]) { [document makeWindowControllers]; } } // remember this document as opened [self noteNewRecentDocument: document]; if (flag && [self shouldCreateUI]) { [document showWindows]; } return document; } } - (BOOL) reopenDocumentForURL: (NSURL *)url withContentsOfURL: (NSURL *)contents error: (NSError **)err { NSString *type = [self typeForContentsOfURL: contents error: err]; id document; if (type == nil) { return NO; } document = [self makeDocumentForURL: url withContentsOfURL: contents ofType: type error: err]; if (document) { [self addDocument:document]; if ([self shouldCreateUI]) { [document makeWindowControllers]; [document showWindows]; } return YES; } return NO; } - (NSOpenPanel *) _setupOpenPanel { NSOpenPanel *openPanel = [NSOpenPanel openPanel]; [openPanel setDirectory: [self currentDirectory]]; [openPanel setAllowsMultipleSelection: YES]; [openPanel setCanChooseFiles: YES]; [openPanel setCanChooseDirectories: NO]; return openPanel; } /** Invokes [NSOpenPanel-runModalForTypes:] with the NSOpenPanel object openPanel, and passes the openableFileExtensions file types */ - (NSInteger) runModalOpenPanel: (NSOpenPanel *)openPanel forTypes: (NSArray *)openableFileExtensions { return [openPanel runModalForTypes: openableFileExtensions]; } - (NSArray *) _openableFileExtensions { int i, count = [_types count]; NSMutableArray *array = [NSMutableArray arrayWithCapacity: count]; for (i = 0; i < count; i++) { NSDictionary *typeInfo = [_types objectAtIndex: i]; [array addObjectsFromArray: [typeInfo objectForKey: NSUnixExtensionsKey]]; [array addObjectsFromArray: [typeInfo objectForKey: NSDOSExtensionsKey]]; [array addObjectsFromArray: [typeInfo objectForKey: CFBundleTypeExtensions]]; } return [array containsObject: @"*"] == NO ? (NSArray *)array : (NSArray *)nil; } /** Uses -runModalOpenPanel:forTypes: to allow the user to select files to open (after initializing the NSOpenPanel). Returns the list of files that the user has selected. */ - (NSArray *) fileNamesFromRunningOpenPanel { NSArray *types = [self _openableFileExtensions]; NSOpenPanel *openPanel = [self _setupOpenPanel]; if ([self runModalOpenPanel: openPanel forTypes: types]) { return [openPanel filenames]; } return nil; } /** Uses -runModalOpenPanel:forTypes: to allow the user to select files to open (after initializing the NSOpenPanel). Returns the list of files as URLs that the user has selected. */ - (NSArray *) URLsFromRunningOpenPanel { NSArray *types = [self _openableFileExtensions]; NSOpenPanel *openPanel = [self _setupOpenPanel]; if ([self runModalOpenPanel: openPanel forTypes: types]) { return [openPanel URLs]; } return nil; } - (IBAction) saveAllDocuments: (id)sender { NSDocument *document; NSEnumerator *docEnum = [_documents objectEnumerator]; while ((document = [docEnum nextObject])) { if ([document isDocumentEdited]) //maybe we should save regardless... { [document saveDocument: sender]; } } } - (IBAction) openDocument: (id)sender { NSError *err = nil; NSEnumerator *urlEnum; NSURL *url; urlEnum = [[self URLsFromRunningOpenPanel] objectEnumerator]; while ((url = [urlEnum nextObject])) { [self openDocumentWithContentsOfURL: url display: YES error: &err]; if (err && ![self presentError: err]) { break; } } } - (IBAction) newDocument: (id)sender { NSError *err = nil; [self openUntitledDocumentAndDisplay: YES error: &err]; if (err) [self presentError: err]; } /** Iterates through all the open documents and asks each one in turn if it can close using [NSDocument-canCloseDocument]. If the document returns YES, then it is closed. */ - (BOOL) closeAllDocuments { int count; count = [_documents count]; if (count > 0) { NSDocument *array[count]; [_documents getObjects: array]; while (count-- > 0) { NSDocument *document = array[count]; if (![document canCloseDocument]) { return NO; } [document close]; } } return YES; } // FIXME static BOOL _shouldClose = YES; - (void) _document: (NSDocument *)doc shouldClose: (BOOL)shouldClose contextInfo: (void *)contextInfo { _shouldClose = shouldClose; } - (void)closeAllDocumentsWithDelegate:(id)delegate didCloseAllSelector:(SEL)didAllCloseSelector contextInfo:(void *)contextInfo { int count; BOOL closeAll = YES; count = [_documents count]; if (count > 0) { NSDocument *array[count]; [_documents getObjects: array]; while (count-- > 0) { NSDocument *document = array[count]; // Initialize to known state _shouldClose = YES; [document canCloseDocumentWithDelegate: self shouldCloseSelector: @selector(_document:shouldClose:contextInfo:) contextInfo: contextInfo]; if (_shouldClose) { [document close]; } else { closeAll = NO; } } } if (delegate != nil && didAllCloseSelector != NULL) { void (*meth)(id, SEL, id, BOOL, void*); meth = (void (*)(id, SEL, id, BOOL, void*))[delegate methodForSelector: didAllCloseSelector]; if (meth) meth(delegate, didAllCloseSelector, self, closeAll, contextInfo); } } /** If there are any unsaved documents, this method displays an alert panel asking if the user wants to review the unsaved documents. If the user agrees to review the documents, this method calls -closeAllDocuments to close each document (prompting to save a document if it is dirty). If cancellable is YES, then the user is not allowed to cancel this request, otherwise this method will return NO if the user presses the Cancel button. Otherwise returns YES after all documents have been closed (or if there are no unsaved documents.) */ - (BOOL) reviewUnsavedDocumentsWithAlertTitle: (NSString *)title cancellable: (BOOL)cancellable { NSString *cancelString = (cancellable)? ((NSString *)_(@"Cancel")) : ((NSString *)nil); int result; if (![self hasEditedDocuments]) { return YES; } result = NSRunAlertPanel(title, _(@"You have unsaved documents"), _(@"Review Unsaved"), cancelString, _(@"Quit Anyway")); #define ReviewUnsaved NSAlertDefaultReturn #define Cancel NSAlertAlternateReturn #define QuitAnyways NSAlertOtherReturn switch (result) { case ReviewUnsaved: return [self closeAllDocuments]; case QuitAnyways: return YES; case Cancel: default: return NO; } } - (void) reviewUnsavedDocumentsWithAlertTitle: (NSString *)title cancellable: (BOOL)cancellable delegate: (id)delegate didReviewAllSelector: (SEL)didReviewAllSelector contextInfo: (void *)contextInfo { NSString *cancelString = (cancellable)? ((NSString *)_(@"Cancel")) : ((NSString *)nil); int result = YES; if (![self hasEditedDocuments]) { if (delegate != nil && didReviewAllSelector != NULL) { void (*meth)(id, SEL, id, BOOL, void*); meth = (void (*)(id, SEL, id, BOOL, void*))[delegate methodForSelector: didReviewAllSelector]; if (meth) meth(delegate, didReviewAllSelector, self, result, contextInfo); } return; } // FIXME NSBeginAlertSheet(title, _(@"Review Unsaved"), cancelString, _(@"Quit Anyway"), nil, delegate, didReviewAllSelector, contextInfo, _(@"You have unsaved documents"), nil); } #ifdef OPENSTEP_ONLY /* * App delegate methods. Apple doesn't have these, but they put code * into NSApplication to call the corresponding NSDocumentController * methods if the app delegate didn't implement a given delegate method. */ - (BOOL) application: (NSApplication *)sender openFile: (NSString *)filename { return [self openDocumentWithContentsOfFile: filename display: YES] ? YES : NO; } - (BOOL) application: (NSApplication *)sender openTempFile: (NSString *)filename { return [self openDocumentWithContentsOfFile: filename display: YES] ? YES : NO; } - (BOOL) applicationOpenUntitledFile: (NSApplication *)sender { return [self openUntitledDocumentOfType: [self defaultType] display: YES] ? YES : NO; } - (BOOL) application: (id)sender openFileWithoutUI: (NSString *)filename { return [self openDocumentWithContentsOfFile: filename display: NO] ? YES : NO; } - (BOOL) applicationShouldTerminate: (NSApplication *)sender { return [self reviewUnsavedDocumentsWithAlertTitle: _(@"Quit") cancellable: YES]; } #endif - (void) _workspaceWillPowerOff: (NSNotification *)notification { [self reviewUnsavedDocumentsWithAlertTitle: _(@"Power Off") cancellable: NO]; } /** Returns an array of all open documents */ - (NSArray *) documents { return _documents; } /** Returns YES if any documents are "dirty", e.g. changes have been made to the document that have not been saved to the disk */ - (BOOL) hasEditedDocuments { int i, count = [_documents count]; for (i = 0; i < count; i++) { if ([[_documents objectAtIndex: i] isDocumentEdited]) { return YES; } } return NO; } /** Returns the document whose window is the main window */ - (id) currentDocument { return [self documentForWindow: [[NSApplication sharedApplication] mainWindow]]; } /** * Returns the current directory. This method first checks if there * is a current document using the -currentDocument method. If this * returns a document and the document has a filename, this method * returns the directory this file is located in. Otherwise it * returns the directory of the most recently opened document or * the user's home directory if no document has been opened before. */ - (NSString *) currentDirectory { NSFileManager *manager = [NSFileManager defaultManager]; NSDocument *document = [self currentDocument]; NSString *directory = nil; BOOL isDir = NO; if (document) { directory = [[document fileName] stringByDeletingLastPathComponent]; } if (directory == nil || [directory isEqual: @""] || [manager fileExistsAtPath: directory isDirectory: &isDir] == NO || isDir == NO) { directory = [[NSOpenPanel openPanel] directory]; } if (directory == nil || [directory isEqual: @""] || [manager fileExistsAtPath: directory isDirectory: &isDir] == NO || isDir == NO) { directory = NSHomeDirectory (); } return directory; } /** Returns the NSDocument class that controls window */ - (id) documentForWindow: (NSWindow *)window { id document; if (window == nil) { return nil; } if (![[window windowController] isKindOfClass: [NSWindowController class]]) { return nil; } document = [[window windowController] document]; if (![document isKindOfClass: [NSDocument class]]) { return nil; } return document; } /** Returns the NSDocument class that controls the document with the name fileName. */ - (id) documentForFileName: (NSString *)fileName { int i, count = [_documents count]; for (i = 0; i < count; i++) { NSDocument *document = [_documents objectAtIndex: i]; if ([[document fileName] isEqualToString: fileName]) { return document; } } return nil; } - (id) documentForURL: (NSURL *)url { if (OVERRIDDEN(documentForFileName:) && [url isFileURL]) { return [self documentForFileName: [url path]]; } else { int i, count = [_documents count]; for (i = 0; i < count; i++) { NSDocument *document = [_documents objectAtIndex: i]; if ([[document fileURL] isEqual: url]) { return document; } } return nil; } } - (BOOL) validateMenuItem: (NSMenuItem *)anItem { return [self validateUserInterfaceItem: anItem]; } - (BOOL) validateUserInterfaceItem: (id )anItem { if (sel_isEqual([anItem action], @selector(saveAllDocuments:))) { return [self hasEditedDocuments]; } if (sel_isEqual([anItem action], @selector(newDocument:))) { return ([self defaultType] != nil); } return YES; } - (NSString *) displayNameForType: (NSString *)type { // FIXME: Is this needed? NSString *name = [TYPE_INFO(type) objectForKey: NSHumanReadableNameKey]; if (!name) { name = [[NSBundle mainBundle] localizedStringForKey: type value: type table: @"InfoPlist"]; } return name ? name : type; } - (NSString *) typeFromFileExtension: (NSString *)fileExtension { int i, count = [_types count]; // Check for a document type with the supplied extension for (i = 0; i < count; i++) { NSDictionary *typeInfo = [_types objectAtIndex: i]; if ([[typeInfo objectForKey: NSUnixExtensionsKey] containsObject: fileExtension] || [[typeInfo objectForKey: NSDOSExtensionsKey] containsObject: fileExtension] || [[typeInfo objectForKey: CFBundleTypeExtensions] containsObject: fileExtension]) { NSString *type = [typeInfo objectForKey: NSNameKey]; if (type == nil) { type = [typeInfo objectForKey: CFBundleTypeName]; } return type; } } // No exact match; check for a document type that supports any extension for (i = 0; i < count; i++) { NSDictionary *typeInfo = [_types objectAtIndex: i]; if ([[typeInfo objectForKey: NSUnixExtensionsKey] containsObject: @"*"] || [[typeInfo objectForKey: NSDOSExtensionsKey] containsObject: @"*"] || [[typeInfo objectForKey: CFBundleTypeExtensions] containsObject: @"*"]) { NSString *type = [typeInfo objectForKey: NSNameKey]; if (type == nil) { type = [typeInfo objectForKey: CFBundleTypeName]; } return type; } } // No luck return nil; } - (NSString *) typeForContentsOfURL: (NSURL *)url error: (NSError **)err { NSString *type = [self typeFromFileExtension: [[url path] pathExtension]]; if ([url isFileURL] == NO && type == nil) { return [self defaultType]; } return type; } - (NSArray *) fileExtensionsFromType: (NSString *)type { NSDictionary *typeInfo = TYPE_INFO(type); NSMutableArray *array = [NSMutableArray arrayWithCapacity: 3]; [array addObjectsFromArray: [typeInfo objectForKey: NSUnixExtensionsKey]]; [array addObjectsFromArray: [typeInfo objectForKey: NSDOSExtensionsKey]]; [array addObjectsFromArray: [typeInfo objectForKey: CFBundleTypeExtensions]]; return array; } - (Class) documentClassForType: (NSString *)type { NSString *className = [TYPE_INFO(type) objectForKey: NSDocumentClassKey]; return className ? NSClassFromString(className) : Nil; } - (NSArray*) documentClassNames { return classNames; } - (IBAction) clearRecentDocuments: (id)sender { [_recent_documents removeAllObjects]; [[NSUserDefaults standardUserDefaults] setObject: _recent_documents forKey: NSRecentDocuments]; [self _updateRecentDocumentsMenu]; } // The number of remembered recent documents - (NSUInteger) maximumRecentDocumentCount { NSUserDefaults *sud = [NSUserDefaults standardUserDefaults]; NSInteger count = 5; if ([sud objectForKey: NSMaximumRecentDocumentCount]) { count = [sud integerForKey: NSMaximumRecentDocumentCount]; if (count < 0) count = 5; } else { count = 5; } return count; } - (void) noteNewRecentDocument: (NSDocument *)aDocument { NSURL *anURL = [aDocument fileURL]; if (anURL != nil) [self noteNewRecentDocumentURL: anURL]; } - (void) noteNewRecentDocumentURL: (NSURL *)anURL { NSUInteger index = [_recent_documents indexOfObject: anURL]; NSMutableArray *a; if (index != NSNotFound) { // Always keep the current object at the end of the list [_recent_documents removeObjectAtIndex: index]; } else if ([_recent_documents count] >= [self maximumRecentDocumentCount]) { [_recent_documents removeObjectAtIndex: 0]; } [_recent_documents addObject: anURL]; // Save the changed list a = [_recent_documents mutableCopy]; index = [a count]; while (index-- > 0) { [a replaceObjectAtIndex: index withObject: [[a objectAtIndex: index] absoluteString]]; } [[NSUserDefaults standardUserDefaults] setObject: a forKey: NSRecentDocuments]; RELEASE(a); [self _updateRecentDocumentsMenu]; } - (NSArray *) recentDocumentURLs { return _recent_documents; } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder*)aCoder { // FIXME } - (id) initWithCoder: (NSCoder*)aDecoder { // FIXME return self; } @end @implementation NSDocumentController (Private) - (NSArray *) _readableTypesForClass: (Class)documentClass { int i, count = [_types count]; NSMutableArray *types = [NSMutableArray arrayWithCapacity: count]; NSString *docClassName = NSStringFromClass (documentClass); for (i = 0; i < count; i++) { NSDictionary *typeInfo = [_types objectAtIndex: i]; NSString *className = [typeInfo objectForKey: NSDocumentClassKey]; NSString *role = [typeInfo objectForKey: NSRoleKey]; // if the standard one isn't filled... check the CF key. if (role == nil) { role = [typeInfo objectForKey: CFBundleTypeRole]; } if ([docClassName isEqualToString: className] && (role == nil || [role isEqual: NSEditorRole] || [role isEqual: NSViewerRole])) { NSString *name = [typeInfo objectForKey: NSNameKey]; if (name == nil) { name = [typeInfo objectForKey: CFBundleTypeName]; } [types addObject: name]; } } return types; } - (NSArray *) _writableTypesForClass: (Class)documentClass { int i, count = [_types count]; NSMutableArray *types = [NSMutableArray arrayWithCapacity: count]; NSString *docClassName = NSStringFromClass (documentClass); for (i = 0; i < count; i++) { NSDictionary *typeInfo = [_types objectAtIndex: i]; NSString *className = [typeInfo objectForKey: NSDocumentClassKey]; NSString *role = [typeInfo objectForKey: NSRoleKey]; NSArray *exportableAs = [typeInfo objectForKey: NSExportableAsKey]; // if the standard one isn't filled... check the CF key. if (role == nil) { role = [typeInfo objectForKey: CFBundleTypeRole]; } if ([docClassName isEqualToString: className] && (role == nil || [role isEqual: NSEditorRole])) { NSString *name = [typeInfo objectForKey: NSNameKey]; if (name == nil) { name = [typeInfo objectForKey: CFBundleTypeName]; } [types addObject: name]; } if ([exportableAs isKindOfClass: [NSArray class]]) { int i, count = [exportableAs count]; NSString *name; for (i = 0; i < count; i++) { name = [exportableAs objectAtIndex: i]; if ([name isKindOfClass: [NSString class]]) [types addObject: name]; } } } return types; } static NSMapTable *autosavedDocuments = NULL; static NSString *processName = nil; - (NSString *) _autosaveDirectory: (BOOL)create { NSArray *paths = NSSearchPathForDirectoriesInDomains (NSLibraryDirectory, NSUserDomainMask, YES); NSString *path = [paths objectAtIndex:0]; path = [path stringByAppendingPathComponent: @"Autosave"]; if (create) { BOOL isDir; NSFileManager *fm = [NSFileManager defaultManager]; if ([fm fileExistsAtPath: path isDirectory: &isDir] == NO) { if (![fm createDirectoryAtPath: path withIntermediateDirectories: YES attributes: nil error: NULL]) { return nil; } } else if (isDir == NO) { if (![fm removeFileAtPath: path handler: nil] || ![fm createDirectoryAtPath: path withIntermediateDirectories: YES attributes: nil error: NULL]) { return nil; } } } return path; } - (void) _autosaveDocuments: (NSTimer *)timer { id document; int i, n = [_documents count]; for (i = 0; i < n; i++) { document = [_documents objectAtIndex: i]; if ([document autosavingFileType] && [document hasUnautosavedChanges]) { [document autosaveDocumentWithDelegate: nil didAutosaveSelector: NULL contextInfo: NULL]; } } } - (BOOL) _reopenAutosavedDocuments { BOOL didOpen = NO; if (!autosavedDocuments) { NSArray *autosaved; NSString *path; autosavedDocuments = NSCreateMapTable (NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 1); if (!processName) processName = [[[NSProcessInfo processInfo] processName] copy]; path = [self _autosaveDirectory: NO]; path = [path stringByAppendingPathComponent: processName]; path = [path stringByAppendingPathExtension: @"plist"]; autosaved = [NSArray arrayWithContentsOfFile: path]; if (autosaved) { int i, n = [autosaved count]; NSFileManager *fm = [NSFileManager defaultManager]; for (i = 0; i < n; i++) { NSDictionary *dict = [autosaved objectAtIndex: i]; NSString *location = [dict objectForKey: @"Location"]; NSString *autosavedLoc = [dict objectForKey: @"AutosavedLocation"]; NSURL *url = location ? [NSURL URLWithString: location] : nil; NSURL *autosavedURL = autosavedLoc ? [NSURL URLWithString: autosavedLoc] : nil; if (autosavedURL && [fm fileExistsAtPath: [autosavedURL path]]) { NSError *err; if ([self reopenDocumentForURL: url withContentsOfURL: autosavedURL error: &err]) didOpen = YES; } } } } return didOpen; } - (void) _recordAutosavedDocument: (NSDocument *)document { BOOL changed = NO; NSURL *url = [document autosavedContentsFileURL]; if (!autosavedDocuments) autosavedDocuments = NSCreateMapTable (NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 1); if (url) { NSMutableDictionary *dict = [[NSMutableDictionary alloc] init]; if ([document fileURL]) [dict setObject: [document fileURL] forKey: @"Location"]; [dict setObject: url forKey: @"AutosavedLocation"]; NSMapInsert (autosavedDocuments, document, dict); [dict release]; changed = YES; } else if (NSMapGet (autosavedDocuments, document)) { NSMapRemove (autosavedDocuments, document); changed = YES; } if (changed) { NSString *path = [self _autosaveDirectory: YES]; NSArray *autosaved = NSAllMapTableValues (autosavedDocuments); NSFileManager *fm = [NSFileManager defaultManager]; if (!processName) processName = [[[NSProcessInfo processInfo] processName] copy]; path = [path stringByAppendingPathComponent: processName]; path = [path stringByAppendingPathExtension: @"plist"]; if ([autosaved count] == 0) { [fm removeFileAtPath: path handler: nil]; } else { [autosaved writeToFile: path atomically:YES]; } } } @end @implementation NSDocumentController (RecentDocumentsMenu) - (NSMenu *) _recentDocumentsMenu { return _recent_documents_menu; } - (void) _setRecentDocumentsMenu: (NSMenu *)aMenu { ASSIGN(_recent_documents_menu, aMenu); [self _updateRecentDocumentsMenu]; } // should be handled by making us the delegate of the recent's menu - (void) _updateRecentDocumentsMenu { NSMenu *recentMenu; int i; recentMenu = [self _recentDocumentsMenu]; if (!recentMenu) { return; } // don't update (to keep Clear List status consistent) [recentMenu setAutoenablesItems: NO]; [recentMenu setMenuChangedMessagesEnabled: NO]; while ([recentMenu numberOfItems] > 0) { [recentMenu removeItemAtIndex: 0]; // remove them all } for (i = [_recent_documents count] - 1; i >= -2; i--) { // add all items incl. a Clear List item if needed NSMenuItem *item; if (i == -1) { if ([_recent_documents count] == 0) continue; // skip if menu is empty item = (NSMenuItem *) [NSMenuItem separatorItem]; // will release... RETAIN(item); } else if (i == -2) { item = [[NSMenuItem alloc] initWithTitle: _(@"Clear List") action: @selector(clearRecentDocuments:) keyEquivalent: nil]; // disable for empty list [item setEnabled: [_recent_documents count] > 0]; } else { // standard item NSURL *u = [_recent_documents objectAtIndex: i]; // get URL if ([u isFileURL]) item = [[NSMenuItem alloc] initWithTitle: [[u path] lastPathComponent] action: @selector(_openRecentDocument:) keyEquivalent:nil]; else item = [[NSMenuItem alloc] initWithTitle: [u relativeString] action: @selector(_openRecentDocument:) keyEquivalent:nil]; [item setTag: i]; } [item setTarget: self]; [recentMenu addItem: item]; RELEASE(item); } [recentMenu setMenuChangedMessagesEnabled: YES]; } - (IBAction) _openRecentDocument: (id)sender { // action to open recent document by tag index NSURL *url; int idx = [sender tag]; NSError *err = nil; if (idx < 0 || idx >= [_recent_documents count]) { // something went wrong, ignore [self _updateRecentDocumentsMenu]; return; } url = (NSURL *)[_recent_documents objectAtIndex: idx]; if ([url isFileURL]) { /* From Apple's documentation of the -noteNewRecentDocumentURL: method: "Applications not based on NSDocument must also implement the application:openFile: method in the application delegate to handle requests from the Open Recent menu command." */ id appDelegate = [NSApp delegate]; if ([appDelegate respondsToSelector: @selector(application:openFile:)]) { if ([appDelegate application: NSApp openFile: [url path]]) return; } } [self openDocumentWithContentsOfURL: url display: YES error: &err]; if (err) [self presentError: err]; } @end gnustep-gui-0.24.0/Source/GSTrackingRect.m0000664000076500007650000000551011534147002020170 0ustar brains99brains99/* GSTrackingRect.m Tracking rectangle class Copyright (C) 1996,1999 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import "GNUstepGUI/GSTrackingRect.h" @implementation GSTrackingRect /* * Class methods */ + (void) initialize { if (self == [GSTrackingRect class]) { [self setVersion: 1]; } } - (id) initWithRect: (NSRect)aRect tag: (NSTrackingRectTag)aTag owner: (id)anObject userData: (void *)theData inside: (BOOL)flag { rectangle = aRect; tag = aTag; owner = anObject; user_data = theData; flags.inside = flag; flags.isValid = YES; return self; } - (void) dealloc { [super dealloc]; } - (NSRect) rectangle { return rectangle; } - (void) reset: (NSRect)aRect inside: (BOOL)flag { rectangle = aRect; flags.inside = flag; flags.isValid = YES; flags.checked = NO; } - (NSTrackingRectTag) tag { return tag; } - (id) owner { return owner; } - (void *) userData { return user_data; } - (BOOL) inside { return flags.inside; } - (BOOL) isValid { return flags.isValid; } - (void) invalidate { if (flags.isValid) { flags.isValid = NO; flags.checked = NO; } } /* * NSCoding protocol */ - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding] == NO) { BOOL inside = flags.inside; [aCoder encodeRect: rectangle]; [aCoder encodeValueOfObjCType: @encode(NSTrackingRectTag) at: &tag]; [aCoder encodeObject: owner]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &inside]; } } - (id) initWithCoder: (NSCoder*)aDecoder { if ([aDecoder allowsKeyedCoding] == NO) { BOOL inside; rectangle = [aDecoder decodeRect]; [aDecoder decodeValueOfObjCType: @encode(NSTrackingRectTag) at: &tag]; owner = [aDecoder decodeObject]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &inside]; flags.inside = inside; } return self; } @end gnustep-gui-0.24.0/Source/NSClipView.m0000664000076500007650000005405112251077461017355 0ustar brains99brains99/** NSClipView Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: July 1997 Author: Richard Frith-Macdonald Date: January 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import #import "AppKit/NSClipView.h" #import "AppKit/NSCursor.h" #import "AppKit/NSColor.h" #import "AppKit/NSEvent.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSTableView.h" #import "AppKit/NSWindow.h" #import "AppKit/PSOperators.h" #import #import "GSGuiPrivate.h" #include @interface NSClipView (Private) - (void) _scrollToPoint: (NSPoint)aPoint; @end /* * Return the biggest integral (in device space) rect contained in rect. * Conversion to/from device space is done using view. * */ static inline NSRect integralRect (NSRect rect, NSView *view) { NSRect output; int rounded; output = [view convertRect: rect toView: nil]; rounded = (int)(output.origin.x); if ((CGFloat)rounded != output.origin.x) { output.origin.x = rounded + 1; } rounded = (int)(output.origin.y); if ((CGFloat)rounded != output.origin.y) { output.origin.y = rounded + 1; } rounded = (int)(NSMaxX (output)); if ((CGFloat)rounded != NSMaxX (output)) { output.size.width = rounded - output.origin.x; } rounded = (int)(NSMaxY (output)); if ((CGFloat)rounded != NSMaxY (output)) { output.size.height = rounded - output.origin.y; } return [view convertRect: output fromView: nil]; } /* Note that the ivar _documentView is really just a convienience variable. The actual document view is stored in NSClipView's subview array. Deallocation, coding, etc of the view is then handled by NSView */ @implementation NSClipView - (id) initWithFrame: (NSRect)frameRect { self = [super initWithFrame:frameRect]; if (self) { [self setAutoresizesSubviews: YES]; [self setBackgroundColor: [NSColor controlBackgroundColor]]; _copiesOnScroll = YES; _drawsBackground = YES; } return self; } - (void) dealloc { [self setDocumentView: nil]; RELEASE(_cursor); RELEASE(_backgroundColor); [super dealloc]; } /**

Sets aView the NSClipView's document view to aView

See Also: -documentView

*/ - (void) setDocumentView: (NSView*)aView { NSNotificationCenter *nc; NSView *nextKV; if (_documentView == aView) { return; } nc = [NSNotificationCenter defaultCenter]; if (_documentView) { nextKV = [_documentView nextKeyView]; if ([nextKV isDescendantOf: _documentView]) { nextKV = nil; } [nc removeObserver: self name: NSViewFrameDidChangeNotification object: _documentView]; [nc removeObserver: self name: NSViewBoundsDidChangeNotification object: _documentView]; /* if our documentView was a tableview, unregister its * observers */ if ([_documentView isKindOfClass: [NSTableView class]]) { [nc removeObserver: _documentView name: NSViewFrameDidChangeNotification object: self]; } [_documentView removeFromSuperview]; } else { nextKV = [self nextKeyView]; } /* Don't retain this since it's stored in our subviews. */ _documentView = aView; /* Update the view hierarchy coordinates if -isFlipped has changed. Call this before doing anything else! */ [self _invalidateCoordinates]; if (_documentView) { NSRect df; [self addSubview: _documentView]; df = [_documentView frame]; [self setBoundsOrigin: df.origin]; /* Register for notifications sent by the document view */ [_documentView setPostsFrameChangedNotifications: YES]; [_documentView setPostsBoundsChangedNotifications: YES]; [nc addObserver: self selector: @selector(viewFrameChanged:) name: NSViewFrameDidChangeNotification object: _documentView]; [nc addObserver: self selector: @selector(viewBoundsChanged:) name: NSViewBoundsDidChangeNotification object: _documentView]; /* * if our document view is a tableview, let it know * when we resize */ if ([_documentView isKindOfClass: [NSTableView class]]) { [self setPostsFrameChangedNotifications: YES]; [nc addObserver: _documentView selector: @selector(superviewFrameChanged:) name: NSViewFrameDidChangeNotification object: self]; } [self setNextKeyView: _documentView]; if (![_documentView nextKeyView]) [_documentView setNextKeyView: nextKV]; } else [self setNextKeyView: nextKV]; [_super_view reflectScrolledClipView: self]; } - (void) resetCursorRects { [self addCursorRect: _bounds cursor: _cursor]; } - (void) scrollToPoint: (NSPoint)aPoint { [self setBoundsOrigin: [self constrainScrollPoint: aPoint]]; [self resetCursorRects]; } - (void) setBounds: (NSRect)b { [super setBounds: b]; [self setNeedsDisplay: YES]; [_super_view reflectScrolledClipView: self]; } - (void) setBoundsSize: (NSSize)aSize { [super setBoundsSize: aSize]; [self setNeedsDisplay: YES]; [_super_view reflectScrolledClipView: self]; } - (void) setBoundsOrigin: (NSPoint)aPoint { NSRect originalBounds = _bounds; NSRect newBounds = originalBounds; NSRect intersection; newBounds.origin = aPoint; if (NSEqualPoints(originalBounds.origin, newBounds.origin)) { return; } if (_documentView == nil) { return; } if (_copiesOnScroll && _window && [_window gState]) { /* Copy the portion of the view that is common before and after scrolling. Then, document view needs to redraw the remaining areas. */ /* Common part - which is a first approx of what we could copy... */ intersection = NSIntersectionRect (originalBounds, newBounds); /* but we must make sure we only copy from visible rect - we can't copy bits which have been clipped (ie discarded) */ intersection = NSIntersectionRect (intersection, [self visibleRect]); /* Copying is done in device space so we only can copy by integral rects in device space - adjust our copy rect */ intersection = integralRect (intersection, self); /* At this point, intersection is the rectangle containing the image we can recycle from the old to the new situation. We must not make any assumption on its position/size, because it has been intersected with visible rect, which is an arbitrary rectangle as far as we know. */ if (NSEqualRects (intersection, NSZeroRect)) { // no recyclable part -- docview should redraw everything // from scratch [super setBoundsOrigin: newBounds.origin]; [_documentView setNeedsDisplayInRect: [self documentVisibleRect]]; } else { /* It is assumed these dx and dy will be integer in device space because they are the difference of the bounds origins, both of which should be integers in device space because of the code at the end of constrainScrollPoint:. */ CGFloat dx = newBounds.origin.x - originalBounds.origin.x; CGFloat dy = newBounds.origin.y - originalBounds.origin.y; NSRect redrawRect; /* Copy the intersection to the new position */ [self scrollRect: intersection by: NSMakeSize(-dx, -dy)]; /* Change coordinate system to the new one */ [super setBoundsOrigin: newBounds.origin]; /* Get the rectangle representing intersection in the new bounds (mainly to keep code readable) */ intersection.origin.x -= dx; intersection.origin.y -= dy; // intersection.size is the same /* Now mark everything which is outside intersection as needing to be redrawn by hand. NB: During simple usage - scrolling in a single direction (left/rigth/up/down) - and a normal visible rect, only one of the following rects will be non-empty. */ /* To the left of intersection */ redrawRect = NSMakeRect(NSMinX(_bounds), _bounds.origin.y, NSMinX(intersection) - NSMinX(_bounds), _bounds.size.height); if (NSIsEmptyRect(redrawRect) == NO) { [_documentView setNeedsDisplayInRect: [self convertRect: redrawRect toView: _documentView]]; } /* Right */ redrawRect = NSMakeRect(NSMaxX(intersection), _bounds.origin.y, NSMaxX(_bounds) - NSMaxX(intersection), _bounds.size.height); if (NSIsEmptyRect(redrawRect) == NO) { [_documentView setNeedsDisplayInRect: [self convertRect: redrawRect toView: _documentView]]; } /* Up (or Down according to whether it's flipped or not) */ redrawRect = NSMakeRect(_bounds.origin.x, NSMinY(_bounds), _bounds.size.width, NSMinY(intersection) - NSMinY(_bounds)); if (NSIsEmptyRect(redrawRect) == NO) { [_documentView setNeedsDisplayInRect: [self convertRect: redrawRect toView: _documentView]]; } /* Down (or Up) */ redrawRect = NSMakeRect(_bounds.origin.x, NSMaxY(intersection), _bounds.size.width, NSMaxY(_bounds) - NSMaxY(intersection)); if (NSIsEmptyRect(redrawRect) == NO) { [_documentView setNeedsDisplayInRect: [self convertRect: redrawRect toView: _documentView]]; } } } else { // dont copy anything -- docview draws it all [super setBoundsOrigin: newBounds.origin]; [_documentView setNeedsDisplayInRect: [self documentVisibleRect]]; } /* ?? TODO: Understand the following code - and add explanatory comment */ /*if ([NSView focusView] == _documentView) { PStranslate (NSMinX (originalBounds) - aPoint.x, NSMinY (originalBounds) - aPoint.y); }*/ [_super_view reflectScrolledClipView: self]; } /** *

*/ - (NSPoint) constrainScrollPoint: (NSPoint)proposedNewOrigin { NSRect documentFrame; NSPoint new = proposedNewOrigin; if (_documentView == nil) { return _bounds.origin; } documentFrame = [_documentView frame]; if (documentFrame.size.width <= _bounds.size.width) { new.x = documentFrame.origin.x; } else if (proposedNewOrigin.x <= documentFrame.origin.x) { new.x = documentFrame.origin.x; } else if (proposedNewOrigin.x + _bounds.size.width >= NSMaxX(documentFrame)) { new.x = NSMaxX(documentFrame) - _bounds.size.width; } if (documentFrame.size.height <= _bounds.size.height) { new.y = documentFrame.origin.y; } else if (proposedNewOrigin.y <= documentFrame.origin.y) { new.y = documentFrame.origin.y; } else if (proposedNewOrigin.y + _bounds.size.height >= NSMaxY(documentFrame)) { new.y = NSMaxY(documentFrame) - _bounds.size.height; } /* Make it an integer coordinate in device space - this is to make sure that when the coordinates are changed and we need to copy to do the scrolling, the difference is an integer and so we can copy the image translating it by an integer in device space - and not by a float. */ new = [self convertPoint: new toView: nil]; new.x = GSRoundTowardsInfinity(new.x); new.y = GSRoundTowardsInfinity(new.y); new = [self convertPoint: new fromView: nil]; return new; } /**

Returns the document rectangle.

See Also: -documentVisibleRect

*/ - (NSRect) documentRect { NSRect documentFrame; NSRect clipViewBounds; NSRect rect; if (_documentView == nil) { return _bounds; } documentFrame = [_documentView frame]; clipViewBounds = _bounds; rect.origin = documentFrame.origin; rect.size.width = MAX(documentFrame.size.width, clipViewBounds.size.width); rect.size.height = MAX(documentFrame.size.height, clipViewBounds.size.height); return rect; } /**

Returns the document visible rectangle in the document views coordinate * system. *

*

See Also: -documentRect [NSView-convertRect:toView:]

*/ - (NSRect) documentVisibleRect { return [self convertRect: _bounds toView:_documentView]; } - (void) drawRect: (NSRect)rect { if (_drawsBackground) { [_backgroundColor set]; NSRectFill(rect); } } /**

Scrolls in response to mouse-dragged events.

*/ - (BOOL) autoscroll: (NSEvent*)theEvent { NSPoint new; NSPoint delta; NSRect r; if (_documentView == nil) { return NO; } new = [_documentView convertPoint: [theEvent locationInWindow] fromView: nil]; r = [self documentVisibleRect]; if (new.x < NSMinX(r)) delta.x = new.x - NSMinX(r); else if (new.x > NSMaxX(r)) delta.x = new.x - NSMaxX(r); else delta.x = 0; if (new.y < NSMinY(r)) delta.y = new.y - NSMinY(r); else if (new.y > NSMaxY(r)) delta.y = new.y - NSMaxY(r); else delta.y = 0; new.x = _bounds.origin.x + delta.x; new.y = _bounds.origin.y + delta.y; new = [self constrainScrollPoint: new]; if (NSEqualPoints(new, _bounds.origin)) return NO; [self setBoundsOrigin: new]; return YES; } - (void) viewBoundsChanged: (NSNotification*)aNotification { [_super_view reflectScrolledClipView: self]; } /**

Used when the document view frame notify its change. ( with NSViewFrameDidChangeNotification )

*/ - (void) viewFrameChanged: (NSNotification*)aNotification { [self _scrollToPoint: _bounds.origin]; /* If document frame does not completely cover _bounds */ if (NSContainsRect([_documentView frame], _bounds) == NO) { /* * fill the area not covered by documentView with background color */ [self setNeedsDisplay: YES]; } [_super_view reflectScrolledClipView: self]; } - (void) scaleUnitSquareToSize: (NSSize)newUnitSize { [super scaleUnitSquareToSize: newUnitSize]; [_super_view reflectScrolledClipView: self]; } - (void) setFrameSize: (NSSize)aSize { [super setFrameSize: aSize]; [self setBoundsOrigin: [self constrainScrollPoint: _bounds.origin]]; [_super_view reflectScrolledClipView: self]; } - (void) setFrameOrigin: (NSPoint)aPoint { [super setFrameOrigin: aPoint]; [self setBoundsOrigin: [self constrainScrollPoint: _bounds.origin]]; [_super_view reflectScrolledClipView: self]; } - (void) setFrame: (NSRect)rect { [super setFrame: rect]; [self setBoundsOrigin: [self constrainScrollPoint: _bounds.origin]]; [_super_view reflectScrolledClipView: self]; } - (void) translateOriginToPoint: (NSPoint)aPoint { [super translateOriginToPoint: aPoint]; [_super_view reflectScrolledClipView: self]; } /** *

Returns the NSClipView's document view.

*

See Also: -setDocumentView:

*/ - (id) documentView { return _documentView; } /** */ - (void) setCopiesOnScroll: (BOOL)flag { _copiesOnScroll = flag; } /** */ - (BOOL) copiesOnScroll { return _copiesOnScroll; } /**

Sets the cursor for the document view to aCursor

See Also: -documentCursor

*/ - (void) setDocumentCursor: (NSCursor*)aCursor { ASSIGN(_cursor, aCursor); } /**

Returns the cursor of the document view

See Also: -setDocumentCursor:

*/ - (NSCursor*) documentCursor { return _cursor; } /**

Returns the NSClipView's background color

See Also: -setBackgroundColor:

*/ - (NSColor*) backgroundColor { return _backgroundColor; } /**

Sets the NSClipView's background color to aColor and marks self for display. Sets the opaque flag if needed ( to YES if the NSClipView does not draw its background, if the background color is nil or if the background color alpha component is less than 1.0 , NO otherwise)

See Also: -backgroundColor [NSView-isOpaque]

*/ - (void) setBackgroundColor: (NSColor*)aColor { if (![_backgroundColor isEqual: aColor]) { ASSIGN (_backgroundColor, aColor); [self setNeedsDisplay: YES]; if (_drawsBackground == NO || _backgroundColor == nil || [_backgroundColor alphaComponent] < 1.0) { _isOpaque = NO; } else { _isOpaque = YES; } } } - (void) setDrawsBackground: (BOOL)flag { if (_drawsBackground != flag) { _drawsBackground = flag; [self setNeedsDisplay: YES]; if (_drawsBackground == NO || _backgroundColor == nil || [_backgroundColor alphaComponent] < 1.0) { _isOpaque = NO; } else { _isOpaque = YES; } } } - (BOOL) drawsBackground { return _drawsBackground; } - (BOOL) isOpaque { return _isOpaque; } - (BOOL) isFlipped { return (_documentView != nil) ? [_documentView isFlipped] : NO; } /* Disable rotation of clip view */ - (void) rotateByAngle: (CGFloat)angle { } - (void) setBoundsRotation: (CGFloat)angle { } - (void) setFrameRotation: (CGFloat)angle { } /* Managing responder chain */ - (BOOL) acceptsFirstResponder { if (_documentView == nil) { return NO; } else { return [_documentView acceptsFirstResponder]; } } - (BOOL) becomeFirstResponder { if (_documentView == nil) { return NO; } else { return [_window makeFirstResponder: _documentView]; } } - (void) setNextKeyView: (NSView *)aView { if (_documentView && aView != _documentView) [_documentView setNextKeyView: aView]; else [super setNextKeyView: aView]; } /* * NSCoding protocol */ - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { unsigned int flags = 0; [aCoder encodeObject: [self backgroundColor] forKey: @"NSBGColor"]; [aCoder encodeObject: [self documentCursor] forKey: @"NSCursor"]; [aCoder encodeObject: [self documentView] forKey: @"NSDocView"]; if ([self drawsBackground]) flags |= 4; if ([self copiesOnScroll] == NO) flags |= 2; [aCoder encodeInt: flags forKey: @"NScvFlags"]; } else { [aCoder encodeObject: _backgroundColor]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_copiesOnScroll]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_drawsBackground]; [aCoder encodeObject: _cursor]; } } - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if (self == nil) { return nil; } if ([aDecoder allowsKeyedCoding]) { [self setAutoresizesSubviews: YES]; [self setBackgroundColor: [aDecoder decodeObjectForKey: @"NSBGColor"]]; [self setDocumentCursor: [aDecoder decodeObjectForKey: @"NSCursor"]]; if ([aDecoder containsValueForKey: @"NScvFlags"]) { int flags = [aDecoder decodeIntForKey: @"NScvFlags"]; BOOL drawsBackground = ((4 & flags) > 0); BOOL noCopyOnScroll = ((2 & flags) > 0); // ??? Not sure... [self setCopiesOnScroll: (noCopyOnScroll == NO)]; [self setDrawsBackground: drawsBackground]; } if ([[self subviews] count] > 0) { NSRect rect; id document = [aDecoder decodeObjectForKey: @"NSDocView"]; NSAssert([document class] != [NSCustomView class], NSInvalidArgumentException); rect = [document frame]; rect.origin = NSZeroPoint; [document setFrame: rect]; RETAIN(document); // prevent it from being released. [document removeFromSuperview]; [self setDocumentView: document]; RELEASE(document); } } else { BOOL temp; [self setAutoresizesSubviews: YES]; [self setBackgroundColor: [aDecoder decodeObject]]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_copiesOnScroll]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &temp]; [self setDrawsBackground: temp]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_cursor]; if ([[self subviews] count] > 0) { NSView *document = [[self subviews] objectAtIndex: 0]; RETAIN(document); // prevent it from being released. [document removeFromSuperview]; [self setDocumentView: document]; RELEASE(document); } } return self; } @end @implementation NSClipView (Private) - (void) _scrollToPoint: (NSPoint)aPoint { NSRect proposedBounds; NSRect proposedVisibleRect; NSRect newVisibleRect; NSRect newBounds; // give documentView a chance to adjust its visible rectangle proposedBounds = _bounds; proposedBounds.origin = aPoint; proposedVisibleRect = [self convertRect: proposedBounds toView: _documentView]; newVisibleRect = [_documentView adjustScroll: proposedVisibleRect]; newBounds = [self convertRect: newVisibleRect fromView: _documentView]; [self scrollToPoint: newBounds.origin]; } @end gnustep-gui-0.24.0/Source/GSThemePrivate.h0000664000076500007650000001675012227420270020211 0ustar brains99brains99/** GSThemePrivate Private utilities for GSTheme Copyright (C) 2007,2008 Free Software Foundation, Inc. Author: Richard Frith-Macdonald Date: 2007,2008 This file is part of the GNU Objective C User interface library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _INCLUDED_GSTHEMEPRIVATE_H #define _INCLUDED_GSTHEMEPRIVATE_H #import #import "AppKit/NSPanel.h" #import "AppKit/NSButtonCell.h" #import "AppKit/NSSegmentedControl.h" #import "GNUstepGUI/GSTheme.h" @class NSImage, NSMatrix, NSScrollView, NSView; NSString *GSStringFromSegmentStyle(NSSegmentStyle segmentStyle); NSString *GSStringFromBezelStyle(NSBezelStyle bezelStyle); NSString *GSStringFromBorderType(NSBorderType borderType); NSString *GSStringFromTabViewType(NSTabViewType type); NSString *GSStringFromImageFrameStyle(NSImageFrameStyle type); /** These are the nine types of tile used to draw a rectangular object. */ typedef enum { TileTL = 0, /** Top left corner */ TileTM = 1, /** Top middle section */ TileTR = 2, /** Top right corner */ TileCL = 3, /** Centerj left corner */ TileCM = 4, /** Centerj middle section */ TileCR = 5, /** Centerj right corner */ TileBL = 6, /** Bottom left corner */ TileBM = 7, /** Bottom middle section */ TileBR = 8 /** Bottom right corner */ } GSThemeTileOffset; /** This is a trivial class to hold the nine tiles needed to draw a rectangle */ @interface GSDrawTiles : NSObject { @public NSImage *images[9]; /** The tile images */ NSRect rects[9]; /** The rectangles to use when drawing */ NSRect contentRect; /** Rectangle in which content should be * drawn, normally rects[TileCM], but can * be customized in the nine-patch format */ NSRect layoutRect; NSRect originalRectCM; /** Caches rects[TileCM] as it was before * -validateTilesSizeWithImage clears the * origin. Used by -themeMargins */ float scaleFactor; GSThemeFillStyle style; /** The default style for filling a rect */ } - (id) copyWithZone: (NSZone*)zone; /* Initialise with a single image, using 'annotations' to determinate * where the tiles are in the image, in the form of black pixels in a * 1-pixel surrounding border. * It is similar to http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch */ - (id) initWithNinePatchImage: (NSImage*)image; /* Initialise with a single image assuming division into nine equally * sized sections. */ - (id) initWithImage: (NSImage*)image; /* Initialise with a single image divided x pixels in from either end on * the horizontal, and y pixels in from either end on the vertical. */ - (id) initWithImage: (NSImage*)image horizontal: (float)x vertical: (float)y; /* * Verify the individual tiles size * If incorrect, we nullify the corresponding image * otherwise, we retain it. */ - (void) validateTilesSizeWithImage: (NSImage*)image; /* Scale the image to the specified value. */ - (void) scaleTo: (float)multiple; - (NSRect) fillRect: (NSRect)rect background: (NSColor*)color fillStyle: (GSThemeFillStyle)style; - (NSRect) fillRect: (NSRect)rect background: (NSColor*)color; /** * Returns the space available to draw content in when the tiles are * drawn in the given rect, or NSZeroRect if the given rect is too small * to draw the tiles in. */ - (NSRect) contentRectForRect: (NSRect)rect isFlipped: (BOOL)flipped; /* Style drawing methods */ - (NSRect) noneStyleFillRect: (NSRect)rect; - (NSRect) centerStyleFillRect: (NSRect)rect; - (NSRect) matrixStyleFillRect: (NSRect)rect; - (NSRect) repeatStyleFillRect: (NSRect)rect; - (NSRect) scaleStyleFillRect: (NSRect)rect; - (NSRect) scaleAllStyleFillRect: (NSRect)rect; /* Utility methods */ - (NSImage*) extractImageFrom: (NSImage*) image withRect: (NSRect) rect; - (NSSize) computeTotalTilesSize; - (void) drawCornersRect: (NSRect)rect; - (void) repeatFillRect: (NSRect)rect; - (void) scaleFillRect: (NSRect)rect; - (GSThemeFillStyle) fillStyle; - (void) setFillStyle: (GSThemeFillStyle)aStyle; /** * Returns the sum of the widths of the left, middle, and right tiles, * and the sum of the heights of the top, center, and bottom tiles, before scaling. * * Can be used to calculate a rect to draw the tiles in such that they are only * filled in one direction. */ - (NSSize) size; - (GSThemeMargins) themeMargins; @end /** This is the panel used to select and inspect themes. */ @interface GSThemePanel : NSPanel { NSMatrix *matrix; // Not retained. NSScrollView *sideView; // Not retained. NSView *bottomView; // Not retained. } /** Return the shared panel. */ + (GSThemePanel*) sharedThemePanel; /** Update current theme to the one clicked on in the matrix. */ - (void) changeSelection: (id)sender; /** Handle notifications */ - (void) notified: (NSNotification*)n; /** Toggle whether the current theme is the default theme. */ - (void) setDefault: (id)sender; /** Update list of available themes. */ - (void) update: (id)sender; @end /** This is the window used to inspect themes. */ @interface GSThemeInspector : NSWindow { } /** Return the shared panel. */ + (GSThemeInspector*) sharedThemeInspector; /** Update to show current theme. */ - (void) update: (id)sender; @end /** This category defines private methods for internal use by GSTheme */ @interface GSTheme (internal) /** * Called whenever user defaults are changed ... this checks for the * GSTheme user default and ensures that the specified theme is the * current active theme. */ + (void) defaultsDidChange: (NSNotification*)n; /** * Called to load specified theme.
* If aName is nil or an empty string or 'GNUstep', * this returns the default theme.
* If the named is a full path specification, this uses that path.
* Otherwise this method searches the standard locations.
* Returns nil on failure. */ + (GSTheme*) loadThemeNamed: (NSString*)aName; // These two drawing method may be made public later on - (void) drawCircularBezel: (NSRect)cellFrame withColor: (NSColor*)backgroundColor; - (void) drawRoundBezel: (NSRect)cellFrame withColor: (NSColor*)backgroundColor; @end /* The GSThemeProxy class provides a simple proxy object for intermal use * by the GUI library when dealing with references to resources which may * be changed by activating a new theme, but which will be set in other * GUI objects. Having objects store a proxy to the orignal resource * rather than storing the original resource itsself means that, when the * new theme is activated the new resource can be used for drawing rather * than the old version. */ @interface GSThemeProxy : NSProxy { id _resource; } - (id) _resource; - (void) _setResource: (id)resource; @end #endif gnustep-gui-0.24.0/Source/NSStringDrawing.m0000664000076500007650000004044612072370607020417 0ustar brains99brains99/** NSStringAdditions Categories which add drawing capabilities to NSAttributedString and NSString. Copyright (C) 1999, 2003, 2004 Free Software Foundation, Inc. Author: Richard Frith-Macdonald Date: Mar 1999 - rewrite from scratch Author: Alexander Malmberg Date: November 2002 - February 2003 (rewrite to use NSLayoutManager et al) 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #import #import #import "AppKit/NSAffineTransform.h" #import "AppKit/NSLayoutManager.h" #import "AppKit/NSStringDrawing.h" #import "AppKit/NSTextContainer.h" #import "AppKit/NSTextStorage.h" #import "AppKit/DPSOperators.h" /* Apple uses this as the maximum width of an NSTextContainer. For bigger values the width gets ignored. */ #define LARGE_SIZE 1e7 /* A size of 16 and these constants give a hit rate of 80%-90% for normal app use (based on real world statistics gathered with the help of some users from #GNUstep). */ #define NUM_CACHE_ENTRIES 16 #define HIT_BOOST 2 #define MISS_COST 1 typedef struct { int used; unsigned int string_hash; int hasSize, useScreenFonts; NSTextStorage *textStorage; NSLayoutManager *layoutManager; NSTextContainer *textContainer; NSSize givenSize; NSRect usedRect; } cache_t; static BOOL did_init = NO; static cache_t cache[NUM_CACHE_ENTRIES]; static NSTextStorage *scratchTextStorage; static NSLayoutManager *scratchLayoutManager; static NSTextContainer *scratchTextContainer; static NSRecursiveLock *cacheLock = nil; /* For collecting statistics. */ //#define STATS #ifdef STATS static int total, hits, misses, hash_hits; static void NSStringDrawing_dump_stats(void) { #define P(x) printf("%15i %s\n", x, #x); P(total) P(hits) P(misses) P(hash_hits) #undef P printf("%15.8f hit ratio\n", hits / (double)total); } #endif static void init_string_drawing(void) { int i; NSTextStorage *textStorage; NSLayoutManager *layoutManager; NSTextContainer *textContainer; if (did_init) return; did_init = YES; #ifdef STATS atexit(NSStringDrawing_dump_stats); #endif for (i = 0; i < NUM_CACHE_ENTRIES + 1; i++) { textStorage = [[NSTextStorage alloc] init]; layoutManager = [[NSLayoutManager alloc] init]; [textStorage addLayoutManager: layoutManager]; [layoutManager release]; textContainer = [[NSTextContainer alloc] initWithContainerSize: NSMakeSize(10, 10)]; [textContainer setLineFragmentPadding: 0]; [layoutManager addTextContainer: textContainer]; [textContainer release]; if (i < NUM_CACHE_ENTRIES) { cache[i].textStorage = textStorage; cache[i].layoutManager = layoutManager; cache[i].textContainer = textContainer; } else { scratchTextStorage = textStorage; scratchLayoutManager = layoutManager; scratchTextContainer = textContainer; } } } static inline void cache_lock() { // FIXME: Put all the init code into an +initialize method // to let the runtime take care of it. if (cacheLock == nil) { cacheLock = [[NSRecursiveLock alloc] init]; } [cacheLock lock]; if (!did_init) { init_string_drawing(); } } static inline void cache_unlock() { [cacheLock unlock]; } static inline BOOL is_size_match(cache_t *c, int hasSize, NSSize size) { if ((!c->hasSize && !hasSize) || (c->hasSize && hasSize && c->givenSize.width == size.width && c->givenSize.height == size.height) /* || (!c->hasSize && hasSize && size.width >= NSMaxX(c->usedRect) && size.height >= NSMaxY(c->usedRect))*/) { return YES; } else { return NO; } } static int cache_match(int hasSize, NSSize size, int useScreenFonts, int *matched) { int i, j; cache_t *c; int least_used; int replace; int orig_used; unsigned int string_hash = [[scratchTextStorage string] hash]; #ifdef STATS total++; #endif *matched = 1; replace = least_used = -1; /* A deterministic pattern for replacing cache entries can hit ugly worst cases on certain matching use patterns (where the cache is full of old unused entries, but the new entries keep replacing each other). By starting at a random index, we avoid this kind of problem. */ j = rand() % NUM_CACHE_ENTRIES; for (i = 0; i < NUM_CACHE_ENTRIES; i++, j++) { if (j == NUM_CACHE_ENTRIES) j = 0; c = cache + j; if (least_used == -1 || c->used < least_used) { least_used = c->used; replace = j; } if (!c->used) continue; orig_used = c->used; if (c->used > MISS_COST) c->used -= MISS_COST; else c->used = 1; if (c->string_hash != string_hash || c->useScreenFonts != useScreenFonts) continue; #ifdef STATS hash_hits++; #endif if (![scratchTextStorage isEqualToAttributedString: c->textStorage]) continue; /* String and attributes match, check size. */ if (is_size_match(c, hasSize, size)) { c->used = orig_used + HIT_BOOST; #ifdef STATS hits++; #endif return j; } } NSCAssert(replace != -1, @"Couldn't find a cache entry to replace."); #ifdef STATS misses++; #endif *matched = 0; c = cache + replace; c->used = 1; c->string_hash = string_hash; c->hasSize = hasSize; c->useScreenFonts = useScreenFonts; c->givenSize = size; { id temp; #define SWAP(a, b) temp = a; a = b; b = temp; SWAP(scratchTextStorage, c->textStorage) SWAP(scratchLayoutManager, c->layoutManager) SWAP(scratchTextContainer, c->textContainer) #undef SWAP } return replace; } static inline void prepare_string(NSString *string, NSDictionary *attributes) { [scratchTextStorage beginEditing]; [scratchTextStorage replaceCharactersInRange: NSMakeRange(0, [scratchTextStorage length]) withString: string]; if ([string length]) { [scratchTextStorage setAttributes: attributes range: NSMakeRange(0, [string length])]; } [scratchTextStorage endEditing]; } static inline void prepare_attributed_string(NSAttributedString *string) { [scratchTextStorage replaceCharactersInRange: NSMakeRange(0, [scratchTextStorage length]) withAttributedString: string]; } static int cache_lookup(int hasSize, NSSize size, int useScreenFonts) { cache_t *c; int ci, hit; NSLayoutManager *layoutManager; NSTextContainer *textContainer; ci = cache_match(hasSize, size, useScreenFonts, &hit); if (hit) { return ci; } // Cache miss, need to set up the text system c = &cache[ci]; layoutManager = c->layoutManager; textContainer = c->textContainer; if (hasSize) [textContainer setContainerSize: NSMakeSize(size.width, size.height)]; else [textContainer setContainerSize: NSMakeSize(LARGE_SIZE, LARGE_SIZE)]; [layoutManager setUsesScreenFonts: useScreenFonts]; c->usedRect = [layoutManager usedRectForTextContainer: textContainer]; return ci; } static int use_screen_fonts(void) { NSGraphicsContext *ctxt = GSCurrentContext(); NSAffineTransform *ctm = GSCurrentCTM(ctxt); NSAffineTransformStruct ts = [ctm transformStruct]; if (ts.m11 != 1.0 || ts.m12 != 0.0 || ts.m21 != 0.0 || fabs(ts.m22) != 1.0) { return 0; } else { return 1; } } /* This is an ugly hack to get text to display correctly in non-flipped views. The text system always has positive y down, so we flip the coordinate system when drawing (if the view isn't flipped already). This causes the glyphs to be drawn upside-down, so we need to tell NSFont to flip the fonts. */ @interface NSFont (FontFlipHack) +(void) _setFontFlipHack: (BOOL)flip; @end @implementation NSAttributedString (NSStringDrawing) - (void) drawAtPoint: (NSPoint)point { int ci; cache_t *c; NSRange r; NSGraphicsContext *ctxt = GSCurrentContext(); cache_lock(); NS_DURING { prepare_attributed_string(self); ci = cache_lookup(0, NSZeroSize, use_screen_fonts()); c = &cache[ci]; r = NSMakeRange(0, [c->layoutManager numberOfGlyphs]); if (![[NSView focusView] isFlipped]) { DPSscale(ctxt, 1, -1); point.y = -point.y; /* Adjust point.y so the lower left corner of the used rect is at the point that was passed to us. */ point.y -= NSMaxY(c->usedRect); [NSFont _setFontFlipHack: YES]; } [c->layoutManager drawBackgroundForGlyphRange: r atPoint: point]; [c->layoutManager drawGlyphsForGlyphRange: r atPoint: point]; } NS_HANDLER { cache_unlock(); [localException raise]; } NS_ENDHANDLER; cache_unlock(); if (![[NSView focusView] isFlipped]) { DPSscale(ctxt, 1, -1); [NSFont _setFontFlipHack: NO]; } } - (void) drawInRect: (NSRect)rect { [self drawWithRect: rect options: NSStringDrawingUsesLineFragmentOrigin]; } - (void) drawWithRect: (NSRect)rect options: (NSStringDrawingOptions)options { // FIXME: This ignores options int ci; cache_t *c; NSRange r; BOOL need_clip = NO; NSGraphicsContext *ctxt = GSCurrentContext(); if (rect.size.width <= 0 || rect.size.height <= 0) return; cache_lock(); NS_DURING { prepare_attributed_string(self); ci = cache_lookup(1, rect.size, use_screen_fonts()); c = &cache[ci]; /* If the used rect fits completely in the rect we draw in, we save time by avoiding the DPSrectclip (and the state save and restore). This isn't completely safe; the used rect isn't guaranteed to contain all parts of all glyphs. */ if (c->usedRect.origin.x >= 0 && c->usedRect.origin.y <= 0 && NSMaxX(c->usedRect) <= rect.size.width && NSMaxY(c->usedRect) <= rect.size.height) { need_clip = NO; } else { need_clip = YES; DPSgsave(ctxt); DPSrectclip(ctxt, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height); } r = [c->layoutManager glyphRangeForBoundingRect: NSMakeRect(0, 0, rect.size.width, rect.size.height) inTextContainer: c->textContainer]; if (![[NSView focusView] isFlipped]) { DPSscale(ctxt, 1, -1); rect.origin.y = -NSMaxY(rect); [NSFont _setFontFlipHack: YES]; } [c->layoutManager drawBackgroundForGlyphRange: r atPoint: rect.origin]; [c->layoutManager drawGlyphsForGlyphRange: r atPoint: rect.origin]; } NS_HANDLER { cache_unlock(); [localException raise]; } NS_ENDHANDLER; cache_unlock(); [NSFont _setFontFlipHack: NO]; if (![[NSView focusView] isFlipped]) { DPSscale(ctxt, 1, -1); } if (need_clip) { /* Restore the original clipping path. */ DPSgrestore(ctxt); } } - (NSSize) size { NSRect usedRect = [self boundingRectWithSize: NSZeroSize options: NSStringDrawingUsesLineFragmentOrigin]; return usedRect.size; } - (NSRect) boundingRectWithSize: (NSSize)size options: (NSStringDrawingOptions)options { // FIXME: This ignores options int ci; NSRect result = NSZeroRect; int hasSize = NSEqualSizes(NSZeroSize, size) ? 0 : 1; cache_lock(); NS_DURING { prepare_attributed_string(self); ci = cache_lookup(hasSize, size, 1); result = cache[ci].usedRect; } NS_HANDLER { cache_unlock(); [localException raise]; } NS_ENDHANDLER; cache_unlock(); return result; } @end @implementation NSString (NSStringDrawing) - (void) drawAtPoint: (NSPoint)point withAttributes: (NSDictionary *)attrs { int ci; cache_t *c; NSRange r; NSGraphicsContext *ctxt = GSCurrentContext(); cache_lock(); NS_DURING { prepare_string(self, attrs); ci = cache_lookup(0, NSZeroSize, use_screen_fonts()); c = &cache[ci]; r = NSMakeRange(0, [c->layoutManager numberOfGlyphs]); if (![[NSView focusView] isFlipped]) { DPSscale(ctxt, 1, -1); point.y = -point.y; /* Adjust point.y so the lower left corner of the used rect is at the point that was passed to us. */ point.y -= NSMaxY(c->usedRect); [NSFont _setFontFlipHack: YES]; } [c->layoutManager drawBackgroundForGlyphRange: r atPoint: point]; [c->layoutManager drawGlyphsForGlyphRange: r atPoint: point]; } NS_HANDLER { cache_unlock(); [localException raise]; } NS_ENDHANDLER; cache_unlock(); if (![[NSView focusView] isFlipped]) { DPSscale(ctxt, 1, -1); [NSFont _setFontFlipHack: NO]; } } - (void) drawInRect: (NSRect)rect withAttributes: (NSDictionary *)attrs { [self drawWithRect: rect options: NSStringDrawingUsesLineFragmentOrigin attributes: attrs]; } - (void) drawWithRect: (NSRect)rect options: (NSStringDrawingOptions)options attributes: (NSDictionary *)attrs { // FIXME: This ignores options int ci; cache_t *c; NSRange r; BOOL need_clip = NO; NSGraphicsContext *ctxt = GSCurrentContext(); if (rect.size.width <= 0 || rect.size.height <= 0) return; cache_lock(); NS_DURING { prepare_string(self, attrs); ci = cache_lookup(1, rect.size, use_screen_fonts()); c = &cache[ci]; /* If the used rect fits completely in the rect we draw in, we save time by avoiding the DPSrectclip (and the state save and restore). This isn't completely safe; the used rect isn't guaranteed to contain all parts of all glyphs. */ if (c->usedRect.origin.x >= 0 && c->usedRect.origin.y <= 0 && NSMaxX(c->usedRect) <= rect.size.width && NSMaxY(c->usedRect) <= rect.size.height) { need_clip = NO; } else { need_clip = YES; DPSgsave(ctxt); DPSrectclip(ctxt, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height); } r = [c->layoutManager glyphRangeForBoundingRect: NSMakeRect(0, 0, rect.size.width, rect.size.height) inTextContainer: c->textContainer]; if (![[NSView focusView] isFlipped]) { DPSscale(ctxt, 1, -1); rect.origin.y = -NSMaxY(rect); [NSFont _setFontFlipHack: YES]; } [c->layoutManager drawBackgroundForGlyphRange: r atPoint: rect.origin]; [c->layoutManager drawGlyphsForGlyphRange: r atPoint: rect.origin]; } NS_HANDLER { cache_unlock(); [localException raise]; } NS_ENDHANDLER; cache_unlock(); [NSFont _setFontFlipHack: NO]; if (![[NSView focusView] isFlipped]) { DPSscale(ctxt, 1, -1); } if (need_clip) { /* Restore the original clipping path. */ DPSgrestore(ctxt); } } - (NSSize) sizeWithAttributes: (NSDictionary *)attrs { NSRect usedRect = [self boundingRectWithSize: NSZeroSize options: NSStringDrawingUsesLineFragmentOrigin attributes: attrs]; return usedRect.size; } - (NSRect) boundingRectWithSize: (NSSize)size options: (NSStringDrawingOptions)options attributes: (NSDictionary *)attrs { // FIXME: This ignores options int ci; NSRect result = NSZeroRect; int hasSize = NSEqualSizes(NSZeroSize, size) ? 0 : 1; cache_lock(); NS_DURING { prepare_string(self, attrs); ci = cache_lookup(hasSize, size, 1); result = cache[ci].usedRect; } NS_HANDLER { cache_unlock(); [localException raise]; } NS_ENDHANDLER; cache_unlock(); return result; } @end /* Dummy function; see comment in NSApplication.m, +initialize. */ void GSStringDrawingDummyFunction(void) { } gnustep-gui-0.24.0/Source/NSTextField.m0000664000076500007650000005053112013442034017506 0ustar brains99brains99/** NSTextField Text field control class for text entry Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Felipe A. Rodriguez Date: August 1998 Author: Nicola Pero Date: November 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import #import #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSCursor.h" #import "AppKit/NSEvent.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSTextField.h" #import "AppKit/NSTextFieldCell.h" #import "AppKit/NSWindow.h" #import "AppKit/NSKeyValueBinding.h" #import "GSBindingHelpers.h" static NSNotificationCenter *nc; /* * Class variables */ static Class usedCellClass; static Class textFieldCellClass; @implementation NSTextField // // Class methods // + (void) initialize { if (self == [NSTextField class]) { [self setVersion: 1]; textFieldCellClass = [NSTextFieldCell class]; usedCellClass = textFieldCellClass; nc = [NSNotificationCenter defaultCenter]; [self exposeBinding: NSEditableBinding]; [self exposeBinding: NSTextColorBinding]; } } /* * Setting the Cell class */ + (Class) cellClass { return usedCellClass; } + (void) setCellClass: (Class)factoryId { usedCellClass = factoryId ? factoryId : textFieldCellClass; } // // Instance methods // - (id) initWithFrame: (NSRect)frameRect { self = [super initWithFrame: frameRect]; if (self == nil) return self; [_cell setBezeled: YES]; [_cell setSelectable: YES]; [_cell setEditable: YES]; [_cell setDrawsBackground: YES]; _text_object = nil; return self; } - (void) dealloc { if (_delegate != nil) { [self setDelegate: nil]; } [super dealloc]; } - (BOOL) isFlipped { return YES; } /**

Returns whether the NSTextField is editable. By default a NSTextField is not editable.

See Also: -setEditable: [NSCell-isEditable]

*/ - (BOOL) isEditable { return [_cell isEditable]; } /**

Returns whether the NSTextField is selectable.

See Also: -setSelectable: [NSCell-isSelectable]

*/ - (BOOL) isSelectable { return [_cell isSelectable]; } /**

Sets whether the NSTextField's cell and the NSText object is editable. By default a NSTextField is not editable.

See Also: -isEditable [NSCell-setEditable:] [NSText-setEditable:]

*/ - (void) setEditable: (BOOL)flag { [_cell setEditable: flag]; if (_text_object) [_text_object setEditable: flag]; } /**

Sets whether the NSTextField's cell and the NSText object is selectable.

See Also: -isSelectable [NSTextFieldCell-setSelectable:] [NSText-setSelectable:]

*/ - (void) setSelectable: (BOOL)flag { [_cell setSelectable: flag]; if (_text_object) [_text_object setSelectable: flag]; } /**

Selects all the text of the NSTextField if it's selectable.

*/ - (void) selectText: (id)sender { if ([self isSelectable] && (_super_view != nil)) { if (_text_object) [_text_object selectAll: self]; else { NSText *text = [_window fieldEditor: YES forObject: self]; int length; if ([text superview] != nil) if ([text resignFirstResponder] == NO) return; // [NSCursor hide]; /* [self stringValue] generates a call to validateEditing so we need to call it before setting up the _text_object */ length = [[self stringValue] length]; _text_object = [_cell setUpFieldEditorAttributes: text]; if (sender == self) { /* Special case: If -selectText: is called in response to making the receiver first responder with a mouse click, don't select the whole text. First of all, this is redundant since the field editor will receive the mouse click and immediately collapse the selection by placing the insertion point at the mouse location. Furthermore, we thus preserve the current selection on X and therefore the user can easily paste it into the text field with a middle mouse click. */ NSEvent *event = [_window currentEvent]; if ([event type] == NSLeftMouseDown && NSPointInRect([event locationInWindow], [self convertRect:[self bounds] toView:nil])) { length = 0; } } [_cell selectWithFrame: _bounds inView: self editor: _text_object delegate: self start: 0 length: length]; } } } /**

Returns the object selected when the user presses the TAB key.

See Also: -setNextText: [NSView-nextKeyView]

*/ - (id) nextText { return [self nextKeyView]; } /**

Returns the object selected when the user presses the Shift-TAB key.

See Also: -setPreviousText: [NSView-previousKeyView]

*/ - (id) previousText { return [self previousKeyView]; } /**

Sets the object selected when the user presses the TAB key to anObject.

See Also: -nextText [NSView-setNextKeyView:]

*/ - (void) setNextText: (id)anObject { [self setNextKeyView: anObject]; } /**

Sets the object selected when the user presses the shift-TAB key to anObject.

See Also: -previousText [NSView-setPreviousKeyView:]

*/ - (void) setPreviousText: (id)anObject { [self setPreviousKeyView: anObject]; } /**

Sets the delegate to anObject.

See Also: -delegate

*/ - (void) setDelegate: (id)anObject { if (_delegate) [nc removeObserver: _delegate name: nil object: self]; _delegate = anObject; #define SET_DELEGATE_NOTIFICATION(notif_name) \ if ([_delegate respondsToSelector: @selector(controlText##notif_name:)]) \ [nc addObserver: _delegate \ selector: @selector(controlText##notif_name:) \ name: NSControlText##notif_name##Notification object: self] SET_DELEGATE_NOTIFICATION(DidBeginEditing); SET_DELEGATE_NOTIFICATION(DidEndEditing); SET_DELEGATE_NOTIFICATION(DidChange); } /**

Returns the delegate object.

See Also: -setDelegate:

*/ - (id) delegate { return _delegate; } /**

Sets the color used to draw the background to aColor.

See Also: -backgroundColor -setDrawsBackground: -drawsBackground [NSTextFieldCell-setBackgroundColor:]

*/ - (void) setBackgroundColor: (NSColor *)aColor { [_cell setBackgroundColor: aColor]; } /**

Returns the color used to draw the background.

See Also: -setBackgroundColor: setDrawsBackground: -drawsBackground [NSTextFieldCell-backgroundColor]

*/ - (NSColor *) backgroundColor { return [_cell backgroundColor]; } /**

Returns whether the NSTextField draws the background. By default NO.

See Also: -setDrawsBackground: [NSTextFieldCell-drawsBackground]

*/ - (BOOL) drawsBackground { return [_cell drawsBackground]; } /**

Returns whether the NSTextField's cell has bezeled border.

See Also: -setBezeled: [NSTextFieldCell-isBezeled]

*/ - (BOOL) isBezeled { return [_cell isBezeled]; } /**

Returns whether the NSTextField's cell has border.

See Also: -setBordered: [NSTextFieldCell-isBordered]

*/ - (BOOL) isBordered { return [_cell isBordered]; } /**

Sets whether the NSTextField's cell has bezeled border.

See Also: -isBezeled [NSTextFieldCell-setBezeled:]

*/ - (void) setBezeled: (BOOL)flag { [_cell setBezeled: flag]; } /**

Sets whether the NSTextField's cell has border.

See Also: -isBordered [NSTextFieldCell-setBordered:]

*/ - (void) setBordered: (BOOL)flag { [_cell setBordered: flag]; } /**

Sets whether the NSTextField draws the background. By default NO.

See Also: -drawsBackground [NSTextFieldCell-setDrawsBackground:]

*/ - (void) setDrawsBackground: (BOOL)flag { [_cell setDrawsBackground: flag]; } /**

Sets the color with which the text will be draw to aColor.

See Also: -textColor [NSTextFieldCell-setTextColor:]

*/ - (void) setTextColor: (NSColor *)aColor { [_cell setTextColor: aColor]; } /**

Returns the colour used to draw the text.

See Also: -setTextColor: [NSTextFieldCell-textColor]

*/ - (NSColor *) textColor { return [_cell textColor]; } // // Target and Action // - (SEL) errorAction { return _error_action; } - (void) setErrorAction: (SEL)aSelector { _error_action = aSelector; } // // Handling Events // - (void) mouseDown: (NSEvent*)theEvent { if ([self isSelectable] == NO || [self isEnabled] == NO) { if (_next_responder) [_next_responder mouseDown: theEvent]; else [super mouseDown: theEvent]; return; } /* NB: If we're receiving this click from the NSWindow, we expect _text_object to never be nil here, since NSWindow makes the NSTextField the first responder (which invokes its -becomeFirstResponder:, which invokes its -selectText:, which, if it is selectable, sets up the _text_object, then makes the _text_object first responder!) before calling its -mouseDown:. Only the first click should go via here; further clicks will be sent directly by the NSWindow to the _text_object. */ if (_text_object) { [_text_object mouseDown: theEvent]; return; } else { /* I suppose you could get here in subclasses which override * -becomeFirstResponder not to select the text. In that case, * we set up the _text_object manually to start editing here. */ /* Make sure we have first responder status when we start edit. * This does nothing if we are already first responder; but * (important!) it implicitly should free the fieldEditor if it * was in use by another control. */ if ([_window makeFirstResponder: self]) { NSText *t = [_window fieldEditor: YES forObject: self]; if ([t superview] != nil) { /* Can't take the field editor ... give up. */ return; } _text_object = [_cell setUpFieldEditorAttributes: t]; [_cell editWithFrame: _bounds inView: self editor: _text_object delegate: self event: theEvent]; } } } - (BOOL) acceptsFirstMouse: (NSEvent *)aEvent { return [self isEditable] && [self isEnabled]; } /**

Returns whether the NSTextField accepts to be the first responder. This method returns YES if the NSTextField is selectable and if there is no NSText object

See Also: -becomeFirstResponder -isSelectable [NSView-acceptsFirstResponder]

*/ - (BOOL) acceptsFirstResponder { // we do not accept first responder if there is already a // _text_object, else it would make the _text_object resign // and end editing return (_text_object == nil) && [self isSelectable] && [self isEnabled]; } - (BOOL) becomeFirstResponder { if ([self acceptsFirstResponder]) { [self selectText: self]; return YES; } else { return NO; } } -(BOOL) needsPanelToBecomeKey { return [self isEditable] || [self isSelectable]; } - (BOOL) abortEditing { if (_text_object) { [_cell endEditing: _text_object]; _text_object = nil; return YES; } else return NO; } - (NSText *) currentEditor { if (_text_object && ([_window firstResponder] == _text_object)) return _text_object; else return nil; } - (void) validateEditing { if (_text_object) { NSFormatter *formatter; NSString *string; BOOL validatedOK = YES; formatter = [_cell formatter]; string = AUTORELEASE ([[_text_object text] copy]); if (formatter != nil) { id newObjectValue; NSString *error; if ([formatter getObjectValue: &newObjectValue forString: string errorDescription: &error] == YES) { [_cell setObjectValue: newObjectValue]; return; } else { SEL sel = @selector(control:didFailToFormatString:errorDescription:); if ([_delegate respondsToSelector: sel]) { validatedOK = [_delegate control: self didFailToFormatString: string errorDescription: error]; } else if (![string isEqualToString: @""]) { validatedOK = NO; } } } if (validatedOK) { [_cell setStringValue: string]; } } } - (void) textDidBeginEditing: (NSNotification *)aNotification { [super textDidBeginEditing: aNotification]; } - (void) textDidChange: (NSNotification *)aNotification { NSFormatter *formatter; [super textDidChange: aNotification]; formatter = [_cell formatter]; if (formatter != nil) { /* * FIXME: This part needs heavy interaction with the yet to finish * text system. * */ NSString *partialString; NSString *newString = nil; NSString *error = nil; BOOL wasAccepted; partialString = [_text_object string]; wasAccepted = [formatter isPartialStringValid: partialString newEditingString: &newString errorDescription: &error]; if (wasAccepted == NO) { SEL sel = @selector(control:didFailToValidatePartialString:errorDescription:); if ([_delegate respondsToSelector: sel]) { [_delegate control: self didFailToValidatePartialString: partialString errorDescription: error]; } } if (newString != nil) { NSLog (@"Unimplemented: should set string to %@", newString); // FIXME ! This would reset editing ! //[_text_object setString: newString]; } else { if (wasAccepted == NO) { // FIXME: Need to delete last typed character (?!) NSLog (@"Unimplemented: should delete last typed character"); } } } } - (void) textDidEndEditing: (NSNotification *)aNotification { id textMovement; int movement; [super textDidEndEditing: aNotification]; textMovement = [[aNotification userInfo] objectForKey: @"NSTextMovement"]; if (textMovement) { movement = [(NSNumber *)textMovement intValue]; } else { movement = 0; } if (movement == NSReturnTextMovement) { if ([self sendAction: [self action] to: [self target]] == NO) { [self performKeyEquivalent: [_window currentEvent]]; } if ([_window firstResponder] == _window) [self selectText: self]; } else { if ([[self cell] sendsActionOnEndEditing]) [self sendAction: [self action] to: [self target]]; if (movement == NSTabTextMovement) { [_window selectKeyViewFollowingView: self]; if ([_window firstResponder] == _window) [self selectText: self]; } else if (movement == NSBacktabTextMovement) { [_window selectKeyViewPrecedingView: self]; if ([_window firstResponder] == _window) [self selectText: self]; } } } - (BOOL) textShouldBeginEditing: (NSText *)textObject { if ([self isEditable] == NO) return NO; if (_delegate && [_delegate respondsToSelector: @selector(control:textShouldBeginEditing:)]) return [_delegate control: self textShouldBeginEditing: textObject]; else return YES; } - (BOOL) textShouldEndEditing: (NSText*)textObject { if ([_cell isEntryAcceptable: [textObject text]] == NO) { [self sendAction: _error_action to: [self target]]; return NO; } if ([_delegate respondsToSelector: @selector(control:textShouldEndEditing:)]) { if ([_delegate control: self textShouldEndEditing: textObject] == NO) { NSBeep (); return NO; } } if ([_delegate respondsToSelector: @selector(control:isValidObject:)] == YES) { NSFormatter *formatter; id newObjectValue; formatter = [_cell formatter]; if ([formatter getObjectValue: &newObjectValue forString: [_text_object text] errorDescription: NULL] == YES) { if ([_delegate control: self isValidObject: newObjectValue] == NO) { return NO; } } } // In all other cases return YES; } - (BOOL)textView: (NSTextView*)textView doCommandBySelector: (SEL)command { if (_delegate && [_delegate respondsToSelector: @selector(control:textView:doCommandBySelector:)]) { return [_delegate control: self textView: textView doCommandBySelector: command]; } return NO; } // // Rich Text // - (void)setAllowsEditingTextAttributes:(BOOL)flag { [_cell setAllowsEditingTextAttributes: flag]; } - (BOOL)allowsEditingTextAttributes { return [_cell allowsEditingTextAttributes]; } - (void)setImportsGraphics:(BOOL)flag { [_cell setImportsGraphics: flag]; } - (BOOL)importsGraphics { return [_cell importsGraphics]; } - (void)setTitleWithMnemonic:(NSString *)aString { [_cell setTitleWithMnemonic: aString]; } - (void)setBezelStyle:(NSTextFieldBezelStyle)style { [_cell setBezelStyle: style]; } - (NSTextFieldBezelStyle)bezelStyle { return [_cell bezelStyle]; } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; if (![aCoder allowsKeyedCoding]) { [aCoder encodeConditionalObject: _delegate]; [aCoder encodeValueOfObjCType: @encode(SEL) at: &_error_action]; } } - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if ([aDecoder allowsKeyedCoding]) { // do nothing for now... } else { [self setDelegate: [aDecoder decodeObject]]; [aDecoder decodeValueOfObjCType: @encode(SEL) at: &_error_action]; } _text_object = nil; return self; } // // Bindings // /* * Bindings implemented: * alignment, hidden, editable, enabled, font, toolTip * * Bindings left to implement: * other font bindings, value, displayPatternValue1 */ - (void) bind: (NSString *)binding toObject: (id)anObject withKeyPath: (NSString *)keyPath options: (NSDictionary *)options { if ([binding hasPrefix: NSEditableBinding]) { GSKeyValueBinding *kvb; [self unbind: binding]; kvb = [[GSKeyValueAndBinding alloc] initWithBinding: NSEditableBinding withName: binding toObject: anObject withKeyPath: keyPath options: options fromObject: self]; // The binding will be retained in the binding table RELEASE(kvb); } else { [super bind: binding toObject: anObject withKeyPath: keyPath options: options]; } } @end gnustep-gui-0.24.0/Source/GSServicesManager.m0000664000076500007650000013630712235010125020671 0ustar brains99brains99/* GSServicesManager.m Copyright (C) 1998 Free Software Foundation, Inc. Author: Richard Frith-Macdonald Date: Novemeber 1998 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSPasteboard.h" #import "AppKit/NSMenu.h" #import "AppKit/NSPanel.h" #import "AppKit/NSWindow.h" #import "AppKit/NSWorkspace.h" #import "AppKit/NSDocumentController.h" #import "GNUstepGUI/GSServicesManager.h" #import "GSGuiPrivate.h" static GSServicesManager *manager = nil; /** * The GSListener class is for talking to other applications. * It is a proxy with some dangerous methods implemented in a * harmless manner to reduce the chances of a malicious app * messing with us. This is responsible for forwarding service * requests and other communications with the outside world. */ @interface GSListener : NSProxy + (id) connectionBecameInvalid: (NSNotification*)notification; + (GSListener*) listener; + (id) servicesProvider; + (void) setServicesProvider: (id)anObject; - (Class) class; - (void) dealloc; - (void) release; - (id) retain; - (void) activateIgnoringOtherApps: (BOOL)flag; - (id) self; @end static NSConnection *listenerConnection = nil; static NSMutableArray *listeners = nil; static GSListener *listener = nil; static id servicesProvider = nil; static NSString *providerName = nil; /** * Unregisters the service provider registered on the named port.
* Applications should use [NSApplication-setServicesProvider:] with a nil * argument instead. */ void NSUnregisterServicesProvider(NSString *name) { if (listenerConnection != nil) { /* * Ensure there is no previous listener and nothing else using * the given port name. */ [[NSPortNameServer systemDefaultPortNameServer] removePortForName: name]; [[NSNotificationCenter defaultCenter] removeObserver: [GSListener class] name: NSConnectionDidDieNotification object: listenerConnection]; DESTROY(listenerConnection); } ASSIGN(servicesProvider, nil); ASSIGN(providerName, nil); } /** * Registers a services providing object using the specified port name.
* Applications should not need to use this, as they can use the * [NSApplication-setServicesProvider:] method instead. The NSApplication * method will use the name of the application rather than an other port name. */ void NSRegisterServicesProvider(id provider, NSString *name) { NSPortNameServer *ns; id namedPort; if ([name length] == 0) { [NSException raise: NSInvalidArgumentException format: @"NSRegisterServicesProvider() no name provided"]; } if (provider == nil) { [NSException raise: NSInvalidArgumentException format: @"NSRegisterServicesProvider() no provider"]; } if (servicesProvider == provider && [providerName isEqual: name]) { return; // Already registered. } ns = [NSPortNameServer systemDefaultPortNameServer]; namedPort = [ns portForName: name]; if (namedPort && [listenerConnection receivePort] == namedPort) { [ns removePortForName: name]; namedPort = nil; } if (namedPort != nil) { [NSException raise: NSInvalidArgumentException format: @"NSRegisterServicesProvider() %@ already in use", name]; } if (listenerConnection != nil) { [[NSNotificationCenter defaultCenter] removeObserver: [GSListener class] name: NSConnectionDidDieNotification object: listenerConnection]; DESTROY(listenerConnection); } listenerConnection = [[NSConnection alloc] initWithReceivePort: [NSPort port] sendPort: nil]; [listenerConnection setRootObject: [GSListener listener]]; if ([listenerConnection registerName: name] == NO) { DESTROY(listenerConnection); } if (listenerConnection != nil) { RETAIN(listenerConnection); [[NSNotificationCenter defaultCenter] addObserver: [GSListener class] selector: @selector(connectionBecameInvalid:) name: NSConnectionDidDieNotification object: listenerConnection]; } else { [NSException raise: NSGenericException format: @"unable to register %@", name]; } ASSIGN(servicesProvider, provider); ASSIGN(providerName, name); } @interface NSNotificationCenter (NSWorkspacePrivate) - (void) _postLocal: (NSString*)name userInfo: (NSDictionary*)info; @end /** * The GSListener class exists as a proxy to forward messages to * service provider objects. It implements very few methods and * those that it does implement are generally designed to defeat * any attack by a malicious program. */ @implementation GSListener + (id) connectionBecameInvalid: (NSNotification*)notification { NSAssert(listenerConnection==[notification object], NSInternalInconsistencyException); [[NSNotificationCenter defaultCenter] removeObserver: self name: NSConnectionDidDieNotification object: listenerConnection]; DESTROY(listenerConnection); return self; } + (void) initialize { static BOOL beenHere = NO; if (beenHere == NO) { beenHere = YES; listeners = [NSMutableArray new]; } } + (GSListener*) listener { if (listener == nil) { listener = (id)NSAllocateObject(self, 0, NSDefaultMallocZone()); [listeners addObject: listener]; } return listener; } /** * Needed to permit use of this class as a notification observer, * since the notification system caches method implementations for speed. */ + (IMP) methodForSelector: (SEL)aSelector { if (aSelector == 0) [NSException raise: NSInvalidArgumentException format: @"%@ null selector given", NSStringFromSelector(_cmd)]; return class_getMethodImplementation(GSObjCClass(self), aSelector); } + (id) servicesProvider { return servicesProvider; } + (void) setServicesProvider: (id)anObject { if (servicesProvider != anObject) { NSString *port = [[GSServicesManager manager] port]; if (port == nil) { port = [[NSProcessInfo processInfo] processName]; } NSRegisterServicesProvider(anObject, port); } } - (id) autorelease { return self; } - (Class) class { return 0; } - (void) dealloc { GSNOSUPERDEALLOC; } /** * Selectively forwards those messages which are thought to be safe, * and perform any special operations we need for workspace management * etc.
* The logic in this method must match that in * methodSignatureForSelector: */ - (void) forwardInvocation: (NSInvocation*)anInvocation { SEL aSel = [anInvocation selector]; NSString *selName = NSStringFromSelector(aSel); id target = nil; id delegate; /* * We never permit remote processes to call private methods in this * application. */ if ([selName hasPrefix: @"_"] == YES) { [NSException raise: NSGenericException format: @"method name '%@' private in '%@'", selName, [manager port]]; } if ([selName hasSuffix: @":userData:error:"] == YES) { /* * The selector matches the correct form for a services request, * so we send the message to the services provider. */ if ([servicesProvider respondsToSelector: aSel] == YES) { NSPasteboard *pb; /* * Create a local NSPasteboard object for this pasteboard. * If we try to use the remote NSPasteboard object, we get * trouble when setting property lists since the remote * NSPasteboard fails to serialize the local property * list objects for sending to gpbs. */ [anInvocation getArgument: (void*)&pb atIndex: 2]; pb = [NSPasteboard pasteboardWithName: [pb name]]; [anInvocation setArgument: (void*)&pb atIndex: 2]; [anInvocation invokeWithTarget: servicesProvider]; return; } [NSException raise: NSGenericException format: @"service request '%@' not implemented in '%@'", selName, [manager port]]; } delegate = [[NSApplication sharedApplication] delegate]; /* * We assume that messages of the form 'application:...' are all * safe and do not need to be listed in GSPermittedMessages. * They can be handled either by the application delegate or by * the shared GSServicesManager instance. */ if ([selName hasPrefix: @"application:"] == YES) { if ([delegate respondsToSelector: aSel] == YES) { target = delegate; } else if ([manager respondsToSelector: aSel] == YES) { target = manager; } } if (target == nil) { NSArray *messages; /* * Unless the message was of a format assumed to be safe, * we must check it against the GSPermittedMessages array * to see if the app allows it to be sent from a remote * process. */ messages = [[NSUserDefaults standardUserDefaults] arrayForKey: @"GSPermittedMessages"]; if (messages != nil && [messages containsObject: selName] == NO) { [NSException raise: NSGenericException format: @"method '%@' not in GSPermittedMessages in '%@'", selName, [manager port]]; } if ([delegate respondsToSelector: aSel] == YES) { target = delegate; } else if ([NSApp respondsToSelector: aSel] == YES) { target = NSApp; } } if (target == nil) { [NSException raise: NSGenericException format: @"method '%@' not implemented in '%@'", selName, [manager port]]; } else { if ([selName isEqualToString: @"terminate:"]) { NSNotificationCenter *c; /* * We handle the terminate: message as a special case, sending * a power off notification before allowing it to be processed * as normal. */ c = [[NSWorkspace sharedWorkspace] notificationCenter]; [c _postLocal: NSWorkspaceWillPowerOffNotification userInfo: nil]; } [anInvocation invokeWithTarget: target]; } } /** * Return the appropriate method signature for aSelector, checking * to see if it's a standard service message or standard application * message.
* If the message is non-standard, it can be checked against a list * of messages specified by the GSPermittedMessages user default.
* The logic in this method must match that in * forwardInvocation: */ - (NSMethodSignature*) methodSignatureForSelector: (SEL)aSelector { NSMethodSignature *sig = nil; NSString *selName = NSStringFromSelector(aSelector); id delegate; if ([selName hasSuffix: @":userData:error:"]) { return [servicesProvider methodSignatureForSelector: aSelector]; } delegate = [[NSApplication sharedApplication] delegate]; if ([selName hasPrefix: @"application:"] == YES) { if ([delegate respondsToSelector: aSelector] == YES) { sig = [delegate methodSignatureForSelector: aSelector]; } else if ([manager respondsToSelector: aSelector] == YES) { sig = [manager methodSignatureForSelector: aSelector]; } } if (sig == nil) { NSArray *messages; messages = [[NSUserDefaults standardUserDefaults] arrayForKey: @"GSPermittedMessages"]; if (messages != nil && [messages containsObject: selName] == NO) { return nil; } if ([delegate respondsToSelector: aSelector] == YES) { sig = [delegate methodSignatureForSelector: aSelector]; } else if ([NSApp respondsToSelector: aSelector] == YES) { sig = [NSApp methodSignatureForSelector: aSelector]; } } return sig; } - (BOOL) respondsToSelector: (SEL)aSelector { if ([self methodSignatureForSelector: aSelector] != nil) { return YES; } return NO; } - (void) release { } - (id) retain { return self; } - (void) activateIgnoringOtherApps: (BOOL)flag { [NSApp activateIgnoringOtherApps: flag]; } - (id) self { return self; } @end /* GSListener */ @implementation GSServicesManager static NSString *servicesName = @".GNUstepServices"; static NSString *disabledName = @".GNUstepDisabled"; /** * Create a new listener for this application. * Uses NSRegisterServicesProvider() to register itsself as a service * provider with the applications name so we can handle incoming * service requests. */ + (GSServicesManager*) newWithApplication: (NSApplication*)app { NSString *str = nil; NSArray *paths; NSString *path = nil; if (manager != nil) { if (manager->_application == nil) { manager->_application = app; } return RETAIN(manager); } manager = [GSServicesManager alloc]; paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); if ((paths != nil) && ([paths count] > 0)) { str = [paths objectAtIndex: 0]; } /* * If standard search paths are not set up, try a default location. */ if (str == nil) { str = [[NSHomeDirectory() stringByAppendingPathComponent: @"GNUstep"] stringByAppendingPathComponent: @"Library"]; } str = [str stringByAppendingPathComponent: @"Services"]; path = [str stringByAppendingPathComponent: servicesName]; manager->_servicesPath = [path copy]; path = [str stringByAppendingPathComponent: disabledName]; manager->_disabledPath = [path copy]; /* * Don't retain application object - that would create a cycle. */ manager->_application = app; manager->_returnInfo = [[NSMutableSet alloc] initWithCapacity: 16]; manager->_combinations = [[NSMutableDictionary alloc] initWithCapacity: 16]; /* * Check for changes to the services cache every thirty seconds. */ manager->_timer = RETAIN([NSTimer scheduledTimerWithTimeInterval: 30.0 target: manager selector: @selector(loadServices) userInfo: nil repeats: YES]); [manager loadServices]; return manager; } + (GSServicesManager*) manager { if (manager == nil) { [self newWithApplication: nil]; } return manager; } - (BOOL) application: (NSApplication*)theApp openFile: (NSString*)file { id del = [NSApp delegate]; BOOL result = NO; NSError *err = nil; if ([del respondsToSelector: _cmd]) { result = [del application: theApp openFile: file]; } else if ([[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL: [NSURL fileURLWithPath: file] display: YES error: &err] != nil) { [NSApp activateIgnoringOtherApps: YES]; result = YES; } else { [NSApp presentError: err]; } return result; } - (void) application: (NSApplication*)theApp openFiles: (NSArray*)files { id del = [NSApp delegate]; if ([del respondsToSelector: _cmd]) { [del application: theApp openFiles: files]; } else { NSString *filePath; NSEnumerator *en = [files objectEnumerator]; while ((filePath = (NSString *)[en nextObject]) != nil) { [self application: theApp openFile: filePath]; } } } - (BOOL) application: (NSApplication*)theApp openFileWithoutUI: (NSString*)file { id del = [NSApp delegate]; BOOL result = NO; NSError *err = nil; if ([del respondsToSelector: _cmd]) { result = [del application: theApp openFileWithoutUI: file]; } else if ([[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL: [NSURL fileURLWithPath: file] display: NO error: &err] != nil) { result = YES; } return result; } - (BOOL) application: (NSApplication*)theApp openTempFile: (NSString*)file { BOOL result = [self application: theApp openFile: file]; [[NSFileManager defaultManager] removeFileAtPath: file handler: nil]; return result; } - (BOOL) application: (NSApplication*)theApp openURL: (NSURL*)aURL { id del = [NSApp delegate]; BOOL result = NO; NSError *err = nil; if ([del respondsToSelector: _cmd]) { result = [del application: theApp openURL: aURL]; } else if ([[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL: aURL display: YES error: &err] != nil) { [NSApp activateIgnoringOtherApps: YES]; result = YES; } else { NSString *s = [aURL absoluteString]; result = [self application: theApp openFile: s]; } return result; } - (BOOL) application: (NSApplication*)theApp printFile: (NSString*)file { id del = [NSApp delegate]; if ([del respondsToSelector: _cmd]) return [del application: theApp printFile: file]; return NO; } - (void) dealloc { NSString *appName; appName = [[NSProcessInfo processInfo] processName]; [_timer invalidate]; RELEASE(_timer); NSUnregisterServicesProvider(appName); RELEASE(_languages); RELEASE(_returnInfo); RELEASE(_combinations); RELEASE(_title2info); RELEASE(_menuTitles); RELEASE(_servicesMenu); RELEASE(_disabledPath); RELEASE(_servicesPath); RELEASE(_disabledStamp); RELEASE(_servicesStamp); RELEASE(_allDisabled); RELEASE(_allServices); [super dealloc]; } - (void) doService: (NSMenuItem*)item { NSString *title = [self item2title: item]; NSDictionary *info = [_title2info objectForKey: title]; NSArray *sendTypes = [info objectForKey: @"NSSendTypes"]; NSArray *returnTypes = [info objectForKey: @"NSReturnTypes"]; unsigned i, j; unsigned es = [sendTypes count]; unsigned er = [returnTypes count]; NSResponder *resp = [[_application keyWindow] firstResponder]; id obj = nil; for (i = 0; i <= es; i++) { NSString *sendType; sendType = (i < es) ? [sendTypes objectAtIndex: i] : nil; for (j = 0; j <= er; j++) { NSString *returnType; returnType = (j < er) ? [returnTypes objectAtIndex: j] : nil; obj = [resp validRequestorForSendType: sendType returnType: returnType]; if (obj != nil) { NSPasteboard *pb; pb = [NSPasteboard pasteboardWithUniqueName]; if (sendType && [obj writeSelectionToPasteboard: pb types: sendTypes] == NO) { NSRunAlertPanel(nil, @"object failed to write to pasteboard", @"Continue", nil, nil); } else if (NSPerformService(title, pb) == YES) { if (returnType && [obj readSelectionFromPasteboard: pb] == NO) { NSRunAlertPanel(nil, @"object failed to read from pasteboard", @"Continue", nil, nil); } } return; } } } } /** * Return a dictionary of information about registered filter services. */ - (NSArray*) filters { return [_allServices objectForKey: @"ByFilter"]; } - (BOOL) hasRegisteredTypes: (NSDictionary*)service { NSArray *sendTypes = [service objectForKey: @"NSSendTypes"]; NSArray *returnTypes = [service objectForKey: @"NSReturnTypes"]; NSString *type; unsigned i; /* * We know that both sendTypes and returnTypes can't be nil since * make_services has validated the service entry for us. */ if (sendTypes == nil || [sendTypes count] == 0) { for (i = 0; i < [returnTypes count]; i++) { type = [returnTypes objectAtIndex: i]; if ([_returnInfo member: type] != nil) { return YES; } } } else if (returnTypes == nil || [returnTypes count] == 0) { for (i = 0; i < [sendTypes count]; i++) { type = [sendTypes objectAtIndex: i]; if ([_combinations objectForKey: type] != nil) { return YES; } } } else { for (i = 0; i < [sendTypes count]; i++) { NSSet *rset; type = [sendTypes objectAtIndex: i]; rset = [_combinations objectForKey: type]; if (rset != nil) { unsigned j; for (j = 0; j < [returnTypes count]; j++) { type = [returnTypes objectAtIndex: j]; if ([rset member: type] != nil) { return YES; } } } } } return NO; } /** * Use tag in menu item to identify slot in menu titles array that * contains the full title of the service. * Return nil if this is not one of our service menu items. */ - (NSString*) item2title: (id)item { unsigned pos; if ([item target] != self) return nil; pos = [item tag]; if (pos > [_menuTitles count]) return nil; return [_menuTitles objectAtIndex: pos]; } - (void) loadServices { NSFileManager *mgr = [NSFileManager defaultManager]; BOOL changed = NO; if ([mgr fileExistsAtPath: _disabledPath]) { NSDictionary *attr; NSDate *mod; attr = [mgr fileAttributesAtPath: _disabledPath traverseLink: YES]; mod = [attr objectForKey: NSFileModificationDate]; if (_disabledStamp == nil || [_disabledStamp laterDate: mod] == mod) { NSData *data; id plist = nil; data = [NSData dataWithContentsOfFile: _disabledPath]; if (data) { plist = [NSDeserializer deserializePropertyListFromData: data mutableContainers: NO]; if (plist) { NSMutableSet *s; changed = YES; s = (NSMutableSet*)[NSMutableSet setWithArray: plist]; ASSIGN(_allDisabled, s); } } /* Track most recent version of file loaded */ ASSIGN(_disabledStamp, mod); } } if ([mgr fileExistsAtPath: _servicesPath]) { NSDictionary *attr; NSDate *mod; attr = [mgr fileAttributesAtPath: _servicesPath traverseLink: YES]; mod = [attr objectForKey: NSFileModificationDate]; if (_servicesStamp == nil || [_servicesStamp laterDate: mod] == mod) { NSData *data; id plist = nil; data = [NSData dataWithContentsOfFile: _servicesPath]; if (data) { plist = [NSDeserializer deserializePropertyListFromData: data mutableContainers: YES]; if (plist) { ASSIGN(_allServices, plist); changed = YES; } } /* Track most recent version of file loaded */ ASSIGN(_servicesStamp, mod); } } if (changed) { /* If we have changed the enabled/disabled services, * or there have been services added/removed * then we must rebuild the services menu to add/remove * items as appropriate. */ [self rebuildServicesMenu]; } } - (NSDictionary*) menuServices { if (_allServices == nil) { [self loadServices]; } return _title2info; } /** * Returns the 'port' of this application ... this is the name the * application is registered under so that other apps can connect to * it to use any services it provides. */ - (NSString*) port { return _port; } /** * Makes the current set of usable services consistent with the * data types currently available. */ - (void) rebuildServices { NSDictionary *services; NSMutableArray *newLang; NSMutableSet *alreadyFound; NSMutableDictionary *newServices; unsigned pos; if (_allServices == nil) return; newLang = [[[[NSUserDefaults standardUserDefaults] stringArrayForKey: @"NSLanguages"] mutableCopy] autorelease]; if (newLang == nil) { newLang = [NSMutableArray arrayWithCapacity: 1]; } if ([newLang containsObject: @"default"] == NO) { [newLang addObject: @"default"]; } ASSIGN(_languages, newLang); services = [_allServices objectForKey: @"ByService"]; newServices = [NSMutableDictionary dictionaryWithCapacity: 16]; alreadyFound = [NSMutableSet setWithCapacity: 16]; /* * Build dictionary of services we can use. * 1. make sure we make dictionary keyed on preferred menu item language * 2. don't include entries for services already examined. * 3. don't include entries for menu items specifically disabled. * 4. don't include entries for which we have no registered types. */ for (pos = 0; pos < [_languages count]; pos++) { NSDictionary *byLanguage; byLanguage = [services objectForKey: [_languages objectAtIndex: pos]]; if (byLanguage != nil) { NSEnumerator *enumerator = [byLanguage keyEnumerator]; NSString *menuItem; while ((menuItem = [enumerator nextObject]) != nil) { NSDictionary *service = [byLanguage objectForKey: menuItem]; if ([alreadyFound member: service] != nil) continue; [alreadyFound addObject: service]; /* See if this service item is disabled. */ if ([_allDisabled member: menuItem] != nil) continue; if ([self hasRegisteredTypes: service]) [newServices setObject: service forKey: menuItem]; } } } if ([newServices isEqual: _title2info] == NO) { NSArray *titles; ASSIGN(_title2info, newServices); titles = [_title2info allKeys]; titles = [titles sortedArrayUsingSelector: @selector(compare:)]; ASSIGN(_menuTitles, titles); [self rebuildServicesMenu]; } } /** Adds or removes items in the services menu in response to a change * in the services which are available to the app. */ - (void) rebuildServicesMenu { if (_servicesMenu != nil) { NSMutableSet *keyEquivalents; unsigned pos; unsigned loc0; unsigned loc1 = 0; SEL sel = @selector(doService:); NSMenu *submenu = nil; [_servicesMenu setAutoenablesItems: NO]; for (pos = [_servicesMenu numberOfItems]; pos > 0; pos--) { [_servicesMenu removeItemAtIndex: 0]; } [_servicesMenu setAutoenablesItems: YES]; keyEquivalents = [NSMutableSet setWithCapacity: 4]; for (loc0 = pos = 0; pos < [_menuTitles count]; pos++) { NSString *title = [_menuTitles objectAtIndex: pos]; NSString *equiv = @""; NSDictionary *info; NSDictionary *titles; NSDictionary *equivs; NSRange r; unsigned lang; id item; if (NSShowsServicesMenuItem(title) == NO) { continue; // We don't want to show this one. } /* * Find the key equivalent corresponding to this menu title * in the service definition. */ info = [_title2info objectForKey: title]; titles = [info objectForKey: @"NSMenuItem"]; equivs = [info objectForKey: @"NSKeyEquivalent"]; for (lang = 0; lang < [_languages count]; lang++) { NSString *language = [_languages objectAtIndex: lang]; NSString *t = [titles objectForKey: language]; if ([t isEqual: title]) { equiv = [equivs objectForKey: language]; if (equiv == nil) { equiv = [equivs objectForKey: @"default"]; } } } /* * Make a note that we are using the key equivalent, or * set to nil if we have already used it in this menu. */ if (equiv) { if ([keyEquivalents member: equiv] == nil) { [keyEquivalents addObject: equiv]; } else { equiv = @""; } } r = [title rangeOfString: @"/"]; if (r.length > 0) { NSString *subtitle = [title substringFromIndex: r.location+1]; NSString *parentTitle = [title substringToIndex: r.location]; NSMenu *menu; item = [_servicesMenu itemWithTitle: parentTitle]; if (item == nil) { loc1 = 0; item = [_servicesMenu insertItemWithTitle: parentTitle action: 0 keyEquivalent: @"" atIndex: loc0++]; menu = [[NSMenu alloc] initWithTitle: parentTitle]; [_servicesMenu setSubmenu: menu forItem: item]; RELEASE(menu); } else { menu = (NSMenu*)[item submenu]; } if (menu != submenu) { [submenu sizeToFit]; submenu = menu; } item = [submenu insertItemWithTitle: subtitle action: sel keyEquivalent: equiv atIndex: loc1++]; [item setTarget: self]; [item setTag: pos]; } else { item = [_servicesMenu insertItemWithTitle: title action: sel keyEquivalent: equiv atIndex: loc0++]; [item setTarget: self]; [item setTag: pos]; } } [submenu update]; // [submenu sizeToFit]; // [_servicesMenu sizeToFit]; [_servicesMenu update]; } } /** * Set up connection to listen for incoming service requests. */ - (void) registerAsServiceProvider { NSString *appName; BOOL registered; appName = [[NSProcessInfo processInfo] processName]; NS_DURING { NSRegisterServicesProvider(self, appName); registered = YES; } NS_HANDLER { registered = NO; } NS_ENDHANDLER if (registered == NO) { NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; if ([defs boolForKey: @"NSUseRunningCopy"] == YES) { id app; /* * Try to activate the other app and terminate self. */ app = [NSConnection rootProxyForConnectionWithRegisteredName: appName host: @""]; NS_DURING { [app activateIgnoringOtherApps: YES]; } NS_HANDLER { /* maybe it terminated. */ } NS_ENDHANDLER registered = NO; } else { unsigned count = 0; /* * Try to rename self as a copy. */ while (registered == NO && ++count < 100) { NSString *tmp; tmp = [appName stringByAppendingFormat: @"Copy%d", count]; NS_DURING { NSRegisterServicesProvider(self, tmp); registered = YES; appName = tmp; } NS_HANDLER { registered = NO; } NS_ENDHANDLER } if (registered == NO) { int result; /* * Something is seriously wrong - we can't talk to the * nameserver, so all interaction with the workspace manager * and/or other applications will fail. * Give the user a chance to keep on going anyway. */ result = NSRunAlertPanel(appName, @"Unable to register application with ANY name", @"Abort", @"Continue", nil); if (result == NSAlertDefaultReturn) { registered = YES; } } } if (registered == NO) { [[NSApplication sharedApplication] terminate: self]; } } ASSIGN(_port, appName); } /** * Register send and return types that an object can handle - we keep * a note of all the possible combinations - * 'returnInfo' is a set of all the return types that can be handled * without a send. * 'combinations' is a dictionary of all send types, with the associated * values being sets of possible return types. */ - (void) registerSendTypes: (NSArray *)sendTypes returnTypes: (NSArray *)returnTypes { BOOL didChange = NO; unsigned i; for (i = 0; i < [sendTypes count]; i++) { NSString *sendType = [sendTypes objectAtIndex: i]; NSMutableSet *returnSet = [_combinations objectForKey: sendType]; if (returnSet == nil) { returnSet = [NSMutableSet setWithCapacity: [returnTypes count]]; [_combinations setObject: returnSet forKey: sendType]; [returnSet addObjectsFromArray: returnTypes]; didChange = YES; } else { unsigned count = [returnSet count]; [returnSet addObjectsFromArray: returnTypes]; if ([returnSet count] != count) { didChange = YES; } } } i = [_returnInfo count]; [_returnInfo addObjectsFromArray: returnTypes]; if ([_returnInfo count] != i) { didChange = YES; } if (didChange) { /* Types have changed, so we need to enable/disable items in the * services menu depending on what types they support. */ [self rebuildServices]; } } - (NSMenu*) servicesMenu { return _servicesMenu; } - (id) servicesProvider { return [GSListener servicesProvider]; } - (void) setServicesMenu: (NSMenu*)aMenu { ASSIGN(_servicesMenu, aMenu); [self rebuildServicesMenu]; } - (void) setServicesProvider: (id)anObject { [GSListener setServicesProvider: anObject]; } - (int) setShowsServicesMenuItem: (NSString*)item to: (BOOL)enable { NSData *d; [self loadServices]; if (_allDisabled == nil) { _allDisabled = [[NSMutableSet alloc] initWithCapacity: 1]; } if (enable) { [_allDisabled removeObject: item]; } else { [_allDisabled addObject: item]; } d = [NSSerializer serializePropertyList: [_allDisabled allObjects]]; if ([d writeToFile: _disabledPath atomically: YES] == YES) { return 0; } return -1; } - (BOOL) showsServicesMenuItem: (NSString*)item { [self loadServices]; if ([_allDisabled member: item] == nil) return YES; return NO; } - (BOOL) validateMenuItem: (id)item { NSString *title = [self item2title: item]; NSDictionary *info = [_title2info objectForKey: title]; NSArray *sendTypes = [info objectForKey: @"NSSendTypes"]; NSArray *returnTypes = [info objectForKey: @"NSReturnTypes"]; unsigned i, j; unsigned es = [sendTypes count]; unsigned er = [returnTypes count]; NSResponder *resp = [[_application keyWindow] firstResponder]; /* * If the menu item is not in our map, it must be the item containing * a sub-menu - so we see if any item in the submenu is valid. */ if (title == nil) { NSMenu *sub; if (![item isKindOfClass: [NSMenuItem class]]) return NO; sub = [item submenu]; if (sub && [sub isKindOfClass: [NSMenu class]]) { NSArray *a = [sub itemArray]; for (i = 0; i < [a count]; i++) { if ([self validateMenuItem: [a objectAtIndex: i]] == YES) { return YES; } } } return NO; } /* * The item corresponds to one of our services - so we check to see if * there is anything that can deal with it. */ if (es == 0) { if (er == 0) { if ([resp validRequestorForSendType: nil returnType: nil] != nil) return YES; } else { for (j = 0; j < er; j++) { NSString *returnType; returnType = [returnTypes objectAtIndex: j]; if ([resp validRequestorForSendType: nil returnType: returnType] != nil) return YES; } } } else { for (i = 0; i < es; i++) { NSString *sendType; sendType = [sendTypes objectAtIndex: i]; if (er == 0) { if ([resp validRequestorForSendType: sendType returnType: nil] != nil) return YES; } else { for (j = 0; j < er; j++) { NSString *returnType; returnType = [returnTypes objectAtIndex: j]; if ([resp validRequestorForSendType: sendType returnType: returnType] != nil) return YES; } } } } return NO; } - (void) updateServicesMenu { if (_servicesMenu && [[_application mainMenu] autoenablesItems]) { NSArray *a; unsigned i; a = [_servicesMenu itemArray]; for (i = 0; i < [a count]; i++) { NSMenuItem *item = [a objectAtIndex: i]; BOOL wasEnabled = [item isEnabled]; BOOL shouldBeEnabled; NSString *title = [self item2title: item]; /* * If there is no title mapping, this item must be a * submenu - so we check the submenu items. * * We always enable the submenu item itself. We do this * to prevent confusion (if the user is trying to use * a disabled item, it's clearer to show that item disabled * than to hide it in a disabled submenu), and to encourage * the user to explore the interface (it makes it possible * to browse the service list at any time). */ if (title == nil && [[item submenu] isKindOfClass: [NSMenu class]]) { NSArray *sub = [[item submenu] itemArray]; unsigned j; shouldBeEnabled = YES; for (j = 0; j < [sub count]; j++) { NSMenuItem *subitem = [sub objectAtIndex: j]; BOOL subWasEnabled = [subitem isEnabled]; BOOL subShouldBeEnabled = NO; if ([self validateMenuItem: subitem] == YES) { subShouldBeEnabled = YES; } if (subWasEnabled != subShouldBeEnabled) { [subitem setEnabled: subShouldBeEnabled]; } } } else { shouldBeEnabled = [self validateMenuItem: item]; } if (wasEnabled != shouldBeEnabled) { [item setEnabled: shouldBeEnabled]; } } } } @end /* GSServicesManager */ /** *

Establishes an NSConnection to the application listening at port * (by convention usually the application name), launching appName * if necessary. Returns the proxy to the remote application, or nil * on failure. *

*

The value of port specifies the name of the distributed objects * service to which the connection is to be made. If this is nil * it will be inferred from appName ... by convention, applications * use their own name (minus any path or extension) for this. *

*

If appName is nil or cannot be launched, this attempts to locate any * application in a standard location whose name matches port and launch * that application. *

*

The value of expire provides a timeout in case the application cannot * be contacted promptly. If it is omitted, a thirty second timeout is * used. *

*/ id GSContactApplication(NSString *appName, NSString *port, NSDate *expire) { id app; if (port == nil) { port = [[appName lastPathComponent] stringByDeletingPathExtension]; } if (expire == nil) { expire = [NSDate dateWithTimeIntervalSinceNow: 30.0]; } if (providerName != nil && [port isEqual: providerName] == YES) { app = [GSListener listener]; // Contect our own listener. } else { NS_DURING { app = [NSConnection rootProxyForConnectionWithRegisteredName: port host: @""]; } NS_HANDLER { return nil; /* Fatal error in DO */ } NS_ENDHANDLER } if (app == nil) { if (appName == nil || [[NSWorkspace sharedWorkspace] launchApplication: appName] == NO) { if (port == nil || [[NSWorkspace sharedWorkspace] launchApplication: port] == NO) { return nil; /* Unable to launch. */ } } NS_DURING { app = [NSConnection rootProxyForConnectionWithRegisteredName: port host: @""]; while (app == nil && [expire timeIntervalSinceNow] > 0.1) { NSRunLoop *loop = [NSRunLoop currentRunLoop]; NSDate *next; [NSTimer scheduledTimerWithTimeInterval: 0.1 invocation: nil repeats: NO]; next = [NSDate dateWithTimeIntervalSinceNow: 0.2]; [loop runUntilDate: next]; app = [NSConnection rootProxyForConnectionWithRegisteredName: port host: @""]; } } NS_HANDLER { return nil; } NS_ENDHANDLER } return app; } static NSDictionary * serviceFromAnyLocalizedTitle(NSString *title) { NSDictionary *allServices; NSEnumerator *e1; NSDictionary *service; allServices = [manager menuServices]; if (allServices == nil) { return nil; } if ([allServices objectForKey: title] != nil) { return [allServices objectForKey: title]; } e1 = [allServices objectEnumerator]; while ((service = [e1 nextObject]) != nil) { NSDictionary *menuItems; NSString *itemName; NSEnumerator *e2; menuItems = [service objectForKey: @"NSMenuItem"]; if (menuItems == nil) { continue; } e2 = [menuItems objectEnumerator]; while ((itemName = [e2 nextObject]) != nil) { if ([itemName isEqualToString: title] == YES) { return service; } } } return nil; } /** *

Given the name of a serviceItem, and some data in a pasteboard * this function sends the data to the service provider (launching * another application if necessary) and retrieves the result of * the service in the pastebaord. *

* Returns YES on success, NO otherwise. */ BOOL NSPerformService(NSString *serviceItem, NSPasteboard *pboard) { NSDictionary *service; NSString *port; NSString *timeout; double seconds; NSDate *finishBy; NSString *appPath; id provider; NSString *message; NSString *selName; NSString *userData; NSString *error = nil; service = serviceFromAnyLocalizedTitle(serviceItem); if (service == nil) { NSRunAlertPanel(nil, @"No service matching '%@'", @"Continue", nil, nil, serviceItem); return NO; /* No matching service. */ } port = [service objectForKey: @"NSPortName"]; timeout = [service objectForKey: @"NSTimeout"]; if (timeout && [timeout floatValue] > 100) { seconds = [timeout floatValue] / 1000.0; } else { seconds = 30.0; } finishBy = [NSDate dateWithTimeIntervalSinceNow: seconds]; appPath = [service objectForKey: @"ServicePath"]; userData = [service objectForKey: @"NSUserData"]; message = [service objectForKey: @"NSMessage"]; selName = [message stringByAppendingString: @":userData:error:"]; /* * Locate the service provider ... this will be a proxy to the remote * object, or a local object (if we provide the service ourself) */ provider = GSContactApplication(appPath, port, finishBy); if (provider == nil) { NSRunAlertPanel(nil, @"Failed to contact service provider for '%@'", @"Continue", nil, nil, serviceItem); return NO; } /* * If the service provider is a remote object, we can set timeouts on * the NSConnection so we don't hang waiting for it to reply. */ /* This check for a remote object is ugly. When GSListener is reworked, this should be improved. For now, we can't use -isProxy since GSListener is a proxy, and we can't use -isKindOfClass: since it gets forwarded. Fortunately, -class isn't forwarded, so that's what we use. (Note, though, that we can't even use [provider class] == [GSListener class] since [GSListener -class] returns NULL instead of the real class.) */ if ([provider class] == [NSDistantObject class]) { NSConnection *connection; connection = [(NSDistantObject*)provider connectionForProxy]; seconds = [finishBy timeIntervalSinceNow]; [connection setRequestTimeout: seconds]; [connection setReplyTimeout: seconds]; } /* * At last, we ask for the service to be performed. * We create an untyped selector matching the message name we have, * Using that, we get a method signature from the provider, and * take the type information from that to make a fully typed * selector, with which we can create and use an invocation. */ NS_DURING { SEL sel = NSSelectorFromString(selName); NSMethodSignature *sig = [provider methodSignatureForSelector: sel]; if (sig != nil) { NSInvocation *inv; NSString **errPtr = &error; inv = [NSInvocation invocationWithMethodSignature: sig]; [inv setTarget: provider]; [inv setSelector: sel]; [inv setArgument: (void*)&pboard atIndex: 2]; [inv setArgument: (void*)&userData atIndex: 3]; [inv setArgument: (void*)&errPtr atIndex: 4]; [inv invoke]; } } NS_HANDLER { error = [NSString stringWithFormat: @"%@", [localException reason]]; } NS_ENDHANDLER if (error != nil) { NSRunAlertPanel(nil, @"Failed to contact service provider for '%@': %@", @"Continue", nil, nil, serviceItem, error); return NO; } return YES; } /** *

Controls whether the item name should be included in the services menu. *

*

If enabled is YES then the services menu for each application will * include the named item, if enabled is NO then the service will not be * shown in application services menus. *

*

Returns 0 if the setting is successfuly changed. Non-zero otherwise. *

*/ int NSSetShowsServicesMenuItem(NSString *name, BOOL enabled) { return [[GSServicesManager manager] setShowsServicesMenuItem: name to: enabled]; } /** * Returns a flag indicating whether the named service is supposed to be * displayed in application services menus. */ BOOL NSShowsServicesMenuItem(NSString *name) { return [[GSServicesManager manager] showsServicesMenuItem: name]; } /** * A services providing application may use this to update the list of * services it provides.
* In order to update the services advertised, the application must * create a .service bundle and place it in * ~/Library/Services before invoking this function. */ void NSUpdateDynamicServices(void) { /* Get the workspace manager to make sure that cached service info is * up to date. */ [[NSWorkspace sharedWorkspace] findApplications]; /* Reload service information from disk cache. */ [[GSServicesManager manager] loadServices]; } gnustep-gui-0.24.0/Source/GSThemeTools.m0000664000076500007650000013603612227437021017706 0ustar brains99brains99/** GSThemeTools Useful/configurable drawing functions Copyright (C) 2004 Free Software Foundation, Inc. Author: Adam Fedor Date: Jan 2004 This file is part of the GNU Objective C User interface library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import "AppKit/NSBezierPath.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSImage.h" #import "AppKit/PSOperators.h" #import "GSThemePrivate.h" #include #include @implementation GSTheme (MidLevelDrawing) - (NSRect) drawButton: (NSRect)border withClip: (NSRect)clip { NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge, NSMaxXEdge, NSMinYEdge}; NSRectEdge dn_sides[] = {NSMaxXEdge, NSMaxYEdge, NSMinXEdge, NSMinYEdge, NSMaxXEdge, NSMaxYEdge}; // These names are role names not the actual colours NSColor *black = [NSColor controlDarkShadowColor]; NSColor *dark = [NSColor controlShadowColor]; NSColor *white = [NSColor controlLightHighlightColor]; NSColor *colors[] = {black, black, white, white, dark, dark}; if ([[NSView focusView] isFlipped] == YES) { return NSDrawColorTiledRects(border, clip, dn_sides, colors, 6); } else { return NSDrawColorTiledRects(border, clip, up_sides, colors, 6); } } - (NSRect) drawDarkBezel: (NSRect)border withClip: (NSRect)clip { NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge, NSMinXEdge, NSMaxYEdge, NSMaxXEdge, NSMinYEdge}; NSRectEdge dn_sides[] = {NSMaxXEdge, NSMaxYEdge, NSMinXEdge, NSMinYEdge, NSMinXEdge, NSMinYEdge, NSMaxXEdge, NSMaxYEdge}; // These names are role names not the actual colours NSColor *black = [NSColor controlDarkShadowColor]; NSColor *dark = [NSColor controlShadowColor]; NSColor *light = [NSColor controlColor]; NSColor *white = [NSColor controlLightHighlightColor]; NSColor *colors[] = {white, white, dark, dark, black, black, light, light}; NSRect rect; if ([[NSView focusView] isFlipped] == YES) { rect = NSDrawColorTiledRects(border, clip, dn_sides, colors, 8); [dark set]; PSrectfill(NSMinX(border) + 1., NSMinY(border) - 2., 1., 1.); PSrectfill(NSMaxX(border) - 2., NSMaxY(border) + 1., 1., 1.); } else { rect = NSDrawColorTiledRects(border, clip, up_sides, colors, 8); [dark set]; PSrectfill(NSMinX(border) + 1., NSMinY(border) + 1., 1., 1.); PSrectfill(NSMaxX(border) - 2., NSMaxY(border) - 2., 1., 1.); } return rect; } - (NSRect) drawDarkButton: (NSRect)border withClip: (NSRect)clip { NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge}; NSRectEdge dn_sides[] = {NSMaxXEdge, NSMaxYEdge, NSMinXEdge, NSMinYEdge}; // These names are role names not the actual colours NSColor *black = [NSColor controlDarkShadowColor]; NSColor *white = [NSColor controlHighlightColor]; NSColor *colors[] = {black, black, white, white}; if ([[NSView focusView] isFlipped] == YES) { return NSDrawColorTiledRects(border, clip, dn_sides, colors, 4); } else { return NSDrawColorTiledRects(border, clip, up_sides, colors, 4); } } - (NSRect) drawFramePhoto: (NSRect)border withClip: (NSRect)clip { NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge, NSMaxXEdge, NSMinYEdge}; NSRectEdge dn_sides[] = {NSMaxXEdge, NSMaxYEdge, NSMinXEdge, NSMinYEdge, NSMaxXEdge, NSMaxYEdge}; // These names are role names not the actual colours NSColor *black = [NSColor controlDarkShadowColor]; NSColor *dark = [NSColor controlShadowColor]; NSColor *colors[] = {dark, dark, dark, dark, black,black}; if ([[NSView focusView] isFlipped] == YES) { return NSDrawColorTiledRects(border, clip, dn_sides, colors, 6); } else { return NSDrawColorTiledRects(border, clip, up_sides, colors, 6); } } #if 1 - (NSRect) drawGradientBorder: (NSGradientType)gradientType inRect: (NSRect)border withClip: (NSRect)clip { NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge}; NSRectEdge dn_sides[] = {NSMaxXEdge, NSMaxYEdge, NSMinXEdge, NSMinYEdge}; NSColor *black = [NSColor controlDarkShadowColor]; NSColor *dark = [NSColor controlShadowColor]; NSColor *light = [NSColor controlColor]; NSColor **colors; NSColor *concaveWeak[] = {dark, dark, light, light}; NSColor *concaveStrong[] = {black, black, light, light}; NSColor *convexWeak[] = {light, light, dark, dark}; NSColor *convexStrong[] = {light, light, black, black}; NSRect rect; switch (gradientType) { case NSGradientConcaveWeak: colors = concaveWeak; break; case NSGradientConcaveStrong: colors = concaveStrong; break; case NSGradientConvexWeak: colors = convexWeak; break; case NSGradientConvexStrong: colors = convexStrong; break; case NSGradientNone: default: return border; } if ([[NSView focusView] isFlipped] == YES) { rect = NSDrawColorTiledRects(border, clip, dn_sides, colors, 4); } else { rect = NSDrawColorTiledRects(border, clip, up_sides, colors, 4); } return rect; } #else // FIXME: I think this method is wrong. - (NSRect) drawGradientBorder: (NSGradientType)gradientType inRect: (NSRect)cellFrame withClip: (NSRect)clip { float start_white = 0.0; float end_white = 0.0; float white = 0.0; float white_step = 0.0; float h, s, v, a; NSPoint p1, p2; NSColor *gray = nil; NSColor *darkGray = nil; NSColor *lightGray = nil; lightGray = [NSColor colorWithDeviceRed: NSLightGray green: NSLightGray blue: NSLightGray alpha:1.0]; gray = [NSColor colorWithDeviceRed: NSGray green: NSGray blue: NSGray alpha:1.0]; darkGray = [NSColor colorWithDeviceRed: NSDarkGray green: NSDarkGray blue: NSDarkGray alpha:1.0]; switch (gradientType) { case NSGradientNone: return NSZeroRect; break; case NSGradientConcaveWeak: [gray getHue: &h saturation: &s brightness: &v alpha: &a]; start_white = [lightGray brightnessComponent]; end_white = [gray brightnessComponent]; break; case NSGradientConvexWeak: [darkGray getHue: &h saturation: &s brightness: &v alpha: &a]; start_white = [gray brightnessComponent]; end_white = [lightGray brightnessComponent]; break; case NSGradientConcaveStrong: [lightGray getHue: &h saturation: &s brightness: &v alpha: &a]; start_white = [lightGray brightnessComponent]; end_white = [darkGray brightnessComponent]; break; case NSGradientConvexStrong: [darkGray getHue: &h saturation: &s brightness: &v alpha: &a]; start_white = [darkGray brightnessComponent]; end_white = [lightGray brightnessComponent]; break; default: break; } white = start_white; white_step = fabs(start_white - end_white) / (cellFrame.size.width + cellFrame.size.height); // Start from top left p1 = NSMakePoint(cellFrame.origin.x, cellFrame.size.height + cellFrame.origin.y); p2 = NSMakePoint(cellFrame.origin.x, cellFrame.size.height + cellFrame.origin.y); // Move by Y while (p1.y > cellFrame.origin.y) { [[NSColor colorWithDeviceHue: h saturation: s brightness: white alpha: 1.0] set]; [NSBezierPath strokeLineFromPoint: p1 toPoint: p2]; if (start_white > end_white) white -= white_step; else white += white_step; p1.y -= 1.0; if (p2.x < (cellFrame.size.width + cellFrame.origin.x)) p2.x += 1.0; else p2.y -= 1.0; } // Move by X while (p1.x < (cellFrame.size.width + cellFrame.origin.x)) { [[NSColor colorWithDeviceHue: h saturation: s brightness: white alpha: 1.0] set]; [NSBezierPath strokeLineFromPoint: p1 toPoint: p2]; if (start_white > end_white) white -= white_step; else white += white_step; p1.x += 1.0; if (p2.x >= (cellFrame.size.width + cellFrame.origin.x)) p2.y -= 1.0; else p2.x += 1.0; } return NSZeroRect; } #endif - (NSRect) drawGrayBezel: (NSRect)border withClip: (NSRect)clip { NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge, NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge}; NSRectEdge dn_sides[] = {NSMaxXEdge, NSMaxYEdge, NSMinXEdge, NSMinYEdge, NSMaxXEdge, NSMaxYEdge, NSMinXEdge, NSMinYEdge}; // These names are role names not the actual colours NSColor *black = [NSColor controlDarkShadowColor]; NSColor *dark = [NSColor controlShadowColor]; NSColor *light = [NSColor controlColor]; NSColor *white = [NSColor controlLightHighlightColor]; NSColor *colors[] = {white, white, dark, dark, light, light, black, black}; NSRect rect; if ([[NSView focusView] isFlipped] == YES) { rect = NSDrawColorTiledRects(border, clip, dn_sides, colors, 8); [dark set]; PSrectfill(NSMinX(border) + 1., NSMaxY(border) - 2., 1., 1.); PSrectfill(NSMaxX(border) - 2., NSMinY(border) + 1., 1., 1.); } else { rect = NSDrawColorTiledRects(border, clip, up_sides, colors, 8); [dark set]; PSrectfill(NSMinX(border) + 1., NSMinY(border) + 1., 1., 1.); PSrectfill(NSMaxX(border) - 2., NSMaxY(border) - 2., 1., 1.); } return rect; } - (NSRect) drawGroove: (NSRect)border withClip: (NSRect)clip { // go clockwise from the top twice -- makes the groove come out right NSRectEdge up_sides[] = {NSMaxYEdge, NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge, NSMaxXEdge, NSMinYEdge, NSMinXEdge}; NSRectEdge dn_sides[] = {NSMinYEdge, NSMaxXEdge, NSMaxYEdge, NSMinXEdge, NSMinYEdge, NSMaxXEdge, NSMaxYEdge, NSMinXEdge}; // These names are role names not the actual colours NSColor *dark = [NSColor controlShadowColor]; NSColor *white = [NSColor controlLightHighlightColor]; NSColor *colors[] = {dark, white, white, dark, white, dark, dark, white}; if ([[NSView focusView] isFlipped] == YES) { return NSDrawColorTiledRects(border, clip, dn_sides, colors, 8); } else { return NSDrawColorTiledRects(border, clip, up_sides, colors, 8); } } - (NSRect) drawLightBezel: (NSRect)border withClip: (NSRect)clip { NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge, NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge}; NSRectEdge dn_sides[] = {NSMaxXEdge, NSMaxYEdge, NSMinXEdge, NSMinYEdge, NSMaxXEdge, NSMaxYEdge, NSMinXEdge, NSMinYEdge}; // These names are role names not the actual colours NSColor *dark = [NSColor controlShadowColor]; NSColor *light = [NSColor controlColor]; NSColor *white = [NSColor controlLightHighlightColor]; NSColor *colors[] = {white, white, dark, dark, light, light, dark, dark}; if ([[NSView focusView] isFlipped] == YES) { return NSDrawColorTiledRects(border, clip, dn_sides, colors, 8); } else { return NSDrawColorTiledRects(border, clip, up_sides, colors, 8); } } - (NSRect) drawWhiteBezel: (NSRect)border withClip: (NSRect)clip { NSRectEdge up_sides[] = {NSMaxYEdge, NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge, NSMaxXEdge, NSMinYEdge, NSMinXEdge}; NSRectEdge dn_sides[] = {NSMinYEdge, NSMaxXEdge, NSMaxYEdge, NSMinXEdge, NSMinYEdge, NSMaxXEdge, NSMaxYEdge, NSMinXEdge}; // These names are role names not the actual colours NSColor *dark = [NSColor controlShadowColor]; NSColor *light = [NSColor controlColor]; NSColor *white = [NSColor controlLightHighlightColor]; NSColor *colors[] = {dark, white, white, dark, dark, light, light, dark}; if ([[NSView focusView] isFlipped] == YES) { return NSDrawColorTiledRects(border, clip, dn_sides, colors, 8); } else { return NSDrawColorTiledRects(border, clip, up_sides, colors, 8); } } - (void) drawRoundBezel: (NSRect)cellFrame withColor: (NSColor*)backgroundColor { NSBezierPath *p = [NSBezierPath bezierPath]; NSPoint point; CGFloat radius; // make smaller than enclosing frame cellFrame = NSInsetRect(cellFrame, 4, floor(cellFrame.size.height * 0.1875)); radius = cellFrame.size.height / 2.0; point = cellFrame.origin; point.x += radius; point.y += radius; // Draw initial path to enclose the button... // left half-circle p = [NSBezierPath bezierPath]; [p appendBezierPathWithArcWithCenter: point radius: radius startAngle: 90.0 endAngle: 270.0]; // line to first point and right halfcircle point.x += cellFrame.size.width - cellFrame.size.height; [p appendBezierPathWithArcWithCenter: point radius: radius startAngle: 270.0 endAngle: 90.0]; [p closePath]; // fill with background color [backgroundColor set]; [p fill]; // and stroke rounded button [[NSColor shadowColor] set]; [p stroke]; // Add highlights... point = cellFrame.origin; point.x += radius; point.y += radius; p = [NSBezierPath bezierPath]; [p setLineWidth: 2.0]; [p appendBezierPathWithArcWithCenter: point radius: radius startAngle: 120.0 endAngle: 270.0]; // line to first point and right halfcircle point.x += cellFrame.size.width - cellFrame.size.height; [p appendBezierPathWithArcWithCenter: point radius: radius startAngle: 270.0 endAngle: 270.0]; [[NSColor controlLightHighlightColor] set]; [p stroke]; } - (void) drawCircularBezel: (NSRect)cellFrame withColor: (NSColor*)backgroundColor { // make smaller so that it does not touch frame NSBezierPath *oval; oval = [NSBezierPath bezierPathWithOvalInRect: NSInsetRect(cellFrame, 1, 1)]; // fill oval with background color [backgroundColor set]; [oval fill]; // and stroke rounded button [[NSColor shadowColor] set]; [oval stroke]; } @end @implementation GSTheme (LowLevelDrawing) - (void) fillHorizontalRect: (NSRect)rect withImage: (NSImage*)image fromRect: (NSRect)source flipped: (BOOL)flipped { NSGraphicsContext *ctxt = GSCurrentContext(); NSBezierPath *path; unsigned repetitions; float remainder; unsigned count; NSPoint p; float y; if (rect.size.width <= 0.0) [NSException raise: NSInvalidArgumentException format: @"[%@-%@] rect width is not positive", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; if (rect.size.height <= 0.0) [NSException raise: NSInvalidArgumentException format: @"[%@-%@] rect height is not positive", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; if (source.size.width <= 0.0) [NSException raise: NSInvalidArgumentException format: @"[%@-%@] source width is not positive", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; if (source.size.height <= 0.0) [NSException raise: NSInvalidArgumentException format: @"[%@-%@] source height is not positive", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; if (image == nil) [NSException raise: NSInvalidArgumentException format: @"[%@-%@] image is nil", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; ctxt = GSCurrentContext(); DPSgsave (ctxt); path = [NSBezierPath bezierPathWithRect: rect]; [path addClip]; repetitions = rect.size.width / source.size.width; remainder = rect.size.width - repetitions * source.size.width; y = rect.origin.y; if (flipped) y = rect.origin.y + rect.size.height; for (count = 0; count < repetitions; count++) { p = NSMakePoint (rect.origin.x + count * source.size.width, y); [image compositeToPoint: p fromRect: source operation: NSCompositeSourceOver]; } if (remainder > 0) { p = NSMakePoint (rect.origin.x + repetitions * source.size.width, y); source.size.width = remainder; [image compositeToPoint: p fromRect: source operation: NSCompositeSourceOver]; } DPSgrestore (ctxt); } - (void) fillRect: (NSRect)rect withRepeatedImage: (NSImage*)image fromRect: (NSRect)source center: (BOOL)center { NSGraphicsContext *ctxt; NSBezierPath *path; NSSize size; unsigned xrepetitions; unsigned yrepetitions; unsigned x; unsigned y; if (rect.size.width <= 0.0) [NSException raise: NSInvalidArgumentException format: @"[%@-%@] rect width is not positive", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; if (rect.size.height <= 0.0) [NSException raise: NSInvalidArgumentException format: @"[%@-%@] rect height is not positive", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; if (source.size.width <= 0.0) [NSException raise: NSInvalidArgumentException format: @"[%@-%@] source width is not positive", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; if (source.size.height <= 0.0) [NSException raise: NSInvalidArgumentException format: @"[%@-%@] source height is not positive", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; if (image == nil) [NSException raise: NSInvalidArgumentException format: @"[%@-%@] image is nil", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; ctxt = GSCurrentContext (); DPSgsave (ctxt); path = [NSBezierPath bezierPathWithRect: rect]; [path addClip]; size = [image size]; xrepetitions = (rect.size.width / size.width) + 1; yrepetitions = (rect.size.height / size.height) + 1; for (x = 0; x < xrepetitions; x++) { for (y = 0; y < yrepetitions; y++) { NSPoint p; p = NSMakePoint (rect.origin.x + x * size.width, rect.origin.y + y * size.height); [image compositeToPoint: p fromRect: source operation: NSCompositeSourceOver]; } } DPSgrestore (ctxt); } - (NSRect) fillRect: (NSRect)rect withTiles: (GSDrawTiles*)tiles background: (NSColor*)color { return [self fillRect: rect withTiles: tiles background: color fillStyle: [tiles fillStyle]]; } - (NSRect) fillRect: (NSRect)rect withTiles: (GSDrawTiles*)tiles { return [self fillRect: rect withTiles: tiles background: [NSColor clearColor] fillStyle: [tiles fillStyle]]; } - (NSRect) fillRect: (NSRect)rect withTiles: (GSDrawTiles*)tiles background: (NSColor*)color fillStyle: (GSThemeFillStyle)style { if (rect.size.width <= 0.0) [NSException raise: NSInvalidArgumentException format: @"[%@-%@] rect width is not positive", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; if (rect.size.height <= 0.0) [NSException raise: NSInvalidArgumentException format: @"[%@-%@] rect height is not positive", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; if (tiles == nil) [NSException raise: NSInvalidArgumentException format: @"[%@-%@] tiles is nil", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; return [tiles fillRect: rect background: color fillStyle: style]; } - (void) fillVerticalRect: (NSRect)rect withImage: (NSImage*)image fromRect: (NSRect)source flipped: (BOOL)flipped { NSGraphicsContext *ctxt; NSBezierPath *path; unsigned repetitions; float remainder; unsigned count; NSPoint p; if (rect.size.width <= 0.0) [NSException raise: NSInvalidArgumentException format: @"[%@-%@] rect width is not positive", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; if (rect.size.height <= 0.0) [NSException raise: NSInvalidArgumentException format: @"[%@-%@] rect height is not positive", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; if (source.size.width <= 0.0) [NSException raise: NSInvalidArgumentException format: @"[%@-%@] source width is not positive", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; if (source.size.height <= 0.0) [NSException raise: NSInvalidArgumentException format: @"[%@-%@] source height is not positive", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; if (image == nil) [NSException raise: NSInvalidArgumentException format: @"[%@-%@] image is nil", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; ctxt = GSCurrentContext(); DPSgsave (ctxt); path = [NSBezierPath bezierPathWithRect: rect]; [path addClip]; repetitions = rect.size.height / source.size.height; remainder = rect.size.height - repetitions * source.size.height; if (flipped) { for (count = 0; count < repetitions; count++) { p = NSMakePoint (rect.origin.x, rect.origin.y + rect.size.height - count * source.size.height); [image compositeToPoint: p fromRect: source operation: NSCompositeSourceOver]; } if (remainder > 0) { p = NSMakePoint (rect.origin.x, rect.origin.y + rect.size.height - repetitions * source.size.height); source.origin.y += source.size.height - remainder; source.size.height = remainder; [image compositeToPoint: p fromRect: source operation: NSCompositeSourceOver]; } } else { for (count = 0; count < repetitions; count++) { p = NSMakePoint (rect.origin.x, rect.origin.y + count * source.size.height); [image compositeToPoint: p fromRect: source operation: NSCompositeSourceOver]; } if (remainder > 0) { p = NSMakePoint (rect.origin.x, rect.origin.y + repetitions * source.size.height); source.size.height = remainder; [image compositeToPoint: p fromRect: source operation: NSCompositeSourceOver]; } } DPSgrestore (ctxt); } @end @implementation GSDrawTiles - (id) copyWithZone: (NSZone*)zone { GSDrawTiles *c = (GSDrawTiles*)NSCopyObject(self, 0, zone); unsigned i; for (i = 0; i < 9; i++) { c->images[i] = [images[i] copyWithZone: zone]; } c->style = style; return c; } - (void) dealloc { unsigned i; for (i = 0; i < 9; i++) { RELEASE(images[i]); } [super dealloc]; } - (NSString*) description { NSMutableString *d = [[[super description] mutableCopy] autorelease]; unsigned i; for (i = 0; i < 9; i++) { [d appendFormat: @"\n %@ %@", NSStringFromRect(rects[i]), images[i]]; } return d; } /** * Simple initialiser, assume the single image is split into nine equal tiles. * If the image size is not divisible by three, the corners are made equal * in size and the central parts slightly smaller. */ - (id) initWithImage: (NSImage*)image { NSSize s = [image size]; return [self initWithImage: image horizontal: s.width / 3.0 vertical: s.height / 3.0]; } - (id) initWithNinePatchImage: (NSImage*)image { int i; CGFloat r,g,b,a; int x1 = -1; // x1, x2, y1, y2, are in flipped coordinates int x2 = -1; // 0,0 is the top-left pixel int y1 = -1; int y2 = -1; NSSize s = [image size]; NSBitmapImageRep* rep = [[image representations] objectAtIndex: 0]; for (i = 0; i < s.width; i++) { NSColor *pixelColor = [rep colorAtX: i y: 0]; [pixelColor getRed: &r green: &g blue: &b alpha: &a]; if (a > 0 && x1 == -1) { x1 = i; } else if (a == 0 && x1 != -1) { x2 = i - 1; break; } } for (i = 0; i < s.height; i++) { NSColor *pixelColor = [rep colorAtX: 0 y: i]; [pixelColor getRed: &r green: &g blue: &b alpha: &a]; if (a > 0 && y1 == -1) { y1 = i; } else if (a == 0 && y1 != -1) { y2 = i - 1; break; } } scaleFactor = 1.0f; style = GSThemeFillStyleScaleAll; // These are all in _unflipped_ coordinates rects[TileTL] = NSMakeRect(1, s.height - y1, x1 - 1, y1 - 1); rects[TileTM] = NSMakeRect(x1, s.height - y1, 1 + x2 - x1, y1 - 1); rects[TileTR] = NSMakeRect(x2 + 1, s.height - y1, s.width - x2 - 2, y1 - 1); rects[TileCL] = NSMakeRect(1, s.height - y2 - 1, x1 - 1, 1 + y2 - y1); rects[TileCM] = NSMakeRect(x1, s.height - y2 - 1, 1 + x2 - x1, 1 + y2 - y1); rects[TileCR] = NSMakeRect(x2 + 1, s.height - y2 - 1, s.width - x2 - 2, 1 + y2 - y1); rects[TileBL] = NSMakeRect(1, 1, x1 - 1, s.height - y2 - 2); rects[TileBM] = NSMakeRect(x1, 1, 1 + x2 - x1, s.height - y2 - 2); rects[TileBR] = NSMakeRect(x2 + 1, 1, s.width - x2 - 2, s.height - y2 - 2); // Measure the content rect (the right and bottom edges of the nine-patch // data) x1 = -1; x2 = -1; y1 = -1; y2 = -1; for (i = 0; i < s.width; i++) { NSColor *pixelColor = [rep colorAtX: i y: s.height - 1]; [pixelColor getRed: &r green: &g blue: &b alpha: &a]; if ((a == 1 && r == 0 && g == 0 && b == 0) && x1 == -1) { x1 = i; } else if (!(a == 1 && r == 0 && g == 0 && b == 0) && x1 != -1) { x2 = i - 1; break; } } for (i = 0; i < s.height; i++) { NSColor *pixelColor = [rep colorAtX: s.width - 1 y: i]; [pixelColor getRed: &r green: &g blue: &b alpha: &a]; if ((a == 1 && r == 0 && g == 0 && b == 0) && y1 == -1) { y1 = i; } else if (!(a == 1 && r == 0 && g == 0 && b == 0) && y1 != -1) { y2 = i - 1; break; } } // Specifying the content rect part of the nine-patch image is optional // ; if either the horizontal or vertical information is missing, use the // geometry from rects[TileCM] // contentRect is in unflipped coordinates, like rects[] if (x1 == -1) { contentRect.origin.x = rects[TileCM].origin.x; contentRect.size.width = rects[TileCM].size.width; } else { contentRect.origin.x = x1; contentRect.size.width = 1 + x2 - x1; } if (y1 == -1) { contentRect.origin.y = rects[TileCM].origin.y; contentRect.size.height = rects[TileCM].size.height; } else { contentRect.origin.y = s.height - y2 - 1; contentRect.size.height = 1 + y2 - y1; } // Measure the layout rect (the right and bottom edges of the nine-patch // data which _isn't_ red pixels) x1 = -1; x2 = -1; y1 = -1; y2 = -1; for (i = 1; i < (s.width - 1); i++) { NSColor *pixelColor = [rep colorAtX: i y: s.height - 1]; [pixelColor getRed: &r green: &g blue: &b alpha: &a]; if (!(a == 1 && r == 1 && g == 0 && b == 0) && x1 == -1) { x1 = i; } else if ((a == 1 && r == 1 && g == 0 && b == 0) && x1 != -1) { x2 = i - 1; break; } } for (i = 1; i < (s.height - 1); i++) { NSColor *pixelColor = [rep colorAtX: s.width - 1 y: i]; [pixelColor getRed: &r green: &g blue: &b alpha: &a]; if (!(a == 1 && r == 1 && g == 0 && b == 0) && y1 == -1) { y1 = i; } else if ((a == 1 && r == 1 && g == 0 && b == 0) && y1 != -1) { y2 = i - 1; break; } } if (x2 == -1) { x2 = s.width - 2; } if (y2 == -1) { y2 = s.height - 2; } layoutRect = NSMakeRect(x1, s.height - y2 - 1, 1 + x2 - x1, 1 + y2 - y1); [self validateTilesSizeWithImage: image]; return self; } - (NSImage*) extractImageFrom: (NSImage*) image withRect: (NSRect) rect { NSImage *img = [[NSImage alloc] initWithSize: rect.size]; [img lockFocus]; [image drawAtPoint: NSMakePoint(0, 0) fromRect: rect operation: NSCompositeSourceOver fraction: 1.0]; [img unlockFocus]; [img TIFFRepresentation]; // creates a proper NSBitmapImageRep return [img autorelease]; } - (void) validateTilesSizeWithImage: (NSImage*)image { int i; originalRectCM = rects[TileCM]; for (i = 0; i < 9; i++) { if (rects[i].origin.x < 0.0 || rects[i].origin.y < 0.0 || rects[i].size.width <= 0.0 || rects[i].size.height <= 0.0) { images[i] = nil; rects[i] = NSZeroRect; } else { images[i] = [[self extractImageFrom: image withRect: rects[i]] retain]; // FIXME: This makes no sense to me, why not leave the // rect origins at their original values? rects[i].origin.x = 0; rects[i].origin.y = 0; } } if (contentRect.origin.x < 0.0 || contentRect.origin.y < 0.0 || contentRect.size.width <= 0.0 || contentRect.size.height <= 0.0) { contentRect = rects[TileCM]; } } - (id) initWithImage: (NSImage*)image horizontal: (float)x vertical: (float)y { NSSize s = [image size]; x = floor(x); y = floor(y); scaleFactor = 1.0; rects[TileTL] = NSMakeRect(0.0, s.height - y, x, y); rects[TileTM] = NSMakeRect(x, s.height - y, s.width - 2.0 * x, y); rects[TileTR] = NSMakeRect(s.width - x, s.height - y, x, y); rects[TileCL] = NSMakeRect(0.0, y, x, s.height - 2.0 * y); rects[TileCM] = NSMakeRect(x, y, s.width - 2.0 * x, s.height - 2.0 * y); rects[TileCR] = NSMakeRect(s.width - x, y, x, s.height - 2.0 * y); rects[TileBL] = NSMakeRect(0.0, 0.0, x, y); rects[TileBM] = NSMakeRect(x, 0.0, s.width - 2.0 * x, y); rects[TileBR] = NSMakeRect(s.width - x, 0.0, x, y); contentRect = rects[TileCM]; style = GSThemeFillStyleNone; [self validateTilesSizeWithImage: image]; return self; } - (void) scaleTo: (float)scale { unsigned i; NSSize s; if (scale == scaleFactor) { return; } [images[0] setScalesWhenResized: YES]; s = [images[0] size]; s.width *= scale; s.height *= scale; [images[0] setSize: s]; rects[0].size.height *= scale; rects[0].size.width *= scale; rects[0].origin.x *= scale; rects[0].origin.y *= scale; for (i = 1; i < 9; i++) { unsigned j; for (j = 0; j < i; j++) { if (images[i] == images[j]) { break; } } if (j == i) { [images[i] setScalesWhenResized: YES]; s = [images[i] size]; s.width *= scale; s.height *= scale; [images[i] setSize: s]; } rects[i].size.height *= scale; rects[i].size.width *= scale; rects[i].origin.x *= scale; rects[i].origin.y *= scale; } contentRect.size.height *= scale; contentRect.size.width *= scale; contentRect.origin.x *= scale; contentRect.origin.y *= scale; } - (NSRect) fillRect: (NSRect)rect background: (NSColor*)color { return [self fillRect: rect background: color fillStyle: style]; } - (NSRect) fillRect: (NSRect)rect background: (NSColor*)color fillStyle: (GSThemeFillStyle)aStyle { if (color == nil) { [[NSColor redColor] set]; } else { [color set]; } // NSRectFill(rect); switch (aStyle) { case GSThemeFillStyleNone: return [self noneStyleFillRect: rect]; case GSThemeFillStyleScale: return [self scaleStyleFillRect: rect]; case GSThemeFillStyleRepeat: return [self repeatStyleFillRect: rect]; case GSThemeFillStyleCenter: return [self centerStyleFillRect: rect]; case GSThemeFillStyleMatrix: return [self matrixStyleFillRect: rect]; case GSThemeFillStyleScaleAll: return [self scaleAllStyleFillRect: rect]; } return NSZeroRect; } - (NSSize) computeTotalTilesSize { NSSize tsz; tsz.width = rects[TileTL].size.width + rects[TileTR].size.width; if (images[TileTM] != nil) { tsz.width += rects[TileTM].size.width; } tsz.height = rects[TileTL].size.height + rects[TileBL].size.height; if (images[TileCL] != nil) { tsz.height += rects[TileCL].size.height; } return tsz; } - (GSThemeMargins) themeMargins { NSRect cm = originalRectCM; GSThemeMargins margins; margins.left = rects[TileCL].size.width; margins.right = rects[TileCR].size.width; margins.top = rects[TileTM].size.height; margins.bottom = rects[TileBM].size.height; // Adjust for contentRect != cm margins.left += (contentRect.origin.x - cm.origin.x); margins.bottom += (contentRect.origin.y - cm.origin.y); margins.right += (NSMaxX(cm) - NSMaxX(contentRect)); margins.top += (NSMaxY(cm) - NSMaxY(contentRect)); return margins; } - (NSRect) contentRectForRect: (NSRect)rect isFlipped: (BOOL)flipped { GSThemeMargins margins = [self themeMargins]; rect.origin.x += margins.left; rect.origin.y += flipped ? margins.top : margins.bottom; rect.size.width -= (margins.left + margins.right); rect.size.height -= (margins.top + margins.bottom); return rect; } - (NSRect) noneStyleFillRect: (NSRect)rect { NSRect inFill = [self contentRectForRect: rect isFlipped: NO]; [self repeatFillRect: rect]; [self drawCornersRect: rect]; return inFill; } - (NSRect) centerStyleFillRect: (NSRect)rect { BOOL flipped = [[GSCurrentContext() focusView] isFlipped]; NSRect r = rects[TileCM]; NSRect inFill = [self contentRectForRect: rect isFlipped: flipped]; [self repeatFillRect: rect]; [self drawCornersRect: rect]; r.origin.x = inFill.origin.x + (inFill.size.width - r.size.width) / 2; r.origin.y = inFill.origin.y + (inFill.size.height - r.size.height) / 2; if (flipped) { r.origin.y += r.size.height; } [images[TileCM] compositeToPoint: r.origin fromRect: rects[TileCM] operation: NSCompositeSourceOver]; return inFill; } - (NSRect) repeatStyleFillRect: (NSRect)rect { BOOL flipped = [[GSCurrentContext() focusView] isFlipped]; NSSize tsz = [self computeTotalTilesSize]; NSRect inFill = [self contentRectForRect: rect isFlipped: flipped]; [self repeatFillRect: rect]; [self drawCornersRect: rect]; [[GSTheme theme] fillRect: inFill withRepeatedImage: images[TileCM] fromRect: rects[TileCM] center: !flipped]; NSLog(@"rect %@ too small for tiles %@", NSStringFromSize(rect.size), NSStringFromSize(tsz)); return inFill; } - (NSRect) scaleStyleFillRect: (NSRect)rect { BOOL flipped = [[GSCurrentContext() focusView] isFlipped]; NSRect inFill = [self contentRectForRect: rect isFlipped: flipped]; NSImage *im = [images[TileCM] copy]; NSRect r = rects[TileCM]; NSSize s = [images[TileCM] size]; NSPoint p = inFill.origin; float sx = inFill.size.width / r.size.width; float sy = inFill.size.height / r.size.height; [self repeatFillRect: rect]; [self drawCornersRect: rect]; r.size.width = inFill.size.width; r.size.height = inFill.size.height; r.origin.x *= sx; r.origin.y *= sy; s.width *= sx; s.height *= sy; if (flipped) { p.y += inFill.size.height; } [im setScalesWhenResized: YES]; [im setSize: s]; [im compositeToPoint: p fromRect: r operation: NSCompositeSourceOver]; RELEASE(im); return inFill; } - (NSRect) scaleAllStyleFillRect: (NSRect)rect { BOOL flipped = [[GSCurrentContext() focusView] isFlipped]; NSSize cls = rects[TileCL].size; NSSize bms = rects[TileBM].size; NSSize crs = rects[TileCR].size; NSSize tms = rects[TileTM].size; NSImage *img; NSRect imgRect; NSRect inFill = [self contentRectForRect: rect isFlipped: flipped]; [self scaleFillRect: rect]; [self drawCornersRect: rect]; // Draw center scaled img = images[TileCM]; imgRect = NSMakeRect(0, 0, rect.size.width - cls.width - crs.width, rect.size.height - tms.height - bms.height); if (imgRect.size.width > 0 && imgRect.size.height > 0) { NSPoint p; [img setScalesWhenResized: YES]; [img setSize: imgRect.size]; p = NSMakePoint(rect.origin.x + cls.width, rect.origin.y + bms.height); if (flipped) { p.y = rect.origin.y + rect.size.height - bms.height; } [img compositeToPoint: p fromRect: imgRect operation: NSCompositeSourceOver]; } return inFill; } - (NSRect) matrixStyleFillRect: (NSRect)rect { NSSize tsz = [self computeTotalTilesSize]; NSRect grid = NSZeroRect; float x; float y; float space = 3.0; float scale; BOOL flipped = [[GSCurrentContext() focusView] isFlipped]; if (images[TileTM] == nil) { grid.size.width = tsz.width + space * 3.0; } else { grid.size.width = tsz.width + space * 4.0; } scale = rect.size.width / grid.size.width; if (images[TileCL] == nil) { grid.size.height = tsz.height + space * 3.0; } else { grid.size.height = tsz.height + space * 4.0; } if ((rect.size.height / grid.size.height) < scale) { scale = rect.size.height / grid.size.height; } if (floor(scale) >= 1) { scale = floor(scale); } if (scale != 1) { // We need to scale the tiles down to fit. grid.size.width *= scale; grid.size.height *= scale; space *= scale; [self scaleTo: scale]; } grid.origin.x = rect.origin.x + (rect.size.width - grid.size.width) / 2; x = grid.origin.x; if (flipped) { grid.origin.y = NSMaxY(rect) - (rect.size.height - grid.size.height) / 2; y = NSMaxY(grid); } else { grid.origin.y = rect.origin.y + (rect.size.height - grid.size.height) / 2; y = grid.origin.y; } // Draw bottom row if (flipped) { y -= (rects[TileBL].size.height + space); } else { y += space; } [images[TileBL] compositeToPoint: NSMakePoint(x, y) fromRect: rects[TileBL] operation: NSCompositeSourceOver]; x += rects[TileBL].size.width + space; if (images[TileBM] != nil) { [images[TileBM] compositeToPoint: NSMakePoint(x, y) fromRect: rects[TileBM] operation: NSCompositeSourceOver]; x += rects[TileBM].size.width + space; } [images[TileBR] compositeToPoint: NSMakePoint(x, y) fromRect: rects[TileBR] operation: NSCompositeSourceOver]; if (!flipped) { y += rects[TileBL].size.height; } // Draw middle row if (images[TileCL] != nil) { x = grid.origin.x; if (flipped) { y -= (rects[TileCL].size.height + space); } else { y += space; } [images[TileCL] compositeToPoint: NSMakePoint(x, y) fromRect: rects[TileCL] operation: NSCompositeSourceOver]; x += rects[TileCL].size.width + space; if (images[TileCM] != nil) { [images[TileCM] compositeToPoint: NSMakePoint(x, y) fromRect: rects[TileCM] operation: NSCompositeSourceOver]; x += rects[TileCM].size.width + space; } [images[TileCR] compositeToPoint: NSMakePoint(x, y) fromRect: rects[TileCR] operation: NSCompositeSourceOver]; if (!flipped) { y += rects[TileCL].size.height; } } // Draw top row x = grid.origin.x; if (flipped) { y -= (rects[TileTL].size.height + space); } else { y += space; } [images[TileTL] compositeToPoint: NSMakePoint(x, y) fromRect: rects[TileTL] operation: NSCompositeSourceOver]; x += rects[TileTL].size.width + space; if (images[TileTM] != nil) { [images[TileTM] compositeToPoint: NSMakePoint(x, y) fromRect: rects[TileTM] operation: NSCompositeSourceOver]; x += rects[TileTM].size.width + space; } [images[TileTR] compositeToPoint: NSMakePoint(x, y) fromRect: rects[TileTR] operation: NSCompositeSourceOver]; if (scale != 1) { [self scaleTo: 1.0f/scale]; } return NSZeroRect; } - (void) repeatFillRect: (NSRect)rect { BOOL flipped = [[GSCurrentContext() focusView] isFlipped]; NSSize tls = rects[TileTL].size; NSSize tms = rects[TileTM].size; NSSize trs = rects[TileTR].size; NSSize cls = rects[TileCL].size; NSSize crs = rects[TileCR].size; NSSize bls = rects[TileBL].size; NSSize bms = rects[TileBM].size; NSSize brs = rects[TileBR].size; // Draw Top-Middle image repeated if (rect.size.width > tls.width + trs.width && tms.height > 0) { float y = rect.origin.y + rect.size.height - tms.height; if (flipped) { y = rect.origin.y; } [[GSTheme theme] fillHorizontalRect: NSMakeRect (rect.origin.x + tls.width, y, rect.size.width - tls.width - trs.width, tms.height) withImage: images[TileTM] fromRect: rects[TileTM] flipped: flipped]; } // Draw Bottom-Middle image repeated if (rect.size.width > bls.width + brs.width && bms.height > 0) { float y = rect.origin.y; if (flipped) { y = rect.origin.y + rect.size.height - bms.height; } [[GSTheme theme] fillHorizontalRect: NSMakeRect (rect.origin.x + bls.width, y, rect.size.width - bls.width - brs.width, bms.height) withImage: images[TileBM] fromRect: rects[TileBM] flipped: flipped]; } // Draw Center-Left image repeated if (rect.size.height > bls.height + tls.height && cls.width > 0) { [[GSTheme theme] fillVerticalRect: NSMakeRect (rect.origin.x, rect.origin.y + bls.height, cls.width, rect.size.height - bls.height - tls.height) withImage: images[TileCL] fromRect: rects[TileCL] flipped: flipped]; } // Draw Center-Right image repeated if (rect.size.height > brs.height + trs.height && crs.width > 0) { [[GSTheme theme] fillVerticalRect: NSMakeRect (rect.origin.x + rect.size.width - crs.width, rect.origin.y + brs.height, crs.width, rect.size.height - brs.height - trs.height) withImage: images[TileCR] fromRect: rects[TileCR] flipped: flipped]; } } - (void) scaleFillRect: (NSRect)rect { BOOL flipped = [[GSCurrentContext() focusView] isFlipped]; NSImage *img; NSRect imgRect; NSPoint p; NSSize tls = rects[TileTL].size; NSSize tms = rects[TileTM].size; NSSize trs = rects[TileTR].size; NSSize cls = rects[TileCL].size; NSSize crs = rects[TileCR].size; NSSize bls = rects[TileBL].size; NSSize bms = rects[TileBM].size; NSSize brs = rects[TileBR].size; // Draw Top-Middle image scaled img = images[TileTM]; imgRect = NSMakeRect(0, 0, rect.size.width - tls.width - trs.width, tms.height); if (imgRect.size.width > 0 && imgRect.size.height > 0) { [img setScalesWhenResized: YES]; [img setSize: imgRect.size]; p = NSMakePoint(rect.origin.x + tls.width, rect.origin.y + rect.size.height - tms.height); if (flipped) { p.y = rect.origin.y + tms.height; } [img compositeToPoint: p fromRect: imgRect operation: NSCompositeSourceOver]; } // Draw Bottom-Middle image scaled img = images[TileBM]; imgRect = NSMakeRect(0, 0, rect.size.width - bls.width - brs.width, bms.height); if (imgRect.size.width > 0 && imgRect.size.height > 0) { [img setScalesWhenResized: YES]; [img setSize: imgRect.size]; p = NSMakePoint(rect.origin.x + bls.width, rect.origin.y); if (flipped) { p.y = rect.origin.y + rect.size.height; } [img compositeToPoint: p fromRect: imgRect operation: NSCompositeSourceOver]; } // Draw Center-Left image scaled img = images[TileCL]; imgRect = NSMakeRect(0, 0, cls.width, rect.size.height - tls.height - bls.height); if (imgRect.size.width > 0 && imgRect.size.height > 0) { [img setScalesWhenResized: YES]; [img setSize: imgRect.size]; p = NSMakePoint(rect.origin.x, rect.origin.y + bls.height); if (flipped) { p.y = rect.origin.y + rect.size.height - bls.height; } [img compositeToPoint: p fromRect: imgRect operation: NSCompositeSourceOver]; } // Draw Center-Right image scaled img = images[TileCR]; imgRect = NSMakeRect(0, 0, crs.width, rect.size.height - trs.height - brs.height); if (imgRect.size.width > 0 && imgRect.size.height > 0) { [img setScalesWhenResized: YES]; [img setSize: imgRect.size]; p = NSMakePoint(rect.origin.x + rect.size.width - crs.width, rect.origin.y + brs.height); if (flipped) { p.y = rect.origin.y + rect.size.height - brs.height; } [img compositeToPoint: p fromRect: imgRect operation: NSCompositeSourceOver]; } } - (void) drawCornersRect: (NSRect)rect { BOOL flipped = [[GSCurrentContext() focusView] isFlipped]; NSSize tls = rects[TileTL].size; NSSize trs = rects[TileTR].size; NSSize brs = rects[TileBR].size; NSPoint p; p = NSMakePoint (rect.origin.x, rect.origin.y + rect.size.height - tls.height); if (flipped) { p.y = rect.origin.y + tls.height; } [images[TileTL] compositeToPoint: p fromRect: rects[TileTL] operation: NSCompositeSourceOver]; // Is this right? // p = NSMakePoint(rect.origin.x + rect.size.width - trs.width + 1, p = NSMakePoint(rect.origin.x + rect.size.width - trs.width, rect.origin.y + rect.size.height - trs.height); if (flipped) { p.y = rect.origin.y + tls.height; } [images[TileTR] compositeToPoint: p fromRect: rects[TileTR] operation: NSCompositeSourceOver]; p = NSMakePoint(rect.origin.x, rect.origin.y); if (flipped) { p.y = rect.origin.y + rect.size.height; } [images[TileBL] compositeToPoint: p fromRect: rects[TileBL] operation: NSCompositeSourceOver]; // Is this right? // p = NSMakePoint(rect.origin.x + rect.size.width - brs.width + 1, p = NSMakePoint(rect.origin.x + rect.size.width - brs.width, rect.origin.y); if (flipped) { p.y = rect.origin.y + rect.size.height; } [images[TileBR] compositeToPoint: p fromRect: rects[TileBR] operation: NSCompositeSourceOver]; } - (GSThemeFillStyle) fillStyle { return style; } - (void) setFillStyle: (GSThemeFillStyle)aStyle { style = aStyle; } - (NSSize) size { const CGFloat width = rects[TileCL].size.width + rects[TileCM].size.width + rects[TileCR].size.width; const CGFloat height = rects[TileTM].size.height + rects[TileCM].size.height + rects[TileBM].size.height; return NSMakeSize(width, height); } @end gnustep-gui-0.24.0/Source/NSBitmapImageRep+PNG.m0000664000076500007650000002674112231040020021061 0ustar brains99brains99/* NSBitmapImageRep+PNG.m Methods for loading .png images. Copyright (C) 2003-2013 Free Software Foundation, Inc. Written by: Alexander Malmberg Date: 2003-12-07 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" /* we include PNG stuff only if required and before the resto to avoid header and redeclaration problems (setjmp, etc) */ #ifdef HAVE_LIBPNG #include #if defined(PNG_FLOATING_POINT_SUPPORT) # define PNG_FLOATING_POINT 1 #else # define PNG_FLOATING_POINT 0 #endif #if defined(PNG_gAMA_SUPPORT) # define PNG_gAMA 1 #else # define PNG_gAMA 0 #endif #endif /* HAVE_LIBPNG */ /* we import all the standard headers to allow compilation without PNG */ #import #import #import #import #import #import "AppKit/NSGraphics.h" #import "NSBitmapImageRep+PNG.h" #ifdef HAVE_LIBPNG @implementation NSBitmapImageRep (PNG) + (BOOL) _bitmapIsPNG: (NSData *)imageData { if (![imageData length]) return NO; if (!png_sig_cmp((png_bytep)[imageData bytes], 0, [imageData length])) return YES; return NO; } typedef struct { NSData *data; unsigned int offset; } reader_struct_t; static void reader_func(png_structp png_struct, png_bytep data, png_size_t length) { reader_struct_t *r = png_get_io_ptr(png_struct); if (r->offset + length > [r->data length]) { png_error(png_struct, "end of buffer"); return; } memcpy(data, [r->data bytes] + r->offset, length); r->offset += length; } - (id) _initBitmapFromPNG: (NSData *)imageData { png_structp png_struct; png_infop png_info, png_end_info; int width,height; unsigned char *buf = NULL; int bytes_per_row; int type,channels,depth; BOOL alpha; int bpp; NSString *colorspace; reader_struct_t reader; if (!(self = [super init])) return nil; png_struct = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); if (!png_struct) { RELEASE(self); return nil; } png_info = png_create_info_struct(png_struct); if (!png_info) { png_destroy_read_struct(&png_struct, NULL, NULL); RELEASE(self); return nil; } png_end_info = png_create_info_struct(png_struct); if (!png_end_info) { png_destroy_read_struct(&png_struct, &png_info, NULL); RELEASE(self); return nil; } if (setjmp(png_jmpbuf(png_struct))) { // We get here when an error happens during image loading png_destroy_read_struct(&png_struct, &png_info, &png_end_info); if (buf != NULL) { NSZoneFree([self zone], buf); } RELEASE(self); return nil; } reader.data = imageData; reader.offset = 0; png_set_read_fn(png_struct, &reader, reader_func); png_read_info(png_struct, png_info); width = png_get_image_width(png_struct, png_info); height = png_get_image_height(png_struct, png_info); bytes_per_row = png_get_rowbytes(png_struct, png_info); type = png_get_color_type(png_struct, png_info); channels = png_get_channels(png_struct, png_info); depth = png_get_bit_depth(png_struct, png_info); switch (type) { case PNG_COLOR_TYPE_GRAY: colorspace = NSCalibratedWhiteColorSpace; alpha = NO; NSAssert(channels == 1, @"unexpected channel/color_type combination"); bpp = depth; break; case PNG_COLOR_TYPE_GRAY_ALPHA: colorspace = NSCalibratedWhiteColorSpace; alpha = YES; NSAssert(channels == 2, @"unexpected channel/color_type combination"); bpp = depth * 2; break; case PNG_COLOR_TYPE_PALETTE: png_set_palette_to_rgb(png_struct); channels = 3; depth = 8; alpha = NO; if (png_get_valid(png_struct, png_info, PNG_INFO_tRNS)) { alpha = YES; channels++; png_set_tRNS_to_alpha(png_struct); } bpp = channels * 8; bytes_per_row = channels * width; colorspace = NSCalibratedRGBColorSpace; break; case PNG_COLOR_TYPE_RGB: colorspace = NSCalibratedRGBColorSpace; alpha = NO; bpp = channels * depth; /* channels might be 4 if there's a filler */ channels = 3; break; case PNG_COLOR_TYPE_RGB_ALPHA: colorspace = NSCalibratedRGBColorSpace; alpha = YES; NSAssert(channels == 4, @"unexpected channel/color_type combination"); bpp = 4 * depth; break; default: NSLog(@"NSBitmapImageRep+PNG: unknown color type %i", type); RELEASE(self); return nil; } buf = NSZoneMalloc([self zone], bytes_per_row * height); { png_bytep row_pointers[height]; int i; for (i = 0; i < height; i++) { row_pointers[i] = buf + i * bytes_per_row; } png_read_image(png_struct, row_pointers); } self = [self initWithBitmapDataPlanes: &buf pixelsWide: width pixelsHigh: height bitsPerSample: depth samplesPerPixel: channels hasAlpha: alpha isPlanar: NO colorSpaceName: colorspace bitmapFormat: NSAlphaNonpremultipliedBitmapFormat bytesPerRow: bytes_per_row bitsPerPixel: bpp]; _imageData = [[NSData alloc] initWithBytesNoCopy: buf length: bytes_per_row * height]; if (png_get_valid(png_struct, png_info, PNG_INFO_gAMA)) { double file_gamma = 2.2; if (PNG_FLOATING_POINT) { png_get_gAMA(png_struct, png_info, &file_gamma); // remap file_gamma [1.0, 2.5] to property [0.0, 1.0] file_gamma = (file_gamma - 1.0)/1.5; } else // fixed point { png_fixed_point int_gamma = 220000; png_get_gAMA_fixed(png_struct, png_info, &int_gamma); // remap gamma [0.0, 1.0] to [100000, 250000] file_gamma = ((double)int_gamma - 100000.0)/150000.0; } [self setProperty: NSImageGamma withValue: [NSNumber numberWithDouble: file_gamma]]; //NSLog(@"PNG file gamma: %f", file_gamma); } if (png_get_valid(png_struct, png_info, PNG_INFO_pHYs)) { png_uint_32 xppm = png_get_x_pixels_per_meter(png_struct, png_info); png_uint_32 yppm = png_get_y_pixels_per_meter(png_struct, png_info); if (xppm != 0 && yppm != 0) { const CGFloat pointsPerMeter = 39.3700787 * 72.0; NSSize sizeInPoints = NSMakeSize((width / (CGFloat)xppm) * pointsPerMeter, (height / (CGFloat)yppm) * pointsPerMeter); // HACK: PNG can not represent 72DPI exactly. If the ppm value is near 72DPI, // assume it is exactly 72 DPI. Note that the same problem occurrs at 144DPI... // so don't use PNG for resolution independent graphics. if (xppm == 2834 || xppm == 2835) { sizeInPoints.width = width; } if (yppm == 2834 || yppm == 2835) { sizeInPoints.height = height; } [self setSize: sizeInPoints]; } } png_destroy_read_struct(&png_struct, &png_info, &png_end_info); return self; } /***** PNG writing support ******/ static void writer_func(png_structp png_struct, png_bytep data, png_size_t length) { NSMutableData * PNGRep = png_get_io_ptr(png_struct); [PNGRep appendBytes: data length: length]; } - (NSData *) _PNGRepresentationWithProperties: (NSDictionary *) properties { png_structp png_struct; png_infop png_info; int width, height, depth; unsigned char * bitmapData; int bytes_per_row; NSString * colorspace; NSMutableData * PNGRep = nil; int type = -1; // illegal value int interlace = PNG_INTERLACE_NONE; int transforms = PNG_TRANSFORM_IDENTITY; // no transformations NSNumber * gammaNumber = nil; double gamma = 0.0; // FIXME: Need to convert to non-pre-multiplied format if ([self isPlanar]) // don't handle planar yet { return nil; } // get the image parameters width = [self pixelsWide]; height = [self pixelsHigh]; bytes_per_row = [self bytesPerRow]; colorspace = [self colorSpaceName]; depth = [self bitsPerSample]; gammaNumber = [properties objectForKey: NSImageGamma]; gamma = [gammaNumber doubleValue]; if ([[properties objectForKey: NSImageInterlaced] boolValue]) interlace = PNG_INTERLACE_ADAM7; if ([colorspace isEqualToString: NSCalibratedWhiteColorSpace] || [colorspace isEqualToString: NSDeviceWhiteColorSpace]) type = PNG_COLOR_TYPE_GRAY; if ([colorspace isEqualToString: NSCalibratedRGBColorSpace] || [colorspace isEqualToString: NSDeviceRGBColorSpace]) type = PNG_COLOR_TYPE_RGB; if ([self hasAlpha]) type = type | PNG_COLOR_MASK_ALPHA; // make the PNG structures // ignore errors until I write the handlers png_struct = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); if (!png_struct) { return nil; } png_info = png_create_info_struct(png_struct); if (!png_info) { png_destroy_write_struct(&png_struct, NULL); return nil; } if (setjmp(png_jmpbuf(png_struct))) { png_destroy_write_struct(&png_struct, &png_info); return nil; } // init structures PNGRep = [NSMutableData dataWithLength: 0]; #if PNG_LIBPNG_VER < 10500 // I don't think this was ever needed as png_create_info_struct() // sets up the structure correctly and we rely on that in all other places. png_info_init_3(&png_info, png_sizeof(png_info)); #endif png_set_write_fn(png_struct, PNGRep, writer_func, NULL); png_set_IHDR(png_struct, png_info, width, height, depth, type, interlace, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); if (gammaNumber) { NSLog(@"PNGRepresentation: gamma support is experimental"); if (PNG_FLOATING_POINT) { // remap gamma [0.0, 1.0] to [1.0, 2.5] png_set_gAMA(png_struct, png_info, (gamma * 1.5 + 1.0)); } else // fixed point { // remap gamma [0.0, 1.0] to [100000, 250000] int int_gamma = (int)(gamma * 150000.0 + 100000.0); png_set_gAMA_fixed(png_struct, png_info, int_gamma); } } // get rgb data and row pointers and // write PNG out to NSMutableData bitmapData = [self bitmapData]; { unsigned char *row_pointers[height]; int i; for (i = 0 ; i < height ; i++) row_pointers[i] = bitmapData + i * bytes_per_row; png_set_rows(png_struct, png_info, row_pointers); png_write_png(png_struct, png_info, transforms, NULL); } //NSLog(@"PNG representation is experimental: %i bytes written", [PNGRep length]); png_destroy_write_struct(&png_struct, &png_info); return PNGRep; } @end #else /* !HAVE_LIBPNG */ @implementation NSBitmapImageRep (PNG) + (BOOL) _bitmapIsPNG: (NSData *)imageData { return NO; } - (id) _initBitmapFromPNG: (NSData *)imageData { RELEASE(self); return nil; } - (NSData *) _PNGRepresentationWithProperties: (NSDictionary *) properties { return nil; } @end #endif /* !HAVE_LIBPNG */ gnustep-gui-0.24.0/Source/NSRulerView.m0000664000076500007650000005441212110205434017543 0ustar brains99brains99/* NSRulerView.m Copyright (C) 2002 Free Software Foundation, Inc. Author: Diego Kreutz (kreutz@inf.ufsm.br) Date: January 2002 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #import "config.h" #import #import #import #import #import "AppKit/NSAttributedString.h" #import "AppKit/NSBezierPath.h" #import "AppKit/NSColor.h" #import "AppKit/NSEvent.h" #import "AppKit/NSFont.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSRulerMarker.h" #import "AppKit/NSRulerView.h" #import "AppKit/NSScrollView.h" #import "AppKit/NSStringDrawing.h" #import "GSGuiPrivate.h" #define MIN_LABEL_DISTANCE 40 #define MIN_MARK_DISTANCE 5 #define MARK_SIZE 2 #define MID_MARK_SIZE 4 #define BIG_MARK_SIZE 6 #define LABEL_MARK_SIZE 11 #define RULER_THICKNESS 16 #define MARKER_THICKNESS 15 #define DRAW_HASH_MARK(path, size) \ do { \ if (_orientation == NSHorizontalRuler)\ { \ [path relativeLineToPoint: NSMakePoint(0, size)]; \ } \ else \ { \ [path relativeLineToPoint: NSMakePoint(size, 0)]; \ } \ } while (0) @interface GSRulerUnit : NSObject { NSString *_unitName; NSString *_abbreviation; CGFloat _conversionFactor; NSArray *_stepUpCycle; NSArray *_stepDownCycle; } + (GSRulerUnit *) unitWithName: (NSString *)uName abbreviation: (NSString *)abbrev unitToPointsConversionFactor: (CGFloat)factor stepUpCycle: (NSArray *)upCycle stepDownCycle: (NSArray *)downCycle; - (id) initWithUnitName: (NSString *)uName abbreviation: (NSString *)abbrev unitToPointsConversionFactor: (CGFloat)factor stepUpCycle: (NSArray *)upCycle stepDownCycle: (NSArray *)downCycle; - (NSString *) unitName; - (NSString *) abbreviation; - (CGFloat) conversionFactor; - (NSArray *) stepUpCycle; - (NSArray *) stepDownCycle; @end @implementation GSRulerUnit + (GSRulerUnit *) unitWithName: (NSString *)uName abbreviation: (NSString *)abbrev unitToPointsConversionFactor: (CGFloat)factor stepUpCycle: (NSArray *)upCycle stepDownCycle: (NSArray *)downCycle { return [[[self alloc] initWithUnitName: uName abbreviation: abbrev unitToPointsConversionFactor: factor stepUpCycle: upCycle stepDownCycle: downCycle] autorelease]; } - (id) initWithUnitName: (NSString *)uName abbreviation: (NSString *)abbrev unitToPointsConversionFactor: (CGFloat)factor stepUpCycle: (NSArray *)upCycle stepDownCycle: (NSArray *)downCycle { self = [super init]; if (self != nil) { ASSIGN(_unitName, uName); ASSIGN(_abbreviation, abbrev); _conversionFactor = factor; ASSIGN(_stepUpCycle, upCycle); ASSIGN(_stepDownCycle, downCycle); } return self; } - (NSString *) unitName { return _unitName; } - (NSString *) abbreviation { return _abbreviation; } - (CGFloat) conversionFactor { return _conversionFactor; } - (NSArray *) stepUpCycle { return _stepUpCycle; } - (NSArray *) stepDownCycle { return _stepDownCycle; } - (void) dealloc { [_unitName release]; [_abbreviation release]; [_stepUpCycle release]; [_stepDownCycle release]; [super dealloc]; } @end @implementation NSRulerView /* * Class variables */ static NSMutableDictionary *units = nil; /* * Class methods */ + (void) initialize { if (self == [NSRulerView class]) { NSArray *array05; NSArray *array052; NSArray *array2; NSArray *array10; [self setVersion: 1]; units = [[NSMutableDictionary alloc] init]; array05 = [NSArray arrayWithObject: [NSNumber numberWithFloat: 0.5]]; array052 = [NSArray arrayWithObjects: [NSNumber numberWithFloat: 0.5], [NSNumber numberWithFloat: 0.2], nil]; array2 = [NSArray arrayWithObject: [NSNumber numberWithFloat: 2.0]]; array10 = [NSArray arrayWithObject: [NSNumber numberWithFloat: 10.0]]; [self registerUnitWithName: @"Inches" abbreviation: @"in" unitToPointsConversionFactor: 72.0 stepUpCycle: array2 stepDownCycle: array05]; [self registerUnitWithName: @"Centimeters" abbreviation: @"cm" unitToPointsConversionFactor: 28.35 stepUpCycle: array2 stepDownCycle: array052]; [self registerUnitWithName: @"Points" abbreviation: @"pt" unitToPointsConversionFactor: 1.0 stepUpCycle: array10 stepDownCycle: array05]; [self registerUnitWithName: @"Picas" abbreviation: @"pc" unitToPointsConversionFactor: 12.0 stepUpCycle: array2 stepDownCycle: array05]; } } - (id) initWithScrollView: (NSScrollView *)aScrollView orientation: (NSRulerOrientation)o { self = [super initWithFrame: NSZeroRect]; if (self != nil) { [self setScrollView: aScrollView]; [self setOrientation: o]; [self setMeasurementUnits: @"Points"]; /* FIXME: should be user's pref */ [self setRuleThickness: RULER_THICKNESS]; [self setOriginOffset: 0.0]; [self setReservedThicknessForAccessoryView: 0.0]; if (o == NSHorizontalRuler) { [self setReservedThicknessForMarkers: MARKER_THICKNESS]; } else { [self setReservedThicknessForMarkers: 0.0]; } [self invalidateHashMarks]; } return self; } + (void) registerUnitWithName: (NSString *)uName abbreviation: (NSString *)abbreviation unitToPointsConversionFactor: (CGFloat)conversionFactor stepUpCycle: (NSArray *)stepUpCycle stepDownCycle: (NSArray *)stepDownCycle { GSRulerUnit *u = [GSRulerUnit unitWithName: uName abbreviation: abbreviation unitToPointsConversionFactor: conversionFactor stepUpCycle: stepUpCycle stepDownCycle: stepDownCycle]; [units setObject: u forKey: uName]; } - (void) setMeasurementUnits: (NSString *)uName { GSRulerUnit *newUnit; newUnit = [units objectForKey: uName]; if (newUnit == nil) { [NSException raise: NSInvalidArgumentException format: @"Unknown measurement unit %@", uName]; } ASSIGN(_unit, newUnit); [self invalidateHashMarks]; } - (NSString *) measurementUnits { return [_unit unitName]; } - (void) setClientView: (NSView *)aView { if (_clientView == aView) return; if (_clientView != nil && [_clientView respondsToSelector: @selector(rulerView:willSetClientView:)]) { [_clientView rulerView: self willSetClientView: aView]; } /* NB: We should not RETAIN the clientView. */ _clientView = aView; [self setMarkers: nil]; [self invalidateHashMarks]; } - (BOOL) isOpaque { return YES; } - (NSView *) clientView { return _clientView; } - (void) setAccessoryView: (NSView *)aView { /* FIXME/TODO: support for accessory views is not implemented */ ASSIGN(_accessoryView, aView); [self setNeedsDisplay: YES]; } - (NSView *) accessoryView { return _accessoryView; } - (void) setOriginOffset: (CGFloat)offset { _originOffset = offset; [self invalidateHashMarks]; } - (CGFloat) originOffset { return _originOffset; } - (void) _verifyReservedThicknessForMarkers { NSEnumerator *en; NSRulerMarker *marker; CGFloat maxThickness = _reservedThicknessForMarkers; if (_markers == nil) { return; } en = [_markers objectEnumerator]; while ((marker = [en nextObject]) != nil) { CGFloat markerThickness; markerThickness = [marker thicknessRequiredInRuler]; if (markerThickness > maxThickness) { maxThickness = markerThickness; } } if (maxThickness > _reservedThicknessForMarkers) { [self setReservedThicknessForMarkers: maxThickness]; } } - (void) setMarkers: (NSArray *)newMarkers { if (newMarkers != nil && _clientView == nil) { [NSException raise: NSInternalInconsistencyException format: @"Cannot set markers without a client view"]; } if (newMarkers != nil) { ASSIGN(_markers, [NSMutableArray arrayWithArray: newMarkers]); [self _verifyReservedThicknessForMarkers]; } else { ASSIGN(_markers, nil); } [self setNeedsDisplay: YES]; } - (NSArray *) markers { return _markers; } - (void) addMarker: (NSRulerMarker *)aMarker { CGFloat markerThickness = [aMarker thicknessRequiredInRuler]; if (_clientView == nil) { [NSException raise: NSInternalInconsistencyException format: @"Cannot add a marker without a client view"]; } if (markerThickness > [self reservedThicknessForMarkers]) { [self setReservedThicknessForMarkers: markerThickness]; } if (_markers == nil) { _markers = [[NSMutableArray alloc] initWithObjects: aMarker, nil]; } else { [_markers addObject: aMarker]; } [self setNeedsDisplay: YES]; } - (void) removeMarker: (NSRulerMarker *)aMarker { [_markers removeObject: aMarker]; [self setNeedsDisplay: YES]; } - (BOOL) trackMarker: (NSRulerMarker *)aMarker withMouseEvent: (NSEvent *)theEvent { NSParameterAssert(aMarker != nil); return [aMarker trackMouse: theEvent adding: YES]; } - (NSRect) _rulerRect { NSRect rect = [self bounds]; if (_orientation == NSHorizontalRuler) { rect.size.height = _ruleThickness; if ([self isFlipped]) { rect.origin.y = [self baselineLocation]; } else { rect.origin.y = [self baselineLocation] - _ruleThickness; } } else { rect.size.width = _ruleThickness; rect.origin.x = [self baselineLocation]; } return rect; } - (NSRect) _markersRect { NSRect rect = [self bounds]; if (_orientation == NSHorizontalRuler) { rect.size.height = _reservedThicknessForMarkers; if ([self isFlipped]) { rect.origin.y = _reservedThicknessForAccessoryView; } else { rect.origin.y = _ruleThickness; } } else { rect.size.width = _reservedThicknessForMarkers; rect.origin.x = _reservedThicknessForAccessoryView; } return rect; } - (NSRulerMarker *) _markerAtPoint: (NSPoint)point { NSEnumerator *markerEnum; NSRulerMarker *marker; BOOL flipped = [self isFlipped]; /* test markers in reverse order so that markers drawn on top are tested before those underneath */ markerEnum = [_markers reverseObjectEnumerator]; while ((marker = [markerEnum nextObject]) != nil) { if (NSMouseInRect (point, [marker imageRectInRuler], flipped)) { return marker; } } return nil; } - (void) mouseDown: (NSEvent*)theEvent { NSPoint clickPoint; BOOL flipped = [self isFlipped]; clickPoint = [self convertPoint: [theEvent locationInWindow] fromView: nil]; if (NSMouseInRect (clickPoint, [self _rulerRect], flipped)) { if (_clientView != nil && [_clientView respondsToSelector: @selector(rulerView:handleMouseDown:)]) { [_clientView rulerView: self handleMouseDown: theEvent]; } } else if (NSMouseInRect (clickPoint, [self _markersRect], flipped)) { NSRulerMarker *clickedMarker; clickedMarker = [self _markerAtPoint: clickPoint]; if (clickedMarker != nil) { [clickedMarker trackMouse: theEvent adding: NO]; } } } - (void) moveRulerlineFromLocation: (CGFloat)oldLoc toLocation: (CGFloat)newLoc { /* FIXME/TODO: not implemented */ } - (void)drawRect: (NSRect)aRect { [[NSColor controlColor] set]; NSRectFill(aRect); [self drawHashMarksAndLabelsInRect: aRect]; [self drawMarkersInRect: aRect]; } - (float) _stepForIndex: (int)index { int newindex; NSArray *stepCycle; if (index > 0) { stepCycle = [_unit stepUpCycle]; newindex = (index - 1) % [stepCycle count]; return [[stepCycle objectAtIndex: newindex] floatValue]; } else { stepCycle = [_unit stepDownCycle]; newindex = (-index) % [stepCycle count]; return 1 / [[stepCycle objectAtIndex: newindex] floatValue]; } } - (void) _verifyCachedValues { if (! _cacheIsValid) { NSSize unitSize; CGFloat cf; int convIndex; /* calculate the size one unit in document view has in the ruler */ cf = [_unit conversionFactor]; unitSize = [self convertSize: NSMakeSize(cf, cf) fromView: [_scrollView documentView]]; if (_orientation == NSHorizontalRuler) { _unitToRuler = unitSize.width; } else { _unitToRuler = unitSize.height; } /* Calculate distance between marks. */ /* It must not be less than MIN_MARK_DISTANCE in ruler units * and must obey the current unit's step cycles. */ _markDistance = _unitToRuler; convIndex = 0; /* make sure it's smaller than MIN_MARK_DISTANCE */ while ((_markDistance) > MIN_MARK_DISTANCE) { _markDistance /= [self _stepForIndex: convIndex]; convIndex--; } /* find the first size that's not < MIN_MARK_DISTANCE */ while ((_markDistance) < MIN_MARK_DISTANCE) { convIndex++; _markDistance *= [self _stepForIndex: convIndex]; } /* calculate number of small marks in each bigger mark */ _marksToMidMark = GSRoundTowardsInfinity([self _stepForIndex: convIndex + 1]); _marksToBigMark = _marksToMidMark * GSRoundTowardsInfinity([self _stepForIndex: convIndex + 2]); /* Calculate distance between labels. It must not be less than MIN_LABEL_DISTANCE. */ _labelDistance = _markDistance; while (_labelDistance < MIN_LABEL_DISTANCE) { convIndex++; _labelDistance *= [self _stepForIndex: convIndex]; } /* number of small marks between two labels */ _marksToLabel = GSRoundTowardsInfinity(_labelDistance / _markDistance); /* format of labels */ if (_labelDistance / _unitToRuler >= 1) { ASSIGN(_labelFormat, @"%1.f"); } else { /* smallest integral value not less than log10(1/labelDistInUnits) */ int log = ceil(log10(1 / (_labelDistance / _unitToRuler))); NSString *string = [NSString stringWithFormat: @"%%.%df", (int)log]; ASSIGN(_labelFormat, string); } _cacheIsValid = YES; } } - (void) drawHashMarksAndLabelsInRect: (NSRect)aRect { NSView *docView; NSRect docBounds; NSRect baselineRect; NSRect visibleBaselineRect; CGFloat firstBaselineLocation; CGFloat firstVisibleLocation; CGFloat lastVisibleLocation; int firstVisibleMark; int lastVisibleMark; int mark; int firstVisibleLabel; int lastVisibleLabel; int label; CGFloat baselineLocation = [self baselineLocation]; NSPoint zeroPoint; CGFloat zeroLocation; NSBezierPath *path; NSFont *font = [NSFont systemFontOfSize: [NSFont smallSystemFontSize]]; NSDictionary *attr = [[NSDictionary alloc] initWithObjectsAndKeys: font, NSFontAttributeName, [NSColor blackColor], NSForegroundColorAttributeName, nil]; docView = [_scrollView documentView]; docBounds = [docView bounds]; /* Calculate the location of 'zero' hash mark */ // _originOffset is an offset from document bounds origin, in doc coords zeroPoint.x = docBounds.origin.x + _originOffset; zeroPoint.y = docBounds.origin.y + _originOffset; zeroPoint = [self convertPoint: zeroPoint fromView: docView]; if (_orientation == NSHorizontalRuler) { zeroLocation = zeroPoint.x; } else { zeroLocation = zeroPoint.y; } [self _verifyCachedValues]; /* Calculate the base line (corresponds to the document bounds) */ baselineRect = [self convertRect: docBounds fromView: docView]; if (_orientation == NSHorizontalRuler) { baselineRect.origin.y = baselineLocation; baselineRect.size.height = 1; firstBaselineLocation = NSMinX(baselineRect); visibleBaselineRect = NSIntersectionRect(baselineRect, aRect); firstVisibleLocation = NSMinX(visibleBaselineRect); lastVisibleLocation = NSMaxX(visibleBaselineRect); } else { baselineRect.origin.x = baselineLocation; baselineRect.size.width = 1; firstBaselineLocation = NSMinY(baselineRect); visibleBaselineRect = NSIntersectionRect(baselineRect, aRect); firstVisibleLocation = NSMinY(visibleBaselineRect); lastVisibleLocation = NSMaxY(visibleBaselineRect); } /* draw the base line */ [[NSColor blackColor] set]; NSRectFill(visibleBaselineRect); /* draw hash marks */ firstVisibleMark = ceil((firstVisibleLocation - zeroLocation) / _markDistance); lastVisibleMark = floor((lastVisibleLocation - zeroLocation) / _markDistance); path = [NSBezierPath new]; for (mark = firstVisibleMark; mark <= lastVisibleMark; mark++) { CGFloat markLocation; markLocation = zeroLocation + mark * _markDistance; if (_orientation == NSHorizontalRuler) { [path moveToPoint: NSMakePoint(markLocation, baselineLocation)]; } else { [path moveToPoint: NSMakePoint(baselineLocation, markLocation)]; } if ((mark % _marksToLabel) == 0) { DRAW_HASH_MARK(path, LABEL_MARK_SIZE); } else if ((mark % _marksToBigMark) == 0) { DRAW_HASH_MARK(path, BIG_MARK_SIZE); } else if ((mark % _marksToMidMark) == 0) { DRAW_HASH_MARK(path, MID_MARK_SIZE); } else { DRAW_HASH_MARK(path, MARK_SIZE); } } [path stroke]; RELEASE(path); /* draw labels */ /* FIXME: shouldn't be using NSCell to draw labels? */ firstVisibleLabel = floor((firstVisibleLocation - zeroLocation) / (_marksToLabel * _markDistance)); lastVisibleLabel = floor((lastVisibleLocation - zeroLocation) / (_marksToLabel * _markDistance)); /* firstVisibleLabel can be to the left of the visible ruler area. This is OK because just part of the label can be visible to the left when scrolling. However, it should not be drawn if outside of the baseline. */ if (zeroLocation + firstVisibleLabel * _marksToLabel * _markDistance < firstBaselineLocation) { firstVisibleLabel++; } for (label = firstVisibleLabel; label <= lastVisibleLabel; label++) { CGFloat labelLocation = zeroLocation + label * _marksToLabel * _markDistance; // This has to be a float or we need to change the label format float labelValue = (labelLocation - zeroLocation) / _unitToRuler; NSString *labelString = [NSString stringWithFormat: _labelFormat, labelValue]; NSSize size = [labelString sizeWithAttributes: attr]; NSPoint labelPosition; if (_orientation == NSHorizontalRuler) { labelPosition.x = labelLocation + 1; labelPosition.y = baselineLocation + LABEL_MARK_SIZE + 4 - size.height; } else { labelPosition.x = baselineLocation + _ruleThickness - size.width; labelPosition.y = labelLocation + 1; } [labelString drawAtPoint: labelPosition withAttributes: attr]; } RELEASE(attr); } - (void) drawMarkersInRect: (NSRect)aRect { NSRulerMarker *marker; NSEnumerator *en; en = [_markers objectEnumerator]; while ((marker = [en nextObject]) != nil) { [marker drawRect: aRect]; } } - (void) invalidateHashMarks { _cacheIsValid = NO; [self setNeedsDisplay:YES]; } - (void) setScrollView: (NSScrollView *)scrollView { /* We do NOT retain the scrollView; the scrollView is retaining us. */ _scrollView = scrollView; } - (NSScrollView *) scrollView { return _scrollView; } - (void) setOrientation: (NSRulerOrientation)o { _orientation = o; } - (NSRulerOrientation)orientation { return _orientation; } - (void) setReservedThicknessForAccessoryView: (CGFloat)thickness { _reservedThicknessForAccessoryView = thickness; [_scrollView tile]; } - (CGFloat) reservedThicknessForAccessoryView { return _reservedThicknessForAccessoryView; } - (void) setReservedThicknessForMarkers: (CGFloat)thickness { _reservedThicknessForMarkers = thickness; [_scrollView tile]; } - (CGFloat) reservedThicknessForMarkers { return _reservedThicknessForMarkers; } - (void) setRuleThickness: (CGFloat)thickness { _ruleThickness = thickness; [_scrollView tile]; } - (CGFloat) ruleThickness { return _ruleThickness; } - (CGFloat) requiredThickness { return [self ruleThickness] + [self reservedThicknessForAccessoryView] + [self reservedThicknessForMarkers]; } - (CGFloat) baselineLocation { return [self reservedThicknessForAccessoryView] + [self reservedThicknessForMarkers]; } - (BOOL) isFlipped { if (_orientation == NSVerticalRuler) { return [[_scrollView documentView] isFlipped]; } return YES; } - (void) encodeWithCoder: (NSCoder *)encoder { [super encodeWithCoder: encoder]; /* FIXME/TODO: not implemented */ return; } - (id) initWithCoder: (NSCoder *)decoder { self = [super initWithCoder: decoder]; if (self == nil) return nil; /* FIXME/TODO: not implemented */ return self; } - (void) dealloc { RELEASE(_unit); RELEASE(_accessoryView); RELEASE(_markers); RELEASE(_labelFormat); [super dealloc]; } @end gnustep-gui-0.24.0/Source/NSSliderCell.m0000664000076500007650000006526012226670036017660 0ustar brains99brains99/** NSSliderCell Copyright (C) 1996,1999 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: September 1997 Rewrite: Richard Frith-Macdonald Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include // (float)rintf(float x) #include "config.h" #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSBezierPath.h" #import "AppKit/NSColor.h" #import "AppKit/NSControl.h" #import "AppKit/NSEvent.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSImage.h" #import "AppKit/NSSliderCell.h" #import "AppKit/NSTextFieldCell.h" #import "AppKit/NSWindow.h" #import #import "GSGuiPrivate.h" #ifndef HAVE_ATAN2F #define atan2f atan2 #endif #ifndef M_PI #define M_PI 3.1415926535897932384626434 #endif static inline float _floatValueForMousePoint (NSPoint point, NSRect knobRect, NSRect slotRect, BOOL isVertical, double minValue, double maxValue, NSSliderCell *theCell, BOOL flipped, BOOL isCircular) { float floatValue = 0; float position; if (isCircular) { NSPoint slotCenter = NSMakePoint(NSMidX(slotRect), NSMidY(slotRect)); NSPoint pointRelativeToKnobCenter = NSMakePoint(point.x - slotCenter.x, point.y - slotCenter.y); if (flipped) { pointRelativeToKnobCenter.y *= -1.0; } floatValue = atan2f(pointRelativeToKnobCenter.x, pointRelativeToKnobCenter.y) / (2.0 * M_PI); if (floatValue < 0) { floatValue += 1.0; } // floatValue is 0 for up, 0.25 for right, 0.5 for down, 0.75 for left, etc. } else { // Adjust the point to lie inside the knob slot. We don't // have to worry whether the view is flipped or not. if (isVertical) { if (point.y < slotRect.origin.y + knobRect.size.height / 2) { position = slotRect.origin.y + knobRect.size.height / 2; } else if (point.y > slotRect.origin.y + slotRect.size.height - knobRect.size.height / 2) { position = slotRect.origin.y + slotRect.size.height - knobRect.size.height / 2; } else position = point.y; // Compute the float value floatValue = (position - (slotRect.origin.y + knobRect.size.height/2)) / (slotRect.size.height - knobRect.size.height); if (flipped) floatValue = 1 - floatValue; } else { if (point.x < slotRect.origin.x + knobRect.size.width / 2) { position = slotRect.origin.x + knobRect.size.width / 2; } else if (point.x > slotRect.origin.x + slotRect.size.width - knobRect.size.width / 2) { position = slotRect.origin.x + slotRect.size.width - knobRect.size.width / 2; } else position = point.x; // Compute the float value given the knob size floatValue = (position - (slotRect.origin.x + knobRect.size.width / 2)) / (slotRect.size.width - knobRect.size.width); } } return floatValue * (maxValue - minValue) + minValue; } /** Class Description

An NSSliderCell controls the behaviour and appearance of an associated NSSlider, or a single slider in an NSMatrix. Tick marks are defined in the official standard, but are not implemented in GNUstep.

An NSSliderCell can be customized through its set... methods. If these do not provide enough customization, a subclass can be created, which overrides any of the follwing methods: knobRectFlipped:, drawBarInside:flipped:, drawKnob:, or prefersTrackingUntilMouseUp.

*/ @implementation NSSliderCell + (void) initialize { if (self == [NSSliderCell class]) { /* Set the class version to 2, as tick information is now stored in the encoding */ [self setVersion: 2]; } } - (id) init { self = [self initImageCell: nil]; if (self == nil) return nil; _altIncrementValue = -1; _isVertical = -1; [self setMinValue: 0]; [self setMaxValue: 1]; [self setDoubleValue: 0]; _cell.is_bordered = YES; _cell.is_bezeled = NO; [self setContinuous: YES]; [self setSliderType: NSLinearSlider]; _knobCell = [NSCell new]; _titleCell = [NSTextFieldCell new]; [_titleCell setTextColor: [NSColor controlTextColor]]; [_titleCell setStringValue: @""]; [_titleCell setAlignment: NSCenterTextAlignment]; return self; } - (void) dealloc { RELEASE(_titleCell); RELEASE(_knobCell); [super dealloc]; } - (id) copyWithZone:(NSZone *)zone { NSSliderCell *cpy = [super copyWithZone: zone]; if (cpy != nil) { /* since NSCells call to NSCopyObject only copies object addresses */ cpy->_titleCell = [_titleCell copyWithZone: zone]; cpy->_knobCell = [_knobCell copyWithZone: zone]; } return cpy; } - (BOOL) isContinuous { return (_action_mask & NSLeftMouseDraggedMask) != 0; } - (void) setContinuous: (BOOL)flag { if (flag) { _action_mask |= NSLeftMouseDraggedMask; } else { _action_mask &= ~NSLeftMouseDraggedMask; } } - (void) _drawBorderAndBackgroundWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { NSBorderType aType; if (_cell.is_bordered) aType = NSLineBorder; else if (_cell.is_bezeled) aType = NSBezelBorder; else aType = NSNoBorder; [[GSTheme theme] drawSliderBorderAndBackground: aType frame: cellFrame inCell: self isHorizontal: ![self isVertical]]; } /**

Draws the slider's track, not including the bezel, in aRect flipped indicates whether the control view has a flipped coordinate system.

Do not call this method directly, it is provided for subclassing only.

*/ - (void) drawBarInside: (NSRect)rect flipped: (BOOL)flipped { [[GSTheme theme] drawBarInside: rect inCell: self flipped: flipped]; } /**

Returns the rect in which to draw the knob, based on the coordinate system of the NSSlider or NSMatrix this NSSliderCell is associated with. flipped indicates whether or not that coordinate system is flipped, which can be determined by sending the isFlipped message to the associated NSSlider or NSMatrix.

Do not call this method directly. It is included for subclassing only.

*/ - (NSRect) knobRectFlipped: (BOOL)flipped { NSImage *image = [_knobCell image]; NSSize size; NSPoint origin; float floatValue = [self floatValue]; // FIXME: this method needs to be refactored out to GSTheme if (_isVertical && flipped) { floatValue = _maxValue + _minValue - floatValue; } floatValue = (floatValue - _minValue) / (_maxValue - _minValue); if (image != nil) { size = [image size]; } else { size = NSZeroSize; } if (_isVertical == YES) { origin = _trackRect.origin; origin.x += (_trackRect.size.width - size.width) / 2.0; // center horizontally origin.y += (_trackRect.size.height - size.height) * floatValue; } else { origin = _trackRect.origin; origin.x += (_trackRect.size.width - size.width) * floatValue; origin.y += (_trackRect.size.height - size.height) / 2.0; // center vertically } { NSRect result = NSMakeRect (origin.x, origin.y, size.width, size.height); if ([self controlView]) { result = [[self controlView] centerScanRect: result]; } return result; } } /**

Calculates the rect in which to draw the knob, then calls drawKnob: Before calling this method, a lockFocus message must be sent to the cell's control view.

When subclassing NSSliderCell, do not override this method. Override drawKnob: instead.

See Also: -drawKnob:

*/ - (void) drawKnob { [[GSTheme theme] drawKnobInCell: self]; } /**

Draws the knob in knobRect. Before calling this method, a lockFocus message must be sent to the cell's control view.

Do not call this method directly. It is included for subclassing only.

See Also: -drawKnob

*/ - (void) drawKnob: (NSRect)knobRect { [_knobCell drawInteriorWithFrame: knobRect inView: _control_view]; } - (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { cellFrame = [self drawingRectForBounds: cellFrame]; _trackRect = cellFrame; if (_type == NSCircularSlider) { NSBezierPath *circle; NSPoint knobCenter; NSPoint point; NSRect knobRect; float fraction, angle, radius; NSImage *image; if (cellFrame.size.width > cellFrame.size.height) { knobRect = NSMakeRect(cellFrame.origin.x + ((cellFrame.size.width - cellFrame.size.height) / 2.0), cellFrame.origin.y, cellFrame.size.height, cellFrame.size.height); } else { knobRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y + ((cellFrame.size.height - cellFrame.size.width) / 2.0), cellFrame.size.width, cellFrame.size.width); } if ([self controlView]) knobRect = [[self controlView] centerScanRect: knobRect]; image = [NSImage imageNamed: @"common_CircularSlider"]; if (image != nil) { [image drawInRect: knobRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0 respectFlipped: YES hints: nil]; } else { knobRect = NSInsetRect(knobRect, 1, 1); circle = [NSBezierPath bezierPathWithOvalInRect: knobRect]; [[NSColor controlBackgroundColor] set]; [circle fill]; [[NSColor blackColor] set]; [circle stroke]; } knobCenter = NSMakePoint(NSMidX(knobRect), NSMidY(knobRect)); fraction = ([self floatValue] - [self minValue]) / ([self maxValue] - [self minValue]); angle = (fraction * (2.0 * M_PI)) - (M_PI / 2.0); radius = (knobRect.size.height / 2) - 6; point = NSMakePoint((radius * cos(angle)) + knobCenter.x, (radius * sin(angle)) + knobCenter.y); image = [NSImage imageNamed: @"common_Dimple"]; { NSSize size = [image size]; NSRect dimpleRect = NSMakeRect(point.x - (size.width / 2.0), point.y - (size.height / 2.0), size.width, size.height); if ([self controlView]) dimpleRect = [[self controlView] centerScanRect: dimpleRect]; [image drawInRect: dimpleRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0 respectFlipped: YES hints: nil]; } } else if (_type == NSLinearSlider) { BOOL vertical = (cellFrame.size.height > cellFrame.size.width); if (vertical != _isVertical) { NSImage *image; if (vertical == YES) { image = [NSImage imageNamed: @"common_SliderVert"]; } else { image = [NSImage imageNamed: @"common_SliderHoriz"]; } [_knobCell setImage: image]; } _isVertical = vertical; [self drawBarInside: cellFrame flipped: [controlView isFlipped]]; /* Draw title - Uhmmm - shouldn't this better go into drawBarInside:flipped: ? */ if (_isVertical == NO) { [_titleCell drawInteriorWithFrame: cellFrame inView: controlView]; } [self drawKnob]; } } - (BOOL) isOpaque { return NO; } /**

Returns the thickness of the slider's knob. This value is in pixels, and is the size of the knob along the slider's track.

See Also: -setKnobThickness:

*/ - (CGFloat) knobThickness { NSImage *image = [_knobCell image]; NSSize size; if (image != nil) { size = [image size]; } else { return 0; } return _isVertical ? size.height : size.width; } /**

Sets the thickness of the knob to thickness, in pixels. This value sets the amount of space which the knob takes up in the slider's track.

See Also: -knobThickness

*/ - (void) setKnobThickness: (CGFloat)thickness { NSImage *image = [_knobCell image]; NSSize size; if (image != nil) { size = [image size]; } else { return; } if (_isVertical == YES) size.height = thickness; else size.width = thickness; [image setSize: size]; if ((_control_view != nil) && ([_control_view isKindOfClass: [NSControl class]])) { [(NSControl*)_control_view updateCell: self]; } } /**

Sets the value by which the slider will be be incremented when with the ALT key down to increment.

See Also: -altIncrementValue

*/ - (void) setAltIncrementValue: (double)increment { _altIncrementValue = increment; } /**

Sets the minimum value that the sliders represents to maxValue.

See Also: -minValue

*/ - (void) setMinValue: (double)aDouble { _minValue = aDouble; if ([self doubleValue] < _minValue) [self setDoubleValue: _minValue]; } /**

Sets the maximum value that the sliders represents to maxValue.

See Also: -maxValue

*/ - (void) setMaxValue: (double)aDouble { _maxValue = aDouble; if ([self doubleValue] > _maxValue) [self setDoubleValue: _maxValue]; } - (void) setObjectValue: (id)anObject { // If the provided object doesn't respond to doubeValue, or our minValue // is greater than our maxValue, we set our value to our minValue // (this arbitrary choice matches OS X) if ([anObject respondsToSelector: @selector(doubleValue)] == NO || _minValue > _maxValue) [super setObjectValue: [NSNumber numberWithDouble: _minValue]]; else { double aDouble = [anObject doubleValue]; if (aDouble < _minValue) [super setObjectValue: [NSNumber numberWithDouble: _minValue]]; else if (aDouble > _maxValue) [super setObjectValue: [NSNumber numberWithDouble: _maxValue]]; else [super setObjectValue: anObject]; } } /**

Returns the cell used to draw the title.

See Also: -setTitleCell:

*/ - (id) titleCell { return _titleCell; } /**

Returns the colour used to draw the title.

See Also: -setTitleColor:

*/ - (NSColor*) titleColor { return [_titleCell textColor]; } /**

Returns the font used to draw the title.

See Also: -setTitleFont:

*/ - (NSFont*) titleFont { return [_titleCell font]; } /**

Sets the title of the slider to barTitle. This title is displayed on the slider's track, behind the knob.

See Also: -title

*/ - (void) setTitle: (NSString*)title { [_titleCell setStringValue: title]; } /**

Returns the title of the slider. This title is displayed on the slider's track, behind the knob.

See Also: -setTitle:

*/ - (NSString*) title { return [_titleCell stringValue]; } /**

Sets the cell used to draw the title to titleCell.

See Also: -titleCell

*/ - (void) setTitleCell: (NSCell*)aCell { ASSIGN(_titleCell, aCell); } /**

Sets the colour with which the title will be drawn to color.

See Also: -titleColor

*/ - (void) setTitleColor: (NSColor*)color { [_titleCell setTextColor: color]; } /**

Sets the font with which the title will be drawm to font.

See Also: -titleFont

*/ - (void) setTitleFont: (NSFont*)font { [_titleCell setFont: font]; } /**

Returns the slider type: linear or circular.

See Also: -setSliderType:

*/ - (NSSliderType)sliderType { return _type; } /**

Sets the type of the slider: linear or circular.

See Also: -sliderType

*/ - (void) setSliderType: (NSSliderType)type { _type = type; if (_type == NSLinearSlider) { [self setBordered: YES]; [self setBezeled: NO]; } else if (_type == NSCircularSlider) { [self setBordered: NO]; [self setBezeled: NO]; } } /**Returns whether or not the slider is vertical. If, for some reason, this cannot be determined, for such reasons as the slider is not yet displayed, this method returns -1. Generally, a slider is considered vertical if its height is greater than its width. */ - (NSInteger) isVertical { return _isVertical; } /**

Returns the value by which the slider is incremented when the user holds down the ALT key.

See Also: -setAltIncrementValue:

*/ - (double) altIncrementValue { return _altIncrementValue; } /**

The default implementation returns YES, so that the slider continues to track the user's movement even if the cursor leaves the slider's track.

Do not call this method directly. Override it in subclasses where the tracking behaviour needs to be different.

*/ + (BOOL) prefersTrackingUntilMouseUp { return YES; } /** Returns the rect of the track, minus the bezel. */ - (NSRect) trackRect { return _trackRect; } /**

Returns the minimum value that the slider represents.

See Also: -setMinValue:

*/ - (double) minValue { return _minValue; } /**

Returns the maximum value that the slider represents.

See Also: -setMaxValue:

*/ - (double) maxValue { return _maxValue; } // ticks - (BOOL) allowsTickMarkValuesOnly { return _allowsTickMarkValuesOnly; } /* verified on Cocoa that a circular slider with one tick has two values: 0, 50 */ - (double) closestTickMarkValueToValue: (double)aValue { double d, f; int effectiveTicks; if (_numberOfTickMarks == 0) return aValue; effectiveTicks = _numberOfTickMarks; if (_type == NSCircularSlider) effectiveTicks++; if (effectiveTicks == 1) return (_maxValue + _minValue) / 2; if (aValue < _minValue) { aValue = _minValue; } else if (aValue > _maxValue) { aValue = _maxValue; } d = _maxValue - _minValue; f = ((aValue - _minValue) * (effectiveTicks - 1)) / d; f = ((GSRoundTowardsInfinity(f) * d) / (effectiveTicks - 1)) + _minValue; /* never return the maximum value, tested on Apple */ if (_type == NSCircularSlider && (f >= _maxValue)) f = _minValue; return f; } - (NSInteger) indexOfTickMarkAtPoint: (NSPoint)point { NSInteger i; for (i = 0; i < _numberOfTickMarks; i++) { if (NSPointInRect(point, [self rectOfTickMarkAtIndex: i])) { return i; } } return NSNotFound; } - (NSInteger) numberOfTickMarks { return _numberOfTickMarks; } - (NSRect) rectOfTickMarkAtIndex: (NSInteger)index { NSRect rect = _trackRect; CGFloat d; if ((index < 0) || (index >= _numberOfTickMarks)) { [NSException raise: NSRangeException format: @"Index of tick mark out of bounds."]; } if (_numberOfTickMarks > 1) { if (_isVertical) { d = NSHeight(rect) / (_numberOfTickMarks - 1); rect.size.height = d; rect.origin.y += d * index; } else { d = NSWidth(rect) / (_numberOfTickMarks - 1); rect.size.width = d; rect.origin.x += d * index; } } return rect; } - (void) setAllowsTickMarkValuesOnly: (BOOL)flag { _allowsTickMarkValuesOnly = flag; } - (void) setNumberOfTickMarks: (NSInteger)numberOfTickMarks { _numberOfTickMarks = numberOfTickMarks; if ((_control_view != nil) && ([_control_view isKindOfClass: [NSControl class]])) { [(NSControl*)_control_view updateCell: self]; } } - (void) setTickMarkPosition: (NSTickMarkPosition)position { _tickMarkPosition = position; if ((_control_view != nil) && ([_control_view isKindOfClass: [NSControl class]])) { [(NSControl*)_control_view updateCell: self]; } } - (NSTickMarkPosition) tickMarkPosition { return _tickMarkPosition; } - (double) tickMarkValueAtIndex: (NSInteger)index { if ((index < 0) || (index >= _numberOfTickMarks)) { [NSException raise: NSRangeException format: @"Index of tick mark out of bounds."]; } if (_numberOfTickMarks == 1) return (_maxValue + _minValue) / 2; if (index >= _numberOfTickMarks) return _maxValue; if (index <= 0) return _minValue; if (_type == NSCircularSlider) return _minValue + index * (_maxValue - _minValue) / _numberOfTickMarks; if (_type == NSLinearSlider) return _minValue + index * (_maxValue - _minValue) / (_numberOfTickMarks - 1); return 0.0; } - (BOOL) trackMouse: (NSEvent*)theEvent inRect: (NSRect)cellFrame ofView: (NSView*)controlView untilMouseUp: (BOOL)flag { float delay; float interval; id target = [self target]; SEL action = [self action]; NSUInteger eventMask = NSLeftMouseDownMask | NSLeftMouseUpMask | NSLeftMouseDraggedMask | NSMouseMovedMask; NSEventType eventType = [theEvent type]; BOOL isContinuous = [self isContinuous]; float oldFloatValue = [self floatValue]; NSRect slotRect = [self trackRect]; BOOL isVertical = [self isVertical]; double minValue = [self minValue]; double maxValue = [self maxValue]; BOOL isFlipped = [controlView isFlipped]; NSPoint location = [theEvent locationInWindow]; NSPoint point = [controlView convertPoint: location fromView: nil]; NSRect knobRect = [self knobRectFlipped: isFlipped]; _mouse_down_flags = [theEvent modifierFlags]; if (![self isEnabled]) { return NO; } if (![controlView mouse: point inRect: knobRect]) { // Mouse is not on the knob, move the knob to the mouse position float floatValue; floatValue = _floatValueForMousePoint(point, knobRect, slotRect, isVertical, minValue, maxValue, self, isFlipped, (_type == NSCircularSlider)); [self setFloatValue: floatValue]; if (isContinuous) { [(NSControl*)controlView sendAction: action to: target]; } } if (isContinuous) { [self getPeriodicDelay: &delay interval: &interval]; [NSEvent startPeriodicEventsAfterDelay: delay withPeriod: interval]; eventMask |= NSPeriodicMask; } while (eventType != NSLeftMouseUp) { theEvent = [NSApp nextEventMatchingMask: eventMask untilDate: [NSDate distantFuture] inMode: NSEventTrackingRunLoopMode dequeue: YES]; eventType = [theEvent type]; if (eventType == NSPeriodic) { NSWindow *w = [controlView window]; location = [w mouseLocationOutsideOfEventStream]; } else { location = [theEvent locationInWindow]; } point = [controlView convertPoint: location fromView: nil]; if (point.x != knobRect.origin.x || point.y != knobRect.origin.y) { float floatValue; floatValue = _floatValueForMousePoint(point, knobRect, slotRect, isVertical, minValue, maxValue, self, isFlipped, (_type == NSCircularSlider)); if (floatValue != oldFloatValue) { if (_allowsTickMarkValuesOnly) { floatValue = [self closestTickMarkValueToValue:floatValue]; } [self setFloatValue: floatValue]; if (isContinuous) { [(NSControl*)controlView sendAction: action to: target]; } oldFloatValue = floatValue; } knobRect.origin = point; } } // If the cell is not continuous send the action at the end of the drag if (!isContinuous) { [(NSControl*)controlView sendAction: action to: target]; } else { [NSEvent stopPeriodicEvents]; } return YES; } - (id) initWithCoder: (NSCoder*)decoder { self = [super initWithCoder: decoder]; if (self == nil) return nil; if ([decoder allowsKeyedCoding]) { _allowsTickMarkValuesOnly = [decoder decodeBoolForKey: @"NSAllowsTickMarkValuesOnly"]; _numberOfTickMarks = [decoder decodeIntForKey: @"NSNumberOfTickMarks"]; _tickMarkPosition = [decoder decodeIntForKey: @"NSTickMarkPosition"]; [self setMinValue: [decoder decodeFloatForKey: @"NSMinValue"]]; [self setMaxValue: [decoder decodeFloatForKey: @"NSMaxValue"]]; [self setFloatValue: [decoder decodeFloatForKey: @"NSValue"]]; _altIncrementValue = [decoder decodeFloatForKey: @"NSAltIncValue"]; [self setSliderType: [decoder decodeIntForKey: @"NSSliderType"]]; // do these here, since the Cocoa version of the class does not save these values... _knobCell = [NSCell new]; _titleCell = [NSTextFieldCell new]; [_titleCell setTextColor: [NSColor controlTextColor]]; [_titleCell setStringValue: @""]; [_titleCell setAlignment: NSCenterTextAlignment]; _isVertical = -1; } else { float minValue, maxValue; [decoder decodeValuesOfObjCTypes: "fffi", &minValue, &maxValue, &_altIncrementValue, &_isVertical]; [self setMinValue: minValue]; [self setMaxValue: maxValue]; [decoder decodeValueOfObjCType: @encode(id) at: &_titleCell]; [decoder decodeValueOfObjCType: @encode(id) at: &_knobCell]; if ([decoder versionForClassName: @"NSSliderCell"] >= 2) { [decoder decodeValueOfObjCType: @encode(BOOL) at: &_allowsTickMarkValuesOnly]; [decoder decodeValueOfObjCType: @encode(NSInteger) at: &_numberOfTickMarks]; [decoder decodeValueOfObjCType: @encode(int) at: &_tickMarkPosition]; } } return self; } - (void) encodeWithCoder: (NSCoder*)coder { [super encodeWithCoder: coder]; if ([coder allowsKeyedCoding]) { [coder encodeBool: _allowsTickMarkValuesOnly forKey: @"NSAllowsTickMarkValuesOnly"]; [coder encodeInt: _numberOfTickMarks forKey: @"NSNumberOfTickMarks"]; [coder encodeInt: _tickMarkPosition forKey: @"NSTickMarkPosition"]; [coder encodeFloat: _minValue forKey: @"NSMinValue"]; [coder encodeFloat: _maxValue forKey: @"NSMaxValue"]; [coder encodeFloat: _altIncrementValue forKey: @"NSAltIncValue"]; [coder encodeFloat: _minValue forKey: @"NSValue"]; // encoded for compatibility [coder encodeInt: _type forKey: @"NSSliderType"]; } else { [coder encodeValuesOfObjCTypes: "fffi", &_minValue, &_maxValue, &_altIncrementValue, &_isVertical]; [coder encodeValueOfObjCType: @encode(id) at: &_titleCell]; [coder encodeValueOfObjCType: @encode(id) at: &_knobCell]; // New for version 2 [coder encodeValueOfObjCType: @encode(BOOL) at: &_allowsTickMarkValuesOnly]; [coder encodeValueOfObjCType: @encode(NSInteger) at: &_numberOfTickMarks]; [coder encodeValueOfObjCType: @encode(int) at: &_tickMarkPosition]; } } @end gnustep-gui-0.24.0/Source/linking.m0000664000076500007650000000030511360134776017021 0ustar brains99brains99 #import #import "AppKit/AppKit.h" #import "GNUstepGUI/GSFontInfo.h" void __objc_gui_linking(void) { [GSFontInfo class]; [NSBezierPath class]; [NSStepper class]; } gnustep-gui-0.24.0/Source/NSBitmapImageRep+GIF.m0000664000076500007650000004153312244364561021065 0ustar brains99brains99/* NSBitmapImageRep+GIF.m Methods for reading GIF images Copyright (C) 2003, 2004 Free Software Foundation, Inc. Written by: Stefan Kleine Stegemann Date: Nov 2003 GIF writing, properties and transparency: Mark Tracy Date: Nov 2006 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import #import #import #import #import "AppKit/NSGraphics.h" #import "NSBitmapImageRep+GIF.h" #import "GSGuiPrivate.h" #if HAVE_LIBUNGIF || HAVE_LIBGIF /* gif_lib.h (4.1.0b1, possibly other versions) uses Object as the name of an argument to a function. This causes a conflict with Object declared by the objective-c headers. */ #define Object GS_GifLib_Object #include #undef Object // GIF 5.0 no longer has this define #ifndef FALSE #define FALSE 0 #endif /* FALSE */ /* ----------------------------------------------------------- The following types and functions are for interacting with the gif library. ----------------------------------------------------------- */ /* settings for reading interlaced images */ static int InterlaceOffset[] = { 0, 4, 2, 1 }; static int InterlaceJumps[] = { 8, 8, 4, 2 }; /* Holds the information for the input function. */ typedef struct gs_gif_input_src { const void *data; unsigned length; unsigned pos; } gs_gif_input_src; /* Provides data for the gif library. */ static int gs_gif_input(GifFileType *file, GifByteType *buffer, int len) { /* according the the libungif sources, this functions has to act like fread. */ int bytesRead; gs_gif_input_src *src = (gs_gif_input_src *)file->UserData; if (src->pos < src->length) { if ((src->pos + len) > src->length) { bytesRead = (src->length - src->pos); } else { bytesRead = len; } /* We have to copy the data here, looking at the libungif source makes this clear. */ memcpy(buffer, src->data + src->pos, bytesRead); src->pos = src->pos + bytesRead; } else { bytesRead = 0; } return bytesRead; } /* Initialze a new input source to be used with gs_gif_input. The passed structure has to be allocated outside this function. */ static void gs_gif_init_input_source(gs_gif_input_src *src, NSData *data) { src->data = [data bytes]; src->length = [data length]; src->pos = 0; } #if HAVE_QUANTIZEBUFFER || HAVE_GIFQUANTIZEBUFFER /* Function to write GIF to buffer */ static int gs_gif_output(GifFileType *file, const GifByteType *buffer, int len) { NSMutableData *nsData; if (len <= 0) return 0; nsData = file->UserData; [nsData appendBytes: buffer length: len]; return len; } #endif /* ----------------------------------------------------------- The gif loading part of NSBitmapImageRep ----------------------------------------------------------- */ @implementation NSBitmapImageRep (GIFReading) /* Return YES if this looks like a GIF. */ + (BOOL) _bitmapIsGIF: (NSData *)imageData { struct gs_gif_input_src src; GifFileType* file; if (!imageData || ![imageData length]) { return NO; } gs_gif_init_input_source(&src, imageData); #if GIFLIB_MAJOR >= 5 file = DGifOpen(&src, gs_gif_input, NULL); #else file = DGifOpen(&src, gs_gif_input); #endif if (file == NULL) { /* we do not use giferror here because it doesn't seem to be thread-safe (the error code is a global variable, so we might get the wrong error here. */ return NO; } DGifCloseFile(file); return YES; } #define SET_ERROR_MSG(msg) \ if (errorMsg != NULL) \ {\ *errorMsg = msg; \ }\ else \ {\ NSLog(@"%@", msg);\ } #define GIF_CREATE_ERROR(msg) \ SET_ERROR_MSG(msg); \ if (file != NULL) \ {\ DGifCloseFile(file); \ }\ if (imgBuffer != NULL) \ {\ NSZoneFree([self zone], imgBuffer); \ }\ RELEASE(self); \ return nil; #define CALL_CHECKED(f, where) \ gifrc = f; \ if (gifrc != GIF_OK) \ {\ NSString* msg = [NSString stringWithFormat: @"reading gif failed (%@)", \ where]; \ GIF_CREATE_ERROR(msg);\ } /* Read a gif image. Assume it is from a gif file. */ - (id) _initBitmapFromGIF: (NSData *)imageData errorMessage: (NSString **)errorMsg { struct gs_gif_input_src src; GifFileType *file = NULL; GifRecordType recordType; GifByteType *extension; GifPixelType *imgBuffer = NULL; GifPixelType *imgBufferPos; /* a position inside imgBuffer */ unsigned char *rgbBuffer; /* image converted to rgb */ unsigned rgbBufferPos; unsigned rgbBufferSize; ColorMapObject *colorMap; GifColorType *color; unsigned char colorIndex; unsigned pixelSize, rowSize; int extCode; int gifrc; /* required by CALL_CHECKED */ int i, j; /* counters */ int imgHeight = 0, imgWidth = 0, imgRow = 0, imgCol = 0; BOOL hasAlpha = NO; unsigned char transparentColor = 0; int sPP = 3; /* samples per pixel */ unsigned short duration = 0; /* open the image */ gs_gif_init_input_source(&src, imageData); #if GIFLIB_MAJOR >= 5 file = DGifOpen(&src, gs_gif_input, NULL); #else file = DGifOpen(&src, gs_gif_input); #endif if (file == NULL) { /* we do not use giferror here because it doesn't seem to be thread-safe (the error code is a global variable, so we might get the wrong error here. */ GIF_CREATE_ERROR(@"unable to open gif from data"); /* Not reached. */ } /* allocate a buffer for the decoded image */ pixelSize = sizeof(GifPixelType); rowSize = file->SWidth * pixelSize; imgBuffer = NSZoneMalloc([self zone], file->SHeight * rowSize); if (imgBuffer == NULL) { GIF_CREATE_ERROR(@"could not allocate input buffer"); /* Not reached. */ } /* set the background color */ memset(imgBuffer, file->SBackGroundColor, file->SHeight * rowSize); /* read the image * this delivers the first image in a multi-image gif */ do { CALL_CHECKED(DGifGetRecordType(file, &recordType), @"GetRecordType"); switch (recordType) { case IMAGE_DESC_RECORD_TYPE: { CALL_CHECKED(DGifGetImageDesc(file), @"GetImageDesc"); imgWidth = file->Image.Width; imgHeight = file->Image.Height; imgRow = file->Image.Top; imgCol = file->Image.Left; if ((file->Image.Left + file->Image.Width > file->SWidth) || (file->Image.Top + file->Image.Height > file->SHeight)) { GIF_CREATE_ERROR(@"image does not fit into screen dimensions"); } if (file->Image.Interlace) { for (i = 0; i < 4; i++) { for (j = imgRow + InterlaceOffset[i]; j < imgRow + imgHeight; j = j + InterlaceJumps[i]) { imgBufferPos = imgBuffer + (j * rowSize) + (imgCol * pixelSize); CALL_CHECKED(DGifGetLine(file, imgBufferPos, imgWidth), @"GetLine(Interlaced)"); } } } else { for (i = 0; i < imgHeight; i++) { imgBufferPos = imgBuffer + ((imgRow++) * rowSize) + (imgCol * pixelSize); CALL_CHECKED(DGifGetLine(file, imgBufferPos, imgWidth), @"GetLine(Non-Interlaced)"); } } break; } case EXTENSION_RECORD_TYPE: { /* transparency support */ CALL_CHECKED(DGifGetExtension(file, &extCode, &extension), @"GetExtension"); if (extCode == GRAPHICS_EXT_FUNC_CODE) { hasAlpha = (extension[1] & 0x01); transparentColor = extension[4]; duration = extension[3]; duration = (duration << 8) + extension[2]; } while (extension != NULL) { CALL_CHECKED(DGifGetExtensionNext(file, &extension), @"GetExtensionNext"); } break; } case TERMINATE_RECORD_TYPE: default: { break; } } } while ((recordType != IMAGE_DESC_RECORD_TYPE) && (recordType != TERMINATE_RECORD_TYPE)); /* convert the image to rgb */ sPP = hasAlpha? 4 : 3; rgbBufferSize = file->SHeight * (file->SWidth * sizeof(unsigned char) * sPP); rgbBuffer = NSZoneMalloc([self zone], rgbBufferSize); if (rgbBuffer == NULL) { GIF_CREATE_ERROR(@"could not allocate image buffer"); /* Not reached. */ } colorMap = (file->Image.ColorMap ? file->Image.ColorMap : file->SColorMap); rgbBufferPos = 0; for (i = 0; i < file->SHeight; i++) { imgBufferPos = imgBuffer + (i * rowSize); for (j = 0; j < file->SWidth; j++) { colorIndex = *(imgBufferPos + j*pixelSize); color = &colorMap->Colors[colorIndex]; rgbBuffer[rgbBufferPos++] = color->Red; rgbBuffer[rgbBufferPos++] = color->Green; rgbBuffer[rgbBufferPos++] = color->Blue; if (hasAlpha) rgbBuffer[rgbBufferPos++] = (transparentColor == colorIndex)? 0 : 255; } } NSZoneFree([self zone], imgBuffer); /* initialize self */ [self initWithBitmapDataPlanes: &rgbBuffer pixelsWide: file->SWidth pixelsHigh: file->SHeight bitsPerSample: 8 samplesPerPixel: sPP hasAlpha: hasAlpha isPlanar: NO colorSpaceName: NSCalibratedRGBColorSpace bytesPerRow: file->SWidth * sPP bitsPerPixel: 8 * sPP]; _imageData = [[NSData alloc] initWithBytesNoCopy: rgbBuffer length: rgbBufferSize]; [self setProperty: NSImageRGBColorTable withValue: [NSData dataWithBytes: colorMap->Colors length: sizeof(GifColorType)*colorMap->ColorCount]]; if (duration > 0) { [self setProperty: NSImageCurrentFrameDuration withValue: [NSNumber numberWithFloat: (100.0 * duration)]]; } [self setProperty: NSImageCurrentFrame withValue: [NSNumber numberWithInt: 0]]; /* don't forget to close the gif */ DGifCloseFile(file); return self; } - (NSData *) _GIFRepresentationWithProperties: (NSDictionary *) properties errorMessage: (NSString **)errorMsg { #if HAVE_QUANTIZEBUFFER || HAVE_GIFQUANTIZEBUFFER NSMutableData * GIFRep = nil; // our return value GifFileType * GIFFile = NULL; GifByteType * rgbPlanes = NULL; // giflib needs planar RGB GifByteType * redPlane = NULL; GifByteType * greenPlane = NULL; GifByteType * bluePlane = NULL; int width, height; GifByteType * GIFImage = NULL; // intermediate image storage GifByteType * GIFImageP = NULL; int h; // general-purpose loop counter ColorMapObject * GIFColorMap = NULL; int colorMapSize = 256; int status; // return status for giflib calls NSString * colorSpaceName; BOOL isRGB, hasAlpha; unsigned char * bitmapData = NULL; unsigned char * planes[5]; // MAX_PLANES = 5 NSData * colorTable = NULL; // passed in from properties NSLog(@"GIF representation is experimental"); width = [self pixelsWide]; height = [self pixelsHigh]; if (!width || !height) { SET_ERROR_MSG(@"GIFRepresentation: image is zero size"); return nil; } // Giflib wants planar RGB so convert as necessary colorSpaceName = [self colorSpaceName]; isRGB = ([colorSpaceName isEqualToString: NSDeviceRGBColorSpace] || [colorSpaceName isEqualToString: NSCalibratedRGBColorSpace]); if (!isRGB) { SET_ERROR_MSG(@"GIFRepresentation: Only RGB is supported at this time."); return nil; } hasAlpha = [self hasAlpha]; if ([self isPlanar]) { [self getBitmapDataPlanes: planes]; redPlane = planes[0]; greenPlane = planes[1]; bluePlane = planes[2]; } else // interleaved RGB or RGBA { rgbPlanes = malloc(sizeof(GifByteType)*width*height*3); if (!rgbPlanes) { SET_ERROR_MSG(@"GIFRepresentation: malloc out of memory."); return nil; } redPlane = rgbPlanes; greenPlane = redPlane + width*height; bluePlane = greenPlane + width*height; bitmapData = [self bitmapData]; for (h = 0; h < width*height; h++) { *redPlane++ = *bitmapData++; *greenPlane++ = *bitmapData++; *bluePlane++ = *bitmapData++; if (hasAlpha) bitmapData++; // ignore alpha channel } redPlane = rgbPlanes; greenPlane = redPlane + width*height; bluePlane = greenPlane + width*height; } // If you have a color table, you must be certain that it is GIF format colorTable = [self valueForProperty: NSImageRGBColorTable]; // nil is OK colorMapSize = (colorTable)? [colorTable length]/sizeof(GifColorType) : 256; #if GIFLIB_MAJOR >= 5 GIFColorMap = GifMakeMapObject(colorMapSize, [colorTable bytes]); #else GIFColorMap = MakeMapObject(colorMapSize, [colorTable bytes]); #endif if (!GIFColorMap) { SET_ERROR_MSG(@"GIFRepresentation (giflib): MakeMapObject() failed."); free(rgbPlanes); return nil; } GIFImage = malloc(sizeof(GifByteType)*height*width); if (!GIFImage) { SET_ERROR_MSG(@"GIFRepresentation: malloc out of memory."); free(rgbPlanes); } #if GIFLIB_MAJOR >= 5 status = GifQuantizeBuffer(width, height, &colorMapSize, redPlane, greenPlane, bluePlane, GIFImage, GIFColorMap->Colors); #else status = QuantizeBuffer(width, height, &colorMapSize, redPlane, greenPlane, bluePlane, GIFImage, GIFColorMap->Colors); #endif if (status == GIF_ERROR) { free(GIFImage); free(rgbPlanes); return nil; } // QuantizeBuffer returns an optimized colorMapSize, // but we must round up to nearest power of 2 // otherwise MakeColorMap() fails for (h = 0; h < 8; h++) if ((1<= colorMapSize) break; colorMapSize = 1<ColorCount = colorMapSize; GIFColorMap->BitsPerPixel = h; if (![self isPlanar]) free(rgbPlanes); // Write the converted image out to the NSData GIFRep = [NSMutableData dataWithLength: 0]; if (!GIFRep) { free(GIFImage); return nil; } #if GIFLIB_MAJOR >= 5 GIFFile = EGifOpen(GIFRep, gs_gif_output, NULL); #else GIFFile = EGifOpen(GIFRep, gs_gif_output); #endif status = EGifPutScreenDesc(GIFFile, width, height, 8, 0, NULL); if (status == GIF_ERROR) { SET_ERROR_MSG(@"GIFRepresentation (giflib): EGifPutScreenDesc() failed."); free(GIFImage); return nil; } // note we are not supporting interlaced mode status = EGifPutImageDesc(GIFFile, 0, 0, width, height, FALSE, GIFColorMap); if (status == GIF_ERROR) { SET_ERROR_MSG(@"GIFRepresentation (giflib): EGifPutImageDesc() failed."); free(GIFImage); return nil; } GIFImageP = GIFImage; for (h = 0; h < height ; h++) { status = EGifPutLine(GIFFile, GIFImageP, width); if (status == GIF_ERROR) { SET_ERROR_MSG(@"GIFRepresentation (giflib): EGifPutLine() failed."); free(GIFImage); return nil; } GIFImageP += width; } status = EGifCloseFile(GIFFile); free(GIFImage); return GIFRep; #else SET_ERROR_MSG(@"GIFRepresentation: not available on this system"); return nil; #endif } @end #else /* !HAVE_LIBUNGIF || !HAVE_LIBGIF */ @implementation NSBitmapImageRep (GIFReading) + (BOOL) _bitmapIsGIF: (NSData *)imageData { return NO; } - (id) _initBitmapFromGIF: (NSData *)imageData errorMessage: (NSString **)errorMsg { if (errorMsg != NULL) { *errorMsg = @"gif images not supported on this system"; } RELEASE(self); return nil; } - (NSData *) _GIFRepresentationWithProperties: (NSDictionary *) properties errorMessage: (NSString **)errorMsg { if (errorMsg != NULL) { *errorMsg = @"GIFRepresentation: not supported on this system"; } return nil; } @end #endif /* !HAVE_LIBUNGIF || !HAVE_LIBGIF */ gnustep-gui-0.24.0/Source/NSBitmapImageRep+ICNS.h0000664000076500007650000000263711565023346021207 0ustar brains99brains99/* NSBitmapImageRep+ICNS.m Methods for loading .icns images. Copyright (C) 2008 Free Software Foundation, Inc. Written by: Gregory Casamento Date: 2008-08-12 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _NSBitmapImageRep_ICNS_H_include #define _NSBitmapImageRep_ICNS_H_include #import "AppKit/NSBitmapImageRep.h" @interface NSBitmapImageRep (ICNS) + (BOOL) _bitmapIsICNS: (NSData *)imageData; + (NSArray*) _imageRepsWithICNSData: (NSData *)imageData; - (id) _initBitmapFromICNS: (NSData *)imageData; // - (NSData *) _ICNSRepresentationWithProperties: (NSDictionary *) properties; @end #endif gnustep-gui-0.24.0/Source/NSComboBox.m0000664000076500007650000003571612110024400017325 0ustar brains99brains99/** NSComboBox Copyright (C) 1999 Free Software Foundation, Inc. Author: Gerrit van Dyk Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import "AppKit/NSComboBox.h" #import "AppKit/NSComboBoxCell.h" #import "AppKit/NSEvent.h" #import "AppKit/NSTextView.h" /* * Class variables */ static Class usedCellClass; static Class comboBoxCellClass; static NSNotificationCenter *nc; /* * Declaration of private cell method */ @interface NSComboBoxCell (GNUstepPrivate) - (void) _performClickWithFrame: (NSRect)cellFrame inView: (NSView *)controlView; @end /** Class Description

An NSComboBox is what we can call a completion/choices box, derived from NSTextField, it allows you to enter text like in a text field but also to click in the ellipsis button (indicating the fact other user inputs are possible) on the right of it to obtain a list of choices, you can use them as the text field value by selecting a row in this list. You can also obtain direct completion when it is enabled via setCompletes: to get a suggested text field value updated as you type.

Like other NSControl classes, NSComboBox is a wrapper around a core piece which implements the combo box behavior, a cell, which is in this case an NSComboBoxCell.

*/ /**

No special instructions to use NSComboBox or text to detail the implementation.

*/ @implementation NSComboBox + (void) initialize { if (self == [NSComboBox class]) { [self setVersion: 1]; comboBoxCellClass = [NSComboBoxCell class]; usedCellClass = comboBoxCellClass; nc = [NSNotificationCenter defaultCenter]; } } /* * Setting the Cell class */ + (Class) cellClass { return usedCellClass; } + (void) setCellClass: (Class)factoryId { usedCellClass = factoryId ? factoryId : comboBoxCellClass; } /** * Returns YES when the combo box cell displays a vertical scroller for its * list, returns NO otherwise. * Take note that the scroller will be displayed even when the sum of the items * height in the list is inferior to the minimal height of the list displayed * area. */ - (BOOL)hasVerticalScroller { return [_cell hasVerticalScroller]; } /** * Sets whether the combo box cell list displays a vertical scroller, by default * it is the case. When flag is NO and the combo cell list has more * items (either in its default list or from its data source) than the number * returned by numberOfVisibleItems, only a subset of them will be * displayed. Uses scroll related methods to position this subset in the combo * box cell list. * Take note that the scroller will be displayed even when the sum of the items * height in the list is inferior to the minimal height of the list displayed * area. */ - (void)setHasVerticalScroller:(BOOL)flag { [_cell setHasVerticalScroller:flag]; } /** * Returns the width and the height (as the values of an NSSize variable) * between each item of the combo box cell list. */ - (NSSize)intercellSpacing { return [_cell intercellSpacing]; } /** * Sets the width and the height between each item of the combo box cell list to * the values in aSize. */ - (void)setIntercellSpacing:(NSSize)aSize { [_cell setIntercellSpacing:aSize]; } /** * Returns the height of the items in the combo box cell list. */ - (CGFloat)itemHeight { return [_cell itemHeight]; } /** * Sets the height of the items in the combo box cell list to * itemHeight. */ - (void)setItemHeight:(CGFloat)itemHeight { [_cell setItemHeight:itemHeight]; } /** * Returns the maximum number of allowed items to be displayed in the combo box * cell list. */ - (NSInteger)numberOfVisibleItems { return [_cell numberOfVisibleItems]; } /** * Sets the maximum number of allowed items to be displayed in the combo box * cell list. */ - (void)setNumberOfVisibleItems:(NSInteger)visibleItems { [_cell setNumberOfVisibleItems:visibleItems]; } /** * Marks the combo box cell in order to have its items list reloaded in the * case it uses a data source, and to have it redisplayed. */ - (void)reloadData { [_cell reloadData]; } /** * Informs the combo box cell that the number of items in its data source has * changed, in order to permit to the scrollers in its displayed list being * updated without needing the reload of the data. * It is recommended to use this method with a data source that continually * receives data in the background, to keep the the combo box cell responsive to * the user while the data is received. * Take a look at the NSComboBoxDataSource informal protocol * specification to know more on the messages NSComboBox sends to its data * source. */ - (void)noteNumberOfItemsChanged { [_cell noteNumberOfItemsChanged]; } /** * Returns YES when the combo box cell uses a data source (which is external) to * populate its items list, otherwise returns NO in the case it uses its default * list. */ - (BOOL)usesDataSource { return [_cell usesDataSource]; } /** * Sets according to flag whether the combo box cell uses a data * source (which is external) to populate its items list. */ - (void)setUsesDataSource:(BOOL)flag { [_cell setUsesDataSource:flag]; } /** * Scrolls the combo box cell list vertically in order to have the item at * index in the closest position relative to the top. There is no * need to have the list displayed when this method is invoked. */ - (void)scrollItemAtIndexToTop:(NSInteger)index { [_cell scrollItemAtIndexToTop:index]; } /** * Scrolls the combo box cell list vertically in order to have the item at * index visible. There is no need to have the list displayed when * this method is invoked. */ - (void)scrollItemAtIndexToVisible:(NSInteger)index { [_cell scrollItemAtIndexToVisible:index]; } /** * Selects the combo box cell list row at index. * Take note no changes occurs in the combo box cell list when this method is * called. * Posts an NSComboBoxSelectionDidChangeNotification to the default notification * center when there is a new selection different from the previous one. */ - (void)selectItemAtIndex:(NSInteger)index { [_cell selectItemAtIndex:index]; } /** * Deselects the combo box cell list row at index in the case this * row is selected. * Posts an NSComboBoxSelectionDidChangeNotification to the default notification * center, when there is a new selection. */ - (void)deselectItemAtIndex:(NSInteger)index { [_cell deselectItemAtIndex:index]; } /** * Returns the index of the selected item in the combo box cell list or -1 when * there is no selection, the selected item can be related to the data source * object in the case usesDataSource returns YES else to the * default items list. */ - (NSInteger)indexOfSelectedItem { return [_cell indexOfSelectedItem]; } /** * Returns the number of items in the the combo box cell list, the numbers of * items can be be related to the data source object in the case * usesDataSource returns YES else to the default items list. */ - (NSInteger)numberOfItems { return [_cell numberOfItems]; } /** * Returns the combo box cell data source object which is reponsible to provide * the data to be displayed. To know how to implement a data source object, * take a look at the NSComboBoxDataSource informal protocol description. In * the case usesDataSource returns NO, this method logs a warning. */ - (id)dataSource { return [_cell dataSource]; } /** * Sets the combo box cell data source to aSource. Just calling this * method doesn't set usesDataSource to return YES, you must call * setUsesDataSource: with YES before or a warning will be logged. * To know how to implement a data source objects, take a look at the * NSComboBoxDataSource informal protocol description. When aSource * doesn't respond to the methods numberOfItemsInComboBox: * comboBox:objectValueForItemAtIndex:, this method * logs a warning. */ - (void)setDataSource:(id)aSource { [_cell setDataSource:aSource]; } /** * Adds an item to the combo box cell default items list which is used when * usesDataSource returns NO. In the case * usesDataSource returns YES, this method logs a warning. */ - (void)addItemWithObjectValue:(id)object { [_cell addItemWithObjectValue:object]; } /** * Adds several items in an array to the combo box cell default items list which * is used when usesDataSource returns NO. In the case * usesDataSource returns YES, this method logs a warning. */ - (void)addItemsWithObjectValues:(NSArray *)objects { [_cell addItemsWithObjectValues:objects]; } /** * Inserts an item in the combo box cell default items list which * is used when usesDataSource returns NO. In the case * usesDataSource returns YES, this method logs a warning. */ - (void)insertItemWithObjectValue:(id)object atIndex:(NSInteger)index { [_cell insertItemWithObjectValue:object atIndex:index]; } /** * Removes an item in the combo box cell default items list which * is used when usesDataSource returns NO. In the case * usesDataSource returns YES, this method logs a warning. */ - (void)removeItemWithObjectValue:(id)object { [_cell removeItemWithObjectValue:object]; } /** * Removes the item with the specified index in the combo box cell * default items list which is used when usesDataSource returns NO. * In the case usesDataSource returns YES, this method logs a warning. */ - (void)removeItemAtIndex:(NSInteger)index { [_cell removeItemAtIndex:index]; } /** * Removes all the items in the combo box cell default items list which is used * when usesDataSource returns NO. In the case * usesDataSource returns YES, this method logs a warning. */ - (void)removeAllItems { [_cell removeAllItems]; } /** * Selects the first item in the default combo box cell list which is equal to * object. In the case usesDataSource returns YES, this * method logs a warning. * Take note that this method doesn't update the text field part value. * Posts an NSComboBoxSelectionDidChange notification to the default * notification center when the new selection is different than the previous * one. */ - (void)selectItemWithObjectValue:(id)object { [_cell selectItemWithObjectValue:object]; } /** * Returns the object value at index within combo box cell default * items list. When the index is beyond the end of the list, an NSRangeException is * raised. In the case usesDataSource returns YES, this method logs * a warning. */ - (id)itemObjectValueAtIndex:(NSInteger)index { return [_cell itemObjectValueAtIndex:index]; } /** * Returns the object value of the selected item in the combo box cell default * items list or nil when there is no selection. In the case * usesDataSource returns YES, this method logs a warning. */ - (id)objectValueOfSelectedItem { return [_cell objectValueOfSelectedItem]; } /** * Returns the lowest index associated with a value in the combo box * cell default items list, which is equal to object, and returns * NSNotFound when there is no such value. In the case * usesDataSource returns YES, this method logs a warning. */ - (NSInteger)indexOfItemWithObjectValue:(id)object { return [_cell indexOfItemWithObjectValue:object]; } /** * Returns the combo box cell default items list in an array. */ - (NSArray *)objectValues { return [_cell objectValues]; } /** * Returns YES when the combo box cell automatic completion is active, returns * NO otherwise. * Take a look at the setCompletes: method documentation to know * how the automatic completion works. */ - (BOOL)completes { return [_cell completes]; } /** * Sets whether the combo box cell automatic completion is active or not. * The automatic completion tries to complete what the user types in the text * field part, it tries to complete only when the the user adds characters at * the end of the string, not when it deletes characters or when the insertion * point precedes the end of the string. * To do the automatic completion, the completedString: method is * called, and when the returned string is longer than the current one in the text * field, the completion occurs and the completed part gets selected. */ - (void)setCompletes:(BOOL)completes { [_cell setCompletes: completes]; } - (BOOL) isButtonBordered { return [_cell isButtonBordered]; } - (void) setButtonBordered:(BOOL)flag { [_cell setButtonBordered: flag]; } - (void) setDelegate: (id)anObject { [super setDelegate: anObject]; #define SET_DELEGATE_NOTIFICATION(notif_name) \ if ([_delegate respondsToSelector: @selector(comboBox##notif_name:)]) \ [nc addObserver: _delegate \ selector: @selector(comboBox##notif_name:) \ name: NSComboBox##notif_name##Notification object: self] SET_DELEGATE_NOTIFICATION(SelectionDidChange); SET_DELEGATE_NOTIFICATION(SelectionIsChanging); SET_DELEGATE_NOTIFICATION(WillPopUp); SET_DELEGATE_NOTIFICATION(WillDismiss); } // Overridden - (void) mouseDown: (NSEvent*)theEvent { BOOL buttonClicked; // buttonClicked is set to the value NO when the click occurs in the text cell // and to the value YES when it occurs in the button cell. buttonClicked = [_cell trackMouse: theEvent inRect: [self bounds] ofView: self untilMouseUp: YES]; if (!buttonClicked) [super mouseDown: theEvent]; } - (BOOL) textView: (NSTextView *)textView doCommandBySelector: (SEL)command { if ([super textView: textView doCommandBySelector: command]) return YES; if (sel_isEqual(command, @selector(moveDown:))) { [_cell _performClickWithFrame: [self bounds] inView: self]; return YES; } return NO; } - (void) setFrame: (NSRect)frame { NSRect rect = NSMakeRect(frame.origin.x, frame.origin.y, frame.size.width, 21); // FIX ME: We shouldn't harcode the height value [super setFrame: rect]; } @end gnustep-gui-0.24.0/Source/NSTextList.m0000664000076500007650000001206311534147002017400 0ustar brains99brains99/* NSTextList.m Copyright (C) 2008 Free Software Foundation, Inc. Author: H. Nikolaus Schaller Date: 2007 Author: Fred Kiefer Date: January 2008 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import "AppKit/NSTextList.h" @implementation NSTextList - (id) initWithMarkerFormat: (NSString *)format options: (unsigned int)mask { ASSIGN(_markerFormat, format); _listOptions = mask; return self; } - (void) dealloc; { RELEASE(_markerFormat); [super dealloc]; } - (BOOL) isEqual: (id)anObject { if (anObject == self) { return YES; } if (anObject == nil || [anObject isKindOfClass: [NSTextList class]] == NO) { return NO; } return ([anObject listOptions] == _listOptions) && [_markerFormat isEqualToString: [anObject markerFormat]]; } - (unsigned int) listOptions { return _listOptions; } - (NSString *) markerFormat { return _markerFormat; } - (NSString *) markerForItemNumber: (int)item { NSMutableString *s = [_markerFormat mutableCopy]; unichar box = 0x25A1; unichar check = 0x2713; unichar circle = 0x25E6; unichar diamond = 0x25C6; unichar disc = 0x2022; unichar hyphen = 0x2043; unichar square = 0x25A0; // FIXME: Needs optimisation and roman numbers [s replaceOccurrencesOfString: @"{box}" withString: [NSString stringWithCharacters: &box length: 1] options: 0 range: NSMakeRange(0, [s length])]; [s replaceOccurrencesOfString: @"{check}" withString: [NSString stringWithCharacters: &check length: 1] options: 0 range: NSMakeRange(0, [s length])]; [s replaceOccurrencesOfString: @"{circle}" withString: [NSString stringWithCharacters: &circle length: 1] options: 0 range: NSMakeRange(0, [s length])]; [s replaceOccurrencesOfString: @"{diamond}" withString: [NSString stringWithCharacters: &diamond length: 1] options: 0 range: NSMakeRange(0, [s length])]; [s replaceOccurrencesOfString: @"{disc}" withString: [NSString stringWithCharacters: &disc length: 1] options: 0 range: NSMakeRange(0, [s length])]; [s replaceOccurrencesOfString: @"{hyphen}" withString: [NSString stringWithCharacters: &hyphen length: 1] options: 0 range: NSMakeRange(0, [s length])]; [s replaceOccurrencesOfString: @"{square}" withString: [NSString stringWithCharacters: &square length: 1] options: 0 range: NSMakeRange(0, [s length])]; [s replaceOccurrencesOfString: @"{decimal}" withString: [NSString stringWithFormat: @"%d", item] options: 0 range: NSMakeRange(0, [s length])]; [s replaceOccurrencesOfString: @"{octal}" withString: [NSString stringWithFormat: @"%o", item] options: 0 range: NSMakeRange(0, [s length])]; [s replaceOccurrencesOfString: @"{lower-hexadecimal}" withString: [NSString stringWithFormat: @"%x", item] options: 0 range: NSMakeRange(0, [s length])]; [s replaceOccurrencesOfString: @"{upper-hexadecimal}" withString: [NSString stringWithFormat: @"%X", item] options: 0 range: NSMakeRange(0, [s length])]; [s replaceOccurrencesOfString: @"{lower-alpha}" withString: [NSString stringWithFormat: @"%c", item + 'a'] options: 0 range: NSMakeRange(0, [s length])]; [s replaceOccurrencesOfString: @"{lower-latin}" withString: [NSString stringWithFormat: @"%c", item + 'a'] options: 0 range: NSMakeRange(0, [s length])]; [s replaceOccurrencesOfString: @"{upper-alpha}" withString: [NSString stringWithFormat: @"%c", item + 'A'] options: 0 range: NSMakeRange(0, [s length])]; [s replaceOccurrencesOfString: @"{upper-latin}" withString: [NSString stringWithFormat: @"%c", item + 'A'] options: 0 range: NSMakeRange(0, [s length])]; return AUTORELEASE(s); } - (id) copyWithZone: (NSZone*)zone { NSTextList *l = (NSTextList*)NSCopyObject(self, 0, zone); _markerFormat = TEST_RETAIN(_markerFormat); return l; } - (void) encodeWithCoder: (NSCoder*)aCoder { // FIXME if ([aCoder allowsKeyedCoding]) { } else { } } - (id) initWithCoder: (NSCoder*)aDecoder { // FIXME if ([aDecoder allowsKeyedCoding]) { } else { } return self; } @end gnustep-gui-0.24.0/Source/GSToolTips.m0000664000076500007650000004045212122432376017376 0ustar brains99brains99/** Implementation of the GSToolTips class Copyright (C) 2006 Free Software Foundation, Inc. Author: Richard Frith-Macdonald Date: 2006 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSAttributedString.h" #import "AppKit/NSBezierPath.h" #import "AppKit/NSEvent.h" #import "AppKit/NSScreen.h" #import "AppKit/NSStringDrawing.h" #import "AppKit/NSView.h" #import "AppKit/NSPanel.h" #import "GNUstepGUI/GSTrackingRect.h" #import "GSToolTips.h" #import "GSFastEnumeration.h" @interface NSWindow (GNUstepPrivate) + (void) _setToolTipVisible: (GSToolTips*)t; + (GSToolTips*) _toolTipVisible; @end @interface NSObject (ToolTips) - (NSString*) view: (NSView*)v stringForToolTip: (NSToolTipTag)t point: (NSPoint)p userData: (void*)d; @end /* A trivial class to hold information about the provider of the tooltip * string. Instance allocation/deallocation is managed by GSToolTip and * our instances are stored in the user data field of tracking rectangles. */ @interface GSTTProvider : NSObject { id object; void *data; } - (void*) data; - (id) initWithObject: (id)o userData: (void*)d; - (id) object; - (void) setObject: (id)o; @end @implementation GSTTProvider - (void*) data { return data; } - (void) dealloc { [self setObject: nil]; [super dealloc]; } - (id) initWithObject: (id)o userData: (void*)d { data = d; [self setObject: o]; return self; } - (id) object { return object; } - (void) setObject: (id)o { /* Experimentation on MacOS-X shows that the object is not retained. * However, if the object does not provide a string, we must use a * copy of its description ... and we have to retain that until we * are done with it. */ if ([object respondsToSelector: @selector(view:stringForToolTip:point:userData:)] == NO) { /* Object must be a string rather than something which provides one */ RELEASE(object); } object = o; if ([object respondsToSelector: @selector(view:stringForToolTip:point:userData:)] == NO) { /* Object does not provide a string ... so we take a copy of it * as the string to be used. */ object = [[object description] copy]; } } @end @interface GSTTView : NSView { NSAttributedString *_text; } - (void)setText: (NSAttributedString *)text; @end @implementation GSTTView - (id) initWithFrame: (NSRect)frameRect { self = [super initWithFrame: frameRect]; if (self) { [self setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; } return self; } - (void) setText: (NSAttributedString *)text { if (_text != text) { ASSIGN(_text, text); [self setNeedsDisplay: YES]; } } - (void) drawRect: (NSRect)dirtyRect { if (_text) { NSRectEdge sides[] = {NSMinXEdge, NSMaxYEdge, NSMaxXEdge, NSMinYEdge}; NSColor *black = [NSColor blackColor]; NSColor *colors[] = {black, black, black, black}; NSRect bounds = [self bounds]; NSRect frame = [self frame]; NSRect textRect = NSInsetRect(frame, 2, 2); NSDrawColorTiledRects(bounds, bounds, sides, colors, 4); [_text drawInRect: textRect]; } } @end @interface GSTTPanel : NSPanel // Tooltip panel that will not try to become main or key - (BOOL) canBecomeKeyWindow; - (BOOL) canBecomeMainWindow; @end @implementation GSTTPanel - (id) initWithContentRect: (NSRect)contentRect styleMask: (NSUInteger)aStyle backing: (NSBackingStoreType)bufferingType defer: (BOOL)flag; { self = [super initWithContentRect: contentRect styleMask: aStyle backing: bufferingType defer: flag]; if (self) { [self setContentView: [[[GSTTView alloc] initWithFrame: contentRect] autorelease]]; } return self; } - (BOOL) canBecomeKeyWindow { return NO; } - (BOOL) canBecomeMainWindow { return NO; } @end @interface GSToolTips (Private) - (void) _endDisplay; - (void) _timedOut: (NSTimer *)timer; @end /* typedef struct NSView_struct { @defs(NSView) } *NSViewPtr; */ typedef NSView* NSViewPtr; @implementation GSToolTips static NSMapTable *viewsMap = 0; static NSTimer *timer = nil; static GSToolTips *timedObject = nil; // Having a single stored panel for tooltips greatly reduces callback interaction from MS-Windows static GSTTPanel *window = nil; // Prevent Windows callback API from attempting to dismiss tooltip as its in the process of appearing static BOOL isOpening = NO; static NSSize offset; static BOOL restoreMouseMoved; + (void) initialize { viewsMap = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks, NSObjectMapValueCallBacks, 8); window = [[GSTTPanel alloc] initWithContentRect: NSMakeRect(0,0,100,25) styleMask: NSBorderlessWindowMask backing: NSBackingStoreRetained defer: YES]; [window setBackgroundColor: [NSColor colorWithDeviceRed: 1.0 green: 1.0 blue: 0.90 alpha: 1.0]]; [window setReleasedWhenClosed: NO]; [window setExcludedFromWindowsMenu: YES]; [window setLevel: NSPopUpMenuWindowLevel]; [window setAutodisplay: NO]; } + (void) removeTipsForView: (NSView*)aView { GSToolTips *tt = (GSToolTips*)NSMapGet(viewsMap, (void*)aView); if (tt != nil) { [tt removeAllToolTips]; NSMapRemove(viewsMap, (void*)aView); } } + (GSToolTips*) tipsForView: (NSView*)aView { GSToolTips *tt = (GSToolTips*)NSMapGet(viewsMap, (void*)aView); if (tt == nil) { tt = [[GSToolTips alloc] initForView: aView]; NSMapInsert(viewsMap, (void*)aView, (void*)tt); RELEASE(tt); } return tt; } - (NSToolTipTag) addToolTipRect: (NSRect)aRect owner: (id)anObject userData: (void *)data { NSTrackingRectTag tag; GSTTProvider *provider; if (timer != nil) { return -1; // A tip is already in progress. } aRect = NSIntersectionRect(aRect, [view bounds]); if (NSEqualRects(aRect, NSZeroRect)) { return -1; // No rectangle. } if (anObject == nil) { return -1; // No provider object. } provider = [[GSTTProvider alloc] initWithObject: anObject userData: data]; tag = [view addTrackingRect: aRect owner: self userData: provider assumeInside: NO]; return tag; } - (unsigned) count { NSEnumerator *enumerator; GSTrackingRect *rect; unsigned count = 0; enumerator = [((NSViewPtr)view)->_tracking_rects objectEnumerator]; while ((rect = [enumerator nextObject]) != nil) { if (rect->owner == self) { count++; } } return count; } - (void) dealloc { [self _endDisplay]; [self removeAllToolTips]; [super dealloc]; } - (id) initForView: (NSView*)aView { view = aView; toolTipTag = -1; return self; } - (void) mouseEntered: (NSEvent *)theEvent { GSTTProvider *provider; NSString *toolTipString; if (timer != nil) { /* Moved from one tooltip view to another, so reset the timer. */ [timer invalidate]; timer = nil; timedObject = nil; } provider = (GSTTProvider*)[theEvent userData]; if ([[provider object] respondsToSelector: @selector(view:stringForToolTip:point:userData:)] == YES) { // From testing on OS X, point is in the view's coordinate system NSPoint p = [view convertPoint: [theEvent locationInWindow] fromView: nil]; toolTipString = [[provider object] view: view stringForToolTip: [theEvent trackingNumber] point: p userData: [provider data]]; } else { toolTipString = [provider object]; } timer = [NSTimer scheduledTimerWithTimeInterval: 0.5 target: self selector: @selector(_timedOut:) userInfo: toolTipString repeats: YES]; [[NSRunLoop currentRunLoop] addTimer: timer forMode: NSModalPanelRunLoopMode]; timedObject = self; if ([[view window] acceptsMouseMovedEvents] == YES) { restoreMouseMoved = NO; } else { restoreMouseMoved = YES; [[view window] setAcceptsMouseMovedEvents: YES]; } [NSWindow _setToolTipVisible: self]; } - (void) mouseExited: (NSEvent *)theEvent { [self _endDisplay]; } - (void) mouseDown: (NSEvent *)theEvent { [self _endDisplay]; } - (void) mouseMoved: (NSEvent *)theEvent { NSPoint mouseLocation; NSPoint origin; if (window == nil) { return; } mouseLocation = [NSEvent mouseLocation]; origin = NSMakePoint(mouseLocation.x + offset.width, mouseLocation.y + offset.height); [window setFrameOrigin: origin]; } - (void) removeAllToolTips { NSEnumerator *enumerator; GSTrackingRect *rect; [self _endDisplay]; enumerator = [((NSViewPtr)view)->_tracking_rects objectEnumerator]; while ((rect = [enumerator nextObject]) != nil) { if (rect->owner == self) { RELEASE((GSTTProvider*)rect->user_data); rect->user_data = 0; [view removeTrackingRect: rect->tag]; } } toolTipTag = -1; } - (void)removeToolTipsInRect: (NSRect)aRect { NSUInteger idx = 0; NSMutableIndexSet *indexes = [NSMutableIndexSet new]; id tracking_rects = ((NSViewPtr)view)->_tracking_rects; FOR_IN(GSTrackingRect*, rect, tracking_rects) if ((rect->owner == self) && NSContainsRect(aRect, rect->rectangle)) { RELEASE((GSTTProvider*)rect->user_data); rect->user_data = 0; [indexes addIndex: idx]; [rect invalidate]; } idx++; END_FOR_IN(tracking_rects) [((NSViewPtr)view)->_tracking_rects removeObjectsAtIndexes: indexes]; if ([((NSViewPtr)view)->_tracking_rects count] == 0) { ((NSViewPtr)view)->_rFlags.has_trkrects = 0; } [indexes release]; } - (void) removeToolTip: (NSToolTipTag)tag { NSEnumerator *enumerator; GSTrackingRect *rect; enumerator = [((NSViewPtr)view)->_tracking_rects objectEnumerator]; while ((rect = [enumerator nextObject]) != nil) { if (rect->tag == tag && rect->owner == self) { RELEASE((GSTTProvider*)rect->user_data); rect->user_data = 0; [view removeTrackingRect: tag]; return; } } } - (void) setToolTip: (NSString *)string { if ([string length] == 0) { if (toolTipTag != -1) { [self _endDisplay]; [self removeToolTip: toolTipTag]; toolTipTag = -1; } } else { GSTTProvider *provider; if (toolTipTag == -1) { NSRect rect; rect = [view bounds]; provider = [[GSTTProvider alloc] initWithObject: string userData: nil]; toolTipTag = [view addTrackingRect: rect owner: self userData: provider assumeInside: NO]; } else { NSEnumerator *enumerator; GSTrackingRect *rect; enumerator = [((NSViewPtr)view)->_tracking_rects objectEnumerator]; while ((rect = [enumerator nextObject]) != nil) { if (rect->tag == toolTipTag && rect->owner == self) { [((GSTTProvider*)rect->user_data) setObject: string]; } } } } } - (NSString *) toolTip { NSEnumerator *enumerator; GSTrackingRect *rect; enumerator = [((NSViewPtr)view)->_tracking_rects objectEnumerator]; while ((rect = [enumerator nextObject]) != nil) { if (rect->tag == toolTipTag) { return [((GSTTProvider*)rect->user_data) object]; } } return nil; } @end @implementation GSToolTips (Private) - (void) _endDisplay { if (isOpening) return; if ([NSWindow _toolTipVisible] == self) { [NSWindow _setToolTipVisible: nil]; } /* If there is currently a timer running for this object, * cancel it. */ if (timer != nil && timedObject == self) { if ([timer isValid]) { [timer invalidate]; } timer = nil; timedObject = nil; } if (window != nil) { [window setFrame: NSZeroRect display: NO]; [window orderOut:self]; } if (restoreMouseMoved == YES) { restoreMouseMoved = NO; [[view window] setAcceptsMouseMovedEvents: NO]; } } /* The delay timed out -- display the tooltip */ - (void) _timedOut: (NSTimer *)aTimer { CGFloat size; NSString *toolTipString; NSAttributedString *toolTipText = nil; NSSize textSize; NSPoint mouseLocation = [NSEvent mouseLocation]; NSRect visible; NSRect rect; NSMutableDictionary *attributes; // retain and autorelease the timer's userinfo because we // may invalidate the timer (which releases the userinfo), // but need the userinfo object to remain valid for the // remainder of this method. toolTipString = [[[aTimer userInfo] retain] autorelease]; if ( (nil == toolTipString) || ([toolTipString isEqualToString: @""]) ) { return; } if (timer != nil) { if ([timer isValid]) { [timer invalidate]; } timer = nil; timedObject = nil; } if ([window isVisible]) { /* Moved from one tooltip view to another ... so stop displaying * the old tool tip before we start the new one. * This is similar to the case in -mouseEntered: where we cancel * the timer for one tooltip view because we have entered another * one. * To think about ... if we entered a tooltip rectangle without * having left the previous one, then when we leave this rectangle * we are probably back in the other one and should really restart * the timer for the original view. However, this is a rare case * so it's probably better to ignore it than add a lot of code to * keep track of all entry and exit. */ [self _endDisplay]; } size = [[NSUserDefaults standardUserDefaults] floatForKey: @"NSToolTipsFontSize"]; if (size <= 0) { size = 10.0; } attributes = [NSMutableDictionary dictionary]; [attributes setObject: [NSFont toolTipsFontOfSize: size] forKey: NSFontAttributeName]; toolTipText = [[NSAttributedString alloc] initWithString: toolTipString attributes: attributes]; textSize = [toolTipText size]; /* Create window just off the current mouse position * Constrain it to be on screen, shrinking if necessary. */ rect = NSMakeRect(mouseLocation.x + 8, mouseLocation.y - 16 - (textSize.height+3), textSize.width + 4, textSize.height + 4); visible = [[NSScreen mainScreen] visibleFrame]; if (NSMaxY(rect) > NSMaxY(visible)) { rect.origin.y -= (NSMaxY(rect) - NSMaxY(visible)); } if (NSMinY(rect) < NSMinY(visible)) { rect.origin.y += (NSMinY(visible) - NSMinY(rect)); } if (NSMaxY(rect) > NSMaxY(visible)) { rect.origin.y = visible.origin.y; rect.size.height = visible.size.height; } if (NSMaxX(rect) > NSMaxX(visible)) { rect.origin.x -= (NSMaxX(rect) - NSMaxX(visible)); } if (NSMinX(rect) < NSMinX(visible)) { rect.origin.x += (NSMinX(visible) - NSMinX(rect)); } if (NSMaxX(rect) > NSMaxX(visible)) { rect.origin.x = visible.origin.x; rect.size.width = visible.size.width; } offset.height = rect.origin.y - mouseLocation.y; offset.width = rect.origin.x - mouseLocation.x; isOpening = YES; [(GSTTView*)([window contentView]) setText: toolTipText]; [window setFrame: rect display: NO]; [window orderFront: nil]; isOpening = NO; RELEASE(toolTipText); } @end gnustep-gui-0.24.0/Source/GSGormLoader.m0000664000076500007650000001106711534147002017647 0ustar brains99brains99/** GSGormLoader Gorm model loader Copyright (C) 1997, 1999 Free Software Foundation, Inc. Author: Gregory John Casamento Date: 2005 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import #import #import #import #import #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSImage.h" #import "GNUstepGUI/GSModelLoaderFactory.h" #import "GNUstepGUI/GSGormLoading.h" @interface GSGormLoader : GSModelLoader @end @implementation GSGormLoader + (void) initialize { /* We load the app icon here, at launch time, since GSGormLoader is initialized before call -finishLaunching in NSApp (In non document-based apps that load a gorm file at launch). So the windows and panels at initial gorm file don't show the app icon. Maybe this is a duplicate code, but solve the problem (bug #31039). */ if (![NSApp isRunning]) { NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary]; NSString *appIconFile; NSImage *image = nil; appIconFile = [infoDict objectForKey: @"NSIcon"]; if (appIconFile && ![appIconFile isEqual: @""]) { image = [NSImage imageNamed: appIconFile]; } // Try to look up the icns file. appIconFile = [infoDict objectForKey: @"CFBundleIconFile"]; if (appIconFile && ![appIconFile isEqual: @""]) { image = [NSImage imageNamed: appIconFile]; } if (image == nil) { image = [NSImage imageNamed: @"GNUstep"]; } [NSApp setApplicationIconImage: image]; } } + (NSString *)type { return @"gorm"; } + (float) priority { return 1.0; } - (BOOL) loadModelData: (NSData *)data externalNameTable: (NSDictionary *)context withZone: (NSZone *)zone { BOOL loaded = NO; NSUnarchiver *unarchiver = nil; NS_DURING { if (data != nil) { unarchiver = [[NSUnarchiver alloc] initForReadingWithData: data]; if (unarchiver != nil) { id obj; NSDebugLog(@"Invoking unarchiver"); [unarchiver setObjectZone: zone]; obj = [unarchiver decodeObject]; if (obj != nil) { if ([obj isKindOfClass: [GSNibContainer class]]) { NSDebugLog(@"Calling awakeWithContext"); [obj awakeWithContext: context]; loaded = YES; } else { NSLog(@"Gorm does not have a container object!"); } } RELEASE(unarchiver); } } } NS_HANDLER { NSLog(@"Exception occured while loading model: %@",[localException reason]); TEST_RELEASE(unarchiver); } NS_ENDHANDLER if (loaded == NO) { NSLog(@"Failed to load Gorm\n"); } return loaded; } - (NSData *) dataForFile: (NSString *)fileName { NSFileManager *mgr = [NSFileManager defaultManager]; BOOL isDir = NO; NSDebugLog(@"Loading Gorm `%@'...\n", fileName); if ([mgr fileExistsAtPath: fileName isDirectory: &isDir]) { NSData *data = nil; // if the data is in a directory, then load from objects.gorm in the directory if (isDir == NO) { data = [NSData dataWithContentsOfFile: fileName]; NSDebugLog(@"Loaded data from file..."); } else { NSString *newFileName = [fileName stringByAppendingPathComponent: @"objects.gorm"]; data = [NSData dataWithContentsOfFile: newFileName]; NSDebugLog(@"Loaded data from %@...",newFileName); } return data; } else { NSLog(@"Gorm file specified %@, could not be found.", fileName); } return nil; } @end gnustep-gui-0.24.0/Source/NSTextContainer.m0000664000076500007650000003204512110256537020416 0ustar brains99brains99/** NSTextContainer Copyright (C) 1999 Free Software Foundation, Inc. Author: Alexander Malmberg Date: 2002-11-23 Author: Jonathan Gapen Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import "AppKit/NSLayoutManager.h" #import "AppKit/NSTextContainer.h" #import "AppKit/NSTextStorage.h" #import "AppKit/NSTextView.h" #import "GNUstepGUI/GSLayoutManager.h" #import "GSGuiPrivate.h" @interface NSTextContainer (TextViewObserver) - (void) _textViewFrameChanged: (NSNotification*)aNotification; @end /* TODO: rethink how this is is triggered. use bounds rectangle instead of frame? */ @implementation NSTextContainer (TextViewObserver) - (void) _textViewFrameChanged: (NSNotification*)aNotification { if (_observingFrameChanges) { id textView; NSSize newTextViewSize; NSSize size; NSSize inset; textView = [aNotification object]; if (textView != _textView) { NSDebugLog(@"NSTextContainer got notification for wrong View %@", textView); return; } newTextViewSize = [textView frame].size; size = _containerRect.size; inset = [textView textContainerInset]; if (_widthTracksTextView) { size.width = MAX(newTextViewSize.width - (inset.width * 2.0), 0.0); } if (_heightTracksTextView) { size.height = MAX(newTextViewSize.height - (inset.height * 2.0), 0.0); } [self setContainerSize: size]; } } @end /* NSTextContainer (TextViewObserver) */ @implementation NSTextContainer + (void) initialize { if (self == [NSTextContainer class]) { [self setVersion: 1]; } } - (id) initWithContainerSize: (NSSize)aSize { NSDebugLLog(@"NSText", @"NSTextContainer initWithContainerSize"); if (aSize.width < 0) { NSWarnMLog(@"given negative width", 0); aSize.width = 0; } if (aSize.height < 0) { NSWarnMLog(@"given negative height", 0); aSize.height = 0; } _layoutManager = nil; _textView = nil; _containerRect.size = aSize; // Tests on Cocoa indicate the default value is 5. _lineFragmentPadding = 5.0; _observingFrameChanges = NO; _widthTracksTextView = NO; _heightTracksTextView = NO; return self; } - (id) init { return [self initWithContainerSize: NSMakeSize(1e7, 1e7)]; } - (void) dealloc { if (_textView != nil) { NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; [nc removeObserver: self name: NSViewFrameDidChangeNotification object: _textView]; [_textView setTextContainer: nil]; RELEASE(_textView); } [super dealloc]; } /* See [NSTextView -setTextContainer:] for more information about these calls. */ - (void) setLayoutManager: (GSLayoutManager*)aLayoutManager { /* The layout manager owns us - so he retains us and we don't retain him. */ _layoutManager = aLayoutManager; /* Tell our text view about the change. */ [_textView setTextContainer: self]; } - (GSLayoutManager*) layoutManager { return _layoutManager; } /* Replaces the layout manager while maintaining the text object framework intact. */ - (void) replaceLayoutManager: (GSLayoutManager*)aLayoutManager { if (aLayoutManager != _layoutManager) { NSTextStorage *textStorage = [_layoutManager textStorage]; NSArray *textContainers = [_layoutManager textContainers]; NSUInteger i, count = [textContainers count]; GSLayoutManager *oldLayoutManager = _layoutManager; RETAIN(oldLayoutManager); RETAIN(textStorage); [textStorage removeLayoutManager: _layoutManager]; [textStorage addLayoutManager: aLayoutManager]; for (i = 0; i < count; i++) { NSTextContainer *container; container = RETAIN([textContainers objectAtIndex: i]); [oldLayoutManager removeTextContainerAtIndex: i]; /* One of these calls will result in our _layoutManager being changed. */ [aLayoutManager addTextContainer: container]; /* The textview is caching the layout manager; refresh the * cache with this do-nothing call. */ /* TODO: probably unnecessary; the call in -setLayoutManager: should be enough */ [[container textView] setTextContainer: container]; RELEASE(container); } RELEASE(textStorage); RELEASE(oldLayoutManager); } } - (void) setTextView: (NSTextView*)aTextView { NSNotificationCenter *nc; nc = [NSNotificationCenter defaultCenter]; if (_textView) { [_textView setTextContainer: nil]; [nc removeObserver: self name: NSViewFrameDidChangeNotification object: _textView]; /* NB: We do not set posts frame change notifications for the text view to NO because there could be other observers for the frame change notifications. */ } ASSIGN(_textView, aTextView); if (aTextView != nil) { [_textView setTextContainer: self]; if (_observingFrameChanges) { [_textView setPostsFrameChangedNotifications: YES]; [nc addObserver: self selector: @selector(_textViewFrameChanged:) name: NSViewFrameDidChangeNotification object: _textView]; [self _textViewFrameChanged: [NSNotification notificationWithName: NSViewFrameDidChangeNotification object: _textView]]; } } /* If someone's trying to set a NSTextView for us, the layout manager we have must be capable of handling NSTextView:s. */ [(NSLayoutManager *)_layoutManager textContainerChangedTextView: self]; } - (NSTextView*) textView { return _textView; } - (void) setContainerSize: (NSSize)aSize { if (NSEqualSizes(_containerRect.size, aSize)) { return; } if (aSize.width < 0) { NSWarnMLog(@"given negative width", 0); aSize.width = 0; } if (aSize.height < 0) { NSWarnMLog(@"given negative height", 0); aSize.height = 0; } _containerRect = NSMakeRect(0, 0, aSize.width, aSize.height); if (_layoutManager) { [_layoutManager textContainerChangedGeometry: self]; } } - (NSSize) containerSize { return _containerRect.size; } - (void) setWidthTracksTextView: (BOOL)flag { NSNotificationCenter *nc; BOOL old_observing = _observingFrameChanges; _widthTracksTextView = flag; _observingFrameChanges = _widthTracksTextView | _heightTracksTextView; if (_textView == nil) return; if (_observingFrameChanges == old_observing) return; nc = [NSNotificationCenter defaultCenter]; if (_observingFrameChanges) { [_textView setPostsFrameChangedNotifications: YES]; [nc addObserver: self selector: @selector(_textViewFrameChanged:) name: NSViewFrameDidChangeNotification object: _textView]; } else { [nc removeObserver: self name: NSViewFrameDidChangeNotification object: _textView]; } } - (BOOL) widthTracksTextView { return _widthTracksTextView; } - (void) setHeightTracksTextView: (BOOL)flag { NSNotificationCenter *nc; BOOL old_observing = _observingFrameChanges; _heightTracksTextView = flag; _observingFrameChanges = _widthTracksTextView | _heightTracksTextView; if (_textView == nil) return; if (_observingFrameChanges == old_observing) return; nc = [NSNotificationCenter defaultCenter]; if (_observingFrameChanges) { [_textView setPostsFrameChangedNotifications: YES]; [nc addObserver: self selector: @selector(_textViewFrameChanged:) name: NSViewFrameDidChangeNotification object: _textView]; } else { [nc removeObserver: self name: NSViewFrameDidChangeNotification object: _textView]; } } - (BOOL) heightTracksTextView { return _heightTracksTextView; } - (void) setLineFragmentPadding: (CGFloat)aFloat { _lineFragmentPadding = aFloat; if (_layoutManager) [_layoutManager textContainerChangedGeometry: self]; } - (CGFloat) lineFragmentPadding { return _lineFragmentPadding; } - (NSRect) lineFragmentRectForProposedRect: (NSRect)proposedRect sweepDirection: (NSLineSweepDirection)sweepDir movementDirection: (NSLineMovementDirection)moveDir remainingRect: (NSRect *)remainingRect { CGFloat minx, maxx, miny, maxy; CGFloat cminx, cmaxx, cminy, cmaxy; minx = NSMinX(proposedRect); maxx = NSMaxX(proposedRect); miny = NSMinY(proposedRect); maxy = NSMaxY(proposedRect); cminx = NSMinX(_containerRect) + _lineFragmentPadding; cmaxx = NSMaxX(_containerRect) - _lineFragmentPadding; cminy = NSMinY(_containerRect); cmaxy = NSMaxY(_containerRect); *remainingRect = NSZeroRect; if (minx >= cminx && maxx <= cmaxx && miny >= cminy && maxy <= cmaxy) { return proposedRect; } switch (moveDir) { case NSLineMovesLeft: if (maxx < cminx) return NSZeroRect; if (maxx > cmaxx) { minx -= maxx-cmaxx; maxx = cmaxx; } break; case NSLineMovesRight: if (minx > cmaxx) return NSZeroRect; if (minx < cminx) { maxx += cminx-minx; minx = cminx; } break; case NSLineMovesDown: if (miny > cmaxy) return NSZeroRect; if (miny < cminy) { maxy += cminy - miny; miny = cminy; } break; case NSLineMovesUp: if (maxy < cminy) return NSZeroRect; if (maxy > cmaxy) { miny -= maxy - cmaxy; maxy = cmaxy; } break; case NSLineDoesntMove: break; } switch (sweepDir) { case NSLineSweepLeft: case NSLineSweepRight: if (minx < cminx) minx = cminx; if (maxx > cmaxx) maxx = cmaxx; break; case NSLineSweepDown: case NSLineSweepUp: if (miny < cminy) miny = cminy; if (maxy > cmaxy) maxy = cmaxy; break; } if (minx < cminx || maxx > cmaxx || miny < cminy || maxy > cmaxy) { return NSZeroRect; } return NSMakeRect(minx, miny, (maxx > minx) ? maxx - minx : 0.0, (maxy > miny) ? maxy - miny : 0.0); } - (BOOL) isSimpleRectangularTextContainer { // sub-classes may say no; this class always says yes return YES; } - (BOOL) containsPoint: (NSPoint)aPoint { return NSPointInRect(aPoint, _containerRect); } - (id) initWithCoder: (NSCoder*)aDecoder { if ([aDecoder allowsKeyedCoding]) { NSSize size = NSMakeSize(1e7, 1e7); if ([aDecoder containsValueForKey: @"NSWidth"]) { size.width = [aDecoder decodeFloatForKey: @"NSWidth"]; } self = [self initWithContainerSize: size]; if ([aDecoder containsValueForKey: @"NSTCFlags"]) { int flags = [aDecoder decodeIntForKey: @"NSTCFlags"]; // decode the flags. _widthTracksTextView = (flags & 1) != 0; _heightTracksTextView = (flags & 2) != 0; // Mac OS X doesn't seem to save this flag _observingFrameChanges = _widthTracksTextView | _heightTracksTextView; } // decoding the manager adds this text container automatically... if ([aDecoder containsValueForKey: @"NSLayoutManager"]) { _layoutManager = [aDecoder decodeObjectForKey: @"NSLayoutManager"]; } return self; } else { return self; } } - (void) encodeWithCoder: (NSCoder *)coder { if ([coder allowsKeyedCoding]) { NSSize size = _containerRect.size; int flags = ((_widthTracksTextView)?1:0) | ((_heightTracksTextView)?2:0) | ((_observingFrameChanges)?4:0); [coder encodeObject: _textView forKey: @"NSTextView"]; [coder encodeObject: _layoutManager forKey: @"NSLayoutManager"]; [coder encodeFloat: size.width forKey: @"NSWidth"]; [coder encodeInt: flags forKey: @"NSTCFlags"]; } } @end /* NSTextContainer */ gnustep-gui-0.24.0/Source/NSKeyValueBinding.m0000664000076500007650000004026311727365361020661 0ustar brains99brains99/** NSKeyValueBinding informal protocol reference Implementation of KeyValueBinding for GNUStep Copyright (C) 2007 Free Software Foundation, Inc. Written by: Chris Farber Date: 2007 Author: Fred Kiefer Date: Decembre 2007 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import #import #import #import #import #import #import "AppKit/NSKeyValueBinding.h" #import "GSBindingHelpers.h" @implementation NSObject (NSKeyValueBindingCreation) + (void) exposeBinding: (NSString *)binding { [GSKeyValueBinding exposeBinding: binding forClass: [self class]]; } - (NSArray *) exposedBindings { NSMutableArray *exposedBindings = [NSMutableArray array]; NSArray *tmp; Class class = [self class]; while (class && class != [NSObject class]) { tmp = [GSKeyValueBinding exposedBindingsForClass: class]; if (tmp != nil) { [exposedBindings addObjectsFromArray: tmp]; } class = [class superclass]; } return exposedBindings; } - (Class) valueClassForBinding: (NSString *)binding { return [NSString class]; } - (void) bind: (NSString *)binding toObject: (id)anObject withKeyPath: (NSString *)keyPath options: (NSDictionary *)options { if ((anObject == nil) || (keyPath == nil)) { NSLog(@"No object or path for binding on %@ for %@", self, binding); return; } if ([[self exposedBindings] containsObject: binding]) { GSKeyValueBinding *kvb; [self unbind: binding]; kvb = [[GSKeyValueBinding alloc] initWithBinding: binding withName: binding toObject: anObject withKeyPath: keyPath options: options fromObject: self]; // The binding will be retained in the binding table RELEASE(kvb); } else { NSLog(@"No binding exposed on %@ for %@", self, binding); } } - (NSDictionary *) infoForBinding: (NSString *)binding { return [GSKeyValueBinding infoForBinding: binding forObject: self]; } - (void) unbind: (NSString *)binding { [GSKeyValueBinding unbind: binding forObject: self]; } @end static NSRecursiveLock *bindingLock = nil; static NSMapTable *classTable = NULL; //available bindings static NSMapTable *objectTable = NULL; //bound bindings typedef enum { GSBindingOperationAnd = 0, GSBindingOperationOr } GSBindingOperationKind; //TODO: document BOOL GSBindingResolveMultipleValueBool(NSString *key, NSDictionary *bindings, GSBindingOperationKind operationKind); //TODO: document void GSBindingInvokeAction(NSString *targetKey, NSString *argumentKey, NSDictionary *bindings); @implementation GSKeyValueBinding + (void) initialize { if (self == [GSKeyValueBinding class]) { bindingLock = [GSLazyRecursiveLock new]; classTable = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks, NSObjectMapValueCallBacks, 128); objectTable = NSCreateMapTable(NSNonRetainedObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 128); } } + (void) exposeBinding: (NSString *)binding forClass: (Class)clazz { NSMutableArray *bindings; [bindingLock lock]; bindings = (NSMutableArray *)NSMapGet(classTable, (void*)clazz); if (bindings == nil) { bindings = [[NSMutableArray alloc] initWithCapacity: 5]; NSMapInsert(classTable, (void*)clazz, (void*)bindings); RELEASE(bindings); } [bindings addObject: binding]; [bindingLock unlock]; } + (NSArray *) exposedBindingsForClass: (Class)clazz { NSArray *tmp; if (!classTable) return nil; [bindingLock lock]; tmp = NSMapGet(classTable, (void*)clazz); [bindingLock unlock]; return tmp; } + (GSKeyValueBinding *) getBinding: (NSString *)binding forObject: (id)anObject { NSMutableDictionary *bindings; GSKeyValueBinding *theBinding = nil; if (!objectTable) return nil; [bindingLock lock]; bindings = (NSMutableDictionary *)NSMapGet(objectTable, (void *)anObject); if (bindings != nil) { theBinding = (GSKeyValueBinding*)[bindings objectForKey: binding]; } [bindingLock unlock]; return theBinding; } + (NSDictionary *) infoForBinding: (NSString *)binding forObject: (id)anObject { GSKeyValueBinding *theBinding; theBinding = [self getBinding: binding forObject: anObject]; if (theBinding == nil) return nil; return theBinding->info; } + (void) unbind: (NSString *)binding forObject: (id)anObject { NSMutableDictionary *bindings; id observedObject; NSString *keyPath; GSKeyValueBinding *theBinding; if (!objectTable) return; [bindingLock lock]; bindings = (NSMutableDictionary *)NSMapGet(objectTable, (void *)anObject); if (bindings != nil) { theBinding = (GSKeyValueBinding*)[bindings objectForKey: binding]; if (theBinding != nil) { observedObject = [theBinding->info objectForKey: NSObservedObjectKey]; keyPath = [theBinding->info objectForKey: NSObservedKeyPathKey]; [observedObject removeObserver: theBinding forKeyPath: keyPath]; [bindings setValue: nil forKey: binding]; } } [bindingLock unlock]; } + (void) unbindAllForObject: (id)anObject { NSEnumerator *enumerator; NSString *binding; NSDictionary *list; if (!objectTable) return; [bindingLock lock]; list = (NSDictionary *)NSMapGet(objectTable, (void *)anObject); if (list != nil) { NSArray *keys = [list allKeys]; enumerator = [keys objectEnumerator]; while ((binding = [enumerator nextObject])) { [anObject unbind: binding]; } NSMapRemove(objectTable, (void *)anObject); } [bindingLock unlock]; } - (id) initWithBinding: (NSString *)binding withName: (NSString *)name toObject: (id)dest withKeyPath: (NSString *)keyPath options: (NSDictionary *)options fromObject: (id)source { NSMutableDictionary *bindings; src = source; if (options == nil) { info = [[NSDictionary alloc] initWithObjectsAndKeys: dest, NSObservedObjectKey, keyPath, NSObservedKeyPathKey, nil]; } else { info = [[NSDictionary alloc] initWithObjectsAndKeys: dest, NSObservedObjectKey, keyPath, NSObservedKeyPathKey, options, NSOptionsKey, nil]; } [dest addObserver: self forKeyPath: keyPath options: NSKeyValueObservingOptionNew context: binding]; [bindingLock lock]; bindings = (NSMutableDictionary *)NSMapGet(objectTable, (void *)source); if (bindings == nil) { bindings = [NSMutableDictionary new]; NSMapInsert(objectTable, (void*)source, (void*)bindings); RELEASE(bindings); } [bindings setObject: self forKey: name]; [bindingLock unlock]; [self setValueFor: binding]; return self; } - (void)dealloc { DESTROY(info); src = nil; [super dealloc]; } - (id) destinationValue { id newValue; id dest; NSString *keyPath; NSDictionary *options; dest = [info objectForKey: NSObservedObjectKey]; keyPath = [info objectForKey: NSObservedKeyPathKey]; options = [info objectForKey: NSOptionsKey]; newValue = [dest valueForKeyPath: keyPath]; return [self transformValue: newValue withOptions: options]; } - (id) sourceValueFor: (NSString *)binding { id newValue; NSDictionary *options; options = [info objectForKey: NSOptionsKey]; newValue = [src valueForKeyPath: binding]; return [self reverseTransformValue: newValue withOptions: options]; } - (void) setValueFor: (NSString *)binding { [src setValue: [self destinationValue] forKey: binding]; } - (void) reverseSetValue: (id)value { NSString *keyPath; id dest; keyPath = [info objectForKey: NSObservedKeyPathKey]; dest = [info objectForKey: NSObservedObjectKey]; [dest setValue: value forKeyPath: keyPath]; } - (void) reverseSetValueFor: (NSString *)binding { [self reverseSetValue: [self sourceValueFor: binding]]; } - (void) observeValueForKeyPath: (NSString *)keyPath ofObject: (id)object change: (NSDictionary *)change context: (void *)context { NSString *binding = (NSString *)context; NSDictionary *options; id newValue; if (change != nil) { options = [info objectForKey: NSOptionsKey]; newValue = [change objectForKey: NSKeyValueChangeNewKey]; newValue = [self transformValue: newValue withOptions: options]; [src setValue: newValue forKey: binding]; } } - (id) transformValue: (id)value withOptions: (NSDictionary *)options { NSString *valueTransformerName; NSValueTransformer *valueTransformer; NSString *placeholder; if (value == NSMultipleValuesMarker) { placeholder = [options objectForKey: NSMultipleValuesPlaceholderBindingOption]; if (placeholder == nil) { placeholder = @"Multiple Values"; } return placeholder; } if (value == NSNoSelectionMarker) { placeholder = [options objectForKey: NSNoSelectionPlaceholderBindingOption]; if (placeholder == nil) { placeholder = @"No Selection"; } return placeholder; } if (value == NSNotApplicableMarker) { if ([[options objectForKey: NSRaisesForNotApplicableKeysBindingOption] boolValue]) { [NSException raise: NSGenericException format: @"This binding does not accept not applicable keys"]; } placeholder = [options objectForKey: NSNotApplicablePlaceholderBindingOption]; if (placeholder == nil) { placeholder = @"Not Applicable"; } return placeholder; } if (value == nil) { placeholder = [options objectForKey: NSNullPlaceholderBindingOption]; return placeholder; } valueTransformerName = [options objectForKey: NSValueTransformerNameBindingOption]; if (valueTransformerName != nil) { valueTransformer = [NSValueTransformer valueTransformerForName: valueTransformerName]; } else { valueTransformer = [options objectForKey: NSValueTransformerBindingOption]; } if (valueTransformer != nil) { value = [valueTransformer transformedValue: value]; } return value; } - (id) reverseTransformValue: (id)value withOptions: (NSDictionary *)options { NSString *valueTransformerName; NSValueTransformer *valueTransformer; valueTransformerName = [options objectForKey: NSValueTransformerNameBindingOption]; if (valueTransformerName != nil) { valueTransformer = [NSValueTransformer valueTransformerForName: valueTransformerName]; } else { valueTransformer = [options objectForKey: NSValueTransformerBindingOption]; } if ((valueTransformer != nil) && [[valueTransformer class] allowsReverseTransformation]) { value = [valueTransformer reverseTransformedValue: value]; } return value; } @end @implementation GSKeyValueOrBinding : GSKeyValueBinding - (void) setValueFor: (NSString *)binding { NSDictionary *bindings; BOOL res; if (!objectTable) return; [bindingLock lock]; bindings = (NSDictionary *)NSMapGet(objectTable, (void *)src); if (!bindings) return; res = GSBindingResolveMultipleValueBool(binding, bindings, GSBindingOperationOr); [bindingLock unlock]; [src setValue: [NSNumber numberWithBool: res] forKey: binding]; } - (void) observeValueForKeyPath: (NSString *)keyPath ofObject: (id)object change: (NSDictionary *)change context: (void *)context { [self setValueFor: (NSString*)context]; } @end @implementation GSKeyValueAndBinding : GSKeyValueBinding - (void) setValueFor: (NSString *)binding { NSDictionary *bindings; BOOL res; if (!objectTable) return; [bindingLock lock]; bindings = (NSDictionary *)NSMapGet(objectTable, (void *)src); if (!bindings) return; res = GSBindingResolveMultipleValueBool(binding, bindings, GSBindingOperationAnd); [bindingLock unlock]; [src setValue: [NSNumber numberWithBool: res] forKey: binding]; } - (void) observeValueForKeyPath: (NSString *)keyPath ofObject: (id)object change: (NSDictionary *)change context: (void *)context { [self setValueFor: (NSString*)context]; } @end //Helper functions BOOL GSBindingResolveMultipleValueBool(NSString *key, NSDictionary *bindings, GSBindingOperationKind operationKind) { NSString *bindingName; NSDictionary *info; int count = 1; id object; NSString *keyPath; id value; NSDictionary *options; GSKeyValueBinding *theBinding; bindingName = key; while ((theBinding = [bindings objectForKey: bindingName])) { info = theBinding->info; object = [info objectForKey: NSObservedObjectKey]; keyPath = [info objectForKey: NSObservedKeyPathKey]; options = [info objectForKey: NSOptionsKey]; value = [object valueForKeyPath: keyPath]; value = [theBinding transformValue: value withOptions: options]; if ([value boolValue] == operationKind) { return operationKind; } bindingName = [NSString stringWithFormat: @"%@%i", key, ++count]; } return !operationKind; } void GSBindingInvokeAction(NSString *targetKey, NSString *argumentKey, NSDictionary *bindings) { NSString *bindingName; NSDictionary *info; NSDictionary *options; int count = 1; id object; id target; SEL selector; NSString *keyPath; NSInvocation *invocation; GSKeyValueBinding *theBinding; theBinding = [bindings objectForKey: targetKey]; info = theBinding->info; object = [info objectForKey: NSObservedObjectKey]; keyPath = [info objectForKey: NSObservedKeyPathKey]; options = [info objectForKey: NSOptionsKey]; target = [object valueForKeyPath: keyPath]; selector = NSSelectorFromString([options objectForKey: NSSelectorNameBindingOption]); if (target == nil || selector == NULL) return; invocation = [NSInvocation invocationWithMethodSignature: [target methodSignatureForSelector: selector]]; [invocation setSelector: selector]; bindingName = argumentKey; while ((theBinding = [bindings objectForKey: bindingName])) { info = theBinding->info; object = [info objectForKey: NSObservedObjectKey]; keyPath = [info objectForKey: NSObservedKeyPathKey]; if ((object = [object valueForKeyPath: keyPath])) { [invocation setArgument: object atIndex: ++count]; } bindingName = [NSString stringWithFormat: @"%@%i", argumentKey, count]; } [invocation invoke]; } gnustep-gui-0.24.0/Source/GNUmakefile.preamble0000664000076500007650000000535311116430505021044 0ustar brains99brains99# # GNUmakefile.preamble # # Copyright (C) 1997 Free Software Foundation, Inc. # # Author: Scott Christley # # This file is part of the GNUstep GUI Library. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # # GNUmakefile.preamble # # Project specific makefile variables, and additional # # Do not put any GNUmakefile rules in this file, instead they should # be put into GNUmakefile.postamble. # # # Flags dealing with compiling and linking # # Additional flags to pass to the preprocessor ADDITIONAL_CPPFLAGS = \ -DGNUSTEP_TARGET_DIR=\"$(GNUSTEP_TARGET_DIR)\" \ -DGNUSTEP_TARGET_CPU=\"$(GNUSTEP_TARGET_CPU)\" \ -DGNUSTEP_TARGET_OS=\"$(GNUSTEP_TARGET_OS)\" \ -DLIBRARY_COMBO=\"$(LIBRARY_COMBO)\" ifneq ($(BACKEND_BUNDLE),) ADDITIONAL_CPPFLAGS += -DBACKEND_BUNDLE=1 endif # Additional flags to pass to the Objective-C compiler ADDITIONAL_OBJCFLAGS = -Wall # Additional flags to pass to the C compiler # ADDITIONAL_CFLAGS = # Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS += -I../Headers/Additions -I../Headers \ -I./$(GNUSTEP_TARGET_DIR) # Additional LDFLAGS to pass to the linker # ADDITIONAL_LDFLAGS = # Additional library directories the linker should search # ADDITIONAL_LIB_DIRS = # # Sparc systems cannot load tiff files due to some problem compiling # this file with optimization. This includes Solaris [78] and sparc-*-linux-gnu # ifeq ($(findstring sparc, $(GNUSTEP_TARGET_CPU)), sparc) NSBitmapImageRep+JPEG.m_FILE_FILTER_OUT_FLAGS = -O% endif # # Flags dealing with installing and uninstalling # # Additional directories to be created during installation ADDITIONAL_INSTALL_DIRS = $(GNUSTEP_HEADERS)/AppKit $(GNUSTEP_HEADERS)/Cocoa # What are the libraries this library depends upon. This is needed for some # systems where building a shared library requires to pass to the linker # all the libraries the target library depends upon. LIBRARIES_DEPEND_UPON = -l$(FOUNDATION_LIBRARY_NAME) $(ADDITIONAL_DEPENDS) \ $(OBJC_LIBS) gnustep-gui-0.24.0/Source/NSTableColumn.m0000664000076500007650000004424712116350327020041 0ustar brains99brains99/** NSTableColumn Copyright (C) 1999 Free Software Foundation, Inc. Author: Nicola Pero Date: December 1999 Completely Rewritten. 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Overview of NSTableColumn
The Column Identifier

Each NSTableColumn object is identified by an object, called the column identifier. The reason is that, after a column has been added to a table view, the user might move the columns around, so there is a need to identify the columns regardless of their position in the table.

The identifier is typically a string describing the column. This identifier object is never displayed to the user ! It is only used internally by the program to identify the column - so yes, you may use a funny string for it and nobody will know, except people reading the code.

Information Stored in an NSTableColumn Object

An NSTableColumn object mainly keeps information about the width of the column, its minimum and maximum width; whether the column can be edited or resized; and the cells used to draw the column header and the data in the column. You can change all these attributes of the column by calling the appropriate methods. Please note that the table column does not hold nor has access to the data to be displayed in the column; this data is maintained in the table view's data source, as described in the NSTableView documentation. A last hint: to set the title of a table column, ask the table column for its header cell, and set the string value of this header cell to the desired title.

*/ #import #import #import #import #import #import "AppKit/NSKeyValueBinding.h" #import "AppKit/NSTableHeaderCell.h" #import "AppKit/NSTableColumn.h" #import "AppKit/NSTableView.h" #import "GSBindingHelpers.h" /**

NSTableColumn objects represent columns in NSTableViews.

*/ @implementation NSTableColumn /* * * Class methods * */ + (void) initialize { if (self == [NSTableColumn class]) { [self setVersion: 3]; [self exposeBinding: NSValueBinding]; [self exposeBinding: NSEnabledBinding]; } } /* * * Instance methods * */ /** Initialize the column. anObject is an object used to identify the column; it is usually a string, but might be any kind of object. anObject is retained. */ - (id) initWithIdentifier: (id)anObject { self = [super init]; if (!self) return nil; _width = 100; _min_width = 10; _max_width = 100000; _resizing_mask = NSTableColumnAutoresizingMask | NSTableColumnUserResizingMask; _is_resizable = YES; _is_editable = YES; _is_hidden = NO; _tableView = nil; _headerCell = [[NSTableHeaderCell alloc] init]; _dataCell = [[NSTextFieldCell alloc] init]; [_dataCell setLineBreakMode: NSLineBreakByTruncatingTail]; [_dataCell setEditable: YES]; _headerToolTip = nil; _sortDescriptorPrototype = nil; ASSIGN (_identifier, anObject); return self; } - (void) dealloc { // Remove all key value bindings for this view. [GSKeyValueBinding unbindAllForObject: self]; RELEASE(_headerCell); RELEASE(_headerToolTip); RELEASE(_dataCell); RELEASE(_sortDescriptorPrototype); TEST_RELEASE(_identifier); [super dealloc]; } /* * Managing the Identifier */ /** Set the identifier used to identify the table. The old identifier is released, and the new one is retained. */ - (void) setIdentifier: (id)anObject { ASSIGN (_identifier, anObject); } /** Return the column identifier, an object used to identify the column. This object is usually a string, but might be any kind of object. */ - (id) identifier { return _identifier; } /* * Setting the NSTableView */ /** Set the table view corresponding to this table column. This method is invoked internally by the table view, and you should not call it directly; it is exposed because you may want to override it in subclasses. To use the table column in a table view, you should use NSTableView's addTableColumn: instead. */ - (void) setTableView: (NSTableView*)aTableView { // We do *not* RETAIN aTableView. // On the contrary, aTableView is supposed to RETAIN us. _tableView = aTableView; } /** Return the table view the column belongs to, or nil if the table column was not added to any table view. */ - (NSTableView *) tableView { return _tableView; } /* * Controlling size */ /** Set the width of the table column. Before being resized, the new width is constrained to the table column minimum and maximum width: if newWidth is smaller than the table column's min width, the table column is simply resized to its min width. If newWidth is bigger than the table column's max width, the table column is simply resized to its max width. Otherwise, it is resized to newWidth. If the width of the table was actually changed, the table view (if any) is redisplayed (by calling tile), and the NSTableViewColumnDidResizeNotification is posted on behalf of the table view. */ - (void) setWidth: (CGFloat)newWidth { CGFloat oldWidth = _width; if (newWidth > _max_width) newWidth = _max_width; else if (newWidth < _min_width) newWidth = _min_width; if (_width == newWidth) return; _width = newWidth; if (_tableView) { // Tiling also marks it as needing redisplay [_tableView tile]; [[NSNotificationCenter defaultCenter] postNotificationName: NSTableViewColumnDidResizeNotification object: _tableView userInfo: [NSDictionary dictionaryWithObjectsAndKeys: self, @"NSTableColumn", [NSNumber numberWithFloat: oldWidth], @"NSOldWidth", nil]]; } } /** Return the width of the table column. The default width is 100. */ - (CGFloat) width { return _width; } /** Set the min width of the table column, eventually adjusting the width of the column if it is smaller than the new min width. In no way a table column can be made smaller than its min width. */ - (void) setMinWidth: (CGFloat)minWidth { _min_width = minWidth; if (_width < _min_width) [self setWidth: _min_width]; } /** Return the column's min width. The column can in no way be resized to a width smaller than this min width. The default min width is 10. */ - (CGFloat) minWidth { return _min_width; } /** Set the max width of the table column, eventually adjusting the width of the column if it is bigger than the new max width. In no way a table column can be made bigger than its max width. */ - (void) setMaxWidth: (CGFloat)maxWidth { _max_width = maxWidth; if (_width > _max_width) [self setWidth: _max_width]; } /** Return the column's max width. The column can in no way be resized to a width bigger than this max width. The default max width is 100000. */ - (CGFloat) maxWidth { return _max_width; } /** Set whether the user can resize the table column by dragging the border of its header with the mouse. The table column can be resized programmatically regardless of this setting. */ - (void) setResizable: (BOOL)flag { _is_resizable = flag; // TODO: To match Cocoa behavior, should be replaced by //if (flag) // { // [self setResizingMask: NSTableColumnAutoresizingMask | NSTableColumnUserResizingMask)]; // } //else // { // [self setResizingMask: NSTableColumnNoResizing]; // } } /** Return whether the column might be resized by the user by dragging the column header border. */ - (BOOL) isResizable { return _is_resizable; // TODO: To match Cocoa behavior, should be replaced by //return (BOOL)[self autoresizingMask]; } /** Return the resizing mask that describes whether the column is resizable and how it resizes. */ - (void) setResizingMask: (NSUInteger)resizingMask { _resizing_mask = resizingMask; } /** Set the resizing mask that describes whether the column is resizable and how it resizes. */ - (NSUInteger) resizingMask { return _resizing_mask; } /** Change the width of the column to be just enough to display its header; change the minimum width and maximum width to allow the column to have this width (if the minimum width is bigger than the column header width, it is reduced to it; if the maximum width is smaller than the column header width, it is increased to it). */ - (void) sizeToFit { CGFloat new_width; new_width = [_headerCell cellSize].width; if (new_width > _max_width) _max_width = new_width; if (new_width < _min_width) _min_width = new_width; // For easier subclassing we dont do it directly [self setWidth: new_width]; } /** Set whether the column is invisible or not. */ - (void) setHidden: (BOOL)hidden { _is_hidden = hidden; } /** Return whether the column is invisible or not. When the column is hidden, it remains present in the column array returned by -[NSTableView tableColumns]. */ - (BOOL) isHidden { return _is_hidden; } /* * Controlling editability */ /** Set whether data in the column might be edited by the user by double-cliking on them. */ - (void) setEditable: (BOOL)flag { _is_editable = flag; } /** Return whether data displayed in the column can be edited by the user by double-cliking on them. */ - (BOOL) isEditable { return _is_editable; } /* * Setting component cells */ /** Set the cell used to display the column header. aCell can't be nil, otherwise a warning will be generated and the method call ignored. The old cell is released, the new one is retained. */ - (void) setHeaderCell: (NSCell*)aCell { if (aCell == nil) { NSLog (@"Attempt to set a nil headerCell for NSTableColumn"); return; } ASSIGN (_headerCell, aCell); } /** Return the cell used to display the column title. The default header cell is an NSTableHeaderCell. */ - (NSCell*) headerCell { return _headerCell; } /** Set the tool tip text displayed when the pointer is in the header area. */ - (void) setHeaderToolTip: (NSString *)aString { ASSIGN(_headerToolTip, aString); } /** Return the toop tip text displayed when the pointer is in the header area. */ - (NSString *) headerToolTip { return _headerToolTip; } /** Set the cell used to display data in the column. aCell can't be nil, otherwise a warning will be generated and the method ignored. The old cell is released, the new one is retained. If you want to change the attributes in which a single row in a column is displayed, you should better use a delegate for your NSTableView implementing tableView:willDisplayCell:forTableColumn:row:. */ - (void) setDataCell: (NSCell*)aCell { if (aCell == nil) { NSLog (@"Attempt to set a nil dataCell for NSTableColumn"); return; } ASSIGN (_dataCell, aCell); } /** Return the cell used to display data in the column. The default data cell is an NSTextFieldCell. */ - (NSCell*) dataCell { return _dataCell; } - (NSCell*) dataCellForRow: (NSInteger)row { return [self dataCell]; } /* * Sorting */ /** Return the sort descriptor bound to the column. */ - (NSSortDescriptor *) sortDescriptorPrototype { return _sortDescriptorPrototype; } /** Return the sort descriptor bound to the column. This sort descriptor will be added to -[NSTableView sortDescriptors] when you bind a column to another object and NSCreateSortDescriptorBindingOption is set to YES. */ - (void) setSortDescriptorPrototype: (NSSortDescriptor *)aSortDescriptor { ASSIGN(_sortDescriptorPrototype, aSortDescriptor); } /* * Encoding/Decoding */ - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { [aCoder encodeObject: _identifier forKey: @"NSIdentifier"]; [aCoder encodeObject: _dataCell forKey: @"NSDataCell"]; [aCoder encodeObject: _headerCell forKey: @"NSHeaderCell"]; [aCoder encodeBool: _is_resizable forKey: @"NSIsResizable"]; [aCoder encodeBool: _is_editable forKey: @"NSIsEditable"]; [aCoder encodeFloat: _max_width forKey: @"NSMaxWidth"]; [aCoder encodeFloat: _min_width forKey: @"NSMinWidth"]; [aCoder encodeFloat: _width forKey: @"NSWidth"]; [aCoder encodeObject: _sortDescriptorPrototype forKey: @"NSSortDescriptorPrototype"]; [aCoder encodeInt: _resizing_mask forKey: @"NSResizingMask"]; [aCoder encodeObject: _headerToolTip forKey: @"NSHeaderToolTip"]; [aCoder encodeBool: _is_hidden forKey: @"NSHidden"]; [aCoder encodeObject: _tableView forKey: @"NSTableView"]; } else { [aCoder encodeObject: _identifier]; [aCoder encodeValueOfObjCType: @encode(float) at: &_width]; [aCoder encodeValueOfObjCType: @encode(float) at: &_min_width]; [aCoder encodeValueOfObjCType: @encode(float) at: &_max_width]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_is_resizable]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_is_editable]; [aCoder encodeObject: _headerCell]; [aCoder encodeObject: _dataCell]; [aCoder encodeObject: _sortDescriptorPrototype]; } } - (id) initWithCoder: (NSCoder*)aDecoder { if ([aDecoder allowsKeyedCoding]) { id identifier = [aDecoder decodeObjectForKey: @"NSIdentifier"]; self = [self initWithIdentifier: identifier]; if (!self) return nil; if ([aDecoder containsValueForKey: @"NSDataCell"]) { [self setDataCell: [aDecoder decodeObjectForKey: @"NSDataCell"]]; } if ([aDecoder containsValueForKey: @"NSHeaderCell"]) { [self setHeaderCell: [aDecoder decodeObjectForKey: @"NSHeaderCell"]]; } if ([aDecoder containsValueForKey: @"NSIsResizeable"]) { [self setResizable: [aDecoder decodeBoolForKey: @"NSIsResizeable"]]; } if ([aDecoder containsValueForKey: @"NSIsEditable"]) { [self setEditable: [aDecoder decodeBoolForKey: @"NSIsEditable"]]; } else { [self setEditable: NO]; } if ([aDecoder containsValueForKey: @"NSWidth"]) { [self setWidth: [aDecoder decodeFloatForKey: @"NSWidth"]]; } if ([aDecoder containsValueForKey: @"NSMinWidth"]) { [self setMinWidth: [aDecoder decodeFloatForKey: @"NSMinWidth"]]; } if ([aDecoder containsValueForKey: @"NSMaxWidth"]) { [self setMaxWidth: [aDecoder decodeFloatForKey: @"NSMaxWidth"]]; } if ([aDecoder containsValueForKey: @"NSSortDescriptorPrototype"]) { [self setSortDescriptorPrototype: [aDecoder decodeObjectForKey: @"NSSortDescriptorPrototype"]]; } if ([aDecoder containsValueForKey: @"NSResizingMask"]) { [self setResizingMask: [aDecoder decodeIntForKey: @"NSResizingMask"]]; } if ([aDecoder containsValueForKey: @"NSHeaderToolTip"]) { [self setHeaderToolTip: [aDecoder decodeObjectForKey: @"NSHeaderToolTip"]]; } if ([aDecoder containsValueForKey: @"NSHidden"]) { [self setHidden: [aDecoder decodeBoolForKey: @"NSHidden"]]; } if ([aDecoder containsValueForKey: @"NSTableView"]) { [self setTableView: [aDecoder decodeObjectForKey: @"NSTableView"]]; } } else { int version = [aDecoder versionForClassName: @"NSTableColumn"]; self = [super init]; if (!self) return nil; if (version >= 2) { _identifier = RETAIN([aDecoder decodeObject]); [aDecoder decodeValueOfObjCType: @encode(float) at: &_width]; [aDecoder decodeValueOfObjCType: @encode(float) at: &_min_width]; [aDecoder decodeValueOfObjCType: @encode(float) at: &_max_width]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_is_resizable]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_is_editable]; _headerCell = RETAIN([aDecoder decodeObject]); _dataCell = RETAIN([aDecoder decodeObject]); if (version >= 3) { _sortDescriptorPrototype = RETAIN([aDecoder decodeObject]); } } else { _identifier = RETAIN([aDecoder decodeObject]); _headerCell = RETAIN([aDecoder decodeObject]); _dataCell = RETAIN([aDecoder decodeObject]); [aDecoder decodeValueOfObjCType: @encode(float) at: &_width]; [aDecoder decodeValueOfObjCType: @encode(float) at: &_min_width]; [aDecoder decodeValueOfObjCType: @encode(float) at: &_max_width]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_is_resizable]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_is_editable]; } } return self; } - (void) setValue: (id)anObject forKey: (NSString*)aKey { if ([aKey isEqual: NSValueBinding]) { // FIXME // Reload data } else if ([aKey isEqual: NSEnabledBinding]) { // FIXME } else { [super setValue: anObject forKey: aKey]; } } - (id) valueForKey: (NSString*)aKey { if ([aKey isEqual: NSValueBinding]) { return nil; } else if ([aKey isEqual: NSEnabledBinding]) { // FIXME return [NSNumber numberWithBool: YES]; } else { return [super valueForKey: aKey]; } } @end gnustep-gui-0.24.0/Source/GSIconManager.h0000664000076500007650000000215711313730034017770 0ustar brains99brains99/* Copyright (C) 2009 Free Software Foundation, Inc. Written by: German Arias Created: December 2009 This file is part of the GNUstep Project This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this library; see the file COPYING. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import "AppKit/NSWindow.h" NSSize GSGetIconSize(void); void GSRemoveIcon(NSWindow *window); NSRect GSGetIconFrame(NSWindow *window); gnustep-gui-0.24.0/Source/NSBitmapImageRep+GIF.h0000664000076500007650000000303311376454556021062 0ustar brains99brains99/* NSBitmapImageRep+GIF.h Functionality for reading GIF images Copyright (C) 2003 Free Software Foundation, Inc. Written by: Stefan Kleine Stegemann Date: Nov 2003 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _NSBitmapImageRep_GIF_H_include #define _NSBitmapImageRep_GIF_H_include #import "AppKit/NSBitmapImageRep.h" @interface NSBitmapImageRep (GIFReading) + (BOOL) _bitmapIsGIF: (NSData *)imageData; - (id) _initBitmapFromGIF: (NSData *)imageData errorMessage: (NSString **)errorMsg; - (NSData *) _GIFRepresentationWithProperties: (NSDictionary *) properties errorMessage: (NSString **)errorMsg; @end #endif // _NSBitmapImageRep_GIF_H_include gnustep-gui-0.24.0/Source/GSSlideView.m0000664000076500007650000001147112107123435017507 0ustar brains99brains99/** GSSlideView Copyright (C) 2002, 2003 Free Software Foundation, Inc. Created by: Enrico Sersale Date: Jan 2002 Author: Fred Kiefer Date: Jan 2003 Removed all dependencies on X and moved to gui. This file is part of the GNU Objective C User Interface Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import "AppKit/NSApplication.h" #import "AppKit/NSCell.h" #import "AppKit/NSEvent.h" #import "AppKit/NSImage.h" #import "AppKit/NSView.h" #import "AppKit/NSWindow.h" #import "GNUstepGUI/GSDisplayServer.h" #import "GSSlideView.h" #include // Minimal slide distance per step in pixel #define MINDIST 18 // Time for each slide step in seconds #define SLIDE_TIME_STEP 0.02 @interface GSSlideView (Private) - (void) _setupImage: (NSImage*) image startPoint: (NSPoint)slideStart; - (void) _slideFrom: (NSPoint)fromPoint to: (NSPoint)toPoint; @end @implementation GSSlideView (Private) - (void) _setupImage: (NSImage*) image startPoint: (NSPoint)slideStart { NSSize imageSize = [image size]; [slideCell setImage: image]; [_window setFrame: NSMakeRect(slideStart.x, slideStart.y, imageSize.width, imageSize.height) display: NO]; // Only display the image [GSServerForWindow(_window) restrictWindow: [_window windowNumber] toImage: image]; [_window orderFrontRegardless]; } - (void) _slideFrom: (NSPoint)fromPoint to: (NSPoint)toPoint { float distx = toPoint.x - fromPoint.x; float disty = toPoint.y - fromPoint.y; float dist = sqrt((distx * distx) + (disty * disty)); // int steps = (int)(dist / MINDIST); NSSize imgSize = [[slideCell image] size]; float imgDist = sqrt((imgSize.width * imgSize.width) + (imgSize.height * imgSize.height)); int steps = (int)(dist/imgDist); int windowNumber = [_window windowNumber]; GSDisplayServer *server = GSServerForWindow(_window); if (steps > 2) { float unitx = distx / steps; float unity = disty / steps; [NSEvent startPeriodicEventsAfterDelay: SLIDE_TIME_STEP withPeriod: SLIDE_TIME_STEP]; while (steps--) { NSEvent *theEvent = [NSApp nextEventMatchingMask: NSPeriodicMask untilDate: [NSDate distantFuture] inMode: NSEventTrackingRunLoopMode dequeue: YES]; if ([theEvent type] == NSPeriodic) { fromPoint.x += unitx; fromPoint.y += unity; [server movewindow: fromPoint : windowNumber]; } else { NSDebugLLog (@"NSDragging", @"Unexpected event type: %d during slide", (int)[theEvent type]); } } [NSEvent stopPeriodicEvents]; } // Go exactly to the point [server movewindow: toPoint : windowNumber]; } @end @implementation GSSlideView + (BOOL) _slideImage: (NSImage *)image from: (NSPoint)fromPoint to: (NSPoint)toPoint { static GSSlideView *v = nil; BOOL result = NO; if (image != nil) { if (v == nil) { v = [[self alloc] init]; } [NSApp preventWindowOrdering]; [v _setupImage: image startPoint: fromPoint]; [v _slideFrom: fromPoint to: toPoint]; [[v window] orderOut: nil]; result = YES; } return result; } - (id) init { self = [super init]; if (self != nil) { // This is never used, as the window gets resized before displaying NSRect winRect = {{0, 0}, {48, 48}}; NSWindow *slideWindow; slideCell = [[NSCell alloc] initImageCell: nil]; [slideCell setBordered: NO]; slideWindow = [[NSWindow alloc] initWithContentRect: winRect styleMask: NSBorderlessWindowMask backing: NSBackingStoreNonretained defer: NO]; [slideWindow setReleasedWhenClosed: YES]; [slideWindow setExcludedFromWindowsMenu: YES]; [slideWindow setContentView: self]; RELEASE (self); } return self; } - (void) dealloc { RELEASE (slideCell); [super dealloc]; } - (void) drawRect: (NSRect)rect { [slideCell drawWithFrame: [self frame] inView: self]; } @end gnustep-gui-0.24.0/Source/NSTextStorage.m0000664000076500007650000002255112036333132020073 0ustar brains99brains99/** NSTextStorage Copyright (C) 1999 Free Software Foundation, Inc. Author: Richard Frith-Macdonald Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import "AppKit/NSAttributedString.h" #import "AppKit/NSTextStorage.h" #import "GNUstepGUI/GSLayoutManager.h" #import "GSTextStorage.h" @implementation NSTextStorage static Class abstract; static Class concrete; static NSNotificationCenter *nc = nil; + (void) initialize { if (self == [NSTextStorage class]) { abstract = self; concrete = [GSTextStorage class]; nc = [NSNotificationCenter defaultCenter]; } } + (id) allocWithZone: (NSZone*)zone { if (self == abstract) return NSAllocateObject(concrete, 0, zone); else return NSAllocateObject(self, 0, zone); } - (void) dealloc { [self setDelegate: nil]; [_layoutManagers makeObjectsPerformSelector: @selector(setTextStorage:) withObject: nil]; RELEASE (_layoutManagers); [super dealloc]; } /* * The designated intialiser */ - (id) initWithString: (NSString*)aString attributes: (NSDictionary*)attributes { _layoutManagers = [[NSMutableArray alloc] initWithCapacity: 2]; return self; } /* * Return a string */ - (NSString*) string { [self subclassResponsibility: _cmd]; return nil; } /* * Managing GSLayoutManagers */ - (void) addLayoutManager: (GSLayoutManager*)obj { if ([_layoutManagers indexOfObjectIdenticalTo: obj] == NSNotFound) { [_layoutManagers addObject: obj]; [obj setTextStorage: self]; } } - (void) removeLayoutManager: (GSLayoutManager*)obj { /* If the receiver belongs to a text network that is owned by its text view it could get deallocated by the call to -setTextStorage:. To prevent crashes we retain the receiver until the end of this method. */ RETAIN(self); [obj setTextStorage: nil]; [_layoutManagers removeObjectIdenticalTo: obj]; RELEASE(self); } - (NSArray*) layoutManagers { return _layoutManagers; } - (void) beginEditing { _editCount++; } - (void) endEditing { if (_editCount == 0) { [NSException raise: NSGenericException format: @"endEditing without corresponding beginEditing"]; } if (--_editCount == 0) { [self processEditing]; } } /* * If there are no outstanding beginEditing calls, this method calls * processEditing to cause post-editing stuff to happen. This method * has to be called by the primitives after changes are made. * The range argument to edited:... is the range in the original string * (before the edit). */ - (void) edited: (unsigned)mask range: (NSRange)old changeInLength: (int)delta { NSDebugLLog(@"NSText", @"edited:range:changeInLength: called"); /* * Add in any new flags for this edit. */ _editedMask |= mask; /* * Extend edited range to encompass the latest edit. */ if (_editedRange.length == 0) { _editedRange = old; // First edit. } else { _editedRange = NSUnionRange (_editedRange, old); } /* * If the number of characters has been increased or decreased - * adjust the delta accordingly. */ if ((mask & NSTextStorageEditedCharacters) && delta) { if (delta < 0) { NSAssert (old.length >= (unsigned)-delta, NSInvalidArgumentException); } _editedRange.length += delta; _editedDelta += delta; } if (_editCount == 0) [self processEditing]; } /* * This is called from edited:range:changeInLength: or endEditing. * This method sends out NSTextStorageWillProcessEditing, then fixes * the attributes, then sends out NSTextStorageDidProcessEditing, * and finally notifies the layout managers of change with the * textStorage:edited:range:changeInLength:invalidatedRange: method. */ - (void) processEditing { NSRange r; int original_delta; unsigned int i; unsigned length; NSDebugLLog(@"NSText", @"processEditing called in NSTextStorage."); /* * The _editCount gets decreased later again, so that changes by the * delegate or by ourselves when we fix attributes dont trigger a * new processEditing */ _editCount++; [nc postNotificationName: NSTextStorageWillProcessEditingNotification object: self]; /* Very important: we save the current _editedRange */ r = _editedRange; original_delta = _editedDelta; length = [self length]; // Multiple adds at the end might give a too long result if (NSMaxRange(r) > length) { r.length = length - r.location; } /* The following call will potentially fix attributes. These changes are done through NSTextStorage methods, which records the changes by calling edited:range:changeInLength: - which modifies editedRange. As a consequence, if any attribute has been fixed, r != editedRange after this call. This is why we saved r in the first place. */ [self invalidateAttributesInRange: r]; [nc postNotificationName: NSTextStorageDidProcessEditingNotification object: self]; _editCount--; /* The attribute fixes might have added or removed characters. We must make sure that range and delta we give to the layout managers is valid. */ if (original_delta != _editedDelta) { if (_editedDelta - original_delta > 0) { r.length += _editedDelta - original_delta; } else { if ((unsigned)(original_delta - _editedDelta) > r.length) { r.length = 0; if (r.location > [self length]) r.location = [self length]; } else { r.length += _editedDelta - original_delta; } } } /* * Calls textStorage:edited:range:changeInLength:invalidatedRange: for * every layoutManager. */ for (i = 0; i < [_layoutManagers count]; i++) { GSLayoutManager *lManager = [_layoutManagers objectAtIndex: i]; [lManager textStorage: self edited: _editedMask range: r changeInLength: _editedDelta invalidatedRange: _editedRange]; } /* * edited values reset to be used again in the next pass. */ _editedRange = NSMakeRange (0, 0); _editedDelta = 0; _editedMask = 0; } /* * These methods return information about the editing status. * Especially useful when there are outstanding beginEditing calls or * during processEditing... editedRange.location will be NSNotFound if * nothing has been edited. */ - (unsigned) editedMask { return _editedMask; } - (NSRange) editedRange { return _editedRange; } - (int) changeInLength { return _editedDelta; } /** * Set the delegate (adds it as an observer for text storage notifications) * and removes any old value (removes it as an observer).
* The delegate is not retained. */ - (void) setDelegate: (id)delegate { if (_delegate != nil) { [nc removeObserver: _delegate name: nil object: self]; } _delegate = delegate; #define SET_DELEGATE_NOTIFICATION(notif_name) \ if ([_delegate respondsToSelector: @selector(textStorage##notif_name:)]) \ [nc addObserver: _delegate \ selector: @selector(textStorage##notif_name:) \ name: NSTextStorage##notif_name##Notification object: self] SET_DELEGATE_NOTIFICATION(DidProcessEditing); SET_DELEGATE_NOTIFICATION(WillProcessEditing); } /** * Returns the value most recently set usiong the -setDelegate: method. */ - (id) delegate { return _delegate; } - (void) ensureAttributesAreFixedInRange: (NSRange)range { // Do nothing as the default is not lazy fixing, so all is done already } - (BOOL) fixesAttributesLazily { return NO; } - (void) invalidateAttributesInRange: (NSRange)range { [self fixAttributesInRange: range]; } - (Class) classForCoder { return abstract; } - (id) replacementObjectForPortCoder: (NSPortCoder*)aCoder { return self; } - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if ([aDecoder allowsKeyedCoding]) { id delegate = [aDecoder decodeObjectForKey: @"NSDelegate"]; [self setDelegate: delegate]; } else { } return self; } - (void) encodeWithCoder: (NSCoder *)coder { [super encodeWithCoder: coder]; if ([coder allowsKeyedCoding]) { [coder encodeObject: [self delegate] forKey: @"NSDelegate"]; } else { } } @end @implementation NSTextStorage (Scripting) - (NSFont*) font { return [self attribute: NSFontAttributeName atIndex: 0 effectiveRange: NULL]; } - (void) setFont: (NSFont*)font { if (font != nil) { [self addAttribute: NSFontAttributeName value: font range: NSMakeRange(0, [self length])]; } } @end gnustep-gui-0.24.0/Source/NSPrintInfo.m0000664000076500007650000002677311672314326017555 0ustar brains99brains99/* NSPrintInfo.m Stores information used in printing Copyright (C) 1996,1997,2004 Free Software Foundation, Inc. Author: Simon Frankau Date: July 1997 Modified for Printing Backend Support Author: Chad Hardin Date: June 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import "AppKit/NSPrinter.h" #import "AppKit/NSPrintInfo.h" #import "GNUstepGUI/GSPrinting.h" #import "GSGuiPrivate.h" // Class variables: static NSPrintInfo *sharedPrintInfo = nil; /** Class Description

NSPrintInfo is a storage object that stores information that describes how a view is to printed and the destination information for printing.

*/ @implementation NSPrintInfo // // Class methods // + (void) initialize { if (self == [NSPrintInfo class]) { // Initial version [self setVersion: 1]; } } /** Load the appropriate bundle for the PrintInfo (eg: GSLPRPrintInfo, GSCUPSPrintInfo). */ + (id) allocWithZone: (NSZone*)zone { Class principalClass; principalClass = [[GSPrinting printingBundle] principalClass]; if (principalClass == nil) return nil; return [[principalClass printInfoClass] allocWithZone: zone]; } // // Managing the Shared NSPrintInfo Object // + (void) setSharedPrintInfo: (NSPrintInfo*)printInfo { ASSIGN(sharedPrintInfo, printInfo); } + (NSPrintInfo*) sharedPrintInfo { if (!sharedPrintInfo) { sharedPrintInfo = [[NSPrintInfo alloc] initWithDictionary: nil]; } return sharedPrintInfo; } // // Managing the Printing Rectangle // + (NSSize) sizeForPaperName: (NSString*)name { return [[self defaultPrinter] pageSizeForPaper: name]; } // // Specifying the Printer // + (NSPrinter*) defaultPrinter { Class principalClass; principalClass = [[GSPrinting printingBundle] principalClass]; if (principalClass == nil) return nil; return [[principalClass printInfoClass] defaultPrinter]; } + (void) setDefaultPrinter: (NSPrinter*)printer { Class principalClass; principalClass = [[GSPrinting printingBundle] principalClass]; if (principalClass == nil) return; [[principalClass printInfoClass] setDefaultPrinter: printer]; } // // Instance methods // // // Creating and Initializing an NSPrintInfo Instance // - (id) initWithDictionary: (NSDictionary*)aDict { NSPrinter *printer; NSString *pageSize; if (!(self = [super init])) { return self; } _info = [[NSMutableDictionary alloc] init]; // put in the defaults [self setVerticalPagination: NSAutoPagination]; [self setHorizontalPagination: NSClipPagination]; [self setJobDisposition: NSPrintSpoolJob]; [self setHorizontallyCentered: YES]; [self setVerticallyCentered: YES]; printer = [NSPrintInfo defaultPrinter]; [self setPrinter: printer]; /* Set up other defaults from the printer object */ pageSize = [printer stringForKey: @"DefaultPageSize" inTable: @"PPD"]; /* FIXME: Need to check for AutoSelect and probably a million other things... */ if (pageSize == nil) pageSize = @"A4"; [self setPaperName: pageSize]; /* Set default margins. FIXME: Probably should check ImageableArea */ [self setRightMargin: 36]; [self setLeftMargin: 36]; [self setTopMargin: 72]; [self setBottomMargin: 72]; [self setOrientation: NSPortraitOrientation]; if (aDict != nil) { [_info addEntriesFromDictionary: aDict]; if ([[_info objectForKey: NSPrintPrinter] isKindOfClass: [NSString class]]) { NSString *printerName; printerName = [_info objectForKey: NSPrintPrinter]; printer = [NSPrinter printerWithName: printerName]; [self setPrinter: printer]; } } return self; } - (void) dealloc { RELEASE(_info); [super dealloc]; } - (id) copyWithZone: (NSZone*)z { NSPrintInfo *new = (NSPrintInfo *)NSCopyObject(self, 0, z); new->_info = [_info mutableCopyWithZone: z]; return new; } // // Managing the Printing Rectangle // - (CGFloat) bottomMargin { return [(NSNumber *)[_info objectForKey: NSPrintBottomMargin] doubleValue]; } - (CGFloat) leftMargin { return [(NSNumber *)[_info objectForKey: NSPrintLeftMargin] doubleValue]; } - (NSPrintingOrientation) orientation { return [(NSNumber *)[_info objectForKey: NSPrintOrientation] intValue]; } - (NSString*) paperName { return [_info objectForKey: NSPrintPaperName]; } - (NSSize) paperSize { /* Don't simplify this. Some OSs can't handle returning a NULL value into a struct. */ NSValue *val = [_info objectForKey: NSPrintPaperSize]; if (val == nil) return NSMakeSize(0,0); return [val sizeValue]; } - (CGFloat) rightMargin { return [(NSNumber *)[_info objectForKey: NSPrintRightMargin] doubleValue]; } - (void) setBottomMargin: (CGFloat)value { [_info setObject: [NSNumber numberWithDouble: value] forKey: NSPrintBottomMargin]; } - (void) setLeftMargin: (CGFloat)value { [_info setObject: [NSNumber numberWithDouble: value] forKey: NSPrintLeftMargin]; } - (void) setOrientation: (NSPrintingOrientation)mode { NSSize size; [_info setObject: [NSNumber numberWithInt: mode] forKey: NSPrintOrientation]; /* Set the paper size accordingly */ size = [self paperSize]; if ((mode == NSPortraitOrientation && size.width > size.height) || (mode == NSLandscapeOrientation && size.width < size.height)) { CGFloat tmp = size.width; size.width = size.height; size.height = tmp; [_info setObject: [NSValue valueWithSize: size] forKey: NSPrintPaperSize]; } } - (void) setPaperName: (NSString*)name { [_info setObject: name forKey: NSPrintPaperName]; // FIXME: Should this change the orientation? [_info setObject: [NSValue valueWithSize: [NSPrintInfo sizeForPaperName: name]] forKey: NSPrintPaperSize]; } - (void) setPaperSize: (NSSize)size { NSPrintingOrientation orient; [_info setObject: [NSValue valueWithSize: size] forKey: NSPrintPaperSize]; // Set orientation accordingly if (size.width <= size.height) orient = NSPortraitOrientation; else orient = NSLandscapeOrientation; [_info setObject: [NSNumber numberWithInt: orient] forKey: NSPrintOrientation]; } - (void) setRightMargin: (CGFloat)value { [_info setObject:[NSNumber numberWithDouble:value] forKey:NSPrintRightMargin]; } - (void) setTopMargin: (CGFloat)value { [_info setObject:[NSNumber numberWithDouble:value] forKey:NSPrintTopMargin]; } - (CGFloat) topMargin { return [(NSNumber *)[_info objectForKey:NSPrintTopMargin] doubleValue]; } - (NSRect) imageablePageBounds { NSRect pageBounds; NSPrinter *printer; printer = [self printer]; if (printer) { NSPrintingOrientation mode; mode = [self orientation]; pageBounds = [printer imageRectForPaper: [self paperName]]; if ((NSPortraitOrientation == mode && pageBounds.size.width > pageBounds.size.height) || (NSLandscapeOrientation == mode && pageBounds.size.width < pageBounds.size.height)) { CGFloat tmp; tmp = pageBounds.origin.x; pageBounds.origin.x = pageBounds.origin.y; pageBounds.origin.y = tmp; tmp = pageBounds.size.width; pageBounds.size.width = pageBounds.size.height; pageBounds.size.height = tmp; } } else { pageBounds.origin = NSMakePoint(0, 0); pageBounds.size = [self paperSize]; } return pageBounds; } - (NSString*) localizedPaperName { return NSLocalizedString([self paperName], @"paper name"); } // // Pagination // - (NSPrintingPaginationMode) horizontalPagination { return [(NSNumber*)[_info objectForKey: NSPrintHorizontalPagination] intValue]; } - (void) setHorizontalPagination: (NSPrintingPaginationMode)mode { [_info setObject: [NSNumber numberWithInt:mode] forKey: NSPrintHorizontalPagination]; } - (void)setVerticalPagination: (NSPrintingPaginationMode)mode { [_info setObject: [NSNumber numberWithInt:mode] forKey: NSPrintVerticalPagination]; } - (NSPrintingPaginationMode) verticalPagination { return [(NSNumber *)[_info objectForKey: NSPrintVerticalPagination] intValue]; } // // Positioning the Image on the Page // - (BOOL) isHorizontallyCentered { return [(NSNumber *)[_info objectForKey: NSPrintHorizontallyCentered] boolValue]; } - (BOOL) isVerticallyCentered { return [(NSNumber *)[_info objectForKey: NSPrintVerticallyCentered] boolValue]; } - (void) setHorizontallyCentered: (BOOL)flag { [_info setObject: [NSNumber numberWithBool: flag] forKey: NSPrintHorizontallyCentered]; } - (void) setVerticallyCentered: (BOOL)flag { [_info setObject: [NSNumber numberWithBool: flag] forKey: NSPrintVerticallyCentered]; } // // Specifying the Printer // - (NSPrinter*) printer { return [_info objectForKey: NSPrintPrinter]; } - (void) setPrinter: (NSPrinter*)aPrinter { if (aPrinter) { [_info setObject: aPrinter forKey: NSPrintPrinter]; // FIXME: Remove features not supported by the new printer } else { [_info removeObjectForKey: NSPrintPrinter]; // FIXME: Should we reset the default printer? } } // // Controlling Printing // - (NSString*) jobDisposition { return [_info objectForKey: NSPrintJobDisposition]; } - (void) setJobDisposition: (NSString*)disposition { [_info setObject: disposition forKey: NSPrintJobDisposition]; } - (void) setUpPrintOperationDefaultValues { // [self subclassResponsibility: _cmd]; } // // Accessing the NSPrintInfo Object's Dictionary // - (NSMutableDictionary*) dictionary { return _info; } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder*)aCoder { NSMutableDictionary *dict; NSString *printerName; dict = [_info mutableCopy]; printerName = [[self printer] name]; if (printerName) { [dict setObject: printerName forKey: NSPrintPrinter]; } else { [dict removeObjectForKey: NSPrintPrinter]; } if ([aCoder allowsKeyedCoding]) { [aCoder encodeObject: dict forKey: @"NSAttributes"]; } else { [aCoder encodePropertyList: dict]; } RELEASE(dict); } - (id) initWithCoder: (NSCoder*)aDecoder { NSMutableDictionary *dict; if ([aDecoder allowsKeyedCoding]) { dict = [aDecoder decodeObjectForKey: @"NSAttributes"]; } else { dict = [aDecoder decodePropertyList]; } return [self initWithDictionary: dict]; } @end gnustep-gui-0.24.0/Source/NSMenuItem.m0000664000076500007650000005033212110205434017337 0ustar brains99brains99/** NSMenuItem The menu cell class. Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: May 1997 Author: David Lazaro Saz Date: Sep 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import #import #import #import #import "AppKit/NSCell.h" #import "AppKit/NSEvent.h" #import "AppKit/NSImage.h" #import "AppKit/NSKeyValueBinding.h" #import "AppKit/NSMenuItem.h" #import "AppKit/NSMenu.h" #import "GSBindingHelpers.h" static BOOL usesUserKeyEquivalents = NO; static Class imageClass; @interface GSMenuSeparator : NSMenuItem @end @implementation GSMenuSeparator - (Class) classForCoder { return [NSMenuItem class]; } - (id) init { self = [super initWithTitle: @"-----------" action: NULL keyEquivalent: @""]; if (self == nil) return nil; _enabled = NO; _changesState = NO; return self; } - (BOOL) isSeparatorItem { return YES; } // FIXME: We need a lot of methods to switch off changes for a separator @end @implementation NSMenuItem + (void) initialize { if (self == [NSMenuItem class]) { [self setVersion: 4]; imageClass = [NSImage class]; [self exposeBinding: NSEnabledBinding]; } } + (void) setUsesUserKeyEquivalents: (BOOL)flag { usesUserKeyEquivalents = flag; } + (BOOL) usesUserKeyEquivalents { return usesUserKeyEquivalents; } + (id ) separatorItem { return AUTORELEASE([GSMenuSeparator new]); } - (id) init { return [self initWithTitle: @"" action: NULL keyEquivalent: @""]; } - (void) dealloc { // Remove all key value bindings for this view. [GSKeyValueBinding unbindAllForObject: self]; TEST_RELEASE(_title); TEST_RELEASE(_keyEquivalent); TEST_RELEASE(_image); TEST_RELEASE(_onStateImage); TEST_RELEASE(_offStateImage); TEST_RELEASE(_mixedStateImage); TEST_RELEASE(_submenu); TEST_RELEASE(_representedObject); TEST_RELEASE(_toolTip); [super dealloc]; } - (id) initWithTitle: (NSString*)aString action: (SEL)aSelector keyEquivalent: (NSString*)charCode { self = [super init]; if (self == nil) return nil; //_menu = nil; [self setKeyEquivalent: charCode]; _keyEquivalentModifierMask = NSCommandKeyMask; [self setTitle: aString]; // do this AFTER setKeyEquivalent: in case NSUserKeyEquivalents is defined _mnemonicLocation = 255; // No mnemonic _state = NSOffState; _enabled = YES; //_image = nil; // Set the images according to the spec. On: check mark; off: dash. [self setOnStateImage: [imageClass imageNamed: @"NSMenuCheckmark"]]; [self setMixedStateImage: [imageClass imageNamed: @"NSMenuMixedState"]]; //_offStateImage = nil; //_target = nil; _action = aSelector; //_changesState = NO; return self; } - (void) _updateKeyEquivalent { // Update keyEquivalent based on any entries in NSUserKeyEquivalents in the defaults database // TODO: also check in other defaults domains, to allow NSUserKeyEquivalents dictionaries // in different domains to provide overrides of different menu items. NSString *userKeyEquivalent = [(NSDictionary*)[[NSUserDefaults standardUserDefaults] objectForKey: @"NSUserKeyEquivalents"] objectForKey: _title]; if (userKeyEquivalent) { // check for leading symbols representing modifier flags: @, ~, $, ^ NSUInteger modifierMask = 0; while ([userKeyEquivalent length] > 1) { if ([userKeyEquivalent hasPrefix:@"@"]) { modifierMask |= NSCommandKeyMask; userKeyEquivalent = [userKeyEquivalent substringFromIndex:1]; } else if ([userKeyEquivalent hasPrefix:@"~"]) { modifierMask |= NSAlternateKeyMask; userKeyEquivalent = [userKeyEquivalent substringFromIndex:1]; } else if ([userKeyEquivalent hasPrefix:@"$"]) { modifierMask |= NSShiftKeyMask; userKeyEquivalent = [userKeyEquivalent substringFromIndex:1]; } else if ([userKeyEquivalent hasPrefix:@"^"]) { modifierMask |= NSControlKeyMask; userKeyEquivalent = [userKeyEquivalent substringFromIndex:1]; } else { break; } } [self setKeyEquivalent:userKeyEquivalent]; [self setKeyEquivalentModifierMask:modifierMask]; } } - (void) setMenu: (NSMenu*)menu { /* The menu is retaining us. Do not retain it. */ _menu = menu; if (_submenu != nil) { [_submenu setSupermenu: menu]; [self setTarget: _menu]; } } - (NSMenu*) menu { return _menu; } - (BOOL) hasSubmenu { return (_submenu == nil) ? NO : YES; } - (void) setSubmenu: (NSMenu*)submenu { if (submenu == _submenu) return; // no change if ([submenu supermenu] != nil) { [NSException raise: NSInvalidArgumentException format: @"submenu (%@) already has supermenu (%@)", [submenu title], [[submenu supermenu] title]]; } ASSIGN(_submenu, submenu); if (submenu != nil) { [submenu setSupermenu: _menu]; [submenu setTitle: _title]; } [self setTarget: _menu]; [self setAction: @selector(submenuAction:)]; [_menu itemChanged: self]; } - (NSMenu*) submenu { return _submenu; } - (void) setTitle: (NSString*)aString { if (nil == aString) aString = @""; if ([_title isEqualToString:aString]) return; // no change ASSIGNCOPY(_title, aString); [self _updateKeyEquivalent]; [_menu itemChanged: self]; } - (NSString*) title { return _title; } - (BOOL) isSeparatorItem { return NO; } - (void) setKeyEquivalent: (NSString*)aKeyEquivalent { if (nil == aKeyEquivalent) { /* We warn about nil for compatibiliy with MacOS X, which refuses nil. */ NSDebugMLLog(@"MacOSXCompatibility", @"Attempt to use nil as key equivalent"); aKeyEquivalent = @""; } if ([_keyEquivalent isEqualToString:aKeyEquivalent]) return; // no change ASSIGNCOPY(_keyEquivalent, aKeyEquivalent); [_menu itemChanged: self]; } - (NSString*) keyEquivalent { if (usesUserKeyEquivalents) return [self userKeyEquivalent]; else return _keyEquivalent; } - (void) setKeyEquivalentModifierMask: (NSUInteger)mask { if (_keyEquivalentModifierMask == mask) return; // no change _keyEquivalentModifierMask = mask; [_menu itemChanged: self]; } - (NSUInteger) keyEquivalentModifierMask { return _keyEquivalentModifierMask; } - (NSString*) userKeyEquivalent { NSString *userKeyEquivalent = [(NSDictionary*)[[[NSUserDefaults standardUserDefaults] persistentDomainForName: NSGlobalDomain] objectForKey: @"NSCommandKeys"] objectForKey: _title]; if (nil == userKeyEquivalent) userKeyEquivalent = @""; return userKeyEquivalent; } - (NSUInteger) userKeyEquivalentModifierMask { // FIXME return NSCommandKeyMask; } - (void) setMnemonicLocation: (NSUInteger)location { if (_mnemonicLocation == location) return; // no change _mnemonicLocation = location; [_menu itemChanged: self]; } - (NSUInteger) mnemonicLocation { if (_mnemonicLocation != 255) return _mnemonicLocation; else return NSNotFound; } - (NSString*) mnemonic { if (_mnemonicLocation != 255) return [_title substringWithRange: NSMakeRange(_mnemonicLocation, 1)]; else return @""; } - (void) setTitleWithMnemonic: (NSString*)stringWithAmpersand { NSUInteger location = [stringWithAmpersand rangeOfString: @"&"].location; [self setTitle: [stringWithAmpersand stringByReplacingString: @"&" withString: @""]]; [self setMnemonicLocation: location]; } - (void) setImage: (NSImage *)image { NSAssert(image == nil || [image isKindOfClass: imageClass], NSInvalidArgumentException); if (_image == image) return; // no change ASSIGN(_image, image); [_menu itemChanged: self]; } - (NSImage*) image { return _image; } - (void) setState: (NSInteger)state { if (_state == state) return; _state = state; _changesState = YES; [_menu itemChanged: self]; } - (NSInteger) state { return _state; } - (void) setOnStateImage: (NSImage*)image { NSAssert(image == nil || [image isKindOfClass: imageClass], NSInvalidArgumentException); if (_onStateImage == image) return; // no change ASSIGN(_onStateImage, image); [_menu itemChanged: self]; } - (NSImage*) onStateImage { return _onStateImage; } - (void) setOffStateImage: (NSImage*)image { NSAssert(image == nil || [image isKindOfClass: imageClass], NSInvalidArgumentException); if (_offStateImage == image) return; // no change ASSIGN(_offStateImage, image); [_menu itemChanged: self]; } - (NSImage*) offStateImage { return _offStateImage; } - (void) setMixedStateImage: (NSImage*)image { NSAssert(image == nil || [image isKindOfClass: imageClass], NSInvalidArgumentException); if (_mixedStateImage == image) return; // no change ASSIGN(_mixedStateImage, image); [_menu itemChanged: self]; } - (NSImage*) mixedStateImage { return _mixedStateImage; } - (void) setEnabled: (BOOL)flag { if (flag == _enabled) return; _enabled = flag; [_menu itemChanged: self]; } - (BOOL) isEnabled { return _enabled; } - (void) setTarget: (id)anObject { if (_target == anObject) return; _target = anObject; [_menu itemChanged: self]; } - (id) target { return _target; } - (void) setAction: (SEL)aSelector { if (_action == aSelector) return; _action = aSelector; [_menu itemChanged: self]; } - (SEL) action { return _action; } - (void) setTag: (NSInteger)anInt { _tag = anInt; } - (NSInteger) tag { return _tag; } - (void) setRepresentedObject: (id)anObject { ASSIGN(_representedObject, anObject); } - (id) representedObject { return _representedObject; } - (NSAttributedString *)attributedTitle { // FIXME return nil; } -(void) setAttributedTitle: (NSAttributedString *)title { // FIXME [self setTitle: [title string]]; } - (NSInteger)indentationLevel { return _indentation; } - (void)setIndentationLevel: (NSInteger)level { _indentation = level; } - (BOOL)isAlternate { return _isAlternate; } - (void) setAlternate: (BOOL)isAlternate { _isAlternate = isAlternate; } - (void) setToolTip: (NSString *)toolTip { ASSIGN(_toolTip, toolTip); } - (NSString *) toolTip { return _toolTip; } /* * NSCopying protocol */ - (id) copyWithZone: (NSZone*)zone { NSMenuItem *copy = (NSMenuItem*)NSCopyObject (self, 0, zone); // We reset the menu to nil to allow the reuse of the copy copy->_menu = nil; copy->_title = [_title copyWithZone: zone]; copy->_keyEquivalent = [_keyEquivalent copyWithZone: zone]; copy->_image = [_image copyWithZone: zone]; copy->_onStateImage = [_onStateImage copyWithZone: zone]; copy->_offStateImage = [_offStateImage copyWithZone: zone]; copy->_mixedStateImage = [_mixedStateImage copyWithZone: zone]; copy->_representedObject = RETAIN(_representedObject); copy->_submenu = [_submenu copy]; copy->_toolTip = RETAIN(_toolTip); copy->_target = _target; return copy; } /* * NSCoding protocol */ - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { if ([self isSeparatorItem]) { [aCoder encodeBool: YES forKey: @"NSIsSeparator"]; } [aCoder encodeObject: _title forKey: @"NSTitle"]; [aCoder encodeObject: NSStringFromSelector(_action) forKey: @"NSAction"]; [aCoder encodeObject: _keyEquivalent forKey: @"NSKeyEquiv"]; [aCoder encodeObject: _onStateImage forKey: @"NSOnImage"]; [aCoder encodeObject: _offStateImage forKey: @"NSOffImage"]; // ??????? [aCoder encodeObject: _mixedStateImage forKey: @"NSMixedImage"]; [aCoder encodeObject: _target forKey: @"NSTarget"]; [aCoder encodeObject: _menu forKey: @"NSMenu"]; // If the menu is owned by a popup, then don't encode the children. // This prevents an assertion error in IB as these keys should not // be present in a menu item when it's encoded as part of a popup. if([_menu _ownedByPopUp] == NO) { [aCoder encodeObject: _submenu forKey: @"NSSubmenu"]; } [aCoder encodeInt: _keyEquivalentModifierMask forKey: @"NSKeyEquivModMask"]; [aCoder encodeInt: _mnemonicLocation forKey: @"NSMnemonicLoc"]; [aCoder encodeInt: _state forKey: @"NSState"]; [aCoder encodeBool: ![self isEnabled] forKey: @"NSIsDisabled"]; if (_tag) { [aCoder encodeInt: _tag forKey: @"NSTag"]; } } else { [aCoder encodeObject: _title]; [aCoder encodeObject: _keyEquivalent]; [aCoder encodeValueOfObjCType: @encode(NSUInteger) at: &_keyEquivalentModifierMask]; [aCoder encodeValueOfObjCType: @encode(NSUInteger) at: &_mnemonicLocation]; [aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_state]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_enabled]; [aCoder encodeObject: _image]; [aCoder encodeObject: _onStateImage]; [aCoder encodeObject: _offStateImage]; [aCoder encodeObject: _mixedStateImage]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_changesState]; [aCoder encodeValueOfObjCType: @encode(SEL) at: &_action]; [aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_tag]; [aCoder encodeConditionalObject: _representedObject]; [aCoder encodeObject: _submenu]; [aCoder encodeConditionalObject: _target]; // version 3 [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isAlternate]; [aCoder encodeValueOfObjCType: @encode(char) at: &_indentation]; [aCoder encodeObject: _toolTip]; } } - (id) initWithCoder: (NSCoder*)aDecoder { if ([aDecoder allowsKeyedCoding]) { NSString *title; NSString *action; NSString *key; BOOL isSeparator = NO; int keyMask; if ([aDecoder containsValueForKey: @"NSIsSeparator"]) { isSeparator = [aDecoder decodeBoolForKey: @"NSIsSeparator"]; } if (isSeparator) { RELEASE(self); // // An object returned from initWithCoder: // should not be autoreleased. Do a retain // to prevent it from being released automatically. // return RETAIN([NSMenuItem separatorItem]); } // // Not retained, because we're calling the designated init with // the values. // title = [aDecoder decodeObjectForKey: @"NSTitle"]; action = [aDecoder decodeObjectForKey: @"NSAction"]; key = [aDecoder decodeObjectForKey: @"NSKeyEquiv"]; self = [self initWithTitle: title action: NSSelectorFromString(action) keyEquivalent: key]; //[aDecoder decodeObjectForKey: @"NSMenu"]; if ([aDecoder containsValueForKey: @"NSTarget"]) { id target = [aDecoder decodeObjectForKey: @"NSTarget"]; [self setTarget: target]; } if ([aDecoder containsValueForKey: @"NSMixedImage"]) { NSImage *mixedImage = [aDecoder decodeObjectForKey: @"NSMixedImage"]; [self setMixedStateImage: mixedImage]; } if ([aDecoder containsValueForKey: @"NSOnImage"]) { NSImage *onImage = [aDecoder decodeObjectForKey: @"NSOnImage"]; [self setOnStateImage: onImage]; } if ([aDecoder containsValueForKey: @"NSSubmenu"]) { NSMenu *submenu = [aDecoder decodeObjectForKey: @"NSSubmenu"]; [self setSubmenu: submenu]; } // Set the key mask regardless of whether it is present; // i.e. set it to 0 if it is not present in the nib. keyMask = [aDecoder decodeIntForKey: @"NSKeyEquivModMask"]; [self setKeyEquivalentModifierMask: keyMask]; if ([aDecoder containsValueForKey: @"NSMnemonicLoc"]) { int loc = [aDecoder decodeIntForKey: @"NSMnemonicLoc"]; [self setMnemonicLocation: loc]; } if ([aDecoder containsValueForKey: @"NSState"]) { _state = [aDecoder decodeIntForKey: @"NSState"]; } if ([aDecoder containsValueForKey: @"NSIsDisabled"]) { BOOL flag = [aDecoder decodeBoolForKey: @"NSIsDisabled"]; [self setEnabled: !flag]; } if ([aDecoder containsValueForKey: @"NSTag"]) { int tag = [aDecoder decodeIntForKey: @"NSTag"]; [self setTag: tag]; } } else { int version = [aDecoder versionForClassName: @"NSMenuItem"]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_title]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_keyEquivalent]; [aDecoder decodeValueOfObjCType: @encode(NSUInteger) at: &_keyEquivalentModifierMask]; if (version <= 3) { _keyEquivalentModifierMask = _keyEquivalentModifierMask << 16; } [aDecoder decodeValueOfObjCType: @encode(NSUInteger) at: &_mnemonicLocation]; [aDecoder decodeValueOfObjCType: @encode(NSInteger) at: &_state]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_enabled]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_image]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_onStateImage]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_offStateImage]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_mixedStateImage]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_changesState]; if (version == 1) { _target = [aDecoder decodeObject]; } [aDecoder decodeValueOfObjCType: @encode(SEL) at: &_action]; [aDecoder decodeValueOfObjCType: @encode(NSInteger) at: &_tag]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_representedObject]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_submenu]; if (version >= 2) { _target = [aDecoder decodeObject]; } if (version >= 3) { [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isAlternate]; [aDecoder decodeValueOfObjCType: @encode(char) at: &_indentation]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_toolTip]; } } [self _updateKeyEquivalent]; return self; } - (void) bind: (NSString *)binding toObject: (id)anObject withKeyPath: (NSString *)keyPath options: (NSDictionary *)options { if ([binding hasPrefix: NSEnabledBinding]) { GSKeyValueBinding *kvb; [self unbind: binding]; kvb = [[GSKeyValueAndBinding alloc] initWithBinding: NSEnabledBinding withName: binding toObject: anObject withKeyPath: keyPath options: options fromObject: self]; // The binding will be retained in the binding table RELEASE(kvb); } else { [super bind: binding toObject: anObject withKeyPath: keyPath options: options]; } } @end @implementation NSMenuItem (GNUstepExtra) /* * These methods support the special arranging in columns of menu * items in GNUstep. There's no need to use them outside but if * they are used the display is more pleasant. */ - (void) setChangesState: (BOOL)flag { _changesState = flag; } - (BOOL) changesState { return _changesState; } @end gnustep-gui-0.24.0/Source/NSBox.m0000664000076500007650000006265112225114146016361 0ustar brains99brains99/** NSBox Simple box view that can display a border and title Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import #import #import #import #import #import "AppKit/NSBox.h" #import "AppKit/NSColor.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSTextFieldCell.h" #import "AppKit/NSWindow.h" #import "GNUstepGUI/GSTheme.h" #include @interface NSBox (Private) - (NSRect) calcSizesAllowingNegative: (BOOL)aFlag; @end /**

TODO : Description

*/ @implementation NSBox // // Class methods // + (void) initialize { if (self == [NSBox class]) { // Initial version [self setVersion: 1]; } } // // Instance methods // - (id) initWithFrame: (NSRect)frameRect { NSView *cv; self = [super initWithFrame: frameRect]; if (!self) return self; _cell = [[NSCell alloc] initTextCell: @"Title"]; [_cell setAlignment: NSCenterTextAlignment]; [_cell setBordered: NO]; [_cell setEditable: NO]; [self setTitleFont: [NSFont systemFontOfSize: [NSFont smallSystemFontSize]]]; _offsets.width = 5; _offsets.height = 5; _border_rect = _bounds; _border_type = NSGrooveBorder; _title_position = NSAtTop; _title_rect = NSZeroRect; [self setAutoresizesSubviews: NO]; cv = [NSView new]; [self setContentView: cv]; RELEASE(cv); return self; } - (void) dealloc { TEST_RELEASE(_cell); [super dealloc]; } /**

Returns the border rectangle of the box.

*/ - (NSRect) borderRect { return _border_rect; } /**

Returns the NSBox's border type. See NSBorderType for more information. The default border type is NSGrooveBorder.

See Also: -setBorderType:

*/ - (NSBorderType) borderType { return _border_type; } /**

Sets the border type to aType, resizes the content view frame if needed, and marks self for display. See NSBorderType for more informations The default boder type is NSGrooveBorder.

See Also: -borderType

*/ - (void) setBorderType: (NSBorderType)aType { if (_border_type != aType) { _border_type = aType; [_content_view setFrame: [self calcSizesAllowingNegative: NO]]; [self setNeedsDisplay: YES]; } } - (NSBoxType) boxType { return _box_type; } - (void) setBoxType: (NSBoxType)aType { if (_box_type != aType) { _box_type = aType; [_content_view setFrame: [self calcSizesAllowingNegative: NO]]; [self setNeedsDisplay: YES]; } } /**

Sets the title cell to aString, resizes the content view frame if needed and marks self for display.

Warning: This method does not implement the Cocoa behaviour

See Also: -title [NSCell-setStringValue:]

*/ - (void) setTitle: (NSString *)aString { // TODO: implement the macosx behaviour for setTitle: [_cell setStringValue: aString]; [_content_view setFrame: [self calcSizesAllowingNegative: NO]]; [self setNeedsDisplay: YES]; } - (void) setTitleWithMnemonic: (NSString *)aString { [_cell setTitleWithMnemonic: aString]; [_content_view setFrame: [self calcSizesAllowingNegative: NO]]; [self setNeedsDisplay: YES]; } /**

Sets the title cell font to fontObj, resizes * the content view frame if needed and marks self for display.

*

See Also: -titleFont [NSCell-setFont:]

*/ - (void) setTitleFont: (NSFont *)fontObj { [_cell setFont: fontObj]; [_content_view setFrame: [self calcSizesAllowingNegative: NO]]; [self setNeedsDisplay: YES]; } /**

Sets the title cell position to aPosition, resizes the content view frame if needed and marks self for display. See NSTitlePosition for more information. The default position is NSAtTop.

See Also: -titlePosition

*/ - (void) setTitlePosition: (NSTitlePosition)aPosition { if (_title_position != aPosition) { _title_position = aPosition; [_content_view setFrame: [self calcSizesAllowingNegative: NO]]; [self setNeedsDisplay: YES]; } } /**

Returns title cell string value.

*

See Also: -setTitle: [NSCell-stringValue]

*/ - (NSString*) title { return [_cell stringValue]; } /**

Returns the title cell

*/ - (id) titleCell { return _cell; } /**

Returns the title cell font.

*

See Also: -setTitleFont: [NSCell-font]

*/ - (NSFont*) titleFont { return [_cell font]; } /**

Returns the title position. See NSTitlePosition for more information. The default position is NSAtTop

See Also: -setTitlePosition:

*/ - (NSTitlePosition) titlePosition { return _title_position; } /**

Returns the title rectangle

*/ - (NSRect) titleRect { return _title_rect; } /**

Returns the NSBox's content view. The content view is created as NSView when the box is initialized. The contentView is resizes when needed.

See Also: -setContentView:

*/ - (id) contentView { return _content_view; } /**

Returns an NSSize containing the interior margins of the receiver. An NSBox's content view margins are empty space that is subtracted from the top, bottom, and sides as padding between the inside of the box and the frame of its content view.

See Also: -setContentViewMargins:

*/ - (NSSize) contentViewMargins { return _offsets; } /**

Sets the content view to aView. The current content view is replaced by -replaceSubview:with:. So you should -retain the current view if you want to use it later. The contentView frame is resized if needed.

See Also: -contentView

*/ - (void) setContentView: (NSView*)aView { if (aView) { [super replaceSubview: _content_view with: aView]; _content_view = aView; [_content_view setFrame: [self calcSizesAllowingNegative: NO]]; } } /**

Sets the NSSize containing the interior margins to offsetSize. An NSBox's content view margins are empty space that is subtracted from the top, bottom, and sides as padding between the inside of the box and the frame of its content view

See Also: -contentViewMargins

*/ - (void) setContentViewMargins: (NSSize)offsetSize { NSAssert(offsetSize.width >= 0 && offsetSize.height >= 0, @"illegal margins supplied"); _offsets = offsetSize; [_content_view setFrame: [self calcSizesAllowingNegative: NO]]; [self setNeedsDisplay: YES]; } // // Resizing the Box // - (void) setFrame: (NSRect)frameRect { [super setFrame: frameRect]; [_content_view setFrame: [self calcSizesAllowingNegative: NO]]; } - (void) setFrameSize: (NSSize)newSize { [super setFrameSize: newSize]; [_content_view setFrame: [self calcSizesAllowingNegative: NO]]; } /**

Resizes the NSBox to fit the content view frame contentFrame.

*/ - (void) setFrameFromContentFrame: (NSRect)contentFrame { // First calc the sizes to see how much we are off by NSRect r = [self calcSizesAllowingNegative: YES]; NSRect f = _frame; NSAssert(contentFrame.size.width >= 0 && contentFrame.size.height >= 0, @"illegal content frame supplied"); if (_super_view) r = [_super_view convertRect:r fromView: self]; // Add the difference to the frame f.size.width = f.size.width + (contentFrame.size.width - r.size.width); f.size.height = f.size.height + (contentFrame.size.height - r.size.height); f.origin.x = f.origin.x + (contentFrame.origin.x - r.origin.x); f.origin.y = f.origin.y + (contentFrame.origin.y - r.origin.y); [self setFrame: f]; [_content_view setFrame: [self calcSizesAllowingNegative: NO]]; } -(NSSize) minimumSize { NSRect rect; NSSize borderSize = [[GSTheme theme] sizeForBorderType: _border_type]; if ([_content_view respondsToSelector: @selector(minimumSize)]) { rect.size = [_content_view minimumSize]; } else { NSArray *subviewArray = [_content_view subviews]; if ([subviewArray count]) { id subview; NSEnumerator *enumerator; enumerator = [subviewArray objectEnumerator]; rect = [[enumerator nextObject] frame]; // Loop through subviews and calculate rect // to encompass all while ((subview = [enumerator nextObject])) { rect = NSUnionRect(rect, [subview frame]); } } else // _content_view has no subviews { rect = NSZeroRect; } } rect.size = [self convertSize: rect.size fromView:_content_view]; rect.size.width += (2 * _offsets.width) + (2 * borderSize.width); rect.size.height += (2 * _offsets.height) + (2 * borderSize.height); return rect.size; } /**

Resizes the NSBox and its content view to fit its subviews.

*/ - (void) sizeToFit { NSRect f; if ([_content_view respondsToSelector: @selector(sizeToFit)]) { [_content_view sizeToFit]; } else // _content_view !respondsToSelector: sizeToFit { NSArray *subviewArray = [_content_view subviews]; if ([subviewArray count]) { id o, e = [subviewArray objectEnumerator]; NSRect r = [[e nextObject] frame]; // Loop through subviews and calculate rect to encompass all while ((o = [e nextObject])) { r = NSUnionRect(r, [o frame]); } [_content_view setBoundsOrigin: r.origin]; r.size = [self convertSize: r.size fromView: _content_view]; [_content_view setAutoresizesSubviews: NO]; [_content_view setFrameSize: r.size]; [_content_view setAutoresizesSubviews: YES]; } else // _content_view has no subviews { [_content_view setFrame: [self calcSizesAllowingNegative: NO]]; } } f = [_content_view frame]; // The box width should be enough to display the title if (_title_position != NSNoTitle) { NSSize titleSize = [_cell cellSize]; titleSize.width += 6; if (f.size.width < titleSize.width) f.size.width = titleSize.width; } if (_super_view != nil) [self setFrameFromContentFrame: [self convertRect: f toView: _super_view]]; else // _super_view == nil [self setFrameFromContentFrame: f]; } - (void) resizeWithOldSuperviewSize: (NSSize)oldSize { [super resizeWithOldSuperviewSize: oldSize]; [_content_view setFrame: [self calcSizesAllowingNegative: NO]]; } // // Managing the NSView Hierarchy // - (void) addSubview: (NSView*)aView { [_content_view addSubview: aView]; } - (void) addSubview: (NSView*)aView positioned: (NSWindowOrderingMode)place relativeTo: (NSView*)otherView { [_content_view addSubview: aView positioned: place relativeTo: otherView]; } - (void) replaceSubview: (NSView *)aView with: (NSView*) newView { [_content_view replaceSubview: aView with: newView]; } // // Displaying // - (void) drawRect: (NSRect)rect { rect = NSIntersectionRect(_bounds, rect); [[GSTheme theme] drawBoxInClipRect: rect boxType: _box_type borderType: _border_type inView: self]; } - (BOOL) isOpaque { // FIXME: Depends on theme; if always returning NO is a performance hit // we can check if GSTheme is going to draw an old-style opaque box // or not. return NO; // if (_box_type == NSBoxCustom) // { // return !_transparent; // } // else // { // return YES; // } } - (NSColor*) fillColor { return _fill_color; } - (void) setFillColor: (NSColor*)newFillColor { ASSIGN(_fill_color, newFillColor); } - (NSColor*) borderColor { return _border_color; } - (void) setBorderColor: (NSColor*)newBorderColor { ASSIGN(_border_color, newBorderColor); } - (CGFloat) borderWidth { return _border_width; } - (void) setBorderWidth: (CGFloat)borderWidth { _border_width = borderWidth; } - (CGFloat) cornerRadius { return _corner_radius; } - (void) setCornerRadius: (CGFloat)cornerRadius { _corner_radius = cornerRadius; } - (BOOL) isTransparent { return _transparent; } - (void) setTransparent: (BOOL)transparent { _transparent = transparent; } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { [aCoder encodeObject: [self contentView] forKey: @"NSContentView"]; [aCoder encodeObject: _cell forKey: @"NSTitleCell"]; [aCoder encodeInt: [self borderType] forKey: @"NSBorderType"]; [aCoder encodeInt: [self boxType] forKey: @"NSBoxType"]; [aCoder encodeInt: [self titlePosition] forKey: @"NSTitlePosition"]; [aCoder encodeBool: _transparent forKey: @"NSFullyTransparent"]; [aCoder encodeSize: [self contentViewMargins] forKey: @"NSOffsets"]; } else { [aCoder encodeObject: _cell]; [aCoder encodeSize: _offsets]; [aCoder encodeValueOfObjCType: @encode(int) at: &_border_type]; [aCoder encodeValueOfObjCType: @encode(int) at: &_title_position]; // NB: the content view is our (only) subview, so it is already // encoded by NSView. } } - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if ([aDecoder allowsKeyedCoding]) { if ([aDecoder containsValueForKey: @"NSBoxType"]) { int boxType = [aDecoder decodeIntForKey: @"NSBoxType"]; [self setBoxType: boxType]; } if ([aDecoder containsValueForKey: @"NSBorderType"]) { NSBorderType borderType = [aDecoder decodeIntForKey: @"NSBorderType"]; [self setBorderType: borderType]; } if ([aDecoder containsValueForKey: @"NSTitlePosition"]) { NSTitlePosition titlePosition = [aDecoder decodeIntForKey: @"NSTitlePosition"]; [self setTitlePosition: titlePosition]; } if ([aDecoder containsValueForKey: @"NSTransparent"]) { // On Apple this is always NO, we keep it for old GNUstep archives _transparent = [aDecoder decodeBoolForKey: @"NSTransparent"]; } if ([aDecoder containsValueForKey: @"NSFullyTransparent"]) { _transparent = [aDecoder decodeBoolForKey: @"NSFullyTransparent"]; } if ([aDecoder containsValueForKey: @"NSOffsets"]) { [self setContentViewMargins: [aDecoder decodeSizeForKey: @"NSOffsets"]]; } if ([aDecoder containsValueForKey: @"NSTitleCell"]) { NSCell *titleCell = [aDecoder decodeObjectForKey: @"NSTitleCell"]; ASSIGN(_cell, titleCell); } if ([aDecoder containsValueForKey: @"NSContentView"]) { NSView *contentView = [aDecoder decodeObjectForKey: @"NSContentView"]; [self setContentView: contentView]; } } else { [aDecoder decodeValueOfObjCType: @encode(id) at: &_cell]; _offsets = [aDecoder decodeSize]; [aDecoder decodeValueOfObjCType: @encode(int) at: &_border_type]; [aDecoder decodeValueOfObjCType: @encode(int) at: &_title_position]; // The content view is our only sub_view if ([_sub_views count] == 0) { NSDebugLLog(@"NSBox", @"NSBox: decoding without content view\n"); // No content view _content_view = nil; [self calcSizesAllowingNegative: NO]; } else { if ([_sub_views count] != 1) { NSLog (@"Warning: Encoded NSBox with more than one content view!"); } _content_view = [_sub_views objectAtIndex: 0]; // The following also computes _title_rect and _border_rect. [_content_view setFrame: [self calcSizesAllowingNegative: NO]]; } } return self; } @end @implementation NSBox (Private) - (NSRect) calcSizesAllowingNegative: (BOOL)aFlag { GSTheme *theme = [GSTheme theme]; NSRect r = NSZeroRect; if (_box_type == NSBoxSeparator) { _title_rect = NSZeroRect; _border_rect = _bounds; if (_bounds.size.width > _bounds.size.height) { _border_rect.origin.y = (int)(_border_rect.size.height / 2); _border_rect.size.height = 1; } else { _border_rect.origin.x = (int)(_border_rect.size.width / 2); _border_rect.size.width = 1; } return r; } switch (_title_position) { case NSNoTitle: { NSSize borderSize = [theme sizeForBorderType: _border_type]; _border_rect = _bounds; _title_rect = NSZeroRect; // Add the offsets to the border rect r.origin.x = _offsets.width + borderSize.width; r.origin.y = _offsets.height + borderSize.height; r.size.width = _border_rect.size.width - (2 * _offsets.width) - (2 * borderSize.width); r.size.height = _border_rect.size.height - (2 * _offsets.height) - (2 * borderSize.height); break; } case NSAboveTop: { NSSize titleSize = [_cell cellSize]; NSSize borderSize = [theme sizeForBorderType: _border_type]; float c; // Add spacer around title titleSize.width += 6; titleSize.height += 2; // Adjust border rect by title cell _border_rect = _bounds; _border_rect.size.height -= titleSize.height + borderSize.height; // Add the offsets to the border rect r.origin.x = _border_rect.origin.x + _offsets.width + borderSize.width; r.origin.y = _border_rect.origin.y + _offsets.height + borderSize.height; r.size.width = _border_rect.size.width - (2 * _offsets.width) - (2 * borderSize.width); r.size.height = _border_rect.size.height - (2 * _offsets.height) - (2 * borderSize.height); // center the title cell c = (_bounds.size.width - titleSize.width) / 2; if (c < 0) c = 0; _title_rect.origin.x = _bounds.origin.x + c; _title_rect.origin.y = _bounds.origin.y + _border_rect.size.height + borderSize.height; _title_rect.size = titleSize; break; } case NSBelowTop: { NSSize titleSize = [_cell cellSize]; NSSize borderSize = [theme sizeForBorderType: _border_type]; float c; // Add spacer around title titleSize.width += 6; titleSize.height += 2; // Adjust border rect by title cell _border_rect = _bounds; // Add the offsets to the border rect r.origin.x = _border_rect.origin.x + _offsets.width + borderSize.width; r.origin.y = _border_rect.origin.y + _offsets.height + borderSize.height; r.size.width = _border_rect.size.width - (2 * _offsets.width) - (2 * borderSize.width); r.size.height = _border_rect.size.height - (2 * _offsets.height) - (2 * borderSize.height); // Adjust by the title size r.size.height -= titleSize.height + borderSize.height; // center the title cell c = (_border_rect.size.width - titleSize.width) / 2; if (c < 0) c = 0; _title_rect.origin.x = _border_rect.origin.x + c; _title_rect.origin.y = _border_rect.origin.y + _border_rect.size.height - titleSize.height - borderSize.height; _title_rect.size = titleSize; break; } case NSAtTop: { NSSize titleSize = [_cell cellSize]; NSSize borderSize = [theme sizeForBorderType: _border_type]; float c; float topMargin; float topOffset; // Add spacer around title titleSize.width += 6; titleSize.height += 2; _border_rect = _bounds; topMargin = ceil(titleSize.height / 2); topOffset = titleSize.height - topMargin; // Adjust by the title size _border_rect.size.height -= topMargin; // Add the offsets to the border rect r.origin.x = _border_rect.origin.x + _offsets.width + borderSize.width; r.size.width = _border_rect.size.width - (2 * _offsets.width) - (2 * borderSize.width); if (topOffset > _offsets.height) { r.origin.y = _border_rect.origin.y + _offsets.height + borderSize.height; r.size.height = _border_rect.size.height - _offsets.height - (2 * borderSize.height) - topOffset; } else { r.origin.y = _border_rect.origin.y + _offsets.height + borderSize.height; r.size.height = _border_rect.size.height - (2 * _offsets.height) - (2 * borderSize.height); } // Adjust by the title size // r.size.height -= titleSize.height + borderSize.height; // center the title cell c = (_border_rect.size.width - titleSize.width) / 2; if (c < 0) c = 0; _title_rect.origin.x = _border_rect.origin.x + c; _title_rect.origin.y = _border_rect.origin.y + _border_rect.size.height - topMargin; _title_rect.size = titleSize; break; } case NSAtBottom: { NSSize titleSize = [_cell cellSize]; NSSize borderSize = [theme sizeForBorderType: _border_type]; float c; float bottomMargin; float bottomOffset; // Add spacer around title titleSize.width += 6; titleSize.height += 2; _border_rect = _bounds; bottomMargin = ceil(titleSize.height / 2); bottomOffset = titleSize.height - bottomMargin; // Adjust by the title size _border_rect.origin.y += bottomMargin; _border_rect.size.height -= bottomMargin; // Add the offsets to the border rect r.origin.x = _border_rect.origin.x + _offsets.width + borderSize.width; r.size.width = _border_rect.size.width - (2 * _offsets.width) - (2 * borderSize.width); if (bottomOffset > _offsets.height) { r.origin.y = _border_rect.origin.y + bottomOffset + borderSize.height; r.size.height = _border_rect.size.height - _offsets.height - bottomOffset - (2 * borderSize.height); } else { r.origin.y = _border_rect.origin.y + _offsets.height + borderSize.height; r.size.height = _border_rect.size.height - (2 * _offsets.height) - (2 * borderSize.height); } // Adjust by the title size /* r.origin.y += (titleSize.height / 2) + borderSize.height; r.size.height -= (titleSize.height / 2) + borderSize.height; */ // center the title cell c = (_border_rect.size.width - titleSize.width) / 2; if (c < 0) c = 0; _title_rect.origin.x = c; _title_rect.origin.y = 0; _title_rect.size = titleSize; break; } case NSBelowBottom: { NSSize titleSize = [_cell cellSize]; NSSize borderSize = [theme sizeForBorderType: _border_type]; float c; // Add spacer around title titleSize.width += 6; titleSize.height += 2; // Adjust by the title _border_rect = _bounds; _border_rect.origin.y += titleSize.height + borderSize.height; _border_rect.size.height -= titleSize.height + borderSize.height; // Add the offsets to the border rect r.origin.x = _border_rect.origin.x + _offsets.width + borderSize.width; r.origin.y = _border_rect.origin.y + _offsets.height + borderSize.height; r.size.width = _border_rect.size.width - (2 * _offsets.width) - (2 * borderSize.width); r.size.height = _border_rect.size.height - (2 * _offsets.height) - (2 * borderSize.height); // center the title cell c = (_border_rect.size.width - titleSize.width) / 2; if (c < 0) c = 0; _title_rect.origin.x = c; _title_rect.origin.y = 0; _title_rect.size = titleSize; break; } case NSAboveBottom: { NSSize titleSize = [_cell cellSize]; NSSize borderSize = [theme sizeForBorderType: _border_type]; float c; // Add spacer around title titleSize.width += 6; titleSize.height += 2; _border_rect = _bounds; // Add the offsets to the border rect r.origin.x = _border_rect.origin.x + _offsets.width + borderSize.width; r.origin.y = _border_rect.origin.y + _offsets.height + borderSize.height; r.size.width = _border_rect.size.width - (2 * _offsets.width) - (2 * borderSize.width); r.size.height = _border_rect.size.height - (2 * _offsets.height) - (2 * borderSize.height); // Adjust by the title size r.origin.y += titleSize.height + borderSize.height; r.size.height -= titleSize.height + borderSize.height; // center the title cell c = (_border_rect.size.width - titleSize.width) / 2; if (c < 0) c = 0; _title_rect.origin.x = _border_rect.origin.x + c; _title_rect.origin.y = _border_rect.origin.y + borderSize.height; _title_rect.size = titleSize; break; } } if (!aFlag) { if (r.size.width < 0) { r.size.width = 0; } if (r.size.height < 0) { r.size.height = 0; } } return r; } @end gnustep-gui-0.24.0/Source/NSTextView_actions.m0000664000076500007650000012240212107776031021125 0ustar brains99brains99/** NSTextView Categories which add user actions to NSTextView Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Originally moved here from NSTextView.m. Author: Scott Christley Date: 1996 Author: Felipe A. Rodriguez Date: July 1998 Author: Daniel Böhringer Date: August 1998 Author: Fred Kiefer Date: March 2000, September 2000 Author: Nicola Pero Date: 2000, 2001, 2002 Author: Pierre-Yves Rivaille Date: September 2002 Extensive reworking: Alexander Malmberg Date: December 2002 - February 2003 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import "AppKit/NSAttributedString.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSLayoutManager.h" #import "AppKit/NSPasteboard.h" #import "AppKit/NSScrollView.h" #import "AppKit/NSTextStorage.h" #import "AppKit/NSTextView.h" #import "AppKit/NSParagraphStyle.h" /* These methods are for user actions, ie. they are normally called from -doCommandBySelector: (which is called by the input manager) in response to some key press or other user event. User actions that modify the text must check that a modification is allowed and make sure all necessary notifications are sent. This is done by sending -shouldChangeTextInRange:replacementString: before making any changes, and (if the change is allowed) -didChangeText after the changes have been made. All actions from NSResponder that make sense for a text view should be implemented here, but this is _not_ the place to add new actions. When changing attributes, the range returned by rangeForUserCharacterAttributeChange or rangeForUserParagraphAttributeChange should be used. If the location is NSNotFound, nothing should be done (in particular, the typing attributes should _not_ be changed). Otherwise, -shouldChangeTextInRange:replacementString: should be called, and if it returns YES, the attributes of the range and the typing attributes should be changed, and -didChangeText should be called. In a non-rich-text text view, the typing attributes _must_always_ hold the attributes of the text. Thus, the typing attributes must always be changed in the same way that the attributes of the text are changed. TODO: can the selected range's location be NSNotFound? when? Not all user actions are here. Exceptions: -copy: -copyFont: -copyRuler: -paste: -pasteFont: -pasteRuler: -pasteAsPlainText: -pasteAsRichText: -checkSpelling: -showGuessPanel: -selectAll: (implemented in NSText) Not all methods that handle user-induced text modifications are here. Exceptions: (TODO) -insertText: -changeColor: -changeFont: (action method?) drag&drop handling methods (others?) All other methods that modify text are for programmatic changes and do not send -shouldChangeTextInRange:replacementString: or -didChangeText. */ /* global kill buffer shared between all text views */ /* Note: I'm not using an attributed string here because Apple apparently is using a plain string either. Maybe this is because NeXT was using the X11 cut buffer for the kill buffer, which can hold only plain strings? */ static NSString *killBuffer = @""; /** First some helpers **/ @interface NSTextView (UserActionHelpers) -(void) _illegalMovement: (int)textMovement; -(void) _changeAttribute: (NSString *)name inRange: (NSRange)r using: (NSNumber*(*)(NSNumber*))func; @end @implementation NSTextView (UserActionHelpers) - (void) _illegalMovement: (int)textMovement { /* This is similar to [self resignFirstResponder], with the difference that in the notification we need to put the NSTextMovement, which resignFirstResponder does not. Also, if we are ending editing, we are going to be removed, so it's useless to update any drawing. Please note that this ends up calling resignFirstResponder anyway. */ NSNumber *number; NSDictionary *uiDictionary; if ((_tf.is_editable) && ([_delegate respondsToSelector: @selector(textShouldEndEditing:)]) && ([_delegate textShouldEndEditing: self] == NO)) return; /* TODO: insertion point. doesn't the -resignFirstResponder take care of that? */ number = [NSNumber numberWithInt: textMovement]; uiDictionary = [NSDictionary dictionaryWithObject: number forKey: @"NSTextMovement"]; [[NSNotificationCenter defaultCenter] postNotificationName: NSTextDidEndEditingNotification object: self userInfo: uiDictionary]; /* The TextField will get the notification, and drop our first responder * status if it's the case ... in that case, our -resignFirstResponder will * be called! */ return; } - (void) _changeAttribute: (NSString *)name inRange: (NSRange)r using: (NSNumber*(*)(NSNumber*))func { NSUInteger i; NSRange e, r2; id current, new; if (![self shouldChangeTextInRange: r replacementString: nil]) return; [_textStorage beginEditing]; for (i = r.location; i < NSMaxRange(r);) { current = [_textStorage attribute: name atIndex: i effectiveRange: &e]; r2 = NSMakeRange(i, NSMaxRange(e) - i); r2 = NSIntersectionRange(r2, r); i = NSMaxRange(e); new = func(current); if (new != current) { if (!new) { [_textStorage removeAttribute: name range: r2]; } else { [_textStorage addAttribute: name value: new range: r2]; } } } [_textStorage endEditing]; current = [_layoutManager->_typingAttributes objectForKey: name]; new = func(current); if (new != current) { if (!new) { [_layoutManager->_typingAttributes removeObjectForKey: name]; } else { [_layoutManager->_typingAttributes setObject: new forKey: name]; } } [self didChangeText]; } @end @implementation NSTextView (UserActions) /* Helpers used with _changeAttribute:inRange:using:. */ static NSNumber *int_minus_one(NSNumber *cur) { int value; if (cur) value = [cur intValue] - 1; else value = -1; if (value) return [NSNumber numberWithInt: value]; else return nil; } static NSNumber *int_plus_one(NSNumber *cur) { int value; if (cur) value = [cur intValue] + 1; else value = 1; if (value) return [NSNumber numberWithInt: value]; else return nil; } static NSNumber *float_minus_one(NSNumber *cur) { float value; if (cur) value = [cur floatValue] - 1; else value = -1; if (value) return [NSNumber numberWithFloat: value]; else return nil; } static NSNumber *float_plus_one(NSNumber *cur) { int value; if (cur) value = [cur floatValue] + 1; else value = 1; if (value) return [NSNumber numberWithFloat: value]; else return nil; } - (void) subscript: (id)sender { NSRange r = [self rangeForUserCharacterAttributeChange]; if (r.location == NSNotFound) return; [self _changeAttribute: NSSuperscriptAttributeName inRange: r using: int_minus_one]; } - (void) superscript: (id)sender { NSRange r = [self rangeForUserCharacterAttributeChange]; if (r.location == NSNotFound) return; [self _changeAttribute: NSSuperscriptAttributeName inRange: r using: int_plus_one]; } - (void) lowerBaseline: (id)sender { NSRange r = [self rangeForUserCharacterAttributeChange]; if (r.location == NSNotFound) return; [self _changeAttribute: NSBaselineOffsetAttributeName inRange: r using: float_plus_one]; } - (void) raiseBaseline: (id)sender { NSRange r = [self rangeForUserCharacterAttributeChange]; if (r.location == NSNotFound) return; [self _changeAttribute: NSBaselineOffsetAttributeName inRange: r using: float_minus_one]; } - (void) unscript: (id)sender { NSRange aRange = [self rangeForUserCharacterAttributeChange]; if (aRange.location == NSNotFound) return; if (![self shouldChangeTextInRange: aRange replacementString: nil]) return; if (aRange.length) { [_textStorage beginEditing]; [_textStorage removeAttribute: NSSuperscriptAttributeName range: aRange]; [_textStorage removeAttribute: NSBaselineOffsetAttributeName range: aRange]; [_textStorage endEditing]; } [_layoutManager->_typingAttributes removeObjectForKey: NSSuperscriptAttributeName]; [_layoutManager->_typingAttributes removeObjectForKey: NSBaselineOffsetAttributeName]; [self didChangeText]; } - (void) underline: (id)sender { BOOL doUnderline = YES; NSRange aRange = [self rangeForUserCharacterAttributeChange]; if (aRange.location == NSNotFound) return; if ([[_textStorage attribute: NSUnderlineStyleAttributeName atIndex: aRange.location effectiveRange: NULL] intValue]) doUnderline = NO; if (aRange.length) { if (![self shouldChangeTextInRange: aRange replacementString: nil]) return; [_textStorage beginEditing]; [_textStorage addAttribute: NSUnderlineStyleAttributeName value: [NSNumber numberWithInt: doUnderline] range: aRange]; [_textStorage endEditing]; [self didChangeText]; } [_layoutManager->_typingAttributes setObject: [NSNumber numberWithInt: doUnderline] forKey: NSUnderlineStyleAttributeName]; } - (void) useStandardKerning: (id)sender { NSRange aRange = [self rangeForUserCharacterAttributeChange]; if (aRange.location == NSNotFound) return; if (![self shouldChangeTextInRange: aRange replacementString: nil]) return; [_textStorage removeAttribute: NSKernAttributeName range: aRange]; [_layoutManager->_typingAttributes removeObjectForKey: NSKernAttributeName]; [self didChangeText]; } - (void) turnOffKerning: (id)sender { NSRange aRange = [self rangeForUserCharacterAttributeChange]; if (aRange.location == NSNotFound) return; if (![self shouldChangeTextInRange: aRange replacementString: nil]) return; [_textStorage addAttribute: NSKernAttributeName value: [NSNumber numberWithFloat: 0.0] range: aRange]; [_layoutManager->_typingAttributes setObject: [NSNumber numberWithFloat: 0.0] forKey: NSKernAttributeName]; [self didChangeText]; } - (void) loosenKerning: (id)sender { NSRange r = [self rangeForUserCharacterAttributeChange]; if (r.location == NSNotFound) return; [self _changeAttribute: NSKernAttributeName inRange: r using: float_plus_one]; } - (void) tightenKerning: (id)sender { NSRange r = [self rangeForUserCharacterAttributeChange]; if (r.location == NSNotFound) return; [self _changeAttribute: NSKernAttributeName inRange: r using: float_minus_one]; } - (void) turnOffLigatures: (id)sender { NSRange aRange = [self rangeForUserCharacterAttributeChange]; if (aRange.location == NSNotFound) return; if (![self shouldChangeTextInRange: aRange replacementString: nil]) return; [_textStorage addAttribute: NSLigatureAttributeName value: [NSNumber numberWithInt: 0] range: aRange]; [_layoutManager->_typingAttributes setObject: [NSNumber numberWithInt: 0] forKey: NSLigatureAttributeName]; [self didChangeText]; } - (void) useStandardLigatures: (id)sender { NSRange aRange = [self rangeForUserCharacterAttributeChange]; if (aRange.location == NSNotFound) return; if (![self shouldChangeTextInRange: aRange replacementString: nil]) return; [_textStorage removeAttribute: NSLigatureAttributeName range: aRange]; [_layoutManager->_typingAttributes removeObjectForKey: NSLigatureAttributeName]; [self didChangeText]; } - (void) useAllLigatures: (id)sender { NSRange aRange = [self rangeForUserCharacterAttributeChange]; if (aRange.location == NSNotFound) return; if (![self shouldChangeTextInRange: aRange replacementString: nil]) return; [_textStorage addAttribute: NSLigatureAttributeName value: [NSNumber numberWithInt: 2] range: aRange]; [_layoutManager->_typingAttributes setObject: [NSNumber numberWithInt: 2] forKey: NSLigatureAttributeName]; [self didChangeText]; } - (void) toggleTraditionalCharacterShape: (id)sender { // TODO NSLog(@"Method %s is not implemented for class %s", "toggleTraditionalCharacterShape:", "NSTextView"); } - (void) insertNewline: (id)sender { if (_tf.is_field_editor) { [self _illegalMovement: NSReturnTextMovement]; return; } [self insertText: @"\n"]; } - (void) insertTab: (id)sender { if (_tf.is_field_editor) { [self _illegalMovement: NSTabTextMovement]; return; } [self insertText: @"\t"]; } - (void) insertBacktab: (id)sender { if (_tf.is_field_editor) { [self _illegalMovement: NSBacktabTextMovement]; return; } /* TODO */ //[self insertText: @"\t"]; } - (void) insertNewlineIgnoringFieldEditor: (id)sender { [self insertText: @"\n"]; } - (void) insertTabIgnoringFieldEditor: (id)sender { [self insertText: @"\t"]; } - (void) insertContainerBreak: (id)sender { unichar ch = NSFormFeedCharacter; [self insertText: [NSString stringWithCharacters: &ch length: 1]]; } - (void) insertLineBreak: (id)sender { unichar ch = NSLineSeparatorCharacter; [self insertText: [NSString stringWithCharacters: &ch length: 1]]; } - (void) deleteForward: (id)sender { NSRange range = [self rangeForUserTextChange]; NSDictionary *attributes; if (range.location == NSNotFound) { return; } /* Manage case of insertion point - implicitly means to delete following character */ if (range.length == 0) { if (range.location != [_textStorage length]) { /* Not at the end of text -- delete following character */ range.length = 1; } else { /* At the end of text - TODO: Make beeping or not beeping configurable vie User Defaults */ NSBeep (); return; } } else if ([self smartInsertDeleteEnabled] && [self selectionGranularity] == NSSelectByWord) { range = [self smartDeleteRangeForProposedRange: range]; } if (![self shouldChangeTextInRange: range replacementString: @""]) { return; } attributes = RETAIN([_textStorage attributesAtIndex: range.location effectiveRange: NULL]); [_textStorage beginEditing]; [_textStorage deleteCharactersInRange: range]; [_textStorage endEditing]; [self setTypingAttributes: attributes]; RELEASE(attributes); [self didChangeText]; } - (void) deleteBackward: (id)sender { NSRange range = [self rangeForUserTextChange]; NSDictionary *attributes; if (range.location == NSNotFound) { return; } /* Manage case of insertion point - implicitly means to delete previous character */ if (range.length == 0) { if (range.location != 0) { /* Not at the beginning of text -- delete previous character */ range.location -= 1; range.length = 1; } else { /* At the beginning of text - TODO: Make beeping or not beeping configurable via User Defaults */ NSBeep (); return; } } else if ([self smartInsertDeleteEnabled] && [self selectionGranularity] == NSSelectByWord) { range = [self smartDeleteRangeForProposedRange: range]; } if (![self shouldChangeTextInRange: range replacementString: @""]) { return; } attributes = RETAIN([_textStorage attributesAtIndex: range.location effectiveRange: NULL]); [_textStorage beginEditing]; [_textStorage deleteCharactersInRange: range]; [_textStorage endEditing]; [self setTypingAttributes: attributes]; RELEASE(attributes); [self didChangeText]; } - (void) deleteToEndOfLine: (id)sender { NSRange range = [self rangeForUserTextChange]; NSDictionary *attributes; if (range.location == NSNotFound) { return; } /* If the selection is not empty delete it, otherwise delete up to the next line end from the insertion point or the delete the line end itself when the insertion point is already at the end of the line. */ if (range.length == 0) { NSUInteger start, end, contentsEnd; [[_textStorage string] getLineStart: &start end: &end contentsEnd: &contentsEnd forRange: range]; if (range.location == contentsEnd) { range = NSMakeRange(contentsEnd, end - contentsEnd); } else { range.length = contentsEnd - range.location; } if (range.length == 0) { return; } } if (![self shouldChangeTextInRange: range replacementString: @""]) { return; } ASSIGN(killBuffer, [[_textStorage string] substringWithRange: range]); attributes = RETAIN([_textStorage attributesAtIndex: range.location effectiveRange: NULL]); [_textStorage beginEditing]; [_textStorage deleteCharactersInRange: range]; [_textStorage endEditing]; [self setTypingAttributes: attributes]; RELEASE(attributes); [self didChangeText]; } - (void) deleteToEndOfParagraph: (id)sender { NSRange range = [self rangeForUserTextChange]; NSDictionary *attributes; if (range.location == NSNotFound) { return; } /* If the selection is not empty delete it, otherwise delete up to the next paragraph end from the insertion point or the delete the paragraph end itself when the insertion point is already at the end of the paragraph. */ if (range.length == 0) { NSUInteger start, end, contentsEnd; [[_textStorage string] getParagraphStart: &start end: &end contentsEnd: &contentsEnd forRange: range]; if (range.location == contentsEnd) { range = NSMakeRange(contentsEnd, end - contentsEnd); } else { range.length = contentsEnd - range.location; } if (range.length == 0) { return; } } if (![self shouldChangeTextInRange: range replacementString: @""]) { return; } ASSIGN(killBuffer, [[_textStorage string] substringWithRange: range]); attributes = RETAIN([_textStorage attributesAtIndex: range.location effectiveRange: NULL]); [_textStorage beginEditing]; [_textStorage deleteCharactersInRange: range]; [_textStorage endEditing]; [self setTypingAttributes: attributes]; RELEASE(attributes); [self didChangeText]; } - (void) yank: (id)sender { if ([killBuffer length] > 0) { [self insertText: killBuffer]; } } /* TODO: find out what affinity is supposed to mean My current assumption: Affinity deals with which direction we are selecting in, ie. which end of the selected range is the moving end, and which is the anchor. NSSelectionAffinityUpstream means that the minimum index of the selected range is moving (ie. _selected_range.location). NSSelectionAffinityDownstream means that the maximum index of the selected range is moving (ie. _selected_range.location+_selected_range.length). Thus, when moving and selecting, we use the affinity to find out which end of the selected range to move, and after moving, we compare the character index we moved to with the anchor and set the range and affinity. The affinity is important when making keyboard selection have sensible behavior. Example: If, in the string "abcd", the insertion point is between the "c" and the "d" (selected range is (3,0)), and the user hits shift-left twice, we select the "c" and "b" (1,2) and set the affinity to NSSelectionAffinityUpstream. If the user hits shift-right, only the "c" will be selected (2,1). If the insertion point is between the "a" and the "b" (1,0) and the user hits shift-right twice, we again select the "b" and "c" (1,2), but the affinity is NSSelectionAffinityDownstream. If the user hits shift-right, the "d" is added to the selection (1,3). */ - (unsigned int) _movementOrigin { NSRange range = [self selectedRange]; if ([self selectionAffinity] == NSSelectionAffinityUpstream) return range.location; else return NSMaxRange(range); } - (NSUInteger) _movementEnd { NSRange range = [self selectedRange]; if ([self selectionAffinity] == NSSelectionAffinityDownstream) return range.location; else return NSMaxRange(range); } - (void) _moveTo: (NSUInteger)cindex select: (BOOL)select { if (select) { NSUInteger anchor = [self _movementEnd]; if (anchor < cindex) { [self setSelectedRange: NSMakeRange(anchor, cindex - anchor) affinity: NSSelectionAffinityDownstream stillSelecting: NO]; } else { [self setSelectedRange: NSMakeRange(cindex, anchor - cindex) affinity: NSSelectionAffinityUpstream stillSelecting: NO]; } } else { [self setSelectedRange: NSMakeRange(cindex, 0)]; } [self scrollRangeToVisible: NSMakeRange(cindex, 0)]; } - (void) _moveFrom: (NSUInteger)cindex direction: (GSInsertionPointMovementDirection)direction distance: (CGFloat)distance select: (BOOL)select { int new_direction; if (direction == GSInsertionPointMoveUp || direction == GSInsertionPointMoveDown) { new_direction = 2; } else if (direction == GSInsertionPointMoveLeft || direction == GSInsertionPointMoveRight) { new_direction = 1; } else { new_direction = 0; } if (new_direction != _currentInsertionPointMovementDirection || !new_direction) { _originalInsertionPointCharacterIndex = cindex; } cindex = [_layoutManager characterIndexMoving: direction fromCharacterIndex: cindex originalCharacterIndex: _originalInsertionPointCharacterIndex distance: distance]; [self _moveTo: cindex select: select]; /* Setting the selected range will clear out the current direction, but not the index. Thus, we always set the direction here. */ _currentInsertionPointMovementDirection = new_direction; } - (void) _move: (GSInsertionPointMovementDirection)direction distance: (CGFloat)distance select: (BOOL)select { [self _moveFrom: [self _movementOrigin] direction: direction distance: distance select: select]; } /* * returns the character index for the left or right side of the selected text * based upon the writing direction of the paragraph style. * it should only be used when moving a literal direction such as left right * up or down, not directions like forward, backward, beginning or end */ - (NSUInteger) _characterIndexForSelectedRange: (NSRange)range direction: (GSInsertionPointMovementDirection)direction { NSUInteger cIndex; NSParagraphStyle *parStyle; NSWritingDirection writingDirection; parStyle = [[self typingAttributes] objectForKey: NSParagraphStyleAttributeName]; writingDirection = [parStyle baseWritingDirection]; switch (writingDirection) { case NSWritingDirectionLeftToRight: cIndex = (direction == GSInsertionPointMoveLeft || direction == GSInsertionPointMoveUp) ? range.location : NSMaxRange(range); break; case NSWritingDirectionRightToLeft: cIndex = (direction == GSInsertionPointMoveLeft || direction == GSInsertionPointMoveUp) ? NSMaxRange(range) : range.location; break; case NSWritingDirectionNaturalDirection: // not sure if we should see this as it should resolve to either // LeftToRight or RightToLeft in NSParagraphStyle // for the users language. // // currently falls back to default.. default: /* default to LeftToRight */ cIndex = (direction == GSInsertionPointMoveLeft || direction == GSInsertionPointMoveUp) ? range.location : NSMaxRange(range); break; } return cIndex; } /* Insertion point movement actions. TODO: some of these used to do nothing if self is a field editor. should check if there was a reason for that. */ - (void) moveUp: (id)sender { NSRange range = [self selectedRange]; NSUInteger cIndex = [self _characterIndexForSelectedRange:range direction:GSInsertionPointMoveUp]; [self _moveFrom: cIndex direction: GSInsertionPointMoveUp distance: 0.0 select: NO]; } - (void) moveUpAndModifySelection: (id)sender { [self _move: GSInsertionPointMoveUp distance: 0.0 select: YES]; } - (void) moveDown: (id)sender { NSRange range = [self selectedRange]; NSUInteger cIndex = [self _characterIndexForSelectedRange: range direction: GSInsertionPointMoveDown]; [self _moveFrom: cIndex direction: GSInsertionPointMoveDown distance: 0.0 select: NO]; } - (void) moveDownAndModifySelection: (id)sender { [self _move: GSInsertionPointMoveDown distance: 0.0 select: YES]; } - (void) moveLeft: (id)sender { NSRange range = [self selectedRange]; if (range.length) { NSUInteger cIndex; cIndex = [self _characterIndexForSelectedRange: range direction:GSInsertionPointMoveLeft]; [self _moveTo: cIndex select: NO]; } else { [self _move: GSInsertionPointMoveLeft distance: 0.0 select: NO]; } } - (void) moveLeftAndModifySelection: (id)sender { NSParagraphStyle *parStyle; NSWritingDirection writingDirection; parStyle = [[self typingAttributes] objectForKey: NSParagraphStyleAttributeName]; writingDirection = [parStyle baseWritingDirection]; if (writingDirection == NSWritingDirectionRightToLeft) { [self moveForwardAndModifySelection: sender]; } else { [self moveBackwardAndModifySelection: sender]; } } - (void) moveRight: (id)sender { NSRange range = [self selectedRange]; if (range.length) { NSUInteger cIndex; cIndex = [self _characterIndexForSelectedRange: range direction: GSInsertionPointMoveRight]; [self _moveTo: cIndex select: NO]; } else { [self _move: GSInsertionPointMoveRight distance: 0.0 select: NO]; } } - (void) moveRightAndModifySelection: (id)sender { NSParagraphStyle *parStyle; NSWritingDirection writingDirection; parStyle = [[self typingAttributes] objectForKey: NSParagraphStyleAttributeName]; writingDirection = [parStyle baseWritingDirection]; if (writingDirection == NSWritingDirectionRightToLeft) { [self moveBackwardAndModifySelection: sender]; } else { [self moveForwardAndModifySelection: sender]; } } - (void) moveBackward: (id)sender { NSRange range = [self selectedRange]; NSUInteger to = range.location; if (range.length == 0 && to) { to--; } [self _moveTo: to select: NO]; } - (void) moveBackwardAndModifySelection: (id)sender { NSUInteger to = [self _movementOrigin]; if (to == 0) return; to--; [self _moveTo: to select: YES]; } - (void) moveForward: (id)sender { NSRange range = [self selectedRange]; NSUInteger to = NSMaxRange(range); if (range.length == 0 && to != [_textStorage length]) { to++; } [self _moveTo: to select: NO]; } - (void) moveForwardAndModifySelection: (id)sender { NSUInteger to = [self _movementOrigin]; if (to == [_textStorage length]) return; to++; [self _moveTo: to select: YES]; } - (void) moveWordBackward: (id)sender { NSRange range = [self selectedRange]; NSUInteger newLocation; NSUInteger cIndex = range.location; newLocation = [_textStorage nextWordFromIndex: cIndex forward: NO]; [self _moveTo: newLocation select: NO]; } - (void) moveWordBackwardAndModifySelection: (id)sender { NSUInteger newLocation; newLocation = [_textStorage nextWordFromIndex: [self _movementOrigin] forward: NO]; [self _moveTo: newLocation select: YES]; } - (void) moveWordForward: (id)sender { NSUInteger newLocation; NSUInteger cIndex = NSMaxRange([self selectedRange]); newLocation = [_textStorage nextWordFromIndex: cIndex forward: YES]; [self _moveTo: newLocation select: NO]; } - (void) moveWordForwardAndModifySelection: (id)sender { NSUInteger newLocation; newLocation = [_textStorage nextWordFromIndex: [self _movementOrigin] forward: YES]; [self _moveTo: newLocation select: YES]; } - (void) moveWordLeft: (id)sender { NSParagraphStyle *parStyle; NSWritingDirection writingDirection; parStyle = [[self typingAttributes] objectForKey: NSParagraphStyleAttributeName]; writingDirection = [parStyle baseWritingDirection]; if (writingDirection == NSWritingDirectionRightToLeft) { [self moveWordForward: sender]; } else { [self moveWordBackward: sender]; } } - (void) moveWordLeftAndModifySelection: (id)sender { NSParagraphStyle *parStyle; NSWritingDirection writingDirection; parStyle = [[self typingAttributes] objectForKey: NSParagraphStyleAttributeName]; writingDirection = [parStyle baseWritingDirection]; if (writingDirection == NSWritingDirectionRightToLeft) { [self moveWordForwardAndModifySelection: sender]; } else { [self moveWordBackwardAndModifySelection: sender]; } } - (void) moveWordRight: (id)sender { NSParagraphStyle *parStyle; NSWritingDirection writingDirection; parStyle = [[self typingAttributes] objectForKey: NSParagraphStyleAttributeName]; writingDirection = [parStyle baseWritingDirection]; if (writingDirection == NSWritingDirectionRightToLeft) { [self moveWordBackward: sender]; } else { [self moveWordForward: sender]; } } - (void) moveWordRightAndModifySelection: (id)sender { NSParagraphStyle *parStyle; NSWritingDirection writingDirection; parStyle = [[self typingAttributes] objectForKey: NSParagraphStyleAttributeName]; writingDirection = [parStyle baseWritingDirection]; if (writingDirection == NSWritingDirectionRightToLeft) { [self moveWordBackwardAndModifySelection: sender]; } else { [self moveWordForwardAndModifySelection: sender]; } } - (void) moveToBeginningOfDocument: (id)sender { [self _moveTo: 0 select: NO]; } - (void) moveToBeginningOfDocumentAndModifySelection: (id)sender { [self _moveTo: 0 select:YES]; } - (void) moveToEndOfDocument: (id)sender { [self _moveTo: [_textStorage length] select: NO]; } - (void) moveToEndOfDocumentAndModifySelection: (id)sender { [self _moveTo: [_textStorage length] select:YES]; } - (void) moveToBeginningOfParagraph: (id)sender { NSRange aRange = [self selectedRange]; aRange = [[_textStorage string] lineRangeForRange: NSMakeRange(aRange.location, 0)]; [self _moveTo: aRange.location select: NO]; } - (void) moveToBeginningOfParagraphAndModifySelection: (id)sender { NSRange aRange; aRange = [[_textStorage string] lineRangeForRange: NSMakeRange([self _movementOrigin], 0)]; [self _moveTo: aRange.location select: YES]; } - (void) _moveToEndOfParagraph: (id)sender modify:(BOOL)flag { NSRange aRange; NSUInteger newLocation; NSUInteger maxRange; NSUInteger cIndex; if (flag) { cIndex = [self _movementOrigin]; } else { cIndex = NSMaxRange([self selectedRange]); } aRange = [[_textStorage string] lineRangeForRange: NSMakeRange(cIndex, 0)]; maxRange = NSMaxRange (aRange); if (maxRange == 0) { /* Beginning of text is special only for technical reasons - since maxRange is an unsigned, we can't safely subtract 1 from it if it is 0. */ newLocation = maxRange; } else if (maxRange == [_textStorage length]) { /* End of text is special - we want the insertion point to appear *after* the last character, which means as if before the next (virtual) character after the end of text ... unless the last character is a newline, and we are trying to go to the end of the line which is displayed as the one-before-the-last. Please note (maxRange - 1) is a valid char since the maxRange == 0 case has already been eliminated. */ unichar u = [[_textStorage string] characterAtIndex: (maxRange - 1)]; if (u == '\n' || u == '\r') { newLocation = maxRange - 1; } else { newLocation = maxRange; } } else { /* Else, we want the insertion point to appear before the last character in the paragraph range. Normally the last character in the paragraph range is a newline. */ newLocation = maxRange - 1; } if (newLocation < aRange.location) { newLocation = aRange.location; } [self _moveTo: newLocation select: flag]; } - (void) moveToEndOfParagraph: (id)sender { [self _moveToEndOfParagraph:sender modify:NO]; } - (void) moveToEndOfParagraphAndModifySelection: (id)sender { [self _moveToEndOfParagraph:sender modify:YES]; } /* TODO: this is only the beginning and end of lines if lines are horizontal and layout is left-to-right */ - (void) moveToBeginningOfLine: (id)sender { NSRange range = [self selectedRange]; NSUInteger cIndex = range.location; [self _moveFrom: cIndex direction: GSInsertionPointMoveLeft distance: 1e8 select: NO]; } - (void) moveToBeginningOfLineAndModifySelection: (id)sender { [self _move: GSInsertionPointMoveLeft distance: 1e8 select: YES]; } - (void) moveToEndOfLine: (id)sender { NSUInteger cIndex = NSMaxRange([self selectedRange]); [self _moveFrom: cIndex direction: GSInsertionPointMoveRight distance: 1e8 select: NO]; } - (void) moveToEndOfLineAndModifySelection: (id)sender { [self _move: GSInsertionPointMoveRight distance: 1e8 select: YES]; } /** * Tries to move the selection/insertion point down one page of the * visible rect in the receiver while trying to maintain the * horizontal position of the last vertical movement. * If the receiver is a field editor, this method returns immediatly. */ - (void) _pageDown: (id)sender modify: (BOOL)flag { CGFloat scrollDelta; CGFloat oldOriginY; CGFloat newOriginY; NSUInteger cIndex; if (flag) { cIndex = [self _movementOrigin]; } else { cIndex = [self _characterIndexForSelectedRange: [self selectedRange] direction: GSInsertionPointMoveDown]; } /* * Scroll; also determine how far to move the insertion point. */ oldOriginY = NSMinY([self visibleRect]); [[self enclosingScrollView] pageDown: sender]; newOriginY = NSMinY([self visibleRect]); scrollDelta = newOriginY - oldOriginY; if (scrollDelta == 0) { [self _moveTo:[_textStorage length] select:flag]; return; } [self _moveFrom: cIndex direction: GSInsertionPointMoveDown distance: scrollDelta select: flag]; } - (void) pageDown:(id)sender { [self _pageDown:sender modify:NO]; } - (void) pageDownAndModifySelection:(id)sender { [self _pageDown:sender modify:YES]; } /** * Tries to move the selection/insertion point up one page of the * visible rect in the receiver while trying to maintain the * horizontal position of the last vertical movement. * If the receiver is a field editor, this method returns immediatly. */ - (void) _pageUp: (id)sender modify:(BOOL)flag { CGFloat scrollDelta; CGFloat oldOriginY; CGFloat newOriginY; NSUInteger cIndex; if (flag) { cIndex = [self _movementOrigin]; } else { cIndex = [self _characterIndexForSelectedRange:[self selectedRange] direction: GSInsertionPointMoveUp]; } /* * Scroll; also determine how far to move the insertion point. */ oldOriginY = NSMinY([self visibleRect]); [[self enclosingScrollView] pageUp: sender]; newOriginY = NSMinY([self visibleRect]); scrollDelta = newOriginY - oldOriginY; if (scrollDelta == 0) { [self _moveTo:0 select:flag]; return; } [self _moveFrom: cIndex direction: GSInsertionPointMoveUp distance: -scrollDelta select: flag]; } - (void) pageUp:(id)sender { [self _pageUp:sender modify:NO]; } - (void) pageUpAndModifySelection:(id)sender { [self _pageUp:sender modify:YES]; } - (void) scrollLineDown: (id)sender { [[self enclosingScrollView] scrollLineDown: sender]; } - (void) scrollLineUp: (id)sender { [[self enclosingScrollView] scrollLineUp: sender]; } - (void) scrollPageDown: (id)sender { [[self enclosingScrollView] scrollPageDown: sender]; } - (void) scrollPageUp: (id)sender { [[self enclosingScrollView] scrollPageUp: sender]; } - (void) scrollToBeginningOfDocument: (id)sender { [[self enclosingScrollView] scrollToBeginningOfDocument: sender]; } - (void) scrollToEndOfDocument: (id)sender { [[self enclosingScrollView] scrollToEndOfDocument: sender]; } - (void) centerSelectionInVisibleArea: (id)sender { NSRange range; NSPoint new; NSRect rect, vRect; vRect = [self visibleRect]; range = [self selectedRange]; if (range.length == 0) { rect = [_layoutManager insertionPointRectForCharacterIndex: range.location inTextContainer: _textContainer]; } else { range = [_layoutManager glyphRangeForCharacterRange: range actualCharacterRange: NULL]; rect = [_layoutManager boundingRectForGlyphRange: range inTextContainer: _textContainer]; } if (NSWidth(_bounds) <= NSWidth(vRect)) new.x = 0; else if (NSWidth(rect) > NSWidth(vRect)) new.x = NSMinX(rect); else new.x = NSMinX(rect) - (NSWidth(vRect) - NSWidth(rect)) / 2; if (NSHeight(_bounds) <= NSHeight(vRect)) new.y = 0; else if (NSHeight(rect) > NSHeight(vRect)) new.y = NSMinY(rect); else new.y = NSMinY(rect) - (NSHeight(vRect) - NSHeight(rect)) / 2; [self scrollPoint: new]; } /* -selectAll: inherited from NSText */ - (void) selectLine: (id)sender { NSUInteger start, end, cindex; cindex = [self _movementOrigin]; start = [_layoutManager characterIndexMoving: GSInsertionPointMoveLeft fromCharacterIndex: cindex originalCharacterIndex: cindex distance: 1e8]; end = [_layoutManager characterIndexMoving: GSInsertionPointMoveRight fromCharacterIndex: cindex originalCharacterIndex: cindex distance: 1e8]; [self setSelectedRange: NSMakeRange(start, end - start)]; } /* The following method is bound to 'Control-t', and works exactly like * pressing 'Control-t' inside Emacs, i.e., in general it swaps the * character immediately before and after the insertion point and moves * the insertion point forward by one character. If, however, the * insertion point is at the end of a line, it swaps the two characters * before the insertion point and does not move the insertion point. * Note that Mac OS X does not implement the special case at the end * of a line, but I consider Emacs' behavior more useful. */ - (void) transpose: (id)sender { NSRange range = [self selectedRange]; NSString *string; NSString *replacementString; unichar chars[2]; /* Do nothing if the selection is not empty or if we are at the * beginning of text. */ if (range.length > 0 || range.location < 1) { return; } range = NSMakeRange(range.location - 1, 2); /* Eventually adjust the range if we are at the end of a line. */ string = [_textStorage string]; if (range.location + 1 == [string length] || [string characterAtIndex: range.location + 1] == '\n') { if (range.location == 0) return; range.location -= 1; } /* Get the two chars and swap them. */ chars[1] = [string characterAtIndex: range.location]; chars[0] = [string characterAtIndex: (range.location + 1)]; /* Replace the original chars with the swapped ones. */ replacementString = [NSString stringWithCharacters: chars length: 2]; if ([self shouldChangeTextInRange: range replacementString: replacementString]) { [self replaceCharactersInRange: range withString: replacementString]; [self setSelectedRange: NSMakeRange(range.location + 2, 0)]; [self didChangeText]; } } - (void) delete: (id)sender { [self deleteForward: sender]; } /* Helper for -align*: */ - (void) _alignUser: (NSTextAlignment)alignment { NSRange r = [self rangeForUserParagraphAttributeChange]; if (r.location == NSNotFound) return; if (![self shouldChangeTextInRange: r replacementString: nil]) return; [self setAlignment: alignment range: r]; [self didChangeText]; } - (void) alignCenter: (id)sender { [self _alignUser: NSCenterTextAlignment]; } - (void) alignLeft: (id)sender { [self _alignUser: NSLeftTextAlignment]; } - (void) alignRight: (id)sender { [self _alignUser: NSRightTextAlignment]; } - (void) alignJustified: (id)sender { [self _alignUser: NSJustifiedTextAlignment]; } - (void) toggleContinuousSpellChecking: (id)sender { [self setContinuousSpellCheckingEnabled: ![self isContinuousSpellCheckingEnabled]]; } - (void) toggleRuler: (id)sender { [self setRulerVisible: !_tf.is_ruler_visible]; } - (void) outline: (id)sender { // FIXME } - (void) setBaseWritingDirection: (NSWritingDirection)direction range: (NSRange)range { if (!_tf.is_rich_text) return; [_textStorage setBaseWritingDirection: direction range: range]; } - (void) toggleBaseWritingDirection: (id)sender { // FIXME } @end gnustep-gui-0.24.0/Source/NSCursor.m0000664000076500007650000004055612207211572017107 0ustar brains99brains99/** NSCursor Holds an image to use as a cursor Copyright (C) 1996,1999,2001 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Adam Fedor Date: Dec 2001 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import "AppKit/NSColor.h" #import "AppKit/NSCursor.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSImage.h" #import "AppKit/NSBitmapImageRep.h" #import "GNUstepGUI/GSDisplayServer.h" // Class variables static NSMutableArray *gnustep_gui_cursor_stack; static NSCursor *gnustep_gui_current_cursor; static BOOL gnustep_gui_hidden_until_move; static Class NSCursor_class; static NSMutableDictionary *cursorDict = nil; @implementation NSCursor /* * Class methods */ + (void) initialize { if (self == [NSCursor class]) { // Initial version [self setVersion: 1]; // Initialize class variables NSCursor_class = self; gnustep_gui_cursor_stack = [[NSMutableArray alloc] initWithCapacity: 1]; gnustep_gui_hidden_until_move = NO; cursorDict = [NSMutableDictionary new]; [[self arrowCursor] set]; } } - (void *) _cid { return _cid; } - (void) _setCid: (void *)val { _cid = val; } - (void) _computeCid { void *c; if (_cursor_image == nil) { _cid = NULL; return; } [GSCurrentServer() imagecursor: _hot_spot : _cursor_image : &c]; _cid = c; } /**

Hides the current cursor.

*/ + (void) hide { [GSCurrentServer() hidecursor]; } /**

Pops the cursor off the top of the stack and makes the previous one as the current cursor.

*/ + (void) pop { /* * The object we pop is the current cursor */ if ([gnustep_gui_cursor_stack count] > 0) { NSCursor *c = RETAIN([gnustep_gui_cursor_stack lastObject]); [gnustep_gui_cursor_stack removeLastObject]; NSDebugLLog(@"NSCursor", @"Cursor pop"); [c set]; RELEASE(c); } } /**

Hides the cursor if flag is YES. Unhides it if NO

*/ + (void) setHiddenUntilMouseMoves: (BOOL)flag { if (flag) { [self hide]; } else { [self unhide]; } gnustep_gui_hidden_until_move = flag; } /**

Returns whther the cursor is hidden until mouse moves

*/ + (BOOL) isHiddenUntilMouseMoves { return gnustep_gui_hidden_until_move; } /**

Shows the NSCursor.

See Also: +hide

*/ + (void) unhide { [GSCurrentServer() showcursor]; } /* * Getting the Cursor */ static NSCursor *getStandardCursor(NSString *name, int style) { NSCursor *cursor = [cursorDict objectForKey: name]; if (cursor == nil) { void *c = NULL; cursor = [[NSCursor_class alloc] initWithImage: nil hotSpot: NSZeroPoint]; if (nil != cursor) { [GSCurrentServer() standardcursor: style : &c]; if (c == NULL) { /* There is no standard cursor with this name defined in the backend, so try an image with this name. */ [cursor setImage: [NSImage imageNamed: name]]; } else { [cursor _setCid: c]; } cursor->_cursor_flags.type = style; [cursorDict setObject: cursor forKey: name]; RELEASE(cursor); } } return cursor; } /**

Returns an arrow cursor.

*/ + (NSCursor*) arrowCursor { return getStandardCursor(@"GSArrowCursor", GSArrowCursor); } /**

Returns an I-beam cursor.

*/ + (NSCursor*) IBeamCursor { return getStandardCursor(@"GSIBeamCursor", GSIBeamCursor); } + (NSCursor*) closedHandCursor { return getStandardCursor(@"GSClosedHandCursor", GSClosedHandCursor); } + (NSCursor*) contextualMenuCursor { return getStandardCursor(@"GSContextualMenuCursor", GSContextualMenuCursor); } + (NSCursor*) crosshairCursor { return getStandardCursor(@"GSCrosshairCursor", GSCrosshairCursor); } + (NSCursor*) dragCopyCursor { return getStandardCursor(@"GSDragCopyCursor", GSDragCopyCursor); } + (NSCursor*) dragLinkCursor { return getStandardCursor(@"GSDragLinkCursor", GSDragLinkCursor); } + (NSCursor*) disappearingItemCursor { return getStandardCursor(@"GSDisappearingItemCursor", GSDisappearingItemCursor); } + (NSCursor*) openHandCursor { return getStandardCursor(@"GSOpenHandCursor", GSOpenHandCursor); } + (NSCursor*) operationNotAllowedCursor { return getStandardCursor(@"GSOperationNotAllowedCursor", GSOperationNotAllowedCursor); } + (NSCursor*) pointingHandCursor { return getStandardCursor(@"GSPointingHandCursor", GSPointingHandCursor); } + (NSCursor*) resizeDownCursor { return getStandardCursor(@"GSResizeDownCursor", GSResizeDownCursor); } + (NSCursor*) resizeLeftCursor { return getStandardCursor(@"GSResizeLeftCursor", GSResizeLeftCursor); } + (NSCursor*) resizeLeftRightCursor { return getStandardCursor(@"GSResizeLeftRightCursor", GSResizeLeftRightCursor); } + (NSCursor*) resizeRightCursor { return getStandardCursor(@"GSResizeRightCursor", GSResizeRightCursor); } + (NSCursor*) resizeUpCursor { return getStandardCursor(@"GSResizeUpCursor", GSResizeUpCursor); } + (NSCursor*) resizeUpDownCursor { return getStandardCursor(@"GSResizeUpDownCursor", GSResizeUpDownCursor); } /**

Returns the current cursor.

*/ + (NSCursor*) currentCursor { return gnustep_gui_current_cursor; } + (NSCursor*) currentSystemCursor { // FIXME return nil; } + (NSCursor*) greenArrowCursor { NSString *name = @"GSGreenArrowCursor"; NSCursor *cursor = [cursorDict objectForKey: name]; if (cursor == nil) { void *c; cursor = [[NSCursor_class alloc] initWithImage: nil hotSpot: NSZeroPoint]; [GSCurrentServer() standardcursor: GSArrowCursor : &c]; [GSCurrentServer() recolorcursor: [NSColor greenColor] : [NSColor blackColor] : c]; [cursor _setCid: c]; [cursorDict setObject: cursor forKey: name]; RELEASE(cursor); } return cursor; } /* * Initializing a New NSCursor Object */ - (id) init { return [self initWithImage: nil hotSpot: NSZeroPoint]; } /**

Initializes and returns a new NSCursor with a NSImage newImage and a hot spot point with x=0 and y=0 (top left corner).

See Also: -initWithImage:hotSpot:

*/ - (id) initWithImage: (NSImage *)newImage { return [self initWithImage: newImage hotSpot: NSZeroPoint]; } /**

Initializes and returns a new NSCursor with a NSImage newImage and the hot spot to hotSpot.

NB. The coordinate system of an NSCursor is flipped, so a hotSpot at 0,0 is in the top left corner of the cursor.

See Also: -initWithImage: -setImage:

*/ - (id) initWithImage: (NSImage *)newImage hotSpot: (NSPoint)hotSpot { //_cursor_flags.is_set_on_mouse_entered = NO; //_cursor_flags.is_set_on_mouse_exited = NO; _hot_spot = hotSpot; [self setImage: newImage]; return self; } - (id)initWithImage:(NSImage *)newImage foregroundColorHint:(NSColor *)fg backgroundColorHint:(NSColor *)bg hotSpot:(NSPoint)hotSpot { self = [self initWithImage: newImage hotSpot: hotSpot]; if (self == nil) return nil; if (fg || bg) { if (bg == nil) bg = [NSColor whiteColor]; if (fg == nil) fg = [NSColor blackColor]; bg = [bg colorUsingColorSpaceName: NSDeviceRGBColorSpace]; fg = [fg colorUsingColorSpaceName: NSDeviceRGBColorSpace]; [GSCurrentServer() recolorcursor: fg : bg : _cid]; } return self; } - (void) dealloc { RELEASE(_cursor_image); if (_cid) { [GSCurrentServer() freecursor: _cid]; } [super dealloc]; } /**

Returns the hot spot point of the NSCursor. This is in the * cursor's coordinate system which is a flipped on (origin at the * top left of the cursor).

*/ - (NSPoint) hotSpot { // FIXME: This wont work for the standard cursor return _hot_spot; } /**

Returns the image of the NSCursor

*/ - (NSImage*) image { // FIXME: This wont work for the standard cursor return _cursor_image; } /**

Sets the hot spot point of the NSCursor to spot

*/ - (void) setHotSpot: (NSPoint)spot { _hot_spot = spot; [self _computeCid]; } /**

Sets newImage the image of the NSCursor

*/ - (void) setImage: (NSImage *)newImage { ASSIGN(_cursor_image, newImage); [self _computeCid]; } /**

Returns whether if the cursor is set on -mouseEntered:.

See Also: -setOnMouseEntered: -mouseEntered: -set -isSetOnMouseExited

*/ - (BOOL) isSetOnMouseEntered { return _cursor_flags.is_set_on_mouse_entered; } /**

Returns whether if the cursor is push on -mouseExited:.

See Also: -setOnMouseEntered: -mouseExited: -set -isSetOnMouseEntered

*/ - (BOOL) isSetOnMouseExited { return _cursor_flags.is_set_on_mouse_exited; } /**

Sets the cursor if -isSetOnMouseEntered is YES or pushs the cursor if -isSetOnMouseExited is NO

See Also: -isSetOnMouseEntered -isSetOnMouseExited

*/ - (void) mouseEntered: (NSEvent*)theEvent { NSDebugLLog(@"NSCursor", @"Cursor mouseEntered:enter %d exit %d", _cursor_flags.is_set_on_mouse_entered, _cursor_flags.is_set_on_mouse_exited); if (_cursor_flags.is_set_on_mouse_entered == YES) { [self set]; } else if (_cursor_flags.is_set_on_mouse_exited == NO) { /* * Undocumented behavior - if a cursor is not set on exit or entry, * we assume a push-pop situation instead. */ [self push]; } } /**

Sets the cursor if -isSetOnMouseExited is YES or pops the cursor if -isSetOnMouseEntered is NO

See Also: -isSetOnMouseExited -isSetOnMouseEntered

*/ - (void) mouseExited: (NSEvent*)theEvent { NSDebugLLog(@"NSCursor", @"Cursor mouseExited: enter %d exit %d", _cursor_flags.is_set_on_mouse_entered, _cursor_flags.is_set_on_mouse_exited); if (_cursor_flags.is_set_on_mouse_exited == YES) { [self set]; } else if (_cursor_flags.is_set_on_mouse_entered == NO) { /* * Undocumented behavior - if a cursor is not set on exit or entry, * we assume a push-pop situation instead. */ [self pop]; } else { /* * The cursor was set on entry, we reset it to the default cursor on exit. * Using push and pop all the time would seem to be a clearer way. */ [[NSCursor arrowCursor] set]; } } /**

Pops the cursor off the top of the stack and makes the previous the current cursor.

*/ - (void) pop { [NSCursor_class pop]; } /**

Adds the NSCursor into the cursor stack and makes it the current cursor.

See Also: -pop -set

*/ - (void) push { [gnustep_gui_cursor_stack addObject: gnustep_gui_current_cursor]; [self set]; NSDebugLLog(@"NSCursor", @"Cursor push %p", _cid); } /**

Sets the NSCursor as the current cursor.

*/ - (void) set { ASSIGN(gnustep_gui_current_cursor, self); if (_cid) { [GSCurrentServer() setcursor: _cid]; } else { /* * No image? This is odd, so we set an standard * cursor image (GSArrowCursor). */ void *c = NULL; [GSCurrentServer() standardcursor: GSArrowCursor : &c]; if (c != NULL) { [self _setCid: c]; [GSCurrentServer() setcursor: _cid]; } } } /**

Sets whether if the cursor is set on -mouseEntered:.

See Also: -isSetOnMouseEntered -mouseEntered: -set

*/ - (void) setOnMouseEntered: (BOOL)flag { _cursor_flags.is_set_on_mouse_entered = flag; } /**

Sets whether if the cursor is push on -mouseExited:.

See Also: -isSetOnMouseExited -mouseExited: -set

*/ - (void) setOnMouseExited: (BOOL)flag { _cursor_flags.is_set_on_mouse_exited = flag; } /* * NSCoding protocol */ - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { if (nil != _cursor_image) { [aCoder encodeObject: _cursor_image forKey: @"NSImage"]; } else { int type = _cursor_flags.type; [aCoder encodeInt: type forKey: @"NSCursorType"]; } [aCoder encodePoint: _hot_spot forKey: @"NSHotSpot"]; } else { BOOL flag; // FIXME: This wont work for the standard cursor flag = _cursor_flags.is_set_on_mouse_entered; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _cursor_flags.is_set_on_mouse_exited; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; [aCoder encodeObject: _cursor_image]; [aCoder encodePoint: _hot_spot]; } } - (id) initWithCoder: (NSCoder*)aDecoder { if ([aDecoder allowsKeyedCoding]) { DESTROY(self); if ([aDecoder containsValueForKey: @"NSCursorType"]) { int type = [aDecoder decodeIntForKey: @"NSCursorType"]; switch (type) { case 0: self = [NSCursor arrowCursor]; break; case 1: self = [NSCursor IBeamCursor]; break; case 2: self = [NSCursor dragLinkCursor]; break; case 3: self = [NSCursor operationNotAllowedCursor]; break; case 5: self = [NSCursor dragCopyCursor]; break; case 11: self = [NSCursor closedHandCursor]; break; case 12: self = [NSCursor openHandCursor]; break; case 13: self = [NSCursor pointingHandCursor]; break; case 17: self = [NSCursor resizeLeftCursor]; break; case 18: self = [NSCursor resizeRightCursor]; break; case 19: self = [NSCursor resizeLeftRightCursor]; break; case 20: self = [NSCursor crosshairCursor]; break; case 21: self = [NSCursor resizeUpCursor]; break; case 22: self = [NSCursor resizeDownCursor]; break; case 24: self = [NSCursor contextualMenuCursor]; break; case 25: self = [NSCursor disappearingItemCursor]; break; default: // FIXME self = [NSCursor arrowCursor]; break; } RETAIN(self); } else { NSPoint hotSpot = NSMakePoint(0, 0); NSImage *image = nil; if ([aDecoder containsValueForKey: @"NSHotSpot"]) { hotSpot = [aDecoder decodePointForKey: @"NSHotSpot"]; } if ([aDecoder containsValueForKey: @"NSImage"]) { image = [aDecoder decodeObjectForKey: @"NSImage"]; } self = [[NSCursor alloc] initWithImage: image hotSpot: hotSpot]; } } else { BOOL flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _cursor_flags.is_set_on_mouse_entered = flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _cursor_flags.is_set_on_mouse_exited = flag; _cursor_image = [aDecoder decodeObject]; _hot_spot = [aDecoder decodePoint]; [self _computeCid]; } return self; } @end gnustep-gui-0.24.0/Source/GNUmakefile.postamble0000664000076500007650000000726012256065556021262 0ustar brains99brains99# # GNUmakefile.postamble # # Copyright (C) 1997 Free Software Foundation, Inc. # # Author: Scott Christley # # This file is part of the GNUstep GUI Library. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # # GNUmakefile.postamble # # Project specific makefile rules # # Uncomment the targets you want. # The double colons (::) are important, do not make them single colons # otherwise the normal makefile rules will not be performed. # # Things to do before compiling ifeq ($(doc),yes) before-all:: $(GNUSTEP_TARGET_DIR)/config.h cp ../Documentation/Gui.gsdoc . # Things to do after compiling after-all:: $(RM) Gui.gsdoc if test -d Gui; then rm -rf Gui; fi; else before-all:: $(GNUSTEP_TARGET_DIR)/config.h endif after-all:: Info-gnustep.plist # Things to do before installing # before-install:: # Things to do after installing after-install:: for file in $(APPKIT_HEADERS); do \ $(INSTALL_DATA) ../Headers/AppKit/$$file \ $(GNUSTEP_HEADERS)/AppKit/$$file ; \ done; \ for file in $(COCOA_HEADERS); do \ $(INSTALL_DATA) ../Headers/Cocoa/$$file \ $(GNUSTEP_HEADERS)/Cocoa/$$file ; \ done # # Things to do before uninstalling # before-uninstall:: # Things to do after uninstalling after-uninstall:: for file in $(APPKIT_HEADERS); do \ rm -f $(GNUSTEP_HEADERS)/AppKit/$$file ; \ done; \ for file in $(COCOA_HEADERS); do \ rm -f $(GNUSTEP_HEADERS)/Cocoa/$$file ; \ done # Things to do before cleaning # before-clean:: # Things to do after cleaning # FIXME - this file is in subversion! after-clean:: rm -f libgnustep-gui.def # Things to do before distcleaning # before-distclean:: # Things to do after distcleaning after-distclean:: rm -rf $(GNUSTEP_TARGET_DIR)/config.h rm -rf ../Headers/Additions/GNUstepGUI/config.h # Things to do before checking # before-check:: # Things to do after checking # after-check:: # # GNUstep GUI Library specific targets # # The config.h file is specific to a target # $(GNUSTEP_TARGET_DIR)/config.h: ../config.status $(MKDIRS) $(GNUSTEP_TARGET_DIR) -mv ../Headers/Additions/GNUstepGUI/config.h $(GNUSTEP_TARGET_DIR) -touch $(GNUSTEP_TARGET_DIR)/config.h # # Make list of class names for DLL exports. Uses the actual classes from # the .o files, so it should really have everything needed. # libgnustep-gui.def: $(OBJ_FILES_TO_LINK) rm -f $@ rm -f _tmp.def cat win32-def.top > $@ nm $^ | grep '^........ [TR] _' | sed 's/[^_]*_//' > _tmp.def cat _tmp.def | grep "_class_name_" >> $@ rm -rf _tmp.def # # Make an Info.plist since libraries don't have these normally # Info-gnustep.plist: ../Version $(ECHO_CREATING)(echo "{"; \ echo " NSExecutable = \"gnustep-gui\";"; \ echo " NSPrincipalClass = \"NSApplication\";"; \ echo " GSBundleShortVersionString = \"$(VERSION)\";"; \ echo " GSBundleVersion = $(VERSION_NUMBER);"; \ echo " CFBundleShortVersionString = \"$(VERSION)\";"; \ echo " CFBundleVersion = $(VERSION_NUMBER);"; \ echo "}") > $@$(END_ECHO) gnustep-gui-0.24.0/Source/GSLayoutManager.m0000664000076500007650000024727212102166206020374 0ustar brains99brains99/* GSLayoutManager.m Copyright (C) 2002-2011 Free Software Foundation, Inc. Author: Alexander Malmberg Date: November 2002 - February 2003 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import "AppKit/NSAttributedString.h" #import "AppKit/NSTextStorage.h" #import "AppKit/NSTextContainer.h" /* just for NSAttachmentCharacter */ #import "AppKit/NSTextAttachment.h" #import "GNUstepGUI/GSFontInfo.h" #import "GNUstepGUI/GSTypesetter.h" #import "GNUstepGUI/GSLayoutManager_internal.h" /* TODO: is using rand() here ok? */ static inline int random_level(void) { int i; for (i = 0; i < SKIP_LIST_DEPTH - 2; i++) if ((rand() % SKIP_LIST_LEVEL_PROBABILITY) != 0) break; return i; } /* * Insert a new run with level into the context of the skip list. * Return the new run. */ static glyph_run_t *run_insert(glyph_run_head_t **context, int level) { glyph_run_head_t *h; glyph_run_t *r; int i, size; size = sizeof(glyph_run_head_t) * level + sizeof(glyph_run_t); h = malloc(size); memset(h, 0, size); for (i = level; i >= 0; i--, h++) { h->next = context[i]->next; context[i]->next = h; } h--; r = (glyph_run_t *)h; r->level = level; r->prev = context[0]; if (h->next) ((glyph_run_t *)h->next)->prev = h; return r; } /* * Free the glphys of a run. */ static inline void run_free_glyphs(glyph_run_t *r) { if (r->glyphs) { r->head.complete = 0; r->head.glyph_length = 0; free(r->glyphs); r->glyphs = NULL; } } /* * Remove the run r from the context of the skip list and free it. * The context does not point at r, but to the run immediately before r. * context[0]->next == r */ static inline void run_remove(glyph_run_head_t **context, glyph_run_t *r) { glyph_run_head_t *h; int i; // Free the glyphs run_free_glyphs(r); h = &r->head; if (h->next) ((glyph_run_t *)h->next)->prev = r->prev; for (i = 0; i <= r->level; i++) context[i]->next = context[i]->next->next; h -= r->level; free(h); } /* Recalculates char_length, glyph_length, and complete for a glyph_run_head_t. All "children" of this head must have valid values. */ static void run_fix_head(glyph_run_head_t *h) { glyph_run_head_t *h2, *next; next = h->next; if (next) next++; h2 = h + 1; h->complete = 1; h->glyph_length = 0; h->char_length = 0; // Loop over all heads below this one while (h2 != next) { h->char_length += h2->char_length; if (!h2->complete) h->complete = 0; else if (h->complete) h->glyph_length += h2->glyph_length; h2 = h2->next; } } /* Private method used internally by GSLayoutManager for sanity checking. */ @interface NSTextStorage (GSLayoutManagerSanityChecking) -(unsigned int) _editCount; @end @implementation NSTextStorage (GSLayoutManagerSanityChecking) -(unsigned int) _editCount; { return _editCount; } @end @interface GSLayoutManager (backend) -(unsigned int) _findSafeBreakMovingBackwardFrom: (unsigned int)ch; -(unsigned int) _findSafeBreakMovingForwardFrom: (unsigned int)ch; -(void) _generateGlyphsForRun: (glyph_run_t *)run at: (unsigned int)cpos; @end /***** Glyph handling *****/ @implementation GSLayoutManager (GlyphsHelpers) -(void) _run_cache_attributes: (glyph_run_t *)r : (NSDictionary *)attributes { /* set up attributes for this run */ NSNumber *n; NSFont *font; r->explicit_kern = !![attributes objectForKey: NSKernAttributeName]; n = [attributes objectForKey: NSLigatureAttributeName]; if (n) r->ligature = [n intValue]; else r->ligature = 1; font = [typesetter fontForCharactersWithAttributes: attributes]; /* TODO: it might be useful to change this slightly: Returning a nil font from -fontForCharactersWithAttributes: causes those characters to not be displayed (ie. no glyphs are generated). How would glyph<->char mapping be handled? Map the entire run to one NSNullGlyph? */ if (font == nil) font = [NSFont userFontOfSize: 0]; font = [self substituteFontForFont: font]; ASSIGN(r->font, font); } -(void) _run_free_attributes: (glyph_run_t *)r { [r->font release]; } -(void) _run_copy_attributes: (glyph_run_t *)dst : (const glyph_run_t *)src { dst->font = [src->font copy]; dst->ligature = src->ligature; dst->explicit_kern = src->explicit_kern; } /* * Free up the skip list and all the glyph arrays */ - (void) _freeGlyphs { glyph_run_t *cur, *next; glyph_run_head_t *h; if (!glyphs) return; cached_run = NULL; h = glyphs; h += SKIP_LIST_DEPTH - 1; for (cur = (glyph_run_t *)h->next; cur; cur = next) { next = (glyph_run_t *)cur->head.next; if (cur->glyphs) free(cur->glyphs); [self _run_free_attributes: cur]; // Find the start of the allocated memory h = &cur->head; h -= cur->level; free(h); } // Free the head element free(glyphs); glyphs = NULL; } /* * Initialize the glyph skip list */ - (void) _initGlyphs { int i, size; glyph_run_t *r; glyph_run_head_t *h; size = sizeof(glyph_run_head_t) * (SKIP_LIST_DEPTH - 1) + sizeof(glyph_run_t); glyphs = malloc(size); memset(glyphs, 0, size); for (h = glyphs, i = SKIP_LIST_DEPTH; i; i--, h++) { h->complete = 1; } h--; r = (glyph_run_t *)h; r->level = SKIP_LIST_DEPTH - 1; } - (void) _glyphDumpRuns { printf("--- dumping runs\n"); { glyph_run_t *h; unsigned int cpos = 0; h = (glyph_run_t *)(glyphs + SKIP_LIST_DEPTH - 1)->next; for (; h; h = (glyph_run_t *)h->head.next) { printf("%8p %i chars, %i glyphs, %i complete, prev %8p next %8p\n", h, h->head.char_length, h->head.glyph_length, h->head.complete, h->prev, h->head.next); printf(" level %i, continued %i\n", h->level, h->continued); if (h->head.complete) { unsigned int i; printf("glyphs:\n"); for (i = 0;i < h->head.glyph_length;i++) printf("%5i %04x u%04x ", h->glyphs[i].char_offset,h->glyphs[i].g, [[_textStorage string] characterAtIndex: cpos+h->glyphs[i].char_offset]); printf("\n"); } cpos += h->head.char_length; } } printf("- structure\n"); { glyph_run_head_t *h, *g; int i; printf(" head: "); for (i = 0, h = glyphs + SKIP_LIST_DEPTH - 1; i < SKIP_LIST_DEPTH; i++, h--) printf("%8p %i %3i %3i|", h->next, h->complete, h->char_length, h->glyph_length); printf("\n"); h = (glyphs + SKIP_LIST_DEPTH - 1)->next; for (; h; h = h->next) { printf("%8p: ", h); for (g = h, i = ((glyph_run_t *)h)->level; i >= 0; i--, g--) printf("%8p %i %3i %3i|", g->next, g->complete, g->char_length, g->glyph_length); printf("\n"); } } printf("--- done\n"); fflush(stdout); } - (void) _sanityChecks { glyph_run_t *g; g = (glyph_run_t *)&glyphs[SKIP_LIST_DEPTH - 1]; while (g->head.next) { NSAssert((glyph_run_t *)((glyph_run_t *)g->head.next)->prev == g, @"glyph structure corrupted: g->next->prev!=g"); g = (glyph_run_t *)g->head.next; } } /* * Returns the glyph run that contains glyphIndex, if there is any. * glyph_pos and char_pos, when supplied, will contain the starting * glyph/character index for this run. */ - (glyph_run_t *)run_for_glyph_index: (unsigned int)glyphIndex : (unsigned int *)glyph_pos : (unsigned int *)char_pos { int level; glyph_run_head_t *h; int pos, cpos; if (glyphs->glyph_length <= glyphIndex) { NSLog(@"run_for_glyph_index failed for %d", glyphIndex); return NULL; } if (cached_run) { if (glyphIndex >= cached_pos && glyphIndex < cached_pos + cached_run->head.glyph_length) { if (glyph_pos) *glyph_pos = cached_pos; if (char_pos) *char_pos = cached_cpos; return cached_run; } } pos = cpos = 0; level = SKIP_LIST_DEPTH; h = glyphs; while (1) { // Find a head, where the glyphs are already created. if (!h->complete) { h++; level--; if (!level) { NSLog(@"run_for_glyph_index failed for %d", glyphIndex); return NULL; } continue; } // Find the head containing the index. if (glyphIndex >= pos + h->glyph_length) { pos += h->glyph_length; cpos += h->char_length; h = h->next; if (!h) { NSLog(@"run_for_glyph_index failed for %d", glyphIndex); return NULL; } continue; } // Go down one level if (level > 1) { h++; level--; continue; } // Level 1 if (glyph_pos) *glyph_pos = pos; if (char_pos) *char_pos = cpos; cached_run = (glyph_run_t *)h; cached_pos = pos; cached_cpos = cpos; return (glyph_run_t *)h; } } /* * Returns the glyph run that contains charIndex, if there is any. * glyph_pos and char_pos, when supplied, will contain the starting * glyph/character index for this run. */ - (glyph_run_t *)run_for_character_index: (unsigned int)charIndex : (unsigned int *)glyph_pos : (unsigned int *)char_pos { int level; glyph_run_head_t *h; int pos, cpos; BOOL cache = YES; if (glyphs->char_length <= charIndex) { NSLog(@"run_for_character_index failed for %d", charIndex); return NULL; } if (cached_run) { if (charIndex >= cached_cpos && charIndex < cached_cpos + cached_run->head.char_length) { if (glyph_pos) *glyph_pos = cached_pos; if (char_pos) *char_pos = cached_cpos; return cached_run; } } pos = cpos = 0; h = glyphs; for (level = SKIP_LIST_DEPTH - 1; level >= 0; level--) { // Find the head containing the index. while (charIndex >= cpos + h->char_length) { // Ignore pos at the end if (!h->complete) cache = NO; pos += h->glyph_length; cpos += h->char_length; h = h->next; if (!h) { NSLog(@"run_for_character_index failed for %d", charIndex); return NULL; } } // Go down one level h++; } h--; if (glyph_pos) *glyph_pos = pos; if (char_pos) *char_pos = cpos; if (cache) { cached_run = (glyph_run_t *)h; cached_pos = pos; cached_cpos = cpos; } return (glyph_run_t *)h; } /* * Generate the glyph runs, but not the actual glyphs, up to the * character index last. * Build up empty skip list entries to later hold the glyphs. * Only appends to the end of the skip list. * Only called after setting up a complete new layout. */ -(void) _generateRunsToCharacter: (unsigned int)last { glyph_run_head_t *context[SKIP_LIST_DEPTH]; glyph_run_head_t *h; unsigned int pos; unsigned int length; int level; length = [_textStorage length]; if (last >= length) last = length - 1; h = glyphs; pos = 0; if (h->char_length > last) return; /* We haven't created any run for that character. Find the last run. */ for (level = SKIP_LIST_DEPTH; level; level--) { while (h->next) pos += h->char_length, h = h->next; context[level - 1] = h; h++; } h--; pos += h->char_length; /* Create runs and add them to the skip list until we're past our target. */ while (pos <= last) { NSRange maxRange; NSRange curRange; NSDictionary *attributes; glyph_run_t *new; int new_level; int i; maxRange = NSMakeRange(pos, length - pos); if (pos > 0) { maxRange.location--; maxRange.length++; } attributes = [_textStorage attributesAtIndex: pos longestEffectiveRange: &curRange inRange: maxRange]; /* Optimize run structure by merging with the previous run under some circumstances. See the comments in -invalidateGlyphsForCharacterRange:changeInLength:actualCharacterRange: for more information. */ if (curRange.location < pos && context[0]->char_length && // FIXME: Why 16 and not MAX_RUN_LENGTH context[0]->char_length < 16) { curRange.length -= pos - curRange.location; curRange.location = pos; new = (glyph_run_t *)context[0]; // FIXME: We could try to reuse the glyphs run_free_glyphs(new); new->head.char_length += curRange.length; for (i = 1; i < SKIP_LIST_DEPTH; i++) { run_fix_head(context[i]); } pos = NSMaxRange(curRange); continue; } if (curRange.location < pos) { curRange.length -= pos - curRange.location; curRange.location = pos; } /* TODO: this shouldn't really be necessary if all searches inside runs were binary. but for now, it helps performance, and it keeps things more balanced when there are long runs of text. */ if (curRange.length > MAX_RUN_LENGTH) { unsigned int safe_break = curRange.location + MAX_RUN_LENGTH; safe_break = [self _findSafeBreakMovingForwardFrom: safe_break]; if (safe_break < NSMaxRange(curRange)) curRange.length = safe_break - curRange.location; } /* Since we'll be creating these in order, we can be smart about picking new levels. */ { int i; /* FIXME: Not sure whether using an ivar here as the counter is a great idea. When the same range is edited over and over again this could lead to a strange structure. It works fine when adding a great chunk of text at the end. */ glyph_num_end_runs++; for (i=0; i < SKIP_LIST_DEPTH - 2; i++) if (glyph_num_end_runs & (1 << i)) break; new_level = i; } new = run_insert(context, new_level); [self _run_cache_attributes: new : attributes]; h = &new->head; for (i = 0; i <= new_level; i++, h--) { h->char_length = curRange.length; context[i] = h; } for (; i < SKIP_LIST_DEPTH; i++) { context[i]->char_length += curRange.length; context[i]->complete = 0; } pos += curRange.length; } [self _sanityChecks]; } /* Recursive glyph generation helper method method. Returns number of valid glyphs under h after generating up to last (sortof, not completely accurate). Fills in all glyph holes up to last. only looking at levels below level */ -(unsigned int) _generateGlyphs_char_r: (unsigned int)last : (unsigned int)cpos : (unsigned int)gpos : (int)level : (glyph_run_head_t *)h : (glyph_run_head_t *)stop : (BOOL *)all_complete { int total = 0, sub_total; BOOL c; *all_complete = YES; while (h != stop && (cpos <= last || *all_complete)) { if (!h->complete) { if (cpos > last) { *all_complete = NO; break; } if (level) { glyph_run_head_t *stopn; if (h->next) stopn = h->next + 1; else stopn = NULL; sub_total = [self _generateGlyphs_char_r: last : cpos : gpos + total : level - 1 : h + 1: stopn: &c]; if (!c) *all_complete = NO; else h->complete = 1; h->glyph_length = sub_total; } else { NSUInteger cindex = cpos; NSUInteger gindex = gpos + total; // Cache the current run cached_run = (glyph_run_t *)h; cached_pos = gindex; cached_cpos = cindex; // Generate the glyphs for the run [_glyphGenerator generateGlyphsForGlyphStorage: self desiredNumberOfCharacters: h->char_length glyphIndex: &gindex characterIndex: &cindex]; h->complete = 1; } } total += h->glyph_length; cpos += h->char_length; h = h->next; } return total; } /* * Generate all glyphs up to the character index last. */ -(void) _generateGlyphsUpToCharacter: (unsigned int)last { unsigned int length; BOOL dummy; if (!_textStorage) return; /* Trying to do anything here while the text storage has unprocessed edits (ie. an edit count>0) breaks things badly, and in strange ways. Thus, we detect this and raise an exception. */ if ([_textStorage _editCount]) { [NSException raise: NSGenericException format: @"Glyph generation was triggered for a layout manager " @"while the text storage it was attached to had " @"unprocessed editing. This is not allowed. Glyph " @"generation may be triggered only at points where " @"calls to -beginEditing and -endEditing are " @"balanced."]; } length = [_textStorage length]; if (!length) return; if (last >= length) last = length - 1; if (glyphs->char_length <= last) [self _generateRunsToCharacter: last]; // [self _glyphDumpRuns]; [self _generateGlyphs_char_r: last : 0 : 0 : SKIP_LIST_DEPTH - 1: glyphs : NULL : &dummy]; // [self _glyphDumpRuns]; } -(void) _generateGlyphsUpToGlyph: (unsigned int)last { unsigned int length; if (!_textStorage) return; length = [_textStorage length]; while (glyphs->glyph_length <= last && (glyphs->char_length < length || !glyphs->complete)) { // Make an estimate for the character position unsigned int char_last; if (glyphs->glyph_length == 0) char_last = last; else char_last = glyphs->char_length + 1 + (last - glyphs->glyph_length) * (glyphs->char_length / (glyphs->glyph_length + 1)); [self _generateGlyphsUpToCharacter: char_last]; } } /* * Find the glyph run that contains target and the glyph that matches to that char index. */ - (glyph_run_t *) _glyphForCharacter: (unsigned int)target index: (unsigned int *)rindex positions: (unsigned int *)rpos : (unsigned int *)rcpos { glyph_run_t *r; unsigned int pos, cpos; int lo, hi, mid, i; r = [self run_for_character_index: target : &pos : &cpos]; if (!r) { [NSException raise: NSRangeException format: @"%s character index %d out of range", __PRETTY_FUNCTION__, target]; return NULL; } if (!r->glyphs) { // range, but no glyphs, may be an empty glyph run *rindex = 0; // FIXME ... is this right? *rpos = pos; *rcpos = cpos; return r; } target -= cpos; lo = 0; hi = r->head.glyph_length - 1; while (lo < hi) { mid = (lo + hi) / 2; if (r->glyphs[mid].char_offset > target) hi = mid - 1; else if (r->glyphs[mid].char_offset < target) lo = mid + 1; else hi = lo = mid; } // This final correction is needed as multiple glyph may have // the same character offset and vise versa. i = lo; while (r->glyphs[i].char_offset > target) i--; while (i > 0 && r->glyphs[i - 1].char_offset == r->glyphs[i].char_offset) i--; *rindex = i; *rpos = pos; *rcpos = cpos; return r; } @end @implementation GSLayoutManager (glyphs) - (unsigned int) numberOfGlyphs { [self _generateGlyphsUpToCharacter: -1]; return glyphs->glyph_length; } - (NSGlyph) glyphAtIndex: (unsigned int)glyphIndex { BOOL valid; NSGlyph g; g = [self glyphAtIndex: glyphIndex isValidIndex: &valid]; if (!valid) [NSException raise: NSRangeException format: @"%s glyph index out of range", __PRETTY_FUNCTION__]; return g; } - (NSGlyph) glyphAtIndex: (unsigned int)glyphIndex isValidIndex: (BOOL *)isValidIndex { glyph_run_t *r; unsigned int pos; if (isValidIndex != NULL) *isValidIndex = NO; /* glyph '-1' is returned in other places as an "invalid" marker; this way, we can say that it isn't valid without building all glyphs */ /* TODO: check if this is really safe or smart. if it isn't, some other methods will need to be changed so they can return "no glyph index" in some other way. */ if (glyphIndex == (unsigned int)-1) return NSNullGlyph; if (glyphs->glyph_length <= glyphIndex) { [self _generateGlyphsUpToGlyph: glyphIndex]; if (glyphs->glyph_length <= glyphIndex) return NSNullGlyph; } r = run_for_glyph_index(glyphIndex, glyphs, &pos, NULL); if (!r || !r->glyphs) /* shouldn't happen */ return NSNullGlyph; if (isValidIndex != NULL) *isValidIndex = YES; return r->glyphs[glyphIndex - pos].g; } - (BOOL) isValidGlyphIndex: (unsigned int)glyphIndex { if (glyphIndex == (unsigned int)-1) return NO; if (glyphs->glyph_length <= glyphIndex) { return NO; } else { return YES; } } - (unsigned int) getGlyphs: (NSGlyph *)glyphArray range: (NSRange)glyphRange { glyph_run_t *r; NSGlyph *g; unsigned int pos; unsigned int num; unsigned int i, j, k; if (glyphRange.length == 0) { return 0; } pos = NSMaxRange(glyphRange) - 1; if (glyphs->glyph_length <= pos) { [self _generateGlyphsUpToGlyph: pos]; if (glyphs->glyph_length <= pos) { [NSException raise: NSRangeException format: @"%s glyph range out of range", __PRETTY_FUNCTION__]; return 0; } } r = run_for_glyph_index(glyphRange.location, glyphs, &pos, NULL); if (!r) { /* shouldn't happen */ [NSException raise: NSRangeException format: @"%s glyph range out of range", __PRETTY_FUNCTION__]; return 0; } g = glyphArray; num = 0; while (1) { if (pos < glyphRange.location) j = glyphRange.location - pos; else j = 0; k = NSMaxRange(glyphRange) - pos; if (k > r->head.glyph_length) k = r->head.glyph_length; if (k <= j) break; /* TODO? only "displayed" glyphs */ for (i = j; i < k; i++) { *g++ = r->glyphs[i].g; num++; } pos += r->head.glyph_length; r = (glyph_run_t *)r->head.next; if (!r) break; } return num; } - (unsigned int) characterIndexForGlyphAtIndex: (unsigned int)glyphIndex { glyph_run_t *r; unsigned int pos, cpos; if (glyphs->glyph_length <= glyphIndex) { [self _generateGlyphsUpToGlyph: glyphIndex]; if (glyphs->glyph_length <= glyphIndex) { [NSException raise: NSRangeException format: @"%s glyph index out of range", __PRETTY_FUNCTION__]; return 0; } } r = run_for_glyph_index(glyphIndex, glyphs, &pos, &cpos); if (!r) { [NSException raise: NSRangeException format: @"%s glyph index out of range", __PRETTY_FUNCTION__]; return 0; } if (r->head.glyph_length <= glyphIndex - pos) { return cpos; } return cpos + r->glyphs[glyphIndex - pos].char_offset; } /** * GNUstep extension */ - (NSSize) advancementForGlyphAtIndex: (unsigned int)glyphIndex { glyph_run_t *r; unsigned int pos, cpos; if (glyphs->glyph_length <= glyphIndex) { [self _generateGlyphsUpToGlyph: glyphIndex]; if (glyphs->glyph_length <= glyphIndex) { [NSException raise: NSRangeException format: @"%s glyph index out of range", __PRETTY_FUNCTION__]; return NSMakeSize(0,0); } } r = run_for_glyph_index(glyphIndex, glyphs, &pos, &cpos); if (!r) { [NSException raise: NSRangeException format: @"%s glyph index out of range", __PRETTY_FUNCTION__]; return NSMakeSize(0,0); } if (r->head.glyph_length <= glyphIndex - pos) { [NSException raise: NSRangeException format: @"%s internal error!", __PRETTY_FUNCTION__]; return NSMakeSize(0,0); } return r->glyphs[glyphIndex - pos].advancement; } - (NSRange) characterRangeForGlyphRange: (NSRange)glyphRange actualGlyphRange: (NSRange *)actualGlyphRange { glyph_run_t *r; NSRange real_range, char_range; unsigned int cpos, pos; unsigned j; if (NSMaxRange(glyphRange) == 0) { if (actualGlyphRange) *actualGlyphRange = glyphRange; return NSMakeRange(0, 0); } pos = NSMaxRange(glyphRange) - 1; if (glyphs->glyph_length <= pos) { [self _generateGlyphsUpToGlyph: pos]; if (glyphs->glyph_length <= pos) { [NSException raise: NSRangeException format: @"%s glyph range out of range", __PRETTY_FUNCTION__]; return NSMakeRange(0, 0); } } r = run_for_glyph_index(glyphRange.location, glyphs, &pos, &cpos); if (!r) { [NSException raise: NSRangeException format: @"%s glyph range out of range", __PRETTY_FUNCTION__]; return NSMakeRange(0, 0); } if (r->head.glyph_length <= glyphRange.location - pos) { j = cpos; } else { j = cpos + r->glyphs[glyphRange.location - pos].char_offset; } char_range.location = j; /* scan backwards to find the real first glyph */ { glyph_run_t *r2; unsigned int adj, cadj; int i; i = glyphRange.location - pos; r2 = r; adj = pos; cadj = cpos; while ((r2->head.glyph_length > i) && (r2->glyphs[i].char_offset + cadj == j)) { i--; while (i < 0) { if (!r2->prev) break; r2 = (glyph_run_t *)r2->prev; i = r2->head.glyph_length - 1; adj -= r2->head.glyph_length; cadj -= r2->head.char_length; } if (i < 0) break; } real_range.location = i + 1 + adj; } /* the range is likely short, so we can do better then a completely new search */ r = run_for_glyph_index(glyphRange.location + glyphRange.length - 1, glyphs, &pos, &cpos); if (!r) { [NSException raise: NSRangeException format: @"%s glyph range out of range", __PRETTY_FUNCTION__]; return NSMakeRange(0, 0); } if (r->head.glyph_length <= glyphRange.location + glyphRange.length - 1 - pos) { j = cpos; } else { j = cpos + r->glyphs[glyphRange.location + glyphRange.length - 1 - pos].char_offset; } /* scan forwards to find the real last glyph */ { glyph_run_t *r2; unsigned int adj, cadj; unsigned int last = 0; unsigned int i; i = glyphRange.location + glyphRange.length - 1 - pos; r2 = r; adj = pos; cadj = cpos; while ((r2->head.glyph_length > i) && (r2->glyphs[i].char_offset + cadj == j)) { GLYPH_STEP_FORWARD(r2,i,adj,cadj) if (i==r2->head.glyph_length) { last = cadj + r2->head.char_length; goto found; } } if (r2->head.glyph_length > i) { last = r2->glyphs[i].char_offset + cadj; } else { last = j; } found: real_range.length = i + adj - real_range.location; char_range.length = last - char_range.location; } if (actualGlyphRange) *actualGlyphRange = real_range; return char_range; } - (NSRange) glyphRangeForCharacterRange: (NSRange)charRange actualCharacterRange: (NSRange *)actualCharRange { NSRange char_range, glyph_range; glyph_run_t *r; unsigned int cpos, pos; unsigned int i, target; /* TODO: should this really be valid? This is causing all kinds of problems when border glyph ranges are passed to other functions. Better to keep the layout manager clean of all this and let NSTextView deal with it. */ #if 1 if (charRange.length == 0 && charRange.location == [[_textStorage string] length]) { if (actualCharRange) *actualCharRange = NSMakeRange([[_textStorage string] length], 0); return NSMakeRange([self numberOfGlyphs], 0); } #endif if (charRange.length == 0 && charRange.location == 0) { if (actualCharRange) *actualCharRange = charRange; return NSMakeRange(0, 0); } pos = NSMaxRange(charRange) - 1; [self _generateGlyphsUpToCharacter: pos]; if (glyphs->char_length <= pos) { [NSException raise: NSRangeException format: @"%s character range out of range", __PRETTY_FUNCTION__]; return NSMakeRange(0, 0); } target = charRange.location; r = [self _glyphForCharacter: target index: &i positions: &pos : &cpos]; glyph_range.location = i + pos; if (r->head.glyph_length > i) { char_range.location = r->glyphs[i].char_offset + cpos; } else { char_range.location = cpos; } target = NSMaxRange(charRange) - 1; r = [self _glyphForCharacter: target index: &i positions: &pos : &cpos]; if (r->head.glyph_length > i) { GLYPH_SCAN_FORWARD(r, i, pos, cpos, r->glyphs[i].char_offset + cpos <= target) } glyph_range.length = i + pos - glyph_range.location; if (i >= r->head.glyph_length) char_range.length = glyphs->char_length - char_range.location; else char_range.length = r->glyphs[i].char_offset + cpos - char_range.location; if (actualCharRange) *actualCharRange = char_range; return glyph_range; } /* TODO? this might currently lead to continued runs not being marked as continued runs. this will only happen at safe break spots, though, so it should still be safe. might lose opportunities to merge runs, though. */ /* This is hairy. The ranges passed in and out of this method are ranges _after_ the change. Internally, we switch between before- and after-indices. Comments mark the places where we switch. */ - (void) invalidateGlyphsForCharacterRange: (NSRange)range changeInLength: (int)lengthChange actualCharacterRange: (NSRange *)actualRange { glyph_run_head_t *context[SKIP_LIST_DEPTH]; glyph_run_head_t *h; glyph_run_t *r; NSRange rng; int position[SKIP_LIST_DEPTH]; unsigned int cpos; int level; unsigned int ch; unsigned int max; /* We always clear out the cached run information to be safe. This is only needed if the cached run is affected by the invalidation, that is if NSMinRange(range) < cpos + cached_run->head.char_lenght */ cached_run = NULL; /* Set it now for early returns. */ if (actualRange) *actualRange = range; // printf("\n +++ range=(%i+%i) lengthChange=%i\n", range.location, range.length, lengthChange); [self _sanityChecks]; // [self _glyphDumpRuns]; if ((range.location == 0) && (range.length >= [_textStorage length])) { // Full invalidation [self _invalidateEverything]; return; } /* Find out what range we actually need to invalidate. This depends on how context affects glyph generation. */ ch = range.location; if (ch > 0) { ch = [self _findSafeBreakMovingBackwardFrom: ch]; range.length += range.location - ch; range.location = ch; } max = ch + range.length; if (max < [_textStorage length]) { max = [self _findSafeBreakMovingForwardFrom: max]; range.length = max - range.location; } // printf("adjusted to %i+%i\n", range.location, range.length); // Last affected character (indix before the change). max -= lengthChange; /* Find the first run (and context) for the range. */ h = glyphs; cpos = 0; for (level = SKIP_LIST_DEPTH - 1; level >= 0; level--) { while (cpos + h->char_length <= ch) { cpos += h->char_length; h = h->next; if (!h) { /* No runs have been created for the range, so there's nothing to invalidate. */ // printf("no runs created yet\n"); return; } } context[level] = h; position[level] = cpos; h++; } h--; r = (glyph_run_t *)h; /* Now we have the first run that intersects the range we're invalidating in 'r' (and context in 'context' and 'position'). */ //printf("split if %i+%i > %i+%i\n", cpos, r->head.char_length, ch, range.length); /* If 'r' extends beyond the invalidated range, split off the trailing, valid part to a new run. The reason we need to do this is that we must have runs for the first glyph not invalidated or the deletion loop below will fail. */ if (cpos + r->head.char_length > max && ch != cpos) { glyph_run_t *new; glyph_run_head_t *hn; int i; new = run_insert(context, random_level()); new->head.char_length = cpos + r->head.char_length - max; [self _run_copy_attributes: new : r]; /* OPT: keep valid glyphs this seems to be a fairly rare case */ hn = &new->head; hn--; for (i = 1; i <= new->level; i++, hn--) { // FIXME: Use simpler adjustment run_fix_head(hn); } r->head.char_length -= new->head.char_length; // Glyphs get freed later } /* Set things up. We want 'r' to be the last run we want to keep. */ if (ch == cpos) { /* This run begins exactly at the beginning of the invalidated range. Since we want 'r' to be the last run to keep, we actually want it to be the previous run. Thus, we step backwards in the skip list to get the previous run. */ glyph_run_head_t *h2; h2 = h - r->level; h = context[r->level + 1]; cpos = position[r->level + 1]; h++; for (level = r->level; level >= 0; level--) { while (h->next != h2) { cpos += h->char_length; h = h->next; } // Fix up old context before switching if (level) run_fix_head(context[level]); position[level] = cpos; context[level] = h; h++; h2++; } h--; r = (glyph_run_t *)h; cpos += r->head.char_length; } else { /* This run begins before the invalidated range. Resize it so it ends just before it. */ int len = r->head.char_length; r->head.char_length = ch - cpos; cpos += len; /* OPT!!! keep valid glyphs */ run_free_glyphs(r); } /* 'r' is the last run we should keep, 'context' and 'position' are set up for it. cpos Now we delete all runs completely invalidated. */ { glyph_run_t *next; while (1) { next = (glyph_run_t *)r->head.next; /* We reached the end of all created runs. */ if (!next) break; NSAssert(max >= cpos, @"no run for first glyph beyond invalidated range"); /* Clean cut, just stop. */ if (max == cpos) break; /* Part of this run extends beyond the invalidated range. Resize it so it's completely beyond the invalidated range and stop. */ if (max < cpos + next->head.char_length) { glyph_run_head_t *hn; int i; /* adjust final run */ /* OPT!!! keep valid glyphs */ run_free_glyphs(next); next->head.char_length -= max - cpos; hn = &next->head; hn--; for (i = 1; i <= next->level; i++, hn--) run_fix_head(hn); break; } cpos += next->head.char_length; /* This run is completely inside the invalidated range. Remove it. The context run heads will be adjusted later. */ [self _run_free_attributes: next]; run_remove(context, next); } } /* printf("deleted\n"); [self _glyphDumpRuns];*/ /* From now one we are use indexes after after the length change. 'r' is the last run we want to keep, and the next run is the next uninvalidated run. We need to insert new runs for invalidated range after 'r'. As we create new runs, we move the context forward. When we do this, we adjust their heads with updated information. When we're done, we update all the remaining heads. FIXME: Much of this code could be shared with the implementation in _generateRunsToCharacter: */ //printf("create runs for %i+%i\n", range.location, range.length); { /* OPT: this is creating more runs than it needs to */ NSDictionary *attributes; glyph_run_t *new; unsigned int max = range.location + range.length; int i; ch = range.location; while (ch < max) { attributes = [_textStorage attributesAtIndex: ch longestEffectiveRange: &rng inRange: NSMakeRange(0, [_textStorage length])]; /* printf("at %i, max=%i, effective range (%i+%i)\n", ch, max, rng.location, rng.length);*/ /* Catch a common case. If the new run would be a continuation of the previous run, and the previous run is short, we resize the previous run instead of creating a new run. (Note that we must make sure that we don't merge with the dummy runs at the very front.) This happens a lot with repeated single-character insertions, aka. typing in a text view. */ if (rng.location < ch && context[0]->char_length && // FIXME: Why 16 and not MAX_RUN_LENGTH context[0]->char_length < 16) { rng.length -= ch - rng.location; rng.location = ch; if (ch + rng.length > max) { rng.length = max - ch; } new = (glyph_run_t *)context[0]; // FIXME: We could try to reuse the glyphs run_free_glyphs(new); new->head.char_length += rng.length; ch = NSMaxRange(rng); continue; } new = run_insert(context, random_level()); [self _run_cache_attributes: new : attributes]; /* We have the longest range the attributes allow us to create a run for. Since this might overlap the previous and next runs, we might need to adjust the location and length of the range we create a run for. OPT: If the overlapped run is short, we might want to clear out its glyphs and extend it to cover our range. This should result in fewer runs being created for large sequences of single character adds. */ if (rng.location < ch) { /* The new run has the same attributes as the previous run, so we mark it is as a continued run. */ new->continued = 1; rng.length -= ch - rng.location; rng.location = ch; } if (ch + rng.length > max) { /* The new run has the same attributes as the next run, so we mark the next run as a continued run. */ if (new->head.next) ((glyph_run_t *)new->head.next)->continued = 1; rng.length = max - ch; } /* See comment in -_generateRunsToCharacter:. */ if (rng.length > MAX_RUN_LENGTH) { unsigned int safe_break = rng.location + MAX_RUN_LENGTH; safe_break = [self _findSafeBreakMovingForwardFrom: safe_break]; if (safe_break < NSMaxRange(rng)) rng.length = safe_break - rng.location; } // printf("adjusted length: %i\n", rng.length); h = &new->head; h->char_length = rng.length; for (i = 0; i <= new->level; i++, h--) { if (i) { // FIXME: Simpler adjustment run_fix_head(context[i]); run_fix_head(h); } //h->char_length = rng.length; context[i] = h; } for (; i < SKIP_LIST_DEPTH; i++) { context[i]->char_length += rng.length; context[i]->complete = 0; } ch += rng.length; } } // Final fix up of context { int i; for (i = 1; i < SKIP_LIST_DEPTH; i++) { run_fix_head(context[i]); } } if (actualRange) *actualRange = range; [self _sanityChecks]; //[self _glyphDumpRuns]; } #define GET_GLYPH \ glyph_run_t *r; \ unsigned int pos, cpos; \ \ if (glyphs->glyph_length <= idx) \ { \ [self _generateGlyphsUpToGlyph: idx]; \ if (glyphs->glyph_length <= idx) \ { \ [NSException raise: NSRangeException \ format: @"%s glyph range out of range", __PRETTY_FUNCTION__]; \ } \ } \ \ r = run_for_glyph_index(idx, glyphs, &pos, &cpos); \ if (!r) \ { \ [NSException raise: NSRangeException \ format: @"%s glyph range out of range", __PRETTY_FUNCTION__]; \ } \ idx -= pos; - (void) setDrawsOutsideLineFragment: (BOOL)flag forGlyphAtIndex: (unsigned int)idx { GET_GLYPH r->glyphs[idx].drawsOutsideLineFragment = !!flag; } - (BOOL) drawsOutsideLineFragmentForGlyphAtIndex: (unsigned int)idx { GET_GLYPH return r->glyphs[idx].drawsOutsideLineFragment; } - (void) setNotShownAttribute: (BOOL)flag forGlyphAtIndex: (unsigned int)idx { GET_GLYPH r->glyphs[idx].isNotShown = !!flag; } - (BOOL) notShownAttributeForGlyphAtIndex: (unsigned int)idx { GET_GLYPH return r->glyphs[idx].isNotShown; } // GNUstep extension - (NSFont *) effectiveFontForGlyphAtIndex: (unsigned int)idx range: (NSRange *)range { GET_GLYPH if (range) *range = NSMakeRange(pos, r->head.glyph_length); return r->font; } - (void) insertGlyph: (NSGlyph)aGlyph atGlyphIndex: (unsigned int)glyphIndex characterIndex: (unsigned int)charIndex { [self insertGlyphs: &aGlyph length: 1 forStartingGlyphAtIndex: glyphIndex characterIndex: charIndex]; } - (void) replaceGlyphAtIndex: (unsigned int)glyphIndex withGlyph: (NSGlyph)newGlyph { glyph_run_t *r; unsigned int pos, cpos; if (glyphs->glyph_length <= glyphIndex) { [NSException raise: NSRangeException format: @"%s glyph index out of range", __PRETTY_FUNCTION__]; return; } r = run_for_glyph_index(glyphIndex, glyphs, &pos, &cpos); if (!r) { [NSException raise: NSRangeException format: @"%s glyph index out of range", __PRETTY_FUNCTION__]; return; } if (!r->glyphs || r->head.glyph_length < glyphIndex - pos) { [NSException raise: NSRangeException format: @"%s glyph index out of range", __PRETTY_FUNCTION__]; return; } r->glyphs[glyphIndex - pos].g = newGlyph; } - (void) deleteGlyphsInRange: (NSRange)aRange { /* See invalidateGlyphsForCharacterRange:changeInLength:actualCharacterRange: glyph_run_t *run; unsigned int pos, cpos; unsigned int glyphIndex; unsigned int lastGlyphIndex; glyph_run_head_t *context[SKIP_LIST_DEPTH]; glyphIndex = NSMinRange(aRange); lastGlyphIndex = NSMaxRange(aRange) - 1; while (glyphIndex <= lastGlyphIndex) { run = run_for_glyph_index(glyphIndex, glyphs, &pos, &cpos); if (!run) { [NSException raise: NSRangeException format: @"%s glyph index out of range", __PRETTY_FUNCTION__]; return; } // FIXME: remove all invalid glyphs from run if ((pos == 0) && (lastGlyphIndex >= glyphIndex - pos + run->head.glyph_length)) { run_free_glyphs(run); } else { if (lastGlyphIndex >= glyphIndex - pos + run->head.glyph_length) { } r->head.glyph_length = len; } // FIXME: Need to invalidate the entries above this one. // FIXME Cache this value glyphIndex += r->head.glyph_length - pos; } */ NSLog(@"Internal method %s called", __PRETTY_FUNCTION__); } - (void) setCharacterIndex: (unsigned int)charIndex forGlyphAtIndex: (unsigned int)glyphIndex { glyph_run_t *r; unsigned int pos, cpos; if (glyphs->glyph_length <= glyphIndex) { [NSException raise: NSRangeException format: @"%s glyph index out of range", __PRETTY_FUNCTION__]; return; } r = run_for_glyph_index(glyphIndex, glyphs, &pos, &cpos); if (!r) { [NSException raise: NSRangeException format: @"%s glyph index out of range", __PRETTY_FUNCTION__]; return; } if (!r->glyphs || r->head.glyph_length < glyphIndex - pos) { [NSException raise: NSRangeException format: @"%s glyph index out of range", __PRETTY_FUNCTION__]; return; } r->glyphs[glyphIndex - pos].char_offset = charIndex - cpos; // What should happen to the following glyphs? } - (int) intAttribute: (int)attributeTag forGlyphAtIndex: (unsigned int)glyphIndex { glyph_run_t *run; glyph_t *g; unsigned int pos; run = run_for_glyph_index(glyphIndex, glyphs, &pos, NULL); if (run && run->glyphs && (run->head.glyph_length < glyphIndex - pos)) { g = &run->glyphs[glyphIndex - pos]; if (attributeTag == NSGlyphAttributeInscribe) return g->inscription; else if (attributeTag == NSGlyphAttributeSoft) return g->soft; else if (attributeTag == NSGlyphAttributeElastic) return g->elasitc; else if (attributeTag == NSGlyphAttributeBidiLevel) return g->bidilevel; } return 0; } @end /***** Layout handling *****/ @implementation GSLayoutManager (LayoutHelpers) -(void) _invalidateLayoutFromContainer: (int)idx { int i, j; textcontainer_t *tc; linefrag_t *lf; extra_textcontainer = nil; for (i = idx, tc = textcontainers + idx; i < num_textcontainers; i++, tc++) { tc->complete = NO; if (tc->linefrags) { for (j = 0, lf = tc->linefrags; j < tc->num_linefrags + tc->num_soft; j++, lf++) { if (lf->points) free(lf->points); if (lf->attachments) free(lf->attachments); } free(tc->linefrags); } tc->linefrags = NULL; tc->num_linefrags = tc->num_soft = 0; tc->size_linefrags = 0; tc->pos = tc->length = 0; tc->was_invalidated = YES; } for (i = idx - 1, tc = textcontainers + idx - 1; i >= 0; i--, tc--) { if (tc->num_linefrags) { layout_glyph = tc->pos + tc->length; if (layout_glyph == glyphs->glyph_length) layout_char = glyphs->char_length; else layout_char = [self characterIndexForGlyphAtIndex: layout_glyph]; /* TODO? */ return; } } layout_glyph = layout_char = 0; } -(void) _freeLayout { [self _invalidateLayoutFromContainer: 0]; } -(void) _invalidateEverything { [self _freeLayout]; [self _freeGlyphs]; [self _initGlyphs]; } -(void) _doLayout { [self _doLayoutToContainer: num_textcontainers - 1]; } -(void) _doLayoutToGlyph: (unsigned int)glyphIndex { int i, j; textcontainer_t *tc; unsigned int next; NSRect prev; BOOL delegate_responds; delegate_responds = [_delegate respondsToSelector: @selector(layoutManager:didCompleteLayoutForTextContainer:atEnd:)]; next = layout_glyph; for (i = 0, tc = textcontainers; i < num_textcontainers; i++, tc++) { if (tc->complete) continue; while (1) { if (tc->num_linefrags) prev = tc->linefrags[tc->num_linefrags - 1].rect; else prev = NSZeroRect; j = [typesetter layoutGlyphsInLayoutManager: self inTextContainer: tc->textContainer startingAtGlyphIndex: next previousLineFragmentRect: prev nextGlyphIndex: &next numberOfLineFragments: 0]; if (j) break; if (next > glyphIndex) { // If all the requested work is done just leave return; } } tc->complete = YES; tc->usedRectValid = NO; if (tc->num_soft) { /* If there is any soft invalidated layout information left, remove it. */ int k; linefrag_t *lf; for (k = tc->num_linefrags, lf = tc->linefrags + k; k < tc->num_linefrags + tc->num_soft; k++, lf++) { if (lf->points) { free(lf->points); lf->points = NULL; } if (lf->attachments) { free(lf->attachments); lf->attachments = NULL; } } tc->num_soft = 0; } if (delegate_responds) { [_delegate layoutManager: self didCompleteLayoutForTextContainer: tc->textContainer atEnd: j == 2]; /* The call might have resulted in more text containers being added, so 'textcontainers' might have moved. */ tc = textcontainers + i; } if (j == 2) { break; } if (i == num_textcontainers && delegate_responds) { [_delegate layoutManager: self didCompleteLayoutForTextContainer: nil atEnd: NO]; } } } -(void) _doLayoutToContainer: (int)cindex { int i, j; textcontainer_t *tc; unsigned int next; NSRect prev; BOOL delegate_responds; delegate_responds = [_delegate respondsToSelector: @selector(layoutManager:didCompleteLayoutForTextContainer:atEnd:)]; next = layout_glyph; for (i = 0, tc = textcontainers; i <= cindex; i++, tc++) { if (tc->complete) continue; while (1) { if (tc->num_linefrags) prev = tc->linefrags[tc->num_linefrags - 1].rect; else prev = NSZeroRect; j = [typesetter layoutGlyphsInLayoutManager: self inTextContainer: tc->textContainer startingAtGlyphIndex: next previousLineFragmentRect: prev nextGlyphIndex: &next numberOfLineFragments: 0]; if (j) break; } tc->complete = YES; tc->usedRectValid = NO; if (tc->num_soft) { /* If there is any soft invalidated layout information left, remove it. */ int k; linefrag_t *lf; for (k = tc->num_linefrags, lf = tc->linefrags + k; k < tc->num_linefrags + tc->num_soft; k++, lf++) { if (lf->points) { free(lf->points); lf->points = NULL; } if (lf->attachments) { free(lf->attachments); lf->attachments = NULL; } } tc->num_soft = 0; } if (delegate_responds) { [_delegate layoutManager: self didCompleteLayoutForTextContainer: tc->textContainer atEnd: j == 2]; /* The call might have resulted in more text containers being added, so 'textcontainers' might have moved. */ tc = textcontainers + i; } if (j == 2) { break; } if (i == num_textcontainers && delegate_responds) { [_delegate layoutManager: self didCompleteLayoutForTextContainer: nil atEnd: NO]; } } } -(void) _didInvalidateLayout { int i; textcontainer_t *tc; for (tc = textcontainers, i = 0; i < num_textcontainers; i++, tc++) { // FIXME: This value never gets used tc->was_invalidated = YES; } } @end @implementation GSLayoutManager (layout) /* In the general case, we can't make any assumptions about how layout might interact between line frag rects. To be safe in all cases, we must invalidate all layout information. TODO: We could handle this by assuming that whoever calls this knows exactly what needs to be invalidated. We won't be using it internally, anyway, so it doesn't matter much to us, and it would make more advanced things possible for external callers. On the other hand, it would be easy to break things by calling this incorrectly. */ - (void) invalidateLayoutForCharacterRange: (NSRange)aRange isSoft: (BOOL)flag actualCharacterRange: (NSRange *)actualRange { [self _invalidateLayoutFromContainer: 0]; } #define SETUP_STUFF \ unsigned int max = glyphRange.location + glyphRange.length; \ \ [self _generateGlyphsUpToGlyph: max - 1]; \ if (glyphs->glyph_length < max) \ { \ [NSException raise: NSRangeException \ format: @"%s: glyph range out of range", __PRETTY_FUNCTION__]; \ return; \ } - (void) setTextContainer: (NSTextContainer *)aTextContainer forGlyphRange: (NSRange)glyphRange { textcontainer_t *tc; int i; SETUP_STUFF for (i = 0, tc = textcontainers; i < num_textcontainers; i++, tc++) if (tc->textContainer == aTextContainer) break; if (i == num_textcontainers) { NSLog(@"%s: doesn't own text container", __PRETTY_FUNCTION__); return; } /* Assume that no line frags means that layout hasn't started yet. */ if (tc->num_linefrags) { if (glyphRange.location != tc->pos + tc->length) { [NSException raise: NSRangeException format: @"%s: glyph range not consistent with existing layout", __PRETTY_FUNCTION__]; return; } tc->length += glyphRange.length; } else if (!i) { if (glyphRange.location) { [NSException raise: NSRangeException format: @"%s: glyph range not consistent with existing layout", __PRETTY_FUNCTION__]; return; } tc->pos = 0; tc->length = glyphRange.length; } else { if (tc[-1].pos + tc[-1].length != glyphRange.location) { [NSException raise: NSRangeException format: @"%s: glyph range not consistent with existing layout", __PRETTY_FUNCTION__]; return; } tc->pos = glyphRange.location; tc->length = glyphRange.length; } { unsigned int gpos; unsigned int g; glyph_t *glyph; glyph_run_t *run = run_for_glyph_index(glyphRange.location, glyphs, &gpos, NULL); g = glyphRange.location; glyph = &run->glyphs[g - gpos]; while (g < glyphRange.location + glyphRange.length) { if (g == gpos + run->head.glyph_length) { gpos += run->head.glyph_length; run = (glyph_run_t *)run->head.next; glyph = run->glyphs; } glyph->isNotShown = NO; glyph->drawsOutsideLineFragment = NO; g++; glyph++; } } layout_glyph = tc->pos + tc->length; if (layout_glyph == glyphs->glyph_length) layout_char = glyphs->char_length; else layout_char = [self characterIndexForGlyphAtIndex: layout_glyph]; } - (void) setLineFragmentRect: (NSRect)fragmentRect forGlyphRange: (NSRange)glyphRange usedRect: (NSRect)usedRect { textcontainer_t *tc; int i; linefrag_t *lf; SETUP_STUFF for (i = 0, tc = textcontainers; i < num_textcontainers; i++, tc++) { if (tc->pos <= glyphRange.location && tc->pos + tc->length >= glyphRange.location + glyphRange.length) break; } if (i == num_textcontainers) { [NSException raise: NSRangeException format: @"%s: glyph range not consistent with existing layout", __PRETTY_FUNCTION__]; return; } /* Make sure the given glyph range matches earlier layout. */ if (!tc->num_linefrags) { if (glyphRange.location != tc->pos) { [NSException raise: NSRangeException format: @"%s: glyph range not consistent with existing layout", __PRETTY_FUNCTION__]; return; } } else { lf = &tc->linefrags[tc->num_linefrags - 1]; if (lf->pos + lf->length != glyphRange.location) { [NSException raise: NSRangeException format: @"%s: glyph range not consistent with existing layout", __PRETTY_FUNCTION__]; return; } } if (!(tc->num_linefrags + tc->num_soft)) { if (!tc->size_linefrags) { tc->size_linefrags = 16; tc->linefrags = malloc(sizeof(linefrag_t) * tc->size_linefrags); } tc->num_linefrags = 1; lf = tc->linefrags; } else if (!tc->num_soft) { if (tc->size_linefrags <= tc->num_linefrags) { tc->size_linefrags += tc->size_linefrags / 2; tc->linefrags = realloc(tc->linefrags, sizeof(linefrag_t) * tc->size_linefrags); } tc->num_linefrags++; lf = &tc->linefrags[tc->num_linefrags - 1]; } else { int i; for (i = tc->num_linefrags, lf = tc->linefrags + i; i < tc->num_linefrags + tc->num_soft; i++, lf++) { if (lf->pos >= NSMaxRange(glyphRange)) break; if (lf->points) { free(lf->points); lf->points = NULL; } if (lf->attachments) { free(lf->attachments); lf->attachments = NULL; } } if (i == tc->num_linefrags) { /* If we should keep all soft frags, we need to enlarge the array to fit the new line frag. */ if (tc->size_linefrags <= tc->num_linefrags + tc->num_soft) { tc->size_linefrags += tc->size_linefrags / 2; tc->linefrags = realloc(tc->linefrags, sizeof(linefrag_t) * tc->size_linefrags); } memmove(&tc->linefrags[tc->num_linefrags + 1], &tc->linefrags[tc->num_linefrags], tc->num_soft * sizeof(linefrag_t)); } else if (i > tc->num_linefrags + 1) { tc->num_soft -= i - tc->num_linefrags; memmove(&tc->linefrags[tc->num_linefrags + 1], &tc->linefrags[i], tc->num_soft * sizeof(linefrag_t)); } else { /* If i == tc->num_linefrags + 1, we're lucky and everything already lines up, so no moving is necessary. */ tc->num_soft--; } tc->num_linefrags++; lf = &tc->linefrags[tc->num_linefrags - 1]; } memset(lf, 0, sizeof(linefrag_t)); lf->rect = fragmentRect; lf->used_rect = usedRect; lf->pos = glyphRange.location; lf->length = glyphRange.length; } - (void) setLocation: (NSPoint)location forStartOfGlyphRange: (NSRange)glyphRange { textcontainer_t *tc; int i; linefrag_t *lf; linefrag_point_t *lp; SETUP_STUFF for (i = 0, tc = textcontainers; i < num_textcontainers; i++, tc++) { if (tc->pos <= glyphRange.location && tc->pos + tc->length >= glyphRange.location + glyphRange.length) break; } if (i == num_textcontainers) { [NSException raise: NSRangeException format: @"%s: glyph range not consistent with existing layout", __PRETTY_FUNCTION__]; return; } for (i = tc->num_linefrags - 1, lf = tc->linefrags + i; i >= 0; i--, lf--) { if (lf->pos <= glyphRange.location && lf->pos + lf->length >= glyphRange.location + glyphRange.length) break; } if (i < 0) { [NSException raise: NSRangeException format: @"%s: glyph range not consistent with existing layout", __PRETTY_FUNCTION__]; return; } if (!lf->num_points) { if (glyphRange.location != lf->pos) { [NSException raise: NSRangeException format: @"%s: glyph range not consistent with existing layout", __PRETTY_FUNCTION__]; return; } lp = lf->points = malloc(sizeof(linefrag_point_t)); lf->num_points++; } else { lp = &lf->points[lf->num_points - 1]; if (lp->pos + lp->length != glyphRange.location) { [NSException raise: NSRangeException format: @"%s: glyph range not consistent with existing layout", __PRETTY_FUNCTION__]; return; } lf->num_points++; lf->points = realloc(lf->points, sizeof(linefrag_point_t) * lf->num_points); lp = &lf->points[lf->num_points - 1]; } lp->pos = glyphRange.location; lp->length = glyphRange.length; lp->p = location; } -(void) setAttachmentSize: (NSSize)size forGlyphRange: (NSRange)glyphRange { textcontainer_t *tc; int i; linefrag_t *lf; linefrag_attachment_t *la; SETUP_STUFF for (i = 0, tc = textcontainers; i < num_textcontainers; i++, tc++) { if (tc->pos <= glyphRange.location && tc->pos + tc->length >= glyphRange.location + glyphRange.length) break; } if (i == num_textcontainers) { [NSException raise: NSRangeException format: @"%s: glyph range not consistent with existing layout", __PRETTY_FUNCTION__]; return; } for (i = 0, lf = tc->linefrags; i < tc->num_linefrags; i++, lf++) { if (lf->pos <= glyphRange.location && lf->pos + lf->length >= glyphRange.location + glyphRange.length) break; } if (i == tc->num_linefrags) { [NSException raise: NSRangeException format: @"%s: glyph range not consistent with existing layout", __PRETTY_FUNCTION__]; return; } /* TODO: we do no sanity checking of attachment size ranges. might want to consider doing it */ lf->attachments = realloc(lf->attachments, sizeof(linefrag_attachment_t) * (lf->num_attachments + 1)); la = &lf->attachments[lf->num_attachments++]; memset(la, 0, sizeof(linefrag_attachment_t)); la->pos = glyphRange.location; la->length = glyphRange.length; la->size = size; } #undef SETUP_STUFF - (NSTextContainer *) textContainerForGlyphAtIndex: (NSUInteger)glyphIndex effectiveRange: (NSRange *)effectiveRange { return [self textContainerForGlyphAtIndex: glyphIndex effectiveRange: effectiveRange withoutAdditionalLayout: NO]; } - (NSTextContainer *) textContainerForGlyphAtIndex: (NSUInteger)glyphIndex effectiveRange: (NSRange *)effectiveRange withoutAdditionalLayout: (BOOL)flag { textcontainer_t *tc; int i; if (!flag) [self _doLayoutToGlyph: glyphIndex]; for (i = 0, tc = textcontainers; i < num_textcontainers; i++, tc++) if (tc->pos + tc->length > glyphIndex) break; if (i == num_textcontainers) { NSLog(@"%s: can't find text container for glyph (internal error)", __PRETTY_FUNCTION__); return nil; } if (effectiveRange) { [self _doLayoutToContainer: i]; tc = textcontainers + i; *effectiveRange = NSMakeRange(tc->pos, tc->length); } return tc->textContainer; } - (NSRect) lineFragmentRectForGlyphAtIndex: (NSUInteger)glyphIndex effectiveRange: (NSRange *)effectiveGlyphRange { return [self lineFragmentRectForGlyphAtIndex: glyphIndex effectiveRange: effectiveGlyphRange withoutAdditionalLayout: NO]; } - (NSRect) lineFragmentRectForGlyphAtIndex: (NSUInteger)glyphIndex effectiveRange: (NSRange *)effectiveGlyphRange withoutAdditionalLayout: (BOOL)flag { int i; textcontainer_t *tc; linefrag_t *lf; if (!flag) [self _doLayoutToGlyph: glyphIndex]; for (i = 0, tc = textcontainers; i < num_textcontainers; i++, tc++) if (tc->pos + tc->length > glyphIndex) break; if (i == num_textcontainers) { NSLog(@"%s: can't find text container for glyph (internal error)", __PRETTY_FUNCTION__); return NSZeroRect; } for (i = 0, lf = tc->linefrags; i < tc->num_linefrags; i++, lf++) if (lf->pos + lf->length > glyphIndex) break; if (i == tc->num_linefrags) { NSLog(@"%s: can't find line frag rect for glyph (internal error)", __PRETTY_FUNCTION__); return NSZeroRect; } if (effectiveGlyphRange) { *effectiveGlyphRange = NSMakeRange(lf->pos, lf->length); } return lf->rect; } - (NSRect) lineFragmentUsedRectForGlyphAtIndex: (NSUInteger)glyphIndex effectiveRange: (NSRange *)effectiveGlyphRange { return [self lineFragmentUsedRectForGlyphAtIndex: glyphIndex effectiveRange: effectiveGlyphRange withoutAdditionalLayout: NO]; } - (NSRect) lineFragmentUsedRectForGlyphAtIndex: (NSUInteger)glyphIndex effectiveRange: (NSRange *)effectiveGlyphRange withoutAdditionalLayout: (BOOL)flag { int i; textcontainer_t *tc; linefrag_t *lf; if (!flag) [self _doLayoutToGlyph: glyphIndex]; for (i = 0, tc = textcontainers; i < num_textcontainers; i++, tc++) if (tc->pos + tc->length > glyphIndex) break; if (i == num_textcontainers) { NSLog(@"%s: can't find text container for glyph (internal error)", __PRETTY_FUNCTION__); return NSMakeRect(0, 0, 0, 0); } for (i = 0, lf = tc->linefrags; i < tc->num_linefrags; i++, lf++) if (lf->pos + lf->length > glyphIndex) break; if (i == tc->num_linefrags) { NSLog(@"%s: can't find line frag rect for glyph (internal error)", __PRETTY_FUNCTION__); return NSMakeRect(0, 0, 0, 0); } if (effectiveGlyphRange) { *effectiveGlyphRange = NSMakeRange(lf->pos, lf->length); } return lf->used_rect; } - (NSRange) rangeOfNominallySpacedGlyphsContainingIndex: (unsigned int)glyphIndex startLocation: (NSPoint *)p { int i; textcontainer_t *tc; linefrag_t *lf; linefrag_point_t *lp; [self _doLayoutToGlyph: glyphIndex]; for (i = 0, tc = textcontainers; i < num_textcontainers; i++, tc++) if (tc->pos + tc->length > glyphIndex) break; if (i == num_textcontainers) { NSLog(@"%s: can't find text container for glyph (internal error)", __PRETTY_FUNCTION__); return NSMakeRange(NSNotFound, 0); } for (i = 0, lf = tc->linefrags; i < tc->num_linefrags; i++, lf++) if (lf->pos + lf->length > glyphIndex) break; if (i == tc->num_linefrags) { NSLog(@"%s: can't find line frag rect for glyph (internal error)", __PRETTY_FUNCTION__); return NSMakeRange(NSNotFound, 0); } for (i = 0, lp = lf->points; i < lf->num_points; i++, lp++) if (lp->pos + lp->length > glyphIndex) break; if (i == lf->num_points) { NSLog(@"%s: can't find location for glyph (internal error)", __PRETTY_FUNCTION__); return NSMakeRange(NSNotFound, 0); } if (p) *p = lp->p; return NSMakeRange(lp->pos, lp->length); } - (NSRange) rangeOfNominallySpacedGlyphsContainingIndex:(unsigned int)glyphIndex { return [self rangeOfNominallySpacedGlyphsContainingIndex: glyphIndex startLocation: NULL]; } /* The union of all line frag rects' used rects. */ - (NSRect) usedRectForTextContainer: (NSTextContainer *)container { textcontainer_t *tc; linefrag_t *lf; int i; NSRect used; for (i = 0, tc = textcontainers; i < num_textcontainers; i++, tc++) if (tc->textContainer == container) break; if (i == num_textcontainers) { NSLog(@"%s: doesn't own text container", __PRETTY_FUNCTION__); return NSMakeRect(0, 0, 0, 0); } if (!tc->complete) { [self _doLayoutToContainer: i]; tc = textcontainers + i; } if (tc->usedRectValid) return tc->usedRect; if (tc->num_linefrags) { double x0, y0, x1, y1; i = 0; lf = tc->linefrags; x0 = NSMinX(lf->used_rect); y0 = NSMinY(lf->used_rect); x1 = NSMaxX(lf->used_rect); y1 = NSMaxY(lf->used_rect); for (i++, lf++; i < tc->num_linefrags; i++, lf++) { if (NSMinX(lf->used_rect) < x0) x0 = NSMinX(lf->used_rect); if (NSMinY(lf->used_rect) < y0) y0 = NSMinY(lf->used_rect); if (NSMaxX(lf->used_rect) > x1) x1 = NSMaxX(lf->used_rect); if (NSMaxY(lf->used_rect) > y1) y1 = NSMaxY(lf->used_rect); } used = NSMakeRect(x0, y0, x1 - x0, y1 - y0); } else used = NSZeroRect; tc->usedRect = used; tc->usedRectValid = YES; return used; } - (NSRange) glyphRangeForTextContainer: (NSTextContainer *)container { textcontainer_t *tc; int i; for (i = 0, tc = textcontainers; i < num_textcontainers; i++, tc++) if (tc->textContainer == container) break; if (i == num_textcontainers) { NSLog(@"%s: doesn't own text container", __PRETTY_FUNCTION__); return NSMakeRange(NSNotFound, 0); } [self _doLayoutToContainer: i]; tc = textcontainers + i; return NSMakeRange(tc->pos, tc->length); } /* TODO: make more efficient */ - (NSArray *) textContainers { NSMutableArray *ma; int i; ma = [[NSMutableArray alloc] initWithCapacity: num_textcontainers]; for (i = 0; i < num_textcontainers; i++) [ma addObject: textcontainers[i].textContainer]; return [ma autorelease]; } - (void) addTextContainer: (NSTextContainer *)container { [self insertTextContainer: container atIndex: num_textcontainers]; } - (void) insertTextContainer: (NSTextContainer *)aTextContainer atIndex: (unsigned int)index { unsigned int i; if (index < num_textcontainers) [self _invalidateLayoutFromContainer: index]; num_textcontainers++; textcontainers = realloc(textcontainers, sizeof(textcontainer_t) * num_textcontainers); for (i = num_textcontainers - 1; i > index; i--) textcontainers[i] = textcontainers[i - 1]; memset(&textcontainers[i], 0, sizeof(textcontainer_t)); textcontainers[i].textContainer = [aTextContainer retain]; [aTextContainer setLayoutManager: self]; [self _didInvalidateLayout]; } - (void) removeTextContainerAtIndex: (unsigned int)index { int i; textcontainer_t *tc = &textcontainers[index]; [self _invalidateLayoutFromContainer: index]; [tc->textContainer setLayoutManager: nil]; [tc->textContainer release]; num_textcontainers--; for (i = index; i < num_textcontainers; i++) textcontainers[i] = textcontainers[i + 1]; if (num_textcontainers) textcontainers = realloc(textcontainers, sizeof(textcontainer_t) * num_textcontainers); else { free(textcontainers); textcontainers = NULL; } [self _didInvalidateLayout]; } - (void) textContainerChangedGeometry: (NSTextContainer *)aContainer { int i; for (i = 0; i < num_textcontainers; i++) if (textcontainers[i].textContainer == aContainer) break; if (i == num_textcontainers) { NSLog(@"%s: does not own text container", __PRETTY_FUNCTION__); return; } [self _invalidateLayoutFromContainer: i]; [self _didInvalidateLayout]; } - (unsigned int) firstUnlaidCharacterIndex { return layout_char; } - (unsigned int) firstUnlaidGlyphIndex { return layout_glyph; } -(void) getFirstUnlaidCharacterIndex: (unsigned int *)cindex glyphIndex: (unsigned int *)gindex { if (cindex) *cindex = [self firstUnlaidCharacterIndex]; if (gindex) *gindex = [self firstUnlaidGlyphIndex]; } -(void) setExtraLineFragmentRect: (NSRect)linefrag usedRect: (NSRect)used textContainer: (NSTextContainer *)tc { extra_rect = linefrag; extra_used_rect = used; extra_textcontainer = tc; } -(NSRect) extraLineFragmentRect { return extra_rect; } -(NSRect) extraLineFragmentUsedRect { return extra_used_rect; } -(NSTextContainer *) extraLineFragmentTextContainer { return extra_textcontainer; } -(void) _softInvalidateUseLineFrags: (int)num withShift: (NSSize)shift inTextContainer: (NSTextContainer *)textContainer { int i; textcontainer_t *tc; linefrag_t *lf; for (i = 0, tc = textcontainers; i < num_textcontainers; i++, tc++) if (tc->textContainer == textContainer) break; if (i == num_textcontainers) { NSLog(@"(%s): does not own text container", __PRETTY_FUNCTION__); return; } if (shift.width || shift.height) { for (i = 0, lf = &tc->linefrags[tc->num_linefrags]; i < num; i++, lf++) { lf->rect.origin.x += shift.width; lf->rect.origin.y += shift.height; lf->used_rect.origin.x += shift.width; lf->used_rect.origin.y += shift.height; } } tc->num_soft -= num; tc->num_linefrags += num; lf = &tc->linefrags[tc->num_linefrags - 1]; tc->length = lf->pos + lf->length - tc->pos; layout_glyph = tc->pos + tc->length; /* We must have glyphs beyond all the soft-invalidated line frags, so comparing with glyphs->glyph_length is ok. */ if (layout_glyph == glyphs->glyph_length) layout_char = glyphs->char_length; else layout_char = [self characterIndexForGlyphAtIndex: layout_glyph]; /* TODO? */ } -(NSRect) _softInvalidateLineFragRect: (int)index firstGlyph: (unsigned int *)first_glyph nextGlyph: (unsigned int *)next_glyph inTextContainer: (NSTextContainer *)textContainer { int i; textcontainer_t *tc; linefrag_t *lf; for (i = 0, tc = textcontainers; i < num_textcontainers; i++, tc++) if (tc->textContainer == textContainer) break; if (i == num_textcontainers) { NSLog(@"(%s): does not own text container", __PRETTY_FUNCTION__); return NSZeroRect; } if (index >= tc->num_soft) return NSZeroRect; lf = &tc->linefrags[tc->num_linefrags + index]; *first_glyph = lf->pos; *next_glyph = lf->pos + lf->length; return lf->rect; } -(unsigned int) _softInvalidateFirstGlyphInTextContainer: (NSTextContainer *)textContainer { int i; textcontainer_t *tc; for (i = 0, tc = textcontainers; i < num_textcontainers; i++, tc++) if (tc->textContainer == textContainer) break; if (i == num_textcontainers) { NSLog(@"(%s): does not own text container", __PRETTY_FUNCTION__); return (unsigned int)-1; } if (tc->num_soft) return tc->linefrags[tc->num_linefrags].pos; else return (unsigned int)-1; } -(unsigned int) _softInvalidateNumberOfLineFragsInTextContainer: (NSTextContainer *)textContainer { int i; textcontainer_t *tc; for (i = 0, tc = textcontainers; i < num_textcontainers; i++, tc++) if (tc->textContainer == textContainer) break; if (i == num_textcontainers) { NSLog(@"(%s): does not own text container", __PRETTY_FUNCTION__); return (unsigned int)-1; } return tc->num_soft; } @end /***** The rest *****/ @implementation GSLayoutManager - init { if (!(self = [super init])) return nil; [self setTypesetter: [GSTypesetter sharedSystemTypesetter]]; [self setGlyphGenerator: [NSGlyphGenerator sharedGlyphGenerator]]; usesScreenFonts = YES; [self _initGlyphs]; return self; } -(void) dealloc { int i; textcontainer_t *tc; free(rect_array); rect_array_size = 0; rect_array = NULL; [self _freeLayout]; for (i = 0, tc = textcontainers; i < num_textcontainers; i++, tc++) { [tc->textContainer setLayoutManager: nil]; [tc->textContainer release]; } free(textcontainers); textcontainers = NULL; [self _freeGlyphs]; DESTROY(typesetter); DESTROY(_glyphGenerator); [super dealloc]; } /** * Sets the text storage for the layout manager. * Use -replaceTextStorage: instead as a rule. - this method is really * more for internal use by the text system. * Invalidates the entire layout (should it??) */ /* See [NSTextView -setTextContainer:] for more information about these calls. */ - (void) setTextStorage: (NSTextStorage *)aTextStorage { int i; textcontainer_t *tc; [self _invalidateEverything]; /* * Make a note of the new text storage object, but don't retain it. * The text storage is owning us - it retains us. */ _textStorage = aTextStorage; /* We send this message to all text containers so they can respond to the change (most importantly to let them tell their text views). */ for (i = 0, tc = textcontainers; i < num_textcontainers; i++, tc++) { [tc->textContainer setLayoutManager: self]; } [self _didInvalidateLayout]; } /** * Returns the text storage for this layout manager. */ - (NSTextStorage *) textStorage { return _textStorage; } /** * Replaces the text storage with a new one.
* Takes care (since layout managers are owned by text storages) * not to get self deallocated. */ - (void) replaceTextStorage: (NSTextStorage *)newTextStorage { NSArray *layoutManagers = [_textStorage layoutManagers]; NSEnumerator *enumerator = [layoutManagers objectEnumerator]; GSLayoutManager *object; /* Remove layout managers from old NSTextStorage object and add them to the new one. NSTextStorage's addLayoutManager invokes GSLayoutManager's setTextStorage method automatically, and that includes self. */ while ((object = (GSLayoutManager*)[enumerator nextObject]) != nil) { RETAIN(object); [_textStorage removeLayoutManager: object]; [newTextStorage addLayoutManager: object]; RELEASE(object); } } - (NSGlyphGenerator *) glyphGenerator { return _glyphGenerator; } - (void) setGlyphGenerator: (NSGlyphGenerator *)glyphGenerator { ASSIGN(_glyphGenerator, glyphGenerator); } - (id) delegate { return _delegate; } - (void) setDelegate: (id)aDelegate { _delegate = aDelegate; } -(GSTypesetter *) typesetter { return typesetter; } -(void) setTypesetter: (GSTypesetter *)a_typesetter { ASSIGN(typesetter, a_typesetter); } - (BOOL) usesScreenFonts { return usesScreenFonts; } - (void) setUsesScreenFonts: (BOOL)flag { flag = !!flag; if (flag == usesScreenFonts) return; usesScreenFonts = flag; [self _invalidateEverything]; [self _didInvalidateLayout]; } - (NSFont *) substituteFontForFont: (NSFont *)originalFont { NSFont *f; if (usesScreenFonts) { f = [originalFont screenFont]; if (f) return f; } return originalFont; } - (void) setBackgroundLayoutEnabled: (BOOL)flag { flag = !!flag; if (flag == backgroundLayoutEnabled) return; backgroundLayoutEnabled = flag; /* TODO */ } - (BOOL) backgroundLayoutEnabled { return backgroundLayoutEnabled; } - (void) setShowsInvisibleCharacters: (BOOL)flag { flag = !!flag; if (flag == showsInvisibleCharacters) return; showsInvisibleCharacters = flag; [self _invalidateEverything]; [self _didInvalidateLayout]; } - (BOOL) showsInvisibleCharacters { return showsInvisibleCharacters; } - (void) setShowsControlCharacters: (BOOL)flag { flag = !!flag; if (flag == showsControlCharacters) return; showsControlCharacters = flag; [self _invalidateEverything]; [self _didInvalidateLayout]; } - (BOOL) showsControlCharacters { return showsControlCharacters; } /* Note that NSLayoutManager completely overrides this (to perform more intelligent invalidation of layout using the constraints on layout it has). */ - (void) textStorage: (NSTextStorage *)aTextStorage edited: (unsigned int)mask range: (NSRange)range changeInLength: (int)lengthChange invalidatedRange: (NSRange)invalidatedRange { NSRange r; if (!(mask & NSTextStorageEditedCharacters)) lengthChange = 0; [self invalidateGlyphsForCharacterRange: invalidatedRange changeInLength: lengthChange actualCharacterRange: &r]; /* See the comments above -invalidateLayoutForCharacterRange:isSoft: actualCharacterRange: for information on why we invalidate everything here. */ [self _invalidateLayoutFromContainer: 0]; [self _didInvalidateLayout]; } -(unsigned int) _findSafeBreakMovingBackwardFrom: (unsigned int)ch { NSString *str = [_textStorage string]; // FIXME: Better check for ligature while (ch > 0 && [str characterAtIndex: ch-1] == 'f') ch--; return ch; } -(unsigned int) _findSafeBreakMovingForwardFrom: (unsigned int)ch { unsigned int len = [_textStorage length]; NSString *str = [_textStorage string]; // FIXME: Better check for ligature while (ch < len && [str characterAtIndex: ch] == 'f') ch++; if (ch < len && ch > 0 && [str characterAtIndex: ch-1] == 'f') ch++; return ch; } /* * NSGlyphStorage protocol */ - (NSAttributedString*) attributedString { return _textStorage; } /** * GNUstep extension */ - (void) insertGlyphs: (const NSGlyph*)glyph_list withAdvancements: (const NSSize*)advancements length: (NSUInteger)length forStartingGlyphAtIndex: (NSUInteger)glyph characterIndex: (NSUInteger)index { glyph_run_t *run; int i; glyph_t *g; int len; unsigned int gpos = 0; unsigned int cpos = 0; //NSLog(@"Insert %d glyphs at %d for index %d", length, glyph, index); run = [self run_for_character_index: index : &gpos : &cpos]; if (!run) { [NSException raise: NSRangeException format: @"%s glyph index out of range", __PRETTY_FUNCTION__]; return; } len = glyph - gpos + length; if (len < 0) { NSLog(@"Insert %d glyphs at %d for index %d", (int)length, (int)glyph, (int)index); NSLog(@"Found gpos %d cpos %d len %d", gpos, cpos, len); [NSException raise: NSRangeException format: @"%s glyph index out of range", __PRETTY_FUNCTION__]; return; } if (!run->glyphs) { run->glyphs = malloc(sizeof(glyph_t) * len); memset(run->glyphs, 0, sizeof(glyph_t) * len); } else if (run->head.glyph_length < len) { run->glyphs = realloc(run->glyphs, sizeof(glyph_t) * len); memset(&run->glyphs[glyph - gpos], 0, sizeof(glyph_t) * length); } run->head.glyph_length = len; // Add the glyphs to the run g = run->glyphs + (glyph - gpos); for (i = 0; i < length; i++) { // We expect to get a nominal glyph run g->char_offset = i + index - cpos; g->g = glyph_list[i]; g->advancement = advancements[i]; g++; } } - (void) insertGlyphs: (const NSGlyph*)glyph_list length: (NSUInteger)length forStartingGlyphAtIndex: (NSUInteger)glyph characterIndex: (NSUInteger)index { glyph_run_t *run; int i; unsigned int gpos, cpos; NSSize advances[length]; run = [self run_for_character_index: index : &gpos : &cpos]; if (!run) { [NSException raise: NSRangeException format: @"%s glyph index out of range", __PRETTY_FUNCTION__]; return; } for (i=0; ifont advancementForGlyph: glyph_list[i]]; } [self insertGlyphs: glyph_list withAdvancements: advances length: length forStartingGlyphAtIndex: glyph characterIndex: index]; } - (NSUInteger) layoutOptions { NSUInteger options = 0; if (showsInvisibleCharacters) options |= NSShowInvisibleGlyphs; if (showsInvisibleCharacters) options |= NSShowControlGlyphs; return options; } - (void) setIntAttribute: (NSInteger)attributeTag value: (NSInteger)anInt forGlyphAtIndex: (NSUInteger)glyphIndex { glyph_run_t *run; glyph_t *g; unsigned int pos; run = run_for_glyph_index(glyphIndex, glyphs, &pos, NULL); if (run && run->glyphs && (run->head.glyph_length < glyphIndex - pos)) { g = &run->glyphs[glyphIndex - pos]; if (attributeTag == NSGlyphAttributeInscribe) g->inscription = anInt; else if (attributeTag == NSGlyphAttributeSoft) g->soft = anInt; else if (attributeTag == NSGlyphAttributeElastic) g->elasitc = anInt; else if (attributeTag == NSGlyphAttributeBidiLevel) g->bidilevel = anInt; } } /* * NSCoding protocol */ - (void) encodeWithCoder: (NSCoder*)aCoder { // FIXME } - (id) initWithCoder: (NSCoder*)aDecoder { // FIXME return self; } @end gnustep-gui-0.24.0/Source/NSTextFieldCell.m0000664000076500007650000002420211354602172020312 0ustar brains99brains99/** NSTextFieldCell Cell class for the text field entry control Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Nicola Pero Date: November 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import "AppKit/NSAttributedString.h" #import "AppKit/NSColor.h" #import "AppKit/NSControl.h" #import "AppKit/NSEvent.h" #import "AppKit/NSFont.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSStringDrawing.h" #import "AppKit/NSTextField.h" #import "AppKit/NSTextFieldCell.h" #import "AppKit/NSText.h" @implementation NSTextFieldCell + (void) initialize { if (self == [NSTextFieldCell class]) { [self setVersion: 2]; } } // // Initialization // - (id) initTextCell: (NSString *)aString { self = [super initTextCell: aString]; if (self == nil) return self; ASSIGN(_text_color, [NSColor textColor]); ASSIGN(_background_color, [NSColor textBackgroundColor]); // _textfieldcell_draws_background = NO; _action_mask = NSKeyUpMask | NSKeyDownMask; return self; } - (void) dealloc { RELEASE(_background_color); RELEASE(_text_color); RELEASE(_placeholder); [super dealloc]; } - (id) copyWithZone: (NSZone*)zone { NSTextFieldCell *c = [super copyWithZone: zone]; RETAIN(_background_color); RETAIN(_text_color); c->_placeholder = [_placeholder copyWithZone: zone]; return c; } // // Modifying Graphic Attributes // - (void) setBackgroundColor: (NSColor *)aColor { ASSIGN (_background_color, aColor); if (_control_view) if ([_control_view isKindOfClass: [NSControl class]]) [(NSControl *)_control_view updateCell: self]; } /**

Returns the color used to draw the background

See Also: -setBackgroundColor:

*/ - (NSColor *) backgroundColor { return _background_color; } /**

Sets whether the NSTextFieldCell draw its background color

See Also: -drawsBackground

*/ - (void) setDrawsBackground: (BOOL)flag { _textfieldcell_draws_background = flag; if (_control_view) if ([_control_view isKindOfClass: [NSControl class]]) [(NSControl *)_control_view updateCell: self]; } /**

Returns whether the NSTextFieldCell draw its background color

See Also: -setBackgroundColor:

*/ - (BOOL) drawsBackground { return _textfieldcell_draws_background; } /**

Sets the text color to aColor

See Also: -textColor

*/ - (void) setTextColor: (NSColor *)aColor { ASSIGN (_text_color, aColor); if (_control_view) if ([_control_view isKindOfClass: [NSControl class]]) [(NSControl *)_control_view updateCell: self]; } /**

Returns the text color

See Also: -setTextColor:

*/ - (NSColor *) textColor { return _text_color; } - (void) setBezelStyle: (NSTextFieldBezelStyle)style { _bezelStyle = style; } - (NSTextFieldBezelStyle) bezelStyle { return _bezelStyle; } - (NSAttributedString*) placeholderAttributedString { if (_textfieldcell_placeholder_is_attributed_string == YES) { return (NSAttributedString*)_placeholder; } else { return nil; } } - (NSString*) placeholderString { if (_textfieldcell_placeholder_is_attributed_string == YES) { return nil; } else { return (NSString*)_placeholder; } } - (void) setPlaceholderAttributedString: (NSAttributedString*)string { ASSIGN(_placeholder, string); _textfieldcell_placeholder_is_attributed_string = YES; } - (void) setPlaceholderString: (NSString*)string { ASSIGN(_placeholder, string); _textfieldcell_placeholder_is_attributed_string = NO; } - (NSText *) setUpFieldEditorAttributes: (NSText *)textObject { textObject = [super setUpFieldEditorAttributes: textObject]; [textObject setDrawsBackground: _textfieldcell_draws_background]; [textObject setBackgroundColor: _background_color]; [textObject setTextColor: _text_color]; return textObject; } - (void) _drawBackgroundWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { if (_textfieldcell_draws_background) { if ([self isEnabled]) { [_background_color set]; } else { [[NSColor controlBackgroundColor] set]; } NSRectFill([self drawingRectForBounds: cellFrame]); } } - (void) _drawBorderAndBackgroundWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { // FIXME: Should use the bezel style if set. [super _drawBorderAndBackgroundWithFrame: cellFrame inView: controlView]; [self _drawBackgroundWithFrame: cellFrame inView: controlView]; } - (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { if (_cell.in_editing) [self _drawEditorWithFrame: cellFrame inView: controlView]; else { NSRect titleRect; /* Make sure we are a text cell; titleRect might return an incorrect rectangle otherwise. Note that the type could be different if the user has set an image on us, which we just ignore (OS X does so as well). */ _cell.type = NSTextCellType; titleRect = [self titleRectForBounds: cellFrame]; [[self _drawAttributedString] drawInRect: titleRect]; } } /* Attributed string that will be displayed. */ - (NSAttributedString*) _drawAttributedString { NSAttributedString *attrStr; attrStr = [super _drawAttributedString]; if (attrStr == nil) { attrStr = [self placeholderAttributedString]; if (attrStr == nil) { NSString *string; NSDictionary *attributes; NSMutableDictionary *newAttribs; string = [self placeholderString]; if (string == nil) { return nil; } attributes = [self _nonAutoreleasedTypingAttributes]; newAttribs = [NSMutableDictionary dictionaryWithDictionary: attributes]; [newAttribs setObject: [NSColor disabledControlTextColor] forKey: NSForegroundColorAttributeName]; return AUTORELEASE([[NSAttributedString alloc] initWithString: string attributes: newAttribs]); } else { return attrStr; } } else { return attrStr; } } - (BOOL) isOpaque { if (_textfieldcell_draws_background == NO || _background_color == nil || [_background_color alphaComponent] < 1.0) return NO; else return YES; } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder*)aCoder { BOOL tmp; [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { [aCoder encodeObject: [self backgroundColor] forKey: @"NSBackgroundColor"]; [aCoder encodeObject: [self textColor] forKey: @"NSTextColor"]; [aCoder encodeBool: [self drawsBackground] forKey: @"NSDrawsBackground"]; if ([self isBezeled]) { [aCoder encodeInt: [self bezelStyle] forKey: @"NSTextBezelStyle"]; } } else { [aCoder encodeValueOfObjCType: @encode(id) at: &_background_color]; [aCoder encodeValueOfObjCType: @encode(id) at: &_text_color]; tmp = _textfieldcell_draws_background; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &tmp]; } } - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if (self == nil) return self; if ([aDecoder allowsKeyedCoding]) { if ([aDecoder containsValueForKey: @"NSBackgroundColor"]) { [self setBackgroundColor: [aDecoder decodeObjectForKey: @"NSBackgroundColor"]]; } if ([aDecoder containsValueForKey: @"NSTextColor"]) { [self setTextColor: [aDecoder decodeObjectForKey: @"NSTextColor"]]; } if ([aDecoder containsValueForKey: @"NSDrawsBackground"]) { [self setDrawsBackground: [aDecoder decodeBoolForKey: @"NSDrawsBackground"]]; } if ([aDecoder containsValueForKey: @"NSTextBezelStyle"]) { [self setBezelStyle: [aDecoder decodeIntForKey: @"NSTextBezelStyle"]]; } } else { BOOL tmp; if ([aDecoder versionForClassName:@"NSTextFieldCell"] < 2) { /* Replace the old default _action_mask with the new default one if it's set. There isn't really a way to modify this value on an NSTextFieldCell encoded in a .gorm file. The old default value causes problems with newer NSTableViews which uses this to discern whether it should trackMouse:inRect:ofView:untilMouseUp: or not. This also disables the action from being sent on an uneditable and unselectable text fields. */ if (_action_mask == NSLeftMouseUpMask) { _action_mask = NSKeyUpMask | NSKeyDownMask; } } [aDecoder decodeValueOfObjCType: @encode(id) at: &_background_color]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_text_color]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &tmp]; _textfieldcell_draws_background = tmp; } return self; } @end gnustep-gui-0.24.0/Source/NSFileWrapper.m0000664000076500007650000005002212230050413020026 0ustar brains99brains99/** NSFileWrapper Hold a file's contents in dynamic memory. Copyright (C) 1996 Free Software Foundation, Inc. Author: Felipe A. Rodriguez Date: Sept 1998 Author: Jonathan Gapen Date: Dec 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import #import #import #import #import #import #import #import #import #import "AppKit/NSFileWrapper.h" #import "AppKit/NSFont.h" #import "AppKit/NSImage.h" #import "AppKit/NSWorkspace.h" @implementation NSFileWrapper // // Initialization // // Init instance of directory type - (id) initDirectoryWithFileWrappers: (NSDictionary*)docs { self = [super init]; if (self != nil) { NSEnumerator *enumerator; id key; NSFileWrapper *wrapper; _wrapperType = GSFileWrapperDirectoryType; _wrapperData = [[NSMutableDictionary alloc] initWithCapacity: [docs count]]; enumerator = [docs keyEnumerator]; while ((key = [enumerator nextObject]) != nil) { wrapper = (NSFileWrapper*)[docs objectForKey: key]; if (![wrapper preferredFilename]) { [wrapper setPreferredFilename: key]; } [_wrapperData setObject: wrapper forKey: key]; } } return self; } // Init instance of regular file type - (id) initRegularFileWithContents: (NSData*)data { self = [super init]; if (self != nil) { _wrapperData = [data copyWithZone: [self zone]]; _wrapperType = GSFileWrapperRegularFileType; } return self; } // Init instance of symbolic link type - (id) initSymbolicLinkWithDestination: (NSString*)path { self = [super init]; if (self != nil) { _wrapperData = [path copyWithZone: [self zone]]; _wrapperType = GSFileWrapperSymbolicLinkType; } return self; } - (id) initSymbolicLinkWithDestinationURL: (NSURL*)url { // FIXME return [self initSymbolicLinkWithDestination: [url path]]; } /** * Init an instance from the file, directory, or symbolic link at path.
* This can create a tree of instances with a directory instance at the top */ - (id) initWithPath: (NSString*)path { CREATE_AUTORELEASE_POOL(arp); NSFileManager *fm = [NSFileManager defaultManager]; NSDictionary *fileAttributes; NSString *fileType; NSDebugLLog(@"NSFileWrapper", @"initWithPath: %@", path); fileAttributes = [fm fileAttributesAtPath: path traverseLink: NO]; fileType = [fileAttributes fileType]; if ([fileType isEqualToString: NSFileTypeDirectory]) { NSString *filename; NSMutableArray *fileWrappers = [NSMutableArray array]; NSArray *filenames = [fm directoryContentsAtPath: path]; NSEnumerator *enumerator = [filenames objectEnumerator]; while ((filename = [enumerator nextObject]) != nil) { NSFileWrapper *w; w = [[NSFileWrapper alloc] initWithPath: [path stringByAppendingPathComponent: filename]]; [fileWrappers addObject: w]; RELEASE(w); } self = [self initDirectoryWithFileWrappers: [NSDictionary dictionaryWithObjects: fileWrappers forKeys: filenames]]; } else if ([fileType isEqualToString: NSFileTypeRegular]) { self = [self initRegularFileWithContents: AUTORELEASE([[NSData alloc] initWithContentsOfFile: path])]; } else if ([fileType isEqualToString: NSFileTypeSymbolicLink]) { self = [self initSymbolicLinkWithDestination: [fm pathContentOfSymbolicLinkAtPath: path]]; } // Store the full path in filename, the specification is unclear in this point [self setFilename: path]; [self setPreferredFilename: [path lastPathComponent]]; [self setFileAttributes: fileAttributes]; [arp drain]; return self; } - (id) initWithURL: (NSURL*)url options: (NSFileWrapperReadingOptions)options error: (NSError**)outError { // FIXME if ([self readFromURL: url options: options error: outError]) { return self; } else { DESTROY(self); return nil; } } // Init an instance from data in std serial format. Serial format is the // same as that used by NSText's RTFDFromRange: method. This can // create a tree of instances with a directory instance at the top - (id) initWithSerializedRepresentation: (NSData*)data { // FIXME - This should use a serializer. To get that working a helper object // is needed that implements the NSObjCTypeSerializationCallBack protocol. // We should add this later, currently the NSArchiver is used. // Thanks to Richard, for pointing this out. NSFileWrapper *wrapper = [NSUnarchiver unarchiveObjectWithData: data]; RELEASE(self); return RETAIN(wrapper); } - (void) dealloc { TEST_RELEASE(_filename); TEST_RELEASE(_fileAttributes); TEST_RELEASE(_preferredFilename); TEST_RELEASE(_wrapperData); TEST_RELEASE(_iconImage); [super dealloc]; } // // General methods // // write instance to disk at path; if directory type, this // method is recursive; if updateFilenamesFlag is YES, the wrapper // will be updated with the name used in writing the file - (BOOL) writeToFile: (NSString*)path atomically: (BOOL)atomicFlag updateFilenames: (BOOL)updateFilenamesFlag { NSFileManager *fm = [NSFileManager defaultManager]; BOOL success = NO; NSDebugLLog(@"NSFileWrapper", @"writeToFile: %@ atomically: updateFilenames: ", path); switch (_wrapperType) { case GSFileWrapperDirectoryType: { // FIXME - more robust save proceedure when atomicFlag set NSEnumerator *enumerator = [_wrapperData keyEnumerator]; NSString *key; [fm createDirectoryAtPath: path withIntermediateDirectories: YES attributes: _fileAttributes error: NULL]; while ((key = (NSString*)[enumerator nextObject])) { NSString *newPath = [path stringByAppendingPathComponent: key]; [[_wrapperData objectForKey: key] writeToFile: newPath atomically: atomicFlag updateFilenames: updateFilenamesFlag]; } success = YES; break; } case GSFileWrapperRegularFileType: { if ([_wrapperData writeToFile: path atomically: atomicFlag]) success = [fm changeFileAttributes: _fileAttributes atPath: path]; break; } case GSFileWrapperSymbolicLinkType: { success = [fm createSymbolicLinkAtPath: path pathContent: _wrapperData]; break; } } if (success && updateFilenamesFlag) { [self setFilename: [path lastPathComponent]]; } return success; } - (NSData*) serializedRepresentation { // FIXME - This should use a serializer. To get that working a helper object // is needed that implements the NSObjCTypeSerializationCallBack protocol. // We should add this later, currently the NSArchiver is used. // Thanks to Richard, for pointing this out. return [NSArchiver archivedDataWithRootObject: self]; } - (void) setFilename: (NSString*)filename { if (filename == nil || [filename isEqualToString: @""]) { [NSException raise: NSInternalInconsistencyException format: @"Empty or nil argument to setFilename: "]; } else { ASSIGN(_filename, filename); } } - (NSString*) filename { return _filename; } - (void) setPreferredFilename: (NSString*)filename { if (filename == nil || [filename isEqualToString: @""]) { [NSException raise: NSInternalInconsistencyException format: @"Empty or nil argument to setPreferredFilename: "]; } else { ASSIGN(_preferredFilename, filename); } } - (NSString*) preferredFilename { return _preferredFilename; } - (void) setFileAttributes: (NSDictionary*)attributes { if (_fileAttributes == nil) { _fileAttributes = [NSMutableDictionary new]; } [_fileAttributes addEntriesFromDictionary: attributes]; } - (NSDictionary*) fileAttributes { return _fileAttributes; } - (BOOL) isRegularFile { if (_wrapperType == GSFileWrapperRegularFileType) { return YES; } else { return NO; } } - (BOOL) isDirectory { if (_wrapperType == GSFileWrapperDirectoryType) { return YES; } else { return NO; } } - (BOOL) isSymbolicLink { if (_wrapperType == GSFileWrapperSymbolicLinkType) { return YES; } else { return NO; } } - (void) setIcon: (NSImage*)icon { ASSIGN(_iconImage, icon); } - (NSImage*) icon { if (_iconImage == nil && [self filename]) { return [[NSWorkspace sharedWorkspace] iconForFile: [self filename]]; } else { return _iconImage; } } - (BOOL) needsToBeUpdatedFromPath: (NSString*)path { NSFileManager *fm = [NSFileManager defaultManager]; switch (_wrapperType) { case GSFileWrapperRegularFileType: if ([[self fileAttributes] isEqualToDictionary: [fm fileAttributesAtPath: path traverseLink: NO]]) return NO; break; case GSFileWrapperSymbolicLinkType: if ([_wrapperData isEqualToString: [fm pathContentOfSymbolicLinkAtPath: path]]) return NO; break; case GSFileWrapperDirectoryType: // Has the dictory itself changed? if (![[self fileAttributes] isEqualToDictionary: [fm fileAttributesAtPath: path traverseLink: NO]]) return YES; // FIXME - for directory wrappers, we have to check if all the files are still there, // if they have the same attributes and if any new files have been added. // And this recursive for all included file wrappers return NO; break; } return YES; } - (BOOL) updateFromPath: (NSString*)path { NSFileManager *fm = [NSFileManager defaultManager]; switch (_wrapperType) { case GSFileWrapperRegularFileType: if ([[self fileAttributes] isEqualToDictionary: [fm fileAttributesAtPath: path traverseLink: NO]]) return NO; [self initWithPath: path]; break; case GSFileWrapperSymbolicLinkType: if ([[self fileAttributes] isEqualToDictionary: [fm fileAttributesAtPath: path traverseLink: NO]] && [_wrapperData isEqualToString: [fm pathContentOfSymbolicLinkAtPath: path]]) return NO; [self initWithPath: path]; break; case GSFileWrapperDirectoryType: // Has the dictory itself changed? if (![[self fileAttributes] isEqualToDictionary: [fm fileAttributesAtPath: path traverseLink: NO]]) { // FIXME: This is not effizent [self initWithPath: path]; return YES; } // FIXME - for directory wrappers, we have to check if all the files are still there, // if they have the same attributes and if any new files have been added. // And this recursive for all included file wrappers return NO; break; } return YES; } // // Directory type methods // #define GSFileWrapperDirectoryTypeCheck() \ if (![self isDirectory]) \ [NSException raise: NSInternalInconsistencyException \ format: @"Can't invoke %@ on a file wrapper that" \ @" does not wrap a directory!", NSStringFromSelector(_cmd)]; - (NSString*) addFileWrapper: (NSFileWrapper*)doc { NSString *key; GSFileWrapperDirectoryTypeCheck(); key = [doc preferredFilename]; if (key == nil || [key isEqualToString: @""]) { [NSException raise: NSInvalidArgumentException format: @"Adding file wrapper with no preferred filename."]; return nil; } if ([_wrapperData objectForKey: key] != nil) { // FIXME - handle duplicate names } [_wrapperData setObject: doc forKey: key]; return key; } - (void) removeFileWrapper: (NSFileWrapper*)doc { GSFileWrapperDirectoryTypeCheck(); [_wrapperData removeObjectsForKeys: [_wrapperData allKeysForObject: doc]]; } - (NSDictionary*) fileWrappers { GSFileWrapperDirectoryTypeCheck(); return _wrapperData; } - (NSString*) keyForFileWrapper: (NSFileWrapper*)doc { GSFileWrapperDirectoryTypeCheck(); return [[_wrapperData allKeysForObject: doc] objectAtIndex: 0]; } - (NSString*) addFileWithPath: (NSString*)path { NSFileWrapper *wrapper; GSFileWrapperDirectoryTypeCheck(); wrapper = AUTORELEASE([[NSFileWrapper alloc] initWithPath: path]); if (wrapper != nil) { return [self addFileWrapper: wrapper]; } else { return nil; } } - (NSString*) addRegularFileWithContents: (NSData*)data preferredFilename: (NSString*)filename { NSFileWrapper *wrapper; GSFileWrapperDirectoryTypeCheck(); wrapper = AUTORELEASE([[NSFileWrapper alloc] initRegularFileWithContents: data]); if (wrapper != nil) { [wrapper setPreferredFilename: filename]; return [self addFileWrapper: wrapper]; } else { return nil; } } - (NSString*) addSymbolicLinkWithDestination: (NSString*)path preferredFilename: (NSString*)filename { NSFileWrapper *wrapper; GSFileWrapperDirectoryTypeCheck(); wrapper = AUTORELEASE([[NSFileWrapper alloc] initSymbolicLinkWithDestination: path]); if (wrapper != nil) { [wrapper setPreferredFilename: filename]; return [self addFileWrapper: wrapper]; } else { return nil; } } // // Regular file type methods // - (NSData*) regularFileContents { if ([self isRegularFile]) { return _wrapperData; } else { [NSException raise: NSInternalInconsistencyException format: @"File wrapper does not wrap regular file."]; } return nil; } // // Symbolic link type methods // - (NSString*) symbolicLinkDestination { if ([self isSymbolicLink]) { return _wrapperData; } else { [NSException raise: NSInternalInconsistencyException format: @"File wrapper does not wrap symbolic link."]; } return nil; } - (NSURL *)symbolicLinkDestinationURL { // FIXME return [NSURL fileURLWithPath: [self symbolicLinkDestination]]; } - (BOOL) matchesContentsOfURL: (NSURL*)url { // FIXME // For return NO; } - (BOOL) readFromURL: (NSURL*)url options: (NSFileWrapperReadingOptions)options error: (NSError**)outError { // FIXME NSFileManager *fm = [NSFileManager defaultManager]; NSString *path = [url path]; NSDictionary *fileAttributes; NSString *fileType; NSDebugLLog(@"NSFileWrapper", @"readFromURL: %@", path); fileAttributes = [fm fileAttributesAtPath: path traverseLink: NO]; fileType = [fileAttributes fileType]; if ([fileType isEqualToString: NSFileTypeDirectory]) { if (options & NSFileWrapperReadingImmediate) { NSString *filename; NSMutableArray *fileWrappers = [NSMutableArray array]; NSArray *filenames = [fm directoryContentsAtPath: path]; NSEnumerator *enumerator = [filenames objectEnumerator]; while ((filename = [enumerator nextObject]) != nil) { NSFileWrapper *w; w = [[NSFileWrapper alloc] initWithPath: [path stringByAppendingPathComponent: filename]]; [fileWrappers addObject: w]; RELEASE(w); } self = [self initDirectoryWithFileWrappers: [NSDictionary dictionaryWithObjects: fileWrappers forKeys: filenames]]; } else { self = [self initDirectoryWithFileWrappers: nil]; } } else if ([fileType isEqualToString: NSFileTypeRegular]) { if (options & NSFileWrapperReadingWithoutMapping) { self = [self initRegularFileWithContents: AUTORELEASE([[NSData alloc] initWithContentsOfFile: path])]; } else { self = [self initRegularFileWithContents: AUTORELEASE([[NSData alloc] initWithContentsOfMappedFile: path])]; } } else if ([fileType isEqualToString: NSFileTypeSymbolicLink]) { self = [self initSymbolicLinkWithDestination: [fm pathContentOfSymbolicLinkAtPath: path]]; } // Store the full path in filename, the specification is unclear in this point [self setFilename: path]; [self setPreferredFilename: [path lastPathComponent]]; [self setFileAttributes: [fm fileAttributesAtPath: path traverseLink: NO]]; return NO; } - (BOOL) writeToURL: (NSURL*)url options: (NSFileWrapperWritingOptions)options originalContentsURL: (NSURL*)originalContentsURL error: (NSError**)outError { // FIXME return [self writeToFile: [url path] atomically: options & NSFileWrapperWritingAtomic updateFilenames: options & NSFileWrapperWritingWithNameUpdating]; } // // Archiving // - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { [aCoder encodeObject: [self serializedRepresentation] forKey: @"NSFileWrapperData"]; } else { [aCoder encodeValueOfObjCType: @encode(int) at: &_wrapperType]; // Dont store the file name [aCoder encodeObject: _preferredFilename]; [aCoder encodeObject: _fileAttributes]; [aCoder encodeObject: _wrapperData]; [aCoder encodeObject: _iconImage]; } } - (id) initWithCoder: (NSCoder*)aDecoder { if ([aDecoder allowsKeyedCoding]) { NSData *data = [aDecoder decodeObjectForKey: @"NSFileWrapperData"]; return [self initWithSerializedRepresentation: data]; } else { int wrapperType; NSString *preferredFilename; NSDictionary *fileAttributes; id wrapperData; NSImage *iconImage; [aDecoder decodeValueOfObjCType: @encode(int) at: &wrapperType]; // Dont restore the file name preferredFilename = [aDecoder decodeObject]; fileAttributes = [aDecoder decodeObject]; wrapperData = [aDecoder decodeObject]; iconImage = [aDecoder decodeObject]; switch (wrapperType) { case GSFileWrapperRegularFileType: { self = [self initRegularFileWithContents: wrapperData]; break; } case GSFileWrapperSymbolicLinkType: { self = [self initSymbolicLinkWithDestination: wrapperData]; break; } case GSFileWrapperDirectoryType: { self = [self initDirectoryWithFileWrappers: wrapperData]; break; } } if (preferredFilename != nil) { [self setPreferredFilename: preferredFilename]; } if (fileAttributes != nil) { [self setFileAttributes: fileAttributes]; } if (iconImage != nil) { [self setIcon: iconImage]; } } return self; } @end gnustep-gui-0.24.0/Source/NSFontPanel.m0000664000076500007650000010123012102315414017475 0ustar brains99brains99/** NSFontPanel System generic panel for selecting and previewing fonts Copyright (C) 1996 Free Software Foundation, Inc. Author: Fred Kiefer Date: Febuary 2000 Author: Nicola Pero Date: January 2001 - sizings and resizings 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import #import #import "AppKit/NSDragging.h" #import "AppKit/NSFont.h" #import "AppKit/NSFontPanel.h" #import "AppKit/NSFontManager.h" #import "AppKit/NSApplication.h" #import "AppKit/NSSplitView.h" #import "AppKit/NSScrollView.h" #import "AppKit/NSBrowser.h" #import "AppKit/NSBrowserCell.h" #import "AppKit/NSTextView.h" #import "AppKit/NSTextField.h" #import "AppKit/NSTextFieldCell.h" #import "AppKit/NSColor.h" #import "AppKit/NSPanel.h" #import "AppKit/NSButton.h" #import "AppKit/NSBox.h" #import "GNUstepGUI/GSCharacterPanel.h" #import "GSGuiPrivate.h" #define _SAVE_PANEL_X_PAD 5 #define _SAVE_PANEL_Y_PAD 4 static inline void _setFloatValue (NSTextField *field, float size) { /* If casting size to int and then back to float we get no change, it means it's an integer */ if ((float)((int)size) == size) { /* We prefer using this if it's an int, so that it's displayed like in `8' rather than like in `8.0000000000'. Yes - when NSCell's formatters are finished we won't need this. */ [field setIntValue: (int)size]; } else { [field setFloatValue: size]; } } static NSText *sizeFieldText = nil; static float sizes[] = {4.0, 6.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 16.0, 18.0, 24.0, 36.0, 48.0, 64.0}; /* Implemented in NSBrowser */ @interface GSBrowserTitleCell : NSTextFieldCell { } @end @interface NSFontPanel (Private) - (NSFont*) _fontForSelection: (NSFont*) fontObject; -(void) _trySelectSize: (float)size updateSizeField: (BOOL)updateSizeField; // Some action methods - (void) cancel: (id) sender; - (void) _togglePreview: (id) sender; - (void) _doPreview; - (void) ok: (id) sender; - (void) _getOriginalSize; - (id)_initWithoutGModel; - (BOOL) _includeFont: (NSString *)fontName delegate: (id)delegate; @end @implementation NSFontPanel /* * Class methods */ + (void) initialize { if (self == [NSFontPanel class]) { [self setVersion: 1]; } } /**

Creates ( if needed ) and returns the shared NSFontPanel.

*/ + (NSFontPanel*) sharedFontPanel { NSFontManager *fm = [NSFontManager sharedFontManager]; return [fm fontPanel: YES]; } + (BOOL) sharedFontPanelExists { NSFontManager *fm = [NSFontManager sharedFontManager]; return ([fm fontPanel: NO] != nil); } /* * Instance methods */ - (id) init { // if (![NSBundle loadNibNamed: @"FontPanel" owner: self]); [self _initWithoutGModel]; ASSIGN(_faceList, [NSArray array]); _face = -1; _family = -1; [self reloadDefaultFontFamilies]; [self _getOriginalSize]; return self; } - (void) dealloc { RELEASE(_panelFont); RELEASE(_familyList); TEST_RELEASE(_faceList); TEST_RELEASE(_accessoryView); [super dealloc]; } /**

Returns whether the "set" button is enabled.

See Also: -setEnabled:

*/ - (BOOL) isEnabled { NSButton *setButton = [[self contentView] viewWithTag: NSFPSetButton]; return [setButton isEnabled]; } /**

Sets whether the "set" button is enabled.

See Also: -isEnabled

*/ - (void) setEnabled: (BOOL)flag { NSButton *setButton = [[self contentView] viewWithTag: NSFPSetButton]; [setButton setEnabled: flag]; } - (void) reloadDefaultFontFamilies { NSFontManager *fm = [NSFontManager sharedFontManager]; id fmDelegate = [fm delegate]; NSBrowser *familyBrowser = [[self contentView] viewWithTag: NSFPFamilyBrowser]; NSArray *fontFamilies = [fm availableFontFamilies]; unsigned int i,j; NSMutableArray *familyList; /* Build an array of all families that have a font that will be included. */ familyList = [[NSMutableArray alloc] initWithCapacity: [fontFamilies count]]; for (i = 0; i < [fontFamilies count]; i++) { NSArray *familyMembers; familyMembers = [fm availableMembersOfFontFamily: [fontFamilies objectAtIndex: i]]; for (j = 0; j < [familyMembers count]; j++) { if ([self _includeFont: [[familyMembers objectAtIndex: j] objectAtIndex: 0] delegate: fmDelegate]) { [familyList addObject: [fontFamilies objectAtIndex: i]]; break; } } } DESTROY(_familyList); _familyList = familyList; // Reload the display. [familyBrowser loadColumnZero]; // Reselect the current font. (Hopefully still there) [self setPanelFont: [fm selectedFont] isMultiple: [fm isMultiple]]; } - (void) setPanelFont: (NSFont *)fontObject isMultiple: (BOOL)flag { NSTextField *previewArea; previewArea = [[self contentView] viewWithTag: NSFPPreviewField]; ASSIGN(_panelFont, fontObject); _multiple = flag; if (fontObject == nil) { return; } if (flag) { // TODO: Unselect all items and show a message [previewArea setStringValue: _(@"Multiple fonts selected")]; _family = -1; _face = -1; } else { NSFontManager *fm = [NSFontManager sharedFontManager]; NSString *family = [fontObject familyName]; NSString *fontName = [fontObject fontName]; float size = [fontObject pointSize]; NSBrowser *familyBrowser = [[self contentView] viewWithTag: NSFPFamilyBrowser]; NSBrowser *faceBrowser = [[self contentView] viewWithTag: NSFPFaceBrowser]; NSString *face = @""; unsigned int i; // Store style information for font _traits = [fm traitsOfFont: fontObject]; _weight = [fm weightOfFont: fontObject]; // Select the row for the font family for (i = 0; i < [_familyList count]; i++) { if ([[_familyList objectAtIndex: i] isEqualToString: family]) break; } if (i < [_familyList count]) { [familyBrowser selectRow: i inColumn: 0]; _family = i; ASSIGN(_faceList, [fm availableMembersOfFontFamily: family]); [faceBrowser loadColumnZero]; _face = -1; } // Select the row for the font face for (i = 0; i < [_faceList count]; i++) { if ([[[_faceList objectAtIndex: i] objectAtIndex: 0] isEqualToString: fontName]) break; } if (i < [_faceList count]) { [faceBrowser selectRow: i inColumn: 0]; _face = i; face = [[_faceList objectAtIndex: i] objectAtIndex: 1]; } // show point size and select the row if there is one [self _trySelectSize: size updateSizeField: YES]; // Use in preview [previewArea setFont: fontObject]; if (_previewString == nil) { [previewArea setStringValue: [NSString stringWithFormat: @"%@ %@ %d PT", family, face, (int)size]]; } } } /**

Converts the NSFont fontObject

*/ - (NSFont *) panelConvertFont: (NSFont *)fontObject { NSFont *newFont; if (_multiple) { //TODO: We go over every item in the panel and check if a // value is selected. If so we send it on to the manager // newFont = [fm convertFont: fontObject toHaveTrait: NSItalicFontMask]; NSLog(@"Multiple font conversion not implemented in NSFontPanel"); newFont = [self _fontForSelection: fontObject]; } else { newFont = [self _fontForSelection: fontObject]; } if (newFont == nil) { newFont = fontObject; } return newFont; } /**

Overides the NSPanel/NSWindow method to always returns YES

*/ - (BOOL) worksWhenModal { return YES; } /**

Returns the NSFontPanel's accessory view.

See Also: -setAccessoryView:

*/ - (NSView*) accessoryView { return _accessoryView; } /**

Sets the NSFontPanel's accessory view to aView

See Also: -accessoryView

*/ - (void) setAccessoryView: (NSView*)aView { NSRect accessoryViewFrame, bottomFrame; NSRect tmpRect; NSSize contentSize, contentMinSize; float addedHeight, accessoryWidth; if (aView == _accessoryView) return; /* The following code is very tricky. Please think and test a lot before changing it. */ /* Remove old accessory view if any */ if (_accessoryView != nil) { /* Remove accessory view */ accessoryViewFrame = [_accessoryView frame]; [_accessoryView removeFromSuperview]; /* Change the min size before doing the resizing otherwise it could be a problem. */ [self setMinSize: _originalMinSize]; /* Resize the panel to the height without the accessory view. This must be done with the special care of not resizing the heights of the other views. */ addedHeight = accessoryViewFrame.size.height + (_SAVE_PANEL_Y_PAD * 2); contentSize = [[self contentView] frame].size; contentSize.height -= addedHeight; // Resize without modifying topView and bottomView height. [_topView setAutoresizingMask: NSViewWidthSizable | NSViewMinYMargin]; [self setContentSize: contentSize]; [_topView setAutoresizingMask: NSViewWidthSizable|NSViewHeightSizable]; } /* Resize the panel to its original size. This resizes freely the heights of the views. NB: minSize *must* come first */ [self setMinSize: _originalMinSize]; [self setContentSize: _originalSize]; /* Set the new accessory view */ _accessoryView = aView; /* If there is a new accessory view, plug it in */ if (_accessoryView != nil) { /* Make sure the new accessory view behaves - its height must be fixed * and its position relative to the bottom of the superview must not * change - so its position rlative to the top must be changable. */ [_accessoryView setAutoresizingMask: NSViewMaxYMargin | ([_accessoryView autoresizingMask] & ~(NSViewHeightSizable | NSViewMinYMargin))]; /* Compute size taken by the new accessory view */ accessoryViewFrame = [_accessoryView frame]; addedHeight = accessoryViewFrame.size.height + (_SAVE_PANEL_Y_PAD * 2); accessoryWidth = accessoryViewFrame.size.width + (_SAVE_PANEL_X_PAD * 2); /* Resize content size accordingly */ contentSize = _originalSize; contentSize.height += addedHeight; if (accessoryWidth > contentSize.width) { contentSize.width = accessoryWidth; } /* Set new content size without resizing heights of topView, bottomView */ // Our views should resize horizontally if needed, but not vertically [_topView setAutoresizingMask: NSViewWidthSizable | NSViewMinYMargin]; [self setContentSize: contentSize]; // Restore the original autoresizing masks [_topView setAutoresizingMask: NSViewWidthSizable|NSViewHeightSizable]; /* Compute new min size */ contentMinSize = _originalMinSize; contentMinSize.height += addedHeight; // width is more delicate tmpRect = NSMakeRect (0, 0, contentMinSize.width, contentMinSize.height); tmpRect = [NSWindow contentRectForFrameRect: tmpRect styleMask: [self styleMask]]; if (accessoryWidth > tmpRect.size.width) { contentMinSize.width += accessoryWidth - tmpRect.size.width; } // Set new min size [self setMinSize: contentMinSize]; /* * Pack the Views */ /* BottomView is ready */ bottomFrame = [_bottomView frame]; /* AccessoryView */ accessoryViewFrame.origin.x = (contentSize.width - accessoryViewFrame.size.width) / 2; accessoryViewFrame.origin.y = NSMaxY (bottomFrame) + _SAVE_PANEL_Y_PAD; [_accessoryView setFrameOrigin: accessoryViewFrame.origin]; /* Add the accessory view */ [[self contentView] addSubview: _accessoryView]; } } /* * NSCoding protocol */ - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; [aCoder encodeObject: _panelFont]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_multiple]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_preview]; } - (id) initWithCoder: (NSCoder*)aDecoder { [super initWithCoder: aDecoder]; _panelFont = RETAIN([aDecoder decodeObject]); [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_multiple]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_preview]; return self; } /* * Overriding fieldEditor:forObject: because we don't want the field * editor (which is used when you type in the size browser) to use the * font panel, otherwise typing in the size browser can modify the * currently selected font in unexpected ways ! */ - (NSText *) fieldEditor: (BOOL)createFlag forObject: (id)anObject { if (([anObject respondsToSelector: @selector(tag)]) && ([anObject tag] == NSFPSizeField)) { if ((sizeFieldText == nil) && createFlag) { sizeFieldText = [NSText new]; [sizeFieldText setUsesFontPanel: NO]; [sizeFieldText setFieldEditor: YES]; } return sizeFieldText; } return [super fieldEditor: createFlag forObject: anObject]; } @end @implementation NSFontPanel (Private) - (id) _initWithoutGModel { NSRect contentRect = {{100, 100}, {320, 300}}; NSRect topAreaRect = {{0, 42}, {320, 258}}; NSRect splitViewRect = {{8, 8}, {304, 243}}; NSRect topSplitRect = {{0, 0}, {304, 45}}; NSRect previewAreaRect = {{0, 1}, {304, 44}}; NSRect bottomSplitRect = {{0, 0}, {304, 190}}; NSRect familyBrowserRect = {{0, 0}, {111, 189}}; NSRect typefaceBrowserRect = {{113, 0}, {111, 189}}; NSRect sizeBrowserRect = {{226, 0}, {78, 143}}; NSRect sizeLabelRect = {{226, 145}, {78, 21}}; NSRect sizeTitleRect = {{226, 168}, {78, 21}}; NSRect bottomAreaRect = {{0, 0}, {320, 42}}; NSRect slashRect = {{0, 40}, {320, 2}}; NSRect revertButtonRect = {{83, 8}, {71, 24}}; NSRect previewButtonRect = {{162, 8}, {71, 24}}; NSRect setButtonRect = {{241, 8}, {71, 24}}; NSRect characterPanelButtonRect = {{8, 8}, {24, 24}}; NSView *v; NSView *topArea; NSView *bottomArea; NSView *topSplit; NSView *bottomSplit; NSSplitView *splitView; NSTextField *previewArea; NSBrowser *sizeBrowser; NSBrowser *familyBrowser; NSBrowser *faceBrowser; NSTextField *label; NSTextField *sizeField; NSButton *revertButton; NSButton *previewButton; NSButton *setButton; NSButton *characterPanelButton; NSBox *slash; unsigned int style = NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask | NSUtilityWindowMask; self = [super initWithContentRect: contentRect styleMask: style backing: NSBackingStoreRetained defer: YES screen: nil]; if (!self) { return nil; } [self setTitle: _(@"Font Panel")]; [self setBecomesKeyOnlyIfNeeded: YES]; v = [self contentView]; // preview and selection topArea = [[NSView alloc] initWithFrame: topAreaRect]; [topArea setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)]; _topView = topArea; splitView = [[NSSplitView alloc] initWithFrame: splitViewRect]; [splitView setVertical: NO]; [splitView setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)]; topSplit = [[NSView alloc] initWithFrame: topSplitRect]; [topSplit setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)]; // Display for the font example previewArea = [[NSTextField alloc] initWithFrame: previewAreaRect]; [previewArea setBackgroundColor: [NSColor textBackgroundColor]]; [previewArea setDrawsBackground: YES]; [previewArea setEditable: NO]; [previewArea setSelectable: NO]; //[previewArea setUsesFontPanel: NO]; [previewArea setAlignment: NSCenterTextAlignment]; [previewArea setStringValue: _(@"Font preview")]; [previewArea setAutoresizingMask: (NSViewWidthSizable|NSViewHeightSizable)]; [previewArea setTag: NSFPPreviewField]; [topSplit addSubview: previewArea]; RELEASE(previewArea); bottomSplit = [[NSView alloc] initWithFrame: bottomSplitRect]; [bottomSplit setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; // Selection of the font family // We use a browser with one column to get a selection list familyBrowser = [[NSBrowser alloc] initWithFrame: familyBrowserRect]; [familyBrowser setDelegate: self]; [familyBrowser setMaxVisibleColumns: 1]; [familyBrowser setMinColumnWidth: 0]; [familyBrowser setAllowsMultipleSelection: NO]; [familyBrowser setAllowsEmptySelection: YES]; [familyBrowser setHasHorizontalScroller: NO]; [familyBrowser setTitled: YES]; [familyBrowser setTakesTitleFromPreviousColumn: NO]; [familyBrowser setTarget: self]; [familyBrowser setDoubleAction: @selector(familySelected:)]; [familyBrowser setAction: @selector(_familySelectionChanged:)]; [familyBrowser setAutoresizingMask: (NSViewWidthSizable | NSViewMaxXMargin | NSViewHeightSizable)]; [familyBrowser setTag: NSFPFamilyBrowser]; [bottomSplit addSubview: familyBrowser]; RELEASE(familyBrowser); // selection of type face // We use a browser with one column to get a selection list faceBrowser = [[NSBrowser alloc] initWithFrame: typefaceBrowserRect]; [faceBrowser setDelegate: self]; [faceBrowser setMaxVisibleColumns: 1]; [faceBrowser setMinColumnWidth: 0]; [faceBrowser setAllowsMultipleSelection: NO]; [faceBrowser setAllowsEmptySelection: YES]; [faceBrowser setHasHorizontalScroller: NO]; [faceBrowser setTitled: YES]; [faceBrowser setTakesTitleFromPreviousColumn: NO]; [faceBrowser setTarget: self]; [faceBrowser setDoubleAction: @selector(faceSelected:)]; [faceBrowser setAction: @selector(_faceSelectionChanged:)]; [faceBrowser setAutoresizingMask: (NSViewWidthSizable | NSViewMinXMargin | NSViewHeightSizable)]; [faceBrowser setTag: NSFPFaceBrowser]; [bottomSplit addSubview: faceBrowser]; RELEASE(faceBrowser); // label for selection of size label = [[NSTextField alloc] initWithFrame: sizeTitleRect]; [label setCell: AUTORELEASE([GSBrowserTitleCell new])]; [label setFont: [NSFont boldSystemFontOfSize: 0]]; [label setAlignment: NSCenterTextAlignment]; [label setDrawsBackground: YES]; [label setEditable: NO]; [label setTextColor: [NSColor windowFrameTextColor]]; [label setBackgroundColor: [NSColor controlShadowColor]]; [label setStringValue: _(@"Size")]; [label setAutoresizingMask: NSViewMinXMargin | NSViewMinYMargin]; [label setTag: NSFPSizeTitle]; [bottomSplit addSubview: label]; RELEASE(label); // this is the size input field sizeField = [[NSTextField alloc] initWithFrame: sizeLabelRect]; [sizeField setDrawsBackground: YES]; [sizeField setEditable: YES]; [sizeField setAllowsEditingTextAttributes: NO]; [sizeField setAlignment: NSCenterTextAlignment]; [sizeField setAutoresizingMask: NSViewMinXMargin | NSViewMinYMargin]; [sizeField setDelegate: self]; [sizeField setTag: NSFPSizeField]; [bottomSplit addSubview: sizeField]; RELEASE(sizeField); sizeBrowser = [[NSBrowser alloc] initWithFrame: sizeBrowserRect]; [sizeBrowser setDelegate: self]; [sizeBrowser setMaxVisibleColumns: 1]; [sizeBrowser setAllowsMultipleSelection: NO]; [sizeBrowser setAllowsEmptySelection: YES]; [sizeBrowser setHasHorizontalScroller: NO]; [sizeBrowser setTitled: NO]; [sizeBrowser setTakesTitleFromPreviousColumn: NO]; [sizeBrowser setTarget: self]; [sizeBrowser setDoubleAction: @selector(sizeSelected:)]; [sizeBrowser setAction: @selector(_sizeSelectionChanged:)]; [sizeBrowser setAutoresizingMask: NSViewMinXMargin | NSViewHeightSizable]; [sizeBrowser setTag: NSFPSizeBrowser]; [bottomSplit addSubview: sizeBrowser]; RELEASE(sizeBrowser); [splitView addSubview: topSplit]; RELEASE(topSplit); [splitView addSubview: bottomSplit]; RELEASE(bottomSplit); [splitView setDelegate: self]; [topArea addSubview: splitView]; RELEASE(splitView); // action buttons bottomArea = [[NSView alloc] initWithFrame: bottomAreaRect]; _bottomView = bottomArea; slash = [[NSBox alloc] initWithFrame: slashRect]; [slash setBorderType: NSGrooveBorder]; [slash setTitlePosition: NSNoTitle]; [slash setAutoresizingMask: NSViewWidthSizable]; [bottomArea addSubview: slash]; RELEASE(slash); // cancel button revertButton = [[NSButton alloc] initWithFrame: revertButtonRect]; [revertButton setTitle: _(@"Revert")]; [revertButton setAction: @selector(cancel:)]; [revertButton setTarget: self]; [revertButton setTag: NSFPRevertButton]; [revertButton setAutoresizingMask: NSViewMinXMargin]; [bottomArea addSubview: revertButton]; RELEASE(revertButton); // toggle button for preview previewButton = [[NSButton alloc] initWithFrame: previewButtonRect]; [previewButton setTitle: _(@"Preview")]; [previewButton setButtonType: NSOnOffButton]; [previewButton setAction: @selector(_togglePreview:)]; [previewButton setTarget: self]; [previewButton setTag: NSFPPreviewButton]; [previewButton setAutoresizingMask: NSViewMinXMargin]; [previewButton setState: NSOnState]; _preview = YES; [bottomArea addSubview: previewButton]; RELEASE(previewButton); // button to set the font setButton = [[NSButton alloc] initWithFrame: setButtonRect]; [setButton setTitle: _(@"Set")]; [setButton setAction: @selector(ok:)]; [setButton setTarget: self]; [setButton setTag: NSFPSetButton]; [setButton setAutoresizingMask: NSViewMinXMargin]; [bottomArea addSubview: setButton]; // make it the default button [self setDefaultButtonCell: [setButton cell]]; RELEASE(setButton); // Character Panel button { NSString *label; unichar labelchars[2] = {0x03b1, 0x03b2}; // alpha, beta label = [[[NSString alloc] initWithCharacters: labelchars length: 2] autorelease]; characterPanelButton = [[NSButton alloc] initWithFrame: characterPanelButtonRect]; [characterPanelButton setTitle: label]; [characterPanelButton setToolTip: _(@"Character Panel")]; [characterPanelButton setAction: @selector(characterPanel:)]; [characterPanelButton setTarget: self]; [bottomArea addSubview: characterPanelButton]; RELEASE(characterPanelButton); } // set up the next key view chain [familyBrowser setNextKeyView: faceBrowser]; [faceBrowser setNextKeyView: sizeField]; [sizeField setNextKeyView: sizeBrowser]; [sizeBrowser setNextKeyView: revertButton]; [revertButton setNextKeyView: previewButton]; [previewButton setNextKeyView: setButton]; [setButton setNextKeyView: familyBrowser]; [v addSubview: topArea]; RELEASE(topArea); // Add the accessory view, if there is one if (_accessoryView != nil) { [v addSubview: _accessoryView]; } [bottomArea setAutoresizingMask: NSViewWidthSizable]; [v addSubview: bottomArea]; RELEASE(bottomArea); [self setMinSize: [self frame].size]; [self setInitialFirstResponder: setButton]; [self setBecomesKeyOnlyIfNeeded: YES]; return self; } - (void) _togglePreview: (id)sender { _preview = (sender == nil) ? YES : [sender state]; [self _doPreview]; } - (void) _doPreview { NSFont *font = nil; NSTextField *previewArea = [[self contentView] viewWithTag: NSFPPreviewField]; if (_preview) { font = [self _fontForSelection: _panelFont]; // build up a font and use it in the preview area if (font != nil) { [previewArea setFont: font]; } } if (_previewString == nil) { NSTextField *sizeField = [[self contentView] viewWithTag: NSFPSizeField]; float size = [sizeField floatValue]; NSString *faceName; NSString *familyName; if (size == 0 && font != nil) { size = [font pointSize]; } if (_family == -1) { familyName = _(@"NoFamily"); } else { familyName = [_familyList objectAtIndex: _family]; } if (_face == -1 || ![_faceList count]) { faceName = _(@"NoFace"); } else { faceName = [[_faceList objectAtIndex: _face] objectAtIndex: 1]; } [previewArea setStringValue: [NSString stringWithFormat: @"%@ %@ %d PT", familyName, faceName, (int)size]]; } } - (void) ok: (id)sender { // The set button has been pushed NSFontManager *fm = [NSFontManager sharedFontManager]; [fm modifyFontViaPanel: self]; } - (void) cancel: (id)sender { // FIXME/TODO /* * The cancel button has been pushed * we should reset the items in the panel */ [self setPanelFont: _panelFont isMultiple: _multiple]; } - (void) characterPanel: (id)sender { [[NSApplication sharedApplication] orderFrontCharacterPalette: sender]; } - (NSFont *) _fontForSelection: (NSFont *)fontObject { float size; NSString *fontName; NSTextField *sizeField = [[self contentView] viewWithTag: NSFPSizeField]; unsigned i = [_faceList count]; size = [sizeField floatValue]; if (size == 0.0) { if (fontObject == nil) { size = 12.0; } else { size = [fontObject pointSize]; } } if (_face < 0) { if (i == 0) { return nil; /* Nothing available */ } // FIXME - just uses first face fontName = [[_faceList objectAtIndex: 0] objectAtIndex: 0]; } else { /* i really should be > 0 here, except for the very obscure case where the delegate has refused all fonts (so that our family and face lists are completely empty). */ if (i) fontName = [[_faceList objectAtIndex: _face] objectAtIndex: 0]; else return nil; } // FIXME: We should check if the font is correct return [NSFont fontWithName: fontName size: size]; } -(void) _trySelectSize: (float)size updateSizeField: (BOOL)updateSizeField { unsigned int i; NSBrowser *sizeBrowser = [[self contentView] viewWithTag: NSFPSizeBrowser]; NSTextField *sizeField; if (updateSizeField) { /* Make sure our sizeField is updated. */ sizeField = [[self contentView] viewWithTag: NSFPSizeField]; _setFloatValue (sizeField, size); } /* Make sure our column is loaded. */ [sizeBrowser loadColumnZero]; for (i = 0; i < sizeof(sizes) / sizeof(float); i++) { if (size == sizes[i]) { /* select the cell */ [sizeBrowser selectRow: i inColumn: 0]; break; } } if (i == sizeof(sizes) / sizeof(float)) { /* TODO: No matching size found in the list. We should deselect everything. */ } } - (void) controlTextDidChange: (NSNotification *)n { NSTextField *sizeField = [[self contentView] viewWithTag: NSFPSizeField]; float size = [sizeField floatValue]; [self _trySelectSize: size updateSizeField: NO]; [self _doPreview]; } /* Ask the NSFontManager:s delegate if a font should be included. For speed, the delegate is an argument; a repeat-caller can then cache it. */ - (BOOL) _includeFont: (NSString*)fontName delegate: (id)fmDelegate { if (fmDelegate != nil && [fmDelegate respondsToSelector: @selector(fontManager:willIncludeFont:)]) { return [fmDelegate fontManager: [NSFontManager sharedFontManager] willIncludeFont: fontName]; } else return YES; } - (void) _getOriginalSize { /* Used in setMinSize: */ _originalMinSize = [self minSize]; /* Used in setContentSize: */ _originalSize = [[self contentView] frame].size; } @end @implementation NSFontPanel (NSBrowserDelegate) static int score_difference(int weight1, int traits1, int weight2, int traits2) { int score, t; score = (weight1 - weight2); score = 10 * score * score; t = traits1 ^ traits2; if (t & NSFixedPitchFontMask) score += 1000; if (t & NSCompressedFontMask) score += 150; if (t & NSPosterFontMask) score += 200; if (t & NSSmallCapsFontMask) score += 200; if (t & NSCondensedFontMask) score += 150; if (t & NSExpandedFontMask) score += 150; if (t & NSNarrowFontMask) score += 150; if (t & NSBoldFontMask) score += 20; if (t & NSItalicFontMask) score += 45; return score; } - (void) _familySelectionChanged: (id)sender { NSFontManager *fm = [NSFontManager sharedFontManager]; id fmDelegate = [fm delegate]; NSBrowser *faceBrowser = [[self contentView] viewWithTag: NSFPFaceBrowser]; NSBrowser *familyBrowser = [[self contentView] viewWithTag: NSFPFamilyBrowser]; int row = [familyBrowser selectedRowInColumn: 0]; unsigned int i; NSArray *entireFaceList; NSMutableArray *faceList; entireFaceList = [fm availableMembersOfFontFamily: [_familyList objectAtIndex: row]]; faceList = [[NSMutableArray alloc] initWithCapacity: [entireFaceList count]]; for (i = 0; i < [entireFaceList count]; i++) { id aFace = [entireFaceList objectAtIndex:i]; if ([self _includeFont: [aFace objectAtIndex:0] delegate: fmDelegate]) { [faceList addObject: aFace]; } } DESTROY(_faceList); _faceList = faceList; _family = row; // Select a face with the same properties for (i = 0; i < [_faceList count]; i++) { NSArray *font_info = [_faceList objectAtIndex: i]; if (([[font_info objectAtIndex: 2] intValue] == _weight) && ([[font_info objectAtIndex: 3] unsignedIntValue] == _traits)) break; } // Find the face that differs the least from what we want if (i == [_faceList count]) { int best, best_score, score; best_score = 1e6; best = -1; for (i = 0; i < [_faceList count]; i++) { NSArray *font_info = [_faceList objectAtIndex: i]; score = score_difference(_weight, _traits, [[font_info objectAtIndex: 2] intValue], [[font_info objectAtIndex: 3] unsignedIntValue]); if (score < best_score) { best = i; best_score = score; } } if (best != -1) i = best; } if (i == [_faceList count]) i = 0; _face = i; [faceBrowser loadColumnZero]; [faceBrowser selectRow: i inColumn: 0]; /* Also make sure the size column has some value */ { NSTextField *sizeField = [[self contentView] viewWithTag: NSFPSizeField]; float size = [sizeField floatValue]; if (size == 0.0) { [self _trySelectSize: 12.0 updateSizeField: YES]; } } [self _doPreview]; } - (void) _faceSelectionChanged: (id)sender { NSBrowser *faceBrowser = [[self contentView] viewWithTag: NSFPFaceBrowser]; int row = [faceBrowser selectedRowInColumn: 0]; NSArray *font_info = [_faceList objectAtIndex: row]; _face = row; _weight = [[font_info objectAtIndex: 2] intValue]; _traits = [[font_info objectAtIndex: 3] unsignedIntValue]; [self _doPreview]; } - (void) _sizeSelectionChanged: (id)sender { NSBrowser *sizeBrowser = [[self contentView] viewWithTag: NSFPSizeBrowser]; int row = [sizeBrowser selectedRowInColumn: 0]; NSTextField *sizeField; sizeField = [[self contentView] viewWithTag: NSFPSizeField]; _setFloatValue (sizeField, sizes[row]); [self _doPreview]; } - (int) browser: (NSBrowser*)sender numberOfRowsInColumn: (int)column { switch ([sender tag]) { case NSFPFamilyBrowser: { return [_familyList count]; } case NSFPFaceBrowser: { return [_faceList count]; } case NSFPSizeBrowser: { return sizeof (sizes) / sizeof (float); } default: { return 0; } } } - (NSString*) browser: (NSBrowser*)sender titleOfColumn: (int)column { switch ([sender tag]) { case NSFPFamilyBrowser: { return _(@"Family"); } case NSFPFaceBrowser: { return _(@"Typeface"); } default: { return @""; } } } - (void) browser: (NSBrowser *)sender willDisplayCell: (id)cell atRow: (NSInteger)row column: (NSInteger)column { NSString *value = nil; if (row < 0) return; switch ([sender tag]) { case NSFPFamilyBrowser: { if ([_familyList count] > (NSUInteger)row) { value = [_familyList objectAtIndex: row]; } break; } case NSFPFaceBrowser: { if ([_faceList count] > (NSUInteger)row) { value = [[_faceList objectAtIndex: row] objectAtIndex: 1]; } break; } case NSFPSizeBrowser: default: { value = [NSString stringWithFormat: @"%d", (int) sizes[row]]; } } [cell setStringValue: value]; [cell setLeaf: YES]; } - (BOOL) browser: (NSBrowser *)sender isColumnValid: (int)column; { return NO; } @end @implementation NSFontPanel (NSSplitViewDelegate) - (void) splitView: (NSSplitView *)splitView constrainMinCoordinate: (float *)min maxCoordinate: (float *)max ofSubviewAt: (int)offset { *max = *max - 100; } @end gnustep-gui-0.24.0/Source/GSXibLoader.m0000664000076500007650000013653412252667554017515 0ustar brains99brains99/* GSXibLoader Xib (Cocoa XML) model loader Copyright (C) 2010, 2011 Free Software Foundation, Inc. Written by: Fred Kiefer Created: March 2010 This file is part of the GNUstep Base Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSNib.h" #import "AppKit/NSNibLoading.h" #import "GNUstepGUI/GSModelLoaderFactory.h" #import "GNUstepGUI/GSNibLoading.h" #import "GNUstepGUI/GSXibLoading.h" @interface NSApplication (NibCompatibility) - (void) _setMainMenu: (NSMenu*)aMenu; @end @interface NSMenu (XibCompatibility) - (BOOL) _isMainMenu; @end @interface NSCustomObject (NibCompatibility) - (id) realObject; - (void) setRealObject: (id)obj; - (NSString *)className; @end @interface NSNibConnector (NibCompatibility) - (id) nibInstantiate; @end @implementation NSMenu (XibCompatibility) - (BOOL) _isMainMenu { if (_name) return [_name isEqualToString:@"_NSMainMenu"]; return NO; } @end @implementation FirstResponder + (id) allocWithZone: (NSZone*)zone { return nil; } @end @implementation IBClassDescriptionSource - (id) initWithCoder: (NSCoder*)coder { if ([coder allowsKeyedCoding]) { if ([coder containsValueForKey: @"majorKey"]) { ASSIGN(majorKey, [coder decodeObjectForKey: @"majorKey"]); } if ([coder containsValueForKey: @"minorKey"]) { ASSIGN(minorKey, [coder decodeObjectForKey: @"minorKey"]); } } else { [NSException raise: NSInvalidArgumentException format: @"Can't decode %@ with %@.",NSStringFromClass([self class]), NSStringFromClass([coder class])]; } return self; } - (void) dealloc { DESTROY(majorKey); DESTROY(minorKey); [super dealloc]; } @end @implementation IBPartialClassDescription - (id) initWithCoder: (NSCoder*)coder { if ([coder allowsKeyedCoding]) { if ([coder containsValueForKey: @"className"]) { ASSIGN(className, [coder decodeObjectForKey: @"className"]); } if ([coder containsValueForKey: @"superclassName"]) { ASSIGN(superclassName, [coder decodeObjectForKey: @"superclassName"]); } if ([coder containsValueForKey: @"actions"]) { ASSIGN(actions, [coder decodeObjectForKey: @"actions"]); } if ([coder containsValueForKey: @"outlets"]) { ASSIGN(outlets, [coder decodeObjectForKey: @"outlets"]); } if ([coder containsValueForKey: @"sourceIdentifier"]) { ASSIGN(sourceIdentifier, [coder decodeObjectForKey: @"sourceIdentifier"]); } } else { [NSException raise: NSInvalidArgumentException format: @"Can't decode %@ with %@.",NSStringFromClass([self class]), NSStringFromClass([coder class])]; } return self; } - (void) dealloc { DESTROY(className); DESTROY(superclassName); DESTROY(actions); DESTROY(outlets); DESTROY(sourceIdentifier); [super dealloc]; } @end @implementation IBClassDescriber - (id) initWithCoder: (NSCoder*)coder { if ([coder allowsKeyedCoding]) { if ([coder containsValueForKey: @"referencedPartialClassDescriptions"]) { ASSIGN(referencedPartialClassDescriptions, [coder decodeObjectForKey: @"referencedPartialClassDescriptions"]); } } else { [NSException raise: NSInvalidArgumentException format: @"Can't decode %@ with %@.",NSStringFromClass([self class]), NSStringFromClass([coder class])]; } return self; } - (void) dealloc { DESTROY(referencedPartialClassDescriptions); [super dealloc]; } @end @implementation IBConnection - (id) initWithCoder: (NSCoder*)coder { if ([coder allowsKeyedCoding]) { if ([coder containsValueForKey: @"label"]) { ASSIGN(label, [coder decodeObjectForKey: @"label"]); } if ([coder containsValueForKey: @"source"]) { ASSIGN(source, [coder decodeObjectForKey: @"source"]); } if ([coder containsValueForKey: @"destination"]) { ASSIGN(destination, [coder decodeObjectForKey: @"destination"]); } } else { [NSException raise: NSInvalidArgumentException format: @"Can't decode %@ with %@.",NSStringFromClass([self class]), NSStringFromClass([coder class])]; } return self; } - (void) encodeWithCoder: (NSCoder*)aCoder { // FIXME } - (void) dealloc { DESTROY(label); DESTROY(source); DESTROY(destination); [super dealloc]; } - (NSString*) label { return label; } - (id) source { return source; } - (id) destination { return destination; } - (NSNibConnector*) nibConnector { NSString *tag = [self label]; NSRange colonRange = [tag rangeOfString: @":"]; NSUInteger location = colonRange.location; NSNibConnector *result = nil; if (location == NSNotFound) { result = [[NSNibOutletConnector alloc] init]; } else { result = [[NSNibControlConnector alloc] init]; } [result setDestination: [self destination]]; [result setSource: [self source]]; [result setLabel: [self label]]; return result; } - (id) nibInstantiate { if ([source respondsToSelector: @selector(nibInstantiate)]) { ASSIGN(source, [source nibInstantiate]); } if ([destination respondsToSelector: @selector(nibInstantiate)]) { ASSIGN(destination, [destination nibInstantiate]); } return self; } - (void) establishConnection { } @end @implementation IBActionConnection - (void) establishConnection { SEL sel = NSSelectorFromString(label); [destination setTarget: source]; [destination setAction: sel]; } @end @implementation IBOutletConnection - (void) establishConnection { NS_DURING { if (source != nil) { NSString *selName; SEL sel; selName = [NSString stringWithFormat: @"set%@%@:", [[label substringToIndex: 1] uppercaseString], [label substringFromIndex: 1]]; sel = NSSelectorFromString(selName); if (sel && [source respondsToSelector: sel]) { [source performSelector: sel withObject: destination]; } else { const char *nam = [label cString]; const char *type; unsigned int size; int offset; /* * Use the GNUstep additional function to set the instance * variable directly. * FIXME - need some way to do this for libFoundation and * Foundation based systems. */ if (GSObjCFindVariable(source, nam, &type, &size, &offset)) { GSObjCSetVariable(source, offset, size, (void*)&destination); } } } } NS_HANDLER { NSLog(@"Error while establishing connection %@: %@",self,[localException reason]); } NS_ENDHANDLER; } @end @implementation IBBindingConnection - (void) dealloc { DESTROY(connector); [super dealloc]; } - (id) initWithCoder: (NSCoder*)coder { self = [super initWithCoder: coder]; if (self == nil) return nil; if ([coder allowsKeyedCoding]) { if ([coder containsValueForKey: @"connector"]) { ASSIGN(connector, [coder decodeObjectForKey: @"connector"]); } } return self; } - (id) nibInstantiate { [connector nibInstantiate]; return [super nibInstantiate]; } - (void) establishConnection { [connector establishConnection]; } @end @implementation IBConnectionRecord - (id) initWithCoder: (NSCoder*)coder { if ([coder allowsKeyedCoding]) { if ([coder containsValueForKey: @"connection"]) { ASSIGN(connection, [coder decodeObjectForKey: @"connection"]); } if ([coder containsValueForKey: @"connectionID"]) { connectionID = [coder decodeIntForKey: @"connectionID"]; } else if ([coder containsValueForKey: @"id"]) { // 4.6+ XIBs.... NSString *string = [coder decodeObjectForKey: @"id"]; connectionID = [string intValue]; } } else { [NSException raise: NSInvalidArgumentException format: @"Can't decode %@ with %@.",NSStringFromClass([self class]), NSStringFromClass([coder class])]; } return self; } - (void) dealloc { DESTROY(connection); [super dealloc]; } - (IBConnection*) connection { return connection; } - (id) nibInstantiate { ASSIGN(connection, [connection nibInstantiate]); return self; } - (void) establishConnection { [connection establishConnection]; } @end @implementation IBToolTipAttribute - (NSString*) toolTip { return toolTip; } - (id) initWithCoder: (NSCoder*)coder { if ([coder allowsKeyedCoding]) { if ([coder containsValueForKey: @"name"]) { ASSIGN(name, [coder decodeObjectForKey: @"name"]); } if ([coder containsValueForKey: @"object"]) { ASSIGN(object, [coder decodeObjectForKey: @"object"]); } if ([coder containsValueForKey: @"toolTip"]) { ASSIGN(toolTip, [coder decodeObjectForKey: @"toolTip"]); } } else { [NSException raise: NSInvalidArgumentException format: @"Can't decode %@ with %@.",NSStringFromClass([self class]), NSStringFromClass([coder class])]; } return self; } - (void) dealloc { DESTROY(name); DESTROY(object); DESTROY(toolTip); [super dealloc]; } @end @implementation IBInitialTabViewItemAttribute - (id) initWithCoder: (NSCoder*)coder { if ([coder allowsKeyedCoding]) { if ([coder containsValueForKey: @"name"]) { ASSIGN(name, [coder decodeObjectForKey: @"name"]); } if ([coder containsValueForKey: @"object"]) { ASSIGN(object, [coder decodeObjectForKey: @"object"]); } if ([coder containsValueForKey: @"initialTabViewItem"]) { ASSIGN(initialTabViewItem, [coder decodeObjectForKey: @"initialTabViewItem"]); } } else { [NSException raise: NSInvalidArgumentException format: @"Can't decode %@ with %@.",NSStringFromClass([self class]), NSStringFromClass([coder class])]; } return self; } - (void) dealloc { DESTROY(name); DESTROY(object); DESTROY(initialTabViewItem); [super dealloc]; } @end @implementation IBObjectRecord - (id) initWithCoder: (NSCoder*)coder { if ([coder allowsKeyedCoding]) { if ([coder containsValueForKey: @"objectID"]) { objectID = [coder decodeIntForKey: @"objectID"]; } else if ([coder containsValueForKey: @"id"]) { // 4.6+ XIBs.... NSString *string = [coder decodeObjectForKey: @"id"]; objectID = [string intValue]; } if ([coder containsValueForKey: @"object"]) { ASSIGN(object, [coder decodeObjectForKey: @"object"]); } if ([coder containsValueForKey: @"children"]) { ASSIGN(children, [coder decodeObjectForKey: @"children"]); } if ([coder containsValueForKey: @"parent"]) { ASSIGN(parent, [coder decodeObjectForKey: @"parent"]); } } else { [NSException raise: NSInvalidArgumentException format: @"Can't decode %@ with %@.",NSStringFromClass([self class]), NSStringFromClass([coder class])]; } return self; } - (void) dealloc { DESTROY(object); DESTROY(children); DESTROY(parent); [super dealloc]; } - (id) object { return object; } - (id) parent { return parent; } - (NSInteger) objectID { return objectID; } - (NSString *) description { return [NSString stringWithFormat: @"<%@, %@, %@, %d>", [self className], object, parent, objectID]; } @end @implementation IBMutableOrderedSet - (id) initWithCoder: (NSCoder*)coder { if ([coder allowsKeyedCoding]) { if ([coder containsValueForKey: @"orderedObjects"]) { ASSIGN(orderedObjects, [coder decodeObjectForKey: @"orderedObjects"]); } } else { [NSException raise: NSInvalidArgumentException format: @"Can't decode %@ with %@.",NSStringFromClass([self class]), NSStringFromClass([coder class])]; } return self; } - (void) dealloc { DESTROY(orderedObjects); [super dealloc]; } - (NSArray*)orderedObjects { return orderedObjects; } - (id) objectWithObjectID: (NSInteger)objID { NSEnumerator *en; IBObjectRecord *obj; en = [orderedObjects objectEnumerator]; while ((obj = [en nextObject]) != nil) { if ([obj objectID] == objID) { return [obj object]; } } return nil; } @end @implementation IBObjectContainer - (id) initWithCoder: (NSCoder*)coder { if ([coder allowsKeyedCoding]) { if ([coder containsValueForKey: @"sourceID"]) { ASSIGN(sourceID, [coder decodeObjectForKey: @"sourceID"]); } if ([coder containsValueForKey: @"maxID"]) { maxID = [coder decodeIntForKey: @"maxID"]; } if ([coder containsValueForKey: @"flattenedProperties"]) { ASSIGN(flattenedProperties, [coder decodeObjectForKey: @"flattenedProperties"]); } if ([coder containsValueForKey: @"objectRecords"]) { ASSIGN(objectRecords, [coder decodeObjectForKey: @"objectRecords"]); } if ([coder containsValueForKey: @"connectionRecords"]) { ASSIGN(connectionRecords, [coder decodeObjectForKey: @"connectionRecords"]); } // We could load more data here, but we currently don't need it. } else { [NSException raise: NSInvalidArgumentException format: @"Can't decode %@ with %@.",NSStringFromClass([self class]), NSStringFromClass([coder class])]; } return self; } - (void) encodeWithCoder: (NSCoder*)aCoder { // FIXME } - (void) dealloc { DESTROY(connectionRecords); DESTROY(objectRecords); DESTROY(flattenedProperties); DESTROY(unlocalizedProperties); DESTROY(activeLocalization); DESTROY(localizations); DESTROY(sourceID); [super dealloc]; } - (NSEnumerator*) connectionRecordEnumerator { return [connectionRecords objectEnumerator]; } - (NSEnumerator*) objectRecordEnumerator { return [[objectRecords orderedObjects] objectEnumerator]; } - (NSDictionary*) propertiesForObjectID: (int)objectID { NSEnumerator *en; NSString *idString; NSString *key; NSMutableDictionary *properties; int idLength; idString = [NSString stringWithFormat: @"%d.", objectID]; idLength = [idString length]; properties = [[NSMutableDictionary alloc] init]; en = [flattenedProperties keyEnumerator]; while ((key = [en nextObject]) != nil) { if ([key hasPrefix: idString]) { id value = [flattenedProperties objectForKey: key]; [properties setObject: value forKey: [key substringFromIndex: idLength]]; } } return AUTORELEASE(properties); } /* Returns a dictionary of the custom class names keyed on the objectIDs. */ - (NSDictionary*) customClassNames { NSMutableDictionary *properties; int i; properties = [[NSMutableDictionary alloc] init]; // We have special objects at -3, -2, -1 and 0 for (i = -3; i < maxID; i++) { NSString *idString; id value; idString = [NSString stringWithFormat: @"%d.CustomClassName", i]; value = [flattenedProperties objectForKey: idString]; if (value) { NSString *key; key = [NSString stringWithFormat: @"%d", i]; [properties setObject: value forKey: key]; } } return properties; } - (id) nibInstantiate { NSEnumerator *en; id obj; // iterate over connections, instantiate, and then establish them. en = [connectionRecords objectEnumerator]; while ((obj = [en nextObject]) != nil) { [obj nibInstantiate]; [obj establishConnection]; } // awaken all objects. en = [[objectRecords orderedObjects] objectEnumerator]; while ((obj = [en nextObject]) != nil) { id realObj; NSDictionary *properties; id value; realObj = [obj object]; if ([realObj respondsToSelector: @selector(nibInstantiate)]) { realObj = [realObj nibInstantiate]; } properties = [self propertiesForObjectID: [obj objectID]]; NSDebugLLog(@"XIB", @"object %ld props %@", (long)[obj objectID], properties); //value = [properties objectForKey: @"windowTemplate.maxSize"]; //value = [properties objectForKey: @"CustomClassName"]; // Activate windows value = [properties objectForKey: @"NSWindowTemplate.visibleAtLaunch"]; if (value != nil) { if ([value boolValue] == YES) { if ([realObj isKindOfClass: [NSWindow class]]) { // bring visible windows to front... [(NSWindow *)realObj orderFront: self]; } } } // Tool tips value = [properties objectForKey: @"IBAttributePlaceholdersKey"]; if (value != nil) { IBToolTipAttribute *tta = [(NSDictionary*)value objectForKey: @"ToolTip"]; if ([realObj respondsToSelector: @selector(setToolTip:)]) { [realObj setToolTip: [tta toolTip]]; } } if ([realObj respondsToSelector: @selector(awakeFromNib)]) { [realObj awakeFromNib]; } } return self; } @end @interface GSXibLoader: GSModelLoader { } @end @implementation GSXibLoader + (NSString*) type { return @"xib"; } + (float) priority { return 4.0; } - (void) awake: (NSArray *)rootObjects inContainer: (IBObjectContainer *)objects withContext: (NSDictionary *)context { NSEnumerator *en; id obj; NSMutableArray *topLevelObjects = [context objectForKey: NSNibTopLevelObjects]; id owner = [context objectForKey: NSNibOwner]; id first = nil; id app = nil; // Get the file's owner and NSApplication object references... if ([[(NSCustomObject*)[rootObjects objectAtIndex: 1] className] isEqualToString: @"FirstResponder"]) first = [(NSCustomObject*)[rootObjects objectAtIndex: 1] realObject]; else NSLog(@"%s:first responder missing\n", __PRETTY_FUNCTION__); if ([[(NSCustomObject*)[rootObjects objectAtIndex: 2] className] isEqualToString: @"NSApplication"]) app = [(NSCustomObject*)[rootObjects objectAtIndex: 2] realObject]; else NSLog(@"%s:NSApplication missing\n", __PRETTY_FUNCTION__); // Use the owner as first root object [(NSCustomObject*)[rootObjects objectAtIndex: 0] setRealObject: owner]; en = [rootObjects objectEnumerator]; while ((obj = [en nextObject]) != nil) { if ([obj respondsToSelector: @selector(nibInstantiate)]) { obj = [obj nibInstantiate]; } // IGNORE file's owner, first responder and NSApplication instances... if ((obj != nil) && (obj != owner) && (obj != first) && (obj != app)) { [topLevelObjects addObject: obj]; // All top level objects must be released by the caller to avoid // leaking, unless they are going to be released by other nib // objects on behalf of the owner. RETAIN(obj); } if (([obj isKindOfClass: [NSMenu class]]) && ([obj _isMainMenu])) { // add the menu... [NSApp _setMainMenu: obj]; } } // Load connections and awaken objects [objects nibInstantiate]; } - (BOOL) loadModelData: (NSData *)data externalNameTable: (NSDictionary *)context withZone: (NSZone *)zone; { BOOL loaded = NO; NSKeyedUnarchiver *unarchiver = nil; NS_DURING { if (data != nil) { unarchiver = [[GSXibKeyedUnarchiver alloc] initForReadingWithData: data]; if (unarchiver != nil) { NSArray *rootObjects; IBObjectContainer *objects; NSDebugLLog(@"XIB", @"Invoking unarchiver"); [unarchiver setObjectZone: zone]; rootObjects = [unarchiver decodeObjectForKey: @"IBDocument.RootObjects"]; objects = [unarchiver decodeObjectForKey: @"IBDocument.Objects"]; NSDebugLLog(@"XIB", @"rootObjects %@", rootObjects); [self awake: rootObjects inContainer: objects withContext: context]; loaded = YES; RELEASE(unarchiver); } else { NSLog(@"Could not instantiate Xib unarchiver."); } } else { NSLog(@"Data passed to Xib loading method is nil."); } } NS_HANDLER { NSLog(@"Exception occured while loading model: %@",[localException reason]); // TEST_RELEASE(unarchiver); } NS_ENDHANDLER if (loaded == NO) { NSLog(@"Failed to load Xib\n"); } return loaded; } - (NSData*) dataForFile: (NSString*)fileName { NSFileManager *mgr = [NSFileManager defaultManager]; BOOL isDir = NO; NSDebugLLog(@"XIB", @"Loading Xib `%@'...\n", fileName); if ([mgr fileExistsAtPath: fileName isDirectory: &isDir]) { if (isDir == NO) { return [NSData dataWithContentsOfFile: fileName]; } else { NSLog(@"Xib file specified %@, is directory.", fileName); } } else { NSLog(@"Xib file specified %@, could not be found.", fileName); } return nil; } @end @implementation GSXibElement - (GSXibElement*) initWithType: (NSString*)typeName andAttributes: (NSDictionary*)attribs { ASSIGN(type, typeName); ASSIGN(attributes, attribs); elements = [[NSMutableDictionary alloc] init]; values = [[NSMutableArray alloc] init]; return self; } - (void) dealloc { DESTROY(type); DESTROY(attributes); DESTROY(elements); DESTROY(values); DESTROY(value); [super dealloc]; } - (NSString*) type { return type; } - (NSString*) value { return value; } - (NSDictionary*) elements { return elements; } - (NSArray*) values { return values; } - (void) addElement: (GSXibElement*)element { [values addObject: element]; } - (void) setElement: (GSXibElement*)element forKey: (NSString*)key { [elements setObject: element forKey: key]; } - (void) setValue: (NSString*)text { ASSIGN(value, text); } - (NSString*) attributeForKey: (NSString*)key { return [attributes objectForKey: key]; } - (GSXibElement*) elementForKey: (NSString*)key { return [elements objectForKey: key]; } - (NSString*) description { return [NSString stringWithFormat: @"GSXibElement <%@> attrs (%@) elements [%@] values [%@] %@", type, attributes, elements, values, value, nil]; } @end @implementation GSXibKeyedUnarchiver - (NSData *) _preProcessXib: (NSData *)data { NSData *result = data; NSXMLDocument *document = [[NSXMLDocument alloc] initWithData:data options:0 error:NULL]; if (document == nil) { NSLog(@"%s:DOCUMENT IS NIL: %@\n", __PRETTY_FUNCTION__, document); } else { NSArray *customClassNodes = [document nodesForXPath:@"//dictionary[@key=\"flattenedProperties\"]/" @"string[contains(@key,\"CustomClassName\")]" error:NULL]; NSMutableDictionary *customClassDict = [NSMutableDictionary dictionary]; if (customClassNodes) { NSDebugLLog(@"PREXIB", @"%s:customClassNodes: %@\n", __PRETTY_FUNCTION__, customClassNodes); // Replace the NSXMLNodes with a dictionary... NSInteger index = 0; for (index = 0; index < [customClassNodes count]; ++index) { id node = [customClassNodes objectAtIndex:index]; if ([node isMemberOfClass:[NSXMLElement class]]) { NSString *key = [[node attributeForName:@"key"] stringValue]; if ([key rangeOfString:@"CustomClassName"].location != NSNotFound) { [customClassDict setObject:[node stringValue] forKey:key]; } } } } else { NSArray *flatProps = [document nodesForXPath:@"//object[@key=\"flattenedProperties\"]" error:NULL]; if ([flatProps count] == 1) { NSInteger index = 0; NSArray *xmlKeys = [[flatProps objectAtIndex:0] nodesForXPath:@"//object[@key=\"flattenedProperties\"]/object[@key=\"dict.sortedKeys\"]/*" error:NULL]; NSArray *xmlObjs = [[flatProps objectAtIndex:0] nodesForXPath:@"//object[@key=\"flattenedProperties\"]/object[@key=\"dict.values\"]/*" error:NULL]; if ([xmlKeys count] != [xmlObjs count]) { NSLog(@"%s:keys to objs count mismatch - keys: %d objs: %d\n", __PRETTY_FUNCTION__, (int)[xmlKeys count], (int)[xmlObjs count]); } else { for (index = 0; index < [xmlKeys count]; ++index) { id key = [[xmlKeys objectAtIndex:index] stringValue]; if ([key rangeOfString:@"CustomClassName"].location != NSNotFound) { // NSString *obj = [[xmlObjs objectAtIndex:index] stringValue]; [customClassDict setObject:[[xmlObjs objectAtIndex:index] stringValue] forKey:key]; } } } } } NSDebugLLog(@"PREXIB", @"%s:customClassDict: %@\n", __PRETTY_FUNCTION__, customClassDict); if ([customClassDict count] > 0) { NSArray *objectRecords = nil; NSEnumerator *en = [[customClassDict allKeys] objectEnumerator]; NSString *key = nil; while ((key = [en nextObject]) != nil) { NSString *keyValue = [key stringByReplacingOccurrencesOfString:@".CustomClassName" withString:@""]; NSString *className = [customClassDict objectForKey: key]; NSString *objectRecordXpath = nil; objectRecordXpath = [NSString stringWithFormat: @"//object[@class=\"IBObjectRecord\"]/" @"int[@key=\"objectID\"][text()=\"%@\"]/../reference", keyValue]; objectRecords = [document nodesForXPath: objectRecordXpath error: NULL]; if (objectRecords == nil) { // If that didn't work then it could be a 4.6+ XIB... objectRecordXpath = [NSString stringWithFormat: @"//object[@class=\"IBObjectRecord\"]/" @"string[@key=\"id\"][text()=\"%@\"]/../reference", keyValue]; objectRecords = [document nodesForXPath: objectRecordXpath error: NULL]; } NSString *refId = nil; if ([objectRecords count] > 0) { id record = nil; NSEnumerator *oen = [objectRecords objectEnumerator]; while ((record = [oen nextObject]) != nil) { if ([record isMemberOfClass:[NSXMLElement class]]) { if([[[record attributeForName:@"key"] stringValue] isEqualToString:@"object"]) { NSArray *classNodes = nil; id classNode = nil; NSString *refXpath = nil; refId = [[record attributeForName:@"ref"] stringValue]; refXpath = [NSString stringWithFormat:@"//object[@id=\"%@\"]",refId]; classNodes = [document nodesForXPath:refXpath error:NULL]; if([classNodes count] > 0) { id classAttr = nil; Class cls = NSClassFromString(className); classNode = [classNodes objectAtIndex:0]; classAttr = [classNode attributeForName:@"class"]; [classAttr setStringValue:className]; if (cls != nil) { if ([cls respondsToSelector:@selector(cellClass)]) { NSArray *cellNodes = nil; id cellNode = nil; id cellClass = [cls cellClass]; NSString *cellXpath = [NSString stringWithFormat:@"//object[@id=\"%@\"]/object[@key=\"NSCell\"]",refId]; cellNodes = [document nodesForXPath:cellXpath error:NULL]; if ([cellNodes count] > 0) { NSString *cellClassString = NSStringFromClass(cellClass); id cellAttr = nil; cellNode = [cellNodes objectAtIndex:0]; cellAttr = [cellNode attributeForName:@"class"]; [cellAttr setStringValue:cellClassString]; } } } } } } } } } } result = [document XMLData]; RELEASE(document); } return result; } - (id) initForReadingWithData: (NSData*)data { NSXMLParser *theParser; NSData *theData = data; // If we are in the interface builder app, do not replace // the existing classes with their custom subclasses. if([NSClassSwapper isInInterfaceBuilder] == NO) { theData = [self _preProcessXib: data]; } objects = [[NSMutableDictionary alloc] init]; stack = [[NSMutableArray alloc] init]; decoded = [[NSMutableDictionary alloc] init]; theParser = [[NSXMLParser alloc] initWithData: theData]; [theParser setDelegate: self]; NS_DURING { // Parse the XML data [theParser parse]; } NS_HANDLER { NSLog(@"Exception occured while parsing Xib: %@",[localException reason]); DESTROY(self); } NS_ENDHANDLER DESTROY(theParser); return self; } - (void) dealloc { DESTROY(objects); DESTROY(stack); DESTROY(decoded); [super dealloc]; } - (void) parser: (NSXMLParser*)parser foundCharacters: (NSString*)string { [currentElement setValue: string]; } - (void) parser: (NSXMLParser*)parser didStartElement: (NSString*)elementName namespaceURI: (NSString*)namespaceURI qualifiedName: (NSString*)qualifiedName attributes: (NSDictionary*)attributeDict { GSXibElement *element = [[GSXibElement alloc] initWithType: elementName andAttributes: attributeDict]; NSString *key = [attributeDict objectForKey: @"key"]; NSString *ref = [attributeDict objectForKey: @"id"]; // FIXME: We should use proper memory management here AUTORELEASE(element); if ([@"document" isEqualToString: elementName]) { [NSException raise: NSInvalidArgumentException format: @"Cannot decode XIB 5 format."]; } if (key != nil) { [currentElement setElement: element forKey: key]; } else { // For Arrays [currentElement addElement: element]; } if (ref != nil) { [objects setObject: element forKey: ref]; } if (![@"archive" isEqualToString: elementName] && ![@"data" isEqualToString: elementName]) { // only used for the root element // push [stack addObject: currentElement]; } if (![@"archive" isEqualToString: elementName]) { currentElement = element; } } - (void) parser: (NSXMLParser*)parser didEndElement: (NSString*)elementName namespaceURI: (NSString*)namespaceURI qualifiedName: (NSString*)qName { if (![@"archive" isEqualToString: elementName] && ![@"data" isEqualToString: elementName]) { // pop currentElement = [stack lastObject]; [stack removeLastObject]; } } - (id) allocObjectForClassName: (NSString*)classname { Class c = nil; id delegate = [self delegate]; c = [self classForClassName: classname]; if (c == nil) { c = [[self class] classForClassName: classname]; if (c == nil) { c = NSClassFromString(classname); if (c == nil) { c = [delegate unarchiver: self cannotDecodeObjectOfClassName: classname originalClasses: nil]; if (c == nil) { [NSException raise: NSInvalidUnarchiveOperationException format: @"[%@ -%@]: no class for name '%@'", NSStringFromClass([self class]), NSStringFromSelector(_cmd), classname]; } } } } // Create instance. return [c allocWithZone: [self zone]]; } - (BOOL) replaceObject: (id)oldObj withObject: (id)newObj { NSEnumerator *keyEnumerator = [decoded keyEnumerator]; id key; BOOL found = NO; while ((key = [keyEnumerator nextObject]) != nil) { id obj = [decoded objectForKey: key]; if (obj == oldObj) { found = YES; break; } } if (found) { [decoded setObject: newObj forKey: key]; } return found; } - (id) decodeObjectForXib: (GSXibElement*)element forClassName: (NSString*)classname withID: (NSString*)objID { GSXibElement *last; id o, r; id delegate = [self delegate]; // Create instance. o = [self allocObjectForClassName: classname]; // Make sure the object stays around, even when replaced. RETAIN(o); if (objID != nil) [decoded setObject: o forKey: objID]; // push last = currentElement; currentElement = element; r = [o initWithCoder: self]; // pop currentElement = last; if (r != o) { [delegate unarchiver: self willReplaceObject: o withObject: r]; ASSIGN(o, r); if (objID != nil) [decoded setObject: o forKey: objID]; } r = [o awakeAfterUsingCoder: self]; if (r != o) { [delegate unarchiver: self willReplaceObject: o withObject: r]; ASSIGN(o, r); if (objID != nil) [decoded setObject: o forKey: objID]; } if (delegate != nil) { r = [delegate unarchiver: self didDecodeObject: o]; if (r != o) { [delegate unarchiver: self willReplaceObject: o withObject: r]; ASSIGN(o, r); if (objID != nil) [decoded setObject: o forKey: objID]; } } // Balance the retain above RELEASE(o); if (objID != nil) { NSDebugLLog(@"XIB", @"decoded object %@ for id %@", o, objID); } return AUTORELEASE(o); } /* This method is a copy of decodeObjectForXib:forClassName:withKey: The only difference being in the way we decode the object and the missing context switch. */ - (id) decodeDictionaryForXib: (GSXibElement*)element forClassName: (NSString*)classname withID: (NSString*)objID { id o, r; id delegate = [self delegate]; // Create instance. o = [self allocObjectForClassName: classname]; // Make sure the object stays around, even when replaced. RETAIN(o); if (objID != nil) [decoded setObject: o forKey: objID]; r = [o initWithDictionary: [self _decodeDictionaryOfObjectsForElement: element]]; if (r != o) { [delegate unarchiver: self willReplaceObject: o withObject: r]; ASSIGN(o, r); if (objID != nil) [decoded setObject: o forKey: objID]; } r = [o awakeAfterUsingCoder: self]; if (r != o) { [delegate unarchiver: self willReplaceObject: o withObject: r]; ASSIGN(o, r); if (objID != nil) [decoded setObject: o forKey: objID]; } if (delegate != nil) { r = [delegate unarchiver: self didDecodeObject: o]; if (r != o) { [delegate unarchiver: self willReplaceObject: o withObject: r]; ASSIGN(o, r); if (objID != nil) [decoded setObject: o forKey: objID]; } } // Balance the retain above RELEASE(o); if (objID != nil) { NSDebugLLog(@"XIB", @"decoded object %@ for id %@", o, objID); } return AUTORELEASE(o); } - (id) objectForXib: (GSXibElement*)element { NSString *elementName; NSString *objID; if (element == nil) return nil; NSDebugLLog(@"XIB", @"decoding element %@", element); objID = [element attributeForKey: @"id"]; if (objID) { id new = [decoded objectForKey: objID]; if (new != nil) { // The object was already decoded as a reference return new; } } elementName = [element type]; if ([@"object" isEqualToString: elementName]) { NSString *classname = [element attributeForKey: @"class"]; return [self decodeObjectForXib: element forClassName: classname withID: objID]; } else if ([@"string" isEqualToString: elementName]) { NSString *type = [element attributeForKey: @"type"]; id new = [element value]; if ([type isEqualToString: @"base64-UTF8"]) { NSData *d = [new dataUsingEncoding: NSASCIIStringEncoding]; d = [GSMimeDocument decodeBase64: d]; new = AUTORELEASE([[NSString alloc] initWithData: d encoding: NSUTF8StringEncoding]); } // empty strings are not nil! if (new == nil) new = @""; if (objID != nil) [decoded setObject: new forKey: objID]; return new; } else if ([@"int" isEqualToString: elementName]) { id new = [NSNumber numberWithInt: [[element value] intValue]]; if (objID != nil) [decoded setObject: new forKey: objID]; return new; } else if ([@"double" isEqualToString: elementName]) { id new = [NSNumber numberWithDouble: [[element value] doubleValue]]; if (objID != nil) [decoded setObject: new forKey: objID]; return new; } else if ([@"bool" isEqualToString: elementName]) { id new = [NSNumber numberWithBool: [[element value] boolValue]]; if (objID != nil) [decoded setObject: new forKey: objID]; return new; } else if ([@"integer" isEqualToString: elementName]) { NSString *value = [element attributeForKey: @"value"]; id new = [NSNumber numberWithInteger: [value integerValue]]; if (objID != nil) [decoded setObject: new forKey: objID]; return new; } else if ([@"real" isEqualToString: elementName]) { NSString *value = [element attributeForKey: @"value"]; id new = [NSNumber numberWithFloat: [value floatValue]]; if (objID != nil) [decoded setObject: new forKey: objID]; return new; } else if ([@"boolean" isEqualToString: elementName]) { NSString *value = [element attributeForKey: @"value"]; id new = [NSNumber numberWithBool: [value boolValue]]; if (objID != nil) [decoded setObject: new forKey: objID]; return new; } else if ([@"reference" isEqualToString: elementName]) { NSString *ref = [element attributeForKey: @"ref"]; if (ref == nil) { return nil; } else { id new = [decoded objectForKey: ref]; // FIXME: We need a marker for nil if (new == nil) { //NSLog(@"Decoding reference %@", ref); element = [objects objectForKey: ref]; if (element != nil) { // Decode the real object new = [self objectForXib: element]; } } return new; } } else if ([@"nil" isEqualToString: elementName]) { return nil; } else if ([@"characters" isEqualToString: elementName]) { id new = [element value]; if (objID != nil) [decoded setObject: new forKey: objID]; return new; } else if ([@"bytes" isEqualToString: elementName]) { id new = [[element value] dataUsingEncoding: NSASCIIStringEncoding allowLossyConversion: NO]; new = [GSMimeDocument decodeBase64: new]; if (objID != nil) [decoded setObject: new forKey: objID]; return new; } else if ([@"array" isEqualToString: elementName]) { NSString *classname = [element attributeForKey: @"class"]; if (classname == nil) { classname = @"NSArray"; } return [self decodeObjectForXib: element forClassName: classname withID: objID]; } else if ([@"dictionary" isEqualToString: elementName]) { NSString *classname = [element attributeForKey: @"class"]; if (classname == nil) { classname = @"NSDictionary"; } return [self decodeDictionaryForXib: element forClassName: classname withID: objID]; } else { NSLog(@"Unknown element type %@", elementName); } return nil; } - (id) _decodeArrayOfObjectsForKey: (NSString*)aKey { // FIXME: This is wrong but the only way to keep the code for // [NSArray-initWithCoder:] working return [self _decodeArrayOfObjectsForElement: currentElement]; } - (id) _decodeArrayOfObjectsForElement: (GSXibElement*)element { NSArray *values = [element values]; int max = [values count]; id list[max]; int i; for (i = 0; i < max; i++) { list[i] = [self objectForXib: [values objectAtIndex: i]]; if (list[i] == nil) NSLog(@"No object for %@ at index %d", [values objectAtIndex: i], i); } return [NSArray arrayWithObjects: list count: max]; } - (id) _decodeDictionaryOfObjectsForElement: (GSXibElement*)element { NSDictionary *elements = [element elements]; NSEnumerator *en; NSString *key; NSMutableDictionary *dict; dict = [[NSMutableDictionary alloc] init]; en = [elements keyEnumerator]; while ((key = [en nextObject]) != nil) { id obj = [self objectForXib: [elements objectForKey: key]]; if (obj == nil) NSLog(@"No object for %@ at key %@", [elements objectForKey: key], key); else [dict setObject: obj forKey: key]; } return AUTORELEASE(dict); } /* Extension method to decode the object id of an object referenced by its key. */ - (NSString *) decodeReferenceForKey: (NSString*)aKey { GSXibElement *element = [currentElement elementForKey: aKey]; NSString *objID; if (element == nil) return nil; objID = [element attributeForKey: @"id"]; if (objID) { return objID; } objID = [element attributeForKey: @"ref"]; if (objID) { return objID; } return nil; } - (BOOL) containsValueForKey: (NSString*)aKey { GSXibElement *element = [currentElement elementForKey: aKey]; return (element != nil); } - (id) decodeObjectForKey: (NSString*)aKey { GSXibElement *element = [currentElement elementForKey: aKey]; if (element == nil) return nil; return [self objectForXib: element]; } - (BOOL) decodeBoolForKey: (NSString*)aKey { id o = [self decodeObjectForKey: aKey]; if (o != nil) { if ([o isKindOfClass: [NSNumber class]] == YES) { return [o boolValue]; } else { [NSException raise: NSInvalidUnarchiveOperationException format: @"[%@ +%@]: value for key(%@) is '%@'", NSStringFromClass([self class]), NSStringFromSelector(_cmd), aKey, o]; } } return NO; } - (const uint8_t*) decodeBytesForKey: (NSString*)aKey returnedLength: (NSUInteger*)length { id o = [self decodeObjectForKey: aKey]; if (o != nil) { if ([o isKindOfClass: [NSData class]] == YES) { *length = [o length]; return [o bytes]; } else { [NSException raise: NSInvalidUnarchiveOperationException format: @"[%@ +%@]: value for key(%@) is '%@'", NSStringFromClass([self class]), NSStringFromSelector(_cmd), aKey, o]; } } *length = 0; return 0; } - (double) decodeDoubleForKey: (NSString*)aKey { id o = [self decodeObjectForKey: aKey]; if (o != nil) { if ([o isKindOfClass: [NSNumber class]] == YES) { return [o doubleValue]; } else { [NSException raise: NSInvalidUnarchiveOperationException format: @"[%@ +%@]: value for key(%@) is '%@'", NSStringFromClass([self class]), NSStringFromSelector(_cmd), aKey, o]; } } return 0.0; } - (float) decodeFloatForKey: (NSString*)aKey { id o = [self decodeObjectForKey: aKey]; if (o != nil) { if ([o isKindOfClass: [NSNumber class]] == YES) { return [o floatValue]; } else { [NSException raise: NSInvalidUnarchiveOperationException format: @"[%@ +%@]: value for key(%@) is '%@'", NSStringFromClass([self class]), NSStringFromSelector(_cmd), aKey, o]; } } return 0.0; } - (int) decodeIntForKey: (NSString*)aKey { id o = [self decodeObjectForKey: aKey]; if (o != nil) { if ([o isKindOfClass: [NSNumber class]] == YES) { long long l = [o longLongValue]; return l; } else { [NSException raise: NSInvalidUnarchiveOperationException format: @"[%@ +%@]: value for key(%@) is '%@'", NSStringFromClass([self class]), NSStringFromSelector(_cmd), aKey, o]; } } return 0; } - (int32_t) decodeInt32ForKey: (NSString*)aKey { id o = [self decodeObjectForKey: aKey]; if (o != nil) { if ([o isKindOfClass: [NSNumber class]] == YES) { long long l = [o longLongValue]; return l; } else { [NSException raise: NSInvalidUnarchiveOperationException format: @"[%@ +%@]: value for key(%@) is '%@'", NSStringFromClass([self class]), NSStringFromSelector(_cmd), aKey, o]; } } return 0; } - (int64_t) decodeInt64ForKey: (NSString*)aKey { id o = [self decodeObjectForKey: aKey]; if (o != nil) { if ([o isKindOfClass: [NSNumber class]] == YES) { long long l = [o longLongValue]; return l; } else { [NSException raise: NSInvalidUnarchiveOperationException format: @"[%@ +%@]: value for key(%@) is '%@'", NSStringFromClass([self class]), NSStringFromSelector(_cmd), aKey, o]; } } return 0; } @end gnustep-gui-0.24.0/Source/NSTextView.m0000664000076500007650000054460312232762252017417 0ustar brains99brains99/** NSTextView Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2008 Free Software Foundation, Inc. Much code of this class was originally derived from code which was in NSText.m. Author: Scott Christley Date: 1996 Author: Felipe A. Rodriguez Date: July 1998 Author: Daniel Boehringer Date: August 1998 Author: Fred Kiefer Date: March 2000, September 2000, January 2008 Author: Nicola Pero Date: 2000, 2001, 2002 Author: Pierre-Yves Rivaille Date: September 2002 Extensive reworking: Alexander Malmberg Date: December 2002 - February 2003 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSAttributedString.h" #import "AppKit/NSClipView.h" #import "AppKit/NSColor.h" #import "AppKit/NSColorPanel.h" #import "AppKit/NSControl.h" #import "AppKit/NSCursor.h" #import "AppKit/NSDragging.h" #import "AppKit/NSEvent.h" #import "AppKit/NSFileWrapper.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSImage.h" #import "AppKit/NSKeyValueBinding.h" #import "AppKit/NSLayoutManager.h" #import "AppKit/NSMenu.h" #import "AppKit/NSMenuItem.h" #import "AppKit/NSParagraphStyle.h" #import "AppKit/NSPasteboard.h" #import "AppKit/NSRulerMarker.h" #import "AppKit/NSRulerView.h" #import "AppKit/NSScrollView.h" #import "AppKit/NSSpellChecker.h" #import "AppKit/NSTextAttachment.h" #import "AppKit/NSTextContainer.h" #import "AppKit/NSTextStorage.h" #import "AppKit/NSTextView.h" #import "AppKit/NSWindow.h" #import "GSGuiPrivate.h" #import "GSTextFinder.h" #import "GSToolTips.h" #import "GSFastEnumeration.h" #import "GSAutocompleteWindow.h" /* NSTextView_actions.m has comments about what methods dealing with user actions and user-initiated changes need to do. These also apply to some methods in this file. */ /* TODOs: think hard about insertion point management How should resizing work? If the text view is set to track the used part of the text container, when does it actually update its size? Might need a new internal method called from NSLayoutManager when text has changed. (Currently NSLayoutManager calls -sizeToFit when text has changed.) */ @interface NSTextViewUndoObject : NSObject { NSRange range; NSAttributedString *string; } - (id) initWithRange: (NSRange)aRange attributedString: (NSAttributedString *)aString; - (NSRange) range; - (void) setRange: (NSRange)aRange; - (void) performUndo: (NSTextStorage *)aTextStorage; - (NSTextView *) bestTextViewForTextStorage: (NSTextStorage *)aTextStorage; @end /* Interface for a bunch of internal methods that need to be cleaned up. */ @interface NSTextView (GNUstepPrivate) - (NSUInteger) _characterIndexForPoint: (NSPoint)point respectFraction: (BOOL)respectFraction; /* * Used to implement the blinking insertion point */ - (void) _blink: (NSTimer *)t; /* * these NSLayoutManager- like method is here only informally */ - (NSRect) rectForCharacterRange: (NSRange)aRange; // // GNU utility methods // - (void) copySelection; - (void) pasteSelection; /* * Text checking */ - (void) _scheduleTextCheckingInVisibleRectIfNeeded; - (void) _textDidChange: (NSNotification*)notif; - (void) _textCheckingTimerFired: (NSTimer *)t; /* * helper method for ruler view */ - (void) _becomeRulerClient; - (void) _resignRulerClient; @end // This class is a helper for keyed unarchiving only @interface NSTextViewSharedData : NSObject { @private NSColor *backgroundColor; NSParagraphStyle *paragraphStyle; unsigned int flags; NSColor *insertionColor; NSDictionary *linkAttr; NSDictionary *markAttr; NSDictionary *selectedAttr; NSTextView *textView; } - (NSColor *) backgroundColor; - (NSParagraphStyle *) paragraphStyle; - (unsigned int) flags; - (NSColor *) insertionColor; - (NSDictionary *) linkAttributes; - (NSDictionary *) markAttributes; - (NSDictionary *) selectedAttributes; - (NSTextView *) textView; @end @implementation NSTextViewSharedData - (id) initWithTextView: (NSTextView *)tv { if ((self = [super init]) != nil) { flags = (([tv isSelectable]?0x01:0) | ([tv isEditable]?0x02:0) | ([tv isRichText]?0x04:0) | ([tv importsGraphics]?0x08:0) | ([tv isFieldEditor]?0x10:0) | ([tv usesFontPanel]?0x20:0) | ([tv isRulerVisible]?0x40:0) | ([tv isContinuousSpellCheckingEnabled]?0x80:0) | ([tv usesRuler]?0x100:0) | ([tv smartInsertDeleteEnabled]?0x200:0) | ([tv allowsUndo]?0x400:0) | ([tv drawsBackground]?0x800:0) | ([tv usesFindPanel]?0x2000:0)); ASSIGN(backgroundColor, [tv backgroundColor]); ASSIGN(paragraphStyle, [tv defaultParagraphStyle]); ASSIGN(insertionColor, [tv insertionPointColor]); ASSIGN(markAttr, [tv markedTextAttributes]); ASSIGN(linkAttr, [tv linkTextAttributes]); ASSIGN(selectedAttr, [tv selectedTextAttributes]); linkAttr = nil; textView = tv; } return self; } - (id) initWithCoder: (NSCoder*)aDecoder { if ([aDecoder allowsKeyedCoding]) { ASSIGN(backgroundColor, [aDecoder decodeObjectForKey: @"NSBackgroundColor"]); ASSIGN(paragraphStyle, [aDecoder decodeObjectForKey: @"NSDefaultParagraphStyle"]); flags = [aDecoder decodeIntForKey: @"NSFlags"]; ASSIGN(insertionColor, [aDecoder decodeObjectForKey: @"NSInsertionColor"]); ASSIGN(linkAttr, [aDecoder decodeObjectForKey: @"NSLinkAttributes"]); ASSIGN(markAttr, [aDecoder decodeObjectForKey: @"NSMarkedAttributes"]); ASSIGN(selectedAttr, [aDecoder decodeObjectForKey: @"NSSelectedAttributes"]); } return self; } - (void) encodeWithCoder: (NSCoder *)coder { if ([coder allowsKeyedCoding]) { [coder encodeObject: backgroundColor forKey: @"NSBackgroundColor"]; [coder encodeObject: paragraphStyle forKey: @"NSDefaultParagraphStyle"]; [coder encodeInt: flags forKey: @"NSFlags"]; [coder encodeObject: insertionColor forKey: @"NSInsertionColor"]; [coder encodeObject: linkAttr forKey: @"NSLinkAttributes"]; [coder encodeObject: markAttr forKey: @"NSMarkedAttributes"]; [coder encodeObject: selectedAttr forKey: @"NSSelectedAttributes"]; } } - (void) dealloc { RELEASE(backgroundColor); RELEASE(paragraphStyle); RELEASE(insertionColor); RELEASE(linkAttr); RELEASE(markAttr); RELEASE(selectedAttr); [super dealloc]; } - (NSColor *)backgroundColor { return backgroundColor; } - (NSParagraphStyle *) paragraphStyle { return paragraphStyle; } - (unsigned int) flags { return flags; } - (NSColor *) insertionColor { return insertionColor; } - (NSDictionary *) linkAttributes { return linkAttr; } - (NSDictionary *) markAttributes { return markAttr; } - (NSDictionary *) selectedAttributes { return selectedAttr; } - (NSTextView *) textView { return textView; } @end @interface NSTextStorage(NSTextViewUndoSupport) - (void) _undoTextChange: (NSTextViewUndoObject *)anObject; @end /**** Misc. helpers and stuff ****/ static const int currentVersion = 4; static BOOL noLayoutManagerException(void) { [NSException raise: NSGenericException format: @"Can't edit a NSTextView without a layout manager!"]; return YES; } /* The shared notification center */ static NSNotificationCenter *notificationCenter; /* Default max. size. Don't change this without understanding and checking for roundoff issues. Whole points should be representable. */ #define GSHUGE 1e7 /**** Synchronization stuff ****/ /* For when more than one text view is connected to a layout manager. Helpers are here, the actual methods are in the main implementation. */ @implementation NSTextView (GSTextViewSync) #define SET_DELEGATE_NOTIFICATION(notif_name) \ if ([_delegate respondsToSelector: @selector(text##notif_name:)]) \ [notificationCenter addObserver: _delegate \ selector: @selector(text##notif_name:) \ name: NSText##notif_name##Notification \ object: _notifObject] /* * Synchronizing flags. Used to manage synchronizing shared * attributes between textviews coupled with the same layout manager. * These synchronizing flags are only accessed when * _tf.multiple_textviews == YES and this can only happen if we have * a non-nil NSLayoutManager - so we don't check. */ /* YES when in the process of synchronizing text view attributes. Used to avoid recursive synchronizations. */ #define IS_SYNCHRONIZING_FLAGS _layoutManager->_isSynchronizingFlags /* YES when in the process of synchronizing delegates. Used to avoid recursive synchronizations. */ #define IS_SYNCHRONIZING_DELEGATES _layoutManager->_isSynchronizingDelegates /* This gets sent to all text views connected to a layout manager whenever a text container is added or removed, or if a text container changes text view. When a text container is removed, it is also sent to the text view of the removed text view. It is also sent by -setTextContainer:. This will be sent several times to the same text view for one change in some cases, so it needs to be safe wrt. that. */ - (void) _updateMultipleTextViews { id oldNotifObject = _notifObject; if ([[_layoutManager textContainers] count] > 1) { _tf.multiple_textviews = YES; _notifObject = [_layoutManager firstTextView]; } else { _tf.multiple_textviews = NO; _notifObject = self; } /* The notifications only need to be reset once for each change, but doing it several times doesn't hurt. */ if ((_delegate != nil) && (oldNotifObject != _notifObject)) { [notificationCenter removeObserver: _delegate name: nil object: oldNotifObject]; if ([_delegate respondsToSelector: @selector(textView:shouldChangeTextInRange:replacementString:)]) { _tf.delegate_responds_to_should_change = YES; } else { _tf.delegate_responds_to_should_change = NO; } /* SET_DELEGATE_NOTIFICATION defined at the beginning of file */ /* NSText notifications */ SET_DELEGATE_NOTIFICATION(DidBeginEditing); SET_DELEGATE_NOTIFICATION(DidChange); SET_DELEGATE_NOTIFICATION(DidEndEditing); /* NSTextView notifications */ SET_DELEGATE_NOTIFICATION(ViewDidChangeSelection); SET_DELEGATE_NOTIFICATION(ViewWillChangeNotifyingTextView); SET_DELEGATE_NOTIFICATION(ViewDidChangeTypingAttributes); } } /* _syncTextViewsByCalling:withFlag: calls a set method on all text views sharing the same layout manager as this one. It sets the IS_SYNCHRONIZING_FLAGS flag to YES to prevent recursive calls; calls the specified action on all the textviews (this one included) with the specified flag; sets back the IS_SYNCHRONIZING_FLAGS flag to NO; then returns. We need to explicitly call the methods - we can't copy the flags directly from one textview to another - to allow subclasses to override eg. -setEditable: to take some particular action when editing is turned on or off. */ - (void) _syncTextViewsByCalling: (SEL)action withFlag: (BOOL)flag { NSArray *array; NSUInteger i, count; if (IS_SYNCHRONIZING_FLAGS == YES) { [NSException raise: NSGenericException format: @"_syncTextViewsByCalling:withFlag: called recursively"]; } array = [_layoutManager textContainers]; count = [array count]; IS_SYNCHRONIZING_FLAGS = YES; for (i = 0; i < count; i++) { NSTextView *tv; void (*msg)(id, SEL, BOOL); tv = [(NSTextContainer *)[array objectAtIndex: i] textView]; msg = (void (*)(id, SEL, BOOL))[tv methodForSelector: action]; if (msg != NULL) { (*msg) (tv, action, flag); } else { /* Ahm. What shall we do here. It can't happen, can it ? */ NSLog(@"Weird error - _syncTextViewsByCalling:withFlag: couldn't find method for selector"); } } IS_SYNCHRONIZING_FLAGS = NO; } /* This must be called whenever the delegate changes (directly, through calls to -setDelegate:, or indirectly due to changes in the text system, or being decoded. */ - (void) _recacheDelegateResponses { SEL selector; selector = @selector(textView:shouldChangeTextInRange:replacementString:); if ([_delegate respondsToSelector: selector]) { _tf.delegate_responds_to_should_change = YES; } else { _tf.delegate_responds_to_should_change = NO; } selector = @selector(textView:willChangeSelectionFromCharacterRange:toCharacterRange:); if ([_delegate respondsToSelector: selector]) { _tf.delegate_responds_to_will_change_sel = YES; } else { _tf.delegate_responds_to_will_change_sel = NO; } } /* Called when our state needs updating due to external changes. Currently, this happens when layout has been invalidated, and when we are resized. */ - (void) _updateState: (id)sender { [self sizeToFit]; /* TODO: we don't have to redisplay the entire view */ [self setNeedsDisplay: YES]; [self updateInsertionPointStateAndRestartTimer: [self shouldDrawInsertionPoint]]; [self _updateInputMethodState]; /* In case any sections of text with custom cursors were moved */ [[self window] invalidateCursorRectsForView: self]; } - (void) _layoutManagerDidInvalidateLayout { /* We don't want to do the update right away, since the invalidation might be followed by further invalidation if the user of the text system is making large rearrangements of the text network. This also makes us a lot more forgiving; no real works is done until "later", so the user can have the text network in an inconsistent state for short periods of time. (This shouldn't be relied on, though. If possible, avoid it.) Actually, we want to run as late as possible. However, it seems to me that we must run before [NSWindow -_handleWindowNeedsDisplay:] (or that it would be a very good idea to do so, since we might end up resizing ourselves and stuff like that). Thus, we use -performSelector:... with an order 1 under that for window updating. If the update method is not called before the real redisplay (if someone forces a redisplay right away), we might draw incorrectly, but it shouldn't cause any other harm. */ [[NSRunLoop currentRunLoop] cancelPerformSelector: @selector(_updateState:) target: self argument: nil]; [[NSRunLoop currentRunLoop] performSelector: @selector(_updateState:) target: self argument: nil order: 599999 modes: [NSArray arrayWithObjects: /* TODO: set up array in advance */ NSDefaultRunLoopMode, NSModalPanelRunLoopMode, NSEventTrackingRunLoopMode, nil]]; } @end @interface NSUndoManager(UndoCoalescing) /* Auxiliary method to support coalescing undo actions for typing events in NSTextView. However, the implementation is not restricted to that purpose. */ - (BOOL) _canCoalesceUndoWithTarget: (id)target selector: (SEL)aSelector object: (id)anObject; @end @implementation NSTextView /* The sets smartLeftChars and smartRightChars are used for smart insert and delete. If users paste text into a text view and the character to the left (right) side of the new word is not in the set smartLeftChars (smartRightChars), an extra space is added to that side. Inversely, if users delete a word followed (preceded) by a character in smartRightChars (smartLeftChars), a space character on the other side of the word is deleted as well. */ static NSCharacterSet *smartLeftChars; static NSCharacterSet *smartRightChars; /* Private pasteboard type for adjoining smart paste information with text on the pasteboard. */ static NSString *NSSmartPastePboardType = @"NSSmartPastePboardType"; static NSMenu *textViewMenu; /**** Misc. class methods ****/ +(void) initialize { if ([self class] == [NSTextView class]) { NSMutableCharacterSet *temp; [self setVersion: currentVersion]; notificationCenter = [NSNotificationCenter defaultCenter]; /* The sets smartLeftChars and smartRightChars were derived from OS X. */ temp = [[NSCharacterSet whitespaceAndNewlineCharacterSet] mutableCopy]; [temp addCharactersInString: @"\"#$\'(-/[`{"]; smartLeftChars = [temp copy]; [temp formUnionWithCharacterSet: [NSCharacterSet punctuationCharacterSet]]; smartRightChars = [temp copy]; [temp release]; [self exposeBinding: NSEditableBinding]; } } static BOOL did_register_for_services; +(void) registerForServices { NSArray *types; did_register_for_services = YES; types = [NSArray arrayWithObjects: NSStringPboardType, NSRTFPboardType, NSRTFDPboardType, nil]; NSAssert(NSApp, @"Called before the shared application object was created."); [NSApp registerServicesMenuSendTypes: types returnTypes: types]; } +(NSDictionary *) defaultTypingAttributes { static NSDictionary *defaultTypingAttributes; if (!defaultTypingAttributes) { defaultTypingAttributes = [[NSDictionary alloc] initWithObjectsAndKeys: [NSParagraphStyle defaultParagraphStyle], NSParagraphStyleAttributeName, [NSFont userFontOfSize: 0], NSFontAttributeName, [NSColor textColor], NSForegroundColorAttributeName, nil]; } return defaultTypingAttributes; } + (NSMenu *) defaultMenu { if (!textViewMenu) { textViewMenu = [[NSMenu alloc] initWithTitle: @""]; [textViewMenu insertItemWithTitle: _(@"Cut") action:@selector(cut:) keyEquivalent:@"x" atIndex:0]; [textViewMenu insertItemWithTitle: _(@"Copy") action:@selector(copy:) keyEquivalent:@"c" atIndex:1]; [textViewMenu insertItemWithTitle: _(@"Paste") action:@selector(paste:) keyEquivalent:@"v" atIndex:2]; } return textViewMenu; } /**** Initialization ****/ /* Note that -init* must be completely side-effect-less (outside this NSTextView). In particular, they must _not_ touch the font panel or rulers until whoever created us has a chance to eg. -setUsesFontPanel: NO. Calling any other methods here is dangerous as a sub-class might have overridden them and given them side-effects, so we don't. Note also that if a text view is added to an existing text network, the new text view must not change any attributes of the existing text views. Instead, it sets its own attributes to match the others'. This also applies when a text view's moves to another text network. The only method that is allowed to change which text network a text view belongs to is -setTextContainer:, and it must be called when it changes (NSLayoutManager and NSTextContainer do this for us). Since we can't have any side-effects, we can't call methods to set the values. A sub-class that wants to react to changes caused by moving to a different text network will have to override -setTextContainer: and do whatever it needs to do after calling [super setTextContainer: foo]. (TODO: check that this behavior is acceptable) If a text view is added to an empty text network, it keeps its attributes. */ - (NSTextContainer *) buildUpTextNetwork: (NSSize)aSize { NSTextContainer *textContainer; NSLayoutManager *layoutManager; NSTextStorage *textStorage; textStorage = [[NSTextStorage alloc] init]; layoutManager = [[NSLayoutManager alloc] init]; [textStorage addLayoutManager: layoutManager]; RELEASE(layoutManager); textContainer = [[NSTextContainer alloc] initWithContainerSize: aSize]; [layoutManager addTextContainer: textContainer]; RELEASE(textContainer); /* We keep a flag to remember that we are directly responsible for managing the text network. */ _tf.owns_text_network = YES; // This value gets set once more in setTextContainer: to the same value. _textStorage = textStorage; /* The situation at this point is as follows: textView (us) --RETAINs--> textStorage textStorage --RETAINs--> layoutManager layoutManager --RETAINs--> textContainer */ return textContainer; } /* Designated initializer. */ - (id) initWithFrame: (NSRect)frameRect textContainer: (NSTextContainer *)container { self = [super initWithFrame: frameRect]; if (!self) return nil; if (!did_register_for_services) [[self class] registerForServices]; _minSize = frameRect.size; _maxSize = NSMakeSize(frameRect.size.width, GSHUGE); _textContainerInset = NSZeroSize; ASSIGN(_insertionPointColor, [NSColor textColor]); ASSIGN(_backgroundColor, [NSColor textBackgroundColor]); ASSIGN(_defaultParagraphStyle, [NSParagraphStyle defaultParagraphStyle]); _linkTextAttributes = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithBool: YES], NSUnderlineStyleAttributeName, [NSColor blueColor], NSForegroundColorAttributeName, nil]; _tf.draws_background = YES; _tf.is_horizontally_resizable = NO; _tf.is_vertically_resizable = NO; /* We set defaults for all shared attributes here. If container is already part of a text network, we reset the attributes in -setTextContainer:. */ _tf.is_field_editor = NO; _tf.is_editable = YES; _tf.is_selectable = YES; _tf.is_rich_text = YES; _tf.imports_graphics = NO; _tf.uses_font_panel = YES; _tf.uses_ruler = YES; _tf.is_ruler_visible = NO; _tf.allows_undo = NO; _tf.smart_insert_delete = YES; _tf.uses_find_panel = NO; _tf.accepts_glyph_info = NO; _tf.allows_document_background_color_change = YES; _dragTargetLocation = NSNotFound; _markedRange = NSMakeRange(NSNotFound, 0); [container setTextView: self]; [self invalidateTextContainerOrigin]; [self setPostsFrameChangedNotifications: YES]; [notificationCenter addObserver: self selector: @selector(_updateState:) name: NSViewFrameDidChangeNotification object: self]; [notificationCenter addObserver: self selector: @selector(_textDidChange:) name: NSTextDidChangeNotification object: self]; return self; } - (id) initWithFrame: (NSRect)frameRect { NSTextContainer *aTextContainer; NSSize containerSize = NSMakeSize(NSWidth(frameRect), 1e7); aTextContainer = [self buildUpTextNetwork: containerSize]; self = [self initWithFrame: frameRect textContainer: aTextContainer]; [self setVerticallyResizable: YES]; [aTextContainer setWidthTracksTextView: YES]; /* At this point the situation is as follows: textView (us) --RETAINs--> textStorage textStorage --RETAINs--> layoutManager layoutManager --RETAINs--> textContainer textContainer --RETAINs--> textView (us) */ /* The text system should be destroyed when the textView (us) is released. To get this result, we send a RELEASE message to us breaking the RETAIN cycle. */ RELEASE(self); return self; } /* In earlier versions, some of these ivar:s were in NSText instead of NSTextView, and parts of their handling (including encoding and decoding) were there. This has been fixed and the ivar:s moved here, but in a way that makes decoding and encoding compatible with the old code. */ - (void) encodeWithCoder: (NSCoder *)aCoder { BOOL flag; NSSize containerSize = [_textContainer containerSize]; [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { int flags = (_tf.is_horizontally_resizable ? 0x01 : 0) | (_tf.is_vertically_resizable ? 0x02 : 0) | (_tf.owns_text_network ? 0x04 : 0); NSTextViewSharedData *tvsd = [[NSTextViewSharedData alloc] initWithTextView: self]; [aCoder encodeConditionalObject: _delegate forKey: @"NSDelegate"]; [aCoder encodeSize: [self maxSize] forKey: @"NSMaxSize"]; [aCoder encodeSize: [self minSize] forKey: @"NSMinSize"]; [aCoder encodeObject: tvsd forKey: @"NSSharedData"]; RELEASE(tvsd); [aCoder encodeObject: [self textStorage] forKey: @"NSTextStorage"]; [aCoder encodeObject: [self textContainer] forKey: @"NSTextContainer"]; [aCoder encodeInt: flags forKey: @"NSTVFlags"]; } else { [aCoder encodeConditionalObject: _delegate]; flag = _tf.is_field_editor; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _tf.is_editable; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _tf.is_selectable; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _tf.is_rich_text; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _tf.imports_graphics; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _tf.draws_background; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _tf.is_horizontally_resizable; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _tf.is_vertically_resizable; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _tf.uses_font_panel; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _tf.uses_ruler; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _tf.is_ruler_visible; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; [aCoder encodeObject: _backgroundColor]; [aCoder encodeValueOfObjCType: @encode(NSSize) at: &_minSize]; [aCoder encodeValueOfObjCType: @encode(NSSize) at: &_maxSize]; flag = _tf.smart_insert_delete; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _tf.allows_undo; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; // version 3 flag = _tf.uses_find_panel; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; // version 2 [aCoder encodeObject: _insertionPointColor]; [aCoder encodeValueOfObjCType: @encode(NSSize) at: &containerSize]; flag = [_textContainer widthTracksTextView]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = [_textContainer heightTracksTextView]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; // version 4 [aCoder encodeObject: _defaultParagraphStyle]; [aCoder encodeObject: _markedTextAttributes]; [aCoder encodeObject: _linkTextAttributes]; flag = _tf.continuous_spell_checking; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; } } - (id) initWithCoder: (NSCoder *)aDecoder { self = [super initWithCoder: aDecoder]; if (!self) return nil; if ([aDecoder allowsKeyedCoding]) { if ([aDecoder containsValueForKey: @"NSDelegate"]) { [self setDelegate: [aDecoder decodeObjectForKey: @"NSDelegate"]]; } if ([aDecoder containsValueForKey: @"NSMaxSize"]) { [self setMaxSize: [aDecoder decodeSizeForKey: @"NSMaxSize"]]; } else { [self setMaxSize: NSMakeSize(_frame.size.width, GSHUGE)]; } if ([aDecoder containsValueForKey: @"NSMinSize"]) { // If NSMinSize is present we want to use it. [self setMinSize: [aDecoder decodeSizeForKey: @"NSMinSize"]]; } else if ([aDecoder containsValueForKey: @"NSMinize"]) { // it's NSMinize in pre-10.3 formats. [self setMinSize: [aDecoder decodeSizeForKey: @"NSMinize"]]; } else { [self setMinSize: _frame.size]; } if ([aDecoder containsValueForKey: @"NSSharedData"]) { NSTextViewSharedData *shared; unsigned int flags; shared = [aDecoder decodeObjectForKey: @"NSSharedData"]; flags = [shared flags]; ASSIGN(_insertionPointColor, [shared insertionColor]); ASSIGN(_backgroundColor, [shared backgroundColor]); ASSIGN(_defaultParagraphStyle, [shared paragraphStyle]); ASSIGN(_markedTextAttributes, [shared markAttributes]); ASSIGN(_linkTextAttributes, [shared linkAttributes]); _tf.is_selectable = ((0x01 & flags) > 0); _tf.is_editable = ((0x02 & flags) > 0); _tf.is_rich_text = ((0x04 & flags) > 0); _tf.imports_graphics = ((0x08 & flags) > 0); _tf.is_field_editor = ((0x10 & flags) > 0); _tf.uses_font_panel = ((0x20 & flags) > 0); _tf.is_ruler_visible = ((0x40 & flags) > 0); _tf.continuous_spell_checking = ((0x80 & flags) > 0); _tf.uses_ruler = ((0x100 & flags) > 0); _tf.smart_insert_delete = ((0x200 & flags) > 0); _tf.allows_undo = ((0x400 & flags) > 0); _tf.draws_background = ((0x800 & flags) > 0); _tf.uses_find_panel = ((0x2000 & flags) > 0); } if ([aDecoder containsValueForKey: @"NSTVFlags"]) { int flags = [aDecoder decodeIntForKey: @"NSTVFlags"]; _tf.is_horizontally_resizable = ((flags & 0x01) != 0); _tf.is_vertically_resizable = ((flags & 0x02) != 0); _tf.owns_text_network = ((flags & 0x04) != 0); } // Get the text container to retrieve the text which was previously archived // so that it can be inserted into the current textview. if ([aDecoder containsValueForKey: @"NSTextContainer"]) { NSTextContainer *container = [aDecoder decodeObjectForKey: @"NSTextContainer"]; [container setTextView: self]; } else { NSTextContainer *container = [self buildUpTextNetwork: _frame.size]; [container setTextView: self]; } //@"NSDragTypes" if (_tf.owns_text_network && _textStorage != nil) { // See initWithFrame: for comments on this RELEASE RELEASE(self); } } else { BOOL flag; NSTextContainer *aTextContainer; int version = [aDecoder versionForClassName: @"NSTextView"]; /* Common stuff for all versions. */ _delegate = [aDecoder decodeObject]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _tf.is_field_editor = flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _tf.is_editable = flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _tf.is_selectable = flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _tf.is_rich_text = flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _tf.imports_graphics = flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _tf.draws_background = flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _tf.is_horizontally_resizable = flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _tf.is_vertically_resizable = flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _tf.uses_font_panel = flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _tf.uses_ruler = flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _tf.is_ruler_visible = flag; _backgroundColor = RETAIN([aDecoder decodeObject]); [aDecoder decodeValueOfObjCType: @encode(NSSize) at: &_minSize]; [aDecoder decodeValueOfObjCType: @encode(NSSize) at: &_maxSize]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _tf.smart_insert_delete = flag; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _tf.allows_undo = flag; if (version >= 3) { [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _tf.uses_find_panel = flag; } /* build up the rest of the text system, which doesn't get stored . */ aTextContainer = [self buildUpTextNetwork: _frame.size]; [aTextContainer setTextView: (NSTextView *)self]; /* See initWithFrame: for comments on this RELEASE */ RELEASE(self); if (version >= 2) { NSSize containerSize; _insertionPointColor = RETAIN([aDecoder decodeObject]); [aDecoder decodeValueOfObjCType: @encode(NSSize) at: &containerSize]; [aTextContainer setContainerSize: containerSize]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; [aTextContainer setWidthTracksTextView: flag]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; [aTextContainer setHeightTracksTextView: flag]; } if (version >= 4) { _defaultParagraphStyle = RETAIN([aDecoder decodeObject]); _markedTextAttributes = RETAIN([aDecoder decodeObject]); _linkTextAttributes = RETAIN([aDecoder decodeObject]); [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _tf.continuous_spell_checking = flag; } } _dragTargetLocation = NSNotFound; [self _recacheDelegateResponses]; [self invalidateTextContainerOrigin]; // register for services... if (!did_register_for_services) [[self class] registerForServices]; [self updateDragTypeRegistration]; [self setPostsFrameChangedNotifications: YES]; [notificationCenter addObserver: self selector: @selector(_updateState:) name: NSViewFrameDidChangeNotification object: self]; [notificationCenter addObserver: self selector: @selector(_textDidChange:) name: NSTextDidChangeNotification object: self]; return self; } - (void) dealloc { if (_tf.owns_text_network == YES) { if (_textStorage != nil) { /* * Destroying our _textStorage releases all the text objects * (us included) which means this method will be called again ... * so this time round we should just return, and the rest of * the deallocation can be done on the next call to dealloc. * * However, the dealloc methods of any subclasses should * already have been called before this method is called, * and those subclasses don't know how to cope with being * deallocated more than once ... to deal with that we * set the isa pointer so that the subclass dealloc methods * won't get called again. */ GSClassSwizzle(self, [NSTextView class]); DESTROY(_textStorage); return; } } [notificationCenter removeObserver: self name: NSViewFrameDidChangeNotification object: self]; [notificationCenter removeObserver: self name: NSTextDidChangeNotification object: self]; [_textCheckingTimer invalidate]; [[NSRunLoop currentRunLoop] cancelPerformSelector: @selector(_updateState:) target: self argument: nil]; if (_delegate) { [notificationCenter removeObserver: _delegate name: nil object: _notifObject]; } DESTROY(_selectedTextAttributes); DESTROY(_markedTextAttributes); DESTROY(_insertionPointColor); DESTROY(_backgroundColor); DESTROY(_defaultParagraphStyle); DESTROY(_linkTextAttributes); DESTROY(_undoObject); [super dealloc]; } /**** Managing the text network ****/ /* This should only be called by [NSTextContainer -setTextView:]. If the text container has had its layout manager changed, it will make a dummy call to this method and container==_textContainer. We still need to do a full update in that case. This is assumed to be the __only__ place where _textContainer, _layoutManager, or _textStorage changes. Re-synchronizing the text network is hairy, and this is the only place where it happens. TODO: Make sure the assumption holds; might need to add more dummy calls to this method from the text container or layout manager. */ - (void) setTextContainer: (NSTextContainer *)container { NSUInteger i, c; NSArray *tcs; NSTextView *other; /* Any of these three might be nil. */ _textContainer = container; _layoutManager = (NSLayoutManager *)[container layoutManager]; if (_tf.owns_text_network) { ASSIGN(_textStorage, [_layoutManager textStorage]); } else { _textStorage = [_layoutManager textStorage]; } /* Search for an existing text view attached to this layout manager. */ tcs = [_layoutManager textContainers]; c = [tcs count]; for (i = 0; i < c; i++) { other = [[tcs objectAtIndex: i] textView]; if (other && other != self) break; } if (i < c) { /* There is already an NSTextView attached to this text network, so all shared attributes, including those in the layout manager, are already set up. We copy the shared attributes to us. */ _delegate = other->_delegate; _tf.is_field_editor = other->_tf.is_field_editor; _tf.is_editable = other->_tf.is_editable; _tf.is_selectable = other->_tf.is_selectable; _tf.is_rich_text = other->_tf.is_rich_text; _tf.imports_graphics = other->_tf.imports_graphics; _tf.uses_font_panel = other->_tf.uses_font_panel; _tf.uses_ruler = other->_tf.uses_ruler; _tf.is_ruler_visible = other->_tf.is_ruler_visible; _tf.allows_undo = other->_tf.allows_undo; _tf.smart_insert_delete = other->_tf.smart_insert_delete; /* TODO: might need to update other things */ [self _recacheDelegateResponses]; [self updateDragTypeRegistration]; } else if (_layoutManager) { /* There is no text network, and the layout manager's attributes might not be set up. We reset them to standard values. */ DESTROY(_layoutManager->_typingAttributes); _layoutManager->_typingAttributes = [[[self class] defaultTypingAttributes] mutableCopy]; _layoutManager->_original_selected_range.location = NSNotFound; _layoutManager->_selected_range = NSMakeRange(0,0); } _currentInsertionPointMovementDirection = 0; [self _updateMultipleTextViews]; } - (void) replaceTextContainer: (NSTextContainer *)newContainer { NSLayoutManager *lm = _layoutManager; NSUInteger index = [[lm textContainers] indexOfObject: _textContainer]; NSTextStorage *ts = _textStorage; RETAIN(self); RETAIN(ts); [_textContainer setTextView: nil]; [lm removeTextContainerAtIndex: index]; [lm insertTextContainer: newContainer atIndex: index]; [newContainer setTextView: self]; RELEASE(ts); RELEASE(self); } - (NSTextContainer *) textContainer { return _textContainer; } - (NSLayoutManager *) layoutManager { return _layoutManager; } - (NSTextStorage *) textStorage { return _textStorage; } /**** Managing shared attributes ****/ /* Note: You might override these methods in subclasses, as in the following example: - (void) setEditable: (BOOL)flag { [super setEditable: flag]; XXX your custom code here XXX } If you override them in this way, they are automatically synchronized between multiple text views - ie., when it is called on one, it will be automatically called on all other text views attached to thesame layout manager. TODO: Not all combinations of flags are allowed, eg. editable implies selectable, imports graphics implies rich-text, etc. In these cases, when making a change that forces a value on another attribute, the attribute is directly changed. Need to check if we should call the method instead. Need to make sure syncing is handled properly in all cases. */ /* Helper macro for these methods. */ #define NSTEXTVIEW_SYNC \ if (_tf.multiple_textviews && (IS_SYNCHRONIZING_FLAGS == NO)) \ { [self _syncTextViewsByCalling: _cmd withFlag: flag]; \ return; } /* Delegate */ - (id) delegate { return _delegate; } - (void) setDelegate: (id)anObject { /* Code to allow sharing the delegate */ if (_tf.multiple_textviews && (IS_SYNCHRONIZING_DELEGATES == NO)) { /* Invoke setDelegate: on all the textviews which share this delegate. */ NSArray *array; NSUInteger i, count; IS_SYNCHRONIZING_DELEGATES = YES; array = [_layoutManager textContainers]; count = [array count]; for (i = 0; i < count; i++) { NSTextView *view; view = [(NSTextContainer *)[array objectAtIndex: i] textView]; [view setDelegate: anObject]; } IS_SYNCHRONIZING_DELEGATES = NO; } /* Now the real code to set the delegate */ if (_delegate != nil) { [notificationCenter removeObserver: _delegate name: nil object: _notifObject]; } _delegate = anObject; /* SET_DELEGATE_NOTIFICATION defined near the beginning of file */ /* NSText notifications */ SET_DELEGATE_NOTIFICATION(DidBeginEditing); SET_DELEGATE_NOTIFICATION(DidChange); SET_DELEGATE_NOTIFICATION(DidEndEditing); /* NSTextView notifications */ SET_DELEGATE_NOTIFICATION(ViewDidChangeSelection); SET_DELEGATE_NOTIFICATION(ViewWillChangeNotifyingTextView); [self _recacheDelegateResponses]; } /* Editable */ - (BOOL) isEditable { return _tf.is_editable; } - (void) setEditable: (BOOL)flag { NSTEXTVIEW_SYNC; _tf.is_editable = flag; if (flag) { _tf.is_selectable = YES; } if ([self shouldDrawInsertionPoint]) { [self updateInsertionPointStateAndRestartTimer: YES]; } else { /* TODO: insertion point */ } [self updateDragTypeRegistration]; } /* Selectable */ - (BOOL) isSelectable { return _tf.is_selectable; } - (void) setSelectable: (BOOL)flag { NSTEXTVIEW_SYNC; _tf.is_selectable = flag; if (flag == NO) { _tf.is_editable = NO; } [self updateDragTypeRegistration]; } /* Field editor */ - (BOOL) isFieldEditor { return _tf.is_field_editor; } - (void) setFieldEditor: (BOOL)flag { NSTEXTVIEW_SYNC; if (flag) { [self setHorizontallyResizable: NO]; /* TODO: why? */ [self setVerticallyResizable: NO]; [_textContainer setLineFragmentPadding: 0]; } else { [self setHorizontallyResizable: NO]; /* TODO: why? */ [self setVerticallyResizable: YES]; [_textContainer setLineFragmentPadding: 5.0]; } _tf.is_field_editor = flag; } /* Rich-text */ - (BOOL) isRichText { return _tf.is_rich_text; } - (void) setRichText: (BOOL)flag { NSTEXTVIEW_SYNC; _tf.is_rich_text = flag; if (flag == NO) { _tf.imports_graphics = NO; /* TODO: convert text to plain text, ie. make attributes the same in all text? */ } [self updateDragTypeRegistration]; } /* Imports graphics */ - (BOOL) importsGraphics { return _tf.imports_graphics; } - (void) setImportsGraphics: (BOOL)flag { NSTEXTVIEW_SYNC; _tf.imports_graphics = flag; if (flag == YES) { _tf.is_rich_text = YES; } [self updateDragTypeRegistration]; } /* Uses ruler */ - (BOOL) usesRuler { return _tf.uses_ruler; } /* TODO: set ruler visible to NO if flag==NO? */ - (void) setUsesRuler: (BOOL)flag { NSTEXTVIEW_SYNC; _tf.uses_ruler = flag; } /* Ruler visible (TODO: is this really supposed to be shared??) */ - (BOOL) isRulerVisible { return _tf.is_ruler_visible; } - (void) setRulerVisible: (BOOL)flag { NSScrollView *sv; NSRulerView *rv; NSTEXTVIEW_SYNC; sv = [self enclosingScrollView]; _tf.is_ruler_visible = flag; if (sv != nil) { if (_tf.is_ruler_visible && ![sv hasHorizontalRuler]) { [sv setHasHorizontalRuler: YES]; } [sv setRulersVisible: _tf.is_ruler_visible]; if (self == [_window firstResponder] && (rv = [sv horizontalRulerView]) != nil) { if (flag) { [rv setClientView: self]; } else { [rv setClientView: nil]; } } } } /* Uses font panel */ - (BOOL) usesFontPanel { return _tf.uses_font_panel; } - (void) setUsesFontPanel: (BOOL)flag { NSTEXTVIEW_SYNC; _tf.uses_font_panel = flag; } - (BOOL) usesFindPanel { return _tf.uses_find_panel; } - (void) setUsesFindPanel: (BOOL)flag { _tf.uses_find_panel = flag; } /* Smart insert/delete */ - (BOOL) smartInsertDeleteEnabled { return _tf.smart_insert_delete; } - (void) setSmartInsertDeleteEnabled: (BOOL)flag { NSTEXTVIEW_SYNC; _tf.smart_insert_delete = flag; } /* Undo */ - (BOOL) allowsUndo { return _tf.allows_undo; } - (void) setAllowsUndo: (BOOL)flag { NSTEXTVIEW_SYNC; _tf.allows_undo = flag; } /* Continuous spell checking */ - (BOOL) isContinuousSpellCheckingEnabled { return _tf.continuous_spell_checking; } - (void) setContinuousSpellCheckingEnabled: (BOOL)flag { NSTEXTVIEW_SYNC; if (_tf.continuous_spell_checking && !flag) { const NSRange allRange = NSMakeRange(0, [[self string] length]); _tf.continuous_spell_checking = 0; [_layoutManager removeTemporaryAttribute: @"NSTextChecked" forCharacterRange: allRange]; [_layoutManager removeTemporaryAttribute: NSSpellingStateAttributeName forCharacterRange: allRange]; _lastCheckedRect = NSZeroRect; [_textCheckingTimer invalidate]; _textCheckingTimer = nil; } else if (!_tf.continuous_spell_checking && flag) { _tf.continuous_spell_checking = 1; [self _scheduleTextCheckingInVisibleRectIfNeeded]; } } /* Don't need this anymore. */ #undef NSTEXTVIEW_SYNC /**** Basic view stuff ****/ - (BOOL) isFlipped { return YES; } - (BOOL) isOpaque { if (_tf.draws_background == NO || _backgroundColor == nil || [_backgroundColor alphaComponent] < 1.0) return NO; else return YES; } - (BOOL) needsPanelToBecomeKey { return _tf.is_editable || _tf.is_selectable; } - (BOOL) acceptsFirstResponder { if (_tf.is_selectable) { return YES; } else { return NO; } } - (BOOL) resignFirstResponder { /* Check if another text view attached to the same layout manager is the new first responder. If so, we always let it become first responder, and we don't send any notifications. */ if (_tf.multiple_textviews == YES) { id futureFirstResponder; NSArray *textContainers; NSUInteger i, count; futureFirstResponder = [_window _futureFirstResponder]; textContainers = [_layoutManager textContainers]; count = [textContainers count]; for (i = 0; i < count; i++) { NSTextContainer *container; NSTextView *view; container = (NSTextContainer *)[textContainers objectAtIndex: i]; view = [container textView]; if (view == futureFirstResponder) { /* NB: We do not reset the BEGAN_EDITING flag so that no spurious notification is generated. */ return YES; } } } /* NB: Possible change: ask always - not only if editable - but we need to change NSTextField etc to allow this. */ if ((_tf.is_editable) && ([_delegate respondsToSelector: @selector(textShouldEndEditing:)]) && ([_delegate textShouldEndEditing: self] == NO)) { return NO; } /* Add any clean-up stuff here */ [self _resignRulerClient]; if ([self shouldDrawInsertionPoint]) { [self updateInsertionPointStateAndRestartTimer: NO]; } if (_layoutManager != nil) { _layoutManager->_beganEditing = NO; } /* NB: According to the doc (and to the tradition), we post this notification even if no real editing was actually done (only selection of text) [Note: in this case, no editing was started, so the notification does not come after a NSTextDidBeginEditingNotification!]. The notification only means that we are resigning first responder status. This makes sense because many objects inside the gui need this notification anyway - typically, it is needed to remove a field editor (editable or not) when the user presses TAB to move to the next view. Anyway yes, the notification name is misleading. */ [notificationCenter postNotificationName: NSTextDidEndEditingNotification object: _notifObject]; return YES; } /* Note that when this method is called, editing might already have started (in another text view attached to the same layout manager). */ - (BOOL) becomeFirstResponder { if (_tf.is_selectable == NO) { return NO; } /* Note: Notifications (NSTextBeginEditingNotification etc) are sent the first time the user tries to edit us. */ [self _becomeRulerClient]; /* Draw selection, update insertion point */ if ([self shouldDrawInsertionPoint]) { [self updateInsertionPointStateAndRestartTimer: YES]; } return YES; } - (void) resignKeyWindow { if ([self shouldDrawInsertionPoint]) { [self updateInsertionPointStateAndRestartTimer: NO]; } } - (void) becomeKeyWindow { if ([self shouldDrawInsertionPoint]) { [self updateInsertionPointStateAndRestartTimer: YES]; } } /**** Unshared attributes ****/ - (NSColor *) backgroundColor { return _backgroundColor; } - (BOOL) drawsBackground { return _tf.draws_background; } - (void) setBackgroundColor: (NSColor *)color { if (![_backgroundColor isEqual: color]) { ASSIGN(_backgroundColor, color); [self setNeedsDisplay: YES]; } } - (void) setDrawsBackground: (BOOL)flag { if (_tf.draws_background != flag) { _tf.draws_background = flag; [self setNeedsDisplay: YES]; } } - (void) setInsertionPointColor: (NSColor *)color { ASSIGN(_insertionPointColor, color); } - (NSColor *) insertionPointColor { return _insertionPointColor; } - (void) setSelectedTextAttributes: (NSDictionary *)attributeDictionary { ASSIGN(_selectedTextAttributes, attributeDictionary); } - (NSDictionary *) selectedTextAttributes { return _selectedTextAttributes; } - (void) setMarkedTextAttributes: (NSDictionary *)attributeDictionary { ASSIGN(_markedTextAttributes, attributeDictionary); } - (NSDictionary *) markedTextAttributes { return _markedTextAttributes; } - (NSDictionary *) linkTextAttributes { return _linkTextAttributes; } - (void) setLinkTextAttributes: (NSDictionary *)attributeDictionary { ASSIGN(_linkTextAttributes, attributeDictionary); } /**** Size management ****/ /* If we are the document view of a clip view, we always have an effective minimum size of the clip view's bounds size. This ensures that we always fill the clip view with our background, and that we always handle clicks events everywhere inside it (and not just on a small part of it if we are partially filled with text and track the text container vertically). Note that this only happens if the text view is the document view of a clip view; if several text views are embedded in a clip view (eg. a multi-column text document in a scroll view), we do _not_ want to extend any of the text views to cover the entire clip view. TODO: what if the max. size is smaller than the effective min. size? TODO: Check and fix bounds vs. frame issues. */ /* TODO: The safety calls below don't protect against all misuse (doing that would be very tricky), so is it worth having them there at all? The docs are pretty clear about what happens (ie. breakage) if you set the flags incorrectly. */ - (void) setHorizontallyResizable: (BOOL)flag { /* Safety call */ [_textContainer setWidthTracksTextView: !flag]; if (flag) { NSSize size; NSSize inset; inset = [self textContainerInset]; size = [_textContainer containerSize]; size.width = MAX(_maxSize.width - (inset.width * 2.0), 0.0); [_textContainer setContainerSize: size]; } _tf.is_horizontally_resizable = flag; } - (void) setVerticallyResizable: (BOOL)flag { /* Safety call */ [_textContainer setHeightTracksTextView: !flag]; if (flag) { NSSize size; NSSize inset; inset = [self textContainerInset]; size = [_textContainer containerSize]; size.height = MAX(_maxSize.height - (inset.height * 2.0), 0.0); [_textContainer setContainerSize: size]; } _tf.is_vertically_resizable = flag; } - (BOOL) isHorizontallyResizable { return _tf.is_horizontally_resizable; } - (BOOL) isVerticallyResizable { return _tf.is_vertically_resizable; } - (NSSize) maxSize { return _maxSize; } - (NSSize) minSize { return _minSize; } - (void) setMaxSize: (NSSize)newMaxSize { _maxSize = newMaxSize; } - (void) setMinSize: (NSSize)newMinSize { _minSize = newMinSize; } - (void) sizeToFit { NSSize size; if (!_layoutManager) return; size = _bounds.size; if (_tf.is_horizontally_resizable || _tf.is_vertically_resizable) { NSRect r = [_layoutManager usedRectForTextContainer: _textContainer]; NSSize s2; if (_textContainer == [_layoutManager extraLineFragmentTextContainer]) { r = NSUnionRect(r, [_layoutManager extraLineFragmentUsedRect]); } s2 = NSMakeSize(NSMaxX(r), NSMaxY(r)); if (_tf.is_horizontally_resizable) size.width = s2.width + 2 * _textContainerInset.width; if (_tf.is_vertically_resizable) size.height = s2.height + 2 * _textContainerInset.height; } [self setConstrainedFrameSize: size]; } /* TODO: There is code in TextEdit that implies that the minimum size is mostly ignored, and that the size of the containing clip view is always used instead. Should test on OS to find out what the proper behavior is. UPDATE: current behavior is correct, but must be documented properly before this TODO can be removed */ - (void) setConstrainedFrameSize: (NSSize)desiredSize { NSSize newSize; NSSize effectiveMinSize = _minSize; NSClipView *cv = (NSClipView *)[self superview]; if (cv && [cv isKindOfClass: [NSClipView class]] && [cv documentView] == self) { NSSize b = [cv bounds].size; effectiveMinSize.width = MAX(effectiveMinSize.width , b.width); effectiveMinSize.height = MAX(effectiveMinSize.height, b.height); } if (_tf.is_horizontally_resizable) { newSize.width = desiredSize.width; newSize.width = MAX(newSize.width, effectiveMinSize.width); newSize.width = MIN(newSize.width, _maxSize.width); } else { newSize.width = _frame.size.width; } if (_tf.is_vertically_resizable) { newSize.height = desiredSize.height; newSize.height = MAX(newSize.height, effectiveMinSize.height); newSize.height = MIN(newSize.height, _maxSize.height); } else { newSize.height = _frame.size.height; } if (NSEqualSizes(_frame.size, newSize) == NO) { [self setFrameSize: newSize]; } } - (void) resizeSubviewsWithOldSize: (NSSize)oldSize { NSSize curSize = [self frame].size; if (_minSize.width > curSize.width) _minSize.width = curSize.width; if (_minSize.height > curSize.height) _minSize.height = curSize.height; if (_maxSize.width < curSize.width) _maxSize.width = curSize.width; if (_maxSize.height < curSize.height) _maxSize.height = curSize.height; [super resizeSubviewsWithOldSize: oldSize]; } /**** Text container origin ****/ /* The text container origin is the origin of the text container's coordinate system in our coordinate system. */ - (void) setTextContainerInset: (NSSize)inset { _textContainerInset = inset; [self invalidateTextContainerOrigin]; /* We send this so our text container can react to the change (it might need to resize itself it it's set to track our size). */ [notificationCenter postNotificationName: NSViewFrameDidChangeNotification object: self]; } - (NSSize) textContainerInset { return _textContainerInset; } - (NSPoint) textContainerOrigin { return _textContainerOrigin; } /* TODO: There used to be a bunch of complex code in here, but I couldn't really see what it did, and I didn't see anything in the docs that imply that anything complex needs to be done, so I removed it. Should double-check and bring it back if necessary. */ - (void) invalidateTextContainerOrigin { _textContainerOrigin.x = NSMinX(_bounds); _textContainerOrigin.x += _textContainerInset.width; _textContainerOrigin.y = NSMinY(_bounds); _textContainerOrigin.y += _textContainerInset.height; } /**** Methods of the NSTextInput protocol ****/ /* -selectedRange is a part of this protocol, but it's also a method in NSText. The implementation is among the selection handling methods and not here. */ /* TODO: currently no support for marked text */ - (NSAttributedString *) attributedSubstringFromRange: (NSRange)theRange { if (theRange.location >= [_textStorage length]) return nil; if (theRange.location + theRange.length > [_textStorage length]) theRange.length = [_textStorage length] - theRange.location; return [_textStorage attributedSubstringFromRange: theRange]; } // This method takes screen coordinates as input. - (NSUInteger) characterIndexForPoint: (NSPoint)point { point = [[self window] convertScreenToBase: point]; point = [self convertPoint:point fromView: nil]; return [self _characterIndexForPoint: point respectFraction: NO]; } - (NSRange) markedRange { return _markedRange; } - (void) setMarkedText: (id)aString selectedRange: (NSRange)selRange { NSAttributedString *as; _markedRange = selRange; as = [[NSAttributedString alloc] initWithString: aString attributes: [self markedTextAttributes]]; [self replaceCharactersInRange: selRange withAttributedString: as]; DESTROY(as); } - (BOOL) hasMarkedText { return (_markedRange.location != NSNotFound); } - (void) unmarkText { if (![self hasMarkedText]) return; [_textStorage setAttributes: _layoutManager->_typingAttributes range: _markedRange]; _markedRange = NSMakeRange(NSNotFound, 0); } - (NSArray *) validAttributesForMarkedText { return [NSArray arrayWithObjects: NSBackgroundColorAttributeName, NSForegroundColorAttributeName, NSFontAttributeName, nil]; } - (NSInteger) conversationIdentifier { return (NSInteger)_textStorage; } - (NSRect) firstRectForCharacterRange: (NSRange)theRange { NSUInteger rectCount = 0; NSRect *rects; if (!_layoutManager) return NSZeroRect; rects = [_layoutManager rectArrayForCharacterRange: theRange withinSelectedCharacterRange: NSMakeRange(NSNotFound, 0) inTextContainer: _textContainer rectCount: &rectCount]; if (rectCount) return rects[0]; else return NSZeroRect; } /* Unlike NSResponder, we should _not_ send the selector down the responder chain if we can't handle it. */ - (void) doCommandBySelector: (SEL)aSelector { if (!_layoutManager) { NSBeep(); return; } /* Give the delegate a chance to handle it. */ if ([_delegate respondsToSelector: @selector(textView:doCommandBySelector:)] && [_delegate textView: _notifObject doCommandBySelector: aSelector]) { return; } if ([self respondsToSelector: aSelector]) { [self performSelector: aSelector]; } else { NSBeep(); } } /* insertString may actually be an NSAttributedString. If it is, and the text view isn't rich-text, we ignore the attributes and use the typing attributes. This method is for user changes; see NSTextView_actions.m. */ - (void) insertText: (id)insertString { NSRange insertRange = [self rangeForUserTextChange]; NSString *string; BOOL isAttributed; if (insertRange.location == NSNotFound) { NSBeep(); return; } isAttributed = [insertString isKindOfClass: [NSAttributedString class]]; if (isAttributed) string = [(NSAttributedString *)insertString string]; else string = insertString; if (![self shouldChangeTextInRange: insertRange replacementString: string]) { return; } if (_tf.is_rich_text) { if (isAttributed) { [_textStorage replaceCharactersInRange: insertRange withAttributedString: (NSAttributedString *)insertString]; } else { [_textStorage replaceCharactersInRange: insertRange withAttributedString: AUTORELEASE([[NSAttributedString alloc] initWithString: insertString attributes: _layoutManager->_typingAttributes])]; } } else { if (isAttributed) { [self replaceCharactersInRange: insertRange withString: [(NSAttributedString *)insertString string]]; } else { [self replaceCharactersInRange: insertRange withString: insertString]; } } [self didChangeText]; } /**** Text modification methods (programmatic) ****/ /* These are methods for programmatic changes, ie. they do _not_ check with the delegate, they don't send notifications, and they work in un- editable text views, etc. */ /* Replace the characters in the given range with the given string. In a non-rich-text view, we use the same attributes as the rest of the text storage (ie. the typing attributes). In a rich-text text view, attributes for the new characters are computed thusly: 1. If there is a first character in the replaced range, its attributes are used. (If not, the range must have length 0.) 2. If there is a character right before the range, its attributed are used. (If not, the range must have location 0, so the range must be length=0, location=0.) 3. If there is a character after the range, we use its attributes. (If not, the text storage must be empty.) 4. We use the typing attributes. (Note that if the text storage is empty, this is the only valid case.) Since 1. - 3. correspond to the normal NSMutableAttributedString behavior, we only need to handle 4. explicitly, and we can detect it by checking if the text storage is empty. */ - (void) replaceCharactersInRange: (NSRange)aRange withString: (NSString *)aString { if (aRange.location == NSNotFound) /* TODO: throw exception instead? */ return; if ([_textStorage length] == 0) { NSAttributedString *as; as = [[NSAttributedString alloc] initWithString: aString attributes: _layoutManager->_typingAttributes]; [_textStorage replaceCharactersInRange: aRange withAttributedString: as]; DESTROY(as); } else { [_textStorage replaceCharactersInRange: aRange withString: aString]; } } /* GNUstep extension. Like the above, but uses the attributes from the string if the text view is rich-text, and otherwise the typing attributes. */ - (void) replaceCharactersInRange: (NSRange)aRange withAttributedString: (NSAttributedString *)aString { if (aRange.location == NSNotFound) /* TODO: throw exception instead? */ return; if (_tf.is_rich_text) { [_textStorage replaceCharactersInRange: aRange withAttributedString: aString]; } else { /* Let the other method deal with the empty text storage case. */ [self replaceCharactersInRange: aRange withString: [aString string]]; } } /* Some attribute-modification methods. The range-less methods change the attribute for all text and update the typing attributes. The range methods, which only work in rich-text text views, only change the attributes for the range, and do not update the typing attributes. */ - (void) setFont: (NSFont *)font { if (!font) return; [_textStorage addAttribute: NSFontAttributeName value: font range: NSMakeRange(0,[_textStorage length])]; [_layoutManager->_typingAttributes setObject: font forKey: NSFontAttributeName]; [notificationCenter postNotificationName: NSTextViewDidChangeTypingAttributesNotification object: _notifObject]; } - (void) setFont: (NSFont *)font range: (NSRange)aRange { if (!_tf.is_rich_text || !font) return; [_textStorage addAttribute: NSFontAttributeName value: font range: aRange]; } - (void) setAlignment: (NSTextAlignment)alignment { NSParagraphStyle *style; NSMutableParagraphStyle *mstyle; [_textStorage setAlignment: alignment range: NSMakeRange(0, [_textStorage length])]; /* Update the typing attributes. */ style = [_layoutManager->_typingAttributes objectForKey: NSParagraphStyleAttributeName]; if (style == nil) style = [self defaultParagraphStyle]; mstyle = [style mutableCopy]; [mstyle setAlignment: alignment]; [_layoutManager->_typingAttributes setObject: mstyle forKey: NSParagraphStyleAttributeName]; DESTROY(mstyle); [notificationCenter postNotificationName: NSTextViewDidChangeTypingAttributesNotification object: _notifObject]; } - (void) setAlignment: (NSTextAlignment)alignment range: (NSRange)range { if (!_tf.is_rich_text) return; [_textStorage setAlignment: alignment range: range]; } - (void) setTextColor: (NSColor *)color { if (!color) { [_textStorage removeAttribute: NSForegroundColorAttributeName range: NSMakeRange(0, [_textStorage length])]; [_layoutManager->_typingAttributes removeObjectForKey: NSForegroundColorAttributeName]; } else { [_textStorage addAttribute: NSForegroundColorAttributeName value: color range: NSMakeRange(0, [_textStorage length])]; [_layoutManager->_typingAttributes setObject: color forKey: NSForegroundColorAttributeName]; } [notificationCenter postNotificationName: NSTextViewDidChangeTypingAttributesNotification object: _notifObject]; } - (void) setTextColor: (NSColor *)color range: (NSRange)aRange { if (!_tf.is_rich_text) return; if (color) { [_textStorage addAttribute: NSForegroundColorAttributeName value: color range: aRange]; } else { [_textStorage removeAttribute: NSForegroundColorAttributeName range: aRange]; } } - (NSParagraphStyle *) defaultParagraphStyle { return _defaultParagraphStyle; } - (void) setDefaultParagraphStyle: (NSParagraphStyle *)style { ASSIGN(_defaultParagraphStyle, style); } /**** Text access methods ****/ - (NSData *) RTFDFromRange: (NSRange)aRange { return [_textStorage RTFDFromRange: aRange documentAttributes: nil]; } - (NSData *) RTFFromRange: (NSRange)aRange { return [_textStorage RTFFromRange: aRange documentAttributes: nil]; } - (NSString *) string { return [_textStorage string]; } - (NSUInteger) textLength { return [_textStorage length]; } - (NSFont *) font { if ([_textStorage length] > 0) { return [_textStorage attribute: NSFontAttributeName atIndex: 0 effectiveRange: NULL]; } return [_layoutManager->_typingAttributes objectForKey: NSFontAttributeName]; } /* Returns alignment of first selected paragraph (which will be the alignment for all text in a non-rich-text text view). Since the alignment of the typing attributes will always be the same as the alignment of the first selected paragraph, we can simply return the typing attributes' alignment. (TODO: double-check this assumption) */ - (NSTextAlignment) alignment { return [[_layoutManager->_typingAttributes objectForKey: NSParagraphStyleAttributeName] alignment]; } - (NSColor *) textColor { if ([_textStorage length] > 0) { return [_textStorage attribute: NSForegroundColorAttributeName atIndex: 0 effectiveRange: NULL]; } return [_layoutManager->_typingAttributes objectForKey: NSForegroundColorAttributeName]; } /**** Pasteboard actions ****/ /* TODO: Move to NSTextView_actions.m? */ - (void) copy: (id)sender { NSMutableArray *types = [NSMutableArray array]; if (_tf.imports_graphics) [types addObject: NSRTFDPboardType]; if (_tf.is_rich_text) [types addObject: NSRTFPboardType]; if ([self smartInsertDeleteEnabled] && [self selectionGranularity] == NSSelectByWord) [types addObject: NSSmartPastePboardType]; [types addObject: NSStringPboardType]; [self writeSelectionToPasteboard: [NSPasteboard generalPasteboard] types: types]; } /* Copy the current font to the font pasteboard */ - (void) copyFont: (id)sender { NSPasteboard *pb = [NSPasteboard pasteboardWithName: NSFontPboard]; [self writeSelectionToPasteboard: pb type: NSFontPboardType]; } /* Copy the current ruler settings to the ruler pasteboard */ - (void) copyRuler: (id)sender { NSPasteboard *pb = [NSPasteboard pasteboardWithName: NSRulerPboard]; [self writeSelectionToPasteboard: pb type: NSRulerPboardType]; } - (void) paste: (id)sender { [self readSelectionFromPasteboard: [NSPasteboard generalPasteboard]]; } - (void) pasteFont: (id)sender { NSPasteboard *pb = [NSPasteboard pasteboardWithName: NSFontPboard]; [self readSelectionFromPasteboard: pb type: NSFontPboardType]; } - (void) pasteRuler: (id)sender { NSPasteboard *pb = [NSPasteboard pasteboardWithName: NSRulerPboard]; [self readSelectionFromPasteboard: pb type: NSRulerPboardType]; } - (void) pasteAsPlainText: (id)sender { [self readSelectionFromPasteboard: [NSPasteboard generalPasteboard] type: NSStringPboardType]; } - (void) pasteAsRichText: (id)sender { [self readSelectionFromPasteboard: [NSPasteboard generalPasteboard] type: NSRTFPboardType]; } /**** Handling user changes ****/ - (NSUndoManager *) undoManager { NSUndoManager *undo = nil; if (![_delegate respondsToSelector: @selector(undoManagerForTextView:)] || ((undo = [_delegate undoManagerForTextView: self]) == nil)) { undo = [super undoManager]; } return undo; } /* * Began editing flag. There are quite some different ways in which * editing can be started. Each time editing is started, we need to check * with the delegate if it is OK to start editing - but we need to check * only once. So, we use a flag. */ /* TODO: comment seems incorrect. macros are only used here. _beganEditing flag is set to NO in -resignFirstResponder. */ /* YES when editing has already began. If NO, then we need to ask to the delegate for permission to begin editing before allowing any change to be made. We explicitly check for a layout manager, and raise an exception if not found. */ #define BEGAN_EDITING \ (_layoutManager ? _layoutManager->_beganEditing : noLayoutManagerException ()) #define SET_BEGAN_EDITING(X) \ if (_layoutManager != nil) _layoutManager->_beganEditing = X /* Whenever text is to be changed due to some user-induced action, this method should be called with information on the change. This method will check if the change is allowed (by checking if the text view is editable and by asking the delegate for permission). It will return YES if the change is allowed. It will also send notifications as necessary. replacementString should be the string that will replace the affected range (disregarding attributes), or nil if only attributes are changed. If the affected range or replacement string can't be determined, pass in NSNotFound for the range's location and nil for the string. (Ie. even if you know the range, you should pass in NSNotFound so the delegate can tell the difference between a pure attribute change and an unknown change.) TODO: What if the view isn't first responder? It should be impossible for a user change to occur in that case, but user change methods might be called anyway. To be safe, changes are currently always disallowed if the text view isn't the first responder. (2003-02-01): GNUMail does it by having an "attach" button when editing mails. It adds an attachment to the text using -insertText:, and it is a fairly reasonable thing to do. Thus, if we aren't the first responder, we still proceed as normal here. In -didChangeText, if we still aren't the first responder, we send the TextDidEndEditing notification _without_ asking the delegate (-; since we can't handle a NO return). */ - (BOOL) shouldChangeTextInRange: (NSRange)affectedCharRange replacementString: (NSString *)replacementString { BOOL result = YES; if (_tf.is_editable == NO) return NO; /* We need to send the textShouldBeginEditing: / textDidBeginEditingNotification only once. */ if (BEGAN_EDITING == NO) { if (([_delegate respondsToSelector: @selector(textShouldBeginEditing:)]) && ([_delegate textShouldBeginEditing: _notifObject] == NO)) return NO; SET_BEGAN_EDITING(YES); [notificationCenter postNotificationName: NSTextDidBeginEditingNotification object: _notifObject]; } if (_tf.delegate_responds_to_should_change) { result = [_delegate textView: self shouldChangeTextInRange: affectedCharRange replacementString: replacementString]; } if (result && [self allowsUndo]) { NSUndoManager *undo; NSRange undoRange; NSAttributedString *undoString; NSTextViewUndoObject *undoObject; BOOL isTyping; NSEvent *event; static BOOL undoManagerCanCoalesce = NO; { // FIXME This code (together with undoManagerCanCoalesce) is a // temporary workaround to allow using an out of date version of // base. Removed this upon the next release of base. static BOOL didCheck = NO; if (!didCheck) { undoManagerCanCoalesce = [NSUndoManager instancesRespondToSelector: @selector(_canCoalesceUndoWithTarget:selector:object:)]; if (!undoManagerCanCoalesce) { NSLog(@"This version of NSUndoManager does not\n" @"support coalescing undo operations. " @"Upgrade gnustep-base to r29163 or newer to\n" @"get rid of this one-time warning."); } didCheck = YES; } } undo = [self undoManager]; /* Coalesce consecutive typing events into a single undo action using currently private undo manager functionality. An event is considered a typing event if it is a keyboard event and the event's characters match our replacement string. Note: Typing events are coalesced only when the previous action was a typing event too and the current character follows the previous one immediately. We never coalesce actions when the current selection is not empty. */ event = [NSApp currentEvent]; isTyping = [event type] == NSKeyDown && [[event characters] isEqualToString: replacementString]; if (undoManagerCanCoalesce && _undoObject) { undoRange = [_undoObject range]; if (isTyping && NSMaxRange(undoRange) == affectedCharRange.location && affectedCharRange.length == 0 && [undo _canCoalesceUndoWithTarget: _textStorage selector: @selector(_undoTextChange:) object: _undoObject]) { undoRange.length += [replacementString length]; [_undoObject setRange: undoRange]; return result; } DESTROY(_undoObject); } // The length of the undoRange is the length of the replacement, if any. if (replacementString != nil) { undoRange = NSMakeRange(affectedCharRange.location, [replacementString length]); } else { undoRange = affectedCharRange; } undoString = [self attributedSubstringFromRange: affectedCharRange]; undoObject = [[NSTextViewUndoObject alloc] initWithRange: undoRange attributedString: undoString]; [undo registerUndoWithTarget: _textStorage selector: @selector(_undoTextChange:) object: undoObject]; if (isTyping) _undoObject = undoObject; else RELEASE(undoObject); } return result; } - (BOOL) shouldChangeTextInRanges: (NSArray *)ranges replacementStrings: (NSArray *)strings { // FIXME NSRange range; range = [(NSValue*)[ranges objectAtIndex: 0] rangeValue]; return [self shouldChangeTextInRange: range replacementString: [strings objectAtIndex: 0]]; } /* After each user-induced change, this method should be called. */ - (void) didChangeText { [self scrollRangeToVisible: [self selectedRange]]; [notificationCenter postNotificationName: NSTextDidChangeNotification object: _notifObject]; if ([_window firstResponder] != self) { /* Copied from -resignFirstResponder . See comment above. */ if ([self shouldDrawInsertionPoint]) { [self updateInsertionPointStateAndRestartTimer: NO]; } if (_layoutManager != nil) { _layoutManager->_beganEditing = NO; } [notificationCenter postNotificationName: NSTextDidEndEditingNotification object: _notifObject]; } } /* Returns the ranges to which various kinds of user changes should apply. */ - (NSRange) rangeForUserCharacterAttributeChange { if (!_tf.is_editable || !_tf.uses_font_panel || !_layoutManager) { return NSMakeRange(NSNotFound, 0); } if (_tf.is_rich_text) { return _layoutManager->_selected_range; } else { return NSMakeRange(0, [_textStorage length]); } } - (NSRange) rangeForUserParagraphAttributeChange { if (!_tf.is_editable || !_tf.uses_ruler || !_layoutManager) { return NSMakeRange(NSNotFound, 0); } if (_tf.is_rich_text) { return [self selectionRangeForProposedRange: _layoutManager->_selected_range granularity: NSSelectByParagraph]; } else { return NSMakeRange(0, [_textStorage length]); } } - (NSRange) rangeForUserTextChange { if (!_tf.is_editable || !_layoutManager) { return NSMakeRange(NSNotFound, 0); } return _layoutManager->_selected_range; } - (NSRange) rangeForUserCompletion { NSUInteger length, location; NSRange range, space; // Get the current location. location = [self selectedRange].location; // Find the first space starting from current location, backwards. space = [[self string] rangeOfCharacterFromSet: [NSCharacterSet whitespaceAndNewlineCharacterSet] options: NSBackwardsSearch range: NSMakeRange(0, location)]; if (space.location == NSNotFound) { // No space was found. if (location > 0) { // Return the range of the whole substring. range = NSMakeRange(0, location); } else { // There isn't word. range = NSMakeRange(NSNotFound, 0); } } else { length = location - space.location - 1; if (length > 0) { // Return the range of the last word. range = NSMakeRange(space.location + 1, length); } else { // There isn't word at the end. range = NSMakeRange(NSNotFound, 0); } } return range; } - (NSArray *) rangesForUserCharacterAttributeChange { // FIXME NSRange range; range = [self rangeForUserCharacterAttributeChange]; if (range.location == NSNotFound) return nil; return [NSArray arrayWithObject: [NSValue valueWithRange: range]]; } - (NSArray *) rangesForUserParagraphAttributeChange { // FIXME NSRange range; range = [self rangeForUserParagraphAttributeChange]; if (range.location == NSNotFound) return nil; return [NSArray arrayWithObject: [NSValue valueWithRange: range]]; } - (NSArray *) rangesForUserTextChange { // FIXME NSRange range; range = [self rangeForUserTextChange]; if (range.location == NSNotFound) return nil; return [NSArray arrayWithObject: [NSValue valueWithRange: range]]; } /**** Misc. ****/ /* Scroll so that the beginning of the range is visible. */ - (void) scrollRangeToVisible: (NSRange)aRange { NSRect rect, r; NSView *cv; CGFloat width; NSPoint p0, p1; NSRange ourCharRange; /* Make sure that our size is up-to-date. If the scroll is in response to a change, the delayed size updating might not have run yet. To avoid scrolling outside the view, we force an update now. (An alternative would be to delay the scroll, too. If problems using this method turn up, it could be changed.) */ [self sizeToFit]; if (_layoutManager == nil) return; /* See if the requested range lies outside of the receiver. If so * forward the call to the appropriate text view. */ ourCharRange = [_layoutManager characterRangeForGlyphRange: [_layoutManager glyphRangeForTextContainer: [self textContainer]] actualGlyphRange: NULL]; if (NSMaxRange(aRange) < ourCharRange.location || aRange.location > NSMaxRange(ourCharRange)) { // FIXME: The following snippet could be refactored to a method called // _textContainerForCharacterRange:effectiveCharacterRange: NSTextContainer *tc; NSTextView *tv; NSUInteger glyphIndex = [_layoutManager glyphRangeForCharacterRange: aRange actualCharacterRange: NULL].location; // If we are asked to scroll to the empty range at the end of the string, // adjust the glyph index to be the last glyph, instead of one after the last glyph if (![_layoutManager isValidGlyphIndex: glyphIndex] && [_layoutManager isValidGlyphIndex: glyphIndex - 1]) { glyphIndex--; } tc = [_layoutManager textContainerForGlyphAtIndex: glyphIndex effectiveRange: NULL]; tv = [tc textView]; if (tv != self) { [tv scrollRangeToVisible: aRange]; return; } } if (aRange.length > 0) { aRange.length = 1; rect = [self rectForCharacterRange: aRange]; } else { rect = [_layoutManager insertionPointRectForCharacterIndex: aRange.location inTextContainer: _textContainer]; rect.origin.x += _textContainerOrigin.x; rect.origin.y += _textContainerOrigin.y; } cv = [self superview]; /* If we are a non-rich-text field editor in a clip view, we use some magic to get scrolling to behave better; if not, just scroll and return. */ if (!_tf.is_field_editor || _tf.is_rich_text || ![cv isKindOfClass: [NSClipView class]]) { [self scrollRectToVisible: rect]; return; } /* The basic principle is that we want to keep as much text as possible visible, and we want the text to appear to keep its alignment. This is especially important for centered text where the auto-scrolling will scroll so it appears right- or left-aligned if we don't do anything here. We also want to avoid spurious scrolling when the user is just moving the insertion point. */ width = [cv frame].size.width; /* Get the left and right edges of the text. */ r = [_layoutManager insertionPointRectForCharacterIndex: 0 inTextContainer: _textContainer]; p0 = r.origin; r = [_layoutManager insertionPointRectForCharacterIndex: [_textStorage length] inTextContainer: _textContainer]; p1 = r.origin; p1.x += r.size.width; /* We only try to be smart for single-line text. */ if (p0.y != p1.y) { [self scrollRectToVisible: rect]; return; } p0.x += _textContainerOrigin.x; p1.x += _textContainerOrigin.x; switch ([self alignment]) { case NSLeftTextAlignment: case NSNaturalTextAlignment: /* TODO? check default writing direction for language? */ case NSJustifiedTextAlignment: /* We don't want blank space to the right of the text; scroll further to the left if possible. */ p1.x -= width; if (p1.x < 0) p1.x = 0; if (p1.x < rect.origin.x) { rect.size.width += rect.origin.x - p1.x; rect.origin.x = p1.x; } break; case NSRightTextAlignment: /* We don't want blank space to the left of the text; scroll further to the right if possible. */ p0.x += width; if (p0.x > p1.x) p0.x = p1.x; if (p0.x > NSMaxX(rect)) { rect.size.width += p0.x - NSMaxX(rect); } break; case NSCenterTextAlignment: /* If all the text fits in the clip view, just center on the text. */ if (p1.x - p0.x <= width) { rect.origin.x = (p1.x + p0.x - width) / 2; rect.size.width = width; } else { /* Otherwise, fill the clip view with text; no blank space on either side. */ CGFloat x; x = p1.x - width; if (x < rect.origin.x) { rect.size.width += rect.origin.x - x; rect.origin.x = x; } x = p0.x + width; if (x > NSMaxX(rect)) { rect.size.width += x - NSMaxX(rect); } } break; } [self scrollRectToVisible: rect]; } - (NSRange) selectedRange { if (!_layoutManager) return NSMakeRange(0, 0); return _layoutManager->_selected_range; } - (BOOL) validateMenuItem: (NSMenuItem *)item { return [self validateUserInterfaceItem: item]; } - (BOOL) validateUserInterfaceItem: (id)item { SEL action = [item action]; // FIXME The list of validated actions below is far from complete if (sel_isEqual(action, @selector(cut:)) || sel_isEqual(action, @selector(delete:))) return [self isEditable] && [self selectedRange].length > 0; if (sel_isEqual(action, @selector(copy:))) return [self selectedRange].length > 0; if (sel_isEqual(action, @selector(copyFont:)) || sel_isEqual(action, @selector(copyRuler:))) return [self selectedRange].location != NSNotFound; if (sel_isEqual(action, @selector(paste:)) || sel_isEqual(action, @selector(pasteAsPlainText:)) || sel_isEqual(action, @selector(pasteAsRichText:)) || sel_isEqual(action, @selector(pasteFont:)) || sel_isEqual(action, @selector(pasteRuler:))) { if ([self isEditable]) { NSArray *types = nil; NSString *available; if (sel_isEqual(action, @selector(paste:))) types = [self readablePasteboardTypes]; else if (sel_isEqual(action, @selector(pasteAsPlainText:))) types = [NSArray arrayWithObject: NSStringPboardType]; else if (sel_isEqual(action, @selector(pasteAsRichText:))) types = [NSArray arrayWithObject: NSRTFPboardType]; else if (sel_isEqual(action, @selector(pasteFont:))) types = [NSArray arrayWithObject: NSFontPboardType]; else if (sel_isEqual(action, @selector(pasteRuler:))) types = [NSArray arrayWithObject: NSRulerPboard]; available = [[NSPasteboard generalPasteboard] availableTypeFromArray: types]; return available != nil; } else return NO; } if (sel_isEqual(action, @selector(selectAll:)) || sel_isEqual(action, @selector(centerSelectionInVisibleArea:))) return [self isSelectable]; if (sel_isEqual(action, @selector(performFindPanelAction:))) { if ([self usesFindPanel] == NO) { return NO; } return [[GSTextFinder sharedTextFinder] validateFindPanelAction: item withTextView: self]; } return YES; } /* Private, internal methods to help input method handling in some backends (XIM, currently). Backends may override these in categories with the real (backend-specific) handling. */ - (void) _updateInputMethodState { } - (void) _updateInputMethodWithInsertionPoint: (NSPoint)insertionPoint { } @end /**** TODO: below this line hasn't been done yet ****/ /* not the same as NSMakeRange! */ static inline NSRange MakeRangeFromAbs (unsigned a1, unsigned a2) { if (a1 < a2) return NSMakeRange(a1, a2 - a1); else return NSMakeRange(a2, a1 - a2); } @implementation NSTextView (leftovers) /**** Misc. stuff not yet categorized ****/ /* This method is for user changes; see NSTextView_actions.m. */ - (void) changeColor: (id)sender { NSColor *aColor = (NSColor *)[sender color]; NSRange aRange = [self rangeForUserCharacterAttributeChange]; // FIXME: support undo /* Set typing attributes */ if (_layoutManager) { [_layoutManager->_typingAttributes setObject: aColor forKey: NSForegroundColorAttributeName]; [notificationCenter postNotificationName: NSTextViewDidChangeTypingAttributesNotification object: _notifObject]; } if (aRange.location == NSNotFound || aRange.length == 0) return; if (![self shouldChangeTextInRange: aRange replacementString: nil]) return; [self setTextColor: aColor range: aRange]; [self didChangeText]; } /* This method is for user changes; see NSTextView_actions.m. */ - (void) changeFont: (id)sender { NSRange foundRange; NSUInteger maxSelRange; NSRange aRange= [self rangeForUserCharacterAttributeChange]; NSRange searchRange = aRange; NSFont *font; if (aRange.location == NSNotFound) return; if (![self shouldChangeTextInRange: aRange replacementString: nil]) return; [_textStorage beginEditing]; for (maxSelRange = NSMaxRange (aRange); searchRange.location < maxSelRange; searchRange = NSMakeRange (NSMaxRange (foundRange), maxSelRange - NSMaxRange (foundRange))) { font = [_textStorage attribute: NSFontAttributeName atIndex: searchRange.location longestEffectiveRange: &foundRange inRange: searchRange]; if (font != nil) { [self setFont: [sender convertFont: font] ofRange: foundRange]; } } [_textStorage endEditing]; [self didChangeText]; /* Set typing attributes */ font = [_layoutManager->_typingAttributes objectForKey: NSFontAttributeName]; if (font != nil) { [_layoutManager->_typingAttributes setObject: [sender convertFont: font] forKey: NSFontAttributeName]; [notificationCenter postNotificationName: NSTextViewDidChangeTypingAttributesNotification object: _notifObject]; } } /* * [NSText] Reading and Writing RTFD files */ - (BOOL) readRTFDFromFile: (NSString *)path { NSAttributedString *peek; peek = [[NSAttributedString alloc] initWithPath: path documentAttributes: NULL]; if (peek != nil) { if (!_tf.is_rich_text) { [self setRichText: YES]; } [self replaceCharactersInRange: NSMakeRange (0, [_textStorage length]) withAttributedString: peek]; RELEASE(peek); return YES; } return NO; } - (BOOL) writeRTFDToFile: (NSString *)path atomically: (BOOL)flag { NSFileWrapper *wrapper; NSRange range = NSMakeRange (0, [_textStorage length]); wrapper = [_textStorage RTFDFileWrapperFromRange: range documentAttributes: nil]; return [wrapper writeToFile: path atomically: flag updateFilenames: YES]; } /* * [NSResponder] Handle enabling/disabling of services menu items. */ - (id) validRequestorForSendType: (NSString *)sendType returnType: (NSString *)returnType { BOOL sendOK = NO; BOOL returnOK = NO; if (!_layoutManager) return [super validRequestorForSendType: sendType returnType: returnType]; if (sendType == nil) { sendOK = YES; } else if (_layoutManager->_selected_range.length && [sendType isEqual: NSStringPboardType]) { sendOK = YES; } if (returnType == nil) { returnOK = YES; } else if (_tf.is_editable && [returnType isEqual: NSStringPboardType]) { returnOK = YES; } if (sendOK && returnOK) { return self; } return [super validRequestorForSendType: sendType returnType: returnType]; } - (void) setTypingAttributes: (NSDictionary *)attrs { NSDictionary *old_attrs; NSString *names[] = {NSParagraphStyleAttributeName, NSFontAttributeName, NSForegroundColorAttributeName}; int i; if (_layoutManager == nil) return; if (attrs == nil) { attrs = [[self class] defaultTypingAttributes]; } old_attrs = _layoutManager->_typingAttributes; if (_delegate) { SEL selector = @selector(textView:shouldChangeTypingAttributes:toAttributes:); if ([_delegate respondsToSelector: selector]) { if (![_delegate textView: self shouldChangeTypingAttributes: old_attrs toAttributes: attrs]) return; } } _layoutManager->_typingAttributes = [[NSMutableDictionary alloc] initWithDictionary: attrs]; // make sure to keep the main attributes set. for (i = 0; i < 3; i++) { NSString *name = names[i]; if ([attrs objectForKey: name] == nil) { [_layoutManager->_typingAttributes setObject: [old_attrs objectForKey: name] forKey: name]; } } RELEASE(old_attrs); [self updateFontPanel]; [self updateRuler]; [notificationCenter postNotificationName: NSTextViewDidChangeTypingAttributesNotification object: _notifObject]; } - (NSDictionary *) typingAttributes { return [NSDictionary dictionaryWithDictionary: _layoutManager->_typingAttributes]; } - (void) clickedOnLink: (id)link atIndex: (NSUInteger)charIndex { if (_delegate != nil) { SEL selector = @selector(textView:clickedOnLink:atIndex:); if ([_delegate respondsToSelector: selector]) { [_delegate textView: self clickedOnLink: link atIndex: charIndex]; } } } - (void) updateFontPanel { /* Update fontPanel only if told so */ if (_tf.uses_font_panel && _layoutManager) { NSRange longestRange; NSFontManager *fm = [NSFontManager sharedFontManager]; NSFont *currentFont; if (_layoutManager->_selected_range.length > 0) /* Multiple chars selection */ { currentFont = [_textStorage attribute: NSFontAttributeName atIndex: _layoutManager->_selected_range.location longestEffectiveRange: &longestRange inRange: _layoutManager->_selected_range]; [fm setSelectedFont: currentFont isMultiple: !NSEqualRanges (longestRange, _layoutManager->_selected_range)]; } else /* Just Insertion Point. */ { currentFont = [_layoutManager->_typingAttributes objectForKey: NSFontAttributeName]; [fm setSelectedFont: currentFont isMultiple: NO]; } } } /**** Smart insert/delete ****/ static inline BOOL is_preceded_by_smart_char(NSString *string, NSRange range) { NSUInteger start = range.location; return start == 0 || [smartLeftChars characterIsMember: [string characterAtIndex: start - 1]]; } static inline BOOL is_followed_by_smart_char(NSString *string, NSRange range) { NSUInteger end = NSMaxRange(range); return end == [string length] || [smartRightChars characterIsMember: [string characterAtIndex: end]]; } - (NSRange) smartDeleteRangeForProposedRange: (NSRange)proposedCharRange { if ([self smartInsertDeleteEnabled]) { NSString *string = [_textStorage string]; NSUInteger start = proposedCharRange.location; NSUInteger end = NSMaxRange(proposedCharRange); /* Like Mac OS X, we only propose a space character (0x20) for deletion and we choose either the character preceding the selection or the one after the selection, but not both. */ if (start > 0 && [string characterAtIndex: start - 1] == ' ' && is_followed_by_smart_char(string, proposedCharRange)) { proposedCharRange.location--; proposedCharRange.length++; } else if (end < [string length] && [string characterAtIndex: end] == ' ' && is_preceded_by_smart_char(string, proposedCharRange)) { proposedCharRange.length++; } } return proposedCharRange; } - (NSString *)smartInsertAfterStringForString: (NSString *)aString replacingRange: (NSRange)charRange { if ([self smartInsertDeleteEnabled] && aString != nil && !is_followed_by_smart_char([_textStorage string], charRange)) { NSUInteger l = [aString length]; NSCharacterSet *ws = [NSCharacterSet whitespaceAndNewlineCharacterSet]; if (l == 0 || ![ws characterIsMember: [aString characterAtIndex: l - 1]]) return @" "; } return nil; } - (NSString *)smartInsertBeforeStringForString: (NSString *)aString replacingRange: (NSRange)charRange { if ([self smartInsertDeleteEnabled] && aString != nil && !is_preceded_by_smart_char([_textStorage string], charRange)) { NSUInteger l = [aString length]; NSCharacterSet *ws = [NSCharacterSet whitespaceAndNewlineCharacterSet]; if (l == 0 || ![ws characterIsMember: [aString characterAtIndex: 0]]) return @" "; } return nil; } - (void) smartInsertForString: (NSString *)aString replacingRange: (NSRange)charRange beforeString: (NSString **)beforeString afterString: (NSString **)afterString { /* Determines whether whitespace needs to be added around aString to preserve proper spacing and punctuation when it's inserted into the receiver's text over charRange. Returns by reference in beforeString and afterString any whitespace that should be added, unless either or both is nil. Both are returned as nil if aString is nil or if smart insertion and deletion is disabled. As part of its implementation, this method calls -smartInsertAfterStringForString: replacingRange: and -smartInsertBeforeStringForString: replacingRange: .To change this method's behavior, override those two methods instead of this one. NSTextView uses this method as necessary. You can also use it in implementing your own methods that insert text. To do so, invoke this method with the proper arguments, then insert beforeString, aString, and afterString in order over charRange. */ if (beforeString) *beforeString = [self smartInsertBeforeStringForString: aString replacingRange: charRange]; if (afterString) *afterString = [self smartInsertAfterStringForString: aString replacingRange: charRange]; } - (void) toggleSmartInsertDelete: (id)sender { [self setSmartInsertDeleteEnabled: ![self smartInsertDeleteEnabled]]; } /**** Selection management ****/ - (void) setSelectedRange: (NSRange)charRange { [self setSelectedRange: charRange affinity: [self selectionAffinity] stillSelecting: NO]; } /** * Return a range of text which encompasses proposedCharRange but is * extended (if necessary) to match the type of selection specified by gr. */ - (NSRange) selectionRangeForProposedRange: (NSRange)proposedCharRange granularity: (NSSelectionGranularity)gr { NSUInteger index; NSRange aRange; NSRange newRange; NSString *string = [self string]; NSUInteger length = [string length]; if (NSMaxRange (proposedCharRange) > length) { proposedCharRange.length = length - proposedCharRange.location; } if (length == 0) { return proposedCharRange; } switch (gr) { case NSSelectByWord: index = proposedCharRange.location; if (index >= length) { index = length - 1; } newRange = [_textStorage doubleClickAtIndex: index]; if (proposedCharRange.length > 1) { index = NSMaxRange(proposedCharRange) - 1; if (index >= length) { index = length - 1; } aRange = [_textStorage doubleClickAtIndex: index]; newRange = NSUnionRange(newRange, aRange); } return newRange; case NSSelectByParagraph: return [string lineRangeForRange: proposedCharRange]; case NSSelectByCharacter: default: if (proposedCharRange.length == 0) return proposedCharRange; /* Expand the beginning character */ index = proposedCharRange.location; newRange = [string rangeOfComposedCharacterSequenceAtIndex: index]; /* If the proposedCharRange is empty we only ajust the beginning */ if (proposedCharRange.length == 0) { return newRange; } /* Expand the finishing character */ index = NSMaxRange (proposedCharRange) - 1; aRange = [string rangeOfComposedCharacterSequenceAtIndex: index]; newRange.length = NSMaxRange(aRange) - newRange.location; return newRange; } } - (void) setSelectedRange: (NSRange)charRange affinity: (NSSelectionAffinity)affinity stillSelecting: (BOOL)stillSelectingFlag { /* Note that this method might be called from the layout manager to update the selection after the text storage has been changed. If text was deleted, the old selected range might extend outside the current string. Also note that this happens during the processing of the changes in the text storage. Thus, it isn't safe to modify the text storage. */ /* The `official' (the last one the delegate approved of) selected range before this one. */ NSRange oldRange; /* If the user was interactively changing the selection, the last displayed selection could have been a temporary selection, different from the last official one: */ NSRange oldDisplayedRange; NSUInteger length = [_textStorage length]; oldDisplayedRange = _layoutManager->_selected_range; if (NSMaxRange(charRange) > length) { if (charRange.location > length) { charRange = NSMakeRange(length, 0); } else { charRange.length = length - charRange.location; } } if (stillSelectingFlag == YES) { /* Store the original range before the interactive selection process begin. That's because we will need to ask the delegate if it's all right for him to do the change, and then notify him we did. In both cases, we need to post the original selection together with the new one. */ if (_layoutManager->_original_selected_range.location == NSNotFound) { oldRange = _layoutManager->_original_selected_range = _layoutManager->_selected_range; } } else { /* Retrieve the original range */ if (_layoutManager->_original_selected_range.location != NSNotFound) { oldRange = _layoutManager->_original_selected_range; _layoutManager->_original_selected_range.location = NSNotFound; } else { oldRange = _layoutManager->_selected_range; } /* Ask delegate to modify the range */ if (_tf.delegate_responds_to_will_change_sel) { charRange = [_delegate textView: _notifObject willChangeSelectionFromCharacterRange: oldRange toCharacterRange: charRange]; } } /* Set the new selected range */ _layoutManager->_selected_range = charRange; /* Clear the remembered position and direction for insertion point movement. Note that we must _not_ clear the index. Many movement actions will reset the direction to a valid value, and they assume that the index remains unchanged here. */ _currentInsertionPointMovementDirection = 0; /* TODO: when and if to restart timer */ [self updateInsertionPointStateAndRestartTimer: !stillSelectingFlag]; if (stillSelectingFlag == NO) { [self updateFontPanel]; /* Insertion Point */ if (charRange.length) { /* TODO: this is a big bottle-neck since it involves talking to the pasteboard server. should do this "later" */ // Store the selected text in the selection pasteboard [self copySelection]; if (_tf.is_rich_text) { NSDictionary *dict; /* always set the typing attributes to the attributes of the first selected character */ dict = [_textStorage attributesAtIndex: charRange.location effectiveRange: NULL]; [self setTypingAttributes: dict]; } /* TODO: insertion point */ } else /* no selection, only insertion point */ { if (_tf.is_rich_text && length) { NSDictionary *dict; if (charRange.location > 0 && [[_textStorage string] characterAtIndex: (charRange.location - 1)] != '\n') { /* If the insertion point is after a bold word, for example, we need to use bold for further insertions - this is why we take the attributes from range.location - 1. */ dict = [_textStorage attributesAtIndex: (charRange.location - 1) effectiveRange: NULL]; } else { /* Unless we are at the beginning of text - we use the first valid attributes then */ dict = [_textStorage attributesAtIndex: charRange.location effectiveRange: NULL]; } [self setTypingAttributes: dict]; } } } if (_window != nil) { [_layoutManager invalidateDisplayForCharacterRange: oldDisplayedRange]; [_layoutManager invalidateDisplayForCharacterRange: charRange]; } [self setSelectionGranularity: NSSelectByCharacter]; _layoutManager->_selectionAffinity = affinity; /* TODO: Remove the marking from marked text if the new selection is greater than the marked region. */ if (stillSelectingFlag == NO) { NSDictionary *userInfo; userInfo = [NSDictionary dictionaryWithObjectsAndKeys: [NSValue valueWithBytes: &oldRange objCType: @encode(NSRange)], NSOldSelectedCharacterRange, nil]; [notificationCenter postNotificationName: NSTextViewDidChangeSelectionNotification object: _notifObject userInfo: userInfo]; } } - (NSSelectionAffinity) selectionAffinity { return _layoutManager->_selectionAffinity; } - (void) setSelectionGranularity: (NSSelectionGranularity)granularity { _layoutManager->_selectionGranularity = granularity; } - (NSSelectionGranularity) selectionGranularity { return _layoutManager->_selectionGranularity; } - (NSArray *) selectedRanges { // FIXME NSRange range; range = [self selectedRange]; return [NSArray arrayWithObject: [NSValue valueWithRange: range]]; } - (void) setSelectedRanges: (NSArray *)ranges { [self setSelectedRanges: ranges affinity: [self selectionAffinity] stillSelecting: NO]; } - (void) setSelectedRanges: (NSArray *)ranges affinity: (NSSelectionAffinity)affinity stillSelecting: (BOOL)flag { // FIXME NSRange range; range = [(NSValue*)[ranges objectAtIndex: 0] rangeValue]; [self setSelectedRange: range affinity: affinity stillSelecting: flag]; } /**** Drawing ****/ /* TODO: Figure out how the additional layout stuff is supposed to work. */ - (void) setNeedsDisplayInRect: (NSRect)rect avoidAdditionalLayout: (BOOL)flag { /* TODO: This is here until the layout manager is working */ /* This is very important */ [super setNeedsDisplayInRect: rect]; } /* We override NSView's setNeedsDisplayInRect: */ - (void) setNeedsDisplayInRect: (NSRect)aRect { [self setNeedsDisplayInRect: aRect avoidAdditionalLayout: NO]; } - (BOOL) shouldDrawInsertionPoint { if (!_layoutManager) return NO; if (_dragTargetLocation != NSNotFound) return YES; if (_layoutManager->_selected_range.length != 0) return NO; if (_tf.is_editable == NO) return NO; if ([_window isKeyWindow] == YES && [_window firstResponder] == self) return YES; return NO; } /* * It only makes real sense to call this method with `flag == YES'. * If you want to delete the insertion point, what you want is rather * to redraw what was under the insertion point - which can't be done * here - you need to set the rect as needing redisplay (without * additional layout) instead. NB: You need to flush the window after * calling this method if you want the insertion point to appear on * the screen immediately. This could only be needed to implement * blinking insertion point - but even there, it could probably be * done without. */ - (void) drawInsertionPointInRect: (NSRect)rect color: (NSColor *)color turnedOn: (BOOL)flag { if (_window == nil) { return; } if (flag) { if (color == nil) { color = _insertionPointColor; } [color set]; NSRectFill (rect); } else { [_backgroundColor set]; NSRectFill (rect); } } - (void) drawViewBackgroundInRect: (NSRect)rect { if (_tf.draws_background) { [_backgroundColor set]; NSRectFill(rect); } } - (void) drawRect: (NSRect)rect { NSRange drawnRange; NSRect containerRect = rect; containerRect.origin.x -= _textContainerOrigin.x; containerRect.origin.y -= _textContainerOrigin.y; if (_layoutManager) { drawnRange = [_layoutManager glyphRangeForBoundingRect: containerRect inTextContainer: _textContainer]; } else { drawnRange = NSMakeRange(0, 0); } [self _scheduleTextCheckingInVisibleRectIfNeeded]; /* FIXME: We should only draw inside of rect. This code is necessary * to remove markings of old glyphs. These would not be removed * by the following call to the layout manager because that only * paints the background of new glyphs. Depending on the * situation, there might be no new glyphs where the old glyphs * were! */ [self drawViewBackgroundInRect: [self bounds]]; /* Then draw the special background of the new glyphs. */ [_layoutManager drawBackgroundForGlyphRange: drawnRange atPoint: _textContainerOrigin]; [_layoutManager drawGlyphsForGlyphRange: drawnRange atPoint: _textContainerOrigin]; if ([self shouldDrawInsertionPoint] && [NSGraphicsContext currentContextDrawingToScreen]) { if (NSIntersectsRect(rect, _insertionPointRect)) { [self drawInsertionPointInRect: _insertionPointRect color: _insertionPointColor turnedOn: _drawInsertionPointNow]; } } // Remove any existing tooltips in the redrawn rectangle. [[GSToolTips tipsForView: self] removeToolTipsInRect: rect]; { NSRange r; NSUInteger i = drawnRange.location; NSUInteger end = i + drawnRange.length; while (i < end) { NSUInteger rectCount; NSRectArray rects; NSUInteger j; // Find the next tooltip id text = [_textStorage attribute: NSToolTipAttributeName atIndex: i effectiveRange: &r]; if (r.location > end) { return; } if (nil == text) { i = r.location + r.length; continue; } // If there is one, find the rectangles it uses. rects = [_layoutManager rectArrayForCharacterRange: r withinSelectedCharacterRange: NSMakeRange(0, 0) inTextContainer: _textContainer rectCount: &rectCount]; // Add this object as the tooltip provider for each rectangle for (j=0 ; jtag == tag) { NSPoint origin; NSUInteger startIndex; id value; // Origin is in window coordinate space origin = rect->rectangle.origin; // Point is an offset from this origin - translate it to the window's // coordinate space point.x += origin.x; point.y += origin.y; // Then translate it to the view's coordinate space point = [self convertPoint: point fromView: nil]; // Find out what the corresponding text is. startIndex = [self _characterIndexForPoint: point respectFraction: NO]; // Look up what the tooltip text should be. value = [_textStorage attribute: NSToolTipAttributeName atIndex: startIndex effectiveRange: NULL]; // The value of NSToolTipAttributeName should be an NSString, // but we deal with it being something else too. if (![value isKindOfClass: [NSString class]]) { value = [value description]; } return value; } END_FOR_IN(_tracking_rects) return nil; } - (void) _stopInsertionTimer { if (_insertionPointTimer != nil) { [_insertionPointTimer invalidate]; DESTROY(_insertionPointTimer); } } - (void) _startInsertionTimer { if (_insertionPointTimer != nil) { NSWarnMLog(@"Starting insertion timer with existing one running"); [self _stopInsertionTimer]; } _insertionPointTimer = [NSTimer scheduledTimerWithTimeInterval: 0.5 target: self selector: @selector(_blink:) userInfo: nil repeats: YES]; [[NSRunLoop currentRunLoop] addTimer: _insertionPointTimer forMode: NSModalPanelRunLoopMode]; RETAIN(_insertionPointTimer); } - (void) updateInsertionPointStateAndRestartTimer: (BOOL)restartFlag { NSRect new; if (!_layoutManager) { _insertionPointRect = NSZeroRect; return; } if (_dragTargetLocation != NSNotFound) { _tf.drag_target_hijacks_insertion_point = YES; new = [_layoutManager insertionPointRectForCharacterIndex: _dragTargetLocation inTextContainer: _textContainer]; new.origin.x += _textContainerOrigin.x; new.origin.y += _textContainerOrigin.y; /* If the insertion would extend outside the view (e.g. because it's just to the right of a character on the far right edge of the view, a common case for right-aligned text), we force it back in. */ if (NSMaxX(new) > NSMaxX(_bounds)) { new.origin.x = NSMaxX(_bounds) - new.size.width; } } else if (_layoutManager->_selected_range.length > 0 || _layoutManager->_selected_range.location == NSNotFound || !restartFlag) { new = NSZeroRect; } else { new = [_layoutManager insertionPointRectForCharacterIndex: _layoutManager->_selected_range.location inTextContainer: _textContainer]; new.origin.x += _textContainerOrigin.x; new.origin.y += _textContainerOrigin.y; /* If the insertion would extend outside the view (e.g. because it's just to the right of a character on the far right edge of the view, a common case for right-aligned text), we force it back in. */ if (NSMaxX(new) > NSMaxX(_bounds)) { new.origin.x = NSMaxX(_bounds) - new.size.width; } } /* Handle hijacked insertion point (either set above when entering this method or during the previous call to this method) */ if (_tf.drag_target_hijacks_insertion_point) { _drawInsertionPointNow = NO; [self setNeedsDisplayInRect: _insertionPointRect avoidAdditionalLayout: YES]; _insertionPointRect = new; if (_dragTargetLocation != NSNotFound) { _drawInsertionPointNow = YES; [self setNeedsDisplayInRect: _insertionPointRect avoidAdditionalLayout: YES]; } else _tf.drag_target_hijacks_insertion_point = NO; } /* Otherwise, draw insertion point only if there is a need to do so */ else if ([self shouldDrawInsertionPoint] || _drawInsertionPointNow) { if (restartFlag) { /* Start blinking timer if not yet started */ if (_insertionPointTimer == nil && [self shouldDrawInsertionPoint]) { // Save new insertion point rectangle before starting the insertion timer... _insertionPointRect = new; [self _startInsertionTimer]; } else if (_insertionPointTimer != nil) { if (!NSEqualRects(new, _insertionPointRect)) { // Erase previous insertion point line... _drawInsertionPointNow = NO; [self setNeedsDisplayInRect: _insertionPointRect avoidAdditionalLayout: YES]; _insertionPointRect = new; } } /* Ok - blinking has just been turned on. Make sure we start * the on/off/on/off blinking from the 'on', because in that way * the user can see where the insertion point is as soon as * possible. */ _drawInsertionPointNow = YES; [self setNeedsDisplayInRect: _insertionPointRect avoidAdditionalLayout: YES]; } else if ([self shouldDrawInsertionPoint] && (_insertionPointTimer != nil)) { // restartFlag is set to NO when control resigns first responder // status or window resings key window status. So we invalidate // timer to avoid extra method calls [self _stopInsertionTimer]; _drawInsertionPointNow = NO; [self setNeedsDisplayInRect: _insertionPointRect avoidAdditionalLayout: YES]; _insertionPointRect = new; } [self _updateInputMethodWithInsertionPoint: _insertionPointRect.origin]; } } /**** Pagination *****/ - (void) adjustPageHeightNew: (CGFloat*)newBottom top: (CGFloat)oldTop bottom: (CGFloat)oldBottom limit: (CGFloat)bottomLimit { BOOL needsToMoveBottom = NO; NSRect proposedPage = NSMakeRect([self bounds].origin.x, oldTop, [self bounds].size.width, oldBottom - oldTop); NSRange pageGlyphRange = [_layoutManager glyphRangeForBoundingRect: proposedPage inTextContainer: _textContainer]; CGFloat actualTextBottom = oldBottom; // the maximum Y value of text less than oldBottom NSInteger i; for (i = NSMaxRange(pageGlyphRange) - 1; i >= (NSInteger)pageGlyphRange.location; ) { NSRange lineFragGlyphRange = NSMakeRange(0, 0); NSRect lineFragRect = [_layoutManager lineFragmentRectForGlyphAtIndex: i effectiveRange: &lineFragGlyphRange]; if (NSMaxY(lineFragRect) <= NSMaxY(proposedPage)) { actualTextBottom = NSMaxY(lineFragRect); break; } else { // We encountered a visible glyph fragment which extents below // the bottom of the page needsToMoveBottom = YES; } i = lineFragGlyphRange.location - 1; } if (needsToMoveBottom) { *newBottom = actualTextBottom; } else { *newBottom = oldBottom; } // FIXME: Do we need a special case so text attachments aren't split in half? } - (CGFloat)heightAdjustLimit { return 1.0; } /**** Ruler handling ****/ /** * Mote movement of marker */ - (void) rulerView: (NSRulerView *)ruler didMoveMarker: (NSRulerMarker *)marker { NSTextTab *old_tab = (NSTextTab*)[marker representedObject]; NSTextTab *new_tab = [[NSTextTab alloc] initWithType: [old_tab tabStopType] location: [marker markerLocation]]; NSRange range = [self rangeForUserParagraphAttributeChange]; NSUInteger loc = range.location; NSParagraphStyle *style; NSMutableParagraphStyle *mstyle; [_textStorage beginEditing]; while (loc < NSMaxRange(range)) { id value; NSRange effRange; NSRange newRange; value = [_textStorage attribute: NSParagraphStyleAttributeName atIndex: loc effectiveRange: &effRange]; newRange = NSIntersectionRange (effRange, range); if (value == nil) { value = [self defaultParagraphStyle]; } value = [value mutableCopy]; [value removeTabStop: old_tab]; [value addTabStop: new_tab]; [_textStorage addAttribute: NSParagraphStyleAttributeName value: value range: newRange]; RELEASE(value); loc = NSMaxRange (effRange); } [_textStorage endEditing]; [self didChangeText]; // Set the typing attributes style = [_layoutManager->_typingAttributes objectForKey: NSParagraphStyleAttributeName]; if (style == nil) style = [self defaultParagraphStyle]; mstyle = [style mutableCopy]; [mstyle removeTabStop: old_tab]; [mstyle addTabStop: new_tab]; // TODO: Should use setTypingAttributes [_layoutManager->_typingAttributes setObject: mstyle forKey: NSParagraphStyleAttributeName]; [notificationCenter postNotificationName: NSTextViewDidChangeTypingAttributesNotification object: _notifObject]; RELEASE(mstyle); [marker setRepresentedObject: new_tab]; RELEASE(new_tab); } /** * Handle removal of marker. */ - (void) rulerView: (NSRulerView *)ruler didRemoveMarker: (NSRulerMarker *)marker { NSTextTab *tab = (NSTextTab *)[marker representedObject]; NSRange range = [self rangeForUserParagraphAttributeChange]; NSUInteger loc = range.location; NSParagraphStyle *style; NSMutableParagraphStyle *mstyle; [_textStorage beginEditing]; while (loc < NSMaxRange(range)) { id value; NSRange effRange; NSRange newRange; value = [_textStorage attribute: NSParagraphStyleAttributeName atIndex: loc effectiveRange: &effRange]; newRange = NSIntersectionRange (effRange, range); if (value == nil) { value = [self defaultParagraphStyle]; } value = [value mutableCopy]; [value removeTabStop: tab]; [_textStorage addAttribute: NSParagraphStyleAttributeName value: value range: newRange]; RELEASE(value); loc = NSMaxRange (effRange); } [_textStorage endEditing]; [self didChangeText]; // Set the typing attributes style = [_layoutManager->_typingAttributes objectForKey: NSParagraphStyleAttributeName]; if (style == nil) style = [self defaultParagraphStyle]; mstyle = [style mutableCopy]; [mstyle removeTabStop: tab]; // TODO: Should use setTypingAttributes [_layoutManager->_typingAttributes setObject: mstyle forKey: NSParagraphStyleAttributeName]; [notificationCenter postNotificationName: NSTextViewDidChangeTypingAttributesNotification object: _notifObject]; RELEASE(mstyle); } - (void) rulerView: (NSRulerView *)ruler didAddMarker: (NSRulerMarker *)marker { NSTextTab *old_tab = (NSTextTab *)[marker representedObject]; NSTextTab *new_tab = [[NSTextTab alloc] initWithType: [old_tab tabStopType] location: [marker markerLocation]]; NSRange range = [self rangeForUserParagraphAttributeChange]; NSUInteger loc = range.location; NSParagraphStyle *style; NSMutableParagraphStyle *mstyle; [_textStorage beginEditing]; while (loc < NSMaxRange(range)) { id value; NSRange effRange; NSRange newRange; value = [_textStorage attribute: NSParagraphStyleAttributeName atIndex: loc effectiveRange: &effRange]; newRange = NSIntersectionRange (effRange, range); if (value == nil) { value = [self defaultParagraphStyle]; } value = [value mutableCopy]; [value addTabStop: new_tab]; [_textStorage addAttribute: NSParagraphStyleAttributeName value: value range: newRange]; RELEASE(value); loc = NSMaxRange (effRange); } [_textStorage endEditing]; [self didChangeText]; // Set the typing attributes style = [_layoutManager->_typingAttributes objectForKey: NSParagraphStyleAttributeName]; if (style == nil) style = [self defaultParagraphStyle]; mstyle = [style mutableCopy]; [mstyle addTabStop: new_tab]; // TODO: Should use setTypingAttributes [_layoutManager->_typingAttributes setObject: mstyle forKey: NSParagraphStyleAttributeName]; [notificationCenter postNotificationName: NSTextViewDidChangeTypingAttributesNotification object: _notifObject]; RELEASE(mstyle); [marker setRepresentedObject: new_tab]; RELEASE(new_tab); } /** * Set new marker position from mouse down location. */ - (void) rulerView: (NSRulerView *)ruler handleMouseDown: (NSEvent *)event { NSPoint point = [ruler convertPoint: [event locationInWindow] fromView: nil]; CGFloat location = point.x; NSRulerMarker *marker = [[NSRulerMarker alloc] initWithRulerView: ruler markerLocation: location image: [NSImage imageNamed: @"common_LeftTabStop"] imageOrigin: NSMakePoint(0, 0)]; NSTextTab *tab = [[NSTextTab alloc] initWithType: NSLeftTabStopType location: location]; [marker setRepresentedObject: tab]; [ruler trackMarker: marker withMouseEvent: event]; RELEASE(marker); RELEASE(tab); } /** * Return YES if the marker should be added, NO otherwise. */ - (BOOL) rulerView: (NSRulerView *)ruler shouldAddMarker: (NSRulerMarker *)marker { return [self shouldChangeTextInRange: [self rangeForUserParagraphAttributeChange] replacementString: nil]; } /** * Return YES if the marker should be moved, NO otherwise. */ - (BOOL) rulerView: (NSRulerView *)ruler shouldMoveMarker: (NSRulerMarker *)marker { return [self shouldChangeTextInRange: [self rangeForUserParagraphAttributeChange] replacementString: nil]; } /** * Return YES if the marker should be removed, NO otherwise. */ - (BOOL) rulerView: (NSRulerView *)ruler shouldRemoveMarker: (NSRulerMarker *)marker { return [(NSObject *)[marker representedObject] isKindOfClass: [NSTextTab class]]; } /** * Return a position for adding by constraining the specified location. */ - (CGFloat) rulerView: (NSRulerView *)ruler willAddMarker: (NSRulerMarker *)marker atLocation: (CGFloat)location { NSSize size = [_textContainer containerSize]; if (location < 0.0) return 0.0; if (location > size.width) return size.width; return location; } /** * Return a new position by constraining the specified location. */ - (CGFloat) rulerView: (NSRulerView *)ruler willMoveMarker: (NSRulerMarker *)marker toLocation: (CGFloat)location { NSSize size = [_textContainer containerSize]; if (location < 0.0) return 0.0; if (location > size.width) return size.width; return location; } - (void) updateRuler { NSScrollView *sv; NSRulerView *rv; /* Update ruler view only if told so */ if (_tf.uses_ruler && _tf.is_ruler_visible && (sv = [self enclosingScrollView]) != nil && (rv = [sv horizontalRulerView]) != nil && [rv clientView] == self) { NSParagraphStyle *paraStyle; NSArray *makers; if (_layoutManager->_selected_range.length > 0) /* Multiple chars selection */ { paraStyle = [_textStorage attribute: NSParagraphStyleAttributeName atIndex: _layoutManager->_selected_range.location effectiveRange: NULL]; } else { paraStyle = [_layoutManager->_typingAttributes objectForKey: NSParagraphStyleAttributeName]; } makers = [_layoutManager rulerMarkersForTextView: self paragraphStyle: paraStyle ruler: rv]; [rv setMarkers: makers]; } } /**** Spell checking ****/ - (void) checkSpelling: (id)sender { NSSpellChecker *sp = [NSSpellChecker sharedSpellChecker]; NSString *misspelledWord = nil; NSRange errorRange; int count = 0; if (sp == nil) { return; } errorRange = [sp checkSpellingOfString: [self string] startingAt: NSMaxRange (_layoutManager->_selected_range) language: [sp language] wrap: YES inSpellDocumentWithTag: [self spellCheckerDocumentTag] wordCount: &count]; if (errorRange.length) { [self setSelectedRange: errorRange]; [self scrollRangeToVisible: errorRange]; misspelledWord = [[self string] substringFromRange: errorRange]; [sp updateSpellingPanelWithMisspelledWord: misspelledWord]; } else { [sp updateSpellingPanelWithMisspelledWord: @""]; } } - (void) changeSpelling: (id)sender { [self insertText: [[(NSControl *)sender selectedCell] stringValue]]; } - (void) ignoreSpelling: (id)sender { NSSpellChecker *sp = [NSSpellChecker sharedSpellChecker]; [sp ignoreWord: [[(NSControl *)sender selectedCell] stringValue] inSpellDocumentWithTag: [self spellCheckerDocumentTag]]; } - (NSInteger) spellCheckerDocumentTag { if (!_spellCheckerDocumentTag) _spellCheckerDocumentTag = [NSSpellChecker uniqueSpellDocumentTag]; return _spellCheckerDocumentTag; } /**** Pasteboard handling ****/ - (NSString *) preferredPasteboardTypeFromArray: (NSArray *)availableTypes restrictedToTypesFromArray: (NSArray *)allowedTypes { NSEnumerator *enumerator; NSString *type; if (availableTypes == nil) return nil; if (allowedTypes == nil) return [availableTypes objectAtIndex: 0]; enumerator = [allowedTypes objectEnumerator]; while ((type = [enumerator nextObject]) != nil) { if ([availableTypes containsObject: type]) { return type; } } return nil; } - (BOOL) readSelectionFromPasteboard: (NSPasteboard *)pboard { /* Reads the text view's preferred type of data from the pasteboard specified by the pboard parameter. This method invokes the preferredPasteboardTypeFromArray: restrictedToTypesFromArray: method to determine the text view's preferred type of data and then reads the data using the readSelectionFromPasteboard: type: method. Returns YES if the data was successfully read. */ NSString *type; type = [self preferredPasteboardTypeFromArray: [pboard types] restrictedToTypesFromArray: [self readablePasteboardTypes]]; if (type == nil) return NO; return [self readSelectionFromPasteboard: pboard type: type]; } /* This method is for user changes; see NSTextView_actions.m. (Note that this makes it impossible to paste programmatically, but it's necessary to get the -shouldChangeTextInRange:replacementString: calls right.) */ - (BOOL) readSelectionFromPasteboard: (NSPasteboard *)pboard type: (NSString *)type { /* Reads data of the given type from pboard. The new data is placed at the current insertion point, replacing the current selection if one exists. Returns YES if the data was successfully read. You should override this method to read pasteboard types other than the default types. Use the rangeForUserTextChange method to obtain the range of characters (if any) to be replaced by the new data. */ NSRange changeRange = [self rangeForUserTextChange]; if ([type isEqualToString: NSStringPboardType]) { if (changeRange.location != NSNotFound) { NSString *s = [pboard stringForType: NSStringPboardType]; if (s != nil) { if ([self smartInsertDeleteEnabled] && [pboard dataForType: NSSmartPastePboardType] != nil) { NSString *after, *before; [self smartInsertForString: s replacingRange: changeRange beforeString: &before afterString: &after]; if (before) s = [before stringByAppendingString: s]; if (after) s = [s stringByAppendingString: after]; } if ([self shouldChangeTextInRange: changeRange replacementString: s]) { [self replaceCharactersInRange: changeRange withString: s]; [self didChangeText]; changeRange.length = [s length]; [self setSelectedRange: NSMakeRange(NSMaxRange(changeRange),0)]; } } else return NO; } return YES; } /* TODO: When inserting attributed strings, I call -shouldChangeTextInRange:replacementString: with the string from the attributed string. Need to decide if this is correct (probably; not much else to do), or if I need to do something else. */ if (_tf.is_rich_text) { if ([type isEqualToString: NSRTFPboardType]) { if (changeRange.location != NSNotFound) { NSMutableAttributedString *as; NSData *d = [pboard dataForType: NSRTFPboardType]; as = [[NSMutableAttributedString alloc] initWithRTF: d documentAttributes: NULL]; if ([self smartInsertDeleteEnabled] && [pboard dataForType: NSSmartPastePboardType] != nil) { NSString *after, *before; [self smartInsertForString: [as string] replacingRange: changeRange beforeString: &before afterString: &after]; if (before) { [as replaceCharactersInRange: NSMakeRange(0, 0) withString: before]; } if (after) { [as replaceCharactersInRange: NSMakeRange([as length], 0) withString: after]; } } if ([self shouldChangeTextInRange: changeRange replacementString: [as string]]) { [self replaceCharactersInRange: changeRange withAttributedString: as]; [self didChangeText]; changeRange.length = [as length]; [self setSelectedRange: NSMakeRange(NSMaxRange(changeRange),0)]; } DESTROY(as); } return YES; } } if (_tf.imports_graphics) { if ([type isEqualToString: NSRTFDPboardType]) { if (changeRange.location != NSNotFound) { NSMutableAttributedString *as; NSData *d = [pboard dataForType: NSRTFDPboardType]; as = [[NSMutableAttributedString alloc] initWithRTFD: d documentAttributes: NULL]; if ([self smartInsertDeleteEnabled] && [pboard dataForType: NSSmartPastePboardType] != nil) { NSString *after, *before; [self smartInsertForString: [as string] replacingRange: changeRange beforeString: &before afterString: &after]; if (before) { [as replaceCharactersInRange: NSMakeRange(0, 0) withString: before]; } if (after) { [as replaceCharactersInRange: NSMakeRange([as length], 0) withString: after]; } } if ([self shouldChangeTextInRange: changeRange replacementString: [as string]]) { [self replaceCharactersInRange: changeRange withAttributedString: as]; [self didChangeText]; changeRange.length = [as length]; [self setSelectedRange: NSMakeRange(NSMaxRange(changeRange),0)]; } DESTROY(as); } return YES; } if ([type isEqualToString: NSTIFFPboardType]) { if (changeRange.location != NSNotFound) { NSData *pboardData = [pboard dataForType: NSTIFFPboardType]; NSFileWrapper *wrapper = [[NSFileWrapper alloc] initRegularFileWithContents: pboardData]; NSImage *image = [[NSImage alloc] initWithData: pboardData]; NSTextAttachment *attachment = [[NSTextAttachment alloc] initWithFileWrapper: wrapper]; NSAttributedString *as = [NSAttributedString attributedStringWithAttachment: attachment]; [wrapper setIcon: image]; /* We changed the wrapper's icon. Reset the attachment to force an update of the attachment's cell's image. */ [attachment setFileWrapper: wrapper]; if ([self shouldChangeTextInRange: changeRange replacementString: [as string]]) { [self replaceCharactersInRange: changeRange withAttributedString: as]; [self didChangeText]; changeRange.length = [as length]; [self setSelectedRange: NSMakeRange(NSMaxRange(changeRange),0)]; } RELEASE(attachment); RELEASE(image); RELEASE(wrapper); } return YES; } if ([type isEqualToString: NSFileContentsPboardType]) { NSTextAttachment *attachment = [[NSTextAttachment alloc] initWithFileWrapper: [pboard readFileWrapper]]; NSAttributedString *as = [NSAttributedString attributedStringWithAttachment: attachment]; if (changeRange.location != NSNotFound && [self shouldChangeTextInRange: changeRange replacementString: [as string]]) { [self replaceCharactersInRange: changeRange withAttributedString: as]; [self didChangeText]; changeRange.length = [as length]; [self setSelectedRange: NSMakeRange(NSMaxRange(changeRange),0)]; } RELEASE(attachment); return YES; } } // color accepting if ([type isEqualToString: NSColorPboardType]) { /* This is an attribute change, so we use a different range. */ NSRange aRange = [self rangeForUserCharacterAttributeChange]; if (aRange.location != NSNotFound && [self shouldChangeTextInRange: aRange replacementString: nil]) { NSColor *color = [NSColor colorFromPasteboard: pboard]; NSMutableDictionary *d = [[self typingAttributes] mutableCopy]; [self setTextColor: color range: aRange]; [d setObject: color forKey: NSForegroundColorAttributeName]; [self setTypingAttributes: d]; RELEASE(d); [self didChangeText]; } return YES; } // font pasting if ([type isEqualToString: NSFontPboardType]) { NSData *data = [pboard dataForType: NSFontPboardType]; NSDictionary *dict = [NSUnarchiver unarchiveObjectWithData: data]; if (dict != nil) { /* This is an attribute change, so we use a different range. */ NSRange aRange = [self rangeForUserCharacterAttributeChange]; NSMutableDictionary *d; if (aRange.location != NSNotFound && [self shouldChangeTextInRange: aRange replacementString: nil]) { [_textStorage addAttributes: dict range: aRange]; d = [[self typingAttributes] mutableCopy]; [d addEntriesFromDictionary: dict]; [self setTypingAttributes: d]; RELEASE(d); [self didChangeText]; } return YES; } return NO; } // ruler pasting if ([type isEqualToString: NSRulerPboardType]) { NSData *data = [pboard dataForType: NSRulerPboardType]; NSDictionary *dict = [NSUnarchiver unarchiveObjectWithData: data]; if (dict != nil) { /* This is an attribute change, so we use a different range. */ NSRange aRange = [self rangeForUserParagraphAttributeChange]; NSMutableDictionary *d; if (aRange.location != NSNotFound && [self shouldChangeTextInRange: aRange replacementString: nil]) { [_textStorage addAttributes: dict range: aRange]; d = [[self typingAttributes] mutableCopy]; [d addEntriesFromDictionary: dict]; [self setTypingAttributes: d]; RELEASE(d); [self didChangeText]; } return YES; } return NO; } return NO; } - (NSArray *) readablePasteboardTypes { // get default types, what are they? NSMutableArray *ret = [NSMutableArray arrayWithObjects: NSRulerPboardType, NSColorPboardType, NSFontPboardType, nil]; if (_tf.imports_graphics) { [ret addObject: NSRTFDPboardType]; [ret addObject: NSTIFFPboardType]; [ret addObject: NSFileContentsPboardType]; } if (_tf.is_rich_text) { [ret addObject: NSRTFPboardType]; } [ret addObject: NSStringPboardType]; return ret; } - (NSArray *) writablePasteboardTypes { // the selected text can be written to the pasteboard with which types. if ([self smartInsertDeleteEnabled]) { /* We write this type to the pasteboard, but it does not have a meaning by itself. Therefore, we do not add it in -readablePasteboardTypes. */ NSMutableArray *ret = [[self readablePasteboardTypes] mutableCopy]; [ret addObject: NSSmartPastePboardType]; return [ret autorelease]; } return [self readablePasteboardTypes]; } - (BOOL) writeSelectionToPasteboard: (NSPasteboard *)pboard type: (NSString *)type { /* Writes the current selection to pboard using the given type. Returns YES if the data was successfully written. You can override this method to add support for writing new types of data to the pasteboard. You should invoke super's implementation of the method to handle any types of data your overridden version does not. */ return [self writeSelectionToPasteboard: pboard types: [NSArray arrayWithObject: type]]; } - (BOOL) writeSelectionToPasteboard: (NSPasteboard *)pboard types: (NSArray *)types { /* Writes the current selection to pboard under each type in the types array. Returns YES if the data for any single type was written successfully. You should not need to override this method. You might need to invoke this method if you are implementing a new type of pasteboard to handle services other than copy/paste or dragging. */ BOOL ret = NO; NSEnumerator *enumerator; NSString *type; if (types == nil) { return NO; } if (_layoutManager->_selected_range.location == NSNotFound) { return NO; } [pboard declareTypes: types owner: self]; enumerator = [types objectEnumerator]; while ((type = [enumerator nextObject]) != nil) { if ([type isEqualToString: NSStringPboardType]) { ret = [pboard setString: [[self string] substringWithRange: _layoutManager->_selected_range] forType: NSStringPboardType] || ret; } if ([type isEqualToString: NSRTFPboardType]) { ret = [pboard setData: [self RTFFromRange: _layoutManager->_selected_range] forType: NSRTFPboardType] || ret; } if ([type isEqualToString: NSRTFDPboardType]) { ret = [pboard setData: [self RTFDFromRange: _layoutManager->_selected_range] forType: NSRTFDPboardType] || ret; } if ([type isEqualToString: NSSmartPastePboardType] && [self selectionGranularity] == NSSelectByWord) { ret = [pboard setData: [NSData data] forType: NSSmartPastePboardType] || ret; } if ([type isEqualToString: NSColorPboardType]) { NSColor *color; color = [_textStorage attribute: NSForegroundColorAttributeName atIndex: _layoutManager->_selected_range.location effectiveRange: 0]; if (color != nil) { [color writeToPasteboard: pboard]; ret = YES; } } if ([type isEqualToString: NSFontPboardType]) { NSDictionary *dict; dict = [_textStorage fontAttributesInRange: _layoutManager->_selected_range]; if (dict != nil) { [pboard setData: [NSArchiver archivedDataWithRootObject: dict] forType: NSFontPboardType]; ret = YES; } } if ([type isEqualToString: NSRulerPboardType]) { NSDictionary *dict; dict = [_textStorage rulerAttributesInRange: _layoutManager->_selected_range]; if (dict != nil) { [pboard setData: [NSArchiver archivedDataWithRootObject: dict] forType: NSRulerPboardType]; ret = YES; } } } return ret; } - (NSArray *) acceptableDragTypes { return [self readablePasteboardTypes]; } - (void) updateDragTypeRegistration { /* TODO: Should change registration for all our text views This seems to be handled already; this will be called when the flags change, and those calls are made on all connected text views. */ if (_tf.is_editable) [self registerForDraggedTypes: [self acceptableDragTypes]]; else [self unregisterDraggedTypes]; } /**** Drag and drop handling ****/ /* * Note: Dragging uses a transient insertion point distinct from the text * view's current selection. This allows subclasses of NSTextView to determine * the origin of the dragged selection during a drag operation and provides * better visual feedback for users, since the origin of the dragged selection * remains visible. */ // dragging of text, colors and files - (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal { return (NSDragOperationGeneric | NSDragOperationCopy); } - (void) _updateDragTargetLocation: (id )sender operation: (NSDragOperation *)flags { if (*flags != NSDragOperationNone) { NSPoint dragPoint; NSUInteger dragIndex; dragPoint = [sender draggingLocation]; dragPoint = [self convertPoint: dragPoint fromView: nil]; dragIndex = [self _characterIndexForPoint: dragPoint respectFraction: YES]; if ([sender draggingSource] != self || dragIndex <= [self selectedRange].location || dragIndex >= NSMaxRange([self selectedRange])) { _dragTargetLocation = dragIndex; } else { _dragTargetLocation = NSNotFound; *flags = NSDragOperationNone; } } else if (_dragTargetLocation != NSNotFound) { _dragTargetLocation = NSNotFound; } [self updateInsertionPointStateAndRestartTimer: NO]; [self displayIfNeeded]; } - (NSDragOperation) draggingEntered: (id )sender { NSPasteboard *pboard = [sender draggingPasteboard]; NSArray *types = [self readablePasteboardTypes]; NSString *type = [self preferredPasteboardTypeFromArray: [pboard types] restrictedToTypesFromArray: types]; NSDragOperation flags = [self dragOperationForDraggingInfo: sender type: type]; if (![type isEqual: NSColorPboardType]) { [self _updateDragTargetLocation: sender operation: &flags]; } return flags; } - (NSDragOperation) draggingUpdated: (id )sender { NSPasteboard *pboard = [sender draggingPasteboard]; NSArray *types = [self readablePasteboardTypes]; NSString *type = [self preferredPasteboardTypeFromArray: [pboard types] restrictedToTypesFromArray: types]; NSDragOperation flags = [self dragOperationForDraggingInfo: sender type: type]; NSPoint dragPoint; NSRect vRect; dragPoint = [sender draggingLocation]; dragPoint = [self convertPoint: dragPoint fromView: nil]; /* Note: Keep DRAGGING_SCROLL_BORDER in sync with a similar value used * in -draggingUpdated: of NSOutlineView and NSTableView. * FIXME: Is the value of DRAGGING_SCROLL_DIST reasonable? */ #define DRAGGING_SCROLL_BORDER 3 #define DRAGGING_SCROLL_DIST 10 vRect = [self visibleRect]; if (dragPoint.x <= NSMinX(vRect) + DRAGGING_SCROLL_BORDER) { vRect.origin.x -= DRAGGING_SCROLL_DIST; if (NSMinX(vRect) < NSMinX(_bounds)) vRect.origin.x = NSMinX(_bounds); } else if (dragPoint.x >= NSMaxX(vRect) - DRAGGING_SCROLL_BORDER) { vRect.origin.x += DRAGGING_SCROLL_DIST; if (NSMaxX(vRect) > NSMaxX(_bounds)) vRect.origin.x = NSMaxX(_bounds) - NSWidth(vRect); } if (dragPoint.y <= NSMinY(vRect) + DRAGGING_SCROLL_BORDER) { vRect.origin.y -= DRAGGING_SCROLL_DIST; if (NSMinY(vRect) < NSMinY(_bounds)) vRect.origin.y = NSMinY(_bounds); } else if (dragPoint.y >= NSMaxY(vRect) - DRAGGING_SCROLL_BORDER) { vRect.origin.y += DRAGGING_SCROLL_DIST; if (NSMaxY(vRect) > NSMaxY(_bounds)) vRect.origin.y = NSMaxY(_bounds) - NSHeight(vRect); } [self scrollPoint: vRect.origin]; #undef DRAGGING_SCROLL_BORDER #undef DRAGGING_SCROLL_DIST if (![type isEqual: NSColorPboardType]) { [self _updateDragTargetLocation: sender operation: &flags]; } return flags; } - (void) draggingExited: (id )sender { NSDragOperation flags = NSDragOperationNone; [self _updateDragTargetLocation: sender operation: &flags]; } - (BOOL) prepareForDragOperation: (id )sender { return YES; } - (BOOL) performDragOperation: (id )sender { /* In general, the position where the dragging source was dropped is given by _dragTargetLocation. However, when dragging a color onto a text view, the cursor is not updated, since the color change always effects the current selection and hence _dragTargetLocation==NSNotFound in that case. */ NSSelectionGranularity gran = [self selectionGranularity]; NSRange sourceRange = [self selectedRange]; NSRange changeRange; NSPasteboard *pboard; NSString *type; if (_dragTargetLocation != NSNotFound) { changeRange = NSMakeRange(_dragTargetLocation, 0); _dragTargetLocation = NSNotFound; [self setSelectedRange: changeRange]; } if ([sender draggingSource] == self && ([sender draggingSourceOperationMask] & NSDragOperationGeneric)) { if ([self smartInsertDeleteEnabled] && gran == NSSelectByWord) sourceRange = [self smartDeleteRangeForProposedRange: sourceRange]; if (![self shouldChangeTextInRange: sourceRange replacementString: @""]) { return NO; } [self replaceCharactersInRange: sourceRange withString: @""]; } changeRange = [self rangeForUserTextChange]; pboard = [sender draggingPasteboard]; type = [self preferredPasteboardTypeFromArray: [pboard types] restrictedToTypesFromArray: [self readablePasteboardTypes]]; if ([self readSelectionFromPasteboard: pboard type: type]) { if (![type isEqual: NSColorPboardType]) { changeRange.length = [self selectedRange].location - changeRange.location; [self setSelectedRange: changeRange]; } return YES; } return NO; } - (void) concludeDragOperation: (id )sender { [self cleanUpAfterDragOperation]; } - (void) cleanUpAfterDragOperation { // Cleanup information after dragging operation completes... _dragTargetLocation = NSNotFound; [self updateInsertionPointStateAndRestartTimer: NO]; [self displayIfNeeded]; } - (NSDragOperation) dragOperationForDraggingInfo: (id )dragInfo type: (NSString *)type { //TODO return NSDragOperationCopy | NSDragOperationGeneric; } - (NSImage *) dragImageForSelectionWithEvent: (NSEvent *)event origin: (NSPoint *)origin { if (origin) *origin = NSMakePoint(0, 0); // FIXME return nil; } - (BOOL) dragSelectionWithEvent: (NSEvent *)event offset: (NSSize)mouseOffset slideBack: (BOOL)slideBack { NSPoint point; NSImage *image = [self dragImageForSelectionWithEvent: event origin: &point]; NSPasteboard *pboard = [NSPasteboard pasteboardWithName: NSDragPboard]; NSPoint location = [self convertPoint: [event locationInWindow] fromView: nil]; NSMutableArray *types = [NSMutableArray array]; if (_tf.imports_graphics) [types addObject: NSRTFDPboardType]; if (_tf.is_rich_text) [types addObject: NSRTFPboardType]; [types addObject: NSStringPboardType]; if ([self smartInsertDeleteEnabled]) [types addObject: NSSmartPastePboardType]; [self writeSelectionToPasteboard: pboard types: types]; [self dragImage: image at: location offset: mouseOffset event: event pasteboard: pboard source: self slideBack: slideBack]; return YES; } /**** Event handling ****/ - (void) mouseDown: (NSEvent *)theEvent { BOOL canDrag = NO; NSSelectionAffinity affinity = [self selectionAffinity]; NSSelectionGranularity granularity = NSSelectByCharacter; NSRange chosenRange, proposedRange; NSPoint point, startPoint; NSUInteger startIndex, endIndex; /* If non selectable then ignore the mouse down. */ if (_tf.is_selectable == NO) { return; } if (!_layoutManager) return; /* Otherwise, NSWindow has already made us first responder (if possible) */ startPoint = [self convertPoint: [theEvent locationInWindow] fromView: nil]; startIndex = [self _characterIndexForPoint: startPoint respectFraction: [theEvent clickCount] == 1]; if ([theEvent modifierFlags] & NSShiftKeyMask) { /* Shift-click is for extending or shrinking an existing selection using the existing granularity */ proposedRange = _layoutManager->_selected_range; granularity = _layoutManager->_selectionGranularity; /* If the clicked point is closer to the left end of the current selection adjust the left end of the selected range */ if (startIndex < proposedRange.location + proposedRange.length / 2) { proposedRange = NSMakeRange(startIndex, NSMaxRange(proposedRange) - startIndex); proposedRange = [self selectionRangeForProposedRange: proposedRange granularity: granularity]; /* Prepare for shift-dragging. Anchor is at the right end. */ startIndex = NSMaxRange(proposedRange); } /* otherwise, adjust the right end of the selected range */ else { proposedRange = NSMakeRange(proposedRange.location, startIndex - proposedRange.location); proposedRange = [self selectionRangeForProposedRange: proposedRange granularity: granularity]; /* Prepare for shift-dragging. Anchor is at the left end. */ startIndex = proposedRange.location; } } else /* No shift */ { switch ([theEvent clickCount]) { case 1: granularity = NSSelectByCharacter; break; case 2: granularity = NSSelectByWord; break; case 3: granularity = NSSelectByParagraph; break; } /* A single click into the selected range can start a drag operation */ canDrag = granularity == NSSelectByCharacter && NSLocationInRange(startIndex, _layoutManager->_selected_range); proposedRange = NSMakeRange (startIndex, 0); /* We manage clicks on attachments and links only on the first click, so that if you double-click on them, only the first click gets sent to them; the other clicks select by word/paragraph as usual. */ if (granularity == NSSelectByCharacter) { NSTextAttachment *attachment; /* Check if the click was on an attachment cell. */ attachment = [_textStorage attribute: NSAttachmentAttributeName atIndex: startIndex effectiveRange: NULL]; if (attachment != nil) { id cell = [attachment attachmentCell]; if (cell != nil) { NSRect cellFrame; NSRect lfRect; NSUInteger glyphIndex; glyphIndex = [_layoutManager glyphRangeForCharacterRange: NSMakeRange(startIndex, 1) actualCharacterRange: NULL].location; lfRect = [_layoutManager lineFragmentRectForGlyphAtIndex: glyphIndex effectiveRange: NULL]; cellFrame.origin = [_layoutManager locationForGlyphAtIndex: glyphIndex]; cellFrame.origin.x += lfRect.origin.x; cellFrame.origin.y += lfRect.origin.y; cellFrame.origin.x += _textContainerOrigin.x; cellFrame.origin.y += _textContainerOrigin.y; cellFrame.size = [_layoutManager attachmentSizeForGlyphAtIndex: glyphIndex]; cellFrame.origin.y -= cellFrame.size.height; /* TODO: What about the insertion point ? */ if ([cell wantsToTrackMouseForEvent: theEvent inRect: cellFrame ofView: self atCharacterIndex: startIndex] && [cell trackMouse: theEvent inRect: cellFrame ofView: self atCharacterIndex: startIndex untilMouseUp: NO]) { return; } } } /* This is the code for handling click event on a link (a link is some chars with the NSLinkAttributeName set to something which is not-null, a NSURL object usually). */ { /* What exactly is this link object, it's up to the programmer who is using the NSTextView and who originally created the link object and saved it under the NSLinkAttributeName in the text. Normally, a NSURL object is used. */ /* TODO: should call -clickedOnLink:atIndex: instead */ id link = [_textStorage attribute: NSLinkAttributeName atIndex: startIndex effectiveRange: NULL]; if (link != nil && _delegate != nil) { SEL selector = @selector(textView:clickedOnLink:atIndex:); if ([_delegate respondsToSelector: selector]) { /* Move the insertion point over the link. */ chosenRange = [self selectionRangeForProposedRange: proposedRange granularity: granularity]; [self setSelectedRange: chosenRange affinity: affinity stillSelecting: NO]; [self displayIfNeeded]; /* Now 'activate' the link. The _delegate returns YES if it handles the click, NO if it doesn't -- and if it doesn't, we need to pass the click to the next responder. */ if ([_delegate textView: self clickedOnLink: link atIndex: startIndex]) { return; } else { [super mouseDown: theEvent]; return; } } } } } } chosenRange = [self selectionRangeForProposedRange: proposedRange granularity: granularity]; if (canDrag) { NSUInteger mask = NSLeftMouseDraggedMask | NSLeftMouseUpMask; NSEvent *currentEvent; currentEvent = [_window nextEventMatchingMask: mask untilDate: [NSDate distantFuture] inMode: NSEventTrackingRunLoopMode dequeue: NO]; if ([currentEvent type] == NSLeftMouseDragged) { if (![self dragSelectionWithEvent: theEvent offset: NSMakeSize(0, 0) slideBack: YES]) { NSBeep(); } return; } } /* Enter modal loop tracking the mouse */ { NSUInteger mask = NSLeftMouseDraggedMask | NSLeftMouseUpMask | NSPeriodicMask; NSEvent *currentEvent; NSEvent *lastEvent = nil; /* Last non-periodic event. */ NSDate *distantPast = [NSDate distantPast]; BOOL gettingPeriodic, gotPeriodic; [self setSelectedRange: chosenRange affinity: affinity stillSelecting: YES]; currentEvent = [_window nextEventMatchingMask: mask untilDate: [NSDate distantFuture] inMode: NSEventTrackingRunLoopMode dequeue: YES]; gettingPeriodic = NO; do { gotPeriodic = NO; while (currentEvent && [currentEvent type] != NSLeftMouseUp) { if ([currentEvent type] == NSPeriodic) { gotPeriodic = YES; } else lastEvent = currentEvent; currentEvent = [_window nextEventMatchingMask: mask untilDate: distantPast inMode: NSEventTrackingRunLoopMode dequeue: YES]; } if (currentEvent && [currentEvent type] == NSLeftMouseUp) break; /* Automatic scrolling. If we aren't getting periodic events, we check all events. If any of them causes us to scroll, we scroll and start up the periodic events. If we are getting periodic events, we only scroll when we receive a periodic event (and we use the last non-periodic event to determine how far). If no scrolling occurred, we stop the periodic events. */ if (!gettingPeriodic) { if ([self autoscroll: lastEvent]) { gettingPeriodic = YES; [NSEvent startPeriodicEventsAfterDelay: 0.1 withPeriod: 0.1]; } } else if (gotPeriodic) { if (![self autoscroll: lastEvent]) { gettingPeriodic = NO; [NSEvent stopPeriodicEvents]; } } point = [self convertPoint: [lastEvent locationInWindow] fromView: nil]; endIndex = [self _characterIndexForPoint: point respectFraction: YES]; /** * If the mouse is not inside the receiver, see if it is over another * text view with the same layout manager. If so, use that text view * to compute endIndex */ if (![self mouse: point inRect: [self bounds]]) { BOOL found = NO; // FIXME: Is there an easier way to find the view under a point? NSView *winContentView = [[self window] contentView]; NSView *view = [winContentView hitTest: [[winContentView superview] convertPoint: [lastEvent locationInWindow] fromView: nil]]; for (; view != nil; view = [view superview]) { if ([view isKindOfClass: [NSTextView class]] && [(NSTextView*)view layoutManager] == [self layoutManager]) { found = YES; break; } } if (found) { NSTextView *textview = (NSTextView*)view; NSPoint mouse = [textview convertPoint: [lastEvent locationInWindow] fromView: nil]; endIndex = [textview _characterIndexForPoint: mouse respectFraction: YES]; } } proposedRange = MakeRangeFromAbs(endIndex, startIndex); chosenRange = [self selectionRangeForProposedRange: proposedRange granularity: granularity]; [self setSelectedRange: chosenRange affinity: affinity stillSelecting: YES]; currentEvent = [_window nextEventMatchingMask: mask untilDate: [NSDate distantFuture] inMode: NSEventTrackingRunLoopMode dequeue: YES]; } while ([currentEvent type] != NSLeftMouseUp); if (gettingPeriodic) { [NSEvent stopPeriodicEvents]; } } NSDebugLog(@"chosenRange. location = %d, length = %d\n", (int)chosenRange.location, (int)chosenRange.length); [self setSelectedRange: chosenRange affinity: affinity stillSelecting: NO]; /* Remember granularity till a new selection destroys the memory */ [self setSelectionGranularity: granularity]; } static const NSInteger GSSpellingSuggestionMenuItemTag = 1; - (void) _acceptGuess: (id)sender { NSString *guess = [(NSMenuItem*)sender title]; NSRange range = [self selectedRange]; if (![self shouldChangeTextInRange: range replacementString: guess]) return; [_textStorage beginEditing]; [self replaceCharactersInRange: range withString: guess]; [_textStorage endEditing]; [self didChangeText]; } - (void) rightMouseDown: (NSEvent *)theEvent { NSInteger i; NSMenu *menu = [[self class] defaultMenu]; NSPoint point = [self convertPoint: [theEvent locationInWindow] fromView: nil]; NSUInteger index = [self _characterIndexForPoint: point respectFraction: YES]; if (_tf.is_selectable == NO) return; if (!_layoutManager) return; for (i = [[menu itemArray] count] - 1; i >= 0; --i) { NSMenuItem *item = [menu itemAtIndex: i]; if ([item tag] == GSSpellingSuggestionMenuItemTag) { [menu removeItemAtIndex: i]; } } if (!(index >= [self selectedRange].location && index <= NSMaxRange([self selectedRange]))) { NSRange wordRange = [self selectionRangeForProposedRange: NSMakeRange(index, 0) granularity: NSSelectByWord]; [self setSelectedRange: wordRange affinity: [self selectionAffinity] stillSelecting: NO]; } if (NSEqualRanges([self selectedRange], [self selectionRangeForProposedRange: NSMakeRange([self selectedRange].location, 0) granularity: NSSelectByWord]) && [self selectedRange].length > 0 && [self isEditable]) { // Possibly show spelling suggestions NSSpellChecker *sp = [NSSpellChecker sharedSpellChecker]; NSString *word = [[self string] substringWithRange: [self selectedRange]]; if ([sp checkSpellingOfString: word startingAt: 0].location != NSNotFound) { /*NSArray *guesses = [sp guessesForWordRange: wordRange inString: [self string] language: [sp language] inSpellDocumentWithTag: [self spellCheckerDocumentTag]];*/ NSArray *guesses = [sp guessesForWord: word]; if ([guesses count] > 0) { for (i=0; i < [guesses count] && i < 5; i++) { NSString *guess = [guesses objectAtIndex: i]; [menu insertItemWithTitle: guess action:@selector(_acceptGuess:) keyEquivalent:@"" atIndex:i]; [[menu itemAtIndex: i] setTarget: self]; [[menu itemAtIndex: i] setTag: GSSpellingSuggestionMenuItemTag]; } [menu insertItem: [NSMenuItem separatorItem] atIndex: i]; [[menu itemAtIndex: i] setTag: GSSpellingSuggestionMenuItemTag]; } else { [menu insertItemWithTitle: _(@"No Suggestions") action:(SEL)0 keyEquivalent:@"" atIndex:0]; [[menu itemAtIndex: 0] setTag: GSSpellingSuggestionMenuItemTag]; [[menu itemAtIndex: 0] setEnabled: NO]; [menu insertItem: [NSMenuItem separatorItem] atIndex: 1]; [[menu itemAtIndex: 1] setTag: GSSpellingSuggestionMenuItemTag]; } } } [NSMenu popUpContextMenu: menu withEvent: theEvent forView: self]; } - (void) keyDown: (NSEvent *)theEvent { // If not editable, don't recognize the key down if (_tf.is_editable == NO) { [super keyDown: theEvent]; } else { [self interpretKeyEvents: [NSArray arrayWithObject: theEvent]]; } } /* Bind other mouse up to pasteSelection. This should be done via configuation! */ - (void) otherMouseUp: (NSEvent *)theEvent { // TODO: Should we change the insertion point, based on the event position? [self pasteSelection]; } - (void) startSpeaking:(id) sender { // FIXME } - (void) stopSpeaking:(id) sender { // FIXME } - (BOOL) acceptsGlyphInfo { return _tf.accepts_glyph_info; } - (void) setAcceptsGlyphInfo: (BOOL)flag { _tf.accepts_glyph_info = flag; } - (BOOL) allowsDocumentBackgroundColorChange { return _tf.allows_document_background_color_change; } - (void) setAllowsDocumentBackgroundColorChange: (BOOL)flag { _tf.allows_document_background_color_change = flag; } - (void) changeDocumentBackgroundColor: (id)sender { if ([self allowsDocumentBackgroundColorChange]) { NSColor *aColor = (NSColor *)[sender color]; [self setBackgroundColor: aColor]; } } - (void) changeAttributes: (id)sender { NSDictionary *attributes; NSRange aRange = [self rangeForUserCharacterAttributeChange]; NSRange foundRange; NSUInteger location; NSUInteger maxSelRange = NSMaxRange(aRange); if (aRange.location == NSNotFound) return; if (![self shouldChangeTextInRange: aRange replacementString: nil]) return; [_textStorage beginEditing]; for (location = aRange.location; location < maxSelRange; location = NSMaxRange(foundRange)) { attributes = [_textStorage attributesAtIndex: location effectiveRange: &foundRange]; if (attributes != nil) { attributes = [sender convertAttributes: attributes]; [_textStorage setAttributes: attributes range: foundRange]; } } [_textStorage endEditing]; [self didChangeText]; [self setTypingAttributes: [sender convertAttributes: [self typingAttributes]]]; } - (void) breakUndoCoalescing { DESTROY(_undoObject); } - (void) complete: (id)sender { NSRange range = [self rangeForUserCompletion]; if ([self isEditable] && range.location != NSNotFound && range.length != 0) { GSAutocompleteWindow *window = [GSAutocompleteWindow defaultWindow]; [window displayForTextView: self]; } } - (NSArray *) completionsForPartialWordRange: (NSRange)range indexOfSelectedItem: (NSInteger *)index { if ([_delegate respondsToSelector: @selector(textView:completions:forPartialWordRange:indexOfSelectedItem:)]) { return [_delegate textView: self completions: [[GSAutocompleteWindow defaultWindow] words] forPartialWordRange: range indexOfSelectedItem: index]; } return nil; } - (void) insertCompletion: (NSString *)word forPartialWordRange: (NSRange)range movement: (NSInteger)movement isFinal: (BOOL)flag { NSString *complete; NSString *partial = [word substringToIndex: range.length]; if (![self shouldChangeTextInRange: range replacementString: partial]) return; complete = [word stringByDeletingPrefix: partial]; [_textStorage beginEditing]; [self replaceCharactersInRange: range withString: partial]; [_textStorage endEditing]; [self didChangeText]; [self insertText: complete]; [self didChangeText]; if (!flag && ([self selectedRange].length == 0) ) { [self setSelectedRange: NSMakeRange(NSMaxRange(range), [complete length])]; } } - (void) orderFrontLinkPanel: (id)sender { // FIXME } - (void) orderFrontListPanel: (id)sender { // FIXME } - (void) orderFrontTablePanel: (id)sender { // FIXME } - (void) performFindPanelAction: (id)sender { [[GSTextFinder sharedTextFinder] performFindPanelAction: sender withTextView: self]; } @end @implementation NSTextView (GNUstepPrivate) /* TODO: make sure this is only called when _layoutManager is known non-nil, or add guards */ - (NSUInteger) _characterIndexForPoint: (NSPoint)point respectFraction: (BOOL)respectFraction { NSUInteger index; CGFloat fraction; point.x -= _textContainerOrigin.x; point.y -= _textContainerOrigin.y; if ([_layoutManager extraLineFragmentTextContainer] == _textContainer) { NSRect extraRect = [_layoutManager extraLineFragmentRect]; if (point.y >= NSMinY(extraRect)) return [_textStorage length]; } index = [_layoutManager glyphIndexForPoint: point inTextContainer: _textContainer fractionOfDistanceThroughGlyph: &fraction]; // FIXME The layoutManager should never return -1. // Assume that the text is empty if this happens. if (index == NSNotFound) return 0; index = [_layoutManager characterIndexForGlyphAtIndex: index]; if (respectFraction && fraction > 0.5 && index < [_textStorage length] && [[_textStorage string] characterAtIndex:index] != '\n') { index++; } return index; } - (void) _blink: (NSTimer *)t { if (_drawInsertionPointNow) { _drawInsertionPointNow = NO; } else { _drawInsertionPointNow = YES; } [self setNeedsDisplayInRect: _insertionPointRect avoidAdditionalLayout: YES]; /* Because we are called by a timer which is independent of any event processing in the gui runloop, we need to manually update the window. */ [self displayIfNeeded]; } - (NSRect) rectForCharacterRange: (NSRange)aRange { NSRange glyphRange; NSRect rect; if (!aRange.length || !_layoutManager) return NSZeroRect; glyphRange = [_layoutManager glyphRangeForCharacterRange: aRange actualCharacterRange: NULL]; rect = [_layoutManager boundingRectForGlyphRange: glyphRange inTextContainer: _textContainer]; rect.origin.x += _textContainerOrigin.x; rect.origin.y += _textContainerOrigin.y; return rect; } /** Extension method that copies the current selected text to the special section pasteboard */ - (void) copySelection { #if 1 NSString *newSelection; NSString *oldSelection; NSRange range = _layoutManager->_selected_range; if (range.location != NSNotFound && range.length != 0) { newSelection = [[self string] substringWithRange: range]; oldSelection = [[NSPasteboard pasteboardWithName: @"Selection"] stringForType: NSStringPboardType]; if (oldSelection != nil && ![newSelection isEqualToString: oldSelection]) { NSPasteboard *secondary; secondary = [NSPasteboard pasteboardWithName: @"Secondary"]; [secondary declareTypes: [NSArray arrayWithObject: NSStringPboardType] owner: self]; [secondary setString: oldSelection forType: NSStringPboardType]; } else { return; } } else { return; } #endif [self writeSelectionToPasteboard: [NSPasteboard pasteboardWithName: @"Selection"] type: NSStringPboardType]; } /** Extension method that pastes the current selected text from the special section pasteboard */ - (void) pasteSelection { #if 1 NSString *newSelection; NSString *oldSelection; NSRange range = _layoutManager->_selected_range; if (range.location != NSNotFound && range.length != 0) { newSelection = [[self string] substringWithRange: range]; oldSelection = [[NSPasteboard pasteboardWithName: @"Selection"] stringForType: NSStringPboardType]; if (oldSelection != nil && [newSelection isEqualToString: oldSelection]) { [self readSelectionFromPasteboard: [NSPasteboard pasteboardWithName: @"Secondary"] type: NSStringPboardType]; return; } } #endif [self readSelectionFromPasteboard: [NSPasteboard pasteboardWithName: @"Selection"] type: NSStringPboardType]; } /** * Text checking */ - (void) _checkTextInRange: (NSRange)aRange { NSRange longestRange; id value = [_layoutManager temporaryAttribute: @"NSTextChecked" atCharacterIndex: aRange.location longestEffectiveRange: &longestRange inRange: aRange]; longestRange = NSIntersectionRange(longestRange, aRange); if ([value boolValue] && NSEqualRanges(longestRange, aRange)) { //NSLog(@"No need to check in range %@", NSStringFromRange(aRange)); return; } // Check all of aRange [_layoutManager removeTemporaryAttribute: NSSpellingStateAttributeName forCharacterRange: aRange]; { NSSpellChecker *sp = [NSSpellChecker sharedSpellChecker]; NSInteger start = 0; int count; // FIXME: doing the spellcheck on this substring could create false-positives // if a word is split in half.. so the range should be expanded to the // nearest word boundary NSString *substring = [[self string] substringWithRange: aRange]; do { NSRange errorRange = [sp checkSpellingOfString: substring startingAt: start language: [sp language] wrap: YES inSpellDocumentWithTag: [self spellCheckerDocumentTag] wordCount: &count]; if (errorRange.location < start) { break; } if (errorRange.length > 0) { start = NSMaxRange(errorRange); } else { break; } errorRange = NSMakeRange(aRange.location + errorRange.location, errorRange.length); //NSLog(@"highlighting mistake: %@", [[self string] substringWithRange: errorRange]); [_layoutManager addTemporaryAttribute: NSSpellingStateAttributeName value: [NSNumber numberWithInteger: NSSpellingStateSpellingFlag] forCharacterRange: errorRange]; } while (1); [_layoutManager addTemporaryAttribute: @"NSTextChecked" value: [NSNumber numberWithBool: YES] forCharacterRange: aRange]; } } - (void) _textCheckingTimerFired: (NSTimer *)t { _textCheckingTimer = nil; if (nil == _layoutManager) return; { const NSRect visibleRect = [self visibleRect]; NSRange visibleGlyphRange = [_layoutManager glyphRangeForBoundingRect: visibleRect inTextContainer: _textContainer]; NSRange visibleRange = [_layoutManager characterRangeForGlyphRange: visibleGlyphRange actualGlyphRange: NULL]; [self _checkTextInRange: visibleRange]; _lastCheckedRect = visibleRect; } } - (void) _scheduleTextCheckingTimer { [_textCheckingTimer invalidate]; _textCheckingTimer = [NSTimer scheduledTimerWithTimeInterval: 0.5 target: self selector: @selector(_textCheckingTimerFired:) userInfo: [NSValue valueWithRect: [self visibleRect]] repeats: NO]; } - (void) _scheduleTextCheckingInVisibleRectIfNeeded { if (_tf.continuous_spell_checking) { const NSRect visibleRect = [self visibleRect]; if (!NSEqualRects(visibleRect, _lastCheckedRect)) { if (nil != _textCheckingTimer && NSEqualRects(visibleRect, [[_textCheckingTimer userInfo] rectValue])) { return; } [self _scheduleTextCheckingTimer]; } } } /** * If selected has a nonzero length, return it unmodified. * If selected is touching a word, expand it to cover the entire word * Otherwise return selected unmodified */ - (NSRange) _rangeToInvalidateSpellingForSelectionRange: (NSRange)selected { if (selected.length > 0) { return selected; } else { NSRange prevNonCharacter; NSRange nextNonCharacter; NSRange range; NSCharacterSet *boundary = [[NSCharacterSet letterCharacterSet] invertedSet]; if (selected.location == [[self string] length] && selected.location > 0) { selected.location--; } prevNonCharacter = [[self string] rangeOfCharacterFromSet: boundary options: NSBackwardsSearch range: NSMakeRange(0, selected.location)]; nextNonCharacter = [[self string] rangeOfCharacterFromSet: boundary options: 0 range: NSMakeRange(NSMaxRange(selected), [[self string] length] - NSMaxRange(selected))]; if (prevNonCharacter.length == 0) { range.location = 0; } else { range.location = prevNonCharacter.location + 1; } if (nextNonCharacter.length == 0) { range.length = [[self string] length] - range.location; } else { range.length = nextNonCharacter.location - range.location; } return range; } } - (void) _textDidChange: (NSNotification*)notif { if (_tf.continuous_spell_checking) { // FIXME: This uses the caret position to guess what change caused // the NSTextDidChangeNotification and mark that range of the text as requiring re-checking. // // It would be better to use accurate information to decide what range // need its spelling state invalidated. NSRange range = [self _rangeToInvalidateSpellingForSelectionRange: [self selectedRange]]; if (range.length > 0) { [_layoutManager removeTemporaryAttribute: @"NSTextChecked" forCharacterRange: range]; [_layoutManager removeTemporaryAttribute: NSSpellingStateAttributeName forCharacterRange: range]; } [self _scheduleTextCheckingTimer]; } } - (void) _becomeRulerClient { NSScrollView *sv; NSRulerView *rv; if (_tf.uses_ruler && _tf.is_ruler_visible && (sv = [self enclosingScrollView]) != nil && (rv = [sv horizontalRulerView]) != nil) { [rv setClientView: self]; } } - (void) _resignRulerClient { NSScrollView *sv; NSRulerView *rv; if (_tf.uses_ruler && _tf.is_ruler_visible && (sv = [self enclosingScrollView]) != nil && (rv = [sv horizontalRulerView]) != nil) { [rv setClientView: nil]; } } @end @implementation NSTextViewUndoObject - (id) initWithRange: (NSRange)aRange attributedString: (NSAttributedString *)aString { if ((self = [super init]) != nil) { range = aRange; string = RETAIN(aString); } return self; } - (void) dealloc { RELEASE(string); [super dealloc]; } - (NSRange) range { return range; } - (void) setRange: (NSRange)aRange { range = aRange; } - (void) performUndo: (NSTextStorage *)aTextStorage { NSTextView *tv = [self bestTextViewForTextStorage: aTextStorage]; if ([tv shouldChangeTextInRange: range replacementString: (string ? (NSString*)[string string] : (NSString*)@"")]) { if ([string length] > 0) { [aTextStorage replaceCharactersInRange: range withAttributedString: string]; } else { [aTextStorage replaceCharactersInRange: range withString: @""]; } range.length = [string length]; if ([[tv undoManager] isUndoing]) [tv setSelectedRange: range]; else [tv setSelectedRange: NSMakeRange(NSMaxRange(range), 0)]; [tv didChangeText]; } } - (NSTextView *) bestTextViewForTextStorage: (NSTextStorage *)aTextStorage { NSUInteger i, j; NSArray *layoutManagers, *textContainers; NSTextView *tv, *first = nil, *best = nil; NSWindow *win; /* The "best" view will be one in the key window followed by one in the * main window. In either case, we prefer the window's first responder. * If no view is in the key or main window, we simply use the first text * view. Since -shouldChangeTextInRange:replacementString: returns NO * by default if a NSTextView is not editable, we consider only editable * views here. */ layoutManagers = [aTextStorage layoutManagers]; for (i = 0; i < [layoutManagers count]; i++) { textContainers = [[layoutManagers objectAtIndex: i] textContainers]; for (j = 0; j < [textContainers count]; j++) { tv = [[textContainers objectAtIndex: j] textView]; if ([tv isEditable]) { win = [tv window]; if (first == nil) first = tv; if ([win isKeyWindow]) { if ([win firstResponder] == tv) return tv; else if (best == nil) best = tv; } else if ([win isMainWindow]) { if ([win firstResponder] == tv) { if (best == nil || ![[best window] isKeyWindow]) best = tv; } else if (best == nil) best = tv; } } } } return best != nil ? best : first; } @end @implementation NSTextStorage(NSTextViewUndoSupport) - (void) _undoTextChange: (NSTextViewUndoObject *)anObject { [anObject performUndo: self]; } @end gnustep-gui-0.24.0/Source/NSButton.m0000664000076500007650000003350211673147131017103 0ustar brains99brains99/** NSButton The button class Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Ovidiu Predescu Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import #import "AppKit/NSApplication.h" #import "AppKit/NSButton.h" #import "AppKit/NSButtonCell.h" #import "AppKit/NSEvent.h" #import "AppKit/NSWindow.h" // // class variables // static id buttonCellClass = nil; /** TODO Description */ @implementation NSButton // // Class methods // + (void) initialize { if (self == [NSButton class]) { [self setVersion: 1]; [self setCellClass: [NSButtonCell class]]; } } // // Initializing the NSButton Factory // /** Returns */ + (Class) cellClass { return buttonCellClass; } + (void) setCellClass: (Class)classId { buttonCellClass = classId; } // // Instance methods // - (BOOL) acceptsFirstMouse: (NSEvent *)theEvent { return YES; } - (BOOL) isFlipped { return YES; } /**

Sets the NSButtonCell's type to aType and marks self for display.See NSButtonType for more information.

See Also: [NSButtonCell-setButtonType:]

*/ - (void) setButtonType: (NSButtonType)aType { [_cell setButtonType: aType]; [self setNeedsDisplay: YES]; } - (void)setHighlightsBy:(NSInteger)aType { [_cell setHighlightsBy:aType]; } - (void)setShowsStateBy:(NSInteger)aType { [_cell setShowsStateBy:aType]; } // // 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)]; } /**

Sets the NSButtonCell's state to value and marks self for display.

See Also: -state [NSButtonCell-setState:]

*/ - (void) setState: (NSInteger)value { [_cell setState: value]; [self setNeedsDisplay: YES]; } /**

Returns the NSButtonCell's state.

See Also: -setState: [NSButtonCell-state]

*/ - (NSInteger) state { return [_cell state]; } - (BOOL) allowsMixedState { return [_cell allowsMixedState]; } - (void) setAllowsMixedState: (BOOL)flag { [_cell setAllowsMixedState: flag]; } /**

Sets the NSButtonCell to the next state and marks self for display.

See Also: [NSButtonCell-setNextState]

*/ - (void)setNextState { [_cell setNextState]; [self setNeedsDisplay: YES]; } /**

Gets the NSButtonCell's delay and the interval parameters used when NSButton sends continouly action messages. By default delay is 0.4 and interval is 0.075.

See Also: [NSButtonCell-getPeriodicDelay:interval:] -setPeriodicDelay:interval: [NSCell-trackMouse:inRect:ofView:untilMouseUp:]

*/ - (void) getPeriodicDelay: (float *)delay interval: (float *)interval { [_cell getPeriodicDelay: delay interval: interval]; } /**

Sets the NSButtonCell's delay and interval parameters used when NSButton sends continouly action messages. By default delay is 0.4 and interval is 0.075.

See Also: [NSButtonCell-setPeriodicDelay:interval:] -getPeriodicDelay:interval: [NSCell-trackMouse:inRect:ofView:untilMouseUp:]

*/ - (void) setPeriodicDelay: (float)delay interval: (float)interval { [_cell setPeriodicDelay: delay interval: interval]; } /**

Returns the NSButtonCell's alternate title.

See Also: -setAlternateTitle: [NSButtonCell-alternateTitle]

*/ - (NSString *) alternateTitle { return [_cell alternateTitle]; } /**

Sets the NSButtonCell's alternateTitle to aString and marks self for display.

See Also: -alternateTitle

*/ - (void) setAlternateTitle: (NSString *)aString { [_cell setAlternateTitle: aString]; [self setNeedsDisplay: YES]; } /**

Sets the NSButtonCell's title to aString and marks self for display.

See Also: -title

*/ - (void) setTitle: (NSString *)aString { [_cell setTitle: aString]; [self setNeedsDisplay: YES]; } /**

Returns the NSButtonCell's title.

See Also: [NSButtonCell-title] -setTitle:

*/ - (NSString *) title { return [_cell title]; } - (NSAttributedString *) attributedAlternateTitle { return [_cell attributedAlternateTitle]; } - (NSAttributedString *) attributedTitle { return [_cell attributedTitle]; } - (void) setAttributedAlternateTitle: (NSAttributedString *)aString { [_cell setAttributedAlternateTitle: aString]; [self setNeedsDisplay: YES]; } - (void) setAttributedTitle: (NSAttributedString *)aString { [_cell setAttributedTitle: aString]; [self setNeedsDisplay: YES]; } - (void) setTitleWithMnemonic: (NSString *)aString { [_cell setTitleWithMnemonic: aString]; [self setNeedsDisplay: YES]; } // // Setting the Images // /**

Returns the NSButtonCell's alternate image.

See Also: -setAlternateImage: [NSButtonCell-alternateImage]

*/ - (NSImage *) alternateImage { return [_cell alternateImage]; } /**

Returns the NSButtonCell's image.

See Also: -setImage: [NSButtonCell-image]

*/ - (NSImage *) image { return [_cell image]; } /**

Returns the position of the NSButtonCell's image. See NSCellImagePosition for more information.

See Also: -setImagePosition: [NSButtonCell-imagePosition]

*/ - (NSCellImagePosition) imagePosition { return [_cell imagePosition]; } /**

Sets the NSButtonCell's alternate image to anImage and marks self for display.

See Also: -alternateImage [NSButtonCell-setAlternateImage:]

*/ - (void) setAlternateImage: (NSImage *)anImage { [_cell setAlternateImage: anImage]; [self setNeedsDisplay: YES]; } /**

Sets the NSButtonCell's image to anImage and marks self for display.

See Also: -image [NSButtonCell-setImage:]

*/ - (void) setImage: (NSImage *)anImage { [_cell setImage: anImage]; [self setNeedsDisplay: YES]; } /**

Sets the postion of the NSButtonCell's image to aPosition and marks self for display. See NSCellImagePositionfor more information.

See Also: -imagePosition [NSButtonCell-setImagePosition:]

*/ - (void) setImagePosition: (NSCellImagePosition)aPosition { [_cell setImagePosition: aPosition]; [self setNeedsDisplay: YES]; } // // Modifying Graphic Attributes // /**

Returns whether the NSButton's cell has border.

See Also: -setBordered: [NSButtonCell-isBordered]

*/ - (BOOL) isBordered { return [_cell isBordered]; } /**

Returns whether the NSButton's cell is transparent.

See Also: -setTransparent: [NSButtonCell-isTransparent]

*/ - (BOOL) isTransparent { return [_cell isTransparent]; } /**

Sets whether the NSButton's cell has border and marks self for display.

See Also: -isBordered [NSButtonCell-setBordered:]

*/ - (void) setBordered: (BOOL)flag { [_cell setBordered: flag]; [self setNeedsDisplay: YES]; } /**

Sets whether the NSButton's cell is transparent and marks self for display.

See Also: -isTransparent [NSButtonCell-setTransparent:]

*/ - (void) setTransparent: (BOOL)flag { [_cell setTransparent: flag]; [self setNeedsDisplay: YES]; } /**

Returns the style of the NSButtonCell's bezeled border. See NSBezelStyle for more information.

See Also: -setBezelStyle: [NSButtonCell-bezelStyle]

*/ - (NSBezelStyle)bezelStyle { return [_cell bezelStyle]; } /**

Sets the style of the NSButtonCell's bezeled border and marks self for display. See NSBezelStyle for more information.

See Also: -bezelStyle [NSButtonCell-setBezelStyle:]

*/ - (void)setBezelStyle:(NSBezelStyle)bezelStyle { [_cell setBezelStyle: bezelStyle]; [self setNeedsDisplay: YES]; } - (BOOL)showsBorderOnlyWhileMouseInside { return [_cell showsBorderOnlyWhileMouseInside]; } - (void)setShowsBorderOnlyWhileMouseInside:(BOOL)show { [_cell setShowsBorderOnlyWhileMouseInside: show]; [self setNeedsDisplay: YES]; } // // Displaying // /**

(Un)Highlights the NSButtonCell.

See Also: [NSButtonCell-highlight:withFrame:inView:]

*/ - (void) highlight: (BOOL)flag { [_cell highlight: flag withFrame: _bounds inView: self]; } // // Setting the Key Equivalent // /**

Returns the NSButtonCell's key equivalent. The key equivalent and its modifier mask are used to simulate the click of the button in -performKeyEquivalent:. Returns an empty string if no key equivalent is defined. By default NSButton hasn't key equivalent.

See Also: -setKeyEquivalent: -performKeyEquivalent: -keyEquivalentModifierMask [NSButtonCell-keyEquivalent]

*/ - (NSString*) keyEquivalent { return [_cell keyEquivalent]; } /**

Returns the modifier mask of the NSButtonCell's key equivalent. The key equivalent and its modifier mask are used to simulate the click of the button in -performKeyEquivalent: . The default mask is NSCommandKeyMask.

See Also: -setKeyEquivalentModifierMask: -keyEquivalent [NSButtonCell-setKeyEquivalentModifierMask:]

*/ - (NSUInteger) keyEquivalentModifierMask { return [_cell keyEquivalentModifierMask]; } /**

Sets the NSButtonCell's key equivalent to aKeyEquivalent. The key equivalent and its modifier mask are used to simulate the click of the button in -performKeyEquivalent:. By default NSButton hasn't key equivalent.

See Also: -keyEquivalent -setKeyEquivalentModifierMask: -performKeyEquivalent: [NSButtonCell-setKeyEquivalent:]

*/ - (void) setKeyEquivalent: (NSString*)aKeyEquivalent { [_cell setKeyEquivalent: aKeyEquivalent]; } /**

Sets the modifier mask of the NSButtonCell's key equivalent to mask. The key equivalent and its modifier mask are used to simulate the click of the button in -performKeyEquivalent:. By default the mask is NSCommandKeyMask.

See Also: -keyEquivalentModifierMask -setKeyEquivalent: -performKeyEquivalent: [NSButtonCell-setKeyEquivalentModifierMask:]

*/ - (void) setKeyEquivalentModifierMask: (NSUInteger)mask { [_cell setKeyEquivalentModifierMask: mask]; } // // Determining the first responder // - (BOOL) becomeFirstResponder { [_window disableKeyEquivalentForDefaultButtonCell]; [_cell setShowsFirstResponder: YES]; [self setNeedsDisplay: YES]; return YES; } - (BOOL) resignFirstResponder { [_window enableKeyEquivalentForDefaultButtonCell]; [_cell setShowsFirstResponder: NO]; [self setNeedsDisplay: YES]; return YES; } - (void) becomeKeyWindow { [_cell setShowsFirstResponder: YES]; [self setNeedsDisplay: YES]; } - (void) resignKeyWindow { [_cell setShowsFirstResponder: NO]; [self setNeedsDisplay: YES]; } - (void) keyDown: (NSEvent*)theEvent { if ([self isEnabled]) { NSString *characters = [theEvent characters]; /* Handle SPACE to perform a click */ if ([characters isEqualToString: @" "]) { [self performClick: self]; return; } } [super keyDown: theEvent]; } // // Handling Events and Action Messages // /**

Simulates the click of the button if the key equivalent and its modifier mask match the event anEvent. By default the key modifier mask is NSCommandKeyMask and there is no key equivalent

See Also: -keyEquivalent -keyEquivalentModifierMask [NSControl-performClick:] [NSEvent-charactersIgnoringModifiers] [NSEvent-modifierFlags]

Does nothing and returns NO if the receiver is disabled or if it is blocked by a modal window being run. */ - (BOOL) performKeyEquivalent: (NSEvent *)anEvent { NSWindow *w = [self window]; NSWindow *mw = [NSApp modalWindow]; if ([self isEnabled] && (mw == nil || [w worksWhenModal] || mw == w)) { NSString *keyEquivalent = [self keyEquivalent]; if ([keyEquivalent length] > 0 && [keyEquivalent isEqualToString: [anEvent charactersIgnoringModifiers]]) { NSUInteger mask = [self keyEquivalentModifierMask]; NSUInteger modifiers = [anEvent modifierFlags]; NSUInteger relevantModifiersMask = NSCommandKeyMask | NSAlternateKeyMask | NSControlKeyMask; /* Take shift key into account only for control keys and arrow and function keys */ if ((modifiers & NSFunctionKeyMask) || [[NSCharacterSet controlCharacterSet] characterIsMember:[keyEquivalent characterAtIndex:0]]) relevantModifiersMask |= NSShiftKeyMask; if ((modifiers & relevantModifiersMask) == (mask & relevantModifiersMask)) { [self performClick: self]; return YES; } } } return NO; } - (void) setSound: (NSSound *)aSound { [_cell setSound: aSound]; } - (NSSound *) sound { return [_cell sound]; } @end gnustep-gui-0.24.0/Source/NSComboBoxCell.m0000664000076500007650000015236112161424607020144 0ustar brains99brains99/** NSComboBoxCell Copyright (C) 1999 Free Software Foundation, Inc. Author: Gerrit van Dyk Date: 1999 Author: Quentin Mathe Date: 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSBox.h" #import "AppKit/NSBrowser.h" #import "AppKit/NSBrowserCell.h" #import "AppKit/NSButtonCell.h" #import "AppKit/NSComboBox.h" #import "AppKit/NSComboBoxCell.h" #import "AppKit/NSEvent.h" #import "AppKit/NSGraphicsContext.h" #import "AppKit/NSImage.h" #import "AppKit/NSPanel.h" #import "AppKit/NSScreen.h" #import "AppKit/NSScroller.h" #import "AppKit/NSScrollView.h" #import "AppKit/NSTableColumn.h" #import "AppKit/NSTableView.h" #import "AppKit/NSTextView.h" #import "GNUstepGUI/GSTheme.h" #import "GSGuiPrivate.h" static NSNotificationCenter *nc; @interface GSComboBoxTableView : NSTableView { } @end @implementation GSComboBoxTableView - (BOOL) acceptsFirstMouse: (NSEvent *)event { return YES; } @end @interface GSComboWindow : NSPanel { NSBrowser *_browser; GSComboBoxTableView *_tableView; NSComboBoxCell *_cell; BOOL _stopped; } + (GSComboWindow *) defaultPopUp; - (void) layoutWithComboBoxCell:(NSComboBoxCell *)comboBoxCell; - (void) positionWithComboBoxCell:(NSComboBoxCell *)comboBoxCell; - (void) popUpForComboBoxCell: (NSComboBoxCell *)comboBoxCell; - (void) runModalPopUpWithComboBoxCell:(NSComboBoxCell *)comboBoxCell; - (void) runLoopWithComboBoxCell:(NSComboBoxCell *)comboBoxCell; - (void) onWindowEdited: (NSNotification *)notification; - (void) clickItem: (id)sender; - (void) reloadData; - (void) noteNumberOfItemsChanged; - (void) scrollItemAtIndexToTop: (NSInteger)index; - (void) scrollItemAtIndexToVisible: (NSInteger)index; - (void) selectItemAtIndex: (NSInteger)index; - (void) deselectItemAtIndex: (NSInteger)index; - (void) moveUpSelection; - (void) moveDownSelection; - (void) validateSelection; @end @interface NSComboBoxCell (GNUstepPrivate) - (NSString *) _stringValueAtIndex: (NSInteger)index; - (void) _performClickWithFrame: (NSRect)cellFrame inView: (NSView *)controlView; - (void) _didClickWithinButton: (id)sender; - (BOOL) _isWantedEvent: (NSEvent *)event; - (GSComboWindow *) _popUp; - (NSRect) _textCellFrame; - (void) _setSelectedItem: (NSInteger)index; - (void) _loadButtonCell; - (void) _selectCompleted; @end // --- static GSComboWindow *gsWindow = nil; @implementation GSComboWindow + (GSComboWindow *) defaultPopUp { if (gsWindow == nil) gsWindow = [[self alloc] initWithContentRect: NSMakeRect(0,0,200,200) styleMask: NSBorderlessWindowMask backing: NSBackingStoreNonretained // NSBackingStoreBuffered defer: YES]; return gsWindow; } - (id) initWithContentRect: (NSRect)contentRect styleMask: (NSUInteger)aStyle backing: (NSBackingStoreType)bufferingType defer: (BOOL)flag { NSBox *box; NSRect borderRect; NSScrollView *scrollView; NSTableColumn *column; NSCell *cell; self = [super initWithContentRect: contentRect styleMask: aStyle backing: bufferingType defer: flag]; if (nil == self) return self; [self setLevel: NSPopUpMenuWindowLevel]; [self setBecomesKeyOnlyIfNeeded: YES]; box = [[NSBox alloc] initWithFrame: contentRect]; [box setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [box setBorderType: NSLineBorder]; [box setTitlePosition: NSNoTitle]; [box setContentViewMargins: NSMakeSize(0, 0)]; [self setContentView: box]; borderRect = contentRect; RELEASE(box); _tableView = [[GSComboBoxTableView alloc] initWithFrame: NSMakeRect(0, 0, 100, 100)]; [_tableView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; //[_tableView setBackgroundColor: [NSColor whiteColor]]; [_tableView setDrawsGrid: NO]; [_tableView setAllowsEmptySelection: YES]; [_tableView setAllowsMultipleSelection: NO]; [_tableView setAutoresizesAllColumnsToFit: YES]; [_tableView setHeaderView: nil]; [_tableView setCornerView: nil]; column = [[NSTableColumn alloc] initWithIdentifier: @"content"]; cell = [[NSCell alloc] initTextCell: @""]; [column setDataCell: cell]; RELEASE(cell); [_tableView addTableColumn: column]; RELEASE(column); [_tableView setDataSource: self]; [_tableView setDelegate: self]; [_tableView setAction: @selector(clickItem:)]; [_tableView setTarget: self]; scrollView = [[NSScrollView alloc] initWithFrame: NSMakeRect(borderRect.origin.x, borderRect.origin.y, borderRect.size.width, borderRect.size.height)]; [scrollView setHasVerticalScroller: YES]; [scrollView setDocumentView: _tableView]; [_tableView release]; [box setContentView: scrollView]; RELEASE(scrollView); [_tableView reloadData]; return self; } - (BOOL) canBecomeKeyWindow { return YES; } - (void)dealloc { // Browser, table view and scroll view were not retained so don't release them [super dealloc]; } - (void) layoutWithComboBoxCell: (NSComboBoxCell *)comboBoxCell { NSSize bsize = [[GSTheme theme] sizeForBorderType: NSLineBorder]; NSSize size; CGFloat itemHeight; CGFloat textCellWidth; CGFloat popUpWidth; NSSize intercellSpacing; NSInteger num = [comboBoxCell numberOfItems]; NSInteger max = [comboBoxCell numberOfVisibleItems]; // Manage table view or browser cells height itemHeight = [comboBoxCell itemHeight]; if (itemHeight <= 0) { // FIX ME : raise NSException itemHeight = [_tableView rowHeight]; } size.height = itemHeight; // Manage table view or browser cells width textCellWidth = [comboBoxCell _textCellFrame].size.width; if ([comboBoxCell hasVerticalScroller]) { popUpWidth = textCellWidth + [NSScroller scrollerWidth]; } else { popUpWidth = textCellWidth; } size.width = textCellWidth - bsize.width; if (size.width < 0) { size.width = 0; } [_tableView setRowHeight: size.height]; // Just check intercell spacing intercellSpacing = [comboBoxCell intercellSpacing]; if (intercellSpacing.height <= 0) { // FIX ME : raise NSException intercellSpacing.height = [_tableView intercellSpacing].height; } else { [_tableView setIntercellSpacing: intercellSpacing]; } if (num > max) num = max; [self setFrame: [self frameRectForContentRect: NSMakeRect(0, 0, popUpWidth, 2 * bsize.height + (itemHeight + intercellSpacing.height) * (num - 1) + itemHeight)] display: NO]; } - (void) positionWithComboBoxCell: (NSComboBoxCell *)comboBoxCell { NSView *viewWithComboCell = [comboBoxCell controlView]; NSRect screenFrame; NSRect comboWindowFrame; NSRect viewWithComboCellFrame; NSRect rect; NSPoint point, oldPoint; [self layoutWithComboBoxCell: comboBoxCell]; // Now we can ask for the size comboWindowFrame = [self frame]; if (comboWindowFrame.size.width == 0 || comboWindowFrame.size.height == 0) return; screenFrame = [[[viewWithComboCell window] screen] frame]; viewWithComboCellFrame = [comboBoxCell _textCellFrame]; if ([viewWithComboCell isFlipped]) { point = viewWithComboCellFrame.origin; point.y = NSMaxY(viewWithComboCellFrame); } else { point = viewWithComboCellFrame.origin; } // Switch to the window coordinates point = [viewWithComboCell convertPoint: point toView: nil]; // Switch to the screen coordinates point = [[viewWithComboCell window] convertBaseToScreen: point]; point.y -= 1 + NSHeight(comboWindowFrame); if (point.y < 0) { // Off screen, so move it oldPoint = point; point = viewWithComboCellFrame.origin; point.y = NSMaxY(viewWithComboCellFrame); // Switch to the window coordinates point = [viewWithComboCell convertPoint: point toView: nil]; // Switch to the screen coordiantes point = [[viewWithComboCell window] convertBaseToScreen: point]; point.y += 1; if (point.y + NSHeight(comboWindowFrame) > NSHeight(screenFrame)) point = oldPoint; } rect.size.width = NSWidth(comboWindowFrame); rect.size.height = NSHeight(comboWindowFrame); rect.origin.x = point.x; rect.origin.y = point.y; [self setFrame: rect display: NO]; } - (void) popUpForComboBoxCell: (NSComboBoxCell *)comboBoxCell { _cell = comboBoxCell; [self positionWithComboBoxCell: _cell]; [_cell _selectCompleted]; [self reloadData]; [self enableKeyEquivalentForDefaultButtonCell]; [self runModalPopUpWithComboBoxCell: _cell]; _cell = nil; [self deselectItemAtIndex: 0]; } - (void) runModalPopUpWithComboBoxCell: (NSComboBoxCell *)comboBoxCell { NSWindow *onWindow; onWindow = [[_cell controlView] window]; [nc addObserver: self selector: @selector(onWindowEdited:) name: NSWindowWillCloseNotification object: onWindow]; [nc addObserver: self selector: @selector(onWindowEdited:) name: NSWindowWillMoveNotification object: onWindow]; [nc addObserver: self selector: @selector(onWindowEdited:) name: NSWindowWillMiniaturizeNotification object: onWindow]; // FIX ME: The notification below doesn't exist currently // [nc addObserver: self selector: @selector(onWindowEdited:) // name: NSWindowWillResizeNotification object: onWindow]; // FIXME: The code below must be removed when the notifications over will work [nc addObserver: self selector: @selector(onWindowEdited:) name: NSWindowDidMoveNotification object: onWindow]; [nc addObserver: self selector: @selector(onWindowEdited:) name: NSWindowDidMiniaturizeNotification object: onWindow]; [nc addObserver: self selector: @selector(onWindowEdited:) name: NSWindowDidResizeNotification object: onWindow]; // End of the code to remove [self orderFront: self]; [self makeFirstResponder: _tableView]; [self runLoopWithComboBoxCell: comboBoxCell]; [nc removeObserver: self name: nil object: onWindow]; [self close]; [onWindow makeFirstResponder: [_cell controlView]]; } - (void) runLoopWithComboBoxCell: (NSComboBoxCell *)comboBoxCell { NSEvent *event; NSDate *limit = [NSDate distantFuture]; unichar key; CREATE_AUTORELEASE_POOL (pool); while (YES) { event = [NSApp nextEventMatchingMask: NSAnyEventMask untilDate: limit inMode: NSDefaultRunLoopMode dequeue: YES]; if ([event type] == NSLeftMouseDown || [event type] == NSRightMouseDown) { if ([comboBoxCell _isWantedEvent: event] == NO && [event window] != self) { break; } else { [NSApp sendEvent: event]; } } else if ([event type] == NSKeyDown) { key = [[event characters] characterAtIndex: 0]; if (key == NSUpArrowFunctionKey) { [self moveUpSelection]; } else if (key == NSDownArrowFunctionKey) { [self moveDownSelection]; } else if (key == NSNewlineCharacter || key == NSEnterCharacter || key == NSCarriageReturnCharacter) { [self validateSelection]; } else if (key == 0x001b) { break; } else { [NSApp sendEvent: event]; } } else { [NSApp sendEvent: event]; } if (_stopped) break; } _stopped = NO; [pool drain]; } // onWindow notifications - (void) onWindowEdited: (NSNotification *)notification { _stopped = YES; } - (void) reloadData { [_tableView reloadData]; [self selectItemAtIndex: [_cell indexOfSelectedItem]]; } - (void) noteNumberOfItemsChanged { // FIXME: Probably should only load the additional items [self reloadData]; } - (void) scrollItemAtIndexToTop: (NSInteger)index { NSRect rect; rect = [_tableView frameOfCellAtColumn: 0 row: index]; [_tableView scrollPoint: rect.origin]; } - (void) scrollItemAtIndexToVisible: (NSInteger)index { [_tableView scrollRowToVisible: index]; } - (void) selectItemAtIndex: (NSInteger)index { if (index < 0) return; if ([_tableView selectedRow] == index || [_tableView numberOfRows] <= index) return; [_tableView selectRow: index byExtendingSelection: NO]; } - (void) deselectItemAtIndex: (NSInteger)index { [_tableView deselectAll: self]; } // Target/Action method - (void) clickItem: (id)sender { if (_cell == nil) return; [_cell _setSelectedItem: [sender selectedRow]]; [self validateSelection]; [nc postNotificationName: NSComboBoxSelectionDidChangeNotification object: [_cell controlView] userInfo: nil]; } // Browser delegate methods - (NSInteger) browser: (NSBrowser *)sender numberOfRowsInColumn: (NSInteger)column { if (_cell == nil) return 0; return [_cell numberOfItems]; } - (void) browser: (NSBrowser *)sender willDisplayCell: (id)aCell atRow: (NSInteger)row column: (NSInteger)column { if (_cell == nil) return; [aCell setStringValue: [_cell _stringValueAtIndex: row]]; [aCell setLeaf: YES]; } // Table view data source methods - (NSInteger) numberOfRowsInTableView: (NSTableView *)tv { return [_cell numberOfItems]; } - (id) tableView: (NSTableView *)tv objectValueForTableColumn: (NSTableColumn *)tc row: (NSInteger)row { return [_cell _stringValueAtIndex: row]; } // Table view delegate methods - (void) tableViewSelectionDidChange: (NSNotification *)notification { [_cell _setSelectedItem: [[notification object] selectedRow]]; [nc postNotificationName: NSComboBoxSelectionDidChangeNotification object: [_cell controlView] userInfo: nil]; } // Key actions methods - (void) moveUpSelection { NSInteger index = [_tableView selectedRow] - 1; if (index > -1 && index < [_tableView numberOfRows]) { [_tableView selectRow: index byExtendingSelection: NO]; [_tableView scrollRowToVisible: index]; } } - (void) moveDownSelection { NSInteger index = [_tableView selectedRow] + 1; if (index > -1 && index < [_tableView numberOfRows]) { [_tableView selectRow: index byExtendingSelection: NO]; [_tableView scrollRowToVisible: index]; } } - (void) validateSelection { if (_cell != nil) { NSText *textObject = nil; id cv = [_cell controlView]; NSInteger index = [_cell indexOfSelectedItem]; if ([cv isKindOfClass: [NSControl class]]) { textObject = [(NSControl *)cv currentEditor]; } if (index != -1) { [_cell setStringValue: [_cell _stringValueAtIndex: [_cell indexOfSelectedItem]]]; // Will update the editor when needed } if (textObject != nil) { NSRange selectionRange = NSMakeRange(0, [[textObject string] length]); [textObject setSelectedRange: selectionRange]; [textObject scrollRangeToVisible: selectionRange]; } [cv sendAction: [_cell action] to: [_cell target]]; _stopped = YES; } } @end // --- /** Class Description

An NSComboBoxCell is what we can call a completion/choices box cell, derived from NSTextFieldCell, it allows you to enter text like in a text field but also to click in the ellipsis button (indicating the fact other user inputs are possible) on the right of it to obtain a list of choices, you can use them as the text field value by selecting a row in this list. You can also obtain direct completion when it is enabled via setCompletes: to get a suggested text field value updated as you type.

Like other NSCell classes, NSComboBoxCell has a matching NSControl named NSComboBox which is relying on it to implement the combo box behavior in a standalone control.

*/ /** *

No special instructions to use NSComboBoxCell or text to detail the implementation.

*/ @implementation NSComboBoxCell /* * Class methods */ + (void) initialize { if (self == [NSComboBoxCell class]) { [NSComboBoxCell setVersion: 2]; nc = [NSNotificationCenter defaultCenter]; } } - (id) initTextCell: (NSString *)aString { self = [super initTextCell: aString]; // Implicitly set by allocation: // //_dataSource = nil; //_buttonCell = nil; //_usesDataSource = NO; //_completes = NO; _popUpList = [[NSMutableArray alloc] init]; _hasVerticalScroller = YES; _visibleItems = 10; _intercellSpacing = NSMakeSize(3.0, 2.0); _itemHeight = 16; _selectedItem = -1; [self _loadButtonCell]; return self; } - (void) dealloc { RELEASE(_buttonCell); RELEASE(_popUpList); [super dealloc]; } - (id) copyWithZone: (NSZone*)zone { NSComboBoxCell *c = [super copyWithZone: zone]; c->_buttonCell = [_buttonCell copyWithZone: zone]; [c->_buttonCell setTarget: c]; c->_popUpList = [_popUpList copyWithZone: zone]; return c; } /** * Returns YES when the combo box cell displays a vertical scroller for its * list, returns NO otherwise. * Take note that the scroller will be displayed even when the sum of the items * height in the list is inferior to the minimal height of the list displayed * area. */ - (BOOL) hasVerticalScroller { return _hasVerticalScroller; } /** * Sets whether the combo box cell list displays a vertical scroller, by default * it is the case. When flag is NO and the combo cell list has more * items (either in its default list or from its data source) than the number * returned by numberOfVisibleItems, only a subset of them will be * displayed. Uses scroll related methods to position this subset in the combo * box cell list. * Take note that the scroller will be displayed even when the sum of the items * height in the list is inferior to the minimal height of the list displayed * area. */ - (void) setHasVerticalScroller: (BOOL)flag { _hasVerticalScroller = flag; } /** * Returns the width and the height (as the values of an NSSize variable) * between each item of the combo box cell list. */ - (NSSize) intercellSpacing { return _intercellSpacing; } /** * Sets the width and the height between each item of the combo box cell list to * the values in aSize. */ - (void) setIntercellSpacing: (NSSize)aSize { _intercellSpacing = aSize; } /** * Returns the height of the items in the combo box cell list. */ - (CGFloat) itemHeight { return _itemHeight; } /** * Sets the height of the items in the combo box cell list to * itemHeight. */ - (void) setItemHeight: (CGFloat)itemHeight { if (itemHeight > 14.0) _itemHeight = itemHeight; } /** * Returns the maximum number of allowed items to be displayed in the combo box * cell list. */ - (NSInteger) numberOfVisibleItems { return _visibleItems; } /** * Sets the maximum number of allowed items to be displayed in the combo box * cell list. */ - (void) setNumberOfVisibleItems: (NSInteger)visibleItems { if (visibleItems > 10) _visibleItems = visibleItems; } /** * Marks the combo box cell in order to have its items list reloaded in the * case it uses a data source, and to have it redisplayed. */ - (void) reloadData { [_popup reloadData]; } /** * Informs the combo box cell that the number of items in its data source has * changed, in order to permit to the scrollers in its displayed list being * updated without needing the reload of the data. * It is recommended to use this method with a data source that continually * receives data in the background, to keep the the combo box cell responsive to * the user while the data is received. * Take a look at the NSComboBoxDataSource informal protocol * specification to know more on the messages NSComboBox sends to its data * source. */ - (void) noteNumberOfItemsChanged { [_popup noteNumberOfItemsChanged]; } /** * Returns YES when the combo box cell uses a data source (which is external) to * populate its items list, otherwise returns NO in the case it uses its default * list. */ - (BOOL) usesDataSource { return _usesDataSource; } /** * Sets according to flag whether the combo box cell uses a data * source (which is external) to populate its items list. */ - (void) setUsesDataSource: (BOOL)flag { _usesDataSource = flag; } /** * Scrolls the combo box cell list vertically in order to have the item at * index in the closest position relative to the top. There is no * need to have the list displayed when this method is invoked. */ - (void) scrollItemAtIndexToTop: (NSInteger)index { [_popup scrollItemAtIndexToTop: index]; } /** * Scrolls the combo box cell list vertically in order to have the item at * index visible. There is no need to have the list displayed when * this method is invoked. */ - (void) scrollItemAtIndexToVisible: (NSInteger)index { [_popup scrollItemAtIndexToVisible: index]; } /** * Selects the combo box cell list row at index. * Take note no changes occurs in the combo box cell list when this method is * called. * Posts an NSComboBoxSelectionDidChangeNotification to the default notification * center when there is a new selection different from the previous one. */ - (void) selectItemAtIndex: (NSInteger)index { // Method called by GSComboWindow when a selection is done in the table view or // the browser if (index < 0 || [self numberOfItems] <= index) return; // FIXME: Probably we should raise an exception if (_selectedItem != index) { [self _setSelectedItem: index]; [_popup selectItemAtIndex: index]; // This method call will not create a infinite loop when the index has been // already set by a mouse click because the method is not completed when the // current index is not different from the index parameter [nc postNotificationName: NSComboBoxSelectionDidChangeNotification object: [self controlView] userInfo: nil]; } } /** * Deselects the combo box cell list row at index in the case this * row is selected. * Posts an NSComboBoxSelectionDidChangeNotification to the default notification * center, when there is a new selection. */ - (void) deselectItemAtIndex: (NSInteger)index { if (_selectedItem == index) { [self _setSelectedItem: -1]; [_popup deselectItemAtIndex: index]; [nc postNotificationName: NSComboBoxSelectionDidChangeNotification object: [self controlView] userInfo: nil]; } } /** * Returns the index of the selected item in the combo box cell list or -1 when * there is no selection, the selected item can be related to the data source * object in the case usesDataSource returns YES else to the * default items list. */ - (NSInteger) indexOfSelectedItem { return _selectedItem; } /** * Returns the number of items in the the combo box cell list, the numbers of * items can be be related to the data source object in the case * usesDataSource returns YES else to the default items list. */ - (NSInteger) numberOfItems { if (_usesDataSource) { if (_dataSource == nil) { NSLog(@"%@: No data source currently specified", self); } else if ([_dataSource respondsToSelector: @selector(numberOfItemsInComboBox:)]) { return [_dataSource numberOfItemsInComboBox: (NSComboBox *)[self controlView]]; } else if ([_dataSource respondsToSelector: @selector(numberOfItemsInComboBoxCell:)]) { return [_dataSource numberOfItemsInComboBoxCell: self]; } } else { return [_popUpList count]; } return 0; } /** * Returns the combo box cell data source object which is reponsible to provide * the data to be displayed. To know how to implement a data source object, * take a look at the NSComboBoxDataSource informal protocol description. In * the case usesDataSource returns NO, this method logs a warning. */ - (id) dataSource { return _dataSource; } /** * Sets the combo box cell data source to aSource. Just calling this * method doesn't set usesDataSource to return YES, you must call * setUsesDataSource: with YES before or a warning will be logged. * To know how to implement a data source objects, take a look at the * NSComboBoxDataSource informal protocol description. When aSource * doesn't respond to the methods numberOfItemsInComboBox: * comboBox:objectValueForItemAtIndex:, this method * logs a warning. */ - (void) setDataSource: (id)aSource { if (_usesDataSource == NO) { NSLog(@"%@: This method is invalid, this combo box is not set to use a data source", self); } else { _dataSource = aSource; } } /** * Adds an item to the combo box cell default items list which is used when * usesDataSource returns NO. In the case * usesDataSource returns YES, this method logs a warning. */ - (void) addItemWithObjectValue: (id)object { if (_usesDataSource) { NSLog(@"%@: This method is invalid, this combo box is set to use a data source", self); } else { [_popUpList addObject: object]; } [self reloadData]; } /** * Adds several items in an array to the combo box cell default items list which * is used when usesDataSource returns NO. In the case * usesDataSource returns YES, this method logs a warning. */ - (void) addItemsWithObjectValues: (NSArray *)objects { if (_usesDataSource) { NSLog(@"%@: This method is invalid, this combo box is set to use a data source", self); } else { [_popUpList addObjectsFromArray: objects]; } [self reloadData]; } /** * Inserts an item in the combo box cell default items list which * is used when usesDataSource returns NO. In the case * usesDataSource returns YES, this method logs a warning. */ - (void) insertItemWithObjectValue: (id)object atIndex: (NSInteger)index { if (_usesDataSource) { NSLog(@"%@: This method is invalid, this combo box is set to use a data source", self); } else { [_popUpList insertObject: object atIndex: index]; } [self reloadData]; } /** * Removes an item in the combo box cell default items list which * is used when usesDataSource returns NO. In the case * usesDataSource returns YES, this method logs a warning. */ - (void) removeItemWithObjectValue: (id)object { if (_usesDataSource) { NSLog(@"%@: This method is invalid, this combo box is set to use a data source", self); } else { [_popUpList removeObject: object]; } [self reloadData]; } /** * Removes the item with the specified index in the combo box cell * default items list which is used when usesDataSource returns NO. * In the case usesDataSource returns YES, this method logs a warning. */ - (void) removeItemAtIndex: (NSInteger)index { if (_usesDataSource) { NSLog(@"%@: This method is invalid, this combo box is set to use a data source", self); } else { [_popUpList removeObjectAtIndex: index]; } [self reloadData]; } /** * Removes all the items in the combo box cell default items list which is used * when usesDataSource returns NO. In the case * usesDataSource returns YES, this method logs a warning. */ - (void) removeAllItems { if (_usesDataSource) { NSLog(@"%@: This method is invalid, this combo box is set to use a data source", self); } else { [_popUpList removeAllObjects]; } [self reloadData]; } /** * Selects the first item in the default combo box cell list which is equal to * object. In the case usesDataSource returns YES, this * method logs a warning. * Take note that this method doesn't update the text field part value. * Posts an NSComboBoxSelectionDidChange notification to the default * notification center when the new selection is different than the previous * one. */ - (void) selectItemWithObjectValue: (id)object { if (_usesDataSource) { NSLog(@"%@: This method is invalid, this combo box is set to use a data source", self); } else { NSInteger i = [_popUpList indexOfObject: object]; if (i == NSNotFound) i = -1; [self selectItemAtIndex: i]; } } /** * Returns the object value at index within combo box cell default * items list. When the index is beyond the end of the list, an NSRangeException is * raised. In the case usesDataSource returns YES, this method logs * a warning. */ - (id) itemObjectValueAtIndex: (NSInteger)index { if (_usesDataSource) { NSLog(@"%@: This method is invalid, this combo box is set to use a data source", self); return nil; } else { return [_popUpList objectAtIndex: index]; } } /* FIXME: Not sure, if this is the best way to implement objectValue, * perhaps it would be better to store the current value with setObjectValue: * whenever it changes. */ - (id) objectValue { NSInteger index = [self indexOfSelectedItem]; if (index == -1) { return nil; } else { if (_usesDataSource) { if (_dataSource == nil) { NSLog(@"%@: No data source currently specified", self); return nil; } if ([_dataSource respondsToSelector: @selector(comboBox:objectValueForItemAtIndex:)]) { return [_dataSource comboBox: (NSComboBox *)[self controlView] objectValueForItemAtIndex: index]; } else if ([_dataSource respondsToSelector: @selector(comboBoxCell:objectValueForItemAtIndex:)]) { return [_dataSource comboBoxCell: self objectValueForItemAtIndex: index]; } } else { return [self itemObjectValueAtIndex: index]; } } return nil; } /** * Returns the object value of the selected item in the combo box cell default * items list or nil when there is no selection. In the case * usesDataSource returns YES, this method logs a warning. */ - (id) objectValueOfSelectedItem { if (_usesDataSource) { NSLog(@"%@: This method is invalid, this combo box is set to use a data source", self); return nil; } else { NSInteger index = [self indexOfSelectedItem]; if (index == -1) { return nil; } else { return [_popUpList objectAtIndex: index]; } } } /** * Returns the lowest index associated with a value in the combo box * cell default items list, which is equal to object, and returns * NSNotFound when there is no such value. In the case * usesDataSource returns YES, this method logs a warning. */ - (NSInteger) indexOfItemWithObjectValue: (id)object { if (_usesDataSource) { NSLog(@"%@: This method is invalid, this combo box is set to use a data source", self); return 0; } return [_popUpList indexOfObject: object]; } /** * Returns the combo box cell default items list in an array. */ - (NSArray *) objectValues { if (_usesDataSource) { NSLog(@"%@: This method is invalid, this combo box is set to use a data source", self); return nil; } return _popUpList; } // Text completion /** * Returns a string by looking in the combo box cell list for an item wich * starts with substring, or nil when there is no such string. * substring is equal to what the user entered in the text field * part. * You rarely needs to call this method explicitly in your code. * By default, the implementation of this method first checks whether the combo * box cell uses a data source and whether the data source responds to * comboBox:completedString: or comboBoxCell:completedString:. * When it is the case, it uses this method to return str, else this * method goes through the combo box cell items one by one and returns the first * item found starting with substring. * In the case, you want another behavior, you can override this method without * need to call the superclass method. */ - (NSString *) completedString: (NSString *)substring { if (nil == substring) { return nil; } if (_usesDataSource) { if (_dataSource == nil) { NSLog(@"%@: No data source currently specified", self); } else if ([_dataSource respondsToSelector: @selector(comboBox:completedString:)]) { return [_dataSource comboBox: (NSComboBox *)[self controlView] completedString: substring]; } else if ([_dataSource respondsToSelector: @selector(comboBoxCell:completedString:)]) { return [_dataSource comboBoxCell: self completedString: substring]; } else { NSInteger i; for (i = 0; i < [self numberOfItems]; i++) { NSString *str = [self _stringValueAtIndex: i]; if ([str length] > [substring length] && [str hasPrefix: substring]) return str; } } } else { NSUInteger i; for (i = 0; i < [_popUpList count]; i++) { NSString *str = [[_popUpList objectAtIndex: i] description]; if ([str length] > [substring length] && [str hasPrefix: substring]) return str; } } return substring; } /** * Returns YES when the combo box cell automatic completion is active, returns * NO otherwise. * Take a look at the setCompletes: method documentation to know * how the automatic completion works. */ - (BOOL) completes { return _completes; } /** * Sets whether the combo box cell automatic completion is active or not. * The automatic completion tries to complete what the user types in the text * field part, it tries to complete only when the the user adds characters at * the end of the string, not when it deletes characters or when the insertion * point precedes the end of the string. * To do the automatic completion, the completedString: method is * called, and when the returned string is longer than the current one in the text * field, the completion occurs and the completed part gets selected. */ - (void) setCompletes: (BOOL)completes { _completes = completes; } - (BOOL) isButtonBordered { return [_buttonCell isBordered]; } - (void) setButtonBordered:(BOOL)flag { [_buttonCell setBordered: flag]; } #define ComboBoxHeight 21 // FIX ME: All this stuff shouldn't be hardcoded #define ButtonWidth 17 #define ButtonHeight 17 #define BorderSize 2 // The inset border for the top and the bottom of the button /* * Inlined methods */ static inline NSRect textCellFrameFromRect(NSRect cellRect) // Not the drawed part, precises just the part which receives events { return NSMakeRect(NSMinX(cellRect), NSMinY(cellRect), NSWidth(cellRect) - ButtonWidth - BorderSize, NSHeight(cellRect)); } static inline NSRect buttonCellFrameFromRect(NSRect cellRect) { return NSMakeRect(NSMaxX(cellRect) - ButtonWidth - BorderSize, NSMinY(cellRect) + BorderSize, ButtonWidth, ButtonHeight); } // Overridden + (BOOL) prefersTrackingUntilMouseUp { return YES; /* Needed to have the clickability of the button take in account when the tracking happens. This method is call by the NSControl -mouseDown: method with the code : [_cell trackMouse: e inRect: _bounds ofView: self untilMouseUp: [[_cell class] prefersTrackingUntilMouseUp]] */ } - (NSSize) cellSize { NSSize textSize; NSSize buttonSize; NSSize mySize; /* Simple version takes the size from text field. A more useful one could loop over the strings of the combo box and calculate the maximal width of all strings. */ textSize = [super cellSize]; // Or should we use the hard coded values from above here? buttonSize = [_buttonCell cellSize]; mySize.height = MAX(textSize.height, buttonSize.height); mySize.width = textSize.width + BorderSize + buttonSize.width; return mySize; } - (void) drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { NSRect rect = cellFrame; // FIX ME: Is this test case below with the method call really needed ? if ([GSCurrentContext() isDrawingToScreen]) { [super drawInteriorWithFrame: textCellFrameFromRect(rect) inView: controlView]; [_buttonCell drawWithFrame: buttonCellFrameFromRect(rect) inView: controlView]; } else { [super drawInteriorWithFrame: rect inView: controlView]; } // Used by GSComboWindow to appear in the right position _lastValidFrame = cellFrame; } - (void) highlight: (BOOL)flag withFrame: (NSRect)cellFrame inView: (NSView *)controlView { NSRect rect = cellFrame; // FIX ME: Is this test case below with the method call really needed ? if ([GSCurrentContext() isDrawingToScreen]) { [super highlight: flag withFrame: textCellFrameFromRect(rect) inView: controlView]; [_buttonCell highlight: flag withFrame: buttonCellFrameFromRect(rect) inView: controlView]; } else { [super highlight: flag withFrame: rect inView: controlView]; } } /** Overrides NSCell trackMouse:inRect:ofView:untilMouseUp: method to establish a * new method behavior. * In the case flag is NO, returns NO when the mouse down occurs in the text * cell part or when the mouse down occurs in the button cell part followed by a * mouse up outside, otherwise returns YES (when both the mouse down and the * mouse up occurs in the button cell part). * In the case flag is YES, returns NO when the mouse occurs in the text * cell part, otherwise returns YES (when the mouse down occurs in the button cell * part). */ - (BOOL) trackMouse: (NSEvent *)theEvent inRect: (NSRect)cellFrame ofView: (NSView *)controlView untilMouseUp: (BOOL)flag { NSPoint point; BOOL isFlipped = [controlView isFlipped]; NSRect buttonRect = buttonCellFrameFromRect(cellFrame); NSRect textRect = textCellFrameFromRect(cellFrame); BOOL result = NO; // FIXME: May be that should be set by NSActionCell if (_control_view != controlView) _control_view = controlView; // Used by GSComboWindow to appear in the right position _lastValidFrame = cellFrame; point = [controlView convertPoint: [theEvent locationInWindow] fromView: nil]; if (NSMouseInRect(point, textRect, isFlipped)) { return NO; } else if (NSMouseInRect(point, buttonRect, isFlipped)) { NSEvent *e = theEvent; BOOL isMouseUp = NO; NSUInteger eventMask = NSLeftMouseDownMask | NSLeftMouseUpMask | NSMouseMovedMask | NSLeftMouseDraggedMask | NSOtherMouseDraggedMask | NSRightMouseDraggedMask; NSPoint location; while (isMouseUp == NO) // Loop until mouse goes up { location = [controlView convertPoint: [e locationInWindow] fromView: nil]; // Ask the cell to track the mouse only when the mouse is within the cell if (NSMouseInRect(location, buttonRect, isFlipped)) { [_buttonCell setHighlighted: YES]; [controlView setNeedsDisplayInRect: cellFrame]; result = [_buttonCell trackMouse: e inRect: buttonRect ofView: controlView untilMouseUp: [NSButtonCell prefersTrackingUntilMouseUp]]; isMouseUp = result; [_buttonCell setHighlighted: NO]; [controlView setNeedsDisplayInRect: cellFrame]; } if (isMouseUp == NO) { e = [NSApp nextEventMatchingMask: eventMask untilDate: [NSDate distantFuture] inMode: NSEventTrackingRunLoopMode dequeue: YES]; if ([e type] == NSLeftMouseUp) isMouseUp = YES; } } if (flag) { return YES; } else { return NO; } } return NO; // Pathological case, normally never happens } - (void) resetCursorRect: (NSRect)cellFrame inView: (NSView *)controlView { [super resetCursorRect: textCellFrameFromRect(cellFrame) inView: controlView]; } - (void) setEnabled: (BOOL)flag { [_buttonCell setEnabled: flag]; [super setEnabled: flag]; } // NSCoding /** * Encodes the combo box cell using encoder. take note that when it * uses a data source, the data source is conditionally encoded. */ - (void) encodeWithCoder: (NSCoder *)coder { [super encodeWithCoder: coder]; if ([coder allowsKeyedCoding]) { [coder encodeBool: [self hasVerticalScroller] forKey: @"NSHasVerticalScroller"]; [coder encodeInt: [self numberOfVisibleItems] forKey: @"NSVisibleItemCount"]; [coder encodeBool: [self completes] forKey: @"NSCompletes"]; [coder encodeDouble: _intercellSpacing.width forKey: @"NSIntercellSpacingWidth"]; [coder encodeDouble: _intercellSpacing.height forKey: @"NSIntercellSpacingHeight"]; [coder encodeDouble: [self itemHeight] forKey: @"NSRowHeight"]; [coder encodeBool: [self usesDataSource] forKey: @"NSUsesDataSource"]; [coder encodeObject: [self dataSource] forKey: @"NSDataSource"]; [coder encodeObject: _popUpList forKey: @"NSPopUpListData"]; } else { [coder encodeValueOfObjCType: @encode(id) at: &_popUpList]; [coder encodeValueOfObjCType: @encode(BOOL) at: &_usesDataSource]; [coder encodeValueOfObjCType: @encode(BOOL) at: &_hasVerticalScroller]; [coder encodeValueOfObjCType: @encode(BOOL) at: &_completes]; [coder encodeValueOfObjCType: @encode(BOOL) at: &_usesDataSource]; [coder encodeValueOfObjCType: @encode(int) at: &_visibleItems]; [coder encodeValueOfObjCType: @encode(NSSize) at: &_intercellSpacing]; [coder encodeValueOfObjCType: @encode(float) at: &_itemHeight]; [coder encodeValueOfObjCType: @encode(int) at: &_selectedItem]; if (_usesDataSource == YES) [coder encodeConditionalObject: _dataSource]; } } /** * Initializes the combo box cell with data linked to decoder. Take * note that when the decoded instance uses a data source, * initWithCoder: decodes the data source. * Finally, returns thr initialized object. */ - (id) initWithCoder: (NSCoder *)aDecoder { self = [super initWithCoder: aDecoder]; if (nil == self) return nil; if ([aDecoder allowsKeyedCoding]) { //id delegate = [aDecoder decodeObjectForKey: @"NSDelegate"]; //id table = [aDecoder decodeObjectForKey: @"NSTableView"]; if ([aDecoder containsValueForKey: @"NSHasVerticalScroller"]) { [self setHasVerticalScroller: [aDecoder decodeBoolForKey: @"NSHasVerticalScroller"]]; } if ([aDecoder containsValueForKey: @"NSVisibleItemCount"]) { [self setNumberOfVisibleItems: [aDecoder decodeIntForKey: @"NSVisibleItemCount"]]; } if ([aDecoder containsValueForKey: @"NSCompletes"]) { [self setCompletes: [aDecoder decodeBoolForKey: @"NSCompletes"]]; } if ([aDecoder containsValueForKey: @"NSIntercellSpacingWidth"]) { _intercellSpacing.width = [aDecoder decodeDoubleForKey: @"NSIntercellSpacingWidth"]; } if ([aDecoder containsValueForKey: @"NSIntercellSpacingHeight"]) { _intercellSpacing.height = [aDecoder decodeDoubleForKey: @"NSIntercellSpacingHeight"]; } if ([aDecoder containsValueForKey: @"NSRowHeight"]) { [self setItemHeight: [aDecoder decodeDoubleForKey: @"NSRowHeight"]]; } if ([aDecoder containsValueForKey: @"NSUsesDataSource"]) { [self setUsesDataSource: [aDecoder decodeBoolForKey: @"NSUsesDataSource"]]; } if ([aDecoder containsValueForKey: @"NSDataSource"]) { [self setDataSource: [aDecoder decodeObjectForKey: @"NSDataSource"]]; } if ([aDecoder containsValueForKey: @"NSPopUpListData"]) { ASSIGN(_popUpList, [aDecoder decodeObjectForKey: @"NSPopUpListData"]); } } else { BOOL dummy; if ([aDecoder versionForClassName: @"NSComboBoxCell"] < 2) { // In previous version we decode _buttonCell, we just discard the decoded value here id previouslyEncodedButton; [aDecoder decodeValueOfObjCType: @encode(id) at: &previouslyEncodedButton]; } [aDecoder decodeValueOfObjCType: @encode(id) at: &_popUpList]; RETAIN(_popUpList); [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_usesDataSource]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_hasVerticalScroller]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_completes]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &dummy]; [aDecoder decodeValueOfObjCType: @encode(int) at: &_visibleItems]; [aDecoder decodeValueOfObjCType: @encode(NSSize) at: &_intercellSpacing]; [aDecoder decodeValueOfObjCType: @encode(float) at: &_itemHeight]; [aDecoder decodeValueOfObjCType: @encode(int) at: &_selectedItem]; if (_usesDataSource == YES) [self setDataSource: [aDecoder decodeObject]]; } [self _loadButtonCell]; return self; } - (void) selectWithFrame: (NSRect)aRect inView: (NSView *)controlView editor: (NSText *)textObj delegate: (id)anObject start: (NSInteger)selStart length: (NSInteger)selLength { [super selectWithFrame: textCellFrameFromRect(aRect) inView: controlView editor: textObj delegate: anObject start: selStart length: selLength]; [nc addObserver: self selector: @selector(textDidChange:) name: NSTextDidChangeNotification object: textObj]; [nc addObserver: self selector: @selector(textViewDidChangeSelection:) name: NSTextViewDidChangeSelectionNotification object: textObj]; // This method is called when the cell obtains the focus; // don't know why the next method editWithFrame: is not called } - (void) editWithFrame: (NSRect)frame inView: (NSView *)controlView editor: (NSText *)textObj delegate: (id)delegate event: (NSEvent *)theEvent { [super editWithFrame: textCellFrameFromRect(frame) inView: controlView editor: textObj delegate: delegate event: theEvent]; /* [nc addObserver: self selector: @selector(textDidChange:) name: NSTextDidChangeNotification object: textObj]; [nc addObserver: self selector: @selector(textViewDidChangeSelection:) name: NSTextViewDidChangeSelectionNotification object: textObj]; */ } - (void) endEditing: (NSText *)editor { /* Close the pop up if it is still open. This may happen, e.g., when the user presses the Tab key to shift focus to a different cell or view. */ if (_popup) [_popup onWindowEdited: nil]; [super endEditing: editor]; [nc removeObserver: self name: NSTextDidChangeNotification object: editor]; [nc removeObserver: self name: NSTextViewDidChangeSelectionNotification object: editor]; } - (void) textViewDidChangeSelection: (NSNotification *)notification { _prevSelectedRange = [[[notification userInfo] objectForKey: @"NSOldSelectedCharacterRange"] rangeValue]; } - (void) textDidChange: (NSNotification *)notification { NSText *textObject = [notification object]; if ([self completes]) { NSString *myString = [[textObject string] copy]; NSString *more; NSUInteger myStringLength = [myString length]; NSUInteger location, length; NSRange selectedRange = [textObject selectedRange]; if (myStringLength != 0 && selectedRange.location == myStringLength && _prevSelectedRange.location < selectedRange.location) { more = [self completedString: myString]; if ((more != nil) && [more isEqualToString: myString] == NO) { [textObject setString: more]; location = myStringLength; length = [more length] - location; [textObject setSelectedRange: NSMakeRange(location, length)]; [textObject scrollRangeToVisible: NSMakeRange(location, length)]; } } RELEASE(myString); } } @end @implementation NSComboBoxCell (GNUstepPrivate) - (NSString *) _stringValueAtIndex: (NSInteger)index { if (_usesDataSource == NO) { return [[self itemObjectValueAtIndex: index] description]; } else { if (_dataSource == nil) { NSLog(@"%@: No data source currently specified", self); return nil; } else if ([_dataSource respondsToSelector: @selector(comboBox:objectValueForItemAtIndex:)]) { return [[_dataSource comboBox: (NSComboBox *)[self controlView] objectValueForItemAtIndex: index] description]; } else if ([_dataSource respondsToSelector: @selector(comboBoxCell:objectValueForItemAtIndex:)]) { return [[_dataSource comboBoxCell: self objectValueForItemAtIndex: index] description]; } } return nil; } - (void) _performClickWithFrame: (NSRect)cellFrame inView: (NSView *)controlView { NSWindow *cvWindow = [controlView window]; NSRect buttonRect = buttonCellFrameFromRect(cellFrame); _control_view = controlView; [controlView lockFocus]; [_buttonCell highlight: YES withFrame: buttonRect inView: controlView]; [controlView unlockFocus]; [cvWindow flushWindow]; [self _didClickWithinButton: self]; [controlView lockFocus]; [_buttonCell highlight: NO withFrame: buttonRect inView: controlView]; [controlView unlockFocus]; [cvWindow flushWindow]; } - (void) _didClickWithinButton: (id)sender { NSView *controlView = [self controlView]; if ((_cell.is_disabled) || (controlView == nil)) return; [nc postNotificationName: NSComboBoxWillPopUpNotification object: controlView userInfo: nil]; _popup = [self _popUp]; [_popup popUpForComboBoxCell: self]; _popup = nil; [nc postNotificationName: NSComboBoxWillDismissNotification object: controlView userInfo: nil]; } - (BOOL) _isWantedEvent: (NSEvent *)event { NSPoint loc; NSWindow *window = [event window]; NSView *controlView = [self controlView]; if (window == [[self controlView] window]) { loc = [event locationInWindow]; loc = [controlView convertPoint: loc fromView: nil]; return NSMouseInRect(loc, [self _textCellFrame], [controlView isFlipped]); } else { return NO; } } - (GSComboWindow *) _popUp { return [GSComboWindow defaultPopUp]; } - (NSRect) _textCellFrame { return textCellFrameFromRect(_lastValidFrame); } - (void) _setSelectedItem: (NSInteger)index { _selectedItem = index; } - (void) _loadButtonCell { _buttonCell = [[NSButtonCell alloc] initImageCell: [NSImage imageNamed: @"NSComboArrow"]]; [_buttonCell setImagePosition: NSImageOnly]; [_buttonCell setButtonType: NSMomentaryPushButton]; [_buttonCell setHighlightsBy: NSPushInCellMask]; [_buttonCell setBordered: YES]; [_buttonCell setTarget: self]; [_buttonCell setAction: @selector(_didClickWithinButton:)]; } - (void) _selectCompleted { NSString *more; NSUInteger index = NSNotFound; more = [self completedString: [self stringValue]]; if (_usesDataSource) { if (_dataSource == nil) { NSLog(@"%@: No data source currently specified", self); } else { if ([_dataSource respondsToSelector: @selector(comboBoxCell:indexOfItemWithStringValue:)]) { index = [_dataSource comboBoxCell: self indexOfItemWithStringValue: more]; } } } else { index = [[self objectValues] indexOfObject: more]; } if (index != NSNotFound) { [self _setSelectedItem: index]; } // Otherwise keep old selection } @end gnustep-gui-0.24.0/Source/NSGlyphGenerator.m0000664000076500007650000001774311352624326020573 0ustar brains99brains99/* NSGlyphGenerator.m Copyright (C) 2008 Free Software Foundation, Inc. Author: Fred Kiefer Date: April 2008 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import "AppKit/NSAttributedString.h" #import "AppKit/NSFont.h" #import "AppKit/NSGlyphGenerator.h" /* just for NSAttachmentCharacter */ #import "AppKit/NSTextAttachment.h" #import "GNUstepGUI/GSFontInfo.h" static NSGlyphGenerator* instance; @interface NSGlyphGenerator (Private) - (NSFont *) fontForCharactersWithAttributes: (NSDictionary *)attributes; @end @implementation NSGlyphGenerator + (id) sharedGlyphGenerator { if (!instance) instance = [[NSGlyphGenerator alloc] init]; return instance; } // Send a run of glyphs where each glyph corresponds to one character. #define SEND_GLYPHS() \ { \ NSUInteger length; \ \ if ((length = g - glyphs)) \ { \ [storage insertGlyphs: glyphs \ length: length \ forStartingGlyphAtIndex: *glyph \ characterIndex: *index]; \ *index += i - cstart + 1; \ *glyph += length; \ g = glyphs; \ cstart = i + 1; \ } \ } /* This is a fairly simple implementation. It will use "ff", "fl", "fi", "ffl", and "ffi" ligatures if available. TODO: how should words like "pfffffffffff" be handled? 0066 'f' 0069 'i' 006c 'l' fb00 'ff' fb01 'fi' fb02 'fl' fb03 'ffi' fb04 'ffl' */ - (void) generateGlyphsForGlyphStorage: (id )storage desiredNumberOfCharacters: (NSUInteger)num glyphIndex: (NSUInteger*)glyph characterIndex: (NSUInteger*)index { // Try to get enough space for all glyphs NSGlyph glyphs[2 * num]; NSGlyph *g; NSGlyph gl; NSAttributedString *attrstr = [storage attributedString]; GSFontInfo *fi; int i; unichar buf[num]; unsigned int cstart = 0; NSRange maxRange = NSMakeRange(*index, num); NSRange curRange; NSDictionary *attributes; NSNumber *n; int ligature; BOOL surr; NSCharacterSet *cs = [NSCharacterSet controlCharacterSet]; SEL cim_sel = @selector(characterIsMember:); BOOL (*characterIsMember)(id, SEL, unichar) = (BOOL(*)(id, SEL, unichar)) [cs methodForSelector: cim_sel]; SEL gfc_sel = @selector(glyphForCharacter:); NSGlyph (*glyphForCharacter)(id, SEL, unichar); NSGlyph fallback = NSNullGlyph; [[attrstr string] getCharacters: buf range: maxRange]; attributes = [attrstr attributesAtIndex: *index longestEffectiveRange: &curRange inRange: maxRange]; fi = [[self fontForCharactersWithAttributes: attributes] fontInfo]; if (!fi) { [NSException raise: NSGenericException format: @"Glyph generation with no font."]; return; } glyphForCharacter = (NSGlyph(*)(id, SEL, unichar)) [fi methodForSelector: gfc_sel]; n = [attributes objectForKey: NSLigatureAttributeName]; if (n) ligature = [n intValue]; else ligature = 1; g = glyphs; for (i = 0; i < num; i++) { unsigned int ch, ch2; ch = buf[i]; if (characterIsMember(cs, cim_sel, ch)) { *g = NSControlGlyph; g++; continue; } if (ch == NSAttachmentCharacter) { *g = GSAttachmentGlyph; g++; continue; } // Simple ligature processing if ((ligature >= 1) && (i + 1 < num)) { ch2 = buf[i + 1]; if (ch == 'f') { if ((i + 2 < num) && (ch2 == 'f')) { // ffl if ((buf[i + 2] == 'l') && (NSNullGlyph != (gl = glyphForCharacter(fi, gfc_sel, 0xfb04)))) { *g = gl; g++; i += 2; SEND_GLYPHS(); continue; } // ffi if ((buf[i + 2] == 'i') && (NSNullGlyph != (gl = glyphForCharacter(fi, gfc_sel, 0xfb03)))) { *g = gl; g++; i += 2; SEND_GLYPHS(); continue; } } // ff if ((ch2 == 'f') && (NSNullGlyph != (gl = glyphForCharacter(fi, gfc_sel, 0xfb00)))) { *g = gl; g++; i++; SEND_GLYPHS(); continue; } // fi if ((ch2 == 'i') && (NSNullGlyph != (gl = glyphForCharacter(fi, gfc_sel, 0xfb01)))) { *g = gl; g++; i++; SEND_GLYPHS(); continue; } // fl if ((ch2 == 'l') && (NSNullGlyph != (gl = glyphForCharacter(fi, gfc_sel, 0xfb02)))) { *g = gl; g++; i++; SEND_GLYPHS(); continue; } } } surr = NO; // Check for surrogate pairs if (ch >= 0xd800 && ch <= 0xdfff) { if (ch >= 0xd800 && ch < 0xdc00 && (i + 1 < num) && (ch2 = buf[i + 1]) >= 0xdc00 && ch2 <= 0xdfff) { ch = ((ch & 0x3ff) << 10) + (ch2 & 0x3ff) + 0x10000; i++; surr = YES; } else { ch = 0xfffd; } } gl = glyphForCharacter(fi, gfc_sel, ch); if (gl != NSNullGlyph) { *g = gl; g++; if (surr) SEND_GLYPHS(); continue; } if (ch < 0x10000) { unichar *decomp; decomp = uni_is_decomp(ch); if (decomp) { for (; *decomp; decomp++) { gl = glyphForCharacter(fi, gfc_sel, *decomp); if (gl == NSNullGlyph) { break; } *g = gl; g++; SEND_GLYPHS(); } continue; } } // No glyph found add fallback if (fallback == NSNullGlyph) { // FIXME: Find a suitable fallback glyph unichar uc = '?'; fallback = glyphForCharacter(fi, gfc_sel, uc); } *g = fallback; g++; // On a NSNullGLyph, send all previous glyphs SEND_GLYPHS(); } // Send all remaining glyphs SEND_GLYPHS(); } @end @implementation NSGlyphGenerator (Private) - (NSFont *) fontForCharactersWithAttributes: (NSDictionary *)attributes { NSFont *f = [attributes valueForKey: NSFontAttributeName]; if (!f) f = [NSFont userFontOfSize: 0]; //f = [storage substituteFontForFont: f]; return f; } @end gnustep-gui-0.24.0/Source/NSBitmapImageRep+JPEG.m0000664000076500007650000004642112250406501021172 0ustar brains99brains99/* NSBitmapImageRep+JPEG.m Methods for reading jpeg images Copyright (C) 2003-2010 Free Software Foundation, Inc. Written by: Stefan Kleine Stegemann Date: Nov 2003 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import #import #import #import #import "AppKit/NSGraphics.h" #import "NSBitmapImageRep+JPEG.h" #import "GSGuiPrivate.h" #if HAVE_LIBJPEG #include #if defined(__MINGW32__) /* Hack so that INT32 is not redefined in jmorecfg.h. MingW defines this as well in basetsd.h */ #ifndef XMD_H #define XMD_H #endif /* And another so that boolean is not redefined in jmorecfg.h. */ #ifndef HAVE_BOOLEAN #define HAVE_BOOLEAN /* This MUST match the jpeg definition of boolean */ typedef int jpeg_boolean; #define boolean jpeg_boolean #endif #endif // __MINGW32__ #include #include /* ----------------------------------------------------------- The following functions are for interacting with the jpeg library ----------------------------------------------------------- */ /* A custom error manager for the jpeg library * that 'inherits' from libjpeg's standard * error manager. */ struct gs_jpeg_error_mgr { struct jpeg_error_mgr parent; /* marks where to return after an error (instead of simply exiting) */ jmp_buf setjmpBuffer; /* a pointer to the last error message, nil if no error occured. if present, string is autoreleased. */ NSString *error; }; typedef struct gs_jpeg_error_mgr *gs_jpeg_error_mgr_ptr; /* Print the last jpeg library error and returns * the control to the caller of the libary. * libjpegs default error handling would exit * after printing the error. */ static void gs_jpeg_error_exit(j_common_ptr cinfo) { gs_jpeg_error_mgr_ptr myerr = (gs_jpeg_error_mgr_ptr)cinfo->err; (*cinfo->err->output_message)(cinfo); /* jump back to the caller of the library */ longjmp(myerr->setjmpBuffer, 1); } /* Save the error message in error. */ static void gs_jpeg_output_message(j_common_ptr cinfo) { char msgBuffer[JMSG_LENGTH_MAX]; gs_jpeg_error_mgr_ptr myerr = (gs_jpeg_error_mgr_ptr)cinfo->err; (*cinfo->err->format_message)(cinfo, msgBuffer); myerr->error = [NSString stringWithCString: msgBuffer]; } /* Initialize our error manager */ static void gs_jpeg_error_mgr_init(gs_jpeg_error_mgr_ptr errMgr) { errMgr->error = nil; } /* ------------------------------------------------------------------*/ /* A custom data source manager that allows the jpeg library * to read it's data from memory. It 'inherits' from the * default jpeg source manager. */ typedef struct { struct jpeg_source_mgr parent; /* the data to be passed to the library functions */ const unsigned char *data; unsigned int length; } gs_jpeg_source_mgr; typedef gs_jpeg_source_mgr *gs_jpeg_source_ptr; static void gs_init_source(j_decompress_ptr cinfo) { /* nothing to do here (so far) */ } static boolean gs_fill_input_buffer(j_decompress_ptr cinfo) { gs_jpeg_source_ptr src = (gs_jpeg_source_ptr)cinfo->src; /* we make all data available at once */ if (src->length == 0) { ERREXIT(cinfo, JERR_INPUT_EMPTY); } src->parent.next_input_byte = src->data; src->parent.bytes_in_buffer = src->length; return TRUE; } static void gs_skip_input_data(j_decompress_ptr cinfo, long numBytes) { gs_jpeg_source_ptr src = (gs_jpeg_source_ptr)cinfo->src; if (numBytes > 0) { src->parent.next_input_byte += numBytes; src->parent.bytes_in_buffer -= numBytes; } } static void gs_term_source(j_decompress_ptr cinfo) { /* nothing to do here */ } /* Prepare a decompression object for input from memory. The * caller is responsible for providing and releasing the * data. After decompression is done, gs_jpeg_memory_src_destroy * has to be called. */ static void gs_jpeg_memory_src_create(j_decompress_ptr cinfo, NSData *data) { gs_jpeg_source_ptr src; cinfo->src = (struct jpeg_source_mgr *)malloc(sizeof(gs_jpeg_source_mgr)); src = (gs_jpeg_source_ptr) cinfo->src; src->parent.init_source = gs_init_source; src->parent.fill_input_buffer = gs_fill_input_buffer; src->parent.skip_input_data = gs_skip_input_data; src->parent.resync_to_restart = jpeg_resync_to_restart; /* use default */ src->parent.term_source = gs_term_source; src->parent.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */ src->parent.next_input_byte = NULL; /* until buffer loaded */ src->data = (const unsigned char *)[data bytes]; src->length = [data length]; } /* Destroy the source manager of the jpeg decompression object. */ static void gs_jpeg_memory_src_destroy(j_decompress_ptr cinfo) { gs_jpeg_source_ptr src = (gs_jpeg_source_ptr)cinfo->src; free(src); // does not free the data cinfo->src = NULL; } /* ------------------------------------------------------------------*/ /* * A custom destination manager. */ typedef struct { struct jpeg_destination_mgr pub; // public fields unsigned char* buffer; unsigned char* data; NSData** finalData; int length; } gs_jpeg_destination_mgr; typedef gs_jpeg_destination_mgr * gs_jpeg_dest_ptr; /* Initialize destination. This is called by jpeg_start_compress() before any data is actually written. It must initialize next_output_byte and free_in_buffer. free_in_buffer must be initialized to a positive value. */ static void gs_init_destination (j_compress_ptr cinfo) { //NSLog (@"gs_init_destination"); gs_jpeg_dest_ptr dest = (gs_jpeg_dest_ptr) cinfo->dest; // allocate the output image int imageSize = cinfo->image_width * cinfo->image_height; dest->buffer = (void*) calloc ((imageSize * cinfo->input_components), sizeof(unsigned char)); dest->data = (void*) calloc ((imageSize * cinfo->input_components), sizeof(unsigned char)); dest->pub.next_output_byte = dest->buffer; dest->pub.free_in_buffer = imageSize * cinfo->input_components; dest->length = 0; } /* This is called whenever the buffer has filled (free_in_buffer reaches zero). In typical applications, it should write out the *entire* buffer (use the saved start address and buffer length; ignore the current state of next_output_byte and free_in_buffer). Then reset the pointer & count to the start of the buffer, and return TRUE indicating that the buffer has been dumped. free_in_buffer must be set to a positive value when TRUE is returned. A FALSE return should only be used when I/O suspension is desired (this operating mode is discussed in the next section). */ static boolean gs_empty_output_buffer (j_compress_ptr cinfo) { //NSLog (@"gs_empty_output_buffer..."); gs_jpeg_dest_ptr dest = (gs_jpeg_dest_ptr) cinfo->dest; //NSLog (@"length added (%d)", dest->length); int imageSize = cinfo->image_width * cinfo->image_height; int bufSize = imageSize * cinfo->input_components; int i; for (i = 0; i < bufSize; i++) { dest->data [dest->length + i] = dest->buffer [i]; } dest->length = dest->length + bufSize; dest->pub.next_output_byte = dest->buffer; dest->pub.free_in_buffer = imageSize * cinfo->input_components; return TRUE; } /* Terminate destination --- called by jpeg_finish_compress() after all data has been written. In most applications, this must flush any data remaining in the buffer. Use either next_output_byte or free_in_buffer to determine how much data is in the buffer. */ static void gs_term_destination (j_compress_ptr cinfo) { //NSLog (@"gs_term_destination"); gs_jpeg_dest_ptr dest = (gs_jpeg_dest_ptr) cinfo->dest; int imageSize = cinfo->image_width * cinfo->image_height; int bufSize = imageSize * cinfo->input_components; int i; for (i = 0; i < bufSize; i++) { dest->data [dest->length + i] = dest->buffer [i]; } dest->length = dest->length + bufSize; *dest->finalData = [[NSData alloc] initWithBytes: dest->data length: (dest->length) - dest->pub.free_in_buffer]; } static void gs_jpeg_memory_dest_create (j_compress_ptr cinfo, NSData** data) { gs_jpeg_dest_ptr dest; cinfo->dest = (struct jpeg_destination_mgr*) malloc (sizeof (gs_jpeg_destination_mgr)); dest = (gs_jpeg_dest_ptr) cinfo->dest; dest->pub.init_destination = gs_init_destination; dest->pub.empty_output_buffer = gs_empty_output_buffer; dest->pub.term_destination = gs_term_destination; dest->finalData = data; } static void gs_jpeg_memory_dest_destroy (j_compress_ptr cinfo) { gs_jpeg_dest_ptr dest = (gs_jpeg_dest_ptr) cinfo->dest; free (dest->buffer); free (dest->data); free (dest); cinfo->dest = NULL; } /* ----------------------------------------------------------- The jpeg loading part of NSBitmapImageRep ----------------------------------------------------------- */ @implementation NSBitmapImageRep (JPEGReading) /* Return YES if this looks like a JPEG. */ + (BOOL) _bitmapIsJPEG: (NSData *)imageData { struct jpeg_decompress_struct cinfo; struct gs_jpeg_error_mgr jerrMgr; memset((void*)&cinfo, 0, sizeof(struct jpeg_decompress_struct)); /* Be sure imageData contains data */ if (![imageData length]) { return NO; } /* Establish the our custom error handler */ gs_jpeg_error_mgr_init(&jerrMgr); cinfo.err = jpeg_std_error(&jerrMgr.parent); jerrMgr.parent.error_exit = gs_jpeg_error_exit; jerrMgr.parent.output_message = gs_jpeg_output_message; // establish return context for error handling if (setjmp(jerrMgr.setjmpBuffer)) { gs_jpeg_memory_src_destroy(&cinfo); jpeg_destroy_decompress(&cinfo); return NO; } /* read the header to see if we have a jpeg */ jpeg_create_decompress(&cinfo); /* Establish our own data source manager */ gs_jpeg_memory_src_create(&cinfo, imageData); jpeg_read_header(&cinfo, TRUE); gs_jpeg_memory_src_destroy(&cinfo); jpeg_destroy_decompress(&cinfo); return YES; } /* Read the jpeg image. Assume it is from a jpeg file and imageData * is not nil. */ - (id) _initBitmapFromJPEG: (NSData *)imageData errorMessage: (NSString **)errorMsg { struct jpeg_decompress_struct cinfo; struct gs_jpeg_error_mgr jerrMgr; JDIMENSION sclcount, samplesPerRow, i, j, rowSize; JSAMPARRAY sclbuffer = NULL; unsigned char *imgbuffer = NULL; BOOL isProgressive; if (!(self = [super init])) return nil; memset((void*)&cinfo, 0, sizeof(struct jpeg_decompress_struct)); /* Establish the our custom error handler */ gs_jpeg_error_mgr_init(&jerrMgr); cinfo.err = jpeg_std_error(&jerrMgr.parent); jerrMgr.parent.error_exit = gs_jpeg_error_exit; jerrMgr.parent.output_message = gs_jpeg_output_message; // establish return context for error handling if (setjmp(jerrMgr.setjmpBuffer)) { /* assign the description of possible occured error to errorMsg */ if (errorMsg) *errorMsg = (jerrMgr.error ? (id)jerrMgr.error : (id)nil); gs_jpeg_memory_src_destroy(&cinfo); jpeg_destroy_decompress(&cinfo); if (imgbuffer) { free(imgbuffer); } RELEASE(self); return nil; } /* jpeg-decompression */ jpeg_create_decompress(&cinfo); /* Establish our own data source manager */ gs_jpeg_memory_src_create(&cinfo, imageData); jpeg_read_header(&cinfo, TRUE); /* we use RGB as target color space; others are not yet supported */ cinfo.out_color_space = JCS_RGB; /* decompress */ jpeg_start_decompress(&cinfo); /* process the decompressed data */ samplesPerRow = cinfo.output_width * cinfo.output_components; rowSize = samplesPerRow * sizeof(unsigned char); NSAssert(sizeof(JSAMPLE) == sizeof(unsigned char), @"unexpected sample size"); sclbuffer = cinfo.mem->alloc_sarray((j_common_ptr)&cinfo, JPOOL_IMAGE, samplesPerRow, cinfo.rec_outbuf_height); /* sclbuffer is freed when cinfo is destroyed */ imgbuffer = NSZoneMalloc([self zone], cinfo.output_height * rowSize); if (!imgbuffer) { NSLog(@"NSBitmapImageRep+JPEG: failed to allocated image buffer"); RELEASE(self); return nil; } i = 0; while (cinfo.output_scanline < cinfo.output_height) { sclcount = jpeg_read_scanlines(&cinfo, sclbuffer, cinfo.rec_outbuf_height); for (j = 0; j < sclcount; j++) { // copy a row to the image buffer memcpy((imgbuffer + (i * rowSize)), *(sclbuffer + (j * rowSize)), rowSize); i++; } } #ifdef GSTEP_PROGRESSIVE_CODEC isProgressive = (cinfo.process == JPROC_PROGRESSIVE); #else isProgressive = cinfo.progressive_mode; #endif /* done */ jpeg_finish_decompress(&cinfo); gs_jpeg_memory_src_destroy(&cinfo); jpeg_destroy_decompress(&cinfo); if (jerrMgr.parent.num_warnings) { NSLog(@"NSBitmapImageRep+JPEG: %ld warnings during jpeg decompression, " @"image may be corrupted", jerrMgr.parent.num_warnings); } // create the imagerep //BITS_IN_JSAMPLE is defined by libjpeg [self initWithBitmapDataPlanes: &imgbuffer pixelsWide: cinfo.output_width pixelsHigh: cinfo.output_height bitsPerSample: BITS_IN_JSAMPLE samplesPerPixel: cinfo.output_components hasAlpha: (cinfo.output_components == 3 ? NO : YES) isPlanar: NO colorSpaceName: NSCalibratedRGBColorSpace bytesPerRow: rowSize bitsPerPixel: BITS_IN_JSAMPLE * cinfo.output_components]; [self setProperty: NSImageProgressive withValue: [NSNumber numberWithBool: isProgressive]]; _imageData = [[NSData alloc] initWithBytesNoCopy: imgbuffer length: (rowSize * cinfo.output_height)]; return self; } /* ----------------------------------------------------------- The jpeg writing part of NSBitmapImageRep ----------------------------------------------------------- */ - (NSData*) _JPEGRepresentationWithProperties: (NSDictionary*) properties errorMessage: (NSString **)errorMsg { NSData *ret; unsigned char *imageSource; int sPP; int width; int height; int row_stride; int quality = 90; NSNumber *qualityNumber = nil; NSNumber *progressiveNumber = nil; NSString *colorSpace = nil; BOOL isRGB; struct jpeg_compress_struct cinfo; struct gs_jpeg_error_mgr jerrMgr; JSAMPROW row_pointer[1]; // pointer to a single row // TODO: handles planar images if ([self isPlanar]) { NSString * em = @"JPEG image rep: Planar Image, not handled yet !"; if (errorMsg != NULL) *errorMsg = em; else NSLog (@"JPEG image rep: Planar Image, not handled yet !"); return nil; } memset((void*)&cinfo, 0, sizeof(struct jpeg_compress_struct)); imageSource = [self bitmapData]; sPP = [self samplesPerPixel]; width = [self size].width; height = [self size].height; row_stride = width * sPP; /* Establish the our custom error handler */ gs_jpeg_error_mgr_init(&jerrMgr); cinfo.err = jpeg_std_error(&jerrMgr.parent); jerrMgr.parent.error_exit = gs_jpeg_error_exit; jerrMgr.parent.output_message = gs_jpeg_output_message; // establish return context for error handling if (setjmp(jerrMgr.setjmpBuffer)) { /* assign the description of possible occured error to errorMsg */ if (errorMsg) *errorMsg = (jerrMgr.error ? (id)jerrMgr.error : (id)nil); gs_jpeg_memory_dest_destroy(&cinfo); jpeg_destroy_compress(&cinfo); return nil; } // initialize libjpeg for compression jpeg_create_compress (&cinfo); // specify the destination for the compressed data.. gs_jpeg_memory_dest_create (&cinfo, &ret); // set parameters colorSpace = [self colorSpaceName]; isRGB = ([colorSpace isEqualToString: NSDeviceRGBColorSpace] || [colorSpace isEqualToString: NSCalibratedRGBColorSpace]); cinfo.image_width = width; cinfo.image_height = height; // note we will strip alpha from RGBA cinfo.input_components = (isRGB && [self hasAlpha])? 3 : sPP; cinfo.in_color_space = JCS_UNKNOWN; if (isRGB) cinfo.in_color_space = JCS_RGB; if (sPP == 1) cinfo.in_color_space = JCS_GRAYSCALE; if ([colorSpace isEqualToString: NSDeviceCMYKColorSpace]) cinfo.in_color_space = JCS_CMYK; if (cinfo.in_color_space == JCS_UNKNOWN) NSLog(@"JPEG image rep: Using unknown color space with unpredictable results"); jpeg_set_defaults (&cinfo); // set quality qualityNumber = [properties objectForKey: NSImageCompressionFactor]; if (qualityNumber != nil) { quality = (int) ((1-[qualityNumber floatValue] / 255.0) * 100.0); } // set progressive mode progressiveNumber = [properties objectForKey: NSImageProgressive]; if (progressiveNumber != nil) { #ifdef GSTEP_PROGRESSIVE_CODEC if ([progressiveNumber boolValue]) cinfo.process = JPROC_PROGRESSIVE; #else cinfo.progressive_mode = [progressiveNumber boolValue]; #endif } // compress the image jpeg_set_quality (&cinfo, quality, TRUE); jpeg_start_compress (&cinfo, TRUE); if (isRGB && [self hasAlpha]) // strip alpha channel before encoding { unsigned char * RGB, * pRGB, * pRGBA; unsigned int iRGB, iRGBA; RGB = malloc(sizeof(unsigned char)*3*width); while (cinfo.next_scanline < cinfo.image_height) { iRGBA = cinfo.next_scanline * row_stride; pRGBA = &imageSource[iRGBA]; pRGB = RGB; for (iRGB = 0; iRGB < 3*width; iRGB += 3) { memcpy(pRGB, pRGBA, 3); pRGB +=3; pRGBA +=4; } row_pointer[0] = RGB; jpeg_write_scanlines (&cinfo, row_pointer, 1); } free(RGB); } else // no alpha channel { while (cinfo.next_scanline < cinfo.image_height) { int index = cinfo.next_scanline * row_stride; row_pointer[0] = &imageSource[index]; jpeg_write_scanlines (&cinfo, row_pointer, 1); } } jpeg_finish_compress(&cinfo); gs_jpeg_memory_dest_destroy (&cinfo); jpeg_destroy_compress(&cinfo); return AUTORELEASE(ret); } @end #else /* !HAVE_LIBJPEG */ @implementation NSBitmapImageRep (JPEGReading) + (BOOL) _bitmapIsJPEG: (NSData *)imageData { return NO; } - (id) _initBitmapFromJPEG: (NSData *)imageData errorMessage: (NSString **)errorMsg { RELEASE(self); return nil; } - (NSData *) _JPEGRepresentationWithProperties: (NSDictionary *) properties errorMessage: (NSString **)errorMsg { return nil; } @end #endif /* !HAVE_LIBJPEG */ gnustep-gui-0.24.0/Source/NSDataLink.m0000664000076500007650000003045611535010660017315 0ustar brains99brains99/** NSDataLink Copyright (C) 1996, 2005 Free Software Foundation, Inc. Author: Gregory John Casamento Date: 2005 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import #import #import #import "AppKit/NSDataLink.h" #import "AppKit/NSDataLinkManager.h" #import "AppKit/NSPasteboard.h" #import "AppKit/NSSavePanel.h" #import "AppKit/NSSelection.h" @implementation NSDataLink // // Class methods // + (void)initialize { if (self == [NSDataLink class]) { // Initial version [self setVersion: 0]; } } // // // Instance methods // // Initializing a Link // - (id)initLinkedToFile:(NSString *)filename { if ((self = [self init]) != nil) { NSData *data = [NSData dataWithBytes: [filename cString] length: [filename cStringLength]]; NSSelection *selection = [NSSelection selectionWithDescriptionData: data]; ASSIGN(sourceSelection, selection); } return self; } - (id)initLinkedToSourceSelection:(NSSelection *)selection managedBy:(NSDataLinkManager *)linkManager supportingTypes:(NSArray *)newTypes { if ((self = [self init]) != nil) { ASSIGN(sourceSelection,selection); ASSIGN(sourceManager,linkManager); ASSIGN(types,newTypes); } return self; } - (id)initWithContentsOfFile:(NSString *)filename { NSData *data = [[NSData alloc] initWithContentsOfFile: filename]; id object = [NSUnarchiver unarchiveObjectWithData: data]; RELEASE(data); RELEASE(self); return RETAIN(object); } - (id)initWithPasteboard:(NSPasteboard *)pasteboard { NSData *data = [pasteboard dataForType: NSDataLinkPboardType]; id object = [NSUnarchiver unarchiveObjectWithData: data]; RELEASE(self); return RETAIN(object); } // // Exporting a Link // - (BOOL)saveLinkIn:(NSString *)directoryName { NSSavePanel *sp; int result; sp = [NSSavePanel savePanel]; [sp setRequiredFileType: NSDataLinkFilenameExtension]; result = [sp runModalForDirectory: directoryName file: @""]; if (result == NSOKButton) { NSFileManager *mgr = [NSFileManager defaultManager]; NSString *path = [sp filename]; if ([mgr fileExistsAtPath: path] == YES) { /* NSSavePanel has already asked if it's ok to replace */ NSString *bPath = [path stringByAppendingString: @"~"]; [mgr removeFileAtPath: bPath handler: nil]; [mgr movePath: path toPath: bPath handler: nil]; } // save it. return [self writeToFile: path]; } return NO; } - (BOOL)writeToFile:(NSString *)filename { NSString *path = filename; if ([[path pathExtension] isEqual: NSDataLinkFilenameExtension] == NO) { path = [filename stringByAppendingPathExtension: NSDataLinkFilenameExtension]; } return [NSArchiver archiveRootObject: self toFile: path]; } - (void)writeToPasteboard:(NSPasteboard *)pasteboard { NSData *data = [NSArchiver archivedDataWithRootObject: self]; [pasteboard setData: data forType: NSDataLinkPboardType]; } // // Information about the Link // - (NSDataLinkDisposition)disposition { return disposition; } - (NSDataLinkNumber)linkNumber { return linkNumber; } - (NSDataLinkManager *)manager { return sourceManager; } // // Information about the Link's Source // - (NSDate *)lastUpdateTime { return lastUpdateTime; } - (BOOL)openSource { return NO; } - (NSString *)sourceApplicationName { return sourceApplicationName; } - (NSString *)sourceFilename { return sourceFilename; } - (NSSelection *)sourceSelection { return sourceSelection; } - (NSArray *)types { return types; } // // Information about the Link's Destination // - (NSString *)destinationApplicationName { return destinationApplicationName; } - (NSString *)destinationFilename { return destinationFilename; } - (NSSelection *)destinationSelection { return destinationSelection; } // // Changing the Link // - (BOOL)break { id srcDelegate = [sourceManager delegate]; id dstDelegate = [destinationManager delegate]; // The spec is quite vague here. I don't know under what // circumstances a link cannot be broken, so this method // always returns YES. if ([srcDelegate respondsToSelector: @selector(dataLinkManager:didBreakLink:)]) { [srcDelegate dataLinkManager: sourceManager didBreakLink: self]; } if ([dstDelegate respondsToSelector: @selector(dataLinkManager:didBreakLink:)]) { [dstDelegate dataLinkManager: destinationManager didBreakLink: self]; } return (_flags.broken = YES); } - (void)noteSourceEdited { _flags.isDirty = YES; if (updateMode != NSUpdateNever) { [sourceManager noteDocumentEdited]; } } - (void)setUpdateMode:(NSDataLinkUpdateMode)mode { updateMode = mode; } - (BOOL)updateDestination { return NO; } - (NSDataLinkUpdateMode)updateMode { return updateMode; } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder*)aCoder { BOOL flag = NO; if ([aCoder allowsKeyedCoding]) { [aCoder encodeInt: linkNumber forKey: @"GSLinkNumber"]; [aCoder encodeInt: disposition forKey: @"GSUpdateMode"]; [aCoder encodeInt: updateMode forKey: @"GSLastUpdateMode"]; [aCoder encodeObject: lastUpdateTime forKey: @"GSLastUpdateTime"]; [aCoder encodeObject: sourceApplicationName forKey: @"GSSourceApplicationName"]; [aCoder encodeObject: sourceFilename forKey: @"GSSourceFilename"]; [aCoder encodeObject: sourceSelection forKey: @"GSSourceSelection"]; [aCoder encodeObject: sourceManager forKey: @"GSSourceManager"]; [aCoder encodeObject: destinationApplicationName forKey: @"GSDestinationApplicationName"]; [aCoder encodeObject: destinationFilename forKey: @"GSDestinationFilename"]; [aCoder encodeObject: destinationSelection forKey: @"GSDestinationSelection"]; [aCoder encodeObject: destinationManager forKey: @"GSDestinationManager"]; [aCoder encodeObject: types forKey: @"GSTypes"]; // flags... flag = _flags.appVerifies; [aCoder encodeBool: flag forKey: @"GSAppVerifies"]; flag = _flags.canUpdateContinuously; [aCoder encodeBool: flag forKey: @"GSCanUpdateContinuously"]; flag = _flags.isDirty; [aCoder encodeBool: flag forKey: @"GSIsDirty"]; flag = _flags.willOpenSource; [aCoder encodeBool: flag forKey: @"GSWillOpenSource"]; flag = _flags.willUpdate; [aCoder encodeBool: flag forKey: @"GSWillUpdate"]; } else { [aCoder encodeValueOfObjCType: @encode(int) at: &linkNumber]; [aCoder encodeValueOfObjCType: @encode(int) at: &disposition]; [aCoder encodeValueOfObjCType: @encode(int) at: &updateMode]; [aCoder encodeValueOfObjCType: @encode(id) at: &lastUpdateTime]; [aCoder encodeValueOfObjCType: @encode(id) at: &sourceApplicationName]; [aCoder encodeValueOfObjCType: @encode(id) at: &sourceFilename]; [aCoder encodeValueOfObjCType: @encode(id) at: &sourceSelection]; [aCoder encodeValueOfObjCType: @encode(id) at: &sourceManager]; [aCoder encodeValueOfObjCType: @encode(id) at: &destinationApplicationName]; [aCoder encodeValueOfObjCType: @encode(id) at: &destinationFilename]; [aCoder encodeValueOfObjCType: @encode(id) at: &destinationSelection]; [aCoder encodeValueOfObjCType: @encode(id) at: &destinationManager]; [aCoder encodeValueOfObjCType: @encode(id) at: &types]; // flags... flag = _flags.appVerifies; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _flags.canUpdateContinuously; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _flags.isDirty; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _flags.willOpenSource; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; flag = _flags.willUpdate; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag]; } } - (id) initWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { id obj; linkNumber = [aCoder decodeIntForKey: @"GSLinkNumber"]; disposition = [aCoder decodeIntForKey: @"GSDisposition"]; updateMode = [aCoder decodeIntForKey: @"GSUpdateMode"]; obj = [aCoder decodeObjectForKey: @"GSSourceManager"]; ASSIGN(sourceManager,obj); obj = [aCoder decodeObjectForKey: @"GSDestinationManager"]; ASSIGN(destinationManager,obj); obj = [aCoder decodeObjectForKey: @"GSLastUpdateTime"]; ASSIGN(lastUpdateTime, obj); obj = [aCoder decodeObjectForKey: @"GSSourceApplicationName"]; ASSIGN(sourceApplicationName,obj); obj = [aCoder decodeObjectForKey: @"GSSourceFilename"]; ASSIGN(sourceFilename,obj); obj = [aCoder decodeObjectForKey: @"GSSourceSelection"]; ASSIGN(sourceSelection,obj); obj = [aCoder decodeObjectForKey: @"GSSourceManager"]; ASSIGN(sourceManager,obj); obj = [aCoder decodeObjectForKey: @"GSDestinationApplicationName"]; ASSIGN(destinationApplicationName,obj); obj = [aCoder decodeObjectForKey: @"GSDestinationFilename"]; ASSIGN(destinationFilename,obj); obj = [aCoder decodeObjectForKey: @"GSDestinationSelection"]; ASSIGN(destinationSelection,obj); obj = [aCoder decodeObjectForKey: @"GSDestinationManager"]; ASSIGN(destinationManager,obj); obj = [aCoder decodeObjectForKey: @"GSTypes"]; ASSIGN(types,obj); // flags... _flags.appVerifies = [aCoder decodeBoolForKey: @"GSAppVerifies"]; _flags.canUpdateContinuously = [aCoder decodeBoolForKey: @"GSCanUpdateContinuously"]; _flags.isDirty = [aCoder decodeBoolForKey: @"GSIsDirty"]; _flags.willOpenSource = [aCoder decodeBoolForKey: @"GSWillOpenSource"]; _flags.willUpdate = [aCoder decodeBoolForKey: @"GSWillUpdate"]; } else { int version = [aCoder versionForClassName: @"NSDataLink"]; if (version == 0) { BOOL flag = NO; [aCoder decodeValueOfObjCType: @encode(int) at: &linkNumber]; [aCoder decodeValueOfObjCType: @encode(int) at: &disposition]; [aCoder decodeValueOfObjCType: @encode(int) at: &updateMode]; [aCoder decodeValueOfObjCType: @encode(id) at: &sourceManager]; [aCoder decodeValueOfObjCType: @encode(id) at: &destinationManager]; [aCoder decodeValueOfObjCType: @encode(id) at: &lastUpdateTime]; [aCoder decodeValueOfObjCType: @encode(id) at: &sourceApplicationName]; [aCoder decodeValueOfObjCType: @encode(id) at: &sourceFilename]; [aCoder decodeValueOfObjCType: @encode(id) at: &sourceSelection]; [aCoder decodeValueOfObjCType: @encode(id) at: &sourceManager]; [aCoder decodeValueOfObjCType: @encode(id) at: &destinationApplicationName]; [aCoder decodeValueOfObjCType: @encode(id) at: &destinationFilename]; [aCoder decodeValueOfObjCType: @encode(id) at: &destinationSelection]; [aCoder decodeValueOfObjCType: @encode(id) at: &destinationManager]; [aCoder decodeValueOfObjCType: @encode(id) at: &types]; // flags... [aCoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _flags.appVerifies = flag; [aCoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _flags.canUpdateContinuously = flag; [aCoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _flags.isDirty = flag; [aCoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _flags.willOpenSource = flag; [aCoder decodeValueOfObjCType: @encode(BOOL) at: &flag]; _flags.willUpdate = flag; } else return nil; } return self; } @end gnustep-gui-0.24.0/Source/GSThemeOpenSavePanels.m0000664000076500007650000000302311534147002021453 0ustar brains99brains99/** GSThemeOpenSavePanels Methods for themes using open and save panels. Copyright (C) 2008 Free Software Foundation, Inc. Author: Gregory Casamento Date: 2010 This file is part of the GNU Objective C User interface library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "AppKit/NSOpenPanel.h" #import "AppKit/NSSavePanel.h" #import "GNUstepGUI/GSTheme.h" @implementation GSTheme (OpenSavePanels) /** * This method returns the open panel class needed by the * native environment. */ - (Class) openPanelClass { return [NSOpenPanel class]; } /** * This method returns the open panel class needed by the * native environment. */ - (Class) savePanelClass { return [NSSavePanel class]; } @end gnustep-gui-0.24.0/Source/NSMovieView.m0000664000076500007650000000641611534147002017537 0ustar brains99brains99/** NSMovie Encapsulate a Quicktime movie Copyright (C) 2003 Free Software Foundation, Inc. Author: Fred Kiefer Date: March 2003 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import "AppKit/NSMovie.h" #import "AppKit/NSMovieView.h" #import "AppKit/NSPasteboard.h" @implementation NSMovieView - (void) setMovie: (NSMovie*)movie { ASSIGN(_movie, movie); } - (NSMovie*) movie { return _movie; } - (void) start: (id)sender { //FIXME } - (void) stop: (id)sender { //FIXME } - (BOOL) isPlaying { //FIXME return NO; } - (void) gotoPosterFrame: (id)sender; { //FIXME } - (void) gotoBeginning: (id)sender; { //FIXME } - (void) gotoEnd: (id)sender; { //FIXME } - (void) stepForward: (id)sender; { //FIXME } - (void) stepBack: (id)sender; { //FIXME } - (void) setRate: (float)rate; { _rate = rate; } - (float) rate { return _rate; } - (void) setVolume: (float)volume { _volume = volume; } - (float) volume { return _volume; } - (void) setMuted: (BOOL)mute { _flags.muted = mute; } - (BOOL) isMuted { return _flags.muted; } - (void) setLoopMode: (NSQTMovieLoopMode)mode { _flags.loopMode = mode; } - (NSQTMovieLoopMode) loopMode { return _flags.loopMode; } - (void) setPlaysSelectionOnly: (BOOL)flag { _flags.plays_selection_only = flag; } - (BOOL) playsSelectionOnly { return _flags.plays_selection_only; } - (void) setPlaysEveryFrame: (BOOL)flag { _flags.plays_every_frame = flag; } - (BOOL) playsEveryFrame { return _flags.plays_every_frame; } - (void) showController: (BOOL)show adjustingSize: (BOOL)adjustSize { //FIXME _flags.is_controller_visible = show; } - (void*) movieController { //FIXME return NULL; } - (BOOL) isControllerVisible { return _flags.is_controller_visible; } - (NSRect) movieRect { return [self bounds]; } - (void) resizeWithMagnification: (float)magnification; { //FIXME } - (NSSize) sizeForMagnification: (float)magnification; { //FIXME return NSMakeSize(0, 0); } - (void) setEditable: (BOOL)editable; { _flags.editable = editable; } - (BOOL) isEditable { return _flags.editable; } - (void) cut: (id)sender { //FIXME } - (void) copy: (id)sender { //FIXME } - (void) paste: (id)sender { //FIXME } - (void) clear: (id)sender { //FIXME } - (void) undo: (id)sender { //FIXME } - (void) selectAll: (id)sender { //FIXME } @end gnustep-gui-0.24.0/Source/NSInputManager.m0000664000076500007650000005556312107776031020235 0ustar brains99brains99/* NSInputManager -*-objc-*- Copyright (C) 2001, 2002 Free Software Foundation, Inc. Author: Nicola Pero Date: December 2001, January 2002, February 2002 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import "AppKit/NSEvent.h" #import "AppKit/NSInputManager.h" #import "AppKit/NSInputServer.h" #import "AppKit/NSText.h" #import "AppKit/NSHelpManager.h" /* For NSBeep () */ #import "AppKit/NSGraphics.h" #import "GSKeyBindingAction.h" #import "GSKeyBindingTable.h" /* A table mapping character names to characters, used to interpret the character names found in KeyBindings dictionaries. */ #define CHARACTER_TABLE_SIZE 78 static struct { NSString *name; unichar character; } character_table[CHARACTER_TABLE_SIZE] = { /* Function keys. */ { @"UpArrow", NSUpArrowFunctionKey }, { @"DownArrow", NSDownArrowFunctionKey }, { @"LeftArrow", NSLeftArrowFunctionKey }, { @"RightArrow", NSRightArrowFunctionKey }, { @"F1", NSF1FunctionKey }, { @"F2", NSF2FunctionKey }, { @"F3", NSF3FunctionKey }, { @"F4", NSF4FunctionKey }, { @"F5", NSF5FunctionKey }, { @"F6", NSF6FunctionKey }, { @"F7", NSF7FunctionKey }, { @"F8", NSF8FunctionKey }, { @"F9", NSF9FunctionKey }, { @"F10", NSF10FunctionKey }, { @"F11", NSF11FunctionKey }, { @"F12", NSF12FunctionKey }, { @"F13", NSF13FunctionKey }, { @"F14", NSF14FunctionKey }, { @"F15", NSF15FunctionKey }, { @"F16", NSF16FunctionKey }, { @"F17", NSF17FunctionKey }, { @"F18", NSF18FunctionKey }, { @"F19", NSF19FunctionKey }, { @"F20", NSF20FunctionKey }, { @"F21", NSF21FunctionKey }, { @"F22", NSF22FunctionKey }, { @"F23", NSF23FunctionKey }, { @"F24", NSF24FunctionKey }, { @"F25", NSF25FunctionKey }, { @"F26", NSF26FunctionKey }, { @"F27", NSF27FunctionKey }, { @"F28", NSF28FunctionKey }, { @"F29", NSF29FunctionKey }, { @"F30", NSF30FunctionKey }, { @"F31", NSF31FunctionKey }, { @"F32", NSF32FunctionKey }, { @"F33", NSF33FunctionKey }, { @"F34", NSF34FunctionKey }, { @"F35", NSF35FunctionKey }, { @"Insert", NSInsertFunctionKey }, { @"Delete", NSDeleteFunctionKey }, { @"Home", NSHomeFunctionKey }, { @"Begin", NSBeginFunctionKey }, { @"End", NSEndFunctionKey }, { @"PageUp", NSPageUpFunctionKey }, { @"PageDown", NSPageDownFunctionKey }, { @"PrintScreen", NSPrintScreenFunctionKey }, { @"ScrollLock", NSScrollLockFunctionKey }, { @"Pause", NSPauseFunctionKey }, { @"SysReq", NSSysReqFunctionKey }, { @"Break", NSBreakFunctionKey }, { @"Reset", NSResetFunctionKey }, { @"Stop", NSStopFunctionKey }, { @"Menu", NSMenuFunctionKey }, { @"User", NSUserFunctionKey }, { @"System", NSSystemFunctionKey }, { @"Print", NSPrintFunctionKey }, { @"ClearLine", NSClearLineFunctionKey }, { @"ClearDisplay", NSClearDisplayFunctionKey }, { @"InsertLine", NSInsertLineFunctionKey }, { @"DeleteLine", NSDeleteLineFunctionKey }, { @"InsertChar", NSInsertCharFunctionKey }, { @"DeleteChar", NSDeleteCharFunctionKey }, { @"Prev", NSPrevFunctionKey }, { @"Next", NSNextFunctionKey }, { @"Select", NSSelectFunctionKey }, { @"Execute", NSExecuteFunctionKey }, { @"Undo", NSUndoFunctionKey }, { @"Redo", NSRedoFunctionKey }, { @"Find", NSFindFunctionKey }, { @"Help", NSHelpFunctionKey }, { @"ModeSwitch", NSModeSwitchFunctionKey }, /* Special characters by name. Useful if you want, for example, to associate some special action to C-Tab or similar evils. */ { @"Backspace", NSDeleteCharacter }, { @"BackTab", NSBackTabCharacter }, { @"Tab", NSTabCharacter }, { @"Enter", NSEnterCharacter }, { @"FormFeed", NSFormFeedCharacter }, { @"CarriageReturn", NSCarriageReturnCharacter } }; static NSInputManager *currentInputManager = nil; @implementation NSInputManager + (NSInputManager *) currentInputManager { if (currentInputManager == nil) { currentInputManager = [[self alloc] initWithName: nil host: nil]; } return currentInputManager; } + (BOOL) parseKey: (NSString *)key intoCharacter: (unichar *)character andModifiers: (unsigned int *)modifiers { int flags = 0; unichar c = 0; /* Parse the key: first break it into segments separated by - */ NSArray *components = [key componentsSeparatedByString: @"-"]; NSString *name; /* Then, parse the modifiers. The modifiers are the components - all of them except the last one! */ int i, count = [components count]; for (i = 0; i < count - 1; i++) { NSString *modifier = [components objectAtIndex: i]; if ([modifier isEqualToString: @"Control"] || [modifier isEqualToString: @"Ctrl"] || [modifier isEqualToString: @"C"]) { flags |= NSControlKeyMask; } else if ([modifier isEqualToString: @"Alternate"] || [modifier isEqualToString: @"Alt"] || [modifier isEqualToString: @"A"] || [modifier isEqualToString: @"Meta"] || [modifier isEqualToString: @"M"]) { flags |= NSAlternateKeyMask; } /* The Shift modifier is only meaningful when used in * conjunction with function keys. 'Shift-LeftArrow' is * meaningful; 'Control-Shift-g' is not - you should use * 'Control-G' instead. */ else if ([modifier isEqualToString: @"Shift"] || [modifier isEqualToString: @"S"]) { flags |= NSShiftKeyMask; } else if ([modifier isEqualToString: @"NumericPad"] || [modifier isEqualToString: @"Numeric"] || [modifier isEqualToString: @"N"]) { flags |= NSNumericPadKeyMask; } else { NSLog (@"NSInputManager - unknown modifier '%@' ignored", modifier); return NO; } } /* Now, parse the actual key. */ name = [components objectAtIndex: (count - 1)]; if ([name isEqualToString: @""]) { /* This happens if '-' was the character. */ c = '-'; } else if ([name length] == 1) { /* A single character, such as 'a'. */ c = [name characterAtIndex: 0]; } else { /* A descriptive string, such as Tab or Home. */ for (i = 0; i < CHARACTER_TABLE_SIZE; i++) { if ([name isEqualToString: (character_table[i]).name]) { c = (character_table[i]).character; flags |= NSFunctionKeyMask; break; } } if (i == CHARACTER_TABLE_SIZE) { NSLog (@"NSInputManager - unknown character '%@' ignored", name); return NO; } } if (character != NULL) { *character = c; } if (modifiers != NULL) { *modifiers = flags; } return YES; } + (NSString *) describeKeyStroke: (unichar)character withModifiers: (unsigned int)modifiers { NSMutableString *description = [NSMutableString new]; int i; if (modifiers & NSCommandKeyMask) { [description appendString: @"Command-"]; } if (modifiers & NSControlKeyMask) { [description appendString: @"Control-"]; } if (modifiers & NSAlternateKeyMask) { [description appendString: @"Alternate-"]; } if (modifiers & NSShiftKeyMask) { [description appendString: @"Shift-"]; } if (modifiers & NSNumericPadKeyMask) { [description appendString: @"NumericPad-"]; } for (i = 0; i < CHARACTER_TABLE_SIZE; i++) { if (character == ((character_table[i]).character)) { [description appendString: character_table[i].name]; break; } } if (i == CHARACTER_TABLE_SIZE) { NSString *c = [NSString stringWithCharacters: &character length: 1]; [description appendString: c]; } return AUTORELEASE(description); } - (void) loadBindingsFromFile: (NSString *)fullPath { NSDictionary *bindings; bindings = [NSDictionary dictionaryWithContentsOfFile: fullPath]; if (bindings == nil) { NSLog (@"Unable to load KeyBindings from file %@", fullPath); } else { [_rootBindingTable loadBindingsFromDictionary: bindings]; } } - (void) loadBindingsWithName: (NSString *)fileName { NSArray *paths; NSEnumerator *enumerator; NSString *libraryPath; NSFileManager *fileManager = [NSFileManager defaultManager]; paths = NSSearchPathForDirectoriesInDomains (NSLibraryDirectory, NSAllDomainsMask, YES); /* paths are in the order - user, network, local, root. Instead we want to load keybindings in the order root, local, network, user - so that user can override root - for this reason we use a reverseObjectEnumerator. */ enumerator = [paths reverseObjectEnumerator]; while ((libraryPath = [enumerator nextObject]) != nil) { NSString *fullPath; fullPath = [[[libraryPath stringByAppendingPathComponent: @"KeyBindings"] stringByAppendingPathComponent: fileName] stringByAppendingPathExtension: @"dict"]; if ([fileManager fileExistsAtPath: fullPath]) { [self loadBindingsFromFile: fullPath]; } } } - (NSInputManager *) initWithName: (NSString *)inputServerName host: (NSString *)hostName { NSUserDefaults *defaults; CREATE_AUTORELEASE_POOL (pool); defaults = [NSUserDefaults standardUserDefaults]; self = [super init]; _rootBindingTable = [GSKeyBindingTable new]; /* Read the abort key from the user defaults. */ { NSString *abortKey = [defaults stringForKey: @"GSAbortKey"]; if (abortKey == nil) { _abortCharacter = 'g'; _abortFlags = NSControlKeyMask; } else if (![NSInputManager parseKey: abortKey intoCharacter: &_abortCharacter andModifiers: &_abortFlags]) { NSLog (@"Could not parse GSAbortKey - using Control-g"); _abortCharacter = 'g'; _abortFlags = NSControlKeyMask; } } /* Read if we should insert Control- keystrokes into the text. This defaults to NO. */ _insertControlKeystrokes = [defaults boolForKey: @"GSInsertControlKeystrokes"]; /* Read the quote key from the user defaults. */ { NSString *quoteKey = [defaults stringForKey: @"GSQuoteKey"]; GSKeyBindingActionQuoteNextKeyStroke *quoteAction; quoteAction = [[GSKeyBindingActionQuoteNextKeyStroke alloc] init]; if (quoteKey == nil) { quoteKey = @"Control-q"; } [_rootBindingTable bindKey: quoteKey toAction: quoteAction]; RELEASE (quoteAction); } /* Normally, when we start up, we load all the keybindings we find in the following files, in this order: $GNUSTEP_SYSTEM_ROOT/Library/KeyBindings/DefaultKeyBindings.dict $GNUSTEP_LOCAL_ROOT/Library/KeyBindings/DefaultKeyBindings.dict $GNUSTEP_NETWORK_ROOT/Library/KeyBindings/DefaultKeyBindings.dict $GNUSTEP_USER_ROOT/Library/KeyBindings/DefaultKeyBindings.dict This gives you a first way of adding your customized keybindings - adding a DefaultKeyBindings.dict to your GNUSTEP_USER_ROOT, and putting additional keybindings in there. This allows you to add new keybindings to the standard ones, or override standard ones with your own. These keybindings are normally used by all your applications (this is why they are in 'DefaultKeyBindings'). You can change this behaviour, by setting the GSKeyBindingsFiles default to something else. The GSKeyBindingsFiles default contains an array of files which is loaded, in that order. Each file is searched first in GNUSTEP_SYSTEM_ROOT, then GNUSTEP_LOCAL_ROOT, the GNUSTEP_NETWORK_ROOT, then GNUSTEP_USER_ROOT. Examples - GSKeyBindingsFiles = (DefaultKeyBindings, NicolaKeyBindings); will first load DefaultKeyBindings.dict (as by default), then NicolaKeyBindings.dict. GSKeyBindingsFiles = (NicolaKeyBindings); will not load DefaultKeyBindings.dict but only NicolaKeyBindings.dict. The default of course is GSKeyBindingsFiles = (DefaultKeyBindings); */ /* First, load the DefaultKeyBindings. */ { NSArray *keyBindingsFiles = [defaults arrayForKey: @"GSKeyBindingsFiles"]; if (keyBindingsFiles == nil) { keyBindingsFiles = [NSArray arrayWithObject: @"DefaultKeyBindings"]; } { Class string = [NSString class]; unsigned int i; for (i = 0; i < [keyBindingsFiles count]; i++) { NSString *filename = [keyBindingsFiles objectAtIndex: i]; if ([filename isKindOfClass: string]) { [self loadBindingsWithName: filename]; } } } } /* Then, load any manually specified keybinding. */ { NSDictionary *keyBindings = [defaults dictionaryForKey: @"GSKeyBindings"]; if ([keyBindings isKindOfClass: [NSDictionary class]]) { [_rootBindingTable loadBindingsFromDictionary: keyBindings]; } } [pool drain]; return self; } - (void) dealloc { TEST_RELEASE (_pendingKeyEvents); RELEASE (_rootBindingTable); [super dealloc]; } - (void) handleKeyboardEvents: (NSArray *)eventArray client: (id)client { NSEvent *theEvent; NSEnumerator *eventEnum = [eventArray objectEnumerator]; /* If the client has changed, reset our internal state before going on. */ if (client != _currentClient) { [self resetInternalState]; } _currentClient = client; while ((theEvent = [eventEnum nextObject]) != nil) { NSString *characters = [theEvent characters]; NSString *unmodifiedCharacters = [theEvent charactersIgnoringModifiers]; unichar character = 0; NSUInteger flags = [theEvent modifierFlags] & (NSShiftKeyMask | NSAlternateKeyMask | NSControlKeyMask | NSNumericPadKeyMask); BOOL isFunctionKey = ([theEvent modifierFlags] & NSFunctionKeyMask) == NSFunctionKeyMask; if ([unmodifiedCharacters length] > 0) { character = [unmodifiedCharacters characterAtIndex: 0]; } if (!_interpretNextKeyStrokeLiterally) { GSKeyBindingAction *action; GSKeyBindingTable *table; BOOL found; unsigned adaptedFlags; /* If the keystroke is a function key, then we need to use * the full modifier flags to compare it against stored * keybindings, so that we can make a difference for example * between Shift-LeftArrow and LeftArrow. But if it's not a * function key, then we should ignore the shift modifier - * for example Control-g is a keystroke, and Control-G is * another one. The shift modifier flag is not used to * match these keystrokes - the fact that it's 'G' rather * than 'g' already contains the fact that it's typed in * with Shift. */ if (!isFunctionKey) { adaptedFlags = flags & (~NSShiftKeyMask); } else { adaptedFlags = flags; } /* Special keybinding recognized in all contexts - abort - normally bound to Control-g. The user is confused and wants to go home. Abort whatever train of thoughts we were following, discarding whatever pending keystrokes we have, and return into default state. */ if (character == _abortCharacter && adaptedFlags == _abortFlags) { [self resetInternalState]; break; } /* Look up the character in the current keybindings table. */ found = [_currentBindingTable lookupKeyStroke: character modifiers: adaptedFlags returningActionIn: &action tableIn: &table]; if (found) { if (action != nil) { /* First reset our internal state - we are done interpreting this keystroke sequence. */ [self resetInternalState]; /* Then perform the action. The action might actually modify our internal state, which is why we reset it before calling the action! (for example, performing the action might cause us to interpret the next keystroke literally). */ [action performActionWithInputManager: self]; break; } else if (table != nil) { /* It's part of a composite multi-stroke keybinding. */ _currentBindingTable = table; [_pendingKeyEvents addObject: theEvent]; break; } /* Else it is as if we didn't find it! */ } /* Ok - the keybinding wasn't found. If we were tracking a multi-stroke keybinding, it means we were on a false track. */ if ([_pendingKeyEvents count] > 0) { NSEvent *e; /* Save the pending events locally in this stack frame. */ NSMutableArray *a = _pendingKeyEvents; RETAIN (a); /* Reset our internal state. */ [self resetInternalState]; /* Take the very first event we received and which we tried to interpret as a key binding, which now we know was the wrong thing to do. */ e = [a objectAtIndex: 0]; /* Interpret it literally, since interpreting it as a keybinding failed. */ _interpretNextKeyStrokeLiterally = YES; [self handleKeyboardEvents: [NSArray arrayWithObject: e] client: client]; /* Now feed the remaining pending key events to ourselves for interpretation - again from scratch. */ [a removeObjectAtIndex: 0]; [a addObject: theEvent]; [self handleKeyboardEvents: a client: client]; RELEASE (a); break; } } /* We couldn't (or shouldn't) find the keybinding ... perform the default action - literally interpreting the keystroke. */ /* If this was a forced literal interpretation, make sure the next one is interpreted normally. */ _interpretNextKeyStrokeLiterally = NO; /* During literal interpretation, function keys are ignored. Trying to insert 'PageUp' literally makes simply no sense. */ if (isFunctionKey) { NSBeep (); break; } /* During literal interpretation, control characters are ignored if GSInsertControlKeystrokes was NO. */ if (_insertControlKeystrokes == NO) { if (flags & NSControlKeyMask) { NSBeep (); break; } } switch (character) { case NSDeleteCharacter: case NSBackspaceCharacter: [self doCommandBySelector: @selector (deleteBackward:)]; break; case '\e': // escape [self doCommandBySelector: @selector (cancelOperation:)]; break; case NSBackTabCharacter: [self doCommandBySelector: @selector (insertBacktab:)]; break; case NSTabCharacter: if (flags & NSShiftKeyMask) { [self doCommandBySelector: @selector (insertBacktab:)]; } else { [self doCommandBySelector: @selector (insertTab:)]; } break; case NSEnterCharacter: case NSFormFeedCharacter: case NSCarriageReturnCharacter: [self doCommandBySelector: @selector (insertNewline:)]; break; case NSHelpFunctionKey: [NSHelpManager setContextHelpModeActive: YES]; break; default: [self insertText: characters]; break; } } } - (void) resetInternalState { _currentBindingTable = _rootBindingTable; ASSIGN (_pendingKeyEvents, [NSMutableArray array]); _interpretNextKeyStrokeLiterally = NO; } - (void) quoteNextKeyStroke { _interpretNextKeyStrokeLiterally = YES; } - (BOOL) handleMouseEvent: (NSEvent *)theMouseEvent { return NO; } - (NSString *) language { return @"English"; } - (NSString *) localizedInputManagerName { return nil; } - (void) markedTextAbandoned: (id)client {} - (void) markedTextSelectionChanged: (NSRange)newSel client: (id)client {} - (BOOL) wantsToDelayTextChangeNotifications { return NO; } - (BOOL) wantsToHandleMouseEvents { return NO; } - (BOOL) wantsToInterpretAllKeystrokes { return NO; } - (void) setMarkedText: (id)aString selectedRange: (NSRange)selRange {} - (BOOL) hasMarkedText { return NO; } - (NSRange) markedRange { return NSMakeRange (NSNotFound, 0); } - (NSRange) selectedRange { return NSMakeRange (NSNotFound, 0); } - (void) unmarkText {} - (NSArray*) validAttributesForMarkedText { return nil; } - (NSAttributedString *) attributedSubstringFromRange: (NSRange)theRange { return nil; } - (NSUInteger) characterIndexForPoint: (NSPoint)thePoint { return 0; } - (NSInteger) conversationIdentifier { return 0; } - (void) doCommandBySelector: (SEL)aSelector { [_currentClient doCommandBySelector: aSelector]; } - (NSRect) firstRectForCharacterRange: (NSRange)theRange { return NSZeroRect; } - (void) insertText: (id)aString { [_currentClient insertText: aString]; } @end gnustep-gui-0.24.0/Source/Functions.m0000664000076500007650000010010712246721336017335 0ustar brains99brains99/* Functions.m Generic Functions for the GNUstep GUI Library. Copyright (C) 1996,1999 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import "GSGuiPrivate.h" #import "AppKit/NSApplication.h" #import "AppKit/NSBitmapImageRep.h" #import "AppKit/NSNibLoading.h" #import "AppKit/NSEvent.h" #import "AppKit/NSGraphicsContext.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSImage.h" #import "AppKit/NSColor.h" #import "AppKit/NSView.h" #import "AppKit/NSWindow.h" #import "AppKit/DPSOperators.h" char **NSArgv = NULL; /* * Main initialization routine for the GNUstep GUI Library Apps */ int NSApplicationMain(int argc, const char **argv) { NSDictionary *infoDict; NSString *mainModelFile; NSString *className; Class appClass; CREATE_AUTORELEASE_POOL(pool); #if defined(LIB_FOUNDATION_LIBRARY) || defined(GS_PASS_ARGUMENTS) extern char **environ; [NSProcessInfo initializeWithArguments: (char**)argv count: argc environment: environ]; #endif infoDict = [[NSBundle mainBundle] infoDictionary]; className = [infoDict objectForKey: @"NSPrincipalClass"]; appClass = NSClassFromString(className); if (appClass == 0) { NSLog(@"Bad application class '%@' specified", className); appClass = [NSApplication class]; } [appClass sharedApplication]; mainModelFile = [infoDict objectForKey: @"NSMainNibFile"]; if (mainModelFile != nil && [mainModelFile isEqual: @""] == NO) { if ([NSBundle loadNibNamed: mainModelFile owner: NSApp] == NO) { NSLog (_(@"Cannot load the main model file '%@'"), mainModelFile); } } RECREATE_AUTORELEASE_POOL(pool); [NSApp run]; DESTROY(NSApp); [pool drain]; return 0; } /* * Color Functions */ /* * Get Information About Color Space and Window Depth */ const NSWindowDepth* NSAvailableWindowDepths(void) { /* * Perhaps this is the only function which * belongs in the backend. It should be possible * to detect which depths the window server is capable * of. */ return (const NSWindowDepth *)_GSWindowDepths; } NSWindowDepth NSBestDepth(NSString *colorSpace, NSInteger bitsPerSample, NSInteger bitsPerPixel, BOOL planar, BOOL *exactMatch) { NSInteger components = NSNumberOfColorComponents(colorSpace); NSInteger index = 0; const NSWindowDepth *depths = NSAvailableWindowDepths(); NSWindowDepth bestDepth = NSDefaultDepth; if (exactMatch != NULL) *exactMatch = NO; if (components == 1) { for (index = 0; depths[index] != 0; index++) { NSWindowDepth depth = depths[index]; if (NSPlanarFromDepth(depth)) { bestDepth = depth; if (NSBitsPerSampleFromDepth(depth) == bitsPerSample) { if (exactMatch != NULL) *exactMatch = YES; } } } } else { for (index = 0; depths[index] != 0; index++) { NSWindowDepth depth = depths[index]; if (!NSPlanarFromDepth(depth)) { bestDepth = depth; if (NSBitsPerSampleFromDepth(depth) == bitsPerSample) { if (exactMatch != NULL) *exactMatch = YES; } } } } return bestDepth; } NSInteger NSBitsPerPixelFromDepth(NSWindowDepth depth) { NSInteger bps = NSBitsPerSampleFromDepth(depth); NSInteger spp = 0; if (depth & _GSRGBBitValue) { spp = 3; } else if (depth & _GSCMYKBitValue) { spp = 4; } else if (depth & _GSGrayBitValue) { spp = 1; } return (spp * bps); } NSInteger NSBitsPerSampleFromDepth(NSWindowDepth depth) { NSWindowDepth bitValue = 0; /* * Test against colorspace bit. * and out the bit to get the bps value. */ if (depth & _GSRGBBitValue) { bitValue = _GSRGBBitValue; } else if (depth & _GSCMYKBitValue) { bitValue = _GSCMYKBitValue; } else if (depth & _GSGrayBitValue) { bitValue = _GSGrayBitValue; } /* * AND against the complement * to extract the bps value. */ return (depth & ~(bitValue)); } NSString* NSColorSpaceFromDepth(NSWindowDepth depth) { NSString *colorSpace = NSCalibratedWhiteColorSpace; /* * Test against each of the possible colorspace bits * and return the corresponding colorspace. */ if (depth == 0) { colorSpace = NSCalibratedBlackColorSpace; } else if (depth & _GSRGBBitValue) { colorSpace = NSCalibratedRGBColorSpace; } else if (depth & _GSCMYKBitValue) { colorSpace = NSDeviceCMYKColorSpace; } else if (depth & _GSGrayBitValue) { colorSpace = NSCalibratedWhiteColorSpace; } else if (depth & _GSNamedBitValue) { colorSpace = NSNamedColorSpace; } else if (depth & _GSCustomBitValue) { colorSpace = NSCustomColorSpace; } return colorSpace; } NSInteger NSNumberOfColorComponents(NSString *colorSpaceName) { NSInteger components = 1; /* * These are the only exceptions to the above. * All other colorspaces have as many bps as bpp. */ if ([colorSpaceName isEqualToString: NSCalibratedRGBColorSpace] || [colorSpaceName isEqualToString: NSDeviceRGBColorSpace]) { components = 3; } else if ([colorSpaceName isEqualToString: NSDeviceCMYKColorSpace]) { components = 4; } return components; } BOOL NSPlanarFromDepth(NSWindowDepth depth) { BOOL planar = NO; /* * Only the grayscale depths are planar. * All others are interleaved. */ if (depth & _GSGrayBitValue) { planar = YES; } return planar; } /* Graphic Ops */ NSColor* NSReadPixel(NSPoint location) { NSLog(@"NSReadPixel not implemented"); return nil; } void NSCopyBitmapFromGState(int srcGstate, NSRect srcRect, NSRect destRect) { NSLog(@"NSCopyBitmapFromGState not implemented"); } void NSCopyBits(NSInteger srcGstate, NSRect srcRect, NSPoint destPoint) { CGFloat x, y, w, h; NSGraphicsContext *ctxt = GSCurrentContext(); x = NSMinX(srcRect); y = NSMinY(srcRect); w = NSWidth(srcRect); h = NSHeight(srcRect); DPScomposite(ctxt, x, y, w, h, srcGstate, destPoint.x, destPoint.y, NSCompositeCopy); } void NSDrawBitmap(NSRect rect, NSInteger pixelsWide, NSInteger pixelsHigh, NSInteger bitsPerSample, NSInteger samplesPerPixel, NSInteger bitsPerPixel, NSInteger bytesPerRow, BOOL isPlanar, BOOL hasAlpha, NSString *colorSpaceName, const unsigned char *const data[5]) { NSBitmapImageRep *bitmap; NSGraphicsContext *ctxt = GSCurrentContext(); bitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes: (unsigned char **)data pixelsWide: pixelsWide pixelsHigh: pixelsHigh bitsPerSample: bitsPerSample samplesPerPixel: samplesPerPixel hasAlpha: hasAlpha isPlanar: isPlanar colorSpaceName: colorSpaceName bytesPerRow: bytesPerRow bitsPerPixel: bitsPerPixel]; [ctxt GSDrawImage: rect : bitmap]; RELEASE(bitmap); } /** * Tiles an image in a rect, starting from the lower-left-hand corner */ static void GSDrawRepeatingImage2D(NSRect aRect, NSImage *image, NSCompositingOperation op, CGFloat fraction, BOOL flipped) { const NSSize imageSize = [image size]; if (imageSize.width <= 0 || imageSize.height <= 0) { return; } [NSGraphicsContext saveGraphicsState]; NSRectClip(aRect); { const NSInteger numHorizontal = ceil(aRect.size.width / imageSize.width); const NSInteger numVertical = ceil(aRect.size.height / imageSize.height); NSInteger x, y; if (numHorizontal > 0 && numVertical > 0) { for (x = 0; x < numHorizontal; x++) { for (y = 0; y < numVertical; y++) { NSRect drawRect; drawRect.size = imageSize; drawRect.origin.x = aRect.origin.x + (x * imageSize.width); drawRect.origin.y = flipped ? (NSMaxY(aRect) - ((y + 1) * imageSize.height)) : (aRect.origin.y + (y * imageSize.height)); [image drawInRect: drawRect fromRect: NSZeroRect operation: op fraction: fraction respectFlipped: YES hints: nil]; } } } } [NSGraphicsContext restoreGraphicsState]; } static void GSDrawRepeatingImage1D(NSRect aRect, NSImage *image, BOOL isVertical, NSCompositingOperation op, CGFloat fraction, BOOL flipped) { const NSSize imageSize = [image size]; if (imageSize.width <= 0 || imageSize.height <= 0) { return; } [NSGraphicsContext saveGraphicsState]; NSRectClip(aRect); { const NSInteger num = isVertical ? ceil(aRect.size.height / imageSize.height) : ceil(aRect.size.width / imageSize.width); NSInteger i; if (num > 0) { for (i = 0; i < num; i++) { NSRect drawRect; if (isVertical) { drawRect.size = NSMakeSize(aRect.size.width, imageSize.height); drawRect.origin = NSMakePoint(aRect.origin.x, flipped ? (NSMaxY(aRect) - ((i + 1) * imageSize.height)) : (aRect.origin.y + (i * imageSize.height))); } else { drawRect.size = NSMakeSize(imageSize.width, aRect.size.height); drawRect.origin = NSMakePoint(aRect.origin.x + (i * imageSize.width), aRect.origin.y); } [image drawInRect: drawRect fromRect: NSZeroRect operation: op fraction: fraction respectFlipped: YES hints: nil]; } } } [NSGraphicsContext restoreGraphicsState]; } void NSDrawThreePartImage(NSRect aRect, NSImage *start, NSImage *middle, NSImage *end, BOOL isVertical, NSCompositingOperation op, CGFloat fraction, BOOL flipped) { NSRect startRect, middleRect, endRect; NSView *focusView = [NSView focusView]; if (nil != focusView) { aRect = [focusView centerScanRect: aRect]; } [NSGraphicsContext saveGraphicsState]; // Protects against the case when the smallest source image is larger than aRect NSRectClip(aRect); if (isVertical) { startRect.size = NSMakeSize(aRect.size.width, [start size].height); endRect.size = NSMakeSize(aRect.size.width, [end size].height); middleRect.size = NSMakeSize(aRect.size.width, MAX(0, aRect.size.height - startRect.size.height - endRect.size.height)); endRect.origin = aRect.origin; middleRect.origin = NSMakePoint(aRect.origin.x, NSMaxY(endRect)); startRect.origin = NSMakePoint(aRect.origin.x, NSMaxY(middleRect)); } else { startRect.size = NSMakeSize([start size].width, aRect.size.height); endRect.size = NSMakeSize([end size].width, aRect.size.height); middleRect.size = NSMakeSize(MAX(0, aRect.size.width - startRect.size.width - endRect.size.width), aRect.size.height); startRect.origin = aRect.origin; middleRect.origin = NSMakePoint(NSMaxX(startRect), aRect.origin.y); endRect.origin = NSMakePoint(NSMaxX(middleRect), aRect.origin.y); } [start drawInRect: startRect fromRect: NSZeroRect operation: op fraction: fraction respectFlipped: YES hints: nil]; GSDrawRepeatingImage1D(middleRect, middle, isVertical, op, fraction, flipped); [end drawInRect: endRect fromRect: NSZeroRect operation: op fraction: fraction respectFlipped: YES hints: nil]; [NSGraphicsContext restoreGraphicsState]; // Restore clipping region } void NSDrawNinePartImage(NSRect aRect, NSImage *topLeft, NSImage *topMiddle, NSImage *topRight, NSImage *centerLeft, NSImage *centerMiddle, NSImage *centerRight, NSImage *bottomLeft, NSImage *bottomMiddle, NSImage *bottomRight, NSCompositingOperation op, CGFloat fraction, BOOL flipped) { NSView *focusView = [NSView focusView]; if (nil != focusView) { aRect = [focusView centerScanRect: aRect]; } [NSGraphicsContext saveGraphicsState]; // Protects against the case when the smallest source image is larger than aRect NSRectClip(aRect); { NSRect topLeftRect; NSRect topMiddleRect; NSRect topRightRect; NSRect centerLeftRect; NSRect centerMiddleRect; NSRect centerRightRect; NSRect bottomLeftRect; NSRect bottomMiddleRect; NSRect bottomRightRect; // These two images are the only sizes we use in addition to aRect topLeftRect.size = [topLeft size]; bottomRightRect.size = [bottomRight size]; // Fill in the rest of the sizes topMiddleRect.size = NSMakeSize(MAX(0, aRect.size.width - topLeftRect.size.width - bottomRightRect.size.width), topLeftRect.size.height); topRightRect.size = NSMakeSize(bottomRightRect.size.width, topLeftRect.size.height); centerLeftRect.size = NSMakeSize(topLeftRect.size.width, MAX(0, aRect.size.height - topLeftRect.size.height - bottomRightRect.size.height)); centerMiddleRect.size = NSMakeSize(topMiddleRect.size.width, centerLeftRect.size.height); centerRightRect.size = NSMakeSize(topRightRect.size.width, centerLeftRect.size.height); bottomLeftRect.size = NSMakeSize(topLeftRect.size.width, bottomRightRect.size.height); bottomMiddleRect.size = NSMakeSize(centerMiddleRect.size.width, bottomRightRect.size.height); // Now fill in the positions if (flipped) { topLeftRect.origin = aRect.origin; topMiddleRect.origin = NSMakePoint(NSMaxX(topLeftRect), aRect.origin.y); topRightRect.origin = NSMakePoint(NSMaxX(aRect) - NSWidth(topRightRect), aRect.origin.y); centerLeftRect.origin = NSMakePoint(aRect.origin.x, NSMaxY(topLeftRect)); centerMiddleRect.origin = NSMakePoint(NSMaxX(topLeftRect), NSMaxY(topLeftRect)); centerRightRect.origin = NSMakePoint(NSMaxX(topMiddleRect), NSMaxY(topMiddleRect)); bottomLeftRect.origin = NSMakePoint(aRect.origin.x, NSMaxY(aRect) - NSHeight(bottomLeftRect)); bottomMiddleRect.origin = NSMakePoint(NSMaxX(centerLeftRect), NSMaxY(centerLeftRect)); bottomRightRect.origin = NSMakePoint(NSMaxX(aRect) - NSWidth(bottomRightRect), NSMaxY(aRect) - NSHeight(bottomRightRect)); } else { bottomLeftRect.origin = aRect.origin; bottomMiddleRect.origin = NSMakePoint(NSMaxX(bottomLeftRect), aRect.origin.y); bottomRightRect.origin = NSMakePoint(NSMaxX(aRect) - NSWidth(bottomRightRect), aRect.origin.y); centerLeftRect.origin = NSMakePoint(aRect.origin.x, NSMaxY(bottomLeftRect)); centerMiddleRect.origin = NSMakePoint(NSMaxX(bottomLeftRect), NSMaxY(bottomLeftRect)); centerRightRect.origin = NSMakePoint(NSMaxX(bottomMiddleRect), NSMaxY(bottomMiddleRect)); topLeftRect.origin = NSMakePoint(aRect.origin.x, NSMaxY(aRect) - NSHeight(topLeftRect)); topMiddleRect.origin = NSMakePoint(NSMaxX(centerLeftRect), NSMaxY(centerLeftRect)); topRightRect.origin = NSMakePoint(NSMaxX(aRect) - NSWidth(topRightRect), NSMaxY(aRect) - NSHeight(topRightRect)); } // Draw the images left-to-right, bottom-to-top [bottomLeft drawInRect: bottomLeftRect fromRect: NSZeroRect operation: op fraction: fraction respectFlipped: YES hints: nil]; GSDrawRepeatingImage2D(bottomMiddleRect, bottomMiddle, op, fraction, flipped); [bottomRight drawInRect: bottomRightRect fromRect: NSZeroRect operation: op fraction: fraction respectFlipped: YES hints: nil]; GSDrawRepeatingImage2D(centerLeftRect, centerLeft, op, fraction, flipped); GSDrawRepeatingImage2D(centerMiddleRect, centerMiddle, op, fraction, flipped); GSDrawRepeatingImage2D(centerRightRect, centerRight, op, fraction, flipped); [topLeft drawInRect: topLeftRect fromRect: NSZeroRect operation: op fraction: fraction respectFlipped: YES hints: nil]; GSDrawRepeatingImage2D(topMiddleRect, topMiddle, op, fraction, flipped); [topRight drawInRect: topRightRect fromRect: NSZeroRect operation: op fraction: fraction respectFlipped: YES hints: nil]; } [NSGraphicsContext restoreGraphicsState]; // Restore clipping region } /* * Rectangle Drawing */ void NSEraseRect(NSRect aRect) { NSGraphicsContext *ctxt = GSCurrentContext(); DPSgsave(ctxt); DPSsetgray(ctxt, NSWhite); NSRectFill(aRect); DPSgrestore(ctxt); } void NSHighlightRect(NSRect aRect) { NSGraphicsContext *ctxt = GSCurrentContext(); DPScompositerect(ctxt, NSMinX(aRect), NSMinY(aRect), NSWidth(aRect), NSHeight(aRect), GSCompositeHighlight); } void NSRectClip(NSRect aRect) { NSGraphicsContext *ctxt = GSCurrentContext(); DPSrectclip(ctxt, NSMinX(aRect), NSMinY(aRect), NSWidth(aRect), NSHeight(aRect)); DPSnewpath(ctxt); } void NSRectClipList(const NSRect *rects, NSInteger count) { NSInteger i; NSRect union_rect; if (count == 0) return; /* The specification is not clear if the union of the rects should produce the new clip rect or if the outline of all rects should be used as clip path. */ union_rect = rects[0]; for (i = 1; i < count; i++) union_rect = NSUnionRect(union_rect, rects[i]); NSRectClip(union_rect); } void NSRectFill(NSRect aRect) { NSGraphicsContext *ctxt = GSCurrentContext(); DPSrectfill(ctxt, NSMinX(aRect), NSMinY(aRect), NSWidth(aRect), NSHeight(aRect)); } void NSRectFillList(const NSRect *rects, NSInteger count) { NSGraphicsContext *ctxt = GSCurrentContext(); GSRectFillList(ctxt, rects, count); } void NSRectFillListWithColors(const NSRect *rects, NSColor **colors, NSInteger count) { NSInteger i; NSGraphicsContext *ctxt = GSCurrentContext(); DPSgsave(ctxt); for (i = 0; i < count; i++) { [colors[i] set]; NSRectFill(rects[i]); } DPSgrestore(ctxt); } void NSRectFillListWithGrays(const NSRect *rects, const CGFloat *grays, NSInteger count) { NSInteger i; NSGraphicsContext *ctxt = GSCurrentContext(); DPSgsave(ctxt); for (i = 0; i < count; i++) { DPSsetgray(ctxt, grays[i]); DPSrectfill(ctxt, NSMinX(rects[i]), NSMinY(rects[i]), NSWidth(rects[i]), NSHeight(rects[i])); } DPSgrestore(ctxt); } void NSRectFillUsingOperation(NSRect aRect, NSCompositingOperation op) { NSGraphicsContext *ctxt = GSCurrentContext(); DPScompositerect(ctxt, NSMinX(aRect), NSMinY(aRect), NSWidth(aRect), NSHeight(aRect), op); } void NSRectFillListUsingOperation(const NSRect *rects, NSInteger count, NSCompositingOperation op) { NSInteger i; for (i = 0; i < count; i++) { NSRectFillUsingOperation(rects[i], op); } } void NSRectFillListWithColorsUsingOperation(const NSRect *rects, NSColor **colors, NSInteger num, NSCompositingOperation op) { NSInteger i; NSGraphicsContext *ctxt = GSCurrentContext(); DPSgsave(ctxt); for (i = 0; i < num; i++) { [colors[i] set]; NSRectFillUsingOperation(rects[i], op); } DPSgrestore(ctxt); } /* Various functions for drawing bordered rectangles. */ void NSDottedFrameRect(const NSRect aRect) { CGFloat dot_dash[] = {1.0, 1.0}; NSGraphicsContext *ctxt = GSCurrentContext(); DPSgsave(ctxt); DPSsetgray(ctxt, NSBlack); DPSsetlinewidth(ctxt, 1.0); // FIXME DPSsetdash(ctxt, dot_dash, 2, 0.0); DPSrectstroke(ctxt, NSMinX(aRect) + 0.5, NSMinY(aRect) + 0.5, NSWidth(aRect) - 1.0, NSHeight(aRect) - 1.0); DPSgrestore(ctxt); } void NSFrameRect(const NSRect aRect) { NSFrameRectWithWidth(aRect, 1.0); } void NSFrameRectWithWidth(const NSRect aRect, CGFloat frameWidth) { NSRectEdge sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge}; NSRect remainder = aRect; NSRect rects[4]; int i; if (frameWidth == 0.0) { NSView *view = [GSCurrentContext() focusView]; NSSize aSize = [view convertSize: NSMakeSize(1.0, 1.0) fromView: nil]; frameWidth = (aSize.width + aSize.height) / 2.0; } for (i = 0; i < 4; i++) { NSDivideRect(remainder, &rects[i], &remainder, frameWidth, sides[i]); } NSRectFillList(rects, 4); } void NSFrameRectWithWidthUsingOperation(NSRect aRect, CGFloat frameWidth, NSCompositingOperation op) { NSRectEdge sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge}; NSRect remainder = aRect; NSRect rects[4]; int i; if (frameWidth == 0.0) { NSView *view = [GSCurrentContext() focusView]; NSSize aSize = [view convertSize: NSMakeSize(1.0, 1.0) fromView: nil]; frameWidth = (aSize.width + aSize.height) / 2.0; } for (i = 0; i < 4; i++) { NSDivideRect(remainder, &rects[i], &remainder, frameWidth, sides[i]); } NSRectFillListUsingOperation(rects, 4, op); } NSRect NSDrawTiledRects(NSRect aRect, const NSRect clipRect, const NSRectEdge *sides, const CGFloat *grays, NSInteger count) { NSInteger i; NSRect slice; NSRect remainder = aRect; NSRect rects[count]; BOOL hasClip = !NSIsEmptyRect(clipRect); if (hasClip && NSIntersectsRect(aRect, clipRect) == NO) return remainder; for (i = 0; i < count; i++) { NSDivideRect(remainder, &slice, &remainder, 1.0, sides[i]); if (hasClip) rects[i] = NSIntersectionRect(slice, clipRect); else rects[i] = slice; } NSRectFillListWithGrays(rects, grays, count); return remainder; } NSRect NSDrawColorTiledRects(NSRect boundsRect, NSRect clipRect, const NSRectEdge *sides, NSColor **colors, NSInteger count) { NSInteger i; NSRect slice; NSRect remainder = boundsRect; NSRect rects[count]; BOOL hasClip = !NSIsEmptyRect(clipRect); if (hasClip && NSIntersectsRect(boundsRect, clipRect) == NO) return remainder; for (i = 0; i < count; i++) { NSDivideRect(remainder, &slice, &remainder, 1.0, sides[i]); if (hasClip) rects[i] = NSIntersectionRect(slice, clipRect); else rects[i] = slice; } NSRectFillListWithColors(rects, colors, count); return remainder; } void NSDrawButton(const NSRect aRect, const NSRect clipRect) { NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge, NSMaxXEdge, NSMinYEdge}; NSRectEdge down_sides[] = {NSMaxXEdge, NSMaxYEdge, NSMinXEdge, NSMinYEdge, NSMaxXEdge, NSMaxYEdge}; CGFloat grays[] = {NSBlack, NSBlack, NSWhite, NSWhite, NSDarkGray, NSDarkGray}; NSRect rect; NSGraphicsContext *ctxt = GSCurrentContext(); if (GSWViewIsFlipped(ctxt) == YES) { rect = NSDrawTiledRects(aRect, clipRect, down_sides, grays, 6); } else { rect = NSDrawTiledRects(aRect, clipRect, up_sides, grays, 6); } DPSgsave(ctxt); DPSsetgray(ctxt, NSLightGray); DPSrectfill(ctxt, NSMinX(rect), NSMinY(rect), NSWidth(rect), NSHeight(rect)); DPSgrestore(ctxt); } void NSDrawGrayBezel(const NSRect aRect, const NSRect clipRect) { NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge, NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge}; NSRectEdge down_sides[] = {NSMaxXEdge, NSMaxYEdge, NSMinXEdge, NSMinYEdge, NSMaxXEdge, NSMaxYEdge, NSMinXEdge, NSMinYEdge}; CGFloat grays[] = {NSWhite, NSWhite, NSDarkGray, NSDarkGray, NSLightGray, NSLightGray, NSBlack, NSBlack}; NSRect rect; NSGraphicsContext *ctxt = GSCurrentContext(); DPSgsave(ctxt); if (GSWViewIsFlipped(ctxt) == YES) { rect = NSDrawTiledRects(aRect, clipRect, down_sides, grays, 8); // to give a really clean look we add 2 dark gray points DPSsetgray(ctxt, NSDarkGray); DPSrectfill(ctxt, NSMinX(aRect) + 1., NSMaxY(aRect) - 2., 1., 1.); DPSrectfill(ctxt, NSMaxX(aRect) - 2., NSMinY(aRect) + 1., 1., 1.); } else { rect = NSDrawTiledRects(aRect, clipRect, up_sides, grays, 8); // to give a really clean look we add 2 dark gray points DPSsetgray(ctxt, NSDarkGray); DPSrectfill(ctxt, NSMinX(aRect) + 1., NSMinY(aRect) + 1., 1., 1.); DPSrectfill(ctxt, NSMaxX(aRect) - 2., NSMaxY(aRect) - 2., 1., 1.); } DPSsetgray(ctxt, NSLightGray); DPSrectfill(ctxt, NSMinX(rect), NSMinY(rect), NSWidth(rect), NSHeight(rect)); DPSgrestore(ctxt); } void NSDrawGroove(const NSRect aRect, const NSRect clipRect) { NSRectEdge up_sides[] = {NSMinXEdge, NSMaxYEdge, NSMinXEdge, NSMaxYEdge, NSMaxXEdge, NSMinYEdge, NSMaxXEdge, NSMinYEdge}; NSRectEdge down_sides[] = {NSMinXEdge, NSMinYEdge, NSMinXEdge, NSMinYEdge, NSMaxXEdge, NSMaxYEdge, NSMaxXEdge, NSMaxYEdge}; CGFloat grays[] = {NSDarkGray, NSDarkGray, NSWhite, NSWhite, NSWhite, NSWhite, NSDarkGray, NSDarkGray}; NSRect rect; NSGraphicsContext *ctxt = GSCurrentContext(); if (GSWViewIsFlipped(ctxt) == YES) { rect = NSDrawTiledRects(aRect, clipRect, down_sides, grays, 8); } else { rect = NSDrawTiledRects(aRect, clipRect, up_sides, grays, 8); } DPSgsave(ctxt); DPSsetgray(ctxt, NSLightGray); DPSrectfill(ctxt, NSMinX(rect), NSMinY(rect), NSWidth(rect), NSHeight(rect)); DPSgrestore(ctxt); } void NSDrawWhiteBezel(const NSRect aRect, const NSRect clipRect) { NSRectEdge up_sides[] = {NSMaxYEdge, NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge, NSMaxXEdge, NSMinYEdge, NSMinXEdge}; NSRectEdge down_sides[] = {NSMinYEdge, NSMaxXEdge, NSMaxYEdge, NSMinXEdge, NSMinYEdge, NSMaxXEdge, NSMaxYEdge, NSMinXEdge}; CGFloat grays[] = {NSDarkGray, NSWhite, NSWhite, NSDarkGray, NSDarkGray, NSLightGray, NSLightGray, NSDarkGray}; NSRect rect; NSGraphicsContext *ctxt = GSCurrentContext(); if (GSWViewIsFlipped(ctxt) == YES) { rect = NSDrawTiledRects(aRect, clipRect, down_sides, grays, 8); } else { rect = NSDrawTiledRects(aRect, clipRect, up_sides, grays, 8); } DPSgsave(ctxt); DPSsetgray(ctxt, NSWhite); DPSrectfill(ctxt, NSMinX(rect), NSMinY(rect), NSWidth(rect), NSHeight(rect)); DPSgrestore(ctxt); } void NSDrawDarkBezel(NSRect aRect, NSRect clipRect) { NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge, NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge}; NSRectEdge down_sides[] = {NSMaxXEdge, NSMaxYEdge, NSMinXEdge, NSMinYEdge, NSMaxXEdge, NSMaxYEdge, NSMinXEdge, NSMinYEdge}; // FIXME: The actual colour used for the 3 + 4 line // (and the two additional points) is a bit darker. CGFloat grays[] = {NSWhite, NSWhite, NSLightGray, NSLightGray, NSLightGray, NSLightGray, NSBlack, NSBlack}; NSRect rect; NSGraphicsContext *ctxt = GSCurrentContext(); DPSgsave(ctxt); if (GSWViewIsFlipped(ctxt) == YES) { rect = NSDrawTiledRects(aRect, clipRect, down_sides, grays, 8); // to give a really clean look we add 2 light gray points DPSsetgray(ctxt, NSLightGray); DPSrectfill(ctxt, NSMinX(aRect) + 1., NSMaxY(aRect) - 2., 1., 1.); DPSrectfill(ctxt, NSMaxX(aRect) - 2., NSMinY(aRect) + 1., 1., 1.); } else { rect = NSDrawTiledRects(aRect, clipRect, up_sides, grays, 8); // to give a really clean look we add 2 light gray points DPSsetgray(ctxt, NSLightGray); DPSrectfill(ctxt, NSMinX(aRect) + 1., NSMinY(aRect) + 1., 1., 1.); DPSrectfill(ctxt, NSMaxX(aRect) - 2., NSMaxY(aRect) - 2., 1., 1.); } DPSsetgray(ctxt, NSLightGray); DPSrectfill(ctxt, NSMinX(rect), NSMinY(rect), NSWidth(rect), NSHeight(rect)); DPSgrestore(ctxt); } void NSDrawLightBezel(NSRect aRect, NSRect clipRect) { NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge, NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge}; NSRectEdge down_sides[] = {NSMaxXEdge, NSMaxYEdge, NSMinXEdge, NSMinYEdge, NSMaxXEdge, NSMaxYEdge, NSMinXEdge, NSMinYEdge}; CGFloat grays[] = {NSWhite, NSWhite, NSGray, NSGray, NSBlack, NSBlack, NSBlack, NSBlack}; NSRect rect; NSGraphicsContext *ctxt = GSCurrentContext(); DPSgsave(ctxt); if (GSWViewIsFlipped(ctxt) == YES) { rect = NSDrawTiledRects(aRect, clipRect, down_sides, grays, 8); // to give a really clean look we add 2 light gray points DPSsetgray(ctxt, NSLightGray); DPSrectfill(ctxt, NSMinX(aRect), NSMaxY(aRect) - 1., 1., 1.); DPSrectfill(ctxt, NSMaxX(aRect) - 1., NSMinY(aRect), 1., 1.); } else { rect = NSDrawTiledRects(aRect, clipRect, up_sides, grays, 8); // to give a really clean look we add 2 light gray points DPSsetgray(ctxt, NSLightGray); DPSrectfill(ctxt, NSMinX(aRect), NSMinY(aRect), 1., 1.); DPSrectfill(ctxt, NSMaxX(aRect) - 1., NSMaxY(aRect) - 1., 1., 1.); } DPSsetgray(ctxt, NSWhite); DPSrectfill(ctxt, NSMinX(rect), NSMinY(rect), NSWidth(rect), NSHeight(rect)); DPSgrestore(ctxt); } void NSDrawFramePhoto(const NSRect aRect, const NSRect clipRect) { NSRectEdge up_sides[] = {NSMaxXEdge, NSMinYEdge, NSMinXEdge, NSMaxYEdge, NSMaxXEdge, NSMinYEdge}; NSRectEdge down_sides[] = {NSMaxXEdge, NSMaxYEdge, NSMinXEdge, NSMinYEdge, NSMaxXEdge, NSMaxYEdge}; CGFloat grays[] = {NSDarkGray, NSDarkGray, NSDarkGray, NSDarkGray, NSBlack, NSBlack}; NSRect rect; NSGraphicsContext *ctxt = GSCurrentContext(); if (GSWViewIsFlipped(ctxt) == YES) { rect = NSDrawTiledRects(aRect, clipRect, down_sides, grays, 6); } else { rect = NSDrawTiledRects(aRect, clipRect, up_sides, grays, 6); } DPSgsave(ctxt); DPSsetgray(ctxt, NSLightGray); DPSrectfill(ctxt, NSMinX(rect), NSMinY(rect), NSWidth(rect), NSHeight(rect)); DPSgrestore(ctxt); } void NSDrawWindowBackground(NSRect aRect) { NSGraphicsContext *ctxt = GSCurrentContext(); DPSgsave(ctxt); [[NSColor windowBackgroundColor] set]; NSRectFill(aRect); DPSgrestore(ctxt); } CGFloat NSLinkFrameThickness(void) { return 1.0; } void NSFrameLinkRect(NSRect aRect, BOOL isDestination) { NSGraphicsContext *ctxt = GSCurrentContext(); DPSgsave(ctxt); if (isDestination) { [[NSColor redColor] set]; } else { [[NSColor greenColor] set]; } NSFrameRectWithWidth(aRect, NSLinkFrameThickness()); DPSgrestore(ctxt); } void NSSetFocusRingStyle(NSFocusRingPlacement placement) { // FIXME: NIMP NSLog(@"*** NSSetFocusRingStyle not implemented ***"); } void NSConvertGlobalToWindowNumber(int globalNum, unsigned int *winNum) { NSArray *windows = GSAllWindows(); NSUInteger count = [windows count]; NSUInteger i; for (i = 0; i < count; i++) { NSWindow *win = [windows objectAtIndex: i]; if (((int)(intptr_t)[win windowRef]) == globalNum) { *winNum = [win windowNumber]; return; } } *winNum = 0; } void NSConvertWindowNumberToGlobal(int winNum, unsigned int *globalNum) { *globalNum = (int)(intptr_t)[GSWindowWithNumber(winNum) windowRef]; } void NSCountWindowsForContext(NSInteger context, NSInteger *count) { // TODO *count = 0; } void NSShowSystemInfoPanel(NSDictionary *options) { [NSApp orderFrontStandardInfoPanelWithOptions: options]; } void NSWindowListForContext(NSInteger context, NSInteger size, NSInteger **list) { // TODO } int NSGetWindowServerMemory(int context, int *virtualMemory, int *windowBackingMemory, NSString **windowDumpStream) { // TODO return -1; } gnustep-gui-0.24.0/Source/GSTextFinder.m0000664000076500007650000003352511547714223017704 0ustar brains99brains99/** GSTextFinder Copyright (C) 2010 Free Software Foundation, Inc. Author: Wolfgang Lux Date: July 2010 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSButton.h" #import "AppKit/NSEvent.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSMatrix.h" #import "AppKit/NSNib.h" #import "AppKit/NSNibLoading.h" #import "AppKit/NSPanel.h" #import "AppKit/NSPasteboard.h" #import "AppKit/NSTextField.h" #import "AppKit/NSTextView.h" #import "AppKit/NSWindow.h" #import "GSGuiPrivate.h" #import "GSTextFinder.h" @interface GSTextFinder(PrivateMethods) - (BOOL) _loadPanel; - (void) _applicationDidBecomeActive: (NSNotification *)notification; - (void) _updateFindStringFromPanel: (unsigned *)options putToPasteboard: (BOOL)flag; - (void) _updateReplaceStringFromPanel; - (void) _getFindStringFromPasteboard; - (void) _putFindStringToPasteboard; @end @implementation GSTextFinder static GSTextFinder *sharedTextFinder; + (GSTextFinder *) sharedTextFinder { if (sharedTextFinder == nil) { sharedTextFinder = [[self alloc] init]; } return sharedTextFinder; } - (id) init { if ((self = [super init]) != nil) { // make sure our search and replace strings are never nil findString = @""; replaceString = @""; // update find string from pasteboard whenever the application is // activated [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_applicationDidBecomeActive:) name: NSApplicationDidBecomeActiveNotification object: NSApp]; [self _applicationDidBecomeActive: nil]; } return self; } - (void) dealloc { [[NSNotificationCenter defaultCenter] removeObserver: self name: NSApplicationDidBecomeActiveNotification object: NSApp]; DESTROY(findString); DESTROY(replaceString); [super dealloc]; } // UI actions - (void) findNext: (id)sender { if ([self findStringInTextView: [self targetView: nil] forward: YES]) { // Special case here: If the user edits the find string and then presses // the Return key while the find text field (rather the panel's field // editor) is first responder, close the panel when a match was found. // This behavior is compatible with OpenStep and Mac OS X. However, in // contrast to Mac OS X, this cannot be implemented by associating a // dedicated action with the find text field, since the event is already // processed by the panel's default button before the field editor has a // chance of looking at it. // NB I assume here that the only keyboard event that can trigger the // Next button's action while the field editor is active is a key down // event from the Return key. if ([[panel currentEvent] type] == NSKeyDown && [findText currentEditor] != nil) { [panel close]; } } } - (void) findPrevious: (id)sender { [self findStringInTextView: [self targetView: nil] forward: NO]; } - (void) replaceAndFind: (id)sender { NSTextView *targetView = [self targetView: nil]; [self replaceStringInTextView: targetView]; [self findStringInTextView: targetView forward: YES]; } - (void) replace: (id)sender { [self replaceStringInTextView: [self targetView: nil]]; } - (void) replaceAll: (id)sender { // NB In contrast to -performFindPanelAction: this UI action takes the current // selection in the Replace All Scope matrix into account [self replaceAllInTextView: [self targetView: nil] onlyInSelection: [replaceScopeMatrix selectedTag] != 0]; } - (void) performFindPanelAction: (id)sender { [self performFindPanelAction: sender withTextView: nil]; } - (void) performFindPanelAction: (id)sender withTextView: (NSTextView *)aTextView { aTextView = [self targetView: aTextView]; switch ([sender tag]) { case NSFindPanelActionShowFindPanel: [self showFindPanel]; break; case NSFindPanelActionNext: [self findStringInTextView: aTextView forward: YES]; break; case NSFindPanelActionPrevious: [self findStringInTextView: aTextView forward: NO]; break; case NSFindPanelActionReplaceAll: [self replaceAllInTextView: aTextView onlyInSelection: NO]; break; case NSFindPanelActionReplace: [self replaceStringInTextView: aTextView]; break; case NSFindPanelActionReplaceAndFind: [self replaceStringInTextView: aTextView]; [self findStringInTextView: aTextView forward: YES]; break; case NSFindPanelActionSetFindString: [self takeFindStringFromTextView: aTextView]; break; case NSFindPanelActionReplaceAllInSelection: [self replaceAllInTextView: aTextView onlyInSelection: YES]; break; case NSFindPanelActionSelectAll: NSLog(@"NSFindPanelActionSelectAll not supported"); break; case NSFindPanelActionSelectAllInSelection: NSLog(@"NSFindPanelActionSelectAllInSelection not supported"); break; default: NSLog(@"Unknown find panel action (%ld)", (long)[sender tag]); } } - (BOOL) validateFindPanelAction: (id)sender withTextView: (NSTextView *)aTextView { aTextView = [self targetView: aTextView]; switch ([sender tag]) { case NSFindPanelActionShowFindPanel: return YES; case NSFindPanelActionReplace: return aTextView != nil; case NSFindPanelActionSetFindString: return aTextView && [aTextView selectedRange].length > 0; case NSFindPanelActionNext: case NSFindPanelActionPrevious: case NSFindPanelActionReplaceAll: case NSFindPanelActionReplaceAndFind: #if 0 // NSTextView does not support discontinuous selections at present case NSFindPanelActionSelectAll: #endif return aTextView && [findString length] > 0; case NSFindPanelActionReplaceAllInSelection: #if 0 // NSTextView does not support discontinuous selections at present case NSFindPanelActionSelectAllInSelection: #endif return [findString length] > 0 && aTextView && [aTextView selectedRange].length > 0; default: break; } // disable everything else return NO; } // text finder methods - (void) showFindPanel { if (panel == nil && [self _loadPanel] == NO) { return; } [messageText setStringValue: @""]; [panel makeKeyAndOrderFront: self]; [findText selectText: self]; } - (void) takeFindStringFromTextView: (NSText *)aTextView { [messageText setStringValue: @""]; if (aTextView != nil) { NSRange range = [aTextView selectedRange]; if (range.length) { NSString *string = [[aTextView string] substringFromRange: range]; ASSIGNCOPY(findString, string); [findText setStringValue: string]; [findText selectText: self]; [self _putFindStringToPasteboard]; } } } - (BOOL) findStringInTextView: (NSText *)aTextView forward: (BOOL)forward { NSRange range; NSRange selectedRange; NSString *string; unsigned int options = NSLiteralSearch | NSCaseInsensitiveSearch; [messageText setStringValue: @""]; if (aTextView == nil) { return NO; } string = [aTextView string]; selectedRange = [aTextView selectedRange]; [self _updateFindStringFromPanel: &options putToPasteboard: YES]; if (forward) { range = NSMakeRange(NSMaxRange(selectedRange), [string length] - NSMaxRange(selectedRange)); range = [string rangeOfString: findString options: options range: range]; if (range.location == NSNotFound) { range = NSMakeRange(0, selectedRange.location); range = [string rangeOfString: findString options: options range: range]; } } else { options |= NSBackwardsSearch; range = NSMakeRange(0, selectedRange.location); range = [string rangeOfString: findString options: options range: range]; if (range.location == NSNotFound) { range = NSMakeRange(NSMaxRange(selectedRange), [string length] - NSMaxRange(selectedRange)); range = [string rangeOfString: findString options: options range: range]; } } if (range.location != NSNotFound) { [aTextView setSelectedRange: range]; [aTextView scrollRangeToVisible: range]; } else { [messageText setStringValue: _(@"Not found")]; NSBeep(); } return range.location != NSNotFound; } - (void) replaceStringInTextView: (NSTextView *)aTextView { [messageText setStringValue: @""]; if (aTextView != nil) { NSRange range = [aTextView selectedRange]; if ([aTextView shouldChangeTextInRange: range replacementString: replaceString]) { [self _updateReplaceStringFromPanel]; [aTextView replaceCharactersInRange: range withString: replaceString]; [aTextView didChangeText]; [aTextView scrollRangeToVisible: range]; } } } - (void) replaceAllInTextView: (NSTextView *)aTextView onlyInSelection: (BOOL)flag { int n; NSRange range, replaceRange; NSString *format; NSString *string; unsigned int options = NSLiteralSearch | NSCaseInsensitiveSearch; [messageText setStringValue: @""]; if (aTextView == nil) return; [self _updateFindStringFromPanel: &options putToPasteboard: YES]; [self _updateReplaceStringFromPanel]; string = [aTextView string]; replaceRange = flag ? [aTextView selectedRange] : NSMakeRange(0, [string length]); // look for a first match in the range range = [string rangeOfString: findString options: options range: replaceRange]; if (range.location == NSNotFound) { [messageText setStringValue: _(@"Not found")]; NSBeep(); return; } n = 0; do { if ([aTextView shouldChangeTextInRange: range replacementString: replaceString]) { [aTextView replaceCharactersInRange: range withString: replaceString]; [aTextView didChangeText]; n++; } replaceRange = NSMakeRange(range.location + [replaceString length], NSMaxRange(replaceRange) - (range.location + [findString length])); range = [string rangeOfString: findString options: options range: replaceRange]; } while (range.location != NSNotFound); format = _(@"%d replaced"); [messageText setStringValue: [NSString stringWithFormat: format, n]]; // set insertion point to the end of the last match range = NSMakeRange(replaceRange.location, 0); [aTextView setSelectedRange: range]; [aTextView scrollRangeToVisible: range]; } - (NSTextView *) targetView: (NSTextView *)aTextView { // If aTextView is equal to the find panel's field editor use the default // target view if (aTextView == [panel fieldEditor: NO forObject: [panel firstResponder]]) { aTextView = nil; } if (aTextView == nil) { // The default target is the first responder of the main window // provided that it is a text view id aResponder = [[NSApp mainWindow] firstResponder]; if ([aResponder isKindOfClass: [NSTextView class]]) { aTextView = aResponder; } } return aTextView; } @end @implementation GSTextFinder(PrivateMethods) - (void) _applicationDidBecomeActive: (NSNotification *)notification { [self _getFindStringFromPasteboard]; } - (BOOL) _loadPanel { NSDictionary *table = [NSDictionary dictionaryWithObject: self forKey: NSNibOwner]; if (![GSGuiBundle() loadNibFile: @"GSFindPanel" externalNameTable: table withZone: [self zone]]) { NSLog(@"Model file load failed for GSFindPanel"); return NO; } [findText setStringValue: findString]; [replaceText setStringValue: replaceString]; [messageText setStringValue: @""]; // FIXME Setting this in gorm does not have an effect [panel setFrameAutosaveName: @"NSFindPanel"]; // Make sure the Find menu is enabled when the panel's field editor is // first responder [(NSTextView *)[panel fieldEditor: YES forObject: nil] setUsesFindPanel: YES]; return YES; } - (void) _updateFindStringFromPanel: (unsigned int *)options putToPasteboard: (BOOL)flag { if (panel) { ASSIGN(findString, [findText stringValue]); if ([ignoreCaseButton state] != NSOffState) { *options |= NSCaseInsensitiveSearch; } else { *options &= ~NSCaseInsensitiveSearch; } } if (flag) { [self _putFindStringToPasteboard]; } } - (void) _updateReplaceStringFromPanel { if (panel) { ASSIGN(replaceString, [replaceText stringValue]); } } - (void) _getFindStringFromPasteboard { NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSFindPboard]; if ([[pboard types] containsObject:NSStringPboardType]) { NSString *string = [pboard stringForType:NSStringPboardType]; if ([string length] && ![string isEqualToString:findString]) { ASSIGN(findString, string); [findText setStringValue: string]; [findText selectText: self]; } } } - (void) _putFindStringToPasteboard { NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSFindPboard]; [pboard declareTypes: [NSArray arrayWithObject:NSStringPboardType] owner: nil]; [pboard setString: findString forType: NSStringPboardType]; } @end gnustep-gui-0.24.0/Source/NSOpenPanel.m0000664000076500007650000004414712023535463017517 0ustar brains99brains99/** NSOpenPanel -*-objc-*- Standard panel for opening files Copyright (C) 1996, 1998, 1999, 2000 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Daniel Boehringer Date: August 1998 Source by Daniel Boehringer integrated into Scott Christley's preliminary implementation by Felipe A. Rodriguez Author: Nicola Pero Date: October 1999 Completely Rewritten. Author: Mirko Viviani Date: September 2000 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSBrowser.h" #import "AppKit/NSBrowserCell.h" #import "AppKit/NSButton.h" #import "AppKit/NSForm.h" #import "AppKit/NSMatrix.h" #import "AppKit/NSOpenPanel.h" #import "GSGuiPrivate.h" #import "GNUstepGUI/GSTheme.h" static NSString * pathToColumn(NSBrowser *browser, int column) { #if defined(__MINGW32__) if (column == 0) return @"/"; else if (column == 1) return [[[browser pathToColumn: column] substringFromIndex: 1] stringByAppendingString: @"/"]; else return [[browser pathToColumn: column] substringFromIndex: 1]; #else return [browser pathToColumn: column]; #endif } static NSOpenPanel *_gs_gui_open_panel = nil; // Pacify the compiler @interface NSSavePanel (GSPrivateMethods) - (void) _resetDefaults; - (void) _updateDefaultDirectory; - (void) _reloadBrowser; - (void) _selectCellName: (NSString *)title; - (void) _selectTextInColumn: (int)column; - (void) _setupForDirectory: (NSString *)path file: (NSString *)filename; - (BOOL) _shouldShowExtension: (NSString *)extension; - (NSComparisonResult) _compareFilename: (NSString *)n1 with: (NSString *)n2; @end @implementation NSOpenPanel (GSPrivateMethods) - (void) _resetDefaults { [super _resetDefaults]; [self setTitle: _(@"Open")]; [self setCanChooseFiles: YES]; [self setCanChooseDirectories: YES]; [self setAllowsMultipleSelection: NO]; [_okButton setEnabled: NO]; } - (BOOL) _shouldShowExtension: (NSString *)extension { if (_canChooseFiles == NO || (_allowedFileTypes != nil && [_allowedFileTypes containsObject: extension] == NO)) return NO; return YES; } - (void) _selectTextInColumn: (int)column { NSMatrix *matrix; if (column == -1) return; if (_delegateHasSelectionDidChange) { [_delegate panelSelectionDidChange: self]; } matrix = [_browser matrixInColumn: column]; // Validate selection BOOL selectionValid = YES; NSArray *selectedCells = [matrix selectedCells]; NSEnumerator *e = [selectedCells objectEnumerator]; id o; while ((o = [e nextObject]) != nil) { if ((![o isLeaf] && !_canChooseDirectories) || ([o isLeaf] && !_canChooseFiles)) { selectionValid = NO; } } [_okButton setEnabled: selectionValid]; // Set form label if ([selectedCells count] > 1) { [[_form cellAtIndex: 0] setStringValue: @""]; } else { [[_form cellAtIndex: 0] setStringValue: [[matrix selectedCell] stringValue]]; } } - (void) _setupForDirectory: (NSString *)path file: (NSString *)filename { // FIXME: Not sure if this is needed if ((filename == nil) || ([filename isEqual: @""] == NO)) [_okButton setEnabled: YES]; if (_canChooseDirectories == NO) { if ([_browser allowsMultipleSelection] == YES) [_browser setAllowsBranchSelection: NO]; } [super _setupForDirectory: path file: filename]; } @end /**

Implements a panel that allows the user to select a file or files. NSOpenPanel is based on the NSSavePanel implementation and shares a lot of similarities with it.

There is only one open panel per application and this panel is obtained by calling the +openPanel class method. From here, you should set the characteristics of the file selection mechanism using the -setCanChooseFiles:, -setCanChooseDirectories: and -setAllowsMultipleSelection: methods. The default is YES except for allowing multiple selection. When ready to show the panel, use the -runModalForTypes:, or a similar method to show the panel in a modal session. Other methods allow you to set the initial directory and initially selected file. The method will return one of NSOKButton or NSCancelButton depending on which button the user pressed.

Use the [NSSavePanel-filename] or -filenames method to retrieve the name of the file the user selected.

*/ @implementation NSOpenPanel /* * Class methods */ + (void) initialize { if (self == [NSOpenPanel class]) { [self setVersion: 1]; } } /**

Creates ( if needed ) and returns the shared NSOpenPanel instance.

*/ + (NSOpenPanel *) openPanel { if (!_gs_gui_open_panel) { Class openPanelClass = [[GSTheme theme] openPanelClass]; _gs_gui_open_panel = [[openPanelClass alloc] init]; } [_gs_gui_open_panel _resetDefaults]; return _gs_gui_open_panel; } - (id) init { self = [super init]; if (self != nil) { _canChooseDirectories = YES; _canChooseFiles = YES; } return self; } /* * Filtering Files */ /**

Allows the user to select multiple files if flag is YES. The default behavior is not to allow multiple selections

See Also: -allowsMultipleSelection [NSBrowser-setAllowsMultipleSelection:]

*/ - (void) setAllowsMultipleSelection: (BOOL)flag { [_browser setAllowsMultipleSelection: flag]; } /**

Returns YES if the user is allowed to select multiple files. The default behavior is not to allow mutiple selections.

See Also: -setAllowsMultipleSelection: [NSBrowser-allowsMultipleSelection]

*/ - (BOOL) allowsMultipleSelection { return [_browser allowsMultipleSelection]; } /**

Allows the user to choose directories if flag is YES. The default behavior is to allow choosing directories.

See Also: -canChooseDirectories [NSBrowser-setAllowsBranchSelection:]

*/ - (void) setCanChooseDirectories: (BOOL)flag { if (flag != _canChooseDirectories) { _canChooseDirectories = flag; [_browser setAllowsBranchSelection: flag]; if (!flag) { /* FIXME If the user disables directory selection we should deselect any directories that are currently selected. This is achieved by calling _reloadBrowser, but this may be considered overkill, since the displayed files are the same whether canChooseDirectories is enabled or not. */ [self _reloadBrowser]; } } } /**

Returns YES if the user is allowed to choose directories The default behavior is to allow choosing directories.

See Also: -setCanChooseDirectories:

*/ - (BOOL) canChooseDirectories { return _canChooseDirectories; } /**

Allows the user to choose files if flag is YES.The default behavior it to allow choosing files.

See Also: -canChooseFiles

*/ - (void) setCanChooseFiles: (BOOL)flag { if (flag != _canChooseFiles) { _canChooseFiles = flag; [self _reloadBrowser]; } } /**

Returns YES if the user is allowed to choose files. The default behavior it to allow choosing files.

See Also: -setCanChooseFiles:

*/ - (BOOL) canChooseFiles { return _canChooseFiles; } /**

Returns the absolute path of the file selected by the user.

*/ - (NSString*) filename { NSArray *ret; ret = [self filenames]; if ([ret count] == 1) return [ret objectAtIndex: 0]; else return nil; } /**

Returns an array containing the absolute paths (as NSString objects) of the selected files and directories. If multiple selections aren't allowed, the array contains a single name.

*/ - (NSArray *) filenames { if ([_browser allowsMultipleSelection]) { NSArray *cells = [_browser selectedCells]; NSEnumerator *cellEnum = [cells objectEnumerator]; NSBrowserCell *currCell; NSMutableArray *ret = [NSMutableArray array]; NSString *dir = [self directory]; if ([_browser selectedColumn] != [_browser lastColumn]) { /* * The last column doesn't have anything selected - so we must * have selected a directory. */ if (_canChooseDirectories == YES) { [ret addObject: dir]; } } else { while ((currCell = [cellEnum nextObject])) { [ret addObject: [dir stringByAppendingPathComponent: [currCell stringValue]]]; } } return ret; } else { if (_canChooseDirectories == YES) { if ([_browser selectedColumn] != [_browser lastColumn]) return [NSArray arrayWithObject: [self directory]]; } return [NSArray arrayWithObject: [super filename]]; } } /** Returns an array of the selected files as URLs */ - (NSArray *) URLs { NSMutableArray *ret = [NSMutableArray new]; NSEnumerator *enumerator = [[self filenames] objectEnumerator]; NSString *filename; while ((filename = [enumerator nextObject]) != nil) { [ret addObject: [NSURL fileURLWithPath: filename]]; } return AUTORELEASE(ret); } /* * Running the NSOpenPanel */ /**

Displays the open panel in a modal session, showing the current directory (or last selected), and filtering for files that matches the allowed file types.

See Also: -runModalForDirectory:file:types: and -allowedFileTypes

*/ - (NSInteger) runModal { return [self runModalForTypes: [self allowedFileTypes]]; } /**

Displays the open panel in a modal session, showing the current directory (or last selected), and filtering for files that have the specified types.

See Also: -runModalForDirectory:file:types:

*/ - (NSInteger) runModalForTypes: (NSArray *)fileTypes { return [self runModalForDirectory: [self directory] file: @"" types: fileTypes]; } /**

Displays the open panel in a modal session, with the directory path shown and file name (if any) selected. Files are filtered for the specified types. If the directory is nil, then the directory shown in the open panel is the last directory selected.

See Also: -runModalForTypes:

*/ - (NSInteger) runModalForDirectory: (NSString *)path file: (NSString *)name types: (NSArray *)fileTypes { [self setAllowedFileTypes: fileTypes]; return [self runModalForDirectory: path file: name]; } - (NSInteger) runModalForDirectory: (NSString *)path file: (NSString *)name types: (NSArray *)fileTypes relativeToWindow: (NSWindow*)window { [self setAllowedFileTypes: fileTypes]; return [self runModalForDirectory: path file: name relativeToWindow: window]; } - (void) beginSheetForDirectory: (NSString *)path file: (NSString *)name types: (NSArray *)fileTypes modalForWindow: (NSWindow *)docWindow modalDelegate: (id)delegate didEndSelector: (SEL)didEndSelector contextInfo: (void *)contextInfo { [self setAllowedFileTypes: fileTypes]; [self beginSheetForDirectory: path file: name modalForWindow: docWindow modalDelegate: delegate didEndSelector: didEndSelector contextInfo: contextInfo]; } - (void) beginForDirectory: (NSString *)path file: (NSString *)filename types: (NSArray *)fileTypes modelessDelegate: (id)modelessDelegate didEndSelector: (SEL)didEndSelector contextInfo: (void *)contextInfo { // FIXME: This should be modeless [self setAllowedFileTypes: fileTypes]; [self _setupForDirectory: path file: filename]; if ([filename length] > 0) [_okButton setEnabled: YES]; [NSApp beginSheet: self modalForWindow: nil modalDelegate: modelessDelegate didEndSelector: didEndSelector contextInfo: contextInfo]; } - (void) ok: (id)sender { NSMatrix *matrix = nil; NSBrowserCell *selectedCell = nil; NSArray *selectedCells = nil; int selectedColumn, lastColumn; NSString *tmp; selectedColumn = [_browser selectedColumn]; lastColumn = [_browser lastColumn]; if (selectedColumn >= 0) { matrix = [_browser matrixInColumn: selectedColumn]; if ([_browser allowsMultipleSelection] == YES) { selectedCells = [matrix selectedCells]; if (selectedColumn == lastColumn && [selectedCells count] == 1) selectedCell = [selectedCells objectAtIndex: 0]; } else { if (selectedColumn == lastColumn) selectedCell = [matrix selectedCell]; } } if (selectedCell) { if ([selectedCell isLeaf] == NO) { [[_form cellAtIndex: 0] setStringValue: @""]; [_browser doClick: matrix]; [_form selectTextAtIndex: 0]; [_form setNeedsDisplay: YES]; return; } } else if (_canChooseDirectories == NO && (selectedColumn != lastColumn || ![selectedCells count])) { [_form selectTextAtIndex: 0]; [_form setNeedsDisplay: YES]; return; } ASSIGN (_directory, pathToColumn(_browser, [_browser lastColumn])); if (selectedCell) tmp = [selectedCell stringValue]; else tmp = [[_form cellAtIndex: 0] stringValue]; if ([tmp isAbsolutePath] == YES) { ASSIGN (_fullFileName, tmp); } else { ASSIGN (_fullFileName, [_directory stringByAppendingPathComponent: tmp]); } if (_delegateHasValidNameFilter) { NSEnumerator *enumerator; NSArray *filenames = [self filenames]; NSString *filename; enumerator = [filenames objectEnumerator]; while ((filename = [enumerator nextObject])) { if ([_delegate panel: self isValidFilename: filename] == NO) return; } } [self _updateDefaultDirectory]; [NSApp stopModalWithCode: NSOKButton]; [_okButton setEnabled: NO]; [self close]; } - (BOOL) resolvesAliases { // FIXME return YES; } - (void) setResolvesAliases: (BOOL) flag { // FIXME } /* * NSCoding protocol */ - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_canChooseDirectories]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_canChooseFiles]; } - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if (nil == self) return nil; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_canChooseDirectories]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_canChooseFiles]; return self; } @end // // NSForm delegate methods // @interface NSOpenPanel (FormDelegate) - (void) controlTextDidChange: (NSNotification *)aNotification; @end @implementation NSOpenPanel (FormDelegate) - (void) controlTextDidChange: (NSNotification *)aNotification; { NSString *s, *selectedString; NSArray *cells; NSMatrix *matrix; NSCell *selectedCell; int i, sLength, cellLength, selectedRow; NSComparisonResult result; NSRange range; s = [[[aNotification userInfo] objectForKey: @"NSFieldEditor"] string]; /* * If the user typed in an absolute path, display it. */ if ([s isAbsolutePath] == YES) { [self setDirectory: s]; } sLength = [s length]; range.location = 0; range.length = sLength; matrix = [_browser matrixInColumn: [_browser lastColumn]]; if (sLength == 0) { [matrix deselectAllCells]; [_okButton setEnabled: _canChooseDirectories]; return; } selectedCell = [matrix selectedCell]; selectedString = [selectedCell stringValue]; selectedRow = [matrix selectedRow]; cells = [matrix cells]; if (selectedString) { cellLength = [selectedString length]; if (cellLength < sLength) range.length = cellLength; result = [selectedString compare: s options: 0 range: range]; if (result == NSOrderedSame) return; else if (result == NSOrderedAscending) result = NSOrderedDescending; else if (result == NSOrderedDescending) result = NSOrderedAscending; range.length = sLength; } else result = NSOrderedDescending; if (result == NSOrderedDescending) { int numberOfCells = [cells count]; for (i = selectedRow+1; i < numberOfCells; i++) { selectedString = [[matrix cellAtRow: i column: 0] stringValue]; cellLength = [selectedString length]; if (cellLength < sLength) continue; result = [selectedString compare: s options: 0 range: range]; if (result == NSOrderedSame) { [matrix deselectAllCells]; [matrix selectCellAtRow: i column: 0]; [matrix scrollCellToVisibleAtRow: i column: 0]; [_okButton setEnabled: YES]; return; } } } else { for (i = selectedRow; i >= 0; --i) { selectedString = [[matrix cellAtRow: i column: 0] stringValue]; cellLength = [selectedString length]; if (cellLength < sLength) continue; result = [selectedString compare: s options: 0 range: range]; if (result == NSOrderedSame) { [matrix deselectAllCells]; [matrix selectCellAtRow: i column: 0]; [matrix scrollCellToVisibleAtRow: i column: 0]; [_okButton setEnabled: YES]; return; } } } [matrix deselectAllCells]; [_okButton setEnabled: NO]; } @end /* NSOpenPanel */ gnustep-gui-0.24.0/Source/GSFastEnumeration.h0000664000076500007650000000214411460306562020715 0ustar brains99brains99 #ifdef __clang__ #define FOR_IN(type, var, collection) \ for (type var in collection)\ { #define END_FOR_IN(collection) } #else void objc_enumerationMutation(id); #define FOR_IN(type, var, c) \ do\ {\ type var;\ NSFastEnumerationState gs_##c##_enumState = { 0 };\ id gs_##c##_items[16];\ unsigned long gs_##c##_limit = \ [c countByEnumeratingWithState: &gs_##c##_enumState \ objects: gs_##c##_items \ count: 16];\ if (gs_##c##_limit)\ {\ unsigned long gs_startMutations = *gs_##c##_enumState.mutationsPtr;\ do {\ unsigned long gs_##c##counter = 0;\ do {\ if (gs_startMutations != *gs_##c##_enumState.mutationsPtr)\ {\ objc_enumerationMutation(c);\ }\ var = gs_##c##_enumState.itemsPtr[gs_##c##counter++];\ #define END_FOR_IN(c) \ } while (gs_##c##counter < gs_##c##_limit);\ } while ((gs_##c##_limit = [c countByEnumeratingWithState: &gs_##c##_enumState\ objects: gs_##c##_items\ count: 16]));\ }\ } while(0); #endif gnustep-gui-0.24.0/Source/GSHelpAttachment.m0000664000076500007650000000466411510333651020523 0ustar brains99brains99/** GSHelpAttachment Copyright (C) 2011 Free Software Foundation, Inc. Author: Wolfgang Lux Date: Jan 2011 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "AppKit/NSFileWrapper.h" #import "AppKit/NSImage.h" #import "GNUstepGUI/GSHelpAttachment.h" @implementation GSHelpLinkAttachment static NSImage *sharedHelpLinkIcon; + (void) initialize { sharedHelpLinkIcon = [NSImage imageNamed: @"common_HelpLink"]; } - (id) initWithFileName: (NSString *)aFileName markerName: (NSString *)aMarkerName { NSFileWrapper *wrapper; /* Create an empty wrapper so that we can supply an icon to the attachment cell. */ wrapper = [[NSFileWrapper alloc] init]; [wrapper setIcon: sharedHelpLinkIcon]; if ((self = [super initWithFileWrapper: wrapper]) != nil) { ASSIGN(fileName, aFileName); ASSIGN(markerName, aMarkerName); } RELEASE(wrapper); return self; } - (void) dealloc { RELEASE(fileName); RELEASE(markerName); [super dealloc]; } - (NSString *) fileName { return fileName; } - (NSString *) markerName { return markerName; } @end @implementation GSHelpMarkerAttachment - (id) initWithMarkerName: (NSString *)aMarkerName { NSFileWrapper *wrapper; /* Create an empty wrapper so that we can supply an (nil) icon to the attachment cell. */ wrapper = [[NSFileWrapper alloc] init]; if ((self = [super initWithFileWrapper: wrapper]) != nil) { ASSIGN(markerName, aMarkerName); } RELEASE(wrapper); return self; } - (void) dealloc { RELEASE(markerName); [super dealloc]; } - (NSString *) markerName { return markerName; } @end gnustep-gui-0.24.0/Source/NSCachedImageRep.m0000664000076500007650000002064212104255431020403 0ustar brains99brains99/** NSCachedImageRep Cached image representation. Copyright (C) 1996 Free Software Foundation, Inc. Author: Adam Fedor Date: Feb 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Keeps a representation of an image in an off-screen window. If the message initFromWindow:rect: is sent with a nil window, one is created using the rect information. */ // for fabs() #include #import "config.h" #import #import #import #import "AppKit/NSAffineTransform.h" #import "AppKit/NSBitmapImageRep.h" #import "AppKit/NSCachedImageRep.h" #import "AppKit/NSView.h" #import "AppKit/NSWindow.h" #import "AppKit/PSOperators.h" @interface GSCacheW : NSWindow @end @implementation GSCacheW - (void) _initDefaults { [super _initDefaults]; [self setExcludedFromWindowsMenu: YES]; [self setAutodisplay: NO]; [self setReleasedWhenClosed: NO]; [self setMiniwindowImage: nil]; } - (void) display { } - (void) displayIfNeeded { } - (void) setViewsNeedDisplay: (BOOL)f { } @end /**

Todo Description

*/ @implementation NSCachedImageRep /**

Initializes and returns a new NSCachedImageRep with size and depth specified by aSize and aDepth respectively. If seperate is YES, the image will gets its own unique cache without sharing it with other images.

*/ - (id) initWithSize: (NSSize)aSize pixelsWide: (NSInteger)pixelsWide pixelsHigh: (NSInteger)pixelsHigh depth: (NSWindowDepth)aDepth separate: (BOOL)separate alpha: (BOOL)alpha { NSWindow *win; if (aSize.width <= 0 || aSize.height <= 0 || pixelsWide <= 0 || pixelsHigh <= 0) { [NSException raise: NSInvalidArgumentException format: @"NSCachedImageRep created with size %@ pixelsWide %d pixelsHigh %d", NSStringFromSize(aSize), pixelsWide, pixelsHigh]; } // FIXME: Only create new window when separate is YES win = [[GSCacheW alloc] initWithContentRect: NSMakeRect(0, 0, pixelsWide, pixelsHigh) styleMask: NSBorderlessWindowMask | NSUnscaledWindowMask backing: NSBackingStoreRetained defer: NO]; [[win contentView] setBoundsSize: NSMakeSize(aSize.width, aSize.height)]; self = [self initWithWindow: win rect: NSMakeRect(0, 0, aSize.width, aSize.height)]; RELEASE(win); if (!self) return nil; [self setAlpha: alpha]; [self setBitsPerSample: NSBitsPerSampleFromDepth(aDepth)]; [self setSize: aSize]; [self setPixelsWide: pixelsWide]; [self setPixelsHigh: pixelsHigh]; return self; } - (id) initWithSize: (NSSize)aSize depth: (NSWindowDepth)aDepth separate: (BOOL)separate alpha: (BOOL)alpha { return [self initWithSize: aSize pixelsWide: aSize.width pixelsHigh: aSize.height depth: aDepth separate: separate alpha: alpha]; } /**

Initializes and returns a new NSCachedImageRep into a NSWindow aWindow. The image will be draw into the rectange aRect of this window. aWindow is retained.

See Also: -rect -window

*/ - (id) initWithWindow: (NSWindow *)aWindow rect: (NSRect)aRect { self = [super init]; if (!self) return nil; _window = RETAIN(aWindow); _rect = aRect; /* Either win or rect must be non-NULL. If rect is empty, we get the frame info from the window. If win is nil we create it from the rect information. */ if (NSIsEmptyRect(_rect)) { if (!_window) { [NSException raise: NSInvalidArgumentException format: @"Must specify either window or rect when " @"creating NSCachedImageRep"]; } _rect = [_window frame]; } if (!_window) _window = [[GSCacheW alloc] initWithContentRect: _rect styleMask: NSBorderlessWindowMask | NSUnscaledWindowMask backing: NSBackingStoreRetained defer: NO]; [self setSize: _rect.size]; [self setAlpha: NO]; [self setOpaque: YES]; [self setPixelsHigh: _rect.size.height]; [self setPixelsWide: _rect.size.width]; return self; } - (void) dealloc { RELEASE(_window); [super dealloc]; } /**

Returns the rectangle where the image is cached.

See Also: -initWithWindow:rect:

*/ - (NSRect) rect { return _rect; } /**

Returns the NSWindow where the image is cached.

See Also: -initWithWindow:rect:

*/ - (NSWindow *) window { return _window; } - (BOOL) draw { /* Horrible hack to get drawing on a scaled or rotated context correct. Only used on backends not supporting GSdraw: (art/xlib backend). */ NSGraphicsContext *ctxt = GSCurrentContext(); NSAffineTransform *transform; NSAffineTransformStruct ts; // Is there anything to draw? if (NSIsEmptyRect(_rect)) return YES; transform = [ctxt GSCurrentCTM]; ts = [transform transformStruct]; if (fabs(ts.m11 - 1.0) < 0.01 && fabs(ts.m12) < 0.01 && fabs(ts.m21) < 0.01 && fabs(ts.m22 - 1.0) < 0.01) { PScomposite(NSMinX(_rect), NSMinY(_rect), NSWidth(_rect), NSHeight(_rect), [_window gState], 0, 0, NSCompositeSourceOver); } else { NSView *view = [_window contentView]; NSBitmapImageRep *rep; [view lockFocus]; rep = [[NSBitmapImageRep alloc] initWithFocusedViewRect: _rect]; [view unlockFocus]; [rep draw]; RELEASE(rep); } return YES; } /** * Overridden private NSImageRep method called for backends supporting * drawGState. This is an efficient implementation which boils down to * cairo calls to set the source surface, clip, and paint. */ - (void) nativeDrawInRect: (NSRect)dstRect fromRect: (NSRect)srcRect operation: (NSCompositingOperation)op fraction: (CGFloat)delta { NSGraphicsContext *ctxt = GSCurrentContext(); NSWindow *window = [self window]; NSInteger gState = [window gState]; NSAffineTransform *transform, *backup; NSRect winSrcRect; // Convert srcRect from rep coordinate space to window base coordinate space { CGFloat repToWinWidthScaleFactor = [window frame].size.width / [self size].width; CGFloat repToWinHeightScaleFactor = [window frame].size.height / [self size].height; winSrcRect = NSMakeRect(srcRect.origin.x * repToWinWidthScaleFactor, srcRect.origin.y * repToWinHeightScaleFactor, srcRect.size.width * repToWinWidthScaleFactor, srcRect.size.height * repToWinHeightScaleFactor); } //NSLog(@"Using NSCachedImageRep nativeDrawInRect: fast path for %@", self); backup = [ctxt GSCurrentCTM]; transform = [NSAffineTransform transform]; [transform translateXBy: dstRect.origin.x yBy: dstRect.origin.y]; [transform scaleXBy: dstRect.size.width / winSrcRect.size.width yBy: dstRect.size.height / winSrcRect.size.height]; [transform concat]; [ctxt GSdraw: gState toPoint: NSMakePoint(0,0) fromRect: winSrcRect operation: op fraction: delta]; [ctxt GSSetCTM: backup]; } // NSCoding protocol - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding] == NO) { [aCoder encodeObject: _window]; [aCoder encodeRect: _rect]; } } - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if (!self) return nil; if ([aDecoder allowsKeyedCoding] == NO) { [aDecoder decodeValueOfObjCType: @encode(id) at: &_window]; _rect = [aDecoder decodeRect]; } return self; } // NSCopying protocol - (id) copyWithZone: (NSZone *)zone { // Cached images should not be copied return nil; } @end gnustep-gui-0.24.0/Source/NSMatrix.m0000664000076500007650000032065012106650604017073 0ustar brains99brains99/** NSMatrix Matrix class for grouping controls Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: March 1997 A completely rewritten version of the original source by Pascal Forget and Scott Christley. Modified: Felipe A. Rodriguez Date: August 1998 Cell handling rewritten: Richard Frith-Macdonald Date: November 1999 Implementation of Editing: Nicola Pero Date: November 1999 Modified: Mirko Viviani Date: March 2001 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Mouse Tracking Notes: The behaviour of mouse tracking is a bit different on OS42 and MaxOSX. The implementation here reflects OS42 more closely (as the original code in NSMatrix). Examples of differences: - highlighting of NSButtonCells is different; - OS42 makes each cell under the cursor track the mouse, MacOSX makes only the clicked cell track it, untilMouseUp; - if mouse goes up outside of a cell, OS42 sends the action, MacOSX does not - keys used for selection in list mode are not the same (shift and alternate on OS42, command and shift on MacOSX). */ #include "config.h" #include #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSButtonCell.h" #import "AppKit/NSColor.h" #import "AppKit/NSCursor.h" #import "AppKit/NSEvent.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSKeyValueBinding.h" #import "AppKit/NSMatrix.h" #import "AppKit/NSWindow.h" #include static NSNotificationCenter *nc; #define NSMATRIX_STRICT_CHECKING 0 #ifdef MIN # undef MIN #endif #define MIN(A,B) ({ typeof(A) __a = (A); \ typeof(B) __b = (B); \ __a < __b ? __a : __b; }) #ifdef MAX # undef MAX #endif #define MAX(A,B) ({ typeof(A) __a = (A); \ typeof(B) __b = (B); \ __a < __b ? __b : __a; }) #ifdef ABS # undef ABS #endif #define ABS(A) ({ typeof(A) __a = (A); __a < 0 ? -__a : __a; }) #define SIGN(x) \ ({typeof(x) _SIGN_x = (x); \ _SIGN_x > 0 ? 1 : (_SIGN_x == 0 ? 0 : -1); }) #define POINT_FROM_INDEX(index) \ ({MPoint point = { (index) % _numCols, (index) / _numCols }; point; }) #define INDEX_FROM_COORDS(x,y) \ ((y) * _numCols + (x)) #define INDEX_FROM_POINT(point) \ ((point).y * _numCols + (point).x) /* Some stuff needed to compute the selection in the list mode. */ typedef struct { int x; int y; } MPoint; typedef struct { int x; int y; int width; int height; } MRect; typedef struct _GSMatrixFlags { #if GS_WORDS_BIGENDIAN == 1 unsigned int isHighlight:1; unsigned int isRadio:1; unsigned int isList:1; unsigned int allowsEmptySelection:1; unsigned int autoScroll:1; unsigned int selectionByRect:1; unsigned int drawCellBackground:1; unsigned int drawBackground:1; unsigned int autosizesCells:1; unsigned int drawingAncestor:1; unsigned int tabKeyTraversesCells:1; unsigned int tabKeyTraversesCellsExplicitly:1; unsigned int canSearchIncrementally:1; unsigned int unused:19; #else unsigned int unused:19; unsigned int canSearchIncrementally:1; unsigned int tabKeyTraversesCellsExplicitly:1; unsigned int tabKeyTraversesCells:1; unsigned int drawingAncestor:1; unsigned int autosizesCells:1; unsigned int drawBackground:1; unsigned int drawCellBackground:1; unsigned int selectionByRect:1; unsigned int autoScroll:1; unsigned int allowsEmptySelection:1; unsigned int isList:1; unsigned int isRadio:1; unsigned int isHighlight:1; #endif } GSMatrixFlags; static inline MPoint MakePoint (int x, int y) { MPoint point = { x, y }; return point; } @interface NSMatrix (PrivateMethods) - (void) _renewRows: (int)row columns: (int)col rowSpace: (int)rowSpace colSpace: (int)colSpace; - (void) _setState: (int)state highlight: (BOOL)highlight startIndex: (int)start endIndex: (int)end; - (BOOL) _selectNextSelectableCellAfterRow: (int)row column: (int)column; - (BOOL) _selectPreviousSelectableCellBeforeRow: (int)row column: (int)column; - (void) _setKeyRow: (int) row column: (int) column; @end enum { DEFAULT_CELL_HEIGHT = 17, DEFAULT_CELL_WIDTH = 100 }; /**

TODO documentation

*/ @implementation NSMatrix /* Class variables */ static Class defaultCellClass = nil; static NSUInteger mouseDownFlags = 0; static SEL copySel; static SEL initSel; static SEL allocSel; static SEL getSel; + (void) initialize { if (self == [NSMatrix class]) { /* Set the initial version */ [self setVersion: 1]; copySel = @selector(copyWithZone:); initSel = @selector(init); allocSel = @selector(allocWithZone:); getSel = @selector(objectAtIndex:); /* * MacOS-X docs say default cell class is NSActionCell */ defaultCellClass = [NSActionCell class]; // nc = [NSNotificationCenter defaultCenter]; [self exposeBinding: NSSelectedTagBinding]; } } /**

Returns the cell class used to create cells. By default it is a NSActionCell class

See Also: +setCellClass:

*/ + (Class) cellClass { return defaultCellClass; } /**

Sets the cell class used to create cells to classId. By default it is a NSActionCell class

See Also: +setCellClass:

*/ + (void) setCellClass: (Class)classId { defaultCellClass = classId; if (defaultCellClass == nil) defaultCellClass = [NSActionCell class]; } - (id) init { return [self initWithFrame: NSZeroRect mode: NSRadioModeMatrix cellClass: [object_getClass(self) cellClass] numberOfRows: 0 numberOfColumns: 0]; } /**

Initializes and returns a NSMatrix in frame frameRect. By default the matrix has no row and no column, the NSMatrix's mode is NSRadioModeMatrix and the cell class is a NSActionCell class.

See Also: -initWithFrame:mode:cellClass:numberOfRows:numberOfColumns:

*/ - (id) initWithFrame: (NSRect)frameRect { return [self initWithFrame: frameRect mode: NSRadioModeMatrix cellClass: [object_getClass(self) cellClass] numberOfRows: 0 numberOfColumns: 0]; } - (void) _privateFrame: (NSRect)frameRect mode: (NSMatrixMode)aMode numberOfRows: (NSInteger)rows numberOfColumns: (NSInteger)cols { _myZone = [self zone]; [self _renewRows: rows columns: cols rowSpace: 0 colSpace: 0]; _mode = aMode; if ((_numCols > 0) && (_numRows > 0)) { /* We must not round the _cellSize to integers here! Any approximation is a loss of information. We should give to the backend as much information as possible, and trust that it will use that information to provide the best possible rendering on that device. Depending on the backend, that might go up to using antialias or advanced graphics tricks to make an advanced rendering of things not lying on pixel boundaries. Approximating here just gives less information to the backend, making the rendering worse. Even if the backend is just approximating to pixels, it would still be wrong to round _cellSize here, because rounding sizes of rectangles without considering the origin of the rectangles has been definitely found to be wrong and to cause incorrect rendering. The origin of the whole matrix is very likely a non-integer - if not originally, as a consequence of the fact that the user resized the window - so making the cell size integer does not cause drawing to be done on pixel boundaries anyway, and will actually make more difficult for the backend to render the rectangles properly since it will be drawing approximately rectangles which are already only an approximate description - and this first approximation having been done incorrectly too! - of what we really want to draw. */ _cellSize = NSMakeSize (frameRect.size.width/_numCols, frameRect.size.height/_numRows); } else { _cellSize = NSMakeSize (DEFAULT_CELL_WIDTH, DEFAULT_CELL_HEIGHT); } _intercell = NSMakeSize(1, 1); [self setAutosizesCells: YES]; [self setFrame: frameRect]; _tabKeyTraversesCells = YES; [self setBackgroundColor: [NSColor controlColor]]; [self setDrawsBackground: NO]; [self setCellBackgroundColor: [NSColor controlColor]]; [self setDrawsCellBackground: NO]; [self setSelectionByRect: YES]; _dottedRow = _dottedColumn = -1; if (_mode == NSRadioModeMatrix && _numRows > 0 && _numCols > 0) { [self selectCellAtRow: 0 column: 0]; } else { _selectedCell = nil; _selectedRow = _selectedColumn = -1; } } /**

Initializes and returns a new NSMatrix in the specified frame frameRect. The NSMatrixMode is specified by mode, the cell class used specified by classId and the number of rows and columns specified by rowsHigh and colsWide respectively

See Also: -initWithFrame:mode:prototype:numberOfRows:numberOfColumns:

*/ - (id) initWithFrame: (NSRect)frameRect mode: (NSMatrixMode)aMode cellClass: (Class)classId numberOfRows: (NSInteger)rowsHigh numberOfColumns: (NSInteger)colsWide { if ( ! ( self = [super initWithFrame: frameRect] ) ) return nil; [self setCellClass: classId]; [self _privateFrame: frameRect mode: aMode numberOfRows: rowsHigh numberOfColumns: colsWide]; return self; } /**

Initializes and returns a new NSMatrix in the specified frame frameRect. The NSMatrixMode is specified by mode, the cell used specified by aCell and the number of rows and columns specified by rowsHigh and colsWide respectively

See Also: -initWithFrame:mode:prototype:numberOfRows:numberOfColumns:

*/ - (id) initWithFrame: (NSRect)frameRect mode: (NSMatrixMode)aMode prototype: (NSCell*)aCell numberOfRows: (NSInteger)rowsHigh numberOfColumns: (NSInteger)colsWide { if (! ( self = [super initWithFrame: frameRect] ) ) return nil; [self setPrototype: aCell]; [self _privateFrame: frameRect mode: aMode numberOfRows: rowsHigh numberOfColumns: colsWide]; return self; } - (void) dealloc { int i; if (_textObject != nil) { [_selectedCell endEditing: _textObject]; _textObject = nil; } for (i = 0; i < _maxRows; i++) { int j; for (j = 0; j < _maxCols; j++) { [_cells[i][j] release]; } NSZoneFree(_myZone, _cells[i]); #if GS_WITH_GC _selectedCells[i] = 0; #else NSZoneFree(_myZone, _selectedCells[i]); #endif } NSZoneFree(_myZone, _cells); NSZoneFree(_myZone, _selectedCells); [_cellPrototype release]; [_backgroundColor release]; [_cellBackgroundColor release]; if (_delegate != nil) { [nc removeObserver: _delegate name: nil object: self]; _delegate = nil; } [super dealloc]; } /**

Inserts a new column after the current last column.

See Also: -insertColumn:withCells:

*/ - (void) addColumn { [self insertColumn: _numCols withCells: nil]; } /**

Inserts a new column of cells specified by cellArray after the current last column.

See Also: -insertColumn:withCells:

*/ - (void) addColumnWithCells: (NSArray*)cellArray { [self insertColumn: _numCols withCells: cellArray]; } /**

Inserts a new row after the current last row.

See Also: -insertRow:withCells:

*/ - (void) addRow { [self insertRow: _numRows withCells: nil]; } /**

Inserts a new row of cells specified by cellArray after the current last row.

See Also: -insertRow:withCells:

*/ - (void) addRowWithCells: (NSArray*)cellArray { [self insertRow: _numRows withCells: cellArray]; } /**

Inserts a new column at the specified column column.

See Also: -insertColumn:withCells:

*/ - (void) insertColumn: (NSInteger)column { [self insertColumn: column withCells: nil]; } /**

Inserts a new column of cells ( specified by cellArray) at the specified column column. This method can grows the matrix as necessay if needed

See Also: -insertColumn:

*/ - (void) insertColumn: (NSInteger)column withCells: (NSArray*)cellArray { int count = [cellArray count]; int i = _numCols + 1; if (column < 0) { column = 0; #if NSMATRIX_STRICT_CHECKING == 0 NSLog(@"insert negative column (%d) in matrix", (int)column); #else [NSException raise: NSRangeException format: @"insert negative column (%d) in matrix", (int)column]; #endif } if (column >= i) { i = column + 1; } /* * Use _renewRows:columns:rowSpace:colSpace: to grow the matrix as necessary. * MacOS-X docs say that if the matrix is empty, we make it have one column * and enough rows for all the elements. */ if (count > 0 && (_numRows == 0 || _numCols == 0)) { [self _renewRows: count columns: 1 rowSpace: 0 colSpace: count]; } else { [self _renewRows: _numRows ? _numRows : 1 columns: i rowSpace: 0 colSpace: count]; } /* * Rotate the new column to the insertion point if necessary. */ if (_numCols != column) { for (i = 0; i < _numRows; i++) { int j = _numCols; id old = _cells[i][j-1]; while (--j > column) { _cells[i][j] = _cells[i][j-1]; _selectedCells[i][j] = _selectedCells[i][j-1]; } _cells[i][column] = old; _selectedCells[i][column] = NO; } if (_selectedCell && (_selectedColumn >= column)) { _selectedColumn++; } if (_dottedColumn >= column) { _dottedColumn++; } } /* * Now put the new cells from the array into the matrix. */ if (count > 0) { IMP getImp = [cellArray methodForSelector: getSel]; for (i = 0; i < _numRows && i < count; i++) { ASSIGN(_cells[i][column], (*getImp)(cellArray, getSel, i)); } } if (_mode == NSRadioModeMatrix && _allowsEmptySelection == NO && _selectedCell == nil) [self selectCellAtRow: 0 column: 0]; } /**

Inserts a new row at index row.

See Also: -insertRow:withCells:

*/ - (void) insertRow: (NSInteger)row { [self insertRow: row withCells: nil]; } /**

Inserts a new row of cells ( specified by cellArray) at the specified row row. This method can grows the matrix as necessay if needed

See Also: -insertColumn:

*/ - (void) insertRow: (NSInteger)row withCells: (NSArray*)cellArray { int count = [cellArray count]; int i = _numRows + 1; if (row < 0) { row = 0; #if NSMATRIX_STRICT_CHECKING == 0 NSLog(@"insert negative row (%d) in matrix", (int)row); #else [NSException raise: NSRangeException format: @"insert negative row (%d) in matrix", (int)row]; #endif } if (row >= i) { i = row + 1; } /* * Grow the matrix to have the new row. * MacOS-X docs say that if the matrix is empty, we make it have one * row and enough columns for all the elements. */ if (count > 0 && (_numRows == 0 || _numCols == 0)) { [self _renewRows: 1 columns: count rowSpace: count colSpace: 0]; } else { [self _renewRows: i columns: _numCols ? _numCols : 1 rowSpace: count colSpace: 0]; } /* * Rotate the newly created row to the insertion point if necessary. */ if (_numRows != row) { id *oldr = _cells[_numRows - 1]; BOOL *olds = _selectedCells[_numRows - 1]; for (i = _numRows - 1; i > row; i--) { _cells[i] = _cells[i-1]; _selectedCells[i] = _selectedCells[i-1]; } _cells[row] = oldr; _selectedCells[row] = olds; if (_selectedCell && (_selectedRow >= row)) _selectedRow++; if (_dottedRow != -1 && _dottedRow >= row) _dottedRow++; } /* * Put cells from the array into the matrix. */ if (count > 0) { IMP getImp = [cellArray methodForSelector: getSel]; for (i = 0; i < _numCols && i < count; i++) { ASSIGN(_cells[row][i], (*getImp)(cellArray, getSel, i)); } } if (_mode == NSRadioModeMatrix && !_allowsEmptySelection && _selectedCell == nil) { [self selectCellAtRow: 0 column: 0]; } } /**

Makes and returns new cell at row row and column column.

*/ - (NSCell*) makeCellAtRow: (NSInteger)row column: (NSInteger)column { NSCell *aCell; if (_cellPrototype != nil) { aCell = (*_cellNew)(_cellPrototype, copySel, _myZone); } else { aCell = (*_cellNew)(_cellClass, allocSel, _myZone); if (aCell != nil) { aCell = (*_cellInit)(aCell, initSel); } } /* * This is only ever called when we are creating a new cell - so we know * we can simply assign a value into the matrix without releasing an old * value. If someone uses this method directly (which the documentation * specifically says they shouldn't) they may produce a memory leak. */ _cells[row][column] = aCell; return aCell; } /**

Returns the rectangle of the cell at row row and column column

*/ - (NSRect) cellFrameAtRow: (NSInteger)row column: (NSInteger)column { NSRect rect; rect.origin.x = column * (_cellSize.width + _intercell.width); rect.origin.y = row * (_cellSize.height + _intercell.height); rect.size = _cellSize; return rect; } /**

Gets the number of rows and columns of the NSMatrix

See Also: -numberOfColumns -numberOfRows

*/ - (void) getNumberOfRows: (NSInteger*)rowCount columns: (NSInteger*)columnCount { *rowCount = _numRows; *columnCount = _numCols; } /**

Replaces the NSMatrix's cell at row row and column column by newCell and mark for display the new cell. Raises a NSRangeException if the row or column are out of range.

*/ - (void) putCell: (NSCell*)newCell atRow: (NSInteger)row column: (NSInteger)column { if (row < 0 || row >= _numRows || column < 0 || column >= _numCols) { [NSException raise: NSRangeException format: @"attempt to put cell outside matrix bounds"]; } if ((row == _selectedRow) && (column == _selectedColumn) && (_selectedCell != nil)) { _selectedCell = newCell; } ASSIGN(_cells[row][column], newCell); [self setNeedsDisplayInRect: [self cellFrameAtRow: row column: column]]; } /**

Removes the NSMatrix's column at index column

See Also: -removeRow:

*/ - (void) removeColumn: (NSInteger)column { if (column >= 0 && column < _numCols) { int i; for (i = 0; i < _maxRows; i++) { int j; AUTORELEASE(_cells[i][column]); for (j = column + 1; j < _maxCols; j++) { _cells[i][j-1] = _cells[i][j]; _selectedCells[i][j-1] = _selectedCells[i][j]; } } _numCols--; _maxCols--; if (_maxCols == 0) { _numRows = _maxRows = 0; } if (column == _selectedColumn) { _selectedCell = nil; [self selectCellAtRow: _selectedRow column: 0]; } if (column == _dottedColumn) { if (_numCols && [_cells[_dottedRow][0] acceptsFirstResponder]) _dottedColumn = 0; else _dottedRow = _dottedColumn = -1; } } else { #if NSMATRIX_STRICT_CHECKING == 0 NSLog(@"remove non-existent column (%d) from matrix", (int) column); #else [NSException raise: NSRangeException format: @"remove non-existent column (%d) from matrix", (int)column]; #endif } } /**

Removes the NSMatrix's row at index row

See Also: -removeColumn:

*/ - (void) removeRow: (NSInteger)row { if (row >= 0 && row < _numRows) { int i; #if GS_WITH_GC == 0 for (i = 0; i < _maxCols; i++) { [_cells[row][i] autorelease]; } NSZoneFree(_myZone, _selectedCells[row]); #endif NSZoneFree(_myZone, _cells[row]); for (i = row + 1; i < _maxRows; i++) { _cells[i-1] = _cells[i]; _selectedCells[i-1] = _selectedCells[i]; } _maxRows--; _numRows--; if (_maxRows == 0) { _numCols = _maxCols = 0; } if (row == _selectedRow) { _selectedCell = nil; [self selectCellAtRow: 0 column: _selectedColumn]; } if (row == _dottedRow) { if (_numRows && [_cells[0][_dottedColumn] acceptsFirstResponder]) _dottedRow = 0; else _dottedRow = _dottedColumn = -1; } } else { #if NSMATRIX_STRICT_CHECKING == 0 NSLog(@"remove non-existent row (%d) from matrix", (int)row); #else [NSException raise: NSRangeException format: @"remove non-existent row (%d) from matrix", (int)row]; #endif } } - (void) renewRows: (NSInteger)newRows columns: (NSInteger)newColumns { [self _renewRows: newRows columns: newColumns rowSpace: 0 colSpace: 0]; } - (void) setCellSize: (NSSize)aSize { _cellSize = aSize; [self sizeToCells]; } /**

Sets the space size between cells to aSize and resizes the matrix to fits the new cells spacing.

See Also: -intercellSpacing -sizeToCells

*/ - (void) setIntercellSpacing: (NSSize)aSize { _intercell = aSize; [self sizeToCells]; } - (void) sortUsingFunction: (NSComparisonResult (*)(id element1, id element2, void *userData))comparator context: (void*)context { NSMutableArray *sorted; IMP add; IMP get; int i, j, index = 0; sorted = [NSMutableArray arrayWithCapacity: _numRows * _numCols]; add = [sorted methodForSelector: @selector(addObject:)]; get = [sorted methodForSelector: @selector(objectAtIndex:)]; for (i = 0; i < _numRows; i++) { for (j = 0; j < _numCols; j++) { (*add)(sorted, @selector(addObject:), _cells[i][j]); } } [sorted sortUsingFunction: comparator context: context]; for (i = 0; i < _numRows; i++) { for (j = 0; j < _numCols; j++) { _cells[i][j] = (*get)(sorted, @selector(objectAtIndex:), index++); } } } - (void) sortUsingSelector: (SEL)comparator { NSMutableArray *sorted; IMP add; IMP get; int i, j, index = 0; sorted = [NSMutableArray arrayWithCapacity: _numRows * _numCols]; add = [sorted methodForSelector: @selector(addObject:)]; get = [sorted methodForSelector: @selector(objectAtIndex:)]; for (i = 0; i < _numRows; i++) { for (j = 0; j < _numCols; j++) { (*add)(sorted, @selector(addObject:), _cells[i][j]); } } [sorted sortUsingSelector: comparator]; for (i = 0; i < _numRows; i++) { for (j = 0; j < _numCols; j++) { _cells[i][j] = (*get)(sorted, @selector(objectAtIndex:), index++); } } } /**

Gets the row and the column of the NSMatrix correponding to the specified NSPoint aPoint. Returns YES if aPoint is within the NSMatrix, NO otherwise

*/ - (BOOL) getRow: (NSInteger*)row column: (NSInteger*)column forPoint: (NSPoint)aPoint { BOOL betweenRows; BOOL betweenCols; BOOL beyondRows; BOOL beyondCols; int approxRow = aPoint.y / (_cellSize.height + _intercell.height); float approxRowsHeight = approxRow * (_cellSize.height + _intercell.height); int approxCol = aPoint.x / (_cellSize.width + _intercell.width); float approxColsWidth = approxCol * (_cellSize.width + _intercell.width); /* First check the limit cases - is the point outside the matrix */ beyondCols = (aPoint.x > _bounds.size.width || aPoint.x < 0); beyondRows = (aPoint.y > _bounds.size.height || aPoint.y < 0); /* Determine if the point is inside a cell - note: if the point lies on the cell boundaries, we consider it inside the cell. to be outside the cell (that is, in the intercell spacing) it must be completely in the intercell spacing - not on the border */ /* The following is non zero if the point lies between rows (not inside a cell) */ betweenRows = (aPoint.y < approxRowsHeight || aPoint.y > approxRowsHeight + _cellSize.height); betweenCols = (aPoint.x < approxColsWidth || aPoint.x > approxColsWidth + _cellSize.width); if (beyondRows || betweenRows || beyondCols || betweenCols || (_numCols == 0) || (_numRows == 0)) { if (row) { *row = -1; } if (column) { *column = -1; } return NO; } if (row) { if (approxRow < 0) { approxRow = 0; } else if (approxRow >= _numRows) { approxRow = _numRows - 1; } *row = approxRow; } if (column) { if (approxCol < 0) { approxCol = 0; } else if (approxCol >= _numCols) { approxCol = _numCols - 1; } *column = approxCol; } return YES; } /**

Gets the row and the column of the NSMatrix correponding to the specified NSCell aCell. Returns YES if aCell is in the NSMatrix, NO otherwise

*/ - (BOOL) getRow: (NSInteger*)row column: (NSInteger*)column ofCell: (NSCell*)aCell { int i; for (i = 0; i < _numRows; i++) { int j; for (j = 0; j < _numCols; j++) { if (_cells[i][j] == aCell) { if (row) *row = i; if (column) *column = j; return YES; } } } if (row) *row = -1; if (column) *column = -1; return NO; } /**

Sets the state of the cell at row row and column to value. If the NSMatrix's mode is NSRadioModeMatrix it deselects the cell currently selected if needed.

*/ - (void) setState: (NSInteger)value atRow: (NSInteger)row column: (NSInteger)column { NSCell *aCell = [self cellAtRow: row column: column]; if (!aCell) return; if (_mode == NSRadioModeMatrix) { if (value) { if (_selectedRow > -1 && _selectedColumn > -1) { _selectedCells[_selectedRow][_selectedColumn] = NO; [_selectedCell setState: NSOffState]; [self setNeedsDisplayInRect: [self cellFrameAtRow: _selectedRow column: _selectedColumn]]; } _selectedCell = aCell; _selectedRow = row; _selectedColumn = column; [_selectedCell setState: value]; _selectedCells[row][column] = YES; [self _setKeyRow: row column: column]; } else if (_allowsEmptySelection) { [self deselectSelectedCell]; } } else { [aCell setState: value]; } [self setNeedsDisplayInRect: [self cellFrameAtRow: row column: column]]; } /**

Deselects all NSMatrix's cells. Does nothing if the NSMatrix's mode is NSRadioModeMatrix and if it does not allows empty selection. Except for the case, when there are no cells left at all. Then the selection is always cleared.

See Also: -mode -allowsEmptySelection -setNeedsDisplayInRect:

*/ - (void) deselectAllCells { int i; if (_numRows > 0 && _numCols > 0 && !_allowsEmptySelection && _mode == NSRadioModeMatrix) return; for (i = 0; i < _numRows; i++) { int j; for (j = 0; j < _numCols; j++) { if (_selectedCells[i][j]) { NSCell *aCell = _cells[i][j]; BOOL isHighlighted = [aCell isHighlighted]; _selectedCells[i][j] = NO; if ([aCell state] || isHighlighted) { [aCell setState: NSOffState]; if (isHighlighted) { [aCell setHighlighted: NO]; } [self setNeedsDisplayInRect: [self cellFrameAtRow: i column: j]]; } } } } _selectedCell = nil; _selectedRow = -1; _selectedColumn = -1; } /**

Deselects the selected cell.Does nothing if the NSMatrix's mode is NSRadioModeMatrix and if it does not allows empty selection

*/ - (void) deselectSelectedCell { int i,j; if (!_selectedCell || (!_allowsEmptySelection && (_mode == NSRadioModeMatrix))) return; /* * For safety (as in macosx) */ for (i = 0; i < _numRows; i++) { for (j = 0; j < _numCols; j++) { if (_selectedCells[i][j]) { [_cells[i][j] setState: NSOffState]; _selectedCells[i][j] = NO; } } } _selectedCell = nil; _selectedRow = -1; _selectedColumn = -1; } /**

Selects all the cells and marks self for display. Does nothing if the NSMatrix's mode is NSRadioModeMatrix

See Also: -selectCellAtRow:column: -selectCell:

*/ - (void) selectAll: (id)sender { int i, j; /* Can't select all if only one can be selected. */ if (_mode == NSRadioModeMatrix) { return; } _selectedCell = nil; _selectedRow = -1; _selectedColumn = -1; for (i = 0; i < _numRows; i++) { for (j = 0; j < _numCols; j++) { if ([_cells[i][j] isEnabled] == YES && [_cells[i][j] isEditable] == NO) { _selectedCell = _cells[i][j]; [_selectedCell setState: NSOnState]; _selectedCells[i][j] = YES; _selectedRow = i; _selectedColumn = j; } else { _selectedCells[i][j] = NO; [_cells[i][j] setShowsFirstResponder: NO]; } } } [self setNeedsDisplay: YES]; } - (void) _selectCell: (NSCell *)aCell atRow: (int)row column: (int)column { if (aCell) { NSRect cellFrame; if (_selectedCell && _selectedCell != aCell) { if (_mode == NSRadioModeMatrix && _selectedRow > -1 && _selectedColumn > -1) { _selectedCells[_selectedRow][_selectedColumn] = NO; [_selectedCell setState: NSOffState]; } [self setNeedsDisplayInRect: [self cellFrameAtRow: _selectedRow column: _selectedColumn]]; } _selectedCell = aCell; _selectedRow = row; _selectedColumn = column; _selectedCells[row][column] = YES; if (_mode == NSListModeMatrix || _mode == NSRadioModeMatrix) { [_selectedCell setState: NSOnState]; } else { [_selectedCell setNextState]; } if (_mode == NSListModeMatrix) [aCell setHighlighted: YES]; cellFrame = [self cellFrameAtRow: row column: column]; if (_autoscroll) [self scrollRectToVisible: cellFrame]; [self setNeedsDisplayInRect: cellFrame]; [self _setKeyRow: row column: column]; } else { _selectedCell = nil; _selectedRow = _selectedColumn = -1; } } - (void) selectCell: (NSCell *)aCell { NSInteger row, column; if ([self getRow: &row column: &column ofCell: aCell] == YES) { [self _selectCell: aCell atRow: row column: column]; // Note: we select the cell iff it is 'selectable', not 'editable' // as macosx says. This looks definitely more appropriate. // [This is going to start editing only if the cell is also editable, // otherwise the text gets selected and that's all.] [self selectTextAtRow: row column: column]; } } /**

Selects the cell and the text inside at row row and column column. If row or column is -1 it deselects all the cells.

See Also: -deselectSelectedCell -selectTextAtRow:column:

*/ - (void) selectCellAtRow: (NSInteger)row column: (NSInteger)column { NSCell *aCell; if ((row == -1) || (column == -1)) { [self deselectAllCells]; return; } aCell = [self cellAtRow: row column: column]; if (aCell) { [self _selectCell: aCell atRow: row column: column]; [self selectTextAtRow: row column: column]; } } /**

Selects the cell (and the text inside) with tag anInt. Return YES if the NSMatrix contains a cell with tag anInt, NO otherwise.

See Also: -deselectSelectedCell -selectTextAtRow:column:

*/ - (BOOL) selectCellWithTag: (NSInteger)anInt { id aCell; int i = _numRows; while (i-- > 0) { int j = _numCols; while (j-- > 0) { aCell = _cells[i][j]; if ([aCell tag] == anInt) { [self _selectCell: aCell atRow: i column: j]; [self selectTextAtRow: i column: j]; return YES; } } } return NO; } /**

Returns an array of the selected cells

*/ - (NSArray*) selectedCells { NSMutableArray *array = [NSMutableArray array]; int i; for (i = 0; i < _numRows; i++) { int j; for (j = 0; j < _numCols; j++) { if (_selectedCells[i][j] == YES) { [array addObject: _cells[i][j]]; } } } return array; } - (void) setSelectionFrom: (NSInteger)startPos to: (NSInteger)endPos anchor: (NSInteger)anchorPos highlight: (BOOL)flag { /* Cells are selected from the anchor (A) to the point where the mouse * went down (S) and then they are selected (if the mouse moves away from A) * or deselected (if the mouse moves closer to A) until the point * where the mouse goes up (E). * This is inverted if flag is false (not sure about this though; if this is * changed, mouse tracking in list mode should be changed too). */ /* An easy way of doing this is unselecting all cells from A to S and then * selecting all cells from A to E. Let's try to do it in a more optimized * way.. */ /* Linear and rectangular selections are a bit different */ if (![self isSelectionByRect] || [self numberOfRows] == 1 || [self numberOfColumns] == 1) { /* Linear selection * There are three possibilities (ignoring direction): * A S E * sssssssssss * * A E S * ssssssuuuuu * * E A S * ssssssuuuuu * * So, cells from A to E are selected and, if S is outside the * range from A to E, cells from S to its closest point are unselected */ int selStart = MIN(anchorPos, endPos); int selEnd = MAX(anchorPos, endPos); [self _setState: flag ? NSOnState : NSOffState highlight: flag startIndex: selStart endIndex: selEnd]; if (startPos > selEnd) { [self _setState: flag ? NSOffState : NSOnState highlight: !flag startIndex: selEnd+1 endIndex: startPos]; } else if (startPos < selStart) { [self _setState: flag ? NSOffState : NSOnState highlight: !flag startIndex: startPos endIndex: selStart-1]; } } else { /* Rectangular selection * * A sss * S sss * E sss * * A ssu * E ssu * S uuu * * E ss * A ssu * S uu * * A ssu * S ssu * E ss * * So, cells of the rect from A to E are selected and cells of the * rect from A to S that are outside the first rect are unselected */ MPoint anchorPoint = POINT_FROM_INDEX(anchorPos); MPoint endPoint = POINT_FROM_INDEX(endPos); MPoint startPoint = POINT_FROM_INDEX(startPos); int minx_AE = MIN(anchorPoint.x, endPoint.x); int miny_AE = MIN(anchorPoint.y, endPoint.y); int maxx_AE = MAX(anchorPoint.x, endPoint.x); int maxy_AE = MAX(anchorPoint.y, endPoint.y); int minx_AS = MIN(anchorPoint.x, startPoint.x); int miny_AS = MIN(anchorPoint.y, startPoint.y); int maxx_AS = MAX(anchorPoint.x, startPoint.x); int maxy_AS = MAX(anchorPoint.y, startPoint.y); [self _setState: flag ? NSOnState : NSOffState highlight: flag startIndex: INDEX_FROM_COORDS(minx_AE, miny_AE) endIndex: INDEX_FROM_COORDS(maxx_AE, maxy_AE)]; if (startPoint.x > maxx_AE) { [self _setState: flag ? NSOffState : NSOnState highlight: !flag startIndex: INDEX_FROM_COORDS(maxx_AE+1, miny_AS) endIndex: INDEX_FROM_COORDS(startPoint.x, maxy_AS)]; } else if (startPoint.x < minx_AE) { [self _setState: flag ? NSOffState : NSOnState highlight: !flag startIndex: INDEX_FROM_COORDS(startPoint.x, miny_AS) endIndex: INDEX_FROM_COORDS(minx_AE-1, maxy_AS)]; } if (startPoint.y > maxy_AE) { [self _setState: flag ? NSOffState : NSOnState highlight: !flag startIndex: INDEX_FROM_COORDS(minx_AS, maxy_AE+1) endIndex: INDEX_FROM_COORDS(maxx_AS, startPoint.y)]; } else if (startPoint.y < miny_AE) { [self _setState: flag ? NSOffState : NSOnState highlight: !flag startIndex: INDEX_FROM_COORDS(minx_AS, startPoint.y) endIndex: INDEX_FROM_COORDS(maxx_AS, miny_AE-1)]; } } /* Update the _selectedCell and related ivars. This could be optimized a lot in many cases, but the full search cannot be avoided in the general case, and being correct comes first. */ { int i, j; for (i = _numRows - 1; i >= 0; i--) { for (j = _numCols - 1; j >= 0; j--) { if (_selectedCells[i][j]) { _selectedCell = _cells[i][j]; _selectedRow = i; _selectedColumn = j; return; } } } _selectedCell = nil; _selectedColumn = -1; _selectedRow = -1; } } /**

Returns the cell at row row and column column Returns nil if the row or column are out of range

*/ - (id) cellAtRow: (NSInteger)row column: (NSInteger)column { if (row < 0 || row >= _numRows || column < 0 || column >= _numCols) return nil; return _cells[row][column]; } /**

Returns the cell with tag anInt Returns nil if no cell has a tag anInt

*/ - (id) cellWithTag: (NSInteger)anInt { int i = _numRows; while (i-- > 0) { int j = _numCols; while (j-- > 0) { id aCell = _cells[i][j]; if ([aCell tag] == anInt) { return aCell; } } } return nil; } /**

Returns an array of the NSMatrix's cells

*/ - (NSArray*) cells { NSMutableArray *c; IMP add; int i; c = [NSMutableArray arrayWithCapacity: _numRows * _numCols]; add = [c methodForSelector: @selector(addObject:)]; for (i = 0; i < _numRows; i++) { int j; for (j = 0; j < _numCols; j++) { (*add)(c, @selector(addObject:), _cells[i][j]); } } return c; } - (void) selectText: (id)sender { // Attention, we are *not* doing what MacOS-X does. // But they are *not* doing what the OpenStep specification says. // This is a compromise -- and fully OpenStep compliant. NSSelectionDirection s = NSDirectSelection; if (_window) s = [_window keyViewSelectionDirection]; switch (s) { // _window selecting backwards case NSSelectingPrevious: [self _selectPreviousSelectableCellBeforeRow: _numRows column: _numCols]; break; // _Window selecting forward case NSSelectingNext: [self _selectNextSelectableCellAfterRow: -1 column: -1]; break; case NSDirectSelection: // Someone else -- we have some freedom here if ([_selectedCell isSelectable]) { [self selectTextAtRow: _selectedRow column: _selectedColumn]; } else { if (_dottedRow != -1) { [self selectTextAtRow: _dottedRow column: _dottedColumn]; } } break; } } /**

Select the text of the cell at row row and column column. The cell is selected if and only if the cell is selectable ( MacOSX select it if the cell is editable ). This methods returns the selected cell if exists and selectable, nil otherwise

*/ - (id) selectTextAtRow: (NSInteger)row column: (NSInteger)column { if (row < 0 || row >= _numRows || column < 0 || column >= _numCols) return self; // macosx doesn't select the cell if it isn't 'editable'; instead, // we select the cell if and only if it is 'selectable', which looks // more appropriate. This is going to start editing if and only if // the cell is also 'editable'. if ([_cells[row][column] isSelectable] == NO) return nil; if (_textObject) { if (_selectedCell == _cells[row][column]) { [_textObject selectAll: self]; return _selectedCell; } else { [self validateEditing]; [self abortEditing]; } } // Now _textObject == nil { NSText *text = [_window fieldEditor: YES forObject: self]; int length; if ([text superview] != nil) if ([text resignFirstResponder] == NO) return nil; [self _selectCell: _cells[row][column] atRow: row column: column]; /* See comment in NSTextField */ length = [[_selectedCell stringValue] length]; _textObject = [_selectedCell setUpFieldEditorAttributes: text]; [_selectedCell selectWithFrame: [self cellFrameAtRow: _selectedRow column: _selectedColumn] inView: self editor: _textObject delegate: self start: 0 length: length]; return _selectedCell; } } - (id) keyCell { if (_dottedRow == -1 || _dottedColumn == -1) { return nil; } else if (_cells != 0) { return _cells[_dottedRow][_dottedColumn]; } return nil; } - (void) setKeyCell: (NSCell *)aCell { BOOL isValid; NSInteger row, column; isValid = [self getRow: &row column: &column ofCell: aCell]; if (isValid == YES) { [self _setKeyRow: row column: column]; } } /**

Returns the next key view

See Also: -setNextText: [NSView-nextKeyView]

*/ - (id) nextText { return [self nextKeyView]; } /**

Returns the previous key view

See Also: -setPreviousText: [NSView-previousKeyView]

*/ - (id) previousText { return [self previousKeyView]; } /**

Invokes when the text cell starts to be editing.This methods posts a NSControlTextDidBeginEditingNotification with a dictionary containing the NSFieldEditor as user info

See Also: [NSNotificationCenter-postNotificationName:object:userInfo:]

*/ - (void) textDidBeginEditing: (NSNotification *)aNotification { [super textDidBeginEditing: aNotification]; } /**

Invokes when the text cell is changed. This methods posts a NSControlTextDidChangeNotification with a dictionary containing the NSFieldEditor as user info

See Also: [NSNotificationCenter-postNotificationName:object:userInfo:]

*/ - (void) textDidChange: (NSNotification *)aNotification { NSFormatter *formatter; // MacOS-X asks us to inform the cell if possible. if ((_selectedCell != nil) && [_selectedCell respondsToSelector: @selector(textDidChange:)]) [_selectedCell textDidChange: aNotification]; [super textDidChange: aNotification]; formatter = [_selectedCell formatter]; if (formatter != nil) { /* * FIXME: This part needs heavy interaction with the yet to finish * text system. * */ NSString *partialString; NSString *newString = nil; NSString *error = nil; BOOL wasAccepted; partialString = [_textObject string]; wasAccepted = [formatter isPartialStringValid: partialString newEditingString: &newString errorDescription: &error]; if (wasAccepted == NO) { SEL sel = @selector(control:didFailToValidatePartialString:errorDescription:); if ([_delegate respondsToSelector: sel]) { [_delegate control: self didFailToValidatePartialString: partialString errorDescription: error]; } } if (newString != nil) { NSLog (@"Unimplemented: should set string to %@", newString); // FIXME ! This would reset editing ! //[_textObject setString: newString]; } else { if (wasAccepted == NO) { // FIXME: Need to delete last typed character (?!) NSLog (@"Unimplemented: should delete last typed character"); } } } } /**

Invokes when the text cell is changed. This methods posts a NSControlTextDidEndEditingNotification a dictionary containing the NSFieldEditor as user info

See Also: [NSNotificationCenter-postNotificationName:object:userInfo:]

*/ - (void) textDidEndEditing: (NSNotification *)aNotification { id textMovement; [super textDidEndEditing: aNotification]; textMovement = [[aNotification userInfo] objectForKey: @"NSTextMovement"]; if (textMovement) { switch ([(NSNumber *)textMovement intValue]) { case NSReturnTextMovement: if ([self sendAction] == NO) { NSEvent *event = [_window currentEvent]; if ([self performKeyEquivalent: event] == NO && [_window performKeyEquivalent: event] == NO) [self selectText: self]; } break; case NSTabTextMovement: if ([_selectedCell sendsActionOnEndEditing]) [self sendAction]; if (_tabKeyTraversesCells) { if ([self _selectNextSelectableCellAfterRow: _selectedRow column: _selectedColumn]) break; } [_window selectKeyViewFollowingView: self]; if ([_window firstResponder] == _window) { if (_tabKeyTraversesCells) { if ([self _selectNextSelectableCellAfterRow: -1 column: -1]) break; } [self selectText: self]; } break; case NSBacktabTextMovement: if ([_selectedCell sendsActionOnEndEditing]) [self sendAction]; if (_tabKeyTraversesCells) { if ([self _selectPreviousSelectableCellBeforeRow: _selectedRow column: _selectedColumn]) break; } [_window selectKeyViewPrecedingView: self]; if ([_window firstResponder] == _window) { if (_tabKeyTraversesCells) { if ([self _selectPreviousSelectableCellBeforeRow: _numRows column: _numCols]) break; } [self selectText: self]; } break; } } } /**

Asks to the delegate (if it implements -control:textShouldBeginEditing: ) if the text should be edit. Returns YES if the delegate does not implement this method

*/ - (BOOL) textShouldBeginEditing: (NSText*)aTextObject { if (_delegate && [_delegate respondsToSelector: @selector(control:textShouldBeginEditing:)]) { return [_delegate control: self textShouldBeginEditing: aTextObject]; } return YES; } - (BOOL) textShouldEndEditing: (NSText *)aTextObject { if ([_selectedCell isEntryAcceptable: [aTextObject text]] == NO) { [self sendAction: _errorAction to: _target]; return NO; } if ([_delegate respondsToSelector: @selector(control:textShouldEndEditing:)]) { if ([_delegate control: self textShouldEndEditing: aTextObject] == NO) { NSBeep (); return NO; } } if ([_delegate respondsToSelector: @selector(control:isValidObject:)] == YES) { NSFormatter *formatter; id newObjectValue; formatter = [_selectedCell formatter]; if ([formatter getObjectValue: &newObjectValue forString: [_textObject text] errorDescription: NULL] == YES) { if ([_delegate control: self isValidObject: newObjectValue] == NO) return NO; } } // In all other cases return YES; } - (BOOL) tabKeyTraversesCells { return _tabKeyTraversesCells; } - (void) setTabKeyTraversesCells: (BOOL)flag { _tabKeyTraversesCells = flag; } /**

Sets the next key view to anObject

See Also: -nextText [NSView-setNextKeyView:

*/ - (void) setNextText: (id)anObject { [self setNextKeyView: anObject]; } /**

Sets the previous key view to anObject

See Also: -previousText [NSView-setPreviousKeyView:

*/ - (void) setPreviousText: (id)anObject { [self setPreviousKeyView: anObject]; } - (void) setValidateSize: (BOOL)flag { // TODO } - (void) sizeToCells { NSSize newSize; int nc = _numCols; int nr = _numRows; if (!nc) nc = 1; if (!nr) nr = 1; newSize.width = nc * (_cellSize.width + _intercell.width) - _intercell.width; newSize.height = nr * (_cellSize.height + _intercell.height) - _intercell.height; [super setFrameSize: newSize]; } - (void) sizeToFit { /* * A simple explanation of the logic behind this method. * * Example of when you would like to use this method: * you have a matrix containing radio buttons. Say that you have the * following radio buttons - * * * First option * * Second option * * Third option * * No thanks, no option for me * * this method should size the matrix so that it can comfortably * show all the cells it contains. To do it, we must consider that * all the cells should be given the same size, yet some cells need * more space than the others to show their contents, so we need to * choose the cell size as to be enough to display every cell. We * loop on all cells, call cellSize on each (which returns the * *minimum* comfortable size to display that cell), and choose a * final cellSize which is enough big to be bigger than all these * cellSizes. We resize the matrix to have that cellSize, and * that's it. */ NSSize newSize = NSZeroSize; int i, j; for (i = 0; i < _numRows; i++) { for (j = 0; j < _numCols; j++) { NSSize tempSize = [_cells[i][j] cellSize]; tempSize.height = ceil(tempSize.height); tempSize.width = ceil(tempSize.width); if (tempSize.width > newSize.width) { newSize.width = tempSize.width; } if (tempSize.height > newSize.height) { newSize.height = tempSize.height; } } } [self setCellSize: newSize]; } /**

Scrolls the NSMatrix to make the cell at row row and column column visible

See Also: -scrollRectToVisible: -cellFrameAtRow:column:

*/ - (void) scrollCellToVisibleAtRow: (NSInteger)row column: (NSInteger)column { [self scrollRectToVisible: [self cellFrameAtRow: row column: column]]; } - (void) setAutoscroll: (BOOL)flag { _autoscroll = flag; } - (void) setScrollable: (BOOL)flag { int i; for (i = 0; i < _numRows; i++) { int j; for (j = 0; j < _numCols; j++) { [_cells[i][j] setScrollable: flag]; } } [_cellPrototype setScrollable: flag]; } - (void) drawRect: (NSRect)rect { int i, j; int row1, col1; // The cell at the upper left corner int row2, col2; // The cell at the lower right corner if (_drawsBackground) { [_backgroundColor set]; NSRectFill(rect); } if (!_numRows || !_numCols) return; row1 = rect.origin.y / (_cellSize.height + _intercell.height); col1 = rect.origin.x / (_cellSize.width + _intercell.width); row2 = NSMaxY(rect) / (_cellSize.height + _intercell.height); col2 = NSMaxX(rect) / (_cellSize.width + _intercell.width); if (row1 < 0) row1 = 0; else if (row1 >= _numRows) row1 = _numRows - 1; if (col1 < 0) col1 = 0; else if (col1 >= _numCols) col1 = _numCols - 1; if (row2 < 0) row2 = 0; else if (row2 >= _numRows) row2 = _numRows - 1; if (col2 < 0) col2 = 0; else if (col2 >= _numCols) col2 = _numCols - 1; /* Draw the cells within the drawing rectangle. */ for (i = row1; i <= row2 && i < _numRows; i++) for (j = col1; j <= col2 && j < _numCols; j++) { [self drawCellAtRow: i column: j]; } } - (BOOL) isOpaque { return _drawsBackground; } - (void) drawCell: (NSCell *)aCell { NSInteger row, column; if ([self getRow: &row column: &column ofCell: aCell] == YES) { [self drawCellAtRow: row column: column]; } } /**

Draws the cell at row row and column column

See Also: [NSCell-drawWithFrame:inView:] -setDrawsCellBackground: -drawsCellBackground

*/ - (void) drawCellAtRow: (NSInteger)row column: (NSInteger)column { NSCell *aCell = [self cellAtRow: row column: column]; if (aCell) { NSRect cellFrame = [self cellFrameAtRow: row column: column]; if (_drawsCellBackground) { [_cellBackgroundColor set]; NSRectFill(cellFrame); } if (_dottedRow == row && _dottedColumn == column && [aCell acceptsFirstResponder] && [_window isKeyWindow] && [_window firstResponder] == self) { [aCell setShowsFirstResponder: YES]; [aCell drawWithFrame: cellFrame inView: self]; [aCell setShowsFirstResponder: NO]; } else { [aCell setShowsFirstResponder: NO]; [aCell drawWithFrame: cellFrame inView: self]; } } } /**

(Un)Highlights the cell (if exists ) at row at row row and column column. and maks the cell rect for display.

See Also: -setNeedsDisplayInRect: [NSCell-setHighlighted:]

*/ - (void) highlightCell: (BOOL)flag atRow: (NSInteger)row column: (NSInteger)column { NSCell *aCell = [self cellAtRow: row column: column]; if (aCell) { [aCell setHighlighted: flag]; [self setNeedsDisplayInRect: [self cellFrameAtRow: row column: column]]; } } /**

Sends the cell action, if a NSMatrix's cell is selected and enabled, sends the NSMatrix action otherwise. Returns YES if the action is succesfully sent. NO if a cell is selected but not enabled or if an action can not be sent.

See Also: -sendAction:to: -selectedCell

*/ - (BOOL) sendAction { if (_selectedCell) { if ([_selectedCell isEnabled] == NO) return NO; return [self sendAction: [_selectedCell action] to: [_selectedCell target]]; } // _selectedCell == nil return [super sendAction: _action to: _target]; } - (BOOL) sendAction: (SEL)theAction to: (id)theTarget { if (theAction) { if (theTarget) { return [super sendAction: theAction to: theTarget]; } else { return [super sendAction: theAction to: _target]; } } else { return [super sendAction: _action to: _target]; } } - (void) sendAction: (SEL)aSelector to: (id)anObject forAllCells: (BOOL)flag { int i; if (flag) { for (i = 0; i < _numRows; i++) { int j; for (j = 0; j < _numCols; j++) { if (![anObject performSelector: aSelector withObject: _cells[i][j]]) { return; } } } } else { for (i = 0; i < _numRows; i++) { int j; for (j = 0; j < _numCols; j++) { if (_selectedCells[i][j]) { if (![anObject performSelector: aSelector withObject: _cells[i][j]]) { return; } } } } } } /** */ - (void) sendDoubleAction { if ([_selectedCell isEnabled] == NO) return; if (_doubleAction) [self sendAction: _doubleAction to: _target]; else [self sendAction]; } /**

Returns NO if the NSMatrix's mode is NSListModeMatrix, YES otherwise.

See Also: -setMode: -mode

*/ - (BOOL) acceptsFirstMouse: (NSEvent*)theEvent { if (_mode == NSListModeMatrix) return NO; else return YES; } - (void) _mouseDownNonListMode: (NSEvent *)theEvent { BOOL mouseUpInCell = NO, onCell, scrolling = NO, mouseUp = NO; NSCell *mouseCell; NSInteger mouseRow; NSInteger mouseColumn; NSPoint mouseLocation; NSRect mouseCellFrame; NSCell *originallySelectedCell = _selectedCell; NSUInteger eventMask = NSLeftMouseUpMask | NSLeftMouseDownMask | NSMouseMovedMask | NSLeftMouseDraggedMask; while (!mouseUp) { mouseLocation = [self convertPoint: [theEvent locationInWindow] fromView: nil]; onCell = [self getRow: &mouseRow column: &mouseColumn forPoint: mouseLocation]; if (onCell) { mouseCellFrame = [self cellFrameAtRow: mouseRow column: mouseColumn]; mouseCell = [self cellAtRow: mouseRow column: mouseColumn]; if (_autoscroll) { scrolling = [self scrollRectToVisible: mouseCellFrame]; } if ([mouseCell isEnabled]) { int old_state; /* Select the cell before tracking. The cell can send its action * during tracking, and the target discovers which cell was * clicked calling selectedCell. * The cell calls -nextState before sending the action, so its * state should not be changed here (except in radio mode). */ old_state = [mouseCell state]; [self _selectCell: mouseCell atRow: mouseRow column: mouseColumn]; if (_mode == NSRadioModeMatrix && !_allowsEmptySelection) { [mouseCell setState: NSOffState]; } else { [mouseCell setState: old_state]; } if (_mode != NSTrackModeMatrix) { [self highlightCell: YES atRow: mouseRow column: mouseColumn]; } mouseUpInCell = [mouseCell trackMouse: theEvent inRect: mouseCellFrame ofView: self untilMouseUp: [[mouseCell class] prefersTrackingUntilMouseUp]]; if (_mode != NSTrackModeMatrix) { [self highlightCell: NO atRow: mouseRow column: mouseColumn]; } else { if ([mouseCell state] != old_state) { [self setNeedsDisplayInRect: mouseCellFrame]; } } mouseUp = mouseUpInCell || ([[NSApp currentEvent] type] == NSLeftMouseUp); if (!mouseUpInCell) { _selectedCells[_selectedRow][_selectedColumn] = NO; _selectedCell = nil; _selectedRow = _selectedColumn = -1; } } } // if mouse didn't go up, take next event if (!mouseUp) { NSEvent *newEvent; newEvent = [NSApp nextEventMatchingMask: eventMask untilDate: !scrolling ? [NSDate distantFuture] : [NSDate dateWithTimeIntervalSinceNow: 0.05] inMode: NSEventTrackingRunLoopMode dequeue: YES]; if (newEvent != nil) { theEvent = newEvent; mouseUp = ([theEvent type] == NSLeftMouseUp); } } } if (!mouseUpInCell) { if (_mode == NSRadioModeMatrix && !_allowsEmptySelection) { [self selectCell: originallySelectedCell]; } [self sendAction]; /* like OPENSTEP, unlike MacOSX */ } } - (void) _mouseDownListMode: (NSEvent *) theEvent { NSPoint locationInWindow, mouseLocation; NSInteger mouseRow, mouseColumn; NSInteger mouseIndex, previousIndex = 0, anchor = 0; id mouseCell, previousCell = nil; BOOL onCell; BOOL isSelecting = YES; NSUInteger eventMask = NSLeftMouseUpMask | NSLeftMouseDownMask | NSMouseMovedMask | NSLeftMouseDraggedMask | NSPeriodicMask; // List mode // multiple cells can be selected, dragging the mouse // cells do not track the mouse // shift key makes expands selection noncontiguously // alternate key expands selection contiguously // implementation based on OS 4.2 behaviour, that is different from MacOS X if (_autoscroll) { [NSEvent startPeriodicEventsAfterDelay: 0.05 withPeriod: 0.05]; } locationInWindow = [theEvent locationInWindow]; while ([theEvent type] != NSLeftMouseUp) { // must convert location each time or periodic events won't work well mouseLocation = [self convertPoint: locationInWindow fromView: nil]; onCell = [self getRow: &mouseRow column: &mouseColumn forPoint: mouseLocation]; if (onCell) { mouseCell = [self cellAtRow: mouseRow column: mouseColumn]; mouseIndex = INDEX_FROM_COORDS(mouseColumn, mouseRow); if (_autoscroll) { NSRect mouseRect; mouseRect = [self cellFrameAtRow: mouseRow column: mouseColumn]; [self scrollRectToVisible: mouseRect]; } if (mouseCell != previousCell && [mouseCell isEnabled] == YES) { if (!previousCell) { // When the user first clicks on a cell // we clear the existing selection // unless the Alternate or Shift keys have been pressed. if (!(mouseDownFlags & NSShiftKeyMask) && !(mouseDownFlags & NSAlternateKeyMask)) { [self deselectAllCells]; } /* The clicked cell is the anchor of the selection, unless * the Alternate key is pressed, when the anchor is made * the key cell, from which the selection will be * extended (this is probably not the best cell when * selection is by rect) */ if (!(mouseDownFlags & NSAlternateKeyMask)) { anchor = INDEX_FROM_COORDS(mouseColumn, mouseRow); } else { if (_dottedColumn != -1) anchor = INDEX_FROM_COORDS(_dottedColumn, _dottedRow); else anchor = INDEX_FROM_COORDS(0, 0); } /* With the shift key pressed, clicking on a selected cell * deselects it (and inverts the selection on mouse dragging). */ if (mouseDownFlags & NSShiftKeyMask) { isSelecting = ([mouseCell state] == NSOffState); } else { isSelecting = YES; } previousIndex = mouseIndex; } [self setSelectionFrom: previousIndex to: mouseIndex anchor: anchor highlight: isSelecting]; [self _setKeyRow: mouseRow column: mouseColumn]; previousIndex = mouseIndex; previousCell = mouseCell; } } theEvent = [NSApp nextEventMatchingMask: eventMask untilDate: [NSDate distantFuture] inMode: NSEventTrackingRunLoopMode dequeue: YES]; NSDebugLLog(@"NSMatrix", @"matrix: got event of type: %d\n", (int)[theEvent type]); if ([theEvent type] != NSPeriodic) { locationInWindow = [theEvent locationInWindow]; } } if (_autoscroll) { [NSEvent stopPeriodicEvents]; } [self sendAction]; } - (void) mouseDown: (NSEvent*)theEvent { NSInteger row, column; NSPoint lastLocation = [theEvent locationInWindow]; int clickCount; /* * Pathological case -- ignore mouse down */ if ((_numRows == 0) || (_numCols == 0)) { [super mouseDown: theEvent]; return; } // Manage multi-click events clickCount = [theEvent clickCount]; if (clickCount > 2) return; if (clickCount == 2 && (_ignoresMultiClick == NO)) { [self sendDoubleAction]; return; } // From now on, code to manage simple-click events lastLocation = [self convertPoint: lastLocation fromView: nil]; // If mouse down was on a selectable cell, start editing/selecting. if ([self getRow: &row column: &column forPoint: lastLocation]) { if ([_cells[row][column] isEnabled]) { if ([_cells[row][column] isSelectable]) { NSText* t = [_window fieldEditor: YES forObject: self]; if ([t superview] != nil) { if ([t resignFirstResponder] == NO) { if ([_window makeFirstResponder: _window] == NO) return; } } // During editing, the selected cell is the cell being edited [self _selectCell: _cells[row][column] atRow: row column: column]; _textObject = [_selectedCell setUpFieldEditorAttributes: t]; [_selectedCell editWithFrame: [self cellFrameAtRow: row column: column] inView: self editor: _textObject delegate: self event: theEvent]; return; } } } // Paranoia check -- _textObject should already be nil, since we // accept first responder, so NSWindow should have already given // us first responder status (thus already ending editing with _textObject). if (_textObject) { NSLog (@"Hi, I am a bug."); [self validateEditing]; [self abortEditing]; } mouseDownFlags = [theEvent modifierFlags]; if (_mode != NSListModeMatrix) { [self _mouseDownNonListMode: theEvent]; } else { [self _mouseDownListMode: theEvent]; } } - (void) updateCell: (NSCell*)aCell { NSInteger row, col; NSRect rect; if ([self getRow: &row column: &col ofCell: aCell] == NO) return; // Not a cell in this matrix - we can't update it. rect = [self cellFrameAtRow: row column: col]; [self setNeedsDisplayInRect: rect]; } /**

Simulates a mouse click for the first cell with the corresponding key Equivalent.

See Also: [NSCell-keyEquivalent]

*/ - (BOOL) performKeyEquivalent: (NSEvent*)theEvent { NSString *keyEquivalent = [theEvent charactersIgnoringModifiers]; NSUInteger modifiers = [theEvent modifierFlags]; int i; NSUInteger relevantModifiersMask = NSCommandKeyMask | NSAlternateKeyMask | NSControlKeyMask; /* Take shift key into account only for control keys and arrow and function keys */ if ((modifiers & NSFunctionKeyMask) || ([keyEquivalent length] > 0 && [[NSCharacterSet controlCharacterSet] characterIsMember:[keyEquivalent characterAtIndex:0]])) relevantModifiersMask |= NSShiftKeyMask; if ([keyEquivalent length] == 0) return NO; // don't respond to zero-length string (such as the Windows key) for (i = 0; i < _numRows; i++) { int j; for (j = 0; j < _numCols; j++) { NSCell *aCell = _cells[i][j]; NSUInteger mask = 0; if ([aCell respondsToSelector:@selector(keyEquivalentModifierMask)]) mask = [(NSButtonCell *)aCell keyEquivalentModifierMask]; if ([aCell isEnabled] && [[aCell keyEquivalent] isEqualToString: keyEquivalent] && (mask & relevantModifiersMask) == (modifiers & relevantModifiersMask)) { NSCell *oldSelectedCell = _selectedCell; int oldSelectedRow = _selectedRow; int oldSelectedColumn = _selectedColumn; _selectedCell = aCell; [self lockFocus]; [self highlightCell: YES atRow: i column: j]; [_window flushWindow]; [aCell setNextState]; [self sendAction]; [self highlightCell: NO atRow: i column: j]; [self unlockFocus]; _selectedCell = oldSelectedCell; _selectedRow = oldSelectedRow; _selectedColumn = oldSelectedColumn; return YES; } } } return NO; } - (void) resetCursorRects { int i; for (i = 0; i < _numRows; i++) { int j; for (j = 0; j < _numCols; j++) { NSCell *aCell = _cells[i][j]; [aCell resetCursorRect: [self cellFrameAtRow: i column: j] inView: self]; } } } - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { GSMatrixFlags matrixFlags; unsigned int mFlags = 0; [aCoder encodeObject: [self backgroundColor] forKey: @"NSBackgroundColor"]; [aCoder encodeObject: [self cellBackgroundColor] forKey: @"NSCellBackgroundColor"]; [aCoder encodeObject: [self prototype] forKey: @"NSProtoCell"]; [aCoder encodeObject: NSStringFromClass([self cellClass]) forKey: @"NSCellClass"]; [aCoder encodeSize: _cellSize forKey: @"NSCellSize"]; [aCoder encodeSize: _intercell forKey: @"NSIntercellSpacing"]; /// set the flags... matrixFlags.isRadio = ([self mode] == NSRadioModeMatrix); matrixFlags.isList = ([self mode] == NSListModeMatrix); matrixFlags.isHighlight = ([self mode] == NSHighlightModeMatrix); matrixFlags.allowsEmptySelection = [self allowsEmptySelection]; matrixFlags.selectionByRect = [self isSelectionByRect]; matrixFlags.drawCellBackground = [self drawsCellBackground]; matrixFlags.drawBackground = [self drawsBackground]; matrixFlags.tabKeyTraversesCells = _tabKeyTraversesCells; matrixFlags.autosizesCells = _autosizesCells; // clear unused... matrixFlags.autoScroll = 0; matrixFlags.drawingAncestor = 0; matrixFlags.tabKeyTraversesCellsExplicitly = 0; matrixFlags.canSearchIncrementally = 0; matrixFlags.unused = 0; memcpy((void *)&mFlags,(void *)&matrixFlags,sizeof(unsigned int)); [aCoder encodeInt: mFlags forKey: @"NSMatrixFlags"]; [aCoder encodeInt: _numCols forKey: @"NSNumCols"]; [aCoder encodeInt: _numRows forKey: @"NSNumRows"]; [aCoder encodeObject: [self cells] forKey: @"NSCells"]; [aCoder encodeInt: _selectedColumn forKey: @"NSSelectedCol"]; [aCoder encodeInt: _selectedRow forKey: @"NSSelectedRow"]; } else { [aCoder encodeValueOfObjCType: @encode (int) at: &_mode]; [aCoder encodeValueOfObjCType: @encode (BOOL) at: &_allowsEmptySelection]; [aCoder encodeValueOfObjCType: @encode (BOOL) at: &_selectionByRect]; [aCoder encodeValueOfObjCType: @encode (BOOL) at: &_autosizesCells]; [aCoder encodeValueOfObjCType: @encode (BOOL) at: &_autoscroll]; [aCoder encodeSize: _cellSize]; [aCoder encodeSize: _intercell]; [aCoder encodeObject: _backgroundColor]; [aCoder encodeObject: _cellBackgroundColor]; [aCoder encodeValueOfObjCType: @encode (BOOL) at: &_drawsBackground]; [aCoder encodeValueOfObjCType: @encode (BOOL) at: &_drawsCellBackground]; [aCoder encodeObject: NSStringFromClass (_cellClass)]; [aCoder encodeObject: _cellPrototype]; [aCoder encodeValueOfObjCType: @encode (int) at: &_numRows]; [aCoder encodeValueOfObjCType: @encode (int) at: &_numCols]; /* This is slower, but does not expose NSMatrix internals and will work with subclasses */ [aCoder encodeObject: [self cells]]; [aCoder encodeConditionalObject: _delegate]; [aCoder encodeConditionalObject: _target]; [aCoder encodeValueOfObjCType: @encode (SEL) at: &_action]; [aCoder encodeValueOfObjCType: @encode (SEL) at: &_doubleAction]; [aCoder encodeValueOfObjCType: @encode (SEL) at: &_errorAction]; [aCoder encodeValueOfObjCType: @encode (BOOL) at: &_tabKeyTraversesCells]; [aCoder encodeObject: [self keyCell]]; /* We do not encode information on selected cells, because this is saved with the cells themselves */ } } - (id) initWithCoder: (NSCoder*)aDecoder { Class class; id cell; int rows = 0, columns = 0; NSArray *array; int i = 0, count = 0; self = [super initWithCoder: aDecoder]; if (!self) return nil; if ([aDecoder allowsKeyedCoding]) { if ([aDecoder containsValueForKey: @"NSBackgroundColor"]) { [self setBackgroundColor: [aDecoder decodeObjectForKey: @"NSBackgroundColor"]]; } if ([aDecoder containsValueForKey: @"NSCellBackgroundColor"]) { [self setCellBackgroundColor: [aDecoder decodeObjectForKey: @"NSCellBackgroundColor"]]; } if ([aDecoder containsValueForKey: @"NSProtoCell"]) { [self setPrototype: [aDecoder decodeObjectForKey: @"NSProtoCell"]]; } if ([aDecoder containsValueForKey: @"NSCellClass"]) { class = NSClassFromString((NSString *)[aDecoder decodeObjectForKey: @"NSCellClass"]); if (class != Nil) { [self setCellClass: class]; } } if ([aDecoder containsValueForKey: @"NSCellSize"]) { // Don't use method here as this would change the frame _cellSize = [aDecoder decodeSizeForKey: @"NSCellSize"]; } if ([aDecoder containsValueForKey: @"NSIntercellSpacing"]) { // Don't use method here as this would change the frame _intercell = [aDecoder decodeSizeForKey: @"NSIntercellSpacing"]; } if ([aDecoder containsValueForKey: @"NSMatrixFlags"]) { int mFlags = [aDecoder decodeIntForKey: @"NSMatrixFlags"]; GSMatrixFlags matrixFlags; memcpy((void *)&matrixFlags,(void *)&mFlags,sizeof(struct _GSMatrixFlags)); if (matrixFlags.isRadio) { [self setMode: NSRadioModeMatrix]; } else if (matrixFlags.isList) { [self setMode: NSListModeMatrix]; } else if (matrixFlags.isHighlight) { [self setMode: NSHighlightModeMatrix]; } [self setAllowsEmptySelection: matrixFlags.allowsEmptySelection]; [self setSelectionByRect: matrixFlags.selectionByRect]; [self setDrawsCellBackground: matrixFlags.drawCellBackground]; [self setDrawsBackground: matrixFlags.drawBackground]; _autosizesCells = matrixFlags.autosizesCells; _tabKeyTraversesCells = matrixFlags.tabKeyTraversesCells; } if ([aDecoder containsValueForKey: @"NSNumCols"]) { columns = [aDecoder decodeIntForKey: @"NSNumCols"]; } if ([aDecoder containsValueForKey: @"NSNumRows"]) { rows = [aDecoder decodeIntForKey: @"NSNumRows"]; } array = [aDecoder decodeObjectForKey: @"NSCells"]; [self renewRows: rows columns: columns]; count = [array count]; if (count != rows * columns) { NSLog (@"Trying to decode an invalid NSMatrix: cell number does not fit matrix dimension"); // Quick fix to do what we can if (count > rows * columns) { count = rows * columns; } } _selectedRow = _selectedColumn = -1; for (i = 0; i < count; i++) { int row, column; cell = [array objectAtIndex: i]; row = i / columns; column = i % columns; [self putCell: cell atRow: row column: column]; if ([cell state]) { [self selectCellAtRow: row column: column]; } } // mis-use these variables for selection rows = -1; columns = -1; if ([aDecoder containsValueForKey: @"NSSelectedCol"]) { columns = [aDecoder decodeIntForKey: @"NSSelectedCol"]; } if ([aDecoder containsValueForKey: @"NSSelectedRow"]) { rows = [aDecoder decodeIntForKey: @"NSSelectedRow"]; } if ((rows != -1) && (columns != -1)) [self selectCellAtRow: rows column: columns]; } else { _myZone = [self zone]; [aDecoder decodeValueOfObjCType: @encode (int) at: &_mode]; [aDecoder decodeValueOfObjCType: @encode (BOOL) at: &_allowsEmptySelection]; [aDecoder decodeValueOfObjCType: @encode (BOOL) at: &_selectionByRect]; [aDecoder decodeValueOfObjCType: @encode (BOOL) at: &_autosizesCells]; [aDecoder decodeValueOfObjCType: @encode (BOOL) at: &_autoscroll]; _cellSize = [aDecoder decodeSize]; _intercell = [aDecoder decodeSize]; [aDecoder decodeValueOfObjCType: @encode (id) at: &_backgroundColor]; [aDecoder decodeValueOfObjCType: @encode (id) at: &_cellBackgroundColor]; [aDecoder decodeValueOfObjCType: @encode (BOOL) at: &_drawsBackground]; [aDecoder decodeValueOfObjCType: @encode (BOOL) at: &_drawsCellBackground]; class = NSClassFromString ((NSString *)[aDecoder decodeObject]); if (class != Nil) { [self setCellClass: class]; } cell = [aDecoder decodeObject]; if (cell != nil) { [self setPrototype: cell]; } if (_cellPrototype == nil) { [self setCellClass: [object_getClass(self) cellClass]]; } [aDecoder decodeValueOfObjCType: @encode (int) at: &rows]; [aDecoder decodeValueOfObjCType: @encode (int) at: &columns]; /* NB: This works without changes for NSForm */ array = [aDecoder decodeObject]; [self renewRows: rows columns: columns]; count = [array count]; if (count != rows * columns) { NSLog (@"Trying to decode an invalid NSMatrix: cell number does not fit matrix dimension"); // Quick fix to do what we can if (count > rows * columns) { count = rows * columns; } } _selectedRow = _selectedColumn = -1; for (i = 0; i < count; i++) { int row, column; cell = [array objectAtIndex: i]; row = i / columns; column = i % columns; [self putCell: cell atRow: row column: column]; if ([cell state]) { [self selectCellAtRow: row column: column]; } } [aDecoder decodeValueOfObjCType: @encode (id) at: &_delegate]; [aDecoder decodeValueOfObjCType: @encode (id) at: &_target]; [aDecoder decodeValueOfObjCType: @encode (SEL) at: &_action]; [aDecoder decodeValueOfObjCType: @encode (SEL) at: &_doubleAction]; [aDecoder decodeValueOfObjCType: @encode (SEL) at: &_errorAction]; [aDecoder decodeValueOfObjCType: @encode (BOOL) at: &_tabKeyTraversesCells]; [self setKeyCell: [aDecoder decodeObject]]; } return self; } /**

Sets the NSMatrix's mode to aMode. See NSMatrixMode for more informations. By default the mode is NSRadioModeMatrix.

See Also: -setMode:

*/ - (void) setMode: (NSMatrixMode)aMode { _mode = aMode; } /**

Returns the NSMatrix's mode. See NSMatrixMode for more informations. By default the mode is NSRadioModeMatrix.

See Also: -setMode:

*/ - (NSMatrixMode) mode { return _mode; } /**

Sets the cell class used by the NSMatrix when it creates new cells to classId. The default cell class is a NSActionCell class

See Also: -cellClass -setPrototype: -prototype

*/ - (void) setCellClass: (Class)classId { _cellClass = classId; if (_cellClass == nil) { _cellClass = defaultCellClass; } _cellNew = [_cellClass methodForSelector: allocSel]; _cellInit = [_cellClass instanceMethodForSelector: initSel]; DESTROY(_cellPrototype); } /**

Returns the cell class used by the NSMatrix when it creates new cells. The default cell class is a NSActionCell class

See Also: -setCellClass: -setPrototype: -prototype

*/ - (Class) cellClass { return _cellClass; } /**

Sets the prototype cell used by the NSMatrix when it creates new cells to aCell. The default cell is NSActionCell

See Also: -cellClass -setPrototype: -prototype

*/ - (void) setPrototype: (NSCell*)aCell { ASSIGN(_cellPrototype, aCell); if (_cellPrototype == nil) { [self setCellClass: defaultCellClass]; } else { _cellNew = [_cellPrototype methodForSelector: copySel]; _cellInit = 0; _cellClass = [aCell class]; } } /**

Returns the prototype cell used by the NSMatrix when it creates new cells. The default cell is NSActionCell

See Also: -cellClass -setPrototype: -prototype

*/ - (id) prototype { return _cellPrototype; } /**

Returns the size of the NSMatrix's cells

See Also: -setCellSize:

*/ - (NSSize) cellSize { return _cellSize; } /**

Returns the space size between cells.

See Also: -setIntercellSpacing:

*/ - (NSSize) intercellSpacing { return _intercell; } /**

Sets the background color to aColor and marks self for display. The background color is used to display the NSMatrix color ( the space between the cells), not the cells ( uses -setCellBackgroundColor: for that)

See Also: -backgroundColor -setCellBackgroundColor: -cellBackgroundColor -drawsBackground -setDrawsBackground:

*/ - (void) setBackgroundColor: (NSColor*)aColor { ASSIGN(_backgroundColor, aColor); [self setNeedsDisplay: YES]; } /**

Returns the background color The background color is used to display the NSMatrix color ( the space between the cells), not the cells ( uses -setCellBackgroundColor: for that)

See Also: -setBackgroundColor: -setCellBackgroundColor: -cellBackgroundColor -drawsBackground -setDrawsBackground:

*/ - (NSColor*) backgroundColor { return _backgroundColor; } /**

Sets the background color of the NSMatrix's cells to aColor and marks self for display.

See Also: -cellBackgroundColor -backgroundColor -setBackgroundColor: -setDrawsCellBackground: -drawsCellBackground

*/ - (void) setCellBackgroundColor: (NSColor*)aColor { ASSIGN(_cellBackgroundColor, aColor); [self setNeedsDisplay: YES]; } /**

Returns the background color of the NSMatrix's cells.

See Also: -setCellBackgroundColor: -backgroundColor -setBackgroundColor:

*/ - (NSColor*) cellBackgroundColor { return _cellBackgroundColor; } /**

Sets the delegate to anObject. The delegate is used when editing a cell

See Also: -delegate -textDidEndEditing: -textDidBeginEditing: -textDidChange:

*/ - (void) setDelegate: (id)anObject { if (_delegate) [nc removeObserver: _delegate name: nil object: self]; _delegate = anObject; #define SET_DELEGATE_NOTIFICATION(notif_name) \ if ([_delegate respondsToSelector: @selector(controlText##notif_name:)]) \ [nc addObserver: _delegate \ selector: @selector(controlText##notif_name:) \ name: NSControlText##notif_name##Notification object: self] if (_delegate) { SET_DELEGATE_NOTIFICATION(DidBeginEditing); SET_DELEGATE_NOTIFICATION(DidEndEditing); SET_DELEGATE_NOTIFICATION(DidChange); } } /**

Returns the NSMatrix's delegate. delegate is used when editing a cell

See Also: -setDelegate: -textDidEndEditing: -textDidBeginEditing: -textDidChange:

*/ - (id) delegate { return _delegate; } - (void) setTarget: anObject { _target = anObject; } - (id) target { return _target; } /** * Sets the message to send when a single click occurs.
*/ - (void) setAction: (SEL)aSelector { _action = aSelector; } - (SEL) action { return _action; } /**

Sets the message to send when a double click occurs. NB: In GNUstep the following method does *not* set ignoresMultiClick to NO as in the MacOS-X spec. It simply sets the doubleAction, as in OpenStep spec.

-doubleAction

*/ - (void) setDoubleAction: (SEL)aSelector { _doubleAction = aSelector; } /**

Returns the action method, used when the user double clicks

See Also: -setDoubleAction:

*/ - (SEL) doubleAction { return _doubleAction; } /**

Sets the error action method to aSelector. This error method is used when in -textShouldEndEditing: if the selected cell doe not have a valid text object

See Also: -errorAction

*/ - (void) setErrorAction: (SEL)aSelector { _errorAction = aSelector; } /**

Returns the error action method to aSelectorThis error method is used when in -textShouldEndEditing: if the selected cell doe not have a valid text object

See Also: -setErrorAction:

*/ - (SEL) errorAction { return _errorAction; } /**

Enables or disables all cells of the receiver.

*/ - (void) setEnabled: (BOOL)flag { int i, j; for (i = 0; i < _numRows; i++) { for (j = 0; j < _numCols; j++) { [_cells[i][j] setEnabled: flag]; } } } /**

Sets a flag to indicate whether the matrix should permit empty selections or should force one or mor cells to be selected at all times.

See Also: -allowsEmptySelection

*/ - (void) setAllowsEmptySelection: (BOOL)flag { _allowsEmptySelection = flag; } /**

Returns whether the matrix should permit empty selections or should force one or mor cells to be selected at all times.

See Also: -setAllowsEmptySelection:

*/ - (BOOL) allowsEmptySelection { return _allowsEmptySelection; } - (void) setSelectionByRect: (BOOL)flag { _selectionByRect = flag; } /** */ - (BOOL) isSelectionByRect { return _selectionByRect; } /**

Sets whether the NSMatrix draws its background and marks self for display.

See Also: -drawsBackground -setDrawsCellBackground:

*/ - (void) setDrawsBackground: (BOOL)flag { _drawsBackground = flag; [self setNeedsDisplay: YES]; } /**

Returns whether the NSMatrix draws its background

See Also: -setDrawsBackground: -drawsCellBackground

*/ - (BOOL) drawsBackground { return _drawsBackground; } /**

Sets whether the NSMatrix draws cells backgrounds and marks self for display

See Also: -drawsCellBackground -setDrawsBackground:

*/ - (void) setDrawsCellBackground: (BOOL)flag { _drawsCellBackground = flag; [self setNeedsDisplay: YES]; } /**

Returns whether the NSMatrix draws cells backgrounds

See Also: -setDrawsCellBackground: -drawsBackground

*/ - (BOOL) drawsCellBackground { return _drawsCellBackground; } /**

Sets whether the NSMatrix resizes its cells automatically

See Also: -autosizesCells

*/ - (void) setAutosizesCells: (BOOL)flag { _autosizesCells = flag; } /**

Returns whether the NSMatrix resizes its cells automatically

See Also: -autosizesCells

*/ - (BOOL) autosizesCells { return _autosizesCells; } - (BOOL) isAutoscroll { return _autoscroll; } /**

Returns the number of rows of the NSMatrix

See Also: -numberOfColumns

*/ - (NSInteger) numberOfRows { return _numRows; } /**

Returns the number of columns of the NSMatrix

See Also: -numberOfRows

*/ - (NSInteger) numberOfColumns { return _numCols; } - (id) selectedCell { return _selectedCell; } /**

Returns the column number of the selected cell or -1 if no cell is selected

See Also: -selectedRow -selectedCell

*/ - (NSInteger) selectedColumn { return _selectedColumn; } /**

Returns the row number of the selected cell or -1 if no cell is selected

See Also: -selectedColumn -selectedCell

*/ - (NSInteger) selectedRow { return _selectedRow; } - (NSInteger) mouseDownFlags { return mouseDownFlags; } - (BOOL) isFlipped { return YES; } - (void) _rebuildLayoutAfterResizing { if (_autosizesCells) { /* Keep the intercell as it is, and adjust the cell size to fit. */ if (_numRows > 1) { _cellSize.height = _bounds.size.height - ((_numRows - 1) * _intercell.height); _cellSize.height = _cellSize.height / _numRows; if (_cellSize.height < 0) { _cellSize.height = 0; } } else { _cellSize.height = _bounds.size.height; } if (_numCols > 1) { _cellSize.width = _bounds.size.width - ((_numCols - 1) * _intercell.width); _cellSize.width = _cellSize.width / _numCols; if (_cellSize.width < 0) { _cellSize.width = 0; } } else { _cellSize.width = _bounds.size.width; } } } - (void) setFrame: (NSRect)aFrame { [super setFrame: aFrame]; [self _rebuildLayoutAfterResizing]; } - (void) setFrameSize: (NSSize)aSize { [super setFrameSize: aSize]; [self _rebuildLayoutAfterResizing]; } - (void) _move: (unichar)pos { BOOL selectCell = NO; int h, i, lastDottedRow, lastDottedColumn; if (_mode == NSRadioModeMatrix || _mode == NSListModeMatrix) selectCell = YES; if (_dottedRow == -1 || _dottedColumn == -1) { if (pos == NSUpArrowFunctionKey || pos == NSDownArrowFunctionKey) { for (h = 0; h < _numCols; h++) { for (i = 0; i < _numRows; i++) { if ([_cells[i][h] acceptsFirstResponder]) { _dottedRow = i; _dottedColumn = h; break; } } if (i == _dottedRow) break; } } else { for (i = 0; i < _numRows; i++) { for (h = 0; h < _numCols; h++) { if ([_cells[i][h] acceptsFirstResponder]) { _dottedRow = i; _dottedColumn = h; break; } } if (h == _dottedColumn) break; } } if (_dottedRow == -1 || _dottedColumn == -1) return; if (selectCell) { if (_selectedCell) { [self deselectAllCells]; } [self selectCellAtRow: _dottedRow column: _dottedColumn]; } else [self setNeedsDisplayInRect: [self cellFrameAtRow: _dottedRow column: _dottedColumn]]; } else { lastDottedRow = _dottedRow; lastDottedColumn = _dottedColumn; if (pos == NSUpArrowFunctionKey) { if (_dottedRow <= 0) return; for (i = _dottedRow-1; i >= 0; i--) { if ([_cells[i][_dottedColumn] acceptsFirstResponder]) { _dottedRow = i; break; } } } else if (pos == NSDownArrowFunctionKey) { if (_dottedRow >= _numRows-1) return; for (i = _dottedRow+1; i < _numRows; i++) { if ([_cells[i][_dottedColumn] acceptsFirstResponder]) { _dottedRow = i; break; } } } else if (pos == NSLeftArrowFunctionKey) { if (_dottedColumn <= 0) return; for (i = _dottedColumn-1; i >= 0; i--) { if ([_cells[_dottedRow][i] acceptsFirstResponder]) { _dottedColumn = i; break; } } } else { if (_dottedColumn >= _numCols-1) return; for (i = _dottedColumn+1; i < _numCols; i++) { if ([_cells[_dottedRow][i] acceptsFirstResponder]) { _dottedColumn = i; break; } } } if ((pos == NSUpArrowFunctionKey || pos == NSDownArrowFunctionKey) && _dottedRow != i) return; if ((pos == NSLeftArrowFunctionKey || pos == NSRightArrowFunctionKey) && _dottedColumn != i) return; if (selectCell) { if (_mode == NSRadioModeMatrix) { /* FIXME */ /* NSCell *aCell = _cells[lastDottedRow][lastDottedColumn]; BOOL isHighlighted = [aCell isHighlighted]; if ([aCell state] || isHighlighted) { [aCell setState: NSOffState]; _selectedCells[lastDottedRow][lastDottedColumn] = NO; _selectedRow = _selectedColumn = -1; _selectedCell = nil; if (isHighlighted) [self highlightCell: NO atRow: lastDottedRow column: lastDottedColumn]; else [self drawCell: aCell]; } */ } else [self deselectAllCells]; [self selectCellAtRow: _dottedRow column: _dottedColumn]; } else { [self setNeedsDisplayInRect: [self cellFrameAtRow: lastDottedRow column: lastDottedColumn]]; [self setNeedsDisplayInRect: [self cellFrameAtRow: _dottedRow column: _dottedColumn]]; } } if (selectCell) { [self displayIfNeeded]; [self performClick: self]; } } - (void) moveUp: (id)sender { [self _move: NSUpArrowFunctionKey]; } - (void) moveDown: (id)sender { [self _move: NSDownArrowFunctionKey]; } - (void) moveLeft: (id)sender { [self _move: NSLeftArrowFunctionKey]; } - (void) moveRight: (id)sender { [self _move: NSRightArrowFunctionKey]; } - (void) _shiftModifier: (unichar)character { int i, lastDottedRow, lastDottedColumn; lastDottedRow = _dottedRow; lastDottedColumn = _dottedColumn; if (character == NSUpArrowFunctionKey) { if (_dottedRow <= 0) return; for (i = _dottedRow-1; i >= 0; i--) { if ([_cells[i][_dottedColumn] acceptsFirstResponder]) { _dottedRow = i; break; } } if (_dottedRow != i) return; } else if (character == NSDownArrowFunctionKey) { if (_dottedRow < 0 || _dottedRow >= _numRows-1) return; for (i = _dottedRow+1; i < _numRows; i++) { if ([_cells[i][_dottedColumn] acceptsFirstResponder]) { _dottedRow = i; break; } } } else if (character == NSLeftArrowFunctionKey) { if (_dottedColumn <= 0) return; for (i = _dottedColumn-1; i >= 0; i--) { if ([_cells[_dottedRow][i] acceptsFirstResponder]) { _dottedColumn = i; break; } } } else { if (_dottedColumn < 0 || _dottedColumn >= _numCols-1) return; for (i = _dottedColumn+1; i < _numCols; i++) { if ([_cells[_dottedRow][i] acceptsFirstResponder]) { _dottedColumn = i; break; } } } [self lockFocus]; [self drawCell: _cells[lastDottedRow][lastDottedColumn]]; [self drawCell: _cells[_dottedRow][_dottedColumn]]; [self unlockFocus]; [_window flushWindow]; [self performClick: self]; } - (void) _altModifier: (unichar)character { switch (character) { case NSUpArrowFunctionKey: if (_dottedRow <= 0) return; _dottedRow--; break; case NSDownArrowFunctionKey: if (_dottedRow < 0 || _dottedRow >= _numRows-1) return; _dottedRow++; break; case NSLeftArrowFunctionKey: if (_dottedColumn <= 0) return; _dottedColumn--; break; case NSRightArrowFunctionKey: if (_dottedColumn < 0 || _dottedColumn >= _numCols-1) return; _dottedColumn++; break; } [self setSelectionFrom: INDEX_FROM_COORDS(_selectedColumn, _selectedRow) to: INDEX_FROM_COORDS(_dottedColumn, _dottedRow) anchor: INDEX_FROM_COORDS(_selectedColumn, _selectedRow) highlight: YES]; [self displayIfNeeded]; [self performClick: self]; } - (void) keyDown: (NSEvent *)theEvent { NSString *characters = [theEvent characters]; NSUInteger modifiers = [theEvent modifierFlags]; unichar character = 0; if ([characters length] > 0) { character = [characters characterAtIndex: 0]; } switch (character) { case NSCarriageReturnCharacter: case NSNewlineCharacter: case NSEnterCharacter: [self selectText: self]; break; case ' ': if (_dottedRow != -1 && _dottedColumn != -1) { if (modifiers & NSAlternateKeyMask) [self _altModifier: character]; else { switch (_mode) { case NSTrackModeMatrix: case NSHighlightModeMatrix: case NSRadioModeMatrix: [self selectCellAtRow: _dottedRow column: _dottedColumn]; break; case NSListModeMatrix: if (!(modifiers & NSShiftKeyMask)) [self deselectAllCells]; break; } [self displayIfNeeded]; [self performClick: self]; } return; } break; case NSLeftArrowFunctionKey: case NSRightArrowFunctionKey: if (_numCols <= 1) break; case NSUpArrowFunctionKey: case NSDownArrowFunctionKey: if (modifiers & NSShiftKeyMask) [self _shiftModifier: character]; else if (modifiers & NSAlternateKeyMask) [self _altModifier: character]; else { if (character == NSUpArrowFunctionKey) [self moveUp: self]; else if (character == NSDownArrowFunctionKey) [self moveDown: self]; else if (character == NSLeftArrowFunctionKey) [self moveLeft: self]; else [self moveRight: self]; } return; case NSBackTabCharacter: if (_tabKeyTraversesCells) { if ([self _selectNextSelectableCellAfterRow: _selectedRow column: _selectedColumn]) return; } break; case NSTabCharacter: if (_tabKeyTraversesCells) { if ([theEvent modifierFlags] & NSShiftKeyMask) { if ([self _selectNextSelectableCellAfterRow: _selectedRow column: _selectedColumn]) return; } else { if ([self _selectPreviousSelectableCellBeforeRow: _selectedRow column: _selectedColumn]) return; } } break; default: break; } [super keyDown: theEvent]; } - (void) performClick: (id)sender { [super sendAction: _action to: _target]; } - (BOOL) acceptsFirstResponder { // We gratefully accept keyboard events. return YES; } - (void) _setNeedsDisplayDottedCell { if (_dottedRow != -1 && _dottedColumn != -1) { [self setNeedsDisplayInRect: [self cellFrameAtRow: _dottedRow column: _dottedColumn]]; } } - (BOOL) becomeFirstResponder { [self _setNeedsDisplayDottedCell]; return YES; } - (BOOL) resignFirstResponder { [self _setNeedsDisplayDottedCell]; return YES; } - (void) becomeKeyWindow { [self _setNeedsDisplayDottedCell]; } - (void) resignKeyWindow { [self _setNeedsDisplayDottedCell]; } - (BOOL) abortEditing { if (_textObject) { [_selectedCell endEditing: _textObject]; _textObject = nil; return YES; } else return NO; } - (NSText *) currentEditor { if (_textObject && ([_window firstResponder] == _textObject)) return _textObject; else return nil; } - (void) validateEditing { if (_textObject) { NSFormatter *formatter; NSString *string; formatter = [_selectedCell formatter]; string = AUTORELEASE ([[_textObject text] copy]); if (formatter == nil) { [_selectedCell setStringValue: string]; } else { id newObjectValue; NSString *error; if ([formatter getObjectValue: &newObjectValue forString: string errorDescription: &error] == YES) { [_selectedCell setObjectValue: newObjectValue]; } else { if ([_delegate control: self didFailToFormatString: string errorDescription: error] == YES) { [_selectedCell setStringValue: string]; } } } } } - (void) setValue: (id)anObject forKey: (NSString*)aKey { if ([aKey isEqual: NSSelectedTagBinding]) { [self selectCellWithTag: [anObject integerValue]]; } else { [super setValue: anObject forKey: aKey]; } } - (id) valueForKey: (NSString*)aKey { if ([aKey isEqual: NSSelectedTagBinding]) { return [NSNumber numberWithInteger: [self selectedTag]]; } else { return [super valueForKey: aKey]; } } @end @implementation NSMatrix (PrivateMethods) /* * Renew rows and columns, but when expanding the matrix, refrain from * creating rowSpace items in the last row and colSpace items in the * last column. When inserting the contents of an array into the matrix, * this avoids creation of new cless which would immediately be replaced * by those from the array. * NB. new spaces in the matrix are pre-initialised with nil values so * that replacing them doesn't cause attempts to release random memory. */ - (void) _renewRows: (int)row columns: (int)col rowSpace: (int)rowSpace colSpace: (int)colSpace { int i, j; int oldMaxC; int oldMaxR; SEL mkSel = @selector(makeCellAtRow:column:); IMP mkImp = [self methodForSelector: mkSel]; //NSLog(@"%x - mr: %d mc:%d nr:%d nc:%d r:%d c:%d", (unsigned)self, _maxRows, _maxCols, _numRows, _numCols, row, col); if (row < 0) { #if NSMATRIX_STRICT_CHECKING == 0 NSLog(@"renew negative row (%d) in matrix", (int)row); #else [NSException raise: NSRangeException format: @"renew negative row (%d) in matrix", (int)row]; #endif row = 0; } if (col < 0) { #if NSMATRIX_STRICT_CHECKING == 0 NSLog(@"renew negative column (%d) in matrix", (int)col); #else [NSException raise: NSRangeException format: @"renew negative column (%d) in matrix", (int)col]; #endif col = 0; } /* * Update matrix dimension before we actually change it - so that * makeCellAtRow:column: diesn't think we are trying to make a cell * outside the array bounds. * Our implementation doesn't care, but a subclass might use * putCell:atRow:column: to implement it, and that checks bounds. */ oldMaxC = _maxCols; _numCols = col; if (col > _maxCols) _maxCols = col; oldMaxR = _maxRows; _numRows = row; if (row > _maxRows) _maxRows = row; if (col > oldMaxC) { int end = col - 1; for (i = 0; i < oldMaxR; i++) { _cells[i] = NSZoneRealloc(_myZone, _cells[i], col * sizeof(id)); #if GS_WITH_GC _selectedCells[i] = NSReallocateCollectable( _selectedCells[i], col * sizeof(BOOL), 0); #else _selectedCells[i] = NSZoneRealloc(_myZone, _selectedCells[i], col * sizeof(BOOL)); #endif for (j = oldMaxC; j < col; j++) { _cells[i][j] = nil; _selectedCells[i][j] = NO; if (j == end && colSpace > 0) { colSpace--; } else { (*mkImp)(self, mkSel, i, j); } } } } if (row > oldMaxR) { int end = row - 1; _cells = NSZoneRealloc(_myZone, _cells, row * sizeof(id*)); _selectedCells = NSZoneRealloc(_myZone, _selectedCells, row * sizeof(BOOL*)); /* Allocate the new rows and fill them */ for (i = oldMaxR; i < row; i++) { _cells[i] = NSZoneMalloc(_myZone, _maxCols * sizeof(id)); #if GS_WITH_GC _selectedCells[i] = NSAllocateCollectable(_maxCols * sizeof(BOOL), 0); #else _selectedCells[i] = NSZoneMalloc(_myZone, _maxCols * sizeof(BOOL)); #endif if (i == end) { for (j = 0; j < _maxCols; j++) { _cells[i][j] = nil; _selectedCells[i][j] = NO; if (rowSpace > 0) { rowSpace--; } else { (*mkImp)(self, mkSel, i, j); } } } else { for (j = 0; j < _maxCols; j++) { _cells[i][j] = nil; _selectedCells[i][j] = NO; (*mkImp)(self, mkSel, i, j); } } } } [self deselectAllCells]; //NSLog(@"%x - end mr: %d mc:%d nr:%d nc:%d r:%d c:%d", (unsigned)self, _maxRows, _maxCols, _numRows, _numCols, row, col); } - (void) _setState: (int)state highlight: (BOOL)highlight startIndex: (int)start endIndex: (int)end { int i; MPoint startPoint = POINT_FROM_INDEX(start); MPoint endPoint = POINT_FROM_INDEX(end); for (i = startPoint.y; i <= endPoint.y; i++) { int j; int colLimit; if (_selectionByRect || i == startPoint.y) { j = startPoint.x; } else { j = 0; } if (_selectionByRect || i == endPoint.y) colLimit = endPoint.x; else colLimit = _numCols - 1; for (; j <= colLimit; j++) { NSCell *aCell = _cells[i][j]; if ([aCell isEnabled] && ([aCell state] != state || [aCell isHighlighted] != highlight || (state == NSOffState && _selectedCells[i][j] != NO) || (state != NSOffState && _selectedCells[i][j] == NO))) { [aCell setState: state]; if (state == NSOffState) _selectedCells[i][j] = NO; else _selectedCells[i][j] = YES; [aCell setHighlighted: highlight]; [self setNeedsDisplayInRect: [self cellFrameAtRow: i column: j]]; } } } } // Return YES on success; NO if no selectable cell found. -(BOOL) _selectNextSelectableCellAfterRow: (int)row column: (int)column { int i,j; if (row > -1) { // First look for cells in the same row for (j = column + 1; j < _numCols; j++) { if ([_cells[row][j] isEnabled] && [_cells[row][j] isSelectable]) { _selectedCell = [self selectTextAtRow: row column: j]; _selectedRow = row; _selectedColumn = j; _selectedCells[row][j] = YES; return YES; } } } // Otherwise, make the big cycle. for (i = row + 1; i < _numRows; i++) { for (j = 0; j < _numCols; j++) { if ([_cells[i][j] isEnabled] && [_cells[i][j] isSelectable]) { _selectedCell = [self selectTextAtRow: i column: j]; _selectedRow = i; _selectedColumn = j; _selectedCells[i][j] = YES; return YES; } } } return NO; } -(BOOL) _selectPreviousSelectableCellBeforeRow: (int)row column: (int)column { int i,j; if (row < _numRows) { // First look for cells in the same row for (j = column - 1; j > -1; j--) { if ([_cells[row][j] isEnabled] && [_cells[row][j] isSelectable]) { _selectedCell = [self selectTextAtRow: row column: j]; _selectedRow = row; _selectedColumn = j; _selectedCells[row][j] = YES; return YES; } } } // Otherwise, make the big cycle. for (i = row - 1; i > -1; i--) { for (j = _numCols - 1; j > -1; j--) { if ([_cells[i][j] isEnabled] && [_cells[i][j] isSelectable]) { _selectedCell = [self selectTextAtRow: i column: j]; _selectedRow = i; _selectedColumn = j; _selectedCells[i][j] = YES; return YES; } } } return NO; } - (void) _setKeyRow: (int)row column: (int)column { if (_dottedRow == row && _dottedColumn == column) { return; } if ([_cells[row][column] acceptsFirstResponder]) { if (_dottedRow != -1 && _dottedColumn != -1) { [self setNeedsDisplayInRect: [self cellFrameAtRow: _dottedRow column: _dottedColumn]]; } _dottedRow = row; _dottedColumn = column; [self setNeedsDisplayInRect: [self cellFrameAtRow: _dottedRow column: _dottedColumn]]; } } @end gnustep-gui-0.24.0/Source/NSTextTableBlock.m0000664000076500007650000000620011534147002020463 0ustar brains99brains99/* NSTextTableBlock.m Copyright (C) 2008 Free Software Foundation, Inc. Author: H. Nikolaus Schaller Date: 2007 Author: Fred Kiefer Date: January 2008 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import "AppKit/NSTextTable.h" @implementation NSTextTableBlock - (id) initWithTable: (NSTextTable *)table startingRow: (int)row rowSpan: (int)rspan startingColumn: (int)col columnSpan: (int)cspan; { self = [super init]; if (self == nil) return nil; ASSIGN(_table, table); _row = row; _rowSpan = rspan; _col = col; _colSpan = cspan; return self; } - (void) dealloc { RELEASE(_table); [super dealloc]; } - (int) columnSpan { return _colSpan; } - (int) rowSpan { return _rowSpan; } - (int) startingColumn { return _col; } - (int) startingRow { return _row; } - (NSTextTable *) table { return _table; } - (id) copyWithZone: (NSZone*)zone { NSTextTableBlock *t = [super copyWithZone: zone]; _table = TEST_RETAIN(_table); return t; } - (NSRect) boundsRectForContentRect: (NSRect)content inRect: (NSRect)rect textContainer: (NSTextContainer *)container characterRange: (NSRange)range { return [_table boundsRectForBlock: self contentRect: content inRect: rect textContainer: container characterRange: range]; } - (NSRect) rectForLayoutAtPoint: (NSPoint)point inRect: (NSRect)rect textContainer: (NSTextContainer *)container characterRange: (NSRange)range { return [_table rectForBlock: self layoutAtPoint: point inRect: rect textContainer: container characterRange: range]; } - (void) drawBackgroundWithFrame: (NSRect)rect inView: (NSView *)view characterRange: (NSRange)range layoutManager: (NSLayoutManager *)lm { // override to handle span // we can ask [_table numberOfColumns] for sizing purposes return [super drawBackgroundWithFrame: rect inView: view characterRange: range layoutManager: lm]; } @end gnustep-gui-0.24.0/Source/NSWorkspace.m0000664000076500007650000024627112102166206017567 0ustar brains99brains99/** NSWorkspace Workspace class Copyright (C) 1996-2010 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Implementation by: Richard Frith-Macdonald Date: 1998 Implementation by: Fred Kiefer Date: 2001 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #if defined(HAVE_GETMNTINFO) #include #include #include #include #elif defined(HAVE_GETMNTENT) && defined (MNT_MEMB) #if defined(HAVE_MNTENT_H) #include #elif defined(HAVE_SYS_MNTENT_H) #include #else #undef HAVE_GETMNTENT #endif #endif #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import "AppKit/NSWorkspace.h" #import "AppKit/NSApplication.h" #import "AppKit/NSImage.h" #import "AppKit/NSPasteboard.h" #import "AppKit/NSView.h" #import "AppKit/NSPanel.h" #import "AppKit/NSWindow.h" #import "AppKit/NSScreen.h" #import "GNUstepGUI/GSServicesManager.h" #import "GNUstepGUI/GSDisplayServer.h" #import "GSGuiPrivate.h" /* Informal protocol for method to ask an app to open a URL. */ @interface NSObject (OpenURL) - (BOOL) application: (NSApplication*)a openURL: (NSURL*)u; @end /* Private method to check that a process exists. */ @interface NSProcessInfo (Private) + (BOOL)_exists: (int)pid; @end #define PosixExecutePermission (0111) static NSMutableDictionary *folderPathIconDict = nil; static NSMutableDictionary *folderIconCache = nil; static NSImage *folderImage = nil; static NSImage *multipleFiles = nil; static NSImage *unknownApplication = nil; static NSImage *unknownTool = nil; static NSString *GSWorkspaceNotification = @"GSWorkspaceNotification"; static NSString *GSWorkspacePreferencesChanged = @"GSWorkspacePreferencesChanged"; /* * Depending on the 'active' flag this returns either the currently * active application or an array containing all launched apps.
* The 'notification' argument is either nil (simply query on disk * database) or a notification containing information to be used to * update the database. */ static id GSLaunched(NSNotification *notification, BOOL active) { static NSString *path = nil; static NSDistributedLock *lock = nil; NSDictionary *info = [notification userInfo]; NSString *mode = [notification name]; NSMutableDictionary *file = nil; NSString *name; NSDictionary *apps = nil; BOOL modified = NO; if (path == nil) { path = [NSTemporaryDirectory() stringByAppendingPathComponent: @"GSLaunchedApplications"]; RETAIN(path); lock = [[NSDistributedLock alloc] initWithPath: [path stringByAppendingPathExtension: @"lock"]]; } if ([lock tryLock] == NO) { unsigned sleeps = 0; /* * If the lock is really old ... assume the app has died and break it. */ if ([[lock lockDate] timeIntervalSinceNow] < -20.0) { NS_DURING { [lock breakLock]; } NS_HANDLER { NSLog(@"Unable to break lock %@ ... %@", lock, localException); } NS_ENDHANDLER } /* * Retry locking several times if necessary before giving up. */ for (sleeps = 0; sleeps < 10; sleeps++) { if ([lock tryLock] == YES) { break; } sleeps++; [NSThread sleepUntilDate: [NSDate dateWithTimeIntervalSinceNow: 0.1]]; } if (sleeps >= 10) { NSLog(@"Unable to obtain lock %@", lock); return nil; } } if ([[NSFileManager defaultManager] isReadableFileAtPath: path] == YES) { file = [NSMutableDictionary dictionaryWithContentsOfFile: path]; } if (file == nil) { file = [NSMutableDictionary dictionaryWithCapacity: 2]; } apps = [file objectForKey: @"GSLaunched"]; if (apps == nil) { apps = [NSDictionary new]; [file setObject: apps forKey: @"GSLaunched"]; RELEASE(apps); } if (info != nil && (name = [info objectForKey: @"NSApplicationName"]) != nil) { NSDictionary *oldInfo = [apps objectForKey: name]; if ([mode isEqualToString: NSApplicationDidResignActiveNotification] == YES || [mode isEqualToString: NSWorkspaceDidTerminateApplicationNotification] == YES) { if ([name isEqual: [file objectForKey: @"GSActive"]] == YES) { [file removeObjectForKey: @"GSActive"]; modified = YES; } } else if ([mode isEqualToString: NSApplicationDidBecomeActiveNotification] == YES) { if ([name isEqual: [file objectForKey: @"GSActive"]] == NO) { [file setObject: name forKey: @"GSActive"]; modified = YES; } } if ([mode isEqualToString: NSWorkspaceDidTerminateApplicationNotification] == YES) { if (oldInfo != nil) { NSMutableDictionary *m = [apps mutableCopy]; [m removeObjectForKey: name]; [file setObject: m forKey: @"GSLaunched"]; apps = m; RELEASE(m); modified = YES; } } else if ([mode isEqualToString: NSApplicationDidResignActiveNotification] == NO) { if ([info isEqual: oldInfo] == NO) { NSMutableDictionary *m = [apps mutableCopy]; [m setObject: info forKey: name]; [file setObject: m forKey: @"GSLaunched"]; apps = m; RELEASE(m); modified = YES; } } } if (modified == YES) { [file writeToFile: path atomically: YES]; } [lock unlock]; if (active == YES) { NSString *activeName = [file objectForKey: @"GSActive"]; if (activeName == nil) { return nil; } return [apps objectForKey: activeName]; } else { return [[file objectForKey: @"GSLaunched"] allValues]; } } @interface _GSWorkspaceCenter: NSNotificationCenter { NSNotificationCenter *remote; } - (void) _handleRemoteNotification: (NSNotification*)aNotification; - (void) _postLocal: (NSString*)name userInfo: (NSDictionary*)info; @end @implementation _GSWorkspaceCenter - (void) dealloc { [remote removeObserver: self name: nil object: GSWorkspaceNotification]; RELEASE(remote); [super dealloc]; } - (id) init { self = [super init]; if (self != nil) { remote = RETAIN([NSDistributedNotificationCenter defaultCenter]); NS_DURING { [remote addObserver: self selector: @selector(_handleRemoteNotification:) name: nil object: GSWorkspaceNotification]; } NS_HANDLER { NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; if ([defs boolForKey: @"GSLogWorkspaceTimeout"]) { NSLog(@"NSWorkspace caught exception %@: %@", [localException name], [localException reason]); } else { [localException raise]; } } NS_ENDHANDLER } return self; } /* * Post notification remotely - since we are listening for distributed * notifications, we will observe the notification arriving from the * distributed notification center, and it will get sent out locally too. */ - (void) postNotification: (NSNotification*)aNotification { NSNotification *rem; NSString *name = [aNotification name]; NSDictionary *info = [aNotification userInfo]; if ([name isEqual: NSWorkspaceDidTerminateApplicationNotification] == YES || [name isEqual: NSWorkspaceDidLaunchApplicationNotification] == YES || [name isEqualToString: NSApplicationDidBecomeActiveNotification] == YES || [name isEqualToString: NSApplicationDidResignActiveNotification] == YES) { GSLaunched(aNotification, YES); } rem = [NSNotification notificationWithName: name object: GSWorkspaceNotification userInfo: info]; NS_DURING { [remote postNotification: rem]; } NS_HANDLER { NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; if ([defs boolForKey: @"GSLogWorkspaceTimeout"]) { NSLog(@"NSWorkspace caught exception %@: %@", [localException name], [localException reason]); } else { [localException raise]; } } NS_ENDHANDLER } - (void) postNotificationName: (NSString*)name object: (id)object { [self postNotification: [NSNotification notificationWithName: name object: object]]; } - (void) postNotificationName: (NSString*)name object: (id)object userInfo: (NSDictionary*)info { [self postNotification: [NSNotification notificationWithName: name object: object userInfo: info]]; } /* * Forward a notification from a remote application to observers in this * application. */ - (void) _handleRemoteNotification: (NSNotification*)aNotification { [self _postLocal: [aNotification name] userInfo: [aNotification userInfo]]; } /* * Method allowing a notification to be posted locally. */ - (void) _postLocal: (NSString*)name userInfo: (NSDictionary*)info { NSNotification *aNotification; aNotification = [NSNotification notificationWithName: name object: self userInfo: info]; [super postNotification: aNotification]; } @end @interface NSWorkspace (Private) // Icon handling - (NSImage*) _extIconForApp: (NSString*)appName info: (NSDictionary*)extInfo; - (NSImage*) unknownFiletypeImage; - (NSImage*) _saveImageFor: (NSString*)iconPath; - (NSString*) thumbnailForFile: (NSString *)file; - (NSImage*) _iconForExtension: (NSString*)ext; - (BOOL) _extension: (NSString*)ext role: (NSString*)role app: (NSString**)app; - (BOOL) _scheme: (NSString*)scheme role: (NSString*)role app: (NSString**)app; - (void) _workspacePreferencesChanged: (NSNotification *)aNotification; // application communication - (BOOL) _launchApplication: (NSString*)appName arguments: (NSArray*)args; - (id) _connectApplication: (NSString*)appName; - (id) _workspaceApplication; @end /** *

The NSWorkspace class gathers together a large number of capabilities * needed for workspace management. *

*

The make_services tool examines all applications (anything with a * .app, .debug, or .profile suffix) in the system, local, and user Apps * directories, and caches information about the services each app * provides (extracted from the Info-gnustep.plist file in each application). *

*

In addition to the cache of services information, it builds a cache of * information about all known applications (including information about file * types they handle). *

*

NSWorkspace reads the cache and uses it to determine which application * to use to open a document and which icon to use to represent that document. *

*

The NSWorkspace API has been extended to provide methods for * finding/setting the preferred icon/application for a particular file * type. NSWorkspace will use the 'best' icon/application available. *

*

To determine the executable to launch, if there was an * Info-gnustep.plist/Info.plist in the app wrapper and it had an * NSExecutable field - it uses that name. Otherwise, it tries to use * the name of the app - eg. foo.app/foo
* The executable is launched by NSTask, which handles the addition * of machine/os/library path components as necessary. *

*

To determine the icon for a file, it uses the value from the * cache of icons for the file extension, or use an 'unknown' icon. *

*

To determine the icon for a folder, if the folder has a '.app', * '.debug' or '.profile' extension - the Info-gnustep.plist file * is examined for an 'NSIcon' value and NSWorkspace tries to use that. * If there is no value specified - it tries 'foo.app/foo.png' * or 'foo.app/foo.tiff' or 'foo.app/.dir.png' or 'foo.app/.dir.tiff' *

*

If the folder was not an application wrapper, it just tries * the .dir.png and .dir.tiff file. *

*

If no icon was available, it uses a default folder icon or a * special icon for the root directory. *

*

The information about what file types an app can handle needs * to be stored in Info-gnustep.plist in an array keyed on the name * NSTypes, within which each value is a dictionary.
*

*

In the NSTypes fields, NSWorkspace uses NSIcon (the icon to use * for the type) NSUnixExtensions (a list of file extensions * corresponding to the type) and NSRole (what the app can do with * documents of this type Editor, Viewer, * or None). In the AppList cache, make_services * generates a dictionary, keyed by file extension, whose values are * the dictionaries containing the NSTypes dictionaries of each * of the apps that handle the extension. The NSWorkspace class * makes use of this cache at runtime. *

*

If the Info-gnustep.plist of an application says that it * can open files with a particular extension, then when NSWorkspace * is asked to open such a file it will attempt to send an * -application:openFile: message to the application (which must be * handled by the applications delegate). If the application is not * running, NSWorkspace will instead attempt to launch the application * passing the filename to open after a '-GSFilePath' flag * in the command line arguments. For a GNUstep application, the * application will recognize this and invoke the -application:openFile: * method passing it the file name. *

*

This command line argument mechanism provides a way for non-gnustep * applications to be used to open files simply by provideing a wrapper * for them containing the appropriate Info-gnustep.plist.
* For instance - you could set up xv.app to contain a shellscript 'xv' * that would start the real xv binary passing it a file to open if the * '-GSFilePath' argument was given. The Info-gnustep.plist file could look * like this: *

* * * { * NSExecutable = "xv"; * NSIcon = "xv.png"; * NSTypes = ( * { * NSIcon = "tiff.tiff"; * NSUnixExtensions = (tiff, tif); * }, * { * NSIcon = "xbm.tiff"; * NSUnixExtensions = (xbm); * } *); * } * */ @implementation NSWorkspace static NSWorkspace *sharedWorkspace = nil; static NSString *appListPath = nil; static NSDictionary *applications = nil; static NSString *extPrefPath = nil; static NSDictionary *extPreferences = nil; static NSString *urlPrefPath = nil; static NSDictionary *urlPreferences = nil; // FIXME: Won't work for MINGW32 static NSString *_rootPath = @"/"; /* * Class methods */ + (void) initialize { if (self == [NSWorkspace class]) { static BOOL beenHere = NO; NSFileManager *mgr = [NSFileManager defaultManager]; NSString *service; NSData *data; NSDictionary *dict; [self setVersion: 1]; [gnustep_global_lock lock]; if (beenHere == YES) { [gnustep_global_lock unlock]; return; } beenHere = YES; NS_DURING { service = [[NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex: 0] stringByAppendingPathComponent: @"Services"]; /* * Load file extension preferences. */ extPrefPath = [service stringByAppendingPathComponent: @".GNUstepExtPrefs"]; RETAIN(extPrefPath); if ([mgr isReadableFileAtPath: extPrefPath] == YES) { data = [NSData dataWithContentsOfFile: extPrefPath]; if (data) { dict = [NSDeserializer deserializePropertyListFromData: data mutableContainers: NO]; extPreferences = RETAIN(dict); } } /* * Load URL scheme preferences. */ urlPrefPath = [service stringByAppendingPathComponent: @".GNUstepURLPrefs"]; RETAIN(urlPrefPath); if ([mgr isReadableFileAtPath: urlPrefPath] == YES) { data = [NSData dataWithContentsOfFile: urlPrefPath]; if (data) { dict = [NSDeserializer deserializePropertyListFromData: data mutableContainers: NO]; urlPreferences = RETAIN(dict); } } /* * Load cached application information. */ appListPath = [service stringByAppendingPathComponent: @".GNUstepAppList"]; RETAIN(appListPath); if ([mgr isReadableFileAtPath: appListPath] == YES) { data = [NSData dataWithContentsOfFile: appListPath]; if (data) { dict = [NSDeserializer deserializePropertyListFromData: data mutableContainers: NO]; applications = RETAIN(dict); } } } NS_HANDLER { [gnustep_global_lock unlock]; [localException raise]; } NS_ENDHANDLER [gnustep_global_lock unlock]; } } + (id) allocWithZone: (NSZone*)zone { [NSException raise: NSInvalidArgumentException format: @"You may not allocate a workspace directly"]; return nil; } /* * Creating a Workspace */ + (NSWorkspace*) sharedWorkspace { if (sharedWorkspace == nil) { [gnustep_global_lock lock]; if (sharedWorkspace == nil) { sharedWorkspace = (NSWorkspace*)NSAllocateObject(self, 0, NSDefaultMallocZone()); [sharedWorkspace init]; } [gnustep_global_lock unlock]; } return sharedWorkspace; } /* * Instance methods */ - (void) dealloc { [NSException raise: NSInvalidArgumentException format: @"Attempt to call dealloc for shared worksapace"]; GSNOSUPERDEALLOC; } - (id) init { NSArray *documentDir; NSArray *libraryDirs; NSArray *sysAppDir; NSArray *downloadDir; NSArray *desktopDir; NSString *sysDir; int i; if (sharedWorkspace != self) { RELEASE(self); return RETAIN(sharedWorkspace); } [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(noteUserDefaultsChanged) name: NSUserDefaultsDidChangeNotification object: nil]; /* There's currently no way of knowing if things have changed due to * apps being installed etc ... so we actually poll regularly. */ [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_workspacePreferencesChanged:) name: @"GSHousekeeping" object: nil]; _workspaceCenter = [_GSWorkspaceCenter new]; _iconMap = [NSMutableDictionary new]; _launched = [NSMutableDictionary new]; if (applications == nil) { [self findApplications]; } [_workspaceCenter addObserver: self selector: @selector(_workspacePreferencesChanged:) name: GSWorkspacePreferencesChanged object: nil]; /* icon association and caching */ folderPathIconDict = [[NSMutableDictionary alloc] initWithCapacity:5]; documentDir = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); downloadDir = NSSearchPathForDirectoriesInDomains(NSDownloadsDirectory, NSUserDomainMask, YES); desktopDir = NSSearchPathForDirectoriesInDomains(NSDesktopDirectory, NSUserDomainMask, YES); libraryDirs = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSAllDomainsMask, YES); sysAppDir = NSSearchPathForDirectoriesInDomains(NSApplicationDirectory, NSSystemDomainMask, YES); /* we try to guess a System directory and check if looks like one */ sysDir = nil; if ([sysAppDir count] > 0) { sysDir = [[sysAppDir objectAtIndex: 0] stringByDeletingLastPathComponent]; if (![[sysDir lastPathComponent] isEqualToString: @"System"]) sysDir = nil; } if (sysDir != nil) [folderPathIconDict setObject: @"GSFolder" forKey: sysDir]; [folderPathIconDict setObject: @"HomeDirectory" forKey: NSHomeDirectory()]; [folderPathIconDict setObject: @"ImageFolder" forKey: [NSHomeDirectory () stringByAppendingPathComponent: @"Images"]]; [folderPathIconDict setObject: @"MusicFolder" forKey: [NSHomeDirectory () stringByAppendingPathComponent: @"Music"]]; /* it would be nice to use different root icons... */ [folderPathIconDict setObject: @"Root_PC" forKey: _rootPath]; for (i = 0; i < [libraryDirs count]; i++) { [folderPathIconDict setObject: @"LibraryFolder" forKey: [libraryDirs objectAtIndex: i]]; } for (i = 0; i < [documentDir count]; i++) { [folderPathIconDict setObject: @"DocsFolder" forKey: [documentDir objectAtIndex: i]]; } for (i = 0; i < [downloadDir count]; i++) { [folderPathIconDict setObject: @"DownloadFolder" forKey: [downloadDir objectAtIndex: i]]; } for (i = 0; i < [desktopDir count]; i++) { [folderPathIconDict setObject: @"Desktop" forKey: [desktopDir objectAtIndex: i]]; } folderIconCache = [[NSMutableDictionary alloc] init]; return self; } /* * Opening Files */ - (BOOL) _openUnknown: (NSString*)fullPath { NSString *tool = [[NSUserDefaults standardUserDefaults] objectForKey: @"GSUnknownFileTool"]; NSString *launchPath; if ((tool == nil) || (launchPath = [NSTask launchPathForTool: tool]) == nil) { #ifdef __MINGW32__ // Maybe we should rather use "Explorer.exe /e, " as the tool name unichar *buffer = (unichar *)calloc(1, ([fullPath length] + 1) * sizeof(unichar)); [fullPath getCharacters: buffer range: NSMakeRange(0, [fullPath length])]; buffer[[fullPath length]] = 0; BOOL success = (ShellExecuteW(GetDesktopWindow(), L"open", buffer, NULL, NULL, SW_SHOWNORMAL) > 32); free(buffer); return success; #else // Fall back to xdg-open launchPath = [NSTask launchPathForTool: @"xdg-open"]; #endif } if (launchPath) { NSTask * task = [NSTask launchedTaskWithLaunchPath: launchPath arguments: [NSArray arrayWithObject: fullPath]]; if (task != nil) { [task waitUntilExit]; if ([task terminationStatus] == 0) return YES; } } return NO; } - (BOOL) openFile: (NSString*)fullPath { return [self openFile: fullPath withApplication: nil]; } - (BOOL) openFile: (NSString*)fullPath fromImage: (NSImage*)anImage at: (NSPoint)point inView: (NSView*)aView { NSWindow *win = [aView window]; NSPoint screenLoc = [win convertBaseToScreen: [aView convertPoint: point toView: nil]]; NSSize screenSize = [[win screen] frame].size; NSPoint screenCenter = NSMakePoint(screenSize.width / 2, screenSize.height / 2); [self slideImage: anImage from: screenLoc to: screenCenter]; return [self openFile: fullPath]; } - (BOOL) openFile: (NSString*)fullPath withApplication: (NSString*)appName { return [self openFile: fullPath withApplication: appName andDeactivate: YES]; } - (BOOL) openFile: (NSString*)fullPath withApplication: (NSString*)appName andDeactivate: (BOOL)flag { id app; NS_DURING { if ((app = [self _workspaceApplication]) != nil) { BOOL result; result = [app openFile: fullPath withApplication: appName andDeactivate: flag]; NS_VALRETURN(result); } } NS_HANDLER // workspace manager problem ... fall through to default code NS_ENDHANDLER if (appName == nil) { NSString *ext = [fullPath pathExtension]; if ([self _extension: ext role: nil app: &appName] == NO) { if ([self _openUnknown: fullPath]) { return YES; } else { NSWarnLog(@"No known applications for file extension '%@'", ext); return NO; } } } app = [self _connectApplication: appName]; if (app == nil) { NSArray *args; args = [NSArray arrayWithObjects: @"-GSFilePath", fullPath, nil]; return [self _launchApplication: appName arguments: args]; } else { NS_DURING { if (flag == NO) { [app application: NSApp openFileWithoutUI: fullPath]; } else { [app application: NSApp openFile: fullPath]; } } NS_HANDLER { NSWarnLog(@"Failed to contact '%@' to open file", appName); return NO; } NS_ENDHANDLER } if (flag) { [NSApp deactivate]; } return YES; } - (BOOL) openTempFile: (NSString*)fullPath { id app; NSString *appName; NSString *ext; NS_DURING { if ((app = [self _workspaceApplication]) != nil) { BOOL result; result = [app openTempFile: fullPath]; NS_VALRETURN(result); } } NS_HANDLER // workspace manager problem ... fall through to default code NS_ENDHANDLER ext = [fullPath pathExtension]; if ([self _extension: ext role: nil app: &appName] == NO) { if ([self _openUnknown: fullPath]) { return YES; } else { NSWarnLog(@"No known applications for file extension '%@'", ext); return NO; } } app = [self _connectApplication: appName]; if (app == nil) { NSArray *args; args = [NSArray arrayWithObjects: @"-GSTempPath", fullPath, nil]; return [self _launchApplication: appName arguments: args]; } else { NS_DURING { [app application: NSApp openTempFile: fullPath]; } NS_HANDLER { NSWarnLog(@"Failed to contact '%@' to open temp file", appName); return NO; } NS_ENDHANDLER } [NSApp deactivate]; return YES; } - (BOOL) openURL: (NSURL*)url { if ([url isFileURL]) { return [self openFile: [url path]]; } else { NSString *appName; NSPasteboard *pb; appName = [self getBestAppInRole: nil forScheme: [url scheme]]; if (appName != nil) { id app; /* Now try to get the application to open the URL. */ app = GSContactApplication(appName, nil, nil); if (app != nil) { NS_DURING { [app application: NSApp openURL: url]; } NS_HANDLER { NSWarnLog(@"Failed to contact '%@' to open file", appName); return NO; } NS_ENDHANDLER [NSApp deactivate]; return YES; } } /* No application found to open the URL. * Try any OpenURL service available. */ pb = [NSPasteboard pasteboardWithUniqueName]; [pb declareTypes: [NSArray arrayWithObject: NSURLPboardType] owner: nil]; [url writeToPasteboard: pb]; if (NSPerformService(@"OpenURL", pb)) { return YES; } else { return [self _openUnknown: [url absoluteString]]; } } } /* * Manipulating Files */ - (BOOL) performFileOperation: (NSString*)operation source: (NSString*)source destination: (NSString*)destination files: (NSArray*)files tag: (int*)tag { id app; NS_DURING { if ((app = [self _workspaceApplication]) != nil) { BOOL result; result = [app performFileOperation: operation source: source destination: destination files: files tag: tag]; NS_VALRETURN(result); } } NS_HANDLER // workspace manager problem ... fall through to default code NS_ENDHANDLER return NO; } - (BOOL) selectFile: (NSString*)fullPath inFileViewerRootedAtPath: (NSString*)rootFullpath { id app; NS_DURING { if ((app = [self _workspaceApplication]) != nil) { BOOL result; result = [app selectFile: fullPath inFileViewerRootedAtPath: rootFullpath]; NS_VALRETURN(result); } } NS_HANDLER // workspace manager problem ... fall through to default code NS_ENDHANDLER return NO; } /** * Given an application name, return the full path for that application.
* This method looks for the application in standard locations, and if not * found there, according to MacOS-X documentation, returns nil.
* If the supplied application name is an absolute path, returns that path * irrespective of whether such an application exists or not. This is * not the docmented debavior in the MacOS-X documentation, but is * the MacOS-X implemented behavior.
* If the appName has an extension, it is used, otherwise in GNUstep * the standard app, debug, and profile extensions * are tried.
*/ - (NSString*) fullPathForApplication: (NSString*)appName { NSString *base; NSString *path; NSString *ext; if ([appName length] == 0) { return nil; } if ([[appName lastPathComponent] isEqual: appName] == NO) { if ([appName isAbsolutePath] == YES) { return appName; // MacOS-X implementation behavior. } /* * Relative path ... get standarized absolute path */ path = [[NSFileManager defaultManager] currentDirectoryPath]; appName = [path stringByAppendingPathComponent: appName]; appName = [appName stringByStandardizingPath]; } base = [appName stringByDeletingLastPathComponent]; appName = [appName lastPathComponent]; ext = [appName pathExtension]; if ([ext length] == 0) // no extension, let's find one { path = [appName stringByAppendingPathExtension: @"app"]; path = [applications objectForKey: path]; if (path == nil) { path = [appName stringByAppendingPathExtension: @"debug"]; path = [applications objectForKey: path]; } if (path == nil) { path = [appName stringByAppendingPathExtension: @"profile"]; path = [applications objectForKey: path]; } } else { path = [applications objectForKey: appName]; } /* * If the original name included a path, check that the located name * matches it. If it doesn't we return nil as MacOS-X does. */ if ([base length] > 0 && [base isEqual: [path stringByDeletingLastPathComponent]] == NO) { path = nil; } return path; } - (BOOL) getFileSystemInfoForPath: (NSString*)fullPath isRemovable: (BOOL*)removableFlag isWritable: (BOOL*)writableFlag isUnmountable: (BOOL*)unmountableFlag description: (NSString **)description type: (NSString **)fileSystemType { #if defined (HAVE_GETMNTINFO) /* FIXME Check for presence of statfs call explicitly. Not all systems with getmntinfo do have a statfs calls. In particular, NetBSD offers only a statvfs calls for compatibility with POSIX. Other BSDs and Linuxes have statvfs as well, but this returns less information than the 4.4BSD statfs call. The NetBSD statvfs, on the other hand, is just a statfs in disguise, i.e., it provides all information available in the 4.4BSD statfs call. Therefore, we go ahead an just #define statfs as statvfs on NetBSD. Note that the POSIX statvfs is not really helpful for us here. The only information that could be extracted from the data returned by that syscall is the ST_RDONLY flag. There is no owner field nor a typename. The statvfs call on Solaris returns a structure that includes a non-standard f_basetype field, which provides the name of the underlying file system type. */ #if defined (__NetBSD__) && __NetBSD_Version__ >= 300000000 #define statfs statvfs #define f_flags f_flag #endif uid_t uid; struct statfs m; NSStringEncoding enc; if (statfs([fullPath fileSystemRepresentation], &m)) return NO; uid = geteuid(); enc = [NSString defaultCStringEncoding]; *removableFlag = NO; // FIXME *writableFlag = (m.f_flags & MNT_RDONLY) == 0; *unmountableFlag = (m.f_flags & MNT_ROOTFS) == 0 && (uid == 0 || uid == m.f_owner); *description = @"filesystem"; // FIXME *fileSystemType = [[NSString alloc] initWithCString: m.f_fstypename encoding: enc]; return YES; #else // FIXME return NO; #endif } /** * This method gets information about the file at fullPath and * returns YES on success, NO if the named file could not be * found.
* On success, the name of the preferred application for opening * the file is returned in *appName, or nil if there is no known * application to open it.
* The returned value in *type describes the file using one of * the following constants. * * NSPlainFileType * * A plain file or a directory that some application * claims to be able to open like a file. * * NSDirectoryFileType * An untyped directory * NSApplicationFileType * A GNUstep application * NSFilesystemFileType * A file system mount point * NSShellCommandFileType * Executable shell command * */ - (BOOL) getInfoForFile: (NSString*)fullPath application: (NSString **)appName type: (NSString **)type { NSFileManager *fm = [NSFileManager defaultManager]; NSDictionary *attributes; NSString *fileType; NSString *extension = [fullPath pathExtension]; attributes = [fm fileAttributesAtPath: fullPath traverseLink: YES]; if (attributes != nil) { *appName = [self getBestAppInRole: nil forExtension: extension]; fileType = [attributes fileType]; if ([fileType isEqualToString: NSFileTypeRegular]) { if ([attributes filePosixPermissions] & PosixExecutePermission) { *type = NSShellCommandFileType; } else { *type = NSPlainFileType; } } else if ([fileType isEqualToString: NSFileTypeDirectory]) { if ([extension isEqualToString: @"app"] || [extension isEqualToString: @"debug"] || [extension isEqualToString: @"profile"]) { *type = NSApplicationFileType; } else if ([extension isEqualToString: @"bundle"]) { *type = NSPlainFileType; } else if (*appName != nil && [extension length] > 0) { *type = NSPlainFileType; } /* * The idea here is that if the parent directory's * fileSystemNumber differs, this must be a filesystem * mount point. */ else if ([[fm fileAttributesAtPath: [fullPath stringByDeletingLastPathComponent] traverseLink: YES] fileSystemNumber] != [attributes fileSystemNumber]) { *type = NSFilesystemFileType; } else { *type = NSDirectoryFileType; } } else { /* * This catches sockets, character special, block special, * and unknown file types */ *type = NSPlainFileType; } return YES; } else { *appName = nil; return NO; } } - (NSImage*) iconForFile: (NSString*)fullPath { NSImage *image = nil; NSString *pathExtension = [[fullPath pathExtension] lowercaseString]; NSFileManager *mgr = [NSFileManager defaultManager]; NSDictionary *attributes; NSString *fileType; attributes = [mgr fileAttributesAtPath: fullPath traverseLink: YES]; fileType = [attributes objectForKey: NSFileType]; if ([fileType isEqual: NSFileTypeDirectory] == YES) { NSString *iconPath = nil; if ([pathExtension isEqualToString: @"app"] || [pathExtension isEqualToString: @"debug"] || [pathExtension isEqualToString: @"profile"]) { image = [self appIconForApp: fullPath]; if (image == nil) { /* * Just use the appropriate icon for the path extension */ return [self _iconForExtension: pathExtension]; } } /* * If we have no iconPath, try 'dir/.dir.png' as a * possible locations for the directory icon. */ if (iconPath == nil) { iconPath = [fullPath stringByAppendingPathComponent: @".dir.png"]; if ([mgr isReadableFileAtPath: iconPath] == NO) { iconPath = [fullPath stringByAppendingPathComponent: @".dir.tiff"]; if ([mgr isReadableFileAtPath: iconPath] == NO) { iconPath = nil; } } } if (iconPath != nil) { image = [self _saveImageFor: iconPath]; } if (image == nil) { image = [self _iconForExtension: pathExtension]; if (image == nil || image == [self unknownFiletypeImage]) { NSString *iconName; iconName = [folderPathIconDict objectForKey: fullPath]; if (iconName != nil) { NSImage *iconImage; iconImage = [folderIconCache objectForKey: iconName]; if (iconImage == nil) { iconImage = [NSImage _standardImageWithName: iconName]; /* the dictionary retains the image */ [folderIconCache setObject: iconImage forKey: iconName]; } image = iconImage; } else { if (folderImage == nil) { folderImage = RETAIN([NSImage _standardImageWithName: @"Folder"]); } image = folderImage; } } } } else { NSDebugLog(@"pathExtension is '%@'", pathExtension); if ([[NSUserDefaults standardUserDefaults] boolForKey: @"GSUseFreedesktopThumbnails"]) { /* This image will be 128x128 pixels as oposed to the 48x48 of other GNUstep icons or the 32x32 of the specification */ image = [self _saveImageFor: [self thumbnailForFile: fullPath]]; if (image != nil) { return image; } } image = [self _iconForExtension: pathExtension]; if (image == nil || image == [self unknownFiletypeImage]) { NSFileManager *mgr; mgr = [NSFileManager defaultManager]; if ([mgr isExecutableFileAtPath: fullPath] == YES) { NSDictionary *attributes; NSString *fileType; attributes = [mgr fileAttributesAtPath: fullPath traverseLink: YES]; fileType = [attributes objectForKey: NSFileType]; if ([fileType isEqual: NSFileTypeRegular] == YES) { if (unknownTool == nil) { unknownTool = RETAIN([NSImage _standardImageWithName: @"UnknownTool"]); } image = unknownTool; } } } } if (image == nil) { image = [self unknownFiletypeImage]; } return image; } - (NSImage*) iconForFiles: (NSArray*)pathArray { if ([pathArray count] == 1) { return [self iconForFile: [pathArray objectAtIndex: 0]]; } if (multipleFiles == nil) { // FIXME: Icon does not exist multipleFiles = [NSImage imageNamed: @"FileIcon_multi"]; } return multipleFiles; } - (NSImage*) iconForFileType: (NSString*)fileType { return [self _iconForExtension: fileType]; } - (BOOL) isFilePackageAtPath: (NSString*)fullPath { NSFileManager *mgr = [NSFileManager defaultManager]; NSDictionary *attributes; NSString *fileType, *extension; attributes = [mgr fileAttributesAtPath: fullPath traverseLink: YES]; fileType = [attributes objectForKey: NSFileType]; if ([fileType isEqual: NSFileTypeDirectory] == YES) { /* * We return YES here exactly when getInfoForFile:application:type: * considers the directory an application or a plain file */ extension = [fullPath pathExtension]; if ([extension isEqualToString: @"app"] || [extension isEqualToString: @"debug"] || [extension isEqualToString: @"profile"] || [extension isEqualToString: @"bundle"]) { return YES; } else if ([extension length] > 0 && [self getBestAppInRole: nil forExtension: extension] != nil) { return YES; } } return NO; } - (BOOL) setIcon: (NSImage *)image forFile: (NSString *)fullPath options: (NSWorkspaceIconCreationOptions)options { // FIXME return NO; } /** * Tracking Changes to the File System */ - (BOOL) fileSystemChanged { BOOL flag = _fileSystemChanged; _fileSystemChanged = NO; return flag; } - (void) noteFileSystemChanged { _fileSystemChanged = YES; } - (void) noteFileSystemChanged: (NSString*)path { _fileSystemChanged = YES; } /** * Updates Registered Services, File Types, and other information about any * applications installed in the standard locations. */ - (void) findApplications { static NSString *path = nil; NSTask *task; /* * Try to locate and run an executable copy of 'make_services' */ if (path == nil) { path = [[NSTask launchPathForTool: @"make_services"] retain]; } task = [NSTask launchedTaskWithLaunchPath: path arguments: nil]; if (task != nil) { [task waitUntilExit]; } [self _workspacePreferencesChanged: [NSNotification notificationWithName: GSWorkspacePreferencesChanged object: self]]; } /** * Instructs all the other running applications to hide themselves. * not yet implemented */ - (void) hideOtherApplications { // FIXME } /** * Calls -launchApplication:showIcon:autolaunch: with arguments set to * show the icon but not set it up as an autolaunch. */ - (BOOL) launchApplication: (NSString*)appName { return [self launchApplication: appName showIcon: YES autolaunch: NO]; } /** *

Launches the specified application (unless it is already running).
* If the autolaunch flag is yes, sets the autolaunch user default for the * newly launched application, so that applications which understand the * concept of being autolaunched at system startup time can modify their * behavior appropriately. *

*

Sends an NSWorkspaceWillLaunchApplicationNotification before it * actually attempts to launch the application (this is not sent if the * application is already running). *

*

The application sends an NSWorkspaceDidlLaunchApplicationNotification * on completion of launching. This is not sent if the application is already * running, or if it fails to complete its startup. *

*

Returns NO if the application cannot be launched (eg. it does not exist * or the binary is not executable). *

*

Returns YES if the application was already running or of it was launched * (this does not necessarily mean that the application succeeded in starting * up fully). *

*

Once an application has fully started up, you should be able to connect * to it using [NSConnection+rootProxyForConnectionWithRegisteredName:host:] * passing the application name (normally the filesystem name excluding path * and file extension) and an empty host name. This will let you communicate * with the the [NSApplication-delegate] of the launched application, and you * can generally use this as a test of whether an application is running * correctly. *

*/ - (BOOL) launchApplication: (NSString*)appName showIcon: (BOOL)showIcon autolaunch: (BOOL)autolaunch { id app; NS_DURING { if ((app = [self _workspaceApplication]) != nil) { BOOL result; result = [app launchApplication: appName showIcon: showIcon autolaunch: autolaunch]; NS_VALRETURN(result); } } NS_HANDLER // workspace manager problem ... fall through to default code NS_ENDHANDLER app = [self _connectApplication: appName]; if (app == nil) { NSArray *args = nil; if (autolaunch == YES) { args = [NSArray arrayWithObjects: @"-autolaunch", @"YES", nil]; } return [self _launchApplication: appName arguments: args]; } else { [app activateIgnoringOtherApps:YES]; } return YES; } - (NSString *) absolutePathForAppBundleWithIdentifier: (NSString *)bundleIdentifier { // TODO: full implementation return [self fullPathForApplication: bundleIdentifier]; } - (BOOL) launchAppWithBundleIdentifier: (NSString *)bundleIdentifier options: (NSWorkspaceLaunchOptions)options additionalEventParamDescriptor: (NSAppleEventDescriptor *)descriptor launchIdentifier: (NSNumber **)identifier { // TODO: full implementation return [self launchApplication: bundleIdentifier showIcon: YES autolaunch: NO]; } - (BOOL) openURLs: (NSArray *)urls withAppBundleIdentifier: (NSString *)bundleIdentifier options: (NSWorkspaceLaunchOptions)options additionalEventParamDescriptor: (NSAppleEventDescriptor *)descriptor launchIdentifiers: (NSArray **)identifiers { // FIXME return NO; } /** * Returns a description of the currently active application, containing * the name (NSApplicationName), path (NSApplicationPath) and process * identifier (NSApplicationProcessIdentifier).
* Returns nil if there is no known active application. */ - (NSDictionary*) activeApplication { id app; NS_DURING { if ((app = [self _workspaceApplication]) != nil) { NSDictionary *result; result = [app activeApplication]; NS_VALRETURN(result); } } NS_HANDLER // workspace manager problem ... fall through to default code NS_ENDHANDLER return GSLaunched(nil, YES); } /** * Returns an array listing all the applications known to have been * launched. Each entry in the array is a dictionary providing * the name, path and process identfier of an application. */ - (NSArray*) launchedApplications { NSArray *apps = nil; NS_DURING { id app; if ((app = [self _workspaceApplication]) != nil) { apps = [app launchedApplications]; } } NS_HANDLER { // workspace manager problem ... fall through to default code } NS_ENDHANDLER if (apps == nil) { NSMutableArray *m; unsigned count; apps = GSLaunched(nil, NO); apps = m = AUTORELEASE([apps mutableCopy]); if ((count = [apps count]) > 0) { if ([NSProcessInfo respondsToSelector: @selector(_exists:)] == YES) { /* Check and remove apps whose pid no longer exists */ while (count-- > 0) { int pid; NSString *name; name = [[apps objectAtIndex: count] objectForKey: @"NSApplicationName"]; pid = [[[apps objectAtIndex: count] objectForKey: @"NSApplicationProcessIdentifier"] intValue]; if (pid > 0 && [name length] > 0) { if ([NSProcessInfo _exists: pid] == NO) { GSLaunched([NSNotification notificationWithName: NSWorkspaceDidTerminateApplicationNotification object: self userInfo: [NSDictionary dictionaryWithObject: name forKey: @"NSApplicationName"]], NO); [m removeObjectAtIndex: count]; } } } } } } return apps; } /* * Unmounting a Device */ - (BOOL) unmountAndEjectDeviceAtPath: (NSString*)path { NSDictionary *userinfo; NSTask *task; BOOL flag = NO; userinfo = [NSDictionary dictionaryWithObject: path forKey: @"NSDevicePath"]; [_workspaceCenter postNotificationName: NSWorkspaceWillUnmountNotification object: self userInfo: userinfo]; // FIXME This is system specific task = [NSTask launchedTaskWithLaunchPath: @"eject" arguments: [NSArray arrayWithObject: path]]; if (task != nil) { [task waitUntilExit]; if ([task terminationStatus] != 0) { return NO; } else { flag = YES; } } else { return NO; } [_workspaceCenter postNotificationName: NSWorkspaceDidUnmountNotification object: self userInfo: userinfo]; return flag; } /* * Tracking Status Changes for Devices */ - (void) checkForRemovableMedia { // FIXME } - (NSArray*) mountNewRemovableMedia { // FIXME return nil; } - (NSArray*) mountedRemovableMedia { NSArray *volumes; NSMutableArray *names; unsigned count; unsigned i; volumes = [self mountedLocalVolumePaths]; count = [volumes count]; names = [NSMutableArray arrayWithCapacity: count]; for (i = 0; i < count; i++) { BOOL removableFlag; BOOL writableFlag; BOOL unmountableFlag; NSString *description; NSString *fileSystemType; NSString *name = [volumes objectAtIndex: i]; if ([self getFileSystemInfoForPath: name isRemovable: &removableFlag isWritable: &writableFlag isUnmountable: &unmountableFlag description: &description type: &fileSystemType] && removableFlag) { [names addObject: name]; } } return names; } - (NSArray*) mountedLocalVolumePaths { NSMutableArray *names; #if defined(__MINGW32__) NSFileManager *mgr = [NSFileManager defaultManager]; unsigned max = BUFSIZ; unichar buf[max]; unichar *base = buf; unichar *ptr; unichar *end; unsigned len; names = [NSMutableArray arrayWithCapacity: 8]; len = GetLogicalDriveStringsW(max-1, base); while (len >= max) { base = NSZoneMalloc(NSDefaultMallocZone(), (len+1) * sizeof(unichar)); max = len; len = GetLogicalDriveStringsW(max-1, base); } for (ptr = base; *ptr != 0; ptr = end + 1) { NSString *path; end = ptr; while (*end != 0) { end++; } len = (end - ptr); path = [mgr stringWithFileSystemRepresentation: ptr length: len]; [names addObject: path]; } if (base != buf) { NSZoneFree(NSDefaultMallocZone(), base); } #elif defined (HAVE_GETMNTINFO) NSFileManager *mgr = [NSFileManager defaultManager]; unsigned int i, n; struct statfs *m; n = getmntinfo(&m, MNT_NOWAIT); names = [NSMutableArray arrayWithCapacity: n]; for (i = 0; i < n; i++) { /* NB For now assume that all local volumes are mounted from a device with an entry /dev and this is not the case for any pseudo filesystems. */ if (strncmp(m[i].f_mntfromname, "/dev/", 5) == 0) { [names addObject: [mgr stringWithFileSystemRepresentation: m[i].f_mntonname length: strlen(m[i].f_mntonname)]]; } } #elif defined(HAVE_GETMNTENT) && defined (MNT_MEMB) /* FIXME Solaris uses /etc/mnttab instead of /etc/mtab, but defines * MNTTAB to that path. * FIXME We won't get here on Solaris at all because it defines the * mntent struct in sys/mnttab.h instead of sys/mntent.h. */ # ifndef MNTTAB # define MNTTAB "/etc/mtab" # endif NSFileManager *mgr = [NSFileManager defaultManager]; FILE *fptr = fopen(MNTTAB, "r"); struct mntent *m; names = [NSMutableArray arrayWithCapacity: 8]; while ((m = getmntent(fptr)) != 0) { NSString *path; path = [mgr stringWithFileSystemRepresentation: m->MNT_MEMB length: strlen(m->MNT_MEMB)]; [names addObject: path]; } #else NSString *mtabPath; NSString *mtab; NSArray *mounts, *reservedMountNames; unsigned int i; // get mount table... mtabPath = [[NSUserDefaults standardUserDefaults] objectForKey:@"GSMtabPath"]; if (mtabPath == nil) { mtabPath = @"/etc/mtab"; } // get reserved names.... reservedMountNames = [[NSUserDefaults standardUserDefaults] objectForKey: @"GSReservedMountNames"]; if (reservedMountNames == nil) { reservedMountNames = [NSArray arrayWithObjects: @"proc",@"devpts", @"shm",@"usbdevfs", @"devpts",@"sysfs", @"tmpfs",@"procbususb", @"udev",nil]; [[NSUserDefaults standardUserDefaults] setObject: reservedMountNames forKey: @"GSReservedMountNames"]; } mtab = [NSString stringWithContentsOfFile: mtabPath]; mounts = [mtab componentsSeparatedByString: @"\n"]; names = [NSMutableArray arrayWithCapacity: [mounts count]]; for (i = 0; i < [mounts count]; i++) { NSString *mount = [mounts objectAtIndex: i]; if ([mount length]) { NSArray *parts = [mount componentsSeparatedByString: @" "]; if ([parts count] >= 2) { NSString *type = [parts objectAtIndex: 2]; if ([reservedMountNames containsObject: type] == NO) { [names addObject: [parts objectAtIndex: 1]]; } } } } #endif return names; } /** * Returns the workspace notification center */ - (NSNotificationCenter*) notificationCenter { return _workspaceCenter; } /** * Simply makes a note that the user defaults database has changed. */ - (void) noteUserDefaultsChanged { _userDefaultsChanged = YES; } /** * Returns a flag to say if the defaults database has changed since * the last time this method was called. */ - (BOOL) userDefaultsChanged { BOOL hasChanged = _userDefaultsChanged; _userDefaultsChanged = NO; return hasChanged; } /** * Animating an Image- slides it from one point on the screen to another. */ - (void) slideImage: (NSImage*)image from: (NSPoint)fromPoint to: (NSPoint)toPoint { [GSCurrentServer() slideImage: image from: fromPoint to: toPoint]; } /* * Requesting Additional Time before Power Off or Logout
* Returns the amount of time actually granted (which may be less than * requested).
* Times are measured in milliseconds. */ - (int) extendPowerOffBy: (int)requested { id app; NS_DURING { if ((app = [self _workspaceApplication]) != nil) { int result; result = [app extendPowerOffBy: requested]; NS_VALRETURN(result); } } NS_HANDLER // workspace manager problem ... fall through to default code NS_ENDHANDLER return 0; } - (BOOL) filenameExtension: (NSString *)filenameExtension isValidForType: (NSString*)typeName { // FIXME return [filenameExtension isEqualToString: typeName]; } - (NSString *) localizedDescriptionForType: (NSString *)typeName { // FIXME return typeName; } - (NSString *) preferredFilenameExtensionForType: (NSString *)typeName { // FIXME return typeName; } - (BOOL) type: (NSString *)firstTypeName conformsToType: (NSString *)secondTypeName { // FIXME return [firstTypeName isEqualToString: secondTypeName]; } - (NSString *) typeOfFile: (NSString *)absoluteFilePath error: (NSError **)outError { // FIXME return [absoluteFilePath pathExtension]; } @end @implementation NSWorkspace (GNUstep) /** * Returns the 'best' application to open a file with the specified extension * using the given role. If the role is nil then apps which can edit are * preferred but viewers are also acceptable. Uses a user preferred app * or picks any good match. */ - (NSString*) getBestAppInRole: (NSString*)role forExtension: (NSString*)ext { NSString *appName = nil; if ([self _extension: ext role: role app: &appName] == NO) { appName = nil; } return appName; } /** * Returns the path set for the icon matching the image by * -setBestIcon:forExtension: */ - (NSString*) getBestIconForExtension: (NSString*)ext { NSString *iconPath = nil; if (extPreferences != nil) { NSDictionary *inf; inf = [extPreferences objectForKey: [ext lowercaseString]]; if (inf != nil) { iconPath = [inf objectForKey: @"Icon"]; } } return iconPath; } /** * Gets the applications cache (generated by the make_services tool) * and looks up the special entry that contains a dictionary of all * file extensions recognised by GNUstep applications. Then finds * the dictionary of applications that can handle our file and * returns it. */ - (NSDictionary*) infoForExtension: (NSString*)ext { NSDictionary *map; ext = [ext lowercaseString]; map = [applications objectForKey: @"GSExtensionsMap"]; return [map objectForKey: ext]; } /** * Returns the application bundle for the named application. Accepts * either a full path to an app or just the name. The extension (.app, * .debug, .profile) is optional, but if provided it will be used.
* Returns nil if the specified app does not exist as requested. */ - (NSBundle*) bundleForApp: (NSString*)appName { if ([appName length] == 0) { return nil; } if ([[appName lastPathComponent] isEqual: appName]) // it's a name { appName = [self fullPathForApplication: appName]; } else { NSFileManager *fm; NSString *ext; BOOL flag; fm = [NSFileManager defaultManager]; ext = [appName pathExtension]; if ([ext length] == 0) // no extension, let's find one { NSString *path; path = [appName stringByAppendingPathExtension: @"app"]; if ([fm fileExistsAtPath: path isDirectory: &flag] == NO || flag == NO) { path = [appName stringByAppendingPathExtension: @"debug"]; if ([fm fileExistsAtPath: path isDirectory: &flag] == NO || flag == NO) { path = [appName stringByAppendingPathExtension: @"profile"]; } } appName = path; } if ([fm fileExistsAtPath: appName isDirectory: &flag] == NO || flag == NO) { appName = nil; } } if (appName == nil) { return nil; } return [NSBundle bundleWithPath: appName]; } /** * Returns the application icon for the given app. * Or null if none defined or appName is not a valid application name. */ - (NSImage*) appIconForApp: (NSString*)appName { NSBundle *bundle; NSImage *image = nil; NSFileManager *mgr = [NSFileManager defaultManager]; NSString *iconPath = nil; NSString *fullPath; fullPath = [self fullPathForApplication: appName]; bundle = [self bundleForApp: fullPath]; if (bundle == nil) { return nil; } iconPath = [[bundle infoDictionary] objectForKey: @"NSIcon"]; if (iconPath == nil) { /* * Try the CFBundleIconFile property. */ iconPath = [[bundle infoDictionary] objectForKey: @"CFBundleIconFile"]; } if (iconPath && [iconPath isAbsolutePath] == NO) { NSString *file = iconPath; iconPath = [bundle pathForImageResource: file]; /* * If there is no icon in the Resources of the app, try * looking directly in the app wrapper. */ if (iconPath == nil) { iconPath = [fullPath stringByAppendingPathComponent: file]; if ([mgr isReadableFileAtPath: iconPath] == NO) { iconPath = nil; } } } /* * If there is no icon specified in the Info.plist for app * try 'wrapper/app.png' */ if (iconPath == nil) { NSString *str; str = [fullPath lastPathComponent]; str = [str stringByDeletingPathExtension]; iconPath = [fullPath stringByAppendingPathComponent: str]; iconPath = [iconPath stringByAppendingPathExtension: @"png"]; if ([mgr isReadableFileAtPath: iconPath] == NO) { iconPath = [iconPath stringByAppendingPathExtension: @"tiff"]; if ([mgr isReadableFileAtPath: iconPath] == NO) { iconPath = [iconPath stringByAppendingPathExtension: @"icns"]; if ([mgr isReadableFileAtPath: iconPath] == NO) { iconPath = nil; } } } } if (iconPath != nil) { image = [self _saveImageFor: iconPath]; } return image; } /** * Requires the path to an application wrapper as an argument, and returns * the full path to the executable. */ - (NSString*) locateApplicationBinary: (NSString*)appName { NSString *path; NSString *file; NSBundle *bundle = [self bundleForApp: appName]; if (bundle == nil) { return nil; } path = [bundle bundlePath]; file = [[bundle infoDictionary] objectForKey: @"NSExecutable"]; if (file == nil) { /* * If there is no executable specified in the info property-list, then * we expect the executable to reside within the app wrapper and to * have the same name as the app wrapper but without the extension. */ file = [path lastPathComponent]; file = [file stringByDeletingPathExtension]; path = [path stringByAppendingPathComponent: file]; } else { /* * If there is an executable specified in the info property-list, then * it can be either an absolute path, or a path relative to the app * wrapper, so we make sure we end up with an absolute path to return. */ if ([file isAbsolutePath] == YES) { path = file; } else { path = [path stringByAppendingPathComponent: file]; } } return path; } /** * Sets up a user preference for which app should be used to open files * of the specified extension. */ - (void) setBestApp: (NSString*)appName inRole: (NSString*)role forExtension: (NSString*)ext { NSMutableDictionary *map; NSMutableDictionary *inf; NSData *data; ext = [ext lowercaseString]; if (extPreferences != nil) map = [extPreferences mutableCopy]; else map = [NSMutableDictionary new]; inf = [[map objectForKey: ext] mutableCopy]; if (inf == nil) { inf = [NSMutableDictionary new]; } if (appName == nil) { if (role == nil) { NSString *iconPath = [inf objectForKey: @"Icon"]; RETAIN(iconPath); [inf removeAllObjects]; if (iconPath) { [inf setObject: iconPath forKey: @"Icon"]; RELEASE(iconPath); } } else { [inf removeObjectForKey: role]; } } else { [inf setObject: appName forKey: (role ? (id)role : (id)@"Editor")]; } [map setObject: inf forKey: ext]; RELEASE(inf); RELEASE(extPreferences); extPreferences = map; data = [NSSerializer serializePropertyList: extPreferences]; if ([data writeToFile: extPrefPath atomically: YES]) { [_workspaceCenter postNotificationName: GSWorkspacePreferencesChanged object: self]; } else { NSLog(@"Update %@ of failed", extPrefPath); } } /** * Sets up a user preference for which icon should be used to * represent the specified file extension. */ - (void) setBestIcon: (NSString*)iconPath forExtension: (NSString*)ext { NSMutableDictionary *map; NSMutableDictionary *inf; NSData *data; ext = [ext lowercaseString]; if (extPreferences != nil) map = [extPreferences mutableCopy]; else map = [NSMutableDictionary new]; inf = [[map objectForKey: ext] mutableCopy]; if (inf == nil) inf = [NSMutableDictionary new]; if (iconPath) [inf setObject: iconPath forKey: @"Icon"]; else [inf removeObjectForKey: @"Icon"]; [map setObject: inf forKey: ext]; RELEASE(inf); RELEASE(extPreferences); extPreferences = map; data = [NSSerializer serializePropertyList: extPreferences]; if ([data writeToFile: extPrefPath atomically: YES]) { [_workspaceCenter postNotificationName: GSWorkspacePreferencesChanged object: self]; } else { NSLog(@"Update %@ of failed", extPrefPath); } } /** * Gets the applications cache (generated by the make_services tool) * and looks up the special entry that contains a dictionary of all * URL schemes recognised by GNUstep applications. Then finds the * dictionary of applications that can handle our scheme and returns * it. */ - (NSDictionary*) infoForScheme: (NSString*)scheme { NSDictionary *map; scheme = [scheme lowercaseString]; map = [applications objectForKey: @"GSSchemesMap"]; return [map objectForKey: scheme]; } /** * Returns the 'best' application to open a file with the specified URL * scheme using the given role. If the role is nil then apps which can * edit are preferred but viewers are also acceptable. Uses a user preferred * app or picks any good match. */ - (NSString*) getBestAppInRole: (NSString*)role forScheme: (NSString*)scheme { NSString *appName = nil; if ([self _scheme: scheme role: role app: &appName] == NO) { appName = nil; } return appName; } /** * Sets up a user preference for which app should be used to open files * of the specified URL scheme */ - (void) setBestApp: (NSString*)appName inRole: (NSString*)role forScheme: (NSString*)scheme { NSMutableDictionary *map; NSMutableDictionary *inf; NSData *data; scheme = [scheme lowercaseString]; if (urlPreferences != nil) map = [urlPreferences mutableCopy]; else map = [NSMutableDictionary new]; inf = [[map objectForKey: scheme] mutableCopy]; if (inf == nil) { inf = [NSMutableDictionary new]; } if (appName == nil) { if (role == nil) { NSString *iconPath = [inf objectForKey: @"Icon"]; RETAIN(iconPath); [inf removeAllObjects]; if (iconPath) { [inf setObject: iconPath forKey: @"Icon"]; RELEASE(iconPath); } } else { [inf removeObjectForKey: role]; } } else { [inf setObject: appName forKey: (role ? (id)role : (id)@"Editor")]; } [map setObject: inf forKey: scheme]; RELEASE(inf); RELEASE(urlPreferences); urlPreferences = map; data = [NSSerializer serializePropertyList: urlPreferences]; if ([data writeToFile: urlPrefPath atomically: YES]) { [_workspaceCenter postNotificationName: GSWorkspacePreferencesChanged object: self]; } else { NSLog(@"Update %@ of failed", urlPrefPath); } } @end @implementation NSWorkspace (Private) - (NSImage*) _extIconForApp: (NSString*)appName info: (NSDictionary*)extInfo { NSDictionary *typeInfo = [extInfo objectForKey: appName]; NSString *file = [typeInfo objectForKey: @"NSIcon"]; /* * If the NSIcon entry isn't there and the CFBundle entries are, * get the first icon in the list if it's an array, or assign * the icon to file if it's a string. * * FIXME: CFBundleTypeExtensions/IconFile can be arrays which assign * multiple types to icons. This needs to be handled eventually. */ if (file == nil) { id icon = [typeInfo objectForKey: @"CFBundleTypeIconFile"]; if ([icon isKindOfClass: [NSArray class]]) { if ([icon count]) { file = [icon objectAtIndex: 0]; } } else { file = icon; } } if (file && [file length] != 0) { if ([file isAbsolutePath] == NO) { NSString *iconPath; NSBundle *bundle; bundle = [self bundleForApp: appName]; iconPath = [bundle pathForImageResource: file]; /* * If the icon is not in the Resources of the app, try looking * directly in the app wrapper. */ if (iconPath == nil) { iconPath = [[bundle bundlePath] stringByAppendingPathComponent: file]; } file = iconPath; } if ([[NSFileManager defaultManager] isReadableFileAtPath: file] == YES) { return [self _saveImageFor: file]; } } return nil; } /** Returns the default icon to display for a file */ - (NSImage*) unknownFiletypeImage { static NSImage *image = nil; if (image == nil) { image = RETAIN([NSImage _standardImageWithName: @"Unknown"]); } return image; } /** Try to create the image in an exception handling context */ - (NSImage*) _saveImageFor: (NSString*)iconPath { NSImage *tmp = nil; NS_DURING { tmp = [[NSImage alloc] initWithContentsOfFile: iconPath]; if (tmp != nil) { AUTORELEASE(tmp); } } NS_HANDLER { NSLog(@"BAD TIFF FILE '%@'", iconPath); } NS_ENDHANDLER return tmp; } /** Returns the freedesktop thumbnail file name for a given file name */ - (NSString*) thumbnailForFile: (NSString *)file { NSString *absolute; NSString *digest; NSString *thumbnail; absolute = [[NSURL fileURLWithPath: [file stringByStandardizingPath]] absoluteString]; /* This compensates for a feature we have in NSURL, that is there to have * MacOSX compatibility. */ if ([absolute hasPrefix: @"file://localhost/"]) { absolute = [@"file:///" stringByAppendingString: [absolute substringWithRange: NSMakeRange(17, [absolute length] - 17)]]; } // FIXME: Not sure which encoding to use here. digest = [[[[absolute dataUsingEncoding: NSASCIIStringEncoding] md5Digest] hexadecimalRepresentation] lowercaseString]; thumbnail = [@"~/.thumbnails/normal" stringByAppendingPathComponent: [digest stringByAppendingPathExtension: @"png"]]; return [thumbnail stringByStandardizingPath]; } - (NSImage*) _iconForExtension: (NSString*)ext { NSImage *icon = nil; if (ext == nil || [ext isEqualToString: @""]) { return nil; } /* * extensions are case-insensitive - convert to lowercase. */ ext = [ext lowercaseString]; if ((icon = [_iconMap objectForKey: ext]) == nil) { NSDictionary *prefs; NSDictionary *extInfo; NSString *iconPath; /* * If there is a user-specified preference for an image - * try to use that one. */ prefs = [extPreferences objectForKey: ext]; iconPath = [prefs objectForKey: @"Icon"]; if (iconPath) { icon = [self _saveImageFor: iconPath]; } if (icon == nil && (extInfo = [self infoForExtension: ext]) != nil) { NSString *appName; /* * If there are any application preferences given, try to use the * icon for this file that is used by the preferred app. */ if (prefs) { if ((appName = [prefs objectForKey: @"Editor"]) != nil) { icon = [self _extIconForApp: appName info: extInfo]; } if (icon == nil && (appName = [prefs objectForKey: @"Viewer"]) != nil) { icon = [self _extIconForApp: appName info: extInfo]; } } if (icon == nil) { NSEnumerator *enumerator; /* * Still no icon - try all the apps that handle this file * extension. */ enumerator = [extInfo keyEnumerator]; while (icon == nil && (appName = [enumerator nextObject]) != nil) { icon = [self _extIconForApp: appName info: extInfo]; } } } /* * Nothing found at all - use the unknowntype icon. */ if (icon == nil) { if ([ext isEqualToString: @"app"] == YES || [ext isEqualToString: @"debug"] == YES || [ext isEqualToString: @"profile"] == YES) { if (unknownApplication == nil) { unknownApplication = RETAIN([NSImage _standardImageWithName: @"UnknownApplication"]); } icon = unknownApplication; } else { icon = [self unknownFiletypeImage]; } } /* * Set the icon in the cache for next time. */ if (icon != nil) { [_iconMap setObject: icon forKey: ext]; } } return icon; } - (BOOL) _extension: (NSString*)ext role: (NSString*)role app: (NSString**)app { NSEnumerator *enumerator; NSString *appName = nil; NSDictionary *apps = [self infoForExtension: ext]; NSDictionary *prefs; NSDictionary *info; ext = [ext lowercaseString]; /* * Look for the name of the preferred app in this role. * A 'nil' roll is a wildcard - find the preferred Editor or Viewer. */ prefs = [extPreferences objectForKey: ext]; if (role == nil || [role isEqualToString: @"Editor"]) { appName = [prefs objectForKey: @"Editor"]; if (appName != nil) { info = [apps objectForKey: appName]; if (info != nil) { if (app != 0) { *app = appName; } return YES; } else if ([self locateApplicationBinary: appName] != nil) { /* * Return the preferred application even though it doesn't * say it opens this type of file ... preferences overrule. */ if (app != 0) { *app = appName; } return YES; } } } if (role == nil || [role isEqualToString: @"Viewer"]) { appName = [prefs objectForKey: @"Viewer"]; if (appName != nil) { info = [apps objectForKey: appName]; if (info != nil) { if (app != 0) { *app = appName; } return YES; } else if ([self locateApplicationBinary: appName] != nil) { /* * Return the preferred application even though it doesn't * say it opens this type of file ... preferences overrule. */ if (app != 0) { *app = appName; } return YES; } } } /* * Go through the dictionary of apps that know about this file type and * determine the best application to open the file by examining the * type information for each app. * The 'NSRole' field specifies what the app can do with the file - if it * is missing, we assume an 'Editor' role. */ if (apps == nil || [apps count] == 0) { return NO; } enumerator = [apps keyEnumerator]; if (role == nil) { BOOL found = NO; /* * If the requested role is 'nil', we can accept an app that is either * an Editor (preferred) or a Viewer, or unknown. */ while ((appName = [enumerator nextObject]) != nil) { NSString *str; info = [apps objectForKey: appName]; str = [info objectForKey: @"NSRole"]; /* NB. If str is nil or an empty string, there is no role set, * and we treat this as an Editor since the role is unrestricted. */ if ([str length] == 0 || [str isEqualToString: @"Editor"]) { if (app != 0) { *app = appName; } return YES; } if ([str isEqualToString: @"Viewer"]) { if (app != 0) { *app = appName; } found = YES; } } return found; } else { while ((appName = [enumerator nextObject]) != nil) { NSString *str; info = [apps objectForKey: appName]; str = [info objectForKey: @"NSRole"]; if ((str == nil && [role isEqualToString: @"Editor"]) || [str isEqualToString: role]) { if (app != 0) { *app = appName; } return YES; } } return NO; } } - (BOOL) _scheme: (NSString*)scheme role: (NSString*)role app: (NSString**)app { NSEnumerator *enumerator; NSString *appName = nil; NSDictionary *apps = [self infoForScheme: scheme]; NSDictionary *prefs; NSDictionary *info; scheme = [scheme lowercaseString]; /* * Look for the name of the preferred app in this role. * A 'nil' roll is a wildcard - find the preferred Editor or Viewer. */ prefs = [urlPreferences objectForKey: scheme]; if (role == nil || [role isEqualToString: @"Editor"]) { appName = [prefs objectForKey: @"Editor"]; if (appName != nil) { info = [apps objectForKey: appName]; if (info != nil) { if (app != 0) { *app = appName; } return YES; } else if ([self locateApplicationBinary: appName] != nil) { /* * Return the preferred application even though it doesn't * say it opens this type of file ... preferences overrule. */ if (app != 0) { *app = appName; } return YES; } } } if (role == nil || [role isEqualToString: @"Viewer"]) { appName = [prefs objectForKey: @"Viewer"]; if (appName != nil) { info = [apps objectForKey: appName]; if (info != nil) { if (app != 0) { *app = appName; } return YES; } else if ([self locateApplicationBinary: appName] != nil) { /* * Return the preferred application even though it doesn't * say it opens this type of file ... preferences overrule. */ if (app != 0) { *app = appName; } return YES; } } } /* * Go through the dictionary of apps that know about this file type and * determine the best application to open the file by examining the * type information for each app. * The 'NSRole' field specifies what the app can do with the file - if it * is missing, we assume an 'Editor' role. */ if (apps == nil || [apps count] == 0) { return NO; } enumerator = [apps keyEnumerator]; if (role == nil) { BOOL found = NO; /* * If the requested role is 'nil', we can accept an app that is either * an Editor (preferred) or a Viewer, or unknown. */ while ((appName = [enumerator nextObject]) != nil) { NSString *str; info = [apps objectForKey: appName]; str = [info objectForKey: @"NSRole"]; /* NB. If str is nil or an empty string, there is no role set, * and we treat this as an Editor since the role is unrestricted. */ if ([str length] == 0 || [str isEqualToString: @"Editor"]) { if (app != 0) { *app = appName; } return YES; } if ([str isEqualToString: @"Viewer"]) { if (app != 0) { *app = appName; } found = YES; } } return found; } else { while ((appName = [enumerator nextObject]) != nil) { NSString *str; info = [apps objectForKey: appName]; str = [info objectForKey: @"NSRole"]; if ((str == nil && [role isEqualToString: @"Editor"]) || [str isEqualToString: role]) { if (app != 0) { *app = appName; } return YES; } } return NO; } } - (void) _workspacePreferencesChanged: (NSNotification *)aNotification { /* FIXME reload only those preferences that really were changed * TODO add a user info to aNotification, which includes a bitmask * denoting the updated preference files. */ NSFileManager *mgr = [NSFileManager defaultManager]; NSData *data; NSDictionary *dict; if ([mgr isReadableFileAtPath: extPrefPath] == YES) { data = [NSData dataWithContentsOfFile: extPrefPath]; if (data) { dict = [NSDeserializer deserializePropertyListFromData: data mutableContainers: NO]; ASSIGN(extPreferences, dict); } } if ([mgr isReadableFileAtPath: urlPrefPath] == YES) { data = [NSData dataWithContentsOfFile: urlPrefPath]; if (data) { dict = [NSDeserializer deserializePropertyListFromData: data mutableContainers: NO]; ASSIGN(urlPreferences, dict); } } if ([mgr isReadableFileAtPath: appListPath] == YES) { data = [NSData dataWithContentsOfFile: appListPath]; if (data) { dict = [NSDeserializer deserializePropertyListFromData: data mutableContainers: NO]; ASSIGN(applications, dict); } } /* * Invalidate the cache of icons for file extensions. */ [_iconMap removeAllObjects]; } /** * Launch an application locally (ie without reference to the workspace * manager application). We should only call this method when we want * the application launched by this process, either because what we are * launching IS the workspace manager, or because we have tried to get * the workspace manager to do the job and been unable to do so. */ - (BOOL) _launchApplication: (NSString*)appName arguments: (NSArray*)args { NSTask *task; NSString *path; NSDictionary *userinfo; NSString *host; path = [self locateApplicationBinary: appName]; if (path == nil) { return NO; } /* * Try to ensure that apps we launch display in this workspace * ie they have the same -NSHost specification. */ host = [[NSUserDefaults standardUserDefaults] stringForKey: @"NSHost"]; if (host != nil) { NSHost *h; h = [NSHost hostWithName: host]; if ([h isEqual: [NSHost currentHost]] == NO) { if ([args containsObject: @"-NSHost"] == NO) { NSMutableArray *a; if (args == nil) { a = [NSMutableArray arrayWithCapacity: 2]; } else { a = AUTORELEASE([args mutableCopy]); } [a insertObject: @"-NSHost" atIndex: 0]; [a insertObject: host atIndex: 1]; args = a; } } } /* * App being launched, send * NSWorkspaceWillLaunchApplicationNotification */ userinfo = [NSDictionary dictionaryWithObjectsAndKeys: [[appName lastPathComponent] stringByDeletingPathExtension], @"NSApplicationName", appName, @"NSApplicationPath", nil]; [_workspaceCenter postNotificationName: NSWorkspaceWillLaunchApplicationNotification object: self userInfo: userinfo]; task = [NSTask launchedTaskWithLaunchPath: path arguments: args]; if (task == nil) { return NO; } /* * The NSWorkspaceDidLaunchApplicationNotification will be * sent by the started application itself. */ [_launched setObject: task forKey: appName]; return YES; } - (id) _connectApplication: (NSString*)appName { NSTimeInterval replyTimeout = 0.0; NSTimeInterval requestTimeout = 0.0; NSString *host; NSString *port; NSDate *when = nil; NSConnection *conn = nil; id app = nil; while (app == nil) { host = [[NSUserDefaults standardUserDefaults] stringForKey: @"NSHost"]; if (host == nil) { host = @""; } else { NSHost *h; h = [NSHost hostWithName: host]; if ([h isEqual: [NSHost currentHost]] == YES) { host = @""; } } port = [[appName lastPathComponent] stringByDeletingPathExtension]; /* * Try to contact a running application. */ NS_DURING { conn = [NSConnection connectionWithRegisteredName: port host: host]; requestTimeout = [conn requestTimeout]; [conn setRequestTimeout: 5.0]; replyTimeout = [conn replyTimeout]; [conn setReplyTimeout: 5.0]; app = [conn rootProxy]; } NS_HANDLER { /* Fatal error in DO */ conn = nil; app = nil; } NS_ENDHANDLER if (app == nil) { NSTask *task = [_launched objectForKey: appName]; NSDate *limit; if (task == nil || [task isRunning] == NO) { if (task != nil) // Not running { [_launched removeObjectForKey: appName]; } break; // Need to launch the app } if (when == nil) { when = [[NSDate alloc] init]; } else if ([when timeIntervalSinceNow] < -5.0) { int result; DESTROY(when); result = NSRunAlertPanel(appName, @"Application seems to have hung", @"Continue", @"Terminate", @"Wait"); if (result == NSAlertDefaultReturn) { break; // Finished without app } else if (result == NSAlertOtherReturn) { // Continue to wait for app startup. } else { [task terminate]; [_launched removeObjectForKey: appName]; break; // Terminate hung app } } // Give it another 0.5 of a second to start up. limit = [[NSDate alloc] initWithTimeIntervalSinceNow: 0.5]; [[NSRunLoop currentRunLoop] runUntilDate: limit]; RELEASE(limit); } } if (conn != nil) { /* Use original timeouts */ [conn setRequestTimeout: requestTimeout]; [conn setReplyTimeout: replyTimeout]; } TEST_RELEASE(when); return app; } - (id) _workspaceApplication { static NSUserDefaults *defs = nil; static GSServicesManager *smgr = nil; NSString *appName; NSString *myName; id app; if (defs == nil) { defs = RETAIN([NSUserDefaults standardUserDefaults]); } if (smgr == nil) { smgr = RETAIN([GSServicesManager manager]); } /* What Workspace application? */ appName = [defs stringForKey: @"GSWorkspaceApplication"]; if (appName == nil) { appName = @"GWorkspace"; } /* * If this app is the workspace app, there is no sense contacting * it as it would cause recursion ... so we return nil. */ myName = [smgr port]; if ([appName isEqual: myName] == YES) { return nil; } app = [self _connectApplication: appName]; if (app == nil) { NSString *host; host = [[NSUserDefaults standardUserDefaults] stringForKey: @"NSHost"]; if (host == nil) { host = @""; } else { NSHost *h; h = [NSHost hostWithName: host]; if ([h isEqual: [NSHost currentHost]] == YES) { host = @""; } } /** * We can only launch a workspace app if we are displaying to the * local host (since if we are displaying on another host we want * to to talk to the workspace app on that host too). */ if ([host isEqual: @""] == YES) { if ([self _launchApplication: appName arguments: nil] == YES) { app = [self _connectApplication: appName]; } } } return app; } @end gnustep-gui-0.24.0/Source/NSPrinter.m0000664000076500007650000012117411700543773017261 0ustar brains99brains99/** NSPrinter Class representing a printer's capabilities. Copyright (C) 1996, 1997, 2004 Free Software Foundation, Inc. Authors: Simon Frankau Date: June 1997 Modified for Printing Backend Support Author: Chad Hardin Date: July 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import "AppKit/AppKitExceptions.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSPrinter.h" #import "GNUstepGUI/GSPrinting.h" // // Class variables: // // // Class variables used during scanning: // // Character sets used in scanning. static NSCharacterSet* newlineSet = nil; static NSCharacterSet* keyEndSet = nil; static NSCharacterSet* optKeyEndSet = nil; static NSCharacterSet* valueEndSet = nil; //Class variable to cache NSPrinters, without this they //are created (and PPDs are parsed) ALL the time static NSMutableDictionary* printerCache; // // Private methods used for PPD Parsing // @interface NSPrinter (PPDParsingPrivate) -(void) loadPPDAtPath: (NSString*) PPDstring symbolValues: (NSMutableDictionary*) ppdSymbolValues inclusionSet: (NSMutableSet*) includeSet; -(void) addPPDKeyword: (NSString*) mainKeyword withScanner: (NSScanner*) PPDdata withPPDPath: (NSString*) ppdPath; -(void) addPPDUIConstraint: (NSScanner*) constraint withPPDPath: (NSString*) ppdPath; -(void) addPPDOrderDependency: (NSScanner*) dependency withPPDPath: (NSString*) ppdPath; -(id) addString: (NSString*) string forKey: (NSString*) key inTable: (NSString*) table; -(void) addValue: (NSString*) value andValueTranslation: (NSString*) valueTranslation andOptionTranslation: (NSString*) optionTranslation forKey: (NSString*) key; -(NSString*) interpretQuotedValue: (NSString*) qString; -(int) gethex: (unichar) character; @end @implementation NSPrinter // // Class methods // +(void) initialize { if (self == [NSPrinter class]) { // Initial version [self setVersion:1]; } printerCache = RETAIN([NSMutableDictionary dictionary]); } /** Load the appropriate bundle for the Printer (eg: GSLPRPrinter, GSCUPSPrinter). */ +(id) allocWithZone: (NSZone*) zone { Class principalClass; principalClass = [[GSPrinting printingBundle] principalClass]; if (principalClass == nil) return nil; return [[principalClass printerClass] allocWithZone: zone]; } // // Finding an NSPrinter // +(NSPrinter*) printerWithName: (NSString*) name { NSEnumerator *keyEnum; NSString *key; NSPrinter *printer; //First, the cache has to be managed. //Take into account any deleted printers. keyEnum = [[printerCache allKeys] objectEnumerator]; while ((key = [keyEnum nextObject])) { NSEnumerator *namesEnum; NSString *validName; BOOL stillValid = NO; namesEnum = [[self printerNames] objectEnumerator]; while ((validName = [namesEnum nextObject])) { if ([validName isEqualToString: key]) { stillValid = YES; break; } } if (stillValid == NO) { [printerCache removeObjectForKey: key]; } } printer = [printerCache objectForKey: name]; if (printer) { return printer; } else { Class principalClass; principalClass = [[GSPrinting printingBundle] principalClass]; if (principalClass == nil) return nil; printer = [[principalClass printerClass] printerWithName: name]; if (printer) { [printerCache setObject: printer forKey: name]; } return printer; } } // // This now different than the OpenStep spec and instead // follows the more useful implementation Apple choosed. In // OpenStep, this method would read a PPD and return a NSPrinter // based upon values from that PPD, regardless if that printer // was actually avaiable for use or not. On the contrary, Apple's // implementation looks // at all avaiable printers and returns one that has the same // type. The reason for this is because they use CUPS. CUPS // does not work by maintaining a repository of PPDs. Instead, // the CUPS server trasnmits PPDs as they are needed, and only // for actual real printers. Since we cannot know how the backend // bundles will be handling their PPDs, or if they will even be using // PPDs for that matter, (a Win32 printing backend, for example), // I've choosen to go with Apple's implementation. Really, I see // little use in creating a NSPrinter for a printer that is not // available for use in the first place, I am open for commments // on this, of course. +(NSPrinter*) printerWithType: (NSString*) type { NSEnumerator *printerNamesEnum; NSString *printerName; printerNamesEnum = [[self printerNames] objectEnumerator]; while ((printerName = [printerNamesEnum nextObject])) { NSPrinter *printer; printer = [self printerWithName: printerName]; if ([[printer type] isEqualToString: type]) { return printer; } } return nil; } +(NSArray*) printerNames { Class principalClass; principalClass = [[GSPrinting printingBundle] principalClass]; if (principalClass == nil) return nil; return [[principalClass printerClass] printerNames]; } // See note at +(NSPrinter*) printerWithType:(NSString*) type +(NSArray*) printerTypes { NSMutableSet *printerTypes; NSEnumerator *printerNamesEnum; NSString *printerName; NSPrinter *printer; printerTypes = [NSMutableSet setWithCapacity:1]; printerNamesEnum = [[self printerNames] objectEnumerator]; while ((printerName = [printerNamesEnum nextObject])) { printer = [self printerWithName: printerName]; [printerTypes addObject: [printer type]]; } return [printerTypes allObjects]; } // // Instance methods // // // Printer Attributes // -(NSString*) host { return _printerHost; } -(NSString*) name { return _printerName; } -(NSString*) note { return _printerNote; } -(NSString*) type { return _printerType; } // // Retrieving Specific Information // -(BOOL) acceptsBinary { // FIXME: I'm not sure if acceptsBinary is the same as BCP protocol? NSString *result; NSScanner *protocols; result = [self stringForKey: @"Protocols" inTable: @"PPD"]; if (!result) return NO; protocols = [NSScanner scannerWithString: result]; while (![protocols isAtEnd]) { [protocols scanUpToCharactersFromSet: [NSCharacterSet whitespaceCharacterSet] intoString: &result]; if ([result isEqual:@"BCP"]) return YES; } return NO; } -(NSRect) imageRectForPaper: (NSString*) paperName { NSString *key; key = [NSString stringWithFormat: @"ImageableArea/%@", paperName]; return [self rectForKey: key inTable: @"PPD"]; } -(NSSize) pageSizeForPaper: (NSString*) paperName { NSString *key; key = [NSString stringWithFormat: @"PaperDimension/%@", paperName]; return [self sizeForKey: key inTable: @"PPD"]; } -(BOOL) isColor { return [self booleanForKey: @"ColorDevice" inTable: @"PPD"]; } -(BOOL) isFontAvailable: (NSString*) fontName { NSString *key; key = [NSString stringWithFormat: @"Font/%@", fontName]; return [self isKey: key inTable: @"PPD"]; } -(int) languageLevel { return [self intForKey: @"LanguageLevel" inTable: @"PPD"]; } -(BOOL) isOutputStackInReverseOrder { // FIXME: Is this what is needed? I'm not sure how this is worked out. NSString *result; result = [self stringForKey: @"DefaultOutputOrder" inTable: @"PPD"]; if (!result) return NO; if ([result caseInsensitiveCompare: @"REVERSE"] == NSOrderedSame) return YES; else return NO; } // // Querying the NSPrinter Tables // -(BOOL) booleanForKey: (NSString*) key inTable: (NSString*) table { NSString *result; result = [self stringForKey: key inTable: table]; if (!result) //raise exception? return NO; if ([result caseInsensitiveCompare: @"TRUE"] == NSOrderedSame) return YES; else return NO; } -(NSDictionary*) deviceDescription { NSMutableDictionary *result; result = [NSMutableDictionary dictionary]; if ([self isKey: @"DefaultResolution" inTable:@"PPD"]) { int dpi = [self intForKey: @"DefaultResolution" inTable: @"PPD"]; [result setObject: [NSNumber numberWithInt: dpi] forKey: NSDeviceResolution]; } if ([self isKey: @"ColorDevice" inTable: @"PPD"]) { BOOL color = [self booleanForKey: @"ColorDevice" inTable: @"PPD"]; // FIXME: Should NSDeviceWhiteColorSpace be NSDeviceBlackColorSpace? // FIXME #2: Are they calibrated? // Basically I'm not sure which color spaces should be used... if (color == YES) { [result setObject: NSDeviceCMYKColorSpace forKey: NSDeviceColorSpaceName]; } else { [result setObject: NSDeviceWhiteColorSpace forKey: NSDeviceColorSpaceName]; } } if ([self isKey: @"DefaultBitsPerPixel" inTable: @"PPD"]) { int bits = [self intForKey: @"DefaultBitsPerPixel" inTable: @"PPD"]; [result setObject: [NSNumber numberWithInt: bits] forKey: NSDeviceBitsPerSample]; } if ([self isKey: @"DefaultPageSize" inTable: @"PPD"]) { NSString* defaultPageSize = [self stringForKey: @"DefaultPageSize" inTable: @"PPD"]; if (defaultPageSize) { NSSize paperSize = [self pageSizeForPaper: defaultPageSize]; [result setObject: [NSValue valueWithSize:paperSize] forKey: NSDeviceSize]; } } [result setObject: [NSNumber numberWithBool:NO] forKey: NSDeviceIsScreen]; [result setObject: [NSNumber numberWithBool:YES] forKey: NSDeviceIsPrinter]; NSDebugMLLog(@"GSPrinting", @"Device Description: %@", [result description]); return result; } -(float) floatForKey: (NSString*) key inTable: (NSString*) table { NSString *result; result = [self stringForKey: key inTable: table]; if (!result) //raise exception? return 0.0; return [result floatValue]; } -(int) intForKey: (NSString*) key inTable: (NSString*) table { NSString *result; result = [self stringForKey: key inTable: table]; if (!result) //raise exception? return 0; return [result intValue]; } -(NSRect) rectForKey: (NSString*) key inTable: (NSString*) table { NSString *result; NSScanner *bits; double x1, y1, x2, y2; result = [self stringForKey: key inTable: table]; if (!result) //raise exception? return NSZeroRect; bits = [NSScanner scannerWithString: result]; if ([bits scanDouble: &x1] && [bits scanDouble: &y1] && [bits scanDouble: &x2] && [bits scanDouble: &y2]) { return NSMakeRect(x1, y1, x2-x1, y2-y1); } return NSZeroRect; } -(NSSize) sizeForKey: (NSString*) key inTable: (NSString*) table { NSString *result; NSScanner *bits; double x, y; result = [self stringForKey: key inTable: table]; if (!result) //raise exception? return NSZeroSize; bits = [NSScanner scannerWithString: result]; if ([bits scanDouble: &x] && [bits scanDouble: &y]) { return NSMakeSize(x,y); } return NSZeroSize; } -(NSString*) stringForKey: (NSString*) key inTable: (NSString*) table { NSArray *results; results = [self stringListForKey: key inTable: table]; if (results == nil) return nil; return [results objectAtIndex: 0]; } -(NSArray*) stringListForKey: (NSString*) key inTable: (NSString*) table { NSDictionary *tableObj; NSMutableArray *result; tableObj = [_tables objectForKey: table ]; if (tableObj == nil) //raise exception? { return nil; } result = [tableObj objectForKey: key]; if ([[result objectAtIndex:0] isEqual:@""]) { NSMutableArray *origResult = result; result = [NSMutableArray array]; [result addObjectsFromArray: origResult]; [result removeObjectAtIndex: 0]; } return result; } -(NSPrinterTableStatus) statusForTable: (NSString*) table { NSDictionary *tableObj; // Select correct table tableObj = [_tables objectForKey: table]; if (tableObj == nil) return NSPrinterTableNotFound; else if (![tableObj isKindOfClass: [NSDictionary class]]) return NSPrinterTableError; else return NSPrinterTableOK; } -(BOOL) isKey: (NSString*) key inTable: (NSString*) table { NSMutableDictionary *tableObj; // Select correct table tableObj = [_tables objectForKey: table]; if (tableObj == nil) //raise exception? { return NO; } // And check it if ([tableObj objectForKey: key] == nil) return NO; else return YES; } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { // TODO: Determine keys for NSPrinter. } else { [aCoder encodeObject: _printerHost]; [aCoder encodeObject: _printerName]; [aCoder encodeObject: _printerNote]; [aCoder encodeObject: _printerType]; [aCoder encodeObject: _tables]; } } - (id) initWithCoder: (NSCoder*)aDecoder { if ([aDecoder allowsKeyedCoding]) { // TODO: Determine keys for NSPrinter. } else { _printerHost = [aDecoder decodeObject]; _printerName = [aDecoder decodeObject]; _printerNote = [aDecoder decodeObject]; _printerType = [aDecoder decodeObject]; _tables = [aDecoder decodeObject]; } return self; } @end /// ///Private implementation of routines that will be usefull ///for the printing backend bundles that subclass us. /// @implementation NSPrinter (Private) // // Initialisation method used by backend bundles // -(id) initWithName: (NSString*) name withType: (NSString*) type withHost: (NSString*) host withNote: (NSString*) note { self = [super init]; // Initialise instance variables ASSIGN(_printerName, name); ASSIGN(_printerType, type); ASSIGN(_printerHost, host); ASSIGN(_printerNote, note); _tables = RETAIN([NSMutableDictionary dictionary]); return self; } // // Deallocation of instance variables // -(void) dealloc { RELEASE(_printerHost); RELEASE(_printerName); RELEASE(_printerNote); RELEASE(_printerType); RELEASE(_tables); [super dealloc]; } @end @implementation NSPrinter (PPDParsing) -(BOOL) parsePPDAtPath: (NSString*) ppdPath { NSAutoreleasePool* subpool; NSMutableDictionary* ppdSymbolValues; NSEnumerator* objEnum; NSMutableArray* valArray; //make sure the class variables for scanning are created if (!newlineSet) { newlineSet = [NSCharacterSet characterSetWithCharactersInString: @"\n\r"]; RETAIN(newlineSet); } if (!keyEndSet) { keyEndSet = [NSCharacterSet characterSetWithCharactersInString: @"\n\r\t: "]; RETAIN(keyEndSet); } if (!optKeyEndSet) { optKeyEndSet = [NSCharacterSet characterSetWithCharactersInString: @"\n\r:/"]; RETAIN(optKeyEndSet); } if (!valueEndSet) { valueEndSet = [NSCharacterSet characterSetWithCharactersInString: @"\n\r/"]; RETAIN(valueEndSet); } [_tables setObject: [NSMutableDictionary dictionary] forKey: @"PPD"]; [_tables setObject: [NSMutableDictionary dictionary] forKey: @"PPDOptionTranslation"]; [_tables setObject: [NSMutableDictionary dictionary] forKey: @"PPDArgumentTranslation"]; [_tables setObject: [NSMutableDictionary dictionary] forKey: @"PPDOrderDependency"]; [_tables setObject: [NSMutableDictionary dictionary] forKey: @"PPDUIConstraints"]; // Create a temporary autorelease pool, as many temporary objects are used subpool = [[NSAutoreleasePool alloc] init]; // NB: There are some structure keywords (such as OpenUI/CloseUI) that may // be repeated, but as yet are not used. Since they are structure keywords, // they'll probably need special processing anyway, and so aren't // added to this list. // Create dictionary for temporary storage of symbol values ppdSymbolValues = [NSMutableDictionary dictionary]; //The inclusion set keeps track of what PPD files have been *Include(d). //If one comes up twice recursion has occurred and we stop it. // And scan the PPD itself [self loadPPDAtPath: ppdPath symbolValues: ppdSymbolValues inclusionSet: [NSMutableSet setWithCapacity:10]]; // Search the PPD dictionary for symbolvalues and substitute them. objEnum = [[_tables objectForKey: @"PPD"] objectEnumerator]; while ((valArray = [objEnum nextObject])) { NSString *oldValue; NSString *newValue; int i, max; max = [valArray count]; for (i=0 ; i < max ; i++) { oldValue = [valArray objectAtIndex: i]; if ([oldValue isKindOfClass: [NSString class]] && ![oldValue isEqual: @""] && [[oldValue substringToIndex: 1] isEqual: @"^"]) { newValue = [ppdSymbolValues objectForKey: [oldValue substringFromIndex: 1]]; if (!newValue) { [NSException raise: NSPPDParseException format: @"Unknown symbol value, ^%@ in PPD file %@.ppd", oldValue, ppdPath]; } [valArray replaceObjectAtIndex: i withObject: newValue]; } } } // Make sure all the required keys are present //Too many PPDs don't pass the test.... /* objEnum = [[NSArray arrayWithObjects: @"NickName", @"ModelName", @"PCFileName", @"Product", @"PSVersion", @"FileVersion", @"FormatVersion", @"LanguageEncoding", @"LanguageVersion", @"PageSize", @"PageRegion", @"ImageableArea", @"PaperDimension", @"PPD-Adobe", nil] objectEnumerator]; while ((checkVal = [objEnum nextObject])) { if (![self isKey: checkVal inTable: @"PPD"]) { [NSException raise:NSPPDParseException format:@"Required keyword *%@ not found in PPD file %@.ppd", checkVal, PPDPath]; } } */ // Release the local autoreleasePool [subpool drain]; //Sometimes it's good to see the tables... /* NSDebugMLLog(@"GSPrinting", @"\n\nPPD: %@\n\n", [[_tables objectForKey: @"PPD"] description]); NSDebugMLLog(@"GSPrinting", @"\n\nPPDOptionTranslation: %@\n\n", [[_tables objectForKey: @"PPDOptionTranslation"] description]); NSDebugMLLog(@"GSPrinting", @"\n\nPPDArgumentTranslation: %@\n\n", [[_tables objectForKey: @"PPDArgumentTranslation"] description]); NSDebugMLLog(@"GSPrinting", @"\n\nPPDOrderDependency: %@\n\n", [[_tables objectForKey: @"PPDOrderDependency"] description]); NSDebugMLLog(@"GSPrinting", @"\n\nPPDUIConstraints: %@\n\n", [[_tables objectForKey: @"PPDUIConstraints"] description]); */ return YES; } @end @implementation NSPrinter (PPDParsingPrivate) -(void) loadPPDAtPath: (NSString*) ppdPath symbolValues: (NSMutableDictionary*) ppdSymbolValues inclusionSet: (NSMutableSet*) inclusionSet { NSString* ppdString; NSScanner* ppdData; NSString* keyword; //See if this ppd has been processed before if ([inclusionSet member: ppdPath]) { //this ppd has been done already! [NSException raise: NSPPDIncludeStackOverflowException format: @"Recursive *Includes! PPD *Include stack: %@", [[inclusionSet allObjects] description] ]; } [inclusionSet addObject: ppdPath]; ppdString = [NSString stringWithContentsOfFile: ppdPath]; if (nil == ppdString) { // The file isn't readable [NSException raise: NSPPDParseException format: @"PPD file '%@' isn't readable", ppdPath]; } // Set up the scanner - Appending a newline means that it should be // able to process the last line correctly ppdData = [NSScanner scannerWithString: [ppdString stringByAppendingString: @"\n"]]; [ppdData setCharactersToBeSkipped: [NSCharacterSet whitespaceCharacterSet]]; // Main processing starts here... while (YES) //Only check for the end after accounting for whitespace { // Get to the start of a new keyword, skipping blank lines [ppdData scanCharactersFromSet: [NSCharacterSet whitespaceAndNewlineCharacterSet] intoString: NULL]; //this could be the end... if ([ppdData isAtEnd]) break; // All new entries should starts '*' if (![ppdData scanString: @"*" intoString: NULL]) { [NSException raise: NSPPDParseException format: @"Line not starting with * in PPD file %@", ppdPath]; } // Skip lines starting '*%', '*End', '*SymbolLength', or '*SymbolEnd' if ([ppdData scanString: @"%" intoString: NULL] || [ppdData scanString: @"End" //if we get this there is problem, yes? intoString: NULL] || [ppdData scanString: @"SymbolLength" intoString: NULL] || [ppdData scanString: @"SymbolEnd" //if we get this there is problem, yes? intoString: NULL]) { [ppdData scanUpToCharactersFromSet: newlineSet intoString: NULL]; continue; } // Read main keyword, up to a colon, space or newline [ppdData scanUpToCharactersFromSet: keyEndSet intoString: &keyword]; // Loop if there is no value section, these keywords are ignored if ([ppdData scanCharactersFromSet: newlineSet intoString: NULL]) { continue; } // Add the line to the relevant table if ([keyword isEqual: @"OrderDependency"]) { [self addPPDOrderDependency: ppdData withPPDPath: ppdPath]; } else if ([keyword isEqual: @"UIConstraints"]) { [self addPPDUIConstraint: ppdData withPPDPath: ppdPath]; } else if ([keyword isEqual: @"Include"]) { NSFileManager *fileManager; NSString *fileName = nil; NSString *path = nil; fileManager = [NSFileManager defaultManager]; [ppdData scanString: @":" intoString: NULL]; // Find the filename between two "s" [ppdData scanString: @"\"" /*"*/ intoString: NULL]; [ppdData scanUpToString: @"\"" /*"*/ intoString: &fileName]; [ppdData scanString: @"\"" /*"*/ intoString: NULL]; //the fileName could be an absolute path or just a filename. if ([fileManager fileExistsAtPath: fileName]) { //it was absolute, we are done path = fileName; } //it was not absolute. Check to see if it exists in the //directory of this ppd else if ([fileManager fileExistsAtPath: [[ppdPath stringByDeletingLastPathComponent] stringByAppendingPathComponent: fileName] ]) { path = [[ppdPath stringByDeletingLastPathComponent] stringByAppendingPathComponent: fileName]; } else //could not find the *Include fileName { [NSException raise: NSPPDIncludeNotFoundException format: @"Could not find *Included PPD file %@", path]; } [self loadPPDAtPath: path symbolValues: ppdSymbolValues inclusionSet: inclusionSet]; } else if ([keyword isEqual: @"SymbolValue"]) { NSString *symbolName; NSString *symbolVal; if (![ppdData scanString: @"^" intoString: NULL]) { [NSException raise: NSPPDParseException format:@"Badly formatted *SymbolValue in PPD file %@", ppdPath]; } [ppdData scanUpToString: @":" intoString: &symbolName]; [ppdData scanString: @":" intoString: NULL]; [ppdData scanString: @"\"" /*"*/ intoString: NULL]; [ppdData scanUpToString: @"\"" /*"*/ intoString: &symbolVal]; if (!symbolVal) symbolVal = @""; [ppdData scanString: @"\"" /*"*/ intoString: NULL]; [ppdSymbolValues setObject: symbolVal forKey: symbolName]; } else { [self addPPDKeyword: keyword withScanner: ppdData withPPDPath: ppdPath]; } } } -(void) addPPDKeyword: (NSString*) mainKeyword withScanner: (NSScanner*) ppdData withPPDPath: (NSString*) ppdPath { NSArray *repKeys; NSString* optionKeyword = nil; NSString* optionTranslation = nil; NSString* value = nil; NSString* valueTranslation = nil; // Array of Repeated Keywords (Appendix B of the PostScript Printer // Description File Format Specification). repKeys = [NSArray arrayWithObjects:@"Emulators", @"Extensions", @"FaxSupport", //@"Include", (handled separately) @"Message", @"PrinterError", @"Product", @"Protocols", @"PSVersion", @"Source", @"Status", //@"UIConstraints", (handled separately) // Even though this is not mentioned in the list of repeated keywords, // it's often repeated anyway, so I'm putting it here. @"InkName", nil]; // Scan off any optionKeyword [ppdData scanUpToCharactersFromSet: optKeyEndSet intoString: &optionKeyword]; if ([ppdData scanCharactersFromSet: newlineSet intoString: NULL]) { [NSException raise: NSPPDParseException format: @"Keyword has optional keyword but no value in PPD file %@", ppdPath]; } if ([ppdData scanString: @"/" intoString: NULL]) { // Option keyword translation exists - scan it [ppdData scanUpToString: @":" intoString: &optionTranslation]; } [ppdData scanString: @":" intoString: NULL]; // Read the value part // Values starting with a " are read until the second ", ignoring \n etc. if ([ppdData scanString: @"\"" /*"*/ intoString: NULL]) { [ppdData scanUpToString: @"\"" /*"*/ intoString: &value]; if (!value) value = @""; [ppdData scanString: @"\"" /*"*/ intoString: NULL]; // It is a QuotedValue if it's in quotes, and there is no option // key, or the main key is a *JCL keyword if (!optionKeyword || [[mainKeyword substringToIndex:3] isEqualToString: @"JCL"]) { value = [self interpretQuotedValue: value]; } } else { // Otherwise, scan up to the end of line or '/' [ppdData scanUpToCharactersFromSet: valueEndSet intoString: &value]; } // If there is a value translation, scan it if ([ppdData scanString: @"/" intoString: NULL]) { [ppdData scanUpToCharactersFromSet: newlineSet intoString: &valueTranslation]; } // The translations also have to have any hex substrings interpreted if (optionTranslation) optionTranslation = [self interpretQuotedValue: optionTranslation]; if (valueTranslation) valueTranslation = [self interpretQuotedValue: valueTranslation]; // The keyword (or keyword/option pair, if there's a option), should only // only have one value, unless it's one of the optionless keywords which // allow multiple instances. // If a keyword is read twice, 'first instance is correct', according to // the standard. // Finally, add the strings to the tables if (optionKeyword) { NSString *mainAndOptionKeyword; mainAndOptionKeyword=[mainKeyword stringByAppendingFormat: @"/%@", optionKeyword]; if ([self isKey: mainAndOptionKeyword inTable: @"PPD"]) { return; } [self addValue: value andValueTranslation: valueTranslation andOptionTranslation: optionTranslation forKey: mainAndOptionKeyword]; // Deal with the oddities of stringForKey:inTable: // If this method is used to find a keyword with options, using // just the keyword it should return an empty string // stringListForKey:inTable:, however, should return the list of // option keywords. // This is done by making the first item in the array an empty // string, which will be skipped by stringListForKey:, if necessary if (![[_tables objectForKey: @"PPD"] objectForKey: mainKeyword]) { [self addString: @"" forKey: mainKeyword inTable: @"PPD"]; [self addString: @"" forKey: mainKeyword inTable: @"PPDOptionTranslation"]; [self addString: @"" forKey: mainKeyword inTable: @"PPDArgumentTranslation"]; } [self addValue: optionKeyword andValueTranslation: optionKeyword andOptionTranslation: optionKeyword forKey: mainKeyword]; } else { if ([self isKey: mainKeyword inTable: @"PPD"] && ![repKeys containsObject: mainKeyword]) { return; } [self addValue: value andValueTranslation: valueTranslation andOptionTranslation: optionTranslation forKey: mainKeyword]; } } -(void) addPPDUIConstraint: (NSScanner*) constraint withPPDPath: (NSString*) ppdPath { NSString* mainKey1 = nil; NSString* optionKey1 = nil; NSString* mainKey2 = nil; NSString* optionKey2 = nil; // UIConstraint should have no option keyword if (![constraint scanString: @":" intoString: NULL]) { [NSException raise:NSPPDParseException format:@"UIConstraints has option keyword in PPD File %@", ppdPath]; } // Skip the '*' [constraint scanString: @"*" intoString: NULL]; // Scan the bits. Stuff not starting with * must be an optionKeyword [constraint scanUpToCharactersFromSet: [NSCharacterSet whitespaceCharacterSet] intoString: &mainKey1]; if (![constraint scanString: @"*" intoString: NULL]) { [constraint scanUpToCharactersFromSet: [NSCharacterSet whitespaceCharacterSet] intoString: &optionKey1]; [constraint scanString: @"*" intoString: NULL]; } [constraint scanUpToCharactersFromSet: [NSCharacterSet whitespaceAndNewlineCharacterSet] intoString: &mainKey2]; if (![constraint scanCharactersFromSet: newlineSet intoString: NULL]) { [constraint scanUpToCharactersFromSet: [NSCharacterSet whitespaceAndNewlineCharacterSet] intoString: &optionKey2]; } else { optionKey2 = @""; } // Add to table if (optionKey1) mainKey1 = [mainKey1 stringByAppendingFormat: @"/%@", optionKey1]; [self addString: mainKey2 forKey: mainKey1 inTable: @"PPDUIConstraints"]; [self addString: optionKey2 forKey: mainKey1 inTable: @"PPDUIConstraints"]; } -(void) addPPDOrderDependency: (NSScanner*) dependency withPPDPath: (NSString*) ppdPath { NSString *realValue = nil; NSString *section = nil; NSString *keyword = nil; NSString *optionKeyword = nil; // Order dependency should have no option keyword if (![dependency scanString: @":" intoString: NULL]) { [NSException raise: NSPPDParseException format:@"OrderDependency has option keyword in PPD file %@", ppdPath]; } [dependency scanUpToCharactersFromSet: [NSCharacterSet whitespaceCharacterSet] intoString: &realValue]; [dependency scanUpToCharactersFromSet: [NSCharacterSet whitespaceCharacterSet] intoString: §ion]; [dependency scanString: @"*" intoString: NULL]; [dependency scanUpToCharactersFromSet: [NSCharacterSet whitespaceAndNewlineCharacterSet] intoString: &keyword]; if (![dependency scanCharactersFromSet: newlineSet intoString: NULL]) { // Optional keyword exists [dependency scanUpToCharactersFromSet: [NSCharacterSet whitespaceAndNewlineCharacterSet] intoString: &optionKeyword]; } // Go to next line of PPD file [dependency scanCharactersFromSet: newlineSet intoString: NULL]; // Add to table if (optionKeyword) keyword = [keyword stringByAppendingFormat: @"/%@", optionKeyword]; [self addString: realValue forKey: keyword inTable: @"PPDOrderDependency"]; [self addString: section forKey: keyword inTable: @"PPDOrderDependency"]; } // // Adds the various values to the relevant tables, for the given key // -(void) addValue: (NSString*) value andValueTranslation: (NSString*) valueTranslation andOptionTranslation: (NSString*) optionTranslation forKey: (NSString*) key { [self addString: value forKey: key inTable: @"PPD"]; if (valueTranslation) { [self addString: valueTranslation forKey: key inTable: @"PPDArgumentTranslation"]; } if (optionTranslation) { [self addString: optionTranslation forKey: key inTable: @"PPDOptionTranslation"]; } } // // Adds the string to the array of strings. // Or creates the array if it does not exist and adds the string // -(id) addString: (NSString*) string forKey: (NSString*) key inTable: (NSString*) table { NSMutableDictionary *tableObj; NSMutableArray *array; tableObj = [_tables objectForKey: table]; if (tableObj == nil) NSDebugMLLog(@"GSPrinting", @"Could not find table %@!", table); array = (NSMutableArray*)[tableObj objectForKey:key]; if (array == nil) //it does not exist, create it { array = [NSMutableArray array]; [tableObj setObject: array forKey: key]; } [array addObject: string]; return self; } // Function to convert hexadecimal substrings -(NSString*) interpretQuotedValue: (NSString*) qString { NSScanner *scanner; NSCharacterSet *emptySet; NSString *value = nil; NSString *part; int stringLength; int location; NSRange range; // Don't bother unless there's something to convert range = [qString rangeOfString: @"<"]; if (!range.length) return qString; scanner = [NSScanner scannerWithString: qString]; emptySet = [NSCharacterSet characterSetWithCharactersInString: @""]; [scanner setCharactersToBeSkipped: emptySet]; if (![scanner scanUpToString: @"<" intoString: &value]) { value = [NSString string]; } stringLength = [qString length]; while (![scanner isAtEnd]) { [scanner scanString: @"<" intoString: NULL]; // "<<" is a valid part of a PS string if ([scanner scanString: @"<" intoString: NULL]) { value = [value stringByAppendingString: @"<<"]; } else { [scanner scanCharactersFromSet: [NSCharacterSet whitespaceAndNewlineCharacterSet] intoString: NULL]; while (![scanner scanString: @">" intoString: NULL]) { location = [scanner scanLocation]; if (location+2 > stringLength) { [NSException raise: NSPPDParseException format: @"Badly formatted hexadecimal substring '%@' in \ PPD printer file.", qString]; // NOT REACHED } value = [value stringByAppendingFormat: @"%c", 16 * [self gethex: [qString characterAtIndex: location]] + [self gethex: [qString characterAtIndex: location+1]]]; [scanner setScanLocation: location+2]; [scanner scanCharactersFromSet: [NSCharacterSet whitespaceAndNewlineCharacterSet] intoString: NULL]; } } if ([scanner scanUpToString:@"<" intoString:&part]) { value = [value stringByAppendingString: part]; } } return value; } // Convert a character to a value between 0 and 15 -(int) gethex: (unichar) character { switch (character) { case '0': return 0; case '1': return 1; case '2': return 2; case '3': return 3; case '4': return 4; case '5': return 5; case '6': return 6; case '7': return 7; case '8': return 8; case '9': return 9; case 'A': return 10; case 'B': return 11; case 'C': return 12; case 'D': return 13; case 'E': return 14; case 'F': return 15; case 'a': return 10; case 'b': return 11; case 'c': return 12; case 'd': return 13; case 'e': return 14; case 'f': return 15; } [NSException raise: NSPPDParseException format: @"Badly formatted hexadeximal character '%d' in PPD printer file.", character]; return 0; /* Quiet compiler warnings */ } @end gnustep-gui-0.24.0/Source/NSBitmapImageRep+JPEG.h0000664000076500007650000000304011376454556021200 0ustar brains99brains99/* NSBitmapImageRep+JPEG.h Functionality for reading jpeg images Copyright (C) 2003 Free Software Foundation, Inc. Written by: Stefan Kleine Stegemann Date: Nov 2003 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _NSBitmapImageRep_JPEG_H_include #define _NSBitmapImageRep_JPEG_H_include #import "AppKit/NSBitmapImageRep.h" @interface NSBitmapImageRep (JPEGReading) + (BOOL) _bitmapIsJPEG: (NSData *)imageData; - (id) _initBitmapFromJPEG: (NSData *)imageData errorMessage: (NSString **)errorMsg; - (NSData *) _JPEGRepresentationWithProperties: (NSDictionary *) properties errorMessage: (NSString **)errorMsg; @end #endif // _NSBitmapImageRep_JPEG_H_include gnustep-gui-0.24.0/Source/GSThemeDrawing.m0000664000076500007650000025313212250703717020202 0ustar brains99brains99/** GSThemeDrawing The theme methods for drawing controls Copyright (C) 2004-2010 Free Software Foundation, Inc. Author: Adam Fedor Date: Jan 2004 This file is part of the GNU Objective C User interface library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "GSThemePrivate.h" #import "Foundation/NSUserDefaults.h" #import "Foundation/NSIndexSet.h" #import "AppKit/NSAttributedString.h" #import "AppKit/NSBezierPath.h" #import "AppKit/NSButtonCell.h" #import "AppKit/NSBrowser.h" #import "AppKit/NSCell.h" #import "AppKit/NSColor.h" #import "AppKit/NSColorList.h" #import "AppKit/NSColorWell.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSImage.h" #import "AppKit/NSMenuView.h" #import "AppKit/NSMenuItemCell.h" #import "AppKit/NSParagraphStyle.h" #import "AppKit/NSPopUpButtonCell.h" #import "AppKit/NSProgressIndicator.h" #import "AppKit/NSScroller.h" #import "AppKit/NSScrollView.h" #import "AppKit/NSStringDrawing.h" #import "AppKit/NSTableView.h" #import "AppKit/NSTableColumn.h" #import "AppKit/NSTableHeaderCell.h" #import "AppKit/NSTableHeaderView.h" #import "AppKit/NSView.h" #import "AppKit/NSTabView.h" #import "AppKit/NSTabViewItem.h" #import "AppKit/PSOperators.h" #import "AppKit/NSSliderCell.h" #import "GNUstepGUI/GSToolbarView.h" #import "GNUstepGUI/GSTitleView.h" /* a border width of 5 gives a reasonable compromise between Cocoa metrics and looking good */ /* 7.0 gives us the NeXT Look (which is 8 pix wide including the shadow) */ #define COLOR_WELL_BORDER_WIDTH 7.0 @interface NSTableView (Private) - (float *)_columnOrigins; - (void) _willDisplayCell: (NSCell*)cell forTableColumn: (NSTableColumn *)tb row: (int)index; @end @interface NSCell (Private) - (void) _setInEditing: (BOOL)flag; @end @implementation GSTheme (Drawing) - (void) setKeyEquivalent: (NSString *)key forButtonCell: (NSButtonCell *)cell { if([cell image] == nil && ([key isEqualToString:@"\r"] || [key isEqualToString:@"\n"])) { [cell setImagePosition: NSImageRight]; [cell setImage: [NSImage imageNamed:@"common_ret"]]; [cell setAlternateImage: [NSImage imageNamed:@"common_retH"]]; } else if([key isEqualToString:@"\r"] == NO && [key isEqualToString:@"\n"] == NO) { NSImage *cellImage = [cell image]; if(cellImage == [NSImage imageNamed:@"common_ret"]) { [cell setImage: nil]; [cell setAlternateImage: nil]; } } } - (void) drawButton: (NSRect)frame in: (NSCell*)cell view: (NSView*)view style: (int)style state: (GSThemeControlState)state { GSDrawTiles *tiles = nil; NSColor *color = nil; NSString *name = [self nameForElement: cell]; if (name == nil) { name = GSStringFromBezelStyle(style); } color = [self colorNamed: name state: state]; if (color == nil) { if (state == GSThemeNormalState) { color = [NSColor controlBackgroundColor]; } else if (state == GSThemeHighlightedState || state == GSThemeHighlightedFirstResponderState) { color = [NSColor selectedControlColor]; } else if (state == GSThemeSelectedState || state == GSThemeSelectedFirstResponderState) { color = [NSColor selectedControlColor]; } else { color = [NSColor controlBackgroundColor]; } } tiles = [self tilesNamed: name state: state]; if (tiles == nil) { tiles = [self tilesNamed: @"NSButton" state: state]; } if (tiles == nil) { switch (style) { case NSRoundRectBezelStyle: case NSTexturedRoundedBezelStyle: case NSRoundedBezelStyle: [self drawRoundBezel: frame withColor: color]; break; case NSTexturedSquareBezelStyle: frame = NSInsetRect(frame, 0, 1); case NSSmallSquareBezelStyle: case NSRegularSquareBezelStyle: case NSShadowlessSquareBezelStyle: [color set]; NSRectFill(frame); [[NSColor controlShadowColor] set]; NSFrameRectWithWidth(frame, 1); break; case NSThickSquareBezelStyle: [color set]; NSRectFill(frame); [[NSColor controlShadowColor] set]; NSFrameRectWithWidth(frame, 1.5); break; case NSThickerSquareBezelStyle: [color set]; NSRectFill(frame); [[NSColor controlShadowColor] set]; NSFrameRectWithWidth(frame, 2); break; case NSCircularBezelStyle: frame = NSInsetRect(frame, 3, 3); [self drawCircularBezel: frame withColor: color]; break; case NSHelpButtonBezelStyle: [self drawCircularBezel: frame withColor: color]; { NSDictionary *attributes = [NSDictionary dictionaryWithObject: [NSFont controlContentFontOfSize: 0] forKey: NSFontAttributeName]; NSAttributedString *questionMark = [[[NSAttributedString alloc] initWithString: _(@"?") attributes: attributes] autorelease]; NSRect textRect; textRect.size = [questionMark size]; textRect.origin.x = NSMidX(frame) - (textRect.size.width / 2); textRect.origin.y = NSMidY(frame) - (textRect.size.height / 2); [questionMark drawInRect: textRect]; } break; case NSDisclosureBezelStyle: case NSRoundedDisclosureBezelStyle: case NSRecessedBezelStyle: // FIXME break; default: [color set]; NSRectFill(frame); if (state == GSThemeNormalState || state == GSThemeHighlightedState) { [self drawButton: frame withClip: NSZeroRect]; } else if (state == GSThemeSelectedState || state == GSThemeSelectedFirstResponderState) { [self drawGrayBezel: frame withClip: NSZeroRect]; } else { [self drawButton: frame withClip: NSZeroRect]; } } } else { /* Use tiles to draw button border with central part filled with color */ [self fillRect: frame withTiles: tiles background: color]; } } - (GSThemeMargins) buttonMarginsForCell: (NSCell*)cell style: (int)style state: (GSThemeControlState)state { GSDrawTiles *tiles = nil; NSString *name = [self nameForElement: cell]; GSThemeMargins margins; if (name == nil) { name = GSStringFromBezelStyle(style); } tiles = [self tilesNamed: name state: state]; if (tiles == nil) { tiles = [self tilesNamed: @"NSButton" state: state]; } if (tiles == nil) { switch (style) { case NSRoundRectBezelStyle: case NSTexturedRoundedBezelStyle: case NSRoundedBezelStyle: margins.left = 5; margins.top = 5; margins.right = 5; margins.bottom = 5; return margins; case NSTexturedSquareBezelStyle: margins.left = 3; margins.top = 3; margins.right = 3; margins.bottom = 3; return margins; case NSSmallSquareBezelStyle: case NSRegularSquareBezelStyle: case NSShadowlessSquareBezelStyle: margins.left = 2; margins.top = 2; margins.right = 2; margins.bottom = 2; return margins; case NSThickSquareBezelStyle: margins.left = 3; margins.top = 3; margins.right = 3; margins.bottom = 3; return margins; case NSThickerSquareBezelStyle: margins.left = 4; margins.top = 4; margins.right = 4; margins.bottom = 4; return margins; case NSCircularBezelStyle: margins.left = 5; margins.top = 5; margins.right = 5; margins.bottom = 5; return margins; case NSHelpButtonBezelStyle: margins.left = 2; margins.top = 2; margins.right = 2; margins.bottom = 2; return margins; case NSDisclosureBezelStyle: case NSRoundedDisclosureBezelStyle: case NSRecessedBezelStyle: // FIXME margins.left = 0; margins.top = 0; margins.right = 0; margins.bottom = 0; return margins; default: margins.left = 2; margins.top = 2; margins.right = 3; margins.bottom = 3; return margins; } } else { margins = [tiles themeMargins]; return margins; } } - (void) drawFocusFrame: (NSRect) frame view: (NSView*) view { GSDrawTiles *tiles = [self tilesNamed: @"NSFocusRing" state: GSThemeNormalState]; if (tiles == nil) { NSDottedFrameRect(frame); } else { [self fillRect: frame withTiles: tiles]; } } - (void) drawWindowBackground: (NSRect) frame view: (NSView*) view { NSColor *c; c = [[view window] backgroundColor]; [c set]; NSRectFill (frame); } - (void) drawBorderType: (NSBorderType)aType frame: (NSRect)frame view: (NSView*)view { NSString *name = GSStringFromBorderType(aType); GSDrawTiles *tiles = [self tilesNamed: name state: GSThemeNormalState]; if (tiles == nil) { switch (aType) { case NSLineBorder: [[NSColor controlDarkShadowColor] set]; NSFrameRect(frame); break; case NSGrooveBorder: [self drawGroove: frame withClip: NSZeroRect]; break; case NSBezelBorder: [self drawWhiteBezel: frame withClip: NSZeroRect]; break; case NSNoBorder: default: break; } } else { [self fillRect: frame withTiles: tiles]; } } - (NSSize) sizeForBorderType: (NSBorderType)aType { NSString *name = GSStringFromBorderType(aType); GSDrawTiles *tiles = [self tilesNamed: name state: GSThemeNormalState]; if (tiles == nil) { // Returns the size of a border switch (aType) { case NSLineBorder: return NSMakeSize(1, 1); case NSGrooveBorder: case NSBezelBorder: return NSMakeSize(2, 2); case NSNoBorder: default: return NSZeroSize; } } else { // FIXME: We assume the button's top and right padding are the same as // its bottom and left. GSThemeMargins margins = [tiles themeMargins]; return NSMakeSize(margins.left, margins.bottom); } } - (void) drawBorderForImageFrameStyle: (NSImageFrameStyle)frameStyle frame: (NSRect)frame view: (NSView*)view { NSString *name = GSStringFromImageFrameStyle(frameStyle); GSDrawTiles *tiles = [self tilesNamed: name state: GSThemeNormalState]; if (tiles == nil) { switch (frameStyle) { case NSImageFrameNone: // do nothing break; case NSImageFramePhoto: [self drawFramePhoto: frame withClip: NSZeroRect]; break; case NSImageFrameGrayBezel: [self drawGrayBezel: frame withClip: NSZeroRect]; break; case NSImageFrameGroove: [self drawGroove: frame withClip: NSZeroRect]; break; case NSImageFrameButton: [self drawButton: frame withClip: NSZeroRect]; break; } } else { [self fillRect: frame withTiles: tiles]; } } - (NSSize) sizeForImageFrameStyle: (NSImageFrameStyle)frameStyle { // Get border size switch (frameStyle) { case NSImageFrameNone: default: return NSZeroSize; case NSImageFramePhoto: // FIXME return NSMakeSize(2, 2); case NSImageFrameGrayBezel: case NSImageFrameGroove: case NSImageFrameButton: return NSMakeSize(2, 2); } } /* NSScroller themeing. */ - (BOOL) scrollerArrowsSameEndForScroller: (NSScroller *)aScroller { NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; if ([defs objectForKey: @"GSScrollerArrowsSameEnd"] != nil) { return [defs boolForKey: @"GSScrollerArrowsSameEnd"]; } else { NSInterfaceStyle interfaceStyle = NSInterfaceStyleForKey(@"NSScrollerInterfaceStyle", aScroller); if ((interfaceStyle == NSNextStepInterfaceStyle || interfaceStyle == NSMacintoshInterfaceStyle || interfaceStyle == GSWindowMakerInterfaceStyle)) { return YES; } else { return NO; } } } - (BOOL) scrollerScrollsByPageForScroller: (NSScroller *)aScroller { NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; if ([defs objectForKey: @"GSScrollerScrollsByPage"] != nil) { return [defs boolForKey: @"GSScrollerScrollsByPage"]; } else { NSInterfaceStyle interfaceStyle = NSInterfaceStyleForKey(@"NSScrollerInterfaceStyle", aScroller); if (interfaceStyle == NSNextStepInterfaceStyle || interfaceStyle == NSMacintoshInterfaceStyle || interfaceStyle == GSWindowMakerInterfaceStyle) { /* NeXTstep style is to scroll to point. */ return NO; } else { /* Windows style is to scroll by a page. */ return YES; } } } - (NSButtonCell*) cellForScrollerArrow: (NSScrollerArrow)arrow horizontal: (BOOL)horizontal { NSButtonCell *cell; NSString *name; cell = [NSButtonCell new]; if (horizontal) { if (arrow == NSScrollerDecrementArrow) { [cell setHighlightsBy: NSChangeBackgroundCellMask | NSContentsCellMask]; [cell setImage: [NSImage imageNamed: @"common_ArrowLeft"]]; [cell setAlternateImage: [NSImage imageNamed: @"common_ArrowLeftH"]]; [cell setImagePosition: NSImageOnly]; name = GSScrollerLeftArrow; } else { [cell setHighlightsBy: NSChangeBackgroundCellMask | NSContentsCellMask]; [cell setImage: [NSImage imageNamed: @"common_ArrowRight"]]; [cell setAlternateImage: [NSImage imageNamed: @"common_ArrowRightH"]]; [cell setImagePosition: NSImageOnly]; name = GSScrollerRightArrow; } } else { if (arrow == NSScrollerDecrementArrow) { [cell setHighlightsBy: NSChangeBackgroundCellMask | NSContentsCellMask]; [cell setImage: [NSImage imageNamed: @"common_ArrowUp"]]; [cell setAlternateImage: [NSImage imageNamed: @"common_ArrowUpH"]]; [cell setImagePosition: NSImageOnly]; name = GSScrollerUpArrow; } else { [cell setHighlightsBy: NSChangeBackgroundCellMask | NSContentsCellMask]; [cell setImage: [NSImage imageNamed: @"common_ArrowDown"]]; [cell setAlternateImage: [NSImage imageNamed: @"common_ArrowDownH"]]; [cell setImagePosition: NSImageOnly]; name = GSScrollerDownArrow; } } [self setName: name forElement: cell temporary: YES]; RELEASE(cell); return cell; } - (NSCell*) cellForScrollerKnob: (BOOL)horizontal { NSButtonCell *cell; cell = [NSButtonCell new]; [cell setButtonType: NSMomentaryChangeButton]; [cell setImagePosition: NSImageOnly]; if (horizontal) { [self setName: GSScrollerHorizontalKnob forElement: cell temporary: YES]; [cell setImage: [NSImage imageNamed: @"common_DimpleHoriz"]]; } else { [self setName: GSScrollerVerticalKnob forElement: cell temporary: YES]; [cell setImage: [NSImage imageNamed: @"common_Dimple"]]; } RELEASE(cell); return cell; } - (NSCell*) cellForScrollerKnobSlot: (BOOL)horizontal { GSDrawTiles *tiles; NSButtonCell *cell; NSColor *color; NSString *name; if (horizontal) { name = GSScrollerHorizontalSlot; } else { name = GSScrollerVerticalSlot; } tiles = [self tilesNamed: name state: GSThemeNormalState]; color = [self colorNamed: name state: GSThemeNormalState]; cell = [NSButtonCell new]; [cell setBordered: (tiles != nil)]; [cell setTitle: nil]; [self setName: name forElement: cell temporary: YES]; if (color == nil) { color = [NSColor scrollBarColor]; } [cell setBackgroundColor: color]; RELEASE(cell); return cell; } - (float) defaultScrollerWidth { NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; float defaultScrollerWidth; if ([defs objectForKey: @"GSScrollerDefaultWidth"] != nil) { defaultScrollerWidth = [defs floatForKey: @"GSScrollerDefaultWidth"]; } else { defaultScrollerWidth = 18.0; } return defaultScrollerWidth; } - (BOOL) scrollViewUseBottomCorner { NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; if ([defs objectForKey: @"GSScrollViewUseBottomCorner"] != nil) { return [defs boolForKey: @"GSScrollViewUseBottomCorner"]; } return YES; } - (BOOL) scrollViewScrollersOverlapBorders { NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; if ([defs objectForKey: @"GSScrollViewScrollersOverlapBorders"] != nil) { return [defs boolForKey: @"GSScrollViewScrollersOverlapBorders"]; } return NO; } - (NSColor *) toolbarBackgroundColor { NSColor *color; color = [self colorNamed: @"toolbarBackgroundColor" state: GSThemeNormalState]; if (color == nil) { color = [NSColor clearColor]; } return color; } - (NSColor *) toolbarBorderColor { NSColor *color; color = [self colorNamed: @"toolbarBorderColor" state: GSThemeNormalState]; if (color == nil) { color = [NSColor darkGrayColor]; } return color; } - (void) drawToolbarRect: (NSRect)aRect frame: (NSRect)viewFrame borderMask: (unsigned int)borderMask { // We draw the background [[self toolbarBackgroundColor] set]; [NSBezierPath fillRect: aRect]; // We draw the border [[self toolbarBorderColor] set]; if (borderMask & GSToolbarViewBottomBorder) { [NSBezierPath strokeLineFromPoint: NSMakePoint(0, 0.5) toPoint: NSMakePoint(viewFrame.size.width, 0.5)]; } if (borderMask & GSToolbarViewTopBorder) { [NSBezierPath strokeLineFromPoint: NSMakePoint(0, viewFrame.size.height - 0.5) toPoint: NSMakePoint(viewFrame.size.width, viewFrame.size.height - 0.5)]; } if (borderMask & GSToolbarViewLeftBorder) { [NSBezierPath strokeLineFromPoint: NSMakePoint(0.5, 0) toPoint: NSMakePoint(0.5, viewFrame.size.height)]; } if (borderMask & GSToolbarViewRightBorder) { [NSBezierPath strokeLineFromPoint: NSMakePoint(viewFrame.size.width - 0.5,0) toPoint: NSMakePoint(viewFrame.size.width - 0.5, viewFrame.size.height)]; } } - (BOOL) toolbarIsOpaque { if ([[self toolbarBackgroundColor] alphaComponent] < 1.0) { return NO; } else { return YES; } } - (NSRect) stepperUpButtonRectWithFrame: (NSRect)frame { NSSize size = [[NSImage imageNamed: @"common_StepperUp"] size]; NSRect upRect; upRect.size = size; upRect.origin.x = NSMaxX(frame) - size.width; upRect.origin.y = NSMinY(frame) + ((int)frame.size.height / 2) + 1; return upRect; } - (NSRect) stepperDownButtonRectWithFrame: (NSRect)frame { NSSize size = [[NSImage imageNamed: @"common_StepperDown"] size]; NSRect downRect; downRect.size = size; downRect.origin.x = NSMaxX(frame) - size.width; downRect.origin.y = NSMinY(frame) + ((int)frame.size.height / 2) - size.height + 1; return downRect; } - (void) drawStepperBorder: (NSRect)frame { } - (NSRect) drawStepperLightButton: (NSRect)border : (NSRect)clip { return NSZeroRect; } - (void) drawStepperUpButton: (NSRect)aRect { NSImage *image = [NSImage imageNamed: @"common_StepperUp"]; [image drawInRect: aRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1 respectFlipped: YES hints: nil]; } - (void) drawStepperHighlightUpButton: (NSRect)aRect { NSImage *image = [NSImage imageNamed: @"common_StepperUpHighlighted"]; [image drawInRect: aRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1 respectFlipped: YES hints: nil]; } - (void) drawStepperDownButton: (NSRect)aRect { NSImage *image = [NSImage imageNamed: @"common_StepperDown"]; [image drawInRect: aRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1 respectFlipped: YES hints: nil]; } - (void) drawStepperHighlightDownButton: (NSRect)aRect { NSImage *image = [NSImage imageNamed: @"common_StepperDownHighlighted"]; [image drawInRect: aRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1 respectFlipped: YES hints: nil]; } - (void) drawStepperCell: (NSCell*)cell withFrame: (NSRect)cellFrame inView: (NSView*)controlView highlightUp: (BOOL)highlightUp highlightDown: (BOOL)highlightDown { const NSRect upRect = [self stepperUpButtonRectWithFrame: cellFrame]; const NSRect downRect = [self stepperDownButtonRectWithFrame: cellFrame]; [self drawStepperBorder: cellFrame]; if (highlightUp) [self drawStepperHighlightUpButton: upRect]; else [self drawStepperUpButton: upRect]; if (highlightDown) [self drawStepperHighlightDownButton: downRect]; else [self drawStepperDownButton: downRect]; } // NSSegmentedControl drawing methods - (void) drawSegmentedControlSegment: (NSCell *)cell withFrame: (NSRect)cellFrame inView: (NSView *)controlView style: (NSSegmentStyle)style state: (GSThemeControlState)state roundedLeft: (BOOL)roundedLeft roundedRight: (BOOL)roundedRight { GSDrawTiles *tiles; NSString *name = GSStringFromSegmentStyle(style); if (roundedLeft) { name = [name stringByAppendingString: @"RoundedLeft"]; } if (roundedRight) { name = [name stringByAppendingString: @"RoundedRight"]; } tiles = [self tilesNamed: name state: state]; if (tiles == nil) { [self drawButton: cellFrame in: cell view: controlView style: NSRegularSquareBezelStyle state: state]; } else { [self fillRect: cellFrame withTiles: tiles]; } } - (NSColor *) menuBackgroundColor { NSColor *color = [self colorNamed: @"menuBackgroundColor" state: GSThemeNormalState]; if (color == nil) { color = [NSColor windowBackgroundColor]; } return color; } - (NSColor *) menuItemBackgroundColor { NSColor *color = [self colorNamed: @"menuItemBackgroundColor" state: GSThemeNormalState]; if (color == nil) { color = [NSColor controlBackgroundColor]; } return color; } - (NSColor *) menuBorderColor { NSColor *color = [self colorNamed: @"menuBorderColor" state: GSThemeNormalState]; if (color == nil) { color = [NSColor darkGrayColor]; } return color; } - (NSColor *) menuBarBackgroundColor { NSColor *color = [self colorNamed: @"menuBarBackgroundColor" state: GSThemeNormalState]; if (color == nil) { color = [self menuBackgroundColor]; } return color; } - (NSColor *) menuBarBorderColor { NSColor *color = [self colorNamed: @"menuBarBorderColor" state: GSThemeNormalState]; if (color == nil) { color = [self menuBorderColor]; } return color; } - (NSColor *) menuBorderColorForEdge: (NSRectEdge)edge isHorizontal: (BOOL)horizontal { if (horizontal && edge == NSMinYEdge) { return [self menuBorderColor]; } else if (edge == NSMinXEdge || edge == NSMaxYEdge) { // Draw the dark gray upper left lines. return [self menuBorderColor]; } return nil; } - (void) drawBackgroundForMenuView: (NSMenuView*)menuView withFrame: (NSRect)bounds dirtyRect: (NSRect)dirtyRect horizontal: (BOOL)horizontal { NSString *name = horizontal ? GSMenuHorizontalBackground : GSMenuVerticalBackground; GSDrawTiles *tiles = [self tilesNamed: name state: GSThemeNormalState]; if (tiles == nil) { NSRectEdge sides[4] = { NSMinXEdge, NSMaxYEdge, NSMaxXEdge, NSMinYEdge }; NSColor *colors[] = {[self menuBorderColorForEdge: NSMinXEdge isHorizontal: horizontal], [self menuBorderColorForEdge: NSMaxYEdge isHorizontal: horizontal], [self menuBorderColorForEdge: NSMaxXEdge isHorizontal: horizontal], [self menuBorderColorForEdge: NSMinYEdge isHorizontal: horizontal]}; [[self menuBackgroundColor] set]; NSRectFill(NSIntersectionRect(bounds, dirtyRect)); NSDrawColorTiledRects(bounds, dirtyRect, sides, colors, 4); } else { [self fillRect: bounds withTiles: tiles]; } } - (BOOL) drawsBorderForMenuItemCell: (NSMenuItemCell *)cell state: (GSThemeControlState)state isHorizontal: (BOOL)horizontal { return [cell isBordered]; } - (void) drawBorderAndBackgroundForMenuItemCell: (NSMenuItemCell *)cell withFrame: (NSRect)cellFrame inView: (NSView *)controlView state: (GSThemeControlState)state isHorizontal: (BOOL)isHorizontal { NSString *name = isHorizontal ? GSMenuHorizontalItem : GSMenuVerticalItem; GSDrawTiles *tiles = [self tilesNamed: name state: state]; if (tiles == nil) { NSColor *backgroundColor = [cell backgroundColor]; if (isHorizontal) { cellFrame = [cell drawingRectForBounds: cellFrame]; [backgroundColor set]; NSRectFill(cellFrame); return; } // Set cell's background color [backgroundColor set]; NSRectFill(cellFrame); if (![self drawsBorderForMenuItemCell: cell state: state isHorizontal: isHorizontal]) { return; } if (state == GSThemeSelectedState) { [self drawGrayBezel: cellFrame withClip: NSZeroRect]; } else { [self drawButton: cellFrame withClip: NSZeroRect]; } } else { [self fillRect: cellFrame withTiles: tiles]; } } - (NSColor *) menuSeparatorColor { NSColor *color = [self colorNamed: @"menuSeparatorColor" state: GSThemeNormalState]; NSInterfaceStyle style = NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil); // TODO: Remove the style check... Windows theming should be in a subclass // probably if (color == nil && style == NSWindows95InterfaceStyle) { color = [NSColor blackColor]; } return color; } - (CGFloat) menuSeparatorInset { return 3.0; } - (CGFloat) menuSubmenuHorizontalOverlap { return [[NSUserDefaults standardUserDefaults] floatForKey: @"GSMenuSubmenuHorizontalOverlap"]; } - (CGFloat) menuSubmenuVerticalOverlap { return [[NSUserDefaults standardUserDefaults] floatForKey: @"GSMenuSubmenuVerticalOverlap"]; } - (void) drawSeparatorItemForMenuItemCell: (NSMenuItemCell *)cell withFrame: (NSRect)cellFrame inView: (NSView *)controlView isHorizontal: (BOOL)isHorizontal { GSDrawTiles *tiles = [self tilesNamed: GSMenuSeparatorItem state: GSThemeNormalState]; if (tiles == nil) { NSBezierPath *path = [NSBezierPath bezierPath]; CGFloat inset = [self menuSeparatorInset]; NSPoint start = NSMakePoint(inset, cellFrame.size.height / 2 + cellFrame.origin.y + 0.5); NSPoint end = NSMakePoint(cellFrame.size.width - inset, cellFrame.size.height / 2 + cellFrame.origin.y + 0.5); [[self menuSeparatorColor] set]; [path setLineWidth: 0.0]; [path moveToPoint: start]; [path lineToPoint: end]; [path stroke]; } else { [self fillRect: cellFrame withTiles: tiles]; } } - (void) drawTitleForMenuItemCell: (NSMenuItemCell *)cell withFrame: (NSRect)cellFrame inView: (NSView *)controlView state: (GSThemeControlState)state isHorizontal: (BOOL)isHorizontal { [cell _drawText: [[cell menuItem] title] inFrame: [cell titleRectForBounds: cellFrame]]; } - (Class) titleViewClassForMenuView: (NSMenuView *)aMenuView { return [GSTitleView class]; } - (NSRect) drawMenuTitleBackground: (GSTitleView *)aTitleView withBounds: (NSRect)bounds withClip: (NSRect)clipRect { GSDrawTiles *tiles = [self tilesNamed: GSMenuTitleBackground state: GSThemeNormalState]; if (tiles == nil) { NSRect workRect = bounds; NSRectEdge top_left[] = {NSMinXEdge, NSMaxYEdge}; CGFloat darkGrays[] = {NSDarkGray, NSDarkGray}; NSColor *titleColor; titleColor = [self colorNamed: @"GSMenuBar" state: GSThemeNormalState]; if (titleColor == nil) { titleColor = [NSColor blackColor]; } // Draw the dark gray upper left lines for menu and black for others. // Rectangle 1 workRect = NSDrawTiledRects(workRect, workRect, top_left, darkGrays, 2); // Rectangle 2 // Draw the title box's button. [self drawButton: workRect withClip: workRect]; // Overdraw white top and left lines with light gray lines for window title workRect.origin.y += 1; workRect.size.height -= 1; workRect.size.width -= 1; // Rectangle 3 // Paint background workRect.origin.x += 1; workRect.origin.y += 1; workRect.size.height -= 2; workRect.size.width -= 2; [titleColor set]; NSRectFill(workRect); return workRect; } else { return [self fillRect: bounds withTiles: tiles]; } } - (CGFloat) menuBarHeight { CGFloat height = [[NSUserDefaults standardUserDefaults] floatForKey: @"GSMenuBarHeight"]; if (height <= 0) { return 22; } return height; } - (CGFloat) menuItemHeight { CGFloat height = [[NSUserDefaults standardUserDefaults] floatForKey: @"GSMenuItemHeight"]; if (height <= 0) { return 20; } return height; } - (CGFloat) menuSeparatorHeight { CGFloat height = [[NSUserDefaults standardUserDefaults] floatForKey: @"GSMenuSeparatorHeight"]; if (height <= 0) { return 20; } return height; } // NSColorWell drawing method - (NSRect) drawColorWellBorder: (NSColorWell*)well withBounds: (NSRect)bounds withClip: (NSRect)clipRect { NSRect aRect = bounds; if ([well isBordered]) { GSThemeControlState state; GSDrawTiles *tiles; if ([[well cell] isHighlighted] || [well isActive]) { state = GSThemeHighlightedState; } else { state = GSThemeNormalState; } tiles = [self tilesNamed: GSColorWell state: state]; if (tiles == nil) { /* * Draw border. */ [self drawButton: aRect withClip: clipRect]; /* * Fill in control color. */ if (state == GSThemeHighlightedState) { [[NSColor selectedControlColor] set]; } else { [[NSColor controlColor] set]; } aRect = NSInsetRect(aRect, 2.0, 2.0); NSRectFill(NSIntersectionRect(aRect, clipRect)); } else { aRect = [self fillRect: aRect withTiles: tiles]; } /* * Set an inset rect for the color area */ aRect = NSInsetRect(bounds, COLOR_WELL_BORDER_WIDTH, COLOR_WELL_BORDER_WIDTH); } /* * OpenStep 4.2 behavior is to omit the inner border for * non-enabled NSColorWell objects. */ if ([well isEnabled]) { GSDrawTiles *tiles = [self tilesNamed: GSColorWellInnerBorder state: GSThemeNormalState]; if (tiles == nil) { /* * Draw inner frame. */ [self drawGrayBezel: aRect withClip: clipRect]; aRect = NSInsetRect(aRect, 2.0, 2.0); } else { [self fillRect: aRect withTiles: tiles]; aRect = [tiles contentRectForRect: aRect isFlipped: [well isFlipped]]; } } return aRect; } // progress indicator drawing methods static NSColor *fillColour = nil; #define MaxCount 10 static int indeterminateMaxCount = MaxCount; static int spinningMaxCount = MaxCount; static NSColor *indeterminateColors[MaxCount]; static NSImage *spinningImages[MaxCount]; - (void) initProgressIndicatorDrawing { int i; // FIXME: Should come from defaults and should be reset when defaults change // FIXME: Should probably get the color from the color extension list (see NSToolbar) fillColour = RETAIN([NSColor controlShadowColor]); // Load images for indeterminate style for (i = 0; i < MaxCount; i++) { NSString *imgName = [NSString stringWithFormat: @"common_ProgressIndeterminate_%d", i + 1]; NSImage *image = [NSImage imageNamed: imgName]; if (image == nil) { indeterminateMaxCount = i; break; } indeterminateColors[i] = RETAIN([NSColor colorWithPatternImage: image]); } // Load images for spinning style for (i = 0; i < MaxCount; i++) { NSString *imgName = [NSString stringWithFormat: @"common_ProgressSpinning_%d", i + 1]; NSImage *image = [NSImage imageNamed: imgName]; if (image == nil) { spinningMaxCount = i; break; } spinningImages[i] = RETAIN(image); } } - (void) drawProgressIndicator: (NSProgressIndicator*)progress withBounds: (NSRect)bounds withClip: (NSRect)rect atCount: (int)count forValue: (double)val { NSRect r; if (fillColour == nil) { [self initProgressIndicatorDrawing]; } // Draw the Bezel if ([progress isBezeled]) { // Calc the inside rect to be drawn r = [self drawProgressIndicatorBezel: bounds withClip: rect]; } else { r = bounds; } if ([progress style] == NSProgressIndicatorSpinningStyle) { NSRect imgBox = {{0,0}, {0,0}}; if (spinningMaxCount != 0) { count = count % spinningMaxCount; imgBox.size = [spinningImages[count] size]; [spinningImages[count] drawInRect: r fromRect: imgBox operation: NSCompositeSourceOver fraction: 1.0]; } } else { if ([progress isIndeterminate]) { if (indeterminateMaxCount != 0) { count = count % indeterminateMaxCount; [indeterminateColors[count] set]; NSRectFill(r); } } else { // Draw determinate if ([progress isVertical]) { float height = NSHeight(r) * val; if ([progress isFlipped]) { // Compensate for the flip r.origin.y += NSHeight(r) - height; } r.size.height = height; } else { r.size.width = NSWidth(r) * val; } r = NSIntersectionRect(r, rect); if (!NSIsEmptyRect(r)) { [self drawProgressIndicatorBarDeterminate: (NSRect)r]; } } } } - (NSRect) drawProgressIndicatorBezel: (NSRect)bounds withClip: (NSRect) rect { GSDrawTiles *tiles = [self tilesNamed: GSProgressIndicatorBezel state: GSThemeNormalState]; if (tiles == nil) { return [self drawGrayBezel: bounds withClip: rect]; } else { [self fillRect: bounds withTiles: tiles]; return [tiles contentRectForRect: bounds isFlipped: [[NSView focusView] isFlipped]]; } } - (void) drawProgressIndicatorBarDeterminate: (NSRect)bounds { GSDrawTiles *tiles = [self tilesNamed: GSProgressIndicatorBarDeterminate state: GSThemeNormalState]; if (tiles == nil) { [fillColour set]; NSRectFill(bounds); } else { [self fillRect: bounds withTiles: tiles background: fillColour]; } } // Table drawing methods - (NSColor *) tableHeaderTextColorForState: (GSThemeControlState)state { NSColor *color; color = [self colorNamed: @"tableHeaderTextColor" state: state]; if (color == nil) { if (state == GSThemeHighlightedState) color = [NSColor controlTextColor]; else color = [NSColor windowFrameTextColor]; } return color; } - (void) drawTableCornerView: (NSView*)cornerView withClip: (NSRect)aRect { NSRect divide; NSRect rect; GSDrawTiles *tiles = [self tilesNamed: GSTableCorner state: GSThemeNormalState]; if ([cornerView isFlipped]) { NSDivideRect(aRect, ÷, &rect, 1.0, NSMaxYEdge); } else { NSDivideRect(aRect, ÷, &rect, 1.0, NSMinYEdge); } if (tiles == nil) { [[NSColor blackColor] set]; NSRectFill(divide); rect = [self drawDarkButton: rect withClip: aRect]; [[NSColor controlShadowColor] set]; NSRectFill(rect); } else { [self fillRect: aRect withTiles: tiles]; } } - (void) drawTableHeaderCell: (NSTableHeaderCell *)cell withFrame: (NSRect)cellFrame inView: (NSView *)controlView state: (GSThemeControlState)state { GSDrawTiles *tiles = [self tilesNamed: GSTableHeader state: state]; if (tiles == nil) { NSRect rect; // Leave a 1pt thick horizontal line underneath the header if (![controlView isFlipped]) { cellFrame.origin.y++; } cellFrame.size.height--; if (state == GSThemeHighlightedState) { rect = [self drawButton: cellFrame withClip: cellFrame]; [[NSColor controlColor] set]; NSRectFill(rect); } else { rect = [self drawDarkButton: cellFrame withClip: cellFrame]; [[NSColor controlShadowColor] set]; NSRectFill(rect); } } else { [self fillRect: cellFrame withTiles: tiles]; } } // Window decoration drawing methods /* These include the black border. */ #define TITLE_HEIGHT 23.0 #define RESIZE_HEIGHT 9.0 - (float) titlebarHeight { return TITLE_HEIGHT; } - (float) resizebarHeight { return RESIZE_HEIGHT; } static NSDictionary *titleTextAttributes[3] = {nil, nil, nil}; - (void) drawTitleBarRect: (NSRect)titleBarRect forStyleMask: (unsigned int)styleMask state: (int)inputState andTitle: (NSString*)title { static const NSRectEdge edges[4] = {NSMinXEdge, NSMaxYEdge, NSMaxXEdge, NSMinYEdge}; CGFloat grays[3][4] = {{NSLightGray, NSLightGray, NSDarkGray, NSDarkGray}, {NSWhite, NSWhite, NSDarkGray, NSDarkGray}, {NSLightGray, NSLightGray, NSBlack, NSBlack}}; NSRect workRect; GSDrawTiles *tiles = nil; if (!titleTextAttributes[0]) { NSMutableParagraphStyle *p; NSColor *keyColor, *normalColor, *mainColor; p = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; [p setLineBreakMode: NSLineBreakByClipping]; // FIXME: refine color names based on style mask // (HUD or textured or regular window) keyColor = [self colorNamed: @"keyWindowFrameTextColor" state: GSThemeNormalState]; if (nil == keyColor) { keyColor = [NSColor windowFrameTextColor]; } normalColor = [self colorNamed: @"normalWindowFrameTextColor" state: GSThemeNormalState]; if (nil == normalColor) { normalColor = [NSColor blackColor]; } mainColor = [self colorNamed: @"mainWindowFrameTextColor" state: GSThemeNormalState]; if (nil == mainColor) { mainColor = [NSColor windowFrameTextColor]; } titleTextAttributes[0] = [[NSMutableDictionary alloc] initWithObjectsAndKeys: [NSFont titleBarFontOfSize: 0], NSFontAttributeName, keyColor, NSForegroundColorAttributeName, p, NSParagraphStyleAttributeName, nil]; titleTextAttributes[1] = [[NSMutableDictionary alloc] initWithObjectsAndKeys: [NSFont titleBarFontOfSize: 0], NSFontAttributeName, normalColor, NSForegroundColorAttributeName, p, NSParagraphStyleAttributeName, nil]; titleTextAttributes[2] = [[NSMutableDictionary alloc] initWithObjectsAndKeys: [NSFont titleBarFontOfSize: 0], NSFontAttributeName, mainColor, NSForegroundColorAttributeName, p, NSParagraphStyleAttributeName, nil]; RELEASE(p); } tiles = [self tilesNamed: @"GSWindowTitleBar" state: GSThemeNormalState]; if (tiles == nil) { /* Draw the black border towards the rest of the window. (The outer black border is drawn in -drawRect: since it might be drawn even if we don't have a title bar. */ NSColor *borderColor = [self colorNamed: @"windowBorderColor" state: GSThemeNormalState]; if (nil == borderColor) { borderColor = [NSColor blackColor]; } [borderColor set]; PSmoveto(0, NSMinY(titleBarRect) + 0.5); PSrlineto(titleBarRect.size.width, 0); PSstroke(); /* Draw the button-like border. */ workRect = titleBarRect; workRect.origin.x += 1; workRect.origin.y += 1; workRect.size.width -= 2; workRect.size.height -= 2; workRect = NSDrawTiledRects(workRect, workRect, edges, grays[inputState], 4); /* Draw the background. */ switch (inputState) { default: case 0: [[NSColor windowFrameColor] set]; break; case 1: [[NSColor lightGrayColor] set]; break; case 2: [[NSColor darkGrayColor] set]; break; } NSRectFill(workRect); } else { [self fillRect: titleBarRect withTiles: tiles background: [NSColor windowFrameColor]]; workRect = titleBarRect; } /* Draw the title. */ if (styleMask & NSTitledWindowMask) { NSSize titleSize; if (styleMask & NSMiniaturizableWindowMask) { workRect.origin.x += 17; workRect.size.width -= 17; } if (styleMask & NSClosableWindowMask) { workRect.size.width -= 17; } titleSize = [title sizeWithAttributes: titleTextAttributes[inputState]]; if (titleSize.width <= workRect.size.width) workRect.origin.x = NSMidX(workRect) - titleSize.width / 2; workRect.origin.y = NSMidY(workRect) - titleSize.height / 2; workRect.size.height = titleSize.height; [title drawInRect: workRect withAttributes: titleTextAttributes[inputState]]; } } // FIXME: Would be good if this took the window as a param - (void) drawResizeBarRect: (NSRect)resizeBarRect { GSDrawTiles *tiles; tiles = [self tilesNamed: @"GSWindowResizeBar" state: GSThemeNormalState]; if (tiles == nil) { [[NSColor lightGrayColor] set]; PSrectfill(1.0, 1.0, resizeBarRect.size.width - 2.0, RESIZE_HEIGHT - 3.0); PSsetlinewidth(1.0); [[NSColor blackColor] set]; PSmoveto(0.0, 0.5); PSlineto(resizeBarRect.size.width, 0.5); PSstroke(); [[NSColor darkGrayColor] set]; PSmoveto(1.0, RESIZE_HEIGHT - 0.5); PSlineto(resizeBarRect.size.width - 1.0, RESIZE_HEIGHT - 0.5); PSstroke(); [[NSColor whiteColor] set]; PSmoveto(1.0, RESIZE_HEIGHT - 1.5); PSlineto(resizeBarRect.size.width - 1.0, RESIZE_HEIGHT - 1.5); PSstroke(); /* Only draw the notches if there's enough space. */ if (resizeBarRect.size.width < 30 * 2) return; [[NSColor darkGrayColor] set]; PSmoveto(27.5, 1.0); PSlineto(27.5, RESIZE_HEIGHT - 2.0); PSmoveto(resizeBarRect.size.width - 28.5, 1.0); PSlineto(resizeBarRect.size.width - 28.5, RESIZE_HEIGHT - 2.0); PSstroke(); [[NSColor whiteColor] set]; PSmoveto(28.5, 1.0); PSlineto(28.5, RESIZE_HEIGHT - 2.0); PSmoveto(resizeBarRect.size.width - 27.5, 1.0); PSlineto(resizeBarRect.size.width - 27.5, RESIZE_HEIGHT - 2.0); PSstroke(); } else { [self fillRect: resizeBarRect withTiles: tiles]; } } - (void) drawWindowBorder: (NSRect)rect withFrame: (NSRect)frame forStyleMask: (unsigned int)styleMask state: (int)inputState andTitle: (NSString*)title { if (styleMask & (NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask)) { NSRect titleBarRect; titleBarRect = NSMakeRect(0.0, frame.size.height - TITLE_HEIGHT, frame.size.width, TITLE_HEIGHT); if (NSIntersectsRect(rect, titleBarRect)) [self drawTitleBarRect: titleBarRect forStyleMask: styleMask state: inputState andTitle: title]; } if (styleMask & NSResizableWindowMask) { NSRect resizeBarRect; resizeBarRect = NSMakeRect(0.0, 0.0, frame.size.width, RESIZE_HEIGHT); if (NSIntersectsRect(rect, resizeBarRect)) [self drawResizeBarRect: resizeBarRect]; } if (styleMask & (NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask)) { NSColor *borderColor = [self colorNamed: @"windowBorderColor" state: GSThemeNormalState]; if (nil == borderColor) { borderColor = [NSColor blackColor]; } [borderColor set]; PSsetlinewidth(1.0); if (NSMinX(rect) < 1.0) { PSmoveto(0.5, 0.0); PSlineto(0.5, frame.size.height); PSstroke(); } if (NSMaxX(rect) > frame.size.width - 1.0) { PSmoveto(frame.size.width - 0.5, 0.0); PSlineto(frame.size.width - 0.5, frame.size.height); PSstroke(); } if (NSMaxY(rect) > frame.size.height - 1.0) { PSmoveto(0.0, frame.size.height - 0.5); PSlineto(frame.size.width, frame.size.height - 0.5); PSstroke(); } if (NSMinY(rect) < 1.0) { PSmoveto(0.0, 0.5); PSlineto(frame.size.width, 0.5); PSstroke(); } } } - (NSColor *) browserHeaderTextColor { NSColor *color; color = [self colorNamed: @"browserHeaderTextColor" state: GSThemeNormalState]; if (color == nil) { color = [NSColor windowFrameTextColor]; } return color; } - (void) drawBrowserHeaderCell: (NSTableHeaderCell*)cell withFrame: (NSRect)rect inView: (NSView*)view; { GSDrawTiles *tiles; tiles = [self tilesNamed: GSBrowserHeader state: GSThemeNormalState]; if (tiles == nil) { [self drawGrayBezel: rect withClip: NSZeroRect]; [cell _drawBackgroundWithFrame: rect inView: view]; } else { [self fillRect: rect withTiles: tiles]; } } - (NSRect) browserHeaderDrawingRectForCell: (NSTableHeaderCell*)cell withFrame: (NSRect)rect { GSDrawTiles *tiles; tiles = [self tilesNamed: GSBrowserHeader state: GSThemeNormalState]; if (tiles == nil) { return NSInsetRect(rect, 2, 2); } else { const BOOL flipped = [[cell controlView] isFlipped]; NSRect result = [tiles contentRectForRect: rect isFlipped: flipped]; return result; } } typedef enum { GSTabSelectedLeft, GSTabSelectedRight, GSTabSelectedToUnSelectedJunction, GSTabSelectedFill, GSTabUnSelectedLeft, GSTabUnSelectedRight, GSTabUnSelectedToSelectedJunction, GSTabUnSelectedJunction, GSTabUnSelectedFill, GSTabBackgroundFill } GSTabPart; - (NSImage *)imageForTabPart: (GSTabPart)part type: (NSTabViewType)type { NSMutableString *imageName = [NSMutableString stringWithCapacity: 32]; NSString *typeString = nil; NSString *partString = nil; switch (type) { case NSTopTabsBezelBorder: typeString = @""; break; case NSBottomTabsBezelBorder: typeString = @"Down"; break; case NSLeftTabsBezelBorder: typeString = @"Left"; break; case NSRightTabsBezelBorder: typeString = @"Right"; break; default: return nil; } switch (part) { case GSTabSelectedLeft: partString = @"SelectedLeft"; break; case GSTabSelectedRight: partString = @"SelectedRight"; break; case GSTabSelectedToUnSelectedJunction: partString = @"SelectedToUnSelectedJunction"; break; case GSTabSelectedFill: return nil; case GSTabUnSelectedLeft: partString = @"UnSelectedLeft"; break; case GSTabUnSelectedRight: partString = @"UnSelectedRight"; break; case GSTabUnSelectedToSelectedJunction: partString = @"UnSelectedToSelectedJunction"; break; case GSTabUnSelectedJunction: partString = @"UnSelectedJunction"; break; case GSTabUnSelectedFill: case GSTabBackgroundFill: return nil; } [imageName appendString: @"common_Tab"]; [imageName appendString: typeString]; [imageName appendString: partString]; return [NSImage imageNamed: imageName]; } - (GSDrawTiles *)tilesForTabPart: (GSTabPart)part type: (NSTabViewType)type { NSString *name = nil; if (type == NSTopTabsBezelBorder) { if (part == GSTabSelectedFill) name = GSTabViewSelectedTabFill; else if (part == GSTabUnSelectedFill) name = GSTabViewUnSelectedTabFill; else if (part == GSTabBackgroundFill) name = GSTabViewBackgroundTabFill; } else if (type == NSBottomTabsBezelBorder) { if (part == GSTabSelectedFill) name = GSTabViewBottomSelectedTabFill; else if (part == GSTabUnSelectedFill) name = GSTabViewBottomUnSelectedTabFill; else if (part == GSTabBackgroundFill) name = GSTabViewBottomBackgroundTabFill; } else if (type == NSLeftTabsBezelBorder) { if (part == GSTabSelectedFill) name = GSTabViewLeftSelectedTabFill; else if (part == GSTabUnSelectedFill) name = GSTabViewLeftUnSelectedTabFill; else if (part == GSTabBackgroundFill) name = GSTabViewLeftBackgroundTabFill; } else if (type == NSRightTabsBezelBorder) { if (part == GSTabSelectedFill) name = GSTabViewRightSelectedTabFill; else if (part == GSTabUnSelectedFill) name = GSTabViewRightUnSelectedTabFill; else if (part == GSTabBackgroundFill) name = GSTabViewRightBackgroundTabFill; } return [self tilesNamed: name state: GSThemeNormalState]; } - (void) frameTabRectTopAndBottom: (NSRect)aRect topColor: (NSColor *)topColor bottomColor: (NSColor *)bottomColor { NSRect bottom = aRect; NSRect top = aRect; top.size.height = 1; bottom.origin.y = NSMaxY(aRect) - 1; bottom.size.height = 1; [topColor set]; NSRectFill(top); [bottomColor set]; NSRectFill(bottom); } - (void) drawTabFillInRect: (NSRect)aRect forPart: (GSTabPart)part type: (NSTabViewType)type { GSDrawTiles *tiles = [self tilesForTabPart: part type: type]; if (tiles == nil) { if (type == NSBottomTabsBezelBorder) { switch (part) { case GSTabSelectedFill: [self frameTabRectTopAndBottom: aRect topColor: [NSColor clearColor] bottomColor: [NSColor whiteColor]]; break; case GSTabUnSelectedFill: [self frameTabRectTopAndBottom: aRect topColor: [NSColor darkGrayColor] bottomColor: [NSColor whiteColor]]; break; case GSTabBackgroundFill: { const NSRect clip = aRect; aRect.origin.x -= 2; aRect.origin.y = NSMinY(aRect) - 2; aRect.size.width += 2; aRect.size.height = 4; [self drawButton: aRect withClip: clip]; break; } default: break; } } else if (type == NSTopTabsBezelBorder) { switch (part) { case GSTabSelectedFill: [self frameTabRectTopAndBottom: aRect topColor: [NSColor whiteColor] bottomColor: [NSColor clearColor]]; break; case GSTabUnSelectedFill: [self frameTabRectTopAndBottom: aRect topColor: [NSColor whiteColor] bottomColor: [NSColor whiteColor]]; break; case GSTabBackgroundFill: { const NSRect clip = aRect; aRect.origin.x -= 2; aRect.origin.y = NSMaxY(aRect) - 1; aRect.size.width += 2; aRect.size.height = 4; [self drawButton: aRect withClip: clip]; break; } default: break; } } } else { [self fillRect: aRect withTiles: tiles]; } } - (CGFloat) tabHeightForType: (NSTabViewType)type { NSImage *img = [self imageForTabPart: GSTabUnSelectedLeft type: type]; if (img == nil) { return 0; } return [img size].height; } - (NSRect) tabViewBackgroundRectForBounds: (NSRect)aRect tabViewType: (NSTabViewType)type { const CGFloat tabHeight = [self tabHeightForType: type]; switch (type) { default: case NSTopTabsBezelBorder: aRect.size.height -= tabHeight; aRect.origin.y += tabHeight; break; case NSBottomTabsBezelBorder: aRect.size.height -= tabHeight; break; case NSLeftTabsBezelBorder: aRect.size.width -= tabHeight; aRect.origin.x += tabHeight; break; case NSRightTabsBezelBorder: aRect.size.width -= tabHeight; break; case NSNoTabsBezelBorder: case NSNoTabsLineBorder: case NSNoTabsNoBorder: break; } return aRect; } - (NSRect) tabViewContentRectForBounds: (NSRect)aRect tabViewType: (NSTabViewType)type tabView: (NSTabView *)view { NSRect cRect = [self tabViewBackgroundRectForBounds: aRect tabViewType: type]; NSString *name = GSStringFromTabViewType(type); GSDrawTiles *tiles = [self tilesNamed: name state: GSThemeNormalState]; if (tiles == nil) { switch (type) { case NSBottomTabsBezelBorder: cRect.origin.x += 1; cRect.origin.y += 1; cRect.size.width -= 3; cRect.size.height -= 2; break; case NSNoTabsBezelBorder: cRect.origin.x += 1; cRect.origin.y += 1; cRect.size.width -= 3; cRect.size.height -= 2; break; case NSNoTabsLineBorder: cRect.origin.y += 1; cRect.origin.x += 1; cRect.size.width -= 2; cRect.size.height -= 2; break; case NSTopTabsBezelBorder: cRect.origin.x += 1; cRect.origin.y += 1; cRect.size.width -= 3; cRect.size.height -= 2; break; case NSLeftTabsBezelBorder: cRect.origin.x += 1; cRect.origin.y += 1; cRect.size.width -= 3; cRect.size.height -= 2; break; case NSRightTabsBezelBorder: cRect.origin.x += 1; cRect.origin.y += 1; cRect.size.width -= 3; cRect.size.height -= 2; break; case NSNoTabsNoBorder: default: break; } } else { cRect = [tiles contentRectForRect: cRect isFlipped: [view isFlipped]]; } return cRect; } - (void) drawTabViewBezelRect: (NSRect)aRect tabViewType: (NSTabViewType)type inView: (NSView *)view { NSString *name = GSStringFromTabViewType(type); GSDrawTiles *tiles = [self tilesNamed: name state: GSThemeNormalState]; if (tiles == nil) { switch (type) { default: case NSTopTabsBezelBorder: { const NSRect clip = aRect; aRect.size.height += 1; aRect.origin.y -= 1; [self drawButton: aRect withClip: clip]; break; } case NSBottomTabsBezelBorder: { const NSRect clip = aRect; aRect.size.height += 2; [self drawButton: aRect withClip: clip]; break; } case NSLeftTabsBezelBorder: case NSRightTabsBezelBorder: [self drawButton: aRect withClip: NSZeroRect]; break; case NSNoTabsBezelBorder: break; case NSNoTabsLineBorder: [[NSColor controlDarkShadowColor] set]; NSFrameRect(aRect); break; case NSNoTabsNoBorder: break; } } else { [self fillRect: aRect withTiles: tiles]; } } - (void) drawTabViewRect: (NSRect)rect inView: (NSView *)view withItems: (NSArray *)items selectedItem: (NSTabViewItem *)selected { NSGraphicsContext *ctxt = GSCurrentContext(); const NSUInteger howMany = [items count]; int i; int previousState = 0; const NSTabViewType type = [(NSTabView *)view tabViewType]; const NSRect bounds = [view bounds]; NSRect aRect = [self tabViewBackgroundRectForBounds: bounds tabViewType: type]; const BOOL truncate = [(NSTabView *)view allowsTruncatedLabels]; const CGFloat tabHeight = [self tabHeightForType: type]; DPSgsave(ctxt); [self drawTabViewBezelRect: aRect tabViewType: type inView: view]; if (type == NSBottomTabsBezelBorder || type == NSTopTabsBezelBorder) { NSPoint iP; if (type == NSTopTabsBezelBorder) iP = bounds.origin; else iP = NSMakePoint(aRect.origin.x, NSMaxY(aRect)); for (i = 0; i < howMany; i++) { NSRect r; NSTabViewItem *anItem = [items objectAtIndex: i]; const NSTabState itemState = [anItem tabState]; const NSSize s = [anItem sizeOfLabel: truncate]; // Draw the left image if (i == 0) { NSImage *part = nil; if (itemState == NSSelectedTab) { part = [self imageForTabPart: GSTabSelectedLeft type: type]; } else if (itemState == NSBackgroundTab) { part = [self imageForTabPart: GSTabUnSelectedLeft type: type]; } else NSLog(@"Not finished yet. Luff ya.\n"); [part drawInRect: NSMakeRect(iP.x, iP.y, [part size].width, [part size].height) fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0 respectFlipped: YES hints: nil]; iP.x += [part size].width; } else { NSImage *part = nil; if (itemState == NSSelectedTab) { part = [self imageForTabPart: GSTabUnSelectedToSelectedJunction type: type]; } else if (itemState == NSBackgroundTab) { if (previousState == NSSelectedTab) { part = [self imageForTabPart: GSTabSelectedToUnSelectedJunction type: type]; } else { part = [self imageForTabPart: GSTabUnSelectedJunction type: type]; } } else NSLog(@"Not finished yet. Luff ya.\n"); [part drawInRect: NSMakeRect(iP.x, iP.y, [part size].width, [part size].height) fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0 respectFlipped: YES hints: nil]; iP.x += [part size].width; } // Draw the middle fill part of the tab r.origin = iP; r.size.width = s.width; r.size.height = tabHeight; if (itemState == NSSelectedTab) { [self drawTabFillInRect: r forPart: GSTabSelectedFill type: type]; } else if (itemState == NSBackgroundTab) { [self drawTabFillInRect: r forPart: GSTabUnSelectedFill type: type]; } else NSLog(@"Not finished yet. Luff ya.\n"); // Label [anItem drawLabel: truncate inRect: r]; iP.x += s.width; previousState = itemState; // For the rightmost tab, draw the right side if (i == howMany - 1) { NSImage *part = nil; if ([anItem tabState] == NSSelectedTab) { part = [self imageForTabPart: GSTabSelectedRight type: type]; } else if ([anItem tabState] == NSBackgroundTab) { part = [self imageForTabPart: GSTabUnSelectedRight type: type]; } else NSLog(@"Not finished yet. Luff ya.\n"); [part drawInRect: NSMakeRect(iP.x, iP.y, [part size].width, [part size].height) fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0 respectFlipped: YES hints: nil]; iP.x += [part size].width; // Draw the background fill if (iP.x < NSMaxX(bounds)) { r.origin = iP; r.size.width = NSMaxX(bounds) - iP.x; r.size.height = tabHeight; [self drawTabFillInRect: r forPart: GSTabBackgroundFill type: type]; } } } } // FIXME: Missing drawing code for other cases DPSgrestore(ctxt); } - (void) drawScrollerRect: (NSRect)rect inView: (NSView *)view hitPart: (NSScrollerPart)hitPart isHorizontal: (BOOL)isHorizontal { NSRect rectForPartIncrementLine; NSRect rectForPartDecrementLine; NSRect rectForPartKnobSlot; NSScroller *scroller = (NSScroller *)view; rectForPartIncrementLine = [scroller rectForPart: NSScrollerIncrementLine]; rectForPartDecrementLine = [scroller rectForPart: NSScrollerDecrementLine]; rectForPartKnobSlot = [scroller rectForPart: NSScrollerKnobSlot]; /* [[[view window] backgroundColor] set]; NSRectFill (rect); */ if (NSIntersectsRect (rect, rectForPartKnobSlot) == YES) { [scroller drawKnobSlot]; [scroller drawKnob]; } if (NSIntersectsRect (rect, rectForPartDecrementLine) == YES) { [scroller drawArrow: NSScrollerDecrementArrow highlight: hitPart == NSScrollerDecrementLine]; } if (NSIntersectsRect (rect, rectForPartIncrementLine) == YES) { [scroller drawArrow: NSScrollerIncrementArrow highlight: hitPart == NSScrollerIncrementLine]; } } - (void) drawBrowserRect: (NSRect)rect inView: (NSView *)view withScrollerRect: (NSRect)scrollerRect columnSize: (NSSize)columnSize { NSBrowser *browser = (NSBrowser *)view; NSRect bounds = [view bounds]; // Load the first column if not already done if (![browser isLoaded]) { [browser loadColumnZero]; } // Draws titles if ([browser isTitled]) { int i; for (i = [browser firstVisibleColumn]; i <= [browser lastVisibleColumn]; ++i) { NSRect titleRect = [browser titleFrameOfColumn: i]; if (NSIntersectsRect (titleRect, rect) == YES) { [browser drawTitleOfColumn: i inRect: titleRect]; } } } // Draws scroller border if ([self browserUseBezels]) { if ([browser hasHorizontalScroller] && [browser separatesColumns]) { NSRect scrollerBorderRect = scrollerRect; NSSize bs = [self sizeForBorderType: NSBezelBorder]; scrollerBorderRect.origin.x = 0; scrollerBorderRect.origin.y = 0; scrollerBorderRect.size.width += 2 * bs.width; scrollerBorderRect.size.height += (2 * bs.height) - 1; if ((NSIntersectsRect (scrollerBorderRect, rect) == YES) && [view window]) { [self drawGrayBezel: scrollerBorderRect withClip: rect]; } } if (![browser separatesColumns]) { NSPoint p1,p2; int i, visibleColumns; float hScrollerWidth = [browser hasHorizontalScroller] ? [NSScroller scrollerWidth] : 0; // Columns borders [self drawGrayBezel: bounds withClip: rect]; [[NSColor blackColor] set]; visibleColumns = [browser numberOfVisibleColumns]; for (i = 1; i < visibleColumns; i++) { p1 = NSMakePoint((columnSize.width * i) + 2 + (i-1), columnSize.height + hScrollerWidth + 2); p2 = NSMakePoint((columnSize.width * i) + 2 + (i-1), hScrollerWidth + 2); [NSBezierPath strokeLineFromPoint: p1 toPoint: p2]; } // Horizontal scroller border if ([browser hasHorizontalScroller]) { p1 = NSMakePoint(2, hScrollerWidth + 2); p2 = NSMakePoint(rect.size.width - 2, hScrollerWidth + 2); [NSBezierPath strokeLineFromPoint: p1 toPoint: p2]; } } } if (![self browserUseBezels] && [self scrollViewScrollersOverlapBorders]) { NSRect baseRect = NSMakeRect(0, 0, bounds.size.width, 1); NSRect colFrame = [browser frameOfColumn: [browser firstVisibleColumn]]; NSRect scrollViewRect = NSUnionRect(baseRect, colFrame); GSDrawTiles *tiles = [self tilesNamed: @"NSScrollView" state: GSThemeNormalState]; [self fillRect: scrollViewRect withTiles: tiles]; } } - (CGFloat) browserColumnSeparation { NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; if ([defs objectForKey: @"GSBrowserColumnSeparation"] != nil) { return [defs floatForKey: @"GSBrowserColumnSeparation"]; } else { return 4; } } - (CGFloat) browserVerticalPadding { NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; if ([defs objectForKey: @"GSBrowserVerticalPadding"] != nil) { return [defs floatForKey: @"GSBrowserVerticalPadding"]; } else { return 2; } } - (BOOL) browserUseBezels { NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; if ([defs objectForKey: @"GSBrowserUseBezels"] != nil) { return [defs boolForKey: @"GSBrowserUseBezels"]; } else { return YES; } } - (void) drawMenuRect: (NSRect)rect inView: (NSView *)view isHorizontal: (BOOL)horizontal itemCells: (NSArray *)itemCells { int i = 0; int howMany = [itemCells count]; NSMenuView *menuView = (NSMenuView *)view; NSRect bounds = [view bounds]; [self drawBackgroundForMenuView: menuView withFrame: bounds dirtyRect: rect horizontal: horizontal]; // Draw the menu cells. for (i = 0; i < howMany; i++) { NSRect aRect; NSMenuItemCell *aCell; aRect = [menuView rectOfItemAtIndex: i]; if (NSIntersectsRect(rect, aRect) == YES) { aCell = [menuView menuItemCellForItemAtIndex: i]; [aCell drawWithFrame: aRect inView: menuView]; } } } - (void) drawScrollViewRect: (NSRect)rect inView: (NSView *)view { NSScrollView *scrollView = (NSScrollView *)view; GSTheme *theme = [GSTheme theme]; NSColor *color; NSString *name; NSBorderType borderType = [scrollView borderType]; NSRect bounds = [view bounds]; BOOL hasInnerBorder = ![[NSUserDefaults standardUserDefaults] boolForKey: @"GSScrollViewNoInnerBorder"]; GSDrawTiles *tiles = nil; name = [theme nameForElement: self]; if (name == nil) { name = @"NSScrollView"; } color = [theme colorNamed: name state: GSThemeNormalState]; tiles = [theme tilesNamed: name state: GSThemeNormalState]; if (color == nil) { color = [NSColor controlDarkShadowColor]; } if (tiles == nil) { switch (borderType) { case NSNoBorder: break; case NSLineBorder: [color set]; NSFrameRect(bounds); break; case NSBezelBorder: [theme drawGrayBezel: bounds withClip: rect]; break; case NSGrooveBorder: [theme drawGroove: bounds withClip: rect]; break; } } else { [self fillRect: bounds withTiles: tiles]; } if (hasInnerBorder) { NSScroller *vertScroller = [scrollView verticalScroller]; NSScroller *horizScroller = [scrollView horizontalScroller]; CGFloat scrollerWidth = [NSScroller scrollerWidth]; [color set]; if ([scrollView hasVerticalScroller]) { NSInterfaceStyle style; CGFloat xpos; CGFloat scrollerHeight = bounds.size.height; style = NSInterfaceStyleForKey(@"NSScrollViewInterfaceStyle", nil); if (style == NSMacintoshInterfaceStyle || style == NSWindows95InterfaceStyle) { xpos = [vertScroller frame].origin.x - 1.0; } else { xpos = [vertScroller frame].origin.x + scrollerWidth; } NSRectFill(NSMakeRect(xpos, [vertScroller frame].origin.y - 1.0, 1.0, scrollerHeight + 1.0)); } if ([scrollView hasHorizontalScroller]) { CGFloat ypos; CGFloat scrollerY = [horizScroller frame].origin.y; CGFloat scrollerLength = bounds.size.width; if ([scrollView hasVerticalScroller]) { scrollerLength -= [NSScroller scrollerWidth]; } if ([scrollView isFlipped]) { ypos = scrollerY - 1.0; } else { ypos = scrollerY + scrollerWidth + 1.0; } NSRectFill(NSMakeRect([horizScroller frame].origin.x - 1.0, ypos, scrollerLength + 1.0, 1.0)); } } } - (void) drawSliderBorderAndBackground: (NSBorderType)aType frame: (NSRect)cellFrame inCell: (NSCell *)cell isHorizontal: (BOOL)horizontal { NSSliderType type = [(NSSliderCell *)cell sliderType]; if (type == NSLinearSlider) { NSString *partName = (horizontal ? GSSliderHorizontalTrack : GSSliderVerticalTrack); GSDrawTiles *tiles = [self tilesNamed: partName state: GSThemeNormalState]; if (tiles == nil) { [[GSTheme theme] drawBorderType: aType frame: cellFrame view: [cell controlView]]; } else { // FIXME: This code could be factored out NSSize tilesNaturalSize = [tiles size]; NSRect tilesRect; // Only stretch the tiles in one direction if (horizontal) { tilesRect.size = NSMakeSize(cellFrame.size.width, tilesNaturalSize.height); } else { tilesRect.size = NSMakeSize(tilesNaturalSize.width, cellFrame.size.height); } tilesRect.origin = NSMakePoint((cellFrame.size.width - tilesRect.size.width) / 2.0, (cellFrame.size.height - tilesRect.size.height) / 2.0); if ([cell controlView] != nil) { tilesRect = [[cell controlView] centerScanRect: tilesRect]; } [self fillRect: tilesRect withTiles: tiles]; } } } - (void) drawBarInside: (NSRect)rect inCell: (NSCell *)cell flipped: (BOOL)flipped { NSSliderType type = [(NSSliderCell *)cell sliderType]; if (type == NSLinearSlider) { BOOL horizontal = (rect.size.width > rect.size.height); NSString *partName = (horizontal ? GSSliderHorizontalTrack : GSSliderVerticalTrack); GSDrawTiles *tiles = [self tilesNamed: partName state: GSThemeNormalState]; if (tiles == nil) { [[NSColor scrollBarColor] set]; NSRectFill(rect); } // Don't draw anything if we have tiles, they are drawn // in -drawSliderBorderAndBackground:... } } - (void) drawKnobInCell: (NSCell *)cell { NSView *controlView = [cell controlView]; NSSliderCell *sliderCell = (NSSliderCell *)cell; [sliderCell drawKnob: [sliderCell knobRectFlipped: [controlView isFlipped]]]; } - (NSRect) tableHeaderCellDrawingRectForBounds: (NSRect)theRect { NSSize borderSize; // This adjustment must match the drawn border borderSize = NSMakeSize(1, 1); return NSInsetRect(theRect, borderSize.width, borderSize.height); } - (void)drawTableHeaderRect: (NSRect)aRect inView: (NSView *)view { NSTableHeaderView *tableHeaderView = (NSTableHeaderView *)view; NSTableView *tableView = [tableHeaderView tableView]; NSArray *columns; int firstColumnToDraw; int lastColumnToDraw; NSRect drawingRect; NSTableColumn *column; NSTableColumn *highlightedTableColumn; float width; int i; NSCell *cell; if (tableView == nil) return; firstColumnToDraw = [tableHeaderView columnAtPoint: NSMakePoint (aRect.origin.x, aRect.origin.y)]; if (firstColumnToDraw == -1) firstColumnToDraw = 0; lastColumnToDraw = [tableHeaderView columnAtPoint: NSMakePoint (NSMaxX (aRect), aRect.origin.y)]; if (lastColumnToDraw == -1) lastColumnToDraw = [tableView numberOfColumns] - 1; drawingRect = [tableHeaderView headerRectOfColumn: firstColumnToDraw]; columns = [tableView tableColumns]; highlightedTableColumn = [tableView highlightedTableColumn]; for (i = firstColumnToDraw; i <= lastColumnToDraw; i++) { column = [columns objectAtIndex: i]; width = [column width]; drawingRect.size.width = width; cell = [column headerCell]; if ((column == highlightedTableColumn) || [tableView isColumnSelected: i]) { [cell setHighlighted: YES]; } else { [cell setHighlighted: NO]; } [cell drawWithFrame: drawingRect inView: tableHeaderView]; drawingRect.origin.x += width; } } - (void) drawPopUpButtonCellInteriorWithFrame: (NSRect)cellFrame withCell: (NSCell *)cell inView: (NSView *)controlView { // Default implementation of this method does nothing. } - (void) drawTableViewBackgroundInClipRect: (NSRect)aRect inView: (NSView *)view withBackgroundColor: (NSColor *)backgroundColor { NSTableView *tableView = (NSTableView *)view; [backgroundColor set]; NSRectFill (aRect); if ([tableView usesAlternatingRowBackgroundColors]) { const CGFloat rowHeight = [tableView rowHeight]; NSInteger startingRow = [tableView rowAtPoint: NSMakePoint(0, NSMinY(aRect))]; NSInteger endingRow; NSInteger i; NSArray *rowColors = [NSColor controlAlternatingRowBackgroundColors]; const NSUInteger rowColorCount = [rowColors count]; NSRect rowRect; if (rowHeight <= 0 || rowColorCount == 0 || aRect.size.height <= 0) return; if (startingRow <= 0) startingRow = 0; rowRect = [tableView rectOfRow: startingRow]; rowRect.origin.x = aRect.origin.x; rowRect.size.width = aRect.size.width; endingRow = startingRow + ceil(aRect.size.height / rowHeight); for (i = startingRow; i <= endingRow; i++) { NSColor *color = [rowColors objectAtIndex: (i % rowColorCount)]; [color set]; NSRectFill(rowRect); rowRect.origin.y += rowHeight; } } } - (void) drawTableViewGridInClipRect: (NSRect)aRect inView: (NSView *)view { NSTableView *tableView = (NSTableView *)view; // Cache some constants const CGFloat minX = NSMinX(aRect); const CGFloat maxX = NSMaxX(aRect); const CGFloat minY = NSMinY(aRect); const CGFloat maxY = NSMaxY(aRect); const NSInteger numberOfColumns = [tableView numberOfColumns]; const NSInteger numberOfRows = [tableView numberOfRows]; NSInteger startingRow = [tableView rowAtPoint: NSMakePoint(minX, minY)]; NSInteger endingRow = [tableView rowAtPoint: NSMakePoint(minX, maxY)]; NSInteger startingColumn = [tableView columnAtPoint: NSMakePoint(minX, minY)]; NSInteger endingColumn = [tableView columnAtPoint: NSMakePoint(maxX, minY)]; NSGraphicsContext *ctxt = GSCurrentContext(); NSColor *gridColor = [tableView gridColor]; if (startingRow == -1) startingRow = 0; if (endingRow == -1) endingRow = numberOfRows - 1; if (startingColumn == -1) startingColumn = 0; if (endingColumn == -1) endingColumn = numberOfColumns - 1; DPSgsave(ctxt); [gridColor set]; // Draw horizontal lines if (numberOfRows > 0) { NSInteger i; for (i = startingRow; i <= endingRow; i++) { NSRect rowRect = [tableView rectOfRow: i]; rowRect.origin.y += rowRect.size.height - 1; rowRect.size.height = 1; NSRectFill(rowRect); } } // Draw vertical lines if (numberOfColumns > 0) { NSInteger i; for (i = startingColumn; i <= endingColumn; i++) { NSRect colRect = [tableView rectOfColumn: i]; colRect.origin.x += colRect.size.width - 1; colRect.size.width = 1; NSRectFill(colRect); } } DPSgrestore (ctxt); } - (void) drawTableViewRect: (NSRect)aRect inView: (NSView *)view { int startingRow; int endingRow; int i; NSTableView *tableView = (NSTableView *)view; int numberOfRows = [tableView numberOfRows]; int numberOfColumns = [tableView numberOfColumns]; BOOL drawsGrid = [tableView drawsGrid]; /* Draw background */ [tableView drawBackgroundInClipRect: aRect]; if ((numberOfRows == 0) || (numberOfColumns == 0)) { return; } /* Draw selection */ [tableView highlightSelectionInClipRect: aRect]; /* Draw grid */ if (drawsGrid) { [tableView drawGridInClipRect: aRect]; } /* Draw visible cells */ /* Using rowAtPoint: here calls them only twice per drawn rect */ startingRow = [tableView rowAtPoint: NSMakePoint (0, NSMinY (aRect))]; endingRow = [tableView rowAtPoint: NSMakePoint (0, NSMaxY (aRect))]; if (startingRow == -1) { startingRow = 0; } if (endingRow == -1) { endingRow = numberOfRows - 1; } // NSLog(@"drawRect : %d-%d", startingRow, endingRow); { SEL sel = @selector(drawRow:clipRect:); IMP imp = [tableView methodForSelector: sel]; for (i = startingRow; i <= endingRow; i++) { (*imp)(tableView, sel, i, aRect); } } } - (void) highlightTableViewSelectionInClipRect: (NSRect)clipRect inView: (NSView *)view selectingColumns: (BOOL)selectingColumns { NSTableView *tableView = (NSTableView *)view; int numberOfRows = [tableView numberOfRows]; int numberOfColumns = [tableView numberOfColumns]; NSIndexSet *selectedRows = [tableView selectedRowIndexes]; NSIndexSet *selectedColumns = [tableView selectedColumnIndexes]; NSColor *backgroundColor = [tableView backgroundColor]; // Set the fill color { NSColor *selectionColor; selectionColor = [self colorNamed: @"highlightedTableRowBackgroundColor" state: GSThemeNormalState]; if (selectionColor == nil) { // Switch to the alternate color of the backgroundColor is white. if([backgroundColor isEqual: [NSColor whiteColor]]) { selectionColor = [NSColor colorWithCalibratedRed: 0.86 green: 0.92 blue: 0.99 alpha: 1.0]; } else { selectionColor = [NSColor whiteColor]; } } [selectionColor set]; } if (selectingColumns == NO) { NSInteger selectedRowsCount; NSUInteger row; NSInteger startingRow, endingRow; selectedRowsCount = [selectedRows count]; if (selectedRowsCount == 0) return; /* highlight selected rows */ startingRow = [tableView rowAtPoint: NSMakePoint(0, NSMinY(clipRect))]; endingRow = [tableView rowAtPoint: NSMakePoint(0, NSMaxY(clipRect))]; if (startingRow == -1) startingRow = 0; if (endingRow == -1) endingRow = numberOfRows - 1; row = [selectedRows indexGreaterThanOrEqualToIndex: startingRow]; while ((row != NSNotFound) && (row <= endingRow)) { NSRectFill(NSIntersectionRect([tableView rectOfRow: row], clipRect)); row = [selectedRows indexGreaterThanIndex: row]; } } else // Selecting columns { NSUInteger selectedColumnsCount; NSUInteger column; NSInteger startingColumn, endingColumn; selectedColumnsCount = [selectedColumns count]; if (selectedColumnsCount == 0) return; /* highlight selected columns */ startingColumn = [tableView columnAtPoint: NSMakePoint(NSMinX(clipRect), 0)]; endingColumn = [tableView columnAtPoint: NSMakePoint(NSMaxX(clipRect), 0)]; if (startingColumn == -1) startingColumn = 0; if (endingColumn == -1) endingColumn = numberOfColumns - 1; column = [selectedColumns indexGreaterThanOrEqualToIndex: startingColumn]; while ((column != NSNotFound) && (column <= endingColumn)) { NSRectFill(NSIntersectionRect([tableView rectOfColumn: column], clipRect)); column = [selectedColumns indexGreaterThanIndex: column]; } } } - (void) drawTableViewRow: (int)rowIndex clipRect: (NSRect)clipRect inView: (NSView *)view { NSTableView *tableView = (NSTableView *)view; // int numberOfRows = [tableView numberOfRows]; int numberOfColumns = [tableView numberOfColumns]; // NSIndexSet *selectedRows = [tableView selectedRowIndexes]; // NSColor *backgroundColor = [tableView backgroundColor]; id dataSource = [tableView dataSource]; float *columnOrigins = [tableView _columnOrigins]; int editedRow = [tableView editedRow]; int editedColumn = [tableView editedColumn]; NSArray *tableColumns = [tableView tableColumns]; int startingColumn; int endingColumn; NSTableColumn *tb; NSRect drawingRect; NSCell *cell; int i; float x_pos; const BOOL rowSelected = [[tableView selectedRowIndexes] containsIndex: rowIndex]; NSColor *tempColor = nil; NSColor *selectedTextColor = [self colorNamed: @"highlightedTableRowTextColor" state: GSThemeNormalState]; if (dataSource == nil) { return; } /* Using columnAtPoint: here would make it called twice per row per drawn rect - so we avoid it and do it natively */ /* Determine starting column as fast as possible */ x_pos = NSMinX (clipRect); i = 0; while ((i < numberOfColumns) && (x_pos > columnOrigins[i])) { i++; } startingColumn = (i - 1); if (startingColumn == -1) startingColumn = 0; /* Determine ending column as fast as possible */ x_pos = NSMaxX (clipRect); // Nota Bene: we do *not* reset i while ((i < numberOfColumns) && (x_pos > columnOrigins[i])) { i++; } endingColumn = (i - 1); if (endingColumn == -1) endingColumn = numberOfColumns - 1; /* Draw the row between startingColumn and endingColumn */ for (i = startingColumn; i <= endingColumn; i++) { const BOOL columnSelected = [tableView isColumnSelected: i]; const BOOL cellSelected = (rowSelected || columnSelected); tb = [tableColumns objectAtIndex: i]; cell = [tb dataCellForRow: rowIndex]; if (i == editedColumn && rowIndex == editedRow) [cell _setInEditing: YES]; [tableView _willDisplayCell: cell forTableColumn: tb row: rowIndex]; [cell setObjectValue: [dataSource tableView: tableView objectValueForTableColumn: tb row: rowIndex]]; drawingRect = [tableView frameOfCellAtColumn: i row: rowIndex]; // Set the cell text color if the theme provides a custom highlighted // row color. // // FIXME: This could probably be done in a cleaner way. We should // probably do -setHighlighted: YES, and the implementation of // -textColor in NSCell could use that to return a highlighted text color. if (cellSelected && (selectedTextColor != nil) && [cell isKindOfClass: [NSTextFieldCell class]]) { tempColor = [cell textColor]; [(NSTextFieldCell *)cell setTextColor: selectedTextColor]; } [cell drawWithFrame: drawingRect inView: tableView]; if (cellSelected && (selectedTextColor != nil) && [cell isKindOfClass: [NSTextFieldCell class]]) { // Restore the cell's text color if we changed it [(NSTextFieldCell *)cell setTextColor: tempColor]; } if (i == editedColumn && rowIndex == editedRow) [cell _setInEditing: NO]; } } - (void) drawBoxInClipRect: (NSRect)clipRect boxType: (NSBoxType)boxType borderType: (NSBorderType)borderType inView: (NSBox *)box { NSColor *color; BOOL drawTitleBackground = YES; if (boxType == NSBoxCustom) { if (![box isOpaque]) { color = [NSColor clearColor]; } else { color = [box fillColor]; } } else { color = [[box window] backgroundColor]; } // Draw separator boxes if (boxType == NSBoxSeparator) { [[box borderColor] set]; NSRectFill([box borderRect]); return; } // Draw border GSDrawTiles *tiles = [[GSTheme theme] tilesNamed: GSBoxBorder state: GSThemeNormalState]; if (tiles == nil || borderType == NSNoBorder || boxType == NSBoxOldStyle || boxType == NSBoxCustom) { // Fill inside [color set]; NSRectFill(clipRect); switch (borderType) { case NSNoBorder: break; case NSLineBorder: if (boxType == NSBoxCustom) { [[box borderColor] set]; NSFrameRectWithWidth([box borderRect], [box borderWidth]); } else { [[NSColor controlDarkShadowColor] set]; NSFrameRect([box borderRect]); } break; case NSBezelBorder: [[GSTheme theme] drawDarkBezel: [box borderRect] withClip: clipRect]; break; case NSGrooveBorder: [[GSTheme theme] drawGroove: [box borderRect] withClip: clipRect]; break; } } else { drawTitleBackground = NO; // If the title is on the border, clip a hole in the later [NSGraphicsContext saveGraphicsState]; if ((borderType != NSNoBorder) && (([box titlePosition] == NSAtTop) || ([box titlePosition] == NSAtBottom))) { const NSRect borderRect = [box borderRect]; const NSRect titleRect = [box titleRect]; NSBezierPath *path = [NSBezierPath bezierPath]; // Left if (NSMinX(titleRect) > NSMinX(borderRect)) { NSRect left = borderRect; left.size.width = NSMinX(titleRect) - NSMinX(borderRect); [path appendBezierPathWithRect: left]; } // Right if (NSMaxX(borderRect) > NSMaxX(titleRect)) { NSRect right = borderRect; right.size.width = NSMaxX(borderRect) - NSMaxX(titleRect); right.origin.x = NSMaxX(titleRect); [path appendBezierPathWithRect: right]; } // MinY if (NSMinY(titleRect) > NSMinY(borderRect)) { NSRect minY = borderRect; minY.size.height = NSMinY(titleRect) - NSMinY(borderRect); [path appendBezierPathWithRect: minY]; } // MaxY if (NSMaxY(borderRect) > NSMaxY(titleRect)) { NSRect maxY = borderRect; maxY.size.height = NSMaxY(borderRect) - NSMaxY(titleRect); maxY.origin.y = NSMaxY(titleRect); [path appendBezierPathWithRect: maxY]; } if (![path isEmpty]) { [path addClip]; } } [[GSTheme theme] fillRect: [box borderRect] withTiles: tiles]; // Restore clipping path [NSGraphicsContext restoreGraphicsState]; } // Draw title if ([box titlePosition] != NSNoTitle) { // If the title is on the border, clip a hole in the later if (drawTitleBackground && (borderType != NSNoBorder) && (([box titlePosition] == NSAtTop) || ([box titlePosition] == NSAtBottom))) { [color set]; NSRectFill([box titleRect]); } [[box titleCell] drawWithFrame: [box titleRect] inView: box]; } } @end gnustep-gui-0.24.0/Source/NSPasteboard.m0000664000076500007650000022111411745555335017723 0ustar brains99brains99/** NSPasteboard Implementation of class for communicating with the pasteboard server. Copyright (C) 1997,1999,2003 Free Software Foundation, Inc. Author: Richard Frith-Macdonald Date: 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. The pasteboard system

The pasteboard system is the core of OpenStep inter-application communications. This chapter is concerned with the use of the system, for detailed reference see the [NSPasteboard] class.
For non-standard services provided by applications (ie those which do not fit the general services mechanism described below), you generally use the Distributed Objects system (see [NSConnection]) directly, and some hints about that are provided at the end of this chapter.

Cut and Paste

The most obvious use of the pasteboard system is to support cut and paste of text and other data, permitting the user to take selected information from a document open in an application, and move it around in the same document, or to another document open in the same application, or to a document open in another application entirely.

While some objects (eg instances of [NSText]) will handle cut and paste for you automatically, you may often need to do this yourself in your own classes. The mechanism for this is quite simple, and should be done in a method called when the user selects the Cut or Copy item on the Edit menu.
The methods to do this should be called cut: and copy: respectively, and will be called automatically when the menu items are selected.

Select a pasteboard to use
There some standard pasteboards, or you can obtain or create other ones with the [NSPasteboard+pasteboardWithName:] method.
Usually you will want to use a standard pasteboard such as the one returned by the [NSPasteboard+generalPasteboard] method. NSPasteboard *pb = [NSPasteboard generalPasteboard];
Declare ownership and types
When you are going to supply data for pasting, you must take ownership of the pasteboard and specify what types of data can be provided. If you are going to place the data on the pasteboard immediately, you don't need to set a pasteboard owner, but if you plan to supply the data lazily (ie on-demand), you need to specify an object which the system can ask to provide the data when it needs it. In either case, you need to say what kinds of data the pasteboard will supply, and you use the [NSPasteboard-declareTypes:owner:] method to do this. // Provide string data immediately. [pb declareTypes: [NSArray arrayWithObject: NSStringPboardType] owner: nil]; [pb setString: myString forType: NSStringPboardType];
Provide data for pasting
If you decided to provide data lazily (recommended) then the pasteboard owner you declared will be asked to provide the data when it is needed for pasting. - (void) pasteboard: (NSPasteboard*)pb provideDataForType: (NSString*)type { // Place the data needed for pasting onto the pasteboard. [pb setData: data forType: type]; }
Support multiple types
Normally, it is best to support pasting of multiple types of data so that the object into which the data is being pasted can handle the pasted information readily. To do this it is conventional to supply data in the richest possible format in the cut: or copy: method, and supply other forms of data lazily. // Supply RTF data to the pasteboard system. - (id) copy: (id)sender { NSPasteboard *pb = [NSPasteboard generalPasteboard]; [pb declareTypes: [NSArray arrayWithObjects: NSRTFPboardType, NSStringPboardType, nil] owner: nil]; [pb setData: myData forType: NSRTFPboardType]; } The providing object can retrieve the data initially stored in the pasteboard, and set the type of data actually needed. - (void) pasteboard: (NSPasteboard*)pb provideDataForType: (NSString*)type { if ([type isEqualToString: NSStringPboardType] == YES) { NSData *d = [pb dataForType: NSRTFPboardType]; NSString *s = [self convertToString: d]; [pb setString: s forType: NSStringPboardType]; } else { // Unsupported type ... should not happen [pb setData: nil forType: type]; } }

Similarly, when the user selects the Paste item on the Edit menu, the paste: method in your code will be called, and this method should retrieve data from the pasteboard and insert it into your custom object so that the user can see it.

Retrieve data from pasteboard - (id) paste: (id)sender { NSPasteboard *pb = [NSPasteboard generalPasteboard]; NSString *info = [pb stringForType: NSStringPboardType]; // Now make use of info return self; }
Drag and Drop

The drag and drop system for transferring data is in essence a simple extension of copy and paste, where the data being dragged is a copy of some initially selected data, and the location to which it is pasted depends on where it is dropped.
To support drag and drop, you use a few standard methods to interact with pasteboards, but you need to extend this with DnD specific methods to handle the drag and drop process.

Services

The services system provides a standardised mechanism for an application to provide services to other applications. Like cut and paste, or drag and drop, the use of an application service is normally initiated by the user selecting some data to work with. The user then goes to the services menu, and selects a service listed there. The selection of a menu item causes the data to be placed on a pasteboard and transferred to the service providing application, where the action of the service is performed on it, and resulting data transferred back to the original system via the pasteboard system again.

To make use of a service then, you typically need to make no changes to your application, making the services facility supremely easy to deal with!
If however, you wish to make use of a service programmatically (rather than from the services menu), you can use the NSPerformService() function to invoke the service directly ...

// Create a pasteboard and store a string in it. NSPasteboard *pb = [NSPasteboard pasteboardWithUniqueName]; [pb declareTypes: [NSArray arrayWithObject: NSStringPboardType] owner: nil]; [pb setString: myString forType: NSStringPboardType]; // Invoke a service which takes string input and produces data output. if (NSPerformService(@"TheServiceName", pb) == YES) { result = [pb dataForType: NSGeneralPboardType]; }

Providing a service is a bit trickier, it involves implementing a method to perform the service (usually in your [NSApplication-delegate] object) and specifying information about your service in the Info.plist file for your application.
When your application is installed in one of the standard locations, and the make_services tool is run to update the cache of services information, your service automatically becomes available on the services menu of every application you run.
At runtime, you use [NSApplication-setServicesProvider:] to specify the object which implements the method to perform the service, or, if you are providing the service from a process other than a GUI application, you use the NSRegisterServicesProvider() function.

Your Info.plist should contain an array named NSServices listing all the services your application provides. Each service definition should be a dictionary containing the following information -

NSSendTypes This is an array containing the string values of the types of data that the service provider can handle (ie the types of data the application requesting the service may send).
The string values are the same as the standard constant names for these types, so the string "NSStringPboardType" would match the use of the NSStringPboardType in your code.
Similarly, the functions NSCreateFileContentsPboardType() and NSCreateFilenamePboardType() return types whose string values are found by appending the filename extension concerned to the strings "NSTypedFileContentsPboardType:" and "NSTypedFilenamesPboardType:" respectively.
NSReturnTypes These are the types of data that the service provider may return and are specified in the same way as the NSSendTypes.
NB. A service must handle at least one send type or one return type, but it is OK to have a service which expects no input data or one which produces no output data.
NSMessage This mandatory string value is the interesting part of the message which is sent to your service provider in order to perform the service.
The method in your application which does the work, must take three arguments and have a name formed of this value followed by :userData:error: // If NSMessage=encryptData - (void) encryptString: (NSPasteboard*)pboard userData: (NSString*)userData error: (NSString**)error; This method will be pass the pasteboard to use and an optional user data string, and must return results in the pasteboard, or an error message in the error argument.
NSPortName This specifies the name of the Distributed Objects port (see [NSConnection] and [NSPort]) on which the service provider will be listening for messages. While its value depends on how you register the service, it is normally the name of the application providing the service. This information is required in order for other applications to know how to contact the service provider. NSUserData This is an optional arbitrary string which (if present) is passed as the userData argument to the method implementing the service. This permits a service provider to implement a single method to handle a variety of similar services, whose exact characteristics are determined by this parameter. NSMenuItem This is a dictionary containing language names and the text to appear in the services menu for each language. It may contain an entry where the language name is default and this entry will be used where none of the specific languages listed are found in the application user's preferences.
These text items may contain a single slash ('/') character, and if this is present, the text after the slash will appear in a submenu of the services menu, with the text before the slash being the name of that submenu. This is very useful where a single application provides a variety of services and wishes to group them together.
NSKeyEquivalent This is an optional dictionary specifying the key equivalents to select the menu items listed in the NSMenuItem specification. NSTimeout This is an optional timeout (in milliseconds) specifying how long the system should wait for the service provider to perform the service. If omitted, it defaults to 30000 (30 seconds). NSExecutable This is an optional path to the executable binary of the program which performs the service .. it's used to launch the program if it is not already running. Normally, for an application, this is not necessary, as the system knows how to launch any applications found installed in standard locations. NSHost Not yet implemented ... this provides for the system to launch the executable for this service on a different host on the network.

The actual code to implement a service is very simple, even with error checking added -

- (void) encryptString: (NSPasteboard*)pboard userData: (NSString*)userData error: (NSString**)error { NSString *d; if ([pboard types] containsObject: NSStringPboardType] == NO) { *error = @"Bad types for encrypt service ... no string data"; return; } s = [pboard stringForType: NSStringPboardType]; if ([d length] == 0) { *error = @"No data supplied for encrypt service"; return; } s = [self encryptString: s]; // Do the real work [pboard declareTypes: [NSArray arrayWithObject: NSStringPboardType owner: nil]; [pboard setString: s forType: NSStringPboardType]; return; }
Filter services

A filter service is a special case of an inter-application service. Its action is to take data of one type and convert it to another type. Unlike general services, this is not directly initiated by user action clicking on an item in the services menu (indeed, filter services do not appear on the services menu), but is instead performed transparently when the application asks the pasteboard system for data of a particular type, but the pasteboard only contains data of some other type.

A filter service definition in the Info.plist file differs from that of a standard service in that the NSMessage entry is replaced by an NSFilter entry, the NSMenuItem and NSKeyEquivalent entries are omitted, and a few other entries may be added -

NSFilter This is the first part of the message name for the method which actually implements the filter service ... just like the NSMessage entry in a normal service. NSInputMechanism This (optional) entry is a string value specifying an alternative mechanism for performing the filer service (instead of sending a message to an application to ask it to do it).
Possible values are - NSIdentity The data to be filtered is simply placed upon the pasteboard without any transformation. NSMapFile The data to be filtered is the name of a file, which is loaded into memory and placed on the pasteboard without any transformation.
If the data to be filtered contains multiple file names, only the first is used.
NSUnixStdio The data to be filtered is the name of a file, which is passed as the argument to a unix command-line program, and the standard output of that program is captured and placed on the pasteboard. The program is run each time data is requested, so this is inefficient in comparison to a filter implemented using the standard method (of sending a message to a running application).
If the data to be filtered contains multiple file names, only the first is used.

Filter services are used implicitly whenever you get a pasteboard by using one of the methods +pasteboardByFilteringData:ofType:, +pasteboardByFilteringFile: or +pasteboardByFilteringTypesInPasteboard: as the pasteboard system will automatically invoke any available filter to convert the data in the pasteboard to any required type as long as a conversion can be done using a single filter.

Distributed Objects services

While the general services mechanism described above covers most eventualities, there are some circumstances where you might want your application to offer more complex services which require the client application to have been written to make use of those services and where the interaction between the two is much trickier.

In most cases, such situations are handled by server processes rather than GUI applications, thus avoiding all the overheads of a GUI application ... linking with the GUI library and using the windowing system etc. On occasion you may actually want the services to use facilities from the GUI library (such as the [NSPasteboard] or [NSWorkspace] class).

Traditionally, NeXTstep and GNUstep applications permit you to connect to an application using the standard [NSConnection] mechanisms, with the name of the port you connect to being (by convention) the name of the application. The root proxy of the NSConnection obtained this way would be the [NSApplication-delegate] object, and any messages sent to this object would be handled by the application delegate.

In the interests of security, GNUstep provides a mechanism to ensure that only those methods you explicitly want to be available to remote processes are actually available.
Those methods are assumed to be any of the standard application methods, and any methods implementing the standard services mechanism (ie. methods whose names begin application: or end with :userData:error:), plus any methods listed in the array returned by the GSPermittedMessages user default.
If your application wishes to make non-standard methods available, it should use [NSUserDefaults-registerDefaults:] to set a standard value for GSPermittedMessages. Users of the application can then use the defaults system to override that standard setting for the application in order to reduce or increase the list of messages available to remote processes.

To make use of a service, you need to check to ensure that the application providing the service is running, connect to it, and then send messages to it. You should take care to catch exceptions and deal with a loss of connection to the server application.
As an aid to using the services, GNUstep provides a helper function (GSContactApplication()) which encapsulates the process of establishing a connection and launching the server application if necessary.

id proxy = GSContactApplication(@"pathToApp", nil, nil); if (proxy != nil) { NS_EXCEPTION { id result = [proxy performTask: taskName withArgument: anArgument]; if (result == nil) { // handle error } else { // Use result } } NS_HANDLER // Handle exception NS_ENDHANDLER }

If we want to send repeated messages, we may store the proxy to server application, and might want to keep track of the state of the connection to be sure that the proxy is still valid.

ASSIGN(remote, proxy); // We want to keep hold of the proxy for use later, so we need to know // if the connection dies ... we ask for a notification to call our // connectionBecameInvalid: method when the connection dies ... in that // method we can release the proxy. [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(connectionBecameInvalid:) name: NSConnectionDidDieNotification object: [remote connectionForProxy]];
*/ #include "config.h" #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import "AppKit/NSPasteboard.h" #import "AppKit/NSApplication.h" #import "AppKit/NSWorkspace.h" #import "AppKit/NSFileWrapper.h" #import "GNUstepGUI/GSServicesManager.h" #import "GNUstepGUI/GSPasteboardServer.h" static NSString *contentsPrefix = @"NSTypedFileContentsPboardType:"; static NSString *namePrefix = @"NSTypedFilenamesPboardType:"; /* This is a proxy used to send objects over DO by reference when they * would normally be copied. * The idea is to use such a proxy when a filter sends data to a pasteboard. * Since the filtered data will only be used in the process which sets up * the filter, there's no point sending it on a round trip to the * pasteboard server and back ... instead we encode a GSByrefObject, which * appears as a proxy/reference on the remote system (pasteboard server) * but when the pasteboard server sends it back it decodes locally as the * original data object. */ @interface GSByrefObject : NSObject { NSObject *target; } + (id) byrefWithObject: (NSObject*)object; @end @implementation GSByrefObject + (id) byrefWithObject: (NSObject*)object { GSByrefObject *b = [GSByrefObject new]; b->target = [object retain]; return [b autorelease]; } - (void) dealloc { [target release]; [super dealloc]; } - (void) forwardInvocation: (NSInvocation*)anInvocation { [anInvocation invokeWithTarget: target]; } - (NSMethodSignature*) methodSignatureForSelector: (SEL)aSelector { if (class_respondsToSelector(object_getClass(self), aSelector)) { return [super methodSignatureForSelector: aSelector]; } return [target methodSignatureForSelector: aSelector]; } /* Encode this proxy as a reference to its target. * That way when the reference is passed back to this process it * will decode as the original target object rather than the proxy. */ - (id) replacementObjectForPortCoder: (NSPortCoder*)aCoder { return [NSDistantObject proxyWithLocal: target connection: [aCoder connection]]; } @end /* * A pasteboard class for lazily filtering data */ @interface GSFiltered : NSPasteboard { @public NSArray *originalTypes; NSString *file; NSData *data; NSPasteboard *pboard; } @end @implementation GSFiltered /** * Given an array of types, produce an array of all the types we can * make from that using a single filter. */ + (NSArray*) _typesFilterableFrom: (NSArray*)from { NSMutableSet *types = [NSMutableSet setWithCapacity: 8]; NSArray *filters = [[GSServicesManager manager] filters]; unsigned c = [filters count]; unsigned i; for (i = 0; i < [from count]; i++) { NSString *type = [from objectAtIndex: i]; unsigned j; [types addObject: type]; // Always include original type for (j = 0; j < c; j++) { NSDictionary *info = [filters objectAtIndex: j]; NSArray *sendTypes = [info objectForKey: @"NSSendTypes"]; if ([sendTypes containsObject: type] == YES) { NSArray *returnTypes = [info objectForKey: @"NSReturnTypes"]; [types addObjectsFromArray: returnTypes]; } } } return [types allObjects]; } - (void) dealloc { DESTROY(originalTypes); DESTROY(file); DESTROY(data); DESTROY(pboard); [super dealloc]; } /** * This method actually performs any filtering required. */ - (void) pasteboard: (NSPasteboard*)sender provideDataForType: (NSString*)type { NSDictionary *info; NSString *fromType = nil; NSString *mechanism; NSAssert(sender == self, NSInvalidArgumentException); /* * If the requested type is the same as one of the original types, * no filtering is required ... and we can just write what we have. */ if ([originalTypes containsObject: type] == YES) { info = [NSDictionary dictionaryWithObjectsAndKeys: @"NSIdentity", @"NSInputMechanism", nil]; } else { NSArray *filters; unsigned count; unsigned filterNumber = 0; /* * Locate the filter information needed, including the type we are * converting from and the name of the filter to use. */ info = nil; filters = [[GSServicesManager manager] filters]; count = [filters count]; while (fromType == nil && filterNumber < count) { NSArray *returnTypes; info = [filters objectAtIndex: filterNumber++]; returnTypes = [info objectForKey: @"NSReturnTypes"]; if ([returnTypes containsObject: type] == YES) { NSArray *sendTypes = [info objectForKey: @"NSSendTypes"]; unsigned i; for (i = 0; i < [originalTypes count]; i++) { fromType = [originalTypes objectAtIndex: i]; if ([sendTypes containsObject: fromType] == YES) { break; } fromType = nil; } } } if (!info) { NSWarnMLog(@"Unable to provide data of type '%@'.", type); return; } } mechanism = [info objectForKey: @"NSInputMechanism"]; if ([mechanism isEqualToString: @"NSUnixStdio"] == YES) { NSMutableData *m = [NSMutableData dataWithCapacity: 1023]; NSString *filename; NSString *path; NSData *d; NSPipe *p; NSFileHandle *h; NSTask *t; id o; /* * The data for an NSUnixStdio filter must be one or more filenames */ if ([fromType isEqualToString: NSStringPboardType] == NO && [fromType isEqualToString: NSFilenamesPboardType] == NO && [fromType hasPrefix: namePrefix] == NO) { [sender setData: [NSData data] forType: type]; return; // Not the name of a file to filter. } if (file != nil) { filename = file; } else { if (data != nil) { d = data; } else { d = [pboard dataForType: fromType]; } o = [NSDeserializer deserializePropertyListFromData: d mutableContainers: NO]; if ([o isKindOfClass: [NSString class]] == YES) { filename = o; } else if ([o isKindOfClass: [NSArray class]] == YES && [o count] > 0 && [[o objectAtIndex: 0] isKindOfClass: [NSString class]] == YES) { filename = [o objectAtIndex: 0]; } else { [sender setData: [NSData data] forType: type]; return; // Not the name of a file to filter. } } /* * Set up and launch task to filter the named file. */ t = [NSTask new]; path = [info objectForKey: @"NSExecutable"]; if ([path length] == 0) { path = [info objectForKey: @"NSPortName"]; } [t setLaunchPath: path]; [t setArguments: [NSArray arrayWithObject: filename]]; p = [NSPipe pipe]; [t setStandardOutput: p]; [t launch]; /* * Read all the data that the task writes. */ h = [p fileHandleForReading]; while ([(d = [h availableData]) length] > 0) { [m appendData: d]; } [t waitUntilExit]; RELEASE(t); /* * And send it on. */ [sender setData: [GSByrefObject byrefWithObject: m] forType: type]; } else if ([mechanism isEqualToString: @"NSMapFile"] == YES) { NSString *filename; NSData *d; id o; if ([fromType isEqualToString: NSStringPboardType] == NO && [fromType isEqualToString: NSFilenamesPboardType] == NO && [fromType hasPrefix: namePrefix] == NO) { [sender setData: [NSData data] forType: type]; return; // Not the name of a file to filter. } /* TODO: d used to be used here before being initialized. Set it to nil and warn instead of crashing for now. */ d = nil; NSWarnMLog(@"NSMapFile handling is broken."); o = [NSDeserializer deserializePropertyListFromData: d mutableContainers: NO]; if ([o isKindOfClass: [NSString class]] == YES) { filename = o; } else if ([o isKindOfClass: [NSArray class]] == YES && [o count] > 0 && [[o objectAtIndex: 0] isKindOfClass: [NSString class]] == YES) { filename = [o objectAtIndex: 0]; } else { [sender setData: [NSData data] forType: type]; return; // Not the name of a file to filter. } d = [NSData dataWithContentsOfFile: filename]; [sender setData: [GSByrefObject byrefWithObject: d] forType: type]; } else if ([mechanism isEqualToString: @"NSIdentity"] == YES) { /* * An 'identity' filter simply places the required data on the * pasteboard. */ if (data != nil) { [sender setData: data forType: type]; } else if (file != nil) { [sender writeFileContents: file]; } else { NSData *d = [pboard dataForType: type]; [sender setData: [GSByrefObject byrefWithObject: d] forType: type]; } } else { NSPasteboard *tmp; NSString *port; NSString *timeout; double seconds; NSDate *finishBy; NSString *appPath; id provider; NSString *message; NSString *selName; NSString *userData; NSString *error = nil; /* * Put data onto a pasteboard that can be used by the service provider. */ if (data != nil) { tmp = [NSPasteboard pasteboardWithUniqueName]; [tmp declareTypes: [NSArray arrayWithObject: fromType] owner: nil]; [tmp setData: data forType: fromType]; } else if (file != nil) { tmp = [NSPasteboard pasteboardWithUniqueName]; [tmp declareTypes: [NSArray arrayWithObject: fromType] owner: nil]; [tmp writeFileContents: file]; } else { tmp = pboard; // Already in a pasteboard. } port = [info objectForKey: @"NSPortName"]; timeout = [info objectForKey: @"NSTimeout"]; if (timeout && [timeout floatValue] > 100) { seconds = [timeout floatValue] / 1000.0; } else { seconds = 30.0; } finishBy = [NSDate dateWithTimeIntervalSinceNow: seconds]; appPath = [info objectForKey: @"NSExecutable"]; if ([appPath length] > 0) { /* * A relative path for NSExecutable is relative to the bundle. */ if ([appPath isAbsolutePath] == NO) { NSString *bundlePath = [info objectForKey: @"ServicePath"]; appPath = [bundlePath stringByAppendingPathComponent: appPath]; } } else { appPath = [info objectForKey: @"ServicePath"]; } userData = [info objectForKey: @"NSUserData"]; message = [info objectForKey: @"NSFilter"]; selName = [message stringByAppendingString: @":userData:error:"]; /* * Locate the service provider ... this will be a proxy to the remote * object, or a local object (if we provide the service ourself) */ provider = GSContactApplication(appPath, port, finishBy); if (provider == nil) { NSLog(@"Failed to contact service provider at '%@' '%@'", appPath, port); return; } /* * If the service provider is a remote object, we can set timeouts on * the NSConnection so we don't hang waiting for it to reply. */ if ([provider isProxy] == YES) { NSConnection *connection; connection = [(NSDistantObject*)provider connectionForProxy]; [connection enableMultipleThreads]; seconds = [finishBy timeIntervalSinceNow]; [connection setRequestTimeout: seconds]; [connection setReplyTimeout: seconds]; } /* * At last, we ask for the service to be performed. */ NS_DURING { SEL sel; NSMethodSignature *sig; sel = NSSelectorFromString(selName); sig = [provider methodSignatureForSelector: sel]; if (sig != nil) { NSInvocation *inv; NSString **errPtr = &error; inv = [NSInvocation invocationWithMethodSignature: sig]; [inv setTarget: provider]; [inv setSelector: sel]; [inv setArgument: (void*)&tmp atIndex: 2]; [inv setArgument: (void*)&userData atIndex: 3]; [inv setArgument: (void*)&errPtr atIndex: 4]; [inv invoke]; } else { error = @"No remote object to handle filter"; } } NS_HANDLER { error = [NSString stringWithFormat: @"%@", [localException reason]]; } NS_ENDHANDLER if (error != nil) { NSLog(@"Failed to contact service provider for '%@': %@", appPath, error); return; } /* * Finally, make it available. */ [sender setData: [GSByrefObject byrefWithObject: [tmp dataForType: type]] forType: type]; } } @end @interface NSPasteboard (Private) + (void) _localServer: (id)s; + (id) _lostServer: (NSNotification*)notification; + (id) _pbs; + (NSPasteboard*) _pasteboardWithTarget: (id)aTarget name: (NSString*)aName; - (id) _target; @end /** *

The pasteboard system is the primary mechanism for data exchange * between OpenStep applications. It is used for cut and paste of data, * as the exchange mechanism for services (as listed on the * services menu), for communicating with a spelling server in order to * perform spell checking, and for filter services which convert * data of one type to another transparently. *

*

Pasteboards are identified by names, some of which are standard * and are intended to exist permanently and be shared between all * applications, others are temporary or private and are used to handle * specific services. *

*

All data transferred to/from pasteboards is typed. Mostly * using one of several standard types for common data or using standardised * names which identify particular kinds of files and their contents * (see the NSCreateFileContentsPboardType() an * NSCreateFilenamePboardType() functions for details). It is also possible * for cooperating applications to use their own private types ... any string * value will do. *

*

Each pasteboard has an owner ... an object which declares the * types of data it can provide. Unless versions of the pasteboard data * corresponding to all the declared types are written to the pasteboard, * the owner is responsible for producing the data for the pasteboard when * it is called for (lazy provision of data).
* The pasteboard owner needs to implement the methods of the * NSPasteboardOwner informal protocol in order to do this. *

*/ @implementation NSPasteboard static NSRecursiveLock *dictionary_lock = nil; static NSMapTable *pasteboards = 0; static id the_server = nil; static NSMapTable *mimeMap = NULL; /** * Returns the general pasteboard found by calling +pasteboardWithName: * with NSGeneralPboard as the name. */ + (NSPasteboard*) generalPasteboard { static NSPasteboard *generalPboard = nil; NSPasteboard *currentGeneralPboard; // call pasteboardWithName: every time, to update server connection if needed currentGeneralPboard = [self pasteboardWithName: NSGeneralPboard]; if (currentGeneralPboard != generalPboard) { ASSIGN(generalPboard, currentGeneralPboard); } return generalPboard; } + (void) initialize { if (self == [NSPasteboard class]) { // Initial version [self setVersion: 1]; dictionary_lock = [[NSRecursiveLock alloc] init]; pasteboards = NSCreateMapTable (NSObjectMapKeyCallBacks, NSNonRetainedObjectMapValueCallBacks, 0); } } /** *

Creates and returns a pasteboard from which the data in the named * file can be read in all the types to which it can be converted by * filter services.
* The type of data in the file is inferred from the file extension. *

*

No filtering is actually performed until some object asks the * pasteboard for the data, so calling this method is quite inexpensive. *

*/ + (NSPasteboard*) pasteboardByFilteringData: (NSData*)data ofType: (NSString*)type { GSFiltered *p; NSArray *types; NSArray *originalTypes; originalTypes = [NSArray arrayWithObject: type]; types = [GSFiltered _typesFilterableFrom: originalTypes]; p = (GSFiltered*)[GSFiltered pasteboardWithUniqueName]; p->originalTypes = [originalTypes copy]; p->data = [data copy]; [p declareTypes: types owner: p]; return p; } /** *

Creates and returns a pasteboard from which the data in the named * file can be read in all the types to which it can be converted by * filter services.
* The type of data in the file is inferred from the file extension. *

*/ + (NSPasteboard*) pasteboardByFilteringFile: (NSString*)filename { GSFiltered *p; NSString *ext = [filename pathExtension]; NSArray *types; NSArray *originalTypes; if ([ext length] > 0) { originalTypes = [NSArray arrayWithObjects: NSCreateFilenamePboardType(ext), NSFilenamesPboardType, nil]; } else { originalTypes = [NSArray arrayWithObject: NSFilenamesPboardType]; } types = [GSFiltered _typesFilterableFrom: originalTypes]; p = (GSFiltered*)[GSFiltered pasteboardWithUniqueName]; p->originalTypes = [originalTypes copy]; p->file = [filename copy]; [p declareTypes: types owner: p]; return p; } /** *

Creates and returns a pasteboard where the data contained in pboard * is available for reading in as many types as it can be converted to by * available filter services. This normally expands on the range of types * available in pboard. *

*

NB. This only permits a single level of filtering ... if pboard was * previously returned by another filtering method, it is returned instead * of a new pasteboard. *

*/ + (NSPasteboard*) pasteboardByFilteringTypesInPasteboard: (NSPasteboard*)pboard { GSFiltered *p; NSArray *types; NSArray *originalTypes; if ([pboard isKindOfClass: [GSFiltered class]] == YES) { return pboard; } originalTypes = [pboard types]; types = [GSFiltered _typesFilterableFrom: originalTypes]; p = (GSFiltered*)[GSFiltered pasteboardWithUniqueName]; p->originalTypes = [originalTypes copy]; p->pboard = RETAIN(pboard); [p declareTypes: types owner: p]; return p; } /** *

Returns the pasteboard for the specified name. Creates a new pasteboard * if (and only if) one with the given name does not exist. *

* Standard pasteboard names are - * * * NSGeneralPboard * * NSFontPboard * * NSRulerPboard * * NSFindPboard * * NSDragPboard * */ + (NSPasteboard*) pasteboardWithName: (NSString*)aName { NS_DURING { id anObj; anObj = [[self _pbs] pasteboardWithName: aName]; if (anObj != nil) { NSPasteboard *ret; if ([(id)anObj isProxy] == YES) { Protocol *p = @protocol(GSPasteboardObj); [(id)anObj setProtocolForProxy: p]; } ret = [self _pasteboardWithTarget: anObj name: aName]; NS_VALRETURN(ret); } } NS_HANDLER { [NSException raise: NSPasteboardCommunicationException format: @"%@", [localException reason]]; } NS_ENDHANDLER return nil; } /** * Creates and returns a new pasteboard with a name guaranteed to be unique * within the pasteboard server. */ + (NSPasteboard*) pasteboardWithUniqueName { NS_DURING { id anObj; anObj = [[self _pbs] pasteboardWithName: nil]; if (anObj) { NSString *aName; aName = [anObj name]; if (aName) { NSPasteboard *ret; ret = [self _pasteboardWithTarget: anObj name: aName]; NS_VALRETURN(ret); } } } NS_HANDLER { [NSException raise: NSPasteboardCommunicationException format: @"%@", [localException reason]]; } NS_ENDHANDLER return nil; } /** * Returns an array of the types from which data of the specified type * can be produced by registered filter services.
* The original type is always present in this array.
* Raises an exception if type is nil. */ + (NSArray*) typesFilterableTo: (NSString*)type { NSMutableSet *types = [NSMutableSet setWithCapacity: 8]; NSArray *filters = [[GSServicesManager manager] filters]; NSEnumerator *enumerator = [filters objectEnumerator]; NSDictionary *info; [types addObject: type]; // Always include original type /* * Step through the filters looking for those which handle the type */ while ((info = [enumerator nextObject]) != nil) { NSArray *returnTypes = [info objectForKey: @"NSReturnTypes"]; if ([returnTypes containsObject: type] == YES) { NSArray *sendTypes = [info objectForKey: @"NSSendTypes"]; [types addObjectsFromArray: sendTypes]; } } return [types allObjects]; } /** *

Adds newTypes to the pasteboard and declares newOwner to be the owner * of the pasteboard. Use only after -declareTypes:owner: has been called * for the same owner, because the new owner may not support all the types * declared by a previous owner. *

*

Returns the new change count for the pasteboard, or zero if an error * occurs. *

*/ - (int) addTypes: (NSArray*)newTypes owner: (id)newOwner { int count = 0; NS_DURING { count = [target addTypes: newTypes owner: newOwner pasteboard: self oldCount: changeCount]; if (count > 0) { changeCount = count; } } NS_HANDLER { count = 0; [NSException raise: NSPasteboardCommunicationException format: @"%@", [localException reason]]; } NS_ENDHANDLER return count; } /** *

Sets the owner of the pasteboard to be newOwner and declares newTypes * as the types of data supported by it.
* This invalidates existing data in the pasteboard (except where the GNUstep * -setHistory: extension allows multi-version data to be held). *

*

The value of newOwner may be nil, but if it is, data should * immediately be written to the pasteboard for all the value in newTypes * as a nil owner cannot be used for lazy supply of data. *

*

This increments the change count for the pasteboard and the new * count is returned, or zero is returned if an error occurs.
* Where -setChangeCount: has been used, the highest count to date * is incremented and returned, rather than the last value specified * by the -setChangeCount: method. *

*

The types you declare can be arbitrary strings, but as at least two * applications really need to be aware of the same type for it to be * of use, it is much more normal to use a predefined (standard) type * or a type representing the name or content of a particular kind of * file (returned by the NSCreateFilenamePboardType() or * NSCreateFilenamePboardType() function).
* The standard type for raw data is * NSGeneralPboardType *

* The predefined pasteboard types are - * * * NSStringPboardType * * NSColorPboardType * * NSFileContentsPboardType * * NSFilenamesPboardType * * NSFontPboardType * * NSRulerPboardType * * NSPostScriptPboardType * * NSTabularTextPboardType * * NSRTFPboardType * * NSRTFDPboardType * * NSTIFFPboardType * * NSDataLinkPboardType * * NSGeneralPboardType * * NSPDFPboardType * * NSPICTPboardType * * NSURLPboardType * * NSHTMLPboardType * */ - (int) declareTypes: (NSArray*)newTypes owner: (id)newOwner { NS_DURING { changeCount = [target declareTypes: newTypes owner: newOwner pasteboard: self]; } NS_HANDLER { [NSException raise: NSPasteboardCommunicationException format: @"%@", [localException reason]]; } NS_ENDHANDLER return changeCount; } - (void) dealloc { DESTROY(target); [dictionary_lock lock]; if (NSMapGet(pasteboards, (void*)name) == (void*)self) { NSMapRemove(pasteboards, (void*)name); } DESTROY(name); [dictionary_lock unlock]; [super dealloc]; } - (NSString*) description { return [NSString stringWithFormat: @"%@ %@ %p", [super description], name, target]; } /** * Encode for DO by using just our name. */ - (void) encodeWithCoder: (NSCoder*)aCoder { [aCoder encodeObject: name]; } /** * Decode from DO by creating a new pasteboard with the decoded name. */ - (id) initWithCoder: (NSCoder*)aCoder { NSString *n = [aCoder decodeObject]; NSPasteboard *p = [[self class] pasteboardWithName: n]; ASSIGN(self, p); return self; } /** * Returns the pasteboard name (as given to +pasteboardWithName:) * for the receiver. */ - (NSString*) name { return name; } /** * Releases the receiver in the pasteboard server so that no other application * can use the pasteboard. This should not be called for any of the standard * pasteboards, only for temporary ones. */ - (void) releaseGlobally { if ([name isEqualToString: NSGeneralPboard] == YES || [name isEqualToString: NSFontPboard] == YES || [name isEqualToString: NSRulerPboard] == YES || [name isEqualToString: NSFindPboard] == YES || [name isEqualToString: NSDragPboard] == YES) { [NSException raise: NSGenericException format: @"Illegal attempt to globally release %@", name]; } [target releaseGlobally]; [dictionary_lock lock]; if (NSMapGet(pasteboards, (void*)name) == (void*)self) { NSMapRemove(pasteboards, (void*)name); } [dictionary_lock unlock]; } /** * Pasteboards sent over DO should always be copied so that a local * instance is created to communicate with the pasteboard server. */ - (id) replacementObjectForPortCoder: (NSPortCoder*)aCoder { if ([self class] == [NSPasteboard class]) { return self; // Always encode bycopy. } /* But ... if this is actually a filter rather than a 'real' pasteboard, * we don't want it copied to the pasteboard server. */ if ([self class] == [GSFiltered class]) { return [super replacementObjectForPortCoder: aCoder]; } return [super replacementObjectForPortCoder: aCoder]; } /** *

Writes data of type dataType to the pasteboard server so that other * applications can read it. The dataType must be one of the types * previously declared for the pasteboard.
* All the other methods for writing data to the pasteboard call this one. *

*

Returns YES on success, NO if the data could not be written for some * reason. *

*/ - (BOOL) setData: (NSData*)data forType: (NSString*)dataType { BOOL ok = NO; NS_DURING { ok = [target setData: data forType: dataType isFile: NO oldCount: changeCount]; } NS_HANDLER { ok = NO; [NSException raise: NSPasteboardCommunicationException format: @"%@", [localException reason]]; } NS_ENDHANDLER return ok; } - (BOOL) writeObjects: (NSArray*)objects { // FIXME: not implemented return NO; } /** *

Serialises the data in the supplied property list and writes it to the * pasteboard server using the -setData:forType: method. *

*

Data written using this method can be read by -propertyListForType: * or, if it was a simple string, by -stringForType: *

*

If the data is retrieved using -dataForType: then it needs to be * deserialized into a property list. *

*/ - (BOOL) setPropertyList: (id)propertyList forType: (NSString*)dataType { NSData *d = [NSSerializer serializePropertyList: propertyList]; return [self setData: d forType: dataType]; } /** *

Writes string it to the pasteboard server using the * -setPropertyList:forType: method. *

*

The data may subsequently be read from the receiver using the * -stringForType: or -propertyListForType: method. *

*

If the data is retrieved using -dataForType: then it needs to be * deserialized into a property list. *

*/ - (BOOL) setString: (NSString*)string forType: (NSString*)dataType { return [self setPropertyList: string forType: dataType]; } /** *

Writes the contents of the file filename to the pasteboard server * after declaring the type NSFileContentsPboardType as well as a type * based on the file extension (given by the NSCreateFileContentsPboardType() * function) if those types have not already been declared.
* If the filename has no extension, only NSFileContentsPboardType is used. *

*

Data written to a pasteboard by this method should be read using * the -readFileContentsType:toFile: or -readFileWrapper method. *

*

If the data is retrieved using -dataForType: then it needs to be * deserialized by the NSFileWrapper class. *

*/ - (BOOL) writeFileContents: (NSString*)filename { NSFileWrapper *wrapper; NSData *data; NSArray *types; NSString *ext = [filename pathExtension]; BOOL ok = NO; wrapper = [[NSFileWrapper alloc] initWithPath: filename]; data = [wrapper serializedRepresentation]; RELEASE(wrapper); if ([ext length] > 0) { types = [NSArray arrayWithObjects: NSFileContentsPboardType, NSCreateFileContentsPboardType(ext), nil]; } else { types = [NSArray arrayWithObject: NSFileContentsPboardType]; } if ([[self types] isEqual: types] == NO) { if ([self declareTypes: types owner: owner] == 0) { return NO; // Unable to declare types. } } NS_DURING { ok = [target setData: data forType: NSFileContentsPboardType isFile: YES oldCount: changeCount]; } NS_HANDLER { ok = NO; [NSException raise: NSPasteboardCommunicationException format: @"%@", [localException reason]]; } NS_ENDHANDLER return ok; } /** *

Writes the contents of the file wrapper to the pasteboard server * after declaring the type NSFileContentsPboardType as well as a type * based on the file extension of the wrappers preferred filename if * those types have not already been declared. *

*

Raises an exception if there is no preferred filename. *

*

Data written to a pasteboard by this method should be read using * the -readFileContentsType:toFile: or -readFileWrapper method. *

*

If the data is retrieved using -dataForType: then it needs to be * deserialized by the NSFileWrapper class. *

*/ - (BOOL) writeFileWrapper: (NSFileWrapper *)wrapper { NSString *filename = [wrapper preferredFilename]; NSData *data; NSArray *types; NSString *ext = [filename pathExtension]; BOOL ok = NO; if (filename == nil) { [NSException raise: NSInvalidArgumentException format: @"Cannot put file on pasteboard with " @"no preferred filename"]; } data = [wrapper serializedRepresentation]; if ([ext length] > 0) { types = [NSArray arrayWithObjects: NSFileContentsPboardType, NSCreateFileContentsPboardType(ext), nil]; } else { types = [NSArray arrayWithObject: NSFileContentsPboardType]; } if ([[self types] isEqual: types] == NO) { if ([self declareTypes: types owner: owner] == 0) { return NO; // Unable to declare types. } } NS_DURING { ok = [target setData: data forType: NSFileContentsPboardType isFile: YES oldCount: changeCount]; } NS_HANDLER { ok = NO; [NSException raise: NSPasteboardCommunicationException format: @"%@", [localException reason]]; } NS_ENDHANDLER return ok; } /** * Returns the first type listed in types which the receiver has been * declared (see -declareTypes:owner:) to support. */ - (NSString*) availableTypeFromArray: (NSArray*)types { NSString *type = nil; NS_DURING { int count = 0; type = [target availableTypeFromArray: types changeCount: &count]; changeCount = count; } NS_HANDLER { type = nil; [NSException raise: NSPasteboardCommunicationException format: @"%@", [localException reason]]; } NS_ENDHANDLER return type; } /** * Returns all the types that the receiver has been declared to support.
* See -declareTypes:owner: for details. */ - (NSArray*) types { NSArray *result = nil; NS_DURING { int count = 0; result = [target typesAndChangeCount: &count]; changeCount = count; } NS_HANDLER { result = nil; [NSException raise: NSPasteboardCommunicationException format: @"%@", [localException reason]]; } NS_ENDHANDLER return result; } /** * Returns the change count for the receiving pasteboard. This count * is incremented whenever the owner of the pasteboard is changed. */ - (int) changeCount { NS_DURING { int count; count = [target changeCount]; changeCount = count; } NS_HANDLER { [NSException raise: NSPasteboardCommunicationException format: @"%@", [localException reason]]; } NS_ENDHANDLER return changeCount; } /** * Returns data from the pasteboard of the specified dataType, or nil * if no such data is available.
* May raise an exception if communication with the pasteboard server fails. */ - (NSData*) dataForType: (NSString*)dataType { NSData *d = nil; NS_DURING { d = [target dataForType: dataType oldCount: changeCount mustBeCurrent: (useHistory == NO) ? YES : NO]; } NS_HANDLER { d = nil; [NSException raise: NSPasteboardCommunicationException format: @"%@", [localException reason]]; } NS_ENDHANDLER return d; } /** * Calls -dataForType: to obtain data (expected to be a serialized property * list) and returns the object produced by deserializing it. */ - (id) propertyListForType: (NSString*)dataType { NSData *d = [self dataForType: dataType]; if (d) return [NSDeserializer deserializePropertyListFromData: d mutableContainers: NO]; else return nil; } /** *

Obtains data of the specified dataType from the pasteboard, deserializes * it to the specified filename and returns the file name (or nil on failure). *

*

This method should only be used to read data written by * the -writeFileContents: or -writeFileWrapper: method. *

*/ - (NSString*) readFileContentsType: (NSString*)type toFile: (NSString*)filename { NSData *d; NSFileWrapper *wrapper; if (type == nil) { type = NSCreateFileContentsPboardType([filename pathExtension]); } d = [self dataForType: type]; if (d == nil) { d = [self dataForType: NSFileContentsPboardType]; if (d == nil) return nil; } wrapper = [[NSFileWrapper alloc] initWithSerializedRepresentation: d]; if ([wrapper writeToFile: filename atomically: NO updateFilenames: NO] == NO) { RELEASE(wrapper); return nil; } RELEASE(wrapper); return filename; } /** *

Obtains data of the specified dataType from the pasteboard, deserializes * it and returns the resulting file wrapper (or nil). *

*

This method should only be used to read data written by * the -writeFileContents: or -writeFileWrapper: method. *

*/ - (NSFileWrapper*) readFileWrapper { NSData *d = [self dataForType: NSFileContentsPboardType]; if (d == nil) return nil; return AUTORELEASE([[NSFileWrapper alloc] initWithSerializedRepresentation: d]); } /** *

Obtains data of the specified dataType from the pasteboard, deserializes * it and returns the resulting string (or nil). *

*

The string should have been written using the -setString:forType: or * -setPropertyList:forType: method. *

*/ - (NSString*) stringForType: (NSString*)dataType { NSString *s = [self propertyListForType: dataType]; if ([s isKindOfClass: [NSString class]] == NO) { s = nil; } return s; } @end @implementation NSPasteboard (Private) /* * Special method to use a local server rather than connecting over DO */ + (void) _localServer: (id)s { the_server = s; } + (id) _lostServer: (NSNotification*)notification { id obj = the_server; the_server = nil; [[NSNotificationCenter defaultCenter] removeObserver: self name: NSConnectionDidDieNotification object: [notification object]]; RELEASE(obj); return self; } + (id) _pbs { if (the_server == nil) { NSString *host; NSString *description; host = [[NSUserDefaults standardUserDefaults] stringForKey: @"NSHost"]; if (host == nil) { host = @""; } else { NSHost *h; /* * If we have a host specified, but it is the current host, * we do not need to ask for a host by name (nameserver lookup * can be faster) and the empty host name can be used to * indicate that we may start a pasteboard server locally. */ h = [NSHost hostWithName: host]; if (h == nil) { NSLog(@"Unknown NSHost (%@) ignored", host); host = @""; } else if ([h isEqual: [NSHost currentHost]] == YES) { host = @""; } else { host = [h name]; } } if ([host length] == 0) { description = @"local host"; } else { description = host; } the_server = (id)[NSConnection rootProxyForConnectionWithRegisteredName: PBSNAME host: host]; if (the_server == nil && [host length] > 0) { NSString *service; service = [PBSNAME stringByAppendingFormat: @"-%@", host]; the_server = (id)[NSConnection rootProxyForConnectionWithRegisteredName: service host: @"*"]; } if (RETAIN((id)the_server) != nil) { NSConnection *conn = [(id)the_server connectionForProxy]; Protocol *p = @protocol(GSPasteboardSvr); [conn enableMultipleThreads]; [(id)the_server setProtocolForProxy: p]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_lostServer:) name: NSConnectionDidDieNotification object: conn]; } else { static BOOL recursion = NO; static NSString *cmd = nil; if (cmd == nil && recursion ==NO) { cmd = RETAIN([NSTask launchPathForTool: @"gpbs"]); } if (recursion == YES || cmd == nil) { NSLog(@"Unable to contact pasteboard server - " @"please ensure that gpbs is running for %@.", description); return nil; } else { NSNotificationCenter *nc; NSMutableArray *startIndicator; NSArray *args = nil; NSDate *timeoutDate; NSDebugLLog(@"NSPasteboard", @"\nI couldn't contact the pasteboard server for %@ -\n" @"so I'm attempting to start one - which might take a few seconds.\n" @"Trying to launch gpbs from %@ or a machine/operating-system subdirectory.\n", description, [cmd stringByDeletingLastPathComponent]); if ([host length] > 0) { args = [[NSArray alloc] initWithObjects: @"-NSHost", host, @"-GSStartupNotification", @"GSStartup-GPBS", @"--auto", nil]; } else { args = [[NSArray alloc] initWithObjects: @"-GSStartupNotification",@"GSStartup-GPBS", @"--auto", nil]; } /* Trick: To avoid having to use global variables or new methods to track whether the notification has been received or not, we use a mutable array as an indicator. When the notification is received, the array is emptied, so we just check the count. */ startIndicator = [[NSMutableArray alloc] initWithObjects: AUTORELEASE([[NSObject alloc] init]), nil]; nc = [NSDistributedNotificationCenter defaultCenter]; [nc addObserver: startIndicator selector: @selector(removeAllObjects) name: @"GSStartup-GPBS" object: nil]; [NSTask launchedTaskWithLaunchPath: cmd arguments: args]; RELEASE(args); timeoutDate = [NSDate dateWithTimeIntervalSinceNow: 5.0]; while ([startIndicator count] && [timeoutDate timeIntervalSinceNow] > 0.0) { [[NSRunLoop currentRunLoop] runMode: NSDefaultRunLoopMode beforeDate: timeoutDate]; } [nc removeObserver: startIndicator]; DESTROY(startIndicator); recursion = YES; [self _pbs]; recursion = NO; } } } return the_server; } /* * Creating and Releasing an NSPasteboard Object */ + (NSPasteboard*) _pasteboardWithTarget: (id)aTarget name: (NSString*)aName { NSPasteboard *p = nil; [dictionary_lock lock]; p = (NSPasteboard*)NSMapGet(pasteboards, (void*)aName); if (p != nil) { /* * It is conceivable that the following may have occurred - * 1. The pasteboard was created on the server * 2. We set up an NSPasteboard to point to it * 3. The pasteboard on the server was destroyed by a [-releaseGlobally] * 4. The named pasteboard was asked for again - resulting in a new * object being created on the server. * If this is the case, our proxy for the object on the server will be * out of date, so we swap it for the newly created one. */ if (p->target != (id)aTarget) { ASSIGN(p->target, (id)aTarget); } } else { /* * For a newly created NSPasteboard object, we must make an entry * in the dictionary so we can look it up safely. */ p = [self alloc]; if (p != nil) { ASSIGN(p->target, (id)aTarget); ASSIGNCOPY(p->name, aName); NSMapInsert(pasteboards, (void*)p, (void*)p->name); [p autorelease]; } } p->changeCount = [p->target changeCount]; [dictionary_lock unlock]; return p; } - (id) _target { return target; } @end /** * GNUstep specific extensions ...
*

GNUstep adds a mechanism for mapping between OpenStep pasteboard * types and MIME types. This is useful for inter-operation with other * systems, as MIME types have come into common usage (long after the * OpenStep specification was created). *

*

The other extension to the pasteboard system produced by GNUstep * is the ability to keep a history of recent items placed in a * pasteboard, and retrieve data from that history rather than just * the current item. *

*/ @implementation NSPasteboard (GNUstepExtensions) /** *

Once the -setChangeCount: message has been sent to an NSPasteboard * the object will gain an extra GNUstep behaviour - when getting data * from the pasteboard, the data need no longer be from the latest * version but may be a version from a previous representation with * the specified change count. *

*

The value of count must be one which has previously been returned * by -declareTypes:owner: and should not be further in the past than * specified by the -setHistory: method. *

*/ - (void) setChangeCount: (int)count { useHistory = YES; changeCount = count; } /** * Sets the number of changes for which pasteboard data is kept.
* This is 1 by default. */ - (void) setHistory: (unsigned)length { NS_DURING { [target setHistory: length]; } NS_HANDLER { [NSException raise: NSPasteboardCommunicationException format: @"%@", [localException reason]]; } NS_ENDHANDLER } + (void) _initMimeMappings { mimeMap = NSCreateMapTable(NSObjectMapKeyCallBacks, NSObjectMapValueCallBacks, 0); NSMapInsert(mimeMap, (void *)NSStringPboardType, (void *)@"text/plain"); NSMapInsert(mimeMap, (void *)NSFileContentsPboardType, (void *)@"text/plain"); NSMapInsert(mimeMap, (void *)NSFilenamesPboardType, (void *)@"text/uri-list"); NSMapInsert(mimeMap, (void *)NSPostScriptPboardType, (void *)@"application/postscript"); NSMapInsert(mimeMap, (void *)NSTabularTextPboardType, (void *)@"text/tab-separated-values"); NSMapInsert(mimeMap, (void *)NSRTFPboardType, (void *)@"text/richtext"); NSMapInsert(mimeMap, (void *)NSTIFFPboardType, (void *)@"image/tiff"); NSMapInsert(mimeMap, (void *)NSGeneralPboardType, (void *)@"text/plain"); } /** * Return the mapping for pasteboard->mime, or return the original pasteboard * type if no mapping is found */ + (NSString *) mimeTypeForPasteboardType: (NSString *)type { NSString *mime; if (mimeMap == NULL) { [self _initMimeMappings]; } mime = NSMapGet(mimeMap, (void *)type); if (mime == nil) { mime = type; } return mime; } /** * Return the mapping for mime->pasteboard, or return the original pasteboard * type if no mapping is found. This method may not have a one-to-one * mapping */ + (NSString *) pasteboardTypeForMimeType: (NSString *)mimeType { BOOL found; NSString *type; NSString *mime; NSMapEnumerator enumerator; if (mimeMap == NULL) { [self _initMimeMappings]; } enumerator = NSEnumerateMapTable(mimeMap); while ((found = NSNextMapEnumeratorPair(&enumerator, (void **)(&type), (void **)(&mime)))) { if ([mimeType isEqual: mime]) { break; } } if (found == NO) { type = mimeType; } return type; } @end /** * Category of NSURL providing convenience methods. */ @implementation NSURL (NSPasteboard) /** * Creates a URL with data (of NSURLPboardType) from pasteBoard. */ + (NSURL *) URLFromPasteboard: (NSPasteboard *)pasteBoard { return [self URLWithString: [pasteBoard stringForType: NSURLPboardType]]; } /** * Writes the receiver (as data of NSURLPboardType) to pasteBoard. */ - (void) writeToPasteboard: (NSPasteboard *)pasteBoard { [pasteBoard setString: [self absoluteString] forType: NSURLPboardType]; } @end /** *

Returns a standardised pasteboard type for file contents, * formed from the supplied file extension. *

*

Data written to a pasteboard with a file contents type should * be written using the [NSPasteboard-writeFileContents:] or * [NSPasteboard-writeFileWrapper:] method. Similarly, the data should * be read using the [NSPasteboard-readFileContentsType:toFile:] or * [NSPasteboard-readFileWrapper] method. *

*/ NSString* NSCreateFileContentsPboardType(NSString *fileType) { NSString *ext = [fileType pathExtension]; if ([ext length] == 0) { ext = fileType; } return [NSString stringWithFormat: @"%@%@", contentsPrefix, ext]; } /** *

Returns a standardised pasteboard type for file names, * formed from the supplied file extension. *

*

Data written to a pasteboard with a file names type should * be a single name written using [NSPasteboard-setString:forType:] or * an array of strings written using * [NSPasteboard-setPropertyList:forType:].
* Similarly, the data should be read using * the [NSPasteboard-stringForType:] or * [NSPasteboard-propertyListForType:] method. *

*

See also the NSGetFileType() and NSGetFileTypes() functions. *

*/ NSString* NSCreateFilenamePboardType(NSString *fileType) { NSString *ext = [fileType pathExtension]; if ([ext length] == 0) { ext = fileType; } return [NSString stringWithFormat: @"%@%@", namePrefix, ext]; } /** * Returns the file type (fileType extension) corresponding to the * pasteboard type given.
* This is a counterpart to the NSCreateFilenamePboardType() function. */ NSString* NSGetFileType(NSString *pboardType) { if ([pboardType hasPrefix: contentsPrefix]) { return [pboardType substringFromIndex: [contentsPrefix length]]; } if ([pboardType hasPrefix: namePrefix]) { return [pboardType substringFromIndex: [namePrefix length]]; } return nil; } /** * Returns the file types (filename extensions) corresponding to the * pasteboard types given. */ NSArray* NSGetFileTypes(NSArray *pboardTypes) { NSMutableArray *a = [NSMutableArray arrayWithCapacity: [pboardTypes count]]; unsigned int i; for (i = 0; i < [pboardTypes count]; i++) { NSString *s = NSGetFileType([pboardTypes objectAtIndex: i]); if (s && ! [a containsObject: s]) { [a addObject: s]; } } if ([a count] > 0) { return AUTORELEASE([a copy]); } return nil; } /* * The following dummy classes are here solely as a workaround for pre 3.3 * versions of gcc where protocols didn't work properly unless implemented * in the source where the '@protocol()' directive is used. */ @interface NSPasteboardServerDummy : NSObject - (id) pasteboardWithName: (in bycopy NSString*)name; @end @implementation NSPasteboardServerDummy - (id) pasteboardWithName: (in bycopy NSString*)name { return nil; } @end @interface NSPasteboardObjectDummy : NSObject - (int) addTypes: (in bycopy NSArray*)types owner: (id)owner pasteboard: (NSPasteboard*)pb oldCount: (int)count; - (NSString*) availableTypeFromArray: (in bycopy NSArray*)types changeCount: (int*)count; - (int) changeCount; - (NSData*) dataForType: (in bycopy NSString*)type oldCount: (int)count mustBeCurrent: (BOOL)flag; - (int) declareTypes: (in bycopy NSArray*)types owner: (id)owner pasteboard: (NSPasteboard*)pb; - (NSString*) name; - (void) releaseGlobally; - (BOOL) setData: (in bycopy NSData*)data forType: (in bycopy NSString*)type isFile: (BOOL)flag oldCount: (int)count; - (void) setHistory: (unsigned)length; - (bycopy NSArray*) typesAndChangeCount: (int*)count; @end @implementation NSPasteboardObjectDummy - (int) addTypes: (in bycopy NSArray*)types owner: (id)owner pasteboard: (NSPasteboard*)pb oldCount: (int)count { return 0; } - (NSString*) availableTypeFromArray: (in bycopy NSArray*)types changeCount: (int*)count { return nil; } - (int) changeCount { return 0; } - (NSData*) dataForType: (in bycopy NSString*)type oldCount: (int)count mustBeCurrent: (BOOL)flag { return nil; } - (int) declareTypes: (in bycopy NSArray*)types owner: (id)owner pasteboard: (NSPasteboard*)pb { return 0; } - (NSString*) name { return nil; } - (void) releaseGlobally { } - (BOOL) setData: (in bycopy NSData*)data forType: (in bycopy NSString*)type isFile: (BOOL)flag oldCount: (int)count { return NO; } - (void) setHistory: (unsigned)length { } - (bycopy NSArray*) typesAndChangeCount: (int*)count { return nil; } @end gnustep-gui-0.24.0/Source/NSAlert.m0000664000076500007650000016633012102166206016675 0ustar brains99brains99/** NSAlert Encapsulate an alert panel Copyright (C) 1998, 2000, 2004 Free Software Foundation, Inc. Author: Fred Kiefer Date: July 2004 GSAlertPanel and alert panel functions implementation Author: Richard Frith-Macdonald Date: 1998 GSAlertPanel and alert panel functions cleanup and improvements (scroll view) Author: Pascal J. Bourguignon > Date: 2000-03-08 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import #import #import #import #import #import "AppKit/NSAlert.h" #import "AppKit/NSApplication.h" #import "AppKit/NSAttributedString.h" #import "AppKit/NSBox.h" #import "AppKit/NSBrowser.h" #import "AppKit/NSBrowserCell.h" #import "AppKit/NSButton.h" #import "AppKit/NSEvent.h" #import "AppKit/NSFont.h" #import "AppKit/NSHelpManager.h" #import "AppKit/NSImage.h" #import "AppKit/NSMatrix.h" #import "AppKit/NSPanel.h" #import "AppKit/NSScreen.h" #import "AppKit/NSScroller.h" #import "AppKit/NSScrollView.h" #import "AppKit/NSStringDrawing.h" #import "AppKit/NSTextField.h" #import "AppKit/NSTextView.h" #import "GNUstepGUI/GMAppKit.h" #import "GNUstepGUI/GMArchiver.h" #import "GSGuiPrivate.h" extern NSThread *GSAppKitThread; static NSNotificationCenter *nc = nil; #ifdef ALERT_TITLE static NSString *defaultTitle = @"Alert"; #else static NSString *defaultTitle = @" "; #endif /* +--------------------------------------------------------------------------+ |############################Title bar#####################################| +--------------------------------------------------------------------------+ | | | | | | | ........... | | | | | : | : | | | | |--: Icon | :----Title | | | | :-------|-: | | | | :.........: | | | | | | | |-===========================|=============~~~~~~=========================-| | s | | | s | | | ...................s....|......................................... | | : Message s s ; | | : s s : | | : s s : | |----: s s :----| | :~~~~~~~~~~~~~~~~~~s~~~~~~~~~~~~~~~~~~~~s~~~~~~~~~~~~~~~~~~~~~~~~: | | : s s : | | :..................s.............................................: | | | s | | | s +-----------+ +-----------+ +-----------+ | | | s | Altern |---| Cancel |---| OK |----| | | s +-----------+ +-----------+ +-----------+ | | | s | | | | +--------------------------------------------------------------------------+ Apart from the buttons and window borders, '|' and '-' mean not flexible, while '~' and 's' mean flexible. The global window size is determined by the message text field size. which is computed with sizeToFit. However, if the window would become larger than the screen, then the message text field is replaced with a scroll view containing the text. The strategy taken in this new version of GSAlertPanel is to let the icon, the title field and the line (box view) being placed automatically by resizing the window, but to always place explicitely the message field (or scroll view when it's needed) and the buttons (that may change of width), the whole in the sizeToFitIfNeeded method. We're doing it separately from the setting of the elements (setTitle: ...) because we also need to recompute the size of the window and position of the elements when dearchiving a panel, because it could be dearchived and displayed on a much smaller screen than originaly created, in which case we needed to embed the message field into a scroll view, and reduce the size of the window. Some rules (which are implemented in sizePanelToFit): ===================================================== IF the messageField is too big either vertically or horizontally and would make the window greater than the screen in any direction, THEN use a scroll view. The width of the window content rect is the minimum of: = the width of the content rect of a window filling the screen = the maximum of: = a minimum width of 362, = the messageField width + 2 = MessageHorzMargin, = the sum of sizes of the buttons and their interspaces and margins, = the sum of sizes of the icon, title and their interspaces and margin. The height of the window content rect is the minimum of: = the height of the content rect of a window filling the screen = the maximum of: = a minimum height of 161. = the sum of: = The height of the icon, the line and their interspaces. = The height of the messageField and its interspaces, if present. = The height of the buttons and their interspaces, if present. The size of the scroll view must be at minimum ScrollMinSize in each direction. The size of the messageField is a given (sizeToFit). The height of the scroll is the rest of the height of the content rect minus the height of the other elements. The width of the scroll is the rest of the width of the content rect minus the margins. In order to prevent alert panels from obscuring the whole screen, we limit the width and height of a panel to at most a factor of SIZE_SCALE of the screen size. At present, we use 60% for SIZE_SCALE, which means that the limit is greater than the minimum width and height even on a 640x400 screen. ((wsize.width <= ssize.width * SIZE_SCALE) and ([messageField frame].size.width+2*MessageHorzMargin <= wsize.width)) or ((wsize.width == ssize.width * SIZE_SCALE) and ([scroll frame].size.width = wsize.width-2*MessageHorzMargin)); ... */ @class GSAlertPanel; static GSAlertPanel *standardAlertPanel = nil; static GSAlertPanel *informationalAlertPanel = nil; static GSAlertPanel *criticalAlertPanel = nil; @interface GSAlertPanel: NSPanel { NSButton *defButton; NSButton *altButton; NSButton *othButton; NSButton *icoButton; NSTextField *titleField; NSTextField *messageField; NSScrollView *scroll; NSInteger result; BOOL isGreen; // we were unarchived and not resized. } - (id) _initWithoutGModel; - (NSInteger) runModal; - (void) setTitleBar: (NSString*)titleBar icon: (NSImage*)icon title: (NSString*)title message: (NSString*)message; - (void) setTitleBar: (NSString*)titleBar icon: (NSImage*)icon title: (NSString*)title message: (NSString*)message def: (NSString*)defaultButton alt: (NSString*)alternateButton other: (NSString*)otherButton; - (void) setButtons: (NSArray *)buttons; - (void) sizePanelToFit; - (void) buttonAction: (id)sender; - (NSInteger) result; - (BOOL) isActivePanel; @end @implementation GSAlertPanel //static const float WTitleHeight = 0.0; // TODO: Check this value. static const float WinMinWidth = 362.0; static const float WinMinHeight = 161.0; static const float IconSide = 48.0; static const float IconBottom = -56.0; // from the top of the window. static const float IconLeft = 8.0; static const float TitleLeft = 64.0; static const float TitleMinRight = 8.0; static const float LineHeight = 2.0; static const float LineBottom = -66.0; // from the top of the window. static const float LineLeft = 0.0; //static const float ScrollMinSize = 48.0; // in either direction. static const float MessageHorzMargin = 8.0; // 5 is too little margin. //static const float MessageMinHeight = 20.0; static const float MessageVertMargin = 6.0; // from the top of the buttons. static const float MessageTop = -72; // from the top of the window; static const float ButtonBottom = 8.0; // from the bottom of the window. static const float ButtonMargin = 8.0; static const float ButtonInterspace = 10.0; static const float ButtonMinHeight = 24.0; static const float ButtonMinWidth = 72.0; #define SIZE_SCALE 0.6 #define MessageFont [NSFont messageFontOfSize: 14] + (void) initialize { if (self == [GSAlertPanel class]) { [self setVersion: 1]; } } - (id) init { /* if (![NSBundle loadNibNamed: @"AlertPanel" owner: self]) { NSLog(@"cannot open alert panel model file\n"); return nil; } */ return [self _initWithoutGModel]; } - (void) dealloc { if (self == standardAlertPanel) { standardAlertPanel = nil; } if (self == informationalAlertPanel) { informationalAlertPanel = nil; } if (self == criticalAlertPanel) { criticalAlertPanel = nil; } RELEASE(defButton); RELEASE(altButton); RELEASE(othButton); RELEASE(icoButton); RELEASE(titleField); RELEASE(messageField); RELEASE(scroll); [super dealloc]; } static NSScrollView* makeScrollViewWithRect(NSRect rect) { float lineHeight = [MessageFont boundingRectForFont].size.height; NSScrollView *scroll = [[NSScrollView alloc]initWithFrame: rect]; [scroll setBorderType: NSLineBorder]; [scroll setBackgroundColor: [NSColor controlBackgroundColor]]; [scroll setHasHorizontalScroller: NO]; [scroll setHasVerticalScroller: YES]; [scroll setScrollsDynamically: YES]; [scroll setLineScroll: lineHeight]; [scroll setPageScroll: lineHeight*10.0]; return scroll; } - (NSButton*) _makeButtonWithRect: (NSRect)rect tag: (NSInteger)tag { NSButton *button = [[NSButton alloc] initWithFrame: rect]; [button setAutoresizingMask: NSViewMinXMargin | NSViewMaxYMargin]; [button setButtonType: NSMomentaryPushInButton]; [button setTitle: @""]; [button setTarget: self]; [button setAction: @selector(buttonAction:)]; [button setTag: tag]; [button setFont: [NSFont systemFontOfSize: 0]]; return button; } #define useControl(control) ([control superview] != nil) static void setControl(NSView* content, id control, NSString *title) { if (title != nil) { if ([control respondsToSelector: @selector(setTitle:)]) { [control setTitle: title]; } else if ([control respondsToSelector: @selector(setStringValue:)]) { [control setStringValue: title]; } [control sizeToFit]; if (!useControl(control)) { [content addSubview: control]; } } else if (useControl(control)) { [control removeFromSuperview]; } } static void setButton(NSView* content, NSButton *control, NSButton *template) { if (template != nil) { [control setTitle: [template title]]; [control setKeyEquivalent: [template keyEquivalent]]; [control setKeyEquivalentModifierMask: [template keyEquivalentModifierMask]]; [control setTag: [template tag]]; [control sizeToFit]; if (!useControl(control)) { [content addSubview: control]; } } else if (useControl(control)) { [control removeFromSuperview]; } } static void setKeyEquivalent(NSButton *button) { NSString *title = [button title]; if (![[button keyEquivalent] isEqualToString: @"\r"]) { if ([title isEqualToString: _(@"Cancel")]) { [button setKeyEquivalent: @"\e"]; [button setKeyEquivalentModifierMask: 0]; } else if ([title isEqualToString: _(@"Don't Save")]) { [button setKeyEquivalent: @"d"]; [button setKeyEquivalentModifierMask: NSCommandKeyMask]; } else { [button setKeyEquivalent: @""]; [button setKeyEquivalentModifierMask: 0]; } } } - (id) _initWithoutGModel { NSRect rect; NSImage *image; NSBox *box; NSView *content; NSRect r = NSMakeRect(0.0, 0.0, WinMinWidth, WinMinHeight); NSFont *titleFont = [NSFont systemFontOfSize: 18.0]; float titleHeight = [titleFont boundingRectForFont].size.height; NSText *fieldEditor = [self fieldEditor: YES forObject: messageField]; NSDictionary *selectedAttrs; self = [self initWithContentRect: r styleMask: NSTitledWindowMask backing: NSBackingStoreRetained defer: YES]; if (self == nil) return nil; [self setTitle: @" "]; [self setLevel: NSModalPanelWindowLevel]; content = [self contentView]; // we're an ATTENTION panel, therefore: [self setHidesOnDeactivate: NO]; [self setBecomesKeyOnlyIfNeeded: NO]; // First, the subviews that will be positioned automatically. rect.size.height = IconSide; rect.size.width = IconSide; rect.origin.y = r.origin.y + r.size.height + IconBottom; rect.origin.x = IconLeft; icoButton = [[NSButton alloc] initWithFrame: rect]; [icoButton setAutoresizingMask: NSViewMaxXMargin|NSViewMinYMargin]; [icoButton setBordered: NO]; [icoButton setEnabled: NO]; [[icoButton cell] setImageDimsWhenDisabled: NO]; [[icoButton cell] setImageScaling: NSImageScaleProportionallyUpOrDown]; [icoButton setImagePosition: NSImageOnly]; image = [[NSApplication sharedApplication] applicationIconImage]; [icoButton setImage: image]; [content addSubview: icoButton]; // Title rect.size.height = 0.0; // will be sized to fit anyway. rect.size.width = 0.0; // will be sized to fit anyway. rect.origin.y = r.origin.y + r.size.height + IconBottom + (IconSide - titleHeight)/2;; rect.origin.x = TitleLeft; titleField = [[NSTextField alloc] initWithFrame: rect]; [titleField setAutoresizingMask: NSViewMinYMargin]; [titleField setEditable: NO]; [titleField setSelectable: NO]; [titleField setBezeled: NO]; [titleField setDrawsBackground: NO]; [titleField setStringValue: @""]; [titleField setFont: titleFont]; // Horizontal line rect.size.height = LineHeight; rect.size.width = r.size.width; rect.origin.y = r.origin.y + r.size.height + LineBottom; rect.origin.x = LineLeft; box = [[NSBox alloc] initWithFrame: rect]; [box setAutoresizingMask: NSViewWidthSizable | NSViewMinYMargin]; [box setTitlePosition: NSNoTitle]; [box setBorderType: NSGrooveBorder]; [content addSubview: box]; RELEASE(box); // Then, make the subviews that'll be sized by sizePanelToFit; rect.size.height = 0.0; rect.size.width = 0.0; rect.origin.y = 0.0; rect.origin.x = 0.0; messageField = [[NSTextField alloc] initWithFrame: rect]; [messageField setEditable: NO]; /* PJB: How do you want the user to report an error message if it is not selectable? Any text visible on the screen should always be selectable for a copy-and-paste. Hence, setSelectable: YES. */ selectedAttrs = [NSDictionary dictionaryWithObjectsAndKeys: [NSColor controlLightHighlightColor], NSBackgroundColorAttributeName, nil]; [(NSTextView *)fieldEditor setSelectedTextAttributes: selectedAttrs]; [messageField setSelectable: YES]; [messageField setBezeled: NO]; [messageField setDrawsBackground: NO]; [messageField setAlignment: NSCenterTextAlignment]; [messageField setStringValue: @""]; [messageField setFont: MessageFont]; defButton = [self _makeButtonWithRect: rect tag: NSAlertDefaultReturn]; [defButton setKeyEquivalent: @"\r"]; [defButton setHighlightsBy: NSPushInCellMask | NSChangeGrayCellMask | NSContentsCellMask]; [defButton setImagePosition: NSImageRight]; [defButton setImage: [NSImage imageNamed: @"common_ret"]]; [defButton setAlternateImage: [NSImage imageNamed: @"common_retH"]]; altButton = [self _makeButtonWithRect: rect tag: NSAlertAlternateReturn]; othButton = [self _makeButtonWithRect: rect tag: NSAlertOtherReturn]; rect.size.height = 80.0; scroll = makeScrollViewWithRect(rect); result = NSAlertErrorReturn; isGreen = YES; return self; } - (void) sizePanelToFit { NSRect bounds; NSSize ssize; // screen size (corrected). NSSize bsize; // button size (max of the three). NSSize wsize = {0.0, 0.0}; // window size (computed). NSScreen *screen; NSView *content; NSButton *buttons[3]; float position = 0.0; int numberOfButtons; int i; BOOL needsScroll; BOOL couldNeedScroll; NSUInteger mask = [self styleMask]; /* * Set size to the size of a content rectangle of a panel * that completely fills the screen. */ screen = [self screen]; if (screen == nil) { screen = [NSScreen mainScreen]; } bounds = [screen frame]; bounds = [NSWindow contentRectForFrameRect: bounds styleMask: mask]; ssize = bounds.size; /* Do not let a panel grow beyond a factor of SIZE_SCALE of the screen */ ssize.width = SIZE_SCALE * ssize.width; ssize.height = SIZE_SCALE * ssize.height; // Let's size the title. if (useControl(titleField)) { NSRect rect = [titleField frame]; float width = TitleLeft + rect.size.width + TitleMinRight; if (wsize.width < width) { wsize.width = width; // ssize.width < width = > the title will be silently clipped. } } wsize.height = -LineBottom; // Let's count the buttons. bsize.width = ButtonMinWidth; bsize.height = ButtonMinHeight; buttons[0] = defButton; buttons[1] = altButton; buttons[2] = othButton; numberOfButtons = 0; for (i = 0; i < 3; i++) { if (useControl(buttons[i])) { NSRect rect = [buttons[i] frame]; if (bsize.width < rect.size.width) { bsize.width = rect.size.width; } if (bsize.height < rect.size.height) { bsize.height = rect.size.height; } numberOfButtons++; } } if (numberOfButtons > 0) { // (with NSGetAlertPanel, there could be zero buttons). float width = (bsize.width + ButtonInterspace) * numberOfButtons -ButtonInterspace + ButtonMargin * 2; /* * If the buttons are too wide or too high to fit in the screen, * then too bad! Thought it would be simple enough to put them * in the scroll view with the messageField. * TODO: See if we raise an exception here or if we let the * QA people detect this kind of problem. */ if (wsize.width < width) { wsize.width = width; } wsize.height += ButtonBottom + bsize.height; } // Let's see the size of the messageField and how to place it. needsScroll = NO; couldNeedScroll = useControl(messageField); if (couldNeedScroll) { NSRect rect = [messageField frame]; float width = rect.size.width + 2*MessageHorzMargin; if (wsize.width < width) { wsize.width = width; } /* If the message is too wide, wrap its text. Apparently, we cannot use -sizeToFit to compute the height of the message. */ [messageField setAlignment: NSLeftTextAlignment]; width = ssize.width - 2*MessageHorzMargin; rect.size = [[messageField attributedStringValue] boundingRectWithSize: NSMakeSize(width, 1e6) options: 0].size; [messageField setFrame: rect]; /* * But only the messageField can impose a great height, therefore * we check it along in the next paragraph. */ wsize.height += rect.size.height + 2 * MessageVertMargin; } else { wsize.height += MessageVertMargin; } // Strategically placed here, we resize the window. if (ssize.height < wsize.height) { wsize.height = ssize.height; needsScroll = couldNeedScroll; } else if (wsize.height < WinMinHeight) { wsize.height = WinMinHeight; } if (needsScroll) { wsize.width += [NSScroller scrollerWidth] + 4.0; } if (ssize.width < wsize.width) { wsize.width = ssize.width; } else if (wsize.width < WinMinWidth) { wsize.width = WinMinWidth; } bounds = NSMakeRect(0, 0, wsize.width, wsize.height); bounds = [NSWindow frameRectForContentRect: bounds styleMask: mask]; [self setMaxSize: bounds.size]; [self setMinSize: bounds.size]; [self setContentSize: wsize]; content = [self contentView]; bounds = [content bounds]; // Now we can place the buttons. if (numberOfButtons > 0) { position = bounds.origin.x + bounds.size.width - ButtonMargin; for (i = 0; i < 3; i++) { if (useControl(buttons[i])) { NSRect rect; position -= bsize.width; rect.origin.x = position; rect.origin.y = bounds.origin.y + ButtonBottom; rect.size.width = bsize.width; rect.size.height = bsize.height; [buttons[i] setFrame: rect]; position -= ButtonInterspace; } } } // Finaly, place the message. if (useControl(messageField)) { NSRect mrect = [messageField frame]; if (needsScroll) { NSRect srect; float width; // The scroll view takes all the space that is available. srect.origin.x = bounds.origin.x + MessageHorzMargin; if (numberOfButtons > 0) { srect.origin.y = bounds.origin.y + ButtonBottom + bsize.height + MessageVertMargin; } else { srect.origin.y = bounds.origin.y + MessageVertMargin; } srect.size.width = bounds.size.width - 2 * MessageHorzMargin; srect.size.height = bounds.origin.y + bounds.size.height + MessageTop - srect.origin.y; [scroll setFrame: srect]; if (!useControl(scroll)) { [content addSubview: scroll]; } /* Adjust the message field's width again so that it does not exceed the scroll view's visible rectangle and we do not need a horizontal scroller. */ [messageField removeFromSuperview]; width = [NSScrollView contentSizeForFrameSize: srect.size hasHorizontalScroller: NO hasVerticalScroller: YES borderType: [scroll borderType]].width; mrect.origin = NSZeroPoint; mrect.size = [[messageField attributedStringValue] boundingRectWithSize: NSMakeSize(width, 1e6) options: 0].size; [messageField setFrame: mrect]; [scroll setDocumentView: messageField]; } else { float vmargin; /* * We must center vertically the messageField because * the window has a minimum size, thus may be greater * than expected. */ mrect.origin.x = (wsize.width - mrect.size.width)/2; vmargin = bounds.size.height + LineBottom-mrect.size.height; if (numberOfButtons > 0) { vmargin -= ButtonBottom + bsize.height; } vmargin/= 2.0; // if negative, it'll bite up and down. mrect.origin.y = bounds.origin.y + vmargin; if (numberOfButtons > 0) { mrect.origin.y += ButtonBottom + bsize.height; } [messageField setFrame: mrect]; } } else if (useControl(scroll)) { [scroll removeFromSuperview]; } isGreen = NO; [content display]; } - (void) buttonAction: (id)sender { if (![self isActivePanel]) { NSLog(@"alert panel buttonAction: when not in modal loop\n"); return; } result = [sender tag]; [NSApp stopModalWithCode: result]; } - (NSInteger) result { return result; } - (BOOL) isActivePanel { return [NSApp modalWindow] == self; } - (NSInteger) runModal { if (GSCurrentThread() != GSAppKitThread) { [self performSelectorOnMainThread: _cmd withObject: nil waitUntilDone: YES]; } else { if (isGreen) { [self sizePanelToFit]; } [NSApp runModalForWindow: self]; [self orderOut: self]; } return result; } - (void) setTitleBar: (NSString*)titleBar icon: (NSImage*)icon title: (NSString*)title message: (NSString*)message { NSView *content = [self contentView]; if (titleBar != nil) { [self setTitle: titleBar]; } if (icon != nil) { [icoButton setImage: icon]; } if (title == nil) { title = titleBar; // Fall back to the same text as the title bar } setControl(content, titleField, title); if (useControl(scroll)) { // TODO: Remove the following line once NSView is corrected. [scroll setDocumentView: nil]; [scroll removeFromSuperview]; [messageField removeFromSuperview]; } setControl(content, messageField, message); /* If the message contains a newline character then align the * message to the left side, as it is quite undesirable for a long * message to appear aligned in the center */ if ([message rangeOfString: @"\n"].location != NSNotFound) { [messageField setAlignment: NSLeftTextAlignment]; } else { [messageField setAlignment: NSCenterTextAlignment]; } } - (void) setTitleBar: (NSString*)titleBar icon: (NSImage*)icon title: (NSString*)title message: (NSString*)message def: (NSString*)defaultButton alt: (NSString*)alternateButton other: (NSString*)otherButton { NSView *content = [self contentView]; [self setTitleBar: titleBar icon: icon title: title message: message]; setControl(content, defButton, defaultButton); setControl(content, altButton, alternateButton); setControl(content, othButton, otherButton); if (useControl(defButton)) { [self makeFirstResponder: defButton]; } else { [self makeFirstResponder: self]; } if (useControl(altButton)) { setKeyEquivalent(altButton); } if (useControl(othButton)) { setKeyEquivalent(othButton); } /* a *working* nextKeyView chain: the trick is that the 3 buttons are not always used (displayed) so we have to set the nextKeyView *each* time. Maybe some optimisation in the logic of this block will be good, however it seems too risky for a (so) small reward */ { BOOL ud, ua, uo; ud = useControl(defButton); ua = useControl(altButton); uo = useControl(othButton); if (ud) { if (uo) [defButton setNextKeyView: othButton]; else if (ua) [defButton setNextKeyView: altButton]; else { [defButton setPreviousKeyView: nil]; [defButton setNextKeyView: nil]; } } if (uo) { if (ua) [othButton setNextKeyView: altButton]; else if (ud) [othButton setNextKeyView: defButton]; else { [othButton setPreviousKeyView: nil]; [othButton setNextKeyView: nil]; } } if (ua) { if (ud) [altButton setNextKeyView: defButton]; else if (uo) [altButton setNextKeyView: othButton]; else { [altButton setPreviousKeyView: nil]; [altButton setNextKeyView: nil]; } } } [self sizePanelToFit]; isGreen = YES; result = NSAlertErrorReturn; /* If no button was pressed */ } - (void) setButtons: (NSArray *)buttons; { NSView *content = [self contentView]; NSUInteger count = [buttons count]; setButton(content, defButton, count > 0 ? [buttons objectAtIndex: 0] : nil); setButton(content, altButton, count > 1 ? [buttons objectAtIndex: 1] : nil); setButton(content, othButton, count > 2 ? [buttons objectAtIndex: 2] : nil); if (useControl(defButton)) { [self makeFirstResponder: defButton]; } else { [self makeFirstResponder: self]; } /* a *working* nextKeyView chain: the trick is that the 3 buttons are not always used (displayed) so we have to set the nextKeyView *each* time. */ if (count > 2) { [defButton setNextKeyView: othButton]; [othButton setNextKeyView: altButton]; [altButton setNextKeyView: defButton]; } else if (count > 1) { [defButton setNextKeyView: altButton]; [altButton setNextKeyView: defButton]; } else if (count > 0) { [defButton setPreviousKeyView: nil]; [defButton setNextKeyView: nil]; } [self sizePanelToFit]; isGreen = YES; result = NSAlertErrorReturn; /* If no button was pressed */ } @end /* GSAlertPanel */ @implementation GSAlertPanel (GMArchiverMethods) // Reuse createObjectForModelUnarchiver: from super class - (void) encodeWithModelArchiver: (GMArchiver*)archiver { [super encodeWithModelArchiver: archiver]; [archiver encodeSize: [self frame].size withName: @"OriginalSize"]; [archiver encodeObject: defButton withName: @"DefaultButton"]; [archiver encodeObject: altButton withName: @"AlternateButton"]; [archiver encodeObject: othButton withName: @"OtherButton"]; [archiver encodeObject: icoButton withName: @"IconButton"]; [archiver encodeObject: messageField withName: @"MessageField"]; [archiver encodeObject: titleField withName: @"TitleField"]; } - (id) initWithModelUnarchiver: (GMUnarchiver*)unarchiver { self = [super initWithModelUnarchiver: unarchiver]; if (self != nil) { (void)[unarchiver decodeSizeWithName: @"OriginalSize"]; defButton = RETAIN([unarchiver decodeObjectWithName: @"DefaultButton"]); altButton = RETAIN([unarchiver decodeObjectWithName: @"AlternateButton"]); othButton = RETAIN([unarchiver decodeObjectWithName: @"OtherButton"]); icoButton = RETAIN([unarchiver decodeObjectWithName: @"IconButton"]); messageField = RETAIN([unarchiver decodeObjectWithName: @"MessageField"]); titleField = RETAIN([unarchiver decodeObjectWithName: @"TitleField"]); scroll = makeScrollViewWithRect(NSMakeRect(0.0, 0.0, 80.0, 80.0)); result = NSAlertErrorReturn; isGreen = YES; } return self; } @end /* GSAlertPanel GMArchiverMethods */ /* GSAlertSheet. This class provides a borderless window which is attached to the parent window. */ @interface GSAlertSheet : GSAlertPanel @end @implementation GSAlertSheet + (void) initialize { if (self == [GSAlertSheet class]) { if (nc == nil) { nc = [NSNotificationCenter defaultCenter]; } [self setVersion: 0]; } } - (id) initWithContentRect: (NSRect)contentRect styleMask: (NSUInteger)aStyle backing: (NSBackingStoreType)bufferingType defer: (BOOL)flag { if (NSIsEmptyRect(contentRect)) { contentRect = NSMakeRect(0,0,100,100); } self = [super initWithContentRect: contentRect styleMask: NSBorderlessWindowMask backing: bufferingType defer: flag]; if (self != nil) { // FIXME } return self; } - (NSRect) frameFromParentWindowFrame { id parent = [self parentWindow]; NSRect frame = [self frame]; NSRect newFrame = NSZeroRect; // return zero rect, if parent isn't set. if(parent != nil) { NSRect contentRect = [[parent contentView] frame]; // // The calculation is based on the contentRect of the parent window // since we want the sheet to appear just inside of it. // newFrame = [parent frame]; newFrame.origin.x += ((newFrame.size.width - frame.size.width) / 2); newFrame.origin.y += (contentRect.size.height - frame.size.height) + 5; } return newFrame; } - (void) resetWindow { NSRect frame = [self frameFromParentWindowFrame]; NSWindow *parent = nil; if((parent = [self parentWindow]) != nil) { [self setBackgroundColor: [[parent backgroundColor] highlightWithLevel: 0.4]]; } [self setFrame: frame display: YES]; } - (void) setParentWindow: (NSWindow *)window { [super setParentWindow: window]; [self resetWindow]; /* [nc removeObserver: self]; if (parent != nil) { // add observers.... [nc addObserver: self selector: @selector(handleWindowClose:) name: NSWindowWillCloseNotification object: parent]; [nc addObserver: self selector: @selector(handleWindowMiniaturize:) name: NSWindowWillMiniaturizeNotification object: parent]; [nc addObserver: self selector: @selector(handleWindowMove:) name: NSWindowWillMoveNotification object: parent]; [nc addObserver: self selector: @selector(handleWindowMove:) name: NSWindowDidResizeNotification object: parent]; [nc addObserver: self selector: @selector(handleWindowDidBecomeKey:) name: NSWindowDidBecomeKeyNotification object: parent]; } */ } /* - (void) handleWindowClose: (NSNotification *)notification { [self close]; } - (void) handleWindowMiniaturize: (NSNotification *)notification { [self close]; } - (void) handleWindowMove: (NSNotification *)notification { [self _resetWindowPosition]; } - (void) handleWindowDidBecomeKey: (NSNotification *)notification { [self _resetWindowPosition]; } - (void) dealloc { [nc removeObserver: self]; [super dealloc]; } */ @end /* These functions may be called "recursively". For example, from a timed event. Therefore, there may be several alert panel active at the same time, but only the first one will be THE standardAlertPanel, which will not be released once finished with, but which will be kept for future use. +---------+---------+---------+---------+---------+ | std !=0 | std act | pan=std | pan=new | std=new | +---------+---------+---------+---------+---------+ a: | F | N/A | | X | X | +---------+---------+---------+---------+---------+ b: | V | F | X | | | +---------+---------+---------+---------+---------+ c: | V | V | | X | | +---------+---------+---------+---------+---------+ */ /* TODO: Check if this discrepancy is wanted and needed. If not, we could merge these parameters, even for the alert panel, setting its window title to "Alert". */ @interface _GSAlertCreation : NSObject { GSAlertPanel **instance; NSString *defaultTitle; NSString *title; NSString *message; NSString *defaultButton; NSString *alternateButton; NSString *otherButton; GSAlertPanel *panel; } - (id) initWithInstance: (GSAlertPanel**)_instance defaultTitle: (NSString*)_defaultTitle title: (NSString*)_title message: (NSString*)_message defaultButton: (NSString*)_defaultButton alternateButton: (NSString*)_alternateButton otherButton: (NSString*)_otherButton; - (void) makePanel; - (void) makeSheet; - (GSAlertPanel*) panel; @end @implementation _GSAlertCreation - (void) dealloc { RELEASE(defaultTitle); RELEASE(title); RELEASE(defaultButton); RELEASE(alternateButton); RELEASE(otherButton); [super dealloc]; } - (id) initWithInstance: (GSAlertPanel**)_instance defaultTitle: (NSString*)_defaultTitle title: (NSString*)_title message: (NSString*)_message defaultButton: (NSString*)_defaultButton alternateButton: (NSString*)_alternateButton otherButton: (NSString*)_otherButton { instance = _instance; ASSIGNCOPY(defaultTitle, _defaultTitle); ASSIGNCOPY(title, _title); ASSIGNCOPY(message, _message); ASSIGNCOPY(defaultButton, _defaultButton); ASSIGNCOPY(alternateButton, _alternateButton); ASSIGNCOPY(otherButton, _otherButton); return self; } - (void) makePanel { if (*instance != 0 && [*instance isMemberOfClass: [GSAlertPanel class]]) { if ([*instance isActivePanel]) { // c: panel = [[GSAlertPanel alloc] init]; } else { // b: panel = *instance; } } else { // a: panel = [[GSAlertPanel alloc] init]; *instance = panel; } [panel setTitleBar: defaultTitle icon: nil title: title message: message def: defaultButton alt: alternateButton other: otherButton]; } - (void) makeSheet { if (*instance != 0 && [*instance isMemberOfClass: [GSAlertSheet class]]) { if ([*instance isActivePanel]) { // c: panel = [[GSAlertSheet alloc] init]; } else { // b: panel = *instance; } } else { // a: panel = [[GSAlertSheet alloc] init]; *instance = panel; } [panel setTitleBar: defaultTitle icon: nil title: title message: message def: defaultButton alt: alternateButton other: otherButton]; } - (GSAlertPanel*) panel { return panel; } @end static GSAlertPanel* getSomePanel( GSAlertPanel **instance, NSString *defaultTitle, NSString *title, NSString *message, NSString *defaultButton, NSString *alternateButton, NSString *otherButton) { GSAlertPanel *panel; if (GSCurrentThread() != GSAppKitThread) { _GSAlertCreation *c; NSWarnFLog(@"Alert Panel functionality called from a thread other than" @" the main one, this may not work on MacOS-X and could therefore be" @" a portability problem in your code"); c = [_GSAlertCreation alloc]; c = [c initWithInstance: instance defaultTitle: defaultTitle title: title message: message defaultButton: defaultButton alternateButton: alternateButton otherButton: otherButton]; [c performSelectorOnMainThread: @selector(makePanel) withObject: nil waitUntilDone: YES]; panel = [c panel]; RELEASE(c); } else { if (*instance != 0 && [*instance isMemberOfClass: [GSAlertPanel class]]) { if ([*instance isActivePanel]) { // c: panel = [[GSAlertPanel alloc] init]; } else { // b: panel = *instance; } } else { // a: panel = [[GSAlertPanel alloc] init]; *instance = panel; } [panel setTitleBar: defaultTitle icon: nil title: title message: message def: defaultButton alt: alternateButton other: otherButton]; } return panel; } static GSAlertPanel* getSomeSheet( GSAlertPanel **instance, NSString *defaultTitle, NSString *title, NSString *message, NSString *defaultButton, NSString *alternateButton, NSString *otherButton) { GSAlertSheet *panel; if (GSCurrentThread() != GSAppKitThread) { _GSAlertCreation *c; NSWarnFLog(@"Alert Sheet functionality called from a thread other than" @" the main one, this may not work on MacOS-X and could therefore be" @" a portability problem in your code"); c = [_GSAlertCreation alloc]; c = [c initWithInstance: instance defaultTitle: defaultTitle title: title message: message defaultButton: defaultButton alternateButton: alternateButton otherButton: otherButton]; [c performSelectorOnMainThread: @selector(makeSheet) withObject: nil waitUntilDone: YES]; panel = (GSAlertSheet *)[c panel]; RELEASE(c); } else { if (*instance != 0 && [*instance isMemberOfClass: [GSAlertSheet class]]) { if ([*instance isActivePanel]) { // c: panel = [[GSAlertSheet alloc] init]; } else { // b: panel = (GSAlertSheet *)*instance; } } else { // a: panel = [[GSAlertSheet alloc] init]; *instance = panel; } [panel setTitleBar: defaultTitle icon: nil title: title message: message def: defaultButton alt: alternateButton other: otherButton]; } return panel; } id NSGetAlertPanel( NSString *title, NSString *msg, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, ...) { va_list ap; NSString *message; va_start(ap, otherButton); message = [NSString stringWithFormat: msg arguments: ap]; va_end(ap); return getSomePanel(&standardAlertPanel, defaultTitle, title, message, defaultButton, alternateButton, otherButton); } NSInteger NSRunAlertPanel( NSString *title, NSString *msg, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, ...) { va_list ap; NSString *message; GSAlertPanel *panel; NSInteger result; va_start(ap, otherButton); message = [NSString stringWithFormat: msg arguments: ap]; va_end(ap); if (NSApp == nil) { // No NSApp ... not running in a gui application so just log. NSLog(@"%@", message); return NSAlertDefaultReturn; } if (defaultButton == nil) { defaultButton = @"OK"; } panel = getSomePanel(&standardAlertPanel, defaultTitle, title, message, defaultButton, alternateButton, otherButton); result = [panel runModal]; NSReleaseAlertPanel(panel); return result; } NSInteger NSRunLocalizedAlertPanel( NSString *table, NSString *title, NSString *msg, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, ...) { va_list ap; NSString *message; GSAlertPanel *panel; NSInteger result; NSBundle *bundle = [NSBundle mainBundle]; if (title == nil) { title = defaultTitle; } #define localize(string) if (string != nil) \ string = [bundle localizedStringForKey: string value: string table: table] localize(title); localize(defaultButton); localize(alternateButton); localize(otherButton); localize(msg); #undef localize va_start(ap, otherButton); message = [NSString stringWithFormat: msg arguments: ap]; va_end(ap); if (defaultButton == nil) { defaultButton = @"OK"; } panel = getSomePanel(&standardAlertPanel, @"Alert", title, message, defaultButton, alternateButton, otherButton); result = [panel runModal]; NSReleaseAlertPanel(panel); return result; } id NSGetCriticalAlertPanel( NSString *title, NSString *msg, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, ...) { va_list ap; NSString *message; va_start(ap, otherButton); message = [NSString stringWithFormat: msg arguments: ap]; va_end(ap); return getSomePanel(&criticalAlertPanel, @"Critical", title, message, defaultButton, alternateButton, otherButton); } NSInteger NSRunCriticalAlertPanel( NSString *title, NSString *msg, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, ...) { va_list ap; NSString *message; GSAlertPanel *panel; NSInteger result; va_start(ap, otherButton); message = [NSString stringWithFormat: msg arguments: ap]; va_end(ap); panel = getSomePanel(&criticalAlertPanel, @"Critical", title, message, defaultButton, alternateButton, otherButton); result = [panel runModal]; NSReleaseAlertPanel(panel); return result; } id NSGetInformationalAlertPanel( NSString *title, NSString *msg, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, ...) { va_list ap; NSString *message; va_start(ap, otherButton); message = [NSString stringWithFormat: msg arguments: ap]; va_end(ap); return getSomePanel(&informationalAlertPanel, @"Information", title, message, defaultButton, alternateButton, otherButton); } NSInteger NSRunInformationalAlertPanel( NSString *title, NSString *msg, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, ...) { va_list ap; NSString *message; GSAlertPanel *panel; NSInteger result; va_start(ap, otherButton); message = [NSString stringWithFormat: msg arguments: ap]; va_end(ap); panel = getSomePanel(&informationalAlertPanel, @"Information", title, message, defaultButton, alternateButton, otherButton); result = [panel runModal]; NSReleaseAlertPanel(panel); return result; } void NSReleaseAlertPanel(id panel) { if ((panel != standardAlertPanel) && (panel != informationalAlertPanel) && (panel != criticalAlertPanel)) { RELEASE(panel); } } // // New alert interface of Mac OS X // void NSBeginAlertSheet(NSString *title, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, NSWindow *docWindow, id modalDelegate, SEL willEndSelector, SEL didEndSelector, void *contextInfo, NSString *msg, ...) { va_list ap; NSString *message; GSAlertPanel *panel; va_start(ap, msg); message = [NSString stringWithFormat: msg arguments: ap]; va_end(ap); if (defaultButton == nil) { defaultButton = @"OK"; } panel = getSomeSheet(&standardAlertPanel, defaultTitle, title, message, defaultButton, alternateButton, otherButton); // FIXME: We should also change the button action to call endSheet: [NSApp beginSheet: panel modalForWindow: docWindow modalDelegate: modalDelegate didEndSelector: willEndSelector contextInfo: contextInfo]; [panel close]; if (modalDelegate && [modalDelegate respondsToSelector: didEndSelector]) { void (*didEnd)(id, SEL, id, NSInteger, void*); didEnd = (void (*)(id, SEL, id, NSInteger, void*))[modalDelegate methodForSelector: didEndSelector]; didEnd(modalDelegate, didEndSelector, panel, [panel result], contextInfo); } NSReleaseAlertPanel(panel); } void NSBeginCriticalAlertSheet(NSString *title, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, NSWindow *docWindow, id modalDelegate, SEL willEndSelector, SEL didEndSelector, void *contextInfo, NSString *msg, ...) { va_list ap; NSString *message; GSAlertPanel *panel; va_start(ap, msg); message = [NSString stringWithFormat: msg arguments: ap]; va_end(ap); panel = getSomeSheet(&criticalAlertPanel, @"Critical", title, message, defaultButton, alternateButton, otherButton); // FIXME: We should also change the button action to call endSheet: [NSApp beginSheet: panel modalForWindow: docWindow modalDelegate: modalDelegate didEndSelector: willEndSelector contextInfo: contextInfo]; [panel close]; if (modalDelegate && [modalDelegate respondsToSelector: didEndSelector]) { void (*didEnd)(id, SEL, id, NSInteger, void*); didEnd = (void (*)(id, SEL, id, NSInteger, void*))[modalDelegate methodForSelector: didEndSelector]; didEnd(modalDelegate, didEndSelector, panel, [panel result], contextInfo); } NSReleaseAlertPanel(panel); } void NSBeginInformationalAlertSheet(NSString *title, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, NSWindow *docWindow, id modalDelegate, SEL willEndSelector, SEL didEndSelector, void *contextInfo, NSString *msg, ...) { va_list ap; NSString *message; GSAlertPanel *panel; va_start(ap, msg); message = [NSString stringWithFormat: msg arguments: ap]; va_end(ap); panel = getSomeSheet(&informationalAlertPanel, @"Information", title, message, defaultButton, alternateButton, otherButton); // FIXME: We should also change the button action to call endSheet: [NSApp beginSheet: panel modalForWindow: docWindow modalDelegate: modalDelegate didEndSelector: willEndSelector contextInfo: contextInfo]; [panel close]; if (modalDelegate && [modalDelegate respondsToSelector: didEndSelector]) { void (*didEnd)(id, SEL, id, NSInteger, void*); didEnd = (void (*)(id, SEL, id, NSInteger, void*))[modalDelegate methodForSelector: didEndSelector]; didEnd(modalDelegate, didEndSelector, panel, [panel result], contextInfo); } NSReleaseAlertPanel(panel); } @implementation NSAlert /* * Class methods */ + (void) initialize { if (self == [NSAlert class]) { [self setVersion: 1]; } } + (NSAlert *) alertWithError: (NSError *)error { NSArray *options; NSUInteger count; options = [error localizedRecoveryOptions]; count = [options count]; return [self alertWithMessageText: [error localizedDescription] defaultButton: (count > 0) ? [options objectAtIndex: 0] : nil alternateButton: (count > 1) ? [options objectAtIndex: 1] : nil otherButton: (count > 2) ? [options objectAtIndex: 2] : nil informativeTextWithFormat: [error localizedRecoverySuggestion]]; } + (NSAlert *) alertWithMessageText: (NSString *)messageTitle defaultButton: (NSString *)defaultButtonTitle alternateButton: (NSString *)alternateButtonTitle otherButton: (NSString *)otherButtonTitle informativeTextWithFormat: (NSString *)format, ... { va_list ap; NSAlert *alert = [[self alloc] init]; NSButton *but; NSString *text; va_start(ap, format); if (format != nil) { text = [[NSString alloc] initWithFormat: format arguments: ap]; [alert setInformativeText: text]; RELEASE(text); } va_end(ap); [alert setMessageText: messageTitle]; if (defaultButtonTitle != nil) { but = [alert addButtonWithTitle: defaultButtonTitle]; } else { but = [alert addButtonWithTitle: _(@"OK")]; } [but setTag: NSAlertDefaultReturn]; if (alternateButtonTitle != nil) { but = [alert addButtonWithTitle: alternateButtonTitle]; [but setTag: NSAlertAlternateReturn]; } if (otherButtonTitle != nil) { but = [alert addButtonWithTitle: otherButtonTitle]; [but setTag: NSAlertOtherReturn]; } return AUTORELEASE(alert); } - (id) init { _buttons = [[NSMutableArray alloc] init]; _style = NSWarningAlertStyle; return self; } - (void) dealloc { RELEASE(_informative_text); RELEASE(_message_text); RELEASE(_icon); RELEASE(_buttons); RELEASE(_help_anchor); RELEASE(_window); [super dealloc]; } - (void) setInformativeText: (NSString *)informativeText { ASSIGN(_informative_text, informativeText); } - (NSString *) informativeText { return _informative_text; } - (void) setMessageText: (NSString *)messageText { ASSIGN(_message_text, messageText); } - (NSString *) messageText { return _message_text; } - (void) setIcon: (NSImage *)icon { ASSIGN(_icon, icon); } - (NSImage *) icon { return _icon; } - (NSButton *) addButtonWithTitle: (NSString *)aTitle { NSButton *button = [[NSButton alloc] init]; NSUInteger count = [_buttons count]; [button setTitle: aTitle]; [button setAutoresizingMask: NSViewMinXMargin | NSViewMaxYMargin]; [button setButtonType: NSMomentaryPushButton]; [button setTarget: self]; [button setAction: @selector(buttonAction:)]; [button setFont: [NSFont systemFontOfSize: 0]]; if (count == 0) { [button setTag: NSAlertFirstButtonReturn]; [button setKeyEquivalent: @"\r"]; } else { [button setTag: NSAlertFirstButtonReturn + count]; setKeyEquivalent(button); } [_buttons addObject: button]; RELEASE(button); return button; } - (NSArray *) buttons { return _buttons; } - (void) setShowsHelp: (BOOL)showsHelp { _shows_help = showsHelp; } - (BOOL) showsHelp { return _shows_help; } - (void) setHelpAnchor: (NSString *)anchor { ASSIGN(_help_anchor, anchor); } - (NSString *) helpAnchor { return _help_anchor; } - (void) setAlertStyle: (NSAlertStyle)style { _style = style; } - (NSAlertStyle) alertStyle { return _style; } - (void) setDelegate: (id)delegate { _delegate = delegate; } - (id) delegate { return _delegate; } - (void) _setupPanel { if (GSCurrentThread() != GSAppKitThread) { [self performSelectorOnMainThread: _cmd withObject: nil waitUntilDone: YES]; } else { GSAlertPanel *panel; NSString *title; panel = [[GSAlertPanel alloc] init]; _window = panel; switch (_style) { case NSCriticalAlertStyle: title = @"Critical"; break; case NSInformationalAlertStyle: title = @"Information"; break; case NSWarningAlertStyle: default: title = @"Alert"; break; } [panel setTitleBar: title icon: _icon title: _message_text != nil ? _message_text : _(@"Alert") message: _informative_text != nil ? _informative_text : _(@"No information")]; [panel setButtons: _buttons]; } } - (NSInteger) runModal { if (GSCurrentThread() != GSAppKitThread) { [self performSelectorOnMainThread: _cmd withObject: nil waitUntilDone: YES]; return _result; } else { [self _setupPanel]; [NSApp runModalForWindow: _window]; [_window orderOut: self]; _result = [(GSAlertPanel*)_window result]; DESTROY(_window); return _result; } } - (void) beginSheetModalForWindow: (NSWindow *)window modalDelegate: (id)delegate didEndSelector: (SEL)didEndSelector contextInfo: (void *)contextInfo { [self _setupPanel]; _modalDelegate = delegate; _didEndSelector = didEndSelector; [NSApp beginSheet: _window modalForWindow: window modalDelegate: self didEndSelector: @selector(_alertDidEnd:returnCode:contextInfo:) contextInfo: contextInfo]; DESTROY(_window); } - (void) _alertDidEnd: (NSWindow *)sheet returnCode: (NSInteger)returnCode contextInfo: (void *)contextInfo { if ([_modalDelegate respondsToSelector: _didEndSelector]) { void (*didEnd)(id, SEL, id, NSInteger, void *); didEnd = (void (*)(id, SEL, id, NSInteger, void *))[_modalDelegate methodForSelector: _didEndSelector]; didEnd(_modalDelegate, _didEndSelector, self, returnCode, contextInfo); } } - (id) window { return _window; } @end @interface GSExceptionPanel : GSAlertPanel { NSBrowser *_browser; NSDictionary *_userInfo; NSPanel *_userInfoPanel; } - (void) setUserInfo: (NSDictionary *)userInfo; - (NSPanel *) userInfoPanel; @end NSInteger GSRunExceptionPanel( NSString *title, NSException *exception, NSString *defaultButton, NSString *alternateButton, NSString *otherButton) { NSString *message; GSExceptionPanel *panel; NSInteger result; message = [NSString stringWithFormat: @"%@: %@", [exception name], [exception reason]]; if (defaultButton == nil) { defaultButton = @"OK"; } panel = [[GSExceptionPanel alloc] init]; if (title == nil) { title = @"Exception"; } [panel setTitleBar: nil icon: nil title: title message: message def: defaultButton alt: alternateButton other: otherButton]; [panel setUserInfo: [exception userInfo]]; result = [panel runModal]; [[panel userInfoPanel] orderOut: nil]; [panel setUserInfo: nil]; RELEASE(panel); return result; } @implementation GSExceptionPanel - (void) dealloc { RELEASE(_userInfo); RELEASE(_browser); RELEASE(_userInfoPanel); [super dealloc]; } - (id) init { if ((self = [super init])) { [icoButton setEnabled: YES]; [icoButton setTarget: self]; [icoButton setAction: @selector(_icoAction:)]; } return self; } - (NSPanel *) userInfoPanel { return _userInfoPanel; } - (void) setUserInfo: (NSDictionary *)userInfo; { ASSIGN(_userInfo, userInfo); [_browser reloadColumn: 0]; } - (void) _icoAction: (id)sender { NSRect fr; if (_userInfoPanel) { [_browser reloadColumn: 0]; return; } fr = NSMakeRect(_frame.origin.x, _frame.origin.y + _frame.size.height + 15, _frame.size.width, 108); _userInfoPanel = [[NSPanel alloc] initWithContentRect: fr styleMask: NSTitledWindowMask | NSResizableWindowMask backing: NSBackingStoreBuffered defer: NO]; [_userInfoPanel setTitle: @"User Info Inspector"]; [_userInfoPanel setWorksWhenModal: YES]; fr = NSMakeRect(8, 8, _frame.size.width - 16, 100); _browser = [[NSBrowser alloc] initWithFrame: fr]; [_browser setMaxVisibleColumns: 2]; [_browser setDelegate: self]; [_browser setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [_browser reloadColumn: 0]; [[_userInfoPanel contentView] addSubview:_browser]; [_userInfoPanel makeKeyAndOrderFront: self]; } - (NSInteger) browser: (id)browser numberOfRowsInColumn: (NSInteger)col { if (col == 0) return [[_userInfo allKeys] count]; else { id val; volatile id foo = nil; val = [[(NSCell *)[browser selectedCellInColumn: col - 1] representedObject] description]; NS_DURING foo = [val propertyList]; val = foo; NS_HANDLER NS_ENDHANDLER if ([val isKindOfClass: [NSArray class]]) return [val count]; else if ([val isKindOfClass: [NSDictionary class]]) return [[val allKeys] count]; else return val != nil; } return 0; } - (void) browser: (NSBrowser *)browser willDisplayCell: (NSBrowserCell *)cell atRow: (NSInteger)row column: (NSInteger)column { if (column == 0) { id key = [[_userInfo allKeys] objectAtIndex: row]; id val = [_userInfo objectForKey: key]; [cell setLeaf: NO]; [cell setStringValue: [key description]]; [cell setRepresentedObject: val]; } else { volatile id val; BOOL flag; val = [(NSCell *)[browser selectedCellInColumn: column - 1] representedObject]; if (!([val isKindOfClass: [NSArray class]] || [val isKindOfClass: [NSArray class]])) { volatile id foo = nil; val = [val description]; NS_DURING foo = [val propertyList]; val = foo; NS_HANDLER NS_ENDHANDLER } flag = (!([val isKindOfClass: [NSArray class]] || [val isKindOfClass: [NSDictionary class]])); [cell setLeaf: flag]; if ([val isKindOfClass: [NSArray class]]) { volatile id obj = [val objectAtIndex: row]; if (!([obj isKindOfClass: [NSArray class]] || [obj isKindOfClass: [NSArray class]])) { volatile id foo; obj = [[obj description] propertyList]; NS_DURING foo = [obj propertyList]; obj = foo; NS_HANDLER NS_ENDHANDLER } if ([obj isKindOfClass: [NSArray class]]) { [cell setRepresentedObject: obj]; [cell setLeaf: NO]; [cell setStringValue: [NSString stringWithFormat: @"%@ %p", [obj class], obj]]; } else if ([obj isKindOfClass: [NSDictionary class]]) { [cell setRepresentedObject: obj]; [cell setLeaf: NO]; [cell setStringValue: [NSString stringWithFormat: @"%@ %p", [obj class], obj]]; } else { [cell setLeaf: YES]; [cell setStringValue: [obj description]]; [cell setRepresentedObject: nil]; } } else if ([val isKindOfClass: [NSDictionary class]]) { id key = [[val allKeys] objectAtIndex: row]; volatile id it = [(NSDictionary *)val objectForKey: key]; volatile id foo; foo = [it description]; NS_DURING foo = [it propertyList]; it = foo; NS_HANDLER NS_ENDHANDLER [cell setStringValue: [key description]]; [cell setRepresentedObject: it]; } else { [cell setLeaf: YES]; [cell setStringValue: [val description]]; } } } - (id) browser: (NSBrowser *)browser titleOfColumn: (NSInteger)column { id val; NSString *title; if (column == 0) return @"userInfo"; val = [(NSCell *)[browser selectedCellInColumn: column - 1] representedObject]; title = [NSString stringWithFormat: @"%@ %p", [val class], val]; return title; } @end gnustep-gui-0.24.0/Source/GSPDFPrintOperation.m0000664000076500007650000001006112113623024021111 0ustar brains99brains99/* GSPDFPrintOperation.m Controls operations generating PDF output files. Copyright (C) 1996, 2004 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Fred Kiefer Date: November 2000 Started implementation. Author: Chad Hardin Date: June 2004 Modified for printing backend support, split off from NSPrintOperation.m 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import "AppKit/NSPrintInfo.h" #import "AppKit/NSView.h" #import "GNUstepGUI/GSPDFPrintOperation.h" /** Class Description

GSPDFPrintOperation produces PDF files for saving, previewing, etc

*/ @implementation GSPDFPrintOperation - (id) initWithView:(NSView *)aView insideRect:(NSRect)rect toData:(NSMutableData *)data printInfo:(NSPrintInfo*)aPrintInfo { self = [super initWithView: aView insideRect: rect toData: data printInfo: aPrintInfo]; _path = [NSTemporaryDirectory() stringByAppendingPathComponent: @"GSPrint-"]; _path = [_path stringByAppendingString: [[NSProcessInfo processInfo] globallyUniqueString]]; _path = [_path stringByAppendingPathExtension: @"pdf"]; RETAIN(_path); return self; } - (id) initWithView:(NSView *)aView insideRect:(NSRect)rect toPath:(NSString *)path printInfo:(NSPrintInfo*)aPrintInfo { NSMutableData *data = [NSMutableData data]; self = [super initWithView: aView insideRect: rect toData: data printInfo: aPrintInfo]; ASSIGN(_path, path); return self; } - (NSGraphicsContext*)createContext { NSMutableDictionary *info; if (_context) return _context; info = [[self printInfo] dictionary]; // TODO: Instead we should support NSGraphicsContext writing to an // NSMutableData directly. [info setObject: _path forKey: @"NSOutputFile"]; [info setObject: NSGraphicsContextPDFFormat forKey: NSGraphicsContextRepresentationFormatAttributeName]; _context = RETAIN([NSGraphicsContext graphicsContextWithAttributes: info]); return _context; } - (void) _print { // TODO: Copied-and-pasted from GSEPSPrintOperation. Factor out. /* Save this for the view to look at. Seems like there should be a better way to pass it to beginDocument */ [[[self printInfo] dictionary] setObject: [NSValue valueWithRect: _rect] forKey: @"NSPrintSheetBounds"]; [_view beginDocument]; [_view beginPageInRect: _rect atPlacement: NSMakePoint(0,0)]; [_view displayRectIgnoringOpacity: _rect inContext: [self context]]; [_view endPage]; [_view endDocument]; // FIXME: Output comes out up-side-down } - (BOOL)deliverResult { if (_data != nil && _path != nil) { [_data setData: [NSData dataWithContentsOfFile: _path]]; } return YES; } @end gnustep-gui-0.24.0/Source/NSTokenField.m0000664000076500007650000000631211534147002017644 0ustar brains99brains99/** NSTokenField Token field control class for token entry. The default token is ",". Copyright (C) 2008 Free Software Foundation, Inc. Author: Gregory Casamento Date: July 2008 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import #import "AppKit/NSApplication.h" #import "AppKit/NSCursor.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSTokenField.h" #import "AppKit/NSTokenFieldCell.h" #import "AppKit/NSWindow.h" #import "AppKit/NSKeyValueBinding.h" #import "GSBindingHelpers.h" static NSNotificationCenter *nc = nil; /* * Class variables */ static Class usedCellClass; static Class tokenFieldCellClass; @implementation NSTokenField // // Class methods // + (void) initialize { if (self == [NSTokenField class]) { [self setVersion: 1]; tokenFieldCellClass = [NSTokenFieldCell class]; usedCellClass = tokenFieldCellClass; nc = [NSNotificationCenter defaultCenter]; [self exposeBinding: NSEditableBinding]; [self exposeBinding: NSTextColorBinding]; } } - (id) initWithFrame: (NSRect)frame { if((self = [super initWithFrame: frame]) == nil) { return nil; } // initialize... [_cell setTokenStyle: NSDefaultTokenStyle]; [_cell setCompletionDelay: [_cell defaultCompletionDelay]]; [_cell setTokenizingCharacterSet: [_cell defaultTokenizingCharacterSet]]; return self; } /* * Setting the Cell class */ + (Class) cellClass { return usedCellClass; } + (void) setCellClass: (Class)factoryId { usedCellClass = factoryId ? factoryId : tokenFieldCellClass; } // Style... - (NSTokenStyle)tokenStyle { return [_cell tokenStyle]; } - (void)setTokenStyle:(NSTokenStyle)style { [_cell setTokenStyle: style]; } // Completion delay... + (NSTimeInterval)defaultCompletionDelay { return [usedCellClass defaultCompletionDelay]; } - (NSTimeInterval)completionDelay { return [_cell completionDelay]; } - (void)setCompletionDelay:(NSTimeInterval)delay { [_cell setCompletionDelay: delay]; } // Character set... + (NSCharacterSet *)defaultTokenizingCharacterSet { return [usedCellClass defaultTokenizingCharacterSet]; } - (void)setTokenizingCharacterSet:(NSCharacterSet *)characterSet { [_cell setTokenizingCharacterSet: characterSet]; } - (NSCharacterSet *)tokenizingCharacterSet { return [_cell tokenizingCharacterSet]; } @end gnustep-gui-0.24.0/Source/NSSegmentedControl.m0000664000076500007650000000677512107547001021111 0ustar brains99brains99/* NSSegmentedControl.m * * Copyright (C) 2007 Free Software Foundation, Inc. * * Author: Gregory John Casamento * Date: 2007 * * This file is part of GNUstep. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 * USA. */ #import "AppKit/NSControl.h" #import "AppKit/NSEvent.h" #import "AppKit/NSSegmentedControl.h" #import "AppKit/NSSegmentedCell.h" static Class segmentedControlCellClass; @implementation NSSegmentedControl + (void) initialize { if(self == [NSSegmentedControl class]) { [self setVersion: 1]; segmentedControlCellClass = [NSSegmentedCell class]; } } + (Class) cellClass { return segmentedControlCellClass; } // Specifying number of segments... - (void) setSegmentCount: (NSInteger) count { [_cell setSegmentCount: count]; } - (NSInteger) segmentCount { return [_cell segmentCount]; } // Specifying selected segment... - (void) setSelectedSegment: (NSInteger) segment { [_cell setSelectedSegment: segment]; } - (NSInteger) selectedSegment { return [_cell selectedSegment]; } - (void) selectSegmentWithTag: (NSInteger) tag { [_cell selectSegmentWithTag: tag]; } // Working with individual segments... - (void) setWidth: (CGFloat)width forSegment: (NSInteger)segment { [_cell setWidth: width forSegment: segment]; } - (CGFloat) widthForSegment: (NSInteger)segment { return [_cell widthForSegment: segment]; } - (void) setImage: (NSImage *)image forSegment: (NSInteger)segment { [_cell setImage: image forSegment: segment]; } - (NSImage *) imageForSegment: (NSInteger)segment { return [_cell imageForSegment: segment]; } - (void) setLabel: (NSString *)label forSegment: (NSInteger)segment { [_cell setLabel: label forSegment: segment]; } - (NSString *) labelForSegment: (NSInteger)segment { return [_cell labelForSegment: segment]; } - (void) setMenu: (NSMenu *)menu forSegment: (NSInteger)segment { [_cell setMenu: menu forSegment: segment]; } - (NSMenu *) menuForSegment: (NSInteger)segment { return [_cell menuForSegment: segment]; } - (void) setSelected: (BOOL)flag forSegment: (NSInteger)segment { [_cell setSelected: flag forSegment: segment]; } - (BOOL) isSelectedForSegment: (NSInteger)segment { return [_cell isSelectedForSegment: segment]; } - (void) setEnabled: (BOOL)flag forSegment: (NSInteger)segment { [_cell setEnabled: flag forSegment: segment]; } - (BOOL) isEnabledForSegment: (NSInteger)segment { return [_cell isEnabledForSegment: segment]; } - (void) setSegmentStyle: (NSSegmentStyle)style { [_cell setSegmentStyle: style]; } - (NSSegmentStyle) segmentStyle { return [_cell segmentStyle]; } /* - (void) mouseDown: (NSEvent *)event { NSPoint location = [self convertPoint: [event locationInWindow] fromView: nil]; [super mouseDown: event]; [_cell _detectHit: location]; NSLog(@"%@",NSStringFromPoint(location)); } */ @end gnustep-gui-0.24.0/Source/GSTextStorage.m0000664000076500007650000005540312234646776020113 0ustar brains99brains99/* GSTextStorage.m Implementation of concrete subclass of a string class with attributes Copyright (C) 1999 Free Software Foundation, Inc. Based on code by: ANOQ of the sun Written by: Richard Frith-Macdonald Date: July 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Warning - [-initWithString:attributes:] is the designated initialiser, * but it doesn't provide any way to perform the function of the * [-initWithAttributedString:] initialiser. * In order to work youd this, the string argument of the * designated initialiser has been overloaded such that it * is expected to accept an NSAttributedString here instead of * a string. If you create an NSAttributedString subclass, you * must make sure that your implementation of the initialiser * copes with either an NSString or an NSAttributedString. * If it receives an NSAttributedString, it should ignore the * attributes argument and use the values from the string. */ #import #import #import #import #import #import #import #import #import #import #import #import "AppKit/NSTextStorage.h" #import "GSTextStorage.h" #define SANITY_CHECKS 0 static BOOL adding; /* When caching attributes we make a shallow copy of the dictionary cached, * so that it is immutable and safe to cache. * However, we have a potential problem if the objects within the attributes * dictionary are themselves mutable, and something mutates them while they * are in the cache. In this case we could items added while different and * then mutated to have the same contents, so we would not know which of * the equal dictionaries to remove. * The solution is to require dictionaries to be identical for removal. */ static inline BOOL cacheEqual(id A, id B) { if (YES == adding) return [A isEqualToDictionary: B]; else return A == B; } #define GSI_MAP_RETAIN_KEY(M, X) #define GSI_MAP_RELEASE_KEY(M, X) #define GSI_MAP_RETAIN_VAL(M, X) #define GSI_MAP_RELEASE_VAL(M, X) #define GSI_MAP_EQUAL(M, X,Y) cacheEqual((X).obj, (Y).obj) #define GSI_MAP_KTYPES GSUNION_OBJ #define GSI_MAP_VTYPES GSUNION_NSINT #define GSI_MAP_NOCLEAN 1 #include static NSDictionary *blank; static NSLock *attrLock = nil; static __strong GSIMapTable_t attrMap; static SEL lockSel; static SEL unlockSel; static IMP lockImp; static IMP unlockImp; #define ALOCK() if (attrLock != nil) (*lockImp)(attrLock, lockSel) #define AUNLOCK() if (attrLock != nil) (*unlockImp)(attrLock, unlockSel) @interface GSTextStorageProxy : NSProxy { NSString *string; } - (id) _initWithString: (NSString*)s; @end @implementation GSTextStorageProxy static Class NSObjectClass = nil; static Class NSStringClass = nil; + (void) initialize { NSObjectClass = [NSObject class]; NSStringClass = [NSString class]; } - (Class) class { return NSStringClass; } - (void) dealloc { [string release]; [super dealloc]; } - (void) forwardInvocation: (NSInvocation*)anInvocation { SEL aSel = [anInvocation selector]; if (YES == [NSStringClass instancesRespondToSelector: aSel]) { [anInvocation invokeWithTarget: string]; } else { [NSException raise: NSGenericException format: @"NSString(instance) does not recognize %s", aSel ? GSNameFromSelector(aSel) : "(null)"]; } } - (NSUInteger) hash { return [string hash]; } - (id) _initWithString: (NSString*)s { string = [s retain]; return self; } - (BOOL) isEqual: (id)other { return [string isEqual: other]; } - (BOOL) isMemberOfClass: (Class)c { return (c == NSStringClass) ? YES : NO; } - (BOOL) isKindOfClass: (Class)c { return (c == NSStringClass || c == NSObjectClass) ? YES : NO; } - (NSMethodSignature*) methodSignatureForSelector: (SEL)aSelector { NSMethodSignature *sig; if (YES == [NSStringClass instancesRespondToSelector: aSelector]) { sig = [string methodSignatureForSelector: aSelector]; } else { sig = [super methodSignatureForSelector: aSelector]; } return sig; } - (BOOL) respondsToSelector: (SEL)aSelector { if (YES == [NSStringClass instancesRespondToSelector: aSelector]) { return YES; } return [super respondsToSelector: aSelector]; } @end /* * Add a dictionary to the cache - if it was not already there, return * the copy added to the cache, if it was, count it and return retained * object that was there. */ static NSDictionary* cacheAttributes(NSDictionary *attrs) { GSIMapNode node; ALOCK(); adding = YES; node = GSIMapNodeForKey(&attrMap, (GSIMapKey)((id)attrs)); if (node == 0) { /* * Shallow copy of dictionary, without copying objects ... results * in an immutable dictionary that can safely be cached. */ attrs = [[NSDictionary alloc] initWithDictionary: attrs copyItems: NO]; GSIMapAddPair(&attrMap, (GSIMapKey)((id)attrs), (GSIMapVal)(NSUInteger)1); } else { node->value.nsu++; attrs = RETAIN(node->key.obj); } AUNLOCK(); return attrs; } static void unCacheAttributes(NSDictionary *attrs) { GSIMapBucket bucket; ALOCK(); adding = NO; bucket = GSIMapBucketForKey(&attrMap, (GSIMapKey)((id)attrs)); if (bucket != 0) { GSIMapNode node; node = GSIMapNodeForKeyInBucket(&attrMap, bucket, (GSIMapKey)((id)attrs)); if (node != 0) { if (--node->value.nsu == 0) { GSIMapRemoveNodeFromMap(&attrMap, bucket, node); GSIMapFreeNode(&attrMap, node); } } } AUNLOCK(); } @interface GSTextInfo : NSObject { @public unsigned loc; NSDictionary *attrs; } + (GSTextInfo*) newWithZone: (NSZone*)z value: (NSDictionary*)a at: (unsigned)l; @end @implementation GSTextInfo /* * Called to record attributes at a particular location - the given attributes * dictionary must have been produced by 'cacheAttributes()' so that it is * already copied/retained and this method doesn't need to do it. */ + (GSTextInfo*) newWithZone: (NSZone*)z value: (NSDictionary*)a at: (unsigned)l; { GSTextInfo *info = (GSTextInfo*)NSAllocateObject(self, 0, z); info->loc = l; info->attrs = a; return info; } - (Class) classForPortCoder { return [self class]; } - (void) dealloc { [self finalize]; [super dealloc]; } - (NSString*) description { return [NSString stringWithFormat: @"Attributes at %u are - %@", loc, attrs]; } - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding] == NO) { [aCoder encodeValueOfObjCType: @encode(unsigned) at: &loc]; [aCoder encodeValueOfObjCType: @encode(id) at: &attrs]; } } - (void) finalize { unCacheAttributes(attrs); DESTROY(attrs); } - (id) initWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding] == NO) { NSDictionary *a; [aCoder decodeValueOfObjCType: @encode(unsigned) at: &loc]; a = [aCoder decodeObject]; attrs = cacheAttributes(a); } return self; } - (id) replacementObjectForPortCoder: (NSPortCoder*)aCoder { return self; } @end static Class infCls = 0; static SEL infSel; static SEL addSel; static SEL cntSel; static SEL insSel; static SEL oatSel; static SEL remSel; static IMP infImp; static void (*addImp)(); static unsigned (*cntImp)(); static void (*insImp)(); static IMP oatImp; static void (*remImp)(); #define NEWINFO(Z,O,L) ((*infImp)(infCls, infSel, (Z), (O), (L))) #define ADDOBJECT(O) ((*addImp)(_infoArray, addSel, (O))) #define INSOBJECT(O,I) ((*insImp)(_infoArray, insSel, (O), (I))) #define OBJECTAT(I) ((*oatImp)(_infoArray, oatSel, (I))) #define REMOVEAT(I) ((*remImp)(_infoArray, remSel, (I))) static inline NSDictionary *attrDict(GSTextInfo* info) { return info->attrs; } static void _setup() { if (infCls == 0) { NSMutableArray *a; NSDictionary *d; GSIMapInitWithZoneAndCapacity(&attrMap, NSDefaultMallocZone(), 32); infSel = @selector(newWithZone:value:at:); addSel = @selector(addObject:); cntSel = @selector(count); insSel = @selector(insertObject:atIndex:); oatSel = @selector(objectAtIndex:); remSel = @selector(removeObjectAtIndex:); infCls = [GSTextInfo class]; infImp = [infCls methodForSelector: infSel]; a = [NSMutableArray allocWithZone: NSDefaultMallocZone()]; a = [a initWithCapacity: 1]; addImp = (void (*)())[a methodForSelector: addSel]; cntImp = (unsigned (*)())[a methodForSelector: cntSel]; insImp = (void (*)())[a methodForSelector: insSel]; oatImp = [a methodForSelector: oatSel]; remImp = (void (*)())[a methodForSelector: remSel]; RELEASE(a); d = [NSDictionary new]; blank = cacheAttributes(d); RELEASE(d); } } static void _setAttributesFrom( NSAttributedString *attributedString, NSRange aRange, NSMutableArray *_infoArray) { NSZone *z = [_infoArray zone]; NSRange range; NSDictionary *attr; GSTextInfo *info; unsigned loc; /* * remove any old attributes of the string. */ [_infoArray removeAllObjects]; if (aRange.length <= 0) { attr = blank; range = aRange; /* Set to satisfy the loop condition below. */ } else { attr = [attributedString attributesAtIndex: aRange.location effectiveRange: &range]; } attr = cacheAttributes(attr); info = NEWINFO(z, attr, 0); ADDOBJECT(info); RELEASE(info); while ((loc = NSMaxRange(range)) < NSMaxRange(aRange)) { attr = [attributedString attributesAtIndex: loc effectiveRange: &range]; attr = cacheAttributes(attr); info = NEWINFO(z, attr, loc - aRange.location); ADDOBJECT(info); RELEASE(info); } } inline static NSDictionary* _attributesAtIndexEffectiveRange( unsigned int index, NSRange *aRange, unsigned int tmpLength, NSMutableArray *_infoArray, unsigned int *foundIndex) { unsigned low, high, used, cnt, nextLoc; GSTextInfo *found = nil; used = (*cntImp)(_infoArray, cntSel); NSCAssert(used > 0, NSInternalInconsistencyException); high = used - 1; if (index >= tmpLength) { if (index == tmpLength) { found = OBJECTAT(high); if (foundIndex != 0) { *foundIndex = high; } if (aRange != 0) { aRange->location = found->loc; aRange->length = tmpLength - found->loc; } return attrDict(found); } [NSException raise: NSRangeException format: @"index is out of range in function " @"_attributesAtIndexEffectiveRange()"]; } /* * Binary search for efficiency in huge attributed strings */ low = 0; while (low <= high) { cnt = (low + high) / 2; found = OBJECTAT(cnt); if (found->loc > index) { high = cnt - 1; } else { if (cnt >= used - 1) { nextLoc = tmpLength; } else { GSTextInfo *inf = OBJECTAT(cnt + 1); nextLoc = inf->loc; } if (found->loc == index || index < nextLoc) { //Found if (aRange != 0) { aRange->location = found->loc; aRange->length = nextLoc - found->loc; } if (foundIndex != 0) { *foundIndex = cnt; } return attrDict(found); } else { low = cnt + 1; } } } NSCAssert(NO,@"Error in binary search algorithm"); return nil; } @implementation GSTextStorage #if SANITY_CHECKS #define SANITY() [self sanity] #else #define SANITY() #endif /* We always compile in this method so that it is available from * regression test cases. */ - (void) _sanity { GSTextInfo *info; unsigned i; unsigned l = 0; unsigned len = [_textChars length]; unsigned c = (*cntImp)(_infoArray, cntSel); NSAssert(c > 0, NSInternalInconsistencyException); info = OBJECTAT(0); NSAssert(info->loc == 0, NSInternalInconsistencyException); for (i = 1; i < c; i++) { info = OBJECTAT(i); NSAssert(info->loc > l, NSInternalInconsistencyException); NSAssert(info->loc < len, NSInternalInconsistencyException); l = info->loc; } } /* * If we are multi-threaded, we must guard access to the uniquing set. */ + (void) _becomeThreaded: (id)notification { attrLock = [NSLock new]; lockSel = @selector(lock); unlockSel = @selector(unlock); lockImp = [attrLock methodForSelector: lockSel]; unlockImp = [attrLock methodForSelector: unlockSel]; } + (void) initialize { _setup(); if ([NSThread isMultiThreaded]) { [self _becomeThreaded: nil]; } else { [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_becomeThreaded:) name: NSWillBecomeMultiThreadedNotification object: nil]; } } - (id) initWithCoder: (NSCoder*)aCoder { self = [super initWithCoder: aCoder]; if([aCoder allowsKeyedCoding] == NO) { if ([aCoder versionForClassName: @"GSTextStorage"] != (NSInteger)NSNotFound) { NSLog(@"Warning - decoding archive containing obsolete %@ object - please delete/replace this archive", NSStringFromClass([self class])); [aCoder decodeValueOfObjCType: @encode(id) at: &_textChars]; [aCoder decodeValueOfObjCType: @encode(id) at: &_infoArray]; } } return self; } - (id) initWithString: (NSString*)aString attributes: (NSDictionary*)attributes { NSZone *z = [self zone]; self = [super initWithString: aString attributes: attributes]; _infoArray = [[NSMutableArray allocWithZone: z] initWithCapacity: 1]; if (aString != nil && [aString isKindOfClass: [NSAttributedString class]]) { NSAttributedString *as = (NSAttributedString*)aString; aString = [as string]; _setAttributesFrom(as, NSMakeRange(0, [aString length]), _infoArray); } else { GSTextInfo *info; if (attributes == nil) { attributes = blank; } attributes = cacheAttributes(attributes); info = NEWINFO(z, attributes, 0); ADDOBJECT(info); RELEASE(info); } if (aString == nil) _textChars = [[NSMutableString allocWithZone: z] init]; else _textChars = [aString mutableCopyWithZone: z]; return self; } - (NSString*) string { /* NB. This method is SUPPOSED to return a proxy to the mutable string! * This is a performance feature documented ifor OSX. */ if (_textProxy == nil) { _textProxy = [[_textChars immutableProxy] retain]; } return _textProxy; } - (NSDictionary*) attributesAtIndex: (NSUInteger)index effectiveRange: (NSRange*)aRange { unsigned dummy; return _attributesAtIndexEffectiveRange( index, aRange, [_textChars length], _infoArray, &dummy); } /* * Primitive method! Sets attributes and values for a given range of * characters, replacing any previous attributes and values for that * range. * * Sets the attributes for the characters in aRange to attributes. * These new attributes replace any attributes previously associated * with the characters in aRange. Raises an NSRangeException if any * part of aRange lies beyond the end of the receiver's characters. * See also: - addAtributes: range: , - removeAttributes: range: */ - (void) setAttributes: (NSDictionary*)attributes range: (NSRange)range { unsigned tmpLength; unsigned arrayIndex = 0; unsigned arraySize; NSRange effectiveRange = NSMakeRange(0, NSNotFound); NSRange originalRange = range; unsigned afterRangeLoc, beginRangeLoc; NSDictionary *attrs; NSZone *z = [self zone]; GSTextInfo *info; if (range.length == 0) { NSWarnMLog(@"Attempt to set attribute for zero-length range", 0); return; } if (attributes == nil) { attributes = blank; } attributes = cacheAttributes(attributes); SANITY(); tmpLength = [_textChars length]; GS_RANGE_CHECK(range, tmpLength); arraySize = (*cntImp)(_infoArray, cntSel); beginRangeLoc = range.location; afterRangeLoc = NSMaxRange(range); if (afterRangeLoc < tmpLength) { /* * Locate the first range that extends beyond our range. */ attrs = _attributesAtIndexEffectiveRange( afterRangeLoc, &effectiveRange, tmpLength, _infoArray, &arrayIndex); if (attrs == attributes) { /* * The located range has the same attributes as us - so we can * extend our range to include it. */ if (effectiveRange.location < beginRangeLoc) { range.length += beginRangeLoc - effectiveRange.location; range.location = effectiveRange.location; beginRangeLoc = range.location; } if (NSMaxRange(effectiveRange) > afterRangeLoc) { range.length = NSMaxRange(effectiveRange) - range.location; } } else if (effectiveRange.location > beginRangeLoc) { /* * The located range also starts at or after our range. */ info = OBJECTAT(arrayIndex); info->loc = afterRangeLoc; arrayIndex--; } else if (NSMaxRange(effectiveRange) > afterRangeLoc) { /* * The located range starts before our range. * Create a subrange to go from our end to the end of the old range. */ info = NEWINFO(z, cacheAttributes(attrs), afterRangeLoc); arrayIndex++; INSOBJECT(info, arrayIndex); RELEASE(info); arrayIndex--; } } else { arrayIndex = arraySize - 1; } /* * Remove any ranges completely within ours */ while (arrayIndex > 0) { info = OBJECTAT(arrayIndex-1); if (info->loc < beginRangeLoc) break; REMOVEAT(arrayIndex); arrayIndex--; } /* * Use the location/attribute info in the current slot if possible, * otherwise, add a new slot and use that. */ info = OBJECTAT(arrayIndex); if (info->loc >= beginRangeLoc) { info->loc = beginRangeLoc; if (info->attrs == attributes) { unCacheAttributes(attributes); RELEASE(attributes); } else { unCacheAttributes(info->attrs); RELEASE(info->attrs); info->attrs = attributes; } } else if (info->attrs == attributes) { unCacheAttributes(attributes); RELEASE(attributes); } else { arrayIndex++; info = NEWINFO(z, attributes, beginRangeLoc); INSOBJECT(info, arrayIndex); RELEASE(info); } SANITY(); [self edited: NSTextStorageEditedAttributes range: originalRange changeInLength: 0]; } - (void) replaceCharactersInRange: (NSRange)range withString: (NSString*)aString { unsigned tmpLength; unsigned arrayIndex = 0; unsigned arraySize; NSRange effectiveRange = NSMakeRange(0, NSNotFound); GSTextInfo *info; int moveLocations; unsigned start; SANITY(); if (aString == nil) { aString = @""; } tmpLength = [_textChars length]; GS_RANGE_CHECK(range, tmpLength); if (range.location == tmpLength) { /* * Special case - replacing a zero length string at the end * simply appends the new string and attributes are inherited. */ [_textChars appendString: aString]; goto finish; } arraySize = (*cntImp)(_infoArray, cntSel); if (arraySize == 1) { /* * Special case - if the string has only one set of attributes * then the replacement characters will get them too. */ [_textChars replaceCharactersInRange: range withString: aString]; goto finish; } /* * Get the attributes to associate with our replacement string. * Should be those of the first character replaced. * If the range replaced is empty, we use the attributes of the * previous character (if possible). */ if (range.length == 0 && range.location > 0) start = range.location - 1; else start = range.location; _attributesAtIndexEffectiveRange(start, &effectiveRange, tmpLength, _infoArray, &arrayIndex); moveLocations = [aString length] - range.length; arrayIndex++; if (NSMaxRange(effectiveRange) < NSMaxRange(range)) { /* * Remove all range info for ranges enclosed within the one * we are replacing. Adjust the start point of a range that * extends beyond ours. */ info = OBJECTAT(arrayIndex); if (info->loc < NSMaxRange(range)) { unsigned int next = arrayIndex + 1; while (next < arraySize) { GSTextInfo *n = OBJECTAT(next); if (n->loc <= NSMaxRange(range)) { REMOVEAT(arrayIndex); arraySize--; info = n; } else { break; } } } if (NSMaxRange(range) < [_textChars length]) { info->loc = NSMaxRange(range); } else { REMOVEAT(arrayIndex); arraySize--; } } /* * If we are replacing a range with a zero length string and the * range we are using matches the range replaced, then we must * remove it from the array to avoid getting a zero length range. */ if ((moveLocations + range.length) == 0) { _attributesAtIndexEffectiveRange(start, &effectiveRange, tmpLength, _infoArray, &arrayIndex); arrayIndex++; if (effectiveRange.location == range.location && effectiveRange.length == range.length) { arrayIndex--; if (arrayIndex != 0 || arraySize > 1) { REMOVEAT(arrayIndex); arraySize--; } else { NSDictionary *d = blank; info = OBJECTAT(0); unCacheAttributes(info->attrs); DESTROY(info->attrs); d = cacheAttributes(d); info->attrs = d; info->loc = NSMaxRange(range); } } } /* * Now adjust the positions of the ranges following the one we are using. */ while (arrayIndex < arraySize) { info = OBJECTAT(arrayIndex); info->loc += moveLocations; arrayIndex++; } [_textChars replaceCharactersInRange: range withString: aString]; finish: SANITY(); [self edited: NSTextStorageEditedCharacters range: range changeInLength: [aString length] - range.length]; } - (void) dealloc { RELEASE(_textChars); RELEASE(_infoArray); RELEASE(_textProxy); [super dealloc]; } // The superclass implementation is correct but too slow - (NSUInteger) length { return [_textChars length]; } @end gnustep-gui-0.24.0/Source/NSDocumentFrameworkPrivate.h0000664000076500007650000000420111534147002022575 0ustar brains99brains99/* NSDocumentFramworkPrivate.h The private methods of all the classes of the document framework Copyright (C) 1999 Free Software Foundation, Inc. Author: Carl Lindberg Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSDocumentFramworkPrivate #define _GNUstep_H_NSDocumentFramworkPrivate #import "AppKit/NSDocument.h" #import "AppKit/NSDocumentController.h" #import "AppKit/NSWindowController.h" @class NSTimer; @interface NSDocumentController (Private) - (NSArray *)_readableTypesForClass:(Class)documentClass; - (NSArray *)_writableTypesForClass:(Class)documentClass; - (NSString *)_autosaveDirectory: (BOOL)create; - (void)_autosaveDocuments: (NSTimer *)timer; - (BOOL)_reopenAutosavedDocuments; - (void)_recordAutosavedDocument: (NSDocument *)document; @end @interface NSDocumentController (RecentDocumentsMenu) - (NSMenu *) _recentDocumentsMenu; - (void) _setRecentDocumentsMenu: (NSMenu *)menu; - (void) _updateRecentDocumentsMenu; - (IBAction) _openRecentDocument: (id)sender; @end @interface NSDocument (Private) - (void)_removeWindowController:(NSWindowController *)controller; - (NSWindow *)_transferWindowOwnership; - (void)_removeAutosavedContentsFile; @end @interface NSWindowController (Private) - (void)_windowDidLoad; @end #endif // _GNUstep_H_NSDocumentFramworkPrivate gnustep-gui-0.24.0/Source/NSSearchField.m0000664000076500007650000000544111506114062017772 0ustar brains99brains99/* NSSearchField.m Text field control class for text search Copyright (C) 1996 Free Software Foundation, Inc. Author: H. Nikolaus Schaller Date: Dec 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import "AppKit/NSSearchField.h" #import "AppKit/NSSearchFieldCell.h" /* * Class variables */ static Class usedCellClass; @implementation NSSearchField /* * Class methods */ + (void) initialize { if (self == [NSSearchField class]) { [self setVersion: 1]; usedCellClass = [NSSearchFieldCell class]; } } + (Class) cellClass { return usedCellClass; } + (void) setCellClass: (Class)factoryId { usedCellClass = factoryId ? factoryId : [NSSearchFieldCell class]; } - (NSArray *) recentSearches { return [[self cell] recentSearches]; } - (NSString *) recentsAutosaveName { return [[self cell] recentsAutosaveName]; } - (void) setRecentSearches: (NSArray *)searches { [[self cell] setRecentSearches: searches]; } - (void) setRecentsAutosaveName: (NSString *)name { [[self cell] setRecentsAutosaveName: name]; } // // Handling Events // - (void) mouseDown: (NSEvent*)theEvent { [[self cell] trackMouse: theEvent inRect: [self bounds] ofView: self untilMouseUp: YES]; } - (void) delete: (id)sender { // this may need to do more (like send action), but start here... [self setStringValue: @""]; [[self cell] performClick: self]; } // Cocoa only defines these methods on the cell, but nib loading targets the field itself - (void) setSearchMenuTemplate: (NSMenu *)newTemplate { [[self cell] setSearchMenuTemplate: newTemplate]; } - (void) setSendsWholeSearchString: (BOOL)flag { [[self cell] setSendsWholeSearchString: flag]; } - (void) setSendsSearchStringImmediately: (BOOL)flag { [[self cell] setSendsSearchStringImmediately: flag]; } - (void) setMaximumRecents: (NSInteger)max { [[self cell] setMaximumRecents: max]; } @end /* NSSearchField */ gnustep-gui-0.24.0/Source/NSTreeNode.m0000664000076500007650000001252612204466636017345 0ustar brains99brains99/* NSTreeNode.m The tree node class Copyright (C) 2013 Free Software Foundation, Inc. Author: Fred Kiefer Date: 2013 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import @interface NSTreeNode (Private) - (NSMutableArray*) _childNodes; - (void) _setParentNode: (NSTreeNode*)parentNode; @end @implementation NSTreeNode (Private) - (NSMutableArray*) _childNodes { return _childNodes; } - (void) _setParentNode: (NSTreeNode*)parentNode { _parentNode = parentNode; } @end @interface GSTreeNodeArray : NSMutableArray { NSMutableArray *array; NSTreeNode *parent; } @end @implementation GSTreeNodeArray - (id) initForTreeNode: (NSTreeNode*)node { ASSIGN(parent, node); array = [parent _childNodes]; return self; } - (void) dealloc { RELEASE(parent); [super dealloc]; } - (NSUInteger) count { return [array count]; } - (id) objectAtIndex: (NSUInteger)index { return [array objectAtIndex: index]; } - (void) addObject: (id)anObject { [array addObject: anObject]; [(NSTreeNode*)anObject _setParentNode: parent]; } - (void) replaceObjectAtIndex: (NSUInteger)index withObject: (id)anObject { id old = [array objectAtIndex: index]; [(NSTreeNode*)old _setParentNode: nil]; [array replaceObjectAtIndex: index withObject: anObject]; [(NSTreeNode*)anObject _setParentNode: parent]; } - (void) insertObject: anObject atIndex: (NSUInteger)index { [array insertObject: anObject atIndex: index]; [(NSTreeNode*)anObject _setParentNode: parent]; } - (void) removeObjectAtIndex: (NSUInteger)index { id old = [array objectAtIndex: index]; [(NSTreeNode*)old _setParentNode: nil]; [array removeObjectAtIndex: index]; } @end @implementation NSTreeNode + (id) treeNodeWithRepresentedObject: (id)modelObject { NSTreeNode *node = [[NSTreeNode alloc] initWithRepresentedObject: modelObject]; return AUTORELEASE(node); } - (NSArray*) childNodes { return [NSArray arrayWithArray: _childNodes]; } - (NSTreeNode*) descendantNodeAtIndexPath: (NSIndexPath*)path { NSUInteger len = [path length]; NSUInteger i; NSTreeNode *node = self; for (i = 0; i < len; i++) { NSUInteger index = [path indexAtPosition: i]; node = [node->_childNodes objectAtIndex: index]; if (node == nil) { return nil; } } return node; } - (NSIndexPath*) indexPath { if (_parentNode != nil) { NSIndexPath *path; NSUInteger index; index = [_parentNode->_childNodes indexOfObject: self]; path = [_parentNode indexPath]; if (path != nil) { return [path indexPathByAddingIndex: index]; } else { return [NSIndexPath indexPathWithIndex: index]; } } else { return nil; } } - (id) initWithRepresentedObject: (id)repObj { ASSIGN(_representedObject, repObj); _childNodes = [[NSMutableArray alloc] init]; return self; } - (void) dealloc { RELEASE(_representedObject); RELEASE(_childNodes); [super dealloc]; } - (BOOL) isLeaf { return [_childNodes count] == 0; } - (NSMutableArray*) mutableChildNodes { GSTreeNodeArray *nodeArray = [[GSTreeNodeArray alloc] initForTreeNode: self]; return AUTORELEASE(nodeArray); } - (NSTreeNode*) parentNode { return _parentNode; } - (id) representedObject { return _representedObject; } - (void) sortWithSortDescriptors: (NSArray*)sortDescs recursively: (BOOL)flag { // Sort children nodes NSUInteger i; NSUInteger len = [sortDescs count]; NSMutableArray *newSortDescs = [[NSMutableArray alloc] init]; for (i = 0; i < len; i++) { NSSortDescriptor *oldDesc = [sortDescs objectAtIndex: i]; NSString * newKey = [@"representedObject." stringByAppendingString: [oldDesc key]]; NSSortDescriptor *newDesc = [[NSSortDescriptor alloc] initWithKey: newKey ascending: [oldDesc ascending] selector: [oldDesc selector]]; [newSortDescs addObject: newDesc]; RELEASE(newDesc); } [_childNodes sortUsingDescriptors: newSortDescs]; RELEASE(newSortDescs); if (flag) { // sort recursive NSUInteger count = [_childNodes count]; for (i = 0; i < count; i++) { [[_childNodes objectAtIndex: i] sortWithSortDescriptors: sortDescs recursively: YES]; } } } @end gnustep-gui-0.24.0/Source/NSSpeechSynthesizer.m0000664000076500007650000001573711544112551021314 0ustar brains99brains99/** NSSpeechSynthesizer abstract base class for speech synthesis Copyright (C) 2009 Free Software Foundation, Inc. Author: Gregory Casamento Date: Mar 2009 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import #import #import "AppKit/NSWorkspace.h" #import "AppKit/NSSpeechSynthesizer.h" // Keys for properties... NSString *NSVoiceIdentifier = @"NSVoiceIdentifier"; NSString *NSVoiceName = @"NSVoiceName"; NSString *NSVoiceAge = @"NSVoiceAge"; NSString *NSVoiceGender = @"NSVoiceGender"; NSString *NSVoiceDemoText = @"NSVoiceDemoText"; NSString *NSVoiceLanguage = @"NSVoiceLanguage"; NSString *NSVoiceLocaleIdentifier = @"NSVoiceLocaleIdentifier"; NSString *NSVoiceSupportedCharacters = @"NSVoiceSupportedCharacters"; NSString *NSVoiceIndividuallySpokenCharacters = @"NSVoiceIndividuallySpokenCharacters"; // Values for gender NSString *NSVoiceGenderNeuter = @"NSVoiceGenderNeuter"; NSString *NSVoiceGenderMale = @"NSVoiceGenderMale"; NSString *NSVoiceGenderFemale = @"NSVoiceGenderFemale"; // values for speech mode NSString *NSSpeechModeText = @"NSSpeechModeText"; NSString *NSSpeechModePhoneme = @"NSSpeechModePhoneme"; NSString *NSSpeechModeNormal = @"NSSpeechModeNormal"; NSString *NSSpeechModeLiteral = @"NSSpeechModeLiteral"; // values for speech status... NSString *NSSpeechStatusOutputBusy = @"NSSpeechStatusOutputBusy"; NSString *NSSpeechStatusOutputPaused = @"NSSpeechStatusOutputPaused"; NSString *NSSpeechStatusNumberOfCharactersLeft = @"NSSpeechStatusNumberOfCharactersLeft"; NSString *NSSpeechStatusPhonemeCode = @"NSSpeechStatusPhonemeCode"; // values for error NSString *NSSpeechErrorCount = @"NSSpeechErrorCount"; NSString *NSSpeechErrorOldestCode = @"NSSpeechErrorOldestCode"; NSString *NSSpeechErrorOldestCharacterOffset = @"NSSpeechErrorOldestCharacterOffset"; NSString *NSSpeechErrorNewestCode = @"NSSpeechErrorNewestCode"; NSString *NSSpeechErrorNewestCharacterOffset = @"NSSpeechErrorNewestCharacterOffset"; // values for info NSString *NSSpeechSynthesizerInfoIdentifier = @"NSSpeechSynthesizerInfoIdentifier"; NSString *NSSpeechSynthesizerInfoVersion = @"NSSpeechSynthesizerInfoVersion"; // values for command delimiter NSString *NSSpeechCommandPrefix = @"NSSpeechCommandPrefix"; NSString *NSSpeechCommandSuffix = @"NSSpeechCommandSuffix"; // values for dictionaries. NSString *NSSpeechDictionaryLanguage = @"NSSpeechDictionaryLanguage"; NSString *NSSpeechDictionaryModificationDate = @"NSSpeechDictionaryModificationDate"; NSString *NSSpeechDictionaryPronunciations = @"NSSpeechDictionaryPronunciations"; NSString *NSSpeechDictionaryAbreviations = @"NSSpeechDictionaryAbreviations"; NSString *NSSpeechDictionaryEntrySpelling = @"NSSpeechDictionaryEntrySpelling"; NSString *NSSpeechDictionaryEntryPhonemes = @"NSSpeechDictionaryEntryPhonemes"; // Speech daemon static id server; // Flag indicating whether we should wait for the daemon to finish launching. static BOOL serverLaunchTested; // Class of the NSSpeechSynthesizer static Class NSSpeechSynthesizerClass; // Informal protocol used for the server. @interface NSObject (GSSpeechServer) - (NSSpeechSynthesizer*)newSynthesizer; @end @implementation NSSpeechSynthesizer - (id) initWithVoice: (NSString *)voice { return self; } + (void)initialize { NSSpeechSynthesizerClass = [NSSpeechSynthesizer class]; server = [[NSConnection rootProxyForConnectionWithRegisteredName: @"GSSpeechServer" host: nil] retain]; if (nil == server) { NSWorkspace *ws = [NSWorkspace sharedWorkspace]; [ws launchApplication: @"GSSpeechServer" showIcon: NO autolaunch: NO]; } } + (BOOL)isAnyApplicationSpeaking { return [server isSpeaking]; } // Never really allocate one of these. + (id)allocWithZone: (NSZone*)aZone { if (self == NSSpeechSynthesizerClass) { if (nil == server && !serverLaunchTested) { unsigned int i=0; // Wait for up to five seconds for the server to launch, then give up. for (i=0 ; i<50 ; i++) { server = [[NSConnection rootProxyForConnectionWithRegisteredName: @"GSSpeechServer" host: nil] retain]; if (nil != server) { break; } [NSThread sleepForTimeInterval: 0.1]; } // Set a flag so we don't bother waiting for the speech server to // launch the next time if it didn't work this time. serverLaunchTested = YES; } // If there is no server, this will return nil return [server newSynthesizer]; } return [super allocWithZone: aZone]; } // configuring speech synthesis - (BOOL) usesFeebackWindow { return NO; } - (void) setUsesFeebackWindow: (BOOL)flag { } - (NSString *) voice { return nil; } - (void) setVoice: (NSString *)voice { } - (float) rate { return 0; } - (void) setRate: (float)rate { } - (float) volume { return 0; } - (void) setVolume: (float)volume { } - (void) addSpeechDictionary: (NSDictionary *)speechDictionary { } - (id) objectForProperty: (NSString *)property error: (NSError **)error { return nil; } - (id) setObject: (id) object forProperty: (NSString *)property error: (NSError **)error { return nil; } - (id) delegate { return nil; } - (void) setDelegate: (id)delegate { } // Getting information... + (NSArray *) availableVoices { return [NSArray array]; } + (NSDictionary *) attributesForVoice: (NSString *)voice { return [NSDictionary dictionary]; } + (NSString *) defaultVoice { return nil; } // Synthesizing.. - (BOOL) isSpeaking { return NO; } - (BOOL) startSpeakingString: (NSString *)text { return NO; } - (BOOL) startSpeakingString: (NSString *)text toURL: (NSURL *)url { return NO; } - (void) stopSpeaking { } - (void) stopSpeakingAtBoundary: (NSSpeechBoundary)boundary { } - (void) pauseSpeakingAtBoundary: (NSSpeechBoundary)boundary { } - (void) continueSpeaking { } - (NSString *) phonemesFromText: (NSString *)text { return nil; } @end gnustep-gui-0.24.0/Source/NSButtonImageSource.m0000664000076500007650000000523111534147002021216 0ustar brains99brains99/* NSButtonImageSource.m Copyright (C) 2006 Free Software Foundation, Inc. Author: Richard Frith-Macdonald Date: 2006 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import "NSButtonImageSource.h" @implementation NSButtonImageSource NSMutableDictionary *sources = nil; + (id) buttonImageSourceWithName: (NSString*)name { NSButtonImageSource *source; source = [sources objectForKey: name]; if (source == nil) { source = [self alloc]; source->imageName = [name copy]; source->images = [NSMutableDictionary new]; [sources setObject: source forKey: sources->imageName]; RELEASE(source); } return source; } + (void) initialize { if (sources == nil) { sources = [NSMutableDictionary new]; } } - (id) copyWithZone: (NSZone*)zone { return RETAIN(self); } - (void) dealloc { RELEASE(images); RELEASE(imageName); [super dealloc]; } - (void) encodeWithCoder: (NSCoder *)coder { if ([coder allowsKeyedCoding]) { [coder encodeObject: imageName forKey: @"NSImageName"]; } else { [NSException raise: NSInvalidArgumentException format: @"Can't encode %@ with %@.", NSStringFromClass([self class]), NSStringFromClass([coder class])]; } } - (id) imageForState: (struct NSButtonState)state { } - (id) initWithCoder: (NSCoder *)coder { if ([coder allowsKeyedCoding]) { NSString *name = [coder decodeObjectForKey: @"NSImageName"]; ASSIGN(self, [[self class] buttonImageSourceWithName: name]); } else { NSString *className = NSStringFromClass([self class]); RELEASE(self); [NSException raise: NSInvalidArgumentException format: @"Can't decode %@ with %@.", className, NSStringFromClass([coder class])]; } return self; } @end gnustep-gui-0.24.0/Source/NSView.m0000664000076500007650000037555012165225114016551 0ustar brains99brains99/** NSView The view class which encapsulates all drawing functionality Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Ovidiu Predescu Date: 1997 Author: Felipe A. Rodriguez Date: August 1998 Author: Richard Frith-Macdonald Date: January 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #include #include #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import "AppKit/NSAffineTransform.h" #import "AppKit/NSApplication.h" #import "AppKit/NSBezierPath.h" #import "AppKit/NSBitmapImageRep.h" #import "AppKit/NSCursor.h" #import "AppKit/NSDocumentController.h" #import "AppKit/NSDocument.h" #import "AppKit/NSClipView.h" #import "AppKit/NSFont.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSKeyValueBinding.h" #import "AppKit/NSMenu.h" #import "AppKit/NSPasteboard.h" #import "AppKit/NSPrintInfo.h" #import "AppKit/NSPrintOperation.h" #import "AppKit/NSScrollView.h" #import "AppKit/NSView.h" #import "AppKit/NSWindow.h" #import "AppKit/NSWorkspace.h" #import "AppKit/PSOperators.h" #import "GNUstepGUI/GSDisplayServer.h" #import "GNUstepGUI/GSTrackingRect.h" #import "GNUstepGUI/GSNibLoading.h" #import "GSToolTips.h" #import "GSBindingHelpers.h" #import "GSGuiPrivate.h" #import "NSViewPrivate.h" /* * We need a fast array that can store objects without retain/release ... */ #define GSI_ARRAY_TYPES GSUNION_OBJ #define GSI_ARRAY_NO_RELEASE 1 #define GSI_ARRAY_NO_RETAIN 1 #ifdef GSIArray #undef GSIArray #endif #include #define nKV(O) ((GSIArray)(O->_nextKeyView)) #define pKV(O) ((GSIArray)(O->_previousKeyView)) /* Variable tells this view and subviews that we're printing. Not really a class variable because we want it visible to subviews also */ NSView *viewIsPrinting = nil; /** NSView

NSView is an abstract class which provides facilities for drawing in a window and receiving events. It is the superclass of many of the visual elements of the GUI.

In order to display itself, a view must be placed in a window (represented by an NSWindow object). Within the window is a hierarchy of NSViews, headed by the window's content view. Every other view in a window is a descendant of this view.

Subclasses can override -drawRect: in order to implement their appearance. Other methods of NSView and NSResponder can also be overridden to handle user generated events.

*/ @implementation NSView /* * Class variables */ static Class rectClass; static Class viewClass; static NSAffineTransform *flip = nil; static NSNotificationCenter *nc = nil; static SEL preSel; static SEL invalidateSel; static void (*preImp)(NSAffineTransform*, SEL, NSAffineTransform*); static void (*invalidateImp)(NSView*, SEL); /* * Stuff to maintain a map table so we know what views are * registered for drag and drop - we don't store the info in * the view directly 'cot it would take up a pointer in each * view and the vast majority of views wouldn't use it. * Types are not registered/unregistered often enough for the * performance of this mechanism to be an issue. */ static NSMapTable *typesMap = 0; static NSLock *typesLock = nil; /* * This is the only external interface to the drag types info. */ NSArray* GSGetDragTypes(NSView *obj) { NSArray *t; [typesLock lock]; t = (NSArray*)NSMapGet(typesMap, (void*)(gsaddr)obj); [typesLock unlock]; return t; } static void GSRemoveDragTypes(NSView* obj) { [typesLock lock]; NSMapRemove(typesMap, (void*)(gsaddr)obj); [typesLock unlock]; } static NSArray* GSSetDragTypes(NSView* obj, NSArray *types) { NSUInteger count = [types count]; NSString *strings[count]; NSArray *t; NSUInteger i; /* * Make a new array with copies of the type strings so we don't get * them mutated by someone else. */ [types getObjects: strings]; for (i = 0; i < count; i++) { strings[i] = [strings[i] copy]; } t = [NSArray arrayWithObjects: strings count: count]; for (i = 0; i < count; i++) { RELEASE(strings[i]); } /* * Store it. */ [typesLock lock]; NSMapInsert(typesMap, (void*)(gsaddr)obj, (void*)(gsaddr)t); [typesLock unlock]; return t; } /* * Private methods. */ /* * The [-_invalidateCoordinates] method marks the coordinate mapping * matrices (matrixFromWindow and _matrixToWindow) and the cached visible * rectangle as invalid. It recursively invalidates the coordinates for * all subviews as well. * This method must be called whenever the size, shape or position of * the view is changed in any way. */ - (void) _invalidateCoordinates { if (_coordinates_valid == YES) { NSUInteger count; _coordinates_valid = NO; if (_rFlags.valid_rects != 0) { [_window invalidateCursorRectsForView: self]; } if (_rFlags.has_subviews) { count = [_sub_views count]; if (count > 0) { NSView* array[count]; NSUInteger i; [_sub_views getObjects: array]; for (i = 0; i < count; i++) { NSView *sub = array[i]; if (sub->_coordinates_valid == YES) { (*invalidateImp)(sub, invalidateSel); } } } } [self renewGState]; } } /* * The [-_matrixFromWindow] method returns a matrix that can be used to * map coordinates in the windows coordinate system to coordinates in the * views coordinate system. It rebuilds the mapping matrices and * visible rectangle cache if necessary. * All coordinate transformations use this matrix. */ - (NSAffineTransform*) _matrixFromWindow { [self _rebuildCoordinates]; return _matrixFromWindow; } /* * The [-_matrixToWindow] method returns a matrix that can be used to * map coordinates in the views coordinate system to coordinates in the * windows coordinate system. It rebuilds the mapping matrices and * visible rectangle cache if necessary. * All coordinate transformations use this matrix. */ - (NSAffineTransform*) _matrixToWindow { [self _rebuildCoordinates]; return _matrixToWindow; } /* * The [-_rebuildCoordinates] method rebuilds the coordinate mapping * matrices (matrixFromWindow and _matrixToWindow) and the cached visible * rectangle if they have been invalidated. */ - (void) _rebuildCoordinates { BOOL isFlipped = [self isFlipped]; BOOL lastFlipped = _rFlags.flipped_view; if ((_coordinates_valid == NO) || (isFlipped != lastFlipped)) { _coordinates_valid = YES; _rFlags.flipped_view = isFlipped; if (!_window) { _visibleRect = NSZeroRect; [_matrixToWindow makeIdentityMatrix]; [_matrixFromWindow makeIdentityMatrix]; } else { NSRect superviewsVisibleRect; BOOL superFlipped; NSAffineTransform *pMatrix; NSAffineTransformStruct ts; if (_super_view != nil) { superFlipped = [_super_view isFlipped]; pMatrix = [_super_view _matrixToWindow]; } else { superFlipped = NO; pMatrix = [NSAffineTransform transform]; } ts = [pMatrix transformStruct]; /* prepend translation */ ts.tX = NSMinX(_frame) * ts.m11 + NSMinY(_frame) * ts.m21 + ts.tX; ts.tY = NSMinX(_frame) * ts.m12 + NSMinY(_frame) * ts.m22 + ts.tY; [_matrixToWindow setTransformStruct: ts]; /* prepend rotation */ if (_frameMatrix != nil) { (*preImp)(_matrixToWindow, preSel, _frameMatrix); } if (isFlipped != superFlipped) { /* * The flipping process must result in a coordinate system that * exactly overlays the original. To do that, we must translate * the origin by the height of the view. */ ts = [flip transformStruct]; ts.tY = _frame.size.height; [flip setTransformStruct: ts]; (*preImp)(_matrixToWindow, preSel, flip); } if (_boundsMatrix != nil) { (*preImp)(_matrixToWindow, preSel, _boundsMatrix); } ts = [_matrixToWindow transformStruct]; [_matrixFromWindow setTransformStruct: ts]; [_matrixFromWindow invert]; if (_super_view != nil) { superviewsVisibleRect = [self convertRect: [_super_view visibleRect] fromView: _super_view]; _visibleRect = NSIntersectionRect(superviewsVisibleRect, _bounds); } else { _visibleRect = _bounds; } } } } - (void) _viewDidMoveToWindow { [self viewDidMoveToWindow]; if (_rFlags.has_subviews) { NSUInteger count = [_sub_views count]; if (count > 0) { NSUInteger i; NSView *array[count]; [_sub_views getObjects: array]; for (i = 0; i < count; ++i) { [array[i] _viewDidMoveToWindow]; } } } } - (void) _viewWillMoveToWindow: (NSWindow*)newWindow { BOOL old_allocate_gstate; [self viewWillMoveToWindow: newWindow]; if (_coordinates_valid) { (*invalidateImp)(self, invalidateSel); } if (_rFlags.has_currects != 0) { [self discardCursorRects]; } if (newWindow == _window) { return; } // This call also reset _allocate_gstate, so we have // to store this value and set it again. // This way we keep the logic in one place. old_allocate_gstate = _allocate_gstate; [self releaseGState]; _allocate_gstate = old_allocate_gstate; if (_rFlags.has_draginfo) { NSArray *t = GSGetDragTypes(self); if (_window != nil) { [GSDisplayServer removeDragTypes: t fromWindow: _window]; if ([_window autorecalculatesKeyViewLoop]) { [_window recalculateKeyViewLoop]; } } if (newWindow != nil) { [GSDisplayServer addDragTypes: t toWindow: newWindow]; if ([newWindow autorecalculatesKeyViewLoop]) { [newWindow recalculateKeyViewLoop]; } } } _window = newWindow; if (_rFlags.has_subviews) { NSUInteger count = [_sub_views count]; if (count > 0) { NSUInteger i; NSView *array[count]; [_sub_views getObjects: array]; for (i = 0; i < count; ++i) { [array[i] _viewWillMoveToWindow: newWindow]; } } } } - (void) _viewWillMoveToSuperview: (NSView*)newSuper { [self viewWillMoveToSuperview: newSuper]; _super_view = newSuper; } /* * Extend in super view covered by the frame of a view. * When the frame is rotated, this is different from the frame. */ - (NSRect) _frameExtend { NSRect frame = _frame; if (_frameMatrix != nil) { NSRect r; r.origin = NSZeroPoint; r.size = frame.size; [_frameMatrix boundingRectFor: r result: &r]; frame = NSOffsetRect(r, NSMinX(frame), NSMinY(frame)); } return frame; } - (NSString*) _subtreeDescriptionWithPrefix: (NSString*)prefix { NSMutableString *desc = [[NSMutableString alloc] init]; NSEnumerator *e; NSView *v; [desc appendFormat: @"%@%@\n", prefix, [self description], nil]; prefix = [prefix stringByAppendingString: @" "]; e = [_sub_views objectEnumerator]; while ((v = (NSView*)[e nextObject]) != nil) { [desc appendString: [v _subtreeDescriptionWithPrefix: prefix]]; } return AUTORELEASE(desc); } /* * Unofficial Cocoa method for debugging a view hierarchy. */ - (NSString*) _subtreeDescription { return [self _subtreeDescriptionWithPrefix: @""]; } - (NSString*) _flagDescription { return @""; } - (NSString*) _resizeDescription { return [NSString stringWithFormat: @"h=%c%c%c v=%c%c%c", (_autoresizingMask & NSViewMinXMargin) ? '&' : '-', (_autoresizingMask & NSViewWidthSizable) ? '&' : '-', (_autoresizingMask & NSViewMaxXMargin) ? '&' : '-', (_autoresizingMask & NSViewMinYMargin) ? '&' : '-', (_autoresizingMask & NSViewHeightSizable) ? '&' : '-', (_autoresizingMask & NSViewMaxYMargin) ? '&' : '-', nil]; } - (NSString*) description { return [NSString stringWithFormat: @"%@ %@ %@ f=%@ b=%@", [self _flagDescription], [self _resizeDescription], [super description], NSStringFromRect(_frame), NSStringFromRect(_bounds), nil]; } /* * Class methods */ + (void) initialize { if (self == [NSView class]) { Class matrixClass = [NSAffineTransform class]; NSAffineTransformStruct ats = { 1, 0, 0, -1, 0, 1 }; typesMap = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks, NSObjectMapValueCallBacks, 0); typesLock = [NSLock new]; preSel = @selector(prependTransform:); invalidateSel = @selector(_invalidateCoordinates); preImp = (void (*)(NSAffineTransform*, SEL, NSAffineTransform*)) [matrixClass instanceMethodForSelector: preSel]; invalidateImp = (void (*)(NSView*, SEL)) [self instanceMethodForSelector: invalidateSel]; flip = [matrixClass new]; [flip setTransformStruct: ats]; nc = [NSNotificationCenter defaultCenter]; viewClass = [NSView class]; rectClass = [GSTrackingRect class]; NSDebugLLog(@"NSView", @"Initialize NSView class\n"); [self setVersion: 1]; // expose bindings [self exposeBinding: NSToolTipBinding]; [self exposeBinding: NSHiddenBinding]; } } /** Return the view at the top of graphics contexts stack or nil if none is focused. */ + (NSView*) focusView { return [GSCurrentContext() focusView]; } /* * Instance methods */ - (id) init { return [self initWithFrame: NSZeroRect]; } - (id) initWithFrame: (NSRect)frameRect { self = [super init]; if (!self) return self; if (frameRect.size.width < 0) { NSWarnMLog(@"given negative width", 0); frameRect.size.width = 0; } if (frameRect.size.height < 0) { NSWarnMLog(@"given negative height", 0); frameRect.size.height = 0; } _frame = frameRect; // Set frame rectangle _bounds.origin = NSZeroPoint; // Set bounds rectangle _bounds.size = _frame.size; // _frameMatrix = [NSAffineTransform new]; // Map fromsuperview to frame // _boundsMatrix = [NSAffineTransform new]; // Map from superview to bounds _matrixToWindow = [NSAffineTransform new]; // Map to window coordinates _matrixFromWindow = [NSAffineTransform new]; // Map from window coordinates _sub_views = [NSMutableArray new]; _tracking_rects = [NSMutableArray new]; _cursor_rects = [NSMutableArray new]; // Some values are already set by initialisation //_super_view = nil; //_window = nil; //_is_rotated_from_base = NO; //_is_rotated_or_scaled_from_base = NO; _rFlags.needs_display = YES; _post_bounds_changes = YES; _post_frame_changes = YES; _autoresizes_subviews = YES; _autoresizingMask = NSViewNotSizable; //_coordinates_valid = NO; //_nextKeyView = 0; //_previousKeyView = 0; return self; } - (void) dealloc { NSView *tmp; NSUInteger count; // Remove all key value bindings for this view. [GSKeyValueBinding unbindAllForObject: self]; /* * Remove self from view chain. Try to mimic MacOS-X behavior ... * We send setNextKeyView: messages to all view for which we are the * next key view, setting their next key view to nil. * * First we do the obvious stuff using the standard methods. */ [self setNextKeyView: nil]; tmp = [self previousKeyView]; if ([tmp nextKeyView] == self) [tmp setNextKeyView: nil]; /* * Now, we locate any remaining cases where a view has us as its next * view, and ask the view to change that. */ if (pKV(self) != 0) { count = GSIArrayCount(pKV(self)); while (count-- > 0) { tmp = GSIArrayItemAtIndex(pKV(self), count).obj; if ([tmp nextKeyView] == self) { [tmp setNextKeyView: nil]; } } } /* * Now we clean up the previous view array, in case subclasses have * overridden the default -setNextKeyView: method and broken things. * We also relase the memory we used. */ if (pKV(self) != 0) { count = GSIArrayCount(pKV(self)); while (count-- > 0) { tmp = GSIArrayItemAtIndex(pKV(self), count).obj; if (tmp != nil && nKV(tmp) != 0) { NSUInteger otherCount = GSIArrayCount(nKV(tmp)); while (otherCount-- > 1) { if (GSIArrayItemAtIndex(nKV(tmp), otherCount).obj == self) { GSIArrayRemoveItemAtIndex(nKV(tmp), otherCount); } } if (GSIArrayItemAtIndex(nKV(tmp), 0).obj == self) { GSIArraySetItemAtIndex(nKV(tmp), (GSIArrayItem)nil, 0); } } } GSIArrayClear(pKV(self)); NSZoneFree(NSDefaultMallocZone(), pKV(self)); _previousKeyView = 0; } /* * Now we clean up all views which have us as their previous view. * We also release the memory we used. */ if (nKV(self) != 0) { count = GSIArrayCount(nKV(self)); while (count-- > 0) { tmp = GSIArrayItemAtIndex(nKV(self), count).obj; if (tmp != nil && pKV(tmp) != 0) { NSUInteger otherCount = GSIArrayCount(pKV(tmp)); while (otherCount-- > 1) { if (GSIArrayItemAtIndex(pKV(tmp), otherCount).obj == self) { GSIArrayRemoveItemAtIndex(pKV(tmp), otherCount); } } if (GSIArrayItemAtIndex(pKV(tmp), 0).obj == self) { GSIArraySetItemAtIndex(pKV(tmp), (GSIArrayItem)nil, 0); } } } GSIArrayClear(nKV(self)); NSZoneFree(NSDefaultMallocZone(), nKV(self)); _nextKeyView = 0; } /* * Now remove our subviews, AFTER cleaning up the view chain, in case * any of our subviews were in the chain. */ while ([_sub_views count] > 0) { [[_sub_views lastObject] removeFromSuperviewWithoutNeedingDisplay]; } RELEASE(_matrixToWindow); RELEASE(_matrixFromWindow); TEST_RELEASE(_frameMatrix); TEST_RELEASE(_boundsMatrix); TEST_RELEASE(_sub_views); if (_rFlags.has_tooltips != 0) { [GSToolTips removeTipsForView: self]; } if (_rFlags.has_currects != 0) { [self discardCursorRects]; // Handle release of cursors } TEST_RELEASE(_cursor_rects); TEST_RELEASE(_tracking_rects); [self unregisterDraggedTypes]; [self releaseGState]; [super dealloc]; } /** * Adds aView as a subview of the receiver. */ - (void) addSubview: (NSView*)aView { [self addSubview: aView positioned: NSWindowAbove relativeTo: nil]; } - (void) addSubview: (NSView*)aView positioned: (NSWindowOrderingMode)place relativeTo: (NSView*)otherView { NSUInteger index; if (aView == nil) { return; } if ([self isDescendantOf: aView]) { [NSException raise: NSInvalidArgumentException format: @"addSubview:positioned:relativeTo: creates a " @"loop in the views tree!"]; } if (aView == otherView) return; RETAIN(aView); [aView removeFromSuperview]; // Do this after the removeFromSuperview, as aView may already // be a subview and the index could change. if (otherView == nil) { index = NSNotFound; } else { index = [_sub_views indexOfObjectIdenticalTo: otherView]; } if (index == NSNotFound) { if (place == NSWindowBelow) index = 0; else index = [_sub_views count]; } else if (place != NSWindowBelow) { index += 1; } [aView _viewWillMoveToWindow: _window]; [aView _viewWillMoveToSuperview: self]; [aView setNextResponder: self]; [_sub_views insertObject: aView atIndex: index]; _rFlags.has_subviews = 1; [aView resetCursorRects]; [aView setNeedsDisplay: YES]; [aView _viewDidMoveToWindow]; [aView viewDidMoveToSuperview]; [self didAddSubview: aView]; RELEASE(aView); } /** * Returns self if aView is the receiver or aView is a subview of the receiver, * the ancestor view shared by aView and the receiver if any, or * aView if it is an ancestor of the receiver, otherwise returns nil. */ - (NSView*) ancestorSharedWithView: (NSView*)aView { if (self == aView) return self; if ([self isDescendantOf: aView]) return aView; if ([aView isDescendantOf: self]) return self; /* * If neither are descendants of each other and either does not have a * superview then they cannot have a common ancestor */ if (!_super_view) return nil; if (![aView superview]) return nil; /* Find the common ancestor of superviews */ return [_super_view ancestorSharedWithView: [aView superview]]; } /** * Returns YES if aView is an ancestor of the receiver. */ - (BOOL) isDescendantOf: (NSView*)aView { if (aView == self) return YES; if (!_super_view) return NO; if (_super_view == aView) return YES; return [_super_view isDescendantOf: aView]; } - (NSView*) opaqueAncestor { NSView *next = _super_view; NSView *current = self; while (next != nil) { if ([current isOpaque] == YES) { break; } current = next; next = current->_super_view; } return current; } /** * Removes the receiver from its superviews list of subviews. */ - (void) removeFromSuperviewWithoutNeedingDisplay { if (_super_view != nil) { [_super_view removeSubview: self]; } } /**

Removes the receiver from its superviews list of subviews and marks the rectangle that the reciever occupied in the superview as needing redisplay.

This is dangerous to use during display, since it alters the rectangles needing display. In this case, you can use the -removeFromSuperviewWithoutNeedingDisplay method instead.

*/ - (void) removeFromSuperview { if (_super_view != nil) { [_super_view setNeedsDisplayInRect: _frame]; [self removeFromSuperviewWithoutNeedingDisplay]; } } /**

Removes aSubview from the receivers list of subviews and from the responder chain.

Also invokes -viewWillMoveToWindow: on aView with a nil argument, to handle removal of aView (and recursively, its children) from its window - performing tidyup by invalidating cursor rects etc.

*/ - (void) removeSubview: (NSView*)aView { id view; /* * This must be first because it invokes -resignFirstResponder:, * which assumes the view is still in the view hierarchy */ for (view = [_window firstResponder]; view != nil && [view respondsToSelector: @selector(superview)]; view = [view superview]) { if (view == aView) { [_window makeFirstResponder: _window]; break; } } [self willRemoveSubview: aView]; aView->_super_view = nil; [aView _viewWillMoveToWindow: nil]; [aView _viewWillMoveToSuperview: nil]; [aView setNextResponder: nil]; RETAIN(aView); [_sub_views removeObjectIdenticalTo: aView]; [aView setNeedsDisplay: NO]; [aView _viewDidMoveToWindow]; [aView viewDidMoveToSuperview]; RELEASE(aView); if ([_sub_views count] == 0) { _rFlags.has_subviews = 0; } } /** * Removes oldView, which should be a subview of the receiver, from the * receiver and places newView in its place. If newView is nil, just * removes oldView. If oldView is nil, just adds newView. */ - (void) replaceSubview: (NSView*)oldView with: (NSView*)newView { if (newView == oldView) { return; } /* * NB. we implement the replacement in full rather than calling addSubview: * since classes like NSBox override these methods but expect to be able to * call [super replaceSubview:with:] safely. */ if (oldView == nil) { /* * Strictly speaking, the docs say that if 'oldView' is not a subview * of the receiver then we do nothing - but here we add newView anyway. * So a replacement with no oldView is an addition. */ RETAIN(newView); [newView removeFromSuperview]; [newView _viewWillMoveToWindow: _window]; [newView _viewWillMoveToSuperview: self]; [newView setNextResponder: self]; [_sub_views addObject: newView]; _rFlags.has_subviews = 1; [newView resetCursorRects]; [newView setNeedsDisplay: YES]; [newView _viewDidMoveToWindow]; [newView viewDidMoveToSuperview]; [self didAddSubview: newView]; RELEASE(newView); } else if ([_sub_views indexOfObjectIdenticalTo: oldView] != NSNotFound) { if (newView == nil) { /* * If there is no new view to add - we just remove the old one. * So a replacement with no newView is a removal. */ [oldView removeFromSuperview]; } else { NSUInteger index; /* * Ok - the standard case - we remove the newView from wherever it * was (which may have been in this view), locate the position of * the oldView (which may have changed due to the removal of the * newView), remove the oldView, and insert the newView in it's * place. */ RETAIN(newView); [newView removeFromSuperview]; index = [_sub_views indexOfObjectIdenticalTo: oldView]; [oldView removeFromSuperview]; [newView _viewWillMoveToWindow: _window]; [newView _viewWillMoveToSuperview: self]; [newView setNextResponder: self]; [_sub_views insertObject: newView atIndex: index]; _rFlags.has_subviews = 1; [newView resetCursorRects]; [newView setNeedsDisplay: YES]; [newView _viewDidMoveToWindow]; [newView viewDidMoveToSuperview]; [self didAddSubview: newView]; RELEASE(newView); } } } - (void) setSubviews: (NSArray *)newSubviews { NSEnumerator *en; NSView *aView; NSMutableArray *uniqNew = [NSMutableArray array]; if (nil == newSubviews) { [NSException raise: NSInvalidArgumentException format: @"Setting nil as new subviews."]; } // Use a copy as we remove from the subviews array en = [[NSArray arrayWithArray: _sub_views] objectEnumerator]; while ((aView = [en nextObject])) { if (NO == [newSubviews containsObject: aView]) { [aView removeFromSuperview]; } } en = [newSubviews objectEnumerator]; while ((aView = [en nextObject])) { id supersub = [aView superview]; if (supersub != nil && supersub != self) { [NSException raise: NSInvalidArgumentException format: @"Superviews of new subviews must be either nil or receiver."]; } if ([uniqNew containsObject: aView]) { [NSException raise: NSInvalidArgumentException format: @"Duplicated new subviews."]; } if (NO == [_sub_views containsObject: aView]) { [self addSubview: aView]; } [uniqNew addObject: aView]; } ASSIGN(_sub_views, uniqNew); // The order of the subviews may have changed [self setNeedsDisplay: YES]; } - (void) sortSubviewsUsingFunction: (NSComparisonResult (*)(id ,id ,void*))compare context: (void*)context { [_sub_views sortUsingFunction: compare context: context]; } /** * Notifies the receiver that its superview is being changed to newSuper. */ - (void) viewWillMoveToSuperview: (NSView*)newSuper { } /** * Notifies the receiver that it will now be a view of newWindow. * Note, this method is also used when removing a view from a window * (in which case, newWindow is nil) to let all the subviews know * that they have also been removed from the window. */ - (void) viewWillMoveToWindow: (NSWindow*)newWindow { } - (void) didAddSubview: (NSView *)subview {} - (void) viewDidMoveToSuperview {} - (void) viewDidMoveToWindow {} - (void) willRemoveSubview: (NSView *)subview {} static NSSize _computeScale(NSSize fs, NSSize bs) { NSSize scale; if (bs.width == 0) { if (fs.width == 0) scale.width = 1; else scale.width = FLT_MAX; } else { scale.width = fs.width / bs.width; } if (bs.height == 0) { if (fs.height == 0) scale.height = 1; else scale.height = FLT_MAX; } else { scale.height = fs.height / bs.height; } return scale; } - (void) _setFrameAndClearAutoresizingError: (NSRect)frameRect { _frame = frameRect; _autoresizingFrameError = NSZeroRect; } - (void) setFrame: (NSRect)frameRect { BOOL changedOrigin = NO; BOOL changedSize = NO; NSSize old_size = _frame.size; if (frameRect.size.width < 0) { NSWarnMLog(@"given negative width", 0); frameRect.size.width = 0; } if (frameRect.size.height < 0) { NSWarnMLog(@"given negative height", 0); frameRect.size.height = 0; } if (NSEqualPoints(_frame.origin, frameRect.origin) == NO) { changedOrigin = YES; } if (NSEqualSizes(_frame.size, frameRect.size) == NO) { changedSize = YES; } if (changedSize == YES || changedOrigin == YES) { [self _setFrameAndClearAutoresizingError: frameRect]; if (changedSize == YES) { if (_is_rotated_or_scaled_from_base == YES) { NSAffineTransform *matrix; NSRect frame = _frame; frame.origin = NSMakePoint(0, 0); matrix = [_boundsMatrix copy]; [matrix invert]; [matrix boundingRectFor: frame result: &_bounds]; RELEASE(matrix); } else { _bounds.size = frameRect.size; } } if (_coordinates_valid) { (*invalidateImp)(self, invalidateSel); } [self resetCursorRects]; [self resizeSubviewsWithOldSize: old_size]; if (_post_frame_changes) { [nc postNotificationName: NSViewFrameDidChangeNotification object: self]; } } } - (void) setFrameOrigin: (NSPoint)newOrigin { if (NSEqualPoints(_frame.origin, newOrigin) == NO) { NSRect newFrame = _frame; newFrame.origin = newOrigin; if (_coordinates_valid) { (*invalidateImp)(self, invalidateSel); } [self _setFrameAndClearAutoresizingError: newFrame]; [self resetCursorRects]; if (_post_frame_changes) { [nc postNotificationName: NSViewFrameDidChangeNotification object: self]; } } } - (void) setFrameSize: (NSSize)newSize { NSRect newFrame = _frame; if (newSize.width < 0) { NSWarnMLog(@"given negative width", 0); newSize.width = 0; } if (newSize.height < 0) { NSWarnMLog(@"given negative height", 0); newSize.height = 0; } if (NSEqualSizes(_frame.size, newSize) == NO) { NSSize old_size = _frame.size; if (_is_rotated_or_scaled_from_base) { if (_boundsMatrix == nil) { CGFloat sx = _bounds.size.width / _frame.size.width; CGFloat sy = _bounds.size.height / _frame.size.height; newFrame.size = newSize; [self _setFrameAndClearAutoresizingError: newFrame]; _bounds.size.width = _frame.size.width * sx; _bounds.size.height = _frame.size.height * sy; } else { NSAffineTransform *matrix; NSRect frame; newFrame.size = newSize; [self _setFrameAndClearAutoresizingError: newFrame]; frame = _frame; frame.origin = NSMakePoint(0, 0); matrix = [_boundsMatrix copy]; [matrix invert]; [matrix boundingRectFor: frame result: &_bounds]; RELEASE(matrix); } } else { newFrame.size = _bounds.size = newSize; [self _setFrameAndClearAutoresizingError: newFrame]; } if (_coordinates_valid) { (*invalidateImp)(self, invalidateSel); } [self resetCursorRects]; [self resizeSubviewsWithOldSize: old_size]; if (_post_frame_changes) { [nc postNotificationName: NSViewFrameDidChangeNotification object: self]; } } } - (void) setFrameRotation: (CGFloat)angle { CGFloat oldAngle = [self frameRotation]; if (oldAngle != angle) { /* no frame matrix, create one since it is needed for rotation */ if (_frameMatrix == nil) { // Map from superview to frame _frameMatrix = [NSAffineTransform new]; } [_frameMatrix rotateByDegrees: angle - oldAngle]; _is_rotated_from_base = _is_rotated_or_scaled_from_base = YES; if (_coordinates_valid) { (*invalidateImp)(self, invalidateSel); } [self resetCursorRects]; if (_post_frame_changes) { [nc postNotificationName: NSViewFrameDidChangeNotification object: self]; } } } - (BOOL) isRotatedFromBase { if (_is_rotated_from_base) { return YES; } else if (_super_view) { return [_super_view isRotatedFromBase]; } else { return NO; } } - (BOOL) isRotatedOrScaledFromBase { if (_is_rotated_or_scaled_from_base) { return YES; } else if (_super_view) { return [_super_view isRotatedOrScaledFromBase]; } else { return NO; } } - (void) setBounds: (NSRect)aRect { NSDebugLLog(@"NSView", @"setBounds %@", NSStringFromRect(aRect)); if (aRect.size.width < 0) { NSWarnMLog(@"given negative width", 0); aRect.size.width = 0; } if (aRect.size.height < 0) { NSWarnMLog(@"given negative height", 0); aRect.size.height = 0; } if (_is_rotated_from_base || (NSEqualRects(_bounds, aRect) == NO)) { NSAffineTransform *matrix; NSPoint oldOrigin; NSSize scale; if (_boundsMatrix == nil) { _boundsMatrix = [NSAffineTransform new]; } // Adjust scale scale = _computeScale(_frame.size, aRect.size); if (scale.width != 1 || scale.height != 1) { _is_rotated_or_scaled_from_base = YES; } [_boundsMatrix scaleTo: scale.width : scale.height]; { matrix = [_boundsMatrix copy]; [matrix invert]; oldOrigin = [matrix transformPoint: NSMakePoint(0, 0)]; RELEASE(matrix); } [_boundsMatrix translateXBy: oldOrigin.x - aRect.origin.x yBy: oldOrigin.y - aRect.origin.y]; if (!_is_rotated_from_base) { // Adjust bounds _bounds = aRect; } else { // Adjust bounds NSRect frame = _frame; frame.origin = NSMakePoint(0, 0); matrix = [_boundsMatrix copy]; [matrix invert]; [matrix boundingRectFor: frame result: &_bounds]; RELEASE(matrix); } if (_coordinates_valid) { (*invalidateImp)(self, invalidateSel); } [self resetCursorRects]; if (_post_bounds_changes) { [nc postNotificationName: NSViewBoundsDidChangeNotification object: self]; } } } - (void) setBoundsOrigin: (NSPoint)newOrigin { NSPoint oldOrigin; if (_boundsMatrix == nil) { oldOrigin = NSMakePoint(NSMinX(_bounds), NSMinY(_bounds)); } else { NSAffineTransform *matrix = [_boundsMatrix copy]; [matrix invert]; oldOrigin = [matrix transformPoint: NSMakePoint(0, 0)]; RELEASE(matrix); } [self translateOriginToPoint: NSMakePoint(oldOrigin.x - newOrigin.x, oldOrigin.y - newOrigin.y)]; } - (void) setBoundsSize: (NSSize)newSize { NSSize scale; NSDebugLLog(@"NSView", @"%@ setBoundsSize: %@", self, NSStringFromSize(newSize)); if (newSize.width < 0) { NSWarnMLog(@"given negative width", 0); newSize.width = 0; } if (newSize.height < 0) { NSWarnMLog(@"given negative height", 0); newSize.height = 0; } scale = _computeScale(_frame.size, newSize); if (scale.width != 1 || scale.height != 1) { _is_rotated_or_scaled_from_base = YES; } if (_boundsMatrix == nil) { _boundsMatrix = [NSAffineTransform new]; } [_boundsMatrix scaleTo: scale.width : scale.height]; if (!_is_rotated_from_base) { scale = _computeScale(_bounds.size, newSize); _bounds.origin.x = _bounds.origin.x / scale.width; _bounds.origin.y = _bounds.origin.y / scale.height; _bounds.size = newSize; } else { NSAffineTransform *matrix; NSRect frame = _frame; frame.origin = NSMakePoint(0, 0); matrix = [_boundsMatrix copy]; [matrix invert]; [matrix boundingRectFor: frame result: &_bounds]; RELEASE(matrix); } if (_coordinates_valid) { (*invalidateImp)(self, invalidateSel); } [self resetCursorRects]; if (_post_bounds_changes) { [nc postNotificationName: NSViewBoundsDidChangeNotification object: self]; } } - (void) setBoundsRotation: (CGFloat)angle { [self rotateByAngle: angle - [self boundsRotation]]; } - (void) translateOriginToPoint: (NSPoint)point { NSDebugLLog(@"NSView", @"%@ translateOriginToPoint: %@", self, NSStringFromPoint(point)); if (NSEqualPoints(NSZeroPoint, point) == NO) { if (_boundsMatrix == nil) { _boundsMatrix = [NSAffineTransform new]; } [_boundsMatrix translateXBy: point.x yBy: point.y]; // Adjust bounds _bounds.origin.x -= point.x; _bounds.origin.y -= point.y; if (_coordinates_valid) { (*invalidateImp)(self, invalidateSel); } [self resetCursorRects]; if (_post_bounds_changes) { [nc postNotificationName: NSViewBoundsDidChangeNotification object: self]; } } } - (void) scaleUnitSquareToSize: (NSSize)newSize { if (newSize.width != 1.0 || newSize.height != 1.0) { if (newSize.width < 0) { NSWarnMLog(@"given negative width", 0); newSize.width = 0; } if (newSize.height < 0) { NSWarnMLog(@"given negative height", 0); newSize.height = 0; } if (_boundsMatrix == nil) { _boundsMatrix = [NSAffineTransform new]; } [_boundsMatrix scaleXBy: newSize.width yBy: newSize.height]; // Adjust bounds _bounds.origin.x = _bounds.origin.x / newSize.width; _bounds.origin.y = _bounds.origin.y / newSize.height; _bounds.size.width = _bounds.size.width / newSize.width; _bounds.size.height = _bounds.size.height / newSize.height; _is_rotated_or_scaled_from_base = YES; if (_coordinates_valid) { (*invalidateImp)(self, invalidateSel); } [self resetCursorRects]; if (_post_bounds_changes) { [nc postNotificationName: NSViewBoundsDidChangeNotification object: self]; } } } - (void) rotateByAngle: (CGFloat)angle { if (angle != 0.0) { NSAffineTransform *matrix; NSRect frame = _frame; frame.origin = NSMakePoint(0, 0); if (_boundsMatrix == nil) { _boundsMatrix = [NSAffineTransform new]; } [_boundsMatrix rotateByDegrees: angle]; // Adjust bounds matrix = [_boundsMatrix copy]; [matrix invert]; [matrix boundingRectFor: frame result: &_bounds]; RELEASE(matrix); _is_rotated_from_base = _is_rotated_or_scaled_from_base = YES; if (_coordinates_valid) { (*invalidateImp)(self, invalidateSel); } [self resetCursorRects]; if (_post_bounds_changes) { [nc postNotificationName: NSViewBoundsDidChangeNotification object: self]; } } } - (NSRect) centerScanRect: (NSRect)aRect { NSAffineTransform *matrix; /* * Hmm - we assume that the windows coordinate system is centered on the * pixels of the screen - this may not be correct of course. * Plus - this is all pretty meaningless is we are not in a window! */ matrix = [self _matrixToWindow]; aRect.origin = [matrix transformPoint: aRect.origin]; aRect.size = [matrix transformSize: aRect.size]; if (aRect.size.height < 0.0) { aRect.size.height = -aRect.size.height; } aRect.origin.x = GSRoundTowardsInfinity(aRect.origin.x); aRect.origin.y = GSRoundTowardsInfinity(aRect.origin.y); aRect.size.width = GSRoundTowardsInfinity(aRect.size.width); aRect.size.height = GSRoundTowardsInfinity(aRect.size.height); matrix = [self _matrixFromWindow]; aRect.origin = [matrix transformPoint: aRect.origin]; aRect.size = [matrix transformSize: aRect.size]; if (aRect.size.height < 0.0) { aRect.size.height = -aRect.size.height; } return aRect; } - (NSPoint) convertPoint: (NSPoint)aPoint fromView: (NSView*)aView { NSPoint inBase; if (aView == self) { return aPoint; } if (aView != nil) { NSAssert(_window == [aView window], NSInvalidArgumentException); inBase = [[aView _matrixToWindow] transformPoint: aPoint]; } else { inBase = aPoint; } return [[self _matrixFromWindow] transformPoint: inBase]; } - (NSPoint) convertPoint: (NSPoint)aPoint toView: (NSView*)aView { NSPoint inBase; if (aView == self) return aPoint; inBase = [[self _matrixToWindow] transformPoint: aPoint]; if (aView != nil) { NSAssert(_window == [aView window], NSInvalidArgumentException); return [[aView _matrixFromWindow] transformPoint: inBase]; } else { return inBase; } } /* Helper for -convertRect:fromView: and -convertRect:toView:. */ static NSRect convert_rect_using_matrices(NSRect aRect, NSAffineTransform *matrix1, NSAffineTransform *matrix2) { NSRect r; NSPoint p[4], min, max; int i; for (i = 0; i < 4; i++) p[i] = aRect.origin; p[1].x += aRect.size.width; p[2].y += aRect.size.height; p[3].x += aRect.size.width; p[3].y += aRect.size.height; for (i = 0; i < 4; i++) p[i] = [matrix1 transformPoint: p[i]]; min = max = p[0] = [matrix2 transformPoint: p[0]]; for (i = 1; i < 4; i++) { p[i] = [matrix2 transformPoint: p[i]]; min.x = MIN(min.x, p[i].x); min.y = MIN(min.y, p[i].y); max.x = MAX(max.x, p[i].x); max.y = MAX(max.y, p[i].y); } r.origin = min; r.size.width = max.x - min.x; r.size.height = max.y - min.y; return r; } /** * Converts aRect from the coordinate system of aView to the coordinate * system of the receiver, ie. returns the bounding rectangle in the * receiver of aRect in aView. *
* aView and the receiver must be in the same window. If aView is nil, * converts from the receiver's window's coordinate system. */ - (NSRect) convertRect: (NSRect)aRect fromView: (NSView*)aView { NSAffineTransform *matrix1, *matrix2; if (aView == self || _window == nil || (aView != nil && [aView window] == nil)) { return aRect; } if (aView != nil) { NSAssert(_window == [aView window], NSInvalidArgumentException); matrix1 = [aView _matrixToWindow]; } else { matrix1 = [NSAffineTransform transform]; } matrix2 = [self _matrixFromWindow]; return convert_rect_using_matrices(aRect, matrix1, matrix2); } /** * Converts aRect from the coordinate system of the receiver to the * coordinate system of aView, ie. returns the bounding rectangle in * aView of aRect in the receiver. *
* aView and the receiver must be in the same window. If aView is nil, * converts to the receiver's window's coordinate system. */ - (NSRect) convertRect: (NSRect)aRect toView: (NSView*)aView { NSAffineTransform *matrix1, *matrix2; if (aView == self || _window == nil || (aView != nil && [aView window] == nil)) { return aRect; } matrix1 = [self _matrixToWindow]; if (aView != nil) { NSAssert(_window == [aView window], NSInvalidArgumentException); matrix2 = [aView _matrixFromWindow]; } else { matrix2 = [NSAffineTransform transform]; } return convert_rect_using_matrices(aRect, matrix1, matrix2); } - (NSSize) convertSize: (NSSize)aSize fromView: (NSView*)aView { NSSize inBase; NSSize inSelf; if (aView) { NSAssert(_window == [aView window], NSInvalidArgumentException); inBase = [[aView _matrixToWindow] transformSize: aSize]; if (inBase.height < 0.0) { inBase.height = -inBase.height; } } else { inBase = aSize; } inSelf = [[self _matrixFromWindow] transformSize: inBase]; if (inSelf.height < 0.0) { inSelf.height = -inSelf.height; } return inSelf; } - (NSSize) convertSize: (NSSize)aSize toView: (NSView*)aView { NSSize inBase = [[self _matrixToWindow] transformSize: aSize]; if (inBase.height < 0.0) { inBase.height = -inBase.height; } if (aView) { NSSize inOther; NSAssert(_window == [aView window], NSInvalidArgumentException); inOther = [[aView _matrixFromWindow] transformSize: inBase]; if (inOther.height < 0.0) { inOther.height = -inOther.height; } return inOther; } else { return inBase; } } - (NSPoint) convertPointFromBase: (NSPoint)aPoint { return [self convertPoint: aPoint fromView: nil]; } - (NSPoint) convertPointToBase: (NSPoint)aPoint { return [self convertPoint: aPoint toView: nil]; } - (NSRect) convertRectFromBase: (NSRect)aRect { return [self convertRect: aRect fromView: nil]; } - (NSRect) convertRectToBase: (NSRect)aRect { return [self convertRect: aRect toView: nil]; } - (NSSize) convertSizeFromBase: (NSSize)aSize { return [self convertSize: aSize fromView: nil]; } - (NSSize) convertSizeToBase: (NSSize)aSize { return [self convertSize: aSize toView: nil]; } /** * Sets whether the receiver should post NSViewFrameDidChangeNotification * when its frame changed. */ - (void) setPostsFrameChangedNotifications: (BOOL)flag { _post_frame_changes = flag; } /** * Sets whether the receiver should post NSViewBoundsDidChangeNotification * when its bound changed. */ - (void) setPostsBoundsChangedNotifications: (BOOL)flag { _post_bounds_changes = flag; } /* * resize subviews only if we are supposed to and we have never been rotated */ - (void) resizeSubviewsWithOldSize: (NSSize)oldSize { if (_rFlags.has_subviews) { id e, o; if (_autoresizes_subviews == NO || _is_rotated_from_base == YES) return; e = [_sub_views objectEnumerator]; o = [e nextObject]; while (o) { [o resizeWithOldSuperviewSize: oldSize]; o = [e nextObject]; } } } static void autoresize(CGFloat oldContainerSize, CGFloat newContainerSize, CGFloat *contentPositionInOut, CGFloat *contentSizeInOut, BOOL minMarginFlexible, BOOL sizeFlexible, BOOL maxMarginFlexible) { const CGFloat change = newContainerSize - oldContainerSize; const CGFloat oldContentSize = *contentSizeInOut; const CGFloat oldContentPosition = *contentPositionInOut; CGFloat flexibleSpace = 0.0; // See how much flexible space we have to distrube the change over if (sizeFlexible) flexibleSpace += oldContentSize; if (minMarginFlexible) flexibleSpace += oldContentPosition; if (maxMarginFlexible) flexibleSpace += oldContainerSize - oldContentPosition - oldContentSize; if (flexibleSpace <= 0.0) { /** * In this code path there is no flexible space so we divide * the available space equally among the flexible portions of the view */ int subdivisions = (sizeFlexible ? 1 : 0) + (minMarginFlexible ? 1 : 0) + (maxMarginFlexible ? 1 : 0); if (subdivisions > 0) { const CGFloat changePerOption = change / subdivisions; if (sizeFlexible) { *contentSizeInOut += changePerOption; } if (minMarginFlexible) { *contentPositionInOut += changePerOption; } } } else { /** * In this code path we distribute the change proportionately * over the flexible spaces */ const CGFloat changePerPoint = change / flexibleSpace; if (sizeFlexible) { *contentSizeInOut += changePerPoint * oldContentSize; } if (minMarginFlexible) { *contentPositionInOut += changePerPoint * oldContentPosition; } } } - (void) resizeWithOldSuperviewSize: (NSSize)oldSize { NSSize superViewFrameSize; NSRect newFrame = _frame; NSRect newFrameRounded; if (_autoresizingMask == NSViewNotSizable) return; if (!NSEqualRects(NSZeroRect, _autoresizingFrameError)) { newFrame.origin.x -= _autoresizingFrameError.origin.x; newFrame.origin.y -= _autoresizingFrameError.origin.y; newFrame.size.width -= _autoresizingFrameError.size.width; newFrame.size.height -= _autoresizingFrameError.size.height; } superViewFrameSize = NSMakeSize(0,0); if (_super_view) superViewFrameSize = [_super_view frame].size; autoresize(oldSize.width, superViewFrameSize.width, &newFrame.origin.x, &newFrame.size.width, (_autoresizingMask & NSViewMinXMargin), (_autoresizingMask & NSViewWidthSizable), (_autoresizingMask & NSViewMaxXMargin)); { const BOOL flipped = (_super_view && [_super_view isFlipped]); autoresize(oldSize.height, superViewFrameSize.height, &newFrame.origin.y, &newFrame.size.height, flipped ? (_autoresizingMask & NSViewMaxYMargin) : (_autoresizingMask & NSViewMinYMargin), (_autoresizingMask & NSViewHeightSizable), flipped ? (_autoresizingMask & NSViewMinYMargin) : (_autoresizingMask & NSViewMaxYMargin)); } newFrameRounded = newFrame; /** * Perform rounding to pixel-align the frame if we are not rotated */ if (![self isRotatedFromBase] && [self superview] != nil) { newFrameRounded = [[self superview] centerScanRect: newFrameRounded]; } [self setFrame: newFrameRounded]; _autoresizingFrameError.origin.x = (newFrameRounded.origin.x - newFrame.origin.x); _autoresizingFrameError.origin.y = (newFrameRounded.origin.y - newFrame.origin.y); _autoresizingFrameError.size.width = (newFrameRounded.size.width - newFrame.size.width); _autoresizingFrameError.size.height = (newFrameRounded.size.height - newFrame.size.height); } - (void) _lockFocusInContext: (NSGraphicsContext *)ctxt inRect: (NSRect)rect { NSRect wrect; NSInteger window_gstate = 0; if (viewIsPrinting == nil) { NSAssert(_window != nil, NSInternalInconsistencyException); /* Check for deferred window */ if ((window_gstate = [_window gState]) == 0) { return; } } if (ctxt == nil) { if (viewIsPrinting != nil) { NSPrintOperation *printOp = [NSPrintOperation currentOperation]; ctxt = [printOp context]; } else { ctxt = [_window graphicsContext]; } } // Set current context [NSGraphicsContext saveGraphicsState]; [NSGraphicsContext setCurrentContext: ctxt]; [ctxt lockFocusView: self inRect: rect]; wrect = [self convertRect: rect toView: nil]; NSDebugLLog(@"NSView", @"-lockFocusInRect: %@\n" @"\t for view %@ in window %p (%@)\n" @"\t frame %@, flip %d", NSStringFromRect(wrect), self, _window, NSStringFromRect([_window frame]), NSStringFromRect(_frame), [self isFlipped]); if (viewIsPrinting == nil) { [_window->_rectsBeingDrawn addObject: [NSValue valueWithRect: wrect]]; } /* Make sure we don't modify superview's gstate */ DPSgsave(ctxt); if (viewIsPrinting != nil) { if (viewIsPrinting == self) { /* Make sure coordinates are valid, then fake that we don't have a superview so we get printed correctly */ [self _matrixToWindow]; [_matrixToWindow makeIdentityMatrix]; } else { [[self _matrixToWindow] concat]; } /* Allow subclases to make other modifications */ [self setUpGState]; } else { if (_gstate && !_renew_gstate) { DPSsetgstate(ctxt, _gstate); DPSgsave(ctxt); } else { // This only works, when the context comes from the window DPSsetgstate(ctxt, window_gstate); DPSgsave(ctxt); [[self _matrixToWindow] concat]; /* Allow subclases to make other modifications */ [self setUpGState]; _renew_gstate = NO; if (_allocate_gstate) { if (_gstate) { GSReplaceGState(ctxt, _gstate); } else { _gstate = GSDefineGState(ctxt); } /* Balance the previous gsave and install our own gstate */ DPSgrestore(ctxt); DPSsetgstate(ctxt, _gstate); DPSgsave(ctxt); } } } if ([self wantsDefaultClipping]) { /* * Clip to the visible rectangle - which will never be greater * than the bounds of the view. This prevents drawing outside * our bounds. */ // Normally the second test is not needed, it can differ only // when the view is loaded from a NIB file. if (_is_rotated_from_base && (_boundsMatrix != nil)) { // When the view is rotated, we clip to the frame. NSAffineTransform *matrix; NSRect frame = _frame; NSBezierPath *bp; frame.origin = NSMakePoint(0, 0); bp = [NSBezierPath bezierPathWithRect: frame]; matrix = [_boundsMatrix copy]; [matrix invert]; [bp transformUsingAffineTransform: matrix]; [bp addClip]; RELEASE(matrix); } else { // FIXME: Should we use _bounds or visibleRect here? DPSrectclip(ctxt, NSMinX(rect), NSMinY(rect), NSWidth(rect), NSHeight(rect)); } } /* Tell backends that images are drawn upside down. Obsolete? This is needed when a backend is able to handle full image transformation. */ GSWSetViewIsFlipped(ctxt, [self isFlipped]); } - (void) _setIgnoresBacking: (BOOL) flag { _rFlags.ignores_backing = flag; } - (BOOL) _ignoresBacking { return _rFlags.ignores_backing; } - (void) unlockFocusNeedsFlush: (BOOL)flush { NSGraphicsContext *ctxt = GSCurrentContext(); NSDebugLLog(@"NSView_details", @"-unlockFocusNeedsFlush: %i for view %@\n", flush, self); if (viewIsPrinting == nil) { NSAssert(_window != nil, NSInternalInconsistencyException); /* Check for deferred window */ if ([_window gState] == 0) return; /* Restore our original gstate */ DPSgrestore(ctxt); } /* Restore state of nesting lockFocus */ DPSgrestore(ctxt); if (!_allocate_gstate) _gstate = 0; if (viewIsPrinting == nil) { NSRect rect; if (flush && !_rFlags.ignores_backing) { rect = [[_window->_rectsBeingDrawn lastObject] rectValue]; _window->_rectNeedingFlush = NSUnionRect(_window->_rectNeedingFlush, rect); _window->_f.needs_flush = YES; } [_window->_rectsBeingDrawn removeLastObject]; } [ctxt unlockFocusView: self needsFlush: YES ]; [NSGraphicsContext restoreGraphicsState]; } /**

Tell the view to maintain a private gstate object which encapsulates all the information about drawing, such as coordinate transforms, line widths, etc. If you do not invoke this method, a gstate object is constructed each time the view is lockFocused. Allocating a private gstate may improve the performance of views that are focused a lot and have a lot of customized drawing parameters.

View subclasses should override the setUpGstate method to set these custom parameters.

*/ - (void) allocateGState { _allocate_gstate = YES; _renew_gstate = YES; } /** Frees the gstate object, if there is one. */ - (void) releaseGState { if (_allocate_gstate && _gstate && _window && ([_window graphicsContext] != nil)) { GSUndefineGState([_window graphicsContext], _gstate); } _gstate = 0; _allocate_gstate = NO; } /** Returns an identifier that represents the view's gstate object, which is used to encapsulate drawing information about the view. Most of the time a gstate object is created from scratch when the view is focused, so if the view is not currently focused or allocateGState has not been called, then this method will return 0. FIXME: The above is what the OpenStep and Cocoa specification say, but gState is 0 unless allocateGState has been called. */ - (NSInteger) gState { if (_allocate_gstate && (!_gstate || _renew_gstate)) { // Set the gstate by locking and unlocking focus. [self lockFocus]; [self unlockFocusNeedsFlush: NO]; } return _gstate; } /** Invalidates the view's gstate object so it will be set up again using setUpGState the next time the view is focused. */ - (void) renewGState { _renew_gstate = YES; /* Note that the next time we lock focus, we'll realloc a gstate (if _allocate_gstate). This seems to make sense, and also allows us to call this method each time we invalidate the coordinates */ } /* Overridden by subclasses to setup custom gstate */ - (void) setUpGState { } - (void) lockFocusInRect: (NSRect)rect { [self _lockFocusInContext: nil inRect: rect]; } - (void) lockFocus { [self lockFocusInRect: [self visibleRect]]; } - (void) unlockFocus { [self unlockFocusNeedsFlush: YES]; } - (BOOL) lockFocusIfCanDraw { return [self lockFocusIfCanDrawInContext: nil]; } - (BOOL) lockFocusIfCanDrawInContext: (NSGraphicsContext *)context { if ([self canDraw]) { [self _lockFocusInContext: context inRect: [self visibleRect]]; return YES; } else { return NO; } } - (BOOL) canDraw { if (((viewIsPrinting != nil) && [self isDescendantOf: viewIsPrinting]) || ((_window != nil) && ([_window windowNumber] != 0) && ![self isHiddenOrHasHiddenAncestor])) { return YES; } else { return NO; } } /* * The following display* methods work based on these invariants: * - When a view is marked as needing display, all views above it * in the hierarchy are marked as well. * - When a view has an invalid rectangle, all views above it up * to the next opaque view also include this invalid rectangle. * * After drawing an area in a view give, subviews a chance to draw * there too. * When drawing a non-opaque subview we need to make sure any area * we draw in has been drawn by the opaque superview as well. * * When drawing the invalid area of a view, we need to make sure * that invalid areas in opaque subviews get drawn as well. These * areas will not be included in the invalid area of the view. * * IfNeeded means we only draw if the view is marked as needing display * and will only draw in the _invalidRect of this view and that of all * the opaque subviews. For non-opaque subviews we need to draw where * ever a superview has already drawn. * * InRect means we will only draw in this rectangle. If non is given the * visibleRect gets used. * * IgnoringOpacity means we start drawing at the current view. Otherwise * we go up to the next opaque view. * */ - (void) display { [self displayRect: [self visibleRect]]; } - (void) displayIfNeeded { if (_rFlags.needs_display == YES) { [self displayIfNeededInRect: [self visibleRect]]; } } - (void) displayIfNeededIgnoringOpacity { if (_rFlags.needs_display == YES) { [self displayIfNeededInRectIgnoringOpacity: [self visibleRect]]; } } - (void) displayIfNeededInRect: (NSRect)aRect { if (_rFlags.needs_display == YES) { if ([self isOpaque] == YES) { [self displayIfNeededInRectIgnoringOpacity: aRect]; } else { NSView *firstOpaque = [self opaqueAncestor]; aRect = [firstOpaque convertRect: aRect fromView: self]; [firstOpaque displayIfNeededInRectIgnoringOpacity: aRect]; } } } - (void) displayIfNeededInRectIgnoringOpacity: (NSRect)aRect { if (_rFlags.needs_display == YES) { NSRect rect; /* * Restrict the drawing of self onto the invalid rectangle. */ rect = NSIntersectionRect(aRect, _invalidRect); [self displayRectIgnoringOpacity: rect]; /* * If we still need display after displaying the invalid rectangle, * this means that some subviews still need to display. * For opaque subviews their invalid rectangle may even overlap the * original aRect. * Display any subview that need display. */ if (_rFlags.needs_display == YES) { NSEnumerator *enumerator = [_sub_views objectEnumerator]; NSView *subview; BOOL subviewNeedsDisplay = NO; while ((subview = [enumerator nextObject]) != nil) { if (subview->_rFlags.needs_display) { NSRect subviewFrame = [subview _frameExtend]; NSRect isect; isect = NSIntersectionRect(aRect, subviewFrame); if (NSIsEmptyRect(isect) == NO) { isect = [subview convertRect: isect fromView: self]; [subview displayIfNeededInRectIgnoringOpacity: isect]; } if (subview->_rFlags.needs_display) { subviewNeedsDisplay = YES; } } } /* * Make sure our needs_display flag matches that of the subviews. * Only set to NO when there is no _invalidRect. */ if (NSIsEmptyRect(_invalidRect)) { _rFlags.needs_display = subviewNeedsDisplay; } } } } /** * Causes the area of the view specified by aRect to be displayed. * This is done by moving up the view hierarchy until an opaque view * is found, then asking that view to update the appropriate area. */ - (void) displayRect: (NSRect)aRect { if ([self isOpaque] == YES) { [self displayRectIgnoringOpacity: aRect]; } else { NSView *firstOpaque = [self opaqueAncestor]; aRect = [firstOpaque convertRect: aRect fromView: self]; [firstOpaque displayRectIgnoringOpacity: aRect]; } } - (void) displayRectIgnoringOpacity: (NSRect)aRect { [self displayRectIgnoringOpacity: aRect inContext: nil]; } - (void) displayRectIgnoringOpacity: (NSRect)aRect inContext: (NSGraphicsContext *)context { NSGraphicsContext *wContext; BOOL flush = NO; BOOL subviewNeedsDisplay = NO; if (![self canDraw]) { return; } wContext = [_window graphicsContext]; if (context == nil) { context = wContext; } if (context == wContext) { NSRect neededRect; NSRect visibleRect = [self visibleRect]; flush = YES; [_window disableFlushWindow]; aRect = NSIntersectionRect(aRect, visibleRect); neededRect = NSIntersectionRect(_invalidRect, visibleRect); /* * If the rect we are going to display contains the _invalidRect * then we can empty _invalidRect. Do this before the drawing, * as drawRect: may change this value. * FIXME: If the drawn rectangle cuts of a complete part of the * _invalidRect, we should try to reduce this. */ if (NSEqualRects(aRect, NSUnionRect(neededRect, aRect)) == YES) { _invalidRect = NSZeroRect; _rFlags.needs_display = NO; } } if (NSIsEmptyRect(aRect) == NO) { /* * Now we draw this view. */ [self _lockFocusInContext: context inRect: aRect]; [self drawRect: aRect]; [self unlockFocusNeedsFlush: flush]; } /* * Even when aRect is empty we need to loop over the subviews to see, * if there is anything left to draw. */ if (_rFlags.has_subviews == YES) { NSUInteger count = [_sub_views count]; if (count > 0) { NSView *array[count]; NSUInteger i; [_sub_views getObjects: array]; for (i = 0; i < count; ++i) { NSView *subview = array[i]; NSRect subviewFrame = [subview _frameExtend]; NSRect isect; /* * Having drawn ourself into the rect, we must make sure that * subviews overlapping the area are redrawn. */ isect = NSIntersectionRect(aRect, subviewFrame); if (NSIsEmptyRect(isect) == NO) { isect = [subview convertRect: isect fromView: self]; [subview displayRectIgnoringOpacity: isect inContext: context]; } /* * Is there still something to draw in the subview? * This keeps the invariant that views further up are marked * for redraw when ever a view further down needs to redraw. */ if (subview->_rFlags.needs_display == YES) { subviewNeedsDisplay = YES; } } } } if (context == wContext) { if (subviewNeedsDisplay) { /* * If not all subviews have been fully displayed, we cannot turn off * the 'needs_display' flag. This is to keep the invariant that when * a view is marked as needing to display, all its ancestors will be * marked too. */ _rFlags.needs_display = YES; } [_window enableFlushWindow]; [_window flushWindowIfNeeded]; } } /** This method is invoked to handle drawing inside the view. The default NSView's implementation does nothing; subclasses might override it to draw something inside the view. Since NSView's implementation is guaranteed to be empty, you should not call super's implementation when you override it in subclasses. drawRect: is invoked when the focus has already been locked on the view; you can use arbitrary postscript functions in drawRect: to draw inside your view; the coordinate system in which you draw is the view's own coordinate system (this means for example that you should refer to the rectangle covered by the view using its bounds, and not its frame). The argument of drawRect: is the rectangle which needs to be redrawn. In a lossy implementation, you can ignore the argument and redraw the whole view; if you are aiming at performance, you may want to redraw only what is inside the rectangle which needs to be redrawn; this usually improves drawing performance considerably. */ - (void) drawRect: (NSRect)rect {} - (NSRect) visibleRect { if ([self isHiddenOrHasHiddenAncestor]) { return NSZeroRect; } if (_coordinates_valid == NO) { [self _rebuildCoordinates]; } return _visibleRect; } - (BOOL) wantsDefaultClipping { return YES; } - (BOOL) needsToDrawRect: (NSRect)aRect { const NSRect *rects; NSInteger i, count; [self getRectsBeingDrawn: &rects count: &count]; for (i = 0; i < count; i++) { if (NSIntersectsRect(aRect, rects[i])) return YES; } return NO; } - (void) getRectsBeingDrawn: (const NSRect **)rects count: (NSInteger *)count { // FIXME static NSRect rect; rect = [[_window->_rectsBeingDrawn lastObject] rectValue]; rect = [self convertRect: rect fromView: nil]; if (rects != NULL) { *rects = ▭ } if (count != NULL) { *count = 1; } } - (NSBitmapImageRep *) bitmapImageRepForCachingDisplayInRect: (NSRect)rect { NSBitmapImageRep *bitmap; [self lockFocus]; bitmap = [[NSBitmapImageRep alloc] initWithFocusedViewRect: rect]; [self unlockFocus]; return AUTORELEASE(bitmap); } - (void) cacheDisplayInRect: (NSRect)rect toBitmapImageRep: (NSBitmapImageRep *)bitmap { NSDictionary *dict; NSData *imageData; [self lockFocus]; dict = [GSCurrentContext() GSReadRect: rect]; [self unlockFocus]; imageData = [dict objectForKey: @"Data"]; if (imageData != nil) { // Copy the image data to the bitmap memcpy([bitmap bitmapData], [imageData bytes], [imageData length]); } } extern NSThread *GSAppKitThread; /* TODO */ /* For -setNeedsDisplay*, the real work is done in the ..._real methods, and the actual public method simply calls it, but makes sure that the call is in the main thread. */ - (void) _setNeedsDisplay_real: (NSNumber *)n { BOOL flag = [n boolValue]; if (flag) { [self setNeedsDisplayInRect: _bounds]; } else { _rFlags.needs_display = NO; _invalidRect = NSZeroRect; } } /** * As an exception to the general rules for threads and gui, this * method is thread-safe and may be called from any thread. Display * will always be done in the main thread. (Note that other methods are * in general not thread-safe; if you want to access other properties of * views from multiple threads, you need to provide the synchronization.) */ - (void) setNeedsDisplay: (BOOL)flag { NSNumber *n = [[NSNumber alloc] initWithBool: flag]; if (GSCurrentThread() != GSAppKitThread) { NSDebugMLLog (@"MacOSXCompatibility", @"setNeedsDisplay: called on secondary thread"); [self performSelectorOnMainThread: @selector(_setNeedsDisplay_real:) withObject: n waitUntilDone: NO]; } else { [self _setNeedsDisplay_real: n]; } DESTROY(n); } - (void) _setNeedsDisplayInRect_real: (NSValue *)v { NSRect invalidRect = [v rectValue]; NSView *currentView = _super_view; /* * Limit to bounds, combine with old _invalidRect, and then check to see * if the result is the same as the old _invalidRect - if it isn't then * set the new _invalidRect. */ invalidRect = NSIntersectionRect(invalidRect, _bounds); invalidRect = NSUnionRect(_invalidRect, invalidRect); if (NSEqualRects(invalidRect, _invalidRect) == NO) { NSView *firstOpaque = [self opaqueAncestor]; _rFlags.needs_display = YES; _invalidRect = invalidRect; if (firstOpaque == self) { /** * Enlarge (if necessary) _invalidRect so it lies on integral device pixels */ const NSRect inBase = [self convertRectToBase: _invalidRect]; const NSRect inBaseRounded = NSIntegralRect(inBase); _invalidRect = [self convertRectFromBase: inBaseRounded]; [_window setViewsNeedDisplay: YES]; } else { invalidRect = [firstOpaque convertRect: _invalidRect fromView: self]; [firstOpaque setNeedsDisplayInRect: invalidRect]; } } /* * Must make sure that superviews know that we need display. * NB. we may have been marked as needing display and then moved to another * parent, so we can't assume that our parent is marked simply because we are. */ while (currentView) { currentView->_rFlags.needs_display = YES; currentView = currentView->_super_view; } // Also mark the window, as this may not happen above [_window setViewsNeedDisplay: YES]; } /** * Inform the view system that the specified rectangle is invalid and * requires updating. This automatically informs any superviews of * any updating they need to do. * * As an exception to the general rules for threads and gui, this * method is thread-safe and may be called from any thread. Display * will always be done in the main thread. (Note that other methods are * in general not thread-safe; if you want to access other properties of * views from multiple threads, you need to provide the synchronization.) */ - (void) setNeedsDisplayInRect: (NSRect)invalidRect { NSValue *v; if (NSIsEmptyRect(invalidRect)) return; // avoid unnecessary work when rectangle is empty v = [[NSValue alloc] initWithBytes: &invalidRect objCType: @encode(NSRect)]; if (GSCurrentThread() != GSAppKitThread) { NSDebugMLLog (@"MacOSXCompatibility", @"setNeedsDisplayInRect: called on secondary thread"); [self performSelectorOnMainThread: @selector(_setNeedsDisplayInRect_real:) withObject: v waitUntilDone: NO]; } else { [self _setNeedsDisplayInRect_real: v]; } DESTROY(v); } + (NSFocusRingType) defaultFocusRingType { return NSFocusRingTypeDefault; } - (void) setKeyboardFocusRingNeedsDisplayInRect: (NSRect)rect { // FIXME For external type special handling is needed [self setNeedsDisplayInRect: rect]; } - (void) setFocusRingType: (NSFocusRingType)focusRingType { _focusRingType = focusRingType; } - (NSFocusRingType) focusRingType { return _focusRingType; } /* * Hidding Views */ - (void) setHidden: (BOOL)flag { id view; if (_is_hidden == flag) return; _is_hidden = flag; if (_is_hidden) { for (view = [_window firstResponder]; view != nil && [view respondsToSelector: @selector(superview)]; view = [view superview]) { if (view == self) { [_window makeFirstResponder: [self nextValidKeyView]]; break; } } if (_rFlags.has_draginfo) { if (_window != nil) { NSArray *t = GSGetDragTypes(self); [GSDisplayServer removeDragTypes: t fromWindow: _window]; } } [[self superview] setNeedsDisplay: YES]; } else { if (_rFlags.has_draginfo) { if (_window != nil) { NSArray *t = GSGetDragTypes(self); [GSDisplayServer addDragTypes: t toWindow: _window]; } } if (_rFlags.has_subviews) { // The _visibleRect of subviews will be NSZeroRect, because when they // were calculated in -[_rebuildCoordinates], they were intersected // with the result of calling -[visibleRect] on the hidden superview, // which returns NSZeroRect for hidden views. // // So, recalculate the subview coordinates now to make them correct. [_sub_views makeObjectsPerformSelector: @selector(_invalidateCoordinates)]; } [self setNeedsDisplay: YES]; } } - (BOOL) isHidden { return _is_hidden; } - (BOOL) isHiddenOrHasHiddenAncestor { return ([self isHidden] || [_super_view isHiddenOrHasHiddenAncestor]); } /* * Live resize support */ - (BOOL) inLiveResize { return _in_live_resize; } - (void) viewWillStartLiveResize { // FIXME _in_live_resize = YES; } - (void) viewDidEndLiveResize { // FIXME _in_live_resize = NO; } - (BOOL) preservesContentDuringLiveResize { return NO; } - (void) getRectsExposedDuringLiveResize: (NSRect[4])exposedRects count: (NSInteger *)count { // FIXME if (count != NULL) { *count = 1; } exposedRects[0] = _bounds; } - (NSRect) rectPreservedDuringLiveResize { return NSZeroRect; } /* * Scrolling */ - (NSRect) adjustScroll: (NSRect)newVisible { return newVisible; } /** * Finds the nearest enclosing NSClipView and, if the location of the event * is outside it, scrolls the NSClipView in the direction of the event. The * amount scrolled is proportional to how far outside the NSClipView the * event's location is. * * This method is suitable for calling periodically from a modal event * tracking loop when the mouse is dragged outside the tracking view. The * suggested period of the calls is 0.1 seconds. */ - (BOOL) autoscroll: (NSEvent*)theEvent { if (_super_view) return [_super_view autoscroll: theEvent]; return NO; } - (void) reflectScrolledClipView: (NSClipView*)aClipView { } - (void) scrollClipView: (NSClipView*)aClipView toPoint: (NSPoint)aPoint { [aClipView scrollToPoint: aPoint]; } - (NSClipView*) _enclosingClipView { static Class clipViewClass; id aView = [self superview]; if (!clipViewClass) { clipViewClass = [NSClipView class]; } while (aView != nil) { if ([aView isKindOfClass: clipViewClass]) { break; } aView = [aView superview]; } return aView; } - (void) scrollPoint: (NSPoint)aPoint { NSClipView *s = [self _enclosingClipView]; if (s == nil) return; aPoint = [self convertPoint: aPoint toView: s]; if (NSEqualPoints(aPoint, [s bounds].origin) == NO) { [s scrollToPoint: aPoint]; } } /** Copy on scroll method, should be called from [NSClipView setBoundsOrigin]. */ - (void) scrollRect: (NSRect)aRect by: (NSSize)delta { NSPoint destPoint; aRect = NSIntersectionRect(aRect, _bounds); // Don't copy stuff outside. destPoint = aRect.origin; destPoint.x += delta.width; destPoint.y += delta.height; if ([self isFlipped]) { destPoint.y += aRect.size.height; } //NSLog(@"destPoint %@ in %@", NSStringFromPoint(destPoint), NSStringFromRect(_bounds)); [self lockFocus]; //NSCopyBits(0, aRect, destPoint); NSCopyBits([[self window] gState], [self convertRect: aRect toView: nil], destPoint); [self unlockFocus]; } /** Scrolls the nearest enclosing clip view the minimum required distance necessary to make aRect (or as much of it possible) in the receiver visible. Returns YES iff any scrolling was done. */ - (BOOL) scrollRectToVisible: (NSRect)aRect { NSClipView *s = [self _enclosingClipView]; if (s != nil) { NSRect vRect = [s documentVisibleRect]; NSPoint aPoint = vRect.origin; // Ok we assume that the rectangle is origined at the bottom left // and goes to the top and right as it grows in size for the naming // of these variables CGFloat ldiff, rdiff, tdiff, bdiff; if (vRect.size.width == 0 && vRect.size.height == 0) return NO; aRect = [self convertRect: aRect toView: [s documentView]]; // Find the differences on each side. ldiff = NSMinX(vRect) - NSMinX(aRect); rdiff = NSMaxX(aRect) - NSMaxX(vRect); bdiff = NSMinY(vRect) - NSMinY(aRect); tdiff = NSMaxY(aRect) - NSMaxY(vRect); // If the diff's have the same sign then nothing needs to be scrolled if ((ldiff * rdiff) >= 0.0) ldiff = rdiff = 0.0; if ((bdiff * tdiff) >= 0.0) bdiff = tdiff = 0.0; // Move the smallest difference aPoint.x += (fabs(ldiff) < fabs(rdiff)) ? (-ldiff) : rdiff; aPoint.y += (fabs(bdiff) < fabs(tdiff)) ? (-bdiff) : tdiff; if (aPoint.x != vRect.origin.x || aPoint.y != vRect.origin.y) { aPoint = [[s documentView] convertPoint: aPoint toView: s]; [s scrollToPoint: aPoint]; return YES; } } return NO; } - (NSScrollView*) enclosingScrollView { static Class scrollViewClass; id aView = [self superview]; if (!scrollViewClass) { scrollViewClass = [NSScrollView class]; } while (aView != nil) { if ([aView isKindOfClass: scrollViewClass]) { break; } aView = [aView superview]; } return aView; } /* * Managing the Cursor * * We use the tracking rectangle class to maintain the cursor rects */ - (void) addCursorRect: (NSRect)aRect cursor: (NSCursor*)anObject { if (_window != nil) { GSTrackingRect *m; aRect = [self convertRect: aRect toView: nil]; m = [rectClass allocWithZone: NSDefaultMallocZone()]; m = [m initWithRect: aRect tag: 0 owner: RETAIN(anObject) userData: NULL inside: YES]; [_cursor_rects addObject: m]; RELEASE(m); _rFlags.has_currects = 1; _rFlags.valid_rects = 1; } } - (void) discardCursorRects { if (_rFlags.has_currects != 0) { NSUInteger count = [_cursor_rects count]; if (count > 0) { GSTrackingRect *rects[count]; [_cursor_rects getObjects: rects]; if (_rFlags.valid_rects != 0) { NSPoint loc = _window->_lastPoint; NSUInteger i; for (i = 0; i < count; ++i) { GSTrackingRect *r = rects[i]; if (NSMouseInRect(loc, r->rectangle, NO)) { [r->owner mouseExited: nil]; } [r invalidate]; } _rFlags.valid_rects = 0; } while (count-- > 0) { RELEASE([rects[count] owner]); } [_cursor_rects removeAllObjects]; } _rFlags.has_currects = 0; } } - (void) removeCursorRect: (NSRect)aRect cursor: (NSCursor*)anObject { id e = [_cursor_rects objectEnumerator]; GSTrackingRect *o; NSCursor *c; NSPoint loc = [_window mouseLocationOutsideOfEventStream]; /* Base remove test upon cursor object */ o = [e nextObject]; while (o) { c = [o owner]; if (c == anObject) { if (NSMouseInRect(loc, o->rectangle, NO)) { [c mouseExited: nil]; } [o invalidate]; [_cursor_rects removeObject: o]; if ([_cursor_rects count] == 0) { _rFlags.has_currects = 0; _rFlags.valid_rects = 0; } RELEASE(c); break; } else { o = [e nextObject]; } } } - (void) resetCursorRects { } static NSView* findByTag(NSView *view, NSInteger aTag, NSUInteger *level) { NSUInteger i, count; NSArray *sub = [view subviews]; count = [sub count]; if (count > 0) { NSView *array[count]; [sub getObjects: array]; for (i = 0; i < count; i++) { if ([array[i] tag] == aTag) return array[i]; } *level += 1; for (i = 0; i < count; i++) { NSView *v; v = findByTag(array[i], aTag, level); if (v != nil) return v; } *level -= 1; } return nil; } - (id) viewWithTag: (NSInteger)aTag { NSView *view = nil; /* * If we have the specified tag - return self. */ if ([self tag] == aTag) { view = self; } else if (_rFlags.has_subviews) { NSUInteger count = [_sub_views count]; if (count > 0) { NSView *array[count]; NSUInteger i; [_sub_views getObjects: array]; /* * Quick check to see if any of our direct descendents has the tag. */ for (i = 0; i < count; i++) { NSView *subView = array[i]; if ([subView tag] == aTag) { view = subView; break; } } if (view == nil) { NSUInteger level = 0xffffffff; /* * Ok - do it the long way - search the whole tree for each of * our descendents and see which has the closest view matching * the tag. */ for (i = 0; i < count; i++) { NSUInteger l = 0; NSView *v; v = findByTag(array[i], aTag, &l); if (v != nil && l < level) { view = v; level = l; } } } } } return view; } /* * Aiding Event Handling */ /** * Returns YES if the view object will accept the first * click received when in an inactive window, and NO * otherwise. */ - (BOOL) acceptsFirstMouse: (NSEvent*)theEvent { return NO; } /** * Returns the subview, lowest in the receiver's hierarchy, which * contains aPoint, or nil if there is no such view. */ - (NSView*) hitTest: (NSPoint)aPoint { NSPoint p; NSView *v = nil, *w; /* If not within our frame then it can't be a hit. As a special case, always assume that it's a hit if our _super_view is nil, ie. if we're the top-level view in a window. */ if ([self isHidden]) { return nil; } if (_is_rotated_or_scaled_from_base) { p = [self convertPoint: aPoint fromView: _super_view]; if (!NSPointInRect (p, _bounds)) { return nil; } } else if (_super_view && ![_super_view mouse: aPoint inRect: _frame]) { return nil; } else { p = [self convertPoint: aPoint fromView: _super_view]; } if (_rFlags.has_subviews) { NSUInteger count; count = [_sub_views count]; if (count > 0) { NSView *array[count]; [_sub_views getObjects: array]; while (count > 0) { w = array[--count]; v = [w hitTest: p]; if (v) break; } } } /* * mouse is either in the subview or within self */ if (v) return v; else return self; } /** * Returns whether or not aPoint lies within aRect. */ - (BOOL) mouse: (NSPoint)aPoint inRect: (NSRect)aRect { return NSMouseInRect (aPoint, aRect, [self isFlipped]); } - (BOOL) performKeyEquivalent: (NSEvent*)theEvent { NSUInteger i; for (i = 0; i < [_sub_views count]; i++) if ([[_sub_views objectAtIndex: i] performKeyEquivalent: theEvent] == YES) return YES; return NO; } - (BOOL) performMnemonic: (NSString *)aString { NSUInteger i; for (i = 0; i < [_sub_views count]; i++) if ([[_sub_views objectAtIndex: i] performMnemonic: aString] == YES) return YES; return NO; } - (BOOL) mouseDownCanMoveWindow { return ![self isOpaque]; } - (void) removeTrackingRect: (NSTrackingRectTag)tag { NSUInteger i, j; GSTrackingRect *m; j = [_tracking_rects count]; for (i = 0;i < j; ++i) { m = (GSTrackingRect*)[_tracking_rects objectAtIndex: i]; if ([m tag] == tag) { [m invalidate]; [_tracking_rects removeObjectAtIndex: i]; if ([_tracking_rects count] == 0) { _rFlags.has_trkrects = 0; } return; } } } - (BOOL) shouldDelayWindowOrderingForEvent: (NSEvent*)anEvent { return NO; } - (NSTrackingRectTag) addTrackingRect: (NSRect)aRect owner: (id)anObject userData: (void*)data assumeInside: (BOOL)flag { NSTrackingRectTag t; NSUInteger i, j; GSTrackingRect *m; t = 0; j = [_tracking_rects count]; for (i = 0; i < j; ++i) { m = (GSTrackingRect*)[_tracking_rects objectAtIndex: i]; if ([m tag] > t) t = [m tag]; } ++t; m = [[rectClass alloc] initWithRect: aRect tag: t owner: anObject userData: data inside: flag]; [_tracking_rects addObject: m]; RELEASE(m); _rFlags.has_trkrects = 1; return t; } -(BOOL) needsPanelToBecomeKey { return NO; } /** *

The effect of the -setNextKeyView: method is to set aView to be the * value returned by subsequent calls to the receivers -nextKeyView method. * This also has the effect of setting the previous key view of aView, * so that subsequent calls to its -previousKeyView method will return * the receiver. *

*

As a special case, if you pass nil as aView then the -previousKeyView * of the receivers current -nextKeyView is set to nil as well as the * receivers -nextKeyView being set to nil.
* This behavior provides MacOS-X compatibility. *

*

If you pass a non-view object other than nil, an * NSInternaInconsistencyException is raised. *

*

NB This method does NOT cause aView to be * retained, and if aView is deallocated, the [NSView-dealloc] method will * automatically remove it from the key view chain it is in. *

*

For keyboard navigation, views are linked together in a chain, so that * the current first responder view can be changed by stepping backward * and forward in that chain. This is the method for building and modifying * that chain. *

*

The MacOS-X documentation refers to this chain as a loop, but * the actual implementation is not a loop at all (except as a special case * when you make the chain into a loop). In fact, while each view may have * only zero or one next view, and zero or one previous * view, several views may have their next view set to a single * view and/or their previous views set to a single view. So the * actual setup is a directed graph rather than a loop. *

*

While a directed graph is a very powerful and flexible way of managing * the way views get keyboard focus in response to tabs etc, it can be * confusing if misused. It is probably best therefore, to set your views * up as a single loop within each window. *

* * [a setNextKeyView: b]; * [b setNextKeyView: c]; * [c setNextKeyView: d]; * [d setNextKeyView: a]; * */ - (void) setNextKeyView: (NSView *)aView { NSView *tmp; NSUInteger count; if (aView != nil && [aView isKindOfClass: viewClass] == NO) { [NSException raise: NSInternalInconsistencyException format: @"[NSView -setNextKeyView:] passed non-view object %@", aView]; } if (aView == nil) { if (nKV(self) != 0) { tmp = GSIArrayItemAtIndex(nKV(self), 0).obj; if (tmp != nil) { /* * Remove all reference to self from our next key view. */ if (pKV(tmp) != 0) { count = GSIArrayCount(pKV(tmp)); while (count-- > 1) { if (GSIArrayItemAtIndex(pKV(tmp), count).obj == self) { GSIArrayRemoveItemAtIndex(pKV(tmp), count); } } if (GSIArrayItemAtIndex(pKV(tmp), 0).obj == self) { GSIArraySetItemAtIndex(pKV(tmp), (GSIArrayItem)nil, 0); } } /* * Clear link to the next key view. */ GSIArraySetItemAtIndex(nKV(self), (GSIArrayItem)nil, 0); } } return; } if (nKV(self) == 0) { /* * Create array and ensure that it has a nil item at index 0 ... * so we always have room for the pointer to the next view. */ _nextKeyView = NSZoneMalloc(NSDefaultMallocZone(), sizeof(GSIArray_t)); GSIArrayInitWithZoneAndCapacity(nKV(self), NSDefaultMallocZone(), 1); GSIArrayAddItem(nKV(self), (GSIArrayItem)nil); } else { /* A safety measure against recursion. */ tmp = GSIArrayItemAtIndex(nKV(self), 0).obj; if (tmp == aView) { return; } } if (pKV(aView) == 0) { /* * Create array and ensure that it has a nil item at index 0 ... * so we always have room for the pointer to the previous view. */ aView->_previousKeyView = NSZoneMalloc(NSDefaultMallocZone(), sizeof(GSIArray_t)); GSIArrayInitWithZoneAndCapacity(pKV(aView), NSDefaultMallocZone(), 1); GSIArrayAddItem(pKV(aView), (GSIArrayItem)nil); } /* * Tell the old previous view of aView that aView no longer points to it. */ tmp = GSIArrayItemAtIndex(pKV(aView), 0).obj; if (tmp != nil) { count = GSIArrayCount(nKV(tmp)); while (count-- > 1) { if (GSIArrayItemAtIndex(nKV(tmp), count).obj == aView) { GSIArrayRemoveItemAtIndex(nKV(tmp), count); } } /* * If the view still points to aView, make a note of it in the * 'previous' array of aView while making space for the new link. */ if (GSIArrayItemAtIndex(nKV(tmp), 0).obj == aView) { GSIArrayInsertItem(pKV(aView), (GSIArrayItem)nil, 0); } } /* * Set up 'previous' link in aView to point to us. */ GSIArraySetItemAtIndex(pKV(aView), (GSIArrayItem)((id)self), 0); /* * Tell our current 'next' view that we are no longer pointing to it. */ tmp = GSIArrayItemAtIndex(nKV(self), 0).obj; if (tmp != nil) { count = GSIArrayCount(pKV(tmp)); while (count-- > 1) { if (GSIArrayItemAtIndex(pKV(tmp), count).obj == self) { GSIArrayRemoveItemAtIndex(pKV(tmp), count); } } if (GSIArrayItemAtIndex(pKV(tmp), 0).obj == self) { GSIArraySetItemAtIndex(pKV(tmp), (GSIArrayItem)nil, 0); } } /* * Set up 'next' link to point to aView. */ GSIArraySetItemAtIndex(nKV(self), (GSIArrayItem)((id)aView), 0); } /** * Returns the next view after the receiver in the key view chain.
* Returns nil if there is no view after the receiver.
* The next view is set up using the -setNextKeyView: method.
* The key view chain is used to determine the order in which views become * first responder when using keyboard navigation. */ - (NSView *) nextKeyView { if (nKV(self) == 0) { return nil; } return GSIArrayItemAtIndex(nKV(self), 0).obj; } /** * Returns the first available view after the receiver which is * actually able to become first responder. See -nextKeyView and * [NSResponder-acceptsFirstResponder] */ - (NSView *) nextValidKeyView { NSView *theView; theView = [self nextKeyView]; while (1) { if ((theView == nil) || (theView == self) || [theView canBecomeKeyView]) { return theView; } theView = [theView nextKeyView]; } } /** * GNUstep addition ... a conveninece method to insert a view in the * key view chain before the receiver, using the -previousKeyView and * -setNextKeyView: methods. */ - (void) setPreviousKeyView: (NSView *)aView { NSView *p = [self previousKeyView]; if (aView == p || aView == self) { return; } [p setNextKeyView: aView]; [aView setNextKeyView: self]; } /** * Returns the view before the receiver in the key view chain.
* Returns nil if there is no view before the receiver in the chain.
* The previous view of the receiver was set up by passing it as the * argument to a call of -setNextKeyView: on that view.
* The key view chain is used to determine the order in which views become * first responder when using keyboard navigation. */ - (NSView *) previousKeyView { if (pKV(self) == 0) { return nil; } return GSIArrayItemAtIndex(pKV(self), 0).obj; } /** * Returns the first available view before the receiver which is * actually able to become first responder. See -nextKeyView and * [NSResponder-acceptsFirstResponder] */ - (NSView *) previousValidKeyView { NSView *theView; theView = [self previousKeyView]; while (1) { if ((theView == nil) || (theView == self) || [theView canBecomeKeyView]) { return theView; } theView = [theView previousKeyView]; } } - (BOOL) canBecomeKeyView { // FIXME return [self acceptsFirstResponder] && ![self isHiddenOrHasHiddenAncestor]; } /* * Dragging */ - (BOOL) dragFile: (NSString*)filename fromRect: (NSRect)rect slideBack: (BOOL)slideFlag event: (NSEvent*)event { NSImage *anImage = [[NSWorkspace sharedWorkspace] iconForFile: filename]; NSPasteboard *pboard = [NSPasteboard pasteboardWithName: NSDragPboard]; if (anImage == nil) return NO; [pboard declareTypes: [NSArray arrayWithObject: NSFilenamesPboardType] owner: self]; if (![pboard setPropertyList: [NSArray arrayWithObject: filename] forType: NSFilenamesPboardType]) return NO; [self dragImage: anImage at: rect.origin offset: NSMakeSize(0, 0) event: event pasteboard: pboard source: self slideBack: slideFlag]; return YES; } - (void) dragImage: (NSImage*)anImage at: (NSPoint)viewLocation offset: (NSSize)initialOffset event: (NSEvent*)event pasteboard: (NSPasteboard*)pboard source: (id)sourceObject slideBack: (BOOL)slideFlag { [_window dragImage: anImage at: [self convertPoint: viewLocation toView: nil] offset: initialOffset event: event pasteboard: pboard source: sourceObject slideBack: slideFlag]; } /** * Registers the fact that the receiver should accept dragged data * of any of the specified types. You need to do this if you want * your view to support drag and drop. */ - (void) registerForDraggedTypes: (NSArray*)newTypes { NSArray *o; NSArray *t; if (newTypes == nil || [newTypes count] == 0) [NSException raise: NSInvalidArgumentException format: @"Types information missing"]; /* * Get the old drag types for this view if we need to tell the context * to change the registered types for the window. */ if (_rFlags.has_draginfo == 1 && _window != nil) { o = TEST_RETAIN(GSGetDragTypes(self)); } else { o = nil; } t = GSSetDragTypes(self, newTypes); _rFlags.has_draginfo = 1; if (_window != nil) { // Remove the old types first, that way overlapping types stay assigned. if (o != nil) { [GSDisplayServer removeDragTypes: o fromWindow: _window]; } [GSDisplayServer addDragTypes: t toWindow: _window]; } TEST_RELEASE(o); } - (void) unregisterDraggedTypes { if (_rFlags.has_draginfo) { if (_window != nil) { NSArray *t = GSGetDragTypes(self); [GSDisplayServer removeDragTypes: t fromWindow: _window]; } GSRemoveDragTypes(self); _rFlags.has_draginfo = 0; } } - (NSArray *) registeredDraggedTypes { return GSGetDragTypes(self); } - (BOOL) dragPromisedFilesOfTypes: (NSArray *)typeArray fromRect: (NSRect)aRect source: (id)sourceObject slideBack: (BOOL)slideBack event: (NSEvent *)theEvent { // FIXME: Where to get the image from? NSImage *anImage = nil; NSPasteboard *pboard = [NSPasteboard pasteboardWithName: NSDragPboard]; if (anImage == nil) return NO; [pboard declareTypes: [NSArray arrayWithObject: NSFilesPromisePboardType] owner: sourceObject]; // FIXME: Not sure if this is correct. if (![pboard setPropertyList: typeArray forType: NSFilesPromisePboardType]) return NO; [self dragImage: anImage at: aRect.origin offset: NSMakeSize(0, 0) event: theEvent pasteboard: pboard source: sourceObject slideBack: slideBack]; return YES; } /* * Printing */ - (void) fax: (id)sender { NSPrintInfo *aPrintInfo = [NSPrintInfo sharedPrintInfo]; [aPrintInfo setJobDisposition: NSPrintFaxJob]; [[NSPrintOperation printOperationWithView: self printInfo: aPrintInfo] runOperation]; } - (void) print: (id)sender { [[NSPrintOperation printOperationWithView: self] runOperation]; } - (NSData*) dataWithEPSInsideRect: (NSRect)aRect { NSMutableData *data = [NSMutableData data]; if ([[NSPrintOperation EPSOperationWithView: self insideRect: aRect toData: data] runOperation]) { return data; } else { return nil; } } - (void) writeEPSInsideRect: (NSRect)rect toPasteboard: (NSPasteboard*)pasteboard { NSData *data = [self dataWithEPSInsideRect: rect]; if (data != nil) [pasteboard setData: data forType: NSPostScriptPboardType]; } - (NSData *) dataWithPDFInsideRect: (NSRect)aRect { NSMutableData *data = [NSMutableData data]; if ([[NSPrintOperation PDFOperationWithView: self insideRect: aRect toData: data] runOperation]) { return data; } else { return nil; } } - (void) writePDFInsideRect: (NSRect)aRect toPasteboard: (NSPasteboard *)pboard { NSData *data = [self dataWithPDFInsideRect: aRect]; if (data != nil) [pboard setData: data forType: NSPDFPboardType]; } - (NSString *) printJobTitle { id doc; NSString *title; doc = [[NSDocumentController sharedDocumentController] documentForWindow: [self window]]; if (doc) title = [doc displayName]; else title = [[self window] title]; return title; } /* * Pagination */ - (void) adjustPageHeightNew: (CGFloat*)newBottom top: (CGFloat)oldTop bottom: (CGFloat)oldBottom limit: (CGFloat)bottomLimit { CGFloat bottom = oldBottom; if (_rFlags.has_subviews) { id e, o; e = [_sub_views objectEnumerator]; while ((o = [e nextObject]) != nil) { // FIXME: We have to convert this values for the subclass CGFloat oTop, oBottom, oLimit; /* Don't ask me why, but gcc-2.91.66 crashes if we use NSMakePoint in the following expressions. We avoid this compiler internal bug by using an auxiliary aPoint variable, and setting it manually to the NSPoints we need. */ { NSPoint aPoint = {0, oldTop}; oTop = ([self convertPoint: aPoint toView: o]).y; } { NSPoint aPoint = {0, bottom}; oBottom = ([self convertPoint: aPoint toView: o]).y; } { NSPoint aPoint = {0, bottomLimit}; oLimit = ([self convertPoint: aPoint toView: o]).y; } [o adjustPageHeightNew: &oBottom top: oTop bottom: oBottom limit: oLimit]; { NSPoint aPoint = {0, oBottom}; bottom = ([self convertPoint: aPoint fromView: o]).y; } } } *newBottom = bottom; } - (void) adjustPageWidthNew: (CGFloat*)newRight left: (CGFloat)oldLeft right: (CGFloat)oldRight limit: (CGFloat)rightLimit { CGFloat right = oldRight; if (_rFlags.has_subviews) { id e, o; e = [_sub_views objectEnumerator]; while ((o = [e nextObject]) != nil) { // FIXME: We have to convert this values for the subclass /* See comments in adjustPageHeightNew:top:bottom:limit: about why code is structured in this funny way. */ CGFloat oLeft, oRight, oLimit; /* Don't ask me why, but gcc-2.91.66 crashes if we use NSMakePoint in the following expressions. We avoid this compiler internal bug by using an auxiliary aPoint variable, and setting it manually to the NSPoints we need. */ { NSPoint aPoint = {oldLeft, 0}; oLeft = ([self convertPoint: aPoint toView: o]).x; } { NSPoint aPoint = {right, 0}; oRight = ([self convertPoint: aPoint toView: o]).x; } { NSPoint aPoint = {rightLimit, 0}; oLimit = ([self convertPoint: aPoint toView: o]).x; } [o adjustPageHeightNew: &oRight top: oLeft bottom: oRight limit: oLimit]; { NSPoint aPoint = {oRight, 0}; right = ([self convertPoint: aPoint fromView: o]).x; } } } *newRight = right; } - (CGFloat) heightAdjustLimit { return 0.0; } - (BOOL) knowsPagesFirst: (int*)firstPageNum last: (int*)lastPageNum { return NO; } - (BOOL) knowsPageRange: (NSRange*)range { return NO; } - (NSPoint) locationOfPrintRect: (NSRect)aRect { int pages; NSPoint location; NSRect bounds; NSMutableDictionary *dict; NSPrintOperation *printOp = [NSPrintOperation currentOperation]; NSPrintInfo *printInfo = [printOp printInfo]; dict = [printInfo dictionary]; pages = [[dict objectForKey: @"NSPrintTotalPages"] intValue]; if ([dict objectForKey: @"NSPrintPaperBounds"]) bounds = [[dict objectForKey: @"NSPrintPaperBounds"] rectValue]; else bounds = aRect; location = NSMakePoint(0, NSHeight(bounds)-NSHeight(aRect)); /* FIXME: I can't figure out how the location for a multi-page document is computed. Just ignore centering? */ if (pages == 1) { if ([printInfo isHorizontallyCentered]) location.x = (NSWidth(bounds) - NSWidth(aRect))/2; if ([printInfo isVerticallyCentered]) location.y = (NSHeight(bounds) - NSHeight(aRect))/2; } return location; } - (NSRect) rectForPage: (NSInteger)page { return NSZeroRect; } - (CGFloat) widthAdjustLimit { return 0.0; } /* * Writing Conforming PostScript */ - (void) beginPage: (int)ordinalNum label: (NSString*)aString bBox: (NSRect)pageRect fonts: (NSString*)fontNames { NSPrintOperation *printOp = [NSPrintOperation currentOperation]; NSGraphicsContext *ctxt = [printOp context]; [ctxt beginPage: ordinalNum label: aString bBox: pageRect fonts: fontNames]; } - (void) beginPageSetupRect: (NSRect)aRect placement: (NSPoint)location { [self beginPageInRect: aRect atPlacement: location]; } - (void) beginPrologueBBox: (NSRect)boundingBox creationDate: (NSString*)dateCreated createdBy: (NSString*)anApplication fonts: (NSString*)fontNames forWhom: (NSString*)user pages: (int)numPages title: (NSString*)aTitle { NSPrintOperation *printOp = [NSPrintOperation currentOperation]; NSGraphicsContext *ctxt = [printOp context]; [ctxt beginPrologueBBox: boundingBox creationDate: dateCreated createdBy: anApplication fonts: fontNames forWhom: user pages: numPages title: aTitle]; } - (void) addToPageSetup { } - (void) beginSetup { NSPrintOperation *printOp = [NSPrintOperation currentOperation]; NSGraphicsContext *ctxt = [printOp context]; [ctxt beginSetup]; } - (void) beginTrailer { NSPrintOperation *printOp = [NSPrintOperation currentOperation]; NSGraphicsContext *ctxt = [printOp context]; [ctxt beginTrailer]; } - (void) drawPageBorderWithSize: (NSSize)borderSize { } - (void) drawSheetBorderWithSize: (NSSize)borderSize { } - (void) endHeaderComments { NSPrintOperation *printOp = [NSPrintOperation currentOperation]; NSGraphicsContext *ctxt = [printOp context]; [ctxt endHeaderComments]; } - (void) endPrologue { NSPrintOperation *printOp = [NSPrintOperation currentOperation]; NSGraphicsContext *ctxt = [printOp context]; [ctxt endPrologue]; } - (void) endSetup { NSPrintOperation *printOp = [NSPrintOperation currentOperation]; NSGraphicsContext *ctxt = [printOp context]; [ctxt endSetup]; } - (void) endPageSetup { NSPrintOperation *printOp = [NSPrintOperation currentOperation]; NSGraphicsContext *ctxt = [printOp context]; [ctxt endPageSetup]; } - (void) endPage { int nup; NSPrintOperation *printOp = [NSPrintOperation currentOperation]; NSGraphicsContext *ctxt = [printOp context]; NSDictionary *dict = [[printOp printInfo] dictionary]; // Balance gsave in beginPageInRect: DPSgrestore(ctxt); nup = [[dict objectForKey: NSPrintPagesPerSheet] intValue]; if (nup > 1) { DPSPrintf(ctxt, "__GSpagesaveobject restore\n\n"); } // [self unlockFocus]; } - (void) endTrailer { NSPrintOperation *printOp = [NSPrintOperation currentOperation]; NSGraphicsContext *ctxt = [printOp context]; [ctxt endTrailer]; } - (NSAttributedString *) pageFooter { return [[[NSAttributedString alloc] initWithString: [NSString stringWithFormat:@"Page %d", [[NSPrintOperation currentOperation] currentPage]]] autorelease]; } - (NSAttributedString *) pageHeader { return [[[NSAttributedString alloc] initWithString: [NSString stringWithFormat:@"%@ %@", [self printJobTitle], [[NSCalendarDate calendarDate] description]]] autorelease]; } /** Writes header and job information for the PostScript document. This includes at a minimum, PostScript header information. It may also include job setup information if the output is intended for a printer (i.e. not an EPS file). Most of the information for writing the header comes from the NSPrintOperation and NSPrintInfo objects associated with the current print operation. There isn't normally anything that the program needs to override at the beginning of a document, although if there is additional setup that needs to be done, you can override the NSView's methods endHeaderComments, endPrologue, beginSetup, and/or endSetup. This method calls the above methods in the listed order before or after writing the required information. For an EPS operation, the beginSetup and endSetup methods aren't used. */ - (void)beginDocument { int first, last, pages, nup; NSRect bbox; NSPrintOperation *printOp = [NSPrintOperation currentOperation]; NSGraphicsContext *ctxt = [printOp context]; NSDictionary *dict = [[printOp printInfo] dictionary]; if (printOp == nil) { [NSException raise: NSInternalInconsistencyException format: @"beginDocument called without a current print op"]; } /* Inform ourselves and subviews that we're printing so we adjust the PostScript accordingly. Perhaps this could be in the thread dictionary, but that's probably overkill and slow */ viewIsPrinting = self; /* Get pagination information */ nup = [[dict objectForKey: NSPrintPagesPerSheet] intValue]; bbox = NSZeroRect; if ([dict objectForKey: @"NSPrintSheetBounds"]) bbox = [[dict objectForKey: @"NSPrintSheetBounds"] rectValue]; first = [[dict objectForKey: NSPrintFirstPage] intValue]; last = [[dict objectForKey: NSPrintLastPage] intValue]; pages = last - first + 1; if (nup > 1) pages = ceil((float)pages / nup); /* Begin document structure */ [self beginPrologueBBox: bbox creationDate: [[NSCalendarDate calendarDate] description] createdBy: [[NSProcessInfo processInfo] processName] fonts: nil forWhom: NSUserName() pages: pages title: [self printJobTitle]]; [self endHeaderComments]; [ctxt printerProlog]; [self endPrologue]; if ([printOp isEPSOperation] == NO) { [self beginSetup]; // Setup goes here ! [self endSetup]; } [ctxt resetUsedFonts]; /* Make sure we set the visible rect so everything is printed. */ [self _invalidateCoordinates]; _visibleRect = _bounds; } - (void) beginPageInRect: (NSRect)aRect atPlacement: (NSPoint)location { int nup; NSRect bounds; NSPrintOperation *printOp = [NSPrintOperation currentOperation]; NSGraphicsContext *ctxt = [printOp context]; NSDictionary *dict = [[printOp printInfo] dictionary]; if (NSIsEmptyRect(aRect)) { if ([dict objectForKey: @"NSPrintPaperBounds"]) { bounds = [[dict objectForKey: @"NSPrintPaperBounds"] rectValue]; } else { // FIXME: What should we use here? bounds = aRect; } } else { bounds = aRect; } nup = [[dict objectForKey: NSPrintPagesPerSheet] intValue]; if (nup > 1) { int page; float xoff, yoff; float scale; DPSPrintf(ctxt, "/__GSpagesaveobject save def\n"); scale = [[dict objectForKey: @"NSNupScale"] floatValue]; page = [printOp currentPage] - [[dict objectForKey: NSPrintFirstPage] intValue]; page = page % nup; if (nup == 2) xoff = page; else xoff = (page % (nup/2)); xoff *= NSWidth(bounds) * scale; if (nup == 2) yoff = 0; else yoff = (int)((nup-page-1) / (nup/2)); yoff *= NSHeight(bounds) * scale; DPStranslate(ctxt, xoff, yoff); DPSgsave(ctxt); DPSscale(ctxt, scale, scale); } else { DPSgsave(ctxt); } /* Translate to placement */ if ((location.x != 0 || location.y != 0) && NSIsEmptyRect(aRect) == YES) DPStranslate(ctxt, location.x, location.y); // FIXME: Need to place this correctly. Maybe it isn't needed at all, // as all drawing happens in displayRectIgnoringOpacity: // [self lockFocusIfCanDrawInContext: ctxt]; } - (void) _endSheet { NSPrintOperation *printOp = [NSPrintOperation currentOperation]; NSGraphicsContext *ctxt = [printOp context]; [ctxt endSheet]; } - (void) endDocument { int first, last, current, pages; NSPrintOperation *printOp = [NSPrintOperation currentOperation]; NSGraphicsContext *ctxt = [printOp context]; NSDictionary *dict = [[printOp printInfo] dictionary]; first = [[dict objectForKey: NSPrintFirstPage] intValue]; last = [[dict objectForKey: NSPrintLastPage] intValue]; pages = last - first + 1; [self beginTrailer]; if (pages == 0) { int nup = [[dict objectForKey: NSPrintPagesPerSheet] intValue]; current = [printOp currentPage]; pages = current - first; // Current is 1 more than the last page if (nup > 1) pages = ceil((float)pages / nup); } else { // Already reported at start of document pages = 0; } [ctxt endDocumentPages: pages documentFonts: [ctxt usedFonts]]; [self endTrailer]; [self _invalidateCoordinates]; viewIsPrinting = nil; } /* An exception occured while printing. Clean up */ - (void) _cleanupPrinting { [self _invalidateCoordinates]; viewIsPrinting = nil; } /* * NSCoding protocol */ - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { NSUInteger vFlags = 0; // encoding [aCoder encodeConditionalObject: [self nextKeyView] forKey: @"NSNextKeyView"]; [aCoder encodeConditionalObject: [self previousKeyView] forKey: @"NSPreviousKeyView"]; [aCoder encodeObject: _sub_views forKey: @"NSSubviews"]; [aCoder encodeRect: _frame forKey: @"NSFrame"]; // autosizing masks. vFlags = _autoresizingMask; // add the autoresize flag. if (_autoresizes_subviews) { vFlags |= 0x100; } // add the hidden flag if (_is_hidden) { vFlags |= 0x80000000; } [aCoder encodeInt: vFlags forKey: @"NSvFlags"]; // // Don't attempt to archive the superview of a view which is the // content view for a window. // if (([[self window] contentView] != self) && _super_view != nil) { [aCoder encodeConditionalObject: _super_view forKey: @"NSSuperview"]; } } else { NSDebugLLog(@"NSView", @"NSView: start encoding\n"); [super encodeWithCoder: aCoder]; [aCoder encodeRect: _frame]; [aCoder encodeRect: _bounds]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_is_rotated_from_base]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_is_rotated_or_scaled_from_base]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_post_frame_changes]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_autoresizes_subviews]; [aCoder encodeValueOfObjCType: @encode(NSUInteger) at: &_autoresizingMask]; [aCoder encodeConditionalObject: [self nextKeyView]]; [aCoder encodeConditionalObject: [self previousKeyView]]; [aCoder encodeObject: _sub_views]; NSDebugLLog(@"NSView", @"NSView: finish encoding\n"); } } - (id) initWithCoder: (NSCoder*)aDecoder { NSEnumerator *e; NSView *sub; NSArray *subs; // decode the superclass... self = [super initWithCoder: aDecoder]; if (!self) return nil; // initialize these here, since they're needed in either case. // _frameMatrix = [NSAffineTransform new]; // Map fromsuperview to frame // _boundsMatrix = [NSAffineTransform new]; // Map from superview to bounds _matrixToWindow = [NSAffineTransform new]; // Map to window coordinates _matrixFromWindow = [NSAffineTransform new];// Map from window coordinates if ([aDecoder allowsKeyedCoding]) { NSView *prevKeyView = nil; NSView *nextKeyView = nil; if ([aDecoder containsValueForKey: @"NSFrame"]) { _frame = [aDecoder decodeRectForKey: @"NSFrame"]; } else { _frame = NSZeroRect; if ([aDecoder containsValueForKey: @"NSFrameSize"]) { _frame.size = [aDecoder decodeSizeForKey: @"NSFrameSize"]; } } // Set bounds rectangle _bounds.origin = NSZeroPoint; _bounds.size = _frame.size; if ([aDecoder containsValueForKey: @"NSBounds"]) { [self setBounds: [aDecoder decodeRectForKey: @"NSBounds"]]; } _sub_views = [NSMutableArray new]; _tracking_rects = [NSMutableArray new]; _cursor_rects = [NSMutableArray new]; _is_rotated_from_base = NO; _is_rotated_or_scaled_from_base = NO; _rFlags.needs_display = YES; _post_bounds_changes = YES; _post_frame_changes = YES; _autoresizes_subviews = YES; _autoresizingMask = NSViewNotSizable; _coordinates_valid = NO; /* * Note: don't zero _nextKeyView and _previousKeyView, as the key view * chain may already have been established by super's initWithCoder: * * _nextKeyView = 0; * _previousKeyView = 0; */ // previous and next key views... prevKeyView = [aDecoder decodeObjectForKey: @"NSPreviousKeyView"]; nextKeyView = [aDecoder decodeObjectForKey: @"NSNextKeyView"]; if (nextKeyView != nil) { [self setNextKeyView: nextKeyView]; } if (prevKeyView != nil) { [self setPreviousKeyView: prevKeyView]; } if ([aDecoder containsValueForKey: @"NSvFlags"]) { NSUInteger vFlags = [aDecoder decodeIntForKey: @"NSvFlags"]; // We are lucky here, Apple use the same constants // in the lower bits of the flags [self setAutoresizingMask: vFlags & 0x3F]; [self setAutoresizesSubviews: ((vFlags & 0x100) == 0x100)]; [self setHidden: ((vFlags & 0x80000000) == 0x80000000)]; } // iterate over subviews and put them into the view... subs = [aDecoder decodeObjectForKey: @"NSSubviews"]; e = [subs objectEnumerator]; while ((sub = [e nextObject]) != nil) { NSAssert([sub class] != [NSCustomView class], NSInternalInconsistencyException); NSAssert([sub window] == nil, NSInternalInconsistencyException); NSAssert([sub superview] == nil, NSInternalInconsistencyException); [sub _viewWillMoveToWindow: _window]; [sub _viewWillMoveToSuperview: self]; [sub setNextResponder: self]; [_sub_views addObject: sub]; _rFlags.has_subviews = 1; [sub resetCursorRects]; [sub setNeedsDisplay: YES]; [sub _viewDidMoveToWindow]; [sub viewDidMoveToSuperview]; [self didAddSubview: sub]; } // the superview... //[aDecoder decodeObjectForKey: @"NSSuperview"]; } else { NSRect rect; NSDebugLLog(@"NSView", @"NSView: start decoding\n"); _frame = [aDecoder decodeRect]; _bounds.origin = NSZeroPoint; _bounds.size = _frame.size; rect = [aDecoder decodeRect]; [self setBounds: rect]; _sub_views = [NSMutableArray new]; _tracking_rects = [NSMutableArray new]; _cursor_rects = [NSMutableArray new]; _super_view = nil; _window = nil; _rFlags.needs_display = YES; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_is_rotated_from_base]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_is_rotated_or_scaled_from_base]; _post_bounds_changes = YES; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_post_frame_changes]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_autoresizes_subviews]; [aDecoder decodeValueOfObjCType: @encode(NSUInteger) at: &_autoresizingMask]; _coordinates_valid = NO; [self setNextKeyView: [aDecoder decodeObject]]; [[aDecoder decodeObject] setNextKeyView: self]; [aDecoder decodeValueOfObjCType: @encode(id) at: &subs]; NSDebugLLog(@"NSView", @"NSView: finish decoding\n"); // iterate over subviews and put them into the view... e = [subs objectEnumerator]; while ((sub = [e nextObject]) != nil) { NSAssert([sub window] == nil, NSInternalInconsistencyException); NSAssert([sub superview] == nil, NSInternalInconsistencyException); [sub _viewWillMoveToWindow: _window]; [sub _viewWillMoveToSuperview: self]; [sub setNextResponder: self]; [_sub_views addObject: sub]; _rFlags.has_subviews = 1; [sub resetCursorRects]; [sub setNeedsDisplay: YES]; [sub _viewDidMoveToWindow]; [sub viewDidMoveToSuperview]; [self didAddSubview: sub]; } RELEASE(subs); } return self; } /* * Accessor methods */ - (void) setAutoresizesSubviews: (BOOL)flag { _autoresizes_subviews = flag; } - (void) setAutoresizingMask: (NSUInteger)mask { _autoresizingMask = mask; } /** Returns the window in which the receiver resides. */ - (NSWindow*) window { return _window; } - (BOOL) autoresizesSubviews { return _autoresizes_subviews; } - (NSUInteger) autoresizingMask { return _autoresizingMask; } - (NSArray*) subviews { /* * Return a mutable copy 'cos we know that a mutable copy of an array or * a mutable array does a shallow copy - which is what we want to give * away - we don't want people to mess with our actual subviews array. */ return AUTORELEASE([_sub_views mutableCopyWithZone: NSDefaultMallocZone()]); } - (NSView*) superview { return _super_view; } - (BOOL) shouldDrawColor { return YES; } - (BOOL) isOpaque { return NO; } - (BOOL) needsDisplay { return _rFlags.needs_display; } - (NSInteger) tag { return -1; } - (BOOL) isFlipped { return NO; } - (NSRect) bounds { return _bounds; } - (NSRect) frame { return _frame; } - (CGFloat) boundsRotation { if (_boundsMatrix != nil) { return [_boundsMatrix rotationAngle]; } return 0.0; } - (CGFloat) frameRotation { if (_frameMatrix != nil) { return [_frameMatrix rotationAngle]; } return 0.0; } /** * Returns whether the receiver posts NSViewFrameDidChangeNotification when * its frame changed. * * Returns YES by default (as documented in Cocoa View Programming Guide). */ - (BOOL) postsFrameChangedNotifications { return _post_frame_changes; } /** * Returns whether the receiver posts NSViewBoundsDidChangeNotification when * its bound changed. * * Returns YES by default (as documented in Cocoa View Programming Guide). */ - (BOOL) postsBoundsChangedNotifications { return _post_bounds_changes; } /** *

Returns the default menu to be used for instances of the * current class; if no menu has been set through setMenu: * this default menu will be used. *

*

NSView's implementation returns nil. You should override * this method if you want all instances of your custom view * to use the same menu. *

*/ + (NSMenu *)defaultMenu { return nil; } /** *

NSResponder's method, overriden by NSView.

*

If no menu has been set through the use of setMenu:, or * if a nil value has been set through setMenu:, then the * value returned by defaultMenu is used. Otherwise this * method returns the menu set through NSResponder. *

*

see [NSResponder -menu], [NSResponder -setMenu:], * [NSView +defaultMenu] and [NSView -menuForEvent:]. *

*/ - (NSMenu *)menu { NSMenu *m = [super menu]; if (m) { return m; } else { return [[self class] defaultMenu]; } } /** *

Returns the menu that it appropriates for the given * event. NSView's implementation returns the default menu of * the view.

*

This methods is intended to be overriden so that it can * return a context-sensitive for appropriate mouse's events. ( * (although it seems it can be used for any kind of event)

*

This method is used by NSView's rightMouseDown: method, * and the returned NSMenu is displayed as a context menu

*

Use of this method is discouraged in GNUstep as it breaks many * user interface guidelines. At the very least, menu items that appear * in a context sensitive menu should also always appear in a normal * menu. Otherwise, users are faced with an inconsistant interface where * the menu items they want are only available in certain (possibly * unknown) cases, making it difficult for the user to understand how * the application operates

*

see [NSResponder -menu], [NSResponder -setMenu:], * [NSView +defaultMenu] and [NSView -menu]. *

*/ - (NSMenu *)menuForEvent: (NSEvent *)theEvent { return [self menu]; } /* * Tool Tips */ - (NSToolTipTag) addToolTipRect: (NSRect)aRect owner: (id)anObject userData: (void *)data { GSToolTips *tt = [GSToolTips tipsForView: self]; _rFlags.has_tooltips = 1; return [tt addToolTipRect: aRect owner: anObject userData: data]; } - (void) removeAllToolTips { if (_rFlags.has_tooltips == 1) { GSToolTips *tt = [GSToolTips tipsForView: self]; [tt removeAllToolTips]; } } - (void) removeToolTip: (NSToolTipTag)tag { if (_rFlags.has_tooltips == 1) { GSToolTips *tt = [GSToolTips tipsForView: self]; [tt removeToolTip: tag]; } } - (void) setToolTip: (NSString *)string { if (_rFlags.has_tooltips == 1 || [string length] > 0) { GSToolTips *tt = [GSToolTips tipsForView: self]; _rFlags.has_tooltips = 1; [tt setToolTip: string]; } } - (NSString *) toolTip { if (_rFlags.has_tooltips == 1) { GSToolTips *tt = [GSToolTips tipsForView: self]; return [tt toolTip]; } return nil; } - (void) rightMouseDown: (NSEvent *) theEvent { NSMenu *m; m = [self menuForEvent: theEvent]; if (m) { [NSMenu popUpContextMenu: m withEvent: theEvent forView: self]; } else { [super rightMouseDown: theEvent]; } } - (BOOL) shouldBeTreatedAsInkEvent: (NSEvent *)theEvent { return YES; } - (void) bind: (NSString *)binding toObject: (id)anObject withKeyPath: (NSString *)keyPath options: (NSDictionary *)options { if ([binding hasPrefix: NSHiddenBinding]) { GSKeyValueBinding *kvb; [self unbind: binding]; kvb = [[GSKeyValueOrBinding alloc] initWithBinding: NSHiddenBinding withName: binding toObject: anObject withKeyPath: keyPath options: options fromObject: self]; // The binding will be retained in the binding table RELEASE(kvb); } else { [super bind: binding toObject: anObject withKeyPath: keyPath options: options]; } } @end @implementation NSView(KeyViewLoop) static NSComparisonResult cmpFrame(id view1, id view2, void *context) { BOOL flippedSuperView = [(NSView *)context isFlipped]; NSRect frame1 = [view1 frame]; NSRect frame2 = [view2 frame]; if (NSMinY(frame1) < NSMinY(frame2)) return flippedSuperView ? NSOrderedAscending : NSOrderedDescending; if (NSMaxY(frame1) > NSMaxY(frame2)) return flippedSuperView ? NSOrderedDescending : NSOrderedAscending; // FIXME Should use NSMaxX in a Hebrew or Arabic locale if (NSMinX(frame1) < NSMinX(frame2)) return NSOrderedAscending; if (NSMinX(frame1) > NSMinX(frame2)) return NSOrderedDescending; return NSOrderedSame; } - (void) _setUpKeyViewLoopWithNextKeyView: (NSView *)nextKeyView { if (_rFlags.has_subviews) { [self _recursiveSetUpKeyViewLoopWithNextKeyView: nextKeyView]; } else { [self setNextKeyView: nextKeyView]; } } - (void) _recursiveSetUpKeyViewLoopWithNextKeyView: (NSView *)nextKeyView { NSArray *sortedViews; NSView *aView; NSEnumerator *e; sortedViews = [_sub_views sortedArrayUsingFunction: cmpFrame context: self]; e = [sortedViews reverseObjectEnumerator]; while ((aView = [e nextObject]) != nil) { [aView _setUpKeyViewLoopWithNextKeyView: nextKeyView]; nextKeyView = aView; } [self setNextKeyView: nextKeyView]; } @end gnustep-gui-0.24.0/Source/NSToolbarItemGroup.m0000664000076500007650000000306311534147002021056 0ustar brains99brains99/* NSToolbarItemGroup.h The toolbar item group class. Copyright (C) 2008 Free Software Foundation, Inc. Author: Fred Kiefer Date: Dec 2008 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import "AppKit/NSToolbarItemGroup.h" @implementation NSToolbarItemGroup // FIXME: Most of the implementation is missing. - (void) setSubitems: (NSArray *)items { ASSIGN(_subitems, items); } - (NSArray *) subitems { return _subitems; } - (void) dealloc { RELEASE(_subitems); [super dealloc]; } // NSCopying protocol - (id) copyWithZone: (NSZone *)zone { NSToolbarItemGroup *new = (NSToolbarItemGroup *)[super copyWithZone: zone]; [new setSubitems: [self subitems]]; return new; } @end gnustep-gui-0.24.0/Source/GSVbox.m0000664000076500007650000001063011537516710016536 0ustar brains99brains99/** GSVbox The GSVbox class (a GNU extension) Copyright (C) 1999-2010 Free Software Foundation, Inc. Author: Nicola Pero Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ // See GSHbox.m for comments // This file is derived from GSVbox.m #import "GNUstepGUI/GSVbox.h" #import "AppKit/NSBox.h" @implementation GSVbox: GSTable // // Class methods // +(void) initialize { if (self == [GSVbox class]) [self setVersion: 1]; } // // Instance Methods // -(id) init { self = [super initWithNumberOfRows: 1 numberOfColumns: 1]; if (nil == self) return nil; _haveViews = NO; _defaultMinYMargin = 0; return self; } -(void) dealloc { [super dealloc]; } // // Adding Views // -(void) addView: (NSView *)aView { [self addView: aView enablingYResizing: YES withMinYMargin: _defaultMinYMargin]; } -(void) addView: (NSView *)aView enablingYResizing: (BOOL)aFlag { [self addView: aView enablingYResizing: aFlag withMinYMargin: _defaultMinYMargin]; } -(void) addView: (NSView *)aView withMinYMargin: (float) aMargin { [self addView: aView enablingYResizing: YES withMinYMargin: aMargin]; } -(void) addView: (NSView *)aView enablingYResizing: (BOOL)aFlag withMinYMargin: (float)aMargin { if (_haveViews) { int entries = _numberOfRows; [super addRow]; [super setYResizingEnabled: aFlag forRow: entries]; [super putView: aView atRow: entries column: 0 withMinXMargin: 0 maxXMargin: 0 minYMargin: aMargin maxYMargin: 0]; } else // !_haveViews { [super setYResizingEnabled: aFlag forRow: 0]; [super putView: aView atRow: 0 column: 0 withMinXMargin: 0 maxXMargin: 0 minYMargin: 0 maxYMargin: 0]; _haveViews = YES; } } // // Adding a Separator // -(void) addSeparator { [self addSeparatorWithMinYMargin: _defaultMinYMargin]; } -(void) addSeparatorWithMinYMargin: (float)aMargin { NSBox *separator; separator = [[NSBox alloc] initWithFrame: NSMakeRect (0, 0, 2, 2)]; [separator setAutoresizingMask: (NSViewWidthSizable | NSViewMinYMargin | NSViewMaxYMargin)]; [separator setTitlePosition: NSNoTitle]; [separator setBorderType: NSGrooveBorder]; [self addView: separator enablingYResizing: NO withMinYMargin: aMargin]; [separator release]; } // // Setting Margins // -(void) setDefaultMinYMargin: (float)aMargin { _defaultMinYMargin = aMargin; } // // Getting the number of Entries // -(int) numberOfViews { if (_haveViews) return _numberOfRows; else return 0; } // // NSCoding protocol // -(void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { [aCoder encodeBool: _haveViews forKey: @"GSHaveViews"]; [aCoder encodeFloat: _defaultMinYMargin forKey: @"GSDefaultMinYMargin"]; } else { [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_haveViews]; [aCoder encodeValueOfObjCType: @encode(float) at: &_defaultMinYMargin]; } } -(id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if (nil == self) return nil; if ([aDecoder allowsKeyedCoding]) { _haveViews = [aDecoder decodeBoolForKey: @"GSHaveViews"]; _defaultMinYMargin = [aDecoder decodeFloatForKey: @"GSDefaultMinYMargin"]; } else { [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_haveViews]; [aDecoder decodeValueOfObjCType: @encode(float) at: &_defaultMinYMargin]; } return self; } @end gnustep-gui-0.24.0/Source/NSRulerMarker.m0000664000076500007650000003670112121417516020063 0ustar brains99brains99/** NSRulerMarker Displays a symbol in a NSRulerView. Copyright (C) 2001 Free Software Foundation, Inc. Author: Fred Kiefer Date: Sept 2001 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import "AppKit/NSRulerMarker.h" #import "AppKit/NSRulerView.h" #import "AppKit/NSEvent.h" #import "AppKit/NSImage.h" #import "AppKit/NSApplication.h" #import "AppKit/NSWindow.h" #import "AppKit/NSCursor.h" @implementation NSRulerMarker - (id)initWithRulerView:(NSRulerView *)aRulerView markerLocation:(CGFloat)location image:(NSImage *)anImage imageOrigin:(NSPoint)imageOrigin { if (aRulerView == nil || anImage == nil) [NSException raise: NSInvalidArgumentException format: @"No view or image for ruler marker"]; self = [super init]; _isMovable = YES; _isRemovable = NO; _location = location; _imageOrigin = imageOrigin; _rulerView = aRulerView; ASSIGN(_image, anImage); return self; } - (void) dealloc { RELEASE(_image); TEST_RELEASE(_representedObject); [super dealloc]; } - (NSRulerView *)ruler { return _rulerView; } - (void)setImage:(NSImage *)anImage { ASSIGN(_image, anImage); } - (NSImage *)image { return _image; } - (void)setImageOrigin:(NSPoint)aPoint { _imageOrigin = aPoint; } - (NSPoint)imageOrigin { return _imageOrigin; } - (NSRect)imageRectInRuler { BOOL flipped = [_rulerView isFlipped]; NSSize size = [_image size]; NSPoint pointInRuler; pointInRuler = [[_rulerView clientView] convertPoint: NSMakePoint(_location, _location) toView: _rulerView]; if ([_rulerView orientation] == NSHorizontalRuler) { if (flipped) { return NSMakeRect(pointInRuler.x - _imageOrigin.x, [_rulerView baselineLocation] - (size.height - _imageOrigin.y), size.width, size.height); } else { return NSMakeRect(pointInRuler.x - _imageOrigin.x, [_rulerView baselineLocation] - _imageOrigin.y, size.width, size.height); } } else { if (flipped) { return NSMakeRect([_rulerView baselineLocation] - _imageOrigin.x, pointInRuler.y - (size.height - _imageOrigin.y), size.width, size.height); } else { return NSMakeRect([_rulerView baselineLocation] - _imageOrigin.x, pointInRuler.y - _imageOrigin.y, size.width, size.height); } } return NSZeroRect; } - (CGFloat)thicknessRequiredInRuler { NSSize size = [_image size]; if ([_rulerView orientation] == NSHorizontalRuler) { /* what is below imageOrigin is on the ruler area and is not counted */ return size.height - _imageOrigin.y; } else { /* what is to the right of imageOrigin is on the ruler area */ return _imageOrigin.x; } } - (void)setMovable:(BOOL)flag { _isMovable = flag; } - (BOOL)isMovable { return _isMovable; } - (void)setRemovable:(BOOL)flag { _isRemovable = flag; } - (BOOL)isRemovable { return _isRemovable; } - (void)setMarkerLocation:(CGFloat)location { _location = location; } - (CGFloat)markerLocation { return _location; } - (void)setRepresentedObject:(id )anObject { ASSIGN(_representedObject, (id)anObject); } - (id )representedObject { return _representedObject; } - (void)drawRect:(NSRect)aRect { NSPoint aPoint; NSRect rect; /* do not draw when dragging, all drawing is done in -trackMouse... */ if (_isDragging) { return; } rect = [self imageRectInRuler]; aPoint = rect.origin; if ([_rulerView isFlipped]) { aPoint.y += rect.size.height; } rect = NSIntersectionRect(aRect, rect); if (NSIsEmptyRect(rect)) return; [_image compositeToPoint: aPoint operation: NSCompositeSourceOver]; } - (BOOL)isDragging { return _isDragging; } - (BOOL)trackMouse:(NSEvent *)theEvent adding:(BOOL)adding { NSView *client = [_rulerView clientView]; NSEvent *newEvent = nil; NSUInteger eventMask = NSLeftMouseDraggedMask | NSLeftMouseUpMask; BOOL isFar = NO; BOOL askedCanRemove = NO; BOOL canRemove = NO; BOOL flipped; NSPoint mousePositionInRuler; NSPoint mousePositionInClient; NSPoint mousePositionInWindow; NSPoint previousMousePositionInWindow; NSPoint mouseOffset; CGFloat location; NSRect drawRect; NSRect bounds = [_rulerView bounds]; NSPoint drawPoint; BOOL returnValue = NO; NSWindow *window; if (adding) { if ([client respondsToSelector: @selector(rulerView:shouldAddMarker:)] && [client rulerView: _rulerView shouldAddMarker: self] == NO) return NO; } else if (!_isMovable && !_isRemovable) { return NO; } else if (_isMovable && [client respondsToSelector: @selector(rulerView:shouldMoveMarker:)] && [client rulerView: _rulerView shouldMoveMarker: self] == NO) { return NO; } // I'm being dragged! _isDragging = YES; RETAIN(self); // make sure we're not dealloc'd if removed from ruler [NSCursor hide]; [_rulerView lockFocus]; /* cache some values */ flipped = [_rulerView isFlipped]; window = [_rulerView window]; mousePositionInWindow = [theEvent locationInWindow]; previousMousePositionInWindow = mousePositionInWindow; mousePositionInRuler = [_rulerView convertPoint: mousePositionInWindow fromView: nil]; /* calculate offset of mouse click relative to marker's location (to avoid marker bumping when dragging starts) */ if (adding) { mouseOffset = NSMakePoint(0, 0); } else { NSPoint locationInRuler; locationInRuler = [client convertPoint: NSMakePoint(_location, _location) toView: _rulerView]; if ([_rulerView orientation] == NSHorizontalRuler) { mouseOffset = NSMakePoint(locationInRuler.x - mousePositionInRuler.x, 0); } else { mouseOffset = NSMakePoint(0, locationInRuler.y - mousePositionInRuler.y); if (flipped) { mouseOffset.y *= -1; } } } /* cache image without marker and draw marker in position */ if (adding) { /* marker is not drawn yet; mouse is in marker's imageOrigin */ drawRect.size = [_image size]; drawPoint.x = mousePositionInRuler.x - _imageOrigin.x; if (!flipped) { drawPoint.y = mousePositionInRuler.y - _imageOrigin.y; drawRect.origin = drawPoint; } else { drawPoint.y = mousePositionInRuler.y + _imageOrigin.y; drawRect.origin.x = drawPoint.x; drawRect.origin.y = drawPoint.y - drawRect.size.height; } } else { drawRect = [self imageRectInRuler]; drawPoint = drawRect.origin; if (flipped) { drawPoint.y += drawRect.size.height; } /* make marker disappear (-drawRect: does not draw marker when dragged) */ [_rulerView drawRect: drawRect]; } [window cacheImageInRect: [_rulerView convertRect: drawRect toView: nil]]; [_image compositeToPoint: drawPoint operation: NSCompositeSourceOver]; [window flushWindow]; /* loop processing events until mouse up */ while (_isDragging) { if(newEvent == nil) { newEvent = theEvent; previousMousePositionInWindow = NSMakePoint(0,0); } else { newEvent = [NSApp nextEventMatchingMask: eventMask untilDate: [NSDate distantFuture] inMode: NSEventTrackingRunLoopMode dequeue: YES]; } switch ([newEvent type]) { case NSLeftMouseDown: case NSLeftMouseDragged: /* take mouse position from outside of event stream and ignore event if in same position as previous event, to reduce the number of events to process */ mousePositionInWindow = [window mouseLocationOutsideOfEventStream]; if (NSEqualPoints(mousePositionInWindow, previousMousePositionInWindow)) { break; } previousMousePositionInWindow = mousePositionInWindow; /* offset mouse position to marker's location */ mousePositionInWindow.x += mouseOffset.x; mousePositionInWindow.y += mouseOffset.y; /* see if mouse is far from ruler area (to remove marker) */ mousePositionInRuler = [_rulerView convertPoint: mousePositionInWindow fromView: nil]; isFar = !NSMouseInRect(mousePositionInRuler, bounds, flipped); /* if it is the first time it's far from the ruler area, see if it can be removed */ if (isFar && !askedCanRemove) { if (adding) { canRemove = YES; } else if (!_isRemovable) { canRemove = NO; } else if ([client respondsToSelector: @selector(rulerView:shouldRemoveMarker:)]) { canRemove = [client rulerView: _rulerView shouldRemoveMarker: self]; } else { canRemove = YES; } askedCanRemove = YES; } /* calculate new marker location */ mousePositionInClient = [client convertPoint: mousePositionInWindow fromView: nil]; if ([_rulerView orientation] == NSHorizontalRuler) { location = mousePositionInClient.x; } else { location = mousePositionInClient.y; } /* give client a chance to change location */ if (adding && !isFar) { if ([client respondsToSelector: @selector(rulerView:willAddMarker:atLocation:)]) { location = [client rulerView: _rulerView willAddMarker: self atLocation: location]; } } else if (_isMovable && !(isFar && canRemove)) { if ([client respondsToSelector: @selector(rulerView:willMoveMarker:toLocation:)]) { location = [client rulerView: _rulerView willMoveMarker: self toLocation: location]; } } _location = location; /* calculate position to draw marker */ drawRect = [self imageRectInRuler]; drawPoint = drawRect.origin; if (flipped) { drawPoint.y += drawRect.size.height; } if (isFar && canRemove) { if ([_rulerView orientation] == NSHorizontalRuler) { float offset; offset = mousePositionInRuler.y - [_rulerView baselineLocation]; drawPoint.y += offset; drawRect.origin.y += offset; } else { float offset; offset = mousePositionInRuler.x - [_rulerView baselineLocation]; drawPoint.x += offset; drawRect.origin.x += offset; } } /* undraw marker and redraw in new position */ [window restoreCachedImage]; [window cacheImageInRect: [_rulerView convertRect: drawRect toView: nil]]; [_image compositeToPoint: drawPoint operation: NSCompositeSourceOver]; [window flushWindow]; break; case NSLeftMouseUp: if (adding) { if (isFar) { /* do nothing, it won't be added */ [window restoreCachedImage]; returnValue = NO; } else { /* marker is added to ruler view; inform client */ [window discardCachedImage]; [_rulerView addMarker:self]; if ([client respondsToSelector: @selector(rulerView:didAddMarker:)]) { [client rulerView: _rulerView didAddMarker: self]; } returnValue = YES; } } else { if (isFar && _isRemovable && canRemove) { /* remove marker from ruler and inform client */ /* this could result in marker being dealloc'd; that's why there is a retain before the loop */ [window restoreCachedImage]; [_rulerView removeMarker:self]; if ([client respondsToSelector: @selector(rulerView:didRemoveMarker:)]) { [client rulerView: _rulerView didRemoveMarker: self]; } returnValue = YES; } else if (_isMovable) { /* inform client that marker has been moved */ [window discardCachedImage]; if ([client respondsToSelector: @selector(rulerView:didMoveMarker:)]) { [client rulerView: _rulerView didMoveMarker: self]; } returnValue = YES; } else { [window restoreCachedImage]; returnValue = NO; } } _isDragging = NO; break; default: break; } } [_rulerView unlockFocus]; [NSCursor unhide]; [window flushWindow]; RELEASE(self); // was retained when dragging started return returnValue; } // NSCopying protocol - (id) copyWithZone: (NSZone*)zone { NSRulerMarker *new = (NSRulerMarker*)NSCopyObject (self, 0, zone); new->_image = [_image copyWithZone: zone]; new->_isDragging = NO; return new; } // NSCoding protocol - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { // FIXME } else { [aCoder encodeObject: _rulerView]; [aCoder encodeObject: _image]; [aCoder encodeConditionalObject: _representedObject]; [aCoder encodePoint: _imageOrigin]; [aCoder encodeValueOfObjCType: @encode(CGFloat) at: &_location]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isMovable]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isRemovable]; } } - (id) initWithCoder: (NSCoder*)aDecoder { if ([aDecoder allowsKeyedCoding]) { // FIXME } else { _rulerView = [aDecoder decodeObject]; _image = [aDecoder decodeObject]; _representedObject = [aDecoder decodeObject]; _imageOrigin = [aDecoder decodePoint]; [aDecoder decodeValueOfObjCType: @encode(CGFloat) at: &_location]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isMovable]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isRemovable]; } return self; } // NSObject protocol @end gnustep-gui-0.24.0/Source/NSApplication.m0000664000076500007650000035076312135015226020077 0ustar brains99brains99/** NSApplication The one and only application class. Copyright (C) 1996,1999 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Felipe A. Rodriguez Date: August 1998 Author: Richard Frith-Macdonald Date: December 1998 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #include #include #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #ifndef LIB_FOUNDATION_LIBRARY #import #endif #import "AppKit/AppKitExceptions.h" #import "AppKit/NSAlert.h" #import "AppKit/NSApplication.h" #import "AppKit/NSCell.h" #import "AppKit/NSCursor.h" #import "AppKit/NSDocumentController.h" #import "AppKit/NSEvent.h" #import "AppKit/NSFontManager.h" #import "AppKit/NSImage.h" #import "AppKit/NSMenu.h" #import "AppKit/NSMenuItem.h" #import "AppKit/NSNibLoading.h" #import "AppKit/NSPageLayout.h" #import "AppKit/NSPanel.h" #import "AppKit/NSPasteboard.h" #import "AppKit/NSToolbarItem.h" #import "AppKit/NSWorkspace.h" #import "AppKit/NSScreen.h" #import "AppKit/PSOperators.h" #import "GSIconManager.h" #import "GNUstepGUI/GSDisplayServer.h" #import "GNUstepGUI/GSServicesManager.h" #import "GSGuiPrivate.h" #import "GNUstepGUI/GSInfoPanel.h" #import "GNUstepGUI/GSVersion.h" #import "NSDocumentFrameworkPrivate.h" #import "NSToolbarFrameworkPrivate.h" // minimize icon when suppressed? #define MINI_ICON 0 /* The -gui thread. See the comment in initialize_gnustep_backend. */ NSThread *GSAppKitThread; /* Notifications used to implement hide and unhide functionality. */ static NSString *GSHideOtherApplicationsNotification = @"GSHideOtherApplicationsNotification"; static NSString *GSUnhideAllApplicationsNotification = @"GSUnhideAllApplicationsNotification"; /* * Base library exception handler */ static NSUncaughtExceptionHandler *defaultUncaughtExceptionHandler; /* * Gui library user friendly exception handler */ static void _NSAppKitUncaughtExceptionHandler (NSException *exception) { NSInteger retVal; /* Reset the exception handler to the Base library's one, to prevent recursive calls to the gui one. */ NSSetUncaughtExceptionHandler(defaultUncaughtExceptionHandler); /* * If there is no graphics context to run the alert panel in or * its a severe error, use a non-graphical exception handler */ if (GSCurrentContext() == nil || [[exception name] isEqual: NSWindowServerCommunicationException] || [[exception name] isEqual: GSWindowServerInternalException]) { /* The following will raise again the exception using the base library exception handler */ [exception raise]; } retVal = GSRunExceptionPanel ([NSString stringWithFormat: _(@"Critical Error in %@"), [[NSProcessInfo processInfo] processName]], exception, _(@"Abort"), nil, #ifdef DEBUG _(@"Debug")); #else nil); #endif /* The user wants to abort */ if (retVal == NSAlertDefault) { /* The following will raise again the exception using the base library exception handler */ [exception raise]; } else { /* Debug button: abort so we can trace the error in gdb */ abort(); } } /* Get the bundle. */ NSBundle * GSGuiBundle(void) { /* This is the bundle from where we load localization of messages. */ static NSBundle *guiBundle = nil; if (!guiBundle) { /* Create the gui bundle we use to localize messages. */ guiBundle = [NSBundle bundleForLibrary: @"gnustep-gui" version: OBJC_STRINGIFY(GNUSTEP_GUI_MAJOR_VERSION.GNUSTEP_GUI_MINOR_VERSION)]; RETAIN(guiBundle); } return guiBundle; } @interface GSBackend : NSObject {} + (void) initializeBackend; @end static NSString * gnustep_backend_path(NSString *dir, NSString *name) { NSString *path; NSEnumerator *benum; NSDebugFLLog(@"BackendBundle", @"Looking for %@", name); /* Find the backend framework */ benum = [NSStandardLibraryPaths() objectEnumerator]; while ((path = [benum nextObject])) { path = [path stringByAppendingPathComponent: dir]; path = [path stringByAppendingPathComponent: name]; if ([[NSFileManager defaultManager] fileExistsAtPath: path]) { break; } } return path; } /* Find and load the backend framework, if there is one. The name is taken from a user default containing the name of the backend framework, such as 'GNUstep-back', or simply 'back', or for historical reasons, 'libgnustep-back'. */ static NSString * gnustep_backend_framework(NSString *bundleName) { if (bundleName == nil) bundleName = @"GNUstep_back.framework"; else { if ([bundleName hasPrefix: @"GNUstep-"]) bundleName = [bundleName stringByAppendingString: @".framework"]; else { if ([bundleName hasPrefix: @"libgnustep-"]) { bundleName = [bundleName substringFromIndex: [@"libgnustep-" length]]; } bundleName = [NSString stringWithFormat: @"GNUstep-%@.framework", bundleName]; } } return gnustep_backend_path(@"Frameworks", bundleName); } /* Find and load the backend bundle, if there is one. The name is taken from a user default containing the name of the backend bundle, such as 'back', or for historical reasons, 'libgnustep-back'. New versions may also have a version number associated with it. */ static NSString * gnustep_backend_bundle(NSString *bundleName) { NSString *path, *bundleWithVersion; int version = GNUSTEP_GUI_MAJOR_VERSION * 100 + GNUSTEP_GUI_MINOR_VERSION; if (bundleName == nil) { bundleName = @"libgnustep-back"; } else { if ([bundleName hasPrefix: @"libgnustep-"] == NO) { bundleName = [NSString stringWithFormat: @"libgnustep-%@", bundleName]; } } bundleWithVersion = [NSString stringWithFormat: @"%@-%03d.bundle", bundleName, version]; bundleName = [bundleName stringByAppendingString: @".bundle"]; path = gnustep_backend_path(@"Bundles", bundleWithVersion); if (path == nil) { NSLog(@"Did not find correct version of backend (%@), " @"falling back to std (%@).", bundleWithVersion, bundleName); path = gnustep_backend_path(@"Bundles", bundleName); } return path; } BOOL initialize_gnustep_backend(void) { static int first = 1; if (first) { Class backend; /* Remember which thread we are running in. This thread will be the -gui thread, ie. the only thread that may do any rendering. With the exception of a few methods explicitly marked as thread-safe, other threads should not call any methods in -gui. */ GSAppKitThread = [NSThread currentThread]; first = 0; #ifdef BACKEND_BUNDLE { NSBundle *theBundle; NSString *path, *bundleName; NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; /* What backend ? */ bundleName = [defs stringForKey: @"GSBackend"]; path = gnustep_backend_framework (bundleName); if (path == nil) { NSDebugLLog(@"BackendBundle", @"Did not find backend framework."); path = gnustep_backend_bundle (bundleName); } /* FIXME/TODO - update localized error messages. */ /* Backend found ? */ if (bundleName == nil) bundleName = @"back"; NSCAssert1(path != nil, _(@"Unable to find backend %@"), bundleName); NSDebugLog(@"Loading Backend from %@", path); NSDebugFLLog(@"BackendBundle", @"Loading Backend from %@", path); /* Create a bundle object. (Should normally succeed). */ theBundle = [NSBundle bundleWithPath: path]; NSCAssert1(theBundle != nil, _(@"Can't create NSBundle object for backend at path %@"), path); /* Now load the object file from the bundle. */ NSCAssert1 ([theBundle load], _(@"Can't load object file from backend at path %@"), path); /* Now get the GSBackend class, which should have just been loaded * from the bundle. */ backend = NSClassFromString (@"GSBackend"); NSCAssert1 (backend != Nil, _(@"Backend at path %@ doesn't contain the GSBackend class"), path); [backend initializeBackend]; } #else /* GSBackend will be in a separate library linked in with the app. This would be cleaner with ...classNamed: @"GSBackend", but that doesn't work in some cases (Mac OS X for instance). */ [GSBackend initializeBackend]; #endif } return YES; } void gsapp_user_bundles(void) { NSUserDefaults *defs=[NSUserDefaults standardUserDefaults]; NSArray *a=[defs arrayForKey: @"GSAppKitUserBundles"]; NSUInteger i, c; c = [a count]; if (a == nil || c == 0) return; NSLog(@"Loading %d user defined AppKit bundles", (int)c); for (i = 0; i < c; i++) { NSBundle *b = [NSBundle bundleWithPath: [a objectAtIndex: i]]; if (!b) { NSLog(@"* Unable to load '%@'", [a objectAtIndex: i]); continue; } NSLog(@"Loaded '%@'\n", [a objectAtIndex: i]); [[[b principalClass] alloc] init]; } } /* * Types */ struct _NSModalSession { NSInteger runState; NSInteger entryLevel; NSWindow *window; NSModalSession previous; }; @interface NSApplication (Private) - (void) _appIconInit; - (NSDictionary*) _notificationUserInfo; - (void) _openDocument: (NSString*)name; - (id) _targetForAction: (SEL)aSelector keyWindow: (NSWindow *)keyWindow mainWindow: (NSWindow *)mainWindow; - (void) _windowDidBecomeKey: (NSNotification*) notification; - (void) _windowDidBecomeMain: (NSNotification*) notification; - (void) _windowDidResignKey: (NSNotification*) notification; - (void) _windowWillClose: (NSNotification*) notification; - (void) _workspaceNotification: (NSNotification*) notification; - (NSArray *) _openFiles; - (NSMenu *) _dockMenu; @end @interface NSWindow (TitleWithRepresentedFilename) - (BOOL) _hasTitleWithRepresentedFilename; @end @interface NSWindow (ApplicationPrivate) - (void) setAttachedSheet: (id) sheet; @end @implementation NSWindow (ApplicationPrivate) /** * Associate sheet with the window it's attached to. The window is not retained. */ - (void) setAttachedSheet: (id) sheet { _attachedSheet = sheet; } @end @interface NSIconWindow : NSWindow @end @interface NSAppIconView : NSView - (void) setImage: (NSImage *)anImage; @end @interface NSMenu (HorizontalPrivate) - (void) _organizeMenu; @end /* * Class variables */ static NSEvent *null_event; static Class arpClass; static NSNotificationCenter *nc; NSApplication *NSApp = nil; @implementation NSIconWindow - (BOOL) canBecomeMainWindow { return NO; } - (BOOL) canBecomeKeyWindow { return NO; } - (BOOL) worksWhenModal { return YES; } - (void) orderWindow: (NSWindowOrderingMode)place relativeTo: (NSInteger)otherWin { if ([[NSUserDefaults standardUserDefaults] boolForKey: @"GSSuppressAppIcon"] == NO) { [super orderWindow: place relativeTo: otherWin]; } } - (void) _initDefaults { [super _initDefaults]; /* Set the title of the window to the process name. Even as the window shows no title bar, the window manager may show it. */ [self setTitle: [[NSProcessInfo processInfo] processName]]; [self setExcludedFromWindowsMenu: YES]; [self setReleasedWhenClosed: NO]; #if MINI_ICON /* Hack ... * At least one window manager won't miniaturize a window unless * it's at the standard level. If the app icon is suppressed, we * may still want a miniaturised version while the app is hidden. */ if (YES == [[NSUserDefaults standardUserDefaults] boolForKey: @"GSSuppressAppIcon"]) { return; } #endif /* App icons and mini windows are displayed at dock level by default. Yet, with the current window level mapping in -back, some window managers will order pop up and context menus behind app icons and mini windows. Therefore, it is possible to have app icons and mini windows displayed at normal window level under control of a user preference. */ // See also NSMiniWindow -_initDefaults in NSWindow.m if ([[NSUserDefaults standardUserDefaults] boolForKey: @"GSAllowWindowsOverIcons"] == YES) _windowLevel = NSDockWindowLevel; } - (void) rightMouseDown: (NSEvent *)theEvent { NSMenu *menu = nil; NSInterfaceStyle style = NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil); if (style == NSMacintoshInterfaceStyle || style == NSWindows95InterfaceStyle) { menu = [NSApp _dockMenu]; } if (menu) { [NSMenu popUpContextMenu: menu withEvent: theEvent forView: [self contentView]]; } else { [super rightMouseDown: theEvent]; } } @end @implementation NSAppIconView // Class variables static NSCell* dragCell = nil; static NSCell* tileCell = nil; static NSSize scaledIconSizeForSize(NSSize imageSize) { NSSize iconSize, retSize; iconSize = GSGetIconSize(); retSize.width = imageSize.width * iconSize.width / 64; retSize.height = imageSize.height * iconSize.height / 64; return retSize; } + (void) initialize { NSImage *tileImage; NSSize iconSize; iconSize = GSGetIconSize(); /* _appIconInit will set our image */ dragCell = [[NSCell alloc] initImageCell: nil]; [dragCell setBordered: NO]; tileImage = [[GSCurrentServer() iconTileImage] copy]; [tileImage setScalesWhenResized: YES]; [tileImage setSize: iconSize]; tileCell = [[NSCell alloc] initImageCell: tileImage]; RELEASE(tileImage); [tileCell setBordered: NO]; } - (BOOL) acceptsFirstMouse: (NSEvent*)theEvent { return YES; } - (void) concludeDragOperation: (id)sender { } - (NSDragOperation) draggingEntered: (id)sender { return NSDragOperationGeneric; } - (void) draggingExited: (id)sender { } - (NSDragOperation) draggingUpdated: (id)sender { return NSDragOperationGeneric; } - (void) drawRect: (NSRect)rect { NSSize iconSize = GSGetIconSize(); [tileCell drawWithFrame: NSMakeRect(0, 0, iconSize.width, iconSize.height) inView: self]; [dragCell drawWithFrame: NSMakeRect(0, 0, iconSize.width, iconSize.height) inView: self]; if ([NSApp isHidden]) { NSRectEdge mySides[] = {NSMinXEdge, NSMinYEdge, NSMaxXEdge, NSMaxYEdge}; CGFloat myGrays[] = {NSBlack, NSWhite, NSWhite, NSBlack}; NSDrawTiledRects(NSMakeRect(4, 4, 3, 2), rect, mySides, myGrays, 4); } } - (id) initWithFrame: (NSRect)frame { self = [super initWithFrame: frame]; [self registerForDraggedTypes: [NSArray arrayWithObjects: NSFilenamesPboardType, nil]]; return self; } - (void) mouseDown: (NSEvent*)theEvent { if ([theEvent clickCount] >= 2) { /* if not hidden raise windows which are possibly obscured. */ if ([NSApp isHidden] == NO) { NSArray *windows = RETAIN(GSOrderedWindows()); NSWindow *aWin; NSEnumerator *iter = [windows reverseObjectEnumerator]; while ((aWin = [iter nextObject])) { if ([aWin isVisible] == YES && [aWin isMiniaturized] == NO && aWin != [NSApp keyWindow] && aWin != [NSApp mainWindow] && aWin != [self window] && ([aWin styleMask] & NSMiniWindowMask) == 0) { [aWin orderFrontRegardless]; } } if ([NSApp isActive] == YES) { if ([NSApp keyWindow] != nil) { [[NSApp keyWindow] orderFront: self]; } else if ([NSApp mainWindow] != nil) { [[NSApp mainWindow] makeKeyAndOrderFront: self]; } else { /* We need give input focus to some window otherwise we'll never get keyboard events. FIXME: doesn't work. */ NSWindow *menu_window= [[NSApp mainMenu] window]; NSDebugLLog(@"Focus", @"No key on activation - make menu key"); [GSServerForWindow(menu_window) setinputfocus: [menu_window windowNumber]]; } } RELEASE(windows); } [NSApp unhide: self]; // or activate or do nothing. } else { NSPoint lastLocation; NSPoint location; NSUInteger eventMask = NSLeftMouseDownMask | NSLeftMouseUpMask | NSPeriodicMask | NSOtherMouseUpMask | NSRightMouseUpMask; NSDate *theDistantFuture = [NSDate distantFuture]; BOOL done = NO; lastLocation = [theEvent locationInWindow]; [NSEvent startPeriodicEventsAfterDelay: 0.02 withPeriod: 0.02]; while (!done) { theEvent = [NSApp nextEventMatchingMask: eventMask untilDate: theDistantFuture inMode: NSEventTrackingRunLoopMode dequeue: YES]; switch ([theEvent type]) { case NSRightMouseUp: case NSOtherMouseUp: case NSLeftMouseUp: /* any mouse up means we're done */ done = YES; break; case NSPeriodic: location = [_window mouseLocationOutsideOfEventStream]; if (NSEqualPoints(location, lastLocation) == NO) { NSPoint origin = [_window frame].origin; origin.x += (location.x - lastLocation.x); origin.y += (location.y - lastLocation.y); [_window setFrameOrigin: origin]; } break; default: break; } } [NSEvent stopPeriodicEvents]; } } - (BOOL) prepareForDragOperation: (id)sender { return YES; } - (BOOL) performDragOperation: (id)sender { NSArray *types; NSPasteboard *dragPb; dragPb = [sender draggingPasteboard]; types = [dragPb types]; if ([types containsObject: NSFilenamesPboardType] == YES) { NSArray *names = [dragPb propertyListForType: NSFilenamesPboardType]; NSUInteger index; [NSApp activateIgnoringOtherApps: YES]; for (index = 0; index < [names count]; index++) { [NSApp _openDocument: [names objectAtIndex: index]]; } return YES; } return NO; } - (void) setImage: (NSImage *)anImage { NSImage *imgCopy = [anImage copy]; if (imgCopy) { NSSize imageSize = [imgCopy size]; [imgCopy setScalesWhenResized: YES]; [imgCopy setSize: scaledIconSizeForSize(imageSize)]; } [dragCell setImage: imgCopy]; RELEASE(imgCopy); [self setNeedsDisplay: YES]; } @end /** *

Every graphical GNUstep application has exactly one instance of * NSApplication (or a subclass) instantiated. Usually this is * created through the +sharedApplication method. Once created, this instance * is always accessible through the global variable 'NSApp'.

* *

The NSApplication instance manages the main run loop, dispatches * events, and manages resources. It sets up the connection to the window * server and provides special methods for putting up "modal" (always on top) * windows.

* *

Typically, -run is called by an application's main method * after the NSApplication instance is created, which never returns. However, * applications needing to integrate other event loops may strategically call * the -stop: method, followed by -run later on.

* *

To avoid most common needs for subclassing, NSApplication allows you to * specify a delegate that is messaged in particular situations. * See -delegate , -setDelegate: , and [(NSApplicationDelegate)].

* *

Subclassing should be a last resort, and delegate * methods should be used in most cases. However, subclassing is most * frequently done to implement custom event loop management by overriding * -run when the method described above is not sufficient, or to intercept * events by overriding -sendEvent: .

*/ @implementation NSApplication /* * Class methods */ + (void) initialize { if (self == [NSApplication class]) { CREATE_AUTORELEASE_POOL(pool); /* * Dummy functions to fool linker into linking files that contain * only catagories - static libraries seem to have problems here. */ extern void GSStringDrawingDummyFunction(void); GSStringDrawingDummyFunction(); [self setVersion: 1]; /* Cache the NSAutoreleasePool class */ arpClass = [NSAutoreleasePool class]; nc = [NSNotificationCenter defaultCenter]; [pool drain]; } } // Helper method + (void) _invokeWithAutoreleasePool: (NSInvocation*) inv { CREATE_AUTORELEASE_POOL(pool); [inv invoke]; [pool drain]; } /** * Calls [NSThread+detachNewThreadSelector:toTarget:withObject:] with the * invocation wrapped by an autorelease pool. */ + (void) detachDrawingThread: (SEL)selector toTarget: (id)target withObject: (id)argument { NSInvocation *inv; inv = [NSInvocation invocationWithMethodSignature: [target methodSignatureForSelector: selector]]; [inv setTarget: target]; [inv setSelector: selector]; [inv setArgument: argument atIndex: 2]; [NSThread detachNewThreadSelector: @selector(_invokeWithAutoreleasePool:) toTarget: self withObject: inv]; } /** *

Return the shared application instance, creating one (of the * receiver class) if needed. There is (and must always be) only a * single shared application instance for each application. After the * shared application instance has been created, you can access it * directly via the global variable NSApp (but not before!). When * the shared application instance is created, it is also automatically * initialized (that is, its init method is called), which * connects to the window server and prepares the gui library for actual * operation. For this reason, you must always call [NSApplication * sharedApplication] before using any functionality of the gui * library - so, normally, this should be one of the first commands in * your program (if you use NSApplicationMain(), this is * automatically done).

* *

The shared application instance is normally an instance of * NSApplication; but you can subclass NSApplication, and have an * instance of your own subclass be created and used as the shared * application instance. If you want to get this result, you need to * make sure the first time you call +sharedApplication is on your * custom NSApplication subclass (rather than on NSApplication). * Putting [MyApplicationClass sharedApplication]; as the first * command in your program is the recommended way. :-) If you use * NSApplicationMain(), it automatically creates the appropriate * instance (which you can control by editing the info dictionary of * the application).

* *

It is not safe to call this method from multiple threads - it would * be useless anyway since the whole library is not thread safe: there * must always be at most one thread using the gui library at a time. * (If you absolutely need to have multiple threads in your * application, make sure only one of them uses the gui [the 'drawing' * thread], and the other ones do not).

*/ + (NSApplication *) sharedApplication { /* If the global application does not yet exist then create it. */ if (NSApp == nil) { /* -init sets NSApp. */ [[self alloc] init]; } return NSApp; } /* * Instance methods */ /** * The real gui initialisation ... called from -init */ - (void) _init { GSDisplayServer *srv; NSDictionary *attributes; /* Initialization must be enclosed in an autorelease pool. */ CREATE_AUTORELEASE_POOL(_app_init_pool); /* * Set NSApp as soon as possible, since other gui classes (which * we refer or use in this method) might be calling [NSApplication * sharedApplication] during their initialization, and we want * those calls to succeed. */ NSApp = self; /* Initialize the backend here. */ initialize_gnustep_backend(); /* Load user-defined bundles */ gsapp_user_bundles(); /* Connect to our window server. */ srv = [GSDisplayServer serverWithAttributes: nil]; RETAIN(srv); [GSDisplayServer setCurrentServer: srv]; /* Create a default context with the attributes of the main screen. */ attributes = [[NSScreen mainScreen] deviceDescription]; _default_context = [NSGraphicsContext graphicsContextWithAttributes: attributes]; RETAIN(_default_context); [NSGraphicsContext setCurrentContext: _default_context]; /* Initialize font manager. */ [NSFontManager sharedFontManager]; _hidden = [[NSMutableArray alloc] init]; _inactive = [[NSMutableArray alloc] init]; _unhide_on_activation = YES; _app_is_hidden = NO; /* Ivar already automatically initialized to NO when the app is created. */ //_app_is_active = NO; //_main_menu = nil; _windows_need_update = YES; /* Save the base library exception handler */ defaultUncaughtExceptionHandler = NSGetUncaughtExceptionHandler(); /* Set a new exception handler for the gui library. */ NSSetUncaughtExceptionHandler(_NSAppKitUncaughtExceptionHandler); _listener = [GSServicesManager newWithApplication: self]; /* NSEvent doesn't use -init so we use +alloc instead of +new. */ _current_event = [NSEvent alloc]; // no current event null_event = [NSEvent alloc]; // create dummy event /* We are the end of responder chain. */ [self setNextResponder: nil]; /* Create our app icon. NB We are doing this here because WindowMaker will not map the app icon window unless it is the very first window being mapped. */ [self _appIconInit]; [_app_init_pool drain]; } /** * This method initializes an NSApplication instance. It sets the * shared application instance to be the receiver, and then connects * to the window server and performs the actual gui library * initialization. * * If there is a already a shared application instance, calling this * method results in an assertion (and normally program abortion/crash). * * It is recommended that you /never/ call this method directly from * your code! It's called automatically (and only once) by * [NSApplication sharedApplication]. You might override this method * in subclasses (make sure to call super's :-), then your overridden * method will automatically be called (guaranteed once in the * lifetime of the application) when you call [MyApplicationClass * sharedApplication]. * * If you call this method from your code (which we discourage you * from doing), it is your responsibility to make sure it is called * only once (this is according to the openstep specification). Since * +sharedApplication automatically calls this method, making also * sure it calls it only once, you definitely want to use * +sharedApplication instead of calling -init directly. */ - (id) init { /* * As per openstep specification, calling -init twice is a bug in * the program. +sharedApplication automatically makes sure it * never calls -init more than once, and programmers should normally * use +sharedApplication in programs. * * Please refrain from trying to have this method work with multiple * calls (such as returning NSApp instead of raising an assertion). * No matter what you do, you can't protect subclass -init custom * code from multiple executions by changing the implementation here * - so it's just simpler and cleaner that multiple -init executions * are always forbidden, and subclasses inherit exactly the same * kind of multiple execution protection as the superclass has, and * initialization code behaves always in the same way for this class * and for subclasses. */ NSAssert (NSApp == nil, _(@"[NSApplication -init] called more than once")); /* * The appkit should run in the main thread ... so to be sure we perform * all the initialisation there. */ [self performSelectorOnMainThread: @selector(_init) withObject: self waitUntilDone: YES]; return NSApp; } /** *

Activates the application, sets the application icon, loads the main * Nib file if NSMainNibFile is set in the application * property list, posts an * NSApplicationWillFinishLaunchingNotification, and takes care * of a few other startup tasks. * If you override this method, be sure to call super.

* *

The -run method calls this the first time it is called, before starting * the event loop for the first time.

*/ - (void) finishLaunching { NSDocumentController *sdc; NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; NSString *filePath; NSArray *windows_list; NSUInteger count; NSUInteger i; BOOL hadDuplicates = NO; BOOL didAutoreopen = NO; NSArray *files = nil; /* post notification that launch will finish */ [nc postNotificationName: NSApplicationWillFinishLaunchingNotification object: self]; /* Register our listener to incoming services requests etc. */ [_listener registerAsServiceProvider]; /* * Establish the current key and main windows. We need to do this in case * the windows were created and set to be key/main earlier - before the * app was active. */ windows_list = [self windows]; count = [windows_list count]; for (i = 0; i < count; i++) { NSWindow *win = [windows_list objectAtIndex: i]; if ([win isKeyWindow] == YES) { if (_key_window == nil) { _key_window = win; } else { hadDuplicates = YES; NSDebugLog(@"Duplicate keyWindow ignored"); [win resignKeyWindow]; } } if ([win isMainWindow] == YES) { if (_main_window == nil) { _main_window = win; } else { hadDuplicates = YES; NSDebugLog(@"Duplicate mainWindow ignored"); [win resignMainWindow]; } } } /* * If there was more than one window set as key or main, we must make sure * that the one we have recorded is the real one by making it become key/main * again. */ if (hadDuplicates) { [_main_window resignMainWindow]; [_main_window becomeMainWindow]; [_main_window orderFrontRegardless]; [_key_window resignKeyWindow]; [_key_window becomeKeyWindow]; [_key_window orderFrontRegardless]; } // Make sure there is one designated main window if (_main_window == nil) { for (i = 0; i < count; i++) { NSWindow *win = [windows_list objectAtIndex: i]; if ([win isVisible] && [win canBecomeMainWindow]) { _main_window = win; break; } } } /* Register self as observer to window events. */ [nc addObserver: self selector: @selector(_windowWillClose:) name: NSWindowWillCloseNotification object: nil]; [nc addObserver: self selector: @selector(_windowDidBecomeKey:) name: NSWindowDidBecomeKeyNotification object: nil]; [nc addObserver: self selector: @selector(_windowDidBecomeMain:) name: NSWindowDidBecomeMainNotification object: nil]; [nc addObserver: self selector: @selector(_windowDidResignKey:) name: NSWindowDidResignKeyNotification object: nil]; [nc addObserver: self selector: @selector(_windowDidResignMain:) name: NSWindowDidResignMainNotification object: nil]; /* register as observer for hide/unhide notifications */ [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver: self selector: @selector(_workspaceNotification:) name: GSHideOtherApplicationsNotification object: nil]; [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver: self selector: @selector(_workspaceNotification:) name: GSUnhideAllApplicationsNotification object: nil]; // Don't activate the application, when the delegate hid it if (![self isHidden]) { [self activateIgnoringOtherApps: YES]; } /* * Instantiate the NSDocumentController if we are a doc-based app * and eventually reopen all autosaved documents */ sdc = [NSDocumentController sharedDocumentController]; if ([[sdc documentClassNames] count] > 0) { didAutoreopen = [sdc _reopenAutosavedDocuments]; } /* * Now check to see if we were launched with arguments asking to * open a file. We permit some variations on the default name. */ if ((files = [self _openFiles]) != nil) { [_listener application: self openFiles: files]; } else if ((filePath = [defs stringForKey: @"GSFilePath"]) != nil || (filePath = [defs stringForKey: @"NSOpen"]) != nil) { [_listener application: self openFile: filePath]; } else if ((filePath = [defs stringForKey: @"GSTempPath"]) != nil) { [_listener application: self openTempFile: filePath]; } else if ((filePath = [defs stringForKey: @"NSPrint"]) != nil) { [_listener application: self printFile: filePath]; [self terminate: self]; } else if (!didAutoreopen && ![defs boolForKey: @"autolaunch"]) { // For document based applications we automatically open a fresh document // unless denied by the delegate. For non-document based applications we // open a fresh document only when requested by the delegate. // Note: We consider an application document based if the shared document // controller reports at least one editable type. BOOL docBased = [[sdc documentClassNames] count] > 0 && [sdc defaultType] != nil; BOOL shouldOpen = docBased ? YES : NO; if ([_delegate respondsToSelector: @selector(applicationShouldOpenUntitledFile:)]) { shouldOpen = [_delegate applicationShouldOpenUntitledFile: self]; } if (shouldOpen) { if (docBased) { NSError *err = nil; if ([sdc openUntitledDocumentAndDisplay: YES error: &err] == nil) { [sdc presentError: err]; } } else if ([_delegate respondsToSelector: @selector(applicationOpenUntitledFile:)]) { [_delegate applicationOpenUntitledFile: self]; } } } } /* * Posts NSApplicationDidFinishLaunchingNotification. * *

The -run method calls this the first time it is called, before starting * the event loop for the first time and after calling finishLaunching.

*/ - (void) _didFinishLaunching { /* finish the launching post notification that launching has finished */ [nc postNotificationName: NSApplicationDidFinishLaunchingNotification object: self]; NS_DURING { [[[NSWorkspace sharedWorkspace] notificationCenter] postNotificationName: NSWorkspaceDidLaunchApplicationNotification object: [NSWorkspace sharedWorkspace] userInfo: [self _notificationUserInfo]]; } NS_HANDLER { NSLog (_(@"Problem during launch app notification: %@"), [localException reason]); [localException raise]; } NS_ENDHANDLER } - (void) dealloc { GSDisplayServer *srv = GSServerForWindow(_app_icon_window); if (srv == nil) { srv = GSCurrentServer(); } [[[NSWorkspace sharedWorkspace] notificationCenter] removeObserver: self]; [nc removeObserver: self]; RELEASE(_hidden); RELEASE(_inactive); RELEASE(_listener); RELEASE(null_event); RELEASE(_current_event); /* We may need to tidy up nested modal session structures. */ while (_session != 0) { NSModalSession tmp = _session; _session = tmp->previous; NSZoneFree(NSDefaultMallocZone(), tmp); } /* Release the menus, then set them to nil so we don't try updating them after they have been deallocated. */ DESTROY(_main_menu); DESTROY(_windows_menu); TEST_RELEASE(_app_icon); TEST_RELEASE(_app_icon_window); TEST_RELEASE(_infoPanel); /* Destroy the default context */ [NSGraphicsContext setCurrentContext: nil]; DESTROY(_default_context); /* Close the server */ [srv closeServer]; DESTROY(srv); [super dealloc]; } /** * Activate app unconditionally if flag is YES, otherwise only if no other app * is active. (Note: this is currently not implemented * under GNUstep. The app is always activated unconditionally.) Usually * it is not necessary to manually call this method, except in some * circumstances of interapplication communication. */ - (void) activateIgnoringOtherApps: (BOOL)flag { // TODO: Currently the flag is ignored if (_app_is_active == NO) { NSUInteger count; NSUInteger i; NSDictionary *info; /* * Menus should observe this notification in order to make themselves * visible when the application is active. */ [nc postNotificationName: NSApplicationWillBecomeActiveNotification object: self]; _app_is_active = YES; if ([[NSUserDefaults standardUserDefaults] boolForKey: @"GSSuppressAppIcon"]) { [_app_icon_window orderOut: self]; } /* Make sure to calculate count after the notification, since inactive status might be changed by a notifiee. */ count = [_inactive count]; for (i = 0; i < count; i++) { [[_inactive objectAtIndex: i] orderFrontRegardless]; } [_inactive removeAllObjects]; if (_unhide_on_activation) { [self unhide: nil]; } if ([self keyWindow] == nil && _hidden_key != nil && [[self windows] indexOfObjectIdenticalTo: _hidden_key] != NSNotFound) { [_hidden_key makeKeyWindow]; _hidden_key = nil; } if ([self mainWindow] == nil && _hidden_main != nil && [[self windows] indexOfObjectIdenticalTo: _hidden_main] != NSNotFound) { [_hidden_main makeMainWindow]; _hidden_main = nil; } if ([self keyWindow] != nil) { [[self keyWindow] orderFront: self]; } else if ([self mainWindow] != nil) { [[self mainWindow] makeKeyAndOrderFront: self]; } else { /* We need give input focus to some window otherwise we'll never get keyboard events. FIXME: doesn't work. */ NSWindow *menu_window= [[self mainMenu] window]; NSDebugLLog(@"Focus", @"No key on activation - make menu key"); [GSServerForWindow(menu_window) setinputfocus: [menu_window windowNumber]]; } info = [self _notificationUserInfo]; [nc postNotificationName: NSApplicationDidBecomeActiveNotification object: self userInfo: info]; [[[NSWorkspace sharedWorkspace] notificationCenter] postNotificationName: NSApplicationDidBecomeActiveNotification object: [NSWorkspace sharedWorkspace] userInfo: info]; } } /** * Forcefully deactivate the app, without activating another. It is rarely * necessary to use this method. */ - (void) deactivate { if (_app_is_active == YES) { NSArray *windows_list; NSDictionary *info; NSWindow *win; NSEnumerator *iter; [nc postNotificationName: NSApplicationWillResignActiveNotification object: self]; _app_is_active = NO; if ([self keyWindow] != nil) { _hidden_key = [self keyWindow]; [_hidden_key resignKeyWindow]; } // The main window is saved for when the app is activated again. // This is necessary for menu in window. if ([self mainWindow] != nil) { _hidden_main = [self mainWindow]; [_hidden_main resignMainWindow]; } windows_list = GSOrderedWindows(); iter = [windows_list reverseObjectEnumerator]; while ((win = [iter nextObject])) { NSModalSession theSession; if ([win isVisible] == NO) { continue; /* Already invisible */ } if ([win canHide] == NO) { continue; /* Can't be hidden */ } if (win == _app_icon_window) { continue; /* can't hide the app icon. */ } /* Don't order out modal windows */ theSession = _session; while (theSession != 0) { if (win == theSession->window) break; theSession = theSession->previous; } if (theSession) continue; if ([win hidesOnDeactivate] == YES) { /* NB Order is important here. When a hide on deactivate window is ordered out while the application is inactive, it gets removed from the _inactive list. Therefore, we must first order out the window and then add it to the _inactive list. */ [win orderOut: self]; [_inactive addObject: win]; } } if (YES == [[NSUserDefaults standardUserDefaults] boolForKey: @"GSSuppressAppIcon"]) { #if MINI_ICON NSRect f = [[[self mainMenu] window] frame]; NSPoint p = f.origin; p.y += f.size.height; [_app_icon_window setFrameTopLeftPoint: p]; [_app_icon_window orderFrontRegardless]; [_app_icon_window miniaturize: self]; #else [_app_icon_window orderFrontRegardless]; #endif } info = [self _notificationUserInfo]; [nc postNotificationName: NSApplicationDidResignActiveNotification object: self userInfo: info]; [[[NSWorkspace sharedWorkspace] notificationCenter] postNotificationName: NSApplicationDidResignActiveNotification object: [NSWorkspace sharedWorkspace] userInfo: info]; } } /** * Returns whether this app is the currently active GNUstep application. * Note that on a GNUstep system, unlike OS X, it is possible for NO GNUstep * app to be active. */ - (BOOL) isActive { return _app_is_active; } /** * Cause all other apps to hide themselves. */ - (void) hideOtherApplications: (id)sender { [[[NSWorkspace sharedWorkspace] notificationCenter] postNotificationName: GSHideOtherApplicationsNotification object: [NSWorkspace sharedWorkspace] userInfo: [self _notificationUserInfo]]; } /** * Cause all apps including this one to unhide themselves. */ - (void) unhideAllApplications: (id)sender { [[[NSWorkspace sharedWorkspace] notificationCenter] postNotificationName: GSUnhideAllApplicationsNotification object: [NSWorkspace sharedWorkspace] userInfo: [self _notificationUserInfo]]; } #define NSLogUncaughtExceptionMask 1 #define NSHandleUncaughtExceptionMask 2 #define NSLogUncaughtSystemExceptionMask 4 #define NSHandleUncaughtSystemExceptionMask 8 #define NSLogRuntimeErrorMask 16 #define NSLogUncaughtRuntimeErrorMask 32 /** * Private method to handle an exception which occurs in the application runloop. */ - (void) _handleException: (NSException *)exception { NSInteger mask = [[NSUserDefaults standardUserDefaults] integerForKey: @"NSExceptionHandlerMask"]; /** * If we are in debug mode, then rethrow the exception so that * the application can be stopped. **/ // log the exception. if (mask & NSLogUncaughtExceptionMask) { [self reportException: exception]; } // allow the default handler to handle the exception. if (mask & NSHandleUncaughtExceptionMask) { [exception raise]; } } /* * Running the main event loop */ /** *

This method first calls -finishLaunching (if this is the first time -run) * has been called, then starts the main event loop of the application which * continues until -terminate: or -stop: is called.

* *

At each iteration, at most one event is dispatched, the main and services * menus are sent [NSMenu-update] messages, and -updateWindows is possibly * called if this has been flagged as necessary.

*/ - (void) run { NSEvent *e; id distantFuture = [NSDate distantFuture]; /* Cache this, safe */ if (_runLoopPool != nil) { [NSException raise: NSInternalInconsistencyException format: @"NSApp's run called recursively"]; } /* * Set this flag here in case the application is actually terminated * inside -finishLaunching. */ _app_is_running = YES; if (_app_is_launched == NO) { _app_is_launched = YES; IF_NO_GC(_runLoopPool = [arpClass new]); [self finishLaunching]; [self _didFinishLaunching]; [_listener updateServicesMenu]; [_main_menu update]; DESTROY(_runLoopPool); } while (_app_is_running) { IF_NO_GC(_runLoopPool = [arpClass new]); // Catch and report any uncaught exceptions. NS_DURING { e = [self nextEventMatchingMask: NSAnyEventMask untilDate: distantFuture inMode: NSDefaultRunLoopMode dequeue: YES]; if (e != nil) { NSEventType type = [e type]; [self sendEvent: e]; // update (en/disable) the services menu's items if (type != NSPeriodic && type != NSMouseMoved) { [_listener updateServicesMenu]; [_main_menu update]; } } } NS_HANDLER { [self _handleException: localException]; } NS_ENDHANDLER; DESTROY (_runLoopPool); } /* Every single non trivial line of code must be enclosed into an autorelease pool. Create an autorelease pool here to wrap synchronize and the NSDebugLog. */ IF_NO_GC(_runLoopPool = [arpClass new]); [[NSUserDefaults standardUserDefaults] synchronize]; DESTROY (_runLoopPool); } /** * Returns whether the event loop managed by -run is currently active. */ - (BOOL) isRunning { return _app_is_running; } /* * Running modal event loops */ /** * Halts a currently running modal event loop started by -runModalForWindow: * or -runModalSession: . If you wish to halt the session in response to * user interaction with the modal window, use -stopModalWithCode: or * -stopModal instead; only use this to halt the loop from elsewhere, such as * another thread. */ - (void) abortModal { /* FIXME: The previous, now commented out, code here did only work from within the modal loop, which is contrary to the purpose of this method. Calling stopModalWithCode: works a bit better, but still relies on the modal loop to cooperate. Calling that method via performSelectorOnMainThread:... and moving the exception into stopModalWithCode:, looks like another option. Still this would rely on the loop getting executed. if (_session == 0) { [NSException raise: NSAbortModalException format: @"abortModal called while not in a modal session"]; } [NSException raise: NSAbortModalException format: @"abortModal"]; */ [self stopModalWithCode: NSRunAbortedResponse]; } /** * Set up modal session for theWindow, and, if it is not visible already, * puts it up on screen, centering it if it is an NSPanel. It is then * ordered front and made key or main window. */ - (NSModalSession) beginModalSessionForWindow: (NSWindow*)theWindow { NSModalSession theSession; theSession = (NSModalSession)NSZoneMalloc(NSDefaultMallocZone(), sizeof(struct _NSModalSession)); theSession->runState = NSRunContinuesResponse; theSession->entryLevel = [theWindow level]; theSession->window = theWindow; theSession->previous = _session; _session = theSession; /* * Displaying / raising window but centering panel only if not up * seems to match the behavior on OS X (Panther). */ if ([theWindow isKindOfClass: [NSPanel class]]) { if ([theWindow isVisible] == NO) [theWindow center]; [theWindow setLevel: NSModalPanelWindowLevel]; } [theWindow orderFrontRegardless]; if ([self isActive] == YES) { if ([theWindow canBecomeKeyWindow] == YES) { [theWindow makeKeyWindow]; } else if ([theWindow canBecomeMainWindow] == YES) { [theWindow makeMainWindow]; } } return theSession; } /** * Clean up after a modal session has been run. Called with theSession * returned from a previous call to beginModalSessionForWindow: . */ - (void) endModalSession: (NSModalSession)theSession { NSModalSession tmp = _session; NSArray *windows = [self windows]; if (theSession == 0) { [NSException raise: NSInvalidArgumentException format: @"null pointer passed to endModalSession:"]; } /* Remove this session from linked list of sessions. */ while (tmp != 0 && tmp != theSession) { tmp = tmp->previous; } if (tmp == 0) { [NSException raise: NSInvalidArgumentException format: @"unknown session passed to endModalSession:"]; } while (_session != theSession) { tmp = _session; _session = tmp->previous; if ([windows indexOfObjectIdenticalTo: tmp->window] != NSNotFound) { [tmp->window setLevel: tmp->entryLevel]; } NSZoneFree(NSDefaultMallocZone(), tmp); } _session = _session->previous; if ([windows indexOfObjectIdenticalTo: theSession->window] != NSNotFound) { [theSession->window setLevel: theSession->entryLevel]; } NSZoneFree(NSDefaultMallocZone(), theSession); // Bring the next modal window to front if ((_session != 0) && ([windows indexOfObjectIdenticalTo: _session->window] != NSNotFound)) { NSWindow *theWindow = _session->window; // Same code as in beginModalSessionForWindow: [theWindow orderFrontRegardless]; if ([self isActive] == YES) { if ([theWindow canBecomeKeyWindow] == YES) { [theWindow makeKeyWindow]; } else if ([theWindow canBecomeMainWindow] == YES) { [theWindow makeMainWindow]; } } } else { [_main_menu update]; } } /** * Starts modal event loop for given window, after calling * -beginModalSessionForWindow:. Loop is broken only by -stopModal , * -stopModalWithCode: , or -abortModal , at which time -endModalSession: * is called automatically. */ - (NSInteger) runModalForWindow: (NSWindow*)theWindow { NSModalSession theSession = 0; NSInteger code = NSRunContinuesResponse; NS_DURING { NSDate *limit; GSDisplayServer *srv; theSession = [self beginModalSessionForWindow: theWindow]; limit = [NSDate distantFuture]; srv = GSCurrentServer(); while (code == NSRunContinuesResponse) { /* * Try to handle events for this session, discarding others. */ code = [self runModalSession: theSession]; if (code == NSRunContinuesResponse) { /* * Wait until there are more events to handle. */ DPSPeekEvent(srv, NSAnyEventMask, limit, NSModalPanelRunLoopMode); } } [self endModalSession: theSession]; } NS_HANDLER { if (theSession != 0) { NSWindow *win_to_close = theSession->window; [self endModalSession: theSession]; [win_to_close close]; } if ([[localException name] isEqual: NSAbortModalException] == NO) { [localException raise]; } code = NSRunAbortedResponse; } NS_ENDHANDLER return code; } /**

Processes any events for a modal session described by the theSession variable. When finished, it returns the state of the session (i.e. whether it is still running or has been stopped, etc)

If there are no pending events for the session, this method returns immediately.

Although Apple's docs state that, before processing the events, it makes the session window key and orders the window front, this method does not attempt to do this, because: 1) we don't want to interfere with use of other apps during modal session for this app; 2) occasionally other windows are active and should be usable during modal sessions (e.g., a popup dialog from a modal window); 3) most of the time -beginModalSessionForWindow: will have been called in advance. If the latter is not the case, you may need to order the window front yourself in advance.

See Also: -runModalForWindow:

*/ - (NSInteger) runModalSession: (NSModalSession)theSession { NSAutoreleasePool *pool; GSDisplayServer *srv; BOOL done = NO; NSEvent *event; NSDate *limit; if (theSession != _session) { [NSException raise: NSInvalidArgumentException format: @"runModalSession: with wrong session"]; } // Use the default context for all events. srv = GSCurrentServer(); // Only handle input which is already available. limit = [NSDate distantPast]; /* * Deal with the events in the queue. */ while (done == NO && theSession->runState == NSRunContinuesResponse) { IF_NO_GC(pool = [arpClass new]); event = DPSGetEvent(srv, NSAnyEventMask, limit, NSModalPanelRunLoopMode); if (event != nil) { NSWindow *eventWindow = [event window]; /* * We handle events for the session window, events for any * window which works when modal, and any window management * events. All others are ignored/discarded. */ if (eventWindow == theSession->window || [eventWindow worksWhenModal] == YES || [event type] == NSAppKitDefined) { ASSIGN(_current_event, event); } else { event = nil; // Ignore/discard this event. } } else { done = YES; // No more events pending. } if (event != nil) { NSEventType type = [_current_event type]; [self sendEvent: _current_event]; // update (en/disable) the services menu's items if (type != NSPeriodic && type != NSMouseMoved) { [_listener updateServicesMenu]; [_main_menu update]; } /* * Check to see if the window has gone away - if so, end session. */ if ([[self windows] indexOfObjectIdenticalTo: _session->window] == NSNotFound || ![_session->window isVisible]) { [self stopModal]; } } [pool drain]; } NSAssert(_session == theSession, @"Session was changed while running"); return theSession->runState; } /**

Returns the window that is part of the current modal session, if any.

See -runModalForWindow:

*/ - (NSWindow *) modalWindow { if (_session != 0) return (_session->window); else return nil; } /** * Stops the main run loop, as well as a modal session if it is running. */ - (void) stop: (id)sender { if (_session != 0) [self stopModal]; else { _app_is_running = NO; /* * add dummy event to queue to assure loop cycles * at least one more time */ DPSPostEvent(GSCurrentServer(), null_event, NO); } } /**

Stops a running modal session causing -runModalForWindow: or * -runModalSession: to return NSRunStoppedResponse. Use this * or -stopModalWithCode: to end a modal session in response to user input.

*

See Also: -stopModalWithCode:

*/ - (void) stopModal { [self stopModalWithCode: NSRunStoppedResponse]; } /** * Stops a running modal session causing -runModalForWindow: or * -runModalSession: to return the specified integer code. Use this * or -stopModal to end a modal session in response to user input. */ - (void) stopModalWithCode: (NSInteger)returnCode { /* According to the spec, there is no exception which is thrown * if we are not currently in a modal session. While it is not * good practice to call this when we're not, we shouldn't throw * an exception. */ if (_session != 0 && _session->runState == NSRunContinuesResponse) { if (returnCode == NSRunContinuesResponse) { [NSException raise: NSInvalidArgumentException format: @"stopModalWithCode: with NSRunContinuesResponse"]; } _session->runState = returnCode; } } /** * Put up a modal window centered relative to docWindow. On OS X this is * deprecated in favor of * -beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo: . * Not implemented under GNUstep. Currently just centers window on the * screen. */ - (NSInteger) runModalForWindow: (NSWindow *)theWindow relativeToWindow: (NSWindow *)docWindow { // FIXME [theWindow orderWindow: NSWindowAbove relativeTo: [docWindow windowNumber]]; return [self runModalForWindow: theWindow]; } /** * Put up a modal sheet sliding down from top of docWindow. If modalDelegate * is non-nil and responds to didEndSelector (this is optional), it is invoked * after the session ends. The selector should take three arguments: * NSWindow *, int, void *. It is passed the sheet window, the return code, * and the contextInfo passed in here. * Under GNUstep, the sheet aspect is not implemented (just centers * window on the screen), but modalDelegate didEndSelector is called if * both non-nil. */ - (void) beginSheet: (NSWindow *)sheet modalForWindow: (NSWindow *)docWindow modalDelegate: (id)modalDelegate didEndSelector: (SEL)didEndSelector contextInfo: (void *)contextInfo { // FIXME NSInteger ret; [sheet setParentWindow: docWindow]; [docWindow setAttachedSheet: sheet]; ret = [self runModalForWindow: sheet relativeToWindow: docWindow]; if (modalDelegate && [modalDelegate respondsToSelector: didEndSelector]) { void (*didEnd)(id, SEL, id, NSInteger, void*); didEnd = (void (*)(id, SEL, id, NSInteger, void*))[modalDelegate methodForSelector: didEndSelector]; didEnd(modalDelegate, didEndSelector, sheet, ret, contextInfo); } [docWindow setAttachedSheet: nil]; [sheet setParentWindow: nil]; } /** * Analogous to -stopModal for sheets. */ - (void) endSheet: (NSWindow *)sheet { // FIXME [self stopModal]; } /** * Analogous to -stopModalWithCode: for sheets. */ - (void) endSheet: (NSWindow *)sheet returnCode: (NSInteger)returnCode { // FIXME [self stopModalWithCode: returnCode]; } /* * Getting, removing, and posting events */ /* Private method used by GSDragView to dispatch drag events as Cocoa does. */ - (void) _postAndSendEvent: (NSEvent *)anEvent { ASSIGN(_current_event, anEvent); [self sendEvent: anEvent]; } /** * Called by -run to dispatch events that are received according to AppKit's * forwarding conventions. You rarely need to invoke this directly. If you * want to synthesize an event for processing, call -postEvent:atStart: . */ - (void) sendEvent: (NSEvent *)theEvent { NSEventType type; type = [theEvent type]; switch (type) { case NSPeriodic: /* NSApplication traps the periodic events */ break; case NSKeyDown: { NSDebugLLog(@"NSEvent", @"send key down event\n"); /* Key equivalents must be looked up explicitly in the Services menu after checking the main menu, as NSMenu's -performKeyEquivalent: ignores the Services menu. See the comment in that method for a rationale. */ if ([[self keyWindow] performKeyEquivalent: theEvent] == NO && [[self mainMenu] performKeyEquivalent: theEvent] == NO && [[self servicesMenu] performKeyEquivalent: theEvent] == NO) { [[theEvent window] sendEvent: theEvent]; } break; } case NSKeyUp: { NSDebugLLog(@"NSEvent", @"send key up event\n"); [[theEvent window] sendEvent: theEvent]; break; } default: /* pass all other events to the event's window */ { NSWindow *window = [theEvent window]; if (!theEvent) NSDebugLLog(@"NSEvent", @"NSEvent is nil!\n"); if (type == NSMouseMoved) NSDebugLLog(@"NSMotionEvent", @"Send move (%d) to %@", (int)type, window); else NSDebugLLog(@"NSEvent", @"Send NSEvent type: %d to %@", (int)type, window); if (window) [window sendEvent: theEvent]; else if (type == NSRightMouseDown) [self rightMouseDown: theEvent]; } } } /** * Returns the most recent event -run pulled off the event queue. */ - (NSEvent*) currentEvent { return _current_event; } /* Utility for pen-device input. See NSResponder. */ - (BOOL) shouldBeTreatedAsInkEvent: (NSEvent *)theEvent { return [[theEvent window] shouldBeTreatedAsInkEvent: theEvent]; } /** * Drop events matching mask from the queue, before but not including * lastEvent. The mask is a bitwise AND of event mask constants. * See (EventType) . Use NSAnyEventMask to discard everything * up to lastEvent. */ - (void) discardEventsMatchingMask: (NSUInteger)mask beforeEvent: (NSEvent *)lastEvent { DPSDiscardEvents(GSCurrentServer(), mask, lastEvent); } /** * Return the next event matching mask from the queue, dequeuing if flag is * YES. Intervening events are NOT dequeued. If no matching event is on the * queue, will wait for one until expiration, returning nil if none found. * See (EventType) for the list of masks. */ - (NSEvent*) nextEventMatchingMask: (NSUInteger)mask untilDate: (NSDate*)expiration inMode: (NSString*)mode dequeue: (BOOL)flag { NSEvent *event; if (_windows_need_update) { [self updateWindows]; } if (!expiration) expiration = [NSDate distantPast]; if (flag) event = DPSGetEvent(GSCurrentServer(), mask, expiration, mode); else event = DPSPeekEvent(GSCurrentServer(), mask, expiration, mode); if (event == null_event) { // Never return the null_event event = nil; } if (event) { IF_NO_GC(NSAssert([event retainCount] > 0, NSInternalInconsistencyException)); /* * If we are not in a tracking loop, we may want to unhide a hidden * because the mouse has been moved. */ if (mode != NSEventTrackingRunLoopMode) { _windows_need_update = YES; if ([NSCursor isHiddenUntilMouseMoves]) { NSEventType type = [event type]; if ((type == NSLeftMouseDown) || (type == NSLeftMouseUp) || (type == NSOtherMouseDown) || (type == NSOtherMouseUp) || (type == NSRightMouseDown) || (type == NSRightMouseUp) || (type == NSMouseMoved)) { [NSCursor setHiddenUntilMouseMoves: NO]; } } } if (flag) ASSIGN(_current_event, event); } return event; } /** * Add an event to be processed by the app, either at end or at beginning * (next up) if flag is YES. This provides a way to provide synthetic input * to an application, or, for whatever reason, to allow a real event to be * re-dispatched. */ - (void) postEvent: (NSEvent *)event atStart: (BOOL)flag { DPSPostEvent(GSCurrentServer(), event, flag); } /** * Sends the aSelector message to the receiver returned by the * -targetForAction:to:from: method (to which the aTarget and sender * arguments are passed).
* The method in the receiver must expect a single argument ... * the sender.
* Any value returned by the method in the receiver is ignored.
* This method returns YES on success, NO on failure (when no receiver * can be found for aSelector). */ - (BOOL) sendAction: (SEL)aSelector to: (id)aTarget from: (id)sender { id resp = [self targetForAction: aSelector to: aTarget from: sender]; if (resp != nil) { IMP actionIMP = [resp methodForSelector: aSelector]; if (0 != actionIMP) { actionIMP(resp, aSelector, sender); return YES; } } return NO; } /** * If theTarget responds to theAction it is returned, otherwise * the application searches for an object which will handle * theAction and returns the first object found.
* Returns nil on failure. */ - (id) targetForAction: (SEL)theAction to: (id)theTarget from: (id)sender { /* * If target responds to the selector then have it perform it. */ if (theTarget && [theTarget respondsToSelector: theAction]) { return theTarget; } else if ([sender isKindOfClass: [NSToolbarItem class]]) { /* Special case for toolbar items which must look up the target in the responder chain of the window containing their toolbar not in the key or main window. Note: If (and only if) the toolbar's window is key window we must pass it as such to _targetForAction:... so that toolbar items in a modal dialog panel work. */ NSWindow *toolbarWindow = [[[(NSToolbarItem *)sender toolbar] _toolbarView] window]; NSWindow *keyWindow = [self keyWindow]; if (keyWindow != toolbarWindow) keyWindow = nil; return [self _targetForAction: theAction keyWindow: keyWindow mainWindow: toolbarWindow]; } else { return [self targetForAction: theAction]; } } /** *

* Returns the target object that will respond to aSelector, if any. The * method first checks if any of the key window's first responders, the * key window or its delegate responds. Next it checks the main window in * the same way. Finally it checks the receiver (NSApplication) and its * delegate. *

*/ - (id) targetForAction: (SEL)aSelector { /* During a modal session actions must not be sent to the main window of * the application, but rather to the dialog window of the modal session. * Note that the modal session window is not necessarily the key window, * as a panel with worksWhenModal = YES, e.g., the font panel, can still * become key window during a modal session. */ NSWindow *mainWindow = [self mainWindow]; if (_session != 0) mainWindow = _session->window; return [self _targetForAction: aSelector keyWindow: [self keyWindow] mainWindow: mainWindow]; } /** * Attempts to perform aSelector using [NSResponder-tryToPerform:with:] * and if that is not possible, attempts to get the application * delegate to perform the aSelector.
* Returns YES if an object was found to perform aSelector, NO otherwise. */ - (BOOL) tryToPerform: (SEL)aSelector with: (id)anObject { if ([super tryToPerform: aSelector with: anObject] == YES) { return YES; } if (_delegate != nil && [_delegate respondsToSelector: aSelector]) { IMP actionIMP = [_delegate methodForSelector: aSelector]; if (0 != actionIMP) { actionIMP(_delegate, aSelector, anObject); return YES; } } return NO; } /**

Sets the application's icon. Any windows that use the old application icon image as their mini window image will be updated to use the new image.

See Also: -applicationIconImage

*/ - (void) setApplicationIconImage: (NSImage*)anImage { NSEnumerator *iterator; NSWindow *current; NSImage *old_app_icon = _app_icon; NSSize miniWindowSize; NSSize imageSize; // Ignore attempts to set nil as the icon image. if (nil == anImage) return; RETAIN(old_app_icon); // Use a copy as we change the name and size ASSIGNCOPY(_app_icon, anImage); miniWindowSize = [GSCurrentServer() iconSize]; if (miniWindowSize.width <= 0 || miniWindowSize.height <= 0) { miniWindowSize = NSMakeSize(48, 48); } // restrict size when the icon is larger than the mini window. imageSize = [_app_icon size]; if (imageSize.width > miniWindowSize.width || imageSize.height > miniWindowSize.height) { [_app_icon setSize: miniWindowSize]; } // Let horizontal menu change icon [_main_menu _organizeMenu]; if (_app_icon_window != nil) { [(NSAppIconView *)[_app_icon_window contentView] setImage: _app_icon]; } // Swap the old image for the new one wherever it's used iterator = [[self windows] objectEnumerator]; while ((current = [iterator nextObject]) != nil) { if ([current miniwindowImage] == old_app_icon) [current setMiniwindowImage: _app_icon]; } DESTROY(old_app_icon); } /**

Returns the current icon be used for the application.

See Also: -setApplicationIconImage:

*/ - (NSImage*) applicationIconImage { return _app_icon; } /** * Returns the actual window object being used to display the application * icon (usually in the dock). */ - (NSWindow*) iconWindow { return _app_icon_window; } /* * Hiding and arranging windows */ /**

Request this application to "hide" (unmap all windows from the screen * except the icon window). Posts * NSApplicationWillHideNotification and * NSApplicationDidHideNotification. On OS X this activates * the next app that is running, however on GNUstep this is up to the window * manager.

See Also: -unhide: -isHidden

*/ - (void) hide: (id)sender { #ifdef __MINGW32__ [self miniaturizeAll: sender]; #else if (_app_is_hidden == NO) { if (![[NSUserDefaults standardUserDefaults] boolForKey: @"GSSuppressAppIcon"]) { NSArray *windows_list; NSDictionary *info; NSWindow *win; NSEnumerator *iter; [nc postNotificationName: NSApplicationWillHideNotification object: self]; if ([self keyWindow] != nil) { _hidden_key = [self keyWindow]; [_hidden_key resignKeyWindow]; } // The main window is saved for when the app is activated again. // This is necessary for menu in window. if ([self mainWindow] != nil) { _hidden_main = [self mainWindow]; [_hidden_main resignMainWindow]; } windows_list = GSOrderedWindows(); iter = [windows_list reverseObjectEnumerator]; while ((win = [iter nextObject])) { if ([win isVisible] == NO && ![win isMiniaturized]) { continue; /* Already invisible */ } if ([win canHide] == NO) { continue; /* Not hideable */ } if (win == _app_icon_window) { continue; /* can't hide the app icon. */ } if (_app_is_active == YES && [win hidesOnDeactivate] == YES) { continue; /* Will be hidden by deactivation */ } [_hidden addObject: win]; [win orderOut: self]; } _app_is_hidden = YES; if (YES == [[NSUserDefaults standardUserDefaults] boolForKey: @"GSSuppressAppIcon"]) { #if MINI_ICON NSRect f = [[[self mainMenu] window] frame]; NSPoint p = f.origin; p.y += f.size.height; [_app_icon_window setFrameTopLeftPoint: p]; [_app_icon_window orderFrontRegardless]; [_app_icon_window miniaturize: self]; #else [_app_icon_window orderFrontRegardless]; #endif } else { [[_app_icon_window contentView] setNeedsDisplay: YES]; } /* * On hiding we also deactivate the application which will make the menus * go away too. */ [self deactivate]; _unhide_on_activation = YES; info = [self _notificationUserInfo]; [nc postNotificationName: NSApplicationDidHideNotification object: self userInfo: info]; [[[NSWorkspace sharedWorkspace] notificationCenter] postNotificationName: NSApplicationDidHideNotification object: [NSWorkspace sharedWorkspace] userInfo: info]; } else { /*Minimize all windows if there isn't an AppIcon. This isn't the most elegant solution, but avoids to loss the app if the user hide it. */ [self miniaturizeAll: sender]; } } #endif } /**

Returns whether app is currently in hidden state.

See Also: -hide: -unhide:

*/ - (BOOL) isHidden { return _app_is_hidden; } /**

Unhides and activates this application.

See Also: -unhideWithoutActivation -hide: -isHidden

*/ - (void) unhide: (id)sender { if (_app_is_hidden) { [self unhideWithoutActivation]; _unhide_on_activation = NO; } if (_app_is_active == NO) { /* * Activation should make the applications menus visible. */ [self activateIgnoringOtherApps: YES]; } } /** * Unhides this app (displays its windows) but does not activate it. */ - (void) unhideWithoutActivation { if (_app_is_hidden == YES) { NSDictionary *info; NSUInteger count; NSUInteger i; [nc postNotificationName: NSApplicationWillUnhideNotification object: self]; /* Make sure we set this before ordering windows to avoid possible recursive loops (some methods window/backend methods check if the app is hidden before ordering a window). */ _app_is_hidden = NO; count = [_hidden count]; for (i = 0; i < count; i++) { NSWindow *win = [_hidden objectAtIndex: i]; [win orderFrontRegardless]; if ([win isMiniaturized]) { [GSServerForWindow(win) miniwindow: [win windowNumber]]; } } [_hidden removeAllObjects]; [[_app_icon_window contentView] setNeedsDisplay: YES]; info = [self _notificationUserInfo]; [nc postNotificationName: NSApplicationDidUnhideNotification object: self userInfo: info]; [[[NSWorkspace sharedWorkspace] notificationCenter] postNotificationName: NSApplicationDidUnhideNotification object: [NSWorkspace sharedWorkspace] userInfo: info]; } } /** * Arranges all non-miniaturized app's windows in front by successively calling * [NSWindow-orderFront:] on each window in the app's Windows menu. */ - (void) arrangeInFront: (id)sender { NSMenu *menu; menu = [self windowsMenu]; if (menu) { NSArray *itemArray; NSUInteger count; NSUInteger i; itemArray = [menu itemArray]; count = [itemArray count]; for (i = 0; i < count; i++) { id win = [(NSMenuItem*)[itemArray objectAtIndex: i] target]; if ([win isKindOfClass: [NSWindow class]] && [win isVisible] && ![win isMiniaturized]) { [win orderFront: sender]; } } } } /* * User interface validation */ - (BOOL) validateUserInterfaceItem: (id )anItem { // FIXME return YES; } /* * Managing windows */ /** * Returns current key window. If this app is active, one window should be * key. If this app is not active, nil should be returned. The key window * is the one that will receive keyboard input. */ - (NSWindow*) keyWindow { return _key_window; } /** * Returns current main window of this application. There need not necessarily * be a main window, even if app is active, and this should return nil if the * app is inactive. */ - (NSWindow*) mainWindow { return _main_window; } /** * Sends aSelector to each window, either in the app's internal window list * (flag = NO) or their stacking order from front to back on the screen * (flag = YES, currently not implemented under GNUstep). */ - (NSWindow*) makeWindowsPerform: (SEL)aSelector inOrder: (BOOL)flag { NSArray *window_list; NSUInteger i, c; // so i suppose when flag is YES it only runs on visible windows if (flag) { window_list = GSOrderedWindows(); } else { window_list = [self windows]; } for (i = 0, c = [window_list count]; i < c; i++) { NSWindow *window = [window_list objectAtIndex: i]; if ([window performSelector: aSelector] != nil) { return window; } } return nil; } /** * Iconify all windows in the app. */ - (void) miniaturizeAll: sender { NSArray *window_list = [self windows]; NSUInteger i, count; for (i = 0, count = [window_list count]; i < count; i++) [[window_list objectAtIndex: i] miniaturize: sender]; } /** * Prevent window reordering in response to most recent mouse down (useful to * prevent raise-on-mouse-click). Not implemented under GNUstep. */ - (void) preventWindowOrdering { //TODO } /** * Set whether the main run loop will request all visible windows update * themselves after the current or next event is processed. (Update occurs * after event dispatch in the loop.) * This is needed when in NSEventTrackingRunLoopMode. When the application * is using NSDefaultRunLoopMode or NSModalPanelRunLoopMode windows are updated * after each loop iteration irrespective of this setting. */ - (void) setWindowsNeedUpdate: (BOOL)flag { _windows_need_update = flag; } /** * Sends each of the app's visible windows an [NSWindow-update] message. * This method is called automatically for every iteration of the run loop * in NSDefaultRunLoopMode or NSModalPanelRunLoopMode, but is only called during * NSEventTrackingRunLoopMode if -setWindowsNeedUpdate: is set to YES. */ - (void) updateWindows { NSArray *window_list = [self windows]; NSUInteger count = [window_list count]; NSUInteger i; _windows_need_update = NO; [nc postNotificationName: NSApplicationWillUpdateNotification object: self]; for (i = 0; i < count; i++) { NSWindow *win = [window_list objectAtIndex: i]; if ([win isVisible]) [win update]; } [nc postNotificationName: NSApplicationDidUpdateNotification object: self]; } /** * Returns array of app's visible and invisible windows. */ - (NSArray*) windows { return GSAllWindows(); } /** * Returns window for windowNum. Note the window number can be obtained for * a window from [NSWindow-windowNumber]. */ - (NSWindow *) windowWithWindowNumber: (NSInteger)windowNum { return GSWindowWithNumber(windowNum); } /* * Showing Standard Panels */ /** Calls -orderFrontStandardAboutPanelWithOptions: with nil passed as the options dictionary. */ - (void) orderFrontStandardAboutPanel: sender { [self orderFrontStandardAboutPanelWithOptions: nil]; } /** OS X compatibility: Calls -orderFrontStandardInfoPanelWithOptions: . */ - (void) orderFrontStandardAboutPanelWithOptions: (NSDictionary *)dictionary { [self orderFrontStandardInfoPanelWithOptions: dictionary]; } /* infoPanel, GNUstep API */ /** Calls -orderFrontStandardInfoPanelWithOptions: with nil passed as the options dictionary. */ - (void) orderFrontStandardInfoPanel: sender { [self orderFrontStandardInfoPanelWithOptions: nil]; } /**

Orders front the standard info panel for the application, taking the needed information from the dictionary argument. There is a single standard info panel per application; it is created the first time that this method is invoked, and then reused in all subsequent calls. The application standard info panel is immutable and can not be changed after creation. Useful keys for the dictionary are:

ApplicationName A string with the name of the application (eg, "Gorm"). If not available, the Info-gnustep.plist file is searched for the value of ApplicationName followed by NSHumanReadableShortName. If this also fails, the string returned by [NSProcessInfo-processName] is used. ApplicationDescription A string with a very short description of the application (eg, "GNUstep Graphics Objects Relationship Modeller"). If not available, Info-gnustep.plist is searched for that key; if this fails, no application description is shown. ApplicationIcon An image to be shown near the title. If not available, Info-gnustep.plist is searched for ApplicationIcon; if this fails, NSApp's -applicationIconImage method is used instead. ApplicationRelease A string with the name of the application, release included (eg, "Gorm 0.1"). If not available, the value for ApplicationVersion is used instead. If this fails, Info-gnustep.plist is searched for ApplicationRelease or NSAppVersion, otherwise, "Unknown" is used. FullVersionID A string with the full version of the application (eg, "0.1.2b" or "snap011100"). If not available, Version is used instead. If this fails, Info-gnustep.plist is looked for NSBuildVersion. If all fails, no full version is shown. Authors An array of strings, each one with the name of an author (eg, [NSArray arrayWithObject: "Nicola Pero <n.pero\@mi.flashnet.it>"]). If not found, Info-gnustep.plist is searched for Authors, if this fails, "Unknown" is displayed. URL [This field is still under work, so it might be changed] A string with an URL (eg, "See http://www.gnustep.org"). Copyright A string with copyright owners (eg, "Copyright (C) 2000 The Free Software Foundation, Inc."). Support for multiple line strings is planned but not yet available. If not found, Info-gnustep.plist is searched for Copyright and then (failing this) for NSHumanReadableCopyright. If all fails, "Copyright Information Not Available" is used. CopyrightDescription A string describing the kind of copyright (eg, "Released under the GNU General Public License 2.0"). If not available, Info-gnustep.plist is searched for CopyrightDescription. If this fails, no copyright description is shown. */ - (void) orderFrontStandardInfoPanelWithOptions: (NSDictionary *)dictionary { if (_infoPanel == nil) _infoPanel = [[GSInfoPanel alloc] initWithDictionary: dictionary]; [_infoPanel setTitle: NSLocalizedString (@"Info", @"Title of the Info Panel")]; [_infoPanel orderFront: self]; } /* * Getting the main menu */ /** * Returns the main menu of the receiver. */ - (NSMenu*) mainMenu { return _main_menu; } /** * Sets the main menu of the receiver. This is sent update messages by the * main event loop. */ - (void) setMainMenu: (NSMenu*)aMenu { if (_main_menu == aMenu) { return; } if (_main_menu != nil) { [_main_menu setMain: NO]; } ASSIGN(_main_menu, aMenu); if (_main_menu != nil) { [_main_menu setMain: YES]; } } /* Overrides to show transient version of main menu as in NeXTstep. */ - (void) rightMouseDown: (NSEvent*)theEvent { // On right mouse down display the main menu transient if (_main_menu != nil) [NSMenu popUpContextMenu: _main_menu withEvent: theEvent forView: nil]; else [super rightMouseDown: theEvent]; } /** * Here for compatibility with OS X, but currently a no-op. */ - (void) setAppleMenu: (NSMenu*)aMenu { //TODO: Unclear, what this should do. } /* * Managing the Windows menu */ /** * Adds an item to the app's Windows menu. This is usually done automatically * so you don't need to call this method. */ - (void) addWindowsItem: (NSWindow*)aWindow title: (NSString*)aString filename: (BOOL)isFilename { [self changeWindowsItem: aWindow title: aString filename: isFilename]; } /** * Removes an item from the app's Windows menu. This is usually done * automatically so you don't need to call this method. */ - (void) removeWindowsItem: (NSWindow*)aWindow { if (_windows_menu) { NSArray *itemArray; NSUInteger count; itemArray = [_windows_menu itemArray]; count = [itemArray count]; while (count-- > 0) { NSMenuItem *item = [itemArray objectAtIndex: count]; if ([item target] == aWindow) { [_windows_menu removeItemAtIndex: count]; return; } } } } // this is an internal helper method for changeWindowsItem:title:filename // when window represents an editable document - (void) setImageForWindowsItem: (NSMenuItem *)item { NSImage *oldImage = [item image]; NSImage *newImage; if (!([[item target] styleMask] & NSClosableWindowMask)) return; if ([[item target] isDocumentEdited]) { newImage = [NSImage imageNamed: @"common_CloseBroken"]; } else { newImage = [NSImage imageNamed: @"common_Close"]; } if (newImage != oldImage) { [item setImage: newImage]; } } /** Changes the Window menu item associated with aWindow to aString. If no associated window item exists, one is created. If isFilename is YES, then aString is assumed to be a filename representation the way [NSWindow-setTitleWithRepresentedFilename:] would format it, otherwise the string is displayed literally in the menu item. */ - (void) changeWindowsItem: (NSWindow*)aWindow title: (NSString*)aString filename: (BOOL)isFilename { NSArray *itemArray; NSUInteger count; NSUInteger i; id item; if (![aWindow isKindOfClass: [NSWindow class]]) [NSException raise: NSInvalidArgumentException format: @"Object of bad type passed as window"]; if (isFilename) { NSRange r = [aString rangeOfString: @" -- "]; if (r.length > 0) { aString = [aString substringToIndex: r.location]; } } /* * If there is no menu and nowhere to put one, we can't do anything. */ if (_windows_menu == nil) return; /* * Check if the window is already in the menu. */ itemArray = [_windows_menu itemArray]; count = [itemArray count]; for (i = 0; i < count; i++) { NSMenuItem *item = [itemArray objectAtIndex: i]; if ([item target] == aWindow) { /* * If our menu item already exists and with the correct * title, we need not continue. */ if ([[item title] isEqualToString: aString]) { return; } else { /* * Else, we need to remove the old item and add it again * with the new title. Then new item might be located * somewhere else in the menu than the old one (because * items in the menu are sorted by title) ... this is * why we remove the old one and then insert it again. */ [_windows_menu removeItem: item]; break; } } } /* * Can't permit an untitled window in the window menu ... so if the * window has not title, we don't add it to the menu. */ if (aString == nil || [aString isEqualToString: @""]) return; /* * Now we insert a menu item for the window in the correct order. * Window menu items are inserted in alphabetic order at the bottom * of the windows menu except for two special items with actions * 'performMiniaturize: ' and 'performClose: '. If these exist the * they are kept at the below all window entries in the menu. */ itemArray = [_windows_menu itemArray]; count = [itemArray count]; if (count > 0 && sel_isEqual([[itemArray objectAtIndex: count-1] action], @selector(performClose:))) count--; if (count > 0 && sel_isEqual([[itemArray objectAtIndex: count-1] action], @selector(performMiniaturize:))) count--; for (i = 0; i < count; i++) { NSMenuItem *item = [itemArray objectAtIndex: i]; if ([[item target] isKindOfClass: [NSWindow class]] && sel_isEqual([item action], @selector(makeKeyAndOrderFront:))) break; } while (i < count) { item = [itemArray objectAtIndex: i]; if ([[item title] compare: aString] == NSOrderedDescending) break; i++; } item = [_windows_menu insertItemWithTitle: aString action: @selector(makeKeyAndOrderFront:) keyEquivalent: @"" atIndex: i]; [item setTarget: aWindow]; // When changing for a window with a file, we should also set the image. [self setImageForWindowsItem: item]; } /** * Update Windows menu item for aWindow, to reflect its edited status. This * is usually done automatically so you don't need to call this. */ - (void) updateWindowsItem: (NSWindow*)aWindow { NSMenu *menu; menu = [self windowsMenu]; if (menu != nil) { NSArray *itemArray; NSUInteger count; NSUInteger i; BOOL found = NO; itemArray = [menu itemArray]; count = [itemArray count]; for (i = 0; i < count; i++) { NSMenuItem *item = [itemArray objectAtIndex: i]; if ([item target] == aWindow) { [self setImageForWindowsItem: item]; break; } } if (found == NO) { [self changeWindowsItem: aWindow title: [aWindow title] filename: [aWindow _hasTitleWithRepresentedFilename]]; } } } /** * Sets the windows menu of the receiver. The windows menu keeps track of all * windows open in the application. */ - (void) setWindowsMenu: (NSMenu*)aMenu { if (_windows_menu == aMenu) { return; } /* * Remove all the windows from the old windows menu. */ if (_windows_menu != nil) { NSArray *itemArray = [_windows_menu itemArray]; NSUInteger i, count = [itemArray count]; for (i = 0; i < count; i++) { NSMenuItem *anItem = [itemArray objectAtIndex: i]; id win = [anItem target]; if ([win isKindOfClass: [NSWindow class]]) { [_windows_menu removeItem: anItem]; } } } /* Set the new _windows_menu. */ ASSIGN (_windows_menu, aMenu); { /* * Now use [-changeWindowsItem:title:filename:] to build the new menu. */ NSArray * windows = [self windows]; NSUInteger i, count = [windows count]; for (i = 0; i < count; i++) { NSWindow *win = [windows objectAtIndex: i]; if (([win isExcludedFromWindowsMenu] == NO) && ([win isVisible] || [win isMiniaturized])) { [self changeWindowsItem: win title: [win title] filename: [win _hasTitleWithRepresentedFilename]]; } } } } /** * Returns current Windows menu for the application (whose window contents are * managed automatically by this class and NSWindow). */ - (NSMenu*) windowsMenu { return _windows_menu; } /* * Managing the Service menu */ /** * Registers the types this application can send and receive over Services. * sendTypes represents the pasteboard types this app can receive in Service * invocation. This is used to set up the services menu of this app -- an * item is added for each registered service that can accept one of sendTypes * or return one of returnTypes */ - (void) registerServicesMenuSendTypes: (NSArray *)sendTypes returnTypes: (NSArray *)returnTypes { [_listener registerSendTypes: sendTypes returnTypes: returnTypes]; } /**

Returns the services menu of the receiver.

See Also: -setServicesMenu:

*/ - (NSMenu *) servicesMenu { return [_listener servicesMenu]; } /**

Returns the services provided previously registered using the * -setServicesProvider: method.

See Also: -setServicesProvider:

*/ - (id) servicesProvider { return [_listener servicesProvider]; } /**

ets the services menu for the receiver. This should be called, otherwise * warnings will be generated by the main event loop, which is in charge of * updating all menus, including the Services menu.

*

See Also: -servicesMenu

*/ - (void) setServicesMenu: (NSMenu *)aMenu { [_listener setServicesMenu: aMenu]; } /** * Sets the object which provides services to other applications.
* Passing a nil value for anObject will result in the provision of * services to other applications by this application being disabled.
* See [NSPasteboard] for information about providing services. */ - (void) setServicesProvider: (id)anObject { [_listener setServicesProvider: anObject]; } /** * Return an object capable of sending and receiving the specified sendType * and returnType in a services interaction. NSApp is generally the last * responder to get this request, and the implementation passes it on to the * delegate if it handles it and is not itself an [NSResponder], or returns * nil otherwise. */ - (id) validRequestorForSendType: (NSString *)sendType returnType: (NSString *)returnType { if (_delegate != nil && ![_delegate isKindOfClass: [NSResponder class]] && [_delegate respondsToSelector: @selector(validRequestorForSendType:returnType:)]) return [_delegate validRequestorForSendType: sendType returnType: returnType]; return nil; } /** * Returns the default drawing context for the app. */ - (NSGraphicsContext *) context { return _default_context; } /** * NSLogs an exception without raising it. */ - (void) reportException: (NSException *)anException { if (anException) NSLog (_(@"reported exception - %@"), anException); } - (BOOL) presentError: (NSError *)error { NSAlert *alert; NSInteger result; error = [self willPresentError: error]; alert = [NSAlert alertWithError: error]; result = [alert runModal]; if (result != NSAlertErrorReturn) { // Convert result (1, 0, -1) into index (0, 1, 2) result = 1 - result; return [[error recoveryAttempter] attemptRecoveryFromError: error optionIndex: result]; } else { return NO; } } struct _DelegateWrapper { id delegate; SEL selector; NSError *error; void *context; }; - (void) presentError: (NSError*)error modalForWindow: (NSWindow*)window delegate: (id)delegate didPresentSelector: (SEL)sel contextInfo: (void*)context { NSAlert *alert; struct _DelegateWrapper *wrapper; error = [self willPresentError: error]; alert = [NSAlert alertWithError: error]; // FIXME: Who is trying to recover the error? wrapper = malloc(sizeof(struct _DelegateWrapper)); wrapper->delegate = delegate; wrapper->selector = sel; wrapper->error = error; wrapper->context = context; [alert beginSheetModalForWindow: window modalDelegate: self didEndSelector: @selector(_didPresentError:returnCode:contextInfo:) contextInfo: wrapper]; } - (void) _didPresentError: (NSWindow*)sheet returnCode: (NSInteger)result contextInfo: (void*)context { struct _DelegateWrapper *wrapper; id delegate; SEL sel; NSError *error; void *orgContext; BOOL recover; wrapper = (struct _DelegateWrapper*)context; delegate = wrapper->delegate; sel = wrapper->selector; error = wrapper->error; orgContext = wrapper->context; free(wrapper); if (result != NSAlertErrorReturn) { // Convert result (1, 0, -1) into index (0, 1, 2) result = 1 - result; recover = [[error recoveryAttempter] attemptRecoveryFromError: error optionIndex: result]; } else { recover = NO; } if ([delegate respondsToSelector: sel]) { void (*didEnd)(id, SEL, BOOL, void*); didEnd = (void (*)(id, SEL, BOOL, void*))[delegate methodForSelector: sel]; didEnd(delegate, sel, recover, orgContext); } } - (NSError*) willPresentError: (NSError*)error { if ([_delegate respondsToSelector: @selector(application:willPresentError:)]) { return [_delegate application: self willPresentError: error]; } else { return error; } } /** * Requests the application terminates the application. First an * -applicationShouldTerminate: message is sent to the delegate, and only if * it returns NSTerminateNow will termination be * carried out.
* The old version of -applicationShouldTerminate: returned a BOOL, and this * should still work as YES is * equivalent to NSTerminateNow and NO is * equivalent to NSTerminateCancel. */ - (void) terminate: (id)sender { NSDocumentController *sdc; NSApplicationTerminateReply termination; /* First ask the shared document controller to save any unsaved changes */ sdc = [NSDocumentController sharedDocumentController]; if ([[sdc documentClassNames] count] > 0) { if ([sdc reviewUnsavedDocumentsWithAlertTitle: _(@"Quit") cancellable: YES] == NO) { return; } } /* Now ask the application delegate whether its okay to terminate */ termination = NSTerminateNow; if ([_delegate respondsToSelector: @selector(applicationShouldTerminate:)]) { /* The old API has applicationShouldTerminate: return a BOOL, * so if we are linked in to an application which used that * API, the delegate might return a BOOL rather than an * NSTerminateNow. That's fine as both NSTerminateNow * and BOOL are integral types (though potentially of different sizes), * and NSTerminateNow is defined as YES and NSTerminateCancel as NO. * So all we need to do is mask the low byte of the return value in * case there is uninitialised random data in the higher bytes. */ termination = ([_delegate applicationShouldTerminate: self] & 0xff); } if (termination == NSTerminateNow) { [self replyToApplicationShouldTerminate: YES]; } /* Don't need to do anything on NSTerminateLater, as long as user code follows the contract (to call replyTo... later). */ } /** * Terminates the app if shouldTerminate is YES, otherwise does nothing. * This should be called by user code if a delegate has returned * NSTerminateLater to an -applicationShouldTerminate: message. */ - (void) replyToApplicationShouldTerminate: (BOOL)shouldTerminate { // Prevent cycles in terminate: call. if (shouldTerminate && _app_is_running) { [nc postNotificationName: NSApplicationWillTerminateNotification object: self]; _app_is_running = NO; GSRemoveIcon(_app_icon_window); [[self windows] makeObjectsPerformSelector: @selector(close)]; [NSCursor setHiddenUntilMouseMoves: NO]; /* Store our user information. */ [[NSUserDefaults standardUserDefaults] synchronize]; /* Tell the Workspace that we really did terminate. */ [[[NSWorkspace sharedWorkspace] notificationCenter] postNotificationName: NSWorkspaceDidTerminateApplicationNotification object: [NSWorkspace sharedWorkspace] userInfo: [self _notificationUserInfo]]; /* Destroy the main run loop pool (this also destroys any nested pools which might have been created inside this one). */ DESTROY (_runLoopPool); /* Now free the NSApplication object. Enclose the operation into an autorelease pool, in case some -dealloc method needs to use any temporary object. */ { NSAutoreleasePool *pool; IF_NO_GC(pool = [arpClass new]); DESTROY(NSApp); DESTROY(pool); } /* And finally, stop the program. */ exit(0); } } - (void) replyToOpenOrPrint: (NSApplicationDelegateReply)reply { // FIXME } /** * Returns the application's delegate, as set by the -setDelegate: method.
*

The application delegate will automatically be sent various * notifications (as long as it implements the appropriate methods) * when application events occur. The method to handle each of these * notifications has name mirroring the notification name, so for instance * an NSApplicationDidBecomeActiveNotification is handled by an * applicationDidBecomeActive: method. *

* * NSApplicationDidBecomeActiveNotification * NSApplicationDidFinishLaunchingNotification * NSApplicationDidHideNotification * NSApplicationDidResignActiveNotification * NSApplicationDidUnhideNotification * NSApplicationDidUpdateNotification * NSApplicationWillBecomeActiveNotification * NSApplicationWillFinishLaunchingNotification * NSApplicationWillHideNotification * NSApplicationWillResignActiveNotification * NSApplicationWillTerminateNotification * NSApplicationWillUnhideNotification * NSApplicationWillUpdateNotification * *

The delegate is also sent various messages to ask for authorisation * to perform actions, or to ask it to perform actions (again, as long * as it implements the appropriate methods). *

* * application:shouldTerminateAfterLastWindowClosed: * application:shouldOpenUntitledFile: * application:openFile: * application:openFiles: * application:openFileWithoutUI: * application:openTempFile: * application:openUntitledFile: * application:shouldOpenUntitledFile: * application:printFile: * application:shouldTerminate: * application:shouldTerminateAfterLastWindowClosed: * *

The delegate is also called upon to respond to any actions which * are not handled by a window, a window delgate, or by the application * object itself. This is controlled by the -targetForAction: method. *

*

Finally, the application delegate is responsible for handling * messages sent to the application from remote processes (see the * section documenting distributed objects for [NSPasteboard]). *

*

See -setDelegate: and [(NSApplicationDelegate)] for more information.

*/ - (id) delegate { return _delegate; } /** * Sets the delegate of the application to anObject.
*

Beware, this does not retain anObject, so you must be sure * that, in the event of anObject being deallocated, you * stop it being the application delagate by calling this * method again with another object (or nil) as the argument. *

*

See -delegate and [(NSApplicationDelegate)] for more information.

*/ - (void) setDelegate: (id)anObject { if (_delegate) [nc removeObserver: _delegate name: nil object: self]; _delegate = anObject; #define SET_DELEGATE_NOTIFICATION(notif_name) \ if ([_delegate respondsToSelector: @selector(application##notif_name:)]) \ [nc addObserver: _delegate \ selector: @selector(application##notif_name:) \ name: NSApplication##notif_name##Notification object: self] SET_DELEGATE_NOTIFICATION(DidBecomeActive); SET_DELEGATE_NOTIFICATION(DidFinishLaunching); SET_DELEGATE_NOTIFICATION(DidHide); SET_DELEGATE_NOTIFICATION(DidResignActive); SET_DELEGATE_NOTIFICATION(DidUnhide); SET_DELEGATE_NOTIFICATION(DidUpdate); SET_DELEGATE_NOTIFICATION(WillBecomeActive); SET_DELEGATE_NOTIFICATION(WillFinishLaunching); SET_DELEGATE_NOTIFICATION(WillHide); SET_DELEGATE_NOTIFICATION(WillResignActive); SET_DELEGATE_NOTIFICATION(WillTerminate); SET_DELEGATE_NOTIFICATION(WillUnhide); SET_DELEGATE_NOTIFICATION(WillUpdate); } /* * Methods for scripting */ /** * OS X scripting method to return document objects being handled by * application. Not implemented yet under GNUstep. */ - (NSArray *) orderedDocuments { // FIXME return nil; } /** * OS X scripting method to return windows in front-to-back on-screen order * for scriptable windows. * The GNUstep implementation returns all the windows excluding NSPanels. * some backends may return an array in an unspecified order. */ - (NSArray *) orderedWindows { NSArray *arr = GSOrderedWindows(); NSMutableArray *ret = [[NSMutableArray alloc] initWithCapacity:[arr count]]; NSEnumerator *iter = [arr objectEnumerator]; id win; while ((win = [iter nextObject])) { if (![win isKindOfClass:[NSPanel class]]) [ret addObject:win]; } return AUTORELEASE(ret); } /* * Methods for user attention requests */ /** * Cancels a request previously made through calling -requestUserAttention: . * Note that request is cancelled automatically if user activates the app. */ - (void) cancelUserAttentionRequest: (NSInteger)request { // FIXME } /** * Method that on OS X makes the icon jump in the doc. Mercifully, this is * unimplemented under GNUstep. If it were implemented, requestType * could be either NSCriticalRequest (bounce endlessly) or * NSInformationalRequest (bounce for one second). */ - (NSInteger) requestUserAttention: (NSRequestUserAttentionType)requestType { // FIXME return 0; } /* * NSCoding protocol */ - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { /* if (_delegate != nil) { [aCoder encodeObject: _delegate forKey: @"NSDelegate"]; } [aCoder encodeObject: _main_menu forKey: @"NSMainMenu"]; // ??? [aCoder encodeObject: _windows_menu forKey: @"NSWindowsMenu"]; // ??? */ } else { [aCoder encodeConditionalObject: _delegate]; [aCoder encodeObject: _main_menu]; [aCoder encodeConditionalObject: _windows_menu]; } } - (id) initWithCoder: (NSCoder*)aDecoder { id obj; [super initWithCoder: aDecoder]; if ([aDecoder allowsKeyedCoding]) { /* if ([aDecoder containsValueForKey: @"NSDelegate"]) { obj = [aDecoder decodeObjectForKey: @"NSDelegate"]; [self setDelegate: obj]; } obj = [aDecoder decodeObjectForKey: @"NSMainMenu"]; [self setMainMenu: obj]; obj = [aDecoder decodeObjectForKey: @"NSWindowsMenu"]; [self setWindowsMenu: obj]; */ } else { obj = [aDecoder decodeObject]; [self setDelegate: obj]; obj = [aDecoder decodeObject]; [self setMainMenu: obj]; obj = [aDecoder decodeObject]; [self setWindowsMenu: obj]; } return self; } @end /* NSApplication */ @implementation NSApplication (Private) - (void) _appIconInit { NSDictionary *infoDict; NSString *appIconFile; NSImage *image = nil; NSAppIconView *iv; NSUInteger mask = NSIconWindowMask; BOOL suppress; suppress = [[NSUserDefaults standardUserDefaults] boolForKey: @"GSSuppressAppIcon"]; #if MINI_ICON if (suppress) { mask = NSMiniaturizableWindowMask; } #endif infoDict = [[NSBundle mainBundle] infoDictionary]; appIconFile = [infoDict objectForKey: @"NSIcon"]; if (appIconFile && ![appIconFile isEqual: @""]) { image = [NSImage imageNamed: appIconFile]; } // Try to look up the icns file. appIconFile = [infoDict objectForKey: @"CFBundleIconFile"]; if (appIconFile && ![appIconFile isEqual: @""]) { image = [NSImage imageNamed: appIconFile]; } if (image == nil) { image = [NSImage imageNamed: @"GNUstep"]; } else { /* Set the new image to be named 'NSApplicationIcon' ... to do that we * must first check that any existing image of the same name has its * name removed. */ [(NSImage*)[NSImage imageNamed: @"NSApplicationIcon"] setName: nil]; // We need to copy the image as we may have a proxy here image = AUTORELEASE([image copy]); [image setName: @"NSApplicationIcon"]; } [self setApplicationIconImage: image]; _app_icon_window = [[NSIconWindow alloc] initWithContentRect: NSZeroRect styleMask: mask backing: NSBackingStoreRetained defer: NO screen: nil]; { NSRect iconContentRect = GSGetIconFrame(_app_icon_window); NSRect iconFrame = [_app_icon_window frameRectForContentRect: iconContentRect]; NSRect iconViewFrame = NSMakeRect(0, 0, iconContentRect.size.width, iconContentRect.size.height); [_app_icon_window setFrame: iconFrame display: YES]; iv = [[NSAppIconView alloc] initWithFrame: iconViewFrame]; [iv setImage: _app_icon]; [_app_icon_window setContentView: iv]; RELEASE(iv); } if (NO == suppress) { /* The icon window is not suppressed ... display it. */ [_app_icon_window orderFrontRegardless]; } } - (NSDictionary*) _notificationUserInfo { NSString *path; NSString *port; NSNumber *processIdentifier; NSDictionary *userInfo; processIdentifier = [NSNumber numberWithInt: [[NSProcessInfo processInfo] processIdentifier]]; port = [(GSServicesManager*)_listener port]; path = [[NSBundle mainBundle] bundlePath]; if (port == nil) { if (path == nil) { userInfo = [NSDictionary dictionaryWithObjectsAndKeys: processIdentifier, @"NSApplicationProcessIdentifier", nil]; } else { userInfo = [NSDictionary dictionaryWithObjectsAndKeys: path, @"NSApplicationPath", processIdentifier, @"NSApplicationProcessIdentifier", nil]; } } else if (path == nil) { userInfo = [NSDictionary dictionaryWithObjectsAndKeys: port, @"NSApplicationName", processIdentifier, @"NSApplicationProcessIdentifier", nil]; } else { userInfo = [NSDictionary dictionaryWithObjectsAndKeys: port, @"NSApplicationName", path, @"NSApplicationPath", processIdentifier, @"NSApplicationProcessIdentifier", nil]; } return userInfo; } - (void) _openDocument: (NSString*)filePath { [_listener application: self openFile: filePath]; } - (id) _targetForAction: (SEL)aSelector window: (NSWindow *)window { id resp, delegate; NSDocumentController *sdc; if (window == nil) { return nil; } /* traverse the responder chain including the window's delegate */ resp = [window firstResponder]; while (resp != nil && resp != self) { if ([resp respondsToSelector: aSelector]) { return resp; } if (resp == window) { delegate = [window delegate]; if ([delegate respondsToSelector: aSelector]) { return delegate; } } resp = [resp nextResponder]; } /* in a document based app try the window's document */ sdc = [NSDocumentController sharedDocumentController]; if ([[sdc documentClassNames] count] > 0) { resp = [sdc documentForWindow: window]; if (resp != nil && [resp respondsToSelector: aSelector]) { return resp; } } /* nothing found */ return nil; } - (id) _targetForAction: (SEL)aSelector keyWindow: (NSWindow *)keyWindow mainWindow: (NSWindow *)mainWindow { NSDocumentController *sdc; id resp; if (aSelector == NULL) return nil; /* start looking in the key window's responder chain */ resp = [self _targetForAction: aSelector window: keyWindow]; if (resp != nil) { return resp; } /* next check the main window's responder chain (provided it is not * the key window) */ if (mainWindow != keyWindow) { resp = [self _targetForAction: aSelector window: mainWindow]; if (resp != nil) { return resp; } } /* try the shared application imstance and its delegate */ if ([self respondsToSelector: aSelector]) { return self; } if (_delegate != nil && [_delegate respondsToSelector: aSelector]) { return _delegate; } /* Try the NSApplication's responder list to determine if any of them * respond to the selector. */ resp = [self nextResponder]; while (resp != nil) { if ([resp respondsToSelector: aSelector]) { return resp; } resp = [resp nextResponder]; } /* as last resort in a document based app, try the document controller */ sdc = [NSDocumentController sharedDocumentController]; if ([[sdc documentClassNames] count] > 0 && [sdc respondsToSelector: aSelector]) { return sdc; } /* give up */ return nil; } - (void) _windowDidBecomeKey: (NSNotification*) notification { id obj = [notification object]; if (_key_window == nil && [obj isKindOfClass: [NSWindow class]]) { _key_window = obj; [_main_menu update]; } else if (_key_window != obj) { NSLog(@"Bogus attempt to set key window"); } } - (void) _windowDidBecomeMain: (NSNotification*) notification { id obj = [notification object]; if (_main_window == nil && [obj isKindOfClass: [NSWindow class]]) { _main_window = obj; [_main_menu update]; } else if (_main_window != obj) { NSLog(@"Bogus attempt to set main window"); } } - (void) _windowDidResignKey: (NSNotification*) notification { id obj = [notification object]; if (_key_window == obj) { _key_window = nil; [NSCursor setHiddenUntilMouseMoves: NO]; } else { NSLog(@"Bogus attempt to resign key window"); } } - (void) _windowDidResignMain: (NSNotification*) notification { id obj = [notification object]; if (_main_window == obj) { _main_window = nil; } else { NSLog(@"Bogus attempt to resign key window"); } } - (void) _lastWindowClosed { if ([_delegate respondsToSelector: @selector(applicationShouldTerminateAfterLastWindowClosed:)]) { if ([_delegate applicationShouldTerminateAfterLastWindowClosed: self]) { [self terminate: self]; } } /* wlux 2009-10-17: If we use MS Windows style menus, terminate the application by default when the last window is closed. */ else if (NSInterfaceStyleForKey(@"NSMenuInterfaceStyle", nil) == NSWindows95InterfaceStyle) { [self terminate: self]; } } - (void) _windowWillClose: (NSNotification*) notification { NSWindow *win = [notification object]; if (_app_is_running) { /* FIXME Don't use GSOrderedWindows(), since it may not return all windows when the application is hidden. E.g., given a hidden application with a single window with canHide == NO, if the user closes this window it would appear as if the last window was closed. */ NSArray *windows_list = GSOrderedWindows(); NSEnumerator *iter = [windows_list objectEnumerator]; BOOL wasLast = YES; NSWindow *tmp; while ((tmp = [iter nextObject])) { if (tmp != win && [tmp canBecomeMainWindow] == YES) { wasLast = NO; break; } } /* Perform _lastWindowDidClose at the end of the event loop cycle so that all interested objects are notified before we terminate the application. In particular, this means that a modified document associated with the closed window has been closed before -terminate: is called and therefore the user isn't asked twice whether she wants to save that document's unsaved changes. */ if (wasLast) { [self performSelector: @selector(_lastWindowClosed) withObject: nil afterDelay: 0.1]; } } } - (void) _workspaceNotification: (NSNotification*) notification { NSString *name = [notification name]; NSDictionary *info = [notification userInfo]; /* * Handle hiding and unhiding of this app if necessary. */ if ([name isEqualToString: GSUnhideAllApplicationsNotification] == YES) { [self unhideWithoutActivation]; } else if ([name isEqualToString: GSHideOtherApplicationsNotification] == YES) { NSString *port = [info objectForKey: @"NSApplicationName"]; if ([port isEqual: [[GSServicesManager manager] port]] == NO) { [self hide: self]; } } } - (NSArray *) _openFiles { NSMutableArray *files = nil; NSArray *args = [[NSProcessInfo processInfo] arguments]; NSEnumerator *en = [args objectEnumerator]; NSString *file = nil; [en nextObject]; // skip the first element, which is always empty... while ((file = [en nextObject]) != nil) { if ([file length] == 0) { continue; } if ([file characterAtIndex: 0] != '-') { if (files == nil) { files = [NSMutableArray array]; } [files addObject: file]; } else { break; } } return files; } - (NSMenu *) _dockMenu { NSUInteger i, j, n; NSMenu *dockMenu, *windowsMenu; // ask delegate for a dock menu, if none create a new one dockMenu = nil; if ([_delegate respondsToSelector: @selector(applicationDockMenu:)]) { // NB we make a copy of the menu since we are going to modify it dockMenu = [[_delegate applicationDockMenu: self] copy]; } if (dockMenu == nil) { dockMenu = [[NSMenu alloc] initWithTitle:@""]; } // copy window menu entries to the top of the menu windowsMenu = [NSApp windowsMenu]; for (i = j = 0, n = [windowsMenu numberOfItems]; i < n; i++) { NSMenuItem *item = [windowsMenu itemAtIndex: i]; if ([[item target] isKindOfClass:[NSWindow class]] && sel_isEqual([item action], @selector(makeKeyAndOrderFront:))) { [[dockMenu insertItemWithTitle: [item title] action: @selector(makeKeyAndOrderFront:) keyEquivalent: @"" atIndex: j++] setTarget: [item target]]; } } if (j > 0) { [dockMenu insertItem: [NSMenuItem separatorItem] atIndex: j++]; } // insert standard entries to show or hide and to quit the application at // the bottom if (j < [dockMenu numberOfItems]) { [dockMenu addItem: [NSMenuItem separatorItem]]; } if ([self isHidden]) { [dockMenu addItemWithTitle:_(@"Show") action:@selector(unhide:) keyEquivalent:@""]; } else { [dockMenu addItemWithTitle:_(@"Hide") action:@selector(hide:) keyEquivalent:@""]; } [dockMenu addItemWithTitle:_(@"Quit") action:@selector(terminate:) keyEquivalent:@""]; // return the menu return dockMenu; } @end // NSApplication (Private) @implementation NSApplication (GSGUIInternal) - (void) _windowWillDealloc: (NSWindow *)window { if (window == _key_window) _key_window = nil; if (window == _main_window) _main_window = nil; } @end gnustep-gui-0.24.0/Source/GSBindingHelpers.h0000664000076500007650000000514611727365361020523 0ustar brains99brains99/** Private Bindings helper functions for GNUstep Copyright (C) 2007 Free Software Foundation, Inc. Written by: Chris Farber Date: 2007 Author: Fred Kiefer Date: Decembre 2007 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GS_BINDING_HELPER_H #define _GS_BINDING_HELPER_H #import @class NSString; @class NSDictionary; @class NSMutableDictionary; @class NSArray; @interface GSKeyValueBinding : NSObject { @public NSDictionary *info; id src; } + (void) exposeBinding: (NSString *)binding forClass: (Class)clazz; + (NSArray *) exposedBindingsForClass: (Class)clazz; + (GSKeyValueBinding *) getBinding: (NSString *)binding forObject: (id)anObject; + (NSDictionary *) infoForBinding: (NSString *)binding forObject: (id)anObject; + (void) unbind: (NSString *)binding forObject: (id)anObject; + (void) unbindAllForObject: (id)anObject; - (id) initWithBinding: (NSString *)binding withName: (NSString *)name toObject: (id)dest withKeyPath: (NSString *)keyPath options: (NSDictionary *)options fromObject: (id)source; - (void) setValueFor: (NSString *)binding; - (void) reverseSetValue: (id)value; - (void) reverseSetValueFor: (NSString *)binding; - (id) destinationValue; - (id) sourceValueFor: (NSString *)binding; /* Transforms the value with a value transformer, if specified and available, * and takes care of any placeholders */ - (id) transformValue: (id)value withOptions: (NSDictionary *)options; - (id) reverseTransformValue: (id)value withOptions: (NSDictionary *)options; @end @interface GSKeyValueOrBinding : GSKeyValueBinding @end @interface GSKeyValueAndBinding : GSKeyValueBinding @end #endif //_GS_BINDING_HELPER_H gnustep-gui-0.24.0/Source/GSAutocompleteWindow.m0000664000076500007650000003174112221751471021453 0ustar brains99brains99/* Copyright (C) 2013 Free Software Foundation, Inc. Author: German A. Arias Date: 2013 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSBox.h" #import "AppKit/NSEvent.h" #import "AppKit/NSScreen.h" #import "AppKit/NSScrollView.h" #import "AppKit/NSTableView.h" #import "AppKit/NSTableColumn.h" #import "AppKit/NSText.h" #import "AppKit/NSTextView.h" #import "GNUstepGUI/GSTheme.h" #import "GSAutocompleteWindow.h" static GSAutocompleteWindow *gsWindow = nil; @interface NSTextView (Additions) - (NSRect) rectForCharacterRange: (NSRange)aRange; @end @interface GSAutocompleteView : NSTableView { } @end @implementation GSAutocompleteView - (BOOL) acceptsFirstMouse: (NSEvent *)event { return YES; } @end @implementation GSAutocompleteWindow + (GSAutocompleteWindow *) defaultWindow { if (gsWindow == nil) gsWindow = [[self alloc] initWithContentRect: NSMakeRect(0,0,200,200) styleMask: NSBorderlessWindowMask backing: NSBackingStoreNonretained defer: YES]; return gsWindow; } - (id) initWithContentRect: (NSRect)contentRect styleMask: (NSUInteger)aStyle backing: (NSBackingStoreType)bufferingType defer: (BOOL)flag { NSBox *box; NSScrollView *scrollView; NSTableColumn *column; NSCell *cell; self = [super initWithContentRect: contentRect styleMask: aStyle backing: bufferingType defer: flag]; if (nil == self) return self; // Init vars _words = nil; _originalWord = nil; [self setLevel: NSPopUpMenuWindowLevel]; [self setBecomesKeyOnlyIfNeeded: YES]; box = [[NSBox alloc] initWithFrame: contentRect]; [box setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [box setBorderType: NSLineBorder]; [box setTitlePosition: NSNoTitle]; [box setContentViewMargins: NSMakeSize(0, 0)]; [self setContentView: box]; [box release]; _tableView = [[GSAutocompleteView alloc] initWithFrame: NSMakeRect(0, 0, 100, 100)]; [_tableView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [_tableView setDrawsGrid: NO]; [_tableView setAllowsEmptySelection: YES]; [_tableView setAllowsMultipleSelection: NO]; [_tableView setAutoresizesAllColumnsToFit: YES]; [_tableView setHeaderView: nil]; [_tableView setCornerView: nil]; column = [[NSTableColumn alloc] initWithIdentifier: @"content"]; cell = [[NSCell alloc] initTextCell: @""]; [column setDataCell: cell]; [cell release]; [_tableView addTableColumn: column]; [column release]; [_tableView setDataSource: self]; [_tableView setDelegate: self]; [_tableView setAction: @selector(clickItem:)]; [_tableView setTarget: self]; scrollView = [[NSScrollView alloc] initWithFrame: NSMakeRect(contentRect.origin.x, contentRect.origin.y, contentRect.size.width, contentRect.size.height)]; [scrollView setHasVerticalScroller: YES]; [scrollView setDocumentView: _tableView]; [_tableView release]; [box setContentView: scrollView]; [scrollView release]; return self; } - (void) dealloc { /* Don't release _words and _originalWord, since these are * released when the autocomplete is final or canceled. */ [super dealloc]; } - (BOOL) canBecomeKeyWindow { return YES; } - (void) layout { NSSize bsize = [[GSTheme theme] sizeForBorderType: NSLineBorder]; CGFloat windowWidth, windowHeight; NSInteger num = [_words count]; NSUInteger widest = 0; NSCell *cell; NSString *word, *widestWord = nil; NSEnumerator *enumerator; /* If the suggested words are more than 10, * we limit the window to show 10. */ if (num > 10) { num = 10; } /* Lookup the widest word to calculate the width * of the window. */ enumerator = [_words objectEnumerator]; while ((word = [enumerator nextObject])) { if ([word length] > widest) { widest = [word length]; widestWord = word; } } // Width cell = [[_tableView tableColumnWithIdentifier: @"content"] dataCell]; windowWidth = 1.1*[cell _sizeText: widestWord].width + [NSScroller scrollerWidth] + 2*bsize.width; //Height windowHeight = 2*bsize.height + [_tableView rowHeight]*num + [_tableView intercellSpacing].height; [self setFrame: NSMakeRect(0, 0, windowWidth, windowHeight) display: NO]; } - (void) computePosition { NSRect screenFrame; NSRect rect; NSRect stringRect; NSPoint point; NSInterfaceStyle style; style = NSInterfaceStyleForKey(@"NSScrollViewInterfaceStyle", nil); rect = [self frame]; screenFrame = [[[_textView window] screen] frame]; // Get the rectangle to draw the current word. stringRect = [_textView rectForCharacterRange: _range]; // Convert the origin point to screen coordinates. point = [[_textView window] convertBaseToScreen: [_textView convertRect: stringRect toView: nil].origin]; // Calculate the origin point to the window. if (style == NSMacintoshInterfaceStyle || style == NSWindows95InterfaceStyle) { rect.origin.x = point.x - 4; } else { rect.origin.x = point.x - [NSScroller scrollerWidth] - 4; } rect.origin.y = point.y - rect.size.height; // If part of the window is off screen, change the origin point. if (screenFrame.size.width < (rect.origin.x + rect.size.width)) { rect.origin.x = screenFrame.size.width - rect.size.width; } else if (rect.origin.x < 0) { rect.origin.x = 0; } // If no space under the string, we display the window over this. if (rect.origin.y < 0) { rect.origin.y = point.y + stringRect.size.height; } [self setFrame: rect display: NO]; } - (NSArray *) words { return _words; } - (void) displayForTextView: (NSTextView *)textView { _textView = textView; _range = [_textView rangeForUserCompletion]; [self reloadData]; if ([_words count] > 0) { [self runModalWindow]; } else { [self close]; } } - (void) runModalWindow { NSWindow *onWindow; NSNotificationCenter *notificationCenter; onWindow = [_textView window]; notificationCenter = [NSNotificationCenter defaultCenter]; // Get the appropriate notifications to cancel the autocomplete. [notificationCenter addObserver: self selector: @selector(onWindowEdited:) name: NSWindowWillCloseNotification object: onWindow]; [notificationCenter addObserver: self selector: @selector(onWindowEdited:) name: NSWindowWillMiniaturizeNotification object: onWindow]; // The notification below don't seems to work. [notificationCenter addObserver: self selector: @selector(onWindowEdited:) name: NSWindowWillMoveNotification object: onWindow]; // FIX ME: The notification below doesn't exist currently // [nc addObserver: self selector: @selector(onWindowEdited:) // name: NSWindowWillResizeNotification object: onWindow]; // FIXME: The code below must be removed when the notifications over will work [notificationCenter addObserver: self selector: @selector(onWindowEdited:) name: NSWindowDidMoveNotification object: onWindow]; [notificationCenter addObserver: self selector: @selector(onWindowEdited:) name: NSWindowDidResizeNotification object: onWindow]; // End of the code to remove [self orderFront: self]; [self makeFirstResponder: _tableView]; [self runLoop]; [notificationCenter removeObserver: self name: nil object: onWindow]; [self close]; [onWindow makeFirstResponder: _textView]; } - (void) runLoop { NSEvent *event; NSDate *limit = [NSDate distantFuture]; unichar key; CREATE_AUTORELEASE_POOL (pool); _stopped = NO; while (YES) { event = [NSApp nextEventMatchingMask: NSAnyEventMask untilDate: limit inMode: NSDefaultRunLoopMode dequeue: YES]; if ([event type] == NSLeftMouseDown || [event type] == NSRightMouseDown) { if ([event window] != self) { [self updateTextViewWithMovement: NSCancelTextMovement isFinal: NO]; break; } else { [NSApp sendEvent: event]; } } else if ([event type] == NSKeyDown) { key = [[event characters] characterAtIndex: 0]; if (key == NSUpArrowFunctionKey) { [self moveUpSelection]; [self updateTextViewWithMovement: NSUpTextMovement isFinal: NO]; } else if (key == NSDownArrowFunctionKey) { [self moveDownSelection]; [self updateTextViewWithMovement: NSDownTextMovement isFinal: NO]; } else if (key == NSEnterCharacter || key == NSCarriageReturnCharacter || key == NSNewlineCharacter) { [self clickItem: self]; break; } else if (key == 0x001b || key == NSRightArrowFunctionKey || key == NSLeftArrowFunctionKey) { [self updateTextViewWithMovement: NSCancelTextMovement isFinal: NO]; break; } else { // First remove the selected text. [_textView replaceCharactersInRange: [_textView selectedRange] withString: @""]; // Send the even to update the text container. [NSApp sendEvent: event]; // Reload data. [self reloadData]; } } else { [NSApp sendEvent: event]; } if (_stopped) break; } [pool drain]; } - (void) onWindowEdited: (NSNotification *)notification { _stopped = YES; [self updateTextViewWithMovement: NSCancelTextMovement isFinal: NO]; } - (void) reloadData { _range = [_textView rangeForUserCompletion]; if (_range.location == NSNotFound || _range.length == 0) { _stopped = YES; } else { NSInteger index = 0; NSString *word; NSArray *newWords; word = [[_textView string] substringWithRange: _range]; ASSIGN(_originalWord, word); newWords = [_textView completionsForPartialWordRange: _range indexOfSelectedItem: &index]; if ([newWords count] > 0) { ASSIGN(_words, newWords); [_tableView reloadData]; [self layout]; [self computePosition]; [_tableView selectRow: index byExtendingSelection: NO]; [_tableView scrollRowToVisible: index]; [self updateTextViewWithMovement: NSOtherTextMovement isFinal: NO]; } else { [_tableView reloadData]; _stopped = YES; [self updateTextViewWithMovement: NSCancelTextMovement isFinal: NO]; } } } - (void) updateTextViewWithMovement: (NSInteger)movement isFinal: (BOOL)flag { NSString *word; if (movement != NSCancelTextMovement) { NSInteger rowIndex = [_tableView selectedRow]; word = [[_words objectAtIndex: rowIndex] description]; } else { word = _originalWord; } [_textView insertCompletion: word forPartialWordRange: _range movement: movement isFinal: flag]; // Release _words and _originalWords if // autocomplete is final or canceled. if ( (flag) || (movement == NSCancelTextMovement) ) { ASSIGN(_originalWord, nil); ASSIGN(_words, nil); } } // Action method - (void) clickItem: (id)sender { [self updateTextViewWithMovement: NSOtherTextMovement isFinal: YES]; _stopped = YES; } // Key actions methods - (void) moveUpSelection { NSInteger index = [_tableView selectedRow] - 1; if (index > -1 && index < [_tableView numberOfRows]) { [_tableView selectRow: index byExtendingSelection: NO]; [_tableView scrollRowToVisible: index]; } } - (void) moveDownSelection { NSInteger index = [_tableView selectedRow] + 1; if (index > -1 && index < [_tableView numberOfRows]) { [_tableView selectRow: index byExtendingSelection: NO]; [_tableView scrollRowToVisible: index]; } } // Delegate - (int) numberOfRowsInTableView: (NSTableView *)aTableView { return [_words count]; } - (id) tableView: (NSTableView *)aTableView objectValueForTableColumn: (NSTableColumn *)aTableColumn row: (int)rowIndex { return [[_words objectAtIndex: rowIndex] description]; } @end gnustep-gui-0.24.0/Source/GNUmakefile0000664000076500007650000002335112216423340017255 0ustar brains99brains99# # Main makefile for GNUstep GUI Library # Copyright (C) 1997 Free Software Foundation, Inc. # # Author: Scott Christley # # This file is part of the GNUstep GUI Library. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-gui GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../gui.make include $(GNUSTEP_MAKEFILES)/common.make include ../Version include ../config.make # Interface version changes with each minor release libgnustep-gui_INTERFACE_VERSION=${GNUSTEP_GUI_MAJOR_VERSION}.${GNUSTEP_GUI_MINOR_VERSION} srcdir = . PACKAGE_NAME = gnustep-gui LIBRARY_VAR = GNUSTEP_GUI # The library to be compiled LIBRARY_NAME = libgnustep-gui # The Objective-C source files to be compiled libgnustep-gui_C_FILES = # The Objective-C source files to be compiled libgnustep-gui_OBJC_FILES = Functions.m \ NSActionCell.m \ NSAffineTransform.m \ NSAlert.m \ NSAnimation.m \ NSApplication.m \ NSArrayController.m \ NSAttributedString.m \ NSBezierPath.m \ NSBitmapImageRep.m \ NSBitmapImageRep+GIF.m \ NSBitmapImageRep+ICNS.m \ NSBitmapImageRep+JPEG.m \ NSBitmapImageRep+PNG.m \ NSBitmapImageRep+PNM.m \ NSBox.m \ NSBrowser.m \ NSBrowserCell.m \ NSBundleAdditions.m \ NSButton.m \ NSButtonCell.m \ NSCachedImageRep.m \ NSCell.m \ NSClipView.m \ NSCollectionView.m \ NSCollectionViewItem.m \ NSColor.m \ NSColorList.m \ NSColorPanel.m \ NSColorPicker.m \ NSColorSpace.m \ NSColorWell.m \ NSComboBox.m \ NSComboBoxCell.m \ NSControl.m \ NSController.m \ NSCursor.m \ NSCustomImageRep.m \ NSDataLink.m \ NSDataLinkManager.m \ NSDataLinkPanel.m \ NSDocument.m \ NSDocumentController.m \ NSDrawer.m \ NSEPSImageRep.m \ NSEvent.m \ NSFileWrapper.m \ NSFont.m \ NSFontDescriptor.m \ NSFontManager.m \ NSFontPanel.m \ NSForm.m \ NSFormCell.m \ NSGradient.m \ NSGlyphGenerator.m \ NSGraphicsContext.m \ NSHelpPanel.m \ NSHelpManager.m \ NSImage.m \ NSImageCell.m \ NSImageRep.m \ NSImageView.m \ NSInputManager.m \ NSInputServer.m \ NSInterfaceStyle.m \ NSKeyValueBinding.m \ NSLayoutManager.m \ NSLevelIndicator.m \ NSLevelIndicatorCell.m \ NSMatrix.m \ NSMenu.m \ NSMenuView.m \ NSMenuItem.m \ NSMenuItemCell.m \ NSMovie.m \ NSMovieView.m \ NSNib.m \ NSNibBindingConnector.m \ NSNibAXAttributeConnector.m \ NSNibAXRelationshipConnector.m \ NSObjectController.m \ NSOpenGLContext.m \ NSOpenGLPixelFormat.m \ NSOpenGLView.m \ NSOpenPanel.m \ NSOutlineView.m \ NSPageLayout.m \ NSPanel.m \ NSParagraphStyle.m \ NSPopover.m \ NSPopUpButton.m \ NSPopUpButtonCell.m \ NSPrinter.m \ NSPrintInfo.m \ NSPrintOperation.m \ NSPrintPanel.m \ NSProgressIndicator.m \ NSResponder.m \ NSRulerMarker.m \ NSRulerView.m \ NSSavePanel.m \ NSSearchField.m \ NSSearchFieldCell.m \ NSSegmentedCell.m \ NSSegmentedControl.m \ NSScreen.m \ NSScroller.m \ NSScrollView.m \ NSSecureTextField.m \ NSSelection.m \ NSShadow.m \ NSSlider.m \ NSSliderCell.m \ NSSound.m \ NSSpeechSynthesizer.m \ NSSpellChecker.m \ NSSplitView.m \ NSStepper.m \ NSStepperCell.m \ NSStringDrawing.m \ NSStatusBar.m \ NSStatusItem.m \ NSTabView.m \ NSTabViewItem.m \ NSTableColumn.m \ NSTableHeaderView.m \ NSTableHeaderCell.m \ NSTableView.m \ NSText.m \ NSTextAttachment.m \ NSTextBlock.m \ NSTextContainer.m \ NSTextField.m \ NSTextFieldCell.m \ NSTextList.m \ NSTextStorage.m \ NSTextTable.m \ NSTextTableBlock.m \ NSTextView.m \ NSTextView_actions.m \ NSToolbar.m \ NSToolbarItem.m \ NSToolbarItemGroup.m \ NSTokenField.m \ NSTokenFieldCell.m \ NSTrackingArea.m \ NSTreeController.m \ NSTreeNode.m \ NSUserDefaultsController.m \ NSView.m \ NSViewController.m \ NSWindow.m \ NSWindowController.m \ NSWorkspace.m \ GSAnimator.m \ GSAutocompleteWindow.m \ GSDisplayServer.m \ GSHelpManagerPanel.m \ GSInfoPanel.m \ GSMemoryPanel.m \ GSSlideView.m \ GSTextStorage.m \ GSTrackingRect.m \ GSServicesManager.m \ tiff.m \ externs.m \ linking.m \ GSCharacterPanel.m \ GSDragView.m \ GSFontInfo.m \ GSTable.m \ GSHbox.m \ GSVbox.m \ GSKeyBindingAction.m \ GSKeyBindingTable.m \ GSTextFinder.m \ GSLayoutManager.m \ GSTypesetter.m \ GSHorizontalTypesetter.m \ GSGormLoading.m \ GSIconManager.m \ GSImageMagickImageRep.m \ GSNibLoading.m \ GSTheme.m \ GSThemeDrawing.m \ GSThemeInspector.m \ GSThemeMenu.m \ GSThemeOpenSavePanels.m \ GSThemePanel.m \ GSThemeTools.m \ GSTitleView.m \ GSToolTips.m \ GSToolbarView.m \ GSToolbarCustomizationPalette.m \ GSStandardWindowDecorationView.m \ GSWindowDecorationView.m \ GSPrinting.m \ GSPrintOperation.m \ GSEPSPrintOperation.m \ GSPDFPrintOperation.m \ GSModelLoaderFactory.m \ GSGormLoader.m \ GSGModelLoader.m \ GSNibLoader.m \ GSXibLoader.m \ GSXibLoading.m \ GSHelpAttachment.m # Turn off NSMenuItem warning that NSMenuItem conforms to , # but does not implement 's methods itself (it inherits # their implementation) NSMenuItem.m_FILE_FLAGS = -Wno-protocol ifneq ($(FOUNDATION_LIB), fd) libgnustep-gui_OBJC_FILES += NSPasteboard.m endif libgnustep-gui_HEADER_FILES_DIR = ../Headers/Additions/GNUstepGUI libgnustep-gui_HEADER_FILES_INSTALL_DIR = /GNUstepGUI COCOA_HEADERS = \ Cocoa.h APPKIT_HEADERS = \ AppKit.h \ AppKitDefines.h \ AppKitExceptions.h \ NSActionCell.h \ NSAffineTransform.h \ NSAlert.h \ NSAnimation.h \ NSApplication.h \ NSArrayController.h \ NSBezierPath.h \ NSBox.h \ NSBitmapImageRep.h \ NSBrowser.h \ NSBrowserCell.h \ NSButton.h \ NSButtonCell.h \ NSCachedImageRep.h \ NSCell.h \ NSClipView.h \ NSCollectionView.h \ NSCollectionViewItem.h \ NSColor.h \ NSColorList.h \ NSColorPanel.h \ NSColorPicker.h \ NSColorSpace.h \ NSColorWell.h \ NSComboBox.h \ NSComboBoxCell.h \ NSControl.h \ NSController.h \ NSCursor.h \ NSCustomImageRep.h \ NSDataLink.h \ NSDataLinkManager.h \ NSDataLinkPanel.h \ NSDocument.h \ NSDocumentController.h \ NSDrawer.h \ NSEPSImageRep.h \ NSEvent.h \ NSFileWrapper.h \ NSFont.h \ NSFontDescriptor.h \ NSFontManager.h \ NSFontPanel.h \ NSForm.h \ NSFormCell.h \ NSGradient.h \ NSGlyphGenerator.h \ NSGraphicsContext.h \ NSHelpPanel.h \ NSHelpManager.h \ NSImage.h \ NSImageCell.h \ NSImageRep.h \ NSImageView.h \ NSInputManager.h \ NSInputServer.h \ NSInterfaceStyle.h \ NSKeyValueBinding.h \ NSLayoutManager.h \ NSLevelIndicator.h \ NSLevelIndicatorCell.h \ NSMatrix.h \ NSMenu.h \ NSMenuItem.h \ NSMenuItemCell.h \ NSMenuView.h \ NSMovie.h \ NSMovieView.h \ NSObjectController.h \ NSOpenPanel.h \ NSOpenGL.h \ NSOpenGLView.h \ NSOutlineView.h \ NSPageLayout.h \ NSPanel.h \ NSParagraphStyle.h \ NSPasteboard.h \ NSPopover.h \ NSPopUpButton.h \ NSPopUpButtonCell.h \ NSPrintInfo.h \ NSPrintOperation.h \ NSPrintPanel.h \ NSPrinter.h \ NSProgressIndicator.h \ NSResponder.h \ NSRulerMarker.h \ NSRulerView.h \ NSSavePanel.h \ NSScreen.h \ NSScrollView.h \ NSScroller.h \ NSSearchField.h \ NSSearchFieldCell.h \ NSSecureTextField.h \ NSSegmentedCell.h \ NSSegmentedControl.h \ NSSelection.h \ NSShadow.h \ NSSlider.h \ NSSliderCell.h \ NSSound.h \ NSSpeechSynthesizer.h \ NSSpellChecker.h \ NSSpellServer.h \ NSSplitView.h \ NSStepper.h \ NSStepperCell.h \ NSStringDrawing.h \ NSStatusBar.h \ NSStatusItem.h \ NSTabView.h \ NSTabViewItem.h \ NSTableColumn.h \ NSTableHeaderCell.h \ NSTableHeaderView.h \ NSTableView.h \ NSText.h \ NSTextAttachment.h \ NSTextContainer.h \ NSTextField.h \ NSTextFieldCell.h \ NSTextList.h \ NSTextStorage.h \ NSTextTable.h \ NSTextView.h \ NSToolbar.h \ NSToolbarItem.h \ NSToolbarItemGroup.h \ NSTokenField.h \ NSTokenFieldCell.h \ NSTrackingArea.h \ NSTreeController.h \ NSTreeNode.h \ NSUserDefaultsController.h \ NSView.h \ NSViewController.h \ NSWindow.h \ NSWindowController.h \ NSWorkspace.h \ NSAttributedString.h \ NSColorPicking.h \ NSDragging.h \ NSGraphics.h \ NSNibConnector.h \ NSNibDeclarations.h \ NSNibLoading.h \ NSNib.h \ NSSpellProtocol.h \ NSUserInterfaceValidation.h \ DPSOperators.h \ PSOperators.h GUI_HEADERS = \ GSVersion.h \ GMAppKit.h \ GMArchiver.h \ GSAnimator.h \ GSTheme.h \ GSFontInfo.h \ GSMemoryPanel.h \ GSInfoPanel.h \ GSMethodTable.h \ GSPasteboardServer.h \ GSServicesManager.h \ GSTextConverter.h \ GSTrackingRect.h \ GSHelpManagerPanel.h \ GSGormLoading.h \ GSNibContainer.h \ GSDisplayServer.h \ GSTable.h \ GSHbox.h \ GSVbox.h \ IMConnectors.h \ IMCustomObject.h \ IMLoading.h \ GSLayoutManager.h \ GSLayoutManager_internal.h \ GSTypesetter.h \ GSHorizontalTypesetter.h \ GSToolbarView.h \ GSNibLoading.h \ GSDragView.h \ GSTitleView.h \ GSPrinting.h \ GSPrintOperation.h \ GSEPSPrintOperation.h \ GSPDFPrintOperation.h \ GSModelLoaderFactory.h \ GSInstantiator.h \ GSSoundSink.h \ GSSoundSource.h \ GSWindowDecorationView.h \ GSXibLoading.h \ GSHelpAttachment.h libgnustep-gui_HEADER_FILES = ${GUI_HEADERS} HEADERS_INSTALL = ${APPKIT_HEADERS} \ ${GUI_HEADERS} \ ${COCOA_HEADERS} # Resources RESOURCE_SET_NAME = libgui-resources libgui-resources_INSTALL_DIR = $(GNUSTEP_LIBRARY)/Libraries/gnustep-gui/Versions/$(libgnustep-gui_INTERFACE_VERSION)/Resources libgui-resources_RESOURCE_DIRS = libgui-resources_RESOURCE_FILES = Info-gnustep.plist # Extra DLL exports file libgnustep-gui_DLL_DEF = libgnustep-gui.def include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/library.make include $(GNUSTEP_MAKEFILES)/resource-set.make include GNUmakefile.postamble include CompatibilityHeaders.make gnustep-gui-0.24.0/Source/GSKeyBindingTable.m0000664000076500007650000001640711532730071020614 0ustar brains99brains99/* GSKeyBindingTable.m -*-objc-*- Copyright (C) 2002-2011 Free Software Foundation, Inc. Author: Nicola Pero Date: February 2002 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "AppKit/NSEvent.h" #import "AppKit/NSInputManager.h" #import "GSKeyBindingAction.h" #import "GSKeyBindingTable.h" @implementation GSKeyBindingTable : NSObject - (void) loadBindingsFromDictionary: (NSDictionary *)dict { NSEnumerator *e; id key; e = [dict keyEnumerator]; while ((key = [e nextObject]) != nil) { [self bindKey: key toAction: [dict objectForKey: key]]; } } - (void) bindKey: (id)key toAction: (id)action { unichar character; unsigned int modifiers; GSKeyBindingAction *a = nil; GSKeyBindingTable *t = nil; BOOL isTable = NO; int i; /* First, try to determine what exactly is key :-) ... it might either be a simple string, "Control-f", or an array, ("Control-x", "Control-s"). We implement the case of arrays in terms of the case of strings. */ if ([key isKindOfClass: [NSArray class]]) { if ([(NSArray *)key count] == 0) { /* Ignore them. */ return; } else if ([(NSArray *)key count] == 1) { key = [key objectAtIndex: 0]; } else { /* Ok - simply convert that into a temporary dictionary representation and store that. Eg, key ("Control-x", "Control-s", "Control-k") action "moveUp:" gets converted into: key "Control-x" action { "Control-s" = { "Control-k" = "moveUp:"; }; }. */ /* Now start from the end of the array, and start building the temporary dictionary structure going backwards. */ id value = action; int j; for (j = [key count] - 1; j > 0; j--) { NSMutableDictionary *tmp = [NSMutableDictionary dictionary]; [tmp setObject: value forKey: [key objectAtIndex: j]]; value = tmp; } key = [key objectAtIndex: 0]; action = value; } } if (![key isKindOfClass: [NSString class]]) { NSLog (@"GSKeyBindingTable - key %@ is not a NSString!", key); return; } if (![NSInputManager parseKey: (NSString *)key intoCharacter: &character andModifiers: &modifiers]) { NSLog (@"GSKeyBindingTable - Could not bind key %@", key); return; } /* If it is not a function key, we automatically ignore the Shift * modifier. You shouldn't use it unless you are describing a modification * of a function key. The NSInputManager will ignore Shift modifiers * as well for non-function keys. */ if (modifiers & NSFunctionKeyMask) { /* Ignore all other modifiers when storing the keystroke modifiers. */ modifiers = modifiers & (NSShiftKeyMask | NSAlternateKeyMask | NSControlKeyMask | NSNumericPadKeyMask); } else { modifiers = modifiers & (NSAlternateKeyMask | NSControlKeyMask | NSNumericPadKeyMask); } /* Now build the associated action/table. */ if ([action isKindOfClass: [NSString class]]) { /* "" as action means disable the keybinding. It can be used to override a previous keybinding. */ if ([(NSString *)action isEqualToString: @""]) { a = nil; } else { a = [[GSKeyBindingActionSelector alloc] initWithSelectorName: (NSString *)action]; AUTORELEASE (a); } } else if ([action isKindOfClass: [NSArray class]]) { a = [[GSKeyBindingActionSelectorArray alloc] initWithSelectorNames: (NSArray *)action]; AUTORELEASE (a); } else if ([action isKindOfClass: [NSDictionary class]]) { /* Don't load the keybindings from action yet ... load them later on when we know if we need to create a new GSKeyBindingTable or if we need to merge them into an existing one. */ isTable = YES; } else if ([action isKindOfClass: [GSKeyBindingAction class]]) { a = action; } /* Ok - at this point, we have all the elements ready, we just need to insert into the table. */ /* Check if there are already some bindings for this keystroke. */ for (i = 0; i < _bindingsCount; i++) { if ((_bindings[i].character == character) && (_bindings[i].modifiers == modifiers)) { /* Replace/override the existing action with the new one if it's an action, or load the bindings into a (new or existing) table if it's a table. */ if (isTable) { /* If there was already a table, add keybindings to that table. */ if (_bindings[i].table != nil) { t = _bindings[i].table; } else { /* Else, create a new one. */ t = [[GSKeyBindingTable alloc] init]; AUTORELEASE (t); } [t loadBindingsFromDictionary: (NSDictionary *)action]; } ASSIGN (_bindings[i].action, a); ASSIGN (_bindings[i].table, t); return; } } /* Ok - new keystroke. Create the table if needed. */ if (isTable) { t = [[GSKeyBindingTable alloc] init]; AUTORELEASE (t); [t loadBindingsFromDictionary: (NSDictionary *)action]; } /* Allocate memory for the new binding. */ if (_bindingsCount == 0) { _bindingsCount = 1; _bindings = malloc (sizeof (struct _GSKeyBinding)); } else { _bindingsCount++; _bindings = realloc (_bindings, sizeof (struct _GSKeyBinding) * _bindingsCount); } _bindings[_bindingsCount - 1].character = character; _bindings[_bindingsCount - 1].modifiers = modifiers; /* Don't use ASSIGN here because that uses the previous value of _bindings[_bindingsCount - 1] ... which is undefined. */ _bindings[_bindingsCount - 1].action = a; RETAIN (a); _bindings[_bindingsCount - 1].table = t; RETAIN (t); } - (BOOL) lookupKeyStroke: (unichar)character modifiers: (int)flags returningActionIn: (GSKeyBindingAction **)action tableIn: (GSKeyBindingTable **)table { int i; for (i = 0; i < _bindingsCount; i++) { if (_bindings[i].character == character) { if (_bindings[i].modifiers == flags) { if (_bindings[i].action == nil && _bindings[i].table == nil) { /* Found the keybinding, but it is disabled! */ return NO; } else { *action = _bindings[i].action; *table = _bindings[i].table; return YES; } } } } return NO; } - (void) dealloc { int i; for (i = 0; i < _bindingsCount; i++) { RELEASE (_bindings[i].action); RELEASE (_bindings[i].table); } free (_bindings); [super dealloc]; } @end gnustep-gui-0.24.0/Source/NSLevelIndicatorCell.m0000664000076500007650000003745411673147131021346 0ustar brains99brains99/* NSLevelIndicatorCell.m The level indicator cell class Copyright (C) 2007 Free Software Foundation, Inc. Author: H. Nikolaus Schaller Date: 2006 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import "AppKit/NSBezierPath.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSImage.h" #import "AppKit/NSLevelIndicatorCell.h" @implementation NSLevelIndicatorCell - (id) init { return [self initWithLevelIndicatorStyle: NSRatingLevelIndicatorStyle]; } - (id) initWithLevelIndicatorStyle: (NSLevelIndicatorStyle)style { self = [super init]; if (self) { [self setAlignment: NSCenterTextAlignment]; [self setLevelIndicatorStyle: style]; //_minValue = 0.0; if ((style == NSContinuousCapacityLevelIndicatorStyle) || (style == NSRelevancyLevelIndicatorStyle)) { _maxValue = 100.0; } else { _maxValue = 5.0; } [self setDoubleValue: 0.0]; } return self; } - (id) copyWithZone:(NSZone *) zone { NSLevelIndicatorCell *c = [super copyWithZone: zone]; return c; } - (void) dealloc { [super dealloc]; } - (NSLevelIndicatorStyle) style { return _style; } - (double) maxValue { return _maxValue; } - (void) setMaxValue: (double)val { _maxValue = val; } - (double) minValue { return _minValue; } - (void) setMinValue:(double) val { _minValue = val; } - (double) criticalValue { return _criticalValue; } - (void) setCriticalValue: (double)val { _criticalValue = val; } - (double) warningValue { return _warningValue; } - (void) setWarningValue: (double)val { _warningValue = val; } - (void) setLevelIndicatorStyle: (NSLevelIndicatorStyle)style { _style = style; } - (NSInteger) numberOfMajorTickMarks { return _numberOfMajorTickMarks; } - (void) setNumberOfMajorTickMarks: (NSInteger)count { _numberOfMajorTickMarks = count; } - (NSInteger) numberOfTickMarks { return _numberOfTickMarks; } - (void) setNumberOfTickMarks: (NSInteger)count { _numberOfTickMarks = count; } - (NSTickMarkPosition) tickMarkPosition { return _tickMarkPosition; } - (void) setTickMarkPosition: (NSTickMarkPosition)pos { _tickMarkPosition = pos; } - (double) tickMarkValueAtIndex: (NSInteger)index { if ((index < 0) || (index >= _numberOfTickMarks)) { [NSException raise: NSRangeException format: @"tick mark index invalid"]; } return _minValue + index * (_maxValue - _minValue) / _numberOfTickMarks; } - (NSRect) rectOfTickMarkAtIndex: (NSInteger)index { NSRect cellRect = NSZeroRect; float frameWidth = _cellFrame.size.width; if ((index < 0) || (index >= _numberOfTickMarks)) { [NSException raise: NSRangeException format: @"tick mark index invalid"]; } // Create default minor tickmark size in cellRect cellRect.size.width = 1; cellRect.size.height = 4; // If all tick marks are major: if (_numberOfTickMarks <= _numberOfMajorTickMarks) { // Use major tick mark size cellRect.size.width = 3; cellRect.size.height = 7; } // If major tick marks fit with even spacing else if ((_numberOfTickMarks -1) % (_numberOfMajorTickMarks - 1) == 0) { NSInteger minorTicksPerMajor = (_numberOfTickMarks - 1) / (_numberOfMajorTickMarks - 1); // If index is a major tick mark if (index % minorTicksPerMajor == 0) { // Use major tick mark size cellRect.size.width = 3; cellRect.size.height = 7; } } // FIXME: Extra tick mark code, when all major tick marks don't fit but a lesser amount will // Last tick mark if (index == (_numberOfTickMarks - 1)) { cellRect.origin.x = (frameWidth - cellRect.size.width); } // Not the first tick mark. (First tick mark will use 0,0 default values already set) else if (index != 0) { float spacing = (frameWidth / (_numberOfTickMarks - 1)) * index; cellRect.origin.x = spacing - (cellRect.size.width / 2); } // Set origins if tick marks are above the indicator if (_tickMarkPosition == NSTickMarkAbove) { switch (_style) { case NSContinuousCapacityLevelIndicatorStyle: { cellRect.origin.y = 16; break; } case NSRelevancyLevelIndicatorStyle: { cellRect.origin.y = 12; break; } case NSRatingLevelIndicatorStyle: { cellRect.origin.y = 13; break; } case NSDiscreteCapacityLevelIndicatorStyle: { cellRect.origin.y = 18; break; } } } // If tick mark is minor and below indicator, use y origin of 3. If not, default value of 0 is used else if (cellRect.size.width == 1) { cellRect.origin.y = 3; } return NSIntegralRect(cellRect); } - (NSSize) cellSize { // Sizes are the same as those from OSX NSSize cellSize = NSMakeSize(400000, 25); // Change cellSize to the correct size: switch (_style) { case NSContinuousCapacityLevelIndicatorStyle: { cellSize.height = 23; break; } case NSRelevancyLevelIndicatorStyle: { cellSize.height = 19; break; } case NSRatingLevelIndicatorStyle: { cellSize.height = 20; cellSize.width = 13 * _maxValue; break; } case NSDiscreteCapacityLevelIndicatorStyle: { cellSize.height = 25; break; } } return cellSize; } - (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { NSColor *fillColor; double value = [self doubleValue]; double val = (value -_minValue) / (_maxValue -_minValue); BOOL vertical = (cellFrame.size.height > cellFrame.size.width); _cellFrame = cellFrame; if (value < _warningValue) fillColor = [NSColor greenColor]; else if (value < _criticalValue) fillColor = [NSColor yellowColor]; else fillColor = [NSColor redColor]; if (_numberOfTickMarks != 0) { // FIXME: this code only works for horizontal frames float x; float y0, y1; float step = _numberOfTickMarks > 1 ? (cellFrame.size.width - 1.0) / (_numberOfTickMarks - 1) : 1.0; int tick; if (_tickMarkPosition == NSTickMarkBelow) { cellFrame.origin.y += 8.0; cellFrame.size.height -= 8.0; y0 = 4.0; y1 = 8.0; } else { cellFrame.size.height -= 8.0; y0 = cellFrame.size.height; y1 = y0 + 4.0; } [[NSColor darkGrayColor] set]; for(x = 0.0, tick = 0; tick <= _numberOfTickMarks; x += step, tick++) { [NSBezierPath strokeLineFromPoint: NSMakePoint(x, y0) toPoint: NSMakePoint(x, y1)]; // FIXME: draw _numberOfMajorTickMarks thick ticks (ignore if more than _numberOfTickMarks) } } switch(_style) { case NSDiscreteCapacityLevelIndicatorStyle: { int segments = (int)(_maxValue - _minValue); // width of one segment float step = (segments > 0) ? ((vertical ? cellFrame.size.height : cellFrame.size.width) / segments) : 10.0; int i; int ifill = val * segments + 0.5; for( i = 0; i < segments; i++) { // draw segments NSRect seg = cellFrame; if (vertical) { seg.size.height = step - 1.0; seg.origin.y += i * step; } else { seg.size.width = step - 1.0; seg.origin.x += i * step; } if (i < ifill) [fillColor set]; else // FIXME: Should not be needed. [[NSColor controlBackgroundColor] set]; // we could also fill with a scaled horizontal/vertical image NSRectFill(seg); // draw border [[NSColor lightGrayColor] set]; NSFrameRect(seg); } break; } case NSContinuousCapacityLevelIndicatorStyle: { NSRect ind, fill; if (vertical) NSDivideRect(cellFrame, &ind, &fill, cellFrame.size.height * val, NSMinYEdge); else NSDivideRect(cellFrame, &ind, &fill, cellFrame.size.width * val, NSMinXEdge); [fillColor set]; // we could also fill with a scaled horizontal/vertical image NSRectFill(ind); // FIXME: Not needed [[NSColor controlBackgroundColor] set]; NSRectFill(fill); // draw border [[NSColor lightGrayColor] set]; NSFrameRect(cellFrame); break; } case NSRelevancyLevelIndicatorStyle: { // FIXME: Not needed [[NSColor controlBackgroundColor] set]; NSRectFill(cellFrame); [[NSColor darkGrayColor] set]; if (vertical) { float y; float yfill = val * cellFrame.size.height + 0.5; for (y = 0.0; y < yfill; y += 2.0) { [NSBezierPath strokeLineFromPoint: NSMakePoint(0.0, y) toPoint: NSMakePoint(cellFrame.size.width, y)]; } } else { float x; float xfill = val * cellFrame.size.width + 0.5; for (x = 0.0; x < xfill; x += 2.0) { [NSBezierPath strokeLineFromPoint: NSMakePoint(x, 0.0) toPoint: NSMakePoint(x, cellFrame.size.height)]; } } break; } case NSRatingLevelIndicatorStyle: { NSImage *indicator = [self image]; NSSize isize; if (!indicator) indicator = [NSImage imageNamed: @"NSRatingLevelIndicator"]; isize = [indicator size]; // FIXME: Not needed [[NSColor controlBackgroundColor] set]; NSRectFill(cellFrame); if (vertical) { int y; for (y = 0.0; y < (val + 0.5); y++) { NSPoint pos = NSMakePoint(0, y * isize.height + 2.0); if (pos.y >= cellFrame.size.height) break; // here we can strech the image as needed by using drawInRect: [indicator drawAtPoint: pos fromRect: (NSRect){NSZeroPoint, isize} operation: NSCompositeCopy fraction:1.0]; } // FIXME: Should draw place holder for the rest of the cell frame } else { int x; for (x = 0.0; x < (val + 0.5); x++) { NSPoint pos = NSMakePoint(x * isize.width + 2.0, 0.0); if(pos.x >= cellFrame.size.width) break; [indicator drawAtPoint: pos fromRect: (NSRect){NSZeroPoint, isize} operation: NSCompositeCopy fraction: 1.0]; } // FIXME: Should draw place holder for the rest of the cell frame } } } } - (void) encodeWithCoder: (NSCoder *) aCoder { [super encodeWithCoder:aCoder]; if ([aCoder allowsKeyedCoding]) { [aCoder encodeDouble: _minValue forKey: @"NSMinValue"]; [aCoder encodeDouble: _maxValue forKey: @"NSMaxValue"]; [aCoder encodeDouble: _warningValue forKey: @"NSWarningValue"]; [aCoder encodeDouble: _criticalValue forKey: @"NSCriticalValue"]; [aCoder encodeDouble: [self doubleValue] forKey: @"NSValue"]; [aCoder encodeInt: _style forKey: @"NSIndicatorStyle"]; [aCoder encodeInt: _numberOfMajorTickMarks forKey: @"NSNumberOfMajorTickMarks"]; [aCoder encodeInt: _numberOfTickMarks forKey: @"NSNumberOfTickMarks"]; [aCoder encodeInt: _tickMarkPosition forKey: @"NSTickMarkPosition"]; } else { [aCoder encodeValueOfObjCType: @encode(double) at: &_minValue]; [aCoder encodeValueOfObjCType: @encode(double) at: &_maxValue]; [aCoder encodeValueOfObjCType: @encode(double) at: &_warningValue]; [aCoder encodeValueOfObjCType: @encode(double) at: &_criticalValue]; [aCoder encodeValueOfObjCType: @encode(int) at: &_style]; [aCoder encodeValueOfObjCType: @encode(int) at: &_numberOfMajorTickMarks]; [aCoder encodeValueOfObjCType: @encode(int) at: &_numberOfTickMarks]; [aCoder encodeValueOfObjCType: @encode(int) at: &_tickMarkPosition]; } } - (id) initWithCoder:(NSCoder *) aDecoder { self = [super initWithCoder:aDecoder]; if ([aDecoder allowsKeyedCoding]) { if ([aDecoder containsValueForKey: @"NSMinValue"]) { _minValue = [aDecoder decodeDoubleForKey: @"NSMinValue"]; } if ([aDecoder containsValueForKey: @"NSMaxValue"]) { _maxValue = [aDecoder decodeDoubleForKey: @"NSMaxValue"]; } if ([aDecoder containsValueForKey: @"NSWarningValue"]) { _warningValue = [aDecoder decodeDoubleForKey: @"NSWarningValue"]; } if ([aDecoder containsValueForKey: @"NSCriticalValue"]) { _criticalValue = [aDecoder decodeDoubleForKey: @"NSCriticalValue"]; } if ([aDecoder containsValueForKey: @"NSValue"]) { [self setDoubleValue: [aDecoder decodeDoubleForKey: @"NSValue"]]; } if ([aDecoder containsValueForKey: @"NSIndicatorStyle"]) { _style = [aDecoder decodeIntForKey: @"NSIndicatorStyle"]; } if ([aDecoder containsValueForKey: @"NSNumberOfMajorTickMarks"]) { _numberOfMajorTickMarks = [aDecoder decodeIntForKey: @"NSNumberOfMajorTickMarks"]; } if ([aDecoder containsValueForKey: @"NSNumberOfTickMarks"]) { _numberOfTickMarks = [aDecoder decodeIntForKey: @"NSNumberOfTickMarks"]; } if ([aDecoder containsValueForKey: @"NSTickMarkPosition"]) { _tickMarkPosition = [aDecoder decodeIntForKey: @"NSTickMarkPosition"]; } } else { [aDecoder decodeValueOfObjCType: @encode(double) at: &_minValue]; [aDecoder decodeValueOfObjCType: @encode(double) at: &_maxValue]; [aDecoder decodeValueOfObjCType: @encode(double) at: &_warningValue]; [aDecoder decodeValueOfObjCType: @encode(double) at: &_criticalValue]; [aDecoder decodeValueOfObjCType: @encode(int) at: &_style]; [aDecoder decodeValueOfObjCType: @encode(int) at: &_numberOfMajorTickMarks]; [aDecoder decodeValueOfObjCType: @encode(int) at: &_numberOfTickMarks]; [aDecoder decodeValueOfObjCType: @encode(int) at: &_tickMarkPosition]; } return self; } @end gnustep-gui-0.24.0/Source/NSTableHeaderView.m0000664000076500007650000006614712110256537020634 0ustar brains99brains99/** NSTableHeaderView Copyright (C) 1999 Free Software Foundation, Inc. Author: Nicola Pero Date: December 1999 First actual coding. Author: Nicola Pero Date: August 2000, Semptember 2000 Selection and resizing of Columns. 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import "AppKit/NSTableHeaderCell.h" #import "AppKit/NSTableHeaderView.h" #import "AppKit/NSTableColumn.h" #import "AppKit/NSTableView.h" #import "AppKit/NSWindow.h" #import "AppKit/NSEvent.h" #import "AppKit/NSApplication.h" #import "AppKit/NSColor.h" #import "AppKit/NSCursor.h" #import "AppKit/NSScrollView.h" #import "AppKit/NSGraphics.h" #import "GSGuiPrivate.h" #import "GNUstepGUI/GSTheme.h" /* * Number of pixels in either direction that will be counted as a hit * on the column border and trigger a column resize. */ #define mouse_sensitivity 4 @interface NSTableView (GNUstepPrivate) - (void) _userResizedTableColumn: (int)index width: (float)width; - (float *) _columnOrigins; - (void) _mouseDownInHeaderOfTableColumn: (NSTableColumn *)tc; - (void) _clickTableColumn: (NSTableColumn *)tc; @end @implementation NSTableHeaderView /* * * Class methods * */ + (void) initialize { if (self == [NSTableColumn class]) [self setVersion: 1]; } /* * * Instance methods * */ /* * Initializes an instance */ // TODO: Remove this method, if not really needed - (id)initWithFrame:(NSRect)frameRect { self = [super initWithFrame: frameRect]; if (self == nil) return nil; _tableView = nil; _resizedColumn = -1; return self; } - (BOOL) isFlipped { return YES; } /* * Setting the table view */ - (void)setTableView: (NSTableView*)aTableView { // We do not RETAIN aTableView but aTableView is supposed // to RETAIN us. _tableView = aTableView; } - (NSTableView*)tableView { return _tableView; } /* * Checking altered columns */ - (NSInteger) draggedColumn { // TODO return -1; } - (CGFloat) draggedDistance { // TODO return -1; } - (NSInteger) resizedColumn { return _resizedColumn; } /* * Utility methods */ - (NSInteger) columnAtPoint: (NSPoint)aPoint { if (_tableView == nil) return -1; /* Ask to the tableview, which is caching geometry info */ aPoint = [self convertPoint: aPoint toView: _tableView]; aPoint.y = [_tableView bounds].origin.y; return [_tableView columnAtPoint: aPoint]; } - (NSRect)headerRectOfColumn: (NSInteger)columnIndex { NSRect rect; if (_tableView == nil) return NSZeroRect; /* Ask to the tableview, which is caching geometry info */ rect = [_tableView rectOfColumn: columnIndex]; rect = [self convertRect: rect fromView: _tableView]; rect.origin.y = _bounds.origin.y; rect.size.height = _bounds.size.height; return rect; } /* * Overidden Methods */ - (void)drawRect: (NSRect)aRect { [[GSTheme theme] drawTableHeaderRect: aRect inView: self]; } - (void) resetCursorRects { if ([[self tableView] allowsColumnResizing]) { const NSRect visibleRect = [self visibleRect]; NSInteger i; const NSInteger count = [[[self tableView] tableColumns] count]; for (i = 0; i < (count - 1) && (count > 0); i++) { NSRect resizeRect = [self headerRectOfColumn: i]; resizeRect.origin.x = NSMaxX(resizeRect) - mouse_sensitivity; resizeRect.size.width = 2 * mouse_sensitivity; resizeRect = NSIntersectionRect(resizeRect, visibleRect); if (!NSEqualRects(NSZeroRect, resizeRect)) { [self addCursorRect: resizeRect cursor: [NSCursor resizeLeftRightCursor]]; } } } } /** * In -mouseDown we intercept the mouse event to handle the * colum resize and rearrangement. Resizing or moving columns * will do a live resize/move of the columns by default. Users can revert to * a "ghost" resize/move indicator by doing: * defaults write NSGlobalDomain GSUseGhostResize YES */ - (void) mouseDown: (NSEvent*)event { NSPoint location = [event locationInWindow]; NSInteger clickCount; NSInteger columnIndex; NSTableColumn *currentColumn; clickCount = [event clickCount]; /* if (clickCount > 2) { return; } */ location = [self convertPoint: location fromView: nil]; columnIndex = [self columnAtPoint: location]; if (columnIndex == -1) { return; } currentColumn = [[_tableView tableColumns] objectAtIndex: columnIndex]; if (clickCount == 2) { [_tableView _sendDoubleActionForColumn: columnIndex]; // return; } // if (clickCount == 1) { NSRect rect = [self headerRectOfColumn: columnIndex]; /* Safety check */ if (_resizedColumn != -1) { NSLog(@"Bug: starting resizing of column while already resizing!"); _resizedColumn = -1; } if ([_tableView allowsColumnResizing]) { /* Start resizing if the mouse is down on the bounds of a column. */ if (location.x >= NSMaxX(rect) - mouse_sensitivity) { if (columnIndex < [_tableView numberOfColumns]) { _resizedColumn = columnIndex; } else { NSLog(@"Bug: Trying to resize column past the end of the table."); } } else if (location.x <= NSMinX(rect) + mouse_sensitivity) { if (columnIndex > 0) { _resizedColumn = columnIndex - 1; } } } /* Resizing */ if (_resizedColumn != -1) { CGFloat p; NSEvent *e; BOOL lit; NSUInteger eventMask; BOOL liveResize; /* Width of the highlighted area. */ const float divWidth = 4; /* Coordinates of visible part of table */ CGFloat minVisCoord = NSMinX([self visibleRect]); CGFloat maxVisCoord = NSMaxX([self visibleRect]); NSPoint unconverted = [event locationInWindow]; NSArray *columns = [_tableView tableColumns]; /* Column on the left of resizing bound */ NSTableColumn *column = [columns objectAtIndex: _resizedColumn]; const CGFloat columnMinX = NSMinX([self headerRectOfColumn: _resizedColumn]); const CGFloat columnMinWidth = [column minWidth]; const CGFloat columnMaxWidth = [column maxWidth]; CGFloat newColumnWidth = [column width]; CGFloat newColumnMaxX; NSRect oldHighlightRect; NSRect highlightRect = [self visibleRect]; highlightRect.size.width = divWidth; /* Mouse position */ /* YES if some highlighting was done and needs to be undone */ lit = NO; eventMask = NSLeftMouseUpMask | NSLeftMouseDraggedMask | NSPeriodicMask; liveResize = ![[NSUserDefaults standardUserDefaults] boolForKey: @"GSUseGhostResize"]; if ([column isResizable] == NO) { _resizedColumn = -1; return; } /* Do we need to check that we already fit into this area ? We should */ [[NSCursor resizeLeftRightCursor] push]; if (!liveResize) { oldHighlightRect = NSZeroRect; [self lockFocus]; [[NSColor lightGrayColor] set]; } [[NSRunLoop currentRunLoop] limitDateForMode: NSEventTrackingRunLoopMode]; [NSEvent startPeriodicEventsAfterDelay: 0.05 withPeriod: 0.05]; e = [NSApp nextEventMatchingMask: eventMask untilDate: [NSDate distantFuture] inMode: NSEventTrackingRunLoopMode dequeue: YES]; while ([e type] != NSLeftMouseUp) { if ([e type] != NSPeriodic) { unconverted = [e locationInWindow]; } p = [self convertPoint: unconverted fromView: nil].x; minVisCoord = NSMinX([self visibleRect]); maxVisCoord = NSMaxX([self visibleRect]); /* newColumnWidth is always positive, since we always resize the column to the left of the mouse pointer */ newColumnWidth = (p - columnMinX); newColumnWidth = MAX(MIN(newColumnWidth, columnMaxWidth), columnMinWidth); newColumnMaxX = columnMinX + newColumnWidth; if (liveResize && [column width] != newColumnWidth) { [_tableView _userResizedTableColumn: _resizedColumn width: newColumnWidth]; } else if (!liveResize) { highlightRect.origin.x = newColumnMaxX; /* Only draw the divider if it is not the same as the currently drawn one, and lies within the header view area */ if (!NSEqualRects(oldHighlightRect,highlightRect) && highlightRect.origin.x > [self visibleRect].origin.x && highlightRect.origin.x + divWidth < [self visibleRect].origin.x + [self visibleRect].size.width) { if (lit) { NSHighlightRect(oldHighlightRect); } NSHighlightRect(highlightRect); [_window flushWindow]; lit = YES; oldHighlightRect = highlightRect; } } /* Scroll the tableview, if needed, so the user's desired new column edge position lies at the edge of the visible part of the table */ if ((p > maxVisCoord && newColumnMaxX > maxVisCoord) || (p < minVisCoord && newColumnMaxX < minVisCoord)) { NSRect tvRect = [_tableView visibleRect]; if (!liveResize && lit) { NSHighlightRect(oldHighlightRect); lit = NO; [_window flushWindow]; } if (p > maxVisCoord) /* resizing to the right */ tvRect.origin.x = newColumnMaxX - tvRect.size.width; else /* resizing to the left */ tvRect.origin.x = newColumnMaxX; [_tableView scrollPoint: tvRect.origin]; } e = [NSApp nextEventMatchingMask: eventMask untilDate: [NSDate distantFuture] inMode: NSEventTrackingRunLoopMode dequeue: YES]; } [NSEvent stopPeriodicEvents]; [NSCursor pop]; if (!liveResize) { if (lit) { NSHighlightRect(oldHighlightRect); [_window flushWindow]; } [self unlockFocus]; /* The following tiles the table. We use a private method which avoids tiling the table twice. */ if ([column width] != newColumnWidth) { [_tableView _userResizedTableColumn: _resizedColumn width: newColumnWidth]; } } /* Clean up */ _resizedColumn = -1; return; } /* We are not resizing Let's launch a mouseDownInHeaderOfTableColumn message */ { NSRect rect = [self headerRectOfColumn: columnIndex]; [_tableView _mouseDownInHeaderOfTableColumn: [[_tableView tableColumns] objectAtIndex: columnIndex]]; rect.origin.y++; rect.size.height--; [[currentColumn headerCell] setHighlighted: YES]; [self lockFocus]; [[currentColumn headerCell] highlight: YES withFrame: rect inView: self]; [self unlockFocus]; [_window flushWindow]; } /* Dragging */ /* Wait for mouse dragged events. If mouse is dragged, move the column. If mouse is not dragged but released, select/deselect the column. */ if ([_tableView allowsColumnReordering]) { NSInteger i = columnIndex; NSInteger j = columnIndex; CGFloat minCoord; CGFloat maxCoord; CGFloat minVisCoord; CGFloat maxVisCoord; CGFloat *_cO; CGFloat *_cO_minus1; NSInteger numberOfColumns = [_tableView numberOfColumns]; NSUInteger eventMask = (NSLeftMouseUpMask | NSLeftMouseDraggedMask | NSPeriodicMask); NSUInteger modifiers = [event modifierFlags]; NSEvent *e; NSDate *distantFuture = [NSDate distantFuture]; NSRect visibleRect = [self visibleRect]; NSRect tvRect; NSRect highlightRect = NSZeroRect, oldRect = NSZeroRect; BOOL outside = NO; BOOL lit = NO; BOOL liveResize = ![[NSUserDefaults standardUserDefaults] boolForKey: @"GSUseGhostResize"]; BOOL mouseDragged = NO; CGFloat p; NSPoint unconverted; minVisCoord = NSMinX (visibleRect); maxVisCoord = NSMaxX (visibleRect); { NSRect bounds = [self bounds]; minCoord = NSMinX(bounds); maxCoord = NSMaxX(bounds); } { float *_c = [_tableView _columnOrigins]; _cO_minus1 = malloc((numberOfColumns + 3) * sizeof(CGFloat)); _cO = _cO_minus1 + 1; memcpy(_cO, _c, numberOfColumns * sizeof(CGFloat)); _cO[numberOfColumns] = maxCoord; _cO[numberOfColumns + 1] = maxCoord; _cO[-1] = minCoord; } highlightRect.size.height = NSHeight (visibleRect); highlightRect.origin.y = NSMinY (visibleRect); if (!liveResize) { [self lockFocus]; [[NSColor lightGrayColor] set]; } [NSEvent startPeriodicEventsAfterDelay: 0.05 withPeriod: 0.05]; e = [NSApp nextEventMatchingMask: eventMask untilDate: distantFuture inMode: NSEventTrackingRunLoopMode dequeue: YES]; while ([e type] != NSLeftMouseUp) { switch ([e type]) { case NSLeftMouseDragged: unconverted = [e locationInWindow]; p = [self convertPoint: unconverted fromView: nil].x; if (mouseDragged == NO) { NSLog(@"TODO: Deselect the column"); } mouseDragged = YES; if (p < minVisCoord || p > maxVisCoord) { outside = YES; } else { outside = NO; i = j; if (p > (_cO[i] + _cO[i+1]) / 2) { while (p > (_cO[i] + _cO[i+1]) / 2) i++; } else if (p < (_cO[i] + _cO[i-1]) / 2) { while (p < (_cO[i] + _cO[i-1]) / 2) i--; } if (!liveResize) { if (i != columnIndex && i != columnIndex + 1) { j = i; highlightRect.size.height = NSHeight (visibleRect); highlightRect.origin.y = NSMinY (visibleRect); highlightRect.size.width = 7; if (i == numberOfColumns) { highlightRect.origin.x = _cO[i] - 3; } else if (i == 0) { highlightRect.origin.x = _cO[i] - 3; } else { highlightRect.origin.x = _cO[i] - 3; } if (!NSEqualRects(highlightRect, oldRect)) { if (lit) NSHighlightRect(oldRect); NSHighlightRect(highlightRect); [_window flushWindow]; } else if (!lit) { NSHighlightRect(highlightRect); [_window flushWindow]; } oldRect = highlightRect; lit = YES; } else { i = columnIndex; highlightRect.size.height = NSHeight (visibleRect); highlightRect.origin.y = NSMinY (visibleRect); highlightRect.origin.x = _cO[columnIndex]; highlightRect.size.width = _cO[columnIndex + 1] - _cO[columnIndex]; if (!NSEqualRects(highlightRect, oldRect)) { if (lit) NSHighlightRect(oldRect); // NSHighlightRect(highlightRect); [_window flushWindow]; } else if (!lit) { // NSHighlightRect(highlightRect); // [_window flushWindow]; } // oldRect = highlightRect; oldRect = NSZeroRect; lit = NO; //lit = YES; } } else if (liveResize) { if (i > columnIndex) i--; if (i != columnIndex) { [_tableView moveColumn: columnIndex toColumn: i]; } columnIndex = i; } } break; case NSPeriodic: if (outside == YES) { if (!liveResize) { if (lit) { NSHighlightRect(oldRect); [_window flushWindow]; lit = NO; oldRect = NSZeroRect; } } p = [self convertPoint: unconverted fromView: nil].x; tvRect = [_tableView visibleRect]; if (p > maxVisCoord) { if (p > maxCoord) tvRect.origin.x += (p - maxVisCoord)/8; else tvRect.origin.x += (p - maxVisCoord)/2; } else if (p < minVisCoord) { if (p < minCoord) tvRect.origin.x += (p - minVisCoord)/8; else tvRect.origin.x += (p - minVisCoord)/2; } else // TODO remove this condition { NSLog(@"not outside !"); } [_tableView scrollPoint: tvRect.origin]; visibleRect = [self visibleRect]; minVisCoord = NSMinX (visibleRect); maxVisCoord = NSMaxX (visibleRect); } break; default: break; } e = [NSApp nextEventMatchingMask: eventMask untilDate: distantFuture inMode: NSEventTrackingRunLoopMode dequeue: YES]; } if (!liveResize) { if (lit) { NSHighlightRect(highlightRect); [_window flushWindow]; } [self unlockFocus]; } [NSEvent stopPeriodicEvents]; if (mouseDragged == NO) { [_tableView _selectColumn: columnIndex modifiers: modifiers]; [_tableView _clickTableColumn: currentColumn]; [self setNeedsDisplay: YES];; } else // mouseDragged == YES { { NSRect rect = [self headerRectOfColumn: columnIndex]; [_tableView _mouseDownInHeaderOfTableColumn: [[_tableView tableColumns] objectAtIndex: columnIndex]]; rect.origin.y++; rect.size.height--; [[currentColumn headerCell] setHighlighted: NO]; [self lockFocus]; [[currentColumn headerCell] highlight: NO withFrame: rect inView: self]; [self unlockFocus]; [_window flushWindow]; } if (i > columnIndex) i--; if (i != columnIndex) { [_tableView moveColumn: columnIndex toColumn: i]; } } free(_cO_minus1); return; } else { NSRect cellFrame = [self headerRectOfColumn: columnIndex]; NSApplication *theApp = [NSApplication sharedApplication]; NSUInteger modifiers = [event modifierFlags]; NSPoint location = [event locationInWindow]; NSPoint point = [self convertPoint: location fromView: nil]; if (![self mouse: point inRect: cellFrame]) { NSLog(@"not in frame, what's happening ?"); return; } event = [theApp nextEventMatchingMask: NSLeftMouseUpMask untilDate: [NSDate distantFuture] inMode: NSEventTrackingRunLoopMode dequeue: NO]; location = [event locationInWindow]; point = [self convertPoint: location fromView: nil]; if (![self mouse: point inRect: cellFrame]) { NSDebugLLog(@"NSCell", @"tableheaderview point not in cell frame\n"); { NSRect rect = [self headerRectOfColumn: columnIndex]; [_tableView _mouseDownInHeaderOfTableColumn: [[_tableView tableColumns] objectAtIndex: columnIndex]]; rect.origin.y++; rect.size.height--; [[currentColumn headerCell] setHighlighted: NO]; [self lockFocus]; [[currentColumn headerCell] highlight: NO withFrame: rect inView: self]; [self unlockFocus]; [_window flushWindow]; } } else { [_tableView _selectColumn: columnIndex modifiers: modifiers]; [_tableView _clickTableColumn: currentColumn]; [self setNeedsDisplay: YES]; /* if ([_tableView highlightedTableColumn] != currentColumn) { NSRect rect = [self headerRectOfColumn: columnIndex]; // [_tableView _mouseDownInHeaderOfTableColumn: // [[_tableView tableColumns] // objectAtIndex: columnIndex]]; rect.origin.y++; rect.size.height--; NSLog(@"highlight"); [[currentColumn headerCell] setHighlighted: NO]; [[currentColumn headerCell] highlight: NO withFrame: rect inView: self]; [_window flushWindow]; } */ } } } } /* * Encoding/Decoding */ - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; /* Nothing else to encode in NSTableHeaderView: - _tableView is set by the parent NSTableView - _resizedColumn is reset on decoding anyway */ } - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if (self == nil) return nil; // NOTE: some xib's can have unintuitive load orders where // the above -initWithCoder: call causes the receiver's assocaited // table view to be loaded, which calls -[self setTableView:]. // So at this point, _tableView might already have been set, // so we must not set it to nil here. _resizedColumn = -1; return self; } @end gnustep-gui-0.24.0/Source/NSArrayController.m0000664000076500007650000002477412133060426020756 0ustar brains99brains99/** NSArrayController Controller class for arrays Copyright (C) 2006 Free Software Foundation, Inc. Author: Fred Kiefer Date: June 2006 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import #import #import "AppKit/NSArrayController.h" #import "AppKit/NSKeyValueBinding.h" #import "GSBindingHelpers.h" #import "GSFastEnumeration.h" @implementation NSArrayController + (void) initialize { if (self == [NSArrayController class]) { [self exposeBinding: NSContentArrayBinding]; } } - (id) initWithContent: (id)content { if ((self = [super initWithContent: content]) != nil) { [self rearrangeObjects]; [self setSelectsInsertedObjects: YES]; } return self; } - (id) init { NSMutableArray *new = [[NSMutableArray alloc] init]; self = [self initWithContent: new]; RELEASE(new); return self; } - (void) dealloc { DESTROY(_arranged_objects); DESTROY(_selection_indexes); DESTROY(_sort_descriptors); DESTROY(_filter_predicate); [super dealloc]; } - (void) addObject: (id)obj { [_content addObject: obj]; if ([self automaticallyRearrangesObjects]) { [self rearrangeObjects]; } } - (void) addObjects: (NSArray*)obj { [_content addObjectsFromArray: obj]; if ([self automaticallyRearrangesObjects]) { [self rearrangeObjects]; } if ([self selectsInsertedObjects]) { [self addSelectedObjects: obj]; } } - (void) removeObject: (id)obj { [_content removeObject: obj]; if ([self automaticallyRearrangesObjects]) { [self rearrangeObjects]; } } - (void) removeObjects: (NSArray*)obj { [_content removeObjectsInArray: obj]; if ([self automaticallyRearrangesObjects]) { [self rearrangeObjects]; } } - (BOOL) canInsert { return YES; } - (void) setContent: (id)content { [super setContent: content]; [self rearrangeObjects]; } - (void) insert: (id)sender { id new = [self newObject]; [_content addObject: new]; RELEASE(new); } - (NSIndexSet*) _indexSetForObjects: (NSArray*)objects { NSMutableIndexSet *tmp = [NSMutableIndexSet new]; id enumerator = objects; FOR_IN (id, obj, enumerator) { NSUInteger index = [_arranged_objects indexOfObject: obj]; if (NSNotFound != index) { [tmp addIndex: index]; } } END_FOR_IN(enumerator) return AUTORELEASE(tmp); } - (BOOL) addSelectedObjects: (NSArray*)obj { return [self addSelectionIndexes: [self _indexSetForObjects: obj]]; } - (BOOL) addSelectionIndexes: (NSIndexSet*)idx { NSMutableIndexSet *tmp = AUTORELEASE([_selection_indexes mutableCopy]); [tmp addIndexes: idx]; return [self setSelectionIndexes: tmp]; } - (BOOL) setSelectedObjects: (NSArray*)obj { return [self setSelectionIndexes: [self _indexSetForObjects: obj]]; } - (BOOL) setSelectionIndex: (NSUInteger)idx { return [self setSelectionIndexes: [NSIndexSet indexSetWithIndex: idx]]; } - (BOOL) setSelectionIndexes: (NSIndexSet*)idx { if ([_selection_indexes isEqual: idx]) { return NO; } else { ASSIGNCOPY(_selection_indexes, idx); return YES; } } - (BOOL) removeSelectedObjects: (NSArray*)obj { return [self removeSelectionIndexes: [self _indexSetForObjects: obj]]; } - (BOOL) removeSelectionIndexes: (NSIndexSet*)idx { NSMutableIndexSet *tmp = AUTORELEASE([_selection_indexes mutableCopy]); [tmp removeIndexes: idx]; return [self setSelectionIndexes: tmp]; } - (BOOL) canSelectNext { NSUInteger cur = [self selectionIndex]; if ((cur == NSNotFound) || (cur + 1 == [_content count])) { return NO; } else { return YES; } } - (BOOL) canSelectPrevious { NSUInteger cur = [self selectionIndex]; if ((cur == NSNotFound) || (cur == 0)) { return NO; } else { return YES; } } - (void) selectNext: (id)sender { NSUInteger cur = [self selectionIndex]; [self setSelectionIndexes: [NSIndexSet indexSetWithIndex: cur + 1]]; } - (void) selectPrevious: (id)sender { NSUInteger cur = [self selectionIndex]; [self setSelectionIndexes: [NSIndexSet indexSetWithIndex: cur - 1]]; } - (NSArray*) selectedObjects { // We make the selection work on the arranged objects return [_arranged_objects objectsAtIndexes: _selection_indexes]; } - (NSUInteger) selectionIndex { return [_selection_indexes firstIndex]; } - (NSIndexSet*) selectionIndexes { return AUTORELEASE([_selection_indexes copy]); } - (BOOL) avoidsEmptySelection { return _acflags.avoids_empty_selection; } - (void) setAvoidsEmptySelection: (BOOL)flag { _acflags.avoids_empty_selection = flag; } - (BOOL) preservesSelection { return _acflags.preserves_selection; } - (void) setPreservesSelection: (BOOL)flag { _acflags.preserves_selection = flag; } - (BOOL) alwaysUsesMultipleValuesMarker { return _acflags.always_uses_multiple_values_marker; } - (void) setAlwaysUsesMultipleValuesMarker: (BOOL)flag { _acflags.always_uses_multiple_values_marker = flag; } - (BOOL) clearsFilterPredicateOnInsertion { return _acflags.clears_filter_predicate_on_insertion; } - (void) setClearsFilterPredicateOnInsertion: (BOOL)flag { _acflags.clears_filter_predicate_on_insertion = flag; } - (BOOL) automaticallyRearrangesObjects { return _acflags.automatically_rearranges_objects; } - (void) setAutomaticallyRearrangesObjects: (BOOL)flag { _acflags.automatically_rearranges_objects = flag; } - (BOOL) selectsInsertedObjects { return _acflags.selects_inserted_objects; } - (void) setSelectsInsertedObjects: (BOOL)flag { _acflags.selects_inserted_objects = flag; } - (NSArray*) arrangeObjects: (NSArray*)obj { NSArray *temp = [obj filteredArrayUsingPredicate: _filter_predicate]; return [temp sortedArrayUsingDescriptors: _sort_descriptors]; } - (id) arrangedObjects { return _arranged_objects; } - (void) rearrangeObjects { [self willChangeValueForKey: @"arrangedObjects"]; ASSIGN(_arranged_objects, [self arrangeObjects: _content]); [self didChangeValueForKey: @"arrangedObjects"]; } - (void) setSortDescriptors: (NSArray*)desc { ASSIGNCOPY(_sort_descriptors, desc); } - (NSArray*) sortDescriptors { return AUTORELEASE([_sort_descriptors copy]); } - (void) setFilterPredicate: (NSPredicate*)filterPredicate { ASSIGN(_filter_predicate, filterPredicate); } - (NSPredicate*) filterPredicate { return _filter_predicate; } - (void) insertObject: (id)obj atArrangedObjectIndex: (NSUInteger)idx { // FIXME [self addObject: obj]; } - (void) insertObjects: (NSArray*)obj atArrangedObjectIndexes: (NSIndexSet*)idx { // FIXME [self addObjects: obj]; } - (void) removeObjectAtArrangedObjectIndex: (NSUInteger)idx { [self removeObject: [_arranged_objects objectAtIndex: idx]]; } - (void) removeObjectsAtArrangedObjectIndexes: (NSIndexSet*)idx { [self removeObjects: [_arranged_objects objectsAtIndexes: idx]]; } - (void)bind: (NSString *)binding toObject: (id)anObject withKeyPath: (NSString *)keyPath options: (NSDictionary *)options { if ([binding isEqual: NSContentArrayBinding]) { GSKeyValueBinding *kvb; [self unbind: binding]; kvb = [[GSKeyValueBinding alloc] initWithBinding: @"content" withName: binding toObject: anObject withKeyPath: keyPath options: options fromObject: self]; // The binding will be retained in the binding table RELEASE(kvb); } else { [super bind: binding toObject: anObject withKeyPath: keyPath options: options]; } } - (Class) valueClassForBinding: (NSString *)binding { if ([binding isEqual: NSContentArrayBinding]) { return [NSArray class]; } else { return [super valueClassForBinding: binding]; } } - (void) encodeWithCoder: (NSCoder *)coder { [super encodeWithCoder: coder]; if ([coder allowsKeyedCoding]) { [coder encodeBool: [self avoidsEmptySelection] forKey: @"NSAvoidsEmptySelection"]; [coder encodeBool: [self preservesSelection] forKey: @"NSPreservesSelection"]; [coder encodeBool: [self selectsInsertedObjects] forKey: @"NSSelectsInsertedObjects"]; [coder encodeBool: [self clearsFilterPredicateOnInsertion] forKey: @"NSClearsFilterPredicateOnInsertion"]; } else { } } - (id) initWithCoder: (NSCoder *)coder { if ((self = [super initWithCoder: coder]) == nil) { return nil; } if ([coder allowsKeyedCoding]) { if ([coder containsValueForKey: @"NSAvoidsEmptySelection"]) { [self setAvoidsEmptySelection: [coder decodeBoolForKey: @"NSAvoidsEmptySelection"]]; } if ([coder containsValueForKey: @"NSPreservesSelection"]) { [self setPreservesSelection: [coder decodeBoolForKey: @"NSPreservesSelection"]]; } if ([coder containsValueForKey: @"NSSelectsInsertedObjects"]) { [self setSelectsInsertedObjects: [coder decodeBoolForKey: @"NSSelectsInsertedObjects"]]; } if ([coder containsValueForKey: @"NSClearsFilterPredicateOnInsertion"]) { [self setClearsFilterPredicateOnInsertion: [coder decodeBoolForKey: @"NSClearsFilterPredicateOnInsertion"]]; } } else { } return self; } @end gnustep-gui-0.24.0/Source/NSBrowser.m0000664000076500007650000026153012244357022017254 0ustar brains99brains99/** NSBrowser Control to display and select from hierarchal lists Copyright (C) 1996, 1997, 2002 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Felipe A. Rodriguez Date: August 1998 Author: Franck Wolff Date: November 1999 Author: Mirko Viviani Date: September 2000 Author: Fred Kiefer Date: September 2002 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include // (float)rintf(float x) #import "config.h" #import #import #import #import #import #import #import "AppKit/NSBrowser.h" #import "AppKit/NSBrowserCell.h" #import "AppKit/AppKitExceptions.h" #import "AppKit/NSScroller.h" #import "AppKit/NSCell.h" #import "AppKit/NSColor.h" #import "AppKit/NSFont.h" #import "AppKit/NSScrollView.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSMatrix.h" #import "AppKit/NSTableHeaderCell.h" #import "AppKit/NSEvent.h" #import "AppKit/NSWindow.h" #import "AppKit/NSBezierPath.h" #import "GNUstepGUI/GSTheme.h" #import "GSGuiPrivate.h" /* Cache */ static CGFloat scrollerWidth; // == [NSScroller scrollerWidth] static NSTextFieldCell *titleCell; static CGFloat browserColumnSeparation; static CGFloat browserVerticalPadding; static BOOL browserUseBezels; #define NSBR_COLUMN_IS_VISIBLE(i) \ (((i)>=_firstVisibleColumn)&&((i)<=_lastVisibleColumn)) // // Internal class for maintaining information about columns // @interface NSBrowserColumn : NSObject { @public BOOL _isLoaded; NSScrollView *_columnScrollView; NSMatrix *_columnMatrix; NSString *_columnTitle; CGFloat _width; } - (void) setIsLoaded: (BOOL)flag; - (BOOL) isLoaded; - (void) setColumnScrollView: (NSScrollView *)aView; - (NSScrollView *) columnScrollView; - (void) setColumnMatrix: (NSMatrix *)aMatrix; - (NSMatrix *) columnMatrix; - (void) setColumnTitle: (NSString *)aString; - (NSString *) columnTitle; @end @implementation NSBrowserColumn - (id) init { self = [super init]; if (nil == self) return nil; _isLoaded = NO; return self; } - (void) dealloc { TEST_RELEASE(_columnScrollView); TEST_RELEASE(_columnMatrix); TEST_RELEASE(_columnTitle); [super dealloc]; } - (void) setIsLoaded: (BOOL)flag { _isLoaded = flag; } - (BOOL) isLoaded { return _isLoaded; } - (void) setColumnScrollView: (NSScrollView *)aView { ASSIGN(_columnScrollView, aView); } - (NSScrollView *) columnScrollView { return _columnScrollView; } - (void) setColumnMatrix: (NSMatrix *)aMatrix { ASSIGN(_columnMatrix, aMatrix); } - (NSMatrix *) columnMatrix { return _columnMatrix; } - (void) setColumnTitle: (NSString *)aString { if (!aString) aString = @""; ASSIGN(_columnTitle, aString); } - (NSString *) columnTitle { return _columnTitle; } - (void) encodeWithCoder: (NSCoder *)aCoder { if ([aCoder allowsKeyedCoding]) { } else { int dummy = 0; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isLoaded]; [aCoder encodeObject: _columnScrollView]; [aCoder encodeObject: _columnMatrix]; [aCoder encodeValueOfObjCType: @encode(int) at: &dummy]; [aCoder encodeObject: _columnTitle]; } } - (id) initWithCoder: (NSCoder *)aDecoder { if ([aDecoder allowsKeyedCoding]) { } else { int dummy = 0; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isLoaded]; _columnScrollView = [aDecoder decodeObject]; if (_columnScrollView) RETAIN(_columnScrollView); _columnMatrix = [aDecoder decodeObject]; if (_columnMatrix) RETAIN(_columnMatrix); [aDecoder decodeValueOfObjCType: @encode(int) at: &dummy]; _columnTitle = [aDecoder decodeObject]; if (_columnTitle) RETAIN(_columnTitle); } return self; } @end // NB: this is used in the NSFontPanel too @interface GSBrowserTitleCell: NSTableHeaderCell @end @implementation GSBrowserTitleCell // Default appearance of GSBrowserTitleCell - (id) initTextCell: (NSString *)aString { self = [super initTextCell: aString]; if (!self) return nil; [self setTextColor: [[GSTheme theme] browserHeaderTextColor]]; return self; } - (NSRect) drawingRectForBounds: (NSRect)theRect { // This adjustment must match the drawn border return [[GSTheme theme] browserHeaderDrawingRectForCell: self withFrame: theRect]; } - (void) _drawBorderAndBackgroundWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { [[GSTheme theme] drawBrowserHeaderCell: self withFrame: cellFrame inView: controlView]; } - (BOOL) isOpaque { return NO; } @end // // Private NSBrowser methods // @interface NSBrowser (Private) - (NSString *) _getTitleOfColumn: (NSInteger)column; - (void) _performLoadOfColumn: (NSInteger)column; - (void) _remapColumnSubviews: (BOOL)flag; - (void) _setColumnTitlesNeedDisplay; - (NSBorderType) _resolvedBorderType; - (void) _themeDidActivate: (NSNotification*)notification; @end // // NSBrowser implementation // @implementation NSBrowser /**

Returns the NSBrowserCell class (regardless of whether a -setCellClass: message has been sent to a particular instance). This method is not meant to be used by applications.

See Also: -setCellClass:

*/ + (Class) cellClass { return [NSBrowserCell class]; } /**

Sets the class of NSCell used in the columns of the NSBrowser.

*

See Also: -setCellPrototype: -cellPrototype +cellClass

*/ - (void) setCellClass: (Class)classId { NSCell *aCell; aCell = [[classId alloc] init]; // set the prototype for the new class [self setCellPrototype: aCell]; RELEASE(aCell); } /**

Returns the NSBrowser's prototype NSCell instance.

See Also: -setCellPrototype:

*/ - (id) cellPrototype { return _browserCellPrototype; } /**

Sets the NSCell instance copied to display items in the columns of NSBrowser.

See Also: -cellPrototype

*/ - (void) setCellPrototype: (NSCell *)aCell { ASSIGN(_browserCellPrototype, aCell); } /**

Returns the class of NSMatrix used in the NSBrowser's columns.

See Also: -setMatrixClass:

*/ - (Class) matrixClass { return _browserMatrixClass; } /**

Sets the matrix class (NSMatrix or an NSMatrix subclass) used in the NSBrowser's columns.

See Also: -matrixClass

*/ - (void) setMatrixClass: (Class)classId { _browserMatrixClass = classId; } /* * Getting matrices, cells, and rows */ /**

Returns the last (rightmost and lowest) selected NSCell. Returns nil if no cell is selected

See Also: -selectedCells -selectedCellInColumn:

*/ - (id) selectedCell { NSInteger i; NSMatrix *matrix; // Nothing selected if ((i = [self selectedColumn]) == -1) { return nil; } if (!(matrix = [self matrixInColumn: i])) { return nil; } return [matrix selectedCell]; } /**

Returns the last (lowest) NSCell that's selected in column. Returns nil if no cell is selected

See Also: -selectedCell -selectedCells

*/ - (id) selectedCellInColumn: (NSInteger)column { NSMatrix *matrix; if (!(matrix = [self matrixInColumn: column])) { return nil; } return [matrix selectedCell]; } /**

Returns a NSArray of selected cells in the rightmost column. Returns nil if no cell is selected.

See Also: -selectedCell -selectedCellInColumn: [NSMatrix selectedCells]

*/ - (NSArray *) selectedCells { NSInteger i; NSMatrix *matrix; // Nothing selected if ((i = [self selectedColumn]) == -1) { return nil; } if (!(matrix = [self matrixInColumn: i])) { return nil; } return [matrix selectedCells]; } /**

Selects all NSCells in the last column of the NSBrowser.

See Also: [NSMatrix-selectAll:]

*/ - (void) selectAll: (id)sender { NSMatrix *matrix; if (!(matrix = [self matrixInColumn: _lastColumnLoaded])) { return; } [matrix selectAll: sender]; } /**

Returns the row index of the selected cell in the column specified by index column. Returns -1 if no cell is selected

See Also: -selectedCellInColumn: [NSMatrix-selectedRow]

*/ - (NSInteger) selectedRowInColumn: (NSInteger)column { NSMatrix *matrix; if (!(matrix = [self matrixInColumn: column])) { return -1; } return [matrix selectedRow]; } /**

Selects the cell at index row in the column identified by index column. If the delegate method -browser:selectRow:inColumn: is implemented, this is its responsability to select the cell. This method adds a NSBrowser column if needed and deselects other selections if the browser does not allows multiple selection.

See Also: -loadedCellAtRow:column: -browser:selectRow:inColumn: [NSMatrix-selectCellAtRow:column:]

*/ - (void) selectRow: (NSInteger)row inColumn: (NSInteger)column { NSMatrix *matrix; id cell; BOOL didSelect; if ((matrix = [self matrixInColumn: column]) == nil) { return; } if ((cell = [matrix cellAtRow: row column: 0]) == nil) { return; } [self setLastColumn: column]; if (_allowsMultipleSelection == NO) { [matrix deselectAllCells]; } if ([_browserDelegate respondsToSelector: @selector(browser:selectRow:inColumn:)]) { didSelect = [_browserDelegate browser: self selectRow: row inColumn: column]; } else { [matrix selectCellAtRow: row column: 0]; didSelect = YES; } if (didSelect && (![cell respondsToSelector: @selector(isLeaf)] || ([(NSBrowserCell*)cell isLeaf] == NO))) { [self addColumn]; } } /**

Returns the index path of the selected item, or nil if there is no selection. */ - (NSIndexPath *) selectionIndexPath { NSInteger columnNumber = 0; NSInteger selectedColumn = [self selectedColumn]; if (selectedColumn > -1) { NSUInteger rowIndexes[selectedColumn + 1]; for (columnNumber = 0; columnNumber <= selectedColumn; columnNumber++) { rowIndexes[columnNumber] = [self selectedRowInColumn: columnNumber]; } return [[NSIndexPath alloc] initWithIndexes: rowIndexes length: selectedColumn + 1]; } return nil; } - (NSArray *) selectionIndexPaths { NSInteger selectedColumn = [self selectedColumn]; if (selectedColumn == -1) { return nil; } else { NSMutableArray *paths = AUTORELEASE([[NSMutableArray alloc] init]); NSMatrix *matrix; NSArray *selectedCells; NSUInteger count; // FIXME: There should be a more efficent way to the the selected row numbers if (!(matrix = [self matrixInColumn: selectedColumn])) { return nil; } selectedCells = [matrix selectedCells]; if (selectedCells == nil) { return nil; } count = [selectedCells count]; NSInteger seletedRows[count]; NSEnumerator *enumerator = [selectedCells objectEnumerator]; NSCell *cell; int i = 0; while ((cell = [enumerator nextObject]) != nil) { NSInteger row; NSInteger column; [matrix getRow: &row column: &column ofCell: cell]; seletedRows[i++] = row; } if (selectedColumn > 0) { NSIndexPath *indexPath; NSUInteger rowIndexes[selectedColumn]; NSInteger columnNumber = 0; for (columnNumber = 0; columnNumber < selectedColumn; columnNumber++) { rowIndexes[columnNumber] = [self selectedRowInColumn: columnNumber]; } indexPath = [[NSIndexPath alloc] initWithIndexes: rowIndexes length: selectedColumn]; for (i = 0; i < count; i++) { [paths addObject: [indexPath indexPathByAddingIndex: seletedRows[i]]]; } } if (selectedColumn == 0) { NSIndexPath *indexPath; for (i = 0; i < count; i++) { indexPath = [[NSIndexPath alloc] initWithIndex: seletedRows[i]]; [paths addObject: indexPath]; RELEASE(indexPath); } } return paths; } return nil; } - (void) setSelectionIndexPath: (NSIndexPath *)path { NSInteger column; NSUInteger length; length = [path length]; for (column = 0; column < length; column++) { NSInteger row = [path indexAtPosition: column]; [self selectRow: row inColumn: column]; } } - (void) setSelectionIndexPaths: (NSArray *)paths { NSEnumerator *enumerator = [paths objectEnumerator]; NSIndexPath *path; while ((path = [enumerator nextObject]) != nil) { // FIXME [self setSelectionIndexPath: path]; } } /** Loads if necessary and returns the NSCell at row in column. if you change this code, you may want to look at the __performLoadOfColumn: method in which the following code is integrated (for speed) */ - (id) loadedCellAtRow: (NSInteger)row column: (NSInteger)column { NSMatrix *matrix; NSCell *cell; if ((matrix = [self matrixInColumn: column]) == nil) { return nil; } // Get the cell if ((cell = [matrix cellAtRow: row column: 0]) == nil) { return nil; } // Load if not already loaded if (![cell respondsToSelector: @selector(isLoaded)] || [(NSBrowserCell*)cell isLoaded]) { return cell; } else { if (_passiveDelegate || [_browserDelegate respondsToSelector: @selector(browser:willDisplayCell:atRow:column:)]) { [_browserDelegate browser: self willDisplayCell: cell atRow: row column: column]; } [(NSBrowserCell*)cell setLoaded: YES]; } return cell; } /**

Returns the matrix located in the column identified by index column. Returns nil if the matrix does not exists

*/ - (NSMatrix *) matrixInColumn: (NSInteger)column { NSBrowserColumn *browserColumn; if (column < 0 || column > _lastColumnLoaded) { return nil; } browserColumn = [_browserColumns objectAtIndex: column]; if ((browserColumn == nil) || !(browserColumn->_isLoaded)) { return nil; } return browserColumn->_columnMatrix; } /* * Getting and setting paths */ /**

Returns the browser's current path.

See Also: -pathToColumn:

*/ - (NSString *) path { return [self pathToColumn: _lastColumnLoaded + 1]; } /** *

Parses path and selects corresponding items in the NSBrowser columns. *

*

This is the primary mechanism for programmatically updating the * selection of a browser. It should result in the browser cells * corresponding to the components being selected, and the * browser columns up to the end of path (and just beyond if the * last selected cell's [NSBrowserCell-isLeaf] returns YES).
* It does not result in the browsers action being sent to its * target, just in a change to the browser selection and display. *

*

If path begins with the -pathSeparator then it is taken to be absolute * and the first component in it is expected to denote a cell in column * zero. Otherwise it is taken to be relative to the currently selected * column. *

*

Empty components (ie where a -pathSeparator occurs immediately * after another or at the end of path) are simply ignored. *

*

The receivers delegate is asked to select each cell in turn * using the -browser:selectCellWithString:inColumn: method (if it * implements it). If this call to the delegate returns NO then * the attempt to set the path fails.
* If the delegate does not implement the method, the browser attempts * to locate and select the cell itself, and the method fails if it * is unable to locate the cell by matching its [NSCell-stringValue] with * the component of the path. *

*

The method returns YES if path contains no components or if a cell * corresponding to the path was found. Otherwise it returns NO. *

*/ - (BOOL) setPath: (NSString *)path { NSMutableArray *subStrings; NSUInteger numberOfSubStrings; NSUInteger indexOfSubStrings; NSInteger column; BOOL useDelegate = NO; if ([_browserDelegate respondsToSelector: @selector(browser:selectCellWithString:inColumn:)]) { useDelegate = YES; } /* * Ensure that our starting column is loaded. */ if (_lastColumnLoaded < 0) { [self loadColumnZero]; } /* * Decompose the path. */ subStrings = [[path componentsSeparatedByString: _pathSeparator] mutableCopy]; [subStrings removeObject: @""]; numberOfSubStrings = [subStrings count]; if ([path hasPrefix: _pathSeparator]) { NSUInteger i; /* * If the path begins with a separator, start at column 0. * Otherwise start at the currently selected column. */ column = 0; /* * Optimisation. If there are columns loaded, it may be that the * specified path is already partially selected. If this is the * case, we can avoid redrawing those columns. */ for (i = 0; i <= _lastColumnLoaded; i++) { if ((i < numberOfSubStrings) && [[[self selectedCellInColumn: i] stringValue] isEqualToString: [subStrings objectAtIndex: i]]) { column = i; } else { // Actually it's always called at 0 column, when string is "/" [[self matrixInColumn: i] deselectAllCells]; break; } } [self setLastColumn: column]; indexOfSubStrings = column; } else { column = _lastColumnLoaded; indexOfSubStrings = 0; } // cycle thru str's array created from path while (indexOfSubStrings < numberOfSubStrings) { NSString *aStr = [subStrings objectAtIndex: indexOfSubStrings]; NSBrowserColumn *bc = [_browserColumns objectAtIndex: column]; NSMatrix *matrix = [bc columnMatrix]; NSBrowserCell *selectedCell = nil; BOOL found = NO; if (useDelegate == YES) { if ([_browserDelegate browser: self selectCellWithString: aStr inColumn: column]) { found = YES; selectedCell = [matrix selectedCell]; } } else { NSInteger numOfRows = [matrix numberOfRows]; NSInteger row; // find the cell in the browser matrix which is equal to aStr for (row = 0; row < numOfRows; row++) { selectedCell = [matrix cellAtRow: row column: 0]; if ([[selectedCell stringValue] isEqualToString: aStr]) { [matrix selectCellAtRow: row column: 0]; found = YES; break; } } } if (found) { indexOfSubStrings++; } else { // if unable to find a cell whose title matches aStr return NO NSDebugLLog (@"NSBrowser", @"unable to find cell '%@' in column %d\n", aStr, (int)column); break; } // if the cell is a leaf, we are finished setting the path if ([selectedCell isLeaf]) { break; } // else, it is not a leaf: get a column in the browser for it [self addColumn]; column++; } // Clean up local memory usage RELEASE(subStrings); if (indexOfSubStrings == numberOfSubStrings) { return YES; } else { return NO; } } /**

Returns a string representing the path from the first column up to, but not including, the column at index column.

See Also: -path

*/ - (NSString *) pathToColumn: (NSInteger)column { NSMutableString *separator = [_pathSeparator mutableCopy]; NSString *string; NSInteger i; /* * Cannot go past the number of loaded columns */ if (column > _lastColumnLoaded) { column = _lastColumnLoaded + 1; } for (i = 0; i < column; ++i) { id cell = [self selectedCellInColumn: i]; if (i != 0) { [separator appendString: _pathSeparator]; } string = [cell stringValue]; if (string == nil) { /* This should happen only when c == nil, in which case it doesn't make sense to go with the path */ break; } else { [separator appendString: string]; } } /* * We actually return a mutable string, but that's ok since a mutable * string is a string and the documentation specifically says that * people should not depend on methods that return strings to return * immutable strings. */ return AUTORELEASE (separator); } /**

Returns the path separator. The default is "/".

See Also: -setPathSeparator:

*/ - (NSString *) pathSeparator { return _pathSeparator; } /**

Sets the path separator to newString. The default is "/".

See Also: -pathSeparator

*/ - (void) setPathSeparator: (NSString *)aString { ASSIGN(_pathSeparator, aString); } /* * Manipulating columns */ - (NSBrowserColumn *) _createColumn { NSBrowserColumn *bc; NSScrollView *sc; NSRect rect = {{-110, -110}, {100, 100}}; bc = [[NSBrowserColumn alloc] init]; // Create a scrollview sc = [[NSScrollView alloc] initWithFrame: rect]; [sc setHasHorizontalScroller: NO]; [sc setHasVerticalScroller: YES]; [sc setBorderType: [self _resolvedBorderType]]; [bc setColumnScrollView: sc]; [self addSubview: sc]; RELEASE(sc); [_browserColumns addObject: bc]; RELEASE(bc); return bc; } /**

Adds a column to the right of the last column, adjusts subviews and scrolls to make the new column visible if needed.

*/ - (void) addColumn { NSInteger i; if ((NSUInteger)(_lastColumnLoaded + 1) >= [_browserColumns count]) { i = [_browserColumns indexOfObject: [self _createColumn]]; } else { i = _lastColumnLoaded + 1; } if (i < 0) { i = 0; } [self _performLoadOfColumn: i]; [self setLastColumn: i]; _isLoaded = YES; [self tile]; if (i > 0 && i - 1 == _lastVisibleColumn) { [self scrollColumnsRightBy: 1]; } } - (BOOL) acceptsFirstResponder { return YES; } - (BOOL) becomeFirstResponder { NSMatrix *matrix; NSInteger selectedColumn; selectedColumn = [self selectedColumn]; if (selectedColumn == -1) matrix = [self matrixInColumn: 0]; else matrix = [self matrixInColumn: selectedColumn]; if (matrix) [_window makeFirstResponder: matrix]; return YES; } /**

Updates the NSBrowser to display all loaded columns.

See Also: -displayColumn: -tile

*/ - (void) displayAllColumns { [self tile]; [self setNeedsDisplay: YES]; } /**

Updates the NSBrowser to display the column with the given index.

*/ - (void) displayColumn: (NSInteger)column { NSBrowserColumn *bc; NSScrollView *sc; // If not visible then nothing to display if ((column < _firstVisibleColumn) || (column > _lastVisibleColumn)) { return; } [self tile]; // Display title of column if (_isTitled) { [self setNeedsDisplayInRect: [self titleFrameOfColumn: column]]; } // Display column if (!(bc = [_browserColumns objectAtIndex: column])) return; if (!(sc = [bc columnScrollView])) return; /* FIXME: why the following ? Are we displaying now, or marking for * later display ?? Given the name, I think we are displaying * now. */ [sc setNeedsDisplay: YES]; } /**

Returns the column number in which matrix is located. Returns -1 if matrix is not found.

*/ - (NSInteger) columnOfMatrix: (NSMatrix *)matrix { NSInteger i, count; // Loop through columns and compare matrixes count = [_browserColumns count]; for (i = 0; i < count; ++i) { if (matrix == [self matrixInColumn: i]) return i; } // Not found return -1; } /** Returns the index of the last column with a selected item. */ - (NSInteger) selectedColumn { NSInteger i; NSMatrix *matrix; for (i = _lastColumnLoaded; i >= 0; i--) { if (!(matrix = [self matrixInColumn: i])) continue; if ([matrix selectedCell]) return i; } return -1; } /**

Returns the index of the last column loaded.

See Also: -setLastColumn:

*/ - (NSInteger) lastColumn { return _lastColumnLoaded; } /**

Sets the last column to column.

See Also: -lastColumn

*/ - (void) setLastColumn: (NSInteger)column { NSInteger i, count; NSBrowserColumn *bc; NSScrollView *sc; if (column > _lastColumnLoaded) { return; } if (column < 0) { column = -1; _isLoaded = NO; } _lastColumnLoaded = column; // Unloads columns. count = [_browserColumns count]; for (i = column + 1; i < count; ++i) { bc = [_browserColumns objectAtIndex: i]; sc = [bc columnScrollView]; if ([bc isLoaded]) { // Make the column appear empty by removing the matrix if (sc) { [sc setDocumentView: nil]; } [bc setIsLoaded: NO]; [self setTitle: nil ofColumn: i]; } if (!_reusesColumns && i > _lastVisibleColumn) { [sc removeFromSuperview]; [_browserColumns removeObject: bc]; count--; i--; } } [self scrollColumnToVisible:column]; } /** Returns the index of the first visible column. */ - (NSInteger) firstVisibleColumn { return _firstVisibleColumn; } /**

Returns the number of columns visible.

See Also: -firstVisibleColumn -lastVisibleColumn

*/ - (NSInteger) numberOfVisibleColumns { NSInteger num; num = _lastVisibleColumn - _firstVisibleColumn + 1; return (num > 0 ? num : 1); } /** Returns the index of the last visible column. */ - (NSInteger) lastVisibleColumn { return _lastVisibleColumn; } /** Invokes delegate method -browser:isColumnValid: for visible columns. */ - (void) validateVisibleColumns { NSInteger i; // If delegate doesn't care, just return if (![_browserDelegate respondsToSelector: @selector(browser:isColumnValid:)]) { return; } // Loop through the visible columns for (i = _firstVisibleColumn; i <= _lastVisibleColumn; ++i) { // Ask delegate if the column is valid and if not // then reload the column if (![_browserDelegate browser: self isColumnValid: i]) { [self reloadColumn: i]; } } } /* * Loading columns */ /** Returns whether column zero is loaded. */ - (BOOL) isLoaded { return _isLoaded; } /** Loads column zero; unloads previously loaded columns. */ - (void) loadColumnZero { // set last column loaded [self setLastColumn: -1]; // load column 0 [self addColumn]; [self _remapColumnSubviews: YES]; [self _setColumnTitlesNeedDisplay]; } /** Reloads column if it is loaded; sets it as the last column. Reselects previously selected cells, if they remain. */ - (void) reloadColumn: (NSInteger)column { NSArray *selectedCells; NSEnumerator *selectedCellsEnumerator; NSMatrix *matrix; NSCell *cell; matrix = [self matrixInColumn: column]; if (matrix == nil) { return; } // Get the previously selected cells selectedCells = [[matrix selectedCells] copy]; // Perform the data load [self _performLoadOfColumn: column]; // set last column loaded [self setLastColumn: column]; // Restore the selected cells matrix = [self matrixInColumn: column]; selectedCellsEnumerator = [selectedCells objectEnumerator]; while ((cell = [selectedCellsEnumerator nextObject]) != nil) { NSInteger sRow, sColumn; if ([matrix getRow: &sRow column: &sColumn ofCell: cell]) { [matrix selectCellAtRow: sRow column: sColumn]; } } RELEASE(selectedCells); } /* * Setting selection characteristics */ /**

Returns whether the user can select branch items when multiple selection is enabled. By default YES.

See Also: -setAllowsBranchSelection:

*/ - (BOOL) allowsBranchSelection { return _allowsBranchSelection; } /**

Sets whether the user can select branch items when multiple selection is enabled. By default YES.

See Also: -allowsBranchSelection

*/ - (void) setAllowsBranchSelection: (BOOL)flag { _allowsBranchSelection = flag; } /**

Returns whether there can be nothing selected. By default YES.

See Also: -setAllowsEmptySelection:

*/ - (BOOL) allowsEmptySelection { return _allowsEmptySelection; } /**

Sets whether there can be nothing selected. By default YES.

See Also: -allowsEmptySelection

*/ - (void) setAllowsEmptySelection: (BOOL)flag { if (_allowsEmptySelection != flag) { NSInteger i; _allowsEmptySelection = flag; for (i = 0; i <= _lastColumnLoaded; i++) { [[self matrixInColumn: i] setAllowsEmptySelection: flag]; } } } /**

Returns whether the user can select multiple items. By default YES.

See Also: -allowsMultipleSelection

*/ - (BOOL) allowsMultipleSelection { return _allowsMultipleSelection; } /**

Sets whether the user can select multiple items. By default YES.

See Also: -allowsMultipleSelection

*/ - (void) setAllowsMultipleSelection: (BOOL)flag { if (_allowsMultipleSelection != flag) { NSInteger i; NSMatrixMode mode; _allowsMultipleSelection = flag; if (flag) { mode = NSListModeMatrix; } else { mode = NSRadioModeMatrix; } for (i = 0; i <= _lastColumnLoaded; i++) { [[self matrixInColumn: i] setMode: mode]; } } } /* * Setting column characteristics */ /**

Returns YES if NSMatrix objects aren't freed when their columns are unloaded. By default a NSBrowser does not reuses their columns.

See Also: -setReusesColumns: [NSMatrix-renewRows:columns:]

*/ - (BOOL) reusesColumns { return _reusesColumns; } /**

If flag is YES, prevents NSMatrix objects from being freed when their columns are unloaded, so they can be reused. By default a NSBrowser does not reuses their columns.

See Also: -reusesColumns [NSMatrix-renewRows:columns:]

*/ - (void) setReusesColumns: (BOOL)flag { _reusesColumns = flag; } /**

Returns the maximum number of visible columns. By default a NSBrowser has 3 visible columns.

See Also: -setMaxVisibleColumns:

*/ - (NSInteger) maxVisibleColumns { return _maxVisibleColumns; } /**

Sets the maximum number of columns displayed and adjusts the various subviews. By default a NSBrowser has 3 visible columns.

See Also: -maxVisibleColumns

*/ - (void) setMaxVisibleColumns: (NSInteger)columnCount { if ((columnCount < 1) || (_maxVisibleColumns == columnCount)) return; _maxVisibleColumns = columnCount; // Redisplay [self tile]; } /**

Returns the minimum column width in pixels.

See Also: -setMinColumnWidth:

*/ - (CGFloat) minColumnWidth { return _minColumnWidth; } /**

Sets the minimum column width in pixels and adjusts subviews.

See Also: -minColumnWidth

*/ - (void) setMinColumnWidth: (CGFloat)columnWidth { CGFloat sw; sw = scrollerWidth; // Take the border into account sw += 2 * ([[GSTheme theme] sizeForBorderType: [self _resolvedBorderType]]).width; // Column width cannot be less than scroller and border if (columnWidth < sw) _minColumnWidth = sw; else _minColumnWidth = columnWidth; [self tile]; } /**

Returns whether columns are separated by bezeled borders. By default a NSBrowser has separate columns.

See Also: -setSeparatesColumns:

*/ - (BOOL) separatesColumns { return _separatesColumns; } /**

Sets whether to separate columns with bezeled borders and marks self for display. Does nothing if the NSBrowser is titled. By default a NSBrowser has separate columns.

See Also: -separatesColumns -isTitled

*/ - (void) setSeparatesColumns: (BOOL)flag { if (_separatesColumns == flag || _isTitled) return; _separatesColumns = flag; [self tile]; [self setNeedsDisplay:YES]; } - (CGFloat) columnWidthForColumnContentWidth: (CGFloat)columnContentWidth { CGFloat cw; cw = columnContentWidth; if (scrollerWidth > cw) { cw = scrollerWidth; } // Take the border into account cw += 2 * ([[GSTheme theme] sizeForBorderType: [self _resolvedBorderType]]).width; return cw; } - (CGFloat) columnContentWidthForColumnWidth: (CGFloat)columnWidth { CGFloat cw; cw = columnWidth; // Take the border into account cw -= 2 * ([[GSTheme theme] sizeForBorderType: [self _resolvedBorderType]]).width; return cw; } - (NSBrowserColumnResizingType) columnResizingType { return _columnResizing; } - (void) setColumnResizingType:(NSBrowserColumnResizingType) type { _columnResizing = type; } - (BOOL) prefersAllColumnUserResizing { return _prefersAllColumnUserResizing; } - (void) setPrefersAllColumnUserResizing: (BOOL)flag { _prefersAllColumnUserResizing = flag; } - (CGFloat) widthOfColumn: (NSInteger)column { NSBrowserColumn *browserColumn; browserColumn = [_browserColumns objectAtIndex: column]; return browserColumn->_width; } - (void) setWidth: (CGFloat)columnWidth ofColumn: (NSInteger)columnIndex { NSBrowserColumn *browserColumn; browserColumn = [_browserColumns objectAtIndex: columnIndex]; browserColumn->_width = columnWidth; // FIXME: Send a notifiaction } /**

Returns YES if the title of a column is set to the string value of the selected NSCell in the previous column. By default YES

See Also: -setTakesTitleFromPreviousColumn: -selectedCellInColumn:

*/ - (BOOL) takesTitleFromPreviousColumn { return _takesTitleFromPreviousColumn; } /**

Sets whether the title of a column is set to the string value of the selected NSCell in the previous column and marks self for display. By default YES

See Also: -takesTitleFromPreviousColumn -selectedCellInColumn:

*/ - (void) setTakesTitleFromPreviousColumn: (BOOL)flag { if (_takesTitleFromPreviousColumn != flag) { _takesTitleFromPreviousColumn = flag; [self setNeedsDisplay: YES]; } } - (BOOL) autohidesScroller { // FIXME return NO; } - (void) setAutohidesScroller: (BOOL)flag { // FIXME } - (NSColor *) backgroundColor { // FIXME return [NSColor controlColor]; } - (void) setBackgroundColor: (NSColor *)backgroundColor { // FIXME } - (BOOL) canDragRowsWithIndexes: (NSIndexSet *)rowIndexes inColumn: (NSInteger)columnIndex withEvent: (NSEvent *)dragEvent { if ([_browserDelegate respondsToSelector: @selector(browser:canDragRowsWithIndexes:inColumn:withEvent:)]) { return [_browserDelegate browser: self canDragRowsWithIndexes: rowIndexes inColumn: columnIndex withEvent: dragEvent]; } else { // FIXME return NO; } } /* * Manipulating column titles */ /** Returns the title displayed for the column at index column. */ - (NSString *) titleOfColumn: (NSInteger)column { NSBrowserColumn *browserColumn; browserColumn = [_browserColumns objectAtIndex: column]; return browserColumn->_columnTitle; } /**

Sets the title of the column at index column to aString and marks the title for dispaly if the NSBrowser can diplay titles or if the column column is visible.

See Also: -isTitled -titleFrameOfColumn: -titleHeight

*/ - (void) setTitle: (NSString *)aString ofColumn: (NSInteger)column { NSBrowserColumn *bc; bc = [_browserColumns objectAtIndex: column]; [bc setColumnTitle: aString]; // If column is not visible then nothing to redisplay if (!_isTitled || !NSBR_COLUMN_IS_VISIBLE(column)) return; [self setNeedsDisplayInRect: [self titleFrameOfColumn: column]]; } /**

Returns whether columns display titles. By default a NSBrowser displays titles.

See Also: -setTitled:

*/ - (BOOL) isTitled { return _isTitled; } /**

Sets whether columns display titles and marks self for display. Does nothing if the NSBrowser hasn't separates columns. By default a NSBrowser displays titles.

See Also: -isTitled -separatesColumns

*/ - (void) setTitled: (BOOL)flag { if (_isTitled == flag || !_separatesColumns) return; _isTitled = flag; [self tile]; [self setNeedsDisplay: YES]; } /** */ - (void) drawTitleOfColumn: (NSInteger)column inRect: (NSRect)aRect { [self drawTitle: [self titleOfColumn: column] inRect: aRect ofColumn: column]; } /** Draws the title for the column at index column within the rectangle defined by aRect. */ - (void) drawTitle: (NSString *)title inRect: (NSRect)aRect ofColumn: (NSInteger)column { if (!_isTitled || !NSBR_COLUMN_IS_VISIBLE(column)) return; // [titleCell setControlView: self]; [titleCell setStringValue: title]; [titleCell drawWithFrame: aRect inView: self]; [titleCell setControlView: nil]; } /**

Returns the height of column titles. The Nextish look returns 21.

*/ - (CGFloat) titleHeight { // Nextish look requires 21 here return 21.0; } /**

Returns the bounds of the title frame for the column at index column. Returns NSZeroRect if the NSBrowser does not display its titles

See Also: -isTitled

*/ - (NSRect) titleFrameOfColumn: (NSInteger)column { // Not titled then no frame if (!_isTitled) { return NSZeroRect; } else { // Number of columns over from the first NSInteger nbColumn = column - _firstVisibleColumn; CGFloat titleHeight = [self titleHeight]; NSRect rect; // Calculate origin if (_separatesColumns) { rect.origin.x = nbColumn * (_columnSize.width + browserColumnSeparation); } else { rect.origin.x = nbColumn * _columnSize.width; } rect.origin.y = _frame.size.height - titleHeight; // Calculate size if (column == _lastVisibleColumn) { rect.size.width = _frame.size.width - rect.origin.x; } else { rect.size.width = _columnSize.width; } rect.size.height = titleHeight; return rect; } } /* * Scrolling an NSBrowser */ /**

Scrolls to make the column at index column visible.

See Also: -scrollColumnsRightBy: -scrollColumnsLeftBy:

*/ - (void) scrollColumnToVisible: (NSInteger)column { // If its the last visible column then we are there already if (_lastVisibleColumn < column) { [self scrollColumnsRightBy: (column - _lastVisibleColumn)]; } else if (_firstVisibleColumn > column) { [self scrollColumnsLeftBy: (_firstVisibleColumn - column)]; } } /**

Scrolls columns left by shiftAmount columns.

See Also: -scrollColumnsRightBy: -scrollColumnToVisible:

*/ - (void) scrollColumnsLeftBy: (NSInteger)shiftAmount { // Cannot shift past the zero column if ((_firstVisibleColumn - shiftAmount) < 0) shiftAmount = _firstVisibleColumn; // No amount to shift then nothing to do if (shiftAmount <= 0) return; // Notify the delegate if ([_browserDelegate respondsToSelector: @selector(browserWillScroll:)]) [_browserDelegate browserWillScroll: self]; // Shift _firstVisibleColumn = _firstVisibleColumn - shiftAmount; _lastVisibleColumn = _lastVisibleColumn - shiftAmount; // Update the scroller [self updateScroller]; // Update the scrollviews [self tile]; [self _remapColumnSubviews: YES]; [self _setColumnTitlesNeedDisplay]; // Notify the delegate if ([_browserDelegate respondsToSelector: @selector(browserDidScroll:)]) [_browserDelegate browserDidScroll: self]; } /**

Scrolls columns right by shiftAmount columns.

See Also: -scrollColumnsLeftBy: -scrollColumnToVisible:

*/ - (void) scrollColumnsRightBy: (NSInteger)shiftAmount { // Cannot shift past the last loaded column if ((shiftAmount + _lastVisibleColumn) > _lastColumnLoaded) shiftAmount = _lastColumnLoaded - _lastVisibleColumn; // No amount to shift then nothing to do if (shiftAmount <= 0) return; // Notify the delegate if ([_browserDelegate respondsToSelector: @selector(browserWillScroll:)]) [_browserDelegate browserWillScroll: self]; // Shift _firstVisibleColumn = _firstVisibleColumn + shiftAmount; _lastVisibleColumn = _lastVisibleColumn + shiftAmount; // Update the scroller [self updateScroller]; // Update the scrollviews [self tile]; [self _remapColumnSubviews: NO]; [self _setColumnTitlesNeedDisplay]; // Notify the delegate if ([_browserDelegate respondsToSelector: @selector(browserDidScroll:)]) [_browserDelegate browserDidScroll: self]; } /** Updates the horizontal scroller to reflect column positions. */ - (void) updateScroller { NSInteger num = [self numberOfVisibleColumns]; float prop = (float)num / (float)(_lastColumnLoaded + 1); NSInteger uc = ((_lastColumnLoaded + 1) - num); // Unvisible columns float f_step = 1.0; // Knob moving step float fv = 0.0; if (uc > 0.0) { f_step = 1.0 / (float)uc; } fv = (float)(_firstVisibleColumn * f_step); if (_lastVisibleColumn > _lastColumnLoaded) { prop = (float)num / (float)(_lastVisibleColumn + 1); } [_horizontalScroller setFloatValue: fv knobProportion: prop]; } /** Scrolls columns left or right based on an NSScroller. */ - (void) scrollViaScroller: (NSScroller *)sender { NSScrollerPart hit; if ([sender class] != [NSScroller class]) return; hit = [sender hitPart]; switch (hit) { // Scroll to the left case NSScrollerDecrementLine: case NSScrollerDecrementPage: [self scrollColumnsLeftBy: 1]; break; // Scroll to the right case NSScrollerIncrementLine: case NSScrollerIncrementPage: [self scrollColumnsRightBy: 1]; break; // The knob or knob slot case NSScrollerKnob: case NSScrollerKnobSlot: { float f = [sender floatValue]; [self scrollColumnToVisible: GSRoundTowardsInfinity(f * _lastColumnLoaded)]; } break; // NSScrollerNoPart ??? default: break; } } - (void) scrollRowToVisible: (NSInteger)row inColumn: (NSInteger)column { NSMatrix *matrix = [self matrixInColumn: column]; [matrix scrollCellToVisibleAtRow: row column: 1]; } /* * Showing a horizontal scroller */ /**

Returns whether an NSScroller is used to scroll horizontally. By default a NSBrowser has a horizontal scroller.

See Also: -setHasHorizontalScroller:

*/ - (BOOL) hasHorizontalScroller { return _hasHorizontalScroller; } /**

Sets whether an NSScroller is used to scroll horizontally. This method add the horizontal scroller, adjust the various subviews of the NSBrowser scroller and marks self for display.By default a NSBrowser has a horizontal scroller.

See Also: -hasHorizontalScroller -tile

*/ - (void) setHasHorizontalScroller: (BOOL)flag { if (_hasHorizontalScroller != flag) { _hasHorizontalScroller = flag; if (!flag) [_horizontalScroller removeFromSuperview]; else [self addSubview: _horizontalScroller]; [self tile]; [self setNeedsDisplay: YES]; } } /* * Setting the behavior of arrow keys */ /**

Returns whether the arrow keys are enabled. By default YES.

See Also: -setAcceptsArrowKeys:

*/ - (BOOL) acceptsArrowKeys { return _acceptsArrowKeys; } /**

Enables or disables the arrow keys as used for navigating within and between browsers. By default YES.

See Also: -acceptsArrowKeys

*/ - (void) setAcceptsArrowKeys: (BOOL)flag { _acceptsArrowKeys = flag; } /**

Returns NO if pressing an arrow key only scrolls the browser, YES if it also sends the action message specified by [NSControl-setAction:]. By default YES.

See Also: -setSendsActionOnArrowKeys: -acceptsArrowKeys [NSControl-setAction:] [NSControl-action]

*/ - (BOOL) sendsActionOnArrowKeys { return _sendsActionOnArrowKeys; } /**

Sets whether pressing an arrow key will cause the action message to be sent (in addition to causing scrolling). By default YES.

See Also: -sendsActionOnArrowKeys -setAcceptsArrowKeys: [NSControl-setAction:] [NSControl-action]

*/ - (void) setSendsActionOnArrowKeys: (BOOL)flag { _sendsActionOnArrowKeys = flag; } - (BOOL) allowsTypeSelect { // FIXME return [self acceptsArrowKeys]; } - (void) setAllowsTypeSelect: (BOOL)allowsTypeSelection { // FIXME [self setAcceptsArrowKeys: allowsTypeSelection]; } /* * Getting column frames */ /**

Returns the rectangle containing the column at index column.

*/ - (NSRect) frameOfColumn: (NSInteger)column { NSRect rect = NSZeroRect; NSSize bezelBorderSize = NSZeroSize; NSInteger n; if (browserUseBezels) bezelBorderSize = [[GSTheme theme] sizeForBorderType: NSBezelBorder]; // Number of columns over from the first n = column - _firstVisibleColumn; // Calculate the frame rect.size = _columnSize; rect.origin.x = n * _columnSize.width; if (_separatesColumns) { rect.origin.x += n * browserColumnSeparation; } else if (!_separatesColumns && browserUseBezels) { if (column == _firstVisibleColumn) rect.origin.x += 2; else rect.origin.x += (n + 2); } // Adjust for horizontal scroller if (browserUseBezels) { if (_hasHorizontalScroller) { if (_separatesColumns) rect.origin.y = (scrollerWidth - 1) + (2 * bezelBorderSize.height) + browserVerticalPadding; else rect.origin.y = scrollerWidth + bezelBorderSize.width; } else { rect.origin.y += bezelBorderSize.width; } } else { if (_hasHorizontalScroller) rect.origin.y = scrollerWidth; } // Padding : _columnSize.width is rounded in "tile" method if (column == _lastVisibleColumn) { if (_separatesColumns) rect.size.width = _frame.size.width - rect.origin.x; else rect.size.width = _frame.size.width - (rect.origin.x + bezelBorderSize.width); // FIXME: Assumes left-side scrollers if ([[GSTheme theme] scrollViewScrollersOverlapBorders]) { rect.size.width -= 1; } } if (rect.size.width < 0) { rect.size.width = 0; } if (rect.size.height < 0) { rect.size.height = 0; } return rect; } /** Returns the rectangle containing the column at index column, */ // not including borders. - (NSRect) frameOfInsideOfColumn: (NSInteger)column { // xxx what does this one do? return [self frameOfColumn: column]; } + (void) removeSavedColumnsWithAutosaveName: (NSString *)name { [[NSUserDefaults standardUserDefaults] removeObjectForKey: name]; } - (NSString *) columnsAutosaveName { return _columnsAutosaveName; } - (void) setColumnsAutosaveName: (NSString *)name { // FIXME: More to do. The whole column width saving is missing! ASSIGN(_columnsAutosaveName, name); } /* * Arranging browser components */ /** Adjusts the various subviews of NSBrowser-scrollers, columns, titles, and so on-without redrawing. Your code shouldn't send this message. It's invoked any time the appearance of the NSBrowser changes. */ - (void) tile { NSSize bezelBorderSize = NSZeroSize; NSInteger i, num, columnCount, delta; CGFloat frameWidth; const BOOL overlapBorders = [[GSTheme theme] scrollViewScrollersOverlapBorders]; const BOOL useBottomCorner = [[GSTheme theme] scrollViewUseBottomCorner]; if (browserUseBezels) bezelBorderSize = [[GSTheme theme] sizeForBorderType: NSBezelBorder]; _columnSize.height = _frame.size.height; // Titles (there is no real frames to resize) if (_isTitled) { _columnSize.height -= [self titleHeight] + browserVerticalPadding; } // Horizontal scroller if (_hasHorizontalScroller) { const CGFloat scrollerHightReduction = browserUseBezels ? 1 : 0; _scrollerRect.origin.x = bezelBorderSize.width; _scrollerRect.origin.y = bezelBorderSize.height - scrollerHightReduction; _scrollerRect.size.width = (_frame.size.width - (2 * bezelBorderSize.width)); _scrollerRect.size.height = scrollerWidth; if (_separatesColumns) _columnSize.height -= (scrollerWidth - scrollerHightReduction) + (2 * bezelBorderSize.height) + browserVerticalPadding; else _columnSize.height -= scrollerWidth + (2 * bezelBorderSize.height); // "Bottom corner" box if (!browserUseBezels && !useBottomCorner) { _scrollerRect.origin.x += scrollerWidth; _scrollerRect.size.width -= scrollerWidth; } /** Horizontall expand the scroller by GSScrollerKnobOvershoot on the left */ if (overlapBorders) { // FIXME: Assumes left scroller _scrollerRect.origin.x -= 1; _scrollerRect.size.width += 1; } if (!NSEqualRects(_scrollerRect, [_horizontalScroller frame])) { [_horizontalScroller setFrame: _scrollerRect]; } } else { _scrollerRect = NSZeroRect; _columnSize.height -= 2 * bezelBorderSize.width; } num = _lastVisibleColumn - _firstVisibleColumn + 1; if (_minColumnWidth > 0) { CGFloat colWidth = _minColumnWidth + scrollerWidth; if (_separatesColumns) colWidth += browserColumnSeparation; if (_frame.size.width > colWidth) { columnCount = (int)(_frame.size.width / colWidth); } else columnCount = 1; } else columnCount = num; if (_maxVisibleColumns > 0 && columnCount > _maxVisibleColumns) columnCount = _maxVisibleColumns; if (columnCount != num) { if (num > 0) delta = columnCount - num; else delta = columnCount - 1; if ((delta > 0) && (_lastVisibleColumn <= _lastColumnLoaded)) { _firstVisibleColumn = (_firstVisibleColumn - delta > 0) ? _firstVisibleColumn - delta : 0; } for (i = [_browserColumns count]; i < columnCount; i++) [self _createColumn]; _lastVisibleColumn = _firstVisibleColumn + columnCount - 1; } // Columns if (_separatesColumns) frameWidth = _frame.size.width - ((columnCount - 1) * browserColumnSeparation); else frameWidth = _frame.size.width - ((columnCount - 1) + (2 * bezelBorderSize.width)); _columnSize.width = (int)(frameWidth / (CGFloat)columnCount); if (_columnSize.height < 0) _columnSize.height = 0; for (i = _firstVisibleColumn; i <= _lastVisibleColumn; i++) { NSBrowserColumn *bc; NSScrollView *sc; NSMatrix *matrix; // FIXME: in some cases the column is not loaded while (i >= [_browserColumns count]) [self _createColumn]; bc = [_browserColumns objectAtIndex: i]; if (!(sc = [bc columnScrollView])) { NSLog(@"NSBrowser error, sc != [bc columnScrollView]"); return; } { NSBorderType bt = _separatesColumns ? NSBezelBorder : NSNoBorder; [sc setBorderType: bt]; } [sc setBorderType: [self _resolvedBorderType]]; [sc setFrame: [self frameOfColumn: i]]; matrix = [bc columnMatrix]; // Adjust matrix to fit in scrollview if column has been loaded if (matrix && [bc isLoaded]) { NSSize cs, ms; cs = [sc contentSize]; ms = [matrix cellSize]; ms.width = cs.width; [matrix setCellSize: ms]; [sc setDocumentView: matrix]; } } if (columnCount != num) { [self updateScroller]; [self _remapColumnSubviews: YES]; // [self _setColumnTitlesNeedDisplay]; [self setNeedsDisplay: YES]; } } /** Override from NSControl. Don't do anything to change the size of the browser. */ - (void) sizeToFit { } /* * Setting the delegate */ /**

Returns the NSBrowser's delegate.

*

See Also: -setDelegate:

*/ - (id) delegate { return _browserDelegate; } /** *

Sets the delegate of the receiver. * If not nil, the delegate must either be passive and respond to * [NSObject-browser:numberOfRowsInColumn:] or be active and respond to * [NSObject-browser:createRowsForColumn:inMatrix:] but not both. * If the delegate is active it must also respond to * [NSObject-browser:willDisplayCell:atRow:column:]. * If the delegate is not nil but does not meet these conditions, * an NSBrowserIllegalDelegateException will be raised.

*

See Also: -delegate

*/ - (void) setDelegate: (id)anObject { BOOL flag = NO; /* Default to YES for nil delegate. */ _passiveDelegate = YES; if ([anObject respondsToSelector: @selector(browser:numberOfRowsInColumn:)]) { flag = YES; if (![anObject respondsToSelector: @selector(browser:willDisplayCell:atRow:column:)]) [NSException raise: NSBrowserIllegalDelegateException format: @"(Passive) Delegate does not respond to %s\n", GSNameFromSelector (@selector(browser:willDisplayCell:atRow:column:))]; } if ([anObject respondsToSelector: @selector(browser:createRowsForColumn:inMatrix:)]) { _passiveDelegate = NO; /* If flag is already set then the delegate must respond to both methods. */ if (flag) { [NSException raise: NSBrowserIllegalDelegateException format: @"Delegate responds to both %s and %s\n", GSNameFromSelector (@selector(browser:numberOfRowsInColumn:)), GSNameFromSelector (@selector(browser:createRowsForColumn:inMatrix:))]; } flag = YES; } if (!flag && anObject) [NSException raise: NSBrowserIllegalDelegateException format: @"Delegate does not respond to %s or %s\n", GSNameFromSelector (@selector(browser:numberOfRowsInColumn:)), GSNameFromSelector (@selector(browser:createRowsForColumn:inMatrix:))]; _browserDelegate = anObject; } /* * Target and action */ /**

Returns the NSBrowser's double-click action method.

See Also: -setDoubleAction:

*/ - (SEL) doubleAction { return _doubleAction; } /**

Sets the NSBrowser's double-click action to aSelector.

See Also: -doubleAction

*/ - (void) setDoubleAction: (SEL)aSelector { _doubleAction = aSelector; } /** Sends the action message to the target. Returns YES upon success, NO if no target for the message could be found. */ - (BOOL) sendAction { return [self sendAction: [self action] to: [self target]]; } /* * Event handling */ /**

Responds to (single) mouse clicks in a column of the NSBrowser.

See Also: -doDoubleClick:

*/ - (void) doClick: (id)sender { NSArray *array; NSMutableArray *selectedCells; NSEnumerator *enumerator; NSBrowserCell *cell; NSInteger column, aCount, selectedCellsCount; if ([sender class] != _browserMatrixClass) return; column = [self columnOfMatrix: sender]; // If the matrix isn't ours then just return if (column < 0 || column > _lastColumnLoaded) return; array = [sender selectedCells]; aCount = [array count]; if (aCount == 0) return; selectedCells = [array mutableCopy]; enumerator = [array objectEnumerator]; while ((cell = [enumerator nextObject])) { if (_allowsBranchSelection == NO && [cell isLeaf] == NO) { [selectedCells removeObject: cell]; } } if ([selectedCells count] == 0 && [sender selectedCell] != nil) [selectedCells addObject: [sender selectedCell]]; selectedCellsCount = [selectedCells count]; /* If some branch cells were selected but branch selection is not allowed reset the selection and select only the leaf cells. It is a pity that we cannot deselect cells individually. */ if (selectedCellsCount != aCount) { BOOL autoscroll = [sender isAutoscroll]; /* Note: Temporarily disable autoscrolling to prevent bug #18881 */ [sender setAutoscroll: NO]; [sender deselectAllCells]; enumerator = [selectedCells objectEnumerator]; while ((cell = [enumerator nextObject])) [sender selectCell: cell]; [sender setAutoscroll: autoscroll]; } [self setLastColumn: column]; // Single selection if (selectedCellsCount == 1) { cell = [selectedCells objectAtIndex: 0]; // If the cell is not a leaf we need to load a column if (![cell isLeaf]) { [self addColumn]; } [sender scrollCellToVisibleAtRow: [sender selectedRow] column: 0]; } [self updateScroller]; // Send the action to target [self sendAction]; RELEASE(selectedCells); } /**

Responds to double-clicks in a column of the NSBrowser.

See Also: -doClick: -sendAction:to:

*/ - (void) doDoubleClick: (id)sender { // We have already handled the single click // so send the double action [self sendAction: _doubleAction to: [self target]]; } - (NSInteger) clickedColumn { // FIXME: Return column number from doClick: return -1; } - (NSInteger) clickedRow { // FIXME: Return row number from doClick: return -1; } + (void) _themeDidActivate: (NSNotification*)n { GSTheme *theme = [GSTheme theme]; scrollerWidth = [NSScroller scrollerWidth]; browserColumnSeparation = [theme browserColumnSeparation]; browserVerticalPadding = [theme browserVerticalPadding]; browserUseBezels = [theme browserUseBezels]; } + (void) initialize { if (self == [NSBrowser class]) { [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_themeDidActivate:) name: GSThemeDidActivateNotification object: nil]; // Initial version [self setVersion: 1]; /* Create the shared titleCell if it hasn't been created already. */ if (!titleCell) { titleCell = [GSBrowserTitleCell new]; } [self _themeDidActivate: nil]; } } /* * Override superclass methods */ /** Setups browser with frame 'rect'. */ - (id) initWithFrame: (NSRect)rect { NSSize bs; if ((self = [super initWithFrame: rect]) == nil) { return nil; } // Class setting _browserCellPrototype = [[[NSBrowser cellClass] alloc] init]; _browserMatrixClass = [NSMatrix class]; // Default values _pathSeparator = @"/"; _allowsBranchSelection = YES; _allowsEmptySelection = YES; _allowsMultipleSelection = YES; _reusesColumns = NO; _separatesColumns = YES; _isTitled = YES; _takesTitleFromPreviousColumn = YES; _hasHorizontalScroller = YES; _isLoaded = NO; _acceptsArrowKeys = YES; _acceptsAlphaNumericalKeys = YES; _lastKeyPressed = 0.; _charBuffer = nil; _sendsActionOnArrowKeys = YES; _sendsActionOnAlphaNumericalKeys = YES; _browserDelegate = nil; _passiveDelegate = YES; _doubleAction = NULL; // FIXME: Seems a bit wrong to look at the current theme here bs = NSZeroSize; if (browserUseBezels) bs = [[GSTheme theme] sizeForBorderType: NSBezelBorder]; _minColumnWidth = scrollerWidth + (2 * bs.width); if (_minColumnWidth < 100.0) _minColumnWidth = 100.0; // Horizontal scroller _scrollerRect.origin.x = bs.width; _scrollerRect.origin.y = bs.height; _scrollerRect.size.width = _frame.size.width - (2 * bs.width); _scrollerRect.size.height = scrollerWidth; _horizontalScroller = [[NSScroller alloc] initWithFrame: _scrollerRect]; [_horizontalScroller setTarget: self]; [_horizontalScroller setAction: @selector(scrollViaScroller:)]; [self addSubview: _horizontalScroller]; _skipUpdateScroller = NO; // Columns _browserColumns = [[NSMutableArray alloc] init]; // Create a single column _lastColumnLoaded = -1; _firstVisibleColumn = 0; _lastVisibleColumn = 0; _maxVisibleColumns = 3; [self _createColumn]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_themeDidActivate:) name: GSThemeDidActivateNotification object: nil]; return self; } - (void) dealloc { [[NSNotificationCenter defaultCenter] removeObserver: self]; if ([titleCell controlView] == self) { [titleCell setControlView: nil]; } RELEASE(_browserCellPrototype); RELEASE(_pathSeparator); RELEASE(_horizontalScroller); RELEASE(_browserColumns); TEST_RELEASE(_charBuffer); [super dealloc]; } /* * Target-actions */ /** Set target to 'target' */ - (void) setTarget: (id)target { _target = target; } /** Return current target. */ - (id) target { return _target; } /** Set action to 's'. */ - (void) setAction: (SEL)s { _action = s; } /** Return current action. */ - (SEL) action { return _action; } /* * Events handling */ - (void) drawRect: (NSRect)rect { [[GSTheme theme] drawBrowserRect: rect inView: self withScrollerRect: _scrollerRect columnSize: _columnSize]; } /* Informs the receivers's subviews that the receiver's bounds rectangle size has changed from oldFrameSize. */ - (void) resizeSubviewsWithOldSize: (NSSize)oldSize { [self tile]; } /* Override NSControl handler (prevents highlighting). */ - (void) mouseDown: (NSEvent *)theEvent { } - (void) moveLeft: (id)sender { if (_acceptsArrowKeys) { NSMatrix *matrix; NSInteger selectedColumn; matrix = (NSMatrix *)[_window firstResponder]; selectedColumn = [self columnOfMatrix:matrix]; if (selectedColumn == -1) { selectedColumn = [self selectedColumn]; matrix = [self matrixInColumn: selectedColumn]; } if (selectedColumn > 0) { [matrix deselectAllCells]; [matrix scrollCellToVisibleAtRow:0 column:0]; [self setLastColumn: selectedColumn]; selectedColumn--; [self scrollColumnToVisible: selectedColumn]; matrix = [self matrixInColumn: selectedColumn]; [_window makeFirstResponder: matrix]; if (_sendsActionOnArrowKeys == YES) { [super sendAction: _action to: _target]; } } } } - (void) moveRight: (id)sender { if (_acceptsArrowKeys) { NSMatrix *matrix; NSInteger selectedColumn; matrix = (NSMatrix *)[_window firstResponder]; selectedColumn = [self columnOfMatrix:matrix]; if (selectedColumn == -1) { selectedColumn = [self selectedColumn]; matrix = [self matrixInColumn: selectedColumn]; } if (selectedColumn == -1) { matrix = [self matrixInColumn: 0]; if ([[matrix cells] count]) { [matrix selectCellAtRow: 0 column: 0]; } } else { // if there is one selected cell and it is a leaf, move right // (column is already loaded) if (![[matrix selectedCell] isLeaf] && [[matrix selectedCells] count] == 1) { selectedColumn++; matrix = [self matrixInColumn: selectedColumn]; if ([[matrix cells] count] && [matrix selectedCell] == nil) { [matrix selectCellAtRow: 0 column: 0]; } // if selected cell is a leaf, we need to add a column if (![[matrix selectedCell] isLeaf] && [[matrix selectedCells] count] == 1) { [self addColumn]; } } } [_window makeFirstResponder: matrix]; if (_sendsActionOnArrowKeys == YES) { [super sendAction: _action to: _target]; } } } - (void) keyDown: (NSEvent *)theEvent { NSString *characters = [theEvent characters]; unichar character = 0; if ([characters length] > 0) { character = [characters characterAtIndex: 0]; } if (_acceptsArrowKeys) { switch (character) { case NSUpArrowFunctionKey: case NSDownArrowFunctionKey: return; case NSLeftArrowFunctionKey: [self moveLeft:self]; return; case NSRightArrowFunctionKey: [self moveRight:self]; return; case NSBackTabCharacter: [_window selectKeyViewPrecedingView: self]; return; case NSTabCharacter: { if ([theEvent modifierFlags] & NSShiftKeyMask) { [_window selectKeyViewPrecedingView: self]; } else { [_window selectKeyViewFollowingView: self]; } } return; } } if (_acceptsAlphaNumericalKeys && (character < 0xF700) && ([characters length] > 0)) { NSMatrix *matrix; NSString *sv; NSInteger i, n, s; NSInteger match; NSInteger selectedColumn; SEL lcarcSel = @selector(loadedCellAtRow:column:); IMP lcarc = [self methodForSelector: lcarcSel]; selectedColumn = [self selectedColumn]; if (selectedColumn != -1) { matrix = [self matrixInColumn: selectedColumn]; n = [matrix numberOfRows]; s = [matrix selectedRow]; if (!_charBuffer) { _charBuffer = [characters substringToIndex: 1]; RETAIN(_charBuffer); } else { if (([theEvent timestamp] - _lastKeyPressed < 2000.0) && (_alphaNumericalLastColumn == selectedColumn)) { NSString *transition; transition = [_charBuffer stringByAppendingString: [characters substringToIndex: 1]]; RELEASE(_charBuffer); _charBuffer = transition; RETAIN(_charBuffer); } else { RELEASE(_charBuffer); _charBuffer = [characters substringToIndex: 1]; RETAIN(_charBuffer); } } _alphaNumericalLastColumn = selectedColumn; _lastKeyPressed = [theEvent timestamp]; sv = [((*lcarc)(self, lcarcSel, s, selectedColumn)) stringValue]; if (([sv length] > 0) && ([sv hasPrefix: _charBuffer])) return; match = -1; for (i = s + 1; i < n; i++) { sv = [((*lcarc)(self, lcarcSel, i, selectedColumn)) stringValue]; if (([sv length] > 0) && ([sv hasPrefix: _charBuffer])) { match = i; break; } } if (i == n) { for (i = 0; i < s; i++) { sv = [((*lcarc)(self, lcarcSel, i, selectedColumn)) stringValue]; if (([sv length] > 0) && ([sv hasPrefix: _charBuffer])) { match = i; break; } } } if (match != -1) { [matrix deselectAllCells]; [self selectRow: match inColumn: selectedColumn]; [matrix scrollCellToVisibleAtRow: match column: 0]; [matrix performClick: self]; return; } } _lastKeyPressed = 0.; } [super keyDown: theEvent]; } /* * NSCoding protocol * * We do not encode most of the instance variables except the Browser columns * because they are internal objects (though not transportable). So we just * encode enoguh information to rebuild identical columns on the decoder * side. Same for the Horizontal Scroller */ - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { long flags = 0; // // NOTE: The browserview under GS uses an NSMatrix subview, the one under // Cocoa does not. This will cause IB to issue an "inconsistency" alert // which is minor and nothing to worry about. // [aCoder encodeObject: _browserCellPrototype forKey: @"NSCellPrototype"]; [aCoder encodeObject: [self _getTitleOfColumn: 0] forKey: @"NSFirstColumnTitle"]; [aCoder encodeObject: _pathSeparator forKey: @"NSPathSeparator"]; flags |= [self hasHorizontalScroller] ? 0x10000 : 0; flags |= ([self allowsEmptySelection] == NO) ? 0x20000 : 0; flags |= [self sendsActionOnArrowKeys] ? 0x40000 : 0; flags |= [self acceptsArrowKeys] ? 0x100000 : 0; flags |= [self separatesColumns] ? 0x4000000 : 0; flags |= [self takesTitleFromPreviousColumn] ? 0x8000000 : 0; flags |= [self isTitled] ? 0x10000000 : 0; flags |= [self reusesColumns] ? 0x20000000 : 0; flags |= [self allowsBranchSelection] ? 0x40000000 : 0; flags |= [self allowsMultipleSelection] ? 0x80000000 : 0; [aCoder encodeInt: flags forKey: @"NSBrFlags"]; [aCoder encodeInt: _maxVisibleColumns forKey: @"NSNumberOfVisibleColumns"]; [aCoder encodeInt: _minColumnWidth forKey: @"NSMinColumnWidth"]; [aCoder encodeInt: _columnResizing forKey: @"NSColumnResizingType"]; //[aCoder encodeInt: prefWidth forKey: @"NSPreferedColumnWidth"]; } else { // Here to keep compatibility with old version [aCoder encodeObject: nil]; [aCoder encodeObject:_browserCellPrototype]; [aCoder encodeObject: NSStringFromClass (_browserMatrixClass)]; [aCoder encodeObject:_pathSeparator]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isLoaded]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_allowsBranchSelection]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_allowsEmptySelection]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_allowsMultipleSelection]; [aCoder encodeValueOfObjCType: @encode(int) at: &_maxVisibleColumns]; [aCoder encodeValueOfObjCType: @encode(CGFloat) at: &_minColumnWidth]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_reusesColumns]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_separatesColumns]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_takesTitleFromPreviousColumn]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isTitled]; [aCoder encodeObject:_horizontalScroller]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_hasHorizontalScroller]; [aCoder encodeRect: _scrollerRect]; [aCoder encodeSize: _columnSize]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_acceptsArrowKeys]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_sendsActionOnArrowKeys]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_acceptsAlphaNumericalKeys]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_sendsActionOnAlphaNumericalKeys]; [aCoder encodeConditionalObject:_browserDelegate]; [aCoder encodeValueOfObjCType: @encode(SEL) at: &_doubleAction]; [aCoder encodeConditionalObject: _target]; [aCoder encodeValueOfObjCType: @encode(SEL) at: &_action]; [aCoder encodeObject: _browserColumns]; // Just encode the number of columns and the first visible // and rebuild the browser columns on the decoding side { int colCount = [_browserColumns count]; [aCoder encodeValueOfObjCType: @encode(int) at: &colCount]; [aCoder encodeValueOfObjCType: @encode(int) at: &_firstVisibleColumn]; } } } - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if ([aDecoder allowsKeyedCoding]) { NSCell *proto = [aDecoder decodeObjectForKey: @"NSCellPrototype"]; NSString *title = [aDecoder decodeObjectForKey: @"NSFirstColumnTitle"]; NSString *sep = [aDecoder decodeObjectForKey: @"NSPathSeparator"]; long flags; NSSize bs; // Class setting _browserCellPrototype = [[[NSBrowser cellClass] alloc] init]; _browserMatrixClass = [NSMatrix class]; // Default values _pathSeparator = @"/"; _allowsBranchSelection = YES; _allowsEmptySelection = YES; _allowsMultipleSelection = YES; _reusesColumns = NO; _separatesColumns = YES; _isTitled = YES; _takesTitleFromPreviousColumn = YES; _hasHorizontalScroller = YES; _isLoaded = NO; _acceptsArrowKeys = YES; _acceptsAlphaNumericalKeys = YES; _lastKeyPressed = 0.; _charBuffer = nil; _sendsActionOnArrowKeys = YES; _sendsActionOnAlphaNumericalKeys = YES; _browserDelegate = nil; _passiveDelegate = YES; _doubleAction = NULL; // FIXME: Seems a bit wrong to look at the current theme here bs = NSZeroSize; if (browserUseBezels) bs = [[GSTheme theme] sizeForBorderType: NSBezelBorder]; _minColumnWidth = scrollerWidth + (2 * bs.width); if (_minColumnWidth < 100.0) _minColumnWidth = 100.0; // Horizontal scroller _scrollerRect.origin.x = bs.width; _scrollerRect.origin.y = bs.height; _scrollerRect.size.width = _frame.size.width - (2 * bs.width); _scrollerRect.size.height = scrollerWidth; _horizontalScroller = [[NSScroller alloc] initWithFrame: _scrollerRect]; [_horizontalScroller setTarget: self]; [_horizontalScroller setAction: @selector(scrollViaScroller:)]; [self addSubview: _horizontalScroller]; _skipUpdateScroller = NO; // Columns _browserColumns = [[NSMutableArray alloc] init]; // Create a single column _lastColumnLoaded = -1; _firstVisibleColumn = 0; _lastVisibleColumn = 0; _maxVisibleColumns = 3; [self _createColumn]; // end // [self setCellPrototype: proto]; [self setPathSeparator: sep]; [self setTitle: title ofColumn: 0]; if ([aDecoder containsValueForKey: @"NSBrFlags"]) { flags = [aDecoder decodeIntForKey: @"NSBrFlags"]; [self setHasHorizontalScroller: ((flags & 0x10000) == 0x10000)]; [self setAllowsEmptySelection: !((flags & 0x20000) == 0x20000)]; [self setSendsActionOnArrowKeys: ((flags & 0x40000) == 0x40000)]; [self setAcceptsArrowKeys: ((flags & 0x100000) == 0x100000)]; [self setSeparatesColumns: ((flags & 0x4000000) == 0x4000000)]; [self setTakesTitleFromPreviousColumn: ((flags & 0x8000000) == 0x8000000)]; [self setTitled: ((flags & 0x10000000) == 0x10000000)]; [self setReusesColumns: ((flags & 0x20000000) == 0x20000000)]; [self setAllowsBranchSelection: ((flags & 0x40000000) == 0x40000000)]; [self setAllowsMultipleSelection: ((flags & 0x80000000) == 0x80000000)]; } if ([aDecoder containsValueForKey: @"NSNumberOfVisibleColumns"]) { [self setMaxVisibleColumns: [aDecoder decodeIntForKey: @"NSNumberOfVisibleColumns"]]; } if ([aDecoder containsValueForKey: @"NSMinColumnWidth"]) { [self setMinColumnWidth: [aDecoder decodeIntForKey: @"NSMinColumnWidth"]]; } if ([aDecoder containsValueForKey: @"NSColumnResizingType"]) { [self setColumnResizingType: [aDecoder decodeIntForKey: @"NSColumnResizingType"]]; } if ([aDecoder containsValueForKey: @"NSPreferedColumnWidth"]) { //int prefWidth = [aDecoder decodeIntForKey: @"NSPreferedColumnWidth"]; } } else { int colCount; // Here to keep compatibility with old version [aDecoder decodeObject]; _browserCellPrototype = RETAIN([aDecoder decodeObject]); _browserMatrixClass = NSClassFromString ((NSString *)[aDecoder decodeObject]); [self setPathSeparator: [aDecoder decodeObject]]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isLoaded]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_allowsBranchSelection]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_allowsEmptySelection]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_allowsMultipleSelection]; [aDecoder decodeValueOfObjCType: @encode(int) at: &_maxVisibleColumns]; [aDecoder decodeValueOfObjCType: @encode(CGFloat) at: &_minColumnWidth]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_reusesColumns]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_separatesColumns]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_takesTitleFromPreviousColumn]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isTitled]; //NSBox *_horizontalScrollerBox; _horizontalScroller = RETAIN([aDecoder decodeObject]); [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_hasHorizontalScroller]; _scrollerRect = [aDecoder decodeRect]; _columnSize = [aDecoder decodeSize]; _skipUpdateScroller = NO; /* _horizontalScroller = [[NSScroller alloc] initWithFrame: _scrollerRect]; [_horizontalScroller setTarget: self]; [_horizontalScroller setAction: @selector(scrollViaScroller:)]; */ [self setHasHorizontalScroller: _hasHorizontalScroller]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_acceptsArrowKeys]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_sendsActionOnArrowKeys]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_acceptsAlphaNumericalKeys]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_sendsActionOnAlphaNumericalKeys]; _lastKeyPressed = 0; _charBuffer = nil; // Skip: int _alphaNumericalLastColumn; _browserDelegate = [aDecoder decodeObject]; if (_browserDelegate != nil) [self setDelegate:_browserDelegate]; else _passiveDelegate = YES; [aDecoder decodeValueOfObjCType: @encode(SEL) at: &_doubleAction]; _target = [aDecoder decodeObject]; [aDecoder decodeValueOfObjCType: @encode(SEL) at: &_action]; // Do the minimal thing to initiate the browser... /* _lastColumnLoaded = -1; _firstVisibleColumn = 0; _lastVisibleColumn = 0; [self _createColumn]; */ _browserColumns = RETAIN([aDecoder decodeObject]); // ..and rebuild any existing browser columns [aDecoder decodeValueOfObjCType: @encode(int) at: &colCount]; [aDecoder decodeValueOfObjCType: @encode(int) at: &_firstVisibleColumn]; } // Display even if there isn't any column _isLoaded = NO; [self tile]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_themeDidActivate:) name: GSThemeDidActivateNotification object: nil]; return self; } /* * Div. */ - (BOOL) isOpaque { // NSBrowser used to be opaque but may not be due to themes; // e.g. if the header tile images are not opaque. return NO; } @end @implementation NSBrowser (GNUstepExtensions) /* * Setting the behavior of arrow keys */ /** Returns YES if the alphanumerical keys are enabled. */ - (BOOL) acceptsAlphaNumericalKeys { return _acceptsAlphaNumericalKeys; } /** Enables or disables the arrow keys as used for navigating within and between browsers. */ - (void) setAcceptsAlphaNumericalKeys: (BOOL)flag { _acceptsAlphaNumericalKeys = flag; } /** Returns NO if pressing an arrow key only scrolls the browser, YES if it also sends the action message specified by setAction:. */ - (BOOL) sendsActionOnAlphaNumericalKeys { return _sendsActionOnAlphaNumericalKeys; } /** Sets whether pressing an arrow key will cause the action message to be sent (in addition to causing scrolling). */ - (void) setSendsActionOnAlphaNumericalKeys: (BOOL)flag { _sendsActionOnAlphaNumericalKeys = flag; } @end /* * * PRIVATE METHODS * */ @implementation NSBrowser (Private) - (void) _remapColumnSubviews: (BOOL)fromFirst { NSBrowserColumn *bc; NSScrollView *sc; NSUInteger i, count; id firstResponder = nil; BOOL setFirstResponder = NO; // Removes all column subviews. count = [_browserColumns count]; for (i = 0; i < count; i++) { bc = [_browserColumns objectAtIndex: i]; sc = [bc columnScrollView]; if (!firstResponder && [bc columnMatrix] == [_window firstResponder]) { firstResponder = [bc columnMatrix]; } if (sc) { [sc removeFromSuperviewWithoutNeedingDisplay]; } } if (_firstVisibleColumn > _lastVisibleColumn) return; // Sets columns subviews order according to fromFirst (display order...). // All added subviews are automaticaly marked as needing display (-> // NSView). if (fromFirst) { for (i = _firstVisibleColumn; i <= _lastVisibleColumn; i++) { bc = [_browserColumns objectAtIndex: i]; sc = [bc columnScrollView]; [self addSubview: sc]; if ([bc columnMatrix] == firstResponder) { [_window makeFirstResponder: firstResponder]; setFirstResponder = YES; } } if (firstResponder && setFirstResponder == NO) { [_window makeFirstResponder: [[_browserColumns objectAtIndex: _firstVisibleColumn] columnMatrix]]; } } else { for (i = _lastVisibleColumn; i >= _firstVisibleColumn; i--) { bc = [_browserColumns objectAtIndex: i]; sc = [bc columnScrollView]; [self addSubview: sc]; if ([bc columnMatrix] == firstResponder) { [_window makeFirstResponder: firstResponder]; setFirstResponder = YES; } } if (firstResponder && setFirstResponder == NO) { [_window makeFirstResponder: [[_browserColumns objectAtIndex: _lastVisibleColumn] columnMatrix]]; } } } /* Loads column 'column' (asking the delegate). */ - (void) _performLoadOfColumn: (NSInteger)column { NSBrowserColumn *bc; NSScrollView *sc; NSMatrix *matrix; NSInteger i, rows, cols; if (_passiveDelegate) { // Ask the delegate for the number of rows rows = [_browserDelegate browser: self numberOfRowsInColumn: column]; cols = 1; } else { rows = 0; cols = 0; } bc = [_browserColumns objectAtIndex: column]; if (!(sc = [bc columnScrollView])) return; matrix = [bc columnMatrix]; if (_reusesColumns && matrix) { [matrix renewRows: rows columns: cols]; // Mark all the cells as unloaded for (i = 0; i < rows; i++) { [[matrix cellAtRow: i column: 0] setLoaded: NO]; } } else { NSRect matrixRect = {{0, 0}, {100, 100}}; NSSize matrixIntercellSpace = {0, 0}; // create a new col matrix matrix = [[_browserMatrixClass alloc] initWithFrame: matrixRect mode: NSListModeMatrix prototype: _browserCellPrototype numberOfRows: rows numberOfColumns: cols]; [matrix setIntercellSpacing: matrixIntercellSpace]; [matrix setAllowsEmptySelection: _allowsEmptySelection]; [matrix setAutoscroll: YES]; // Set up background colors. [matrix setBackgroundColor: [self backgroundColor]]; [matrix setDrawsBackground: YES]; if (!_allowsMultipleSelection) { [matrix setMode: NSRadioModeMatrix]; } [matrix setTarget: self]; [matrix setAction: @selector(doClick:)]; [matrix setDoubleAction: @selector(doDoubleClick:)]; // set new col matrix and release old [bc setColumnMatrix: matrix]; RELEASE (matrix); } [sc setDocumentView: matrix]; // Loading is different based upon passive/active delegate if (_passiveDelegate) { // Now loop through the cells and load each one id aCell; SEL sel1 = @selector(browser:willDisplayCell:atRow:column:); IMP imp1 = [_browserDelegate methodForSelector: sel1]; SEL sel2 = @selector(cellAtRow:column:); IMP imp2 = [matrix methodForSelector: sel2]; for (i = 0; i < rows; i++) { aCell = (*imp2)(matrix, sel2, i, 0); if (![aCell isLoaded]) { (*imp1)(_browserDelegate, sel1, self, aCell, i, column); [aCell setLoaded: YES]; } } } else { // Tell the delegate to create the rows [_browserDelegate browser: self createRowsForColumn: column inMatrix: matrix]; } [bc setIsLoaded: YES]; if (column > _lastColumnLoaded) { _lastColumnLoaded = column; } /* Determine the height of a cell in the matrix, and set that as the cellSize of the matrix. */ { NSSize cs, ms; NSBrowserCell *b = [matrix cellAtRow: 0 column: 0]; if (b != nil) { ms = [b cellSize]; } else { ms = [matrix cellSize]; } cs = [sc contentSize]; ms.width = cs.width; [matrix setCellSize: ms]; } // Get the title even when untitled, as this may change later. [self setTitle: [self _getTitleOfColumn: column] ofColumn: column]; // Mark for redisplay [self displayColumn: column]; } /* Get the title of a column. */ - (NSString *) _getTitleOfColumn: (NSInteger)column { // Ask the delegate for the column title if ([_browserDelegate respondsToSelector: @selector(browser:titleOfColumn:)]) { return [_browserDelegate browser: self titleOfColumn: column]; } // Check if we take title from previous column if (_takesTitleFromPreviousColumn) { id c; // If first column then use the path separator if (column == 0) { return _pathSeparator; } // Get the selected cell // Use its string value as the title // Only if it is not a leaf if (_allowsMultipleSelection == NO) { c = [self selectedCellInColumn: column - 1]; } else { NSMatrix *matrix; NSArray *selectedCells; if (!(matrix = [self matrixInColumn: column - 1])) return @""; selectedCells = [matrix selectedCells]; if ([selectedCells count] == 1) { c = [selectedCells objectAtIndex:0]; } else { return @""; } } if ([c isLeaf]) { return @""; } else { NSString *value = [c stringValue]; if (value != nil) { return value; } else { return @""; } } } return @""; } /* Marks all titles as needing to be redrawn. */ - (void) _setColumnTitlesNeedDisplay { if (_isTitled) { NSRect r = [self titleFrameOfColumn: _firstVisibleColumn]; r.size.width = _frame.size.width; [self setNeedsDisplayInRect: r]; } } - (void) setNeedsDisplayInRect: (NSRect)invalidRect { [super setNeedsDisplayInRect: invalidRect]; } - (NSBorderType) _resolvedBorderType { if (browserUseBezels && _separatesColumns) { return NSBezelBorder; } return NSNoBorder; } - (void) _themeDidActivate: (NSNotification*)notification { [self tile]; } @end gnustep-gui-0.24.0/Source/NSDrawer.m0000664000076500007650000005650212101306763017054 0ustar brains99brains99/** NSDrawer The drawer class Copyright (C) 2001 Free Software Foundation, Inc. Author: Douglas Simons Date: 2009 Author: Gregory Casamento Date: 2006 Author: Fred Kiefer Date: 2001 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import #import "AppKit/NSWindow.h" #import "AppKit/NSBox.h" #import "AppKit/NSView.h" #import "AppKit/NSDrawer.h" #import "AppKit/NSGraphics.h" static NSNotificationCenter *nc = nil; @interface GSDrawerWindow : NSWindow { NSWindow *_parentWindow; NSWindow *_pendingParentWindow; NSDrawer *_drawer; id _container; NSBox *_borderBox; NSSize _borderSize; NSTimer *_timer; NSRect _latestParentFrame; BOOL _wasOpen; } - (NSRect) frameFromParentWindowFrameInState:(NSInteger)state; // open/close - (void) openOnEdge; - (void) closeOnEdge; - (void) slideOpen:(BOOL)opening; - (void) startTimer; - (void) stopTimer; // window/drawer properties - (void) setParentWindow: (NSWindow *)window; - (NSWindow *) parentWindow; - (void) setPendingParentWindow: (NSWindow *)window; - (NSWindow *) pendingParentWindow; - (void) setDrawer: (NSDrawer *)drawer; - (NSDrawer *) drawer; // handle notifications... - (void) handleWindowDidBecomeKey: (NSNotification *)notification; - (void) handleWindowClose: (NSNotification *)notification; - (void) handleWindowMiniaturize: (NSNotification *)notification; - (void) handleWindowDeminiaturize: (NSNotification *)notification; - (void) handleWindowMove: (NSNotification *)notification; @end @implementation GSDrawerWindow + (void) initialize { if (self == [GSDrawerWindow class]) { nc = [NSNotificationCenter defaultCenter]; [self setVersion: 0]; } } - (id) initWithContentRect: (NSRect)contentRect styleMask: (NSUInteger)aStyle backing: (NSBackingStoreType)bufferingType defer: (BOOL)flag { if(NSIsEmptyRect(contentRect)) { contentRect = NSMakeRect(0,0,100,100); } self = [super initWithContentRect: contentRect styleMask: aStyle backing: bufferingType defer: flag]; if (self != nil) { NSRect rect = contentRect; NSRect border = contentRect; NSSize containerContentSize; rect.origin.x += 6; rect.origin.y += 6; rect.size.width -= 16; rect.size.height -= 16; border.origin.x += 1; border.origin.y += 1; border.size.width -= 2; border.size.height -= 2; _borderBox = [[NSBox alloc] initWithFrame: border]; [_borderBox setTitle: @""]; [_borderBox setTitlePosition: NSNoTitle]; [_borderBox setBorderType: NSLineBorder]; [_borderBox setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [_borderBox setContentViewMargins: NSMakeSize(0,0)]; [[super contentView] addSubview: _borderBox]; _container = [[NSBox alloc] initWithFrame: rect]; [_container setTitle: @""]; [_container setTitlePosition: NSNoTitle]; [_container setBorderType: NSBezelBorder]; [_container setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [_container setContentViewMargins: NSMakeSize(2,2)]; [_borderBox addSubview: _container]; // determine the difference between the container's content size and the window content size containerContentSize = [[_container contentView] frame].size; _borderSize = NSMakeSize(contentRect.size.width - containerContentSize.width, contentRect.size.height - containerContentSize.height); } return self; } - (id) container { return _container; } - (NSRect) frameFromParentWindowFrameInState:(NSInteger)state { NSRect newFrame = [_parentWindow frame]; CGFloat totalOffset = [_drawer leadingOffset] + [_drawer trailingOffset]; NSRectEdge edge = [_drawer preferredEdge]; BOOL opened = (state == NSDrawerOpenState || state == NSDrawerOpeningState); NSSize size = [_parentWindow frame].size; // [_drawer maxContentSize]; NSRect windowContentRect = [[_parentWindow contentView] frame]; CGFloat windowHeightWithoutTitleBar = windowContentRect.origin.y + windowContentRect.size.height; // FIXME: This should probably add the toolbar height too, if the window has a toolbar if (edge == NSMinXEdge) // left { if (opened) newFrame.size.width = [_drawer minContentSize].width + _borderSize.width; else newFrame.size.width = 16; newFrame.size.height = windowHeightWithoutTitleBar - totalOffset; newFrame.origin.y += [_drawer trailingOffset]; if (opened) newFrame.origin.x -= newFrame.size.width; } else if (edge == NSMinYEdge) // bottom { if (opened) newFrame.size.height = [_drawer minContentSize].height + _borderSize.height; else newFrame.size.height = 16; newFrame.size.width -= totalOffset; newFrame.origin.x += [_drawer leadingOffset]; if (opened) newFrame.origin.y -= newFrame.size.height; } else if (edge == NSMaxXEdge) // right { if (opened) newFrame.size.width = [_drawer minContentSize].width + _borderSize.width; else newFrame.size.width = 16; newFrame.size.height = windowHeightWithoutTitleBar - totalOffset; newFrame.origin.y += [_drawer trailingOffset]; newFrame.origin.x += size.width; if (!opened) newFrame.origin.x -= newFrame.size.width; } else if (edge == NSMaxYEdge) // top { if (opened) newFrame.size.height = [_drawer minContentSize].height + _borderSize.height; else newFrame.size.height = 16; newFrame.size.width -= totalOffset; newFrame.origin.x += [_drawer leadingOffset]; newFrame.origin.y += size.height; // put above the window if (!opened) newFrame.origin.y -= newFrame.size.height; } return newFrame; } - (BOOL) canBecomeKeyWindow { return YES; } - (BOOL) canBecomeMainWindow { return NO; } - (void) becomeKeyWindow { [_parentWindow orderFrontRegardless]; // so clicking on the drawer will bring the parent to the front [super becomeKeyWindow]; } /* - (void) orderFront: (id)sender { NSPoint holdOrigin = [self frame].origin; NSPoint newOrigin = NSMakePoint(-10000,-10000); NSRect tempFrame = [self frame]; // order the window under the parent... tempFrame.origin = newOrigin; [self setFrame: tempFrame display: NO]; [super orderFront: sender]; // [_parentWindow orderWindow: NSWindowAbove relativeTo: [self windowNumber]]; tempFrame.origin = holdOrigin; // [self setFrame: tempFrame display: YES]; } */ /* - (void) orderFront: (id)sender { [super orderWindow:NSWindowBelow relativeTo:[_parentWindow windowNumber]]; } */ - (void) startTimer { NSTimeInterval time = 0.1; _timer = [NSTimer scheduledTimerWithTimeInterval: time target: self selector: @selector(_timedWindowReset) userInfo: nil repeats: YES]; } - (void) stopTimer { [_timer invalidate]; _timer = nil; } - (void) orderFrontRegardless { [self orderFront: self]; } - (void) orderOut: (id)sender { [super orderOut: sender]; } /* - (void) orderWindow: (NSWindowOrderingMode)place relativeTo: (int)windowNum { NSLog(@"Ordering window...."); [super orderWindow: place relativeTo: windowNum]; } */ - (void) lockBorderBoxForSliding { // set the _borderBox to not resize during the slide, and attach it to the appropriate edge instead NSRectEdge edge = [_drawer preferredEdge]; NSUInteger resizeMask = 0; if (edge == NSMinXEdge) // left { resizeMask = NSViewMaxXMargin; } else if (edge == NSMinYEdge) // bottom { resizeMask = NSViewMaxYMargin; } else if (edge == NSMaxXEdge) // right { resizeMask = NSViewMinXMargin; } else if (edge == NSMaxYEdge) // top { resizeMask = NSViewMinYMargin; } [_borderBox setAutoresizingMask: resizeMask]; // don't resize -- just give appearance of sliding } - (void) unlockBorderBoxAfterSliding { // set the _borderBox to resize again [_borderBox setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; } - (void) openOnEdge { // prepare drawer contents before sliding... NSRect frame = [self frameFromParentWindowFrameInState:NSDrawerOpenState]; [self setFrame:frame display: YES]; // make sure it's the full (open) size before locking the borderBox if ([_parentWindow isVisible]) // don't order front until parent window is visible { [self lockBorderBoxForSliding]; [self orderFront: self]; [self slideOpen:YES]; [self performSelector:@selector(unlockBorderBoxAfterSliding) withObject:nil afterDelay:0.01]; } [self startTimer]; } - (void) closeOnEdge { NSRect frame; [self stopTimer]; [self lockBorderBoxForSliding]; [self slideOpen:NO]; [self orderOut: self]; frame = [self frameFromParentWindowFrameInState:NSDrawerOpenState]; [self setFrame:frame display: YES]; // make sure it's the full (open) size again (offscreen) before unlocking [self performSelector:@selector(unlockBorderBoxAfterSliding) withObject:nil afterDelay:0.01]; if (_pendingParentWindow != nil && _pendingParentWindow != _parentWindow) { [self setParentWindow: _pendingParentWindow]; ASSIGN(_pendingParentWindow, nil); } } - (void) slideOpen:(BOOL)opening { NSRect frame = [self frameFromParentWindowFrameInState:(opening?NSDrawerClosedState:NSDrawerOpenState)]; NSRect newFrame = [self frameFromParentWindowFrameInState:(opening?NSDrawerOpenState:NSDrawerClosedState)]; NSTimeInterval slideDelay = 0.03; NSDate *nextStop = [NSDate dateWithTimeIntervalSinceNow:slideDelay]; int count = 10; CGFloat deltaX = (newFrame.origin.x - frame.origin.x) / count; CGFloat deltaY = (newFrame.origin.y - frame.origin.y) / count; CGFloat deltaW = (newFrame.size.width - frame.size.width) / count; CGFloat deltaH = (newFrame.size.height - frame.size.height) / count; while (count--) { frame.origin.x += deltaX; frame.origin.y += deltaY; frame.size.width += deltaW; frame.size.height += deltaH; [self setFrame: frame display: YES]; [NSThread sleepUntilDate:nextStop]; nextStop = [nextStop addTimeInterval:slideDelay]; } [self setFrame:newFrame display: YES]; } - (void) _resetWindowPosition { if ([_parentWindow isVisible]) // don't set our frame until parent window is visible { NSRect frame = [self frameFromParentWindowFrameInState:[_drawer state]]; [self setFrame: frame display: YES]; if (![self isVisible] && [_drawer state] != NSDrawerClosedState) [self orderFront:self]; } if ([self isVisible] && [_parentWindow isKeyWindow]) // do our best to maintain proper window ordering { [super orderFrontRegardless]; [_parentWindow orderFront:self]; } } - (void) _timedWindowReset { NSRect frame = [_parentWindow frame]; if (!NSEqualRects(frame, _latestParentFrame)) { [self _resetWindowPosition]; _latestParentFrame = frame; } } - (void) handleWindowClose: (NSNotification *)notification { [self stopTimer]; [self close]; } - (void) handleWindowMiniaturize: (NSNotification *)notification { _wasOpen = ([_drawer state] == NSDrawerOpenState); if (_wasOpen) { // It would be nice to call [self closeOnEdge] here, but the parent window is already closing // (with animation) so it doesn't look right to slide the drawer. So we'll do this instead: [self stopTimer]; [self close]; } } - (void) handleWindowDeminiaturize: (NSNotification *)notification { if (_wasOpen) { //[self openOnEdge]; -- this also doesn't work: see comment above _latestParentFrame = NSMakeRect(0,0,0,0); [self startTimer]; } } - (void) handleWindowMove: (NSNotification *)notification { [self _resetWindowPosition]; } - (void) handleWindowDidBecomeKey: (NSNotification *)notification { if([_drawer state] == NSDrawerOpenState) { [self _resetWindowPosition]; } } - (void) setParentWindow: (NSWindow *)window { if (_parentWindow != window) { [super setParentWindow: window]; ASSIGN(_parentWindow, window); [nc removeObserver: self]; if (_parentWindow != nil) { [self _resetWindowPosition]; // add observers.... [nc addObserver: self selector: @selector(handleWindowClose:) name: NSWindowWillCloseNotification object: _parentWindow]; [nc addObserver: self selector: @selector(handleWindowMiniaturize:) name: NSWindowWillMiniaturizeNotification object: _parentWindow]; [nc addObserver: self selector: @selector(handleWindowDeminiaturize:) name: NSWindowDidDeminiaturizeNotification object: _parentWindow]; [nc addObserver: self selector: @selector(handleWindowMove:) name: NSWindowWillMoveNotification object: _parentWindow]; [nc addObserver: self selector: @selector(handleWindowMove:) name: NSWindowDidResizeNotification object: _parentWindow]; [nc addObserver: self selector: @selector(handleWindowDidBecomeKey:) name: NSWindowDidBecomeKeyNotification object: _parentWindow]; } } } - (NSWindow *) parentWindow { return _parentWindow; } - (void) setPendingParentWindow: (NSWindow *)window { ASSIGN(_pendingParentWindow, window); } - (NSWindow *) pendingParentWindow { return _pendingParentWindow; } - (void) setDrawer: (NSDrawer *)drawer { // don't retain, since the drawer retains us... _drawer = drawer; } - (NSDrawer *) drawer { return _drawer; } - (void) dealloc { [self stopTimer]; RELEASE(_parentWindow); RELEASE(_borderBox); TEST_RELEASE(_pendingParentWindow); [super dealloc]; } @end @implementation NSDrawer + (void) initialize { if (self == [NSDrawer class]) { nc = [NSNotificationCenter defaultCenter]; [self setVersion: 0]; } } // Creation - (id) init { return [self initWithContentSize: NSMakeSize(100,100) preferredEdge: NSMinXEdge]; } - (id) initWithContentSize: (NSSize)contentSize preferredEdge: (NSRectEdge)edge { self = [super init]; // initialize the drawer window... _drawerWindow = [[GSDrawerWindow alloc] initWithContentRect: NSMakeRect(0, 0, contentSize.width, contentSize.height) styleMask: 0 backing: NSBackingStoreBuffered defer: NO]; [_drawerWindow setDrawer: self]; [_drawerWindow setReleasedWhenClosed: NO]; _preferredEdge = edge; _currentEdge = edge; _maxContentSize = NSMakeSize(200,200); _minContentSize = contentSize; //NSMakeSize(50,50); if (edge == NSMinXEdge || edge == NSMaxXEdge) { _leadingOffset = 0.0; // for side drawers, top of drawer is immediately below the title bar _trailingOffset = 10.0; } else { _leadingOffset = 10.0; _trailingOffset = 10.0; } _state = NSDrawerClosedState; return self; } - (void) dealloc { RELEASE(_drawerWindow); if (_delegate != nil) { [nc removeObserver: _delegate name: nil object: self]; _delegate = nil; } [super dealloc]; } // Opening and Closing - (void) close { if (_state != NSDrawerOpenState) return; if ((_delegate != nil) && ([_delegate respondsToSelector: @selector(drawerShouldClose:)]) && ![_delegate drawerShouldClose: self]) return; _state = NSDrawerClosingState; [nc postNotificationName: NSDrawerWillCloseNotification object: self]; [_drawerWindow closeOnEdge]; _state = NSDrawerClosedState; [nc postNotificationName: NSDrawerDidCloseNotification object: self]; } - (void) close: (id)sender { [self close]; } - (void) open { [self openOnEdge: _preferredEdge]; } - (void) open: (id)sender { [self open]; } - (void) openOnEdge: (NSRectEdge)edge { if ((_state != NSDrawerClosedState) || ([self parentWindow] == nil)) return; if ((_delegate != nil) && ([_delegate respondsToSelector: @selector(drawerShouldOpen:)]) && ![_delegate drawerShouldOpen: self]) return; _state = NSDrawerOpeningState; [nc postNotificationName: NSDrawerWillOpenNotification object: self]; _currentEdge = edge; [_drawerWindow openOnEdge]; _state = NSDrawerOpenState; [nc postNotificationName: NSDrawerDidOpenNotification object: self]; } - (void) toggle: (id)sender { if (_state == NSDrawerClosedState) [self open: sender]; else if (_state == NSDrawerOpenState) [self close: sender]; // Do nothing for inbetween states } // Managing Size - (NSSize) contentSize { return [[_drawerWindow contentView] frame].size; } - (CGFloat) leadingOffset { return _leadingOffset; } - (NSSize) maxContentSize { return _maxContentSize; } - (NSSize) minContentSize { return _minContentSize; } - (void) setContentSize: (NSSize)size { // Check with min and max size if (size.width < _minContentSize.width) size.width = _minContentSize.width; if (size.height < _minContentSize.height) size.height = _minContentSize.height; if (size.width > _maxContentSize.width) size.width = _maxContentSize.width; if (size.height > _maxContentSize.height) size.height = _maxContentSize.height; // Check with delegate if ((_delegate != nil) && ([_delegate respondsToSelector: @selector(drawerWillResizeContents:toSize:)])) { size = [_delegate drawerWillResizeContents: self toSize: size]; } [_drawerWindow setContentSize: size]; } - (void) setLeadingOffset: (CGFloat)offset { _leadingOffset = offset; } - (void) setMaxContentSize: (NSSize)size { _maxContentSize = size; } - (void) setMinContentSize: (NSSize)size { _minContentSize = size; } - (void) setTrailingOffset: (CGFloat)offset { _trailingOffset = offset; } - (CGFloat) trailingOffset { return _trailingOffset; } // Managing Edge - (NSRectEdge) edge { return _currentEdge; } - (NSRectEdge) preferredEdge { return _preferredEdge; } - (void) setPreferredEdge: (NSRectEdge)preferredEdge { _preferredEdge = preferredEdge; } // Managing Views - (NSView *) contentView { return [[_drawerWindow container] contentView]; } - (NSWindow *) parentWindow { return [_drawerWindow parentWindow]; } - (void) setContentView: (NSView *)aView { [[_drawerWindow container] setContentView: aView]; } - (void) setParentWindow: (NSWindow *)parent { if (_state == NSDrawerClosedState) { [_drawerWindow setParentWindow: parent]; } else { [_drawerWindow setPendingParentWindow: parent]; } } // Delegation and State - (id) delegate { return _delegate; } - (void) setDelegate: (id)anObject { if (_delegate) { [nc removeObserver: _delegate name: nil object: self]; } _delegate = anObject; #define SET_DELEGATE_NOTIFICATION(notif_name) \ if ([_delegate respondsToSelector: @selector(drawer##notif_name:)]) \ [nc addObserver: _delegate \ selector: @selector(drawer##notif_name:) \ name: NSDrawer##notif_name##Notification object: self] SET_DELEGATE_NOTIFICATION(DidClose); SET_DELEGATE_NOTIFICATION(DidOpen); SET_DELEGATE_NOTIFICATION(WillClose); SET_DELEGATE_NOTIFICATION(WillOpen); } - (NSInteger) state { return _state; } /* * NSCoding protocol */ - (void) encodeWithCoder: (NSCoder*)aCoder { id parent = [self parentWindow]; [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { [aCoder encodeSize: [self contentSize] forKey: @"NSContentSize"]; if (_delegate != nil) { [aCoder encodeObject: _delegate forKey: @"NSDelegate"]; } [aCoder encodeFloat: _leadingOffset forKey: @"NSLeadingOffset"]; [aCoder encodeSize: _maxContentSize forKey: @"NSMaxContentSize"]; [aCoder encodeSize: _minContentSize forKey: @"NSMinContentSize"]; if (parent != nil) { [aCoder encodeObject: parent forKey: @"NSParentWindow"]; } [aCoder encodeInt: _preferredEdge forKey: @"NSPreferredEdge"]; [aCoder encodeFloat: _trailingOffset forKey: @"NSTrailingOffset"]; } else { [aCoder encodeSize: [self contentSize]]; [aCoder encodeObject: _delegate]; [aCoder encodeValueOfObjCType: @encode(float) at: &_leadingOffset]; [aCoder encodeSize: _maxContentSize]; [aCoder encodeSize: _minContentSize]; [aCoder encodeObject: parent]; [aCoder encodeValueOfObjCType: @encode(unsigned) at: &_preferredEdge]; [aCoder encodeValueOfObjCType: @encode(float) at: &_trailingOffset]; } } - (id) initWithCoder: (NSCoder*)aDecoder { if ((self = [super initWithCoder: aDecoder]) != nil) { NSWindow *parentWindow = nil; if ([aDecoder allowsKeyedCoding]) { _contentSize = [aDecoder decodeSizeForKey: @"NSContentSize"]; if ([aDecoder containsValueForKey: @"NSDelegate"]) { ASSIGN(_delegate, [aDecoder decodeObjectForKey: @"NSDelegate"]); } _leadingOffset = [aDecoder decodeFloatForKey: @"NSLeadingOffset"]; _maxContentSize = [aDecoder decodeSizeForKey: @"NSMaxContentSize"]; _minContentSize = [aDecoder decodeSizeForKey: @"NSMinContentSize"]; if ([aDecoder containsValueForKey: @"NSParentWindow"]) { parentWindow = [aDecoder decodeObjectForKey: @"NSParentWindow"]; } _preferredEdge = [aDecoder decodeIntForKey: @"NSPreferredEdge"]; _trailingOffset = [aDecoder decodeFloatForKey: @"NSTrailingOffset"]; } else { int version = [aDecoder versionForClassName: @"NSDrawer"]; if (version == 0) { _contentSize = [aDecoder decodeSize]; ASSIGN(_delegate, [aDecoder decodeObject]); [aDecoder decodeValueOfObjCType: @encode(float) at: &_leadingOffset]; _maxContentSize = [aDecoder decodeSize]; _minContentSize = [aDecoder decodeSize]; parentWindow = [aDecoder decodeObject]; [aDecoder decodeValueOfObjCType: @encode(unsigned) at: &_preferredEdge]; [aDecoder decodeValueOfObjCType: @encode(float) at: &_trailingOffset]; } else { [NSException raise: NSInternalInconsistencyException format: @"Invalid version of NSDrawer (version = %d).", version]; return nil; // not reached, but keeps gcc happy... } } // set up drawer... _drawerWindow = [[GSDrawerWindow alloc] initWithContentRect: NSMakeRect(0, 0,_contentSize.width, _contentSize.height) styleMask: 0 backing: NSBackingStoreBuffered defer: NO]; [_drawerWindow setParentWindow: parentWindow]; [_drawerWindow setDrawer: self]; [_drawerWindow setReleasedWhenClosed: NO]; // initial state... _state = NSDrawerClosedState; } return self; } @end gnustep-gui-0.24.0/Source/NSGradient.m0000664000076500007650000002447412244460263017374 0ustar brains99brains99/* NSGradient.m GUI implementation of a colour gradient. Copyright (C) 2009 Free Software Foundation, Inc. Author: Fred Kiefer Date: Oct 2009 Author: H. Nikolaus Schaller Date: Dec 2007 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import "AppKit/NSBezierPath.h" #import "AppKit/NSColor.h" #import "AppKit/NSColorSpace.h" #import "AppKit/NSGradient.h" #import "AppKit/NSGraphicsContext.h" #include #ifndef PI #define PI 3.1415926535897932384626434 #endif @interface NSGradient (Private) - (void) _drawInRect: (NSRect)rect angle: (CGFloat)angle; - (void) _drawInRect: (NSRect)rect relativeCenterPosition: (NSPoint)relativeCenterPoint; @end @implementation NSGradient - (NSColorSpace *) colorSpace; { return _colorSpace; } - (void) drawFromCenter: (NSPoint)startCenter radius: (CGFloat)startRadius toCenter: (NSPoint)endCenter radius: (CGFloat)endRadius options: (NSGradientDrawingOptions)options { [[NSGraphicsContext currentContext] drawGradient: self fromCenter: startCenter radius: startRadius toCenter: endCenter radius: endRadius options: options]; } - (void) drawFromPoint: (NSPoint)startPoint toPoint: (NSPoint)endPoint options: (NSGradientDrawingOptions)options { [[NSGraphicsContext currentContext] drawGradient: self fromPoint: startPoint toPoint: endPoint options: options]; } - (void) drawInBezierPath: (NSBezierPath *)path angle: (CGFloat)angle { NSGraphicsContext *currentContext = [NSGraphicsContext currentContext]; [currentContext saveGraphicsState]; [path addClip]; [self _drawInRect: [path bounds] angle: angle]; [currentContext restoreGraphicsState]; } - (void) drawInBezierPath: (NSBezierPath *)path relativeCenterPosition: (NSPoint)relativeCenterPoint { NSGraphicsContext *currentContext = [NSGraphicsContext currentContext]; [currentContext saveGraphicsState]; [path addClip]; [self _drawInRect: [path bounds] relativeCenterPosition: relativeCenterPoint]; [currentContext restoreGraphicsState]; } - (void) drawInRect: (NSRect)rect angle: (CGFloat)angle { NSGraphicsContext *currentContext = [NSGraphicsContext currentContext]; [currentContext saveGraphicsState]; [NSBezierPath clipRect: rect]; [self _drawInRect: rect angle: angle]; [currentContext restoreGraphicsState]; } - (void) drawInRect: (NSRect)rect relativeCenterPosition: (NSPoint)relativeCenterPoint { NSGraphicsContext *currentContext = [NSGraphicsContext currentContext]; [currentContext saveGraphicsState]; [NSBezierPath clipRect: rect]; [self _drawInRect: rect relativeCenterPosition: relativeCenterPoint]; [currentContext restoreGraphicsState]; } - (void) getColor: (NSColor **)color location: (CGFloat *)location atIndex: (NSInteger)index { NSAssert(index >= 0 && index < _numberOfColorStops, @"NSGradient invalid index"); if (color) *color = [_colors objectAtIndex: index]; if (location) *location = _locations[index]; } - (id) initWithColors: (NSArray *)colorArray; { return [self initWithColors: colorArray atLocations: NULL colorSpace: nil]; } - (id) initWithColors: (NSArray *)colorArray atLocations: (const CGFloat *)locations colorSpace: (NSColorSpace *)colorSpace; { if ((self = [super init])) { _numberOfColorStops = [colorArray count]; NSAssert(_numberOfColorStops >= 2, @"NSGradient needs at least 2 locations"); if (colorSpace == nil) { colorSpace = [[colorArray objectAtIndex: 0] colorSpace]; } ASSIGN(_colorSpace, colorSpace); // FIXME: Convert all colours to colour space ASSIGN(_colors, colorArray); _locations = malloc(sizeof(CGFloat)*_numberOfColorStops); if (locations) { // FIXME: Check that the locations are properly ordered memcpy(_locations, locations, sizeof(CGFloat) * _numberOfColorStops); } else { unsigned int i; // evenly spaced for (i = 0; i < _numberOfColorStops; i++) _locations[i] = (float)i / (_numberOfColorStops - 1); } } return self; } - (id) initWithColorsAndLocations: (NSColor *)color, ... { va_list ap; unsigned int max = 128; unsigned int count = 0; CGFloat *locations = (CGFloat*)malloc(max * sizeof(CGFloat)); NSMutableArray *colorArray = [[NSMutableArray alloc] init]; va_start(ap, color); while (color != nil) { if (max <= count) { max *= 2; locations = (CGFloat*)realloc(locations, max * sizeof(CGFloat)); } [colorArray addObject: color]; // gcc insists on using double here locations[count++] = (CGFloat)va_arg(ap, double); color = va_arg(ap, id); } va_end(ap); self = [self initWithColors: colorArray atLocations: locations colorSpace: nil]; RELEASE(colorArray); free(locations); return self; } - (id) initWithStartingColor: (NSColor *)startColor endingColor: (NSColor *)endColor { return [self initWithColors: [NSArray arrayWithObjects: startColor, endColor, nil]]; } - (void) dealloc { RELEASE(_colorSpace); RELEASE(_colors); free(_locations); [super dealloc]; } - (NSColor *) interpolatedColorAtLocation: (CGFloat)location { unsigned int i; if (location <= _locations[0]) { return [_colors objectAtIndex: 0]; } if (location >= _locations[_numberOfColorStops - 1]) { return [_colors objectAtIndex: _numberOfColorStops - 1]; } for (i = 1; i < _numberOfColorStops; i++) { if (location <= _locations[i]) { NSColor *c1 = [_colors objectAtIndex: i - 1]; NSColor *c2 = [_colors objectAtIndex: i]; float fraction = (_locations[i] - location) / (_locations[i] - _locations[i - 1]); // FIXME: Works only for RGB colours and does not respect the colour space return [c1 blendedColorWithFraction: fraction ofColor: c2]; } } return nil; } - (NSInteger) numberOfColorStops { return _numberOfColorStops; } /* * Copying */ - (id) copyWithZone: (NSZone*)zone { NSGradient *g = (NSGradient*)NSCopyObject(self, 0, zone); RETAIN(g->_colorSpace); RETAIN(g->_colors); g->_locations = malloc(sizeof(CGFloat) * _numberOfColorStops); memcpy(g->_locations, _locations, sizeof(CGFloat) * _numberOfColorStops); return g; } /* * NSCoding protocol */ - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { } else { } } - (id) initWithCoder: (NSCoder*)aDecoder { if ([aDecoder allowsKeyedCoding]) { } else { } return self; } @end @implementation NSGradient (Private) - (void) _drawInRect: (NSRect)rect angle: (CGFloat)angle { NSPoint startPoint; NSPoint endPoint; float rad; float length; // Normalize to 0.0 <= angle <= 360.0 while (angle < 0.0) { angle += 360.0; } while (angle > 360.0) { angle -= 360.0; } if (angle < 90.0) { startPoint = NSMakePoint(NSMinX(rect), NSMinY(rect)); } else if (angle < 180.0) { startPoint = NSMakePoint(NSMaxX(rect), NSMinY(rect)); } else if (angle < 270.0) { startPoint = NSMakePoint(NSMaxX(rect), NSMaxY(rect)); } else { startPoint = NSMakePoint(NSMinX(rect), NSMaxY(rect)); } rad = PI * angle / 180; length = abs(NSWidth(rect) * cos(rad) + NSHeight(rect) * sin(rad)); endPoint = NSMakePoint(startPoint.x + length * cos(rad), startPoint.y + length * sin(rad)); [self drawFromPoint: startPoint toPoint: endPoint options: 0]; } static inline float sqr(float a) { return a * a; } static inline float euclidian_distance(NSPoint start, NSPoint end) { return sqrt(sqr(end.x - start.x) + sqr(end.y - start.y)); } - (void) _drawInRect: (NSRect)rect relativeCenterPosition: (NSPoint)relativeCenterPoint { NSPoint startCenter; NSPoint endCenter; CGFloat endRadius; CGFloat distance; NSAssert(relativeCenterPoint.x >= 0.0 && relativeCenterPoint.x <= 1.0, @"NSGradient invalid relative center point"); NSAssert(relativeCenterPoint.y >= 0.0 && relativeCenterPoint.y <= 1.0, @"NSGradient invalid relative center point"); startCenter = NSMakePoint(NSMidX(rect), NSMidY(rect)); endCenter = NSMakePoint(startCenter.x + rect.size.width * relativeCenterPoint.x, startCenter.y + rect.size.height * relativeCenterPoint.y); endRadius = 0.0; distance = euclidian_distance(endCenter, NSMakePoint(NSMinX(rect), NSMinY(rect))); if (endRadius < distance) endRadius = distance; distance = euclidian_distance(endCenter, NSMakePoint(NSMaxX(rect), NSMinY(rect))); if (endRadius < distance) endRadius = distance; distance = euclidian_distance(endCenter, NSMakePoint(NSMinX(rect), NSMaxY(rect))); if (endRadius < distance) endRadius = distance; distance = euclidian_distance(endCenter, NSMakePoint(NSMaxX(rect), NSMaxY(rect))); if (endRadius < distance) endRadius = distance; [self drawFromCenter: startCenter radius: 0.0 toCenter: endCenter radius: endRadius options: 0]; } @end gnustep-gui-0.24.0/Source/NSDocument.m0000664000076500007650000014747412050127713017416 0ustar brains99brains99/** NSDocument The abstract document class Copyright (C) 1999 Free Software Foundation, Inc. Author: Carl Lindberg Date: 1999 Modifications: Fred Kiefer Date: June 2000, Dec 2006 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import #import "AppKit/NSBox.h" #import "AppKit/NSDocument.h" #import "AppKit/NSFileWrapper.h" #import "AppKit/NSSavePanel.h" #import "AppKit/NSPageLayout.h" #import "AppKit/NSPopUpButton.h" #import "AppKit/NSPrintInfo.h" #import "AppKit/NSPrintOperation.h" #import "AppKit/NSView.h" #import "NSDocumentFrameworkPrivate.h" #import "GSGuiPrivate.h" @implementation NSDocument + (NSArray *) readableTypes { // FIXME: Should allow for filterable types return [[NSDocumentController sharedDocumentController] _readableTypesForClass: self]; } + (NSArray *) writableTypes { // FIXME: Should allow for filterable types return [[NSDocumentController sharedDocumentController] _writableTypesForClass: self]; } + (BOOL) isNativeType: (NSString *)type { return ([[self readableTypes] containsObject: type] && [[self writableTypes] containsObject: type]); } /* * Private helper macro to check, if the method given via the selector sel * has been overridden in the current subclass. */ #define OVERRIDDEN(sel) ([self methodForSelector: @selector(sel)] != [[NSDocument class] instanceMethodForSelector: @selector(sel)]) - (id) init { static int untitledCount = 1; NSArray *fileTypes; self = [super init]; if (self != nil) { _document_index = untitledCount++; _window_controllers = [[NSMutableArray alloc] init]; fileTypes = [[self class] readableTypes]; _doc_flags.has_undo_manager = YES; /* Set our default type */ if ([fileTypes count]) { [self setFileType: [fileTypes objectAtIndex: 0]]; ASSIGN(_save_type, [fileTypes objectAtIndex: 0]); } } return self; } /** * Initialises the receiver with the contents of the document at fileName * assuming that the type of data is as specified by fileType.
* Destroys the receiver and returns nil on failure. */ - (id) initWithContentsOfFile: (NSString*)fileName ofType: (NSString*)fileType { self = [self init]; if (self != nil) { // Setting these values first is contrary to the documentation, // but mathces the reported behaviour on Cocoa. [self setFileType: fileType]; [self setFileName: fileName]; if (![self readFromFile: fileName ofType: fileType]) { NSRunAlertPanel (_(@"Load failed"), _(@"Could not load file %@."), nil, nil, nil, fileName); DESTROY(self); } } return self; } /** * Initialises the receiver with the contents of the document at url * assuming that the type of data is as specified by fileType.
* Destroys the receiver and returns nil on failure. */ - (id) initWithContentsOfURL: (NSURL*)url ofType: (NSString*)fileType { self = [self init]; if (self != nil) { [self setFileType: fileType]; [self setFileName: [url path]]; if (![self readFromURL: url ofType: fileType]) { NSRunAlertPanel(_(@"Load failed"), _(@"Could not load URL %@."), nil, nil, nil, [url absoluteString]); DESTROY(self); } } return self; } - (id) initForURL: (NSURL *)forUrl withContentsOfURL: (NSURL *)url ofType: (NSString *)type error: (NSError **)error { self = [self initWithType: type error: error]; if (self != nil) { [self setFileType: type]; if (forUrl) [self setFileURL: forUrl]; if ([self readFromURL: url ofType: type error: error]) { if (![url isEqual: forUrl]) { [self setAutosavedContentsFileURL: url]; [self updateChangeCount: NSChangeReadOtherContents]; } } else { DESTROY(self); } } return self; } - (id) initWithContentsOfURL: (NSURL *)url ofType: (NSString *)type error: (NSError **)error { if (OVERRIDDEN(initWithContentsOfFile:ofType:) && [url isFileURL]) { self = [self initWithContentsOfFile: [url path] ofType: type]; } else { self = [self initForURL: url withContentsOfURL: url ofType: type error: error]; } [self setFileModificationDate: [NSDate date]]; return self; } - (id) initWithType: (NSString *)type error: (NSError **)error { self = [self init]; if (self != nil) { [self setFileType: type]; } return self; } - (void) dealloc { [[NSNotificationCenter defaultCenter] removeObserver: self]; RELEASE(_undo_manager); RELEASE(_file_name); RELEASE(_file_url); RELEASE(_file_type); RELEASE(_last_component_file_name); RELEASE(_autosaved_file_url); RELEASE(_file_modification_date); RELEASE(_window_controllers); RELEASE(_window); RELEASE(_print_info); RELEASE(_printOp_delegate); RELEASE(_save_panel_accessory); RELEASE(_spa_button); RELEASE(_save_type); [super dealloc]; } - (NSString *) fileName { return _file_name; } - (void) setFileName: (NSString *)fileName { NSURL *fileUrl; if (fileName && ![fileName isAbsolutePath]) { NSString *dir = [[NSFileManager defaultManager] currentDirectoryPath]; if (dir) { fileName = [dir stringByAppendingPathComponent: fileName]; } } fileUrl = fileName ? [NSURL fileURLWithPath: fileName] : nil; // This check is to prevent super calls from recursing. if (!OVERRIDDEN(setFileName:)) { [self setFileURL: fileUrl]; } else { ASSIGN(_file_name, fileName); ASSIGN(_file_url, fileUrl); [self setLastComponentOfFileName: [_file_name lastPathComponent]]; } } - (NSString *) fileType { return _file_type; } - (void) setFileType: (NSString *)type { ASSIGN(_file_type, type); } - (NSURL *) fileURL { if (OVERRIDDEN(fileName)) { NSString *fileName = [self fileName]; return fileName ? [NSURL fileURLWithPath: fileName] : nil; } else { return _file_url; } } - (void) setFileURL: (NSURL *)url { if (OVERRIDDEN(setFileName:) && ((url == nil) || [url isFileURL])) { [self setFileName: [url path]]; } else { ASSIGN(_file_url, url); ASSIGN(_file_name, (url && [url isFileURL]) ? [url path] : (NSString*)nil); [self setLastComponentOfFileName: [[_file_url path] lastPathComponent]]; } } - (NSDate *) fileModificationDate { return _file_modification_date; } - (void) setFileModificationDate: (NSDate *)date { ASSIGN(_file_modification_date, date); } - (NSString *) lastComponentOfFileName { return _last_component_file_name; } - (void) setLastComponentOfFileName: (NSString *)str { ASSIGN(_last_component_file_name, str); [[self windowControllers] makeObjectsPerformSelector: @selector(synchronizeWindowTitleWithDocumentName)]; } - (NSArray *) windowControllers { return _window_controllers; } - (void) addWindowController: (NSWindowController *)windowController { [_window_controllers addObject: windowController]; if ([windowController document] != self) { [windowController setDocument: self]; [windowController setDocumentEdited: [self isDocumentEdited]]; } } - (void) removeWindowController: (NSWindowController *)windowController { if ([_window_controllers containsObject: windowController]) { [windowController setDocumentEdited: NO]; [windowController setDocument: nil]; [_window_controllers removeObject: windowController]; } } - (NSString *) windowNibName { return nil; } // private; called during nib load. // we do not retain the window, since it should // already have a retain from the nib. - (void) setWindow: (NSWindow *)aWindow { _window = aWindow; } - (NSWindow *) windowForSheet { NSWindow *win; if (([_window_controllers count] > 0) && ((win = [[_window_controllers objectAtIndex: 0] window]) != nil)) { return win; } /* Note: While Apple's documentation says that this method returns * [NSApp mainWindow] if the document has no window controllers, the * actual implementation returns nil and, in fact, the header files * on OS X also say so. Since it would be very unreasonable to attach a * document modal sheet to a window that doesn't belong to this document, * we do the same here, too. */ return nil; } /** * Creates the window controllers for the current document. Calls * addWindowController: on the receiver to add them to the controller * array. */ - (void) makeWindowControllers { NSString *name = [self windowNibName]; if (name != nil && [name length] > 0) { NSWindowController *controller; controller = [[NSWindowController alloc] initWithWindowNibName: name owner: self]; [self addWindowController: controller]; RELEASE(controller); } else { [NSException raise: NSInternalInconsistencyException format: @"%@ must override either -windowNibName " @"or -makeWindowControllers", NSStringFromClass([self class])]; } } /** * Makes all the documents windows visible by ordering them to the * front and making them main or key.
* If the document has no windows, this method has no effect. */ - (void) showWindows { [_window_controllers makeObjectsPerformSelector: @selector(showWindow:) withObject: self]; } - (BOOL) isDocumentEdited { return _change_count != 0 || _doc_flags.permanently_modified; } - (void) updateChangeCount: (NSDocumentChangeType)change { int i, count = [_window_controllers count]; BOOL isEdited; switch (change) { case NSChangeDone: _change_count++; _autosave_change_count++; break; case NSChangeUndone: _change_count--; _autosave_change_count--; break; case NSChangeReadOtherContents: _doc_flags.permanently_modified = 1; break; case NSChangeCleared: _change_count = 0; _autosave_change_count = 0; _doc_flags.permanently_modified = 0; _doc_flags.autosave_permanently_modified = 0; break; case NSChangeAutosaved: _autosave_change_count = 0; _doc_flags.autosave_permanently_modified = 0; break; } /* * NOTE: Apple's implementation seems to not call -isDocumentEdited * here but directly checks to see if _changeCount == 0. It seems it * would be better to call the method in case it's overridden by a * subclass, but we may want to keep Apple's behavior. */ isEdited = [self isDocumentEdited]; for (i = 0; i < count; i++) { [[_window_controllers objectAtIndex: i] setDocumentEdited: isEdited]; } } - (BOOL) canCloseDocument { int result; if (![self isDocumentEdited]) return YES; result = NSRunAlertPanel (_(@"Close"), _(@"%@ has changed. Save?"), _(@"Save"), _(@"Cancel"), _(@"Don't Save"), [self displayName]); #define Save NSAlertDefaultReturn #define Cancel NSAlertAlternateReturn #define DontSave NSAlertOtherReturn switch (result) { // return NO if save failed case Save: { [self saveDocument: nil]; return ![self isDocumentEdited]; } case DontSave: return YES; case Cancel: default: return NO; } } - (void) canCloseDocumentWithDelegate: (id)delegate shouldCloseSelector: (SEL)shouldCloseSelector contextInfo: (void *)contextInfo { BOOL result = [self canCloseDocument]; if (delegate != nil && shouldCloseSelector != NULL) { void (*meth)(id, SEL, id, BOOL, void*); meth = (void (*)(id, SEL, id, BOOL, void*))[delegate methodForSelector: shouldCloseSelector]; if (meth) meth(delegate, shouldCloseSelector, self, result, contextInfo); } } - (BOOL) shouldCloseWindowController: (NSWindowController *)windowController { if (![_window_controllers containsObject: windowController]) return YES; /* If it's the last window controller, pop up a warning */ /* maybe we should count only loaded window controllers (or visible windows). */ if ([windowController shouldCloseDocument] || [_window_controllers count] == 1) { return [self canCloseDocument]; } return YES; } - (void) shouldCloseWindowController: (NSWindowController *)windowController delegate: (id)delegate shouldCloseSelector: (SEL)callback contextInfo: (void *)contextInfo { /* If it's the last window controller, pop up a warning */ /* maybe we should count only loaded window controllers (or visible windows). */ if ([_window_controllers containsObject: windowController] && ([windowController shouldCloseDocument] || [_window_controllers count] == 1)) { [self canCloseDocumentWithDelegate: delegate shouldCloseSelector: callback contextInfo: contextInfo]; return; } if (delegate != nil && callback != NULL) { void (*meth)(id, SEL, id, BOOL, void*); meth = (void (*)(id, SEL, id, BOOL, void*))[delegate methodForSelector: callback]; if (meth) meth(delegate, callback, self, YES, contextInfo); } } - (NSString *) displayName { if ([self lastComponentOfFileName] != nil) { if ([self fileNameExtensionWasHiddenInLastRunSavePanel]) { return [[self lastComponentOfFileName] stringByDeletingPathExtension]; } else { return [self lastComponentOfFileName]; } } else { return [NSString stringWithFormat: _(@"Untitled-%d"), _document_index]; } } - (BOOL) keepBackupFile { return NO; } - (NSData *) dataRepresentationOfType: (NSString *)type { [NSException raise: NSInternalInconsistencyException format:@"%@ must implement %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; return nil; } - (NSData *) dataOfType: (NSString *)type error: (NSError **)error { if (OVERRIDDEN(dataRepresentationOfType:)) { if (error) *error = nil; return [self dataRepresentationOfType: type]; } [NSException raise: NSInternalInconsistencyException format:@"%@ must implement %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; return nil; } - (BOOL) loadDataRepresentation: (NSData *)data ofType: (NSString *)type { [NSException raise: NSInternalInconsistencyException format:@"%@ must implement %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; return NO; } - (NSFileWrapper *) fileWrapperRepresentationOfType: (NSString *)type { NSData *data = [self dataRepresentationOfType: type]; if (data == nil) return nil; return AUTORELEASE([[NSFileWrapper alloc] initRegularFileWithContents: data]); } - (NSFileWrapper *) fileWrapperOfType: (NSString *)type error: (NSError **)error { NSData *data; if (OVERRIDDEN(fileWrapperRepresentationOfType:)) { if (error) *error = nil; return [self fileWrapperRepresentationOfType: type]; } data = [self dataOfType: type error: error]; if (data == nil) return nil; return AUTORELEASE([[NSFileWrapper alloc] initRegularFileWithContents: data]); } - (BOOL) loadFileWrapperRepresentation: (NSFileWrapper *)wrapper ofType: (NSString *)type { if ([wrapper isRegularFile]) { return [self loadDataRepresentation: [wrapper regularFileContents] ofType: type]; } /* * This even happens on a symlink. May want to use * -stringByResolvingAllSymlinksInPath somewhere, but Apple doesn't. */ NSLog(@"%@ must be overridden if your document deals with file packages.", NSStringFromSelector(_cmd)); return NO; } - (BOOL) writeToFile: (NSString *)fileName ofType: (NSString *)type { return [[self fileWrapperRepresentationOfType: type] writeToFile: fileName atomically: YES updateFilenames: YES]; } - (BOOL) readFromFile: (NSString *)fileName ofType: (NSString *)type { NSFileWrapper *wrapper = AUTORELEASE([[NSFileWrapper alloc] initWithPath: fileName]); return [self loadFileWrapperRepresentation: wrapper ofType: type]; } - (BOOL) revertToSavedFromFile: (NSString *)fileName ofType: (NSString *)type { return [self readFromFile: fileName ofType: type]; } - (BOOL) writeToURL: (NSURL *)url ofType: (NSString *)type { if ([url isFileURL]) { return [self writeToFile: [url path] ofType: type]; } return NO; } - (BOOL) readFromURL: (NSURL *)url ofType: (NSString *)type { if ([url isFileURL]) { return [self readFromFile: [url path] ofType: type]; } return NO; } - (BOOL) revertToSavedFromURL: (NSURL *)url ofType: (NSString *)type { return [self readFromURL: url ofType: type]; } - (BOOL) readFromData: (NSData *)data ofType: (NSString *)type error: (NSError **)error { if (OVERRIDDEN(loadDataRepresentation:ofType:)) { if (error) *error = nil; return [self loadDataRepresentation: data ofType: type]; } [NSException raise: NSInternalInconsistencyException format:@"%@ must implement %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)]; return NO; } - (BOOL) readFromFileWrapper: (NSFileWrapper *)wrapper ofType: (NSString *)type error: (NSError **)error { if (OVERRIDDEN(loadFileWrapperRepresentation:ofType:)) { if (error) *error = nil; return [self loadFileWrapperRepresentation: wrapper ofType: type]; } if ([wrapper isRegularFile]) { return [self readFromData: [wrapper regularFileContents] ofType: type error: error]; } // FIXME: Set error if (error) *error = nil; return NO; } - (BOOL) readFromURL: (NSURL *)url ofType: (NSString *)type error: (NSError **)error { if ([url isFileURL]) { NSString *fileName = [url path]; if (OVERRIDDEN(readFromFile:ofType:)) { if (error) *error = nil; return [self readFromFile: fileName ofType: type]; } else { NSFileWrapper *wrapper = AUTORELEASE([[NSFileWrapper alloc] initWithPath: fileName]); return [self readFromFileWrapper: wrapper ofType: type error: error]; } } else { return [self readFromData: [url resourceDataUsingCache: YES] ofType: type error: error]; } } - (BOOL) revertToContentsOfURL: (NSURL *)url ofType: (NSString *)type error: (NSError **)error { return [self readFromURL: url ofType: type error: error]; } - (BOOL) writeToFile: (NSString *)fileName ofType: (NSString *)type originalFile: (NSString *)origFileName saveOperation: (NSSaveOperationType)saveOp { return [self writeToFile: fileName ofType: type]; } - (NSString *) _backupFileNameFor: (NSString *)newFileName { NSString *extension = [newFileName pathExtension]; NSString *backupFilename = [newFileName stringByDeletingPathExtension]; backupFilename = [backupFilename stringByAppendingString:@"~"]; return [backupFilename stringByAppendingPathExtension: extension]; } - (BOOL) _writeBackupForFile: (NSString *)newFileName toFile: (NSString *)backupFilename { NSFileManager *fileManager = [NSFileManager defaultManager]; /* NSFileManager movePath: will fail if destination exists */ /* Save panel has already asked if the user wants to replace it */ if ([fileManager fileExistsAtPath: backupFilename]) { [fileManager removeFileAtPath: backupFilename handler: nil]; } // Move or copy? if (![fileManager movePath: newFileName toPath: backupFilename handler: nil] && [self keepBackupFile]) { int result = NSRunAlertPanel(_(@"File Error"), _(@"Can't create backup file. Save anyways?"), _(@"Save"), _(@"Cancel"), nil); if (result != NSAlertDefaultReturn) return NO; } return YES; } - (BOOL) writeWithBackupToFile: (NSString *)fileName ofType: (NSString *)fileType saveOperation: (NSSaveOperationType)saveOp { NSFileManager *fileManager = [NSFileManager defaultManager]; NSString *backupFilename = nil; BOOL isNativeType = [[self class] isNativeType: fileType]; if (fileName && isNativeType) { if ([fileManager fileExistsAtPath: fileName]) { backupFilename = [self _backupFileNameFor: fileName]; if (![self _writeBackupForFile: fileName toFile: backupFilename]) { return NO; } } if ([self writeToFile: fileName ofType: fileType originalFile: backupFilename saveOperation: saveOp]) { // FIXME: Should set the file attributes if (saveOp != NSSaveToOperation) { [self _removeAutosavedContentsFile]; [self setFileName: fileName]; [self setFileType: fileType]; [self updateChangeCount: NSChangeCleared]; } if (backupFilename && ![self keepBackupFile]) { [fileManager removeFileAtPath: backupFilename handler: nil]; } return YES; } } return NO; } - (BOOL) writeSafelyToURL: (NSURL *)url ofType: (NSString *)type forSaveOperation: (NSSaveOperationType)op error: (NSError **)error { NSURL *original = [self fileURL]; NSFileManager *fileManager = [NSFileManager defaultManager]; NSString *backupFilename = nil; BOOL isNativeType = [[self class] isNativeType: type]; if (OVERRIDDEN(writeWithBackupToFile:ofType:saveOperation:)) { BOOL isAutosave = NO; if (op == NSAutosaveOperation) { op = NSSaveToOperation; isAutosave = YES; } if (error) *error = nil; if (![self writeWithBackupToFile: [url path] ofType: type saveOperation: op]) { return NO; } if (isAutosave) { [self setAutosavedContentsFileURL: url]; [self updateChangeCount: NSChangeAutosaved]; } return YES; } if (!isNativeType || (url == nil)) { // FIXME: Set error if (error) *error = nil; return NO; } if (op == NSSaveOperation) { if ([url isFileURL]) { NSString *fileName; fileName = [url path]; if ([fileManager fileExistsAtPath: fileName]) { backupFilename = [self _backupFileNameFor: fileName]; if (![self _writeBackupForFile: fileName toFile: backupFilename]) { // FIXME: Set error. if (error) *error = nil; return NO; } } } } if (![self writeToURL: url ofType: type forSaveOperation: op originalContentsURL: original error: error]) { return NO; } if ([url isFileURL]) { NSDictionary *attrs; attrs = [self fileAttributesToWriteToURL: url ofType: type forSaveOperation: op originalContentsURL: original error: error]; [fileManager changeFileAttributes: attrs atPath: [url path]]; } if (op == NSAutosaveOperation) { [self setAutosavedContentsFileURL: url]; [self updateChangeCount: NSChangeAutosaved]; } else if (op != NSSaveToOperation) { [self _removeAutosavedContentsFile]; [self setFileURL: url]; [self setFileType: type]; [self updateChangeCount: NSChangeCleared]; } if (backupFilename && ![self keepBackupFile]) { [fileManager removeFileAtPath: backupFilename handler: nil]; } return YES; } - (BOOL) writeToURL: (NSURL *)url ofType: (NSString *)type error: (NSError **)error { if ([url isFileURL]) { NSFileWrapper *wrapper; if (OVERRIDDEN(writeToFile:ofType:)) { if (error) *error = nil; return [self writeToFile: [url path] ofType: type]; } wrapper = [self fileWrapperOfType: type error: error]; if (wrapper == nil) { // FIXME: Set error if (error) *error = nil; return NO; } if (error) *error = nil; return [wrapper writeToFile: [url path] atomically: YES updateFilenames: YES]; } else { NSData *data = [self dataOfType: type error: error]; if (data == nil) return NO; return [url setResourceData: data]; } } - (BOOL) writeToURL: (NSURL *)url ofType: (NSString *)type forSaveOperation: (NSSaveOperationType)op originalContentsURL: (NSURL *)orig error: (NSError **)error { if (OVERRIDDEN(writeToFile:ofType:originalFile:saveOperation:)) { if (op == NSAutosaveOperation) { op = NSSaveToOperation; } if (error) *error = nil; return [self writeToFile: [url path] ofType: type originalFile: [orig path] saveOperation: op]; } return [self writeToURL: url ofType: type error: error]; } - (IBAction) changeSaveType: (id)sender { NSDocumentController *controller = [NSDocumentController sharedDocumentController]; NSArray *extensions; ASSIGN(_save_type, [[sender selectedItem] representedObject]); extensions = [controller fileExtensionsFromType: _save_type]; if ([extensions containsObject: @"*"]) extensions = nil; [(NSSavePanel *)[sender window] setAllowedFileTypes: extensions]; } - (NSInteger) runModalSavePanel: (NSSavePanel *)savePanel withAccessoryView: (NSView *)accessoryView { NSString *directory, *file; if (accessoryView) { [savePanel setAccessoryView: accessoryView]; } if ([self fileName]) { directory = [[self fileName] stringByDeletingLastPathComponent]; file = [[self fileName] lastPathComponent]; if (![savePanel allowsOtherFileTypes]) { NSArray *exts = [savePanel allowedFileTypes]; if ([exts count] && ![exts containsObject: [file pathExtension]] && ![exts containsObject: @"*"]) { file = [file stringByDeletingPathExtension]; file = [file stringByAppendingPathExtension: [exts objectAtIndex: 0]]; } } return [savePanel runModalForDirectory: directory file: file]; } return [savePanel runModal]; } - (BOOL) prepareSavePanel: (NSSavePanel *)savePanel { return YES; } - (BOOL) shouldRunSavePanelWithAccessoryView { return YES; } - (void) _createPanelAccessory { if (_save_panel_accessory == nil) { NSRect accessoryFrame = NSMakeRect(0,0,380,70); NSRect spaFrame = NSMakeRect(115,14,150,22); _save_panel_accessory = [[NSBox alloc] initWithFrame: accessoryFrame]; [(NSBox *)_save_panel_accessory setTitle: _(@"File Type")]; [_save_panel_accessory setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; _spa_button = [[NSPopUpButton alloc] initWithFrame: spaFrame]; [_spa_button setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable | NSViewMinYMargin | NSViewMaxYMargin | NSViewMinXMargin | NSViewMaxXMargin]; [_spa_button setTarget: self]; [_spa_button setAction: @selector(changeSaveType:)]; [_save_panel_accessory addSubview: _spa_button]; } } - (void) _addItemsToSpaButtonFromArray: (NSArray *)types { NSString *type, *title; int i, count = [types count]; [_spa_button removeAllItems]; for (i = 0; i < count; i++) { type = [types objectAtIndex: i]; title = [[NSDocumentController sharedDocumentController] displayNameForType: type]; [_spa_button addItemWithTitle: title]; [[_spa_button itemAtIndex: i] setRepresentedObject: type]; } // if it's more than one, then [_spa_button setEnabled: (count > 0)]; // if we have some items, select the current filetype. if (count > 0) { [_spa_button selectItemAtIndex: [_spa_button indexOfItemWithRepresentedObject: [self fileType]]]; } } - (NSSavePanel *)_runSavePanelForSaveOperation: (NSSaveOperationType)saveOperation { NSString *title; NSString *directory; NSArray *types; NSDocumentController *controller; NSSavePanel *savePanel = [NSSavePanel savePanel]; ASSIGN(_save_type, [self fileType]); controller = [NSDocumentController sharedDocumentController]; types = [self writableTypesForSaveOperation: saveOperation]; if ([self shouldRunSavePanelWithAccessoryView]) { if (_save_panel_accessory == nil) [self _createPanelAccessory]; [self _addItemsToSpaButtonFromArray: types]; [savePanel setAccessoryView: _save_panel_accessory]; } if ([types count] > 0) { NSArray *extensions = [controller fileExtensionsFromType: [self fileType]]; if ([extensions containsObject: @"*"]) extensions = nil; [savePanel setAllowedFileTypes: extensions]; } switch (saveOperation) { case NSSaveAsOperation: title = _(@"Save As"); break; case NSSaveToOperation: title = _(@"Save To"); break; case NSSaveOperation: default: title = _(@"Save"); break; } [savePanel setTitle: title]; if ([self fileName]) directory = [[self fileName] stringByDeletingLastPathComponent]; else directory = [controller currentDirectory]; [savePanel setDirectory: directory]; if (!OVERRIDDEN(runModalSavePanel:withAccessoryView:)) { if (![self prepareSavePanel: savePanel]) { return nil; } } if ([self runModalSavePanel: savePanel withAccessoryView: [savePanel accessoryView]]) { return savePanel; } return nil; } - (NSString *) fileNameFromRunningSavePanelForSaveOperation: (NSSaveOperationType)saveOperation { NSSavePanel *savePanel = [self _runSavePanelForSaveOperation: saveOperation]; if (savePanel) { return [savePanel filename]; } return nil; } - (void) runModalSavePanelForSaveOperation: (NSSaveOperationType)saveOperation delegate: (id)delegate didSaveSelector: (SEL)didSaveSelector contextInfo: (void *)contextInfo { // FIXME: Commit registered editors NSSavePanel *savePanel = [self _runSavePanelForSaveOperation: saveOperation]; if (savePanel) { if (OVERRIDDEN(saveToFile:saveOperation:delegate:didSaveSelector:contextInfo:)) { [self saveToFile: [savePanel filename] saveOperation: saveOperation delegate: delegate didSaveSelector: didSaveSelector contextInfo: contextInfo]; } else { [self saveToURL: [savePanel URL] ofType: [self fileTypeFromLastRunSavePanel] forSaveOperation: saveOperation delegate: delegate didSaveSelector: didSaveSelector contextInfo: contextInfo]; } } } - (NSArray *) writableTypesForSaveOperation: (NSSaveOperationType)op { NSArray *types = [object_getClass(self) writableTypes]; NSMutableArray *muTypes; int i, len; if (op == NSSaveToOperation) { return types; } len = [types count]; muTypes = [NSMutableArray arrayWithCapacity: len]; for (i = 0; i < len; i++) { NSString *type; type = [types objectAtIndex: i]; if ([[self class] isNativeType: type]) { [muTypes addObject: type]; } } return muTypes; } - (BOOL) fileNameExtensionWasHiddenInLastRunSavePanel { // FIXME return NO; } - (NSString *) fileNameExtensionForType: (NSString *)typeName saveOperation: (NSSaveOperationType)saveOperation { NSArray *exts = [[NSDocumentController sharedDocumentController] fileExtensionsFromType: typeName]; if ([exts count] && ![exts containsObject: @"*"]) return (NSString *)[exts objectAtIndex: 0]; return @""; } - (BOOL) shouldChangePrintInfo: (NSPrintInfo *)newPrintInfo { return YES; } - (NSPrintInfo *) printInfo { return _print_info? _print_info : [NSPrintInfo sharedPrintInfo]; } - (void) setPrintInfo: (NSPrintInfo *)printInfo { NSUndoManager *undoManager = [self undoManager]; if (undoManager != nil) { [[undoManager prepareWithInvocationTarget: self] setPrintInfo: _print_info]; // FIXME undoManager -setActionName: } ASSIGN(_print_info, printInfo); if (undoManager == nil) { [self updateChangeCount: NSChangeDone]; } } // Page layout panel (Page Setup) - (BOOL) preparePageLayout: (NSPageLayout *)pageLayout { return YES; } - (NSInteger) runModalPageLayoutWithPrintInfo: (NSPrintInfo *)printInfo { NSPageLayout *pageLayout; pageLayout = [NSPageLayout pageLayout]; if ([self preparePageLayout: pageLayout]) { return [pageLayout runModalWithPrintInfo: printInfo]; } else { return NSCancelButton; } } - (void) _documentDidRunModalPageLayout: (NSDocument*)doc accepted: (BOOL)accepted contextInfo: (void *)contextInfo { NSPrintInfo *printInfo = (NSPrintInfo *)contextInfo; if (accepted && [self shouldChangePrintInfo: printInfo]) { [self setPrintInfo: printInfo]; } } - (IBAction) runPageLayout: (id)sender { NSPrintInfo *printInfo = AUTORELEASE([[self printInfo] copy]); [self runModalPageLayoutWithPrintInfo: printInfo delegate: self didRunSelector: @selector(_documentDidRunModalPageLayout:accepted:contextInfo:) contextInfo: printInfo]; } - (void) runModalPageLayoutWithPrintInfo: (NSPrintInfo *)info delegate: (id)delegate didRunSelector: (SEL)sel contextInfo: (void *)context { NSPageLayout *pageLayout; pageLayout = [NSPageLayout pageLayout]; if ([self preparePageLayout: pageLayout]) { [pageLayout beginSheetWithPrintInfo: info modalForWindow: [self windowForSheet] delegate: delegate didEndSelector: sel contextInfo: context]; } } /* This is overridden by subclassers; the default implementation does nothing. */ - (void) printShowingPrintPanel: (BOOL)flag { } - (IBAction) printDocument: (id)sender { [self printDocumentWithSettings: [NSDictionary dictionary] showPrintPanel: YES delegate: nil didPrintSelector: NULL contextInfo: NULL]; } - (void) printDocumentWithSettings: (NSDictionary *)settings showPrintPanel: (BOOL)flag delegate: (id)delegate didPrintSelector: (SEL)sel contextInfo: (void *)context { NSPrintOperation *printOp; NSError *error; if (OVERRIDDEN(printShowingPrintPanel:)) { // FIXME: More communication with the panel is needed. return [self printShowingPrintPanel: flag]; } printOp = [self printOperationWithSettings: settings error: &error]; if (printOp != nil) { [printOp setShowsPrintPanel: flag]; [self runModalPrintOperation: printOp delegate: delegate didRunSelector: sel contextInfo: context]; } else { [self presentError: error]; if (delegate != nil && sel != NULL) { void (*meth)(id, SEL, id, BOOL, void*); meth = (void (*)(id, SEL, id, BOOL, void*))[delegate methodForSelector: sel]; if (meth) meth(delegate, sel, self, NO, context); } } } - (NSPrintOperation *) printOperationWithSettings: (NSDictionary *)settings error: (NSError **)error { if (error) *error = nil; return nil; } - (void) runModalPrintOperation: (NSPrintOperation *)op delegate: (id)delegate didRunSelector: (SEL)sel contextInfo: (void *)context { ASSIGN(_printOp_delegate, delegate); _printOp_didRunSelector = sel; [op runOperationModalForWindow: [self windowForSheet] delegate: self didRunSelector: @selector(_runModalPrintOperationDidSucceed:contextInfo:) contextInfo: context]; } - (void) _runModalPrintOperationDidSucceed: (BOOL)success contextInfo: (void *)context { id delegate = _printOp_delegate; SEL didRunSelector = _printOp_didRunSelector; void (*didRun)(id, SEL, NSDocument *, BOOL, id); if (delegate && [delegate respondsToSelector: didRunSelector]) { didRun = (void (*)(id, SEL, NSDocument *, BOOL, id)) [delegate methodForSelector: didRunSelector]; didRun(delegate, didRunSelector, self, success, context); } DESTROY(_printOp_delegate); } - (BOOL) validateMenuItem: (NSMenuItem *)anItem { return [self validateUserInterfaceItem: anItem]; } - (BOOL) validateUserInterfaceItem: (id )anItem { if (sel_isEqual([anItem action], @selector(revertDocumentToSaved:))) return ([self fileName] != nil && [self isDocumentEdited]); if (sel_isEqual([anItem action], @selector(saveDocument:))) return [self isDocumentEdited]; // FIXME should validate spa popup items; return YES if it's a native type. return YES; } - (NSString *) fileTypeFromLastRunSavePanel { return _save_type; } - (NSDictionary *) fileAttributesToWriteToFile: (NSString *)fullDocumentPath ofType: (NSString *)docType saveOperation: (NSSaveOperationType)saveOperationType { // FIXME: Implement. Should set NSFileExtensionHidden return [NSDictionary dictionary]; } - (NSDictionary *) fileAttributesToWriteToURL: (NSURL *)url ofType: (NSString *)type forSaveOperation: (NSSaveOperationType)op originalContentsURL: (NSURL *)original error: (NSError **)error { // FIXME: Implement. Should set NSFileExtensionHidden if (error) *error = nil; return [NSDictionary dictionary]; } - (IBAction) saveDocument: (id)sender { [self saveDocumentWithDelegate: nil didSaveSelector: NULL contextInfo: NULL]; } - (IBAction) saveDocumentAs: (id)sender { [self runModalSavePanelForSaveOperation: NSSaveAsOperation delegate: nil didSaveSelector: NULL contextInfo: NULL]; } - (IBAction) saveDocumentTo: (id)sender { [self runModalSavePanelForSaveOperation: NSSaveToOperation delegate: nil didSaveSelector: NULL contextInfo: NULL]; } - (void) saveDocumentWithDelegate: (id)delegate didSaveSelector: (SEL)didSaveSelector contextInfo: (void *)contextInfo { NSURL *fileURL = [self fileURL]; NSString *type = [self fileType]; if ((fileURL != nil) && (type != nil)) { [self saveToURL: fileURL ofType: type forSaveOperation: NSSaveOperation delegate: delegate didSaveSelector: didSaveSelector contextInfo: contextInfo]; } else { [self runModalSavePanelForSaveOperation: NSSaveOperation delegate: delegate didSaveSelector: didSaveSelector contextInfo: contextInfo]; } } - (void) saveToFile: (NSString *)fileName saveOperation: (NSSaveOperationType)saveOperation delegate: (id)delegate didSaveSelector: (SEL)didSaveSelector contextInfo: (void *)contextInfo { BOOL saved = NO; if (fileName != nil) { saved = [self writeWithBackupToFile: fileName ofType: [self fileTypeFromLastRunSavePanel] saveOperation: saveOperation]; if (saved && (saveOperation == NSSaveOperation || saveOperation == NSSaveAsOperation)) { [[NSDocumentController sharedDocumentController] noteNewRecentDocument: self]; } } if (delegate != nil && didSaveSelector != NULL) { void (*meth)(id, SEL, id, BOOL, void*); meth = (void (*)(id, SEL, id, BOOL, void*))[delegate methodForSelector: didSaveSelector]; if (meth) meth(delegate, didSaveSelector, self, saved, contextInfo); } } - (BOOL) saveToURL: (NSURL *)url ofType: (NSString *)type forSaveOperation: (NSSaveOperationType)op error: (NSError **)error { BOOL saved = [self writeSafelyToURL: url ofType: type forSaveOperation: op error: error]; if (saved && (op == NSSaveOperation || op == NSSaveAsOperation)) { [[NSDocumentController sharedDocumentController] noteNewRecentDocument: self]; } return saved; } - (void) saveToURL: (NSURL *)url ofType: (NSString *)type forSaveOperation: (NSSaveOperationType)op delegate: (id)delegate didSaveSelector: (SEL)didSaveSelector contextInfo: (void *)contextInfo { NSError *error; BOOL saved; saved = [self saveToURL: url ofType: type forSaveOperation: op error: &error]; if (!saved) { [self presentError: error]; } else if (op == NSSaveOperation || op == NSSaveAsOperation) { [[NSDocumentController sharedDocumentController] noteNewRecentDocument: self]; } if (delegate != nil && didSaveSelector != NULL) { void (*meth)(id, SEL, id, BOOL, void*); meth = (void (*)(id, SEL, id, BOOL, void*))[delegate methodForSelector: didSaveSelector]; if (meth) meth(delegate, didSaveSelector, self, saved, contextInfo); } } - (IBAction) revertDocumentToSaved: (id)sender { int result; NSError *error; result = NSRunAlertPanel (_(@"Revert"), _(@"%@ has been edited. Are you sure you want to undo changes?"), _(@"Revert"), _(@"Cancel"), nil, [self displayName]); if (result == NSAlertDefaultReturn) { // FIXME: Revert registered editors if ([self revertToContentsOfURL: [self fileURL] ofType: [self fileType] error: &error]) { [self updateChangeCount: NSChangeCleared]; [[self undoManager] removeAllActions]; [self _removeAutosavedContentsFile]; } else { [self presentError: error]; } } } /** Closes all the windows owned by the document, then removes itself from the list of documents known by the NSDocumentController. This method does not ask the user if they want to save the document before closing. It is closed without saving any information. */ - (void) close { if (_doc_flags.in_close == NO) { int count = [_window_controllers count]; /* Closing a windowController will also send us a close, so make sure we don't go recursive */ _doc_flags.in_close = YES; if (count > 0) { NSWindowController *array[count]; [_window_controllers getObjects: array]; while (count-- > 0) [array[count] close]; } [self _removeAutosavedContentsFile]; AUTORELEASE(RETAIN(self)); [[NSDocumentController sharedDocumentController] removeDocument: self]; } } - (void) windowControllerWillLoadNib: (NSWindowController *)windowController {} - (void) windowControllerDidLoadNib: (NSWindowController *)windowController {} - (NSUndoManager *) undoManager { if (_undo_manager == nil && [self hasUndoManager]) { [self setUndoManager: AUTORELEASE([[NSUndoManager alloc] init])]; } return _undo_manager; } - (void) setUndoManager: (NSUndoManager *)undoManager { if (undoManager != _undo_manager) { NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; if (_undo_manager) { [center removeObserver: self name: NSUndoManagerWillCloseUndoGroupNotification object: _undo_manager]; [center removeObserver: self name: NSUndoManagerDidUndoChangeNotification object: _undo_manager]; [center removeObserver: self name: NSUndoManagerDidRedoChangeNotification object: _undo_manager]; } ASSIGN(_undo_manager, undoManager); if (_undo_manager == nil) { [self setHasUndoManager: NO]; } else { [center addObserver: self selector:@selector(_changeWasDone:) name: NSUndoManagerWillCloseUndoGroupNotification object: _undo_manager]; [center addObserver: self selector:@selector(_changeWasUndone:) name: NSUndoManagerDidUndoChangeNotification object: _undo_manager]; [center addObserver: self selector:@selector(_changeWasRedone:) name: NSUndoManagerDidRedoChangeNotification object: _undo_manager]; } } } - (BOOL) hasUndoManager { return _doc_flags.has_undo_manager; } - (void) setHasUndoManager: (BOOL)flag { if (_undo_manager && !flag) [self setUndoManager: nil]; _doc_flags.has_undo_manager = flag; } - (BOOL) presentError: (NSError *)error { error = [self willPresentError: error]; return [[NSDocumentController sharedDocumentController] presentError: error]; } - (void) presentError: (NSError *)error modalForWindow: (NSWindow *)window delegate: (id)delegate didPresentSelector: (SEL)sel contextInfo: (void *)context { error = [self willPresentError: error]; [[NSDocumentController sharedDocumentController] presentError: error modalForWindow: window delegate: delegate didPresentSelector: sel contextInfo: context]; } - (NSError *) willPresentError: (NSError *)error { return error; } - (NSURL *) autosavedContentsFileURL { return _autosaved_file_url; } - (void) setAutosavedContentsFileURL: (NSURL *)url { ASSIGN(_autosaved_file_url, url); [[NSDocumentController sharedDocumentController] _recordAutosavedDocument: self]; } - (void) autosaveDocumentWithDelegate: (id)delegate didAutosaveSelector: (SEL)didAutosaveSelector contextInfo: (void *)context { NSURL *url = [self autosavedContentsFileURL]; NSString *type = [self autosavingFileType]; if (url == nil) { static NSString *processName = nil; NSString *path; NSString *ext = [self fileNameExtensionForType: type saveOperation: NSAutosaveOperation]; if (!processName) processName = [[[NSProcessInfo processInfo] processName] copy]; path = [[NSDocumentController sharedDocumentController] _autosaveDirectory: YES]; path = [path stringByAppendingPathComponent: [NSString stringWithFormat: @"%@-%d", processName, _document_index]]; path = [path stringByAppendingPathExtension: ext]; url = [NSURL fileURLWithPath: path]; } [self saveToURL: url ofType: type forSaveOperation: NSAutosaveOperation delegate: delegate didSaveSelector: didAutosaveSelector contextInfo: context]; } - (NSString *) autosavingFileType { return [self fileType]; } - (BOOL) hasUnautosavedChanges { return _autosave_change_count != 0 || _doc_flags.autosave_permanently_modified; } @end @implementation NSDocument(Private) /* * This private method is used to transfer window ownership to the * NSWindowController in situations (such as the default) where the * document is set to the nib owner, and thus owns the window immediately * following the loading of the nib. */ - (NSWindow *) _transferWindowOwnership { NSWindow *window = _window; _window = nil; return AUTORELEASE(window); } - (void) _removeWindowController: (NSWindowController *)windowController { if ([_window_controllers containsObject: windowController]) { BOOL autoClose = [windowController shouldCloseDocument]; [windowController setDocument: nil]; [_window_controllers removeObject: windowController]; if (autoClose || [_window_controllers count] == 0) { [self close]; } } } - (void) _removeAutosavedContentsFile { NSURL *url = [self autosavedContentsFileURL]; if (url) { NSString *path = [[url path] retain]; [self setAutosavedContentsFileURL: nil]; [[NSFileManager defaultManager] removeFileAtPath: path handler: nil]; [path release]; } } - (void) _changeWasDone: (NSNotification *)notification { /* Prevent a document from appearing unmodified after saving the * document, undoing a number of changes, and then making an equal * number of changes. Ditto for autosaved changes. */ if (_change_count < 0) _doc_flags.permanently_modified = 1; if (_autosave_change_count < 0) _doc_flags.autosave_permanently_modified = 1; [self updateChangeCount: NSChangeDone]; } - (void) _changeWasUndone: (NSNotification *)notification { [self updateChangeCount: NSChangeUndone]; } - (void) _changeWasRedone: (NSNotification *)notification { /* FIXME * Mac OS X 10.5 uses a new constant NSChangeRedone here, but * old applications are not prepared to handle this constant * and expect NSChangeDone instead. */ [self updateChangeCount: NSChangeDone]; } @end gnustep-gui-0.24.0/Source/NSColorPicker.m0000664000076500007650000000545111376454556020062 0ustar brains99brains99/** NSColorPicker Abstract superclass for NSColorPanel color pickers Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Jonathan Gapen Date: March 2000 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import #import "AppKit/NSButtonCell.h" #import "AppKit/NSColorList.h" #import "AppKit/NSColorPanel.h" #import "AppKit/NSColorPicker.h" #import "AppKit/NSImage.h" @implementation NSColorPicker // // Class methods // + (void)initialize { if (self == [NSColorPicker class]) { // Initial version [self setVersion:1]; } } // // Instance methods // // // Initializing an NSColorPicker // - (id)initWithPickerMask:(int)aMask colorPanel:(NSColorPanel *)colorPanel { ASSIGN(_colorPanel, colorPanel); return self; } // // Getting the Color Panel // - (NSColorPanel *)colorPanel { return _colorPanel; } // // Adding Button Images // - (void)insertNewButtonImage:(NSImage *)newImage in:(NSButtonCell *)newButtonCell { [newButtonCell setImage: newImage]; } - (NSImage *)provideNewButtonImage { Class myClass = [self class]; NSBundle *bundle = [NSBundle bundleForClass: myClass]; NSString *file = [bundle pathForResource: NSStringFromClass(myClass) ofType:@"tiff"]; return AUTORELEASE([[NSImage alloc] initWithContentsOfFile: file]); } // // Setting the Mode // - (void)setMode:(int)mode {} // does nothing; override // // Using Color Lists // - (void)attachColorList:(NSColorList *)colorList {} // does nothing; override - (void)detachColorList:(NSColorList *)colorList {} // does nothing; override // // Showing Opacity Controls // - (void)alphaControlAddedOrRemoved:(id)sender {} // does nothing; override // // Responding to a Resized View // - (void)viewSizeChanged:(id)sender {} // does nothing; override @end gnustep-gui-0.24.0/Source/NSColorList.m0000664000076500007650000004225112121417516017537 0ustar brains99brains99/** NSColorList Manage named lists of NSColors. Copyright (C) 1996, 2000 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Nicola Pero Date: January 2000 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import #import #import #import #import #import #import #import #import #import #import "AppKit/NSColorList.h" #import "AppKit/NSColor.h" #import "AppKit/AppKitExceptions.h" // The list of available color lists is cached and re-loaded only // after a time. static NSMutableArray *_availableColorLists = nil; static NSLock *_colorListLock = nil; static NSColorList *defaultSystemColorList = nil; static NSColorList *themeColorList = nil; @interface NSColorList (GNUstepPrivate) /* Loads the available color lists from standard directories.
* If called with a nil argument, this will check to see if the * lists have already been loaded, and only load if they haven't been. */ + (void) _loadAvailableColorLists: (NSNotification*)aNotification; /* Set the default system color list ... to be used if no system color * list has been loaded from file. This should always be the last of * the array of available color lists even though it has noit been * written to file. */ + (void) _setDefaultSystemColorList: (NSColorList*)aList; /* Set the theme system color list ... if this is not nil, it is placed * at the start of the array of available lists and is used as the system * color list. */ + (void) _setThemeSystemColorList: (NSColorList*)aList; @end @implementation NSColorList // // Class methods // + (void) initialize { if (self == [NSColorList class]) { [self setVersion: 2]; _colorListLock = (NSLock *)[NSRecursiveLock new]; } } /* * Getting All Color Lists */ + (NSArray*) availableColorLists { NSArray *a; // Serialize access to color list [_colorListLock lock]; [NSColor whiteColor]; // NB This ensures that the System color list is defined [NSColorList _loadAvailableColorLists: nil]; a = [NSArray arrayWithArray: _availableColorLists]; [_colorListLock unlock]; return a; } /* * Getting a Color List by Name */ + (NSColorList *) colorListNamed: (NSString *)name { NSColorList *r; NSEnumerator *e; // Serialize access to color list [_colorListLock lock]; [NSColorList _loadAvailableColorLists: nil]; e = [_availableColorLists objectEnumerator]; while ((r = (NSColorList *)[e nextObject]) != nil) { if ([[r name] isEqualToString: name]) { RETAIN(r); break; } } [_colorListLock unlock]; return AUTORELEASE(r); } /* * Instance methods */ /* * Private method for reading text color list files, with following format: * first line = <#/colors> * each subsequent line describes a color as * the first int describes the method (ARGB, etc.), the floats * provide its arguments (e.g., r, g, b, alpha), and string is name. */ - (BOOL) _readTextColorFile: (NSString *) filepath { int nColors; int method; float r; float g; float b; float alpha; NSString *cname; int i; BOOL st; NSColor *color; NSCharacterSet *newlineSet = [NSCharacterSet characterSetWithCharactersInString: @"\n"]; NSScanner *scanner = [NSScanner scannerWithString: [NSString stringWithContentsOfFile: _fullFileName]]; if ([scanner scanInt: &nColors] == NO) { NSLog(@"Unable to read color file at \"%@\" -- unknown format.", _fullFileName); return NO; } for (i = 0; i < nColors; i++) { if ([scanner scanInt: &method] == NO) { NSLog(@"Unable to read color file at \"%@\" -- unknown format.", _fullFileName); break; } //FIXME- replace this by switch on method to different // NSColor initializers if (method != 0) { NSLog(@"Unable to read color file at \"%@\" -- only RGBA form " @"supported.", _fullFileName); break; } st = [scanner scanFloat: &r]; st = st && [scanner scanFloat: &g]; st = st && [scanner scanFloat: &b]; st = st && [scanner scanFloat: &alpha]; st = st && [scanner scanUpToCharactersFromSet: newlineSet intoString: &cname]; if (st == NO) { NSLog(@"Unable to read color file at \"%@\" -- unknown format.", _fullFileName); break; } color = [NSColor colorWithCalibratedRed: r green: g blue: b alpha: alpha]; [self insertColor: color key: cname atIndex: i]; } return i == nColors; } - (id) initWithName: (NSString *)name { return [self initWithName: name fromFile: nil]; } - (id) initWithName: (NSString *)name fromFile: (NSString *)path { NSColorList *cl; BOOL could_load = NO; ASSIGN (_name, name); if (path != nil) { BOOL isDir = NO; // previously impl wrongly expected directory containing color file // rather than color file; we support this for apps that rely on it if (([[NSFileManager defaultManager] fileExistsAtPath: path isDirectory: &isDir] == NO) || (isDir == YES)) { NSLog(@"NSColorList -initWithName:fromFile: warning: excluding " @"filename from path (%@) is deprecated.", path); ASSIGN (_fullFileName, [[path stringByAppendingPathComponent: name] stringByAppendingPathExtension: @"clr"]); } else { ASSIGN (_fullFileName, path); } // Unarchive the color list // TODO [Optm]: Rewrite to initialize directly without unarchiving // in another object NS_DURING { cl = (NSColorList*)[NSUnarchiver unarchiveObjectWithFile: _fullFileName]; } NS_HANDLER { cl = nil; } NS_ENDHANDLER ; if (cl && [cl isKindOfClass: [NSColorList class]]) { could_load = YES; _is_editable = [[NSFileManager defaultManager] isWritableFileAtPath: _fullFileName]; ASSIGN(_colorDictionary, [NSMutableDictionary dictionaryWithDictionary: cl->_colorDictionary]); ASSIGN(_orderedColorKeys, [NSMutableArray arrayWithArray: cl->_orderedColorKeys]); } else if ([[NSFileManager defaultManager] fileExistsAtPath: path]) { _colorDictionary = [[NSMutableDictionary alloc] init]; _orderedColorKeys = [[NSMutableArray alloc] init]; _is_editable = YES; if ([self _readTextColorFile: _fullFileName]) { could_load = YES; _is_editable = [[NSFileManager defaultManager] isWritableFileAtPath: _fullFileName]; } else { RELEASE (_colorDictionary); RELEASE (_orderedColorKeys); } } } if (could_load == NO) { _fullFileName = nil; _colorDictionary = [[NSMutableDictionary alloc] init]; _orderedColorKeys = [[NSMutableArray alloc] init]; _is_editable = YES; } return self; } - (void) dealloc { RELEASE (_name); TEST_RELEASE (_fullFileName); RELEASE (_colorDictionary); RELEASE (_orderedColorKeys); [super dealloc]; } /* * Getting a Color List by Name */ - (NSString *) name { return _name; } /* * Managing Colors by Key */ - (NSArray *) allKeys { return [NSArray arrayWithArray: _orderedColorKeys]; } - (NSColor *) colorWithKey: (NSString *)key { return [_colorDictionary objectForKey: key]; } - (void) insertColor: (NSColor *)color key: (NSString *)key atIndex: (unsigned)location { NSNotification *n; if (_is_editable == NO) [NSException raise: NSColorListNotEditableException format: @"Color list cannot be edited\n"]; [_colorDictionary setObject: color forKey: key]; [_orderedColorKeys removeObject: key]; [_orderedColorKeys insertObject: key atIndex: location]; n = [NSNotification notificationWithName: NSColorListDidChangeNotification object: self userInfo: nil]; [[NSNotificationQueue defaultQueue] enqueueNotification: n postingStyle: NSPostASAP coalesceMask: NSNotificationCoalescingOnSender forModes: nil]; } - (void) removeColorWithKey: (NSString *)key { NSNotification *n; if (_is_editable == NO) [NSException raise: NSColorListNotEditableException format: @"Color list cannot be edited\n"]; [_colorDictionary removeObjectForKey: key]; [_orderedColorKeys removeObject: key]; n = [NSNotification notificationWithName: NSColorListDidChangeNotification object: self userInfo: nil]; [[NSNotificationQueue defaultQueue] enqueueNotification: n postingStyle: NSPostASAP coalesceMask: NSNotificationCoalescingOnSender forModes: nil]; } - (void) setColor: (NSColor *)aColor forKey: (NSString *)key { NSNotification *n; if (_is_editable == NO) [NSException raise: NSColorListNotEditableException format: @"Color list cannot be edited\n"]; [_colorDictionary setObject: aColor forKey: key]; if ([_orderedColorKeys containsObject: key] == NO) [_orderedColorKeys addObject: key]; n = [NSNotification notificationWithName: NSColorListDidChangeNotification object: self userInfo: nil]; [[NSNotificationQueue defaultQueue] enqueueNotification: n postingStyle: NSPostASAP coalesceMask: NSNotificationCoalescingOnSender forModes: nil]; } /* * Editing */ - (BOOL) isEditable { return _is_editable; } /* * Writing and Removing Files */ - (BOOL) writeToFile: (NSString *)path { NSFileManager *fm = [NSFileManager defaultManager]; NSString *tmpPath; BOOL isDir; BOOL success; BOOL path_is_standard = YES; /* * We need to initialize before saving, to avoid the new file being * counted as a different list thus making us appear twice */ [NSColorList _loadAvailableColorLists: nil]; if (path == nil) { NSArray *paths; // FIXME the standard path for saving color lists? paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); if ([paths count] == 0) { NSLog (@"Failed to find Library directory for user"); return NO; // No directory to save to. } path = [[paths objectAtIndex: 0] stringByAppendingPathComponent: @"Colors"]; isDir = YES; } else { [fm fileExistsAtPath: path isDirectory: &isDir]; } if (isDir) { ASSIGN (_fullFileName, [[path stringByAppendingPathComponent: _name] stringByAppendingPathExtension: @"clr"]); } else // it is a file { if ([[path pathExtension] isEqual: @"clr"] == YES) { ASSIGN (_fullFileName, path); } else { ASSIGN (_fullFileName, [[path stringByDeletingPathExtension] stringByAppendingPathExtension: @"clr"]); } path = [path stringByDeletingLastPathComponent]; } // Check if the path is a standard path if ([[path lastPathComponent] isEqualToString: @"Colors"] == NO) { path_is_standard = NO; } else { tmpPath = [path stringByDeletingLastPathComponent]; if (![NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSAllDomainsMask, YES) containsObject: tmpPath]) { path_is_standard = NO; } } /* * If path is standard and it does not exist, try to create it. * System standard paths should always be assumed to exist; * this will normally then only try to create user paths. */ if (path_is_standard && ([fm fileExistsAtPath: path] == NO)) { if ([fm createDirectoryAtPath: path withIntermediateDirectories: YES attributes: nil error: NULL]) { NSLog (@"Created standard directory %@", path); } else { NSLog (@"Failed attempt to create directory %@", path); } } success = [NSArchiver archiveRootObject: self toFile: _fullFileName]; if (success && path_is_standard) { [_colorListLock lock]; if ([_availableColorLists containsObject: self] == NO) [_availableColorLists addObject: self]; [_colorListLock unlock]; return YES; } return success; } - (void) removeFile { if (_fullFileName && _is_editable) { // Remove the file [[NSFileManager defaultManager] removeFileAtPath: _fullFileName handler: nil]; // Remove the color list from the global list of colors [_colorListLock lock]; [_availableColorLists removeObject: self]; [_colorListLock unlock]; // Reset file name _fullFileName = nil; } } - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { // FIXME } else { [aCoder encodeObject: _name]; [aCoder encodeObject: _colorDictionary]; [aCoder encodeObject: _orderedColorKeys]; } } - (id) initWithCoder: (NSCoder*)aDecoder { if ([aDecoder allowsKeyedCoding]) { // FIXME } else { [aDecoder decodeValueOfObjCType: @encode(id) at: &_name]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_colorDictionary]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_orderedColorKeys]; } return self; } @end @implementation NSColorList (GNUstepPrivate) + (void) _loadAvailableColorLists: (NSNotification*)aNotification { [_colorListLock lock]; /* FIXME ... we should ensure that we get housekeeping notifications */ if (_availableColorLists != nil && aNotification == nil) { // Nothing to do ... already loaded [_colorListLock unlock]; } else { NSString *dir; NSString *file; NSEnumerator *e; NSFileManager *fm = [NSFileManager defaultManager]; NSDirectoryEnumerator *de; NSColorList *newList; if (_availableColorLists == nil) { // Create the global array of color lists _availableColorLists = [[NSMutableArray alloc] init]; } else { [_availableColorLists removeAllObjects]; } /* * Keep any pre-loaded system color list. */ if (themeColorList != nil) { [_availableColorLists addObject: themeColorList]; } /* * Load color lists found in standard paths into the array * FIXME: Check exactly where in the directory tree we should scan. */ e = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSAllDomainsMask, YES) objectEnumerator]; while ((dir = (NSString *)[e nextObject])) { BOOL flag; dir = [dir stringByAppendingPathComponent: @"Colors"]; if (![fm fileExistsAtPath: dir isDirectory: &flag] || !flag) { // Only process existing directories continue; } de = [fm enumeratorAtPath: dir]; while ((file = [de nextObject])) { if ([[file pathExtension] isEqualToString: @"clr"]) { NSString *name; name = [file stringByDeletingPathExtension]; newList = [[NSColorList alloc] initWithName: name fromFile: [dir stringByAppendingPathComponent: file]]; [_availableColorLists addObject: newList]; RELEASE(newList); } } } if (defaultSystemColorList != nil) { [_availableColorLists addObject: defaultSystemColorList]; } [_colorListLock unlock]; } } + (void) _setDefaultSystemColorList: (NSColorList*)aList { [_colorListLock lock]; if (defaultSystemColorList != aList) { if (defaultSystemColorList != nil && [_availableColorLists lastObject] == defaultSystemColorList) { [_availableColorLists removeLastObject]; } ASSIGN(defaultSystemColorList, aList); [_availableColorLists addObject: aList]; } [_colorListLock unlock]; } + (void) _setThemeSystemColorList: (NSColorList*)aList { [_colorListLock lock]; if (themeColorList != aList) { if (themeColorList != nil && [_availableColorLists count] > 0 && [_availableColorLists objectAtIndex: 0] == themeColorList) { [_availableColorLists removeObjectAtIndex: 0]; } ASSIGN(themeColorList, aList); [_availableColorLists insertObject: aList atIndex: 0]; } [_colorListLock unlock]; } @end gnustep-gui-0.24.0/Source/NSToolbar.m0000664000076500007650000011522011732730660017231 0ustar brains99brains99/* NSToolbar.m The toolbar class. Copyright (C) 2002 Free Software Foundation, Inc. Author: Gregory John Casamento , Fabien Vallon , Quentin Mathe Date: May 2002 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import #import #import #import #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSEvent.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSMenu.h" #import "AppKit/NSNibLoading.h" #import "AppKit/NSToolbar.h" #import "AppKit/NSToolbarItem.h" #import "AppKit/NSView.h" #import "AppKit/NSWindow.h" #import "GNUstepGUI/GSToolbarView.h" #import "NSToolbarFrameworkPrivate.h" #import "GSToolbarCustomizationPalette.h" // internal static NSNotificationCenter *nc = nil; static NSMutableArray *toolbars = nil; static const int current_version = 1; // Validation stuff static const unsigned int ValidationInterval = 4; @class GSValidationCenter; // Mandatory because the interface is declared later static GSValidationCenter *vc = nil; // Extensions @interface NSArray (ObjectsWithValueForKey) - (NSArray *) objectsWithValue: (id)value forKey: (NSString *)key; @end @implementation NSArray (ObjectsWithValueForKey) - (NSArray *) objectsWithValue: (id)value forKey: (NSString *)key { NSMutableArray *result = [NSMutableArray array]; NSArray *keys = [self valueForKey: key]; int i, n = 0; if (keys == nil) return nil; n = [keys count]; for (i = 0; i < n; i++) { if ([[keys objectAtIndex: i] isEqual: value]) { [result addObject: [self objectAtIndex: i]]; } } if ([result count] == 0) return nil; return result; } @end /* * Validation support * * Validation support is architectured around a shared validation center, which * is our public interface to handle the validation, behind the scene each * window has an associated validation object created when an observer is added * to the validation center. * A validation object calls the _validate: method on the observer when the * mouse is inside the observed window and only in the case this window is * updated or in the case the mouse stays inside more than four seconds, then * the action will be reiterated every four seconds until the mouse exits. * A validation object owns a window to observe, a tracking rect attached to * the window root view to know when the mouse is inside, a timer to be able to * send the _validate: message periodically, and one ore more observers, then it * is necessary to supply with each registered observer an associated window to * observe. * In the case, an object would observe several windows, the _validate: has a * parameter observedWindow to let us know where the message is coming from. * Because we cannot know surely when a validation object is deallocated, a * method named clean has been added which permits to invalidate a validation * object which must not be used anymore, not calling it would let segmentation * faults occurs. */ @interface GSValidationObject : NSObject { NSWindow *_window; NSView *_trackingRectView; NSTrackingRectTag _trackingRect; NSMutableArray *_observers; NSTimer *_validationTimer; BOOL _inside; BOOL _validating; } - (NSMutableArray *) observers; - (void) setObservers: (NSMutableArray *)observers; - (NSWindow *) window; - (void) setWindow: (NSWindow *)window; - (void) validate; - (void) scheduledValidate; - (void) clean; @end @interface GSValidationCenter : NSObject { NSMutableArray *_vobjs; } + (GSValidationCenter *) sharedValidationCenter; - (NSArray *) observersWindow: (NSWindow *)window; - (void) addObserver: (id)observer window: (NSWindow *)window; - (void) removeObserver: (id)observer window: (NSWindow *)window; @end // Validation mechanism @interface NSWindow (GNUstepPrivate) - (NSView *) _windowView; @end @implementation GSValidationObject - (id) initWithWindow: (NSWindow *)window { if ((self = [super init]) != nil) { _observers = [[NSMutableArray alloc] init]; [nc addObserver: self selector: @selector(windowDidUpdate:) name: NSWindowDidUpdateNotification object: window]; [nc addObserver: vc selector: @selector(windowWillClose:) name: NSWindowWillCloseNotification object: window]; _trackingRectView = [window _windowView]; _trackingRect = [_trackingRectView addTrackingRect: [_trackingRectView bounds] owner: self userData: nil assumeInside: NO]; _window = window; } return self; } - (void) dealloc { // NSLog(@"vobj dealloc"); // [_trackingRectView removeTrackingRect: _trackingRect]; // Not here because the tracking rect retains us, then when the tracking rect // would be deallocated that would create a loop and a segmentation fault. // See next method. RELEASE(_observers); [super dealloc]; } - (void) clean { if ([_validationTimer isValid]) { [_validationTimer invalidate]; _validationTimer = nil; } [nc removeObserver: vc name: NSWindowWillCloseNotification object: _window]; [nc removeObserver: self name: NSWindowDidUpdateNotification object: _window]; [self setWindow: nil]; // Needed because the validation timer can retain us and by this way retain also the toolbar which is // currently observing. [self setObservers: nil]; // To release observers [_trackingRectView removeTrackingRect: _trackingRect]; // We can safely remove the tracking rect here, because it will never call // this method unlike dealloc. } /* * FIXME: Replace the deprecated method which follows by this one when -base * NSObject will implement it. * - (id) valueForUndefinedKey: (NSString *)key { if ([key isEqualToString: @"window"] || [key isEqualToString: @"_window"]) return nil; return [super valueForUndefinedKey: key]; } */ - (id) handleQueryWithUnboundKey: (NSString *)key { if ([key isEqualToString: @"window"] || [key isEqualToString: @"_window"]) return [NSNull null]; return [super handleQueryWithUnboundKey: key]; } - (NSMutableArray *) observers { return _observers; } - (void) setObservers: (NSMutableArray *)observers { ASSIGN(_observers, observers); } - (NSWindow *) window { return _window; } - (void) setWindow: (NSWindow *)window { _window = window; } - (void) validate { if (_validating == NO) { _validating = YES; NS_DURING { [_observers makeObjectsPerformSelector: @selector(_validate:) withObject: _window]; _validating = NO; } NS_HANDLER { _validating = NO; NSLog(@"Problem validating toolbar: %@", localException); } NS_ENDHANDLER } } - (void) mouseEntered: (NSEvent *)event { _inside = YES; [self scheduledValidate]; } - (void) mouseExited: (NSEvent *)event { _inside = NO; if ([_validationTimer isValid]) { [_validationTimer invalidate]; _validationTimer = nil; } } - (void) windowDidUpdate: (NSNotification *)notification { // Validate the toolbar for each update of the window. [self validate]; } - (void) scheduledValidate { if (!_inside) return; [self validate]; _validationTimer = [NSTimer timerWithTimeInterval: ValidationInterval target: self selector: @selector(scheduledValidate) userInfo: nil repeats: NO]; [[NSRunLoop currentRunLoop] addTimer: _validationTimer forMode: NSDefaultRunLoopMode]; } @end @implementation GSValidationCenter + (GSValidationCenter *) sharedValidationCenter { if (vc == nil) { if ((vc = [[GSValidationCenter alloc] init]) != nil) { // Nothing special } } return vc; } - (id) init { if ((self = [super init]) != nil) { _vobjs = [[NSMutableArray alloc] init]; } return self; } - (void) dealloc { [nc removeObserver: self]; RELEASE(_vobjs); [super dealloc]; } - (GSValidationObject *) validationObjectForWindow: (NSWindow*)w { return [[_vobjs objectsWithValue: w forKey: @"_window"] objectAtIndex: 0]; } - (NSArray *) observersWindow: (NSWindow *)window { int i; NSArray *observersArray; NSMutableArray *result; if (window == nil) { result = [NSMutableArray array]; observersArray = [_vobjs valueForKey: @"_observers"]; for (i = 0; i < [observersArray count]; i++) { [result addObjectsFromArray: [observersArray objectAtIndex: i]]; } return result; } else { return [[self validationObjectForWindow: window] observers]; } } - (void) addObserver: (id)observer window: (NSWindow *)window { GSValidationObject *vobj = [self validationObjectForWindow: window]; NSMutableArray *observersWindow = nil; if (window == nil) return; if (vobj != nil) { observersWindow = [vobj observers]; } else { vobj = [[GSValidationObject alloc] initWithWindow: window]; [_vobjs addObject: vobj]; RELEASE(vobj); observersWindow = [NSMutableArray array]; [vobj setObservers: observersWindow]; } [observersWindow addObject: observer]; } - (void) removeObserver: (id)observer window: (NSWindow *)window { GSValidationObject *vobj; NSMutableArray *observersWindow; NSMutableArray *windows; NSEnumerator *e; NSWindow *w; if (window == nil) { windows = [_vobjs valueForKey: @"_window"]; } else { windows = [NSArray arrayWithObject: window]; } e = [windows objectEnumerator]; while ((w = [e nextObject]) != nil) { vobj = [self validationObjectForWindow: w]; observersWindow = [vobj observers]; if (observersWindow != nil && [observersWindow containsObject: observer]) { [observersWindow removeObject: observer]; if ([observersWindow count] == 0) { [vobj clean]; [_vobjs removeObjectIdenticalTo: vobj]; } } } } - (void) windowWillClose: (NSNotification *)notification { GSValidationObject *vobj; // NSLog(@"Window will close"); vobj = [self validationObjectForWindow: [notification object]]; if (vobj != nil) { [vobj clean]; [_vobjs removeObjectIdenticalTo: vobj]; } } @end // --- @implementation NSToolbar // Class methods // Initialize the class when it is loaded + (void) initialize { if (self == [NSToolbar class]) { [self setVersion: current_version]; nc = [NSNotificationCenter defaultCenter]; vc = [GSValidationCenter sharedValidationCenter]; toolbars = [[NSMutableArray alloc] init]; } } // Private class method to access static variable toolbars in subclasses + (NSArray *) _toolbarsWithIdentifier: (NSString *)identifier { return [toolbars objectsWithValue: identifier forKey: @"_identifier"]; } // Instance methods - (id) initWithIdentifier: (NSString *)identifier { NSToolbar *toolbarModel = nil; if ((self = [super init]) == nil) return nil; ASSIGN(_identifier, identifier); _items = [[NSMutableArray alloc] init]; // Only set when loaded from a nib _interfaceBuilderItemsByIdentifier = nil; _interfaceBuilderAllowedItemIdentifiers = nil; _interfaceBuilderDefaultItemIdentifiers = nil; _interfaceBuilderSelectableItemIdentifiers = nil; toolbarModel = [self _toolbarModel]; if (toolbarModel != nil) { _customizationPaletteIsRunning = NO; _allowsUserCustomization = [toolbarModel allowsUserCustomization]; _autosavesConfiguration = [toolbarModel autosavesConfiguration]; ASSIGN(_configurationDictionary, [toolbarModel configurationDictionary]); _displayMode = [toolbarModel displayMode]; _sizeMode = [toolbarModel sizeMode]; _visible = [toolbarModel isVisible]; } else { _customizationPaletteIsRunning = NO; _allowsUserCustomization = NO; _autosavesConfiguration = NO; _configurationDictionary = nil; _displayMode = NSToolbarDisplayModeIconAndLabel; _sizeMode = NSToolbarSizeModeRegular; _visible = YES; } _delegate = nil; [self setShowsBaselineSeparator: YES]; // Store in list of toolbars [toolbars addObject: self]; return self; } - (NSArray *) _identifiersForItems: (NSArray*)items { NSMutableArray *result = [NSMutableArray arrayWithCapacity: [items count]]; NSEnumerator *e = [items objectEnumerator]; NSToolbarItem *item; if (items == nil) return nil; while ((item = [e nextObject]) != nil) { [result addObject: [item itemIdentifier]]; } return result; } - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { // FIXME } else { // FIXME } } - (id) initWithCoder: (NSCoder *)aCoder { if ([aCoder allowsKeyedCoding]) { ASSIGN(_identifier, [aCoder decodeObjectForKey:@"NSToolbarIdentifier"]); _items = [[NSMutableArray alloc] init]; ASSIGN(_interfaceBuilderItemsByIdentifier, [aCoder decodeObjectForKey: @"NSToolbarIBIdentifiedItems"]); ASSIGN(_interfaceBuilderAllowedItemIdentifiers, [self _identifiersForItems: [aCoder decodeObjectForKey: @"NSToolbarIBAllowedItems"]]); ASSIGN(_interfaceBuilderDefaultItemIdentifiers, [self _identifiersForItems: [aCoder decodeObjectForKey: @"NSToolbarIBDefaultItems"]]); ASSIGN(_interfaceBuilderSelectableItemIdentifiers, [self _identifiersForItems: [aCoder decodeObjectForKey: @"NSToolbarIBSelectableItems"]]); _customizationPaletteIsRunning = NO; _configurationDictionary = nil; [self setAllowsUserCustomization: [aCoder decodeBoolForKey: @"NSToolbarAllowsUserCustomization"]]; [self setAutosavesConfiguration: [aCoder decodeBoolForKey: @"NSToolbarAutosavesConfiguration"]]; [self setDisplayMode: [aCoder decodeIntForKey: @"NSToolbarDisplayMode"]]; [self setShowsBaselineSeparator: [aCoder decodeBoolForKey: @"NSToolbarShowsBaselineSeparator"]]; [self setSizeMode: [aCoder decodeIntForKey: @"NSToolbarSizeMode"]]; [self setVisible: [aCoder decodeBoolForKey: @"NSToolbarPrefersToBeShown"]]; [self setDelegate: [aCoder decodeObjectForKey: @"NSToolbarDelegate"]]; } else { // FIXME } // Store in list of toolbars [toolbars addObject: self]; return self; } - (void) dealloc { //NSLog(@"Toolbar dealloc %@", self); [self _setToolbarView: nil]; // Use DESTROY ? RELEASE(_identifier); RELEASE(_selectedItemIdentifier); RELEASE(_configurationDictionary); RELEASE(_items); DESTROY(_interfaceBuilderItemsByIdentifier); DESTROY(_interfaceBuilderAllowedItemIdentifiers); DESTROY(_interfaceBuilderDefaultItemIdentifiers); DESTROY(_interfaceBuilderSelectableItemIdentifiers); if (_delegate != nil) { [nc removeObserver: _delegate name: nil object: self]; _delegate = nil; } [super dealloc]; } // FIXME: Hack - (oneway void) release { // When a toolbar has no external references any more, it's necessary // to remove the toolbar from the master list, so that it // doesn't cause a memory leak. if ([self retainCount] == 2) [toolbars removeObjectIdenticalTo: self]; [super release]; } - (id) valueForUndefinedKey: (NSString *)key { if ([key isEqualToString: @"window"] || [key isEqualToString: @"_window"]) return nil; return [super valueForUndefinedKey: key]; } - (void) insertItemWithItemIdentifier: (NSString *)itemIdentifier atIndex: (NSInteger)index { [self _insertItemWithItemIdentifier: itemIdentifier atIndex: index broadcast: YES]; } - (void) removeItemAtIndex: (NSInteger)index { [self _removeItemAtIndex: index broadcast: YES]; } - (void) runCustomizationPalette: (id)sender { GSToolbarCustomizationPalette *palette; if (![self allowsUserCustomization]) { return; } if (_customizationPaletteIsRunning) { NSLog(@"Customization palette is already running for toolbar: %@", self); return; } palette = [GSToolbarCustomizationPalette palette]; if (palette != nil) _customizationPaletteIsRunning = YES; [palette showForToolbar: self]; } - (void) validateVisibleItems { NSEnumerator *e = [[self visibleItems] objectEnumerator]; NSToolbarItem *item = nil; while ((item = [e nextObject]) != nil) { [item validate]; } } // Accessors - (BOOL) allowsUserCustomization { return _allowsUserCustomization; } - (BOOL) autosavesConfiguration { return _autosavesConfiguration; } - (NSDictionary *) configurationDictionary { return _configurationDictionary; } - (BOOL) customizationPaletteIsRunning { return _customizationPaletteIsRunning; } - (void) _setCustomizationPaletteIsRunning: (BOOL)isRunning { _customizationPaletteIsRunning = isRunning; } - (id) delegate { return _delegate; } - (NSToolbarDisplayMode) displayMode { return _displayMode; } - (NSString *) identifier { return _identifier; } - (NSArray *) items { return _items; } - (NSString *) selectedItemIdentifier { return _selectedItemIdentifier; } - (BOOL) showsBaselineSeparator { return _showsBaselineSeparator; } - (NSArray *) visibleItems { if ([_toolbarView superview] == nil) { return nil; } else { return [[_toolbarView _visibleBackViews] valueForKey: @"toolbarItem"]; } } - (void) setAllowsUserCustomization: (BOOL)flag { [self _setAllowsUserCustomization: flag broadcast: YES]; } - (void) setAutosavesConfiguration: (BOOL)flag { [self _setAutosavesConfiguration: flag broadcast: YES]; } - (void) setConfigurationFromDictionary: (NSDictionary *)configDict { int i = 0; id item = nil; NSArray *items = nil; NSEnumerator *en = nil; ASSIGN(_configurationDictionary, configDict); // set _visible = [[_configurationDictionary objectForKey: @"isVisible"] boolValue]; _displayMode = [[_configurationDictionary objectForKey: @"displayMode"] intValue]; // remove all items... for(i = 0; i < [_items count]; i++) { [self _removeItemAtIndex: 0 broadcast: YES]; } // add all of the items... i = 0; items = [_configurationDictionary objectForKey: @"items"]; en = [items objectEnumerator]; while((item = [en nextObject]) != nil) { [self _insertItemWithItemIdentifier: item atIndex: i++ broadcast: YES]; } } /** * Sets the receivers delegate ... this is the object which will receive * -toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar: * -toolbarAllowedItemIdentifiers: and -toolbarDefaultItemIdentifiers: * messages. */ - (void) setDelegate: (id)delegate { if (_delegate == delegate) return; if (_delegate != nil) [nc removeObserver: _delegate name: nil object: self]; // Assign the delegate... _delegate = delegate; if (_delegate != nil) { #define CHECK_REQUIRED_METHOD(selector_name) \ if (![_delegate respondsToSelector: @selector(selector_name)]) \ [NSException raise: NSInternalInconsistencyException \ format: @"delegate does not respond to %@",@#selector_name] if (_interfaceBuilderItemsByIdentifier == nil) { CHECK_REQUIRED_METHOD(toolbar:itemForItemIdentifier: willBeInsertedIntoToolbar:); } if (_interfaceBuilderAllowedItemIdentifiers == nil) { CHECK_REQUIRED_METHOD(toolbarAllowedItemIdentifiers:); } if (_interfaceBuilderDefaultItemIdentifiers == nil) { CHECK_REQUIRED_METHOD(toolbarDefaultItemIdentifiers:); } #define SET_DELEGATE_NOTIFICATION(notif_name) \ if ([_delegate respondsToSelector: @selector(toolbar##notif_name:)]) \ [nc addObserver: _delegate \ selector: @selector(toolbar##notif_name:) \ name: NSToolbar##notif_name##Notification object: self] SET_DELEGATE_NOTIFICATION(DidRemoveItem); SET_DELEGATE_NOTIFICATION(WillAddItem); } [self _build]; } - (NSArray *) _selectableItemIdentifiers { NSArray *selectableIdentifiers = nil; if (_delegate != nil && [_delegate respondsToSelector: @selector(toolbarSelectableItemIdentifiers:)]) { selectableIdentifiers = [_delegate toolbarSelectableItemIdentifiers: self]; if (selectableIdentifiers == nil) { NSLog(@"Toolbar delegate returns no such selectable item identifiers"); } } if (selectableIdentifiers == nil) { selectableIdentifiers = _interfaceBuilderSelectableItemIdentifiers; } return selectableIdentifiers; } - (void) setSelectedItemIdentifier: (NSString *)identifier { NSArray *selectedItems; NSArray *itemsToSelect; NSEnumerator *e; NSToolbarItem *item; NSArray *selectableIdentifiers; BOOL updated = NO; // First, we have to deselect the previous selected toolbar items selectedItems = [[self items] objectsWithValue: [self selectedItemIdentifier] forKey: @"_itemIdentifier"]; e = [selectedItems objectEnumerator]; while ((item = [e nextObject]) != nil) { [item _setSelected: NO]; } selectableIdentifiers = [self _selectableItemIdentifiers]; if (selectableIdentifiers == nil) return; itemsToSelect = [_items objectsWithValue: identifier forKey: @"_itemIdentifier"]; e = [itemsToSelect objectEnumerator]; while ((item = [e nextObject]) != nil) { if ([selectableIdentifiers containsObject: [item itemIdentifier]]) { if (![item _selected]) [item _setSelected: YES]; updated = YES; } } if (updated) { ASSIGN(_selectedItemIdentifier, identifier); } else { NSLog(@"Toolbar delegate returns no such selectable item identifiers"); } } - (NSToolbarSizeMode) sizeMode { return _sizeMode; } - (BOOL) isVisible { return _visible; } /** * Sets the receivers delegate ... this is the object which will receive * -toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar: * -toolbarAllowedItemIdentifiers: and -toolbarDefaultItemIdentifiers: * messages. */ - (void) setDisplayMode: (NSToolbarDisplayMode)displayMode { [self _setDisplayMode: displayMode broadcast: YES]; } - (void) setSizeMode: (NSToolbarSizeMode)sizeMode { [self _setSizeMode: sizeMode broadcast: YES]; } - (void) setVisible: (BOOL)shown { [self _setVisible: shown broadcast: NO]; } - (void) setShowsBaselineSeparator: (BOOL)flag { _showsBaselineSeparator = flag; if (_showsBaselineSeparator) [_toolbarView setBorderMask: GSToolbarViewBottomBorder]; else [_toolbarView setBorderMask: 0]; } // Private methods - (NSArray *) _defaultItemIdentifiers { if (_delegate != nil) { return [_delegate toolbarDefaultItemIdentifiers:self]; } else { return _interfaceBuilderDefaultItemIdentifiers; } } /* * Toolbar build : * will use the delegate when there is no toolbar model */ - (void) _build { NSToolbar *toolbarModel; NSArray *wantedItemIdentifiers; NSEnumerator *e; id itemIdentifier; int i = 0; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSString *tableKey = [NSString stringWithFormat: @"NSToolbar Config %@",_identifier]; NSDictionary *config = [defaults objectForKey: tableKey]; if (config) { NSToolbarDisplayMode displayMode = 0; NSToolbarSizeMode sizeMode = 0; displayMode = (NSToolbarDisplayMode)[[config objectForKey: @"displayMode"] intValue]; [self setDisplayMode: displayMode]; sizeMode = (NSToolbarSizeMode)[[config objectForKey: @"sizeMode"] intValue]; [self setSizeMode: sizeMode]; } // Switch off toolbar view reload _build = YES; RELEASE(_items); _items = [[NSMutableArray alloc] init]; toolbarModel = [self _toolbarModel]; wantedItemIdentifiers = [self _itemsFromConfig]; if(wantedItemIdentifiers == nil) { if (toolbarModel != nil) { wantedItemIdentifiers = [[toolbarModel items] valueForKey: @"_itemIdentifier"]; } else { wantedItemIdentifiers = [self _defaultItemIdentifiers]; } } if (wantedItemIdentifiers == nil) { _build = NO; return; } e = [wantedItemIdentifiers objectEnumerator]; while ((itemIdentifier = [e nextObject]) != nil) { [self _insertItemWithItemIdentifier: itemIdentifier atIndex: [_items count] broadcast: NO]; i++; } _build = NO; // Now do the toolbar view reload if (_toolbarView != nil) [_toolbarView _reload]; } - (void) _resetConfig { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSString *tableKey = [NSString stringWithFormat: @"NSToolbar Config %@",_identifier]; [defaults removeObjectForKey: tableKey]; [self _build]; } - (BOOL) usesStandardBackgroundColor { return [_toolbarView _usesStandardBackgroundColor]; } - (void) setUsesStandardBackgroundColor: (BOOL)standard { [_toolbarView _setUsesStandardBackgroundColor: standard]; } - (int) _indexOfItem: (NSToolbarItem *)item { return [_items indexOfObjectIdenticalTo: item]; } - (void) _insertPassivelyItem: (NSToolbarItem *)item atIndex: (int)newIndex { if (![_items containsObject: item]) { if (newIndex > [_items count] - 1) { newIndex = [_items count] - 1; } else if(newIndex < 0) { newIndex = 0; } [_items insertObject: item atIndex: newIndex]; } else { NSLog(@"Error: the toolbar already contains the item to insert."); } } - (void) _saveConfig { if (_identifier != nil) { NSUserDefaults *defaults; NSString *tableKey; id config; NSMutableArray *items = [NSMutableArray array]; id item; NSEnumerator *en = [_items objectEnumerator]; defaults = [NSUserDefaults standardUserDefaults]; tableKey = [NSString stringWithFormat: @"NSToolbar Config %@",_identifier]; config = [defaults objectForKey: tableKey]; if (config == nil) { config = [NSMutableDictionary dictionary]; } else { config = [config mutableCopy]; } [config setObject: [NSNumber numberWithBool: _visible] forKey: @"isVisible"]; [config setObject: [NSNumber numberWithInt: _displayMode] forKey: @"displayMode"]; [config setObject: [NSNumber numberWithInt: _sizeMode] forKey: @"sizeMode"]; while((item = [en nextObject]) != nil) { [items addObject: [item itemIdentifier]]; } [config setObject: items forKey: @"items"]; // write to defaults [defaults setObject: config forKey: tableKey]; ASSIGN(_configurationDictionary, config); } } - (BOOL) _containsItemWithIdentifier: (NSString *)identifier { NSEnumerator *en = [_items objectEnumerator]; id item = nil; while((item = [en nextObject]) != nil) { if([identifier isEqual: [item itemIdentifier]]) { return YES; } } return NO; } - (NSArray *) _itemsFromConfig { NSArray *items = nil; if (_identifier != nil) { NSUserDefaults *defaults; NSString *tableKey; id config; defaults = [NSUserDefaults standardUserDefaults]; tableKey = [NSString stringWithFormat: @"NSToolbar Config %@",_identifier]; config = [defaults objectForKey: tableKey]; if (config != nil) { items = [config objectForKey: @"items"]; } } return items; } - (NSToolbar *) _toolbarModel { NSArray *linked; id toolbar; linked = [[self class] _toolbarsWithIdentifier: [self identifier]]; if (linked != nil && [linked count] > 0) { toolbar = [linked objectAtIndex: 0]; // Toolbar model class must be identical to self class : // an NSToolbar instance cannot use a NSToolbar instance as a model if ([toolbar isMemberOfClass: [self class]] && toolbar != self) return toolbar; else return nil; } return nil; } - (NSToolbarItem *) _toolbarItemForIdentifier: (NSString *)itemIdent willBeInsertedIntoToolbar: (BOOL)insert { NSToolbarItem *item = nil; if ([itemIdent isEqual: NSToolbarSeparatorItemIdentifier] || [itemIdent isEqual: NSToolbarSpaceItemIdentifier] || [itemIdent isEqual: NSToolbarFlexibleSpaceItemIdentifier] || [itemIdent isEqual: NSToolbarShowColorsItemIdentifier] || [itemIdent isEqual: NSToolbarShowFontsItemIdentifier] || [itemIdent isEqual: NSToolbarCustomizeToolbarItemIdentifier] || [itemIdent isEqual: NSToolbarPrintItemIdentifier]) { item = [[[NSToolbarItem alloc] initWithItemIdentifier: itemIdent] autorelease]; } if (item == nil && _delegate != nil) { item = [_delegate toolbar: self itemForItemIdentifier: itemIdent willBeInsertedIntoToolbar: insert]; } if (item == nil && _interfaceBuilderItemsByIdentifier) { item = [_interfaceBuilderItemsByIdentifier objectForKey: itemIdent]; } return item; } /* * * The methods below handles the toolbar edition and broadcasts each associated * event to the other toolbars with identical identifiers. * Warning : broadcast process only happens between instances based on the same * class. */ #define TRANSMIT(signature) \ NSEnumerator *e = [[NSToolbar _toolbarsWithIdentifier: _identifier] objectEnumerator]; \ NSToolbar *toolbar; \ \ while ((toolbar = [e nextObject]) != nil) \ { \ if (toolbar != self && [self isMemberOfClass: [self class]]) \ [toolbar signature]; \ } \ - (NSArray *) _allowedItemIdentifiers { if (_delegate) { return [_delegate toolbarAllowedItemIdentifiers: self]; } else { return _interfaceBuilderAllowedItemIdentifiers; } } - (void) _insertItemWithItemIdentifier: (NSString *)itemIdentifier atIndex: (int)index broadcast: (BOOL)broadcast { NSToolbarItem *item = nil; NSArray *allowedItems = [self _allowedItemIdentifiers]; if ([allowedItems containsObject: itemIdentifier]) { item = [self _toolbarItemForIdentifier: itemIdentifier willBeInsertedIntoToolbar: YES]; if (item != nil) { NSArray *selectableItems = [self _selectableItemIdentifiers]; if ([selectableItems containsObject: itemIdentifier]) [item _setSelectable: YES]; [nc postNotificationName: NSToolbarWillAddItemNotification object: self userInfo: [NSDictionary dictionaryWithObject: item forKey: @"item"]]; [item _setToolbar: self]; [item _layout]; [_items insertObject: item atIndex: index]; // We reload the toolbarView each time a new item is added except when // we build/create the toolbar if (!_build) [_toolbarView _reload]; if (broadcast) { TRANSMIT(_insertItemWithItemIdentifier: itemIdentifier atIndex: index broadcast: NO); } } } } - (void) _removeItemAtIndex: (int)index broadcast: (BOOL)broadcast { id item = [_items objectAtIndex: index]; RETAIN(item); [self _performRemoveItem: item]; [self _concludeRemoveItem: item atIndex: index broadcast: broadcast]; RELEASE(item); } - (void) _performRemoveItem: (NSToolbarItem *)item { [_items removeObject: item]; [_toolbarView _reload]; [self _saveConfig]; } - (void) _concludeRemoveItem: (NSToolbarItem *)item atIndex: (int)index broadcast: (BOOL)broadcast { [nc postNotificationName: NSToolbarDidRemoveItemNotification object: self userInfo: [NSDictionary dictionaryWithObject: item forKey: @"item"]]; if (broadcast) { TRANSMIT(_removeItemAtIndex: index broadcast: NO); } } - (void) _setAllowsUserCustomization: (BOOL)flag broadcast: (BOOL)broadcast { _allowsUserCustomization = flag; if (broadcast) { TRANSMIT(_setAllowsUserCustomization: _allowsUserCustomization broadcast: NO); } } - (void) _setAutosavesConfiguration: (BOOL)flag broadcast: (BOOL)broadcast { _autosavesConfiguration = flag; if (broadcast) { TRANSMIT(_setAutosavesConfiguration: _autosavesConfiguration broadcast: NO); } } - (void) _setConfigurationFromDictionary: (NSDictionary *)configDict broadcast: (BOOL)broadcast { ASSIGN(_configurationDictionary, configDict); if (broadcast) { TRANSMIT(_setConfigurationFromDictionary: _configurationDictionary broadcast: NO); } } - (void) _moveItemFromIndex: (int)index toIndex: (int)newIndex broadcast: (BOOL)broadcast { id item; item = RETAIN([_items objectAtIndex: index]); [_items removeObjectAtIndex: index]; if (newIndex > [_items count] - 1) { [_items addObject: item]; } else { [_items insertObject: item atIndex: newIndex]; } [_toolbarView _reload]; RELEASE(item); if (broadcast) { TRANSMIT(_moveItemFromIndex: index toIndex: newIndex broadcast: NO); } } - (void) _setDisplayMode: (NSToolbarDisplayMode)displayMode broadcast: (BOOL)broadcast { if (_displayMode != displayMode) { _displayMode = displayMode; if ([self isVisible]) { [_toolbarView _reload]; [(id)[[_toolbarView window] _windowView] adjustToolbarView: _toolbarView]; } if (broadcast) { TRANSMIT(_setDisplayMode: _displayMode broadcast: NO); } } } - (void) _setSizeMode: (NSToolbarSizeMode)sizeMode broadcast: (BOOL)broadcast { if (_sizeMode != sizeMode) { _sizeMode = sizeMode; if ([self isVisible]) { [_toolbarView _reload]; [(id)[[_toolbarView window] _windowView] adjustToolbarView: _toolbarView]; } if (broadcast) { TRANSMIT(_setSizeMode: _sizeMode broadcast: NO); } } } - (NSWindow*) _window { NSWindow *window = [_toolbarView window]; NSEnumerator *wenum; if (window) return window; wenum = [GSAllWindows() objectEnumerator]; while ((window = [wenum nextObject])) { if ([window toolbar] == self) return window; } return nil; } - (void) _setVisible: (BOOL)shown broadcast: (BOOL)broadcast { if (_visible != shown) { _visible = shown; if (shown) [self _build]; if (shown) { if ((_toolbarView == nil) || ([_toolbarView superview] == nil)) { NSWindow *w = [self _window]; [(id)[w _windowView] addToolbarView: [self _toolbarView]]; } } else { if ((_toolbarView != nil) && ([_toolbarView superview] != nil)) { NSWindow *w = [self _window]; [(id)[w _windowView] removeToolbarView: [self _toolbarView]]; } } if (broadcast) { TRANSMIT(_setVisible: _visible broadcast: NO); } } } // Private Accessors - (void) _setToolbarView: (GSToolbarView *)toolbarView { if (_toolbarView == toolbarView) return; if (_toolbarView != nil) { // We unset the toolbar from the previous toolbar view [_toolbarView setToolbar: nil]; [vc removeObserver: self window: nil]; } ASSIGN(_toolbarView, toolbarView); if (toolbarView != nil) { // In the case the window parameter is a nil value, nothing happens. [vc addObserver: self window: [toolbarView window]]; // We set the toolbar on the new toolbar view [_toolbarView setToolbar: self]; } } - (GSToolbarView *) _toolbarView { if (_toolbarView == nil) { // Instantiate the toolbar view // addToolbarView: method will set the toolbar view to the right // frame GSToolbarView *toolbarView = [[GSToolbarView alloc] initWithFrame: NSMakeRect(0, 0, 100, 100)]; [toolbarView setAutoresizingMask: NSViewWidthSizable | NSViewMinYMargin]; if (_showsBaselineSeparator) [toolbarView setBorderMask: GSToolbarViewBottomBorder]; else [toolbarView setBorderMask: 0]; // Load the toolbar view inside the toolbar _toolbarView = toolbarView; [_toolbarView setToolbar: self]; } return _toolbarView; } - (void) _toolbarViewWillMoveToSuperview: (NSView *)newSuperview { // Must synchronize the validation system // _toolbarView should never be nil here // We don't handle synchronization when the toolbar view is added to a superview not // binded to a window, such superview being later moved to a window. (FIX ME ?) // NSLog(@"Moving to window %@", [newSuperview window]); [vc removeObserver: self window: nil]; if (newSuperview != nil) [vc addObserver: self window: [newSuperview window]]; } - (void) _validate: (NSWindow *)observedWindow { // We observe only one window, then we ignore observedWindow. [self validateVisibleItems]; } @end gnustep-gui-0.24.0/Source/NSStepperCell.m0000664000076500007650000002500211537516710020050 0ustar brains99brains99/** NSStepperCell Copyright (C) 2001 Free Software Foundation, Inc. Author: Pierre-Yves Rivaille Date: 2001 Author: Fred Kiefer Date: August 2006 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import #import "AppKit/NSApplication.h" #import "AppKit/NSControl.h" #import "AppKit/NSEvent.h" #import "AppKit/NSStepperCell.h" #import "AppKit/NSWindow.h" #import "GNUstepGUI/GSTheme.h" @interface NSStepperCell (Private) - (void) _increment; - (void) _decrement; - (void) setHighlighted: (BOOL)highlight upButton: (BOOL)upButton withFrame: (NSRect)frame inView: (NSView*)controlView; @end @implementation NSStepperCell + (void) initialize { if (self == [NSStepperCell class]) { [self setVersion: 1]; } } + (BOOL) prefersTrackingUntilMouseUp { return YES; } // // Initialization // - (id) init { self = [super init]; if (!self) return nil; [self setIntValue: 0]; [self setAlignment: NSRightTextAlignment]; [self setWraps: NO]; _autorepeat = YES; _valueWraps = YES; [self setMaxValue: 59]; [self setMinValue: 0]; _increment = 1; highlightUp = NO; highlightDown = NO; return self; } - (double) maxValue { return _maxValue; } - (void) setMaxValue: (double)maxValue { _maxValue = maxValue; if ([self doubleValue] > _maxValue) [self setDoubleValue: _maxValue]; } - (double) minValue { return _minValue; } - (void) setMinValue: (double)minValue { _minValue = minValue; if ([self doubleValue] < _minValue) [self setDoubleValue: _minValue]; } - (void) setObjectValue: (id)anObject { // NOTE: valueWraps has no effect on setObjectValue: // FIXME: Copied from NSSliderCell.. can we share the code somehow? // If the provided object doesn't respond to doubeValue, or our minValue // is greater than our maxValue, we set our value to our minValue // (this arbitrary choice matches OS X) if ([anObject respondsToSelector: @selector(doubleValue)] == NO || _minValue > _maxValue) [super setObjectValue: [NSNumber numberWithDouble: _minValue]]; else { double aDouble = [anObject doubleValue]; if (aDouble < _minValue) [super setObjectValue: [NSNumber numberWithDouble: _minValue]]; else if (aDouble > _maxValue) [super setObjectValue: [NSNumber numberWithDouble: _maxValue]]; else [super setObjectValue: anObject]; } } - (double) increment { return _increment; } - (void) setIncrement: (double)increment { _increment = increment; } - (BOOL) autorepeat { return _autorepeat; } - (void) setAutorepeat: (BOOL)autorepeat { _autorepeat = autorepeat; } - (BOOL) valueWraps { return _valueWraps; } - (void) setValueWraps: (BOOL)valueWraps { _valueWraps = valueWraps; } - (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { [[GSTheme theme] drawStepperCell: self withFrame: cellFrame inView: controlView highlightUp: highlightUp highlightDown: highlightDown]; } - (void) getPeriodicDelay: (float*)delay interval: (float*)interval { *delay = 0.5; *interval = 0.025; } - (BOOL) trackMouse: (NSEvent*)theEvent inRect: (NSRect)cellFrame ofView: (NSView*)controlView untilMouseUp: (BOOL)flag { NSPoint location = [theEvent locationInWindow]; NSPoint point = [controlView convertPoint: location fromView: nil]; NSRect upRect; NSRect downRect; NSRect rect; float delay; float interval; BOOL overButton = YES; unsigned int event_mask = NSLeftMouseUpMask | NSLeftMouseDraggedMask; unsigned int periodCount = 0; BOOL isDirectionUp; BOOL autorepeat = [self autorepeat]; BOOL done = NO; BOOL mouseWentUp = NO; _mouse_down_flags = [theEvent modifierFlags]; if (![self startTrackingAt: point inView: controlView]) return NO; if (![controlView mouse: point inRect: cellFrame]) return NO; // point is not in cell if ([self isEnabled] == NO) return NO; if ([theEvent type] != NSLeftMouseDown) return NO; upRect = [[GSTheme theme] stepperUpButtonRectWithFrame: cellFrame]; downRect = [[GSTheme theme] stepperDownButtonRectWithFrame: cellFrame]; // Did the mouse go down in the up or in the down part? if (NSMouseInRect(point, upRect, NO)) { isDirectionUp = YES; rect = upRect; } else if (NSMouseInRect(point, downRect, NO)) { isDirectionUp = NO; rect = downRect; } else { return mouseWentUp; } [self setHighlighted: YES upButton: isDirectionUp withFrame: cellFrame inView: controlView]; if (autorepeat) { [self getPeriodicDelay: &delay interval: &interval]; [NSEvent startPeriodicEventsAfterDelay: delay withPeriod: interval]; event_mask |= NSPeriodicMask; } while (!done) { NSEventType eventType; theEvent = [NSApp nextEventMatchingMask: event_mask untilDate: [NSDate distantFuture] inMode: NSEventTrackingRunLoopMode dequeue: YES]; eventType = [theEvent type]; // Did the mouse go up? if (eventType == NSLeftMouseUp) { mouseWentUp = YES; done = YES; } if (eventType == NSPeriodic) { periodCount++; if (periodCount == 4) periodCount = 0; if (periodCount == 0) { if (isDirectionUp) [self _increment]; else [self _decrement]; [(NSControl*)controlView sendAction: [self action] to: [self target]]; } location = [[controlView window] mouseLocationOutsideOfEventStream]; } else { location = [theEvent locationInWindow]; } point = [controlView convertPoint: location fromView: nil]; if (![controlView mouse: point inRect: cellFrame]) { if (flag == NO) { done = YES; } } if (NSMouseInRect(point, rect, NO) != overButton) { overButton = !overButton; if (overButton && autorepeat) { [NSEvent startPeriodicEventsAfterDelay: delay withPeriod: interval]; periodCount = 0; } else { [NSEvent stopPeriodicEvents]; } [self setHighlighted: overButton upButton: isDirectionUp withFrame: cellFrame inView: controlView]; } } if (overButton && autorepeat) { [NSEvent stopPeriodicEvents]; } if (overButton) { if (isDirectionUp) [self _increment]; else [self _decrement]; [(NSControl*)controlView sendAction: [self action] to: [self target]]; } [self setHighlighted: NO upButton: isDirectionUp withFrame: cellFrame inView: controlView]; return mouseWentUp; } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { [aCoder encodeDouble: [self increment] forKey: @"NSIncrement"]; [aCoder encodeDouble: [self maxValue] forKey: @"NSMaxValue"]; [aCoder encodeDouble: [self minValue] forKey: @"NSMinValue"]; [aCoder encodeBool: [self autorepeat] forKey: @"NSAutorepeat"]; [aCoder encodeBool: [self valueWraps] forKey: @"NSValueWraps"]; } else { int tmp1, tmp2; tmp1 = (int)_autorepeat; tmp2 = (int)_valueWraps; [aCoder encodeValueOfObjCType: @encode(double) at: &_maxValue]; [aCoder encodeValueOfObjCType: @encode(double) at: &_minValue]; [aCoder encodeValueOfObjCType: @encode(double) at: &_increment]; [aCoder encodeValueOfObjCType: @encode(int) at: &tmp1]; [aCoder encodeValueOfObjCType: @encode(int) at: &tmp2]; } } - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if (nil == self) return nil; if ([aDecoder allowsKeyedCoding]) { _autorepeat = [aDecoder decodeBoolForKey: @"NSAutorepeat"]; _valueWraps = [aDecoder decodeBoolForKey: @"NSValueWraps"]; _increment = [aDecoder decodeDoubleForKey: @"NSIncrement"]; _maxValue = [aDecoder decodeDoubleForKey: @"NSMaxValue"]; if ([aDecoder containsValueForKey: @"NSMinValue"]) { _minValue = [aDecoder decodeDoubleForKey: @"NSMinValue"]; } } else { int tmp1, tmp2; [aDecoder decodeValueOfObjCType: @encode(double) at: &_maxValue]; [aDecoder decodeValueOfObjCType: @encode(double) at: &_minValue]; [aDecoder decodeValueOfObjCType: @encode(double) at: &_increment]; [aDecoder decodeValueOfObjCType: @encode(int) at: &tmp1]; [aDecoder decodeValueOfObjCType: @encode(int) at: &tmp2]; _autorepeat = (BOOL)tmp1; _valueWraps = (BOOL)tmp2; } return self; } @end @implementation NSStepperCell (Private) - (void) _increment { double newValue; double maxValue = [self maxValue]; double minValue = [self minValue]; double increment = [self increment]; newValue = [self doubleValue] + increment; if ([self valueWraps]) { if (newValue > maxValue) newValue = newValue - maxValue + minValue - 1; else if (newValue < minValue) newValue = newValue + maxValue - minValue + 1; } [self setDoubleValue: newValue]; } - (void) _decrement { double newValue; double maxValue = [self maxValue]; double minValue = [self minValue]; double increment = [self increment]; newValue = [self doubleValue] - increment; if ([self valueWraps]) { if (newValue > maxValue) newValue = newValue - maxValue + minValue - 1; else if (newValue < minValue) newValue = newValue + maxValue - minValue + 1; } [self setDoubleValue: newValue]; } - (void) setHighlighted: (BOOL)highlight upButton: (BOOL)upButton withFrame: (NSRect)frame inView: (NSView*)controlView { if (upButton) { highlightUp = highlight; } else { highlightDown = highlight; } [controlView setNeedsDisplayInRect: frame]; } @end gnustep-gui-0.24.0/Source/GSKeyBindingTable.h0000664000076500007650000001025511376454556020623 0ustar brains99brains99/* GSKeyBindingTable -*-objc-*- Copyright (C) 2002 Free Software Foundation, Inc. Author: Nicola Pero Date: February 2002 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GS_KEYBINDING_TABLE_H #define _GS_KEYBINDING_TABLE_H #import "GSKeyBindingAction.h" @class GSKeyBindingTable; /* A struct _GSKeyBinding describes how to interpret a single * keystroke. It binds a keystroke to an action (when that keystroke * is read, the action is performed), or to a further table of * bindings of keystrokes to actions, to be used to interpret the next * keystroke. * * The table is used in the case of multi-stroke bindings, such as * Control-x followed by Control-s. In this case, Control-x will * point to a secondary table of keystrokes, which contains Control-s, * which binds it to the required action. */ struct _GSKeyBinding { /* The character this binding is about. */ unichar character; /* The modifier for the binding. Might be a combination of * NSShiftKeyMask, NSControlKeyMask, NSAlternateKeyMask, * NSNumericPadKeyMask. */ int modifiers; /* The action, or NULL if there's no action associated. NB - the action * is retained here. */ GSKeyBindingAction *action; /* A further table of _GSKeyBinding to be used to interpret the next keystroke, or NULL if this is a 'leaf' keybinding. NB - the table is retained here. */ GSKeyBindingTable *table; /* Both action and table might be NULL if this is a keybinding which has been disabled. In that case, it's ignored. */ }; /* This class can manage a table of keybindings (that is, a table of * _GSKeyBinding objects). It can add and remove them, and it can * look up a keystroke into the table, and return the associated action, * or a GSKeyBindingTable object which can be used to process further * keystrokes, for multi-stroke keybindings. */ @interface GSKeyBindingTable : NSObject { /* The array of bindings. */ struct _GSKeyBinding *_bindings; /* The length of the array of bindings. */ int _bindingsCount; } /* Load all the bindings from this dictionary. The dictionary binds keys to actions, as described below under bindKey:toAction:. The DefaultKeyBindings.dict file is an example of such a dictionary. */ - (void) loadBindingsFromDictionary: (NSDictionary *)dict; /* Bind a specific key [must be a string, representing a keystroke] to * a specific action, which can be a string for a selector; an array * of strings for an array of selectors; a dictionary if the key is * just the prefix to a further array of keybindings; a * GSKeyBindingAction for a specific prebuilt action object [this is * normally used by the NSInputManager to bind very special actions * such as Control-q (interpret literally next keystroke)]. */ - (void) bindKey: (id)key toAction: (id)action; /* The input manager calls this when it wants to look up a keybinding * in the table. The method returns YES if the keybinding is in the * table, or NO if it's not. If it is in the table, it returns the * action (or nil if none), and the further keybinding table (or nil * if none) to use for interpreting the next keystrokes. */ - (BOOL) lookupKeyStroke: (unichar)character modifiers: (int)flags returningActionIn: (GSKeyBindingAction **)action tableIn: (GSKeyBindingTable **)table; @end #endif /* _GS_KEYBINDING_TABLE_H */ gnustep-gui-0.24.0/Source/NSBitmapImageRep+PNM.h0000664000076500007650000000245711376454556021120 0ustar brains99brains99/* bitmap Functions for reading bitmap images Copyright (C) 2003 Free Software Foundation, Inc. Written by: Adam Fedor Date: Oct 2003 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _NSBitmapImageRep_PNM_H_include #define _NSBitmapImageRep_PNM_H_include #import "AppKit/NSBitmapImageRep.h" @interface NSBitmapImageRep (PNM) + (BOOL) _bitmapIsPNM: (NSData *)imageData; -(id) _initBitmapFromPNM: (NSData *)imageData errorMessage: (NSString **)error; @end #endif gnustep-gui-0.24.0/Source/NSPrintPanel.m0000664000076500007650000005464312102166206017705 0ustar brains99brains99/** NSPrintPanel Standard panel for querying user about printing. Copyright (C) 2001,2004 Free Software Foundation, Inc. Written By: Adam Fedor Date: Oct 2001 Modified for Printing Backend Support Author: Chad Hardin Date: June 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSBox.h" #import "AppKit/NSForm.h" #import "AppKit/NSNib.h" #import "AppKit/NSNibLoading.h" #import "AppKit/NSPrinter.h" #import "AppKit/NSPrintPanel.h" #import "AppKit/NSPrintInfo.h" #import "AppKit/NSPrintOperation.h" #import "AppKit/NSPopUpButton.h" #import "AppKit/NSSavePanel.h" #import "AppKit/NSView.h" #import "GSGuiPrivate.h" #import "GNUstepGUI/GSPrinting.h" static NSPrintPanel *shared_instance = nil; #define GSPANELNAME @"GSPrintPanel" #define CONTROL(panel, name) [[panel contentView] viewWithTag: name] @interface NSPrintPanel (GSPrivate) - (void)_updateFromPrintInfo: (NSPrintInfo*)info; - (void)_finalWritePrintInfo: (NSPrintInfo*)info; @end /** Class Description

NSPrintPanel provides a standard print panel allowing the user to specify information about how a document is to be printed, including the page range, number of copies and scale of the document. It also allows the user to save the document to a file or preview it. When a print: message is sent to an NSView or NSWindow, an NSPrintOpertation is created which manages printing of a view. The NSPrintOperation object would by default show a print panel in a modal loop for the user. You can avoid showing the print panel by sending the setShowsPanels: message in the print operation with a NO argument.

*/ @implementation NSPrintPanel // // Class Methods // /** Load the appropriate bundle for the PrintPanel and alloc the class from that in our place (eg: GSLPRPrintPanel, GSCUPSPrintPanel). */ + (id) allocWithZone: (NSZone*) zone { Class principalClass; principalClass = [[GSPrinting printingBundle] principalClass]; if (principalClass == nil) return nil; return [[principalClass printPanelClass] allocWithZone: zone]; } /** Creates ( if needed) and returns a shared instance of the NSPrintPanel panel. */ + (NSPrintPanel *)printPanel { if (shared_instance == nil) { shared_instance = [[NSPrintPanel alloc] init]; } return shared_instance; } // // Instance methods // - (id) init { return [self initWithContentRect: NSMakeRect(300, 300, 420, 350) styleMask: NSTitledWindowMask backing: NSBackingStoreBuffered defer: YES]; } /* Designated initializer */ - (id) initWithContentRect: (NSRect)contentRect styleMask: (NSUInteger)aStyle backing: (NSBackingStoreType)bufferingType defer: (BOOL)flag { unsigned int i; id control; NSArray *subviews, *list; NSString *panel; NSDictionary *table; self = [super initWithContentRect: contentRect styleMask: aStyle backing: bufferingType defer: flag]; if (self == nil) return nil; /* Set the title */ [self setTitle: _(@"Print Panel")]; _accessoryControllers = [[NSMutableArray alloc] init]; // self will come from a bundle, to get the panel from the GUI library // we have to select that bundle explicitly panel = [GSGuiBundle() pathForNibResource: GSPANELNAME]; if (panel == nil) { NSRunAlertPanel(@"Error", @"Could not find print panel resource", @"OK", NULL, NULL); return nil; } table = [NSDictionary dictionaryWithObject: self forKey: NSNibOwner]; if ([NSBundle loadNibFile: panel externalNameTable: table withZone: [self zone]] == NO) { NSRunAlertPanel(@"Error", @"Could not load print panel resource", @"OK", NULL, NULL); return nil; } /* Transfer the objects to us. FIXME: There must be a way to instantiate the panel directly */ subviews = [[_panel contentView] subviews]; for (i = 0; i < [subviews count]; i++) { [_contentView addSubview: [subviews objectAtIndex: i]]; } DESTROY(_panel); /* Setup the layout popup */ control = CONTROL(self, NSPPLayoutButton); list = [NSArray arrayWithObjects: _(@"1 up"), _(@"2 up"), _(@"4 up"), _(@"6 up"), _(@"8 up"), nil]; [control removeAllItems]; for (i = 0; i < [list count]; i++) { [control addItemWithTitle: [list objectAtIndex: i]]; } [control selectItemAtIndex: 0]; return self; } - (void) dealloc { RELEASE(_accessoryView); RELEASE(_savePath); RELEASE(_optionPanel); RELEASE(_printInfo); RELEASE(_accessoryControllers); RELEASE(_jobStyleHint); RELEASE(_helpAnchor); [super dealloc]; } // // Customizing the Panel // /**

Sets the accessory view for the print panel to aView

See Also: -accessoryView

*/ - (void) setAccessoryView: (NSView *)aView { ASSIGN(_accessoryView, aView); } /**

Returns the accessory view for the print panel

See Also: -setAccessoryView:

*/ - (NSView *) accessoryView { return _accessoryView; } - (NSArray *) accessoryControllers { return _accessoryControllers; } - (void) addAccessoryController: (NSViewController < NSPrintPanelAccessorizing >*)accessoryController { [_accessoryControllers addObject: accessoryController]; } - (void) removeAccessoryController: (NSViewController < NSPrintPanelAccessorizing >*)accessoryController { [_accessoryControllers removeObjectIdenticalTo: accessoryController]; } - (NSString *) defaultButtonTitle { NSButton *defaultButton = CONTROL(self, NSOKButton); return [defaultButton title]; } - (void) setDefaultButtonTitle: (NSString *)defaultButtonTitle { NSButton *defaultButton = CONTROL(self, NSOKButton); [defaultButton setTitle: defaultButtonTitle]; } - (NSPrintPanelOptions) options { return _options; } - (void) setOptions: (NSPrintPanelOptions)options { _options = options; } - (NSString *) jobStyleHint { return _jobStyleHint; } - (void) setJobStyleHint: (NSString *)hint { ASSIGN(_jobStyleHint, hint); } - (NSString *) helpAnchor { return _helpAnchor; } - (void) setHelpAnchor: (NSString *)helpAnchor { ASSIGN(_helpAnchor, helpAnchor); } - (NSPrintInfo *) printInfo { return _printInfo; } // // Running the Panel // /** Display the Print panel in a modal loop. Saves any aquired information in the NSPrintInfo object for the current NSPrintOperation. Returns NSCancelButton if the user clicks the Cancel button or NSOKButton otherwise. Unlike other panels, this one does not order itself out after the modal session is finished. You must do that yourself. */ - (NSInteger)runModal { NSPrintInfo* info = [[NSPrintOperation currentOperation] printInfo]; return [self runModalWithPrintInfo: info]; } - (NSInteger) runModalWithPrintInfo: (NSPrintInfo *)printInfo { NSInteger ret; _picked = NSOKButton; ASSIGN(_printInfo, printInfo); // Set the values from printInfo [self _updateFromPrintInfo: _printInfo]; ret = [NSApp runModalForWindow: self]; [_optionPanel orderOut: self]; DESTROY(_printInfo); /* Don't order ourselves out, let the NSPrintOperation do that */ return ret; } - (void) beginSheetWithPrintInfo: (NSPrintInfo *)printInfo modalForWindow: (NSWindow *)docWindow delegate: (id)delegate didEndSelector: (SEL)didEndSelector contextInfo: (void *)contextInfo { _picked = NSOKButton; ASSIGN(_printInfo, printInfo); // Set the values from printInfo [self _updateFromPrintInfo: _printInfo]; [NSApp beginSheet: self modalForWindow: docWindow modalDelegate: delegate didEndSelector: didEndSelector contextInfo: contextInfo]; [_optionPanel orderOut: self]; DESTROY(_printInfo); [self orderOut: self]; } - (void) _changeSaveType: (id)sender { NSString *ext = [[sender selectedItem] representedObject]; [(NSSavePanel *)[sender window] setAllowedFileTypes: [NSArray arrayWithObject: ext]]; } - (NSBox *) _savePanelAccessory { NSRect accessoryFrame = NSMakeRect(0,0,380,70); NSRect spaFrame = NSMakeRect(115,14,150,22); NSBox *save_panel_accessory = [[[NSBox alloc] initWithFrame: accessoryFrame] autorelease]; [save_panel_accessory setTitle: _(@"File Type")]; [save_panel_accessory setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; NSPopUpButton *spa_button = [[NSPopUpButton alloc] initWithFrame: spaFrame]; [spa_button setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable | NSViewMinYMargin | NSViewMaxYMargin | NSViewMinXMargin | NSViewMaxXMargin]; [spa_button setTarget: self]; [spa_button setAction: @selector(_changeSaveType:)]; [spa_button addItemWithTitle: @"PDF"]; [[spa_button itemAtIndex: 0] setRepresentedObject: @"pdf"]; [spa_button addItemWithTitle: @"PostScript"]; [[spa_button itemAtIndex: 1] setRepresentedObject: @"ps"]; [spa_button selectItemAtIndex: 0]; [save_panel_accessory addSubview: spa_button]; [spa_button release]; return save_panel_accessory; } - (BOOL) _getSavePath { int result; NSSavePanel *sp; sp = [NSSavePanel savePanel]; [sp setAllowedFileTypes: [NSArray arrayWithObjects: @"pdf", nil]]; [sp setAccessoryView: [self _savePanelAccessory]]; result = [sp runModal]; if (result == NSOKButton) { _savePath = RETAIN([sp filename]); } return (result == NSOKButton); } /* Private communication with our panel objects */ - (void) _pickedButton: (id)sender { int tag = [sender tag]; if (tag == NSPPSaveButton) { _picked = NSPPSaveButton; if ([self _getSavePath] == NO) { /* User pressed save, then changed his mind, so go back to the print panel (don't stop the modal session) */ return; } } else if (tag == NSPPPreviewButton) { _picked = NSPPPreviewButton; } else if (tag == NSFaxButton) { _picked = NSFaxButton; NSRunAlertPanel(_(@"Sorry"), _(@"Faxing of print file not implemented"), _(@"OK"), NULL, NULL); /* Don't stop the modal session */ return; } else if (tag == NSCancelButton) { _picked = NSCancelButton; } else if (tag == NSOKButton) { _picked = NSOKButton; } else if (tag == NSPPOptionsButton) { /* Open the options panel */ [NSApp runModalForWindow: _optionPanel]; [_optionPanel orderOut: self]; return; } else if (tag == NSPPOptionOKButton) { /* Do nothing. Just stops model on the options panel */ } else { NSLog(@"Print panel buttonAction: from unknown sender - x%p\n", sender); } // FIXME [self _finalWritePrintInfo: _printInfo]; [NSApp stopModalWithCode: (_picked == NSCancelButton) ? NSCancelButton : NSOKButton]; } - (void) _pickedPrinter: (id)sender { NSString *name = [sender titleOfSelectedItem]; NSPrinter *printer = [NSPrinter printerWithName: name]; [_printInfo setPrinter: printer]; [self _updateFromPrintInfo: _printInfo]; } - (void) _pickedPage: (id)sender { id pageMatrix = CONTROL(self, NSPPPageChoiceMatrix); id fromRangeForm = CONTROL(self, NSPPPageRangeFrom); id toRangeForm = CONTROL(self, NSPPPageRangeTo); if ([pageMatrix selectedColumn] == 0) { [[fromRangeForm cellAtIndex: 0] setStringValue: @"" ]; [[toRangeForm cellAtIndex: 0] setStringValue: @"" ]; } else { NSString *str; str = [NSString stringWithFormat: @"%d", _pages.location]; [[fromRangeForm cellAtIndex: 0] setStringValue: str]; str = [NSString stringWithFormat: @"%d", NSMaxRange(_pages)-1]; [[toRangeForm cellAtIndex: 0] setStringValue: str]; } } /* Depreciated communication methods */ /** This method has been depreciated. It doesn't do anything useful. */ - (void)pickedButton:(id)sender { NSLog(@"[NSPrintPanel -pickedButton:] method depreciated"); [self _pickedButton: sender]; } /** This method has been depreciated. It doesn't do anything useful. */ - (void)pickedAllPages:(id)sender { NSLog(@"[NSPrintPanel -pickedAllPages:] method depreciated"); [self _pickedPage: sender]; } /** This method has been depreciated. It doesn't do anything useful. */ - (void)pickedLayoutList:(id)sender { NSLog(@"[NSPrintPanel -pickedLayoutList:] method depreciated"); } // // Communicating with the NSPrintInfo Object // /** Setup the display in the receiver's panel based on the values stored in the NSPrintInfo object from the current NSPrintOperation. */ - (void)updateFromPrintInfo { NSPrintInfo* info = [[NSPrintOperation currentOperation] printInfo]; [self _updateFromPrintInfo: info]; } /** Saves information set by the user in the receiver's panel in the NSPrintInfo object from the current NSPrintOperation. */ - (void)finalWritePrintInfo { NSPrintInfo* info = [[NSPrintOperation currentOperation] printInfo]; [self _finalWritePrintInfo: info]; } /* Private method for NSPrintOperation */ - (void) _setStatusStringValue: (NSString *)string { [CONTROL(self, NSPPStatusField) setStringValue: string ]; } @end @implementation NSPrintPanel (GSPrivate) - (void)_updateFromPrintInfo: (NSPrintInfo*)info { id control; int layout; double scale; NSString *str; NSPrinter *printer; NSDictionary *dict; printer = [info printer]; dict = [info dictionary]; /* Setup printer information */ { NSArray *printerNames = [NSPrinter printerNames]; NSInteger i; NSPopUpButton *button = CONTROL(self, NSPPNameField); [button removeAllItems]; for (i=0; i<[printerNames count]; i++) { NSString *printerName = [printerNames objectAtIndex: i]; [button addItemWithTitle: printerName]; if ([[printer name] isEqual: printerName]) { [button selectItemAtIndex: i]; } } } [CONTROL(self, NSPPNoteField) setStringValue: [printer note] ]; [CONTROL(self, NSPPStatusField) setStringValue: @"Idle" ]; /* Setup copies, page range, scale */ [CONTROL(self, NSPPCopiesField) setIntValue: 1]; [[CONTROL(self, NSPPPageRangeFrom) cellAtIndex: 0] setStringValue: @"" ]; [[CONTROL(self, NSPPPageRangeTo) cellAtIndex: 0] setStringValue: @"" ]; [CONTROL(self, NSPPPageChoiceMatrix) selectCellAtRow: 0 column: 0]; if ([dict objectForKey: NSPrintScalingFactor]) scale = [[dict objectForKey: NSPrintScalingFactor] doubleValue]; else scale = 0; if (scale == 0) scale = 1; [CONTROL(self, NSPPScaleField) setIntValue: (int)(scale*100)]; dict = [info dictionary]; NSDebugLLog(@"NSPrinting", @"Update PrintInfo dictionary\n %@ \n --------------", dict); _pages = NSMakeRange([[dict objectForKey: NSPrintFirstPage] intValue], [[dict objectForKey: NSPrintLastPage] intValue]); if (NSMaxRange(_pages) == 0) _pages = NSMakeRange(1, 0); /* Setup the layout popup */ layout = [[dict objectForKey: NSPrintPagesPerSheet] intValue]; if (layout == 0) layout = 1; if (layout > 4) layout = 4; control = CONTROL(self, NSPPLayoutButton); [control selectItemAtIndex: (int)(layout/2)]; /* Setup the resolution popup */ control = CONTROL(_optionPanel, NSPPResolutionButton); [control removeAllItems]; /* FIXME: Get default from printInfo? */ str = [printer stringForKey:@"DefaultResolution" inTable: @"PPD"]; if (str) { NSArray *list; list = [printer stringListForKey:@"Resolution" inTable: @"PPD"]; if ([list count]) { unsigned int i; NSString *display, *option; for (i = 0; i < [list count]; i++) { NSString *key = [list objectAtIndex: i]; option = [@"Resolution/" stringByAppendingString: key]; display = [printer stringForKey: option inTable: @"PPDOptionTranslation"]; if (display == nil) display = key; [control addItemWithTitle: display]; } option = [@"Resolution/" stringByAppendingString: str]; display = [printer stringForKey: option inTable: @"PPDOptionTranslation"]; if (display == nil) display = str; [control selectItemWithTitle: display]; } else { [control addItemWithTitle: str]; } } else [control addItemWithTitle: _(@"Unknown")]; /* Setup the paper feed popup */ control = CONTROL(_optionPanel, NSPPPaperFeedButton); [control removeAllItems]; str = [printer stringForKey:@"DefaultInputSlot" inTable: @"PPD"]; if (str) { NSString *manual; NSArray *list; manual = [printer stringForKey:@"DefaultManualFeed" inTable: @"PPD"]; if (manual) [control addItemWithTitle: _(@"Manual")]; list = [printer stringListForKey:@"InputSlot" inTable: @"PPD"]; if ([list count]) { unsigned int i; NSString *display, *option; for (i = 0; i < [list count]; i++) { NSString *paper = [list objectAtIndex: i]; option = [@"InputSlot/" stringByAppendingString: paper]; display = [printer stringForKey: option inTable: @"PPDOptionTranslation"]; if (display == nil) display = paper; [control addItemWithTitle: display]; } /* FIXME: What if manual is default ? */ option = [@"InputSlot/" stringByAppendingString: str]; display = [printer stringForKey: option inTable: @"PPDOptionTranslation"]; if (display == nil) display = str; [control selectItemWithTitle: display]; } else { [control addItemWithTitle: str]; } } else [control addItemWithTitle: _(@"Unknown")]; } #define NSNUMBER(a) [NSNumber numberWithInt: (a)] - (void)_finalWritePrintInfo: (NSPrintInfo*)info { id control; double scale; int layout; NSString *sel; NSArray *list; NSPrinter *printer; NSMutableDictionary *dict; NSMutableDictionary *features; dict = [info dictionary]; printer = [info printer]; features = [dict objectForKey: NSPrintJobFeatures]; /* Copies */ control = CONTROL(self, NSPPCopiesField); if ([control intValue] > 1) { [dict setObject: NSNUMBER([control intValue]) forKey: NSPrintCopies]; } /* Pages */ control = CONTROL(self, NSPPPageChoiceMatrix); if ([control selectedColumn] != 0) { id fromRangeForm = CONTROL(self, NSPPPageRangeFrom); id toRangeForm = CONTROL(self, NSPPPageRangeTo); [dict setObject: NSNUMBER([[fromRangeForm cellAtIndex: 0] intValue]) forKey: NSPrintFirstPage]; [dict setObject: NSNUMBER([[toRangeForm cellAtIndex: 0] intValue]) forKey: NSPrintLastPage]; [dict setObject: NSNUMBER(NO) forKey: NSPrintAllPages]; } else [dict setObject: NSNUMBER(YES) forKey: NSPrintAllPages]; /* Scale */ control = CONTROL(self, NSPPScaleField); scale = [control doubleValue]/100.0; if (scale <= 0) scale = .1; if (scale >= 10) scale = 10; [control setIntValue: (int)(scale*100)]; [dict setObject: [NSNumber numberWithDouble: scale] forKey: NSPrintScalingFactor]; /* Layout */ layout = [CONTROL(self, NSPPLayoutButton) indexOfSelectedItem] * 2; if (layout == 0) layout = 1; [dict setObject: NSNUMBER(layout) forKey: NSPrintPagesPerSheet]; /* Resolution */ /* Here we take advantage of the fact the names in the popup list are in the same order as the PPD file, so we don't actually compare the values */ control = CONTROL(_optionPanel, NSPPResolutionButton); list = [printer stringListForKey: @"Resolution" inTable: @"PPD"]; if (list) { NSString *def; sel = [list objectAtIndex: [control indexOfSelectedItem]]; def = [printer stringForKey:@"DefaultResolution" inTable: @"PPD"]; if ([sel isEqual: def] == NO || [features objectForKey: @"Resolution"]) { if (features == nil) { features = [NSMutableDictionary dictionary]; [dict setObject: features forKey: NSPrintJobFeatures]; } sel = [@"Resolution/" stringByAppendingString: sel]; [features setObject: sel forKey: @"Resolution"]; } } /* Input Slot */ control = CONTROL(_optionPanel, NSPPPaperFeedButton); list = [printer stringListForKey:@"InputSlot" inTable: @"PPD"]; if (list) { int selected; NSString *def, *manual; sel = nil; selected = [control indexOfSelectedItem]; manual = [printer stringForKey:@"DefaultManualFeed" inTable: @"PPD"]; if (manual) { if (selected == 0) sel = _(@"Manual"); else selected--; } if (sel == nil) sel = [list objectAtIndex: selected]; def = [printer stringForKey:@"DefaultInputSlot" inTable: @"PPD"]; if ([sel isEqual: _(@"Manual")] == YES) { [dict setObject: NSPrintManualFeed forKey: NSPrintPaperFeed]; /* FIXME: This needs to be more robust. I'm just assuming that all Manual Feed keys can be True or False (which is the case for all the ppd files that I know of). */ [dict setObject: @"ManualFeed/True" forKey: NSPrintManualFeed]; [features setObject: @"ManualFeed/True" forKey: NSPrintPaperFeed]; } else if ([sel isEqual: def] == NO || [dict objectForKey: NSPrintPaperFeed]) { if (features == nil) { features = [NSMutableDictionary dictionary]; [dict setObject: features forKey: NSPrintJobFeatures]; } sel = [@"InputSlot/" stringByAppendingString: sel]; [features setObject: sel forKey: @"InputSlot"]; [dict setObject: sel forKey: NSPrintPaperFeed]; } } /* Job Resolution */ switch (_picked) { case NSPPSaveButton: sel = NSPrintSaveJob; [dict setObject: _savePath forKey: NSPrintSavePath]; break; case NSPPPreviewButton: sel = NSPrintPreviewJob; break; case NSFaxButton: sel = NSPrintFaxJob; break; case NSOKButton: sel = NSPrintSpoolJob; break; case NSCancelButton: default: sel = NSPrintCancelJob; } [info setJobDisposition: sel]; NSDebugLLog(@"NSPrinting", @"Final info dictionary ----\n %@ \n --------------", dict); } @end gnustep-gui-0.24.0/Source/GSHbox.m0000664000076500007650000001056111537516710016523 0ustar brains99brains99/** GSHbox The GSHbox class (a GNU extension) Copyright (C) 1999-2010 Free Software Foundation, Inc. Author: Nicola Pero Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "GNUstepGUI/GSHbox.h" // For the separator #import "AppKit/NSBox.h" @implementation GSHbox: GSTable // // Class methods // +(void) initialize { if (self == [GSHbox class]) [self setVersion: 1]; } // // Instance Methods // -(id) init { self = [super initWithNumberOfRows: 1 numberOfColumns: 1]; if (nil == self) return nil; _haveViews = NO; _defaultMinXMargin = 0; return self; } -(void) dealloc { [super dealloc]; } // // Adding Views // -(void) addView: (NSView *)aView { [self addView: aView enablingXResizing: YES withMinXMargin: _defaultMinXMargin]; } -(void) addView: (NSView *)aView enablingXResizing: (BOOL)aFlag { [self addView: aView enablingXResizing: aFlag withMinXMargin: _defaultMinXMargin]; } -(void) addView: (NSView *)aView withMinXMargin: (float) aMargin { [self addView: aView enablingXResizing: YES withMinXMargin: aMargin]; } -(void) addView: (NSView *)aView enablingXResizing: (BOOL)aFlag withMinXMargin: (float)aMargin { if (_haveViews) { int entries = _numberOfColumns; [super addColumn]; [super setXResizingEnabled: aFlag forColumn: entries]; [super putView: aView atRow: 0 column: entries withMinXMargin: aMargin maxXMargin: 0 minYMargin: 0 maxYMargin: 0]; } else // !_haveViews { [super setXResizingEnabled: aFlag forColumn: 0]; [super putView: aView atRow: 0 column: 0 withMinXMargin: 0 maxXMargin: 0 minYMargin: 0 maxYMargin: 0]; _haveViews = YES; } } // // Adding a Separator // -(void) addSeparator { [self addSeparatorWithMinXMargin: _defaultMinXMargin]; } -(void) addSeparatorWithMinXMargin: (float)aMargin { NSBox *separator; separator = [[NSBox alloc] initWithFrame: NSMakeRect (0, 0, 2, 2)]; [separator setAutoresizingMask: (NSViewMinXMargin | NSViewMaxXMargin | NSViewHeightSizable)]; [separator setTitlePosition: NSNoTitle]; [separator setBorderType: NSGrooveBorder]; [self addView: separator enablingXResizing: NO withMinXMargin: aMargin]; [separator release]; } // // Setting Margins // -(void) setDefaultMinXMargin: (float)aMargin { _defaultMinXMargin = aMargin; } // // Getting the number of Entries // -(int) numberOfViews { if (_haveViews) return _numberOfColumns; else return 0; } // // NSCoding protocol // -(void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { [aCoder encodeBool: _haveViews forKey: @"GSHaveViews"]; [aCoder encodeFloat: _defaultMinXMargin forKey: @"GSDefaultMinXMargin"]; } else { [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_haveViews]; [aCoder encodeValueOfObjCType: @encode(float) at: &_defaultMinXMargin]; } } -(id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if (nil == self) return nil; if ([aDecoder allowsKeyedCoding]) { _haveViews = [aDecoder decodeBoolForKey: @"GSHaveViews"]; _defaultMinXMargin = [aDecoder decodeFloatForKey: @"GSDefaultMinXMargin"]; } else { [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_haveViews]; [aDecoder decodeValueOfObjCType: @encode(float) at: &_defaultMinXMargin]; } return self; } @end gnustep-gui-0.24.0/Source/GSXibLoading.m0000664000076500007650000000404012020162732017623 0ustar brains99brains99#import #import @interface IBUserDefinedRuntimeAttributesPlaceholder : NSObject { NSString *typeIdentifier; NSString *keyPath; id value; } - (void) setTypeIdentifier: (NSString *)type; - (NSString *) typeIdentifier; - (void) setKeyPath: (NSString *)keyPath; - (NSString *) keyPath; - (void) setValue: (id)value; - (id) value; @end @interface IBAccessibilityAttribute : NSObject @end @interface IBNSLayoutConstraint : NSObject @end @interface IBLayoutConstant : NSObject @end @implementation IBUserDefinedRuntimeAttributesPlaceholder - (void) encodeWithCoder: (NSCoder *)coder { if([coder allowsKeyedCoding]) { [coder encodeObject: typeIdentifier forKey: @"typeIdentifier"]; [coder encodeObject: keyPath forKey: @"keyPath"]; [coder encodeObject: value forKey: @"value"]; } } - (id) initWithCoder: (NSCoder *)coder { if([coder allowsKeyedCoding]) { [self setTypeIdentifier: [coder decodeObjectForKey: @"typeIdentifier"]]; [self setKeyPath: [coder decodeObjectForKey: @"keyPath"]]; [self setValue: [coder decodeObjectForKey: @"value"]]; } return self; } - (void) setTypeIdentifier: (NSString *)type { ASSIGN(typeIdentifier, type); } - (NSString *) typeIdentifier { return typeIdentifier; } - (void) setKeyPath: (NSString *)kpath { ASSIGN(keyPath, kpath); } - (NSString *) keyPath { return keyPath; } - (void) setValue: (id)val { ASSIGN(value, val); } - (id) value { return value; } @end @implementation IBAccessibilityAttribute - (void) encodeWithCoder: (NSCoder *)coder { } - (id) initWithCoder: (NSCoder *)coder { return self; } @end @implementation IBNSLayoutConstraint - (void) encodeWithCoder: (NSCoder *)coder { // Do nothing... } - (id) initWithCoder: (NSCoder *)coder { return self; } @end @implementation IBLayoutConstant - (void) encodeWithCoder: (NSCoder *)coder { // Do nothing... } - (id) initWithCoder: (NSCoder *)coder { return self; } @end gnustep-gui-0.24.0/Source/NSPrintOperation.m0000664000076500007650000010750211677707303020616 0ustar brains99brains99/* NSPrintOperation.m Controls operations generating print jobs. Copyright (C) 1996,2004 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Fred Kiefer Date: November 2000 Started implementation. Modified for Printing Backend Support Author: Chad Hardin Date: June 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include "config.h" #import #import #import #import #import #import #import #import #import #import #import "AppKit/AppKitExceptions.h" #import "AppKit/NSAffineTransform.h" #import "AppKit/NSApplication.h" #import "AppKit/NSGraphicsContext.h" #import "AppKit/NSView.h" #import "AppKit/NSPrinter.h" #import "AppKit/NSPrintPanel.h" #import "AppKit/NSPrintInfo.h" #import "AppKit/NSPrintOperation.h" #import "AppKit/NSWorkspace.h" #import "AppKit/PSOperators.h" #import "GNUstepGUI/GSEPSPrintOperation.h" #import "GNUstepGUI/GSPDFPrintOperation.h" #import "GNUstepGUI/GSPrintOperation.h" #import "GSGuiPrivate.h" #define NSNUMBER(a) [NSNumber numberWithInt: (a)] #define NSFNUMBER(a) [NSNumber numberWithDouble: (a)] /* * When a view gets printed it may need to be split up into segments, if the * views printed rectangle (after scaling) is bigger than the used area on the page. * In this case we set xpages and ypages to the number of segments needed per * dimension. This pre-calculated value may not be accurate, as the view may * adjust the rect for each printed page. * An independent concept is that multuple pages may be put on one sheet of paper. * This is taken care of by nup and nupScale. Here we currently only allow even * values (or 1, when we don't use multiple pages). If we ever change this be * sure to change [NSView beginPageInRect:atPlacement:], perhaps by moving that * code to here? * We always end up printing two rows per page, this is fine for 2, 4, 6, 8 and 10, * but starting from there it would be better to use three or four rows. */ /* Local pagination variables needed while printing */ typedef struct _page_info_t { NSRect scaledBounds; /* View's rect scaled by the user specified scale and page fitting */ NSRect paperBounds; /* Print area of a page in default user space, possibly rotated if printing Landscape */ NSRect sheetBounds; /* Print area of a sheet in default user space */ NSSize paperSize; /* Size of the paper */ int xpages, ypages; /* number of page segments for the view in both dimensions */ int first, last; /* first and last page to print */ double pageScale; /* Scaling determined from page fitting */ double printScale; /* User specified scaling */ double nupScale; /* Scale required to fit nup pages on the sheet */ int nup; /* Number of pages to print on a sheet */ double lastWidth, lastHeight; /* max. values of last printed page (scaled) */ NSPrintingOrientation orient; int pageDirection; /* NSPrintPageDirection */ } page_info_t; @interface NSPrintOperation (TrulyPrivate) - (BOOL) _runOperation; - (void) _setupPrintInfo; - (void)_printOperationDidRun:(NSPrintOperation *)printOperation returnCode:(int)returnCode contextInfo:(void *)contextInfo; - (void) _printPaginateWithInfo: (page_info_t *)info knowsRange: (BOOL)knowsRange; - (NSRect) _rectForPage: (int)page info: (page_info_t *)info xpage: (int *)xptr ypage: (int *)yptr; - (NSRect) _adjustPagesFirst: (int)first last: (int)last info: (page_info_t *)info; - (void) _print; @end @interface NSView (NSPrintOperation) - (void) _displayPageInRect: (NSRect)pageRect withInfo: (page_info_t)info knowsPageRange: (BOOL)knowsPageRange; @end @interface NSView (NPrintOperationPrivate) - (void) _endSheet; - (void) _cleanupPrinting; @end static NSString *NSPrintOperationThreadKey = @"NSPrintOperationThreadKey"; /** Class Description

NSPrintOperation controls printing of an NSView. When invoked normally it will (optionally) display a standard print panel (NSPrintPanel), and based on the information entered by the user here as well as information about page layout (see NSPageLayout) tells the NSView to print it's contents. NSPrintOperation works with the NSView to paginate the output into appropriately sized and oriented pages and finally delivers the result to the appropriate place, whether it be a printer, and PostScript file, or another output.

*/ @implementation NSPrintOperation // // Class methods // + (void)initialize { if (self == [NSPrintOperation class]) { // Initial version [self setVersion:1]; } } // // Creating and Initializing an NSPrintOperation Object // + (NSPrintOperation *)EPSOperationWithView:(NSView *)aView insideRect:(NSRect)rect toData:(NSMutableData *)data { return [self EPSOperationWithView: aView insideRect: rect toData: data printInfo: nil]; } + (NSPrintOperation *)EPSOperationWithView:(NSView *)aView insideRect:(NSRect)rect toData:(NSMutableData *)data printInfo:(NSPrintInfo *)aPrintInfo { return AUTORELEASE([[GSEPSPrintOperation alloc] initWithView: aView insideRect: rect toData: data printInfo: aPrintInfo]); } + (NSPrintOperation *)EPSOperationWithView:(NSView *)aView insideRect:(NSRect)rect toPath:(NSString *)path printInfo:(NSPrintInfo *)aPrintInfo { return AUTORELEASE([[GSEPSPrintOperation alloc] initWithView: aView insideRect: rect toPath: path printInfo: aPrintInfo]); } + (NSPrintOperation *)printOperationWithView:(NSView *)aView { return [self printOperationWithView: aView printInfo: nil]; } + (NSPrintOperation *)printOperationWithView:(NSView *)aView printInfo:(NSPrintInfo *)aPrintInfo { return AUTORELEASE([[GSPrintOperation alloc] initWithView: aView printInfo: aPrintInfo]); } + (NSPrintOperation *)PDFOperationWithView:(NSView *)aView insideRect:(NSRect)rect toData:(NSMutableData *)data { return [self PDFOperationWithView: aView insideRect: rect toData: data printInfo: nil]; } + (NSPrintOperation *)PDFOperationWithView:(NSView *)aView insideRect:(NSRect)rect toData:(NSMutableData *)data printInfo:(NSPrintInfo*)aPrintInfo { return AUTORELEASE([[GSPDFPrintOperation alloc] initWithView: aView insideRect: rect toData: data printInfo: aPrintInfo]); } + (NSPrintOperation *)PDFOperationWithView:(NSView *)aView insideRect:(NSRect)rect toPath:(NSString *)path printInfo:(NSPrintInfo*)aPrintInfo { return AUTORELEASE([[GSPDFPrintOperation alloc] initWithView: aView insideRect: rect toPath: path printInfo: aPrintInfo]); } // // Setting the Print Operation // /** Returns the NSPrintOperation object that is currently performing a print operation (if any). */ + (NSPrintOperation *)currentOperation { NSMutableDictionary *dict = [[NSThread currentThread] threadDictionary]; return (NSPrintOperation*)[dict objectForKey: NSPrintOperationThreadKey]; } /** Set the current NSPrintOperation to the supplied operation object. As this is currently implemented, if a NSPrintOperation is currently running, that operation is lost (along with any associated context), so be careful to call this only when there is no current operation. */ + (void)setCurrentOperation:(NSPrintOperation *)operation { NSMutableDictionary *dict = [[NSThread currentThread] threadDictionary]; if (operation == nil) [dict removeObjectForKey: NSPrintOperationThreadKey]; else [dict setObject: operation forKey: NSPrintOperationThreadKey]; } // // Instance methods // // // Creating and Initializing an NSPrintOperation Object // - (id)initEPSOperationWithView:(NSView *)aView insideRect:(NSRect)rect toData:(NSMutableData *)data printInfo:(NSPrintInfo *)aPrintInfo { RELEASE(self); return [[GSEPSPrintOperation alloc] initWithView: aView insideRect: rect toData: data printInfo: aPrintInfo]; } - (id)initWithView:(NSView *)aView printInfo:(NSPrintInfo *)aPrintInfo { RELEASE(self); return [[GSPrintOperation alloc] initWithView: aView printInfo: aPrintInfo]; } - (void) dealloc { RELEASE(_print_info); RELEASE(_view); RELEASE(_data); TEST_RELEASE(_context); TEST_RELEASE(_print_panel); TEST_RELEASE(_accessory_view); TEST_RELEASE(_path); TEST_RELEASE(_job_style_hint); [super dealloc]; } // // Determining the Type of Operation // /** Returns YES if the receiver is performing an operation whose output is EPS format. */ - (BOOL)isEPSOperation { return NO; } - (BOOL)isCopyingOperation { return NO; } // // Controlling the User Interface // /** Returns the NSPrintPanel associated with the receiver. */ - (NSPrintPanel *)printPanel { if (_print_panel == nil) ASSIGN(_print_panel, [NSPrintPanel printPanel]); return _print_panel; } /** Returns YES if the reciever display an NSPrintPanel and other information when running a print operation. */ - (BOOL)showPanels { return [self showsPrintPanel] && [self showsProgressPanel]; } /** Sets the NSPrintPanel used by the receiver obtaining and displaying printing information from/to the user. */ - (void)setPrintPanel:(NSPrintPanel *)panel { ASSIGN(_print_panel, panel); } /** Use this to set whether a print panel is displayed during a printing operation. If set to NO, then the receiver uses information that was previously set and does not display any status information about the progress of the printing operation. */ - (void)setShowPanels:(BOOL)flag { [self setShowsPrintPanel: flag]; [self setShowsProgressPanel: flag]; } - (BOOL)showsPrintPanel { return _flags.show_print_panel; } - (void)setShowsPrintPanel:(BOOL)flag { _flags.show_print_panel = flag; } - (BOOL)showsProgressPanel { return _flags.show_progress_panel; } - (void)setShowsProgressPanel:(BOOL)flag { _flags.show_progress_panel = flag; } /** Returns the accessory view used by the NSPrintPanel associated with the receiver. */ - (NSView *)accessoryView { return _accessory_view; } /** Set the accessory view used by the NSPrintPanel associated with the receiver. */ - (void)setAccessoryView:(NSView *)aView { ASSIGN(_accessory_view, aView); } // // Managing the drawing Context // /** This method is used by the print operation to create a special graphics context for use while running the print operation. */ - (NSGraphicsContext*)createContext { [self subclassResponsibility: _cmd]; return nil; } /** Returns the graphic contexts used by the print operation. */ - (NSGraphicsContext *)context { return _context; } /** This method is used by the print operation to destroy the special graphic context used while running the print operation. */ - (void)destroyContext { DESTROY(_context); } // // Page Information // /** Returns the page currently being printing. Returns 0 if no page is currently being printed */ - (int)currentPage { return _currentPage; } /** Returns the page order of printing. */ - (NSPrintingPageOrder)pageOrder { return _page_order; } /** Set the page order used when printing. */ - (void)setPageOrder:(NSPrintingPageOrder)order { _page_order = order; } // // Running a Print Operation // /** Called by the print operation after it has finished running a printing operation. */ - (void)cleanUpOperation { [[self printPanel] orderOut: self]; _currentPage = 0; [NSPrintOperation setCurrentOperation: nil]; } /** Called by the print operation to deliver the results of the printing operation. This might include sending the output to a printer, a file or a previewing program. Returns YES if the output was delivered sucessfully. */ - (BOOL)deliverResult { return NO; } /** Call this message to run the print operation on a view. This includes (optionally) displaying a print panel and working with the NSView to paginate and draw the contents of the view. */ - (BOOL)runOperation { BOOL result; if ([self showsPrintPanel]) { NSPrintPanel *panel = [self printPanel]; int button; [panel setAccessoryView: _accessory_view]; [self _setupPrintInfo]; button = [panel runModalWithPrintInfo: _print_info]; [panel setAccessoryView: nil]; if (button != NSOKButton) { [self cleanUpOperation]; return NO; } } result = NO; if ([self _runOperation]) result = [self deliverResult]; [self cleanUpOperation]; return result; } /** Run a print operation modally with respect to a window. */ - (void)runOperationModalForWindow: (NSWindow *)docWindow delegate: (id)delegate didRunSelector: (SEL)didRunSelector contextInfo:(void *)contextInfo { NSMutableDictionary *dict; NSPrintPanel *panel = [self printPanel]; if (delegate != nil && didRunSelector != NULL) { /* Save the selector so we can use it later */ dict = [_print_info dictionary]; [dict setObject: [NSValue value: &didRunSelector withObjCType: @encode(SEL)] forKey: @"GSModalRunSelector"]; [dict setObject: delegate forKey: @"GSModalRunDelegate"]; } /* Assume we want to show the panel regardless of the value of _showPanels */ [panel setAccessoryView: _accessory_view]; [self _setupPrintInfo]; [panel beginSheetWithPrintInfo: _print_info modalForWindow: docWindow delegate: self didEndSelector: @selector(_printOperationDidRun:returnCode:contextInfo:) contextInfo: contextInfo]; [panel setAccessoryView: nil]; } - (BOOL)canSpawnSeparateThread { return _flags.can_spawn_separate_thread; } - (void)setCanSpawnSeparateThread:(BOOL)flag { _flags.can_spawn_separate_thread = flag; } - (NSString *) jobStyleHint { return _job_style_hint; } - (void)setJobStyleHint:(NSString *)hint { ASSIGN(_job_style_hint, hint); } // // Getting the NSPrintInfo Object // /** Returns the NSPrintInfo object associated with the receiver. */ - (NSPrintInfo *)printInfo { return _print_info; } /** Set the NSPrintInfo object associated with the receiver. */ - (void)setPrintInfo:(NSPrintInfo *)aPrintInfo { if (aPrintInfo == nil) aPrintInfo = [NSPrintInfo sharedPrintInfo]; ASSIGNCOPY(_print_info, aPrintInfo); } // // Getting the NSView Object // /** Return the view that is the being printed. */ - (NSView *)view { return _view; } @end @implementation NSPrintOperation (Private) - (id) initWithView:(NSView *)aView insideRect:(NSRect)rect toData:(NSMutableData *)data printInfo:(NSPrintInfo *)aPrintInfo { if ([NSPrintOperation currentOperation] != nil) { [NSException raise: NSPrintOperationExistsException format: @"There is already a printoperation for this thread"]; } ASSIGN(_view, aView); _rect = rect; ASSIGN(_data, data); _page_order = NSUnknownPageOrder; [self setShowsPrintPanel: NO]; [self setShowsProgressPanel: NO]; [self setPrintInfo: aPrintInfo]; _path = nil; _currentPage = 0; [NSPrintOperation setCurrentOperation: self]; return self; } @end @implementation NSPrintOperation (TrulyPrivate) /* Private method to run the printing operation. Needs to create an autoreleaes pool to make sure the print context is destroyed before returning (which closes the print file.) */ - (BOOL) _runOperation { BOOL result; CREATE_AUTORELEASE_POOL(pool); NSGraphicsContext *oldContext = [NSGraphicsContext currentContext]; [self createContext]; if (_context == nil) return NO; result = NO; if (_page_order == NSUnknownPageOrder) { if ([[[_print_info dictionary] objectForKey: NSPrintReversePageOrder] boolValue] == YES) _page_order = NSDescendingPageOrder; else _page_order = NSAscendingPageOrder; } [NSGraphicsContext setCurrentContext: _context]; NS_DURING { [self _print]; result = YES; [NSGraphicsContext setCurrentContext: oldContext]; } NS_HANDLER { [_view _cleanupPrinting]; [NSGraphicsContext setCurrentContext: oldContext]; NSRunAlertPanel(_(@"Error"), _(@"Printing error: %@"), _(@"OK"), NULL, NULL, localException); } NS_ENDHANDLER [self destroyContext]; RELEASE(pool); return result; } - (void) _setupPrintInfo { BOOL knowsPageRange; NSRange viewPageRange = NSMakeRange(1, 0); NSMutableDictionary *dict = [_print_info dictionary]; knowsPageRange = [_view knowsPageRange: &viewPageRange]; if (knowsPageRange == YES) { int first = viewPageRange.location; int last = NSMaxRange(viewPageRange) - 1; [dict setObject: NSNUMBER(first) forKey: NSPrintFirstPage]; [dict setObject: NSNUMBER(last) forKey: NSPrintLastPage]; } } - (void)_printOperationDidRun:(NSPrintOperation *)printOperation returnCode:(int)returnCode contextInfo:(void *)contextInfo { id delegate; SEL didRunSelector; BOOL success = NO; NSMutableDictionary *dict; void (*didRun)(id, SEL, BOOL, id); if (returnCode == NSOKButton) { if ([self _runOperation]) success = [self deliverResult]; } [self cleanUpOperation]; dict = [_print_info dictionary]; [[dict objectForKey: @"GSModalRunSelector"] getValue: &didRunSelector]; delegate = [dict objectForKey: @"GSModalRunDelegate"]; if (delegate != nil && didRunSelector != NULL) { didRun = (void (*)(id, SEL, BOOL, id))[delegate methodForSelector: didRunSelector]; didRun (delegate, didRunSelector, success, contextInfo); } } /* static NSSize scaleSize(NSSize size, double scale) { size.height *= scale; size.width *= scale; return size; } */ static NSRect scaleRect(NSRect rect, double scale) { return NSMakeRect(NSMinX(rect) * scale, NSMinY(rect) * scale, NSWidth(rect) * scale, NSHeight(rect) * scale); } /* * Pagination - guess how many pages we need to print. This could be off * in both X and Y because of the view's ability to adjust the width and * height of the printRect during printing. * Also set up a bunch of other information needed for printing. */ - (void) _printPaginateWithInfo: (page_info_t *)info knowsRange: (BOOL)knowsRange { NSMutableDictionary *dict; NSNumber *value; dict = [_print_info dictionary]; info->paperSize = [_print_info paperSize]; info->orient = [_print_info orientation]; value = [dict objectForKey: NSPrintScalingFactor]; if (value != nil) info->printScale = [value doubleValue]; else info->printScale = 1.0; info->nup = [[dict objectForKey: NSPrintPagesPerSheet] intValue]; info->nupScale = 1; if (info->nup < 1 || (info->nup > 1 && (((info->nup) & 0x1) == 1))) { /* Bad nup value */ info->nup = 1; [dict setObject: NSNUMBER(1) forKey: NSPrintPagesPerSheet]; } /* Subtract the margins from the paper size to get print boundary */ info->paperBounds.size = info->paperSize; info->paperBounds.origin.x = [_print_info leftMargin]; info->paperBounds.origin.y = [_print_info bottomMargin]; info->paperBounds.size.width -= ([_print_info rightMargin]+[_print_info leftMargin]); info->paperBounds.size.height -= ([_print_info topMargin]+[_print_info bottomMargin]); if (info->orient == NSLandscapeOrientation) { /* Bounding box needs to be in default user space, but the bbox we get is rotated */ info->sheetBounds = NSMakeRect(NSMinY(info->paperBounds), NSMinX(info->paperBounds), NSHeight(info->paperBounds), NSWidth(info->paperBounds)); } else { info->sheetBounds = info->paperBounds; } /* Save this for the view to look at */ [dict setObject: [NSValue valueWithRect: info->paperBounds] forKey: @"NSPrintPaperBounds"]; [dict setObject: [NSValue valueWithRect: info->sheetBounds] forKey: @"NSPrintSheetBounds"]; /* Scale bounds by the user specified scaling */ info->scaledBounds = scaleRect(_rect, info->printScale); info->pageScale = 1; // default if (knowsRange == NO) { /* Now calculate page fitting to get page scale */ if ([_print_info horizontalPagination] == NSFitPagination) info->pageScale = info->paperBounds.size.width / NSWidth(info->scaledBounds); if ([_print_info verticalPagination] == NSFitPagination) info->pageScale = MIN(info->pageScale, NSHeight(info->paperBounds)/NSHeight(info->scaledBounds)); /* Scale bounds by pageScale */ info->scaledBounds = scaleRect(info->scaledBounds, info->pageScale); /* Now find out how many pages */ info->xpages = ceil(NSWidth(info->scaledBounds)/NSWidth(info->paperBounds)); info->ypages = ceil(NSHeight(info->scaledBounds)/NSHeight(info->paperBounds)); if ([_print_info horizontalPagination] == NSClipPagination) info->xpages = 1; if ([_print_info verticalPagination] == NSClipPagination) info->ypages = 1; } /* * Calculate nup. If nup is an odd multiple of two, secretly change the * page orientation to it's complement to make pages fit better. */ if (((int)(info->nup / 2) & 0x1) == 1) { CGFloat tmp; if (info->orient == NSLandscapeOrientation) info->nupScale = info->paperSize.width/(2*info->paperSize.height); else info->nupScale = info->paperSize.height/(2*info->paperSize.width); info->nupScale /= (info->nup / 2); info->orient = (info->orient == NSPortraitOrientation) ? NSLandscapeOrientation : NSPortraitOrientation; tmp = info->paperSize.width; info->paperSize.width = info->paperSize.height; info->paperSize.height = tmp; [dict setObject: NSNUMBER(info->orient) forKey: NSPrintOrientation]; } else if (info->nup > 1) { info->nupScale = 2.0 / (CGFloat)info->nup; } if ([[dict objectForKey: NSPrintPageDirection] isEqual: @"Columns"]) info->pageDirection = 1; else info->pageDirection = 0; } /* Our personnel method to calculate the print rect for the specified page. Note, we assume this function is called in order from our first to last page. The returned pageRect is in the view's coordinate system */ - (NSRect) _rectForPage: (int)page info: (page_info_t *)info xpage: (int *)xptr ypage: (int *)yptr { int xpage, ypage; NSRect pageRect; if (info->pageDirection == 1) { xpage = (page - 1) / info->ypages; ypage = (page - 1) % info->ypages; } else { xpage = (page - 1) % info->xpages; ypage = (page - 1) / info->xpages; } *xptr = xpage; *yptr = ypage; if (xpage == 0) info->lastWidth = 0; if (ypage == 0) info->lastHeight = 0; pageRect = NSMakeRect(info->lastWidth, info->lastHeight, NSWidth(info->paperBounds), NSHeight(info->paperBounds)); pageRect = NSIntersectionRect(pageRect, info->scaledBounds); /* Scale to view's coordinate system */ return scaleRect(pageRect, 1/(info->pageScale*info->printScale)); } /* Let the view adjust the page rect we calculated. See assumptions for _rectForPage: */ - (NSRect) _adjustPagesFirst: (int)first last: (int)last info: (page_info_t *)info { int i, xpage, ypage; double hlimit, wlimit; NSRect pageRect = NSZeroRect; /* Silence compiler warning. */ hlimit = [_view heightAdjustLimit]; wlimit = [_view widthAdjustLimit]; for (i = first; i <= last; i++) { CGFloat newVal, limitVal; pageRect = [self _rectForPage: i info: info xpage: &xpage ypage: &ypage]; limitVal = NSMaxY(pageRect) - hlimit * NSHeight(pageRect); [_view adjustPageHeightNew: &newVal top: NSMinY(pageRect) bottom: NSMaxY(pageRect) limit: limitVal]; if (newVal < NSMaxY(pageRect)) pageRect.size.height = MAX(newVal, limitVal) - NSMinY(pageRect); limitVal = NSMaxX(pageRect) - wlimit * NSWidth(pageRect); [_view adjustPageWidthNew: &newVal left: NSMinX(pageRect) right: NSMaxX(pageRect) limit: limitVal]; if (newVal < NSMaxX(pageRect)) pageRect.size.width = MAX(newVal, limitVal) - NSMinX(pageRect); if (info->pageDirection == 0 || ypage == info->ypages - 1) info->lastWidth = NSMaxX(pageRect)*(info->pageScale*info->printScale); if (info->pageDirection == 1 || xpage == info->xpages - 1) info->lastHeight = NSMaxY(pageRect)*(info->pageScale*info->printScale); } return pageRect; } - (void) _print { int i, dir; BOOL knowsPageRange, allPages; NSRange viewPageRange = NSMakeRange(1, 0); NSMutableDictionary *dict; NSNumber *value; page_info_t info; dict = [_print_info dictionary]; /* Setup pagination */ knowsPageRange = [_view knowsPageRange: &viewPageRange]; [self _printPaginateWithInfo: &info knowsRange: knowsPageRange]; if (knowsPageRange == NO) { viewPageRange = NSMakeRange(1, (info.xpages * info.ypages)); } else { // These values never get used info.xpages = 1; info.ypages = viewPageRange.length; } [dict setObject: NSNUMBER(NSMaxRange(viewPageRange)) forKey: @"NSPrintTotalPages"]; value = [dict objectForKey: NSPrintAllPages]; if (value != nil) allPages = [value boolValue]; else allPages = YES; if (allPages == YES) { info.first = viewPageRange.location; info.last = NSMaxRange(viewPageRange) - 1; } else { value = [dict objectForKey: NSPrintFirstPage]; if (value != nil) info.first = [value intValue]; else info.first = 1; value = [dict objectForKey: NSPrintLastPage]; if (value != nil) info.last = [value intValue]; else info.last = INT_MAX; info.first = MAX(info.first, (int)viewPageRange.location); info.first = MIN(info.first, (int)(NSMaxRange(viewPageRange) - 1)); info.last = MAX(info.last, info.first); info.last = MIN(info.last, (int)(NSMaxRange(viewPageRange) - 1)); viewPageRange = NSMakeRange(info.first, (info.last-info.first)+1); } [dict setObject: NSFNUMBER(info.nupScale) forKey: @"NSNupScale"]; [dict setObject: NSNUMBER(info.first) forKey: NSPrintFirstPage]; if (allPages == YES && knowsPageRange == NO) [dict setObject: NSNUMBER(info.first-1) forKey: NSPrintLastPage]; else [dict setObject: NSNUMBER(info.last) forKey: NSPrintLastPage]; NSDebugLLog(@"NSPrinting", @"Printing pages %d to %d", info.first, info.last); NSDebugLLog(@"NSPrinting", @"Printing rect %@, scaled %@", NSStringFromRect(_rect), NSStringFromRect(info.scaledBounds)); if (_page_order == NSDescendingPageOrder) { _currentPage = info.last; dir = -1; } else { _currentPage = info.first; dir = 1; } /* * FIXME: Independent of the page order we could pre-calculate the * pageRects for all pages up to last (including clipping adjustment) * and use them when printing. */ info.lastWidth = info.lastHeight = 0; if (!knowsPageRange && dir > 0 && _currentPage != 1) { /* Calculate page rects we aren't processing to catch up to the first page we are */ [self _adjustPagesFirst: 1 last: _currentPage - 1 info: &info]; } /* Print the header information */ [_view beginDocument]; /* Print each page */ i = 0; while (i < (info.last - info.first + 1)) { NSRect pageRect; if (knowsPageRange == YES) { pageRect = [_view rectForPage: _currentPage]; } else { if (dir < 0) pageRect = [self _adjustPagesFirst: 1 last: _currentPage info: &info]; else pageRect = [self _adjustPagesFirst: _currentPage last: _currentPage info: &info]; } NSDebugLLog(@"NSPrinting", @" current page %d, rect %@", _currentPage, NSStringFromRect(pageRect)); if (NSIsEmptyRect(pageRect)) break; /* Draw using our special view routine */ [_view _displayPageInRect: pageRect withInfo: info knowsPageRange: knowsPageRange]; // We could end up in this case for each row/column not just the lase page. if (!knowsPageRange && dir > 0 && _currentPage == info.last && allPages == YES) { /* Check if adjust pages forced part of the bounds onto another page */ if (NSMaxX(pageRect) < NSMaxX(_rect) && [_print_info horizontalPagination] != NSClipPagination) { info.xpages++; } if (NSMaxY(pageRect) < NSMaxY(_rect) && [_print_info verticalPagination] != NSClipPagination) { info.ypages++; } viewPageRange = NSMakeRange(1, (info.xpages * info.ypages)); info.last = NSMaxRange(viewPageRange) - 1; } i++; _currentPage += dir; } /* Print each page */ /* Make sure we end the sheet */ if (info.nup > 1 && (info.last - info.first) % info.nup != info.nup - 1) { [_view drawSheetBorderWithSize: info.sheetBounds.size]; [_view _endSheet]; DPSgrestore([self context]); } [_view endDocument]; /* Setup/reset for next time */ [dict setObject: NSNUMBER(info.last) forKey: NSPrintLastPage]; if (((int)(info.nup / 2) & 0x1) == 1) { info.orient = (info.orient == NSPortraitOrientation) ? NSLandscapeOrientation : NSPortraitOrientation; [dict setObject: NSNUMBER(info.orient) forKey: NSPrintOrientation]; } } @end @implementation NSView (NSPrintOperation) - (void) _displayPageInRect: (NSRect)pageRect withInfo: (page_info_t)info knowsPageRange: (BOOL)knowsPageRange { int currentPage; int numberOnSheet; CGFloat xoffset, yoffset, scale; NSPoint location; NSPrintOperation *printOp = [NSPrintOperation currentOperation]; NSGraphicsContext *ctxt = [printOp context]; currentPage = [printOp currentPage]; numberOnSheet = (currentPage - info.first) % info.nup; /* Begin a sheet (i.e. a physical page in Postscript terms). If nup > 1 then this occurs only once every nup pages */ if (numberOnSheet == 0) { NSString *label; NSRect boundsForPage = info.sheetBounds; if (knowsPageRange) { boundsForPage = pageRect; } label = nil; if (info.nup == 1) label = [NSString stringWithFormat: @"%d", currentPage]; DPSgsave(ctxt); [self beginPage: floor((currentPage - info.first)/info.nup)+1 label: label bBox: boundsForPage fonts: nil]; if (info.orient == NSLandscapeOrientation) { DPSrotate(ctxt, 90); DPStranslate(ctxt, 0, -info.paperSize.height); } if (!knowsPageRange) { /* Also offset by margins */ DPStranslate(ctxt, NSMinX(info.paperBounds), NSMinY(info.paperBounds)); } /* End page setup for multi page */ if (info.nup != 1) { [self addToPageSetup]; [self endPageSetup]; } } scale = info.pageScale * info.printScale; location = [self locationOfPrintRect: scaleRect(pageRect, scale)]; /* Begin a logical page */ [self beginPageInRect: pageRect atPlacement: location]; if (scale != 1.0) DPSscale(ctxt, scale, scale); /* FIXME: Why is this needed? Shouldn't the flip be handled by the lockFocus method? */ if ([self isFlipped]) { NSAffineTransformStruct ats = { 1, 0, 0, -1, 0, NSHeight(_bounds) }; NSAffineTransform *matrix, *flip; flip = [NSAffineTransform new]; matrix = [NSAffineTransform new]; if (_boundsMatrix != nil) { [matrix prependTransform: _boundsMatrix]; } /* * The flipping process must result in a coordinate system that * exactly overlays the original. To do that, we must translate * the origin by the height of the view. */ [flip setTransformStruct: ats]; [matrix prependTransform: flip]; [matrix concat]; RELEASE(flip); RELEASE(matrix); yoffset = NSHeight(_frame) - NSMaxY(pageRect); } else yoffset = 0 - NSMinY(pageRect); /* Translate so the rect we're printing is on the page */ xoffset = 0 - NSMinX(pageRect); DPStranslate(ctxt, xoffset, yoffset); /* End page setup for single page */ if (info.nup == 1) { [self addToPageSetup]; [self endPageSetup]; } /* Do the actual drawing */ [self displayRectIgnoringOpacity: pageRect inContext: ctxt]; /* End a logical page */ // FIXME: Attempt to get the coordinates of the page border correct. DPSgrestore(ctxt); DPSgsave(ctxt); [self drawPageBorderWithSize: info.paperBounds.size]; [self endPage]; /* End a physical page */ if (numberOnSheet == info.nup - 1) { [self drawSheetBorderWithSize: info.sheetBounds.size]; [self _endSheet]; DPSgrestore(ctxt); } } @end gnustep-gui-0.24.0/Source/GSTitleView.m0000664000076500007650000003304612224451506017535 0ustar brains99brains99/** GSTitleView Copyright (C) 2003 Free Software Foundation, Inc. Author: Serg Stoyan Date: Mar 2003 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSAttributedString.h" #import "AppKit/NSButton.h" #import "AppKit/NSColor.h" #import "AppKit/NSEvent.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSImage.h" #import "AppKit/NSMenu.h" #import "AppKit/NSMenuView.h" #import "AppKit/NSPanel.h" #import "AppKit/NSStringDrawing.h" #import "AppKit/NSView.h" #import "AppKit/NSWindow.h" #import "GNUstepGUI/GSTitleView.h" #import "GNUstepGUI/GSTheme.h" @implementation GSTitleView // ============================================================================ // ==== Initialization & deallocation // ============================================================================ + (float) height { return [NSMenuView menuBarHeight] + 1; } - (id) init { self = [super init]; if (!self) return nil; _owner = nil; _ownedByMenu = NO; _isKeyWindow = NO; _isMainWindow = NO; _isActiveApplication = NO; [self setAutoresizingMask: NSViewWidthSizable | NSViewMinYMargin]; textAttributes = [[NSMutableDictionary alloc] initWithObjectsAndKeys: [NSFont boldSystemFontOfSize: 0], NSFontAttributeName, [NSColor blackColor], NSForegroundColorAttributeName, nil]; titleColor = RETAIN ([NSColor lightGrayColor]); return self; } - (id) initWithOwner: (id)owner { self = [self init]; if (!self) return nil; [self setOwner: owner]; return self; } - (void) setOwner: (id)owner { NSNotificationCenter *theCenter = [NSNotificationCenter defaultCenter]; if ([owner isKindOfClass: [NSWindow class]]) { NSDebugLLog(@"GSTitleView", @"owner is NSWindow or NSPanel"); _owner = owner; _ownedByMenu = NO; [self setFrame: NSMakeRect (-1, [_owner frame].size.height - [GSTitleView height]-40, [_owner frame].size.width+2, [GSTitleView height])]; if ([_owner styleMask] & NSClosableWindowMask) { [self addCloseButtonWithAction: @selector(performClose:)]; } if ([_owner styleMask] & NSMiniaturizableWindowMask) { [self addMiniaturizeButtonWithAction: @selector(performMiniaturize:)]; } // NSWindow observers [theCenter addObserver: self selector: @selector(windowBecomeKey:) name: NSWindowDidBecomeKeyNotification object: _owner]; [theCenter addObserver: self selector: @selector(windowResignKey:) name: NSWindowDidResignKeyNotification object: _owner]; [theCenter addObserver: self selector: @selector(windowBecomeMain:) name: NSWindowDidBecomeMainNotification object: _owner]; [theCenter addObserver: self selector: @selector(windowResignMain:) name: NSWindowDidResignMainNotification object: _owner]; // NSApplication observers [theCenter addObserver: self selector: @selector(applicationBecomeActive:) name: NSApplicationWillBecomeActiveNotification object: NSApp]; [theCenter addObserver: self selector: @selector(applicationResignActive:) name: NSApplicationWillResignActiveNotification object: NSApp]; } else if ([owner isKindOfClass: [NSMenu class]]) { NSColor *textColor; GSTheme *theme; NSDebugLLog(@"GSTitleView", @"owner is NSMenu"); _owner = owner; _ownedByMenu = YES; theme = [GSTheme theme]; RELEASE (titleColor); titleColor = RETAIN ([theme colorNamed: @"GSMenuBar" state: GSThemeNormalState]); if (titleColor == nil) { titleColor = RETAIN ([NSColor blackColor]); } textColor = [theme colorNamed: @"GSMenuBarTitle" state: GSThemeNormalState]; if (textColor == nil) { textColor = [NSColor whiteColor]; } [textAttributes setObject: textColor forKey: NSForegroundColorAttributeName]; } else { NSDebugLLog(@"GSTitleView", @"%@ owner is not NSMenu or NSWindow or NSPanel", [owner className]); return; } } - (id) owner { return _owner; } - (void) dealloc { if (!_ownedByMenu) { [[NSNotificationCenter defaultCenter] removeObserver: self]; } RELEASE(textAttributes); RELEASE(titleColor); [[GSTheme theme] setName: nil forElement: [closeButton cell] temporary: NO]; TEST_RELEASE(closeButton); TEST_RELEASE(miniaturizeButton); [super dealloc]; } // ============================================================================ // ==== Drawing // ============================================================================ - (NSSize) titleSize { return [[_owner title] sizeWithAttributes: textAttributes]; } - (void) drawRect: (NSRect)rect { NSRect workRect = [[GSTheme theme] drawMenuTitleBackground: self withBounds: [self bounds] withClip: rect]; // Draw the title NSSize titleSize = [self titleSize]; workRect.origin.x += 4; workRect.origin.y = NSMidY (workRect) - titleSize.height / 2; workRect.size.height = titleSize.height; [[_owner title] drawInRect: workRect withAttributes: textAttributes]; } // ============================================================================ // ==== Mouse actions // ============================================================================ - (BOOL) acceptsFirstMouse: (NSEvent *)theEvent { return YES; } - (void) mouseDown: (NSEvent*)theEvent { NSPoint lastLocation; NSPoint location; NSUInteger eventMask = NSLeftMouseUpMask | NSPeriodicMask; BOOL done = NO; BOOL moved = NO; NSDate *theDistantFuture = [NSDate distantFuture]; NSPoint startWindowOrigin; NSPoint endWindowOrigin; NSDebugLLog (@"NSMenu", @"Mouse down in title!"); // Remember start position of window startWindowOrigin = [_window frame].origin; // Remember start location of cursor in window lastLocation = [theEvent locationInWindow]; [_window _captureMouse: nil]; [NSEvent startPeriodicEventsAfterDelay: 0.02 withPeriod: 0.02]; while (!done) { theEvent = [NSApp nextEventMatchingMask: eventMask untilDate: theDistantFuture inMode: NSEventTrackingRunLoopMode dequeue: YES]; switch ([theEvent type]) { case NSRightMouseUp: case NSLeftMouseUp: done = YES; [_window _releaseMouse: nil]; break; case NSPeriodic: location = [_window mouseLocationOutsideOfEventStream]; if (NSEqualPoints(location, lastLocation) == NO) { NSPoint origin = [_window frame].origin; moved = YES; origin.x += (location.x - lastLocation.x); origin.y += (location.y - lastLocation.y); if (_ownedByMenu) { [_owner nestedSetFrameOrigin: origin]; } else { [_owner setFrameOrigin: origin]; } } break; default: break; } } // Make menu torn off if (_ownedByMenu && ![_owner isTornOff] && [_owner supermenu]) { endWindowOrigin = [_window frame].origin; if ((startWindowOrigin.x != endWindowOrigin.x || startWindowOrigin.y != endWindowOrigin.y)) { [_owner setTornOff: YES]; } } [NSEvent stopPeriodicEvents]; if (moved == YES) { // Let everything know the window has moved. [[NSNotificationCenter defaultCenter] postNotificationName: NSWindowDidMoveNotification object: _window]; } } // We do not need app menu over menu - (void) rightMouseDown: (NSEvent*)theEvent { } // We do not want to popup menus in this menu. - (NSMenu *) menuForEvent: (NSEvent*) theEvent { return nil; } // ============================================================================ // ==== NSWindow & NSApplication notifications // ============================================================================ - (void) applicationBecomeActive: (NSNotification *)notification { _isActiveApplication = YES; } - (void) applicationResignActive: (NSNotification *)notification { _isActiveApplication = NO; RELEASE (titleColor); titleColor = RETAIN ([NSColor lightGrayColor]); [textAttributes setObject: [NSColor blackColor] forKey: NSForegroundColorAttributeName]; [self setNeedsDisplay: YES]; } - (void) windowBecomeKey: (NSNotification *)notification { _isKeyWindow = YES; RELEASE (titleColor); titleColor = RETAIN ([NSColor blackColor]); [textAttributes setObject: [NSColor whiteColor] forKey: NSForegroundColorAttributeName]; [self setNeedsDisplay: YES]; } - (void) windowResignKey: (NSNotification *)notification { _isKeyWindow = NO; RELEASE (titleColor); if (_isActiveApplication && _isMainWindow) { titleColor = RETAIN ([NSColor darkGrayColor]); [textAttributes setObject: [NSColor whiteColor] forKey: NSForegroundColorAttributeName]; } else { titleColor = RETAIN ([NSColor lightGrayColor]); [textAttributes setObject: [NSColor blackColor] forKey: NSForegroundColorAttributeName]; } [self setNeedsDisplay: YES]; } - (void) windowBecomeMain: (NSNotification *)notification { _isMainWindow = YES; } - (void) windowResignMain: (NSNotification *)notification { _isMainWindow = NO; } // ============================================================================ // ==== Buttons // ============================================================================ - (void) addCloseButtonWithAction: (SEL)closeAction { if (closeButton == nil) { NSSize viewSize; NSSize buttonSize; [[GSTheme theme] setName: nil forElement: [closeButton cell] temporary: NO]; ASSIGN(closeButton, [NSWindow standardWindowButton: NSWindowCloseButton forStyleMask: NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask]); [[GSTheme theme] setName: @"GSMenuCloseButton" forElement: [closeButton cell] temporary: NO]; [closeButton setTarget: _owner]; [closeButton setAction: closeAction]; viewSize = [self frame].size; buttonSize = [[closeButton image] size]; buttonSize = NSMakeSize(buttonSize.width + 3, buttonSize.height + 3); // Update location [closeButton setFrame: NSMakeRect(viewSize.width - buttonSize.width - 4, (viewSize.height - buttonSize.height) / 2, buttonSize.width, buttonSize.height)]; [closeButton setAutoresizingMask: NSViewMinXMargin | NSViewMaxYMargin]; } if ([closeButton superview] == nil) { [self addSubview: closeButton]; [self setNeedsDisplay: YES]; } } - (NSButton *) closeButton { return closeButton; } - (void) removeCloseButton { if ([closeButton superview] != nil) { [closeButton removeFromSuperview]; } } - (void) addMiniaturizeButtonWithAction: (SEL)miniaturizeAction { if (miniaturizeButton == nil) { NSSize viewSize; NSSize buttonSize; ASSIGN(miniaturizeButton, [NSWindow standardWindowButton: NSWindowMiniaturizeButton forStyleMask: NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask]); [miniaturizeButton setTarget: _owner]; [miniaturizeButton setAction: miniaturizeAction]; viewSize = [self frame].size; buttonSize = [[miniaturizeButton image] size]; buttonSize = NSMakeSize(buttonSize.width + 3, buttonSize.height + 3); // Update location [miniaturizeButton setFrame: NSMakeRect(4, (viewSize.height - buttonSize.height) / 2, buttonSize.width, buttonSize.height)]; [miniaturizeButton setAutoresizingMask: NSViewMaxXMargin | NSViewMaxYMargin]; } if ([miniaturizeButton superview] == nil) { [self addSubview: miniaturizeButton]; [self setNeedsDisplay: YES]; } } - (NSButton *) miniaturizeButton { return miniaturizeButton; } - (void) removeMiniaturizeButton { if ([miniaturizeButton superview] != nil) { [miniaturizeButton removeFromSuperview]; } } @end gnustep-gui-0.24.0/Source/NSTextAttachment.m0000664000076500007650000002315611534147002020562 0ustar brains99brains99/** NSTextAttachment Classes to represent text attachments. NSTextAttachment is used to represent text attachments. When inline, text attachments appear as the value of the NSAttachmentAttributeName attached to the special character NSAttachmentCharacter. NSTextAttachment uses an object obeying the NSTextAttachmentCell protocol to get input from the user and to display an image. NSTextAttachmentCell is a simple subclass of NSCell which provides the NSTextAttachment protocol. Copyright (C) 2000 Free Software Foundation, Inc. Author: Fred Kiefer Date: June 2000 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "AppKit/NSCell.h" #import "AppKit/NSFileWrapper.h" #import "AppKit/NSImage.h" #import "AppKit/NSEvent.h" #import "AppKit/NSTextContainer.h" #import "AppKit/NSTextAttachment.h" #import "AppKit/NSTextView.h" @implementation NSTextAttachmentCell - (void)drawWithFrame: (NSRect)cellFrame inView: (NSView *)controlView characterIndex: (unsigned)charIndex { [self drawWithFrame: cellFrame inView: controlView]; } - (void)drawWithFrame: (NSRect)cellFrame inView: (NSView *)controlView characterIndex: (unsigned)charIndex layoutManager: (NSLayoutManager *)layoutManager { [self drawWithFrame: cellFrame inView: controlView characterIndex: charIndex]; } - (NSPoint)cellBaselineOffset { return NSZeroPoint; } - (NSRect)cellFrameForTextContainer: (NSTextContainer *)textContainer proposedLineFragment: (NSRect)lineFrag glyphPosition: (NSPoint)position characterIndex: (unsigned)charIndex { NSRect aRect; aRect.origin = [self cellBaselineOffset]; aRect.size = [self cellSize]; return aRect; } - (BOOL)wantsToTrackMouse { return YES; } - (BOOL)wantsToTrackMouseForEvent: (NSEvent *)theEvent inRect: (NSRect)cellFrame ofView: (NSView *)controlView atCharacterIndex: (unsigned)charIndex { return [self wantsToTrackMouse]; } - (BOOL)trackMouse: (NSEvent *)theEvent inRect: (NSRect)cellFrame ofView: (NSView *)controlView untilMouseUp: (BOOL)flag { if ([controlView respondsToSelector: @selector(delegate)]) { NSTextView *textView = (NSTextView*)controlView; id delegate = [textView delegate]; NSEventType type = [theEvent type]; if (type == NSLeftMouseUp) { if ([theEvent clickCount] == 2) { if (delegate != nil && [delegate respondsToSelector: @selector(textView:doubleClickedOnCell:inRect:)]) { [delegate textView: textView doubleClickedOnCell: self inRect: cellFrame]; return YES; } } else { if (delegate != nil && [delegate respondsToSelector: @selector(textView:clickedOnCell:inRect:)]) { [delegate textView: textView clickedOnCell: self inRect: cellFrame]; return YES; } } } else if (type == NSLeftMouseDragged) { if (delegate != nil && [delegate respondsToSelector: @selector(textView:draggedCell:inRect:event:)]) { [delegate textView: textView draggedCell: self inRect: cellFrame event: theEvent]; return YES; } } } return [super trackMouse: theEvent inRect: cellFrame ofView: controlView untilMouseUp: flag]; } - (BOOL)trackMouse: (NSEvent *)theEvent inRect: (NSRect)cellFrame ofView: (NSView *)controlView atCharacterIndex: (unsigned)charIndex untilMouseUp: (BOOL)flag { if ([controlView respondsToSelector: @selector(delegate)]) { NSTextView *textView = (NSTextView*)controlView; id delegate = [textView delegate]; NSEventType type = [theEvent type]; if (type == NSLeftMouseDown) { if ([theEvent clickCount] == 2) { if (delegate != nil) { if ([delegate respondsToSelector: @selector(textView:doubleClickedOnCell:inRect:atIndex:)]) { [delegate textView: textView doubleClickedOnCell: self inRect: cellFrame atIndex: charIndex]; return YES; } else if ([delegate respondsToSelector: @selector(textView:doubleClickedOnCell:inRect:)]) { [delegate textView: textView doubleClickedOnCell: self inRect: cellFrame]; return YES; } } } else { if (delegate != nil) { if ([delegate respondsToSelector: @selector(textView:clickedOnCell:inRect:atIndex:)]) { [delegate textView: textView clickedOnCell: self inRect: cellFrame atIndex: charIndex]; return YES; } else if ([delegate respondsToSelector: @selector(textView:clickedOnCell:inRect:)]) { [delegate textView: textView clickedOnCell: self inRect: cellFrame]; return YES; } } } } else if (type == NSLeftMouseDragged) { if (delegate != nil && [delegate respondsToSelector: @selector(textView:draggedCell:inRect:event:atIndex:)]) { [delegate textView: textView draggedCell: self inRect: cellFrame event: theEvent atIndex: charIndex]; return YES; } } } return [self trackMouse: theEvent inRect: cellFrame ofView: controlView untilMouseUp: flag]; } - (void)setAttachment: (NSTextAttachment *)anObject { NSFileWrapper *fileWrap = [anObject fileWrapper]; // Do not retain the attachment _attachment = anObject; if (fileWrap != nil) { NSImage *icon = nil; NSString *fileName = [fileWrap filename]; if (fileName != nil) { // Try to set the image to the file wrapper content icon = [[NSImage alloc] initByReferencingFile: fileName]; } if (icon == nil) icon = RETAIN([fileWrap icon]); [self setImage: icon]; RELEASE(icon); } } - (NSTextAttachment *)attachment { return _attachment; } //FIXME: I had to add those methods to keep the compiler quite. // This are already defined on the super class and should be taken from there. - (NSSize)cellSize { return [super cellSize]; } - (void)highlight: (BOOL)flag withFrame: (NSRect)cellFrame inView: (NSView *)controlView { [super highlight: flag withFrame: cellFrame inView: controlView]; } - (void)drawWithFrame: (NSRect)cellFrame inView: (NSView *)controlView { [super drawWithFrame: cellFrame inView: controlView]; } @end @implementation NSTextAttachment - (id) init { return [self initWithFileWrapper: nil]; } - (void) dealloc { DESTROY(_fileWrapper); DESTROY(_cell); [super dealloc]; } - (id) initWithFileWrapper: (NSFileWrapper *)fileWrapper { self = [super init]; if (self != nil) { ASSIGN(_fileWrapper, fileWrapper); _cell = [[NSTextAttachmentCell alloc ] init]; [_cell setAttachment: self]; } return self; } - (void)setFileWrapper: (NSFileWrapper *)fileWrapper { ASSIGN(_fileWrapper, fileWrapper); // Reset the cell, so it shows the new attachment if ([_cell respondsToSelector: @selector(setAttachment:)] == YES) { [_cell setAttachment: self]; } } - (NSFileWrapper *)fileWrapper { return _fileWrapper; } - (id )attachmentCell { return _cell; } - (void)setAttachmentCell: (id )cell { ASSIGN(_cell, cell); if ([_cell respondsToSelector: @selector(setAttachment:)] == YES) { [_cell setAttachment: self]; } } /* * NSCoding protocol */ - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { // TODO_NIB: Determine keys for NSTextAttachment. } else { [aCoder encodeObject: _fileWrapper]; [aCoder encodeObject: _cell]; } } - (id) initWithCoder: (NSCoder*)aDecoder { if ([aDecoder allowsKeyedCoding]) { // TODO_NIB: Determine keys for NSTextAttachment. } else { [aDecoder decodeValueOfObjCType: @encode(id) at: &_fileWrapper]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_cell]; // Reconnect the cell, so the cell does not have to store the attachment if ([_cell respondsToSelector: @selector(setAttachment:)] == YES) { [_cell setAttachment: self]; } } return self; } @end gnustep-gui-0.24.0/Source/NSSplitView.m0000664000076500007650000011370412216161560017555 0ustar brains99brains99/** NSSplitView Allows multiple views to share a region in a window Copyright (C) 1996, 1998, 1999, 2000, 2001, 2004, 2008 Free Software Foundation, Inc. Author: Robert Vasvari Date: Jul 1998 Author: Felipe A. Rodriguez Date: November 1998 Author: Richard Frith-Macdonald Date: January 1999 Author: Nicola Pero Date: 2000, 2001, 2008 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import #import #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSColor.h" #import "AppKit/NSCursor.h" #import "AppKit/NSEvent.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSImage.h" #import "AppKit/NSSplitView.h" #import "AppKit/NSWindow.h" #import "GSGuiPrivate.h" static NSNotificationCenter *nc = nil; @implementation NSSplitView + (void) initialize { nc = [NSNotificationCenter defaultCenter]; } /* * Instance methods */ - (id) initWithFrame: (NSRect)frameRect { if ((self = [super initWithFrame: frameRect]) != nil) { _dividerWidth = [self dividerThickness]; _draggedBarWidth = 8; // default bigger than dividerThickness _isVertical = NO; ASSIGN(_dividerColor, [NSColor controlShadowColor]); ASSIGN(_dimpleImage, [NSImage imageNamed: @"common_Dimple"]); _never_displayed_before = YES; _autoresizes_subviews = NO; _is_pane_splitter = YES; } return self; } - (void) dealloc { RELEASE(_backgroundColor); RELEASE(_dividerColor); RELEASE(_dimpleImage); TEST_RELEASE(_autosaveName); if (_delegate != nil) { [nc removeObserver: _delegate name: nil object: self]; _delegate = nil; } [super dealloc]; } - (void) _autosaveSubviewProportions { if (_autosaveName != nil) { NSUserDefaults *defaults; NSString *splitViewKey; NSMutableDictionary *config; NSArray *subs = [self subviews]; NSUInteger count = [subs count]; NSView *views[count]; defaults = [NSUserDefaults standardUserDefaults]; splitViewKey = [NSString stringWithFormat: @"NSSplitView Dividers %@", _autosaveName]; config = [NSMutableDictionary new]; [subs getObjects: views]; /* Compute the proportions and store them. */ if (count > 0) { NSUInteger i; CGFloat oldTotal = 0.0; NSRect frames[count]; for (i = 0; i < count; i++) { frames[i] = [views[i] frame]; if (_isVertical == NO) { oldTotal += NSHeight(frames[i]); } else { oldTotal += NSWidth(frames[i]); } } for (i = 0; i < (count - 1); i++) { NSString *key; double proportion; if (_isVertical == NO) { proportion = (NSHeight(frames[i]))/oldTotal; } else { proportion = (NSWidth(frames[i]))/oldTotal; } key = [NSString stringWithFormat: @"%u", i]; [config setObject: [NSNumber numberWithDouble: proportion] forKey: key]; } } [defaults setObject: config forKey: splitViewKey]; [defaults synchronize]; RELEASE (config); } } - (BOOL) acceptsFirstMouse: (NSEvent*)theEvent { return YES; } /** * Utility function to draw the xor-ed splitview divider * It is only used in the non-live resize mode. */ - (BOOL) _drawHighlightedDividerWithSize: (NSRect) r andOldSize: (NSRect) oldRect isLit: (BOOL) lit { if (NSEqualRects(r, oldRect) == YES) { return lit; } NSDebugLLog(@"NSSplitView", @"drawing divider at %@\n", NSStringFromRect(r)); [_dividerColor set]; if (lit == YES) { if (_isVertical == NO) { if ((NSMinY(r) > NSMaxY(oldRect)) || (NSMaxY(r) < NSMinY(oldRect))) // the two rects don't intersect { NSHighlightRect(oldRect); NSHighlightRect(r); } else // the two rects intersect { if (NSMinY(r) > NSMinY(oldRect)) { NSRect onRect, offRect; onRect.size.width = r.size.width; onRect.origin.x = r.origin.x; offRect.size.width = r.size.width; offRect.origin.x = r.origin.x; offRect.origin.y = NSMinY(oldRect); offRect.size.height = NSMinY(r) - NSMinY(oldRect); onRect.origin.y = NSMaxY(oldRect); onRect.size.height = NSMaxY(r) - NSMaxY(oldRect); NSHighlightRect(onRect); NSHighlightRect(offRect); //NSLog(@"on : %@", NSStringFromRect(onRect)); //NSLog(@"off : %@", NSStringFromRect(offRect)); //NSLog(@"old : %@", NSStringFromRect(oldRect)); //NSLog(@"r : %@", NSStringFromRect(r)); } else { NSRect onRect, offRect; onRect.size.width = r.size.width; onRect.origin.x = r.origin.x; offRect.size.width = r.size.width; offRect.origin.x = r.origin.x; offRect.origin.y = NSMaxY(r); offRect.size.height = NSMaxY(oldRect) - NSMaxY(r); onRect.origin.y = NSMinY(r); onRect.size.height = NSMinY(oldRect) - NSMinY(r); NSHighlightRect(onRect); NSHighlightRect(offRect); //NSLog(@"on : %@", NSStringFromRect(onRect)); //NSLog(@"off : %@", NSStringFromRect(offRect)); //NSLog(@"old : %@", NSStringFromRect(oldRect)); //NSLog(@"r : %@", NSStringFromRect(r)); } } } else { if ((NSMinX(r) > NSMaxX(oldRect)) || (NSMaxX(r) < NSMinX(oldRect))) // the two rects don't intersect { NSHighlightRect(oldRect); NSHighlightRect(r); } else // the two rects intersect { if (NSMinX(r) > NSMinX(oldRect)) { NSRect onRect, offRect; onRect.size.height = r.size.height; onRect.origin.y = r.origin.y; offRect.size.height = r.size.height; offRect.origin.y = r.origin.y; offRect.origin.x = NSMinX(oldRect); offRect.size.width = NSMinX(r) - NSMinX(oldRect); onRect.origin.x = NSMaxX(oldRect); onRect.size.width = NSMaxX(r) - NSMaxX(oldRect); NSHighlightRect(onRect); NSHighlightRect(offRect); } else { NSRect onRect, offRect; onRect.size.height = r.size.height; onRect.origin.y = r.origin.y; offRect.size.height = r.size.height; offRect.origin.y = r.origin.y; offRect.origin.x = NSMaxX(r); offRect.size.width = NSMaxX(oldRect) - NSMaxX(r); onRect.origin.x = NSMinX(r); onRect.size.width = NSMinX(oldRect) - NSMinX(r); NSHighlightRect(onRect); NSHighlightRect(offRect); } } } } else { NSHighlightRect(r); } [_window flushWindow]; /* if (lit == YES) { NSHighlightRect(oldRect); lit = NO; } NSHighlightRect(r); */ return YES; } /** * Utility function handling the splitview resize after * the divider has been moved */ - (void) _resize: (id) v withOldSplitView: (id) prev withFrame: (NSRect) r fromPoint: (NSPoint) p withBigRect: (NSRect) bigRect divHorizontal: (CGFloat) divHorizontal divVertical: (CGFloat) divVertical { NSRect r1 = NSZeroRect; [nc postNotificationName: NSSplitViewWillResizeSubviewsNotification object: self]; /* resize the subviews accordingly */ r = [prev frame]; if (_isVertical == NO) { r.size.height = p.y - NSMinY(bigRect) - (divVertical/2.); if (NSHeight(r) < 1.) { r.size.height = 1.; } } else { r.size.width = p.x - NSMinX(bigRect) - (divHorizontal/2.); if (NSWidth(r) < 1.) { r.size.width = 1.; } } [prev setFrame: r]; NSDebugLLog(@"NSSplitView", @"drawing PREV at x: %d, y: %d, w: %d, h: %d\n", (int)NSMinX(r),(int)NSMinY(r),(int)NSWidth(r),(int)NSHeight(r)); r1 = [v frame]; if (_isVertical == NO) { r1.origin.y = p.y + (divVertical/2.); if (NSMinY(r1) < 0.) { r1.origin.y = 0.; } r1.size.height = NSHeight(bigRect) - NSHeight(r) - divVertical; if (NSHeight(r) < 1.) { r.size.height = 1.; } } else { r1.origin.x = p.x + (divHorizontal/2.); if (NSMinX(r1) < 0.) { r1.origin.x = 0.; } r1.size.width = NSWidth(bigRect) - NSWidth(r) - divHorizontal; if (NSWidth(r1) < 1.) { r1.size.width = 1.; } } [v setFrame: r1]; NSDebugLLog(@"NSSplitView", @"drawing LAST at x: %d, y: %d, w: %d, h: %d\n", (int)NSMinX(r1),(int)NSMinY(r1),(int)NSWidth(r1), (int)NSHeight(r1)); [nc postNotificationName: NSSplitViewDidResizeSubviewsNotification object: self]; } /** * In -mouseDown we intercept the mouse event to handle the * splitview divider move. Moving the divider will do a live * resize of the subviews by default. Users can revert to * a "ghost" display of the splitview (without doing the * resize) by doing: * defaults write NSGlobalDomain GSUseGhostResize YES */ - (void) mouseDown: (NSEvent*)theEvent { NSApplication *app = [NSApplication sharedApplication]; NSPoint p = NSZeroPoint, op = NSZeroPoint; NSEvent *e; NSRect r, r1, bigRect, vis; id v = nil, prev = nil; CGFloat minCoord, maxCoord; NSArray *subs = [self subviews]; NSInteger offset = 0; NSUInteger i, count = [subs count]; CGFloat divVertical, divHorizontal; NSDate *farAway = [NSDate distantFuture]; NSDate *longTimeAgo = [NSDate distantPast]; NSUInteger eventMask = NSLeftMouseUpMask | NSLeftMouseDraggedMask; /* YES if delegate implements splitView:constrainSplitPosition:ofSubviewAt:*/ BOOL delegateConstrains = NO; SEL constrainSel = @selector(splitView:constrainSplitPosition:ofSubviewAt:); typedef CGFloat (*floatIMP)(id, SEL, id, CGFloat, NSInteger); floatIMP constrainImp = NULL; BOOL liveResize = ![[NSUserDefaults standardUserDefaults] boolForKey: @"GSUseGhostResize"]; NSRect oldRect; //only one can be dragged at a time BOOL lit = NO; NSCursor *cursor; /* if there are less the two subviews, there is nothing to do */ if (count < 2) { return; } /* Silence compiler warnings. */ r = NSZeroRect; r1 = NSZeroRect; bigRect = NSZeroRect; vis = [self visibleRect]; /* find out which divider it is */ p = [theEvent locationInWindow]; p = [self convertPoint: p fromView: nil]; for (i = 0; i < count; i++) { v = [subs objectAtIndex: i]; r = [v frame]; /* if the click is inside of a subview, return. this should happen only if a subview has leaked a mouse down to next responder */ if (NSPointInRect(p, r)) { NSDebugLLog(@"NSSplitView", @"NSSplitView got mouseDown in subview area"); return; } if (_isVertical == NO) { if (NSMinY(r) >= p.y) { offset = i - 1; /* get the enclosing rect for the two views */ if (prev != nil) { r = [prev frame]; } else { /* * This happens if user pressed exactly on the * top of the top subview */ return; } if (v != nil) { r1 = [v frame]; } bigRect = r; bigRect = NSUnionRect(r1 , bigRect); break; } prev = v; } else { if (NSMinX(r) >= p.x) { offset = i - 1; /* get the enclosing rect for the two views */ if (prev != nil) { r = [prev frame]; } else { /* * This happens if user pressed exactly on the * left of the left subview */ return; } if (v != nil) { r1 = [v frame]; } bigRect = r; bigRect = NSUnionRect(r1 , bigRect); break; } prev = v; } } /* Check if the delegate wants to constrain the spliview divider to certain positions */ if (_delegate && [_delegate respondsToSelector: @selector(splitView:constrainSplitPosition:ofSubviewAt:)]) { delegateConstrains = YES; } if (_isVertical == NO) { divVertical = _dividerWidth; divHorizontal = NSWidth(_frame); /* set the default limits on the dragging */ minCoord = NSMinY(bigRect) + divVertical; maxCoord = NSHeight(bigRect) + NSMinY(bigRect) - divVertical; cursor = [NSCursor resizeUpDownCursor]; } else { divHorizontal = _dividerWidth; divVertical = NSHeight(_frame); /* set the default limits on the dragging */ minCoord = NSMinX(bigRect) + divHorizontal; maxCoord = NSWidth(bigRect) + NSMinX(bigRect) - divHorizontal; cursor = [NSCursor resizeLeftRightCursor]; } [cursor push]; /* find out what the dragging limit is */ if (_delegate) { CGFloat delMin = minCoord, delMax = maxCoord; if ([_delegate respondsToSelector: @selector(splitView:constrainMinCoordinate:maxCoordinate:ofSubviewAt:)]) { [_delegate splitView: self constrainMinCoordinate: &delMin maxCoordinate: &delMax ofSubviewAt: offset]; } else { if ([_delegate respondsToSelector: @selector(splitView:constrainMinCoordinate:ofSubviewAt:)]) { delMin = [_delegate splitView: self constrainMinCoordinate: minCoord ofSubviewAt: offset]; } if ([_delegate respondsToSelector: @selector(splitView:constrainMaxCoordinate:ofSubviewAt:)]) { delMax = [_delegate splitView: self constrainMaxCoordinate: maxCoord ofSubviewAt: offset]; } } /* we are still constrained by the original bounds */ if (delMin > minCoord) { minCoord = delMin; } if (delMax < maxCoord) { maxCoord = delMax; } } if (!liveResize) { oldRect = NSZeroRect; [self lockFocus]; [_dividerColor set]; } [[NSRunLoop currentRunLoop] limitDateForMode: NSEventTrackingRunLoopMode]; r.size.width = divHorizontal; r.size.height = divVertical; e = [app nextEventMatchingMask: eventMask untilDate: farAway inMode: NSEventTrackingRunLoopMode dequeue: YES]; if (delegateConstrains) { constrainImp = (floatIMP)[_delegate methodForSelector: constrainSel]; } if (!liveResize) { // Save the old position op = p; } // user is moving the knob loop until left mouse up while ([e type] != NSLeftMouseUp) { if (liveResize) { // Save the old position op = p; } p = [self convertPoint: [e locationInWindow] fromView: nil]; if (delegateConstrains) { if (_isVertical) { p.x = (*constrainImp)(_delegate, constrainSel, self, p.x, offset); } else { p.y = (*constrainImp)(_delegate, constrainSel, self, p.y, offset); } } if (_isVertical == NO) { if (p.y < minCoord) { p.y = minCoord; } if (p.y > maxCoord) { p.y = maxCoord; } r.origin.y = p.y - (divVertical/2.); r.origin.x = NSMinX(vis); } else { if (p.x < minCoord) { p.x = minCoord; } if (p.x > maxCoord) { p.x = maxCoord; } r.origin.x = p.x - (divHorizontal/2.); r.origin.y = NSMinY(vis); } if (!liveResize) { lit = [self _drawHighlightedDividerWithSize: r andOldSize: oldRect isLit: lit]; oldRect = r; } { NSEvent *ee; e = [app nextEventMatchingMask: eventMask untilDate: farAway inMode: NSEventTrackingRunLoopMode dequeue: YES]; if ((ee = [app nextEventMatchingMask: NSLeftMouseUpMask untilDate: longTimeAgo inMode: NSEventTrackingRunLoopMode dequeue: YES]) != nil) { [app discardEventsMatchingMask:NSLeftMouseDraggedMask beforeEvent:ee]; e = ee; } else { ee = e; do { e = ee; ee = [app nextEventMatchingMask: NSLeftMouseDraggedMask untilDate: longTimeAgo inMode: NSEventTrackingRunLoopMode dequeue: YES]; } while (ee != nil); } } if (liveResize) { // If the splitview was moved, we resize the subviews if ((_isVertical == YES && p.x != op.x) || (_isVertical == NO && p.y != op.y)) { [self _resize: v withOldSplitView: prev withFrame: r fromPoint: p withBigRect: bigRect divHorizontal: divHorizontal divVertical: divVertical]; [_window invalidateCursorRectsForView: self]; [self setNeedsDisplay: YES]; } } } if (!liveResize) { if (lit == YES) { [_dividerColor set]; NSHighlightRect(oldRect); } [self unlockFocus]; } if (!liveResize) { // If the splitview was moved, we resize the subviews if ((_isVertical == YES && p.x != op.x) || (_isVertical == NO && p.y != op.y)) { [self _resize: v withOldSplitView: prev withFrame: r fromPoint: p withBigRect: bigRect divHorizontal: divHorizontal divVertical: divVertical]; [_window invalidateCursorRectsForView: self]; } } [self _autosaveSubviewProportions]; [self setNeedsDisplay: YES]; [NSCursor pop]; //[self display]; } - (void) _adjustSubviews: (NSSize)oldSize { SEL delegateMethod = @selector (splitView:resizeSubviewsWithOldSize:); if (_delegate != nil && [_delegate respondsToSelector: delegateMethod]) { [_delegate splitView: self resizeSubviewsWithOldSize: oldSize]; } else { [self adjustSubviews]; } } - (BOOL) _shouldAdjustSubviewAtIndex: (NSUInteger)index { if (_delegate != nil && [_delegate respondsToSelector: @selector(splitView:shouldAdjustSizeOfSubview:)]) { return [_delegate splitView: self shouldAdjustSizeOfSubview: [[self subviews] objectAtIndex: index]]; } return YES; } - (void) adjustSubviews { /* Try to load the autosaved view proportions, if any; if there are * no autosaved view proportions, then manually adjust subviews * proportionally to their current sizes. */ NSArray *subs = [self subviews]; NSUInteger count = [subs count]; NSView *views[count]; NSUInteger i; BOOL autoloading = NO; double proportionsTotal = 1.0; double proportions[count]; BOOL shouldAdjust[count]; if (count == 0) return; [nc postNotificationName: NSSplitViewWillResizeSubviewsNotification object: self]; for (i = 0; (i + 1) < count; i++) { shouldAdjust[i] = [self _shouldAdjustSubviewAtIndex: i]; } /* Try loading the autosaved view proportions. We store the * proportions between the size of each view and the size of the * whole area occupied by the views. */ if (_autosaveName != nil) { NSUserDefaults *defaults; NSDictionary *config; NSString *splitViewKey; defaults = [NSUserDefaults standardUserDefaults]; splitViewKey = [NSString stringWithFormat: @"NSSplitView Dividers %@", _autosaveName]; config = [defaults objectForKey: splitViewKey]; if (config != nil) { autoloading = YES; /* Please note that we don't save the 'proportion' of the * last view; it will be set up to take exactly the * remaining available space. */ for (i = 0; (i + 1) < count; i++) { NSNumber *proportion; NSString *key; key = [NSString stringWithFormat: @"%u", i]; proportion = [config objectForKey: key]; if (proportion == nil) { /* If any autosaved proportion is missing, do not do * any autoloading. */ autoloading = NO; break; } else { proportions[i] = [proportion doubleValue]; } } } } [subs getObjects: views]; /* If we haven't managed to load any saved view proportions, compute * default proportions using the current view sizes. */ if (autoloading == NO) { CGFloat oldTotal = 0.0; NSRect frames[count]; for (i = 0; i < count; i++) { frames[i] = [views[i] frame]; if (_isVertical == NO) { oldTotal += NSHeight(frames[i]); } else { oldTotal += NSWidth(frames[i]); } } for (i = 0; i < (count - 1); i++) { if (_isVertical == NO) { proportions[i] = (NSHeight(frames[i]))/oldTotal; } else { proportions[i] = (NSWidth(frames[i]))/oldTotal; } } } // For any subviews we aren't resizing, subtract their // proportion from the total for (i = 0; i < (count - 1); i++) { if (!shouldAdjust[i]) { proportionsTotal -= proportions[i]; } } if (_isVertical == NO) { CGFloat newTotal = NSHeight(_bounds) - _dividerWidth*(count - 1); CGFloat running = 0.0; for (i = 0; i < count; i++) { NSRect newRect; CGFloat newHeight; if (i < (count - 1)) { if (shouldAdjust[i]) { newHeight = (proportions[i] / proportionsTotal) * newTotal; } else { newHeight = NSHeight([views[i] frame]); } } else { /* Size the last view to take exactly the remaining * space. */ newHeight = NSHeight(_bounds) - running; } newRect = NSMakeRect(0.0, running, NSWidth(_bounds), newHeight); newRect = [self centerScanRect: newRect]; running += newHeight + _dividerWidth; [views[i] setFrame: newRect]; } } else { CGFloat newTotal = NSWidth(_bounds) - _dividerWidth*(count - 1); CGFloat running = 0.0; for (i = 0; i < count; i++) { NSRect newRect; CGFloat newWidth; if ((i + 1) < count) { if (shouldAdjust[i]) { newWidth = (proportions[i] / proportionsTotal) * newTotal; } else { newWidth = NSWidth([views[i] frame]); } } else { newWidth = NSWidth(_bounds) - running; } newRect = NSMakeRect(running, 0.0, newWidth, NSHeight(_bounds)); newRect = [self centerScanRect: newRect]; running += newWidth + _dividerWidth; [views[i] setFrame: newRect]; } } [self setNeedsDisplay: YES]; [nc postNotificationName: NSSplitViewDidResizeSubviewsNotification object: self]; /* Do not autosave if we just autoloaded - there's no point as it * would be the same information we just loaded. ;-) */ if (autoloading == NO) { [self _autosaveSubviewProportions]; } } - (CGFloat) dividerThickness { /* * You need to override this method in subclasses to change the * dividerThickness (or, without need for subclassing, invoke * setDimpleImage:resetDividerThickness:YES below) */ return 6; } static inline NSPoint centerSizeInRect(NSSize innerSize, NSRect outerRect) { NSPoint p; p.x = MAX(NSMidX(outerRect) - (innerSize.width/2.),0.); p.y = MAX(NSMidY(outerRect) - (innerSize.height/2.),0.); return p; } - (void) drawDividerInRect: (NSRect)aRect { NSPoint dimpleOrigin; NSSize dimpleSize; /* focus is already on self */ if (!_dimpleImage) { return; } dimpleSize = [_dimpleImage size]; dimpleOrigin = centerSizeInRect(dimpleSize, aRect); /* * Images are always drawn with their bottom-left corner at the origin * so we must adjust the position to take account of a flipped view. */ if ([self isFlipped]) { dimpleOrigin.y += dimpleSize.height; } [_dimpleImage compositeToPoint: dimpleOrigin operation: NSCompositeSourceOver]; } /* Vertical splitview has a vertical split bar */ - (void) setVertical: (BOOL)flag { _isVertical = flag; } - (BOOL) isVertical { return _isVertical; } - (BOOL) isSubviewCollapsed: (NSView *)subview { return NSIsEmptyRect([subview frame]); } - (BOOL) isPaneSplitter { return _is_pane_splitter; } - (void) setIsPaneSplitter: (BOOL)flag { _is_pane_splitter = flag; } - (NSString *) autosaveName { return _autosaveName; } - (void) setAutosaveName: (NSString *)autosaveName { ASSIGN(_autosaveName, autosaveName); } - (CGFloat) maxPossiblePositionOfDividerAtIndex: (NSInteger)dividerIndex { NSArray *subs = [self subviews]; NSUInteger count = [subs count]; NSView *view; if ((dividerIndex >= count - 1) || (dividerIndex < 0)) { if (_isVertical) { return NSMaxX([self bounds]); } else { return NSMaxY([self bounds]); } } view = [subs objectAtIndex: dividerIndex + 1]; if (_isVertical) { return NSMaxX([view frame]); } else { return NSMaxY([view frame]); } } - (CGFloat) minPossiblePositionOfDividerAtIndex: (NSInteger)dividerIndex { NSArray *subs = [self subviews]; NSUInteger count = [subs count]; NSView *view; if ((dividerIndex >= count - 1) || (dividerIndex < 0)) { if (_isVertical) { return NSMinX([self bounds]); } else { return NSMinY([self bounds]); } } view = [subs objectAtIndex: dividerIndex]; if (_isVertical) { return NSMinX([view frame]); } else { return NSMinY([view frame]); } } - (void) setPosition: (CGFloat)position ofDividerAtIndex: (NSInteger)dividerIndex { NSArray *subs = [self subviews]; NSUInteger count = [subs count]; CGFloat old_position; NSView *prev; NSView *next; NSRect r, r1; if ((dividerIndex >= count - 1) || (dividerIndex < 0)) { return; } if (_delegate && [_delegate respondsToSelector: @selector(splitView:constrainSplitPosition:ofSubviewAt:)]) { position = [_delegate splitView: self constrainSplitPosition: position ofSubviewAt: dividerIndex]; } // FIXME [nc postNotificationName: NSSplitViewWillResizeSubviewsNotification object: self]; prev = [subs objectAtIndex: dividerIndex]; next = [subs objectAtIndex: dividerIndex + 1]; r = [prev frame]; r1 = [next frame]; // Compute the old split position if (_isVertical == NO) { old_position = (NSMaxY(r) + NSMinY(r1)) / 2; } else { old_position = (NSMaxX(r) + NSMinX(r1)) / 2; } // Compute new rectangles if (_isVertical == NO) { r.size.height += position - old_position; if (NSHeight(r) < 1.) { r.size.height = 1.; } } else { r.size.width += position - old_position; if (NSWidth(r) < 1.) { r.size.width = 1.; } } if (_isVertical == NO) { r1.origin.y += position - old_position; r1.size.height -= position - old_position; if (NSHeight(r) < 1.) { r.size.height = 1.; } } else { r1.origin.x += position - old_position; r1.size.width -= position - old_position; if (NSWidth(r1) < 1.) { r1.size.width = 1.; } } /* resize the subviews accordingly */ [prev setFrame: r]; [next setFrame: r1]; } /* Overridden Methods */ - (void) drawRect: (NSRect)r { NSArray *subs = [self subviews]; NSUInteger i, count = [subs count]; id v; NSRect divRect; if ([self isOpaque]) { [_backgroundColor set]; NSRectFill(r); } /* draw the dimples */ for (i = 0; (i + 1) < count; i++) { v = [subs objectAtIndex: i]; divRect = [v frame]; if (_isVertical == NO) { divRect.origin.y = NSMaxY (divRect); divRect.size.height = _dividerWidth; } else { divRect.origin.x = NSMaxX (divRect); divRect.size.width = _dividerWidth; } [self drawDividerInRect: divRect]; } } - (BOOL) isFlipped { return YES; } - (BOOL) isOpaque { return (_backgroundColor != nil); } - (void) resizeSubviewsWithOldSize: (NSSize) oldSize { [self _adjustSubviews: oldSize]; [_window invalidateCursorRectsForView: self]; } - (void) displayRectIgnoringOpacity: (NSRect)aRect inContext: (NSGraphicsContext *)context { if (_window == nil) { return; } if (_never_displayed_before == YES) { _never_displayed_before = NO; [self _adjustSubviews: _frame.size]; } [super displayRectIgnoringOpacity: aRect inContext: context]; } - (id) delegate { return _delegate; } - (void) setDelegate: (id)anObject { if (_delegate) { [nc removeObserver: _delegate name: nil object: self]; } _delegate = anObject; #define SET_DELEGATE_NOTIFICATION(notif_name) \ if ([_delegate respondsToSelector: @selector(splitView##notif_name:)]) \ [nc addObserver: _delegate \ selector: @selector(splitView##notif_name:) \ name: NSSplitView##notif_name##Notification \ object: self] SET_DELEGATE_NOTIFICATION(DidResizeSubviews); SET_DELEGATE_NOTIFICATION(WillResizeSubviews); } - (void) resetCursorRects { NSArray *subs = [self subviews]; NSUInteger i; const NSUInteger count = [subs count]; const NSRect visibleRect = [self visibleRect]; NSCursor *cursor; if (_isVertical) { cursor = [NSCursor resizeLeftRightCursor]; } else { cursor = [NSCursor resizeUpDownCursor]; } for (i = 0; (i + 1) < count; i++) { NSView *v = [subs objectAtIndex: i]; NSRect divRect = [v frame]; if (_isVertical == NO) { divRect.origin.y = NSMaxY (divRect); divRect.size.height = _dividerWidth; } else { divRect.origin.x = NSMaxX (divRect); divRect.size.width = _dividerWidth; } divRect = NSIntersectionRect(divRect, visibleRect); if (!NSEqualRects(NSZeroRect, divRect)) { [self addCursorRect: divRect cursor: cursor]; } } } - (NSColor*) dividerColor { return _dividerColor; } - (NSSplitViewDividerStyle) dividerStyle { // FIXME return NSSplitViewDividerStyleThick; } - (void) setDividerStyle: (NSSplitViewDividerStyle)dividerStyle { // FIXME } /* * NSCoding protocol */ - (void) encodeWithCoder: (NSCoder *)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { [aCoder encodeBool: _isVertical forKey: @"NSIsVertical"]; [aCoder encodeObject: _autosaveName forKey: @"NSAutosaveName"]; } else { // FIXME: No idea why this as encode as int int draggedBarWidth = _draggedBarWidth; /* * Encode objects we don't own. */ [aCoder encodeConditionalObject: _delegate]; /* * Encode the objects we do own. */ [aCoder encodeObject: _dimpleImage]; [aCoder encodeObject: _backgroundColor]; [aCoder encodeObject: _dividerColor]; /* * Encode the rest of the ivar data. */ [aCoder encodeValueOfObjCType: @encode(int) at: &draggedBarWidth]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isVertical]; } } - (id) initWithCoder: (NSCoder *)aDecoder { self = [super initWithCoder: aDecoder]; if (self == nil) { return nil; } if ([aDecoder allowsKeyedCoding]) { id subview = nil; NSEnumerator *en = [[self subviews] objectEnumerator]; if ([aDecoder containsValueForKey: @"NSIsVertical"]) { [self setVertical: [aDecoder decodeBoolForKey: @"NSIsVertical"]]; } if ([aDecoder containsValueForKey: @"NSAutosaveName"]) { [self setAutosaveName: [aDecoder decodeObjectForKey: @"NSAutosaveName"]]; } _dividerWidth = [self dividerThickness]; _draggedBarWidth = 8; // default bigger than dividerThickness ASSIGN(_dividerColor, [NSColor controlShadowColor]); ASSIGN(_dimpleImage, [NSImage imageNamed: @"common_Dimple"]); _never_displayed_before = YES; _is_pane_splitter = YES; [self setAutoresizesSubviews: YES]; while((subview = [en nextObject]) != nil) { [subview setAutoresizesSubviews: YES]; } } else { // FIXME: No idea why this as encode as int int draggedBarWidth; // Decode objects that we don't retain. [self setDelegate: [aDecoder decodeObject]]; // Decode objects that we do retain. [aDecoder decodeValueOfObjCType: @encode(id) at: &_dimpleImage]; if (_dimpleImage == nil) ASSIGN(_dimpleImage, [NSImage imageNamed: @"common_Dimple"]); [aDecoder decodeValueOfObjCType: @encode(id) at: &_backgroundColor]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_dividerColor]; // Decode non-object data. [aDecoder decodeValueOfObjCType: @encode(int) at: &draggedBarWidth]; _draggedBarWidth = draggedBarWidth; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isVertical]; _dividerWidth = [self dividerThickness]; _never_displayed_before = YES; } return self; } @end @implementation NSSplitView (GNUstepExtra) /* * FIXME: Perhaps the following two should be removed and _dividerWidth * should be used also for dragging? */ - (CGFloat) draggedBarWidth { //defaults to 8 return _draggedBarWidth; } - (void) setDraggedBarWidth: (CGFloat)newWidth { _draggedBarWidth = newWidth; } - (void) setDimpleImage: (NSImage*)anImage resetDividerThickness: (BOOL)flag { ASSIGN(_dimpleImage, anImage); if (flag) { NSSize s = NSMakeSize(6., 6.); if (_dimpleImage) s = [_dimpleImage size]; if (_isVertical) _dividerWidth = s.width; else _dividerWidth = s.height; } } - (NSImage*) dimpleImage { return _dimpleImage; } - (NSColor*) backgroundColor { return _backgroundColor; } - (void) setBackgroundColor: (NSColor *)aColor { ASSIGN(_backgroundColor, aColor); } - (void) setDividerColor: (NSColor*) aColor { ASSIGN(_dividerColor, aColor); } @end gnustep-gui-0.24.0/Source/NSAttributedString.m0000664000076500007650000015042512210135216021117 0ustar brains99brains99/** NSAttributedStringAdditions Categories which add capabilities to NSAttributedString Copyright (C) 1999 Free Software Foundation, Inc. Author: Richard Frith-Macdonald Date: July 1999 Modifications: Fred Kiefer Date: June 2000 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import #import #import #import #import #import #import #import "AppKit/NSAttributedString.h" #import "AppKit/NSDocumentController.h" #import "AppKit/NSParagraphStyle.h" #import "AppKit/NSPasteboard.h" #import "AppKit/NSTextAttachment.h" #import "AppKit/NSColor.h" #import "AppKit/NSFileWrapper.h" #import "AppKit/NSFont.h" #import "AppKit/NSFontManager.h" // For the colour name spaces #import "AppKit/NSGraphics.h" #import "AppKit/NSTextTable.h" #import "GNUstepGUI/GSTextConverter.h" #import "GSGuiPrivate.h" /* Cache class pointers to avoid the expensive lookup by string. */ static Class dictionaryClass = nil; static Class stringClass = nil; /* A character set containing characters that separate words. */ static NSCharacterSet *wordBreakCSet = nil; /* A character set containing characters that are legal within words. */ static NSCharacterSet *wordCSet = nil; /* Character sets containing characters that are white space and not white space */ static NSCharacterSet *whiteCSet = nil; static NSCharacterSet *nonWhiteCSet = nil; /* A String containing the attachment character */ static NSString *attachmentString = nil; /* This function initializes all the previous cached values. */ static void cache_init_real(void) { NSMutableCharacterSet *m; NSCharacterSet *cset; unichar ch = NSAttachmentCharacter; /* Initializes Class pointer cache */ dictionaryClass = [NSDictionary class]; stringClass = [NSString class]; /* Initializes wordBreakCSet */ m = [NSMutableCharacterSet new]; cset = [NSCharacterSet whitespaceAndNewlineCharacterSet]; [m formUnionWithCharacterSet: cset]; cset = [NSCharacterSet punctuationCharacterSet]; [m formUnionWithCharacterSet: cset]; cset = [NSCharacterSet controlCharacterSet]; [m formUnionWithCharacterSet: cset]; cset = [NSCharacterSet illegalCharacterSet]; [m formUnionWithCharacterSet: cset]; [m addCharactersInString: @"<>"]; [m removeCharactersInString: @"_"]; wordBreakCSet = [m copy]; RELEASE (m); /* Initializes wordCSet */ wordCSet = [[wordBreakCSet invertedSet] copy]; /* Initializes white space and non-white space character sets */ whiteCSet = [[NSCharacterSet whitespaceCharacterSet] copy]; nonWhiteCSet = [[whiteCSet invertedSet] copy]; /* Initializes attachmentString */ attachmentString = [stringClass stringWithCharacters: &ch length: 1]; RETAIN (attachmentString); } /* This inline function calls cache_init_real () the first time it is invoked, and does nothing afterwards. Thus we get both speed (cache_init is inlined and only compares a pointer to nil when the cache has been initialized) and limit memory consumption (we are not copying everywhere the real initialization code, which is in cache_real_init (), which is not inlined.).*/ static inline void cache_init(void) { if (dictionaryClass == nil) { cache_init_real (); } } /* Return the class that handles format from the first bundle it finds */ static Class converter_bundles(NSString *format, BOOL producer) { Class converter_class = Nil; NSEnumerator *benum; NSString *dpath; /* Find the bundle paths */ benum = [NSStandardLibraryPaths() objectEnumerator]; while ((dpath = [benum nextObject])) { NSEnumerator *direnum; NSString *path; dpath = [dpath stringByAppendingPathComponent: @"Bundles"]; dpath = [dpath stringByAppendingPathComponent: @"TextConverters"]; if ([[NSFileManager defaultManager] fileExistsAtPath: dpath]) direnum = [[NSFileManager defaultManager] enumeratorAtPath: dpath]; else direnum = nil; while (direnum && (path = [direnum nextObject])) { Class bclass; NSString *full_path; NSBundle *aBundle; if ([[path pathExtension] isEqual: @"bundle"] == NO) continue; full_path = [dpath stringByAppendingPathComponent: path]; aBundle = [NSBundle bundleWithPath: full_path]; if (aBundle && ((bclass = [aBundle principalClass]))) { if ([bclass respondsToSelector: @selector(classForFormat: producer: )]) { converter_class = (Class)[bclass classForFormat: format producer: producer]; } else { NSString *converter_name; if (producer) { converter_name = [format stringByAppendingString: @"Producer"]; } else { converter_name = [format stringByAppendingString: @"Consumer"]; } converter_class = [aBundle classNamed: converter_name]; } } if (converter_class) break; } if (converter_class) break; } return converter_class; } /* Return a suitable converter for the text format supplied as argument. If producer is YES a class capable of writting that format is returned, otherwise a class able to read the format is returned. */ static Class converter_class(NSString *format, BOOL producer) { static NSMutableDictionary *p_classes = nil; static NSMutableDictionary *c_classes = nil; Class found; if (producer) { if (p_classes == nil) p_classes = [NSMutableDictionary new]; found = [p_classes objectForKey: format]; if (found == Nil) { found = converter_bundles(format, producer); if (found != Nil) NSDebugLog(@"Found converter %@ for format %@", found, format); if (found != Nil) [p_classes setObject: found forKey: format]; } return found; } else { if (c_classes == nil) c_classes = [NSMutableDictionary new]; found = [c_classes objectForKey: format]; if (found == Nil) { found = converter_bundles(format, producer); if (found != Nil) NSDebugLog(@"Found converter %@ for format %@", found, format); if (found != Nil) [c_classes setObject: found forKey: format]; } return found; } return Nil; } static inline NSError* create_error(int code, NSString* desc) { return [NSError errorWithDomain: @"NSAttributedString" code: code userInfo: [NSDictionary dictionaryWithObjectsAndKeys: desc, NSLocalizedDescriptionKey, nil]]; } @implementation NSAttributedString (AppKit) + (NSArray *) textFileTypes { // FIXME: Apply service filters return [self textUnfilteredFileTypes]; } + (NSArray *) textPasteboardTypes { // FIXME: Apply service filters return [self textUnfilteredPasteboardTypes]; } + (NSArray *) textTypes { // FIXME: Apply service filters return [self textUnfilteredTypes]; } + (NSArray *) textUnfilteredFileTypes { return [NSArray arrayWithObjects: @"txt", @"rtf", @"rtfd", @"html", nil]; } + (NSArray *) textUnfilteredPasteboardTypes { return [NSArray arrayWithObjects: NSStringPboardType, NSRTFPboardType, NSRTFDPboardType, NSHTMLPboardType, nil]; } + (NSArray *) textUnfilteredTypes { return [NSArray arrayWithObjects: @"public.plain-text", @"public.rtf", @"com.apple.rtfd", @"public.html", /* @"public.xml", @"com.apple.webarchive", @"com.microsoft.word.doc", @"com.microsoft.word.wordml", @"org.openxmlformats.wordprocessingml.document", @"org.oasis-open.opendocument.text", @"com.apple.traditional-mac-plain-text", */ nil]; } + (NSAttributedString *) attributedStringWithAttachment: (NSTextAttachment *)attachment { NSDictionary *attributes; cache_init (); attributes = [dictionaryClass dictionaryWithObject: attachment forKey: NSAttachmentAttributeName]; return AUTORELEASE ([[self alloc] initWithString: attachmentString attributes: attributes]); } - (BOOL) containsAttachments { NSRange aRange; cache_init (); aRange = [[self string] rangeOfString: attachmentString]; if (aRange.length > 0) { return YES; } else { return NO; } } - (NSDictionary *) fontAttributesInRange: (NSRange)range { NSDictionary *all; static SEL sel = 0; IMP objForKey; id objects[8]; id keys[8]; int count = 0; if (NSMaxRange(range) > [self length]) { [NSException raise: NSRangeException format: @"RangeError in method -fontAttributesInRange: "]; } all = [self attributesAtIndex: range.location effectiveRange: &range]; if (sel == 0) { sel = @selector (objectForKey: ); } objForKey = [all methodForSelector: sel]; #define NSATT_GET_ATTRIBUTE(attribute) \ keys[count] = attribute; \ objects[count] = (*objForKey) (all, sel, keys[count]); \ if (objects[count] != nil) count++; NSATT_GET_ATTRIBUTE (NSFontAttributeName); NSATT_GET_ATTRIBUTE (NSForegroundColorAttributeName); NSATT_GET_ATTRIBUTE (NSBackgroundColorAttributeName); NSATT_GET_ATTRIBUTE (NSUnderlineStyleAttributeName); NSATT_GET_ATTRIBUTE (NSSuperscriptAttributeName); NSATT_GET_ATTRIBUTE (NSBaselineOffsetAttributeName); NSATT_GET_ATTRIBUTE (NSKernAttributeName); NSATT_GET_ATTRIBUTE (NSLigatureAttributeName); #undef NSATT_GET_ATTRIBUTE cache_init (); return [dictionaryClass dictionaryWithObjects: objects forKeys: keys count: count]; } - (NSDictionary*) rulerAttributesInRange: (NSRange)range { id style; cache_init (); if (NSMaxRange (range) > [self length]) { [NSException raise: NSRangeException format: @"RangeError in method -rulerAttributesInRange: "]; } style = [self attribute: NSParagraphStyleAttributeName atIndex: range.location effectiveRange: &range]; if (style != nil) { return [dictionaryClass dictionaryWithObject: style forKey: NSParagraphStyleAttributeName]; } return [dictionaryClass dictionary]; } - (NSUInteger) lineBreakByHyphenatingBeforeIndex: (NSUInteger)location withinRange: (NSRange)aRange { // FIXME return [self lineBreakBeforeIndex: location withinRange: aRange]; } - (NSUInteger) lineBreakBeforeIndex: (NSUInteger)location withinRange: (NSRange)aRange { NSString *str = [self string]; NSUInteger length = [str length]; NSRange scanRange; NSRange startRange; cache_init (); if (NSMaxRange (aRange) > length || location > length) { [NSException raise: NSRangeException format: @"RangeError in method -lineBreakBeforeIndex: withinRange: "]; } if (!NSLocationInRange (location, aRange)) { return NSNotFound; } scanRange = NSMakeRange (aRange.location, location - aRange.location); startRange = [str rangeOfCharacterFromSet: wordBreakCSet options: NSBackwardsSearch | NSLiteralSearch range: scanRange]; while (startRange.length > 0 && startRange.location > 0 && [str characterAtIndex: startRange.location] == '\'' && [wordCSet characterIsMember: [str characterAtIndex: startRange.location-1]]) { location = startRange.location - 1; scanRange = NSMakeRange (0, location); startRange = [str rangeOfCharacterFromSet: wordBreakCSet options: NSBackwardsSearch|NSLiteralSearch range: scanRange]; } if (startRange.length == 0) { return NSNotFound; } else { return NSMaxRange (startRange); } } - (NSRange) doubleClickAtIndex: (NSUInteger)location { NSString *str = [self string]; NSUInteger length = [str length]; NSRange scanRange; NSRange startRange; NSRange endRange; NSCharacterSet *breakCSet; cache_init (); if (location > length) { [NSException raise: NSRangeException format: @"RangeError in method -doubleClickAtIndex: "]; } /* * Double clicking on a white space character selects all surrounding * white space. Otherwise, if the location lies between words, a double * click selects only the character actually clicked on. */ if ([whiteCSet characterIsMember: [str characterAtIndex: location]]) { breakCSet = nonWhiteCSet; } else if ([wordBreakCSet characterIsMember: [str characterAtIndex: location]]) { if (location == 0 || location == length - 1 || [str characterAtIndex: location] != '\'' || ! [wordCSet characterIsMember: [str characterAtIndex: location - 1]] || ! [wordCSet characterIsMember: [str characterAtIndex: location + 1]]) { return NSMakeRange(location, 1); } breakCSet = wordBreakCSet; } else { breakCSet = wordBreakCSet; } scanRange = NSMakeRange (0, location); startRange = [str rangeOfCharacterFromSet: breakCSet options: NSBackwardsSearch|NSLiteralSearch range: scanRange]; /* * Don't treat single quotes embedded within a word as break characters. * Note: The loop condition is always false when breakCSet==nonWhiteSetCSet. */ while (startRange.length > 0 && startRange.location > 0 && startRange.location < length - 1 && [str characterAtIndex: startRange.location] == '\'' && [wordCSet characterIsMember: [str characterAtIndex: startRange.location - 1]] && [wordCSet characterIsMember: [str characterAtIndex: startRange.location + 1]]) { location = startRange.location - 1; scanRange = NSMakeRange (0, location); startRange = [str rangeOfCharacterFromSet: wordBreakCSet options: NSBackwardsSearch|NSLiteralSearch range: scanRange]; } scanRange = NSMakeRange (location, length - location); endRange = [str rangeOfCharacterFromSet: breakCSet options: NSLiteralSearch range: scanRange]; /* * Don't treat single quotes embedded within a word as break characters. * Note: The loop condition is always false when breakCSet==nonWhiteSetCSet. */ while (endRange.length > 0 && endRange.location > 0 && endRange.location < length - 1 && [str characterAtIndex: endRange.location] == '\'' && [wordCSet characterIsMember: [str characterAtIndex: endRange.location - 1]] && [wordCSet characterIsMember: [str characterAtIndex: endRange.location + 1]]) { location = endRange.location + 1; scanRange = NSMakeRange (location, length - location); endRange = [str rangeOfCharacterFromSet: wordBreakCSet options: NSLiteralSearch range: scanRange]; } if (startRange.length == 0) { location = 0; } else { location = NSMaxRange (startRange); } if (endRange.length == 0) { length = length - location; } else { length = endRange.location - location; } return NSMakeRange (location, length); } - (NSUInteger) nextWordFromIndex: (NSUInteger)location forward: (BOOL)isForward { NSString *str = [self string]; NSUInteger length = [str length]; NSRange range; if (location > length) { [NSException raise: NSRangeException format: @"RangeError in method -nextWordFromIndex: forward: "]; } /* Please note that we consider ' a valid word separator. This is what Emacs does and is perfectly correct. If you want to change the word separators, the right approach is to use a different character set for word separators - the following code should be unchanged whatever characters you use to separate words. */ cache_init (); if (isForward) { /* What we want to do is: move forward to the next chunk of non-word separator characters, skip them all, and return the location just after them. */ if (location == length) { return length; } /* Move forward to the next non-word separator. */ range = NSMakeRange (location, length - location); range = [str rangeOfCharacterFromSet: wordCSet options: NSLiteralSearch range: range]; if (range.location == NSNotFound) { return length; } /* rangeOfCharacterFromSet: options: range: only returns the range of the first non-word-separator character ... we want to skip them all! So we need to search again, this time for the first word-separator character, and return the first such character. */ range = NSMakeRange (range.location, length - range.location); range = [str rangeOfCharacterFromSet: wordBreakCSet options: NSLiteralSearch range: range]; if (range.location == NSNotFound) { return length; } return range.location; } else { /* What we want to do is: move backward to the next chunk of non-word separator characters, skip them all, and return the location just at the beginning of the chunk. */ if (location == 0) { return 0; } /* Move backward to the next non-word separator. */ range = NSMakeRange (0, location); range = [str rangeOfCharacterFromSet: wordCSet options: NSBackwardsSearch | NSLiteralSearch range: range]; if (range.location == NSNotFound) { return 0; } /* rangeOfCharacterFromSet: options: range: only returns the range of the first non-word-separator character ... we want to skip them all! So we need to search again, this time for the first word-separator character. */ range = NSMakeRange (0, range.location); range = [str rangeOfCharacterFromSet: wordBreakCSet options: NSBackwardsSearch | NSLiteralSearch range: range]; if (range.location == NSNotFound) { return 0; } return NSMaxRange (range); } } - (id) initWithRTFDFileWrapper: (NSFileWrapper *)wrapper documentAttributes: (NSDictionary **)dict { return [self initWithRTFD: [wrapper serializedRepresentation] documentAttributes: dict]; } - (id) initWithRTFD: (NSData*)data documentAttributes: (NSDictionary**)dict { NSDictionary *options; options = [NSDictionary dictionaryWithObject: NSRTFDTextDocumentType forKey: NSDocumentTypeDocumentOption]; return [self initWithData: data options: options documentAttributes: dict error: NULL]; } - (id) initWithRTF: (NSData *)data documentAttributes: (NSDictionary **)dict { NSDictionary *options; options = [NSDictionary dictionaryWithObject: NSRTFTextDocumentType forKey: NSDocumentTypeDocumentOption]; return [self initWithData: data options: options documentAttributes: dict error: NULL]; } - (id) initWithHTML: (NSData *)data documentAttributes: (NSDictionary **)dict { return [self initWithHTML: data baseURL: nil documentAttributes: dict]; } - (id) initWithHTML: (NSData *)data baseURL: (NSURL *)base documentAttributes: (NSDictionary **)dict { NSDictionary *options = nil; if (base != nil) options = [NSDictionary dictionaryWithObject: base forKey: NSBaseURLDocumentOption]; return [self initWithHTML: data options: options documentAttributes: dict]; } - (id) initWithHTML: (NSData *)data options: (NSDictionary *)options documentAttributes: (NSDictionary **)dict { if (options == nil) { options = [NSDictionary dictionaryWithObject: NSHTMLTextDocumentType forKey: NSDocumentTypeDocumentOption]; } else if ([options objectForKey: NSDocumentTypeDocumentOption] == nil) { options = AUTORELEASE([options mutableCopy]); [(NSMutableDictionary*)options setObject: NSHTMLTextDocumentType forKey: NSDocumentTypeDocumentOption]; } /* The converter should support: NSHTMLTextDocumentType @"public.html" @"html" */ return [self initWithData: data options: options documentAttributes: dict error: NULL]; } - (id) initWithDocFormat: (NSData *)data documentAttributes: (NSDictionary **)dict { NSDictionary *options; options = [NSDictionary dictionaryWithObject: NSDocFormatTextDocumentType forKey: NSDocumentTypeDocumentOption]; return [self initWithData: data options: options documentAttributes: dict error: NULL]; } - (id) initWithData: (NSData *)data options: (NSDictionary *)options documentAttributes: (NSDictionary **)dict error: (NSError **)error { NSString *type = [options objectForKey: NSDocumentTypeDocumentOption]; Class converter; if (data == nil) { if (error) *error = create_error(0, NSLocalizedString(@"No data specified for data loading.", @"Error description")); RELEASE(self); return nil; } if (type == nil) { // Make sure this buffer is long enough char prefix[14]; NSUInteger l = [data length]; if (l < sizeof(prefix)) { [data getBytes: prefix length: l]; prefix[l] = 0; } else { [data getBytes: prefix length: sizeof(prefix)]; } // The list of file types below was derived from Apache's conf/magic file // FIXME extend the list if (strncmp(prefix, "{\\rtf", 5) == 0) { type = NSRTFTextDocumentType; } else if (strncasecmp(prefix, "= 2) { static const unichar byteOrderMark = 0xFEFF; static const unichar byteOrderMarkSwapped = 0xFFFE; const unichar firstChar = ((const unichar *)[data bytes])[0]; if (firstChar == byteOrderMark || firstChar == byteOrderMarkSwapped) { encoding = NSUnicodeStringEncoding; } } } if (dict != NULL) { *dict = [NSDictionary dictionaryWithObjectsAndKeys: NSPlainTextDocumentType, NSDocumentTypeDocumentAttribute, [NSNumber numberWithUnsignedInteger: encoding], NSCharacterEncodingDocumentAttribute, nil]; } str = [[NSString alloc] initWithData: data encoding: encoding]; self = [self initWithString: str attributes: defaultAttrs]; RELEASE(str); return self; } if (error) *error = create_error(0, NSLocalizedString(@"Could not load data.", @"Error description")); RELEASE(self); return nil; } - (id) initWithPath: (NSString *)path documentAttributes: (NSDictionary **)dict { BOOL isDir = NO; if (path == nil) { RELEASE (self); return nil; } if ([[NSFileManager defaultManager] fileExistsAtPath: path isDirectory: &isDir] && isDir) { // FIXME: This expects the file to be RTFD NSFileWrapper *fw; fw = [[NSFileWrapper alloc] initWithPath: path]; AUTORELEASE (fw); return [self initWithRTFDFileWrapper: fw documentAttributes: dict]; } else { return [self initWithURL: [NSURL fileURLWithPath: path] documentAttributes: dict]; } } - (id) initWithURL: (NSURL *)url documentAttributes: (NSDictionary **)dict { NSURL *baseURL = [url baseURL]; NSDictionary *options = nil; if (baseURL != nil) { [NSDictionary dictionaryWithObject: baseURL forKey: NSBaseURLDocumentOption]; } return [self initWithURL: url options: options documentAttributes: dict error: NULL]; } - (id) initWithURL: (NSURL *)url options: (NSDictionary *)options documentAttributes: (NSDictionary **)dict error: (NSError **)error { NSURL *baseURL; NSData *data = [url resourceDataUsingCache: YES]; if (data == nil) { if (error) *error = create_error(0, NSLocalizedString(@"Could not load data from URL.", @"Error description")); RELEASE(self); return nil; } // Pass on baseURL baseURL = [url baseURL]; if (baseURL != nil) { if (options == nil) options = [NSDictionary dictionaryWithObject: baseURL forKey: NSBaseURLDocumentOption]; else if ([options objectForKey: NSBaseURLDocumentOption] == nil) { options = AUTORELEASE([options mutableCopy]); [(NSMutableDictionary*)options setObject: baseURL forKey: NSBaseURLDocumentOption]; } } return [self initWithData: data options: options documentAttributes: dict error: error]; } - (NSData *) RTFFromRange: (NSRange)range documentAttributes: (NSDictionary *)dict { if (dict == nil) { dict = [NSDictionary dictionaryWithObject: NSRTFTextDocumentType forKey: NSDocumentTypeDocumentOption]; } else if ([dict objectForKey: NSDocumentTypeDocumentOption] == nil) { dict = AUTORELEASE([dict mutableCopy]); [(NSMutableDictionary*)dict setObject: NSRTFTextDocumentType forKey: NSDocumentTypeDocumentOption]; } return [self dataFromRange: range documentAttributes: dict error: NULL]; } - (NSData *) RTFDFromRange: (NSRange)range documentAttributes: (NSDictionary *)dict { if (dict == nil) { dict = [NSDictionary dictionaryWithObject: NSRTFDTextDocumentType forKey: NSDocumentTypeDocumentOption]; } else if ([dict objectForKey: NSDocumentTypeDocumentOption] == nil) { dict = AUTORELEASE([dict mutableCopy]); [(NSMutableDictionary*)dict setObject: NSRTFDTextDocumentType forKey: NSDocumentTypeDocumentOption]; } return [self dataFromRange: range documentAttributes: dict error: NULL]; } - (NSFileWrapper *) RTFDFileWrapperFromRange: (NSRange)range documentAttributes: (NSDictionary *)dict { return AUTORELEASE([[NSFileWrapper alloc] initWithSerializedRepresentation: [self RTFDFromRange: range documentAttributes: dict]]); } - (NSData *) docFormatFromRange: (NSRange)range documentAttributes: (NSDictionary *)dict { if (dict == nil) { dict = [NSDictionary dictionaryWithObject: NSDocFormatTextDocumentType forKey: NSDocumentTypeDocumentOption]; } else if ([dict objectForKey: NSDocumentTypeDocumentOption] == nil) { dict = AUTORELEASE([dict mutableCopy]); [(NSMutableDictionary*)dict setObject: NSDocFormatTextDocumentType forKey: NSDocumentTypeDocumentOption]; } return [self dataFromRange: range documentAttributes: dict error: NULL]; } - (NSData *) dataFromRange: (NSRange)range documentAttributes: (NSDictionary *)dict error: (NSError **)error { NSString *type = [dict objectForKey: NSDocumentTypeDocumentOption]; Class converter; if (type == nil) { if (error) *error = create_error(0, NSLocalizedString(@"No type specified for data.", @"Error description")); return nil; } converter = converter_class(type, YES); if (converter != Nil) { return [converter produceDataFrom: [self attributedSubstringFromRange: range] documentAttributes: dict error: error]; } else if ([type isEqualToString: NSPlainTextDocumentType] || [type isEqualToString: @"public.plain-text"] || [type isEqualToString: @"text"]) { NSStringEncoding encoding = [[dict objectForKey: @"CharacterEncoding"] intValue]; if (!encoding) encoding = [NSString defaultCStringEncoding]; return [[self string] dataUsingEncoding: encoding]; } if (error) *error = create_error(0, NSLocalizedString(@"Could not create data for type.", @"Error description")); return nil; } - (NSFileWrapper *) fileWrapperFromRange: (NSRange)range documentAttributes: (NSDictionary *)dict error: (NSError **)error { NSFileWrapper *wrapper; NSData *data; data = [self dataFromRange: range documentAttributes: dict error: error]; if (data != nil) { // FIXME: This wont work for directory bundles. wrapper = [[NSFileWrapper alloc] initRegularFileWithContents: data]; return AUTORELEASE(wrapper); } if (error) *error = create_error(0, NSLocalizedString(@"Could not create data for type.", @"Error description")); return nil; } - (NSInteger) itemNumberInTextList: (NSTextList *)list atIndex: (NSUInteger)location { NSParagraphStyle *style = [self attribute: NSParagraphStyleAttributeName atIndex: location effectiveRange: NULL]; if (style != nil) { NSArray *textLists = [style textLists]; if (textLists != nil) { return [textLists indexOfObject: list]; } } return NSNotFound; } - (NSRange) rangeOfTextBlock: (NSTextBlock *)block atIndex: (NSUInteger)location { NSRange effRange; NSParagraphStyle *style = [self attribute: NSParagraphStyleAttributeName atIndex: location effectiveRange: &effRange]; if (style != nil) { NSArray *textBlocks = [style textBlocks]; if ((textBlocks != nil) && [textBlocks containsObject: block]) { NSRange newEffRange; NSUInteger len = [self length]; while ((effRange.location > 0) && style && textBlocks) { style = [self attribute: NSParagraphStyleAttributeName atIndex: effRange.location - 1 effectiveRange: &newEffRange]; if (style != nil) { textBlocks = [style textBlocks]; if ((textBlocks != nil) && [textBlocks containsObject: block]) { effRange.location = newEffRange.location; effRange.length += newEffRange.length; } } } while (NSMaxRange(effRange) < len && style && textBlocks) { style = [self attribute: NSParagraphStyleAttributeName atIndex: NSMaxRange(effRange) effectiveRange: &newEffRange]; if (style != nil) { textBlocks = [style textBlocks]; if ((textBlocks != nil) && [textBlocks containsObject: block]) { effRange.length += newEffRange.length; } } } return effRange; } } return NSMakeRange(NSNotFound, 0); } - (NSRange) rangeOfTextList: (NSTextList *)list atIndex: (NSUInteger)location { NSRange effRange; NSParagraphStyle *style = [self attribute: NSParagraphStyleAttributeName atIndex: location effectiveRange: &effRange]; if (style != nil) { NSArray *textLists = [style textLists]; if ((textLists != nil) && [textLists containsObject: list]) { NSRange newEffRange; NSUInteger len = [self length]; while ((effRange.location > 0) && style && textLists) { style = [self attribute: NSParagraphStyleAttributeName atIndex: effRange.location - 1 effectiveRange: &newEffRange]; if (style != nil) { textLists = [style textLists]; if ((textLists != nil) && [textLists containsObject: list]) { effRange.location = newEffRange.location; effRange.length += newEffRange.length; } } } while (NSMaxRange(effRange) < len && style && textLists) { style = [self attribute: NSParagraphStyleAttributeName atIndex: NSMaxRange(effRange) effectiveRange: &newEffRange]; if (style != nil) { textLists = [style textLists]; if ((textLists != nil) && [textLists containsObject: list]) { effRange.length += newEffRange.length; } } } return effRange; } } return NSMakeRange(NSNotFound, 0); } static inline BOOL containsTable(NSArray *textBlocks, NSTextTable *table) { NSEnumerator *benum = [textBlocks objectEnumerator]; NSTextTableBlock *block; while ((block = [benum nextObject])) { if ([table isEqual: [block table]]) { return YES; } } return NO; } - (NSRange) rangeOfTextTable: (NSTextTable *)table atIndex: (NSUInteger)location { NSRange effRange; NSParagraphStyle *style = [self attribute: NSParagraphStyleAttributeName atIndex: location effectiveRange: &effRange]; if (style != nil) { NSArray *textBlocks = [style textBlocks]; if ((textBlocks != nil) && containsTable(textBlocks, table)) { NSRange newEffRange; NSUInteger len = [self length]; while ((effRange.location > 0) && style && textBlocks) { style = [self attribute: NSParagraphStyleAttributeName atIndex: effRange.location - 1 effectiveRange: &newEffRange]; if (style != nil) { textBlocks = [style textBlocks]; if ((textBlocks != nil) && containsTable(textBlocks, table)) { effRange.location = newEffRange.location; effRange.length += newEffRange.length; } } } while (NSMaxRange(effRange) < len && style && textBlocks) { style = [self attribute: NSParagraphStyleAttributeName atIndex: NSMaxRange(effRange) effectiveRange: &newEffRange]; if (style != nil) { textBlocks = [style textBlocks]; if ((textBlocks != nil) && containsTable(textBlocks, table)) { effRange.length += newEffRange.length; } } } return effRange; } } return NSMakeRange(NSNotFound, 0); } @end @implementation NSMutableAttributedString (AppKit) - (void) superscriptRange: (NSRange)range { id value; int sValue; NSRange effRange; if (NSMaxRange (range) > [self length]) { [NSException raise: NSRangeException format: @"RangeError in method -superscriptRange: "]; } // We take the value from the first character and use it for the whole range value = [self attribute: NSSuperscriptAttributeName atIndex: range.location effectiveRange: &effRange]; if (value != nil) { sValue = [value intValue] + 1; } else { sValue = 1; } [self addAttribute: NSSuperscriptAttributeName value: [NSNumber numberWithInt: sValue] range: range]; } - (void) subscriptRange: (NSRange)range { id value; int sValue; NSRange effRange; if (NSMaxRange (range) > [self length]) { [NSException raise: NSRangeException format: @"RangeError in method -subscriptRange: "]; } // We take the value form the first character and use it for the whole range value = [self attribute: NSSuperscriptAttributeName atIndex: range.location effectiveRange: &effRange]; if (value != nil) { sValue = [value intValue] - 1; } else { sValue = -1; } [self addAttribute: NSSuperscriptAttributeName value: [NSNumber numberWithInt: sValue] range: range]; } - (void) unscriptRange: (NSRange)range { if (NSMaxRange (range) > [self length]) { [NSException raise: NSRangeException format: @"RangeError in method -unscriptRange: "]; } [self removeAttribute: NSSuperscriptAttributeName range: range]; } - (void) applyFontTraits: (NSFontTraitMask)traitMask range: (NSRange)range { NSFont *font; NSUInteger loc = range.location; NSRange effRange; NSFontManager *fm = [NSFontManager sharedFontManager]; if (NSMaxRange (range) > [self length]) { [NSException raise: NSRangeException format: @"RangeError in method -applyFontTraits: range: "]; } while (loc < NSMaxRange (range)) { font = [self attribute: NSFontAttributeName atIndex: loc effectiveRange: &effRange]; if (font != nil) { font = [fm convertFont: font toHaveTrait: traitMask]; if (font != nil) { [self addAttribute: NSFontAttributeName value: font range: NSIntersectionRange (effRange, range)]; } } loc = NSMaxRange(effRange); } } - (void) setAlignment: (NSTextAlignment)alignment range: (NSRange)range { id value; NSUInteger loc = range.location; if (NSMaxRange(range) > [self length]) { [NSException raise: NSRangeException format: @"RangeError in method -setAlignment: range: "]; } while (loc < NSMaxRange(range)) { BOOL copiedStyle = NO; NSRange effRange; NSRange newRange; value = [self attribute: NSParagraphStyleAttributeName atIndex: loc effectiveRange: &effRange]; newRange = NSIntersectionRange (effRange, range); if (value == nil) { value = [NSMutableParagraphStyle defaultParagraphStyle]; } else { value = [value mutableCopy]; copiedStyle = YES; } [value setAlignment: alignment]; [self addAttribute: NSParagraphStyleAttributeName value: value range: newRange]; if (copiedStyle == YES) { RELEASE(value); } loc = NSMaxRange (effRange); } } - (void) fixAttributesInRange: (NSRange)range { [self fixFontAttributeInRange: range]; [self fixParagraphStyleAttributeInRange: range]; [self fixAttachmentAttributeInRange: range]; } static NSString *lastFont = nil; static NSCharacterSet *lastSet = nil; static NSMutableDictionary *cachedCSets = nil; - (NSFont*)_substituteFontWithName: (NSString*)fontName font: (NSFont*)baseFont { return [[NSFontManager sharedFontManager] convertFont: baseFont toFace: fontName]; } - (NSFont*)_substituteFontFor: (unichar)uchar font: (NSFont*)baseFont fromList: (NSArray *)fonts { NSUInteger count; NSUInteger i; if (cachedCSets == nil) { cachedCSets = [NSMutableDictionary new]; } count = [fonts count]; for (i = 0; i < count; i++) { NSFont *newFont; NSString *fName; NSCharacterSet *newSet; fName = [fonts objectAtIndex: i]; newSet = [cachedCSets objectForKey: fName]; if (newSet == nil) { newFont = [self _substituteFontWithName: fName font: baseFont]; newSet = [newFont coveredCharacterSet]; if ((newSet != nil) && ([cachedCSets count] < 10)) { [cachedCSets setObject: newSet forKey: fName]; } } else { newFont = nil; } if ([newSet characterIsMember: uchar]) { ASSIGN(lastFont, fName); ASSIGN(lastSet, newSet); if (newFont != nil) { return newFont; } else { return [self _substituteFontWithName: fName font: baseFont]; } } } return nil; } - (NSFont*)_substituteFontFor: (unichar)uchar font: (NSFont*)baseFont { NSFont *subFont; // Caching one font may lead to the selected substitution font not being // from the prefered list, although there is one there with this character. if (lastSet && [lastSet characterIsMember: uchar]) { return [self _substituteFontWithName: lastFont font: baseFont]; } subFont = [self _substituteFontFor: uchar font: baseFont fromList: [NSFont preferredFontNames]]; if (subFont != nil) { return subFont; } subFont = [self _substituteFontFor: uchar font: baseFont fromList: [[NSFontManager sharedFontManager] availableFonts]]; if (subFont != nil) { return subFont; } return nil; } - (void) fixFontAttributeInRange: (NSRange)range { NSString *string; NSFont *font = nil; NSCharacterSet *charset = nil; NSRange fontRange = NSMakeRange(NSNotFound, 0); NSUInteger i; NSUInteger lastMax; NSUInteger start; unichar chars[64]; CREATE_AUTORELEASE_POOL(pool); if (NSMaxRange (range) > [self length]) { [NSException raise: NSRangeException format: @"RangeError in method -fixFontAttributeInRange: "]; } // Check for each character if it is supported by the // assigned font /* Note that this needs to be done on a script basis. Per-character checks are difficult to do at all, don't give reasonable results, and would have really poor performance. */ string = [self string]; lastMax = range.location; start = lastMax; for (i = range.location; i < NSMaxRange(range); i++) { unichar uchar; if (i >= lastMax) { NSUInteger dist; start = lastMax; dist = MIN(64, NSMaxRange(range) - start); lastMax = start + dist; [string getCharacters: chars range: NSMakeRange(start, dist)]; } uchar = chars[i - start]; if (!NSLocationInRange(i, fontRange)) { font = [self attribute: NSFontAttributeName atIndex: i effectiveRange: &fontRange]; /* If we don't have an attribute for NSFontAttributeName, ** we take a default font so we can carry on with the ** substitution. */ if (nil == font) { font = [NSFont userFontOfSize:0.0]; } charset = [font coveredCharacterSet]; } if (charset != nil && ![charset characterIsMember: uchar] && (uchar > 31)) { // Find a replacement font NSFont *subFont; subFont = [self _substituteFontFor: uchar font: font]; if (subFont != nil) { // Set substitution font permanently [self addAttribute: NSFontAttributeName value: subFont range: NSMakeRange(i, 1)]; } } } [pool drain]; } - (void) fixParagraphStyleAttributeInRange: (NSRange)range { NSString *str = [self string]; NSUInteger loc = range.location; NSRange r; if (NSMaxRange (range) > [self length]) { [NSException raise: NSRangeException format: @"RangeError in method -fixParagraphStyleAttributeInRange: "]; } while (loc < NSMaxRange (range)) { NSParagraphStyle *style; NSRange found; NSUInteger end; /* Extend loc to take in entire paragraph if necessary. */ r = [str lineRangeForRange: NSMakeRange (loc, 1)]; end = NSMaxRange (r); /* Get the style in effect at the paragraph start. */ style = [self attribute: NSParagraphStyleAttributeName atIndex: r.location longestEffectiveRange: &found inRange: r]; if (style == nil) { /* No style found at the beginning of paragraph. found is the range without the style set. */ if ((NSMaxRange (found) + 1) < end) { /* There is a paragraph style for part of the paragraph. Set this style for the entire paragraph. Since NSMaxRange(found) + 1 is outside the longest effective range for the nil style, it must be non-nil. */ style = [self attribute: NSParagraphStyleAttributeName atIndex: NSMaxRange(found) + 1 effectiveRange: NULL]; [self addAttribute: NSParagraphStyleAttributeName value: style range: r]; } else { /* All the paragraph without a style ... too bad, fixup the whole paragraph using the default paragraph style. */ [self addAttribute: NSParagraphStyleAttributeName value: [NSParagraphStyle defaultParagraphStyle] range: r]; } } else { if (NSMaxRange (found) < end) { /* Not the whole paragraph has the same style ... add the style found at the beginning to the remainder of the paragraph. */ found.location = NSMaxRange (found); found.length = end - found.location; [self addAttribute: NSParagraphStyleAttributeName value: style range: found]; } } /* Move on to the next paragraph. */ loc = end; } } - (void) fixAttachmentAttributeInRange: (NSRange)range { NSString *string = [self string]; NSUInteger location = range.location; NSUInteger end = NSMaxRange (range); cache_init (); if (end > [self length]) { [NSException raise: NSRangeException format: @"RangeError in method -fixAttachmentAttributeInRange: "]; } // Check for attachments with the wrong character while (location < end) { NSDictionary *attr; NSRange eRange; attr = [self attributesAtIndex: location effectiveRange: &eRange]; if ([attr objectForKey: NSAttachmentAttributeName] != nil) { unichar buf[eRange.length]; NSUInteger pos = 0; NSUInteger start = eRange.location; // Leave only one character with the attachment [string getCharacters: buf range: eRange]; while (pos < eRange.length && buf[pos] != NSAttachmentCharacter) pos++; if (pos) [self removeAttribute: NSAttachmentAttributeName range: NSMakeRange (start, pos)]; pos++; if (pos < eRange.length) [self removeAttribute: NSAttachmentAttributeName range: NSMakeRange (start + pos, eRange.length - pos)]; } location = NSMaxRange (eRange); } // Check for attachment characters without attachments location = range.location; string = [self string]; while (location < end) { NSRange eRange = [string rangeOfString: attachmentString options: NSLiteralSearch range: NSMakeRange (location, end - location)]; NSTextAttachment *attachment; if (!eRange.length) break; attachment = [self attribute: NSAttachmentAttributeName atIndex: eRange.location effectiveRange: NULL]; if (attachment == nil) { [self deleteCharactersInRange: NSMakeRange (eRange.location, 1)]; eRange.length--; end--; // Need to reset this after every character change string = [self string]; } location = NSMaxRange (eRange); } } - (void) updateAttachmentsFromPath: (NSString *)path { NSString *string = [self string]; NSUInteger location = 0; NSUInteger end = [string length]; cache_init (); while (location < end) { NSRange range = [string rangeOfString: attachmentString options: NSLiteralSearch range: NSMakeRange (location, end - location)]; NSTextAttachment *attachment; NSFileWrapper *fileWrapper; if (!range.length) break; attachment = [self attribute: NSAttachmentAttributeName atIndex: range.location effectiveRange: NULL]; fileWrapper = [attachment fileWrapper]; // FIXME: Is this the correct thing to do? [fileWrapper updateFromPath: [path stringByAppendingPathComponent: [fileWrapper filename]]]; location = NSMaxRange (range); } } - (BOOL) readFromURL: (NSURL *)url options: (NSDictionary *)options documentAttributes: (NSDictionary**)documentAttributes { return [self readFromURL: url options: options documentAttributes: documentAttributes error: NULL]; } - (BOOL) readFromURL: (NSURL *)url options: (NSDictionary *)options documentAttributes: (NSDictionary **)documentAttributes error: (NSError **)error { NSAttributedString *attr; attr = [[NSAttributedString alloc] initWithURL: url options: options documentAttributes: documentAttributes error: error]; if (attr != nil) { [self setAttributedString: attr]; RELEASE(attr); return YES; } return NO; } - (BOOL) readFromData: (NSData *)data options: (NSDictionary *)options documentAttributes: (NSDictionary **)documentAttributes { return [self readFromData: data options: options documentAttributes: documentAttributes error: NULL]; } - (BOOL) readFromData: (NSData *)data options: (NSDictionary *)options documentAttributes: (NSDictionary **)documentAttributes error: (NSError **)error { NSAttributedString *attr; attr = [[NSAttributedString alloc] initWithData: data options: options documentAttributes: documentAttributes error: error]; if (attr) { [self setAttributedString: attr]; RELEASE(attr); return YES; } return NO; } - (void) setBaseWritingDirection: (NSWritingDirection)writingDirection range: (NSRange)range { id value; NSUInteger loc = range.location; if (NSMaxRange(range) > [self length]) { [NSException raise: NSRangeException format: @"RangeError in method -setBaseWritingDirection: range: "]; } while (loc < NSMaxRange(range)) { BOOL copiedStyle = NO; NSRange effRange; NSRange newRange; value = [self attribute: NSParagraphStyleAttributeName atIndex: loc effectiveRange: &effRange]; newRange = NSIntersectionRange(effRange, range); if (value == nil) { value = [NSMutableParagraphStyle defaultParagraphStyle]; } else { value = [value mutableCopy]; copiedStyle = YES; } [value setBaseWritingDirection: writingDirection]; [self addAttribute: NSParagraphStyleAttributeName value: value range: newRange]; if (copiedStyle == YES) { RELEASE(value); } loc = NSMaxRange(effRange); } } @end gnustep-gui-0.24.0/Source/NSPopUpButtonCell.m0000664000076500007650000010227512227306115020666 0ustar brains99brains99/** NSPopUpButtonCell Copyright (C) 1999 Free Software Foundation, Inc. Author: Fred Kiefer Date: Jul 2003 Author: Michael Hanni Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSEvent.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSImage.h" #import "AppKit/NSKeyValueBinding.h" #import "AppKit/NSMenu.h" #import "AppKit/NSMenuView.h" #import "AppKit/NSPopUpButton.h" #import "AppKit/NSPopUpButtonCell.h" #import "AppKit/NSWindow.h" #import "GNUstepGUI/GSTheme.h" #import "GSBindingHelpers.h" /* The image to use in a specific popupbutton depends on type and * preferred edge; that is, _pbc_image[0] if it is a * popup menu, _pbc_image[1] if it is a pulls down list pointing down, * and so on. */ static NSImage *_pbc_image[5]; @interface NSButtonCell (Private) - (GSThemeControlState) themeControlState; @end @interface NSPopUpButtonCell (CocoaExtensions) - (void) _popUpItemAction: (id)sender; @end @implementation NSPopUpButtonCell + (void) initialize { if (self == [NSPopUpButtonCell class]) { [self setVersion: 3]; ASSIGN(_pbc_image[0], [NSImage imageNamed: @"common_Nibble"]); ASSIGN(_pbc_image[1], [NSImage imageNamed: @"common_3DArrowDown"]); ASSIGN(_pbc_image[2], [NSImage imageNamed: @"common_3DArrowRight"]); ASSIGN(_pbc_image[3], [NSImage imageNamed: @"common_3DArrowUp"]); ASSIGN(_pbc_image[4], [NSImage imageNamed: @"common_3DArrowLeft"]); } } + (BOOL) prefersTrackingUntilMouseUp { return YES; } + (NSFocusRingType) defaultFocusRingType { return NSFocusRingTypeDefault; } // Initialization /** * Initialize a blank cell. */ - (id) init { return [self initTextCell: @"" pullsDown: NO]; } /** * Initialize with stringValue. */ - (id) initTextCell: (NSString *)stringValue { return [self initTextCell: stringValue pullsDown: NO]; } /* * Helper method should be overriden by Gorm */ - (void)_initMenu { NSMenu *menu; menu = [[NSMenu alloc] initWithTitle: @""]; [self setMenu: menu]; RELEASE(menu); } /** * Initialize with stringValue and pullDown. If pullDown is YES, the * reciever will be a pulldown button. */ - (id) initTextCell: (NSString *)stringValue pullsDown: (BOOL)flag { self = [super initTextCell: stringValue]; if (!self) return nil; [self _initMenu]; [self setPullsDown: flag]; _pbcFlags.usesItemFromMenu = YES; [self setPreferredEdge: NSMaxYEdge]; [self setArrowPosition: NSPopUpArrowAtCenter]; if ([stringValue length] > 0) { [self addItemWithTitle: stringValue]; } return self; } - (void) dealloc { /* * The popup must be closed here, just in case the cell goes away * while the popup is still displayed. In that case the notification * center would still send notifications to the deallocated cell. */ if ([[_menu window] isVisible]) { [self dismissPopUp]; } /* * We don't use methods here to clean up the selected item, the menu * item and the menu as these methods internally update the menu, * which tries to access the target of the menu item (or of this cell). * When the popup is relases this target may already have been freed, * so the local reference to it is invalid and will result in a * segmentation fault. */ if (_menu != nil) { NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; [nc removeObserver: self name: nil object: _menu]; } _selectedItem = nil; [super dealloc]; } // Getters and setters. /** * Set the menu for the popup. */ - (void) setMenu: (NSMenu *)menu { NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; if (_menu == menu) { return; } if (_menu != nil) { [_menu _setOwnedByPopUp: nil]; [nc removeObserver: self name: nil object: _menu]; } ASSIGN(_menu, menu); if (_menu != nil) { [_menu _setOwnedByPopUp: self]; /* We need to set the menu view so we trigger the special case * popupbutton code in super class NSMenuItemCell */ [self setMenuView: [_menu menuRepresentation]]; [nc addObserver: self selector: @selector(synchronizeTitleAndSelectedItem) name: NSMenuDidAddItemNotification object: _menu]; [nc addObserver: self selector: @selector(synchronizeTitleAndSelectedItem) name: NSMenuDidRemoveItemNotification object: _menu]; [nc addObserver: self selector: @selector(synchronizeTitleAndSelectedItem) name: NSMenuDidChangeItemNotification object: _menu]; } else { [self setMenuView: nil]; } // FIXME: Select the first or last item? [self selectItemAtIndex: [_menu numberOfItems] - 1]; [self synchronizeTitleAndSelectedItem]; } - (void)setMenuView: (NSMenuView *)aMenuView { // NB Don't call NSMenuItemCell's implementation here because it also // changes various items of the receiver, which is reasonable for a // menu item cell that is part of a menu, but not for a pop up button // cell. _menuView = aMenuView; } /** * Return the menu for the popup. */ - (NSMenu *) menu { return _menu; } /** * Set the pull-down state */ - (void) setPullsDown: (BOOL)flag { NSMenuItem *item = _menuItem; [self setMenuItem: nil]; if (flag && !_pbcFlags.pullsDown && _pbcFlags.altersStateOfSelectedItem) { [[self selectedItem] setState: NSOffState]; } _pbcFlags.pullsDown = flag; [self setMenuItem: item]; [self synchronizeTitleAndSelectedItem]; } /** * Returns YES, if this is a pull-down */ - (BOOL) pullsDown { return _pbcFlags.pullsDown; } /** * Set to YES, if the items are to be autoenabled. */ - (void) setAutoenablesItems: (BOOL)flag { [_menu setAutoenablesItems: flag]; } /** * Returns YES, if the items are autoenabled. */ - (BOOL) autoenablesItems { return [_menu autoenablesItems]; } /** * Set the preferred edge as described by edge. This is used * to determine the edge which will open the popup when the screen * is small. */ - (void) setPreferredEdge: (NSRectEdge)preferredEdge { _pbcFlags.preferredEdge = preferredEdge; } /** * Return the preferred edge. */ - (NSRectEdge) preferredEdge { return _pbcFlags.preferredEdge; } /** * Set to YES, if the reciever should use a menu item for its title. YES * is the default. */ - (void) setUsesItemFromMenu: (BOOL)flag { if (_pbcFlags.usesItemFromMenu != flag) { _pbcFlags.usesItemFromMenu = flag; if (!flag) { NSMenuItem *anItem; anItem = [[NSMenuItem alloc] initWithTitle: [self title] action: NULL keyEquivalent: nil]; [self setMenuItem: anItem]; RELEASE(anItem); } } } /** * Returns YES, if the reciever uses a menu item for its title. */ - (BOOL) usesItemFromMenu { return _pbcFlags.usesItemFromMenu; } /** * Return YES, if the reciever changes the state of the item chosen by * the user. */ - (void) setAltersStateOfSelectedItem: (BOOL)flag { id selectedItem = [self selectedItem]; if (flag) { [selectedItem setState: NSOnState]; } else { [selectedItem setState: NSOffState]; } _pbcFlags.altersStateOfSelectedItem = flag; } /** * Return YES, if the reciever changes the state of the item chosen by * the user. */ - (BOOL) altersStateOfSelectedItem { return _pbcFlags.altersStateOfSelectedItem; } /** * Returns the current arrow position of the reciever. */ - (NSPopUpArrowPosition) arrowPosition { return _pbcFlags.arrowPosition; } /** * Sets the current arrow position of the reciever. */ - (void) setArrowPosition: (NSPopUpArrowPosition)pos { _pbcFlags.arrowPosition = pos; } // Item management /** * Add an item to the popup with title. */ - (void) addItemWithTitle: (NSString *)title { [self insertItemWithTitle: title atIndex: [_menu numberOfItems]]; } /** * Add a number of items to the reciever using the provided itemTitles array. */ - (void) addItemsWithTitles: (NSArray *)titles { unsigned c = [titles count]; unsigned i; for (i = 0; i < c; i++) { [self addItemWithTitle: [titles objectAtIndex: i]]; } } /** * Adds an item with the given title at index. If an item already exists at * index, it, and all items after it are advanced one position. Index needs * to be within the valid range for the array of items in the popup button. */ - (void) insertItemWithTitle: (NSString *)title atIndex: (NSInteger)index { id anItem; NSInteger i, count; i = [self indexOfItemWithTitle: title]; if (-1 != i) { [self removeItemAtIndex: i]; } count = [_menu numberOfItems]; if (index < 0) index = 0; if (index > count) index = count; anItem = [_menu insertItemWithTitle: title action: NULL keyEquivalent: @"" atIndex: index]; /* Disable showing the On/Off/Mixed state. We change the state of menu items when selected, according to the doc, but we don't want it to appear on the screen. */ [anItem setOnStateImage: nil]; [anItem setMixedStateImage: nil]; // FIXME: The documentation is unclear what to set here. //[anItem setAction: [self action]]; //[anItem setTarget: [self target]]; // Or [anItem setAction: @selector(_popUpItemAction:)]; [anItem setTarget: self]; // Select the new item if there isn't any selection. if (_selectedItem == nil) { [self selectItem: anItem]; } } /** * Remove a given item based on its title. */ - (void) removeItemWithTitle: (NSString *)title { [self removeItemAtIndex: [self indexOfItemWithTitle: title]]; } /** * Remove a given item based on its index, must be a valid index within the * range for the item array of this popup. */ - (void) removeItemAtIndex: (NSInteger)index { if (index == [self indexOfSelectedItem]) { [self selectItem: nil]; } [_menu removeItemAtIndex: index]; } /** * Purges all items from the popup. */ - (void) removeAllItems { [self selectItem: nil]; while ([_menu numberOfItems] > 0) { [_menu removeItemAtIndex: 0]; } } // Referencing items... /** * Item array of the reciever. */ - (NSArray *) itemArray { return [_menu itemArray]; } /** * Number of items in the reciever. */ - (NSInteger) numberOfItems { return [_menu numberOfItems]; } /** * Return the index of item in the item array of the reciever. */ - (NSInteger) indexOfItem: (id )item { return [_menu indexOfItem: item]; } /** * Return index of the item with the given title. */ - (NSInteger) indexOfItemWithTitle: (NSString *)title { return [_menu indexOfItemWithTitle: title]; } /** * Return index of the item with a tag equal to aTag. */ - (NSInteger) indexOfItemWithTag: (NSInteger)tag { return [_menu indexOfItemWithTag: tag]; } /** * Index of the item whose menu item's representedObject is equal to obj. */ - (NSInteger) indexOfItemWithRepresentedObject: (id)obj { return [_menu indexOfItemWithRepresentedObject: obj]; } /** * Index of the item in the reciever whose target and action * are equal to aTarget and actionSelector. */ - (NSInteger) indexOfItemWithTarget: (id)aTarget andAction: (SEL)actionSelector { return [_menu indexOfItemWithTarget: aTarget andAction: actionSelector]; } /** * Return the item at index. */ - (id ) itemAtIndex: (NSInteger)index { if ((index >= 0) && (index < [_menu numberOfItems])) { return [_menu itemAtIndex: index]; } else { return nil; } } /** * Return the item with title. */ - (id ) itemWithTitle: (NSString *)title { return [_menu itemWithTitle: title]; } /** * Return the item listed last in the reciever. */ - (id ) lastItem { NSInteger end = [_menu numberOfItems] - 1; if (end < 0) return nil; return [_menu itemAtIndex: end]; } /* The Cocoa specification has this method as: - (id ) objectValue But this gives a conflict with the NSCell declaration of this method, which is: - (id) objectValue */ - (id ) objectValue { return [NSNumber numberWithInt: [self indexOfSelectedItem]]; } - (void) setObjectValue: (id)object { if ([object respondsToSelector: @selector(intValue)]) { int i = [object intValue]; [self selectItemAtIndex: i]; [self synchronizeTitleAndSelectedItem]; } } - (NSImage *) _currentArrowImage { if (_pbcFlags.pullsDown) { if (_pbcFlags.arrowPosition == NSPopUpNoArrow) { return nil; } if (_pbcFlags.preferredEdge == NSMaxYEdge) { return _pbc_image[1]; } else if (_pbcFlags.preferredEdge == NSMaxXEdge) { return _pbc_image[2]; } else if (_pbcFlags.preferredEdge == NSMinYEdge) { return _pbc_image[3]; } else if (_pbcFlags.preferredEdge == NSMinXEdge) { return _pbc_image[4]; } else { return _pbc_image[1]; } } else { return _pbc_image[0]; } } - (void) setImage: (NSImage *)anImage { // Do nothing as the image is determined by the current item } - (void) setMenuItem: (NSMenuItem *)item { NSImage *image; if (_menuItem == item) return; image = [self _currentArrowImage]; if ([_menuItem image] == image) { [_menuItem setImage: nil]; } //[super setMenuItem: item]; ASSIGN(_menuItem, item); if ([_menuItem image] == nil) { [_menuItem setImage: image]; } } - (void) selectItem: (id )item { id oldSelectedItem = _selectedItem; if (_selectedItem == item) { // pull-down should set highlighted item even when selection is unchanged if (_pbcFlags.pullsDown) [[_menu menuRepresentation] setHighlightedItemIndex: [_menu indexOfItem: _selectedItem]]; return; } if (_selectedItem != nil) { if (_pbcFlags.altersStateOfSelectedItem) { [_selectedItem setState: NSOffState]; } } _selectedItem = item; /* Set the item in the menu */ /* Note: Must do this before changing the state of the selected item, since * the change will recursively invoke synchronizeTitleAndSelectedItem, which * otherwise would select the old item again */ [[_menu menuRepresentation] setHighlightedItemIndex: [_menu indexOfItem: _selectedItem]]; if (_selectedItem != nil) { if (_pbcFlags.altersStateOfSelectedItem) { [_selectedItem setState: NSOnState]; } } if (oldSelectedItem) { [[_menu menuRepresentation] setNeedsDisplayForItemAtIndex: [_menu indexOfItem: oldSelectedItem]]; } } - (void) selectItemAtIndex: (NSInteger)index { id anItem; if (index < 0) anItem = nil; else anItem = [self itemAtIndex: index]; [self selectItem: anItem]; } - (void) selectItemWithTitle: (NSString *)title { id anItem = [self itemWithTitle: title]; [self selectItem: anItem]; } - (NSString *)title { id selectedItem; if (!_pbcFlags.usesItemFromMenu) { selectedItem = _menuItem; } else if (_pbcFlags.pullsDown) { if ([_menu numberOfItems] == 0) { selectedItem = _menuItem; } else { selectedItem = [_menu itemAtIndex: 0]; } } else { selectedItem = [self selectedItem]; } return [selectedItem title]; } - (void) setTitle: (NSString *)aString { id anItem; if (!_pbcFlags.usesItemFromMenu) { [_menuItem setTitle: aString]; return; } else if (_pbcFlags.pullsDown) { if ([_menu numberOfItems] == 0) { anItem = nil; } else { anItem = [_menu itemAtIndex: 0]; [anItem setTitle: aString]; } } else { anItem = [_menu itemWithTitle: aString]; if (anItem == nil) { [self addItemWithTitle: aString]; anItem = [_menu itemWithTitle: aString]; } } [self selectItem: anItem]; } - (NSString *)stringValue { return [self titleOfSelectedItem]; } - (id ) selectedItem { return _selectedItem; } - (id) representedObject { return [[self selectedItem] representedObject]; } - (void) setRepresentedObject: (id)object { [[self selectedItem] setRepresentedObject: object]; } - (NSInteger) indexOfSelectedItem { return [_menu indexOfItem: [self selectedItem]]; } - (void) synchronizeTitleAndSelectedItem { NSInteger index; if (!_pbcFlags.usesItemFromMenu) return; if ([_menu numberOfItems] == 0) { index = -1; } else if (_pbcFlags.pullsDown) { index = 0; } else { index = [[_menu menuRepresentation] highlightedItemIndex]; if (index < 0) { // If no item is highighted, display the selected one, if there is one. index = [self indexOfSelectedItem]; } else { // Selected the highlighted item [self selectItemAtIndex: index]; } } if ((index >= 0) && ([_menu numberOfItems] > index)) { NSMenuItem *anItem; // This conversion is needed as [setMenuItem:] expects an NSMenuItem anItem = (NSMenuItem *)[_menu itemAtIndex: index]; [self setMenuItem: anItem]; } else { [self setMenuItem: nil]; } if (_control_view) if ([_control_view isKindOfClass: [NSControl class]]) [(NSControl *)_control_view updateCell: self]; } // Title management /** * Set item title at the given index in the reciever. */ - (NSString *) itemTitleAtIndex: (NSInteger)index { return [[self itemAtIndex: index] title]; } /** * Returns an array containing all of the current item titles. */ - (NSArray *) itemTitles { unsigned count = [_menu numberOfItems]; id items[count]; unsigned i; [[_menu itemArray] getObjects: items]; for (i = 0; i < count; i++) { items[i] = [items[i] title]; } return [NSArray arrayWithObjects: items count: count]; } /** * Returns the title of the currently selected item in the reciever. */ - (NSString *) titleOfSelectedItem { id item = [self selectedItem]; if (item != nil) return [item title]; else return @""; } /** * Attach popup */ - (void) attachPopUpWithFrame: (NSRect)cellFrame inView: (NSView *)controlView { NSRectEdge preferredEdge = _pbcFlags.preferredEdge; NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; NSWindow *cvWin = [controlView window]; NSMenuView *mr = [_menu menuRepresentation]; NSInteger selectedItem; [nc postNotificationName: NSPopUpButtonCellWillPopUpNotification object: self]; [nc postNotificationName: NSPopUpButtonWillPopUpNotification object: controlView]; // Convert to Screen Coordinates cellFrame = [controlView convertRect: cellFrame toView: nil]; cellFrame.origin = [cvWin convertBaseToScreen: cellFrame.origin]; if (_pbcFlags.pullsDown) selectedItem = -1; else { selectedItem = [self indexOfSelectedItem]; if (selectedItem == -1) { selectedItem = 0; } } if (selectedItem > 0) { [mr setHighlightedItemIndex: selectedItem]; } if ([controlView isFlipped]) { if (preferredEdge == NSMinYEdge) { preferredEdge = NSMaxYEdge; } else if (preferredEdge == NSMaxYEdge) { preferredEdge = NSMinYEdge; } } // display the menu item... [[GSTheme theme] displayPopUpMenu: mr withCellFrame: cellFrame controlViewWindow: cvWin preferredEdge: preferredEdge selectedItem: selectedItem]; [nc addObserver: self selector: @selector(_handleNotification:) name: NSMenuDidSendActionNotification object: _menu]; } /** * Dismiss the reciever. */ - (void) dismissPopUp { NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; NSMenuView *mr = [_menu menuRepresentation]; NSWindow *mWin; [nc removeObserver: self name: NSMenuDidSendActionNotification object: _menu]; [_menu close]; // remove from main window mWin = [mr window]; [[mWin parentWindow] removeChildWindow: mWin]; } /* Private method handles all cases after doing a selection from the popup menu. Especially the obscure case where the user uses the keyboard to open a popup, but subsequently uses the mouse to select an item. We'll never know this was done (and thus cannot dismiss the popUp) without getting this notification */ - (void) _handleNotification: (NSNotification*)aNotification { NSString *name = [aNotification name]; if ([name isEqual: NSMenuDidSendActionNotification] == YES) { [self dismissPopUp]; [self synchronizeTitleAndSelectedItem]; } } - (BOOL) trackMouse: (NSEvent *)theEvent inRect: (NSRect)cellFrame ofView: (NSView *)controlView untilMouseUp: (BOOL)untilMouseUp { NSMenuView *mr = [[self menu] menuRepresentation]; NSWindow *menuWindow = [mr window]; NSEvent *e; NSPoint p; if ([self isEnabled] == NO) return NO; if ([[self menu] numberOfItems] == 0) { NSBeep (); return NO; } // Attach the popUp [self attachPopUpWithFrame: cellFrame inView: controlView]; p = [[controlView window] convertBaseToScreen: [theEvent locationInWindow]]; p = [menuWindow convertScreenToBase: p]; // Process events; we start menu events processing by converting // this event to the menu window, and sending it there. e = [NSEvent mouseEventWithType: [theEvent type] location: p modifierFlags: [theEvent modifierFlags] timestamp: [theEvent timestamp] windowNumber: [menuWindow windowNumber] context: [theEvent context] eventNumber: [theEvent eventNumber] clickCount: [theEvent clickCount] pressure: [theEvent pressure]]; // Send the event directly to the popup window, as it may not be located // at the event position. [mr mouseDown: e]; // End of mouse tracking here -- dismiss popup // No synchronization needed here if ([[_menu window] isVisible]) { [self dismissPopUp]; return NO; } return YES; } /** * Perform the click operation with the given frame and controlView. */ - (void) performClickWithFrame: (NSRect)frame inView: (NSView *)controlView { [super performClickWithFrame: frame inView: controlView]; [self attachPopUpWithFrame: frame inView: controlView]; } /* * Override the implementation in NSMenuItemCell to behave the same * as superclass NSButtonCell's implementation, since our direct * superclass NSMenuItemCell has special menu-specific drawing. */ - (void) drawBorderAndBackgroundWithFrame: (NSRect)cellFrame inView: (NSView *)controlView { [[GSTheme theme] drawButton: cellFrame in: self view: controlView style: _bezel_style state: [self themeControlState]]; } /* * This drawing uses the same code that is used to draw cells in the menu. */ - (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { BOOL new = NO; if ([self menuItem] == nil) { NSMenuItem *anItem; /* * Create a temporary NSMenuItemCell to at least draw our control, * if items array is empty. */ anItem = [NSMenuItem new]; [anItem setTitle: [self title]]; /* We need this menu item because NSMenuItemCell gets its contents * from the menuItem not from what is set in the cell */ [self setMenuItem: anItem]; RELEASE(anItem); new = YES; } /* We need to calc our size to get images placed correctly */ [self calcSize]; [[GSTheme theme] drawPopUpButtonCellInteriorWithFrame: cellFrame withCell: self inView: controlView]; [super drawInteriorWithFrame: cellFrame inView: controlView]; /* Unset the item to restore balance if a new was created */ if (new) { [self setMenuItem: nil]; } } /* FIXME: this method needs to be rewritten to be something like * NSMenuView's sizeToFit. That way if you call [NSPopUpButton sizeToFit]; * you will get the absolutely correct cellSize. * Not sure if this is true. Maybe the popup should only use the size * of the current title, at least, when usesItemFromMenu is false. */ - (NSSize) cellSize { NSSize s; NSSize imageSize; NSSize titleSize; NSInteger i, count; NSString *title; NSImage *image; count = [_menu numberOfItems]; image = [self _currentArrowImage]; if (image) imageSize = [image size]; else imageSize = NSZeroSize; s = NSMakeSize(0, imageSize.height); if (count == 0) { title = [self title]; titleSize = [self _sizeText: title]; if (titleSize.width > s.width) s.width = titleSize.width; if (titleSize.height > s.height) s.height = titleSize.height; } for (i = 0; i < count; i++) { title = [[_menu itemAtIndex: i] title]; titleSize = [self _sizeText: title]; if (titleSize.width > s.width) s.width = titleSize.width; if (titleSize.height > s.height) s.height = titleSize.height; } s.width += imageSize.width; s.width += 5; /* Left border to text (border included) */ s.width += 3; /* Text to Image */ s.width += 4; /* Right border to image (border included) */ /* (vertical) border: */ s.height += 2 * [[GSTheme theme] sizeForBorderType: NSBezelBorder].height; /* Spacing between border and inside: */ s.height += 2 * 1; s.width += 2 * 3; return s; } - (void) setAction: (SEL)aSelector { [super setAction: aSelector]; [_menu update]; } - (void) setTarget: (id)anObject { [super setTarget: anObject]; [_menu update]; } // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { [aCoder encodeBool: [self altersStateOfSelectedItem] forKey: @"NSAltersState"]; [aCoder encodeBool: [self usesItemFromMenu] forKey: @"NSUsesItemFromMenu"]; [aCoder encodeInt: [self arrowPosition] forKey: @"NSArrowPosition"]; [aCoder encodeInt: [self preferredEdge] forKey: @"NSPreferredEdge"]; [aCoder encodeInt: [self indexOfSelectedItem] forKey: @"NSSelectedIndex"]; [aCoder encodeBool: [self pullsDown] forKey: @"NSPullDown"]; // encode the menu, if present. if (_menu != nil) { [aCoder encodeObject: _menu forKey: @"NSMenu"]; } } else { int flag; [aCoder encodeObject: _menu]; [aCoder encodeConditionalObject: [self selectedItem]]; flag = _pbcFlags.pullsDown; [aCoder encodeValueOfObjCType: @encode(int) at: &flag]; flag = _pbcFlags.preferredEdge; [aCoder encodeValueOfObjCType: @encode(int) at: &flag]; flag = _pbcFlags.usesItemFromMenu; [aCoder encodeValueOfObjCType: @encode(int) at: &flag]; flag = _pbcFlags.altersStateOfSelectedItem; [aCoder encodeValueOfObjCType: @encode(int) at: &flag]; flag = _pbcFlags.arrowPosition; [aCoder encodeValueOfObjCType: @encode(int) at: &flag]; } } - (id) initWithCoder: (NSCoder*)aDecoder { NSMenu *menu; self = [super initWithCoder: aDecoder]; if (!self) return nil; if ([aDecoder allowsKeyedCoding]) { /* First decode menu, menu items must be available to set the selection */ menu = [aDecoder decodeObjectForKey: @"NSMenu"]; [self setMenu: nil]; [self setMenu: menu]; if ([aDecoder containsValueForKey: @"NSAltersState"]) { BOOL alters = [aDecoder decodeBoolForKey: @"NSAltersState"]; [self setAltersStateOfSelectedItem: alters]; } if ([aDecoder containsValueForKey: @"NSPullDown"]) { BOOL pullDown = [aDecoder decodeBoolForKey: @"NSPullDown"]; [self setPullsDown: pullDown]; } if ([aDecoder containsValueForKey: @"NSUsesItemFromMenu"]) { BOOL usesItem = [aDecoder decodeBoolForKey: @"NSUsesItemFromMenu"]; [self setUsesItemFromMenu: usesItem]; } if ([aDecoder containsValueForKey: @"NSArrowPosition"]) { NSPopUpArrowPosition position = [aDecoder decodeIntForKey: @"NSArrowPosition"]; [self setArrowPosition: position]; } if ([aDecoder containsValueForKey: @"NSPreferredEdge"]) { NSRectEdge edge = [aDecoder decodeIntForKey: @"NSPreferredEdge"]; [self setPreferredEdge: edge]; } if ([aDecoder containsValueForKey: @"NSSelectedIndex"]) { int selectedIdx = [aDecoder decodeIntForKey: @"NSSelectedIndex"]; [self selectItemAtIndex: selectedIdx]; } else { [self selectItemAtIndex: 0]; } if ([aDecoder containsValueForKey: @"NSMenuItem"]) { NSMenuItem *item = [aDecoder decodeObjectForKey: @"NSMenuItem"]; [self setMenuItem: item]; } } else { int flag; id selectedItem; int version = [aDecoder versionForClassName: @"NSPopUpButtonCell"]; menu = [aDecoder decodeObject]; /* FIXME: This same ivar already gets set in NSCell initWithCoder, but there it is used directly not via a method call. So here we first unset it and than set it again as our setMenu: method tries to optimize duplicate calls. */ [self setMenu: nil]; [self setMenu: menu]; selectedItem = [aDecoder decodeObject]; [aDecoder decodeValueOfObjCType: @encode(int) at: &flag]; _pbcFlags.pullsDown = flag; [aDecoder decodeValueOfObjCType: @encode(int) at: &flag]; _pbcFlags.preferredEdge = flag; [aDecoder decodeValueOfObjCType: @encode(int) at: &flag]; _pbcFlags.usesItemFromMenu = flag; [aDecoder decodeValueOfObjCType: @encode(int) at: &flag]; _pbcFlags.altersStateOfSelectedItem = flag; [aDecoder decodeValueOfObjCType: @encode(int) at: &flag]; _pbcFlags.arrowPosition = flag; if (version < 2) { int i; // Not the stored format did change but the interpretation of it. // in version 1 most of the ivars were not used, so their values may // be arbitray. We overwrite them with valid settings. [self setPullsDown: _pbcFlags.pullsDown]; _pbcFlags.usesItemFromMenu = YES; for (i = 0; i < [_menu numberOfItems]; i++) { id anItem = [menu itemAtIndex: i]; [anItem setOnStateImage: nil]; [anItem setMixedStateImage: nil]; } [self setEnabled: YES]; } if (version < 3) { [self setPreferredEdge: NSMaxYEdge]; [self setArrowPosition: NSPopUpArrowAtCenter]; } [self selectItem: selectedItem]; } return self; } @end @implementation NSPopUpButtonCell (CocoaExtensions) /* * The selector for this method gets used by menu items in Apple NIB files. */ - (void) _popUpItemAction: (id)sender { // first, if sender is one of our items, set it as our selected item NSUInteger index = [_menu indexOfItem: sender]; if (index != NSNotFound) [self selectItemAtIndex: index]; if (_control_view) { GSKeyValueBinding *theBinding; theBinding = [GSKeyValueBinding getBinding: NSSelectedIndexBinding forObject: _control_view]; if (theBinding != nil) [theBinding reverseSetValueFor: NSSelectedIndexBinding]; theBinding = [GSKeyValueBinding getBinding: NSSelectedTagBinding forObject: _control_view]; if (theBinding != nil) [theBinding reverseSetValueFor: NSSelectedTagBinding]; theBinding = [GSKeyValueBinding getBinding: NSSelectedObjectBinding forObject: _control_view]; if (theBinding != nil) [theBinding reverseSetValueFor: NSSelectedObjectBinding]; } [NSApp sendAction: [self action] to: [self target] from: _control_view]; } @end gnustep-gui-0.24.0/Source/NSHelpPanel.m0000664000076500007650000001206012121417516017470 0ustar brains99brains99/** NSHelpPanel 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import "AppKit/NSHelpPanel.h" #import "AppKit/NSHelpManager.h" #import "AppKit/NSScrollView.h" #import "AppKit/NSTextView.h" #import "AppKit/NSTextContainer.h" #import "GSGuiPrivate.h" @implementation NSApplication (NSHelpPanel) - (void) orderFrontHelpPanel: sender { // This is implemented in NSHelpManager.m [self showHelp: sender]; } @end @implementation NSHelpPanel static NSString *_helpDirectory = nil; static NSString *_helpFile = nil; static NSHelpPanel *_sharedPanel = nil; // // Class methods // + (void) initialize { if (self == [NSHelpPanel class]) { // Initial version [self setVersion: 1]; } } // // Accessing the Help Panel // + (NSHelpPanel*) sharedHelpPanel { if (_sharedPanel == nil) { return [self new]; } return _sharedPanel; } + (NSHelpPanel *) sharedHelpPanelWithDirectory: (NSString *)helpDirectory { [self setHelpDirectory: helpDirectory]; return [self sharedHelpPanel]; } // // Managing the Contents // + (void) setHelpDirectory: (NSString *)helpDirectory { ASSIGN(_helpDirectory, helpDirectory); } // // Attaching Help to Objects // + (void) attachHelpFile: (NSString *)filename markerName: (NSString *)markerName to: (id)anObject { if ([filename isAbsolutePath] == NO) { filename = [[[NSHelpPanel sharedHelpPanel] helpDirectory] stringByAppendingPathComponent: filename]; } [[NSHelpManager sharedHelpManager] setContextHelp: (id)filename forObject: anObject]; } + (void) detachHelpFrom: (id)anObject { [[NSHelpManager sharedHelpManager] removeContextHelpForObject: anObject]; } // // Instance methods // // // Managing the Contents // - (void) addSupplement: (NSString *)helpDirectory inPath: (NSString *)supplementPath { } - (NSString *) helpDirectory { return _helpDirectory; } - (NSString *) helpFile { return _helpFile; } - (id) initWithContentRect: (NSRect)contentRect styleMask: (NSUInteger)aStyle backing: (NSBackingStoreType)bufferingType defer: (BOOL)flag { if (_sharedPanel == nil) { NSScrollView *s; NSTextView *v; NSRect r; /* We have a standard start size. */ contentRect = NSMakeRect(100,100,400,500); self = [super initWithContentRect: contentRect styleMask: NSTitledWindowMask|NSClosableWindowMask|NSResizableWindowMask backing: NSBackingStoreBuffered defer: NO]; if (nil == self) return nil; [self setReleasedWhenClosed: NO]; [self setTitle: _(@"Help")]; s = [[NSScrollView alloc] initWithFrame: contentRect]; [s setHasHorizontalScroller: YES]; [s setHasVerticalScroller: YES]; [s setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)]; [self setContentView: s]; RELEASE(s); r = [[s documentView] frame]; v = [[NSTextView alloc] initWithFrame: r]; [v setHorizontallyResizable: YES]; [v setVerticallyResizable: YES]; [v setEditable: NO]; [v setRichText: YES]; [v setMinSize: NSMakeSize (0, 0)]; [v setMaxSize: NSMakeSize (1E7, 1E7)]; [v setAutoresizingMask: NSViewHeightSizable | NSViewWidthSizable]; [[v textContainer] setContainerSize: NSMakeSize (MAX(r.size.width, 0.0), 1e7)]; [[v textContainer] setWidthTracksTextView: YES]; [s setDocumentView: v]; RELEASE(v); _sharedPanel = self; } else { RELEASE(self); RETAIN(_sharedPanel); } return _sharedPanel; } // // Showing Help // - (void) showFile: (NSString *)filename atMarker: (NSString *)markerName { if ([filename isAbsolutePath] == NO) { filename = [[[NSHelpPanel sharedHelpPanel] helpDirectory] stringByAppendingPathComponent: filename]; } [[NSHelpManager sharedHelpManager] setContextHelp: (id)filename forObject: self]; [self showHelpAttachedTo: self]; } - (BOOL) showHelpAttachedTo: (id)anObject { return [[NSHelpManager sharedHelpManager] showContextHelpForObject: anObject locationHint: NSZeroPoint]; } // // Printing // - (void) print: (id)sender { } @end gnustep-gui-0.24.0/Source/NSOpenGLPixelFormat.m0000664000076500007650000000544212066646726021144 0ustar brains99brains99/** NSOpenGLPixelFormat.m use to choose the type of GL context Copyright (C) 1996 Free Software Foundation, Inc. Author: Frederic De Jaeger Date: 2002 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import "AppKit/NSOpenGL.h" #import "GNUstepGUI/GSDisplayServer.h" @implementation NSOpenGLPixelFormat + (Class) _classPixelFormat { Class glPixelFormatClass = [GSCurrentServer() glPixelFormatClass]; if (glPixelFormatClass == nil) { NSWarnMLog(@"Backend doesn't have any glPixelFormatClass"); return nil; } else { NSDebugMLLog(@"GLX", @"found a class %@", glPixelFormatClass); return glPixelFormatClass; } } + (id) allocWithZone: (NSZone*) z { Class c = [self _classPixelFormat]; if (c) return NSAllocateObject(c, 0, z); else return nil; } - (void) getValues: (int*)vals forAttribute: (NSOpenGLPixelFormatAttribute)attrib forVirtualScreen: (int)screen { [self subclassResponsibility: _cmd]; } - (id) initWithAttributes: (NSOpenGLPixelFormatAttribute*)attribs { [self subclassResponsibility: _cmd]; return nil; } - (int) numberOfVirtualScreens { [self subclassResponsibility: _cmd]; return 0; } - (id) initWithCoder: (NSCoder*)aDecoder { if ([aDecoder allowsKeyedCoding]) { NSMutableData *attrs = [aDecoder decodeObjectForKey: @"NSPixelAttributes"]; if (attrs != nil) { NSOpenGLPixelFormatAttribute *glattrs; unsigned char tmp = 0; // Ensure that it is zero-terminated [attrs appendBytes: &tmp length: sizeof(tmp)]; // FIXME: Deserialize an integer array glattrs = (NSOpenGLPixelFormatAttribute *)[attrs mutableBytes]; return [self initWithAttributes: glattrs]; } } else { } return self; } - (void) encodeWithCoder: (NSCoder*)aCoder { [self subclassResponsibility: _cmd]; } @end gnustep-gui-0.24.0/Source/NSSavePanel.m0000664000076500007650000015552612202222436017510 0ustar brains99brains99/** NSSavePanel Standard panel for saving files Copyright (C) 1999, 2000 Free Software Foundation, Inc. Author: Jonathan Gapen Date: 1999 Author: Nicola Pero Date: 1999 Author: Mirko Viviani Date: September 2000 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSBox.h" #import "AppKit/NSBrowser.h" #import "AppKit/NSBrowserCell.h" #import "AppKit/NSButton.h" #import "AppKit/NSEvent.h" #import "AppKit/NSFont.h" #import "AppKit/NSForm.h" #import "AppKit/NSImage.h" #import "AppKit/NSImageView.h" #import "AppKit/NSMatrix.h" #import "AppKit/NSMenu.h" #import "AppKit/NSPasteboard.h" #import "AppKit/NSDragging.h" #import "AppKit/NSSavePanel.h" #import "AppKit/NSTextField.h" #import "AppKit/NSWindowController.h" #import "AppKit/NSWorkspace.h" #import "GSGuiPrivate.h" #import "GNUstepGUI/GSTheme.h" #define _SAVE_PANEL_X_PAD 5 #define _SAVE_PANEL_Y_PAD 4 static NSSavePanel *_gs_gui_save_panel = nil; static NSFileManager *_fm = nil; static BOOL _gs_display_reading_progress = NO; static NSString * pathToColumn(NSBrowser *browser, int column) { #if defined(__MINGW32__) if (column == 0) return @"/"; else if (column == 1) return [[[browser pathToColumn: column] substringFromIndex: 1] stringByAppendingString: @"/"]; else return [[browser pathToColumn: column] substringFromIndex: 1]; #else return [browser pathToColumn: column]; #endif } static void setPath(NSBrowser *browser, NSString *path) { #if defined(__MINGW32__) [browser setPath: [@"/" stringByAppendingString: path]]; #else [browser setPath: path]; #endif } // // SavePanel filename compare // @interface NSString (GSSavePanel) - (NSComparisonResult)_gsSavePanelCompare:(NSString *)other; @end // // NSSavePanel private methods // @interface NSSavePanel (GSPrivateMethods) // Methods to manage default settings - (id) _initWithoutGModel; - (void) _getOriginalSize; - (void) _setDefaultDirectory; - (void) _updateDefaultDirectory; - (void) _resetDefaults; - (void) _reloadBrowser; // Methods invoked by buttons - (void) _setHomeDirectory; - (void) _mountMedia; - (void) _unmountMedia; - (void) _selectTextInColumn: (int)column; - (void) _selectCellName: (NSString *)title; - (void) _setFileName: (NSString *)name; - (void) _setupForDirectory: (NSString *)path file: (NSString *)name; - (BOOL) _shouldShowExtension: (NSString *)extension; - (void) _windowResized: (NSNotification*)n; - (NSComparisonResult) _compareFilename: (NSString *)n1 with: (NSString *)n2; @end /* NSSavePanel (PrivateMethods) */ @implementation NSSavePanel (PrivateMethods) - (NSDragOperation) draggingEntered: (id )sender { NSPasteboard *pb; pb = [sender draggingPasteboard]; if ([[pb types] indexOfObject: NSFilenamesPboardType] == NSNotFound) { return NSDragOperationNone; } return NSDragOperationEvery; } - (BOOL) performDragOperation: (id)sender { NSArray *types; NSPasteboard *dragPb; dragPb = [sender draggingPasteboard]; types = [dragPb types]; if ([types containsObject: NSFilenamesPboardType] == YES) { NSArray *names = [dragPb propertyListForType: NSFilenamesPboardType]; NSString *file = [[names lastObject] stringByStandardizingPath]; BOOL isDir; if (file && [_fm fileExistsAtPath: file isDirectory: &isDir] && isDir) { [self setDirectory: file]; } else { NSString *path = [file stringByDeletingLastPathComponent]; NSString *filename = [file lastPathComponent]; [self _setupForDirectory: path file: filename]; } return YES; } return NO; } - (BOOL) prepareForDragOperation: (id)sender { return YES; } -(id) _initWithoutGModel { NSBox *bar; NSButton *button; NSImage *image; NSImageView *imageView; NSRect r; id lastKeyView; // Track window resizing so we can change number of browser columns. [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_windowResized:) name: NSWindowDidResizeNotification object: self]; // // WARNING: We create the panel sized (308, 317), which is the // minimum size we want it to have. Then, we resize it at the // comfortable size of (384, 426). // self = [super initWithContentRect: NSMakeRect (100, 100, 308, 317) styleMask: (NSTitledWindowMask | NSResizableWindowMask) backing: 2 defer: YES]; if (nil == self) return nil; [self setMinSize: [self frame].size]; r = NSMakeRect (0, 0, 308, 317); [[self contentView] setBounds: r]; r = NSMakeRect (0, 64, 308, 245); _topView = [[NSView alloc] initWithFrame: r]; [_topView setBounds: r]; [_topView setAutoresizingMask: NSViewWidthSizable|NSViewHeightSizable]; [_topView setAutoresizesSubviews: YES]; [[self contentView] addSubview: _topView]; [_topView release]; r = NSMakeRect (0, 0, 308, 64); _bottomView = [[NSView alloc] initWithFrame: r]; [_bottomView setBounds: r]; [_bottomView setAutoresizingMask: NSViewWidthSizable|NSViewMaxYMargin]; [_bottomView setAutoresizesSubviews: YES]; [[self contentView] addSubview: _bottomView]; [_bottomView release]; r = NSMakeRect (8, 68, 292, 177); _browser = [[NSBrowser alloc] initWithFrame: r]; lastKeyView = _browser; [_browser setDelegate: self]; [_browser setHasHorizontalScroller: YES]; [_browser setAllowsMultipleSelection: NO]; [_browser setAutoresizingMask: NSViewWidthSizable|NSViewHeightSizable]; [_browser setTag: NSFileHandlingPanelBrowser]; [_browser setAction: @selector(_selectText:)]; [_browser setTarget: self]; [_browser setMinColumnWidth: 140]; [_topView addSubview: _browser]; [_browser release]; _showsHiddenFilesMenu = [[NSMenu alloc] initWithTitle: @""]; [_showsHiddenFilesMenu insertItemWithTitle: _(@"Show Hidden Files") action:@selector(_toggleShowsHiddenFiles:) keyEquivalent:@"" atIndex:0]; [[_showsHiddenFilesMenu itemAtIndex: 0] setTarget: self]; [[_showsHiddenFilesMenu itemAtIndex: 0] setState: [self showsHiddenFiles]]; [_browser setMenu: _showsHiddenFilesMenu]; [_showsHiddenFilesMenu release]; r = NSMakeRect (8, 39, 291, 21); _form = [NSForm new]; [_form addEntry: _(@"Name:")]; [_form setFrame: r]; // Force the size we want [_form setCellSize: NSMakeSize (291, 21)]; [_form setEntryWidth: 291]; [_form setInterlineSpacing: 0]; [_form setAutosizesCells: YES]; [_form setDrawsBackground: NO]; [_form setTag: NSFileHandlingPanelForm]; [_form setAutoresizingMask: NSViewWidthSizable]; [_form setDelegate: self]; [_bottomView addSubview: _form]; [lastKeyView setNextKeyView: _form]; lastKeyView = _form; [_form release]; r = NSMakeRect (43, 6, 27, 27); button = [[NSButton alloc] initWithFrame: r]; [button setBordered: YES]; image = [NSImage imageNamed: @"common_Home"]; [button setImage: image]; [button setImagePosition: NSImageOnly]; [button setTarget: self]; [button setAction: @selector(_setHomeDirectory)]; [button setAutoresizingMask: NSViewMinXMargin]; [button setTag: NSFileHandlingPanelHomeButton]; [button setToolTip:_(@"Home")]; [_bottomView addSubview: button]; [lastKeyView setNextKeyView: button]; lastKeyView = button; [button release]; r = NSMakeRect (78, 6, 27, 27); button = [[NSButton alloc] initWithFrame: r]; [button setBordered: YES]; image = [NSImage imageNamed: @"common_Mount"]; [button setImage: image]; [button setImagePosition: NSImageOnly]; [button setTarget: self]; [button setAction: @selector(_mountMedia)]; [button setAutoresizingMask: NSViewMinXMargin]; [button setTag: NSFileHandlingPanelDiskButton]; [button setToolTip:_(@"Mount")]; [_bottomView addSubview: button]; [lastKeyView setNextKeyView: button]; lastKeyView = button; [button release]; r = NSMakeRect (112, 6, 27, 27); button = [[NSButton alloc] initWithFrame: r]; [button setBordered: YES]; image = [NSImage imageNamed: @"common_Unmount"]; [button setImage: image]; [button setImagePosition: NSImageOnly]; [button setTarget: self]; [button setAction: @selector(_unmountMedia)]; [button setAutoresizingMask: NSViewMinXMargin]; [button setTag: NSFileHandlingPanelDiskEjectButton]; [button setToolTip:_(@"Unmount")]; [_bottomView addSubview: button]; [lastKeyView setNextKeyView: button]; lastKeyView = button; [button release]; r = NSMakeRect (148, 6, 71, 27); button = [[NSButton alloc] initWithFrame: r]; [button setBordered: YES]; [button setTitle: _(@"Cancel")]; [button setImagePosition: NSNoImage]; [button setTarget: self]; [button setAction: @selector(cancel:)]; [button setAutoresizingMask: NSViewMinXMargin]; [button setTag: NSFileHandlingPanelCancelButton]; [button setKeyEquivalent: @"\e"]; [button setKeyEquivalentModifierMask: 0]; [_bottomView addSubview: button]; [lastKeyView setNextKeyView: button]; lastKeyView = button; [button release]; r = NSMakeRect (228, 6, 71, 27); _okButton = [[NSButton alloc] initWithFrame: r]; [_okButton setBordered: YES]; [_okButton setTitle: _(@"OK")]; [_okButton setImagePosition: NSImageRight]; [_okButton setImage: [NSImage imageNamed: @"common_ret"]]; [_okButton setAlternateImage: [NSImage imageNamed: @"common_retH"]]; [_okButton setTarget: self]; [_okButton setAction: @selector(ok:)]; [_okButton setEnabled: NO]; [_okButton setAutoresizingMask: NSViewMinXMargin]; [_okButton setTag: NSFileHandlingPanelOKButton]; [_bottomView addSubview: _okButton]; [lastKeyView setNextKeyView: _okButton]; [_okButton setNextKeyView: _browser]; [self setDefaultButtonCell: [_okButton cell]]; [_okButton release]; [_browser setDoubleAction: @selector(performClick:)]; [_browser setTarget: _okButton]; r = NSMakeRect (8, 261, 48, 48); image = [[NSApplication sharedApplication] applicationIconImage]; imageView = [[NSImageView alloc] initWithFrame: r]; [imageView setAutoresizingMask: NSViewMinYMargin]; [imageView setImage:image]; [imageView setTag: NSFileHandlingPanelImageButton]; [_topView addSubview: imageView]; [imageView release]; r = NSMakeRect (67, 276, 200, 14); _titleField = [[NSTextField alloc] initWithFrame: r]; [_titleField setSelectable: NO]; [_titleField setEditable: NO]; [_titleField setDrawsBackground: NO]; [_titleField setBezeled: NO]; [_titleField setBordered: NO]; [_titleField setFont: [NSFont messageFontOfSize: 18]]; [_titleField setAutoresizingMask: NSViewMinYMargin]; [_titleField setTag: NSFileHandlingPanelTitleField]; [_topView addSubview: _titleField]; [_titleField release]; r = NSMakeRect (0, 252, 308, 2); bar = [[NSBox alloc] initWithFrame: r]; [bar setBorderType: NSGrooveBorder]; [bar setTitlePosition: NSNoTitle]; [bar setAutoresizingMask: NSViewWidthSizable|NSViewMinYMargin]; [_topView addSubview: bar]; [bar release]; [self setContentSize: NSMakeSize (384, 426)]; [self setInitialFirstResponder: _form]; [super setTitle: @""]; [self registerForDraggedTypes: [NSArray arrayWithObjects: NSFilenamesPboardType, nil]]; return self; } - (void) _toggleShowsHiddenFiles: (id)sender { NSMenuItem *menuItem = (NSMenuItem*)sender; [self setShowsHiddenFiles: ![menuItem state]]; } - (void) _getOriginalSize { /* Used in setMinSize: */ _originalMinSize = [self minSize]; /* Used in setContentSize: */ _originalSize = [[self contentView] frame].size; } /* Set the current directory to a useful default value */ - (void) _setDefaultDirectory { NSString *path; path = [[NSUserDefaults standardUserDefaults] objectForKey: @"NSDefaultOpenDirectory"]; if (path == nil) { // FIXME: Should we use this or the home directory? ASSIGN(_directory, [_fm currentDirectoryPath]); } else { ASSIGN(_directory, path); } } - (void) _updateDefaultDirectory { [[NSUserDefaults standardUserDefaults] setObject: _directory forKey: @"NSDefaultOpenDirectory"]; } - (void) _resetDefaults { [self _setDefaultDirectory]; [self setPrompt: _(@"Name:")]; [self setTitle: _(@"Save")]; [self setAllowedFileTypes: nil]; [self setAllowsOtherFileTypes: NO]; [self setTreatsFilePackagesAsDirectories: NO]; [self setDelegate: nil]; [self setAccessoryView: nil]; } - (void) _reloadBrowser { NSString *path = [_browser path]; [_browser loadColumnZero]; setPath(_browser, path); } // // Methods invoked by button press // - (void) _setHomeDirectory { [self setDirectory: NSHomeDirectory()]; } - (void) _mountMedia { [[NSWorkspace sharedWorkspace] mountNewRemovableMedia]; } - (void) _unmountMedia { [[NSWorkspace sharedWorkspace] unmountAndEjectDeviceAtPath: [self directory]]; } - (void) _selectTextInColumn: (int)column { NSMatrix *matrix; NSBrowserCell *selectedCell; BOOL isLeaf; if (column == -1) return; matrix = [_browser matrixInColumn:column]; selectedCell = [matrix selectedCell]; isLeaf = [selectedCell isLeaf]; if (_delegateHasSelectionDidChange) { [_delegate panelSelectionDidChange: self]; } if (isLeaf) { [[_form cellAtIndex: 0] setStringValue: [selectedCell stringValue]]; // [_form selectTextAtIndex:0]; [_okButton setEnabled: YES]; } else { if (_delegateHasDirectoryDidChange) { [_delegate panel: self directoryDidChange: pathToColumn(_browser, column)]; } if ([[[_form cellAtIndex: 0] stringValue] length] > 0) { [_okButton setEnabled: YES]; [self _selectCellName: [[_form cellAtIndex: 0] stringValue]]; // [_form selectTextAtIndex:0]; } else [_okButton setEnabled: NO]; } } - (void) _selectText: (id)sender { [self _selectTextInColumn:[_browser selectedColumn]]; } - (void) _selectCellName: (NSString *)title { NSString *cellString; NSArray *cells; NSMatrix *matrix; NSComparisonResult result; int i, titleLength, cellLength, numberOfCells; matrix = [_browser matrixInColumn:[_browser lastColumn]]; if ([matrix selectedCell]) return; titleLength = [title length]; if (!titleLength) return; cells = [matrix cells]; numberOfCells = [cells count]; for (i = 0; i < numberOfCells; i++) { cellString = [[matrix cellAtRow:i column:0] stringValue]; cellLength = [cellString length]; if (cellLength != titleLength) continue; result = [self _compareFilename:cellString with:title]; if (result == NSOrderedSame) { [matrix selectCellAtRow:i column:0]; [matrix scrollCellToVisibleAtRow:i column:0]; [_okButton setEnabled:YES]; return; } else if (result == NSOrderedDescending) break; } } - (BOOL) _browser: (NSBrowser*)sender selectCellWithString: (NSString*)title inColumn: (NSInteger)column { NSMatrix *m; BOOL isLeaf; NSString *path; m = [sender matrixInColumn: column]; isLeaf = [[m selectedCell] isLeaf]; path = pathToColumn(sender, column); if (isLeaf) { ASSIGN (_directory, path); ASSIGN (_fullFileName, [path stringByAppendingPathComponent: title]); } else { ASSIGN (_directory, [path stringByAppendingPathComponent: title]); ASSIGN (_fullFileName, nil); } [self _selectTextInColumn:column]; return YES; } - (void) _setFileName: (NSString *)filename { [self _selectCellName: filename]; [[_form cellAtIndex: 0] setStringValue: filename]; [_form selectTextAtIndex: 0]; [_form setNeedsDisplay: YES]; } - (void) _setupForDirectory: (NSString *)path file: (NSString *)filename { if (path == nil) { if (_directory == nil) { [self _setDefaultDirectory]; } } else { ASSIGN(_directory, path); } if (filename == nil) filename = @""; ASSIGN(_fullFileName, [_directory stringByAppendingPathComponent: filename]); setPath(_browser, _fullFileName); [self _setFileName: filename]; [self _browser: _browser selectCellWithString: [[_browser selectedCell] stringValue] inColumn: [_browser selectedColumn]]; } - (BOOL) _shouldShowExtension: (NSString *)extension { if (_allowedFileTypes != nil && [_allowedFileTypes indexOfObject: extension] == NSNotFound && [_allowedFileTypes indexOfObject: @""] == NSNotFound) return NO; return YES; } - (void) _windowResized: (NSNotification*)n { [_browser setMaxVisibleColumns: [_browser frame].size.width / 140]; } - (NSComparisonResult) _compareFilename: (NSString *)n1 with: (NSString *)n2 { if (_delegateHasCompareFilter) { return [_delegate panel: self compareFilename: n1 with: n2 caseSensitive: YES]; } else { return [n1 _gsSavePanelCompare: n2]; } } @end /* NSSavePanel (PrivateMethods) */ // // NSSavePanel methods // /**

Implements a panel that allows the user to save a file.

There is only one save panel per application and this panel is obtained by calling the +savePanel class method. From here, you should set the required file extension using -setRequiredFileType: When ready to show the panel, use the -runModal, or a similar method to show the panel in a modal session. Other methods allow you to set the initial directory and initially choosen file. The method will return one of NSOKButton or NSCancelButton depending on which button the user pressed.

Use the -filename method to retrieve the name of the file the user choose.

*/ @implementation NSSavePanel + (void) initialize { if (self == [NSSavePanel class]) { [self setVersion: 1]; ASSIGN (_fm, [NSFileManager defaultManager]); // A GNUstep feature if ([[NSUserDefaults standardUserDefaults] boolForKey: @"GSSavePanelShowProgress"]) { _gs_display_reading_progress = YES; } } } /**

Creates ( if needed) and returns the shared NSSavePanel instance.

*/ + (NSSavePanel *) savePanel { if (_gs_gui_save_panel == nil) { Class savePanelClass = [[GSTheme theme] savePanelClass]; _gs_gui_save_panel = [[savePanelClass alloc] init]; } [_gs_gui_save_panel _resetDefaults]; return _gs_gui_save_panel; } // - (void) dealloc { [[NSNotificationCenter defaultCenter] removeObserver: self]; TEST_RELEASE (_fullFileName); TEST_RELEASE (_directory); TEST_RELEASE (_allowedFileTypes); [super dealloc]; } // If you do a simple -init, we initialize the panel with // the system size/mask/appearance/subviews/etc. If you do more // complicated initializations, you get a simple panel from super. -(id) init { self = [self _initWithoutGModel]; if (nil == self) return nil; /* * All these are set automatically _directory = nil; _fullFileName = nil; _allowedFileTypes = nil; _delegate = nil; _treatsFilePackagesAsDirectories = NO; _delegateHasCompareFilter = NO; _delegateHasShowFilenameFilter = NO; _delegateHasValidNameFilter = NO; _delegateHasDirectoryDidChange = NO; _delegateHasSelectionDidChange = NO; */ [self _getOriginalSize]; return self; } /**

Sets an accessory view which is shown near the bottom of the panel. The panel is automatically expanded with enough room to show the extra view. You can use this extra view to customize various characteristics of the file selection mechanism. For instance you could add a popup button which allows the user to select the format that the file is saved in (e.g. rtf or txt). See also -validateVisibleColumns .

See Also: -accessoryView

*/ - (void) setAccessoryView: (NSView*)aView { NSRect accessoryViewFrame, bottomFrame; NSRect tmpRect; NSSize contentSize, contentMinSize; float addedHeight, accessoryWidth; if (aView == _accessoryView) return; /* The following code is very tricky. Please think and test a lot before changing it. */ /* Remove old accessory view if any */ if (_accessoryView != nil) { /* Remove accessory view */ accessoryViewFrame = [_accessoryView frame]; [_accessoryView removeFromSuperview]; /* Change the min size before doing the resizing otherwise it could be a problem. */ [self setMinSize: _originalMinSize]; /* Resize the panel to the height without the accessory view. This must be done with the special care of not resizing the heights of the other views. */ addedHeight = accessoryViewFrame.size.height + (_SAVE_PANEL_Y_PAD * 2); contentSize = [[self contentView] frame].size; contentSize.height -= addedHeight; // Resize without modifying topView and bottomView height. [_topView setAutoresizingMask: NSViewWidthSizable | NSViewMinYMargin]; [self setContentSize: contentSize]; [_topView setAutoresizingMask: NSViewWidthSizable|NSViewHeightSizable]; } /* Resize the panel to its original size. This resizes freely the heights of the views. NB: minSize *must* come first */ [self setMinSize: _originalMinSize]; [self setContentSize: _originalSize]; /* Set the new accessory view */ _accessoryView = aView; /* If there is a new accessory view, plug it in */ if (_accessoryView != nil) { /* Make sure the new accessory view behaves - its height must be fixed * and its position relative to the bottom of the superview must not * change - so its position rlative to the top must be changable. */ [_accessoryView setAutoresizingMask: NSViewMaxYMargin | ([_accessoryView autoresizingMask] & ~(NSViewHeightSizable | NSViewMinYMargin))]; /* Compute size taken by the new accessory view */ accessoryViewFrame = [_accessoryView frame]; addedHeight = accessoryViewFrame.size.height + (_SAVE_PANEL_Y_PAD * 2); accessoryWidth = accessoryViewFrame.size.width + (_SAVE_PANEL_X_PAD * 2); /* Resize content size accordingly */ contentSize = _originalSize; contentSize.height += addedHeight; if (accessoryWidth > contentSize.width) { contentSize.width = accessoryWidth; } /* Set new content size without resizing heights of topView, bottomView */ // Our views should resize horizontally if needed, but not vertically [_topView setAutoresizingMask: NSViewWidthSizable | NSViewMinYMargin]; [self setContentSize: contentSize]; // Restore the original autoresizing masks [_topView setAutoresizingMask: NSViewWidthSizable|NSViewHeightSizable]; /* Compute new min size */ contentMinSize = _originalMinSize; contentMinSize.height += addedHeight; // width is more delicate tmpRect = NSMakeRect (0, 0, contentMinSize.width, contentMinSize.height); tmpRect = [NSWindow contentRectForFrameRect: tmpRect styleMask: [self styleMask]]; if (accessoryWidth > tmpRect.size.width) { contentMinSize.width += accessoryWidth - tmpRect.size.width; } // Set new min size [self setMinSize: contentMinSize]; /* * Pack the Views */ /* BottomView is ready */ bottomFrame = [_bottomView frame]; /* AccessoryView */ accessoryViewFrame.origin.x = (contentSize.width - accessoryViewFrame.size.width) / 2; accessoryViewFrame.origin.y = NSMaxY (bottomFrame) + _SAVE_PANEL_Y_PAD; [_accessoryView setFrameOrigin: accessoryViewFrame.origin]; /* Add the accessory view */ [[self contentView] addSubview: _accessoryView]; } } /**

Sets the title of the NSSavePanel to title. By default, 'Save' is the title string. If you adapt the NSSavePanel for other uses, its title should reflect the user action that brings it to the screen.

See Also: -title

*/ - (void) setTitle: (NSString*)title { [_titleField setStringValue: title]; // TODO: Improve the following by managing // vertical alignment better. [_titleField sizeToFit]; } /**

Returns the title of the save panel

See Also: -setTitle:

*/ - (NSString*) title { return [_titleField stringValue]; } /**

Returns the prompt of the Save panel field that holds the current pathname or file name. By default this prompt is 'Name: '.

See Also: -prompt

*/ - (void) setPrompt: (NSString*)prompt { [[_form cellAtIndex: 0] setTitle: prompt]; [_form setNeedsDisplay: YES]; } /**

Returns the prompt used in the current path field.

See Also: -setPrompt:

*/ - (NSString*) prompt { return [[_form cellAtIndex: 0] title]; } /**

Returns the accesory view (if any).

See Also: -setAccessoryView:

*/ - (NSView*) accessoryView { return _accessoryView; } - (void) setNameFieldStringValue:(NSString *)value { [[_form cellAtIndex: 0] setStringValue: value]; } - (NSString *) nameFieldStringValue { return [[_form cellAtIndex: 0] stringValue]; } - (void) setNameFieldLabel: (NSString *)label { [[_form cellAtIndex: 0] setTitle: label]; } - (NSString *) nameFieldLabel { return [[_form cellAtIndex: 0] title]; } - (void) setMessage: (NSString *)message { // FIXME } - (NSString *) message { // FIXME return nil; } /**

Sets the current path name in the Save panel's browser. The path argument must be an absolute path name.

See Also: -directory

*/ - (void) setDirectory: (NSString*)path { NSString *standardizedPath = [path stringByStandardizingPath]; BOOL isDir; if (standardizedPath && [_fm fileExistsAtPath: standardizedPath isDirectory: &isDir] && isDir) { ASSIGN (_directory, standardizedPath); setPath(_browser, _directory); } } /**

Sets the current path name in the Save panel's browser. The path argument must be an absolute path name.

See Also: -directory

*/ - (void) setDirectoryURL: (NSURL*)url { [self setDirectory: [url path]]; } /**

Specifies the type, a file name extension to be appended to any selected files that don't already have that extension; The argument type should not include the period that begins the extension. Invoke this method each time the Save panel is used for another file type within the application. If you do not invoke it, or set it to empty string or nil, no extension will be appended, indicated by an empty string returned from -requiredFileType.

This method is equivalent to calling -setAllowedFileTypes: with an array containing only fileType.

See Also: -requiredFileType

*/ - (void) setRequiredFileType: (NSString*)fileType { NSArray *fileTypes; if ([fileType length] == 0) fileTypes = nil; else fileTypes = [NSArray arrayWithObject: fileType]; [self setAllowedFileTypes: fileTypes]; } /**

Returns the required file type. The default, indicated by an empty * string, is no required file type.

This method is equivalent to * calling -allowedFileTypes and returning the first element of the list * of allowed types, or the empty string if there are none.

*

See Also: -setRequiredFileType:

*/ - (NSString*) requiredFileType { if ([_allowedFileTypes count] > 0) return [_allowedFileTypes objectAtIndex: 0]; else return @""; } /**

Specifies the allowed types, i.e., file name extensions to be appended to any selected files that don't already have one of those extensions. The elements of the array should be strings that do not include the period that begins the extension. Invoke this method each time the Save panel is used for another file type within the application. If you do not invoke it, or set it to an empty array or nil, no extension will be appended, indicated by nil returned from -allowedFileTypes.

See Also: -allowedFileTypes

*/ - (void) setAllowedFileTypes: (NSArray *)types { if (types != _allowedFileTypes) { BOOL hasAllowedExtension = NO; NSString *filename, *extension; filename = [[_form cellAtIndex: 0] stringValue]; extension = [filename pathExtension]; if ([extension length] && [_allowedFileTypes count] && [_allowedFileTypes indexOfObject: extension] != NSNotFound) hasAllowedExtension = YES; if ([types count] == 0) DESTROY(_allowedFileTypes); else ASSIGN(_allowedFileTypes, types); [self _reloadBrowser]; if (hasAllowedExtension && [types count] && [types indexOfObject: extension] == NSNotFound && [types indexOfObject: @""] == NSNotFound) { extension = [types objectAtIndex: 0]; filename = [filename stringByDeletingPathExtension]; filename = [filename stringByAppendingPathExtension: extension]; [[_form cellAtIndex: 0] setStringValue: filename]; } } } /**

Returns an array of the allowed file types. The default, indicated by * nil, is any file type is allowed.

See Also: -setAllowedFileTypes:

*/ - (NSArray *) allowedFileTypes { return _allowedFileTypes; } - (void) setAllowsOtherFileTypes: (BOOL)flag { _allowsOtherFileTypes = flag; } - (BOOL) allowsOtherFileTypes { return _allowsOtherFileTypes; } /** Returns YES if file packages are shown as directories. The default is NO. */ - (BOOL) treatsFilePackagesAsDirectories { return _treatsFilePackagesAsDirectories; } /**

Sets the NSSavePanel's behavior for displaying file packages (for example, MyApp.app) to the user. If flag is YES, the user is shown files and subdirectories within a file package. If NO, the NSSavePanel shows each file package as a file, thereby giving no indication that it is a directory.

See Also: -treatsFilePackagesAsDirectories

*/ - (void) setTreatsFilePackagesAsDirectories: (BOOL)flag { if (flag != _treatsFilePackagesAsDirectories) { _treatsFilePackagesAsDirectories = flag; [self _reloadBrowser]; } } /**

Validates and possibly reloads the browser columns that are visible * in the Save panel by causing the delegate method * -panel:shouldShowFilename: to be invoked. One situation in * which this method would find use is whey you want the * browser to show only files with certain extensions based on the * selection made in an accessory-view pop-up list. When the * user changes the selection, you would invoke this method to * revalidate the visible columns.

*/ - (void) validateVisibleColumns { [_browser validateVisibleColumns]; } - (void) setCanCreateDirectories: (BOOL)flag { _canCreateDirectories = flag; } - (BOOL) canCreateDirectories { return _canCreateDirectories; } /**

Shows the save panel for the user. This method invokes -runModalForDirectory:file: with empty strings for the filename. Returns NSOKButton (if the user clicks the OK button) or NSCancelButton (if the user clicks the Cancel button).

See Also: -runModalForDirectory:file:

*/ - (NSInteger) runModal { return [self runModalForDirectory: [self directory] file: [self filename]]; } - (void) beginSheetModalForWindow:(NSWindow *)window completionHandler:(GSSavePanelCompletionHandler)handler { NSInteger result = [NSApp runModalForWindow: self relativeToWindow: window]; CALL_BLOCK(handler, result); } - (void) beginWithCompletionHandler:(GSSavePanelCompletionHandler)handler { self->_completionHandler = Block_copy(handler); [self makeKeyAndOrderFront: self]; } /**

Initializes the panel to the directory specified by path and, optionally, the file specified by filename, then displays it and begins its modal event loop; path and filename can be empty strings. The method invokes [NSApplication:-runModalForWindow:] method with self as the argument. Returns NSOKButton (if the user clicks the OK button) or NSCancelButton (if the user clicks the Cancel button). If path is nil then the panel displays the last selected directory or as a last resort, the current working directory.

See Also: -runModal

*/ - (NSInteger) runModalForDirectory: (NSString*)path file: (NSString*)filename { [self _setupForDirectory: path file: filename]; if ([filename length] > 0) [_okButton setEnabled: YES]; return [NSApp runModalForWindow: self]; } - (NSInteger) runModalForDirectory: (NSString *)path file: (NSString *)filename relativeToWindow: (NSWindow*)window { [self _setupForDirectory: path file: filename]; if ([filename length] > 0) [_okButton setEnabled: YES]; return [NSApp runModalForWindow: self relativeToWindow: window]; } - (void) beginSheetForDirectory: (NSString *)path file: (NSString *)filename modalForWindow: (NSWindow *)docWindow modalDelegate: (id)delegate didEndSelector: (SEL)didEndSelector contextInfo: (void *)contextInfo { [self _setupForDirectory: path file: filename]; if ([filename length] > 0) [_okButton setEnabled: YES]; [NSApp beginSheet: self modalForWindow: docWindow modalDelegate: delegate didEndSelector: didEndSelector contextInfo: contextInfo]; } /**

Returns the directory choosen by the user. Do not invoke directory within a modal loop because the information that these methods fetch is updated only upon return.

See Also: -setDirectory:

*/ - (NSString*) directory { if (_directory) return AUTORELEASE([_directory copy]); else return @""; } - (NSURL *) directoryURL { return [NSURL fileURLWithPath: [self directory]]; } /**

Returns the absolute filename choosen by the user. Do not invoke filename within a modal loop because the information that these methods fetch is updated only upon return.

*/ - (NSString*) filename { NSString *fileType; if (_fullFileName == nil) return @""; if (_allowedFileTypes == nil || [_allowedFileTypes indexOfObject: @""] != NSNotFound) return _fullFileName; /* add file type extension if the file name does not have an extension or the file name's extension is not one of the allowed extensions and the save panel does not allow other extensions */ fileType = [_fullFileName pathExtension]; if ([fileType length] == 0 || ((!_allowsOtherFileTypes && [_allowedFileTypes indexOfObject: fileType] == NSNotFound))) { fileType = [_allowedFileTypes objectAtIndex: 0]; return [_fullFileName stringByAppendingPathExtension: fileType]; } else { return _fullFileName; } } - (NSURL *) URL { return [NSURL fileURLWithPath: [self filename]]; } /**

Invoked by the 'Cancel' button. Saves the current directory browsed and stop the modal event loop using [NSApplication-stopModalWithCode:]

See Also: -ok:

*/ - (void) cancel: (id)sender { ASSIGN(_directory, pathToColumn(_browser, [_browser lastColumn])); [self _updateDefaultDirectory]; if (self->_completionHandler == NULL) [NSApp stopModalWithCode: NSCancelButton]; else { CALL_BLOCK(self->_completionHandler, NSCancelButton); Block_release(self->_completionHandler); self->_completionHandler = NULL; } [_okButton setEnabled: NO]; [self close]; } /**

Invoked by the "OK" button.

*

See Also: -cancel:

*/ - (void) ok: (id)sender { NSMatrix *matrix; NSBrowserCell *selectedCell; NSString *filename; BOOL isDir = NO; matrix = [_browser matrixInColumn: [_browser lastColumn]]; selectedCell = [matrix selectedCell]; if (selectedCell && [selectedCell isLeaf] == NO) { [[_form cellAtIndex: 0] setStringValue: @""]; [_browser doClick: matrix]; [_form selectTextAtIndex: 0]; [_form setNeedsDisplay: YES]; return; } ASSIGN (_directory, pathToColumn(_browser, [_browser lastColumn])); filename = [[_form cellAtIndex: 0] stringValue]; if ([filename isAbsolutePath] == NO) { filename = [_directory stringByAppendingPathComponent: filename]; } ASSIGN (_fullFileName, [filename stringByStandardizingPath]); if (_delegateHasUserEnteredFilename) { filename = [_delegate panel: self userEnteredFilename: _fullFileName confirmed: YES]; if (!filename) return; else if (![_fullFileName isEqual: filename]) { ASSIGN (_directory, [filename stringByDeletingLastPathComponent]); ASSIGN (_fullFileName, filename); setPath(_browser, _fullFileName); [self _setFileName: [_fullFileName lastPathComponent]]; } } /* Warn user if a wrong extension was entered */ if (_allowedFileTypes != nil && [_allowedFileTypes indexOfObject: @""] == NSNotFound) { NSString *fileType = [_fullFileName pathExtension]; if ([fileType length] != 0 && [_allowedFileTypes indexOfObject: fileType] == NSNotFound) { int result; NSString *msgFormat, *butFormat; NSString *altType, *requiredType; requiredType = [self requiredFileType]; if ([self allowsOtherFileTypes]) { msgFormat = _(@"You have used the extension '.%@'.\n" @"The standard extension is '.%@'.'"); butFormat = _(@"Use .%@"); altType = fileType; } else { msgFormat = _(@"You cannot save this document with extension '.%@'.\n" @"The required extension is '.%@'."); butFormat = _(@"Use .%@"); altType = [fileType stringByAppendingPathExtension: requiredType]; } result = NSRunAlertPanel(_(@"Save"), msgFormat, [NSString stringWithFormat: butFormat, requiredType], _(@"Cancel"), [NSString stringWithFormat: butFormat, altType], fileType, requiredType); switch (result) { case NSAlertDefaultReturn: filename = [_fullFileName stringByDeletingPathExtension]; filename = [filename stringByAppendingPathExtension: requiredType]; ASSIGN (_fullFileName, filename); setPath(_browser, _fullFileName); [self _setFileName: [_fullFileName lastPathComponent]]; break; case NSAlertOtherReturn: if (altType != fileType) { filename = [_fullFileName stringByAppendingPathExtension: requiredType]; ASSIGN (_fullFileName, filename); setPath(_browser, _fullFileName); [self _setFileName: [_fullFileName lastPathComponent]]; } break; default: return; } } } filename = [_fullFileName stringByDeletingLastPathComponent]; if ([_fm fileExistsAtPath: filename isDirectory: &isDir] == NO) { int result; result = NSRunAlertPanel(_(@"Save"), _(@"The directory '%@' does not exist, do you want to create it?"), _(@"Yes"), _(@"No"), nil, filename ); if (result == NSAlertDefaultReturn) { if ([_fm createDirectoryAtPath: filename withIntermediateDirectories: YES attributes: nil error: NULL] == NO) { NSRunAlertPanel(_(@"Save"), _(@"The directory '%@' could not be created."), _(@"Dismiss"), nil, nil, filename ); return; } } } else if (isDir == NO) { NSRunAlertPanel(_(@"Save"), _(@"The path '%@' is not a directory."), _(@"Dismiss"), nil, nil, filename ); return; } if ([_fm fileExistsAtPath: [self filename] isDirectory: NULL]) { int result; result = NSRunAlertPanel(_(@"Save"), _(@"The file '%@' in '%@' exists. Replace it?"), _(@"Replace"), _(@"Cancel"), nil, [[self filename] lastPathComponent], _directory); if (result != NSAlertDefaultReturn) return; } if (_delegateHasValidNameFilter) if (![_delegate panel: self isValidFilename: [self filename]]) return; [self _updateDefaultDirectory]; if (self->_completionHandler == NULL) [NSApp stopModalWithCode: NSOKButton]; else { CALL_BLOCK(self->_completionHandler, NSOKButton); Block_release(self->_completionHandler); self->_completionHandler = NULL; } [_okButton setEnabled: NO]; [self close]; } - (void) selectText: (id)sender { NSEvent *theEvent = [self currentEvent]; NSString *characters = [theEvent characters]; unichar character = 0; if ([characters length] > 0) { character = [characters characterAtIndex: 0]; } switch (character) { case NSUpArrowFunctionKey: case NSDownArrowFunctionKey: case NSLeftArrowFunctionKey: case NSRightArrowFunctionKey: [_form abortEditing]; [[_form cellAtIndex:0] setStringValue: @""]; [_browser keyDown:theEvent]; break; } } - (id) delegate { return [super delegate]; } - (void) setDelegate: (id)aDelegate { if ([aDelegate respondsToSelector: @selector(panel:compareFilename:with:caseSensitive:)]) _delegateHasCompareFilter = YES; else _delegateHasCompareFilter = NO; if ([aDelegate respondsToSelector: @selector(panel:shouldShowFilename:)]) _delegateHasShowFilenameFilter = YES; else _delegateHasShowFilenameFilter = NO; if ([aDelegate respondsToSelector: @selector(panel:isValidFilename:)]) _delegateHasValidNameFilter = YES; else _delegateHasValidNameFilter = NO; if ([aDelegate respondsToSelector: @selector(panel:userEnteredFilename:confirmed:)]) _delegateHasUserEnteredFilename = YES; else _delegateHasUserEnteredFilename = NO; if ([aDelegate respondsToSelector: @selector(panel:directoryDidChange:)]) _delegateHasDirectoryDidChange = YES; else _delegateHasDirectoryDidChange = NO; if ([aDelegate respondsToSelector: @selector(panelSelectionDidChange:)]) _delegateHasSelectionDidChange = YES; else _delegateHasSelectionDidChange = NO; [super setDelegate: aDelegate]; [self validateVisibleColumns]; } - (void) setCanSelectHiddenExtension: (BOOL) flag { _canSelectHiddenExtension = flag; } - (BOOL) canSelectHiddenExtension { return _canSelectHiddenExtension; } - (BOOL) isExtensionHidden { return _isExtensionHidden; } - (void) setExtensionHidden: (BOOL) flag { _isExtensionHidden = flag; } - (BOOL) showsHiddenFiles { return _showsHiddenFiles; } - (void) setShowsHiddenFiles: (BOOL) flag { if (flag != _showsHiddenFiles) { _showsHiddenFiles = flag; [[_showsHiddenFilesMenu itemAtIndex: 0] setState: flag]; [self _reloadBrowser]; } } - (BOOL) isExpanded { // FIXME return NO; } // // NSCoding protocol // - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if (nil == self) return nil; // TODO return self; } - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; // TODO } @end // // SavePanel filename compare // @implementation NSString (GSSavePanel) - (NSComparisonResult)_gsSavePanelCompare:(NSString *)other { int sLength, oLength; unichar sChar, oChar; NSComparisonResult result; NSRange range; sLength = [self length]; oLength = [other length]; range.location = 0; range.length = sLength; if (sLength == 0) { if (oLength == 0) return NSOrderedSame; else return NSOrderedAscending; } else if (oLength == 0) { return NSOrderedDescending; } sChar = [self characterAtIndex: 0]; oChar = [other characterAtIndex: 0]; if (sChar == '.' && oChar != '.') return NSOrderedDescending; else if (sChar != '.' && oChar == '.') return NSOrderedAscending; if (sLength == oLength) { result = [self compare: other options: NSCaseInsensitiveSearch range: range]; if (result == NSOrderedSame) result = [self compare: other options: 0 range: range]; } else { if (sLength < oLength) { result = [other compare: self options: NSCaseInsensitiveSearch range: range]; if (result == NSOrderedAscending) result = NSOrderedDescending; else if (result == NSOrderedDescending) result = NSOrderedAscending; else { result = [other compare: self options: 0 range: range]; if (result == NSOrderedAscending) result = NSOrderedDescending; else result = NSOrderedAscending; } } else result = [self compare: other options: NSCaseInsensitiveSearch range: range]; if (result == NSOrderedSame) result = [self compare: other options: 0 range: range]; } return result; } @end // // NSSavePanel browser delegate methods // @interface NSSavePanel (GSBrowserDelegate) - (void) browserDidScroll: (NSBrowser *)sender; - (void) browser: (NSBrowser*)sender createRowsForColumn: (NSInteger)column inMatrix: (NSMatrix*)matrix; - (BOOL) browser: (NSBrowser*)sender isColumnValid: (NSInteger)column; - (void) browser: (NSBrowser*)sender willDisplayCell: (id)cell atRow: (NSInteger)row column: (NSInteger)column; @end static int compareFilenames (id elem1, id elem2, void *context) { /* TODO - use IMP optimization here. */ NSSavePanel *s = context; NSSavePanel *self = (NSSavePanel *)context; return (int)[s->_delegate panel: self compareFilename: elem1 with: elem2 caseSensitive: YES]; } @implementation NSSavePanel (GSBrowserDelegate) - (void) browserDidScroll: (NSBrowser *)sender { [self validateVisibleColumns]; } - (void) browser: (NSBrowser*)sender createRowsForColumn: (NSInteger)column inMatrix: (NSMatrix*)matrix { NSString *path, *file, *pathAndFile, *extension; NSArray *files; unsigned i, count, addedRows; BOOL exists, isDir; NSBrowserCell *cell; // _gs_display_reading_progress variables unsigned reached_frac = 0; unsigned base_frac = 1; BOOL display_progress = NO; NSString *progressString = nil; NSWorkspace *ws; /* We create lot of objects in this method, so we use a pool */ NSAutoreleasePool *pool; pool = [NSAutoreleasePool new]; ws = [NSWorkspace sharedWorkspace]; path = pathToColumn(_browser, column); #if defined(__MINGW32__) if (column == 0) { NSMutableArray *m; unsigned i; files = [ws mountedLocalVolumePaths]; m = [files mutableCopy]; i = [m count]; while (i-- > 0) { NSString *file = [m objectAtIndex: i]; /* Strip the backslash from the drive name so we don't * get it confusing the path we have. */ file = [file substringToIndex: [file length] - 1]; [m replaceObjectAtIndex: i withObject: file]; } files = [m autorelease]; } else { files = [[NSFileManager defaultManager] directoryContentsAtPath: path]; } #else files = [[NSFileManager defaultManager] directoryContentsAtPath: path]; #endif /* Remove hidden files. */ { NSString *h; NSArray *hiddenFiles = nil; // FIXME: Use NSFileManager to tell us what files are hidden/non-hidden // rather than having it hardcoded here if ([files containsObject: @".hidden"] == YES) { /* We need to remove files listed in the xxx/.hidden file. */ h = [path stringByAppendingPathComponent: @".hidden"]; h = [NSString stringWithContentsOfFile: h]; hiddenFiles = [h componentsSeparatedByString: @"\n"]; } /* Alse remove files starting with `.' (dot) */ /* Now copy the files array into a mutable array - but only if strictly needed. */ if (!_showsHiddenFiles) { int j; /* We must make a mutable copy of the array because the API says that NSFileManager -directoryContentsAtPath: return a NSArray, not a NSMutableArray, so we shouldn't expect it to be mutable. */ NSMutableArray *mutableFiles = AUTORELEASE ([files mutableCopy]); /* Ok - now modify the mutable array removing unwanted files. */ if (hiddenFiles != nil) { [mutableFiles removeObjectsInArray: hiddenFiles]; } /* Don't use i which is unsigned. */ j = [mutableFiles count] - 1; while (j >= 0) { NSString *file = (NSString *)[mutableFiles objectAtIndex: j]; if ([file hasPrefix: @"."]) { /* NSLog (@"Removing dot file %@", file); */ [mutableFiles removeObjectAtIndex: j]; } j--; } files = mutableFiles; } } count = [files count]; /* If array is empty, just return (nothing to display). */ if (count == 0) { RELEASE (pool); return; } // Prepare Messages on title bar if directory is big and user wants them if (_gs_display_reading_progress && (count > 100)) { display_progress = YES; base_frac = count / 4; progressString = [_(@"Reading Directory ") stringByAppendingString: path]; [super setTitle: progressString]; // Is the following really safe? [self flushWindow]; } //TODO: Sort after creation of matrix so we do not sort // files we are not going to show. Use NSMatrix sorting cells method // Sort list of files to display if (_delegateHasCompareFilter == YES) { files = [files sortedArrayUsingFunction: compareFilenames context: self]; } else files = [files sortedArrayUsingSelector: @selector(_gsSavePanelCompare:)]; addedRows = 0; for (i = 0; i < count; i++) { // Update displayed message if needed if (display_progress && (i > (base_frac * (reached_frac + 1)))) { reached_frac++; progressString = [progressString stringByAppendingString: @"."]; [super setTitle: progressString]; [self flushWindow]; } // Now the real code file = [files objectAtIndex: i]; extension = [file pathExtension]; pathAndFile = [path stringByAppendingPathComponent: file]; exists = [_fm fileExistsAtPath: pathAndFile isDirectory: &isDir]; /* Note: The initial directory and its parents are always shown, even if * it they are file packages or would be rejected by the validator. */ #define HAS_PATH_PREFIX(aPath, otherPath) \ ([aPath isEqualToString: otherPath] || \ [aPath hasPrefix: [otherPath stringByAppendingString: @"/"]]) if (exists && (!isDir || !HAS_PATH_PREFIX(_directory, pathAndFile))) { if (isDir && !_treatsFilePackagesAsDirectories && ([ws isFilePackageAtPath: pathAndFile] || [_allowedFileTypes containsObject: extension])) { isDir = NO; } if (_delegateHasShowFilenameFilter) { exists = [_delegate panel: self shouldShowFilename: pathAndFile]; } if (exists && !isDir) { exists = [self _shouldShowExtension: extension]; } } if (exists) { if (addedRows == 0) { [matrix addColumn]; } else // addedRows > 0 { /* Same as [matrix addRow] */ [matrix insertRow: addedRows withCells: nil]; /* Possible TODO: Faster would be to create all the cells at once with a single call instead of resizing the matrix each time a cell is inserted. */ } cell = [matrix cellAtRow: addedRows column: 0]; [cell setStringValue: file]; { NSImage *icon = [[ws iconForFile: pathAndFile] copy]; CGFloat iconSize = [cell cellSize].height - 1; [icon setSize: NSMakeSize(iconSize, iconSize)]; [cell setImage: icon]; [icon release]; } if (isDir) [cell setLeaf: NO]; else [cell setLeaf: YES]; addedRows++; } } if (display_progress) { [super setTitle: @""]; [self flushWindow]; } RELEASE (pool); } - (BOOL) browser: (NSBrowser*)sender isColumnValid: (NSInteger)column { /* * FIXME This code doesn't handle the case where the delegate now wants * to show additional files, which were not displayed before. */ NSArray *cells = [[sender matrixInColumn: column] cells]; unsigned count = [cells count], i; NSString *path = pathToColumn(sender, column); // iterate through the cells asking the delegate if each filename is valid // if it says no for any filename, the column is not valid if (_delegateHasShowFilenameFilter == YES) for (i = 0; i < count; i++) { if (![_delegate panel: self shouldShowFilename: [path stringByAppendingPathComponent: [[cells objectAtIndex: i] stringValue]]]) return NO; } return YES; } - (void) browser: (NSBrowser*)sender willDisplayCell: (id)cell atRow: (NSInteger)row column: (NSInteger)column { } @end // // NSForm delegate methods // @interface NSSavePanel (FormDelegate) - (void) controlTextDidChange: (NSNotification *)aNotification; @end @implementation NSSavePanel (FormDelegate) - (void) controlTextDidChange: (NSNotification *)aNotification { NSString *s, *selectedString; NSArray *cells; NSMatrix *matrix; NSCell *selectedCell; int i, sLength, cellLength, selectedRow; NSComparisonResult result; NSRange range; s = [[[aNotification userInfo] objectForKey: @"NSFieldEditor"] string]; /* * If the user typed in an absolute path, display it. */ if ([s isAbsolutePath] == YES) { [self setDirectory: s]; } sLength = [s length]; range.location = 0; range.length = sLength; matrix = [_browser matrixInColumn:[_browser lastColumn]]; if (sLength == 0) { [matrix deselectAllCells]; [_okButton setEnabled:NO]; return; } selectedCell = [matrix selectedCell]; selectedString = [selectedCell stringValue]; selectedRow = [matrix selectedRow]; cells = [matrix cells]; if (selectedString) { result = [s compare:selectedString options:0 range:range]; if (result == NSOrderedSame) return; } else result = NSOrderedDescending; if (result == NSOrderedDescending) { int numberOfCells = [cells count]; for (i = selectedRow+1; i < numberOfCells; i++) { selectedString = [[matrix cellAtRow:i column:0] stringValue]; cellLength = [selectedString length]; if (cellLength != sLength) continue; result = [selectedString compare:s options:0 range:range]; if (result == NSOrderedSame) { [matrix deselectAllCells]; [matrix selectCellAtRow:i column:0]; [matrix scrollCellToVisibleAtRow:i column:0]; [_okButton setEnabled:YES]; return; } } } else { for (i = selectedRow; i >= 0; --i) { selectedString = [[matrix cellAtRow:i column:0] stringValue]; cellLength = [selectedString length]; if (cellLength != sLength) continue; result = [selectedString compare:s options:0 range:range]; if (result == NSOrderedSame) { [matrix deselectAllCells]; [matrix selectCellAtRow:i column:0]; [matrix scrollCellToVisibleAtRow:i column:0]; [_okButton setEnabled:YES]; return; } } } [matrix deselectAllCells]; [_okButton setEnabled:YES]; } @end /* NSSavePanel */ gnustep-gui-0.24.0/Source/GSToolbarCustomizationPalette.h0000664000076500007650000000313611534147002023317 0ustar brains99brains99/* GSToolbarCustomizationPalette.h The palette which allows to customize toolbar Copyright (C) 2007 Free Software Foundation, Inc. Author: Quentin Mathe Date: January 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSToolbarCustomizationPalette #define _GNUstep_H_GSToolbarCustomizationPalette #import @class NSMutableArray; @class NSToolbar; @interface GSToolbarCustomizationPalette : NSObject { id _customizationWindow; id _customizationView; id _defaultTemplateView; id _sizeCheckBox; id _displayPopup; id _doneButton; NSMutableArray *_allowedItems; NSMutableArray *_defaultItems; NSToolbar *_toolbar; } + (id) palette; - (void) showForToolbar: (NSToolbar *)toolbar; @end #endif /* _GNUstep_H_GSToolbarCustomizationPalette */ gnustep-gui-0.24.0/Source/NSStatusItem.m0000664000076500007650000000736712203676404017744 0ustar brains99brains99/* NSStatusItem.h The status item class Copyright (C) 2013 Free Software Foundation, Inc. Author: Gregory Casamento Date: 2013 Author: Dr. H. Nikolaus Schaller 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ // FIXME: This class is currently a placeholder to allow compilation of // apps which require NSStatusItem. Currently there is not a clean, // cross-platform way to implement this functionality. #import #import #import #import #import @implementation NSStatusItem - (id) _initForStatusBar: (NSStatusBar*)bar withLength: (CGFloat)len { if ((self = [super init])) { _statusBar = bar; _menuItem = [[NSMenuItem alloc] initWithTitle: @"?" action: NULL keyEquivalent: @""]; [_menuItem setRepresentedObject: self]; [self setLength: len]; } return self; } - (void) dealloc { RELEASE(_menuItem); [super dealloc]; } - (SEL) action { return [_menuItem action]; } - (NSAttributedString*) attributedTitle { return [_menuItem attributedTitle]; } - (SEL) doubleAction { // NIMP return NULL; } - (void) drawStatusBarBackgroundInRect: (NSRect)rect withHighlight: (BOOL)flag { // NIMP } - (BOOL) highlightMode { return _highlightMode; } - (NSImage*) image { return [_menuItem image]; } - (BOOL) isEnabled { return [_menuItem isEnabled]; } - (CGFloat) length { return _length; } - (NSMenu *) menu { return [_menuItem submenu]; } - (void) popUpStatusItemMenu: (NSMenu*)menu { // NIMP } - (void) sendActionOn: (NSInteger)mask { //NIMP } - (void) setAction: (SEL)action { [_menuItem setAction: action]; } - (void) setAttributedTitle: (NSAttributedString*) title { [_menuItem setAttributedTitle: title]; } - (void) setDoubleAction: (SEL)sel { // NIMP } - (void) setEnabled: (BOOL)flag { [_menuItem setEnabled: flag]; } - (void) setHighlightMode: (BOOL)highlightMode { _highlightMode = highlightMode; } - (void) setImage: (NSImage*)image { [_menuItem setImage: image]; } - (void) setLength: (CGFloat)len { _length = len; //[_menuItem _changed]; } - (void) setMenu: (NSMenu*)menu { [_menuItem setSubmenu: menu]; } - (void) setTarget: (id)target { [_menuItem setTarget: target]; } - (void) setTitle: (NSString*)title { [_menuItem setTitle: title]; } - (void) setToolTip: (NSString*)toolTip { [_menuItem setToolTip: toolTip]; } - (void) setView: (NSView*)view { ASSIGN(_view, view); } - (NSStatusBar*) statusBar { return _statusBar; } - (id) target { return [_menuItem target]; } - (NSString*) title { return [_menuItem title]; } - (NSString*) toolTip { return [_menuItem toolTip]; } - (NSView*) view { return _view; } - (NSImage*) alternateImage { //NIMP return nil; } - (void) setAlternateImage: (NSImage*)img { //NIMP } @end gnustep-gui-0.24.0/Source/NSParagraphStyle.m0000664000076500007650000004703112145450735020562 0ustar brains99brains99/** NSParagraphStyle NSParagraphStyle and NSMutableParagraphStyle hold paragraph style information NSTextTab holds information about a single tab stop Copyright (C) 1996 Free Software Foundation, Inc. Author: Richard Frith-Macdonald Date March 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import "AppKit/NSParagraphStyle.h" @implementation NSTextTab - (id) initWithType: (NSTextTabType)type location: (CGFloat)loc { if ((self = [super init])) { _tabStopType = type; _location = loc; switch (type) { default: case NSLeftTabStopType: _alignment = NSLeftTextAlignment; break; case NSRightTabStopType: _alignment = NSRightTextAlignment; break; case NSCenterTabStopType: _alignment = NSCenterTextAlignment; break; case NSDecimalTabStopType: _alignment = NSRightTextAlignment; break; } } return self; } - (id) initWithTextAlignment: (NSTextAlignment)align location: (CGFloat)loc options: (NSDictionary *)options { NSTextTabType type; switch (align) { default: case NSLeftTextAlignment: type = NSLeftTabStopType; break; case NSRightTextAlignment: if ([options objectForKey: NSTabColumnTerminatorsAttributeName] != nil) { type = NSDecimalTabStopType; } else { type = NSRightTabStopType; } break; case NSCenterTextAlignment: type = NSCenterTabStopType; break; case NSJustifiedTextAlignment: type = NSLeftTabStopType; break; case NSNaturalTextAlignment: // FIXME: Get from language user setting type = YES ? NSLeftTabStopType : NSRightTabStopType; break; } if ((self = [self initWithType: type location: loc])) { _alignment = align; ASSIGN(_options, options); } return self; } - (void) dealloc { RELEASE(_options); [super dealloc]; } - (id) copyWithZone: (NSZone*)aZone { NSTextTab *copy; if (NSShouldRetainWithZone(self, aZone) == YES) return RETAIN(self); copy = (NSTextTab *)NSCopyObject(self, 0, aZone); copy->_options = [_options copyWithZone: aZone]; return copy; } - (NSComparisonResult) compare: (id)anObject { float loc; if (anObject == self) return NSOrderedSame; if (anObject == nil || ([anObject isKindOfClass: object_getClass(self)] == NO)) return NSOrderedAscending; loc = ((NSTextTab*)anObject)->_location; if (_location < loc) return NSOrderedAscending; else if (_location > loc) return NSOrderedDescending; else return NSOrderedSame; } - (NSUInteger) hash { NSUInteger val = (NSUInteger)_location; val ^= (NSUInteger)_tabStopType; return val; } - (BOOL) isEqual: (id)anObject { if (anObject == self) return YES; if ([anObject isKindOfClass: object_getClass(self)] == NO) return NO; else if (((NSTextTab*)anObject)->_tabStopType != _tabStopType) return NO; else if (((NSTextTab*)anObject)->_location != _location) return NO; return YES; } - (CGFloat) location { return _location; } - (NSTextTabType) tabStopType { return _tabStopType; } - (NSTextAlignment) alignment { return _alignment; } - (NSDictionary *) options { return _options; } - (id) initWithCoder: (NSCoder *)aCoder { if ([aCoder allowsKeyedCoding]) { _location = [aCoder decodeFloatForKey: @"NSLocation"]; } else { // FIXME } return self; } - (void) encodeWithCoder: (NSCoder *)aCoder { if ([aCoder allowsKeyedCoding]) { [aCoder encodeFloat: _location forKey: @"NSLocation"]; } else { // FIXME } } @end @implementation NSParagraphStyle static NSParagraphStyle *defaultStyle = nil; + (NSParagraphStyle*) defaultParagraphStyle { if (defaultStyle == nil) { NSParagraphStyle *style = [[self alloc] init]; int i; for (i = 0; i < 12; i++) { NSTextTab *tab; tab = [[NSTextTab alloc] initWithType: NSLeftTabStopType location: (i + 1) * 28.0]; [style->_tabStops addObject: tab]; RELEASE(tab); } defaultStyle = style; } return defaultStyle; } + (void) initialize { if (self == [NSParagraphStyle class]) { /* Set the class version to 2, as the writing direction is now stored in the encoding */ [self setVersion: 3]; } } + (NSWritingDirection) defaultWritingDirectionForLanguage: (NSString*) language { static NSArray *rightToLeft; NSWritingDirection writingDirection; NSString *langCode = nil; /* If language is 5/6 characters long with underscore in the middle, treat it as ISO language-region format. */ if ([language length] == 5 && [language characterAtIndex: 2] == '_') langCode = [language substringToIndex: 2]; else if ([language length] == 6 && [language characterAtIndex: 3] == '_') langCode = [language substringToIndex: 3]; /* Else if it's just two or three chars long, treat as ISO 639 code. */ else if ([language length] == 2 || [language length] == 3) langCode = language; if (!rightToLeft) // Holds languages whose current scripts are written right to left. rightToLeft = [[NSArray alloc] initWithObjects: @"ar", @"ara", @"arc", @"chi", @"fa", @"fas", @"he", @"heb", @"iw", @"ji", @"kas", @"ks", @"ku", @"kur", @"pa", @"pan", @"per" @"ps", @"pus", @"sd", @"snd", @"syr", @"tk", @"tmh", @"tuk", @"ug", @"uig", @"ur," @"urd", @"yi", @"yid", @"zh", @"zho", nil]; if ([rightToLeft containsObject: langCode] == YES) writingDirection = NSWritingDirectionRightToLeft; else // If it's not RTL, assume LTR. writingDirection = NSWritingDirectionLeftToRight; return writingDirection; } - (void) dealloc { if (self == defaultStyle) { NSLog(@"Argh - attempt to dealloc the default paragraph style!"); return; } RELEASE(_tabStops); RELEASE(_textBlocks); RELEASE(_textLists); [super dealloc]; } - (id) init { if ((self = [super init])) { _alignment = NSNaturalTextAlignment; //_firstLineHeadIndent = 0.0; //_headIndent = 0.0; _lineBreakMode = NSLineBreakByWordWrapping; //_lineSpacing = 0.0; //_maximumLineHeight = 0.0; //_minimumLineHeight = 0.0; //_paragraphSpacing = 0.0; //_tailIndent = 0.0; _baseDirection = NSWritingDirectionNaturalDirection; _tabStops = [[NSMutableArray allocWithZone: [self zone]] initWithCapacity: 12]; } return self; } /* * "Leading": distance between the bottom of one line fragment and top * of next (applied between lines in the same container). * Can't be negative. This value is included in the line fragment * heights in layout manager. */ - (CGFloat) lineSpacing { return _lineSpacing; } /* * Distance between the bottom of this paragraph and top of next. */ - (CGFloat) paragraphSpacing { return _paragraphSpacing; } - (NSTextAlignment) alignment { return _alignment; } /* * The following values are relative to the appropriate margin * (depending on the paragraph direction) */ /* * Distance from margin to front edge of paragraph */ - (CGFloat) headIndent { return _headIndent; } /* * Distance from margin to back edge of paragraph; if negative or 0, * from other margin */ - (CGFloat) tailIndent { return _tailIndent; } /* * Distance from margin to edge appropriate for text direction */ - (CGFloat) firstLineHeadIndent { return _firstLineHeadIndent; } /* * Distance from margin to tab stops */ - (NSArray *) tabStops { return AUTORELEASE ([_tabStops copyWithZone: NSDefaultMallocZone ()]); } /* * Line height is the distance from bottom of descenders to to * of ascenders; basically the line fragment height. Does not include * lineSpacing (which is added after this computation). */ - (CGFloat) minimumLineHeight { return _minimumLineHeight; } /* * 0 implies no maximum. */ - (CGFloat) maximumLineHeight { return _maximumLineHeight; } - (NSLineBreakMode) lineBreakMode { return _lineBreakMode; } - (NSWritingDirection) baseWritingDirection { return _baseDirection; } - (CGFloat) defaultTabInterval { return _defaultTabInterval; } - (CGFloat) lineHeightMultiple { return _lineHeightMultiple; } - (CGFloat) paragraphSpacingBefore { return _paragraphSpacingBefore; } - (NSInteger) headerLevel { return _headerLevel; } - (float) hyphenationFactor { return _hyphenationFactor; } - (NSArray *) textBlocks { return _textBlocks; } - (NSArray *) textLists { return _textLists; } - (float) tighteningFactorForTruncation { return _tighteningFactorForTruncation; } - (id) copyWithZone: (NSZone*)aZone { if (NSShouldRetainWithZone (self, aZone) == YES) return RETAIN (self); else { NSParagraphStyle *c; c = (NSParagraphStyle*)NSCopyObject (self, 0, aZone); c->_textBlocks = [_textBlocks mutableCopyWithZone: aZone]; c->_textLists = [_textLists mutableCopyWithZone: aZone]; return c; } } - (id) mutableCopyWithZone: (NSZone*)aZone { NSMutableParagraphStyle *c; c = [[NSMutableParagraphStyle allocWithZone: aZone] init]; [c setParagraphStyle: self]; return c; } - (id) initWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { // TODO_NIB: Determine keys for NSParagraphStyle, if there are any. } else { NSUInteger count; [aCoder decodeValueOfObjCType: @encode(NSInteger) at: &_alignment]; [aCoder decodeValueOfObjCType: @encode(NSInteger) at: &_lineBreakMode]; [aCoder decodeValueOfObjCType: @encode(float) at: &_firstLineHeadIndent]; [aCoder decodeValueOfObjCType: @encode(float) at: &_headIndent]; [aCoder decodeValueOfObjCType: @encode(float) at: &_lineSpacing]; [aCoder decodeValueOfObjCType: @encode(float) at: &_maximumLineHeight]; [aCoder decodeValueOfObjCType: @encode(float) at: &_minimumLineHeight]; [aCoder decodeValueOfObjCType: @encode(float) at: &_paragraphSpacing]; [aCoder decodeValueOfObjCType: @encode(float) at: &_tailIndent]; /* * Tab stops don't conform to NSCoding - so we do it the long way. */ [aCoder decodeValueOfObjCType: @encode(NSUInteger) at: &count]; _tabStops = [[NSMutableArray alloc] initWithCapacity: count]; if (count > 0) { float locations[count]; NSTextTabType types[count]; NSUInteger i; [aCoder decodeArrayOfObjCType: @encode(float) count: count at: locations]; if ([aCoder versionForClassName: @"NSParagraphStyle"] >= 3) { [aCoder decodeArrayOfObjCType: @encode(NSInteger) count: count at: types]; } else { [aCoder decodeArrayOfObjCType: @encode(int) count: count at: types]; } for (i = 0; i < count; i++) { NSTextTab *tab; tab = [[NSTextTab alloc] initWithType: types[i] location: locations[i]]; [_tabStops addObject: tab]; RELEASE(tab); } } if ([aCoder versionForClassName: @"NSParagraphStyle"] >= 2) { [aCoder decodeValueOfObjCType: @encode(NSInteger) at: &_baseDirection]; } } return self; } - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { // TODO_NIB: Determine keys for NSParagraphStyle, if there are any. } else { NSUInteger count; [aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_alignment]; [aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_lineBreakMode]; [aCoder encodeValueOfObjCType: @encode(float) at: &_firstLineHeadIndent]; [aCoder encodeValueOfObjCType: @encode(float) at: &_headIndent]; [aCoder encodeValueOfObjCType: @encode(float) at: &_lineSpacing]; [aCoder encodeValueOfObjCType: @encode(float) at: &_maximumLineHeight]; [aCoder encodeValueOfObjCType: @encode(float) at: &_minimumLineHeight]; [aCoder encodeValueOfObjCType: @encode(float) at: &_paragraphSpacing]; [aCoder encodeValueOfObjCType: @encode(float) at: &_tailIndent]; /* * Tab stops don't conform to NSCoding - so we do it the long way. */ count = [_tabStops count]; [aCoder encodeValueOfObjCType: @encode(NSUInteger) at: &count]; if (count > 0) { float locations[count]; NSTextTabType types[count]; NSUInteger i; for (i = 0; i < count; i++) { NSTextTab *tab = [_tabStops objectAtIndex: i]; locations[i] = [tab location]; types[i] = [tab tabStopType]; } [aCoder encodeArrayOfObjCType: @encode(float) count: count at: locations]; [aCoder encodeArrayOfObjCType: @encode(NSInteger) count: count at: types]; } [aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_baseDirection]; } } - (BOOL) isEqual: (id)aother { NSParagraphStyle *other = aother; if (other == self) return YES; if ([other isKindOfClass: [NSParagraphStyle class]] == NO) return NO; #define C(x) if (x != other->x) return NO C(_lineSpacing); C(_paragraphSpacing); C(_headIndent); C(_tailIndent); C(_firstLineHeadIndent); C(_minimumLineHeight); C(_maximumLineHeight); C(_alignment); C(_lineBreakMode); C(_paragraphSpacingBefore); C(_defaultTabInterval); C(_hyphenationFactor); C(_lineHeightMultiple); C(_tighteningFactorForTruncation); C(_headerLevel); #undef C return [_tabStops isEqualToArray: other->_tabStops]; } - (NSUInteger) hash { return _alignment + _lineBreakMode; } @end @implementation NSMutableParagraphStyle + (NSParagraphStyle*) defaultParagraphStyle { return AUTORELEASE ([[NSParagraphStyle defaultParagraphStyle] mutableCopy]); } - (void) setLineSpacing: (CGFloat)aFloat { NSAssert (aFloat >= 0.0, NSInvalidArgumentException); _lineSpacing = aFloat; } - (void) setParagraphSpacing: (CGFloat)aFloat { NSAssert (aFloat >= 0.0, NSInvalidArgumentException); _paragraphSpacing = aFloat; } - (void) setAlignment: (NSTextAlignment)newAlignment { _alignment = newAlignment; } - (void) setFirstLineHeadIndent: (CGFloat)aFloat { NSAssert (aFloat >= 0.0, NSInvalidArgumentException); _firstLineHeadIndent = aFloat; } - (void) setHeadIndent: (CGFloat)aFloat { NSAssert (aFloat >= 0.0, NSInvalidArgumentException); _headIndent = aFloat; } - (void) setTailIndent: (CGFloat)aFloat { _tailIndent = aFloat; } - (void) setLineBreakMode: (NSLineBreakMode)mode { _lineBreakMode = mode; } - (void) setMinimumLineHeight: (CGFloat)aFloat { NSAssert (aFloat >= 0.0, NSInvalidArgumentException); _minimumLineHeight = aFloat; } - (void) setMaximumLineHeight: (CGFloat)aFloat { NSAssert (aFloat >= 0.0, NSInvalidArgumentException); _maximumLineHeight = aFloat; } - (void) setBaseWritingDirection: (NSWritingDirection)direction { /* * FIXME there is some confusion regarding natural writing direction. * * this method is documented as setting * NSWritingDirectionLeftToRight or NSWritingDirectionRightToLeft * based on the users language preferences. * when encountering NSWritingDirectionNaturalDirection * * NSWritingDirectionNatural constant is documented as using the * unicode bidi algorithm. * * no idea what the constant name or behaviour actually is. */ _baseDirection = direction; } - (void) setDefaultTabInterval: (CGFloat)interval { _defaultTabInterval = interval; } - (void) setLineHeightMultiple: (CGFloat)factor { _lineHeightMultiple = factor; } - (void) setParagraphSpacingBefore: (CGFloat)spacing { _paragraphSpacingBefore = spacing; } - (void) setHeaderLevel: (NSInteger)level { _headerLevel = level; } - (void) setHyphenationFactor: (float)factor { _hyphenationFactor = factor; } - (void) setTextBlocks: (NSArray *)blocks { ASSIGN(_textBlocks, blocks); } - (void) setTextLists: (NSArray *)lists { ASSIGN(_textLists, lists); } - (void) setTighteningFactorForTruncation: (float)factor { _tighteningFactorForTruncation = factor; } - (void) addTabStop: (NSTextTab*)anObject { NSUInteger count = [_tabStops count]; if (count == 0) { [_tabStops addObject: anObject]; } else { while (count-- > 0) { NSTextTab *tab; tab = [_tabStops objectAtIndex: count]; if ([tab compare: anObject] != NSOrderedDescending) { [_tabStops insertObject: anObject atIndex: count + 1]; return; } } [_tabStops insertObject: anObject atIndex: 0]; } } - (void) removeTabStop: (NSTextTab*)anObject { NSUInteger i = [_tabStops indexOfObject: anObject]; if (i != NSNotFound) [_tabStops removeObjectAtIndex: i]; } - (void) setTabStops: (NSArray *)array { if (array != _tabStops) { [_tabStops removeAllObjects]; [_tabStops addObjectsFromArray: array]; [_tabStops sortUsingSelector: @selector(compare:)]; } } - (void) setParagraphStyle: (NSParagraphStyle*)obj { NSMutableParagraphStyle *p = (NSMutableParagraphStyle*)obj; if (p == self) return; /* Can add tab stops without sorting as we know they are already sorted. */ [_tabStops removeAllObjects]; [_tabStops addObjectsFromArray: p->_tabStops]; if (p->_textBlocks) [self setTextBlocks: p->_textBlocks]; if (p->_textLists) [self setTextLists: p->_textLists]; _alignment = p->_alignment; _firstLineHeadIndent = p->_firstLineHeadIndent; _headIndent = p->_headIndent; _lineBreakMode = p->_lineBreakMode; _lineSpacing = p->_lineSpacing; _maximumLineHeight = p->_maximumLineHeight; _minimumLineHeight = p->_minimumLineHeight; _paragraphSpacing = p->_paragraphSpacing; _tailIndent = p->_tailIndent; _baseDirection = p->_baseDirection; _paragraphSpacingBefore = p->_paragraphSpacingBefore; _defaultTabInterval = p->_defaultTabInterval; _hyphenationFactor = p->_hyphenationFactor; _lineHeightMultiple = p->_lineHeightMultiple; _tighteningFactorForTruncation = p->_tighteningFactorForTruncation; _headerLevel = p->_headerLevel; } - (id) copyWithZone: (NSZone*)aZone { NSMutableParagraphStyle *c; c = (NSMutableParagraphStyle*)NSCopyObject (self, 0, aZone); GSClassSwizzle(c, [NSParagraphStyle class]); c->_tabStops = [_tabStops mutableCopyWithZone: aZone]; c->_textBlocks = [_textBlocks mutableCopyWithZone: aZone]; c->_textLists = [_textLists mutableCopyWithZone: aZone]; return c; } @end gnustep-gui-0.24.0/Source/GSFontInfo.m0000664000076500007650000004653111340007043017335 0ustar brains99brains99/* GSFontInfo Private class for handling font info Copyright (C) 2000 Free Software Foundation, Inc. Author: Adam Fedor Date: Mar 2000 This file is part of the GNUstep. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #import #import #import #import #import #import #import #import #import #import "AppKit/NSFontDescriptor.h" #import "GNUstepGUI/GSFontInfo.h" static Class fontEnumeratorClass = Nil; static Class fontInfoClass = Nil; static GSFontEnumerator *sharedEnumerator = nil; @implementation GSFontEnumerator + (void) setDefaultClass: (Class)defaultClass { fontEnumeratorClass = defaultClass; } - (id) init { [super init]; [self enumerateFontsAndFamilies]; return self; } - (void) dealloc { RELEASE(allFontNames); RELEASE(allFontFamilies); [super dealloc]; } + (GSFontEnumerator*) sharedEnumerator { NSAssert(fontEnumeratorClass, @"Called with fontEnumeratorClass unset." @" The shared NSApplication instance must be created before methods that" @" need the backend may be called."); if (!sharedEnumerator) sharedEnumerator = [[fontEnumeratorClass alloc] init]; return sharedEnumerator; } - (void) enumerateFontsAndFamilies { // This method has to set up the ivars allFontNames and allFontFamilies [self subclassResponsibility: _cmd]; } - (NSArray*) availableFonts { return allFontNames; } - (NSArray*) availableFontFamilies { return [[allFontFamilies allKeys] sortedArrayUsingSelector: @selector(compare:)]; } - (NSArray*) availableMembersOfFontFamily: (NSString*)family { return [allFontFamilies objectForKey: family]; } - (NSArray*) availableFontDescriptors { if (allFontDescriptors == nil) { NSMutableArray *fontDescriptors; NSEnumerator *keyEnumerator; NSString *family; fontDescriptors = [[NSMutableArray alloc] init]; keyEnumerator = [allFontFamilies keyEnumerator]; while ((family = [keyEnumerator nextObject]) != nil) { NSArray *fontDefs = [allFontFamilies objectForKey: family]; NSEnumerator *fdEnumerator; NSArray *fontDef; fdEnumerator = [fontDefs objectEnumerator]; while ((fontDef = [fdEnumerator nextObject]) != nil) { NSFontDescriptor *fd; NSDictionary *attributes; NSNumber *weight = [fontDef objectAtIndex: 2]; NSNumber *traits = [fontDef objectAtIndex: 3]; NSDictionary *fontTraits; float fweight = ([weight intValue] - 6) / 6.0; fontTraits = [NSDictionary dictionaryWithObjectsAndKeys: traits, NSFontSymbolicTrait, [NSNumber numberWithFloat: fweight], NSFontWeightTrait, nil]; attributes = [NSDictionary dictionaryWithObjectsAndKeys: family, NSFontFamilyAttribute, [fontDef objectAtIndex: 0], NSFontNameAttribute, [fontDef objectAtIndex: 1], NSFontFaceAttribute, fontTraits, NSFontTraitsAttribute, nil]; fd = [[NSFontDescriptor alloc] initWithFontAttributes: attributes]; [fontDescriptors addObject: fd]; RELEASE(fd); } } allFontDescriptors = fontDescriptors; } return allFontDescriptors; } - (NSArray *) availableFontNamesMatchingFontDescriptor: (NSFontDescriptor *)descriptor { NSString *fontName; NSArray *fds; NSMutableArray *found; NSEnumerator *fdEnumerator; NSFontDescriptor *fd; fontName = [descriptor objectForKey: NSFontNameAttribute]; if (fontName != nil) { return [NSArray arrayWithObject: fontName]; } found = [NSMutableArray array]; // Normalize the font descriptor fds = [descriptor matchingFontDescriptorsWithMandatoryKeys: nil]; fdEnumerator = [fds objectEnumerator]; while ((fd = [fdEnumerator nextObject]) != nil) { fontName = [fd objectForKey: NSFontNameAttribute]; if (fontName != nil) { [found addObject: fontName]; } } return found; } - (NSArray *) matchingFontDescriptorsFor: (NSDictionary *)attributes { NSMutableArray *found; NSEnumerator *fdEnumerator; NSFontDescriptor *fd; NSArray *keys = [attributes allKeys]; found = [NSMutableArray arrayWithCapacity: 3]; // Get an enumerator for all available font descriptors fdEnumerator = [[self availableFontDescriptors] objectEnumerator]; while ((fd = [fdEnumerator nextObject]) != nil) { NSEnumerator *keyEnumerator; NSString *key; BOOL match = YES; keyEnumerator = [keys objectEnumerator]; while ((key = [keyEnumerator nextObject]) != nil) { id valueA = [attributes objectForKey: key]; if (valueA != nil) { id valueB = [fd objectForKey: key]; if (valueB == nil) { match = NO; break; } // Special handling for NSFontTraitsAttribute if ([key isEqual: NSFontTraitsAttribute]) { NSNumber *traitsA = [valueA objectForKey: NSFontSymbolicTrait]; NSNumber *traitsB = [valueB objectForKey: NSFontSymbolicTrait]; // FIXME: For now we only compare symbolic traits if ((traitsA != nil) && ((traitsB == nil) || ([traitsA unsignedIntValue] != [traitsB unsignedIntValue]))) { match = NO; break; } } else { if (![valueA isEqual: valueB]) { match = NO; break; } } } } if (match) { [found addObject: fd]; } } return found; } - (NSString *) defaultSystemFontName { return @"Helvetica"; } - (NSString *) defaultBoldSystemFontName { return @"Helvetica-Bold"; } - (NSString *) defaultFixedPitchFontName { return @"Courier"; } @end @interface GSFontInfo (Backend) -initWithFontName: (NSString *)fontName matrix: (const CGFloat *)fmatrix screenFont: (BOOL)screenFont; @end @implementation GSFontInfo + (void) setDefaultClass: (Class)defaultClass { fontInfoClass = defaultClass; } + (GSFontInfo*) fontInfoForFontName: (NSString*)nfontName matrix: (const CGFloat *)fmatrix screenFont: (BOOL)screenFont; { NSAssert(fontInfoClass, @"Called with fontInfoClass unset." @" The shared NSApplication instance must be created before methods that" @" need the backend may be called."); return AUTORELEASE([[fontInfoClass alloc] initWithFontName: nfontName matrix: fmatrix screenFont: screenFont]); } + (int) weightForString: (NSString *)weightString { static NSDictionary *dict = nil; NSNumber *num; if (dict == nil) { dict = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt: 1], @"ultralight", [NSNumber numberWithInt: 2], @"thin", [NSNumber numberWithInt: 3], @"light", [NSNumber numberWithInt: 3], @"extralight", [NSNumber numberWithInt: 4], @"book", [NSNumber numberWithInt: 5], @"regular", [NSNumber numberWithInt: 5], @"plain", [NSNumber numberWithInt: 5], @"display", [NSNumber numberWithInt: 5], @"roman", [NSNumber numberWithInt: 5], @"semilight", [NSNumber numberWithInt: 6], @"medium", [NSNumber numberWithInt: 7], @"demi", [NSNumber numberWithInt: 7], @"demibold", [NSNumber numberWithInt: 8], @"semi", [NSNumber numberWithInt: 8], @"semibold", [NSNumber numberWithInt: 9], @"bold", [NSNumber numberWithInt: 10], @"extra", [NSNumber numberWithInt: 10], @"extrabold", [NSNumber numberWithInt: 11], @"heavy", [NSNumber numberWithInt: 11], @"heavyface", [NSNumber numberWithInt: 12], @"ultrabold", [NSNumber numberWithInt: 12], @"black", [NSNumber numberWithInt: 13], @"ultra", [NSNumber numberWithInt: 13], @"ultrablack", [NSNumber numberWithInt: 13], @"fat", [NSNumber numberWithInt: 14], @"extrablack", [NSNumber numberWithInt: 14], @"obese", [NSNumber numberWithInt: 14], @"nord", nil]; RETAIN(dict); } if ((weightString == nil) || ((num = [dict objectForKey: weightString]) == nil)) { return 5; } else { return [num intValue]; } } + (NSString *) stringForWeight: (int)aWeight { static NSArray *arr = nil; if (arr == nil) { arr = [NSArray arrayWithObjects: @"", @"ultralight", @"thin", @"light", @"book", @"regular", @"medium", @"demibold", @"semibold", @"bold", @"extrabold", @"heavy", @"black", @"ultrablack", @"extrablack", nil]; RETAIN(arr); } if ((aWeight < 1) || (aWeight > 14)) return @""; else return [arr objectAtIndex: aWeight]; } - init { [super init]; mostCompatibleStringEncoding = NSASCIIStringEncoding; return self; } - (void) dealloc { RELEASE(coveredCharacterSet); RELEASE(fontDictionary); RELEASE(fontName); RELEASE(familyName); RELEASE(encodingScheme); TEST_RELEASE(fontDescriptor); [super dealloc]; } - (id) copyWithZone: (NSZone *)zone { GSFontInfo *copy; if (NSShouldRetainWithZone(self, zone)) copy = RETAIN(self); else { copy = (GSFontInfo*) NSCopyObject (self, 0, zone); copy->fontDictionary = [fontDictionary copyWithZone: zone]; copy->fontName = [fontName copyWithZone: zone]; copy->familyName = [familyName copyWithZone: zone]; copy->encodingScheme = [encodingScheme copyWithZone: zone]; copy->fontDescriptor = [fontDescriptor copyWithZone: zone]; } return copy; } /* We really want a mutable class for this, but this is quick and easy since it's not really a public class anyway */ - (id) mutableCopyWithZone: (NSZone *)zone { GSFontInfo *copy; copy = (GSFontInfo*) NSCopyObject (self, 0, zone); copy->fontDictionary = [fontDictionary copyWithZone: zone]; copy->fontName = [fontName copyWithZone: zone]; copy->familyName = [familyName copyWithZone: zone]; copy->encodingScheme = [encodingScheme copyWithZone: zone]; copy->fontDescriptor = [fontDescriptor copyWithZone: zone]; return copy; } - (void) set { [self subclassResponsibility: _cmd]; } - (NSDictionary*) afmDictionary { if (fontDictionary == nil) { NSString *weightString; fontDictionary = [[NSMutableDictionary alloc] initWithCapacity: 25]; [fontDictionary setObject: fontName forKey: NSAFMFontName]; if (familyName != nil) { [fontDictionary setObject: familyName forKey: NSAFMFamilyName]; } if (ascender != 0.0) { [fontDictionary setObject: [NSNumber numberWithFloat: ascender] forKey: NSAFMAscender]; } if (descender != 0.0) { [fontDictionary setObject: [NSNumber numberWithFloat: descender] forKey: NSAFMDescender]; } if (xHeight != 0.0) { [fontDictionary setObject: [NSNumber numberWithFloat: xHeight] forKey: NSAFMXHeight]; } if (capHeight != 0.0) { [fontDictionary setObject: [NSNumber numberWithFloat: capHeight] forKey: NSAFMCapHeight]; } if (italicAngle != 0.0) { [fontDictionary setObject: [NSNumber numberWithFloat: italicAngle] forKey: NSAFMItalicAngle]; } if (underlinePosition != 0.0) { [fontDictionary setObject: [NSNumber numberWithFloat: underlinePosition] forKey: NSAFMUnderlinePosition]; } if (underlineThickness != 0.0) { [fontDictionary setObject: [NSNumber numberWithFloat: underlineThickness] forKey: NSAFMUnderlineThickness]; } weightString = [GSFontInfo stringForWeight: weight]; if (weightString != nil) { [fontDictionary setObject: weightString forKey: NSAFMWeight]; } if (encodingScheme != nil) { [fontDictionary setObject: encodingScheme forKey: NSAFMEncodingScheme]; } } return fontDictionary; } - (NSString *) afmFileContents { return nil; } - (NSCharacterSet*) coveredCharacterSet { return coveredCharacterSet; } - (NSString*) encodingScheme { return encodingScheme; } - (NSRect) boundingRectForFont { return fontBBox; } - (NSString*) displayName { return familyName; } - (NSString*) familyName { return familyName; } - (const CGFloat*) matrix { return matrix; } - (NSUInteger) numberOfGlyphs { return numberOfGlyphs; } - (CGFloat) pointSize { return matrix[0]; } - (NSString*) fontName { return fontName; } - (BOOL) isBaseFont { return isBaseFont; } - (BOOL) isFixedPitch { return isFixedPitch; } - (CGFloat) ascender { return ascender; } - (CGFloat) descender { return descender; } - (CGFloat) capHeight { return capHeight; } - (CGFloat) italicAngle { return italicAngle; } - (NSSize) maximumAdvancement { return maximumAdvancement; } - (NSSize) minimumAdvancement { return minimumAdvancement; } - (CGFloat) underlinePosition { return underlinePosition; } - (CGFloat) underlineThickness { return underlineThickness; } - (CGFloat) xHeight { return xHeight; } - (CGFloat) defaultLineHeightForFont { /* In the absence of a more accurate line height from the font itself, we use ascender_height+descender_height (note that descender is negative below the baseline). This matches what other systems do, and it matches the font-provided line height in most cases. (Note that the ascender height usually includes a bit of space above the top of the actual glyphs, so we get some inter-line spacing anyway.) This calculation should match the baseline calculation in GSHorizontalTypesetter, or text will look odd. */ return [self ascender] - [self descender]; } - (NSSize) advancementForGlyph: (NSGlyph)aGlyph { return NSMakeSize (0,0); } - (NSRect) boundingRectForGlyph: (NSGlyph)aGlyph { return NSZeroRect; } - (BOOL) glyphIsEncoded: (NSGlyph)aGlyph; { // FIXME: This is a hack for aGlyph == theChar fonts. if (coveredCharacterSet == nil) { [self coveredCharacterSet]; } return [coveredCharacterSet characterIsMember: (unichar)aGlyph]; } - (NSMultibyteGlyphPacking) glyphPacking { return NSOneByteGlyphPacking; } - (NSGlyph) glyphWithName: (NSString*)glyphName { return 0; } - (NSPoint) positionOfGlyph: (NSGlyph)curGlyph precededByGlyph: (NSGlyph)prevGlyph isNominal: (BOOL *)nominal { NSSize advance; if (nominal) *nominal = YES; if (curGlyph == NSControlGlyph || prevGlyph == NSControlGlyph) return NSZeroPoint; if (curGlyph == NSNullGlyph) advance = [self advancementForGlyph: prevGlyph]; else // Should check kerning advance = [self advancementForGlyph: prevGlyph]; return NSMakePoint (advance.width, advance.height); } - (NSPoint) positionOfGlyph: (NSGlyph)aGlyph forCharacter: (unichar)aChar struckOverRect: (NSRect)aRect { return NSZeroPoint; } - (NSPoint) positionOfGlyph: (NSGlyph)aGlyph struckOverGlyph: (NSGlyph)baseGlyph metricsExist: (BOOL *)flag { if (flag) *flag = NO; return NSZeroPoint; } - (NSPoint) positionOfGlyph: (NSGlyph)aGlyph struckOverRect: (NSRect)aRect metricsExist: (BOOL *)flag { if (flag) *flag = NO; return NSZeroPoint; } - (NSPoint) positionOfGlyph: (NSGlyph)aGlyph withRelation: (NSGlyphRelation)relation toBaseGlyph: (NSGlyph)baseGlyph totalAdvancement: (NSSize *)offset metricsExist: (BOOL *)flag { NSRect baseRect = [self boundingRectForGlyph: baseGlyph]; NSPoint point = NSZeroPoint; if (flag) *flag = NO; if (relation == NSGlyphBelow) { point = baseRect.origin; } else { point = NSMakePoint (baseRect.origin.x, NSMaxY (baseRect)); } if (offset) { NSSize baseSize = [self advancementForGlyph: baseGlyph]; NSSize aSize = [self advancementForGlyph: aGlyph]; if (baseSize.width > aSize.width) *offset = baseSize; else *offset = aSize; } return point; } - (NSStringEncoding) mostCompatibleStringEncoding { return mostCompatibleStringEncoding; } - (CGFloat) widthOfString: (NSString*)string { return 0; } - (NSFontTraitMask) traits { return traits; } - (int) weight { return weight; } -(void) appendBezierPathWithGlyphs: (NSGlyph *)glyphs count: (int)count toBezierPath: (NSBezierPath *)path { [self subclassResponsibility: _cmd]; } - (NSGlyph) glyphForCharacter: (unichar)theChar { // Hack to get most font backends working if ([self glyphIsEncoded: (NSGlyph)theChar]) return (NSGlyph)theChar; else return NSNullGlyph; } - (NSFontDescriptor*) fontDescriptor { if (fontDescriptor == nil) { // Create a new one NSAffineTransform *transform = [NSAffineTransform new]; NSAffineTransformStruct ats; NSDictionary *attributes; NSDictionary *fontTraits; float fweight = (weight - 6) / 6.0; float fslant = italicAngle / 30.0; ats.m11 = matrix[0]; ats.m12 = matrix[1]; ats.m21 = matrix[2]; ats.m22 = matrix[3]; ats.tX = matrix[4]; ats.tY = matrix[5]; [transform setTransformStruct: ats]; fontTraits = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithUnsignedInt: traits], NSFontSymbolicTrait, [NSNumber numberWithFloat: fweight], NSFontWeightTrait, [NSNumber numberWithFloat: fslant], NSFontSlantTrait, nil]; attributes = [NSDictionary dictionaryWithObjectsAndKeys: familyName, NSFontFamilyAttribute, fontName, NSFontNameAttribute, //fontFace, NSFontFaceAttribute, fontTraits, NSFontTraitsAttribute, transform, NSFontMatrixAttribute, nil]; RELEASE(transform); fontDescriptor = [[NSFontDescriptor alloc] initWithFontAttributes: attributes]; } return fontDescriptor; } @end gnustep-gui-0.24.0/Source/NSProgressIndicator.m0000664000076500007650000003250612111653106021264 0ustar brains99brains99/** NSProgressIndicator Copyright (C) 1999 Free Software Foundation, Inc. Author: Gerrit van Dyk Date: 1999 Author: Fred Kiefer Date: 2009 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSProgressIndicator.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSImage.h" #import "AppKit/NSWindow.h" #import "GNUstepGUI/GSTheme.h" #import "GNUstepGUI/GSNibLoading.h" @implementation NSProgressIndicator + (void) initialize { if (self == [NSProgressIndicator class]) { [self setVersion: 1]; } } - (id) initWithFrame: (NSRect)frameRect { self = [super initWithFrame: frameRect]; if (!self) return nil; _isIndeterminate = YES; _isDisplayedWhenStopped = YES; _isBezeled = YES; _animationDelay = 5.0 / 60.0; // 1 twelfth a a second _doubleValue = 0.0; _minValue = 0.0; _maxValue = 100.0; _controlTint = NSDefaultControlTint; _controlSize = NSRegularControlSize; [self setStyle: NSProgressIndicatorBarStyle]; //_isVertical = NO; //_usesThreadedAnimation = NO; return self; } - (void) dealloc { [self stopAnimation: self]; [super dealloc]; } - (BOOL) isFlipped { return YES; } - (void) animate: (id)sender { if (!_isIndeterminate && (_style == NSProgressIndicatorBarStyle)) return; // Let this value overflow when it reachs the limit _count++; [self setNeedsDisplay: YES]; } - (NSTimeInterval) animationDelay { return _animationDelay; } - (void) setAnimationDelay: (NSTimeInterval)delay { _animationDelay = delay; if (_isRunning && (_isIndeterminate || (_style == NSProgressIndicatorSpinningStyle))) { [self stopAnimation: self]; [self startAnimation: self]; } } - (void) _animationLoop { while (_isRunning) { CREATE_AUTORELEASE_POOL(pool); [self animate: self]; [NSThread sleepForTimeInterval: _animationDelay]; [pool drain]; } } - (void) startAnimation: (id)sender { if (_isRunning || (!_isIndeterminate && (_style == NSProgressIndicatorBarStyle))) return; _isRunning = YES; if (!_usesThreadedAnimation) { ASSIGN(_timer, [NSTimer scheduledTimerWithTimeInterval: _animationDelay target: self selector: @selector(animate:) userInfo: nil repeats: YES]); [[NSRunLoop currentRunLoop] addTimer: _timer forMode: NSModalPanelRunLoopMode]; } else { [NSThread detachNewThreadSelector: @selector(_animationLoop) toTarget: self withObject: nil]; } } - (void) stopAnimation: (id)sender { if (!_isRunning || (!_isIndeterminate && (_style == NSProgressIndicatorBarStyle))) return; if (!_usesThreadedAnimation) { [_timer invalidate]; DESTROY(_timer); } else { // Done automatically } _isRunning = NO; } - (BOOL) usesThreadedAnimation { return _usesThreadedAnimation; } - (void) setUsesThreadedAnimation: (BOOL)flag { if (_usesThreadedAnimation != flag) { BOOL wasRunning = _isRunning; if (wasRunning) [self stopAnimation: self]; _usesThreadedAnimation = flag; if (wasRunning) [self startAnimation: self]; } } - (void) incrementBy: (double)delta { [self setDoubleValue: _doubleValue + delta]; } - (double) doubleValue { return _doubleValue; } - (void) setDoubleValue: (double)aValue { if (aValue > _maxValue) aValue = _maxValue; else if (aValue < _minValue) aValue = _minValue; if (_doubleValue != aValue) { _doubleValue = aValue; [self setNeedsDisplay: YES]; } } - (double) minValue { return _minValue; } - (void) setMinValue: (double)newMinimum { if (_minValue != newMinimum) { _minValue = newMinimum; if (_minValue > _doubleValue) _doubleValue = _minValue; [self setNeedsDisplay: YES]; } } - (double) maxValue { return _maxValue; } - (void) setMaxValue: (double)newMaximum { if (_maxValue != newMaximum) { _maxValue = newMaximum; if (_maxValue < _doubleValue) _doubleValue = _maxValue; [self setNeedsDisplay: YES]; } } - (BOOL)isBezeled { return _isBezeled; } - (void) setBezeled: (BOOL)flag { if (_isBezeled != flag) { _isBezeled = flag; [self setNeedsDisplay: YES]; } } - (BOOL) isIndeterminate { return _isIndeterminate; } - (void) setIndeterminate: (BOOL)flag { /* Note: We must stop a running animation before setting _isIndeterminate because -stopAnimation: has no effect when _isIndeterminate is NO. */ if (flag == NO && _isRunning) [self stopAnimation: self]; _isIndeterminate = flag; // Maybe we need more functionality here when we implement indeterminate [self setNeedsDisplay: YES]; } - (BOOL) isDisplayedWhenStopped { return _isDisplayedWhenStopped; } - (void) setDisplayedWhenStopped: (BOOL)flag { if (flag != _isDisplayedWhenStopped) { _isDisplayedWhenStopped = flag; [self setNeedsDisplay: YES]; } } - (NSProgressIndicatorStyle) style { return _style; } - (void) setStyle: (NSProgressIndicatorStyle)style { _style = style; _count = 0; [self setDisplayedWhenStopped: (style == NSProgressIndicatorBarStyle)]; [self sizeToFit]; [self setNeedsDisplay: YES]; } - (NSControlSize) controlSize { return _controlSize; } - (void) setControlSize: (NSControlSize)size { _controlSize = size; [self sizeToFit]; [self setNeedsDisplay: YES]; } - (NSControlTint) controlTint { return _controlTint; } - (void) setControlTint: (NSControlTint)tint { _controlTint = tint; [self setNeedsDisplay: YES]; } - (void) sizeToFit { // FIXME } - (void) drawRect: (NSRect)rect { double val; if (!_isRunning && !_isDisplayedWhenStopped) return; if (_doubleValue < _minValue) val = 0.0; else if (_doubleValue > _maxValue) val = 1.0; else val = (_doubleValue - _minValue) / (_maxValue - _minValue); [[GSTheme theme] drawProgressIndicator: self withBounds: _bounds withClip: rect atCount: _count forValue: val]; } // It does not seem that Gnustep has a copyWithZone: on NSView, it is private // under openstep // NSCopying /* - (id)copyWithZone:(NSZone *)zone { NSProgressIndicator *newInd; newInd = [super copyWithZone:zone]; [newInd setIndeterminate:_isIndeterminate]; [newInd setBezeled:_isBezeled]; [newInd setUsesThreadedAnimation:_usesThreadedAnimation]; [newInd setAnimimationDelay:_animationDelay]; [newInd setDoubleValue:_doubleValue]; [newInd setMinValue:_minValue]; [newInd setMaxValue:_maxValue]; [newInd setVertical:_isVertical]; return newInd; } */ // NSCoding - (void) encodeWithCoder: (NSCoder *)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { unsigned long flags = 0; id matrix = AUTORELEASE([[NSPSMatrix alloc] init]); [aCoder encodeDouble: _minValue forKey: @"NSMinValue"]; [aCoder encodeDouble: _maxValue forKey: @"NSMaxValue"]; [aCoder encodeObject: matrix forKey: @"NSDrawMatrix"]; // add flag values. flags |= (_isIndeterminate)? 2 : 0; // Hard coded... flags |= 8; flags |= (_controlSize == NSSmallControlSize) ? 0x100 : 0; flags |= (_style == NSProgressIndicatorSpinningStyle) ? 0x1000 : 0; flags |= _isDisplayedWhenStopped ? 0 : 0x2000; [aCoder encodeInt: flags forKey: @"NSpiFlags"]; // things which Gorm encodes, but IB doesn't care about. [aCoder encodeDouble: _doubleValue forKey: @"GSDoubleValue"]; [aCoder encodeBool: _isBezeled forKey: @"GSIsBezeled"]; [aCoder encodeBool: _isVertical forKey: @"GSIsVertical"]; [aCoder encodeBool: _usesThreadedAnimation forKey: @"GSUsesThreadAnimation"]; [aCoder encodeDouble: _animationDelay forKey: @"GSAnimationDelay"]; } else { [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isIndeterminate]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isBezeled]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_usesThreadedAnimation]; [aCoder encodeValueOfObjCType: @encode(NSTimeInterval) at: &_animationDelay]; [aCoder encodeValueOfObjCType: @encode(double) at: &_doubleValue]; [aCoder encodeValueOfObjCType: @encode(double) at: &_minValue]; [aCoder encodeValueOfObjCType: @encode(double) at: &_maxValue]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isVertical]; } } - (id) initWithCoder: (NSCoder *)aDecoder { self = [super initWithCoder: aDecoder]; if (!self) return nil; if ([aDecoder allowsKeyedCoding]) { // id matrix = [aDecoder decodeObjectForKey: @"NSDrawMatrix"]; if ([aDecoder containsValueForKey: @"NSMaxValue"]) { double max = [aDecoder decodeDoubleForKey: @"NSMaxValue"]; [self setMaxValue: max]; } else { _maxValue = 100.0; } if ([aDecoder containsValueForKey: @"NSMinValue"]) { double min = [aDecoder decodeDoubleForKey: @"NSMinValue"]; [self setMinValue: min]; } else { _minValue = 0.0; } if ([aDecoder containsValueForKey: @"NSpiFlags"]) { int flags = [aDecoder decodeIntForKey: @"NSpiFlags"]; _isIndeterminate = ((flags & 2) == 2); _controlTint = NSDefaultControlTint; _controlSize = (flags & 0x100) ? NSSmallControlSize : NSRegularControlSize; [self setStyle: (flags & 0x1000) ? NSProgressIndicatorSpinningStyle : NSProgressIndicatorBarStyle]; _isDisplayedWhenStopped = ((flags & 0x2000) != 0x2000); // ignore the rest, since they are not pertinent to GNUstep. } else { _isIndeterminate = YES; _isDisplayedWhenStopped = YES; _controlTint = NSDefaultControlTint; _controlSize = NSRegularControlSize; [self setStyle: NSProgressIndicatorBarStyle]; } // things which Gorm encodes, but IB doesn't care about. if ([aDecoder containsValueForKey: @"GSDoubleValue"]) { _doubleValue = [aDecoder decodeDoubleForKey: @"GSDoubleValue"]; } else { _doubleValue = _minValue; } if ([aDecoder containsValueForKey: @"GSIsBezeled"]) { _isBezeled = [aDecoder decodeBoolForKey: @"GSIsBezeled"]; } else { _isBezeled = YES; } if ([aDecoder containsValueForKey: @"GSIsVertical"]) { _isVertical = [aDecoder decodeBoolForKey: @"GSIsVertical"]; } else { _isVertical = NO; } if ([aDecoder containsValueForKey: @"GSUsesThreadAnimation"]) { _usesThreadedAnimation = [aDecoder decodeBoolForKey: @"GSUsesThreadAnimation"]; } else { _usesThreadedAnimation = NO; } if ([aDecoder containsValueForKey: @"GSAnimationDelay"]) { _animationDelay = [aDecoder decodeDoubleForKey: @"GSAnimationDelay"]; } else { _animationDelay = 5.0 / 60.0; // 1 twelfth a a second } } else { [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isIndeterminate]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isBezeled]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_usesThreadedAnimation]; [aDecoder decodeValueOfObjCType: @encode(NSTimeInterval) at: &_animationDelay]; [aDecoder decodeValueOfObjCType: @encode(double) at: &_doubleValue]; [aDecoder decodeValueOfObjCType: @encode(double) at: &_minValue]; [aDecoder decodeValueOfObjCType: @encode(double) at: &_maxValue]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_isVertical]; _isDisplayedWhenStopped = YES; _controlTint = NSDefaultControlTint; _controlSize = NSRegularControlSize; [self setStyle: NSProgressIndicatorBarStyle]; } return self; } @end @implementation NSProgressIndicator (GNUstepExtensions) - (BOOL) isVertical { return _isVertical; } - (void) setVertical: (BOOL)flag { if (_isVertical != flag) { _isVertical = flag; [self setNeedsDisplay:YES]; } } @end gnustep-gui-0.24.0/Source/GSCharacterPanel.m0000664000076500007650000002540512063450153020473 0ustar brains99brains99/** GSCharacterPanel Character Panel. Copyright (C) 2011 Free Software Foundation, Inc. Author: Eric Wasylishen Date: July 2011 This file is part of the GNUstep Application Kit Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import #import #import "AppKit/NSApplication.h" #import "AppKit/NSStringDrawing.h" #import "AppKit/NSPasteboard.h" #import "AppKit/NSTableView.h" #import "AppKit/NSTableColumn.h" #import "AppKit/NSTextFieldCell.h" #import "AppKit/NSScrollView.h" #import "AppKit/NSSearchField.h" #import "GNUstepGUI/GSCharacterPanel.h" #import "GSGuiPrivate.h" @implementation NSApplication (CharacterPanel) - (void) orderFrontCharacterPalette: (id)sender { [[GSCharacterPanel sharedCharacterPanel] orderFront: sender]; } @end #if defined(HAVE_UNICODE_UCHAR_H) && defined(HAVE_UNICODE_USTRING_H) #include #include @interface GSVerticallyCenteredTextFieldCell : NSTextFieldCell { } @end @implementation GSVerticallyCenteredTextFieldCell - (NSRect) titleRectForBounds: (NSRect)aRect { NSRect titleRect = [super titleRectForBounds: aRect]; NSSize titleSize = [[self attributedStringValue] size]; titleRect.origin.y = aRect.origin.y + (aRect.size.height - titleSize.height) / 2.0; titleRect.size.height = titleSize.height; return titleRect; } @end // Enumerating assigned codepoints static UBool enumCharNamesFn(void *context, UChar32 code, UCharNameChoice nameChoice, const char *name, int32_t length) { [(NSMutableIndexSet*)context addIndex: (NSUInteger)code]; return TRUE; } static NSIndexSet *AssignedCodepoints() { UErrorCode err = U_ZERO_ERROR; NSMutableIndexSet *set = [NSMutableIndexSet indexSet]; u_enumCharNames(UCHAR_MIN_VALUE, UCHAR_MAX_VALUE + 1, enumCharNamesFn, set, U_UNICODE_CHAR_NAME, &err); return set; } // Searching for codepoints struct searchContext { const char *searchString; NSMutableIndexSet *set; }; static UBool searchCharNamesFn(void *context, UChar32 code, UCharNameChoice nameChoice, const char *name, int32_t length) { struct searchContext *ctx = (struct searchContext *)context; if (strstr(name, ctx->searchString) != NULL) { [ctx->set addIndex: (NSUInteger)code]; } return TRUE; } static NSIndexSet *CodepointsWithNameContainingSubstring(NSString *str) { UErrorCode err = U_ZERO_ERROR; struct searchContext ctx; ctx.set = [NSMutableIndexSet indexSet]; ctx.searchString = [[str uppercaseString] UTF8String]; u_enumCharNames(UCHAR_MIN_VALUE, UCHAR_MAX_VALUE + 1, searchCharNamesFn, &ctx, U_UNICODE_CHAR_NAME, &err); return ctx.set; } @implementation GSCharacterPanel - (void)setVisibleCodepoints: (NSIndexSet*)set { ASSIGN(visibleCodepoints, set); } + (GSCharacterPanel *) sharedCharacterPanel { static GSCharacterPanel *shared = nil; if (nil == shared) { shared = [[self alloc] init]; } return shared; } - (id) init { const NSRect contentRect = NSMakeRect(100, 100, 276, 420); self = [super initWithContentRect: contentRect styleMask: NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask | NSUtilityWindowMask backing: NSBackingStoreBuffered defer: YES]; if (nil != self) { // Setup assignedCodepoints and visibleCodepointsArray assignedCodepoints = [AssignedCodepoints() retain]; [self setVisibleCodepoints: assignedCodepoints]; [self setTitle: _(@"Character Panel")]; // Set up the table view table = [[[NSTableView alloc] initWithFrame: NSMakeRect(0, 0, contentRect.size.width - 18, contentRect.size.height - 52)] autorelease]; // Set up table columns { NSTableColumn *col = [[[NSTableColumn alloc] initWithIdentifier: @"char"] autorelease]; [col setDataCell: [[[GSVerticallyCenteredTextFieldCell alloc] init] autorelease]]; [[col dataCell] setFont:[NSFont systemFontOfSize: 24]]; [[col dataCell] setAlignment: NSCenterTextAlignment]; [col setMinWidth: 40]; [col setWidth: 40]; [table addTableColumn: col]; } { NSTableColumn *col = [[[NSTableColumn alloc] initWithIdentifier: @"name"] autorelease]; [col setDataCell: [[[GSVerticallyCenteredTextFieldCell alloc] init] autorelease]]; [[col dataCell] setFont:[NSFont systemFontOfSize: 10]]; [[col headerCell] setStringValue: _(@"Name")]; [col setWidth: 195]; [table addTableColumn: col]; } { NSTableColumn *col = [[[NSTableColumn alloc] initWithIdentifier: @"code"] autorelease]; [col setDataCell: [[[GSVerticallyCenteredTextFieldCell alloc] init] autorelease]]; [[col dataCell] setFont:[NSFont systemFontOfSize: 10]]; [[col dataCell] setAlignment: NSCenterTextAlignment]; [[col headerCell] setStringValue: _(@"Code Point")]; [col setMinWidth: 80]; [col setWidth: 80]; [table addTableColumn: col]; } { NSTableColumn *col = [[[NSTableColumn alloc] initWithIdentifier: @"block"] autorelease]; [col setDataCell: [[[GSVerticallyCenteredTextFieldCell alloc] init] autorelease]]; [[col dataCell] setFont:[NSFont systemFontOfSize: 10]]; [[col headerCell] setStringValue: _(@"Unicode Block")]; [col setMinWidth: 140]; [table addTableColumn: col]; } [table setRowHeight: 32]; [table setDataSource: self]; [table setDelegate: self]; [table setTarget: self]; [table setDoubleAction: @selector(doubleClickRow:)]; // Allow dragging out of the application [table setDraggingSourceOperationMask:NSDragOperationCopy forLocal:NO]; // Set up scroll view { NSScrollView *scrollView = [[NSScrollView alloc] initWithFrame: NSMakeRect(9, 41, contentRect.size.width - 18, contentRect.size.height - 52)]; [scrollView setDocumentView: table]; [scrollView setHasHorizontalScroller: YES]; [scrollView setHasVerticalScroller: YES]; [scrollView setBorderType: NSBezelBorder]; [scrollView setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)]; [[self contentView] addSubview: scrollView]; [scrollView release]; } // Set up search field { searchfield = [[NSSearchField alloc] initWithFrame: NSMakeRect(9,9,186,22)]; [searchfield setTarget: self]; [searchfield setAction: @selector(search:)]; [[self contentView] addSubview: searchfield]; [searchfield release]; } } return self; } - (void)dealloc { [assignedCodepoints release]; [visibleCodepoints release]; [super dealloc]; } - (void)search: (id)sender { NSString *str = [searchfield stringValue]; if ([str length] == 0) { [self setVisibleCodepoints: assignedCodepoints]; } else { NSIndexSet *set = CodepointsWithNameContainingSubstring(str); [self setVisibleCodepoints: set]; } [table reloadData]; } - (NSUInteger) codepointAtVisibleRow:(NSUInteger)row { //FIXME: Use a binary search NSUInteger curr = 0; NSUInteger currValue = [visibleCodepoints firstIndex]; while (currValue != NSNotFound) { if (curr == row) { return currValue; } currValue = [visibleCodepoints indexGreaterThanIndex: currValue]; curr++; } return NSNotFound; } - (NSString *)characterForRow: (NSInteger)row { if (row >= 0 && row < [visibleCodepoints count]) { UChar32 utf32 = [self codepointAtVisibleRow: row]; UChar utf16buf[2]; int32_t utf16bufLength = 0; UErrorCode error = U_ZERO_ERROR; u_strFromUTF32(utf16buf, 2, &utf16bufLength, &utf32, 1, &error); return [[[NSString alloc] initWithCharacters: utf16buf length: utf16bufLength] autorelease]; } return @""; } - (void) doubleClickRow: (id)sender { NSWindow *mainWindow = [NSApp mainWindow]; NSResponder *firstResponder = [mainWindow firstResponder]; NSString *str = [self characterForRow: [table clickedRow]]; [firstResponder insertText: str]; } - (BOOL) tableView: (NSTableView *)aTable shouldEditTableColumn: (NSTableColumn *)aColumn row: (NSInteger)row { return NO; } // NSTableViewDataSource protocol - (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView { return [visibleCodepoints count]; } - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { UChar32 utf32 = [self codepointAtVisibleRow: row]; if ([[tableColumn identifier] isEqualToString: @"char"]) { return [self characterForRow: row]; } else if ([[tableColumn identifier] isEqualToString: @"name"]) { UErrorCode error = U_ZERO_ERROR; int32_t size = u_charName(utf32, U_UNICODE_CHAR_NAME, NULL, 0, &error); if (size > 0) { char name[512]; error = U_ZERO_ERROR; u_charName(utf32, U_UNICODE_CHAR_NAME, name, 512, &error); NSString *nameObj = [[[NSString alloc] initWithBytes: name length: size encoding: NSASCIIStringEncoding] autorelease]; return [[nameObj lowercaseString] capitalizedString]; } return @""; } else if ([[tableColumn identifier] isEqualToString: @"code"]) { return [NSString stringWithFormat:@"U+%04X", (int)utf32]; } else if ([[tableColumn identifier] isEqualToString: @"block"]) { int32_t val = u_getIntPropertyValue(utf32, UCHAR_BLOCK); const char *name = u_getPropertyValueName(UCHAR_BLOCK, val, U_LONG_PROPERTY_NAME); if (name != NULL) { return [[[[NSString alloc] initWithBytes: name length: strlen(name) encoding: NSASCIIStringEncoding] autorelease] stringByReplacingOccurrencesOfString: @"_" withString: @" "]; } } return nil; } - (BOOL)tableView:(NSTableView *)aTableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard { NSString *str = [self characterForRow: [rowIndexes firstIndex]]; [pboard declareTypes: [NSArray arrayWithObject: NSStringPboardType] owner: nil]; [pboard setString: str forType: NSStringPboardType]; return YES; } @end #else // !(defined(HAVE_UNICODE_UCHAR_H) && defined(HAVE_UNICODE_USTRING_H)) @implementation GSCharacterPanel + (GSCharacterPanel *) sharedCharacterPanel { return nil; } @end #endif gnustep-gui-0.24.0/Source/GSWindowDecorationView.m0000664000076500007650000003670612107547001021735 0ustar brains99brains99/** GSWindowDecorationView Copyright (C) 2004 Free Software Foundation, Inc. Author: Alexander Malmberg Date: 2004-03-24 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import "AppKit/NSColor.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSMenuView.h" #import "AppKit/NSScreen.h" #import "AppKit/NSWindow.h" #import "GNUstepGUI/GSDisplayServer.h" #import "GNUstepGUI/GSTheme.h" #import "NSToolbarFrameworkPrivate.h" @interface NSWindow (GSWindowDecorationView) - (void)_clearContentView; @end @implementation NSWindow (GSWindowDecorationView) /* This method prevents a recursion when removing the contet view of a window. The method [NSWindow -setContentView:] would again lead to a call to -willRemoveSubview:. */ - (void)_clearContentView { _contentView = nil; } @end @implementation GSWindowDecorationView static inline NSRect RectWithSizeScaledByFactor(NSRect aRect, CGFloat factor) { return NSMakeRect(aRect.origin.x, aRect.origin.y, aRect.size.width * factor, aRect.size.height * factor); } + (id) windowDecorator { if ([GSCurrentServer() handlesWindowDecorations]) return [GSBackendWindowDecorationView self]; else return [GSStandardWindowDecorationView self]; } + (id) newWindowDecorationViewWithFrame: (NSRect)frame window: (NSWindow *)aWindow { return [[self alloc] initWithFrame: frame window: aWindow]; } + (void) offsets: (float *)l : (float *)r : (float *)t : (float *)b forStyleMask: (NSUInteger)style { [self subclassResponsibility: _cmd]; } + (NSRect) contentRectForFrameRect: (NSRect)aRect styleMask: (NSUInteger)aStyle { float t = 0.0, b = 0.0, l = 0.0, r = 0.0; [self offsets: &l : &r : &t : &b forStyleMask: aStyle]; aRect.size.width -= l + r; aRect.size.height -= t + b; aRect.origin.x += l; aRect.origin.y += b; if (0 == (aStyle & NSUnscaledWindowMask)) { // FIXME: This method should probably take a screen parameter // rather than assuming the mainScreen CGFloat factor = [[NSScreen mainScreen] userSpaceScaleFactor]; aRect = RectWithSizeScaledByFactor(aRect, 1/factor); } return aRect; } + (NSRect) frameRectForContentRect: (NSRect)aRect styleMask: (NSUInteger)aStyle { float t = 0.0, b = 0.0, l = 0.0, r = 0.0; [self offsets: &l : &r : &t : &b forStyleMask: aStyle]; if (0 == (aStyle & NSUnscaledWindowMask)) { // FIXME: This method should probably take a screen parameter // rather than assuming the mainScreen CGFloat factor = [[NSScreen mainScreen] userSpaceScaleFactor]; aRect = RectWithSizeScaledByFactor(aRect, factor); } aRect.size.width += l + r; aRect.size.height += t + b; aRect.origin.x -= l; aRect.origin.y -= b; return aRect; } + (CGFloat) minFrameWidthWithTitle: (NSString *)aTitle styleMask: (NSUInteger)aStyle { [self subclassResponsibility: _cmd]; return 0.0; } - (id) initWithFrame: (NSRect)frame { NSAssert(NO, @"Tried to create GSWindowDecorationView without a window!"); return nil; } - (id) initWithFrame: (NSRect)frame window: (NSWindow *)w { self = [super initWithFrame: frame]; if (self != nil) { hasToolbar = NO; hasMenu = NO; window = w; // Content rect will be everything apart from the border // that is including menu, toolbar and the like. contentRect = [object_getClass(self) contentRectForFrameRect: frame styleMask: [w styleMask]]; } return self; } - (void) setHasMenu: (BOOL) flag { hasMenu = flag; } - (BOOL) hasMenu { return hasMenu; } - (void) setHasToolbar: (BOOL) flag { hasToolbar = flag; } - (BOOL) hasToolbar { return hasToolbar; } - (NSRect) contentRectForFrameRect: (NSRect)aRect styleMask: (NSUInteger)aStyle { NSRect content = [object_getClass(self) contentRectForFrameRect: aRect styleMask: aStyle]; NSToolbar *tb = [_window toolbar]; if ([_window menu] != nil) { CGFloat menubarHeight = [[GSTheme theme] menuHeightForWindow: _window]; content.size.height -= menubarHeight; } if ([tb isVisible]) { GSToolbarView *tv = [tb _toolbarView]; content.size.height -= [tv _heightFromLayout]; } return content; } - (NSRect) frameRectForContentRect: (NSRect)aRect styleMask: (NSUInteger)aStyle { NSToolbar *tb = [_window toolbar]; if ([_window menu] != nil) { CGFloat menubarHeight = [[GSTheme theme] menuHeightForWindow: _window]; aRect.size.height += menubarHeight; } if ([tb isVisible]) { GSToolbarView *tv = [tb _toolbarView]; aRect.size.height += [tv _heightFromLayout]; } return [object_getClass(self) frameRectForContentRect: aRect styleMask: aStyle]; } /* If the contentView is removed from the window we must make sure the * window no longer tries to access it. This situation may occur, for * example, when people create inspectors where they want to swap in * and out views. In the example I saw, a bunch of non-visible * windows were created to create the inspector views. When an * inspector view was needed, it was added as a subview in the visible * inspector window. We need to make sure that when 'addSubview:' is * called to add the view to another window, all references to it in * the old window will automatically disappear (this is how it works * on Apple too). */ - (void) willRemoveSubview: (NSView*)aView { /* * If the content view is removed (for example, because it was added * to another view in another window), we must let the window know. * Otherwise, it would keep trying to resize/manage it as if it was * its content view, while it actually is now in another window! */ [super willRemoveSubview: aView]; if (aView == [_window contentView]) { [_window _clearContentView]; } } - (void) setBackgroundColor: (NSColor *)color { [self setNeedsDisplayInRect: contentRect]; } - (void) setContentView: (NSView *)contentView { [contentView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [self addSubview: contentView]; [self layout]; } - (void) setDocumentEdited: (BOOL)flag { documentEdited = flag; if (windowNumber) [GSServerForWindow(window) docedited: documentEdited : windowNumber]; } - (void) layout { // Should resize all subviews NSRect contentViewFrame; NSToolbar *tb = [_window toolbar]; NSRect frame = [window frame]; NSView *windowContentView = [_window contentView]; frame.origin = NSZeroPoint; contentViewFrame = [object_getClass(self) contentRectForFrameRect: frame styleMask: [window styleMask]]; if (hasMenu) { NSMenuView *menuView = nil; GSTheme *theme = [GSTheme theme]; CGFloat menuBarHeight = [theme menuHeightForWindow: _window]; NSRect menuRect = NSMakeRect(contentViewFrame.origin.x, (NSMaxY(contentRect) + 1) - menuBarHeight, contentViewFrame.size.width, menuBarHeight); NSEnumerator *e = [[self subviews] objectEnumerator]; NSView *v; while ((v = [e nextObject]) != nil) { if ([v isKindOfClass: [NSMenuView class]] == YES) { menuView = (NSMenuView *)v; break; } } [menuView setFrame: menuRect]; contentViewFrame.size.height -= menuBarHeight; } if (hasToolbar) { GSToolbarView *tv = [tb _toolbarView]; CGFloat newToolbarViewHeight; NSRect toolbarRect; // If the width changed we may need to recalculate the height if (contentViewFrame.size.width != [tv frame].size.width) { [tv setFrameSize: NSMakeSize(contentViewFrame.size.width, 100)]; // Will recalculate the layout [tv _reload]; } newToolbarViewHeight = [tv _heightFromLayout]; toolbarRect = NSMakeRect(contentViewFrame.origin.x, NSMaxY(contentViewFrame) - newToolbarViewHeight, contentViewFrame.size.width, newToolbarViewHeight); [tv setFrame: toolbarRect]; contentViewFrame.size.height -= newToolbarViewHeight; } if (0 == ([window styleMask] & NSUnscaledWindowMask)) { CGFloat factor = [window userSpaceScaleFactor]; NSRect aRect = RectWithSizeScaledByFactor([self frame], 1/factor); [self setBoundsSize: aRect.size]; } if ([windowContentView superview] == self) { [windowContentView setFrame:contentViewFrame]; } } - (void) changeWindowHeight: (CGFloat)difference { NSRect orgWindowFrame; NSRect windowFrame; NSRect windowContentFrame; contentRect.size.height += difference; windowFrame = [object_getClass(self) frameRectForContentRect: contentRect styleMask: [window styleMask]]; // Set the local frame without changing the contents view windowContentFrame = windowFrame; windowContentFrame.origin = NSZeroPoint; _autoresizes_subviews = NO; [super setFrame: windowContentFrame]; // Keep the top of the window at the same place orgWindowFrame = [window frame]; windowFrame.origin.y = orgWindowFrame.origin.y + orgWindowFrame.size.height - windowFrame.size.height; windowFrame.origin.x = orgWindowFrame.origin.x; // then resize the window [window setFrame: windowFrame display: YES]; [self layout]; } /* * Special setFrame: implementation - a minimal autoresize mechanism */ - (void) setFrame: (NSRect)frameRect { NSSize oldSize = _frame.size; NSView *cv = [_window contentView]; // Wouldn't it be better to rely on the autoresize mechanism? _autoresizes_subviews = NO; [super setFrame: frameRect]; contentRect = [object_getClass(self) contentRectForFrameRect: frameRect styleMask: [window styleMask]]; // Safety Check. [cv setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [cv resizeWithOldSuperviewSize: oldSize]; [self layout]; } - (void) setInputState: (int)state { inputState = state; if (windowNumber) [GSServerForWindow(window) setinputstate: inputState : windowNumber]; } - (void) setTitle: (NSString *)title { if (windowNumber) [GSServerForWindow(window) titlewindow: title : windowNumber]; } - (void) setWindowNumber: (int)theWindowNumber { windowNumber = theWindowNumber; if (!windowNumber) return; [GSServerForWindow(window) titlewindow: [window title] : windowNumber]; [GSServerForWindow(window) setinputstate: inputState : windowNumber]; [GSServerForWindow(window) docedited: documentEdited : windowNumber]; } - (BOOL) isOpaque { return YES; } - (void) drawRect: (NSRect)rect { if (NSIntersectsRect(rect, contentRect)) { // Since this is the outermost view, we have to clear the contentRect // in case the theme's window background is not opaque. NSRectFillUsingOperation(contentRect, NSCompositeClear); [[GSTheme theme] drawWindowBackground: contentRect view: self]; } } - (id) initWithCoder: (NSCoder*)aCoder { NSAssert(NO, @"The top-level window view should never be encoded."); return nil; } - (void) encodeWithCoder: (NSCoder*)aCoder { NSAssert(NO, @"The top-level window view should never be encoded."); } @end @implementation GSWindowDecorationView (ToolbarPrivate) - (void) addToolbarView: (GSToolbarView*)toolbarView { CGFloat newToolbarViewHeight; CGFloat contentYOrigin; hasToolbar = YES; [toolbarView setFrameSize: NSMakeSize(contentRect.size.width, 100)]; // Will recalculate the layout [toolbarView _reload]; newToolbarViewHeight = [toolbarView _heightFromLayout]; // take in account of the menubar when calculating the origin contentYOrigin = NSMaxY(contentRect); if (hasMenu) { CGFloat menuBarHeight = [[GSTheme theme] menuHeightForWindow: _window]; contentYOrigin -= menuBarHeight; } // Plug the toolbar view [toolbarView setFrame: NSMakeRect( contentRect.origin.x, contentYOrigin, contentRect.size.width, newToolbarViewHeight)]; [self addSubview: toolbarView]; [self changeWindowHeight: newToolbarViewHeight]; } - (void) removeToolbarView: (GSToolbarView *)toolbarView { CGFloat toolbarViewHeight = [toolbarView frame].size.height; // Unplug the toolbar view hasToolbar = NO; [toolbarView removeFromSuperviewWithoutNeedingDisplay]; [self changeWindowHeight: -toolbarViewHeight]; } - (void) adjustToolbarView: (GSToolbarView *)toolbarView { // Frame and height NSRect toolbarViewFrame = [toolbarView frame]; CGFloat toolbarViewHeight = toolbarViewFrame.size.height; CGFloat newToolbarViewHeight = [toolbarView _heightFromLayout]; if (toolbarViewHeight != newToolbarViewHeight) { [toolbarView setFrame: NSMakeRect( toolbarViewFrame.origin.x, toolbarViewFrame.origin.y + (toolbarViewHeight - newToolbarViewHeight), toolbarViewFrame.size.width, newToolbarViewHeight)]; [self changeWindowHeight: newToolbarViewHeight - toolbarViewHeight]; } } @end @implementation GSWindowDecorationView (Menu) - (void) addMenuView: (NSMenuView*)menuView { CGFloat menubarHeight = [[GSTheme theme] menuHeightForWindow: _window]; NSRect menuRect = NSMakeRect(contentRect.origin.x, (NSMaxY(contentRect) + 1) - menubarHeight, contentRect.size.width, menubarHeight); hasMenu = YES; // Plug the menu view [menuView setFrame: menuRect]; [self addSubview: menuView]; [self changeWindowHeight: menubarHeight]; } - (NSMenuView*) removeMenuView { NSEnumerator *e = [[self subviews] objectEnumerator]; NSView *v; CGFloat menubarHeight = [[GSTheme theme] menuHeightForWindow: _window]; while ((v = [e nextObject]) != nil) { if ([v isKindOfClass: [NSMenuView class]] == YES) { /* Unplug the menu view and return it so that it can be * restored to its original menu if necessary. */ hasMenu = NO; [RETAIN(v) removeFromSuperviewWithoutNeedingDisplay]; [self changeWindowHeight: -(menubarHeight)]; return (NSMenuView *)AUTORELEASE(v); } } return nil; } @end @implementation GSBackendWindowDecorationView + (void) offsets: (float *)l : (float *)r : (float *)t : (float *)b forStyleMask: (NSUInteger)style { [GSCurrentServer() styleoffsets: l : r : t : b : style]; } + (CGFloat) minFrameWidthWithTitle: (NSString *)aTitle styleMask: (NSUInteger)aStyle { /* TODO: we could at least guess... */ return 0.0; } @end gnustep-gui-0.24.0/Source/NSControl.m0000664000076500007650000007012312102166206017240 0ustar brains99brains99/** NSControl The abstract control class Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Richard Frith-Macdonald Date: August 1998 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #import #import #import #import #import #import #import "AppKit/NSActionCell.h" #import "AppKit/NSApplication.h" #import "AppKit/NSCell.h" #import "AppKit/NSControl.h" #import "AppKit/NSColor.h" #import "AppKit/NSEvent.h" #import "AppKit/NSFont.h" #import "AppKit/NSFontManager.h" #import "AppKit/NSKeyValueBinding.h" #import "AppKit/NSTextStorage.h" #import "AppKit/NSTextView.h" #import "AppKit/NSWindow.h" #import "GSBindingHelpers.h" #import "NSViewPrivate.h" /* * Class variables */ static Class usedCellClass; static Class cellClass; static Class actionCellClass; static NSNotificationCenter *nc; /**

TODO Description

*/ @implementation NSControl /* * Class methods */ + (void) initialize { if (self == [NSControl class]) { [self setVersion: 1]; cellClass = [NSCell class]; usedCellClass = cellClass; actionCellClass = [NSActionCell class]; // Cache the notifiaction centre for editing notifications nc = [NSNotificationCenter defaultCenter]; // expose bindings [self exposeBinding: NSValueBinding]; [self exposeBinding: NSEnabledBinding]; [self exposeBinding: NSAlignmentBinding]; [self exposeBinding: NSFontBinding]; [self exposeBinding: NSFontNameBinding]; [self exposeBinding: NSFontSizeBinding]; } } /**

Returns the cell Class used by NSControl. Used by subclasses.

See Also: +setCellClass:

*/ + (Class) cellClass { return usedCellClass; } /**

Sets the cell Class used by NSControl to factoryId. Used by subclasses.

See Also: +setCellClass:

*/ + (void) setCellClass: (Class)factoryId { usedCellClass = factoryId ? factoryId : cellClass; } /**

Initializes and returns a new NSControl into the rectangle frameRect and create a new associated NSCell

See Also: -setCell:

*/ - (id) initWithFrame: (NSRect)frameRect { NSCell *cell = [[[self class] cellClass] new]; [super initWithFrame: frameRect]; [self setCell: cell]; RELEASE(cell); //_tag = 0; return self; } - (void) dealloc { RELEASE(_cell); [super dealloc]; } /**

Returns the NSControl's cell.

See Also: -setCell:

*/ - (id) cell { return _cell; } /**

Sets the NSControl's cell to aCell, Raises an NSInvalidArgumentException exception if aCell is not nil and if it is not a cell class.

See Also: -cell

*/ - (void) setCell: (NSCell *)aCell { if (aCell != nil && [aCell isKindOfClass: cellClass] == NO) [NSException raise: NSInvalidArgumentException format: @"attempt to set non-cell object for control cell"]; ASSIGN(_cell, aCell); } /**

Returns whether the selected cell of the NSControl is enabled.

See Also: -setEnabled: [NSCell-isEnabled]

*/ - (BOOL) isEnabled { return [[self selectedCell] isEnabled]; } /**

Sets whether the NSControl's selected cell is enabled. If flag is NO, this method abort the editing. This method marks self for display.

See Also: -isEnabled [NSCell-setEnabled:]

*/ - (void) setEnabled: (BOOL)flag { [[self selectedCell] setEnabled: flag]; if (!flag) [self abortEditing]; [self setNeedsDisplay: YES]; } /**

Returns the NSControl's selected cell.

*/ - (id) selectedCell { return _cell; } /**

Returns the tag of the NSControl's selected cell (if exists). -1 otherwise.

See Also: [NSCell-tag]

*/ - (NSInteger) selectedTag { NSCell *selected = [self selectedCell]; if (selected == nil) return -1; else return [selected tag]; } /**

Returns the value of the NSControl's selected cell as double.

See Also: -setDoubleValue: [NSCell-doubleValue] -intValue -floatValue -doubleValue -stringValue

*/ - (double) doubleValue { // The validation is performed by the NSActionCell return [[self selectedCell] doubleValue]; } /**

Returns the value of the NSControl's selected cell as float.

See Also: -setFloatValue: [NSCell-floatValue] -intValue -stringValue -doubleValue

*/ - (float) floatValue { return [[self selectedCell] floatValue]; } /**

Returns the value of the NSControl's selected cell as int.

See Also: -setIntValue: [NSCell-intValue] -floatValue -doubleValue -stringValue

*/ - (int) intValue { return [[self selectedCell] intValue]; } /**

Returns the value of the NSControl's selected cell as int.

See Also: -setIntegerValue: [NSCell-integerValue] -floatValue -doubleValue -stringValue

*/ - (NSInteger) integerValue { return [[self selectedCell] integerValue]; } /**

Returns the value of the NSControl's selected cell as NSString.

See Also: -setStringValue: [NSCell-stringValue] -intValue -floatValue -doubleValue -stringValue

*/ - (NSString *) stringValue { return [[self selectedCell] stringValue]; } - (id) objectValue { return [[self selectedCell] objectValue]; } /**

Sets the value of the NSControl's selected cell to double. If the selected cell is an action cell, it marks self for display.

See Also: -doubleValue [NSCell-setDoubleValue:] -setIntValue: -setStringValue: -setFloatValue:

*/ - (void) setDoubleValue: (double)aDouble { NSCell *selected = [self selectedCell]; BOOL wasEditing = [self abortEditing]; [selected setDoubleValue: aDouble]; if (![selected isKindOfClass: actionCellClass]) [self setNeedsDisplay: YES]; if (wasEditing) { [[self window] makeFirstResponder: self]; } } /**

Sets the value of the NSControl's selected cell to float. If the selected cell is an action cell, it marks self for display.

See Also: -floatValue [NSCell-setFloatValue:] -setIntValue: -setStringValue: -setDoubleValue:

*/ - (void) setFloatValue: (float)aFloat { NSCell *selected = [self selectedCell]; BOOL wasEditing = [self abortEditing]; [selected setFloatValue: aFloat]; if (![selected isKindOfClass: actionCellClass]) [self setNeedsDisplay: YES]; if (wasEditing) { [[self window] makeFirstResponder: self]; } } /**

Sets the value of the NSControl's selected cell to int. If the selected cell is an action cell, it marks self for display.

See Also: -intValue [NSCell-setIntValue:] -setDoubleValue: -setFloatValue: -setStringValue:

*/ - (void) setIntValue: (int)anInt { NSCell *selected = [self selectedCell]; BOOL wasEditing = [self abortEditing]; [selected setIntValue: anInt]; if (![selected isKindOfClass: actionCellClass]) [self setNeedsDisplay: YES]; if (wasEditing) { [[self window] makeFirstResponder: self]; } } /**

Sets the value of the NSControl's selected cell to int. If the selected cell is an action cell, it marks self for display.

See Also: -integerValue [NSCell-setIntegerValue:] -setDoubleValue: -setFloatValue: -setStringValue:

*/ - (void) setIntegerValue: (NSInteger)anInt { NSCell *selected = [self selectedCell]; BOOL wasEditing = [self abortEditing]; [selected setIntegerValue: anInt]; if (![selected isKindOfClass: actionCellClass]) [self setNeedsDisplay: YES]; if (wasEditing) { [[self window] makeFirstResponder: self]; } } /**

Sets the value of the NSControl's selected cell to NSString. If the selected cell is an action cell, it marks self for display.

See Also: -stringValue [NSCell-setStringValue:] -setIntValue: -setFloatValue: -setDoubleValue:

*/ - (void) setStringValue: (NSString *)aString { NSCell *selected = [self selectedCell]; BOOL wasEditing = [self abortEditing]; [selected setStringValue: aString]; if (![selected isKindOfClass: actionCellClass]) [self setNeedsDisplay: YES]; if (wasEditing) { [[self window] makeFirstResponder: self]; } } - (void) setObjectValue: (id)anObject { NSCell *selected = [self selectedCell]; BOOL wasEditing = [self abortEditing]; [selected setObjectValue: anObject]; if (![selected isKindOfClass: actionCellClass]) [self setNeedsDisplay: YES]; if (wasEditing) { [[self window] makeFirstResponder: self]; } } /**

Marks self for display.

*/ - (void) setNeedsDisplay { [super setNeedsDisplay: YES]; } /**

Sets the NSControl's selected cell to the sender's double value.

See Also: [NSCell-takeDoubleValueFrom:] -takeFloatValueFrom: takeIntValueFrom: takeStringValueFrom:

*/ - (void) takeDoubleValueFrom: (id)sender { [[self selectedCell] takeDoubleValueFrom: sender]; [self setNeedsDisplay: YES]; } /**

Sets the NSControl's selected cell to the sender's float value.

See Also: [NSCell-takeDoubleValueFrom:] -takeDoubleValueFrom: -takeIntValueFrom: -takeStringValueFrom:

*/ - (void) takeFloatValueFrom: (id)sender { [[self selectedCell] takeFloatValueFrom: sender]; [self setNeedsDisplay: YES]; } /**

Sets the NSControl's selected cell to the sender's float int.

See Also: [NSCell-takeIntValueFrom:] -takeDoubleValueFrom: -takeFloatValueFrom: -takeStringValueFrom:

*/ - (void) takeIntValueFrom: (id)sender { [[self selectedCell] takeIntValueFrom: sender]; [self setNeedsDisplay: YES]; } /**

Sets the NSControl's selected cell to the sender's float int.

See Also: [NSCell-takeIntegerValueFrom:] -takeDoubleValueFrom: -takeFloatValueFrom: -takeStringValueFrom:

*/ - (void) takeIntegerValueFrom: (id)sender { [[self selectedCell] takeIntegerValueFrom: sender]; [self setNeedsDisplay: YES]; } - (void) takeObjectValueFrom: (id)sender { [[self selectedCell] takeObjectValueFrom: sender]; [self setNeedsDisplay: YES]; } /**

Sets the NSControl's selected cell to the sender's float int.

See Also: [NSCell-takeDoubleValueFrom:] -takeDoubleValueFrom: -takeFloatValueFrom: -takeIntValueFrom:

*/ - (void) takeStringValueFrom: (id)sender { [[self selectedCell] takeStringValueFrom: sender]; [self setNeedsDisplay: YES]; } /**

Returns the alignment of the text in the NSControl's cell. Returns NSNaturalTextAlignment if the cell does not exists. See NSTextAlignment for more informations.

See Also: -setAlignment: [NSCell-alignment]

*/ - (NSTextAlignment) alignment { if (_cell) return [_cell alignment]; else return NSNaturalTextAlignment; } /**

Returns the font of the text in the NSControl's cell. Returns nil if the cell does not exists.

See Also: -setFont: [NSCell-font]

*/ - (NSFont *) font { if (_cell) return [_cell font]; else return nil; } /**

Sets the alignment of the text in the NSControl's cell to mode. This method abort the editing and marks self for display if the cell is an NSActionCell. See NSTextAlignment for more informations.

See Also: -alignment [NSCell-setAlignment:] -abortEditing

*/ - (void) setAlignment: (NSTextAlignment)mode { if (_cell) { [self abortEditing]; [_cell setAlignment: mode]; if (![_cell isKindOfClass: actionCellClass]) [self setNeedsDisplay: YES]; } } /**

Sets the font of the text in the NSControl's cell and the editor object (if exists) to fontObject.

See Also: -font [NSCell-setFont:] -currentEditor

*/ - (void) setFont: (NSFont *)fontObject { if (_cell) { NSText *editor = [self currentEditor]; [_cell setFont: fontObject]; if (editor != nil) [editor setFont: fontObject]; } } - (void) setFloatingPointFormat: (BOOL)autoRange left: (NSUInteger)leftDigits right: (NSUInteger)rightDigits { [self abortEditing]; [_cell setFloatingPointFormat: autoRange left: leftDigits right: rightDigits]; if (![_cell isKindOfClass: actionCellClass]) [self setNeedsDisplay: YES]; } - (void) setFormatter: (NSFormatter*)newFormatter { if (_cell) { [_cell setFormatter: newFormatter]; if (![_cell isKindOfClass: actionCellClass]) [self setNeedsDisplay: YES]; } } - (id) formatter { return [_cell formatter]; } - (NSWritingDirection) baseWritingDirection { return [_cell baseWritingDirection]; } - (void) setBaseWritingDirection: (NSWritingDirection)direction { if (_cell) { [_cell setBaseWritingDirection: direction]; if (![_cell isKindOfClass: actionCellClass]) [self setNeedsDisplay: YES]; } } /**

Sends an [NSCell-endEditing:] message to the current object used to edit the NSControl. Returns NO if the the currentEditor does not exists, YES otherwise.

*/ - (BOOL) abortEditing { NSText *text; text = [self currentEditor]; if (text == nil) { return NO; } [[self selectedCell] endEditing: text]; return YES; } /**

Returns the NSText object used when editing the NSControl.

*/ - (NSText *) currentEditor { if (_cell != nil) { NSText *text; text = [_window fieldEditor: NO forObject: self]; if (([text delegate] == self) && ([_window firstResponder] == text)) { return text; } } return nil; } /** */ - (void) validateEditing { NSText *text; text = [self currentEditor]; if (text == nil) { return; } if ([text isRichText]) { NSAttributedString *attr; NSTextStorage *storage; int len; storage = [(NSTextView*)text textStorage]; len = [storage length]; attr = [storage attributedSubstringFromRange: NSMakeRange(0, len)]; [[self selectedCell] setAttributedStringValue: attr]; } else { NSString *string; string = AUTORELEASE([[text string] copy]); [[self selectedCell] setStringValue: string]; } } /* * Text delegate methods */ /**

Invokes when the text cell starts to be editing.This methods posts a NSControlTextDidBeginEditingNotification with a dictionary containing the NSFieldEditor as user info

See Also: [NSNotificationCenter-postNotificationName:object:userInfo:]

*/ - (void) textDidBeginEditing: (NSNotification *)aNotification { NSMutableDictionary *dict; dict = [[NSMutableDictionary alloc] initWithDictionary: [aNotification userInfo]]; [dict setObject: [aNotification object] forKey: @"NSFieldEditor"]; [nc postNotificationName: NSControlTextDidBeginEditingNotification object: self userInfo: dict]; RELEASE(dict); } /**

Invokes when the text cell is changed. This methods posts a NSControlTextDidChangeNotification with a dictionary containing the NSFieldEditor as user info

See Also: [NSNotificationCenter-postNotificationName:object:userInfo:]

*/ - (void) textDidChange: (NSNotification *)aNotification { NSMutableDictionary *dict; dict = [[NSMutableDictionary alloc] initWithDictionary: [aNotification userInfo]]; [dict setObject: [aNotification object] forKey: @"NSFieldEditor"]; [nc postNotificationName: NSControlTextDidChangeNotification object: self userInfo: dict]; RELEASE(dict); } /**

Invokes when the text cell is changed. This methods posts a NSControlTextDidEndEditingNotification a dictionary containing the NSFieldEditor as user info

See Also: [NSNotificationCenter-postNotificationName:object:userInfo:]

*/ - (void) textDidEndEditing: (NSNotification *)aNotification { NSMutableDictionary *dict; [self validateEditing]; [self abortEditing]; dict = [[NSMutableDictionary alloc] initWithDictionary: [aNotification userInfo]]; [dict setObject: [aNotification object] forKey: @"NSFieldEditor"]; [nc postNotificationName: NSControlTextDidEndEditingNotification object: self userInfo: dict]; RELEASE(dict); } /**

Recalculates the internal size by sending [NSCell-calcDrawInfo:] to the cell.

*/ - (void) calcSize { [_cell calcDrawInfo: [self bounds]]; } /**

Resizes the NSControl to fits the NSControl's cell size.

See Also: [NSCell-cellSize]

*/ - (void) sizeToFit { [self setFrameSize: [_cell cellSize]]; } /**

Returns whether the NSControl's cell is opaque

*/ - (BOOL) isOpaque { return [_cell isOpaque]; } - (void) drawRect: (NSRect)aRect { [self drawCell: _cell]; } /**

Redraws a aCell if it is the NSControl's cell.

See Also: -setCell: [NSCell-drawWithFrame:inView:]

*/ - (void) drawCell: (NSCell *)aCell { if (_cell == aCell) { [_cell drawWithFrame: _bounds inView: self]; } } /**

Redraws a aCell's inside if it is the NSControl's cell.

See Also: -setCell: [NSCell-drawInteriorWithFrame:inView:]

*/ - (void) drawCellInside: (NSCell *)aCell { if (_cell == aCell) { [_cell drawInteriorWithFrame: _bounds inView: self]; } } /**

Sets the aCell's state to NSOnState and marks self for display if it is the NSControl's cell.

*/ - (void) selectCell: (NSCell *)aCell { if (_cell == aCell) { [_cell setState: NSOnState]; [self setNeedsDisplay: YES]; } } /**

Marks self for display.

*/ - (void) updateCell: (NSCell *)aCell { [self setNeedsDisplay: YES]; } /**

Marks self for display.

*/ - (void) updateCellInside: (NSCell *)aCell { [self setNeedsDisplay: YES]; } /**

Returns the NSControl's cell action method.

See Also: -setAction: [NSCell-action]

*/ - (SEL) action { return [_cell action]; } /**

Returns whether the NSControl's cell can continuously sends its action message.

See Also: -setContinuous: [NSCell-isContinuous]

*/ - (BOOL) isContinuous { return [_cell isContinuous]; } /**

Asks the NSApplication to send an action theAction with theTarget as target to NSControl. Returns NO if theAction is nil or if NSApplication can not send the action.

See Also: [NSApplication-sendAction:to:from:]

*/ - (BOOL) sendAction: (SEL)theAction to: (id)theTarget { GSKeyValueBinding *theBinding; theBinding = [GSKeyValueBinding getBinding: NSValueBinding forObject: self]; if (theBinding != nil) [theBinding reverseSetValueFor: @"objectValue"]; if (theAction) return [NSApp sendAction: theAction to: theTarget from: self]; else return NO; } - (NSInteger) sendActionOn: (NSInteger)mask { return [_cell sendActionOn: mask]; } /**

Sets the NSControl's cell action method.

See Also: -action [NSCell-setAction:]

*/ - (void) setAction: (SEL)aSelector { [_cell setAction: aSelector]; } /**

Sets whether the NSControl's cell can continuously sends its action message.

See Also: -isContinuous [NSCell-setContinuous:]

*/ - (void) setContinuous: (BOOL)flag { [_cell setContinuous: flag]; } /**

Sets the target object of the NSControl's cell to anObject.

See Also: -target [NSCell-setTarget:]

*/ - (void) setTarget: (id)anObject { [_cell setTarget: anObject]; } /**

Returns the target object of the NSControl's cell.

See Also: -setTarget: [NSCell-target]

*/ - (id) target { return [_cell target]; } /* * Attributed string handling */ - (void) setAttributedStringValue: (NSAttributedString*)attribStr { NSCell *selected = [self selectedCell]; [self abortEditing]; [selected setAttributedStringValue: attribStr]; if (![selected isKindOfClass: actionCellClass]) [self setNeedsDisplay: YES]; } - (NSAttributedString*) attributedStringValue { NSCell *selected = [self selectedCell]; if (selected == nil) { return AUTORELEASE([NSAttributedString new]); } // As this method is not defined for NSActionCell, we have // to do the validation here. [self validateEditing]; return [selected attributedStringValue]; } /** Assigning a Tag */ - (void) setTag: (NSInteger)anInt { _tag = anInt; } /**

Returns the NSControl tag

See Also: -setTag:

*/ - (NSInteger) tag { return _tag; } /* * Activation */ /** * Simulates a single mouse click on the control. This method calls the cell's * method performClickWithFrame:inView:. Take note that sender is not * used. */ - (void) performClick: (id)sender { [_cell performClickWithFrame: [self bounds] inView: self]; } - (BOOL) refusesFirstResponder { return [[self selectedCell] refusesFirstResponder]; } - (void) setRefusesFirstResponder:(BOOL)flag { [[self selectedCell] setRefusesFirstResponder: flag]; } - (BOOL) acceptsFirstResponder { return [[self selectedCell] acceptsFirstResponder]; } - (void) mouseDown: (NSEvent *)theEvent { unsigned int event_mask = NSLeftMouseDownMask | NSLeftMouseUpMask | NSMouseMovedMask | NSLeftMouseDraggedMask | NSOtherMouseDraggedMask | NSRightMouseDraggedMask; NSEvent *e = nil; // If not enabled ignore mouse clicks if (![self isEnabled]) { [super mouseDown: theEvent]; return; } // Ignore multiple clicks, if configured to do so if (_ignoresMultiClick && ([theEvent clickCount] > 1)) { [super mouseDown: theEvent]; return; } // Make sure self does not go away during the processing of the event RETAIN(self); // loop until mouse goes up e = theEvent; while (1) { NSPoint location = [self convertPoint: [e locationInWindow] fromView: nil]; // ask the cell to track the mouse only, // if the mouse is within the cell if ([self mouse: location inRect: _bounds]) { BOOL done; [_cell setHighlighted: YES]; [self setNeedsDisplay: YES]; done = [_cell trackMouse: e inRect: _bounds ofView: self untilMouseUp: [[_cell class] prefersTrackingUntilMouseUp]]; [_cell setHighlighted: NO]; [self setNeedsDisplay: YES]; if (done) { break; } } e = [NSApp nextEventMatchingMask: event_mask untilDate: [NSDate distantFuture] inMode: NSEventTrackingRunLoopMode dequeue: YES]; if ([e type] == NSLeftMouseUp) { break; } } // undo initial retain RELEASE(self); } - (BOOL) shouldBeTreatedAsInkEvent: (NSEvent *)theEvent { return NO; } - (void) resetCursorRects { [_cell resetCursorRect: _bounds inView: self]; } /**

Returns wheter multiple clicks are ignored.

See Also: -setIgnoresMultiClick: -mouseDown:

*/ - (BOOL) ignoresMultiClick { return _ignoresMultiClick; } /**

Sets wheter multiple clicks are ignored.

See Also: -ignoresMultiClick -mouseDown:

*/ - (void) setIgnoresMultiClick: (BOOL)flag { _ignoresMultiClick = flag; } /**

Returns the mouse flags. This flags are usally sets in the NSCell-trackMouse:inRect:ofView:untilMouseUp: method.

This is a NeXTStep 3.3 method, no longer officially supported.

*/ - (NSInteger) mouseDownFlags { return [[self selectedCell] mouseDownFlags]; } /* * NSCoding protocol */ - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { [aCoder encodeObject: [self cell] forKey: @"NSCell"]; [aCoder encodeBool: [self isEnabled] forKey: @"NSEnabled"]; if (_tag) { [aCoder encodeInt: [self tag] forKey: @"NSTag"]; } } else { [aCoder encodeValueOfObjCType: @encode(int) at: &_tag]; [aCoder encodeObject: _cell]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_ignoresMultiClick]; } } - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if (self == nil) { return nil; } if ([aDecoder allowsKeyedCoding]) { NSCell *cell = [aDecoder decodeObjectForKey: @"NSCell"]; if (cell != nil) { [self setCell: cell]; } else { // This is needed for subclasses without cells, like NSColorWeel // as we store some properties only on the cell. cell = [[[self class] cellClass] new]; [self setCell: cell]; RELEASE(cell); } if ([aDecoder containsValueForKey: @"NSEnabled"]) { [self setEnabled: [aDecoder decodeBoolForKey: @"NSEnabled"]]; } if ([aDecoder containsValueForKey: @"NSTag"]) { int tag = [aDecoder decodeIntForKey: @"NSTag"]; [self setTag: tag]; } } else { [aDecoder decodeValueOfObjCType: @encode(int) at: &_tag]; [aDecoder decodeValueOfObjCType: @encode(id) at: &_cell]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_ignoresMultiClick]; } return self; } - (void) bind: (NSString *)binding toObject: (id)anObject withKeyPath: (NSString *)keyPath options: (NSDictionary *)options { if ([binding isEqual: NSValueBinding]) { GSKeyValueBinding *kvb; [self unbind: binding]; kvb = [[GSKeyValueBinding alloc] initWithBinding: @"objectValue" withName: NSValueBinding toObject: anObject withKeyPath: keyPath options: options fromObject: self]; // The binding will be retained in the binding table RELEASE(kvb); } else if ([binding hasPrefix: NSEnabledBinding]) { GSKeyValueBinding *kvb; [self unbind: binding]; kvb = [[GSKeyValueAndBinding alloc] initWithBinding: NSEnabledBinding withName: binding toObject: anObject withKeyPath: keyPath options: options fromObject: self]; // The binding will be retained in the binding table RELEASE(kvb); } else { [super bind: binding toObject: anObject withKeyPath: keyPath options: options]; } } - (void) setValue: (id)anObject forKey: (NSString*)aKey { if ([aKey isEqual: NSFontNameBinding]) { [self setFont: [[NSFontManager sharedFontManager] convertFont: [self font] toFace: anObject]]; } else if ([aKey isEqual: NSFontSizeBinding]) { [self setFont: [[NSFontManager sharedFontManager] convertFont: [self font] toSize: [anObject doubleValue]]]; } else { [super setValue: anObject forKey: aKey]; } } - (id) valueForKey: (NSString*)aKey { if ([aKey isEqual: NSFontNameBinding]) { return [[self font] fontName]; } else if ([aKey isEqual: NSFontSizeBinding]) { return [NSNumber numberWithDouble: (double)[[self font] pointSize]]; } else { return [super valueForKey: aKey]; } } @end @implementation NSControl(KeyViewLoop) - (void) _setUpKeyViewLoopWithNextKeyView: (NSView *)nextKeyView { // Controls are expected to have no subviews //NSLog(@"%@@%p -_setUpKeyViewLoopWithKeyKeyView:%@@%p", [self class], self, [nextKeyView class], nextKeyView); [self setNextKeyView: nextKeyView]; } @end gnustep-gui-0.24.0/Source/NSToolbarFrameworkPrivate.h0000664000076500007650000001103311707267156022441 0ustar brains99brains99/* NSToolbarFrameworkPrivate.h Private methods used throughout the toolbar classes. Copyright (C) 2009 Free Software Foundation, Inc. Author: Fred Kiefer Date: January 2009 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _NSToolbarFrameworkPrivate_h_INCLUDE #define _NSToolbarFrameworkPrivate_h_INCLUDE #import "AppKit/NSMenuView.h" #import "AppKit/NSToolbar.h" #import "AppKit/NSToolbarItem.h" #import "GNUstepGUI/GSToolbarView.h" #import "GNUstepGUI/GSWindowDecorationView.h" @interface GSToolbarView (GNUstepPrivate) - (void) _reload; // Accessors - (float) _heightFromLayout; - (NSArray *) _visibleBackViews; - (BOOL) _usesStandardBackgroundColor; - (void) _setUsesStandardBackgroundColor: (BOOL)standard; @end @interface NSToolbarItem (GNUstepPrivate) - (void) _layout; - (void) _computeFlags; // Accessors - (NSView *) _backView; - (NSMenuItem *) _defaultMenuFormRepresentation; - (BOOL) _isModified; - (BOOL) _isFlexibleSpace; - (BOOL) _selectable; - (void) _setSelectable: (BOOL)selectable; - (BOOL) _selected; - (void) _setSelected: (BOOL)selected; - (void) _setToolbar: (NSToolbar *)toolbar; @end @interface NSToolbar (GNUstepPrivate) // Private class method + (NSArray *) _toolbarsWithIdentifier: (NSString *)identifier; // Private methods with broadcast support - (void) _insertItemWithItemIdentifier: (NSString *)itemIdentifier atIndex: (int)index broadcast: (BOOL)broadcast; - (void) _removeItemAtIndex: (int)index broadcast: (BOOL)broadcast; - (void) _setAllowsUserCustomization: (BOOL)flag broadcast: (BOOL)broadcast; - (void) _setAutosavesConfiguration: (BOOL)flag broadcast: (BOOL)broadcast; - (void) _setConfigurationFromDictionary: (NSDictionary *)configDict broadcast: (BOOL)broadcast; - (void) _moveItemFromIndex: (int)index toIndex: (int)newIndex broadcast: (BOOL)broadcast; - (void) _setDisplayMode: (NSToolbarDisplayMode)displayMode broadcast: (BOOL)broadcast; - (void) _setSizeMode: (NSToolbarSizeMode)sizeMode broadcast: (BOOL)broadcast; - (void) _setVisible: (BOOL)shown broadcast: (BOOL)broadcast; // Few other private methods - (void) _build; - (int) _indexOfItem: (NSToolbarItem *)item; - (void) _concludeRemoveItem: (NSToolbarItem *)item atIndex: (int)index broadcast: (BOOL)broadcast; - (void) _insertPassivelyItem: (NSToolbarItem *)item atIndex: (int)newIndex; - (void) _performRemoveItem: (NSToolbarItem *)item; // Used by drag setup - (NSToolbar *) _toolbarModel; - (void) _validate: (NSWindow *)observedWindow; - (void) _toolbarViewWillMoveToSuperview: (NSView *)newSuperview; - (void) _saveConfig; - (void) _resetConfig; - (NSArray *) _itemsFromConfig; - (BOOL) _containsItemWithIdentifier: (NSString *) identifier; // Accessors - (void) _setCustomizationPaletteIsRunning: (BOOL)isRunning; - (void) _setToolbarView: (GSToolbarView *)toolbarView; - (GSToolbarView *) _toolbarView; // Deprecated - (void) setUsesStandardBackgroundColor: (BOOL)standard; - (BOOL) usesStandardBackgroundColor; // Delegate wrappers - (NSArray *) _allowedItemIdentifiers; - (NSArray *) _defaultItemIdentifiers; - (NSArray *) _selectableItemIdentifiers; - (NSToolbarItem *) _toolbarItemForIdentifier: (NSString *)itemIdent willBeInsertedIntoToolbar: (BOOL)insert; @end @interface GSWindowDecorationView (ToolbarPrivate) - (void) addToolbarView: (GSToolbarView*)toolbarView; - (void) removeToolbarView: (GSToolbarView *)toolbarView; - (void) adjustToolbarView: (GSToolbarView *)toolbarView; @end @interface GSWindowDecorationView (Menu) - (void) addMenuView: (NSMenuView*)menuView; - (NSMenuView*) removeMenuView; @end #endif // _NSToolbarFrameworkPrivate_h_INCLUDE gnustep-gui-0.24.0/Source/NSText.m0000664000076500007650000002702712107776031016561 0ustar brains99brains99/** NSText The RTFD text class Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Felipe A. Rodriguez Date: July 1998 Author: Daniel Boehringer Date: August 1998 Author: Fred Kiefer Date: March 2000 Reorganised and cleaned up code, added some action methods Author: Nicola Pero Date: December 2000 Made class abstract, moved most code to NSTextView. 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "AppKit/NSText.h" #import "AppKit/NSAttributedString.h" #import "AppKit/NSPanel.h" #import "AppKit/NSSpellChecker.h" #import "AppKit/NSTextView.h" static Class abstract; static Class concrete; @implementation NSText /* * Class methods */ + (void)initialize { if (self == [NSText class]) { [self setVersion: 1]; abstract = self; concrete = [NSTextView class]; } } + (id) allocWithZone: (NSZone*)zone { if (self == abstract) return NSAllocateObject (concrete, 0, zone); else return NSAllocateObject (self, 0, zone); } /* * Instance methods */ /* * Getting and Setting Contents */ - (void) replaceCharactersInRange: (NSRange)aRange withRTF: (NSData *)rtfData { NSAttributedString *attr; attr = [[NSAttributedString alloc] initWithRTF: rtfData documentAttributes: NULL]; AUTORELEASE (attr); [self replaceCharactersInRange: aRange withAttributedString: attr]; } - (void) replaceCharactersInRange: (NSRange)aRange withRTFD: (NSData *)rtfdData { NSAttributedString *attr; attr = [[NSAttributedString alloc] initWithRTFD: rtfdData documentAttributes: NULL]; AUTORELEASE (attr); [self replaceCharactersInRange: aRange withAttributedString: attr]; } /* PRIMITIVE */ - (void) replaceCharactersInRange: (NSRange)aRange withString: (NSString*)aString { [self subclassResponsibility: _cmd]; } /* PRIMITIVE */ - (void) replaceCharactersInRange: (NSRange)aRange withAttributedString: (NSAttributedString*)attrString { [self subclassResponsibility: _cmd]; } /* PRIMITIVE */ - (NSData*) RTFDFromRange: (NSRange)aRange { [self subclassResponsibility: _cmd]; return nil; } /* PRIMITIVE */ - (NSData*) RTFFromRange: (NSRange)aRange { [self subclassResponsibility: _cmd]; return nil; } /* TODO: is this correct? seems that this would use the attributes of the old text. */ - (void) setString: (NSString*)aString { [self replaceCharactersInRange: NSMakeRange (0, [self textLength]) withString: aString]; } /* PRIMITIVE */ - (NSString*) string { [self subclassResponsibility: _cmd]; return nil; } /* * old OpenStep methods doing the same */ - (void) replaceRange: (NSRange)aRange withRTFD: (NSData*)rtfdData { [self replaceCharactersInRange: aRange withRTFD: rtfdData]; } - (void) replaceRange: (NSRange)aRange withRTF: (NSData*)rtfData { [self replaceCharactersInRange: aRange withRTF: rtfData]; } - (void) replaceRange: (NSRange)aRange withString: (NSString*)aString { [self replaceCharactersInRange: aRange withString: aString]; } - (void) setText: (NSString*)aString range: (NSRange)aRange { [self replaceCharactersInRange: aRange withString: aString]; } - (void) setText: (NSString*)aString { [self setString: aString]; } - (NSString*) text { return [self string]; } /* * Graphic attributes */ /* PRIMITIVE */ - (NSColor*) backgroundColor { [self subclassResponsibility: _cmd]; return nil; } /* PRIMITIVE */ - (BOOL) drawsBackground { [self subclassResponsibility: _cmd]; return NO; } /* PRIMITIVE */ - (void) setBackgroundColor: (NSColor*)color { [self subclassResponsibility: _cmd]; } /* PRIMITIVE */ - (void) setDrawsBackground: (BOOL)flag { [self subclassResponsibility: _cmd]; } /* * Managing Global Characteristics */ /* PRIMITIVE */ - (BOOL) importsGraphics { [self subclassResponsibility: _cmd]; return NO; } /* PRIMITIVE */ - (BOOL) isEditable { [self subclassResponsibility: _cmd]; return NO; } /* PRIMITIVE */ - (BOOL) isFieldEditor { [self subclassResponsibility: _cmd]; return NO; } /* PRIMITIVE */ - (BOOL) isRichText { [self subclassResponsibility: _cmd]; return NO; } /* PRIMITIVE */ - (BOOL) isSelectable { [self subclassResponsibility: _cmd]; return NO; } /* PRIMITIVE */ - (void) setEditable: (BOOL)flag { [self subclassResponsibility: _cmd]; } /* PRIMITIVE */ - (void) setFieldEditor: (BOOL)flag { [self subclassResponsibility: _cmd]; } /* PRIMITIVE */ - (void) setImportsGraphics: (BOOL)flag { [self subclassResponsibility: _cmd]; } /* PRIMITIVE */ - (void) setRichText: (BOOL)flag { [self subclassResponsibility: _cmd]; } /* PRIMITIVE */ - (void)setSelectable: (BOOL)flag { [self subclassResponsibility: _cmd]; } /* * Using the font panel */ /* PRIMITIVE */ - (BOOL) usesFontPanel { [self subclassResponsibility: _cmd]; return NO; } /* PRIMITIVE */ - (void) setUsesFontPanel: (BOOL)flag { [self subclassResponsibility: _cmd]; } /* * Managing the Ruler */ /* PRIMITIVE */ - (BOOL) isRulerVisible { [self subclassResponsibility: _cmd]; return NO; } /* PRIMITIVE */ - (void) toggleRuler: (id)sender { [self subclassResponsibility: _cmd]; } /* * Managing the Selection */ /* PRIMITIVE */ - (NSRange) selectedRange { [self subclassResponsibility: _cmd]; return NSMakeRange (NSNotFound, 0); } /* PRIMITIVE */ - (void) setSelectedRange: (NSRange)range { [self subclassResponsibility: _cmd]; } /* * Copy and paste */ /* PRIMITIVE */ - (void) copy: (id)sender { [self subclassResponsibility: _cmd]; } /* Copy the current font to the font pasteboard */ /* PRIMITIVE */ - (void) copyFont: (id)sender { [self subclassResponsibility: _cmd]; } /* Copy the current ruler settings to the ruler pasteboard */ /* PRIMITIVE */ - (void) copyRuler: (id)sender { [self subclassResponsibility: _cmd]; } /* PRIMITIVE */ - (void) delete: (id)sender { [self subclassResponsibility: _cmd]; } /* PRIMITIVE */ - (void) cut: (id)sender { [self copy: sender]; [self delete: sender]; } /* PRIMITIVE */ - (void) paste: (id)sender { [self subclassResponsibility: _cmd]; } /* PRIMITIVE */ - (void) pasteFont: (id)sender { [self subclassResponsibility: _cmd]; } /* PRIMITIVE */ - (void) pasteRuler: (id)sender { [self subclassResponsibility: _cmd]; } - (void) selectAll: (id)sender { [self setSelectedRange: NSMakeRange (0, [self textLength])]; } /* * Managing Font */ /* PRIMITIVE */ - (NSFont*) font { [self subclassResponsibility: _cmd]; return nil; } /* * This action method changes the font of the selection for a rich * text object, or of all text for a plain text object. If the * receiver doesn't use the Font Panel, however, this method does * nothing. */ /* PRIMITIVE */ - (void) changeFont: (id)sender { [self subclassResponsibility: _cmd]; } /* PRIMITIVE */ - (void) setFont: (NSFont*)font { [self subclassResponsibility: _cmd]; } /* PRIMITIVE */ - (void) setFont: (NSFont*)font range: (NSRange)aRange { [self subclassResponsibility: _cmd]; } - (void) setFont: (NSFont*)font ofRange: (NSRange)aRange { [self setFont: font range: aRange]; } /* * Managing Alingment */ /* PRIMITIVE */ - (NSTextAlignment) alignment { [self subclassResponsibility: _cmd]; return 0; } /* PRIMITIVE */ - (void) setAlignment: (NSTextAlignment)mode { [self subclassResponsibility: _cmd]; } /* PRIMITIVE */ - (void) alignCenter: (id)sender { [self subclassResponsibility: _cmd]; } /* PRIMITIVE */ - (void) alignLeft: (id)sender { [self subclassResponsibility: _cmd]; } /* PRIMITIVE */ - (void) alignRight: (id)sender { [self subclassResponsibility: _cmd]; } /* * Text colour */ /* PRIMITIVE */ - (NSColor*) textColor { [self subclassResponsibility: _cmd]; return nil; } /* PRIMITIVE */ - (void) setTextColor: (NSColor*)color { [self subclassResponsibility: _cmd]; } /* PRIMITIVE */ - (void) setTextColor: (NSColor*)color range: (NSRange)aRange { [self subclassResponsibility: _cmd]; } /* Old OpenStep method to do the same */ - (void) setColor: (NSColor*)color ofRange: (NSRange)aRange { [self setTextColor: color range: aRange]; } /* * Text attributes */ /* PRIMITIVE */ - (void) subscript: (id)sender { [self subclassResponsibility: _cmd]; } /* PRIMITIVE */ - (void) superscript: (id)sender { [self subclassResponsibility: _cmd]; } /* PRIMITIVE */ - (void) unscript: (id)sender { [self subclassResponsibility: _cmd]; } /* PRIMITIVE */ - (void) underline: (id)sender { [self subclassResponsibility: _cmd]; } /* * Reading and Writing RTFD Files */ /* PRIMITIVE */ - (BOOL) readRTFDFromFile: (NSString*)path { [self subclassResponsibility: _cmd]; return NO; } /* PRIMITIVE */ - (BOOL) writeRTFDToFile: (NSString*)path atomically: (BOOL)flag { [self subclassResponsibility: _cmd]; return NO; } /* * Sizing the Frame Rectangle */ /* PRIMITIVE */ - (BOOL) isHorizontallyResizable { [self subclassResponsibility: _cmd]; return NO; } /* PRIMITIVE */ - (BOOL) isVerticallyResizable { [self subclassResponsibility: _cmd]; return NO; } /* PRIMITIVE */ - (NSSize) maxSize { [self subclassResponsibility: _cmd]; return NSMakeSize(0,0); } /* PRIMITIVE */ - (NSSize) minSize { [self subclassResponsibility: _cmd]; return NSMakeSize(0,0); } /* PRIMITIVE */ - (void) setHorizontallyResizable: (BOOL)flag { [self subclassResponsibility: _cmd]; } /* PRIMITIVE */ - (void) setVerticallyResizable: (BOOL)flag { [self subclassResponsibility: _cmd]; } /* PRIMITIVE */ - (void) setMaxSize: (NSSize)newMaxSize { [self subclassResponsibility: _cmd]; } /* PRIMITIVE */ - (void) setMinSize: (NSSize)newMinSize { [self subclassResponsibility: _cmd]; } /* PRIMITIVE */ - (void) sizeToFit { [self subclassResponsibility: _cmd]; } /* * Spelling */ /* PRIMITIVE */ - (void) checkSpelling: (id)sender { [self subclassResponsibility: _cmd]; } - (void) showGuessPanel: (id)sender { NSSpellChecker *sp = [NSSpellChecker sharedSpellChecker]; [[sp spellingPanel] orderFront: self]; } /* * Scrolling */ /* PRIMITIVE */ - (void) scrollRangeToVisible: (NSRange)aRange { [self subclassResponsibility: _cmd]; } /* * Managing the Delegate */ /* PRIMITIVE */ - (id) delegate { [self subclassResponsibility: _cmd]; return nil; } /* PRIMITIVE */ - (void) setDelegate: (id)anObject { [self subclassResponsibility: _cmd]; } /* * NSChangeSpelling protocol */ /* PRIMITIVE */ - (void) changeSpelling: (id)sender { [self subclassResponsibility: _cmd]; } /* * NSIgnoreMisspelledWords protocol */ /* PRIMITIVE */ - (void) ignoreSpelling: (id)sender { [self subclassResponsibility: _cmd]; } @end @implementation NSText (GNUstepExtensions) /* PRIMITIVE */ - (NSUInteger) textLength { [self subclassResponsibility: _cmd]; return 0; } @end gnustep-gui-0.24.0/Source/NSActionCell.m0000664000076500007650000002223012110205434017625 0ustar brains99brains99/** NSActionCell Abstract cell for target/action paradigm Copyright (C) 1996-1999 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import "config.h" #import #import "AppKit/NSActionCell.h" #import "AppKit/NSControl.h" @implementation NSActionCell static Class controlClass; /* * Class methods */ + (void) initialize { if (self == [NSActionCell class]) { controlClass = [NSControl class]; [self setVersion: 1]; } } /* * Instance methods */ /* * Configuring an NSActionCell */ /** * Sets the alignment of text within the receiver. */ - (void) setAlignment: (NSTextAlignment)mode { [super setAlignment: mode]; if (_control_view) if ([_control_view isKindOfClass: controlClass]) [(NSControl *)_control_view updateCell: self]; } /** * If YES then the receiver is drawn with a bezeled border. */ - (void) setBezeled: (BOOL)flag { _cell.is_bezeled = flag; if (_cell.is_bezeled) _cell.is_bordered = NO; if (_control_view) if ([_control_view isKindOfClass: controlClass]) [(NSControl *)_control_view updateCell: self]; } /** * If YES then receiver is drawn with a border. */ - (void) setBordered: (BOOL)flag { _cell.is_bordered = flag; if (_cell.is_bordered) _cell.is_bezeled = NO; if (_control_view) if ([_control_view isKindOfClass: controlClass]) [(NSControl *)_control_view updateCell: self]; } /** * If YES then the receiver is capable of accepting input. */ - (void) setEnabled: (BOOL)flag { _cell.is_disabled = !flag; if (_control_view) if ([_control_view isKindOfClass: controlClass]) [(NSControl *)_control_view updateCell: self]; } - (void) setFloatingPointFormat: (BOOL)autoRange left: (NSUInteger)leftDigits right: (NSUInteger)rightDigits { [super setFloatingPointFormat: autoRange left: leftDigits right: rightDigits]; if (_control_view) if ([_control_view isKindOfClass: controlClass]) [(NSControl *)_control_view updateCell: self]; } /** * Sets the font to be used in the receiver. */ - (void) setFont: (NSFont*)fontObject { [super setFont: fontObject]; if (_control_view) if ([_control_view isKindOfClass: controlClass]) [(NSControl *)_control_view updateCell: self]; // TODO: This should also set the font of the text object, when selected } /** * Sets the image to be displayed in the receiver. */ - (void) setImage: (NSImage*)image { [super setImage: image]; if (_control_view) if ([_control_view isKindOfClass: controlClass]) [(NSControl *)_control_view updateCell: self]; } /* * Manipulating NSActionCell Values */ /** * Retrieve the value of the receiver */ - (id) objectValue { if (_cell.in_editing && _control_view) if ([_control_view isKindOfClass: controlClass]) [(NSControl *)_control_view validateEditing]; return [super objectValue]; } /** * Retrieve the value of the receiver as an NSAttributedString. */ - (NSAttributedString*) attributedStringValue { if (_cell.in_editing && _control_view) if ([_control_view isKindOfClass: controlClass]) [(NSControl *)_control_view validateEditing]; return [super attributedStringValue]; } /** * Retrieve the value of the receiver as an NSString. */ - (NSString *) stringValue { if (_cell.in_editing && _control_view) if ([_control_view isKindOfClass: controlClass]) [(NSControl *)_control_view validateEditing]; return [super stringValue]; } /** * Retrieve the value of the receiver as a double. */ - (double) doubleValue { if (_cell.in_editing && _control_view) if ([_control_view isKindOfClass: controlClass]) [(NSControl *)_control_view validateEditing]; return [super doubleValue]; } /** * Retrieve the value of the receiver as a float. */ - (float) floatValue { if (_cell.in_editing && _control_view) if ([_control_view isKindOfClass: controlClass]) [(NSControl *)_control_view validateEditing]; return [super floatValue]; } /** * Retrieve the value of the receiver as an int. */ - (int) intValue { if (_cell.in_editing && _control_view) if ([_control_view isKindOfClass: controlClass]) [(NSControl *)_control_view validateEditing]; return [super intValue]; } /** * Retrieve the value of the receiver as an NSInteger. */ - (NSInteger) integerValue { if (_cell.in_editing && _control_view) if ([_control_view isKindOfClass: controlClass]) [(NSControl *)_control_view validateEditing]; return [super integerValue]; } /** * Set the value of the receiver from anObject. */ - (void) setObjectValue: (id)anObject { [super setObjectValue: anObject]; if (_control_view) { if ([_control_view isKindOfClass: controlClass]) { if (_cell.in_editing) { [self _updateFieldEditor: [(NSControl *)_control_view currentEditor]]; } else { [(NSControl *)_control_view updateCell: self]; } } } } /** * Set the value of the receiver from aString. */ // This method is currently needed, as NSCells implementation // sometimes does not call setObjectValue: - (void) setStringValue: (NSString*)aString { [super setStringValue: aString]; if (_control_view) { if ([_control_view isKindOfClass: controlClass]) { if (_cell.in_editing) { [self _updateFieldEditor: [(NSControl *)_control_view currentEditor]]; } else { [(NSControl *)_control_view updateCell: self]; } } } } /* * Target and Action */ /** * Retrieve the action from the receiver. */ - (SEL) action { return _action; } /** * Set the action in the receiver as the selector aSelector. */ - (void) setAction: (SEL)aSelector { _action = aSelector; } /** * Set the target in the receiver as anObject. NSActionCell does not retain its target! */ - (void) setTarget: (id)anObject { _target = anObject; } /** * Return the target of the receiver. */ - (id) target { return _target; } /** * Assigning a Tag. */ - (void) setTag: (NSInteger)anInt { _tag = anInt; } /** * Return the tag. */ - (NSInteger) tag { return _tag; } /** * Returns the control view of the receiver. */ -(NSView *) controlView { return _control_view; } /** * Set the control view of the receiver. */ - (void) setControlView: (NSView*)view { _control_view = view; } - (void) drawWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { if (_control_view != controlView) _control_view = controlView; [super drawWithFrame: cellFrame inView: controlView]; } /* * NSCoding protocol */ - (void) encodeWithCoder: (NSCoder*)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { [aCoder encodeInteger: [self tag] forKey: @"NSTag"]; if ([self target] != nil) { [aCoder encodeObject: [self target] forKey: @"NSTarget"]; } if ([self action] != NULL) { [aCoder encodeObject: NSStringFromSelector([self action]) forKey: @"NSAction"]; } [aCoder encodeObject: _control_view forKey: @"NSControlView"]; } else { [aCoder encodeValueOfObjCType: @encode(NSInteger) at: &_tag]; [aCoder encodeConditionalObject: _target]; [aCoder encodeValueOfObjCType: @encode(SEL) at: &_action]; // This is only encoded for backward compatibility and won't be decoded. [aCoder encodeConditionalObject: nil]; } } - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if (!self) return nil; if ([aDecoder allowsKeyedCoding]) { if ([aDecoder containsValueForKey: @"NSTag"]) { [self setTag: [aDecoder decodeIntegerForKey: @"NSTag"]]; } if ([aDecoder containsValueForKey: @"NSTarget"]) { [self setTarget: [aDecoder decodeObjectForKey: @"NSTarget"]]; } if ([aDecoder containsValueForKey: @"NSAction"]) { NSString *action = [aDecoder decodeObjectForKey: @"NSAction"]; [self setAction: NSSelectorFromString(action)]; } } else { id dummy; [aDecoder decodeValueOfObjCType: @encode(NSInteger) at: &_tag]; _target = [aDecoder decodeObject]; [aDecoder decodeValueOfObjCType: @encode(SEL) at: &_action]; // Don't decode _control_view, as this may no longer be valid. dummy = [aDecoder decodeObject]; } return self; } @end gnustep-gui-0.24.0/Source/NSViewPrivate.h0000664000076500007650000000241312033252310020050 0ustar brains99brains99/* NSViewPrivate.h The private methods of the NSView classes Copyright (C) 2010 Free Software Foundation, Inc. This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSViewPrivate #define _GNUstep_H_NSViewPrivate #import "AppKit/NSView.h" @interface NSView (KeyViewLoop) - (void) _setUpKeyViewLoopWithNextKeyView: (NSView *)nextKeyView; - (void) _recursiveSetUpKeyViewLoopWithNextKeyView: (NSView *)nextKeyView; @end #endif // _GNUstep_H_NSViewPrivate gnustep-gui-0.24.0/Source/NSNibAXAttributeConnector.m0000664000076500007650000000401511115161522022314 0ustar brains99brains99/** NSNibAXAttributeConnector Copyright (C) 2007 Free Software Foundation, Inc. Author: Gregory John Casamento Date: 2007 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import @implementation NSNibAXAttributeConnector // Attribute name/type. - (NSString *) attributeType { return _attributeType; } - (void) setAttributeType: (NSString *)type { ASSIGN(_attributeType, type); } - (NSString *) attributeValue { return _attributeValue; } - (void) setAttributeValue: (NSString *)value { ASSIGN(_attributeValue, value); } // Source destination, connectors. - (id) destination { return _destination; } - (void) setDestination: (id)destination { ASSIGN(_destination, destination); } - (NSString *) label { return _label; } - (void) setLabel: (NSString *)label { ASSIGN(_label, label); } - (id) source { return _source; } - (void) setSource: (id)source { ASSIGN(_source, source); } // establish connection... - (void) establishConnection { } // archiving.... - (id) initWithCoder: (NSCoder *)coder { return self; } - (void) encodeWithCoder: (NSCoder *)coder { } - (void) dealloc { [super dealloc]; } @end gnustep-gui-0.24.0/Source/NSNibAXRelationshipConnector.m0000664000076500007650000000220211115161522023006 0ustar brains99brains99/** NSNibAXAttributeConnector Copyright (C) 2007 Free Software Foundation, Inc. Author: Gregory John Casamento Date: 2007 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import @implementation NSNibAXRelationshipConnector @end gnustep-gui-0.24.0/Source/NSViewController.m0000664000076500007650000001142612121442562020602 0ustar brains99brains99/* NSViewController.m Copyright (C) 2010 Free Software Foundation, Inc. Author: David Wetzel Date: 2010 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import "AppKit/NSKeyValueBinding.h" #import "AppKit/NSNib.h" #import "AppKit/NSView.h" #import "AppKit/NSViewController.h" @implementation NSViewController - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super init]; if (self == nil) return nil; ASSIGN(_nibName, nibNameOrNil); ASSIGN(_nibBundle, nibBundleOrNil); return self; } - (void) dealloc { // View Controllers are expect to release their own top-level objects [_topLevelObjects makeObjectsPerformSelector: @selector(release)]; DESTROY(_nibName); DESTROY(_nibBundle); DESTROY(_representedObject); DESTROY(_title); DESTROY(_topLevelObjects); DESTROY(_editors); DESTROY(_autounbinder); DESTROY(_designNibBundleIdentifier); DESTROY(view); [super dealloc]; } - (void)setRepresentedObject:(id)representedObject { ASSIGN(_representedObject, representedObject); } - (id)representedObject { return _representedObject; } - (void)setTitle:(NSString *)title { ASSIGN(_title, title); } - (NSString *)title { return _title; } - (NSView *)view { if (view == nil && !_vcFlags.nib_is_loaded) { [self loadView]; } return view; } - (void)setView:(NSView *)aView { if (view != aView) { ASSIGN(view, aView); } } - (void)loadView { NSNib *nib; if (_vcFlags.nib_is_loaded) { return; } nib = [[NSNib alloc] initWithNibNamed: [self nibName] bundle: [self nibBundle]]; if ((nib != nil) && [nib instantiateNibWithOwner: self topLevelObjects: &_topLevelObjects]) { _vcFlags.nib_is_loaded = YES; // FIXME: Need to resolve possible retain cycles here } else { if (_nibName != nil) { NSLog(@"%@: could not load nib named %@.nib", [self class], _nibName); } } RETAIN(_topLevelObjects); RELEASE(nib); } - (NSString *)nibName { return _nibName; } - (NSBundle *)nibBundle { return _nibBundle; } - (id) initWithCoder: (NSCoder *)aDecoder { self = [super initWithCoder: aDecoder]; if (!self) { return nil; } if ([aDecoder allowsKeyedCoding]) { NSView *aView = [aDecoder decodeObjectForKey: @"NSView"]; [self setView: aView]; } else { NSView *aView; [aDecoder decodeValueOfObjCType: @encode(id) at: &aView]; [self setView: aView]; } return self; } - (void) encodeWithCoder: (NSCoder *)aCoder { [super encodeWithCoder: aCoder]; if ([aCoder allowsKeyedCoding]) { [aCoder encodeObject: [self view] forKey: @"NSView"]; } else { [aCoder encodeObject: [self view]]; } } @end @implementation NSViewController (NSEditorRegistration) - (void) objectDidBeginEditing: (id)editor { // Add editor to _editors } - (void) objectDidEndEditing: (id)editor { // Remove editor from _editors } @end @implementation NSViewController (NSEditor) - (void)commitEditingWithDelegate:(id)delegate didCommitSelector:(SEL)didCommitSelector contextInfo:(void *)contextInfo { // Loop over all elements of _editors id editor = nil; BOOL res = [self commitEditing]; if (delegate && [delegate respondsToSelector: didCommitSelector]) { void (*didCommit)(id, SEL, id, BOOL, void*); didCommit = (void (*)(id, SEL, id, BOOL, void*))[delegate methodForSelector: didCommitSelector]; didCommit(delegate, didCommitSelector, editor, res, contextInfo); } } - (BOOL)commitEditing { // Loop over all elements of _editors [self notImplemented: _cmd]; return NO; } - (void)discardEditing { // Loop over all elements of _editors [self notImplemented: _cmd]; } @end gnustep-gui-0.24.0/Source/GSToolTips.h0000664000076500007650000000500612034104700017352 0ustar brains99brains99/** Interface of the GSToolTips class Copyright (C) 2006 Free Software Foundation, Inc. Author: Richard Frith-Macdonald Date: 2006 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import "GNUstepGUI/GSTrackingRect.h" @class NSTimer; @class NSView; @class NSWindow; @interface GSToolTips : NSObject { NSView *view; NSTrackingRectTag toolTipTag; } /** Destroy object handling tips for aView. */ + (void) removeTipsForView: (NSView*)aView; /** Return object to handle tips for aView. */ + (GSToolTips*) tipsForView: (NSView*)aView; /** Initialiser for internal use only. */ - (id) initForView: (NSView*)aView; /** Support [NSView-addToolTipRect:owner:userData:]. */ - (NSToolTipTag) addToolTipRect: (NSRect)aRect owner: (id)anObject userData: (void *)data; /** * Removes all of the tool tips in a given rectangle. */ - (void)removeToolTipsInRect: (NSRect)aRect; /** Return the number of tooltip rectangles active. */ - (unsigned) count; /** Handle mouse entry to tracking rect */ - (void) mouseEntered: (NSEvent *)theEvent; /** Handle mouse exit from tracking rect */ - (void) mouseExited: (NSEvent *)theEvent; /** Cancel tooltip because user clicked mouse. */ - (void) mouseDown: (NSEvent *)theEvent; /** Move tooltip window with user's mouse movement. */ - (void) mouseMoved: (NSEvent *)theEvent; /** Support [NSView-removeAllToolTips] */ - (void) removeAllToolTips; /** Support [NSView-removeToolTip:]. */ - (void) removeToolTip: (NSToolTipTag)tag; /** Support [NSView-setToolTip:]. */ - (void) setToolTip: (NSString *)string; /** Support [NSView-toolTip]. */ - (NSString *) toolTip; @end gnustep-gui-0.24.0/Source/NSTableView.m0000664000076500007650000050500212252621360017504 0ustar brains99brains99/** NSTableView Copyright (C) 2000 Free Software Foundation, Inc. Author: Nicola Pero Date: March 2000, June 2000, August 2000, September 2000 Author: Pierre-Yves Rivaille Date: August 2001, January 2002 Author: Fred Kiefer Date: March 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import "AppKit/NSTableView.h" #import "AppKit/NSApplication.h" #import "AppKit/NSCell.h" #import "AppKit/NSClipView.h" #import "AppKit/NSColor.h" #import "AppKit/NSEvent.h" #import "AppKit/NSImage.h" #import "AppKit/NSGraphics.h" #import "AppKit/NSKeyValueBinding.h" #import "AppKit/NSScroller.h" #import "AppKit/NSScrollView.h" #import "AppKit/NSTableColumn.h" #import "AppKit/NSTableHeaderView.h" #import "AppKit/NSText.h" #import "AppKit/NSTextFieldCell.h" #import "AppKit/NSWindow.h" #import "AppKit/PSOperators.h" #import "AppKit/NSCachedImageRep.h" #import "AppKit/NSPasteboard.h" #import "AppKit/NSDragging.h" #import "AppKit/NSCustomImageRep.h" #import "GNUstepGUI/GSTheme.h" #import "GSBindingHelpers.h" #include static NSNotificationCenter *nc = nil; static const int currentVersion = 5; static NSRect oldDraggingRect; static int oldDropRow; static NSTableViewDropOperation oldDropOperation; static NSTableViewDropOperation currentDropOperation; static int currentDropRow; static int lastQuarterPosition; static NSDragOperation currentDragOperation; /* * Nib compatibility struct. This structure is used to * pull the attributes out of the nib that we need to fill * in the flags. */ typedef struct _tableViewFlags { #if GS_WORDS_BIGENDIAN == 1 unsigned int columnOrdering:1; unsigned int columnResizing:1; unsigned int drawsGrid:1; unsigned int emptySelection:1; unsigned int multipleSelection:1; unsigned int columnSelection:1; unsigned int _unused:26; #else unsigned int _unused:26; unsigned int columnSelection:1; unsigned int multipleSelection:1; unsigned int emptySelection:1; unsigned int drawsGrid:1; unsigned int columnResizing:1; unsigned int columnOrdering:1; #endif } GSTableViewFlags; #define ALLOWS_MULTIPLE (1) #define ALLOWS_EMPTY (1 << 1) #define SHIFT_DOWN (1 << 2) #define CONTROL_DOWN (1 << 3) #define ADDING_ROW (1 << 4) @interface NSTableView (NotificationRequestMethods) - (void) _postSelectionIsChangingNotification; - (void) _postSelectionDidChangeNotification; - (void) _postColumnDidMoveNotificationWithOldIndex: (int) oldIndex newIndex: (int) newIndex; - (void) _postColumnDidResizeNotification; - (BOOL) _shouldSelectTableColumn: (NSTableColumn *)tableColumn; - (BOOL) _shouldSelectRow: (int)rowIndex; - (BOOL) _shouldSelectionChange; - (void) _didChangeSortDescriptors: (NSArray *)oldSortDescriptors; - (void) _didClickTableColumn: (NSTableColumn *)tc; - (BOOL) _shouldEditTableColumn: (NSTableColumn *)tableColumn row: (int) rowIndex; - (void) _willDisplayCell: (NSCell*)cell forTableColumn: (NSTableColumn *)tb row: (int)index; - (BOOL) _writeRows: (NSIndexSet *)rows toPasteboard: (NSPasteboard *)pboard; - (BOOL) _isDraggingSource; - (id)_objectValueForTableColumn: (NSTableColumn *)tb row: (int)index; - (void)_setObjectValue: (id)value forTableColumn: (NSTableColumn *)tb row: (int)index; - (BOOL) _isEditableColumn: (int)columnIndex row: (int)rowIndex; - (BOOL) _isCellSelectableColumn: (int)columnIndex row: (int)rowIndex; - (BOOL) _isCellEditableColumn: (int)columnIndex row: (int)rowIndex; - (int) _numRows; @end @interface NSTableView (SelectionHelper) - (void) _setSelectingColumns: (BOOL)flag; - (NSArray *) _indexSetToArray: (NSIndexSet*)indexSet; - (NSArray *) _selectedRowArray; - (BOOL) _selectRow: (int)rowIndex; - (BOOL) _selectUnselectedRow: (int)rowIndex; - (BOOL) _unselectRow: (int)rowIndex; - (void) _unselectAllRows; - (NSArray *) _selectedColumArray; - (void) _unselectAllColumns; @end @interface NSTableView (EventLoopHelper) - (void) _trackCellAtColumn:(NSInteger)column row:(NSInteger)row withEvent:(NSEvent *)ev; - (BOOL) _startDragOperationWithEvent:(NSEvent *)theEvent; @end /* * A specific struct and its associated quick sort function * This is used by the -sizeToFit method */ typedef struct { CGFloat width; BOOL isMax; } columnSorting; static void quick_sort_internal(columnSorting *data, int p, int r) { if (p < r) { int q; { CGFloat x = data[p].width; BOOL y = data[p].isMax; int i = p - 1; int j = r + 1; columnSorting exchange; while (1) { j--; for (; (data[j].width > x) || ((data[j].width == x) && (data[j].isMax == YES) && (y == NO)); j--) ; i++; for (; (data[i].width < x) || ((data[i].width == x) && (data[i].isMax == NO) && (y == YES)); i++) ; if (i < j) { exchange = data[j]; data[j] = data[i]; data[i] = exchange; } else { q = j; break; } } } quick_sort_internal(data, p, q); quick_sort_internal(data, q + 1, r); } } /* * Now some auxiliary functions used to manage real-time user selections. * */ static void computeNewSelection (NSTableView *tv, NSIndexSet *_oldSelectedRows, NSMutableIndexSet *_selectedRows, int _originalRow, int _oldRow, int _currentRow, int *_selectedRow, unsigned selectionMode) { if (!(selectionMode & ALLOWS_MULTIPLE)) { if ((selectionMode & SHIFT_DOWN) && (selectionMode & ALLOWS_EMPTY) && !(selectionMode & ADDING_ROW)) // we will unselect the selected row // ic, sc : ok { int count = [_selectedRows count]; if ((count == 0) && (_oldRow == -1)) { NSLog(@"how did you get there ?"); NSLog(@"you're supposed to have clicked on a selected row,"); NSLog(@"but there's no selected row!"); return; } else if (count > 1) { [tv _unselectAllRows]; [tv _postSelectionIsChangingNotification]; } else if (_currentRow != _originalRow) { if (*_selectedRow == _originalRow) { // we are already selected, don't do anything } else { //begin checking code if (count > 0) { NSLog(@"There should not be any row selected"); } //end checking code if ([tv _selectRow: _originalRow]) { [tv _postSelectionIsChangingNotification]; } } } else if (_currentRow == _originalRow) { if (count == 0) { // the row is already deselected // nothing to do ! } else { [tv _unselectRow: _originalRow]; [tv _postSelectionIsChangingNotification]; } } } else //(!(selectionMode & ALLOWS_MULTIPLE) && //(!(selectionMode & SHIFT_DOWN) || //!(selectionMode & ALLOWS_EMPTY) || //(selectionMode & ADDING_ROW))) // we'll be selecting exactly one row // ic, sc : ok { int count = [_selectedRows count]; if ([tv _shouldSelectRow: _currentRow] == NO) { return; } if ((count != 1) || (_oldRow == -1)) { // this is the first call that goes thru shouldSelectRow // Therefore we don't know anything about the selection BOOL notified = ![_selectedRows containsIndex: _currentRow]; [tv _unselectAllRows]; [_selectedRows addIndex: _currentRow]; *_selectedRow = _currentRow; if (notified == YES) { [tv setNeedsDisplayInRect: [tv rectOfRow: _currentRow]]; } else { if (count > 1) { notified = YES; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } else { // we know there is only one column selected // this column is *_selectedRow //begin checking code if (![_selectedRows containsIndex: *_selectedRow]) { NSLog(@"*_selectedRow is not the only selected row!"); } //end checking code if (*_selectedRow == _currentRow) { // currentRow is already selecteed return; } else { [tv _unselectRow: *_selectedRow]; // CHANGE: This does a check more [tv _selectRow: _currentRow]; [tv _postSelectionIsChangingNotification]; } } } } else if ((selectionMode & ALLOWS_MULTIPLE) && (selectionMode & SHIFT_DOWN) && (selectionMode & ADDING_ROW)) // we add new row to the current selection { if (_oldRow == -1) // this is the first pass { BOOL notified = NO; int i; int diff = _currentRow - _originalRow; if (diff >= 0) { for (i = _originalRow; i <= _currentRow; i++) { if ([_selectedRows containsIndex: i] || [tv _selectRow: i]) { *_selectedRow = i; notified = YES; } } } else { // this case does happen, (sometimes) for (i = _originalRow; i >= _currentRow; i--) { if ([_selectedRows containsIndex: i] || [tv _selectRow: i]) { *_selectedRow = i; notified = YES; } } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } else // new multiple selection, after first pass { int oldDiff, newDiff, i; oldDiff = _oldRow - _originalRow; newDiff = _currentRow - _originalRow; if (oldDiff >= 0 && newDiff >= 0) { if (newDiff >= oldDiff) // we're extending the selection { BOOL notified = NO; for (i = _oldRow + 1; i <= _currentRow; i++) { if ([_selectedRows containsIndex: i] || [tv _selectRow: i]) { *_selectedRow = i; notified = YES; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } else // we're reducing the selection { BOOL notified = NO; for (i = _oldRow; i > _currentRow; i--) { if ([_oldSelectedRows containsIndex: i]) { // this row was in the old selection // leave it selected continue; } if ([tv _unselectRow: i]) { notified = YES; } } if (*_selectedRow == -1) { NSUInteger last = [_selectedRows lastIndex]; if (last == NSNotFound) { *_selectedRow = -1; } else { *_selectedRow = last; } } if (notified) { [tv _postSelectionIsChangingNotification]; } } } else if (oldDiff <= 0 && newDiff <= 0) { if (newDiff <= oldDiff) // we're extending the selection { BOOL notified = NO; for (i = _oldRow - 1; i >= _currentRow; i--) { if ([_selectedRows containsIndex: i] || [tv _selectRow: i]) { *_selectedRow = i; notified = YES; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } else // we're reducing the selection { BOOL notified = NO; for (i = _oldRow; i < _currentRow; i++) { if ([_oldSelectedRows containsIndex: i]) { // this row was in the old selection // leave it selected continue; } if ([tv _unselectRow: i]) { notified = YES; } } if (*_selectedRow == -1) { NSUInteger first = [_selectedRows firstIndex]; if (first == NSNotFound) { *_selectedRow = -1; } else { *_selectedRow = first; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } } else if (oldDiff <= 0 && newDiff >= 0) { BOOL notified = NO; // we're reducing the selection { for (i = _oldRow; i < _originalRow; i++) { if ([_oldSelectedRows containsIndex: i]) { // this row was in the old selection // leave it selected continue; } if ([tv _unselectRow: i]) { notified = YES; } } } // then we're extending it for (i = _originalRow + 1; i <= _currentRow; i++) { if ([_selectedRows containsIndex: i] || [tv _selectRow: i]) { *_selectedRow = i; notified = YES; } } if (*_selectedRow == -1) { NSUInteger first = [_selectedRows firstIndex]; if (first == NSNotFound) { *_selectedRow = -1; } else { *_selectedRow = first; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } else if (oldDiff >= 0 && newDiff <= 0) { BOOL notified = NO; // we're reducing the selection for (i = _oldRow; i > _originalRow; i--) { if ([_oldSelectedRows containsIndex: i]) { // this row was in the old selection // leave it selected continue; } if ([tv _unselectRow: i]) { notified = YES; } } // then we're extending it for (i = _originalRow - 1; i >= _currentRow; i--) { if ([_selectedRows containsIndex: i] || [tv _selectRow: i]) { *_selectedRow = i; notified = YES; } } if (*_selectedRow == -1) { NSUInteger last = [_selectedRows lastIndex]; if (last == NSNotFound) { *_selectedRow = -1; } else { *_selectedRow = last; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } } } else if ((selectionMode & ALLOWS_MULTIPLE) && ((selectionMode & SHIFT_DOWN) == 0) && (selectionMode & ALLOWS_EMPTY) ) // ic, sr : ok // new multiple selection (empty possible) { if (_oldRow == -1) // this is the first pass // we'll clear the selection first { int diff, i; int count = [_selectedRows count]; BOOL notified = NO; diff = _currentRow - _originalRow; if (count > 0) { notified = YES; } [tv _unselectAllRows]; if (diff >= 0) { for (i = _originalRow; i <= _currentRow; i++) { if ([tv _selectRow: i]) { notified = YES; } } } else { // this case does happen (sometimes) for (i = _originalRow; i >= _currentRow; i--) { if ([tv _selectRow: i]) { notified = YES; } } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } else // new multiple selection, after first pass { int oldDiff, newDiff, i; oldDiff = _oldRow - _originalRow; newDiff = _currentRow - _originalRow; if (oldDiff >= 0 && newDiff >= 0) { if (newDiff >= oldDiff) { BOOL notified = NO; for (i = _oldRow + 1; i <= _currentRow; i++) { if ([tv _selectRow: i]) { notified = YES; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } else { BOOL notified = NO; for (i = _oldRow; i > _currentRow; i--) { if ([tv _unselectRow: i]) { notified = YES; } } if (*_selectedRow == -1) { NSUInteger last = [_selectedRows lastIndex]; if (last == NSNotFound) { *_selectedRow = -1; } else { *_selectedRow = last; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } } else if (oldDiff <= 0 && newDiff <= 0) { if (newDiff <= oldDiff) // we're extending the selection { BOOL notified = NO; for (i = _oldRow - 1; i >= _currentRow; i--) { if ([tv _selectRow: i]) { notified = YES; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } else // we're reducing the selection { BOOL notified = NO; for (i = _oldRow; i < _currentRow; i++) { if ([tv _unselectRow: i]) { notified = YES; } } if (*_selectedRow == -1) { NSUInteger first = [_selectedRows firstIndex]; if (first == NSNotFound) { *_selectedRow = -1; } else { *_selectedRow = first; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } } else if (oldDiff <= 0 && newDiff >= 0) { BOOL notified = NO; // we're reducing the selection for (i = _oldRow; i < _originalRow; i++) { if ([tv _unselectRow: i]) { notified = YES; } } // then we're extending it for (i = _originalRow + 1; i <= _currentRow; i++) { if ([tv _selectRow: i]) { notified = YES; } } if (*_selectedRow == -1) { NSUInteger first = [_selectedRows firstIndex]; if (first == NSNotFound) { *_selectedRow = -1; } else { *_selectedRow = first; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } else if (oldDiff >= 0 && newDiff <= 0) { BOOL notified = NO; // we're reducing the selection for (i = _oldRow; i > _originalRow; i--) { if ([tv _unselectRow: i]) { notified = YES; } } // then we're extending it for (i = _originalRow - 1; i >= _currentRow; i--) { if ([tv _selectRow: i]) { notified = YES; } } if (*_selectedRow == -1) { NSUInteger last = [_selectedRows lastIndex]; if (last == NSNotFound) { *_selectedRow = -1; } else { *_selectedRow = last; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } } } else if (((selectionMode & ALLOWS_MULTIPLE) && ((selectionMode & SHIFT_DOWN) == 0) && ((selectionMode & ALLOWS_EMPTY) == 0) && (selectionMode & ADDING_ROW)) // the following case can be assimilated to the // one before, although it will lead to an // extra redraw // TODO: solve this issue || ((selectionMode & ALLOWS_MULTIPLE) && ((selectionMode & SHIFT_DOWN) == 0) && ((selectionMode & ALLOWS_EMPTY) == 0) && ((selectionMode & ADDING_ROW) == 0)) ) { if (_oldRow == -1) { // if we can select the _originalRow, we'll clear the old selection // else we'll add to the old selection if ([tv _shouldSelectRow: _currentRow] == YES) { // let's clear the old selection // this code is copied from another case // (AM = 1, SD=0, AE=1, AR=*, first pass) int diff, i; int count = [_selectedRows count]; BOOL notified = NO; diff = _currentRow - _originalRow; if (count > 0) { notified = YES; } [tv _unselectAllRows]; if (diff >= 0) { for (i = _originalRow; i <= _currentRow; i++) { if ([tv _selectRow: i]) { notified = YES; } } } else { for (i = _originalRow; i >= _currentRow; i--) { if ([tv _selectRow: i]) { notified = YES; } } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } else { // let's add to the old selection // this code is copied from another case // (AM=1, SD=1, AE=*, AR=1) int diff, i; BOOL notified = NO; diff = _currentRow - _originalRow; if (diff >= 0) { for (i = _originalRow; i <= _currentRow; i++) { if ([_selectedRows containsIndex: i] || [tv _selectRow: i]) { *_selectedRow = i; notified = YES; } } } else { // this case does happen (sometimes) for (i = _originalRow; i >= _currentRow; i--) { if ([_selectedRows containsIndex: i] || [tv _selectRow: i]) { *_selectedRow = i; notified = YES; } } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } } else if ([_selectedRows containsIndex: _originalRow]) // as the originalRow is selected, // we are in a new selection { // this code is copied from another case // (AM=1, SD=0, AE=1, AR=*, after first pass) int oldDiff, newDiff, i; oldDiff = _oldRow - _originalRow; newDiff = _currentRow - _originalRow; if (oldDiff >= 0 && newDiff >= 0) { if (newDiff >= oldDiff) { BOOL notified = NO; for (i = _oldRow + 1; i <= _currentRow; i++) { if ([tv _selectRow: i]) { notified = YES; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } else { BOOL notified = NO; for (i = _oldRow; i > _currentRow; i--) { if ([tv _unselectRow: i]) { notified = YES; } } if (*_selectedRow == -1) { NSUInteger last = [_selectedRows lastIndex]; if (last == NSNotFound) { *_selectedRow = -1; } else { *_selectedRow = last; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } } else if (oldDiff <= 0 && newDiff <= 0) { if (newDiff <= oldDiff) // we're extending the selection { BOOL notified = NO; for (i = _oldRow - 1; i >= _currentRow; i--) { if ([tv _selectRow: i]) { notified = YES; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } else // we're reducing the selection { BOOL notified = NO; for (i = _oldRow; i < _currentRow; i++) { if ([tv _unselectRow: i]) { notified = YES; } } if (*_selectedRow == -1) { NSUInteger first = [_selectedRows firstIndex]; if (first == NSNotFound) { *_selectedRow = -1; } else { *_selectedRow = first; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } } else if (oldDiff <= 0 && newDiff >= 0) { BOOL notified = NO; // we're reducing the selection for (i = _oldRow; i < _originalRow; i++) { if ([tv _unselectRow: i]) { notified = YES; } } // then we're extending it for (i = _originalRow + 1; i <= _currentRow; i++) { if ([tv _selectRow: i]) { notified = YES; } } if (*_selectedRow == -1) { NSUInteger first = [_selectedRows firstIndex]; if (first == NSNotFound) { *_selectedRow = -1; } else { *_selectedRow = first; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } else if (oldDiff >= 0 && newDiff <= 0) { BOOL notified = NO; // we're reducing the selection for (i = _oldRow; i > _originalRow; i--) { if ([tv _unselectRow: i]) { notified = YES; } } // then we're extending it for (i = _originalRow - 1; i >= _currentRow; i--) { if ([tv _selectRow: i]) { notified = YES; } } if (*_selectedRow == -1) { NSUInteger last = [_selectedRows lastIndex]; if (last == NSNotFound) { *_selectedRow = -1; } else { *_selectedRow = last; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } } else // as the originalRow is not selection, // we are adding to the old selection { // this code is copied from another case // (AM=1, SD=1, AE=*, AR=1, after first pass) int oldDiff, newDiff, i; oldDiff = _oldRow - _originalRow; newDiff = _currentRow - _originalRow; if (oldDiff >= 0 && newDiff >= 0) { if (newDiff >= oldDiff) // we're extending the selection { BOOL notified = NO; for (i = _oldRow + 1; i <= _currentRow; i++) { if ([_selectedRows containsIndex: i] || [tv _selectRow: i]) { *_selectedRow = i; notified = YES; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } else // we're reducing the selection { BOOL notified = NO; for (i = _oldRow; i > _currentRow; i--) { if ([_oldSelectedRows containsIndex: i]) { // this row was in the old selection // leave it selected continue; } if ([tv _unselectRow: i]) { notified = YES; } } if (*_selectedRow == -1) { NSUInteger last = [_selectedRows lastIndex]; if (last == NSNotFound) { *_selectedRow = -1; } else { *_selectedRow = last; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } } else if (oldDiff <= 0 && newDiff <= 0) { if (newDiff <= oldDiff) // we're extending the selection { BOOL notified = NO; for (i = _oldRow - 1; i >= _currentRow; i--) { if ([_selectedRows containsIndex: i] || [tv _selectRow: i]) { *_selectedRow = i; notified = YES; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } else // we're reducing the selection { BOOL notified = NO; for (i = _oldRow; i < _currentRow; i++) { if ([_oldSelectedRows containsIndex: i]) { // this row was in the old selection // leave it selected continue; } if ([tv _unselectRow: i]) { notified = YES; } } if (*_selectedRow == -1) { NSUInteger first = [_selectedRows firstIndex]; if (first == NSNotFound) { *_selectedRow = -1; } else { *_selectedRow = first; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } } else if (oldDiff <= 0 && newDiff >= 0) { BOOL notified = NO; // we're reducing the selection for (i = _oldRow; i < _originalRow; i++) { if ([_oldSelectedRows containsIndex: i]) { // this row was in the old selection // leave it selected continue; } if ([tv _unselectRow: i]) { notified = YES; } } // then we're extending it for (i = _originalRow + 1; i <= _currentRow; i++) { if ([_selectedRows containsIndex: i] || [tv _selectRow: i]) { *_selectedRow = i; notified = YES; } } if (*_selectedRow == -1) { NSUInteger first = [_selectedRows firstIndex]; if (first == NSNotFound) { *_selectedRow = -1; } else { *_selectedRow = first; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } else if (oldDiff >= 0 && newDiff <= 0) { BOOL notified = NO; // we're reducing the selection for (i = _oldRow; i > _originalRow; i--) { if ([_oldSelectedRows containsIndex: i]) { // this row was in the old selection // leave it selected continue; } if ([tv _unselectRow: i]) { notified = YES; } } // then we're extending it for (i = _originalRow - 1; i >= _currentRow; i--) { if ([_selectedRows containsIndex: i] || [tv _selectRow: i]) { *_selectedRow = i; notified = YES; } } if (*_selectedRow == -1) { NSUInteger last = [_selectedRows lastIndex]; if (last == NSNotFound) { *_selectedRow = -1; } else { *_selectedRow = last; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } } } else if ((selectionMode & ALLOWS_MULTIPLE) && (selectionMode & SHIFT_DOWN) && (selectionMode & ALLOWS_EMPTY) && ((selectionMode & ADDING_ROW) == 0)) { if (_oldRow == -1) // this is the first pass { int diff, i; BOOL notified = NO; diff = _currentRow - _originalRow; if (diff >= 0) { for (i = _originalRow; i <= _currentRow; i++) { if ([tv _unselectRow: i]) { notified = YES; } } if (*_selectedRow == -1) { NSUInteger first = [_selectedRows firstIndex]; if (first == NSNotFound) { *_selectedRow = -1; } else { *_selectedRow = first; } } } else { // this case does happen (sometimes) for (i = _originalRow; i >= _currentRow; i--) { if ([tv _unselectRow: i]) { notified = YES; } } if (*_selectedRow == -1) { NSUInteger first = [_selectedRows firstIndex]; if (first == NSNotFound) { *_selectedRow = -1; } else { *_selectedRow = first; } } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } else // new multiple antiselection, after first pass { int oldDiff, newDiff, i; oldDiff = _oldRow - _originalRow; newDiff = _currentRow - _originalRow; if (oldDiff >= 0 && newDiff >= 0) { if (newDiff >= oldDiff) // we're extending the antiselection { BOOL notified = NO; for (i = _oldRow + 1; i <= _currentRow; i++) { if ([tv _unselectRow: i]) { notified = YES; } } if (*_selectedRow == -1) { NSUInteger first = [_selectedRows firstIndex]; if (first == NSNotFound) { *_selectedRow = -1; } else { *_selectedRow = first; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } else // we're reducing the selection { BOOL notified = NO; for (i = _oldRow; i > _currentRow; i--) { if ([_oldSelectedRows containsIndex: i]) { // this row was in the old selection // select it [tv setNeedsDisplayInRect: [tv rectOfRow: i]]; [_selectedRows addIndex: i]; *_selectedRow = i; notified = YES; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } } else if (oldDiff <= 0 && newDiff <= 0) { if (newDiff <= oldDiff) // we're extending the selection { BOOL notified = NO; for (i = _oldRow - 1; i >= _currentRow; i--) { if ([tv _unselectRow: i]) { notified = YES; } } if (*_selectedRow == -1) { NSUInteger first = [_selectedRows firstIndex]; if (first == NSNotFound) { *_selectedRow = -1; } else { *_selectedRow = first; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } else // we're reducing the selection { BOOL notified = NO; for (i = _oldRow; i < _currentRow; i++) { if ([_oldSelectedRows containsIndex: i]) { // this row was in the old selection // select it [tv setNeedsDisplayInRect: [tv rectOfRow: i]]; [_selectedRows addIndex: i]; *_selectedRow = i; notified = YES; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } } else if (oldDiff <= 0 && newDiff >= 0) { BOOL notified = NO; // we're reducing the selection { for (i = _oldRow; i < _originalRow; i++) { if ([_oldSelectedRows containsIndex: i]) { // this row was in the old selection // select it [tv setNeedsDisplayInRect: [tv rectOfRow: i]]; [_selectedRows addIndex: i]; *_selectedRow = i; notified = YES; } } } // then we're extending it { for (i = _originalRow + 1; i <= _currentRow; i++) { if ([tv _unselectRow: i]) { notified = YES; } } } if (*_selectedRow == -1) { NSUInteger first = [_selectedRows firstIndex]; if (first == NSNotFound) { *_selectedRow = -1; } else { *_selectedRow = first; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } else if (oldDiff >= 0 && newDiff <= 0) { BOOL notified = NO; // we're reducing the selection { for (i = _oldRow; i > _originalRow; i--) { if ([_oldSelectedRows containsIndex: i]) { // this row was in the old selection // select it [tv setNeedsDisplayInRect: [tv rectOfRow: i]]; [_selectedRows addIndex: i]; *_selectedRow = i; notified = YES; } } } // then we're extending it { for (i = _originalRow - 1; i >= _currentRow; i--) { if ([tv _unselectRow: i]) { notified = YES; } } } if (*_selectedRow == -1) { NSUInteger first = [_selectedRows firstIndex]; if (first == NSNotFound) { *_selectedRow = -1; } else { *_selectedRow = first; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } } } else if ((selectionMode & ALLOWS_MULTIPLE) && (selectionMode & SHIFT_DOWN) && ((selectionMode & ALLOWS_EMPTY) == 0) && ((selectionMode & ADDING_ROW) == 0)) { if (_oldRow == -1) // this is the first pass { int diff, i; int count = [_selectedRows count]; BOOL notified = NO; diff = _currentRow - _originalRow; if (diff >= 0) { for (i = _originalRow; i <= _currentRow; i++) { if ((count > 1) && [tv _unselectRow: i]) { notified = YES; count--; } } if (*_selectedRow == -1) { NSUInteger first = [_selectedRows firstIndex]; if (first == NSNotFound) { NSLog(@"error!"); *_selectedRow = -1; } else { *_selectedRow = first; } } } else { // this case does happen (sometimes) for (i = _originalRow; i >= _currentRow; i--) { if ((count > 1) && [tv _unselectRow: i]) { notified = YES; count--; } } if (*_selectedRow == -1) { NSUInteger first = [_selectedRows firstIndex]; if (first == NSNotFound) { NSLog(@"error!"); *_selectedRow = -1; } else { *_selectedRow = first; } } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } else // new multiple antiselection, after first pass { int oldDiff, newDiff, i; int count = [_selectedRows count]; oldDiff = _oldRow - _originalRow; newDiff = _currentRow - _originalRow; if (oldDiff >= 0 && newDiff >= 0) { if (newDiff >= oldDiff) // we're extending the antiselection { BOOL notified = NO; for (i = _oldRow + 1; i <= _currentRow; i++) { if ((count > 1) && [tv _unselectRow: i]) { notified = YES; count--; } } if (*_selectedRow == -1) { NSUInteger first = [_selectedRows firstIndex]; if (first == NSNotFound) { NSLog(@"error!"); *_selectedRow = -1; } else { *_selectedRow = first; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } else // we're reducing the selection { BOOL notified = NO; for (i = _oldRow; i > _currentRow; i--) { if (([_oldSelectedRows containsIndex: i])) { // this row was in the old selection // select it if ([tv _selectUnselectedRow: i]) { notified = YES; } } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } } else if (oldDiff <= 0 && newDiff <= 0) { if (newDiff <= oldDiff) // we're extending the selection { BOOL notified = NO; for (i = _oldRow - 1; i >= _currentRow; i--) { if ((count > 1) && [tv _unselectRow: i]) { notified = YES; count--; } } if (*_selectedRow == -1) { NSUInteger first = [_selectedRows firstIndex]; if (first == NSNotFound) { NSLog(@"error!"); *_selectedRow = -1; } else { *_selectedRow = first; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } else // we're reducing the selection { BOOL notified = NO; for (i = _oldRow; i < _currentRow; i++) { if ([_oldSelectedRows containsIndex: i]) { // this row was in the old selection // select it if ([tv _selectUnselectedRow: i]) { notified = YES; } count++; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } } else if (oldDiff <= 0 && newDiff >= 0) { BOOL notified = NO; // we're reducing the selection { for (i = _oldRow; i < _originalRow; i++) { if ([_oldSelectedRows containsIndex: i]) { // this row was in the old selection // select it if ([tv _selectUnselectedRow: i]) { notified = YES; } } } } // then we're extending it { for (i = _originalRow + 1; i <= _currentRow; i++) { if ((count > 1) && [tv _unselectRow: i]) { notified = YES; count--; } } } if (*_selectedRow == -1) { NSUInteger first = [_selectedRows firstIndex]; if (first == NSNotFound) { NSLog(@"error!"); *_selectedRow = -1; } else { *_selectedRow = first; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } else if (oldDiff >= 0 && newDiff <= 0) { BOOL notified = NO; // we're reducing the selection { for (i = _oldRow; i > _originalRow; i--) { if ([_oldSelectedRows containsIndex: i]) { // this row was in the old selection // select it if ([tv _selectUnselectedRow: i]) { notified = YES; } } } } // then we're extending it { for (i = _originalRow - 1; i >= _currentRow; i--) { if ((count > 1) && [tv _unselectRow: i]) { notified = YES; count--; } } } if (*_selectedRow == -1) { NSUInteger first = [_selectedRows firstIndex]; if (first == NSNotFound) { NSLog(@"error!"); *_selectedRow = -1; } else { *_selectedRow = first; } } if (notified == YES) { [tv _postSelectionIsChangingNotification]; } } } } } @interface GSTableCornerView : NSView {} @end @implementation GSTableCornerView - (BOOL) isFlipped { return YES; } - (void) drawRect: (NSRect)aRect { [[GSTheme theme] drawTableCornerView: self withClip: aRect]; } @end @interface NSTableView (TableViewInternalPrivate) - (void) _setSelectingColumns: (BOOL)flag; - (BOOL) _editNextEditableCellAfterRow: (int)row column: (int)column; - (BOOL) _editPreviousEditableCellBeforeRow: (int)row column: (int)column; - (void) _editNextCellAfterRow:(int)row inColumn:(int)column; - (void) _autosaveTableColumns; - (void) _autoloadTableColumns; @end @implementation NSTableView + (void) initialize { if (self == [NSTableView class]) { [self setVersion: currentVersion]; nc = [NSNotificationCenter defaultCenter]; // FIXME [self exposeBinding: NSContentBinding]; [self exposeBinding: NSSelectionIndexesBinding]; } } /* * Initializing/Releasing */ - (void) _initDefaults { _isValidating = NO; _drawsGrid = YES; _rowHeight = 16.0; _intercellSpacing = NSMakeSize (5.0, 2.0); ASSIGN(_selectedColumns, [NSMutableIndexSet indexSet]); ASSIGN(_selectedRows, [NSMutableIndexSet indexSet]); _allowsEmptySelection = YES; _allowsMultipleSelection = NO; _allowsColumnSelection = YES; _allowsColumnResizing = YES; _allowsColumnReordering = YES; _autoresizesAllColumnsToFit = NO; _selectingColumns = NO; _verticalMotionDrag = NO; _editedColumn = -1; _editedRow = -1; _clickedRow = -1; _clickedColumn = -1; _selectedColumn = -1; _selectedRow = -1; _highlightedTableColumn = nil; _draggingSourceOperationMaskForLocal = NSDragOperationCopy | NSDragOperationLink | NSDragOperationGeneric | NSDragOperationPrivate; _draggingSourceOperationMaskForRemote = NSDragOperationNone; ASSIGN(_sortDescriptors, [NSArray array]); } - (id) initWithFrame: (NSRect)frameRect { self = [super initWithFrame: frameRect]; if (!self) return self; [self _initDefaults]; ASSIGN(_gridColor, [NSColor gridColor]); ASSIGN(_backgroundColor, [NSColor controlBackgroundColor]); ASSIGN(_tableColumns, [NSMutableArray array]); _headerView = [NSTableHeaderView new]; [_headerView setFrameSize: NSMakeSize (frameRect.size.width, 22.0)]; [_headerView setTableView: self]; _cornerView = [GSTableCornerView new]; [self tile]; return self; } - (void) dealloc { [self abortEditing]; RELEASE (_gridColor); RELEASE (_backgroundColor); RELEASE (_tableColumns); RELEASE (_selectedColumns); RELEASE (_selectedRows); RELEASE (_sortDescriptors); TEST_RELEASE (_headerView); TEST_RELEASE (_cornerView); if (_autosaveTableColumns == YES) { [nc removeObserver: self name: NSTableViewColumnDidResizeNotification object: self]; } TEST_RELEASE (_autosaveName); if (_numberOfColumns > 0) { NSZoneFree (NSDefaultMallocZone (), _columnOrigins); } if (_delegate != nil) { [nc removeObserver: _delegate name: nil object: self]; _delegate = nil; } [super dealloc]; } - (BOOL) isFlipped { return YES; } /* * Table Dimensions */ - (NSInteger) numberOfColumns { return _numberOfColumns; } - (NSInteger) numberOfRows { return [self _numRows]; } /* * Columns */ - (void) addTableColumn: (NSTableColumn *)aColumn { [aColumn setTableView: self]; [_tableColumns addObject: aColumn]; _numberOfColumns++; if (_numberOfColumns > 1) { _columnOrigins = NSZoneRealloc (NSDefaultMallocZone (), _columnOrigins, (sizeof (float)) * _numberOfColumns); } else { _columnOrigins = NSZoneMalloc (NSDefaultMallocZone (), sizeof (float)); } [self tile]; } - (void) removeTableColumn: (NSTableColumn *)aColumn { int columnIndex = [self columnWithIdentifier: [aColumn identifier]]; if (columnIndex == -1) { NSLog (@"Warning: Tried to remove not-existent column from table"); return; } /* Remove selection on this column */ [self deselectColumn: columnIndex]; /* Shift column indexes on the right by one */ if (_selectedColumn > columnIndex) { _selectedColumn--; } [_selectedColumns removeIndex: columnIndex]; /* Now really remove the column */ /* NB: Set table view to nil before removing the column from the array, because removing it from the array could deallocate it ! */ [aColumn setTableView: nil]; [_tableColumns removeObject: aColumn]; _numberOfColumns--; if (_numberOfColumns > 0) { _columnOrigins = NSZoneRealloc (NSDefaultMallocZone (), _columnOrigins, (sizeof (float)) * _numberOfColumns); } else { NSZoneFree (NSDefaultMallocZone (), _columnOrigins); } [self tile]; } - (void) moveColumn: (NSInteger)columnIndex toColumn: (NSInteger)newIndex { /* The range of columns which need to be shifted, extremes included */ int minRange, maxRange; /* Amount of shift for these columns */ int shift; BOOL selected = NO; if ((columnIndex < 0) || (columnIndex > (_numberOfColumns - 1))) { NSLog (@"Attempt to move column outside table"); return; } if ((newIndex < 0) || (newIndex > (_numberOfColumns - 1))) { NSLog (@"Attempt to move column to outside table"); return; } if (columnIndex == newIndex) return; if (columnIndex > newIndex) { minRange = newIndex; maxRange = columnIndex - 1; shift = +1; } else // columnIndex < newIndex { minRange = columnIndex + 1; maxRange = newIndex; shift = -1; } /* Rearrange selection */ if (_selectedColumn == columnIndex) { _selectedColumn = newIndex; } else if ((_selectedColumn >= minRange) && (_selectedColumn <= maxRange)) { _selectedColumn += shift; } if ([_selectedColumns containsIndex: columnIndex]) { selected = YES; } [_selectedColumns shiftIndexesStartingAtIndex: columnIndex + 1 by: -1]; [_selectedColumns shiftIndexesStartingAtIndex: newIndex by: 1]; if (selected) { [_selectedColumns addIndex: newIndex]; } /* Update edited cell */ if (_editedColumn == columnIndex) { _editedColumn = newIndex; } else if ((_editedColumn >= minRange) && (_editedColumn <= maxRange)) { _editedColumn += shift; } /* Now really move the column */ if (columnIndex < newIndex) { [_tableColumns insertObject: [_tableColumns objectAtIndex: columnIndex] atIndex: newIndex + 1]; [_tableColumns removeObjectAtIndex: columnIndex]; } else { [_tableColumns insertObject: [_tableColumns objectAtIndex: columnIndex] atIndex: newIndex]; [_tableColumns removeObjectAtIndex: columnIndex + 1]; } /* Tile */ [self tile]; /* Post notification */ [self _postColumnDidMoveNotificationWithOldIndex: columnIndex newIndex: newIndex]; [self _autosaveTableColumns]; } - (NSArray *) tableColumns { return AUTORELEASE ([_tableColumns mutableCopyWithZone: NSDefaultMallocZone ()]); } - (NSInteger) columnWithIdentifier: (id)identifier { NSEnumerator *enumerator = [_tableColumns objectEnumerator]; NSTableColumn *tb; int return_value = 0; while ((tb = [enumerator nextObject]) != nil) { // Also handle a nil identifier. if ((identifier == [tb identifier]) || [[tb identifier] isEqual: identifier]) return return_value; else return_value++; } return -1; } - (NSTableColumn *) tableColumnWithIdentifier:(id)anObject { int indexOfColumn = [self columnWithIdentifier: anObject]; if (indexOfColumn == -1) return nil; else return [_tableColumns objectAtIndex: indexOfColumn]; } /* * Data Source */ - (id) dataSource { return _dataSource; } - (void) setDataSource: (id)anObject { /* Used only for readability */ const SEL sel_a = @selector (numberOfRowsInTableView:); const SEL sel_b = @selector (tableView:objectValueForTableColumn:row:); const SEL sel_c = @selector(tableView:setObjectValue:forTableColumn:row:); GSKeyValueBinding *theBinding; // If we have content binding the data source is used only // like a delegate theBinding = [GSKeyValueBinding getBinding: NSContentBinding forObject: self]; if (theBinding == nil) { if (anObject && [anObject respondsToSelector: sel_a] == NO) { [NSException raise: NSInternalInconsistencyException format: @"Data Source doesn't respond to numberOfRowsInTableView:"]; } if (anObject && [anObject respondsToSelector: sel_b] == NO) { /* This method isn't required. [NSException raise: NSInternalInconsistencyException format: @"Data Source doesn't respond to " @"tableView:objectValueForTableColumn:row:"]; */ } } _dataSource_editable = [anObject respondsToSelector: sel_c]; /* We do *not* retain the dataSource, it's like a delegate */ _dataSource = anObject; [self tile]; [self reloadData]; } /* * Loading data */ - (void) reloadData { [self noteNumberOfRowsChanged]; [self setNeedsDisplay: YES]; } /* * Target-action */ - (void) setAction: (SEL)aSelector { _action = aSelector; } - (SEL) action { return _action; } - (void) setDoubleAction: (SEL)aSelector { _doubleAction = aSelector; } - (SEL) doubleAction { return _doubleAction; } - (void) setTarget:(id)anObject { _target = anObject; } - (id) target { return _target; } - (NSInteger) clickedColumn { return _clickedColumn; } - (NSInteger) clickedRow { return _clickedRow; } /* * The NSTableHeaderView calls this method when it receives a double click. */ - (void) _sendDoubleActionForColumn: (NSInteger)columnIndex { _clickedColumn = columnIndex; _clickedRow = -1; [self sendAction: _doubleAction to: _target]; } /* * And this when it gets a simple click which turns out to be for * selecting/deselecting a column. * We don't support subtracting a column from the selection (Cocoa doesn't * either). * However we support adding a distinct column with the control key (unlike * Cocoa where the user can only make column range selection). */ - (void) _selectColumn: (NSInteger)columnIndex modifiers: (unsigned int)modifiers { NSIndexSet *oldIndexes = [self selectedColumnIndexes]; BOOL addRange = ((modifiers & NSShiftKeyMask) && _allowsMultipleSelection && [oldIndexes count] > 0); BOOL addSingle = ((modifiers & NSControlKeyMask) && _allowsMultipleSelection); BOOL shouldSelect = ([self _shouldSelectionChange] && [self _shouldSelectTableColumn: [_tableColumns objectAtIndex: columnIndex]]); NSIndexSet *newIndexes = [NSIndexSet indexSetWithIndex: columnIndex]; if (_allowsColumnSelection == NO || shouldSelect == NO) { return; } if (_selectingColumns == NO) { [self _setSelectingColumns: YES]; } /* Single select has priority over range select when both modifiers are pressed */ if (addSingle) { [self selectColumnIndexes: newIndexes byExtendingSelection: YES]; } else if (addRange) { NSUInteger firstIndex = [oldIndexes firstIndex]; NSUInteger lastIndex = [oldIndexes lastIndex]; NSRange range; /* We extend the selection to the left or the right of the last selected column. */ if (columnIndex > [self selectedColumn]) { lastIndex = columnIndex; } else { firstIndex = columnIndex; } range = NSMakeRange(firstIndex, lastIndex - firstIndex + 1); newIndexes = [NSIndexSet indexSetWithIndexesInRange: range]; [self selectColumnIndexes: newIndexes byExtendingSelection: YES]; } else { [self selectColumnIndexes: newIndexes byExtendingSelection: NO]; } } /* *Configuration */ - (void) setAllowsColumnReordering: (BOOL)flag { _allowsColumnReordering = flag; } - (BOOL) allowsColumnReordering { return _allowsColumnReordering; } - (void) setAllowsColumnResizing: (BOOL)flag { _allowsColumnResizing = flag; } - (BOOL) allowsColumnResizing { return _allowsColumnResizing; } - (void) setAllowsMultipleSelection: (BOOL)flag { _allowsMultipleSelection = flag; } - (BOOL) allowsMultipleSelection { return _allowsMultipleSelection; } - (void) setAllowsEmptySelection: (BOOL)flag { _allowsEmptySelection = flag; } - (BOOL) allowsEmptySelection { return _allowsEmptySelection; } - (void) setAllowsColumnSelection: (BOOL)flag { _allowsColumnSelection = flag; } - (BOOL) allowsColumnSelection { return _allowsColumnSelection; } /* * Drawing Attributes */ - (void) setIntercellSpacing: (NSSize)aSize { _intercellSpacing = aSize; [self setNeedsDisplay: YES]; } - (NSSize) intercellSpacing { return _intercellSpacing; } - (void) setRowHeight: (CGFloat)rowHeight { _rowHeight = rowHeight; [self tile]; } - (CGFloat) rowHeight { return _rowHeight; } - (void) setBackgroundColor: (NSColor *)aColor { ASSIGN (_backgroundColor, aColor); } - (NSColor *) backgroundColor { return _backgroundColor; } - (void) setUsesAlternatingRowBackgroundColors: (BOOL)useAlternatingRowColors { // FIXME } - (BOOL) usesAlternatingRowBackgroundColors { // FIXME return NO; } /* * Selecting Columns and Rows */ - (void) selectColumn: (NSInteger)columnIndex byExtendingSelection: (BOOL)flag { if (columnIndex < 0 || columnIndex > _numberOfColumns) { NSDebugLLog(@"NSTableView", @"Column index %d out of table in selectColumn", (int)columnIndex); return; } _selectingColumns = YES; if (flag == NO) { /* If the current selection is the one we want, just ends editing * This is not just a speed up, it prevents us from sending * a NSTableViewSelectionDidChangeNotification. * This behaviour is required by the specifications */ if ([_selectedColumns count] == 1 && [_selectedColumns containsIndex: columnIndex] == YES) { /* Stop editing if any */ if (_textObject != nil) { [self validateEditing]; [self abortEditing]; } return; } /* If _numberOfColumns == 1, we can skip trying to deselect the only column - because we have been called to select it. */ if (_numberOfColumns > 1) { [self _unselectAllColumns]; } } else // flag == YES { if (_allowsMultipleSelection == NO) { [NSException raise: NSInternalInconsistencyException format: @"Can not extend selection in table view when multiple selection is disabled"]; } } /* Stop editing if any */ if (_textObject != nil) { [self validateEditing]; [self abortEditing]; } /* Now select the column and post notification only if needed */ if ([_selectedColumns containsIndex: columnIndex] == NO) { [_selectedColumns addIndex: columnIndex]; _selectedColumn = columnIndex; [self setNeedsDisplayInRect: [self rectOfColumn: columnIndex]]; if (_headerView) { [_headerView setNeedsDisplayInRect: [_headerView headerRectOfColumn: columnIndex]]; } [self _postSelectionDidChangeNotification]; } else /* Otherwise simply change the last selected column */ { _selectedColumn = columnIndex; } } - (void) selectRow: (NSInteger)rowIndex byExtendingSelection: (BOOL)flag { if (rowIndex < 0 || rowIndex >= _numberOfRows) { NSDebugLLog(@"NSTableView", @"Row index %d out of table in selectRow", (int)rowIndex); return; } if (_selectingColumns) { _selectingColumns = NO; if (_headerView) { [_headerView setNeedsDisplay: YES]; } } if (flag == NO) { /* If the current selection is the one we want, just ends editing * This is not just a speed up, it prevents us from sending * a NSTableViewSelectionDidChangeNotification. * This behaviour is required by the specifications */ if ([_selectedRows count] == 1 && [_selectedRows containsIndex: rowIndex] == YES) { /* Stop editing if any */ if (_textObject != nil) { [self validateEditing]; [self abortEditing]; } /* reset the _clickedRow for keyboard navigation */ _clickedRow = rowIndex; return; } /* If _numberOfRows == 1, we can skip trying to deselect the only row - because we have been called to select it. */ if (_numberOfRows > 1) { [self _unselectAllRows]; } } else // flag == YES { if (_allowsMultipleSelection == NO) { [NSException raise: NSInternalInconsistencyException format: @"Can not extend selection in table view when multiple selection is disabled"]; } } /* Stop editing if any */ if (_textObject != nil) { [self validateEditing]; [self abortEditing]; } /* * Now select the row and post notification only if needed * also update the _clickedRow for keyboard navigation. */ if ([self _selectUnselectedRow: rowIndex]) { _clickedRow = rowIndex; [self _postSelectionDidChangeNotification]; } else /* Otherwise simply change the last selected row */ { _selectedRow = rowIndex; _clickedRow = rowIndex; } } - (void) selectColumnIndexes: (NSIndexSet *)indexes byExtendingSelection: (BOOL)extend { BOOL empty = ([indexes firstIndex] == NSNotFound); BOOL changed = NO; NSUInteger col; if (!_selectingColumns) { _selectingColumns = YES; if (_headerView) { [_headerView setNeedsDisplay: YES]; } } /* Stop editing if any */ if (_textObject != nil) { [self validateEditing]; [self abortEditing]; } if (extend == NO) { /* If the current selection is the one we want, just ends editing * This is not just a speed up, it prevents us from sending * a NSTableViewSelectionDidChangeNotification. * This behaviour is required by the specifications */ if ([_selectedColumns isEqual: indexes]) { if (!empty) { _selectedColumn = [indexes lastIndex]; } return; } [self _unselectAllColumns]; changed = YES; } if (!empty) { if ([indexes lastIndex] >= _numberOfColumns) { [NSException raise: NSInvalidArgumentException format: @"Column index out of table in selectColumn"]; } /* This check is not fully correct, as both sets may contain just the same entry, but works according to the old specification. */ if (_allowsMultipleSelection == NO && [_selectedColumns count] + [indexes count] > 1) { [NSException raise: NSInternalInconsistencyException format: @"Can not set multiple selection in table view when multiple selection is disabled"]; } col = [indexes firstIndex]; while (col != NSNotFound) { if (![_selectedColumns containsIndex: col]) { [self setNeedsDisplayInRect: [self rectOfColumn: col]]; if (_headerView) { [_headerView setNeedsDisplayInRect: [_headerView headerRectOfColumn: col]]; } changed = YES; } col = [indexes indexGreaterThanIndex: col]; } [_selectedColumns addIndexes: indexes]; _selectedColumn = [indexes lastIndex]; } if (changed) { [self _postSelectionDidChangeNotification]; } } - (void) selectRowIndexes: (NSIndexSet *)indexes byExtendingSelection: (BOOL)extend { BOOL empty = ([indexes firstIndex] == NSNotFound); BOOL changed = NO; NSUInteger row; if (_selectingColumns) { _selectingColumns = NO; if (_headerView) { [_headerView setNeedsDisplay: YES]; } } /* Stop editing if any */ if (_textObject != nil) { [self validateEditing]; [self abortEditing]; } if (extend == NO) { /* If the current selection is the one we want, just ends editing * This is not just a speed up, it prevents us from sending * a NSTableViewSelectionDidChangeNotification. * This behaviour is required by the specifications */ if ([_selectedRows isEqual: indexes]) { if (!empty) { _selectedRow = [indexes lastIndex]; } return; } [self _unselectAllRows]; changed = YES; } if (!empty) { if ([indexes lastIndex] >= _numberOfRows) { [NSException raise: NSInvalidArgumentException format: @"Row index out of table in selectRow"]; } /* This check is not fully correct, as both sets may contain just the same entry, but works according to the old specification. */ if (_allowsMultipleSelection == NO && [_selectedRows count] + [indexes count] > 1) { [NSException raise: NSInternalInconsistencyException format: @"Can not set multiple selection in table view when multiple selection is disabled"]; } row = [indexes firstIndex]; while (row != NSNotFound) { if (![_selectedRows containsIndex: row]) { [self setNeedsDisplayInRect: [self rectOfRow: row]]; } row = [indexes indexGreaterThanIndex: row]; } [_selectedRows addIndexes: indexes]; _selectedRow = [indexes lastIndex]; changed = YES; } if (changed) { [self _postSelectionDidChangeNotification]; } } - (NSIndexSet *) selectedColumnIndexes { return [[_selectedColumns copy] autorelease]; } - (NSIndexSet *) selectedRowIndexes { return [[_selectedRows copy] autorelease]; } - (void) deselectColumn: (NSInteger)columnIndex { if ([_selectedColumns containsIndex: columnIndex] == NO) { return; } /* Now by internal consistency we assume columnIndex is in fact a valid column index, since it was the index of a selected column */ if (_textObject != nil) { [self validateEditing]; [self abortEditing]; } _selectingColumns = YES; [_selectedColumns removeIndex: columnIndex]; if (_selectedColumn == columnIndex) { NSUInteger less = [_selectedColumns indexLessThanIndex: columnIndex]; NSUInteger greater = [_selectedColumns indexGreaterThanIndex: columnIndex]; if (less == NSNotFound) { if (greater == NSNotFound) { _selectedColumn = -1; } else { _selectedColumn = greater; } } else if (greater == NSNotFound) { _selectedColumn = less; } else if (columnIndex - less > greater - columnIndex) { _selectedColumn = greater; } else { _selectedColumn = less; } } [self setNeedsDisplayInRect: [self rectOfColumn: columnIndex]]; if (_headerView) { [_headerView setNeedsDisplayInRect: [_headerView headerRectOfColumn: columnIndex]]; } [self _postSelectionDidChangeNotification]; } - (void) deselectRow: (NSInteger)rowIndex { if ([_selectedRows containsIndex: rowIndex] == NO) { return; } if (_textObject != nil) { [self validateEditing]; [self abortEditing]; } _selectingColumns = NO; [_selectedRows removeIndex: rowIndex]; if (_selectedRow == rowIndex) { NSUInteger less = [_selectedRows indexLessThanIndex: rowIndex]; NSUInteger greater = [_selectedRows indexGreaterThanIndex: rowIndex]; if (less == NSNotFound) { if (greater == NSNotFound) { _selectedRow = -1; } else { _selectedRow = greater; } } else if (greater == NSNotFound) { _selectedRow = less; } else if (rowIndex - less > greater - rowIndex) { _selectedRow = greater; } else { _selectedRow = less; } } [self _postSelectionDidChangeNotification]; } - (NSInteger) numberOfSelectedColumns { return [_selectedColumns count]; } - (NSInteger) numberOfSelectedRows { return [_selectedRows count]; } - (NSInteger) selectedColumn { return _selectedColumn; } - (NSInteger) selectedRow { return _selectedRow; } - (BOOL) isColumnSelected: (NSInteger)columnIndex { return [_selectedColumns containsIndex: columnIndex]; } - (BOOL) isRowSelected: (NSInteger)rowIndex { return [_selectedRows containsIndex: rowIndex]; } - (NSEnumerator *) selectedColumnEnumerator { return [[self _selectedColumArray] objectEnumerator]; } - (NSEnumerator *) selectedRowEnumerator { return [[self _selectedRowArray] objectEnumerator]; } - (void) selectAll: (id) sender { if (_allowsMultipleSelection == NO) return; /* Ask the delegate if we can select all columns or rows */ if (_selectingColumns == YES) { if ([_selectedColumns count] == (NSUInteger)_numberOfColumns) { // Nothing to do ! return; } { NSEnumerator *enumerator = [_tableColumns objectEnumerator]; NSTableColumn *tb; while ((tb = [enumerator nextObject]) != nil) { if ([self _shouldSelectTableColumn: tb] == NO) { return; } } } } else // selecting rows { if ([_selectedRows count] == (NSUInteger)_numberOfRows) { // Nothing to do ! return; } { NSInteger row; for (row = 0; row < _numberOfRows; row++) { if ([self _shouldSelectRow: row] == NO) return; } } } /* Stop editing if any */ if (_textObject != nil) { [self validateEditing]; [self abortEditing]; } /* Do the real selection */ if (_selectingColumns == YES) { [_selectedColumns removeAllIndexes]; [_selectedColumns addIndexesInRange: NSMakeRange(0, _numberOfColumns)]; } else // selecting rows { [_selectedRows removeAllIndexes]; [_selectedRows addIndexesInRange: NSMakeRange(0, _numberOfRows)]; } [self setNeedsDisplay: YES]; [self _postSelectionDidChangeNotification]; } - (void) deselectAll: (id) sender { if (_allowsEmptySelection == NO) return; if ([self _shouldSelectionChange] == NO) { return; } if (_textObject != nil) { [self validateEditing]; [self abortEditing]; } if (([_selectedColumns count] > 0) || ([_selectedRows count] > 0)) { [_selectedColumns removeAllIndexes]; [_selectedRows removeAllIndexes]; _selectedColumn = -1; _selectedRow = -1; _selectingColumns = NO; [self setNeedsDisplay: YES]; [self _postSelectionDidChangeNotification]; } else { _selectedColumn = -1; _selectedRow = -1; _selectingColumns = NO; } } /* * Grid Drawing attributes */ - (void) setDrawsGrid: (BOOL)flag { _drawsGrid = flag; } - (BOOL) drawsGrid { return _drawsGrid; } - (void) setGridColor: (NSColor *)aColor { ASSIGN (_gridColor, aColor); } - (NSColor *) gridColor { return _gridColor; } - (void) setGridStyleMask: (NSTableViewGridLineStyle)gridType { // FIXME } - (NSTableViewGridLineStyle) gridStyleMask { // FIXME return 0; } /* * Providing Cells */ - (NSCell *) preparedCellAtColumn: (NSInteger)columnIndex row: (NSInteger)rowIndex { NSCell *cell = nil; NSTableColumn *tb = [_tableColumns objectAtIndex: columnIndex]; if ([_delegate respondsToSelector: @selector(tableView:dataCellForTableColumn:row:)]) { cell = [_delegate tableView: self dataCellForTableColumn: tb row: rowIndex]; } if (cell == nil) { cell = [tb dataCellForRow: rowIndex]; } return cell; } /* * Editing Cells */ - (BOOL) abortEditing { if (_textObject) { [_editedCell endEditing: _textObject]; DESTROY(_editedCell); [self setNeedsDisplayInRect: [self frameOfCellAtColumn: _editedColumn row: _editedRow]]; _editedRow = -1; _editedColumn = -1; _textObject = nil; return YES; } else return NO; } - (NSText *) currentEditor { if (_textObject && ([_window firstResponder] == _textObject)) return _textObject; else return nil; } - (void) validateEditing { if (_textObject && (_isValidating == NO)) { NSFormatter *formatter; NSString *string; id newObjectValue = nil; BOOL validatedOK = YES; // Avoid potential recursive sequences... _isValidating = YES; formatter = [_editedCell formatter]; string = AUTORELEASE([[_textObject text] copy]); if (formatter != nil) { NSString *error; if ([formatter getObjectValue: &newObjectValue forString: string errorDescription: &error] == YES) { [_editedCell setObjectValue: newObjectValue]; if (_dataSource_editable) { NSTableColumn *tb; tb = [_tableColumns objectAtIndex: _editedColumn]; [self _setObjectValue: newObjectValue forTableColumn: tb row: _editedRow]; } return; } else { SEL sel = @selector(control:didFailToFormatString:errorDescription:); if ([_delegate respondsToSelector: sel]) { validatedOK = [_delegate control: self didFailToFormatString: string errorDescription: error]; } // Allow an empty string to fall through else if (![string isEqualToString: @""]) { validatedOK = NO; } } } if (validatedOK) { [_editedCell setStringValue: string]; if (_dataSource_editable) { NSTableColumn *tb; tb = [_tableColumns objectAtIndex: _editedColumn]; [self _setObjectValue: string // newObjectValue forTableColumn: tb row: _editedRow]; } } // Avoid potential recursive sequences... _isValidating = NO; } } - (void) editColumn: (NSInteger) columnIndex row: (NSInteger) rowIndex withEvent: (NSEvent *) theEvent select: (BOOL) flag { NSText *t; NSTableColumn *tb; NSRect drawingRect; NSUInteger length = 0; if (rowIndex != _selectedRow) { [NSException raise:NSInvalidArgumentException format:@"Attempted to edit unselected row"]; } if (rowIndex < 0 || rowIndex >= _numberOfRows || columnIndex < 0 || columnIndex >= _numberOfColumns) { [NSException raise: NSInvalidArgumentException format: @"Row/column out of index in edit"]; } [self scrollRowToVisible: rowIndex]; [self scrollColumnToVisible: columnIndex]; if (_textObject != nil) { [self validateEditing]; [self abortEditing]; } // Now (_textObject == nil) t = [_window fieldEditor: YES forObject: self]; if ([t superview] != nil) { if ([t resignFirstResponder] == NO) { return; } } _editedRow = rowIndex; _editedColumn = columnIndex; // Prepare the cell // NB: need to be released when no longer used _editedCell = [[self preparedCellAtColumn: columnIndex row: rowIndex] copy]; tb = [_tableColumns objectAtIndex: columnIndex]; [_editedCell setObjectValue: [self _objectValueForTableColumn: tb row: rowIndex]]; // But of course the delegate can mess it up if it wants [self _willDisplayCell: _editedCell forTableColumn: tb row: rowIndex]; /* Please note the important point - calling stringValue normally causes the _editedCell to call the validateEditing method of its control view ... which happens to be this NSTableView object :-) but we don't want any spurious validateEditing to be performed before the actual editing is started (otherwise you easily end up with the table view picking up the string stored in the field editor, which is likely to be the string resulting from the last edit somewhere else ... getting into the bug that when you TAB from one cell to another one, the string is copied!), so we must call stringValue when _textObject is still nil. */ if (flag) { length = [[_editedCell stringValue] length]; } _textObject = [_editedCell setUpFieldEditorAttributes: t]; // FIXME: Which background color do we want here? [_textObject setBackgroundColor: [NSColor selectedControlColor]]; [_textObject setDrawsBackground: YES]; drawingRect = [self frameOfCellAtColumn: columnIndex row: rowIndex]; if (flag) { [_editedCell selectWithFrame: drawingRect inView: self editor: _textObject delegate: self start: 0 length: length]; } else { [_editedCell editWithFrame: drawingRect inView: self editor: _textObject delegate: self event: theEvent]; } return; } - (NSInteger) editedRow { return _editedRow; } - (NSInteger) editedColumn { return _editedColumn; } static inline float computePeriod(NSPoint mouseLocationWin, float minYVisible, float maxYVisible) { /* We have three zones of speed. 0 - 50 pixels: period 0.2 50 - 100 pixels: period 0.1 100 - 150 pixels: period 0.01 */ float distance = 0; if (mouseLocationWin.y < minYVisible) { distance = minYVisible - mouseLocationWin.y; } else if (mouseLocationWin.y > maxYVisible) { distance = mouseLocationWin.y - maxYVisible; } if (distance < 50) return 0.2; else if (distance < 100) return 0.1; else return 0.01; } - (void) _trackCellAtColumn: (NSInteger) columnIndex row: (NSInteger) rowIndex withEvent: (NSEvent *) theEvent { if (rowIndex == -1 || columnIndex == -1) { return; } /* we should copy the cell here, as we do on editing. otherwise validation on a cell being edited could cause the cell we are selecting to get it's objectValue */ NSCell *cell = [[self preparedCellAtColumn: columnIndex row: rowIndex] copy]; NSTableColumn *tb = [_tableColumns objectAtIndex: columnIndex]; id originalValue = RETAIN([self _objectValueForTableColumn: tb row: rowIndex]); [cell setObjectValue: originalValue]; NSRect cellFrame = [self frameOfCellAtColumn: columnIndex row: rowIndex]; [cell setHighlighted: YES]; [self setNeedsDisplayInRect: cellFrame]; /* give delegate a chance to i.e set target */ [self _willDisplayCell: cell forTableColumn: tb row: rowIndex]; if ([cell trackMouse: theEvent inRect: cellFrame ofView: self untilMouseUp: [[cell class] prefersTrackingUntilMouseUp]]) { id newValue = [cell objectValue]; /* don't check editability that only pertains to editColumn:... */ if (originalValue != newValue && ![originalValue isEqual: newValue]) { [self _setObjectValue: newValue forTableColumn: tb row: rowIndex]; } } RELEASE(originalValue); [cell setHighlighted: NO]; [self setNeedsDisplayInRect: cellFrame]; RELEASE(cell); } - (BOOL) _startDragOperationWithEvent: (NSEvent *) theEvent { NSPasteboard *pboard = [NSPasteboard pasteboardWithName: NSDragPboard]; NSPoint startPoint = [self convertPoint: [theEvent locationInWindow] fromView: nil]; if ([self canDragRowsWithIndexes: _selectedRows atPoint: startPoint] && [self _writeRows: _selectedRows toPasteboard: pboard]) { NSPoint p = NSZeroPoint; NSImage *dragImage; NSSize s; // FIXME NSArray *cols = nil; dragImage = [self dragImageForRowsWithIndexes: _selectedRows tableColumns: cols event: theEvent offset: &p]; /* * Store image offset in s ... the returned * value is the position of the center of * the image, so we adjust to the bottom left * corner. */ s = [dragImage size]; s.width = p.x - s.width/2; s.height = p.y + s.height/2; // View is flipped /* * Reuse the current mouse location and adjust * it to determine the location of the bottom * left corner of the image in this view's * coordinate system. */ p = startPoint; p.x += s.width; p.y += s.height; [self dragImage: dragImage at: p offset: NSMakeSize(0, 0) event: theEvent pasteboard: pboard source: self slideBack: YES]; return YES; } return NO; } - (void) mouseDown: (NSEvent *)theEvent { NSPoint initialLocation = [theEvent locationInWindow]; NSPoint location; int clickCount = [theEvent clickCount]; // Pathological case -- ignore mouse down if ((_numberOfRows == 0) || (_numberOfColumns == 0)) { return; } /* Stop editing if any */ if (_textObject != nil) { if (_editedCell != nil && [_editedCell isEntryAcceptable:[_textObject text]] == NO) { NSBeep(); return; } [self validateEditing]; [self abortEditing]; } // Determine row and column which were clicked location = [self convertPoint: initialLocation fromView: nil]; _clickedRow = [self rowAtPoint: location]; _clickedColumn = [self columnAtPoint: location]; if ([theEvent type] == NSLeftMouseDown && clickCount > 1) { // Double-click event if (![self isRowSelected: _clickedRow]) { return; } if (![self _isCellSelectableColumn: _clickedColumn row: _clickedRow]) { // Send double-action but don't edit [self _trackCellAtColumn: _clickedColumn row: _clickedRow withEvent: theEvent]; if (_clickedRow != -1) [self sendAction: _doubleAction to: _target]; } else if (clickCount == 2) // if < 2, dont want to abort editing { // It is OK to edit column. Go on, do it. [self editColumn: _clickedColumn row: _clickedRow withEvent: theEvent select: YES]; } } else { #define COMPUTE_NEW_SELECTION do { \ if (originalRow == -1) \ { \ originalRow = currentRow; \ } \ if (currentRow >= 0 && currentRow < _numberOfRows) \ { \ computeNewSelection(self, \ oldSelectedRows, \ _selectedRows, \ originalRow, \ oldRow, \ currentRow, \ &_selectedRow, \ selectionMode); \ [self displayIfNeeded]; \ } \ } while (0); // Selection NSUInteger modifiers = [theEvent modifierFlags]; NSUInteger eventMask = (NSLeftMouseUpMask | NSLeftMouseDownMask | NSLeftMouseDraggedMask | NSPeriodicMask); unsigned selectionMode = 0; NSPoint mouseLocationWin; NSPoint mouseLocationView; NSDate *distantFuture = [NSDate distantFuture]; NSEvent *lastEvent; NSIndexSet *oldSelectedRows; BOOL startedPeriodicEvents = NO; BOOL mouseBelowView = NO; BOOL done = NO; BOOL mouseMoved = NO; BOOL didTrackCell = NO; BOOL dragOperationPossible = [self _isDraggingSource]; NSRect visibleRect = [self convertRect: [self visibleRect] toView: nil]; CGFloat minYVisible = NSMinY (visibleRect); CGFloat maxYVisible = NSMaxY (visibleRect); float oldPeriod = 0; int originalRow = _clickedRow; int oldRow = -1; int currentRow = -1; BOOL getNextEvent = YES; BOOL sendAction = NO; if (_allowsMultipleSelection == YES) { selectionMode |= ALLOWS_MULTIPLE; } if (_allowsEmptySelection == YES) { selectionMode |= ALLOWS_EMPTY; } if (modifiers & NSShiftKeyMask) { selectionMode |= SHIFT_DOWN; } if (![_selectedRows containsIndex: _clickedRow]) { selectionMode |= ADDING_ROW; } if (modifiers & NSControlKeyMask) { selectionMode |= CONTROL_DOWN; if (_allowsMultipleSelection == YES && _selectedRow != -1) { originalRow = _selectedRow; selectionMode |= SHIFT_DOWN; selectionMode |= ADDING_ROW; } } // is the delegate ok for a new selection ? if ([self _shouldSelectionChange] == NO) { return; } // if we are in column selection mode, stop it [self _setSelectingColumns: NO]; // let's sort the _selectedRows oldSelectedRows = [_selectedRows copy]; lastEvent = theEvent; while (done != YES) { /* Wrap each iteration in an autorelease pool. Otherwise, we end up allocating huge amounts of objects if the button is held down for a long time. */ CREATE_AUTORELEASE_POOL(arp); NSEventType eventType = [lastEvent type]; mouseLocationWin = [lastEvent locationInWindow]; mouseLocationView = [self convertPoint: mouseLocationWin fromView: nil]; switch (eventType) { case NSLeftMouseUp: if ((mouseLocationWin.y > minYVisible) && (mouseLocationWin.y < maxYVisible)) { // mouse up within table if (startedPeriodicEvents == YES) { [NSEvent stopPeriodicEvents]; startedPeriodicEvents = NO; } mouseLocationView.x = _bounds.origin.x; oldRow = currentRow; currentRow = [self rowAtPoint: mouseLocationView]; if (oldRow != currentRow) { COMPUTE_NEW_SELECTION; } if (!didTrackCell && currentRow == _clickedRow) { /* * a dragging operation is still possible so * selections were never dragged, * and a drag operation was never attempted. * the cell was clicked, * track the cell with the old mouseDown event * then it will get the current event mouseUp. */ [self _trackCellAtColumn: _clickedColumn row: _clickedRow withEvent: theEvent]; } } else { // Mouse dragged out of the table // we don't care } done = YES; break; case NSLeftMouseDown: case NSLeftMouseDragged: if (fabs(mouseLocationWin.x - initialLocation.x) > 1 || fabs(mouseLocationWin.y - initialLocation.y) > 1) { mouseMoved = YES; } if (dragOperationPossible == YES) { if ([_selectedRows containsIndex:_clickedRow] == NO || (_verticalMotionDrag == NO && fabs(mouseLocationWin.y - initialLocation.y) > 2)) { dragOperationPossible = NO; } else if ((fabs(mouseLocationWin.x - initialLocation.x) >= 4) || (_verticalMotionDrag && fabs(mouseLocationWin.y - initialLocation.y) >= 4)) { if ([self _startDragOperationWithEvent: theEvent]) { RELEASE(oldSelectedRows); IF_NO_GC(DESTROY(arp)); return; } else { dragOperationPossible = NO; } } } else if ((mouseLocationWin.y > minYVisible) && (mouseLocationWin.y < maxYVisible)) { // mouse dragged within table if (startedPeriodicEvents == YES) { [NSEvent stopPeriodicEvents]; startedPeriodicEvents = NO; } mouseLocationView.x = _bounds.origin.x; oldRow = currentRow; currentRow = [self rowAtPoint: mouseLocationView]; if (oldRow != currentRow) { COMPUTE_NEW_SELECTION; } if (eventType == NSLeftMouseDown) { /* * Can never get here from a dragging source * so they need to track in mouse up. */ NSCell *cell = [self preparedCellAtColumn: _clickedColumn row: _clickedRow]; [self _trackCellAtColumn: _clickedColumn row: _clickedRow withEvent: theEvent]; didTrackCell = YES; if ([[cell class] prefersTrackingUntilMouseUp]) { /* the mouse could have gone up outside of the cell * avoid selecting the row under mouse cursor */ sendAction = YES; done = YES; } } /* * Since we may have tracked a cell which may have caused * a change to the currentEvent we may need to loop over * the current event */ getNextEvent = (lastEvent == [NSApp currentEvent]); } else { // Mouse dragged out of the table float period = computePeriod(mouseLocationWin, minYVisible, maxYVisible); if (startedPeriodicEvents == YES) { /* Check - if the mouse did not change zone, we do nothing */ if (period == oldPeriod) break; [NSEvent stopPeriodicEvents]; } /* Start periodic events */ oldPeriod = period; [NSEvent startPeriodicEventsAfterDelay: 0 withPeriod: oldPeriod]; startedPeriodicEvents = YES; if (mouseLocationWin.y <= minYVisible) mouseBelowView = YES; else mouseBelowView = NO; } break; case NSPeriodic: if (mouseBelowView == YES) { if (currentRow == -1 && oldRow != -1) currentRow = oldRow + 1; if (currentRow != -1 && currentRow < _numberOfRows - 1) { oldRow = currentRow; currentRow++; [self scrollRowToVisible: currentRow]; if (dragOperationPossible == NO) COMPUTE_NEW_SELECTION; } } else { if (currentRow == -1 && oldRow != -1) currentRow = oldRow - 1; if (currentRow > 0) { oldRow = currentRow; currentRow--; [self scrollRowToVisible: currentRow]; if (dragOperationPossible == NO) COMPUTE_NEW_SELECTION; } } break; default: break; } if (done == NO) { /* in certain cases we are working with events that have already * occured and been dequeued by NSCell classes, in these cases * getNextEvent is set to NO, use the current event. */ if (getNextEvent == YES) { lastEvent = [NSApp nextEventMatchingMask: eventMask untilDate: distantFuture inMode: NSEventTrackingRunLoopMode dequeue: YES]; } else { lastEvent = [NSApp currentEvent]; getNextEvent = YES; } } IF_NO_GC(DESTROY(arp)); } if (startedPeriodicEvents == YES) [NSEvent stopPeriodicEvents]; if (![_selectedRows isEqual: oldSelectedRows]) { [self _postSelectionDidChangeNotification]; } RELEASE(oldSelectedRows); if (!mouseMoved) sendAction = YES; /* If this was a simple click (ie. no dragging), we send our action. */ if (sendAction) { /* _clickedRow and _clickedColumn are already set at the start of this function. TODO: should we ask the data source/column for the cell for this row/column and check whether it has its own action/target? */ if (_clickedRow != -1) [self sendAction: _action to: _target]; } } _clickedRow = _selectedRow; } /* helpers for keyboard selection */ #define CHECK_CHANGING(x) { \ if (!x) \ { \ [self _postSelectionIsChangingNotification]; \ x = YES; \ } \ } static BOOL selectContiguousRegion(NSTableView *self, NSIndexSet *_selectedRows, int originalRow, int oldRow, int currentRow) { int first = (oldRow < currentRow) ? oldRow : currentRow; int last = (oldRow < currentRow) ? currentRow : oldRow; int row; BOOL notified = NO; if (![_selectedRows containsIndex: currentRow]) { CHECK_CHANGING(notified); [self _selectRow: currentRow]; } /* * check if the old row is not between the current row and the original row * and not the original or current rows */ if (((!((oldRow < currentRow && currentRow > originalRow && oldRow > originalRow) || (oldRow > currentRow && currentRow < originalRow && oldRow < originalRow))) && (!(oldRow == currentRow || oldRow == originalRow)))) { CHECK_CHANGING(notified); [self _unselectRow: oldRow]; } /* * there is an off by one here it could be on either end of the loop * but its either oldRow or currentRow so above we select the currentRow * and possibly unselect the oldRow, one of the two will then * be selected or deselected again in in this loop */ for (row = first; row < last; row++) { /* check if the old row is between the current row and the original row */ if ((row < currentRow && row > originalRow && currentRow > oldRow) || (row > currentRow && row < originalRow && currentRow < oldRow)) { if (![_selectedRows containsIndex: row]) { CHECK_CHANGING(notified); [self _selectRow: row]; } } else if (row == currentRow || row == originalRow) { if (![_selectedRows containsIndex: row]) { CHECK_CHANGING(notified); [self _selectRow: row]; } } else { if ([_selectedRows containsIndex: row]) { CHECK_CHANGING(notified); [self _unselectRow: row]; } } } return notified; } - (void) keyDown: (NSEvent *)theEvent { NSInteger oldRow = -1; NSInteger currentRow = _selectedRow; NSInteger originalRow = -1; NSString *characters = [theEvent characters]; NSUInteger len = [characters length]; NSUInteger modifiers = [theEvent modifierFlags]; CGFloat rowHeight = [self rowHeight]; NSRect visRect = [self visibleRect]; BOOL modifySelection = YES; NSPoint noModPoint = NSZeroPoint; NSInteger visRows; NSUInteger i; BOOL gotMovementKey = NO; // will not contain partial rows. visRows = visRect.size.height / [self rowHeight]; // _clickedRow is stored between calls as the first selected row // when doing multiple selection, so the selection may grow and shrink. /* * do a contiguous selection on shift */ if (modifiers & NSShiftKeyMask) { originalRow = _clickedRow; if (_allowsMultipleSelection == YES) { oldRow = _selectedRow; } } /* just scroll don't modify any selection */ if (modifiers & NSControlKeyMask) { modifySelection = NO; } for (i = 0; i < len; i++) { unichar c = [characters characterAtIndex: i]; switch (c) { case NSUpArrowFunctionKey: gotMovementKey = YES; if (modifySelection == NO) { noModPoint.x = visRect.origin.x; noModPoint.y = NSMinY(visRect) - rowHeight; } else { currentRow--; } break; case NSDownArrowFunctionKey: gotMovementKey = YES; if (modifySelection == NO) { noModPoint.x = visRect.origin.x; noModPoint.y = NSMinY(visRect) + rowHeight; } else { currentRow++; } break; case NSPageDownFunctionKey: gotMovementKey = YES; if (modifySelection == NO) { noModPoint.x = visRect.origin.x; noModPoint.y = NSMinY(visRect) + (rowHeight * visRows) - rowHeight; } else { currentRow += visRows; } break; case NSPageUpFunctionKey: gotMovementKey = YES; if (modifySelection == NO) { noModPoint.x = visRect.origin.x; noModPoint.y = NSMinY(visRect) - (rowHeight * visRows) + rowHeight; } else { currentRow -= visRows; } break; case NSHomeFunctionKey: gotMovementKey = YES; if (modifySelection == NO) { noModPoint.x = visRect.origin.x; noModPoint.y = NSMinY(_bounds); } else { currentRow = 0; } break; case NSEndFunctionKey: gotMovementKey = YES; if (modifySelection == NO) { noModPoint.x = visRect.origin.x; noModPoint.y = NSMaxY(_bounds); } else { currentRow = _numberOfRows - 1; } break; default: break; } } /* * if scrolled off the bottom or top the selection. * the modifiers might have changed so recompute the selection. */ if (gotMovementKey == NO) { /* no handled keys. */ [super keyDown: theEvent]; return; } else if (currentRow < 0) { currentRow = 0; } else if (currentRow >= _numberOfRows) { currentRow = _numberOfRows - 1; } if (_numberOfRows) { if (modifySelection) { BOOL notified = NO; [self _setSelectingColumns: NO]; if (originalRow == -1) { /* we're not extending any selection */ originalRow = currentRow; _clickedRow = currentRow; } if (_clickedRow == -1) { /* user must have hit a key with no selected rows */ _clickedRow = currentRow; } if ((!(modifiers & NSShiftKeyMask && _allowsMultipleSelection))) { int first = [_selectedRows firstIndex]; int last = [_selectedRows lastIndex]; if ((first == last && first == currentRow) == 0) { CHECK_CHANGING(notified) [self _unselectAllRows]; [self _selectRow: currentRow]; _selectedRow = currentRow; } } else { notified = selectContiguousRegion(self, _selectedRows, originalRow, oldRow, currentRow); _selectedRow = currentRow; } if (notified) { [self _postSelectionDidChangeNotification]; } [self scrollRowToVisible: currentRow]; [self displayIfNeeded]; } else { noModPoint = [self convertPoint: noModPoint toView: _super_view]; noModPoint = [(NSClipView *)_super_view constrainScrollPoint: noModPoint]; [(NSClipView *)_super_view scrollToPoint: noModPoint]; } } } /* * Auxiliary Components */ - (void) setHeaderView: (NSTableHeaderView*)aHeaderView { if ([_headerView respondsToSelector:@selector(setTableView:)]) [_headerView setTableView: nil]; ASSIGN (_headerView, aHeaderView); if ([_headerView respondsToSelector:@selector(setTableView:)]) [_headerView setTableView: self]; [self tile]; // resizes corner and header views, then displays if (_super_view != nil) { id ssv = [_super_view superview]; if ([ssv isKindOfClass: [NSScrollView class]]) [ssv tile]; // draws any border type over corner and header views } } - (NSTableHeaderView*) headerView { return _headerView; } - (void) setCornerView: (NSView*)aView { ASSIGN (_cornerView, aView); [self tile]; // resizes corner and header views, then displays if (_super_view) { id ssv = [_super_view superview]; if ([ssv isKindOfClass: [NSScrollView class]]) [ssv tile]; // draws any border type over corner and header views } } - (NSView*) cornerView { return _cornerView; } /* * Layout */ - (NSRect) rectOfColumn: (NSInteger)columnIndex { NSRect rect; if (columnIndex < 0 || columnIndex > _numberOfColumns) { NSDebugLLog(@"NSTableView", @"Column index %d out of table in rectOfColumn", (int)columnIndex); return NSZeroRect; } rect.origin.x = _columnOrigins[columnIndex]; rect.origin.y = _bounds.origin.y; rect.size.width = [[_tableColumns objectAtIndex: columnIndex] width]; rect.size.height = _numberOfRows * _rowHeight; return rect; } - (NSRect) rectOfRow: (NSInteger)rowIndex { NSRect rect; if (rowIndex < 0 || rowIndex >= _numberOfRows) { NSDebugLLog(@"NSTableView", @"Row index %d out of table in rectOfRow", (int)rowIndex); return NSZeroRect; } rect.origin.x = _bounds.origin.x; rect.origin.y = _bounds.origin.y + (_rowHeight * rowIndex); rect.size.width = _bounds.size.width; rect.size.height = _rowHeight; return rect; } /** Returns the indexes of the table columns which intersects the given rect. The rect is expressed in the receiver coordinate space. Hidden table columns are never tested. */ - (NSIndexSet *) columnIndexesInRect: (NSRect)aRect { NSRange range = [self columnsInRect: aRect]; NSMutableIndexSet *indexes = [NSMutableIndexSet indexSetWithIndexesInRange: range]; int i; for (i = range.location; i < range.length; i++) { NSTableColumn *tableColumn = [_tableColumns objectAtIndex: i]; if ([tableColumn isHidden]) [indexes removeIndex: i]; } return indexes; } /** Returns the index range of the table columns which intersects the given rect. The rect is expressed in the receiver coordinate space. The returned range can include hidden table column indexes. This method is deprecated, use -columnIndexesInRect:. */ - (NSRange) columnsInRect: (NSRect)aRect { NSRange range; range.location = [self columnAtPoint: aRect.origin]; range.length = [self columnAtPoint: NSMakePoint (NSMaxX (aRect), _bounds.origin.y)]; range.length -= range.location; range.length += 1; return range; } - (NSRange) rowsInRect: (NSRect)aRect { NSRange range; int lastRowInRect; range.location = [self rowAtPoint: aRect.origin]; lastRowInRect = [self rowAtPoint: NSMakePoint (_bounds.origin.x, NSMaxY (aRect))]; if (lastRowInRect == -1) { lastRowInRect = _numberOfRows - 1; } range.length = lastRowInRect; range.length -= range.location; range.length += 1; return range; } - (NSInteger) columnAtPoint: (NSPoint)aPoint { if ((NSMouseInRect (aPoint, _bounds, YES)) == NO) { return -1; } else { int i = 0; while ((i < _numberOfColumns) && (aPoint.x >= _columnOrigins[i])) { i++; } return i - 1; } } - (NSInteger) rowAtPoint: (NSPoint)aPoint { /* NB: Y coordinate system is flipped in NSTableView */ if ((NSMouseInRect (aPoint, _bounds, YES)) == NO) { return -1; } else { int return_value; aPoint.y -= _bounds.origin.y; return_value = (int) (aPoint.y / _rowHeight); /* This could happen if point lies on the grid line or below the last row */ if (return_value >= _numberOfRows) { return_value = -1; } return return_value; } } - (NSRect) frameOfCellAtColumn: (NSInteger)columnIndex row: (NSInteger)rowIndex { NSRect frameRect; if ((columnIndex < 0) || (rowIndex < 0) || (columnIndex > (_numberOfColumns - 1)) || (rowIndex > (_numberOfRows - 1))) return NSZeroRect; frameRect.origin.y = _bounds.origin.y + (rowIndex * _rowHeight); frameRect.origin.y += _intercellSpacing.height / 2; frameRect.size.height = _rowHeight - _intercellSpacing.height; frameRect.origin.x = _columnOrigins[columnIndex]; frameRect.origin.x += _intercellSpacing.width / 2; frameRect.size.width = [[_tableColumns objectAtIndex: columnIndex] width]; frameRect.size.width -= _intercellSpacing.width; // We add some space to separate the cell from the grid if (_drawsGrid) { frameRect.size.width -= 4; frameRect.origin.x += 2; } // Safety check if (frameRect.size.width < 0) frameRect.size.width = 0; return frameRect; } - (void) setAutoresizesAllColumnsToFit: (BOOL)flag { _autoresizesAllColumnsToFit = flag; } - (BOOL) autoresizesAllColumnsToFit { return _autoresizesAllColumnsToFit; } - (NSTableViewColumnAutoresizingStyle) columnAutoresizingStyle { // FIXME return NSTableViewNoColumnAutoresizing; } - (void) setColumnAutoresizingStyle: (NSTableViewColumnAutoresizingStyle)style { // FIXME } - (void) sizeLastColumnToFit { if ((_super_view != nil) && (_numberOfColumns > 0)) { float excess_width; float last_column_width; NSTableColumn *lastColumn; lastColumn = [_tableColumns objectAtIndex: (_numberOfColumns - 1)]; if ([lastColumn isResizable] == NO) return; excess_width = NSMaxX([self convertRect: [_super_view bounds] fromView: _super_view]) - NSMaxX(_bounds); last_column_width = [lastColumn width] + excess_width; // This will automatically retile the table [lastColumn setWidth: last_column_width]; } } - (void) setFrame: (NSRect)frameRect { NSRect tmpRect = frameRect; if ([_super_view respondsToSelector: @selector(documentVisibleRect)]) { float rowsHeight = ((_numberOfRows * _rowHeight) + 1); NSRect docRect = [(NSClipView *)_super_view documentVisibleRect]; if (rowsHeight < docRect.size.height) { tmpRect.size.height = docRect.size.height; } else { tmpRect.size.height = rowsHeight; } // TODO width? } [super setFrame: tmpRect]; } - (void) setFrameSize: (NSSize)frameSize { NSSize tmpSize = frameSize; if ([_super_view respondsToSelector: @selector(documentVisibleRect)]) { float rowsHeight = ((_numberOfRows * _rowHeight) + 1); NSRect docRect = [(NSClipView *)_super_view documentVisibleRect]; if (rowsHeight < docRect.size.height) { tmpSize.height = docRect.size.height; } else { tmpSize.height = rowsHeight; } // TODO width? } [super setFrameSize: tmpSize]; } - (void) viewWillMoveToSuperview:(NSView *)newSuper { [super viewWillMoveToSuperview: newSuper]; /* need to potentially enlarge to fill the documentRect of the clip view */ [self setFrame: _frame]; } - (void) sizeToFit { NSTableColumn *tb; int i, j; float remainingWidth; columnSorting *columnInfo; float *currentWidth; float *maxWidth; float *minWidth; BOOL *isResizable; int numberOfCurrentColumns = 0; float previousPoint; float nextPoint; float toAddToCurrentColumns; if ((_super_view == nil) || (_numberOfColumns == 0)) return; columnInfo = NSZoneMalloc(NSDefaultMallocZone(), sizeof(columnSorting) * 2 * _numberOfColumns); currentWidth = NSZoneMalloc(NSDefaultMallocZone(), sizeof(float) * _numberOfColumns); maxWidth = NSZoneMalloc(NSDefaultMallocZone(), sizeof(float) * _numberOfColumns); minWidth = NSZoneMalloc(NSDefaultMallocZone(), sizeof(float) * _numberOfColumns); isResizable = NSZoneMalloc(NSDefaultMallocZone(), sizeof(BOOL) * _numberOfColumns); remainingWidth = NSMaxX([self convertRect: [_super_view bounds] fromView: _super_view]); /* * We store the minWidth and the maxWidth of every column * because we'll use those values *a lot* * At the same time we set every column to its mininum width */ for (i = 0; i < _numberOfColumns; i++) { tb = [_tableColumns objectAtIndex: i]; isResizable[i] = [tb isResizable]; if (isResizable[i] == YES) { minWidth[i] = [tb minWidth]; maxWidth[i] = [tb maxWidth]; if (minWidth[i] < 0) minWidth[i] = 0; if (minWidth[i] > maxWidth[i]) { minWidth[i] = [tb width]; maxWidth[i] = minWidth[i]; } columnInfo[i * 2].width = minWidth[i]; columnInfo[i * 2].isMax = 0; currentWidth[i] = minWidth[i]; remainingWidth -= minWidth[i]; columnInfo[i * 2 + 1].width = maxWidth[i]; columnInfo[i * 2 + 1].isMax = 1; } else { minWidth[i] = [tb width]; columnInfo[i * 2].width = minWidth[i]; columnInfo[i * 2].isMax = 0; currentWidth[i] = minWidth[i]; remainingWidth -= minWidth[i]; maxWidth[i] = minWidth[i]; columnInfo[i * 2 + 1].width = maxWidth[i]; columnInfo[i * 2 + 1].isMax = 1; } } // sort the info we have quick_sort_internal(columnInfo, 0, 2 * _numberOfColumns - 1); previousPoint = columnInfo[0].width; numberOfCurrentColumns = 1; if (remainingWidth >= 0.) { for (i = 1; i < 2 * _numberOfColumns; i++) { nextPoint = columnInfo[i].width; if (numberOfCurrentColumns > 0 && (nextPoint - previousPoint) > 0.) { int verification = 0; if ((nextPoint - previousPoint) * numberOfCurrentColumns <= remainingWidth) { toAddToCurrentColumns = nextPoint - previousPoint; remainingWidth -= (nextPoint - previousPoint) * numberOfCurrentColumns; for (j = 0; j < _numberOfColumns; j++) { if (minWidth[j] <= previousPoint && maxWidth[j] >= nextPoint) { verification++; currentWidth[j] += toAddToCurrentColumns; } } if (verification != numberOfCurrentColumns) { NSLog(@"[NSTableView sizeToFit]: unexpected error"); } } else { int remainingInt = floor(remainingWidth); int quotient = remainingInt / numberOfCurrentColumns; int remainder = remainingInt - quotient * numberOfCurrentColumns; int oldRemainder = remainder; for (j = _numberOfColumns - 1; j >= 0; j--) { if (minWidth[j] <= previousPoint && maxWidth[j] >= nextPoint) { currentWidth[j] += quotient; if (remainder > 0 && maxWidth[j] >= currentWidth[j] + 1) { remainder--; currentWidth[j]++; } } } while (oldRemainder > remainder && remainder > 0) { oldRemainder = remainder; for (j = 0; j < _numberOfColumns; j++) { if (minWidth[j] <= previousPoint && maxWidth[j] >= nextPoint) { if (remainder > 0 && maxWidth[j] >= currentWidth[j] + 1) { remainder--; currentWidth[j]++; } } } } if (remainder > 0) NSLog(@"There is still free space to fill.\ However it seems better to use integer width for the columns"); else remainingWidth = 0.; } } else if (numberOfCurrentColumns < 0) { NSLog(@"[NSTableView sizeToFit]: unexpected error"); } if (columnInfo[i].isMax) numberOfCurrentColumns--; else numberOfCurrentColumns++; previousPoint = nextPoint; if (remainingWidth == 0.) { break; } } } _tilingDisabled = YES; remainingWidth = 0.; for (i = 0; i < _numberOfColumns; i++) { if (isResizable[i] == YES) { tb = [_tableColumns objectAtIndex: i]; remainingWidth += currentWidth[i]; [tb setWidth: currentWidth[i]]; } else { remainingWidth += minWidth[i]; } } _tilingDisabled = NO; NSZoneFree(NSDefaultMallocZone(), columnInfo); NSZoneFree(NSDefaultMallocZone(), currentWidth); NSZoneFree(NSDefaultMallocZone(), maxWidth); NSZoneFree(NSDefaultMallocZone(), minWidth); NSZoneFree(NSDefaultMallocZone(), isResizable); [self tile]; } /* - (void) sizeToFit { NSCell *cell; NSEnumerator *enumerator; NSTableColumn *tb; float table_width; float width; float candidate_width; int row; _tilingDisabled = YES; // First Step // Resize Each Column to its Minimum Width table_width = _bounds.origin.x; enumerator = [_tableColumns objectEnumerator]; while ((tb = [enumerator nextObject]) != nil) { // Compute min width of column width = [[tb headerCell] cellSize].width; for (row = 0; row < _numberOfRows; row++) { cell = [self preparedCellAtColumn: [_tableColumns indexOfObject: tb] row: row]; [cell setObjectValue: [_dataSource tableView: self objectValueForTableColumn: tb row: row]]; [self _willDisplayCell: cell forTableColumn: tb row: row]; candidate_width = [cell cellSize].width; if (_drawsGrid) candidate_width += 4; if (candidate_width > width) { width = candidate_width; } } width += _intercellSpacing.width; [tb setWidth: width]; // It is necessary to ask the column for the width, since it might have // been changed by the column to constrain it to a min or max width table_width += [tb width]; } // Second Step // If superview (clipview) is bigger than that, divide remaining space // between all columns if ((_super_view != nil) && (_numberOfColumns > 0)) { float excess_width; excess_width = NSMaxX ([self convertRect: [_super_view bounds] fromView: _super_view]); excess_width -= table_width; // Since we resized each column at its minimum width, // it's useless to try shrinking more: we can't if (excess_width <= 0) { _tilingDisabled = NO; [self tile]; NSLog(@"exiting sizeToFit"); return; } excess_width = excess_width / _numberOfColumns; enumerator = [_tableColumns objectEnumerator]; while ((tb = [enumerator nextObject]) != nil) { [tb setWidth: ([tb width] + excess_width)]; } } _tilingDisabled = NO; [self tile]; NSLog(@"exiting sizeToFit"); } */ - (void) noteNumberOfRowsChanged { NSRect newFrame; _numberOfRows = [self _numRows]; /* If we are selecting rows, we have to check that we have no selected rows below the new end of the table */ if (!_selectingColumns) { NSUInteger row = [_selectedRows lastIndex]; if (row == NSNotFound) { if (!_allowsEmptySelection) { /* We shouldn't allow empty selection - try selecting the last row */ NSInteger lastRow = _numberOfRows - 1; if (lastRow > -1) { [self _postSelectionIsChangingNotification]; [_selectedRows addIndex: lastRow]; _selectedRow = lastRow; [self _postSelectionDidChangeNotification]; } else { /* problem - there are no rows at all */ _selectedRow = -1; } } } /* Check that all selected rows are in the new range of rows */ else if (row >= _numberOfRows) { [_selectedRows removeIndexesInRange: NSMakeRange(_numberOfRows, row + 1 - _numberOfRows)]; if (_selectedRow >= _numberOfRows) { row = [_selectedRows lastIndex]; [self _postSelectionIsChangingNotification]; if (row != NSNotFound) { _selectedRow = row; } else { /* Argh - all selected rows were outside the table */ if (_allowsEmptySelection) { _selectedRow = -1; } else { /* We shouldn't allow empty selection - try selecting the last row */ int lastRow = _numberOfRows - 1; if (lastRow > -1) { [_selectedRows addIndex: lastRow]; _selectedRow = lastRow; } else { /* problem - there are no rows at all */ _selectedRow = -1; } } } [self _postSelectionDidChangeNotification]; } } } newFrame = _frame; newFrame.size.height = (_numberOfRows * _rowHeight) + 1; if (NO == NSEqualRects(newFrame, NSUnionRect(newFrame, _frame))) { [_super_view setNeedsDisplayInRect: _frame]; } [self setFrame: newFrame]; /* If we are shorter in height than the enclosing clipview, we should redraw us now. */ if (_super_view != nil) { NSRect superviewBounds; // Get this *after* [self setFrame:] superviewBounds = [_super_view bounds]; if ((superviewBounds.origin.x <= _frame.origin.x) && (NSMaxY(superviewBounds) >= NSMaxY(_frame))) { [self setNeedsDisplay: YES]; } } } - (void) tile { float table_width = 0; float table_height; if (_tilingDisabled == YES) return; if (_numberOfColumns > 0) { int i; float width; _columnOrigins[0] = _bounds.origin.x; width = [[_tableColumns objectAtIndex: 0] width]; table_width += width; for (i = 1; i < _numberOfColumns; i++) { _columnOrigins[i] = _columnOrigins[i - 1] + width; width = [[_tableColumns objectAtIndex: i] width]; table_width += width; } } /* + 1 for the last grid line */ table_height = (_numberOfRows * _rowHeight) + 1; [self setFrameSize: NSMakeSize (table_width, table_height)]; [self setNeedsDisplay: YES]; if (_headerView != nil) { CGFloat innerBorderWidth = [[NSUserDefaults standardUserDefaults] boolForKey: @"GSScrollViewNoInnerBorder"] ? 0.0 : 1.0; [_headerView setFrameSize: NSMakeSize (_frame.size.width, [_headerView frame].size.height)]; [_cornerView setFrameSize: NSMakeSize ([NSScroller scrollerWidth] + innerBorderWidth, [_headerView frame].size.height)]; [_headerView setNeedsDisplay: YES]; [_cornerView setNeedsDisplay: YES]; } } /* * Drawing */ - (void) drawRow: (NSInteger)rowIndex clipRect: (NSRect)clipRect { [[GSTheme theme] drawTableViewRow: rowIndex clipRect: clipRect inView: self]; } - (void) noteHeightOfRowsWithIndexesChanged: (NSIndexSet*)indexes { // FIXME } - (void) drawGridInClipRect: (NSRect)aRect { [[GSTheme theme] drawTableViewGridInClipRect: aRect inView: self]; } - (void) highlightSelectionInClipRect: (NSRect)clipRect { [[GSTheme theme] highlightTableViewSelectionInClipRect: clipRect inView: self selectingColumns: _selectingColumns]; } - (void) drawBackgroundInClipRect: (NSRect)clipRect { [[GSTheme theme] drawTableViewBackgroundInClipRect: clipRect inView: self withBackgroundColor: _backgroundColor]; } - (void) drawRect: (NSRect)aRect { [[GSTheme theme] drawTableViewRect: aRect inView: self]; } - (BOOL) isOpaque { return YES; } /* * Scrolling */ - (void) scrollRowToVisible: (NSInteger)rowIndex { if (_super_view != nil) { NSRect rowRect = [self rectOfRow: rowIndex]; NSRect visibleRect = [self visibleRect]; // If the row is over the top, or it is partially visible // on top, if ((rowRect.origin.y < visibleRect.origin.y)) { // Then make it visible on top NSPoint newOrigin; newOrigin.x = visibleRect.origin.x; newOrigin.y = rowRect.origin.y; newOrigin = [self convertPoint: newOrigin toView: _super_view]; [(NSClipView *)_super_view scrollToPoint: newOrigin]; return; } // If the row is under the bottom, or it is partially visible on // the bottom, if (NSMaxY (rowRect) > NSMaxY (visibleRect)) { // Then make it visible on bottom NSPoint newOrigin; newOrigin.x = visibleRect.origin.x; newOrigin.y = visibleRect.origin.y; newOrigin.y += NSMaxY (rowRect) - NSMaxY (visibleRect); newOrigin = [self convertPoint: newOrigin toView: _super_view]; [(NSClipView *)_super_view scrollToPoint: newOrigin]; return; } } } - (void) scrollColumnToVisible: (NSInteger)columnIndex { if (_super_view != nil) { NSRect columnRect = [self rectOfColumn: columnIndex]; NSRect visibleRect = [self visibleRect]; CGFloat diff; // If the row is out on the left, or it is partially visible // on the left if ((columnRect.origin.x < visibleRect.origin.x)) { // Then make it visible on the left NSPoint newOrigin; newOrigin.x = columnRect.origin.x; newOrigin.y = visibleRect.origin.y; newOrigin = [self convertPoint: newOrigin toView: _super_view]; [(NSClipView *)_super_view scrollToPoint: newOrigin]; return; } diff = NSMaxX (columnRect) - NSMaxX (visibleRect); // If the row is out on the right, or it is partially visible on // the right, if (diff > 0) { // Then make it visible on the right NSPoint newOrigin; newOrigin.x = visibleRect.origin.x; newOrigin.y = visibleRect.origin.y; newOrigin.x += diff; newOrigin = [self convertPoint: newOrigin toView: _super_view]; [(NSClipView *)_super_view scrollToPoint: newOrigin]; return; } } } /* * Text delegate methods */ - (void) textDidBeginEditing: (NSNotification *)aNotification { [super textDidBeginEditing: aNotification]; } - (void) textDidChange: (NSNotification *)aNotification { // MacOS-X asks us to inform the cell if possible. if ((_editedCell != nil) && [_editedCell respondsToSelector: @selector(textDidChange:)]) [_editedCell textDidChange: aNotification]; [super textDidChange: aNotification]; } - (void) textDidEndEditing: (NSNotification *)aNotification { id textMovement; int row, column; /* Save values */ row = _editedRow; column = _editedColumn; [super textDidEndEditing: aNotification]; textMovement = [[aNotification userInfo] objectForKey: @"NSTextMovement"]; if (textMovement) { switch ([(NSNumber *)textMovement intValue]) { case NSReturnTextMovement: [self _editNextCellAfterRow: row inColumn: column]; // Send action ? break; case NSTabTextMovement: if ([self _editNextEditableCellAfterRow: row column: column] == YES) { break; } [_window selectKeyViewFollowingView: self]; break; case NSBacktabTextMovement: if ([self _editPreviousEditableCellBeforeRow: row column: column] == YES) { break; } [_window selectKeyViewPrecedingView: self]; break; } } } - (BOOL) textShouldBeginEditing: (NSText *)textObject { if (_delegate && [_delegate respondsToSelector: @selector(control:textShouldBeginEditing:)]) return [_delegate control: self textShouldBeginEditing: textObject]; else return YES; } - (BOOL) textShouldEndEditing: (NSText*)textObject { if ([_delegate respondsToSelector: @selector(control:textShouldEndEditing:)]) { if ([_delegate control: self textShouldEndEditing: textObject] == NO) { NSBeep (); return NO; } return YES; } if ([_delegate respondsToSelector: @selector(control:isValidObject:)] == YES) { NSFormatter *formatter; id newObjectValue; formatter = [_editedCell formatter]; if ([formatter getObjectValue: &newObjectValue forString: [_textObject text] errorDescription: NULL] == YES) { if ([_delegate control: self isValidObject: newObjectValue] == NO) return NO; } } return [_editedCell isEntryAcceptable: [textObject text]]; } /* * Persistence */ - (NSString *) autosaveName { return _autosaveName; } - (BOOL) autosaveTableColumns { return _autosaveTableColumns; } - (void) setAutosaveName: (NSString *)name { ASSIGN (_autosaveName, name); [self _autoloadTableColumns]; } - (void) setAutosaveTableColumns: (BOOL)flag { if (flag == _autosaveTableColumns) { return; } _autosaveTableColumns = flag; if (flag) { [self _autoloadTableColumns]; [nc addObserver: self selector: @selector(_autosaveTableColumns) name: NSTableViewColumnDidResizeNotification object: self]; } else { [nc removeObserver: self name: NSTableViewColumnDidResizeNotification object: self]; } } /* * Delegate */ - (void) setDelegate: (id)anObject { const SEL sel = @selector(tableView:willDisplayCell:forTableColumn:row:); if (_delegate) [nc removeObserver: _delegate name: nil object: self]; _delegate = anObject; #define SET_DELEGATE_NOTIFICATION(notif_name) \ if ([_delegate respondsToSelector: @selector(tableView##notif_name:)]) \ [nc addObserver: _delegate \ selector: @selector(tableView##notif_name:) \ name: NSTableView##notif_name##Notification object: self] SET_DELEGATE_NOTIFICATION(ColumnDidMove); SET_DELEGATE_NOTIFICATION(ColumnDidResize); SET_DELEGATE_NOTIFICATION(SelectionDidChange); SET_DELEGATE_NOTIFICATION(SelectionIsChanging); /* Cache */ _del_responds = [_delegate respondsToSelector: sel]; } - (id) delegate { return _delegate; } /* indicator image */ - (NSImage *) indicatorImageInTableColumn: (NSTableColumn *)aTableColumn { // TODO NSLog(@"Method %s is not implemented for class %s", "indicatorImageInTableColumn:", "NSTableView"); return nil; } - (void) setIndicatorImage: (NSImage *)anImage inTableColumn: (NSTableColumn *)aTableColumn { // TODO NSLog(@"Method %s is not implemented for class %s", "setIndicatorImage:inTableColumn:", "NSTableView"); } /* highlighting columns */ - (NSTableColumn *) highlightedTableColumn { return _highlightedTableColumn; } - (void) setHighlightedTableColumn: (NSTableColumn *)aTableColumn { NSUInteger tableColumnIndex; tableColumnIndex = [_tableColumns indexOfObject: aTableColumn]; if (tableColumnIndex == NSNotFound) { NSLog(@"setHighlightedTableColumn received an invalid\ NSTableColumn object"); return; } // we do not need to retain aTableColumn as it is already in // _tableColumns array _highlightedTableColumn = aTableColumn; [_headerView setNeedsDisplay: YES]; } /* dragging rows */ - (NSImage*) dragImageForRows: (NSArray*)dragRows event: (NSEvent*)dragEvent dragImageOffset: (NSPoint*)dragImageOffset { // FIXME NSImage *dragImage = [[NSImage alloc] initWithSize: NSMakeSize(8, 8)]; return AUTORELEASE(dragImage); } - (NSImage *) dragImageForRowsWithIndexes: (NSIndexSet*)rows tableColumns: (NSArray*)cols event: (NSEvent*)event offset: (NSPoint*)offset { // FIXME NSArray *rowArray; rowArray = [self _indexSetToArray: rows]; return [self dragImageForRows: rowArray event: event dragImageOffset: offset]; } - (void) setDropRow: (NSInteger)row dropOperation: (NSTableViewDropOperation)operation { if (row < -1 || row > _numberOfRows || (operation == NSTableViewDropOn && row == _numberOfRows)) { currentDropRow = -1; currentDropOperation = NSTableViewDropOn; } else { currentDropRow = row; currentDropOperation = operation; } } - (void) setVerticalMotionCanBeginDrag: (BOOL)flag { _verticalMotionDrag = flag; } - (BOOL) verticalMotionCanBeginDrag { return _verticalMotionDrag; } - (NSArray*) namesOfPromisedFilesDroppedAtDestination: (NSURL *)dropDestination { if ([_dataSource respondsToSelector: @selector(tableView:namesOfPromisedFilesDroppedAtDestination:forDraggedRowsWithIndexes:)]) { return [_dataSource tableView: self namesOfPromisedFilesDroppedAtDestination: dropDestination forDraggedRowsWithIndexes: _selectedRows]; } else { return nil; } } /* * Encoding/Decoding */ - (void) encodeWithCoder: (NSCoder*)aCoder { if ([aCoder allowsKeyedCoding]) { unsigned long vFlags = 0; NSSize intercellSpacing = [self intercellSpacing]; GSTableViewFlags tableViewFlags; // make sure the corner view is properly encoded... [super encodeWithCoder: aCoder]; if ([self dataSource]) { [aCoder encodeObject: [self dataSource] forKey: @"NSDataSource"]; } if ([self delegate]) { [aCoder encodeObject: [self delegate] forKey: @"NSDelegate"]; } if ([self target]) { [aCoder encodeObject: [self target] forKey: @"NSTarget"]; } if ([self action]) { [aCoder encodeObject: NSStringFromSelector([self action]) forKey: @"NSAction"]; } if ([self doubleAction] != NULL) { [aCoder encodeObject: NSStringFromSelector([self doubleAction]) forKey: @"NSDoubleAction"]; } [aCoder encodeObject: [self backgroundColor] forKey: @"NSBackgroundColor"]; [aCoder encodeObject: [self gridColor] forKey: @"NSGridColor"]; [aCoder encodeFloat: intercellSpacing.height forKey: @"NSIntercellSpacingHeight"]; [aCoder encodeFloat: intercellSpacing.width forKey: @"NSIntercellSpacingWidth"]; [aCoder encodeFloat: [self rowHeight] forKey: @"NSRowHeight"]; [aCoder encodeObject: [self tableColumns] forKey: @"NSTableColumns"]; if (_headerView) { [aCoder encodeObject: _headerView forKey: @"NSHeaderView"]; } if (_cornerView) { [aCoder encodeObject: _cornerView forKey: @"NSCornerView"]; } if ([[self sortDescriptors] count] > 0) { [aCoder encodeObject: _sortDescriptors forKey: @"NSSortDescriptors"]; } tableViewFlags.columnSelection = [self allowsColumnSelection]; tableViewFlags.multipleSelection = [self allowsMultipleSelection]; tableViewFlags.emptySelection = [self allowsEmptySelection]; tableViewFlags.drawsGrid = [self drawsGrid]; tableViewFlags.columnResizing = [self allowsColumnResizing]; tableViewFlags.columnOrdering = [self allowsColumnReordering]; memcpy((void *)&vFlags,(void *)&tableViewFlags,sizeof(unsigned long)); // encode.. [aCoder encodeInt: vFlags forKey: @"NSTvFlags"]; } else { [super encodeWithCoder: aCoder]; [aCoder encodeConditionalObject: _dataSource]; [aCoder encodeObject: _tableColumns]; [aCoder encodeObject: _gridColor]; [aCoder encodeObject: _backgroundColor]; [aCoder encodeObject: _headerView]; [aCoder encodeObject: _cornerView]; [aCoder encodeConditionalObject: _delegate]; [aCoder encodeConditionalObject: _target]; [aCoder encodeValueOfObjCType: @encode(int) at: &_numberOfRows]; [aCoder encodeValueOfObjCType: @encode(int) at: &_numberOfColumns]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_drawsGrid]; [aCoder encodeValueOfObjCType: @encode(float) at: &_rowHeight]; [aCoder encodeValueOfObjCType: @encode(SEL) at: &_doubleAction]; [aCoder encodeSize: _intercellSpacing]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_allowsMultipleSelection]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_allowsEmptySelection]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_allowsColumnSelection]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_allowsColumnResizing]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_allowsColumnReordering]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_autoresizesAllColumnsToFit]; [aCoder encodeValueOfObjCType: @encode(BOOL) at: &_verticalMotionDrag]; [aCoder encodeObject: _sortDescriptors]; } } - (id) initWithCoder: (NSCoder*)aDecoder { self = [super initWithCoder: aDecoder]; if (!self) return self; if ([aDecoder allowsKeyedCoding]) { NSSize intercellSpacing; NSArray *columns; NSEnumerator *e; NSTableColumn *col; // assign defaults, so that there's color in case none is specified [self _initDefaults]; ASSIGN(_gridColor, [NSColor gridColor]); ASSIGN(_backgroundColor, [NSColor controlBackgroundColor]); ASSIGN(_tableColumns, [NSMutableArray array]); ASSIGN(_sortDescriptors, [NSArray array]); // // Check for nil on some of these, since they are usually set // in NSIBOutletConnector objects we don't want to override // that setting unless they're directly encoded with the // object. // // I'm not sure why IB encodes nil values for these, but // the behaviour here should match that on Mac OS X. // if ([aDecoder containsValueForKey: @"NSDataSource"]) { id obj = [aDecoder decodeObjectForKey: @"NSDataSource"]; if(obj != nil) { [self setDataSource: obj]; } } if ([aDecoder containsValueForKey: @"NSDelegate"]) { id obj = [aDecoder decodeObjectForKey: @"NSDelegate"]; if(obj != nil) { [self setDelegate: obj]; } } if ([aDecoder containsValueForKey: @"NSTarget"]) { id obj = [aDecoder decodeObjectForKey: @"NSTarget"]; if(obj != nil) { [self setTarget: obj]; } } if ([aDecoder containsValueForKey: @"NSAction"]) { NSString *action = [aDecoder decodeObjectForKey: @"NSAction"]; if(action != nil) { [self setAction: NSSelectorFromString(action)]; } } if ([aDecoder containsValueForKey: @"NSDoubleAction"]) { NSString *action = [aDecoder decodeObjectForKey: @"NSDoubleAction"]; if(action != nil) { [self setDoubleAction: NSSelectorFromString(action)]; } } if ([aDecoder containsValueForKey: @"NSBackgroundColor"]) { [self setBackgroundColor: [aDecoder decodeObjectForKey: @"NSBackgroundColor"]]; } if ([aDecoder containsValueForKey: @"NSGridColor"]) { [self setGridColor: [aDecoder decodeObjectForKey: @"NSGridColor"]]; } intercellSpacing = [self intercellSpacing]; if ([aDecoder containsValueForKey: @"NSIntercellSpacingHeight"]) { intercellSpacing.height = [aDecoder decodeFloatForKey: @"NSIntercellSpacingHeight"]; } if ([aDecoder containsValueForKey: @"NSIntercellSpacingWidth"]) { intercellSpacing.width = [aDecoder decodeFloatForKey: @"NSIntercellSpacingWidth"]; } [self setIntercellSpacing: intercellSpacing]; if ([aDecoder containsValueForKey: @"NSDraggingSourceMaskForLocal"]) { [self setDraggingSourceOperationMask: [aDecoder decodeIntForKey: @"NSDraggingSourceMaskForLocal"] forLocal: YES]; } if ([aDecoder containsValueForKey: @"NSDraggingSourceMaskForNonLocal"]) { [self setDraggingSourceOperationMask: [aDecoder decodeIntForKey: @"NSDraggingSourceMaskForNonLocal"] forLocal: NO]; } if ([aDecoder containsValueForKey: @"NSRowHeight"]) { [self setRowHeight: [aDecoder decodeFloatForKey: @"NSRowHeight"]]; } if ([aDecoder containsValueForKey: @"NSCornerView"]) { NSView *aView = [aDecoder decodeObjectForKey: @"NSCornerView"]; [self setCornerView: aView]; [aView setHidden: NO]; } else { _cornerView = [GSTableCornerView new]; } if ([aDecoder containsValueForKey: @"NSHeaderView"]) { [self setHeaderView: [aDecoder decodeObjectForKey: @"NSHeaderView"]]; } if ([aDecoder containsValueForKey: @"NSSortDescriptors"]) { ASSIGN(_sortDescriptors, [aDecoder decodeObjectForKey: @"NSSortDescriptors"]); } if ([aDecoder containsValueForKey: @"NSTvFlags"]) { unsigned long flags = [aDecoder decodeIntForKey: @"NSTvFlags"]; GSTableViewFlags tableViewFlags; memcpy((void *)&tableViewFlags,(void *)&flags,sizeof(struct _tableViewFlags)); [self setAllowsColumnSelection: tableViewFlags.columnSelection]; [self setAllowsMultipleSelection: tableViewFlags.multipleSelection]; [self setAllowsEmptySelection: tableViewFlags.emptySelection]; [self setDrawsGrid: tableViewFlags.drawsGrid]; [self setAllowsColumnResizing: tableViewFlags.columnResizing]; [self setAllowsColumnReordering: tableViewFlags.columnOrdering]; } // get the table columns... columns = [aDecoder decodeObjectForKey: @"NSTableColumns"]; e = [columns objectEnumerator]; while ((col = [e nextObject]) != nil) { /* Will initialize -[NSTableColumn tableView], _numberOfColumns and allocate _columnsOrigins */ [self addTableColumn: col]; } [self tile]; /* Initialize _columnOrigins */ } else { int version = [aDecoder versionForClassName: @"NSTableView"]; id aDelegate; [self _initDefaults]; _dataSource = [aDecoder decodeObject]; _tableColumns = RETAIN([aDecoder decodeObject]); _gridColor = RETAIN([aDecoder decodeObject]); _backgroundColor = RETAIN([aDecoder decodeObject]); _headerView = RETAIN([aDecoder decodeObject]); _cornerView = RETAIN([aDecoder decodeObject]); aDelegate = [aDecoder decodeObject]; _target = [aDecoder decodeObject]; [self setDelegate: aDelegate]; [_headerView setTableView: self]; [_tableColumns makeObjectsPerformSelector: @selector(setTableView:) withObject: self]; [aDecoder decodeValueOfObjCType: @encode(int) at: &_numberOfRows]; [aDecoder decodeValueOfObjCType: @encode(int) at: &_numberOfColumns]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_drawsGrid]; [aDecoder decodeValueOfObjCType: @encode(float) at: &_rowHeight]; [aDecoder decodeValueOfObjCType: @encode(SEL) at: &_doubleAction]; _intercellSpacing = [aDecoder decodeSize]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_allowsMultipleSelection]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_allowsEmptySelection]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_allowsColumnSelection]; [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_allowsColumnResizing]; if (version >= 3) { [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_allowsColumnReordering]; } if (version >= 2) { [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_autoresizesAllColumnsToFit]; } if (version >= 4) { [aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_verticalMotionDrag]; } if (version >= 5) { ASSIGN(_sortDescriptors, [aDecoder decodeObject]); } if (_numberOfColumns > 0) { _columnOrigins = NSZoneMalloc (NSDefaultMallocZone (), sizeof(float) * _numberOfColumns); } [self tile]; /* Initialize _columnOrigins */ } return self; } - (void) updateCell: (NSCell*)aCell { int i, j; if (aCell == nil) return; return; for (i = 0; i < _numberOfColumns; i++) { if ([self preparedCellAtColumn: i row: -1] == aCell) { [self setNeedsDisplayInRect: [self rectOfColumn: i]]; } else { NSRect columnRect = [self rectOfColumn: i]; NSRect rowRect; NSRect visibleRect = [self convertRect: [_super_view bounds] toView: self]; NSPoint top = NSMakePoint(NSMinX(visibleRect), NSMinY(visibleRect)); NSPoint bottom = NSMakePoint(NSMinX(visibleRect), NSMaxY(visibleRect)); int firstVisibleRow = [self rowAtPoint: top]; int lastVisibleRow = [self rowAtPoint: bottom]; if (firstVisibleRow == -1) firstVisibleRow = 0; if (lastVisibleRow == -1) lastVisibleRow = _numberOfColumns - 1; for (j = firstVisibleRow; j < lastVisibleRow; j++) { if ([self preparedCellAtColumn: i row: j] == aCell) { rowRect = [self rectOfRow: j]; [self setNeedsDisplayInRect: NSIntersectionRect(columnRect, rowRect)]; } } } } } - (void) _userResizedTableColumn: (int)index width: (float)width { [[_tableColumns objectAtIndex: index] setWidth: width]; } - (float *) _columnOrigins { return _columnOrigins; } - (void) _mouseDownInHeaderOfTableColumn: (NSTableColumn *)tc { if ([_delegate respondsToSelector: @selector(tableView:mouseDownInHeaderOfTableColumn:)]) { [_delegate tableView: self mouseDownInHeaderOfTableColumn: tc]; } } - (void) _clickTableColumn: (NSTableColumn *)tc { NSSortDescriptor *oldMainSortDescriptor = nil; NSSortDescriptor *newMainSortDescriptor = [tc sortDescriptorPrototype]; NSMutableArray *newSortDescriptors = [NSMutableArray arrayWithArray: [self sortDescriptors]]; NSEnumerator *e = [newSortDescriptors objectEnumerator]; NSSortDescriptor *descriptor = nil; NSMutableArray *outdatedDescriptors = [NSMutableArray array]; if ([[self sortDescriptors] count] > 0) { oldMainSortDescriptor = [[self sortDescriptors] objectAtIndex: 0]; } /* Remove every main descriptor equivalents (normally only one) */ while ((descriptor = [e nextObject]) != nil) { if ([[descriptor key] isEqual: [newMainSortDescriptor key]]) [outdatedDescriptors addObject: descriptor]; } /* Invert the sort direction when the same column header is clicked twice */ if ([[newMainSortDescriptor key] isEqual: [oldMainSortDescriptor key]]) { newMainSortDescriptor = [oldMainSortDescriptor reversedSortDescriptor]; } [newSortDescriptors removeObjectsInArray: outdatedDescriptors]; if (newMainSortDescriptor != nil) [newSortDescriptors insertObject: newMainSortDescriptor atIndex: 0]; [self setSortDescriptors: newSortDescriptors]; [self _didClickTableColumn: tc]; } - (void) _editNextCellAfterRow: (int) row inColumn: (int) column { if (++row >= _numberOfRows) row = 0; if ([self _shouldSelectRow: row]) { [self selectRowIndexes: [NSIndexSet indexSetWithIndex: row] byExtendingSelection: NO]; if ([self _isCellEditableColumn: column row:row]) { [self editColumn: column row: row withEvent: nil select: YES]; } } } -(BOOL) _editNextEditableCellAfterRow: (int)row column: (int)column { int i, j; if (row > -1) { // First look for cells in the same row for (j = column + 1; j < _numberOfColumns; j++) { if ([self _isCellEditableColumn: j row: row]) { [self editColumn: j row: row withEvent: nil select: YES]; return YES; } } } // Otherwise, make the big cycle. for (i = row + 1; i < _numberOfRows; i++) { for (j = 0; j < _numberOfColumns; j++) { if ([self _isCellEditableColumn: j row: i]) { // Need to select row to be able to edit it. [self selectRow: i byExtendingSelection: NO]; [self editColumn: j row: i withEvent: nil select: YES]; return YES; } } } // Should we loop around or not? #if 0 // Nothing found? Search in the rows before the current for (i = 0; i < row; i++) { for (j = 0; j < _numberOfColumns; j++) { if ([self _isCellEditableColumn: j row: i]) { // Need to select row to be able to edit it. [self selectRow: i byExtendingSelection: NO]; [self editColumn: j row: i withEvent: nil select: YES]; return YES; } } } // Still nothing? Look at the beginning of the current row if (row > -1) { // First look for cells in the same row for (j = 0; j < column; j++) { if ([self _isCellEditableColumn: j row: row]) { [self editColumn: j row: row withEvent: nil select: YES]; return YES; } } } #endif return NO; } -(BOOL) _editPreviousEditableCellBeforeRow: (int)row column: (int)column { int i, j; if (row > -1) { // First look for cells in the same row for (j = column - 1; j > -1; j--) { if ([self _isCellEditableColumn: j row: row]) { [self editColumn: j row: row withEvent: nil select: YES]; return YES; } } } // Otherwise, make the big cycle. for (i = row - 1; i > -1; i--) { for (j = _numberOfColumns - 1; j > -1; j--) { if ([self _isCellEditableColumn: j row: i]) { // Need to select row to be able to edit it. [self selectRow: i byExtendingSelection: NO]; [self editColumn: j row: i withEvent: nil select: YES]; return YES; } } } // Should we loop around or not? #if 0 // Nothing found? Search in the rows after the current for (i = _numberOfRows - 1; i > row; i--) { for (j = _numberOfColumns - 1; j > -1; j--) { if ([self _isCellEditableColumn: j row: i]) { // Need to select row to be able to edit it. [self selectRow: i byExtendingSelection: NO]; [self editColumn: j row: i withEvent: nil select: YES]; return YES; } } } // Still nothing? Look at the end of the current row if (row > -1) { // First look for cells in the same row for (j = _numberOfColumns - 1; j > column; j++) { if ([self _isCellEditableColumn: j row: row]) { [self editColumn: j row: row withEvent: nil select: YES]; return YES; } } } #endif return NO; } - (void) _autosaveTableColumns { if (_autosaveTableColumns && _autosaveName != nil) { NSUserDefaults *defaults; NSString *tableKey; NSMutableDictionary *config; NSTableColumn *column; id en; defaults = [NSUserDefaults standardUserDefaults]; tableKey = [NSString stringWithFormat: @"NSTableView Columns %@", _autosaveName]; config = [NSMutableDictionary new]; en = [[self tableColumns] objectEnumerator]; while ((column = [en nextObject]) != nil) { NSArray *array; NSNumber *width, *identNum; NSObject *ident; width = [NSNumber numberWithInt: [column width]]; ident = [column identifier]; identNum = [NSNumber numberWithInt: [self columnWithIdentifier: ident]]; array = [NSArray arrayWithObjects: width, identNum, nil]; [config setObject: array forKey: ident]; } [defaults setObject: config forKey: tableKey]; [defaults synchronize]; RELEASE (config); } } - (void) _autoloadTableColumns { if (_autosaveTableColumns && _autosaveName != nil) { NSUserDefaults *defaults; NSDictionary *config; NSString *tableKey; defaults = [NSUserDefaults standardUserDefaults]; tableKey = [NSString stringWithFormat: @"NSTableView Columns %@", _autosaveName]; config = [defaults objectForKey: tableKey]; if (config != nil) { NSEnumerator *en = [[config allKeys] objectEnumerator]; NSString *colKey; NSArray *colDesc; NSTableColumn *col; while ((colKey = [en nextObject]) != nil) { col = [self tableColumnWithIdentifier: colKey]; if (col != nil) { colDesc = [config objectForKey: colKey]; [col setWidth: [[colDesc objectAtIndex: 0] intValue]]; [self moveColumn: [self columnWithIdentifier: colKey] toColumn: [[colDesc objectAtIndex: 1] intValue]]; } } } } } - (void) superviewFrameChanged: (NSNotification*)aNotification { if (_autoresizesAllColumnsToFit == YES) { float visible_width = [self convertRect: [_super_view bounds] fromView: _super_view].size.width; float table_width = 0; if (_numberOfColumns > 0) { table_width = _columnOrigins[_numberOfColumns - 1] + [[_tableColumns objectAtIndex: _numberOfColumns - 1] width]; } /* NSLog(@"columnOrigins[0] %f", _columnOrigins[0]); NSLog(@"superview.bounds %@", NSStringFromRect([_super_view bounds])); NSLog(@"superview.frame %@", NSStringFromRect([_super_view frame])); NSLog(@"table_width %f", table_width); NSLog(@"width %f", visible_width); NSLog(@"_superview_width %f", _superview_width); */ if (table_width - _superview_width <= 0.001 && table_width - _superview_width >= -0.001) { // the last column had been sized to fit [self sizeToFit]; } else if (table_width <= _superview_width && table_width >= visible_width) { // the tableView was too small and is now too large [self sizeToFit]; } else if (table_width >= _superview_width && table_width <= visible_width) { // the tableView was too large and is now too small if (_numberOfColumns > 0) [self scrollColumnToVisible: 0]; [self sizeToFit]; } _superview_width = visible_width; } else { float visible_width = [self convertRect: [_super_view bounds] fromView: _super_view].size.width; float table_width = 0; if (_numberOfColumns > 0) { table_width = _columnOrigins[_numberOfColumns - 1] + [[_tableColumns objectAtIndex: _numberOfColumns - 1] width]; } /* NSLog(@"columnOrigins[0] %f", _columnOrigins[0]); NSLog(@"superview.bounds %@", NSStringFromRect([_super_view bounds])); NSLog(@"superview.frame %@", NSStringFromRect([_super_view frame])); NSLog(@"table_width %f", table_width); NSLog(@"width %f", visible_width); NSLog(@"_superview_width %f", _superview_width); */ if (table_width - _superview_width <= 0.001 && table_width - _superview_width >= -0.001) { // the last column had been sized to fit [self sizeLastColumnToFit]; } else if (table_width <= _superview_width && table_width >= visible_width) { // the tableView was too small and is now too large [self sizeLastColumnToFit]; } else if (table_width >= _superview_width && table_width <= visible_width) { // the tableView was too large and is now too small if (_numberOfColumns > 0) [self scrollColumnToVisible: 0]; [self sizeLastColumnToFit]; } _superview_width = visible_width; } [self setFrame:_frame]; } - (NSDragOperation) draggingSourceOperationMaskForLocal: (BOOL)isLocal { if (isLocal) { return _draggingSourceOperationMaskForLocal; } else { return _draggingSourceOperationMaskForRemote; } } - (void) setDraggingSourceOperationMask: (NSDragOperation)mask forLocal: (BOOL)isLocal { if (isLocal) { _draggingSourceOperationMaskForLocal = mask; } else { _draggingSourceOperationMaskForRemote = mask; } } - (NSDragOperation) draggingEntered: (id ) sender { currentDropRow = -1; currentDropOperation = -1; oldDropRow = -1; lastQuarterPosition = -1; oldDraggingRect = NSMakeRect(0.,0., 0., 0.); currentDragOperation = NSDragOperationEvery; return currentDragOperation; } - (void) draggingExited: (id ) sender { [self setNeedsDisplayInRect: oldDraggingRect]; [self displayIfNeeded]; } - (void) _drawDropIndicator { NSRect newRect = NSZeroRect; [self lockFocus]; [self setNeedsDisplayInRect: oldDraggingRect]; [self displayIfNeeded]; [[NSColor darkGrayColor] set]; if (currentDropRow == -1) { newRect = [self bounds]; NSFrameRectWithWidth(newRect, 2.0); oldDraggingRect = newRect; } else if (currentDropOperation == NSTableViewDropAbove) { if (currentDropRow == 0) { newRect = NSMakeRect([self visibleRect].origin.x, currentDropRow * _rowHeight, [self visibleRect].size.width, 3); } else if (currentDropRow == _numberOfRows) { newRect = NSMakeRect([self visibleRect].origin.x, currentDropRow * _rowHeight - 2, [self visibleRect].size.width, 3); } else { newRect = NSMakeRect([self visibleRect].origin.x, currentDropRow * _rowHeight - 1, [self visibleRect].size.width, 3); } NSRectFill(newRect); oldDraggingRect = newRect; } else { newRect = [self frameOfCellAtColumn: 0 row: currentDropRow]; newRect.origin.x = _bounds.origin.x; newRect.size.width = _bounds.size.width + 2; newRect.origin.x -= _intercellSpacing.height / 2; newRect.size.height += _intercellSpacing.height; newRect.size.height -= 1; newRect.origin.x += 3; newRect.size.width -= 3; if (_drawsGrid) { //newRect.origin.y += 1; //newRect.origin.x += 1; //newRect.size.width -= 2; newRect.size.height += 1; } NSFrameRectWithWidth(newRect, 2.0); oldDraggingRect = newRect; oldDraggingRect.origin.y -= 1; oldDraggingRect.size.height += 2; } [_window flushWindow]; [self unlockFocus]; } /* This is a crude method of scrolling the view while dragging so the user can drag to any cell even if it's not visible. Unfortunately we don't receive events when the drag is outside the view, so the pointer must still be in the view to drag. */ - (void) _scrollRowAtPointToVisible: (NSPoint)p { NSInteger currentRow; if (p.y < NSMinY([self visibleRect]) + 3) { currentRow = [self rowAtPoint: p] - 1; if (currentRow > 0) [self scrollRowToVisible: currentRow]; } else if (p.y > NSMaxY([self visibleRect]) - 3) { currentRow = [self rowAtPoint: p] + 1; if (currentRow < _numberOfRows) [self scrollRowToVisible: currentRow]; } } - (NSInteger) _computedRowAtPoint: (NSPoint)p { return (NSInteger)(p.y - _bounds.origin.y) / (NSInteger)_rowHeight; } - (void) _setDropOperationAndRow: (NSInteger)row usingPositionInRow: (NSInteger)positionInRow atPoint: (NSPoint)p { NSParameterAssert(row > -1); BOOL isPositionInsideMiddleQuartersOfRow = (positionInRow > _rowHeight / 4 && positionInRow <= (3 * _rowHeight) / 4); BOOL isDropOn = (row > _numberOfRows || isPositionInsideMiddleQuartersOfRow); [self setDropRow: (isDropOn ? [self _computedRowAtPoint: p] : row) dropOperation: (isDropOn ? NSTableViewDropOn : NSTableViewDropAbove)]; } - (NSInteger) _dropRowFromQuarterPosition: (NSInteger)quarterPosition { if ((quarterPosition - oldDropRow * 4 <= 2) && (quarterPosition - oldDropRow * 4 >= -3)) { return oldDropRow; } else { return (quarterPosition + 2) / 4; } } - (NSDragOperation) draggingUpdated: (id ) sender { NSPoint p = [self convertPoint: [sender draggingLocation] fromView: nil]; NSInteger positionInRow = (NSInteger)(p.y - _bounds.origin.y) % (int)_rowHeight; NSInteger quarterPosition = (NSInteger)([self _computedRowAtPoint: p] * 4.); NSInteger row = [self _dropRowFromQuarterPosition: quarterPosition]; NSDragOperation dragOperation = [sender draggingSourceOperationMask]; BOOL isSameDropTargetThanBefore = (lastQuarterPosition == quarterPosition && currentDragOperation == dragOperation); [self _scrollRowAtPointToVisible: p]; if (isSameDropTargetThanBefore) return currentDragOperation; /* Remember current drop target */ currentDragOperation = dragOperation; lastQuarterPosition = quarterPosition; /* The user can retarget this default drop using -setDropRow:dropOperation: in -tableView:validateDrop:proposedRow:proposedDropOperation:. */ [self _setDropOperationAndRow: row usingPositionInRow: positionInRow atPoint: p]; if ([_dataSource respondsToSelector: @selector(tableView:validateDrop:proposedRow:proposedDropOperation:)]) { currentDragOperation = [_dataSource tableView: self validateDrop: sender proposedRow: currentDropRow proposedDropOperation: currentDropOperation]; } /* -setDropRow:dropOperation: can changes both currentDropRow and currentDropOperation. Whether we have to redraw the drop indicator depends on this change. */ if (currentDropRow != oldDropRow || currentDropOperation != oldDropOperation) { [self _drawDropIndicator]; oldDropRow = (currentDropRow > -1 ? currentDropRow : _numberOfRows); oldDropOperation = currentDropOperation; } return currentDragOperation; } - (BOOL) performDragOperation: (id)sender { if ([_dataSource respondsToSelector: @selector(tableView:acceptDrop:row:dropOperation:)]) { return [_dataSource tableView: self acceptDrop: sender row: currentDropRow dropOperation: currentDropOperation]; } else return NO; } - (BOOL) prepareForDragOperation: (id)sender { [self setNeedsDisplayInRect: oldDraggingRect]; [self displayIfNeeded]; return YES; } - (void) concludeDragOperation:(id )sender { } - (BOOL) canDragRowsWithIndexes: (NSIndexSet *)indexes atPoint: (NSPoint)point { return YES; } /* * sorting */ /** Sets the sort descriptors used to sort the rows and delegates the sorting to -tableView:didChangeSortDescriptors or -outlineView:didChangeSortDescriptors: in NSOutlineView. The delegate methods can retrieve the new sort descriptors with -sortDescriptors and override them with -setSortDescriptors:.
The first object in the new sort descriptor array is the sort descriptor prototype returned by the table column whose header was the last clicked. See -[NSTableColumn sortDescriptorPrototype]. This method is called automatically when you click on a table column header, so you shouldn't need to call it usually. Take note the sort descriptors are encoded by the keyed archiving (rarely used since neither IB or Gorm support to set these directly). */ - (void) setSortDescriptors: (NSArray *)sortDescriptors { NSArray *oldSortDescriptors = [self sortDescriptors]; NSArray *newSortDescriptors = nil; /* To replicate precisely the Cocoa behavior */ if (sortDescriptors == nil) { newSortDescriptors = [NSArray array]; } else { /* _sortDescriptors must remain immutable since -sortDescriptors doesn't return a defensive copy */ newSortDescriptors = [NSArray arrayWithArray: sortDescriptors]; } if ([newSortDescriptors isEqual: oldSortDescriptors]) return; RETAIN(oldSortDescriptors); ASSIGN(_sortDescriptors, newSortDescriptors); [self _didChangeSortDescriptors: oldSortDescriptors]; RELEASE(oldSortDescriptors); } /** Returns the current sort descriptors, usually updated every time a click happens on a table column header. By default, returns an empty array. For a more detailed explanation, -setSortDescriptors:. */ - (NSArray *)sortDescriptors { return _sortDescriptors; } /* * User interface validation */ - (BOOL) validateUserInterfaceItem: (id )anItem { // FIXME return YES; } /* * (NotificationRequestMethods) */ - (void) _postSelectionIsChangingNotification { [nc postNotificationName: NSTableViewSelectionIsChangingNotification object: self]; } - (void) _postSelectionDidChangeNotification { [nc postNotificationName: NSTableViewSelectionDidChangeNotification object: self]; } - (void) _postColumnDidMoveNotificationWithOldIndex: (int) oldIndex newIndex: (int) newIndex { [nc postNotificationName: NSTableViewColumnDidMoveNotification object: self userInfo: [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt: newIndex], @"NSNewColumn", [NSNumber numberWithInt: oldIndex], @"NSOldColumn", nil]]; } - (void) _postColumnDidResizeNotificationWithOldWidth: (float) oldWidth { [nc postNotificationName: NSTableViewColumnDidResizeNotification object: self userInfo: [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithFloat: oldWidth], @"NSOldWidth", nil]]; } - (BOOL) _shouldSelectTableColumn: (NSTableColumn *)tableColumn { if ([_delegate respondsToSelector: @selector (tableView:shouldSelectTableColumn:)] == YES) { if ([_delegate tableView: self shouldSelectTableColumn: tableColumn] == NO) { return NO; } } return YES; } - (BOOL) _shouldSelectRow: (int)rowIndex { if ([_delegate respondsToSelector: @selector (tableView:shouldSelectRow:)] == YES) { if ([_delegate tableView: self shouldSelectRow: rowIndex] == NO) { return NO; } } return YES; } - (BOOL) _shouldSelectionChange { if ([_delegate respondsToSelector: @selector (selectionShouldChangeInTableView:)] == YES) { if ([_delegate selectionShouldChangeInTableView: self] == NO) { return NO; } } return YES; } - (void) _didChangeSortDescriptors: (NSArray *)oldSortDescriptors { if ([_dataSource respondsToSelector: @selector(tableView:sortDescriptorsDidChange:)]) { [_dataSource tableView: self sortDescriptorsDidChange: oldSortDescriptors]; } } - (void) _didClickTableColumn: (NSTableColumn *)tc { if ([_delegate respondsToSelector: @selector(tableView:didClickTableColumn:)]) { [_delegate tableView: self didClickTableColumn: tc]; } } - (BOOL) _shouldEditTableColumn: (NSTableColumn *)tableColumn row: (int) rowIndex { if ([_delegate respondsToSelector: @selector(tableView:shouldEditTableColumn:row:)]) { return [_delegate tableView: self shouldEditTableColumn: tableColumn row: rowIndex]; } return YES; } - (BOOL) _isEditableColumn: (int) columnIndex row: (int) rowIndex { NSTableColumn *tableColumn = [_tableColumns objectAtIndex: columnIndex]; return [tableColumn isEditable] && [self _shouldEditTableColumn: tableColumn row: rowIndex]; } - (BOOL) _isCellSelectableColumn: (int) columnIndex row: (int) rowIndex { if (![self _isEditableColumn: columnIndex row: rowIndex]) { return NO; } else { NSCell *cell = [self preparedCellAtColumn: columnIndex row: rowIndex]; return [cell isSelectable]; } } - (BOOL) _isCellEditableColumn: (int) columnIndex row: (int) rowIndex { if (![self _isEditableColumn: columnIndex row: rowIndex]) { return NO; } else { NSCell *cell = [self preparedCellAtColumn: columnIndex row: rowIndex]; return [cell isEditable]; } } - (void) _willDisplayCell: (NSCell*)cell forTableColumn: (NSTableColumn *)tb row: (int)index { if (_del_responds) { [_delegate tableView: self willDisplayCell: cell forTableColumn: tb row: index]; } } - (id) _objectValueForTableColumn: (NSTableColumn *)tb row: (int) index { id result = nil; GSKeyValueBinding *theBinding; theBinding = [GSKeyValueBinding getBinding: NSValueBinding forObject: tb]; if (theBinding != nil) { return [(NSArray *)[theBinding sourceValueFor: NSValueBinding] objectAtIndex: index]; } else if ([_dataSource respondsToSelector: @selector(tableView:objectValueForTableColumn:row:)]) { result = [_dataSource tableView: self objectValueForTableColumn: tb row: index]; } return result; } - (void) _setObjectValue: (id)value forTableColumn: (NSTableColumn *)tb row: (int) index { if ([_dataSource respondsToSelector: @selector(tableView:setObjectValue:forTableColumn:row:)]) { [_dataSource tableView: self setObjectValue: value forTableColumn: tb row: index]; } } /* Quasi private method called on self from -noteNumberOfRowsChanged * implemented in NSTableView and subclasses * by default returns the DataSource's -numberOfRowsInTableView: */ - (int) _numRows { GSKeyValueBinding *theBinding; // If we have content binding the data source is used only // like a delegate theBinding = [GSKeyValueBinding getBinding: NSContentBinding forObject: self]; if (theBinding != nil) { return [(NSArray *)[theBinding sourceValueFor: NSContentBinding] count]; } else if ([_dataSource respondsToSelector: @selector(numberOfRowsInTableView:)]) { return [_dataSource numberOfRowsInTableView:self]; } else { // FIXME return 0; } } - (BOOL) _isDraggingSource { return [_dataSource respondsToSelector: @selector(tableView:writeRows:toPasteboard:)] || [_dataSource respondsToSelector: @selector(tableView:writeRowsWithIndexes:toPasteboard:)]; } - (BOOL) _writeRows: (NSIndexSet *)rows toPasteboard: (NSPasteboard *)pboard { if ([_dataSource respondsToSelector: @selector(tableView:writeRowsWithIndexes:toPasteboard:)] == YES) { return [_dataSource tableView: self writeRowsWithIndexes: rows toPasteboard: pboard]; } else if ([_dataSource respondsToSelector: @selector(tableView:writeRows:toPasteboard:)] == YES) { NSArray *rowArray; rowArray = [self _indexSetToArray: rows]; return [_dataSource tableView: self writeRows: rowArray toPasteboard: pboard]; } return NO; } @end /* implementation of NSTableView */ @implementation NSTableView (SelectionHelper) - (void) _setSelectingColumns: (BOOL)flag { if (flag == _selectingColumns) return; if (flag == NO) { [self _unselectAllColumns]; _selectingColumns = NO; } else { [self _unselectAllRows]; _selectingColumns = YES; } } - (NSArray *) _indexSetToArray: (NSIndexSet*)indexSet { NSMutableArray *array = [NSMutableArray array]; NSUInteger index = [indexSet firstIndex]; while (index != NSNotFound) { NSNumber *num = [NSNumber numberWithInt: index]; [array addObject: num]; index = [indexSet indexGreaterThanIndex: index]; } return array; } - (NSArray *) _selectedRowArray { return [self _indexSetToArray: _selectedRows]; } - (BOOL) _selectRow: (int)rowIndex { if (![self _shouldSelectRow: rowIndex]) { return NO; } [self setNeedsDisplayInRect: [self rectOfRow: rowIndex]]; [_selectedRows addIndex: rowIndex]; _selectedRow = rowIndex; return YES; } - (BOOL) _selectUnselectedRow: (int)rowIndex { if ([_selectedRows containsIndex: rowIndex]) { return NO; } [self setNeedsDisplayInRect: [self rectOfRow: rowIndex]]; [_selectedRows addIndex: rowIndex]; _selectedRow = rowIndex; return YES; } - (BOOL) _unselectRow: (int)rowIndex { if (![_selectedRows containsIndex: rowIndex]) { return NO; } [self setNeedsDisplayInRect: [self rectOfRow: rowIndex]]; [_selectedRows removeIndex: rowIndex]; if (_selectedRow == rowIndex) { _selectedRow = -1; } return YES; } - (void) _unselectAllRows { /* Compute rect to redraw to clear the old row selection */ NSUInteger row = [_selectedRows firstIndex]; while (row != NSNotFound) { [self setNeedsDisplayInRect: [self rectOfRow: row]]; row = [_selectedRows indexGreaterThanIndex: row]; } [_selectedRows removeAllIndexes]; _selectedRow = -1; } - (NSArray *) _selectedColumArray { return [self _indexSetToArray: _selectedColumns]; } - (void) _unselectAllColumns { /* Compute rect to redraw to clear the old column selection */ NSUInteger column = [_selectedColumns firstIndex]; while (column != NSNotFound) { [self setNeedsDisplayInRect: [self rectOfColumn: column]]; if (_headerView) { [_headerView setNeedsDisplayInRect: [_headerView headerRectOfColumn: column]]; } column = [_selectedColumns indexGreaterThanIndex: column]; } [_selectedColumns removeAllIndexes]; _selectedColumn = -1; } - (void) setValue: (id)anObject forKey: (NSString*)aKey { if ([aKey isEqual: NSContentBinding]) { // Reload data [self reloadData]; NSLog(@"Setting TV content to %@", anObject); } else if ([aKey isEqual: NSSelectionIndexesBinding]) { if (_selectingColumns) { if (nil == anObject) { [self _unselectAllColumns]; } else { return [self selectColumnIndexes: anObject byExtendingSelection: NO]; } } else { if (nil == anObject) { [self _unselectAllRows]; } else { return [self selectRowIndexes: anObject byExtendingSelection: NO]; } } } else { [super setValue: anObject forKey: aKey]; } } - (id) valueForKey: (NSString*)aKey { if ([aKey isEqual: NSContentBinding]) { return nil; } else if ([aKey isEqual: NSSelectionIndexesBinding]) { if (_selectingColumns) { return [self selectedColumnIndexes]; } else { return [self selectedRowIndexes]; } } else { return [super valueForKey: aKey]; } } @end gnustep-gui-0.24.0/Source/NSBitmapImageRep+PNG.h0000664000076500007650000000256411376454556021111 0ustar brains99brains99/* NSBitmapImageRep+PNG.h Methods for loading .png images. Copyright (C) 2003 Free Software Foundation, Inc. Written by: Alexander Malmberg Date: 2003-12-07 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _NSBitmapImageRep_PNG_H_include #define _NSBitmapImageRep_PNG_H_include #import "AppKit/NSBitmapImageRep.h" @interface NSBitmapImageRep (PNG) + (BOOL) _bitmapIsPNG: (NSData *)imageData; - (id) _initBitmapFromPNG: (NSData *)imageData; - (NSData *) _PNGRepresentationWithProperties: (NSDictionary *) properties; @end #endif gnustep-gui-0.24.0/Panels/0000775000076500007650000000000012256227330015166 5ustar brains99brains99gnustep-gui-0.24.0/Panels/ColorPanel.gmodel0000664000076500007650000003251610377004044020421 0ustar brains99brains99{ "Object 1" = {elements = ("Object 2"); isa = NSMutableArray; }; "Object 2" = { className = GSAppKitPanelController; isa = IMCustomObject; realObject = "Object 3"; }; "Object 3" = { delegate = nil; isa = NSApplication; keyWindow = nil; mainMenu = nil; mainWindow = nil; windows = "Object 4"; }; "Object 4" = { elements = ("ColorPanel"); isa = NSMutableArray; }; "BackgroundColor" = { alpha = 1.000000; blue = 0.666667; brightness = 0.666667; colorSpaceName = NSCalibratedRGBColorSpace; green = 0.666667; hue = 0.000000; isa = NSColor; red = 0.666667; saturation = 0.000000; }; "BlackColor" = { alpha = 1.000000; blue = 0.000000; brightness = 0.000000; colorSpaceName = NSCalibratedRGBColorSpace; green = 0.000000; hue = 0.000000; isa = NSColor; red = 0.000000; saturation = 0.000000; }; "Font" = {isa = NSFont; name = Helvetica; size = 12.000000; }; "ColorPanel" = { backgroundColor = "BackgroundColor"; backingType = 2; becomesKeyOnlyIfNeeded = YES; contentFrame = "{x = 352; y = 519; width = 200; height = 270}"; contentView = "ContentView"; frameAutosaveName = nil; hidesOnDeactivate = YES; initialFirstResponder = nil; isAutodisplay = YES; isFloatingPanel = YES; isReleasedWhenClosed = NO; isVisible = NO; isa = NSColorPanel; level = 0; maxSize = "{width = 3.40282e+38; height = 3.40282e+38}"; minSize = "{width = 202; height = 302}"; representedFilename = ""; styleMask = 11; title = Colors; }; "ContentView" = { autoresizesSubviews = YES; autoresizingMask = 18; bounds = "{x = 0; y = 0; width = 200; height = 270}"; frame = "{x = 0; y = 0; width = 200; height = 270}"; interfaceStyle = 0; isa = NSView; nextKeyView = nil; nextResponder = "ColorPanel"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; previousKeyView = nil; subviews = "Object 5"; superview = nil; }; "Object 5" = { elements = ("TopView"); isa = NSMutableArray; }; "TopView" = { autoresizesSubviews = YES; autoresizingMask = 18; bounds = "{x = 0; y = 0; width = 200; height = 270}"; frame = "{x = 0; y = 0; width = 200; height = 270}"; interfaceStyle = 0; isa = NSView; nextKeyView = nil; nextResponder = "ContentView"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifcations = YES; previousKeyView = nil; subviews = "Object 7"; superview = "ContentView"; }; "Object 7" = { elements = ( "MagnifyButton", "ColorWell", "PickerMatrix", "AlphaSlider", "PickerBox" ); isa = NSMutableArray; }; "MagnifyButton" = { autoresizesSubviews = NO; autoresizingMask = 12; bounds = "{x = 0; y = 0; width = 50; height = 36}"; cell = "MagnifyButtonCell"; frame = "{x = 4; y = 230; width = 50; height = 36}"; ignoresMultiClick = NO; interfaceStyle = 0; isEnabled = NO; isa = NSButton; nextKeyView = nil; nextResponder = "TopView"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; previousKeyView = nil; subviews = nil; superview = "TopView"; tag = 0; }; "MagnifyButtonCell" = { action = nil; alignment = 2; alternateImage = nil; alternateTitle = ""; delay = 0.200000; entryType = 0; font = "Font"; highlightsBy = 14; image = "MagnifyImage"; imagePosition = 1; interval = 0.025000; isBezeled = NO; isBordered = YES; isContinuous = NO; isEditable = NO; isEnabled = NO; isScrollable = NO; isSelectable = NO; isTransparent = NO; isa = NSButtonCell; keyEquivalent = ""; keyEquivalentFont = nil; keyEquivalentModifierMask = 0; sendActionMask = 0; showsStateBy = 0; state = 0; stringValue = 0; tag = 0; target = nil; title = Set; type = 2; wraps = YES; }; "MagnifyImage" = {isa = NSImage; name = GNUstepMenuImage; size = "{width = 14; height = 14}"; }; "ColorWell" = { autoresizesSubviews = YES; autoresizingMask = 10; bounds = "{x = 0; y = 0; width = 138; height = 36}"; cell = nil; color = "BlackColor"; frame = "{x = 58; y = 230; width = 138; height = 36}"; ignoresMultiClick = NO; interfaceStyle = 0; isEnabled = YES; isa = NSColorWell; nextKeyView = nil; nextResponder = "TopView"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; previousKeyView = nil; subviews = nil; superview = "TopView"; tag = 0; }; "PickerMatrix" = { action = nil; allowsEmptySelection = NO; autoresizesSubviews = NO; autoresizingMask = 10; autosizesCells = YES; backgroundColor = "BackgroundColor"; bounds = "{x = 0; y = 0; width = 192; height = 36}"; cell = nil; cellBackgroundColor = "BackgroundColor"; cellClass = NSButtonCell; cellSize = "{width = 40; height = 36}"; cells = nil; delegate = nil; doubleAction = nil; errorAction = nil; frame = "{x = 4; y = 190; width = 192; height = 36}"; ignoresMultiClick = NO; intercellSpacing = "{width = 2; height = 0}"; interfaceStyle = 0; isAutoscroll = NO; isEnabled = YES; isSelectionByRect = NO; isa = NSMatrix; mode = 0; nextKeyView = nil; nextResponder = "TopView"; numberOfColumns = 0; numberOfRows = 0; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; previousKeyView = nil; prototype = "PickerButtonPrototype"; subviews = nil; superview = "TopView"; tag = 0; target = nil; }; "PickerButtonPrototype" = { action = nil; alignment = 2; alternateImage = nil; alternateTitle = ""; delay = 0.200000; entryType = 0; font = "Font"; highlightsBy = 14; image = nil; imagePosition = 1; interval = 0.025000; isBezeled = NO; isBordered = YES; isContinuous = NO; isEditable = NO; isEnabled = YES; isScrollable = NO; isSelectable = NO; isTransparent = NO; isa = NSButtonCell; keyEquivalent = ""; keyEquivalentFont = nil; keyEquivalentModifierMask = 0; sendActionMask = 0; showsStateBy = 0; state = 0; stringValue = 0; tag = 0; target = nil; title = ""; type = 2; wraps = YES; }; "PickerBox" = { autoresizesSubviews = YES; autoresizingMask = 18; borderType = 0; bounds = "{x = 0; y = 0; width = 192; height = 162}"; contentView = nil; contentViewMargins = "{width = 0; height = 0}"; frame = "{x = 4; y = 24; width = 192; height = 162}"; interfaceStyle = 0; isa = NSBox; nextKeyView = nil; nextResponder = "TopView"; ostsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; previousKeyView = nil; subviews = nil; superview = "TopView"; title = Box; titleFont = "Font"; titlePosition = 0; }; "AlphaSlider" = { autoresizesSubviews = NO; autoresizingMask = 34; bounds = "{x = 0; y = 0; width = 192; height = 16}"; cell = "AlphaSliderCell"; frame = "{x = 4; y = 4; width = 192; height = 16}"; ignoresMultiClick = NO; interfaceStyle = 0; isEnabled = YES; isa = NSSlider; nextKeyView = nil; nextResponder = "TopView"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; previousKeyView = nil; subviews = nil; superview = "TopView"; tag = 0; }; "AlphaSliderCell" = { action = nil; alignment = 0; entryType = 0; font = "Font"; image = nil; isBezeled = YES; isBordered = NO; isContinuous = YES; isEditable = NO; isEnabled = YES; isScrollable = NO; isSelectable = NO; isa = NSSliderCell; knobThickness = 12.000000; maxValue = 100.000000; minValue = 0.000000; sendActionMask = 0; state = 0; stringValue = 50; tag = 0; target = nil; titleCell = "AlphaSliderTitleCell"; type = 1; wraps = YES; }; "AlphaSliderTitleCell" = { action = nil; alignment = 0; backgroundColor = "BackgroundColor"; drawsBackground = NO; entryType = 0; font = "Font"; image = nil; isBezeled = NO; isBordered = NO; isContinuous = NO; isEditable = NO; isEnabled = YES; isScrollable = NO; isSelectable = NO; isa = NSTextFieldCell; sendActionMask = 0; state = 0; stringValue = "Alpha Channel"; tag = 0; target = nil; textColor = "BlackColor"; type = 1; wraps = YES; }; "SwatchMatrix" = { action = nil; allowsEmptySelection = YES; autoresizesSubviews = NO; autoresizingMask = 18; autosizesCells = NO; backgroundColor = "BackgroundColor"; bounds = "{x = 0; y = 0; width = 200; height = 0}"; cell = nil; cellBackgroundColor = "BlackColor"; cellClass = NSActionCell; cellSize = "{width = 15; height = 15}"; cells = nil; delegate = nil; doubleAction = nil; drawsBackground = NO; drawsCellBackground = YES; errorAction = nil; frame = "{x = 4; y = 0; width = 200; height = 0}"; ignoresMultiClick = NO; intercellSpacing = "{width = 1; height = 1}"; interfaceStyle = 0; isAutoscroll = NO; isEnabled = YES; isSelectionByRect = NO; isa = NSMatrix; mode = 0; nextKeyView = nil; nextResponder = "SplitView"; numberOfColumns = 10; numberOfRows = 1; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; previousKeyView = nil; prototype = nil; subviews = nil; superview = "SplitView"; tag = 0; target = nil; }; "Connections" = { elements = ( "Connection 1", "Connection 3", "Connection 4", "Connection 5", "Connection 6", "Connection 7", "Connection 8" ); isa = NSMutableArray; }; "Connection 1" = { destination = "ColorPanel"; isa = IMOutletConnector; label = "Label 1"; source = "Object 2"; }; "Label 1" = {isa = NSString; string = panel; }; "Connection 2" = { destination = "SplitView"; isa = IMOutletConnector; label = "Label 2"; source = "ColorPanel"; }; "Label 2" = {isa = NSString; string = "_splitView"; }; "Connection 3" = { destination = "TopView"; isa = IMOutletConnector; label = "Label 3"; source = "ColorPanel"; }; "Label 3" = {isa = NSString; string = "_topView"; }; "Connection 4" = { destination = "MagnifyButton"; isa = IMOutletConnector; label = "Label 4"; source = "ColorPanel"; }; "Label 4" = {isa = NSString; string = "_magnifyButton"; }; "Connection 5" = { destination = "ColorWell"; isa = IMOutletConnector; label = "Label 5"; source = "ColorPanel"; }; "Label 5" = {isa = NSString; string = "_colorWell"; }; "Connection 6" = { destination = "AlphaSlider"; isa = IMOutletConnector; label = "Label 6"; source = "ColorPanel"; }; "Label 6" = {isa = NSString; string = "_alphaSlider"; }; "Connection 7" = { destination = "PickerBox"; isa = IMOutletConnector; label = "Label 7"; source = "ColorPanel"; }; "Label 7" = {isa = NSString; string = "_pickerBox"; }; "Connection 8" = { destination = "PickerMatrix"; isa = IMOutletConnector; label = "Label 8"; source = "ColorPanel"; }; "Label 8" = {isa = NSString; string = "_pickerMatrix"; }; RootObject = {Connections = "Connections"; Objects = "Object 1"; isa = GMModel; }; TopLevelObjects = (RootObject); Version = 1; } gnustep-gui-0.24.0/Panels/SavePanel.gmodel0000664000076500007650000004634010377004044020241 0ustar brains99brains99// // Gmodel for NSOpenPanel/NSSavePanel // { "ObjectArray" = { elements = ( "Custom_SavePanel" ); isa = NSMutableArray; }; "Custom_SavePanel" = { isa = IMCustomObject; className = NSSavePanel; realObject = "SavePanel"; }; "BackgroundColor" = { alpha = 1.000000; blue = 0.666667; brightness = 0.666667; colorSpaceName = NSCalibratedRGBColorSpace; green = 0.666667; hue = 0.000000; isa = NSColor; red = 0.666667; saturation = 0.000000; }; "SavePanel" = { backgroundColor = "BackgroundColor"; backingType = 2; contentView = "SavePanelView"; frame = "{x = 100; y = 100; width = 280; height = 350}"; isVisible = NO; level = 0; isa = NSSavePanel; isAutodisplay = YES; title = "Save"; isDocumentEdited = NO; representedFilename = ""; isReleasedWhenClosed = NO; delegate = nil; prompt = "Name:"; accessoryView = nil; requiredFileType = ""; treatsFilePackagesAsDirectories = YES; directory = "."; minSize = "{width = 280; height = 350}"; styleMask = 9; }; "SavePanelView" = { autoresizesSubviews = YES; autoresizingMask = 0; bounds = "{x = 0; y = 0; width = 280; height = 350}"; frame = "{x = 0; y = 0; width = 280; height = 350}"; isAutodisplay = YES; isa = NSView; nextResponder = "SavePanel"; postBoundsChangedNotifications = YES; postFrameChangedNotifications = YES; subviews = "SavePanelSubviews"; superview = nil; tag = 0; }; "SavePanelSubviews" = { elements = ( "TopView", "BottomView"); isa = NSMutableArray; }; "TopView" = { autoresizesSubviews = YES; autoresizingMask = 18; bounds = "{x = 0; y = 0; width = 280; height = 290}"; frame = "{x = 0; y = 60; width = 280; height = 290}"; isAutodisplay = YES; isa = NSView; nextResponder = "SavePanel"; postBoundsChangedNotifications = YES; postFrameChangedNotifications = YES; subviews = "TopSubviews"; superview = "SavePanelView"; tag = 0; }; "TopSubviews" = { elements = ( "ImageView", "SaveLabel", "Bar", "Browser"); isa = NSMutableArray; }; "BottomView" = { autoresizesSubviews = YES; autoresizingMask = 2; bounds = "{x = 0; y = 0; width = 280; height = 60}"; frame = "{x = 0; y = 0; width = 280; height = 60}"; isAutodisplay = YES; isa = NSView; nextResponder = "SavePanel"; postBoundsChangedNotifications = YES; postFrameChangedNotifications = YES; subviews = "BottomSubviews"; superview = "SavePanelView"; tag = 0; }; "BottomSubviews" = { elements = ( "HomeButton", "MountButton", "UnmountButton", "CancelButton", "OkButton", "FileName", "PromptLabel"); isa = NSMutableArray; }; // // Browser // "Browser" = { autoresizingMask = 18; title = "Column 0"; pathSeparator = "/"; delegate = "SavePanel"; maxVisibleColumns = 2; hasHorizontalScroller = YES; isAutodisplay = YES; allowsMultipleSelection = NO; bounds = "{x = 0; y = 0; width = 260; height = 200}"; frame = "{x = 10; y = 10; width = 260; height = 196}"; isTitled = YES; isa = NSBrowser; subviews = nil; superview = "SavePanelView"; takesTitleFromPreviousColumn = YES; }; "FileName" = { autoresizesSubviews = NO; autoresizingMask = 2; backgroundColor = "TextBkColor"; bounds = "{x = 0; y = 0; width = 226; height = 22}"; cell = "FileNameCell"; delegate = nil; drawsBackground = YES; errorAction = nil; frame = "{x = 44; y = 40; width = 226; height = 22}"; ignoresMultiClick = NO; isBezeled = YES; isBordered = NO; isContinuous = NO; isEditable = YES; isEnabled = YES; isScrollable = YES; isSelectable = YES; isa = NSTextField; nextResponder = "SavePanelView"; nextText = "HomeButton"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; previousText = "OkButton"; subviews = nil; superview = "SavePanelView"; tag = 666; textColor = "TextColor"; }; "FileNameCell" = { action = nil; alignment = 2; backgroundColor = "TextBkColor"; drawsBackground = YES; entryType = 0; font = "TextFont"; image = nil; isBezeled = YES; isBordered = NO; isContinuous = NO; isEditable = YES; isEnabled = YES; isScrollable = YES; isSelectable = YES; isa = NSTextFieldCell; sendActionMask =0; state = 0; stringValue = "foobar.txt"; tag = 0; target = nil; textColor = "TextColor"; type = 1; wraps = YES; }; "PromptLabel" = { autoresizesSubviews = NO; autoresizingMask = 0; //backgroundColor = "TextBkColor"; bounds = "{x = 0; y = 0; width = 38; height = 18}"; cell = "PromptLabelCell"; delegate = nil; drawsBackground = NO; errorAction = nil; frame = "{x = 5; y = 38; width = 38; height = 18}"; ignoresMultiClick = NO; isBezeled = NO; isBordered = NO; isEditable = NO; isEnabled = NO; isScrollable = NO; isSelectable = NO; isa = NSTextField; nextResponder = "SavePanelView"; nextText = "HomeButton"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; previousText = "OkButton"; stringValue = "Name:"; subviews = nil; superview = "SavePanelView"; tag = 0; textColor = "TextColor"; }; "PromptLabelCell" = { action = nil; alignment = 2; backgroundColor = nil; drawsBackground = NO; entryType = 0; font = "TextFont"; image = nil; isBezeled = NO; isBordered = NO; isContinuous = NO; isEditable = NO; isEnabled = NO; isScrollable = NO; isSelectable = NO; isa = NSTextFieldCell; sendActionMask = 0; state = 0; stringValue = "Name:"; tag = 0; target = nil; textColor = "TextColor"; type = 1; wraps = YES; }; "HomeButton" = { alternateImage = "Object 22"; alternateTitle = ""; autoresizesSubviews = NO; autoresizingMask = 1; bounds = "{x = 0; y = 0; width = 28; height = 28}"; cell = "HomeButtonCell"; delay = 0.200000; frame = "{x = 18; y = 5; width = 28; height = 28}"; highlightsBy = 14; ignoresMultiClick = NO; image = "Object 22"; imagePosition = 1; interval = 0.025; isBordered = YES; isEnabled = YES; isTransparent = NO; isa = NSButton; keyEquivalent = ""; nextResponder = "SavePanelView"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; showsStateBy = 0; state = 0; subviews = nil; superview = "SavePanelView"; tag = 0; title = ""; }; "Object 22" = {isa = NSImage; name = common_Home; size = "{width = 24; height = 24}"; }; "HomeButtonCell" = { action = nil; alignment = 2; alternateImage = "Object 22"; alternateTitle = ""; delay = 0.200000; entryType = 0; font = nil; highlightsBy = 14; image = "Object 22"; imagePosition = 2; interval = 0.025000; isBezeled = NO; isBordered = YES; isContinuous = NO; isEditable = NO; isEnabled = YES; isScrollable = NO; isSelectable = NO; isTransparent = NO; isa = NSButtonCell; keyEquivalent = ""; keyEquivalentFont = nil; keyEquivalentModifierMask = 0; sendActionMask = 0; showsStateBy = 1; state = 0; stringValue = ""; tag = 0; target = nil; type = 1; wraps = NO; }; "MountButton" = { alternateImage = nil; alternateTitle = ""; autoresizesSubviews = NO; autoresizingMask = 1; bounds = "{x = 0; y = 0; width = 28; height = 28}"; cell = "MountButtonCell"; delay = 0.2; frame = "{x = 52; y = 5; width = 28; height = 28}"; highlightsBy = 14; ignoresMultiClick = NO; image = "Object 23"; imagePosition = 1; interval = 0.025; isBordered = YES; isEnabled = YES; isTransparent = NO; isa = NSButton; keyEquivalent = ""; nextResponder = "SavePanelView"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; showsStateBy = 0; state = 0; subviews = nil; superview = "SavePanelView"; tag = 0; title = ""; }; "Object 23" = {isa = NSImage; name = common_Mount; size = "{width = 24; height = 24}"; }; "MountButtonCell" = { action = nil; alignment = 2; alternateImage = nil; alternateTitle = ""; delay = 0.2; entryType = 0; font = nil; highlightsBy = 14; image = "Object 23"; imagePosition = 1; interval = 0.025000; isBezeled = NO; isBordered = YES; isContinuous = NO; isEditable = NO; isEnabled = YES; isScrollable = NO; isSelectable = NO; isTransparent = NO; isa = NSButtonCell; keyEquivalent = ""; keyEquivalentFont = nil; keyEquivalentModifierMask = 0; sendActionMask = 0; showsStateBy = 0; state = 0; stringValue = 0; tag = 0; target = nil; type = 1; wraps = YES; }; "UnmountButton" = { alternateImage = nil; alternateTitle = ""; autoresizesSubviews = NO; autoresizingMask = 1; bounds = "{x = 0; y = 0; width = 28; height = 28}"; cell = "UnmountButtonCell"; delay = 0.2; frame = "{x = 86; y = 5; width = 28; height = 28}"; highlightsBy = 14; ignoresMultiClick = NO; image = "Object 24"; imagePosition = 1; interval = 0.025; isBordered = YES; isEnabled = YES; isTransparent = NO; isa = NSButton; keyEquivalent = ""; nextResponder = "SavePanelView"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; showsStateBy = 0; state = 0; subviews = nil; superview = "SavePanelView"; tag = 0; title = ""; }; "Object 24" = {isa = NSImage; name = common_Unmount; size = "{width = 24; height = 24}"; }; "UnmountButtonCell" = { action = nil; alignment = 2; alternateImage = nil; alternateTitle = ""; delay = 0.2; entryType = 0; font = nil; highlightsBy = 14; image = "Object 23"; imagePosition = 1; interval = 0.025000; isBezeled = NO; isBordered = YES; isContinuous = NO; isEditable = NO; isEnabled = YES; isScrollable = NO; isSelectable = NO; isTransparent = NO; isa = NSButtonCell; keyEquivalent = ""; keyEquivalentFont = nil; keyEquivalentModifierMask = 0; sendActionMask = 0; showsStateBy = 0; state = 0; stringValue = 0; tag = 0; target = nil; type = 1; wraps = YES; }; "CancelButton" = { alignment = 2; alternateImage = nil; alternateTitle = "Cancel"; autoresizesSubviews = NO; autoresizingMask = 1; bounds = "{x = 0; y = 0; width = 70; height = 28}"; cell = "CancelButtonCell"; frame = "{x = 122; y = 5; width = 70; height = 28}"; delay = 0.2; highlightsBy = 14; ignoresMultiClick = NO; image = nil; imagePosition = 0; interval = 0.025; isBordered = YES; isContinuous = NO; isEnabled = YES; isTransparent = NO; isa = NSButton; keyEquivalent = ""; nextResponder = "SavePanelView"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; showsStateBy = 0; state = 0; subviews = nil; superview = "SavePanelView"; tag = 0; title = "Cancel"; }; "CancelButtonCell" = { action = nil; alignment = 2; alternateImage = nil; alternateTitle = ""; delay = 0.200000; entryType = 0; font = "TextFont"; highlightsBy = 14; image = nil; imagePosition = 0; interval = 0.02500; isBezeled = NO; isBordered = YES; isContinuous = NO; isEditable = NO; isEnabled = YES; isScrollable = NO; isSelectable = NO; isTransparent = NO; isa = NSButtonCell; keyEquivalent = ""; keyEquivalentFont = "TextFont"; keyEquivalentModifierMask = 0; sendActionMask = 0; showsStateBy = 0; state = 0; stringValue = 0; tag = 0; target = nil; type = 1; wraps = YES; }; "OkButton" = { alignment = 2; alternateImage = nil; alternateTitle = "OK"; autoresizesSubviews = NO; autoresizingMask = 1; bounds = "{x = 0; y = 0; width = 70; height = 28}"; cell = "OkButtonCell"; frame = "{x = 200; y = 5; width = 70; height = 28}"; delay = 0.2; highlightsBy = 14; ignoresMultiClick = NO; image = nil; imagePosition = 0; interval = 0.025; isBordered = YES; isContinuous = NO; isEnabled = YES; isTransparent = NO; isa = NSButton; keyEquivalent = ""; nextResponder = "SavePanelView"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; showsStateBy = 0; state = 0; subviews = nil; superview = "SavePanelView"; tag = 0; title = "OK"; }; "OkButtonCell" = { action = nil; alignment = 2; alternateImage = nil; alternateTitle = ""; delay = 0.200000; entryType = 0; font = "TextFont"; highlightsBy = 14; image = nil; imagePosition = 0; interval = 0.02500; isBezeled = NO; isBordered = YES; isContinuous = NO; isEditable = NO; isEnabled = YES; isScrollable = NO; isSelectable = NO; isTransparent = NO; isa = NSButtonCell; keyEquivalent = ""; keyEquivalentFont = "TextFont"; keyEquivalentModifierMask = 0; sendActionMask = 0; showsStateBy = 0; state = 0; stringValue = 0; tag = 0; target = nil; type = 1; wraps = YES; }; "Bar" = { autoresizesSubviews = NO; autoresizingMask = 10; borderType = 3; bounds = "{x = 0; y = 0; width = 310; height = 2}"; contentView = "BarView"; contentViewMargins = "{width = 0; height = 0}"; frame = "{x = 0; y = 210; width = 310; height = 2}"; isa = NSBox; nextResponder = "Browser"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; subviews = "BarSubviews"; superview = "SavePanelView"; titlePosition = 0; }; "BarSubviews" = {elements = ("BarView"); isa = NSMutableArray; }; "BarView" = { autoresizesSubviews = NO; autoresizingMask = 0; bounds = "{x = 0; y = 0; width = 306; height = 0}"; frame = "{x = 2; y = 2; width = 306; height = 0}"; isa = NSView; nextResponder = "Bar"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; subviews = nil; superview = "Bar"; }; "SaveLabel" = { autoresizesSubviews = NO; autoresizingMask = 8; backgroundColor = "TextBkColor"; bounds = "{x = 0; y = 0; width = 224; height = 21}"; cell = "SaveLabelCell"; delegate = nil; drawsBackground = NO; errorAction = nil; frame = "{x = 80; y = 240; width = 224; height = 21}"; ignoresMultiClick = NO; isBezeled = NO; isBordered = NO; isEditable = NO; isEnabled = YES; isScrollable = NO; isSelectable = NO; isa = NSTextField; nextResponder = nil; nextText = nil; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; previousText = nil; stringValue = Save; subviews = nil; superview = "SavePanelView"; tag = 151; textColor = "TextColor"; }; "SaveLabelCell" = { action = nil; alignment = 0; backgroundColor = "TextBkColor"; drawsBackground = NO; entryType = 0; font = "SaveLabelFont"; image = nil; isBezeled = NO; isBordered = NO; isContinuous = NO; isEditable = NO; isEnabled = YES; isScrollable = NO; isSelectable = NO; isa = NSTextFieldCell; sendActionMask = 0; state = 0; stringValue = "Save"; tag = 0; target = nil; textColor = "TextColor"; type = 1; wraps = NO; }; "SaveLabelFont" = { isa = NSFont; name = Helvetica; size = 18.000000; }; "TextFont" = {isa = NSFont; name = Helvetica; size = 12.000000; }; "ImageView" = { alignment = 0; autoresizesSubviews = NO; autoresizingMask = 8; bounds = "{x = 0; y = 0; width = 64; height = 64}"; cell = "ImageViewCell"; frame = "{x = 8; y = 218; width = 64; height = 64}"; ignoresMultiClick = NO; image = "AppIcon"; imagePosition = 1; isBordered = NO; isa = NSImageView; keyEquivalent = ""; nextResponder = "SavePanelView"; postsBoundsChangedNotifications = YES; postsFrameChangedNotifications = YES; showsStateBy = 0; state = 0; subviews = nil; superview = "SavePanelView"; tag = 0; title = ""; }; "AppIcon" = {isa = NSImage; name = NSApplicationIcon; size = "{width = 48; height = 48}"; }; "ImageViewCell" = { image = "AppIcon"; isa = NSImageCell; }; // // Colors // "TextColor" = { alpha = 1.0; blue = 0.0; brightness = 0.0; colorSpaceName = NSCalibratedRGBColorSpace; green = 0.0; hue = 0.0; isa = NSColor; red = 0.0; saturation = 0.0; }; "TextBkColor" = { alpha = 1.0; blue = 1.0; brightness = 1.0; colorSpaceName = NSCalibratedRGBColorSpace; green = 1.0; hue = 0.0; isa = NSColor; red = 1.0; saturation = 0.0; }; "ConnectionArray" = { elements = ( "TopViewConnect", "BottomViewConnect", "Object 66", "Object 68", "Object 49", "Object 51", "Object 53", "Object 55", "HomeConnect", "MountConnect", "UnmountConnect", "CellSelectionConnect", ); isa = NSMutableArray; }; "Object 65" = {isa = NSString; string = "cancel:"; }; "Object 66" = { destination = "SavePanel"; isa = IMControlConnector; label = "Object 65"; source = "CancelButton"; }; "Object 67" = {isa = NSString; string = "ok:"; }; "Object 68" = { destination = "SavePanel"; isa = IMControlConnector; label = "Object 67"; source = "OkButton"; }; "Object 48" = {isa = NSString; string = delegate; }; "Object 49" = { destination = "SavePanel"; isa = IMOutletConnector; label = "Object 48"; source = "Browser"; }; "TopViewIVar" = {isa = NSString; string = _topView; }; "TopViewConnect" = { destination = "TopView"; isa = IMOutletConnector; label = "TopViewIVar"; source = "SavePanel"; }; "BottomViewIVar" = {isa = NSString; string = _bottomView; }; "BottomViewConnect" = { destination = "BottomView"; isa = IMOutletConnector; label = "BottomViewIVar"; source = "SavePanel"; }; "Object 50" = {isa = NSString; string = _browser; }; "Object 51" = { destination = "Browser"; isa = IMOutletConnector; label = "Object 50"; source = "SavePanel"; }; "Object 52" = {isa = NSString; string = _form; }; "Object 53" = { destination = "FileName"; isa = IMOutletConnector; label = "Object 52"; source = "SavePanel"; }; "PromptIVar" = {isa = NSString; string = _prompt; }; "PromptConnect" = { destination = "PromptLabel"; isa = IMOutletConnector; label = "PromptIVar"; source = "SavePanel"; }; "Object 54" = {isa = NSString; string = _titleField; }; "Object 55" = { destination = "SaveLabel"; isa = IMOutletConnector; label = "Object 54"; source = "SavePanel"; }; "SetHomeDirMethod" = {isa = NSString; string = _setHomeDirectory; }; "HomeConnect" = { destination = "SavePanel"; isa = IMControlConnector; label = "SetHomeDirMethod"; source = "HomeButton"; }; "MountMethod" = {isa = NSString; string = _mountMedia; }; "MountConnect" = { destination = "SavePanel"; isa = IMControlConnector; label = "MountMethod"; source = "MountButton"; }; "UnmountMethod" = {isa = NSString; string = _unmountMedia; }; "UnmountConnect" = { destination = "SavePanel"; isa = IMControlConnector; label = "UnmountMethod"; source = "UnmountButton"; }; "CellSelectionMethod" = {isa = NSString; string = _processCellSelection; }; "CellSelectionConnect" = { destination = "SavePanel"; isa = IMControlConnector; label = "CellSelectionMethod"; source = "Browser"; }; RootObject = {Connections = "ConnectionArray"; Objects = "ObjectArray"; isa = GMModel; }; TopLevelObjects = (RootObject); Version = 1; } gnustep-gui-0.24.0/Panels/Spanish.lproj/0000775000076500007650000000000012256227330017720 5ustar brains99brains99gnustep-gui-0.24.0/Panels/Spanish.lproj/GSToolbarCustomizationPalette.gorm/0000775000076500007650000000000012256227330026627 5ustar brains99brains99gnustep-gui-0.24.0/Panels/Spanish.lproj/GSToolbarCustomizationPalette.gorm/data.info0000664000076500007650000000027011543227525030420 0ustar brains99brains99GNUstep archive00002f45:00000003:00000003:00000000:01GormFilePrefsManager1NSObject% 01NSString&%Latest Version0±& % Typed Streamgnustep-gui-0.24.0/Panels/Spanish.lproj/GSToolbarCustomizationPalette.gorm/objects.gorm0000664000076500007650000001400711543227525031154 0ustar brains99brains99GNUstep archive00002f45:00000027:00000093:00000000:01GSNibContainer1NSObject01 NSMutableSet1NSSet&01GSWindowTemplate1GSClassSwapper01NSString&%NSPanel1NSPanel1 NSWindow1 NSResponder% @  @  Cù€ C´& % Cè D9€01 NSView% @  @  Cù€ C´  Cù€ C´&01 NSMutableArray1 NSArray&01 GSCustomView1 GSNibItem0±&%GSToolbarCustomizationView ¿€ BÎ Cú CF&0 1 NSPopUpButton1NSButton1 NSControl% B† C¤ Bø A°  Bø A°& 0 ± &%0 1NSPopUpButtonCell1NSMenuItemCell1 NSButtonCell1 NSActionCell1NSCell0 ±&0 1NSFont%&&&&&&&&01NSMenu0±&0± &01 NSMenuItem0±& % Por defecto0±&&&ÿ%01NSImage A0 A01NSColor0±&%NSCalibratedWhiteColorSpace 0± &01NSBitmapImageRep1 NSImageRep0±&%NSDeviceRGBColorSpace A0 A%% %01NSData&  II*z€ P8$ „B`ïød6º¢Q™HªR ÐèԙţØ$IÕ’@£ìÉ ]þ”L¥%óDLÿ•Î$™ä‚Dÿ? Ô Ö ?¤K©1Š]‡A¡Ê`S •BW«Vhµ R±E­SìX þÿ rR’%0±0±& % Icono & Texto° &&ÿ%’%0±0±& % Solo Icono° &&ÿ%’%0±0 ±& % Solo Texto° &&ÿ%’%&&&&&&%’0!±&°!&&& &&°°°%%%%%0"1 NSTextField% A C¥ BP A  BP A& 0#± &%0$1!NSTextFieldCell0%±&%Mostrar:0&±% A@°%&&&&&&&& &&&&&&%’0'±0(±&%NSNamedColorSpace0)±&%System0*±&%textBackgroundColor0+±°(°)0,±& % textColor’0-±0.±& % NSScrollView ¿€ BD Cú BD&00/±% CD C¦ C A€  C A€& 00± &%01±02±&%Mostrar en pequeño03± A€ A€°04± &05±° A€ A€%%%06±&((II*–€ P8$ „BaP¸d6ˆDbQ83Ò,ÿ‹=#xÌn5G$Qø¼R;ˆ(%Oóµÿ“Ê!Ò¥²]0’Ì¡³I±‚_˜Î¡sÉlúq¡C(“zæ“ ¥Ñ©´Š}BWEŸÃ¨5X5F³ ­× •éL®yg³Zf¶‹]©ÿd‰Ö.Rëœúë=¼]ìW¸Œ þÿ ŽR° 07±&%Display in Small Size&&&&&&&&&&&&&&%’08±&09±&0:± A€ A€°0;± &0<±° A€ A€%%%0=±&ˆˆII*ö€ P8$ „Ba@„5ÿ X?áq8¤M¯™£OðÌvŠÈd1äxa'ÅÚñ(;Ò\ÿ—=&ùŒÎe5œM%òHèeÿ'Jc9¬Š'<“J%RÈ­¥ƒêOðõV…+6Öi‘JtIK„P$³é"‚Ìÿ0ZktI|4f±¿Å·:¼f7=»\ –e¢Õ"®Ám÷⪵Àï—ã&‚R¶?„bí8ܶ…eqÐ\ÕþCƒÉ,RHž—9§ÏSäZífÏ‹Üm÷WÝÎóvÿÚl€¼g‰Çµr1¼®/ ÏŠ@@ þÿ€íR&&& &&0>± % A C™ C’€ A  C’€ A& 0?± &%0@±!0A±&*%*Arrastrar los iconos dentro de la barra...0B±% A@°A&&&&&&&& &&&&&&%’°'°+’0C±% CЀ A  B AÀ  B AÀ&!0D± &%0E±0F±&%Guardar° 0G±&%Done&&&&&&&&&&&&&&%’0H±&0I±&&&& &&0J±% CÌ€ C£ B  AÀ  B  AÀ& 0K± &%0L±0M±& % Restaurar° 0N±&%Reset&&&&&&&&&&&&&&%’0O±&0P±&&&& &&0Q±°(0R±&%System0S±&%windowBackgroundColor0T±&%Window0U±&"%"Personalizar Barra de Herramientas°U ?€ ?€ F@ F@%&   D€ D@0V± &0W± &0X1"NSMutableDictionary1# NSDictionary&0Y±&%GormCustomView1°-0Z±&%NSOwner0[±&%GSToolbarCustomizationPalette0\±& % Button(1)°J0]±& % TextField°"0^±& % MenuItem(0)°0_±&%View°0`±&%GormNSPopUpButton° 0a±&%Button°/0b±&%GormCustomView°0c±& % Button(0)°C0d±& % MenuItem1°0e±& % GormNSPanel°0f±& % TextField(0)°>0g±& % MenuItem2°0h±&%MenuItem°0i± &0j1$NSNibConnector°e0k±&%NSOwner0l±$°_°e0m±$°b°_0n±$°`°_0o±$°h0p±$°d0q±$°g0r±$°]°_0s±$°Y°_0t±$°a°_0u1%NSNibOutletConnector°k°b0v1&NSMutableString&%_customizationView0w±%°k°e0x±&&%_customizationWindow0y±%°k°a0z±&& % _sizeCheckBox0{±%°k°`0|±&& % _displayPopup0}±%°k°Y0~±&&%_defaultTemplateView0±$°^0€1'NSNibControlConnector°`°k0±&&%show:0‚±$°f°_0ƒ±$°c°_0„±$°\°_0…±'°c°e0†±&& % performClose:0‡±'°\°k0ˆ±&%reset:0‰±'°a°k0б&%size:0‹±%°k°c0Œ±&& % _doneButton0±"&gnustep-gui-0.24.0/Panels/Spanish.lproj/GSToolbarCustomizationPalette.gorm/data.classes0000664000076500007650000000105511543227525031124 0ustar brains99brains99{ "## Comment" = "Do NOT change this file, Gorm maintains it"; FirstResponder = { Actions = ( "size:", "reset:", "show:" ); Super = NSObject; }; GSToolbarCustomizationPalette = { Actions = ( "show:", "reset:", "size:" ); Outlets = ( "_customizationWindow", "_customizationView", "_defaultTemplateView", "_sizeCheckBox", "_displayPopup", "_doneButton" ); Super = NSObject; }; GSToolbarCustomizationView = { Actions = ( ); Outlets = ( ); Super = NSView; }; }gnustep-gui-0.24.0/Panels/Spanish.lproj/GSSpellPanel.gorm/0000775000076500007650000000000012256227330023154 5ustar brains99brains99gnustep-gui-0.24.0/Panels/Spanish.lproj/GSSpellPanel.gorm/data.info0000664000076500007650000000027011317031403024730 0ustar brains99brains99GNUstep archive00002e7f:00000003:00000003:00000000:01GormFilePrefsManager1NSObject% 01NSString&%Latest Version0±& % Typed Streamgnustep-gui-0.24.0/Panels/Spanish.lproj/GSSpellPanel.gorm/objects.gorm0000664000076500007650000001722511337627420025505 0ustar brains99brains99GNUstep archive00002e7f:0000002d:000000b8:0000000c:01GSNibContainer1NSObject01 GSMutableSet1 NSMutableSet1NSSet&01GSWindowTemplate1GSClassSwapper01NSString&%NSPanel1 NSPanel1 NSWindow1 NSResponder% @  @  C: C˜& % D€ D@01 NSView% @  @  C: C˜  C: C˜&01 NSMutableArray1NSArray&01NSBox% A CQ C& Bª  C& Bª& 0± &0 ± % @à @à C Bl  C Bl&0 ± &0 1 NSPopUpButton1NSButton1 NSControl% A Að C A¸  C A¸&0 ± &%0 1NSPopUpButtonCell1NSMenuItemCell1 NSButtonCell1 NSActionCell1NSCell0±&01NSFont% A@&&&&&&&&01NSMenu0±&0± &01 NSMenuItem0±&%English0±&&&ÿ%01NSImage A0 A01NSColor0±&%NSCalibratedWhiteColorSpace 0± &01NSBitmapImageRep1 NSImageRep0±&%NSDeviceRGBColorSpace A0 A%% %01NSData&  II*z€ P8$ „B`ïød6º¢Q™HªR ÐèԙţØ$IÕ’@£ìÉ ]þ”L¥%óDLÿ•Î$™ä‚Dÿ? Ô Ö ?¤K©1Š]‡A¡Ê`S •BW«Vhµ R±E­SìX þÿ rR’%&&&&&&%2 _switchDictionary:@12@0:4@80±&0±&&&& &&°°°%%%%%0±% A ?€ B€ AÀ  B€ AÀ&0 ±% Bž ?€ B| AÀ  B| AÀ&0!±% A B$ B” AÐ  B” AÐ&0"±% BÌ B$ B” AÐ  B” AÐ&0#±% A A  B” AÐ  B” AÐ&0$±% BÌ A  B” AÐ  B” AÐ&°#0%± &%0&±0'±&%Corregir0(±%&&&&&&&&&&&&&&%2 _correct:@12@0:4@80)±&% 0*±&&&& &&°"0+± &%0,±0-±& % Siguiente°(&&&&&&&&&&&&&&%2 _findNext:@12@0:4@80.±&0/±&&&& &&°!00± &%01±02±&%Adivinar°(&&&&&&&&&&&&&&%2 _guess:@12@0:4@803±&04±&&&& &&° 05± &%06±07±&%Ignorar°&&&&&&&&&&&&&&%2 _ignore:@12@0:4@808±&09±&&&& &&°0:± &%0;±0<±&%Olvidar°&&&&&&&&&&&&&&%2 _forget:@12@0:4@80=±&0>±&&&& &&0?± &%0@±0A±&%Guardar°&&&&&&&&&&&&&&%2 _learn:@12@0:4@80B±&0C±&&&& &&° 0D1 NSTextFieldCell0E±& % Diccionario°°E&&&&&&&& &&&&&&%’0F±0G±&%NSNamedColorSpace0H±&%System0I±&%windowBackgroundColor0J±°G0K±&%System0L±& % textColor @  @ %%0M1! NSBrowser% A B¾ C& BÒ  C& BÒ&0N± &0O1" NSScrollView% @ C& Bœ  C& Bœ&0P± &0Q1# NSClipView% A¨ @ C B”  C B”&0R± &0S1$NSMatrix%  C BÈ  C BÈ&0T± &%0U±0V±&°(&&&&&&&&&&&&&&%’% C BÈ 0W±°G°H0X±&%controlBackgroundColor°W0Y±& % NSBrowserCell0Z1% NSBrowserCell0[±&°&&&&&&&&&&&&&&%%0\± &°M2doClick:2 doDoubleClick:’°W0]1& NSScroller% @ @ A B”  A B”&0^± &%0_±°[°&&&&&&&&&&&&&&&°O2 _doScroll:v12@0:4@8°Q% A A A A °]%0`±%°[°&&&&&&&&&&&&&&°Z0a±&%NSMatrix0b±&%/% BÈ0c±&% @ ?€ C" A  C" A&0d± &%0e±°[°&&&&&&&&&&&&&&&°M2  scrollViaScroller:v12@0:4@8   C& Bœ’2  _highlightGuess:@12@0:4@80f± &0g1'NSBrowserColumn°O°S%°b%%°!°"°#°$0h1( NSTextField% A B C& A¨  C& A¨&0i± &%0j± 0k±&°(&&&&&&&& &&&&&&%’0l±°G°K0m±&%textBackgroundColor°J’°F0n±&%Window0o±& % Ortografía°o ?€ A¨ F@ F@%0p±0q±&%NSApplicationIcon&   D€ D@0r± &0s± &0t1)NSMutableDictionary1* NSDictionary& 0u±&%Button2°!0v±&%Button3°"0w±&%Button4°#0x±& % GormNSBrowser°M0y±&%NSOwner0z±&%NSSpellChecker0{±&%Button5°$0|±& % TextField°h0}±&%GormNSPopUpButton° 0~±&%Button°0±& % GormNSPanel°0€±&%Box°0±&%MenuItem°0‚±&%Button1° 0ƒ± &0„1+NSNibConnector°0…±&%NSOwner0†±+°€0‡±+°}0ˆ±+°~0‰±+°‚0б+°x0‹±+°u0Œ±+°v°…0±+°w°…0ޱ+°{°…0±+°01,NSNibOutletConnector°…°~0‘±& % _learnButton0’1-NSNibControlConnector°‚°…0“±&%_forget:0”±-°u°…0•±&%_ignore:0–±-°v°…0—±&%_guess:0˜±-°w°…0™±& % _findNext:0š±-°{°…0›±& % _correct:0œ±-°}°…0±&%_switchDictionary:0ž±-°x°…0Ÿ±&%_highlightGuess:0 ±-°~°…0¡±&%_learn:0¢±,°…°w0£±&%_findNextButton0¤±,°…°v0¥±& % _guessButton0¦±,°…°u0§±& % _ignoreButton0¨±,°…°‚0©±& % _forgetButton0ª±+°|0«±,°…°|0¬±& % _wordField0­±,°…°x0®±&%_accessoryView0¯±,°…°}0°±&%_dictionaryPulldown0±±,°…°0²±& % _spellPanel0³±)&gnustep-gui-0.24.0/Panels/Spanish.lproj/GSSpellPanel.gorm/data.classes0000664000076500007650000000136211317031403025435 0ustar brains99brains99{ "## Comment" = "Do NOT change this file, Gorm maintains it"; FirstResponder = { Actions = ( "orderFrontFontPanel:", "_learn:", "_forget:", "_ignore:", "_guess:", "_findNext:", "_correct:", "_switchDictionary:", "_highlightGuess:" ); Super = NSObject; }; NSSpellChecker = { Actions = ( "_learn:", "_forget:", "_ignore:", "_guess:", "_findNext:", "_correct:", "_switchDictionary:", "_highlightGuess:" ); Outlets = ( _serverProxy, _wordField, _accessoryView, _dictionaryPulldown, _spellPanel, _learnButton, _forgetButton, _ignoreButton, _guessButton, _findNextButton ); Super = NSObject; }; }gnustep-gui-0.24.0/Panels/Spanish.lproj/GSFindPanel.gorm/0000775000076500007650000000000012256227330022755 5ustar brains99brains99gnustep-gui-0.24.0/Panels/Spanish.lproj/GSFindPanel.gorm/data.info0000664000076500007650000000027011441342216024536 0ustar brains99brains99GNUstep archive00002f45:00000003:00000003:00000000:01GormFilePrefsManager1NSObject% 01NSString&%Latest Version0±& % Typed Streamgnustep-gui-0.24.0/Panels/Spanish.lproj/GSFindPanel.gorm/objects.gorm0000664000076500007650000001671311543227525025310 0ustar brains99brains99GNUstep archive00002f45:0000001f:000000c6:00000000:01GSNibContainer1NSObject01 NSMutableSet1NSSet&01GSWindowTemplate1GSClassSwapper01NSString&%NSPanel1NSPanel1 NSWindow1 NSResponder% @  @  Câ CA&% Bð D)@01 NSView% @  @  Câ CA  Câ CA&01 NSMutableArray1 NSArray&  01NSButton1 NSControl% A B C AÀ  C AÀ&0± &%0 1 NSButtonCell1 NSActionCell1NSCell0 ±&%Reemplazar Todo0 1NSFont%&&&&&&&&&&&&&&%’0 ±&0 ±&&&& &&0±% C B B AÀ  B AÀ&0± &%0±0±& % Reemplazar° &&&&&&&&&&&&&&%’0±&0±&&&& &&0±% C€€ B C9 AÀ  C9 AÀ&0± &%0±0±&%Reemplazar & Buscar° &&&&&&&&&&&&&&%’0±&0±&&&& &&0±% C€€ A  B´ AÀ  B´ AÀ&0± &%0±0±&%Previo° &&&&&&&&&&&&&&%’0±&0±&&&& &&0 ±% C° A  B´ AÀ  B´ AÀ&0!± &%0"±0#±& % Siguiente0$1NSImage0%±& % common_ret° &&&&&&&&&&&&&&%’0&±&% 0'±&0(±0)±& % common_retH&&& &&0*1 NSTextField% ?€ C# Bà A  Bà A&0+± &%0,1NSTextFieldCell0-±&%Buscar:0.±% A@°-&&&&&&&& &&&&&&%’0/1NSColor00±&%NSNamedColorSpace01±&%System02±&%textBackgroundColor03±°0°104±& % textColor’05±% ?€ C  Bà A  Bà A&06± &%07±08±&%Reemplazar con:°.°8&&&&&&&& &&&&&&%’°/°3’09±% Bì C" C¢ A¨  C¢ A¨&0:± &%0;±0<±&° °<&&&&&&&& &&&&&&%’°/°3’0=±% Bì C C¢ A¨  C¢ A¨&0>± &%0?±0@±&° °@&&&&&&&& &&&&&&%’°/°3’0A±% A Bˆ BÈ BX  BÈ BX&0B± &%0C±0D±&%%%Área de mensajes (contenido dinámico)°.°D&&&&&&&& &&&&&&%’°/°3’0E1NSBox% Bì Bˆ C B|  C B|&0F± &0G± % @à @à C B  C B&0H± &0I1NSMatrix% A  Bô B  Bô B&0J± &%0K±0L±&° &&&&&&&&&&&&&&%’% Bô A ?€ ?€0M±& % NSButtonCell0N±0O±&%Radio0P±0Q1NSMutableString&%common_RadioOff&&&&&&&&&&&&&&%’0R±&0S±0T±&%common_RadioOn&&& &&%%0U± &0V±0W±&%Archivo Entero°P&&&&&&&&&&&&&&%’0X±&°S&&& &&0Y±0Z±& % Selección°P&&&&&&&&&&&&&&%’0[±&°S&&& &&’’’°V0\±0]±&%Ámbito de Reemplazo° °]&&&&&&&&&&&&&& @  @ %%0^±% CŠ€ Bˆ C% B|  C% B|&0_± &0`± % @à @à C B  C B&0a± &0b±% AP C A€  C A€&0c± &%0d±0e±&%Ignorar Mayúsculas0f±0g±&%common_SwitchOff° &&&&&&&&&&&&&&%’0h±&0i±&0j±0k±&%common_SwitchOn&&& &&0l±0m±&%Opciones de Búsqueda° °m&&&&&&&&&&&&&& @  @ %%0n±°00o±&%System0p±&%windowBackgroundColor0q±&%Window0r±&%Buscar°r @@ B F@ F@%&   D€ D@0s± &0t± &0u1NSMutableDictionary1 NSDictionary&0v±& % Button(4)° 0w±& % TextField(0)°*0x±& % FindPanel°0y±&%NSOwner0z±& % GSTextFinder0{±&%View(1)°G0|±& % TextField(2)°90}±& % ButtonCell(1)°Y0~±& % TextField(4)°A0±& % Button(1)°0€±&%Box(0)°E0±& % Button(3)°0‚±&%View(0)°0ƒ±& % Button(5)°b0„±& % TextField(1)°50…±&%View(2)°`0†±& % Matrix(0)°I0‡±& % TextField(3)°=0ˆ±& % Button(0)°0‰±& % ButtonCell(0)°V0б& % Button(2)°0‹±&%Box(1)°^0Œ± &))01NSNibConnector°x0ޱ&%NSOwner0±°‚°x0±°ˆ°‚0‘±°°‚0’±°Š°‚0“±°°‚0”±°v°‚0•±°w°‚0–±°„°‚0—±°|°‚0˜±°‡°‚0™±°~°‚0š±°†°€0›±°‰°†0œ±°}°†0±°€°‚0ž±°{°€0Ÿ±°ƒ°‹0 ±°‹°‚0¡±°…°‹0¢1NSNibOutletConnector°Ž°|0£±&%findText0¤±°Ž°‡0¥±& % replaceText0¦±°Ž°~0§±& % messageText0¨±°Ž°†0©±&%replaceScopeMatrix0ª±°Ž°ƒ0«±&%ignoreCaseButton0¬±°x°|0­±&%initialFirstResponder0®±°|°‡0¯±& % nextKeyView0°±°‡°†°¯0±±°†°ƒ°¯0²±°ˆ°°¯0³±°°Š°¯0´±°Š°°¯0µ±°°v°¯0¶±°v°|°¯0·±°Ž°x0¸±&%panel0¹±°ƒ°ˆ°¯0º1NSNibControlConnector°ˆ°Ž0»±& % replaceAll:0¼±°v°Ž0½±& % findNext:0¾±°°Ž0¿±& % findPrevious:0À±°Š°Ž0Á±&%replaceAndFind:0±°°Ž0ñ&%replace:0ı&gnustep-gui-0.24.0/Panels/Spanish.lproj/GSFindPanel.gorm/data.classes0000664000076500007650000000101511441342216025236 0ustar brains99brains99{ "## Comment" = "Do NOT change this file, Gorm maintains it"; FirstResponder = { Actions = ( "findNext:", "findPrevious:", "replace:", "replaceAll:", "replaceAndFind:" ); Super = NSObject; }; GSTextFinder = { Actions = ( "replaceAll:", "findNext:", "findPrevious:", "replace:", "replaceAndFind:" ); Outlets = ( findText, ignoreCaseButton, messageText, panel, replaceScopeMatrix, replaceText ); Super = NSObject; }; }gnustep-gui-0.24.0/Panels/Spanish.lproj/GSPageLayout.gorm/0000775000076500007650000000000012256227330023167 5ustar brains99brains99gnustep-gui-0.24.0/Panels/Spanish.lproj/GSPageLayout.gorm/data.info0000664000076500007650000000027012226664452024763 0ustar brains99brains99GNUstep archive000f4240:00000003:00000003:00000000:01GormFilePrefsManager1NSObject%01NSString&%Latest Version0±& % Typed Streamgnustep-gui-0.24.0/Panels/Spanish.lproj/GSPageLayout.gorm/objects.gorm0000664000076500007650000010237712226664452025527 0ustar brains99brains99GNUstep archive000f4240:00000035:000002de:00000001:01GSNibContainer1NSObject01 NSMutableSet1NSSet&01GSWindowTemplate1GSClassSwapper01NSString& % NSPageLayout1NSPanel1 NSWindow1 NSResponder% ?ð @" @s° @ƒhJI @wp @‡001 NSView% ?ð @" @s° @ƒh  @s° @ƒhJ01 NSMutableArray1 NSArray&01 NSTabView% @& @C€ @rP @@  @rP @@J0± &0 ± % ?ð @2 @r @~  @r @~J0 1 NSScrollView% @$ @$ @pð @|Ð  @pð @|ÐJ0 1GSTableCornerView% @ @ @3 @6  @3 @6J0 1 NSClipView% @5 @ @o @6  @o @6J0 1NSTableHeaderView%  @o @6  @o @6J01 NSScroller1 NSControl% @ @8 @2 @{0  @2 @{0J0±% @5 @8 @o @z  @o @zJ01 NSTableView%  @o @z  @o @zJ0±% @5 @{ @o @2  @o @2J° °0± &%01NSCell0±&01NSFont%&&&&&&JJ&&&&&&J° 2 _doScroll:v24@0:8@16°0± &%0±0±&°&&&&&&JJ&&&&&&0± &01 NSTableColumn0±&%column1 BP A  GÃP01NSTableHeaderCell1NSTextFieldCell1 NSActionCell0±&%Atributo0±% °&&&&&&JJ &&&&&&I’01NSColor0 ±&% NSNamedColorSpace0!±&% System0"±&% controlShadowColor0#±° °!0$±&% windowFrameTextColor0%±0&±&%neuf°°&&&&&&&JJ &&&&&&I’0'±° 0(±&%System0)±&%textBackgroundColor0*±° °(0+±& % textColor0,±0-±&%column2 CD A  GÃP0.±0/±&%Valor°°/&&&&&&JJ &&&&&&I’°°#00±01±&%nine°°1&&&&&&JJ &&&&&&I’°'°*02±° °!03±& %  gridColor04±° °!05±&% controlBackgroundColor° ° %% A€’ @ @06± &°07± &°°4° 08± &%09±°°&&&&&&JJ&&&&&&J° ²° 0:± &° 0;± &° 0<±° °!0=±& %  controlColor° 0>± &° 0?± &°°° °° °I A A A A °°° °0@± &° 0A± &0B1 NSTabViewItem0C±& % attributes0D±& % Atributos0E± % ?ð @2 @r @~  @r @~J0F1NSBox% @& @z€ @pà @H  @pà @HJ0G± % @ @ @p @5  @p @5J0H1 NSPopUpButton1 NSButton%  @p @4  @p @4J0I±% @& @u  @pà @R@  @pà @R@J0J± % @ @ @p @G  @p @GJ0K±% @U@ @9 @e` @4  @e` @4J0L1!NSMatrix%  @U@ @F€  @U@ @F€J0M±% @U@  @e` @4  @e` @4J0N±% @$ @n` @pà @X€  @pà @X€J0O± % @ @ @p @QÀ  @p @QÀJ0P±!%  @p @Q€  @p @Q€J0Q1" NSTextField% @$ @k€ @pà @2  @pà @2J0R±% @$ @O€ @pà @c   @pà @c J0S± % @ @ @p @`@  @p @`@J0T1# GSCustomView1$ GSNibItem0U±&%GSPageLayoutMiniPageView @O€  @` @` &°R0V± &°T°Q0W± &°S0X±0Y±& % Vista Previa°°Y&&&&&&JJ&&&&&& @ @%%°P0Z± &%0[±0\±& % Dimensiones0]±% A@°\&&&&&&JJ &&&&&&I’°'°*’°O0^± &%0_±0`±&°&&&&&&JJ&&&&&&I’% @` @Q€ °4°40a±& % NSButtonCell0b1% NSButtonCell0c±&%Button°&&&&&&JJ&&&&&&I’0d±&0e±&&&& &&%%0f± &0g±%0h±&%Vertical0i1&NSImage0j±& % page_portrait°]&&&&&&JJ&&&&&&I’0k±&0l±&&&& &&0m±%0n±& % Horizontal0o±&0p±&%page_landscape°]&&&&&&JJ&&&&&&I’0q±&0r±&&&& &&’’’°m°N0s± &°P°M0t± &°O0u±0v±&%Orientación del papel°°v&&&&&&JJ&&&&&& @ @%%°L0w± &%0x1'NSPopUpButtonCell1(NSMenuItemCell0y±&°&&&&&&JJ0z1)NSMenu0{±&0|± &0}1* NSMenuItem0~±&0±&JJÿI0€±& @& @ 0±0‚±&% NSCalibratedWhiteColorSpace 0ƒ± &0„1+NSBitmapImageRep1, NSImageRep0…±&% NSDeviceRGBColorSpace @& @ II I0†1-NSData&  II*z€ P8$ „B`ïød6º¢Q™HªR ÐèԙţØ$IÕ’@£ìÉ ]þ”L¥%óDLÿ•Î$™ä‚Dÿ? Ô Ö ?¤K©1Š]‡A¡Ê`S •BW«Vhµ R±E­SìX þÿ rR’I0‡±*0ˆ±&°JJÿI’I0‰±*0б&°JJÿI’I&&&&&&I’0‹±&0Œ±&&&& &&°}°z%%%%%°K0± &%0ޱ0±&°&&&&&&JJ&&&&&&I’% @U@ @4 @°4°40±& % NSButtonCell0‘±%0’±&%Radio0“±&0”1.NSMutableString&%GSRadio°&&&&&&JJ&&&&&&I’0•±&0–±&0—±&0˜±.&%GSRadioSelected&&& &&%%0™± &0š±%0›±& % Estandar:°“°&&&&&&JJ&&&&&&I’0œ±&0±&°—&&& &&0ž±%0Ÿ±&%Crear:°“°&&&&&&JJ&&&&&&I’0 ±&0¡±&°—&&& &&’’’°š°J0¢± &%0£±'0¤±&°&&&&&&JJ0¥±)0¦±&0§± &0¨±*0©±&%Item 10ª±&JJÿI°€’I0«±*0¬±&%Item 2°ªJJÿI’I0­±*0®±&%Item 3°ªJJÿI’I&&&&&&I’0¯±&0°±&&&& &&°¨°¥%%%%%°I0±± &°K°L°M°H0²± &°J0³±0´±&%Tamaño del Papel°°´&&&&&&JJ&&&&&& @ @%%°G0µ± &%0¶±'0·±&°&&&&&&JJ0¸±)0¹±&0º± &0»±*0¼±&%Item 10½±&JJÿI°€’I0¾±*0¿±&%Item 2°½JJÿI’I0À±*0Á±&%Item 3°½JJÿI’I&&&&&&I’0±&0ñ&&&& &&°»°¸%%%%%°F0ı &°H°E0ű &°G0Ʊ0DZ& % Impresora°°Ç&&&&&&JJ&&&&&& @ @%%0ȱ &0ɱ% @$ @$ @pà @H  @pà @HJ0ʱ % @ @ @p @5  @p @5J0˱"% @Y@  @I @5  @I @5J0̱"% @bà  @. @5  @. @5J°E°Ë0ͱ &%0α0ϱ&%%0б% A`&&&&&&JJ &&&&&&I’°'°*’°Ê0ѱ &% 0Ò±0Ó±&°&&&&&&JJ &&&&&&I’°'°*’°É0Ô± &°Ë°Ì°T0Õ± &°Ê0Ö±0×±&%Escala°°×&&&&&&JJ&&&&&& @ @%%°Q°R°I°N°F%°E°0ر0Ù±&%custom0Ú±&%Tamaño0Û± % ?ð @2 @r @~  @r @~J0ܱ% @$ @tÀ @pà @a`  @pà @a`J0ݱ % @ @ @p @\  @p @\J0Þ±%  @g @[À  @g @[ÀJ0ß±% @ @ @3 @6  @3 @6J0à±% @5 @ @d @6  @d @6J0á±%  @d @6  @d @6J0â±% @ @8 @2 @U@  @2 @U@J0ã±% @5 @8 @d @P€  @d @P€J0ä±%  @d @d   @d @d J0å±% @5 @VÀ @d @2  @d @2J0æ± % @g  @UÀ @PÀ @8  @PÀ @8J0ç± % @g  @M @PÀ @8  @PÀ @8J0è± % @g  @= @PÀ @8  @PÀ @8J0é± % @g   @PÀ @8  @PÀ @8J0ê±% @$ @q` @pà @H  @pà @HJ0ë± % @ @ @p @5  @p @5J0ì±"%  @I @5  @I @5J0í±"% @K€  @D @5  @D @5J0î±"% @WÀ  @4 @5  @4 @5J0ï±"% @a  @I @5  @I @5J0ð±"% @gà  @D @5  @D @5J0ñ±"% @là  @4 @5  @4 @5J0ò±% @$ @hà @pà @R€  @pà @R€J0ó± % @ @ @p @G€  @p @G€J0ô±"% @: @I @5  @I @5J0õ±"% @K€ @: @D @5  @D @5J0ö±"% @WÀ @: @4 @5  @4 @5J0÷±"% @a @: @I @5  @I @5J0ø±"% @gà @: @D @5  @D @5J0ù±"% @là @: @4 @5  @4 @5J0ú±"%  @I @5  @I @5J0û±"% @K€  @D @5  @D @5J0ü±"% @WÀ  @4 @5  @4 @5J0ý±"% @`  @L€ @5  @L€ @5J0þ±"% @gà  @D @5  @D @5J0ÿ±"% @là  @4 @5  @4 @5JP±% @$ @  @pà @g@  @pà @g@JP± % @ @ @p @cà  @p @càJP±#P±&%GSPageLayoutMiniPageView @G  @cà @cà&ÐP± &аÿP± &ÐP±P±& % Vista previa°Ð&&&&&&JJ&&&&&& @ @%%°þP± &%iP ±P ±&%un°]&&&&&&JJ &&&&&&I’°'°*’°ýP ± &%P ±P ±&°&&&&&&JJ &&&&&&I’°'°*’°üP± &%P±P±&%Derecha:°]Ð&&&&&&JJ &&&&&&I’°'°*’°ûP± &%hP±P±&%un°]&&&&&&JJ &&&&&&I’°'°*’°úP± &%P±P±&°&&&&&&JJ &&&&&&I’°'°*’°ùP± &%P±P±&%Izq:°]Ð&&&&&&JJ &&&&&&I’°'°*’°øP± &%gP±P±&%un°]&&&&&&JJ &&&&&&I’°'°*’°÷P± &%P±P±&°&&&&&&JJ &&&&&&I’°'°*’°öP ± &%P!±P"±&%Abajo:°]Ð"&&&&&&JJ &&&&&&I’°'°*’°õP#± &%fP$±P%±&%un°]&&&&&&JJ &&&&&&I’°'°*’°ôP&± &%P'±P(±&°&&&&&&JJ &&&&&&I’°'°*’°óP)± &%P*±P+±&%Arriba:°]Ð+&&&&&&JJ &&&&&&I’°'°*’°òP,± &  °÷°ô°ú°ý°õ°ö°ø°ù°û°ü°þ°ÿ°ñP-± &°óP.±P/±&%Margenes de Impresión°Ð/&&&&&&JJ&&&&&& @ @%%°ðP0± &%eP1±P2±&%un°]&&&&&&JJ &&&&&&I’°'°*’°ïP3± &%P4±P5±&°&&&&&&JJ &&&&&&I’°'°*’°îP6± &%P7±P8±&%Alto:°]Ð8&&&&&&JJ &&&&&&I’°'°*’°íP9± &%dP:±P;±&%un°]&&&&&&JJ &&&&&&I’°'°*’°ìP<± &%P=±P>±&°&&&&&&JJ &&&&&&I’°'°*’°ëP?± &%P@±PA±&%Ancho:°]ÐA&&&&&&JJ &&&&&&I’°'°*’°êPB± &°ï°ì°ð°í°ñ°î°éPC± &°ëPD±PE±&%Tamaño del papel°ÐE&&&&&&JJ&&&&&& @ @%%°èPF± &%ËPG±%PH±&%Guardar°&&&&&&JJ&&&&&&I’PI±&PJ±&&&& &&°çPK± &%ÊPL±%PM±&%Borrar°&&&&&&JJ&&&&&&I’PN±&PO±&&&& &&°æPP± &%ÉPQ±%PR±&%Duplicar°&&&&&&JJ&&&&&&I’PS±&PT±&&&& &&°åPU± &%ÈPV±%PW±&%Nuevo°&&&&&&JJ&&&&&&I’PX±&PY±&&&& &&°äPZ± &%P[±P\±&°&&&&&&JJ&&&&&&J°Þ²°ãP]± &%P^±P_±&°&&&&&&JJ&&&&&&P`± &Pa±Pb±&%column1 C! C! C!Pc±Pd±&% Nombre del Papel°Ðd&&&&&&JJ &&&&&&I’°°#Pe±Pf±&%quatre°Ðf&&&&&&JJ &&&&&&I’°'°*°2Pg±°‚ ?€ ?€°á°ß%% A€’ @ @Ph± &°âPi± &°äPj±°‚ ?€ ?€°áPk± &%Pl±Ð_°&&&&&&JJ&&&&&&J°Þ²°àPm± &°ßPn± &°á°<°ÞPo± &°ÝPp± &°ã°â°à°å°ß°ãI A A A A °å°â°à°ÜPq± &°Þ°æ°ç°è°é°ÛPr± &°ÝPs±Pt±& % Por nombre°Ðt&&&&&&JJ&&&&&& @ @%%Pu± &°ê°òаÜ%°Û°Pv±Pw±&%summaryPx±&%Resumen° %° °°%JPy1/ NSImageView% @$ @8 @J @J  @J @JJPz± &%P{10 NSImageCellP|±&P}±&% NSApplicationIcon°&&&&&&JJ&&&&&&%%% @H @H’P~±"% @PÀ @8 @i @J  @i @JJP± &%P€±P±&%Diseño de páginaP‚±% AÐ&&&&&&JJ &&&&&&I’°'°*’Pƒ±% ÀqÐ @ @‚À @  @‚À @JP„± &P…± % @ @ @‚P   @‚P JP†± &P‡±Pˆ±&%Box°&&&&&&JJ &&&&&&I’P‰±° °!Pб&% windowBackgroundColor°* @ @%%P‹± % @lÀ @$ @RÀ @8  @RÀ @8JPŒ± &% P±%Pޱ&%AceptarP±&P±& %  common_ret°&&&&&&JJ&&&&&&I’P‘±&% P’±&&&& &&P“± % @bÀ @$ @RÀ @8  @RÀ @8JP”± &%P•±%P–±&%Cancelar°&&&&&&JJ&&&&&&I’P—±&P˜±&&&& &&ЉP™±&%WindowPš±&К @sÐ @ƒØ @È @ÈIÐ|&  @” @‰P›± &Pœ± &P11NSMutableDictionary12 NSDictionary&QPž±&%Box9°NPŸ±&%View2Ð…P ±& % TextField10°ËP¡±& % TableColumn1P¢±P£±&%column2 BÚ A  GÃPP¤±P¥±&% °&&&&&&JJ &&&&&&I’°<°#P¦±P§±&%five°Ð§&&&&&&JJ &&&&&&I’°'°*P¨±& % TextField26°ûP©±& % MenuItem3Pª±*P«±&%Item 1P¬±&JJÿI°€’IP­±&%GormNSPopUpButton3°KP®±& % TextField7Ð~P¯±& % MenuItem11P°±*P±±& % CentimetersP²±&JJÿI’IP³±&%Button7ГP´±&%MenuItemPµ±*P¶±&%EmptyP·±&JJÿI°€’IP¸±& % TextField13°ìP¹±&%View(0)°ÝPº±& % TableColumn4P»±P¼±&%actions C A  GÃPP½±P¾±&% °&&&&&&JJ &&&&&&I’°<°#P¿±PÀ±&%0°ÐÀ&&&&&&JJ &&&&&&I’°'°*PÁ±& % TextField29°ÿP±& % MenuItem6Pñ*Pı& % 2 per pagePű&JJÿI’IPƱ& % TextField21°ýPDZ& % MenuItem14°}Pȱ& % TextField16°ñPɱ&%Button2°æPʱ&%Box7°IP˱& % MenuItem9P̱*Pͱ&%PointsвJJÿI°€’IPα&%TabView°Pϱ& % TextField24°øPб& % MenuItem1Pѱ*PÒ±&%Item 2PÓ±&JJÿI’IPÔ±&%Matrix2°LPÕ±& % ScrollView1° PÖ±& % TextField19°ôP×±&%Button5°éPر&%GormCustomView2ÐPÙ±& % TextField11°ÌPÚ±&%View3PÛ± % @ @ @\ @;  @\ @;JPܱ &Pݱ& % TextField27°üPÞ±&%Box2ЃPß±& % TableColumn2Pà±Pá±&%classes BP A  GÃPPâ±Pã±&%Item°&&&&&&JJ &&&&&&I’°°#Pä±På±&%NSObject°Ðå&&&&&&JJ &&&&&&I’°'°*Pæ±&%GormNSPopUpButton4°MPç±& % MenuItem4Pè±*Pé±&%Item 2ЬJJÿI’IPê±&%Box°FPë±& % MenuItem12Pì±*Pí±&%InchesPî±&JJÿI’IPï±& % TextField14°ðPð±& % TableColumn5°Pñ±& % ImageView1ÐyPò±& % ScrollView°ÞPó±&%Box5°RPô±& % MenuItem7Põ±*Pö±& % 4 per pageÐÅJJÿI’IP÷±& % TextField22°õPø±&%Box12°êPù±& % MenuItem15°‡Pú±& % TextField17°îPû±&%Button3°çPü±&%Box8ÐPý±&%View1Pþ± % @ @ @\ @;  @\ @;JPÿ± &P±& % TextField25°ùP±&%GormNSPopUpButton°HP±& % MenuItem2P±*P±&%Item 3ÐÓJJÿI’IP±&%GormNSTableView°äP±& % MenuItem10P±*P±& % MillimetersвJJÿI’IP ±&%Button6ЋP ±& % TextField12°ïP ±&%GormNSTableView1°P ±& % TableColumn3P ±P±&%outlets CC A  GÃPP±P±& % Description°&&&&&&JJ &&&&&&I’°°#P±P±&%0°Ð&&&&&&JJ &&&&&&I’°'°*P±& % TextField28°þP±& % MenuItem5P±*P±& % 1 per pageÐÅJJÿI°€’IP±&%Box10°ÉP±& % TextField20°úP±& % TextField9°QP±& % MenuItem13P±*P±&%Item 3ЬJJÿI’IP±&% NSOwnerP±&%GSPageLayoutControllerP±& % TextField15°íP ±& % TableColumn6°,P!±& % MenuItem8P"±*P#±& % 16 per pageP$±&JJÿI’IP%±&%Box(0)°ÜP&±& % TableColumnÐaP'±& % TextField23°öP(±&%Box13°òP)±&%Matrix1°PP*±& % GormNSPanel1°P+±& % MenuItem16°‰P,±&%Button4°èP-±&%GormCustomView1°TP.±& % TextField18°÷P/± &€€P013NSNibConnectorÐýP1±&% NSOwnerP2±3ÐÚÐ1P3±3ÐÐP4±3ÐP5±3дP6±3ÐP7±3ÐÂP8±3ÐôP9±3Ð!P:±3ÐËP;±3ÐP<±3ЯP=±3ÐëP>±3Ð*Ð1P?±3ÐÎP@±3ÐñÐ1PA±3ЮÐ1PB±3ÐÞÐ1PC±3ПÐ1PD±3ЩPE±3ÐçPF±3ÐPG±3ЭPH±3ÐPI±3Ð)Ð1PJ±3РPK±3ÐÙPL±3ÐPM±3ÐòÐ%PN±3ÐÐòPO±3Ð&ÐPP±3СPQ±3ÐÉÐ%PR±3ÐûÐ%PS±3Ð,Ð%PT±3Ð×Ð%PU±3Ð PV±3иPW±3ÐïPX±3ÐPY±3ÐÈPZ±3ÐúP[±3ÐøP\±3Ð.P]±3ÐÖP^±3ÐP_±3ÐÆP`±3Ð÷Pa±3Ð'Pb±3ÐÏPc±3ÐPd±3ШPe±3ÐÝPf±3ÐPg±3ÐÁPh±3Ð(Pi±3Ð-Pj±3ÐóPk±3ÐØPl±3ÐüPm±3ÐßPn±3Ð Po±3кPp±3Ð Ð1Pq±3гÐ1Pr±3ÐÔPs±3ÐæPt±3ÐÊPu±3ОPv±3ÐÕPw±3Ð Px±3ÐðPy±3Ð Pz14NSNibOutletConnectorÐ1Ð*P{±&%panelP|±4Ð1ÐÔP}±.&%paperRadioMatrixP~±4Ð1ЭP±.&%standardPaperSizePopUpP€±4Ð1ÐæP±.&%customPaperSizePopUpP‚±4Ð1Ð)Pƒ±.&%paperOrientationMatrixP„±4Ð1Ð-P…±.&%paperAttributesPreviewP†±4Ð1РP‡±.&%scaleTextFieldPˆ±4Ð1ÐP‰±.&%customPaperTableViewPб4Ð1ÐP‹±.&%customPaperWidthTextFieldPŒ±4Ð1ÐÏP±.& % customPaperMarginBottomTextFieldPޱ4Ð1ÐïP±.&%customPaperHeightTextFieldP±4Ð1Ð÷P‘±.&%customPaperMarginTopTextFieldP’±4Ð1ШP“±.&%customPaperMarginLeftTextFieldP”±4Ð1ÐP•±.&%customPaperMarginRightTextFieldP–±4Ð1ÐØP—±.&%customPaperPreviewP˜±4Ð1Ð P™±.&%summaryTableViewPš±4Ð1ÐÉP›±&%newCustomPaperButtonPœ±4Ð1ÐûP±.&%duplicateCustomPaperButtonPž±4Ð1Ð,PŸ±.&%deleteCustomPaperButtonP ±4Ð1Ð×P¡±.&%saveCustomPaperButtonP¢±4Ð1ÐñP£±&%applicationImageButtonP¤±4Ð1ЮP¥±&%panelTitleFieldP¦±4Ð1ÐP§±.&%dimensionsTextFieldP¨±4ÐÐ1P©±.& % dataSourcePª±4Ð Ð1ЩP«±4Ð1Ð&P¬±&%customPaperNameColumnP­±4Ð1ÐðP®±&%summarySettingColumnP¯±4Ð1Ð P°±&%summaryValueColumnP±15NSNibControlConnectorгÐ1P²±&%cancelButtonClicked:P³±5Ð Ð1P´±&%okButtonClicked:Pµ±5ÐÉÐ1P¶±&%customPaperButtonsClicked:P·±5ÐûÐ1жP¸±5Ð,Ð1жP¹±5Ð×Ð1жPº±5ÐÔÐ1P»±&%paperRadioMatrixClicked:P¼±4РÐ1P½±.&%delegateP¾±4ÐÐ1нP¿±4ÐïÐ1нPÀ±4Ð÷Ð1нPÁ±4ШÐ1нP±3ÐPñ3ÐêPı4Ð1ÐPű& % printerPopUpPƱ5ÐÐ1PDZ&%printerPopUpClicked:Pȱ5ЭÐ1Pɱ&%paperPopUpClicked:Pʱ5ÐæÐ1ÐÉP˱5Ð)Ð1P̱&%paperOrientationMatrixClicked:Pͱ4Ð*Ð1Pα.& % _controllerPϱ4Ð1ÐÎPб&%tabViewPѱ4ÐÎÐ1PÒ±.&%delegatePÓ±3ÐÇPÔ±3ÐùPÕ±3Ð+PÖ±3Ð%P×±3йÐ%Pر1&Ð*°gnustep-gui-0.24.0/Panels/Spanish.lproj/GSPageLayout.gorm/data.classes0000664000076500007650000000356211543227525025471 0ustar brains99brains99{ "## Comment" = "Do NOT change this file, Gorm maintains it"; FirstResponder = { Actions = ( "orderFrontFontPanel:", "_pickedButton:", "pickedOrientation:", "_pickedPaper:", "pickedUnits:", "pickedButton:", "pickedPaperSize:", "okButtonClicked:", "cancelButtonClicked:", "customPaperButtonsClicked:", "paperRadioMatrixClicked:", "printerPopUpClicked:", "paperPopUpClicked:", "paperOrientationMatrixClicked:" ); Super = NSObject; }; GSPageLayoutController = { Actions = ( "okButtonClicked:", "cancelButtonClicked:", "customPaperButtonsClicked:", "paperRadioMatrixClicked:", "printerPopUpClicked:", "paperPopUpClicked:", "paperOrientationMatrixClicked:" ); Outlets = ( panel, paperRadioMatrix, standardPaperSizePopUp, customPaperSizePopUp, dimensionsTextField, paperOrientationMatrix, paperAttributesPreview, scaleTextField, customPaperTableView, customPaperWidthTextField, customPaperHeightTextField, customPaperMarginTopTextField, customPaperMarginBottomTextField, customPaperMarginRightTextField, customPaperMarginLeftTextField, customPaperPreview, summaryTableView, newCustomPaperButton, duplicateCustomPaperButton, deleteCustomPaperButton, saveCustomPaperButton, applicationImageButton, panelTitleField, customPaperNameColumn, summarySettingColumn, summaryValueColumn, printerPopUp, tabView ); Super = NSObject; }; GSPageLayoutMiniPageView = { Actions = ( ); Outlets = ( "_pageLayoutController" ); Super = NSView; }; NSPageLayout = { Actions = ( "pickedButton:", "pickedOrientation:", "pickedPaperSize:", "pickedUnits:" ); Outlets = ( "_controller" ); Super = NSPanel; }; }gnustep-gui-0.24.0/Panels/Spanish.lproj/GSDataLinkPanel.gorm/0000775000076500007650000000000012256227330023564 5ustar brains99brains99gnustep-gui-0.24.0/Panels/Spanish.lproj/GSDataLinkPanel.gorm/data.info0000664000076500007650000000027011543227525025355 0ustar brains99brains99GNUstep archive00002f45:00000003:00000003:00000000:01GormFilePrefsManager1NSObject% 01NSString&%Latest Version0±& % Typed Streamgnustep-gui-0.24.0/Panels/Spanish.lproj/GSDataLinkPanel.gorm/objects.gorm0000664000076500007650000006537311543227525026125 0ustar brains99brains99GNUstep archive00002f45:00000025:000000bb:00000005:01GSNibContainer1NSObject01 NSMutableSet1NSSet&01GSWindowTemplate1GSClassSwapper01NSString&%NSDataLinkPanel1NSPanel1 NSWindow1 NSResponder% @  @  C»€ C5&% DÀ D9€01 NSView% @  @  C»€ C5  C»€ C5&01 NSMutableArray1 NSArray&01 NSTextField1 NSControl% C! B| A˜  B| A˜&0± &%0 1NSTextFieldCell1 NSActionCell1NSCell0 ±&%Fuente:0 1NSFont% AP° &&&&&&&& &&&&&&%’0 1NSColor0 ±&%NSNamedColorSpace0±&%System0±&%textBackgroundColor0±° °0±& % textColor’0±% B| C! CŠ€ A˜  CŠ€ A˜&0± &%0±0±&° &&&&&&&& &&&&&&%’° °’01NSButton% @à B¢ B¬ B–  B¬ B–&0± &%01 NSButtonCell0±& % Abrir fuente01NSImage B@ B@0±0±&%NSCalibratedWhiteColorSpace 0± &01NSBitmapImageRep1 NSImageRep0±&%NSDeviceRGBColorSpace B@ B@%%0%00 1NSData&$š$šII*$???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿçííÿçîîÿçïïÿçííÿèèèÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿ???ÿ€???ÿêêêÿëëëÿëëëÿêêêÿêêêÿëëëÿëëëÿëëëÿìììÿëëëÿëëëÿêêêÿêêêÿêêêÿëëëÿëëëÿêêêÿëëëÿêêêÿëëëÿëëëÿëëëÿëëëÿëëëÿëëëÿêêêÿêêêÿêêêÿêêêÿêêêÿ???ÿ @???ÿêêêÿêêêÿéééÿêêêÿêêêÿåååÿéééÿìììÿãããÿìììÿìììÿìììÿìììÿìììÿçççÿêêêÿìììÿéééÿëëëÿéééÿìììÿéééÿêêêÿëëëÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿ???ÿ @???ÿçôôÿ˜¥¥ÿŽ››ÿÛèèÿèõõÿ¹ÆÆÿ«¸¸ÿ¬¹¹ÿ¡®®ÿ£°°ÿ®»»ÿ¾ËËÿ³ÀÀÿ·ÃÃÿÂÏÏÿ±½½ÿÁÎÎÿ¹ÆÆÿ·ÄÄÿ¶ÃÃÿ¬¹¹ÿ¨µµÿ ­­ÿ°½½ÿ»ÈÈÿæóóÿê÷÷ÿéööÿéööÿéööÿ???ÿ @???ÿðššÿÓ~~ÿÍxxÿì——ÿñœœÿàŠŠÿÙ„„ÿÎzzÿà‹‹ÿÆrrÿÉttÿÙ„„ÿÔÿÔ||ÿåÿÕ}}ÿÛƒƒÿÜ„„ÿÚ‚‚ÿÞ††ÿÙÿÖ~~ÿÒzzÿÕ}}ÿÛƒƒÿñ™™ÿò™™ÿñ™™ÿñ™™ÿñ™™ÿ???ÿ @???ÿÿ©©ÿÿ««ÿÿ««ÿÿ®®ÿÿµµÿÿ··ÿÿ··ÿÿ››ÿÿ©©ÿÿ¦¦ÿÿ¨¨ÿÿ©©ÿÿ««ÿÿ¹¹ÿÿ¹¹ÿÿººÿÿººÿÿººÿÿººÿÿººÿÿººÿÿººÿÿººÿÿººÿÿººÿÿ¹¹ÿÿ¹¹ÿÿ¹¹ÿÿ¹¹ÿÿ¹¹ÿ???ÿ @???ÿÿ÷÷ÿÿööÿÿððÿÿúúÿÿÿÿÿÿÿÿÿÿÿÿÿÿååÿÿùùÿÿüüÿÿýýÿÿþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿòøøÿøþþÿúÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿÿÿÿÿÿÿÿÿçççÿÑÑÑÿáááÿßßßÿÕÕÕÿãããÿßßßÿéééÿØØØÿÝÝÝÿÓÓÓÿòòòÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿOOOÿ¿¿¿ÿÂÂÂÿ¿¿¿ÿºººÿ¹¹¹ÿµµµÿ´´´ÿ¯¯¯ÿåååÿOOOÿÿÿÿÿÿÿÿÿñññÿáááÿìììÿêêêÿåååÿìììÿáááÿåååÿÖÖÖÿÏÏÏÿÍÍÍÿéééÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿOOOÿÄÄÄÿÁÁÁÿ¿¿¿ÿ¿¿¿ÿºººÿ···ÿµµµÿ´´´ÿÓÓÓÿOOOÿÿÿÿÿÿÿÿÿçççÿÝÝÝÿÓÓÓÿèèèÿæææÿäääÿðððÿÐÐÐÿàààÿâââÿïïïÿÏÏÏÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿOOOÿ¹¹¹ÿ¿¿¿ÿ¿¿¿ÿ¬¬¬ÿ¢¢¢ÿµµµÿ¹¹¹ÿ···ÿ°°°ÿOOOÿÿÿÿÿÿÿÿÿçççÿéééÿåååÿÝÝÝÿäääÿôôôÿäääÿèèèÿßßßÿßßßÿåååÿßßßÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿOOOÿ•••ÿ£££ÿªªªÿÿŽŽŽÿšššÿ˜˜˜ÿ›››ÿÿOOOÿÿÿÿÿÿÿÿÿâââÿæææÿßßßÿ×××ÿÏÏÏÿêêêÿÛÛÛÿÝÝÝÿÍÍÍÿÖÖÖÿØØØÿ×××ÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿOOOÿšššÿŽŽŽÿÿ‹‹‹ÿ“““ÿ‘‘‘ÿ‘‘‘ÿ†††ÿ†††ÿOOOÿÿÿÿÿÿÿÿÿÛÛÛÿáááÿÓÓÓÿéééÿÓÓÓÿñññÿÔÔÔÿÛÛÛÿäääÿáááÿòòòÿåååÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿOOOÿ£££ÿŒŒŒÿŒŒŒÿÿ˜˜˜ÿšššÿ   ÿŽŽŽÿÿOOOÿÿÿÿÿÿÿÿÿÙÙÙÿéééÿðððÿ×××ÿàààÿ×××ÿÔÔÔÿÔÔÔÿÝÝÝÿæææÿßßßÿÝÝÝÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿOOOÿ˜˜˜ÿÿŒŒŒÿÿ‰‰‰ÿ‰‰‰ÿ‹‹‹ÿ†††ÿŒŒŒÿOOOÿÿÿÿÿÿÿÿÿäääÿãããÿíííÿØØØÿØØØÿÚÚÚÿÑÑÑÿÙÙÙÿßßßÿëëëÿäääÿ×××ÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿÿÿÿÿÿÿÿÿèèèÿÞÞÞÿóóóÿÝÝÝÿÑÑÑÿåååÿÖÖÖÿÞÞÞÿÞÞÞÿðððÿîîîÿåååÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿåååÿÛÛÛÿÖÖÖÿÛÛÛÿùùùÿãããÿáááÿÎÎÎÿáááÿãããÿòòòÿÙÙÙÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿæææÿÙÙÙÿÐÐÐÿàààÿÛÛÛÿÜÜÜÿÕÕÕÿíííÿêêêÿØØØÿÜÜÜÿâââÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿäääÿäääÿÞÞÞÿëëëÿâââÿÝÝÝÿÜÜÜÿòòòÿâââÿßßßÿäääÿïïïÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿüüüÿèèèÿåååÿóóóÿñññÿùùùÿéééÿåååÿðððÿôôôÿðððÿ÷÷÷ÿêêêÿÿÿÿÿÿÿÿÿâââÿîîîÿÐÐÐÿÙÙÙÿáááÿÙÙÙÿÝÝÝÿìììÿàààÿæææÿØØØÿãããÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿøøøÿØØØÿÈÈÈÿåååÿÍÍÍÿäääÿÝÝÝÿÅÅÅÿÍÍÍÿÏÏÏÿÃÃÃÿìììÿÊÊÊÿÿÿÿÿÿÿÿÿåååÿÓÓÓÿäääÿØØØÿÖÖÖÿßßßÿôôôÿÒÒÒÿÔÔÔÿÚÚÚÿíííÿíííÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿêêêÿîîîÿïïïÿòòòÿìììÿãããÿôôôÿØØØÿÓÓÓÿèèèÿæææÿïïïÿÿÿÿÿÿÿÿÿßßßÿÓÓÓÿÔÔÔÿÎÎÎÿÒÒÒÿàààÿóóóÿìììÿëëëÿðððÿõõõÿ÷÷÷ÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÒÒÒÿÑÑÑÿâââÿ÷÷÷ÿéééÿÏÏÏÿÞÞÞÿáááÿÖÖÖÿÜÜÜÿÚÚÚÿìììÿÿÿÿÿÿÿÿÿÝÝÝÿÐÐÐÿÝÝÝÿÌÌÌÿØØØÿÎÎÎÿìììÿÿÿÿÿÿÿÿÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿüüüÿÚÚÚÿàààÿÛÛÛÿ×××ÿØØØÿÒÒÒÿìììÿéééÿàààÿÔÔÔÿÛÛÛÿÜÜÜÿÿÿÿÿÿÿÿÿáááÿåååÿÝÝÝÿÚÚÚÿÝÝÝÿÖÖÖÿìììÿãããÿØØØÿËËËÿÜÜÜÿäääÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿøøøÿÈÈÈÿèèèÿÜÜÜÿÚÚÚÿÓÓÓÿßßßÿóóóÿöööÿãããÿÍÍÍÿÏÏÏÿ×××ÿÿÿÿÿÿÿÿÿéééÿãããÿñññÿéééÿåååÿèèèÿâââÿëëëÿäääÿïïïÿàààÿâââÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿøøøÿ×××ÿæææÿÆÆÆÿàààÿêêêÿöööÿãããÿØØØÿØØØÿ×××ÿØØØÿéééÿÿÿÿÿÿÿÿÿßßßÿÓÓÓÿäääÿÛÛÛÿÙÙÙÿÕÕÕÿÕÕÕÿàààÿÜÜÜÿëëëÿÐÐÐÿÖÖÖÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿúúúÿÌÌÌÿÖÖÖÿÉÉÉÿÌÌÌÿäääÿòòòÿÝÝÝÿÊÊÊÿÔÔÔÿºººÿÕÕÕÿÓÓÓÿÿÿÿÿÿÿÿÿéééÿØØØÿÇÇÇÿÕÕÕÿìììÿáááÿâââÿàààÿáááÿÇÇÇÿàààÿÎÎÎÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿþþþÿæææÿèèèÿîîîÿóóóÿöööÿéééÿæææÿêêêÿúúúÿðððÿãããÿæææÿÿÿÿÿÿÿÿÿæææÿÛÛÛÿíííÿôôôÿÝÝÝÿßßßÿãããÿÝÝÝÿÚÚÚÿâââÿéééÿÝÝÝÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿüüüÿÐÐÐÿÌÌÌÿÁÁÁÿÊÊÊÿàààÿËËËÿÝÝÝÿÑÑÑÿäääÿçççÿºººÿÌÌÌÿÿÿÿÿÿÿÿÿØØØÿÎÎÎÿàààÿëëëÿÜÜÜÿÜÜÜÿÐÐÐÿÏÏÏÿ×××ÿÙÙÙÿêêêÿ×××ÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿþþþÿÔÔÔÿÔÔÔÿôôôÿâââÿãããÿØØØÿÒÒÒÿßßßÿ×××ÿÝÝÝÿáááÿðððÿÿÿÿÿÿÿÿÿÙÙÙÿÎÎÎÿÓÓÓÿÓÓÓÿßßßÿ×××ÿÚÚÚÿÎÎÎÿÖÖÖÿÊÊÊÿòòòÿÓÓÓÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿþþþÿáááÿàààÿýýýÿôôôÿèèèÿÕÕÕÿÏÏÏÿ×××ÿäääÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿçççÿàààÿâââÿçççÿÜÜÜÿÜÜÜÿäääÿâââÿßßßÿÝÝÝÿÛÛÛÿÝÝÝÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿüüüÿÒÒÒÿÑÑÑÿÕÕÕÿÑÑÑÿÚÚÚÿÕÕÕÿ÷÷÷ÿÌÌÌÿÕÕÕÿõõõÿÇÇÇÿçççÿÿÿÿÿÿÿÿÿãããÿÙÙÙÿÔÔÔÿëëëÿÙÙÙÿáááÿàààÿÜÜÜÿÙÙÙÿÛÛÛÿÓÓÓÿæææÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿýýýÿåååÿãããÿìììÿÜÜÜÿãããÿæææÿöööÿßßßÿàààÿóóóÿâââÿîîîÿÿÿÿÿÿÿÿÿãããÿÐÐÐÿØØØÿãããÿßßßÿÛÛÛÿÝÝÝÿÑÑÑÿáááÿÕÕÕÿÚÚÚÿÜÜÜÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿüüüÿ×××ÿÖÖÖÿßßßÿÜÜÜÿßßßÿÙÙÙÿ÷÷÷ÿËËËÿéééÿñññÿÝÝÝÿÈÈÈÿÿÿÿÿÿÿÿÿåååÿÛÛÛÿßßßÿÛÛÛÿßßßÿâââÿóóóÿ×××ÿòòòÿãããÿâââÿØØØÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿüüüÿÝÝÝÿÜÜÜÿÜÜÜÿÙÙÙÿÝÝÝÿÙÙÙÿ÷÷÷ÿÉÉÉÿÝÝÝÿòòòÿÖÖÖÿæææÿÿÿÿÿÿÿÿÿÜÜÜÿØØØÿÚÚÚÿÙÙÙÿæææÿÕÕÕÿçççÿÚÚÚÿÖÖÖÿàààÿÛÛÛÿåååÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿüüüÿÞÞÞÿäääÿãããÿäääÿèèèÿåååÿìììÿÛÛÛÿÞÞÞÿÝÝÝÿãããÿôôôÿÿÿÿÿÿÿÿÿÞÞÞÿÙÙÙÿÕÕÕÿÖÖÖÿÝÝÝÿÒÒÒÿØØØÿÑÑÑÿÕÕÕÿðððÿèèèÿÚÚÚÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿùùùÿÌÌÌÿÚÚÚÿÔÔÔÿÞÞÞÿäääÿÚÚÚÿàààÿáááÿÔÔÔÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿáááÿÛÛÛÿÚÚÚÿÙÙÙÿÝÝÝÿßßßÿÛÛÛÿÍÍÍÿÛÛÛÿõõõÿêêêÿÖÖÖÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ???ÿ @???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ @€                               @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ þÿ00’$$R0!±% A &&&&&&&&&&&&&&%2 pickedOpenSource:v12@0:4@80"±&0#±&&&& &&0$±% BÄ B¢ B¬ B–  B¬ B–&0%± &%0&±0'±& % Actualizar0(± B@ B@°0)± &0*±° B@ B@%%0%00+±&$š$šII*$UUUÿUUUÿUUUÿUDUÿUUUÿUUUÿUUUÿUDUÿUUUÿUUUÿUUUÿUDUÿUUUÿUUUÿUUUÿUDUÿUUUÿUUUÿUUUÿUDUÿUUUÿUUUÿUUUÿUDUÿUUUÿUUUÿUUUÿUDUÿUUUÿUUUÿUUUÿUDUÿUUUÿUUUÿUUUÿUDUÿUUUÿUUUÿUUUÿUDUÿUUUÿUUUÿUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦UUDÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÇÇÇÿªªªÿÇÇÇÿÿÿÿÿãããÿªªªÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿ›››ÿLLLÿâââÿüüüÿûûûÿßßßÿ¨¨¨ÿ¨¨¨ÿþþþÿÿÿÿÿªªªÿŽŽŽÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿãããÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿUUUÿÿÿÿÿ†††ÿ   ÿóóóÿÚÚÚÿÃÃÃÿýýýÿâââÿªªªÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿÿ¦LUUDÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿ999ÿÿÿÿÿÿ000ÿàààÿçççÿŸŸŸÿöööÿûûûÿ©©©ÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿ¨¨¨ÿÿÿÿÿÿÿÿ¹¹¹ÿ­­­ÿëëëÿôôôÿ¦¦¦ÿþþþÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÇÇÇÿªªªÿÇÇÇÿÿÿÿÿãããÿªªªÿrrrÿÇÇÇÿÿÿÿÿÿÿÿÿªªªÿªªªÿâââÿúúúÿ‘‘‘ÿXXXÿ„„„ÿŸŸŸÿ¦¦¦ÿ@@@ÿÿ)))ÿÉÉÉÿÚÚÚÿ›››ÿmmmÿ§§§ÿþþþÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿùùùÿíííÿÚÚÚÿÂÂÂÿ«««ÿœœœÿ———ÿhhhÿÿgggÿÉÉÉÿÛÛÛÿêêêÿõõõÿûûûÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUDÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿúúúÿðððÿßßßÿÉÉÉÿµµµÿ§§§ÿ¡¡¡ÿ¢¢¢ÿ&&&ÿÿ©©©ÿÍÍÍÿÝÝÝÿìììÿ÷÷÷ÿýýýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÇÇÇÿªªªÿÇÇÇÿÿÿÿÿãããÿªªªÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿüüüÿ¿¿¿ÿgggÿÙÙÙÿÊÊÊÿÀÀÀÿ¥¥¥ÿzzzÿQQQÿÿTTTÿ‚‚‚ÿtttÿáááÿïïïÿùùùÿ©©©ÿªªªÿãããÿÿÿÿÿãããÿªªªÿªªªÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿãããÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿþþþÿÞÞÞÿ¢¢¢ÿêêêÿâââÿÜÜÜÿÿÔÔÔÿ···ÿÿÿ©©©ÿ„„„ÿÕÕÕÿæææÿ¾¾¾ÿàààÿÿÿÿÿªªªÿÿÿÿÿãããÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿýýýÿ§§§ÿ÷÷÷ÿóóóÿñññÿžžžÿêêêÿâââÿÿÿ~~~ÿ~~~ÿÉÉÉÿÛÛÛÿžžžÿøøøÿþþþÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿ¦LUUDÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿ©©©ÿýýýÿüüüÿûûûÿ¦¦¦ÿ÷÷÷ÿÕÕÕÿÿÿUUUÿyyyÿ½½½ÿÐÐÐÿ²²²ÿÙÙÙÿüüüÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÇÇÇÿªªªÿÇÇÇÿÿÿÿÿãããÿªªªÿrrrÿÇÇÇÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÇÇÇÿrrrÿªªªÿãããÿÿÿÿÿãããÿ¨¨¨ÿ[[[ÿÿÿ***ÿNNNÿvvvÿÄÄÄÿÜÜÜÿŸŸŸÿ¦¦¦ÿãããÿÿÿÿÿãããÿªªªÿrrrÿÇÇÇÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿâââÿÿÿÿ>>>ÿ§§§ÿ§§§ÿ¹¹¹ÿÔÔÔÿëëëÿøøøÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÆÆÆÿÿÿÿÿtttÿœœœÿÿ±±±ÿÍÍÍÿçççÿ÷÷÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUDÿÿÿÿÿÿÿÿÿªªªÿŽŽŽÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÇÇÇÿeeeÿªªªÿŽŽŽÿ999ÿÿÿÿÿÿjjjÿPPPÿ•••ÿ¬¬¬ÿ´´´ÿ˜˜˜ÿ¤¤¤ÿÿÿÿÿÿÿÿÿãããÿªªªÿªªªÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿãããÿªªªÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿãããÿqqqÿÿÿÿÿÿÿÿmmmÿ~~~ÿYYYÿ‘‘‘ÿ¬¬¬ÿµµµÿçççÿ¤¤¤ÿÿÿÿÿÿÿÿÿãããÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿqqqÿÿÿÿÿÿÿFFFÿŒŒŒÿ€€€ÿVVVÿ”””ÿ²²²ÿÒÒÒÿêêêÿ¥¥¥ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿpppÿÿÿÿÿLLLÿvvvÿgggÿ{{{ÿzzzÿZZZÿ   ÿ¿¿¿ÿÜÜÜÿðððÿ§§§ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿ¦LUUDÿÿÿÿÿÿÿÿÿªªªÿrrrÿªªªÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÆÆÆÿJJJÿÿÿ¯¯¯ÿ•••ÿ```ÿUUUÿxxxÿyyyÿWWWÿCCCÿvvvÿÏÏÏÿÌÌÌÿ£££ÿqqqÿÇÇÇÿÿÿÿÿãããÿªªªÿrrrÿÇÇÇÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿ¦¦¦ÿÿÿ¸¸¸ÿœœœÿ†††ÿ}}}ÿ~~~ÿˆˆˆÿ™™™ÿ°°°ÿÉÉÉÿàààÿðððÿúúúÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUDÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿ¦¦¦ÿÿŒŒŒÿµµµÿ›››ÿŒŒŒÿ‹‹‹ÿ”””ÿ¥¥¥ÿ¸¸¸ÿÌÌÌÿÞÞÞÿîîîÿøøøÿýýýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÇÇÇÿªªªÿÇÇÇÿÿÿÿÿãããÿªªªÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÆÆÆÿJJJÿÿŒŒŒÿ¸¸¸ÿ‘‘‘ÿhhhÿlllÿ²²²ÿÄÄÄÿŽŽŽÿ~~~ÿïïïÿ÷÷÷ÿüüüÿªªªÿªªªÿãããÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿãããÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿâââÿnnnÿÿŽŽŽÿ¾¾¾ÿtttÿ¯¯¯ÿ¦¦¦ÿŸŸŸÿÞÞÞÿÑÑÑÿ¢¢¢ÿùùùÿýýýÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿþþþÿ¦¦¦ÿìììÿÙÙÙÿÇÇÇÿ}}}ÿÀÀÀÿÎÎÎÿ•••ÿîîîÿ÷÷÷ÿ¨¨¨ÿþþþÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿ¦LUUDÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿþþþÿ¦¦¦ÿïïïÿàààÿÑÑÑÿ†††ÿÎÎÎÿÃÃÃÿ···ÿ÷÷÷ÿüüüÿªªªÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÇÇÇÿªªªÿÇÇÇÿÿÿÿÿãããÿªªªÿrrrÿÇÇÇÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÇÇÇÿpppÿ¢¢¢ÿÎÎÎÿÝÝÝÿÀÀÀÿ’’’ÿšššÿóóóÿûûûÿ©©©ÿrrrÿªªªÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýýýÿøøøÿðððÿéééÿæææÿéééÿðððÿøøøÿýýýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿûûûÿöööÿòòòÿðððÿòòòÿöööÿûûûÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUDÿÿÿÿÿÿÿÿÿÇÇÇÿªªªÿÇÇÇÿÿÿÿÿãããÿªªªÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÇÇÇÿ&&&ÿÿÿ¢¢¢ÿÖÖÖÿ¡¡¡ÿ£££ÿúúúÿýýýÿªªªÿŽŽŽÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿãããÿªªªÿªªªÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿãããÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿeeeÿÿÿÿÿ‡‡‡ÿæææÿÑÑÑÿ½½½ÿùùùÿáááÿªªªÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿãããÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿZZZÿÎÎÎÿØØØÿ™™™ÿòòòÿúúúÿ©©©ÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿþþþÿ888ÿÿÿÿÿZZZÿ°°°ÿªªªÿ¦¦¦ÿéééÿöööÿ¨¨¨ÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿ¦LUUDÿÿÿÿÿÿÿÿÿÇÇÇÿªªªÿÇÇÇÿÿÿÿÿãããÿªªªÿrrrÿÇÇÇÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿþþþÿ———ÿ ÿÿÿ555ÿÿdddÿqqqÿÆÆÆÿáááÿ¢¢¢ÿpppÿªªªÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿãããÿªªªÿrrrÿÇÇÇÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýýýÿ÷÷÷ÿÎÎÎÿŠŠŠÿˆˆˆÿ’’’ÿ„„„ÿ‰‰‰ÿ   ÿÀÀÀÿÝÝÝÿñññÿûûûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýýýÿ÷÷÷ÿéééÿÐÐÐÿ³³³ÿ˜˜˜ÿŠŠŠÿÿ¥¥¥ÿÃÃÃÿßßßÿòòòÿüüüÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿùùùÿîîîÿÛÛÛÿÃÃÃÿ­­­ÿ¢¢¢ÿ¦¦¦ÿ¸¸¸ÿÐÐÐÿæææÿõõõÿýýýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUDÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿüüüÿôôôÿèèèÿØØØÿÉÉÉÿÁÁÁÿÄÄÄÿÐÐÐÿáááÿïïïÿùùùÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦L¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦§¨ªªª©¨¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦LLLLLLLLLLLLLLLLLLLMNNNMLLLLLLLLLLLLLLLLLLL þÿ00’$$R°!&&&&&&&&&&&&&&%2 pickedUpdateDestination:v12@0:4@80,±&0-±&&&& &&0.±% C= B¢ B¬ B–  B¬ B–&0/± &%00±01±& % Romper enlace02± A€ A€°03± &04±° A€ A€%%%05±&ššII*ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ þÿ’R°!&&&&&&&&&&&&&&%2 pickedBreakLink:v12@0:4@806±&07±&&&& &&08±% CŒ B¢ B¬ B–  B¬ B–&09± &%0:±0;±& % Romper todo0<± A€ A€°0=± &0>±° A€ A€%%%0?±&II*têÿþÿþÿþÿþÿþÿíòÿþèÿþÿþÿõöÿþàÿþÿþÿùúÿþôÿþÿþÿþÿþôÿþÿþÿýúøÿþÿþÿòðÿþÿýþôÿþÿòèÿþÿþøÿþÿòôÿþÿþøÿþÿþøÿþÿöôÿþÿúøÿþÿþøÿþÿúôÿþÿöøÿþÿþøÿþÿþôÿþÿòøÿþÿþèÿþÿòôÿþÿúðÿþÿòÿþøÿþÿýúÿþôÿþÿþÿþÿþôÿþÿþÿýöÿþàÿþÿþÿùòÿþèÿþÿþÿõêÿþÿþÿþÿþÿþÿí þÿþ€lR°!&&&&&&&&&&&&&&%2 pickedBreakAllLinks:v12@0:4@80@±&0A±&&&& &&0B1NSBox% @à @À C³ BŽ  C³ BŽ&0C± &0D± % @à @à C¬ B4  C¬ B4&0E± &0F±% C AØ C A  C A&0G± &%0H±0I±&%Última actualización:0J±% A@°I&&&&&&&& &&&&&&%’° °’0K±% CJ A C A  C A&0L± &%0M±0N±&°J&&&&&&&& &&&&&&%’° °’0O1 NSPopUpButton% A  C AÈ  C AÈ&0P± &%0Q1NSPopUpButtonCell1NSMenuItemCell0R±&%Button°J&&&&&&&&0S1NSMenu0T±&0U± &0V1 NSMenuItem0W±&%Nunca0X±&&&ÿ%’%0Y± 0Z±& % Manualmente0[±&&&ÿ%0\± A0 A0]±° 0^± &0_±° A0 A%% %0`±&  II*z€ P8$ „B`ïød6º¢Q™HªR ÐèԙţØ$IÕ’@£ìÉ ]þ”L¥%óDLÿ•Î$™ä‚Dÿ? Ô Ö ?¤K©1Š]‡A¡Ê`S •BW«Vhµ R±E­SìX þÿ rR’%0a± 0b±&%Cuando se grave°[&&ÿ%’%0c± 0d±& % Continuamente°[&&ÿ%’%&&&&&&%2 pickedUpdateMode:v12@0:4@80e±&0f±&&&& &&°Y°S°Y%%%%%0g±0h±& % Actualizar°J°h&&&&&&&& &&&&&&%’0i±° 0j±&%System0k±&%windowBackgroundColor° @  @ %%°i0l±&%Window0m±&%Inspector de Enlace°m ?€ A¨ F@ F@%0n±0o±&%NSApplicationIcon&  D€ D@0p± &0q± &0r1!NSMutableDictionary1" NSDictionary&0s±&%Button2°.0t±&%Button3°80u±&%NSOwner0v±&%GSDataLinkPanelController0w±& % TextField1°0x±& % TextField2°F0y±& % TextField°0z±& % TextField3°K0{±&%GormNSPopUpButton°O0|±&%Button°0}±& % MenuItem1°a0~±& % GormNSPanel°0±&%Box°B0€±& % MenuItem2°c0±& % MenuItem3°V0‚±&%MenuItem°Y0ƒ±&%Button1°$0„± &0…1#NSNibConnector°~0†±&%NSOwner0‡±#°y0ˆ±#°w0‰±#°|0б#°ƒ0‹±#°s0Œ±#°t0±#°0ޱ#°x0±#°z0±#°{0‘±#°‚0’±#°}0“±#°€0”1$NSNibControlConnector°{°~0•±&%pickedUpdateMode:0–±$°|°~0—±&%pickedOpenSource:0˜±$°ƒ°~0™±&%pickedUpdateDestination:0š±$°s°~0›±&%pickedBreakLink:0œ±$°t°~0±&%pickedBreakAllLinks:0ž1%NSNibOutletConnector°~°|0Ÿ±&%_openSourceButton0 ±%°~°ƒ0¡±&%_updateDestinationButton0¢±%°~°s0£±&%_breakLinkButton0¤±%°~°t0¥±&%_breakAllLinksButton0¦±%°~°{0§±&%_updateModeButton0¨±%°~°z0©±&%_lastUpdateField0ª±%°~°w0«±& % _sourceField0¬±%°†°~0­±&%panel0®±%°~°0¯±& % _updateView0°±#°0±±!&°~°gnustep-gui-0.24.0/Panels/Spanish.lproj/GSDataLinkPanel.gorm/data.classes0000664000076500007650000000126411543227525026063 0ustar brains99brains99{ "## Comment" = "Do NOT change this file, Gorm maintains it"; FirstResponder = { Actions = ( "orderFrontFontPanel:" ); Super = NSObject; }; GSDataLinkPanelController = { Actions = ( ); Outlets = ( panel ); Super = NSObject; }; NSDataLinkPanel = { Actions = ( "pickedUpdateMode:", "pickedUpdateDestination:", "pickedOpenSource:", "pickedBreakLink:", "pickedBreakAllLinks:" ); Outlets = ( "_updateModeButton", "_breakAllLinksButton", "_breakLinkButton", "_updateDestinationButton", "_openSourceButton", "_lastUpdateField", "_sourceField", "_updateView" ); Super = NSPanel; }; }gnustep-gui-0.24.0/Panels/Spanish.lproj/GSPrintPanel.gorm/0000775000076500007650000000000012256227330023171 5ustar brains99brains99gnustep-gui-0.24.0/Panels/Spanish.lproj/GSPrintPanel.gorm/data.info0000664000076500007650000000027011444316015024753 0ustar brains99brains99GNUstep archive00002f45:00000003:00000003:00000000:01GormFilePrefsManager1NSObject% 01NSString&%Latest Version0±& % Typed Streamgnustep-gui-0.24.0/Panels/Spanish.lproj/GSPrintPanel.gorm/objects.gorm0000664000076500007650000004607511543227525025530 0ustar brains99brains99GNUstep archive00002f45:00000029:000001b5:00000001:01GSNibContainer1NSObject01 NSMutableSet1NSSet&01GSWindowTemplate1GSClassSwapper01NSString&%NSPanel1NSPanel1 NSWindow1 NSResponder% @  @  Cƒ€ C&% D;À D%À01 NSView% @  @  Cƒ€ C  Cƒ€ C&01 NSMutableArray1 NSArray&01NSButton1 NSControl% CF A  B` AÀ  B` AÀ&0± &%(0 1 NSButtonCell1 NSActionCell1NSCell0 ±&%Aceptar0 1NSFont% A@&&&&&&&&&&&&&&%2 _pickedButton:v12@0:4@80 ±&0 ±&&&& &&01NSBox% C BH Bì B†  Bì B†&0± &0± % @à @à BÐ B$  BÐ B$&0± &01 NSPopUpButton% A  BÐ A   BÐ A &0± &%$01NSPopUpButtonCell1NSMenuItemCell0±&%Button° &&&&&&&&01NSMenu0±&0± &01 NSMenuItem0±&%Item 10±&&&ÿ%01NSImage A0 A01NSColor0±&%NSCalibratedWhiteColorSpace 0± &0 1NSBitmapImageRep1 NSImageRep0!±&%NSDeviceRGBColorSpace A0 A%% %0"1NSData&  II*z€ P8$ „B`ïød6º¢Q™HªR ÐèԙţØ$IÕ’@£ìÉ ]þ”L¥%óDLÿ•Î$™ä‚Dÿ? Ô Ö ?¤K©1Š]‡A¡Ê`S •BW«Vhµ R±E­SìX þÿ rR’%0#±0$±&%Item 2°&&ÿ%’%0%±0&±&%Item 3°&&ÿ%’%&&&&&&%’&&& &&°°°%%%%%0'1NSTextFieldCell0(±& % Resolución° °(&&&&&&&& &&&&&&%’0)±0*±&%NSCalibratedRGBColorSpace ?*Àƒ ?*Àƒ ?*Àƒ ?*Àƒ ?€0+±°* ?€ @  @ %%0,±% A BH Bò B†  Bò B†&0-± &0.± % @à @à BÖ B$  BÖ B$&0/± &00±% A  BÖ A   BÖ A &01± &%"02±03±&%Button° &&&&&&&&04±05±&06± &07±08±&%Item 109±&&&ÿ%°’%0:±0;±&%Item 2°9&&ÿ%’%0<±0=±&%Item 3°9&&ÿ%’%&&&&&&%’&&& &&°7°4°7%%%%%0>±0?±&%Fuente del papel° °?&&&&&&&& &&&&&&%’°)0@±°* ?€ @  @ %%0A±0B±&%NSNamedColorSpace0C±&%System0D±&%windowBackgroundColor0E±&%Window0F±&%Opciones de impresión°F @@ B F@ F@%&   D€ D@0G±°±% @  @  CÑ C¤&% C¥€ D%À0H± % @  @  CÑ C¤  CÑ C¤&0I± &0J±% @à @À B˜ AÀ  B˜ AÀ& 0K± &%0L±0M±&%Guardar° &&&&&&&&&&&&&&%’0N±&0O±&&&& &&0P±% B² @À B˜ AÀ  B˜ AÀ& 0Q± &%0R±0S±&%Previa° &&&&&&&&&&&&&&%’°N0T±&&&& &&0U±% C* @À B˜ AÀ  B˜ AÀ& 0V± &%0W±0X±&%Fax° &&&&&&&&&&&&&&%’°N0Y±&&&& &&0Z±% C| @À B˜ AÀ  B˜ AÀ& 0[± &%0\±0]±&%Cancelar° &&&&&&&&&&&&&&%’0^±&&&& &&0_±% C§€ @À B˜ AÀ  B˜ AÀ& 0`± &%0a±0b±&%Imprimir° &&&&&&&&&&&&&&%’°N0c±&&&& &&0d±% @` C| CË€ @  CË€ @&0e± &0f± % @à @à CÄ€   CÄ€ &0g± &0h±0i±&%Box° &&&&&&&& &&&&&&%’0j±°* ?*Àƒ ?*Àƒ ?*Àƒ ?*Àƒ ?€0k±°* ?€ @  @ %%0l±% @À C‚€ B€ B€  B€ B€&0m± &%0n±0o±&%Button0p±0q±&%common_Root_Apple.tiff° &&&&&&&&&&&&&&%’°Y°Y&&& &&0r1 NSTextField% B~ C‰ BÞ B  BÞ B&0s± &%0t±0u±&%Imprimir0v±% A°u&&&&&&&& &&&&&&%’0w±°* ?€ ?€ ?€ ?€ ?€0x±°* ?€’0y±% Bú BÜ C€ BT  C€ BT&0z± &0{± % @à @à C†€ AØ  C†€ AØ&0|± &0}1!NSMatrix% @  Bò A   Bò A &0~± &%0±0€±&° &&&&&&&&&&&&&&%’% Bp A  ?€ ?€0±°* ?*Àƒ ?*Àƒ ?*Àƒ ?*Àƒ ?€°0‚±& % NSButtonCell0ƒ±0„±&%Radio0…±0†1"NSMutableString&%common_RadioOff° &&&&&&&&&&&&&&%’0‡±0ˆ±"&%common_RadioOn&&& &&%%0‰± &0б0‹±&%Todo°…° &&&&&&&&&&&&&&%’0Œ±&°‡&&& &&0±0ޱ&%Desde:°…° 0±&%From:&&&&&&&&&&&&&&%’°Œ°‡&&& &&’’’°01#NSForm% Bð @  BX A   BX A &0‘± &%0’1$ NSFormCell0“±&° &&&&&&&&&&&&&&%’ ¿€0”±0•±&%Field:° &&&&&&&&&&&&&&% BX A  @@0–±°* ?*Àƒ ?*Àƒ ?*Àƒ ?*Àƒ ?€°–0—±& % NSFormCell%%0˜± &0™±$0š±&° &&&&&&&&&&&&&&%’ A0›±0œ±&° &&&&&&&&&&&&&&’’’°™0±#% C3 @  B² A   B² A &0ž± &%0Ÿ±$0 ±&° &&&&&&&&&&&&&&%’ ¿€0¡±0¢±&%Field:° &&&&&&&&&&&&&&% B² A  @@0£±°* ?*Àƒ ?*Àƒ ?*Àƒ ?*Àƒ ?€°£0¤±& % NSFormCell%%0¥± &0¦±$0§±&° °§&&&&&&&&&&&&&&%’ B00¨±0©±&%hasta: ° °©&&&&&&&&&&&&&&’’’°¦0ª±0«±&%Páginas° °«&&&&&&&& &&&&&&%’°j0¬±°* ?€ @  @ %%0­±% A BÜ BÒ BT  BÒ BT&0®± &0¯± % @à @à B¶ AØ  B¶ AØ&0°± &0±± % A @€ BŽ A   BŽ A &0²± &%0³±0´±&%Text° °´&&&&&&&& &&&&&&%’0µ±°* ?€ ?€ ?€ ?€ ?€0¶±°* ?€’0·±0¸±&%Copias° °¸&&&&&&&& &&&&&&%’°j0¹±°* ?€ @  @ %%0º±% Bú B0 Bð Bp  Bð Bp&0»± &0¼± % @à @à BÔ B  BÔ B&0½± &0¾± % A  @ð B` A   B` A &0¿± &% 0À±0Á±&%Text° °Á&&&&&&&& &&&&&&%’0±°* ?€ ?€ ?€ ?€ ?€0ñ°* ?€’0ı % Bœ @ð A€ A   A€ A &0ű &%0Ʊ0DZ&%%0ȱ% A`&&&&&&&& &&&&&&%’0ɱ°* ?€ ?€ ?€ ?€ ?€0ʱ°* ?€’0˱0̱&%Escala° °Ì&&&&&&&& &&&&&&%’°j0ͱ°* ?€ @  @ %%0α% C B0 C Bp  C Bp&0ϱ &0б % @à @à C B  C B&0ѱ &0Ò±% AÈ @ð B´ A   B´ A &0Ó± &%#0Ô±0Õ±&%Button° &&&&&&&&0Ö±0×±&0ر &0Ù±0Ú±&%Item 10Û±&&&ÿ%°’%0ܱ0ݱ&%Item 2°Û&&ÿ%’%0Þ±0ß±&%Item 3°Û&&ÿ%’%&&&&&&%’&&& &&°Ù°Ö°Ù%%%%%0à±0á±&%Páginas por hoja° °á&&&&&&&& &&&&&&%’°j0â±°* ?€ @  @ %%0ã± % @à C\ B˜ A`  B˜ A`&0ä± &%0å±0æ±& % Impresora:°È°æ&&&&&&&& &&&&&&%’0ç±°* ?€ ?€ ?€ ?€ ?€0è±°* ?€’0é± % A CD B‚ A`  B‚ A`&0ê± &%0ë±0ì±&%Nota:°È°ì&&&&&&&& &&&&&&%’0í±°* ?€ ?€ ?€ ?€ ?€0î±°* ?€’0ï± % A C( B’ A˜  B’ A˜&0ð± &%0ñ±0ò±& % Progreso:°È°ò&&&&&&&& &&&&&&%’0ó±°* ?€ ?€ ?€ ?€ ?€0ô±°* ?€’0õ± % B² CD C € A`  C € A`&0ö± &%0÷±0ø±&%None°È°ø&&&&&&&& &&&&&&%’0ù±°* ?€ ?€ ?€ ?€ ?€0ú±°* ?€’0û± % B² C, C € A`  C € A`&0ü± &%0ý±0þ±&%Idle°È&&&&&&&& &&&&&&%’0ÿ±°* ?€ ?€ ?€ ?€ ?€P±°* ?€’P±% A B0 BÒ BP  BÒ BP&P± &P± % @à @à B¶ B  B¶ B&P± &P±% A @  B˜ AÀ  B˜ AÀ&P± &%!P±P±&%Opciones° P ±&%Options&&&&&&&&&&&&&&%²°NP ±&&&& &&P ±P ±&%Box° &&&&&&&& &&&&&&%’°jP ±°* ?€ @  @ %%P±% B² CT CŸ€ A°  CŸ€ A°&P± &%P±P±&P±%&&&&&&&&P±P±&P± &P±P±&%Item 1Ð&&ÿ%P±P±& % common_Nibble’%P±P±&%Item 2Ð&&ÿ%’%P±P±&%Item 3Ð&&ÿ%’%&&&&&&%’P±&Ð&&& >ÌÌÍ =™™š&&ÐÐÐ%%%%%°AP±&%WindowP ±&%ImprimirÐ  CÒ C¯ F@ F@%&   D€ D@P!± &P"± &P#1%NSMutableDictionary1& NSDictionary&,P$±&%Button5°lP%±&%Button6ÐP&±&%Button7°P'±&%Button°JP(±&%Box1°yP)±&%Box2°­P*±&%Box3°ºP+±& % TextField°rP,±&%Box4°ÎP-±&%Box5ÐP.±&%Panel°GP/±&%Box6°P0±&%Box7°,P1±&%Panel1°P2±&%PopUpButton(0)ÐP3±& % MenuItem(5)ÐP4±& % MenuItem(4)ÐP5±& % MenuItem(3)ÐP6±& % MenuItem(2)°ÞP7±& % TextField1°±P8±&%Box°dP9±& % TextField2P:± % Bœ C B¦ A`  B¦ A`&P;± &%P<±P=±&%Title°È&&&&&&&& &&&&&&%’P>±°* ?€ ?€ ?€ ?€ ?€P?±°* ?€’P@±& % MenuItem(1)°ÜPA±& % TextField3°ãPB±& % TextField4°éPC±& % MenuItem(0)°ÙPD±& % TextField5PE± % Bœ C B¦ A`  B¦ A`&PF± &%PG±PH±&%Title°È&&&&&&&& &&&&&&%’PI±°* ?€ ?€ ?€ ?€ ?€PJ±°* ?€’PK±& % TextField6°ïPL±&%NSOwnerPM±& % NSPrintPanelPN±&%Form1PO±#% C, B¢ B® B  B® B&PP± &%PQ±$PR±&° &&&&&&&&&&&&&&%’ ¿€PS±PT±&%Field:° &&&&&&&&&&&&&&% B® Aˆ @@PU±°* ?*Àƒ ?*Àƒ ?*Àƒ ?*Àƒ ?€ÐUPV±& % NSFormCell%%PW± &PX±$ÐR° &&&&&&&&&&&&&&%’ BPY±PZ±&%Field 1° &&&&&&&&&&&&&&P[±$ÐR° &&&&&&&&&&&&&&%’ BP\±P]±&%Field 2° &&&&&&&&&&&&&&’’’ÐXP^±& % TextField8°õP_±&%Matrix°}P`±& % TextField9°ûPa±&%Form2°Pb±&%Button1°PPc±&%Form3°Pd±& % TextField10°¾Pe±&%Button2°UPf±& % PopUpButton1°ÒPg±& % TextField11°ÄPh±&%Button3°ZPi±& % PopUpButton2°0Pj±&%Button4°_Pk±& % PopUpButton3°Pl± &66Pm1'NSNibConnectorÐ.Pn±&%NSOwnerPo±'Ð9Ð.Pp±'Ð'Ð.Pq±'ÐbÐ.Pr±'ÐeÐ.Ps±'ÐhÐ.Pt±'ÐjÐ.Pu±'Ð8Ð.Pv±'Ð$Ð.Pw±'Ð+Ð.Px±'Ð(Ð.Py±'Ð)Ð.Pz±'Ð7Ð.P{±'Ð_Ð.P|±'ÐNÐ.P}±'ÐaÐ.P~±'ÐcÐ.P±'Ð*Ð.P€±'Ð,Ð.P±'ÐfÐ.P‚1(NSNibControlConnectorÐ'ÐnPƒ±&%_pickedButton:P„±(ÐbÐnЃP…±(ÐeÐnЃP†±(ÐhÐnЃP‡±(ÐjÐnЃPˆ±(Ð_ÐnP‰±& % _pickedPage:Pб'ÐAÐ.P‹±'ÐBÐ.PŒ±'ÐDÐ.P±'ÐKÐ.Pޱ'Ð^Ð.P±'Ð`Ð.P±'Ð-Ð.P‘±'Ð%Ð.P’±'Ð1ÐnP“±'Ð&Ð1P”±'Ð/Ð1P•±'Ð0Ð1P–±'ÐiÐ1P—±'ÐkÐ1P˜±'ÐdÐ.P™±'ÐgÐ.Pš1)NSNibOutletConnectorÐnÐ.P›±&%_panelPœ±(Ð%ÐnP±&%_pickedButton:Pž±(Ð&ÐnPŸ±&%_pickedButton:P ±)ÐnÐ1P¡±& % _optionPanelP¢±'ÐCP£±'Ð@P¤±'Ð6P¥±'Ð2P¦±'Ð5Ð2P§±'Ð4Ð2P¨±'Ð3Ð2P©±(Ð2ÐnPª±&%_pickedPrinter:P«±%&gnustep-gui-0.24.0/Panels/Spanish.lproj/GSPrintPanel.gorm/data.classes0000664000076500007650000000061011541064077025461 0ustar brains99brains99{ "## Comment" = "Do NOT change this file, Gorm maintains it"; FirstResponder = { Actions = ( "_pickedPrinter:", "orderFrontFontPanel:" ); Super = NSObject; }; NSPrintPanel = { Actions = ( "_pickedButton:", "_pickedPage:", "_pickedPrintOp:", "_pickedPrinter:" ); Outlets = ( "_optionPanel", "_panel" ); Super = NSPanel; }; }gnustep-gui-0.24.0/Panels/English.lproj/0000775000076500007650000000000012256227330017704 5ustar brains99brains99gnustep-gui-0.24.0/Panels/English.lproj/GSToolbarCustomizationPalette.gorm/0000775000076500007650000000000012256227330026613 5ustar brains99brains99gnustep-gui-0.24.0/Panels/English.lproj/GSToolbarCustomizationPalette.gorm/data.info0000664000076500007650000000027011144365551030403 0ustar brains99brains99GNUstep archive00002e7c:00000003:00000003:00000000:01GormFilePrefsManager1NSObject% 01NSString&%Latest Version0±& % Typed Streamgnustep-gui-0.24.0/Panels/English.lproj/GSToolbarCustomizationPalette.gorm/objects.gorm0000664000076500007650000001136111161604276031136 0ustar brains99brains99GNUstep archive00002e7c:00000025:00000086:00000000:01GSNibContainer1NSObject01 GSMutableSet1 NSMutableSet1NSSet&01GSWindowTemplate1GSClassSwapper01NSString&%NSPanel1 NSPanel1 NSWindow1 NSResponder% ?€ A Cù€ C´& % Cè D_€01 NSView% ?€ A Cù€ C´  Cù€ C´&01 NSMutableArray1NSArray&01 GSCustomView1 GSNibItem0±&%GSToolbarCustomizationView ¿€ BÎ Cú CF&0 1 NSPopUpButton1NSButton1 NSControl% B@ C¤ Bø A°  Bø A°& 0 ± &%0 1NSPopUpButtonCell1NSMenuItemCell1 NSButtonCell1 NSActionCell1NSCell0 ±&0 1NSFont%&&&&&&&&01NSMenu0±&0± &01 NSMenuItem0±&%Default0±&&&ÿ%01NSImage0±& % common_Nibble’%0±0±& % Icon & Text° &&ÿ%’%0±0±& % Icon Only° &&ÿ%’%0±0±& % Text Only° &&ÿ%’%&&&&&&%’0±&°&&& &&°°°%%%%%01 NSTextField% A C¦ B¦ A  B¦ A& 0± &%01NSTextFieldCell0 ±&%Show:0!±% A@° &&&&&&&& &&&&&&%’0"1NSColor0#±&%NSNamedColorSpace0$±&%System0%±&%textBackgroundColor0&±°#°$0'±& % textColor’0(±0)±& % NSScrollView ¿€ BD Cú BD&00*±% C1 C¦ C A€  C A€& 0+± &%0,±0-±&%Display in Small Size0.±0/1 NSMutableString&%common_SwitchOff° °-&&&&&&&&&&&&&&%’00±&01±&02±03± &%common_SwitchOn&&& &&04±% A C› C’€ A  C’€ A& 05± &%06±07±&%Drag items into the toolbar...08±% A@°7&&&&&&&& &&&&&&%’09±°#0:±&%System0;±&%textBackgroundColor0<±°#°:0=±& % textColor’0>±% CØ€ A  B` AÀ  B` AÀ&!0?± &%0@±0A±&%Done° °A&&&&&&&&&&&&&&%’0B±&0C±&&&& &&0D±% CØ€ C£ B` AÀ  B` AÀ& 0E± &%0F±0G±&%Reset° °G&&&&&&&&&&&&&&%’0H±&0I±&&&& &&0J±°#0K±&%System0L±&%windowBackgroundColor0M±&%Window0N±&%Customize Toolbar°N ?€ ?€ F@ F@%&   Dð D–0O± &0P± &0Q1!NSMutableDictionary1" NSDictionary&0R±&%GormCustomView1°(0S±&%NSOwner0T±&%GSToolbarCustomizationPalette0U±& % Button(1)°D0V±& % TextField°0W±& % MenuItem(0)°0X±&%View°0Y±&%GormNSPopUpButton° 0Z±&%Button°*0[±&%GormCustomView°0\±& % Button(0)°>0]±& % MenuItem1°0^±& % GormNSPanel°0_±& % TextField(0)°40`±& % MenuItem2°0a±&%MenuItem°0b± &0c1#NSNibConnector°^0d±&%NSOwner0e±#°X°^0f±#°[°X0g±#°Y°X0h±#°a0i±#°]0j±#°`0k±#°V°X0l±#°R°X0m±#°Z°X0n1$NSNibOutletConnector°d°[0o± &%_customizationView0p±$°d°^0q± &%_customizationWindow0r±$°d°Z0s± & % _sizeCheckBox0t±$°d°Y0u± & % _displayPopup0v±$°d°R0w± &%_defaultTemplateView0x±#°W0y1%NSNibControlConnector°Y°d0z± &%show:0{±#°_°X0|±#°\°X0}±#°U°X0~±%°\°^0± & % performClose:0€±%°U°d0±&%reset:0‚±%°Z°d0ƒ±&%size:0„±$°d°\0…± & % _doneButton0†±!&gnustep-gui-0.24.0/Panels/English.lproj/GSToolbarCustomizationPalette.gorm/data.classes0000664000076500007650000000104111161213407031071 0ustar brains99brains99{ "## Comment" = "Do NOT change this file, Gorm maintains it"; FirstResponder = { Actions = ( "size:", "reset:", "show:" ); Super = NSObject; }; GSToolbarCustomizationPalette = { Actions = ( "show:", "reset:", "size:" ); Outlets = ( _customizationWindow, _customizationView, _defaultTemplateView, _sizeCheckBox, _displayPopup, _doneButton ); Super = NSObject; }; GSToolbarCustomizationView = { Actions = ( ); Outlets = ( ); Super = NSView; }; }gnustep-gui-0.24.0/Panels/English.lproj/GSSpellPanel.gorm/0000775000076500007650000000000012256227330023140 5ustar brains99brains99gnustep-gui-0.24.0/Panels/English.lproj/GSSpellPanel.gorm/objects.gorm0000664000076500007650000001624411337627420025471 0ustar brains99brains99GNUstep archive00002e7f:0000002a:000000b1:0000000c:01GSNibContainer1NSObject01 GSMutableSet1 NSMutableSet1NSSet&01GSWindowTemplate1GSClassSwapper01NSString&%NSPanel1 NSPanel1 NSWindow1 NSResponder% @  @  C: C˜& % D€ D@01 NSView% @  @  C: C˜  C: C˜&01 NSMutableArray1NSArray&01NSBox% A CQ C& Bª  C& Bª& 0± &0 ± % @à @à C Bl  C Bl&0 ± &0 1 NSPopUpButton1NSButton1 NSControl% A Að C A¸  C A¸&0 ± &%0 1NSPopUpButtonCell1NSMenuItemCell1 NSButtonCell1 NSActionCell1NSCell0±&01NSFont% A@&&&&&&&&01NSMenu0±&0± &01 NSMenuItem0±&%English0±&&&ÿ%01NSImage0±& % common_Nibble’%&&&&&&%2 _switchDictionary:@12@0:4@80±&0±&&&& &&°°°%%%%%0±% A ?€ B€ AÀ  B€ AÀ&0±% Bž ?€ B| AÀ  B| AÀ&0±% A B$ B” AÐ  B” AÐ&0±% BÌ B$ B” AÐ  B” AÐ&0±% A A  B” AÐ  B” AÐ&0±% BÌ A  B” AÐ  B” AÐ&°0 ± &%0!±0"±&%Correct0#±%&&&&&&&&&&&&&&%2 _correct:@12@0:4@80$±&% 0%±&&&& &&°0&± &%0'±0(±& % Find Next°#&&&&&&&&&&&&&&%2 _findNext:@12@0:4@80)±&0*±&&&& &&°0+± &%0,±0-±&%Guess°#&&&&&&&&&&&&&&%2 _guess:@12@0:4@80.±&0/±&&&& &&°00± &%01±02±&%Ignore°&&&&&&&&&&&&&&%2 _ignore:@12@0:4@803±&04±&&&& &&°05± &%06±07±&%Forget°&&&&&&&&&&&&&&%2 _forget:@12@0:4@808±&09±&&&& &&0:± &%0;±0<±&%Learn°&&&&&&&&&&&&&&%2 _learn:@12@0:4@80=±&0>±&&&& &&°0?1NSTextFieldCell0@±& % Dictionary°&&&&&&&& &&&&&&%’0A1NSColor0B±&%NSNamedColorSpace0C±&%System0D±&%windowBackgroundColor0E±°B0F±&%System0G±& % textColor @  @ %%0H1 NSBrowser% A B¾ C& BÒ  C& BÒ&0I± &0J1 NSScrollView% @ C& Bœ  C& Bœ&0K± &0L1 NSClipView% A¨ @ C B”  C B”&0M± &0N1!NSMatrix%  C BÈ  C BÈ&0O± &%0P±0Q±&°#&&&&&&&&&&&&&&%’% C BÈ 0R±°B°C0S±&%controlBackgroundColor°R0T±& % NSBrowserCell0U1" NSBrowserCell0V±&°&&&&&&&&&&&&&&%%0W± &°H2doClick:2 doDoubleClick:’°R0X1# NSScroller% @ @ A B”  A B”&0Y± &%0Z±°V°&&&&&&&&&&&&&&&°J2 _doScroll:v12@0:4@8°L% A A A A °X%0[±"°V°&&&&&&&&&&&&&&°U0\±&%NSMatrix0]±&%/% BÈ0^±#% @ ?€ C" A  C" A&0_± &%0`±°V°&&&&&&&&&&&&&&&°H2  scrollViaScroller:v12@0:4@8   C& Bœ’2  _highlightGuess:@12@0:4@80a± &0b1$NSBrowserColumn°J°N%°]%%°°°°0c1% NSTextField% A B C& A¨  C& A¨&0d± &%0e±0f±&°#&&&&&&&& &&&&&&%’0g±°B°F0h±&%textBackgroundColor°E’°A0i±&%Window0j±&%Spelling°j ?€ A¨ F@ F@%0k±0l±&%NSApplicationIcon&   D€ D@0m± &0n± &0o1&NSMutableDictionary1' NSDictionary& 0p±&%Button2°0q±&%Button3°0r±&%Button4°0s±& % GormNSBrowser°H0t±&%NSOwner0u±&%NSSpellChecker0v±&%Button5°0w±& % TextField°c0x±&%GormNSPopUpButton° 0y±&%Button°0z±&%Box°0{±& % GormNSPanel°0|±&%Button1°0}±&%MenuItem°0~± &01(NSNibConnector°{0€±&%NSOwner0±(°z0‚±(°x0ƒ±(°y0„±(°|0…±(°s0†±(°p0‡±(°q°€0ˆ±(°r°€0‰±(°v°€0б(°}0‹1)NSNibOutletConnector°€°y0Œ±& % _learnButton01*NSNibControlConnector°|°€0ޱ&%_forget:0±*°p°€0±&%_ignore:0‘±*°q°€0’±&%_guess:0“±*°r°€0”±& % _findNext:0•±*°v°€0–±& % _correct:0—±*°x°€0˜±&%_switchDictionary:0™±*°s°€0š±&%_highlightGuess:0›±*°y°€0œ±&%_learn:0±)°€°r0ž±&%_findNextButton0Ÿ±)°€°q0 ±& % _guessButton0¡±)°€°p0¢±& % _ignoreButton0£±)°€°|0¤±& % _forgetButton0¥±(°w0¦±)°€°w0§±& % _wordField0¨±)°€°s0©±&%_accessoryView0ª±)°€°x0«±&%_dictionaryPulldown0¬±)°€°{0­±& % _spellPanel0®±&&gnustep-gui-0.24.0/Panels/English.lproj/GSSpellPanel.gorm/data.classes0000664000076500007650000000763110377004044025434 0ustar brains99brains99{ FirstResponder = { Actions = ( "activateContextHelpMode:", "alignCenter:", "alignJustified:", "alignLeft:", "alignRight:", "arrangeInFront:", "cancel:", "capitalizeWord:", "changeColor:", "changeFont:", "checkSpelling:", "close:", "complete:", "copy:", "copyFont:", "copyRuler:", "cut:", "delete:", "deleteBackward:", "deleteForward:", "deleteToBeginningOfLine:", "deleteToBeginningOfParagraph:", "deleteToEndOfLine:", "deleteToEndOfParagraph:", "deleteToMark:", "deleteWordBackward:", "deleteWordForward:", "deminiaturize:", "deselectAll:", "fax:", "hide:", "hideOtherApplications:", "indent:", "loosenKerning:", "lowerBaseline:", "lowercaseWord:", "makeKeyAndOrderFront:", "miniaturize:", "miniaturizeAll:", "moveBackward:", "moveBackwardAndModifySelection:", "moveDown:", "moveDownAndModifySelection:", "moveForward:", "moveForwardAndModifySelection:", "moveLeft:", "moveRight:", "moveToBeginningOfDocument:", "moveToBeginningOfLine:", "moveToBeginningOfParagraph:", "moveToEndOfDocument:", "moveToEndOfLine:", "moveToEndOfParagraph:", "moveUp:", "moveUpAndModifySelection:", "moveWordBackward:", "moveWordBackwardAndModifySelection:", "moveWordForward:", "moveWordForwardAndModifySelection:", "newDocument:", "ok:", "openDocument:", "orderBack:", "orderFront:", "orderFrontColorPanel:", "orderFrontDataLinkPanel:", "orderFrontFontPanel:", "orderFrontHelpPanel:", "orderFrontStandardAboutPanel:", "orderFrontStandardInfoPanel:", "orderOut:", "pageDown:", "pageUp:", "paste:", "pasteAsPlainText:", "pasteAsRichText:", "pasteFont:", "pasteRuler:", "performClose:", "performMiniaturize:", "performZoom:", "print:", "raiseBaseline:", "revertDocumentToSaved:", "runPageLayout:", "runToolbarCustomizationPalette:", "saveAllDocuments:", "saveDocument:", "saveDocumentAs:", "saveDocumentTo:", "scrollLineDown:", "scrollLineUp:", "scrollPageDown:", "scrollPageUp:", "scrollViaScroller:", "selectAll:", "selectLine:", "selectNextKeyView:", "selectParagraph:", "selectPreviousKeyView:", "selectText:", "selectText:", "selectToMark:", "selectWord:", "showContextHelp:", "showGuessPanel:", "showHelp:", "showWindow:", "stop:", "subscript:", "superscript:", "swapWithMark:", "takeDoubleValueFrom:", "takeFloatValueFrom:", "takeIntValueFrom:", "takeObjectValueFrom:", "takeStringValueFrom:", "terminate:", "tightenKerning:", "toggle:", "toggleContinuousSpellChecking:", "toggleRuler:", "toggleToolbarShown:", "toggleTraditionalCharacterShape:", "transpose:", "transposeWords:", "turnOffKerning:", "turnOffLigatures:", "underline:", "unhide:", "unhideAllApplications:", "unscript:", "uppercaseWord:", "useAllLigatures:", "useStandardKerning:", "useStandardLigatures:", "yank:", "zoom:", "_learn:", "_forget:", "_ignore:", "_guess:", "_findNext:", "_correct:", "_switchDictionary:", "_highlightGuess:" ); Super = NSObject; }; NSSpellChecker = { Actions = ( "_learn:", "_forget:", "_ignore:", "_guess:", "_findNext:", "_correct:", "_switchDictionary:", "_highlightGuess:" ); Outlets = ( _serverProxy, _wordField, _accessoryView, _dictionaryPulldown, _spellPanel, _learnButton, _forgetButton, _ignoreButton, _guessButton, _findNextButton ); Super = NSObject; }; }gnustep-gui-0.24.0/Panels/English.lproj/GSFindPanel.gorm/0000775000076500007650000000000012256227330022741 5ustar brains99brains99gnustep-gui-0.24.0/Panels/English.lproj/GSFindPanel.gorm/data.info0000664000076500007650000000027011425612374024531 0ustar brains99brains99GNUstep archive00002f45:00000003:00000003:00000000:01GormFilePrefsManager1NSObject% 01NSString&%Latest Version0±& % Typed Streamgnustep-gui-0.24.0/Panels/English.lproj/GSFindPanel.gorm/objects.gorm0000664000076500007650000001660311425612374025271 0ustar brains99brains99GNUstep archive00002f45:0000001f:000000c5:00000000:01GSNibContainer1NSObject01 NSMutableSet1NSSet&01GSWindowTemplate1GSClassSwapper01NSString&%NSPanel1NSPanel1 NSWindow1 NSResponder% ?€ A C× C$&% Bð D)@01 NSView% ?€ A C× C$  C× C$&01 NSMutableArray1 NSArray&  01NSButton1 NSControl% A A  B  AÀ  B  AÀ&0± &%0 1 NSButtonCell1 NSActionCell1NSCell0 ±& % Replace All0 1NSFont%&&&&&&&&&&&&&&%’0 ±&0 ±&&&& &&0±% B¾ A  B| AÀ  B| AÀ&0± &%0±0±&%Replace° &&&&&&&&&&&&&&%’0±&0±&&&& &&0±% C# A  BÌ AÀ  BÌ AÀ&0± &%0±0±&%Replace & Find° &&&&&&&&&&&&&&%’0±&0±&&&& &&0±% C A  B„ AÀ  B„ AÀ&0± &%0±0±&%Previous° &&&&&&&&&&&&&&%’0±&0±&&&& &&0 ±% C°€ A  B„ AÀ  B„ AÀ&0!± &%0"±0#±&%Next0$1NSImage0%±& % common_ret° &&&&&&&&&&&&&&%’0&±&% 0'±&0(±0)±& % common_retH&&& &&0*1 NSTextField% A C B  A  B  A&0+± &%0,1NSTextFieldCell0-±&%Find:0.±% A@°-&&&&&&&& &&&&&&%’0/1NSColor00±&%NSNamedColorSpace01±&%System02±&%textBackgroundColor03±°0°104±& % textColor’05±% A BÖ B  A  B  A&06± &%07±08±& % Replace with:°.°8&&&&&&&& &&&&&&%’°/°3’09±% B¾ C C¢ A¨  C¢ A¨&0:± &%0;±0<±&° °<&&&&&&&& &&&&&&%’°/°3’0=±% B¾ BÖ C¢ A¨  C¢ A¨&0>± &%0?±0@±&° °@&&&&&&&& &&&&&&%’°/°3’0A±% A B B  BX  B  BX&0B± &%0C±0D±&%Message Area (dynamic contents)°.°D&&&&&&&& &&&&&&%’°/°3’0E1NSBox% B¾ B C B|  C B|&0F± &0G± % @à @à C B  C B&0H± &0I1NSMatrix% A¸  BÈ B  BÈ B&0J± &%0K±0L±&° &&&&&&&&&&&&&&%’% BÈ A ?€ ?€0M±& % NSButtonCell0N±0O±&%Radio0P±0Q1NSMutableString&%common_RadioOff&&&&&&&&&&&&&&%’0R±&0S±0T±&%common_RadioOn&&& &&%%0U± &0V±0W±& % Entire File°P&&&&&&&&&&&&&&%’0X±&°S&&& &&0Y±0Z±& % Selection°P&&&&&&&&&&&&&&%’0[±&°S&&& &&’’’°V0\±0]±&%Replace All Scope° °]&&&&&&&&&&&&&& @  @ %%0^±% C~ B C% B|  C% B|&0_± &0`± % @à @à C B  C B&0a± &0b±% AÈ A¨ BÄ A€  BÄ A€&0c± &%0d±0e±& % Ignore Case0f±0g±&%common_SwitchOff° &&&&&&&&&&&&&&%’0h±&0i±&0j±0k±&%common_SwitchOn&&& &&0l±0m±& % Find Options° °m&&&&&&&&&&&&&& @  @ %%0n±°00o±&%System0p±&%windowBackgroundColor0q±&%Window0r±&%Find°r @@ B F@ F@%&   D D@0s± &0t± &0u1NSMutableDictionary1 NSDictionary&0v±& % Button(4)° 0w±& % TextField(0)°*0x±& % FindPanel°0y±&%NSOwner0z±& % GSTextFinder0{±&%View(1)°G0|±& % TextField(2)°90}±& % ButtonCell(1)°Y0~±& % TextField(4)°A0±& % Button(1)°0€±&%Box(0)°E0±& % Button(3)°0‚±&%View(0)°0ƒ±& % Button(5)°b0„±& % TextField(1)°50…±&%View(2)°`0†±& % Matrix(0)°I0‡±& % TextField(3)°=0ˆ±& % Button(0)°0‰±& % ButtonCell(0)°V0б& % Button(2)°0‹±&%Box(1)°^0Œ± &))01NSNibConnector°x°y0ޱ°‚°x0±°ˆ°‚0±°°‚0‘±°Š°‚0’±°°‚0“±°v°‚0”±°w°‚0•±°„°‚0–±°|°‚0—±°‡°‚0˜±°~°‚0™±°†°€0š±°‰°†0›±°}°†0œ±°€°‚0±°{°€0ž±°ƒ°‹0Ÿ±°‹°‚0 ±°…°‹0¡1NSNibOutletConnector°y°|0¢±&%findText0£±°y°‡0¤±& % replaceText0¥±°y°~0¦±& % messageText0§±°y°†0¨±&%replaceScopeMatrix0©±°y°ƒ0ª±&%ignoreCaseButton0«±°x°|0¬±&%initialFirstResponder0­±°|°‡0®±& % nextKeyView0¯±°‡°†°®0°±°†°ƒ°®0±±°ˆ°°®0²±°°Š°®0³±°Š°°®0´±°°v°®0µ±°v°|°®0¶±°y°x0·±&%panel0¸±°ƒ°ˆ°®0¹1NSNibControlConnector°ˆ°y0º±& % replaceAll:0»±°v°y0¼±& % findNext:0½±°°y0¾±& % findPrevious:0¿±°Š°y0À±&%replaceAndFind:0Á±°°y0±&%replace:0ñ&gnustep-gui-0.24.0/Panels/English.lproj/GSFindPanel.gorm/data.classes0000664000076500007650000000101511425612374025231 0ustar brains99brains99{ "## Comment" = "Do NOT change this file, Gorm maintains it"; FirstResponder = { Actions = ( "findNext:", "findPrevious:", "replace:", "replaceAll:", "replaceAndFind:" ); Super = NSObject; }; GSTextFinder = { Actions = ( "replaceAll:", "findNext:", "findPrevious:", "replace:", "replaceAndFind:" ); Outlets = ( findText, ignoreCaseButton, messageText, panel, replaceScopeMatrix, replaceText ); Super = NSObject; }; }gnustep-gui-0.24.0/Panels/English.lproj/GSPageLayout.gorm/0000775000076500007650000000000012256227330023153 5ustar brains99brains99gnustep-gui-0.24.0/Panels/English.lproj/GSPageLayout.gorm/data.info0000664000076500007650000000027012226664452024747 0ustar brains99brains99GNUstep archive000f4240:00000003:00000003:00000000:01GormFilePrefsManager1NSObject%01NSString&%Latest Version0±& % Typed Streamgnustep-gui-0.24.0/Panels/English.lproj/GSPageLayout.gorm/objects.gorm0000664000076500007650000010130512226664452025501 0ustar brains99brains99GNUstep archive000f4240:00000032:000002d2:00000001:01GSNibContainer1NSObject01 NSMutableSet1NSSet&01GSWindowTemplate1GSClassSwapper01NSString& % NSPageLayout1NSPanel1 NSWindow1 NSResponder% ?ð @" @s° @ƒhJI @~0 @‰01 NSView% ?ð @" @s° @ƒh  @s° @ƒhJ01 NSMutableArray1 NSArray&01 NSTabView% @$ @C€ @rP @@  @rP @@J0± &0 ± % ?ð @2 @r @~  @r @~J0 1NSBox% @& @z€ @pà @H  @pà @HJ0 ± % @ @ @p @5  @p @5J0 1 NSPopUpButton1NSButton1 NSControl%  @p @4  @p @4J0 ±% @& @u  @pà @R@  @pà @R@J0± % @ @ @p @G  @p @GJ0±% @U@ @9 @e` @4  @e` @4J01NSMatrix%  @U@ @F€  @U@ @F€J0±% @U@  @e` @4  @e` @4J0±% @$ @n` @pà @X€  @pà @X€J0± % @ @ @p @QÀ  @p @QÀJ0±%  @p @Q€  @p @Q€J01 NSTextField% @$ @k€ @pà @2  @pà @2J0±% @$ @O€ @pà @c   @pà @c J0± % @ @ @p @`@  @p @`@J01 GSCustomView1 GSNibItem0±&%GSPageLayoutMiniPageView @O€  @` @` &°0± &°°0± &°01NSCell0±&%Preview01NSFont%&&&&&&JJ&&&&&& @ @%%°0± &%0 1NSTextFieldCell1 NSActionCell0!±& % Dimensions0"±% A@&&&&&&JJ &&&&&&I’0#1NSColor0$±&% NSNamedColorSpace0%±&%System0&±&%textBackgroundColor0'±°$°%0(±& % textColor’°0)± &%0*±0+±&°&&&&&&JJ&&&&&&I’% @` @Q€ 0,±°$0-±&% System0.±&% controlBackgroundColor°,0/±& % NSButtonCell001 NSButtonCell01±&%Button°&&&&&&JJ&&&&&&I’02±&03±&&&& &&%%04± &05±06±&%Portrait071NSImage08±& % page_portrait°"&&&&&&JJ&&&&&&I’09±&°3&&& &&0:±0;±& % Landscape0<±0=±&%page_landscape°"&&&&&&JJ&&&&&&I’0>±&°3&&& &&’’’°:°0?± &°°0@± &°0A±0B±&%Paper Orientation°&&&&&&JJ&&&&&& @ @%%°0C± &%0D1NSPopUpButtonCell1NSMenuItemCell0E±&°&&&&&&JJ0F1 NSMenu0G±&0H± &0I1! NSMenuItem0J±&0K±&JJÿI0L±0M±& %  common_Nibble’I0N±!0O±&°KJJÿI’I0P±!0Q±&°KJJÿI’I&&&&&&I’0R±&0S±&&&& &&°I°F%%%%%°0T± &%0U±0V±&°&&&&&&JJ&&&&&&I’% @U@ @4 @°,°,0W±& % NSButtonCell0X±0Y±&%Radio0Z±0[1"NSMutableString&%GSRadio°&&&&&&JJ&&&&&&I’0\±&0]±&0^±0_±"&%GSRadioSelected&&& &&%%0`± &0a±0b±& % Standard:°Z°&&&&&&JJ&&&&&&I’0c±&°]°^&&& &&0d±0e±&%Custom:°Z°&&&&&&JJ&&&&&&I’0f±&°]°^&&& &&’’’°a°0g± &%0h±0i±&°&&&&&&JJ0j± 0k±&0l± &0m±!0n±&%Item 10o±&JJÿI°L’I0p±!0q±&%Item 2°oJJÿI’I0r±!0s±&%Item 3°oJJÿI’I&&&&&&I’0t±&0u±&&&& &&°m°j%%%%%° 0v± &°°°° 0w± &°0x±0y±& % Paper Size°&&&&&&JJ&&&&&& @ @%%° 0z± &%0{±0|±&°&&&&&&JJ0}± 0~±&0± &0€±!0±&%Item 10‚±&JJÿI°L’I0ƒ±!0„±&%Item 2°‚JJÿI’I0…±!0†±&%Item 3°‚JJÿI’I&&&&&&I’0‡±&0ˆ±&&&& &&°€°}%%%%%° 0‰± &° ° 0б &° 0‹±0Œ±&%Format For Printer Named°&&&&&&JJ&&&&&& @ @%%0± &0ޱ% @$ @$ @pà @H  @pà @HJ0± % @ @ @p @5  @p @5J0±% @Y@  @I @5  @I @5J0‘±% @bà  @. @5  @. @5J° °0’± &%0“±0”±&%%0•±% A`&&&&&&JJ &&&&&&I’°#°'’°0–± &% 0—±0˜±&°&&&&&&JJ &&&&&&I’°#°'’°Ž0™± &°°‘°0š± &°0›±0œ±&%Scale°&&&&&&JJ&&&&&& @ @%%°°° °° 0± &0ž1# NSTabViewItem0Ÿ±& % attributes0 ±&%Page Attributes° %° °0¡±#0¢±&%custom0£±&%Custom Paper Size0¤± % ?ð @2 @r @~  @r @~J0¥±% @$ @t° @pà @a€  @pà @a€J0¦± % @ @ @p @\@  @p @\@J0§1$ NSScrollView%  @g @[À  @g @[ÀJ0¨1%GSTableCornerView% @ @ @3 @6  @3 @6J0©1& NSClipView% @5 @ @d @6  @d @6J0ª1'NSTableHeaderView%  @d @6  @d @6J0«1( NSScroller% @ @8 @2 @U@  @2 @U@J0¬±&% @5 @8 @d @P€  @d @P€J0­1) NSTableView%  @d @d   @d @d J0®±(% @5 @VÀ @d @2  @d @2J0¯±% @g  @UÀ @PÀ @8  @PÀ @8J0°±% @g  @M @PÀ @8  @PÀ @8J0±±% @g  @= @PÀ @8  @PÀ @8J0²±% @g   @PÀ @8  @PÀ @8J0³±% @$ @q` @pà @H  @pà @HJ0´± % @ @ @p @5  @p @5J0µ±%  @I @5  @I @5J0¶±% @K€  @D @5  @D @5J0·±% @WÀ  @4 @5  @4 @5J0¸±% @a  @I @5  @I @5J0¹±% @gà  @D @5  @D @5J0º±% @là  @4 @5  @4 @5J0»±% @$ @hà @pà @R€  @pà @R€J0¼± % @ @ @p @G€  @p @G€J0½±% @: @I @5  @I @5J0¾±% @K€ @: @D @5  @D @5J0¿±% @WÀ @: @4 @5  @4 @5J0À±% @a @: @I @5  @I @5J0Á±% @gà @: @D @5  @D @5J0±% @là @: @4 @5  @4 @5J0ñ%  @I @5  @I @5J0ı% @K€  @D @5  @D @5J0ű% @WÀ  @4 @5  @4 @5J0Ʊ% @a  @I @5  @I @5J0DZ% @gà  @D @5  @D @5J0ȱ% @là  @4 @5  @4 @5J0ɱ% @$ @  @pà @g@  @pà @g@J0ʱ % @ @ @p @cà  @p @càJ0˱0̱&%GSPageLayoutMiniPageView @G  @cà @cà&°É0ͱ &°Ë°È0α &°Ê0ϱ0б&%Preview°&&&&&&JJ&&&&&& @ @%%°Ç0ѱ &%i0Ò±0Ó±&%un°"&&&&&&JJ &&&&&&I’°#°'’°Æ0Ô± &%0Õ±0Ö±&°&&&&&&JJ &&&&&&I’°#°'’°Å0×± &%0ر0Ù±&%Right:°"&&&&&&JJ &&&&&&I’°#°'’°Ä0Ú± &%h0Û±0ܱ&%un°"&&&&&&JJ &&&&&&I’°#°'’°Ã0ݱ &%0Þ±0ß±&°&&&&&&JJ &&&&&&I’°#°'’°Â0à± &%0á±0â±&%Left:°"&&&&&&JJ &&&&&&I’°#°'’°Á0ã± &%g0ä±0å±&%un°"&&&&&&JJ &&&&&&I’°#°'’°À0æ± &%0ç±0è±&°&&&&&&JJ &&&&&&I’°#°'’°¿0é± &%0ê±0ë±&%Bottom:°"&&&&&&JJ &&&&&&I’°#°'’°¾0ì± &%f0í±0î±&%un°"&&&&&&JJ &&&&&&I’°#°'’°½0ï± &%0ð±0ñ±&°&&&&&&JJ &&&&&&I’°#°'’°¼0ò± &%0ó±0ô±&%Top:°"&&&&&&JJ &&&&&&I’°#°'’°»0õ± &  °À°½°Ã°Æ°¾°¿°Á°Â°Ä°Å°Ç°È°º0ö± &°¼0÷±0ø±&%Printer Margins°&&&&&&JJ&&&&&& @ @%%°¹0ù± &%e0ú±0û±&%un°"&&&&&&JJ &&&&&&I’°#°'’°¸0ü± &%0ý±0þ±&°&&&&&&JJ &&&&&&I’°#°'’°·0ÿ± &%P±P±&%Height:°"&&&&&&JJ &&&&&&I’°#°'’°¶P± &%dP±P±&%un°"&&&&&&JJ &&&&&&I’°#°'’°µP± &%P±P±&°&&&&&&JJ &&&&&&I’°#°'’°´P± &%P ±P ±&%Width:°"&&&&&&JJ &&&&&&I’°#°'’°³P ± &°¸°µ°¹°¶°º°·°²P ± &°´P ±P±& % Paper Size°&&&&&&JJ&&&&&& @ @%%°±P± &%ËP±P±&%Save°&&&&&&JJ&&&&&&I’P±&P±&&&& &&°°P± &%ÊP±P±&%Delete°&&&&&&JJ&&&&&&I’P±&P±&&&& &&°¯P± &%ÉP±P±& % Duplicate°&&&&&&JJ&&&&&&I’P±&P±&&&& &&°®P± &%ÈP±P ±&%New°&&&&&&JJ&&&&&&I’P!±&P"±&&&& &&°­P#± &%P$±P%±&°&&&&&&JJ&&&&&&J°§2 _doScroll:v24@0:8@16°¬P&± &%P'±P(±&°&&&&&&JJ&&&&&&P)± &P*1* NSTableColumnP+±&%column1 C! C! C!P,1+NSTableHeaderCellP-±& %  Paper NameP.±% &&&&&&JJ &&&&&&I’P/±°$°-P0±&% controlShadowColorP1±°$°-P2±&% windowFrameTextColorP3±P4±&%quatre°Ð4&&&&&&JJ &&&&&&I’°#°'P5±°$°-P6±& %  gridColorP7±P8±&% NSCalibratedWhiteColorSpace ?€ ?€°ª°¨%% A€’ @ @P9± &°«P:± &°­P;±Ð8 ?€ ?€°ªP<± &%P=±Ð(°&&&&&&JJ&&&&&&J°§²°©P>± &°¨P?± &°ªP@±°$°-PA±& %  controlColor°§PB± &°¦PC± &°¬°«°©°®°¨°¬I A A A A °®°«°©°¥PD± &°§°¯°°°±°²°¤PE± &°¦PF±PG±&%Custom Paper Names°&&&&&&JJ&&&&&& @ @%%PH± &°¥°³°»°É%°¤°PI±#PJ±&%summaryPK±&%SummaryPL± % ?ð @2 @r @~  @r @~JPM±$% @$ @$ @pð @|Ð  @pð @|ÐJPN±%% @ @ @3 @6  @3 @6JPO±&% @5 @ @o @6  @o @6JPP±'%  @o @6  @o @6JPQ±(% @ @8 @2 @{0  @2 @{0JPR±&% @5 @8 @o @z  @o @zJPS±)%  @o @z  @o @zJPT±(% @5 @{ @o @2  @o @2JÐLÐSPU± &%PV±PW±&°&&&&&&JJ&&&&&&JÐM²ÐRPX± &%PY±PZ±&°&&&&&&JJ&&&&&&P[± &P\±*P]±&%column1 BP A  GÃPP^±+P_±&%SettingÐ.&&&&&&JJ &&&&&&I’Ð/Ð1P`±Pa±&%neuf°Ða&&&&&&JJ &&&&&&I’°#°'Pb±*Pc±&%column2 CD A  GÃPPd±+Pe±&%ValueÐ.&&&&&&JJ &&&&&&I’Ð/Ð1Pf±Pg±&%nine°Ðg&&&&&&JJ &&&&&&I’°#°'Ð5°,ÐPÐN%% A€’ @ @Ph± &ÐQPi± &ÐS°,ÐPPj± &%Pk±ÐZ°&&&&&&JJ&&&&&&JÐM²ÐOPl± &ÐNPm± &ÐPÐ@ÐMPn± &ÐLPo± &ÐRÐQÐOÐTÐNÐRI A A A A ÐTÐQÐOÐTPp± &ÐM%ÐL°°%JPq1, NSImageView% @$ @8 @J @J  @J @JJPr± &%Ps1- NSImageCellPt±Pu±&% NSApplicationIcon°&&&&&&JJ&&&&&&%%% @H @H’Pv±% @PÀ @8 @i @J  @i @JJPw± &%Px±Py±& % Page LayoutPz±% A&&&&&&JJ &&&&&&I’°#°'’P{±% ÀqÐ @ @‚À @  @‚À @JP|± &P}± % @ @ @‚P   @‚P JP~± &P±P€±&%Box°&&&&&&JJ &&&&&&I’P±°$°-P‚±&% windowBackgroundColor°' @ @%%Pƒ±% @lÀ @$ @RÀ @8  @RÀ @8JP„± &% P…±P†±&%OKP‡±Pˆ±& %  common_ret°&&&&&&JJ&&&&&&I’P‰±&%  Pб&&&& &&P‹±% @bÀ @$ @RÀ @8  @RÀ @8JPŒ± &%P±Pޱ&%Cancel°&&&&&&JJ&&&&&&I’P±&P±&&&& &&ÐP‘±&%WindowP’±&Ð’ @sÐ @ƒØ @È @ÈIÐt&  @” @‰P“± &P”± &P•1.NSMutableDictionary1/ NSDictionary&PP–±&%Box9°P—±&%View2Ð}P˜±& % TextField10°P™±& % TableColumn1Pš±*P›±&%column2 BÚ A  GÃPPœ±+P±&% Ð.&&&&&&JJ &&&&&&I’Ð@Ð1Pž±PŸ±&%five°ÐŸ&&&&&&JJ &&&&&&I’°#°'P ±& % TextField26°ÄP¡±& % MenuItem3P¢±!P£±&%Item 1P¤±&JJÿI°L’IP¥±&%GormNSPopUpButton3°P¦±& % TextField7ÐvP§±& % MenuItem11P¨±!P©±& % CentimetersPª±&JJÿI’IP«±&%Button7ЋP¬±&%MenuItemP­±!P®±&%EmptyP¯±&JJÿI°L’IP°±& % TextField13°µP±±& % TableColumn4P²±*P³±&%actions C A  GÃPP´±+Pµ±&% Ð.&&&&&&JJ &&&&&&I’Ð@Ð1P¶±P·±&%0°Ð·&&&&&&JJ &&&&&&I’°#°'P¸±& % TextField29°ÈP¹±& % MenuItem6Pº±!P»±& % 2 per pageP¼±&JJÿI’IP½±&%Box11°¥P¾±& % TextField21°ÆP¿±& % MenuItem14°IPÀ±& % TextField16°ºPÁ±&%Button2°¯P±&%Box7° Pñ& % MenuItem9Pı!Pű&%PointsЪJJÿI°L’IPƱ&%TabView°PDZ& % TextField24°ÁPȱ& % MenuItem1Pɱ!Pʱ&%Item 2P˱&JJÿI’IP̱&%Matrix2°Pͱ& % ScrollView1ÐMPα& % TextField19°½Pϱ&%Button5°²Pб&%GormCustomView2°ËPѱ& % TextField11°‘PÒ±&%View3PÓ± % @ @ @\ @;  @\ @;JPÔ± &PÕ±& % TextField27°ÅPÖ±&%Box2Ð{P×±& % TableColumn2Pر*PÙ±&%classes BP A  GÃPPÚ±+PÛ±&%ItemÐ.&&&&&&JJ &&&&&&I’Ð/Ð1PܱPݱ&%NSObject°ÐÝ&&&&&&JJ &&&&&&I’°#°'PÞ±&%GormNSPopUpButton4°Pß±& % MenuItem4Pà±!Pá±&%Item 2ФJJÿI’IPâ±&%Box° Pã±& % MenuItem12Pä±!På±&%InchesPæ±&JJÿI’IPç±& % TextField14°¹Pè±& % TableColumn5Ð\Pé±& % ImageView1ÐqPê±& % ScrollView°§Pë±&%Box5°Pì±& % MenuItem7Pí±!Pî±& % 4 per pageмJJÿI’IPï±& % TextField22°¾Pð±&%Box12°³Pñ±& % MenuItem15°NPò±& % TextField17°·Pó±&%Button3°°Pô±&%Box8°ÉPõ±&%View1Pö± % @ @ @\ @;  @\ @;JP÷± &Pø±& % TextField25°ÂPù±&%GormNSPopUpButton° Pú±& % MenuItem2Pû±!Pü±&%Item 3ÐËJJÿI’IPý±&%GormNSTableView°­Pþ±& % MenuItem10Pÿ±!P±& % MillimetersЪJJÿI’IP±&%Button6ЃP±& % TextField12°¸P±&%GormNSTableView1ÐSP±& % TableColumn3P±*P±&%outlets CC A  GÃPP±+P±& % DescriptionÐ.&&&&&&JJ &&&&&&I’Ð/Ð1P ±P ±&%0°Ð &&&&&&JJ &&&&&&I’°#°'P ±& % TextField28°ÇP ±& % MenuItem5P ±!P±& % 1 per pageмJJÿI°L’IP±&%Box10°ŽP±& % TextField20°ÃP±& % TextField9°P±& % MenuItem13P±!P±&%Item 3ФJJÿI’IP±&% NSOwnerP±&%GSPageLayoutControllerP±& % TextField15°¶P±& % TableColumn6ÐbP±& % MenuItem8P±!P±& % 16 per pageP±&JJÿI’IP±& % TableColumnÐ*P±&%Box13°»P±& % TextField23°¿P ±&%Matrix1°P!±& % GormNSPanel1°P"±& % MenuItem16°PP#±&%Button4°±P$±&%GormCustomView1°P%±& % TextField18°ÀP&± &P'10NSNibConnectorÐõP(±&% NSOwnerP)±0ÐÒÐ(P*±0ÐÈP+±0ÐúP,±0ЬP-±0Ð P.±0йP/±0ÐìP0±0ÐP1±0ÐÃP2±0ÐþP3±0ЧP4±0ÐãP5±0Ð!Ð(P6±0ÐÆP7±0ÐéÐ(P8±0ЦÐ(P9±0ÐÖÐ(P:±0ЗÐ(P;±0СP<±0ÐßP=±0ÐP>±0Ð¥P?±0ÐP@±0Ð Ð(PA±0ИPB±0ÐÑPC±0ÐPD±0ÐêPE±0ÐýPF±0ÐPG±0ЙPH±0ÐÁPI±0ÐóPJ±0Ð#PK±0ÐÏPL±0нPM±0ÐPN±0аPO±0ÐçPP±0ÐPQ±0ÐÀPR±0ÐòPS±0ÐðPT±0Ð%PU±0ÐÎPV±0ÐPW±0оPX±0ÐïPY±0ÐPZ±0ÐÇP[±0ÐøP\±0РP]±0ÐÕP^±0Ð P_±0иP`±0ÐPa±0Ð$Pb±0ÐëPc±0ÐÐPd±0ÐôPe±0Ð×Pf±0ÐPg±0бPh±0ÐÐ(Pi±0ЫÐ(Pj±0ÐÌPk±0ÐÞPl±0ÐÂPm±0ЖPn±0ÐÍPo±0ÐPp±0ÐèPq±0ÐPr11NSNibOutletConnectorÐ(Ð!Ps±&%panelPt±1Ð(ÐÌPu±"&%paperRadioMatrixPv±1Ð(Ð¥Pw±"&%standardPaperSizePopUpPx±1Ð(ÐÞPy±"&%customPaperSizePopUpPz±1Ð(Ð P{±"&%paperOrientationMatrixP|±1Ð(Ð$P}±"&%paperAttributesPreviewP~±1Ð(ИP±"&%scaleTextFieldP€±1Ð(ÐýP±"&%customPaperTableViewP‚±1Ð(ÐPƒ±"&%customPaperWidthTextFieldP„±1Ð(ÐÇP…±"& % customPaperMarginBottomTextFieldP†±1Ð(ÐçP‡±"&%customPaperHeightTextFieldPˆ±1Ð(ÐïP‰±"&%customPaperMarginTopTextFieldPб1Ð(РP‹±"&%customPaperMarginLeftTextFieldPŒ±1Ð(Ð P±"&%customPaperMarginRightTextFieldPޱ1Ð(ÐÐP±"&%customPaperPreviewP±1Ð(ÐP‘±"&%summaryTableViewP’±1Ð(ÐÁP“±&%newCustomPaperButtonP”±1Ð(ÐóP•±"&%duplicateCustomPaperButtonP–±1Ð(Ð#P—±"&%deleteCustomPaperButtonP˜±1Ð(ÐÏP™±"&%saveCustomPaperButtonPš±1Ð(ÐéP›±&%applicationImageButtonPœ±1Ð(ЦP±&%panelTitleFieldPž±1Ð(ÐPŸ±"&%dimensionsTextFieldP ±1ÐýÐ(P¡±"& % dataSourceP¢±1ÐÐ(СP£±1Ð(ÐP¤±&%customPaperNameColumnP¥±1Ð(ÐèP¦±&%summarySettingColumnP§±1Ð(ÐP¨±&%summaryValueColumnP©12NSNibControlConnectorЫÐ(Pª±&%cancelButtonClicked:P«±2ÐÐ(P¬±&%okButtonClicked:P­±2ÐÁÐ(P®±&%customPaperButtonsClicked:P¯±2ÐóÐ(ЮP°±2Ð#Ð(ЮP±±2ÐÏÐ(ЮP²±2ÐÌÐ(P³±&%paperRadioMatrixClicked:P´±1ИÐ(Pµ±"&%delegateP¶±1ÐÐ(еP·±1ÐçÐ(еP¸±1ÐïÐ(еP¹±1РÐ(еPº±0ÐùP»±0ÐâP¼±1Ð(ÐùP½±& % printerPopUpP¾±2ÐùÐ(P¿±&%printerPopUpClicked:PÀ±2Ð¥Ð(PÁ±&%paperPopUpClicked:P±2ÐÞÐ(ÐÁPñ2Ð Ð(Pı&%paperOrientationMatrixClicked:Pű1Ð!Ð(PƱ"& % _controllerPDZ1Ð(ÐÆPȱ&%tabViewPɱ1ÐÆÐ(Pʱ"&%delegateP˱0пP̱0ÐñPͱ0Ð"Pα.&Ð!°gnustep-gui-0.24.0/Panels/English.lproj/GSPageLayout.gorm/data.classes0000664000076500007650000000355610571075053025455 0ustar brains99brains99{ "## Comment" = "Do NOT change this file, Gorm maintains it"; FirstResponder = { Actions = ( "orderFrontFontPanel:", "_pickedButton:", "pickedOrientation:", "_pickedPaper:", "pickedUnits:", "pickedButton:", "pickedPaperSize:", "okButtonClicked:", "cancelButtonClicked:", "customPaperButtonsClicked:", "paperRadioMatrixClicked:", "printerPopUpClicked:", "paperPopUpClicked:", "paperOrientationMatrixClicked:" ); Super = NSObject; }; GSPageLayoutController = { Actions = ( "okButtonClicked:", "cancelButtonClicked:", "customPaperButtonsClicked:", "paperRadioMatrixClicked:", "printerPopUpClicked:", "paperPopUpClicked:", "paperOrientationMatrixClicked:" ); Outlets = ( panel, paperRadioMatrix, standardPaperSizePopUp, customPaperSizePopUp, dimensionsTextField, paperOrientationMatrix, paperAttributesPreview, scaleTextField, customPaperTableView, customPaperWidthTextField, customPaperHeightTextField, customPaperMarginTopTextField, customPaperMarginBottomTextField, customPaperMarginRightTextField, customPaperMarginLeftTextField, customPaperPreview, summaryTableView, newCustomPaperButton, duplicateCustomPaperButton, deleteCustomPaperButton, saveCustomPaperButton, applicationImageButton, panelTitleField, customPaperNameColumn, summarySettingColumn, summaryValueColumn, printerPopUp, tabView ); Super = NSObject; }; GSPageLayoutMiniPageView = { Actions = ( ); Outlets = ( _pageLayoutController ); Super = NSView; }; NSPageLayout = { Actions = ( "pickedButton:", "pickedOrientation:", "pickedPaperSize:", "pickedUnits:" ); Outlets = ( _controller ); Super = NSPanel; }; }gnustep-gui-0.24.0/Panels/English.lproj/GSDataLinkPanel.gorm/0000775000076500007650000000000012256227330023550 5ustar brains99brains99gnustep-gui-0.24.0/Panels/English.lproj/GSDataLinkPanel.gorm/data.info0000664000076500007650000000027010120747755025343 0ustar brains99brains99GNUstep archive00002af8:00000003:00000003:00000000:01GormFilePrefsManager1NSObject%01NSString&%Latest Version0±& % Typed Streamgnustep-gui-0.24.0/Panels/English.lproj/GSDataLinkPanel.gorm/objects.gorm0000664000076500007650000006466010120747755026111 0ustar brains99brains99GNUstep archive00002af8:00000028:000000c7:00000005:01GSNibContainer1NSObject01NSMutableDictionary1 NSDictionary&01NSString&% Button201NSButton1 NSControl1NSView1 NSResponder% C= B¢ B¬ B–  B¬ B–&01 NSMutableArray1 NSArray&%01 NSButtonCell1 NSActionCell1NSCell0±& % Break Link01NSImage A€ A€0 1NSColor0 ±&%NSCalibratedWhiteColorSpace 0 ± &0 1NSBitmapImageRep1 NSImageRep0 ±&%NSDeviceRGBColorSpace A€ A€%%%01 NSDataMalloc1 NSDataStatic1NSData&ššII*ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ þÿ’R01NSFont% A &&&&&&&&%2 pickedBreakLink:v12@0:4@80±&0±&&&&0±&% Button30±% CŒ B¢ B¬ B–  B¬ B–&0± &%0± 0±& % Break All0± A€ A€° 0± &0±°  A€ A€%%%0±&II*têÿþÿþÿþÿþÿþÿíòÿþèÿþÿþÿõöÿþàÿþÿþÿùúÿþôÿþÿþÿþÿþôÿþÿþÿýúøÿþÿþÿòðÿþÿýþôÿþÿòèÿþÿþøÿþÿòôÿþÿþøÿþÿþøÿþÿöôÿþÿúøÿþÿþøÿþÿúôÿþÿöøÿþÿþøÿþÿþôÿþÿòøÿþÿþèÿþÿòôÿþÿúðÿþÿòÿþøÿþÿýúÿþôÿþÿþÿþÿþôÿþÿþÿýöÿþàÿþÿþÿùòÿþèÿþÿþÿõêÿþÿþÿþÿþÿþÿí þÿþ€lR°&&&&&&&&%2 pickedBreakAllLinks:v12@0:4@80±&0±&&&&0±&%NSOwner0±&%GSDataLinkPanelController0±& %  TextField10 1 NSTextField% B| C! CŠ€ A˜  CŠ€ A˜&0!± &%0"1NSTextFieldCell0#±&0$±% AP&&&&&&&&%’0%±0&±&%NSNamedColorSpace0'±&%System0(±&%textBackgroundColor0)±°&°'0*±& % textColor’0+±& %  TextField20,±% C Aˆ B¬ A  B¬ A&0-± &%0.±0/±& % Last Update:00±% A@&&&&&&&&%’01±°&02±&%System03±&%textBackgroundColor04±°&°205±& % textColor’06±& % TextField07±% C! B| A˜  B| A˜&08± &%09±0:±&%Source:°$&&&&&&&&%’0;±°&0<±&%System0=±&%textBackgroundColor0>±°&°<0?±& % textColor’0@±& %  TextField30A±% Ck Aˆ B¦ A  B¦ A&0B± &%0C±0D±&°0&&&&&&&&%’0E±°&0F±&%System0G±&%textBackgroundColor0H±°&°F0I±& % textColor’0J±&%GSCustomClassMap0K±&0L±& % GormNSPanel0M±&%NSDataLinkPanel0N±&%GormNSPopUpButton0O1 NSPopUpButton% A A  C AÈ  C AÈ&0P± &%0Q1NSPopUpButtonCell1NSMenuItemCell0R±&%Button°0&&&&&&&&0S1NSMenu0T±&0U± &0V1 NSMenuItem0W±&%Never0X±&&&ÿ%’%0Y±0Z±&%Manually0[±&&&ÿ%0\±0]±& % common_Nibble’%0^±0_±&%When Source Saved°[&&ÿ%’%0`±0a±& % Continually°[&&ÿ%’%%2 pickedUpdateMode:v12@0:4@80b±&0c±&&&&°Y°S°Y%%%%%0d±&%Button0e±% @à B¢ B¬ B–  B¬ B–&0f± &%0g± 0h±& % Open Source0i± B@ B@° 0j± &0k±°  B@ B@%%0%00l±&$š$šII*$???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿçííÿçîîÿçïïÿçííÿèèèÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿ???ÿ€???ÿêêêÿëëëÿëëëÿêêêÿêêêÿëëëÿëëëÿëëëÿìììÿëëëÿëëëÿêêêÿêêêÿêêêÿëëëÿëëëÿêêêÿëëëÿêêêÿëëëÿëëëÿëëëÿëëëÿëëëÿëëëÿêêêÿêêêÿêêêÿêêêÿêêêÿ???ÿ @???ÿêêêÿêêêÿéééÿêêêÿêêêÿåååÿéééÿìììÿãããÿìììÿìììÿìììÿìììÿìììÿçççÿêêêÿìììÿéééÿëëëÿéééÿìììÿéééÿêêêÿëëëÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿ???ÿ @???ÿçôôÿ˜¥¥ÿŽ››ÿÛèèÿèõõÿ¹ÆÆÿ«¸¸ÿ¬¹¹ÿ¡®®ÿ£°°ÿ®»»ÿ¾ËËÿ³ÀÀÿ·ÃÃÿÂÏÏÿ±½½ÿÁÎÎÿ¹ÆÆÿ·ÄÄÿ¶ÃÃÿ¬¹¹ÿ¨µµÿ ­­ÿ°½½ÿ»ÈÈÿæóóÿê÷÷ÿéööÿéööÿéööÿ???ÿ @???ÿðššÿÓ~~ÿÍxxÿì——ÿñœœÿàŠŠÿÙ„„ÿÎzzÿà‹‹ÿÆrrÿÉttÿÙ„„ÿÔÿÔ||ÿåÿÕ}}ÿÛƒƒÿÜ„„ÿÚ‚‚ÿÞ††ÿÙÿÖ~~ÿÒzzÿÕ}}ÿÛƒƒÿñ™™ÿò™™ÿñ™™ÿñ™™ÿñ™™ÿ???ÿ @???ÿÿ©©ÿÿ««ÿÿ««ÿÿ®®ÿÿµµÿÿ··ÿÿ··ÿÿ››ÿÿ©©ÿÿ¦¦ÿÿ¨¨ÿÿ©©ÿÿ««ÿÿ¹¹ÿÿ¹¹ÿÿººÿÿººÿÿººÿÿººÿÿººÿÿººÿÿººÿÿººÿÿººÿÿººÿÿ¹¹ÿÿ¹¹ÿÿ¹¹ÿÿ¹¹ÿÿ¹¹ÿ???ÿ @???ÿÿ÷÷ÿÿööÿÿððÿÿúúÿÿÿÿÿÿÿÿÿÿÿÿÿÿååÿÿùùÿÿüüÿÿýýÿÿþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿòøøÿøþþÿúÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿÿÿÿÿÿÿÿÿçççÿÑÑÑÿáááÿßßßÿÕÕÕÿãããÿßßßÿéééÿØØØÿÝÝÝÿÓÓÓÿòòòÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿOOOÿ¿¿¿ÿÂÂÂÿ¿¿¿ÿºººÿ¹¹¹ÿµµµÿ´´´ÿ¯¯¯ÿåååÿOOOÿÿÿÿÿÿÿÿÿñññÿáááÿìììÿêêêÿåååÿìììÿáááÿåååÿÖÖÖÿÏÏÏÿÍÍÍÿéééÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿOOOÿÄÄÄÿÁÁÁÿ¿¿¿ÿ¿¿¿ÿºººÿ···ÿµµµÿ´´´ÿÓÓÓÿOOOÿÿÿÿÿÿÿÿÿçççÿÝÝÝÿÓÓÓÿèèèÿæææÿäääÿðððÿÐÐÐÿàààÿâââÿïïïÿÏÏÏÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿOOOÿ¹¹¹ÿ¿¿¿ÿ¿¿¿ÿ¬¬¬ÿ¢¢¢ÿµµµÿ¹¹¹ÿ···ÿ°°°ÿOOOÿÿÿÿÿÿÿÿÿçççÿéééÿåååÿÝÝÝÿäääÿôôôÿäääÿèèèÿßßßÿßßßÿåååÿßßßÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿOOOÿ•••ÿ£££ÿªªªÿÿŽŽŽÿšššÿ˜˜˜ÿ›››ÿÿOOOÿÿÿÿÿÿÿÿÿâââÿæææÿßßßÿ×××ÿÏÏÏÿêêêÿÛÛÛÿÝÝÝÿÍÍÍÿÖÖÖÿØØØÿ×××ÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿOOOÿšššÿŽŽŽÿÿ‹‹‹ÿ“““ÿ‘‘‘ÿ‘‘‘ÿ†††ÿ†††ÿOOOÿÿÿÿÿÿÿÿÿÛÛÛÿáááÿÓÓÓÿéééÿÓÓÓÿñññÿÔÔÔÿÛÛÛÿäääÿáááÿòòòÿåååÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿOOOÿ£££ÿŒŒŒÿŒŒŒÿÿ˜˜˜ÿšššÿ   ÿŽŽŽÿÿOOOÿÿÿÿÿÿÿÿÿÙÙÙÿéééÿðððÿ×××ÿàààÿ×××ÿÔÔÔÿÔÔÔÿÝÝÝÿæææÿßßßÿÝÝÝÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿOOOÿ˜˜˜ÿÿŒŒŒÿÿ‰‰‰ÿ‰‰‰ÿ‹‹‹ÿ†††ÿŒŒŒÿOOOÿÿÿÿÿÿÿÿÿäääÿãããÿíííÿØØØÿØØØÿÚÚÚÿÑÑÑÿÙÙÙÿßßßÿëëëÿäääÿ×××ÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿÿÿÿÿÿÿÿÿèèèÿÞÞÞÿóóóÿÝÝÝÿÑÑÑÿåååÿÖÖÖÿÞÞÞÿÞÞÞÿðððÿîîîÿåååÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿåååÿÛÛÛÿÖÖÖÿÛÛÛÿùùùÿãããÿáááÿÎÎÎÿáááÿãããÿòòòÿÙÙÙÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿæææÿÙÙÙÿÐÐÐÿàààÿÛÛÛÿÜÜÜÿÕÕÕÿíííÿêêêÿØØØÿÜÜÜÿâââÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿäääÿäääÿÞÞÞÿëëëÿâââÿÝÝÝÿÜÜÜÿòòòÿâââÿßßßÿäääÿïïïÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿüüüÿèèèÿåååÿóóóÿñññÿùùùÿéééÿåååÿðððÿôôôÿðððÿ÷÷÷ÿêêêÿÿÿÿÿÿÿÿÿâââÿîîîÿÐÐÐÿÙÙÙÿáááÿÙÙÙÿÝÝÝÿìììÿàààÿæææÿØØØÿãããÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿøøøÿØØØÿÈÈÈÿåååÿÍÍÍÿäääÿÝÝÝÿÅÅÅÿÍÍÍÿÏÏÏÿÃÃÃÿìììÿÊÊÊÿÿÿÿÿÿÿÿÿåååÿÓÓÓÿäääÿØØØÿÖÖÖÿßßßÿôôôÿÒÒÒÿÔÔÔÿÚÚÚÿíííÿíííÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿêêêÿîîîÿïïïÿòòòÿìììÿãããÿôôôÿØØØÿÓÓÓÿèèèÿæææÿïïïÿÿÿÿÿÿÿÿÿßßßÿÓÓÓÿÔÔÔÿÎÎÎÿÒÒÒÿàààÿóóóÿìììÿëëëÿðððÿõõõÿ÷÷÷ÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÒÒÒÿÑÑÑÿâââÿ÷÷÷ÿéééÿÏÏÏÿÞÞÞÿáááÿÖÖÖÿÜÜÜÿÚÚÚÿìììÿÿÿÿÿÿÿÿÿÝÝÝÿÐÐÐÿÝÝÝÿÌÌÌÿØØØÿÎÎÎÿìììÿÿÿÿÿÿÿÿÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿüüüÿÚÚÚÿàààÿÛÛÛÿ×××ÿØØØÿÒÒÒÿìììÿéééÿàààÿÔÔÔÿÛÛÛÿÜÜÜÿÿÿÿÿÿÿÿÿáááÿåååÿÝÝÝÿÚÚÚÿÝÝÝÿÖÖÖÿìììÿãããÿØØØÿËËËÿÜÜÜÿäääÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿøøøÿÈÈÈÿèèèÿÜÜÜÿÚÚÚÿÓÓÓÿßßßÿóóóÿöööÿãããÿÍÍÍÿÏÏÏÿ×××ÿÿÿÿÿÿÿÿÿéééÿãããÿñññÿéééÿåååÿèèèÿâââÿëëëÿäääÿïïïÿàààÿâââÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿøøøÿ×××ÿæææÿÆÆÆÿàààÿêêêÿöööÿãããÿØØØÿØØØÿ×××ÿØØØÿéééÿÿÿÿÿÿÿÿÿßßßÿÓÓÓÿäääÿÛÛÛÿÙÙÙÿÕÕÕÿÕÕÕÿàààÿÜÜÜÿëëëÿÐÐÐÿÖÖÖÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿúúúÿÌÌÌÿÖÖÖÿÉÉÉÿÌÌÌÿäääÿòòòÿÝÝÝÿÊÊÊÿÔÔÔÿºººÿÕÕÕÿÓÓÓÿÿÿÿÿÿÿÿÿéééÿØØØÿÇÇÇÿÕÕÕÿìììÿáááÿâââÿàààÿáááÿÇÇÇÿàààÿÎÎÎÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿþþþÿæææÿèèèÿîîîÿóóóÿöööÿéééÿæææÿêêêÿúúúÿðððÿãããÿæææÿÿÿÿÿÿÿÿÿæææÿÛÛÛÿíííÿôôôÿÝÝÝÿßßßÿãããÿÝÝÝÿÚÚÚÿâââÿéééÿÝÝÝÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿüüüÿÐÐÐÿÌÌÌÿÁÁÁÿÊÊÊÿàààÿËËËÿÝÝÝÿÑÑÑÿäääÿçççÿºººÿÌÌÌÿÿÿÿÿÿÿÿÿØØØÿÎÎÎÿàààÿëëëÿÜÜÜÿÜÜÜÿÐÐÐÿÏÏÏÿ×××ÿÙÙÙÿêêêÿ×××ÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿþþþÿÔÔÔÿÔÔÔÿôôôÿâââÿãããÿØØØÿÒÒÒÿßßßÿ×××ÿÝÝÝÿáááÿðððÿÿÿÿÿÿÿÿÿÙÙÙÿÎÎÎÿÓÓÓÿÓÓÓÿßßßÿ×××ÿÚÚÚÿÎÎÎÿÖÖÖÿÊÊÊÿòòòÿÓÓÓÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿþþþÿáááÿàààÿýýýÿôôôÿèèèÿÕÕÕÿÏÏÏÿ×××ÿäääÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿçççÿàààÿâââÿçççÿÜÜÜÿÜÜÜÿäääÿâââÿßßßÿÝÝÝÿÛÛÛÿÝÝÝÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿüüüÿÒÒÒÿÑÑÑÿÕÕÕÿÑÑÑÿÚÚÚÿÕÕÕÿ÷÷÷ÿÌÌÌÿÕÕÕÿõõõÿÇÇÇÿçççÿÿÿÿÿÿÿÿÿãããÿÙÙÙÿÔÔÔÿëëëÿÙÙÙÿáááÿàààÿÜÜÜÿÙÙÙÿÛÛÛÿÓÓÓÿæææÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿýýýÿåååÿãããÿìììÿÜÜÜÿãããÿæææÿöööÿßßßÿàààÿóóóÿâââÿîîîÿÿÿÿÿÿÿÿÿãããÿÐÐÐÿØØØÿãããÿßßßÿÛÛÛÿÝÝÝÿÑÑÑÿáááÿÕÕÕÿÚÚÚÿÜÜÜÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿüüüÿ×××ÿÖÖÖÿßßßÿÜÜÜÿßßßÿÙÙÙÿ÷÷÷ÿËËËÿéééÿñññÿÝÝÝÿÈÈÈÿÿÿÿÿÿÿÿÿåååÿÛÛÛÿßßßÿÛÛÛÿßßßÿâââÿóóóÿ×××ÿòòòÿãããÿâââÿØØØÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿüüüÿÝÝÝÿÜÜÜÿÜÜÜÿÙÙÙÿÝÝÝÿÙÙÙÿ÷÷÷ÿÉÉÉÿÝÝÝÿòòòÿÖÖÖÿæææÿÿÿÿÿÿÿÿÿÜÜÜÿØØØÿÚÚÚÿÙÙÙÿæææÿÕÕÕÿçççÿÚÚÚÿÖÖÖÿàààÿÛÛÛÿåååÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿüüüÿÞÞÞÿäääÿãããÿäääÿèèèÿåååÿìììÿÛÛÛÿÞÞÞÿÝÝÝÿãããÿôôôÿÿÿÿÿÿÿÿÿÞÞÞÿÙÙÙÿÕÕÕÿÖÖÖÿÝÝÝÿÒÒÒÿØØØÿÑÑÑÿÕÕÕÿðððÿèèèÿÚÚÚÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿùùùÿÌÌÌÿÚÚÚÿÔÔÔÿÞÞÞÿäääÿÚÚÚÿàààÿáááÿÔÔÔÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿáááÿÛÛÛÿÚÚÚÿÙÙÙÿÝÝÝÿßßßÿÛÛÛÿÍÍÍÿÛÛÛÿõõõÿêêêÿÖÖÖÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ???ÿ @???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ @€                               @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ þÿ00’$$R°&&&&&&&&%2 pickedOpenSource:v12@0:4@80m±&0n±&&&&0o±& %  MenuItem1°^°L0p1GSWindowTemplate1GSClassSwapper°M1 NSPanel1!NSWindow% ?€ A C»€ C5&% D@ D;@0q±% ?€ A C»€ C5  C»€ C5&0r± &°7° °e0s±% BÄ B¢ B¬ B–  B¬ B–&0t± &%0u± 0v±&%Update0w± B@ B@° 0x± &0y±°  B@ B@%%0%00z±&$š$šII*$UUUÿUUUÿUUUÿUDUÿUUUÿUUUÿUUUÿUDUÿUUUÿUUUÿUUUÿUDUÿUUUÿUUUÿUUUÿUDUÿUUUÿUUUÿUUUÿUDUÿUUUÿUUUÿUUUÿUDUÿUUUÿUUUÿUUUÿUDUÿUUUÿUUUÿUUUÿUDUÿUUUÿUUUÿUUUÿUDUÿUUUÿUUUÿUUUÿUDUÿUUUÿUUUÿUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦UUDÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÇÇÇÿªªªÿÇÇÇÿÿÿÿÿãããÿªªªÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿ›››ÿLLLÿâââÿüüüÿûûûÿßßßÿ¨¨¨ÿ¨¨¨ÿþþþÿÿÿÿÿªªªÿŽŽŽÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿãããÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿUUUÿÿÿÿÿ†††ÿ   ÿóóóÿÚÚÚÿÃÃÃÿýýýÿâââÿªªªÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿÿ¦LUUDÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿ999ÿÿÿÿÿÿ000ÿàààÿçççÿŸŸŸÿöööÿûûûÿ©©©ÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿ¨¨¨ÿÿÿÿÿÿÿÿ¹¹¹ÿ­­­ÿëëëÿôôôÿ¦¦¦ÿþþþÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÇÇÇÿªªªÿÇÇÇÿÿÿÿÿãããÿªªªÿrrrÿÇÇÇÿÿÿÿÿÿÿÿÿªªªÿªªªÿâââÿúúúÿ‘‘‘ÿXXXÿ„„„ÿŸŸŸÿ¦¦¦ÿ@@@ÿÿ)))ÿÉÉÉÿÚÚÚÿ›››ÿmmmÿ§§§ÿþþþÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿùùùÿíííÿÚÚÚÿÂÂÂÿ«««ÿœœœÿ———ÿhhhÿÿgggÿÉÉÉÿÛÛÛÿêêêÿõõõÿûûûÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUDÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿúúúÿðððÿßßßÿÉÉÉÿµµµÿ§§§ÿ¡¡¡ÿ¢¢¢ÿ&&&ÿÿ©©©ÿÍÍÍÿÝÝÝÿìììÿ÷÷÷ÿýýýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÇÇÇÿªªªÿÇÇÇÿÿÿÿÿãããÿªªªÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿüüüÿ¿¿¿ÿgggÿÙÙÙÿÊÊÊÿÀÀÀÿ¥¥¥ÿzzzÿQQQÿÿTTTÿ‚‚‚ÿtttÿáááÿïïïÿùùùÿ©©©ÿªªªÿãããÿÿÿÿÿãããÿªªªÿªªªÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿãããÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿþþþÿÞÞÞÿ¢¢¢ÿêêêÿâââÿÜÜÜÿÿÔÔÔÿ···ÿÿÿ©©©ÿ„„„ÿÕÕÕÿæææÿ¾¾¾ÿàààÿÿÿÿÿªªªÿÿÿÿÿãããÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿýýýÿ§§§ÿ÷÷÷ÿóóóÿñññÿžžžÿêêêÿâââÿÿÿ~~~ÿ~~~ÿÉÉÉÿÛÛÛÿžžžÿøøøÿþþþÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿ¦LUUDÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿ©©©ÿýýýÿüüüÿûûûÿ¦¦¦ÿ÷÷÷ÿÕÕÕÿÿÿUUUÿyyyÿ½½½ÿÐÐÐÿ²²²ÿÙÙÙÿüüüÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÇÇÇÿªªªÿÇÇÇÿÿÿÿÿãããÿªªªÿrrrÿÇÇÇÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÇÇÇÿrrrÿªªªÿãããÿÿÿÿÿãããÿ¨¨¨ÿ[[[ÿÿÿ***ÿNNNÿvvvÿÄÄÄÿÜÜÜÿŸŸŸÿ¦¦¦ÿãããÿÿÿÿÿãããÿªªªÿrrrÿÇÇÇÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿâââÿÿÿÿ>>>ÿ§§§ÿ§§§ÿ¹¹¹ÿÔÔÔÿëëëÿøøøÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÆÆÆÿÿÿÿÿtttÿœœœÿÿ±±±ÿÍÍÍÿçççÿ÷÷÷ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUDÿÿÿÿÿÿÿÿÿªªªÿŽŽŽÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÇÇÇÿeeeÿªªªÿŽŽŽÿ999ÿÿÿÿÿÿjjjÿPPPÿ•••ÿ¬¬¬ÿ´´´ÿ˜˜˜ÿ¤¤¤ÿÿÿÿÿÿÿÿÿãããÿªªªÿªªªÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿãããÿªªªÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿãããÿqqqÿÿÿÿÿÿÿÿmmmÿ~~~ÿYYYÿ‘‘‘ÿ¬¬¬ÿµµµÿçççÿ¤¤¤ÿÿÿÿÿÿÿÿÿãããÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿqqqÿÿÿÿÿÿÿFFFÿŒŒŒÿ€€€ÿVVVÿ”””ÿ²²²ÿÒÒÒÿêêêÿ¥¥¥ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿpppÿÿÿÿÿLLLÿvvvÿgggÿ{{{ÿzzzÿZZZÿ   ÿ¿¿¿ÿÜÜÜÿðððÿ§§§ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿ¦LUUDÿÿÿÿÿÿÿÿÿªªªÿrrrÿªªªÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÆÆÆÿJJJÿÿÿ¯¯¯ÿ•••ÿ```ÿUUUÿxxxÿyyyÿWWWÿCCCÿvvvÿÏÏÏÿÌÌÌÿ£££ÿqqqÿÇÇÇÿÿÿÿÿãããÿªªªÿrrrÿÇÇÇÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿ¦¦¦ÿÿÿ¸¸¸ÿœœœÿ†††ÿ}}}ÿ~~~ÿˆˆˆÿ™™™ÿ°°°ÿÉÉÉÿàààÿðððÿúúúÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUDÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿ¦¦¦ÿÿŒŒŒÿµµµÿ›››ÿŒŒŒÿ‹‹‹ÿ”””ÿ¥¥¥ÿ¸¸¸ÿÌÌÌÿÞÞÞÿîîîÿøøøÿýýýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÇÇÇÿªªªÿÇÇÇÿÿÿÿÿãããÿªªªÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÆÆÆÿJJJÿÿŒŒŒÿ¸¸¸ÿ‘‘‘ÿhhhÿlllÿ²²²ÿÄÄÄÿŽŽŽÿ~~~ÿïïïÿ÷÷÷ÿüüüÿªªªÿªªªÿãããÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿãããÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿâââÿnnnÿÿŽŽŽÿ¾¾¾ÿtttÿ¯¯¯ÿ¦¦¦ÿŸŸŸÿÞÞÞÿÑÑÑÿ¢¢¢ÿùùùÿýýýÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿþþþÿ¦¦¦ÿìììÿÙÙÙÿÇÇÇÿ}}}ÿÀÀÀÿÎÎÎÿ•••ÿîîîÿ÷÷÷ÿ¨¨¨ÿþþþÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿ¦LUUDÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿþþþÿ¦¦¦ÿïïïÿàààÿÑÑÑÿ†††ÿÎÎÎÿÃÃÃÿ···ÿ÷÷÷ÿüüüÿªªªÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÇÇÇÿªªªÿÇÇÇÿÿÿÿÿãããÿªªªÿrrrÿÇÇÇÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÇÇÇÿpppÿ¢¢¢ÿÎÎÎÿÝÝÝÿÀÀÀÿ’’’ÿšššÿóóóÿûûûÿ©©©ÿrrrÿªªªÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýýýÿøøøÿðððÿéééÿæææÿéééÿðððÿøøøÿýýýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿûûûÿöööÿòòòÿðððÿòòòÿöööÿûûûÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUDÿÿÿÿÿÿÿÿÿÇÇÇÿªªªÿÇÇÇÿÿÿÿÿãããÿªªªÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿÇÇÇÿ&&&ÿÿÿ¢¢¢ÿÖÖÖÿ¡¡¡ÿ£££ÿúúúÿýýýÿªªªÿŽŽŽÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿãããÿªªªÿªªªÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿãããÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿeeeÿÿÿÿÿ‡‡‡ÿæææÿÑÑÑÿ½½½ÿùùùÿáááÿªªªÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿãããÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿZZZÿÎÎÎÿØØØÿ™™™ÿòòòÿúúúÿ©©©ÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿþþþÿ888ÿÿÿÿÿZZZÿ°°°ÿªªªÿ¦¦¦ÿéééÿöööÿ¨¨¨ÿÿÿÿÿÿÿÿÿÇÇÇÿãããÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿ¦LUUDÿÿÿÿÿÿÿÿÿÇÇÇÿªªªÿÇÇÇÿÿÿÿÿãããÿªªªÿrrrÿÇÇÇÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿþþþÿ———ÿ ÿÿÿ555ÿÿdddÿqqqÿÆÆÆÿáááÿ¢¢¢ÿpppÿªªªÿÿÿÿÿÿÿÿÿªªªÿªªªÿãããÿÿÿÿÿãããÿªªªÿrrrÿÇÇÇÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýýýÿ÷÷÷ÿÎÎÎÿŠŠŠÿˆˆˆÿ’’’ÿ„„„ÿ‰‰‰ÿ   ÿÀÀÀÿÝÝÝÿñññÿûûûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýýýÿ÷÷÷ÿéééÿÐÐÐÿ³³³ÿ˜˜˜ÿŠŠŠÿÿ¥¥¥ÿÃÃÃÿßßßÿòòòÿüüüÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿùùùÿîîîÿÛÛÛÿÃÃÃÿ­­­ÿ¢¢¢ÿ¦¦¦ÿ¸¸¸ÿÐÐÐÿæææÿõõõÿýýýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUDÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿüüüÿôôôÿèèèÿØØØÿÉÉÉÿÁÁÁÿÄÄÄÿÐÐÐÿáááÿïïïÿùùùÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦LUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦L¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦§¨ªªª©¨¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦LLLLLLLLLLLLLLLLLLLMNNNMLLLLLLLLLLLLLLLLLLL þÿ00’$$R°&&&&&&&&%2 pickedUpdateDestination:v12@0:4@80{±&0|±&&&&°°0}1"NSBox% @à @À C³ BŽ  C³ BŽ&0~± &0±% @à @à C¬ B0  C¬ B0&0€± &°,°A°O0±0‚±&%Update°0&&&&&&&&%’0ƒ±°&0„±&%System0…±&%windowBackgroundColor0†±°&0‡±&%System0ˆ±& % textColor @  @ %%°ƒ0‰±&%Window0б&%Link Inspector°Š ?€ A¨ F@ F@%0‹±0Œ±&%NSApplicationIcon0±&%Box°}0ޱ& %  MenuItem2°`0±& %  MenuItem3°V0±&%MenuItem°Y0‘±&% Button1°s0’± &0“1#NSNibConnector°L0”±&%NSOwner0•±#°60–±#°0—±#°d0˜±#°‘0™±#°0š±#°0›±#°0œ±#°+0±#°@0ž±#°N0Ÿ±#°0 ±#°o0¡±#°Ž0¢1$NSNibControlConnector°N°L0£±&%pickedUpdateMode:0¤±$°d°L0¥±&%pickedOpenSource:0¦±$°‘°L0§±&%pickedUpdateDestination:0¨±$°°L0©±&%pickedBreakLink:0ª±$°°L0«±&%pickedBreakAllLinks:0¬1%NSNibOutletConnector°L°d0­±&%_openSourceButton0®±%°L°‘0¯±&%_updateDestinationButton0°±%°L°0±±&%_breakLinkButton0²±%°L°0³±&%_breakAllLinksButton0´±%°L°N0µ±&%_updateModeButton0¶±%°L°@0·±&%_lastUpdateField0¸±%°L°0¹±& % _sourceField0º±%°”°L0»±&%panel0¼±%°L°0½±& % _updateView0¾±#°0¿1& GSMutableSet1' NSMutableSet1(NSSet&°pgnustep-gui-0.24.0/Panels/English.lproj/GSDataLinkPanel.gorm/data.classes0000664000076500007650000000751310377004044026043 0ustar brains99brains99{ FirstResponder = { Actions = ( "activateContextHelpMode:", "alignCenter:", "alignJustified:", "alignLeft:", "alignRight:", "arrangeInFront:", "cancel:", "capitalizeWord:", "changeColor:", "changeFont:", "checkSpelling:", "close:", "complete:", "copy:", "copyFont:", "copyRuler:", "cut:", "delete:", "deleteBackward:", "deleteForward:", "deleteToBeginningOfLine:", "deleteToBeginningOfParagraph:", "deleteToEndOfLine:", "deleteToEndOfParagraph:", "deleteToMark:", "deleteWordBackward:", "deleteWordForward:", "deminiaturize:", "deselectAll:", "fax:", "hide:", "hideOtherApplications:", "indent:", "loosenKerning:", "lowerBaseline:", "lowercaseWord:", "makeKeyAndOrderFront:", "miniaturize:", "miniaturizeAll:", "moveBackward:", "moveBackwardAndModifySelection:", "moveDown:", "moveDownAndModifySelection:", "moveForward:", "moveForwardAndModifySelection:", "moveLeft:", "moveRight:", "moveToBeginningOfDocument:", "moveToBeginningOfLine:", "moveToBeginningOfParagraph:", "moveToEndOfDocument:", "moveToEndOfLine:", "moveToEndOfParagraph:", "moveUp:", "moveUpAndModifySelection:", "moveWordBackward:", "moveWordBackwardAndModifySelection:", "moveWordForward:", "moveWordForwardAndModifySelection:", "newDocument:", "ok:", "openDocument:", "orderBack:", "orderFront:", "orderFrontColorPanel:", "orderFrontDataLinkPanel:", "orderFrontFontPanel:", "orderFrontHelpPanel:", "orderFrontStandardAboutPanel:", "orderFrontStandardInfoPanel:", "orderOut:", "pageDown:", "pageUp:", "paste:", "pasteAsPlainText:", "pasteAsRichText:", "pasteFont:", "pasteRuler:", "performClose:", "performMiniaturize:", "performZoom:", "print:", "raiseBaseline:", "revertDocumentToSaved:", "runPageLayout:", "runToolbarCustomizationPalette:", "saveAllDocuments:", "saveDocument:", "saveDocumentAs:", "saveDocumentTo:", "scrollLineDown:", "scrollLineUp:", "scrollPageDown:", "scrollPageUp:", "scrollViaScroller:", "selectAll:", "selectLine:", "selectNextKeyView:", "selectParagraph:", "selectPreviousKeyView:", "selectText:", "selectText:", "selectToMark:", "selectWord:", "showContextHelp:", "showGuessPanel:", "showHelp:", "showWindow:", "stop:", "subscript:", "superscript:", "swapWithMark:", "takeDoubleValueFrom:", "takeFloatValueFrom:", "takeIntValueFrom:", "takeObjectValueFrom:", "takeStringValueFrom:", "terminate:", "tightenKerning:", "toggle:", "toggleContinuousSpellChecking:", "toggleRuler:", "toggleToolbarShown:", "toggleTraditionalCharacterShape:", "transpose:", "transposeWords:", "turnOffKerning:", "turnOffLigatures:", "underline:", "unhide:", "unhideAllApplications:", "unscript:", "uppercaseWord:", "useAllLigatures:", "useStandardKerning:", "useStandardLigatures:", "yank:", "zoom:" ); Super = NSObject; }; GSDataLinkPanelController = { Actions = ( ); Outlets = ( panel ); Super = NSObject; }; NSDataLinkPanel = { Actions = ( "pickedUpdateMode:", "pickedUpdateDestination:", "pickedOpenSource:", "pickedBreakLink:", "pickedBreakAllLinks:" ); Outlets = ( _updateModeButton, _breakAllLinksButton, _breakLinkButton, _updateDestinationButton, _openSourceButton, _lastUpdateField, _sourceField, _updateView ); Super = NSPanel; }; }gnustep-gui-0.24.0/Panels/English.lproj/GSPrintPanel.gorm/0000775000076500007650000000000012256227330023155 5ustar brains99brains99gnustep-gui-0.24.0/Panels/English.lproj/GSPrintPanel.gorm/data.info0000664000076500007650000000027011672574677024766 0ustar brains99brains99GNUstep archive0000300d:00000003:00000003:00000000:01GormFilePrefsManager1NSObject% 01NSString&%Latest Version0±& % Typed Streamgnustep-gui-0.24.0/Panels/English.lproj/GSPrintPanel.gorm/objects.gorm0000664000076500007650000004475211672574677025534 0ustar brains99brains99GNUstep archive0000300d:00000026:000001a4:00000001:01GSNibContainer1NSObject01 NSMutableSet1NSSet&01GSWindowTemplate1GSClassSwapper01NSString&% NSPanel1NSPanel1 NSWindow1 NSResponder% ?€ A CÑ C¤&% C¥€ D%À01 NSView% ?€ A CÑ C¤  CÑ C¤&01 NSMutableArray1 NSArray&01NSButton1 NSControl% @à @À B˜ AÀ  B˜ AÀ& 0± &%0 1 NSButtonCell1 NSActionCell1NSCell0 ±&%Save0 1NSFont% A@&&&&&&&&&&&&&&%’0 ±&0 ±&&&& &&0±% B² @À B˜ AÀ  B˜ AÀ& 0± &%0±0±&%Preview° &&&&&&&&&&&&&&%’° ° &&& &&0±% C* @À B˜ AÀ  B˜ AÀ& 0± &%0±0±&%Fax° &&&&&&&&&&&&&&%’° ° &&& &&0±% C| @À B˜ AÀ  B˜ AÀ& 0± &%0±0±&%Cancel° &&&&&&&&&&&&&&%’° &&& &&0±% C§€ @À B˜ AÀ  B˜ AÀ& 0± &%0±0±&%Print° &&&&&&&&&&&&&&%’° ° &&& &&01NSBox% @€ C| CË€ @  CË€ @&0± &0 ± % @à @à CÄ€   CÄ€ &0!± &0"1NSTextFieldCell0#±&%Box° &&&&&&&& &&&&&&%’0$1NSColor0%±&% NSCalibratedRGBColorSpace ?*Àƒ ?*Àƒ ?*Àƒ ?*Àƒ ?€0&±°% ?€ @  @ %%0'±% @À C‚€ B€ B€  B€ B€&0(± &%0)±0*±&%Button0+1NSImage0,±&%common_Root_Apple.tiff° &&&&&&&&&&&&&&%’° ° &&& &&0-1 NSTextField% B€ C‰ B B  B B&0.± &%0/±00±&%Print01±% A&&&&&&&& &&&&&&%’02±°% ?€ ?€ ?€ ?€ ?€03±°% ?€’04±% C BÜ CŒ BT  CŒ BT&05± &06± % @à @à C… AØ  C… AØ&07± &081NSMatrix% A @  Bæ A   Bæ A &09± &%0:±0;±&° &&&&&&&&&&&&&&%’% Bd A  ?€ ?€0<±°% ?*Àƒ ?*Àƒ ?*Àƒ ?*Àƒ ?€°<0=±& % NSButtonCell0>±0?±&%Radio0@±0A1NSMutableString&%common_RadioOff° &&&&&&&&&&&&&&%’0B±0C±&%common_RadioOn&&& &&%%0D± &0E±0F±&%All°@° &&&&&&&&&&&&&&%’°B&&& &&0G±0H±&%From:°@° °H&&&&&&&&&&&&&&%’°B&&& &&’’’°G0I1NSForm% Bæ @  Bd A   Bd A &0J± &%0K1 NSFormCell0L±&° &&&&&&&&&&&&&&%’ ¿€0M±0N±&%Field:° &&&&&&&&&&&&&&% Bd A  @@0O±°% ?*Àƒ ?*Àƒ ?*Àƒ ?*Àƒ ?€°O0P±& % NSFormCell%%0Q± &0R±0S±&° &&&&&&&&&&&&&&%’ A0T±0U±&° &&&&&&&&&&&&&&’’’°R0V±% C< @  B€ A   B€ A &0W± &%0X±0Y±&° &&&&&&&&&&&&&&%’ ¿€0Z±0[±&%Field:° &&&&&&&&&&&&&&% B€ A  @@0\±°% ?*Àƒ ?*Àƒ ?*Àƒ ?*Àƒ ?€°\0]±& % NSFormCell%%0^± &0_±0`±&° °`&&&&&&&&&&&&&&%’ A 0a±0b±&%to: ° °b&&&&&&&&&&&&&&’’’°_0c±0d±&%Pages° &&&&&&&& &&&&&&%’°$0e±°% ?€ @  @ %%0f±% A BÜ BÜ BT  BÜ BT&0g± &0h± % @à @à BÀ AØ  BÀ AØ&0i± &0j±% A @  B– A   B– A &0k± &%0l±0m±&%Text° °m&&&&&&&& &&&&&&%’0n±°% ?€ ?€ ?€ ?€ ?€0o±°% ?€’0p±0q±&%Copies° &&&&&&&& &&&&&&%’°$0r±°% ?€ @  @ %%0s±% Bú B0 Bð Bp  Bð Bp&0t± &0u± % @à @à BÔ B  BÔ B&0v± &0w±% A  @à B` A   B` A &0x± &% 0y±0z±&%Text° °z&&&&&&&& &&&&&&%’0{±°% ?€ ?€ ?€ ?€ ?€0|±°% ?€’0}±% Bœ @ð A€ A   A€ A &0~± &%0±0€±&%%0±% A`&&&&&&&& &&&&&&%’0‚±°% ?€ ?€ ?€ ?€ ?€0ƒ±°% ?€’0„±0…±&%Scale° &&&&&&&& &&&&&&%’°$0†±°% ?€ @  @ %%0‡±% C B0 C Bp  C Bp&0ˆ± &0‰± % @à @à C B  C B&0б &0‹1 NSPopUpButton% AÈ @à B´ A   B´ A &0Œ± &%#01NSPopUpButtonCell1NSMenuItemCell0ޱ&%Button° &&&&&&&&01 NSMenu0±&0‘± &0’1! NSMenuItem0“±&%Item 10”±&&&ÿ%0•±0–±& %  common_Nibble’%0—±!0˜±&%Item 2°”&&ÿ%’%0™±!0š±&%Item 3°”&&ÿ%’%&&&&&&%’&&& &&°’°°’%%%%%0›±0œ±&%Layout° &&&&&&&& &&&&&&%’°$0±°% ?€ @  @ %%0ž±% A0 CU B‚ A°  B‚ A°&0Ÿ± &%0 ±0¡±&%Printer:°°¡&&&&&&&& &&&&&&%’0¢±°% ?€ ?€ ?€ ?€ ?€0£±°% ?€’0¤±% A0 C? B‚ A˜  B‚ A˜&0¥± &%0¦±0§±&%Note:°°§&&&&&&&& &&&&&&%’0¨±°% ?€ ?€ ?€ ?€ ?€0©±°% ?€’0ª±% A C( B‚ A  B‚ A&0«± &%0¬±0­±& % Progress:°&&&&&&&& &&&&&&%’0®±°% ?€ ?€ ?€ ?€ ?€0¯±°% ?€’0°±% B  CD C¥ A`  C¥ A`&0±± &%0²±0³±&%None°°³&&&&&&&& &&&&&&%’0´±°% ?€ ?€ ?€ ?€ ?€0µ±°% ?€’0¶±% B  C, C¥ A`  C¥ A`&0·± &%0¸±0¹±&%Idle°&&&&&&&& &&&&&&%’0º±°% ?€ ?€ ?€ ?€ ?€0»±°% ?€’0¼±% A B0 BÐ BP  BÐ BP&0½± &0¾± % @à @à B´ B  B´ B&0¿± &0À±% @À @  B– AÀ  B– AÀ&0Á± &%!0±0ñ&%Options° °Ã&&&&&&&&&&&&&&%2 _pickedButton:v12@0:4@8° 0ı&&&& &&0ű0Ʊ&%Box° &&&&&&&& &&&&&&%’°$0DZ°% ?€ @  @ %%0ȱ% B  CW C¤ A°  C¤ A°&0ɱ &%0ʱ0˱&0̱%&&&&&&&&0ͱ 0α&0ϱ &0б!0ѱ&%Item 1°Ë&&ÿ%°•’%0Ò±!0Ó±&%Item 2°Ë&&ÿ%’%0Ô±!0Õ±&%Item 3°Ë&&ÿ%’%&&&&&&%’0Ö±&°Ö&&& >ÌÌÍ =™™š&&°Ð°Í°Ð%%%%%0×±0ر&% NSNamedColorSpace0Ù±&% System0Ú±&% windowBackgroundColor0Û±&%Window0ܱ&%Print°Ü CÒ C¯ F@ F@%&   D€ D@0ݱ°±% ?€ A C‚ C&% D€ D%À0Þ± % ?€ A C‚ C  C‚ C&0ß± &0à±% C7 A B` AÀ  B` AÀ&0á± &%(0â±0ã±&%OK° &&&&&&&&&&&&&&%²0ä±&°Ä&&& &&0å±% C BH Bì B†  Bì B†&0æ± &0ç± % @à @à BÐ B$  BÐ B$&0è± &0é±% @à A B² A   B² A &0ê± &%$0ë±0ì±&%Button° &&&&&&&&0í± 0î±&0ï± &0ð±!0ñ±&%Item 10ò±&&&ÿ%°•’%0ó±!0ô±&%Item 2°ò&&ÿ%’%0õ±!0ö±&%Item 3°ò&&ÿ%’%&&&&&&%’&&& &&°ð°í°ð%%%%%0÷±0ø±& % Resolution° &&&&&&&& &&&&&&%’0ù±°% ?*Àƒ ?*Àƒ ?*Àƒ ?*Àƒ ?€0ú±°% ?€ @  @ %%0û±% @À BH Bò B†  Bò B†&0ü± &0ý± % @à @à BÖ B$  BÖ B$&0þ± &0ÿ±% @€ A BÈ A   BÈ A &P± &%"P±P±&%Button° &&&&&&&&P± P±&P± &P±!P±&%Item 1P±&&&ÿ%°•’%P ±!P ±&%Item 2Ð&&ÿ%’%P ±!P ±&%Item 3Ð&&ÿ%’%&&&&&&%’&&& &&ÐÐÐ%%%%%P ±P±& % Paper Feed° &&&&&&&& &&&&&&%’°ùP±°% ?€ @  @ %%°×P±&%WindowP±& % Print OptionsÐ @@ B F@ F@%&   D€ D@P± &P± &P1"NSMutableDictionary1# NSDictionary&,P±&%Button5°'P±&%Button6°ÀP±&%Button7°àP±&%Button°P±&%Box1°4P±&%Box2°fP±&%Box3°sP±& % TextField°-P±&%Box4°‡P±&%Box5°¼P±&%Panel°P ±&%Box6°åP!±&%Box7°ûP"±&%Panel1°ÝP#±&%PopUpButton(0)°ÈP$±& % MenuItem(5)°ÔP%±& % MenuItem(4)°ÒP&±& % MenuItem(3)°ÐP'±& % MenuItem(2)°™P(±&%Box°P)±& % TextField1°jP*±& % TextField2P+±% Bœ C B¦ A`  B¦ A`&P,± &%P-±P.±&%Title°&&&&&&&& &&&&&&%’P/±°% ?€ ?€ ?€ ?€ ?€P0±°% ?€’P1±& % MenuItem(1)°—P2±& % TextField3°žP3±& % TextField4°¤P4±& % MenuItem(0)°’P5±& % TextField5P6±% Bœ C B¦ A`  B¦ A`&P7± &%P8±P9±&%Title°&&&&&&&& &&&&&&%’P:±°% ?€ ?€ ?€ ?€ ?€P;±°% ?€’P<±& % TextField6°ªP=±&% NSOwnerP>±& % NSPrintPanelP?±& % TextField8°°P@±&%Form1PA±% C, B¢ B® B  B® B&PB± &%PC±PD±&° &&&&&&&&&&&&&&%’ ¿€PE±PF±&%Field:° &&&&&&&&&&&&&&% B® Aˆ @@PG±°% ?*Àƒ ?*Àƒ ?*Àƒ ?*Àƒ ?€ÐGPH±& % NSFormCell%%PI± &PJ±ÐD° &&&&&&&&&&&&&&%’ BPK±PL±&%Field 1° &&&&&&&&&&&&&&PM±ÐD° &&&&&&&&&&&&&&%’ BPN±PO±&%Field 2° &&&&&&&&&&&&&&’’’ÐJPP±&%Matrix°8PQ±& % TextField9°¶PR±&%Form2°IPS±&%Button1°PT±&%Form3°VPU±& % TextField10°wPV±&%Button2°PW±& % PopUpButton1°‹PX±& % TextField11°}PY±&%Button3°PZ±& % PopUpButton2°ÿP[±&%Button4°P\±& % PopUpButton3°éP]± &66P^1$NSNibConnectorÐP_±&% NSOwnerP`±$Ð*ÐPa±$ÐÐPb±$ÐSÐPc±$ÐVÐPd±$ÐYÐPe±$Ð[ÐPf±$Ð(ÐPg±$ÐÐPh±$ÐÐPi±$ÐÐPj±$ÐÐPk±$Ð)ÐPl±$ÐPÐPm±$Ð@ÐPn±$ÐRÐPo±$ÐTÐPp±$ÐÐPq±$ÐÐPr±$ÐWÐPs1%NSNibControlConnectorÐÐ_Pt±&%_pickedButton:Pu±%ÐSÐ_ÐtPv±%ÐVÐ_ÐtPw±%ÐYÐ_ÐtPx±%Ð[Ð_ÐtPy±%ÐPÐ_Pz±& % _pickedPage:P{±$Ð2ÐP|±$Ð3ÐP}±$Ð5ÐP~±$Ð<ÐP±$Ð?ÐP€±$ÐQÐP±$ÐÐP‚±$ÐÐPƒ±$Ð"Ð_P„±$ÐÐ"P…±$Ð Ð"P†±$Ð!Ð"P‡±$ÐZÐ"Pˆ±$Ð\Ð"P‰±$ÐUÐPб$ÐXÐP‹1&NSNibOutletConnectorÐ_ÐPŒ±&%_panelP±%ÐÐ_Pޱ&%_pickedButton:P±%ÐÐ_P±&%_pickedButton:P‘±&Ð_Ð"P’±& % _optionPanelP“±$Ð4P”±$Ð1P•±$Ð'P–±$Ð#P—±$Ð&Ð#P˜±$Ð%Ð#P™±$Ð$Ð#Pš±%Ð#Ð_P›±&%_pickedPrinter:Pœ±"&gnustep-gui-0.24.0/Panels/English.lproj/GSPrintPanel.gorm/data.classes0000664000076500007650000000061011541064077025445 0ustar brains99brains99{ "## Comment" = "Do NOT change this file, Gorm maintains it"; FirstResponder = { Actions = ( "_pickedPrinter:", "orderFrontFontPanel:" ); Super = NSObject; }; NSPrintPanel = { Actions = ( "_pickedButton:", "_pickedPage:", "_pickedPrintOp:", "_pickedPrinter:" ); Outlets = ( "_optionPanel", "_panel" ); Super = NSPanel; }; }gnustep-gui-0.24.0/Panels/GNUmakefile.postamble0000664000076500007650000000510711023376255021232 0ustar brains99brains99# # GNUmakefile.postamble # # Copyright (C) 2001 Free Software Foundation, Inc. # # Written: Adam Fedor # Date: Oct 2001 # # This file is part of the GNUstep Base Library. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # TODO: extend resource-set.make so that this can be done easily with # it. include ../Version libgnustep-gui_INTERFACE_VERSION=$(GNUSTEP_GUI_MAJOR_VERSION).$(GNUSTEP_GUI_MINOR_VERSION) POSTAMBLE_INSTALL_DIR = $(GNUSTEP_LIBRARY)/Libraries/gnustep-gui/Versions/$(libgnustep-gui_INTERFACE_VERSION)/Resources # Things to do after installing after-install:: ifneq ($(strip $(LOCALIZED_RESOURCE_FILES)),) $(ECHO_NOTHING)echo "Copying localized resources into system..."; \ for l in $(LANGUAGES); do \ if [ ! -d $(POSTAMBLE_INSTALL_DIR)/$$l.lproj ]; then \ $(MKDIRS) $(POSTAMBLE_INSTALL_DIR)/$$l.lproj; \ fi; \ for f in $(LOCALIZED_RESOURCE_FILES); do \ if [ -f $$l.lproj/$$f ]; then \ cp -r $$l.lproj/$$f $(POSTAMBLE_INSTALL_DIR)/$$l.lproj; \ fi; \ done; \ done$(END_ECHO) endif ifneq ($(strip $(LOCALIZED_RESOURCE_COMPONENTS)),) $(ECHO_NOTHING)echo "Copying localized components into system..."; \ for l in $(LANGUAGES); do \ if [ ! -d $(POSTAMBLE_INSTALL_DIR)/$$l.lproj ]; then \ $(MKDIRS) $(POSTAMBLE_INSTALL_DIR)/$$l.lproj; \ fi; \ for f in $(LOCALIZED_RESOURCE_COMPONENTS); do \ if [ -d $$l.lproj/$$f ]; then \ cp -r $$l.lproj/$$f $(POSTAMBLE_INSTALL_DIR)/$$l.lproj; \ rm -rf $(POSTAMBLE_INSTALL_DIR)/$$l.lproj/$$f/.svn; \ fi; \ done; \ done$(END_ECHO) endif # Things to do after uninstalling after-uninstall:: ifneq ($(strip $(LOCALIZED_RESOURCE_FILES)$(LOCALIZED_RESOURCE_COMPONENTS)),) $(ECHO_NOTHING)for l in $(LANGUAGES); do \ if [ -d $$l.lproj ]; then \ rm -rf $(POSTAMBLE_INSTALL_DIR)/$$l.lproj; \ fi; \ done$(END_ECHO) endif gnustep-gui-0.24.0/Panels/GNUmakefile0000664000076500007650000000264211425612374017247 0ustar brains99brains99# # Makefile for GNUstep GUI Panels # # Copyright (C) 2001 Free Software Foundation, Inc. # # Author: Adam Fedor # Date: November 2001 # # This file is part of the GNUstep GUI Library. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-gui GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../gui.make include $(GNUSTEP_MAKEFILES)/common.make LANGUAGES = English Spanish LOCALIZED_RESOURCE_COMPONENTS = \ GSDataLinkPanel.gorm \ GSPageLayout.gorm \ GSPrintPanel.gorm \ GSToolbarCustomizationPalette.gorm \ GSSpellPanel.gorm \ GSFindPanel.gorm -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/rules.make include GNUmakefile.postamble gnustep-gui-0.24.0/COPYING.LIB0000664000076500007650000006350611023376255015420 0ustar brains99brains99 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! gnustep-gui-0.24.0/install.sh0000775000076500007650000000023311731102232015735 0ustar brains99brains99#! /bin/sh PREFIX=$1 MAKE=${2:-make} . $PREFIX/System/Library/Makefiles/GNUstep.sh $MAKE GNUSTEP_INSTALLATION_DOMAIN=SYSTEM messages=yes install exit 0 gnustep-gui-0.24.0/ChangeLog.10000664000076500007650000077344210377004044015673 0ustar brains99brains99Sat Dec 11 06:55:59 1999 Nicola Pero * Source/NSPopUpButton.m ([-mouseDown:]): Send NSPopUpButton action to target. Sat Dec 11 03:15:12 1999 Nicola Pero * Source/NSMenu.m ([NSMenu -performActionForItemAtIndex:]): Fix: don't send action if there is no action. * Source/NSMenuView.m ([-setWindowFrameForAttachingToRect: onScreen:preferredEdge:popUpSelectedItem:]): Implemented (but preferredEdge implementation still missing). ([-trackWithEvent:]): If the menu is a popup menu, don't unhighlight item when closing (used internally by the popup button code to know which item was selected without interfering with the normal target-action operation). * Source/NSPopUpButton.m ([-initWithFrame:pullsDown:]): Removed notification center code; set the pullsDown flag. ([-_popup:]): Removed. ([-mouseDown:]): Rewritten. ([-selectItem:]): Fixed bug/typo. ([-removeItemWithTitle:]): Fixed bug/typo. ([-addItemsWithTitles:]): Fixed bug/typo. ([-insertItemWithTitle:atIndex:]): Fixed bug/typo. * Source/NSPopUpButtonCell.m ([-attachPopUpWithFrame:inView:]): Rewritten. ([-performClickWithFrame:inView:]): Method still todo. ([-_popUpItemAction:]): Removed. ([-addItemWithTitle:]), ([-insertItemWithTitle:atIndex:]): Changed setting of item's target and action. * core/gui/Headers/AppKit/NSMenu.h: Removed declaration of unimplemented -initWithPopUpButton: * Headers/AppKit/NSPopUpButton.h: Updated. * Headers/AppKit/NSPopUpButtonCell.h: Added copyright, protected from multiple inclusions. Thu Dec 9 05:47:09 1999 Nicola Pero * Source/NSSavePanel.m ([-runModalForDirectory:path:filename]), ([-ok:]), ([-cancel:]): There was a nice bug here: when the panel was aborted, NSOKButton was returned! The reason is that by chance NSRunAbortedResponse == NSOKButton (they are defined in two different enums). I changed the way we handle return codes; now the panel returns NSCancelButton on abort. * Headers/AppKit/NSSavePanel.h: Added ivar _OKButtonPressed. Thu Dec 9 03:12:16 1999 Nicola Pero * Source/NSMatrix.m ([-keyDown:]): Trivial implementation to allow ESC to abort the save panel, method still to implement. Wed Dec 8 14:59:00 1999 Richard Frith-Macdonald * Headers/AppKit/NSWindow.m: Added new ivar for window view and a boolean to say whether the window has been opened (ordered in) since it was created or closed. * Source/NSWindow.m: Use ivar for window view so that the ([NSView -removeFromSuperview]) method will work for a window content view. Add code so that windows are not added to the app window menu until they are first ordered in. Also ensure that windows are removed from that menu (and run loop performers are cancelled) when a window is closed. Tue Dec 7 21:30:00 1999 Richard Frith-Macdonald * Source/NSColor.m: Implemented ([-isEqual:]) * Source/NSImage.m: Fix so any cache is ok if the image rep is opaque. 1999-12-07 Adam Fedor * Source/NSColorWell.m: Added ([+cellClass]) to set cell class to NSActionCell so that setTarget: and setAction: methods at least don't raise an exception. Modified ([-drawRect:]) to conform to OpenStep 4.2 behavior. (Patch from Jonathan Gapen ). * Source/NSColor.m (-set): Set the alpha coverage. Tue Dec 7 10:50:00 1999 Richard Frith-Macdonald * Source/NSButtonCell.m: ([-drawInteriorWithFrame:inView:]) fix code for drawing images above and below text, and add support for drawing in a flipped view. Tue Dec 7 7:00:00 1999 Richard Frith-Macdonald * Source/NSBrowser.m: ([-setPath:]) applied fix suggested by georg@das.ist.org Tue Dec 7 06:23:07 1999 Nicola Pero Major improvements of the save panel and the open panel. * Headers/AppKit/NSWindow.h: Prefixed ivar delegate with underscore. * Source/NSWindow.m: Prefixed ivar delegate with underscore. * Headers/AppKit/NSSavePanel.h: Changed ivars. * Source/NSSavePanel.m: ([NSFileManager -_directoryContentsAtPath:showHidden:]): Removed. ([NSFileManager -hiddenFilesAtPath:]): Removed. ([-_initWithoutGModel]): Removed setMinSize in excess; set title of window to @"". ([-setTitle:]): Dont set window title to @"". ([-_setDirectory:updateBrowser:]): Removed method. ([-_resetDefaults]): New method. ([+initialize]): New method. ([+savePanel]): Moved all reset defaults code to _resetDefaults. ([-dealloc]): New method. ([-init]): Some changings. ([-setAccessoryView:]): Access content view directly. ([-setDirectory:]): Updated. ([-runModalForDirectory:path:filename]): Updated, fixed. ([-directory]): New better implementation. ([-cancel:]): set directory to nil. ([-cancel:]), ([-ok:]): Changed from orderOut: to close:. ([-setDelegate:]): Cleaned, fixed. ([-browser:createRowsForColumn:inMatrix:]): Rewritten, much better. ([-browser:selectCellWithString:inColumn:]): Rewritten, much better. ([-controlTextDidEndEditing:]): Improved, still to finish. * Source/NSOpenPanel.m: Updated for changing in NSSavePanel. ([-_resetDefaults]): New method. ([-_shouldShowExtension:]): New method. ([+openPanel]): Updated. ([-runModalForDirectory:file:types:]): Updated. ([-browser:createRowsForColumn:inMatrix:]): Removed method; not needed any longer after rewriting of NSSavePanel. ([-browser:selectCellWithString:inColumn:]): Rewritten, updated. * Documentation/gnustep-gui.tmpl.texi (NSSavePanel): Added documentation for the new experimental feature GSSavePanelShowProgress. Tue Dec 7 5:40:00 1999 Richard Frith-Macdonald Fixes by Jonathon Gapen - * Source/NSButton.m: Use ([+cellClass]) to obtain cell class. * Source/NSPopUpButton.m: Implement ([+setCellClass:]) and ([+cellClass]) Mon Dec 6 13:32:00 1999 Richard Frith-Macdonald Additional DPS operator for telling backend to mark a document window as being edited/up-to-date. * Source/NSGraphicsContext.m: Added DPSdocedited() * Headers/AppKit/NSGraphicsContext.h: ditto * Headers/AppKit/DPSOperators.h: ditto * Headers/AppKit/GSMethodTable.h: ditto Sat Dec 4 19:41:00 1999 Richard Frith-Macdonald Additional DPS operator in preparation for fixing window code to handle window-manager decoration of windows correctly. * Source/NSGraphicsContext.m: Added method for getting style info. * Headers/AppKit/NSGraphicsContext.h: ditto * Headers/AppKit/DPSOperators.h: ditto * Headers/AppKit/GSMethodTable.h: ditto Fri Dec 3 14:53:00 1999 Richard Frith-Macdonald * Source/NSPopUpButtonCell.m: arbitrary hacks to get window positioning correct - NSWindow still needs some fixing. Fri Dec 3 14:41:00 1999 Michael Hanni * Source/NSPopUpButtonCell.m: more fixes, issues remain. * Source/NSPopUpButton.m: additions to deal with above. * Source/NSMenuView.m: ditto. Fri Dec 3 14:53:00 1999 Richard Frith-Macdonald * Source/NSOpenPanel.m: ([-browser:selectCellWithString:inColumn:]) fixed to set the _fullFileName ivar so that the panel can return the selected filename. * Source/NSWindow.m: Encode/decode top-left point of window for positioning. Fri Dec 3 11:34:00 1999 Richard Frith-Macdonald * Source/NSApplication.m: ([-updateWindowsItem:]) modified to show document state image with new menus. ([-changeWindowsitem:title:filename:]) updated to understand filename format and discard path info. * Source/NSMenuView.m: Implement ([-setNeedsDisplayForItemAtIndex:]) and fixed ([-itemRemoved:]) to update the highlighted item properly and avoid a crash. * Source/NSMenuItemCell.m: Fix so that images are drawn. * Source/NSWindow.m: ([-setTitle:]), ([-setRepresentedFilename:]), ([-setTitleWithRepresentedFilename:]), ([-setMiniwindowTitle:]) rewritten to conform to documented behavior. Fri Dec 3 05:21:40 1999 Nicola Pero * Source/NSTableColumn.m ([-setWidth:]): Tiny changing. * Documentation/gnustep-gui.tmpl.texi: Added some reference documentation for GSHbox, GSVBox, GSTable. Thu Dec 2 17:02:00 1999 Richard Frith-Macdonald * Source/NSView.m: ([-displayRectIgnoringOpacity:]) and ([-displayIfNeededInRectIgnoringOpacity:]) - very tricksy fix so that views are still marked as needing display if any of their subviews need displaying (though the invalid rectangle may be zeroed if all the stuff at this level has been drawn). Thu Dec 2 11:00:00 1999 Richard Frith-Macdonald * Source/NSMenuView.m: ([-trackWithEvent:]) Removed spurious code that caused the bug of submenus being closed when you click on them! Sumbenus should only be closed at the end of a drag operation or if you click on their corresponding item in the parent menu. Thu Dec 2 8:23:00 1999 Richard Frith-Macdonald * Source/NSImage.m: Use opacity values from image reps to cache more intelligently, and set the opacity of caches correctly. Removed an ivar * Headers/AppKit/NSImage.h: removed _repList ivar - not needed * Source/NSView.m: Re-instate needs-display stuff for actual rectangles. Thu Dec 2 01:28:34 1999 Nicola Pero * Headers/AppKit/NSTableHeaderView.h: Added copyright. * Source/NSTableHeaderView.m: Untested first attempt at drawing code; it should work enough to make developing of NSTableView possible. Mouse events to be implemented after NSTableView works. * Headers/AppKit/NSTableColumn.h: Added copyright, updates. * Source/NSTableColumn.m: Rewritten nearly everything, class now finished, but not tested. Wed Dec 1 14:55:00 1999 Richard Frith-Macdonald * Source/NSColor.m: Fixed a few transparency bugs in system colors. * Source/NSImage.m: Caching rewrite - using NSCachedImageRep - works with xgps, but probably not xdps. There are two global variables to control this - 1. NSImageDoesCaching To turn caching on - when an image is drawn it is cached, if it is redrawn with the same background color set (excluding transparent) then the cached version is used. 2. NSImageForceCaching To force the cache to be used irrespective of the background color. Wed Dec 1 11:55:00 1999 Richard Frith-Macdonald * Source/NSWindow.m: Removed spurious setNeedsDisplay when changing the contentView of a window - it's up to the programmer to do that. * Source/NSView.m: Removed many spurious setNeedsDisplay calls when altering the view hierarchy - it's up to the programmer to do a single call at the end of the work. Wed Dec 1 8:27:00 1999 Richard Frith-Macdonald Applied and modified/rewrote patch by Jonathan Gapen * Headers/gnustep/gui/NSImage.h: Moved excess BOOL ivar to _flags. * Headers/NSView.h: Added -enclosingScrollView method and NSScrollView class reference. * Source/NSImage.m ([NSImage -setFlipped:]): Implemented. ([NSImage -isFlipped]): Implemented. NOTE: NSImage not updated to respect flipped setting. * Source/NSView.m ([NSView -enclosingScrollView]): Implemented. 1999-11-30 Adam Fedor * Headers/gnustep/gui/NSBrowser.m: Add some ivars, removed others. * Source/NSBrowser.m: Rewrite for better functionality. * Source/NSBrowserCell.m (-drawInteriorWithFrame:inView): Check to make sure we have a controlView. * Source/NSCell.m: Likewise. * Source/NSView.m (-lockFocusInRect:): Check to make sure we have a window. (patches from F. Wolff ). Tue Nov 30 19:44:00 1999 Richard Frith-Macdonald * Source/NSWindow.m: Rewrote ([-encodeWithCoder:]) and ([-initWithCoder:]) so they actually work (more or less). Fixed ([-setExcludedFromWindowsMenu:]) to update windows menu. Tue Nov 30 11:52:00 1999 Richard Frith-Macdonald * Source/NSCachecImageRep.m: Improve initialisation and added partial implementations (no scaling) for ([-drawAtPoint:]) and ([-drawInRect:]) - the superclass versions didn't work due to current state of gstate management. Mon Nov 29 17:23:00 1999 Richard Frith-Macdonald * Source/NSMatrix.m: Memory bounds error fixed. * Source/NSOpenPanel.m: use any supplied filetype as denoting a file package for the purposes of differentiating between packages and directories. Also - better fix for selecting directories when multiple selection is allowed. Mon Nov 29 11:43:00 1999 Richard Frith-Macdonald * Source/NSBundle.m: rewrite with new nib loading method. * Source/GNUmakefile: Added NSNibConnector.h * Headers/AppKit/NSNibConnector.h: new file * Headers/AppKit/NSNibLoading.h: Update Mon Nov 29 6:05:00 1999 Richard Frith-Macdonald * Source/NSApplication.m: ([-iconWindow]) new (non-standard) method. * Source/NSWindow.m: ([-orderWindow:relativeTo:]) added code to resign key/main window status on ordering out. Also, set up a new key/main window - if no suitable candidates are available, use the app icon window or the main menu window. Sun Nov 28 19:37:00 1999 Richard Frith-Macdonald * Source/NSOpenPanel.m: ([-filenames]) fix to handle multiple selection correctly - was duplicating name of selected item. Sun Nov 28 04:44:43 1999 Nicola Pero First implementation of editing in NSForm, NSMatrix. * Source/NSFormCell.m ([-initTextCell:]): Set editable by default. * Source/NSForm.m ([-selectTextAtIndex:]): Implemented. * Source/NSMatrix.m: Started work of prefixing ivars with underscore; ([-selectText:]): Implemented. ([-selectTextAtRow:column:]): Implemented. ([-textDidBeginEditing:]): Implemented. ([-textDidChange:]): Implemented. ([-textDidEndEditing:]): Implemented. ([-textShouldBeginEditing:]): Implemented. ([-textShouldEndEditing:]): Implemented. ([-tabKeyTraversesCells]): Implemented. ([-setTabKeyTraversesCells:]): Implemented. ([-mouseDown:]): Added code to start editing if needed. ([-setDelegate:]): Implemented. ([-keyDown:]): Removed old implementation -- still to do the new one. ([-acceptsFirstResponder]): Fixed. ([-abortEditing]): Implemented. ([-currentEditor]): Implemented. ([-validateEditing]): Implemented. ([-_selectNextSelectableCellAfterRow:column:]): : New method. ([-_selectPreviousSelectableCellBeforeRow:column:]): New method. * Headers/AppKit/NSMatrix.h: Updated in sync. * Source/NSSavePanel.m: Use a NSForm for the text field; cleanup. * Headers/AppKit/NSSavePanel.h: Updated. * Source/NSOpenPanel.m: Updated. Sat Nov 27 04:30:15 1999 Nicola Pero * Source/NSSavePanel.m ([-directory]): Maintenance, clean up. * Source/NSSavePanel.m: Moved code between ([-_setDirectory:updateBrowser:]) and ([-setDirectory:]) so that we check existence of directories etc only if strictly needed. * Source/NSSavePanel.m ([-browser:createRowsForColumn:inMatrix:]): Maintenance, clean up. Thu Nov 26 20:16:00 1999 Richard Frith-Macdonald * Source/NSAttributedString.m: Added and rewrote RTFD additions contributed by Daniel Bðhringer. Thu Nov 25 18:59:34 1999 Nicola Pero * Source/NSControl.m ([-setIntValue:]), ([-setFloatValue:]), ([-setDoubleValue:]): Abort editing before setting the value. Thu Nov 25 11:44:00 1999 Richard Frith-Macdonald * Source/NSMenu.m: Tidying, performnce tweaks, memory leak fixes. * Source/NSPopUpButton.m: Tidied. * Headers/AppKit/NSPopUpButtonCell.h: Use _selectedItem ivar rather than _selectedIndex. * Source/NSPopUpButtonCell.m: Use _selectedItem ivar rather than _selectedIndex, fix memory leaks, and various hacks to stop things crashing. Thu Nov 25 1999 Nicola Pero * Source/NSMenuView.m ([-trackWithEvent:]): Fixed bug which was crashing save panel when run from a menu. We should stop the periodic events before performing the user-selected action, otherwise any legitimate attempt of starting the periodic events during performance of the action crashes the app. 1999-11-24 Adam Fedor * Source/GNUmakefile: Alphabatize headers. * Source/NSPasteboard.m: Fix typo in format string. Wed Nov 24 16:58:00 1999 Richard Frith-Macdonald * Source/NSMenuView.m: ([-sizeTofit]) oops - fixed error in last mod. Wed Nov 24 1999 Nicola Pero The three new autolayout classes; code extremely stable, API experimental. Documentation/example code forthcoming. * Source/GSHbox.m: New file. * Source/GSTable.m: New file. * Source/GSVbox.m: New file. * Headers/AppKit/GSHbox.h: New file. * Headers/AppKit/GSTable.h: New File. * Headers/AppKit/GSVbox.h: New file. * Source/GNUmakefile: Updated for new files. Tue Nov 23 14:08:00 1999 Richard Frith-Macdonald * Source/NSApplication.m: Rewrite focus handling, preliminary attempt to cope with window close etc. * Source/NSWindow.m: Some focus fixes etc. * Source/NSMenuView.m: ([-sizeTofit]) hacked out reference to _isBeholdenToPopUpButton to get this to compile again. 1999-11-22 Michael Hanni * Source/NSPopUpButton.m: rewrite. * Source/NSPopUpButtonCell.m: ditto. * Source/?.m: a few other misc fixes. will document. Mon Nov 22 17:33:00 1999 Richard Frith-Macdonald * Source/NSApplication.m: Start listening for window notifications whenm the app becomes active, and check to see which windows are key and main. ([-unhide:]) fixed to activate app even if it wasn't hidden. 1999-11-21 Tim McIntosh * Model/GMAppKit.m ([NSMenuItem -initWithModelUnarchiver:]), ([NSMenuItem -encodeWithModelArchiver:]): "menu" should not be a persistent field. [NSMenu addItem:] will reject menu items for which [NSMenuItem menu] returns non-nil. Mon Nov 22 14:51:33:00 1999 Richard Frith-Macdonald * Source/NSWindow.m: Tidied activation/deactivation code. * Source/NSApplication.m: Fixed Windows menu for new menu API. Changed to use arrays to store deactivated/hidden windows and to keep track of key window when hidden. Watch window notifications to keep track of which window is key/main. Handle making window key and ordering front in modal sessions. Sat Nov 20 6:56:00 1999 Richard Frith-Macdonald * Source/NSMenu.m: Implemented ([-initDefaults]) to set window level in pre-initialisation so the information is available when backend window is created. 1999-11-19 David Lazaro Saz * Source/NSMenuView.m ([NSMenuView -trackWithEvent:]): Added two defines (MOVE_THRESHOLD_DELTA and DELAY_MULTIPLIER) to make nicer the menu traversing. 1999-11-18 David Lazaro Saz * Source/NSPopUpButton.m ([NSPopUpButton +initialize]): Fixed core dump on init. Remains core on select. Thu Nov 18 1999 Nicola Pero * Source/NSCell.m ([-editWithFrame:inView:editor:delegate:event:]), ([-selectWithFrame:inView:editor:delegate:start:length:]): Fixed bug. * Source/NSWindow.m ([-keyViewSelectionDirection]): Implemented. ([-selectKeyViewFollowingView:]),([-selectKeyViewPrecedingView:]), ([-selectNextKeyView:]),([-selectPreviousKeyView:]): Improvement, made ready to support TABbing with selection of text between views which are not necessarily textfields, eg forms. * Headers/AppKit/NSWindow.h: Added ivar _selection_direction. 1999-11-18 David Lazaro Saz * Source/NSMenuView.m ([NSMenuView -performActionWithHighlightingForItemAtIndex:]): Added a short delay to item unhiglighting (100ms). ([NSMenuView -trackWithEvent:]): When an attached menu is present other items only highlight when the cursor stops at them. 1999-11-17 David Lazaro Saz * Source/NSWindow.m ([NSWindow -setLevel:]): Removed orderWindow:RelativeTo: message that made impossible to setup the window level before displaying the window. * Source/NSApplication.m ([NSApplication -setMainMenu:]): The window level for the main menu is set here to NSMainMenuWindowLevel. The old main menu window level is reverted to NSSubmenuWindowLevel. * Source/NSMenu.m ([NSMenu -initWithTitle:]): Changed init code to take into account changes made in the NSMenuWindow class. ([NSMenuWindow -init]): This is the main init method for this class. It is responsible of setting the window level to NSSubmenuWindowLevel. * Model/GMAppKit.m (NSMenu, NSMenuItem): Added preliminary changes to support new menuing code. Wed Nov 17 1999 Nicola Pero * Source/NSBox.m ([-isOpaque]): Added method. * Source/NSBrowser.m ([-isOpaque]): Added method. * Source/NSBrowserCell.m ([-isOpaque]): Added method. * Source/NSButtonCell.m ([-isOpaque]): Updated. * Source/NSColorWell.m ([-isOpaque]): Added method. * Source/NSControl.m ([-isOpaque]): Added method. * Source/NSFormCell.m ([-isOpaque]): Improved. * Source/NSMatrix.m ([-isOpaque]): Added method. * Source/NSSliderCell.m ([-isOpaque]): Added method. * Source/NSTabView.m ([-isOpaque]): Added method. * Source/NSText.m ([-isOpaque]): Added method. * Source/NSTextFieldCell.m ([-isOpaque]): Added method. * Source/NSTextFieldCell.m: Tiny optimization by using _isOpaque. * Headers/AppKit/NSTextFieldCell.h: Added ivar _isOpaque. * Source/NSCell.m ([-drawInteriorWithFrame:inView:]): Removed [unused] drawing of background. Now the drawing is minimal, but easier to subclass. ([-setUpFieldEditorAttributes:]): Removed setting of background. * Source/NSBrowserCell.m ([-editWithFrame:inView:editor:delegate: event:]), ([-endEditing:]), ([-_handleKeyEvent:]): Useless, removed. * Headers/AppKit/NSButtonCell.h: Removed declaration of -performClick: to pacify the compiler. * Source/NSMatrix.m ([-nextText]), ([-previousText]), ([-setNextText:]), ([-setPreviousText:]): Implemented. 1999-11-16 David Lazaro Saz * Source/NSMenu.m: Almost total rewrite of some of the parts. Added all useful MacOS X Server changes. * Source/NSMenuView.m: ditto. * Source/NSMenuItem.m: Reimplemented to be compatible with MacOS X Server. The online docs are wrong in respect to this class so the changes were infered from a lot of different places. * Source/NSMenuItemCell.m: Reimplemented to be just like another form of NSButtonCell and comply with MacOS X Server specs changes. * Source/NSApplication.m ([NSApplication -setMainMenu:]): Changes to support changes in the menuing code. * Source/GSServicesManager.m ([GSServicesManager -updateServicesMenu]): Update for using new NSMenuItem code. This means that it does send a submenu message instead of a target message to get the submenu. * Headers/gnustep/gui/NSView.h: Added declaration for the removeFromSuperviewWithoutNeedingDisplay method. Tue Nov 16 10:49:00 1999 Richard Frith-Macdonald * Source/NSView.m: Removed opaque-view optimisation in favour of retaining MacOS-X compatibility. * Source/GMAppKit.m: ditto. Tue Nov 16 7:05:00 1999 Richard Frith-Macdonald * Source/NSApplication.m: ([-run]) make sure user defaults are up to date on exit. * Source/NSWindow.m: various changes to sving window frame info. Use top-left as window origin, and save in OPENSTEP format. Include code to save NSMenuWindow locations exactly as in MacOS-X also. Mon Nov 15 21:29:00 1999 Richard Frith-Macdonald * Headers/gnustep/gui/NSMenu.h: Make menu window inherit from NSPanel * Headers/gnustep/gui/NSResponder.h: New flag for window and view. * Headers/gnustep/gui/NSWindow.h: Condense flags into a bitfield. * Source/GSHelpManagerPanel.m: Tidy and fix error in ([-release]). * Source/NSApplication.m: Fixup references into NSWindow ivars. * Source/NSCachedImageRep.m: ditto. * Source/NSMenu.m: Fixup references into NSWindow ivars, and remove unnecessary code for hide/unhide on app deactivation/activation. * Source/NSPanel.m: Fixup references to NSWindow ivars and make panels hide on app deactivation by default. * Source/NSView.m: Fixup references to NSWindow ivars and move one ivar into flags field defined in NSResponder.h * Source/NSWindow.m: Change flags to be in bitfield and implement code to handle hide/unhide on app deactivation/reactivation. Mon Nov 15 16:57:00 1999 Richard Frith-Macdonald * Source/NSFontPanel.m: Removed a couple of bogus methods that were preventing display of a font panel. Mon Nov 15 16:09:00 1999 Richard Frith-Macdonald * Headers/gnustep/gui/GSTrackingRect.h: Tidied to more compact layout. * Headers/gnustep/gui/NSCursor.h: Closer to MacOS-X spec. * Headers/gnustep/gui/NSResponder.h: New flag for cursor rect validity * Headers/gnustep/gui/NSTextField.h: Removed unused ivar. * Source/GSTrackingRect.m: Alter for more compact ivars. * Source/NSCell.m: Implement method for cursor tracking. * Source/NSControl.m: Implement default -resetCursorRects. * Source/NSCursor.m: Tidied up and added undocumented behavior to make cursor handling on entry/exit work nicely - push new cursor onto stack on entry to rectangle, pop it off again on exit. * Source/NSTextField.m: Remove cursor handling stuff - it's done in NSCell and NSControl. * Source/NSView.m: Many little changes for correct cursor rectangle handling. * Source/NSWindow.m: Changes for cursor rectangle handling. Mon Nov 15 1999 Nicola Pero * Headers/AppKit/NSFormCell.h: Prefixed ivars with underscore; added ivar _autoTitleWidth. * Source/NSFormCell.m: Revised/rewritten most code. Rethinked drawing code to be fully compliant with OS spec and to support editing. Also, minor optimization: cache titleWidth. Sun Nov 14 1999 Nicola Pero Modified code so that text is highlighted only when moving between fields with TAB, not on mouse events: * Source/NSTextField.m ([-becomeFirstResponder]), ([-mouseDown:]): Modified. ([-acceptsFirstMouse:]): New method. * Source/NSWindow.m: ([-selectKeyViewPrecedingView:]), ([-selectPreviousKeyView:]), ([-selectNextKeyView:]), ([-selectKeyViewFollowingView:]): Select text if the newly selected view is kind of text field. Sun Nov 14 1999 Nicola Pero Huge improvements of NSTextField and related code. Fix for nil target: * Source/NSApplication.m ([-sendAction:to:from:]): Deal with nil targets as per spec. Corrected NSControl's delegate stuff: * Headers/AppKit/NSControl.h: Moved methods 'implemented by the delegate' from the class interface to an informal protocol definition. * Source/NSControl.m: Removed implementation, which was nearly void anyway, of 'methods implemented by delegate'. They should be implemented by the delegate, not by the control. Fix in NSControl: * Source/NSControl.m ([-setStringValue:]): Abort editing, if any, before setting the value. Little fix in NSCell to allow abort/checking of entered text: * Source/NSCell.m ([-endEditing:]): Do not set the cell's string value to the text. This should be done by the delegate specified in editWithFrame:inView:editor:delegate:event: upon receiving the -textDidEndEditing: message. Fix to make setSelectable/setEditable work: * Source/NSCell.m ([-setUpFieldEditorAttributes:]): set editability/selectability of text object. Fixed and simplified treating of border during editing; also, do not invoke setUpFieldEditorAttributes: in the cell; this has to be done by the control: * Source/NSCell.m ([-editWithFrame:inView:editor:delegate:event:]), ([-selectWithFrame:inView:editor:delegate:start:length:]): Invoke cell's drawingRectForBounds: and other minor fixes. Added full NSTextField's delegate support; added real RETURN, TAB, Shift+TAB support; tons of fixes; major rewriting of much of NSTextField: * Headers/AppKit/NSTextField.h: Prefixed ivars with underscore, added ivar _text_object. * Source/NSTextField.m ([-abortEditing]), ([-currentEditor]), ([-validateEditing]): Implemented. ([-keyDown:]): Removed. ([-acceptsFirstResponder]), ([-becomeFirstResponder]), ([-mouseDown:]), ([-selectText:]), ([-setDelegate:]), ([-textShouldEndEditing:]), ([-textShouldBeginEditing:]), ([-textDidEndEditing:]), ([-textDidChange:]), ([-textDidBeginEditing:]): Completely rewritten, often from scratch. * Source/NSTextField.m, Source/NSSecureTextField.m: Standardized initialization. Cleaned up NSText delegate stuff and fixed some nasty bugs during the work: * Source/NSText.m: Removed implementation of methods 'implemented by the delegate'. Moved the code around where needed. Implemented method missing in NSWindow. * Source/NSWindow.m ([NSWindow -endEditingFor:]): Implemented. Added in NSSavePanel support for editing the file name in the textfield: * Source/NSSavePanel.m ([NSSavePanel -_initWithoutGModel]): Set self as delegate to _form; ([NSSavePanel -controlTextDidEndEditing:]): New method. Fri Nov 12 1999 Nicola Pero * NSBrowser.m: [GSBrowserTitleCell] updated ivar draw_background to the new name _draws_background. Fri Nov 12 12:02:00 1999 Richard Frith-Macdonald * Source/NSMatrix.m: ([-setCellClass:]) was calling methodForSelector when it should have been instanceMethodForSelector. Fri Nov 12 11:53:52 1999 Lyndon Tremblay * NSBrowser.m: Removed access to unused variable `draw_background', which prevented successful compile. Fri Nov 12 1999 Nicola Pero NSTextFieldCell made OpenStep compliant; this class is finished. * Headers/AppKit/NSTextFieldCell.h Clean up. Removed some useless ivars, prefixed names of remaining ones with underscores; removed useless methods. * Source/NSTextFieldCell.m: Cleaned up completely, fixed, simplified, removed lot of useless stuff, checked for compliance. * Source/NSTextField.m, Source/NSTableHeaderCell.m: microscopic trivial updates to keep in sync with NSTextFieldCell. Thu Nov 11 1999 Nicola Pero * Source/NSText.m Manually reformatted the whole code. Wed Nov 10 1999 Nicola Pero Debugged/rewritten handling of special key events, such as Return or TAB, of text field editors: * Source/NSText.m ([-keyDown:]): Debugged, rewritten. * Source/NSText.m ([-acceptsFirstResponder]), ([-resignFirstResponder]), ([-becomeFirstResponder]): Rewritten to deal correctly with delegate. * Headers/AppKit/NSText.h: Added enumeration of important unicodes. Improved interaction of cells with text field editors, better support for fonts, colors when editing: * Source/NSCell.m ([-editWithFrame:inView:editor:delegate:event:]): Fixes (eg vertical position of rect used for drawing, display text editor, call setUpFieldEditorAttributes:). ([-selectWithFrame:inView:editor: delegate:start:length:]): Fixes (eg don't make the text object first responder before having put it in the view tree; added selection of the range) [untested]. * NSCell.m ([-setUpFieldEditorAttributes:]): First implementation. * Source/NSTextFieldCell.m ([-setUpFieldEditorAttributes:]): First implementation. Tue Nov 9 1999 Nicola Pero * Source/NSBrowser.m ([NSBrowser -setPath:]): Tidied, and fixed code which had been broken by the recent fix to [NSMatrix -cells]. Sun Nov 7 1999 Richard Frith-Macdonald * Source/NSView.m: Change debug logging for negative width and height values to use NSWarn... macros instead. Fri Nov 5 1999 Richard Frith-Macdonald * Source/NSApplication.m: ([-hide:]) and ([-unhideWithoutActivation]) Changed to hide/unhide all windows (excluding a couple of special cases - menu windown and app icon windows) as per the spec, not just menus that appear in the windows menu. Thu Nov 4 1999 Richard Frith-Macdonald * Source/NSApplication.m: ([-runModalforWindow:]) make the window key and order to front as specified in MacOS-X docs. * Source/NSPanel.m: Remove redundant code from alert panels - now done in NSApplication. Tue Nov 2 1999 Richard Frith-Macdonald * Source/NSMatrix.m: Complete rewrite of code for handling cells within a matrix - use plain C arrays for holding the objects and cache method implementations for creating new cells. Also make GC aware for some future date when we can use GC. * Headers/AppKit/NSMatrix.h: ivar changes for rewrite. * Source/NSCell.m: Updated to notice changes in system colors, also optimised a little by caching some classes. Sat Oct 30 1999 Nicola Pero Still work in progress, but this is a first preview of the new NSSavePanel, NSOpenPanel. I am aiming at making these classes fully compliant soon. * Source/NSOpenPanel.m: Completely rewritten. A lot of functionalities which were missing have now been implemented. * Source/NSSavePanel.m: Rewritten a lot of parts, mainly: allocation/initialization (but could not test the gmodel loading), browser delegate methods, appearance (the gmodel has not been updated -- when we have IM it will be very easy), and with the specs in hand I checked all the code and did a lot of improvements. * Headers/AppKit/NSOpenPanel.h: Changed ivars. * Headers/AppKit/NSSavePanel.h: Changed ivars. * Model/GMAppKit.m: Added NSOpenPanel. 1999-10-29 Adam Fedor * Remove backend application, cursor, and screen classes and use new window ops. * Headers/gnustep/gui/DPSOperators.h: New window ops. * Headers/gnustep/gui/GSMethodTable.h: Likewise. * Headers/gnustep/gui/NSGraphicsContext.h: Likewise. * NSGraphicsContext.m: Likewise. * Headers/gnustep/gui/NSCursor.h: Add enum for standard cursors. * Source/NSCursor.m: Implement methods using new cursor ops. * Source/NSApplication.m: Move icon window classes from backend here and use new window ops. * Source/NSScreen.m: Implement methods using new window ops. * Source/NSView.m (-registerForDragTypes:): Fix typo? wrong list being removed. * Source/NSWindow.m (+_windowList): New method. Wed Oct 27 1999 Nicola Pero Changings suggested by Andrew Lindesay: * Source/NSBrowser.m: draw a border around its horizontal scroller. Updated code to compute the border during calculation of sizes; ([NSBrowser -drawRect:]): draw horizontal scroller border. * Source/NSSavePanel.m ([NSSavePanel -_initWithoutGModel]): Changed Ok button from 'Ok' to 'OK'. * Panels/SavePanel.gmodel: idem. Wed Oct 27 1999 Nicola Pero Minor improvements on last days' changings. * Source/NSBrowserCell.m: Use simple bold and no color when fontifying. * Documentation/gnustep-gui.tmpl.texi (NSBrowserCell): Updated description. * Source/NSSavePanel.m: More cleanup in size dealing. 1999-10-26 Adam Fedor * Source/NSWindow.m (-dealloc): Remove check for context. Wed Oct 27 1999 Nicola Pero Patches by ackyugo@geocities.co.jp fixing bug (horizontal scroller non resized) in NSBrowser upon resize: * Source/NSBrowser.h: Added forgotten ivar _scrollerRect; * Source/NSBrowser.m: ([-initWithFrame:]), ([-tile]): Use ivar _scrollerRect appropriately; ([-resizeSubviewsWithOldSize:]): Update horizontal scroller frame using _scrollerRect. Tue Oct 26 1999 Nicola Pero SavePanel tidyups, simplifications and fixes for better accessoryView support. * Headers/gnustep/gui/NSSavePanel.h: Removed ivars _oldContentFrame, _oldTopViewFrame. * Source/NSSavePanel.m ([NSSavePanel -setAccessoryView:]): Cleaned, improved and tested size calculations. * Source/NSSavePanel.m ([NSSavePanel -_initWithoutGModel]): Set properly all the autoresizingMasks. Added experimental feature (*disabled* by default) to Browser Cells. Setting the user preference "GSBrowserCellFontify" to 'YES' draws the leaf and non-leaf cells with different fonts and colors. The API is stricltly unchanged in all cases. * Documentation/gnustep-gui.tmpl.texi (NSBrowserCell): Written short description of how to turn the experimental feature on/off. * Source/NSBrowserCell.m ([+initialize]): Initialize fonts and colors if fontify is on. * Source/NSBrowserCell.m ([-initTextCell:]): use setLeaf: instead of setting the ivar directly. * Source/NSBrowserCell.m ([-setLeaf:]): If fontification is on, change appropriately the text cell font and color. Tue Oct 26 1999 Nicola Pero Fixes for Controls and Cells: * Source/NSButton.m ([-selectedCell]): Removed (duplicate of NSControl's method). * Source/NSCell.m ([-setImage:]): Accept nil argument. * Source/NSCell.m ([-setStringValue:]): Make the cell a text cell. * Source/NSControl.m ([-selectedCell]): Always return the control's cell. * Source/NSTextField.m ([-selectedCell]): Removed (duplicate of NSControl method). Class Rewritten: * Source/NSTableHeaderCell.m: Rewritten from scratch, tested. This class is now complete and fully compliant. Headers Fix: * Headers/gnustep/gui/AppKit.h: Include NSTableColumn.h. * Headers/gnustep/gui/NSTableHeaderCell.h: Added copyright notice. Mon Oct 25 1999 Nicola Pero The merit should all go to David Lee Ludwig , for reporting the bug in border drawing, and suggesting the fix. * Source/NSBrowser.m: ([GSBrowserTitleCell]): new class. * Source/NSBrowser.m ([-initWithFrame:]): use GSBrowserTitleCell to draw the titles. Mon Oct 25 1999 Nicola Pero * Source/NSBrowser.m ([-initWithFrame:]): fixed bug in drawing title background. Sun Oct 24 1999 Nicola Pero * Source/NSWindow.m ([GSWindowView -setFrame:]): Send to the content view a resizeWithOldSuperviewSize: instead of a setFrame:. Sat Oct 23 1999 Nicola Pero Fixed critical bug. Now setting a flipped view as a window's contentView should work. * Source/NSView.m ([-convertPoint:fromView:]): Use window's contentView's superview and not contentView when argument is nil. * Source/NSView.m ([-convertPoint:toView:]): idem. * Source/NSView.m ([-convertRect:toView:]): idem. * Source/NSView.m ([-convertRect:fromView:]): idem. * Source/NSView.m ([-convertSize:fromView:]): idem. * Source/NSView.m ([-convertSize:toView:]): idem. 1999-10-22 Adam Fedor * Source/NSWindow.m (-initWithContentRect:...): Remove window from windows menu if window_level is > dock window. * Source/NSMenu.m (NSMenuWindow): Implement class (from backend) so backend class can be removed. Sat Oct 23 1999 Nicola Pero * Source/NSSavePanel.m Moved FileManager at the beginning of file, to avoid compiler warnings. ([-_initWithoutGModel]): Made the prompt non selectable. * Source/NSScroller.m ([-trackScrollButtons:]): Removed useless lockFocus:. * Source/NSSlider.m ([-mouseDown:]): idem. 1999-10-22 Adam Fedor * Source/NSColor.m ([NSColor -set]): Implement (from backend). Fri Oct 22 1999 Nicola Pero * Documentation/gnustep-gui.tmpl.texi (Keyboard Modifiers): Added short documentation on how to configure the xgps/xdps backend keyboard modifiers. 1999-10-21 Adam Fedor * Remove backend window class and use new window ops. * Headers/gnustep/gui/DPSOperators.h: New window ops. * Headers/gnustep/gui/GSMethodTable.h: Likewise. * Headers/gnustep/gui/NSGraphicsContext.h: Likewise. * NSGraphicsContext.m: Likewise. * Headers/gnustep/gui/NSEvent.h: Add GSAppKitWindowClose event type. * Headers/gnustep/gui/NSWindow.h: Move some backend methods here. * Source/NSEvent.m (-window): Use new NSWindow method. * Source/NSWindow.m (-dealloc): Use window ops. (-init:...): Likewise. (-flushWindow): Implement using window ops. (-processResizeEvent): New method. (-sendEvent:) Tidy. Thu Oct 21 1999 Nicola Pero * Source/NSPopUpButton.m ([-selectItemAtIndex:]): Mark the button as needing redisplay when the selected item is changed. This is effective, but temporary. Replace it by a call to synchronizeTitleAndSelectedItem as soon as the latter works. Tue Oct 19 11:33:46 1999 Lyndon Tremblay * Source/NSMenuView.m: ([-sizeToFit]) added handling for title width. ([-setTitleWidth:]) new private function called by NSMenu to make the menu not get smaller than menu title. * Source/NSMenu.m: (-[sizeToFit]) added handling for title width. * Headers/AppKit/NSMenuView.h: added declaration for -setTitleWidth. Tue Oct 19 1999 Richard Frith-Macdonald * Source/NSApplication.m: ([-terminate:]) modification based on patch by Aled.Davies@bigfoot.com to send notification. * Source/NSWorkspace.m: Fix to prevent duplicate notifications. Tue Oct 19 1999 Nicola Pero Changing suggested by Richard: * Source/NSApplication.m Removed ([-isRunningModalForWindow:]) in favour of ([-modalWindow]). This method returns the window currently running a modal loop, if any; otherwise, nil. * Source/NSWindow.m ([-keyDown:]): changed accordingly. * Headers/AppKit/NSApplication.h: changed accordingly. Minor changings/fixes: * Source/NSCell.m ([-performClick:]): Rewritten the case when the cell has no control view. Also, made click faster. * Source/NSControl.m ([-performClick:]): Added missing method. * Headers/AppKit/NSControl.h: Added corresponding declaration. * Source/NSMatrix.m ([-initWithFrame:mode:prototype:numberOfRows: numberOfColumns:]): if numberOfRows or numberOfColumns is zero, use default size for cells. * Source/NSMenuView.m ([-performKeyEquivalent:]): implemented method. * Source/NSSavePanel.m ([-_initWithoutGModel]): Make the panel non resizable. 1999-10-18 Lyndon Tremblay * Headers/gnustep/gui/NSSecureTextField.h: Added. * Headers/gnustep/gui/NSTextField.h: Added method to share initialization data with NSSecureTextField. * Source/NSSecureTextField.m: Added, 90% done. * Source/NSTextField.m ([-_initFieldWithFrame:cellClass:]): Added for shared initialization code with NSSecureTextField. * Images/common_Diamond.tiff: Added for NSSecureTextField's bullets. * GNUmakefile: Added rules for NSSecureTextField's sources. Tue Oct 14 1999 Nicola Pero Sorry for having messed things up using the wrong modifier for key equivalents. Thanks to Richard for pointing this out. * Source/NSApplication.m ([-sendEvent:]): Changed modifier back to NSCommandKeyMask. * Source/NSButtonCell.m ([-_init]): Changed back to use NSCommandKeyMask. * Source/NSWindow.m ([-keyDown:]): Use NSCommandKeyMask for key equivalents. Tue Oct 14 1999 Lyndon Tremblay * Source/NSMatrix.m: ([-initWithFrame:]): Changed default cellSize to be convient and match NSMatrix's frame. Wed Oct 13 1999 Nicola Pero You should now be able to use key equivalents for buttons. See core/Testing/Calculator.app for a running example. * Source/NSApplication.m ([-sendEvent:]): Changed modifier used for key equivalents to NSControlKeyMask. * Source/NSButtonCell.m ([-_init]): By default, set keyEquivalentModifierMask to NSControlKeyMask. * Source/NSButton.m ([-keyDown:]): Removed invocation of peformKeyEquivalent:. Key equivalents are not processed here. * Source/NSWindow.m ([-keyDown:]): After all else fails, try considering the key as a keyEquivalent without Control pressed. * Source/NSWindow.m ([-initDefaults]): Make the default first responder the window itself. ([-display]): Modified initial first responder stuff accordingly. Tue Oct 12 1999 Richard Frith-Macdonald * Source/NSApplication.m: Attempts to fix ordering of application activation und unhiding on launch. * Source/NSWorkspace.m: Patch by Aled.Davies@bigfoot.com to send notifications on application launch * Source/NSWorkspace.m: Patch by Aled.Davies@bigfoot.com to send notifications on application launch. Tue Oct 12 1999 Richard Frith-Macdonald * Source/NSWorkspace.m: Added private notification center class to handle notifications to be passed between applications. Sat Oct 10 1999 Nicola Pero nextText and previousText can now be safely and almost trivially implemented using the nextKeyView and previousKeyView facilities. Today I did it for NSTextField: * Headers/AppKit/NSTextField.h: Removed ivars nextText and previousText * Source/NSTextField.m ([-encodeWithCoder:]), ([-initWithCoder:]): Update for removal of ivars nextText, previousText. * Model/GMAppKit.m ([NSTextField -initWithModelUnarchiver:]), ([NSTextField -encodeWithModelArchiver:]): Updated for removal of ivars. * Source/NSTextField.m ([-nextText]), ([-previousText]), ([-setNextText:]), ([-setPreviousText:]): rewritten, by using nextKeyView stuff. * Source/NSTextField.m ([-keyDown:]): Completely rewritten the part before the cell edit. A little reorganization of keyboard event handling code written in the last days; added Escape support: * Headers/AppKit/NSApplication.h: Added prototype for -isRunningModalForWindow:. * Source/NSApplication.m ([-isRunningModalForWindow:]): new method (a GNUstep extension). Return YES if there is a modal session running and it is running with the specified window. * Source/NSApplication.m ([-runModalForWindow:]): Close the window on abort. * Source/NSTextField.m ([-keyUp:]): Removed method, useless. * Source/NSView.m ([-keyDown:]): Removed method. Moved the code to [NSWindow -keyDown:]. * Source/NSView.m ([-keyUp:]): Removed method, useless. * Source/NSWindow.m ([-keyDown:]): Implemented method. Added Escape support. Sat Oct 9 1999 Nicola Pero * Source/NSButton.m ([-keyDown:]): Perform a click if the key is SPACE or ENTER. * Source/NSCell.m ([-performClick:]): Completely rewritten. * Source/NSView.m ([-previousValidKeyView]), ([-nextValidKeyView]): fix to avoid an infinite loop. 1999-10-09 * Model/GMAppKit.m ([NSPopUpButton -initWithModelUnarchiver:]): decode itemArray as an array. * Source/GNUmakefile: Move installed headers to gnustep/AppKit * Model/GNUmakefile: Likewise. 1999-10-08 * Model/GMAppKit.m ([NSPopUpButton -encodeWithModelArchiver:]): Encode frame. Fri Oct 8 1999 Nicola Pero Implementation of key view loop. * Headers/AppKit/NSView.h: New instance variables _nextKeyView and _previousKeyView. Added prototypes for the new methods implemented in NSView.m. * Model/GMAppKit.m ([NSView -encodeWithModelArchiver:]), ([NSView -initWithModelUnarchiver:]): Updated for new ivars _nextKeyView, _previousKeyView. * Source/NSView.m ([-dealloc]): Remove references to the view in _nextKeyView and _previousKeyView. * Source/NSView.m ([-initWithCoder:]), ([-encodeWithCoder:]), ([-initWithFrame:]): Updated for new ivars _nextKeyView, _previousKeyView. * Source/NSView.m ([-setNextKeyView:]): implemented method. ([-nextValidKeyView]): implemented method. ([-nextValidKeyView]): implemented method. ([-setPreviousKeyView:]): implemented method. ([-previousValidKeyView]): implemented method. ([-previousValidKeyView]): implemented method. * Source/NSView.m ([NSView -keyDown:]): implemented method to process TAB/SHIFT+TAB. ([NSView -keyUp:]): idem. * Source/NSWindow.m: ([-selectPreviousKeyView:]): implemented method. ([-selectKeyViewFollowingView:]): implemented method. ([-selectNextKeyView:]): implemented method. ([-selectKeyViewPrecedingView:]): implemented method. Fix, mainly useful for custom control subclasses: * Model/GMAppKit.m ([NSControl -initWithModelUnarchiver:]): If the encoded cell is nil, create a new one (of the class associated with the type of NSControl being decoded). This is needed for NSControl custom subclasses encoded through IMCustomView. ([NSMatrix -initWithModelUnarchiver:]): Do not set delegate if nil. Tue Oct 5 1999 Nicola Pero * Model/IMConnectors.m ([IMOutletConnector -establishConnection]): Fixed bug which would get some method names wrong, as for example @"setInspectorview:" instead of @"setInspectorView:", due to an error in calling NSString's -capitalizedString. Mon Oct 4 1999 Nicola Pero Implementation of 'initial first responder' stuff for NSWindow: * Headers/AppKit/NSWindow.h: New instance variable _initial_first_responder * Source/NSWindow.m: ([-dealloc]), ([-initDefaults]), ([-encodeWithCoder:]), ([-decodeWithCoder:]): updated to take account for the new ivar _initial_first_responder. * Model/GMAppKit.m ([NSWindow -encodeWithModelArchiver:]): Added initialFirstResponder ([NSWindow -initWithModelUnarchiver:]): idem ([NSPanel -encodeWithModelArchiver:]): idem ([NSPanel -initWithModelUnarchiver:]): idem ([NSSavePanel -encodeWithModelArchiver:]): idem ([NSSavePanel -initWithModelUnarchiver:]): idem * Source/NSWindow.m ([-setInitialFirstResponder:]): implemented method. ([-initialFirstResponder]): implemented method. * Source/NSWindow.m ([-display]): If there is no first_responder, set it to _initial_first_responder (if non-nil). Minor fixes: * Source/GNUmakefile: Added missing AppKit/AppKitExceptions.h * Source/NSOpenPanel.m ([+openPanel]): Set defaults after creating. Tue Sep 28 1999 Nicola Pero * Source/NSBrowser.m Fixed bug: ([-mouseDown:]): New method with a void implementation (to prevent the original NSControl's method from being ever executed). Mon Sep 27 1999 Nicola Pero * Source/NSOpenPanel.m ([+openPanel]): use NSSavePanel's new _initWithoutGModel method if loading of gmodel fails. For now, use always the safer _initWithoutGModel. Thu Sep 23 1999 Nicola Pero * Source/NSBrowserCell.m ([-drawInteriorWithFrame:inView:]): Clean up and bug fix for cells without image. Leaf cells (and branch cells with a nil branchimage) should now draw correctly. * Source/NSSavePanel.m ([-_initWithoutGModel]): new method meant to allow the panel run even without a gmodel, or when loading of the gmodel fails. ([-_setDefaults]): set the title to "Save". ([+savePanel]): Use always the safer _initWithoutGModel for now. RFM - tidied a little, adding releases for subviews etc (even though the save panel may never be destroyed). Tue Sep 21 1999 Nicola Pero * Source/NSBrowser.m ([-selectedColumn]): fix: ignore unloaded columns when searching the currently selected one. * Source/NSMatrix.m ([-drawCellAtRow:column:]): fix: added forgotten lockFocus/unlockFocus. * Source/NSMatrix.m ([-resizeWithOldSuperviewSize:]): New method implementing the prescribed autoresizing behaviour according to autosizesCells. 1999-09-21 Adam Fedor * Source/NSBrowserCell.m (-drawInteriorWithFrame:inView:): Put arrow at extreme right of cell (patch from Tim Bissell ). * Source/NSButtonsCell.m (-performClick:) Remove (duplicate of NSCell method). Tue Sep 15 1999 Nicola Pero (NB. The above date reflects submission of the patch - sorry I didn't commit it until 21st Sept - RFM) * Source/NSButton.m ([-performClick:]): Removed lock/unlock focus, now done automatically by the cell. * Source/NSBrowserCell.m ([-drawInteriorWithFrame:inView:]): Lock focus in the view during drawing. * Source/NSButtonCell.m: ([-drawInteriorWithFrame:inView:]): Lock focus in the view during drawing. ([-drawWithFrame:inView:]): idem. * Source/NSButtonCell.m ([-performClick:]): draw in its control_view, if it has one, not in the currently focused view. * Source/NSCell.m ([-performClick:]): idem. * Source/NSCell.m: ([-drawInteriorWithFrame:inView:]): Lock focus in the view during drawing. ([-drawWithFrame:inView:]): idem. * Source/NSControl.m ([-initWithFrame:]): invoke +cellClass when creating the new cell. * Source/NSControl.m ([-drawCellInside:]): call the cell's drawingRectForBounds: method to get the area to draw. * Source/NSControl.m ([-mouseDown:]): Removed lock/unlock focus now done automatically by the cell. * Source/NSImageCell.m: ([-drawInteriorWithFrame:inView:]): Lock focus in the view during drawing. ([-drawWithFrame:inView:]): idem. * Source/NSMatrix.m ([-highlightCell:atRow:column:]): lock focus during drawing of background. * Source/NSMatrix.m ([-_mouseDownNonListMode:]): Removed lock focus now done by the cells. ([-mouseDown:]): idem. ([-keyDown:]): idem. * Source/NSMenuItemCell.m ([-drawWithFrame:inView:]): Lock focus in the view during drawing. * Source/NSPopUpButtonCell.m ([-drawWithFrame:inView:]): idem. * Source/NSSliderCell.m ([-drawInteriorWithFrame:inView:]): idem. * Source/NSTableHeaderCell.m ([-drawInteriorWithFrame:inView:]): idem. * Source/NSTextFieldCell.m: ([-drawInteriorWithFrame:inView:]): idem. Mon Sep 20 1999 Nicola Pero * Source/NSView.m ([-setFrameSize:]): use zero width or height if the width or height of the argument is negative, but don't crash the app. ([-setFrame:]): idem. Modified by RFM to apply to all other cases of checking view size and also to add debug logging for all those cases. Mon Sep 20 1999 Richard Frith-Macdonald * Source/NSPanel.m: Remove unnecessary -center messages. * Source/NSApplication.m: Add explanatory comment about centering. Mon Sep 20 1999 Nicola Pero * Source/NSApplication.m ([-runModalForWindow:]): Automatically invoke [-center] on the window, if the window is a panel. (following the spec for NSWindow's center method.) * Source/NSSavePanel.m ([-runModalForDirectory:path:filename]): Simplified, removed some useless comands: NSApplication's -runModalForWindow: already both centers and makeKeyAndOrderFronts the panel, as required by the specs. Sat Sep 18 1999 Richard Frith-Macdonald * Source/NSView.m: Applied N. Pero's fix for lockFocus. Sat Sep 18 1999 Nicola Pero * Source/NSFormCell.m ([-initTextCell:]): Follow the doc: init bezeled. ([-drawWithFrame:inView:]): Tiny fix to have some space between title and text. ([-cellSize]): New method Thu Sep 16 8:38:00 1999 Richard Frith-Macdonald * Source/NSBrowserCell.m: Fix for positioning of leaf images. Thu Sep 16 7:11:00 1999 Richard Frith-Macdonald * Source/NSBrowser.m: ([-setPath:]) ensure column zero is loaded - patch from Tim Bissell. 1999-09-13 Pedro Ivo Andrade Tavares * NSScreen.m: added the Mac OS X messages -visibleFrame: and -supportedWindowDepths. The messages are not generalized right now. 1999-09-14 Adam Fedor * Source/NSCell.m ([NSCell -trackMouse:inRect:ofView:untilMouseUp:]): Remove setNeedsDisplay (bug reintroduced again inadvertantly). 1999-09-08 Adam Fedor * Model/GMAppKit.m: Undef implementation of NSPopUpButton. * Model/IBClasses.h: Interface for NSMenuTemplate. * Model/IBClasses.m: Add code to retain NSMenuTemplate if it's associated with a NSPopUpButton (This seems like a hack - nib2gmodel may not be correctly connecting NSPopUpButton with its NSMenu). 1999-09-14 David Lazaro Saz * Source/NSScrollView.m ([NSScrollView -drawRect:]): Corrected problem with the vertical black line of a scrollview being displaced 1 pixel down. Tue Sep 14 1999 Nicola Pero * Source/NSButton.m: ([-drawRect:]): Removed method. * Source/NSPopUpButton.m ([-drawRect:]): Corrected method. It should not draw the cell in its argument rect, but in its bounds. * Source/NSTextField.m: ([-drawRect:]): Removed method. 1999-09-14 David Lazaro Saz * Source/NSButtonCell.m: NeXT look-alike changes ([-drawingRectForBounds:]): Made NSButton a special case. The drawing rect is calculated in a different way than the other cell types. ([-cellSize]): Added changes that take the above into account and removed extra inner border if only there's an image to draw and no text. ([-drawInteriorWithFrame:inView:]): Added a nice translation effect when pushing a button. Mon Sep 13 1999 Nicola Pero * Source/NSImageView.m ([-setImage:]): Added update of the cell. ([-setImageAlignment:]): idem. ([-setImageScaling:]): idem. ([-setImageFrameStyle:]): idem. * Source/NSView.m ([-encodeWithCoder:]): added encoding of the autoresizingMask ([-initWithCoder:]): added decoding of the same variable. Sun Sep 12 1999 Nicola Pero * Source/NSView.m ([-resizeWithOldSuperviewSize:]): Fixed difficult bug hunted for months: removed floor() used in the middle of the computation of widths and heights. Widths and heights are float, and must not to be arbitrarily rounded to integers in the middle of a computation. This bug would cause obscure, very little, misalignment in various views after resize. The misalignments could become appreciable and ugly after repeated resizes. Sun Sep 12 1999 Nicola Pero * Source/NSImageCell.m ([-cellSize]): added method. ([-drawingRectForBounds:]): added method. ([-drawInteriorWithFrame:inView:]): usual bug fix (see Sep 11). 1999-09-11 David Lazaro Saz * Headers/gnustep/gui/NSGraphics.h: Changed parameter declaration of bordered rectangle drawing functions to conform with MacOS X specs. 1999-09-11 Michael Hanni * Source/NSMenu.m: many small fixes and optimizations for quicker display. In addition several small fixes which should improve functionality as well as usablity. * Source/NSMenuView.m: ditto. * Source/NSHelpManager.m: a small bugfix to allow for compilation. 1999-09-11 Pedro Ivo Andrade Tavares * NSResponder.m ([NSResponder -helpRequested:]): Now the application exits context help mode regardless of whether help was shown or not. Without it, the app would do nothing while the user didn't click on a control with help, and would appear broken. * NSHelpManager.m ([NSBundle -contextHelpForKey:]): implemented. See below. ([NSApplication -showHelp:]): implemented. See below. ([NSHelpManager -contextHelpForObject:]): minor change. Context Help for an application is stored in a file called Help.plist. Inside it are several dictionaries, each with the name of what originally was an RTF or RTFD file. Inside each of these dicts, a key called NSHelpRTFContents contains an NSArchived NSAttributedString from the original file. NSBundle receives the original RTF file name, and retrieves the NSAttributedString from this file. Thanks to Richard Frith-MacDonald for unearthing the format of Help.plist. I've implemented an extension, in that NSBundle also looks inside an directory called Help for a file of this name. NSApplication -showHelp: asks the workspace to open in the default editor a file of name "appname.rtf", or what is in the key GSHelpContentsFile in the Info-gnustep.plist file. Sat Sep 11 11:20:00 1999 Richard Frith-Macdonald * Headers/AppKit/NSCell.h: Removed ([-_drawImage:inFrame:]) * Source/NSCell.m: Removed ([-_drawImage:inFrame:]) * Source/NSButtonCell.m: Don't use ([-_drawImage:inFrame:]) * Source/NSPopUpButtonCell.m: Don't use ([-_drawImage:inFrame:]) Sat Sep 11 1999 Nicola Pero * Source/NSControl.m ([-sizeToFit]): implemented method. * Source/NSCell.m ([-cellSize]): implemented method. ([-drawingRectForBounds:]): implemented method. ([-imageRectForBounds:]): implemented method. ([-titleRectForBounds:]): implemented method. ([-drawInteriorWithFrame:inView:]): bug fix; calculate the drawing rect (the cell frame minus the borders) correctly (by invoking drawingRectForBounds:). Previously, xDist was incorrectly used instead of the width of the border, and yDist instead of the height of the border. * NSButtonCell.m ([-drawingRectForBounds:]): implemented method. ([-drawInteriorWithFrame:inView:]): same bug fix as above. * NSTextFieldCell.m ([-cellSize]): removed method; it is no longer needed. Now [-cellSize] is inherited from the NSCell class. ([-drawInteriorWithFrame:inView:]): same bug fix as above. 1999-09-10 Carl Lindberg * Source/NSDocument.m: new file, implementation. * Source/NSDocumentController.m: ditto. * Source/NSWindowController.m: ditto. * Headers/NSDocument.h Headers/NSDocumentController.h Headers/NSDocumentFrameworkPrivate.h Headers/NSWindowController.h: new. 1999-09-10 Pedro Ivo Andrade Tavares * Source/NSHelpManager.m: new file. See below for an explanation. * Headers/AppKit/NSHelpManager.h: new file. * Source/GSHelpManagerPanel.h: new file. * Source/GSHelpManagerPanel.m: new file, defines the help window used by NSHelpManager. * Source/NSWindow.m ([NSWindow -sendEvent:]): if we're in context help mode, call -helpRequested: instead of -mouseDown. * NSResponder.m ([NSResponder -helpRequested:]): if the current responder has context help, show it using NSHelpManager; else, pass to the next responder. These changes and new files implement the NSHelpManager context help interface, which is defined on OpenStep 4.1 onward and Mac OS X Server. To define context help for any responder, call [[NSHelpManager sharedHelpManager] setContextHelp: (an NSAttributedString with the help) forObject: (the responder)]. For the user to see it, call [[NSApplication sharedApplication] activateContextHelpMode] for now, and the next time a user clicks on a responder, its help will be shown. The actiation of the context help mode will be automatic in the future. 1999-09-10 Michael Hanni * Source/NSWindow.m: modifications to allow NSWindowController and friends to work happily. Before windowShouldClose completes we confer with NSWindowController if we should REALLY close the window. * Source/NSApplication.m: modifications for NSDocumentController. If the delgate doesn't handle openFile: [NSDocumentController sharedDocumentController] opens the file. * Source/NSTabView.m: fixed a display problem. Tabs on the bottom of the view work, but some display niggles remain. (Note: we beat Apple on this one, heh.) Thu Sep 9 1999 Nicola Pero * Source/NSButtonCell.m: implemented missing method ([-cellSize]). 1999-09-09 Gerrit van Dyk * Headers/NSComboBox.h: Added NSComboBox * Headers/NSComboBoxCell.h: Add NSComboBoxCell * Headers/AppKit.h: Added NSComboBox,NSComboBoxCell * Source/NSComboBox.m: Added NSComboBox. * Source/NSComboBoxCell.m: Added NSComboBoxCell * Source/GSComboSupport.hm: Private Classes used by ComboBoxes * Images/NSComboArrow.tiff: down arrow on comboboxes 1999-09-07 Michael Hanni * Source/NSTabView.m: some modifications to make tabs on the bottom look a little better. * Source/NSAttributedString.m: turned off fixParagraphAttributes, was causing Text Network to crash. (Most likely my fault.) * Source/NSLayoutManager.m: lots of code... nothing exciting. * Images/*: somehow I triggered CVS to touch everything in here, oops. Tue Sep 7 6:50:00 1999 Richard Frith-Macdonald * Source/NSScrollView.m: ([-setContentView:]) prohibit illegal settings. ([-encodeWithCoder:]) and ([-initWithCoder:]) implemented. * Model/GMAppKit.m: Fix NSScrollView initialisation to create the content-view (NSClipView) as it should. 1999-09-06 Nicola Pero * Source/NSMatrix: Added missing method ([-sizeToFit]). ([-deselectAllCells]): do nothing, as in MacOS-X, if mode is NSRadioModeMatrix and empty selection is not allowed. ([-selectCellAtRow:column:]): mark both the cells, newly selected and deselected one, as needing redraw, not only the newly selected cell. If row or column is negative, just deselect the currently selected cell, as in MacOS-X. Mon Sep 6 6:37:00 1999 Richard Frith-Macdonald * Source/NSWindow.m: added enable/disable flush fix from dawn. * Headers/NSWindow.h: added enable/disable flush fix from dawn. Fri Sep 3 22:45:00 1999 Richard Frith-Macdonald * Source/NSAttributedString.m: implemented (untested) most of the missing methods, and fixed a few memory leaks. Thu Sep 2 12:50:00 1999 Richard Frith-Macdonald * NSWorkspace.m: Fixes for locating icons in application resources. * NSBundleAdditions.m: implemented ([-pathForImageresource:]) Wed Sep 1 9:55:00 1999 Richard Frith-Macdonald Added patches from n.pero@mi.flashnet.it to access ivars of superclasses directly. Generated changes for NSClipView.m myself. * NSBox.m: (frame) * NSClipView.m: (superview, window, bounds) * NSMatrix.m: (bounds) * NSMenuView.m: (frame, window, bounds) * NSPopUpButton.m: (frame, window) * NSProgressIndicator (window, bounds) * NSSavePanel.m: (frame) * NSScroller.m: (frame) * NSScrollView.m: (bounds) * NSSlider.m: (bounds) * NSSplitView.m: (frame, window, bounds) * NSTabView.m: (frame) * NSTableView.m: (superview) * NSView.m: (superview, autoresizeSubviews) Wed Sep 1 9:28:00 1999 Richard Frith-Macdonald * Tools/GNUmakefile.preamble: patch by doko@cs.tu-berlin.de so that make_services is linked without the gste-gui library. * Tools/make_services.m: minor fixes to get rid of some compiler warnings - remove unused variables etc. Wed Sep 1 9:17:00 1999 n.pero@mi.flashnet.it * Source/NSBox.m: (-initWithFrame:) changed default border type to NSGrooveBorder (as in MacOS-X). Resize content view to fit the box. Turn off autoresizing of subviews. (-setContentViewMargins:) removed the code which resized the content view (as required by MacOS-X specs). (-setFrame:) added method. It resizes also the content view when the box is resized, as required by MacOS-X specs. (-setFrameSize:) idem. (-setFrameFromContentFrame:) Tried to make the GNUstep method compliant with MacOS-X specs. In particular, the origin of the NSBox has to be changed too, and contentFrame is relative to the superview's coordinate system. (-sizeToFit) Tried to make the GNUstep method compliant with MacOS-X specs. In particular, try the sizeToFit message to the content_view before resizing it; check that the title fits, otherwise make the box bigger to have the title displayed; modified slightly the loop to give correct answer in case the min of the origin's of the subviews is positive; keep better care of the fact that frames are not expressed always in the same coordinate system. Sun Aug 22 11:52:00 1999 Richard Frith-Macdonald * Source/NSView.m: ([-viewWillMoveToWindow:]) fixed to call method in subviews when new window is nil. 1999-08-22 Gerrit van Dyk * Headers/NSProgressIndicator.h AppKit.h: Added ProgressIndicator * Source/NSProgressIndicator.m: Added ProgressIndicator. Only determinate Indicators works at this stage. 1999-08-21 Michael Hanni * Source/NSCell.m: lots of fixes to editWithFrame, and fieldEditor related methods. * Source/NSText.m: caret drawing now works. * Source/NSTextField.m: fixes to allow for single click and type usage of textFields. * Source/NSView.m: fixed bug in viewWillMoveToWindow: which could cause an X11 protocol error in the backend. 1999-08-20 Michael Hanni * Source/NSSlider.m: added missing [self unlockFocus];. * Source/NSMenu.m: fixes to sizeToFit and update. This allows you to keep the windows and services menus tornoff and when you rerun the program these menus will look correct. * Source/NSMenuView.m: ditto. 1999-08-19 Michael Hanni * Headers/NSAttributedString.h NSLayoutManager.h NSTableView.h: modifications, mostly added ivars. * Source/NSLayoutManager.m: implemented much code for layout and display. * Source/NSMenu.m: fixed some nagging problems. tearoffs should work almost universally. Positions are saved and restored. If you previous position exists for the main menu it goes to the upper left corner. * Source/NSMenuView.m: a few attempts to fix the "move to submenu" bugs. * Source/NSPopUpButton.m: many bug fixes and new implementations. Too many to list here. * Source/NSTableView.m: more code implemented, though I wouldn't recommend trying to use this class. :-) * Source/NSText.m: debugging code to help pinpoint which methods can be used in NSTextView and which have to be overridden. * Source/NSTextStorage.m: properly assigns itself to its layoutManager. * Source/NSTextView.m: more code additions to coincide with the new NSLayoutManager. 1999-09-07 Adam Fedor * Version: 0.6.0 * Source/NSLayoutManager.m: Change NSLog to NSDebugLLog * Source/NSText.m: Likewise. * Source/NSTextContainer.m: Likewise. * Source/NSTextField.m: Likewise. * Source/NSTextStorage.m: Likewise. * Source/NSTextView.m: Likewise. * Source/NSBox.m ([NSBox -initWithCoder:]): Remember to set the content view. * Source/NSFontPanel.m ([NSFontPanel -setPanelFont:isMultiple:]): ASSIGN panel_font (e.g. retain it). (-initWithCoder:): Likewise. * Source/NSText.m ([NSText -initWithFrame:]): Retain default_font. (-initWithCoder:): Likewise. 1999-09-07 Michael Hanni * Source/NSInterfaceStyle.m: added support for GSWindowMakerInterfaceStyle. * Headers/NSInterfaceStyle.h: added enum GSWindowMakerInterfaceStyle. * Source/NSMenu.m: implemented NSInterfaceStyle based window maker like menus. i.e. they line up with the menu item selected. try 'defaults write NSGlobalDomain NSMenuInterfaceStyle GSWindowMakerInterfaceStyle' 1999-09-05 Michael Hanni * Source/NSMenuView.m: fix nagging bug reported by Gregory John Casamento . * Source/NSWorkspace.m: reverted an erroneous patch I applied. 1999-09-04 Nicola Pero * Source/NSMenu.m: added missing method ([-_rightMouseDisplay]) with a void implementation. In future, it should be given a complete implementation, or removed. At present, the method is only called by NSResponder. 1999-09-04 Michael Hanni * Model/GMAppKit.m: patch from Tim Bissell adds proper decoding/encoding of NSButtonCell titles. * Source/NSCell.m: updated copy from HEAD. * Source/NSText.m: ditto + minor additions. * Source/NSView.m: patch to prevent X crashes. * Source/NSMenu.m: multiple patches from HEAD. * Source/NSPopUpButton.m: ditto. * Source/NSSlider.m: patch to add missing unlockFocus. * Source/NSBrowserCell.m: patch from Tim Bissell set NSBrowerCell to be initially not editable (mimcs OS 4.2 behaviour). * Source/NSWorkspace.m: added patch from Tim Bissell which adds special GNUstep functionality to NSWorkspace (for FileViewer.app). * Headers/NSWorkspace.h: added method definitions for additions by Tim Bissell Thu Sep 2 16:42:00 1999 Richard Frith-Macdonald * NSWorkspace.m: Trivial fix to pass app when opening files. * GSServicesManager.m: Fix to send open commands to app delegate rather than to application object itsself. * NSApplication.m: Fix to recognise file open request on commandline. Thu Sep 2 9:50:00 1999 Richard Frith-Macdonald * NSWorkspace.m: Attempted fix for locateApplicationBinary and tidied. Modified fix for getting file icons of directories where the extension is meaningless. Look for .dir.tiff as well. 1999-09-01 Adam Fedor * Source/NSFont.m ([NSFont -initWithCoder:]): Get the real font from the fontname. * Source/NSView.m ([NSFont -initWithCoder:]): Initialize frameMatrix and other matrices. (Fixes suggested by GerritVD@decimax.com). Mon Aug 30 15:53:41 1999 Martin Man * Headers/AppKit/NSPopUpButton.h: * Source/NSPopUpButton.m: setTitle's return type changed from int to void to conform openstep specs. Wed Sep 1 9:28:00 1999 Richard Frith-Macdonald * Tools/GNUmakefile.preamble: patch by doko@cs.tu-berlin.de so that make_services is linked without the gstep-gui library. Wed Sep 1 9:25:00 1999 Richard Frith-Macdonald * Source/NSBox.m: set default border type to NSGrooveBorder as suggested by n.pero Tue Aug 31 10:45:00 1999 Richard Frith-Macdonald Fixes to remove hard-coded colors from gui. I'm not sure this is entirely correct - in places where we expect to display white text on a dark-gray background, I've used windowFrameTextColor and controlShadowColor, since the MacOS-X documentation doesn't seem to specify anything exactly for this. * NSBrowser.m: use windowFrameTextColor for title text and controlShadowColor for background. * NSClipView.m: (-init) use controlColor for default background. * NSColorWell.m: (-drawRect:) use controlColor for background. * NSFontPanel.m: use windowFrameTextColor for title text and controlShadowColor for background. * NSMatrix.m: Use controlBackgroundColor for backgrounds. * NSMenu.m: ([NSMenuWindowTitleView drawRect:]) use windowFrameColor and windowFrameTextColor. * NSMenuItemCell.m: use selectedMenuItemColor or controlColor for background, and use selectedMenuItemTextColor, controlTextColor, or disabledControlTextColor for text. * NSPopUpButtonCell.m: use selectedMenuItemColor or controlColor for background, and use selectedMenuItemTextColor, controlTextColor for text. * NSSplitView.m: ([-initWithFrame:]) use controlShadowColor for the divider, and controlBackgroundColor for background. * NSTabViewItem.m: use controlBackgroundColor. * NSTableHeaderCell.m: use controlShadowColor for header. * NSTableView.m: use gridColor for the grid. 1999-08-29 Adam Fedor * Source/NSCell.m ([NSCell -trackMouse:inRect:ofView:untilMouseUp:]): Remove setNeedsDisplay, which was causing button to disappear when mouse left bounds. 1999-08-23 Pedro Ivo Andrade Tavares * Source/NSApplication.m: fixed a bug where it would ask if it should terminate when a panel over the main window was closed. Fri Aug 27 8:02:00 1999 Richard Frith-Macdonald Patch from Nicola Pero * Source/NSBox.m: Fix setFrameFromContentFrame: for zero rect frame. Wed Aug 25 09:42:05 1999 Martin Man * Source/NSWindow.m ([NSWindow -setFrameTopLeftPoint:]): Corrected positioning of window's top left point. X coordinate was ignored and Y coordinate was computed in wrong way. Thu Aug 26 5:07:00 1999 Richard Frith-Macdonald Patch from Niico Pero modified to use controlDarkShadowColor rather than blackColor. * Source/NSBox.m: draw line borders in correct color. * Source/NSCell.m ditto * Source/NSScrollView.m: ditto * Source/NSTabView.m: ditto 1999-08-24 Adam Fedor * Source/NSPanel.m (NSRun...AlertPanel): Change window mapping to orderFrontRegardless so panel comes up even when app is not active. 1999-08-22 Adam Fedor * Documentation/gnustep-gui.tmpl.texi: New with GNUstep specific documentation. Sat Aug 21 8:00:00 1999 Richard Frith-Macdonald * Source/NSApplication: ([-setMainMenu:]) close the old main menu (if any) and display the new one if the app is active. * Headers/AppKit/NSWindow.h: Changed ivar to support flush enable * Source/NSWindow.m: Fixed frame sizing to permit setting of frame beyond min/max size. Fixed bug in enable/disable flush. 1999-08-12 Adam Fedor * Model/GMArchiver.m (-encodeObject:withName:): Don't encode object if there is a replacement object for it. (Patch from Benhur Stein ) 1999-08-10 Adam Fedor * Source/NSClipView.m (-setBoundsOrigin:): Remove window update. * Source/NSScroller.m (-_floatValueForMousePoint:): Better position calculations. (-trackScrollButtons:): Various improvements. * Source/NSWindow.m (-setViewsNeedDisplay:): Rewrite to automatically update in event loop. * Source/NSTextView.m (-drawRect:): Minor fix. (Patches and suggestions from Benhur Stein ). Mon Aug 9 13:57:48 1999 Adam Fedor * NSGraphicsContext.m (-DPSGetEventMatchingMask:...): Add check for NSAppKitDefined and other masks. * NSWindow.m (-sendEvent:): Get dragInfo object fix. 1999-08-06 Adam Fedor * many files: Update FSF mailing address. Fri Aug 6 15:07:29 1999 Adam Fedor * Headers/gnustep/gui/NSDragging: Corrected method name. * Source/NSWindow.m: Likewise. 1999-08-03 Michael Hanni * Source/NSMenu.m: commented out code which did multiple menu movement as it was breaking things. Need to rethink that. * Headers/NSTableColumn.h Headers/NSTableHeaderView.h Headers/NSTableHeaderCell.h Headers/NSTableView.h: added files. * Source/GNUMakefile: compile in NSTable classes. 1999-07-31 Michael Hanni * Source/NSApplication.m: added patch by Pedro Ivo Andrade Tavares to handle last window/application exit. This implementation mimics OpenStep 4.1. 1999-07-30 Michael Hanni * Source/NSMenu.m: rewrote sections to handle new popupbutton code. New initialiser - initWithPopUpButton:. New ivar menu_isBeholdenToPopUpButton. * Source/NSMenuView.m: ditto. removed code that dealt with popupbutton. Also fixed bug which disallowed selecting an item if you dragged of a popup and dragged back up. * Source/NSPopUpButton.m: complete rewrite. now this class should be almost completly MacOSX compliant. For kicks try popupbuttons.app in core/Testing to see. * Source/NSPopUpButtonCell.m: modifications to make NSPopUpButton work. Also implemented representedObject as I think it should be. Also made popupbutton arrow image work for popups that use images. * Source/NSTableColumn.m: fixes to make some things work a little better. * Source/NSTableView.m: fixes to make things behave. Still doesn't compile in, but it is getting there. Modifications will have to be made to NSScrollView before we can use this class. * Source/NSTabView.m: fixed (- contentRect) for the no tabs case. * Images/: added common_UpAndDownArrowSmall.tiff and common_DownArrowSmall.tiff for popupbuttons with images in them. * Headers/NSMenu.h: mods for changes. * Headers/NSPopUpButton.h: ditto. * Headers/NSPopUpButtonCell.h: ditto, also changed to inherit from NSMenuItemCell. 1999-07-29 Adam Fedor * Headers/gnustep/gui/NSEvent.h: Add AppKit dragging events. * Headers/gnustep/gui/NSGraphicsContext.h: Added some internal drag methods. * Source/NSGraphicsContext.m (-_dragInfo): New method. (-_postExternalEvent:): Likewise. * Headers/gnustep/gui/NSPasteboard.h: Added some internal mime type conversions. * Source/NSPasteboard.m (-_initMimeMappings): New method. (-mimeTypeForPasteboardType:): Likewise. (-pasteboardTypeForMimeType:): Likewise. * Headers/gnustep/gui/NSWindow.h: Added some drag ivars. * Source/NSView.m (-dragImage...): Get the shared dragView and call it. * Source/NSWindow.m (-sendEvent:): For LeftMouseDown, send mouseDown: to view if view is key (even if not first responder). Handle AppKit dragging events. * Source/NSObjectProtocols.m: New file (Implement informal draggin protocols). 1999-07-27 Michael Hanni * Source/NSMenu.m: merge in all backend code. All that remains in the backend is NSMenuWindow. * Source/NSPopUpButton.m: merged in all backend code. Relies on NSMenuWindow now. 1999-07-27 Michael Hanni * Source/NSTabView.m: added code to allow tabs on the bottom of a tabview. Also made the space that the tabs themselves are draw in from 20 pixels to 16 (which is the exact space needed.) * Images/common_TabDownSelectedLeft.tiff common_TabDownSelectedRight.tiff common_TabDownSelectedToUnSelectedJunction.tiff common_TabDownUnSelectedJunction.tiff common_TabDownUnSelectedLeft.tiff common_TabDownUnSelectedRight.tiff common_TabDownUnSelectedToSelectedJunction.tiff: place keeper images for bottom tabs. These really need to be redrawn. * Source/NSMenu.m: removed isTornOff: from frontend and it is in the backend where it should be. * Source/NSMenuView.m: added code that does quite a bit of the transient menu code. Added code to close transients when the mouse goes up. The event code needs to be finessed so that the transient menu is not allowed to remain on screen unless the mouse button stays down. 1999-07-26 Michael Hanni * Source/NSTableView.m: added much more code to this implementation. Almost to the point where it could display something useful. Alas, some difficulties remain because the linkages between the NSTable* classes is by no means clear. * Source/NSTableColumn.m: if the datacell type has not been set and is asked for we create a standard NSTextFieldCell. * Source/NSTabView.m: implementation is at 90%. All delegate messages are sent as required (if possible) and tab selection is now by the spec. Also a small optimization in tab selection makes sure we don't reselect tabs that are already selected. Also, when drawRect is called, if no tab is selected the first tab becomes selected. Further, we properly keep the value of the index of the currently selected item. I also fixed the drawing code for use NSTabView without displaying tabs. The result of this can be seen in core/Testing/GNUstepInstaller.app. Tidied (- contentRect) to return something a little closer to the full rect. * Source/NSMenu.m: redid alot of the insertItem: addItem: methods to unify under the one primitive method. Did the same for removeItem:. Also added all the rest of the NSMenu notifications: NSMenuDidAddItemNotification NSMenuDidRemoveItemNotification NSMenuDidChangeItemNotification. I think we need some setDelegate/delegate methods in here, no? * Source/NSPopUpButton.m: when creating NSPopUpButtonCell's we make sure to make set the cell enabled so to better work with some of the new menu code. Also added code to post the one notification that this class has. * Source/externs.m: added references to new NSMenu and NSPopUpButton notifications. 1999-07-25 Michael Hanni * Source/NSTextStorage.m: removed excess calls to edited:range:changeInLength. Also changed on line 191 from > to >=. Not sure the complete implications, but alas it now works correctly. * Source/NSAttributedString.m: new file with implementation of some needed additions to NSMutableAttributedString. Try gstextnetwork.app, you'll see a lot of debug information. After that has cleared click twice in the textView and press a key. You will see the textStorage buffer. You should see the word 'eek' close to the top, that would be from a replaceCharacters in range edit, and you should also notice that some 500 characters are missing from the middle, that would be from the deleteCharactersInRange edit. It seems that the text network is working slightly on the flip side, now all we need is some drawing code to help make sense of all this. ;-) Sun Jul 25 11:40:00 1999 Richard Frith-Macdonald * Source/GSTextStorage.m: Modified ([-setAttributes:range:]) and ([-replaceCharactersinRange:withString:]) to call ([-edited:range:changeInLength:) on completion. * Source/NSTextStorage.m: likewise. * Source/NSWindow.m: make minimum window size 1 by 1. 1999-07-24 Michael Hanni * Headers/NSTextView.h: redid ivars. * Source/NSTextView.m: complete rewrite. more methods written. * Source/GSServicesManager.m: minor temp debug NSlog. * Source/NSMenuView.m: debug logs. * Source/NSText.m: debug logs. * Source/NSTextStorage.m: in processEditing: add code to notify every layoutManager of editing done in textStorage. Also fixed code to return the string. This makes debugging ohh so much easier. ;-) Look at core/Testing/gstextnetwork.app. That is the text application for NSTextView/TextNetwork. Edit.app has been modified to use NSText directly and not NSTextView. 1999-07-23 Adam Fedor * Model/GMAppKit.m: Added ifndef's to comment out areas of code that don't compile on OPENSTEP/MacOSX machines. * Model/GMArchiver.m: Likewise. * Model/IMConnectors.m (GSSetInstanceVariable): Dummy function on non-gstep-base machines. Fri Jul 23 11:45:00 1999 Richard Frith-Macdonald * Tools/gpbs.m: In ihandler() reset signal handler. 1999-07-22 Michael Hanni * Source/NSMenuView.m: some fixes to get things to work correctly when calling menu item actions. Also autoenable should be working a little better. In setHighlightedItemIndex: if new item is disabled do not highlight or target action. * Source/NSMenuItemCell.m: drawing fixes for disabled cells. 1999-07-20 Michael Hanni * Source/NSMenuView.m: trackEvent: fixed problems that existed for NSPopUpButton. Should now work as desired. However, I believe I need to once again rewrite NSPopUp to make proper use of setMenu:, that will make the code sharing between NSMenu and NSPopUp complete. Also documented the event code a little. Interestingly enough by doing this I know what needs to be looked at better. Suprise, suprise. 1999-07-19 Michael Hanni * Source/NSTableView.m: very incomplete implementation. * Source/NSTableColumn.m: mostly complete NSTableColumn implementation. * Source/NSTableHeaderView.m: some coding left when NSTableView works. * Source/NSTableHeaderCell.m: once all is drawing this should be corrected. None of this is built for good reason. The code is not finished, and the interfaces are not written. But committing them to CVS makes it much easier for me to develop on the multiple machines I use. * Source/GSServicesManager.m: removed NSMenuMatrix code. Should work properly now. * TODO: added the unimplemented classes TODO list. 1999-07-18 Michael Hanni * Source/NSPopUpButtonCell.m: removed debug code. Makes popupbutton snappy not sloppy. ;-) Sun Jul 18 16:30:00 1999 Richard Frith-Macdonald * Source/NSMenuView.m: When doing sizeToFit, use setContentSize to change the size of the window if we have one, rather than changing our frame directly. * Source/NSWindow.m: When adding a content view - don't set its autosizing mask. In GSWindowView, don't use autosizing to change the content view - set it's frame directly instead. 1999-07-17 Michael Hanni * Headers/gnustep/gui/NSMenuView.h: added new private interface. * Headers/gnustep/gui/NSPopUpButton.h: removed NSPopUpButtonMatrix and tidied some ivars. * Source/NSMenu.m: fixed a few problems. * Source/NSMenuItemCell.m: likewise. * Source/NSMenuView.m: added functionality (privately) so this class can be used to draw NSPopUpButton. Also made sizeToFit code only size the view, not the window. * Source/NSPopUpButton.m: removed NSPopUpButtonMatrix. Rewrote to use NSMenuView. * Source/NSPopUpButtonCell.m: rewrote portions to handle new system of NSMenuView. 1999-07-16 Michael Hanni * Source/NSText.m: add a patch to NSText from Daniel to do some pasteboard related stuff. Also added a patch from Peter Rasmussen that addressed my hackish NSClipView scrolling code. Still a hack, but won't kill NSText if not used in conjunction with a ClipView. 1999-07-15 Michael Hanni * Source/NSPopupButton.m: if (count) == 0, return early in drawing code. This fixes crashes created by Popups created in our gmodels. * Source/NSLayoutManager.m: new file from jagapen@whitewater.chem.wisc.edu * Source/NSTextView.m: initWithFrame: now creates a proper NSText network. Thu Jul 15 18:00:00 1999 Richard Frith-Macdonald * Source/NSView.m: Make sure cursor and tracking rects are converted to window coordinate system before installing them. Coordinate conversion methods - return unchanged values if the view is not in a window. * Source/NSWindow.m: Don't convert cursor rects coordinates - done in nsview. * Headers/AppKit/NSText.h: Fix include order. Thu Jul 15 6:55:00 1999 Richard Frith-Macdonald * Headers/AppKit/NSAttributedString.h: new file * Headers/AppKit/NSStringDrawing.h: Move some stuff to NSAttributedString.h * Headers/AppKit/AppKit.h: include NSAttributedString.h * Source/GSTextStorage.m: new file * Source/GNUmakefile: update for new source * Source/NSTextStorage.m: Make instances of GSTextStorage * Source/externs.m: Add new string constant for text links. Wed Jul 14 19:18:00 1999 Richard Frith-Macdonald * Source/GNUmakefile: Install NSMenuItemCell.h and NSMenuView.h * Headers/AppKit/AppKit.h: Add recent class headers. Wed Jul 14 16:20:00 1999 Richard Frith-Macdonald * Source/NSMatrix.m: Modifications to get rid of most internal methods and get the list-mode selection by rectangle working. * Source/NSView.m: Implemented ([scrollPoint:]) and ([scrollrectToVisible:]) (based on mGSTEP). Code probably buggy and untested. * Source/NSActionCell.m: Minor optimisations. Tue Jul 13 6:44:00 1999 Richard Frith-Macdonald * Source/NSApplication.m: In ([-runModalSession:]) pay attention to ([NSWindow worksWhenModal]). 1999-07-12 Michael Hanni * Source/NSMenu.m: added code to convert anything that conforms to into an NSMenuItemCell. Not tested, but should work. Also fixed a small bug in -init, it was not returning. * Model/GMAppKit.m: fixed code in unarchiving of NSMenus to addItems so they are converted rather than swapped in (in an operation which we can not intercede.) Mon Jul 12 5:40:00 1999 Richard Frith-Macdonald * Source/NSOpenPanel.m: In ([-runModalForTypes:]) made change suggested by Pascal Bourguignon to pass legal arguments. Sat Jul 10 14:55:00 1999 Richard Frith-Macdonald * Source/NSapplication.m: In ([-init]) made changes suggested by Pascal Bourguignon to enable effective sublassing of NSAppklication. 1999-07-9 Michael Hanni * Source/NSTabView.m: perfected the mouse event work. now clicking in the tabs works wonderfully. Now just need to hook up code to draw the selected tabs view in the tabview rect. [Check out nstabview.app in Testing/, you won't regret it, hehe.] 1999-07-9 Michael Hanni * Headers/AppKit/NSTabViewItem.h: defined some non-spec methods. * Source/NSTabView.m: added event code. you can now select tabs. Not perfect yet, but it works (i.e. click around the text.) Also fixed image problem with left most tab being selected. * Source/NSTabViewItem.m: cache tabrect for quick retrieval. * Source/NSMenuView.m: removed an extra call to flushwindow. Fri Jul 9 9:33:00 1999 Richard Frith-Macdonald * Headers/AppKit/NSApplication.h: Removed delegate methods from NSApplication, and put them in a protocol instead. Removed obsolete backend method. * Source/NSApplication.m: Removed delegate methods. Removed code that intercepted the right mouse button. * Source/NSResponder.m: Added code so that the last responder will pop-up the main menu if NSRightMouseDown has not been handled. Tue Jul 6 21:45:00 1999 Richard Frith-Macdonald * Headers/AppKit/NSGraphicsContext.h: Added new method to perform window ordering. * Source/NSGraphicsContext.m: Dummy implementation of (_orderWindow:relativeTo:forWindow:]) * Source/NSWindow.m: Use new method to implement all window ordering methods. * Model/GMAppKit.m: Remove calls to ([NSWindow -setLevel:]) as these have the unwaanted side-effect of ordering the window in to display. Tue Jul 6 16:55:00 1999 Richard Frith-Macdonald * Source/NSMenuView.m: In ([-trackWithEvent:]) fixed indexing bug when mouse dragged off bottom of menu and released, also reformatted to GNU coding style. Added copyright notice. * Source/NSMenu.m: Added copyright notice. * Source/NSMenuItemCell.m: Added copyright notice. Tue Jul 6 14:40:00 1999 Richard Frith-Macdonald * Headers/AppKit/NSAffineTransform.h: Removed macros * Source/NSAffineTransform.m: Added macros Tue Jul 6 13:06:00 1999 Richard Frith-Macdonald * Headers/AppKit/NSEvent.h: Added event subtypes for appkit events * Headers/AppKit/NSWindow.h: Removed ([_setFrame:]) - achieve same effect using the event queue. * Source/Functions.m: Rewrite for new event types. * Source/NSWindow.m: Handle AppKit defined events for window movement and resizing. Tue Jul 6 6:45:00 1999 Richard Frith-Macdonald * Headers/AppKit/NSGraphicsContext.h: New method for window control - ([_setFrame:forWindow:]) * Headers/AppKit/NSWindow.h: New ivar 'autosave_name' and new method ([_setFrame:]) for backend to call when window frame has changed. * Source/NSGraphicsContext.m: Dummy implementation of new method. * Source/NSWindow.m: Rewrite all moving/sizing methods and methods for storing/retrieving window frame info in defaults database. 1999-07-05 Adam Fedor * Source/GNUmakefile: Install NSPopUpButtonCell.h 1999-07-03 Richard Frith-Macdonald * Source/NSWindow.m: Implement ([-dragImage:at:offset:event:pasteboard:source:slideBack:]) by calling the mothod of the smae name in the window view. 1999-07-03 Adam Fedor * Source/NSApplication.m (-run): Added destroyContext (so we can remove backend run method). * Source/NSStringDrawing.m (drawRun): Better hack to work around DGS bug that fails to flush strings (XDPS backend only). 1999-06-30 Michael Hanni * Source/NSMenuView.m: fixes: 2. Clicking on the menu item that opened a sub-menu should close the sub-menu again - it doesn't. [FIXED] 5. Menus are not always closed properly at the end of a click and drag - I'm not sure if you already know about this one. [FIXED] 6. If I drag off the bottom of a menu (or submenu) then release the mouse button, the app crashes. [FIXED] [ 7 is fixed in the backend. ] * Source/NSMenuItemCell.m: paper-bag-over-the-head-goof: keyEquivalents are now drawn. How did I miss those? 1999-06-29 Michael Hanni * Source/NSMenu.m: complete rewrite. Some work still required to finish implementing obscure MacOSX methods, but otherwise functional. * Source/NSMenuView.m: new file. Implementation of MacOSX menu view class. Most classes implemented to provide basic functionality. Some work required in event code to "forward"curse to close/deselect menus in one case. I'll fix this ASAP. * Source/NSMenuItemCell.m: new file. Implementation complete, plus modifications to allow its use as an . * Source/*.m: compilation fixes. Sun Jun 27 7:50:00 1999 Richard Frith-Macdonald * Source/GNUmakefile: Install GSWraps.h Fri Jun 25 12:00:00 1999 Richard Frith-Macdonald * Source/GMArchiver.m: Fix for decodeDoubleWithName: by jagapen@whitewater.chem.wisc.edu 1999-06-23 Michael Hanni * Source/NSText.m: tweaked - sizeToFit and now scrollbars are correctly positioned. Furthermore down arrow will move you down through text in Edit.app (up arrow does too, but the algo doesn't work for it so its dead.) * Source/NSTabViewItem.m: remove top line drawing. * Source/NSTabView.m: add top line drawing. 1999-06-22 Michael Hanni * Source/NSText.m: new file from Daniel. Modifications to allow it to work with GNUstep. Plus multiple hacks to make it work with NSTextField and NSTextView better. * Source/NSTextView.m: ditto. * Source/NSCell.m: modifications to editWithFrame:::: so our field editor is a little better lined up. Plus fieldEditor gets our mouseDown: event. Fixed flicker, I think. TODO: * fix Caret. Without an insertion marker its hard to see. :-) * fix buffer for using a fieldEditor in a cell. Possibly modify NSTextFieldCell so it doesn't draw text directly abutting the side? 1999-06-21 Michael Hanni * Source/NSText.m: a bunch of little tweaks. Will document today. However as a consequence hitting return in Edit.app properly moves lines down whereas before it lost lines. * Source/NSCell.m: - editWithFrame:inView:editor:delegate:event: Now puts fieldEditor in windows contentView rather than in the cell. Debugging messages and red cell splash kept in for the moment as debugging of NSTextField* continues. 1999-06-20 Michael Hanni * Images/common_TabSelectedLeft.tiff common_TabSelectedRight.tiff common_TabSelectedToUnSelectedJunction.tiff common_TabUnSelectToSelectedJunction.tiff common_TabUnSelectedJunction.tiff common_TabUnSelectedLeft.tiff common_TabUnSelectedRight.tiff: all tiffs needed to draw NSTabs. * Images/common_3DArrowDown.tiff: for NSPopUp in pulldown mode. * Source/NSTabView.m: lots of work on drawing. Should draw correct in almost all cases. However, without event code I can't test it yet. * Source/NSTabViewItem.m: drawing. still need to move the drawing of the top line out of this and move it into NSTabView's drawRect. * Source/NSPopUpButtonCell.m: moved all backend code to frontend. 1999-06-20 Michael Hanni * Source/NSPopUpButton.m: hooked up all the actions and targets now works for popup, haven't finished pulldown yet. * Source/NSTabView.m: now draws the view correctly for all cases(?) * Source/NSTabViewItem.m: spits out correct values for string length, though more work is needed. No drawing, no events yet. NSPopUpButton now has basic functionality, ie. it works. 1999-06-19 Michael Hanni * Images/common_Nibble.tiff: made inner gray area transparent. * Source/NSTabView.m: new file. implemented, save for drawing and event. * Source/NSTabViewItem.m: new file. implemented, save for drawing and event. TabView should be fun to get drawing. :-) I'm going to follow Alfredo's lead by using a few drawn lines instead of bezier curves to draw the tabs for now (since xgps doesn't do bezier). 1999-06-18 Michael Hanni * Images/common_Nibble.tiff: new image for NSPopUpButton. * Source/NSPopUpButton.m: more changes. still using a subclass of NSMenuMatrix but had to hack new methods in to make selected_item working in the Matrix. - drawRect: draws the correct item. - synchronizeTitleAndSelectedItem: now informs our NSPopUpButtonMatrix which one of its cells is "selected", i.e. on top. * Source/NSPopUpButtonCell.m: added new file. empty class, used in the backend currently. 1999-06-17 Michael Hanni * Source/NSPopUpButton.m: half way implemented. Most still in backend, but that will change soon. PopUp and PullDown work, however the entire event mechanism needs to be implemented. * Tools/Functions.m: added definitions for new NSDraw* functions used in NSPopUp. Thu Jun 17 16:20:00 1999 Richard Frith-Macdonald * Source/NSTextContainer.m: New by jagapen@whitewater.chem.wisc.edu * Headers/AppKit/NSTextContainer.h: rewrite by jagapen * Source/GNUmakefile: Modified to build NSTextContainer and NSTextStorage. 1999-06-16 Adam Fedor * Headers/gnustep/gui/DPSOperators.h: New functions defineuserobject, execuserobject, and undefineuserobject for dealing with gstates. * Headers/gnustep/gui/GSMethodTable.h: Likewise. * Headers/gnustep/gui/NSGraphicsContext.h. Likewise. * Headers/gnustep/gui/PSOperators.h: Likewise. * Headers/gnustep/gui/GSWraps.h: Wrapper functions for PostScript functionality. * Source/NSAffineTransform.m (-concat): Implement. (-set): Likewise. * Headers/gnustep/gui/NSView.h: New gstate ivars. * Source/NSGraphicsContext.m: Move lockFocus code to NSView. * Source/NSView.m (-lockFocusInRect:): New method implementing proper gstate support. (-lockFocus): Use it. (-unlockFocusNeedsFlush): New method. Wed Jun 16 22:15:00 1999 Richard Frith-Macdonald * Images/common_Home.tiff: new file for save panel * Images/common_Mount.tiff: new file for save panel * Images/common_Unmount.tiff: new file for save panel * Images/GNUmakefile: Install new files Wed Jun 16 12:35:00 1999 Richard Frith-Macdonald * Source/NSSavePanel.m: Rewrite by jagapen@whitewater.chem.wisc.edu * Headers/AppKit/NSSavePanel.h: ditto * Panels/SavePanel.gmodel: Update by jagapen@whitewater.chem.wisc.edu Tue Jun 15 20:55:00 1999 Richard Frith-Macdonald * Source/GSServicesManager.m: Use NSNotificationCenter properly. * Source/NSColor.m: Use NSNotificationCenter properly. * Source/NSInterfaceStyle.m: Use NSNotificationCenter properly. * Source/NSPasteboard.m: Use NSNotificationCenter properly. * Source/NSWorkspace.m: Use NSNotificationCenter properly. * Tools/gpbs.m: Use NSNotificationCenter properly. Tue Jun 15 9:00:00 1999 Richard Frith-Macdonald * Source/NSWindow.m: Handle dnd registration for the window by using the window view (the superview of the content view). * Source/NSView.m: Incorporate code for keeping track of dnd registered views. Add support for notifying the graphics context of changes to the types registered by views in each window. * Source/GSDragManager.m: Removed - merged into NSView.m * Source/NSGraphicsContext.m: Added dnd registration methods. * Source/GNUmakefile: Removed GSDragManager. * Headers/AppKit/GSDragManager.h: Removed * Headers/AppKit/NSView.h: Added GSGetDragTypes() * Headers/AppKit/NSGraphicsContext.h: Added dnd registration methods. 1999-06-14 Michael Hanni * Model/GMAppKit.m: Minor adjustments for MacOS-X so nib2model works (mainly #ifdef'ing NSCStringText out if on __APPLE__). * Model/IBClasses.m: NSIB* -> NSNib on __APPLE__. Some ivars #ifedef'ed to new names if on __APPLE__. * Model/IMLoading.m: makeObjectsPerformSelector on __APPLE__. * Headers/GMAppKit.h: #ifdef'ed out NSCStringText on __APPLE__. With these changes nib2gmodel works on MacOSX-Server machines. Sat Jun 12 9:35:00 1999 Richard Frith-Macdonald * Source/NSResponder.m: Update encoding/decoding for interface styles * Model/GMAppKit.m: Update for interface styles * Headers/AppKit/NSScrollView.h: Added MacOS-X methods - setHorizontalLineScroll, setVerticalLineScroll, setHorizontalPageScroll, setVerticalPageScroll horizontalLineScroll, verticalLineScroll, horizontalPageScroll, verticalPageScroll * Source/NSScrollView.m: Added new MacOS-X methods - setHorizontalLineScroll, setVerticalLineScroll, setHorizontalPageScroll, setVerticalPageScroll horizontalLineScroll, verticalLineScroll, horizontalPageScroll, verticalPageScroll Fri Jun 11 8:35:00 1999 Richard Frith-Macdonald * Source/NSScroller.m: Fixed bug in recognising page-scrolls - now sets the NSIncrementPage and NSDecrementPage correctly. * Source/NSScrollView.m: Fixed bug in scrolling by page - now uses the page size as the context to retain, as it should. Thu Jun 10 22:25:00 1999 Richard Frith-Macdonald * Source/NSView.m: Optimise display routines - avoid unneeded re-displays. Use flag to tell if a view is opaque. Optimise 'opaqueAncestor' * Model/GMAppKit.m: Set flag to say if a view is opaque on decoding. * Headers/AppKit/NSResponder.h: Add 'opaque_view' flag. Wed Jun 9 8:35:00 1999 Richard Frith-Macdonald * Headers/AppKit/DPSOperators.h: Add DPSmouselocation() * Headers/AppKit/PSOperators.h: Add PSmouselocation() * Headers/AppKit/NSGraphicsContext.h: Add ([-DPSmouselocation::]) * Headers/AppKit/GSMethodTable.h: Add ([-DPSmouselocation::]) * Source/NSWindow.m: Use DPSmouselocation() * Source/NSGraphicsContext.m: Add ([-DPSmouselocation::]) * Source/NSApplication.m: Fix retain/release problems introduced by event system changes. Sun Jun 6 20:40:00 1999 Richard Frith-Macdonald * Headers/AppKit/NSEvent.h: Added new event types and masks and tidied. * Headers/AppKit/NSGraphicsContext.h: Added event queue ivar * Source/NSEvent.m: Rewrite to add new event types, optimise, and generate all the exceptions it should. * Source/NSGraphicsContext.m: Incorporate event handling code from backend libraries. Sun Jun 6 9:35:00 1999 Richard Frith-Macdonald * Source/NSScrollView.m: tidyup * Source/NSScroller.m: Permit use of alt key to slow down scrolling. Sat Jun 5 21:50:00 1999 Richard Frith-Macdonald Added image updates by jagapen@whitewater.chem.wisc.edu - * Source/NSImageView.m: Implemented * Source/NSImageCell.m: New class * Source/GNUmakefile: Added NSImageCell * Headers/AppKit/NSImageCell.h: New header * Headers/AppKit/AppKit.h: Added NSImageCell Sat Jun 5 7:05:00 1999 Richard Frith-Macdonald * Source/NSCell.m: Some minor drawing optimisations. 1999-06-03 Adam Fedor * Source/NSGraphicsContext.m (GSCurrentContext): Insert = (patch from John BEPPU ). Thu Jun 3 9:35:00 1999 Richard Frith-Macdonald * Source/NSWorkspace.m: Updated app launching code to supply info to open files if necessary. Fixed bug in getting name of icons for file. Wed Jun 2 22:00:00 1999 Richard Frith-Macdonald * Source/NSButtonCell.m: ([sendAction:to:]) should work with nil target. * Source/NSCell.m: ([sendAction:to:]) should work with nil target. * Source/NSControl.m: ([sendAction:to:]) should work with nil target. Wed Jun 2 20:55:00 1999 Richard Frith-Macdonald * Source/NSApplication.m: Send performKeyEquivalent messages. * Source/NSWindow.m: Send performKeyEquivalent messages. * Source/NSView.m: Send performKeyEquivalent messages. * Source/NSMenu.m: Have the menu matrix forward performKeyEquivalent messages to the menu. Wed Jun 2 19:22:00 1999 Richard Frith-Macdonald * Headers/gnustep/gui/DPSOperators.h: Fixed error in event functions. * Headers/gnustep/gui/PSOperators.h: Fixed error in event functions. * Headers/gnustep/gui/NSApplication.h: Removed unused event queue. * Source/NSApplication.m: Rewrote all event handling. * Source/NSGraphicsContext.m: initialise dps event functions. Wed Jun 2 8:34:00 1999 Richard Frith-Macdonald * Tools/make_services.m: Updated to use the GNUSTEP_PATHPREFIX_LIST environment variable if it is available. Wed Jun 2 4:10:00 1999 Richard Frith-Macdonald Added patches from jagapen@whitewater.chem.wisc.edu - * Source/NSApplication.m: In setApplicationIconImage, invoke ([setName:@"NSApplicationIcon"]) on the appicon NSImage so gmodels can use that name to get the appicon. * Source/NSOpenPanel.m: Load the save panel gmodel as an NSOpenPanel instead. (Integrated from mGSTEP code.) Raise an exception if the panel gmodel is not found. Added +allocWithZone Removed some old code. * Model/GMAppKit.m: Changed NSSavePanel code to support sub-classes (i.e. NSOpenPanel). Encoding/decoding of titles for NSFormCell Tue Jun 1 18:20:00 1999 Richard Frith-Macdonald * Headers/AppKit/NSResponder.h: New flag for dnd. * Headers/AppKit/GSDragManager.h: new file. * Source/GSDragManager.m: new file. * Source/NSView.m: Implemented drag registration/unregistration and prepared for garbage collection. * Source/NSWindow.m: Implemented drag registration/unregistration and prepared for garbage collection. * Source/GNUmakefile: Updated for above changes Fri May 28 15:15:00 1999 Richard Frith-Macdonald * Source/NSPanel.m: ([-canBecomeKeyWindow]) return NO only if the _becomesKeyOnlyIfNeeded is set. ([-canBecomeMainWindow]) always return NO. NSRun... functions make the panel key and order front. * Source/NSButton.m: ([-performClick:]) lock and unlock focus round call to the cell. Thu May 27 19:40:00 1999 Richard Frith-Macdonald * Source/NSPasteboard.m: Tidy formatting and improve style slightly. Add private method so the pasteboard server can be the same process as the pasteboard owners - for use with X selection integration. 1999-05-25 Adam Fedor * Source/NSStringDrawing.m ([NSAttributesString -drawInRect:]): Remove gsave/grestore and NSClipRect (to conform to Apple's OPENSTEP NSString operation). Tue May 25 8:50:00 1999 Richard Frith-Macdonald * Source/Model/IMConnectors.m: Use 'standard' function to set ivars the local version was buggy. * Headers/AppKit/PSOperators.h: Optimise access to context Tue May 25 3:55:00 1999 Richard Frith-Macdonald * Source/Model/GMArchiver.m: Fix for save panels by Jonathan Gapen. 1999-05-18 Adam Fedor * Headers/gnustep/gui/DPSOperators: New graphics extensions operators (composite, compositerect, disolve, etc). * Headers/gnustep/gui/GSMethodTable.h: Likewise. * Headers/gnustep/gui/NSGraphicsContext.h: Likewise. * Headers/gnustep/gui/PSOperators.h: Likewise. * Source/NSGraphicsContext.m: Likewise. * Source/NSImageRep.m: (-drawAtPoint:): Implement using DPS operators. (-drawInRect:): Likewise. Sun May 16 8:15:00 1999 Richard Frith-Macdonald * Source/NSView.m: Use new context lock/unlock operations. Mon May 14 19:50:00 1999 Richard Frith-Macdonald * Tools/make_services.m: Fix to get correct type info cached. 1999-05-12 Adam Fedor * Source/NSButtonCell.m (-drawWithFrame:inView:): Don't set a clip rect (not needed since we know what we're drawing). (-drawInteriorWithFrame:inView): Remove gsave/grestore. * Source/NSCell.m: Likewise. * Source/NSStringDrawing.m ([NSAttributedString -drawInRect:]): gsave/grestore around rectclip. * Headers/gnustep/gui/NSFont.h: ivar to show when matrix was explicitly set. * Source/NSFont.m (+fontWithName:size:): Reset it. 1999-05-11 Adam Fedor * Source/NSButtonCell.m ([NSButtonCell -drawInteriorWithFrame:inView:]): gsave/grestore around image/text to return to original clipping rect for second half of drawing. * Source/NSCell.m ([NSCell -_drawText:title:cellFrame]): PointSize does not include descender. (-highlight:withFrame:inView:): gsave/grestore to return to original for second highlight call. * Source/NSControl.m ([NSControl -mouseDown:]): Remove extra lockFocus. * Source/NSMenu.m ([NSMenuMatrix -initWithFrame:]): Font descender is a negative number. * Source/NSStringDrawing.m (sizeLine): Likewise. (setupRun): Likewise. (drawRun): Awful hack to get DGS to flush strings. * Headers/gnustep/gui/DPSOperators.h (DPSflush): Added operator. * Headers/gnustep/gui/GSMethodTable.h: Likewise. * Headers/gnustep/gui/NSGraphicsContext.h: Likewise. * Headers/gnustep/gui/PSOperators.h: Likewise. * Source/NSGraphicsContext.m: Likewise. Mon May 10 9:50:00 1999 Richard Frith-Macdonald * Headers/AppKit/NSGraphicsContext.h: Added GSCurrentContext() for optimised access to current context for thread. * Source/NSView.m: Minor optimisation of graphics context access. * Source/NSApplication.m: ditto * Source/NSScrollView.m: ditto * Source/NSSplitView.m: ditto * Source/NSStringDrawing.m: ditto * Source/NSGraphicsContext.m: Added GSCurrentContext() to return the current graphics context for the thread. Sun May 9 9:13:00 1999 Richard Frith-Macdonald * Source/NSView.m: Further optimisations, plus bugfix to ensure that a view and it's children are moved to window 'nil' when the view is removed from it's superview. Fri May 7 21:25:00 1999 Richard Frith-Macdonald Large and complex changes made in order to speed up operation of the gui. Roughly double the speed of an app - but stability will probably suffer for a while. * Headers/AppKit/NSResponder.h: Added flags structure for use by NSView (and others) for optimisation. * Headers/AppKit/NSView.h: Made ([-subviews]) return an array. Removed ([-cursorRectangles]) and ([-trackingRectangles]) * Model/GMAppKit.m: Added code to ensure that 'flipped_view' and 'has_subviews' flags are setup correctly on unarchiving. * Source/NSView.m: Removed ([-cursorRectangles]) and ([-trackingRectangles]). Added 'flipped_view' flag throughout, to avoid necessity of sending ([-isFlipped]) message except at initialisation. Added 'has_currect' flag to say if the view has any cursor rectangles. Added 'has_trkrect' flag to say if the view has any tracking rectangles. Added 'has_subviews' flag to say if the view has any subviews. Make use of the new flags. * Source/NSClipView.m: Added code to update 'flipped_view' flag when the codument view is changed. * Source/NSClipView.m: Added code to update 'flipped_view' flag when the document view is changed. * Source/NSScrollView.m: Make use of the 'flipped_view' flag. * Source/NSSplitView.m: Make use of the 'flipped_view' flag. * Source/NSWindow.m: For tracking rectangles and cursor rectangles, make use of the new flags maintained by NSView. Fri May 7 12:16:00 1999 Richard Frith-Macdonald * Headers/AppKit/GSTrackingRect.h: Add a couple of ivars and make them public. * Source/GSTrackingRect.m: Set ivars to say what methods the owner responds to. * Source/NSWindow.m: Rewrite of ([-_checkTrackingRectangles:forEvent]) and ([-_checkCursorRectangles:forEvent:]) 1999-05-05 Adam Fedor * Headers/gnustep/gui/NSGraphicsContext.h: New lock focus methods to replace old ones (lockFocusView:inRect:, unlockFocusView:needsFlush:). * Headers/gnustep/gui/NSWindow.h: New rectsBeingDrawn stack. * Source/NSGraphicsContext.m (-lockFocusView:inRect:): Implement. (-unlockFocusView:needsFlush:): Likewise. * Source/NSView.m (-lockFocus): Use them. (-unlockFocus): Likewise. Tue May 4 18:00:00 1999 Richard Frith-Macdonald * Headers/AppKit/NSGraphicsContext.h: methods for event handling. * Headers/AppKit/GSMethodTable.h: methods for event handling. * Headers/AppKit/DPSOperators.h: methods for event handling. * Headers/AppKit/PSOperators.h: methods for event handling. * Source/NSGraphicsContext.m: methods for event handling. Tue May 4 14:40:00 1999 Richard Frith-Macdonald Updates from information supplied by Marc Champesme to make NSWindow header have all the MacOS-X stuff in it. * Headers/AppKit/NSResponder.h: include NSInterfaceStyle and fix a few method prototypes; * Headers/AppKit/NSWindow.h: Added a whole load of MacOS-X methods. * Source/NSResponder.m: Fixed a few method prototypes and added interface style stuff. * Source/NSWindow.m: Fixed a few method prototypes and added interface style stuff and gState implementation. Mon May 3 18:55:00 1999 Richard Frith-Macdonald * Source/NSButtonCell.m: ([-drawWithFrame:inView:]) and ([-drawInteriorWithFrame:inView:]) respect ([-isTransparent]) 1999-05-01 Adam Fedor * Headers/gnustep/gui/NSGraphicsContext.h (-windowRectInDeviceSpace:): New method. * Headers/gnustep/gui/NSWindow.h: Removed old flush ivar, added new one. * Source/NSGraphicsContext.m (-lockFocusView:): Set focus window's rectBeingDrawn ivar for flushing performance. (-unlockFOcusView:): Set rectNeedsFlush from rectBeingDrawn. Thu Apr 29 13:10:00 1999 Richard Frith-Macdonald * Source/NSControl.m: ([-drawRect:]) implemented to call ([-drawCell:]) This (undocumented) behavior seems to be what OPENSTEP does. Thu Apr 29 12:40:00 1999 Richard Frith-Macdonald Patches by Tim Bissell * Model/GMAppKit.m: Fixes for window frames * Model/IBClasses.m: ditto * Model/IMCustomObject.m: ditto Wed Apr 28 11:37:00 1999 Richard Frith-Macdonald Images for FileViewer. * Images/GNUmakefile: new images * Images/common_Unknown.tiff: new * Images/common_Folder.tiff: new * Images/common_Root_PC.tiff: new * Images/common_Root_SGI.tiff: new * Images/common_Root_Sparc.tiff: new * Images/common_Root_Sparc2.tiff: new * Images/common_Root_Apple.tiff: new * Source/NSImageRep.m: A few bugfixes. * Source/NSCachedImageRep.m: A few bugfixes. * Source/NSImage.m: Partial support for caching. * Source/NSWorkspace.m: Support for finding file icons and finding the correct application to open an app with a given extension. * Headers/AppKit/NSWorkspace.h: GNUstep specific API for handling the preferred icon and the preferred app to edit/view a file. 1999-04-27 Michael Hanni Changes based on report by Tim Bissell * Source/NSFont.m: implemented new methods: + (NSFont *)titleBarFontOfSize:(float)fontSize; + (NSFont *)menuFontOfSize:(float)fontSize; + (NSFont *)messageFontOfSize:(float)fontSize; + (NSFont *)paletteFontOfSize:(float)fontSize; + (NSFont *)toolTipsFontOfSize:(float)fontSize; + (NSFont *)controlContentFontOfSize:(float)fontSize; * Headers/AppKit/NSFont.h: ditto. Tue Apr 27 15:48:00 1999 Richard Frith-Macdonald * Source/NSApplication.m: Load image specified in Info-gnustep.plist and use it as app icon if possible. Tue Apr 27 15:10:00 1999 Richard Frith-Macdonald Changes supplied by Tim.Bissell@dresdnerkb.com * Source/NSBrowserCell.m: Use 3d arrow images. * Images/GNUmakefile: Add 3d images * Images/common_3DArrowRight.tiff: new file * Images/common_3DArrowRightH.tiff: new file * Model/IMCustomObject.m: minor bugfixes * Model/GMAppKit.m: Partial fixes to handle window sizes correctly. Mon Apr 26 7:05:00 1999 Richard Frith-Macdonald Changes based on report by Marc.Champesme@lipn.univ-paris13.fr * Headers/AppKit/NSHelpPanel.h: place in #ifndef STRICT_MACOS_X * Headers/AppKit/NSGraphicsContext.h: place in #ifndef STRICT_OPENSTEP * Headers/AppKit/NSInterfaceStyle.h: new file. * Headers/AppKit/NSResponder.h: new interface_style ivar. * Headers/AppKit/AppKit.h: Added NSInterfaceStyle. * Source/NSInterfaceStyle.m: new file - implemented class. * Source/GNUmakefile: Added NSInterfaceStyle stuff. Fri Apr 23 16:30:00 1999 Richard Frith-Macdonald Changes based on report by Marc.Champesme@lipn.univ-paris13.fr * Source/NSOpenPanel.m: Tidied a little. * Source/NSSavePanel.m: ditto * Headers/AppKit/NSPanel.m: Added NS_ALERTDEFAULT etc. * Headers/AppKit/NSSavePanel.m: Bracket MacOS-X method with #ifndef STRICT_OPENSTEP 1999-04-22 Michael Hanni * Model/test.m: fixed NSGraphic's'Context type-o. * Model/GMAppKit.m: Added missing @end to NSImageView implementation. Mon Apr 19 14:54:00 1999 Richard Frith-Macdonald * Source/NSApplication.m: Link in dummy function to ensure that NSStringDrawing catagories are linked when using static libs. * Source/NSStringDrawing.m: Add dummy function to force link. * Source/NSEvent.m: Faster thread access. * Source/NSGraphicsContext.m: ditto. Sun Apr 18 6:30:00 1999 Richard Frith-Macdonald Added all improvements from mgstep. NSBrowser.m: ([-setPath]) implemented. NSMatrix.m: ([-getRow:column:ofCell:]) bugfix. 1999-04-14 Adam Fedor * Headers/gnustep/gui/NSScreen.h: Add initializer. * Source/NSScreen.m (initWithDeviceDescription:): New method to make it easier to determine screen information. * Source/NSBundleAdditions.m (+loadNibFile:): Fix unarchiver method name. Wed Apr 14 16:58:00 1999 Richard Frith-Macdonald Applied changes by Tim.Bissell@dresdnerkb.com - * Model/GMAppKit.m: Fixed unarchiving of NSButton and NSTextField so they don't refer to [self cell] before initialisation. Wed Apr 14 15:04:00 1999 Richard Frith-Macdonald * Source/NSPasteboard.m: Remove 'system()' and use NSTask to launch gpbs if necessary instead. * Source/NSWorkspace.m: Removed a load of obsolete code - depend on NSBundle and NSTask to do the right thing. Fri Apr 9 16:08:00 1999 Richard Frith-Macdonald * Source/NSStringDrawing.m: Further hacking of the string drawing stuff to (hopefully) support fonts, colors, tabs, underline, kern, leading. Very little actually tested and no line-break support yet. Thu Apr 8 21:08:00 1999 Richard Frith-Macdonald * Source/NSWindow.m: Tidy window view stuff * Source/NSWorkspace.m: Improve app launching to try various locations. * Source/GSServicesManager.m: Workaround compiler bug and remove unused method. * Headers/AppKitGSServicesManager.h: Remove unused method. Wed Apr 7 21:35:00 1999 Richard Frith-Macdonald * Source/NSCell.m: Position image correctly in flipped view. Wed Apr 7 10:10:00 1999 Richard Frith-Macdonald * Images/GNUmakefile: Install all images * Source/NSControl.m: ([setCell:]) permit nil cell values. Tue Apr 6 14:50:00 1999 Richard Frith-Macdonald Applied Felipes fixes from mgstep. Thu Apr 1 20:45:00 1999 Richard Frith-Macdonald * Source/NSStringDrawing.m: improved paragraph style handling and added slight optimisation to restore (barely) tolerable performance. Further optimisation to wait until it all works properly. 1999-04-01 Adam Fedor * Model/test.m (main): Change GSContext to NSGraphicContext Thu Apr 1 20:45:00 1999 Richard Frith-Macdonald * Source/NSTextField.m: init with same default values as OPENSTEP * Source/NSPanel.m: Tidied. * Source/NSStringDrawing.m: First go at support for paragraph styles, tabs, and kerning. Thu Apr 1 10:00:00 1999 Richard Frith-Macdonald * Model/GMAppKit.m: Added patch supplied by Jonathan Gapen Thu Apr 1 06:45:00 1999 Richard Frith-Macdonald * Source/NSCell.m: Make bezeled and bordered mutually exclusive - bug report by Jonathan Gapen * Headers/AppKit/NSStringDrawing.h: Add all the string drawing stuff * Source/NSStringDrawing.m: Rewrite from scratch - preliminary work. * Source/NSButton.m: Removed redundant lock/unlock in drawing ops. * Source/NSControl.m: tidy. * Source/NSSplitView.m: avoid compiler warning. * Source/NSTextFieldCell.m: tidy up, set draws background color in initialisation, fix border/bezel drawing. Wed Mar 31 17:32:00 1999 Richard Frith-Macdonald * Source/NSView: ([-viewWithTag:]) complete rewrite to find nearest matching view at any depth as it should. ([-replaceSubview:with:]) minor rewrite and tidy up. Tue Mar 30 14:00:00 1999 Richard Frith-Macdonald * Source/NSCell.m: Position image correctly in flipped views. * Source/NSSplitView.m: Position dimple image correctly when flipped. * Source/NSImage.m: Tidied a little * Source/NSScrollView.m: Work when flipped - and make NSScrollView flipped unless a subclass dictates otherwise. Tue Mar 30 05:26:00 1999 Richard Frith-Macdonald * Headers/AppKit/NSScroller.h: Modified ([-setContentView:]) and ([-contentView]) to use NSClipView rather than NSView. * NSScroller.m: Modified ([-setContentView:]) and ([-contentView]) to use NSClipView rather than NSView. Sat Mar 27 05:58:00 1999 Richard Frith-Macdonald * Source/NSBrowser.m: Override target, setTarget, action, setAction * Headers/AppKit/NSBrowser.h: Add _action and _target ivars. FRi Mar 26 20:34:00 1999 Richard Frith-Macdonald * Source/NSImage.m: Incorporated fixes suggested by dave@turbocat.de Thu Mar 25 20:34:00 1999 Richard Frith-Macdonald Mostly fixes to cope with case where tracking rectangles are removed from a window while an event that refers to them is still in the queue. * Source/NSView.m: Handle invalidation of cursor rectangles. * Source/NSWindow.m: Cope with invalidated cursor rects. * Source/NSEvent.m: Retain tracking rectangles. * Source/GSTrackingRect.m: Added support for invalidation. * Source/NSApplication.m: Deactivate app on hide. * Headers/AppKit/NSApplication.h: flag to decide whether to unhide on application activation. Thu Mar 25 09:12:00 1999 Richard Frith-Macdonald * Source/NSCell.m: Added all the exceptions mentioned in the docs. Wed Mar 24 10:52:00 1999 Richard Frith-Macdonald * Source/NSMenu.m: ([-acceptsFirstmouse:]) implemented. * Source/NSScroller.m: ([-acceptsFirstmouse:]) implemented. * Source/NSButton.m: ([-acceptsFirstmouse:]) implemented. * Source/NSSplitView.m: ([-acceptsFirstmouse:]) implemented. * Source/NSWindow.m: Now uses ([-acceptsFirstmouse:]) as it should and sends mouse movement and drag events as it should. Wed Mar 24 08:23:00 1999 Richard Frith-Macdonald Incorporated patches by Benhur-de-Oliveira.Stein@imag.fr * Model/GMAppKit.m: various fixes. * Model/GMArchiver.m: various fixes. * Model/IMCustomObject.m: various fixes. * Model/IMLoading.m: various fixes. Tue Mar 23 22:00:00 1999 Richard Frith-Macdonald * Source/NSWindow.m: Tidied up and added ([-setResizeIncrements:]) * Headers/AppKit/NSWindow.h: Ddded ([-setResizeIncrements:]) Tue Mar 23 1999 Michael Hanni * Source/NSFontManager.m: implemented orderFrontFontPanel:. * Source/NSFontPanel.m: implemented init:. Will now display the font panel. Not necessarily useful yet though. I need to plugin a few matrixes and bogus arrays with font info to make it look useful. Try fontpanel.app in xraw/Testing. Mon Mar 22 13:12:00 1999 Richard Frith-Macdonald * Source/NSView.m: implement lockFocus and unlockFocus * Source/NSImage.m: ([+imageNamed:]) store new image in dictionary with the name actually supplied. Wed Mar 17 6:48:00 1999 Richard Frith-Macdonald * Source/NSAffineTransform.m: bounding matrix of an unrotated rect is the rect itsself. Mon Mar 16 16:19:00 1999 Richard Frith-Macdonald * Source/NSTextFieldCell.m: Don't draw background by default - be consistent with OPENSTEP. Wed Mar 16 16:00:00 1999 Richard Frith-Macdonald * Source/NSApplication.m: ([-runModalSession:]) fix for windowmaker doing a windowshade - HACK - need a better solution. * Source/NSClipView.m: ([-setBoundsOrigin:]) update window before doing bit copy. * Source/NSColor.m: Fix default scroller color. * Source/NSScroller.m: Minor tidyup - use scroller slot color. * Source/NSImageRep.m: Tidyup - remove workaround for missing NSString functionality - no longer required. Mon Mar 15 10:15:00 1999 Richard Frith-Macdonald * Source/NSView.m: ([-resizeWithOldSuperviewSize:]) Added fix so this method is active at correct times - there was a logic error in the original code. * Source/NSBrowser.m: Removed ([-setFrame:]) and added an implementation of ([-resizeSubviewsWithOldSize:]) such that autoresizing now works. 1999-03-14 Adam Fedor * Model/GNUmakefile: Add ifeq's for OpenStep 4.0 compilation * Model/IMConnectors.m: COmment out extension includes Sun Mar 14 21:27:00 1999 Richard Frith-Macdonald * Source/NSView.m: ([-resizeWithOldSuperviewSize:]) Added fix for autoresizing in flipped views. * Source/NSScrollView.m: ([-_doScroll:]) update window after each call so that click-and-hold on scroller button is displayed properly. Sun Mar 14 10:20:00 1999 Richard Frith-Macdonald * Source/NSScroller.m: Rewrite and tidy various stuff to bring into conformance with MacOS-X documentation and to be more compatible - Scrollers are now flipped views. * Source/NSScrollView.m: Minor changes to work with corrections to NSScroller. Thu Mar 11 Felipe A. Rodriguez * gui/Images: common_Right.tiff add alpha channel to image. Thu Mar 11 11:57:00 1999 Richard Frith-Macdonald * Source/NSBox.m: Tidied and added code to prevent attempts to set contentview to negative dimensions. * Source/NSMenu.m: Tidied and added code to prevent attempts to set mwnu matrix frame to negative dimensions. Wed Mar 10 12:56:00 1999 Richard Frith-Macdonald * Source/NSAffineTransform.m: Improved debug logging. * Source/NSView.m: Add loads of checks to ensure that you can't set illegal (negative) dimensions in frame or bounds. Add loads of code to cope with scaling when bounds dimensions are zero. Added logged warning if you set bounds dimensions to zero. Changed debug logging to use the 'NSView' logging level. Tue Mar 9 19:57:00 1999 Richard Frith-Macdonald * Headers/AppKit/NSParagraphStyle.h: Tidied * Headers/AppKit/NSTextStorage.h: Tidied * Source/NSParagraphStyle.m: Implemented NSTextTab, NSParagraphStyle, and NSMutableParagraphStyle classes. * Source/NSTextStorage.m: Added incomplete implementation. 1999-03-08 Adam Fedor * Merge dawn branch into main. Mon Mar 8 8:55:00 1999 Richard Frith-Macdonald * Source/NSClipView.m: Tidied a little, including minor fixes for cases where the doucment view is nil. * Source/NSScrollView.m: Tidied and fixed bugs in scrolling for document views whose origins are not 0,0. Sun Mar 7 6:00:00 1999 Richard Frith-Macdonald * Source/NSView.m: ([-removeFromSuperview]) Fixed error invalidating coordinates of a view - returned if there was no superview. Fri Mar 5 16:04:00 1999 Richard Frith-Macdonald * Headers/AppKit/NSGraphicsContext.h: Added three new methods to support focusing - ([-focusView]), ([-pushFocusView:]) and ([-popFocusView:]) * Source/NSGraphicsContext.m: Added new focussing methods, tidied a little, and made graphocs contexts thread-safe. * Source/NSView.m: Removed old code to handle per-thread stack of focussed views - use new code in NSGraphicsContext instead. * Source/NSCell.m: Draw cell text with font and colour attributes. Thu Mar 4 12:46:00 1999 Richard Frith-Macdonald * Source/NSClipView.m: Fixed to cope with nil document view. Wed Mar 3 08:53:00 1999 Richard Frith-Macdonald * Source/NSCell.m: ([-drawInteriorWithFrame:inView:]) don't draw background - NSCell shouldn't draw backgrounds even if opaque - it's the responsibility of the subclass. ([-isOpaque]) Fixed to return NO as it should. * Source/NSTextFieldCell.m: ([-drawInteriorWithFrame:inView:]) handle drawing background if necessary before calling method in super. Tue Mar 2 13:27:00 1999 Richard Frith-Macdonald * Source/NSView.m: Bugfix in redisplay - avoid views being redrawn when not needed - hope I didn't break anything - this stuff is tricky. Tue Mar 2 11:40:00 1999 Richard Frith-Macdonald * Source/NSMatrix.m: Tracking fixes by Benhur-de-Oliveira.Stein@imag.fr * Source/NSControl.m: Fix setting of cell states by Benhur * Source/NSCell.m: Toggle cell state in mouse tracking Tue Mar 2 08:04:00 1999 Richard Frith-Macdonald * Merge in 'dawn' CVS branch. Mon Mar 1 20:06:00 1999 Richard Frith-Macdonald Removed PSMatrix - replaced by NSAffineTransform * Headers/AppKit/NSAffineTransform.h: New file based on PSMatrix.h * Source/NSAffineTransform.m: New file based on PSMatrix.m * Source/NSView.m: Modified to use NSAffineTransformAffineTransform * Source/GNUmakefile: Added NSAffineTransform * Source/NSCell.m: Don't include PSMatrix.h * Source/NSScroller.m: Don't include PSMatrix.h * Source/NSView.m: Use NSAffineTransform * Source/NSWindow.m: Don't include PSMatrix.h Mon Mar 1 17:12:00 1999 Richard Frith-Macdonald * Headers/AppKit/NSCell.h: Added MacOS-X cell state constants. Thu Feb 25 15:00:00 1999 Richard Frith-Macdonald Added support for the new (MacOS-X) NSGraphicsContext class by incorporating stuff from Adam Fedors xgps and replacing GSContext * Headers/AppKit/DPSOperators.h: New file * Headers/AppKit/PSOperators.h: New file * Headers/AppKit/GSMethodTable.h: New file * Headers/AppKit/NSGraphicsContext.h: New file * Source/NSGraphicsContext.m: New class implementation * Headers/AppKit/AppKit.h: Updated for NSGraphicsContext * Headers/AppKit/NSApplication.h: ditto * Headers/AppKit/NSEvent.h: ditto * Headers/AppKit/NSImage.h: ditto * Headers/AppKit/NSPrintOperation.h: ditto * Headers/AppKit/NSView.h: ditto * Headers/AppKit/NSWindow.h: ditto * Source/Functions.m: ditto * Source/GNUmakefile: ditto * Source/NSApplication.m: ditto * Source/NSButtonCell.m: ditto * Source/NSCell.m: ditto * Source/NSEvent.m: ditto * Source/NSPrintOperation.m: ditto * Source/NSScrollView.m: ditto * Source/externs.m: ditto Wed Feb 24 Felipe A. Rodriguez * NSSliderCell.m: knobRectFlipped: fix draw bugs in slider.app example. Mon Feb 22 8:30:00 1999 Richard Frith-Macdonald * NSView.m: Tidied coordinate conversion code to use new system with a cached conversion matrix to convert to/from window coordinates. * NSView.h: Cache conversion matrices. Mon Feb 22 6:06:00 1999 Richard Frith-Macdonald * NSView.m: Tidied coordinate conversion code to use new system with a cached conversion matrix to convert to/from window coordinates. 1999-02-21 Michael Hanni * Headers/gnustep/gui/NSRulerView.h: added (note: not implemented) * Headers/gnustep/gui/NSRulerMarker.h: added (note: not implemented) Sun Feb 21 20:36:00 1999 Richard Frith-Macdonald * Headers/gnustep/gui/NSCell.h: tidyup * Headers/gnustep/gui/NSView.h: Added matrix for coordinate conversion * Source/NSView.m: Bugfix in update, plus partial code for improved coordinate handling. 1999-03-08 Adam Fedor * Version 0.5.5 Released. Sun Mar 7 5:58:00 1999 Richard Frith-Macdonald * Source/NSView.m: Fixed error invalidating coordinates of a view. 1999-03-04 Adam Fedor * Testing/GNUmakefile.preamble: Remove tiff and jpeg libs. * Tools/GNUmakefile.preamble: Likewise (already in make package). 1999-03-01 Adam Fedor * Update documentation. Wed Feb 24 8:56:00 1999 Richard Frith-Macdonald Benhur reported oddity in cell drawing code - cells were drawing their backgrounds in the method to draw the frame. Fixed this by moving background drawing code to the drawInterior methods - also removed a lot of redundant code to workaround bugs in clipping that are now fixed. * Source/NSBrowserCell.m: update drawing code. * Source/NSButtonCell.m: ditto. * Source/NSCell.m: ditto. * Source/NSFormCell.m: ditto. * Source/NSSliderCell.m: ditto. * Source/NSTextFieldCell.m: ditto. Tue Feb 23 19:30:00 1999 Richard Frith-Macdonald Practically every file - I went through all the classes that conform to the NSCoding protocol and checked and tidied their initWithCoder and encodeWithCoder methods. In some cases they simply needed the method prototypes fixing, but in most the initWithCoder method needed modifying to retain decoded ivar objects correctly! No guarantees that coding/decoding is correct now - but it's certainly a lot better. Tue Feb 23 15:18:00 1999 Richard Frith-Macdonald Various files - fixed all the copyWithZone: methods where objects are both copied AND retained. 1999-02-22 Adam Fedor * Version: update version. Mon Feb 22 5:52:00 1999 Richard Frith-Macdonald * Source/NSView.m: ([-displayIfNeededInRectIgnoringOpacity:]) a two character change to fix a redisplay problem - already in the main cvs branch. Also merged in changes to coordinate conversion code. Sun Feb 21 14:43:57 1999 Masatake Yamato * Panels/GNUmakefile (before-uninstall): Use -d instead of -e. test command in sh of solaris2.6 doesn't support -e option. Fri Feb 19 20:00:00 1999 Richard Frith-Macdonald * Source/NSClipView.m: coordinate fixes. * Source/NSScrollView.m: ditto * Source/NSTextField.m: bugfix for redisplay * Source/PSMatrix.m: minor tidyup * Source/tiff.m: fix a warning * Testing/GNUmakefile: fixup * Testing/GNUmakefile.preamble: fixup * Testing/testpb.m: incomplet attempt to get this linking properly Thu Feb 18 13:12:00 1999 Richard Frith-Macdonald * Headers/AppKit/NSView.h: Listed all private methods allong with a warning that they shouldn't be overridden. Removed a couple of unused ivars. Added two new ivars - a cache for the visible rectangle and a flag to say whether it (and when we add it, a matrix to map to and from window coordinates) is currently valid. Added ([-_invalidateCoordinates]) method declaration. * Source/NSView.m: Much tidying up. Added ([-__invalidateCoordinates]). Modified ([-visibleRect]) to cache the visible rect and to clip the invalid rect. Speeded up iterations over all subviews etc. Fix error in redisplay causing occasional excess redisplay. * Source/NSSplitView.m: Corrected orientation of dividers. * Source/NSBrowser.m: Tidied - use setNeedsDisplay. * Source/NSBrowserCell.m: Tidied and fixed bugs in decoding. * Source/NSCell.m: Tidied and fixed bugs in decoding and setting editable/selectable status. * Source/NSScroller.m: Tidy a little. Thu Feb 18 1999 Felipe A. Rodriguez * NSView.m display: fix for display bug in buttons example * NSCell.m endEditing: fix for display bug in buttons example * NSTextField.m textShouldEndEditing: The changes to these three classes fix a display bug visible in the buttons example when the top text field is selected for editing and then asked to resign when the user clicks on say the bottom text field. This causes a rect encompassing both views to be invalidated and displayed. Beyond being inefficient this also causes a display glitch given the current drawing methodology. Wed Feb 17 11:50:00 1999 Richard Frith-Macdonald * Source/NSView.m: Tidyup - visibleRect is empty if we have no window. * Source/NSText.m: ([-redisplayForLineRange:]) fixed error drawing into wrong view. * Source/NSCell.m: When starting to edit cell text, set the frame of the text object after adding to the view so it gets sized correctly. Wed Feb 17 9:04:00 1999 Richard Frith-Macdonald * Tools/make_services.m: Updated for change in NSProcessInfo * Tools/set_show_service.m: Updated for change in NSProcessInfo Wed Feb 17 8:38:00 1999 Richard Frith-Macdonald * Source/NSSplitView.m: ([-setDelegate:]) corrected to register delegate to recieve notifications. * Source/NSText.m: ([-setDelegate:]) corrected to register delegate to recieve notifications. * Source/NSTextView.m: ([-setDelegate:]) implemented to register delegate to recieve notifications. * Source/externs.m: Added missing TextView notifications. Wed Feb 17 4:06:00 1999 Richard Frith-Macdonald * Source/NSApplication.m: ([-setDelegate:]) remove old delegate as observer of application notifications. * Source/NSWindow.m: ([-setDelegate:]) add delegate as observer for window notifications. Tue Feb 16 17:06:00 1999 Richard Frith-Macdonald Additions provided by mgiddings@ypc.net - * Headers/AppKit/NSNibDeclarations.h: New file * Headers/AppKit/AppKit.h: Added NSNibDeclarations.h * Source/GNUmakefile: Added NSNibDeclarations.h Tue Feb 16 10:45:00 1999 Richard Frith-Macdonald * Tools/gpbs.m: Improve handling of loss of connections - don't remove data from a pasteboard unless it was owned by the connection lost. * Source/NSPanel.m: Override NSWindows initDefaults to make sure panels aren't shown in windows menu by default. * Source/NSApplication.m: Make NSApp a global variable. * Source/NSPasteboard.m: Fix recursivre dealloc. * Headers/AppKit/NSApplication.h: Make NSApp a global variable. Tue Feb 16 5:30:00 1999 Richard Frith-Macdonald * Source/NSView.m: Optimise coordinate conversion. * Headers/AppKit/PSMatrix.h: ditto 1999-02-15 Michael Hanni * Source/NSBox.m Source/NSButtonCell.m Source/NSCell.m Source/NSColorWell.m Source/NSMatrix.m Source/NSPrintInfo.m Source/NSScroller.m Source/NSSliderCell.m: fixed compilation warnings by including proper includes. * Tools/Functions.m: Defined NSRectClip(). Fixes fatal linking errors in Tools/ Mon Feb 15 12:20:00 1999 Richard Frith-Macdonald * Source/NSBrowserCell.m: Code by Benhur to handle flipped views * Source/NSButtonCell.m: ditto * Source/NSCell.m: ditto * Source/NSScrollView.m: ditto 1999-02-13 Michael Hanni * Small change to gui/Tools/GNUmakefile.preamble to allow for easy linking on FreeBSD 3.x. (added -ljpeg) Fri Feb 12 21:00:00 1999 Richard Frith-Macdonald * Source/NSView.m: Tidied some more. * Source/NSText.m: Don't use display - use setNeedsDisplay: instead so that drawing gets done automatically. Fri Feb 12 16:20:00 1999 Richard Frith-Macdonald * Source/NSView.m: Improve window flushing * Source/NSWindow.m: ditto Fri Feb 12 13:37:00 1999 Richard Frith-Macdonald * Source/NSCell.m: Fixes to draw text using NSText (by Benhur) Fri Feb 12 12:56:00 1999 Richard Frith-Macdonald * Headers/AppKit/NSView.h: Added missing method declarations for display methods. * Source/NSView.m: Rewrote all the display methods to the current spec (I hope). Thu Feb 11 14:10:00 1999 Richard Frith-Macdonald Coordinate fixes by Benhur to - * Source/NSClipView.m: Coordinate fixes by Benhur * Source/NSColor.m: Retain things properly when decoding. * Source/NSMatrix.m: Matrix coordinate system is flipped. * Source/NSScroller.m: Coordinate fixes Wed Feb 10 12:35:00 1999 Richard Frith-Macdonald * Source/NSClipView.m: Tidy flip-view errors by Benhur * Source/NSText.m: Lock focus around drawing insertion point while becoming/resiging first responder. Wed Feb 10 10:32:00 1999 Richard Frith-Macdonald * Source/NSCell.m: ([-copyWithZone:]) Fixed memory leak - was copying AND retaining contents. Tue Feb 9 12:20:00 1999 Richard Frith-Macdonald * Source/NSView.m: Various tidyups suggested by Benhur * Source/PSMatrix.m: ([-rectInMatrixSpace:]) and ([-sizeInMatrixSpace:]) fixed for negative values. * Source/NSScrollView.m: Resize code fix. Fri Feb 5 19:46:00 1999 Richard Frith-Macdonald * Source/NSView.m: Coordinate conversion fixe by Benhur-de-Oliveira.Stein@imag.fr * Source/NSClipView.m: turn copy-on-scroll off by defualt until it's working properly. * Headers/.../NSView.h: Fixed superview methods Fri Feb 5 6:00:00 1999 Richard Frith-Macdonald * Source/NSScroller.m: ([-knobRect:]) Correctd code so that the knob doesn't jump if you click on it. Thu Feb 4 18:50:00 1999 Richard Frith-Macdonald * Source/NSScroller.m: More fixes by Benhur-de-Oliveira.Stein@imag.fr * Source/NSClipView.m: ditto Thu Feb 4 9:35:00 1999 Richard Frith-Macdonald * Tools/dummy.m: renamed to Functions.m * Tools/Functions.m: created from dummy.m -some functions added * Tools/GNUmakefile: updated dummy.m to Functions.m * Source/NSApplication.m: Fixed to update all only when necessary. * Source/NSWindow.m: Fix to tell application when update required. The following files revised by Benhur-de-Oliveira.Stein@imag.fr * Source/NSScroller.m: Drawing fixes * Source/NSScrollView.m: Drawing fixes * Source/NSClipViem.m: Drawing fixes 1999-02-01 Adam Fedor * Model/test.m (main): Fix LIB_FOUNDATION ifdef. * Source/GSContext.m (-wait): New method. (Bug report from Eric Norum ). Mon Feb 1 13:35:00 1999 Richard Frith-Macdonald * Source/GSServicesManager.m: Replace call to getpid() with use of globallyUniqueString as a unique process name. Fri Jan 29 15:32:48 1999 Adam Fedor * Documentation/todo.tmpl.texi: Update. 1999-01-28 Adam Fedor * Model/GNUmakefile (libgmodel_OBJC_FILES): Add GMArchiver.m. (ADDITIONAL_TOOL_LIBS): Remove FoundationExt. * Headers/gnustep/gui/GMAppKit.h: Update GMArchiver include. * Model/IBClasses.m: Likewise. * Model/IMConnectors.m: Likewise. * Model/IMCustomObject.m: Likewise. * Model/IMConnectors.m: Likewise. * Model/IMLoading.m: Likewise. * Model/Translator.m: Likewise. * Source/NSPanel.m: Likewise. * Source/NSSavePanel.m: Likewise. Fri Jan 22 20:00:00 1999 Richard Frith-Macdonald * Source/NSView: Rewrote all the coordinate conversion methods to take account of flipped views correctly. Should be a major improvement. Thu Jan 21 10:05:00 1999 Richard Frith-Macdonald * Source/NSColor.m: Fixed initWithCoder: - was decoding an ivar twice (bug report by Benhur-de-Oliveira.Stein@imag.fr) - also used @encode() everywhere. Tue Jan 19 10:00:00 1999 Richard Frith-Macdonald * Source/NSScrollView.m: Tidied ([-tile]) and other stuff to do with resizing - removed some redundant code. * Source/NSSplitView.m: ([-adjustSubviews]) complete rewrite in an attempt to get things working as specified in documentation. Subviews are now scaled proportionately. * Source/NSBrowser.m: ([-selectedRowInColumn:]) implemented as suggested by Dirk Olmes. * Headers/AppKit/NSBrowser.h: ditto * Source/NSView.m: Raise exception if supplied with illegal bounds size (reported by Benhur-de-Oliveira.Stein@imag.fr) * Source/NSControl.m: Corrected ([-sendActionon:]) as suggested by Benhur-de-Oliveira.Stein@imag.fr * Source/NSClipView.m: General tidying and fix code to constrain the scroll point. Get everything to work correctly. Mon Jan 18 5:00:00 1999 Richard Frith-Macdonald * Source/NSColor.m: Fixed error in decoding color from defaults string - was only reading the first (red) color component. Fri Jan 15 10:00:00 1999 Richard Frith-Macdonald * Source/NSPasteboard.m: Removed unused (and erroneous) header. * Source/GSServicesManager.m: Fixed include path for fast.x as suggested by dirk@object-factory.com Fri Jan 15 9:30:00 1999 Richard Frith-Macdonald * Headers/AppKit/NSNibLoading.h: Added interface for new class - GSNibContainer - to manage the contents of a nib. * Source/NSBundleAdditions.m: Added implementation of GSNibContainer and implemented the nib loading methods using it and NSArchiver. This should give us a fast and simple alternative to gmodel files where portability (and the ability to edit by hand) is not a issue. Tue Jan 12 11:57:00 1999 Richard Frith-Macdonald * Source/NSWindow.m: ([-sendEvent:]) fix cursor update code to set cursors as it should. Mon Jan 11 17:00:00 1999 Richard Frith-Macdonald * Source/NSColor.m: ([-colorWithAlphaComponent:]) bugfix from Benhur-de-Oliveira.Stein@imag.fr Sat Jan 9 21:10:00 1999 Richard Frith-Macdonald * Source/NSWindow.m: ([-setcontentView:]) Corrected to resize the new content view to fill the window. Sat Jan 9 6:10:00 1999 Richard Frith-Macdonald * Source/NSApplication.m: ([-run]) reorganize so that the app can be terminated before entry to the run loop (in finishLaunching) and to make the event loop slightly more efficient. * Source/GSServicesManager.m: ([-registerAsServiceProvider:]) added checks to raise alert panel to let the application continue when it conflicts with an already running application or when the DO system is not working. Fri Jan 8 14:25:00 1999 Richard Frith-Macdonald * Images/GNUmakefile: Added common_WMClose.tiff and common_WMCloseBroken.tiff images. * Source/NSApplication.m: Use specific images for denoting state of documents in windows menu. Thu Jan 7 16:15:18 1999 Adam Fedor * Headers/gnustep/gui/GSContext.h: Add new backend instance variable for storing method pointers. Thu Jan 7 15:15:00 1999 Richard Frith-Macdonald * Tools/make_services.m: Extended to build a map of extensions to application names in the applications cache. * Source/GSServicesManager.m: Extensions for opening files. * Source/NSWorkspaceManager.m: Initial code for handling opening files. * GSServicesManager.m: GSConnectToApplication() function added to connect to, and if necessary launch, an application. Wed Jan 6 21:45:00 1999 Richard Frith-Macdonald * Source/NSCell.m: ([-endEditing]) modified as suggested by stark@easynet.fr to prevent recursion - clear delegate at start. Wed Jan 6 17:35:00 1999 Richard Frith-Macdonald * Source/NSApplication.m: minor fix for updating windows menu items. * Source/NSWindow.m: Update windows menu when document edit state is changed. Tue Jan 5 18:05:00 1999 Richard Frith-Macdonald * Source/NSMatrix.m: bugfix growing matrix - from stark@easynet.fr * Source/NSApplication.m: Modified -init method to return the shared application object so that +new is effectively a synonym for the [+sharedApplication] method - from stark@easynet.fr Tue Dec 22 12:30:00 1998 Richard Frith-Macdonald * Source/GSServicesManager.m: ([-rebuildServicesMenu:]) release submenu once it's added to main menu.a ([-update]) Don't force a display - let the autodisplay mechanism do it. * Source/NSMenu.m: ([-update]) Check to see if autoupdate is enabled properly and don't force a redisplay unnecessarily. * Source/NSApplication.m: ([-run]) update main menu items. * Source/NSMenuItem.m: Fix memory leak when copying an item with a submenu - the submenu was never released. * Source/NSWindow.m: Don't add window to windows menu in ([-initWithContentRect:styleMask:backing:defer:screen:]). ([-setMiniwindowTitle:]) Don't change windows menu if excluded. ([-makeKeyAndOrderFront:]) Make main window as well as key window. ([-initWithCoder:]) Don't put in windows menu automatically. * Source/NSpanel.m: Implemented ([canBecomeMainWindow]) to return NO. Sat Dec 19 01:26:06 1998 Matthias Klose * Images/Makefile.postamble: Use macro MKDIRS. * Headers/gnustep/gui/NSStringDrawing.h: Remove preface.h include. Sun Dec 20 6:30:00 1998 Richard Frith-Macdonald NSApplication.h: Removed windows_menu_count again - and removed window_list ivar - backend should return window list in ([-windows]). NSApplication.m: Removed window_list ivar - use calls to ([-windows]) instead. Remove code dealing with adding/removing windows - done in backend instead. Fri Dec 18 10:32300 1998 Richard Frith-Macdonald NSApplication.h: New instance variable to give reasonable perfomance with windows menu. Omitted by error in last update. Thu Dec 17 22:55:00 1998 Richard Frith-Macdonald * NSMenu.m: ([-update]) removed code to search responder chain - get NSApplication to do it for us. * NSApplication.m: Implemented more of the windows menu stuff. Almost complete barring wierd glitches due to the menu implementation. 1998-12-17 Matthias Klose * {,*}/GNUmakefile: Include Version and GNUmakefile.local. * Tools/GNUmakefile.preamble: Set ADDITIONAL_LIB_DIRS. Thu Dec 17 13:20:00 1998 Richard Frith-Macdonald * NSWindow.m: Reinstated changes lost in last update (to fix recursion problem on menu creation) and added acceptsFirstResponder. Wed Dec 16 1998 Felipe A. Rodriguez * NSWindow.m acceptsFirstResponder implement. * NSView.m: removeFromSuperview remove view from responder chain. Wed Dec 16 15:30:00 1998 Richard Frith-Macdonald * NSResponder.m: bugfix - now beeps when it can't handle a key down. * NSPanel.m: Panels are not released when closed. * NSWindow.m: Removed ([-keyDown:]) - functionality moved to point where keyDown events are sent to first responder. Fixed code for setting window titles to work with windows menu. Reinstated hack to shut down app when window closed and no main menu exists. * NSMenu.m: Removed redundant action dispatch code - use NSApplication Send notifications. * NSApplication.m: Implemented and rewrote loads of methods - windows menu now supported. Wed Dec 16 09:22:06 1998 Adam Fedor * Source/NSApplication.m (NSOpenStepRootDirectory): Remove duplicate function (also in base). Wed Dec 16 1998 Felipe A. Rodriguez * NSCell.m acceptsFirstResponder implement, editWithFrame: adjust further, selectWithFrame: preliminary implementation. * NSButton.m: acceptsFirstResponder implement. * NSText.m: shouldDrawInsertionPoint test for field editor status. * NSTextField.m: mouseDown: use field editor instead of previous non OS text field cell editor code, textShouldEndEditing: implement. Tue Dec 15 16:30:00 1998 Richard Frith-Macdonald * NSApplication.m: Terminate modal loop if the window goes away. * NSButton.m: Handle key equivalents. * NSButtonCell.m: Handle key equivalents. * NSCell.m: implement ([-performClick:]) method. * NSPanel.m: Close closable panels when user hits escape key. handle keyboard shortcut for default option. * NSWindow.m: Fix bug causing app to terminate when it shouldn't. Mon Dec 14 16:15:00 1998 Richard Frith-Macdonald * GSServicesMnager.m: Added alert panels to display error messages when services fail. Tested and fixed code for submenus of the services menu. Everything I know of is now implemented and working - now to wait for bug reports... Mon Dec 14 1998 Felipe A. Rodriguez * NSWindow.m renmae captureMouse: to _captureMouse: (designate as non OS), various methods add fieldEditor support. * GSContext.m/GSContext.h revert to previous code as solution discussed with Adam Fedor regarding backends had problems I had not forseen. * NSBrowserCell.h/.m specify text subcell as an NSCell, eliminate image cell, copyWithZone: optimize and eliminate use of ASSIGN (fixes serious dealloc bug), highlight: eliminate method (fixes dup display bug). * NSButtonCell.m copyWithZone: optimize and eliminate use of ASSIGN * NSStringDrawing.h/.m remove unimplemented draw methods from Category (these are backend specific, can't be defined twice and are already implemented in xraw). * NSApplication.h redefine initialize_gnustep_backend () per Adam's redefinition in the backend. * Functions.m/.h remove initialize_gnustep_backend() * NSCell.m preliminary implementation of fieldEditor mechanism, copyWithZone: optimize and eliminate use of ASSIGN * NSControl.m rename cell class global to _NSCONTROL_CELL_CLASS * NSMatrix.m implement NSControl's updateCell: to prevent unecessary matrix drawing if possible. * NSView.m -resizeWithOldSuperviewSize reverted code to my own once more (fewer lines and no if/else logic), changed code to use view frame instead of bounds per 3.3/4.2 docs, optimize to avoid floating point math and scale adjustment unless view has been scaled. * NSScrollView.m define as externs various PS* functions for use in drawing, polish drawing, move all backend code to front. * Tools/dummy.m define dummy PS* functions employed in gui. Mon Dec 14 9:10:00 1998 Richard Frith-Macdonald * NSPanel.m: Implemented all the alert panel functions * NSPanel.h: Added prototypes for MacOS-X alert panel functions. Sat Dec 12 10:10:00 1998 Richard Frith-Macdonald * NSView.m: Fixed bug and added comment about the (deliberately) wrong code that rounds view sizes down to an integer number of points. Commented out debug prointfs * NSPanel.m: Minor tidying - fixed size of alert panel and made message text be centered. Sat Dec 12 7:00:00 1998 Richard Frith-Macdonald * NSView.m: ([-resizeWithOldSuperviewSize:]) revert to previous code (in order to fix error in logic of handling cases whare MaxX or MaxY are specified). Added reliable code to avoid fractional values (floors final values rather than deltas - so gives right results even when a frame with fractional values was passed into the method). Yes, I know it's more lines of code - but it's better to have longer code that works correctly than shorter code that doesn't :-) Fri Dec 11 08:52:03 1998 Adam Fedor * Headers/gnustep/gui/GSContext.h: Remove method table. * Source/GSContext.m: Remove method table initialization. (+initializeMethodTable): Remove. Thu Dec 10 1998 Felipe A. Rodriguez * GNUAlertPanel rename to GSAlertPanel (to maintain a common naming style along the NS* lines within the AppKit public API). Move code to NSPanel as it is conceptually a private panel class for the sake of the public NS* panel functions. * GNUServicesManager.m/.h rename to GSServicesManager (to maintain a common naming style along the NS* lines within the AppKit public API). Thu Dec 10 15:03:05 1998 Adam Fedor * Headers/gnustep/gui/GSContext.h: New backend initialization. * Headers/gnustep/gui/NSApplication.h: Remove backend initialization declaration. * Source/Functions.m (initialize_gnustep_backend): New function. * Source/GSContext.m (+initialize): Set up method table. (+initializeGUIBackend): New method. (+initializeMethodTable): Likewise. * Headers/gnustep/gui/NSScreen.h: New ivars. * Source/NSScreen.m: Use them. * Headers/gnustep/gui/NSStringDrawing.h: New methods. * Source/NSStringDrawing.m: Implement stub. * Source/GNUServicesManager.m (-registerAsServiceProvider): Add exception handler. * Tools/GNUmakefile: Don't make example tool. Thu Dec 10 1998 Felipe A. Rodriguez * NSWindow.h change window style enum to match WindowMaker's definition. * GNUAlertPanel.m NSGetAlertPanel() replace centering code with call to center method, change window style mask, add class initialize. * libgnustep-gui.m rename to Functions.m. * Functions.m add new file as location for generic NS* and GS* functions, move backend NSEventMaskFromType() into it. * NSApplication.m discardEventsMatchingMask:.. rewrite (fix bugs), runModalSession: dump all events not for modal window (fixes modal panel button display bug), arrangeInFront: preliminary implemenation. * NSCell.m: Polish. * NSWindow.m: center method remove display invocation per 4.2 docs. Wed Dec 9 1998 Felipe A. Rodriguez * NSView.m resizeWithOldSuperviewSize: revert to previous code and add bug fixes from new. Fixes bugs in new code when MaxX or Y is specified but not Min. Avoids fractional values and fewer lines of code. Wed Dec 9 7:00:00 1998 Richard Frith-Macdonald * NSView.m: Complete rewrite of auto-resize code - now works! * NSBox.m: Fix to make auto-resize work. * GNUAlertPanel.m: Minor tidying for auto-resize. Tue Dec 8 1998 Felipe A. Rodriguez * NSScroller.m move backend code into frontend, polish code, remove ifdefs. * TrackingRectangle.m/.h rename class to GS* prefix (GSTrackingRect). * NSView.m resizeWithOldSuperviewSize: floor possibly fractional results. displayIfNeededIgnoringOpacity: rewrite to fix obscure bugs in auto display. Minor tweaks in other display methods for same reasons. * NSView.h rename invalidatedRectangle to invalidRect. * NSApplication.m: polish, eliminate a couple of compiler warnings. Tue Dec 8 20:50:00 1998 Richard Frith-Macdonald * Headers/gnustep/gui/NSWindow.h: fixed designated initialiser to use NSScreen type. * Source/NSApplication.m: bugfix for modal sessioin - now works * Source/GNUAlertPanel.m: hard-coded initialiser - seems to work ok. Mon Dec 7 15:55:00 1998 Richard Frith-Macdonald * Model/GMAppKit.m: Fix errors in creating new objects - was messing up subclasses by creating new objects of the superclass instead. Mon Dec 7 12:15:00 1998 Richard Frith-Macdonald * Tools/make_services.m: Serialize cache info in compact format (uniquing dictionary key strings) for better performance. Sun Dec 6 20:35:00 1998 Richard Frith-Macdonald * NSWorkspace.m: Fixed error in application cache path setup. * GNUServicesManager.m: Fixed error in application cache path setup. Sat Dec 5 1998 Felipe A. Rodriguez * NSView.m resizeWithOldSuperviewSize: fully implement. Fri Dec 4 11:10:00 1998 Richard Frith-Macdonald * GNUmakefile: Added GNUAlertPanel.m * GNUAlertPanel.m: Outline of framework for handling alert panels. Thu Dec 3 1998 Felipe A. Rodriguez * NSView.m resizeSubviewsWithOldSize: check whether view has ever been rotated (per 4.2 docs). * NSStringDrawing.m sizeWithAttributes: fix minor bug introduced while optimizing tab calc. * NSCell.m: drawInteriorWithFrame: minor optimization Tue Dec 3 7:00:00 1998 Richard Frith-Macdonald * NSApplication.m: Fixed include for GNUServicesManager.h Implemented all the modal loop methods (untested). * NSApplication.h: Added 'session' ivar for modal loop support. Tue Dec 1 21:00:00 1998 Richard Frith-Macdonald * NSApplication.m: Moved services code out to GNUServiceManager.m * NSPasteboard.m: Moved services code out to GNUServiceManager.m * NSWorkspace.m: Moved services code out to GNUServiceManager.m * GNUServicesManager.m: All services stuff in here - now full implementation of services functions. * GNUServicesManager.h: Header for services manager class. * GNUmakefile: Added services manager stuff * Tools/set_show_service.m: New tool to enable/disable services. * Tools/GNUmakefile: Added set_show_service.m * Tools/dummy.m: More dummy backend functions. * Tools/make_services.m: Update for new directory structure. Tue Dec 1 1998 Felipe A. Rodriguez * NSWindow.m rename windowWithNumber to _windowWithTag per backend * NSEvent.m call to windowWithNumber. Tue Dec 1 09:58:20 1998 Adam Fedor * Source/NSWorkspace.m ([NSWorkspace -findApplications]): Check for data before calling deserializer. Tue Dec 1 10:25:00 1998 Richard Frith-Macdonald * NSApplication.m: Fixed auto-enable of services menu. * NSMenu.m: Rewrote auto-enable code to work as specified in docs. * NSMenuItem.m: Removed bogus implementation of -isEnabled Mon Nov 30 10:43:09 1998 Adam Fedor * Panels/GNUmakefile: Use normal install rules. Mon Nov 30 1998 Felipe A. Rodriguez * NSAttributedString.m and NSAttributedString.h remove. * NSStringDrawing.m and NSStringDrawing.h add NSAttributedString interface and implementation. Implement NSAttributedString's size method and optimize tab width calculation. Sat Nov 28 18:25:00 1998 Richard Frith-Macdonald * Tools/example.m: Add very crude code to open a URL in netscape. * Tools/exampleInfo.plist: Add opnURL service definition. Sat Nov 28 8:00:00 1998 Richard Frith-Macdonald * NSColor.m: Mod for system colors to work nicely with backend * NSColor.h: ditto * NSColorPrivate.h: ditto Fri Nov 27 1998 Felipe A. Rodriguez * GSContext.m/.h second rewrite and polish of API. * NSView.m displayrect add flushWindow at end. Thu Nov 26 1998 Felipe A. Rodriguez * NSApplication.m add updateServicesMenu invocation accidently deleted during merge. Move method from _eventMatchingMask to tail of run method for performance reasons. * Tools/dummy.m add various new dummy functions. * Panels/GNUmakefile make local targets double colon, add local clean to fix make clean failure. Wed Nov 25 1998 Felipe A. Rodriguez * move DPSOperators.h to XDPS. * move GPS headers into a new backend. * define GSContext.h/GSContext.m as abstract super for all drawing destinations (eliminates the need for DPS, GPS, DGS at the root of the AppKit) add appropriate defintion to various classes. * NSMatrix.m add abstract backend code from xraw (eliminate backend). * NSSlider.m add abstract backend code from xraw (eliminate backend). * NSSliderCell.m add abstract backend code from xraw (eliminate backend). * NSSplitView.m add abstract backend code from xraw (eliminate backend). replace private divider highlight method with NSHighlightRect() * NSWindow.m add class method to create backend specific window view. * NSTextField.m add abstract backend code from xraw (eliminate backend). * NSForm.m add abstract backend code from xraw (eliminate backend). * NSFormCell.m add abstract backend code from xraw (eliminate backend). * NSColorWell.m add abstract backend code from xraw (eliminate backend). * NSButton.m add abstract backend code from xraw (eliminate backend). * NSControl.m add abstract backend code from xraw (eliminate backend). * NSBox.m add abstract backend code from xraw (eliminate backend). * NSBrowser.m add abstract backend code from xraw (eliminate backend). * NSBrowserCell.m add abstract backend code from xraw (eliminate backend). * NSWorkspace.m add NSProcessInfo include. Tue Nov 24 15:40:001998 Richard Frith-Macdonald * NSApplication.h: updates for services * NSApplication.m: major updates - new private class etc to support services. * NSWindow.m: Bugfix for services menu enable/disable Mon Nov 23 22:10:001998 Richard Frith-Macdonald * NSWorkspace.m: partial implementation - can launch apps. * NSPasteboard.m: partial support for services. * Tools/make_services.m: new file - moven in from base library * Tools/example.m: new example service provider * Tools/dummy.m: dummy functions for linking without backend. * Tools/gpbs.m: Tidied indentatione etc. * Tools/GNUmakefile: Added new files * Testing/testpb.m: Added rudimentary services test. Sun Nov 22 1998 Richard Frith-Macdonald * NSClipView.m: ([-setDocumentView:]) Ignore attempt to assign a view that is already the document view - could previously result in the current document view being deallocated before it was put back in place - thus crashing the app. 1998-11-22 03:44 Lyndon Tremblay * GMAppKit.m: [-_unconditionallyResetNeedsDisplayInAllViews] was not working, message could not be found, commented out calls to it. Fixed NSBrowser loading. 1998-11-20 16:32 Lyndon Tremblay * GMAppKit.m: Fixed browser loading * NSSavePanel.m: Added NSBrowser delegate * GNUmakefile: added 'Panels' subproject * Panels/SavePanel.gmode: Moved from gstep-make * Panels/GNUmakefile: New file Fri Nov 20 10:59:55 1998 Adam Fedor * Source/NSDPSContext.m: Moved to xdps backend. 1998-11-20 01:50 Lyndon Tremblay * GMAppKit.h: Added NSBrowser * GMAppKit.m: Added NSBrowser archiving methods 1998-11-19 Lyndon Tremblay * GMAppKit.m: Fixed isBezeled and isBordered in NSTextField. Thu Nov 19 1998 Felipe A. Rodriguez * NSWindowView.m, NSScrollView.m and NSClipView.m add view isOpaque method. * NSWindow.m and NSView.m remove non OS display and flushing methods (move them to XDPS) reimplement these per the OS 4.2 docs. * NSText.m setSelectedRange: test that view is in a window first. * NSScroller.m add view isOpaque method. * NSScrollView.m reflectScrolledClipView: tweak auto display of scrollers. * NSApplication.m replace ASSIGN with CONVEY macro. 1998-11-19 16:40 Lyndon Tremblay * Model/IMLoading.m: -loadIMFile automatically searches in GNUSTEP_SYSTEM_ROOT/Library/Model/ for gmodels 1998-11-19 14:13 Lyndon Tremblay * Headers/GMAppKit.h: Added NSPanel and NSSavePanel. * Headers/NSSavePanel.h: Cleaned up instance variables. * Model/GMAppKit.m: Implemented NSPanel and NSSavePanel. * Model/GNUmakefile: Disabled test.app, missing NSDPSContext * Source/NSSavePanel.m: Added controller class for loading of gmodels, loads gmodels. Wed Nov 18 20:55:53 1998 Adam Fedor * Source/NSWindow.m ([-close]): Release only when proper flag is set. Wed Nov 18 1998 Richard Frith-Macdonald * Source/NSPasteboard.m: make filename and file content pasteboard types conform to documentation. Mon Nov 16 15:13:39 1998 Adam Fedor * Preliminary implementation of a device independant drawing engine. * Headers/gnustep/gui/GPSDefinitions.h: New file. * Headers/gnustep/gui/GPSDrawContext.h: Likewise. * Headers/gnustep/gui/GPSDrawContextOps.h: Likewise. * Headers/gnustep/gui/GPSOperators.h: Likewise. * Headers/gnustep/gui/gpsdefs.h: Likewise. * Headers/gnustep/gui/gpsops.h: Likewise. * Source/GPSDrawContext.m: Likewise. * Source/gpsops.m: Likewise. * Headers/gnustep/gui/DPSOperators.h: Revert to old imp. * Headers/gnustep/gui/NS*: Change NSDPSContext to GPSDrawContext. * Source/NS*: Likewise. * Source/externs.m: Add new externs. * Source/NS*: Remove ASSIGN definitions. Thu Nov 12 1998 Felipe A. Rodriguez * GNUmakefile rearrange subprojects so that Source is built first. * NSMenu.h and NSMenu.m add support for right mouse display of menu. * NSApplication.m implement deque of events test in nextEventMatchingMask.. * NSApplication.m implement discardEventsMatchingMask method * NSApplication.m add support for right mouse display of menu. * NSCell.m move non OS method calls to back ends. * NSView.m move non OS XDPS specific method calls to XDPS back ends. * NSWindow.m move various non OS XDPS specific methods to XDPS, move various front end methods out of XRWindow and into NSWindow, fix center method. * NSApplication.m sendEvent: add test for menu to right mouse display of. Mon Nov 9 1998 Richard Frith-Macdonald * Source/NSColor.m: update to Rhapsody DR2 docs - added system colors * Headers/NSColor.h: update to add system colors etc. Thu Nov 5 1998 Felipe A. Rodriguez * Model/GNUmakefile enable build of test app, fix resource files ref. * Model/test.gmodel remove ref to IMCustomView. * Model/GMAppKit.m add test for XRAW backend. * Testing/testpb.m added dummy definition functions needed for compile. Wed Nov 4 1998 Felipe A. Rodriguez * NSApplication.h/NSApplication.m remove unused ivar recycledEventsQueue. * NSApplication.m terminate: fix call to applicationShouldTerminate, should use self not sender. * NSMenuItem.h and NSMenu.m aesthetic tweaks. * NSWindow.m implement performClose and close per OS 4.2 docs. Tue Nov 3 1998 Felipe A. Rodriguez * NSMenuItem.h ADDITIONAL_WIDTH increase defined size (fix overlap in Edit) Mon Nov 2 1998 Felipe A. Rodriguez * NSApplication.m optimize event translation, matching and dispatch. Add a possible temporary regulation hack to control event translation in backend. * NSApplication.h remove unused private methods * NSAttributedString.m polish * NSScrollView.m _doScroll: fix button scrolling direction when view is not flipped. Tue Oct 27 15:20:00 1998 Richard Frith-Macdonald * Source/NSDPSContext.m: Fixed per-thread code to be OpenStep complient and less inefficient. * Source/NSEvent.m: Fixed per-thread code to be OpenStep complient and less inefficient. * Source/NSView.m: Fixed per-thread code to be OpenStep complient and less inefficient. Mon Oct 26 13:20:00 1998 Richard Frith-Macdonald * Tools/gpbs.m: Changed cStringNoCopy to cString. Sat Oct 17 08:30:00 1998 Richard Frith-Macdonald * NSImage.m: removed erroneous attempt to set nil in image dictionary. Thu Oct 15 1998 Felipe A. Rodriguez * NSApplication.m minor optimiztions. * NSAttributedString.m sizeWithAttributes: implement tab support. * NSStringDrawing.m sizeWithAttributes: implement tab support. * NSScroller.m trackScrollButtons: add temporary hack in support of XRAW's heavily optimized scrolling machinery. * NSScroller.m remove sendAction:to: * NSScrolView.m _doScroll: implement scroller update when scrolling via buttons * NSScrolView.m reflectScrolledClipView comment out setNeedsDisplay as it causes display flicker. * NSText.m add changes from Daniel Bðhringer, set initFrame to default values to prevent infinite loop in rebuildLineLayout, minor tweaks * NSView.m minor optimiztions. Fri Sep 18 10:21:38 1998 Adam Fedor * Source/NSClipView.m (MIN, MAX): Remove. * Source/NSMatrix.c: Likewise. Mon Sep 14 1998 Felipe A. Rodriguez * NSEvent.m extensive optimization. Tue Sep 8 1998 Felipe A. Rodriguez * NSMenu.m->NSMenuMatrix in insertItemWithTitle: removed call to _resizeMenuForCellSize for performance reasons. _resizeMenuForCellSize is called later on a sizeToFit. * NSMenu.m->NSMenuMatrix in removeItem: removed call to _resizeMenuForCellSize for performance reasons. _resizeMenuForCellSize is called later on a sizeToFit. * NSMenu.m->NSMenu in insertItemWithTitle: replaced call to _menuChanged with menuHasChanged=YES for performance reasons. * NSMenu.m->NSMenu in removeItem: replaced call to _menuChanged with menuHasChanged=YES for performance reasons. * NSStringDrawing.h: reformat for clarity Tue Sep 8 16:30:00 1998 Richard Frith-Macdonald * Source/NSScroller.m: Minor efficiency hacks (inspired by xraw) plus tidying. Thu Sep 3 15:18:39 1998 Adam Fedor * Source/GNUmakefile.postamble: Don't move config.h * Source/GNUmakefile.preamble: Don't include special config.h dir. (ADDITONAL_CPPFLAGS): Add DPS_DEFINE. Thur Sept 3 1998 Felipe A. Rodriguez * NSMenuItem.m in copyWithZone: fixed bug which crashed menus two or more deep when said menus are opened and detached twice Mon Aug 31 16:31:12 1998 Adam Fedor * Headers/gnustep/gui/DPSOperators.h: Define enough stuff so that when we don't have DPS, gui will still compile. * configure.in, configure: New files. * Header/gnuste/gui/config.h.in: Likewise. * Source/GNUmakefile.postamble: Config config.h to proper target dir. * Source/GNUmakefile.preamble: Add config.h include dirs Weds Sept 2 1998 Felipe A. Rodriguez * NSFileWrapper.m and NSFileWrapper.h added preliminary implementations in support of Daniel Bðhringer's work on the text classes * NSText.m added changes by Daniel Bðhringer * NSText.h removed text_contents ivar * Tools/gpbs.m added dummy defines of some backend functions Tues Sept 1 1998 Felipe A. Rodriguez * GNUmakefile added NSAttributedString.m, NSAttributedString.h, NSParagraphStyle.m, NSTextAttachment.h, NSTextContainer.h, NSTextStorage.h, NSLayoutManager.h and NSParagraphStyle.h. * Source added NSParagraphStyle.m. * Headers/Appkit added NSTextAttachment.h, NSTextContainer.h, NSTextStorage.h, NSLayoutManager.h and NSParagraphStyle.h files. * NSText.m and NSText.h. added numerous changes by Daniel Bðhringer * NSTextView.m and NSTextView.h. added numerous changes by Daniel Bðhringer Sun Aug 30 1998 Felipe A. Rodriguez * NSApplication.h added windows_need_update as autodisplay ivar. * NSApplication.m in init set default for main_menu, windows_need_update. * NSApplication.m in run added support for OPENSTEP autodisplay mechanism. * NSApplication.m _eventMatchingMask: reformat. * NSApplication.m nextEventMatchingMask:untilDate:inMode:dequeue: move calls to _flushWindows to XDPS backend. * NSApplication.m implemented updateWindows. * NSApplication.m implemented setWindowsNeedUpdate:. * NSApplication.m setMainMenu: test for menu prior to release. * NSActionCell.m removed setState: method. * NSActionCell.m copyWithZone: optimized ivar copying. * NSButtonCell.m added _init and moved common defaults to this method. * NSButtonCell.m initImageCell: and initTextCell: minor optimizations. * NSButtonCell.m setAlternateTitle: optimize and use ASSIGN macro. * NSButtonCell.m setKeyEquivalent: remove [copy release]. * NSButtonCell.m setKeyEquivalentFont:size: optimize. * NSButtonCell.m copyWithZone: optimized ivar copying where possible. * NSCell.m _init removed call to [super init]. * NSCell.m initTextCell: removed duplicate default initializers. * NSCell.m setImage: rewrote to use ASSIGN macro. * NSCell.m setDoubleValue: rewrote to use ASSIGN macro. * NSCell.m setFloatValue: rewrote to use ASSIGN macro. * NSCell.m setIntValue: rewrote to use ASSIGN macro. * NSCell.m setStringValue: rewrote to use ASSIGN macro. * NSCell.m setFont: rewrote to use ASSIGN macro. * NSCell.m setRepresentedObject: rewrote to use ASSIGN macro. * NSCell.m copyWithZone: optimized ivar copying where possible. * NSClipView.m viewBoundsChanged: minor optimization. * NSClipView.m viewFrameChanged: minor optimization. * NSClipView.m scaleUnitSquareToSize: minor optimization. * NSClipView.m setBoundsOrigin: minor optimization. * NSClipView.m setBoundsSize: minor optimization. * NSClipView.m setFrameSize: minor optimization. * NSClipView.m setFrameOrigin: minor optimization. * NSClipView.m setFrame: minor optimization. * NSClipView.m translateOriginToPoint: minor optimization. * NSMatrix.m eliminate retain/release of selected cell via ASSIGN. * NSMatrix.m initWithFrame: remove duplicate setting of selected row and column. * NSMatrix.m removeColumn: rewrite so that col is removed before new selection is attempted (needed because selected cell is not retained). * NSMatrix.m removeRow: rewrite so that row is removed before new selection is attempted (needed because selected cell is not retained). * NSMatrix.m deselectAllCells per OS spec try to select a cell at end if empty selection is not allowed. * NSMatrix.m deselectSelectedCell set default selected row/col to 0. * NSMatrix.m mouseDown: optimize for new drawing behaviour. * NSMenu.m setSelectedCell: eliminate use of retain/release of selected cell via ASSIGN. * NSMenuItem.m copyWithZone: optimized ivar copying where possible. * NSMenuItem.m dealloc minor optimization. * NSMenuItem.m setTarget: minor optimization. * NSScroller.m trackScrollButtons: heavily optimized. * NSScroller.m sendAction: reimplemented to use sendAction: per spec also optimized. * NSText.m implemented init method. * NSText.m initWithFrame: fixed initialization of ivars which are released to retain. * NSText.m dealloc add release of retained ivars. * NSView.m dealloc add release of retained ivars. * NSView.m displayRect: and _addSubviewForNeedingDisplay reformatted code and rewrote comments. * NSWindow.m setFrame:display: rewrote for clarity. * NSWindow.m implemented update method per OPENSTEP spec. Thurs Aug 20 1998 Felipe A. Rodriguez * NSTextView.m commented out references to defaultTypingAttributes Thurs Aug 20 1998 Felipe A. Rodriguez * NSSplitView.m in drawRect moved NSRectFill() to backend * NSSavePanel.m commented out call to NSRunAlertPanel * NSText.h and NSText.m integrated source from Daniel Bðhringer. * NSTextView.h and NSTextView.m integrated source from Daniel Bðhringer. Weds Aug 19 1998 Felipe A. Rodriguez * NSView.h added specific values and comments to resize constants enum. * NSView.m implemented resizeWithOldSuperviewSize (needs work). * NSMatrix.m mousedown clarified description comment. * NSSavePanel.m integrated source from Daniel Bðhringer into premliminary implementations provided by Scott Christley. * NSSavePanel.h integrated source from Daniel Bðhringer into premliminary implementations provided by Scott Christley. * NSOpenPanel.m integrated source from Daniel Bðhringer into premliminary implementations provided by Scott Christley. * NSOpenPanel.h integrated source from Daniel Bðhringer into premliminary implementations provided by Scott Christley. * NSStringDrawing.h defined NSAttributedString portion of extension. * NSAttributedString.h created preliminary implementation of extension. * Appkit.h added includes for NSAttributedString and NSStringDrawing. * NSPasteboard.h added extern NSRTFDPboardType define. * externs.m defined NSRTFDPboardType. * NSText.h integrated source from Daniel Bðhringer * NSTextView.m preliminary implementation from Daniel Bðhringer * NSTextView.h preliminary implementation from Daniel Bðhringer * NSSplitView.m in drawRect use NSRectFill() Weds Aug 12 1998 Richard Frith-Macdonald * NSCell.m: Modified ([-copyWithZone:]) to use alloc-init to create new cell so that it works properly for subclasses that need to be initialised. Tues Aug 11 1998 Felipe A. Rodriguez * externs.m further defined the NSStringAdditions globals. Sat Aug 8 1998 Felipe A. Rodriguez * added NSStringDrawing.m and NSStringDrawing.h which implement the frontend portion of the NSString additions Category from 4.1. Tues Aug 4 1998 Felipe A. Rodriguez * NSSplitView in initWithFrame changed default back color to light gray. * NSSavePanel modified to inherit from NSPanel per OS spec. Sun Aug 2 1998 Felipe A. Rodriguez * NSText implemented setFont. * NSText fixed setUsesFontPanel. * NSText reformatted code again in certain places. Sat Aug 1 1998 Felipe A. Rodriguez * NSText in setText modified to use ASSIGN macro. * NSText added draws_background ivar and implemented it's set method. * NSText reformatted code. Weds July 29 1998 Felipe A. Rodriguez * NSMatrix.m in mouseDown adjusted the selection process when in List mode Tue Jul 28 13:02:43 1998 Adam Fedor * Source/NSSplitView.m: Implemention from Robert Vasvari . * Headers/gnustep/gui/NSSplitView.h: Likewise. Tues July 28 1998 Felipe A. Rodriguez * NSScroller.m in trackScrollButtons method added code to highlight cell prior to calling trackMouse. In keeping with new behaviour of NSCell. Sat July 25 1998 Felipe A. Rodriguez * NSCell.m removed highlight/unhighlight behaviour from trackMouse method per OS spec. Behaviour is now as described for this method in NSControl, NSMatrix and NSCell. * NSMatrix.m: rewrote mouseDown to more closely follow the OS spec. There are still some very subtle differences. * NSButton.m: now highlights it's cell before invoking Cell's trackMouse. Mon Jul 20 10:37:22 1998 Adam Fedor * config.h: Use NSDebugLog def from Foundation/NSObjCRuntime.h Tues July 18 1998 Felipe A. Rodriguez * Source/NSBrowser.m fixed bug where column matrix was getting released twice in method _performLoadOfColumn. * NSCell.m: isOpaque returns whether cell is bezeled per NS docs. * NSText.m: implemented setBackground and back color release in dealloc. * NSMenu.m: insertItemWithTitle moved set font position for performance Fri May 29 13:30:14 1998 Adam Fedor * Headers/gnustep/gui/AppKit.h: Include Foundation.h. Wed May 13 15:59:32 1998 Adam Fedor * Model/IBClasses.m: Fix header includes. * Translator.m: Likewise. * test.m: Likewise. Mon Apr 6 16:38:40 1998 Scott Christley * Documentation/status.tmpl.texi: Update. * Add Adobe printer definition files. * PrinterTypes/English.lproj/*.ppd: New files. * PrinterTypes/French.lproj/*.ppd: New files. * PrinterTypes/German.lproj/*.ppd: New files. * PrinterTypes/Italian.lproj/*.ppd: New files. * PrinterTypes/Spanish.lproj/*.ppd: New files. * PrinterTypes/Swedish.lproj/*.ppd: New files. Mon Apr 6 16:38:40 1998 Simon Frankau * Headers/gnustep/gui/NSPrinter.h (+printerNames): Add method. * Source/NSPrinter.m: Major rewrite. Wed Mar 11 10:47:31 1998 Scott Christley * Version: Version 0.5.0 * Documentation/announce.tmpl.texi: Update. * Documentation/news.tmpl.texi: Update. * Documentation/status.tmpl.texi: Update. * ANNOUNCE: Regenerate. * FAQ: Regenerate. * INSTALL: Regenerate. * NEWS: Regenerate. * README: Regenerate. * STATUS: Regenerate. * Source/NSCell.m (-drawWithFrame:inView:): Mark the cell's frame as needing flush. (-highlight:withFrame:inView:): Likewise. Sat Feb 14 16:34:22 1998 Scott Christley * Model/GNUmakefile (HEADER_FILES_DIR): Correct definition. Thu Feb 5 09:44:38 1998 Adam Fedor * GNUmakefile.postamble (header-links): Remove non-package links. Link DPSClient to gnustep/gui. * Souce/GNUmakefile: Include GNUmakefile.local. * Tools/GNUmakefile: Likewise. * Tools/GNUmakefile.preamble (ADDITIONAL_LIB_DIRS): Removed previous change. Wed Feb 4 09:11:49 1998 Adam Fedor * Changes to allow library to be compiled in a GNUstep package without having previous libraries installed. * GNUmakefile (GNUSTEP_MAKEFILES): New variable. Use it to include makefiles. (SUBPROJECTS): Remove Testing. * GNUmakefile.postamble (before-all): Add header-links depend. (header-links): New target to link in various header dirs. * Documentation/GNUmakefile (GNUSTEP_MAKEFILES): New variable. Use it to include makefiles. * Images/GNUmakefile: Likewise. * Model/GNUmakefile: Likewise. * Testing/GNUmakefile: Likewise. * Source/GNUmakefile: Likewise. * Tools/GNUmakefile: Likewise. * Source/GNUmakefile.postamble (header-links): Removed. * Model/GNUmakefile (APP_NAME): Comment out. (ADDITIONAL_INCLUDE_DIRS): New variable. * Tools/GNUmakefile.preamble (ADDITIONAL_LIB_DIRS): Include Model lib dir. Also include extensions and Foundation dirs. (ADDITIONAL_TOOL_LIBS): Include lgmodel, FoundationExt. * Tools/gpbs.m (initialize_gnustep_backend): New function. * Headers/gnustep/gui/IMCustomObject.h: Add Appkit/NSView.h. * Headers/gnuste/NSDPSContext.h: Add stdarg.h * Model/GMAppKit.m: Update includes. * Model/IMConnectors.m: Likewise. * Model/IMCustomObject.m: Likewise. * Model/IMLoading.m: Likewise. Thu Jan 29 12:02:08 Ovidiu Predescu * Model/IBClasses.h: New class NSCustomView. * Model/IBClasses.m: Likewise. * Model/GMAppKit.h: Moved to Headers/AppKit. * Model/IMCustomObject.m: Likewise. * Model/IMLoading.h: Likewise. * Model/GMAppKit.m ([NSApplication -encodeWithModelArchiver:]): Encode the delegate. (NSBox): Support for encoding and decoding it. ([NSCell -initWithModelUnarchiver:]): Check for the font. (NSClipView): Support for encoding and decoding. (NSImage): Return a dummy image in case the requested one doesn't exist. Don't return nil as it breaks the code, maybe we should raise an exception. (NSPopUpButton): Code to support encoding and decoding. Unfortunately it doesn't work properly, it causes a crash when loading. * Model/test.nib: Added a custom view to test loading. * Source/GNUmakefile: Added NSTextView.m. * Source/NSApplication.m ([NSApplication -finishLaunching]): Add support for loading the model file. * Source/NSBrowser.m: Fixed several allocation bugs. * Source/NSClipView.m ([NSClipView -setDocumentView:]): Check for invalid document view. * Source/NSPopUpButton.m: Minimaly fill out the implementation so we don't get a crash at the loading time. * Source/NSTextView.m: Define the class so we don't linking errors while trying to link with OPENSTEP converted applications. Fri Jan 9 14:06:57 1998 Ovidiu Predescu * Model/GNUmakefile: Copy the header files to the AppKit directory first. Fri Jan 9 12:25:41 1998 Ovidiu Predescu * Headers/gnustep/gui/NSImageView.h: New file. * Source/NSImageView.m: New file. * Headers/gnustep/gui/NSApplication.h (NSApplicationWillTerminateNotification): New notification. (NSApplicationMain): New function. (NSOpenStepRootDirectory): Likewise. * Model/GMAppKit.h: New categories for NSCStringText and NSPopUpButton. * Model/GMAppKit.m: Likewise. (-[NSImage createObjectForModelUnarchiver:]): Return a dummy image in case the image requested does not exist. This prevents a crash later. * Model/IBClasses.h: Define the NSWindowTemplate class, which is used internally by the NeXT's IB. I simply remove it from the generated model file since it has no equivalent. * Model/IBClasses.m (NSWindowTemplate): Remove all the instances that appear in the NIB file and encode the window it points to. * Model/IMConnectors.m: When assigning an object to an instance variable directly retain the object automatically so it doesn't get released accidentally. * Model/IMLoading.m: Search for model files in the Resources directory of the app wrapper. Automatically append the gmodel extension if not present. * Source/NSApplication.m (finishLaunching): Load the main model file if any. Define the NSOpenStepRootDirectory to be the value of GNUSTEP_SYSTEM_ROOT. * Model/GNUmakefile: Define the GNUSTEP_INSTALLATION_DIR to be the system root. Define the header files that get installed (in the AppKit directory). * Source/externs.m: Define the NSApplicationWillTerminateNotification notification. * Source/libgnustep-gui.m: Changed the name of the GNUstepMain function to NSApplicationMain. Implement the NSApplicationMain function to do something useful ;-). Mon Jan 5 15:15:34 1998 Ovidiu Predescu * Headers/gnustep/DPSClient/DPSOperators.h: Moved to the AppKit header directory. * Headers/gnustep/DPSClient/NSDPSContext.h: Likewise. * Headers/gnustep/DPSClient/TypesandConstants.h: Removed. * Headers/gnustep/AppKit/NSApplication.h (NSOpenStepRootDirectory): New function. Wed Dec 3 14:12:35 1997 Ovidiu Predescu Added the code to support the loading of model files (similar to nib files under OPENSTEP). The model file is a human readable and modifiable file which is portable across many OpenStep implementations. * Model: New directory. * Model/GMAppKit.h: New file. * Model/GMAppKit.m: Likewise. * Model/GNUmakefile: Likewise. * Model/IBClasses.h: Likewise. * Model/IBClasses.m: Likewise. * Model/IMConnectors.h: Likewise. * Model/IMConnectors.m: Likewise. * Model/IMCustomObject.h: Likewise. * Model/IMCustomObject.m: Likewise. * Model/IMLoading.h: Likewise. * Model/IMLoading.m: Likewise. * Model/Translator.h: Likewise. * Model/Translator.m: Likewise. * Model/nib2gmodel.m: Likewise. * Model/test.nib: Likewise. * Model/test.m: Likewise. * Model/test.gmodel: Likewise. * Model/Controller.h: Likewise. * Model/Controller.m: Likewise. Support the standard OpenStep images in NSImage: * Images/nsmapping.strings: New file. It contains the mapping between the OpenStep name to the GNUstep file name that contains the image. * Images/GNUmakefile: Added nsmapping.strings to the list of files that get installed. * Source/NSImage.m: Support the above modification. * Headers/gnustep/gui/NSView.h (_unconditionallyResetNeedsDisplayInAllViews): Define the method. (setAutoDisplay:): Fixed typo. * Source/NSView.m: New method that unconditionally sets the additional pointers needed for display and flush in NSView. * Source/NSApplication.m (nextEventMatchingMask:untilDate:inMode: dequeue:): Flush the communication channel after the while loop ends. * Source/NSMenu.m: Changed the definition of MAX. (_resizeMenuForCellSize): Resize the menu cells matrix to fit all the cells. (sizeToFit): Call _resizeMenuForCellSize to resize the cells matrix. * Source/NSTextField.m (selectedCell): New method. * Source/NSWindow.m: Include . (dealloc, setContentView:): Clean up the code. (setAutodisplay): Fixed typo. Fri Nov 14 09:34:45 1997 Scott Christley * Headers/gnustep/gui/NSApplication.h (-getNextEvent): Method no longer returns a value. * Headers/gnustep/gui/NSWindowView.h: New file. * Source/NSWindowView.m: New file. * Source/NSView.m (-displayRect:): Remove debug code. * Source/NSWindow.m: Use new class which represents the view the window uses to draw its frame and title. Many changes throughout the file to update the window view instead of the content view. * Source/GNUmakefile: Don't install the config.h file. Compile and install NSWindowView. * Source/NSApplication.m (-nextEventMatchingMask:untilDate:inMode:dequeue:): Rearrange code so that that the flushing of windows is done before runloop's limit date is retrieved. (-getNextEvent): Method no longer returns a value. Sat Nov 1 11:30:40 1997 Ovidiu Predescu * Source/GNUmakefile: Don't compile NSPasteboard.m if using libFoundation. * Source/NSBrowser.m: Include NSTextFieldCell.h to elimate compiler warning. (setCellClass:): Autorelease the newly created cell. (addColumn): Autorelease the column. (doClick:): Use respondsToSelector: instead of respondsTo:. * Source/NSCell.m (initImageCell:): Changed the font size to be 0 so that the font size from the defaults database is taken if it's specified. (initTextCell:): Likewise. * Source/NSTextFieldCell.m (initTextCell:): Likewise. * Headers/gnustep/gui/NSView.h: Add a definition for _removeSubviewFromViewsThatNeedDisplay:. Thu Oct 30 15:51:43 1997 Scott Christley * GNUmakefile: Add Tools directory. * Headers/gnustep/gui/NSBrowser.h: Initial implementation. * Headers/gnustep/gui/NSBrowserCell.h: Initial implementation. * Source/NSBrowser.m: Initial implementation. * Source/NSBrowserCell.m: Initial implementation. * Documentation/news.tmpl.texi: Update. * Documentation/status.tmpl.texi: Update. * Source/NSCell.m (-initImageCell:, -initTextCell:): init super. * Source/NSClipView.m (-init): Set background to gray as we may not have a window yet. * Source/NSMatrix.m: Fix column and row range checks. * Source/NSTextFieldCell.m (-copyWithZone:): Set draws background flag for new cell. * Source/NSView.m: Reset subview needs display variables when view is removed from superview. * Source/GNUmakefile: Add NSPasteboard.m. * Testing/GNUmakefile: Use test.make * Testing/GNUmakefile.postamble: Remove install code. * Testing/GNUmakefile.preamble: Add directory and library. * Tools/GNUmakefile: Make system root the default install dir. * Tools/GNUmakefile.postamble: Install after instead of before. * Tools/GNUmakefile.preamble: Add directory and library. Wed Oct 29 13:02:53 1997 Ovidiu Predescu * Source/NSView.m (_removeSubviewFromViewsThatNeedDisplay:): New method to remove a view from its super view linked list of views that need display. (removeFromSuperview): Invoke the above method to remove itself from the list of views that need display. (replaceSubview:with:): Likewise. Wed Oct 29 12:22:22 1997 Ovidiu Predescu Bug fixes for NSForm and NSFormCell from Benhur Stein . * Headers/gnustep/gui/NSFormCell.h: The text field cell is keeping the value now not the title. Changed drawInteriorWithFrame:inView: to drawWithFrame:inView:. * Source/NSForm.m: Likewise. * Source/NSFormCell.m: Likewise. (drawInteriorWithFrame:inView:): Changed to drawWithFrame:inView:. * Source/NSCell.m (init): Make a text cell by default. (_init): Invoke super's init. * Source/NSView.m (opaqueAncestor): Implemented. (visibleRect): Intersect the super view's visible rectangle with the receiver's bounds instead of the receiver's frame. * GNUmakefile: Fixed typo. * Source/GNUmakefile: Changed the name of the variables to work with the new multi-library building capabilities of library.make. Tue Oct 28 11:24:40 1997 Ovidiu Predescu * Makefile: Changed to GNUmakefile. * Makefile.postamble: Changed to GNUmakefile.postamble. * Documentation/Makefile: Changed to GNUmakefile. * Images/Makefile: Changed to GNUmakefile. * Images/Makefile.postamble: Changed to GNUmakefile.postamble. * Source/Makefile: Changed to GNUmakefile. * Source/Makefile.preamble: Changed to GNUmakefile.preamble. * Source/Makefile.postamble: Changed to GNUmakefile.postamble. * Testing/Makefile: Changed to GNUmakefile. * Testing/Makefile.preamble: Changed to GNUmakefile.preamble. * Testing/Makefile.postamble: Changed to GNUmakefile.postamble. Mon Oct 27 09:33:17 1997 Ovidiu Predescu * Source/NSBox.m (-initWithFrame:): Call super's addSubview: method (bug fix from Benhur Stein ). (setContentView:): Fixed. Tue Oct 21 18:25:14 1997 Ovidiu Predescu * Incorporated some bug fixes from Benhur Stein . * Source/NSApplication.m (setDelegate:): Register the delegate for receiving notifications. (hide:): Post the NSApplicationWillHideNotification and NSApplicationDidHideNotification notifications. (unhideWithoutActivation:): Post NSApplicationWillUnhideNotification and NSApplicationDidUnhideNotification notifications. * Source/NSView.m (visibleRect): Implemented. * Source/NSColorWell.m (initWithFrame:): Assign the color without using ASSIGN. * Source/NSForm (+initialize): New method. (+cellClass): Likewise. (+setCellClass:): Likewise. * Source/NSView.m (addSubview:): Invoke windowWillMoveToWindow:. (replaceSubview:): Likewise. Tue Oct 21 16:21:06 1997 Ovidiu Predescu Fixed display optimization and the scrolling behavior in the presence of optimizations. * Source/NSView.m (_collectInvalidatedRectanglesInArray): Changed the order in which the matrices are multiplyied to be able to correctly convert the rectangles between views. * Source/NSWindow.m (_collectFlushRectangles): Changed the matrices that are passed to _collectInvalidatedRectanglesInArray:originMatrix: sizeMatrix: to be the identity matrix. * Source/PSMatrix.m (sizeInMatrixSpace:): Removed adding TX and TY to the new size. (rectInMatrixSpace:): Likewise. * Source/NSClipView.m (-viewFrameChanged:): Update the bounds origin. * Source/NSScrollView.m (reflectScrolledClipView:): Changed the 'documentRect' name of the variable to 'documentFrame' to better match its usage. * Source/NSScroller.m: Delete unnecessary commented out portions of code. * Documentation/news.tmpl.texi: Updated. Mon Oct 20 14:32:55 1997 Scott Christley * Fill out NSBox implementation. * Headers/gnustep/gui/NSCell.h (+sizeForBorderType:): New method. * Source/NSCell.m (+sizeForBorderType:): New method. * Source/NSBox.m: Fill out implementation. * Source/NSTextField.m (-initWithFrame:,-setTextCursor:,-dealloc): Correct retain/release behavior of cursor. * Source/NSTextFieldCell.m (-cellSize): Implement. * Source/NSView.m (-removeTrackingRect:): Comment out release of object as we haven't retained it. Thu Oct 16 12:28:00 1997 Scott Christley * config.mak.in: Delete. * Headers/gnustep/gui/NSScrollView.h: Correct datatype. * Headers/gnustep/gui/NSWindow.h: Declare NSMutableArray. * Source/NSMenu.m (-drawRect:): Handle rounding errors. * Source/NSScrollView.m: Correct datatype. Mon Oct 13 16:17:45 1997 Ovidiu Predescu * Source/NSMatrix.m: Removed commented out portions of code. * Headers/gnustep/gui/NSApplication.h: Added a definition for initialize_gnustep_backend. * Documentation/Makefile: Remove dependency on Makefile.in. * Documentation/news.tmpl.texi: Updated. * Documentation/status.tmpl.texi: Updated. Mon Oct 13 12:08:51 1997 Ovidiu Predescu * Headers/gnustep/gui/config.h: Added to repository. * Makefile.postamble: Don't delete config.h file since it's no longer automatically generated. Wed Oct 8 15:38:22 1997 Ovidiu Predescu * Heavy display and window flushing optimizations have been implemented. * Source/NSView.m (-setDisplayInRect:): Now is implemented to work optimized. (-displayRect:): Likewise. (-setNeedsDisplay:): Likewise. (-setNeedsDisplayInRect:): Likewise. (-_addSubviewForNeedingDisplay:): New method. (-_recursivelyResetNeedsDisplayInAllViews): Likewise. (-_displayNeededViews): Likewise. (-_collectFlushRectangles): Likewise. (-_setNeedsDisplay): Likewise. (-_setNeedsFlush): Likewise. (-_needsFlush): Likewise. (+_flushWindows): Likewise. * Headers/gnustep/gui/NSWindow.h: Important optimization for window flushing has been implemented. * Source/NSWindow.m: Likewise. * Headers/gnustep/gui/PSMatrix.h (boundingRectFor:): New method. (isRotated): New method. (rectInMatrixSpace:): New method. * Source/NSApplication.m (-nextEventMatchingMask:untilDate:inMode: dequeue:): Call the NSWindow class to flush the windows, then flush the communication channels. (-_flushCommunicationChannels): New method. * Source/NSWindow.m (-disableFlushWindow): New method. * Source/PSMatrix.m (-boundingRectFor:result:): New method. (-rectInMatrixSpace:): Likewise. * NSSlider has been implemented. * Headers/gnustep/gui/NSSlider.h: New implementation. * Source/NSSlider.m: Likewise. * Headers/gnustep/gui/NSSliderCell.h: Likewise. * Source/NSSliderCell.m: Likewise. * Source/NSButton.m: Use -setNeedsDisplay: instead of display. * Source/NSCell.m: Likewise. * Source/NSControl.m: Likewise. * Source/NSScroller.m: Likewise. * Source/NSMatrix.m: Likewise. Removed all lock focuses because display occurs at a later time. It is still possible to improve the performance, but at least selection in the list mode works quite quick under Solaris, not counting in radio mode which is (very) fast. * Source/NSMenu.m (-drawRect:): Fixed code that determines what cells need display. Several cleanups. * Source/NSActionCell.m: Remove commented out sequences of code. * Source/NSApplication.m: Likewise. * Source/NSPopUpButton.m: Likewise. * Source/NSView.m: Likewise. * Source/NSApplication.m: Fixed memory allocation problems by retaining instance variables. * Source/NSButtonCell.m: Likewise. * Source/NSCachedImageRep.m: Likewise. * Source/NSCell.m: Likewise. * Source/NSColorList.m: Likewise. * Source/NSColorWell.m: Likewise. * Source/NSCursor.m: Likewise. * Source/NSEvent.m: Likewise. * Source/NSDPSContext.m: Likewise. * Source/NSPopUpButton.m: Likewise. * Source/NSWindow.m: Likewise. (-dealloc): New method: release all instance variables. * Source/NSColor.m (-dealloc): Likewise. * Source/NSView.m (-dealloc): Release other two additional ivars. * Source/NSApplication.m (-dealloc): Cleanup the windows array deallocation. Other memory allocation problems have been fixed. (-hide): Don't use an enumerator, iterate instead over the array. (-unhide): Likewise. (-miniaturizeAll): Likewise. (-updateWindows): Likewise. (-postEvent:atStart:): Fixed condition. * Source/NSColorList.m (-colorListNamed:): Don't use an enumerator. * Source/NSCell.m: Changed the size of the default font back to 12. * Source/NSText.m: Likewise. * Source/NSTextFieldCell.m: Likewise. * Source/NSClipView.m (-scrollToPoint:): Fixed the code that moves the bounds to a new point. * Source/NSScrollView.m (-_doScroll:): Fixed the code that computes the moving direction and step. Fixed the way the scroller position is updated when a scroll button is pressed. * Headers/gnustep/gui/NSApplication.h: Removed the backend category because of the problems it presents with calling super in its methods. * Source/NSApplication.m: Likewise. (-handleNullEvent): New method. * Headers/gnustep/gui/NSCell.h (-setControlView:): New method. * Source/NSCell.m (-setControlView:): New method. * Source/NSCell.m: Likewise. * Headers/gnustep/gui/NSPrintInfo.h: Replaced with Simon Frankau's implementation. * Source/NSPrintInfo.m: Likewise. * Headers/gnustep/gui/NSScrollView.h (_knobMoved): New instance variable. * Source/Makefile: Temporary exclude NSPasteboard from compiling. * Source/Makefile.preamble: Add -Wall to the compile flags. Define the libraries the GUI library depends upon. * Source/NSApplication.m: Conditionally include NSConnection.h. Include NSTimer.h. Define ASSIGN. (+sharedApplication): Use two consecutive calls to initialize the NSApp global variable. (-nextEventMatchingMask:untilDate:inMode:dequeue:): Change the order in which the expiration date is computed to avoid unnecessary operations. * Source/NSView.m: Mark the view as being rotated and/or scaled when setting bounds or frame. (-sortSubviewsUsingFunction:context:): Implemented. * Source/externs.m: Define NSPrintHorizontalPagination. Wed Oct 8 10:33:52 1997 Ovidiu Predescu * Headers/gnustep/gui/config.h.in: Changed to config.h. * Headers/gnustep/gui/config.sed.nt: Removed. * Images/common_SliderHoriz.tiff: New file. * Images/common_SliderVert.tiff: New file. * Images/Makefile: Added the above two files. * aclocal.m4: Removed. * configure: Removed. * configure.in: Removed. * configure.bat: Removed. * config.guess: Removed. * config.mak.in: Removed. * config.sub: Removed. * COPYING: Removed. * install-sh: Removed. * mkinstalldirs: Removed. * Documentation/Makefile.in: Removed. Tue Sep 23 14:28:14 1997 Scott Christley * Convert to the GNUstep makefile package. * Makefile: New file. * Makefile.postamble: New file. * config.mak.in: New file. * Makefile.in: Delete. * Makefile.sed.net: Delete. * configure.in (AC_OUTPUT): Do not create makefiles. Eliminate checks for TIFF and DPS. * configure: Regnerate for configure.in changes. * Source/Makefile: New file. * Source/Makefile.preamble: New file. * Source/Makefile.postamble: New file. * Source/Makefile.in: Delete. * Source/Makefile.sed.nt: Delete. * Testing/Makefile.sed.nt: Delete. * gnustep/gui/config.h.in: Remove TIFF and DPS macros. * Images/Makefile: New file. * Images/Makefile/postamble: New file. * Images/Makefile.in: Delete. * The config.h files should not be installed with the other header files; it is only used for compilation, so the source files should include it not the header files. * gnustep/dps/DPSOperators.h: Do not include config.h. * gnustep/dps/TypesandConstants.h: Likewise. * gnustep/gui/NSCell.h: Likewise. * gnustep/gui/NSColor.h: Likewise. * gnustep/gui/NSColorList.h: Likewise. * gnustep/gui/NSColorPicker.h: Likewise. * gnustep/gui/NSCursor.h: Likewise. * gnustep/gui/NSDataLink.h: Likewise. * gnustep/gui/NSDataLinkManager.h: Likewise. * gnustep/gui/NSEvent.h: Likewise. * gnustep/gui/NSFont.h: Likewise. * gnustep/gui/NSFontManager.h: Likewise. * gnustep/gui/NSImage.h: Likewise. * gnustep/gui/NSImageRep.h: Likewise. * gnustep/gui/NSPasteboard.h: Likewise. * gnustep/gui/NSPrintInfo.h: Likewise. * gnustep/gui/NSPrintOperation.h: Likewise. * gnustep/gui/NSResponder.h: Likewise. * gnustep/gui/NSScreen.h: Likewise. * gnustep/gui/NSSelection.h: Likewise. * gnustep/gui/NSSpellChecker.h: Likewise. * gnustep/gui/NSSpellServer.h: Likewise. * gnustep/gui/NSWorkspace.h: Likewise. * gnustep/gui/NSPasteboardServer.h: Likewise. * gnustep/gui/nimage-tiff.h: Likewise. * Source/NSActionCell.m: Include config.h. * Source/NSApplication.m: Likewise. * Source/NSBitmapImageRep.m: Likewise. * Source/NSBox.m: Likewise. * Source/NSBrowser.m: Likewise. * Source/NSBrowserCell.m: Likewise. * Source/NSBundleAdditions.m: Likewise. * Source/NSButton.m: Likewise. * Source/NSButtonCell.m: Likewise. * Source/NSCStringText.m: Likewise. * Source/NSCachedImageRep.m: Likewise. * Source/NSCell.m: Likewise. * Source/NSClipView.m: Likewise. * Source/NSColor.m: Likewise. * Source/NSColorList.m: Likewise. * Source/NSColorPanel.m: Likewise. * Source/NSColorPicker.m: Likewise. * Source/NSColorWell.m: Likewise. * Source/NSControl.m: Likewise. * Source/NSCursor.m: Likewise. * Source/NSCustomImageRep.m: Likewise. * Source/NSNSDPSContext.m: Likewise. * Source/NSDataLink.m: Likewise. * Source/NSDataLinkManager.m: Likewise. * Source/NSDataLinkPanel.m: Likewise. * Source/NSEPSImageRep.m: Likewise. * Source/NSEvent.m: Likewise. * Source/NSFont.m: Likewise. * Source/NSFontManager.m: Likewise. * Source/NSFontPanel.m: Likewise. * Source/NSForm.m: Likewise. * Source/NSFormCell.m: Likewise. * Source/NSHelpPanel.m: Likewise. * Source/NSImage.m: Likewise. * Source/NSImageRep.m: Likewise. * Source/NSMatrix.m: Likewise. * Source/NSMenu.m: Likewise. * Source/NSMenuItem.m: Likewise. * Source/NSOpenPanel.m: Likewise. * Source/NSPageLayout.m: Likewise. * Source/NSPanel.m: Likewise. * Source/NSPasteboard.m: Likewise. * Source/NSPopUpButton.m: Likewise. * Source/NSPrintInfo.m: Likewise. * Source/NSPrintOperation.m: Likewise. * Source/NSPrintPanel.m: Likewise. * Source/NSPrinter.m: Likewise. * Source/NSResponder.m: Likewise. * Source/NSSavePanel.m: Likewise. * Source/NSScreen.m: Likewise. * Source/NSScrollView.m: Likewise. * Source/NSScroller.m: Likewise. * Source/NSSelection.m: Likewise. * Source/NSSlider.m: Likewise. * Source/NSSpellChecker.m: Likewise. * Source/NSSpellServer.m: Likewise. * Source/NSSplitView.m: Likewise. * Source/NSText.m: Likewise. * Source/NSTextField.m: Likewise. * Source/NSTextFieldCell.m: Likewise. * Source/NSView.m: Likewise. * Source/NSWindow.m: Likewise. * Source/NSWorkspace.m: Likewise. * Source/PSMatrix.m: Likewise. * Source/TrackingRectangle.m: Likewise. * Source/externs.m: Likewise. * Source/gpbs.m: Likewise. * Source/tiff.m: Likewise. * Source/NSPasteboard.m: Move global strings to externs.m * Source/gpbs.m: Add copyright and license information. Wed Aug 27 14:04:38 1997 Ovidiu Predescu * Headers/gnustep/gui/config.h.in (OBJC_MALLOC, OBJC_FREE): New defines to make the GUI library compile with NeXT PDO. * Source/NSApplication.m: Include Foundation/NSConnection.h for symbols needed by NSRunLoop. * Source/NSApplication.m: Changed perform:... with performSelector:.. . * Source/NSCustomImageRep.m: Likewise. * gui/Source/NSImage.m: Likewise. * Source/NSMatrix.m: Likewise. * Source/NSMenu.m: Likewise. * Source/NSResponder.m: Likewise. * Source/NSScroller.m: Likewise. * Source/NSBitmapImageRep.m: Include config.h to get the OBJC_MALLOC and OBJC_FREE definitions. * Source/PSMatrix.m: Include Foundation/NSString.h. * Source/NSMenu.m: Likewise. * Source/NSMatrix.m: Likewise. * gui/Source/NSImage.m: Likewise. Fri Aug 22 11:40:45 1997 Ovidiu Predescu Fixed scrolling to work with the new scalation/rotation code. * Source/PSMatrix.m (-scaleTo:): New method. * Source/NSCell.m (-trackMouse:...): Check if done before asking if needs to continue tracking. * Source/NSClipView.m (-scrollToPoint:): Set the bounds origin to the oposite point. * Source/NSScrollView.m (-_doScroll:): Take into consideration the bounds origin which is in the third quadrant. * Source/NSView.m (-setBounds:): Use scaleTo: rather than scaleBy:. (-setBoundsSize:): Likewise. (-hitTest:): Fixed to work with views that have the bounds origin other that (0, 0). Mon Aug 18 09:38:27 1997 Ovidiu Predescu Start the port to NeXT's PDO under Solaris. * Headers/gnustep/gui/NSCStringText.h: Include Foundation/NSString.h. * Headers/gnustep/gui/NSScreen.h: Declare NSArray. * Headers/gnustep/gui/NSText.h: Include Foundation/NSRange.h. * Source/NSBox.m: Include Foundation/NSString.h. * Source/NSButtonCell.m: Likewise. * Source/NSCachedImageRep.m: Likewise. * Source/NSCell.m: Likewise. * Source/NSColor.m: Likewise. * Source/NSFont.m: Likewise. * Source/NSImage.m: Likewise. * Source/NSMenuItem.m: Likewise. * Source/NSOpenPanel.m: Likewise. * Source/NSSavePanel.m: Likewise. * Source/NSSliderCell.m: Likewise. * Source/NSText.m: Likewise. * Source/NSTextField.m: Likewise. * Source/libgnustep-gui.m: Likewise. * Source/NSDPSContext.m: Likewise. Also declare -copyWithZone: for NSThread to make possible adding it to Foundation containers. Added scaling and rotation support. * Headers/gnustep/gui/NSView.h: Remove frame_rotation. Add frameMatrix and boundsMatrix instance variables. * Source/PSMatrix.m: New file. * Headers/gnustep/gui/PSMatrix.h: New file. * Source/Makefile.in: Added PSMatrix.m. * Source/NSView.m: Use two PSMatrix to do all the scaling and rotation stuff instead of dealing with angles and scale factors. Change the implementation of methods that convert points and sizes to use these matrices. * Source/NSWindow.m (-checkCursorRectangles:forEvent:): Changed to work with scaled and rotated views. * Headers/gnustep/gui/config.h.in: Declare initialize_gnustep_backend. * Source/NSMenu.m (-copyWithZone:): Create a proper copy of NSMenuMatrix. Sat Aug 16 16:28:31 1997 Scott Christley * Headers/gnustep/gui/NSApplication.h (+setNullEvent:): New method. (+getNullEvent): New method. (NSApp): Eliminate global variable. * Headers/gnustep/gui/NSWindow.h (-performDeminiaturize:): New method. (-performHide:): New method. (-performUnhide:): New method. * Source/Makefile.in: Rename variables. * Source/NSApplication.m (+setNullEvent:): New method. (+getNullEvent): New method. (-peekEventMatchingMask:untilDate:inMode:dequeue:): Modify to be more like the nextEvent.. method. (-hide:): Call performHide: method. (-unhide:): Call performUnhide: method. * Source/NSButton.m (mouseDown:): Add method calls to capture and release the mouse. Set the action mask. * Source/NSCell.m (-setDoubleValue:): Don't set the cell type. (-setFloatValue:, -setIntValue:, -setStringValue:): Likewise. * Source/NSEvent.m: Don't access application object through the global variable, use method instead. * Source/NSFont.m (getFont, setFont): Rename to getNSFont and setNSFont and make non-static so that they can be called from the backend implementation. * Source/NSMatrix.m (-initWithFrame:mode:prototype:numberOfRows: numberOfColumns:): Call super's initWithFrame: (mouseDown:): Capture and release the mouse when tracking. Don't access application object through the global variable, use method instead. * Source/NSMenu.m: Don't access application object through the global variable, use method instead. * Source/NSScroller.m: Likewise. * Source/NSTextFieldCell.m (-dealloc, -copyWithZone:): New method. Fix retain/release on colors. * Source/NSWindow.m (-deminiaturize:): Call performDeminiaturize. (-makeFirstResponder:): Check that first responder exists before telling it to resign. (-performDeminiaturize:): New method. (-performHide:): New method. (-performUnhide:): New method. * Source/externs.m: Add global variables. * Source/libgnustep-gui.def: Add functions. * Source/libgnustep-gui.m: Eliminate unneeded code. Wed Aug 6 13:27:53 1997 Ovidiu Predescu * Source/NSApplication (-nextEventMatchingMask:untilDate:inMode: dequeue:): Restored the old behavior of getting time events from the queue because otherwise the scroll view class works slowly; I have to find some other way to put such events on the events queue. * Source/NSButton.m (mouseDown:): Don't send the action to the target since it is already done in trackMouse:inRect:ofView:untilMouseUp:. * Source/NSCell.m (getPeriodicDelay:interval:): Set the delay to 0.05. * Source/NSDPSContext.m (+initialize): Create a retained dictionary for GNU_CONTEXT_THREAD_DICT instead of an autoreleased one. * Source/NSClipView.m: Turned NSLog into NSDebugLog. * Source/NSScrollView.m: Likewise. * Source/NSScroller.m (drawParts): Set the scroller buttons delay and repeat interval. Tue Aug 5 14:39:29 1997 Ovidiu Predescu Implementation of scroll views. * Source/NSClipView.m: The initial implementation. * Source/NSScrollView.m: Likewise. * NSScroller completely reworked. * Source/NSScroller.m: Optimized to work with time events to gain speed in user interaction. * Images/common_ArrowLeftH.tiff: New file. * Images/common_ArrowRightH.tiff: Likewise. * Images/common_ArrowUpH.tiff: Likewise. * Images/common_ArrowDownH.tiff: Likewise. * Source/NSApplication.m (-nextEventMatchingMask:untilDate:inMode: dequeue:): Do not pop-up the time events from the queue immediately after -limitDateForMode: to avoid loosing the normal events. * Source/NSCell.m: Handle sending action continuously while the user tracks the mouse. * Source/NSButtonCell.m: Likewise. * Source/NSButton.m: Likewise. * Source/NSView.m: Post notifications if needed when a frame or bound change. * Source/externs.m: Changed the name of NSView notification to conform to the new ones in OS 4.x. Mon Aug 04 13:16:54 1997 Scott Christley * Source/externs.m: New file. * Source/libgnustep-gui.def: New file. * Source/win32-def.top: New file. * Source/win32-entry.c: New file. * config.sub: New file. * config.guess: Update. * aclocal.m4: Rearrange checking of foundation library so that it works properly on Windows. * configure.in (DLLTOOL): Add support for building a DLL. (enable-shared): New option to enable build of shared library. (disable-static): New option to disable build of static library. * configure: Regenerate. * Headers/gnustep/gui/NSApplication.h (USE_RUN_LOOP): Delete macro. * Headers/gnustep/gui/NSGraphics.h (NSGray): New global. * Headers/gnustep/gui/NSMenuItem.h (be_mi_reserved): New instance variable. * Source/Makefile.in: Add support for building a DLL. * Source/NSApplication.m: Move global variables to externs.m. * Source/NSColor.m: Likewise. * Source/NSColorList.m: Likewise. * Source/NSColorPanel.m: Likewise. * Source/NSControl.m: Likewise. * Source/NSDataLink.m: Likewise. * Source/NSFont.m: Likewise. * Source/NSImageRep.m: Likewise. * Source/NSPasteboard.m: Likewise. * Source/NSPrinter.m: Likewise. * Source/NSScreen.m: Likewise. * Source/NSSplitView.m: Likewise. * Source/NSText.m: Likewise. * Source/NSView.m: Likewise. * Source/NSWindow.m: Likewise. * Source/NSWorkspace.m: Likewise. * Source/libgnustep-gui.m: Likewise. Thu Jun 12 19:05:24 1997 Ovidiu Predescu Finished the second attempt in implementing menus. * Headers/gnustep/gui/NSMenuCell.h: Removed. * Headers/gnustep/gui/NSMenuPrivate.h: Removed. * Headers/gnustep/gui/NSMenuItem.h: New file. * Headers/gnustep/gui/NSMenu.h: Completely reworked. * Headers/gnustep/gui/AppKit.h: Include NSMenuItem.h. * Source/NSMenu.m: Completely reworked. * Source/NSMenuCell.m: Removed. * Source/NSMenuItem.m: New file. Fixed objects retain/release policy. * Source/NSView.m: Likewise. * Source/NSWindow.m: Likewise. * Source/NSImage.m: Likewise. * Source/NSWindow.m: Changed the way in which the windows are identified by number. The NSWindow class should keep track of them instead of NSApplication. * Source/NSApplication.m (-run): Create a local autorelease pool. (-_eventMatchingMask:): New method. (-nextEventMatchingMask:untilDate:inMode:dequeue:): Changed the way in which the events are get off the queue to better handle time events. (-setMainMenu:): Properly handle the assignment of aMenu to main_menu. * Source/NSEvent.m (-windowNumber): Send -windowWithNumber: to NSWindow class instead of using the shared application instance. * Source/NSView.m (-dealloc): Simply release the arrays instead of doing other strange things. (-removeCursorRect:cursor:, -viewWithTag:) Several cleanups. * Source/NSWindow.m (flushWindowIfNeeded): Flush the window if it needs flush. (+windowWithNumber:): New method; its implementation should be in the backend library. Mon Apr 21 18:57:30 1997 Ovidiu Predescu * Implement NSCopying protocol to cell classes. * Headers/gnustep/gui/NSCell.h: Declare class to conform to NSCopying. * Headers/gnustep/gui/NSActionCell.h: Likewise. * Headers/gnustep/gui/NSButtonCell.h: Likewise. * Source/NSCell.m: Implement copyWithZone:. * Source/NSActionCell.m: Likewise. * Source/NSButtonCell.m: Likewise. * Use NSRunLoop to get the events. * Headers/gnustep/gui/NSApplication.h: Define USE_RUN_LOOP macro if you want NSRunLoop class to be used instead of the default busy wait. Note that some classes will not work with the "default" loop. This macro should be removed eventually. (-setupRunLoopInputSourcesForMode:): New method to be implemented in backend. In this method the backend should register to run loop the input sources it uses. * Source/NSApplication.m (-init): Call backend method -setupRunLoopInputSourcesForMode: to setup the input source is several modes used by NSApp. (-run): Get the events from NSDefaultRunLoopMode mode instead of nil. (-nextEventMatchingMask:untilDate:inMode:dequeue:): Check for a matching event into the events queue in the order in which the events occured. Temporary retain the event found before removing it from the events queue to avoid an unneeded deallocation. Inside the loop fire the timers then wait for inputs on the input sources of run loop. * Source/NSButton.m: Call the nextEventMatchingMask:... using the NSEventTrackingRunLoopMode mode instead of nil. * Source/NSCell.m: (-trackMouse:inRect:ofView:untilMouseUp:): Likewise. (-trackScrollButtons:): Likewise. * Source/NSScroller.m (-trackKnob:): Likewise. * Source/NSWindow.m (-nextEventMatchingMask:): Likewise. * NSMatrix class completely reworked to be compliant with the OpenStep specification. * Source/NSMatrix.m: The second implementation. * Headers/gnustep/gui/NSMatrix.h: Likewise. * Implementation of NSForm, not tested. * Source/NSForm.m: Initial implementation. * Headers/gnustep/gui/NSForm.h: Likewise. * Source/NSFormCell.m: Initial implementation. * Headers/gnustep/gui/NSFormCell.h: Likewise. * Added support in configure and makefiles for libFoundation. * configure.in: Configure checks now for the underlaying Foundation library and the Objective-C runtime for whom the library was compiled for. The code is copied with copy/paste from libFoundation sources. * aclocal.m4: Likewise. * Source/Makefile.in: New OBJC_RUNTIME_FLAG that gets replaced by configure. Remove OBJC_LIB since the runtime library is added to LIBS by configure. * Source/NSButton.m: Comment out captureMouse: method call to make possible debugging. Anyway it seems we don't need to capture the mouse. * Source/NSButtonCell.m: Remove the -prefersTrackingUntilMouseUp method. * Source/NSCell.m: Changed the way in which a cell gets initialized. Moved all the common things into the -_init method. * Added support for periodic events. * Source/NSEvent.m: (+startPeriodicEventsAfterDelay:withPeriod:, +stopPeriodicEvents): New public methods. (+_timerFired:, +_registerRealTimer:): New private methods. Fri Apr 04 14:03:40 1997 Scott Christley * Source/NSSlider.m (MB_NSSLIDER_CLASS): Rename to follow GNU coding standards. * Source/NSTextField.m (MB_NSTEXTFIELDCELL_CLASS): Likewise. Sat Mar 29 11:58:31 1997 GNUstep Development * Source/NSApplication.m (NullEvent): Rename global variable to be unique and conform to GNUstep standards. (nextEventMatchingMatchingMask:untilDate:inMode:dequeue:): Don't unhide the cursor for null events. (peekEventMatchingMatchingMask:untilDate:inMode:dequeue:): Likewise. Fri Mar 28 14:15:52 1997 GNUstep Development * Release version 0.2.0 * Version: Update with new version number. * Update documentation. * Documentation/announce.tmpl.texi: Likewise. * Documentation/faq.tmpl.texi: Likewise. * Documentation/gnustep-gui.tmpl.texi: Likewise. * Documentation/install.tmpl.texi: Likewise. * Documentation/news.tmpl.texi: Likewise. * Documentation/readme.tmpl.texi: Likewise. * Documentation/status.tmpl.texi: Likewise. * Documentation/todo.tmpl.texi: Likewise. * ANNOUNCE: Likewise. * FAQ: Likewise. * INSTALL: Likewise. * NEWS: Likewise. * README: Likewise. * STATUS: Likewise. * SUPPORT: Likewise. * TODO: Likewise. * Documentation/Makefile.in (update-top): New target. Thu Mar 27 09:43:02 1997 GNUstep Development * Source/NSTextFieldCell.m: Change default point size to 16. * Source/NSCell.m: Likewise. * Source/libgnustep-gui.m: Likewise. * Source/NSText.m: Likewise. * Headers/gnustep/gui/NSApplication.h (-peekNextEvent): New method. (-peekEventMatchingMask:untilDate:inMode:dequeue:): New method. * Source/NSApplication.m (-peekNextEvent): New method. (-peekEventMatchingMask:untilDate:inMode:dequeue:): New method. * Source/NSControl.m (-setAlignment:): Display if needed. * Source/NSScroller.m (-trackKnob:): Set the value of the cell manually to prevent automatic redisplay of scroller. Thu Mar 20 10:40:51 1997 GNUstep Development * Source/NSControl.m: Call displayIfNeeded after setting the contents of the cell. (-copyWithZone:): Copy the object instead of allocating so that instance variable values are copied. Retain the cell because it will be released when we set a new one. (-drawCell:, -drawCellInside:): Lock and unlock the focus when drawing the cell. * Source/NSImage.m (_base_name, extension): Delete functions; functionality is now provided by NSString. (+imageNamed:) Use NSString methods instead of local functions for obtaining base name and extension. Check if extension is one of the image types before deleting. (-useFromFile:): Use NSString methods instead of local functions for obtaining the extension. * Source/NSScroller.m (-setFloatValue:knobProportion:): Set knob proportion first before setting float value. (-setFloatValue:): Indicate needs display. (-drawRect:): Remove method. (-drawParts): Flush window. (-trackKnob:): Correct position of knob relative to pointer. Lock and unlock the focus; make sure it is unlocked before sending action. (-trackScrollButtons:): Fill out implementation. (-mouseDown:): Lock and unlock focus in the tracking methods instead. * Source/NSTextField.m (-setTextCursor:, -copyWithZone:): New methods. * Source/NSTextFieldCell.m (-initTextCell:): By default it draws the background. * Source/NSView.m (-ancestoreSharedWithView:): Implement. (-lockFocus, -unlockFocus): Make sure our superview locks or unlocks the focus before us. (-display): Unlock focus before drawing subviews. (+popFocusView): Returned poped view. * Source/NSButton.m (-mouseDown:): Remove unneeded code; rearrange so that the focus is unlocked before sending the action. Fri Mar 14 18:23:18 1997 Ovidiu Predescu * Flush the view's window after a redraw. * Source/NSButton.m (-mouseDown:): Likewise. * Source/NSCell.m (-trackMouse:inRect:ofView:untilMouseUp:): Likewise. * Source/NSView.m (-display): Likewise. * Source/NSControl.m (-updateCell:): Don't redraw imediately the cell, just mark it as needs display. * Source/NSControl.m (-updateCellInside:): Likewise. * Source/NSFont.m (getFont): Renamed the variables to better match the code. * Source/NSImage.m (+imageNamed:): After creating an image don't set it into the nameDict dictionary; this operation was already made in -setName:. * Source/NSResponder.m (-noResponderFor:): Commented out the NSBeep() call to make possible to build the GUI library as a shared library under OpenStep 4.x. The code should be in the backend libraries. * Source/NSScroller.m (-initWithFrame:): Fixed the code that sets up our cell to use an autoreleased cell. * Source/NSView.m (-initWithFrame:): Make a view opaque by default. * Source/NSView.m (-displayIfNeeded): After display mark the view as clean. * Source/NSView.m (-displayIfNeededIgnoringOpacity): Likewise. Wed Mar 5 17:43:34 1997 GNUstep Development * Headers/gnustep/gui/nsimage-tiff.h: Include gnustep-gui config. * Source/tiff.m: Include header file. Tue Mar 4 18:05:24 1997 Ovidiu Predescu * Source/NSFont.m (-minimumAdvancement): New method. * Source/NSButton.m (-initWithFrame:): Use an autoreleased cell. * Source/NSButtonCell.m (+prefersTrackingUntilMouseUp): New method. * Source/NSCell.m: Retain the objects we set in instance variables. * Source/NSControl.m (-initWithFrame:): Use an autoreleased cell. * Source/NSEvent.m (-description): New method. * Source/NSSlider.m (-initWithFrame:): Use an autoreleased cell. * Source/NSTextField.m (-initWithFrame:): Likewise. * Source/NSTextFieldCell.m (-drawWithFrame:inView:): Call super's implementation. Tue Mar 4 17:28:58 1997 GNUstep Development * Make sure gnustep-gui config.h file is included. * Headers/gnustep/gui/AppKit.h: Likewise. * Headers/gnustep/gui/NSCell.h: Likewise. * Headers/gnustep/gui/NSColor.h: Likewise. * Headers/gnustep/gui/NSColorList.h: Likewise. * Headers/gnustep/gui/NSColorPicker.h: Likewise. * Headers/gnustep/gui/NSCursor.h: Likewise. * Headers/gnustep/gui/NSDataLink.h: Likewise. * Headers/gnustep/gui/NSDataLinkManager.h: Likewise. * Headers/gnustep/gui/NSEvent.h: Likewise. * Headers/gnustep/gui/NSFont.h: Likewise. * Headers/gnustep/gui/NSFontManager.h: Likewise. * Headers/gnustep/gui/NSImage.h: Likewise. * Headers/gnustep/gui/NSImageRep.h: Likewise. * Headers/gnustep/gui/NSPasteboard.h: Likewise. * Headers/gnustep/gui/NSPrintInfo.h: Likewise. * Headers/gnustep/gui/NSPrintOperation.h: Likewise. * Headers/gnustep/gui/NSPrinter.h: Likewise. * Headers/gnustep/gui/NSResponder.h: Likewise. * Headers/gnustep/gui/NSScreen.h: Likewise. * Headers/gnustep/gui/NSSelection.h: Likewise. * Headers/gnustep/gui/NSSpellChecker.h: Likewise. * Headers/gnustep/gui/NSSpellServer.h: Likewise. * Headers/gnustep/gui/NSWorkspace.h: Likewise. * Source/Makefile.in: Remove non-existent header files. * Source/tiff.m: Remove unneeded header file. * Source/NSDPSContext.m: Remove unneeded header file. * Headers/gnustep/gui/config.h.in: Define NSDebugLog if not defined. Tue Mar 4 17:04:16 1997 GNUstep Development * Reinstate NSCursor and NSColorWell changes that got lost. * configure.in: Utilize config.h file instead of compiler defines. * configure: Regenerate for configure.in changes. * Headers/gnustep/dps/DPSOperators.h: Correct name. * Headers/gnsutep/gui/Headers/TypesandConstants.h: Correct name. * Headers/gnustep/gui/config.h.in: Correct names. * Headers/gnustep/gui/nsimage-tiff.h: Correct name. * Source/NSCell.m: Redraw cell when needed during tracking. * Initial NSScroller implementation. * Headers/gnustep/gui/NSScroller.h: Likewise. * Source/NSScroller.m: Likewise. Tue Mar 4 09:28:57 1997 GNUstep Development * Headers/gnustep/gui/NSEvent.h: Include needed header file. * Headers/gnustep/gui/NSNibLoading.h: Likewise. * Headers/gnustep/gui/NSPasteboard.h: Likewise. * Headers/gnustep/gui/NSSpellServer.h: Likewise. * Remove internal NSLog() implementation. * Source/Functions.m: Remove file. * Headers/gnustep/gui/LogFile.h: Remove file. * Headers/gnustep/gui/NSWindow.h: Remove include file. * Source/LogFile.m: Remove file. * Source/NSActionCell.m: Remove include file. * Source/NSApplication.m: Likewise. * Source/NSButton.m: Likewise. * Source/NSCell.m: Likewise. * Source/NSControl.m: Likewise. * Source/NSEvent.m: Likewise. * Source/NSFontManager.m: Likewise. * Source/NSResponder.m: Likewise. * Source/tiff.m: Likewise. * Source/Makefile.in: Remove LogFile and Functions. * Source/NSFont.m (getFont): Return font not font name. * Images/Makefile.in: Install common_Dimple.tiff. * Source/NSBundle.m (+imageNamed:): Create a bundle with gnustep library install path for searching system resources. Mon Feb 17 19:30:50 1997 Ovidiu Predescu * 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?). Sat Feb 15 23:12:35 1997 Ovidiu Predescu * 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. Wed Feb 12 14:14:47 1997 GNUstep Development * 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. Thu Feb 6 19:31:54 1997 GNUstep Development * 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: 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 * Move and install resources to a more appropriate place. * gnustep/gui/resource: Remove directory and files. * Images: New directory. * Images/GNUstep_Images_Copyright: New file. * Images/Makefile.in: New file. * Makefile.in: Clean up code. * configure.in: Update ftp messages; add Images directory. * configure: Regenerate based upon configure.in changes. * Headers/gnustep/gui/NSCell.h (support): Remove instance variable. (cell_image, cell_font): New instance variables. * Source/Makefile.in (GNUSTEP_RESOURCE, install-resource): Remove. (GNUSTEP_INSTALL_LIBDIR): Add definition. Correct some minor errors. * Source/NSButtonCell.m: Modify for NSCell instance variables changes. * Source/NSCell.m: Likewise. * Source/NSTextFieldCell.m: Likewise. * Headers/gnustep/gui/NSBitmapImageRep.h (back_end_reserved): New instance variable for backend use. * Source/NSImage.m (NSImage_PATH): Default path for where NSImage tries to find system image resources. (-_displayEraseRect:view:color:): Eliminate method. (-_doImageCache): Remove drawing code and place in proper methods. Thu Jan 30 12:34:30 1997 Scott Christley * Headers/gnustep/gui/NSDragging.h (NSDraggingInfo): Define protocol before it is used by the NSObject category. * Headers/gnustep/dps/DPSOperators.h: Eliminate unneeded code. * Source/NSControl.m (-copyWithZone:): New method. * Source/NSFontManager.m (-fontWithFamily:traits:weight:size:): Add log error message when requesting invalid font. Thu Jan 29 13:07:11 1997 Adam Fedor * Headers/gnustep/gui/AppKit.h: Add NSBundle definitions. * Source/NSBitmapImageRep.m ([NSBitmapImageRep -bitmapData]): planes instance variable always contains image data. ([NSBitmapImageRep -getBitmapDataPlanes]): Check for data in imagePlanes before allocating data. * Source/NSEPSImageRep.m ([NSEPSImageRep +imageRepWithData:]): Just return nil instead of not implementing. ([NSEPSImageRep +imageRepsWithData:]): New method. Wed Jan 29 07:44:32 1997 Simon Frankau * Headers/gnustep/gui/NSCStringText.h: New file. * Headers/gnustep/gui/NSDragging.h: New file. * Headers/gnustep/gui/NSColorPicking.h: New file. * Headers/gnustep/gui/NSNibLoading.h: New file. * Headers/gnustep/gui/NSSpellProtocol.h: New file. * Headers/gnustep/gui/AppKit.h: Include new files. * Headers/gnustep/gui/Application.h: Add NSServicesRequests category. * Headers/gnustep/gui/NSColor.h (-decodeNXColor:): New method. * Headers/gnustep/gui/NSColorPicker.h (-alphaControlAddedOrRemoved:): New method. * Headers/gnustep/gui/NSMenu.h (-validateCell:): New method. * Source/Makefile.in: Add new files. * Source/NSBundle.m: New file. * Source/NSCStringText.m: New file. * SourceNSColor.m (-decodeNXColor:): New method. * Source/NSColorPicker.m (-alphaControlAddedOrRemoved:): New method. * Source/NSText.m (-changeSpelling:, -ignoreSpelling:): New methods. Thu Jan 23 15:10:13 1997 Scott Christley * Makefile.in (install): Don't force make of source. * Source/Makefile.in: Use configure variables for libdir, includedir, bindir, and links. * Source/NSCell.m (-stringValue, -setStringValue:): Make copies. * Source/NSColorList.m (NSColorListNotEditableException): Already 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. * Source/NSColorWell.m: Initial implementation. Thu Dec 05 09:56:25 1996 Scott Christley * Headers/gnustep/gui/NSMenu.h: Newer release of OpenStep specification indicates NSMenu subclasses from NSObject. * Headers/gnustep/gui/NSFontManager.h (-enumerateFontsAndFamilies): New method that backend must implement. (-enumerateFamilies): Delete old method. * Source/NSColor.m: Reverse usage of global variables for common colors as it causes havoc with archiving. * Source/NSFont.m: Encode additional instance variables. * Source/NSFontManager.m: Rename global variables. (-enumerateFamilies): Replaced by -enumerateFontsAndFamilies. * Source/NSMenu.m: Encode additional instance variables. * Source/NSWindow.m: Likewise. Fri Oct 18 12:56:14 1996 GNUstep Development * SUPPORT: New file. * Makefile.in: Corrected FSF address and moved comment about NET-Community support into SUPPORT file. * aclocal.m4: Likewise. * configure.in: Likewise. * config.guess: Likewise. * Headers/gnustep/dps/*.h: Likewise. * Headers/gnustep/gui/*.h: Likewise. * Headers/gnustep/gui/config.h.in: Likewise. * Source/*.m: Likewise. * Source/Makefile.in: Likewise. * Testing/Makefile.in: Likewise. * configure: Regenerate with autoconf for configure.in changes. * Testing/nsarchiver.dat: Remove file. * Testing/nsarchiver.m: Remove file. * Source/NSImageRep.m: Additional NSImage work. * Source/NSImage.m: Likewise. * Source/tiff.m: Likewise. Thu Oct 17 18:11:39 1996 GNUstep Development * Headers/gnustep/resource/gui/README: New file. * Headers/gnustep/resource/gui/common_ArrowDown.tiff: New file. * Headers/gnustep/resource/gui/common_ArrowLeft.tiff: New file. * Headers/gnustep/resource/gui/common_ArrowRight.tiff: New file. * Headers/gnustep/resource/gui/common_ArrowUp.tiff: New file. * Headers/gnustep/resource/gui/common_Dimple.tiff: New file. * Headers/gnustep/resource/gui/common_RadioOff.tiff: New file. * Headers/gnustep/resource/gui/common_RadioOn.tiff: New file. * Headers/gnustep/resource/gui/common_SwitchOff.tiff: New file. * Headers/gnustep/resource/gui/common_SwitchOn.tiff: New file. * Headers/gnustep/resource/gui/common_ret.tiff: New file. * Source/Makefile: Add targets for installing and uninstalling resource directory and files. Mon Oct 07 16:09:57 1996 Scott Christley * Headers/gnustep/gui/config.sed.nt: Set appropriate definitions. * Source/NSBitmapImageRep.m: Correct definition. * Source/tiff.m: Renamed from tiff.c. Thu Oct 3 19:36:07 1996 GNUstep Development * Version (GNUSTEP_GUI_SUBMINOR_VERSION): Release version 0.1.1. * Documentation/install.tmpl.texi: Update for new version. * Documentation/news.tmpl.texi: Update for new version. * Documentation/status.tmpl.texi: Update for new version. * ANNOUNCE: Regenerate from documentation files. * FAQ: Likewise. * INSTALL: Likewise. * NEWS: Likewise. * README: Likewise. * STATUS: Likewise. * Documentation/*.texi.orig: Rename files to *.tmpl.texi. * Documentation/Makefile.in: Changes for renamed files. Wed Oct 2 10:40:23 1996 GNUstep Development * Headers/gnustep/gui/NSWindow.h: Add additional instance variables to fill out implementation. (-initDefaults): New method. * Source/NSApplication.m: Assign values to the global exception and notification strings. Post notifications to the default notification center. Fixed bug where the first event was being removed from the queue versus removing the event actually being processed. * Source/NSMatrix.m: Fill out implementation, reimplement many methods, and fix lots of bugs. * Source/NSMenu.m: Don't create NSView as content view, just make the menu matrix the content view. * Source/NSWindow.m: Assign values to the notification strings. Implement many unimplemented methods. Post notifications to the default notification center. Sat Sep 21 12:25:23 1996 GNUstep Development * Source/NSButtonCell.m (-initTextCell:): Make default font be the user font instead of the user fixed pitch font. * Source/NSColor.m: Use global variables for common colors. * Source/NSView.m (+popFocusView): Remove dictionary object. * Source/NSWindow.m: Make default background color light gray. Thu Sep 12 13:49:53 1996 GNUstep Development * Headers/gnustep/gui/NSFontPrivate.h: New file. * Headers/gnustep/gui/NSFont.h: Add typeface and weight variables. * Source/NSFont.m: Fill out implementation. * Source/NSFontManager.m: Likewise. * Headers/gnustep/gui/NSMenuPrivate.h: New file. * Headers/gnustep/gui/NSMenu.h: Add instance variables to fill out implementation. * Source/NSMenu.m: Fill out implementation. * Version (GNUSTEP_GUI_LIBTIFF): Required tiff library version. (GNUSTEP_GUI_DPSCLIENT): Required DPSclient library version. * configure: Run autoconf for configure.in changes. * configure.in: Add check for tiff library. Add check for DPSclient library. * Headers/gnustep/dps/DPSOperators.h: include in header file from DPSclient library. * Headers/gnustep/dps/NSDPSContext.h: Include DPS operators. * Headers/gnustep/dps/TypesandConstants.h: Don't define some typedefs if we have the DPSclient library. * Headers/gnustep/gui/Functions.h (NSRectFill): Correct definition. * Headers/gnustep/gui/config.h.in (HAVE_TIFF): Add definition for tiff library. (HAVE_DPSCLIENT): Add definition for DPSclient library. * Headers/gnustep/gui/nsimage-tiff.h (HAVE_TIFF): Correct definition. * Source/Makefile.in: Remove definition. * Source/NSDPSContext.m: Specify default language and name encoding. * Source/tiff.c: Delete include of non-existent header file. * Source/Functions.m: Remove all function declarations that belong in the backend implementation. * Source/NSBox.m (-drawRect:): Remove use of DPS functions that should be in backend. * Source/NSView.m (-drawRect:): Likewise. * Headers/gnustep/gui/NSApplication.h: Correct method definitions that should be using NSNotification. * Headers/gnustep/gui/NSWindow.h: Likewise. * Source/NSApplication.m: Likewise. * Source/NSWindow.m: Likewise. * Headers/gnustep/gui/NSClipView.h: Include NSNotification. * Headers/gnustep/gui/NSControl.h: Likewise. * Headers/gnustep/gui/NSMatrix.h: Likewise. * Headers/gnustep/gui/NSSplitView.h: Likewise. * Headers/gnustep/gui/NSTextField.h: Likewise. * Headers/gnustep/gui/NSWorkspace.h: Likewise. * Headers/gnustep/gui/NSColorPrivate.h: New file. * Headers/gnustep/gui/NSColor.h: Implement HSB colors. * Source/NSColor.m: Implement HSB, CMYK, and grayscale methods. Tue Sep 3 15:24:41 1996 Adam Fedor * NSBitmapImageRep.h: "Hide" instance variable names. * NSImageRep.h: Likewise. * NSBitmapImageRep.m: Change all pertinent methods to use these new names. * NSImageRep.m: Likewise. * NSBitmapImageRep.m (-initWithBitmapDataPlanes:...): Alloc planes array and copy pointers into it. (-dealloc]): Don't free image planes. -bitmapData): retain image data. Alloc planes array if not already there. Fix typo. * NSImage.m (extension): Get one copy of cString. * NSImageRep.m (extension): Likewise. * NSImage.m (-initWithSize:): Fix typo. (iterate_reps_for_types): Use correct indices. * NSImageRep.m (+initialize): Perform only if we are NSImageRep class. (-imageRepsWithContentsOfFile:): Comment out non-working code. Tue Sep 3 13:47:52 1996 GNUstep Development Create initial documentation set. * Documentation/Makefile.in: New file. * Documentation/announce.texi.orig: New file. * Documentation/faq.texi.orig: New file. * Documentation/gnustep-gui.texi.orig: New file. * Documentation/install.texi.orig: New file. * Documentation/news.texi.orig: New file. * Documentation/readme.texi.orig: New file. * Documentation/status.texi.orig: New file. * Documentation/todo.texi.orig: New file. * ANNOUNCE: Now based upon Documentation/announce.texi.orig file. * INSTALL: Now based upon Documentation/install.texi.orig file. * NEWS: Now based upon Documentation/news.texi.orig file. * README: Now based upon Documentation/readme.texi.orig file. * FAQ: New file * STATUS: New file * TODO: New file * configure.in (CONFIG_FILES): Add Documentation/Makefile. * configure: Run autoconf for changes to configure.in. * Version: Correct variable names. Mon Aug 12 14:16:12 1996 GNUstep Development * Headers/gnustep/gui/NSBitmapImageRep.h: Initial implementation based upon Adam's Feodor work. * Headers/gnustep/gui/NSCachedImageRep.h: Likewise. * Headers/gnustep/gui/NSCustomImageRep.h: Likewise. * Headers/gnustep/gui/NSEPSImageRep.h: Likewise. * Headers/gnustep/gui/NSImage.h: Likewise. * Headers/gnustep/gui/NSImageRep.h: Likewise. * Source/NSBitmapImageRep.m: Likewise. * Source/NSCachedImageRep.m: Likewise. * Source/NSCustomImageRep.m: Likewise. * Source/NSEPSImageRep.m: Likewise. * Source/NSImage.m: Likewise. * Source/NSImageRep.m: Likewise. * Headers/gnustep/gui/NSApplication.h (-reportException:): Uncomment method now that NSExceptions are implemented. * Source/NSApplication.m (-reportException:): Likewise. * Headers/gnustep/gui/NSText.h: Include NSNotification header file now that class is implemented. * Headers/gnustep/gui/config.h.in: Don't define NSNotification and NSNotificationCenter to void as classes are now implemented. * Headers/gnustep/gui/NSWindow.h: Uncomment methods now that NSScreen class has been implemented. * Source/NSWindow.m: Likewise. * Source/Makefile.in: Changes to use TIFF library. * Source/tiff.c: New file. * Headers/gnustep/gui/nsimage-tiff.h: New file. Wed Jul 10 17:11:53 1996 Scott Christley * Source/NSView.m: Use NSDebugLog instead of NSLog. * Source/NSWindow.m: Likewise. * Source/NSResponder.m: Likewise. * Source/NSMatrix.m: Likewise. * Source/NSFontPanel.m: Likewise. * Source/NSFontManager.m: Likewise. * Source/NSFont.m: Likewise. * Source/NSEvent.m: Likewise. * Source/NSControl.m: Likewise. * Source/NSButtonCell.m: Likewise. * Source/NSApplication.m: Likewise. * Source/NSActionCell.m: Likewise. * Source/Makefile.sed.nt: Disable debugging by default. Wed Jun 26 12:43:17 1996 GNUstep Development * Source/NSButton.m (mouseDown:): Correct cell state changes for the different cell types. * Source/NSActionCell.m (setState:): Update the cell. * Source/NSControl.m (drawCell:, drawCellInside:): Pass the control's bounds not its frame. * Source/NSTextFieldCell.m (initTextCell:): Make the default background color be white. * Source/NSWindow.m: Corrections to key and main window notification and first responder handling. Fri Jun 21 11:09:50 1996 GNUstep Development * Headers/gnustep/gui/NSScreen.h: Add instance variables for a screen's device dictionary and for the backend. * Source/NSButton.m (highlight:): Implement method. (mouseDown:): Add mouse dragged events to tracking event mask. * Source/NSCell.m (trackMouse:inRect:ofView:untilMouseUp:): Likewise. * Source/NSMatrix.m (createInitialMatrix): Wrong initial capacity. * Source/NSScreen.m: Initial implementation. * Source/NSView.m (convertRectToWindow:): New method. (convertPointToWindow:): New method. (convertPoint:fromView:, convertPoint:toView:): Implement method. Wed Jun 19 14:25:46 1996 Scott Christley * Source/NSView.m (resizeSubviewsWithOldSize:): Implement method. (setFrame:): Notify subviews that size has changed. (initWithFrame:): Automatically resize subviews. * Source/Makefile.sed.nt: Have the library automatically contain COFF debugging information. * Source/NSButton.m (mouseDown:): Ignore the mouse if the button is not enabled. * Source/NSFont.m (MB_USER_FIXED_FONT, MB_USER_FONT): Rename global variables to correspond with coding standards. Thu Jun 6 09:20:51 1996 GNUstep Development * Headers/gnustep/gui/NSApplication.h (-context): New method. * Source/Makefile.sed.nt (install): Delete AppKit and DPSClient headers directories before installing headers. * Source/NSApplication.m (gnustep_gui_app_is_in_dealloc): New global variable to flag when the application is being dealloced so it can prevent -release loops. (+initialize, -dealloc, -removeWindowsItem:): Likewise. (-context): New method. * Source/NSView.m (+pushFocusView, +focusView): Remove debugging information. Mon Jun 3 10:54:28 1996 GNUstep Development * Makefile.in (clean-top, distclean): Correct targets and clean all header subdirectories. * Makefile.sed.nt: Modify for Makefile.in changes. * Source/Makefile.in (clean): Remove additional temporary files. * Source/NSDPSContext.m: Add some log messages. * Source/NSView.m (+pushFocusView, +popFocusView): New methods. * Source/NSView.m: Initial implementation of view focusing. Thu May 30 18:37:51 1996 Scott Christley * configure.bat: Modifications for new directory structure. * Source/Makefile.in (uninstall): New target. * Source/Makefile.sed.nt: Modifications for Source/Makefile.in changes and new directory structure. Tue Feb 13 09:52:02 1996 Scott Christley * Headers/AppKit/NSText.h: Removed WIN32 instance variables Sun Feb 11 14:17:15 1996 Scott Christley * Makefile.in: Changed library name from libAppKit to libgnustep * Renamed file libAppKit.m to libgnustep.m * Changed terminology "Application Kit Library" to "Application Library" to eliminate trademark conflicts with NeXT. Thu Feb 8 04:53:45 1996 Scott Christley * *.m: Conforms to NSCoding protocol * *.h: Added NSCoding protocol methods gnustep-gui-0.24.0/Tests/0000775000076500007650000000000012256227332015050 5ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/0000775000076500007650000000000012256227332015634 5ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/NSCell/0000775000076500007650000000000012256227332016754 5ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/NSCell/TestInfo0000664000076500007650000000000011531251711020411 0ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/NSCell/objectValue.m0000664000076500007650000000173110373346332021377 0ustar brains99brains99#include "Testing.h" #include #include #include #include #include int main() { CREATE_AUTORELEASE_POOL(arp); NSCell *cell; NSNumber *num; [NSApplication sharedApplication]; cell = [[NSCell alloc] init]; num = [NSNumber numberWithFloat:55.0]; [cell setObjectValue:num]; pass([[cell objectValue] isEqual:num], "-objectValue with NSNumber works"); pass([cell floatValue] == 55.0, "-floatValue works"); pass([cell intValue] == 55, "-intValue works"); pass([cell doubleValue] == 55.0, "-doubleValue works"); [cell setObjectValue:@"foo"]; pass ([[cell objectValue] isEqual:@"foo"], "-objectValue with NSString works"); [cell setObjectValue:[NSImage imageNamed:@"GNUstep"]]; pass ([[cell objectValue] isEqual:[NSImage imageNamed:@"GNUstep"]], "-objectValue with NSImage works"); DESTROY(arp); return 0; } gnustep-gui-0.24.0/Tests/gui/NSCell/basic.m0000664000076500007650000000272712121715043020213 0ustar brains99brains99#import "ObjectTesting.h" #import #import #import #import #import int main() { NSAutoreleasePool *arp = [NSAutoreleasePool new]; id testObject; id testObject1; id testObject2; NSArray *testObjects; [NSApplication sharedApplication]; test_alloc(@"NSCell"); testObject = [NSCell new]; testObject1 = [[NSCell alloc] initImageCell: [NSImage imageNamed: @"GNUstep"]]; testObject2 = [[NSCell alloc] initTextCell: @"GNUstep"]; testObjects = [NSArray arrayWithObjects: testObject, testObject1, testObject2, nil]; test_NSObject(@"NSCell", testObjects); test_NSCoding(testObjects); test_keyed_NSCoding(testObjects); test_NSCopying(@"NSCell", @"NSCell", testObjects, NO, NO); [arp release]; return 0; } @implementation NSCell (Testing) - (BOOL) isEqual: (id)anObject { if (self == anObject) return YES; if (![anObject isKindOfClass: [NSCell class]]) return NO; if (![[anObject stringValue] isEqual: [self stringValue]]) return NO; if (![[anObject title] isEqual: [self title]]) return NO; if (!([anObject image] == [self image]) && ![[anObject image] isEqual: [self image]]) { NSLog(@"image differ %@ %@", [self image], [anObject image]); return NO; } if ([anObject type] != [self type]) return NO; if ([anObject tag] != [self tag]) return NO; return YES; } @end gnustep-gui-0.24.0/Tests/gui/NSSavePanel/0000775000076500007650000000000012256227332017753 5ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/NSSavePanel/setDelegate_reload.m0000664000076500007650000000426112116414422023701 0ustar brains99brains99/* copyright 2005 Alexander Malmberg Test that the file lists in NSSavePanel are reloaded properly when the delegate changes. */ #include "Testing.h" #include @implementation NSSavePanel (TestDelegate) - (NSMatrix *)lastColumnMatrix { return [_browser matrixInColumn: [_browser lastColumn]]; } @end @interface Delegate : NSObject @end @implementation Delegate static BOOL pressed; static NSSavePanel *sp; + (BOOL) panel: (NSSavePanel *)p shouldShowFilename: (NSString *)fname { if ([[fname lastPathComponent] isEqual: @"B"]) { return NO; } return YES; } @end int main(int argc, char **argv) { NSAutoreleasePool *arp = [NSAutoreleasePool new]; NSSavePanel *p; NSMatrix *m; [NSApplication sharedApplication]; p = [NSSavePanel savePanel]; [p setShowsHiddenFiles: NO]; [p setDirectory: [[[[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent] stringByDeletingLastPathComponent] stringByAppendingPathComponent: @"dummy"]]; m = [p lastColumnMatrix]; pass([m numberOfRows] == 2 && [[[m cellAtRow: 0 column: 0] stringValue] isEqual: @"A"] && [[[m cellAtRow: 1 column: 0] stringValue] isEqual: @"B"], "browser initially contains all files"); [p setDelegate: [Delegate self]]; m = [p lastColumnMatrix]; pass([m numberOfRows] == 1 && [[[m cellAtRow: 0 column: 0] stringValue] isEqual: @"A"], "browser is reloaded after -setDelegate:"); /* Not really a -setDelegate: issue, but the other methods involved are documented as doing the wrong thing. */ [p setDelegate: nil]; m = [p lastColumnMatrix]; testHopeful = YES; pass([m numberOfRows] == 2 && [[[m cellAtRow: 0 column: 0] stringValue] isEqual: @"A"] && [[[m cellAtRow: 1 column: 0] stringValue] isEqual: @"B"], "browser contains all files after resetting delegate"); testHopeful = NO; [p setDelegate: [Delegate self]]; m = [p lastColumnMatrix]; pass([m numberOfRows] == 1 && [[[m cellAtRow: 0 column: 0] stringValue] isEqual: @"A"], "browser is reloaded after -setDelegate: (2)"); [arp release]; return 0; } gnustep-gui-0.24.0/Tests/gui/NSSavePanel/TestInfo0000664000076500007650000000000011531251711021410 0ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/NSSavePanel/dummy/0000775000076500007650000000000012256227332021106 5ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/NSSavePanel/dummy/B0000664000076500007650000000000410373346332021204 0ustar brains99brains99foo gnustep-gui-0.24.0/Tests/gui/NSSavePanel/dummy/A0000664000076500007650000000000410373346332021203 0ustar brains99brains99foo gnustep-gui-0.24.0/Tests/gui/TestInfo0000664000076500007650000000000011531251711017271 0ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/NSPrintInfo/0000775000076500007650000000000012256227332020005 5ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/NSPrintInfo/TestInfo0000664000076500007650000000000011531251711021442 0ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/NSPrintInfo/sharedPrintInfo.m0000664000076500007650000000047710373346332023272 0ustar brains99brains99/* copyright 2004 Alexander Malmberg */ #include #include int main(int argc, char **argv) { CREATE_AUTORELEASE_POOL(arp); /* Should run without causing any exceptions. */ [NSPrintInfo sharedPrintInfo]; DESTROY(arp); return 0; } gnustep-gui-0.24.0/Tests/gui/TextSystem/0000775000076500007650000000000012256227332017765 5ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/TextSystem/TestInfo0000664000076500007650000000000011531251711021422 0ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/TextSystem/repeatedAttachmentCellHeight.m0000664000076500007650000000324710671226136025704 0ustar brains99brains99/* copyright 2004 Alexander Malmberg Check that the layour process doesn't get stuck if we try to make a cell fill the entire height of a line frag. */ #include #include #include #include #include #include #include @interface MyCell : NSTextAttachmentCell @end @implementation MyCell -(NSRect) cellFrameForTextContainer: (NSTextContainer *)textContainer proposedLineFragment: (NSRect)lineFrag glyphPosition: (NSPoint)p characterIndex: (unsigned int)charIndex { static int count; /* This should only be called once. */ if (count) exit(1); count++; return NSMakeRect(0,-p.y,50,lineFrag.size.height); } @end int main(int argc, char **argv) { unichar chars[4]={'a','b','c',NSAttachmentCharacter}; CREATE_AUTORELEASE_POOL(arp); NSTextStorage *text; NSLayoutManager *lm; NSTextContainer *tc; NSTextAttachment *ta; [NSApplication sharedApplication]; text=[[NSTextStorage alloc] init]; lm=[[NSLayoutManager alloc] init]; tc=[[NSTextContainer alloc] initWithContainerSize: NSMakeSize(500,5000)]; [lm addTextContainer: tc]; [text addLayoutManager: lm]; ta=[[NSTextAttachment alloc] init]; [ta setAttachmentCell: [[MyCell alloc] init]]; [text beginEditing]; [text appendAttributedString: [[NSAttributedString alloc] initWithString: [NSString stringWithCharacters: chars length: 4]]]; [text addAttribute: NSAttachmentAttributeName value: ta range: NSMakeRange(3,1)]; [text endEditing]; [lm usedRectForTextContainer: tc]; DESTROY(arp); return 0; } gnustep-gui-0.24.0/Tests/gui/TextSystem/deallocation.m0000664000076500007650000000451611763373575022624 0ustar brains99brains99/* (C) Copyright 2012 Wolfgang Lux Check that no dangling pointers are left when elements of a text network are deallocated. FIXME In its present form, this test is unlikely to yield correct results with a garbage collected runtime. */ #import "Testing.h" #import #import #import #import #import #import int main(int argc, char **argv) { NSLayoutManager *lm; NSTextStorage *ts; NSTextContainer *tc; NSTextView *tv; CREATE_AUTORELEASE_POOL(arp); // Create shared application object (required by NSTextView) [NSApplication sharedApplication]; // Set up text network retaining all elements ts = [NSTextStorage new]; lm = [NSLayoutManager new]; [ts addLayoutManager: lm]; tc = [[NSTextContainer alloc] initWithContainerSize: NSMakeSize(100, 100)]; [lm addTextContainer: tc]; tv = [[NSTextView alloc] initWithFrame: NSMakeRect(0, 0, 100, 100) textContainer: tc]; // Check text view returns the expected elements pass([tv textContainer] == tc, "NSTextView -textContainer returns text container"); pass([tv layoutManager] == lm, "NSTextView -layoutManager returns layout manager"); pass([tv textStorage] == ts, "NSTextView -textStorage returns text storage"); // Release text storage [ts release]; RECREATE_AUTORELEASE_POOL(arp); pass([tv textContainer] == tc, "NSTextView -textContainer returns text container"); pass([tv layoutManager] == lm, "NSTextView -layoutManager returns layout manager"); pass([tv textStorage] == nil, "NSTextView -textStorage returns nil"); // Release layout manager [lm release]; RECREATE_AUTORELEASE_POOL(arp); pass([tv textContainer] == tc, "NSTextView -textContainer returns text container"); pass([tv layoutManager] == nil, "NSTextView -layoutManager returns nil"); pass([tv textStorage] == nil, "NSTextView -textStorage returns nil"); // Release text container [tc release]; RECREATE_AUTORELEASE_POOL(arp); pass([tv textContainer] == nil, "NSTextView -textContainer returns nil"); pass([tv layoutManager] == nil, "NSTextView -layoutManager returns nil"); pass([tv textStorage] == nil, "NSTextView -textStorage returns nil"); DESTROY(arp); return 0; } gnustep-gui-0.24.0/Tests/gui/NSView/0000775000076500007650000000000012256227332017007 5ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/NSView/NSView_bounds_scale.m0000664000076500007650000001521111734640366023067 0ustar brains99brains99/* copyright 2011 HNS Modified by Fred Kiefer on 18.07.11. */ #include "Testing.h" #include #include #include #include #include int CHECK(NSView *view, NSRect frame, NSRect bounds) { NSRect r; r = [view frame]; if (fabs(r.origin.x - frame.origin.x)>0.001 || fabs(r.origin.y - frame.origin.y)>0.001 || fabs(r.size.width - frame.size.width)>0.001 || fabs(r.size.height - frame.size.height)>0.001) { printf("(1) expected frame (%g %g)+(%g %g), got (%g %g)+(%g %g)\n", frame.origin.x, frame.origin.y, frame.size.width, frame.size.height, r.origin.x, r.origin.y, r.size.width, r.size.height); return 0; } r = [view bounds]; if (fabs(r.origin.x - bounds.origin.x)>0.001 || fabs(r.origin.y - bounds.origin.y)>0.001 || fabs(r.size.width - bounds.size.width)>0.001 || fabs(r.size.height - bounds.size.height)>0.001) { printf("(2) expected bounds (%g %g)+(%g %g), got (%g %g)+(%g %g)\n", bounds.origin.x, bounds.origin.y, bounds.size.width, bounds.size.height, r.origin.x, r.origin.y, r.size.width, r.size.height); return 0; } return 1; } int CHECK_BOUNDS_ROTATION(NSView *view, CGFloat rot) { if (fabs([view boundsRotation] - rot) > 0.001) { printf("expected bounds rotation %g got %g\n", rot, [view boundsRotation]); return 0; } return 1; } int CHECK_MATRIX(NSView *view, CGFloat *ts) { NSView *superView = [view superview]; CGFloat tsm[6]; NSPoint res; res = [view convertPoint: NSMakePoint(0, 0) toView: superView]; tsm[4] = res.x; tsm[5] = res.y; res = [view convertPoint: NSMakePoint(1, 0) toView: superView]; tsm[0] = res.x - tsm[4]; tsm[1] = res.y - tsm[5]; res = [view convertPoint: NSMakePoint(0, 1) toView: superView]; tsm[2] = res.x - tsm[4]; tsm[3] = res.y - tsm[5]; if (fabs(ts[0] - tsm[0]) > 0.001 || fabs(ts[1] - tsm[1]) > 0.001 || fabs(ts[2] - tsm[2]) > 0.001 || fabs(ts[3] - tsm[3]) > 0.001 || fabs(ts[4] - tsm[4]) > 0.001 || fabs(ts[5] - tsm[5]) > 0.001) { printf("expected bounds matrix (%g %g %g %g %g %g) got (%g %g %g %g %g %g)\n", ts[0], ts[1], ts[2], ts[3], ts[4], ts[5], tsm[0], tsm[1], tsm[2], tsm[3], tsm[4], tsm[5]); return 0; } return 1; } int main(int argc, char **argv) { CREATE_AUTORELEASE_POOL(arp); NSWindow *window; NSView *view1; CGFloat ts[6]; int passed = 1; [NSApplication sharedApplication]; window = [[NSWindow alloc] initWithContentRect: NSMakeRect(100,100,200,200) styleMask: NSClosableWindowMask backing: NSBackingStoreRetained defer: YES]; view1 = [[NSView alloc] initWithFrame: NSMakeRect(20,20,100,100)]; [[window contentView] addSubview: view1]; [view1 setBounds: NSMakeRect(30.4657, 88.5895, 21.2439, 60.8716)]; passed = CHECK(view1, NSMakeRect(20,20,100,100), NSMakeRect(30.4657, 88.5895, 21.2439, 60.8716)) && passed; passed = CHECK_BOUNDS_ROTATION(view1, 0) && passed; ts[0] = 4.70723; ts[1] = 0; ts[2] = 0; ts[3] = 1.64281; ts[4] = -123.409; ts[5] = -125.535; passed = CHECK_MATRIX(view1, ts) && passed; [view1 setBoundsRotation: 30]; passed = CHECK(view1, NSMakeRect(20,20,100,100), NSMakeRect(70.6788, 50.866, 48.8336, 63.3383)) && passed; passed = CHECK_BOUNDS_ROTATION(view1, 30) && passed; ts[0] = 4.07658; ts[1] = 0.821396; ts[2] = -2.35362; ts[3] = 1.42271; ts[4] = -123.409; ts[5] = -125.535; passed = CHECK_MATRIX(view1, ts) && passed; [view1 setBounds:(NSRect){{30.4657, 88.5895}, {21.2439, 60.8716}}]; passed = CHECK(view1, NSMakeRect(20,20,100,100),(NSRect) {{30.4657, 77.9676}, {48.8336, 63.3383}}) && passed; passed = CHECK_BOUNDS_ROTATION(view1, 30) && passed; ts[0] = 4.07658; ts[1] = 0.821396; ts[2] = -2.35361; ts[3] = 1.42271; ts[4] = 104.31; ts[5] = -131.062; passed = CHECK_MATRIX(view1, ts) && passed; [view1 scaleUnitSquareToSize:(NSSize){0.720733, 0.747573}]; passed = CHECK(view1, NSMakeRect(20,20,100,100),(NSRect) {{42.2704, 104.294}, {67.7554, 84.7253}}) && passed; passed = CHECK_BOUNDS_ROTATION(view1, 30) && passed; ts[0] = 2.93813; ts[1] = 0.59201; ts[2] = -1.7595; ts[3] = 1.06358; ts[4] = 104.31; ts[5] = -131.062; passed = CHECK_MATRIX(view1, ts) && passed; [view1 setBoundsRotation:30-1e-6]; passed = (fabs([view1 boundsRotation] - 30.0 + 1e-6) <= 0.001) && passed; passed = CHECK(view1, NSMakeRect(20,20,100,100),(NSRect) {{39.9801, 104.211}, {66.2393, 85.2544}}) && passed; passed = CHECK_BOUNDS_ROTATION(view1, 30 - 1e-6) && passed; ts[0] = 2.93813; ts[1] = 0.614059; ts[2] = -1.69633; ts[3] = 1.06358; ts[4] = 104.31; ts[5] = -131.062; passed = CHECK_MATRIX(view1, ts) && passed; [view1 rotateByAngle:1e-6]; passed = CHECK(view1, NSMakeRect(20,20,100,100),(NSRect) {{39.9801, 104.211}, {66.2393, 85.2544}}) && passed; passed = CHECK_BOUNDS_ROTATION(view1, 30) && passed; view1 = [[NSView alloc] initWithFrame: NSMakeRect(20,20,100,100)]; [[window contentView] addSubview: view1]; [view1 setBounds: NSMakeRect(30.4657, 88.5895, 21.2439, 60.8716)]; passed = CHECK(view1, NSMakeRect(20,20,100,100), NSMakeRect(30.4657, 88.5895, 21.2439, 60.8716)) && passed; [view1 scaleUnitSquareToSize:(NSSize){0.720733, 0.747573}]; passed = CHECK(view1, NSMakeRect(20,20,100,100),(NSRect) {{42.2704, 118.503}, {29.4754, 81.4256}}) && passed; passed = CHECK_BOUNDS_ROTATION(view1, 0) && passed; [view1 setBoundsRotation:30]; passed = CHECK(view1, NSMakeRect(20,20,100,100),(NSRect) {{95.8587, 66.7535}, {66.2393, 85.2544}}) && passed; passed = CHECK_BOUNDS_ROTATION(view1, 30) && passed; view1 = [[NSView alloc] initWithFrame: NSMakeRect(20,20,100,100)]; [[window contentView] addSubview: view1]; [view1 setBounds: NSMakeRect(30.4657, 88.5895, 21.2439, 60.8716)]; passed = CHECK(view1, NSMakeRect(20,20,100,100), NSMakeRect(30.4657, 88.5895, 21.2439, 60.8716)) && passed; [view1 setBoundsRotation:30]; passed = CHECK(view1, NSMakeRect(20,20,100,100),(NSRect) {{70.6788, 50.866}, {48.8336, 63.3383}}) && passed; passed = CHECK_BOUNDS_ROTATION(view1, 30) && passed; [view1 scaleUnitSquareToSize:(NSSize){0.720733, 0.747573}]; passed = CHECK(view1, NSMakeRect(20,20,100,100),(NSRect) {{98.0652, 68.0415}, {67.7554, 84.7252}}) && passed; passed = CHECK_BOUNDS_ROTATION(view1, 30) && passed; testHopeful = YES; pass(passed,"NSView -scaleUnitSquareToSize works"); testHopeful = NO; DESTROY(arp); return 0; } gnustep-gui-0.24.0/Tests/gui/NSView/NSView_convertRect.m0000664000076500007650000000735510373346332022730 0ustar brains99brains99/* copyright 2004 Alexander Malmberg */ #include "Testing.h" #include #include #include #include #include #include #if 0 NSView *view1,*view2; @interface TestView1 : NSView @end @implementation TestView1 -(void) drawRect: (NSRect)dr { NSRect r; PSsetrgbcolor(1,0,0); PSrectfill(0,0,100,100); PSsetrgbcolor(1,1,1); PSsetlinewidth(3.0); // printf("********* convert\n"); r=[self convertRect: NSMakeRect(0,0,50,50) fromView: view2]; printf("got rect (%g %g)+(%g %g)\n",r.origin.x,r.origin.y,r.size.width,r.size.height); PSrectstroke(r.origin.x,r.origin.y,r.size.width,r.size.height); PSsetrgbcolor(0,1,0); PSrectfill(r.origin.x-4,r.origin.y-4,8,8); } -(BOOL) isFlipped { return YES; } @end @interface TestView2 : NSView @end @implementation TestView2 -(void) drawRect: (NSRect)r { PSsetrgbcolor(0,0,1); PSrectfill(0,0,50,50); } -(BOOL) isFlipped { return YES; } @end #endif int check(NSView *from,NSView *to,NSRect rfrom,NSRect rto) { NSRect r; r=[to convertRect: rfrom fromView: from]; if (fabs(r.origin.x - rto.origin.x)>0.001 || fabs(r.origin.y - rto.origin.y)>0.001 || fabs(r.size.width - rto.size.width)>0.001 || fabs(r.size.height - rto.size.height)>0.001) { printf("(1) expected (%g %g)+(%g %g) to convert to (%g %g)+(%g %g), got (%g %g)+(%g %g)\n", rfrom.origin.x,rfrom.origin.y,rfrom.size.width,rfrom.size.height, rto.origin.x,rto.origin.y,rto.size.width,rto.size.height, r.origin.x,r.origin.y,r.size.width,r.size.height); return 0; } r=[from convertRect: rfrom toView: to]; if (fabs(r.origin.x - rto.origin.x)>0.001 || fabs(r.origin.y - rto.origin.y)>0.001 || fabs(r.size.width - rto.size.width)>0.001 || fabs(r.size.height - rto.size.height)>0.001) { printf("(2) expected (%g %g)+(%g %g) to convert to (%g %g)+(%g %g), got (%g %g)+(%g %g)\n", rfrom.origin.x,rfrom.origin.y,rfrom.size.width,rfrom.size.height, rto.origin.x,rto.origin.y,rto.size.width,rto.size.height, r.origin.x,r.origin.y,r.size.width,r.size.height); return 0; } return 1; } int main(int argc, char **argv) { CREATE_AUTORELEASE_POOL(arp); NSWindow *window; NSView *view1,*view2; int passed=1; [NSApplication sharedApplication]; window=[[NSWindow alloc] initWithContentRect: NSMakeRect(100,100,200,200) styleMask: NSClosableWindowMask backing: NSBackingStoreRetained defer: YES]; view1=[[NSView alloc] initWithFrame: NSMakeRect(20,20,100,100)]; view2=[[NSView alloc] initWithFrame: NSMakeRect(25,25,50,50)]; [view1 addSubview: view2]; [[window contentView] addSubview: view1]; passed=check(view2,view1,NSMakeRect(0,0,10,10),NSMakeRect(25,25,10,10)) && passed; passed=check(view1,view2,NSMakeRect(25,25,10,10),NSMakeRect(0,0,10,10)) && passed; [view2 setFrameRotation: 45.0]; passed=check(view2,view1,NSMakeRect(0,0,10,10),NSMakeRect(17.9289,25,14.1421,14.1421)) && passed; [view2 setFrameRotation: 0.0]; passed=check(view2,view1,NSMakeRect(0,0,10,10),NSMakeRect(25,25,10,10)) && passed; passed=check(view1,view2,NSMakeRect(25,25,10,10),NSMakeRect(0,0,10,10)) && passed; [view1 setFrameRotation: 45.0]; [view2 setFrameRotation: 45.0]; passed=check(view2,view1,NSMakeRect(0,0,10,10),NSMakeRect(17.9289,25,14.1421,14.1421)) && passed; [view2 setFrameRotation: -45.0]; passed=check(view2,view1,NSMakeRect(0,0,10,10),NSMakeRect(25,17.9289,14.1421,14.1421)) && passed; passed=check(view2,[window contentView],NSMakeRect(0,0,10,10),NSMakeRect(20,55.3553,10,10)) && passed; passed=check([window contentView],view2,NSMakeRect(20,55.3553,10,10),NSMakeRect(0,0,10,10)) && passed; pass(passed,"NSView -convertRect:fromView: and -convertRect:toView: work"); DESTROY(arp); return 0; } gnustep-gui-0.24.0/Tests/gui/NSView/TestInfo0000664000076500007650000000000011531251711020444 0ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/NSView/NSView_visibleRect.m0000664000076500007650000000102611734640366022700 0ustar brains99brains99/* copyright 2011 Fred Kiefer on 18.07.11. */ #include "Testing.h" #include #include #include int main(int argc, char **argv) { CREATE_AUTORELEASE_POOL(arp); NSRect f = NSMakeRect(0,0,100,100); NSView *v = [[NSView alloc] initWithFrame: f]; int passed = 1; if (!NSEqualRects([v visibleRect], f)) { passed = 0; } testHopeful = YES; pass(passed, "NSView -visibleRect works"); testHopeful = NO; DESTROY(arp); return 0; } gnustep-gui-0.24.0/Tests/gui/NSView/NSView_frame_bounds.m0000775000076500007650000000732411560644141023073 0ustar brains99brains99// // NSView_frame_bounds.m // // Created by Fred Kiefer on 13.11.08. // #include "Testing.h" #include #include #include #include #include int CHECK(NSView *view, NSRect frame, NSRect bounds) { NSRect r; r = [view frame]; if (fabs(r.origin.x - frame.origin.x)>0.001 || fabs(r.origin.y - frame.origin.y)>0.001 || fabs(r.size.width - frame.size.width)>0.001 || fabs(r.size.height - frame.size.height)>0.001) { printf("(1) expected frame (%g %g)+(%g %g), got (%g %g)+(%g %g)\n", frame.origin.x, frame.origin.y, frame.size.width, frame.size.height, r.origin.x, r.origin.y, r.size.width, r.size.height); return 0; } r = [view bounds]; if (fabs(r.origin.x - bounds.origin.x)>0.001 || fabs(r.origin.y - bounds.origin.y)>0.001 || fabs(r.size.width - bounds.size.width)>0.001 || fabs(r.size.height - bounds.size.height)>0.001) { printf("(2) expected bounds (%g %g)+(%g %g), got (%g %g)+(%g %g)\n", bounds.origin.x, bounds.origin.y, bounds.size.width, bounds.size.height, r.origin.x, r.origin.y, r.size.width, r.size.height); return 0; } return 1; } int main(int argc, char **argv) { CREATE_AUTORELEASE_POOL(arp); NSWindow *window; NSView *view1; int passed = 1; [NSApplication sharedApplication]; window = [[NSWindow alloc] initWithContentRect: NSMakeRect(100,100,200,200) styleMask: NSClosableWindowMask backing: NSBackingStoreRetained defer: YES]; view1 = [[NSView alloc] initWithFrame: NSMakeRect(20,20,100,100)]; [[window contentView] addSubview: view1]; passed = CHECK(view1, NSMakeRect(20,20,100,100),NSMakeRect(0,0,100,100)) && passed; [view1 setFrameOrigin: NSMakePoint(10, 10)]; passed = CHECK(view1, NSMakeRect(10,10,100,100),NSMakeRect(0,0,100,100)) && passed; [view1 setFrameSize: NSMakeSize(80, 80)]; passed = CHECK(view1, NSMakeRect(10,10,80,80),NSMakeRect(0,0,80,80)) && passed; [view1 setFrameRotation: 45.0]; passed = CHECK(view1, NSMakeRect(10,10,80,80),NSMakeRect(0,0,80,80)) && passed; [view1 setBoundsRotation: -45.0]; passed = CHECK(view1, NSMakeRect(10,10,80,80),NSMakeRect(-56.5685,0,113.137,113.137)) && passed; [view1 setFrameSize: NSMakeSize(100, 100)]; passed = CHECK(view1, NSMakeRect(10,10,100,100),NSMakeRect(-70.7107,0,141.421,141.421)) && passed; [view1 setFrameOrigin: NSMakePoint(20, 20)]; passed = CHECK(view1, NSMakeRect(20,20,100,100),NSMakeRect(-70.7107,0,141.421,141.421)) && passed; [view1 setBoundsOrigin: NSMakePoint(20, 20)]; passed = CHECK(view1, NSMakeRect(20,20,100,100),NSMakeRect(-50.7107,20,141.421,141.421)) && passed; [view1 setBoundsSize: NSMakeSize(100, 100)]; passed = CHECK(view1, NSMakeRect(20,20,100,100),NSMakeRect(-50.7107,20,141.421,141.421)) && passed; [view1 setBoundsSize: NSMakeSize(10, 10)]; passed = CHECK(view1, NSMakeRect(20,20,100,100),NSMakeRect(-5.07107,2,14.1421,14.1421)) && passed; [view1 setBoundsRotation: 0.0]; passed = CHECK(view1, NSMakeRect(20,20,100,100),NSMakeRect(2.82843, 0, 10, 10)) && passed; [view1 setBoundsSize: NSMakeSize(1, 1)]; passed = CHECK(view1, NSMakeRect(20,20,100,100),NSMakeRect(0.282843, 0, 1, 1)) && passed; [view1 setBoundsRotation: -45.0]; [view1 setBounds: NSMakeRect(10, 10, 100, 100)]; passed = CHECK(view1, NSMakeRect(20,20,100,100),NSMakeRect(-60.7107,10,141.421,141.421)) && passed; [view1 translateOriginToPoint: NSMakePoint(20, 20)]; passed = CHECK(view1, NSMakeRect(20,20,100,100),NSMakeRect(-80.7107,-10,141.421,141.421)) && passed; [view1 scaleUnitSquareToSize: NSMakeSize(2, 3)]; passed = CHECK(view1, NSMakeRect(20,20,100,100),NSMakeRect(-40.3553,-3.33333,70.7107,47.1405)) && passed; pass(passed,"NSView -frame and -bounds work"); DESTROY(arp); return 0; } gnustep-gui-0.24.0/Tests/gui/NSView/NSView_frame_rotation.m0000664000076500007650000000231111107110276023416 0ustar brains99brains99/* copyright 2004 Alexander Malmberg */ #include "Testing.h" #include #include #include #include #include int main(int argc, char **argv) { CREATE_AUTORELEASE_POOL(arp); NSWindow *window; NSView *view; int passed; [NSApplication sharedApplication]; window=[[NSWindow alloc] init]; view=[[NSView alloc] init]; [[window contentView] addSubview: view]; #define CHECK(f) \ if (fabs(f-[view frameRotation])>0.0001 \ && fabs(f-[view frameRotation]-360.0)>0.0001 \ && fabs(f-[view frameRotation]+360.0)>0.0001) \ { \ passed=0; \ printf("expected rotation %30.25f, got %30.25f\n",f,[view frameRotation]); \ } passed=1; CHECK(0.0) [view setFrameRotation: 45.0]; CHECK(45.0) [view setFrameRotation: 0.0]; CHECK(0.0) [view setFrameRotation: 90.0]; CHECK(90.0) [view setFrameRotation: 180.0]; CHECK(180.0) [view setFrameRotation: 360.0]; CHECK(0.0) [view setFrameRotation: 0.0]; CHECK(0.0) [view setFrameRotation: -45.0]; CHECK(315.0) [view setFrameRotation: 0.0]; CHECK(0.0) pass(passed,"-frameRotation/-setFrameRotation work"); DESTROY(arp); return 0; } gnustep-gui-0.24.0/Tests/gui/NSView/scrollRectToVisible.m0000664000076500007650000000516011612554350023122 0ustar brains99brains99/* copyright 2004 Alexander Malmberg */ #include "Testing.h" #include #include #include #include #include #define TEST(r,s) \ if (!NSEqualRects([v visibleRect],r)) \ { \ printf("%s: got %s, expected %s\n", \ s, \ [NSStringFromRect([v visibleRect]) lossyCString], \ [NSStringFromRect(r) lossyCString]); \ pass(0,s); \ } \ else \ pass(1,s); int main(int argc, char **argv) { NSWindow *window; CREATE_AUTORELEASE_POOL(arp); NSClipView *cv=[[NSClipView alloc] initWithFrame: NSMakeRect(0,0,10,10)]; NSView *v=[[NSView alloc] initWithFrame: NSMakeRect(0,0,100,100)]; [cv setDocumentView: v]; [NSApplication sharedApplication]; window = [[NSWindow alloc] initWithContentRect: NSMakeRect(100,100,200,200) styleMask: NSClosableWindowMask backing: NSBackingStoreRetained defer: YES]; [[window contentView] addSubview: cv]; /* Initial position. */ TEST(NSMakeRect(0,0,10,10),"1") /* Basic scrolling. */ [v scrollRectToVisible: NSMakeRect(50,50,10,10)]; TEST(NSMakeRect(50,50,10,10),"2"); /* No scrolling necessary. */ [v scrollRectToVisible: NSMakeRect(55,55,5,5)]; TEST(NSMakeRect(50,50,10,10),"3"); /* No scrolling necessary. */ [v scrollRectToVisible: NSMakeRect(50,50,5,5)]; TEST(NSMakeRect(50,50,10,10),"4"); /* No scrolling necessary. */ [v scrollRectToVisible: NSMakeRect(52,52,5,5)]; TEST(NSMakeRect(50,50,10,10),"5"); /* Minimal scrolling means that the "small-coordinate" corner should be visible. */ [v scrollRectToVisible: NSMakeRect(80,80,20,20)]; TEST(NSMakeRect(80,80,10,10),"6"); /* And in this case, the "large-coordinate" corner. */ [v scrollRectToVisible: NSMakeRect(0,0,20,20)]; TEST(NSMakeRect(10,10,10,10),"7"); /* If the visible rect is inside the target rect, no scrolling should occur. */ [v scrollRectToVisible: NSMakeRect(5,5,20,20)]; TEST(NSMakeRect(10,10,10,10),"8"); /* Nor for a target rect on the edge of the visible rect. */ [v scrollRectToVisible: NSMakeRect(10,10,20,20)]; TEST(NSMakeRect(10,10,10,10),"9"); /* Repeating the call shouldn't cause any scrolling. */ [v scrollRectToVisible: NSMakeRect(10,10,20,20)]; TEST(NSMakeRect(10,10,10,10),"10"); /* Minimal scrolling and partial overlap. */ [v scrollRectToVisible: NSMakeRect(7,7,5,5)]; TEST(NSMakeRect(7,7,10,10),"11"); [v scrollRectToVisible: NSMakeRect(15,15,5,5)]; TEST(NSMakeRect(10,10,10,10),"12"); DESTROY(arp); return 0; } gnustep-gui-0.24.0/Tests/gui/NSView/NSView_autoresize_and_rounding.m0000775000076500007650000001645411734640366025364 0ustar brains99brains99// // NSView_autoresize_and_rounding.m // // Created by Eric Wasylishen on 06.07.11 // #include "Testing.h" #include #include #include #include #include #include BOOL rects_almost_equal(NSRect r1, NSRect r2) { if (fabs(r1.origin.x - r2.origin.x)>0.001 || fabs(r1.origin.y - r2.origin.y)>0.001 || fabs(r1.size.width - r2.size.width)>0.001 || fabs(r1.size.height - r2.size.height)>0.001) { printf("(1) expected frame (%g %g)+(%g %g), got (%g %g)+(%g %g)\n", r2.origin.x, r2.origin.y, r2.size.width, r2.size.height, r1.origin.x, r1.origin.y, r1.size.width, r1.size.height); return NO; } else { return YES; } } int CHECK(NSView *view, NSRect frame) { NSRect r = [view frame]; return rects_almost_equal(r, frame); } int main(int argc, char **argv) { CREATE_AUTORELEASE_POOL(arp); NSWindow *window; NSView *container; NSView *view1; int passed = 1; [NSApplication sharedApplication]; window = [[NSWindow alloc] initWithContentRect: NSMakeRect(100,100,100,100) styleMask: NSBorderlessWindowMask backing: NSBackingStoreRetained defer: YES]; container = [[NSView alloc] initWithFrame: NSMakeRect(0,0,100,100)]; [[window contentView] addSubview: container]; view1 = [[NSView alloc] initWithFrame: NSMakeRect(10,10,10,10)]; [container addSubview: view1]; /** * Basic autoresizing test */ // No autosizing [view1 setAutoresizingMask: NSViewNotSizable]; passed = CHECK(view1, NSMakeRect(10,10,10,10)) && passed; [container setFrameSize: NSMakeSize(50, 100)]; passed = CHECK(view1, NSMakeRect(10,10,10,10)) && passed; [container setFrameSize: NSMakeSize(200, 100)]; passed = CHECK(view1, NSMakeRect(10,10,10,10)) && passed; [container setFrameSize: NSMakeSize(100, 100)]; passed = CHECK(view1, NSMakeRect(10,10,10,10)) && passed; // NSViewWidthSizable [view1 setFrame: NSMakeRect(10,10,10,10)]; [view1 setAutoresizingMask: NSViewWidthSizable]; passed = CHECK(view1, NSMakeRect(10,10,10,10)) && passed; [container setFrameSize: NSMakeSize(96, 100)]; passed = CHECK(view1, NSMakeRect(10,10,6,10)) && passed; [container setFrameSize: NSMakeSize(200, 100)]; passed = CHECK(view1, NSMakeRect(10,10,110,10)) && passed; [container setFrameSize: NSMakeSize(100, 100)]; passed = CHECK(view1, NSMakeRect(10,10,10,10)) && passed; // NSViewWidthSizable | NSViewMaxXMargin [view1 setFrame: NSMakeRect(0,0,33,33)]; [view1 setAutoresizingMask: NSViewWidthSizable | NSViewMaxXMargin]; [container setFrameSize: NSMakeSize(200, 100)]; passed = CHECK(view1, NSMakeRect(0,0,66,33)) && passed; [container setFrameSize: NSMakeSize(100, 100)]; // NSViewWidthSizable | NSViewMinXMargin [view1 setFrame: NSMakeRect(50,0,25,25)]; [view1 setAutoresizingMask: NSViewWidthSizable | NSViewMinXMargin]; [container setFrameSize: NSMakeSize(175, 100)]; passed = CHECK(view1, NSMakeRect(100,0,50,25)) && passed; [container setFrameSize: NSMakeSize(100, 100)]; pass(passed,"NSView autoresizing works"); /** * Corner case tests, involving widths of 0, etc. */ // Test that a view with a width of 0 can be expanded // if it only has NSViewWidthSizable passed = 1; [view1 setFrame: NSMakeRect(50,0,0,25)]; [view1 setAutoresizingMask: NSViewWidthSizable]; [container setFrameSize: NSMakeSize(133, 100)]; passed = CHECK(view1, NSMakeRect(50,0,33,25)) && passed; [container setFrameSize: NSMakeSize(100, 100)]; // Test that if NSViewWidthSizable | NSViewMinXMargin is set, // and the view has width of 0, extra space is given to the margin // not the width [view1 setFrame: NSMakeRect(50,0,0,35)]; [view1 setAutoresizingMask: NSViewWidthSizable | NSViewMinXMargin]; [container setFrameSize: NSMakeSize(133, 100)]; passed = CHECK(view1, NSMakeRect(83,0,0,35)) && passed; [container setFrameSize: NSMakeSize(100, 100)]; // Test a {0, 0} sized window with NSViewWidthSizable | NSViewHeightSizable [container setFrameSize: NSMakeSize(0,0)]; [view1 setFrame: NSMakeRect(0,0,0,0)]; [view1 setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [container setFrameSize: NSMakeSize(4,4)]; passed = CHECK(view1, NSMakeRect(0,0,4,4)) && passed; [container setFrameSize: NSMakeSize(100, 100)]; // Test a {0, 0} sized window with NSMinXMargin | NSViewWidthSizable [container setFrameSize: NSMakeSize(0,0)]; [view1 setFrame: NSMakeRect(0,0,0,0)]; [view1 setAutoresizingMask: NSViewMinXMargin | NSViewWidthSizable]; [container setFrameSize: NSMakeSize(6,6)]; passed = CHECK(view1, NSMakeRect(3,0,3,0)) && passed; [container setFrameSize: NSMakeSize(100, 100)]; // Test a {0, 0} sized window with all autoresizing flags set on the view [container setFrameSize: NSMakeSize(0,0)]; [view1 setFrame: NSMakeRect(0,0,0,0)]; [view1 setAutoresizingMask: NSViewMinXMargin | NSViewWidthSizable | NSViewMaxXMargin | NSViewMinYMargin | NSViewHeightSizable | NSViewMaxYMargin]; [container setFrameSize: NSMakeSize(9,9)]; passed = CHECK(view1, NSMakeRect(3,3,3,3)) && passed; [container setFrameSize: NSMakeSize(100, 100)]; pass(passed,"NSView autoresizing corner cases work"); /** * Rounding test */ passed = 1; [view1 setFrame: NSMakeRect(10, 10, 10, 10)]; [view1 setAutoresizingMask: NSViewMinXMargin | NSViewWidthSizable | NSViewMaxXMargin | NSViewMinYMargin | NSViewHeightSizable | NSViewMaxYMargin ]; // All autoresize masks are enabled. Check that halving the // width and height of the window works as expected. passed = CHECK(view1, NSMakeRect(10,10,10,10)) && passed; [container setFrameSize: NSMakeSize(50, 50)]; // reduce to 50% passed = CHECK(view1, NSMakeRect(5,5,5,5)) && passed; [container setFrameSize: NSMakeSize(100, 100)]; // restore passed = CHECK(view1, NSMakeRect(10,10,10,10)) && passed; [container setFrameSize: NSMakeSize(33, 33)]; // reduce to 33% // NOTE: Frame should be rounded from NSMakeRect(3.3,3.3,3.3,3.3) to // NSMakeRect(3,3,3,3) passed = CHECK(view1, NSMakeRect(3,3,3,3)) && passed; [container setFrameSize: NSMakeSize(100, 100)]; // restore // NOTE: The following shows that the precision lost in the rounding // shown in the previous test was saved by the view passed = CHECK(view1, NSMakeRect(10,10,10,10)) && passed; // Now test that we can still set fractional frames [view1 setFrame: NSMakeRect(1.5, 1.5, 1.5, 1.5)]; passed = CHECK(view1, NSMakeRect(1.5, 1.5, 1.5, 1.5)) && passed; pass(passed,"NSView autoresize rounding works"); // Test centerScanRect { NSView *view2 = [[NSView alloc] initWithFrame: NSMakeRect(0, 0, 100, 100)]; testHopeful = YES; PASS(rects_almost_equal([view2 centerScanRect: NSMakeRect(0.5, 0.5, 100, 100)], NSMakeRect(1, 1, 100, 100)), "centerScanRect works 1"); PASS(rects_almost_equal([view2 centerScanRect: NSMakeRect(0.9, 0.9, 99.9, 99.9)], NSMakeRect(1, 1, 100, 100)), "centerScanRect works 2"); PASS(rects_almost_equal([view2 centerScanRect: NSMakeRect(0.9, 0.9, 99.4, 99.4)], NSMakeRect(1, 1, 99, 99)), "centerScanRect works 3"); PASS(rects_almost_equal([view2 centerScanRect: NSMakeRect(0.4, 0.4, 99.4, 99.4)], NSMakeRect(0, 0, 100, 100)), "centerScanRect works 4"); testHopeful = NO; [view2 release]; } DESTROY(arp); return 0; } gnustep-gui-0.24.0/Tests/gui/NSParagraphStyle/0000775000076500007650000000000012256227332021023 5ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/NSParagraphStyle/TestInfo0000664000076500007650000000000011531251711022460 0ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/NSParagraphStyle/NSParagraphStyle_defaultWritingDirection.m0000664000076500007650000000104210373346332031276 0ustar brains99brains99/* copyright 2004 Alexander Malmberg */ #include "Testing.h" #include #include int main(int argc, char **argv) { int ok; CREATE_AUTORELEASE_POOL(arp); ok = [NSParagraphStyle defaultWritingDirectionForLanguage: @"en"]==NSWritingDirectionLeftToRight && [NSParagraphStyle defaultWritingDirectionForLanguage: @"ar"]==NSWritingDirectionRightToLeft; pass(ok,"[NSParagraphStyle defaultWritingDirectionForLanguage:] works"); DESTROY(arp); return 0; } gnustep-gui-0.24.0/Tests/gui/NSPasteboard/0000775000076500007650000000000012256227332020161 5ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/NSPasteboard/TestInfo0000664000076500007650000000000011531251711021616 0ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/NSPasteboard/lazy_copy.m0000664000076500007650000000201711356570271022353 0ustar brains99brains99/* copyright 2004 Alexander Malmberg */ #include "Testing.h" #include #include #include #include static NSString *theString=@"QUUX!!1!!\"$!"; @interface Foo : NSObject @end @implementation Foo +(void) pasteboard: (NSPasteboard *)pb provideDataForType: (NSString *)type { // printf("pasteboard: %@ provideDataForType: %@\n",pb,type); [pb setString: theString forType: NSStringPboardType]; } @end int main(int argc, char **argv) { CREATE_AUTORELEASE_POOL(arp); NSPasteboard *pb=[NSPasteboard pasteboardWithName: @"lazy copy test"]; int i; NSString *s; i=[pb declareTypes: [NSArray arrayWithObject: NSStringPboardType] owner: [Foo self]]; DESTROY(arp); arp=[NSAutoreleasePool new]; pb=[NSPasteboard pasteboardWithName: @"lazy copy test"]; s=[pb stringForType: NSStringPboardType]; pass([s isEqual: theString], "NSPasteboard handles lazy setting of data"); DESTROY(arp); return 0; } gnustep-gui-0.24.0/Tests/gui/NSPopUpButton/0000775000076500007650000000000012256227332020334 5ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/NSPopUpButton/TestInfo0000664000076500007650000000000011531251711021771 0ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/NSPopUpButton/defaultSelection.m0000664000076500007650000000074010373346332024005 0ustar brains99brains99/* copyright 2005 Alexander Malmberg */ #include "Testing.h" #include #include int main(int argc, char **argv) { CREATE_AUTORELEASE_POOL(arp); NSPopUpButton *b; [NSApplication sharedApplication]; b=[[NSPopUpButton alloc] init]; [b addItemWithTitle: @"foo"]; [b addItemWithTitle: @"bar"]; pass([b indexOfSelectedItem] == 0,"first item is selected by default"); DESTROY(arp); return 0; } gnustep-gui-0.24.0/Tests/gui/NSEvent/0000775000076500007650000000000012256227332017156 5ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/NSEvent/TestInfo0000664000076500007650000000000011531251711020613 0ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/NSEvent/delta.m0000664000076500007650000000273411504722665020437 0ustar brains99brains99#include "Testing.h" #include #include #include #include int main() { CREATE_AUTORELEASE_POOL(arp); NSEvent *ev; [NSApplication sharedApplication]; ev = [NSEvent mouseEventWithType: NSLeftMouseDown location: NSMakePoint(0.0, 0.0) modifierFlags: 0 timestamp: 0 windowNumber: 0 context: nil eventNumber: 0 clickCount: 0 pressure: 0.0]; pass([ev deltaX] == 0.0, "-deltaX with NSLeftMouseDown event works"); pass([ev deltaY] == 0.0, "-deltaY with NSLeftMouseDown event works"); pass([ev deltaZ] == 0.0, "-deltaZ with NSLeftMouseDown event works"); ev = [NSEvent keyEventWithType: NSKeyDown location: NSMakePoint(0.0, 0.0) modifierFlags: 0 timestamp: 0 windowNumber: 0 context: nil characters: @"a" charactersIgnoringModifiers: @"a" isARepeat: NO keyCode: 65]; pass([ev deltaX] == 0.0, "-deltaX with NSKeyDown event works"); pass([ev deltaY] == 0.0, "-deltaY with NSKeyDown event works"); pass([ev deltaZ] == 0.0, "-deltaZ with NSKeyDown event works"); DESTROY(arp); return 0; } gnustep-gui-0.24.0/Tests/gui/GNUmakefile.postamble0000664000076500007650000000132310373346332021672 0ustar brains99brains99# # GNUmakefile.postamble for base tests # # Find all all subdirectories and run a clean in them independantly # after-clean:: $(ECHO_NOTHING)\ RUNDIR=`pwd`; \ TESTDIRS=`find . -type d`; \ for dir in $$TESTDIRS __done; do \ if [ $$dir != . -a -f $$dir/GNUmakefile ]; then \ echo Cleaning $$dir; cd $$dir; make clean; cd $$RUNDIR; \ fi \ done \ $(END_ECHO) after-distclean:: $(ECHO_NOTHING)\ RUNDIR=`pwd`; \ TESTDIRS=`find . -type d`; \ for dir in $$TESTDIRS __done; do \ if [ $$dir != . -a -f $$dir/GNUmakefile ]; then \ echo Cleaning $$dir; cd $$dir; make distclean; \ if [ \! -f IGNORE ]; then \ $(RM) GNUmakefile; \ fi; \ cd $$RUNDIR; \ fi \ done \ $(END_ECHO) gnustep-gui-0.24.0/Tests/gui/GNUmakefile.super0000664000076500007650000000013410373346332021041 0ustar brains99brains99# # # -include $(GNUSTEP_MAKEFILES)/Additional/gui.make AUXILIARY_TOOL_LIBS += $(GUI_LIBS) gnustep-gui-0.24.0/Tests/gui/NSSliderCell/0000775000076500007650000000000012256227332020117 5ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/NSSliderCell/TestInfo0000664000076500007650000000000011531251711021554 0ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/NSSliderCell/minMax.m0000664000076500007650000001211711313521564021525 0ustar brains99brains99#include "Testing.h" #include #include #include #include #include int main() { CREATE_AUTORELEASE_POOL(arp); NSSliderCell *cell; NSNumber *num; [NSApplication sharedApplication]; cell = [[NSSliderCell alloc] init]; pass([cell isContinuous], "slider continuous by default"); pass([cell minValue] == 0.0, "default min value is 0"); pass([cell maxValue] == 1.0, "default max value is 1"); pass([cell doubleValue] == 0.0, "default value is 0"); pass([[cell objectValue] isEqual: [NSNumber numberWithDouble: 0]], "default objectValue is NSNumber 0"); [cell setMinValue: 2]; pass([cell minValue] == 2.0, "set min value to 2"); pass([cell maxValue] == 1.0, "max value is still 1"); pass([cell doubleValue] == 2.0, "when min < max, value should always be min"); [cell setDoubleValue: -100.0]; pass([cell doubleValue] == 2.0, "when min < max, value should always be min"); [cell setDoubleValue: 1]; pass([cell doubleValue] == 2.0, "when min < max, value should always be min"); [cell setDoubleValue: 1.5]; pass([cell doubleValue] == 2.0, "when min < max, value should always be min"); [cell setDoubleValue: 2.0]; pass([cell doubleValue] == 2.0, "when min < max, value should always be min"); [cell setDoubleValue: 2.5]; pass([cell doubleValue] == 2.0, "when min < max, value should always be min"); [cell setMaxValue: 10]; pass([cell doubleValue] == 2.0, "value is still 2.0"); [cell setMinValue: 3.0]; pass([cell doubleValue] == 3.0, "changing minimum clamps value to 3.0"); pass([cell floatValue] == 3.0, "changing minimum clamps value to 3.0"); [cell setDoubleValue: 10]; [cell setMaxValue: 9]; pass([cell doubleValue] == 9.0, "changing max clamps value to 9.0"); pass([cell floatValue] == 9.0, "changing max clamps value to 9.0"); // Test value setters [cell setObjectValue: @"hello"]; pass([cell doubleValue] == 3.0, "setting nonsense string objectValue sets value to min"); [cell setDoubleValue: 9.0]; [cell setStringValue: @"hello"]; pass([cell doubleValue] == 3.0, "setting nonsense string stringValue sets value to min"); [cell setDoubleValue: 9.0]; [cell setObjectValue: nil]; pass([cell doubleValue] == 3.0, "setting nil objectValue sets value to min"); [cell setDoubleValue: 9.0]; [cell setObjectValue: @"3.5"]; pass([cell doubleValue] == 3.5, "setting @'3.5' objectValue sets value to 3.5"); [cell setDoubleValue: 9.0]; [cell setStringValue: @"3.5"]; pass([cell doubleValue] == 3.5, "setting @'3.5' stringValue sets value to 3.5"); [cell setDoubleValue: 9.0]; [cell setIntValue: 3]; pass([cell doubleValue] == 3.0, "setting 3 intValue sets value to 3.0"); [cell setDoubleValue: 9.0]; // Test setting the value out of bounds with different setters [cell setDoubleValue: 3.5]; [cell setObjectValue: @"-5"]; pass([cell doubleValue] == 3.0, "setting @'-5' objectValue sets value to min"); pass([cell intValue] == 3, "setting @'-5' objectValue sets value to min (integer)"); [cell setDoubleValue: 3.5]; [cell setStringValue: @"-5"]; pass([cell doubleValue] == 3.0, "setting @'-5' stringValue sets value to min"); pass([cell intValue] == 3, "setting @'-5' objectValue sets value to min (integer)"); [cell setDoubleValue: 3.5]; [cell setIntValue: -5]; pass([cell doubleValue] == 3.0, "setting -5 intValue sets value to min"); pass([cell intValue] == 3, "setting @'-5' objectValue sets value to min (integer)"); [cell setDoubleValue: 3.5]; [cell setDoubleValue: -5]; pass([cell doubleValue] == 3.0, "setting -5 doubleValue sets value to min"); pass([cell intValue] == 3, "setting @'-5' objectValue sets value to min (integer)"); [cell setDoubleValue: 3.5]; [cell setFloatValue: -5]; pass([cell doubleValue] == 3.0, "setting -5 floatValue sets value to min"); pass([cell intValue] == 3, "setting @'-5' objectValue sets value to min (integer)"); [cell setDoubleValue: 3.5]; [cell setObjectValue: @"15"]; pass([cell doubleValue] == 9.0, "setting @'15' objectValue sets value to max"); pass([cell intValue] == 9, "setting @'15' objectValue sets value to max (integer)"); [cell setDoubleValue: 3.5]; [cell setStringValue: @"15"]; pass([cell doubleValue] == 9.0, "setting @'15' stringValue sets value to max"); pass([cell intValue] == 9, "setting @'15' stringValue sets value to max (integer)"); [cell setDoubleValue: 3.5]; [cell setIntValue: 15]; pass([cell doubleValue] == 9.0, "setting 15 intValue sets value to max"); pass([cell intValue] == 9, "setting 15 intValue sets value to max (integer)"); [cell setDoubleValue: 3.5]; [cell setDoubleValue: 15]; pass([cell doubleValue] == 9.0, "setting 15 doubleValue sets value to max"); pass([cell intValue] == 9, "setting 15 doubleValue sets value to max (integer)"); [cell setDoubleValue: 3.5]; [cell setFloatValue: 15]; pass([cell doubleValue] == 9.0, "setting 15 floatValue sets value to max"); pass([cell intValue] == 9, "setting 15 floatValue sets value to max (integer)"); DESTROY(arp); return 0; } gnustep-gui-0.24.0/Tests/gui/NSBezierPath/0000775000076500007650000000000012256227332020132 5ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/NSBezierPath/TestInfo0000664000076500007650000000000011531251711021567 0ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/NSBezierPath/windingCountAtPoint.m0000664000076500007650000002776511356570271024303 0ustar brains99brains99/* copyright 2004 Alexander Malmberg */ #include "Testing.h" #include #include #include #define nextafterf(x,y) next(x,y) static float next(float x,float y) { if (yx) return x+(x?0.00001:0.000005); // return x+(x?0.0001:0.00001); else return y; } //#define DRAW #ifdef DRAW #include #include #include #include #include @interface MyView : NSView -(void) clear; -(void) drawPath: (NSBezierPath *)p; -(void) drawPoint: (NSPoint)p count: (int)c; -(void) pause; @end #define MOVE \ { \ double x0,y0,x1,y1; \ double w=800,h=800; \ \ x0=76.980; \ x1=76.981; \ y0=-0.0005; \ y1=0.0005; \ \ ww=w/(x1-x0); \ hh=h/(y1-y0); \ PSscale(ww,hh); \ PStranslate(-x0,-y0); \ } @implementation MyView -(void) clear { [self lockFocus]; PSsetrgbcolor(1,1,1); NSRectFill([self bounds]); [self unlockFocus]; [[self window] flushWindow]; } -(void) drawPath: (NSBezierPath *)p { double ww,hh; [self lockFocus]; MOVE PSsetrgbcolor(0.8,0.4,0.4); [p fill]; PSsetrgbcolor(0.3,1.0,0.3); PSsetalpha(0.5); [[p bezierPathByFlatteningPath] fill]; [self unlockFocus]; [[self window] flushWindow]; } -(void) drawPoint: (NSPoint)p count: (int)c { #define NC 3 static float colors[NC][3]={ {1,0,0}, {0,1,0}, {0,0,1}, }; double ww,hh; c%=NC; if (c<0) c+=NC; [self lockFocus]; MOVE PSsetrgbcolor(colors[c][0],colors[c][1],colors[c][2]); PSrectfill(p.x-4/ww,p.y-4/hh,8/ww,8/hh); [self unlockFocus]; [[self window] flushWindow]; #undef NC } -(void) pause { char buf[128]; gets(buf); } @end MyView *view; #endif int main(int argc, char **argv) { CREATE_AUTORELEASE_POOL(arp); NSBezierPath *p=[[NSBezierPath alloc] init]; NSRect r; float x; int i; const char *str; int X=-1000; #ifdef DRAW { NSWindow *w; [NSApplication sharedApplication]; w=[[NSWindow alloc] initWithContentRect: NSMakeRect(50,50,800,800) styleMask: NSTitledWindowMask backing: NSBackingStoreRetained defer: YES]; view=[[MyView alloc] init]; [w setContentView: view]; [w orderFront: nil]; } #endif #ifdef DRAW #define DP(e,x,y) [view drawPoint: NSMakePoint(x,y) count: e]; #define CLEAR [view clear]; #define PAUSE [view pause]; #define DRAWPATH [view drawPath: p]; #else #define DP(e,x,y) #define CLEAR #define PAUSE #define DRAWPATH #endif #define T(e,x,y) \ { \ int i,r; \ DP(e,x,y) \ r=[p windingCountAtPoint: NSMakePoint(x,y)]; \ for (i=5;i;i--) \ { \ if ([p windingCountAtPoint: NSMakePoint(x,y)]!=r) \ break; \ } \ if (i) \ { \ pass(NO, \ "path '%s', %15.8e %15.8e, expected %i, got inconsistant results", \ str,(double)x,(double)y, \ e); \ } \ else \ { \ pass(r == e, \ "path '%s', %15.8e %15.8e, expected %i, got %i", \ str,(double)x,(double)y, \ e,r); \ } \ } #define CHECK_AROUND(x,y, p00,p10,p20, p01,p11,p21, p02,p12,p22) \ if (p00!=X) T(p00,nextafterf(x,-1000),nextafterf(y, 1000)) \ if (p10!=X) T(p10, x ,nextafterf(y, 1000)) \ if (p20!=X) T(p20,nextafterf(x, 1000),nextafterf(y, 1000)) \ \ if (p01!=X) T(p01,nextafterf(x,-1000), y ) \ if (p11!=X) T(p11, x , y ) \ if (p21!=X) T(p21,nextafterf(x, 1000), y ) \ \ if (p02!=X) T(p02,nextafterf(x,-1000),nextafterf(y,-1000)) \ if (p12!=X) T(p12, x ,nextafterf(y,-1000)) \ if (p22!=X) T(p22,nextafterf(x, 1000),nextafterf(y,-1000)) #if 1 str="empty"; T(0,0,0) for (i=0;i<3;i++) { [p removeAllPoints]; [p moveToPoint: NSMakePoint(100,100)]; [p lineToPoint: NSMakePoint(100,200)]; [p lineToPoint: NSMakePoint(200,200)]; [p lineToPoint: NSMakePoint(200,100)]; if (i==0) { str="(u) rect"; } else if (i==1) { [p closePath]; str="(c) rect"; } else { [p lineToPoint: NSMakePoint(100,100)]; [p closePath]; str="(d) rect"; } /* Obvious stuff. */ T(0,0,0) T(1,150,150) /* Check around each corner. */ CHECK_AROUND(100,100, 0,X,1, 0,X,X, 0,0,0) CHECK_AROUND(200,100, 1,X,0, X,X,0, 0,0,0) CHECK_AROUND(200,200, 0,0,0, X,X,0, 1,X,0) CHECK_AROUND(100,200, 0,0,0, 0,X,X, 0,X,1) if (!i) [p closePath]; } for (i=0;i<3;i++) { [p removeAllPoints]; [p moveToPoint: NSMakePoint(0,-100)]; [p lineToPoint: NSMakePoint(-100,0)]; [p lineToPoint: NSMakePoint(0,100)]; [p lineToPoint: NSMakePoint(100,0)]; if (i==0) { str="(u) tilted rect"; } else if (i==1) { [p closePath]; str="(c) tilted rect"; } else { [p lineToPoint: NSMakePoint(0,-100)]; [p closePath]; str="(d) tilted rect"; } /* Obvious stuff. */ T(1,0,0) T(0,200,200) /* Check around each corner. */ CHECK_AROUND(0,-100, 1,1,1, 0,X,0, 0,0,0) CHECK_AROUND(0,100, 0,0,0, 0,X,0, 1,1,1) CHECK_AROUND(-100,0, 0,0,1, 0,X,1, 0,0,1) CHECK_AROUND(100,0, 1,0,0, 1,X,0, 1,0,0) /* Check some points on the edges. */ CHECK_AROUND(50,50, X,0,0, 1,X,0, 1,1,X) CHECK_AROUND(-50,50, 0,0,X, 0,X,1, X,1,1) CHECK_AROUND(-50,-50, X,1,1, 0,X,1, 0,0,X) CHECK_AROUND(50,-50, 1,1,X, 1,X,0, X,0,0) } for (i=0;i<3;i++) { [p removeAllPoints]; [p moveToPoint: NSMakePoint(200,200)]; [p lineToPoint: NSMakePoint(200,100)]; [p lineToPoint: NSMakePoint(100,100)]; [p lineToPoint: NSMakePoint(100,200)]; if (i==2) [p lineToPoint: NSMakePoint(200,200)]; if (i>=1) [p closePath]; [p moveToPoint: NSMakePoint(200,200)]; [p lineToPoint: NSMakePoint(300,200)]; [p lineToPoint: NSMakePoint(300,100)]; [p lineToPoint: NSMakePoint(200,100)]; if (i==2) [p lineToPoint: NSMakePoint(200,200)]; if (i>=1) [p closePath]; if (i==0) str="(u) touching rects"; else if (i==1) str="(c) touching rects"; else str="(d) touching rects"; /* Obvious stuff. */ T(0,0,0) T(1,150,150) T(1,250,150) /* Check around the touching corners and edge. */ CHECK_AROUND(200,200, 0,0,0, X,X,X, 1,1,1) CHECK_AROUND(200,100, 1,1,1, X,X,X, 0,0,0) CHECK_AROUND(200,150, 1,1,1, 1,1,1, 1,1,1) } for (i=0;i<3;i++) { [p removeAllPoints]; [p moveToPoint: NSMakePoint(-100,200)]; [p lineToPoint: NSMakePoint(100,200)]; [p lineToPoint: NSMakePoint(100,-200)]; [p lineToPoint: NSMakePoint(-100,-200)]; if (i==2) [p lineToPoint: NSMakePoint(-100,200)]; if (i>=1) [p closePath]; [p moveToPoint: NSMakePoint(200,100)]; [p lineToPoint: NSMakePoint(200,-100)]; [p lineToPoint: NSMakePoint(-200,-100)]; [p lineToPoint: NSMakePoint(-200,100)]; if (i==2) [p lineToPoint: NSMakePoint(200,100)]; if (i>=1) [p closePath]; if (i==0) str="(u) intersecting rects"; else if (i==1) str="(c) intersecting rects"; else str="(d) intersecting rects"; /* Obvious stuff. */ T(2,0,0) T(0,200,200) T(1,150,0) T(1,0,150) } for (i=0;i<3;i++) { [p removeAllPoints]; [p moveToPoint: NSMakePoint(200,0)]; [p lineToPoint: NSMakePoint(100,-100)]; [p lineToPoint: NSMakePoint(100,100)]; if (i==2) [p lineToPoint: NSMakePoint(200,0)]; if (i>=1) [p closePath]; [p moveToPoint: NSMakePoint(200,0)]; [p lineToPoint: NSMakePoint(300,100)]; [p lineToPoint: NSMakePoint(300,-100)]; if (i==2) [p lineToPoint: NSMakePoint(200,0)]; if (i>=1) [p closePath]; if (i==0) str="(u) touching triangles"; else if (i==1) str="(c) touching triangles"; else str="(d) touching triangles"; /* Obvious stuff. */ T(0,0,0) T(1,150,0) T(1,250,0) CHECK_AROUND(200,0, 1,0,1, 1,X,1, 1,0,1) } for (i=0;i<3;i++) { CLEAR [p removeAllPoints]; [p moveToPoint: NSMakePoint(100,100)]; [p lineToPoint: NSMakePoint(300,100)]; [p lineToPoint: NSMakePoint(100,-100)]; [p lineToPoint: NSMakePoint(300,-100)]; if (i==2) [p lineToPoint: NSMakePoint(100,100)]; if (i>=1) [p closePath]; // [view drawPath: p]; if (i==0) str="(u) self-intersection"; else if (i==1) str="(c) self-intersection"; else str="(d) self-intersection"; /* Obvious stuff. */ T(0,0,0) T(1,200,50) T(-1,200,-50) CHECK_AROUND(200,0, 0,1,0, 0,X,0, 0,-1,0) // [view pause]; } for (i=0;i<3;i++) { [p removeAllPoints]; [p moveToPoint: NSMakePoint(-100,200)]; [p lineToPoint: NSMakePoint(100,200)]; [p lineToPoint: NSMakePoint(100,-200)]; [p lineToPoint: NSMakePoint(-100,-200)]; if (i==2) [p lineToPoint: NSMakePoint(-100,200)]; if (i>=1) [p closePath]; [p moveToPoint: NSMakePoint(200,100)]; [p lineToPoint: NSMakePoint(200,-100)]; [p lineToPoint: NSMakePoint(-200,-100)]; [p lineToPoint: NSMakePoint(-200,100)]; if (i==2) [p lineToPoint: NSMakePoint(200,100)]; if (i>=1) [p closePath]; if (i==0) str="(u) intersecting rects"; else if (i==1) str="(c) intersecting rects"; else str="(d) intersecting rects"; /* Obvious stuff. */ T(2,0,0) T(0,200,200) T(1,150,0) T(1,0,150) /* Intersection corners. */ CHECK_AROUND(100,100, 1,X,0, X,X,X, 2,X,1) CHECK_AROUND(100,-100, 2,X,1, X,X,X, 1,X,0) CHECK_AROUND(-100,-100, 1,X,2, X,X,X, 0,X,1) CHECK_AROUND(-100,100, 0,X,1, X,X,X, 1,X,2) } for (i=0;i<3;i++) { // CLEAR [p removeAllPoints]; [p moveToPoint: NSMakePoint(100,100)]; [p curveToPoint: NSMakePoint(100,-100) controlPoint1: NSMakePoint(200,100) controlPoint2: NSMakePoint(200,-100)]; if (i==2) [p lineToPoint: NSMakePoint(100,100)]; if (i>=1) [p closePath]; // DRAWPATH if (i==0) str="(u) curve 1"; else if (i==1) str="(c) curve 1"; else str="(d) curve 1"; /* Obvious stuff. */ T(0,0,0) T(0,210,0) T(0,190,0) T(1,110,0) /* "Extreme" point is at 175, 0. This is at the half-way point, so any tesselation by the standard method should get it right. */ CHECK_AROUND(175, 0, 1,0,0, 1,X,0, 1,0,0) // PAUSE } for (i=0;i<3;i++) { CLEAR [p removeAllPoints]; [p moveToPoint: NSMakePoint(-100,100)]; [p curveToPoint: NSMakePoint(100,100) controlPoint1: NSMakePoint(-100,-100) controlPoint2: NSMakePoint(100,-100)]; [p lineToPoint: NSMakePoint(100,-100)]; [p curveToPoint: NSMakePoint(-100,-100) controlPoint1: NSMakePoint(100,100) controlPoint2: NSMakePoint(-100,100)]; if (i==2) [p lineToPoint: NSMakePoint(-100,100)]; if (i>=1) [p closePath]; DRAWPATH if (i==0) str="(u) curve 2"; else if (i==1) str="(c) curve 2"; else str="(d) curve 2"; /* Obvious stuff. */ T(-1,0,0) T(1,-90,0) T(1, 90,0) /* The two curves intersect at y=0, x= +- 400 * sqrt(3) / 9. */ CHECK_AROUND(-400*sqrt(3)/9, 0, 1,0,-1, 1,X,-1, 1,0,-1) CHECK_AROUND( 400*sqrt(3)/9, 0, -1,0,1, -1,X,1, -1,0,1) PAUSE } for (i=0;i<3;i++) { CLEAR [p removeAllPoints]; [p moveToPoint: NSMakePoint(100,100)]; [p curveToPoint: NSMakePoint(100,100) controlPoint1: NSMakePoint(100,200) controlPoint2: NSMakePoint(200,100)]; if (i==2) [p lineToPoint: NSMakePoint(100,100)]; if (i>=1) [p closePath]; DRAWPATH if (i==0) str="(u) curve 3"; else if (i==1) str="(c) curve 3"; else str="(d) curve 3"; /* Obvious stuff. */ T(0,0,0) T(1,105,105) CHECK_AROUND(100,100, 0,0,1, 0,X,0, 0,0,0) PAUSE } #endif for (i=0;i<3;i++) { CLEAR /* +-+ | | +-* | | | +---+ */ [p removeAllPoints]; [p moveToPoint: NSMakePoint(0,0)]; [p lineToPoint: NSMakePoint(0,100)]; [p lineToPoint: NSMakePoint(100,100)]; [p lineToPoint: NSMakePoint(100,-100)]; [p lineToPoint: NSMakePoint(-100,-100)]; [p lineToPoint: NSMakePoint(-100,0)]; if (i==2) [p lineToPoint: NSMakePoint(0,0)]; if (i>=1) [p closePath]; DRAWPATH if (i==0) str="(u) curve 3"; else if (i==1) str="(c) curve 3"; else str="(d) curve 3"; /* Obvious stuff. */ T(0,-5,5) T(1,5,-5) CHECK_AROUND(0,0, 0,X,1, X,X,1, 1,1,1) PAUSE } DESTROY(arp); return 0; } gnustep-gui-0.24.0/Tests/gui/NSBezierPath/basic.m0000664000076500007650000000755112115150376021376 0ustar brains99brains99#import "ObjectTesting.h" #import #import #import #include static BOOL eq(double d1, double d2) { if (abs(d1 - d2) < 0.000001) return YES; return NO; } int main() { NSAutoreleasePool *arp = [NSAutoreleasePool new]; id testObject; id testObject1; id testObject2; NSArray *testObjects; testObject = [NSBezierPath new]; testObject1 = [NSBezierPath bezierPathWithRoundedRect: NSMakeRect(0, 0, 20, 30) xRadius: 2.0 yRadius: 3.0]; testObject2 = [NSBezierPath new]; [testObject2 setLineWidth: 12.4]; [testObject2 setFlatness: 13.4]; [testObject2 setLineCapStyle: NSSquareLineCapStyle]; [testObject2 setLineJoinStyle: NSRoundLineJoinStyle]; [testObject2 setMiterLimit: 14.4]; [testObject2 setWindingRule: NSEvenOddWindingRule]; testObjects = [NSArray arrayWithObjects: testObject, testObject1, testObject2, nil]; RELEASE(testObject); RELEASE(testObject2); test_alloc(@"NSBezierPath"); test_NSObject(@"NSBezierPath", testObjects); test_NSCoding(testObjects); test_keyed_NSCoding(testObjects); test_NSCopying(@"NSBezierPath", @"NSBezierPath", testObjects, NO, NO); [arp release]; return 0; } @implementation NSBezierPath (Testing) - (BOOL) isEqual: (id)anObject { NSInteger i; NSBezierPathElement type1; NSPoint pts1[3]; NSBezierPathElement type2; NSPoint pts2[3]; if (self == anObject) return YES; if (![anObject isKindOfClass: [NSBezierPath class]]) return NO; if (!eq([self lineWidth], [anObject lineWidth])) { NSLog(@"different lineWidth %g %g", (float)[self lineWidth], (float)[anObject lineWidth]); return NO; } if (!eq([self flatness], [anObject flatness])) { NSLog(@"different flatness %g %g", (float)[self flatness], (float)[anObject flatness]); return NO; } if (!eq([self miterLimit], [anObject miterLimit])) { NSLog(@"different miterLimit %g %g", (float)[self miterLimit], (float)[anObject miterLimit]); return NO; } if ([self lineCapStyle] != [anObject lineCapStyle]) { NSLog(@"different lineCapStyle %d %d", [self lineCapStyle], [anObject lineCapStyle]); return NO; } if ([self lineJoinStyle] != [anObject lineJoinStyle]) { NSLog(@"different lineJoinStyle %d %d", [self lineJoinStyle], [anObject lineJoinStyle]); return NO; } if ([self windingRule] != [anObject windingRule]) { NSLog(@"different winding rule %d %d", [self windingRule], [anObject windingRule]); return NO; } if ([self elementCount] != [anObject elementCount]) { NSLog(@"different element count %d %d", [self elementCount], [anObject elementCount]); return NO; } for (i = 0; i < [self elementCount]; i++) { type1 = [self elementAtIndex: i associatedPoints: pts1]; type2 = [anObject elementAtIndex: i associatedPoints: pts2]; if (type1 != type2) { NSLog(@"different type count %d %d", type1, type2); return NO; } if (!eq(pts1[0].x, pts2[0].x) || !eq(pts1[0].y, pts2[0].y)) { NSLog(@"different point %@ %@", NSStringFromPoint(pts1[0]), NSStringFromPoint(pts2[0])); return NO; } if (type1 == NSCurveToBezierPathElement) { if (!eq(pts1[1].x, pts2[1].x) || !eq(pts1[1].y, pts2[1].y)) { NSLog(@"different point %@ %@", NSStringFromPoint(pts1[1]), NSStringFromPoint(pts2[1])); return NO; } if (!eq(pts1[2].x, pts2[2].x) || !eq(pts1[2].y, pts2[2].y)) { NSLog(@"different point %@ %@", NSStringFromPoint(pts1[2]), NSStringFromPoint(pts2[2])); return NO; } } } return YES; } @end gnustep-gui-0.24.0/Tests/gui/NSBezierPath/bounds.m0000664000076500007650000001061411356570271021607 0ustar brains99brains99/* copyright 2004 Alexander Malmberg */ #include "Testing.h" #include #include #include int main(int argc, char **argv) { CREATE_AUTORELEASE_POOL(arp); NSBezierPath *p=[[NSBezierPath alloc] init]; NSRect r; pass(NSIsEmptyRect([p bounds]),"empty path gives empty bounds"); [p moveToPoint: NSMakePoint(100,100)]; [p lineToPoint: NSMakePoint(150,150)]; pass(NSEqualRects([p bounds],NSMakeRect(100,100,50,50)),"bounds accuracy (1)"); pass(NSEqualRects([p controlPointBounds],NSMakeRect(100,100,50,50)),"control-point bounds accuracy (1)"); [p removeAllPoints]; pass(NSIsEmptyRect([p bounds]),"empty path gives empty bounds (2)"); [p moveToPoint: NSMakePoint(100,100)]; [p curveToPoint: NSMakePoint(200,100) controlPoint1: NSMakePoint(125,50) controlPoint2: NSMakePoint(175,150)]; /* Basic checking Y. */ r=[p bounds]; if (fabs(r.origin.x - 100.0000) > 0.001 || fabs(r.origin.y - 85.5662) > 0.001 || fabs(r.size.width - 100.0000) > 0.001 || fabs(r.size.height - 28.8678) > 0.001) { pass(0,"bounds accuracy (2)"); printf("expected %s, got %s\n", [NSStringFromRect(NSMakeRect(100.0000, 85.5662, 100.0000, 28.8678)) lossyCString], [NSStringFromRect(r) lossyCString]); } else pass(1,"bounds accuracy (2)"); pass(NSEqualRects([p controlPointBounds],NSMakeRect(100,50,100,100)),"control-point bounds accuracy (2)"); /* Basic checking X. */ [p removeAllPoints]; [p moveToPoint: NSMakePoint(100,100)]; [p curveToPoint: NSMakePoint(100,200) controlPoint1: NSMakePoint(50,125) controlPoint2: NSMakePoint(150,175)]; r=[p bounds]; if (fabs(r.origin.y - 100.0000) > 0.001 || fabs(r.origin.x - 85.5662) > 0.001 || fabs(r.size.height - 100.0000) > 0.001 || fabs(r.size.width - 28.8678) > 0.001) { pass(0,"bounds accuracy (3)"); printf("expected %s, got %s\n", [NSStringFromRect(NSMakeRect(85.5662, 100.0000, 28.8678, 100.0000)) lossyCString], [NSStringFromRect(r) lossyCString]); } else pass(1,"bounds accuracy (3)"); /* A bit of both, and extreme values beyond the initial points. */ [p removeAllPoints]; [p moveToPoint: NSMakePoint(-100,0)]; [p curveToPoint: NSMakePoint(100,0) controlPoint1: NSMakePoint(-118.2, 10.393) controlPoint2: NSMakePoint( 118.2,-10.393)]; r=[p bounds]; if (fabs(r.origin.x + 101.0) > 0.001 || fabs(r.origin.y + 3.0) > 0.001 || fabs(r.size.width - 202.0) > 0.001 || fabs(r.size.height - 6.0) > 0.001) { pass(0,"bounds accuracy (4)"); printf("expected %s, got %s\n", [NSStringFromRect(NSMakeRect(-101.0, -3.0, 202.0, 6.0)) lossyCString], [NSStringFromRect(r) lossyCString]); } else pass(1,"bounds accuracy (4)"); /* Check the control-point bounding box. */ r=[p controlPointBounds]; if (fabs(r.origin.x + 118.2 ) > 0.001 || fabs(r.origin.y + 10.393) > 0.001 || fabs(r.size.width - 236.4 ) > 0.001 || fabs(r.size.height - 20.786) > 0.001) { pass(0,"control-point bounds accuracy (3)"); printf("expected %s, got %s\n", [NSStringFromRect(NSMakeRect(-118.2, -10.393, 236.4, 20.786)) lossyCString], [NSStringFromRect(r) lossyCString]); } else pass(1,"control-point bounds accuracy (3)"); /* p=(1-t)^3*a + 3*(1-t)^2*t*b + 3*(1-t)*t^2*c + t^3*d c-2b+a +- sqrt(a(d-c)+b(-d-c)+c^2+b^2) t= -------------------------------------- -d+3c-3b+a */ if (0) { NSPoint a,b,c,d; double t1,t2; double t,ti; NSPoint p; a=NSMakePoint(-100,0); b=NSMakePoint(-118.2,10.39); c=NSMakePoint(118.2,-10.39); d=NSMakePoint(100,0); #define D \ ti=1.0-t; \ p.x=ti*ti*ti*a.x + 3*ti*ti*t*b.x + 3*ti*t*t*c.x + t*t*t*d.x; \ p.y=ti*ti*ti*a.y + 3*ti*ti*t*b.y + 3*ti*t*t*c.y + t*t*t*d.y; \ printf(" t=%15.7f (%15.7f %15.7f)\n",t,p.x,p.y); t=0; D t=1; D t=0.5; D t1=(c.x-2*b.x+a.x + sqrt(a.x*(d.x-c.x)+b.x*(-d.x-c.x)+c.x*c.x+b.x*b.x)) / (-d.x+3*c.x-3*b.x+a.x); t2=(c.x-2*b.x+a.x - sqrt(a.x*(d.x-c.x)+b.x*(-d.x-c.x)+c.x*c.x+b.x*b.x)) / (-d.x+3*c.x-3*b.x+a.x); printf("x:\n"); t=t1; D t=t2; D t1=(c.y-2*b.y+a.y + sqrt(a.y*(d.y-c.y)+b.y*(-d.y-c.y)+c.y*c.y+b.y*b.y)) / (-d.y+3*c.y-3*b.y+a.y); t2=(c.y-2*b.y+a.y - sqrt(a.y*(d.y-c.y)+b.y*(-d.y-c.y)+c.y*c.y+b.y*b.y)) / (-d.y+3*c.y-3*b.y+a.y); printf("y:\n"); t=t1; D t=t2; D } // printf("bounds=%@\n",NSStringFromRect([p bounds])); DESTROY(arp); return 0; } gnustep-gui-0.24.0/Tests/gui/NSImage/0000775000076500007650000000000012256227332017117 5ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/NSImage/TestInfo0000664000076500007650000000000012121715043020553 0ustar brains99brains99gnustep-gui-0.24.0/Tests/gui/NSImage/basic.m0000664000076500007650000000235212121715043020350 0ustar brains99brains99#import "ObjectTesting.h" #import #import #import #import int main() { NSAutoreleasePool *arp = [NSAutoreleasePool new]; id testObject; id testObject1; id testObject2; NSArray *testObjects; [NSApplication sharedApplication]; test_alloc(@"NSImage"); testObject = [NSImage new]; testObject1 = [NSImage imageNamed: @"GNUstep"]; testObject2 = [[NSImage alloc] initWithData: nil]; testObjects = [NSArray arrayWithObjects: testObject, testObject1, testObject2, nil]; RELEASE(testObject); test_NSObject(@"NSImage", testObjects); test_NSCoding(testObjects); test_keyed_NSCoding(testObjects); test_NSCopying(@"NSImage", @"NSImage", testObjects, NO, NO); [arp release]; return 0; } @implementation NSImage (Testing) - (BOOL) isEqual: (id)anObject { if (self == anObject) return YES; if (![anObject isKindOfClass: [NSImage class]]) return NO; if (![[anObject backgroundColor] isEqual: [self backgroundColor]]) return NO; if ([anObject isFlipped] != [self isFlipped]) return NO; if (!NSEqualSizes([anObject size], [self size])) return NO; // FIXME return YES; } @end gnustep-gui-0.24.0/Tests/GNUmakefile0000664000076500007650000000325611547653254017140 0ustar brains99brains99# # Tests Makefile for GNUstep GUI Library. # # Copyright (C) 2011 Free Software Foundation, Inc. # # Written by: Richard Frith-Macdonald # # This file is part of the GNUstep GUI Library. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU 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 # General Public License for more details. # # You should have received a copy of the GNU General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 51 Franklin Street, Fifth Floor, # Boston, MA 02111 USA # ifeq ($(GNUSTEP_MAKEFILES),) GNUSTEP_MAKEFILES := $(shell gnustep-config --variable=GNUSTEP_MAKEFILES 2>/dev/null) ifeq ($(GNUSTEP_MAKEFILES),) $(warning ) $(warning Unable to obtain GNUSTEP_MAKEFILES setting from gnustep-config!) $(warning Perhaps gnustep-make is not properly installed,) $(warning so gnustep-config is not in your PATH.) $(warning ) $(warning Your PATH is currently $(PATH)) $(warning ) endif endif ifeq ($(GNUSTEP_MAKEFILES),) $(error You need to set GNUSTEP_MAKEFILES before running this!) endif include $(GNUSTEP_MAKEFILES)/common.make all:: @(echo If you want to run the gnustep-gui testsuite, please type \'make check\') check:: gnustep-tests gui clean:: gnustep-tests --clean include $(GNUSTEP_MAKEFILES)/rules.make gnustep-gui-0.24.0/Headers/0000775000076500007650000000000012256227327015325 5ustar brains99brains99gnustep-gui-0.24.0/Headers/Additions/0000775000076500007650000000000012256227327017243 5ustar brains99brains99gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/0000775000076500007650000000000012256227330021127 5ustar brains99brains99gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSHelpManagerPanel.h0000664000076500007650000000267111357044577024716 0ustar brains99brains99/* GSHelpManagerPanel.h GSHelpManagerPanel displays a help message for an item. Copyright (C) 1999 Free Software Foundation, Inc. Author: Pedro Ivo Andrade Tavares Date: September 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSHelpManagerPanel #define _GNUstep_H_GSHelpManagerPanel #import @class NSTextView; @class NSAttributedString; @interface GSHelpManagerPanel: NSPanel { NSTextView *textView; } +sharedHelpManagerPanel; -(void)setHelpText: (NSAttributedString*)helpText; - (void)buttonAction:(id)sender; @end #endif // _GNUstep_H_GSHelpManagerPanel gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GMArchiver.h0000664000076500007650000001571711357044577023315 0ustar brains99brains99/* GMArchiver.h Author: Ovidiu Predescu Date: October 1997 Copyright (C) 1997 Free Software Foundation, Inc. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Portions of the code are based on NSArchiver from libFoundation. See the COPYING file from libFoundation for copyright information. */ #ifndef __GMArchiver_h__ #define __GMArchiver_h__ #ifndef GNUSTEP #import #else #import #import #import #endif @class NSString; @class NSData; @class NSArray; @class NSDictionary; @class NSHashTable; @class NSMapTable; @class NSMutableArray; @class NSMutableDictionary; @class GMArchiver; @class GMUnarchiver; /* The objects that want to be archived the following protocol. */ @protocol ModelCoding /* These methods are much like those from the NSCoding protocol. The difference is that you can specify names for the instance variables or attributes you encode. The recommended way is not to encode instance variables but attributes so that an archive file does not depend on the particular version of a class or on different instance variable names of the class from another implementation. */ - (void)encodeWithModelArchiver:(GMArchiver*)archiver; - (id)initWithModelUnarchiver:(GMUnarchiver*)unarchiver; @end @interface NSObject (ModelArchivingMethods) - (id)replacementObjectForModelArchiver:(GMArchiver*)archiver; - (Class)classForModelArchiver; + (id)createObjectForModelUnarchiver:(GMUnarchiver*)unarchiver; @end @interface GMArchiver : NSObject { NSMutableDictionary* propertyList; NSMutableArray* topLevelObjects; id lastObjectRepresentation; NSMapTable* objects; // object -> name NSHashTable* conditionals; // conditional objects NSMapTable* classes; // real classname -> class info int counter; int level; BOOL writingRoot; // YES if encodeRootObject:withName: was sent BOOL findingConditionals; // YES if finding conditionals } /* Initializing an GMArchiver */ - (id)init; /* Archiving Data */ + (BOOL)archiveRootObject:(id)rootObject toFile:(NSString*)path; - (BOOL)writeToFile:(NSString*)path; /* Getting the property list representation from the GMArchiver */ - (id)propertyList; /* Encoding objects */ - (id)encodeRootObject:(id)rootObject withName:(NSString*)name; - (id)encodeConditionalObject:(id)object withName:(NSString*)name; - (id)encodeObject:(id)anObject withName:(NSString*)name; - (id)encodeString:(NSString*)anObject withName:(NSString*)name; - (id)encodeArray:(NSArray*)array withName:(NSString*)name; - (id)encodeDictionary:(NSDictionary*)dictionary withName:(NSString*)name; - (id)encodeData:(NSData*)anObject withName:(NSString*)name; - (id)encodeClass:(Class)class withName:(NSString*)name; - (id)encodeSelector:(SEL)selector withName:(NSString*)name; /* Encoding the most common C types */ - (void)encodeChar:(char)value withName:(NSString*)name; - (void)encodeUnsignedChar:(unsigned char)value withName:(NSString*)name; - (void)encodeBOOL:(BOOL)value withName:(NSString*)name; - (void)encodeShort:(short)value withName:(NSString*)name; - (void)encodeUnsignedShort:(unsigned short)value withName:(NSString*)name; - (void)encodeInt:(int)value withName:(NSString*)name; - (void)encodeUnsignedInt:(unsigned int)value withName:(NSString*)name; - (void)encodeLong:(long)value withName:(NSString*)name; - (void)encodeUnsignedLong:(unsigned long)value withName:(NSString*)name; - (void)encodeFloat:(float)value withName:(NSString*)name; - (void)encodeDouble:(double)value withName:(NSString*)name; /* Encoding geometry types */ - (void)encodePoint:(NSPoint)point withName:(NSString*)name; - (void)encodeSize:(NSSize)size withName:(NSString*)name; - (void)encodeRect:(NSRect)rect withName:(NSString*)name; /* Substituting One Class for Another */ - (NSString*)classNameEncodedForTrueClassName:(NSString*)trueName; - (void)encodeClassName:(NSString*)trueName intoClassName:(NSString*)inArchiveName; @end /* GMArchiver */ @interface GMUnarchiver : NSObject { NSMutableDictionary* propertyList; id currentDecodedObjectRepresentation; NSMutableDictionary* namesToObjects; // object name -> object int level; int version; NSZone* objectZone; } /* Initializing an GMUnarchiver */ + (id)unarchiverWithContentsOfFile:(NSString*)filename; - (id)initForReadingWithPropertyList:(id)propertyList; /* Decoding Objects */ + (id)unarchiveObjectWithName:(NSString*)name fromPropertyList:(id)propertyList; + (id)unarchiveObjectWithName:(NSString*)name fromFile:(NSString*)path; /* Decoding objects */ - (id)decodeObjectWithName:(NSString*)name; - (NSString*)decodeStringWithName:(NSString*)name; - (NSArray*)decodeArrayWithName:(NSString*)name; - (NSDictionary*)decodeDictionaryWithName:(NSString*)name; - (NSData*)decodeDataWithName:(NSString*)name; - (Class)decodeClassWithName:(NSString*)name; - (SEL)decodeSelectorWithName:(NSString*)name; /* Decoding the most common C types */ - (char)decodeCharWithName:(NSString*)name; - (unsigned char)decodeUnsignedCharWithName:(NSString*)name; - (BOOL)decodeBOOLWithName:(NSString*)name; - (short)decodeShortWithName:(NSString*)name; - (unsigned short)decodeUnsignedShortWithName:(NSString*)name; - (int)decodeIntWithName:(NSString*)name; - (unsigned int)decodeUnsignedIntWithName:(NSString*)name; - (long)decodeLongWithName:(NSString*)name; - (unsigned long)decodeUnsignedLongWithName:(NSString*)name; - (float)decodeFloatWithName:(NSString*)name; - (double)decodeDoubleWithName:(NSString*)name; /* Decoding geometry types */ - (NSPoint)decodePointWithName:(NSString*)name; - (NSSize)decodeSizeWithName:(NSString*)name; - (NSRect)decodeRectWithName:(NSString*)name; /* Managing an GMUnarchiver */ - (BOOL)isAtEnd; - (NSZone*)objectZone; - (void)setObjectZone:(NSZone*)zone; - (unsigned int)systemVersion; /* Substituting One Class for Another */ + (NSString*)classNameDecodedForArchiveClassName:(NSString*)nameInArchive; + (void)decodeClassName:(NSString*)nameInArchive asClassName:(NSString*)trueName; - (NSString*)classNameDecodedForArchiveClassName:(NSString*)nameInArchive; - (void)decodeClassName:(NSString*)nameInArchive asClassName:(NSString*)trueName; - (unsigned int)versionForClassName:(NSString*)className; @end #endif /* __GMArchiver_h__ */ gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSVersion.h.in0000664000076500007650000000252010711446641023565 0ustar brains99brains99/* GSVersion.h Define version of GNUstep GUI Library Copyright (C) 2001 Free Software Foundation, Inc. Author: Nicola Pero Date: 2001 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef GNUSTEP_GUI_VERSION #define GNUSTEP_GUI_VERSION @GNUSTEP_GUI_VERSION@ #define GNUSTEP_GUI_MAJOR_VERSION @GNUSTEP_GUI_MAJOR_VERSION@ #define GNUSTEP_GUI_MINOR_VERSION @GNUSTEP_GUI_MINOR_VERSION@ #define GNUSTEP_GUI_SUBMINOR_VERSION @GNUSTEP_GUI_SUBMINOR_VERSION@ #endif /* GNUSTEP_GUI_VERSION */ gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSTheme.h0000664000076500007650000014761012227437021022603 0ustar brains99brains99/** GSTheme Useful/configurable drawing functions Copyright (C) 2004-2006 Free Software Foundation, Inc. Author: Adam Fedor Author: Richard Frith-Macdonald Date: Jan 2004 This file is part of the GNU Objective C User interface library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. The theme management system

The theme management system for the GNUstep GUI is based around the [GSTheme] class, which provides support for loading of theme bundles and methods for drawing common user interface elements.
The theme system works in conjunction with a variety of other GUI classes and is intended to eventually allow for very major changes in GUI appearance and behavior.

Various design imperatives apply to the theme system, but probably the key ones are:

It should allow designers and other non-technical users to easily develop new and interesting GUI styles likely to attract new users to GNUstep. Using and switching between themes should be an easy and pleasant experience ... so that people are not put off when they try using themes. It should eventually permit a GNUstep application to appear as a native application on ms-windows and other systems.

To attain these aims implies the recognition of some more specific objectives and some possible technical solutions:

We must have as simple as possible an API for the functions handling the way GUI elements work and the way they draw themselves.
The standard OpenStep/MacOS-X API provides mechanisms for controlling the colors used to draw controls (via [NSColor] and [NSColorList]) and controlling the way controls behave (NSInterfaceStyleForKey() and [NSResponder-interfaceStyle]), but we need to extend that with methods to draw controls entirely differently if required.
We must have a GUI application for theme development. It is not sufficient to provide an API if we want good graphic designers and user interface specialists to develop themes for us. It must be possible for an application to dynamically change the theme in use while it is running and it should be easy for a user to select between available themes.
This implies that themes must be loadable bundles and that it must always be possible to unload a theme as well as loading one.
It suggests that the theme selection mechanism should be in every application, perhaps as an extension to an existing panel such as the info panel.
Types of theming

There are various aspects of theming which can be treated pretty much separately, so there is no reason why a theme might not be created which just employs one of these mechanisms.

System images Possibly the simples theme change ... a theme might supply a new set of system images used for arrows and other icons that the GUI decorates controls with. System colors A theme might simply define a new system color list, so that controls are drawn in a new color range, though they would still function the same way. Even specifying new colors can make the GUI look quite different though.
Beyond system colors, the theming API also provides a mechanism for specifying colors for particular parts of GUI controls.
Image tiling Controls might be given sets of images used as tiling to draw themselves rather than using the standard line drawing and color fill mechanisms. Interface style A theme might supply a set of interface style keys for various controls, defining how those controls should behave subject to the limitation of the range of behaviors coded into the GUI library. Method override A theme might actually provide code, in the form of a subclass of [GSTheme] such that drawing methods have completely custom behavior.
Subclassing GSTheme

While many themes can be created without subclassing GSTheme, there are some cases where writing code is necessary (most notably when interfacing to a native theming engine for some platform in order to make a GNUstep app have a native look).
In these cases the subclass should follow certain rules in order to operate cleanly and efficiently:

Stability Theme operation should remain consistent while it is in use, particularly in the provision of resources such as images and colors.
If a theme needs to change a resource (such as an image) then it should do so by calling -deactivate, making the change, and then calling -activate. This sequence ensures that the GUI library is made aware of any changes and can redraw the screen.
The deactivation/activation sequence is expensive, so the subclass should attempt to combine multiple resource updates into a group rather than performing the deactivation/activation for each resource individually.
Activation The standard -activate method replaces existing system images, colors, interface style settings and other user defaults settings with versions stored in the theme bundle.
If a subclass wishes to dynamically provide these resources rather than supplying them as static information in the bundle, it may update the in-memory information after the normal operation has taken place. This should be done by the theme registering itsself as an observer of GSThemeWillActivateNotification and adding the resources just before the theme becomes active.
Cleanup may be done in response to a GSThemeWillDeactivateNotification (called before the default cleanup) or a GSThemeDidDeactivateNotification (called after the default cleanup).
Versioning With a theme which contains only static resources, versioning is not much of an issue, but with a code-based theme (ie where you subclass GSTheme) versioning does become very important. This is because, while you can load code from a bundle, you can't unload it again ... so if you have two versions of a theme where the subclass has the same name, then you have a conflict and can't load both and swap between the two.
Thematic.app solves this problem my incorporating a version number into the name of the GSTheme subclasses it creates, but that's not the only consideration...
You must also ensure that either you do not define any other classes in your theme or that, if you do define them you make sure that each of them incorporates the theme version number.
A similar consideration would apply to any categories, however category conflicts are far more difficult to resolve since even with different version names of the categories, the categories all effect the same class/methods. In fact this issue is so tricky to deal with that you should simply not use categories within your theme code.
To work around this limitation, the GSTheme class supports overriding of the methods of any other class while the theme is active. See the -overriddenMethod:for: method for more information.
Image override System images (those returned by the [NSImage+imageNamed:] method) are handled by the default theming mechanism, for each system image supplied in the theme bundle, the image is loaded from the bundle and used while the theme is active. Any pre-existing in-memory image is saved on theme activation and restored on theme deactivation.
A theme subclass may override the -imageClass method to change the class used to load each image from the bundle ... thus allowing customisation of not just the images but also of the image behavior in the (very rare) cases where this is desirable.
*/ #ifndef _GNUstep_H_GSTheme #define _GNUstep_H_GSTheme #import #import #import #import // For gradient types #import // For image frame style #import // For scroller constants #import // For segmented control style constants #import // For tab view type #import #if OS_API_VERSION(GS_API_NONE,GS_API_NONE) @class NSArray; @class NSBundle; @class NSDictionary; @class NSButton; @class NSColor; @class NSColorList; @class NSColorWell; @class NSImage; @class NSMenuItemCell; @class NSPopUpButtonCell; @class NSMenuView; @class NSProgressIndicator; @class NSTableHeaderCell; @class NSTabViewItem; @class GSDrawTiles; @class GSTitleView; APPKIT_EXPORT NSString *GSSwitch; APPKIT_EXPORT NSString *GSRadio; /* First, declare names used for obtaining colors and/or tiles for specific * controls and parts of controls. */ /* Names for the component parts of a scroller, * allowing tiles and/or colors to be set for them. */ APPKIT_EXPORT NSString *GSScrollerDownArrow; APPKIT_EXPORT NSString *GSScrollerHorizontalKnob; APPKIT_EXPORT NSString *GSScrollerHorizontalSlot; APPKIT_EXPORT NSString *GSScrollerLeftArrow; APPKIT_EXPORT NSString *GSScrollerRightArrow; APPKIT_EXPORT NSString *GSScrollerUpArrow; APPKIT_EXPORT NSString *GSScrollerVerticalKnob; APPKIT_EXPORT NSString *GSScrollerVerticalSlot; /* Names for table view parts */ APPKIT_EXPORT NSString *GSTableHeader; APPKIT_EXPORT NSString *GSTableCorner; /* * Browser part names. */ APPKIT_EXPORT NSString *GSBrowserHeader; /* * Menu part names. */ APPKIT_EXPORT NSString *GSMenuHorizontalBackground; APPKIT_EXPORT NSString *GSMenuVerticalBackground; APPKIT_EXPORT NSString *GSMenuTitleBackground; APPKIT_EXPORT NSString *GSMenuHorizontalItem; APPKIT_EXPORT NSString *GSMenuVerticalItem; APPKIT_EXPORT NSString *GSMenuSeparatorItem; /* NSPopUpButton parts */ APPKIT_EXPORT NSString *GSPopUpButton; /* * Progress Indicator part names. */ APPKIT_EXPORT NSString *GSProgressIndicatorBezel; APPKIT_EXPORT NSString *GSProgressIndicatorBarDeterminate; /* * Color well part names. */ APPKIT_EXPORT NSString *GSColorWell; APPKIT_EXPORT NSString *GSColorWellInnerBorder; /* NSSliderCell parts */ APPKIT_EXPORT NSString *GSSliderHorizontalTrack; APPKIT_EXPORT NSString *GSSliderVerticalTrack; /* NSBox parts */ APPKIT_EXPORT NSString *GSBoxBorder; /* NSTabView parts */ APPKIT_EXPORT NSString *GSTabViewSelectedTabFill; APPKIT_EXPORT NSString *GSTabViewUnSelectedTabFill; APPKIT_EXPORT NSString *GSTabViewBackgroundTabFill; APPKIT_EXPORT NSString *GSTabViewBottomSelectedTabFill; APPKIT_EXPORT NSString *GSTabViewBottomUnSelectedTabFill; APPKIT_EXPORT NSString *GSTabViewBottomBackgroundTabFill; APPKIT_EXPORT NSString *GSTabViewLeftSelectedTabFill; APPKIT_EXPORT NSString *GSTabViewLeftUnSelectedTabFill; APPKIT_EXPORT NSString *GSTabViewLeftBackgroundTabFill; APPKIT_EXPORT NSString *GSTabViewRightSelectedTabFill; APPKIT_EXPORT NSString *GSTabViewRightUnSelectedTabFill; APPKIT_EXPORT NSString *GSTabViewRightBackgroundTabFill; /** * Structure to describe the size of top/bottom/left/right margins inside * a button */ typedef struct GSThemeMargins { CGFloat left; CGFloat right; CGFloat top; CGFloat bottom; } GSThemeMargins; /** * This defines how the values in a tile array should be used when * drawing a rectangle. Mostly this just effects the center, middle * image of the rectangle.
* FillStyleMatrix is provided for the use of theme editors wishing * to display the tile. */ typedef enum { GSThemeFillStyleNone = 0, /** CM image is not drawn */ GSThemeFillStyleScale = 1, /** CM image is scaled to fit */ GSThemeFillStyleRepeat = 2, /** CM image is tiled from bottom left */ GSThemeFillStyleCenter = 3, /** CM image is tiled from the center */ GSThemeFillStyleMatrix = 4, /** a matrix of nine separated images */ GSThemeFillStyleScaleAll = 5 /** All 'stretchable' images (i.e. not the four corners) are scaled to fill their area, instead of being repeated */ } GSThemeFillStyle; /** Function to convert a fill style enumeration value to a string.
* Returns nil on failure. */ extern NSString * GSThemeStringFromFillStyle(GSThemeFillStyle s); /** Function to convert a string to a fill style enumeration value.
* Returns GSThemeFillStyleNone if the string is not a valid name. */ extern GSThemeFillStyle GSThemeFillStyleFromString(NSString *s); /** * This enumeration provides constants for informing drawing methods * what state a control is in (and consequently how the display element * being drawn should be presented). * NB. GSThemeNormalState must be 0 and GSThemeSelectedState must be the * last state, in order to allow code to iterate through all the states. */ typedef enum { GSThemeNormalState = 0, /** A control in its normal state */ GSThemeFirstResponderState, GSThemeDisabledState, /** A control which is disabled */ GSThemeHighlightedFirstResponderState, GSThemeHighlightedState, /** A control which is highlighted */ GSThemeSelectedFirstResponderState, GSThemeSelectedState /** A control which is selected */ } GSThemeControlState; /** Notification sent when a theme has just become active.
* The notification is posted by the -activate method.
* This is primarily for internal use by AppKit controls which * need to readjust how they are displayed when a new theme is in use.
* Theme subclasses must ensure that the theme is ready for use by the * time this notification is posted (which generally means that * they should have finished putting all resources in place in * response to a GSThemeWillActivateNotification). */ APPKIT_EXPORT NSString *GSThemeDidActivateNotification; /** Notification sent when a theme has just become inactive.
* The notification is posted by the -deactivate method.
* This is primarily for use by subclasses of GSTheme which need to perform * additional cleanup after the theme stops being used. */ APPKIT_EXPORT NSString *GSThemeDidDeactivateNotification; /** Notification sent when a theme is about to become active.
* The notification is posted by the -activate method.
* This is for use by subclasses of GSTheme which need to perform * additional setup before the theme starts being used by AppKit controls.
* At the point when this notification is called, the color, image, and * defaults information from the theme will have been installed and the * theme subclass may perform final adjustments. */ APPKIT_EXPORT NSString *GSThemeWillActivateNotification; /** Notification sent when a theme is about to become inactive.
* The notification is posted by the -deactivate method.
* This allows code to make preparatory changes before the current theme * is deactivated, but subclasses should not make the theme unusable * at this point as the AppKit may be doing its own cleanup in response * to the notification. */ APPKIT_EXPORT NSString *GSThemeWillDeactivateNotification; /**

This interface is HIGHLY unstable and incomplete at present.

This is a class used for 'theming', which is mostly a matter of encapsulating common drawing behaviors so that GUI appearance can be easily modified, but also includes mechanisms for altering some GUI behavior (such as orientation and position of menus).

Methods in this class standardize drawing of buttons, borders and other common GUI elements, so that all other classes within the GUI will provide a consistent appearance by using these methods.

The default implementation uses the standard configurable colors defined in NSColor, such as controlLightHighlightColor, controlShadowColor and controlDarkShadowColor.
Themes are expected to override the default system color list with their own versions, and this class cooperates with [NSColor] and [NSColorList] to establish the correct system color list when a theme is activated.

The class provides a mechanism for automatic loading of theme bundles consisting of resources used to define how drawing is done, plus an optional binary subclass of this class (to replace/extend the drawing methods this class provides).

In future this class should provide mechanisms to draw controls by tiling of images, and provide control over GUI behavior by controlling the values returned by NSInterfaceStyleForKey() so that controls use the appropriate behavior.

*/ @interface GSTheme : NSObject { @private void *_reserved; } /** * Loads a theme from a theme bundle of the specified name, which may be * either a full path name of the theme bundle, or a simple theme name * (in which case the standard directories are searched for it) or nil * (in which case the default GNUstep theme is returned).
* Returns the loaded theme but does not make it the current theme, * to do that you will need to call the +setTheme: method. */ + (GSTheme*) loadThemeNamed: (NSString*)themeName; /** * Creates and displays a panel allowing selection of different themes * and display of the current theme inspector. */ + (void) orderFrontSharedThemePanel: (id)sender; /** * Set the currently active theme to be the instance specified.
* You do not normally need to call this method as it is called * automatically when the user default which specifies the current * theme (GSTheme) is updated. */ + (void) setTheme: (GSTheme*)theme; /** * Returns the currently active theme instance. This is the value most * recently set using +setTheme: or (if none has been set) is a default * instance of the base class. */ + (GSTheme*) theme; /** *

This method is called automatically when the receiver is made into * the currently active theme by the +setTheme: method. Subclasses may * override it to perform startup operations, however, the method is not * really intended to be overridden, and subclasses should generally * handle activation work in response to the GSThemeWillActivatenotification * posted by this method. *

*

The base implementation handles setup and caching of the system * color list, standard image information, tiling information, * and user defaults.
* It then sends a GSThemeWillActivateNotification to allow subclasses to * perform further activation work, and a GSThemeDidActivateNotification * to allow other parts of the GUI library to update themselves from the * new theme. *

*

Finally, this method marks all windows in the application as needing * update ... so they will draw themselves with the new theme information. *

*

NB. If a GSTheme subclass is integrating to an external native theming * mechanism in order to make GNUstep apps look like native apps, then the * external theme may change dynamically and the GSTheme subclass may need * to change the GNUstep application to reflect this change. When this * happens, the update should be handled by the subclass calling -deactivate * and then -activate to make the changes 'live'. *

*/ - (void) activate; /** * Returns the names of the theme's authors. */ - (NSArray*) authors; /** * Return the bundle containing the resources used by the current theme. */ - (NSBundle*) bundle; /** * Returns the class used by the theme for loading color lists. The default * implementation returns the NSColorList class, but a subclass may override * this to return a color list class whose values change dynamically in * response to changes of a native theming API for instance.
* The class returned by this method should be NSColorList or one of its * subclasses. Subclasses should note that GSTheme will initialise the * instances of the class using the [NSColerList-initWithName:fromFile:] * method. */ - (Class) colorClass; /** Removes the name from the color cache forcing it to be re-created next * time the named color is required.
* Passing nil for aName removes all named colors.
* Passing a negative value for elementState applies to all caches. */ - (void) colorFlush: (NSString*)aName state: (GSThemeControlState)elementState; /** * This returns the color for drawing the item whose name is aName in * the specified state. If aName is nil or if there is no color defined * for the particular combination of item name and state, the method * returns nil.
* The standard names used for the parts of various controls are declared * in GSTheme.h
* See also the -tilesNamed:state: method. */ - (NSColor*) colorNamed: (NSString*)aName state: (GSThemeControlState)elementState; /** * Returns the system color list defined by the receiver.
* The default implementation returns the color list provided in the * theme bundle (if any) or the default system color list. */ - (NSColorList*) colors; /** *

This method is called automatically when the receiver is stopped from * being the currently active theme by the use of the +setTheme: method * to make another theme active. Subclasses may override it to perform * shutdown operations, but it is preferred for subclasses to perform * their own deactivation in response to a GSThemeWillDeactivateNotification. *

*

The base implementation sends a GSThemeWillDeactivateNotification to * allow subclasses to perform cleanup, then restores image, color and default * information to the state before the theme was activates, and finally * sends a GSThemeDidDeactivateNotification to allow other parts of the * GUI library to update themselves. *

*

NB. If a GSTheme subclass is integrating to an external native theming * mechanism in order to make GNUstep apps look like native apps, then the * external theme may change dynamically and the GSTheme subclass may need * to change the GNUstep application to reflect this change. When this * happens, the update should be handled by the subclass calling -deactivate * and then -activate to make the changes 'live'. *

*/ - (void) deactivate; /** * Returns the theme's icon. */ - (NSImage*) icon; /** * Returns the class used by the theme for loading images. The default * implementation returns the NSImage class, but a subclass may override * this to return an image class whose instances dynamically alter what * they draw in response to changes of a native theming API for instance.
* This method must return the NSImage class or one of its subclasses. * Subclass implementations should note that instances will be initialised * using the [NSImage-initWithContentsOfFile:] method and will use the * [NSImage-imageFileTypes] method to determine which image files can be * loaded. */ - (Class) imageClass; /** * Initialise an instance of a theme with the specified resource bundle.
* You don't need to call this method directly, but if you are subclassing * you may need to override this to provide additional initialisation. */ - (id) initWithBundle: (NSBundle*)bundle; /** *

Returns the info dictionary for this theme. In the base class * implementation this is simply the info dictionary of the theme * bundle, but subclasses may override this method to return extra * or different information. *

*

Keys found in this dictionary include: *

* * GSThemeDomain * A dictionary whose key/value pairs are used to set up new values * in the GSThemeDomain domain of the user defaults system, and hence * define values for these unless overridden by values set explicitly by * the user. * * GSThemeTiles * A dictionary keyed on tile names and containing the following: * * FileName * Name of the file (within the GSThemeTiles directory in the * bundle) in which the image for this tile is stored. * * HorizontalDivision * The offset along the X-axis used to divide the image into * columns of tiles. * * VerticalDivision * The offer along the Y-axis used to divide the image into * rows of tiles. * * * * */ - (NSDictionary*) infoDictionary; /** * Return the theme's name. */ - (NSString*) name; /** Returns the name used to locate theming resources for a particular GUI * element. If no name has been set for the particular object this method * returns nil. */ - (NSString*) nameForElement: (id)anObject; /**

Returns the original implementation of a method overridden by this * theme, or zero if the method was not overridden. *

*

A theme may override a method of another class by implementing a method * whose name is '_overrideXXXMethod_YYY' where 'XXX' is the name of the * class whose method is to be overridden, and 'YYY' is the normal name of * the method in that class.
* eg. _overrideNSScrollerMethod_drawRect: *

*

NB. The overriding method may not access instance variable directly and * must cast all uses of 'self' to be the correct class. *

*/ - (IMP) overriddenMethod: (SEL)selector for: (id)receiver; /** Set the name of this theme ... used for testing by Thematic.app */ - (void) setName: (NSString*)aString; /** Set the name that is used to identify theming resources for a particular * control or other GUI element. This is used so that where an element is * part of a control it can be displayed differently from the same class of * element used outside that control.
* Supplying a nil value for aString simply removes any name setting for * anObject.
* Supplying nil for anObject is illegal (raises an exception) unless * the value of aString is also nil (and the method does nothing).
* Any control which uses this method to set names for subsidiary elements * must also make sure to remove the name mapping before that element is * deallocated, unless the takeOwnership option is YES, in which case * anObject is retained, the name mapping lasts only until the receiver * is deactivated, and at that point anObject is released. */ - (void) setName: (NSString*)aString forElement: (id)anObject temporary: (BOOL)takeOwnership; /** *

Provides a standard inspector window used to display information about * the receiver. The default implementation displays the icon, the name, * and the authors of the theme. *

*

The code managing this object (if any) must be prepared to have the * content view of the window re-parented into another window for display * on screen. *

*/ - (NSWindow*) themeInspector; /** Removes the name tile images from cache, forcing re-creation next * time the named tiles are required.
* Passing nil for aName removes all named tiles.
* Passing a negative value for elementState applies to all caches. */ - (void) tilesFlush: (NSString*)aName state: (GSThemeControlState)elementState; /** * Returns the tile image information for a particular image name, * or nil if there is no such information or the name is nil.
* The standard names used for the parts of various controls are declared * in GSTheme.h
* The GUI library uses this internally to handling tiling of image * information to draw user interface elements. The tile information * returned by this method can be passed to the * -fillRect:withTiles:background:fillStyle: method.
* The elementState argument specifies the state for which tiles are * requested. * See the -colorNamed:state: method for determining colors to be * used for drawing specific GUI elements. */ - (GSDrawTiles*) tilesNamed: (NSString*)aName state: (GSThemeControlState)elementState; /** * Return the theme's version string. */ - (NSString*) versionString; /** * Return the theme's license. */ - (NSString*) license; @end /** * Theme drawing methods.
* Methods which return information/resources are generally expected * (ie unless explicitly documented otherwise) to be returning something * which persists until the method is called again or until the current * theme is deactivated (whichever comes first).
* This means that drawing code should not need to * retain/release any returned object (the theme is responsible for * retaining the object), and should also be able to cache size information * etc for later drawing.
* This simple rule means that drawing code can be written to be as * efficient as possible while keeping caching strategies simple and * uniform.
* To facilitate this within the theme code itsself, it is recommended * that you make use of the -setName:forElement:temporary: method to * retain any vended object until deactivation. */ @interface GSTheme (Drawing) /** * Allows the theme to set an image or set attributes for drawing the * button differently based on the key equivalent which is set. */ - (void) setKeyEquivalent: (NSString *)key forButtonCell: (NSButtonCell *)cell; /** * Draws a button frame and background (not its content) for the specified * cell and view. */ - (void) drawButton: (NSRect)frame in: (NSCell*)cell view: (NSView*)view style: (int)style state: (GSThemeControlState)state; /** * Amount by which the button is inset by the border. */ - (GSThemeMargins) buttonMarginsForCell: (NSCell*)cell style: (int)style state: (GSThemeControlState)state; /** * Draws the indicator (normally a dotted rectangle) to show that * the view currently has keyboard focus. */ - (void) drawFocusFrame: (NSRect)frame view: (NSView*)view; /** * Draws the background of a window ... normally a simple fill with the * the window's background color. */ - (void) drawWindowBackground: (NSRect)frame view: (NSView*)view; /** * Draw a border of the specified border type. */ - (void) drawBorderType: (NSBorderType)aType frame: (NSRect)frame view: (NSView*)view; /** * Determine the size for the specified border type . */ - (NSSize) sizeForBorderType: (NSBorderType)aType; /** * Draw a border of the specified frame style. */ - (void) drawBorderForImageFrameStyle: (NSImageFrameStyle)frameStyle frame: (NSRect)frame view: (NSView*)view; /** * Determine the size for the specified frame style. */ - (NSSize) sizeForImageFrameStyle: (NSImageFrameStyle)frameStyle; /** * Return YES if the scroller arrows are at the same end. * Return NO to get one scroller arrow at each end of the scroller. * * The default implementation first checks the default GSScrollerArrowsSameEnd * and if that is not set, delegates to the NSInterfaceStyle. */ - (BOOL) scrollerArrowsSameEndForScroller: (NSScroller *)aScroller; /** * Returns YES if clicking in the scroller slot should scroll by one page, * NO if the scroller should jump to the location clicked. * * The default implementation first checks the default GSScrollerScrollsByPage * and if that is not set, delegates to the NSInterfaceStyle. */ - (BOOL) scrollerScrollsByPageForScroller: (NSScroller *)aScroller; /** * Creates and returns the cell to be used to draw a scroller arrow of the * specified type and orientation.
* The theme instance is responsible for ensuring that the cell continues * to exist until the theme is deactivated (the default implementation does * this by naming the cell using the -setName:forElement:temporary: * method, which also provides a name for the cell color and image). */ - (NSButtonCell*) cellForScrollerArrow: (NSScrollerArrow)part horizontal: (BOOL)horizontal; /** * Creates and returns the cell to be used to draw a scroller knob of the * specified orientation.
* The theme instance is responsible for ensuring that the cell continues * to exist until the theme is deactivated (the default implementation does * this by naming the cell using the -setName:forElement:temporary: * method). */ - (NSCell*) cellForScrollerKnob: (BOOL)horizontal; /** * Creates and returns the cell to be used to draw a scroller slot of the * specified orientation.
* The theme instance is responsible for ensuring that the cell continues * to exist until the theme is deactivated (the default implementation does * this by naming the cell using the -setName:forElement:temporary: * method). */ - (NSCell*) cellForScrollerKnobSlot: (BOOL)horizontal; /** Returns the width which should be allowed for a scroller within the * current theme. Drawing code is entitled to assume that this value will * remain constant until the theme is deactivated. */ - (float) defaultScrollerWidth; /** * If YES, instructs NSScrollView to leave an empty square space where * the horizontal and vertical scrollers meet. * * Controlled by user default GSScrollViewUseBottomCorner; default YES. */ - (BOOL) scrollViewUseBottomCorner; /** * If YES, instructs NSScrollView to make the scrollers overlap the border. * The scroll view border is drawn using the NSScrollView part, which * must be provided by the theme if this method returns YES. * * Controlled by user default GSScrollViewScrollersOverlapBorders; default NO; */ - (BOOL) scrollViewScrollersOverlapBorders; /** * Method for toolbar theming. */ - (NSColor *) toolbarBackgroundColor; - (NSColor *) toolbarBorderColor; - (void) drawToolbarRect: (NSRect)aRect frame: (NSRect)viewFrame borderMask: (unsigned int)borderMask; - (BOOL) toolbarIsOpaque; // Methods to deal with steppers.. /** * Draw a stepper cell */ - (void) drawStepperCell: (NSCell*)cell withFrame: (NSRect)cellFrame inView: (NSView*)controlView highlightUp: (BOOL)highlightUp highlightDown: (BOOL)highlightDown; // Stepper cell helper methods - (NSRect) stepperUpButtonRectWithFrame: (NSRect)frame; - (NSRect) stepperDownButtonRectWithFrame: (NSRect)frame; - (void) drawStepperBorder: (NSRect)frame; /** * Draw light colored stepper using the border and clip rects */ - (NSRect) drawStepperLightButton: (NSRect)border : (NSRect)clip; /** * Draw normal stepper up button. */ - (void) drawStepperUpButton: (NSRect)aRect; /** * Draw highlighted up stepper button. */ - (void) drawStepperHighlightUpButton: (NSRect)aRect; /** * Draw down button for stepper */ - (void) drawStepperDownButton: (NSRect)aRect; /** * Draw highlighted stepper down button */ - (void) drawStepperHighlightDownButton: (NSRect)aRect; // NSSegmentedControl drawing methods - (void) drawSegmentedControlSegment: (NSCell *)cell withFrame: (NSRect)cellFrame inView: (NSView *)controlView style: (NSSegmentStyle)style state: (GSThemeControlState)state roundedLeft: (BOOL)roundedLeft roundedRight: (BOOL)roundedRight; /** *

Returns the color used to draw a menu view background.

* *

By default, looks up the color named menuBackgroundColor, * otherwise returns the window background color.

* *

The returned color is used by * -drawBackgroundForMenuView:withFrame:dirtyRect:horizontal:

* *

Can be overridden in subclasses to return a custom color.

*/ - (NSColor *) menuBackgroundColor; /** *

Returns the color used to draw a menu item background.

* * The menu item background is drawn atop the menu background. * *

By default, looks up the color named menuItemBackgroundColor, * otherwise returns the control background color.
* When selected or highlighted, the background color is provided by * [NSColor+selectedMenuItemColor].

* *

The returned value used by * -drawBorderAndBackgroundForMenuItemCell:withFrame:inView:state:isHorizontal: * and [NSMenuItemCell-backgroundColor].

* *

Can be overridden in subclasses to return a custom color.

*/ - (NSColor *) menuItemBackgroundColor; - (NSColor *) menuBarBackgroundColor; - (NSColor *) menuBarBorderColor; /** *

Returns the color used to draw a menu view border.

* *

By default, looks up the color named menuBorderColor, * otherwise returns the dark gray color.

* *

The returned color is used by * -drawBackgroundForMenuView:withFrame:dirtyRect:horizontal:

* *

Can be overridden in subclasses to return a custom color.

*/ - (NSColor *) menuBorderColor; /** *

Returns a color to draw each edge in a menu view border.

* *

By default, returns -menuBorderColor for the upper and left edges of a * vertical menu, or for the bottom edge of a horizontal one.

* *

The returned edge color is used by * -drawBackgroundForMenuView:withFrame:dirtyRect:horizontal:

* *

Can be overridden in subclasses to return a custom color per edge.

*/ - (NSColor *) menuBorderColorForEdge: (NSRectEdge)edge isHorizontal: (BOOL)horizontal; - (void) drawBackgroundForMenuView: (NSMenuView*)menuView withFrame: (NSRect)bounds dirtyRect: (NSRect)dirtyRect horizontal: (BOOL)horizontal; /** *

Returns whether the menu item border should be drawn or not.

* *

By default, returns [NSMenuItemCell-isBordered] value. The value is NO * when the menu is horizontal, YES when vertical.

* *

The returned value used by * -drawBorderAndBackgroundForMenuItemCell:withFrame:inView:state:isHorizontal:

* *

Can be overridden in subclasses.

*/ - (BOOL) drawsBorderForMenuItemCell: (NSMenuItemCell *)cell state: (GSThemeControlState)state isHorizontal: (BOOL)horizontal; // menu item cell drawing method - (void) drawBorderAndBackgroundForMenuItemCell: (NSMenuItemCell *)cell withFrame: (NSRect)cellFrame inView: (NSView *)controlView state: (GSThemeControlState)state isHorizontal: (BOOL)isHorizontal; /** *

Draws the menu item title.

* *

Can be overridden to customize the text font, size and position.
* You can use [[cell menuItem] title] to get the title.

* *

The title color is mapped to the theme state as described below:

* * GSThemeSelectedState[NSColor+selectedMenuItemTextColor] * GSThemeDisabledState[NSColor+controlTextColor] or * [NSColor+disabledControlTextColor] * */ - (void) drawTitleForMenuItemCell: (NSMenuItemCell *)cell withFrame: (NSRect)cellFrame inView: (NSView *)controlView state: (GSThemeControlState)state isHorizontal: (BOOL)isHorizontal; /** *

Returns the color used to draw a separator line in a menu.

* *

By default, looks up the color named menuSeparatorColor, * otherwise returns nil.

* *

The returned color is used by * -drawSeparatorItemForMenuItemCell:withFrame:inView:isHorizontal:

* *

Can be overridden in subclasses to return a custom color.

*/ - (NSColor *) menuSeparatorColor; /** *

Returns the left and right inset used to draw a separator line in a menu.

* *

By default, returns 3.0.

* *

The returned color is used by * -drawSeparatorItemForMenuItemCell:withFrame:inView:isHorizontal:

* *

Can be overridden in subclasses to return a custom value.

*/ - (CGFloat) menuSeparatorInset; /** * Amount that submenus overlap their parent menu by, horizontally. * (i.e. applies to vertical menus) * * Controlled by GSMenuSubmenuHorizontalOverlap default */ - (CGFloat) menuSubmenuHorizontalOverlap; /** * Amount that submenus overlap the horizontal menu bar by, vertically. * * Controlled by GSMenuSubmenuVerticalOverlap default */ - (CGFloat) menuSubmenuVerticalOverlap; /** *

Draws a separator between normal menu items in a menu.

* *

Each separator corresponds to a menu item that returns YES to * -isSeparatorItem

* *

You can provide an image tile named GSMenuSeparatorItem to * draw the separator.
* Can be overridden in subclasses to customize the drawing.

* *

See also -menuSeparatorColor and -menuSeparatorInset

*/ - (void) drawSeparatorItemForMenuItemCell: (NSMenuItemCell *)cell withFrame: (NSRect)cellFrame inView: (NSView *)controlView isHorizontal: (BOOL)isHorizontal; /** * Returns the class used to create the title bar in the given menu view. * * By default, returns GSTitleView.
* A subclass can be returned to customize the title view look and behavior. */ - (Class) titleViewClassForMenuView: (NSMenuView *)aMenuView; - (NSRect) drawMenuTitleBackground: (GSTitleView *)aTitleView withBounds: (NSRect)bounds withClip: (NSRect)clipRect; - (CGFloat) menuBarHeight; - (CGFloat) menuItemHeight; - (CGFloat) menuSeparatorHeight; // NSColorWell drawing method - (NSRect) drawColorWellBorder: (NSColorWell*)well withBounds: (NSRect)bounds withClip: (NSRect)clipRect; // progress indicator drawing methods - (void) drawProgressIndicator: (NSProgressIndicator*)progress withBounds: (NSRect)bounds withClip: (NSRect)rect atCount: (int)count forValue: (double)val; - (NSRect) drawProgressIndicatorBezel: (NSRect)bounds withClip: (NSRect) rect; - (void) drawProgressIndicatorBarDeterminate: (NSRect)bounds; // Table drawing methods - (NSColor *) tableHeaderTextColorForState: (GSThemeControlState)state; - (void) drawTableCornerView: (NSView*)cornerView withClip: (NSRect)aRect; - (void) drawTableHeaderCell: (NSTableHeaderCell *)cell withFrame: (NSRect)cellFrame inView: (NSView *)controlView state: (GSThemeControlState)state; - (float) titlebarHeight; - (float) resizebarHeight; - (void) drawWindowBorder: (NSRect)rect withFrame: (NSRect)frame forStyleMask: (unsigned int)styleMask state: (int)inputState andTitle: (NSString*)title; - (NSColor *) browserHeaderTextColor; - (void) drawBrowserHeaderCell: (NSTableHeaderCell*)cell withFrame: (NSRect)rect inView: (NSView*)view; - (NSRect) browserHeaderDrawingRectForCell: (NSTableHeaderCell*)cell withFrame: (NSRect)rect; - (NSRect) tabViewContentRectForBounds: (NSRect)aRect tabViewType: (NSTabViewType)type tabView: (NSTabView *)view; - (void) drawTabViewRect: (NSRect)rect inView: (NSView *)view withItems: (NSArray *)items selectedItem: (NSTabViewItem *)item; - (void) drawScrollerRect: (NSRect)rect inView: (NSView *)view hitPart: (NSScrollerPart)hitPart isHorizontal: (BOOL)isHorizontal; - (void) drawBrowserRect: (NSRect)rect inView: (NSView *)view withScrollerRect: (NSRect)scrollerRect columnSize: (NSSize)columnSize; - (CGFloat) browserColumnSeparation; - (CGFloat) browserVerticalPadding; - (BOOL) browserUseBezels; - (void) drawMenuRect: (NSRect)rect inView: (NSView *)view isHorizontal: (BOOL)horizontal itemCells: (NSArray *)itemCells; - (void) drawScrollViewRect: (NSRect)rect inView: (NSView *)view; - (void) drawSliderBorderAndBackground: (NSBorderType)aType frame: (NSRect)cellFrame inCell: (NSCell *)cell isHorizontal: (BOOL)horizontal; - (void) drawBarInside: (NSRect)rect inCell: (NSCell *)cell flipped: (BOOL)flipped; - (void) drawKnobInCell: (NSCell *)cell; - (NSRect) tableHeaderCellDrawingRectForBounds: (NSRect)theRect; - (void) drawTableHeaderRect: (NSRect)aRect inView: (NSView *)view; - (void) drawPopUpButtonCellInteriorWithFrame: (NSRect)cellFrame withCell: (NSCell *)cell inView: (NSView *)controlView; - (void) drawTableViewBackgroundInClipRect: (NSRect)clipRect inView: (NSView *)view withBackgroundColor: (NSColor *)backgroundColor; - (void) drawTableViewRect: (NSRect)aRect inView: (NSView *)view; - (void) drawTableViewGridInClipRect: (NSRect)aRect inView: (NSView *)view; - (void) highlightTableViewSelectionInClipRect: (NSRect)clipRect inView: (NSView *)view selectingColumns: (BOOL)selectingColumns; - (void) drawTableViewRow: (int)rowIndex clipRect: (NSRect)clipRect inView: (NSView *)view; - (void) drawBoxInClipRect: (NSRect)clipRect boxType: (NSBoxType)boxType borderType: (NSBorderType)borderType inView: (NSBox *)box; @end /** * Helper functions for drawing standard items. */ @interface GSTheme (MidLevelDrawing) /** Draw a standard button */ - (NSRect) drawButton: (NSRect)border withClip: (NSRect)clip; /** Draw a dark bezel border */ - (NSRect) drawDarkBezel: (NSRect)border withClip: (NSRect)clip; /** Draw a "dark" button border (used in tableviews) */ - (NSRect) drawDarkButton: (NSRect)border withClip: (NSRect)clip; /** Draw a frame photo border. Used in NSImageView. */ - (NSRect) drawFramePhoto: (NSRect)border withClip: (NSRect)clip; /** Draw a gradient border. */ - (NSRect) drawGradientBorder: (NSGradientType)gradientType inRect: (NSRect)border withClip: (NSRect)clip; /** Draw a gray bezel border */ - (NSRect) drawGrayBezel: (NSRect)border withClip: (NSRect)clip; /** Draw a groove border */ - (NSRect) drawGroove: (NSRect)border withClip: (NSRect)clip; /** Draw a light bezel border */ - (NSRect) drawLightBezel: (NSRect)border withClip: (NSRect)clip; /** Draw a white bezel border */ - (NSRect) drawWhiteBezel: (NSRect)border withClip: (NSRect)clip; @end /** * Low level drawing methods ... themes may use these for drawing, * but should not normally override them. */ @interface GSTheme (LowLevelDrawing) /** * Method to tile the supplied image to fill the horizontal rectangle.
* The rect argument is the rectangle to be filled.
* The image argument is the data to fill with.
* The source argument is the rectangle within the image which is used.
* The flipped argument specifies what sort of coordinate system is in * use in the view where we are drawing. */ - (void) fillHorizontalRect: (NSRect)rect withImage: (NSImage*)image fromRect: (NSRect)source flipped: (BOOL)flipped; /** * Tile rect with image. The tiling starts with the origin of the * first copy of the image at the bottom left corner of the rect * unless center is YES, in which case the image is centered in rect * and tiled outwards from that. */ - (void) fillRect: (NSRect)rect withRepeatedImage: (NSImage*)image fromRect: (NSRect)source center: (BOOL)center; /** * Method to tile a rectangle given a group of up to nine tile images.
* The GSDrawTiles object encapsulates the tile images and information * about what parts of each image are used for tiling.
* This draws the left, right, top and bottom borders by tiling the * images at left, right, top and bottom. It then draws the four corner * images and finally deals with the remaining space in the middle according * to the specified style.
* The background color specified is used to fill the center where * style is FillStyleNone.
* The return value is the central rectangle (inside the border images). */ - (NSRect) fillRect: (NSRect)rect withTiles: (GSDrawTiles*)tiles background: (NSColor*)color fillStyle: (GSThemeFillStyle)style; /** * Method to tile a rectangle given a group of up to nine tile images.
* The GSDrawTiles object encapsulates the tile images and information * about what parts of each image are used for tiling.
* This draws the left, right, top and bottom borders by tiling the * images at left, right, top and bottom. It then draws the four corner * images and finally deals with the remaining space in the middle according * to the default style set for the GSDrawTiles object used.
* The background color specified is used to fill the center where * style is FillStyleNone.
* The return value is the central rectangle (inside the border images). */ - (NSRect) fillRect: (NSRect)rect withTiles: (GSDrawTiles*)tiles background: (NSColor*)color; - (NSRect) fillRect: (NSRect)rect withTiles: (GSDrawTiles*)tiles; /** * Method to tile the supplied image to fill the vertical rectangle.
* The rect argument is the rectangle to be filled.
* The image argument is the data to fill with.
* The source argument is the rectangle within the image which is used.
* The flipped argument specifies what sort of coordinate system is in * use in the view where we are drawing. */ - (void) fillVerticalRect: (NSRect)rect withImage: (NSImage*)image fromRect: (NSRect)source flipped: (BOOL)flipped; @end @interface GSTheme (Menus) /** * This method sets the menu for the window using the current theme * In the default theme this calls the setMenu: method on the window * giving the menu parameter as the argument. */ - (void) setMenu: (NSMenu *)menu forWindow: (NSWindow *)window; /** * Display the context menu when the right mouse button is pressed. */ - (void) rightMouseDisplay: (NSMenu *)menu forEvent: (NSEvent *)theEvent; /** * Display popup menu item. */ - (void) displayPopUpMenu: (NSMenuView *)mr withCellFrame: (NSRect)cellFrame controlViewWindow: (NSWindow *)cvWin preferredEdge: (NSRectEdge)edge selectedItem: (int)selectedItem; /** * Process events for popups. */ - (BOOL) doesProcessEventsForPopUpMenu; /** * Display the menu icon in the application. */ - (BOOL) menuShouldShowIcon; /** * Processes menu events for the theme. The default implementation * does nothing. */ - (void) processCommand: (void *)context; /** * Calculate the height of the menu for in-window menus. The default * implementation returns [NSMenuView menuBarHeight]; */ - (float) menuHeightForWindow: (NSWindow *)window; /** * Update the menu for the window. This refreshes the menu contents. * The default implementation of this method does nothing. */ - (void) updateMenu: (NSMenu *)menu forWindow: (NSWindow *)window; - (void) updateAllWindowsWithMenu: (NSMenu *) menu; @end @interface GSTheme (OpenSavePanels) /** * This method returns the open panel class needed by the * native environment. */ - (Class) openPanelClass; /** * This method returns the open panel class needed by the * native environment. */ - (Class) savePanelClass; @end #endif /* OS_API_VERSION */ #endif /* _GNUstep_H_GSTheme */ gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSInstantiator.h0000664000076500007650000000263111351153376024216 0ustar brains99brains99/* GSNibCompatibility.h Copyright (C) 1997, 1999 Free Software Foundation, Inc. Author: Gregory John Casamento Date: 2002 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSInstantiator #define _GNUstep_H_GSInstantiator #import #import // instantiator @protocol GSInstantiator - (id) instantiateObject: (id)object; @end // informal protocol @interface NSNibConnector (NibInstantiation) - (void) instantiateWithInstantiator: (id)instantiator; @end #endif /* _GNUstep_H_GSNibCompatibility */ gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/.cvsignore0000664000076500007650000000002510377004044023121 0ustar brains99brains99config.h GSVersion.h gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSGhostscriptImageRep.h0000664000076500007650000000250011602014404025440 0ustar brains99brains99/* GSGhostscriptImageRep.h Ghostscript image representation. Copyright (C) 2011 Free Software Foundation, Inc. Written by: Eric Wasylishen Date: June 2011 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSGhostscriptImageRep #define _GNUstep_H_GSGhostscriptImageRep #import @class NSData; @interface GSGhostscriptImageRep : NSImageRep { NSBitmapImageRep *_bitmap; NSData *_psData; } @end #endif // _GNUstep_H_GSGhostscriptImageRep gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSDragView.h0000664000076500007650000000730311504422116023237 0ustar brains99brains99/* GSDragView - Generic Drag and Drop code. Copyright (C) 2004 Free Software Foundation, Inc. Author: Fred Kiefer Date: May 2004 Based on X11 specific code from: Created by: Wim Oudshoorn Date: Nov 2001 Written by: Adam Fedor Date: Nov 1998 This file is part of the GNU Objective C User Interface Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GSDragView_h_INCLUDE #define _GSDragView_h_INCLUDE #import #import #import #import @class NSMutableDictionary; @class NSCell; @class NSEvent; @class NSImage; @class NSPasteboard; @class NSWindow; /* * used in the operation mask to indicate that the * user can not change the drag action by * pressing modifiers. */ #define NSDragOperationIgnoresModifiers 0xffff @interface GSDragView : NSView { // the graphics that is dragged NSCell *dragCell; // the pasteboard with the dragged data NSPasteboard *dragPasteboard; // NSWindow in this application that is the current target NSWindow *destWindow; // Screen coordinates of mouse pointer, only valid when destWindow != nil NSPoint dragPoint; NSInteger dragSequence; // the source of the dragging operation id dragSource; // Operations supported by the source NSDragOperation dragMask; /* User specified operation mask (key modifiers). * This is either a mask of type _NSDragOperation, * or NSDragOperationIgnoresModifiers, which * is defined as 0xffff */ NSDragOperation operationMask; // slide the image back when drag fails? BOOL slideBack; /* The following information used in the drag and drop event loop */ // offset of image w.r.t. cursor NSSize offset; // current drag (mouse cursor) position in screen coordinates NSPoint dragPosition; // drag (mouse cursor) position, not yet processed NSPoint newPosition; // OS specific current window target of the drag operation int targetWindowRef; // Operations supported by the target, only valid if targetWindowRef isn't 0 NSDragOperation targetMask; // YES if target and source are in a different application BOOL destExternal; // YES if we are currently dragging BOOL isDragging; // Cache for cursors NSMutableDictionary *cursors; } + (id) sharedDragView; - (void) dragImage: (NSImage*)anImage at: (NSPoint)screenLocation offset: (NSSize)initialOffset event: (NSEvent*)event pasteboard: (NSPasteboard*)pboard source: (id)sourceObject slideBack: (BOOL)slideFlag; - (void) postDragEvent: (NSEvent*)theEvent; - (void) sendExternalEvent: (GSAppKitSubtype)subtype action: (NSDragOperation)action position: (NSPoint)eventLocation timestamp: (NSTimeInterval)time toWindow: (int)dWindowNumber; - (NSWindow*) windowAcceptingDnDunder: (NSPoint)mouseLocation windowRef: (int*)mouseWindowRef; @end #endif gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSAnimator.h0000664000076500007650000000716611357044577023331 0ustar brains99brains99/* GSAnimator.h Author: Xavier Glattard (xgl) Copyright (c) 2007 Free Software Foundation, Inc. This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSAnimator_ #define _GNUstep_H_GSAnimator_ #import #import #import @class NSArray; @class NSEvent; @class NSRunLoop; @class NSString; @class NSTimer; /** * Protocol that needs to be adopted by classes that want to * be animated by a GSAnimator. */ @protocol GSAnimation /** Call back method indicating that the GSAnimator did start the * animation loop. */ - (void) animatorDidStart; /** Call back method indicating that the GSAnimator did stop the * animation loop. */ - (void) animatorDidStop; /** Call back method called for each animation loop. */ - (void) animatorStep: (NSTimeInterval)elapsedTime; @end /** * GSAnimator is the front of a class cluster. Instances of a subclass of * GSAnimator manage the timing of an animation. */ @interface GSAnimator : NSObject { id _animation; // The Object to be animated BOOL _running; // Indicates that the animator is looping NSTimeInterval _elapsed; // Elapsed time since the animator started NSTimeInterval _lastFrame; // The time of the last animation loop unsigned int _frameCount; // The number of loops since the start NSArray *_runLoopModes; NSTimer *_timer; // Timer used for looping NSTimeInterval _timerInterval; } /** Returns a GSAnimator object initialized with the specified object * to be animated as fast as possible. */ + (GSAnimator*) animatorWithAnimation: (id)anAnimation; /** Returns a GSAnimator object initialized with the specified object * to be animated. */ + (GSAnimator*) animatorWithAnimation: (id)anAnimation frameRate: (float)fps; /** Returns a GSAnimator object allocated in the given NSZone and * initialized with the specified object to be animated. */ + (GSAnimator*) animatorWithAnimation: (id)anAnimation frameRate: (float)fps zone: (NSZone*)aZone; /** Returns a GSAnimator object initialized with the specified object * to be animated. The given NSRunLoop is used in NSDefaultRunLoopMode.*/ - (GSAnimator*) initWithAnimation: (id)anAnimation frameRate: (float)aFrameRate; - (GSAnimator*) initWithAnimation: (id)anAnimation; - (unsigned int) frameCount; - (void) resetCounters; - (float) frameRate; - (NSArray*) runLoopModesForAnimating; - (void) setRunLoopModesForAnimating: (NSArray*)modes; - (void) startAnimation; - (void) stopAnimation; - (BOOL) isAnimationRunning; - (void) startStopAnimation; - (void) stepAnimation; @end #endif /* _GNUstep_H_GSAnimator_ */ gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSToolbarView.h0000664000076500007650000000445611361162127023776 0ustar brains99brains99/* GSToolbarView.h The private toolbar class which draws the actual toolbar. Copyright (C) 2002 Free Software Foundation, Inc. Author: Gregory John Casamento , Fabien Vallon , Quentin Mathe Date: May 2002 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GSToolbarView_h_INCLUDE #define _GSToolbarView_h_INCLUDE #import #import #import @class NSMutableArray; @class NSClipView; @class NSToolbar; @class NSToolbarItem; @class GSToolbarClippedItemsButton; typedef enum { GSToolbarViewNoBorder = 0, GSToolbarViewRightBorder = 2, GSToolbarViewLeftBorder = 4, GSToolbarViewTopBorder = 8, GSToolbarViewBottomBorder = 16 } GSToolbarViewBorder; @interface GSToolbarView : NSView { NSToolbar *_toolbar; NSClipView *_clipView; GSToolbarClippedItemsButton *_clippedItemsMark; unsigned int _borderMask; NSRect _rectAvailable; float _heightFromLayout; } + (int) draggedItemIndex; + (void) setDraggedItemIndex:(int)sourceIndex; - (id) initWithFrame: (NSRect)frame; // Accessors - (NSToolbar *) toolbar; - (void) setToolbar: (NSToolbar *)toolbar; - (unsigned int) borderMask; - (void) setBorderMask: (unsigned int)borderMask; @end // Toolbar related NSColor methods @interface NSColor (GSToolbarViewAdditions) + (NSColor *) toolbarBackgroundColor; + (NSColor *) toolbarBorderColor; @end #endif gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSTextConverter.h0000664000076500007650000000432411357044577024364 0ustar brains99brains99/* -*-objc-*- GSTextConverter.h Define two protocols for text converter that will either read an external format from a file or data object into an attributed string or write out an attributed string in a format into a file or data object. Copyright (C) 2001 Free Software Foundation, Inc. Author: Fred Kiefer Date: August 2001 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSTextConverter #define _GNUstep_H_GSTextConverter #import @class NSAttributedString; @class NSData; @class NSDictionary; @class NSError; @class NSString; @protocol GSTextConverter + (Class) classForFormat: (NSString*)format producer: (BOOL)producer; @end @protocol GSTextProducer + (NSData*) produceDataFrom: (NSAttributedString*) aText documentAttributes: (NSDictionary*)dict error: (NSError **)error; @end /* * The 'class' argument must be NSAttributedString (or a subclass); * the results of parsing will be saved into a newly created object of * that class, which is then returned. */ @protocol GSTextConsumer + (NSAttributedString*) parseData: (NSData *)aData options: (NSDictionary *)options documentAttributes: (NSDictionary **)dict error: (NSError **)error class: (Class)class; @end #endif // _GNUstep_H_GSTextConverter gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/IMConnectors.h0000664000076500007650000000326511756500665023662 0ustar brains99brains99/* IMConnectors.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: November 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* These classes were inspired by IBConnectors classes from objcX, "an Objective-C class library for a window system". The code was originally written by Scott Francis, Paul Kunz, Imran Qureshi and Libing Wang. */ #ifndef _GNUstep_H_IMConnectors #define _GNUstep_H_IMConnectors #ifndef GNUSTEP #include #else #include #endif @interface IMConnector : NSObject { id source; id destination; NSString* label; } - source; - destination; - label; @end @interface IMControlConnector:IMConnector - (void)establishConnection; @end @interface IMOutletConnector : IMConnector - (void)establishConnection; @end #endif /* _GNUstep_H_IMConnectors */ gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSSoundSink.h0000664000076500007650000000527611354602172023460 0ustar brains99brains99/* GSSoundSink.h Sink audio data. Copyright (C) 2009 Free Software Foundation, Inc. Written by: Stefan Bidigaray Date: Jun 2009 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSSoundSink #define _GNUstep_H_GSSoundSink #import #import @protocol GSSoundSink /** Returns YES if class has the ability of playing audio data * through a playback device playbackDevice, NO otherwise. */ + (BOOL)canInitWithPlaybackDevice: (NSString *)playbackDevice; /** * Initializes the receiver for output using the defined parameters. *

WARNING: This method does not open the device, see -open.

*/ - (id)initWithEncoding: (int)encoding channels: (NSUInteger)channelCount sampleRate: (NSUInteger)sampleRate byteOrder: (NSByteOrder)byteOrder; /** Opens the device for output, called by [NSSound-play]. */ - (BOOL)open; /** Closes the device, called by [NSSound-stop]. */ - (void)close; /** Plays the data in bytes to the device. Data must be in * the same format as specified in * -initWithEncoding:channels:sampleRate:byteOrder:. */ - (BOOL)playBytes: (void *)bytes length: (NSUInteger)length; /** Called by [NSSound-setVolume:], and corresponds to it. Parameter volume * is between the values 0.0 and 1.0. */ - (void)setVolume: (float)volume; /** Called by [NSSound-volume]. */ - (float)volume; /** Called by [NSSound-setPlaybackDeviceIdentifier:]. */ - (void)setPlaybackDeviceIdentifier: (NSString *)playbackDeviceIdentifier; /** Called by [NSSound-playbackDeviceIdentifier]. */ - (NSString *)playbackDeviceIdentifier; /** Called by [NSSound-setChannelMapping:]. */ - (void)setChannelMapping: (NSArray *)channelMapping; /** Called by [NSSound-channelMapping]. */ - (NSArray *)channelMapping; @end #endif // _GNUstep_H_GSSoundSink gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSMemoryPanel.h0000664000076500007650000000343611357044577024003 0ustar brains99brains99/* GSMemoryPanel.h -*-objc-*- A GNUstep panel for tracking memory leaks. Copyright (C) 2000, 2002 Free Software Foundation, Inc. Author: Nicola Pero Date: 2000, 2002 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* * Class displaying a panel showing object allocation statistics. * */ #ifndef _GNUstep_H_GSMEMORY_PANEL_ #define _GNUstep_H_GSMEMORY_PANEL_ #import #import @class NSTableView; @class NSMutableArray; @interface GSMemoryPanel: NSPanel { NSTableView *table; NSMutableArray *array; /* Are we ordering by class name, or by count or total or peak number of instances ? */ SEL orderingBy; } + (id) sharedMemoryPanel; /* Updates the statistics */ + (void) update: (id)sender; - (void) update: (id)sender; @end @interface NSApplication (GSMemoryPanel) - (void) orderFrontSharedMemoryPanel: (id)sender; @end #endif /* _GNUstep_H_GSMEMORY_PANEL_ */ gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/IMLoading.h0000664000076500007650000000316511357044577023123 0ustar brains99brains99/* IMLoading.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: November 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_IMLoading #define _GNUstep_H_IMLoading #ifndef GNUSTEP #import #else #import @class NSArray; @class NSBundle; @class NSString; #endif @interface NSObject (NibAwaking) - (void)awakeFromModel; @end @interface GMModel : NSObject { NSArray* objects; NSArray* connections; } + (BOOL)loadIMFile:(NSString*)path owner:(id)owner; + (BOOL)loadIMFile:(NSString*)path owner:(id)owner bundle:(NSBundle*)bundle; - (void)_makeConnections; - (void)_setObjects:objects connections:connections; - (NSArray *) objects; - (NSArray *) connections; @end #endif /* _GNUstep_H_IMLoading */ gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSEPSPrintOperation.h0000664000076500007650000000351011357044577025071 0ustar brains99brains99/** GSEPSPrintOperation Controls generation of EPS print output. Copyright (C) 1996,2004 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Fred Kiefer Date: November 2000 Updated to new specification Author: Adam Fedor Date: Oct 2001 Modified for Printing Backend Support Author: Chad Hardin Date: June 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSEPSPrintOperation #define _GNUstep_H_GSEPSPrintOperation #import #import #import "AppKit/NSPrintOperation.h" @class NSString; @class NSView; @class NSPrintInfo; // subclass for EPS output @interface GSEPSPrintOperation: NSPrintOperation { } - (id) initWithView:(NSView *)aView insideRect:(NSRect)rect toPath:(NSString *)path printInfo:(NSPrintInfo *)aPrintInfo; @end #endif // _GNUstep_H_GSEPSPrintOperation gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSTypesetter.h0000664000076500007650000001003411357044577023713 0ustar brains99brains99/* GSTypesetter.h Copyright (C) 2002 Free Software Foundation, Inc. Author: Alexander Malmberg Date: 2002 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSTypesetter #define _GNUstep_H_GSTypesetter #import #import #import @class GSLayoutManager; @class NSTextContainer; @class NSFont; /* This class is abstract. */ /* This isn't final. It will probably change. If you want to sub-class, you'll have to update your code when things change (or wait until it's done). */ @interface GSTypesetter : NSObject /* ??? GSTypesetter's implementation returns NSMakeSize(0,0). */ + (NSSize) printingAdjustmentsInLayoutManager: (GSLayoutManager *)layoutManager forNominallySpacedGlyphRange: (NSRange)glyphRange packedGlyphs: (const unsigned char *)glyphs count: (unsigned)packedGlyphCount; /* Returns a thread-safe shared GSTypesetter (a GSHorizontalTypesetter instance in practice, at least when this is done). */ +(GSTypesetter *) sharedSystemTypesetter; /* Returns the font that should be used for the given attributes. GSTypesetter's implementation returns the value of NSFontAttribute, or [NSFont userFontOfSize: 0] if there is no such value. Subclasses can use this to make the font picked depend on other attributes, eg. to automatically use a smaller size for subscripts and superscripts. {Provide context?} */ -(NSFont *) fontForCharactersWithAttributes: (NSDictionary *)attributes; /* Lay out glyphs means that, for each glyph laid out in one call, the following things need to be done: -setTextContainer:forGlyphRange: 1. Set the text container for the glyph. -setLineFragmentRect:forGlyphRange:usedRect: 2. Set the line fragment rectangle for the glyph. -setLocation:forStartOfGlyphRange: 3. Set the position for the glyph (directly, or indirectly by setting the starting position for a range of nominally spaced glyphs containing the glyph). It should also set the drawsOutsideLineFragment and notShownAttribute if they are YES (they are set to NO by -setTextContainer:forGlyphRange:). (TODO: good?) */ /* Lay out glyphs, starting at glyphIndex, in textContainer. The line fragment rectangle for the previous line fragment in this textContainer, or NSZeroRect if there are none, is in previousLineFragRect. The index of the first glyph not laid out should be returned in nextGlyphIndex (which may _not_ be NULL). If all glyphs have been laid out, set it to [layoutManager numberOfGlyphs]. howMany is the number of requested line fragment rectangles. The typesetter should try to create approximately this many and then stop. If it is 0, the typesetter should fill the entire text container. Returns: 0 did some layout, nothing special happened 1 text container is full 2 all glyphs have been laid out Subclasses need to implement this method. {Too much context?} */ -(int) layoutGlyphsInLayoutManager: (GSLayoutManager *)layoutManager inTextContainer: (NSTextContainer *)textContainer startingAtGlyphIndex: (unsigned int)glyphIndex previousLineFragmentRect: (NSRect)previousLineFragRect nextGlyphIndex: (unsigned int *)nextGlyphIndex numberOfLineFragments: (unsigned int)howMany; @end #endif gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/IMCustomObject.h0000664000076500007650000000347411357044577024152 0ustar brains99brains99/* IMCustomObject.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: November 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* This class was inspired by CustomObject class from objcX, "an Objective-C class library for a window system". The code was originally written by Paul Kunz and Imran Qureshi. */ #ifndef _GNUstep_H_IMCustomObject #define _GNUstep_H_IMCustomObject #ifndef GNUSTEP #import #else #import #import @class NSString; #endif /* Add an archiving category to object so every object can respond to -nibInstantiate */ @interface NSObject (ModelUnarchiving) - (id)nibInstantiate; @end @interface IMCustomObject : NSObject { NSString* className; id realObject; id extension; } - (id)nibInstantiate; @end @interface IMCustomView : NSView { NSString* className; id realObject; id extension; } - (id)nibInstantiate; @end #endif /* _GNUstep_H_IMCustomObject */ gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSPrintOperation.h0000664000076500007650000000337511357044577024532 0ustar brains99brains99/** GSPrintOperation Controls generation of print jobs. Backends determine the file format and how to send the data to the printer. Copyright (C) 1996,2004 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Fred Kiefer Date: November 2000 Updated to new specification Author: Adam Fedor Date: Oct 2001 Modified for Printing Backend Support Author: Chad Hardin Date: June 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSPrintOperation #define _GNUstep_H_GSPrintOperation #import "AppKit/NSPrintOperation.h" @class NSView; @class NSPrintInfo; @interface GSPrintOperation: NSPrintOperation { } - (id) initWithView:(NSView *)aView printInfo:(NSPrintInfo *)aPrintInfo; - (BOOL) _deliverSpooledResult; @end #endif // _GNUstep_H_GSPrintOperation gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSTable.h0000664000076500007650000003516711357044577022610 0ustar brains99brains99/* GSTable.h The GSTable class (a GNU extension) Copyright (C) 1999 Free Software Foundation, Inc. Author: Nicola Pero Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSTable #define _GNUstep_H_GSTable #import /** GSTable

A GSTable object is used to control the disposition (position and size) of a group of NSViews. The GSTable object offers two main facilities to the programmer:

with a GSTable object, you do not need to specify the exact position and size of each view. You only specify the logical position, relative to the other views in the table. The actual frame of each view is then computed by the GSTable at run time. when the GSTable is resized (for example, because the user has resized the window in which the GSTable is), the GSTable takes care of moving and resizing all its views automatically. This is done in much a advanced and customizable way than in the usual standard NSView's autoresizing mechanism.

You create a GSTable instance with a certain number of rows and columns. The GSTable object itself is invisible; it is only a logical device used to specify the subview position. Then, you place one by one the views you want to control in the GSTable, by calling a method of the family -putView:atRow:column:. Before placing a view in the table, you should resize it to the minimum comfortable size you want it to have. The table then automatically places the views, organizing them in well-ordered columns and rows.

The initial size of the GSTable is zero; each time you put a view in the GSTable, the GSTable recomputes sizes and as a result resizes itself so that it exactly fits the views it contains. You should not force a GSTable in a size different from the one it has automatically computed. The only acceptable, reasonable and meaningful way of resizing a GSTable is through the appropriate [NSView-resizeWithOldSuperviewSize:] message when the GSTable is in the view hierarchy.

When you add a view, you may specify some particular margins to be used for that view. If nothing is specified, the view is added to the table with the margins of 0. You should think of each view and its margins as a whole. A position in the GSTable is free or filled with a view and its margins.

The GSTable itself knows what is the minimum size it needs to have in order to comfortably display the views it contains. You may get this size by calling the method -minimumSize. When first filled, the table has this minimum size. If in any moment you want the table to restore itself to this size, you should invoke the method -sizeToFit.

When the GSTable receives a [NSView-resizeWithOldSuperviewSize:] message, it automatically rearranges the views it contains:

If the new width or height is equal or less than the table's minimum width or height, the GSTable simply arranges its views in the initial position. In other words, the GSTable refuse to resize below its minimum width or height. If you do that, part of the GSTable is clipped. If the new width or height is bigger than the table's minimum width or height, the space in excess is equally distributed between the columns or rows which have X (or Y) resizing enabled. When a column or a row is resized, each view in the column or row is resized together with its margins. By setting the autoresizingMask of each view, you may decide how the resizing operation will act on that particular view and its margins. For example, setting the autoresizingMask to NSViewWidthSizable | NSViewHeightSizable will always leave the margins fixed to their initial dimensions, and expand/reduce only the view, in all directions. Setting the autoresizingMask to NSViewMinXMargin | NSViewMaxXMargin | NSViewSizable | NSViewHeightSizable will instead expand/reduce both the margins and the view in the horizontal direction, but leave the margins fixed and expand/reduce only the view in the vertical direction. Whatever the autoresizingMask and the amount of the resizing, views and margins are never resized below their minimum comfortable size, as explained above. For more information on the autoresizingMask, please refer to the description of the -setAutoresizingMask: method of the NSView class.
Advanced Description of GSTable

We call any view which is added to the GSTable a prisoner. The purpose of the GSTable is to effectively manage its prisoners. To do so, the GSTable creates a special view, called a jail, for each prisoner. The jails are subviews of the GSTable; each prisoner, when added to the GSTable, is made a subview of its jail. The GSTable always moves and resizes directly the jails. The moving is automatically transmitted to the prisoners, which are subviews of the jails; the resizing is transmitted through the usual autoresizing machinery, because the jails always have autoresizing of subviews turned on. This works because if a prisoner sends to its superview an [NSView-frame] message, the frame of the jail (and not the frame of the GSTable) is returned, so that each prisoner will autoresize itself in its jail frame. Moreover, any prisoner, being a subview of its jail, is clipped in its jail frame. If a prisoner draws something out of its jail frame, the output is discarded by the usual subview/view clipping machinery. This prevents the prisoners from disturbing each other. The dimension of the jail is the dimension of the prisoner plus its margins. Since the GSTable manages directly the jails, each prisoner is managed together with its margins. When the jail is resized, the prisoner receives a [NSView-resizeWithOldSuperviewSize:], which makes it resize itself and its margins in the new jail size, according to its autoresizingMask.

Setting Row and Column Expand Flag

When the GSTable is resized, the extra space is equally divided between the Rows and Columns which have the X (or Y) resizing enabled. The following methods let you enable/disable the X (or Y) resizing of each row and column in the GSTable. Note that when the GSTable is first created, all its columns and rows have by default resizing enabled. -setXResizingEnabled:forColumn:, -setYResizingEnabled:forRow:.

*/ @interface GSTable: NSView { int _numberOfRows; int _numberOfColumns; // Border around the table. float _minXBorder; float _maxXBorder; float _minYBorder; float _maxYBorder; // We control the NSView inserted in the GSTable (which we call // the prisoners) by enclosing them in jails. // Each prisoner is enclosed in a jail (which is a subview under // our control). // Each prisoner is allowed to resize only inside its jail. NSView **_jails; // YES if the column/row should be expanded/reduced when the size // of the GSTable is expanded/reduced (this BOOL is otherwhere // called X/Y Resizing Enabled). BOOL *_expandColumn; BOOL *_expandRow; // Cache the total number of rows/columns which have expand set to YES int _expandingColumnNumber; int _expandingRowNumber; // Dimension of each column/row float *_columnDimension; float *_rowDimension; // Origin of each column/row float *_columnXOrigin; float *_rowYOrigin; // Minimum dimension each row/column is allowed to have // (which is the size the jail had when first created). float *_minColumnDimension; float *_minRowDimension; // Cache the minimum size the GSTable should be resized to. NSSize _minimumSize; // YES if there is a prisoner in that GSTable position. // (to avoid creating a jail if there is no prisoner to control). BOOL *_havePrisoner; } // // Initizialing. // /** Initialize a GSTable with columns columns and rows rows. If columns or rows is negative or null, a warning is issued and a default of 2 is used instead. */ -(id) initWithNumberOfRows: (int)rows numberOfColumns: (int)columns; /** Initialize with a default of 2 columns and 2 rows. */ -(id) init; // // Setting Border Dimension. // Border is space around the table. // /** Set the GSTable up, bottom, left and right borders to the same value aBorder. The GSTable is immediately updated. If aBorder is negative, the border is reset to the default, which is zero (0). The border is simply unfilled space; it is measured in the GSTable coordinate system. */ -(void) setBorder: (float)aBorder; /** Set the GSTable left and right borders to aBorder. If aBorder is negative, the border is reset to zero. The GSTable is immediately updated. */ -(void) setXBorder: (float)aBorder; /** Same as setXBorder: but set the up and bottom borders. */ -(void) setYBorder: (float)aBorder; /** Same as setXBorder: but set only the left border. */ -(void) setMinXBorder: (float)aBorder; /** Same as setXBorder: but set only the right border. */ -(void) setMaxXBorder: (float)aBorder; /** Same as setXBorder: but set only the lower border (upper if the GSTable is flipped). */ -(void) setMinYBorder: (float)aBorder; /** Same as setXBorder: but set only the upper border (lower if the GSTable is flipped). */ -(void) setMaxYBorder: (float)aBorder; // // Adding a View. // Use these methods to put views in the GSTable. // /** Put aView in the GSTable, in the specified row and column. Zero (0) margins are used. If the column column (or the row row}) is not enough big to fully display aView and its margins, the column (or the row) is resized (regardless of the fact that X or Y Resizing is Enabled or not). It is understood that this will affect each view (and its margins) in the column (or row) according to the autoresizing mask of each view. */ -(void) putView: (NSView *)aView atRow: (int)row column: (int)column; /** Put aView in the GSTable, using margins as margin in all directions: left, right, top, bottom. */ -(void) putView: (NSView *)aView atRow: (int)row column: (int)column withMargins: (float)margins; /** Put aView in the GSTable, using xMargins as the left and right margins, and yMargins as the top and bottom margins. */ -(void) putView: (NSView *)aView atRow: (int)row column: (int)column withXMargins: (float)xMargins yMargins: (float)yMargins; /**

Put aView in the GSTable, using the specified margins. The names for the margins are chosen as to be as close as possible to the autoresizingMask convention. The margins are to be interpreted as follows:

minXMargin Left Margin maxXMargin Right Margin minYMargin Lower Margin (Upper if view is flipped) maxYMargin Upper Margin (Lower if view is flipped)

Each view which is added to the GSTable can have some margins set. The GSTable treats the view and its margins as a whole. They are given (as a whole) some space, which is reduced or increased (but only if X or Y Resizing is Enabled for the column or the row in which the view resides) when the GSTable is resized. When this happens, the space is added (or subtracted) to the view or to the margins according to the autoResizeMask of the view.

*/ -(void) putView: (NSView *)aView atRow: (int)row column: (int)column withMinXMargin: (float)minXMargin // Left Margin maxXMargin: (float)maxXMargin // Right Margin minYMargin: (float)minYMargin // Lower Margin (Upper if flipped) maxYMargin: (float)maxYMargin; // Upper Margin (Lower if flipped) // // Minimum Size. /** This returns the minimum size the GSTable should be resized to. Trying to resize the GSTable below this size will only result in clipping (ie, making it disappear) part of the GSTable. */ -(NSSize) minimumSize; // // Resizing. /** If for any reason you need the GSTable to be redrawn (with minimum size), invoke the following. */ -(void) sizeToFit; // // Setting Row and Column Expand Flag // /** Enable/disable X Resizing for the column aColumn} according to aFlag. Note: at present, enabling/disabling X resizing after the table has been put in the view hierarchy is not supported. */ -(void) setXResizingEnabled: (BOOL)aFlag forColumn: (int)aColumn; /** Return whether X resizing is enabled for the column aColumn. */ -(BOOL) isXResizingEnabledForColumn: (int)aColumn; /** Enable/disable Y Resizing for the row aRow according to aFlag. Note: at present, enabling/disabling Y resizing after the table has been put in the view hierarchy is not supported. */ -(void) setYResizingEnabled: (BOOL)aFlag forRow: (int)aRow; /** Return whether Y resizing is enabled for the row aRow. */ -(BOOL) isYResizingEnabledForRow: (int)aRow; // // Adding Rows and Columns // These should be used to add more rows and columns to the GSTable. // Of course it is faster to create a GSTable with the right number of rows // and columns from the beginning. // /** Add a row to the GSTable. The row is added void, with zero height and Y Resizing enabled. */ -(void) addRow; // TODO: -(void) insertRow: (int)row; // TODO: -(void) removeRow: (int)row; /** Add a column to the GSTable. The column is added void, with zero width and X Resizing enabled. */ -(void) addColumn; // TODO: -(void) insertColumn: (int)column; // TODO: -(void) removeColumn: (int)column; // // Getting Row and Column Number // /** Return the number of rows in the GSTable. */ -(int) numberOfRows; /** Return the number of columns in the GSTable. */ -(int) numberOfColumns; @end #endif /* _GNUstep_H_GSTable */ gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSNibContainer.h0000664000076500007650000000270711023376255024115 0ustar brains99brains99/* GSNibContainer.h Copyright (C) 1997, 1999 Free Software Foundation, Inc. Author: Gregory John Casamento Date: 2006 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSNibContainer #define _GNUstep_H_GSNibContainer @class NSDictionary; @class NSMutableDictionary; @class NSMutableSet; @class NSMutableArray; @protocol GSNibContainer - (void) awakeWithContext: (NSDictionary *)context; - (NSMutableDictionary *) nameTable; - (NSMutableArray *) connections; - (NSMutableSet *) topLevelObjects; // - (NSSet *) visibleWindows; // - (NSSet *) deferredWindows; @end #endif /* _GNUstep_H_GSNibContainer */ gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSServicesManager.h0000664000076500007650000000625611357044577024634 0ustar brains99brains99/* GSServicesManager.h Copyright (C) 1998 Free Software Foundation, Inc. Author: Richard Frith-Macdonald Date: Novemeber 1998 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSServicesManager #define _GNUstep_H_GSServicesManager #import /* Forward declaring the NSMenuItem protocol here would be nicer, but older versions of gcc can't handle that. Thus, we include the header instead. */ #import "AppKit/NSMenuItem.h" @class NSApplication; @class NSArray; @class NSDate; @class NSMenu; @class NSMenuItem; @class NSMutableArray; @class NSMutableDictionary; @class NSMutableSet; @class NSString; @class NSTimer; @interface GSServicesManager : NSObject { NSApplication *_application; NSMenu *_servicesMenu; NSMutableArray *_languages; NSMutableSet *_returnInfo; NSMutableDictionary *_combinations; NSMutableDictionary *_title2info; NSArray *_menuTitles; NSString *_disabledPath; NSString *_servicesPath; NSDate *_disabledStamp; NSDate *_servicesStamp; NSMutableSet *_allDisabled; NSMutableDictionary *_allServices; NSTimer *_timer; NSString *_port; } + (GSServicesManager*) newWithApplication: (NSApplication*)app; + (GSServicesManager*) manager; - (BOOL) application: (NSApplication*)theApp openFile: (NSString*)file; - (BOOL) application: (NSApplication*)theApp openFileWithoutUI: (NSString*)file; - (BOOL) application: (NSApplication*)theApp openTempFile: (NSString*)file; - (BOOL) application: (NSApplication*)theApp printFile: (NSString*)file; - (void) doService: (NSMenuItem*)item; - (NSArray*) filters; - (BOOL) hasRegisteredTypes: (NSDictionary*)service; - (NSString*) item2title: (id)item; - (void) loadServices; - (NSDictionary*) menuServices; - (NSString*) port; - (void) rebuildServices; - (void) rebuildServicesMenu; - (void) registerAsServiceProvider; - (void) registerSendTypes: (NSArray *)sendTypes returnTypes: (NSArray *)returnTypes; - (NSMenu *) servicesMenu; - (id) servicesProvider; - (void) setServicesMenu: (NSMenu *)anObject; - (void) setServicesProvider: (id)anObject; - (int) setShowsServicesMenuItem: (NSString*)item to: (BOOL)enable; - (BOOL) showsServicesMenuItem: (NSString*)item; - (BOOL) validateMenuItem: (id)item; - (void) updateServicesMenu; @end #endif gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSPDFPrintOperation.h0000664000076500007650000000351311357044577025056 0ustar brains99brains99/** GSPDFPrintOperation Controls generation of PDF print output. Copyright (C) 1996,2004 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Fred Kiefer Date: November 2000 Updated to new specification Author: Adam Fedor Date: Oct 2001 Modified for Printing Backend Support Author: Chad Hardin Date: June 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSPDFPrintOperation #define _GNUstep_H_GSPDFPrintOperation #import #import #import "AppKit/NSPrintOperation.h" @class NSString; @class NSView; @class NSPrintInfo; // subclass for PDF output @interface GSPDFPrintOperation: NSPrintOperation { } - (id) initWithView:(NSView *)aView insideRect:(NSRect)rect toPath:(NSString *)path printInfo:(NSPrintInfo *)aPrintInfo; @end #endif // _GNUstep_H_GSPDFPrintOperation gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSWindowDecorationView.h0000664000076500007650000000677012107547001025651 0ustar brains99brains99/** GSWindowDecorationView Copyright (C) 2004 Free Software Foundation, Inc. Author: Alexander Malmberg Date: 2004-03-24 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSWindowDecorationView #define _GNUstep_H_GSWindowDecorationView #import #import @class NSWindow; // These are implemented as class methods on GSWindowDecorationView @protocol GSWindowDecorator - (id) newWindowDecorationViewWithFrame: (NSRect)frame window: (NSWindow *)window; - (NSRect) contentRectForFrameRect: (NSRect)aRect styleMask: (NSUInteger)aStyle; - (NSRect) frameRectForContentRect: (NSRect)aRect styleMask: (NSUInteger)aStyle; - (CGFloat) minFrameWidthWithTitle: (NSString *)aTitle styleMask: (NSUInteger)aStyle; @end /* Abstract superclass for the top-level view in each window. This view is responsible for managing window decorations. Concrete subclasses may do this, either directly, or indirectly (by using the backend). */ @interface GSWindowDecorationView : NSView { NSWindow *window; /* not retained */ int windowNumber; NSRect contentRect; int inputState; BOOL documentEdited; BOOL hasMenu; BOOL hasToolbar; } + (id) windowDecorator; - (id) initWithFrame: (NSRect)frame window: (NSWindow *)w; - (NSRect) contentRectForFrameRect: (NSRect)aRect styleMask: (NSUInteger)aStyle; - (NSRect) frameRectForContentRect: (NSRect)aRect styleMask: (NSUInteger)aStyle; - (void) layout; - (void) changeWindowHeight: (CGFloat)difference; - (void) setBackgroundColor: (NSColor *)color; - (void) setContentView: (NSView *)contentView; - (void) setDocumentEdited: (BOOL)flag; - (void) setInputState: (int)state; - (void) setTitle: (NSString *)title; /* Called when the backend window is created or destroyed. When it's destroyed, windowNumber will be 0. */ - (void) setWindowNumber: (int)windowNumber; // Flags controlling if elements are present - (void) setHasMenu: (BOOL) flag; - (void) setHasToolbar: (BOOL) flag; - (BOOL) hasMenu; - (BOOL) hasToolbar; @end /* Manage window decorations by using the backend functions. This only works * on backends that can handle window decorations. */ @interface GSBackendWindowDecorationView : GSWindowDecorationView @end /* Standard OPENSTEP-ish window decorations. */ @class NSButton; @interface GSStandardWindowDecorationView : GSWindowDecorationView { BOOL hasTitleBar, hasResizeBar, hasCloseButton, hasMiniaturizeButton; BOOL isTitled; //, hasToolbar, hasMenu; NSRect titleBarRect; NSRect resizeBarRect; NSRect closeButtonRect; NSRect miniaturizeButtonRect; NSButton *closeButton, *miniaturizeButton; } @end #endif gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSHorizontalTypesetter.h0000664000076500007650000000407111357044577025771 0ustar brains99brains99/* GSHorizontalTypesetter.h Copyright (C) 2002 Free Software Foundation, Inc. Author: Alexander Malmberg Date: 2002 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSHorizontalTypesetter #define _GNUstep_H_GSHorizontalTypesetter #import @class NSLock; @class GSLayoutManager, NSTextContainer, NSTextStorage; @class NSDictionary; @class NSParagraphStyle, NSFont; @interface GSHorizontalTypesetter : GSTypesetter { NSLock *lock; GSLayoutManager *curLayoutManager; NSTextContainer *curTextContainer; NSTextStorage *curTextStorage; unsigned int curGlyph; NSPoint curPoint; NSParagraphStyle *curParagraphStyle; NSRange paragraphRange; /* characters */ NSDictionary *curAttributes; NSRange attributeRange; /* characters */ struct { BOOL explicit_kern; float kern; float baseline_offset; int superscript; } attributes; NSFont *curFont; NSRange fontRange; /* glyphs */ struct GSHorizontalTypesetter_glyph_cache_s *cache; unsigned int cache_base, cache_size, cache_length; BOOL at_end; struct GSHorizontalTypesetter_line_frag_s *line_frags; int line_frags_num, line_frags_size; } +(GSHorizontalTypesetter *) sharedInstance; @end #endif gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSInfoPanel.h0000664000076500007650000000470411357044577023425 0ustar brains99brains99/* GSInfoPanel.h Standard GNUstep info panel Copyright (C) 2000 Free Software Foundation, Inc. Author: Nicola Pero Date: January 2000 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSInfoPanel #define _GNUstep_H_GSInfoPanel #import @class NSDictionary; /* If you need an Info Panel, the simpler thing to do is to use * NSApplication -orderFrontStandardInfoPanel: and * NSApplication -orderFrontStandardInfoPanelWithOptions:. * They automatically manage an infoPanel for you. */ @interface GSInfoPanel: NSPanel { } /* * Instance Methods */ /* * The designated initializer * * Useful keys (with example values) for the dictionary are: * * ApplicationName = @"Gorm" * * ApplicationDescription = @"GNUstep Graphics Object Relationship Modeller" * * ApplicationIcon = an image * * ApplicationRelease = @"Gorm 0" * (ApplicationVersion in place of ApplicationRelease is also accepted for macosx compatibility) * * FullVersionID = @"0.0.1 1999" * (Version also accepted for macosx compatibility) * * Authors = an array of (NSString*)s, each one probably similar to the following * @"Richard Frith-Macdonald " * * URL = @"See http://www.gnustep.org" * (still to fix/improve position of this thing so perhaps you don't want to use it) * * Copyright = @"Copyright (C) 1999, 2000 The Free Software Foundation, Inc." * * CopyrightDescription = @"Released under the GNU General Public License 2.0" * */ -(id) initWithDictionary: (NSDictionary *)dictionary; /* * NB: Once initialized, a GSInfoPanel is immutable. */ @end #endif /* _GNUstep_H_GSInfoPanel */ gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSHelpAttachment.h0000664000076500007650000000311311510333651024425 0ustar brains99brains99/** GSHelpAttachment Copyright (C) 2011 Free Software Foundation, Inc. Author: Wolfgang Lux Date: Jan 2011 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSHelpAttachment #define _GNUstep_H_GSHelpAttachment #import @interface GSHelpLinkAttachment : NSTextAttachment { NSString *fileName, *markerName; } - (id) initWithFileName: (NSString *)aFileName markerName: (NSString *)aMarkerName; - (void) dealloc; - (NSString *)fileName; - (NSString *)markerName; @end @interface GSHelpMarkerAttachment : NSTextAttachment { NSString *markerName; } - (id) initWithMarkerName: (NSString *)aMarkerName; - (void) dealloc; - (NSString *)markerName; @end #endif /* _GNUstep_H_GSHelpAttachment */ gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/config.h.in0000664000076500007650000000755612074535407023174 0ustar brains99brains99/* Headers/Additions/GNUstepGUI/config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_AO_AO_H /* Define if you have the aspell header */ #undef HAVE_ASPELL /* Define to 1 if you have the header file. */ #undef HAVE_ASPELL_H /* Define to 1 if you have the `atan2f' function. */ #undef HAVE_ATAN2F /* Define to 1 if you have the header file. */ #undef HAVE_CUPS_CUPS_H /* Define to 1 if you have the header file. */ #undef HAVE_FLITE_FLITE_H /* Define to 1 if you have the `getmntent' function. */ #undef HAVE_GETMNTENT /* Define to 1 if you have the `getmntinfo' function. */ #undef HAVE_GETMNTINFO /* Have ImageMagick */ #undef HAVE_IMAGEMAGICK /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_JPEGLIB_H /* Define to 1 if you have the `aspell' library (-laspell). */ #undef HAVE_LIBASPELL /* Define to 1 if you have the `gif' library (-lgif). */ #undef HAVE_LIBGIF /* Define to 1 if you have the `icns' library (-licns). */ #undef HAVE_LIBICNS /* Define to 1 if you have the `jpeg' library (-ljpeg). */ #undef HAVE_LIBJPEG /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the `png' library (-lpng). */ #undef HAVE_LIBPNG /* Define to 1 if you have the `tiff' library (-ltiff). */ #undef HAVE_LIBTIFF /* Define to 1 if you have the `ungif' library (-lungif). */ #undef HAVE_LIBUNGIF /* Define to 1 if you have the `z' library (-lz). */ #undef HAVE_LIBZ /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_MNTENT_H /* Define to 1 if you have the header file. */ #undef HAVE_PNG_H /* Define to 1 if you have the `QuantizeBuffer' function. */ #undef HAVE_QUANTIZEBUFFER /* Define to 1 if you have the `rint' function. */ #undef HAVE_RINT /* Define to 1 if you have the `rintf' function. */ #undef HAVE_RINTF /* Define to 1 if you have the header file. */ #undef HAVE_SNDFILE_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MNTENT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNICODE_UCHAR_H /* Define to 1 if you have the header file. */ #undef HAVE_UNICODE_USTRING_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* mntent structure member name */ #undef MNT_MEMB /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define for those who don't have rintf and/or rint */ #ifndef HAVE_RINTF #define rintf rint #endif #ifndef HAVE_RINT #define DEFINE_RINT_IF_MISSING \ static double rint(double a) \ { \ return (floor(a+0.5)); \ } #else #define DEFINE_RINT_IF_MISSING #endif gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSHbox.h0000664000076500007650000002566111357044577022457 0ustar brains99brains99/* GSHbox.h The GSHbox class (a GNU extension) Copyright (C) 1999 Free Software Foundation, Inc. Author: Nicola Pero Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSHbox #define _GNUstep_H_GSHbox #import "GSTable.h" /** GSHbox

GSHbox inherits from GSTable the autosizing/autoresizing engine. The only real difference between a GSHbox and a GSTable with 1 row is that the GSHbox has a much simpler, easier and friendlier API.

You shouldn't use GSTable methods with GSHbox (exception: methods explicitly quoted in comments to this file as 'inherited from GSTable'). If you need to do that, you should be using GSTable instead.

A GSHbox is an invisible view (a logical device) which can contain some views. The GSHbox controls the position and sizes of these views so that they are lined up in a row.

To initialize a GSHbox, you should always use -init method. Don't use GSTable methods. The correct way to start using a new GSHbox is simply:

hbox = [GSHbox new];

(well, of course, autoreleasing it if necessary). You add a view to a GSHbox using the method -addView: and its variants. The views you add to a GSHbox are placed by the GSHbox in its subview hierarchy, and moved (and/or resized in the vertical direction) so that they are positioned one after the other, from left to right, in a row. Before adding views to a box, you should resize them to the least comfortable size you want them to have. The GSHbox considers this size as the minimum size your view should ever have, and never resizes your view below this size.

The initial size of the GSHbox is zero; each time you add a view in the GSHbox, the GSHbox resizes itself to fit the new contents. Usually, you simply add objects to the GSHbox, and let it compute its size (this is the minimum size); you may get this resulting size by

size = [yourHBox size];

for example, if the GSHbox is to be used as the content view of a window, you may create the window exactly with this size.

You should never force a GSHbox in a size different from the one it has automatically computed. It sounds quite pointless anyway. The only correct (and meaningful) way to resize a GSHbox is through -resizeWithOldSuperviewSize: messages (in the view hierarchy). In other words, after you place your box in the view hierarchy, then you may resize the superview and (if the superview has autoresizing of subviews enabled) your box is resized automatically accordingly.

By default, there is no space between the added views. By using the method -addView:withMinXMargin: you may tell the GSHbox to insert some space (a margin) between the view you are adding and the previous one (the one at its left).

If what you want is space around the GSHbox, and not between views in the GSHbox, you don't want a margin but a border; you should then use -setBorder:, which will add an equal amount of space on all the sides of the box. You can also set a different border on each side (see -setMinXBorder: and similar methods).

A useful feature of GSHbox is that it supports separators. This facility is not directly available in GSTable (to add separators to a GSTable you need to create and handle them yourself). A GSHbox separator is a vertical groove line, used to mark the separation between different elements of a box. To add a separator, simply invoke the method -addSeparator. The separator is put at the right of the last added view.

To use GSHbox proficiently, it is crucial to set correctly the autoresizing mask of each view before adding it to the GSHbox.

The GSHbox treats each view and its margins as a whole (see the GSTable class description for more information).

When the GSHbox is resized in the vertical direction (as a consequence of user intervertion, for example), what happens is:

if the new height is less than the minimum height of the GSHbox (computed as the maximum of the minimum height of the added views), it simply resizes all the added views to this minimum height; part of them are clipped then. if the new height is greater than the GSHbox's minimum height, the GSHbox resizes all the added views to the new height. This is done through the standard superview-subview resizing mechanism, so that, by setting the autoresizingMask of each view that you add, you are able to control exactly how the resizing effects each view and its margins.

When the GSHbox is resized in the horizontal direction, its behaviour is as follows:

If the new width is less than the minimum width, all the added views are sized to minimum width; part of them is clipped then. If the new width is greater than the minimum width, some of the views are resized. You may decide which views you want to be resized and which not; to disable resizing of a certain view in the horizontal direction, you should specify a NO value to the option enablingXResizing when you add the view to the box. Views with X Resizing Not Enabled are always kept in their minimum width (the original one), and never resized. If nothing is specified, a default of YES for enablingXResizing is understood. So, when the new width is greater than the minimum width, the excess width is equally divided between the view with X Resizing Enabled. The actual resizing is done through the usual superview-subview resizing mechanism, so that again you may influence the way the resizing affects each view by setting the autoresizing mask of each view.
*/ @interface GSHbox: GSTable { BOOL _haveViews; float _defaultMinXMargin; } // // Initizialing. // /** Always use init for GSHbox: other methods don't make sense. Don't used GSTable methods. You do not need to specify the number of views you plan to put in the box when you initialize it. */ -(id) init; // // Adding a View. // /** See -addView:enablingXResizing:withMinXMargin: */ -(void) addView: (NSView *)aView; /** See -addView:enablingXResizing:withMinXMargin: */ -(void) addView: (NSView *)aView enablingXResizing: (BOOL)aFlag; /** See -addView:enablingXResizing:withMinXMargin: */ -(void) addView: (NSView *)aView withMinXMargin: (float)aMargin; /**

Pack views in the GSHbox. Don't use the corresponding methods of GSTable, which are far more general and far more complicate. If you need to do that, use GSTable instead.

Add a view to the box, enabling X Resizing only if flag is YES, and a MinXMargin aMargin. If aFlag is YES the [view and its margins] should be resized in the horizontal direction when the GSHbox is resized in the horizontal direction. If aFlag is NO the view is never X-resized and always left in its original width. The default is YES.

The min X margin is used to separate the view from the preceding one. The first view added to the box has no min X margin; if you try setting one for it, it is ignored (zero is used instead).

When views are added to the GSHbox, it might happen that some of the added views have a greater height than others. When this happens, the GSHbox resizes all the views to the highest height. As usual, each view is resized with its margins; the effect of the resizing on each view is determined by the autoresizing mask of the view. The classical options are

(NSViewMinYMargin | NSViewMaxYMargin) Center the view vertically NSViewMinYMargin Flush the view up (down if the GSHbox is flipped) NSViewMaxYMargin Flush the view down (up if the GSHbox is flipped) NSViewHeightSizable Expand the view to the whole height

(you may need to OR these masks with the mask you use in the horizontal direction, if you use any).

With a GSHbox, only one margin is set when you add views to the GSHbox: the margin between each view and the preceding one. Exception: the first view is special, and has no margin set (it has no preceding view to be separated from). Space above or below the view may result if the view is shorter, in the vertical direction, than the other views in the GSHbox; in that case the view is resized to fit vertically, according to its autoresizingMask. By changing the autoresizingMask you may decide whether the space should go to the view or to its vertical margins; this for example lets you center vertically or flush up/down your view.

*/ -(void) addView: (NSView *)aView enablingXResizing: (BOOL)aFlag withMinXMargin: (float)aMargin; // // Adding a Separator. // /** Add a separator with the default MinXMargin. */ -(void) addSeparator; /** Add a separator (a vertical groove line encompassing all the height of the GSHbox) to the GSHbox, inserting a margin aMargin between the separator and the last added view. */ -(void) addSeparatorWithMinXMargin: (float)aMargin; // // Setting Margins. // /** Use only the following method to set a default margin. The default margin set with the following method will be used for all the views added after. (Exception: the first view put in the box has no margins at all) It will not affect already added views. In a GSHbox, only one margin is used, the one between each view and the preceding one. If what you want is space around the GSHbox, you don't want a margin but a border; use setBorder: (see GSTable, "Setting Border"). If you need more complicated margins/borders, use GSTable. */ -(void) setDefaultMinXMargin: (float)aMargin; // // Getting Number of Views // /** Return the number of views in the GSHbox (separators included). */ -(int) numberOfViews; @end #endif /* _GNUstep_H_GSHbox */ gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSPasteboardServer.h0000664000076500007650000000552211357044577025024 0ustar brains99brains99/* GSPasteboardServer.h Copyright (C) 1997,1999 Free Software Foundation, Inc. Author: Richard Frith-Macdonald Date: August 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSPasteboardServer #define _GNUstep_H_GSPasteboardServer #import #import #import @class NSString; @class NSArray; @class NSData; /* * The name of the pasteboard server. */ #define PBSNAME @"GNUstepGSPasteboardServer" /* * This protocol for use in asking GSPasteboardObj on the server to * perform tasks for the local NSPasteboard objects. */ @protocol GSPasteboardObj - (int) addTypes: (in bycopy NSArray*)types owner: (id)owner pasteboard: (NSPasteboard*)pb oldCount: (int)count; - (NSString*) availableTypeFromArray: (in bycopy NSArray*)types changeCount: (int*)count; - (int) changeCount; - (NSData*) dataForType: (in bycopy NSString*)type oldCount: (int)count mustBeCurrent: (BOOL)flag; - (int) declareTypes: (in bycopy NSArray*)types owner: (id)owner pasteboard: (NSPasteboard*)pb; - (NSString*) name; - (void) releaseGlobally; - (BOOL) setData: (in bycopy NSData*)data forType: (in bycopy NSString*)type isFile: (BOOL)flag oldCount: (int)count; - (void) setHistory: (unsigned)length; - (bycopy NSArray*) typesAndChangeCount: (int*)count; @end /* * This protocol for use in obtaining GSPasteboardObj from the server * and controlling general server behaviour. */ @protocol GSPasteboardSvr - (id) pasteboardWithName: (in bycopy NSString*)name; @end /* * This protocol is used by the server to ask pasteboard clients to * provide additional data. */ @protocol GSPasteboardCallback - (void) pasteboard: (NSPasteboard*)pb provideDataForType: (NSString*)type; - (void) pasteboard: (NSPasteboard*)pb provideDataForType: (NSString*)type andVersion:(int)v; - (void) pasteboardChangedOwner: (NSPasteboard*)pb; @end #endif // _GNUstep_H_GSPasteboardServer gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSFontInfo.h0000664000076500007650000001163111340007043023244 0ustar brains99brains99/* GSFontInfo.h Private class for handling font info Copyright (C) 2000 Free Software Foundation, Inc. Author: Adam Fedor Date: Mar 2000 This file is part of the GNUstep. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __GSFontInfo_h_INCLUDE_ #define __GSFontInfo_h_INCLUDE_ #import #import @class NSMutableDictionary; @class NSArray; @class NSBezierPath; @class NSFontDescriptor; @interface GSFontEnumerator : NSObject { NSArray *allFontNames; NSMutableDictionary *allFontFamilies; NSArray *allFontDescriptors; } + (void) setDefaultClass: (Class)defaultClass; + (GSFontEnumerator*) sharedEnumerator; - (void) enumerateFontsAndFamilies; - (NSArray*) availableFonts; - (NSArray*) availableFontFamilies; - (NSArray*) availableMembersOfFontFamily: (NSString*)family; - (NSArray*) availableFontDescriptors; - (NSArray *) availableFontNamesMatchingFontDescriptor: (NSFontDescriptor *)descriptor; - (NSArray *) matchingFontDescriptorsFor: (NSDictionary *)attributes; /* Note that these are only called once. NSFont will remember the returned values. Backends may override these. */ - (NSString *) defaultSystemFontName; - (NSString *) defaultBoldSystemFontName; - (NSString *) defaultFixedPitchFontName; @end @interface GSFontInfo : NSObject { NSMutableDictionary* fontDictionary; // metrics of the font NSString *fontName; NSString *familyName; CGFloat matrix[6]; CGFloat italicAngle; CGFloat underlinePosition; CGFloat underlineThickness; CGFloat capHeight; CGFloat xHeight; CGFloat descender; CGFloat ascender; NSSize maximumAdvancement; NSSize minimumAdvancement; NSString *encodingScheme; NSStringEncoding mostCompatibleStringEncoding; NSRect fontBBox; BOOL isFixedPitch; BOOL isBaseFont; int weight; NSFontTraitMask traits; unsigned numberOfGlyphs; NSCharacterSet *coveredCharacterSet; NSFontDescriptor *fontDescriptor; } + (GSFontInfo*) fontInfoForFontName: (NSString*)fontName matrix: (const CGFloat*)fmatrix screenFont: (BOOL)screenFont; + (void) setDefaultClass: (Class)defaultClass; + (NSString*) stringForWeight: (int)weight; + (int) weightForString: (NSString*)weightString; - (NSSize) advancementForGlyph: (NSGlyph)aGlyph; - (NSDictionary*) afmDictionary; - (NSString*) afmFileContents; - (void) appendBezierPathWithGlyphs: (NSGlyph*)glyphs count: (int)count toBezierPath: (NSBezierPath*)path; - (CGFloat) ascender; - (NSRect) boundingRectForGlyph: (NSGlyph)aGlyph; - (NSRect) boundingRectForFont; - (CGFloat) capHeight; - (NSCharacterSet*) coveredCharacterSet; - (CGFloat) defaultLineHeightForFont; - (CGFloat) descender; - (NSString *) displayName; - (NSString *) encodingScheme; - (NSString *) familyName; - (NSString *) fontName; - (BOOL) glyphIsEncoded: (NSGlyph)aGlyph; - (NSMultibyteGlyphPacking) glyphPacking; - (NSGlyph) glyphWithName: (NSString*)glyphName; - (BOOL) isFixedPitch; - (BOOL) isBaseFont; - (CGFloat) italicAngle; - (const CGFloat*) matrix; - (NSSize) maximumAdvancement; - (NSSize) minimumAdvancement; - (NSStringEncoding) mostCompatibleStringEncoding; - (NSUInteger) numberOfGlyphs; - (NSPoint) positionOfGlyph: (NSGlyph)aGlyph forCharacter: (unichar)aChar struckOverRect: (NSRect)aRect; - (NSPoint) positionOfGlyph: (NSGlyph)curGlyph precededByGlyph: (NSGlyph)prevGlyph isNominal: (BOOL*)nominal; - (NSPoint) positionOfGlyph: (NSGlyph)aGlyph struckOverGlyph: (NSGlyph)baseGlyph metricsExist: (BOOL *)flag; - (NSPoint) positionOfGlyph: (NSGlyph)aGlyph struckOverRect: (NSRect)aRect metricsExist: (BOOL *)flag; - (NSPoint) positionOfGlyph: (NSGlyph)aGlyph withRelation: (NSGlyphRelation)relation toBaseGlyph: (NSGlyph)baseGlyph totalAdvancement: (NSSize *)offset metricsExist: (BOOL *)flag; - (NSFontTraitMask) traits; - (CGFloat) underlinePosition; - (CGFloat) underlineThickness; - (int) weight; - (CGFloat) widthOfString: (NSString*)string; - (CGFloat) xHeight; - (NSGlyph) glyphForCharacter: (unichar)theChar; - (NSFontDescriptor*) fontDescriptor; @end #endif /* __GSFontInfo_h_INCLUDE_ */ gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSLayoutManager.h0000664000076500007650000003072711616104556024316 0ustar brains99brains99/* GSLayoutManager.h Copyright (C) 2002, 2003 Free Software Foundation, Inc. Author: Alexander Malmberg Date: November 2002 - February 2003 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSLayoutManager #define _GNUstep_H_GSLayoutManager #import #import #import #import @class GSTypesetter; @class NSTextStorage,NSTextContainer; typedef enum { NSGlyphInscribeBase = 0, NSGlyphInscribeBelow = 1, NSGlyphInscribeAbove = 2, NSGlyphInscribeOverstrike = 3, NSGlyphInscribeOverBelow = 4 } NSGlyphInscription; enum { NSGlyphAttributeSoft = 0, NSGlyphAttributeElastic = 1, #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) NSGlyphAttributeBidiLevel = 2, #endif NSGlyphAttributeInscribe = 5 }; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) @interface GSLayoutManager : NSObject #else @interface GSLayoutManager : NSObject #endif { @protected NSTextStorage *_textStorage; NSGlyphGenerator *_glyphGenerator; id _delegate; BOOL usesScreenFonts; BOOL backgroundLayoutEnabled; BOOL showsInvisibleCharacters; BOOL showsControlCharacters; GSTypesetter *typesetter; /* Glyph storage */ /* Skip list of runs */ struct GSLayoutManager_glyph_run_head_s *glyphs; /* number of runs created from existing text (ie. not as a result of stuff being invalidated) */ int glyph_num_end_runs; /* Layout storage */ /* OPT: This is just a simple implementation that should let me figure out how it's supposed to work. It's functional and correct, but it isn't fast. */ unsigned int layout_glyph, layout_char; struct GSLayoutManager_textcontainer_s *textcontainers; int num_textcontainers; NSRect extra_rect, extra_used_rect; NSTextContainer *extra_textcontainer; /* For -rectArrayForGlyphRange:... */ NSRect *rect_array; int rect_array_size; /* Cached run. GSHorizontalTypesetter (and other typesetters, presumably) often walk linearly through the glyphs. Thus, for many methods, we cache the last run so we can quickly get more information for the next glyph. */ struct GSLayoutManager_glyph_run_s *cached_run; unsigned int cached_pos, cached_cpos; } - (NSTextStorage *) textStorage; - (void) setTextStorage: (NSTextStorage *)aTextStorage; - (void) replaceTextStorage: (NSTextStorage *)newTextStorage; - (NSGlyphGenerator *) glyphGenerator; - (void) setGlyphGenerator: (NSGlyphGenerator *)glyphGenerator; - (id) delegate; - (void) setDelegate: (id)aDelegate; -(GSTypesetter *) typesetter; -(void) setTypesetter: (GSTypesetter *)typesetter; - (void) setBackgroundLayoutEnabled: (BOOL)flag; - (BOOL) backgroundLayoutEnabled; - (void) setShowsInvisibleCharacters: (BOOL)flag; - (BOOL) showsInvisibleCharacters; - (void) setShowsControlCharacters: (BOOL)flag; - (BOOL) showsControlCharacters; /** Font handling **/ - (BOOL) usesScreenFonts; - (void) setUsesScreenFonts: (BOOL)flag; - (NSFont *) substituteFontForFont: (NSFont *)originalFont; /* (?) Sent by the NSTextStorage. mask tells us if attributes or characters (or both) have been changed. range is the range of directly modified characters. invalidatedRange is the range of characters affected by the changes (contains range but may be larger due to eg. attribute fixing). If characters have been edited, lengthChange has the text length delta. */ - (void) textStorage: (NSTextStorage *)aTextStorage edited: (unsigned int)mask range: (NSRange)range changeInLength: (int)lengthChange invalidatedRange: (NSRange)invalidatedRange; /** * GNUstep extension */ - (void) insertGlyphs: (const NSGlyph*)glyph_list withAdvancements: (const NSSize*)advancements length: (NSUInteger)length forStartingGlyphAtIndex: (NSUInteger)glyph characterIndex: (NSUInteger)index; @end @interface GSLayoutManager (glyphs) /** Glyph handling **/ /* Mark the glyphs for the characters in aRange as invalid. lengthChange is the text length delta. If not NULL, the range of characters actually affected (_after_ the change) will be returned in actualRange. This method is used internally and should _not_ be called. (It interacts in complex ways with layout invalidation.) */ - (void) invalidateGlyphsForCharacterRange: (NSRange)aRange changeInLength: (int)lengthChange actualCharacterRange: (NSRange *)actualRange; /* These are internal methods and should _not_ be called. */ - (void) insertGlyph: (NSGlyph)aGlyph atGlyphIndex: (unsigned int)glyphIndex characterIndex: (unsigned int)charIndex; - (void) replaceGlyphAtIndex: (unsigned int)glyphIndex withGlyph: (NSGlyph)newGlyph; - (void) deleteGlyphsInRange: (NSRange)aRange; - (void) setCharacterIndex: (unsigned int)charIndex forGlyphAtIndex: (unsigned int)glyphIndex; /* Returns total number of glyphs. */ - (unsigned int) numberOfGlyphs; /* Returns the glyph at glyphIndex or raises an NSRangeException if the index is invalid (past the end of the glyphs). */ - (NSGlyph) glyphAtIndex: (unsigned int)glyphIndex; /* Returns the glyph at glyphIndex and sets isValidIndex to YES if the index is valid. Otherwise, the return value is arbitrary and isValidIndex is set to NO. */ - (NSGlyph) glyphAtIndex: (unsigned int)glyphIndex isValidIndex: (BOOL *)isValidIndex; /* Returns if the glyph at glyphIndex is valid or not */ - (BOOL) isValidGlyphIndex: (unsigned int)glyphIndex; /* Copies displayed glyphs to glyphArray for glyphRange. Returns the number of glyphs actually copied to the array. NSRangeException of the range is invalid (extends beyond the end of glyphs). */ - (unsigned int) getGlyphs: (NSGlyph *)glyphArray range: (NSRange)glyphRange; /* Return the first character for the glyph at glyphIndex. (NSRangeException?) */ - (unsigned int) characterIndexForGlyphAtIndex: (unsigned int)glyphIndex; /** * GNUstep extension */ - (NSSize) advancementForGlyphAtIndex: (unsigned int)glyphIndex; /* Returns the range of glyphs for the characters in charRange. If actualRange isn't NULL, the exact range of characters for the glyphs in the returned range is returned there. */ - (NSRange) glyphRangeForCharacterRange: (NSRange)charRange actualCharacterRange: (NSRange *)actualCharRange; /* Returns the range of characters for the glyphs in glyphRange. Returns the actual glyphs for the characters in the range in actualGlyphRange, if it isn't NULL. */ - (NSRange) characterRangeForGlyphRange: (NSRange)glyphRange actualGlyphRange: (NSRange *)actualGlyphRange; /* These can be used to set arbitrary tags on individual glyphs. Non-negative tags are reserved. You must provide storage yourself (by subclassing). */ #if !OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (void) setIntAttribute: (int)attributeTag value: (int)anInt forGlyphAtIndex: (unsigned int)glyphIndex; #endif - (int) intAttribute: (int)attributeTag forGlyphAtIndex: (unsigned int)glyphIndex; /* Returns the font actually used for a range of glyphs. This isn't necessarily the font specified by NSFontAttributeName; both the typesetter and the layout manager can substitute a different font (the typesetter might eg. substitute a smaller font for sub-/super-scripted text, and the layout manager might be substituting screen fonts. */ - (NSFont *) effectiveFontForGlyphAtIndex: (unsigned int)glyphIndex range: (NSRange *)range; /* GNUstep extension */ - (void) setDrawsOutsideLineFragment: (BOOL)flag forGlyphAtIndex: (unsigned int)glyphIndex; - (BOOL) drawsOutsideLineFragmentForGlyphAtIndex: (unsigned int) glyphIndex; - (void) setNotShownAttribute: (BOOL)flag forGlyphAtIndex: (unsigned int)glyphIndex; - (BOOL) notShownAttributeForGlyphAtIndex: (unsigned int) glyphIndex; @end @interface GSLayoutManager (layout) /** Text containers **/ - (NSArray *) textContainers; - (void) addTextContainer: (NSTextContainer *)container; - (void) insertTextContainer: (NSTextContainer*)aTextContainer atIndex: (unsigned int)index; - (void) removeTextContainerAtIndex: (unsigned int)index; - (void) textContainerChangedGeometry: (NSTextContainer *)aContainer; /** Layout **/ /* This method is used internally and should _not_ be called. (It interacts in complex ways with glyph invalidation, and with itself when doing soft invalidation.) */ - (void) invalidateLayoutForCharacterRange: (NSRange)aRange isSoft: (BOOL)flag actualCharacterRange: (NSRange *)actualRange; - (void) setTextContainer: (NSTextContainer *)aTextContainer forGlyphRange: (NSRange)glyphRange; - (void) setLineFragmentRect: (NSRect)fragmentRect forGlyphRange: (NSRange)glyphRange usedRect: (NSRect)usedRect; - (void) setLocation: (NSPoint)location forStartOfGlyphRange: (NSRange)glyphRange; - (void) setAttachmentSize: (NSSize)attachmentSize forGlyphRange: (NSRange)glyphRange; /* not OPENSTEP */ - (NSTextContainer *) textContainerForGlyphAtIndex: (NSUInteger)glyphIndex effectiveRange: (NSRange *)effectiveRange; - (NSRect) lineFragmentRectForGlyphAtIndex: (NSUInteger)glyphIndex effectiveRange: (NSRange *)effectiveGlyphRange; - (NSRect) lineFragmentUsedRectForGlyphAtIndex: (NSUInteger)glyphIndex effectiveRange: (NSRange *)effectiveGlyphRange; #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (NSTextContainer *) textContainerForGlyphAtIndex: (NSUInteger)glyphIndex effectiveRange: (NSRange *)effectiveRange withoutAdditionalLayout: (BOOL)flag; - (NSRect) lineFragmentRectForGlyphAtIndex: (NSUInteger)glyphIndex effectiveRange: (NSRange *)effectiveGlyphRange withoutAdditionalLayout: (BOOL)flag; - (NSRect) lineFragmentUsedRectForGlyphAtIndex: (NSUInteger)glyphIndex effectiveRange: (NSRange *)effectiveGlyphRange withoutAdditionalLayout: (BOOL)flag; #endif /* The typesetter may set this to mark where the rectangle the insertion point is to be placed if the insertion point is beyond the last character of the text. The extra text container is reset to nil any time layout is invalidated. */ -(void) setExtraLineFragmentRect: (NSRect)linefrag usedRect: (NSRect)used textContainer: (NSTextContainer *)tc; -(NSRect) extraLineFragmentRect; -(NSRect) extraLineFragmentUsedRect; -(NSTextContainer *) extraLineFragmentTextContainer; /* Extension, but without this, there's no way to get the starting locations of the nominally spaced glyphs. */ - (NSRange) rangeOfNominallySpacedGlyphsContainingIndex:(unsigned int)glyphIndex startLocation: (NSPoint *)p; - (NSRange) rangeOfNominallySpacedGlyphsContainingIndex:(unsigned int)glyphIndex; /* The union of all line frag rects' used rects. (TODO: shouldn't this be just the union of all the line frag rects?) */ - (NSRect) usedRectForTextContainer: (NSTextContainer *)container; - (NSRange) glyphRangeForTextContainer: (NSTextContainer *)container; - (unsigned int) firstUnlaidCharacterIndex; - (unsigned int) firstUnlaidGlyphIndex; - (void) getFirstUnlaidCharacterIndex: (unsigned int *)charIndex glyphIndex: (unsigned int *)glyphIndex; /* Basic (and experimental) methods that let the typesetter use soft-invalidated layout information. */ -(void) _softInvalidateUseLineFrags: (int)num withShift: (NSSize)shift inTextContainer: (NSTextContainer *)textContainer; -(NSRect) _softInvalidateLineFragRect: (int)index firstGlyph: (unsigned int *)first_glyph nextGlyph: (unsigned int *)next_glyph inTextContainer: (NSTextContainer *)textContainer; -(unsigned int) _softInvalidateFirstGlyphInTextContainer: (NSTextContainer *)textContainer; -(unsigned int) _softInvalidateNumberOfLineFragsInTextContainer: (NSTextContainer *)textContainer; @end @interface NSObject (GSLayoutManagerDelegate) -(void) layoutManager: (GSLayoutManager *)layoutManager didCompleteLayoutForTextContainer: (NSTextContainer *)textContainer atEnd: (BOOL)atEnd; @end #endif gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSModelLoaderFactory.h0000664000076500007650000000404212246625344025257 0ustar brains99brains99/** NSBundleAdditions Implementation of NSBundle Additions Copyright (C) 2005 Free Software Foundation, Inc. Author: Gregory John Casamento Date: 2005 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSModelLoaderFactory #define _GNUstep_H_GSModelLoaderFactory #import #import @class NSArray; @class NSData; @class NSDictionary; @class NSString; @class NSBundle; @interface GSModelLoader : NSObject + (NSString *) type; + (float) priority; - (BOOL) loadModelData: (NSData *)data externalNameTable: (NSDictionary *)context withZone: (NSZone *)zone; - (BOOL) loadModelFile: (NSString *)fileName externalNameTable: (NSDictionary *)context withZone: (NSZone *)zone; - (NSData *)dataForFile: (NSString *)fileName; @end @interface GSModelLoaderFactory : NSObject + (void) registerModelLoaderClass: (Class)aClass; + (Class) classForType: (NSString *)type; + (NSArray *) supportedTypes; + (NSString *) supportedModelFileAtPath: (NSString *)modelPath; + (GSModelLoader *) modelLoaderForFileType: (NSString *)type; + (GSModelLoader *) modelLoaderForFileName: (NSString *)modelPath; @end #endif gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSSoundSource.h0000664000076500007650000000535311354602172024010 0ustar brains99brains99/* GSSoundSource.h Load and read sound data. Copyright (C) 2009 Free Software Foundation, Inc. Written by: Stefan Bidigaray Date: Jun 2009 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSSoundSource #define _GNUstep_H_GSSoundSource #import #import @class NSArray; enum { GSSoundFormatUnknown = 0x0000, GSSoundFormatPCMS8 = 0x0001, GSSoundFormatPCM16 = 0x0002, GSSoundFormatPCM24 = 0x0003, GSSoundFormatPCM32 = 0x0004, GSSoundFormatPCMU8 = 0x0005, GSSoundFormatFloat32 = 0x0006, GSSoundFormatFloat64 = 0x0007, GSSoundFormatULaw = 0x0010, GSSoundFormatALaw = 0x0011 }; @protocol GSSoundSource /** Returns an array of the file types supported by the class. */ + (NSArray *)soundUnfilteredFileTypes; /** Returns an array of UTIs identifying the file types the class understands. */ + (NSArray *)soundUnfilteredTypes; /** Returns YES if the class can understand data and NO otherwise. */ + (BOOL)canInitWithData: (NSData *)data; /** * Initilizes the reciever for output. */ - (id)initWithData: (NSData *)data; /** Reads data provided in -initWithData:. Parameter bytes must be big enough * to hold length bytes. */ - (NSUInteger)readBytes: (void *)bytes length: (NSUInteger)length; /** Returns the duration, in seconds. Equivalent to [NSSound-duration]. */ - (NSTimeInterval)duration; /** Called by [NSSound-setCurrentTime:]. */ - (void)setCurrentTime: (NSTimeInterval)currentTime; /** Called by [NSSound-currentTime]. */ - (NSTimeInterval)currentTime; /** Returns encoding of the audio data. */ - (int)encoding; /** Returns the number of channels. */ - (NSUInteger)channelCount; /** Returns the receiver's sample rate (ie 44100, 8000, etc). */ - (NSUInteger)sampleRate; /** Returns the byte order of the audio data. */ - (NSByteOrder)byteOrder; @end #endif // _GNUstep_H_GSSoundSource gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSVbox.h0000664000076500007650000000505711357044577022472 0ustar brains99brains99/* GSVbox.h The GSVbox class (a GNU extension) Copyright (C) 1999 Free Software Foundation, Inc. Author: Nicola Pero Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ // // See GSHbox.h for comments. // This file is generated from GSHbox.h by removing comments // and substituting all occurrences of "hbox" with "vbox", // "XResizing" with "YResizing", "MinXMargin" with "MinYMargin". // #ifndef _GNUstep_H_GSVbox #define _GNUstep_H_GSVbox #import "GSTable.h" /** GSVbox

A GSVbox is completely analogue to a GSHbox. It implements the same methods; the only different is that it packs views from bottom to top (from top to bottom if flipped).

*/ @interface GSVbox: GSTable { BOOL _haveViews; float _defaultMinYMargin; } // // Initizialing. // -(id) init; // // Adding a View. // /** See the documentation for GSHbox */ -(void) addView: (NSView *)aView; /** See the documentation for GSHbox */ -(void) addView: (NSView *)aView enablingYResizing: (BOOL)aFlag; /** See the documentation for GSHbox */ -(void) addView: (NSView *)aView withMinYMargin: (float)aMargin; /** See the documentation for GSHbox */ -(void) addView: (NSView *)aView enablingYResizing: (BOOL)aFlag withMinYMargin: (float)aMargin; // // Adding a Separator. // /** See the documentation for GSHbox */ -(void) addSeparator; /** See the documentation for GSHbox */ -(void) addSeparatorWithMinYMargin: (float)aMargin; // // Setting Margins. // /** See the documentation for GSHbox */ -(void) setDefaultMinYMargin: (float)aMargin; // // Getting Number of Views // /** Return the number of views in the GSVbox (separators included). */ -(int) numberOfViews; @end #endif /* _GNUstep_H_GSVbox */ gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSTitleView.h0000664000076500007650000000430711536247102023451 0ustar brains99brains99/** GSTitleView Copyright (C) 2003 Free Software Foundation, Inc. Author: Serg Stoyan Date: Mar 2003 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSTitleView #define _GNUstep_H_GSTitleView #import @class NSMutableDictionary; @class NSButton; @class NSImage; @interface GSTitleView : NSView { NSButton *closeButton; NSButton *miniaturizeButton; NSMutableDictionary *textAttributes; NSColor *titleColor; @private id _owner; unsigned _ownedByMenu; unsigned _isKeyWindow; unsigned _isMainWindow; unsigned _isActiveApplication; } // ============================================================================ // ==== Initialization & deallocation // ============================================================================ + (float) height; - (void) setOwner: (id)owner; - (id) initWithOwner: (id)owner; - (id) owner; - (NSSize) titleSize; // ============================================================================ // ==== Buttons // ============================================================================ - (void) addCloseButtonWithAction: (SEL)closeAction; - (NSButton *) closeButton; - (void) removeCloseButton; - (void) addMiniaturizeButtonWithAction: (SEL)miniaturizeAction; - (NSButton *)miniaturizeButton; - (void) removeMiniaturizeButton; @end #endif gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSCharacterPanel.h0000664000076500007650000000267311605125765024424 0ustar brains99brains99/* GSCharacterPanel.h Ghostscript image representation. Copyright (C) 2011 Free Software Foundation, Inc. Written by: Eric Wasylishen Date: June 2011 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSCharacterPanel #define _GNUstep_H_GSCharacterPanel #import @class NSTableView; @class NSSearchField; @class NSIndexSet; @interface GSCharacterPanel : NSPanel { NSTableView *table; NSSearchField *searchfield; NSIndexSet *assignedCodepoints; NSIndexSet *visibleCodepoints; } + (GSCharacterPanel *) sharedCharacterPanel; @end #endif // _GNUstep_H_GSCharacterPanel gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSDisplayServer.h0000664000076500007650000001653312210100616024321 0ustar brains99brains99/** GSDisplayServer Abstract display server class. Copyright (C) 2002 Free Software Foundation, Inc. Author: Adam Fedor Date: Mar 2002 This file is part of the GNU Objective C User interface library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GSDisplayServer_h_INCLUDE #define _GSDisplayServer_h_INCLUDE #import #import #import #import #import @class NSArray; @class NSCountedSet; @class NSDictionary; @class NSMapTable; @class NSMutableArray; @class NSMutableData; @class NSMutableDictionary; @class NSString; @class NSEvent; @class NSImage; @class GSDisplayServer; @class NSGraphicsContext; @class NSWindow; #if !NO_GNUSTEP APPKIT_EXPORT GSDisplayServer *GSServerForWindow(NSWindow *window); APPKIT_EXPORT GSDisplayServer *GSCurrentServer(void); /* Display attributes */ APPKIT_EXPORT NSString *GSDisplayName; APPKIT_EXPORT NSString *GSDisplayNumber; APPKIT_EXPORT NSString *GSScreenNumber; @interface GSDisplayServer : NSObject { NSMutableDictionary *server_info; NSMutableArray *event_queue; NSMapTable *drag_types; } + (void) setDefaultServerClass: (Class)aClass; + (GSDisplayServer *) serverWithAttributes: (NSDictionary *)attributes; + (void) setCurrentServer: (GSDisplayServer *)server; - initWithAttributes: (NSDictionary *)attributes; - (NSDictionary *) attributes; - (void) closeServer; /* GL context */ - glContextClass; - glPixelFormatClass; - (BOOL) handlesWindowDecorations; /* Drag and drop support. */ + (BOOL) addDragTypes: (NSArray*)types toWindow: (NSWindow *)win; + (BOOL) removeDragTypes: (NSArray*)types fromWindow: (NSWindow *)win; + (NSCountedSet*) dragTypesForWindow: (NSWindow *)win; - (BOOL) addDragTypes: (NSArray*)types toWindow: (NSWindow *)win; - (BOOL) removeDragTypes: (NSArray*)types fromWindow: (NSWindow *)win; - (NSCountedSet*) dragTypesForWindow: (NSWindow *)win; - (id ) dragInfo; - (BOOL) slideImage: (NSImage*)image from: (NSPoint)from to: (NSPoint)to; - (void) restrictWindow: (int)win toImage: (NSImage*)image; - (int) findWindowAt: (NSPoint)screenLocation windowRef: (int*)windowRef excluding: (int)win; /* Screen information */ - (NSSize) resolutionForScreen: (int)screen; - (NSRect) boundsForScreen: (int)screen; - (NSWindowDepth) windowDepthForScreen: (int)screen; - (const NSWindowDepth *) availableDepthsForScreen: (int)screen; - (NSArray *) screenList; - (void *) serverDevice; - (void *) windowDevice: (int)win; - (void) beep; /* AppIcon/MiniWindow information */ - (NSImage *) iconTileImage; - (NSSize) iconSize; /* Screen capture */ - (NSImage *) contentsOfScreen: (int)screen inRect: (NSRect)rect; @end /* ----------------------------------------------------------------------- */ /* GNUstep Window operations */ /* ----------------------------------------------------------------------- */ @interface GSDisplayServer (WindowOps) - (void) _setWindowOwnedByServer: (int)win; - (int) window: (NSRect)frame : (NSBackingStoreType)type : (unsigned int)style; - (int) window: (NSRect)frame : (NSBackingStoreType)type : (unsigned int)style : (int)screen; - (void) termwindow: (int)win; - (int) nativeWindow: (void *)winref : (NSRect*)frame : (NSBackingStoreType*)type : (unsigned int*)style : (int*)screen; /* Only if handlesWindowDecorations returns YES. */ - (void) stylewindow: (unsigned int)style : (int)win; - (void) windowbacking: (NSBackingStoreType)type : (int)win; - (void) titlewindow: (NSString *)window_title : (int)win; - (void) miniwindow: (int)win; - (BOOL) appOwnsMiniwindow; - (void) setWindowdevice: (int)win forContext: (NSGraphicsContext *)ctxt; // Deprecated - (void) windowdevice: (int) winNum; - (void) orderwindow: (int)op : (int)otherWin : (int)win; - (void) movewindow: (NSPoint)loc : (int)win; - (void) placewindow: (NSRect)frame : (int)win; - (NSRect) windowbounds: (int)win; - (void) setwindowlevel: (int)level : (int)win; - (int) windowlevel: (int)win; - (NSArray *) windowlist; - (int) windowdepth: (int)win; - (void) setmaxsize: (NSSize)size : (int)win; - (void) setminsize: (NSSize)size : (int)win; - (void) setresizeincrements: (NSSize)size : (int)win; - (void) flushwindowrect: (NSRect)rect : (int)win; - (void) styleoffsets: (float*)l : (float*)r : (float*)t : (float*)b : (unsigned int)style; - (void) docedited: (int) edited : (int)win; - (void) setinputstate: (int)state : (int)win; - (void) setinputfocus: (int)win; - (void) setalpha: (float)alpha : (int)win; - (void) setShadow: (BOOL)hasShadow : (int)win; - (NSPoint) mouselocation; - (NSPoint) mouseLocationOnScreen: (int)aScreen window: (int *)win; - (BOOL) capturemouse: (int)win; - (void) releasemouse; - (void) setMouseLocation: (NSPoint)mouseLocation onScreen: (int)aScreen; - (void) hidecursor; - (void) showcursor; - (void) standardcursor: (int) style : (void**)cid; - (void) imagecursor: (NSPoint)hotp : (NSImage *) image : (void**)cid; - (void) setcursorcolor: (NSColor *)fg : (NSColor *)bg : (void*)cid; - (void) recolorcursor: (NSColor *)fg : (NSColor *)bg : (void*) cid; - (void) setcursor: (void*) cid; - (void) freecursor: (void*) cid; - (void) setParentWindow: (int)parentWin forChildWindow: (int)childWin; - (void) setIgnoreMouse: (BOOL)ignoreMouse : (int)win; @end /* ----------------------------------------------------------------------- */ /* GNUstep Event Operations */ /* ----------------------------------------------------------------------- */ @interface GSDisplayServer (EventOps) - (NSEvent*) getEventMatchingMask: (unsigned)mask beforeDate: (NSDate*)limit inMode: (NSString*)mode dequeue: (BOOL)flag; - (void) discardEventsMatchingMask: (unsigned)mask beforeEvent: (NSEvent*)limit; - (void) postEvent: (NSEvent*)anEvent atStart: (BOOL)flag; - (void) _printEventQueue; @end static inline NSEvent* DPSGetEvent(GSDisplayServer *ctxt, unsigned mask, NSDate* limit, NSString *mode) { return [ctxt getEventMatchingMask: mask beforeDate: limit inMode: mode dequeue: YES]; } static inline NSEvent* DPSPeekEvent(GSDisplayServer *ctxt, unsigned mask, NSDate* limit, NSString *mode) { return [ctxt getEventMatchingMask: mask beforeDate: limit inMode: mode dequeue: NO]; } static inline void DPSDiscardEvents(GSDisplayServer *ctxt, unsigned mask, NSEvent* limit) { [ctxt discardEventsMatchingMask: mask beforeEvent: limit]; } static inline void DPSPostEvent(GSDisplayServer *ctxt, NSEvent* anEvent, BOOL atStart) { [ctxt postEvent: anEvent atStart: atStart]; } #endif /* NO_GNUSTEP */ #endif gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSMethodTable.h0000664000076500007650000002777012104255431023732 0ustar brains99brains99/* GSMethodTable.h - Definitions of PostScript methods for NSGraphicsContext Copyright (C) 1998 Free Software Foundation, Inc. Written by: Adam Fedor Date: Nov 1998 Updated by: Richard Frith-Macdonald This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GSMethodTable_h_INCLUDE #define _GSMethodTable_h_INCLUDE #import #import #import @class NSAffineTransform; @class NSDate; @class NSString; @class NSBezierPath; @class NSColor; @class NSEvent; @class NSGraphicsContext; typedef struct { /* ----------------------------------------------------------------------- */ /* Color operations */ /* ----------------------------------------------------------------------- */ void (*DPScurrentalpha_) (NSGraphicsContext*, SEL, CGFloat*); void (*DPScurrentcmykcolor____) (NSGraphicsContext*, SEL, CGFloat*, CGFloat*, CGFloat*, CGFloat*); void (*DPScurrentgray_) (NSGraphicsContext*, SEL, CGFloat*); void (*DPScurrenthsbcolor___) (NSGraphicsContext*, SEL, CGFloat*, CGFloat*, CGFloat*); void (*DPScurrentrgbcolor___) (NSGraphicsContext*, SEL, CGFloat*, CGFloat*, CGFloat*); void (*DPSsetalpha_) (NSGraphicsContext*, SEL, CGFloat); void (*DPSsetcmykcolor____) (NSGraphicsContext*, SEL, CGFloat, CGFloat, CGFloat, CGFloat); void (*DPSsetgray_) (NSGraphicsContext*, SEL, CGFloat); void (*DPSsethsbcolor___) (NSGraphicsContext*, SEL, CGFloat, CGFloat, CGFloat); void (*DPSsetrgbcolor___) (NSGraphicsContext*, SEL, CGFloat, CGFloat, CGFloat); void (*GSSetFillColorspace_) (NSGraphicsContext*, SEL, NSDictionary *); void (*GSSetStrokeColorspace_) (NSGraphicsContext*, SEL, NSDictionary *); void (*GSSetFillColor_) (NSGraphicsContext*, SEL, CGFloat *); void (*GSSetStrokeColor_) (NSGraphicsContext*, SEL, CGFloat *); /* ----------------------------------------------------------------------- */ /* Text operations */ /* ----------------------------------------------------------------------- */ void (*DPSashow___) (NSGraphicsContext*, SEL, CGFloat, CGFloat, const char*); void (*DPSawidthshow______) (NSGraphicsContext*, SEL, CGFloat, CGFloat, int, CGFloat, CGFloat, const char*); void (*DPScharpath__) (NSGraphicsContext*, SEL, const char*, int); void (*DPSshow_) (NSGraphicsContext*, SEL, const char*); void (*DPSwidthshow____) (NSGraphicsContext*, SEL, CGFloat, CGFloat, int, const char*); void (*DPSxshow___) (NSGraphicsContext*, SEL, const char*, const CGFloat*, int); void (*DPSxyshow___) (NSGraphicsContext*, SEL, const char*, const CGFloat*, int); void (*DPSyshow___) (NSGraphicsContext*, SEL, const char*, const CGFloat*, int); void (*GSSetCharacterSpacing_) (NSGraphicsContext*, SEL, CGFloat); void (*GSSetFont_) (NSGraphicsContext*, SEL, NSFont*); void (*GSSetFontSize_) (NSGraphicsContext*, SEL, CGFloat); NSAffineTransform * (*GSGetTextCTM) (NSGraphicsContext*, SEL); NSPoint (*GSGetTextPosition) (NSGraphicsContext*, SEL); void (*GSSetTextCTM_) (NSGraphicsContext*, SEL, NSAffineTransform *); void (*GSSetTextDrawingMode_) (NSGraphicsContext*, SEL, GSTextDrawingMode); void (*GSSetTextPosition_) (NSGraphicsContext*, SEL, NSPoint); void (*GSShowText__) (NSGraphicsContext*, SEL, const char *, size_t); void (*GSShowGlyphs__) (NSGraphicsContext*, SEL, const NSGlyph *, size_t); void (*GSShowGlyphsWithAdvances__) (NSGraphicsContext*, SEL, const NSGlyph *, const NSSize *, size_t); /* ----------------------------------------------------------------------- */ /* Gstate Handling */ /* ----------------------------------------------------------------------- */ void (*DPSgrestore) (NSGraphicsContext*, SEL); void (*DPSgsave) (NSGraphicsContext*, SEL); void (*DPSinitgraphics) (NSGraphicsContext*, SEL); void (*DPSsetgstate_) (NSGraphicsContext*, SEL, NSInteger); NSInteger (*GSDefineGState) (NSGraphicsContext*, SEL); void (*GSUndefineGState_) (NSGraphicsContext*, SEL, NSInteger); void (*GSReplaceGState_) (NSGraphicsContext*, SEL, NSInteger); /* ----------------------------------------------------------------------- */ /* Gstate operations */ /* ----------------------------------------------------------------------- */ void (*DPScurrentflat_) (NSGraphicsContext*, SEL, CGFloat*); void (*DPScurrentlinecap_) (NSGraphicsContext*, SEL, int*); void (*DPScurrentlinejoin_) (NSGraphicsContext*, SEL, int*); void (*DPScurrentlinewidth_) (NSGraphicsContext*, SEL, CGFloat*); void (*DPScurrentmiterlimit_) (NSGraphicsContext*, SEL, CGFloat*); void (*DPScurrentpoint__) (NSGraphicsContext*, SEL, CGFloat*, CGFloat*); void (*DPScurrentstrokeadjust_) (NSGraphicsContext*, SEL, int*); void (*DPSsetdash___) (NSGraphicsContext*, SEL, const CGFloat*, NSInteger, CGFloat); void (*DPSsetflat_) (NSGraphicsContext*, SEL, CGFloat); void (*DPSsethalftonephase__) (NSGraphicsContext*, SEL, CGFloat, CGFloat); void (*DPSsetlinecap_) (NSGraphicsContext*, SEL, int); void (*DPSsetlinejoin_) (NSGraphicsContext*, SEL, int); void (*DPSsetlinewidth_) (NSGraphicsContext*, SEL, CGFloat); void (*DPSsetmiterlimit_) (NSGraphicsContext*, SEL, CGFloat); void (*DPSsetstrokeadjust_) (NSGraphicsContext*, SEL, int); /* ----------------------------------------------------------------------- */ /* Matrix operations */ /* ----------------------------------------------------------------------- */ void (*DPSconcat_) (NSGraphicsContext*, SEL, const CGFloat*); void (*DPSinitmatrix) (NSGraphicsContext*, SEL); void (*DPSrotate_) (NSGraphicsContext*, SEL, CGFloat); void (*DPSscale__) (NSGraphicsContext*, SEL, CGFloat, CGFloat); void (*DPStranslate__) (NSGraphicsContext*, SEL, CGFloat, CGFloat); NSAffineTransform * (*GSCurrentCTM) (NSGraphicsContext*, SEL); void (*GSSetCTM_) (NSGraphicsContext*, SEL, NSAffineTransform *); void (*GSConcatCTM_) (NSGraphicsContext*, SEL, NSAffineTransform *); /* ----------------------------------------------------------------------- */ /* Paint operations */ /* ----------------------------------------------------------------------- */ void (*DPSarc_____) (NSGraphicsContext*, SEL, CGFloat, CGFloat, CGFloat, CGFloat, CGFloat); void (*DPSarcn_____) (NSGraphicsContext*, SEL, CGFloat, CGFloat, CGFloat, CGFloat, CGFloat); void (*DPSarct_____) (NSGraphicsContext*, SEL, CGFloat, CGFloat, CGFloat, CGFloat, CGFloat); void (*DPSclip) (NSGraphicsContext*, SEL); void (*DPSclosepath) (NSGraphicsContext*, SEL); void (*DPScurveto______) (NSGraphicsContext*, SEL, CGFloat, CGFloat, CGFloat, CGFloat, CGFloat, CGFloat); void (*DPSeoclip) (NSGraphicsContext*, SEL); void (*DPSeofill) (NSGraphicsContext*, SEL); void (*DPSfill) (NSGraphicsContext*, SEL); void (*DPSflattenpath) (NSGraphicsContext*, SEL); void (*DPSinitclip) (NSGraphicsContext*, SEL); void (*DPSlineto__) (NSGraphicsContext*, SEL, CGFloat, CGFloat); void (*DPSmoveto__) (NSGraphicsContext*, SEL, CGFloat, CGFloat); void (*DPSnewpath) (NSGraphicsContext*, SEL); void (*DPSpathbbox____) (NSGraphicsContext*, SEL, CGFloat*, CGFloat*, CGFloat*, CGFloat*); void (*DPSrcurveto______) (NSGraphicsContext*, SEL, CGFloat, CGFloat, CGFloat, CGFloat, CGFloat, CGFloat); void (*DPSrectclip____) (NSGraphicsContext*, SEL, CGFloat, CGFloat, CGFloat, CGFloat); void (*DPSrectfill____) (NSGraphicsContext*, SEL, CGFloat, CGFloat, CGFloat, CGFloat); void (*DPSrectstroke____) (NSGraphicsContext*, SEL, CGFloat, CGFloat, CGFloat, CGFloat); void (*DPSreversepath) (NSGraphicsContext*, SEL); void (*DPSrlineto__) (NSGraphicsContext*, SEL, CGFloat, CGFloat); void (*DPSrmoveto__) (NSGraphicsContext*, SEL, CGFloat, CGFloat); void (*DPSstroke) (NSGraphicsContext*, SEL); void (*GSSendBezierPath_) (NSGraphicsContext*, SEL, NSBezierPath *); void (*GSRectClipList__) (NSGraphicsContext*, SEL, const NSRect *, int); void (*GSRectFillList__) (NSGraphicsContext*, SEL, const NSRect *, int); /* ----------------------------------------------------------------------- */ /* Window system ops */ /* ----------------------------------------------------------------------- */ void (*GSCurrentDevice___) (NSGraphicsContext*, SEL, void**, int*, int*); void (*DPScurrentoffset__) (NSGraphicsContext*, SEL, int*, int*); void (*GSSetDevice___) (NSGraphicsContext*, SEL, void*, int, int); void (*DPSsetoffset__) (NSGraphicsContext*, SEL, short int, short int); /*-------------------------------------------------------------------------*/ /* Graphics Extensions Ops */ /*-------------------------------------------------------------------------*/ void (*DPScomposite________) (NSGraphicsContext*, SEL, CGFloat, CGFloat, CGFloat, CGFloat, NSInteger, CGFloat, CGFloat, NSCompositingOperation); void (*DPScompositerect_____) (NSGraphicsContext*, SEL, CGFloat, CGFloat, CGFloat, CGFloat, NSCompositingOperation); void (*DPSdissolve________) (NSGraphicsContext*, SEL, CGFloat, CGFloat, CGFloat, CGFloat, NSInteger, CGFloat, CGFloat, CGFloat); void (*GSDrawImage__) (NSGraphicsContext*, SEL, NSRect, void *); /* ----------------------------------------------------------------------- */ /* Postscript Client functions */ /* ----------------------------------------------------------------------- */ void (*DPSPrintf__) (NSGraphicsContext*, SEL, const char *, va_list); void (*DPSWriteData__) (NSGraphicsContext*, SEL, const char *, unsigned int); /* ----------------------------------------------------------------------- */ /* NSGraphics Ops */ /* ----------------------------------------------------------------------- */ NSDictionary * (*GSReadRect_) (NSGraphicsContext*, SEL, NSRect); void (*NSBeep) (NSGraphicsContext*, SEL); /* Context helper wraps */ void (*GSWSetViewIsFlipped_) (NSGraphicsContext*, SEL, BOOL); BOOL (*GSWViewIsFlipped) (NSGraphicsContext*, SEL); /* * Render Bitmap Images */ void (*NSDrawBitmap___________)(NSGraphicsContext*, SEL, NSRect rect, NSInteger pixelsWide, NSInteger pixelsHigh, NSInteger bitsPerSample, NSInteger samplesPerPixel, NSInteger bitsPerPixel, NSInteger bytesPerRow, BOOL isPlanar, BOOL hasAlpha, NSString *colorSpaceName, const unsigned char *const data[5]); /* This probably belongs next to DPSstroke, but inserting members in this struct breaks apps that use PS* or DPS* functions and were compiled with an earlier version, so it's here until we figure out how to handle that. */ void (*DPSshfill) (NSGraphicsContext*, SEL, NSDictionary *); } gsMethodTable; #endif gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSPrinting.h0000664000076500007650000000314711357044577023344 0ustar brains99brains99/** GSPrinting Loads the proper bundle for the printing backend and contains the class GSPrintingPrincipleClass, which is subclassed by printing backend bundles. Copyright (C) 2004 Free Software Foundation, Inc. Author: Chad Elliott Hardin Date: June 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSPrinting #define _GNUstep_H_GSPrinting #import @class NSBundle; @interface GSPrinting : NSObject { } +(NSBundle*) printingBundle; @end @interface GSPrintingPrincipalClass : NSObject { } +(Class) pageLayoutClass; +(Class) printInfoClass; +(Class) printOperationClass; +(Class) printPanelClass; +(Class) printerClass; +(Class) gsPrintOperationClass; @end #endif // _GNUstep_H_GSPrinting gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSImageMagickImageRep.h0000664000076500007650000000240611602516575025312 0ustar brains99brains99/* GSImageMagickImageRep.h Ghostscript image representation. Copyright (C) 2011 Free Software Foundation, Inc. Written by: Eric Wasylishen Date: June 2011 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSImageMagickImageRep #define _GNUstep_H_GSImageMagickImageRep #import @interface GSImageMagickImageRep : NSBitmapImageRep { } @end #endif // _GNUstep_H_GSImageMagickImageRep gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSGormLoading.h0000664000076500007650000000741311337760765023756 0ustar brains99brains99/* GSNibTemplates.h Copyright (C) 1997, 1999 Free Software Foundation, Inc. Author: Gregory John Casamento Date: 2002 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSNibTemplates #define _GNUstep_H_GSNibTemplates #import #import "GNUstepGUI/GSNibContainer.h" // version of the nib container and the templates. #define GNUSTEP_NIB_VERSION 2 #define GSSWAPPER_VERSION 0 #define GSWINDOWT_VERSION 1 #define GSVIEWT_VERSION 0 #define GSCONTROLT_VERSION 0 #define GSTEXTT_VERSION 0 #define GSTEXTVIEWT_VERSION 0 #define GSMENUT_VERSION 0 #define GSOBJECTT_VERSION 0 @class NSString; @class NSDictionary; @class NSMutableDictionary; @class NSMutableSet; @class NSWindow; /** Window template autopositioning constants */ enum { GSWindowAutoPositionNone = 0, GSWindowMinXMargin = 1, GSWindowMaxXMargin = 2, GSWindowMinYMargin = 4, GSWindowMaxYMargin = 8 }; /* * This is the class that holds objects within a nib. */ @interface GSNibContainer : NSObject { NSMutableDictionary *nameTable; NSMutableArray *connections; NSMutableArray *visibleWindows; NSMutableArray *deferredWindows; NSMutableSet *topLevelObjects; NSMutableDictionary *customClasses; BOOL isAwake; } - (NSMutableArray*) visibleWindows; - (NSMutableArray*) deferredWindows; - (NSMutableDictionary *) customClasses; @end /* * Template classes */ @protocol GSTemplate - (id) initWithObject: (id)object className: (NSString *)className superClassName: (NSString *)superClassName; - (void) setClassName: (NSString *)className; - (NSString *)className; @end @interface GSClassSwapper : NSObject { id _object; NSString *_className; Class _superClass; } - (BOOL) shouldSwapClass; @end @interface GSNibItem : NSObject { NSString *theClass; NSRect theFrame; unsigned int autoresizingMask; } @end @interface GSCustomView : GSNibItem { } @end @interface GSWindowTemplate : GSClassSwapper { BOOL _deferFlag; unsigned int _autoPositionMask; NSRect _screenRect; } // auto position the window. - (unsigned int) autoPositionMask; - (void) setAutoPositionMask: (unsigned int)flag; - (void) autoPositionWindow: (NSWindow *)window; // set attributes specific to the template. - (void) setDeferFlag: (BOOL)flag; - (BOOL) deferFlag; @end @interface GSViewTemplate : GSClassSwapper @end @interface GSTextTemplate : GSClassSwapper @end @interface GSTextViewTemplate : GSClassSwapper @end @interface GSMenuTemplate : GSClassSwapper @end @interface GSControlTemplate : GSClassSwapper @end @interface GSObjectTemplate : GSClassSwapper @end @interface GSTemplateFactory : NSObject + (id) templateForObject: (id) object withClassName: (NSString *)className withSuperClassName: (NSString *)superClassName; @end #endif /* _GNUstep_H_GSNibTemplates */ gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSLayoutManager_internal.h0000664000076500007650000002227712070061105026176 0ustar brains99brains99/* GSLayoutManager_internal.h Copyright (C) 2002, 2003 Free Software Foundation, Inc. Author: Alexander Malmberg Date: November 2002 - February 2003 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSLayoutManager_internal #define _GNUstep_H_GSLayoutManager_internal #import /* TODO: Since temporary attributes are set for _character_ ranges and not _glyph_ ranges, a bunch of things could be simplified here (in particular, a character can't be in several runs anymore, so there's no need to worry about that or search over run boundaries). (2002-11-27): All comments should be clarified now. */ /* Logarithmic time for lookups et al for up to 2^SKIP_LIST_DEPTH runs. Only the head may actually have the maximum level. */ /* OPT: tweak */ #define SKIP_LIST_DEPTH 15 #define SKIP_LIST_LEVEL_PROBABILITY 2 /* We try to keep runs no larger than about this size. See the comment in -_generateRunsToCharacter: for more details. */ #define MAX_RUN_LENGTH 16384 typedef struct GSLayoutManager_glyph_run_head_s { struct GSLayoutManager_glyph_run_head_s *next; /* char_length must always be accurate. glyph_length is the number of valid glyphs counting from the start. For a level 0 head, it's the number of glyphs in that run. */ unsigned int glyph_length, char_length; /* Glyph generation is complete for all created runs. */ unsigned int complete:1; } glyph_run_head_t; typedef struct { NSGlyph g; /* This if the offset for the first character this glyph is mapped to; it is mapped to all characters between it and the next character explicitly mapped to a glyph. The char_offset must be strictly increasing for all glyphs; if reordering is necessary, the mapping will have to be range to range. (Eg. if you have characters 'ab' mapped to glyphs 'AB', reordered to 'BA', then the range 'ab' will be mapped to the range 'BA'. */ unsigned int char_offset:18; /* This could be made smaller, if necessary */ unsigned int drawsOutsideLineFragment:1; unsigned int isNotShown:1; unsigned int inscription:3; unsigned int soft:1; unsigned int elasitc:1; unsigned int bidilevel:7; // Need to support 0..61 NSSize advancement; } glyph_t; @class NSParagraphStyle; @class NSColor; @class NSTextAttachment; typedef struct GSLayoutManager_glyph_run_s { glyph_run_head_t head; // Pointer to the previous leaf. Invariant: t->head->next->prev == t glyph_run_head_t *prev; /* Zero-based, so it's really the number of heads in addition to the one included in glyph_run_t. */ unsigned int level:4; /* All glyph-generation-affecting attributes are same as last run. This doesn't have to be set if a run is continued, but if it is set, it must be correct (it is (will, someday) be used to merge small runs created by repeated inserts in a small range; not merging when we can merge doesn't cost much, but merging when we shouldn't would mess up attributes for those runs). */ unsigned int continued:1; /* Bidirectional-level, as per the unicode bidirectional algorithm (unicode standard annex #9). Only valid if glyphs have been generated (in particular, runs for which glyphs haven't been generated may not be all at the same level). */ /* TODO2: these aren't filled in or used anywhere yet */ unsigned int bidi_level:6; int ligature:5; /* YES if there's an explicit kern attribute. Currently, ligatures aren't used when explicit kerning is available (TODO). */ unsigned int explicit_kern:1; /* Font for this run. */ NSFont *font; glyph_t *glyphs; } glyph_run_t; /* All positions and lengths in glyphs */ typedef struct { unsigned int pos, length; NSPoint p; } linefrag_point_t; typedef struct { unsigned int pos, length; NSSize size; } linefrag_attachment_t; typedef struct { NSRect rect, used_rect; unsigned int pos, length; linefrag_point_t *points; int num_points; linefrag_attachment_t *attachments; int num_attachments; } linefrag_t; typedef struct GSLayoutManager_textcontainer_s { NSTextContainer *textContainer; BOOL complete; unsigned int pos, length; /* This should be set to YES whenever any layout information for this text container has been invalidated. It is reset to NO in -_didInvalidateLayout. All methods called externally that invalidate layout (directly or indirectly) should call -_didInvalidateLayout at some safe point after all invalidation is done. In GSLayoutManager, -_didInvalidateLayout only resets the flags. However, subclasses might need to actually do something. NSLayoutManager needs to tell its NSTextView:s to resize. */ BOOL was_invalidated; /* The array actually has num_soft+num_linefrags entries. Only the num_linefrags first are significant, the rest hold soft invalidated layout information. */ linefrag_t *linefrags; int num_linefrags; int num_soft; int size_linefrags; /* Keep some per-textcontainer info that's expensive to calculate and often requested here. According to profiling (2004-08-09), -usedRectForTextContainer: used to account for ~7% of execution time when editing huge files. */ NSRect usedRect; BOOL usedRectValid; } textcontainer_t; @interface GSLayoutManager (GlyphsHelpers) -(void) _run_cache_attributes: (glyph_run_t *)r : (NSDictionary *)attributes; -(void) _run_copy_attributes: (glyph_run_t *)dst : (const glyph_run_t *)src; -(void) _run_free_attributes: (glyph_run_t *)r; -(void) _initGlyphs; -(void) _freeGlyphs; -(void) _glyphDumpRuns; -(void) _sanityChecks; -(void) _generateGlyphsUpToCharacter: (unsigned int)last; -(void) _generateGlyphsUpToGlyph: (unsigned int)last; -(glyph_run_t *) _glyphForCharacter: (unsigned int)target index: (unsigned int *)rindex positions: (unsigned int *)rpos : (unsigned int *)rcpos; -(glyph_run_t *)run_for_glyph_index: (unsigned int)glyphIndex : (unsigned int *)glyph_pos : (unsigned int *)char_pos; @end @interface GSLayoutManager (LayoutHelpers) -(void) _freeLayout; -(void) _invalidateLayoutFromContainer: (int)idx; -(void) _invalidateEverything; -(void) _doLayout; /* TODO: this is just a hack until proper incremental layout is done */ -(void) _doLayoutToGlyph: (unsigned int)glyphIndex; -(void) _doLayoutToContainer: (int)cindex; -(void) _didInvalidateLayout; @end /* Some helper macros */ /* r is a run, pos and cpos are the glyph and character positions of the run, i is the glyph index in the run. */ /* Steps forward to the next glyph. If there is no next glyph, r will be the last run and i==r->head.glyph_length. */ #define GLYPH_STEP_FORWARD(r, i, pos, cpos) \ { \ i++; \ while (i == r->head.glyph_length) \ { \ if (!r->head.next || !r->head.next->complete) \ { \ if (cpos + r->head.char_length == [_textStorage length]) \ break; \ /* This call might lead to the current run being extended, so \ we make sure that we check r->head.glyph_length again. */ \ [self _generateGlyphsUpToCharacter: cpos + r->head.char_length]; \ } \ else \ { \ pos += r->head.glyph_length; \ cpos += r->head.char_length; \ r = (glyph_run_t *)r->head.next; \ i = 0; \ } \ } \ } /* Steps backward to the previous glyph. If there is no previous glyph, r will be the first glyph and i==-1. */ #define GLYPH_STEP_BACKWARD(r, i, pos, cpos) \ { \ i--; \ while (i<0 && r->prev) \ { \ r=(glyph_run_t *)r->prev; \ pos-=r->head.glyph_length; \ cpos-=r->head.char_length; \ i=r->head.glyph_length-1; \ } \ } /* OPT: can do better than linear scan? */ /* Scans forward from glyph i in run r (with positions pos and cpos) while condition holds. r, i, pos, and cpos must be simple variables. When done, r, i, pos, and cpos will be set for the first glyph for which the condition doesn't hold. If there is no such glyph, r is the last run and i==r->head.glyph_length. */ #define GLYPH_SCAN_FORWARD(r, i, pos, cpos, condition) \ { \ while (condition) \ { \ GLYPH_STEP_FORWARD(r, i, pos, cpos) \ if (i==r->head.glyph_length) \ break; \ } \ } /* Scan backward. r, i, pos, and cpos will be set to the first glyph for which condition doesn't hold. If there is no such glyph, r is the first run and i==-1. */ #define GLYPH_SCAN_BACKWARD(r, i, pos, cpos, condition) \ { \ while (condition) \ { \ GLYPH_STEP_BACKWARD(r, i, pos, cpos) \ if (i==-1) \ break; \ } \ } #define run_for_glyph_index(a,b,c,d) [self run_for_glyph_index: a : c : d] #endif gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSNibLoading.h0000664000076500007650000002227411400150402023530 0ustar brains99brains99/* GSNibCompatibility.h Copyright (C) 1997, 1999 Free Software Foundation, Inc. Author: Gregory John Casamento Date: 2002 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSNibCompatibility #define _GNUstep_H_GSNibCompatibility #import #import #import #import #import #import #import #import #import #import #import #import #import #import "GNUstepGUI/GSNibContainer.h" #import "GNUstepGUI/GSInstantiator.h" @class NSDictionary; @class NSMapTable; @class NSMutableArray; @class NSMutableSet; @class NSString; // templates @protocol OSXNibTemplate - (void) setClassName: (NSString *)className; - (NSString *)className; - (void) setRealObject: (id)o; - (id) realObject; @end @protocol GSNibLoading - (id) nibInstantiate; @end typedef struct _GSWindowTemplateFlags { #if GS_WORDS_BIGENDIAN == 1 unsigned int isHiddenOnDeactivate:1; unsigned int isNotReleasedOnClose:1; unsigned int isDeferred:1; unsigned int isOneShot:1; unsigned int isVisible:1; unsigned int wantsToBeColor:1; unsigned int dynamicDepthLimit:1; unsigned int autoPositionMask:6; unsigned int savePosition:1; unsigned int style:2; unsigned int _unused:16; // currently not used, contains Cocoa specific info #else unsigned int _unused:16; // currently not used, contains Cocoa specific info unsigned int style:2; unsigned int savePosition:1; unsigned int autoPositionMask:6; unsigned int dynamicDepthLimit:1; unsigned int wantsToBeColor:1; unsigned int isVisible:1; unsigned int isOneShot:1; unsigned int isDeferred:1; unsigned int isNotReleasedOnClose:1; unsigned int isHiddenOnDeactivate:1; #endif } GSWindowTemplateFlags; // help connector class... @interface NSIBHelpConnector : NSNibConnector { id _marker; id _file; } - (void) setFile: (id)file; - (id) file; - (void) setMarker: (id)file; - (id) marker; @end /** * Button image source class. */ @interface NSButtonImageSource : NSObject { NSString *imageName; } - (id) initWithImageNamed: (NSString *)name; - (NSString *)imageName; @end /** * This class acts as a placeholder for the window. It doesn't derive from * NSWindow for two reasons. First, it shouldn't instantiate a window immediately * when it's unarchived and second, it holds certain attributes (but doesn't set them * on the window, when the window is being edited in the application builder. */ @interface NSWindowTemplate : NSObject { NSBackingStoreType _backingStoreType; NSSize _maxSize; NSSize _minSize; unsigned _windowStyle; NSString *_title; NSString *_viewClass; NSString *_windowClass; NSRect _windowRect; NSRect _screenRect; id _realObject; id _view; GSWindowTemplateFlags _flags; NSString *_autosaveName; Class _baseWindowClass; } - (id) initWithWindow: (NSWindow *)window className: (NSString *)windowClass isDeferred: (BOOL) deferred isOneShot: (BOOL) oneShot isVisible: (BOOL) visible wantsToBeColor: (BOOL) wantsToBeColor autoPositionMask: (int) autoPositionMask; - (void) setBackingStoreType: (NSBackingStoreType)type; - (NSBackingStoreType) backingStoreType; - (void) setDeferred: (BOOL)flag; - (BOOL) isDeferred; - (void) setMaxSize: (NSSize)maxSize; - (NSSize) maxSize; - (void) setMinSize: (NSSize)minSize; - (NSSize) minSize; - (void) setWindowStyle: (unsigned)sty; - (unsigned) windowStyle; - (void) setTitle: (NSString *) title; - (NSString *)title; - (void) setViewClass: (NSString *)viewClass; - (NSString *)viewClass; - (void) setWindowRect: (NSRect)rect; - (NSRect)windowRect; - (void) setScreenRect: (NSRect)rect; - (NSRect) screenRect; - (void) setView: (id)view; - (id) view; - (Class) baseWindowClass; @end @interface NSViewTemplate : NSView { NSString *_className; id _realObject; } - (id) initWithObject: (id)o className: (NSString *)name; @end @interface NSTextTemplate : NSViewTemplate { } @end @interface NSTextViewTemplate : NSViewTemplate { } @end @interface NSMenuTemplate : NSObject { NSString *_menuClass; NSString *_title; id _realObject; id _parentMenu; NSPoint _location; BOOL _isWindowsMenu; BOOL _isServicesMenu; BOOL _isFontMenu; NSInterfaceStyle _interfaceStyle; } - (void) setClassName: (NSString *)name; - (NSString *)className; @end @interface NSCustomObject : NSObject { NSString *_className; NSString *_extension; id _object; } - (void) setClassName: (NSString *)name; - (NSString *)className; - (void) setExtension: (NSString *)ext; - (NSString *)extension; @end @interface NSCustomView : NSView { NSString *_className; NSString *_extension; NSView *_superview; NSView *_view; } - (void) setClassName: (NSString *)name; - (NSString *)className; - (void) setExtension: (NSString *)view; - (NSString *)extension; - (id)nibInstantiateWithCoder: (NSCoder *)coder; @end @interface NSCustomResource : NSObject { NSString *_className; NSString *_resourceName; } - (void) setClassName: (NSString *)className; - (NSString *)className; - (void) setResourceName: (NSString *)view; - (NSString *)resourceName; @end @interface NSClassSwapper : NSObject { NSString *_className; NSString *_originalClassName; id _template; } - (id) initWithObject: (id)object withClassName: (NSString *)className originalClassName: (NSString *)origClassName; + (void) setIsInInterfaceBuilder: (BOOL)flag; + (BOOL) isInInterfaceBuilder; - (void) setTemplate: (id)temp; - (id) template; - (void) setClassName: (NSString *)className; - (NSString *)className; - (void) setOriginalClassName: (NSString *)className; - (NSString *)originalClassName; @end @interface NSIBObjectData : NSObject { id _root; NSMapTable *_objects; NSMapTable *_names; NSMapTable *_oids; NSMapTable *_classes; NSMapTable *_instantiatedObjs; NSMutableArray *_visibleWindows; NSMutableArray *_connections; id _firstResponder; id _fontManager; NSString *_framework; unsigned _nextOid; NSMutableArray *_accessibilityConnectors; NSMapTable *_accessibilityOids; NSMutableSet *_topLevelObjects; } - (id) instantiateObject: (id)obj; - (void) nibInstantiateWithOwner: (id)owner topLevelObjects: (NSMutableArray *)toplevel; - (id) objectForName: (NSString *)name; - (NSString *) nameForObject: (id)name; - (NSMapTable *) objects; - (NSMapTable *) names; - (NSMapTable *) classes; - (NSMapTable *) oids; - (NSMutableArray *) visibleWindows; - (void) setRoot: (id)root; - (id) root; - (void) setNextOid: (int)noid; - (int) nextOid; @end // class needed for nib encoding/decoding by the progress bar... @interface NSPSMatrix : NSObject @end @interface NSNibAXAttributeConnector : NSObject { NSString *_attributeType; NSString *_attributeValue; id _destination; id _source; NSString *_label; } // Attribute name/type. - (NSString *) attributeType; - (void) setAttributeType: (NSString *)type; - (NSString *) attributeValue; - (void) setAttributeValue: (NSString *)value; // Source destination, connectors. - (id) destination; - (void) setDestination: (id)destination; - (NSString *) label; - (void) setLabel: (NSString *)label; - (id) source; - (void) setSource: (id)source; // establish connection... - (void) establishConnection; @end @interface NSNibAXRelationshipConnector : NSNibConnector @end @interface NSNibBindingConnector: NSNibConnector { NSDictionary *_options; NSString *_binding; NSString *_keyPath; BOOL _hasEstablishedConnection; } - (NSString *) binding; - (NSString *) keyPath; - (NSDictionary *) options; - (void) setBinding: (NSString *)bindings; - (void) setKeyPath: (NSString *)keyPath; - (void) setOptions: (NSDictionary *)options; @end #endif /* _GNUstep_H_GSNibCompatibility */ gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSTrackingRect.h0000664000076500007650000000354511357044577024134 0ustar brains99brains99/* GSTrackingRect.h Tracking rectangle class Copyright (C) 1996,1999 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GSTrackingRect #define _GNUstep_H_GSTrackingRect #import #import @interface GSTrackingRect : NSObject { @public NSRect rectangle; NSTrackingRectTag tag; id owner; void *user_data; struct TrackFlagsType { unsigned inside:1; unsigned isValid:1; unsigned checked:1; unsigned ownerRespondsToMouseEntered:1; unsigned ownerRespondsToMouseExited:1; } flags; } - (id) initWithRect: (NSRect)aRect tag: (NSTrackingRectTag)aTag owner: (id)anObject userData: (void *)theData inside: (BOOL)flag; - (NSRect) rectangle; - (void) reset: (NSRect)aRect inside: (BOOL)flag; - (NSTrackingRectTag) tag; - (id) owner; - (void*) userData; - (BOOL) inside; - (BOOL) isValid; - (void) invalidate; @end #endif /* _GNUstep_H_GSTrackingRect */ gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GSXibLoading.h0000664000076500007650000001027511655273045023565 0ustar brains99brains99/* GSXibLoading Xib (Cocoa XML) model loader Copyright (C) 2010 Free Software Foundation, Inc. Written by: Fred Kiefer Created: March 2010 Refactored slightly by: Gregory Casamento Created: May 2010 This file is part of the GNUstep Base Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #ifndef _GNUstep_H_GSXibLoading #define _GNUstep_H_GSXibLoading #import #import @class NSString, NSDictionary, NSArray, NSMutableDictionary, NSMutableArray; @class NSNibBindingConnector; // Hack: This allows the class name FirstResponder in NSCustomObject and // correctly returns nil as the corresponding object. @interface FirstResponder: NSObject { } @end @interface IBClassDescriptionSource: NSObject { NSString *majorKey; NSString *minorKey; } @end @interface IBPartialClassDescription: NSObject { NSString *className; NSString *superclassName; NSMutableDictionary *actions; NSMutableDictionary *outlets; IBClassDescriptionSource *sourceIdentifier; } @end @interface IBClassDescriber: NSObject { NSMutableArray *referencedPartialClassDescriptions; } @end @interface IBConnection: NSObject { NSString *label; id source; id destination; } - (NSString *) label; - (id) source; - (id) destination; - (NSNibConnector *) nibConnector; - (id) nibInstantiate; - (void) establishConnection; @end @interface IBActionConnection: IBConnection { } @end @interface IBOutletConnection: IBConnection { } @end @interface IBBindingConnection: IBConnection { NSNibBindingConnector *connector; } @end @interface IBConnectionRecord: NSObject { IBConnection *connection; int connectionID; } - (IBConnection *) connection; @end @interface IBToolTipAttribute: NSObject { NSString *name; id object; NSString *toolTip; } @end @interface IBInitialTabViewItemAttribute: NSObject { NSString *name; id object; id initialTabViewItem; } @end @interface IBObjectRecord: NSObject { int objectID; id object; id children; id parent; } - (id) object; - (id) parent; - (NSInteger) objectID; @end @interface IBMutableOrderedSet: NSObject { NSArray *orderedObjects; } - (NSArray *)orderedObjects; - (id) objectWithObjectID: (NSInteger)objID; @end @interface IBObjectContainer: NSObject { NSMutableArray *connectionRecords; IBMutableOrderedSet *objectRecords; NSMutableDictionary *flattenedProperties; NSMutableDictionary *unlocalizedProperties; id activeLocalization; NSMutableDictionary *localizations; id sourceID; int maxID; } - (id) nibInstantiate; - (NSEnumerator *) connectionRecordEnumerator; - (NSEnumerator *) objectRecordEnumerator; @end @interface GSXibElement: NSObject { NSString *type; NSDictionary *attributes; NSString *value; NSMutableDictionary *elements; NSMutableArray *values; } - (NSString*) type; - (NSString*) value; - (NSDictionary*) elements; - (NSArray*) values; - (void) addElement: (GSXibElement*)element; - (void) setElement: (GSXibElement*)element forKey: (NSString*)key; - (void) setValue: (NSString*)text; - (NSString*) attributeForKey: (NSString*)key; - (GSXibElement*) elementForKey: (NSString*)key; @end @interface GSXibKeyedUnarchiver: NSKeyedUnarchiver { NSMutableDictionary *objects; NSMutableArray *stack; GSXibElement *currentElement; NSMutableDictionary *decoded; } - (id) _decodeArrayOfObjectsForElement: (GSXibElement*)element; - (id) _decodeDictionaryOfObjectsForElement: (GSXibElement*)element; @end #endif gnustep-gui-0.24.0/Headers/Additions/GNUstepGUI/GMAppKit.h0000664000076500007650000000752411357044577022737 0ustar brains99brains99/* GMAppKit.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: November 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_GMAppKit #define _GNUstep_H_GMAppKit #ifndef GNUSTEP #import #else #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #endif #import @interface NSApplication (GMArchiverMethods) @end @interface NSBox (GMArchiverMethods) @end @interface NSButton (GMArchiverMethods) @end @interface NSCell (GMArchiverMethods) @end @interface NSClipView (GMArchiverMethods) @end @interface NSColor (GMArchiverMethods) @end @interface NSControl (GMArchiverMethods) @end @interface NSFont (GMArchiverMethods) @end @interface NSImage (GMArchiverMethods) @end @interface NSMatrix (GMArchiverMethods) @end @interface NSMenuItem (GMArchiverMethods) @end @interface NSMenu (GMArchiverMethods) @end @interface NSPopUpButton (GMArchiverMethods) @end @interface NSResponder (GMArchiverMethods) @end @interface NSTextField (GMArchiverMethods) @end @interface NSScrollView (GMArchiverMethods) @end @interface NSSecureTextFieldCell (GMArchiverMethods) @end @interface NSView (GMArchiverMethods) @end @interface NSWindow (GMArchiverMethods) @end @interface NSPanel (GMArchiverMethods) @end @interface NSSavePanel (GMArchiverMethods) @end @interface NSOpenPanel (GMArchiverMethods) @end @interface NSBrowser (GMArchiverMethods) @end @interface NSColorWell (GMArchiverMethods) @end @interface NSImageView (GMArchiverMethods) @end @interface NSSliderCell (GMArchiverMethods) @end @interface NSTextFieldCell (GMArchiverMethods) @end @interface NSFormCell (GMArchiverMethods) @end @interface NSText (GMArchiverMethods) @end @interface NSTextView (GMArchiverMethods) @end #endif /* _GNUstep_H_GMAppKit */ gnustep-gui-0.24.0/Headers/AppKit/0000775000076500007650000000000012256227327016515 5ustar brains99brains99gnustep-gui-0.24.0/Headers/AppKit/NSPopUpButton.h0000664000076500007650000000575512102212557021367 0ustar brains99brains99/* NSPopUpButton.h Popup list class Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Michael Hanni Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSPopUpButton #define _GNUstep_H_NSPopUpButton #import #import #import #import @class NSString; @class NSArray; @interface NSPopUpButton : NSButton { } // // Initializing an NSPopUpButton // - (id)initWithFrame:(NSRect)frameRect pullsDown:(BOOL)flag; - (void)setPullsDown:(BOOL)flag; - (BOOL)pullsDown; - (void)setAutoenablesItems:(BOOL)flag; - (BOOL)autoenablesItems; - (void)addItemWithTitle:(NSString *)title; - (void)addItemsWithTitles:(NSArray *)itemTitles; - (void)insertItemWithTitle:(NSString *)title atIndex:(NSInteger)index; - (void)removeAllItems; - (void)removeItemWithTitle:(NSString *)title; - (void)removeItemAtIndex:(NSInteger)index; - (id )selectedItem; - (NSString *)titleOfSelectedItem; - (NSInteger)indexOfSelectedItem; - (void)selectItem:(id )anObject; - (void)selectItemAtIndex:(NSInteger)index; - (void)selectItemWithTitle:(NSString *)title; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (BOOL) selectItemWithTag: (NSInteger)tag; #endif - (NSInteger)numberOfItems; - (NSArray *)itemArray; - (id )itemAtIndex:(NSInteger)index; - (NSString *)itemTitleAtIndex:(NSInteger)index; - (NSArray *)itemTitles; - (id )itemWithTitle:(NSString *)title; - (id )lastItem; - (NSInteger)indexOfItem:(id )anObject; - (NSInteger)indexOfItemWithTag:(NSInteger)tag; - (NSInteger)indexOfItemWithTitle:(NSString *)title; - (NSInteger)indexOfItemWithRepresentedObject:(id)anObject; - (NSInteger)indexOfItemWithTarget:(id)target andAction:(SEL)actionSelector; - (void)setPreferredEdge:(NSRectEdge)edge; - (NSRectEdge)preferredEdge; - (void)setTitle:(NSString *)aString; - (void)synchronizeTitleAndSelectedItem; @end APPKIT_EXPORT NSString *NSPopUpButtonWillPopUpNotification; #endif // _GNUstep_H_NSPopUpButton gnustep-gui-0.24.0/Headers/AppKit/NSTokenFieldCell.h0000664000076500007650000000373311354736316021762 0ustar brains99brains99/* NSTokenFieldCell.h Cell class for the token field entry control Copyright (C) 2008 Free Software Foundation, Inc. Author: Gregory Casamento Date: 2008 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSTokenFieldCell #define _GNUstep_H_NSTokenFieldCell #import #import #import @class NSCharacterSet; typedef enum _NSTokenStyle { NSDefaultTokenStyle = 0, NSPlainTextTokenStyle, NSRoundedTokenStyle } NSTokenStyle; @interface NSTokenFieldCell : NSTextFieldCell { NSTokenStyle tokenStyle; NSTimeInterval completionDelay; NSCharacterSet *tokenizingCharacterSet; } // Style... - (NSTokenStyle)tokenStyle; - (void)setTokenStyle:(NSTokenStyle)style; // Completion delay... + (NSTimeInterval)defaultCompletionDelay; - (NSTimeInterval)completionDelay; - (void)setCompletionDelay:(NSTimeInterval)delay; // Character set... + (NSCharacterSet *)defaultTokenizingCharacterSet; - (void)setTokenizingCharacterSet:(NSCharacterSet *)characterSet; - (NSCharacterSet *)tokenizingCharacterSet; @end #endif // _GNUstep_H_NSTokenFieldCell gnustep-gui-0.24.0/Headers/AppKit/NSToolbarItem.h0000664000076500007650000001027211354736316021353 0ustar brains99brains99/* NSToolbarItem.h The toolbar item class. Copyright (C) 2002 Free Software Foundation, Inc. Author: Gregory John Casamento , Fabien Vallon , Quentin Mathe Date: May 2002 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSToolbarItem #define _GNUstep_H_NSToolbarItem #import #import #import #import #import @class NSArray; @class NSString; @class NSDictionary; @class NSMutableDictionary; @class NSImage; @class NSMenuItem; @class NSView; @class NSToolbar; /* * Constants */ APPKIT_EXPORT NSString *NSToolbarSeparatorItemIdentifier; APPKIT_EXPORT NSString *NSToolbarSpaceItemIdentifier; APPKIT_EXPORT NSString *NSToolbarFlexibleSpaceItemIdentifier; APPKIT_EXPORT NSString *NSToolbarShowColorsItemIdentifier; APPKIT_EXPORT NSString *NSToolbarShowFontsItemIdentifier; APPKIT_EXPORT NSString *NSToolbarCustomizeToolbarItemIdentifier; APPKIT_EXPORT NSString *NSToolbarPrintItemIdentifier; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) enum _NSToolbarItemVisibilityPriority { NSToolbarItemVisibilityPriorityStandard = 0, NSToolbarItemVisibilityPriorityLow = -1000, NSToolbarItemVisibilityPriorityHigh = 1000, NSToolbarItemVisibilityPriorityUser = 2000 }; #endif @interface NSToolbarItem : NSObject { // externally visible variables BOOL _autovalidates; NSString *_itemIdentifier; NSString *_label; NSString *_paletteLabel; NSImage *_image; id _view; NSMenuItem *_menuFormRepresentation; NSString *_toolTip; NSInteger _tag; NSInteger _visibilityPriority; // toolbar NSToolbar *_toolbar; NSView *_backView; BOOL _modified; BOOL _selectable; // size NSSize _maxSize; NSSize _minSize; } // Instance methods - (id)initWithItemIdentifier: (NSString *)itemIdentifier; - (void)validate; // Accessors - (SEL) action; - (BOOL) allowsDuplicatesInToolbar; - (NSImage *) image; - (BOOL) isEnabled; - (NSString *) itemIdentifier; - (NSString *) label; - (NSSize) maxSize; - (NSMenuItem *) menuFormRepresentation; - (NSSize) minSize; - (NSString *) paletteLabel; - (NSInteger) tag; - (id) target; - (NSString *) toolTip; - (NSToolbar *) toolbar; - (NSView *) view; - (void) setAction: (SEL)action; - (void) setEnabled: (BOOL)enabled; - (void) setImage: (NSImage *)image; - (void) setLabel: (NSString *)label; - (void) setMaxSize: (NSSize)maxSize; - (void) setMenuFormRepresentation: (NSMenuItem *)menuItem; - (void) setMinSize: (NSSize)minSize; - (void) setPaletteLabel: (NSString *)paletteLabel; - (void) setTag: (NSInteger)tag; - (void) setTarget: (id)target; - (void) setToolTip: (NSString *)toolTip; - (void) setView: (NSView *)view; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (BOOL) autovalidates; - (void) setAutovalidates: (BOOL)autovalidates; - (NSInteger) visibilityPriority; - (void) setVisibilityPriority: (NSInteger)visibilityPriority; #endif @end /* interface of NSToolbarItem */ // Informal protocol for the toolbar validation @interface NSObject (NSToolbarItemValidation) - (BOOL) validateToolbarItem: (NSToolbarItem *)toolbarItem; @end // Extra private stuff APPKIT_EXPORT NSString *GSMovableToolbarItemPboardType; #endif /* _GNUstep_H_NSToolbarItem */ gnustep-gui-0.24.0/Headers/AppKit/NSView.h0000664000076500007650000004520512102042725020032 0ustar brains99brains99/** NSView Encapsulates all drawing functionality Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Heavily changed and extended by Ovidiu Predescu . Date: 1997 Author: Felipe A. Rodriguez Date: August 1998 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSView #define _GNUstep_H_NSView #import #import #import @class NSArray; @class NSAttributedString; @class NSData; @class NSMutableArray; @class NSString; @class NSBitmapImageRep; @class NSClipView; @class NSCursor; @class NSImage; @class NSMenu; @class NSPasteboard; @class NSScrollView; @class NSView; @class NSWindow; typedef NSInteger NSTrackingRectTag; typedef NSInteger NSToolTipTag; /** Describes the type of border used by an NSView. NSNoBorder NSLineBorder NSBezelBorder NSGrooveBorder */ enum _NSBorderType { NSNoBorder, NSLineBorder, NSBezelBorder, NSGrooveBorder }; typedef NSUInteger NSBorderType; /* * autoresize constants which NSView uses in * determining the parts of a view which are * resized when the view's superview is resized */ enum { NSViewNotSizable = 0, // view does not resize with its superview NSViewMinXMargin = 1, // left margin between views can stretch NSViewWidthSizable = 2, // view's width can stretch NSViewMaxXMargin = 4, // right margin between views can stretch NSViewMinYMargin = 8, // bottom margin between views can stretch NSViewHeightSizable = 16, // view's height can stretch NSViewMaxYMargin = 32 // top margin between views can stretch }; /* * constants defining if and how a view (or cell) should draw a focus ring */ typedef enum _NSFocusRingType { NSFocusRingTypeDefault = 0, NSFocusRingTypeNone = 1, NSFocusRingTypeExterior = 2 } NSFocusRingType; @interface NSView : NSResponder { NSRect _frame; NSRect _bounds; id _frameMatrix; id _boundsMatrix; id _matrixToWindow; id _matrixFromWindow; NSView* _super_view; PACKAGE_SCOPE NSMutableArray *_sub_views; @protected NSWindow *_window; PACKAGE_SCOPE NSMutableArray *_tracking_rects; NSMutableArray *_cursor_rects; @protected NSRect _invalidRect; NSRect _visibleRect; NSInteger _gstate; void *_nextKeyView; void *_previousKeyView; @public /* * Flags for internal use by NSView and it's subclasses. */ struct _rFlagsType { unsigned flipped_view:1; /* Flipped state the last time we checked. */ unsigned has_subviews:1; /* The view has subviews. */ unsigned has_currects:1; /* The view has cursor rects. */ unsigned has_trkrects:1; /* The view has tracking rects. */ unsigned has_draginfo:1; /* View has drag types. */ unsigned opaque_view:1; /* For views whose opacity may */ /* change to keep track of it. */ unsigned valid_rects:1; /* Some cursor rects may be ok. */ unsigned needs_display:1; /* view needs display. */ unsigned has_tooltips:1; /* The view has tooltips set. */ unsigned ignores_backing:1; /* The view does not trigger */ /* backing flush when drawn */ } _rFlags; BOOL _is_rotated_from_base; BOOL _is_rotated_or_scaled_from_base; BOOL _post_frame_changes; BOOL _post_bounds_changes; BOOL _autoresizes_subviews; BOOL _coordinates_valid; BOOL _allocate_gstate; BOOL _renew_gstate; BOOL _is_hidden; BOOL _in_live_resize; NSUInteger _autoresizingMask; NSFocusRingType _focusRingType; NSRect _autoresizingFrameError; } /* * Initializing NSView Objects */ - (id) initWithFrame: (NSRect)frameRect; /* * Managing the NSView Hierarchy */ - (void) addSubview: (NSView*)aView; - (void) addSubview: (NSView*)aView positioned: (NSWindowOrderingMode)place relativeTo: (NSView*)otherView; - (NSView*) ancestorSharedWithView: (NSView*)aView; - (BOOL) isDescendantOf: (NSView*)aView; - (NSView*) opaqueAncestor; - (void) removeFromSuperviewWithoutNeedingDisplay; - (void) removeFromSuperview; #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) - (void) removeSubview: (NSView*)aView; #endif - (void) replaceSubview: (NSView*)oldView with: (NSView*)newView; - (void) sortSubviewsUsingFunction: (NSComparisonResult (*)(id ,id ,void*))compare context: (void*)context; - (NSArray*) subviews; #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (void) setSubviews: (NSArray *)newSubviews; #endif - (NSView*) superview; - (NSWindow*) window; - (void) viewWillMoveToSuperview: (NSView*)newSuper; - (void) viewWillMoveToWindow: (NSWindow*)newWindow; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void) didAddSubview: (NSView *)subview; - (void) viewDidMoveToSuperview; - (void) viewDidMoveToWindow; - (void) willRemoveSubview: (NSView *)subview; #endif /* * Assigning a Tag */ - (NSInteger) tag; - (id) viewWithTag: (NSInteger)aTag; /* * Modifying the Frame Rectangle */ - (CGFloat) frameRotation; - (NSRect) frame; - (void) setFrame: (NSRect)frameRect; - (void) setFrameOrigin: (NSPoint)newOrigin; - (void) setFrameRotation: (CGFloat)angle; - (void) setFrameSize: (NSSize)newSize; /* * Modifying the Coordinate System */ - (CGFloat) boundsRotation; - (NSRect) bounds; - (void) setBounds: (NSRect)aRect; - (void) setBoundsOrigin: (NSPoint)newOrigin; - (void) setBoundsRotation: (CGFloat)angle; - (void) setBoundsSize: (NSSize)newSize; - (void) translateOriginToPoint: (NSPoint)point; - (void) scaleUnitSquareToSize: (NSSize)newSize; - (void) rotateByAngle: (CGFloat)angle; - (BOOL) isFlipped; - (BOOL) isRotatedFromBase; - (BOOL) isRotatedOrScaledFromBase; /* * Converting Coordinates */ - (NSRect) centerScanRect: (NSRect)aRect; - (NSPoint) convertPoint: (NSPoint)aPoint fromView: (NSView*)aView; - (NSPoint) convertPoint: (NSPoint)aPoint toView: (NSView*)aView; - (NSRect) convertRect: (NSRect)aRect fromView: (NSView*)aView; - (NSRect) convertRect: (NSRect)aRect toView: (NSView*)aView; - (NSSize) convertSize: (NSSize)aSize fromView: (NSView*)aView; - (NSSize) convertSize: (NSSize)aSize toView: (NSView*)aView; #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (NSPoint) convertPointFromBase: (NSPoint)aPoint; - (NSPoint) convertPointToBase: (NSPoint)aPoint; - (NSRect) convertRectFromBase: (NSRect)aRect; - (NSRect) convertRectToBase: (NSRect)aRect; - (NSSize) convertSizeFromBase: (NSSize)aSize; - (NSSize) convertSizeToBase: (NSSize)aSize; #endif /* * Notifying Ancestor Views */ - (void) setPostsFrameChangedNotifications: (BOOL)flag; - (BOOL) postsFrameChangedNotifications; - (void) setPostsBoundsChangedNotifications: (BOOL)flag; - (BOOL) postsBoundsChangedNotifications; /* * Resizing Subviews */ - (void) resizeSubviewsWithOldSize: (NSSize)oldSize; - (void) setAutoresizesSubviews: (BOOL)flag; - (BOOL) autoresizesSubviews; - (void) setAutoresizingMask: (NSUInteger)mask; - (NSUInteger) autoresizingMask; - (void) resizeWithOldSuperviewSize: (NSSize)oldSize; /* * Focusing */ + (NSView*) focusView; - (void) lockFocus; - (void) unlockFocus; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (BOOL) lockFocusIfCanDraw; - (void) lockFocusInRect: (NSRect)rect; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (BOOL) lockFocusIfCanDrawInContext: (NSGraphicsContext *)context; #endif /* * Displaying */ - (void) display; - (void) displayIfNeeded; - (void) displayIfNeededIgnoringOpacity; - (void) displayIfNeededInRect: (NSRect)aRect; - (void) displayIfNeededInRectIgnoringOpacity: (NSRect)aRect; - (void) displayRect: (NSRect)aRect; - (void) displayRectIgnoringOpacity: (NSRect)aRect; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (void) displayRectIgnoringOpacity: (NSRect)aRect inContext: (NSGraphicsContext *)context; #endif - (BOOL) needsDisplay; - (void) setNeedsDisplay: (BOOL)flag; - (void) setNeedsDisplayInRect: (NSRect)invalidRect; - (BOOL) isOpaque; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) + (NSFocusRingType) defaultFocusRingType; - (void) setKeyboardFocusRingNeedsDisplayInRect: (NSRect)rect; - (void) setFocusRingType: (NSFocusRingType)focusRingType; - (NSFocusRingType) focusRingType; /* * Hidding Views */ - (void) setHidden: (BOOL)flag; - (BOOL) isHidden; - (BOOL) isHiddenOrHasHiddenAncestor; #endif - (void) drawRect: (NSRect)rect; - (NSRect) visibleRect; - (BOOL) canDraw; - (BOOL) shouldDrawColor; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (NSBitmapImageRep *) bitmapImageRepForCachingDisplayInRect: (NSRect)rect; - (void) cacheDisplayInRect: (NSRect)rect toBitmapImageRep: (NSBitmapImageRep *)bitmap; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (BOOL) wantsDefaultClipping; - (BOOL) needsToDrawRect: (NSRect)aRect; - (void) getRectsBeingDrawn: (const NSRect **)rects count: (NSInteger *)count; /* * Live resize support */ - (BOOL) inLiveResize; - (void) viewWillStartLiveResize; - (void) viewDidEndLiveResize; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (BOOL) preservesContentDuringLiveResize; - (void) getRectsExposedDuringLiveResize: (NSRect[4])exposedRects count: (NSInteger *)count; - (NSRect) rectPreservedDuringLiveResize; #endif /* * Graphics State Objects */ - (void) allocateGState; - (void) releaseGState; - (NSInteger) gState; - (void) renewGState; - (void) setUpGState; - (BOOL) acceptsFirstMouse: (NSEvent*)theEvent; - (NSView*) hitTest: (NSPoint)aPoint; - (BOOL) mouse: (NSPoint)aPoint inRect: (NSRect)aRect; - (BOOL) performKeyEquivalent: (NSEvent*)theEvent; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (BOOL) performMnemonic: (NSString *)aString; - (BOOL) mouseDownCanMoveWindow; #endif /* * Dragging */ - (BOOL) dragFile: (NSString*)filename fromRect: (NSRect)rect slideBack: (BOOL)slideFlag event: (NSEvent*)event; - (void) dragImage: (NSImage*)anImage at: (NSPoint)viewLocation offset: (NSSize)initialOffset event: (NSEvent*)event pasteboard: (NSPasteboard*)pboard source: (id)sourceObject slideBack: (BOOL)slideFlag; - (void) registerForDraggedTypes: (NSArray*)newTypes; - (void) unregisterDraggedTypes; - (BOOL) shouldDelayWindowOrderingForEvent: (NSEvent*)anEvent; #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) - (BOOL) dragPromisedFilesOfTypes: (NSArray *)typeArray fromRect: (NSRect)aRect source: (id)sourceObject slideBack: (BOOL)slideBack event: (NSEvent *)theEvent; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (NSArray *) registeredDraggedTypes; #endif /** * Adds a cursor rectangle. This provides for automatic update of the * cursor to be anObject while the mouse is in aRect.
* The cursor (anObject) is retained until the cursor rectangle is * removed or discarded.
* Generally your subviews should call this in their implementation of * the -resetCursorRects method.
* It is your responsibility to ensure that aRect lies within your veiw's * visible rectangle. */ - (void) addCursorRect: (NSRect)aRect cursor: (NSCursor*)anObject; /** * Removes all the cursor rectancles which have been set up for the * receiver. This is equivalent to calling -removeCursorRect:cursor: * for all cursor rectangles which have been set up.
* This is called automatically before the system calls -resetCursorRects * so you never need to call it. */ - (void) discardCursorRects; /** * Removes the cursor rectangle which was set up for the specified * rectangle and cursor. */ - (void) removeCursorRect: (NSRect)aRect cursor: (NSCursor*)anObject; /** * This is called to establish a new set of cursor rectangles whenever * the receiver needs to do so (eg the view has been resized). The default * implementation does nothing, but subclasses should use it to make * calls to -addCursorRect:cursor: to establish their new cursor rectangles. */ - (void) resetCursorRects; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) /* * Tool Tips */ - (NSToolTipTag) addToolTipRect: (NSRect)aRect owner: (id)anObject userData: (void *)data; - (void) removeAllToolTips; - (void) removeToolTip: (NSToolTipTag)tag; - (void) setToolTip: (NSString *)string; - (NSString *) toolTip; #endif /** * Removes a tracking rectangle which was previously established using the * -addTrackingRect:owner:userData:assumeInside: method.
* The value of tag must be the value returned by the method used to add * the rectangle. */ - (void) removeTrackingRect: (NSTrackingRectTag)tag; /** * Adds a tracking rectangle to monitor mouse movement and generate * mouse-entered and mouse-exited events.
* The event messages are sent to anObject, which is not * retained and must therefore be sure to remove any tracking rectangles * using it before it is deallocated.
* The value of data is supplied as the user data in the event objects * generated.
* If flag is YES then the mouse is assumed to be inside the tracking * rectangle and the first event generated will therefore be a mouse exit, * if it is NO then the first event generated will be a mouse entry. */ - (NSTrackingRectTag) addTrackingRect: (NSRect)aRect owner: (id)anObject userData: (void*)data assumeInside: (BOOL)flag; /* * Scrolling */ - (NSRect) adjustScroll: (NSRect)newVisible; - (BOOL) autoscroll: (NSEvent*)theEvent; - (NSScrollView*) enclosingScrollView; - (void) scrollPoint: (NSPoint)aPoint; - (void) scrollRect: (NSRect)aRect by: (NSSize)delta; - (BOOL) scrollRectToVisible: (NSRect)aRect; - (void) reflectScrolledClipView: (NSClipView*)aClipView; - (void) scrollClipView: (NSClipView*)aClipView toPoint: (NSPoint)aPoint; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) /* * Menu operations */ + (NSMenu *) defaultMenu; - (NSMenu *) menuForEvent: (NSEvent *)theEvent; #endif /* * Aiding Event Handling */ - (BOOL) needsPanelToBecomeKey; - (void) setNextKeyView: (NSView*)aView; - (NSView*) nextKeyView; - (NSView*) nextValidKeyView; - (void) setPreviousKeyView: (NSView*)aView; - (NSView*) previousKeyView; - (NSView*) previousValidKeyView; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (BOOL) canBecomeKeyView; #endif /* * Printing */ - (void) fax: (id)sender; - (void) print: (id)sender; - (NSData*) dataWithEPSInsideRect: (NSRect)aRect; - (void) writeEPSInsideRect: (NSRect)rect toPasteboard: (NSPasteboard*)pasteboard; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (NSData *) dataWithPDFInsideRect: (NSRect)aRect; - (void) writePDFInsideRect: (NSRect)aRect toPasteboard: (NSPasteboard *)pboard; - (NSString *) printJobTitle; #endif /* * Pagination */ - (void) adjustPageHeightNew: (CGFloat*)newBottom top: (CGFloat)oldTop bottom: (CGFloat)oldBottom limit: (CGFloat)bottomLimit; - (void) adjustPageWidthNew: (CGFloat*)newRight left: (CGFloat)oldLeft right: (CGFloat)oldRight limit: (CGFloat)rightLimit; - (CGFloat) heightAdjustLimit; - (BOOL) knowsPagesFirst: (int*)firstPageNum last: (int*)lastPageNum; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (BOOL) knowsPageRange: (NSRange*)range; #endif - (NSPoint) locationOfPrintRect: (NSRect)aRect; - (NSRect) rectForPage: (NSInteger)page; - (CGFloat) widthAdjustLimit; /* * Writing Conforming PostScript */ - (void) addToPageSetup; - (void) beginPage: (int)ordinalNum label: (NSString*)aString bBox: (NSRect)pageRect fonts: (NSString*)fontNames; - (void) beginPageSetupRect: (NSRect)aRect placement: (NSPoint)location; - (void) beginPrologueBBox: (NSRect)boundingBox creationDate: (NSString*)dateCreated createdBy: (NSString*)anApplication fonts: (NSString*)fontNames forWhom: (NSString*)user pages: (int)numPages title: (NSString*)aTitle; - (void) beginSetup; - (void) beginTrailer; - (void) drawPageBorderWithSize: (NSSize)borderSize; - (void) drawSheetBorderWithSize: (NSSize)borderSize; - (void) endHeaderComments; - (void) endPrologue; - (void) endSetup; - (void) endPageSetup; - (void) endPage; - (void) endTrailer; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void)beginDocument; - (void)beginPageInRect:(NSRect)aRect atPlacement:(NSPoint)location; - (void)endDocument; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (NSAttributedString *)pageFooter; - (NSAttributedString *)pageHeader; #endif @end @class NSAffineTransform; /* * GNUstep extensions * Methods whose names begin with an underscore must NOT be overridden. */ #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) @interface NSView (PrivateMethods) /* * The [-_invalidateCoordinates] method marks the cached visible rectangles * of the view and it's subview as being invalid. NSViews methods call this * whenever the coordinate system of the view is changed in any way - thus * forcing recalculation of cached values next time they are needed. */ - (void) _invalidateCoordinates; - (void) _rebuildCoordinates; - (NSAffineTransform*) _matrixToWindow; - (NSAffineTransform*) _matrixFromWindow; - (void) _setIgnoresBacking: (BOOL) flag; - (BOOL) _ignoresBacking; @end #endif /* * GNUstep specific function to determine the drag types registered for a view. */ APPKIT_EXPORT NSArray *GSGetDragTypes(NSView* aView); /* Notifications */ APPKIT_EXPORT NSString *NSViewFrameDidChangeNotification; APPKIT_EXPORT NSString *NSViewBoundsDidChangeNotification; APPKIT_EXPORT NSString *NSViewFocusDidChangeNotification; APPKIT_EXPORT NSString *NSViewGlobalFrameDidChangeNotification; #endif // _GNUstep_H_NSView gnustep-gui-0.24.0/Headers/AppKit/NSAlert.h0000664000076500007650000000641512101306763020173 0ustar brains99brains99/** NSAlert Encapsulate an alert panel Copyright (C) 2004 Free Software Foundation, Inc. Author: Fred Kiefer Date: July 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSAlert #define _GNUstep_H_NSAlert #import #import @class NSArray; @class NSError; @class NSString; @class NSMutableArray; @class NSButton; @class NSImage; @class NSWindow; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) enum _NSAlertStyle { NSWarningAlertStyle = 0, NSInformationalAlertStyle = 1, NSCriticalAlertStyle = 2 }; typedef NSUInteger NSAlertStyle; enum { NSAlertFirstButtonReturn = 1000, NSAlertSecondButtonReturn = 1001, NSAlertThirdButtonReturn = 1002 }; @interface NSAlert : NSObject { @private NSString *_informative_text; NSString *_message_text; NSImage *_icon; NSMutableArray *_buttons; NSString *_help_anchor; NSWindow *_window; id _delegate; NSAlertStyle _style; BOOL _shows_help; id _modalDelegate; SEL _didEndSelector; NSInteger _result; } #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) + (NSAlert *) alertWithError: (NSError *)error; #endif + (NSAlert *) alertWithMessageText: (NSString *)messageTitle defaultButton: (NSString *)defaultButtonTitle alternateButton: (NSString *)alternateButtonTitle otherButton: (NSString *)otherButtonTitle informativeTextWithFormat: (NSString *)format, ...; - (NSButton *) addButtonWithTitle: (NSString *)aTitle; - (NSAlertStyle) alertStyle; - (void) beginSheetModalForWindow: (NSWindow *)window modalDelegate: (id)delegate didEndSelector: (SEL)didEndSelector contextInfo: (void *)contextInfo; - (NSArray *) buttons; - (id) delegate; - (NSString *) helpAnchor; - (NSImage *) icon; - (NSString *) informativeText; - (NSString *) messageText; - (NSInteger) runModal; - (void) setAlertStyle: (NSAlertStyle)style; - (void) setDelegate: (id)delegate; - (void) setHelpAnchor: (NSString *)anchor; - (void) setIcon: (NSImage *)icon; - (void) setInformativeText: (NSString *)informativeText; - (void) setMessageText: (NSString *)messageText; - (void) setShowsHelp: (BOOL)showsHelp; - (BOOL) showsHelp; - (id) window; @end /* * Implemented by the delegate */ #ifdef GNUSTEP @interface NSObject (NSAlertDelegate) - (BOOL) alertShowHelp: (NSAlert *)alert; @end #endif #endif /* MAC_OS_X_VERSION_10_3 */ #endif /* _GNUstep_H_NSAlert */ gnustep-gui-0.24.0/Headers/AppKit/NSDataLinkPanel.h0000664000076500007650000000514512121417516021573 0ustar brains99brains99/* NSDataLinkPanel.h Standard panel for inspecting data links Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSDataLinkPanel #define _GNUstep_H_NSDataLinkPanel #import #import #import @class NSDataLink; @class NSDataLinkManager; @class NSView; @interface NSApplication (NSDataLinkPanel) - (void) orderFrontDataLinkPanel: (id)sender; @end @interface NSDataLinkPanel : NSPanel { // Outlets id _sourceField; id _lastUpdateField; id _openSourceButton; id _updateDestinationButton; id _breakLinkButton; id _breakAllLinksButton; id _updateModeButton; // Attributes NSDataLinkManager *_currentDataLinkManager; NSDataLink *_currentDataLink; BOOL _multipleSelection; NSView *_accessoryView; } // // Initializing // + (NSDataLinkPanel *)sharedDataLinkPanel; // // Keeping the Panel Up to Date // + (void)getLink:(NSDataLink **)link manager:(NSDataLinkManager **)linkManager isMultiple:(BOOL *)flag; + (void)setLink:(NSDataLink *)link manager:(NSDataLinkManager *)linkManager isMultiple:(BOOL)flag; - (void)getLink:(NSDataLink **)link manager:(NSDataLinkManager **)linkManager isMultiple:(BOOL *)flag; - (void)setLink:(NSDataLink *)link manager:(NSDataLinkManager *)linkManager isMultiple:(BOOL)flag; // // Customizing the Panel // - (NSView *)accessoryView; - (void)setAccessoryView:(NSView *)aView; // // Responding to User Input // - (void)pickedBreakAllLinks:(id)sender; - (void)pickedBreakLink:(id)sender; - (void)pickedOpenSource:(id)sender; - (void)pickedUpdateDestination:(id)sender; - (void)pickedUpdateMode:(id)sender; @end #endif // _GNUstep_H_NSDataLinkPanel gnustep-gui-0.24.0/Headers/AppKit/NSBrowser.h0000664000076500007650000002406712243757125020563 0ustar brains99brains99/* NSBrowser.h Control to display and select from hierarchal lists Copyright (C) 1996, 1997 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSBrowser #define _GNUstep_H_NSBrowser #import #import @class NSString; @class NSArray; @class NSIndexPath; @class NSIndexSet; @class NSCell; @class NSEvent; @class NSMatrix; @class NSScroller; //@class NSBox; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) enum _NSBrowserColumnResizingType { NSBrowserNoColumnResizing, NSBrowserAutoColumnResizing, NSBrowserUserColumnResizing }; typedef NSUInteger NSBrowserColumnResizingType; #endif @interface NSBrowser : NSControl { // Attributes NSCell *_browserCellPrototype; Class _browserMatrixClass; NSString *_pathSeparator; //NSBox *_horizontalScrollerBox; NSScroller *_horizontalScroller; NSTimeInterval _lastKeyPressed; NSString *_charBuffer; BOOL _isLoaded; BOOL _allowsBranchSelection; BOOL _allowsEmptySelection; BOOL _allowsMultipleSelection; BOOL _reusesColumns; BOOL _separatesColumns; BOOL _takesTitleFromPreviousColumn; BOOL _isTitled; BOOL _hasHorizontalScroller; BOOL _skipUpdateScroller; BOOL _acceptsArrowKeys; BOOL _sendsActionOnArrowKeys; BOOL _acceptsAlphaNumericalKeys; BOOL _sendsActionOnAlphaNumericalKeys; BOOL _prefersAllColumnUserResizing; BOOL _passiveDelegate; id _browserDelegate; id _target; SEL _action; SEL _doubleAction; NSMutableArray *_browserColumns; NSSize _columnSize; NSRect _scrollerRect; int _alphaNumericalLastColumn; int _maxVisibleColumns; CGFloat _minColumnWidth; int _lastColumnLoaded; int _firstVisibleColumn; int _lastVisibleColumn; NSString *_columnsAutosaveName; NSBrowserColumnResizingType _columnResizing; } // // Setting the Delegate // - (id) delegate; - (void) setDelegate: (id)anObject; // // Target and Action // - (SEL) doubleAction; - (BOOL) sendAction; - (void) setDoubleAction: (SEL)aSelector; // // Setting Component Classes // + (Class) cellClass; - (id) cellPrototype; - (Class) matrixClass; - (void) setCellClass: (Class)classId; - (void) setCellPrototype: (NSCell *)aCell; - (void) setMatrixClass: (Class)classId; // // Setting NSBrowser Behavior // - (BOOL) reusesColumns; - (void) setReusesColumns: (BOOL)flag; - (void) setTakesTitleFromPreviousColumn: (BOOL)flag; - (BOOL) takesTitleFromPreviousColumn; #if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) - (BOOL) autohidesScroller; - (void) setAutohidesScroller: (BOOL)flag; - (NSColor *) backgroundColor; - (void) setBackgroundColor: (NSColor *)backgroundColor; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (BOOL) canDragRowsWithIndexes: (NSIndexSet *)rowIndexes inColumn: (NSInteger)columnIndex withEvent: (NSEvent *)dragEvent; #endif // // Allowing Different Types of Selection // - (BOOL) allowsBranchSelection; - (BOOL) allowsEmptySelection; - (BOOL) allowsMultipleSelection; - (void) setAllowsBranchSelection: (BOOL)flag; - (void) setAllowsEmptySelection: (BOOL)flag; - (void) setAllowsMultipleSelection: (BOOL)flag; // // Setting Arrow Key Behavior // - (BOOL) acceptsArrowKeys; - (BOOL) sendsActionOnArrowKeys; - (void) setAcceptsArrowKeys: (BOOL)flag; - (void) setSendsActionOnArrowKeys: (BOOL)flag; #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (BOOL) allowsTypeSelect; - (void) setAllowsTypeSelect: (BOOL)allowsTypeSelection; #endif // // Showing a Horizontal Scroller // - (void) setHasHorizontalScroller: (BOOL)flag; - (BOOL) hasHorizontalScroller; // // Setting the NSBrowser's Appearance // - (NSInteger) maxVisibleColumns; - (CGFloat) minColumnWidth; - (BOOL) separatesColumns; - (void) setMaxVisibleColumns: (NSInteger)columnCount; - (void) setMinColumnWidth: (CGFloat)columnWidth; - (void) setSeparatesColumns: (BOOL)flag; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (CGFloat) columnWidthForColumnContentWidth: (CGFloat)columnContentWidth; - (CGFloat) columnContentWidthForColumnWidth: (CGFloat)columnWidth; #endif // // Manipulating Columns // - (void) addColumn; - (NSInteger) columnOfMatrix: (NSMatrix *)matrix; - (void) displayAllColumns; - (void) displayColumn: (NSInteger)column; - (NSInteger) firstVisibleColumn; - (BOOL) isLoaded; - (NSInteger) lastColumn; - (NSInteger) lastVisibleColumn; - (void) loadColumnZero; - (NSInteger) numberOfVisibleColumns; - (void) reloadColumn: (NSInteger)column; - (void) selectAll: (id)sender; - (void) selectRow: (NSInteger)row inColumn: (NSInteger)column; - (NSInteger) selectedColumn; - (NSInteger) selectedRowInColumn: (NSInteger)column; - (void) setLastColumn: (NSInteger)column; - (void) validateVisibleColumns; #if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) - (NSIndexPath *) selectionIndexPath; - (NSArray *) selectionIndexPaths; - (void) setSelectionIndexPath: (NSIndexPath *)path; - (void) setSelectionIndexPaths: (NSArray *)paths; #endif // // Manipulating Column Titles // - (void) drawTitle: (NSString *)title inRect: (NSRect)aRect ofColumn: (NSInteger)column; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void) drawTitleOfColumn: (NSInteger)column inRect: (NSRect)aRect; #endif - (BOOL) isTitled; - (void) setTitled: (BOOL)flag; - (void) setTitle: (NSString *)aString ofColumn: (NSInteger)column; - (NSRect) titleFrameOfColumn: (NSInteger)column; - (CGFloat) titleHeight; - (NSString *) titleOfColumn: (NSInteger)column; // // Scrolling an NSBrowser // - (void) scrollColumnsLeftBy: (NSInteger)shiftAmount; - (void) scrollColumnsRightBy: (NSInteger)shiftAmount; - (void) scrollColumnToVisible: (NSInteger)column; - (void) scrollViaScroller: (NSScroller *)sender; - (void) updateScroller; #if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) - (void) scrollRowToVisible: (NSInteger)row inColumn: (NSInteger)column; #endif // // Event Handling // - (void) doClick: (id)sender; - (void) doDoubleClick: (id)sender; #if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) - (NSInteger) clickedColumn; - (NSInteger) clickedRow; #endif // // Getting Matrices and Cells // - (id) loadedCellAtRow: (NSInteger)row column: (NSInteger)column; - (NSMatrix *) matrixInColumn: (NSInteger)column; - (id) selectedCell; - (id) selectedCellInColumn: (NSInteger)column; - (NSArray *) selectedCells; // // Getting Column Frames // - (NSRect) frameOfColumn: (NSInteger)column; - (NSRect) frameOfInsideOfColumn: (NSInteger)column; // // Manipulating Paths // - (NSString *) path; - (NSString *) pathSeparator; - (NSString *) pathToColumn: (NSInteger)column; - (BOOL) setPath: (NSString *)path; - (void) setPathSeparator: (NSString *)aString; // // Arranging an NSBrowser's Components // - (void) tile; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) // // Resizing // - (NSBrowserColumnResizingType) columnResizingType; - (void) setColumnResizingType:(NSBrowserColumnResizingType) type; - (BOOL) prefersAllColumnUserResizing; - (void) setPrefersAllColumnUserResizing: (BOOL)flag; - (CGFloat) widthOfColumn: (NSInteger)column; - (void) setWidth: (CGFloat)columnWidth ofColumn: (NSInteger)columnIndex; // // Autosave names // + (void) removeSavedColumnsWithAutosaveName: (NSString *)name; - (NSString *) columnsAutosaveName; - (void) setColumnsAutosaveName: (NSString *)name; #endif @end // // Controlling the alphanumerical keys behaviour // @interface NSBrowser (GNUstepExtensions) - (BOOL) acceptsAlphaNumericalKeys; - (void) setAcceptsAlphaNumericalKeys: (BOOL)flag; - (BOOL) sendsActionOnAlphaNumericalKeys; - (void) setSendsActionOnAlphaNumericalKeys: (BOOL)flag; @end // // Methods Implemented by the Delegate // @interface NSObject (NSBrowserDelegate) - (void) browser: (NSBrowser *)sender createRowsForColumn: (NSInteger)column inMatrix: (NSMatrix *)matrix; /** Returns YES iff */ - (BOOL) browser: (NSBrowser *)sender isColumnValid: (NSInteger)column; - (NSInteger) browser: (NSBrowser *)sender numberOfRowsInColumn: (NSInteger)column; - (BOOL) browser: (NSBrowser *)sender selectCellWithString: (NSString *)title inColumn: (NSInteger)column; - (BOOL) browser: (NSBrowser *)sender selectRow: (NSInteger)row inColumn: (NSInteger)column; - (NSString *) browser: (NSBrowser *)sender titleOfColumn: (NSInteger)column; - (void) browser: (NSBrowser *)sender willDisplayCell: (id)cell atRow: (NSInteger)row column: (NSInteger)column; - (void) browserDidScroll: (NSBrowser *)sender; - (void) browserWillScroll: (NSBrowser *)sender; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (CGFloat) browser: (NSBrowser *)browser shouldSizeColumn: (NSInteger)column forUserResize: (BOOL)flag toWidth: (CGFloat)width; - (CGFloat) browser: (NSBrowser *)browser sizeToFitWidthOfColumn: (NSInteger)column; - (void) browserColumnConfigurationDidChange: (NSNotification *)notification; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (BOOL) browser: (NSBrowser *)browser canDragRowsWithIndexes: (NSIndexSet *)rowIndexes inColumn: (NSInteger)column withEvent: (NSEvent *)event; #endif @end #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) APPKIT_EXPORT NSString *NSBrowserColumnConfigurationDidChangeNotification; #endif #endif // _GNUstep_H_NSBrowser gnustep-gui-0.24.0/Headers/AppKit/NSSpellProtocol.h0000664000076500007650000000244611354602172021727 0ustar brains99brains99/* NSSpellProtocol.h Protocols for spell checking Copyright (C) 1997 Free Software Foundation, Inc. Author: Simon Frankau Date: 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSSpellProtocol #define _GNUstep_H_NSSpellProtocol #import @protocol NSChangeSpelling - (void) changeSpelling:(id)sender; @end @protocol NSIgnoreMisspelledWords - (void)ignoreSpelling:(id)sender; @end #endif // _GNUstep_H_NSSpellProtocol gnustep-gui-0.24.0/Headers/AppKit/NSSpellServer.h0000664000076500007650000000226611023376255021377 0ustar brains99brains99/* NSSpellServer.h Class to allow a spell checker to be available to other apps Copyright (C) 1996 Free Software Foundation, Inc. Author: Gregory John Casamento Date: 2001 Author of previous version: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import gnustep-gui-0.24.0/Headers/AppKit/NSCell.h0000664000076500007650000003420112102042725017771 0ustar brains99brains99/* -*-objc-*- NSCell.h The abstract cell class Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSCell #define _GNUstep_H_NSCell #import #import // For tint #import // for NSWritingDirection #import // For text alignment #import // for NSFocusRingType #import @class NSString; @class NSMutableDictionary; @class NSView; @class NSFont; @class NSText; @class NSFormatter; enum _NSCellType { NSNullCellType, NSTextCellType, NSImageCellType }; typedef NSUInteger NSCellType; enum { NSAnyType, NSIntType, NSPositiveIntType, NSFloatType, NSPositiveFloatType, NSDoubleType, NSPositiveDoubleType, NSDateType }; enum { NSNoImage = 0, NSImageOnly, NSImageLeft, NSImageRight, NSImageBelow, NSImageAbove, NSImageOverlaps }; typedef NSUInteger NSCellImagePosition; enum _NSCellAttribute { NSCellDisabled, NSCellState, NSPushInCell, NSCellEditable, NSChangeGrayCell, NSCellHighlighted, NSCellLightsByContents, NSCellLightsByGray, NSChangeBackgroundCell, NSCellLightsByBackground, NSCellIsBordered, NSCellHasOverlappingImage, NSCellHasImageHorizontal, NSCellHasImageOnLeftOrBottom, NSCellChangesContents, NSCellIsInsetButton, NSCellAllowsMixedState }; typedef NSUInteger NSCellAttribute; enum { NSNoCellMask = 0, NSContentsCellMask = 1, NSPushInCellMask = 2, NSChangeGrayCellMask = 4, NSChangeBackgroundCellMask = 8 }; enum { GSCellTextImageXDist = 2, // horizontal distance between the text and image rects. GSCellTextImageYDist = 2 // vertical distance between the text and image rects. }; /* * We try to do as in macosx. */ enum { NSMixedState = -1, NSOffState = 0, NSOnState = 1 }; typedef NSUInteger NSCellStateValue; /** *

Enumeration of the ways that you can display an image in an * NSImageCell. The available ones are:

*

NSScaleNone: The image is always displayed with * its natural size. If it's bigger than the cell size, it is * cropped.

*

NSScaleProportionally: If the image is bigger * than the cell size, it is displayed in its natural size. If it * is smaller than the cell size, it is resized down proportionally * to fit the cell size.

*

NSScaleToFit: The image is always resized (up * or down) to fit exactly in the cell size.

*/ enum { NSScaleProportionally = 0, NSScaleToFit = 1, NSScaleNone = 2, NSImageScaleProportionallyDown = 0, NSImageScaleAxesIndependently = 1, NSImageScaleNone = 2, NSImageScaleProportionallyUpOrDown = 3 }; typedef NSUInteger NSImageScaling; @interface NSCell : NSObject { // Attributes id _contents; NSImage *_cell_image; NSFont *_font; id _object_value; struct GSCellFlagsType { // total 32 bits. 0 bits left. unsigned contents_is_attributed_string: 1; unsigned is_highlighted: 1; unsigned is_disabled: 1; unsigned is_editable: 1; unsigned is_rich_text: 1; unsigned imports_graphics: 1; unsigned shows_first_responder: 1; unsigned refuses_first_responder: 1; unsigned sends_action_on_end_editing: 1; unsigned is_bordered: 1; unsigned is_bezeled: 1; unsigned is_scrollable: 1; unsigned reserved: 1; unsigned text_align: 3; // 5 values unsigned is_selectable: 1; unsigned allows_mixed_state: 1; unsigned has_valid_object_value: 1; unsigned type: 2; // 3 values unsigned image_position: 3; // 7 values unsigned entry_type: 4; // 8 values unsigned allows_undo: 1; unsigned line_break_mode: 3; // 6 values // total 20 bits. 4 bits extension, 8 bits left. int state: 2; // 3 values but one negative unsigned mnemonic_location: 8; unsigned control_tint: 3; unsigned control_size: 2; unsigned focus_ring_type: 2; // 3 values unsigned base_writing_direction: 2; // 3 values // 4 bits reserved for subclass use unsigned subclass_bool_one: 1; unsigned subclass_bool_two: 1; unsigned subclass_bool_three: 1; unsigned subclass_bool_four: 1; // Set while the cell is edited/selected unsigned in_editing: 1; } _cell; NSUInteger _mouse_down_flags; NSUInteger _action_mask; NSFormatter *_formatter; NSMenu *_menu; id _represented_object; void *_reserved1; } // // Class methods // #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) + (NSFocusRingType)defaultFocusRingType; #endif #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) + (NSMenu *)defaultMenu; #endif + (BOOL)prefersTrackingUntilMouseUp; // // Initializing an NSCell // - (id)initImageCell:(NSImage *)anImage; - (id)initTextCell:(NSString *)aString; // // Setting the NSCell's Value // - (id)objectValue; - (BOOL)hasValidObjectValue; - (double)doubleValue; - (float)floatValue; - (int)intValue; - (NSString *)stringValue; - (void) setObjectValue:(id)object; - (void)setDoubleValue:(double)aDouble; - (void)setFloatValue:(float)aFloat; - (void)setIntValue:(int)anInt; - (void)setStringValue:(NSString *)aString; #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (NSInteger) integerValue; - (void) setIntegerValue: (NSInteger)anInt; - (void) takeIntegerValueFrom: (id)sender; #endif // // Setting Parameters // - (NSInteger)cellAttribute:(NSCellAttribute)aParameter; - (void)setCellAttribute:(NSCellAttribute)aParameter to:(NSInteger)value; // // Setting the NSCell's Type // - (void)setType:(NSCellType)aType; - (NSCellType)type; // // Enabling and Disabling the NSCell // - (BOOL)isEnabled; - (void)setEnabled:(BOOL)flag; // // Modifying Graphic Attributes // - (BOOL)isBezeled; - (BOOL)isBordered; - (BOOL)isOpaque; - (void)setBezeled:(BOOL)flag; - (void)setBordered:(BOOL)flag; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (NSFocusRingType)focusRingType; - (void)setFocusRingType:(NSFocusRingType)type; #endif // // Setting the NSCell's State // - (void)setState:(NSInteger)value; - (NSInteger)state; - (BOOL)allowsMixedState; - (void)setAllowsMixedState:(BOOL)flag; - (NSInteger)nextState; - (void)setNextState; // // Modifying Text Attributes // - (NSTextAlignment)alignment; - (NSFont *)font; - (BOOL)isEditable; - (BOOL)isSelectable; - (BOOL)isScrollable; - (void)setAlignment:(NSTextAlignment)mode; - (void)setEditable:(BOOL)flag; - (void)setFont:(NSFont *)fontObject; - (void)setSelectable:(BOOL)flag; - (void)setScrollable:(BOOL)flag; - (void)setWraps:(BOOL)flag; - (BOOL)wraps; - (NSText *)setUpFieldEditorAttributes:(NSText *)textObject; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void)setAttributedStringValue:(NSAttributedString *)attribStr; - (NSAttributedString *)attributedStringValue; - (void)setAllowsEditingTextAttributes:(BOOL)flag; - (BOOL)allowsEditingTextAttributes; - (void)setImportsGraphics:(BOOL)flag; - (BOOL)importsGraphics; - (void)setTitle:(NSString *)aString; - (NSString *)title; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (NSWritingDirection)baseWritingDirection; - (void)setBaseWritingDirection:(NSWritingDirection)direction; - (NSLineBreakMode)lineBreakMode; - (void)setLineBreakMode:(NSLineBreakMode)mode; #endif // // Target and Action // - (SEL)action; - (BOOL)isContinuous; - (NSInteger)sendActionOn:(NSInteger)mask; - (void)setAction:(SEL)aSelector; - (void)setContinuous:(BOOL)flag; - (void)setTarget:(id)anObject; - (id)target; // // Setting the Image // - (NSImage *)image; - (void)setImage:(NSImage *)anImage; // // Assigning a Tag // - (void)setTag:(NSInteger)anInt; - (NSInteger)tag; // // Formatting Data and Validating Input // #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void)setFormatter:(NSFormatter *)newFormatter; - (id)formatter; #endif - (NSInteger)entryType; - (BOOL)isEntryAcceptable:(NSString *)aString; - (void)setEntryType:(NSInteger)aType; - (void)setFloatingPointFormat:(BOOL)autoRange left:(NSUInteger)leftDigits right:(NSUInteger)rightDigits; // // Menu // #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void)setMenu:(NSMenu *)aMenu; - (NSMenu *)menu; - (NSMenu *)menuForEvent:(NSEvent *)anEvent inRect:(NSRect)cellFrame ofView:(NSView *)aView; #endif // // Comparing to Another NSCell // - (NSComparisonResult)compare:(id)otherCell; // // respond to keyboard // // All these methods except -performClick: are provided only for some // compatibility with MacOS-X code and their use in new programs is // deprecated. Please use -isEnabled, -setEnabled: instead of // -acceptsFirstReponder, -refusesFirstResponder, // -setRefusesFirstResponder:. Mnemonics (eg 'File' with the 'F' // underlined as in MS Windows(tm) menus) are not part of GNUstep's // interface so methods referring to mnemonics do nothing -- they are // provided for compatibility only; please use key equivalents instead // in your GNUstep programs. #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (BOOL)acceptsFirstResponder; - (void)setShowsFirstResponder:(BOOL)flag; - (BOOL)showsFirstResponder; - (void)setTitleWithMnemonic:(NSString *)aString; - (NSString *)mnemonic; - (void)setMnemonicLocation:(NSUInteger)location; - (NSUInteger)mnemonicLocation; - (BOOL)refusesFirstResponder; - (void)setRefusesFirstResponder:(BOOL)flag; // deprecated method now in favor of performClickWithFrame:inView: - (void)performClick:(id)sender; - (void)performClickWithFrame: (NSRect)cellFrame inView: (NSView *)controlView; #endif // // Interacting with Other NSCells // - (void)takeObjectValueFrom: (id)sender; - (void)takeDoubleValueFrom:(id)sender; - (void)takeFloatValueFrom:(id)sender; - (void)takeIntValueFrom:(id)sender; - (void)takeStringValueFrom:(id)sender; // // Using the NSCell to Represent an Object // - (id)representedObject; - (void)setRepresentedObject:(id)anObject; // // Tracking the Mouse // - (BOOL)continueTracking:(NSPoint)lastPoint at:(NSPoint)currentPoint inView:(NSView *)controlView; - (NSInteger)mouseDownFlags; - (void)getPeriodicDelay:(float *)delay interval:(float *)interval; - (BOOL)startTrackingAt:(NSPoint)startPoint inView:(NSView *)controlView; - (void)stopTracking:(NSPoint)lastPoint at:(NSPoint)stopPoint inView:(NSView *)controlView mouseIsUp:(BOOL)flag; - (BOOL)trackMouse:(NSEvent *)theEvent inRect:(NSRect)cellFrame ofView:(NSView *)controlView untilMouseUp:(BOOL)flag; // // Managing the Cursor // - (void)resetCursorRect:(NSRect)cellFrame inView:(NSView *)controlView; // // Handling Keyboard Alternatives // - (NSString *)keyEquivalent; // // Determining Component Sizes // - (void)calcDrawInfo:(NSRect)aRect; - (NSSize)cellSize; - (NSSize)cellSizeForBounds:(NSRect)aRect; - (NSRect)drawingRectForBounds:(NSRect)theRect; - (NSRect)imageRectForBounds:(NSRect)theRect; - (NSRect)titleRectForBounds:(NSRect)theRect; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void)setControlSize:(NSControlSize)controlSize; - (NSControlSize)controlSize; #endif // // Displaying // - (NSView *)controlView; - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView; - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView; - (void)highlight:(BOOL)lit withFrame:(NSRect)cellFrame inView:(NSView *)controlView; - (BOOL)isHighlighted; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void)setHighlighted: (BOOL) flag; - (NSColor*)highlightColorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView; - (void)setControlTint:(NSControlTint)controlTint; - (NSControlTint)controlTint; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (void)setControlView:(NSView*)view; #endif // // Editing Text // - (void)editWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)textObject delegate:(id)anObject event:(NSEvent *)theEvent; - (void)selectWithFrame:(NSRect)aRect inView:(NSView *)controlView editor:(NSText *)textObject delegate:(id)anObject start:(NSInteger)selStart length:(NSInteger)selLength; - (void)endEditing:(NSText *)textObject; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (BOOL)sendsActionOnEndEditing; - (void)setSendsActionOnEndEditing:(BOOL)flag; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (BOOL)allowsUndo; - (void)setAllowsUndo:(BOOL)flag; #endif @end // // Methods that are private GNUstep extensions // @interface NSCell (PrivateMethods) - (NSDictionary*) _nonAutoreleasedTypingAttributes; - (NSColor*) textColor; - (NSSize) _sizeText: (NSString*) title; - (void) _drawText: (NSString*)aString inFrame: (NSRect)cellFrame; - (void) _drawAttributedText: (NSAttributedString*)aString inFrame: (NSRect)aRect; - (BOOL) _sendsActionOn:(NSUInteger)eventTypeMask; - (NSAttributedString*) _drawAttributedString; - (void) _drawBorderAndBackgroundWithFrame: (NSRect)cellFrame inView: (NSView*)controlView; - (void) _drawFocusRingWithFrame: (NSRect)cellFrame inView: (NSView*)controlView; - (void) _drawEditorWithFrame: (NSRect)cellFrame inView: (NSView*)controlView; - (void) _setInEditing: (BOOL)flag; - (void) _updateFieldEditor: (NSText*)textObject; @end #endif // _GNUstep_H_NSCell gnustep-gui-0.24.0/Headers/AppKit/NSCollectionViewItem.h0000664000076500007650000000364312134764617022705 0ustar brains99brains99/* -*-objc-*- NSCollectionViewItem.h Copyright (C) 2013 Free Software Foundation, Inc. Author: Doug Simons (doug.simons@testplant.com) Frank LeGrand (frank.legrand@testplant.com) Date: February 2013 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSCollectionViewItem #define _GNUstep_H_NSCollectionViewItem #import #import #import #import #import #import #import #import #import @interface NSCollectionViewItem : NSViewController { IBOutlet NSTextField *textField; IBOutlet NSImageView *imageView; BOOL _isSelected; } - (NSCollectionView *)collectionView; - (NSArray *)draggingImageComponents; - (void)setSelected:(BOOL)shouldBeSelected; - (BOOL)isSelected; - (NSTextField *)textField; - (void)setTextField:(NSTextField *)aTextField; - (NSImageView *)imageView; - (void)setImageView:(NSImageView *)anImageView; @end #endif /* _GNUstep_H_NSCollectionView */ gnustep-gui-0.24.0/Headers/AppKit/NSNibConnector.h0000664000076500007650000000326711351153376021517 0ustar brains99brains99/* NSNibConnector.h Copyright (C) 1999 Free Software Foundation, Inc. Author: Richard Frith-Macdonald Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSNibConnector #define _GNUstep_H_NSNibConnector #import #import @class NSString; @interface NSNibConnector : NSObject { id _src; id _dst; NSString *_tag; } - (id) destination; - (void) establishConnection; - (NSString*) label; - (void) replaceObject: (id)anObject withObject: (id)anotherObject; - (id) source; - (void) setDestination: (id)anObject; - (void) setLabel: (NSString*)label; - (void) setSource: (id)anObject; @end @interface NSNibControlConnector : NSNibConnector - (void) establishConnection; @end @interface NSNibOutletConnector : NSNibConnector - (void) establishConnection; @end #endif gnustep-gui-0.24.0/Headers/AppKit/NSDrawer.h0000664000076500007650000000651611673175625020370 0ustar brains99brains99/* -*-objc-*- NSDrawer.h The drawer class Copyright (C) 2001 Free Software Foundation, Inc. Author: Fred Kiefer Date: 2001 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSDrawer #define _GNUstep_H_NSDrawer #import #import #import @class NSWindow; @class NSView; @class NSNotification; enum { NSDrawerClosedState = 0, NSDrawerOpeningState = 1, NSDrawerOpenState = 2, NSDrawerClosingState = 3 }; @interface NSDrawer : NSResponder { // Attributes id _delegate; id _drawerWindow; NSRectEdge _preferredEdge; NSRectEdge _currentEdge; NSSize _maxContentSize; NSSize _minContentSize; NSSize _contentSize; CGFloat _leadingOffset; CGFloat _trailingOffset; NSInteger _state; } // Creation - (id) initWithContentSize: (NSSize)contentSize preferredEdge: (NSRectEdge)edge; // Opening and Closing - (void) close; - (void) close: (id)sender; - (void) open; - (void) open: (id)sender; - (void) openOnEdge: (NSRectEdge)edge; - (void) toggle: (id)sender; // Managing Size - (NSSize) contentSize; - (CGFloat) leadingOffset; - (NSSize) maxContentSize; - (NSSize) minContentSize; - (void) setContentSize: (NSSize)size; - (void) setLeadingOffset: (CGFloat)offset; - (void) setMaxContentSize: (NSSize)size; - (void) setMinContentSize: (NSSize)size; - (void) setTrailingOffset: (CGFloat)offset; - (CGFloat) trailingOffset; // Managing Edge - (NSRectEdge) edge; - (NSRectEdge) preferredEdge; - (void) setPreferredEdge: (NSRectEdge)preferredEdge; // Managing Views - (NSView *) contentView; - (NSWindow *) parentWindow; - (void) setContentView: (NSView *)aView; - (void) setParentWindow: (NSWindow *)parent; // Delegation and State - (id) delegate; - (void) setDelegate: (id)anObject; - (NSInteger) state; @end @interface NSDrawerDelegate - (BOOL) drawerShouldClose: (NSDrawer *)sender; - (BOOL) drawerShouldOpen: (NSDrawer *)sender; - (NSSize) drawerWillResizeContents: (NSDrawer *)sender toSize: (NSSize)contentSize; - (void) drawerDidClose: (NSNotification *)notification; - (void) drawerDidOpen: (NSNotification *)notification; - (void) drawerWillClose: (NSNotification *)notification; - (void) drawerWillOpen: (NSNotification *)notification; @end // Notifications APPKIT_EXPORT NSString *NSDrawerDidCloseNotification; APPKIT_EXPORT NSString *NSDrawerDidOpenNotification; APPKIT_EXPORT NSString *NSDrawerWillCloseNotification; APPKIT_EXPORT NSString *NSDrawerWillOpenNotification; #endif // _GNUstep_H_NSDrawer gnustep-gui-0.24.0/Headers/AppKit/NSFormCell.h0000664000076500007650000000535312110024400020610 0ustar brains99brains99/* NSFormCell.h The cell class for the NSForm control Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: March 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSFormCell #define _GNUstep_H_NSFormCell #import #import @interface NSFormCell : NSActionCell { // NB: this is the titleWidth which is effectively used -- takes in // account all the other cells' titleWidths. // If its value is -1, it means it must be recomputed. float _displayedTitleWidth; // Think the following as a BOOL ivar // YES if the titleWidth is automatically computed #define _formcell_auto_title_width _cell.subclass_bool_one NSCell* _titleCell; #define _formcell_placeholder_is_attributed_string _cell.subclass_bool_two id _placeholder; } // // Modifying the Title // - (void)setTitle:(NSString*)aString; - (void)setTitleAlignment:(NSTextAlignment)mode; - (void)setTitleFont:(NSFont*)fontObject; - (void)setTitleWidth:(CGFloat)width; - (NSString*)title; - (NSTextAlignment)titleAlignment; - (NSFont*)titleFont; - (CGFloat)titleWidth; - (CGFloat)titleWidth:(NSSize)aSize; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) // // Attributed title // - (NSAttributedString *)attributedTitle; - (void)setAttributedTitle:(NSAttributedString *)anAttributedString; - (void)setTitleWithMnemonic:(NSString *)titleWithAmpersand; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (NSAttributedString*)placeholderAttributedString; - (NSString*)placeholderString; - (void)setPlaceholderAttributedString:(NSAttributedString*)string; - (void)setPlaceholderString:(NSString*)string; - (NSWritingDirection)titleBaseWritingDirection; - (void)setTitleBaseWritingDirection:(NSWritingDirection)writingDirection; #endif @end APPKIT_EXPORT NSString *_NSFormCellDidChangeTitleWidthNotification; #endif // _GNUstep_H_NSFormCell gnustep-gui-0.24.0/Headers/AppKit/NSScrollView.h0000664000076500007650000001104012110256537021206 0ustar brains99brains99/* NSScrollView.h A view that allows you to scroll a document view that's too big to display entirely on a window. Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: July 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSScrollView #define _GNUstep_H_NSScrollView #import #import @class NSClipView; @class NSRulerView; @class NSColor; @class NSCursor; @class NSScroller; @interface NSScrollView : NSView { NSClipView *_contentView; NSScroller *_horizScroller; NSScroller *_vertScroller; NSRulerView *_horizRuler; NSRulerView *_vertRuler; NSClipView *_headerClipView; NSView *_cornerView; float _hLineScroll; float _hPageScroll; float _vLineScroll; float _vPageScroll; NSBorderType _borderType; BOOL _hasHorizScroller; BOOL _hasVertScroller; BOOL _hasHorizRuler; BOOL _hasVertRuler; BOOL _scrollsDynamically; BOOL _rulersVisible; BOOL _knobMoved; BOOL _hasHeaderView; BOOL _hasCornerView; BOOL _autohidesScrollers; } /* Calculating layout */ + (NSSize)contentSizeForFrameSize:(NSSize)frameSize hasHorizontalScroller:(BOOL)hFlag hasVerticalScroller:(BOOL)vFlag borderType:(NSBorderType)borderType; + (NSSize)frameSizeForContentSize:(NSSize)contentSize hasHorizontalScroller:(BOOL)hFlag hasVerticalScroller:(BOOL)vFlag borderType:(NSBorderType)borderType; /* Determining component sizes */ - (NSSize)contentSize; - (NSRect)documentVisibleRect; /* Managing graphic attributes */ - (void)setBackgroundColor:(NSColor*)aColor; - (NSColor*)backgroundColor; - (void)setBorderType:(NSBorderType)borderType; - (NSBorderType)borderType; /* Managing the scrolled views */ - (void)setContentView:(NSClipView*)aView; - (NSClipView*)contentView; - (void)setDocumentView:(NSView*)aView; - (id)documentView; - (void)setDocumentCursor:(NSCursor*)aCursor; - (NSCursor*)documentCursor; /* Managing scrollers */ - (void)setHorizontalScroller:(NSScroller*)aScroller; - (NSScroller*)horizontalScroller; - (void)setHasHorizontalScroller:(BOOL)flag; - (BOOL)hasHorizontalScroller; - (void)setVerticalScroller:(NSScroller*)aScroller; - (NSScroller*)verticalScroller; - (void)setHasVerticalScroller:(BOOL)flag; - (BOOL)hasVerticalScroller; /* Managing rulers */ + (void)setRulerViewClass:(Class)aClass; + (Class)rulerViewClass; - (void)setHasHorizontalRuler:(BOOL)flag; - (BOOL)hasHorizontalRuler; - (void)setHorizontalRulerView:(NSRulerView*)aRulerView; - (NSRulerView*)horizontalRulerView; - (void)setHasVerticalRuler:(BOOL)flag; - (BOOL)hasVerticalRuler; - (void)setVerticalRulerView:(NSRulerView*)aRulerView; - (NSRulerView*)verticalRulerView; - (void)setRulersVisible:(BOOL)flag; - (BOOL)rulersVisible; /* Setting scrolling behavior */ - (void)setLineScroll:(CGFloat)aFloat; - (CGFloat)lineScroll; - (void)setPageScroll:(CGFloat)aFloat; - (CGFloat)pageScroll; - (void)setScrollsDynamically:(BOOL)flag; - (BOOL)scrollsDynamically; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (CGFloat) horizontalLineScroll; - (CGFloat) horizontalPageScroll; - (CGFloat) verticalLineScroll; - (CGFloat) verticalPageScroll; - (void) setHorizontalLineScroll: (CGFloat)aFloat; - (void) setHorizontalPageScroll: (CGFloat)aFloat; - (void) setVerticalLineScroll: (CGFloat)aFloat; - (void) setVerticalPageScroll: (CGFloat)aFloat; /* Setting the background drawing */ - (void)setDrawsBackground:(BOOL)flag; - (BOOL)drawsBackground; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (BOOL)autohidesScrollers; - (void)setAutohidesScrollers:(BOOL)flag; #endif /* Updating display after scrolling */ - (void)reflectScrolledClipView:(NSClipView*)aClipView; /* Arranging components */ - (void)tile; @end #endif /* _GNUstep_H_NSScrollView */ gnustep-gui-0.24.0/Headers/AppKit/NSTextFieldCell.h0000664000076500007650000000540011354736316021617 0ustar brains99brains99/* NSTextFieldCell.h Cell class for the text field entry control Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSTextFieldCell #define _GNUstep_H_NSTextFieldCell #import #import @class NSColor; #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) typedef enum _NSTextFieldBezelStyle { NSTextFieldSquareBezel = 0, NSTextFieldRoundedBezel } NSTextFieldBezelStyle; #endif @interface NSTextFieldCell : NSActionCell { // Attributes NSColor *_background_color; NSColor *_text_color; #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) NSTextFieldBezelStyle _bezelStyle; #else unsigned int _bezelStyle; #endif // Think of the following ones as of two BOOL ivars #define _textfieldcell_draws_background _cell.subclass_bool_one #define _textfieldcell_placeholder_is_attributed_string _cell.subclass_bool_three id _placeholder; } // // Modifying Graphic Attributes // - (void)setTextColor:(NSColor *)aColor; - (NSColor *)textColor; - (void)setDrawsBackground:(BOOL)flag; - (BOOL)drawsBackground; - (void)setBackgroundColor:(NSColor *)aColor; - (NSColor *)backgroundColor; #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) - (void)setBezelStyle:(NSTextFieldBezelStyle)style; - (NSTextFieldBezelStyle)bezelStyle; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (void)setPlaceholderString:(NSString *)string; - (NSString *)placeholderString; - (void)setPlaceholderAttributedString:(NSAttributedString *)string; - (NSAttributedString *)placeholderAttributedString; #endif @end // // Methods that are private GNUstep extensions // @interface NSTextFieldCell (PrivateMethods) - (void) _drawBackgroundWithFrame: (NSRect)cellFrame inView: (NSView*)controlView; @end #endif // _GNUstep_H_NSTextFieldCell gnustep-gui-0.24.0/Headers/AppKit/NSSegmentedCell.h0000664000076500007650000000673412107547001021641 0ustar brains99brains99/* NSSegmentedCell.h * * Copyright (C) 2007 Free Software Foundation, Inc. * * Author: Gregory John Casamento * Date: 2007 * * This file is part of GNUstep. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 * USA. */ #ifndef _GNUstep_H_NSSegmentedCell #define _GNUstep_H_NSSegmentedCell #import #import // tracking types... typedef enum { NSSegmentSwitchTrackingSelectOne = 0, NSSegmentSwitchTrackingSelectAny = 1, NSSegmentSwitchTrackingMomentary = 2 } NSSegmentSwitchTracking; // forward declarations @class NSMutableArray; @class NSImage; @class NSString; @class NSMenu; @class NSView; @interface NSSegmentedCell : NSActionCell { @private NSInteger _selected_segment; int _key_selection; NSMutableArray *_items; struct { unsigned int _tracking_mode:3; unsigned int _trimmed_labels:1; unsigned int _drawing:1; unsigned int unused1:2; unsigned int _recalcToolTips:1; unsigned int unused2:3; unsigned int _style:8; unsigned int unused3:13; } _segmentCellFlags; } // Specifying number of segments... - (void) setSegmentCount: (NSInteger) count; - (NSInteger) segmentCount; // Specifying selected segment... - (void) setSelectedSegment: (NSInteger) segment; - (void) setSelected: (BOOL)flag forSegment: (NSInteger)segment; - (NSInteger) selectedSegment; - (void) selectSegmentWithTag: (NSInteger)tag; - (void) makeNextSegmentKey; - (void) makePreviousSegmentKey; // Specify tracking mode... - (void) setTrackingMode: (NSSegmentSwitchTracking)mode; - (NSSegmentSwitchTracking) trackingMode; // Working with individual segments... - (void) setWidth: (CGFloat)width forSegment: (NSInteger)segment; - (CGFloat) widthForSegment: (NSInteger)segment; - (void) setImage: (NSImage *)image forSegment: (NSInteger)segment; - (NSImage *) imageForSegment: (NSInteger)segment; - (void) setLabel: (NSString *)label forSegment: (NSInteger)segment; - (NSString *) labelForSegment: (NSInteger)segment; - (BOOL) isSelectedForSegment: (NSInteger)segment; - (void) setEnabled: (BOOL)flag forSegment: (NSInteger)segment; - (BOOL) isEnabledForSegment: (NSInteger)segment; - (void) setMenu: (NSMenu *)menu forSegment: (NSInteger)segment; - (NSMenu *) menuForSegment: (NSInteger)segment; - (void) setToolTip: (NSString *) toolTip forSegment: (NSInteger)segment; - (NSString *) toolTipForSegment: (NSInteger)segment; - (void) setTag: (NSInteger)tag forSegment: (NSInteger)segment; - (NSInteger) tagForSegment: (NSInteger)segment; // Drawing custom content - (void) drawSegment: (NSInteger)segment inFrame: (NSRect)frame withView: (NSView *)view; // Setting the style of the segments #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void)setSegmentStyle:(NSSegmentStyle)style; - (NSSegmentStyle)segmentStyle; #endif @end #endif gnustep-gui-0.24.0/Headers/AppKit/NSParagraphStyle.h0000664000076500007650000001540312110024400022030 0ustar brains99brains99/* NSParagraphStyle.h NSParagraphStyle and NSMutableParagraphStyle hold paragraph style information NSTextTab holds information about a single tab stop Copyright (C) 1996,1999 Free Software Foundation, Inc. Author: Daniel Böhringer Date: August 1998 Update: Richard Frith-Macdonald March 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSParagraphStyle #define _GNUstep_H_NSParagraphStyle #import #import #import typedef enum _NSTextTabType { NSLeftTabStopType = 0, NSRightTabStopType, NSCenterTabStopType, NSDecimalTabStopType } NSTextTabType; enum _NSLineBreakMode { /* What to do with long lines */ NSLineBreakByWordWrapping = 0, /* Wrap at word boundaries, default */ NSLineBreakByCharWrapping, /* Wrap at character boundaries */ NSLineBreakByClipping, /* Simply clip */ NSLineBreakByTruncatingHead, /* Truncate at head of line: "...wxyz" */ NSLineBreakByTruncatingTail, /* Truncate at tail of line: "abcd..." */ NSLineBreakByTruncatingMiddle /* Truncate middle of line: "ab...yz" */ }; typedef NSUInteger NSLineBreakMode; enum _NSWritingDirection { NSWritingDirectionNaturalDirection, NSWritingDirectionLeftToRight, NSWritingDirectionRightToLeft }; typedef NSInteger NSWritingDirection; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) APPKIT_EXPORT NSString *NSTabColumnTerminatorsAttributeName; #endif @interface NSTextTab : NSObject { NSTextTabType _tabStopType; NSDictionary *_options; NSTextAlignment _alignment; float _location; } - (id) initWithType: (NSTextTabType)type location: (CGFloat)loc; - (CGFloat) location; - (NSTextTabType) tabStopType; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (id) initWithTextAlignment: (NSTextAlignment)align location: (CGFloat)loc options: (NSDictionary *)options; - (NSTextAlignment) alignment; - (NSDictionary *) options; #endif @end @interface NSParagraphStyle : NSObject { NSMutableArray *_tabStops; NSArray *_textBlocks; NSArray *_textLists; float _lineSpacing; float _paragraphSpacing; float _headIndent; float _tailIndent; float _firstLineHeadIndent; float _minimumLineHeight; float _maximumLineHeight; float _paragraphSpacingBefore; float _defaultTabInterval; float _hyphenationFactor; float _lineHeightMultiple; float _tighteningFactorForTruncation; NSTextAlignment _alignment; NSLineBreakMode _lineBreakMode; NSWritingDirection _baseDirection; int _headerLevel; } + (NSParagraphStyle*) defaultParagraphStyle; /* * "Leading": distance between the bottom of one line fragment and top * of next (applied between lines in the same container). * Can't be negative. This value is included in the line fragment * heights in layout manager. */ - (CGFloat) lineSpacing; /* * Distance between the bottom of this paragraph and top of next. */ - (CGFloat) paragraphSpacing; - (NSTextAlignment) alignment; /* * The following values are relative to the appropriate margin * (depending on the paragraph direction) */ /* * Distance from margin to front edge of paragraph */ - (CGFloat) headIndent; /* * Distance from margin to back edge of paragraph; if negative or 0, * from other margin */ - (CGFloat) tailIndent; /* * Distance from margin to edge appropriate for text direction */ - (CGFloat) firstLineHeadIndent; /* * Distance from margin to tab stops */ - (NSArray *)tabStops; /* * Line height is the distance from bottom of descenders to to * of ascenders; basically the line fragment height. Does not include * lineSpacing (which is added after this computation). */ - (CGFloat) minimumLineHeight; /* * 0 implies no maximum. */ - (CGFloat) maximumLineHeight; - (NSLineBreakMode) lineBreakMode; #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) /* * Returns the writing direction of "language", which is an ISO 639 * two- or three letter code, e.g. "en", or an ISO language-region * format, e.g. "en_GB" */ + (NSWritingDirection) defaultWritingDirectionForLanguage: (NSString*) language; - (NSWritingDirection) baseWritingDirection; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (CGFloat) defaultTabInterval; - (CGFloat) lineHeightMultiple; - (CGFloat) paragraphSpacingBefore; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (NSInteger) headerLevel; - (float) hyphenationFactor; - (NSArray *) textBlocks; - (NSArray *) textLists; - (float) tighteningFactorForTruncation; #endif @end @interface NSMutableParagraphStyle : NSParagraphStyle { } - (void) setLineSpacing: (CGFloat)aFloat; - (void) setParagraphSpacing: (CGFloat)aFloat; - (void) setAlignment: (NSTextAlignment)newAlignment; - (void) setFirstLineHeadIndent: (CGFloat)aFloat; - (void) setHeadIndent: (CGFloat)aFloat; - (void) setTailIndent: (CGFloat)aFloat; - (void) setLineBreakMode: (NSLineBreakMode)mode; - (void) setMinimumLineHeight: (CGFloat)aFloat; - (void) setMaximumLineHeight: (CGFloat)aFloat; - (void) addTabStop: (NSTextTab*)anObject; - (void) removeTabStop: (NSTextTab*)anObject; - (void) setTabStops: (NSArray*)array; - (void) setParagraphStyle: (NSParagraphStyle*)obj; #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) - (void) setBaseWritingDirection: (NSWritingDirection)direction; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (void) setDefaultTabInterval: (CGFloat)interval; - (void) setLineHeightMultiple: (CGFloat)factor; - (void) setParagraphSpacingBefore: (CGFloat)spacing; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (void) setHeaderLevel: (NSInteger)level; - (void) setHyphenationFactor: (float)factor; - (void) setTextBlocks: (NSArray *)blocks; - (void) setTextLists: (NSArray *)lists; - (void) setTighteningFactorForTruncation: (float)factor; #endif @end #endif // _GNUstep_H_NSParagraphStyle gnustep-gui-0.24.0/Headers/AppKit/NSFileWrapper.h0000664000076500007650000001171412230050413021331 0ustar brains99brains99/* NSFileWrapper.h NSFileWrapper objects hold a file's contents in dynamic memory. Copyright (C) 1996 Free Software Foundation, Inc. Author: Felipe A. Rodriguez Date: Sept 1998 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSFileWrapper #define _GNUstep_H_NSFileWrapper #import #import @class NSData; @class NSDictionary; @class NSError; @class NSMutableDictionary; @class NSString; @class NSURL; @class NSImage; typedef enum { GSFileWrapperDirectoryType, GSFileWrapperRegularFileType, GSFileWrapperSymbolicLinkType } GSFileWrapperType; #if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) enum { NSFileWrapperReadingImmediate = 1, NSFileWrapperReadingWithoutMapping = 2, }; typedef NSUInteger NSFileWrapperReadingOptions; enum { NSFileWrapperWritingAtomic = 1, NSFileWrapperWritingWithNameUpdating = 2, }; typedef NSUInteger NSFileWrapperWritingOptions; #endif @interface NSFileWrapper : NSObject { NSString *_filename; NSString *_preferredFilename; NSMutableDictionary *_fileAttributes; GSFileWrapperType _wrapperType; id _wrapperData; NSImage *_iconImage; } // // Initialization // // Init instance of directory type - (id)initDirectoryWithFileWrappers:(NSDictionary *)docs; // Init instance of regular file type - (id)initRegularFileWithContents:(NSData *)data; // Init instance of symbolic link type - (id)initSymbolicLinkWithDestination:(NSString *)path; // Init an instance from the file, directory, or symbolic link at path. // This can create a tree of instances - (id)initWithPath:(NSString *)path; // with a directory instance at the top // Init an instance from data in standard serial format. Serial format // is the same as that used by NSText's RTFDFromRange: method. This can // create a tree of instances with a directory instance at the top - (id)initWithSerializedRepresentation:(NSData *)data; // // General methods // // write instace to disk at path. if directory type, this method is recursive // if flag is YES, the wrapper will be updated with the name used in writing // the file - (BOOL)writeToFile:(NSString *)path atomically:(BOOL)atomicFlag updateFilenames:(BOOL)updateFilenamesFlag; - (NSData *)serializedRepresentation; - (void)setFilename:(NSString *)filename; - (NSString *)filename; - (void)setPreferredFilename:(NSString *)filename; - (NSString *)preferredFilename; - (void)setFileAttributes:(NSDictionary *)attributes; - (NSDictionary *)fileAttributes; - (BOOL)isRegularFile; - (BOOL)isDirectory; - (BOOL)isSymbolicLink; - (void)setIcon:(NSImage *)icon; - (NSImage *)icon; - (BOOL)needsToBeUpdatedFromPath:(NSString *)path; - (BOOL)updateFromPath:(NSString *)path; // // Directory type methods // // these messages raise an exception when sent to non-directory type wrappers! - (NSString *)addFileWrapper:(NSFileWrapper *)doc; - (void)removeFileWrapper:(NSFileWrapper *)doc; - (NSDictionary *)fileWrappers; - (NSString *)keyForFileWrapper:(NSFileWrapper *)doc; - (NSString *)addFileWithPath:(NSString *)path; - (NSString *)addRegularFileWithContents:(NSData *)data preferredFilename:(NSString *)filename; - (NSString *)addSymbolicLinkWithDestination:(NSString *)path preferredFilename:(NSString *)filename; // // Regular file type methods // - (NSData *)regularFileContents; // // Symbolic link type methods // - (NSString *)symbolicLinkDestination; #if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) - (id)initSymbolicLinkWithDestinationURL:(NSURL *)url; - (id)initWithURL:(NSURL *)url options:(NSFileWrapperReadingOptions)options error:(NSError **)outError; - (BOOL)matchesContentsOfURL:(NSURL *)url; - (BOOL)readFromURL:(NSURL *)url options:(NSFileWrapperReadingOptions)options error:(NSError **)outError; - (NSURL *)symbolicLinkDestinationURL; - (BOOL)writeToURL:(NSURL *)url options:(NSFileWrapperWritingOptions)options originalContentsURL:(NSURL *)originalContentsURL error:(NSError **)outError; #endif @end #endif // _GNUstep_H_NSFileWrapper gnustep-gui-0.24.0/Headers/AppKit/NSClipView.h0000664000076500007650000000441612110024400020626 0ustar brains99brains99/* NSClipView.h The class that contains the document view displayed by a NSScrollView. Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: July 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSClipView #define _GNUstep_H_NSClipView #import #import @class NSNotification; @class NSCursor; @class NSColor; @interface NSClipView : NSView { NSView* _documentView; NSCursor* _cursor; NSColor* _backgroundColor; BOOL _drawsBackground; BOOL _copiesOnScroll; /* Cached */ BOOL _isOpaque; } /* Setting the document view */ - (void)setDocumentView:(NSView*)aView; - (id)documentView; /* Scrolling */ - (void)scrollToPoint:(NSPoint)aPoint; - (BOOL)autoscroll:(NSEvent*)theEvent; - (NSPoint)constrainScrollPoint:(NSPoint)proposedNewOrigin; /* Determining scrolling efficiency */ - (void)setCopiesOnScroll:(BOOL)flag; - (BOOL)copiesOnScroll; /* Getting the visible portion */ - (NSRect)documentRect; - (NSRect)documentVisibleRect; /* Setting the document cursor */ - (void)setDocumentCursor:(NSCursor*)aCursor; - (NSCursor*)documentCursor; /* Setting the background color */ - (void)setBackgroundColor:(NSColor*)aColor; - (NSColor*)backgroundColor; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) /* Setting the background drawing */ - (void)setDrawsBackground:(BOOL)flag; - (BOOL)drawsBackground; #endif @end #endif /* _GNUstep_H_NSClipView */ gnustep-gui-0.24.0/Headers/AppKit/NSOpenGL.h0000664000076500007650000001045312066646726020265 0ustar brains99brains99/** -*-ObjC-*- Copyright (C) 2002 Free Software Foundation, Inc. Author: Frederic De Jaeger Date: Nov 2002 This file is part of the GNU Objective C User interface library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _NSOpenGL_h_INCLUDE #define _NSOpenGL_h_INCLUDE #import #import @class NSView; typedef enum { NSOpenGLPFAAllRenderers = 1, NSOpenGLPFADoubleBuffer = 5, NSOpenGLPFAStereo = 6, NSOpenGLPFAAuxBuffers = 7, NSOpenGLPFAColorSize = 8, NSOpenGLPFAAlphaSize = 11, NSOpenGLPFADepthSize = 12, NSOpenGLPFAStencilSize = 13, NSOpenGLPFAAccumSize = 14, NSOpenGLPFAMinimumPolicy = 51, NSOpenGLPFAMaximumPolicy = 52, NSOpenGLPFAOffScreen = 53, NSOpenGLPFAFullScreen = 54, NSOpenGLPFASampleBuffers = 55, // 10.2 NSOpenGLPFASamples = 56, // 10.2 NSOpenGLPFAAuxDepthStencil = 57, // 10.2 NSOpenGLPFAColorFloat = 58, // 10.4 NSOpenGLPFAMultisample = 59, // 10.4 NSOpenGLPFASupersample = 60, // 10.4 NSOpenGLPFASampleAlpha = 61, // 10.4 NSOpenGLPFARendererID = 70, NSOpenGLPFASingleRenderer = 71, NSOpenGLPFANoRecovery = 72, NSOpenGLPFAAccelerated = 73, NSOpenGLPFAClosestPolicy = 74, NSOpenGLPFARobust = 75, NSOpenGLPFABackingStore = 76, NSOpenGLPFAMPSafe = 78, NSOpenGLPFAWindow = 80, NSOpenGLPFAMultiScreen = 81, NSOpenGLPFACompliant = 83, NSOpenGLPFAScreenMask = 84, NSOpenGLPFAPixelBuffer = 90, // 10.3 NSOpenGLPFAAllowOfflineRenderers = 96,// 10.5 NSOpenGLPFAVirtualScreenCount = 128 // 10.2 } NSOpenGLPixelFormatAttribute; typedef enum { NSOpenGLCPSwapRectangle = 200, NSOpenGLCPSwapRectangleEnable = 201, NSOpenGLCPRasterizationEnable = 221, NSOpenGLCPSwapInterval = 222, NSOpenGLCPSurfaceOrder = 235, NSOpenGLCPSurfaceOpacity = 236, NSOpenGLCPStateValidation = 301 } NSOpenGLContextParameter; typedef enum { NSOpenGLGOFormatCacheSize = 501, NSOpenGLGOClearFormatCache = 502, NSOpenGLGORetainRenderers = 503, NSOpenGLGOResetLibrary = 504 } NSOpenGLGlobalOption; @interface NSOpenGLPixelFormat : NSObject { } - (void)getValues:(int *)vals forAttribute:(NSOpenGLPixelFormatAttribute)attrib forVirtualScreen:(int)screen; - (id)initWithAttributes:(NSOpenGLPixelFormatAttribute *)attribs; - (int)numberOfVirtualScreens; @end @interface NSOpenGLContext : NSObject { } + (void)clearCurrentContext; + (NSOpenGLContext *)currentContext; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (void *)CGLContextObj; #endif - (void)clearDrawable; - (void)copyAttributesFromContext:(NSOpenGLContext *)context withMask:(unsigned long)mask; #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) - (void)createTexture:(unsigned long)target fromView:(NSView*)view internalFormat:(unsigned long)format; - (int)currentVirtualScreen; #endif - (void)flushBuffer; - (void)getValues:(long *)vals forParameter:(NSOpenGLContextParameter)param; #if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) - (id)initWithCGLContextObj:(void *)context; #endif - (id)initWithFormat:(NSOpenGLPixelFormat *)format shareContext:(NSOpenGLContext *)share; - (void)makeCurrentContext; - (void)setCurrentVirtualScreen:(int)screen; - (void)setFullScreen; - (void)setOffScreen:(void *)baseaddr width:(long)width height:(long)height rowbytes:(long)rowbytes; - (void)setValues:(const long *)vals forParameter:(NSOpenGLContextParameter)param; - (void)setView:(NSView *)view; - (void)update; - (NSView *)view; @end #endif gnustep-gui-0.24.0/Headers/AppKit/NSColorPicking.h0000664000076500007650000000427511375004636021517 0ustar brains99brains99/* NSColorPicking.h Protocols for picking colors Copyright (C) 1997 Free Software Foundation, Inc. Author: Simon Frankau Date: 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSColorPicking #define _GNUstep_H_NSColorPicking #import @class NSColor; @class NSColorPanel; @class NSView; @class NSImage; @class NSButtonCell; @class NSColorList; @protocol NSColorPickingCustom // // Getting the Mode // - (int)currentMode; - (BOOL)supportsMode:(int)mode; // // Getting the view // - (NSView *)provideNewView:(BOOL)firstRequest; // // Setting the Current Color // - (void)setColor:(NSColor *)aColor; @end @protocol NSColorPickingDefault // // Initialize a Color Picker // - (id)initWithPickerMask:(int)mask colorPanel:(NSColorPanel *)colorPanel; // // Adding Button Images // - (void)insertNewButtonImage:(NSImage *)newImage in:(NSButtonCell *)newButtonCell; - (NSImage *)provideNewButtonImage; // // Setting the Mode // - (void)setMode:(int)mode; // // Using Color Lists // - (void)attachColorList:(NSColorList *)aColorList; - (void)detachColorList:(NSColorList *)aColorList; // // Showing Opacity Controls // - (void)alphaControlAddedOrRemoved:(id)sender; // // Responding to a Resized View // - (void)viewSizeChanged:(id)sender; @end #endif // _GNUstep_H_NSColorPicking gnustep-gui-0.24.0/Headers/AppKit/NSDragging.h0000664000076500007650000000721412107776031020651 0ustar brains99brains99/* NSDragging.h Protocols for drag 'n' drop. Copyright (C) 1997 Free Software Foundation, Inc. Author: Simon Frankau Date: 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSDragging #define _GNUstep_H_NSDragging #import #import @class NSWindow; @class NSPasteboard; @class NSImage; @class NSURL; enum _NSDragOperation { NSDragOperationNone = 0, NSDragOperationCopy = 1, NSDragOperationLink = 2, NSDragOperationGeneric = 4, NSDragOperationPrivate = 8, NSDragOperationAll = 15, NSDragOperationMove = 16, NSDragOperationDelete = 32, NSDragOperationEvery = UINT_MAX }; typedef NSUInteger NSDragOperation; @protocol NSDraggingInfo // // Dragging-session Information // - (NSWindow *)draggingDestinationWindow; - (NSPoint)draggingLocation; - (NSPasteboard *)draggingPasteboard; - (NSInteger)draggingSequenceNumber; - (id)draggingSource; - (NSDragOperation)draggingSourceOperationMask; // // Image Information // - (NSImage *)draggedImage; - (NSPoint)draggedImageLocation; // // Sliding the Image // - (void)slideDraggedImageTo:(NSPoint)screenPoint; #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) - (NSArray *)namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination; #endif @end @interface NSObject (NSDraggingDestination) // // Before the Image is Released // - (NSDragOperation)draggingEntered:(id )sender; - (NSDragOperation)draggingUpdated:(id )sender; - (void)draggingExited:(id )sender; // // After the Image is Released // - (BOOL)prepareForDragOperation:(id )sender; - (BOOL)performDragOperation:(id )sender; - (void)concludeDragOperation:(id )sender; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void)draggingEnded: (id )sender; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (BOOL)wantsPeriodicDraggingUpdates; #endif @end @interface NSObject (NSDraggingSource) // // Querying the Source // - (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal; - (BOOL)ignoreModifierKeysWhileDragging; // // Informing the Source // - (void)draggedImage:(NSImage *)image beganAt:(NSPoint)screenPoint; - (void)draggedImage: (NSImage*)image endedAt: (NSPoint)screenPoint deposited: (BOOL)didDeposit; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void)draggedImage: (NSImage*)image endedAt: (NSPoint)screenPoint operation: (NSDragOperation)operation; - (void)draggedImage: (NSImage*)image movedTo: (NSPoint)screenPoint; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) - (NSArray *)namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination; #endif @end #endif // _GNUstep_H_NSDragging gnustep-gui-0.24.0/Headers/AppKit/NSLevelIndicator.h0000664000076500007650000000371411673147131022034 0ustar brains99brains99/* -*-objc-*- NSLevelIndicator.h The level indicator class Copyright (C) 2007 Free Software Foundation, Inc. Author: H. Nikolaus Schaller Date: 2006 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSLevelIndicator #define _GNUstep_H_NSLevelIndicator #import "AppKit/NSControl.h" // For the tick mark #import "AppKit/NSLevelIndicatorCell.h" #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) @interface NSLevelIndicator : NSControl { } - (double) maxValue; - (void) setMaxValue: (double)val; - (double) minValue; - (void) setMinValue: (double)val; - (double) warningValue; - (void) setWarningValue: (double)val; - (double) criticalValue; - (void) setCriticalValue: (double) val; - (NSInteger) numberOfMajorTickMarks; - (NSInteger) numberOfTickMarks; - (NSRect) rectOfTickMarkAtIndex: (NSInteger)index; - (void) setNumberOfMajorTickMarks: (NSInteger)count; - (void) setNumberOfTickMarks: (NSInteger)count; - (void) setTickMarkPosition: (NSTickMarkPosition)pos; - (NSTickMarkPosition) tickMarkPosition; - (double) tickMarkValueAtIndex: (NSInteger)index; @end #endif /* MAC_OS_X_VERSION_10_4 */ #endif /* _GNUstep_H_NSLevelIndicator */ gnustep-gui-0.24.0/Headers/AppKit/NSScreen.h0000664000076500007650000000413111354602172020336 0ustar brains99brains99/* NSScreen.h Class representing monitors Copyright (C) 1996, 2000 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Fixes and updates made by Author: Gregory John Casamento Date: 2000 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSScreen #define _GNUstep_H_NSScreen #import #import #import @class NSArray; @class NSDictionary; @interface NSScreen : NSObject { @private NSWindowDepth _depth; NSRect _frame; int _screenNumber; NSWindowDepth *_supportedWindowDepths; void *_reserved; } /* * Creating NSScreen Instances */ + (NSScreen*) mainScreen; + (NSScreen*) deepestScreen; + (NSArray*) screens; + (void) resetScreens; /* * Reading Screen Information */ - (NSWindowDepth) depth; - (NSRect) frame; - (NSDictionary*) deviceDescription; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (const NSWindowDepth*) supportedWindowDepths; - (NSRect) visibleFrame; #endif #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) - (int) screenNumber; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (float) userSpaceScaleFactor; #endif @end #endif // _GNUstep_H_NSScreen gnustep-gui-0.24.0/Headers/AppKit/NSLayoutManager.h0000664000076500007650000002171012107776031021674 0ustar brains99brains99/* NSLayoutManager.h Copyright (C) 2002 Free Software Foundation, Inc. Author: Alexander Malmberg Date: 2002-11 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSLayoutManager #define _GNUstep_H_NSLayoutManager #import #import #import #import @class NSParagraphStyle; /* GNUstep extension. */ typedef enum { GSInsertionPointMoveLeft, GSInsertionPointMoveRight, GSInsertionPointMoveDown, GSInsertionPointMoveUp, } GSInsertionPointMovementDirection; @interface NSLayoutManager : GSLayoutManager { /* Public for use only in the associated NSTextViews. Don't access them directly from elsewhere. */ @public /* Ivars to synchronize multiple textviews */ BOOL _isSynchronizingFlags; BOOL _isSynchronizingDelegates; BOOL _beganEditing; /* Selection */ NSRange _selected_range; NSRange _original_selected_range; NSSelectionGranularity _selectionGranularity; NSSelectionAffinity _selectionAffinity; /* Retained by the NSLayoutManager. NSTextView:s that change this value should release the old value and retain the new one. It is nil originally and will be released when the NSLayoutManager is deallocated. */ NSMutableDictionary *_typingAttributes; NSMutableAttributedString *_temporaryAttributes; } /* TODO */ -(void) invalidateDisplayForGlyphRange: (NSRange)aRange; -(void) invalidateDisplayForCharacterRange: (NSRange)aRange; /* not STRICT_40 ?? */ - (NSTextView *) firstTextView; - (NSTextView *) textViewForBeginningOfSelection; - (BOOL) layoutManagerOwnsFirstResponderInWindow: (NSWindow *)window; -(NSArray *) rulerMarkersForTextView: (NSTextView *)textView paragraphStyle: (NSParagraphStyle *)paragraphStyle ruler: (NSRulerView *)aRulerView; -(NSView *) rulerAccessoryViewForTextView: (NSTextView *)textView paragraphStyle: (NSParagraphStyle *)style ruler: (NSRulerView *)ruler enabled: (BOOL)isEnabled; -(float) hyphenationFactor; -(void) setHyphenationFactor: (float)factor; @end @interface NSLayoutManager (layout) - (void) textContainerChangedTextView: (NSTextContainer *)aContainer; - (NSPoint) locationForGlyphAtIndex: (NSUInteger)glyphIndex; - (NSRect *) rectArrayForGlyphRange: (NSRange)glyphRange withinSelectedGlyphRange: (NSRange)selGlyphRange inTextContainer: (NSTextContainer *)container rectCount: (NSUInteger *)rectCount; - (NSRect *) rectArrayForCharacterRange: (NSRange)charRange withinSelectedCharacterRange: (NSRange)selCharRange inTextContainer: (NSTextContainer *)container rectCount: (NSUInteger *)rectCount; - (NSRect) boundingRectForGlyphRange: (NSRange)glyphRange inTextContainer: (NSTextContainer *)aTextContainer; - (NSRange) glyphRangeForBoundingRect: (NSRect)bounds inTextContainer: (NSTextContainer *)container; - (NSRange) glyphRangeForBoundingRectWithoutAdditionalLayout: (NSRect)bounds inTextContainer: (NSTextContainer *)container; - (unsigned int) glyphIndexForPoint: (NSPoint)aPoint inTextContainer: (NSTextContainer *)aTextContainer; - (NSUInteger) glyphIndexForPoint: (NSPoint)point inTextContainer: (NSTextContainer *)container fractionOfDistanceThroughGlyph: (CGFloat *)partialFraction; /* Returns a rectangle suitable for drawing an insertion point in if the insertion point is placed before the given character. The character index may be any character in the text (it will handle positions "inside" a ligature), and (unlike other methods) it may be one past the end of the text (ie. cindex==[[_textStorage string] length]). If the character isn't in the text container, returns NSZeroRect. GNUstep extension. */ -(NSRect) insertionPointRectForCharacterIndex: (unsigned int)cindex inTextContainer: (NSTextContainer *)textContainer; /* Insertion point movement primitive. 'from' is the character index moved from, and 'original' is the character index originally moved from in this sequence of moves (ie. if the user hits the down key several times, the first call would have original==from, and subsequent calls would use the same 'original' and the 'from' returned from the last call). The returned character index will always be different from 'from' unless 'from' is the "furthest" character index in the text container in the specified direction. The distance is the target distance for the move (in the text container's coordinate system). The move won't be farther than this distance unless it's impossible to move a shorter distance. Distance 0.0 is treated specially: the move will be the shortest possible move, and movement will "make sense" even if the glyph/character mapping is complex at 'from' (eg. it will move through ligatures in a sensible way). Note that this method does not work across text containers. 'original' and 'from' should be in the same container, and the returned index will also be in that container. GNUstep extension. */ -(unsigned int) characterIndexMoving: (GSInsertionPointMovementDirection)direction fromCharacterIndex: (unsigned int)from originalCharacterIndex: (unsigned int)original distance: (float)distance; #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (void) ensureGlyphsForGlyphRange: (NSRange)glyphRange; - (void) ensureGlyphsForCharacterRange: (NSRange)charRange; - (void) ensureLayoutForGlyphRange: (NSRange)glyphRange; - (void) ensureLayoutForCharacterRange: (NSRange)charRange; - (void) ensureLayoutForTextContainer: (NSTextContainer*)container; - (void) ensureLayoutForBoundingRect: (NSRect)bounds inTextContainer: (NSTextContainer*)container; - (void) invalidateLayoutForCharacterRange: (NSRange)charRange actualCharacterRange: (NSRangePointer)actualCharRange; - (void) invalidateGlyphsOnLayoutInvalidationForGlyphRange: (NSRange)glyphRange; - (BOOL) allowsNonContiguousLayout; - (void) setAllowsNonContiguousLayout: (BOOL)flag; - (BOOL) hasNonContiguousLayout; #endif @end @interface NSLayoutManager (drawing) -(void) drawBackgroundForGlyphRange: (NSRange)range atPoint: (NSPoint)containerOrigin; -(void) drawGlyphsForGlyphRange: (NSRange)range atPoint: (NSPoint)containerOrigin; -(void) underlineGylphRange: (NSRange)range underlineType: (NSInteger)type lineFragmentRect: (NSRect)fragmentRect lineFragmentGlyphRange: (NSRange)fragmentGlyphRange containerOrigin: (NSPoint)containerOrigin; -(void) drawUnderlineForGlyphRange: (NSRange)underlineRange underlineType: (NSInteger)type baselineOffset: (CGFloat)offset lineFragmentRect: (NSRect)fragmentRect lineFragmentGlyphRange: (NSRange)fragmentGlyphRange containerOrigin: (NSPoint)containerOrigin; - (NSSize) attachmentSizeForGlyphAtIndex: (NSUInteger)glyphIndex; - (void) showAttachmentCell: (NSCell *)cell inRect: (NSRect)rect characterIndex: (NSUInteger)attachmentIndex; @end @interface NSLayoutManager (temporaryattributes) - (void) addTemporaryAttributes: (NSDictionary *)attrs forCharacterRange: (NSRange)range; - (void) removeTemporaryAttribute: (NSString *)attr forCharacterRange: (NSRange)range; - (void) setTemporaryAttributes: (NSDictionary *)attrs forCharacterRange: (NSRange)range; - (NSDictionary *) temporaryAttributesAtCharacterIndex: (NSUInteger)index effectiveRange: (NSRange*)range; #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (void) addTemporaryAttribute: (NSString *)attr value: (id)value forCharacterRange: (NSRange)range; - (id) temporaryAttribute: (NSString *)attr atCharacterIndex: (NSUInteger)index effectiveRange: (NSRange*)range; - (id) temporaryAttribute: (NSString *)attr atCharacterIndex: (NSUInteger)index longestEffectiveRange: (NSRange*)longestRange inRange: (NSRange)range; - (NSDictionary *) temporaryAttributesAtCharacterIndex: (NSUInteger)index longestEffectiveRange: (NSRange*)longestRange inRange: (NSRange)range; #endif @end #endif gnustep-gui-0.24.0/Headers/AppKit/NSUserInterfaceValidation.h0000664000076500007650000000260411354736316023704 0ustar brains99brains99/* NSUserInterfaceValidation.h Protocols for interface item validation Copyright (C) 2001 Free Software Foundation, Inc. Author: Fred Kiefer Date: 2001 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSUserInterfaceValidation #define _GNUstep_H_NSUserInterfaceValidation #import @protocol NSValidatedUserInterfaceItem - (SEL)action; - (NSInteger)tag; @end @protocol NSUserInterfaceValidations - (BOOL)validateUserInterfaceItem:(id )anItem; @end #endif // _GNUstep_H_NSUserInterfaceValidation gnustep-gui-0.24.0/Headers/AppKit/NSPopover.h0000664000076500007650000000672312135722444020565 0ustar brains99brains99/* NSPopover.h The popover class Copyright (C) 2013 Free Software Foundation, Inc. Author: Gregory Casamento Date: 2013 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSPopover #define _GNUstep_H_NSPopover #import #import #import /* Keys */ APPKIT_EXPORT NSString *NSPopoverCloseReasonKey; APPKIT_EXPORT NSString *NSPopoverCloseReasonStandard; APPKIT_EXPORT NSString *NSPopoverCloseReasonDetachToWindow; /* Notifications */ APPKIT_EXPORT NSString *NSPopoverWillShowNotification; APPKIT_EXPORT NSString *NSPopoverDidShowNotification; APPKIT_EXPORT NSString *NSPopoverWillCloseNotification; APPKIT_EXPORT NSString *NSPopoverDidCloseNotification; /* Constants and enums */ enum { NSPopoverAppearanceMinimal = 0, NSPopoverAppearanceHUD = 1 }; typedef NSInteger NSPopoverAppearance; enum { NSPopoverBehaviorApplicationDefined = 0, NSPopoverBehaviorTransient = 1, NSPopoverBehaviorSemitransient = 2 }; typedef NSInteger NSPopoverBehavior; /* Forward declarations */ @class NSViewController, NSWindow, NSView, NSNotification; @protocol NSPopoverDelegate; /* Class */ @interface NSPopover : NSResponder { BOOL _animates; NSPopoverAppearance _appearance; NSPopoverBehavior _behavior; NSSize _contentSize; IBOutlet NSViewController *_contentViewController; id _delegate; NSRect _positioningRect; BOOL _shown; NSWindow *_realWindow; } /* Properties */ - (void)setAnimates:(BOOL)flag; - (BOOL)animates; - (void)setAppearance: (NSPopoverAppearance)value; - (NSPopoverAppearance)appearance; - (void)setBehavior:(NSPopoverBehavior)value; - (NSPopoverBehavior)behavior; - (void)setContentSize:(NSSize)value; - (NSSize)contentSize; - (void)setContentViewController:(NSViewController *)controller; - (NSViewController *)contentViewController; - (void)setDelegate:(id)value; - (id)delegate; - (void)setPositioningRect:(NSRect)value; - (NSRect)positioningRect; - (BOOL)isShown; /* Methods */ - (void)close; - (IBAction)performClose:(id)sender; - (void)showRelativeToRect:(NSRect)positioningRect ofView:(NSView *)positioningView preferredEdge:(NSRectEdge)preferredEdge; @end /* Delegate */ @protocol NSPopoverDelegate #ifdef __OBJC2__ @optional #else @end @interface NSObject (NSPopoverDelegate) #endif - (NSWindow *)detachableWindowForPopover:(NSPopover *)popover; - (void)popoverDidClose:(NSNotification *)notification; - (void)popoverDidShow:(NSNotification *)notification; - (BOOL)popoverShouldClose:(NSPopover *)popover; - (void)popoverWillClose:(NSNotification *)notification; - (void)popoverWillShow:(NSNotification *)notification; @end #endif gnustep-gui-0.24.0/Headers/AppKit/NSTabViewItem.h0000664000076500007650000000455612036333132021305 0ustar brains99brains99/* NSTabViewItem.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Michael Hanni Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSTabViewItem #define _GNUstep_H_NSTabViewItem #import #import typedef enum { NSSelectedTab = 0, NSBackgroundTab, NSPressedTab } NSTabState; @class NSString; @class NSColor; @class NSTabView; @class NSView; @interface NSTabViewItem : NSObject { id _ident; NSString *_label; NSView *_view; NSColor *_color; NSTabState _state; NSView *_first_responder; NSTabView *_tabview; NSRect _rect; // cached NSString *_toolTip; } - (id) initWithIdentifier:(id)identifier; - (void)setIdentifier:(id)identifier; - (id)identifier; - (void)setLabel:(NSString *)label; - (NSString *)label; - (NSSize)sizeOfLabel:(BOOL)shouldTruncateLabel; - (void)setView:(NSView *)view; - (NSView *)view; - (void)setColor:(NSColor *)color; - (NSColor *)color; - (NSTabState)tabState; - (NSTabView *)tabView; - (void)setInitialFirstResponder:(NSView *)view; - (id)initialFirstResponder; - (void)drawLabel:(BOOL)shouldTruncateLabel inRect:(NSRect)tabRect; #if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) - (NSString *)toolTip; - (void)setToolTip:(NSString *)newToolTip; #endif @end @interface NSTabViewItem (GNUstep) // Non-spec - (void)_setTabState:(NSTabState)tabState; - (void)_setTabView:(NSTabView *)tabView; - (NSRect) _tabRect; - (NSString*)_truncatedLabel; @end #endif // _GNUstep_H_NSTabViewItem gnustep-gui-0.24.0/Headers/AppKit/NSTextTable.h0000664000076500007650000001414312110256537021020 0ustar brains99brains99/* -*-objc-*- NSTextTable.h Copyright (C) 2008 Free Software Foundation, Inc. Author: Fred Kiefer Date: January 2008 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSTextTable #define _GNUstep_H_NSTextTable #import #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) #import #import @class NSColor; @class NSTextContainer; @class NSView; @class NSLayoutManager; @class NSTextTableBlock; typedef enum _NSTextBlockValueType { NSTextBlockAbsoluteValueType, NSTextBlockPercentageValueType } NSTextBlockValueType; typedef enum _NSTextBlockDimension { NSTextBlockWidth, NSTextBlockMinimumWidth, NSTextBlockMaximumWidth, NSTextBlockHeight, NSTextBlockMinimumHeight, NSTextBlockMaximumHeight } NSTextBlockDimension; typedef enum _NSTextBlockLayer { NSTextBlockPadding, NSTextBlockBorder, NSTextBlockMargin } NSTextBlockLayer; typedef enum _NSTextBlockVerticalAlignment { NSTextBlockTopAlignment, NSTextBlockMiddleAlignment, NSTextBlockBottomAlignment, NSTextBlockBaselineAlignment } NSTextBlockVerticalAlignment; @interface NSTextBlock : NSObject { NSColor *_backgroundColor; NSColor *_borderColorForEdge[NSMaxYEdge + 1]; NSTextBlockVerticalAlignment _verticalAlignment; // The following ivars come in pairs CGFloat _value[NSTextBlockMaximumHeight + 1]; NSTextBlockValueType _valueType[NSTextBlockMaximumHeight + 1]; CGFloat _width[NSTextBlockMargin + 1][NSMaxYEdge + 1]; NSTextBlockValueType _widthType[NSTextBlockMargin + 1][NSMaxYEdge + 1]; } - (NSColor *) backgroundColor; - (NSColor *) borderColorForEdge: (NSRectEdge)edge; - (NSRect) boundsRectForContentRect: (NSRect)cont inRect: (NSRect)rect textContainer: (NSTextContainer *)container characterRange: (NSRange)range; - (CGFloat) contentWidth; - (NSTextBlockValueType) contentWidthValueType; - (void) drawBackgroundWithFrame: (NSRect)rect inView: (NSView *)view characterRange: (NSRange)range layoutManager: (NSLayoutManager *)lm; - (id) init; - (NSRect) rectForLayoutAtPoint: (NSPoint)point inRect: (NSRect)rect textContainer: (NSTextContainer *)cont characterRange: (NSRange)range; - (void) setBackgroundColor: (NSColor *)color; - (void) setBorderColor: (NSColor *)color; - (void) setBorderColor: (NSColor *)color forEdge: (NSRectEdge)edge; - (void) setContentWidth: (CGFloat)val type: (NSTextBlockValueType)type; - (void) setValue: (CGFloat)val type: (NSTextBlockValueType)type forDimension: (NSTextBlockDimension)dimension; - (void) setVerticalAlignment: (NSTextBlockVerticalAlignment)alignment; - (void) setWidth: (CGFloat)val type: (NSTextBlockValueType)type forLayer: (NSTextBlockLayer)layer; - (void) setWidth: (CGFloat)val type: (NSTextBlockValueType)type forLayer: (NSTextBlockLayer)layer edge: (NSRectEdge)edge; - (CGFloat) valueForDimension: (NSTextBlockDimension)dimension; - (NSTextBlockValueType) valueTypeForDimension: (NSTextBlockDimension)dimension; - (NSTextBlockVerticalAlignment) verticalAlignment; - (CGFloat) widthForLayer: (NSTextBlockLayer)layer edge: (NSRectEdge)edge; - (NSTextBlockValueType) widthValueTypeForLayer: (NSTextBlockLayer)layer edge: (NSRectEdge)edge; @end typedef enum _NSTextTableLayoutAlgorithm { NSTextTableAutomaticLayoutAlgorithm, NSTextTableFixedLayoutAlgorithm } NSTextTableLayoutAlgorithm; @interface NSTextTable : NSTextBlock { NSTextTableLayoutAlgorithm _layoutAlgorithm; NSUInteger _numberOfColumns; BOOL _collapsesBorders; BOOL _hidesEmptyCells; } - (NSRect) boundsRectForBlock: (NSTextTableBlock *)block contentRect: (NSRect)content inRect: (NSRect)rect textContainer: (NSTextContainer *)container characterRange: (NSRange)range; - (BOOL) collapsesBorders; - (void) drawBackgroundForBlock: (NSTextTableBlock *)block withFrame: (NSRect)frame inView: (NSView *)controlView characterRange: (NSRange)range layoutManager: (NSLayoutManager *)manager; - (BOOL) hidesEmptyCells; - (NSTextTableLayoutAlgorithm) layoutAlgorithm; - (NSUInteger) numberOfColumns; - (NSRect) rectForBlock: (NSTextTableBlock *)block layoutAtPoint: (NSPoint)start inRect: (NSRect)rect textContainer: (NSTextContainer *)container characterRange: (NSRange)range; - (void) setCollapsesBorders: (BOOL)flag; - (void) setHidesEmptyCells: (BOOL)flag; - (void) setLayoutAlgorithm: (NSTextTableLayoutAlgorithm)algorithm; - (void) setNumberOfColumns: (NSUInteger)numCols; @end @interface NSTextTableBlock : NSTextBlock { NSTextTable *_table; int _row; int _rowSpan; int _col; int _colSpan; } - (id) initWithTable: (NSTextTable *)table startingRow: (int)row rowSpan: (int)rspan startingColumn: (int)col columnSpan: (int)cspan; - (int) columnSpan; - (int) rowSpan; - (int) startingColumn; - (int) startingRow; - (NSTextTable *) table; @end #endif #endif // _GNUstep_H_NSTextTable gnustep-gui-0.24.0/Headers/AppKit/NSFont.h0000664000076500007650000002143212076562165020041 0ustar brains99brains99/* NSFont.h The font class Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Author: Ovidiu Predescu Date: 1996, 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSFont #define _GNUstep_H_NSFont #import #import #import #import // For NSControlSize #import @class NSAffineTransform; @class NSCharacterSet; @class NSDictionary; @class NSFontDescriptor; @class NSGraphicsContext; typedef unsigned int NSGlyph; enum { NSControlGlyph = 0x00ffffff, GSAttachmentGlyph = 0x00fffffe, NSNullGlyph = 0x0 }; typedef enum _NSGlyphRelation { NSGlyphBelow, NSGlyphAbove, } NSGlyphRelation; typedef enum _NSMultibyteGlyphPacking { NSOneByteGlyphPacking, NSJapaneseEUCGlyphPacking, NSAsciiWithDoubleByteEUCGlyphPacking, NSTwoByteGlyphPacking, NSFourByteGlyphPacking } NSMultibyteGlyphPacking; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) typedef enum _NSFontRenderingMode { NSFontDefaultRenderingMode = 0, NSFontAntialiasedRenderingMode, NSFontIntegerAdvancementsRenderingMode, NSFontAntialiasedIntegerAdvancementsRenderingMode } NSFontRenderingMode; #endif APPKIT_EXPORT const CGFloat *NSFontIdentityMatrix; @interface NSFont : NSObject { NSString *fontName; CGFloat matrix[6]; BOOL matrixExplicitlySet; // unused BOOL screenFont; id fontInfo; void *_fontRef; /* If this font was created with a specific "role", like user font, or message font, and not a specific postscript name, the role will be stored here. */ int role; /* For printer fonts, this is a cache of the corresponding screen font. It is initialized to placeHolder, and is created for real on demand in -screenFont (and retained). For screen fonts, it's nil. */ NSFont *cachedScreenFont; /* In the GNUstep implementation, fonts may encapsulate some rendering state relating to view flipped state, therefore we generate a separate font for this case. We don't create it by default, unless -set is called in a flipped context. */ NSFont *cachedFlippedFont; } // // Creating a Font Object // + (NSFont*) boldSystemFontOfSize: (CGFloat)fontSize; + (NSFont*) fontWithName: (NSString*)aFontName matrix: (const CGFloat*)fontMatrix; + (NSFont*) fontWithName: (NSString*)aFontName size: (CGFloat)fontSize; + (NSFont*) systemFontOfSize: (CGFloat)fontSize; + (NSFont*) userFixedPitchFontOfSize: (CGFloat)fontSize; + (NSFont*) userFontOfSize: (CGFloat)fontSize; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) + (NSFont*) titleBarFontOfSize: (CGFloat)fontSize; + (NSFont*) menuFontOfSize: (CGFloat)fontSize; + (NSFont*) messageFontOfSize: (CGFloat)fontSize; + (NSFont*) paletteFontOfSize: (CGFloat)fontSize; + (NSFont*) toolTipsFontOfSize: (CGFloat)fontSize; + (NSFont*) controlContentFontOfSize: (CGFloat)fontSize; + (NSFont*) labelFontOfSize: (CGFloat)fontSize; + (NSFont*) menuBarFontOfSize: (CGFloat)fontSize; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) + (NSFont*) fontWithDescriptor: (NSFontDescriptor*)descriptor size: (CGFloat)size; + (NSFont*) fontWithDescriptor: (NSFontDescriptor*)descriptor textTransform: (NSAffineTransform*)transform; // This method was a mistake in the 10.4 documentation + (NSFont*) fontWithDescriptor: (NSFontDescriptor*)descriptor size: (CGFloat)size textTransform: (NSAffineTransform*)transform; #endif // // Font Sizes // #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) + (CGFloat) labelFontSize; + (CGFloat) smallSystemFontSize; + (CGFloat) systemFontSize; + (CGFloat) systemFontSizeForControlSize: (NSControlSize)controlSize; #endif // // Preferred Fonts // + (NSArray*) preferredFontNames; + (void) setPreferredFontNames: (NSArray*)fontNames; // // Setting the Font // + (void) setUserFixedPitchFont: (NSFont*)aFont; + (void) setUserFont: (NSFont*)aFont; + (void) useFont: (NSString*)aFontName; - (void) set; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (void) setInContext: (NSGraphicsContext*)context; - (NSAffineTransform*) textTransform; #endif // // Querying the Font // - (NSDictionary*) afmDictionary; - (NSString*) afmFileContents; - (NSRect) boundingRectForFont; - (NSString*) displayName; - (NSString*) familyName; - (NSString*) fontName; - (NSString*) encodingScheme; - (BOOL) isFixedPitch; - (BOOL) isBaseFont; - (const CGFloat*) matrix; - (CGFloat) pointSize; - (NSFont*) printerFont; - (NSFont*) screenFont; - (CGFloat) ascender; - (CGFloat) descender; - (CGFloat) capHeight; - (CGFloat) italicAngle; - (NSSize) maximumAdvancement; - (NSSize) minimumAdvancement; - (CGFloat) underlinePosition; - (CGFloat) underlineThickness; - (CGFloat) xHeight; - (CGFloat) widthOfString: (NSString*)string; - (CGFloat) defaultLineHeightForFont; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (CGFloat) leading; #endif #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (NSUInteger) numberOfGlyphs; - (NSCharacterSet*) coveredCharacterSet; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (NSFontDescriptor*) fontDescriptor; - (NSFontRenderingMode) renderingMode; - (NSFont*) screenFontWithRenderingMode: (NSFontRenderingMode)mode; #endif // // Manipulating Glyphs // - (NSSize) advancementForGlyph: (NSGlyph)aGlyph; - (NSRect) boundingRectForGlyph: (NSGlyph)aGlyph; - (BOOL) glyphIsEncoded: (NSGlyph)aGlyph; - (NSMultibyteGlyphPacking) glyphPacking; - (NSGlyph) glyphWithName: (NSString*)glyphName; - (NSPoint) positionOfGlyph: (NSGlyph)curGlyph precededByGlyph: (NSGlyph)prevGlyph isNominal: (BOOL*)nominal; - (NSPoint) positionOfGlyph: (NSGlyph)aGlyph forCharacter: (unichar)aChar struckOverRect: (NSRect)aRect; - (NSPoint) positionOfGlyph: (NSGlyph)aGlyph struckOverGlyph: (NSGlyph)baseGlyph metricsExist: (BOOL*)flag; - (NSPoint) positionOfGlyph: (NSGlyph)aGlyph struckOverRect: (NSRect)aRect metricsExist: (BOOL*)flag; - (NSPoint) positionOfGlyph: (NSGlyph)aGlyph withRelation: (NSGlyphRelation)relation toBaseGlyph: (NSGlyph)baseGlyph totalAdvancement: (NSSize*)offset metricsExist: (BOOL*)flag; - (int) positionsForCompositeSequence: (NSGlyph*)glyphs numberOfGlyphs: (int)numGlyphs pointArray: (NSPoint*)points; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (void) getAdvancements: (NSSizeArray)advancements forGlyphs: (const NSGlyph*)glyphs count: (NSUInteger)count; - (void) getAdvancements: (NSSizeArray)advancements forPackedGlyphs: (const void*)glyphs count: (NSUInteger)count; - (void) getBoundingRects: (NSRectArray)bounds forGlyphs: (const NSGlyph*)glyphs count: (NSUInteger)count; #endif - (NSStringEncoding) mostCompatibleStringEncoding; @end #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) @class GSFontInfo; @interface NSFont (GNUstep) - (GSFontInfo*) fontInfo; - (void *) fontRef; @end int NSConvertGlyphsToPackedGlyphs(NSGlyph*glBuf, int count, NSMultibyteGlyphPacking packing, char*packedGlyphs); #endif APPKIT_EXPORT NSString *NSAFMAscender; APPKIT_EXPORT NSString *NSAFMCapHeight; APPKIT_EXPORT NSString *NSAFMCharacterSet; APPKIT_EXPORT NSString *NSAFMDescender; APPKIT_EXPORT NSString *NSAFMEncodingScheme; APPKIT_EXPORT NSString *NSAFMFamilyName; APPKIT_EXPORT NSString *NSAFMFontName; APPKIT_EXPORT NSString *NSAFMFormatVersion; APPKIT_EXPORT NSString *NSAFMFullName; APPKIT_EXPORT NSString *NSAFMItalicAngle; APPKIT_EXPORT NSString *NSAFMMappingScheme; APPKIT_EXPORT NSString *NSAFMNotice; APPKIT_EXPORT NSString *NSAFMUnderlinePosition; APPKIT_EXPORT NSString *NSAFMUnderlineThickness; APPKIT_EXPORT NSString *NSAFMVersion; APPKIT_EXPORT NSString *NSAFMWeight; APPKIT_EXPORT NSString *NSAFMXHeight; #endif // _GNUstep_H_NSFont gnustep-gui-0.24.0/Headers/AppKit/NSHelpManager.h0000664000076500007650000000447611352752764021331 0ustar brains99brains99/* NSHelpManager.m Description... Copyright (C) 1999 Free Software Foundation, Inc. Author: Pedro Ivo Andrade Tavares Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __GNUstep_H_NSHelpManager #define __GNUstep_H_NSHelpManager #import #import #import #import @class NSAttributedString; @class NSString; @class NSMapTable; @interface NSBundle (NSHelpManager) - (NSString *)pathForHelpResource:(NSString *)fileName; - (NSAttributedString *)contextHelpForKey:(NSString *)key; @end @interface NSApplication (NSHelpManager) - (void) showHelp: (id) sender; - (void) activateContextHelpMode: (id) sender; @end @interface NSHelpManager: NSObject { @private NSMapTable* contextHelpTopics; } // // Class methods // + (NSHelpManager*)sharedHelpManager; + (BOOL)isContextHelpModeActive; + (void)setContextHelpModeActive: (BOOL) flag; // // Instance methods // - (NSAttributedString*) contextHelpForObject: (id)object; - (void) removeContextHelpForObject: (id)object; - (void)setContextHelp:(NSAttributedString *)help forObject:(id)object; - (void) setContextHelp: (NSAttributedString*) help withObject: (id) object; - (BOOL) showContextHelpForObject: (id)object locationHint: (NSPoint) point; @end // Notifications APPKIT_EXPORT NSString* NSContextHelpModeDidActivateNotification; APPKIT_EXPORT NSString* NSContextHelpModeDidDeactivateNotification; #endif // GNUstep_H_NSHelpManager gnustep-gui-0.24.0/Headers/AppKit/NSPrinter.h0000664000076500007650000001175611737560372020567 0ustar brains99brains99/* NSPrinter.h Class representing a printer's capabilities. Copyright (C) 1996, 1997, 2004 Free Software Foundation, Inc. Authors: Simon Frankau Date: June 1997 Modified for Printing Backend Support Author: Chad Hardin Date: July 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSPrinter #define _GNUstep_H_NSPrinter #import #import @class NSString; @class NSArray; @class NSDictionary; @class NSMutableDictionary; typedef enum _NSPrinterTableStatus { NSPrinterTableOK, NSPrinterTableNotFound, NSPrinterTableError } NSPrinterTableStatus; @interface NSPrinter : NSObject { NSString *_printerHost; NSString *_printerName; NSString *_printerNote; NSString *_printerType; //The way openstep handled NSPrinter was odd, it had a concept of "real" //printers and //not real printers. Printers that were not real were simply parsed PPDs, //whether the printer was actually available or not was irrevelatn. This is //is where the all the -types and +types methods come from. Apple's //adoption of CUPS forced them to change this behavior, now, their types //methods only search for the types of printers that are actually avaiable, //it has nothing to do with the PPDs that happen to be avaiable on the file //system. I think this is also the behavior we should adopt. Not simply //because it is what Apple does but because it facilitates a generic printing //backend system, especially one that will likely be using CUPS itself. //This is why the following ivar is removed and the behavior of this class //and the GSLPR Bundle has been changed. Doing this has also allowed me //to put a lot of generic code in ths class that would have otherwise had //to have been handles by each bundle. See +printerWithType: in NSPrinter.m //BOOL _isRealPrinter; NSMutableDictionary *_tables; //maps the tables, which are //NSMutableDictionaries, to their names //(such as PPD, PPDOptionTranslation, etc) } // // Finding an NSPrinter // + (NSPrinter*) printerWithName: (NSString*) name; + (NSPrinter*) printerWithType: (NSString*) type; + (NSArray*) printerNames; + (NSArray*) printerTypes; // // Printer Attributes // - (NSString*) host; - (NSString*) name; - (NSString*) note; - (NSString*) type; // // Retrieving Specific Information // - (BOOL) acceptsBinary; - (NSRect) imageRectForPaper: (NSString*) paperName; - (NSSize) pageSizeForPaper: (NSString*) paperName; - (BOOL) isColor; - (BOOL) isFontAvailable: (NSString*) fontName; - (int) languageLevel; - (BOOL) isOutputStackInReverseOrder; // // Querying the NSPrinter Tables // - (BOOL) booleanForKey: (NSString*) key inTable: (NSString*) table; - (NSDictionary*) deviceDescription; - (float) floatForKey: (NSString*) key inTable: (NSString*) table; - (int) intForKey: (NSString*) key inTable: (NSString*) table; - (NSRect) rectForKey: (NSString*) key inTable: (NSString*) table; - (NSSize) sizeForKey: (NSString*) key inTable: (NSString*) table; - (NSString*) stringForKey: (NSString*) key inTable: (NSString*) table; - (NSArray*) stringListForKey: (NSString*) key inTable: (NSString*) table; - (NSPrinterTableStatus) statusForTable: (NSString*) table; - (BOOL) isKey: (NSString*) key inTable: (NSString*) table; // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder*) aCoder; - (id)initWithCoder: (NSCoder*) aDecoder; @end // // Private methods that will be usefull for the // printing backend bundles that subclass NSPrinter // @interface NSPrinter (Private) // // Initialisation method used by backend bundles // -(id) initWithName: (NSString*) name withType: (NSString*) type withHost: (NSString*) host withNote: (NSString*) note; @end // // Have the NSPrinter parse a PPD and put it into its // tables. Used by the printing backend bundles. // @interface NSPrinter (PPDParsing) -(BOOL) parsePPDAtPath: (NSString*) ppdPath; @end #endif // _GNUstep_H_NSPrinter gnustep-gui-0.24.0/Headers/AppKit/NSArrayController.h0000664000076500007650000000750012102166206022237 0ustar brains99brains99/** NSArrayController Controller class for arrays Copyright (C) 2006 Free Software Foundation, Inc. Author: Fred Kiefer Date: June 2006 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSArrayController #define _GNUstep_H_NSArrayController #import #if OS_API_VERSION(MAC_OS_X_VERSION_10_3,GS_API_LATEST) @class NSArray; @class NSMutableArray; @class NSIndexSet; @class NSPredicate; @interface NSArrayController : NSObjectController { NSArray *_arranged_objects; NSIndexSet *_selection_indexes; NSArray *_sort_descriptors; NSPredicate *_filter_predicate; struct GSArrayControllerFlagsType { unsigned always_uses_multiple_values_marker: 1; unsigned automatically_rearranges_objects: 1; unsigned avoids_empty_selection: 1; unsigned clears_filter_predicate_on_insertion: 1; unsigned preserves_selection: 1; unsigned selects_inserted_objects: 1; } _acflags; } - (void) addObject: (id)obj; - (void) addObjects: (NSArray*)obj; - (void) removeObject: (id)obj; - (void) removeObjects: (NSArray*)obj; - (BOOL) canInsert; - (void) insert: (id)sender; - (BOOL) addSelectedObjects: (NSArray*)obj; - (BOOL) addSelectionIndexes: (NSIndexSet*)idx; - (BOOL) setSelectedObjects: (NSArray*)obj; - (BOOL) setSelectionIndex: (NSUInteger)idx; - (BOOL) setSelectionIndexes: (NSIndexSet*)idx; - (BOOL) removeSelectedObjects: (NSArray*)obj; - (BOOL) removeSelectionIndexes: (NSIndexSet*)idx; - (BOOL) canSelectNext; - (BOOL) canSelectPrevious; - (void) selectNext: (id)sender; - (void) selectPrevious: (id)sender; - (NSArray*) selectedObjects; - (NSUInteger) selectionIndex; - (NSIndexSet*) selectionIndexes; - (BOOL) avoidsEmptySelection; - (void) setAvoidsEmptySelection: (BOOL)flag; - (BOOL) preservesSelection; - (void) setPreservesSelection: (BOOL)flag; - (BOOL) selectsInsertedObjects; - (void) setSelectsInsertedObjects: (BOOL)flag; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (BOOL) alwaysUsesMultipleValuesMarker; - (void) setAlwaysUsesMultipleValuesMarker: (BOOL)flag; - (BOOL) clearsFilterPredicateOnInsertion; - (void) setClearsFilterPredicateOnInsertion: (BOOL)flag; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (BOOL) automaticallyRearrangesObjects; - (void) setAutomaticallyRearrangesObjects: (BOOL)flag; #endif - (NSArray*) arrangeObjects: (NSArray*)obj; - (id) arrangedObjects; - (void) rearrangeObjects; - (void) setSortDescriptors: (NSArray*)desc; - (NSArray*) sortDescriptors; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (void) setFilterPredicate: (NSPredicate*)filterPredicate; - (NSPredicate*) filterPredicate; #endif - (void) insertObject: (id)obj atArrangedObjectIndex: (NSUInteger)idx; - (void) insertObjects: (NSArray*)obj atArrangedObjectIndexes: (NSIndexSet*)idx; - (void) removeObjectAtArrangedObjectIndex: (NSUInteger)idx; - (void) removeObjectsAtArrangedObjectIndexes: (NSIndexSet*)idx; @end #endif // OS_API_VERSION #endif // _GNUstep_H_NSArrayController gnustep-gui-0.24.0/Headers/AppKit/NSInputManager.h0000664000076500007650000001673312107776031021527 0ustar brains99brains99/* -*-objc-*- NSInputManager.h Copyright (C) 2001, 2002 Free Software Foundation, Inc. Author: Nicola Pero Date: December 2001, February 2002 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSInputManager #define _GNUstep_H_NSInputManager #import #import #import @class NSArray; @class NSAttributedString; @class NSMutableArray; @class NSInputServer; @class NSEvent; @class NSImage; @protocol NSTextInput - (void) setMarkedText: (id)aString selectedRange: (NSRange)selRange; - (BOOL) hasMarkedText; - (NSRange) markedRange; - (NSRange) selectedRange; - (void) unmarkText; - (NSArray*) validAttributesForMarkedText; - (NSAttributedString *) attributedSubstringFromRange: (NSRange)theRange; - (NSUInteger) characterIndexForPoint: (NSPoint)thePoint; - (NSInteger) conversationIdentifier; - (void) doCommandBySelector: (SEL)aSelector; - (NSRect) firstRectForCharacterRange: (NSRange)theRange; - (void) insertText: (id)aString; @end /* The input manager understands quite sophisticated keybindings. * * A certain keystroke (represented by a unichar + some modifiers) can * be bound to a selector. For example: "Control-f" = "moveForward:"; * If you press Control-f, the selector moveForward: is invoked. * * A certain keystroke can be bound to an array of selectors. For * example: "Control-k" = ("moveToBeginningOfLine:", "deleteToEndOfLine:"); * If you press Control-k, the selector moveToBeginningOfLine: is invoked, * immediately followed by deleteToEndOfLine:. * * A certain keystroke can be bound to a dictionary of other * keybindings. For example "Control-c" = { "Control-f" = * "openFile:"; "Control-s" = "save:"; }; * If you press Control-c followed by Control-f, openFile: is invoked; * if you press Control-c followed by Control-s, save: is invoked. * * Any keystroke which is not bound by a keybinding is basically inserted * as it is by calling 'insertText:' of the caller. * * Control-g is normally bound to aborting the current keybinding * sequence. Whenever you are confused about what the hell you have * typed and what strange command the input manager is going to * understand, just type Control-g to discard past pending keystrokes, * and reset the input manager. * * Control-q is normally bound to literally quoting the next * keystroke. That is, the next keystroke is *not* interpreted by the * input manager, but rather inserted literally into the text. */ @class GSKeyBindingTable; @interface NSInputManager: NSObject { /* The current client we are working for. */ id _currentClient; /* This is the basic, root set of bindings. Whenever the input manager detects that the current client has changed, it immediately resets the current key bindings to the root ones. If you are typing and are confused about what's happening, pressing Control-g always resets the bindings to the root bindings. */ GSKeyBindingTable *_rootBindingTable; /* These are the bindings which will be used to interpret the next keystroke. At the beginning, this is the same as the _rootBindingTable. But when you type a keystroke which is the beginning of a sequence of keystrokes producing a certain action, then the input manager updates the _currentBindingTable to be the table where he looks up the next keystroke you put in. */ GSKeyBindingTable *_currentBindingTable; /* When we are reading multi-keystroke bindings, we need to remember the keystrokes we read thinking they were the beginning of a multi-keystroke binding ... just in case it turns out that they are not :-) */ NSMutableArray *_pendingKeyEvents; /* When it is YES, the next key stroke is interpreted literally rather than looked up using the _currentBindingTable. */ BOOL _interpretNextKeyStrokeLiterally; /* Extremely special keybinding which overrides any other keybinding in all contexts - abort - normally bound to Control-g. When we encounter this keystroke, we abort all pending keystrokes and reset ourselves immediately into vanilla root input state. */ unichar _abortCharacter; unsigned int _abortFlags; /* When it is YES, keystrokes containing the NSControlKeyMask as not inserted into the text. This is so that if you press Control-x, and that is bound to nothing, it doesn't get inserted as a strange character into your text. */ BOOL _insertControlKeystrokes; } + (NSInputManager *) currentInputManager; - (NSInputManager *) initWithName: (NSString *)inputServerName host: (NSString *)hostName; - (BOOL) handleMouseEvent: (NSEvent *)theMouseEvent; - (void) handleKeyboardEvents: (NSArray *)eventArray client: (id)client; - (NSString *) language; - (NSString *) localizedInputManagerName; - (void) markedTextAbandoned: (id)client; - (void) markedTextSelectionChanged: (NSRange)newSel client: (id)client; - (BOOL) wantsToDelayTextChangeNotifications; - (BOOL) wantsToHandleMouseEvents; - (BOOL) wantsToInterpretAllKeystrokes; /* GNUstep Extensions. */ /* Can be called explicitly by applications to load in application-specific keybindings for use by a specific input manager. */ - (void) loadBindingsFromFile: (NSString *)fullPath; /* Parses a key as found in a keybinding file. key is something like 'Control-f' or 'Control-Shift-LeftArrow'. Returns YES if the key could be parsed, NO if not. If the key could be parsed, character will contain the unichar, and modifiers the modifiers. */ + (BOOL) parseKey: (NSString *)key intoCharacter: (unichar *)character andModifiers: (unsigned int *)modifiers; /* This is used to produce a key description which can be put into a keybinding file from an actual keystroke. The gnustep-gui never needs this :-) since it only reads keybinding files, never writes them, but Preferences applications might need it - they can have the user type in the desired keystroke, then call this method to turn the keystroke into a string which can be put in keybindings files. Pass 0 as modifiers if you only want the name of the keystroke, ignoring modifiers. */ + (NSString *) describeKeyStroke: (unichar)character withModifiers: (unsigned int)modifiers; /* Methods used internally ... not really part of the public API, can change without notice. */ /* Reset the internal state. Normally bound to Control-g [regardless of context!], but also automatically done whenever the current client changes. */ - (void) resetInternalState; /* Quote the next key stroke. Normally bound to Control-q. */ - (void) quoteNextKeyStroke; @end #endif /* _GNUstep_H_NSInputManager */ gnustep-gui-0.24.0/Headers/AppKit/NSObjectController.h0000664000076500007650000000576011517263353022407 0ustar brains99brains99/** NSObjectController Controller class Copyright (C) 2006 Free Software Foundation, Inc. Author: Fred Kiefer Date: June 2006 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSObjectController #define _GNUstep_H_NSObjectController #import #import #import #if OS_API_VERSION(MAC_OS_X_VERSION_10_3,GS_API_LATEST) @class NSArray; @class NSMutableArray; @class NSString; @class NSPredicate; @class NSError; @class NSFetchRequest; @class NSManagedObjectContext; @interface NSObjectController : NSController { @protected Class _object_class; NSString *_object_class_name; NSString *_entity_name_key; id _managed_proxy; id _content; NSMutableArray *_selection; NSPredicate *_fetch_predicate; NSManagedObjectContext *_managed_object_context; BOOL _is_editable; BOOL _automatically_prepares_content; BOOL _is_using_managed_proxy; } - (id) initWithContent: (id)content; - (id) content; - (void) setContent: (id)content; - (Class) objectClass; - (void) setObjectClass: (Class)aClass; - (id) newObject; - (void) prepareContent; - (BOOL) automaticallyPreparesContent; - (void) setAutomaticallyPreparesContent: (BOOL)flag; - (void) add: (id)sender; - (void) addObject: (id)obj; - (void) remove: (id)sender; - (void) removeObject: (id)obj; - (BOOL) canAdd; - (BOOL) canRemove; - (BOOL) isEditable; - (void) setEditable: (BOOL)flag; - (NSArray*) selectedObjects; - (id) selection; - (BOOL) validateMenuItem: (id )item; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4,GS_API_LATEST) - (NSString*) entityNameKey; - (void) setEntityName: (NSString*)entityName; - (NSPredicate*) fetchPredicate; - (void) setFetchPredicate: (NSPredicate*)predicate; - (void) fetch: (id)sender; - (BOOL) fetchWithRequest: (NSFetchRequest*)fetchRequest merge: (BOOL)merge error: (NSError**)error; - (NSManagedObjectContext*) managedObjectContext; - (void) setManagedObjectContext: (NSManagedObjectContext*)managedObjectContext; #endif //OS_API_VERSION @end #endif // OS_API_VERSION #endif // _GNUstep_H_NSObjectController gnustep-gui-0.24.0/Headers/AppKit/NSController.h0000664000076500007650000000345711352624326021257 0ustar brains99brains99/** NSController abstract base class for controllers Copyright (C) 2006 Free Software Foundation, Inc. Author: Fred Kiefer Date: June 2006 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSController #define _GNUstep_H_NSController #import #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) @class NSMutableArray; @interface NSController : NSObject { NSMutableArray *_editors; NSMutableArray *_declared_keys; } // NSEditor protocol - (BOOL) commitEditing; - (void) discardEditing; - (BOOL) isEditing; // NSEditorRegistration protocol - (void) objectDidBeginEditing: (id)editor; - (void) objectDidEndEditing: (id)editor; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (void) commitEditingWithDelegate: (id)delegate didCommitSelector: (SEL)didCommitSelector contextInfo: (void*)contextInfo; #endif @end #endif // OS_API_VERSION #endif // _GNUstep_H_NSController gnustep-gui-0.24.0/Headers/AppKit/NSSplitView.h0000664000076500007650000001171712106010727021050 0ustar brains99brains99/* -*-objc-*- NSSplitView.h Allows multiple views to share a region in a window Copyright (C) 1996 Free Software Foundation, Inc. Author: Robert Vasvari Date: Jul 1998 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSSplitView #define _GNUstep_H_NSSplitView #import @class NSImage, NSColor, NSNotification; #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) enum { NSSplitViewDividerStyleThick = 1, NSSplitViewDividerStyleThin = 2, }; typedef NSInteger NSSplitViewDividerStyle; #endif @interface NSSplitView : NSView { id _delegate; NSImage *_dimpleImage; NSColor *_backgroundColor; NSColor *_dividerColor; NSString *_autosaveName; CGFloat _dividerWidth; CGFloat _draggedBarWidth; BOOL _isVertical; BOOL _never_displayed_before; BOOL _is_pane_splitter; } - (void) setDelegate: (id)anObject; - (id) delegate; - (void) adjustSubviews; - (void) drawDividerInRect: (NSRect)aRect; - (CGFloat) dividerThickness; /* Vertical splitview has a vertical split bar */ - (void) setVertical: (BOOL)flag; - (BOOL) isVertical; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (BOOL) isSubviewCollapsed: (NSView *)subview; - (BOOL) isPaneSplitter; - (void) setIsPaneSplitter: (BOOL)flag; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (void) setAutosaveName: (NSString *)autosaveName; - (NSString *) autosaveName; - (CGFloat) maxPossiblePositionOfDividerAtIndex: (NSInteger)dividerIndex; - (CGFloat) minPossiblePositionOfDividerAtIndex: (NSInteger)dividerIndex; - (void) setPosition: (CGFloat)position ofDividerAtIndex: (NSInteger)dividerIndex; - (NSColor *) dividerColor; - (NSSplitViewDividerStyle) dividerStyle; - (void) setDividerStyle: (NSSplitViewDividerStyle)dividerStyle; #endif @end #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) @interface NSSplitView (GNUstepExtra) /* extra methods to make it more usable */ - (CGFloat) draggedBarWidth; - (void) setDraggedBarWidth: (CGFloat)newWidth; /* if flag is yes, dividerThickness is reset to the height/width of the dimple image + 1; */ - (void) setDimpleImage: (NSImage *)anImage resetDividerThickness: (BOOL)flag; - (NSImage *) dimpleImage; - (NSColor *) backgroundColor; - (void) setBackgroundColor: (NSColor *)aColor; - (void) setDividerColor: (NSColor *)aColor; @end #endif @interface NSObject (NSSplitViewDelegate) - (void) splitView: (NSSplitView *)sender resizeSubviewsWithOldSize: (NSSize)oldSize; - (void) splitView: (NSSplitView *)sender constrainMinCoordinate: (CGFloat *)min maxCoordinate: (CGFloat *)max ofSubviewAt: (NSInteger)offset; - (CGFloat) splitView: (NSSplitView *)sender constrainSplitPosition: (CGFloat)proposedPosition ofSubviewAt: (NSInteger)offset; - (void) splitViewWillResizeSubviews: (NSNotification *)notification; - (void) splitViewDidResizeSubviews: (NSNotification *)notification; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (BOOL) splitView: (NSSplitView *)sender canCollapseSubview: (NSView *)subview; - (CGFloat) splitView: (NSSplitView *)sender constrainMaxCoordinate: (CGFloat)proposedMax ofSubviewAt: (NSInteger)offset; - (CGFloat) splitView: (NSSplitView *)sender constrainMinCoordinate: (CGFloat)proposedMin ofSubviewAt: (NSInteger)offset; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (NSRect) splitView: (NSSplitView *)splitView additionalEffectiveRectOfDividerAtIndex: (NSInteger)dividerIndex; - (NSRect) splitView: (NSSplitView *)splitView effectiveRect: (NSRect)proposedEffectiveRect forDrawnRect: (NSRect)drawnRect ofDividerAtIndex: (NSInteger)dividerIndex; - (BOOL) splitView: (NSSplitView *)splitView shouldCollapseSubview: (NSView *)subview forDoubleClickOnDividerAtIndex: (NSInteger)dividerIndex; - (BOOL) splitView: (NSSplitView *)splitView shouldHideDividerAtIndex: (NSInteger)dividerIndex; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) - (BOOL) splitView: (NSSplitView *)splitView shouldAdjustSizeOfSubview: (NSView *)view; #endif @end /* Notifications */ APPKIT_EXPORT NSString *NSSplitViewDidResizeSubviewsNotification; APPKIT_EXPORT NSString *NSSplitViewWillResizeSubviewsNotification; #endif gnustep-gui-0.24.0/Headers/AppKit/NSPrintOperation.h0000664000076500007650000001506311353745723022113 0ustar brains99brains99/** NSPrintOperation Controls generation of EPS, PDF or PS print jobs. Copyright (C) 1996,2001,2004 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Fred Kiefer Date: November 2000 Updated to new specification Author: Adam Fedor Date: Oct 2001 Modified for Printing Backend Support Author: Chad Hardin Date: June 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSPrintOperation #define _GNUstep_H_NSPrintOperation #import #import #import @class NSString; @class NSData; @class NSMutableData; @class NSView; @class NSWindow; @class NSPrintInfo; @class NSPrintPanel; @class NSGraphicsContext; typedef enum _NSPrintingPageOrder { NSDescendingPageOrder, NSSpecialPageOrder, NSAscendingPageOrder, NSUnknownPageOrder } NSPrintingPageOrder; @interface NSPrintOperation : NSObject { // Attributes NSPrintInfo *_print_info; NSView *_view; NSRect _rect; NSMutableData *_data; NSString *_path; NSGraphicsContext *_context; NSPrintPanel *_print_panel; NSView *_accessory_view; NSString *_job_style_hint; NSPrintingPageOrder _page_order; struct __Flags { unsigned int show_print_panel:1; unsigned int show_progress_panel:1; unsigned int can_spawn_separate_thread:1; unsigned int RESERVED:29; } _flags; int _currentPage; } // // Creating and Initializing an NSPrintOperation Object // + (NSPrintOperation *)EPSOperationWithView:(NSView *)aView insideRect:(NSRect)rect toData:(NSMutableData *)data; + (NSPrintOperation *)EPSOperationWithView:(NSView *)aView insideRect:(NSRect)rect toData:(NSMutableData *)data printInfo:(NSPrintInfo *)aPrintInfo; + (NSPrintOperation *)EPSOperationWithView:(NSView *)aView insideRect:(NSRect)rect toPath:(NSString *)path printInfo:(NSPrintInfo *)aPrintInfo; + (NSPrintOperation *)printOperationWithView:(NSView *)aView; + (NSPrintOperation *)printOperationWithView:(NSView *)aView printInfo:(NSPrintInfo *)aPrintInfo; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) + (NSPrintOperation *)PDFOperationWithView:(NSView *)aView insideRect:(NSRect)rect toData:(NSMutableData *)data; + (NSPrintOperation *)PDFOperationWithView:(NSView *)aView insideRect:(NSRect)rect toData:(NSMutableData *)data printInfo:(NSPrintInfo*)aPrintInfo; + (NSPrintOperation *)PDFOperationWithView:(NSView *)aView insideRect:(NSRect)rect toPath:(NSString *)path printInfo:(NSPrintInfo*)aPrintInfo; #endif - (id)initEPSOperationWithView:(NSView *)aView insideRect:(NSRect)rect toData:(NSMutableData *)data printInfo:(NSPrintInfo *)aPrintInfo; - (id)initWithView:(NSView *)aView printInfo:(NSPrintInfo *)aPrintInfo; // // Setting the Print Operation // + (NSPrintOperation *)currentOperation; + (void)setCurrentOperation:(NSPrintOperation *)operation; // // Determining the Type of Operation // - (BOOL)isEPSOperation; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (BOOL)isCopyingOperation; #endif // // Controlling the User Interface // - (NSPrintPanel *)printPanel; - (BOOL)showPanels; - (void)setPrintPanel:(NSPrintPanel *)panel; - (void)setShowPanels:(BOOL)flag; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (BOOL)showsPrintPanel; - (void)setShowsPrintPanel:(BOOL)flag; - (BOOL)showsProgressPanel; - (void)setShowsProgressPanel:(BOOL)flag; #endif #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (NSView *)accessoryView; - (void)setAccessoryView:(NSView *)aView; #endif // // Managing the DPS Context // - (NSGraphicsContext *)createContext; - (NSGraphicsContext *)context; - (void)destroyContext; // // Page Information // - (int)currentPage; - (NSPrintingPageOrder)pageOrder; - (void)setPageOrder:(NSPrintingPageOrder)order; // // Running a Print Operation // - (void)cleanUpOperation; - (BOOL)deliverResult; - (BOOL)runOperation; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void)runOperationModalForWindow:(NSWindow *)docWindow delegate:(id)delegate didRunSelector:(SEL)didRunSelector contextInfo:(void *)contextInfo; - (BOOL)canSpawnSeparateThread; - (void)setCanSpawnSeparateThread:(BOOL)flag; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) - (NSString *) jobStyleHint; - (void)setJobStyleHint:(NSString *)hint; #endif // // Getting the NSPrintInfo Object // - (NSPrintInfo *)printInfo; - (void)setPrintInfo:(NSPrintInfo *)aPrintInfo; // // Getting the NSView Object // - (NSView *)view; @end // // Private method used by the NSPrintOperation subclasses // such as GSEPSPrintOperation, GSPDFPrintOperation. This // also includes GSPrintOperation, which is used in the printing // backend system. Printing bundles subclass GSPrintOperation // and use that to interface with the native printing system. // @interface NSPrintOperation (Private) - (id) initWithView:(NSView *)aView insideRect:(NSRect)rect toData:(NSMutableData *)data printInfo:(NSPrintInfo *)aPrintInfo; @end #endif // _GNUstep_H_NSPrintOperation gnustep-gui-0.24.0/Headers/AppKit/NSMovieView.h0000664000076500007650000000563611352752764021057 0ustar brains99brains99/** NSMovieView Encapsulate a view for Quicktime movies Copyright (C) 2003 Free Software Foundation, Inc. Author: Fred Kiefer Date: March 2003 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSMovieView #define _GNUstep_H_NSMovieView #import #import @class NSMovie; typedef enum { NSQTMovieNormalPlayback, NSQTMovieLoopingPlayback, NSQTMovieLoopingBackAndForthPlayback } NSQTMovieLoopMode; @interface NSMovieView : NSView { @protected NSMovie* _movie; float _rate; float _volume; struct NSMovieViewFlags { unsigned int muted: 1; unsigned int loopMode: 3; unsigned int plays_selection_only: 1; unsigned int plays_every_frame: 1; unsigned int is_controller_visible: 1; unsigned int editable: 1; unsigned int reserved: 24; } _flags; } - (void) setMovie: (NSMovie*)movie; - (NSMovie*) movie; - (void) start: (id)sender; - (void) stop: (id)sender; - (BOOL) isPlaying; - (void) gotoPosterFrame: (id)sender; - (void) gotoBeginning: (id)sender; - (void) gotoEnd: (id)sender; - (void) stepForward: (id)sender; - (void) stepBack: (id)sender; - (void) setRate: (float)rate; - (float) rate; - (void) setVolume: (float)volume; - (float) volume; - (void) setMuted: (BOOL)mute; - (BOOL) isMuted; - (void) setLoopMode: (NSQTMovieLoopMode)mode; - (NSQTMovieLoopMode) loopMode; - (void) setPlaysSelectionOnly: (BOOL)flag; - (BOOL) playsSelectionOnly; - (void) setPlaysEveryFrame: (BOOL)flag; - (BOOL) playsEveryFrame; - (void) showController: (BOOL)show adjustingSize: (BOOL)adjustSize; - (void*) movieController; - (BOOL) isControllerVisible; - (NSRect) movieRect; - (void) resizeWithMagnification: (float)magnification; - (NSSize) sizeForMagnification: (float)magnification; - (void) setEditable: (BOOL)editable; - (BOOL) isEditable; - (void) cut: (id)sender; - (void) copy: (id)sender; - (void) paste: (id)sender; - (void) clear: (id)sender; - (void) undo: (id)sender; - (void) selectAll: (id)sender; @end #endif /* _GNUstep_H_NSMovieView */ gnustep-gui-0.24.0/Headers/AppKit/NSTrackingArea.h0000664000076500007650000000421312243757125021462 0ustar brains99brains99/* NSTrackingArea.h Create a rectangle to track mouse movements. Copyright (C) 2013 Free Software Foundation, Inc. Written by: Gregory Casamento Date: September 2013 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSTrackingArea #define _GNUstep_H_NSTrackingArea #import #import /* * Options pulled from Cocoa documentation. */ enum { NSTrackingMouseEnteredAndExited = 1, NSTrackingMouseMoved = 2, NSTrackingCursorUpdate = 4, NSTrackingActiveWhenFirstResponder = 8, NSTrackingActiveInKeyWindow = 16, NSTrackingActiveInActiveApp = 32, NSTrackingActiveAlways = 64, NSTrackingAssumeInside = 128, NSTrackingInVisibleRect = 256, NSTrackingEnabledDuringMouseDrag = 512 }; typedef NSUInteger NSTrackingAreaOptions; @class NSDictionary; @class GSTrackingRect; @interface NSTrackingArea : NSObject { NSDictionary *_userInfo; GSTrackingRect *_trackingRect; NSTrackingAreaOptions _options; } - (id)initWithRect: (NSRect)rect options: (NSTrackingAreaOptions)options owner: (id)owner userInfo: (NSDictionary *)userInfo; - (NSTrackingAreaOptions) options; - (id) owner; - (NSRect) rect; - (NSDictionary *) userInfo; @end #endif // _GNUstep_H_NSTrackingArea gnustep-gui-0.24.0/Headers/AppKit/NSTableHeaderView.h0000664000076500007650000000324712110256537022122 0ustar brains99brains99/* NSTableHeaderView.h Copyright (C) 1999 Free Software Foundation, Inc. Author: Michael Hanni Date: 1999 Author: Nicola Pero Date: December 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSTableHeaderView #define _GNUstep_H_NSTableHeaderView #import #import @class NSTableView; @interface NSTableHeaderView : NSView { NSTableView *_tableView; int _resizedColumn; } /* * Setting the table view */ - (void) setTableView: (NSTableView*)aTableView; - (NSTableView*) tableView; /* * Checking altered columns */ - (NSInteger) draggedColumn; - (CGFloat) draggedDistance; - (NSInteger) resizedColumn; /* * Utility methods */ - (NSInteger) columnAtPoint: (NSPoint)aPoint; - (NSRect) headerRectOfColumn: (NSInteger)columnIndex; @end #endif gnustep-gui-0.24.0/Headers/AppKit/NSEvent.h0000664000076500007650000003454212106650604020210 0ustar brains99brains99/* NSEvent.h The event class Copyright (C) 1996,1999 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSEvent #define _GNUstep_H_NSEvent #import #import #import // For NSTimeInterval #import @class NSString; @class NSWindow; @class NSGraphicsContext; /** * Enumeration of event types recognized within GNUstep GUI. Each type has a * corresponding mask that can be used when filtering for multiple types. For * example, the NSLeftMouseDown type has * NSLeftMouseDownMask for its mask. The special mask * NSAnyEventMask matches any event. The complete list of types * is as follows: * NSLeftMouseDown, NSLeftMouseUp, NSOtherMouseDown, NSOtherMouseUp, NSRightMouseDown, NSRightMouseUp, NSMouseMoved, NSLeftMouseDragged, NSOtherMouseDragged, NSRightMouseDragged, NSMouseEntered, NSMouseExited, NSKeyDown, NSKeyUp, NSFlagsChanged, NSAppKitDefined, // reserved NSSystemDefined, // reserved NSApplicationDefined, // available for custom use by apps NSPeriodic, NSCursorUpdate, NSScrollWheel */ enum _NSEventType { // Note - order IS significant as ranges of values // are used for testing for valid event types. NSLeftMouseDown = 1, NSLeftMouseUp, NSRightMouseDown, NSRightMouseUp, NSMouseMoved, NSLeftMouseDragged, NSRightMouseDragged, NSMouseEntered, NSMouseExited, NSKeyDown, NSKeyUp, NSFlagsChanged, NSAppKitDefined, NSSystemDefined, NSApplicationDefined, NSPeriodic, NSCursorUpdate, NSScrollWheel = 22, #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) NSTabletPoint, NSTabletProximity, #endif NSOtherMouseDown = 25, NSOtherMouseUp, NSOtherMouseDragged }; typedef NSUInteger NSEventType; enum { NSLeftMouseDownMask = (1 << NSLeftMouseDown), NSLeftMouseUpMask = (1 << NSLeftMouseUp), NSRightMouseDownMask = (1 << NSRightMouseDown), NSRightMouseUpMask = (1 << NSRightMouseUp), NSMouseMovedMask = (1 << NSMouseMoved), NSLeftMouseDraggedMask = (1 << NSLeftMouseDragged), NSRightMouseDraggedMask = (1 << NSRightMouseDragged), NSMouseEnteredMask = (1 << NSMouseEntered), NSMouseExitedMask = (1 << NSMouseExited), NSKeyDownMask = (1 << NSKeyDown), NSKeyUpMask = (1 << NSKeyUp), NSFlagsChangedMask = (1 << NSFlagsChanged), NSAppKitDefinedMask = (1 << NSAppKitDefined), NSSystemDefinedMask = (1 << NSSystemDefined), NSApplicationDefinedMask = (1 << NSApplicationDefined), NSPeriodicMask = (1 << NSPeriodic), NSCursorUpdateMask = (1 << NSCursorUpdate), NSScrollWheelMask = (1 << NSScrollWheel), #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) NSTabletPointMask = (1 << NSTabletPoint), NSTabletProximityMask = (1 << NSTabletProximity), #endif NSOtherMouseDownMask = (1 << NSOtherMouseDown), NSOtherMouseUpMask = (1 << NSOtherMouseUp), NSOtherMouseDraggedMask = (1 << NSOtherMouseDragged), NSAnyEventMask = 0xffffffffU, // key events GSKeyEventMask = (NSKeyDownMask | NSKeyUpMask | NSFlagsChangedMask), // mouse events GSMouseEventMask = (NSLeftMouseDownMask | NSLeftMouseUpMask | NSLeftMouseDraggedMask | NSRightMouseDownMask | NSRightMouseUpMask | NSRightMouseDraggedMask | NSOtherMouseDownMask | NSOtherMouseUpMask | NSOtherMouseDraggedMask | NSMouseMovedMask | NSScrollWheelMask #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) | NSTabletPointMask | NSTabletProximityMask #endif ), // mouse move events GSMouseMovedEventMask = (NSMouseMovedMask | NSScrollWheelMask | NSLeftMouseDraggedMask | NSRightMouseDraggedMask | NSOtherMouseDraggedMask), // enter/exit event GSEnterExitEventMask = (NSMouseEnteredMask | NSMouseExitedMask | NSCursorUpdateMask), // other events GSOtherEventMask = (NSAppKitDefinedMask | NSSystemDefinedMask | NSApplicationDefinedMask | NSPeriodicMask), // tracking loops may need to add NSPeriodicMask GSTrackingLoopMask = (NSLeftMouseDownMask | NSLeftMouseUpMask | NSLeftMouseDraggedMask | NSMouseMovedMask | NSRightMouseUpMask | NSOtherMouseUpMask) }; /* * Convert an NSEvent Type to it's respective Event Mask */ // FIXME: Should we use the inline trick from NSGeometry.h here? static inline NSUInteger NSEventMaskFromType(NSEventType type); static inline NSUInteger NSEventMaskFromType(NSEventType type) { return (1 << type); } enum { #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) NSDeviceIndependentModifierFlagsMask = 0xffff0000U, #endif NSAlphaShiftKeyMask = 1 << 16, NSShiftKeyMask = 2 << 16, NSControlKeyMask = 4 << 16, NSAlternateKeyMask = 8 << 16, NSCommandKeyMask = 16 << 16, NSNumericPadKeyMask = 32 << 16, NSHelpKeyMask = 64 << 16, NSFunctionKeyMask = 128 << 16 }; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) typedef enum { NSUnknownPointingDevice, NSPenPointingDevice, NSCursorPointingDevice, NSEraserPointingDevice } NSPointingDeviceType; enum { NSPenTipMask = 1, NSPenLowerSideMask = 2, NSPenUpperSideMask = 4 }; enum { NSMouseEventSubtype, NSTabletPointEventSubtype, NSTabletProximityEventSubtype }; enum { NSWindowExposedEventType = 0, NSApplicationActivatedEventType = 1, NSApplicationDeactivatedEventType = 2, NSWindowMovedEventType = 4, NSScreenChangedEventType = 8, NSAWTEventType = 16 }; enum { NSPowerOffEventType = 1 }; #endif @interface NSEvent : NSObject { NSEventType event_type; NSPoint location_point; NSUInteger modifier_flags; NSTimeInterval event_time; NSInteger window_num; NSGraphicsContext *event_context; union _MB_event_data { struct { NSInteger event_num; NSInteger click; NSInteger button; float pressure; CGFloat deltaX; CGFloat deltaY; CGFloat deltaZ; } mouse; struct { BOOL repeat; __unsafe_unretained NSString *char_keys; __unsafe_unretained NSString *unmodified_keys; unsigned short key_code; } key; struct { NSInteger event_num; NSInteger tracking_num; void *user_data; } tracking; struct { short sub_type; NSInteger data1; NSInteger data2; } misc; } event_data; } + (NSEvent*) enterExitEventWithType: (NSEventType)type location: (NSPoint)location modifierFlags: (NSUInteger)flags timestamp: (NSTimeInterval)time windowNumber: (NSInteger)windowNum context: (NSGraphicsContext*)context eventNumber: (NSInteger)eventNum trackingNumber: (NSInteger)trackingNum userData: (void *)userData; + (NSEvent*) keyEventWithType: (NSEventType)type location: (NSPoint)location modifierFlags: (NSUInteger)flags timestamp: (NSTimeInterval)time windowNumber: (NSInteger)windowNum context: (NSGraphicsContext*)context characters: (NSString *)keys charactersIgnoringModifiers: (NSString *)ukeys isARepeat: (BOOL)repeatKey keyCode: (unsigned short)code; + (NSEvent*) mouseEventWithType: (NSEventType)type location: (NSPoint)location modifierFlags: (NSUInteger)flags timestamp: (NSTimeInterval)time windowNumber: (NSInteger)windowNum context: (NSGraphicsContext*)context eventNumber: (NSInteger)eventNum clickCount: (NSInteger)clickNum pressure: (float)pressureValue; #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) + (NSEvent*) mouseEventWithType: (NSEventType)type location: (NSPoint)location modifierFlags: (NSUInteger)flags timestamp: (NSTimeInterval)time windowNumber: (NSInteger)windowNum context: (NSGraphicsContext*)context eventNumber: (NSInteger)eventNum clickCount: (NSInteger)clickNum pressure: (float)pressureValue buttonNumber: (NSInteger)buttonNum deltaX: (CGFloat)deltaX deltaY: (CGFloat)deltaY deltaZ: (CGFloat)deltaZ; #endif + (NSPoint)mouseLocation; + (NSEvent*) otherEventWithType: (NSEventType)type location: (NSPoint)location modifierFlags: (NSUInteger)flags timestamp: (NSTimeInterval)time windowNumber: (NSInteger)windowNum context: (NSGraphicsContext*)context subtype: (short)subType data1: (NSInteger)data1 data2: (NSInteger)data2; + (void) startPeriodicEventsAfterDelay: (NSTimeInterval)delaySeconds withPeriod: (NSTimeInterval)periodSeconds; + (void) stopPeriodicEvents; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (NSInteger) buttonNumber; #endif - (NSString *) characters; - (NSString *) charactersIgnoringModifiers; - (NSInteger) clickCount; - (NSGraphicsContext*) context; - (NSInteger) data1; - (NSInteger) data2; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (CGFloat)deltaX; - (CGFloat)deltaY; - (CGFloat)deltaZ; #endif - (NSInteger) eventNumber; - (BOOL) isARepeat; - (unsigned short) keyCode; - (NSPoint) locationInWindow; - (NSUInteger) modifierFlags; - (float) pressure; - (short) subtype; - (NSTimeInterval) timestamp; - (NSInteger) trackingNumber; - (NSEventType) type; - (void *) userData; - (NSWindow *) window; - (NSInteger) windowNumber; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (NSInteger) absoluteX; - (NSInteger) absoluteY; - (NSInteger) absoluteZ; - (NSUInteger) buttonMask; - (NSUInteger) capabilityMask; - (NSUInteger) deviceID; - (BOOL) isEnteringProximity; - (NSUInteger) pointingDeviceID; - (NSUInteger) pointingDeviceSerialNumber; - (NSPointingDeviceType) pointingDeviceType; - (float) rotation; - (NSUInteger) systemTabletID; - (NSUInteger) tabletID; - (float) tangentialPressure; - (NSPoint) tilt; - (unsigned long long) uniqueID; - (id) vendorDefined; - (NSUInteger) vendorID; - (NSUInteger) vendorPointingDeviceType; #endif @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 }; #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) typedef enum { GSAppKitWindowMoved = 1, GSAppKitWindowResized, GSAppKitWindowClose, GSAppKitWindowMiniaturize, GSAppKitWindowFocusIn, GSAppKitWindowFocusOut, GSAppKitWindowLeave, GSAppKitWindowEnter, GSAppKitDraggingEnter, GSAppKitDraggingUpdate, GSAppKitDraggingStatus, GSAppKitDraggingExit, GSAppKitDraggingDrop, GSAppKitDraggingFinished, GSAppKitRegionExposed, GSAppKitWindowDeminiaturize, } GSAppKitSubtype; #endif #endif /* _GNUstep_H_NSEvent */ gnustep-gui-0.24.0/Headers/AppKit/NSStepperCell.h0000664000076500007650000000332411276011274021344 0ustar brains99brains99/* NSStepperCell.h Copyright (C) 2001 Free Software Foundation, Inc. Author: Pierre-Yves Rivaille Date: 2001 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSStepperCell #define _GNUstep_H_NSStepperCell #import @interface NSStepperCell : NSActionCell { // Think of the following ones as of two BOOL ivars #define _autorepeat _cell.subclass_bool_one #define _valueWraps _cell.subclass_bool_two double _maxValue; double _minValue; double _increment; BOOL highlightUp; BOOL highlightDown; } - (double)maxValue; - (void)setMaxValue: (double)maxValue; - (double)minValue; - (void)setMinValue: (double)minValue; - (double)increment; - (void)setIncrement: (double)increment; - (BOOL)autorepeat; - (void)setAutorepeat: (BOOL)autorepeat; - (BOOL)valueWraps; - (void)setValueWraps: (BOOL)valueWraps; @end #endif // _GNUstep_H_NSStepperCell gnustep-gui-0.24.0/Headers/AppKit/NSOutlineView.h0000664000076500007650000002342512114440121021365 0ustar brains99brains99/* NSOutlineView.h The outline class. Copyright (C) 2001 Free Software Foundation, Inc. Author: Gregory John Casamento Date: October 2001 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSOutlineView #define _GNUstep_H_NSOutlineView #import #import @class NSMapTable; @class NSMutableArray; @class NSString; @class NSURL; @interface NSOutlineView : NSTableView { NSMapTable *_itemDict; NSMutableArray *_items; NSMutableArray *_expandedItems; NSMutableArray *_selectedItems; /* No longer in use */ NSMapTable *_levelOfItems; BOOL _autoResizesOutlineColumn; BOOL _indentationMarkerFollowsCell; BOOL _autosaveExpandedItems; CGFloat _indentationPerLevel; NSTableColumn *_outlineTableColumn; } // Instance methods - (BOOL) autoResizesOutlineColumn; - (BOOL) autosaveExpandedItems; - (void) collapseItem: (id)item; - (void) collapseItem: (id)item collapseChildren: (BOOL)collapseChildren; - (void) expandItem: (id)item; - (void) expandItem: (id)item expandChildren: (BOOL)expandChildren; #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (NSRect) frameOfOutlineCellAtRow: (NSInteger)row; #endif - (BOOL) indentationMarkerFollowsCell; - (CGFloat) indentationPerLevel; - (BOOL) isExpandable: (id)item; - (BOOL) isItemExpanded: (id)item; - (id) itemAtRow: (NSInteger)row; - (NSInteger) levelForItem: (id)item; - (NSInteger) levelForRow: (NSInteger)row; - (NSTableColumn *) outlineTableColumn; #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (id) parentForItem: (id)item; #endif - (void) reloadItem: (id)item; - (void) reloadItem: (id)item reloadChildren: (BOOL)reloadChildren; - (NSInteger) rowForItem: (id)item; - (void) setAutoresizesOutlineColumn: (BOOL)resize; - (void) setAutosaveExpandedItems: (BOOL)flag; - (void) setDropItem: (id)item dropChildIndex: (NSInteger)childIndex; - (void) setIndentationMarkerFollowsCell: (BOOL)followsCell; - (void) setIndentationPerLevel: (CGFloat)newIndentLevel; - (void) setOutlineTableColumn: (NSTableColumn *)outlineTableColumn; - (BOOL) shouldCollapseAutoExpandedItemsForDeposited: (BOOL)deposited; @end /* interface of NSOutlineView */ /** * Informal protocol NSOutlineViewDataSource */ @interface NSObject (NSOutlineViewDataSource) /** * Called to perform drop operation and returns YES if successful, * and NO otherwise. */ - (BOOL) outlineView: (NSOutlineView *)outlineView acceptDrop: (id )info item: (id)item childIndex: (NSInteger)index; /** * Implementation of this method is required. Returns the child at * the specified index for the given item. */ - (id) outlineView: (NSOutlineView *)outlineView child: (NSInteger)index ofItem: (id)item; /** * This is a required method. Returns whether or not the outline view * item specified is expandable or not. */ - (BOOL) outlineView: (NSOutlineView *)outlineView isItemExpandable: (id)item; /** * Returns the item for the given persistent object. */ - (id) outlineView: (NSOutlineView *)outlineView itemForPersistentObject: (id)object; /* * This is a required method. Returns the number of children of * the given item. */ - (NSInteger) outlineView: (NSOutlineView *)outlineView numberOfChildrenOfItem: (id)item; /** * This is a required method. Returns the object corresponding to the * item representing it in the outline view. */ - (id) outlineView: (NSOutlineView *)outlineView objectValueForTableColumn: (NSTableColumn *)tableColumn byItem: (id)item; /** * Returns the persistent object for the item specified. */ - (id) outlineView: (NSOutlineView *)outlineView persistentObjectForItem: (id)item; /** * Sets the object value of the given item in the given table column * to the object provided. */ - (void) outlineView: (NSOutlineView *)outlineView setObjectValue: (id)object forTableColumn: (NSTableColumn *)tableColumn byItem: (id)item; /** * Used by the Drag and Drop system. Returns the drag operation which should * be used when -outlineView:acceptDrop:item:childIndex: is called. */ - (NSDragOperation) outlineView: (NSOutlineView*)outlineView validateDrop: (id )info proposedItem: (id)item proposedChildIndex: (NSInteger)index; /** * Causes the outline view to write the specified items to the pastboard. */ - (BOOL) outlineView: (NSOutlineView *)outlineView writeItems: (NSArray*)items toPasteboard: (NSPasteboard*)pboard; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (void) outlineView: (NSOutlineView *)outlineView sortDescriptorsDidChange: (NSArray *)oldSortDescriptors; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (NSArray *) outlineView: (NSOutlineView *)outlineView namesOfPromisedFilesDroppedAtDestination: (NSURL *)dropDestination forDraggedItems: (NSArray *)items; #endif @end /* * Constants */ extern const int NSOutlineViewDropOnItemIndex; /* * Notifications */ APPKIT_EXPORT NSString *NSOutlineViewColumnDidMoveNotification; APPKIT_EXPORT NSString *NSOutlineViewColumnDidResizeNotification; APPKIT_EXPORT NSString *NSOutlineViewSelectionDidChangeNotification; APPKIT_EXPORT NSString *NSOutlineViewSelectionIsChangingNotification; APPKIT_EXPORT NSString *NSOutlineViewItemDidExpandNotification; APPKIT_EXPORT NSString *NSOutlineViewItemDidCollapseNotification; APPKIT_EXPORT NSString *NSOutlineViewItemWillExpandNotification; APPKIT_EXPORT NSString *NSOutlineViewItemWillCollapseNotification; /* * Methods Implemented by the Delegate */ @interface NSObject (NSOutlineViewDelegate) // notification methods /** * Called after the column has moved. */ - (void) outlineViewColumnDidMove: (NSNotification *)aNotification; /** * Called after the view column is resized. */ - (void) outlineViewColumnDidResize: (NSNotification *)aNotification; /** * Called after the item has collapsed. */ - (void) outlineViewItemDidCollapse: (NSNotification *)aNotification; /** * Called after the item has expanded */ - (void) outlineViewItemDidExpand: (NSNotification *)aNotification; /** * Called before the item has collapsed. */ - (void) outlineViewItemWillCollapse: (NSNotification *)aNotification; /** * Called before the item is expanded. */ - (void) outlineViewItemWillExpand: (NSNotification *)aNotification; /** * Called when the selection has changed. */ - (void) outlineViewSelectionDidChange: (NSNotification *)aNotification; /** * Called when the selection is about to change. */ - (void) outlineViewSelectionIsChanging: (NSNotification *)aNotification; // delegate methods /** * Returns whether or not the specified item should be allowed to collapse. */ - (BOOL) outlineView: (NSOutlineView *)outlineView shouldCollapseItem: (id)item; /** * Returns whether or not the given table column should be allowed to be edited. */ - (BOOL) outlineView: (NSOutlineView *)outlineView shouldEditTableColumn: (NSTableColumn *)tableColumn item: (id)item; /** * Returns whether or not the specified item should be expanded. */ - (BOOL) outlineView: (NSOutlineView *)outlineView shouldExpandItem: (id)item; /** * Returns YES or NO depending on if the given item is selectable. If YES, the item is selected, * otherwise the outline view will reject the selection. */ - (BOOL) outlineView: (NSOutlineView *)outlineView shouldSelectItem: (id)item; /** * Returns YES or NO depending on if the given table column is selectable according * to the delegate. If NO is returned the outline view will not allow the selection, if YES * it will allow the selection. */ - (BOOL) outlineView: (NSOutlineView *)outlineView shouldSelectTableColumn: (NSTableColumn *)tableColumn; /** * Called when the given cell is about to be displayed. This method is * useful for making last second modifications to what will be shown. */ - (void) outlineView: (NSOutlineView *)outlineView willDisplayCell: (id)cell forTableColumn: (NSTableColumn *)tableColumn item: (id)item; #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (NSCell *) outlineView: (NSOutlineView *)outlineView dataCellForTableColumn: (NSTableColumn *)aTableColumn item: (id)item; #endif /** * Called when the given cell in the outline column is about to be displayed. This method is * useful for making last second modifications to what will be shown. */ - (void) outlineView: (NSOutlineView *)outlineView willDisplayOutlineCell: (id)cell forTableColumn: (NSTableColumn *)tableColumn item: (id)item; /** * Called before the selection is modified. This method should return YES if * the selection is allowed and NO, if not. */ - (BOOL) selectionShouldChangeInOutlineView: (NSOutlineView *)outlineView; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (void) outlineView: (NSOutlineView *)outlineView didClickTableColumn: (NSTableColumn *)aTableColumn; #endif @end #endif /* _GNUstep_H_NSOutlineView */ gnustep-gui-0.24.0/Headers/AppKit/PSOperators.h0000664000076500007650000004255712104255431021111 0ustar brains99brains99/* PSOperators.h - Drawing engine operators that use default context Copyright (C) 1999 Free Software Foundation, Inc. Written by: Richard Frith-Macdonald Based on code by Adam Fedor Date: Feb 1999 This file is part of the GNU Objective C User Interface library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _PSOperators_h_INCLUDE #define _PSOperators_h_INCLUDE #import #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) #define DEFCTXT GSCurrentContext() #else #define DEFCTXT [NSGraphicsContext currentContext] #endif /* ----------------------------------------------------------------------- */ /* Color operations */ /* ----------------------------------------------------------------------- */ static inline void PScurrentalpha(CGFloat* a) __attribute__((unused)); static inline void PScurrentcmykcolor(CGFloat* c, CGFloat* m, CGFloat* y, CGFloat* k) __attribute__((unused)); static inline void PScurrentgray(CGFloat* gray) __attribute__((unused)); static inline void PScurrenthsbcolor(CGFloat* h, CGFloat* s, CGFloat* b) __attribute__((unused)); static inline void PScurrentrgbcolor(CGFloat* r, CGFloat* g, CGFloat* b) __attribute__((unused)); static inline void PSsetalpha(CGFloat a) __attribute__((unused)); static inline void PSsetcmykcolor(CGFloat c, CGFloat m, CGFloat y, CGFloat k) __attribute__((unused)); static inline void PSsetgray(CGFloat gray) __attribute__((unused)); static inline void PSsethsbcolor(CGFloat h, CGFloat s, CGFloat b) __attribute__((unused)); static inline void PSsetrgbcolor(CGFloat r, CGFloat g, CGFloat b) __attribute__((unused)); /* ----------------------------------------------------------------------- */ /* Text operations */ /* ----------------------------------------------------------------------- */ static inline void PSashow(CGFloat x, CGFloat y, const char* s) __attribute__((unused)); static inline void PSawidthshow(CGFloat cx, CGFloat cy, int c, CGFloat ax, CGFloat ay, const char* s) __attribute__((unused)); static inline void PScharpath(const char* s, int b) __attribute__((unused)); static inline void PSshow(const char* s) __attribute__((unused)); static inline void PSwidthshow(CGFloat x, CGFloat y, int c, const char* s) __attribute__((unused)); static inline void PSxshow(const char* s, const CGFloat* numarray, int size) __attribute__((unused)); static inline void PSxyshow(const char* s, const CGFloat* numarray, int size) __attribute__((unused)); static inline void PSyshow(const char* s, const CGFloat* numarray, int size) __attribute__((unused)); /* ----------------------------------------------------------------------- */ /* Gstate Handling */ /* ----------------------------------------------------------------------- */ static inline void PSgrestore() __attribute__((unused)); static inline void PSgsave() __attribute__((unused)); static inline void PSinitgraphics() __attribute__((unused)); static inline void PSsetgstate(NSInteger gst) __attribute__((unused)); /* ----------------------------------------------------------------------- */ /* Gstate operations */ /* ----------------------------------------------------------------------- */ static inline void PScurrentflat(CGFloat* flatness) __attribute__((unused)); static inline void PScurrentlinecap(int* linecap) __attribute__((unused)); static inline void PScurrentlinejoin(int* linejoin) __attribute__((unused)); static inline void PScurrentlinewidth(CGFloat* width) __attribute__((unused)); static inline void PScurrentmiterlimit(CGFloat* limit) __attribute__((unused)); static inline void PScurrentpoint(CGFloat* x, CGFloat* y) __attribute__((unused)); static inline void PScurrentstrokeadjust(int* b) __attribute__((unused)); static inline void PSsetdash(const CGFloat* pat, NSInteger size, CGFloat offset) __attribute__((unused)); static inline void PSsetflat(CGFloat flatness) __attribute__((unused)); static inline void PSsethalftonephase(CGFloat x, CGFloat y) __attribute__((unused)); static inline void PSsetlinecap(int linecap) __attribute__((unused)); static inline void PSsetlinejoin(int linejoin) __attribute__((unused)); static inline void PSsetlinewidth(CGFloat width) __attribute__((unused)); static inline void PSsetmiterlimit(CGFloat limit) __attribute__((unused)); static inline void PSsetstrokeadjust(int b) __attribute__((unused)); /* ----------------------------------------------------------------------- */ /* Matrix operations */ /* ----------------------------------------------------------------------- */ static inline void PSconcat(const CGFloat* m) __attribute__((unused)); static inline void PSinitmatrix() __attribute__((unused)); static inline void PSrotate(CGFloat angle) __attribute__((unused)); static inline void PSscale(CGFloat x, CGFloat y) __attribute__((unused)); static inline void PStranslate(CGFloat x, CGFloat y) __attribute__((unused)); /* ----------------------------------------------------------------------- */ /* Paint operations */ /* ----------------------------------------------------------------------- */ static inline void PSarc(CGFloat x, CGFloat y, CGFloat r, CGFloat angle1, CGFloat angle2) __attribute__((unused)); static inline void PSarcn(CGFloat x, CGFloat y, CGFloat r, CGFloat angle1, CGFloat angle2) __attribute__((unused)); static inline void PSarct(CGFloat x1, CGFloat y1, CGFloat x2, CGFloat y2, CGFloat r) __attribute__((unused)); static inline void PSclip() __attribute__((unused)); static inline void PSclosepath() __attribute__((unused)); static inline void PScurveto(CGFloat x1, CGFloat y1, CGFloat x2, CGFloat y2, CGFloat x3, CGFloat y3) __attribute__((unused)); static inline void PSeoclip() __attribute__((unused)); static inline void PSeofill() __attribute__((unused)); static inline void PSfill() __attribute__((unused)); static inline void PSflattenpath() __attribute__((unused)); static inline void PSinitclip() __attribute__((unused)); static inline void PSlineto(CGFloat x, CGFloat y) __attribute__((unused)); static inline void PSmoveto(CGFloat x, CGFloat y) __attribute__((unused)); static inline void PSnewpath() __attribute__((unused)); static inline void PSpathbbox(CGFloat* llx, CGFloat* lly, CGFloat* urx, CGFloat* ury) __attribute__((unused)); static inline void PSrcurveto(CGFloat x1, CGFloat y1, CGFloat x2, CGFloat y2, CGFloat x3, CGFloat y3) __attribute__((unused)); static inline void PSrectclip(CGFloat x, CGFloat y, CGFloat w, CGFloat h) __attribute__((unused)); static inline void PSrectfill(CGFloat x, CGFloat y, CGFloat w, CGFloat h) __attribute__((unused)); static inline void PSrectstroke(CGFloat x, CGFloat y, CGFloat w, CGFloat h) __attribute__((unused)); static inline void PSreversepath() __attribute__((unused)); static inline void PSrlineto(CGFloat x, CGFloat y) __attribute__((unused)); static inline void PSrmoveto(CGFloat x, CGFloat y) __attribute__((unused)); static inline void PSstroke() __attribute__((unused)); static inline void PSshfill(NSDictionary *shaderDictionary) __attribute__((unused)); /*-------------------------------------------------------------------------*/ /* Graphics Extensions Ops */ /*-------------------------------------------------------------------------*/ static inline void PScomposite(CGFloat x, CGFloat y, CGFloat w, CGFloat h, NSInteger gstateNum, CGFloat dx, CGFloat dy, NSCompositingOperation op) __attribute__((unused)); static inline void PScompositerect(CGFloat x, CGFloat y, CGFloat w, CGFloat h, NSCompositingOperation op) __attribute__((unused)); static inline void PSdissolve(CGFloat x, CGFloat y, CGFloat w, CGFloat h, NSInteger gstateNum, CGFloat dx, CGFloat dy, CGFloat delta) __attribute__((unused)); /* ----------------------------------------------------------------------- */ /* Postscript Client functions */ /* ----------------------------------------------------------------------- */ static inline void PSPrintf(const char * fmt, va_list args) __attribute__((unused)); static inline void PSWriteData(const char * buf, unsigned int count) __attribute__((unused)); /* ----------------------------------------------------------------------- */ /* Color operations */ /* ----------------------------------------------------------------------- */ static inline void PScurrentalpha(CGFloat* a) { DPScurrentalpha(DEFCTXT, a); } static inline void PScurrentcmykcolor(CGFloat* c, CGFloat* m, CGFloat* y, CGFloat* k) { DPScurrentcmykcolor(DEFCTXT, c, m, y, k); } static inline void PScurrentgray(CGFloat* gray) { DPScurrentgray(DEFCTXT, gray); } static inline void PScurrenthsbcolor(CGFloat* h, CGFloat* s, CGFloat* b) { DPScurrenthsbcolor(DEFCTXT, h, s, b); } static inline void PScurrentrgbcolor(CGFloat* r, CGFloat* g, CGFloat* b) { DPScurrentrgbcolor(DEFCTXT, r, g, b); } static inline void PSsetalpha(CGFloat a) { DPSsetalpha(DEFCTXT, a); } static inline void PSsetcmykcolor(CGFloat c, CGFloat m, CGFloat y, CGFloat k) { DPSsetcmykcolor(DEFCTXT, c, m, y, k); } static inline void PSsetgray(CGFloat gray) { DPSsetgray(DEFCTXT, gray); } static inline void PSsethsbcolor(CGFloat h, CGFloat s, CGFloat b) { DPSsethsbcolor(DEFCTXT, h, s, b); } static inline void PSsetrgbcolor(CGFloat r, CGFloat g, CGFloat b) { DPSsetrgbcolor(DEFCTXT, r, g, b); } static inline void PScountwindowlist(int __attribute__((unused)) d, int __attribute__((unused)) *c) { // dummy implementation for now... GJC } static inline void PSwindowlist(int __attribute__((unused)) d, int __attribute__((unused)) c, int __attribute__((unused)) *array) { // dummy implementation for now... GJC } /* ----------------------------------------------------------------------- */ /* Text operations */ /* ----------------------------------------------------------------------- */ static inline void PSashow(CGFloat x, CGFloat y, const char* s) { DPSashow(DEFCTXT, x, y, s); } static inline void PSawidthshow(CGFloat cx, CGFloat cy, int c, CGFloat ax, CGFloat ay, const char* s) { DPSawidthshow(DEFCTXT, cx, cy, c, ax, ay, s); } static inline void PScharpath(const char* s, int b) { DPScharpath(DEFCTXT, s, b); } static inline void PSshow(const char* s) { DPSshow(DEFCTXT, s); } static inline void PSwidthshow(CGFloat x, CGFloat y, int c, const char* s) { DPSwidthshow(DEFCTXT, x, y, c, s); } static inline void PSxshow(const char* s, const CGFloat* numarray, int size) { DPSxshow(DEFCTXT, s, numarray, size); } static inline void PSxyshow(const char* s, const CGFloat* numarray, int size) { DPSxyshow(DEFCTXT, s, numarray, size); } static inline void PSyshow(const char* s, const CGFloat* numarray, int size) { DPSyshow(DEFCTXT, s, numarray, size); } /* ----------------------------------------------------------------------- */ /* Gstate Handling */ /* ----------------------------------------------------------------------- */ static inline void PSgsave() { DPSgsave(DEFCTXT); } static inline void PSgrestore() { DPSgrestore(DEFCTXT); } static inline void PSinitgraphics() { DPSinitgraphics(DEFCTXT); } static inline void PSsetgstate(NSInteger gst) { DPSsetgstate(DEFCTXT, gst); } /* ----------------------------------------------------------------------- */ /* Gstate operations */ /* ----------------------------------------------------------------------- */ static inline void PScurrentflat(CGFloat* flatness) { DPScurrentflat(DEFCTXT, flatness); } static inline void PScurrentlinecap(int* linecap) { DPScurrentlinecap(DEFCTXT, linecap); } static inline void PScurrentlinejoin(int* linejoin) { DPScurrentlinejoin(DEFCTXT, linejoin); } static inline void PScurrentlinewidth(CGFloat* width) { DPScurrentlinewidth(DEFCTXT, width); } static inline void PScurrentmiterlimit(CGFloat* limit) { DPScurrentmiterlimit(DEFCTXT, limit); } static inline void PScurrentpoint(CGFloat* x, CGFloat* y) { DPScurrentpoint(DEFCTXT, x, y); } static inline void PScurrentstrokeadjust(int* b) { DPScurrentstrokeadjust(DEFCTXT, b); } static inline void PSsetdash(const CGFloat* pat, NSInteger size, CGFloat offset) { DPSsetdash(DEFCTXT, pat, size, offset); } static inline void PSsetflat(CGFloat flatness) { DPSsetflat(DEFCTXT, flatness); } static inline void PSsethalftonephase(CGFloat x, CGFloat y) { DPSsethalftonephase(DEFCTXT, x, y); } static inline void PSsetlinecap(int linecap) { DPSsetlinecap(DEFCTXT, linecap); } static inline void PSsetlinejoin(int linejoin) { DPSsetlinejoin(DEFCTXT, linejoin); } static inline void PSsetlinewidth(CGFloat width) { DPSsetlinewidth(DEFCTXT, width); } static inline void PSsetmiterlimit(CGFloat limit) { DPSsetmiterlimit(DEFCTXT, limit); } static inline void PSsetstrokeadjust(int b) { DPSsetstrokeadjust(DEFCTXT, b); } /* ----------------------------------------------------------------------- */ /* Matrix operations */ /* ----------------------------------------------------------------------- */ static inline void PSconcat(const CGFloat* m) { DPSconcat(DEFCTXT, m); } static inline void PSinitmatrix() { DPSinitmatrix(DEFCTXT); } static inline void PSrotate(CGFloat angle) { DPSrotate(DEFCTXT, angle); } static inline void PSscale(CGFloat x, CGFloat y) { DPSscale(DEFCTXT, x, y); } static inline void PStranslate(CGFloat x, CGFloat y) { DPStranslate(DEFCTXT, x, y); } /* ----------------------------------------------------------------------- */ /* Paint operations */ /* ----------------------------------------------------------------------- */ static inline void PSarc(CGFloat x, CGFloat y, CGFloat r, CGFloat angle1, CGFloat angle2) { DPSarc(DEFCTXT, x, y, r, angle1, angle2); } static inline void PSarcn(CGFloat x, CGFloat y, CGFloat r, CGFloat angle1, CGFloat angle2) { DPSarcn(DEFCTXT, x, y, r, angle1, angle2); } static inline void PSarct(CGFloat x1, CGFloat y1, CGFloat x2, CGFloat y2, CGFloat r) { DPSarct(DEFCTXT, x1, y1, x2, y2, r); } static inline void PSclip() { DPSclip(DEFCTXT); } static inline void PSclosepath() { DPSclosepath(DEFCTXT); } static inline void PScurveto(CGFloat x1, CGFloat y1, CGFloat x2, CGFloat y2, CGFloat x3, CGFloat y3) { DPScurveto(DEFCTXT, x1, y1, x2, y2, x3, y3); } static inline void PSeoclip() { DPSeoclip(DEFCTXT); } static inline void PSeofill() { DPSeofill(DEFCTXT); } static inline void PSfill() { DPSfill(DEFCTXT); } static inline void PSflattenpath() { DPSflattenpath(DEFCTXT); } static inline void PSinitclip() { DPSinitclip(DEFCTXT); } static inline void PSlineto(CGFloat x, CGFloat y) { DPSlineto(DEFCTXT, x, y); } static inline void PSmoveto(CGFloat x, CGFloat y) { DPSmoveto(DEFCTXT, x, y); } static inline void PSnewpath() { DPSnewpath(DEFCTXT); } static inline void PSpathbbox(CGFloat* llx, CGFloat* lly, CGFloat* urx, CGFloat* ury) { DPSpathbbox(DEFCTXT, llx, lly, urx, ury); } static inline void PSrcurveto(CGFloat x1, CGFloat y1, CGFloat x2, CGFloat y2, CGFloat x3, CGFloat y3) { DPSrcurveto(DEFCTXT, x1, y1, x2, y2, x3, y3); } static inline void PSrectclip(CGFloat x, CGFloat y, CGFloat w, CGFloat h) { DPSrectclip(DEFCTXT, x, y, w, h); } static inline void PSrectfill(CGFloat x, CGFloat y, CGFloat w, CGFloat h) { DPSrectfill(DEFCTXT, x, y, w, h); } static inline void PSrectstroke(CGFloat x, CGFloat y, CGFloat w, CGFloat h) { DPSrectstroke(DEFCTXT, x, y, w, h); } static inline void PSreversepath() { DPSreversepath(DEFCTXT); } static inline void PSrlineto(CGFloat x, CGFloat y) { DPSrlineto(DEFCTXT, x, y); } static inline void PSrmoveto(CGFloat x, CGFloat y) { DPSrmoveto(DEFCTXT, x, y); } static inline void PSstroke() { DPSstroke(DEFCTXT); } static inline void PSshfill(NSDictionary *shaderDictionary) { DPSshfill(DEFCTXT, shaderDictionary); } /*-------------------------------------------------------------------------*/ /* Graphics Extensions Ops */ /*-------------------------------------------------------------------------*/ static inline void PScomposite(CGFloat x, CGFloat y, CGFloat w, CGFloat h, NSInteger gstateNum, CGFloat dx, CGFloat dy, NSCompositingOperation op) { DPScomposite(DEFCTXT, x, y, w, h, gstateNum, dx, dy, op); } static inline void PScompositerect(CGFloat x, CGFloat y, CGFloat w, CGFloat h, NSCompositingOperation op) { DPScompositerect(DEFCTXT, x, y, w, h, op); } static inline void PSdissolve(CGFloat x, CGFloat y, CGFloat w, CGFloat h, NSInteger gstateNum, CGFloat dx, CGFloat dy, CGFloat delta) { DPSdissolve(DEFCTXT, x, y, w, h, gstateNum, dx, dy, delta); } /* ----------------------------------------------------------------------- */ /* Postscript Client functions */ /* ----------------------------------------------------------------------- */ static inline void PSPrintf(const char * fmt, va_list args) { DPSPrintf(DEFCTXT, fmt, args); } static inline void PSWriteData(const char * buf, unsigned int count) { DPSWriteData(DEFCTXT, buf, count); } static inline void PSWait() { // do nothing. } #endif gnustep-gui-0.24.0/Headers/AppKit/NSComboBoxCell.h0000664000076500007650000000773012110024400021416 0ustar brains99brains99/* NSComboBoxCell.h Copyright (C) 1999 Free Software Foundation, Inc. Author: Gerrit van Dyk Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSComboBoxCell #define _GNUstep_H_NSComboBoxCell #import #import #import @class NSButtonCell; @class NSMutableArray; @class NSArray; @class NSString; @interface NSComboBoxCell : NSTextFieldCell { id _dataSource; NSButtonCell *_buttonCell; NSMutableArray *_popUpList; BOOL _usesDataSource; BOOL _hasVerticalScroller; BOOL _completes; int _visibleItems; NSSize _intercellSpacing; float _itemHeight; int _selectedItem; NSRect _lastValidFrame; NSRange _prevSelectedRange; @private id _popup; } - (BOOL)hasVerticalScroller; - (void)setHasVerticalScroller:(BOOL)flag; - (NSSize)intercellSpacing; - (void)setIntercellSpacing:(NSSize)aSize; - (CGFloat)itemHeight; - (void)setItemHeight:(CGFloat)itemHeight; - (NSInteger)numberOfVisibleItems; - (void)setNumberOfVisibleItems:(NSInteger)visibleItems; - (void)reloadData; - (void)noteNumberOfItemsChanged; - (BOOL)usesDataSource; - (void)setUsesDataSource:(BOOL)flag; - (void)scrollItemAtIndexToTop:(NSInteger)index; - (void)scrollItemAtIndexToVisible:(NSInteger)index; - (void)selectItemAtIndex:(NSInteger)index; - (void)deselectItemAtIndex:(NSInteger)index; - (NSInteger)indexOfSelectedItem; - (NSInteger)numberOfItems; /* These two methods can only be used when usesDataSource is YES */ - (id)dataSource; - (void)setDataSource:(id)aSource; /* These methods can only be used when usesDataSource is NO */ - (void)addItemWithObjectValue:(id)object; - (void)addItemsWithObjectValues:(NSArray *)objects; - (void)insertItemWithObjectValue:(id)object atIndex:(NSInteger)index; - (void)removeItemWithObjectValue:(id)object; - (void)removeItemAtIndex:(NSInteger)index; - (void)removeAllItems; - (void)selectItemWithObjectValue:(id)object; - (id)itemObjectValueAtIndex:(NSInteger)index; - (id)objectValueOfSelectedItem; - (NSInteger)indexOfItemWithObjectValue:(id)object; - (NSArray *)objectValues; - (BOOL) trackMouse: (NSEvent *)theEvent inRect: (NSRect)cellFrame ofView: (NSView *)controlView untilMouseUp: (BOOL)flag; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) /* text completion */ - (NSString *)completedString:(NSString *)substring; - (void)setCompletes:(BOOL)completes; - (BOOL)completes; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (BOOL) isButtonBordered; - (void) setButtonBordered:(BOOL)flag; #endif @end @interface NSObject (NSComboBoxCellDataSource) - (NSInteger)numberOfItemsInComboBoxCell:(NSComboBoxCell *)comboBoxCell; - (id)comboBoxCell:(NSComboBoxCell *)aComboBoxCell objectValueForItemAtIndex:(NSInteger)index; - (NSUInteger)comboBoxCell:(NSComboBoxCell *)aComboBoxCell indexOfItemWithStringValue:(NSString *)string; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) /* text completion */ - (NSString *)comboBoxCell:(NSComboBoxCell *)aComboBoxCell completedString:(NSString *)uncompletedString; #endif @end #endif /* _GNUstep_H_NSComboBoxCell */ gnustep-gui-0.24.0/Headers/AppKit/NSEPSImageRep.h0000664000076500007650000000312011352512421021150 0ustar brains99brains99/* NSEPSImageRep.h EPS image representation. Copyright (C) 1996 Free Software Foundation, Inc. Written by: Adam Fedor Date: Feb 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSEPSImageRep #define _GNUstep_H_NSEPSImageRep #import #import #import @class NSData; @interface NSEPSImageRep : NSImageRep { // Attributes NSRect _bounds; NSData *_epsData; } // // Initializing a New Instance // + (id)imageRepWithData:(NSData *)epsData; - (id)initWithData:(NSData *)epsData; // // Getting Image Data // - (NSRect)boundingBox; - (NSData *)EPSRepresentation; // // Drawing the Image // - (void)prepareGState; @end #endif // _GNUstep_H_NSEPSImageRep gnustep-gui-0.24.0/Headers/AppKit/NSImage.h0000664000076500007650000002632512107547001020146 0ustar brains99brains99/* NSImage.h Load, manipulate and display images Copyright (C) 1996, 2005 Free Software Foundation, Inc. Written by: Adam Fedor Date: Feb 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSImage #define _GNUstep_H_NSImage #import #import #import #import @class NSString; @class NSMutableArray; @class NSData; @class NSURL; @class NSPasteboard; @class NSImageRep; @class NSColor; @class NSView; /** Defines how an NSImage is to be cached. Possible values are: * * NSImageCacheDefault * NSImageCacheAlways * NSImageCacheBySize * NSImageCacheNever * *

See Also:

* * -setCacheMode: * -cacheMode * */ typedef enum { NSImageCacheDefault, NSImageCacheAlways, NSImageCacheBySize, NSImageCacheNever } NSImageCacheMode; @interface NSImage : NSObject { // Attributes NSString *_name; NSString *_fileName; NSSize _size; struct __imageFlags { unsigned archiveByName: 1; unsigned scalable: 1; unsigned dataRetained: 1; unsigned flipDraw: 1; unsigned sizeWasExplicitlySet: 1; unsigned useEPSOnResolutionMismatch: 1; unsigned colorMatchPreferred: 1; unsigned multipleResolutionMatching: 1; unsigned cacheSeparately: 1; unsigned unboundedCacheDepth: 1; unsigned syncLoad: 1; } _flags; NSMutableArray *_reps; NSColor *_color; NSView *_lockedView; id _delegate; NSImageCacheMode _cacheMode; } // // Initializing a New NSImage Instance // /** Initializes and returns a NSImage from the NSString fileName. */ - (id) initByReferencingFile: (NSString*)fileName; /** Initializes and returns a new NSImage from the file * fileName. fileName should be an absolute path. *

See Also:

* * [NSImageRep+imageRepsWithContentsOfFile:] * */ - (id) initWithContentsOfFile: (NSString*)fileName; /** Initializes and returns a new NSImage from the NSData data. *

See Also:

* * [NSBitmapImageRep+imageRepWithData:] * [NSEPSImageRep+imageRepWithData:] * */ - (id) initWithData: (NSData*)data; /** Initializes and returns a new NSImage from the data in pasteboard. * The pasteboard types can be whose defined in * [NSImageRep+imagePasteboardTypes] or NSFilenamesPboardType *

See Also:

* * [NSImageRep+imageRepsWithPasteboard:] * */ - (id) initWithPasteboard: (NSPasteboard*)pasteboard; /** Initialize and returns a new NSImage with aSize as specified * size. *

See Also:

* * -setSize: * -size * */ - (id) initWithSize: (NSSize)aSize; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (id)initWithBitmapHandle:(void *)bitmap; - (id)initWithContentsOfURL:(NSURL *)anURL; - (id)initWithIconHandle:(void *)icon; #endif // // Setting the Size of the Image // /** Sets the NSImage size to aSize. Changing the size recreate * the cache. *

See Also:

* * -size * -initWithSize: * */ - (void) setSize: (NSSize)aSize; /** Returns NSImage size if the size have been set. Returns the * size of the best representation otherwise. *

See Also:

* * -setSize: * -initWithSize: * */ - (NSSize) size; // // Referring to Images by Name // /** Returns the NSImage named aName. The search is done in the main bundle * first and then in the usual images directories. */ + (id) imageNamed: (NSString*)aName; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) + (NSImage*) _standardImageWithName: (NSString*)name; #endif #endif /** Sets aName as the name of the receiver. */ - (BOOL) setName: (NSString*)aName; /** Returns the name of the receiver. */ - (NSString*) name; // // Specifying the Image // /** Adds the NSImageRep imageRep to the NSImage's representations array. *

See Also:

* * -addRepresentations: * -removeRepresentation: * */ - (void) addRepresentation: (NSImageRep*)imageRep; /** Adds the NSImageRep array imageRepArray to the NSImage's * representations array. *

See Also:

* * -addRepresentation: * -removeRepresentation: * */ - (void) addRepresentations: (NSArray*)imageRepArray; /** Locks the focus on the best representation. *

See Also:

* * -lockFocusOnRepresentation: * */ - (void) lockFocus; /** Locks the focus in the imageRep. If imageRep is nil this method * locks the focus on the best representation. */ - (void) lockFocusOnRepresentation: (NSImageRep*)imageRep; /** Unlocks the focus on the receiver. *

See Also:

* * -lockFocus * */ - (void) unlockFocus; // // Using the Image // - (void) compositeToPoint: (NSPoint)aPoint operation: (NSCompositingOperation)op; - (void) compositeToPoint: (NSPoint)aPoint fromRect: (NSRect)aRect operation: (NSCompositingOperation)op; - (void) dissolveToPoint: (NSPoint)aPoint fraction: (CGFloat)aFloat; - (void) dissolveToPoint: (NSPoint)aPoint fromRect: (NSRect)aRect fraction: (CGFloat)aFloat; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void) compositeToPoint: (NSPoint)aPoint fromRect: (NSRect)srcRect operation: (NSCompositingOperation)op fraction: (CGFloat)delta; - (void) compositeToPoint: (NSPoint)aPoint operation: (NSCompositingOperation)op fraction: (CGFloat)delta; #endif // // Choosing Which Image Representation to Use // /** Sets the preferred representation of a NSImage. *

See Also:

* * -prefersColorMatch * -bestRepresentationForDevice: * */ - (void) setPrefersColorMatch: (BOOL)flag; /** Returns YES if color matching is the preferred representation * and NO otherwise. */ - (BOOL) prefersColorMatch; - (void) setUsesEPSOnResolutionMismatch: (BOOL)flag; - (BOOL) usesEPSOnResolutionMismatch; - (void) setMatchesOnMultipleResolution: (BOOL)flag; - (BOOL) matchesOnMultipleResolution; // // Getting the Representations // /** Finds the best representation for deviceDescription. If * deviceDescription is nil, it guesses where drawing is taking * place and finds the best representation. */ - (NSImageRep*) bestRepresentationForDevice: (NSDictionary*)deviceDescription; #if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) /** * Finds the best representation for drawing in the specified rect. * * context and hints are currently ignored. */ - (NSImageRep *)bestRepresentationForRect: (NSRect)rect context: (NSGraphicsContext *)context hints: (NSDictionary *)hints; #endif - (NSArray*) representations; /** Remove the NSImageRep imageRep from the NSImage's representations * array *

See Also:

* * -addRepresentations: * -addRepresentation: * */ - (void) removeRepresentation: (NSImageRep*)imageRep; // // Determining How the Image is Stored // - (void) setCachedSeparately: (BOOL)flag; - (BOOL) isCachedSeparately; - (void) setDataRetained: (BOOL)flag; - (BOOL) isDataRetained; - (void) setCacheDepthMatchesImageDepth: (BOOL)flag; - (BOOL) cacheDepthMatchesImageDepth; - (void) setCacheMode: (NSImageCacheMode)mode; - (NSImageCacheMode) cacheMode; // // Drawing // - (BOOL) drawRepresentation: (NSImageRep*)imageRep inRect: (NSRect)aRect; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) /** Calls -drawAtPoint:fromRect:operation:fraction: with * dstRect given by point and the size of * srcRect. */ - (void) drawAtPoint: (NSPoint)point fromRect: (NSRect)srcRect operation: (NSCompositingOperation)op fraction: (CGFloat)delta; /**

Takes the part of the receiver given by srcRect and * draws it in dstRect in the current coordinate system, * transforming the image as necessary. *

* The image is drawn as if it was drawn to a cleared window, then * dissolved using the fraction delta to another cleared * window, and finally composited using op to the * destination. *

* Note that compositing and dissolving doesn't work on all devices * (printers, in particular). *

*/ - (void) drawInRect: (NSRect)dstRect fromRect: (NSRect)srcRect operation: (NSCompositingOperation)op fraction: (CGFloat)delta; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) - (void) drawInRect: (NSRect)dstRect fromRect: (NSRect)srcRect operation: (NSCompositingOperation)op fraction: (CGFloat)delta respectFlipped: (BOOL)respectFlipped hints: (NSDictionary*)hints; #endif // // Determining How the Image is Drawn // - (BOOL) isValid; - (void) setScalesWhenResized: (BOOL)flag; - (BOOL) scalesWhenResized; /** Sets the color of the NSImage's background to aColor. *

See Also:

* * -backgroundColor * */ - (void) setBackgroundColor: (NSColor*)aColor; /** Returns the color of the NSImage's background. *

See Also:

* * -setBackgroundColor: * */ - (NSColor*) backgroundColor; - (void) recache; - (void) setFlipped: (BOOL)flag; - (BOOL) isFlipped; // // Assigning a Delegate // - (void) setDelegate: (id)anObject; - (id) delegate; // // Producing TIFF Data for the Image // - (NSData*) TIFFRepresentation; - (NSData*) TIFFRepresentationUsingCompression: (NSTIFFCompression)comp factor: (float)aFloat; // // Managing NSImageRep Subclasses // + (NSArray*) imageUnfilteredFileTypes; + (NSArray*) imageUnfilteredPasteboardTypes; // // Testing Image Data Sources // + (BOOL) canInitWithPasteboard: (NSPasteboard*)pasteboard; + (NSArray*) imageFileTypes; + (NSArray*) imagePasteboardTypes; @end @interface NSBundle (NSImageAdditions) - (NSString*) pathForImageResource: (NSString*)name; @end #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) /* * A formal protocol that duplicates the informal protocol for delegates. */ @protocol GSImageDelegateProtocol - (NSImage*) imageDidNotDraw: (id)sender inRect: (NSRect)aRect; @end #endif #endif // _GNUstep_H_NSImage gnustep-gui-0.24.0/Headers/AppKit/NSTableColumn.h0000664000076500007650000000747412110256537021342 0ustar brains99brains99/* NSTableColumn.h Copyright (C) 1999 Free Software Foundation, Inc. Author: Michael Hanni Date: 1999 Author: Nicola Pero Date: December 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSTableColumn #define _GNUstep_H_NSTableColumn #import #import @class NSSortDescriptor; @class NSCell; @class NSTableView; // TODO: Finish to implement hidden, header tool tip and resizing mask // and update the archiving code to support them. /** Describe the resizing styles accepted by the column. The final resizing behavior also depends on -[NSTableView columnAutoresizingStyle]. The table view uses the resizing mask set on each column and its column autoresizing style to determine how to resize each column. */ enum { NSTableColumnNoResizing = 0, /** Disallow any resizing. */ NSTableColumnAutoresizingMask = 1, /** Allow automatic resizing when the table view is resized. */ NSTableColumnUserResizingMask = 2 /** Allow the user to resize the column manually. */ }; @interface NSTableColumn : NSObject { id _identifier; NSTableView *_tableView; float _width; float _min_width; float _max_width; NSUInteger _resizing_mask; BOOL _is_resizable; BOOL _is_editable; BOOL _is_hidden; NSCell *_headerCell; NSCell *_dataCell; NSString *_headerToolTip; NSSortDescriptor *_sortDescriptorPrototype; } /* * Initializing an NSTableColumn instance */ - (id) initWithIdentifier: (id)anObject; /* * Managing the Identifier */ - (void) setIdentifier: (id)anObject; - (id) identifier; /* * Setting the NSTableView */ - (void) setTableView: (NSTableView *)aTableView; - (NSTableView *) tableView; /* * Controlling size & visibility */ - (void) setWidth: (CGFloat)newWidth; - (CGFloat) width; - (void) setMinWidth: (CGFloat)minWidth; - (CGFloat) minWidth; - (void) setMaxWidth: (CGFloat)maxWidth; - (CGFloat) maxWidth; - (void) setResizable: (BOOL)flag; - (BOOL) isResizable; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (void) setResizingMask: (NSUInteger)resizingMask; - (NSUInteger) resizingMask; #endif - (void) sizeToFit; #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (void) setHidden: (BOOL)hidden; - (BOOL) isHidden; #endif /* * Controlling editability */ - (void) setEditable: (BOOL)flag; - (BOOL) isEditable; /* * Setting component cells */ - (void) setHeaderCell: (NSCell *)aCell; - (NSCell *) headerCell; #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (void) setHeaderToolTip: (NSString *)aString; - (NSString *) headerToolTip; #endif - (void) setDataCell: (NSCell *)aCell; - (NSCell *) dataCell; - (NSCell *) dataCellForRow: (NSInteger)row; /* * Sorting */ #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (void) setSortDescriptorPrototype: (NSSortDescriptor *)aSortDescriptor; - (NSSortDescriptor *) sortDescriptorPrototype; #endif @end /* Notifications */ APPKIT_EXPORT NSString *NSTableViewColumnDidResizeNotification; #endif gnustep-gui-0.24.0/Headers/AppKit/DPSOperators.h0000664000076500007650000007416712104255431021217 0ustar brains99brains99/* DPSOperators - Drawing engine operators that require context Copyright (C) 1999 Free Software Foundation, Inc. Written by: Richard Frith-Macdonald Based on code by Adam Fedor Date: Feb 1999 This file is part of the GNU Objective C User Interface library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _DPSOperators_h_INCLUDE #define _DPSOperators_h_INCLUDE #import #import #define GSCTXT NSGraphicsContext /* ----------------------------------------------------------------------- */ /* Color operations */ /* ----------------------------------------------------------------------- */ static inline void DPScurrentalpha(GSCTXT *ctxt, CGFloat* a) __attribute__((unused)); static inline void DPScurrentcmykcolor(GSCTXT *ctxt, CGFloat* c, CGFloat* m, CGFloat* y, CGFloat* k) __attribute__((unused)); static inline void DPScurrentgray(GSCTXT *ctxt, CGFloat* gray) __attribute__((unused)); static inline void DPScurrenthsbcolor(GSCTXT *ctxt, CGFloat* h, CGFloat* s, CGFloat* b) __attribute__((unused)); static inline void DPScurrentrgbcolor(GSCTXT *ctxt, CGFloat* r, CGFloat* g, CGFloat* b) __attribute__((unused)); static inline void DPSsetalpha(GSCTXT *ctxt, CGFloat a) __attribute__((unused)); static inline void DPSsetcmykcolor(GSCTXT *ctxt, CGFloat c, CGFloat m, CGFloat y, CGFloat k) __attribute__((unused)); static inline void DPSsetgray(GSCTXT *ctxt, CGFloat gray) __attribute__((unused)); static inline void DPSsethsbcolor(GSCTXT *ctxt, CGFloat h, CGFloat s, CGFloat b) __attribute__((unused)); static inline void DPSsetrgbcolor(GSCTXT *ctxt, CGFloat r, CGFloat g, CGFloat b) __attribute__((unused)); static inline void GSSetFillColorspace(GSCTXT *ctxt, NSDictionary * dict) __attribute__((unused)); static inline void GSSetStrokeColorspace(GSCTXT *ctxt, NSDictionary * dict) __attribute__((unused)); static inline void GSSetFillColor(GSCTXT *ctxt, CGFloat * values) __attribute__((unused)); static inline void GSSetStrokeColor(GSCTXT *ctxt, CGFloat * values) __attribute__((unused)); /* ----------------------------------------------------------------------- */ /* Text operations */ /* ----------------------------------------------------------------------- */ static inline void DPSashow(GSCTXT *ctxt, CGFloat x, CGFloat y, const char* s) __attribute__((unused)); static inline void DPSawidthshow(GSCTXT *ctxt, CGFloat cx, CGFloat cy, int c, CGFloat ax, CGFloat ay, const char* s) __attribute__((unused)); static inline void DPScharpath(GSCTXT *ctxt, const char* s, int b) __attribute__((unused)); static inline void DPSshow(GSCTXT *ctxt, const char* s) __attribute__((unused)); static inline void DPSwidthshow(GSCTXT *ctxt, CGFloat x, CGFloat y, int c, const char* s) __attribute__((unused)); static inline void DPSxshow(GSCTXT *ctxt, const char* s, const CGFloat* numarray, int size) __attribute__((unused)); static inline void DPSxyshow(GSCTXT *ctxt, const char* s, const CGFloat* numarray, int size) __attribute__((unused)); static inline void DPSyshow(GSCTXT *ctxt, const char* s, const CGFloat* numarray, int size) __attribute__((unused)); static inline void GSSetCharacterSpacing(GSCTXT *ctxt, CGFloat extra) __attribute__((unused)); static inline void GSSetFont(GSCTXT *ctxt, NSFont* font) __attribute__((unused)); static inline void GSSetFontSize(GSCTXT *ctxt, CGFloat size) __attribute__((unused)); static inline NSAffineTransform * GSGetTextCTM(GSCTXT *ctxt) __attribute__((unused)); static inline NSPoint GSGetTextPosition(GSCTXT *ctxt) __attribute__((unused)); static inline void GSSetTextCTM(GSCTXT *ctxt, NSAffineTransform * ctm) __attribute__((unused)); static inline void GSSetTextDrawingMode(GSCTXT *ctxt, GSTextDrawingMode mode) __attribute__((unused)); static inline void GSSetTextPosition(GSCTXT *ctxt, NSPoint loc) __attribute__((unused)); static inline void GSShowText(GSCTXT *ctxt, const char * string, size_t length) __attribute__((unused)); static inline void GSShowGlyphs(GSCTXT *ctxt, const NSGlyph * glyphs, size_t length) __attribute__((unused)); static inline void GSShowGlyphsWithAdvances(GSCTXT *ctxt, const NSGlyph * glyphs, const NSSize * advances, size_t length) __attribute__((unused)); /* ----------------------------------------------------------------------- */ /* Gstate Handling */ /* ----------------------------------------------------------------------- */ static inline void DPSgrestore(GSCTXT *ctxt) __attribute__((unused)); static inline void DPSgsave(GSCTXT *ctxt) __attribute__((unused)); static inline void DPSinitgraphics(GSCTXT *ctxt) __attribute__((unused)); static inline void DPSsetgstate(GSCTXT *ctxt, NSInteger gst) __attribute__((unused)); static inline NSInteger GSDefineGState(GSCTXT *ctxt) __attribute__((unused)); static inline void GSUndefineGState(GSCTXT *ctxt, NSInteger gst) __attribute__((unused)); static inline void GSReplaceGState(GSCTXT *ctxt, NSInteger gst) __attribute__((unused)); /* ----------------------------------------------------------------------- */ /* Gstate operations */ /* ----------------------------------------------------------------------- */ static inline void DPScurrentflat(GSCTXT *ctxt, CGFloat* flatness) __attribute__((unused)); static inline void DPScurrentlinecap(GSCTXT *ctxt, int* linecap) __attribute__((unused)); static inline void DPScurrentlinejoin(GSCTXT *ctxt, int* linejoin) __attribute__((unused)); static inline void DPScurrentlinewidth(GSCTXT *ctxt, CGFloat* width) __attribute__((unused)); static inline void DPScurrentmiterlimit(GSCTXT *ctxt, CGFloat* limit) __attribute__((unused)); static inline void DPScurrentpoint(GSCTXT *ctxt, CGFloat* x, CGFloat* y) __attribute__((unused)); static inline void DPScurrentstrokeadjust(GSCTXT *ctxt, int* b) __attribute__((unused)); static inline void DPSsetdash(GSCTXT *ctxt, const CGFloat* pat, NSInteger size, CGFloat offset) __attribute__((unused)); static inline void DPSsetflat(GSCTXT *ctxt, CGFloat flatness) __attribute__((unused)); static inline void DPSsethalftonephase(GSCTXT *ctxt, CGFloat x, CGFloat y) __attribute__((unused)); static inline void DPSsetlinecap(GSCTXT *ctxt, int linecap) __attribute__((unused)); static inline void DPSsetlinejoin(GSCTXT *ctxt, int linejoin) __attribute__((unused)); static inline void DPSsetlinewidth(GSCTXT *ctxt, CGFloat width) __attribute__((unused)); static inline void DPSsetmiterlimit(GSCTXT *ctxt, CGFloat limit) __attribute__((unused)); static inline void DPSsetstrokeadjust(GSCTXT *ctxt, int b) __attribute__((unused)); /* ----------------------------------------------------------------------- */ /* Matrix operations */ /* ----------------------------------------------------------------------- */ static inline void DPSconcat(GSCTXT *ctxt, const CGFloat* m) __attribute__((unused)); static inline void DPSinitmatrix(GSCTXT *ctxt) __attribute__((unused)); static inline void DPSrotate(GSCTXT *ctxt, CGFloat angle) __attribute__((unused)); static inline void DPSscale(GSCTXT *ctxt, CGFloat x, CGFloat y) __attribute__((unused)); static inline void DPStranslate(GSCTXT *ctxt, CGFloat x, CGFloat y) __attribute__((unused)); static inline NSAffineTransform * GSCurrentCTM(GSCTXT *ctxt) __attribute__((unused)); static inline void GSSetCTM(GSCTXT *ctxt, NSAffineTransform * ctm) __attribute__((unused)); static inline void GSConcatCTM(GSCTXT *ctxt, NSAffineTransform * ctm) __attribute__((unused)); /* ----------------------------------------------------------------------- */ /* Paint operations */ /* ----------------------------------------------------------------------- */ static inline void DPSarc(GSCTXT *ctxt, CGFloat x, CGFloat y, CGFloat r, CGFloat angle1, CGFloat angle2) __attribute__((unused)); static inline void DPSarcn(GSCTXT *ctxt, CGFloat x, CGFloat y, CGFloat r, CGFloat angle1, CGFloat angle2) __attribute__((unused)); static inline void DPSarct(GSCTXT *ctxt, CGFloat x1, CGFloat y1, CGFloat x2, CGFloat y2, CGFloat r) __attribute__((unused)); static inline void DPSclip(GSCTXT *ctxt) __attribute__((unused)); static inline void DPSclosepath(GSCTXT *ctxt) __attribute__((unused)); static inline void DPScurveto(GSCTXT *ctxt, CGFloat x1, CGFloat y1, CGFloat x2, CGFloat y2, CGFloat x3, CGFloat y3) __attribute__((unused)); static inline void DPSeoclip(GSCTXT *ctxt) __attribute__((unused)); static inline void DPSeofill(GSCTXT *ctxt) __attribute__((unused)); static inline void DPSfill(GSCTXT *ctxt) __attribute__((unused)); static inline void DPSflattenpath(GSCTXT *ctxt) __attribute__((unused)); static inline void DPSinitclip(GSCTXT *ctxt) __attribute__((unused)); static inline void DPSlineto(GSCTXT *ctxt, CGFloat x, CGFloat y) __attribute__((unused)); static inline void DPSmoveto(GSCTXT *ctxt, CGFloat x, CGFloat y) __attribute__((unused)); static inline void DPSnewpath(GSCTXT *ctxt) __attribute__((unused)); static inline void DPSpathbbox(GSCTXT *ctxt, CGFloat* llx, CGFloat* lly, CGFloat* urx, CGFloat* ury) __attribute__((unused)); static inline void DPSrcurveto(GSCTXT *ctxt, CGFloat x1, CGFloat y1, CGFloat x2, CGFloat y2, CGFloat x3, CGFloat y3) __attribute__((unused)); static inline void DPSrectclip(GSCTXT *ctxt, CGFloat x, CGFloat y, CGFloat w, CGFloat h) __attribute__((unused)); static inline void DPSrectfill(GSCTXT *ctxt, CGFloat x, CGFloat y, CGFloat w, CGFloat h) __attribute__((unused)); static inline void DPSrectstroke(GSCTXT *ctxt, CGFloat x, CGFloat y, CGFloat w, CGFloat h) __attribute__((unused)); static inline void DPSreversepath(GSCTXT *ctxt) __attribute__((unused)); static inline void DPSrlineto(GSCTXT *ctxt, CGFloat x, CGFloat y) __attribute__((unused)); static inline void DPSrmoveto(GSCTXT *ctxt, CGFloat x, CGFloat y) __attribute__((unused)); static inline void DPSstroke(GSCTXT *ctxt) __attribute__((unused)); static inline void DPSshfill(GSCTXT *ctxt, NSDictionary *shaderDictionary) __attribute__((unused)); static inline void GSSendBezierPath(GSCTXT *ctxt, NSBezierPath * path) __attribute__((unused)); static inline void GSRectClipList(GSCTXT *ctxt, const NSRect * rects, int count) __attribute__((unused)); static inline void GSRectFillList(GSCTXT *ctxt, const NSRect * rects, int count) __attribute__((unused)); /* ----------------------------------------------------------------------- */ /* Window system ops */ /* ----------------------------------------------------------------------- */ static inline void GSCurrentDevice(GSCTXT *ctxt, void** device, int* x, int* y) __attribute__((unused)); static inline void DPScurrentoffset(GSCTXT *ctxt, int* x, int* y) __attribute__((unused)); static inline void GSSetDevice(GSCTXT *ctxt, void* device, int x, int y) __attribute__((unused)); static inline void DPSsetoffset(GSCTXT *ctxt, short int x, short int y) __attribute__((unused)); /*-------------------------------------------------------------------------*/ /* Graphics Extensions Ops */ /*-------------------------------------------------------------------------*/ static inline void DPScomposite(GSCTXT *ctxt, CGFloat x, CGFloat y, CGFloat w, CGFloat h, NSInteger gstateNum, CGFloat dx, CGFloat dy, NSCompositingOperation op) __attribute__((unused)); static inline void DPScompositerect(GSCTXT *ctxt, CGFloat x, CGFloat y, CGFloat w, CGFloat h, NSCompositingOperation op) __attribute__((unused)); static inline void DPSdissolve(GSCTXT *ctxt, CGFloat x, CGFloat y, CGFloat w, CGFloat h, NSInteger gstateNum, CGFloat dx, CGFloat dy, CGFloat delta) __attribute__((unused)); static inline void GSDrawImage(GSCTXT *ctxt, NSRect rect, void * imageref) __attribute__((unused)); /* ----------------------------------------------------------------------- */ /* Postscript Client functions */ /* ----------------------------------------------------------------------- */ static void DPSPrintf(GSCTXT *ctxt, const char * fmt, ...) __attribute__((unused)); static inline void DPSWriteData(GSCTXT *ctxt, const char * buf, unsigned int count) __attribute__((unused)); /* ----------------------------------------------------------------------- */ /* Color operations */ /* ----------------------------------------------------------------------- */ static inline void DPScurrentalpha(GSCTXT *ctxt, CGFloat* a) { (ctxt->methods->DPScurrentalpha_) (ctxt, @selector(DPScurrentalpha:), a); } static inline void DPScurrentcmykcolor(GSCTXT *ctxt, CGFloat* c, CGFloat* m, CGFloat* y, CGFloat* k) { (ctxt->methods->DPScurrentcmykcolor____) (ctxt, @selector(DPScurrentcmykcolor: : : :), c, m, y, k); } static inline void DPScurrentgray(GSCTXT *ctxt, CGFloat* gray) { (ctxt->methods->DPScurrentgray_) (ctxt, @selector(DPScurrentgray:), gray); } static inline void DPScurrenthsbcolor(GSCTXT *ctxt, CGFloat* h, CGFloat* s, CGFloat* b) { (ctxt->methods->DPScurrenthsbcolor___) (ctxt, @selector(DPScurrenthsbcolor: : :), h, s, b); } static inline void DPScurrentrgbcolor(GSCTXT *ctxt, CGFloat* r, CGFloat* g, CGFloat* b) { (ctxt->methods->DPScurrentrgbcolor___) (ctxt, @selector(DPScurrentrgbcolor: : :), r, g, b); } static inline void DPSsetalpha(GSCTXT *ctxt, CGFloat a) { (ctxt->methods->DPSsetalpha_) (ctxt, @selector(DPSsetalpha:), a); } static inline void DPSsetcmykcolor(GSCTXT *ctxt, CGFloat c, CGFloat m, CGFloat y, CGFloat k) { (ctxt->methods->DPSsetcmykcolor____) (ctxt, @selector(DPSsetcmykcolor: : : :), c, m, y, k); } static inline void DPSsetgray(GSCTXT *ctxt, CGFloat gray) { (ctxt->methods->DPSsetgray_) (ctxt, @selector(DPSsetgray:), gray); } static inline void DPSsethsbcolor(GSCTXT *ctxt, CGFloat h, CGFloat s, CGFloat b) { (ctxt->methods->DPSsethsbcolor___) (ctxt, @selector(DPSsethsbcolor: : :), h, s, b); } static inline void DPSsetrgbcolor(GSCTXT *ctxt, CGFloat r, CGFloat g, CGFloat b) { (ctxt->methods->DPSsetrgbcolor___) (ctxt, @selector(DPSsetrgbcolor: : :), r, g, b); } static inline void GSSetFillColorspace(GSCTXT *ctxt, NSDictionary * dict) { (ctxt->methods->GSSetFillColorspace_) (ctxt, @selector(GSSetFillColorspace:), dict); } static inline void GSSetStrokeColorspace(GSCTXT *ctxt, NSDictionary * dict) { (ctxt->methods->GSSetStrokeColorspace_) (ctxt, @selector(GSSetStrokeColorspace:), dict); } static inline void GSSetFillColor(GSCTXT *ctxt, CGFloat * values) { (ctxt->methods->GSSetFillColor_) (ctxt, @selector(GSSetFillColor:), values); } static inline void GSSetStrokeColor(GSCTXT *ctxt, CGFloat * values) { (ctxt->methods->GSSetStrokeColor_) (ctxt, @selector(GSSetStrokeColor:), values); } /* ----------------------------------------------------------------------- */ /* Text operations */ /* ----------------------------------------------------------------------- */ static inline void DPSashow(GSCTXT *ctxt, CGFloat x, CGFloat y, const char* s) { (ctxt->methods->DPSashow___) (ctxt, @selector(DPSashow: : :), x, y, s); } static inline void DPSawidthshow(GSCTXT *ctxt, CGFloat cx, CGFloat cy, int c, CGFloat ax, CGFloat ay, const char* s) { (ctxt->methods->DPSawidthshow______) (ctxt, @selector(DPSawidthshow: : : : : :), cx, cy, c, ax, ay, s); } static inline void DPScharpath(GSCTXT *ctxt, const char* s, int b) { (ctxt->methods->DPScharpath__) (ctxt, @selector(DPScharpath: :), s, b); } static inline void DPSshow(GSCTXT *ctxt, const char* s) { (ctxt->methods->DPSshow_) (ctxt, @selector(DPSshow:), s); } static inline void DPSwidthshow(GSCTXT *ctxt, CGFloat x, CGFloat y, int c, const char* s) { (ctxt->methods->DPSwidthshow____) (ctxt, @selector(DPSwidthshow: : : :), x, y, c, s); } static inline void DPSxshow(GSCTXT *ctxt, const char* s, const CGFloat* numarray, int size) { (ctxt->methods->DPSxshow___) (ctxt, @selector(DPSxshow: : :), s, numarray, size); } static inline void DPSxyshow(GSCTXT *ctxt, const char* s, const CGFloat* numarray, int size) { (ctxt->methods->DPSxyshow___) (ctxt, @selector(DPSxyshow: : :), s, numarray, size); } static inline void DPSyshow(GSCTXT *ctxt, const char* s, const CGFloat* numarray, int size) { (ctxt->methods->DPSyshow___) (ctxt, @selector(DPSyshow: : :), s, numarray, size); } static inline void GSSetCharacterSpacing(GSCTXT *ctxt, CGFloat extra) { (ctxt->methods->GSSetCharacterSpacing_) (ctxt, @selector(GSSetCharacterSpacing:), extra); } static inline void GSSetFont(GSCTXT *ctxt, NSFont* font) { (ctxt->methods->GSSetFont_) (ctxt, @selector(GSSetFont:), font); } static inline void GSSetFontSize(GSCTXT *ctxt, CGFloat size) { (ctxt->methods->GSSetFontSize_) (ctxt, @selector(GSSetFontSize:), size); } static inline NSAffineTransform * GSGetTextCTM(GSCTXT *ctxt) { return (ctxt->methods->GSGetTextCTM) (ctxt, @selector(GSGetTextCTM)); } static inline NSPoint GSGetTextPosition(GSCTXT *ctxt) { return (ctxt->methods->GSGetTextPosition) (ctxt, @selector(GSGetTextPosition)); } static inline void GSSetTextCTM(GSCTXT *ctxt, NSAffineTransform * ctm) { (ctxt->methods->GSSetTextCTM_) (ctxt, @selector(GSSetTextCTM:), ctm); } static inline void GSSetTextDrawingMode(GSCTXT *ctxt, GSTextDrawingMode mode) { (ctxt->methods->GSSetTextDrawingMode_) (ctxt, @selector(GSSetTextDrawingMode:), mode); } static inline void GSSetTextPosition(GSCTXT *ctxt, NSPoint loc) { (ctxt->methods->GSSetTextPosition_) (ctxt, @selector(GSSetTextPosition:), loc); } static inline void GSShowText(GSCTXT *ctxt, const char * string, size_t length) { (ctxt->methods->GSShowText__) (ctxt, @selector(GSShowText: :), string, length); } static inline void GSShowGlyphs(GSCTXT *ctxt, const NSGlyph * glyphs, size_t length) { (ctxt->methods->GSShowGlyphs__) (ctxt, @selector(GSShowGlyphs: :), glyphs, length); } static inline void GSShowGlyphsWithAdvances(GSCTXT *ctxt, const NSGlyph * glyphs, const NSSize * advances, size_t length) { (ctxt->methods->GSShowGlyphsWithAdvances__) (ctxt, @selector(GSShowGlyphsWithAdvances: :), glyphs, advances, length); } /* ----------------------------------------------------------------------- */ /* Gstate Handling */ /* ----------------------------------------------------------------------- */ static inline void DPSgrestore(GSCTXT *ctxt) { (ctxt->methods->DPSgrestore) (ctxt, @selector(DPSgrestore)); } static inline void DPSgsave(GSCTXT *ctxt) { (ctxt->methods->DPSgsave) (ctxt, @selector(DPSgsave)); } static inline void DPSinitgraphics(GSCTXT *ctxt) { (ctxt->methods->DPSinitgraphics) (ctxt, @selector(DPSinitgraphics)); } static inline void DPSsetgstate(GSCTXT *ctxt, NSInteger gst) { (ctxt->methods->DPSsetgstate_) (ctxt, @selector(DPSsetgstate:), gst); } static inline NSInteger GSDefineGState(GSCTXT *ctxt) { return (ctxt->methods->GSDefineGState) (ctxt, @selector(GSDefineGState)); } static inline void GSUndefineGState(GSCTXT *ctxt, NSInteger gst) { (ctxt->methods->GSUndefineGState_) (ctxt, @selector(GSUndefineGState:), gst); } static inline void GSReplaceGState(GSCTXT *ctxt, NSInteger gst) { (ctxt->methods->GSReplaceGState_) (ctxt, @selector(GSReplaceGState:), gst); } /* ----------------------------------------------------------------------- */ /* Gstate operations */ /* ----------------------------------------------------------------------- */ static inline void DPScurrentflat(GSCTXT *ctxt, CGFloat* flatness) { (ctxt->methods->DPScurrentflat_) (ctxt, @selector(DPScurrentflat:), flatness); } static inline void DPScurrentlinecap(GSCTXT *ctxt, int* linecap) { (ctxt->methods->DPScurrentlinecap_) (ctxt, @selector(DPScurrentlinecap:), linecap); } static inline void DPScurrentlinejoin(GSCTXT *ctxt, int* linejoin) { (ctxt->methods->DPScurrentlinejoin_) (ctxt, @selector(DPScurrentlinejoin:), linejoin); } static inline void DPScurrentlinewidth(GSCTXT *ctxt, CGFloat* width) { (ctxt->methods->DPScurrentlinewidth_) (ctxt, @selector(DPScurrentlinewidth:), width); } static inline void DPScurrentmiterlimit(GSCTXT *ctxt, CGFloat* limit) { (ctxt->methods->DPScurrentmiterlimit_) (ctxt, @selector(DPScurrentmiterlimit:), limit); } static inline void DPScurrentpoint(GSCTXT *ctxt, CGFloat* x, CGFloat* y) { (ctxt->methods->DPScurrentpoint__) (ctxt, @selector(DPScurrentpoint: :), x, y); } static inline void DPScurrentstrokeadjust(GSCTXT *ctxt, int* b) { (ctxt->methods->DPScurrentstrokeadjust_) (ctxt, @selector(DPScurrentstrokeadjust:), b); } static inline void DPSsetdash(GSCTXT *ctxt, const CGFloat* pat, NSInteger size, CGFloat offset) { (ctxt->methods->DPSsetdash___) (ctxt, @selector(DPSsetdash: : :), pat, size, offset); } static inline void DPSsetflat(GSCTXT *ctxt, CGFloat flatness) { (ctxt->methods->DPSsetflat_) (ctxt, @selector(DPSsetflat:), flatness); } static inline void DPSsethalftonephase(GSCTXT *ctxt, CGFloat x, CGFloat y) { (ctxt->methods->DPSsethalftonephase__) (ctxt, @selector(DPSsethalftonephase: :), x, y); } static inline void DPSsetlinecap(GSCTXT *ctxt, int linecap) { (ctxt->methods->DPSsetlinecap_) (ctxt, @selector(DPSsetlinecap:), linecap); } static inline void DPSsetlinejoin(GSCTXT *ctxt, int linejoin) { (ctxt->methods->DPSsetlinejoin_) (ctxt, @selector(DPSsetlinejoin:), linejoin); } static inline void DPSsetlinewidth(GSCTXT *ctxt, CGFloat width) { (ctxt->methods->DPSsetlinewidth_) (ctxt, @selector(DPSsetlinewidth:), width); } static inline void DPSsetmiterlimit(GSCTXT *ctxt, CGFloat limit) { (ctxt->methods->DPSsetmiterlimit_) (ctxt, @selector(DPSsetmiterlimit:), limit); } static inline void DPSsetstrokeadjust(GSCTXT *ctxt, int b) { (ctxt->methods->DPSsetstrokeadjust_) (ctxt, @selector(DPSsetstrokeadjust:), b); } /* ----------------------------------------------------------------------- */ /* Matrix operations */ /* ----------------------------------------------------------------------- */ static inline void DPSconcat(GSCTXT *ctxt, const CGFloat* m) { (ctxt->methods->DPSconcat_) (ctxt, @selector(DPSconcat:), m); } static inline void DPSinitmatrix(GSCTXT *ctxt) { (ctxt->methods->DPSinitmatrix) (ctxt, @selector(DPSinitmatrix)); } static inline void DPSrotate(GSCTXT *ctxt, CGFloat angle) { (ctxt->methods->DPSrotate_) (ctxt, @selector(DPSrotate:), angle); } static inline void DPSscale(GSCTXT *ctxt, CGFloat x, CGFloat y) { (ctxt->methods->DPSscale__) (ctxt, @selector(DPSscale: :), x, y); } static inline void DPStranslate(GSCTXT *ctxt, CGFloat x, CGFloat y) { (ctxt->methods->DPStranslate__) (ctxt, @selector(DPStranslate: :), x, y); } static inline NSAffineTransform * GSCurrentCTM(GSCTXT *ctxt) { return (ctxt->methods->GSCurrentCTM) (ctxt, @selector(GSCurrentCTM)); } static inline void GSSetCTM(GSCTXT *ctxt, NSAffineTransform * ctm) { (ctxt->methods->GSSetCTM_) (ctxt, @selector(GSSetCTM:), ctm); } static inline void GSConcatCTM(GSCTXT *ctxt, NSAffineTransform * ctm) { (ctxt->methods->GSConcatCTM_) (ctxt, @selector(GSConcatCTM:), ctm); } /* ----------------------------------------------------------------------- */ /* Paint operations */ /* ----------------------------------------------------------------------- */ static inline void DPSarc(GSCTXT *ctxt, CGFloat x, CGFloat y, CGFloat r, CGFloat angle1, CGFloat angle2) { (ctxt->methods->DPSarc_____) (ctxt, @selector(DPSarc: : : : :), x, y, r, angle1, angle2); } static inline void DPSarcn(GSCTXT *ctxt, CGFloat x, CGFloat y, CGFloat r, CGFloat angle1, CGFloat angle2) { (ctxt->methods->DPSarcn_____) (ctxt, @selector(DPSarcn: : : : :), x, y, r, angle1, angle2); } static inline void DPSarct(GSCTXT *ctxt, CGFloat x1, CGFloat y1, CGFloat x2, CGFloat y2, CGFloat r) { (ctxt->methods->DPSarct_____) (ctxt, @selector(DPSarct: : : : :), x1, y1, x2, y2, r); } static inline void DPSclip(GSCTXT *ctxt) { (ctxt->methods->DPSclip) (ctxt, @selector(DPSclip)); } static inline void DPSclosepath(GSCTXT *ctxt) { (ctxt->methods->DPSclosepath) (ctxt, @selector(DPSclosepath)); } static inline void DPScurveto(GSCTXT *ctxt, CGFloat x1, CGFloat y1, CGFloat x2, CGFloat y2, CGFloat x3, CGFloat y3) { (ctxt->methods->DPScurveto______) (ctxt, @selector(DPScurveto: : : : : :), x1, y1, x2, y2, x3, y3); } static inline void DPSeoclip(GSCTXT *ctxt) { (ctxt->methods->DPSeoclip) (ctxt, @selector(DPSeoclip)); } static inline void DPSeofill(GSCTXT *ctxt) { (ctxt->methods->DPSeofill) (ctxt, @selector(DPSeofill)); } static inline void DPSfill(GSCTXT *ctxt) { (ctxt->methods->DPSfill) (ctxt, @selector(DPSfill)); } static inline void DPSflattenpath(GSCTXT *ctxt) { (ctxt->methods->DPSflattenpath) (ctxt, @selector(DPSflattenpath)); } static inline void DPSinitclip(GSCTXT *ctxt) { (ctxt->methods->DPSinitclip) (ctxt, @selector(DPSinitclip)); } static inline void DPSlineto(GSCTXT *ctxt, CGFloat x, CGFloat y) { (ctxt->methods->DPSlineto__) (ctxt, @selector(DPSlineto: :), x, y); } static inline void DPSmoveto(GSCTXT *ctxt, CGFloat x, CGFloat y) { (ctxt->methods->DPSmoveto__) (ctxt, @selector(DPSmoveto: :), x, y); } static inline void DPSnewpath(GSCTXT *ctxt) { (ctxt->methods->DPSnewpath) (ctxt, @selector(DPSnewpath)); } static inline void DPSpathbbox(GSCTXT *ctxt, CGFloat* llx, CGFloat* lly, CGFloat* urx, CGFloat* ury) { (ctxt->methods->DPSpathbbox____) (ctxt, @selector(DPSpathbbox: : : :), llx, lly, urx, ury); } static inline void DPSrcurveto(GSCTXT *ctxt, CGFloat x1, CGFloat y1, CGFloat x2, CGFloat y2, CGFloat x3, CGFloat y3) { (ctxt->methods->DPSrcurveto______) (ctxt, @selector(DPSrcurveto: : : : : :), x1, y1, x2, y2, x3, y3); } static inline void DPSrectclip(GSCTXT *ctxt, CGFloat x, CGFloat y, CGFloat w, CGFloat h) { (ctxt->methods->DPSrectclip____) (ctxt, @selector(DPSrectclip: : : :), x, y, w, h); } static inline void DPSrectfill(GSCTXT *ctxt, CGFloat x, CGFloat y, CGFloat w, CGFloat h) { (ctxt->methods->DPSrectfill____) (ctxt, @selector(DPSrectfill: : : :), x, y, w, h); } static inline void DPSrectstroke(GSCTXT *ctxt, CGFloat x, CGFloat y, CGFloat w, CGFloat h) { (ctxt->methods->DPSrectstroke____) (ctxt, @selector(DPSrectstroke: : : :), x, y, w, h); } static inline void DPSreversepath(GSCTXT *ctxt) { (ctxt->methods->DPSreversepath) (ctxt, @selector(DPSreversepath)); } static inline void DPSrlineto(GSCTXT *ctxt, CGFloat x, CGFloat y) { (ctxt->methods->DPSrlineto__) (ctxt, @selector(DPSrlineto: :), x, y); } static inline void DPSrmoveto(GSCTXT *ctxt, CGFloat x, CGFloat y) { (ctxt->methods->DPSrmoveto__) (ctxt, @selector(DPSrmoveto: :), x, y); } static inline void DPSstroke(GSCTXT *ctxt) { (ctxt->methods->DPSstroke) (ctxt, @selector(DPSstroke)); } static inline void DPSshfill(GSCTXT *ctxt, NSDictionary *shaderDictionary) { (ctxt->methods->DPSshfill) (ctxt, @selector(DPSshfill:), shaderDictionary); } static inline void GSSendBezierPath(GSCTXT *ctxt, NSBezierPath * path) { (ctxt->methods->GSSendBezierPath_) (ctxt, @selector(GSSendBezierPath:), path); } static inline void GSRectClipList(GSCTXT *ctxt, const NSRect * rects, int count) { (ctxt->methods->GSRectClipList__) (ctxt, @selector(GSRectClipList: :), rects, count); } static inline void GSRectFillList(GSCTXT *ctxt, const NSRect * rects, int count) { (ctxt->methods->GSRectFillList__) (ctxt, @selector(GSRectFillList: :), rects, count); } /* ----------------------------------------------------------------------- */ /* Window system ops */ /* ----------------------------------------------------------------------- */ static inline void GSCurrentDevice(GSCTXT *ctxt, void** device, int* x, int* y) { (ctxt->methods->GSCurrentDevice___) (ctxt, @selector(GSCurrentDevice: : :), device, x, y); } static inline void DPScurrentoffset(GSCTXT *ctxt, int* x, int* y) { (ctxt->methods->DPScurrentoffset__) (ctxt, @selector(DPScurrentoffset: :), x, y); } static inline void GSSetDevice(GSCTXT *ctxt, void* device, int x, int y) { (ctxt->methods->GSSetDevice___) (ctxt, @selector(GSSetDevice: : :), device, x, y); } static inline void DPSsetoffset(GSCTXT *ctxt, short int x, short int y) { (ctxt->methods->DPSsetoffset__) (ctxt, @selector(DPSsetoffset: :), x, y); } /*-------------------------------------------------------------------------*/ /* Graphics Extensions Ops */ /*-------------------------------------------------------------------------*/ static inline void DPScomposite(GSCTXT *ctxt, CGFloat x, CGFloat y, CGFloat w, CGFloat h, NSInteger gstateNum, CGFloat dx, CGFloat dy, NSCompositingOperation op) { (ctxt->methods->DPScomposite________) (ctxt, @selector(DPScomposite: : : : : : : :), x, y, w, h, gstateNum, dx, dy, op); } static inline void DPScompositerect(GSCTXT *ctxt, CGFloat x, CGFloat y, CGFloat w, CGFloat h, NSCompositingOperation op) { (ctxt->methods->DPScompositerect_____) (ctxt, @selector(DPScompositerect: : : : :), x, y, w, h, op); } static inline void DPSdissolve(GSCTXT *ctxt, CGFloat x, CGFloat y, CGFloat w, CGFloat h, NSInteger gstateNum, CGFloat dx, CGFloat dy, CGFloat delta) { (ctxt->methods->DPSdissolve________) (ctxt, @selector(DPSdissolve: : : : : : : :), x, y, w, h, gstateNum, dx, dy, delta); } static inline void GSDrawImage(GSCTXT *ctxt, NSRect rect, void * imageref) { (ctxt->methods->GSDrawImage__) (ctxt, @selector(GSDrawImage: :), rect, imageref); } /* ----------------------------------------------------------------------- */ /* Postscript Client functions */ /* ----------------------------------------------------------------------- */ static void DPSPrintf(GSCTXT *ctxt, const char * fmt, ...) { va_list ap; va_start(ap, fmt); if (fmt != NULL) (ctxt->methods->DPSPrintf__) (ctxt, @selector(DPSPrintf: :), fmt, ap); va_end(ap); } static inline void DPSWriteData(GSCTXT *ctxt, const char * buf, unsigned int count) { (ctxt->methods->DPSWriteData__) (ctxt, @selector(DPSWriteData: :), buf, count); } #endif gnustep-gui-0.24.0/Headers/AppKit/NSMovie.h0000664000076500007650000000331411352752764020213 0ustar brains99brains99/** NSMovie Encapsulate a Quicktime movie Copyright (C) 2003 Free Software Foundation, Inc. Author: Fred Kiefer Date: March 2003 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSMovie #define _GNUstep_H_NSMovie #import #import @class NSArray; @class NSData; @class NSURL; @class NSPasteboard; @interface NSMovie : NSObject { @private NSData* _movie; NSURL* _url; } + (NSArray*) movieUnfilteredFileTypes; + (NSArray*) movieUnfilteredPasteboardTypes; + (BOOL) canInitWithPasteboard: (NSPasteboard*)pasteboard; - (id) initWithMovie: (void*)movie; - (id) initWithURL: (NSURL*)url byReference: (BOOL)byRef; - (id) initWithPasteboard: (NSPasteboard*)pasteboard; - (void*) QTMovie; - (NSURL*) URL; @end #endif /* _GNUstep_H_NSMovie */ gnustep-gui-0.24.0/Headers/AppKit/NSSliderCell.h0000664000076500007650000000656712110256537021161 0ustar brains99brains99/* NSSliderCell.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: September 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSSliderCell #define _GNUstep_H_NSSliderCell #import @class NSString; @class NSColor; @class NSFont; @class NSImage; typedef enum _NSTickMarkPosition { NSTickMarkBelow = 0, NSTickMarkAbove, NSTickMarkLeft = 0, NSTickMarkRight } NSTickMarkPosition; typedef enum _NSSliderType { NSLinearSlider = 0, NSCircularSlider } NSSliderType; @interface NSSliderCell : NSActionCell { float _minValue; float _maxValue; float _altIncrementValue; id _titleCell; id _knobCell; NSRect _trackRect; BOOL _isVertical; BOOL _allowsTickMarkValuesOnly; NSInteger _numberOfTickMarks; NSTickMarkPosition _tickMarkPosition; NSSliderType _type; } /* Asking about the cell's behavior */ - (double) altIncrementValue; + (BOOL) prefersTrackingUntilMouseUp; - (NSRect) trackRect; /* Changing the cell's behavior */ - (void) setAltIncrementValue: (double)increment; /* Displaying the cell */ - (NSRect) knobRectFlipped: (BOOL)flipped; - (void) drawBarInside: (NSRect)rect flipped: (BOOL)flipped; - (void) drawKnob; - (void) drawKnob: (NSRect)knobRect; /* Asking about the cell's appearance */ - (CGFloat) knobThickness; - (NSInteger) isVertical; - (NSString*) title; - (id) titleCell; - (NSColor*) titleColor; - (NSFont*) titleFont; - (NSSliderType) sliderType; /* Changing the cell's appearance */ - (void) setKnobThickness: (CGFloat)thickness; - (void) setTitle: (NSString*)title; - (void) setTitleCell: (NSCell*)aCell; - (void) setTitleColor: (NSColor*)color; - (void) setTitleFont: (NSFont*)font; - (void) setSliderType:(NSSliderType)type; /* Asking about the value limits */ - (double) minValue; - (double) maxValue; /* Changing the value limits */ - (void) setMinValue: (double)aDouble; - (void) setMaxValue: (double)aDouble; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) // ticks - (BOOL) allowsTickMarkValuesOnly; - (double) closestTickMarkValueToValue: (double)aValue; - (NSInteger) indexOfTickMarkAtPoint: (NSPoint)point; - (NSInteger) numberOfTickMarks; - (NSRect) rectOfTickMarkAtIndex: (NSInteger)index; - (void) setAllowsTickMarkValuesOnly: (BOOL)flag; - (void) setNumberOfTickMarks: (NSInteger)numberOfTickMarks; - (void) setTickMarkPosition: (NSTickMarkPosition)position; - (NSTickMarkPosition) tickMarkPosition; - (double) tickMarkValueAtIndex: (NSInteger)index; #endif @end #endif /* _GNUstep_H_NSSliderCell */ gnustep-gui-0.24.0/Headers/AppKit/NSTreeController.h0000664000076500007650000000717012204466636022100 0ustar brains99brains99/* NSTreeController.h The tree controller class. Copyright (C) 2012 Free Software Foundation, Inc. Author: Gregory Casamento Date: 2012 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSTreeController #define _GNUstep_H_NSTreeController #import #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) #import @class NSString; @class NSArray; @class NSIndexPath; @class NSTreeNode; @interface NSTreeController : NSObjectController { NSString *_childrenKeyPath; NSString *_countKeyPath; NSString *_leafKeyPath; NSArray *_sortDescriptors; BOOL _alwaysUsesMultipleValuesMarker; BOOL _avoidsEmptySelection; BOOL _preservesSelection; BOOL _selectsInsertedObjects; } - (BOOL) addSelectionIndexPaths: (NSArray*)indexPaths; - (BOOL) alwaysUsesMultipleValuesMarker; - (BOOL) avoidsEmptySelection; - (BOOL) canAddChid; - (BOOL) canInsert; - (BOOL) canInsertChild; - (BOOL) preservesSelection; - (BOOL) selectsInsertedObjects; - (BOOL) setSelectionIndexPath: (NSIndexPath*)indexPath; - (BOOL) setSelectionIndexPaths: (NSArray*)indexPaths; - (id) arrangedObjects; - (id) content; - (NSArray*) selectedObjects; - (NSIndexPath*) selectionIndexPath; - (NSArray*) selectionIndexPaths; - (NSArray*) sortDescriptors; - (NSString*) childrenKeyPath; - (NSString*) countKeyPath; - (NSString*) leafKeyPath; - (void) addChild: (id)sender; - (void) add: (id)sender; - (void) insertChild: (id)sender; - (void) insertObject: (id)object atArrangedObjectIndexPath: (NSIndexPath*)indexPath; - (void) insertObjects: (NSArray*)objects atArrangedObjectIndexPaths: (NSArray*)indexPaths; - (void) insert: (id)sender; - (void) rearrangeObjects; - (void) removeObjectAtArrangedObjectIndexPath: (NSIndexPath*)indexPath; - (void) removeObjectsAtArrangedObjectIndexPaths: (NSArray*)indexPaths; - (void) removeSelectionIndexPaths: (NSArray*)indexPaths; - (void) remove: (id)sender; - (void) setAlwaysUsesMultipleValuesMarker: (BOOL)flag; - (void) setAvoidsEmptySelection: (BOOL)flag; - (void) setChildrenKeyPath: (NSString*)path; - (void) setContent: (id)content; - (void) setCountKeyPath: (NSString*)path; - (void) setLeafPathKey: (NSString*)key; - (void) setPreservesSelection: (BOOL)flag; - (void) setSelectsInsertedObjects: (BOOL)flag; - (void) setSortDescriptors: (NSArray*)descriptors; #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (NSString*) childrenKeyPathForNode: (NSTreeNode*)node; - (NSString*) countKeyPathForNode: (NSTreeNode*)node; - (NSString*) leafKeyPathForNode: (NSTreeNode*)node; - (void) moveNode: (NSTreeNode*)node toIndexPath: (NSIndexPath*)indexPath; - (void) moveNodes: (NSArray*)nodes toIndexPath: (NSIndexPath*)startingIndexPath; - (NSArray*) selectedNodes; #endif @end #endif #endif /* _GNUstep_H_NSTreeController */ gnustep-gui-0.24.0/Headers/AppKit/NSColorPanel.h0000664000076500007650000000671311514372530021165 0ustar brains99brains99/* NSColorPanel.h System generic color panel Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSColorPanel #define _GNUstep_H_NSColorPanel #import #import #import #import #import #import #import @class NSBox; @class NSButton; @class NSColorList; @class NSEvent; @class NSMatrix; @class NSSlider; @class NSSplitView; @class NSView; enum { NSGrayModeColorPanel, NSRGBModeColorPanel, NSCMYKModeColorPanel, NSHSBModeColorPanel, NSCustomPaletteModeColorPanel, NSColorListModeColorPanel, NSWheelModeColorPanel, NSCrayonModeColorPanel }; enum { NSColorPanelGrayModeMask = 1, NSColorPanelRGBModeMask = 2, NSColorPanelCMYKModeMask = 4, NSColorPanelHSBModeMask = 8, NSColorPanelCustomPaletteModeMask = 16, NSColorPanelColorListModeMask = 32, NSColorPanelWheelModeMask = 64, NSColorPanelCrayonModeMask = 128, NSColorPanelAllModesMask = 255 }; @interface NSApplication (NSColorPanel) - (void) orderFrontColorPanel: (id)sender; @end @interface NSColorPanel : NSPanel { // Attributes NSView *_topView; NSColorWell *_colorWell; NSButton *_magnifyButton; NSMatrix *_pickerMatrix; NSBox *_pickerBox; NSSlider *_alphaSlider; NSSplitView *_splitView; NSView *_accessoryView; //NSMatrix *_swatches; NSMutableArray *_pickers; id _currentPicker; id _target; SEL _action; BOOL _isContinuous; BOOL _showsAlpha; } // // Creating the NSColorPanel // + (NSColorPanel *)sharedColorPanel; + (BOOL)sharedColorPanelExists; // // Setting the NSColorPanel // + (void)setPickerMask:(int)mask; + (void)setPickerMode:(int)mode; - (NSView *)accessoryView; - (BOOL)isContinuous; - (int)mode; - (void)setAccessoryView:(NSView *)aView; - (void)setAction:(SEL)aSelector; - (void)setContinuous:(BOOL)flag; - (void)setMode:(int)mode; - (void)setShowsAlpha:(BOOL)flag; - (void)setTarget:(id)anObject; - (BOOL)showsAlpha; // // Attaching a Color List // - (void)attachColorList:(NSColorList *)aColorList; - (void)detachColorList:(NSColorList *)aColorList; // // Setting Color // + (BOOL)dragColor:(NSColor *)aColor withEvent:(NSEvent *)anEvent fromView:(NSView *)sourceView; - (void)setColor:(NSColor *)aColor; - (float)alpha; - (NSColor *)color; @end /* Notifications */ APPKIT_EXPORT NSString *NSColorPanelColorDidChangeNotification; #endif // _GNUstep_H_NSColorPanel gnustep-gui-0.24.0/Headers/AppKit/NSWindow.h0000664000076500007650000006625212216157450020404 0ustar brains99brains99/* NSWindow.h The window class Copyright (C) 1996,1999,2004 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Modified: Felipe A. Rodriguez Date: June 1998 Modified: Richard Frith-Macdonald Date: 1998,1999 Author: Quentin Mathe Date: January 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSWindow #define _GNUstep_H_NSWindow #import #import #import @class NSArray; @class NSData; @class NSDate; @class NSDictionary; @class NSMutableArray; @class NSNotification; @class NSString; @class NSUndoManager; @class NSButton; @class NSButtonCell; @class NSColor; @class NSEvent; @class NSImage; @class NSMenu; @class NSPasteboard; @class NSScreen; @class NSText; @class NSToolbar; @class NSView; @class NSWindowController; @class NSCachedImageRep; @class GSWindowDecorationView; /* * Window levels are taken from MacOS-X * NSDesktopWindowLevel is copied from Window maker and is intended to be * the level at which things on the desktop sit ... so you should be able * to put a desktop background just below it. * FIXME: The hardcoded values here don't match the ones in Cocoa. * But we cannot change them easily as the have to match the ones in Window maker. */ enum { NSDesktopWindowLevel = -1000, /* GNUstep addition */ // 2 NSNormalWindowLevel = 0, // 3 NSFloatingWindowLevel = 3, // 4 NSSubmenuWindowLevel = 3, // 5 NSTornOffMenuWindowLevel = 3, // 5 NSMainMenuWindowLevel = 20, // 7 NSDockWindowLevel = 21, /* Deprecated - use NSStatusWindowLevel */ // 6 NSStatusWindowLevel = 21, // 8 NSModalPanelWindowLevel = 100, // 9 NSPopUpMenuWindowLevel = 101, // 10 NSScreenSaverWindowLevel = 1000 // 12 }; enum { NSBorderlessWindowMask = 0, NSTitledWindowMask = 1, NSClosableWindowMask = 2, NSMiniaturizableWindowMask = 4, NSResizableWindowMask = 8, #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) NSTexturedBackgroundWindowMask = 256, #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) NSUnscaledWindowMask = 2048, NSUnifiedTitleAndToolbarWindowMask = 4096, #endif NSIconWindowMask = 64, /* GNUstep extension - app icon window */ NSMiniWindowMask = 128 /* GNUstep extension - miniwindows */ }; enum _NSSelectionDirection { NSDirectSelection, NSSelectingNext, NSSelectingPrevious }; typedef NSUInteger NSSelectionDirection; #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) enum _NSWindowButton { NSWindowCloseButton = 0, NSWindowMiniaturizeButton, NSWindowZoomButton, NSWindowToolbarButton, NSWindowDocumentIconButton }; typedef NSUInteger NSWindowButton; #endif APPKIT_EXPORT NSSize NSIconSize; APPKIT_EXPORT NSSize NSTokenSize; /** *

An NSWindow instance represents a window, panel or menu on the * screen.
* Each window has a style, which determines how the window is decorated: * ie whether it has a border, a title bar, a resize bar, minimise and * close buttons. *

*

A window has a frame. This is the frame of the entire * window on the screen, including all decorations and borders. The origin * of the frame represents its bottom left corner and the frame is expressed * in screen coordinates (see [NSScreen]). *

*

When a window is created, it has a private [NSView] instance * which fills the entire window frame and whose coordinate system is the * same as the base coordinate system of the window (ie zero x and * y coordinates are at the bottom left corner of the window, with increasing * x and y corresponding to points to the right and above the origin).
* This view may be used by the library internals (and theme engines) to * draw window decorations if the backend library is not handling the * window decorations. *

*

A window always contains a content view which is the highest * level view available for public (application) use. This view fills the * area of the window inside any decoration/border.
* This is the only part of the window that application programmers are * allowed to draw in directly. *

*

You can convert between view coordinates and window base coordinates * using the [NSView-convertPoint:fromView:], [NSView-convertPoint:toView:], * [NSView-convertRect:fromView:], and [NSView-convertRect:toView:] * methods with a nil view argument.
* You can convert between window and screen coordinates using the * -convertBaseToScreen: and -convertScreenToBase: methods. *

*/ @interface NSWindow : NSResponder { NSRect _frame; NSSize _minimumSize; NSSize _maximumSize; NSSize _increments; NSString *_autosaveName; GSWindowDecorationView *_wv; id _contentView; id _firstResponder; id _futureFirstResponder; NSView *_initialFirstResponder; PACKAGE_SCOPE id _delegate; @protected id _fieldEditor; id _lastLeftMouseDownView; id _lastRightMouseDownView; id _lastOtherMouseDownView; id _lastDragView; NSInteger _lastDragOperationMask; NSInteger _windowNum; NSInteger _gstate; id _defaultButtonCell; NSGraphicsContext *_context; NSScreen *_screen; NSColor *_backgroundColor; NSString *_representedFilename; NSString *_miniaturizedTitle; NSImage *_miniaturizedImage; NSString *_windowTitle; PACKAGE_SCOPE NSPoint _lastPoint; @protected NSBackingStoreType _backingType; NSUInteger _styleMask; NSInteger _windowLevel; PACKAGE_SCOPE NSRect _rectNeedingFlush; NSMutableArray *_rectsBeingDrawn; @protected unsigned _disableFlushWindow; NSWindowDepth _depthLimit; NSWindowController *_windowController; NSInteger _counterpart; CGFloat _alphaValue; NSMutableArray *_children; NSWindow *_parent; NSCachedImageRep *_cachedImage; NSPoint _cachedImageOrigin; NSWindow *_attachedSheet; PACKAGE_SCOPE struct GSWindowFlagsType { unsigned accepts_drag:1; unsigned is_one_shot:1; unsigned needs_flush:1; unsigned is_autodisplay:1; unsigned optimize_drawing:1; unsigned dynamic_depth_limit:1; unsigned cursor_rects_enabled:1; unsigned cursor_rects_valid:1; unsigned visible:1; unsigned is_key:1; unsigned is_main:1; unsigned is_edited:1; unsigned is_released_when_closed:1; unsigned is_miniaturized:1; unsigned menu_exclude:1; unsigned hides_on_deactivate:1; unsigned accepts_mouse_moved:1; unsigned has_opened:1; unsigned has_closed:1; unsigned default_button_cell_key_disabled:1; unsigned can_hide:1; unsigned has_shadow:1; unsigned is_opaque:1; unsigned views_need_display:1; // 3 bits reserved for subclass use unsigned subclass_bool_one: 1; unsigned subclass_bool_two: 1; unsigned subclass_bool_three: 1; unsigned selectionDirection: 2; unsigned displays_when_screen_profile_changes: 1; unsigned is_movable_by_window_background: 1; unsigned allows_tooltips_when_inactive: 1; // 4 used 28 available unsigned shows_toolbar_button: 1; unsigned autorecalculates_keyview_loop: 1; unsigned ignores_mouse_events: 1; unsigned preserves_content_during_live_resize: 1; } _f; @protected NSToolbar *_toolbar; void *_reserved_1; } /* * Class methods */ /* * Computing frame and content rectangles */ /** * Returns the rectangle which would be used for the content view of * a window whose on-screen size and position is specified by aRect * and which is decorated with the border and title etc given by aStyle.
* Both rectangles are expressed in screen coordinates. */ + (NSRect) contentRectForFrameRect: (NSRect)aRect styleMask: (NSUInteger)aStyle; /** * Returns the rectangle which would be used for the on-screen frame of * a window if that window had a content view occupying the rectangle aRect * and was decorated with the border and title etc given by aStyle.
* Both rectangles are expressed in screen coordinates. */ + (NSRect) frameRectForContentRect: (NSRect)aRect styleMask: (NSUInteger)aStyle; /** * Returns the smallest frame width that will fit the given title * and style. This is the on-screen width of the window including * decorations. */ + (CGFloat) minFrameWidthWithTitle: (NSString *)aTitle styleMask: (NSUInteger)aStyle; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (NSRect) contentRectForFrameRect: (NSRect)frameRect; - (NSRect) frameRectForContentRect: (NSRect)contentRect; #endif /* * Initializing and getting a new NSWindow object */ - (id) initWithContentRect: (NSRect)contentRect styleMask: (NSUInteger)aStyle backing: (NSBackingStoreType)bufferingType defer: (BOOL)flag; /** * Creates a new window with the specified characteristics.
* The contentRect is expressed in screen coordinates (for aScreen) * and the window frame is calculated from the content rectangle and * the window style mask. */ - (id) initWithContentRect: (NSRect)contentRect styleMask: (NSUInteger)aStyle backing: (NSBackingStoreType)bufferingType defer: (BOOL)flag screen: (NSScreen*)aScreen; /** * Converts aPoint from the base coordinate system of the receiver * to a point in the screen coordinate system. */ - (NSPoint) convertBaseToScreen: (NSPoint)aPoint; /** * Converts aPoint from the screen coordinate system to a point in * the base coordinate system of the receiver. */ - (NSPoint) convertScreenToBase: (NSPoint)aPoint; /** * Converts aRect from the coordinate system of the screen * to the coordinate system of the window. */ - (NSRect) convertRectFromScreen: (NSRect)aRect; /** * Converts aRect from the window coordinate system to a rect in * the screen coordinate system. */ - (NSRect) convertRectToScreen: (NSRect)aRect; /** * Returns the frame of the receiver ... the rectangular area that the window * (including any border, title, and other decorations) occupies on screen. */ - (NSRect) frame; /** *

Sets the frame for the receiver to frameRect and if flag is YES causes * the window contents to be refreshed. The value of frameRect is the * desired on-screen size and position of the window including all * border/decoration. *

*

The size of the frame is constrained to the minimum and maximum * sizes set for the receiver (if any).
* Its position is constrained to be on screen if it is a titled window. *

*/ - (void) setFrame: (NSRect)frameRect display: (BOOL)flag; /** * Sets the origin (bottom left corner) of the receiver's frame to be the * specified point (in screen coordinates). */ - (void) setFrameOrigin: (NSPoint)aPoint; /** * Sets the top left corner of the receiver's frame to be the * specified point (in screen coordinates). */ - (void) setFrameTopLeftPoint: (NSPoint)aPoint; /** * Sets the size of the receiver's content view to aSize, implicitly * adjusting the size of the receiver's frame to match. */ - (void) setContentSize: (NSSize)aSize; /** * Positions the receiver at topLeftPoint (or if topLeftPoint is NSZeroPoint, * leaves the receiver unmoved except for any necessary constraint to fit * on screen).
* Returns the position of the top left corner of the receivers content * view (after repositioning), so that another window cascaded at the * returned point will not obscure the title bar of the receiver. */ - (NSPoint) cascadeTopLeftFromPoint: (NSPoint)topLeftPoint; - (void) center; - (NSInteger) resizeFlags; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void) setFrame: (NSRect)frameRect display: (BOOL)displayFlag animate: (BOOL)animationFlag; - (NSTimeInterval) animationResizeTime: (NSRect)newFrame; - (void) performZoom: (id)sender; - (void) zoom: (id)sender; - (BOOL) isZoomed; - (BOOL) showsResizeIndicator; - (void) setShowsResizeIndicator: (BOOL)show; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (BOOL) preservesContentDuringLiveResize; - (void) setPreservesContentDuringLiveResize: (BOOL)flag; #endif /* * Constraining size */ - (NSSize) minSize; - (NSSize) maxSize; - (void) setMinSize: (NSSize)aSize; - (void) setMaxSize: (NSSize)aSize; - (NSRect) constrainFrameRect: (NSRect)frameRect toScreen: (NSScreen*)screen; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (NSSize) aspectRatio; - (void) setAspectRatio: (NSSize)ratio; - (NSSize) resizeIncrements; - (void) setResizeIncrements: (NSSize)aSize; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (NSSize) contentMaxSize; - (void) setContentMaxSize: (NSSize)size; - (NSSize) contentMinSize; - (void) setContentMinSize: (NSSize)size; - (NSSize) contentAspectRatio; - (void) setContentAspectRatio: (NSSize)ratio; - (NSSize) contentResizeIncrements; - (void) setContentResizeIncrements: (NSSize)increments; #endif /* * Saving and restoring the frame */ + (void) removeFrameUsingName: (NSString*)name; - (NSString*) frameAutosaveName; - (void) saveFrameUsingName: (NSString*)name; - (BOOL) setFrameAutosaveName: (NSString*)name; - (void) setFrameFromString: (NSString*)string; - (BOOL) setFrameUsingName: (NSString*)name; - (NSString*) stringWithSavedFrame; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (BOOL) setFrameUsingName: (NSString *)name force: (BOOL)force; #endif /* * Window status and ordering */ - (void) orderBack: sender; - (void) orderFront: sender; - (void) orderFrontRegardless; - (void) orderOut: (id)sender; - (void) orderWindow: (NSWindowOrderingMode)place relativeTo: (NSInteger)otherWin; - (BOOL) isVisible; - (NSInteger) level; - (void) setLevel: (NSInteger)newLevel; - (void) becomeKeyWindow; - (void) becomeMainWindow; - (BOOL) canBecomeKeyWindow; - (BOOL) canBecomeMainWindow; - (BOOL) isKeyWindow; - (BOOL) isMainWindow; - (void) makeKeyAndOrderFront: (id)sender; - (void) makeKeyWindow; - (void) makeMainWindow; - (void) resignKeyWindow; - (void) resignMainWindow; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (NSButtonCell*) defaultButtonCell; - (void) setDefaultButtonCell: (NSButtonCell*)aCell; - (void) disableKeyEquivalentForDefaultButtonCell; - (void) enableKeyEquivalentForDefaultButtonCell; #endif /* * Managing the display */ - (void) display; - (void) displayIfNeeded; - (BOOL) isAutodisplay; - (void) setAutodisplay: (BOOL)flag; - (void) setViewsNeedDisplay: (BOOL)flag; - (void) update; - (void) useOptimizedDrawing: (BOOL)flag; - (BOOL) viewsNeedDisplay; - (BOOL) isFlushWindowDisabled; - (void) disableFlushWindow; - (void) enableFlushWindow; - (void) flushWindow; - (void) flushWindowIfNeeded; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void) cacheImageInRect: (NSRect)aRect; - (void) discardCachedImage; - (void) restoreCachedImage; #endif /* * Window device attributes */ - (NSInteger) windowNumber; - (NSInteger) gState; - (NSDictionary*) deviceDescription; - (NSBackingStoreType) backingType; - (void) setBackingType: (NSBackingStoreType)type; - (BOOL) isOneShot; - (void) setOneShot: (BOOL)flag; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (NSGraphicsContext*) graphicsContext; - (CGFloat) userSpaceScaleFactor; #endif /* * Screens and window depths */ + (NSWindowDepth) defaultDepthLimit; - (BOOL) canStoreColor; - (NSWindowDepth) depthLimit; - (BOOL) hasDynamicDepthLimit; - (void) setDepthLimit: (NSWindowDepth)limit; - (void) setDynamicDepthLimit: (BOOL)flag; - (NSScreen*) deepestScreen; - (NSScreen*) screen; - (NSResponder*) firstResponder; /** * This method attempts to make aResponder the first responder.
* If aResponder is already the first responder, this method has no * effect and simply returns YES. * Otherwise, the method sends a -resignFirstResponder message to the * current first responder (if there is one) and immediately returns NO if * the current first responder refuses to resign.
* Then the method asks aResponder to become first responder by sending * it a -becomeFirstResponder message, and if that returns YES then this * method immediately returns YES.
* However, if that returns NO, the receiver is made the first responder by * sending it a -becomeFirstResponder message, and this method returns NO.
* If aResponder is neither nil nor an instance of NSResponder (or of a * subclass of NSResponder) then behavior is undefined (though the current * GNUstep implementation just returns NO). */ - (BOOL) makeFirstResponder: (NSResponder*)aResponder; /* * Aiding event handling */ - (NSEvent*) currentEvent; - (NSEvent*) nextEventMatchingMask: (NSUInteger)mask; - (NSEvent*) nextEventMatchingMask: (NSUInteger)mask untilDate: (NSDate*)expiration inMode: (NSString*)mode dequeue: (BOOL)deqFlag; - (void) discardEventsMatchingMask: (NSUInteger)mask beforeEvent: (NSEvent*)lastEvent; - (void) postEvent: (NSEvent*)event atStart: (BOOL)flag; - (void) sendEvent: (NSEvent*)theEvent; - (BOOL) tryToPerform: (SEL)anAction with: (id)anObject; - (void) keyDown: (NSEvent*)theEvent; - (NSPoint) mouseLocationOutsideOfEventStream; - (BOOL) acceptsMouseMovedEvents; - (void) setAcceptsMouseMovedEvents: (BOOL)flag; #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) - (BOOL) ignoresMouseEvents; - (void) setIgnoresMouseEvents: (BOOL)flag; #endif /* * The field editor */ - (void) endEditingFor: anObject; - (NSText*) fieldEditor: (BOOL)createFlag forObject: (id)anObject; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (NSView*) initialFirstResponder; - (NSSelectionDirection) keyViewSelectionDirection; - (void) selectKeyViewFollowingView: (NSView*)aView; - (void) selectKeyViewPrecedingView: (NSView*)aView; - (void) selectNextKeyView: (id)sender; - (void) selectPreviousKeyView: (id)sender; - (void) setInitialFirstResponder: (NSView*)aView; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (BOOL) autorecalculatesKeyViewLoop; - (void) setAutorecalculatesKeyViewLoop: (BOOL)flag; - (void) recalculateKeyViewLoop; #endif /* * Window graphics */ - (NSString*) representedFilename; - (void) setRepresentedFilename: (NSString*)aString; - (void) setTitle: (NSString*)aString; - (void) setTitleWithRepresentedFilename: (NSString*)aString; - (NSString*) title; - (BOOL) isDocumentEdited; - (void) setDocumentEdited: (BOOL)flag; /* * Handling user actions and events */ - (void) close; - (void) performClose: (id)sender; - (void) setReleasedWhenClosed: (BOOL)flag; - (BOOL) isReleasedWhenClosed; - (void) deminiaturize: (id)sender; - (void) miniaturize: (id)sender; - (void) performMiniaturize: (id)sender; - (BOOL) isMiniaturized; /* * The miniwindow */ - (NSImage*) miniwindowImage; - (NSString*) miniwindowTitle; - (void) setMiniwindowImage: (NSImage*)image; - (void) setMiniwindowTitle: (NSString*)title; #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) - (NSWindow*) counterpart; #endif #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) + (void) menuChanged: (NSMenu*)aMenu; #endif /* * Windows menu support */ - (BOOL) isExcludedFromWindowsMenu; - (void) setExcludedFromWindowsMenu: (BOOL)flag; /* * Cursor management */ - (BOOL) areCursorRectsEnabled; - (void) disableCursorRects; - (void) discardCursorRects; - (void) enableCursorRects; - (void) invalidateCursorRectsForView: (NSView*)aView; - (void) resetCursorRects; /* * Dragging */ - (void) dragImage: (NSImage*)anImage at: (NSPoint)baseLocation offset: (NSSize)initialOffset event: (NSEvent*)event pasteboard: (NSPasteboard*)pboard source: sourceObject slideBack: (BOOL)slideFlag; - (void) registerForDraggedTypes: (NSArray*)newTypes; - (void) unregisterDraggedTypes; - (BOOL) hidesOnDeactivate; - (void) setHidesOnDeactivate: (BOOL)flag; - (BOOL) worksWhenModal; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void) setCanHide: (BOOL)flag; - (BOOL) canHide; #endif /* * Accessing the content view */ - (id) contentView; - (void) setContentView: (NSView*)aView; - (void) setBackgroundColor: (NSColor*)color; - (NSColor*) backgroundColor; - (NSUInteger) styleMask; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void) setHasShadow: (BOOL)hasShadow; - (BOOL) hasShadow; - (void) setAlphaValue: (CGFloat)windowAlpha; - (CGFloat) alphaValue; - (void) setOpaque: (BOOL)isOpaque; - (BOOL) isOpaque; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) - (void) invalidateShadow; #endif /* * Services menu support */ - (id) validRequestorForSendType: (NSString*)sendType returnType: (NSString*)returnType; /* * Printing and postscript */ - (void) fax: (id)sender; - (void) print: (id)sender; - (NSData*) dataWithEPSInsideRect: (NSRect)rect; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (NSData*) dataWithPDFInsideRect:(NSRect)aRect; #endif /* * Assigning a delegate */ - (id) delegate; - (void) setDelegate: (id)anObject; /* * The window controller */ - (void) setWindowController: (NSWindowController*)windowController; - (id) windowController; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (NSArray *) drawers; - (id) initWithWindowRef: (void *)windowRef; - (void *)windowRef; - (void*) windowHandle; #endif /* * Window butons */ #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) + (NSButton *) standardWindowButton: (NSWindowButton)button forStyleMask: (NSUInteger) mask; - (NSButton *) standardWindowButton: (NSWindowButton)button; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (BOOL) showsToolbarButton; - (void) setShowsToolbarButton: (BOOL)flag; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) - (NSArray *) childWindows; - (void) addChildWindow: (NSWindow *)child ordered: (NSWindowOrderingMode)place; - (void) removeChildWindow: (NSWindow *)child; - (NSWindow *) parentWindow; - (void) setParentWindow: (NSWindow *)window; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (BOOL) allowsToolTipsWhenApplicationIsInactive; - (void) setAllowsToolTipsWhenApplicationIsInactive: (BOOL)flag; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) - (BOOL) isMovableByWindowBackground; - (void) setMovableByWindowBackground: (BOOL)flag; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (BOOL) displaysWhenScreenProfileChanges; - (void) setDisplaysWhenScreenProfileChanges: (BOOL)flag; #endif @end @class NSToolbar; @interface NSWindow (Toolbar) - (void) runToolbarCustomizationPalette: (id)sender; - (void) toggleToolbarShown: (id)sender; - (NSToolbar *) toolbar; - (void) setToolbar: (NSToolbar*)toolbar; @end #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) /* * GNUstep backend methods */ @interface NSWindow (GNUstepBackend) /* * Mouse capture/release */ - (void) _captureMouse: (id)sender; - (void) _releaseMouse: (id)sender; /* * Allow subclasses to init without the backend class * attempting to create an actual window */ - (void) _initDefaults; /* * Let backend set window visibility. */ - (void) _setVisible: (BOOL)flag; @end #endif #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) @interface NSWindow (GNUstepTextView) /* * Called from NSTextView's resignFirstResponder to know which is * the next first responder. */ - (id) _futureFirstResponder; @end #endif /* * Implemented by the delegate */ #ifdef GNUSTEP @protocol NSWindowDelegate #ifdef __OBJC2__ @optional #else @end @interface NSObject (NSWindowDelegate) #endif - (BOOL) windowShouldClose: (id)sender; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void) windowWillBeginSheet: (NSNotification*)aNotification; - (void) windowDidEndSheet: (NSNotification*)aNotification; - (BOOL) windowShouldZoom: (NSWindow*)sender toFrame: (NSRect)aFrame; - (NSUndoManager*) windowWillReturnUndoManager: (NSWindow*)sender; - (NSRect) windowWillUseStandardFrame: (NSWindow*)sender defaultFrame: (NSRect)aFrame; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (NSRect) window: (NSWindow *)window willPositionSheet: (NSWindow *)sheet usingRect: (NSRect)rect; #endif - (NSSize) windowWillResize: (NSWindow*)sender toSize: (NSSize)frameSize; - (id) windowWillReturnFieldEditor: (NSWindow*)sender toObject: (id)client; - (void) windowDidBecomeKey: (NSNotification*)aNotification; - (void) windowDidBecomeMain: (NSNotification*)aNotification; - (void) windowDidChangeScreen: (NSNotification*)aNotification; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (void) windowDidChangeScreenProfile: (NSNotification *)aNotification; #endif - (void) windowDidDeminiaturize: (NSNotification*)aNotification; - (void) windowDidExpose: (NSNotification*)aNotification; - (void) windowDidMiniaturize: (NSNotification*)aNotification; - (void) windowDidMove: (NSNotification*)aNotification; - (void) windowDidResignKey: (NSNotification*)aNotification; - (void) windowDidResignMain: (NSNotification*)aNotification; - (void) windowDidResize: (NSNotification*)aNotification; - (void) windowDidUpdate: (NSNotification*)aNotification; - (void) windowWillClose: (NSNotification*)aNotification; - (void) windowWillMiniaturize: (NSNotification*)aNotification; - (void) windowWillMove: (NSNotification*)aNotification; @end #endif @interface NSObject (NSWindowDelegateAdditions) #if OS_API_VERSION(MAC_OS_X_VERSION_10_1, GS_API_LATEST) - (NSWindow *) attachedSheet; #endif @end /* Notifications */ APPKIT_EXPORT NSString *NSWindowDidBecomeKeyNotification; APPKIT_EXPORT NSString *NSWindowDidBecomeMainNotification; APPKIT_EXPORT NSString *NSWindowDidChangeScreenNotification; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) APPKIT_EXPORT NSString *NSWindowDidChangeScreenProfileNotification; #endif APPKIT_EXPORT NSString *NSWindowDidDeminiaturizeNotification; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) APPKIT_EXPORT NSString *NSWindowDidEndSheetNotification; #endif APPKIT_EXPORT NSString *NSWindowDidExposeNotification; APPKIT_EXPORT NSString *NSWindowDidMiniaturizeNotification; APPKIT_EXPORT NSString *NSWindowDidMoveNotification; APPKIT_EXPORT NSString *NSWindowDidResignKeyNotification; APPKIT_EXPORT NSString *NSWindowDidResignMainNotification; APPKIT_EXPORT NSString *NSWindowDidResizeNotification; APPKIT_EXPORT NSString *NSWindowDidUpdateNotification; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) APPKIT_EXPORT NSString *NSWindowWillBeginSheetNotification; #endif APPKIT_EXPORT NSString *NSWindowWillCloseNotification; APPKIT_EXPORT NSString *NSWindowWillMiniaturizeNotification; APPKIT_EXPORT NSString *NSWindowWillMoveNotification; #endif /* _GNUstep_H_NSWindow */ gnustep-gui-0.24.0/Headers/AppKit/NSNib.h0000664000076500007650000000526011354327034017634 0ustar brains99brains99/** NSNib.h This class serves as a container for a nib file. It's possible to load a nib file from a URL or from a bundle. Using this class the nib file can now be "preloaded" and instantiated multiple times when/if needed. Also, since it's possible to initialize this class using a NSURL it's possible to load nib files from remote locations. This class uses: NSNibOwner and NSNibTopLevelObjects to allow the caller to specify the owner of the nib during instantiation and receive an array containing the top level objects of the nib file. Copyright (C) 2004 Free Software Foundation, Inc. Author: Gregory John Casamento Date: 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSNib #define _GNUstep_H_NSNib #import #import #import #import @class NSData; @class NSDictionary; @class NSString; @class NSBundle; @class NSURL; @class NSArray; @class NSMutableArray; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) APPKIT_EXPORT NSString *NSNibTopLevelObjects; APPKIT_EXPORT NSString *NSNibOwner; #endif @interface NSNib : NSObject { NSData *_nibData; id _loader; NSURL *_url; NSBundle *_bundle; } // reading the data... - (id)initWithContentsOfURL: (NSURL *)nibFileURL; - (id)initWithNibNamed: (NSString *)nibNamed bundle: (NSBundle *)bundle; // instantiating the nib. - (BOOL)instantiateNibWithExternalNameTable: (NSDictionary *)externalNameTable; - (BOOL)instantiateNibWithOwner: (id)owner topLevelObjects: (NSArray **)topLevelObjects; #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) - (BOOL)instantiateNibWithExternalNameTable: (NSDictionary *)externalNameTable withZone: (NSZone *)zone; #endif @end #endif /* _GNUstep_H_NSNib */ gnustep-gui-0.24.0/Headers/AppKit/NSCustomImageRep.h0000664000076500007650000000262711352512421022006 0ustar brains99brains99/* NSCustomImageRep.h Custom image representation. Copyright (C) 1996 Free Software Foundation, Inc. Written by: Adam Fedor Date: Feb 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSCustomImageRep #define _GNUstep_H_NSCustomImageRep #import #import @interface NSCustomImageRep : NSImageRep { // Attributes id _delegate; SEL _selector; } - (id)initWithDrawSelector:(SEL)aSelector delegate:(id)anObject; // // Identifying the Object // - (id)delegate; - (SEL)drawSelector; @end #endif // _GNUstep_H_NSCustomImageRep gnustep-gui-0.24.0/Headers/AppKit/NSDataLinkManager.h0000664000076500007650000001063711352512421022104 0ustar brains99brains99/* NSDataLinkManager.h Manager of a NSDataLink Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSDataLinkManager #define _GNUstep_H_NSDataLinkManager #import #import @class NSString; @class NSEnumerator; @class NSMutableArray; @class NSDataLink; @class NSSelection; @class NSPasteboard; @class NSWindow; @interface NSDataLinkManager : NSObject { // Attributes id delegate; NSString *filename; NSMutableArray *sourceLinks; NSMutableArray *destinationLinks; struct __dlmFlags { unsigned areLinkOutlinesVisible:1; unsigned delegateVerifiesLinks:1; unsigned interactsWithUser:1; unsigned isEdited:1; } _flags; } // // Initializing and Freeing a Link Manager // - (id)initWithDelegate:(id)anObject; - (id)initWithDelegate:(id)anObject fromFile:(NSString *)path; // // Adding and Removing Links // - (BOOL)addLink:(NSDataLink *)link at:(NSSelection *)selection; - (BOOL)addLinkAsMarker:(NSDataLink *)link at:(NSSelection *)selection; - (NSDataLink *)addLinkPreviouslyAt:(NSSelection *)oldSelection fromPasteboard:(NSPasteboard *)pasteboard at:(NSSelection *)selection; - (void)breakAllLinks; - (void)writeLinksToPasteboard:(NSPasteboard *)pasteboard; // // Informing the Link Manager of Document Status // - (void)noteDocumentClosed; - (void)noteDocumentEdited; - (void)noteDocumentReverted; - (void)noteDocumentSaved; - (void)noteDocumentSavedAs:(NSString *)path; - (void)noteDocumentSavedTo:(NSString *)path; // // Getting and Setting Information about the Link Manager // - (id)delegate; - (BOOL)delegateVerifiesLinks; - (NSString *)filename; - (BOOL)interactsWithUser; - (BOOL)isEdited; - (void)setDelegateVerifiesLinks:(BOOL)flag; - (void)setInteractsWithUser:(BOOL)flag; // // Getting and Setting Information about the Manager's Links // - (BOOL)areLinkOutlinesVisible; - (NSEnumerator *)destinationLinkEnumerator; - (NSDataLink *)destinationLinkWithSelection:(NSSelection *)destSel; - (void)setLinkOutlinesVisible:(BOOL)flag; - (NSEnumerator *)sourceLinkEnumerator; @end // // Methods Implemented by the Delegate // @interface NSObject (NSDataLinkManagerDelegate) // data link management methods. - (void)dataLinkManager:(NSDataLinkManager *)sender didBreakLink:(NSDataLink *)link; - (BOOL)dataLinkManager:(NSDataLinkManager *)sender isUpdateNeededForLink:(NSDataLink *)link; - (void)dataLinkManager:(NSDataLinkManager *)sender startTrackingLink:(NSDataLink *)link; - (void)dataLinkManager:(NSDataLinkManager *)sender stopTrackingLink:(NSDataLink *)link; - (void)dataLinkManagerCloseDocument:(NSDataLinkManager *)sender; - (void)dataLinkManagerDidEditLinks:(NSDataLinkManager *)sender; - (void)dataLinkManagerRedrawLinkOutlines:(NSDataLinkManager *)sender; - (BOOL)dataLinkManagerTracksLinksIndividually:(NSDataLinkManager *)sender; // selection management methods. - (BOOL)copyToPasteboard:(NSPasteboard *)pasteboard at:(NSSelection *)selection cheapCopyAllowed:(BOOL)flag; - (BOOL)importFile:(NSString *)filename at:(NSSelection *)selection; - (BOOL)pasteFromPasteboard:(NSPasteboard *)pasteboard at:(NSSelection *)selection; - (BOOL)showSelection:(NSSelection *)selection; - (NSWindow *)windowForSelection:(NSSelection *)selection; @end // // Draw a Distinctive Outline around Linked Data // void NSFrameLinkRect(NSRect aRect, BOOL isDestination); float NSLinkFrameThickness(void); #endif // _GNUstep_H_NSDataLinkManager gnustep-gui-0.24.0/Headers/AppKit/NSMenuItemCell.h0000664000076500007650000000600512114437641021446 0ustar brains99brains99/* NSMenuItemCell.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Michael Hanni Date: June 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSMenuItemCell #define _GNUstep_H_NSMenuItemCell #import #import #import @class NSMenuView; typedef void (*DrawingIMP)(id, SEL, NSRect, NSView*); @interface NSMenuItemCell : NSButtonCell { NSMenuItem *_menuItem; NSMenuView *_menuView; /* If we belong to a popupbutton, we display image on the extreme right */ BOOL _mcell_belongs_to_popupbutton; // Cache BOOL _needs_sizing; BOOL _needs_display; char _pad[1]; CGFloat _imageWidth; CGFloat _titleWidth; CGFloat _keyEquivalentWidth; CGFloat _stateImageWidth; CGFloat _menuItemHeight; NSImage *_imageToDisplay; NSString *_titleToDisplay; NSSize _imageSize; } - (void)setHighlighted:(BOOL)flag; - (BOOL)isHighlighted; - (void)setMenuItem:(NSMenuItem *)item; - (NSMenuItem *)menuItem; - (void)setMenuView:(NSMenuView *)menuView; - (NSMenuView *)menuView; - (void)calcSize; - (void)setNeedsSizing:(BOOL)flag; - (BOOL)needsSizing; - (void)setNeedsDisplay:(BOOL)flag; - (BOOL)needsDisplay; - (CGFloat)imageWidth; - (CGFloat)titleWidth; - (CGFloat)keyEquivalentWidth; - (CGFloat)stateImageWidth; - (NSRect)imageRectForBounds:(NSRect)cellFrame; - (NSRect)keyEquivalentRectForBounds:(NSRect)cellFrame; - (NSRect)stateImageRectForBounds:(NSRect)cellFrame; - (NSRect)titleRectForBounds:(NSRect)cellFrame; - (void)drawBorderAndBackgroundWithFrame:(NSRect)cellFrame inView:(NSView *)controlView; - (void)drawImageWithFrame:(NSRect)cellFrame inView:(NSView *)controlView; - (void)drawKeyEquivalentWithFrame:(NSRect)cellFrame inView:(NSView *)controlView; - (void)drawSeparatorItemWithFrame:(NSRect)cellFrame inView:(NSView *)controlView; - (void)drawStateImageWithFrame:(NSRect)cellFrame inView:(NSView *)controlView; - (void)drawTitleWithFrame:(NSRect)cellFrame inView:(NSView *)controlView; @end #endif gnustep-gui-0.24.0/Headers/AppKit/NSAffineTransform.h0000664000076500007650000000475611602440254022215 0ustar brains99brains99/* NSAffineTransform.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: August 1997 Rewrite for MacOS-X compatibility: Richard Frith-Macdonald, 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSAffineTransform #define _GNUstep_H_NSAffineTransform #import #import @class NSBezierPath; @interface NSAffineTransform (GUIAdditions) - (void) concat; - (void) set; - (NSBezierPath*) transformBezierPath: (NSBezierPath*)aPath; @end #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) #if GS_API_VERSION(GS_API_NONE, 011500) @interface NSAffineTransform (GNUstep) - (void) translateToPoint: (NSPoint)point; - (void) scaleTo: (CGFloat)sx : (CGFloat)sy; - (void) makeIdentityMatrix; - (CGFloat) rotationAngle; - (void) setFrameOrigin: (NSPoint)point; - (void) setFrameRotation: (CGFloat)angle; /* Deprecated: use -invert */ - (void) inverse; - (BOOL) isRotated; - (void) boundingRectFor: (NSRect)rect result: (NSRect*)newRect; /* Returns anotherMatrix * self */ - (void) concatenateWith: (NSAffineTransform*)anotherMatrix; - (void) concatenateWithMatrix: (const float[6])anotherMatrix; - (NSPoint) pointInMatrixSpace: (NSPoint)point; - (NSPoint) deltaPointInMatrixSpace: (NSPoint)point; - (NSSize) sizeInMatrixSpace: (NSSize)size; - (NSRect) rectInMatrixSpace: (NSRect)rect; /* Deprecated: use -setTransformStruct: */ - (void) setMatrix: (const float[6])replace; /* Deprecated: use -transformStruct */ - (void) getMatrix: (float[6])replace; - (void) takeMatrixFromTransform: (NSAffineTransform *)aTransform; @end #endif #endif #endif /* _GNUstep_H_NSAffineTransform */ gnustep-gui-0.24.0/Headers/AppKit/NSWindowController.h0000664000076500007650000000553511354736316022453 0ustar brains99brains99/* NSWindowController.h The document controller class Copyright (C) 1999 Free Software Foundation, Inc. This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSWindowController #define _GNUstep_H_NSWindowController #import #import @class NSString; @class NSArray; @class NSWindow; @class NSDocument; @interface NSWindowController : NSResponder { @private NSWindow *_window; NSString *_window_nib_name; NSString *_window_nib_path; NSString *_window_frame_autosave_name; NSDocument *_document; NSArray *_top_level_objects; id _owner; struct ___wcFlags { unsigned int should_close_document:1; unsigned int should_cascade:1; unsigned int nib_is_loaded:1; unsigned int RESERVED:29; } _wcFlags; void *_reserved1; void *_reserved2; } - (id) initWithWindowNibName: (NSString *)windowNibName; // self is the owner - (id) initWithWindowNibName: (NSString *)windowNibName owner: (id)owner; - (id) initWithWindow: (NSWindow *)window; - (id) initWithWindowNibPath: (NSString *)windowNibPath owner: (id)owner; - (void) loadWindow; - (IBAction) showWindow: (id)sender; - (BOOL) isWindowLoaded; - (NSWindow *) window; - (void) setWindow: (NSWindow *)aWindow; - (void) windowDidLoad; - (void) windowWillLoad; - (void) setDocument: (NSDocument *)document; - (id) document; - (void) setDocumentEdited: (BOOL)flag; - (void) close; - (BOOL) shouldCloseDocument; - (void) setShouldCloseDocument: (BOOL)flag; - (id) owner; - (NSString *) windowNibName; - (NSString *) windowNibPath; - (BOOL) shouldCascadeWindows; - (void) setShouldCascadeWindows: (BOOL)flag; - (void) setWindowFrameAutosaveName: (NSString *)name; - (NSString *) windowFrameAutosaveName; - (NSString *) windowTitleForDocumentDisplayName: (NSString *)displayName; - (void) synchronizeWindowTitleWithDocumentName; @end #endif /* _GNUstep_H_NSWindowController */ gnustep-gui-0.24.0/Headers/AppKit/NSBezierPath.h0000664000076500007650000001727512102745434021172 0ustar brains99brains99/* The NSBezierPath class Copyright (C) 1999, 2005 Free Software Foundation, Inc. Author: Enrico Sersale Date: Dec 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef BEZIERPATH_H #define BEZIERPATH_H #import #import #import #import @class NSAffineTransform; @class NSImage; typedef enum { NSButtLineCapStyle = 0, NSRoundLineCapStyle = 1, NSSquareLineCapStyle = 2 } NSLineCapStyle; typedef enum { NSMiterLineJoinStyle = 0, NSRoundLineJoinStyle = 1, NSBevelLineJoinStyle = 2 } NSLineJoinStyle; /** A winding rule defines which points are considered inside and which points are considered outside a path. NSNonZeroWindingRule A point is inside the path iff the winding count at the point is non-zero. NSEvenOddWindingRule A point is inside the path iff the winding count at the point is odd. */ typedef enum { NSNonZeroWindingRule, NSEvenOddWindingRule } NSWindingRule; typedef enum { NSMoveToBezierPathElement, NSLineToBezierPathElement, NSCurveToBezierPathElement, NSClosePathBezierPathElement } NSBezierPathElement; @interface NSBezierPath : NSObject { @private NSWindingRule _windingRule; NSLineCapStyle _lineCapStyle; NSLineJoinStyle _lineJoinStyle; CGFloat _lineWidth; CGFloat _flatness; CGFloat _miterLimit; NSInteger _dash_count; CGFloat _dash_phase; CGFloat *_dash_pattern; NSRect _bounds; NSRect _controlPointBounds; NSImage *_cacheImage; #ifndef _IN_NSBEZIERPATH_M #define GSIArray void* #endif GSIArray _pathElements; #ifndef _IN_NSBEZIERPATH_M #undef GSIArray #endif BOOL _cachesBezierPath; BOOL _shouldRecalculateBounds; BOOL _flat; } // // Creating common paths // + (NSBezierPath *)bezierPath; + (NSBezierPath *)bezierPathWithRect:(NSRect)aRect; + (NSBezierPath *)bezierPathWithOvalInRect:(NSRect)aRect; #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) + (NSBezierPath *)bezierPathWithRoundedRect:(NSRect)aRect xRadius:(CGFloat)xRadius yRadius:(CGFloat)yRadius; #endif // // Immediate mode drawing of common paths // + (void)fillRect:(NSRect)aRect; /** Using default stroke color and default drawing attributes, strokes a rectangle using the specified rect. */ + (void)strokeRect:(NSRect)aRect; + (void)clipRect:(NSRect)aRect; /** Using default stroke color and default drawing attributes, draws a line between the two points specified. */ + (void)strokeLineFromPoint:(NSPoint)point1 toPoint:(NSPoint)point2; + (void)drawPackedGlyphs: (const char *)packedGlyphs atPoint: (NSPoint)aPoint; // // Default path rendering parameters // + (void)setDefaultMiterLimit:(CGFloat)limit; + (CGFloat)defaultMiterLimit; + (void)setDefaultFlatness:(CGFloat)flatness; + (CGFloat)defaultFlatness; + (void)setDefaultWindingRule:(NSWindingRule)windingRule; + (NSWindingRule)defaultWindingRule; + (void)setDefaultLineCapStyle:(NSLineCapStyle)lineCapStyle; + (NSLineCapStyle)defaultLineCapStyle; + (void)setDefaultLineJoinStyle:(NSLineJoinStyle)lineJoinStyle; + (NSLineJoinStyle)defaultLineJoinStyle; + (void)setDefaultLineWidth:(CGFloat)lineWidth; + (CGFloat)defaultLineWidth; // // Path construction // - (void)moveToPoint:(NSPoint)aPoint; - (void)lineToPoint:(NSPoint)aPoint; - (void)curveToPoint:(NSPoint)aPoint controlPoint1:(NSPoint)controlPoint1 controlPoint2:(NSPoint)controlPoint2; - (void)closePath; - (void)removeAllPoints; // // Relative path construction // - (void)relativeMoveToPoint:(NSPoint)aPoint; - (void)relativeLineToPoint:(NSPoint)aPoint; - (void)relativeCurveToPoint:(NSPoint)aPoint controlPoint1:(NSPoint)controlPoint1 controlPoint2:(NSPoint)controlPoint2; // // Path rendering parameters // - (CGFloat)lineWidth; - (void)setLineWidth:(CGFloat)lineWidth; - (NSLineCapStyle)lineCapStyle; - (void)setLineCapStyle:(NSLineCapStyle)lineCapStyle; - (NSLineJoinStyle)lineJoinStyle; - (void)setLineJoinStyle:(NSLineJoinStyle)lineJoinStyle; - (NSWindingRule)windingRule; - (void)setWindingRule:(NSWindingRule)windingRule; - (void)setFlatness:(CGFloat)flatness; - (CGFloat)flatness; - (void)setMiterLimit:(CGFloat)limit; - (CGFloat)miterLimit; - (void)getLineDash:(CGFloat *)pattern count:(NSInteger *)count phase:(CGFloat *)phase; - (void)setLineDash:(const CGFloat *)pattern count:(NSInteger)count phase:(CGFloat)phase; // // Path operations // - (void)stroke; - (void)fill; - (void)addClip; - (void)setClip; // // Path modifications. // - (NSBezierPath *)bezierPathByFlatteningPath; - (NSBezierPath *)bezierPathByReversingPath; // // Applying transformations. // - (void)transformUsingAffineTransform:(NSAffineTransform *)transform; // // Path info // - (BOOL)isEmpty; - (NSPoint)currentPoint; - (NSRect)controlPointBounds; - (NSRect)bounds; // // Elements // - (NSInteger)elementCount; - (NSBezierPathElement)elementAtIndex:(NSInteger)index associatedPoints:(NSPoint *)points; - (NSBezierPathElement)elementAtIndex:(NSInteger)index; - (void)setAssociatedPoints:(NSPoint *)points atIndex:(NSInteger)index; // // Appending common paths // - (void)appendBezierPath:(NSBezierPath *)aPath; - (void)appendBezierPathWithRect:(NSRect)aRect; - (void)appendBezierPathWithPoints:(NSPoint *)points count:(NSInteger)count; - (void)appendBezierPathWithOvalInRect:(NSRect)aRect; - (void)appendBezierPathWithArcWithCenter:(NSPoint)center radius:(CGFloat)radius startAngle:(CGFloat)startAngle endAngle:(CGFloat)endAngle clockwise:(BOOL)clockwise; - (void)appendBezierPathWithArcWithCenter:(NSPoint)center radius:(CGFloat)radius startAngle:(CGFloat)startAngle endAngle:(CGFloat)endAngle; - (void)appendBezierPathWithArcFromPoint:(NSPoint)point1 toPoint:(NSPoint)point2 radius:(CGFloat)radius; - (void)appendBezierPathWithGlyph:(NSGlyph)glyph inFont:(NSFont *)font; - (void)appendBezierPathWithGlyphs:(NSGlyph *)glyphs count:(NSInteger)count inFont:(NSFont *)font; - (void)appendBezierPathWithPackedGlyphs:(const char *)packedGlyphs; #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (void)appendBezierPathWithRoundedRect:(NSRect)aRect xRadius:(CGFloat)xRadius yRadius:(CGFloat)yRadius; #endif // // Hit detection // #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) /** Returns the winding count, according to the PostScript definition, at the given point. */ - (int) windingCountAtPoint: (NSPoint)point; #endif /** Returns YES iff the path contains, according to the current winding rule, the given point. */ - (BOOL)containsPoint:(NSPoint)point; // // Caching // - (BOOL)cachesBezierPath; - (void)setCachesBezierPath:(BOOL)flag; @end #endif // BEZIERPATH_H gnustep-gui-0.24.0/Headers/AppKit/NSScroller.h0000664000076500007650000000757312110256537020722 0ustar brains99brains99/* NSScroller.h The scroller class Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu A completely rewritten version of the original source by Scott Christley. Date: July 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSScroller #define _GNUstep_H_NSScroller #import #import #import @class NSEvent; enum _NSScrollArrowPosition { #if OS_API_VERSION(MAC_OS_X_VERSION_10_1, GS_API_LATEST) NSScrollerArrowsDefaultSetting = 0, #endif NSScrollerArrowsMaxEnd = 0, NSScrollerArrowsMinEnd, NSScrollerArrowsNone }; typedef NSUInteger NSScrollArrowPosition; enum _NSScrollerPart { NSScrollerNoPart = 0, NSScrollerDecrementPage, NSScrollerKnob, NSScrollerIncrementPage, NSScrollerDecrementLine, NSScrollerIncrementLine, NSScrollerKnobSlot }; typedef NSUInteger NSScrollerPart; enum _NSScrollerUsablePart { NSNoScrollerParts = 0, NSOnlyScrollerArrows, NSAllScrollerParts }; typedef NSUInteger NSUsableScrollerParts; enum _NSScrollerArrow { NSScrollerIncrementArrow = 0, NSScrollerDecrementArrow }; typedef NSUInteger NSScrollerArrow; @interface NSScroller : NSControl { double _doubleValue; CGFloat _knobProportion; CGFloat _pendingKnobProportion; id _target; SEL _action; NSScrollerPart _hitPart; NSScrollArrowPosition _arrowsPosition; NSUsableScrollerParts _usableParts; struct _scFlagsType { // total 7 bits. 25 bits left. unsigned isHorizontal: 1; unsigned isEnabled: 1; unsigned control_tint: 3; unsigned control_size: 2; } _scFlags; } // // Laying out the NSScroller // + (CGFloat)scrollerWidth; - (NSScrollArrowPosition)arrowsPosition; - (void)checkSpaceForParts; - (NSRect)rectForPart:(NSScrollerPart)partCode; - (void)setArrowsPosition:(NSScrollArrowPosition)where; - (NSUsableScrollerParts)usableParts; // // Setting the NSScroller's Values // - (CGFloat)knobProportion; #if OS_API_VERSION(GS_API_MACOSX, MAC_OS_X_VERSION_10_5) - (void)setFloatValue:(float)aFloat knobProportion:(CGFloat)ratio; #endif // // Displaying // - (void)drawArrow:(NSScrollerArrow)whichButton highlight:(BOOL)flag; - (void)drawKnobSlot; - (void)drawKnob; - (void)drawParts; - (void)highlight:(BOOL)flag; // // Handling Events // - (NSScrollerPart)hitPart; /* Return the part of the scroller which contains thePoint. thePoint * is in the window's coordinate system. */ - (NSScrollerPart)testPart:(NSPoint)thePoint; - (void)trackKnob:(NSEvent *)theEvent; - (void)trackScrollButtons:(NSEvent *)theEvent; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) + (CGFloat)scrollerWidthForControlSize:(NSControlSize)controlSize; - (void)setControlSize:(NSControlSize)controlSize; - (NSControlSize)controlSize; - (void)setControlTint:(NSControlTint)controlTint; - (NSControlTint)controlTint; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (void)setKnobProportion:(CGFloat)proportion; - (void)drawKnobSlotInRect:(NSRect)slotRect highlight:(BOOL)flag; #endif @end #endif // _GNUstep_H_NSScroller gnustep-gui-0.24.0/Headers/AppKit/NSSpellChecker.h0000664000076500007650000000626111354602172021471 0ustar brains99brains99/* NSSpellChecker.h Class which is interface to spell-checking service Copyright (C) 1996, 2001 Free Software Foundation, Inc. Author: Gregory John Casamento Date: 2001 Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSSpellChecker #define _GNUstep_H_NSSpellChecker #import #import @class NSProxy; @class NSString; @class NSArray; @class NSView; @class NSPanel; @class NSDictionary; @class NSMutableDictionary; @interface NSSpellChecker : NSObject { @private /* Non-GUI attributes */ id _serverProxy; NSString *_language; NSMutableDictionary *_ignoredWords; // Variables to keep state... int _position; int _currentTag; BOOL _wrapFlag; // GUI ... id _wordField; id _accessoryView; id _dictionaryPulldown; id _spellPanel; // Buttons... (so we can enable/disable, if necessary) id _learnButton; id _forgetButton; id _ignoreButton; id _guessButton; id _findNextButton; id _correctButton; } // // Making a Checker available // + (NSSpellChecker *)sharedSpellChecker; + (BOOL)sharedSpellCheckerExists; // // Managing the Spelling Panel // - (NSView *)accessoryView; - (void)setAccessoryView:(NSView *)aView; - (NSPanel *)spellingPanel; // // Checking Spelling // - (int)countWordsInString:(NSString *)aString language:(NSString *)language; - (NSRange)checkSpellingOfString:(NSString *)stringToCheck startingAt:(int)startingOffset; - (NSRange)checkSpellingOfString:(NSString *)stringToCheck startingAt:(int)startingOffset language:(NSString *)language wrap:(BOOL)wrapFlag inSpellDocumentWithTag:(int)tag wordCount:(int *)wordCount; - (NSArray *)guessesForWord:(NSString *)word; // // Setting the Language // - (NSString *)language; - (BOOL)setLanguage:(NSString *)aLanguage; // // Managing the Spelling Process // + (int)uniqueSpellDocumentTag; - (void)closeSpellDocumentWithTag:(int)tag; - (void)ignoreWord:(NSString *)wordToIgnore inSpellDocumentWithTag:(int)tag; - (NSArray *)ignoredWordsInSpellDocumentWithTag:(int)tag; - (void)setIgnoredWords:(NSArray *)someWords inSpellDocumentWithTag:(int)tag; - (void)setWordFieldStringValue:(NSString *)aString; - (void)updateSpellingPanelWithMisspelledWord:(NSString *)word; @end #endif // _GNUstep_H_NSSpellChecker gnustep-gui-0.24.0/Headers/AppKit/NSBitmapImageRep.h0000664000076500007650000002142312107547001021744 0ustar brains99brains99/* NSBitmapImageRep.h Bitmap image representations Copyright (C) 1996 Free Software Foundation, Inc. Written by: Adam Fedor Date: Feb 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSBitmapImageRep #define _GNUstep_H_NSBitmapImageRep #import #import @class NSArray; @class NSString; @class NSData; @class NSDictionary; @class NSMutableData; @class NSMutableDictionary; @class NSColor; /** Describes the type of compression used on an image. Possible compressions: NSTIFFCompressionNone; NSTIFFCompressionCCITTFAX3; NSTIFFCompressionCCITFAX4; NSTIFFCompressionLZW; NSTIFFCompressionJPEG; NSTIFFCompressionNEXT; NSTIFFCompressionPackBits. NSTIFFCompressionOldJPEG; */ typedef enum _NSTIFFCompression { NSTIFFCompressionNone = 1, NSTIFFCompressionCCITTFAX3 = 3, NSTIFFCompressionCCITTFAX4 = 4, NSTIFFCompressionLZW = 5, NSTIFFCompressionJPEG = 6, NSTIFFCompressionNEXT = 32766, NSTIFFCompressionPackBits = 32773, NSTIFFCompressionOldJPEG = 32865 } NSTIFFCompression; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) /** Type of image NSTIFFFileType; NSBMPFileType; Not implemented NSGIFFileType; NSJPEGFileType; NSPNGFileType; NSJPEG2000FileType. Not implemented */ typedef enum _NSBitmapImageFileType { NSTIFFFileType, NSBMPFileType, NSGIFFileType, NSJPEGFileType, NSPNGFileType, NSJPEG2000FileType // available in Mac OS X v10.4 } NSBitmapImageFileType; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) typedef enum _NSBitmapFormat { NSAlphaFirstBitmapFormat = 1, NSAlphaNonpremultipliedBitmapFormat = 2, NSFloatingPointSamplesBitmapFormat = 4 } NSBitmapFormat; typedef enum _NSImageRepLoadStatus { NSImageRepLoadStatusUnknownType = -1, NSImageRepLoadStatusReadingHeader = -2, NSImageRepLoadStatusWillNeedAllData = -3, NSImageRepLoadStatusInvalidData = -4, NSImageRepLoadStatusUnexpectedEOF = -5, NSImageRepLoadStatusCompleted = -6 } NSImageRepLoadStatus; #endif APPKIT_EXPORT NSString *NSImageCompressionMethod; // NSNumber; only for TIFF files APPKIT_EXPORT NSString *NSImageCompressionFactor; // NSNumber 0.0 to 255.0; only for JPEG files (GNUstep extension: JPEG-compressed TIFFs too) APPKIT_EXPORT NSString *NSImageDitherTranparency; // NSNumber boolean; only for writing GIF files APPKIT_EXPORT NSString *NSImageRGBColorTable; // NSData; only for reading & writing GIF files APPKIT_EXPORT NSString *NSImageInterlaced; // NSNumber boolean; only for writing PNG files APPKIT_EXPORT NSString *NSImageColorSyncProfileData; // Mac OX X only //APPKIT_EXPORT NSString *GSImageICCProfileData; // if & when color management comes to GNUstep APPKIT_EXPORT NSString *NSImageFrameCount; // NSNumber integer; only for reading animated GIF files APPKIT_EXPORT NSString *NSImageCurrentFrame; // NSNumber integer; only for animated GIF files APPKIT_EXPORT NSString *NSImageCurrentFrameDuration; // NSNumber float; only for reading animated GIF files APPKIT_EXPORT NSString *NSImageLoopCount; // NSNumber integer; only for reading animated GIF files APPKIT_EXPORT NSString *NSImageGamma; // NSNumber 0.0 to 1.0; only for reading & writing PNG files APPKIT_EXPORT NSString *NSImageProgressive; // NSNumber boolean; only for reading & writing JPEG files APPKIT_EXPORT NSString *NSImageEXIFData; // No GNUstep support yet; for reading & writing JPEG #endif @interface NSBitmapImageRep : NSImageRep { // Attributes NSInteger _bytesPerRow; NSInteger _numColors; NSInteger _bitsPerPixel; unsigned short _compression; float _comp_factor; NSMutableDictionary *_properties; BOOL _isPlanar; unsigned char **_imagePlanes; NSData *_imageData; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) NSBitmapFormat _format; #else unsigned int _format; #endif } // // Allocating and Initializing a New NSBitmapImageRep Object // + (id) imageRepWithData: (NSData*)imageData; + (NSArray*) imageRepsWithData: (NSData*)imageData; - (id) initWithData: (NSData*)imageData; - (id) initWithFocusedViewRect: (NSRect)rect; - (id) initWithBitmapDataPlanes: (unsigned char**)planes pixelsWide: (NSInteger)width pixelsHigh: (NSInteger)height bitsPerSample: (NSInteger)bitsPerSample samplesPerPixel: (NSInteger)samplesPerPixel hasAlpha: (BOOL)alpha isPlanar: (BOOL)isPlanar colorSpaceName: (NSString*)colorSpaceName bytesPerRow: (NSInteger)rowBytes bitsPerPixel: (NSInteger)pixelBits; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void)colorizeByMappingGray:(CGFloat)midPoint toColor:(NSColor *)midPointColor blackMapping:(NSColor *)shadowColor whiteMapping:(NSColor *)lightColor; - (id)initWithBitmapHandle:(void *)bitmap; - (id)initWithIconHandle:(void *)icon; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) - (NSInteger) incrementalLoadFromData: (NSData *)data complete: (BOOL)complete; - (id) initForIncrementalLoad; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (id) initWithBitmapDataPlanes: (unsigned char**)planes pixelsWide: (NSInteger)width pixelsHigh: (NSInteger)height bitsPerSample: (NSInteger)bps samplesPerPixel: (NSInteger)spp hasAlpha: (BOOL)alpha isPlanar: (BOOL)isPlanar colorSpaceName: (NSString*)colorSpaceName bitmapFormat: (NSBitmapFormat)bitmapFormat bytesPerRow: (NSInteger)rowBytes bitsPerPixel: (NSInteger)pixelBits; #endif // // Getting Information about the Image // - (NSInteger) bitsPerPixel; - (NSInteger) samplesPerPixel; - (BOOL) isPlanar; - (NSInteger) numberOfPlanes; - (NSInteger) bytesPerPlane; - (NSInteger) bytesPerRow; // // Getting Image Data // - (unsigned char*) bitmapData; - (void) getBitmapDataPlanes: (unsigned char**)data; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (NSBitmapFormat) bitmapFormat; - (void) getPixel: (NSUInteger[])pixelData atX: (NSInteger)x y: (NSInteger)y; - (void) setPixel: (NSUInteger[])pixelData atX: (NSInteger)x y: (NSInteger)y; - (NSColor*) colorAtX: (NSInteger)x y: (NSInteger)y; - (void) setColor: (NSColor*)color atX: (NSInteger)x y: (NSInteger)y; #endif // // Producing a TIFF Representation of the Image // + (NSData*) TIFFRepresentationOfImageRepsInArray: (NSArray*)anArray; + (NSData*) TIFFRepresentationOfImageRepsInArray: (NSArray*)anArray usingCompression: (NSTIFFCompression)type factor: (float)factor; - (NSData*) TIFFRepresentation; - (NSData*) TIFFRepresentationUsingCompression: (NSTIFFCompression)type factor: (float)factor; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) + (NSData *)representationOfImageRepsInArray:(NSArray *)imageReps usingType:(NSBitmapImageFileType)storageType properties:(NSDictionary *)properties; - (NSData *)representationUsingType:(NSBitmapImageFileType)storageType properties:(NSDictionary *)properties; #endif // // Setting and Checking Compression Types // + (void) getTIFFCompressionTypes: (const NSTIFFCompression**)list count: (NSInteger*)numTypes; + (NSString*) localizedNameForTIFFCompressionType: (NSTIFFCompression)type; - (BOOL) canBeCompressedUsing: (NSTIFFCompression)compression; - (void) getCompression: (NSTIFFCompression*)compression factor: (float*)factor; - (void) setCompression: (NSTIFFCompression)compression factor: (float)factor; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void)setProperty:(NSString *)property withValue:(id)value; - (id)valueForProperty:(NSString *)property; #endif @end @interface NSBitmapImageRep (GNUstepExtension) + (NSArray*) imageRepsWithFile: (NSString *)filename; @end #endif // _GNUstep_H_NSBitmapImageRep gnustep-gui-0.24.0/Headers/AppKit/NSSearchField.h0000664000076500007650000000257211354602172021277 0ustar brains99brains99/* NSSearchField.h Text field control class for text search Copyright (C) 1996 Free Software Foundation, Inc. Author: H. Nikolaus Schaller Date: Dec 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSSearchField #define _GNUstep_H_NSSearchField #import @interface NSSearchField : NSTextField - (NSArray *) recentSearches; - (NSString *) recentsAutosaveName; - (void) setRecentSearches: (NSArray *)searches; - (void) setRecentsAutosaveName: (NSString *)name; @end #endif /* _GNUstep_H_NSSearchField */ gnustep-gui-0.24.0/Headers/AppKit/NSGraphics.h0000664000076500007650000002505612165047414020673 0ustar brains99brains99/* NSGraphics.h Copyright (C) 1996, 2005 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __NSGraphics_h__ #define __NSGraphics_h__ #import #import #import #import #import #if defined(__cplusplus) extern "C" { #endif @class NSString; @class NSColor; @class NSGraphicsContext; /* * Colorspace Names */ APPKIT_EXPORT NSString *NSCalibratedWhiteColorSpace; APPKIT_EXPORT NSString *NSCalibratedBlackColorSpace; APPKIT_EXPORT NSString *NSCalibratedRGBColorSpace; APPKIT_EXPORT NSString *NSDeviceWhiteColorSpace; APPKIT_EXPORT NSString *NSDeviceBlackColorSpace; APPKIT_EXPORT NSString *NSDeviceRGBColorSpace; APPKIT_EXPORT NSString *NSDeviceCMYKColorSpace; APPKIT_EXPORT NSString *NSNamedColorSpace; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) APPKIT_EXPORT NSString *NSPatternColorSpace; #endif APPKIT_EXPORT NSString *NSCustomColorSpace; /* * Color function APPKIT_EXPORTs */ APPKIT_EXPORT const NSWindowDepth _GSGrayBitValue; APPKIT_EXPORT const NSWindowDepth _GSRGBBitValue; APPKIT_EXPORT const NSWindowDepth _GSCMYKBitValue; APPKIT_EXPORT const NSWindowDepth _GSCustomBitValue; APPKIT_EXPORT const NSWindowDepth _GSNamedBitValue; APPKIT_EXPORT const NSWindowDepth *_GSWindowDepths[7]; APPKIT_EXPORT const NSWindowDepth NSDefaultDepth; APPKIT_EXPORT const NSWindowDepth NSTwoBitGrayDepth; APPKIT_EXPORT const NSWindowDepth NSEightBitGrayDepth; APPKIT_EXPORT const NSWindowDepth NSEightBitRGBDepth; APPKIT_EXPORT const NSWindowDepth NSTwelveBitRGBDepth; APPKIT_EXPORT const NSWindowDepth GSSixteenBitRGBDepth; APPKIT_EXPORT const NSWindowDepth NSTwentyFourBitRGBDepth; /* * Gray Values */ APPKIT_EXPORT const CGFloat NSBlack; APPKIT_EXPORT const CGFloat NSDarkGray; APPKIT_EXPORT const CGFloat NSWhite; APPKIT_EXPORT const CGFloat NSLightGray; APPKIT_EXPORT const CGFloat NSGray; /* * Device Dictionary Keys */ APPKIT_EXPORT NSString *NSDeviceResolution; APPKIT_EXPORT NSString *NSDeviceColorSpaceName; APPKIT_EXPORT NSString *NSDeviceBitsPerSample; APPKIT_EXPORT NSString *NSDeviceIsScreen; APPKIT_EXPORT NSString *NSDeviceIsPrinter; APPKIT_EXPORT NSString *NSDeviceSize; /* * Get Information About Color Space and Window Depth */ APPKIT_EXPORT const NSWindowDepth *NSAvailableWindowDepths(void); APPKIT_EXPORT NSWindowDepth NSBestDepth(NSString *colorSpace, NSInteger bitsPerSample, NSInteger bitsPerPixel, BOOL planar, BOOL *exactMatch); APPKIT_EXPORT NSInteger NSBitsPerPixelFromDepth(NSWindowDepth depth); APPKIT_EXPORT NSInteger NSBitsPerSampleFromDepth(NSWindowDepth depth); APPKIT_EXPORT NSString *NSColorSpaceFromDepth(NSWindowDepth depth); APPKIT_EXPORT NSInteger NSNumberOfColorComponents(NSString *colorSpaceName); APPKIT_EXPORT BOOL NSPlanarFromDepth(NSWindowDepth depth); /* * Functions for getting information about windows. */ APPKIT_EXPORT void NSCountWindows(NSInteger *count); APPKIT_EXPORT void NSWindowList(NSInteger size, NSInteger list[]); APPKIT_EXPORT void NSEraseRect(NSRect aRect); APPKIT_EXPORT void NSHighlightRect(NSRect aRect); APPKIT_EXPORT void NSRectClip(NSRect aRect); APPKIT_EXPORT void NSRectClipList(const NSRect *rects, NSInteger count); APPKIT_EXPORT void NSRectFill(NSRect aRect); APPKIT_EXPORT void NSRectFillList(const NSRect *rects, NSInteger count); APPKIT_EXPORT void NSRectFillListWithGrays(const NSRect *rects, const CGFloat *grays, NSInteger count); /** Draws a set of edges of aRect. The sides array should contain count edges, and grays the corresponding color. Edges are drawn in the order given in the array, and subsequent edges are drawn inside previous edges (thus, they will never overlap). */ APPKIT_EXPORT NSRect NSDrawTiledRects(NSRect aRect, const NSRect clipRect, const NSRectEdge *sides, const CGFloat *grays, NSInteger count); APPKIT_EXPORT void NSDrawButton(const NSRect aRect, const NSRect clipRect); APPKIT_EXPORT void NSDrawGrayBezel(const NSRect aRect, const NSRect clipRect); APPKIT_EXPORT void NSDrawGroove(const NSRect aRect, const NSRect clipRect); APPKIT_EXPORT void NSDrawWhiteBezel(const NSRect aRect, const NSRect clipRect); APPKIT_EXPORT void NSDrawFramePhoto(const NSRect aRect, const NSRect clipRect); // This is from an old version of the specification static inline void NSDrawBezel(const NSRect aRect, const NSRect clipRect) { NSDrawGrayBezel(aRect, clipRect); } /** Draws a rectangle along the inside of aRect. The rectangle will be black, dotted (using 1 point dashes), and will have a line width of 1 point. */ APPKIT_EXPORT void NSDottedFrameRect(NSRect aRect); /**

Draws a rectangle using the current color along the inside of aRect. NSFrameRectWithWidth uses the frameWidth as the line width, while NSFrameRect always uses 1 point wide lines. The functions do not change the line width of the current graphics context.

'Inside' here means that no part of the stroked rectangle will extend outside the given rectangle.

*/ APPKIT_EXPORT void NSFrameRect(const NSRect aRect); APPKIT_EXPORT void NSFrameRectWithWidth(const NSRect aRect, CGFloat frameWidth); APPKIT_EXPORT void NSFrameRectWithWidthUsingOperation(const NSRect aRect, CGFloat frameWidth, NSCompositingOperation op); APPKIT_EXPORT NSColor* NSReadPixel(NSPoint location); APPKIT_EXPORT void NSCopyBitmapFromGState(int srcGstate, NSRect srcRect, NSRect destRect); APPKIT_EXPORT void NSCopyBits(NSInteger srcGstate, NSRect srcRect, NSPoint destPoint); APPKIT_EXPORT void NSDrawBitmap(NSRect rect, NSInteger pixelsWide, NSInteger pixelsHigh, NSInteger bitsPerSample, NSInteger samplesPerPixel, NSInteger bitsPerPixel, NSInteger bytesPerRow, BOOL isPlanar, BOOL hasAlpha, NSString *colorSpaceName, const unsigned char *const data[5]); APPKIT_EXPORT void NSDrawThreePartImage(NSRect aRect, NSImage *start, NSImage *middle, NSImage *end, BOOL isVertical, NSCompositingOperation op, CGFloat fraction, BOOL flipped); APPKIT_EXPORT void NSDrawNinePartImage(NSRect aRect, NSImage *topLeft, NSImage *topMiddle, NSImage *topRight, NSImage *centerLeft, NSImage *centerMiddle, NSImage *centerRight, NSImage *bottomLeft, NSImage *bottomMiddle, NSImage *bottomRight, NSCompositingOperation op, CGFloat fraction, BOOL flipped); static inline void NSBeep(void) { NSGraphicsContext *ctxt = GSCurrentContext(); if (ctxt != nil) { (ctxt->methods->NSBeep) (ctxt, @selector(NSBeep)); } } static inline void GSWSetViewIsFlipped(NSGraphicsContext *ctxt, BOOL flipped) { (ctxt->methods->GSWSetViewIsFlipped_) (ctxt, @selector(GSWSetViewIsFlipped:), flipped); } static inline BOOL GSWViewIsFlipped(NSGraphicsContext *ctxt) { return (ctxt->methods->GSWViewIsFlipped) (ctxt, @selector(GSWViewIsFlipped)); } #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) @class NSArray; @class NSWindow; APPKIT_EXPORT NSArray* GSOrderedWindows(void); APPKIT_EXPORT NSArray* GSAllWindows(void); APPKIT_EXPORT NSWindow* GSWindowWithNumber(NSInteger num); #endif #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) // Window operations APPKIT_EXPORT void NSConvertGlobalToWindowNumber(int globalNum, unsigned int *winNum); APPKIT_EXPORT void NSConvertWindowNumberToGlobal(int winNum, unsigned int *globalNum); // Rectangle drawing APPKIT_EXPORT NSRect NSDrawColorTiledRects(NSRect boundsRect, NSRect clipRect, const NSRectEdge *sides, NSColor **colors, NSInteger count); APPKIT_EXPORT void NSDrawDarkBezel(NSRect aRect, NSRect clipRect); APPKIT_EXPORT void NSDrawLightBezel(NSRect aRect, NSRect clipRect); APPKIT_EXPORT void NSRectFillListWithColors(const NSRect *rects, NSColor **colors, NSInteger count); APPKIT_EXPORT void NSRectFillUsingOperation(NSRect aRect, NSCompositingOperation op); APPKIT_EXPORT void NSRectFillListUsingOperation(const NSRect *rects, NSInteger count, NSCompositingOperation op); APPKIT_EXPORT void NSRectFillListWithColorsUsingOperation(const NSRect *rects, NSColor **colors, NSInteger num, NSCompositingOperation op); APPKIT_EXPORT void NSDrawWindowBackground(NSRect aRect); // Context information APPKIT_EXPORT void NSCountWindowsForContext(NSInteger context, NSInteger *count); APPKIT_EXPORT void NSWindowListForContext(NSInteger context, NSInteger size, NSInteger **list); APPKIT_EXPORT int NSGetWindowServerMemory(int context, int *virtualMemory, int *windowBackingMemory, NSString **windowDumpStream); #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_1, GS_API_LATEST) typedef enum _NSFocusRingPlacement { NSFocusRingOnly=0, NSFocusRingBelow, NSFocusRingAbove } NSFocusRingPlacement; void NSSetFocusRingStyle(NSFocusRingPlacement placement); #endif #if defined(__cplusplus) } #endif #endif /* __NSGraphics_h__ */ gnustep-gui-0.24.0/Headers/AppKit/NSImageCell.h0000664000076500007650000001022311657325527020754 0ustar brains99brains99/* NSImageCell.h The cell class for NSImage Copyright (C) 1999 Free Software Foundation, Inc. Author: Jonathan Gapen Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSImageCell #define _GNUstep_H_NSImageCell #import #import /** *

Enumeration of the ways that you can align an image inside an * NSImageCell when the image is not taking up all the space inside * the cell (for example, because you are using NSScaleNone or * NSScaleProportionally and the cell size is bigger than the natural * image size). The available ones are: NSImageAlignCenter, * NSImageAlignTop, NSImageAlignTopLeft, NSImageAlignTopRight, * NSImageAlignLeft, NSImageAlignBottom, NSImageAlignBottomLeft, * NSImageAlignBottomRight, NSImageAlignRight.

*/ typedef enum { NSImageAlignCenter = 0, NSImageAlignTop, NSImageAlignTopLeft, NSImageAlignTopRight, NSImageAlignLeft, NSImageAlignBottom, NSImageAlignBottomLeft, NSImageAlignBottomRight, NSImageAlignRight } NSImageAlignment; /** *

Enumeration of the types of frame that can be used in an * NSImageCell. The available ones are: NSImageFrameNone, * NSImageFramePhoto, NSImageFrameGrayBezel, NSImageFrameGroove, * NSImageFrameButton.

*/ typedef enum { NSImageFrameNone = 0, NSImageFramePhoto, NSImageFrameGrayBezel, NSImageFrameGroove, NSImageFrameButton } NSImageFrameStyle; /** *

An NSImageCell is a cell that can display a single image. It * is normally associated with an NSImageView control; but you can * use it as a building block in your own controls.

* *

The image to display is set using the -setImage: method * which is inherited from the superclass.

* *

The -setImageAlignment: and -setImageScaling: methods can be * used to control how the image is drawn inside a rectangle which is * larger or smaller than the image size; the image might need to be * scaled, cropped or aligned.

* *

The -setImageFrameStyle: method can be used to control if the * cell should display a frame border, and which one.

*/ @interface NSImageCell : NSCell { NSImageAlignment _imageAlignment; NSImageFrameStyle _frameStyle; NSImageScaling _imageScaling; NSSize _original_image_size; } /** * Returns the alignment used when displaying the image inside * a cell that is bigger than the image, and NSScaleToFit has * not been selected. */ - (NSImageAlignment) imageAlignment; /** * Sets the alignment used when displaying the image inside a cell * that is bigger than the image, and NSScaleToFit has not been * selected. */ - (void) setImageAlignment: (NSImageAlignment)anAlignment; /** * Returns the type of image scaling used on the image when the * image natural size and the cell size are different. */ - (NSImageScaling) imageScaling; /** * Sets the type of image scaling used on the image when the image * natural size and the cell size are different. */ - (void) setImageScaling: (NSImageScaling)scaling; /** * Returns the style used to draw the frame around the image. */ - (NSImageFrameStyle) imageFrameStyle; /** * Sets the style used to draw the frame around the image. */ - (void) setImageFrameStyle: (NSImageFrameStyle)aFrameStyle; @end #endif // _GNUstep_H_NSImageCell gnustep-gui-0.24.0/Headers/AppKit/NSColor.h0000664000076500007650000001732612102042725020201 0ustar brains99brains99/* NSColor.h The colorful color class Copyright (C) 1996, 1998 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSColor #define _GNUstep_H_NSColor #import #import #import #import @class NSString; @class NSDictionary; @class NSPasteboard; @class NSImage; @class NSColorSpace; enum _NSControlTint { NSDefaultControlTint, NSBlueControlTint, NSGraphiteControlTint = 6, NSClearControlTint }; typedef NSUInteger NSControlTint; enum _NSControlSize { NSRegularControlSize, NSSmallControlSize, NSMiniControlSize }; typedef NSUInteger NSControlSize; /* * NSColor is an abstract super class of the class cluster of the real colour classes. * For each colour space exists a specific subclass that implements the behaviour for * this colour space. * The colour spaces NSDeviceBlackColorSpace and NSCalibratedBlackColorSpace * are no longer supported by this class. They were not in the old OpenStep * specification, and are not used in the new Apple specification. The names are * used as synonyms to NSDeviceWhiteColorSpace and NSCalibratedWhiteColorSpace. */ @interface NSColor : NSObject { } // // Creating an NSColor from Component Values // + (NSColor *)colorWithCalibratedHue:(CGFloat)hue saturation:(CGFloat)saturation brightness:(CGFloat)brightness alpha:(CGFloat)alpha; + (NSColor *)colorWithCalibratedRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha; + (NSColor *)colorWithCalibratedWhite:(CGFloat)white alpha:(CGFloat)alpha; + (NSColor *)colorWithCatalogName:(NSString *)listName colorName:(NSString *)colorName; + (NSColor *)colorWithDeviceCyan:(CGFloat)cyan magenta:(CGFloat)magenta yellow:(CGFloat)yellow black:(CGFloat)black alpha:(CGFloat)alpha; + (NSColor *)colorWithDeviceHue:(CGFloat)hue saturation:(CGFloat)saturation brightness:(CGFloat)brightness alpha:(CGFloat)alpha; + (NSColor *)colorWithDeviceRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha; + (NSColor *)colorWithDeviceWhite:(CGFloat)white alpha:(CGFloat)alpha; // // Creating an NSColor With Preset Components // + (NSColor *)blackColor; + (NSColor *)blueColor; + (NSColor *)brownColor; + (NSColor *)clearColor; + (NSColor *)cyanColor; + (NSColor *)darkGrayColor; + (NSColor *)grayColor; + (NSColor *)greenColor; + (NSColor *)lightGrayColor; + (NSColor *)magentaColor; + (NSColor *)orangeColor; + (NSColor *)purpleColor; + (NSColor *)redColor; + (NSColor *)whiteColor; + (NSColor *)yellowColor; // // Ignoring Alpha Components // + (BOOL)ignoresAlpha; + (void)setIgnoresAlpha:(BOOL)flag; // // Retrieving a Set of Components // - (void)getCyan:(CGFloat *)cyan magenta:(CGFloat *)magenta yellow:(CGFloat *)yellow black:(CGFloat *)black alpha:(CGFloat *)alpha; - (void)getHue:(CGFloat *)hue saturation:(CGFloat *)saturation brightness:(CGFloat *)brightness alpha:(CGFloat *)alpha; - (void)getRed:(CGFloat *)red green:(CGFloat *)green blue:(CGFloat *)blue alpha:(CGFloat *)alpha; - (void)getWhite:(CGFloat *)white alpha:(CGFloat *)alpha; // // Retrieving Individual Components // - (CGFloat)alphaComponent; - (CGFloat)blackComponent; - (CGFloat)blueComponent; - (CGFloat)brightnessComponent; - (NSString *)catalogNameComponent; - (NSString *)colorNameComponent; - (CGFloat)cyanComponent; - (CGFloat)greenComponent; - (CGFloat)hueComponent; - (NSString *)localizedCatalogNameComponent; - (NSString *)localizedColorNameComponent; - (CGFloat)magentaComponent; - (CGFloat)redComponent; - (CGFloat)saturationComponent; - (CGFloat)whiteComponent; - (CGFloat)yellowComponent; // // Converting to Another Color Space // - (NSString *)colorSpaceName; - (NSColor *)colorUsingColorSpaceName:(NSString *)colorSpace; - (NSColor *)colorUsingColorSpaceName:(NSString *)colorSpace device:(NSDictionary *)deviceDescription; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) // + (NSColor *)colorWithCIColor:(CIColor *)color; + (NSColor *)colorWithColorSpace:(NSColorSpace *)space components:(const CGFloat *)comp count:(NSInteger)number; - (NSColorSpace *)colorSpace; - (NSColor *)colorUsingColorSpace:(NSColorSpace *)space; - (void)getComponents:(CGFloat *)components; - (NSInteger)numberOfComponents; #endif // // Changing the Color // - (NSColor *)blendedColorWithFraction:(CGFloat)fraction ofColor:(NSColor *)aColor; - (NSColor *)colorWithAlphaComponent:(CGFloat)alpha; // // Copying and Pasting // + (NSColor *)colorFromPasteboard:(NSPasteboard *)pasteBoard; - (void)writeToPasteboard:(NSPasteboard *)pasteBoard; // // Drawing // - (void)drawSwatchInRect:(NSRect)rect; - (void)set; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (void)setFill; - (void)setStroke; #endif #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) // // Changing the color // - (NSColor*) highlightWithLevel: (CGFloat)level; - (NSColor*) shadowWithLevel: (CGFloat)level; + (NSColor*)colorWithPatternImage:(NSImage*)image; + (NSColor*)colorForControlTint:(NSControlTint)controlTint; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) + (NSControlTint)currentControlTint; #endif // // System colors stuff. // #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) + (NSColor*) alternateSelectedControlColor; + (NSColor*) alternateSelectedControlTextColor; #endif + (NSColor*) controlBackgroundColor; + (NSColor*) controlColor; + (NSColor*) controlHighlightColor; + (NSColor*) controlLightHighlightColor; + (NSColor*) controlShadowColor; + (NSColor*) controlDarkShadowColor; + (NSColor*) controlTextColor; + (NSColor*) disabledControlTextColor; + (NSColor*) gridColor; + (NSColor*) headerColor; + (NSColor*) headerTextColor; + (NSColor*) highlightColor; + (NSColor*) keyboardFocusIndicatorColor; + (NSColor*) knobColor; + (NSColor*) scrollBarColor; + (NSColor*) secondarySelectedControlColor; + (NSColor*) selectedControlColor; + (NSColor*) selectedControlTextColor; + (NSColor*) selectedKnobColor; + (NSColor*) selectedMenuItemColor; + (NSColor*) selectedMenuItemTextColor; + (NSColor*) selectedTextBackgroundColor; + (NSColor*) selectedTextColor; + (NSColor*) shadowColor; + (NSColor*) textBackgroundColor; + (NSColor*) textColor; + (NSColor*) windowBackgroundColor; + (NSColor*) windowFrameColor; + (NSColor*) windowFrameTextColor; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) + (NSArray*) controlAlternatingRowBackgroundColors; #endif // Pattern colour - (NSImage*) patternImage; #endif @end APPKIT_EXPORT NSString *NSSystemColorsDidChangeNotification; #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) @interface NSCoder (NSCoderAdditions) // // Converting an Archived NXColor to an NSColor // - (NSColor *)decodeNXColor; @end #endif #endif // _GNUstep_H_NSColor gnustep-gui-0.24.0/Headers/AppKit/NSPageLayout.h0000664000076500007650000000630012105235341021164 0ustar brains99brains99/** NSPageLayout Standard panel for querying user about page layout. Copyright (C) 2001,2004 Free Software Foundation, Inc. Written By: Adam Fedor Date: Oct 2001 Author: Chad Hardin Date: July 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSPageLayout #define _GNUstep_H_NSPageLayout #import #import #import @class NSPrintInfo; @class NSView; @class NSWindow; // // Note: not all of these tags are currently used in the // NSPageLayout panel, see below for details. // enum { NSPLImageButton = 1, //Used. NSPLTitleField = 2, //Used. NSPLPaperNameButton = 3, //Used, only for the standard paper size //NSPopUpButton though. Not the //NSPopUpButton used to select custom //paper sizes. NSPLUnitsButton = 4, //NOT used. NSPLWidthField = 5, //NOT used. NSPLHeightField = 6, //NOT used. NSPLOrientationMatrix = 7, //Used. NSPLCancelButton = 8, //Used. NSPLOKButton = 9, //Used. NSPLPageLayout = 10, //NOT used. NSPLScaleField = 11 //Used. }; @interface NSApplication (NSPageLayout) - (void) runPageLayout: (id)sender; @end @interface NSPageLayout : NSPanel { id _controller; } // // Creating an NSPageLayout Instance // + (NSPageLayout *)pageLayout; // // Running the Panel // - (NSInteger)runModal; - (NSInteger)runModalWithPrintInfo:(NSPrintInfo *)printInfo; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void)beginSheetWithPrintInfo:(NSPrintInfo *)printInfo modalForWindow:(NSWindow *)docWindow delegate:(id)delegate didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo; #endif // // Customizing the Panel // - (NSView *)accessoryView; - (void)setAccessoryView:(NSView *)aView; // // Updating the Panel's Display // - (void)convertOldFactor:(float *)old newFactor:(float *)newFactor; - (void)pickedButton:(id)sender; - (void)pickedOrientation:(id)sender; - (void)pickedPaperSize:(id)sender; - (void)pickedUnits:(id)sender; // // Communicating with the NSPrintInfo Object // - (NSPrintInfo *)printInfo; - (void)readPrintInfo; - (void)writePrintInfo; @end #endif // _GNUstep_H_NSPageLayout gnustep-gui-0.24.0/Headers/AppKit/NSStringDrawing.h0000664000076500007650000000554411354602172021712 0ustar brains99brains99/* NSStringDrawing.h Categories which add measure capabilities to NSAttributedString and NSString. Copyright (C) 1997 Free Software Foundation, Inc. Author: Felipe A. Rodriguez Date: Aug 1998 Rewrite: Richard Frith-Macdonald Date: Mar 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSStringDrawing #define _GNUstep_H_NSStringDrawing #import #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) #import #import #import @class NSDictionary; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) typedef enum { NSStringDrawingUsesLineFragmentOrigin=0x01, NSStringDrawingUsesFontLeading=0x02, NSStringDrawingDisableScreenFontSubstitution=0x04, NSStringDrawingUsesDeviceMetrics=0x08, NSStringDrawingOneShot=0x10 } NSStringDrawingOptions; #endif @interface NSString (NSStringDrawing) - (void) drawAtPoint: (NSPoint)point withAttributes: (NSDictionary*)attrs; - (void) drawInRect: (NSRect)rect withAttributes: (NSDictionary*)attrs; - (NSSize) sizeWithAttributes: (NSDictionary*)attrs; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (NSRect) boundingRectWithSize: (NSSize)size options: (NSStringDrawingOptions)options attributes: (NSDictionary *)attributes; - (void) drawWithRect: (NSRect)rect options: (NSStringDrawingOptions)options attributes: (NSDictionary *)attributes; #endif @end @interface NSAttributedString (NSStringDrawing) - (NSSize) size; - (void) drawAtPoint: (NSPoint)point; - (void) drawInRect: (NSRect)rect; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (NSRect) boundingRectWithSize: (NSSize)size options: (NSStringDrawingOptions)options; - (void) drawWithRect: (NSRect)rect options: (NSStringDrawingOptions)options; #endif @end #else @class NSAttributedString; #endif #endif /* _GNUstep_H_NSStringDrawing */ gnustep-gui-0.24.0/Headers/AppKit/NSProgressIndicator.h0000664000076500007650000000720711536247102022567 0ustar brains99brains99/* NSProgressIndicator.h Copyright (C) 1999 Free Software Foundation, Inc. Author: Gerrit van Dyk Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSProgressIndicator #define _GNUstep_H_NSProgressIndicator #import #import /* For NSControlTint */ #import /* For NSControlSize */ #import @class NSTimer; @class NSThread; typedef enum _NSProgressIndicatorThickness { NSProgressIndicatorPreferredThickness = 14, NSProgressIndicatorPreferredSmallThickness = 10, NSProgressIndicatorPreferredLargeThickness = 18, NSProgressIndicatorPreferredAquaThickness = 12 } NSProgressIndicatorThickness; typedef enum _NSProgressIndicatorStyle { NSProgressIndicatorBarStyle = 0, NSProgressIndicatorSpinningStyle = 1 } NSProgressIndicatorStyle; @interface NSProgressIndicator : NSView { double _doubleValue; double _minValue; double _maxValue; NSTimeInterval _animationDelay; NSProgressIndicatorStyle _style; BOOL _isIndeterminate; BOOL _isBezeled; BOOL _usesThreadedAnimation; BOOL _isDisplayedWhenStopped; NSControlTint _controlTint; NSControlSize _controlSize; @private BOOL _isVertical; BOOL _isRunning; int _count; NSTimer *_timer; id _reserved; } // // Animating the progress indicator // #if OS_API_VERSION(GS_API_LATEST, MAC_OS_X_VERSION_10_5) - (void)animate:(id)sender; - (NSTimeInterval)animationDelay; - (void)setAnimationDelay:(NSTimeInterval)delay; #endif - (void)startAnimation:(id)sender; - (void)stopAnimation:(id)sender; - (BOOL)usesThreadedAnimation; - (void)setUsesThreadedAnimation:(BOOL)flag; // // Advancing the progress bar // - (void)incrementBy:(double)delta; - (double)doubleValue; - (void)setDoubleValue:(double)aValue; - (double)minValue; - (void)setMinValue:(double)newMinimum; - (double)maxValue; - (void)setMaxValue:(double)newMaximum; // // Setting the appearance // - (BOOL)isBezeled; - (void)setBezeled:(BOOL)flag; - (BOOL)isIndeterminate; - (void)setIndeterminate:(BOOL)flag; // // Standard control layout // - (NSControlSize)controlSize; - (void)setControlSize:(NSControlSize)size; - (NSControlTint)controlTint; - (void)setControlTint:(NSControlTint)tint; #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) - (BOOL)isDisplayedWhenStopped; - (void)setDisplayedWhenStopped:(BOOL)flag; - (void)setStyle:(NSProgressIndicatorStyle)style; - (NSProgressIndicatorStyle)style; - (void)sizeToFit; #endif @end #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) @interface NSProgressIndicator (GNUstepExtensions) /* * Enables Vertical ProgressBar * * If isVertical = YES, Progress is from the bottom to the top * If isVertical = NO, Progress is from the left to the right */ - (BOOL)isVertical; - (void)setVertical:(BOOL)flag; @end #endif #endif /* _GNUstep_H_NSProgressIndicator */ gnustep-gui-0.24.0/Headers/AppKit/NSSelection.h0000664000076500007650000000363411354602172021053 0ustar brains99brains99/* NSSelection.h Class describing a selection in a document Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSSelection #define _GNUstep_H_NSSelection #import @class NSData; @class NSPasteboard; @interface NSSelection : NSObject { // Attributes @private NSData *_descriptionData; BOOL _isWellKnownSelection; int _selectionType; } // // Returning Special Selection Shared Instances // + (NSSelection *)allSelection; + (NSSelection *)currentSelection; + (NSSelection *)emptySelection; // // Creating and Initializing a Selection // + (NSSelection *)selectionWithDescriptionData:(NSData *)data; - (id)initWithDescriptionData:(NSData *)newData; - (id)initWithPasteboard:(NSPasteboard *)pasteboard; // // Describing a Selection // - (NSData *)descriptionData; - (BOOL)isWellKnownSelection; // // Writing a Selection to the Pasteboard // - (void)writeToPasteboard:(NSPasteboard *)pasteboard; @end #endif // _GNUstep_H_NSSelection gnustep-gui-0.24.0/Headers/AppKit/NSHelpPanel.h0000664000076500007650000000437212121417516020775 0ustar brains99brains99/* NSHelpPanel.h Standard panel for showing help information Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSHelpPanel #define _GNUstep_H_NSHelpPanel #import #if OS_API_VERSION(GS_API_OPENSTEP,GS_API_MACOSX) || GS_API_VERSION(GS_API_NONE, GS_API_LATEST) #import #import @class NSString; @interface NSApplication (NSHelpPanel) - (void) orderFrontHelpPanel: (id)sender; @end @interface NSHelpPanel : NSPanel { // Attributes } // // Accessing the Help Panel // + (NSHelpPanel *) sharedHelpPanel; + (NSHelpPanel *) sharedHelpPanelWithDirectory: (NSString *)helpDirectory; // // Managing the Contents // + (void) setHelpDirectory: (NSString *)helpDirectory; - (void) addSupplement: (NSString *)helpDirectory inPath: (NSString *)supplementPath; - (NSString *) helpDirectory; - (NSString *) helpFile; // // Attaching Help to Objects // + (void) attachHelpFile: (NSString *)filename markerName: (NSString *)markerName to: (id)anObject; + (void) detachHelpFrom: (id)anObject; // // Showing Help // - (void) showFile: (NSString *)filename atMarker: (NSString *)markerName; - (BOOL) showHelpAttachedTo: (id)anObject; // // Printing // - (void) print: (id)sender; @end #endif // !GS_API_MACOSX #endif // _GNUstep_H_NSHelpPanel gnustep-gui-0.24.0/Headers/AppKit/NSLevelIndicatorCell.h0000664000076500007650000000511211673147131022626 0ustar brains99brains99/* -*-objc-*- NSLevelIndicatorCell.h The level indicator cell class Copyright (C) 2007 Free Software Foundation, Inc. Author: H. Nikolaus Schaller Date: 2006 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSLevelIndicatorCell #define _GNUstep_H_NSLevelIndicatorCell #import "AppKit/NSActionCell.h" // For the tick mark #import "AppKit/NSSliderCell.h" #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) typedef enum _NSLevelIndicatorStyle { NSRelevancyLevelIndicatorStyle, NSContinuousCapacityLevelIndicatorStyle, NSDiscreteCapacityLevelIndicatorStyle, NSRatingLevelIndicatorStyle } NSLevelIndicatorStyle; @interface NSLevelIndicatorCell : NSActionCell { double _minValue; double _maxValue; double _warningValue; double _criticalValue; NSInteger _numberOfMajorTickMarks; NSInteger _numberOfTickMarks; NSLevelIndicatorStyle _style; NSTickMarkPosition _tickMarkPosition; NSRect _cellFrame; } - (id)initWithLevelIndicatorStyle:(NSLevelIndicatorStyle)style; // value handling - (double)criticalValue; - (void)setCriticalValue:(double)val; - (double)maxValue; - (void)setMaxValue:(double)val; - (double)minValue; - (void)setMinValue:(double)val; - (void)setWarningValue:(double)val; - (double)warningValue; - (NSLevelIndicatorStyle)style; - (void)setLevelIndicatorStyle:(NSLevelIndicatorStyle)style; - (NSInteger)numberOfMajorTickMarks; - (void)setNumberOfMajorTickMarks:(NSInteger)count; - (NSInteger)numberOfTickMarks; - (void)setNumberOfTickMarks:(NSInteger)count; - (NSTickMarkPosition)tickMarkPosition; - (void)setTickMarkPosition:(NSTickMarkPosition) pos; - (double)tickMarkValueAtIndex:(NSInteger)index; - (NSRect)rectOfTickMarkAtIndex:(NSInteger)index; @end #endif /* MAC_OS_X_VERSION_10_4 */ #endif /* _GNUstep_H_NSLevelIndicatorCell */ gnustep-gui-0.24.0/Headers/AppKit/AppKitDefines.h0000664000076500007650000000366612075246103021357 0ustar brains99brains99/* Plateform specific definitions for externs Copyright (C) 2001 Free Software Foundation, Inc. Written by: Adam Fedor Date: Jul, 2001 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __AppKitDefines_INCLUDE #define __AppKitDefines_INCLUDE #import #ifdef __cplusplus #define APPKIT_EXTERN extern "C" #else #define APPKIT_EXTERN extern #endif #ifdef GNUSTEP_WITH_DLL #if BUILD_libgnustep_gui_DLL # # if defined(__MINGW32__) /* On Mingw, the compiler will export all symbols automatically, so * __declspec(dllexport) is not needed. */ # define APPKIT_EXPORT APPKIT_EXTERN # define APPKIT_DECLARE # else # define APPKIT_EXPORT __declspec(dllexport) APPKIT_EXTERN # define APPKIT_DECLARE __declspec(dllexport) # endif #else # define APPKIT_EXPORT APPKIT_EXTERN __declspec(dllimport) # define APPKIT_DECLARE __declspec(dllimport) #endif #else /* GNUSTEP_WITH[OUT]_DLL */ # define APPKIT_EXPORT APPKIT_EXTERN # define APPKIT_DECLARE #endif #ifdef __clang__ # define PACKAGE_SCOPE @package #else # define PACKAGE_SCOPE @public #endif #endif /* __AppKitDefines_INCLUDE */ gnustep-gui-0.24.0/Headers/AppKit/NSSlider.h0000664000076500007650000000502112110256537020341 0ustar brains99brains99/* NSSlider.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: September 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSSlider #define _GNUstep_H_NSSlider #import #import @class NSString; @class NSImage; @class NSCell; @class NSFont; @class NSColor; @class NSEvent; @interface NSSlider : NSControl // appearance - (double) altIncrementValue; - (NSImage*) image; - (NSInteger) isVertical; - (CGFloat) knobThickness; - (void) setAltIncrementValue: (double)increment; - (void) setImage: (NSImage*)backgroundImage; - (void) setKnobThickness: (CGFloat)aFloat; // title - (NSString*) title; - (id) titleCell; - (NSColor*) titleColor; - (NSFont*) titleFont; - (void) setTitle: (NSString*)aString; - (void) setTitleCell: (NSCell*)aCell; - (void) setTitleColor: (NSColor*)aColor; - (void) setTitleFont: (NSFont*)fontObject; // value limits - (double) maxValue; - (double) minValue; - (void) setMaxValue: (double)aDouble; - (void) setMinValue: (double)aDouble; // mouse handling - (BOOL) acceptsFirstMouse: (NSEvent*)theEvent; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) // ticks - (BOOL) allowsTickMarkValuesOnly; - (double) closestTickMarkValueToValue: (double)aValue; - (NSInteger) indexOfTickMarkAtPoint: (NSPoint)point; - (NSInteger) numberOfTickMarks; - (NSRect) rectOfTickMarkAtIndex: (NSInteger)index; - (void) setAllowsTickMarkValuesOnly: (BOOL)flag; - (void) setNumberOfTickMarks: (NSInteger)numberOfTickMarks; - (void) setTickMarkPosition: (NSTickMarkPosition)position; - (NSTickMarkPosition) tickMarkPosition; - (double) tickMarkValueAtIndex: (NSInteger)index; #endif @end #endif // _GNUstep_H_NSSlider gnustep-gui-0.24.0/Headers/AppKit/NSWorkspace.h0000664000076500007650000002430111574707070021065 0ustar brains99brains99/* NSWorkspace.h Interface for workspace. Copyright (C) 1996-2002 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSWorkspace #define _GNUstep_H_NSWorkspace #import #import #import @class NSString; @class NSNumber; @class NSArray; @class NSMutableArray; @class NSMutableDictionary; @class NSNotificationCenter; @class NSImage; @class NSView; @class NSURL; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) enum { NSWorkspaceLaunchAndPrint = 0x2, NSWorkspaceLaunchInhibitingBackgroundOnly = 0x80, NSWorkspaceLaunchWithoutAddingToRecents = 0x100, NSWorkspaceLaunchWithoutActivation = 0x200, NSWorkspaceLaunchAsync = 0x10000, NSWorkspaceLaunchAllowingClassicStartup = 0x20000, NSWorkspaceLaunchPreferringClassic = 0x40000, NSWorkspaceLaunchNewInstance = 0x80000, NSWorkspaceLaunchAndHide = 0x100000, NSWorkspaceLaunchAndHideOthers = 0x200000, NSWorkspaceLaunchDefault = NSWorkspaceLaunchAsync | NSWorkspaceLaunchAllowingClassicStartup }; typedef NSUInteger NSWorkspaceLaunchOptions; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) enum { NSExcludeQuickDrawElementsIconCreationOption = 1 << 1, NSExclude10_4ElementsIconCreationOption = 1 << 2 }; typedef NSUInteger NSWorkspaceIconCreationOptions; #endif @interface NSWorkspace : NSObject { NSMutableDictionary *_iconMap; NSMutableDictionary *_launched; NSNotificationCenter *_workspaceCenter; BOOL _fileSystemChanged; BOOL _userDefaultsChanged; } // // Creating a Workspace // + (NSWorkspace*) sharedWorkspace; // // Opening Files // - (BOOL) openFile: (NSString*)fullPath; - (BOOL) openFile: (NSString*)fullPath fromImage: (NSImage*)anImage at: (NSPoint)point inView: (NSView*)aView; - (BOOL) openFile: (NSString*)fullPath withApplication: (NSString*)appName; - (BOOL) openFile: (NSString*)fullPath withApplication: (NSString*)appName andDeactivate: (BOOL)flag; - (BOOL) openTempFile: (NSString*)fullPath; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (BOOL) openURL: (NSURL*)url; #endif // // Manipulating Files // - (BOOL) performFileOperation: (NSString*)operation source: (NSString*)source destination: (NSString*)destination files: (NSArray*)files tag: (int*)tag; - (BOOL) selectFile: (NSString*)fullPath inFileViewerRootedAtPath: (NSString*)rootFullpath; // // Requesting Information about Files // - (NSString*) fullPathForApplication: (NSString*)appName; - (BOOL) getFileSystemInfoForPath: (NSString*)fullPath isRemovable: (BOOL*)removableFlag isWritable: (BOOL*)writableFlag isUnmountable: (BOOL*)unmountableFlag description: (NSString**)description type: (NSString**)fileSystemType; - (BOOL) getInfoForFile: (NSString*)fullPath application: (NSString**)appName type: (NSString**)type; - (NSImage*) iconForFile: (NSString*)fullPath; - (NSImage*) iconForFiles: (NSArray*)pathArray; - (NSImage*) iconForFileType: (NSString*)fileType; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (BOOL) isFilePackageAtPath: (NSString*)fullPath; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (BOOL) setIcon: (NSImage *)image forFile: (NSString *)fullPath options: (NSWorkspaceIconCreationOptions)options; #endif // // Tracking Changes to the File System // - (BOOL) fileSystemChanged; - (void) noteFileSystemChanged; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void) noteFileSystemChanged: (NSString*)path; #endif // // Updating Registered Services and File Types // - (void) findApplications; // // Launching and Manipulating Applications // - (void) hideOtherApplications; - (BOOL) launchApplication: (NSString*)appName; - (BOOL) launchApplication: (NSString*)appName showIcon: (BOOL)showIcon autolaunch: (BOOL)autolaunch; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (NSString *) absolutePathForAppBundleWithIdentifier: (NSString *)bundleIdentifier; // TODO: implement NSAppleEventDescriptor in gnustep-base typedef void NSAppleEventDescriptor; - (BOOL) launchAppWithBundleIdentifier: (NSString *)bundleIdentifier options: (NSWorkspaceLaunchOptions)options additionalEventParamDescriptor: (NSAppleEventDescriptor *)descriptor launchIdentifier: (NSNumber **)identifier; - (BOOL) openURLs: (NSArray *)urls withAppBundleIdentifier: (NSString *)bundleIdentifier options: (NSWorkspaceLaunchOptions)options additionalEventParamDescriptor: (NSAppleEventDescriptor *)descriptor launchIdentifiers: (NSArray **)identifiers; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (BOOL) filenameExtension: (NSString *)filenameExtension isValidForType: (NSString*)typeName; - (NSString *) localizedDescriptionForType: (NSString *)typeName; - (NSString *) preferredFilenameExtensionForType: (NSString *)typeName; - (BOOL) type: (NSString *)firstTypeName conformsToType: (NSString *)secondTypeName; - (NSString *) typeOfFile: (NSString *)absoluteFilePath error: (NSError **)outError; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) - (NSDictionary*) activeApplication; - (NSArray*) launchedApplications; #endif // // Unmounting a Device // - (BOOL) unmountAndEjectDeviceAtPath: (NSString*)path; // // Tracking Status Changes for Devices // - (void) checkForRemovableMedia; - (NSArray*) mountNewRemovableMedia; - (NSArray*) mountedRemovableMedia; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (NSArray*) mountedLocalVolumePaths; #endif // // Notification Center // - (NSNotificationCenter*) notificationCenter; // // Tracking Changes to the User Defaults Database // - (void) noteUserDefaultsChanged; - (BOOL) userDefaultsChanged; // // Animating an Image // - (void) slideImage: (NSImage*)image from: (NSPoint)fromPoint to: (NSPoint)toPoint; // // Requesting Additional Time before Power Off or Logout // - (int) extendPowerOffBy: (int)requested; @end #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) @class NSBundle; @interface NSWorkspace (GNUstep) - (NSString*) getBestAppInRole: (NSString*)role forExtension: (NSString*)ext; - (NSString*) getBestIconForExtension: (NSString*)ext; - (NSDictionary*) infoForExtension: (NSString*)ext; - (NSBundle*) bundleForApp:(NSString*)appName; - (NSImage*) appIconForApp:(NSString*)appName; - (NSString*) locateApplicationBinary: (NSString*)appName; - (void) setBestApp: (NSString*)appName inRole: (NSString*)role forExtension: (NSString*)ext; - (void) setBestIcon: (NSString*)iconPath forExtension: (NSString*)ext; - (NSDictionary*) infoForScheme: (NSString*)scheme; - (NSString*) getBestAppInRole: (NSString*)role forScheme: (NSString*)scheme; - (void) setBestApp: (NSString*)appName inRole: (NSString*)role forScheme: (NSString*)scheme; @end #endif /* Notifications */ /** * This notification is sent by applications when they launch, * the notification userInfo dictionary contains the following - * * NSApplicationName * The name of the launched application. * A string. * * NSApplicationPath * The full path to the launched application. * A string. * * NSApplicationProcessIdentifier * The process identifier (pid) of the launched application. * * NSApplicationProcessSerialNumberHigh * MacOS-X specific ... not present in GNUstep. * * NSApplicationProcessSerialNumberLow * MacOS-X specific ... not present in GNUstep. * * */ APPKIT_EXPORT NSString *NSWorkspaceDidLaunchApplicationNotification; APPKIT_EXPORT NSString *NSWorkspaceDidMountNotification; APPKIT_EXPORT NSString *NSWorkspaceDidPerformFileOperationNotification; APPKIT_EXPORT NSString *NSWorkspaceDidTerminateApplicationNotification; APPKIT_EXPORT NSString *NSWorkspaceDidUnmountNotification; APPKIT_EXPORT NSString *NSWorkspaceWillLaunchApplicationNotification; APPKIT_EXPORT NSString *NSWorkspaceWillPowerOffNotification; APPKIT_EXPORT NSString *NSWorkspaceWillUnmountNotification; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) APPKIT_EXPORT NSString *NSWorkspaceDidWakeNotification; APPKIT_EXPORT NSString *NSWorkspaceSessionDidBecomeActiveNotification; APPKIT_EXPORT NSString *NSWorkspaceSessionDidResignActiveNotification; APPKIT_EXPORT NSString *NSWorkspaceWillSleepNotification; #endif // // Workspace File Type Globals // APPKIT_EXPORT NSString *NSPlainFileType; APPKIT_EXPORT NSString *NSDirectoryFileType; APPKIT_EXPORT NSString *NSApplicationFileType; APPKIT_EXPORT NSString *NSFilesystemFileType; APPKIT_EXPORT NSString *NSShellCommandFileType; // // Workspace File Operation Globals // APPKIT_EXPORT NSString *NSWorkspaceCompressOperation; APPKIT_EXPORT NSString *NSWorkspaceCopyOperation; APPKIT_EXPORT NSString *NSWorkspaceDecompressOperation; APPKIT_EXPORT NSString *NSWorkspaceDecryptOperation; APPKIT_EXPORT NSString *NSWorkspaceDestroyOperation; APPKIT_EXPORT NSString *NSWorkspaceDuplicateOperation; APPKIT_EXPORT NSString *NSWorkspaceEncryptOperation; APPKIT_EXPORT NSString *NSWorkspaceLinkOperation; APPKIT_EXPORT NSString *NSWorkspaceMoveOperation; APPKIT_EXPORT NSString *NSWorkspaceRecycleOperation; #endif // _GNUstep_H_NSWorkspace gnustep-gui-0.24.0/Headers/AppKit/NSTextField.h0000664000076500007650000000622012013442034021000 0ustar brains99brains99/* NSTextField.h Text field control class for text entry Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSTextField #define _GNUstep_H_NSTextField #import #import // For NSTextFieldBezelStyle #import @class NSNotification; @class NSColor; @class NSText; @class NSCursor; @protocol NSTextFieldDelegate @end @interface NSTextField : NSControl { // Attributes id _delegate; SEL _error_action; NSText *_text_object; } // // Setting User Access to Text // - (BOOL)isEditable; - (BOOL)isSelectable; - (void)setEditable:(BOOL)flag; - (void)setSelectable:(BOOL)flag; // // Editing Text // - (void)selectText:(id)sender; // // Setting Tab Key Behavior // - (id)nextText; - (id)previousText; - (void)setNextText:(id)anObject; - (void)setPreviousText:(id)anObject; // // Assigning a Delegate // - (void)setDelegate:(id)anObject; - (id)delegate; // // Modifying Graphic Attributes // - (NSColor *)backgroundColor; - (BOOL)drawsBackground; - (BOOL)isBezeled; - (BOOL)isBordered; - (void)setBackgroundColor:(NSColor *)aColor; - (void)setBezeled:(BOOL)flag; - (void)setBordered:(BOOL)flag; - (void)setDrawsBackground:(BOOL)flag; - (void)setTextColor:(NSColor *)aColor; - (NSColor *)textColor; // // Target and Action // - (SEL)errorAction; - (void)setErrorAction:(SEL)aSelector; // // Handling Events // - (BOOL)acceptsFirstResponder; - (void)textDidBeginEditing:(NSNotification *)aNotification; - (void)textDidChange:(NSNotification *)aNotification; - (void)textDidEndEditing:(NSNotification *)aNotification; - (BOOL)textShouldBeginEditing:(NSText *)textObject; - (BOOL)textShouldEndEditing:(NSText *)textObject; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) // // Rich Text // - (void)setAllowsEditingTextAttributes:(BOOL)flag; - (BOOL)allowsEditingTextAttributes; - (void)setImportsGraphics:(BOOL)flag; - (BOOL)importsGraphics; - (void)setTitleWithMnemonic:(NSString *)aString; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) - (void)setBezelStyle:(NSTextFieldBezelStyle)style; - (NSTextFieldBezelStyle)bezelStyle; #endif @end #endif // _GNUstep_H_NSTextField gnustep-gui-0.24.0/Headers/AppKit/NSPopUpButtonCell.h0000664000076500007650000001551312102212557022160 0ustar brains99brains99/* NSPopUpButtonCell.h Cell for Popup list class Copyright (C) 1999 Free Software Foundation, Inc. Author: Michael Hanni Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSPopUpButtonCell #define _GNUstep_H_NSPopUpButtonCell #import #import #import @class NSString; @class NSMenu; @class NSView; APPKIT_EXPORT NSString *NSPopUpButtonCellWillPopUpNotification; typedef enum { NSPopUpNoArrow = 0, NSPopUpArrowAtCenter = 1, NSPopUpArrowAtBottom = 2 } NSPopUpArrowPosition; @interface NSPopUpButtonCell : NSMenuItemCell { id _selectedItem; struct __pbcFlags { unsigned int pullsDown: 1; unsigned int preferredEdge: 3; unsigned int usesItemFromMenu: 1; unsigned int altersStateOfSelectedItem: 1; unsigned int arrowPosition: 2; } _pbcFlags; } // Initialization /** * Initialize with stringValue and pullDown. If pullDown is YES, the * reciever will be a pulldown button. */ - (id) initTextCell: (NSString*)stringValue pullsDown: (BOOL)flag; // Selection processing /** * The currently selected item in the reciever. */ - (id ) selectedItem; /** * Index of the currently selected item in the reciever. */ - (NSInteger) indexOfSelectedItem; /** * Synchronizes the title and the selected item. This sets * the selected item to the title of the reciever. */ - (void) synchronizeTitleAndSelectedItem; /** * Select item in the reciever. */ - (void) selectItem: (id )item; /** * Select item at the given index. */ - (void) selectItemAtIndex: (NSInteger)index; /** * Select the item with the given title. */ - (void) selectItemWithTitle: (NSString*)title; /** * Set title to aString. */ - (void) setTitle: (NSString*)aString; // Getters and setters. /** * Set the menu for the popup. */ - (void) setMenu: (NSMenu*)menu; /** * Return the menu for the popup. */ - (NSMenu*) menu; /** * Set to YES to make the popup button a pull-down style control. */ - (void) setPullsDown: (BOOL)flag; /** * Returns YES, if this is a pull-down */ - (BOOL) pullsDown; /** * Set to YES, if the items are to be autoenabled. */ - (void) setAutoenablesItems: (BOOL)flag; /** * Returns YES, if the items are autoenabled. */ - (BOOL) autoenablesItems; /** * Set the preferred edge as described by edge. This is used * to determine the edge which will open the popup when the screen * is small. */ - (void) setPreferredEdge: (NSRectEdge)preferredEdge; /** * Return the preferred edge. */ - (NSRectEdge) preferredEdge; /** * Set to YES, if the reciever should use a menu item for its title. YES * is the default. */ - (void) setUsesItemFromMenu: (BOOL)flag; /** * Returns YES, if the reciever uses a menu item for its title. */ - (BOOL) usesItemFromMenu; /** * Set to YES, if the state of the menu item selected in the reciever * should be changed when it's selected. */ - (void) setAltersStateOfSelectedItem: (BOOL)flag; /** * Return YES, if the reciever changes the state of the item chosen by * the user. */ - (BOOL) altersStateOfSelectedItem; /** * Returns the current arrow position of the reciever. */ - (NSPopUpArrowPosition) arrowPosition; /** * Sets the current arrow position of the reciever. */ - (void) setArrowPosition: (NSPopUpArrowPosition)pos; // Item management /** * Add an item to the popup with title. */ - (void) addItemWithTitle: (NSString*)title; /** * Add a number of items to the reciever using the provided itemTitles array. */ - (void) addItemsWithTitles: (NSArray*)titles; /** * Adds an item with the given title at index. If an item already exists at * index, it, and all items after it are advanced one position. Index needs * to be within the valid range for the array of items in the popup button. */ - (void) insertItemWithTitle: (NSString*)title atIndex: (NSInteger)index; /** * Remove a given item based on its title. */ - (void) removeItemWithTitle: (NSString*)title; /** * Remove a given item based on its index, must be a valid index within the * range for the item array of this popup. */ - (void) removeItemAtIndex: (NSInteger)index; /** * Purges all items from the popup. */ - (void) removeAllItems; // Referencing items... /** * Item array of the reciever. */ - (NSArray*) itemArray; /** * Number of items in the reciever. */ - (NSInteger) numberOfItems; /** * Return the index of item in the item array of the reciever. */ - (NSInteger) indexOfItem: (id)item; /** * Return index of the item with the given title. */ - (NSInteger) indexOfItemWithTitle: (NSString*)title; /** * Return index of the item with a tag equal to aTag. */ - (NSInteger) indexOfItemWithTag: (NSInteger)tag; /** * Index of the item whose menu item's representedObject is equal to obj. */ - (NSInteger) indexOfItemWithRepresentedObject: (id)obj; /** * Index of the item in the reciever whose target and action * are equal to aTarget and actionSelector. */ - (NSInteger) indexOfItemWithTarget: (id)aTarget andAction: (SEL)actionSelector; /** * Return the item at index. */ - (id ) itemAtIndex: (NSInteger)index; /** * Return the item with title. */ - (id ) itemWithTitle: (NSString*)title; /** * Return the item listed last in the reciever. */ - (id ) lastItem; // Title management /** * Set item title at the given index in the reciever. */ - (NSString*) itemTitleAtIndex: (NSInteger)index; /** * Returns an array containing all of the current item titles. */ - (NSArray*) itemTitles; /** * Returns the title of the currently selected item in the reciever. */ - (NSString*) titleOfSelectedItem; /** * Attach popup */ - (void) attachPopUpWithFrame: (NSRect)cellFrame inView: (NSView*)controlView; /** * Dismiss the reciever. */ - (void) dismissPopUp; /** * Perform the click operation with the given frame and controlView. */ - (void) performClickWithFrame: (NSRect)frame inView: (NSView*)controlView; @end #endif // _GNUstep_H_NSPopUpButtonCell gnustep-gui-0.24.0/Headers/AppKit/NSPrintInfo.h0000664000076500007650000001404211672314326021035 0ustar brains99brains99/** NSPrintInfo Stores information used in printing. Copyright (C) 1996,1997,2004 Free Software Foundation, Inc. Author: Simon Frankau Date: July 1997 Author: Adam Fedor Date: Oct 2001 Modified for Printing Backend Support Author: Chad Hardin Date: June 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSPrintInfo #define _GNUstep_H_NSPrintInfo #import #import #import @class NSString; @class NSDictionary; @class NSMutableDictionary; @class NSPrinter; typedef enum _NSPrintingOrientation { NSPortraitOrientation, NSLandscapeOrientation } NSPrintingOrientation; typedef enum _NSPrintingPaginationMode { NSAutoPagination, NSFitPagination, NSClipPagination } NSPrintingPaginationMode; @interface NSPrintInfo : NSObject { NSMutableDictionary *_info; } // // Creating and Initializing an NSPrintInfo Instance // - (id)initWithDictionary:(NSDictionary *)aDict; // // Managing the Shared NSPrintInfo Object // + (void)setSharedPrintInfo:(NSPrintInfo *)printInfo; + (NSPrintInfo *)sharedPrintInfo; // // Managing the Printing Rectangle // + (NSSize)sizeForPaperName:(NSString *)name; - (CGFloat)bottomMargin; - (CGFloat)leftMargin; - (NSPrintingOrientation)orientation; - (NSString *)paperName; - (NSSize)paperSize; - (CGFloat)rightMargin; - (void)setBottomMargin:(CGFloat)value; - (void)setLeftMargin:(CGFloat)value; - (void)setOrientation:(NSPrintingOrientation)mode; - (void)setPaperName:(NSString *)name; - (void)setPaperSize:(NSSize)size; - (void)setRightMargin:(CGFloat)value; - (void)setTopMargin:(CGFloat)value; - (CGFloat)topMargin; #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) - (NSRect)imageablePageBounds; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (NSString *)localizedPaperName; #endif // // Pagination // - (NSPrintingPaginationMode)horizontalPagination; - (void)setHorizontalPagination:(NSPrintingPaginationMode)mode; - (void)setVerticalPagination:(NSPrintingPaginationMode)mode; - (NSPrintingPaginationMode)verticalPagination; // // Positioning the Image on the Page // - (BOOL)isHorizontallyCentered; - (BOOL)isVerticallyCentered; - (void)setHorizontallyCentered:(BOOL)flag; - (void)setVerticallyCentered:(BOOL)flag; // // Specifying the Printer // + (NSPrinter *)defaultPrinter; + (void)setDefaultPrinter:(NSPrinter *)printer; - (NSPrinter *)printer; - (void)setPrinter:(NSPrinter *)aPrinter; // // Controlling Printing // - (NSString *)jobDisposition; - (void)setJobDisposition:(NSString *)disposition; - (void)setUpPrintOperationDefaultValues; // // Accessing the NSPrintInfo Object's Dictionary // - (NSMutableDictionary *)dictionary; @end // // Printing Information Dictionary Keys // APPKIT_EXPORT NSString *NSPrintAllPages; APPKIT_EXPORT NSString *NSPrintBottomMargin; APPKIT_EXPORT NSString *NSPrintCopies; APPKIT_EXPORT NSString *NSPrintFaxCoverSheetName; APPKIT_EXPORT NSString *NSPrintFaxHighResolution; APPKIT_EXPORT NSString *NSPrintFaxModem; APPKIT_EXPORT NSString *NSPrintFaxReceiverNames; APPKIT_EXPORT NSString *NSPrintFaxReceiverNumbers; APPKIT_EXPORT NSString *NSPrintFaxReturnReceipt; APPKIT_EXPORT NSString *NSPrintFaxSendTime; APPKIT_EXPORT NSString *NSPrintFaxTrimPageEnds; APPKIT_EXPORT NSString *NSPrintFaxUseCoverSheet; APPKIT_EXPORT NSString *NSPrintFirstPage; APPKIT_EXPORT NSString *NSPrintHorizontalPagination; APPKIT_EXPORT NSString *NSPrintHorizontallyCentered; APPKIT_EXPORT NSString *NSPrintJobDisposition; APPKIT_EXPORT NSString *NSPrintJobFeatures; APPKIT_EXPORT NSString *NSPrintLastPage; APPKIT_EXPORT NSString *NSPrintLeftMargin; APPKIT_EXPORT NSString *NSPrintManualFeed; APPKIT_EXPORT NSString *NSPrintMustCollate; APPKIT_EXPORT NSString *NSPrintOrientation; APPKIT_EXPORT NSString *NSPrintPackageException; APPKIT_EXPORT NSString *NSPrintPagesPerSheet; APPKIT_EXPORT NSString *NSPrintPaperFeed; APPKIT_EXPORT NSString *NSPrintPaperName; APPKIT_EXPORT NSString *NSPrintPaperSize; APPKIT_EXPORT NSString *NSPrintPrinter; APPKIT_EXPORT NSString *NSPrintReversePageOrder; APPKIT_EXPORT NSString *NSPrintRightMargin; APPKIT_EXPORT NSString *NSPrintSavePath; APPKIT_EXPORT NSString *NSPrintScalingFactor; APPKIT_EXPORT NSString *NSPrintTopMargin; APPKIT_EXPORT NSString *NSPrintVerticalPagination; APPKIT_EXPORT NSString *NSPrintVerticallyCentered; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) APPKIT_EXPORT NSString *NSPrintPagesAcross; APPKIT_EXPORT NSString *NSPrintPagesDown; APPKIT_EXPORT NSString *NSPrintTime; APPKIT_EXPORT NSString *NSPrintDetailedErrorReporting; APPKIT_EXPORT NSString *NSPrintFaxNumber; APPKIT_EXPORT NSString *NSPrintPrinterName; APPKIT_EXPORT NSString *NSPrintHeaderAndFooter; #endif // // Additional (GNUstep) keys // /** Set to Rows to print row by row, set to Columns to print column by column */ APPKIT_EXPORT NSString *NSPrintPageDirection; // // Print Job Disposition Values // APPKIT_EXPORT NSString *NSPrintCancelJob; APPKIT_EXPORT NSString *NSPrintFaxJob; APPKIT_EXPORT NSString *NSPrintPreviewJob; APPKIT_EXPORT NSString *NSPrintSaveJob; APPKIT_EXPORT NSString *NSPrintSpoolJob; #endif // _GNUstep_H_NSPrintInfo gnustep-gui-0.24.0/Headers/AppKit/NSSearchFieldCell.h0000664000076500007650000000553111354602172022075 0ustar brains99brains99/* NSSearchFieldCell.h Text field cell class for text search Copyright (C) 2004 Free Software Foundation, Inc. Author: H. Nikolaus Schaller Date: Dec 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSSearchFieldCell #define _GNUstep_H_NSSearchFieldCell #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) #import @class NSButtonCell; @class NSMenu; enum { NSSearchFieldRecentsTitleMenuItemTag = 1000, NSSearchFieldRecentsMenuItemTag = 1001, NSSearchFieldClearRecentsMenuItemTag = 1002, NSSearchFieldNoRecentsMenuItemTag = 1003 }; @interface NSSearchFieldCell : NSTextFieldCell { NSMutableArray *_recent_searches; NSString *_recents_autosave_name; NSButtonCell *_search_button_cell; NSButtonCell *_cancel_button_cell; NSMenu *_menu_template; BOOL _sends_whole_search_string; BOOL _sends_search_string_immediatly; unsigned char _max_recents; } // Managing button cells - (NSButtonCell *) cancelButtonCell; - (void) setCancelButtonCell: (NSButtonCell *)cell; - (void) resetCancelButtonCell; - (NSButtonCell *) searchButtonCell; - (void) setSearchButtonCell: (NSButtonCell *)cell; - (void) resetSearchButtonCell; // Custom layout - (NSRect) cancelButtonRectForBounds: (NSRect)rect; - (NSRect) searchButtonRectForBounds: (NSRect)rect; - (NSRect) searchTextRectForBounds: (NSRect)rect; // template - (NSMenu *) searchMenuTemplate; - (void) setSearchMenuTemplate: (NSMenu *)menu; // search mode - (BOOL) sendsWholeSearchString; - (void) setSendsWholeSearchString: (BOOL)flag; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (BOOL) sendsSearchStringImmediately; - (void) setSendsSearchStringImmediately: (BOOL)flag; #endif // search results - (NSInteger) maximumRecents; - (void) setMaximumRecents: (NSInteger)max; - (NSArray *) recentSearches; - (NSString *) recentsAutosaveName; - (void) setRecentSearches: (NSArray *)searches; - (void) setRecentsAutosaveName: (NSString *)name; @end #endif #endif /* _GNUstep_H_NSSearchFieldCell */ gnustep-gui-0.24.0/Headers/AppKit/NSSegmentedControl.h0000664000076500007650000000504712107547001022376 0ustar brains99brains99/* NSSegmentedControl.h * * Copyright (C) 2007 Free Software Foundation, Inc. * * Author: Gregory John Casamento * Date: 2007 * * This file is part of GNUstep. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 * USA. */ #ifndef _GNUstep_H_NSSegmentedControl #define _GNUstep_H_NSSegmentedControl #import #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) typedef enum _NSSegmentStyle { NSSegmentStyleAutomatic = 0, NSSegmentStyleRounded = 1, NSSegmentStyleTexturedRounded = 2, NSSegmentStyleRoundRect = 3, NSSegmentStyleTexturedSquare = 4, NSSegmentStyleCapsule = 5, NSSegmentStyleSmallSquare = 6 } NSSegmentStyle; #endif @interface NSSegmentedControl : NSControl // Specifying number of segments... - (void) setSegmentCount: (NSInteger)count; - (NSInteger) segmentCount; // Specifying selected segment... - (void) setSelectedSegment: (NSInteger)segment; - (NSInteger) selectedSegment; - (void) selectSegmentWithTag: (NSInteger)tag; // Working with individual segments... - (void) setWidth: (CGFloat)width forSegment: (NSInteger)segment; - (CGFloat) widthForSegment: (NSInteger)segment; - (void) setImage: (NSImage *)image forSegment: (NSInteger)segment; - (NSImage *) imageForSegment: (NSInteger)segment; - (void) setLabel: (NSString *)label forSegment: (NSInteger)segment; - (NSString *) labelForSegment: (NSInteger)segment; - (void) setMenu: (NSMenu *)menu forSegment: (NSInteger)segment; - (NSMenu *) menuForSegment: (NSInteger)segment; - (void) setSelected: (BOOL)flag forSegment: (NSInteger)segment; - (BOOL) isSelectedForSegment: (NSInteger)segment; - (void) setEnabled: (BOOL)flag forSegment: (NSInteger)segment; - (BOOL) isEnabledForSegment: (NSInteger)segment; // Setting the style of the segments #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void)setSegmentStyle:(NSSegmentStyle)style; - (NSSegmentStyle)segmentStyle; #endif @end #endif gnustep-gui-0.24.0/Headers/AppKit/NSTabView.h0000664000076500007650000000704012035057417020465 0ustar brains99brains99/* NSTabView.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Michael Hanni Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSTabView #define _GNUstep_H_NSTabView #import #import #import typedef enum { NSTopTabsBezelBorder, NSLeftTabsBezelBorder, NSBottomTabsBezelBorder, NSRightTabsBezelBorder, NSNoTabsBezelBorder, NSNoTabsLineBorder, NSNoTabsNoBorder } NSTabViewType; @class NSFont; @class NSTabViewItem; @interface NSTabView : NSView { NSMutableArray *_items; NSFont *_font; NSTabViewType _type; NSTabViewItem *_selected; BOOL _draws_background; BOOL _truncated_label; id _delegate; NSView *_original_nextKeyView; NSUInteger _selected_item; } - (void)addTabViewItem:(NSTabViewItem *)tabViewItem; - (void)insertTabViewItem:(NSTabViewItem *)tabViewItem atIndex:(NSInteger)index; - (void)removeTabViewItem:(NSTabViewItem *)tabViewItem; - (NSInteger)indexOfTabViewItem:(NSTabViewItem *)tabViewItem; - (NSInteger)indexOfTabViewItemWithIdentifier:(id)identifier; - (NSInteger)numberOfTabViewItems; - (NSTabViewItem *)tabViewItemAtIndex:(NSInteger)index; - (NSArray *)tabViewItems; - (void)selectFirstTabViewItem:(id)sender; - (void)selectLastTabViewItem:(id)sender; - (void)selectNextTabViewItem:(id)sender; - (void)selectPreviousTabViewItem:(id)sender; - (void)selectTabViewItem:(NSTabViewItem *)tabViewItem; - (void)selectTabViewItemAtIndex:(NSInteger)index; - (void)selectTabViewItemWithIdentifier:(id)identifier; - (void)takeSelectedTabViewItemFromSender:(id)sender; - (NSTabViewItem*) selectedTabViewItem; - (void)setFont:(NSFont *)font; - (NSFont *)font; - (void)setTabViewType:(NSTabViewType)tabViewType; - (NSTabViewType)tabViewType; - (void)setDrawsBackground:(BOOL)flag; - (BOOL)drawsBackground; - (void)setAllowsTruncatedLabels:(BOOL)allowTruncatedLabels; - (BOOL)allowsTruncatedLabels; - (void)setDelegate:(id)anObject; - (id)delegate; - (NSSize)minimumSize; - (NSRect)contentRect; - (NSTabViewItem *)tabViewItemAtPoint:(NSPoint)point; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (NSControlSize)controlSize; - (NSControlTint)controlTint; - (void)setControlSize:(NSControlSize)controlSize; - (void)setControlTint:(NSControlTint)controlTint; #endif @end @interface NSObject(NSTabViewDelegate) - (BOOL)tabView:(NSTabView *)tabView shouldSelectTabViewItem:(NSTabViewItem *)tabViewItem; - (void)tabView:(NSTabView *)tabView willSelectTabViewItem:(NSTabViewItem *)tabViewItem; - (void)tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem; - (void)tabViewDidChangeNumberOfTabViewItems:(NSTabView *)TabView; @end #endif // _GNUstep_H_NSTabView /* Notifications */ gnustep-gui-0.24.0/Headers/AppKit/NSFontDescriptor.h0000664000076500007650000001142011352512421022056 0ustar brains99brains99/* NSFontDescriptor.h Holds an image to use as a cursor Copyright (C) 2007 Free Software Foundation, Inc. Author: Dr. H. Nikolaus Schaller Date: 2006 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSFontDescriptor #define _GNUstep_H_NSFontDescriptor #import #import #import #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) @class NSArray; @class NSCoder; @class NSDictionary; @class NSSet; @class NSString; @class NSAffineTransform; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) typedef uint32_t NSFontSymbolicTraits; typedef enum _NSFontFamilyClass { NSFontUnknownClass = 0 << 28, NSFontOldStyleSerifsClass = 1U << 28, NSFontTransitionalSerifsClass = 2U << 28, NSFontModernSerifsClass = 3U << 28, NSFontClarendonSerifsClass = 4U << 28, NSFontSlabSerifsClass = 5U << 28, NSFontFreeformSerifsClass = 7U << 28, NSFontSansSerifClass = 8U << 28, NSFontOrnamentalsClass = 9U << 28, NSFontScriptsClass = 10U << 28, NSFontSymbolicClass = 12U << 28 } NSFontFamilyClass; enum _NSFontFamilyClassMask { NSFontFamilyClassMask = 0xF0000000 }; enum _NSFontTrait { NSFontItalicTrait = 0x0001, NSFontBoldTrait = 0x0002, NSFontExpandedTrait = 0x0020, NSFontCondensedTrait = 0x0040, NSFontMonoSpaceTrait = 0x0400, NSFontVerticalTrait = 0x0800, NSFontUIOptimizedTrait = 0x1000 }; #endif APPKIT_EXPORT NSString *NSFontFamilyAttribute; APPKIT_EXPORT NSString *NSFontNameAttribute; APPKIT_EXPORT NSString *NSFontFaceAttribute; APPKIT_EXPORT NSString *NSFontSizeAttribute; APPKIT_EXPORT NSString *NSFontVisibleNameAttribute; APPKIT_EXPORT NSString *NSFontColorAttribute; APPKIT_EXPORT NSString *NSFontMatrixAttribute; APPKIT_EXPORT NSString *NSFontVariationAttribute; APPKIT_EXPORT NSString *NSFontCharacterSetAttribute; APPKIT_EXPORT NSString *NSFontCascadeListAttribute; APPKIT_EXPORT NSString *NSFontTraitsAttribute; APPKIT_EXPORT NSString *NSFontFixedAdvanceAttribute; APPKIT_EXPORT NSString *NSFontSymbolicTrait; APPKIT_EXPORT NSString *NSFontWeightTrait; APPKIT_EXPORT NSString *NSFontWidthTrait; APPKIT_EXPORT NSString *NSFontSlantTrait; APPKIT_EXPORT NSString *NSFontVariationAxisIdentifierKey; APPKIT_EXPORT NSString *NSFontVariationAxisMinimumValueKey; APPKIT_EXPORT NSString *NSFontVariationAxisMaximumValueKey; APPKIT_EXPORT NSString *NSFontVariationAxisDefaultValueKey; APPKIT_EXPORT NSString *NSFontVariationAxisNameKey; @interface NSFontDescriptor : NSObject { NSDictionary *_attributes; } + (id) fontDescriptorWithFontAttributes: (NSDictionary *)attributes; + (id) fontDescriptorWithName: (NSString *)name size: (CGFloat)size; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) + (id) fontDescriptorWithName: (NSString *)name matrix: (NSAffineTransform *)matrix; #endif - (NSDictionary *) fontAttributes; - (id) initWithFontAttributes: (NSDictionary *)attributes; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (NSFontDescriptor *) fontDescriptorByAddingAttributes: (NSDictionary *)attributes; - (NSFontDescriptor *) fontDescriptorWithFace: (NSString *)face; - (NSFontDescriptor *) fontDescriptorWithFamily: (NSString *)family; - (NSFontDescriptor *) fontDescriptorWithMatrix: (NSAffineTransform *)matrix; - (NSFontDescriptor *) fontDescriptorWithSize: (CGFloat)size; - (NSFontDescriptor *) fontDescriptorWithSymbolicTraits: (NSFontSymbolicTraits)traits; - (NSArray *) matchingFontDescriptorsWithMandatoryKeys: (NSSet *)keys; - (id) objectForKey: (NSString *)attribute; - (NSAffineTransform *) matrix; - (CGFloat) pointSize; - (NSString *) postscriptName; - (NSFontSymbolicTraits) symbolicTraits; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (NSFontDescriptor *) matchingFontDescriptorWithMandatoryKeys: (NSSet *)keys; #endif @end #endif /* OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) */ #endif /* _GNUstep_H_NSFontDescriptor */ gnustep-gui-0.24.0/Headers/AppKit/NSTextList.h0000664000076500007650000000314311023376255020704 0ustar brains99brains99/* -*-objc-*- NSTextList.h Copyright (C) 2008 Free Software Foundation, Inc. Author: Fred Kiefer Date: January 2008 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSTextList #define _GNUstep_H_NSTextList #import #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) #import @class NSString; enum { NSTextListPrependEnclosingMarker = 1 }; @interface NSTextList : NSObject { NSString *_markerFormat; unsigned int _listOptions; } - (id) initWithMarkerFormat: (NSString *)format options: (unsigned int)mask; - (unsigned int) listOptions; - (NSString *) markerForItemNumber: (int)item; - (NSString *) markerFormat; @end #endif #endif // _GNUstep_H_NSTextList gnustep-gui-0.24.0/Headers/AppKit/NSNibDeclarations.h0000664000076500007650000000262511775277400022177 0ustar brains99brains99/* NSNibDeclarations.h Declarations for types used by Interface Builder when reading header files. Copyright (C) 1999 Free Software Foundation, Inc. Author: Michael Giddings Date: Feb. 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _NSNibDeclarations_H_ #define _NSNibDeclarations_H_ #import #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) /* IBOutlet and IBAction are now built-in macros in recent Clang */ #if !defined(IBOutlet) #define IBOutlet #endif #if !defined(IBAction) #define IBAction void #endif #endif #endif gnustep-gui-0.24.0/Headers/AppKit/NSSecureTextField.h0000664000076500007650000000274011354602172022162 0ustar brains99brains99/* NSSecureTextField.h Secure text field control class for hidden text entry Copyright (C) 1999 Free Software Foundation, Inc. Author: Lyndon Tremblay Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSSecureTextField #define _GNUstep_H_NSSecureTextField #import #import @interface NSSecureTextField : NSTextField {} - (void) setEchosBullets:(BOOL)flag; - (BOOL) echosBullets; @end @interface NSSecureTextFieldCell : NSTextFieldCell { BOOL _echosBullets; } - (void) setEchosBullets:(BOOL)flag; - (BOOL) echosBullets; @end #endif /* _GNUstep_H_NSSecureTextField */ gnustep-gui-0.24.0/Headers/AppKit/NSDocument.h0000664000076500007650000003245611432163771020714 0ustar brains99brains99/* NSDocument.h The abstract document class Copyright (C) 1999 Free Software Foundation, Inc. Author: Carl Lindberg Date: 1999 Modifications: Fred Kiefer Date: Dec 2006 Added MacOS 10.4 methods. 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSDocument #define _GNUstep_H_NSDocument #import #import #import #import /* Foundation classes */ @class NSString; @class NSArray; @class NSMutableArray; @class NSData; @class NSDate; @class NSDictionary; @class NSError; @class NSFileManager; @class NSURL; @class NSUndoManager; /* AppKit classes */ @class NSWindow; @class NSView; @class NSSavePanel; @class NSMenuItem; @class NSPageLayout; @class NSPrintInfo; @class NSPrintOperation; @class NSPopUpButton; @class NSFileWrapper; @class NSDocumentController; @class NSWindowController; typedef enum _NSDocumentChangeType { NSChangeDone = 0, NSChangeUndone = 1, NSChangeCleared = 2, #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) NSChangeReadOtherContents = 3, NSChangeAutosaved = 4 #endif } NSDocumentChangeType; typedef enum _NSSaveOperationType { NSSaveOperation = 0, NSSaveAsOperation = 1, NSSaveToOperation = 2, #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) NSAutosaveOperation = 3 #endif } NSSaveOperationType; @interface NSDocument : NSObject { @private NSWindow *_window; // Outlet for the single window case NSMutableArray *_window_controllers; // WindowControllers for this document NSURL *_file_url; // Save location as URL NSString *_file_name; // Save location NSString *_file_type; // file/document type NSDate *_file_modification_date;// file modification date NSString *_last_component_file_name; // file name last component NSURL *_autosaved_file_url; // Autosave location as URL NSPrintInfo *_print_info; // print info record id _printOp_delegate; // delegate and selector called SEL _printOp_didRunSelector;// after modal print operation NSView *_save_panel_accessory; // outlet for the accessory save-panel view NSPopUpButton *_spa_button; // outlet for "the File Format:" button in the save panel. NSString *_save_type; // the currently selected extension. NSUndoManager *_undo_manager; // Undo manager for this document long _change_count; // number of time the document has been changed long _autosave_change_count; // number of time the document has been changed since the last autosave int _document_index; // Untitled index struct __docFlags { unsigned int in_close:1; unsigned int has_undo_manager:1; unsigned int permanently_modified:1; unsigned int autosave_permanently_modified:1; unsigned int RESERVED:28; } _doc_flags; void *_reserved1; } + (NSArray *)readableTypes; + (NSArray *)writableTypes; + (BOOL)isNativeType:(NSString *)type; /*" Initialization "*/ - (id)init; - (id)initWithContentsOfFile:(NSString *)fileName ofType:(NSString *)fileType; - (id)initWithContentsOfURL:(NSURL *)url ofType:(NSString *)fileType; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (id)initForURL:(NSURL *)forUrl withContentsOfURL:(NSURL *)url ofType:(NSString *)type error:(NSError **)error; - (id)initWithContentsOfURL:(NSURL *)url ofType:(NSString *)type error:(NSError **)error; - (id)initWithType:(NSString *)type error:(NSError **)error; #endif /*" Window management "*/ - (NSArray *)windowControllers; - (void)addWindowController:(NSWindowController *)windowController; #if OS_API_VERSION(GS_API_MACOSX, MAC_OS_X_VERSION_10_4) - (BOOL)shouldCloseWindowController:(NSWindowController *)windowController; #endif #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void)shouldCloseWindowController:(NSWindowController *)windowController delegate:(id)delegate shouldCloseSelector:(SEL)callback contextInfo:(void *)contextInfo; #endif - (void)showWindows; - (void)removeWindowController:(NSWindowController *)windowController; - (void)setWindow:(NSWindow *)aWindow; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (NSWindow *)windowForSheet; #endif /*" Window controller creation "*/ - (void)makeWindowControllers; // Manual creation - (NSString *)windowNibName; // Automatic creation (Document will be the nib owner) /*" Window loading notifications "*/ // Only called if the document is the owner of the nib - (void)windowControllerWillLoadNib:(NSWindowController *)windowController; - (void)windowControllerDidLoadNib:(NSWindowController *)windowController; /*" Edited flag "*/ - (BOOL)isDocumentEdited; - (void)updateChangeCount:(NSDocumentChangeType)change; /*" Display Name (window title) "*/ - (NSString *)displayName; /*" Backup file "*/ - (BOOL)keepBackupFile; /*" Closing "*/ - (void)close; #if OS_API_VERSION(GS_API_MACOSX, MAC_OS_X_VERSION_10_4) - (BOOL)canCloseDocument; #endif #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void)canCloseDocumentWithDelegate:(id)delegate shouldCloseSelector:(SEL)shouldCloseSelector contextInfo:(void *)contextInfo; #endif /*" Type and location "*/ - (NSString *)fileName; - (void)setFileName:(NSString *)fileName; - (NSString *)fileType; - (void)setFileType:(NSString *)type; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (NSURL *)fileURL; - (void)setFileURL:(NSURL *)url; - (NSDate *)fileModificationDate; - (void)setFileModificationDate: (NSDate *)date; - (NSString *)lastComponentOfFileName; - (void)setLastComponentOfFileName:(NSString *)str; #endif /*" Read/Write/Revert "*/ - (NSData *)dataRepresentationOfType:(NSString *)type; - (BOOL)loadDataRepresentation:(NSData *)data ofType:(NSString *)type; - (NSFileWrapper *)fileWrapperRepresentationOfType:(NSString *)type; - (BOOL)loadFileWrapperRepresentation:(NSFileWrapper *)wrapper ofType:(NSString *)type; - (BOOL)writeToFile:(NSString *)fileName ofType:(NSString *)type; - (BOOL)readFromFile:(NSString *)fileName ofType:(NSString *)type; - (BOOL)revertToSavedFromFile:(NSString *)fileName ofType:(NSString *)type; - (BOOL)writeToURL:(NSURL *)url ofType:(NSString *)type; - (BOOL)readFromURL:(NSURL *)url ofType:(NSString *)type; - (BOOL)revertToSavedFromURL:(NSURL *)url ofType:(NSString *)type; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (NSData *)dataOfType:(NSString *)type error:(NSError **)error; - (NSFileWrapper *)fileWrapperOfType:(NSString *)type error:(NSError **)error; - (BOOL)readFromData:(NSData *)data ofType:(NSString *)type error:(NSError **)error; - (BOOL)readFromFileWrapper:(NSFileWrapper *)wrapper ofType:(NSString *)type error:(NSError **)error; - (BOOL)readFromURL:(NSURL *)url ofType:(NSString *)type error:(NSError **)error; - (BOOL)revertToContentsOfURL:(NSURL *)url ofType:(NSString *)type error:(NSError **)error; - (BOOL)writeSafelyToURL:(NSURL *)url ofType:(NSString *)type forSaveOperation:(NSSaveOperationType)op error:(NSError **)error; - (BOOL)writeToURL:(NSURL *)url ofType:(NSString *)type error:(NSError **)error; - (BOOL)writeToURL:(NSURL *)url ofType:(NSString *)type forSaveOperation:(NSSaveOperationType)op originalContentsURL:(NSURL *)orig error:(NSError **)error; #endif /*" Save panel "*/ - (BOOL)shouldRunSavePanelWithAccessoryView; #if OS_API_VERSION(GS_API_MACOSX, MAC_OS_X_VERSION_10_4) - (NSString *)fileNameFromRunningSavePanelForSaveOperation:(NSSaveOperationType)saveOperation; - (NSInteger)runModalSavePanel:(NSSavePanel *)savePanel withAccessoryView:(NSView *)accessoryView; #endif - (NSString *)fileTypeFromLastRunSavePanel; - (NSDictionary *)fileAttributesToWriteToFile: (NSString *)fullDocumentPath ofType: (NSString *)docType saveOperation: (NSSaveOperationType)saveOperationType; - (BOOL)writeToFile:(NSString *)fileName ofType:(NSString *)type originalFile:(NSString *)origFileName saveOperation:(NSSaveOperationType)saveOp; - (BOOL)writeWithBackupToFile:(NSString *)fileName ofType:(NSString *)fileType saveOperation:(NSSaveOperationType)saveOp; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (NSArray *)writableTypesForSaveOperation:(NSSaveOperationType)op; - (NSDictionary *)fileAttributesToWriteToURL:(NSURL *)url ofType:(NSString *)type forSaveOperation:(NSSaveOperationType)op originalContentsURL:(NSURL *)original error:(NSError **)error; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_1, GS_API_LATEST) - (BOOL)fileNameExtensionWasHiddenInLastRunSavePanel; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (NSString *)fileNameExtensionForType:(NSString *)typeName saveOperation:(NSSaveOperationType)saveOperation; #endif /*" Printing "*/ - (NSPrintInfo *)printInfo; - (void)setPrintInfo:(NSPrintInfo *)printInfo; - (BOOL)shouldChangePrintInfo:(NSPrintInfo *)newPrintInfo; - (IBAction)runPageLayout:(id)sender; - (NSInteger)runModalPageLayoutWithPrintInfo:(NSPrintInfo *)printInfo; - (IBAction)printDocument:(id)sender; - (void)printShowingPrintPanel:(BOOL)flag; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (BOOL)preparePageLayout:(NSPageLayout *)pageLayout; - (void)runModalPageLayoutWithPrintInfo:(NSPrintInfo *)info delegate:(id)delegate didRunSelector:(SEL)sel contextInfo:(void *)context; - (void)printDocumentWithSettings:(NSDictionary *)settings showPrintPanel:(BOOL)flag delegate:(id)delegate didPrintSelector:(SEL)sel contextInfo:(void *)context; - (NSPrintOperation *)printOperationWithSettings:(NSDictionary *)settings error:(NSError **)error; - (void)runModalPrintOperation:(NSPrintOperation *)op delegate:(id)delegate didRunSelector:(SEL)sel contextInfo:(void *)context; #endif /*" IB Actions "*/ - (IBAction)saveDocument:(id)sender; - (IBAction)saveDocumentAs:(id)sender; - (IBAction)saveDocumentTo:(id)sender; - (IBAction)revertDocumentToSaved:(id)sender; /*" Menus "*/ - (BOOL)validateMenuItem:(NSMenuItem *)anItem; - (BOOL)validateUserInterfaceItem:(id )anItem; /*" Undo "*/ - (NSUndoManager *)undoManager; - (void)setUndoManager:(NSUndoManager *)undoManager; - (BOOL)hasUndoManager; - (void)setHasUndoManager:(BOOL)flag; /* NEW delegate operations*/ - (void)saveToFile:(NSString *)fileName saveOperation:(NSSaveOperationType)saveOperation delegate:(id)delegate didSaveSelector:(SEL)didSaveSelector contextInfo:(void *)contextInfo; - (BOOL)prepareSavePanel:(NSSavePanel *)savePanel; - (void)saveDocumentWithDelegate:(id)delegate didSaveSelector:(SEL)didSaveSelector contextInfo:(void *)contextInfo; - (void)runModalSavePanelForSaveOperation:(NSSaveOperationType)saveOperation delegate:(id)delegate didSaveSelector:(SEL)didSaveSelector contextInfo:(void *)contextInfo; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (BOOL)saveToURL:(NSURL *)url ofType:(NSString *)type forSaveOperation:(NSSaveOperationType)op error:(NSError **)error; - (void)saveToURL:(NSURL *)url ofType:(NSString *)type forSaveOperation:(NSSaveOperationType)op delegate:(id)delegate didSaveSelector:(SEL)didSaveSelector contextInfo:(void *)contextInfo; /* Autosaving */ - (NSURL *)autosavedContentsFileURL; - (void)setAutosavedContentsFileURL:(NSURL *)url; - (void)autosaveDocumentWithDelegate:(id)delegate didAutosaveSelector:(SEL)didAutosaveSelector contextInfo:(void *)context; - (NSString *)autosavingFileType; - (BOOL)hasUnautosavedChanges; - (BOOL)presentError:(NSError *)error; - (void)presentError:(NSError *)error modalForWindow:(NSWindow *)window delegate:(id)delegate didPresentSelector:(SEL)sel contextInfo:(void *)context; - (NSError *)willPresentError:(NSError *)error; #endif @end #endif // _GNUstep_H_NSDocument gnustep-gui-0.24.0/Headers/AppKit/NSStatusItem.h0000664000076500007650000000533012203676404021226 0ustar brains99brains99/* NSStatusItem.h The status item class Copyright (C) 2013 Free Software Foundation, Inc. Author: Gregory Casamento Date: 2013 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ // FIXME: This class is currently a placeholder to allow compilation of // apps which require NSStatusItem. Currently there is not a clean, // cross-platform way to implement this functionality. #ifndef _GNUstep_H_NSStatusItem #define _GNUstep_H_NSStatusItem #import #import #import @class NSAttributedString; @class NSString; @class NSStatusBar; @class NSView; @class NSImage; @class NSMenu; @class NSMenuItem; @interface NSStatusItem : NSObject { @private NSMenuItem *_menuItem; NSStatusBar *_statusBar; NSView *_view; CGFloat _length; BOOL _highlightMode; } - (SEL) action; - (NSAttributedString*) attributedTitle; - (SEL) doubleAction; - (void) drawStatusBarBackgroundInRect: (NSRect)rect withHighlight: (BOOL)flag; - (BOOL) highlightMode; - (NSImage*) image; - (BOOL) isEnabled; - (CGFloat) length; - (NSMenu*) menu; - (void) popUpStatusItemMenu: (NSMenu*)menu; - (void) sendActionOn: (NSInteger)mask; - (void) setAction: (SEL)action; - (void) setAttributedTitle: (NSAttributedString*)title; - (void) setDoubleAction: (SEL)sel; - (void) setEnabled: (BOOL)flag; - (void) setHighlightMode: (BOOL)highlightMode; - (void) setImage: (NSImage*)image; - (void) setLength: (CGFloat)length; - (void) setMenu: (NSMenu*)menu; - (void) setTarget: (id)target; - (void) setTitle: (NSString*)title; - (void) setToolTip: (NSString*)toolTip; - (void) setView: (NSView*)view; - (NSStatusBar*) statusBar; - (id) target; - (NSString*) title; - (NSString*) toolTip; - (NSView*) view; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (NSImage*) alternateImage; - (void) setAlternateImage: (NSImage*)img; #endif @end #endif // _GNUstep_H_NSStatusItem gnustep-gui-0.24.0/Headers/AppKit/NSBrowserCell.h0000664000076500007650000000362711352512421021346 0ustar brains99brains99/* NSBrowserCell.h Cell class for the NSBrowser Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSBrowserCell #define _GNUstep_H_NSBrowserCell #import #import @class NSImage; @interface NSBrowserCell : NSCell { // Attributes NSImage *_alternateImage; // Think of the following ones as of two BOOL ivars #define _browsercell_is_leaf _cell.subclass_bool_one #define _browsercell_is_loaded _cell.subclass_bool_two } // // Accessing Graphic Attributes // + (NSImage *)branchImage; + (NSImage *)highlightedBranchImage; - (NSImage *)alternateImage; - (void)setAlternateImage:(NSImage *)anImage; - (NSColor *)highlightColorInView: (NSView *)controlView; // // Placing in the Browser Hierarchy // - (BOOL)isLeaf; - (void)setLeaf:(BOOL)flag; // // Determining Loaded Status // - (BOOL)isLoaded; - (void)setLoaded:(BOOL)flag; // // Setting State // - (void)reset; - (void)set; @end #endif // _GNUstep_H_NSBrowserCell gnustep-gui-0.24.0/Headers/AppKit/NSColorList.h0000664000076500007650000001171211514372530021034 0ustar brains99brains99/* NSColorList.h Manage named lists of NSColors. Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Nicola Pero Date: 2000 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSColorList #define _GNUstep_H_NSColorList #import #import #import @class NSString; @class NSArray; @class NSMutableArray; @class NSDictionary; @class NSMutableDictionary; @class NSColor; @interface NSColorList : NSObject { NSString* _name; NSString* _fullFileName; BOOL _is_editable; // Color Lists are required to be a sort of ordered dictionary // For now it is implemented as follows (Scott Christley, 1996): // This object contains couples (keys (=color names), values (=colors)) NSMutableDictionary* _colorDictionary; // This object contains the keys (=color names) in order NSMutableArray* _orderedColorKeys; } // // Initializing an NSColorList // /** * Initializes a new, empty color list registered under given name. */ - (id) initWithName: (NSString *)name; /** *

Initializes a new color list registered under given name, taking * contents from the file specified in path. (Path should include the * filename with extension (usually ".clr"), and by convention name should be * the same as filename without the extension.)

* *

The format of the file can be either an archive of an NSColorList * or an ASCII format. ASCII files follow this format:

* *

first line = [#/colors]
* each subsequent line describes a color as [int float+ string]
* the first int describes the method (RGBA, etc.), the floats * provide its arguments (e.g., r, g, b, alpha), and string is name.

* *

The method corresponds to one of the [NSColor] initializers. * We are looking for documentation of the exact correspondence on OpenStep; * for now the only supported method is "0", which is an RGBA format with * the arguments in order R,G,B, A.

*/ - (id) initWithName: (NSString *)name fromFile: (NSString *)path; // // Getting All Color Lists // + (NSArray *) availableColorLists; /** Returns the first color list (from the array of available lists) * matching name. */ + (NSColorList *) colorListNamed: (NSString *)name; /** Returns an array containing all the keyus in the color list */ - (NSArray *) allKeys; /** Returns the color for the specified key (if any). */ - (NSColor *) colorWithKey: (NSString *)key; /** * Returns a flag indicating whether the receiver is editable. */ - (BOOL) isEditable; /** Inserts a color into the color list at the specified index. * Removes any other color with the same name. */ - (void) insertColor: (NSColor *)color key: (NSString *)key atIndex: (unsigned)location; /** * Returns the name of the receiver. */ - (NSString *) name; /** Removes the color for the specified key from the list. */ - (void) removeColorWithKey: (NSString *)key; /** Removes the on-disk representation of the list. */ - (void) removeFile; /** * Sets the color for this key and appends it to the color list. */ - (void) setColor: (NSColor *)aColor forKey: (NSString *)key; /** * Writes the receiver to the specified path.
* If path is nil, writes to a file located in the current user's personal * Colors directory whose name is that of the list with the extension * 'clr' appended.
* If path is a directory, writes to a file in that directory whose name * is that of the list with the extension 'clr' appended.
* Otherwise (path is neither nil nor a directory), writes to the path * without appending the l.ist name.
* Returns YES on success, NO on failure.
* Writing with a path of nil will cause the receiver to be added to the * +availableColorLists if it is not already there. */ - (BOOL) writeToFile: (NSString *)path; // // NSCoding protocol // - (void) encodeWithCoder: (NSCoder *)aCoder; - (id) initWithCoder: (NSCoder *)aDecoder; @end /* Notifications */ APPKIT_EXPORT NSString *NSColorListDidChangeNotification; #endif // _GNUstep_H_NSColorList gnustep-gui-0.24.0/Headers/AppKit/NSShadow.h0000664000076500007650000000317411352624326020355 0ustar brains99brains99/* -*-objc-*- NSShadow.h GUI implementation of a shadow effect. Copyright (C) 2009 Free Software Foundation, Inc. Author: Eric Wasylishen Date: Dec 2009 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSShadow #define _GNUstep_H_NSShadow #import #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) #import #import @class NSColor; @interface NSShadow : NSObject { NSSize _offset; CGFloat _radius; NSColor *_color; } - (NSSize) shadowOffset; - (void) setShadowOffset: (NSSize)offset; - (CGFloat) shadowBlurRadius; - (void) setShadowBlurRadius: (CGFloat)radius; - (NSColor *) shadowColor; - (void) setShadowColor: (NSColor *)color; - (void) set; @end #endif #endif gnustep-gui-0.24.0/Headers/AppKit/NSMenu.h0000664000076500007650000006574712216136511020044 0ustar brains99brains99/* NSMenu.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: May 1997 A completely rewritten version of the original source by Scott Christley. This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSMenu #define _GNUstep_H_NSMenu #import #import #import #import #import @class NSString; @class NSEvent; @class NSFont; @class NSMatrix; @class NSPopUpButton; @class NSPopUpButtonCell; @class NSView; @class NSWindow; @class NSMutableArray; @class NSScreen; /* ******************* */ /* NSMenuView Protocol */ /* ******************* */ @protocol NSMenuView /** Set the menu that this view object will be drawing. * This method will NOT retain the menu. * In normal usage an instance of NSMenu will * use this method to supply the NSMenuView with reference * to itself. The NSMenu will retain the NSMenuView. */ - (void) setMenu: (NSMenu *)menu; /** Set the currently highlighted item. * This is used by the NSMenu class to restore * the selected item when it is temporary set to * another item. This happens when both the regular * version and the transient version are on the screen. * A value of -1 means that no item will be highlighted. */ - (void) setHighlightedItemIndex: (NSInteger)index; /** Returns the currently highlighted item. Returns -1 * if no item is highlighted. */ - (NSInteger) highlightedItemIndex; /** This should ensure that if there is an attached * submenu this submenu will be detached. * Detaching means that this particular menu representation * should be removed from the screen. * It should implement a deep detach, that is, all * attached submenus of this menu should also be detached. */ - (void) detachSubmenu; /** This will relayout the NSMenuView. * It should be called when the menu changes. Changes include * becoming detached, adding or removing submenu items etcetera. * However, normally it does not need to be called directly because * Because the NSMenuView is supposed to listen to the NSMenu notifications * for the item added, removed and change notifications. * It should be called explicitly when other changes occur, such as * becoming detached or changing the title. */ - (void) update; /** Hm, why is this method needed? Shouldn't this be done by * the update method? */ - (void) sizeToFit; //!!! /** Method used by NSMenuItemCell to draw itself correctly and nicely * lined up with the other menu items. */ - (float) stateImageWidth; /** Method used by NSMenuItemCell to draw itself correctly and nicely * lined up with the other menu items */ - (float) imageAndTitleOffset; /** Methos used by NSMenuItemCell to draw itself correctly and nicely * lined up with the other menu items. */ - (float) imageAndTitleWidth; /** Methos used by NSMenuItemCell to draw itself correctly and nicely * lined up with the other menu items. */ - (float) keyEquivalentOffset; /** Used by NSItemCell to ... */ - (float) keyEquivalentWidth; /** Used by the NSMenu to determine where to position a * submenu. */ - (NSPoint) locationForSubmenu: (NSMenu *)aSubmenu; - (void) performActionWithHighlightingForItemAtIndex: (NSInteger)index; //???? /**

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

*

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

*

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

*

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

*

The implementation should roughly follow the following logic: *

* * { * while (have not released mouse button) * { * if (mouse hovers over submenu, or supermenu) * { * if ([(menurepresentation under mouse) * trackWithEvent: the event]) * { * [self detachSubmenu]; * return YES; * } * return NO; * } * //highlight item under mouse * * if (highlighting submenu item) * { * [self attachSubmenuAtIndex:..]; * } * else * { * [self detachSubmenu]; * } * get next event. * } * * execute the menu action if applicable; * * return YES | NO depending on the situation; * } * * * Note that actual implementations tend to be more complicated because * because of all kind of useability issues. Useabilities issues to * look out for are: * * Menus that are only partly on the screen. Those need to be * moved while navigation the menu. * Submenus that are hard to reach. If the natural route to * the content of a submenu travels through other menu items * you do not want to remove the submenu immediately. * Transient menus require slightly different behaviour from * the normal menus. For example, when selecting a action from * a transient menu that brings up a modal panel you would * expect the transient menu to dissappear. However in the * normal menu system you want it to stay, so you still have * feedback on which menu action triggered the modal panel. * */ - (BOOL) trackWithEvent: (NSEvent *)event; @end /** * The NSMenuDelegate protocol defines optional methods implemented * by delegates of NSMenu objects. */ @protocol NSMenuDelegate /** * Allows the delegate to return the target and action for a key-down event. */ - (BOOL) menuHasKeyEquivalent: (NSMenu *)menu forEvent: (NSEvent *)event target: (id *)target action: (SEL *)action; /** * Invoked on the delegate to allow changes before the menu opens. */ - (void) menuWillOpen: (NSMenu *)menu; /** * Invoked when the menu is about to be displayed. */ - (NSInteger) numberOfItemsInMenu: (NSMenu *)menu; /** * Invoked to indicate that the menu is about to be updated. */ - (void) menuNeedsUpdate: (NSMenu *)menu; /** * Invoked to inform the delegate that the menu did close. */ - (void) menuDidClose: (NSMenu *)menu; /** * Invoked too notify the delegate that the item will be highlighted. */ - (void) menu: (NSMenu *)menu willHighlightItem: (NSMenuItem *)item; /** * Invoked to allow the delegate to update an item before * it is displayed. */ - (BOOL) menu: (NSMenu *)menu updateItem: (NSMenuItem *)item atIndex: (NSInteger)index shouldCancel: (BOOL)shouldCancel; /** * Specify a display location for the menu */ - (NSRect)confinementRectForMenu: (NSMenu *)menu onScreen: (NSScreen *)screen; @end /**

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

*

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

*

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

*

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

*

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

*

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

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

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

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

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

* The user clicks on a submenu item which is highlighted
* This means that the submenu is an attached submenu for this * menu. After clicking the submenu item will no be no longer * highlighted and the submenu will be removed from the screen.
* The user drags over a menu item
* The item will be highlighted, if the item is a submenu item, * the submenu will be shown as an attached submenu. This can * be transient, or non transient.
*
* *
* Customizing the look of Menus *
* * There are basically three ways of customizing the look of NSMenu * * Using custom NSMenuItemCell's. This you should do when you * want to influence the look of the items displayed in the * menu. * Using custom NSMenuView. This is the class to modify if * you want to change the way the menu is layout on the screen. * So if you want to stack the menu items horizontally, you * should change this class. This should be rarely needed. * Reimplement NSMenu. This you should not do. But, if you * implement everything yourself you can achieve anything. * * *
* Information for implementing custom NSMenuView class *
* When implementing a custom NSMenuView class it is important * to keep the following information in mind. * * * The menus (or the menu items) form a tree. Navigating * through this tree is done with the methods * [NSMenu-supermenu], which returns the parent menu * of the receiver, and with [NSMenu-itemAtIndex:] which returns * a NSMenuItem on which we can call [(NSMenuItem)-submenu] for * a child menu. * The menus as displayed on the screen do NOT form a tree. * This because detached and transient menus lead to duplicate * menus on the screen. * * * The displayed menus on the screen have the following structure: * * The ordered graph of displayed menus (note, NOT the set of * NSMenus) form a collection of line graphs. * The attached menus are precisely the non root vertices in * this graph. * An attached menu of a transient menu is itself a transient * menu. * The collection of transient menus form connect subgraph of * the menu graph. * * */ @interface NSMenu : NSObject { NSString *_title; NSMutableArray *_items; NSView* _view; NSMenu *_superMenu; NSMenu *_attachedMenu; NSMutableArray *_notifications; id _delegate; // GNUstepExtra category NSPopUpButtonCell *_popUpButtonCell; struct GSMenuFlags { unsigned int changedMessagesEnabled: 1; unsigned int autoenable: 1; unsigned int needsSizing: 1; unsigned int is_tornoff: 1; unsigned int transient: 1; unsigned int horizontal: 1; unsigned int mainMenuChanged: 1; unsigned int unused: 25; } _menu; @private NSWindow *_aWindow; NSWindow *_bWindow; NSMenu *_oldAttachedMenu; int _oldHiglightedIndex; NSString *_name; } /** Returns the memory allocation zone used to create instances of this class. */ + (NSZone*) menuZone; /** Specifies the memory allocation zone used to create instances of this class. */ + (void) setMenuZone: (NSZone*)zone; + (void) popUpContextMenu: (NSMenu*)menu withEvent: (NSEvent*)event forView: (NSView*)view; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) + (void) popUpContextMenu: (NSMenu *)menu withEvent: (NSEvent *)event forView: (NSView *)view withFont: (NSFont *)font; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) + (BOOL) menuBarVisible; + (void) setMenuBarVisible: (BOOL)flag; #endif /** Add newItem to the menu. */ - (void) addItem: (id )newItem; /** Prefered method for inserting a menu item. This method calls * [NSMenu-insertItemWithTitle:-action:-keyEquivalent:-atIndex:] * * aString * The title of the specific menu item. * aSelector * The action taken by selecting this menu item, or NULL. * keyEquiv * The shortcut key for this menu item. If none is needed, * specify and empty NSString, ie: @"". * *

See Also: -insertItemWithTitle:-action:-keyEquivalent:-atIndex

*/ - (id ) addItemWithTitle: (NSString *)aString action: (SEL)aSelector keyEquivalent: (NSString *)keyEquiv; /** Returns the menu that is attached to this menu. *

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

*

* If no menu is attached return nil.

*/ - (NSMenu*) attachedMenu; /** Returns YES if item does autoenable (default value) and NO otherwise. *

See Also: *

* * -setAutoenablesItems: * */ - (BOOL) autoenablesItems; #if OS_API_VERSION(MAC_OS_X_VERSION_10_0, MAC_OS_X_VERSION_10_1) - (id) contextMenuRepresentation; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (id) delegate; #endif /* Displaying Context-Sensitive Help */ - (void) helpRequested: (NSEvent*)event; /** Returns the index of item anObject. */ - (NSInteger) indexOfItem: (id )anObject; /** Returns the index of an item with the tag aTag. */ - (NSInteger) indexOfItemWithTag: (NSInteger)aTag; /** Returns the index of an item with the target anObject * and the actionSelector. */ - (NSInteger) indexOfItemWithTarget: (id)anObject andAction: (SEL)actionSelector; /** Returns the index of an item with the represented object anObject. */ - (NSInteger) indexOfItemWithRepresentedObject: (id)anObject; /** Returns the index of an item with the submenu anObject. */ - (NSInteger) indexOfItemWithSubmenu: (NSMenu *)anObject; /** Returns the index of an item with the title aTitle. */ - (NSInteger) indexOfItemWithTitle: (NSString *)aTitle; /** */ - (id) initWithTitle: (NSString*)aTitle; /** Insert newItem at position index. */ - (void) insertItem: (id )newItem atIndex: (NSInteger)index; /** Inserts a new menu item at position index. *

See Also: *

* * -addItemWithTitle:-action:-keyEquivalent-atIndex: * */ - (id ) insertItemWithTitle: (NSString *)aString action: (SEL)aSelector keyEquivalent: (NSString *)charCode atIndex: (NSInteger)index; /** Returns if this menu is attached to its supermenu, * return nil if it does not have a parent menu. *

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

*/ - (BOOL) isAttached; /** If there are two instances of this menu visible, return NO. * Otherwise, return YES if we are a detached menu and visible. */ - (BOOL) isTornOff; /** * Returns an array containing all menu items in this menu. */ - (NSArray*) itemArray; /** Returns an item located at index. */ - (id ) itemAtIndex: (NSInteger)index; /** Informs the menu that the specified item has changed. */ - (void) itemChanged: (id )anObject; /** Retuns an item referenced by aTag. *

See Also: *

* * -indexOfItemWithTag: * [(NSMenuItem)-tag] * */ - (id ) itemWithTag: (NSInteger)aTag; /** Returns an item with aString as its title. */ - (id ) itemWithTitle: (NSString*)aString; /** Returns the position where submenu will be displayed * when it will be displayed as an attached menu of this menu. * The result is undefined when aSubmenu is not actually a submenu * of this menu. */ - (NSPoint) locationForSubmenu: (NSMenu*)aSubmenu; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (float)menuBarHeight; #endif - (BOOL) menuChangedMessagesEnabled; /** Return the NSView that is used for drawing * the menu. * It is the view set with [NSMenu-setMenuRepresentation:] and * therefore it should be safe to assume it is an NSView * implementing the NSMenuView protocol. */ - (id) menuRepresentation; /** Returns the numbers of items on the menu */ - (NSInteger) numberOfItems; /** Simulates a mouse click on item located at index. *

See Also: *

* * -indexOfItem: * -indexOfItemWithTitle: * */ - (void) performActionForItemAtIndex: (NSInteger)index; /** Looks for a menu item that responds to theEvent on the receiver. If * the receiver is a submenu, the method is performed on it. */ - (BOOL) performKeyEquivalent: (NSEvent*)theEvent; /** Calls -removeItemAtIndex: for anItem. */ - (void) removeItem: (id )anItem; /** Removes item at position index. */ - (void) removeItemAtIndex: (NSInteger)index; /** Sets if a menu does autoenable. */ - (void) setAutoenablesItems: (BOOL)flag; #if OS_API_VERSION(MAC_OS_X_VERSION_10_0, MAC_OS_X_VERSION_10_1) - (void) setContextMenuRepresentation: (id)representation; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (void) setDelegate:(id) delegate; #endif - (void) setMenuChangedMessagesEnabled: (BOOL)flag; /** Set the View that should be used to display the menu. *

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

* * Inherits from NSView * Implements NSMenuView protocol * */ - (void) setMenuRepresentation: (id) menuRep; /** Set a submenu of a menu. * * aMenu * The submenu to be inserted. * anItem * Item to be turned into a submenu. * *

See Also: *

* * [(NSMenuItem)-setSubmenu:] * */ - (void) setSubmenu: (NSMenu*)aMenu forItem: (id )anItem; /** Set the supermenu of this menu. * TODO: add explanation if this will change remove this menu * from the old supermenu or if it does not. */ - (void) setSupermenu: (NSMenu *)supermenu; #if OS_API_VERSION(MAC_OS_X_VERSION_10_0, MAC_OS_X_VERSION_10_1) - (void) setTearOffMenuRepresentation: (id)representation; #endif /** Change the title of the menu. */ - (void) setTitle: (NSString*)aTitle; - (void) sizeToFit; - (void) submenuAction: (id)sender; /** Returns the supermenu of this menu. Return nil * if this is the application menu. */ - (NSMenu*) supermenu; #if OS_API_VERSION(MAC_OS_X_VERSION_10_0, MAC_OS_X_VERSION_10_1) - (id) tearOffMenuRepresentation; #endif /** Returns the current title. */ - (NSString*) title; - (void) update; @end /** * Specifies the protocol to which an object must confirm if it is to be * used to validate menu items (in order to implement automatic enabling * and disabling of menu items). */ @protocol NSMenuValidation /**

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

*

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

*/ - (BOOL) validateMenuItem: (id)menuItem; @end #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) @interface NSObject (NSMenuDelegate) - (void) menuNeedsUpdate: (NSMenu *)menu; - (NSInteger) numberOfItemsInMenu: (NSMenu *)menu; - (BOOL) menu: (NSMenu *)menu updateItem: (NSMenuItem *)item atIndex: (NSInteger)index shouldCancel: (BOOL)shouldCancel; - (BOOL) menuHasKeyEquivalent: (NSMenu *)menu forEvent: (NSEvent *)event target: (id *)target action: (SEL *)action; @end #endif #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) @interface NSObject (NSMenuActionResponder) - (BOOL) validateMenuItem: (id)aMenuItem; @end /** This interface exist contains methods that are meant * for the NSMenuView. If you write your own implementation * of the NSMenuView interface you can use these methods * to popup other menus or close them. */ @interface NSMenu (GNUstepExtra) /** Remove the window from the screen. This method can/should be * used by the menurepresentation to remove a submenu from the screen. */ - (void) close; /** Remove the transient version of the window from the screen. * This method is used by NSMenuView implementations that need * to open/close transient menus. */ - (void) closeTransient; /** Show menu on the screen. This method can/should be used by * the menurepresentation to display a submenu on the screen. */ - (void) display; /** Display the transient version of the menu. */ - (void) displayTransient; - (BOOL) isPartlyOffScreen; /** Returns YES if there is a transient version * of this menu displayed on the screen. */ - (BOOL) isTransient; /* Moving menus */ - (void) nestedSetFrameOrigin: (NSPoint)aPoint; /** Flag this menu to be the main menu of the application, * when isMain is YES. Flag it as no longer being the main * menu when NO is handed in. *

This method also checks the user defaults to determine how * the menu is to be displayed (eg vertical or horizontal) and can * therefore be used to change window geometry.

*/ - (void) setMain: (BOOL)isMain; /** When the flag is YES * this method will detach the receiver from its parent and * update the menurepresentation so it will display a close * button if appropriate. *

* If the flag is NO this method will update the menurepresentation * so it will be able to remove the close button if needed. * Note that it will not reattach to its parent menu.

*/ - (void) setTornOff: (BOOL) flag; /* Shift partly off-screen menus */ - (void) shiftOnScreen; /** Returns the window in which this menu is displayed. * If there is a transient version it will return the * window in which the transient version is displayed. * If the Menu is not displayed at all the result * is meaningless. */ - (NSWindow*) window; /* Popup behaviour */ - (BOOL) _ownedByPopUp; - (NSPopUpButtonCell *)_owningPopUp; - (void) _setOwnedByPopUp: (NSPopUpButtonCell*)popUp; @end #endif APPKIT_EXPORT NSString* const NSMenuDidSendActionNotification; APPKIT_EXPORT NSString* const NSMenuWillSendActionNotification; APPKIT_EXPORT NSString* const NSMenuDidAddItemNotification; APPKIT_EXPORT NSString* const NSMenuDidRemoveItemNotification; APPKIT_EXPORT NSString* const NSMenuDidChangeItemNotification; #endif // _GNUstep_H_NSMenu gnustep-gui-0.24.0/Headers/AppKit/NSTextAttachment.h0000664000076500007650000001452011354602172022057 0ustar brains99brains99/* NSTextAttachment.h Classes to represent text attachments. Copyright (C) 1996 Free Software Foundation, Inc. Author: Daniel Böhringer Date: August 1998 Source by Daniel Böhringer integrated into GNUstep gui by Felipe A. Rodriguez This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /** NSTextAttachment is used to represent text attachments. When inline, text attachments appear as the value of the NSAttachmentAttributeName attached to the special character NSAttachmentCharacter. NSTextAttachment uses an object obeying the NSTextAttachmentCell protocol to get input from the user and to display an image. NSTextAttachmentCell is a simple subclass of NSCell which provides the NSTextAttachment protocol. */ #ifndef _GNUstep_H_NSTextAttachment #define _GNUstep_H_NSTextAttachment #import #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) #import #import #import #import @class NSFileWrapper; @class NSLayoutManager; @class NSTextAttachment; @class NSTextContainer; enum { NSAttachmentCharacter = 0xfffc /* To denote attachments. */ }; /* These are the only methods required of cells in text attachments... The default NSCell class implements most of these; the NSTextAttachmentCell class is a subclass which implements all and provides some additional functionality. */ @protocol NSTextAttachmentCell - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView; - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView characterIndex:(unsigned)charIndex; - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView characterIndex:(unsigned)charIndex layoutManager:(NSLayoutManager *)layoutManager; - (void)highlight:(BOOL)flag withFrame:(NSRect)cellFrame inView:(NSView *)controlView; /** The old way of placing the cell. The text system will never call these directly (TODO: make sure it doesn't), but other things might. The class implements the new method by calling these, so subclasses can easily change behavior by overriding these. **/ - (NSSize)cellSize; /* Returns the offset from the current point when typesetting to the lower left corner of the cell. The class returns (0,0). Positive y is probably up. (TODO) */ - (NSPoint)cellBaselineOffset; /** The new way of placing the cell. **/ /* Returns the rectangle in which the cell should be drawn. The rectangle is relative to the current point when typesetting. Positive y is up. lineFrag is the line frag rect that this cell might be placed in, and position is the current position in that line frag rect (positive y is up). Note that the line frag rect and glyph position may not be where the cell is actually placed. Note that this might be called many times for the same attachment. Eg. if you return a rectangle that won't fit in the proposed line frag rect, the typesetter might try to adjust things so it will fit. It will then send this message with a new proposed line frag rect and glyph position. Thus, great care must be taken when using the line frag rect to calculate the returned rectangle to prevent the typesetting process from getting stuck. The class uses -cellSize and -cellBaselineOffset to return a rect. */ -(NSRect) cellFrameForTextContainer: (NSTextContainer *)textContainer proposedLineFragment: (NSRect)lineFrag glyphPosition: (NSPoint)position characterIndex: (unsigned int)charIndex; - (BOOL)wantsToTrackMouse; - (BOOL)wantsToTrackMouseForEvent:(NSEvent *)theEvent inRect:(NSRect)cellFrame ofView:(NSView *)controlView atCharacterIndex:(unsigned)charIndex; - (BOOL)trackMouse:(NSEvent *)theEvent inRect:(NSRect)cellFrame ofView:(NSView *)controlView untilMouseUp:(BOOL)flag; - (BOOL)trackMouse:(NSEvent *)theEvent inRect:(NSRect)cellFrame ofView:(NSView *)controlView atCharacterIndex:(unsigned)charIndex untilMouseUp:(BOOL)flag; - (void)setAttachment:(NSTextAttachment *)anObject; - (NSTextAttachment *)attachment; @end /* Simple class to provide basic attachment cell functionality. By default this class causes NSTextView to send out delegate messages when the attachment is clicked on or dragged. */ @interface NSTextAttachmentCell : NSCell { NSTextAttachment *_attachment; } @end @interface NSTextAttachment : NSObject { NSFileWrapper *_fileWrapper; id _cell; } /* Designated initializer. */ - (id)initWithFileWrapper:(NSFileWrapper *)fileWrapper; /* The fileWrapper is the meat of most types of attachment. It can be set or queried with these methods. An NSTextAttachment usually has a fileWrapper. setFileWrapper does not update the attachment's cell in any way. */ - (void)setFileWrapper:(NSFileWrapper *)fileWrapper; - (NSFileWrapper *)fileWrapper; /* The cell which handles user interaction. By default an instance of NSTextAttachmentCell is used. */ - (id )attachmentCell; - (void)setAttachmentCell:(id )cell; @end @interface NSAttributedString (NSTextAttachment) + (NSAttributedString*) attributedStringWithAttachment: (NSTextAttachment*)attachment; - (BOOL) containsAttachments; @end @interface NSMutableAttributedString (NSTextAttachment) - (void) updateAttachmentsFromPath: (NSString *)path; @end #endif #endif /* _GNUstep_H_NSTextAttachment */ gnustep-gui-0.24.0/Headers/AppKit/NSOpenGLView.h0000664000076500007650000000335711353745723021120 0ustar brains99brains99/** -*-ObjC-*- Copyright (C) 2002 Free Software Foundation, Inc. Author: Frederic De Jaeger Date: Nov 2002 This file is part of the GNU Objective C User interface library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _NSOpenGLView_h #define _NSOpenGLView_h #import #import @class NSOpenGLContext; @class NSOpenGLPixelFormat; @interface NSOpenGLView : NSView { NSOpenGLContext *glcontext; NSOpenGLPixelFormat *pixel_format; BOOL prepared; } + (NSOpenGLPixelFormat*) defaultPixelFormat; - (void) clearGLContext; - (void) setOpenGLContext: (NSOpenGLContext*)context; - (NSOpenGLContext*) openGLContext; - (id) initWithFrame: (NSRect)frameRect pixelFormat: (NSOpenGLPixelFormat*)format; - (NSOpenGLPixelFormat*) pixelFormat; - (void) setPixelFormat: (NSOpenGLPixelFormat*)pixelFormat; - (void) reshape; - (void) update; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (void) prepareOpenGL; #endif @end #endif gnustep-gui-0.24.0/Headers/AppKit/NSNibLoading.h0000664000076500007650000000366211351153376021141 0ustar brains99brains99/* NSNibLoading.h Copyright (C) 1997, 1999 Free Software Foundation, Inc. Author: Simon Frankau Date: 1997 Author: Richard Frith-Macdonald Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSNibLoading #define _GNUstep_H_NSNibLoading #import #import #import #import @class NSString; @class NSDictionary; @class NSMutableDictionary; @interface NSObject (NSNibAwaking) /* * Notification of Loading */ - (void) awakeFromNib; @end @interface NSBundle (NSNibLoading) + (BOOL) loadNibFile: (NSString *)fileName externalNameTable: (NSDictionary *)context withZone: (NSZone *)zone; + (BOOL) loadNibNamed: (NSString *)aNibName owner: (id)owner; - (BOOL) loadNibFile: (NSString *)fileName externalNameTable: (NSDictionary *)context withZone: (NSZone *)zone; #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) - (NSString *) pathForNibResource: (NSString *)fileName; #endif // GS_API_NONE @end #endif /* _GNUstep_H_NSNibLoading */ gnustep-gui-0.24.0/Headers/AppKit/NSGradient.h0000664000076500007650000000565011352624326020666 0ustar brains99brains99/* -*-objc-*- NSGradient.h GUI implementation of a colour gradient. Copyright (C) 2009 Free Software Foundation, Inc. Author: Fred Kiefer Date: Oct 2009 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSGradient #define _GNUstep_H_NSGradient #import #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) #import #import @class NSArray; @class NSBezierPath; @class NSColor; @class NSColorSpace; typedef NSUInteger NSGradientDrawingOptions; enum { NSGradientDrawsBeforeStartingLocation = 1, NSGradientDrawsAfterEndingLocation = 2 }; @interface NSGradient : NSObject { NSColorSpace *_colorSpace; NSArray *_colors; CGFloat *_locations; NSInteger _numberOfColorStops; } - (NSColorSpace *) colorSpace; - (void) drawFromCenter: (NSPoint)startCenter radius: (CGFloat)startRadius toCenter: (NSPoint)endCenter radius: (CGFloat)endRadius options: (NSGradientDrawingOptions)options; - (void) drawFromPoint: (NSPoint)startPoint toPoint: (NSPoint)endPoint options: (NSGradientDrawingOptions)options; - (void) drawInBezierPath: (NSBezierPath *)path angle: (CGFloat)angle; - (void) drawInBezierPath: (NSBezierPath *)path relativeCenterPosition: (NSPoint)relativeCenterPoint; - (void) drawInRect: (NSRect)rect angle: (CGFloat)angle; - (void) drawInRect: (NSRect)rect relativeCenterPosition: (NSPoint)relativeCenterPoint; - (void) getColor: (NSColor **)color location: (CGFloat *)locatuib atIndex: (NSInteger)index; - (id) initWithColors: (NSArray *)colArray; - (id) initWithColors: (NSArray *)colArray atLocations: (const CGFloat *)locs colorSpace: (NSColorSpace *)colSpace; - (id) initWithColorsAndLocations: (NSColor *)color, ...; - (id) initWithStartingColor: (NSColor *)startColor endingColor: (NSColor *)endColor; - (NSColor *) interpolatedColorAtLocation: (CGFloat)location; - (NSInteger) numberOfColorStops; @end #endif #endif // _GNUstep_H_NSGradient gnustep-gui-0.24.0/Headers/AppKit/NSResponder.h0000664000076500007650000001765011354602172021072 0ustar brains99brains99/* NSResponder.h Abstract class which is basis of command and event processing Copyright (C) 1996,1999 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSResponder #define _GNUstep_H_NSResponder #import #import #import #import @class NSCoder; @class NSError; @class NSString; @class NSEvent; @class NSMenu; @class NSUndoManager; @class NSWindow; @interface NSResponder : NSObject { PACKAGE_SCOPE #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) NSInterfaceStyle _interface_style; #else int _interface_style; #endif @protected NSResponder *_next_responder; /* Due to interface brain-damage, both NSResponder and NSMenuView have -menu and -setMenu: methods, but for different menus. Thus, to prevent (future, there have already been some) problems and confusion, this ivar is private (iow, it can't be accidentally used in NSMenuView). */ @private NSMenu *_menu; } /* * Instance methods */ /* * Managing the next responder */ - (NSResponder*) nextResponder; - (void) setNextResponder: (NSResponder*)aResponder; /* * Determining the first responder */ - (BOOL) acceptsFirstResponder; - (BOOL) becomeFirstResponder; - (BOOL) resignFirstResponder; /* * Aid event processing */ - (BOOL) performKeyEquivalent: (NSEvent*)theEvent; - (BOOL) tryToPerform: (SEL)anAction with: (id)anObject; /* * Forwarding event messages */ - (void) flagsChanged: (NSEvent*)theEvent; - (void) helpRequested: (NSEvent*)theEvent; - (void) keyDown: (NSEvent*)theEvent; - (void) keyUp: (NSEvent*)theEvent; - (void) mouseDown: (NSEvent*)theEvent; - (void) mouseDragged: (NSEvent*)theEvent; - (void) mouseEntered: (NSEvent*)theEvent; - (void) mouseExited: (NSEvent*)theEvent; - (void) mouseMoved: (NSEvent*)theEvent; - (void) mouseUp: (NSEvent*)theEvent; - (void) noResponderFor: (SEL)eventSelector; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void) otherMouseDown: (NSEvent*)theEvent; - (void) otherMouseDragged: (NSEvent*)theEvent; - (void) otherMouseUp: (NSEvent*)theEvent; #endif - (void) rightMouseDown: (NSEvent*)theEvent; - (void) rightMouseDragged: (NSEvent*)theEvent; - (void) rightMouseUp: (NSEvent*)theEvent; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void) scrollWheel: (NSEvent *)theEvent; #endif /* * Services menu support */ - (id) validRequestorForSendType: (NSString*)typeSent returnType: (NSString*)typeReturned; /* * NSCoding protocol */ - (void) encodeWithCoder: (NSCoder*)aCoder; - (id) initWithCoder: (NSCoder*)aDecoder; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void) interpretKeyEvents: (NSArray*)eventArray; - (BOOL) performMnemonic: (NSString*)aString; - (void) flushBufferedKeyEvents; - (void) doCommandBySelector: (SEL)aSelector; /**

Tells the receiver to insert the given string. In a text view the text is typically inserted at the insertion point, and replaces any selection.

Subclasses should override this method. The implementation in NSResponder just sends the message on to the next responder.

Normally, aString will be an NSString, but in some cases, it might be an NSAttributedString.

*/ - (void) insertText: (id)aString; - (NSUndoManager*) undoManager; /* * Menu */ - (NSMenu*) menu; - (void) setMenu: (NSMenu*)aMenu; /* * Setting the interface */ - (NSInterfaceStyle) interfaceStyle; - (void) setInterfaceStyle: (NSInterfaceStyle)aStyle; - (BOOL) shouldBeTreatedAsInkEvent: (NSEvent *)theEvent; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (BOOL)presentError:(NSError *)error; - (void)presentError:(NSError *)error modalForWindow:(NSWindow *)window delegate:(id)delegate didPresentSelector:(SEL)sel contextInfo:(void *)context; - (NSError *)willPresentError:(NSError *)error; #endif @end #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) @interface NSResponder (OptionalActionMethods) - (void) capitalizeWord: (id)sender; - (void) centerSelectionInVisibleArea: (id)sender; - (void) changeCaseOfLetter: (id)sender; - (void) complete: (id)sender; - (void) deleteBackward: (id)sender; - (void) deleteForward: (id)sender; - (void) deleteToBeginningOfLine: (id)sender; - (void) deleteToBeginningOfParagraph: (id)sender; - (void) deleteToEndOfLine: (id)sender; - (void) deleteToEndOfParagraph: (id)sender; - (void) deleteToMark: (id)sender; - (void) deleteWordBackward: (id)sender; - (void) deleteWordForward: (id)sender; - (void) indent: (id)sender; - (void) insertBacktab: (id)sender; - (void) insertNewline: (id)sender; - (void) insertNewlineIgnoringFieldEditor: (id)sender; - (void) insertParagraphSeparator: (id)sender; - (void) insertTab: (id)sender; - (void) insertTabIgnoringFieldEditor: (id)sender; - (void) lowercaseWord: (id)sender; - (void) moveBackward: (id)sender; - (void) moveBackwardAndModifySelection: (id)sender; - (void) moveDown: (id)sender; - (void) moveDownAndModifySelection: (id)sender; - (void) moveForward: (id)sender; - (void) moveForwardAndModifySelection: (id)sender; - (void) moveLeft: (id)sender; - (void) moveRight: (id)sender; - (void) moveToBeginningOfDocument: (id)sender; - (void) moveToBeginningOfLine: (id)sender; - (void) moveToBeginningOfParagraph: (id)sender; - (void) moveToEndOfDocument: (id)sender; - (void) moveToEndOfLine: (id)sender; - (void) moveToEndOfParagraph: (id)sender; - (void) moveUp: (id)sender; - (void) moveUpAndModifySelection: (id)sender; - (void) moveWordBackward: (id)sender; - (void) moveWordBackwardAndModifySelection: (id)sender; - (void) moveWordForward: (id)sender; - (void) moveWordForwardAndModifySelection: (id)sender; - (void) pageDown: (id)sender; - (void) pageUp: (id)sender; - (void) scrollLineDown: (id)sender; - (void) scrollLineUp: (id)sender; - (void) scrollPageDown: (id)sender; - (void) scrollPageUp: (id)sender; - (void) scrollToBeginningOfDocument: (id)sender; - (void) scrollToEndOfDocument: (id)sender; - (void) selectAll: (id)sender; - (void) selectLine: (id)sender; - (void) selectParagraph: (id)sender; - (void) selectToMark: (id)sender; - (void) selectWord: (id)sender; - (void) setMark: (id)sender; - (void) showContextHelp: (id)sender; - (void) swapWithMark: (id)sender; - (void) transpose: (id)sender; - (void) transposeWords: (id)sender; - (void) uppercaseWord: (id)sender; - (void) yank: (id)sender; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (void) cancelOperation: (id)sender; - (void) deleteBackwardByDecomposingPreviousCharacter: (id)sender; - (void) moveLeftAndModifySelection: (id)sender; - (void) moveRightAndModifySelection: (id)sender; - (void) moveWordLeft: (id)sender; - (void) moveWordLeftAndModifySelection: (id)sender; - (void) moveWordRight: (id)sender; - (void) moveWordRightAndModifySelection: (id)sender; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (void) insertContainerBreak: (id)sender; - (void) insertLineBreak: (id)sender; - (void) tabletPoint:(NSEvent *)event; - (void) tabletProximity:(NSEvent *)event; #endif @end #endif #endif /* _GNUstep_H_NSResponder */ gnustep-gui-0.24.0/Headers/AppKit/NSMenuView.h0000664000076500007650000003154012102212557020656 0ustar brains99brains99/* NSMenuView.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Michael Hanni Date: June 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSMenuView #define _GNUstep_H_NSMenuView #import #import #import //#import #import @class NSArray; @class NSMutableArray; @class NSNotification; @class NSString; @class NSColor; @class NSMenuItemCell; @class NSPopUpButton; @class NSEvent; @class NSFont; @class NSScreen; @class NSWindow; /** The NSMenu class uses an object implementing the NSMenuView protocol to do the actual drawing.

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

How menus are drawn

This class implements several menu look and feels at the same time. The looks and feels implemented are: Ordinary vertically stacked menus with the NeXT submenu positioning behavour. Vertically stacked menus with the WindowMaker submenu placement. This behaviour is selected by choosing the GSWindowMakerInterfaceStyle. PopupButtons are actually menus. This class implements also the behaviour for the NSPopButtons. See for the the class NSPopButton. */ @interface NSMenuView : NSView { NSMutableArray *_itemCells; BOOL _horizontal; char _pad1[3]; NSFont *_font; int _highlightedItemIndex; float _horizontalEdgePad; float _stateImageOffset; float _stateImageWidth; float _imageAndTitleOffset; float _imageAndTitleWidth; float _keyEqOffset; float _keyEqWidth; BOOL _needsSizing; char _pad2[3]; NSSize _cellSize; @private id _items_link; int _leftBorderOffset; id _titleView; /* Private and not named '_menu' to avoid confusion and further problems with NSResponder's menu. */ NSMenu *_attachedMenu; } /*********************************************************************** * Initializing a menu view ***********************************************************************/ /** Creates new instance and sets menu to torn off state with NSMenu's setTornOff:. */ - (id) initAsTearOff; /*********************************************************************** * Getting and setting menu view attributes ***********************************************************************/ /** Returns the height of the menu bar. */ + (float) menuBarHeight; /** Sets the menu to be displayed in to menu. Also this method adds this menu view to the menu's list of observers, mark view to force recalculation of layout with setNeedsSizing:YES, and updates itself with update method. */ - (void) setMenu: (NSMenu *)menu; /** Returns the NSMenu associated with this menu view. */ - (NSMenu *) menu; /** Sets menu orientation. If YES menu items are displayed from left to right, if NO from top to bottom (vertically). By default, menu items are displayed vertically. */ - (void) setHorizontal: (BOOL)flag; /** Returns YES if menu items are displayed horizontally, NO if vertically. */ - (BOOL) isHorizontal; /** Sets the default font to use when drawing the menu text. */ - (void) setFont: (NSFont *)font; /** Returns the default font used to draw the menu text. */ - (NSFont *) font; /** Highlights item with at index. If index is -1 all highlighing is removed. */ - (void) setHighlightedItemIndex: (NSInteger)index; /** Returns the index of the highlighted item. Returns -1 if there is no highlighted item. */ - (NSInteger) highlightedItemIndex; /** Replaces item cell at index with cell. Highlighting of item is preserved. */ - (void) setMenuItemCell: (NSMenuItemCell *)cell forItemAtIndex: (NSInteger)index; /** Returns cell associated with item at index. */ - (NSMenuItemCell *) menuItemCellForItemAtIndex: (NSInteger)index; /** Returns menu view associated with visible attached submenu. */ - (NSMenuView *) attachedMenuView; /** Returns visible attached submenu. */ - (NSMenu *) attachedMenu; /** Returns YES, if this object is an visivle attached submenu's view. Returns NO otherwise. */ - (BOOL) isAttached; /** Returns YES, if this object is associated with torn off menu (menu with a close button on title bar). */ - (BOOL) isTornOff; /** Returns horizontal space used for padding between menu item elements (state image, title image, title, key equivalent, submenu arrow image). */ - (float) horizontalEdgePadding; /** Sets amount of pixels added between menu item elements to pad. */ - (void) setHorizontalEdgePadding: (float)pad; /*********************************************************************** * Notification methods ***********************************************************************/ /** Marks menu item cell associated with the menu item and menu view as needing to be resized. This method is invoked when NSMenuDidChangeItemNotification received. The notification parameter contains index of changed menu item and can be accessed with NSMenuItemIndex key. */ - (void) itemChanged: (NSNotification *)notification; /** Creates new item cell for the newly created menu item, marks cell and menu view as needing to be resized. This method is invoked when NSMenuDidAddItemNotification received. The notification parameter contains index of changed menu item and can be accessed with NSMenuItemIndex key. */ - (void) itemAdded: (NSNotification *)notification; /** Removes cell associated with removed menu item, removes highlighting if removed menu item was highlighted, marks cell and menu view as needing to be resized. This method is invoked when NSMenuDidRemoveItemNotification received. The notification parameter contains index of changed menu item and can be accessed with NSMenuItemIndex key. */ - (void) itemRemoved: (NSNotification *)notification; /*********************************************************************** * Working with submenus ***********************************************************************/ /** * Detaches currently visible submenu window from main menu. */ - (void) detachSubmenu; /** Attach submenu if the item at index is a submenu. It will figure out if the new submenu should be transient or not. */ - (void) attachSubmenuForItemAtIndex: (NSInteger)index; /*********************************************************************** * Calculating menu geometry ***********************************************************************/ /** Adds title view for application menu and submenus, removes title view if menu is owned by NSPopUpButton, adds close button to title view for torn off menus and removes it for other type of menu. */ - (void) update; /** Sets the flag whether layout needs to be resized. Set it to YES if menu contents changed and layout needs to be recalculated. This method is used internally. Yout should not invoke it directly from applications. */ - (void) setNeedsSizing: (BOOL)flag; /** Return YES if menu view contents changed and needs to be resized. */ - (BOOL) needsSizing; /** */ - (void) sizeToFit; /** Returns the starting horizontal position for drawing the state image. */ - (float) stateImageOffset; /** Returns the width of the state image. */ - (float) stateImageWidth; /** Returns the starting horizontal position for drawing the image and title. */ - (float) imageAndTitleOffset; /** Returns the width of the image and title section. Tis section contains image and text of menu item. */ - (float) imageAndTitleWidth; /** Returns the starting position for drawing the key equivalent. Key equivalent can be submenu arrow if menu item has submenu. */ - (float) keyEquivalentOffset; /** Returns the width of key equivalent text. Key equivalent can be submenu arrow if menu item has submenu */ - (float) keyEquivalentWidth; /** Returns bounds rectangle of the menu view. It is smaller by 1 pixel in width than menu window (dark gray border at left). */ - (NSRect) innerRect; /** Returns frame rectangle of menu item cell. It is smaller by 1 pixel in width than menu window (dark gray border). */ - (NSRect) rectOfItemAtIndex: (NSInteger)index; /** Returns the index of the item below point. Returns -1 if mouse is not above a menu item. */ - (NSInteger) indexOfItemAtPoint: (NSPoint)point; /** Calls setNeedsDisplayInRect: for rectangle occupied by item at index. */ - (void) setNeedsDisplayForItemAtIndex: (NSInteger)index; /** Returns the correct frame origin for aSubmenu based on the location of the receiver. This location may depend on the current NSInterfaceStyle. */ - (NSPoint) locationForSubmenu:(NSMenu *) aSubmenu; /** Resize menu view frame to be appropriate in size to attach to screenRect at preferredEdge. For popup's menu, if selectedItemIndex is other than -1, position view so selected item covers the NSPopUpButton.
NOTE: preffered edge positioning doesn't implemented yet! */ - (void) setWindowFrameForAttachingToRect: (NSRect)screenRect onScreen: (NSScreen *)screen preferredEdge: (NSRectEdge)edge popUpSelectedItem: (NSInteger)selectedItemIndex; /*********************************************************************** * Event handling ***********************************************************************/ - (void) performActionWithHighlightingForItemAtIndex: (NSInteger)index; /** This method is responsible for tracking the mouse while this menu is on the screen and the user is busy navigating the menu or one of it submenus. Responsible does not mean that this method does it all. For submenus for example it will call, indirectly, itself for submenu under consideration. It will return YES if user released mouse, not above a submenu item. NO in all other circumstances. Implementation detail: It use periodic events to update the highlight state and attach / detach submenus. The flag justAttachedNewSubmenu is set to YES when a new submenu is attached. The effect is that the highlighting / attaching / detaching is supressed for this menu. This is done so the user is given a change to move the mouse pointer into the newly attached submenu. Otherwise it would immediately be removed as the mouse pointer move over another item. The logic for resetting the flag is rather adhoc. the flag subMenusNeedRemoving means that we will remove all the submenus after we are done. This flag is used to clean up the submenus when the user has opened a submenu by clicking and wants to close it again by clicking on the hihglighted item. When the user released the mouse this method will cleanup all the transient menus. Not only its own, but also its attached menu and all its transient super menus. The clean up is done BEFORE the action is executed. This is needed otherwise `hiding' the application leaves a dangling menu. If this is not acceptable, there should be another mechanism of handling the hiding. BTW besides the `hiding' the application, model panels are also a problem when the menu is not cleared before executing the action. */ - (BOOL) trackWithEvent: (NSEvent *)event; @end #endif gnustep-gui-0.24.0/Headers/AppKit/NSTextContainer.h0000664000076500007650000002127612110256537021720 0ustar brains99brains99/* NSTextContainer.h Text container for text system Copyright (C) 1999, 2003 Free Software Foundation, Inc. Author: Alexander Malmberg Date: April 2003 Author: Jonathan Gapen Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /** A text container defines a region in the plane. It is used by the text system to lay out text: text is laid out inside this region. A layout manager has a list of text containers that it lays out text in. A text container may have one NSTextView attached to it that displays the text laid out in the text container. Note that the coordinate system used by NSTextContainer is the same as in the rest of the text system classes, ie. positive y is down. NSTextContainer itself defines a simple rectangular region as large as the container size. In most cases, only a single, simple text container is used with a layout manager and a text view. Examples of cases where you might want to use several text containers, or subclasses that define more complex regions, are: Multi-page layout; one text container for each page. Multi-column layout; one text container for each column. Layout flowing around pictures; the text container would define a region that does not include the space used by the picture. If the region defined by a text container can change dynamically, the text container should call [GSLayoutManager-textContainerChangedGeometry:] whenever this happens. */ #ifndef _GNUstep_H_NSTextContainer #define _GNUstep_H_NSTextContainer #import #if GS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) #import #import @class GSLayoutManager; @class NSTextView; enum { NSLineSweepLeft, NSLineSweepRight, NSLineSweepDown, NSLineSweepUp }; typedef NSUInteger NSLineSweepDirection; enum { NSLineDoesntMove, NSLineMovesLeft, NSLineMovesRight, NSLineMovesDown, NSLineMovesUp }; typedef NSUInteger NSLineMovementDirection; @interface NSTextContainer : NSObject { id _layoutManager; id _textView; NSRect _containerRect; CGFloat _lineFragmentPadding; BOOL _observingFrameChanges; BOOL _widthTracksTextView; BOOL _heightTracksTextView; } /** Initializes a new instance and sets the container size to aSize. */ - (id) initWithContainerSize: (NSSize)aSize; /** Querying the region */ /** Returns YES if the region for this container is a rectangle as large as the container size, otherwise NO. For simple rectangular regions, the text system can apply certain optimizations. NSTextContainer always returns YES. Subclasses that define more complex regions must return NO. */ - (BOOL) isSimpleRectangularTextContainer; /** This is the main method used by the text system for querying the region and flowing text in it. It takes a proposed line fragment rectangle and, if possible, splits it into a valid line fragment rectangle, and a remaining rectangle that can be used in subsequent calls to this method. sweepDir is the direction that text moves inside the lines, and moveDir is the direction lines move in, or NSLineDoesntMove if the line may not move. The line sweep and line movement may not both be in the same dimension, ie. both be vertical, or both be horizontal. The method returns the first (according to the sweep direction) valid line fragment rectangle in the proposed rectangle. This line fragment rectangle is a sub-rectangle of the proposed rectangle in the sweep direction, and has the same size in the other direction. (Ie. if the sweep direction is left, the line fragment rectangle must have the same height as the proposed rectangle.) If there is no valid line fragment rectangle in the proposed rectangle, the proposed rectangle may be moved in the line movement direction until there is one. If no valid line fragment rectangle can be returned, the method returns NSZeroRect. The remaining rectangle should be set to the potentially valid part of the proposed rectangle, after moving in the line movement direction, that remains after the first line fragment rectangle. The proposed rectangle may be any rectangle; in particular, it may extend outside the container size. The remaining rectangle does not have to be or contain a valid line fragment rectangle. Subclasses define regions by overriding this method. Note: The TextContainerExample in the text system example collection (TODO: link) contains an example implementation of an NSTextContainer subclass that defiens a non-trivial region, as well as an interactive demonstration of this method. It can also be used as a simple test of custom subclasses. Note: Although a correct NSTextContainer implementation must handle all line sweep and movement directions, the current standard typesetter will only call this method with sweep right, and no movement or movement down. Relying on this makes writing a subclass easier, but it is not safe. */ - (NSRect) lineFragmentRectForProposedRect: (NSRect)proposedRect sweepDirection: (NSLineSweepDirection)sweepDir movementDirection: (NSLineMovementDirection)moveDir remainingRect: (NSRect *)remainingRect; /** Returns YES if aPoint is inside the region. Subclasses define regions by overriding this method. */ - (BOOL) containsPoint: (NSPoint)aPoint; /** Managing the text network
A text container may be attached to one layout manager and one text view. The text container is retained by the layout manager, and retains the text view. */ /** Replaces the layout manager of this text container with aLayoutManager. This is done without changing the rest of the text network, so aLayoutManager will be connected to the text storage and text containers that the current layout manager is connected to. */ - (void) replaceLayoutManager: (GSLayoutManager *)aLayoutManager; /** Returns the layout manager of this text container. */ - (GSLayoutManager *) layoutManager; /** This method should not be called directly. It is called by the layout manager when the layout manager of a text container changes. */ - (void) setLayoutManager: (GSLayoutManager *)aLayoutManager; /** Sets the NSTextView for this text container. Note that a text view should be attached to a text container only if the text container is attached to a layout manager that can handle text views (eg. NSLayoutManager). The text view is retained by the text container. */ - (void) setTextView: (NSTextView *)aTextView; /** Returns the NSTextView attached to this text container, or nil if there is none. */ - (NSTextView *) textView; /** The container size
A text container has a container size. The region defined by the text container must be a subset of the rectangle of this size with it's top-left corner in the origin. Subclasses do not have to support arbitrary sizes, and may choose to ignore -setContainerSize: completely. However, the size returned by -containerSize must be valid. */ - (void) setContainerSize: (NSSize)aSize; - (NSSize) containerSize; /** Automatic resizing
A text container can be set to automatically track the width and/or height of its NSTextView (TODO: frame? bounds?). For more information, see the documentation on automatic resizing in NSTextView. (TODO: link) When enabled, the automatic resizing is done by calling [NSTextContainer-setContainerSize:] with the new size whenever the text view is resized. */ - (void) setWidthTracksTextView: (BOOL)flag; - (BOOL) widthTracksTextView; - (void) setHeightTracksTextView: (BOOL)flag; - (BOOL) heightTracksTextView; /** Line fragment padding
The line fragment padding is an amount of space left empty at each end of a line fragment rectangle by the standard typesetter. The default is 0.0. */ - (void) setLineFragmentPadding: (CGFloat)aFloat; - (CGFloat) lineFragmentPadding; @end #else #error "The OpenStep specification does not define an NSTextContainer class." #endif #endif /* _GNUstep_H_NSTextContainer */ gnustep-gui-0.24.0/Headers/AppKit/NSToolbar.h0000664000076500007650000001152412102166206020520 0ustar brains99brains99/* NSToolbar.h The toolbar class. Copyright (C) 2002, 2004, 2009 Free Software Foundation, Inc. Author: Gregory John Casamento , Fabien Vallon , Quentin Mathe Date: May 2002, February 2004 Author: Fred Kiefer Date: January 2009 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSToolbar #define _GNUstep_H_NSToolbar #import #import #import @class NSArray; @class NSString; @class NSMutableArray; @class NSDictionary; @class NSMutableDictionary; @class NSNotification; @class NSToolbarItem; @class GSToolbarView; @class NSWindow; /* * Constants */ typedef enum { NSToolbarDisplayModeDefault, NSToolbarDisplayModeIconAndLabel, NSToolbarDisplayModeIconOnly, NSToolbarDisplayModeLabelOnly } NSToolbarDisplayMode; #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) typedef enum { NSToolbarSizeModeDefault, NSToolbarSizeModeRegular, NSToolbarSizeModeSmall, } NSToolbarSizeMode; #endif APPKIT_EXPORT NSString *NSToolbarDidRemoveItemNotification; APPKIT_EXPORT NSString *NSToolbarWillAddItemNotification; @interface NSToolbar : NSObject { NSDictionary *_configurationDictionary; id _delegate; NSString *_identifier; NSString *_selectedItemIdentifier; NSMutableArray *_items; GSToolbarView *_toolbarView; NSToolbarDisplayMode _displayMode; #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) NSToolbarSizeMode _sizeMode; #else int _sizeMode; #endif BOOL _allowsUserCustomization; BOOL _autosavesConfiguration; BOOL _visible; BOOL _customizationPaletteIsRunning; BOOL _showsBaselineSeparator; BOOL _build; NSDictionary *_interfaceBuilderItemsByIdentifier; NSArray *_interfaceBuilderAllowedItemIdentifiers; NSArray *_interfaceBuilderDefaultItemIdentifiers; NSArray *_interfaceBuilderSelectableItemIdentifiers; } // Instance methods - (id) initWithIdentifier: (NSString*)identifier; - (void) insertItemWithItemIdentifier: (NSString*)itemIdentifier atIndex: (NSInteger)index; - (void) removeItemAtIndex: (NSInteger)index; - (void) runCustomizationPalette: (id)sender; - (void) validateVisibleItems; // Accessors - (BOOL) allowsUserCustomization; - (BOOL) autosavesConfiguration; - (NSDictionary*) configurationDictionary; - (BOOL) customizationPaletteIsRunning; - (id) delegate; - (NSToolbarDisplayMode) displayMode; - (NSString*) identifier; - (NSArray*) items; - (NSArray*) visibleItems; - (BOOL) isVisible; - (void) setAllowsUserCustomization: (BOOL)flag; - (void) setAutosavesConfiguration: (BOOL)flag; - (void) setConfigurationFromDictionary: (NSDictionary*)configDict; - (void) setDelegate: (id)delegate; - (void) setDisplayMode: (NSToolbarDisplayMode)displayMode; - (void) setVisible: (BOOL)shown; #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) - (NSToolbarSizeMode) sizeMode; - (void) setSizeMode: (NSToolbarSizeMode)sizeMode; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (NSString *) selectedItemIdentifier; - (void) setSelectedItemIdentifier: (NSString *) identifier; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (BOOL) showsBaselineSeparator; - (void) setShowsBaselineSeparator: (BOOL)flag; #endif @end /* interface of NSToolbar */ /* * Methods Implemented by the Delegate */ @interface NSObject (NSToolbarDelegate) // notification methods - (void) toolbarDidRemoveItem: (NSNotification*)aNotification; - (void) toolbarWillAddItem: (NSNotification*)aNotification; // delegate methods // required method - (NSToolbarItem*)toolbar: (NSToolbar*)toolbar itemForItemIdentifier: (NSString*)itemIdentifier willBeInsertedIntoToolbar: (BOOL)flag; // required method - (NSArray*) toolbarAllowedItemIdentifiers: (NSToolbar*)toolbar; // required method - (NSArray*) toolbarDefaultItemIdentifiers: (NSToolbar*)toolbar; // optional method - (NSArray *) toolbarSelectableItemIdentifiers: (NSToolbar *)toolbar; @end #endif /* _GNUstep_H_NSToolbar */ gnustep-gui-0.24.0/Headers/AppKit/NSTableView.h0000664000076500007650000003654112217654156021023 0ustar brains99brains99/* NSTableView.h The table class. Copyright (C) 2000 Free Software Foundation, Inc. Author: Nicola Pero Date: March 2000 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSTableView #define _GNUstep_H_NSTableView #import #import #import @class NSArray; @class NSIndexSet; @class NSMutableIndexSet; @class NSTableColumn; @class NSTableHeaderView; @class NSText; @class NSImage; @class NSURL; typedef enum _NSTableViewDropOperation { NSTableViewDropOn, NSTableViewDropAbove } NSTableViewDropOperation; enum { NSTableViewGridNone = 0, NSTableViewSolidVerticalGridLineMask = 1 << 0, NSTableViewSolidHorizontalGridLineMask = 1 << 1, NSTableViewDashedHorizontalGridLineMask = 1 << 3 }; typedef NSUInteger NSTableViewGridLineStyle; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) typedef enum _NSTableViewColumnAutoresizingStyle { NSTableViewNoColumnAutoresizing = 0, NSTableViewUniformColumnAutoresizingStyle, NSTableViewSequentialColumnAutoresizingStyle, NSTableViewReverseSequentialColumnAutoresizingStyle, NSTableViewLastColumnOnlyAutoresizingStyle, NSTableViewFirstColumnOnlyAutoresizingStyle } NSTableViewColumnAutoresizingStyle; #endif @interface NSTableView : NSControl { /* * Real Ivars */ id _dataSource; NSMutableArray *_tableColumns; BOOL _drawsGrid; NSColor *_gridColor; NSColor *_backgroundColor; float _rowHeight; NSSize _intercellSpacing; id _delegate; NSTableHeaderView *_headerView; NSView *_cornerView; SEL _action; SEL _doubleAction; id _target; int _clickedRow; int _clickedColumn; NSTableColumn *_highlightedTableColumn; NSMutableIndexSet *_selectedColumns; NSMutableIndexSet *_selectedRows; int _selectedColumn; int _selectedRow; BOOL _allowsMultipleSelection; BOOL _allowsEmptySelection; BOOL _allowsColumnSelection; BOOL _allowsColumnResizing; BOOL _allowsColumnReordering; BOOL _autoresizesAllColumnsToFit; BOOL _selectingColumns; NSText *_textObject; int _editedRow; int _editedColumn; NSCell *_editedCell; BOOL _autosaveTableColumns; NSString *_autosaveName; BOOL _verticalMotionDrag; NSArray *_sortDescriptors; /* * Ivars Acting as Control... */ BOOL _isValidating; /* * Ivars Acting as Cache */ int _numberOfRows; int _numberOfColumns; /* YES if _delegate responds to tableView:willDisplayCell:forTableColumn:row: */ BOOL _del_responds; /* YES if _dataSource responds to tableView:setObjectValue:forTableColumn:row: */ BOOL _dataSource_editable; /* * We cache column origins (precisely, the x coordinate of the left * origin of each column). When a column width is changed through * [NSTableColumn setWidth:], then [NSTableView tile] gets called, * which updates the cache. */ float *_columnOrigins; /* * We keep the superview's width in order to know when to * size the last column to fit */ float _superview_width; /* if YES [which happens only during a sizeToFit], we are doing computations on sizes so we ignore tile (produced for example by the NSTableColumns) during the computation. We perform a global tile at the end */ BOOL _tilingDisabled; NSDragOperation _draggingSourceOperationMaskForLocal; NSDragOperation _draggingSourceOperationMaskForRemote; } /* Data Source */ - (void) setDataSource: (id)anObject; - (id) dataSource; /* Loading data */ - (void) reloadData; /* Target-action */ - (void) setDoubleAction: (SEL)aSelector; - (SEL) doubleAction; - (NSInteger) clickedColumn; - (NSInteger) clickedRow; /* Configuration */ - (void) setAllowsColumnReordering: (BOOL)flag; - (BOOL) allowsColumnReordering; - (void) setAllowsColumnResizing: (BOOL)flag; - (BOOL) allowsColumnResizing; - (void) setAllowsMultipleSelection: (BOOL)flag; - (BOOL) allowsMultipleSelection; - (void) setAllowsEmptySelection: (BOOL)flag; - (BOOL) allowsEmptySelection; - (void) setAllowsColumnSelection: (BOOL)flag; - (BOOL) allowsColumnSelection; /* Drawing Attributes */ - (void) setIntercellSpacing: (NSSize)aSize; - (NSSize) intercellSpacing; - (void) setRowHeight: (CGFloat)rowHeight; - (CGFloat) rowHeight; - (void) setBackgroundColor: (NSColor *)aColor; - (NSColor *) backgroundColor; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (void) setUsesAlternatingRowBackgroundColors: (BOOL)useAlternatingRowColors; - (BOOL) usesAlternatingRowBackgroundColors; #endif /* Columns */ - (void) addTableColumn: (NSTableColumn *)aColumn; - (void) removeTableColumn: (NSTableColumn *)aColumn; - (void) moveColumn: (NSInteger)columnIndex toColumn: (NSInteger)newIndex; - (NSArray *) tableColumns; - (NSInteger) columnWithIdentifier: (id)identifier; - (NSTableColumn *) tableColumnWithIdentifier: (id)anObject; /* Selecting Columns and Rows */ - (void) selectColumn: (NSInteger) columnIndex byExtendingSelection: (BOOL)flag; - (void) selectRow: (NSInteger) rowIndex byExtendingSelection: (BOOL)flag; - (void) selectColumnIndexes: (NSIndexSet *)indexes byExtendingSelection: (BOOL)extend; - (void) selectRowIndexes: (NSIndexSet *)indexes byExtendingSelection: (BOOL)extend; - (NSIndexSet *) selectedColumnIndexes; - (NSIndexSet *) selectedRowIndexes; - (void) deselectColumn: (NSInteger)columnIndex; - (void) deselectRow: (NSInteger)rowIndex; - (NSInteger) numberOfSelectedColumns; - (NSInteger) numberOfSelectedRows; - (NSInteger) selectedColumn; - (NSInteger) selectedRow; - (BOOL) isColumnSelected: (NSInteger)columnIndex; - (BOOL) isRowSelected: (NSInteger)rowIndex; - (NSEnumerator *) selectedColumnEnumerator; - (NSEnumerator *) selectedRowEnumerator; - (void) selectAll: (id)sender; - (void) deselectAll: (id)sender; /* Table Dimensions */ - (NSInteger) numberOfColumns; - (NSInteger) numberOfRows; /* Grid Drawing attributes */ - (void) setDrawsGrid: (BOOL)flag; - (BOOL) drawsGrid; - (void) setGridColor: (NSColor *)aColor; - (NSColor *) gridColor; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (void) setGridStyleMask: (NSTableViewGridLineStyle)gridType; - (NSTableViewGridLineStyle) gridStyleMask; #endif /* Proving Cells */ #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (NSCell *) preparedCellAtColumn: (NSInteger)columnIndex row: (NSInteger)rowIndex; #endif /* Editing Cells */ /* ALL TODOS */ - (void) editColumn: (NSInteger)columnIndex row: (NSInteger)rowIndex withEvent: (NSEvent *)theEvent select: (BOOL)flag; - (NSInteger) editedRow; - (NSInteger) editedColumn; /* Auxiliary Components */ - (void) setHeaderView: (NSTableHeaderView*)aHeaderView; - (NSTableHeaderView*) headerView; - (void) setCornerView: (NSView*)aView; - (NSView*) cornerView; /* Layout */ - (NSRect) rectOfColumn: (NSInteger)columnIndex; - (NSRect) rectOfRow: (NSInteger)rowIndex; #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (NSIndexSet *) columnIndexesInRect: (NSRect)aRect; #endif - (NSRange) columnsInRect: (NSRect)aRect; - (NSRange) rowsInRect: (NSRect)aRect; - (NSInteger) columnAtPoint: (NSPoint)aPoint; - (NSInteger) rowAtPoint: (NSPoint)aPoint; - (NSRect) frameOfCellAtColumn: (NSInteger)columnIndex row: (NSInteger)rowIndex; - (void) setAutoresizesAllColumnsToFit: (BOOL)flag; - (BOOL) autoresizesAllColumnsToFit; - (void) sizeLastColumnToFit; - (void) noteNumberOfRowsChanged; - (void) tile; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (NSTableViewColumnAutoresizingStyle) columnAutoresizingStyle; - (void) setColumnAutoresizingStyle: (NSTableViewColumnAutoresizingStyle)style; - (void) noteHeightOfRowsWithIndexesChanged: (NSIndexSet*)indexes; #endif /* Drawing */ - (void) drawRow: (NSInteger)rowIndex clipRect: (NSRect)clipRect; - (void) drawGridInClipRect: (NSRect)aRect; - (void) highlightSelectionInClipRect: (NSRect)clipRect; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (void) drawBackgroundInClipRect: (NSRect)clipRect; #endif /* Scrolling */ - (void) scrollRowToVisible: (NSInteger)rowIndex; - (void) scrollColumnToVisible: (NSInteger)columnIndex; /* Text delegate methods */ - (BOOL) textShouldBeginEditing: (NSText *)textObject; - (void) textDidBeginEditing: (NSNotification *)aNotification; - (void) textDidChange: (NSNotification *)aNotification; - (BOOL) textShouldEndEditing: (NSText *)textObject; - (void) textDidEndEditing: (NSNotification *)aNotification; /* Persistence */ - (NSString *) autosaveName; - (BOOL) autosaveTableColumns; - (void) setAutosaveName: (NSString *)name; - (void) setAutosaveTableColumns: (BOOL)flag; /* Delegate */ - (void) setDelegate: (id)anObject; - (id) delegate; /* indicator image */ /* NB: ALL TODOS */ - (NSImage *) indicatorImageInTableColumn: (NSTableColumn *)aTableColumn; - (void) setIndicatorImage: (NSImage *)anImage inTableColumn: (NSTableColumn *)aTableColumn; /* highlighting columns */ /* NB: ALL TODOS */ - (NSTableColumn *) highlightedTableColumn; - (void) setHighlightedTableColumn: (NSTableColumn *)aTableColumn; /* dragging rows */ /* NB: ALL TODOS */ - (NSImage*) dragImageForRows: (NSArray*)dragRows event: (NSEvent*)dragEvent dragImageOffset: (NSPoint*)dragImageOffset; - (void) setDropRow: (NSInteger)row dropOperation: (NSTableViewDropOperation)operation; - (void) setVerticalMotionCanBeginDrag: (BOOL)flag; - (BOOL) verticalMotionCanBeginDrag; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (BOOL) canDragRowsWithIndexes: (NSIndexSet*)indexes atPoint: (NSPoint)point; - (NSImage *) dragImageForRowsWithIndexes: (NSIndexSet*)rows tableColumns: (NSArray*)cols event: (NSEvent*)event offset: (NSPoint*)offset; - (void) setDraggingSourceOperationMask: (NSDragOperation)mask forLocal: (BOOL)isLocal; #endif /* sorting */ #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (void) setSortDescriptors: (NSArray *)array; - (NSArray *) sortDescriptors; #endif @end /* interface of NSTableView */ @interface NSTableView (GNUPrivate) - (void) _sendDoubleActionForColumn: (NSInteger)columnIndex; - (void) _selectColumn: (NSInteger)columnIndex modifiers: (unsigned int)modifiers; @end /* * Informal protocol NSTableDataSource */ @protocol NSTableViewDataSource #ifdef __OBJC2__ @optional #else @end @interface NSObject (NSTableDataSource) #endif /** * Returns the number of records that the data source manages for aTableView. */ - (NSInteger) numberOfRowsInTableView: (NSTableView *)aTableView; - (id) tableView: (NSTableView *)aTableView objectValueForTableColumn: (NSTableColumn *)aTableColumn row: (NSInteger)rowIndex; - (void) tableView: (NSTableView *)aTableView setObjectValue: (id)anObject forTableColumn: (NSTableColumn *)aTableColumn row: (NSInteger)rowIndex; /* Dragging */ - (BOOL) tableView: (NSTableView*)tableView acceptDrop: (id )info row: (NSInteger)row dropOperation: (NSTableViewDropOperation)operation; - (NSDragOperation) tableView: (NSTableView*)tableView validateDrop: (id )info proposedRow: (NSInteger)row proposedDropOperation: (NSTableViewDropOperation)operation; - (BOOL) tableView: (NSTableView*)tableView writeRows: (NSArray*)rows toPasteboard: (NSPasteboard*)pboard; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (void) tableView: (NSTableView*)tableView sortDescriptorsDidChange: (NSArray *)oldSortDescriptors; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (BOOL) tableView: (NSTableView*)tableView writeRowsWithIndexes: (NSIndexSet*)rows toPasteboard: (NSPasteboard*)pboard; - (NSArray *) tableView: (NSTableView *)aTableView namesOfPromisedFilesDroppedAtDestination: (NSURL *)dropDestination forDraggedRowsWithIndexes: (NSIndexSet *)indexSet; #endif @end APPKIT_EXPORT NSString *NSTableViewColumnDidMoveNotification; APPKIT_EXPORT NSString *NSTableViewColumnDidResizeNotification; APPKIT_EXPORT NSString *NSTableViewSelectionDidChangeNotification; APPKIT_EXPORT NSString *NSTableViewSelectionIsChangingNotification; /* * Methods Implemented by the Delegate */ @protocol NSTableViewDelegate #ifdef __OBJC2__ @optional #else @end @interface NSObject (NSTableViewDelegate) #endif - (BOOL) selectionShouldChangeInTableView: (NSTableView *)aTableView; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (void) tableView: (NSTableView*)tableView didClickTableColumn: (NSTableColumn *)tableColumn; - (void) tableView: (NSTableView*)tableView didDragTableColumn: (NSTableColumn *)tableColumn; - (void) tableView: (NSTableView*)tableView mouseDownInHeaderOfTableColumn: (NSTableColumn *)tableColumn; #endif - (BOOL)tableView: (NSTableView *)aTableView shouldEditTableColumn: (NSTableColumn *)aTableColumn row: (NSInteger)rowIndex; - (BOOL) tableView: (NSTableView *)aTableView shouldSelectRow: (NSInteger)rowIndex; - (BOOL) tableView: (NSTableView *)aTableView shouldSelectTableColumn: (NSTableColumn *)aTableColumn; - (void) tableView: (NSTableView *)aTableView willDisplayCell: (id)aCell forTableColumn: (NSTableColumn *)aTableColumn row: (NSInteger)rowIndex; #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (NSCell *) tableView: (NSTableView *)aTableView dataCellForTableColumn: (NSTableColumn *)aTableColumn row: (NSInteger)rowIndex; #endif - (void) tableViewColumnDidMove: (NSNotification *)aNotification; - (void) tableViewColumnDidResize: (NSNotification *)aNotification; - (void) tableViewSelectionDidChange: (NSNotification *)aNotification; - (void) tableViewSelectionIsChanging: (NSNotification *)aNotification; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (CGFloat) tableView: (NSTableView *)tableView heightOfRow: (NSInteger)row; - (NSString *) tableView: (NSTableView *)tableView toolTipForCell: (NSCell *)cell rect: (NSRect *)rect tableColumn: (NSTableColumn *)col row: (NSInteger)row mouseLocation: (NSPoint)mouse; #endif @end #endif /* _GNUstep_H_NSTableView */ gnustep-gui-0.24.0/Headers/AppKit/NSFontPanel.h0000664000076500007650000000653112121417516021012 0ustar brains99brains99/* NSFontPanel.h Standard panel for selecting and previewing fonts. Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSFontPanel #define _GNUstep_H_NSFontPanel #import #import #import #import // needed for NSTextFieldDelegate @class NSFont; @class NSView; @class NSButton; @class NSBrowser; @class NSTextField; enum { NSFPPreviewButton, NSFPRevertButton, NSFPSetButton, NSFPPreviewField, NSFPSizeField, NSFPSizeTitle, NSFPCurrentField, // GNUstep extensions NSFPFamilyBrowser, NSFPFaceBrowser, NSFPSizeBrowser }; @interface NSFontPanel : NSPanel { // Attributes NSFont *_panelFont; BOOL _multiple; BOOL _preview; // store currently selected information NSArray *_familyList; NSArray *_faceList; int _family; int _face; NSFontTraitMask _traits; int _weight; // user typed string for preview area NSString *_previewString; // field for display NSView *_accessoryView; NSView *_topView; NSView *_bottomView; // sizes NSSize _originalMinSize; NSSize _originalSize; } // // Creating an NSFontPanel // + (NSFontPanel *)sharedFontPanel; + (BOOL)sharedFontPanelExists; // // Enabling // - (BOOL)isEnabled; - (void)setEnabled:(BOOL)flag; - (void)reloadDefaultFontFamilies; // // Updating font // - (void)setPanelFont:(NSFont *)fontObject isMultiple:(BOOL)flag; // // Converting // - (NSFont *)panelConvertFont:(NSFont *)fontObject; // // Works in modal loops // - (BOOL)worksWhenModal; // // Configuring the NSFontPanel // - (NSView *)accessoryView; - (void)setAccessoryView:(NSView *)aView; @end #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) enum { NSFontPanelFaceModeMask = 1 << 0, NSFontPanelSizeModeMask = 1 << 1, NSFontPanelCollectionModeMask = 1 << 2, #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) NSFontPanelUnderlineEffectModeMask = 1 << 8, NSFontPanelStrikethroughEffectModeMask = 1 << 9, NSFontPanelTextColorEffectModeMask = 1 << 10, NSFontPanelDocumentColorEffectModeMask = 1 << 11, NSFontPanelShadowEffectModeMask = 1 << 12, NSFontPanelAllEffectsModeMask = 0xfff00, #endif NSFontPanelStandardModesMask = 0xffff, NSFontPanelAllModesMask = 0xffffffff }; @interface NSObject (NSFontPanelValidation) - (unsigned int)validModesForFontPanel:(NSFontPanel *)fontPanel; @end #endif #endif // _GNUstep_H_NSFontPanel gnustep-gui-0.24.0/Headers/AppKit/NSColorWell.h0000664000076500007650000000363711737560372021045 0ustar brains99brains99/* NSColorWell.h NSControl for selecting and display a single color value. Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSColorWell #define _GNUstep_H_NSColorWell #import #import @class NSColor; @interface NSColorWell : NSControl { // Attributes NSColor *_the_color; BOOL _is_active; BOOL _is_bordered; NSRect _wellRect; id _target; SEL _action; // Mouse tracking NSPoint _mouseDownPoint; } // // Drawing // - (void)drawWellInside:(NSRect)insideRect; // // Activating // - (void)activate:(BOOL)exclusive; - (void)deactivate; - (BOOL)isActive; // // Managing Color // - (NSColor *)color; - (void)setColor:(NSColor *)color; - (void)takeColorFrom:(id)sender; // // Managing Borders // - (BOOL)isBordered; - (void)setBordered:(BOOL)bordered; // // NSCoding protocol // - (void)encodeWithCoder: (NSCoder *)aCoder; - (id)initWithCoder: (NSCoder *)aDecoder; @end #endif // _GNUstep_H_NSColorWell gnustep-gui-0.24.0/Headers/AppKit/AppKit.h0000664000076500007650000001367212216423340020054 0ustar brains99brains99/* AppKit.h Main include file for GNUstep GUI Library Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_AppKit #define _GNUstep_H_AppKit #import /* Define library version */ #import // // Foundation // #import // // GNUstep GUI Library functions // #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import #endif #import #endif /* _GNUstep_H_AppKit */ gnustep-gui-0.24.0/Headers/AppKit/NSButton.h0000664000076500007650000000675011673147131020406 0ustar brains99brains99/* NSButton.h The button class Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Ovidiu Predescu Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSButton #define _GNUstep_H_NSButton #import #import #import @class NSAttributedString; @class NSString; @class NSEvent; @interface NSButton : NSControl { // Attributes } // // Setting the Button Type // - (void)setButtonType:(NSButtonType)aType; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void)setHighlightsBy:(NSInteger)aType; - (void)setShowsStateBy:(NSInteger)aType; #endif // // Setting the State // - (void)setState:(NSInteger)value; - (NSInteger)state; - (BOOL)allowsMixedState; - (void)setAllowsMixedState: (BOOL)flag; - (void)setNextState; // // Setting the Repeat Interval // - (void)getPeriodicDelay:(float *)delay interval:(float *)interval; - (void)setPeriodicDelay:(float)delay interval:(float)interval; // // Setting the Titles // - (NSString *)alternateTitle; - (void)setAlternateTitle:(NSString *)aString; - (void)setTitle:(NSString *)aString; - (NSString *)title; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (NSAttributedString *)attributedAlternateTitle; - (NSAttributedString *)attributedTitle; - (void)setAttributedAlternateTitle:(NSAttributedString *)aString; - (void)setAttributedTitle:(NSAttributedString *)aString; - (void)setTitleWithMnemonic:(NSString *)aString; #endif // // Setting the Images // - (NSImage *)alternateImage; - (NSImage *)image; - (NSCellImagePosition)imagePosition; - (void)setAlternateImage:(NSImage *)anImage; - (void)setImage:(NSImage *)anImage; - (void)setImagePosition:(NSCellImagePosition)aPosition; // // Modifying Graphic Attributes // - (BOOL)isBordered; - (BOOL)isTransparent; - (void)setBordered:(BOOL)flag; - (void)setTransparent:(BOOL)flag; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (NSBezelStyle)bezelStyle; - (void)setBezelStyle:(NSBezelStyle)bezelStyle; - (void)setShowsBorderOnlyWhileMouseInside:(BOOL)show; - (BOOL)showsBorderOnlyWhileMouseInside; #endif // // Displaying // - (void)highlight:(BOOL)flag; // // Setting the Key Equivalent // - (NSString *)keyEquivalent; - (NSUInteger)keyEquivalentModifierMask; - (void)setKeyEquivalent:(NSString *)aKeyEquivalent; - (void)setKeyEquivalentModifierMask:(NSUInteger)mask; // // Handling Events and Action Messages // - (BOOL)performKeyEquivalent:(NSEvent *)anEvent; // // Sound // #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void)setSound:(NSSound *)aSound; - (NSSound *)sound; #endif @end #endif // _GNUstep_H_NSButton gnustep-gui-0.24.0/Headers/AppKit/NSApplication.h0000664000076500007650000005102112135015226021356 0ustar brains99brains99/** NSApplication.h The one and only application class Copyright (C) 1996,1999 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Felipe A. Rodriguez Date: August 1998 Author: Richard Frith-Macdonald Date: December 1998 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. AutogsdocSource: NSApplication.m AutogsdocSource: GSServicesManager.m */ #ifndef _GNUstep_H_NSApplication #define _GNUstep_H_NSApplication #import #import #import #if defined(__cplusplus) extern "C" { #endif @class NSArray; @class NSDate; @class NSError; @class NSException; @class NSMutableArray; @class NSNotification; @class NSString; @class NSTimer; @class NSEvent; @class NSGraphicsContext; @class NSImage; @class NSMenu; @class NSMenuItem; @class NSPasteboard; @class NSWindow; @class GSInfoPanel; typedef struct _NSModalSession *NSModalSession; enum { NSRunStoppedResponse = (-1000), NSRunAbortedResponse = (-1001), NSRunContinuesResponse = (-1002) }; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) #define NSUpdateWindowsRunLoopOrdering 600000 /** * Returned by -applicationShouldTerminate: when -terminate: is called. * Possible types include: * * NSTerminateCancel; * NSTerminateNow; * NSTerminateLater. * */ enum { NSTerminateCancel = NO, NSTerminateNow = YES, NSTerminateLater }; typedef NSUInteger NSApplicationTerminateReply; /** * Type used by -requestUserAttention: when an applications opened. Possible values are: * * NSCriticalRequest; * NSInformationalRequest; * */ enum { NSCriticalRequest = 0, NSInformationalRequest = 10 }; typedef NSUInteger NSRequestUserAttentionType; #define NSAppKitVersionNumber10_0 577 #define NSAppKitVersionNumber10_1 620 #define NSAppKitVersionNumber10_2 663 #define NSAppKitVersionNumber10_2_3 663.6 #define NSAppKitVersionNumber10_3 743 #define NSAppKitVersionNumber10_3_2 743.14 #define NSAppKitVersionNumber10_3_3 743.2 #define NSAppKitVersionNumber10_3_5 743.24 #define NSAppKitVersionNumber10_3_7 743.33 #define NSAppKitVersionNumber10_3_9 743.36 #define NSAppKitVersionNumber10_4 824 #define NSAppKitVersionNumber10_4_1 824.1 #define NSAppKitVersionNumber10_4_3 824.23 #define NSAppKitVersionNumber10_4_4 824.33 #define NSAppKitVersionNumber10_4_7 824.41 #define NSAppKitVersionNumber10_5 949 #define NSAppKitVersionNumber10_5_2 949.27 #define NSAppKitVersionNumber10_5_3 949.33 #define NSAppKitVersionNumber10_6 1038 #define NSAppKitVersionNumber10_7 1138 #define NSAppKitVersionNumber10_7_2 1138.23 APPKIT_EXPORT const double NSAppKitVersionNumber; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) enum _NSApplicationDelegateReply { NSApplicationDelegateReplySuccess = 0, NSApplicationDelegateReplyCancel = 1, NSApplicationDelegateReplyFailure = 2 }; typedef NSUInteger NSApplicationDelegateReply; enum _NSApplicationPrintReply { NSPrintingCancelled = NO, NSPrintingSuccess = YES, NSPrintingFailure, NSPrintingReplyLater }; typedef NSUInteger NSApplicationPrintReply; #endif APPKIT_EXPORT NSString *NSModalPanelRunLoopMode; APPKIT_EXPORT NSString *NSEventTrackingRunLoopMode; @interface NSApplication : NSResponder { NSGraphicsContext *_default_context; NSEvent *_current_event; NSModalSession _session; NSWindow *_key_window; NSWindow *_main_window; id _delegate; id _listener; NSMenu *_main_menu; NSMenu *_windows_menu; // 6 bits BOOL _app_is_launched; BOOL _app_is_running; BOOL _app_is_active; BOOL _app_is_hidden; BOOL _unhide_on_activation; BOOL _windows_need_update; NSImage *_app_icon; NSWindow *_app_icon_window; NSMutableArray *_hidden; NSMutableArray *_inactive; NSWindow *_hidden_key; NSWindow *_hidden_main; GSInfoPanel *_infoPanel; /* This autorelease pool should only be created and used by -run, with a single exception (which is why it is stored here as an ivar): the -terminate: method will destroy this autorelease pool before exiting the program. */ id _runLoopPool; } /* * Class methods */ #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) + (void) detachDrawingThread: (SEL)selector toTarget: (id)target withObject: (id)argument; #endif /* * Creating and initializing the NSApplication */ + (NSApplication*) sharedApplication; /* * Instance methods */ /* * Creating and initializing the NSApplication */ - (void) finishLaunching; /* * Changing the active application */ - (void) activateIgnoringOtherApps: (BOOL)flag; - (void) deactivate; - (BOOL) isActive; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void) hideOtherApplications: (id)sender; - (void) unhideAllApplications: (id)sender; #endif /* * Running the event loop */ - (void) abortModal; - (NSModalSession) beginModalSessionForWindow: (NSWindow*)theWindow; - (void) endModalSession: (NSModalSession)theSession; - (BOOL) isRunning; - (void) run; - (NSInteger) runModalForWindow: (NSWindow*)theWindow; - (NSInteger) runModalSession: (NSModalSession)theSession; - (NSWindow *) modalWindow; - (void) sendEvent: (NSEvent*)theEvent; - (void) stop: (id)sender; - (void) stopModal; - (void) stopModalWithCode: (NSInteger)returnCode; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (NSInteger) runModalForWindow: (NSWindow *)theWindow relativeToWindow: (NSWindow *)docWindow; - (void) beginSheet: (NSWindow *)sheet modalForWindow: (NSWindow *)docWindow modalDelegate: (id)modalDelegate didEndSelector: (SEL)didEndSelector contextInfo: (void *)contextInfo; - (void) endSheet: (NSWindow *)sheet; - (void) endSheet: (NSWindow *)sheet returnCode: (NSInteger)returnCode; #endif /* * Getting, removing, and posting events */ - (NSEvent*) currentEvent; - (void) discardEventsMatchingMask: (NSUInteger)mask beforeEvent: (NSEvent*)lastEvent; - (NSEvent*) nextEventMatchingMask: (NSUInteger)mask untilDate: (NSDate*)expiration inMode: (NSString*)mode dequeue: (BOOL)flag; - (void) postEvent: (NSEvent*)event atStart: (BOOL)flag; /* * Sending action messages */ - (BOOL) sendAction: (SEL)aSelector to: (id)aTarget from: (id)sender; - (id) targetForAction: (SEL)aSelector; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (id)targetForAction: (SEL)theAction to: (id)theTarget from: (id)sender; #endif - (BOOL) tryToPerform: (SEL)aSelector with: (id)anObject; /* * Setting the application's icon */ - (void) setApplicationIconImage: (NSImage*)anImage; - (NSImage*) applicationIconImage; /* * Hiding all windows */ - (void) hide: (id)sender; - (BOOL) isHidden; - (void) unhide: (id)sender; - (void) unhideWithoutActivation; /* * Managing windows */ - (NSWindow*) keyWindow; - (NSWindow*) mainWindow; - (NSWindow*) makeWindowsPerform: (SEL)aSelector inOrder: (BOOL)flag; - (void) miniaturizeAll: (id)sender; - (void) preventWindowOrdering; - (void) setWindowsNeedUpdate: (BOOL)flag; - (void) updateWindows; - (NSArray*) windows; - (NSWindow*) windowWithWindowNumber: (NSInteger)windowNum; /* * Showing Standard Panels */ #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) /* GNUstep extensions displaying an infoPanel, title is 'Info' */ /* For a list of the useful values in the dictionary, see GSInfoPanel.h. The entries are mostly compatible with macosx. */ - (void) orderFrontStandardInfoPanel: (id)sender; - (void) orderFrontStandardInfoPanelWithOptions: (NSDictionary *)dictionary; #endif #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) /* macosx extensions displaying an aboutPanel, title is 'About'. NB: These two methods do exactly the same as the two methods above, only the title is different. */ - (void) orderFrontStandardAboutPanel: (id)sender; - (void) orderFrontStandardAboutPanelWithOptions: (NSDictionary *)dictionary; #endif /* * Getting the main menu */ - (NSMenu*) mainMenu; - (void) setMainMenu: (NSMenu*)aMenu; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void) setAppleMenu: (NSMenu*)aMenu; #endif /* * Managing the Windows menu */ - (void) addWindowsItem: (NSWindow*)aWindow title: (NSString*)aString filename: (BOOL)isFilename; - (void) arrangeInFront: (id)sender; - (void) changeWindowsItem: (NSWindow*)aWindow title: (NSString*)aString filename: (BOOL)isFilename; - (void) removeWindowsItem: (NSWindow*)aWindow; - (void) setWindowsMenu: (NSMenu*)aMenu; - (void) updateWindowsItem: (NSWindow*)aWindow; - (NSMenu*) windowsMenu; /* * Managing the Service menu */ - (void) registerServicesMenuSendTypes: (NSArray*)sendTypes returnTypes: (NSArray*)returnTypes; - (NSMenu*) servicesMenu; - (id) servicesProvider; - (void) setServicesMenu: (NSMenu*)aMenu; - (void) setServicesProvider: (id)anObject; - (id) validRequestorForSendType: (NSString*)sendType returnType: (NSString*)returnType; /* * Getting the display context */ - (NSGraphicsContext*) context; /* * Reporting an exception */ - (void) reportException: (NSException*)anException; /* * Terminating the application */ #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void) replyToApplicationShouldTerminate: (BOOL)shouldTerminate; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (void) replyToOpenOrPrint: (NSApplicationDelegateReply)reply; #endif - (void) terminate: (id)sender; /* * Assigning a delegate */ - (id) delegate; - (void) setDelegate: (id)anObject; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) /* * Methods for scripting */ - (NSArray *) orderedDocuments; - (NSArray *) orderedWindows; /* * Methods for user attention requests */ - (void) cancelUserAttentionRequest: (NSInteger)request; - (NSInteger) requestUserAttention: (NSRequestUserAttentionType)requestType; #endif @end /** * Informal protocol declaring methods for sending to and receiving from * remote services providers. */ @interface NSObject (NSServicesRequests) /* * Pasteboard Read/Write */ /** * Request to transfer data from given pasteboard to selection (called when * a called remote service has provided data to this pasteboard). */ - (BOOL) readSelectionFromPasteboard: (NSPasteboard*)pboard; /** * Request to write selection data to given pasteboard (called when a called * remote service is to be invoked). */ - (BOOL) writeSelectionToPasteboard: (NSPasteboard*)pboard types: (NSArray*)types; #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) - (NSWindow*) iconWindow; #endif @end #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) @interface NSApplication (CharacterPanel) - (void) orderFrontCharacterPalette: (id)sender; @end #endif #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) @interface NSApplication (GSGUIInternal) - (void) _windowWillDealloc: (NSWindow *)window; @end /** * This is now a formal optional protocol. * Your delegate does not need to implement the full formal protocol. Your * delegate should just implement the methods it needs to, which will allow * NSApp to use default implementations in other cases. */ @protocol NSApplicationDelegate #ifdef __OBJC2__ @optional #else @end @interface NSObject (NSApplicationDelegate) #endif /** * Sender app (not necessarily this application) requests application to open * file without bringing up its normal UI, for programmatic manipulation. * YES should be returned on success, NO on failure. */ - (BOOL) application: (NSApplication*)app openFileWithoutUI: (NSString*)filename; /** * Sender requests application to open filename. * YES should be returned on success, NO on failure. */ - (BOOL) application: (NSApplication*)app openFile: (NSString*)filename; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) /** * Sender requests application to open filenames. */ - (void) application: (NSApplication*)app openFiles: (NSArray*)filenames; #endif /** * Sender requests application to open a temporary file. Responsibility * for eventual deletion lies with this application. * YES should be returned on success, NO on failure. */ - (BOOL) application: (NSApplication*)app openTempFile: (NSString*)filename; /** * Sender requests application to print filename. This should generally be * done without presenting a GUI to the user, unless default options are * likely to be changed. * YES should be returned on success, NO on failure. */ - (BOOL) application: (NSApplication *)theApplication printFile:(NSString *)filename; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) /** * Not sent yet on GNUstep. */ #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (NSApplicationPrintReply) application: (NSApplication*)app printFiles: (NSArray*)files withSettings: (NSDictionary*)settings showPrintPanels: (BOOL)flag; #else // Deprecated in 10.4 - (void) application: (NSApplication*)app printFiles: (NSArray*)filenames; #endif #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) /** * Ask delegate for an error replacement. */ - (NSError*) application: (NSApplication*)app willPresentError: (NSError*)error; #endif /** * Sender requests application to open a fresh document. * YES should be returned on success, NO on failure. */ - (BOOL) applicationOpenUntitledFile: (NSApplication*)app; /** * Sender will request application to open a fresh document, unless NO * is returned here. */ - (BOOL) applicationShouldOpenUntitledFile:(NSApplication *)sender; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) /** * Sent from within the [NSApplication-terminate:]. If * NSTerminateNow is returned, termination will proceed. If * NSTerminateCancel is returned, termination will NOT proceed. * If NSTerminateLater is returned, termination will be halted, * but the application should call * [NSApplication-replyToApplicationShouldTerminate:] with a YES or NO. (Used * if confirmation windows, etc. need to be put up.) */ - (NSApplicationTerminateReply) applicationShouldTerminate: (NSApplication *)sender; #else /** * Sent from within the [NSApplication-terminate:]. If NO is returned * termination will not proceed. */ - (BOOL) applicationShouldTerminate: (id)sender; #endif /** * Invoked when the last window is closed in an application. If YES is * returned, -applicationShouldTerminate: is invoked. */ - (BOOL) applicationShouldTerminateAfterLastWindowClosed: (id)sender; /** * Invoked on notification that application has become active. */ - (void) applicationDidBecomeActive: (NSNotification*)aNotification; /** * Invoked on notification that application has finished launching * ([NSApplication-finishLaunching] has completed, but no event dispatching * has begun. */ - (void) applicationDidFinishLaunching: (NSNotification*)aNotification; /** * Invoked on notification that application has just been hidden. */ - (void) applicationDidHide: (NSNotification*)aNotification; /** * Invoked on notification that application has just been deactivated. */ - (void) applicationDidResignActive: (NSNotification*)aNotification; /** * Invoked on notification that application has just been unhidden. */ - (void) applicationDidUnhide: (NSNotification*)aNotification; /** * Invoked on notification that application has updated its windows. */ - (void) applicationDidUpdate: (NSNotification*)aNotification; /** * Invoked on notification that application will become active. */ - (void) applicationWillBecomeActive: (NSNotification*)aNotification; /** * Invoked on notification that application will become active. */ - (void) applicationWillFinishLaunching: (NSNotification*)aNotification; /** * Invoked on notification that application will be hidden. */ - (void) applicationWillHide: (NSNotification*)aNotification; /** * Invoked on notification just before application resigns active status. */ - (void) applicationWillResignActive: (NSNotification*)aNotification; /** * Invoked on notification just before application terminates. (There is * no opportunity to avert it now.) */ - (void) applicationWillTerminate:(NSNotification*)aNotification; /** * Invoked on notification that application will be unhidden. */ - (void) applicationWillUnhide: (NSNotification*)aNotification; /** * Invoked on notification that application will now update its windows. * (See [NSApplication-updateWindows]. */ - (void) applicationWillUpdate: (NSNotification*)aNotification; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) /** * Method called by scripting framework on OS X. Not implemented (sent) * yet on GNUstep. */ - (BOOL) application: (NSApplication*)sender delegateHandlesKey: (NSString*)key; #if OS_API_VERSION(MAC_OS_X_VERSION_10_1, GS_API_LATEST) /** * Method used on OS X to allow an application to override the standard menu * obtained by right-clicking on the application's dock icon. Called * when the application uses Macintosh or Windows95 style menus. */ - (NSMenu *) applicationDockMenu: (NSApplication*)sender; #endif /** * Method used on OS X to allow delegate to handle event when user clicks on * dock icon of an already-open app. If YES is returned, a default * implementation executes (for example, to create a new untitled document); * if NO is returned nothing is done (and you can handle it here in this * method). Not sent yet under GNUstep. */ - (BOOL) applicationShouldHandleReopen: (NSApplication*)theApplication hasVisibleWindows: (BOOL)flag; /** * Called on OS X when the resolution or other characteristics of the display * have changed (through control panel operation, connecting a new monitor, * etc.). Not implemented/sent yet under GNUstep. */ - (void) applicationDidChangeScreenParameters: (NSNotification*)aNotification; #endif @end #endif /* * Notifications */ APPKIT_EXPORT NSString *NSApplicationDidBecomeActiveNotification; APPKIT_EXPORT NSString *NSApplicationDidChangeScreenParametersNotification; APPKIT_EXPORT NSString *NSApplicationDidFinishLaunchingNotification; APPKIT_EXPORT NSString *NSApplicationDidHideNotification; APPKIT_EXPORT NSString *NSApplicationDidResignActiveNotification; APPKIT_EXPORT NSString *NSApplicationDidUnhideNotification; APPKIT_EXPORT NSString *NSApplicationDidUpdateNotification; APPKIT_EXPORT NSString *NSApplicationWillBecomeActiveNotification; APPKIT_EXPORT NSString *NSApplicationWillFinishLaunchingNotification; APPKIT_EXPORT NSString *NSApplicationWillHideNotification; APPKIT_EXPORT NSString *NSApplicationWillResignActiveNotification; APPKIT_EXPORT NSString *NSApplicationWillTerminateNotification; APPKIT_EXPORT NSString *NSApplicationWillUnhideNotification; APPKIT_EXPORT NSString *NSApplicationWillUpdateNotification; /* * Determine Whether an Item Is Included in Services Menus */ APPKIT_EXPORT int NSSetShowsServicesMenuItem(NSString *name, BOOL enabled); APPKIT_EXPORT BOOL NSShowsServicesMenuItem(NSString *name); /* * Programmatically Invoke a Service */ APPKIT_EXPORT BOOL NSPerformService(NSString *serviceItem, NSPasteboard *pboard); #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) APPKIT_EXPORT id GSContactApplication(NSString *appName, NSString *port, NSDate *expire); #endif /* * Force Services Menu to Update Based on New Services */ APPKIT_EXPORT void NSUpdateDynamicServices(void); /* * Register object to handle services requests. */ APPKIT_EXPORT void NSRegisterServicesProvider(id provider, NSString *name); APPKIT_EXPORT void NSUnRegisterServicesProvider(NSString *name); APPKIT_EXPORT int NSApplicationMain(int argc, const char **argv); APPKIT_EXPORT void NSShowSystemInfoPanel(NSDictionary *options); /* * The NSApp global variable. */ APPKIT_EXPORT NSApplication *NSApp; #if defined(__cplusplus) } #endif #endif // _GNUstep_H_NSApplication gnustep-gui-0.24.0/Headers/AppKit/NSStatusBar.h0000664000076500007650000000310412203676404021031 0ustar brains99brains99/* NSStatusBar.h The status bar class Copyright (C) 2013 Free Software Foundation, Inc. Author: Dr. H. Nikolaus Schaller Date: 2013 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSStatusBar #define _GNUstep_H_NSStatusBar #import @class NSStatusItem; @interface NSStatusBar : NSObject { @private NSMutableArray *_items; } #ifndef NSSquareStatusItemLength // length == thickness #define NSSquareStatusItemLength ((CGFloat) -2.0) // variable #define NSVariableStatusItemLength ((CGFloat) -1.0) #endif + (NSStatusBar*) systemStatusBar; - (BOOL) isVertical; - (void) removeStatusItem: (NSStatusItem*)item; - (NSStatusItem*) statusItemWithLength: (CGFloat)length; - (CGFloat) thickness; @end #endif // _GNUstep_H_NSStatusBar gnustep-gui-0.24.0/Headers/AppKit/NSRulerMarker.h0000664000076500007650000000447212107547001021356 0ustar brains99brains99/* NSRulerMarker.h Displays a symbol in a NSRulerView. Copyright (C) 1999 Free Software Foundation, Inc. Author: Michael Hanni Date: Feb 1999 Author: Fred Kiefer Date: Sept 2001 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSRulerMarker #define _GNUstep_H_NSRulerMarker #import #import @class NSRulerView; @class NSImage; @class NSEvent; @interface NSRulerMarker : NSObject { NSRulerView *_rulerView; NSImage *_image; id _representedObject; NSPoint _imageOrigin; CGFloat _location; BOOL _isMovable; BOOL _isRemovable; BOOL _isDragging; } - (id)initWithRulerView:(NSRulerView *)aRulerView markerLocation:(CGFloat)location image:(NSImage *)anImage imageOrigin:(NSPoint)imageOrigin; - (NSRulerView *)ruler; - (void)setImage:(NSImage *)anImage; - (NSImage *)image; - (void)setImageOrigin:(NSPoint)aPoint; - (NSPoint)imageOrigin; - (NSRect)imageRectInRuler; - (CGFloat)thicknessRequiredInRuler; - (void)setMovable:(BOOL)flag; - (BOOL)isMovable; - (void)setRemovable:(BOOL)flag; - (BOOL)isRemovable; - (void)setMarkerLocation:(CGFloat)location; - (CGFloat)markerLocation; - (void)setRepresentedObject:(id )anObject; - (id )representedObject; - (void)drawRect:(NSRect)aRect; - (BOOL)isDragging; - (BOOL)trackMouse:(NSEvent *)theEvent adding:(BOOL)adding; @end #endif /* _GNUstep_H_NSRulerMarker */ gnustep-gui-0.24.0/Headers/AppKit/NSCursor.h0000664000076500007650000000752212166413345020407 0ustar brains99brains99/* NSCursor.h Holds an image to use as a cursor Copyright (C) 1996,1999 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSCursor #define _GNUstep_H_NSCursor #import #import #import @class NSImage; @class NSEvent; @class NSColor; @interface NSCursor : NSObject { NSImage *_cursor_image; NSPoint _hot_spot; struct GSCursorFlagsType { unsigned int is_set_on_mouse_entered: 1; unsigned int is_set_on_mouse_exited: 1; unsigned int type: 5; unsigned int reserved: 25; } _cursor_flags; void *_cid; } /* * Initializing a New NSCursor Object */ #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) - (id) initWithImage: (NSImage *)newImage; #endif - (id) initWithImage: (NSImage *)newImage hotSpot: (NSPoint)hotSpot; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (id)initWithImage:(NSImage *)newImage foregroundColorHint:(NSColor *)fg backgroundColorHint:(NSColor *)bg hotSpot:(NSPoint)hotSpot; #endif /* * Defining the Cursor */ - (NSPoint) hotSpot; - (NSImage*) image; #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) - (void) setHotSpot: (NSPoint)spot; - (void) setImage: (NSImage *)newImage; #endif /* * Setting the Cursor */ + (void) hide; + (void) pop; + (void) setHiddenUntilMouseMoves: (BOOL)flag; + (BOOL) isHiddenUntilMouseMoves; + (void) unhide; - (BOOL) isSetOnMouseEntered; - (BOOL) isSetOnMouseExited; - (void) mouseEntered: (NSEvent*)theEvent; - (void) mouseExited: (NSEvent*)theEvent; - (void) pop; - (void) push; - (void) set; - (void) setOnMouseEntered: (BOOL)flag; - (void) setOnMouseExited: (BOOL)flag; /* * Getting the Cursor */ + (NSCursor*) arrowCursor; + (NSCursor*) currentCursor; + (NSCursor*) IBeamCursor; #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) + (NSCursor*) greenArrowCursor; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) + (NSCursor*) closedHandCursor; + (NSCursor*) crosshairCursor; + (NSCursor*) disappearingItemCursor; + (NSCursor*) openHandCursor; + (NSCursor*) pointingHandCursor; + (NSCursor*) resizeDownCursor; + (NSCursor*) resizeLeftCursor; + (NSCursor*) resizeLeftRightCursor; + (NSCursor*) resizeRightCursor; + (NSCursor*) resizeUpCursor; + (NSCursor*) resizeUpDownCursor; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) + (NSCursor*) currentSystemCursor; + (NSCursor*) contextualMenuCursor; + (NSCursor*) dragCopyCursor; + (NSCursor*) dragLinkCursor; + (NSCursor*) operationNotAllowedCursor; #endif @end /* Cursor types */ typedef enum { GSArrowCursor = 0, GSIBeamCursor, GSDragLinkCursor, GSOperationNotAllowedCursor, GSDragCopyCursor = 5, GSClosedHandCursor = 11, GSOpenHandCursor, GSPointingHandCursor, GSResizeLeftCursor = 17, GSResizeRightCursor, GSResizeLeftRightCursor, GSCrosshairCursor, GSResizeUpCursor, GSResizeDownCursor, GSResizeUpDownCursor, GSContextualMenuCursor, GSDisappearingItemCursor } GSCursorTypes; #endif /* _GNUstep_H_NSCursor */ gnustep-gui-0.24.0/Headers/AppKit/NSFontManager.h0000664000076500007650000001276611352512421021330 0ustar brains99brains99/* NSFontManager.h Manages system and user fonts Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Modified: Fred Kiefer Date: January 2000 Almost complete rewrite. This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSFontManager #define _GNUstep_H_NSFontManager #import #import @class NSString; @class NSArray; @class NSDictionary; @class NSMutableDictionary; @class NSFont; @class NSFontDescriptor; @class NSMenu; @class NSFontPanel; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) enum _NSFontManagerAddCollectionOptions { NSFontCollectionApplicationOnlyMask = 1 << 0 }; #endif 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, NSFixedPitchFontMask = 1024, NSUnitalicFontMask = 1 << 24 }; typedef enum { NSNoFontChangeAction, NSViaPanelFontAction, NSAddTraitFontAction, NSRemoveTraitFontAction, NSSizeUpFontAction, NSSizeDownFontAction, NSHeavierFontAction, NSLighterFontAction, } NSFontTag; @interface NSFontManager : NSObject { // Attributes id _delegate; SEL _action; NSFont *_selectedFont; BOOL _multiple; NSMenu *_fontMenu; NSFontTag _storedTag; NSFontTraitMask _trait; id _fontEnumerator; NSDictionary *_selectedAttributes; NSMutableDictionary *_collections; } // // Managing the FontManager // + (void) setFontManagerFactory: (Class)aClass; + (void) setFontPanelFactory: (Class)aClass; + (NSFontManager *)sharedFontManager; // // information on available fonts // - (NSArray *)availableFonts; - (NSArray *)availableFontFamilies; - (NSArray *)availableFontNamesWithTraits:(NSFontTraitMask)fontTraitMask; - (NSArray *)availableMembersOfFontFamily:(NSString *)family; - (NSString *) localizedNameForFamily:(NSString *)family face:(NSString *)face; // // Selecting fonts // - (void)setSelectedFont:(NSFont *)fontObject isMultiple:(BOOL)flag; - (NSFont *)selectedFont; - (BOOL)isMultiple; - (BOOL)sendAction; // // Action methods // - (void)addFontTrait:(id)sender; - (void)removeFontTrait:(id)sender; - (void)modifyFont:(id)sender; - (void)modifyFontViaPanel:(id)sender; // //Automatic font conversion // - (NSFont *)convertFont:(NSFont *)fontObject; // // Converting Fonts // - (NSFont *)convertFont:(NSFont *)fontObject toFamily:(NSString *)family; - (NSFont *)convertFont:(NSFont *)fontObject toFace:(NSString *)typeface; - (NSFont *)convertFont:(NSFont *)fontObject toHaveTrait:(NSFontTraitMask)trait; - (NSFont *)convertFont:(NSFont *)fontObject toNotHaveTrait:(NSFontTraitMask)trait; - (NSFont *)convertFont:(NSFont *)fontObject toSize:(float)size; - (NSFont *)convertWeight:(BOOL)upFlag ofFont:(NSFont *)fontObject; // // Getting a font // - (NSFont *)fontWithFamily:(NSString *)family traits:(NSFontTraitMask)traits weight:(int)weight size:(float)size; // // Examining a font // - (NSFontTraitMask)traitsOfFont:(NSFont *)aFont; - (int)weightOfFont:(NSFont *)fontObject; - (BOOL)fontNamed:(NSString *)typeface hasTraits:(NSFontTraitMask)fontTraitMask; // // Enabling // - (BOOL)isEnabled; - (void)setEnabled:(BOOL)flag; // // Font menu // - (NSMenu *)fontMenu:(BOOL)create; - (void)setFontMenu:(NSMenu *)newMenu; // // Font panel // - (NSFontPanel *)fontPanel:(BOOL)create; - (void)orderFrontFontPanel:(id)sender; // // Assigning a Delegate // - (id)delegate; - (void)setDelegate:(id)anObject; // // Action Methods // - (SEL)action; - (void)setAction:(SEL)aSelector; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (BOOL)addCollection:(NSString *)name options:(int)options; - (BOOL)removeCollection:(NSString *)collection; - (NSArray *)collectionNames; - (void)addFontDescriptors:(NSArray *)descriptors toCollection:(NSString *)collection; - (void)removeFontDescriptor:(NSFontDescriptor *)descriptor fromCollection:(NSString *)collection; - (NSArray *)fontDescriptorsInCollection:(NSString *)collection; - (NSArray *)availableFontNamesMatchingFontDescriptor:(NSFontDescriptor *)descriptor; - (NSDictionary *)convertAttributes:(NSDictionary *)attributes; - (void)setSelectedAttributes:(NSDictionary *)attributes isMultiple:(BOOL)flag; #endif @end @interface NSObject (NSFontManagerDelegate) // // Methods Implemented by the Delegate // - (BOOL)fontManager:(id)sender willIncludeFont:(NSString *)fontName; @end #endif // _GNUstep_H_NSFontManager gnustep-gui-0.24.0/Headers/AppKit/NSTableHeaderCell.h0000664000076500007650000000303011354602172022054 0ustar brains99brains99/* NSTableHeaderCell.h Copyright (C) 1999 Free Software Foundation, Inc. Author: Michael Hanni Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSTableHeaderCell #define _GNUstep_H_NSTableHeaderCell #import #import @interface NSTableHeaderCell : NSTextFieldCell { } #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (void)drawSortIndicatorWithFrame: (NSRect)cellFrame inView: (NSView *)controlView ascending: (BOOL)ascending priority: (int)priority; - (NSRect)sortIndicatorRectForBounds: (NSRect)theRect; #endif @end #endif gnustep-gui-0.24.0/Headers/AppKit/NSColorPicker.h0000664000076500007650000000412611352512421021332 0ustar brains99brains99/* NSColorPicker.h Abstract superclass of custom color pickers Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSColorPicker #define _GNUstep_H_NSColorPicker #import #import #import @class NSColorPanel; @class NSColorList; @class NSImage; @class NSButtonCell; @interface NSColorPicker : NSObject { // Attributes id _colorPanel; } // // Initializing an NSColorPicker // - (id)initWithPickerMask:(int)aMask colorPanel:(NSColorPanel *)colorPanel; // // Getting the Color Panel // - (NSColorPanel *)colorPanel; // // Adding Button Images // - (void)insertNewButtonImage:(NSImage *)newImage in:(NSButtonCell *)newButtonCell; - (NSImage *)provideNewButtonImage; // // Setting the Mode // - (void)setMode:(int)mode; // // Using Color Lists // - (void)attachColorList:(NSColorList *)colorList; - (void)detachColorList:(NSColorList *)colorList; // // Showing Opacity Controls // - (void)alphaControlAddedOrRemoved:(id)sender; // // Responding to a Resized View // - (void)viewSizeChanged:(id)sender; @end #endif // _GNUstep_H_NSColorPicker gnustep-gui-0.24.0/Headers/AppKit/NSMatrix.h0000664000076500007650000001734412102315414020365 0ustar brains99brains99/* NSMatrix.h Copyright (C) 1996,1997,1999 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: March 1997 A completely rewritten version of the original source by Pascal Forget and Scott Christley. This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSMatrix #define _GNUstep_H_NSMatrix #import #import @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 { __strong id **_cells; BOOL **_selectedCells; int _maxRows; int _maxCols; int _numRows; int _numCols; NSZone *_myZone; Class _cellClass; id _cellPrototype; IMP _cellNew; IMP _cellInit; NSMatrixMode _mode; NSSize _cellSize; NSSize _intercell; NSColor *_backgroundColor; NSColor *_cellBackgroundColor; id _delegate; NSText* _textObject; BOOL _tabKeyTraversesCells; id _target; SEL _action; SEL _doubleAction; SEL _errorAction; id _selectedCell; int _selectedRow; int _selectedColumn; BOOL _allowsEmptySelection; BOOL _selectionByRect; BOOL _drawsBackground; BOOL _drawsCellBackground; BOOL _autosizesCells; BOOL _autoscroll; id _reserved1; int _dottedRow; int _dottedColumn; } /* * Initializing the NSMatrix Class */ + (Class) cellClass; + (void) setCellClass: (Class)classId; /* * Initializing an NSMatrix Object */ - (id) initWithFrame: (NSRect)frameRect; - (id) initWithFrame: (NSRect)frameRect mode: (NSMatrixMode)aMode cellClass: (Class)classId numberOfRows: (NSInteger)rowsHigh numberOfColumns: (NSInteger)colsWide; - (id) initWithFrame: (NSRect)frameRect mode: (NSMatrixMode)aMode prototype: (NSCell *)aCell numberOfRows: (NSInteger)rowsHigh numberOfColumns: (NSInteger)colsWide; /* * Setting the Selection Mode */ - (NSMatrixMode) mode; - (void) setMode: (NSMatrixMode)aMode; /* * Configuring the NSMatrix */ - (BOOL) allowsEmptySelection; - (BOOL) isSelectionByRect; - (void) setAllowsEmptySelection: (BOOL)flag; - (void) setSelectionByRect: (BOOL)flag; /* * Setting the Cell Class */ - (Class) cellClass; - (id) prototype; - (void) setCellClass: (Class)classId; - (void) setPrototype: (NSCell *)aCell; /* * Laying Out the NSMatrix */ - (void) addColumn; - (void) addColumnWithCells: (NSArray *)cellArray; - (void) addRow; - (void) addRowWithCells: (NSArray *)cellArray; - (NSRect) cellFrameAtRow: (NSInteger)row column: (NSInteger)column; - (NSSize) cellSize; - (void) getNumberOfRows: (NSInteger *)rowCount columns: (NSInteger *)columnCount; - (void) insertColumn: (NSInteger)column; - (void) insertColumn: (NSInteger)column withCells: (NSArray *)cellArray; - (void) insertRow: (NSInteger)row; - (void) insertRow: (NSInteger)row withCells: (NSArray *)cellArray; - (NSSize) intercellSpacing; - (NSCell *) makeCellAtRow: (NSInteger)row column: (NSInteger)column; - (void) putCell: (NSCell *)newCell atRow: (NSInteger)row column: (NSInteger)column; - (void) removeColumn: (NSInteger)column; - (void) removeRow: (NSInteger)row; - (void) renewRows: (NSInteger)newRows columns: (NSInteger)newColumns; - (void) setCellSize: (NSSize)aSize; - (void) setIntercellSpacing: (NSSize)aSize; - (void) sortUsingFunction: (NSComparisonResult (*)(id element1, id element2, void *userData))comparator context: (void *)context; - (void) sortUsingSelector: (SEL)comparator; - (NSInteger) numberOfColumns; - (NSInteger) numberOfRows; /* * Finding Matrix Coordinates */ - (BOOL) getRow: (NSInteger *)row column: (NSInteger *)column forPoint: (NSPoint)aPoint; - (BOOL) getRow: (NSInteger *)row column: (NSInteger *)column ofCell: (NSCell *)aCell; /* * Modifying Individual Cells */ - (void) setState: (NSInteger)value atRow: (NSInteger)row column: (NSInteger)column; /* * Selecting Cells */ - (void) deselectAllCells; - (void) deselectSelectedCell; - (void) selectAll: (id)sender; - (void) selectCellAtRow: (NSInteger)row column: (NSInteger)column; - (BOOL) selectCellWithTag: (NSInteger)anInt; - (id) selectedCell; - (NSArray *) selectedCells; - (NSInteger) selectedColumn; - (NSInteger) selectedRow; - (void) setSelectionFrom: (NSInteger)startPos to: (NSInteger)endPos anchor: (NSInteger)anchorPos highlight: (BOOL)flag; /* * Finding Cells */ - (id) cellAtRow: (NSInteger)row column: (NSInteger)column; - (id) cellWithTag: (NSInteger)anInt; - (NSArray *) cells; /* * Modifying Graphic Attributes */ - (NSColor *) backgroundColor; - (NSColor *) cellBackgroundColor; - (BOOL) drawsBackground; - (BOOL) drawsCellBackground; - (void) setBackgroundColor: (NSColor *)aColor; - (void) setCellBackgroundColor: (NSColor *)aColor; - (void) setDrawsBackground: (BOOL)flag; - (void) setDrawsCellBackground: (BOOL)flag; /* * Editing Text in Cells */ - (void) selectText: (id)sender; - (id) selectTextAtRow: (NSInteger)row column: (NSInteger)column; - (void) textDidBeginEditing: (NSNotification *)aNotification; - (void) textDidChange: (NSNotification *)aNotification; - (void) textDidEndEditing: (NSNotification *)aNotification; - (BOOL) textShouldBeginEditing: (NSText *)aTextObject; - (BOOL) textShouldEndEditing: (NSText *)aTextObject; /* * Setting Tab Key Behavior */ - (id) keyCell; - (void) setKeyCell: (NSCell *)aCell; - (id) nextText; - (id) previousText; - (void) setNextText: (id)anObject; - (void) setPreviousText: (id)anObject; - (BOOL) tabKeyTraversesCells; - (void) setTabKeyTraversesCells: (BOOL)flag; /* * Assigning a Delegate */ - (void) setDelegate: (id)anObject; - (id) delegate; /* * Resizing the Matrix and Cells */ - (BOOL) autosizesCells; - (void) setAutosizesCells: (BOOL)flag; - (void) setValidateSize: (BOOL)flag; - (void) sizeToCells; /* * Scrolling */ - (BOOL) isAutoscroll; - (void) scrollCellToVisibleAtRow: (NSInteger)row column: (NSInteger)column; - (void) setAutoscroll: (BOOL)flag; - (void) setScrollable: (BOOL)flag; /* * Displaying */ - (void) drawCellAtRow: (NSInteger)row column: (NSInteger)column; - (void) highlightCell: (BOOL)flag atRow: (NSInteger)row column: (NSInteger)column; /* *Target and Action */ - (void) setAction: (SEL)aSelector; - (SEL) action; - (void) setDoubleAction: (SEL)aSelector; - (SEL) doubleAction; - (void) setErrorAction: (SEL)aSelector; - (SEL) errorAction; - (BOOL) sendAction; - (void) sendAction: (SEL)aSelector to: (id)anObject forAllCells: (BOOL)flag; - (void) sendDoubleAction; /* * Handling Event and Action Messages */ - (BOOL) acceptsFirstMouse: (NSEvent *)theEvent; - (void) mouseDown: (NSEvent *)theEvent; - (NSInteger) mouseDownFlags; - (BOOL) performKeyEquivalent: (NSEvent *)theEvent; /* * Managing the Cursor */ - (void) resetCursorRects; @end #endif /* _GNUstep_H_NSMatrix */ gnustep-gui-0.24.0/Headers/AppKit/NSInputServer.h0000664000076500007650000000535411352752764021430 0ustar brains99brains99/* -*-objc-*- NSInputServer.h Copyright (C) 2001 Free Software Foundation, Inc. Author: Fred Kiefer Date: August 2001 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSInputServer #define _GNUstep_H_NSInputServer #import #import #import @class NSString; @protocol NSInputServerMouseTracker - (BOOL) mouseDownOnCharacterIndex: (unsigned)index atCoordinate: (NSPoint)point withModifier: (unsigned int)flags client: (id)sender; - (BOOL) mouseDraggedOnCharacterIndex: (unsigned)index atCoordinate: (NSPoint)point withModifier: (unsigned int)flags client: (id)sender; - (void) mouseUpOnCharacterIndex: (unsigned)index atCoordinate: (NSPoint)point withModifier: (unsigned int)flags client: (id)sender; @end @protocol NSInputServiceProvider - (void) activeConversationChanged: (id)sender toNewConversation: (long)newConversation; - (void) activeConversationWillChange: (id)sender fromOldConversation: (long)oldConversation; - (BOOL) canBeDisabled; - (void) doCommandBySelector: (SEL)aSelector client: (id)sender; - (void) inputClientBecomeActive: (id)sender; - (void) inputClientDisabled: (id)sender; - (void) inputClientEnabled: (id)sender; - (void) inputClientResignActive: (id)sender; - (void) insertText: (id)aString client: (id)sender; - (void) markedTextAbandoned: (id)sender; - (void) markedTextSelectionChanged: (NSRange)newSelection client: (id)sender; - (void) terminate: (id)sender; - (BOOL) wantsToDelayTextChangeNotifications; - (BOOL) wantsToHandleMouseEvents; - (BOOL) wantsToInterpretAllKeystrokes; @end @interface NSInputServer: NSObject - (id) initWithDelegate: (id)aDelegate name: (NSString *)name; @end #endif //_GNUstep_H_NSInputServer gnustep-gui-0.24.0/Headers/AppKit/NSImageView.h0000664000076500007650000000432511705631651021005 0ustar brains99brains99/* -*-objc-*- NSImageView.h Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: January 1998 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSImageView #define _GNUstep_H_NSImageView #import #import #import @interface NSImageView : NSControl { id _target; SEL _action; struct GSImageViewFlagsType { // total 32 bits. 30 bits left. unsigned allowsCutCopyPaste: 1; unsigned initiatesDrag: 1; } _ivflags; } - (NSImage *)image; - (void)setImage:(NSImage *)image; - (NSImageAlignment)imageAlignment; - (void)setImageAlignment:(NSImageAlignment)align; - (NSImageScaling)imageScaling; - (void)setImageScaling:(NSImageScaling)scaling; - (NSImageFrameStyle)imageFrameStyle; - (void)setImageFrameStyle:(NSImageFrameStyle)style; - (void)setEditable:(BOOL)flag; - (BOOL)isEditable; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (BOOL)animates; - (void)setAnimates:(BOOL)flag; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (BOOL)allowsCutCopyPaste; - (void)setAllowsCutCopyPaste:(BOOL)flag; #endif @end #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) // // Methods that are GNUstep extensions // @interface NSImageView (GNUstep) - (BOOL)initiatesDrag; - (void)setInitiatesDrag: (BOOL)flag; @end #endif #endif /* _GNUstep_H_NSImageView */ gnustep-gui-0.24.0/Headers/AppKit/NSToolbarItemGroup.h0000664000076500007650000000266511354736316022377 0ustar brains99brains99/* NSToolbarItemGroup.h The toolbar item group class. Copyright (C) 2008 Free Software Foundation, Inc. Author: Fred Kiefer Date: Dec 2008 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSToolbarItemGroup #define _GNUstep_H_NSToolbarItemGroup #import #import #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) @class NSArray; @interface NSToolbarItemGroup : NSToolbarItem { NSArray *_subitems; } - (void) setSubitems: (NSArray *)items; - (NSArray *) subitems; @end #endif #endif /* _GNUstep_H_NSToolbarItemGroup */ gnustep-gui-0.24.0/Headers/AppKit/NSTreeNode.h0000664000076500007650000000344212204466636020640 0ustar brains99brains99/* NSTreeNode.h The tree node class Copyright (C) 2013 Free Software Foundation, Inc. Author: Dr. H. Nikolaus Schaller Date: 2013 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSTreeNode #define _GNUstep_H_NSTreeNode #import #import @class NSArray; @class NSIndexPath; @class NSMutableArray; #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) @interface NSTreeNode : NSObject { id _representedObject; NSMutableArray *_childNodes; NSTreeNode *_parentNode; } + (id) treeNodeWithRepresentedObject: (id)modelObject; - (NSArray*) childNodes; - (NSTreeNode*) descendantNodeAtIndexPath: (NSIndexPath*)path; - (NSIndexPath*) indexPath; - (id) initWithRepresentedObject: (id)repObj; - (BOOL) isLeaf; - (NSMutableArray*) mutableChildNodes; - (NSTreeNode*) parentNode; - (id) representedObject; - (void) sortWithSortDescriptors: (NSArray*)sortDescs recursively: (BOOL)flag; @end #endif #endif // _GNUstep_H_NSTreeNode gnustep-gui-0.24.0/Headers/AppKit/NSGraphicsContext.h0000664000076500007650000004543012110205434022222 0ustar brains99brains99/** NSGraphicsContext Abstract drawing context class. Copyright (C) 1998,1999 Free Software Foundation, Inc. Author: Richard Frith-Macdonald Date: Feb 1999 Based on code by: Adam Fedor Date: Nov 1998 This file is part of the GNU Objective C User interface library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _NSGraphicsContext_h_INCLUDE #define _NSGraphicsContext_h_INCLUDE #import #import #import #import @class NSDate; @class NSDictionary; @class NSMutableArray; @class NSMutableData; @class NSMutableSet; @class NSString; @class NSView; @class NSWindow; @class NSFont; @class NSSet; @class NSBitmapImageRep; @class NSGradient; /* * Backing Store Types */ enum _NSBackingStoreType { NSBackingStoreRetained, NSBackingStoreNonretained, NSBackingStoreBuffered }; typedef NSUInteger NSBackingStoreType; /** NSCompositingOperation defines how an image is drawn or composited onto another. * * NSCompositeClear: Cleans out an area * NSCompositeCopy: (Common) Draws over the destination replacing it and carrying over transparency to the destination * NSCompositeSourceOver: (Common) Draws over the destination with transparency * NSCompositeSourceIn * NSCompositeSourceOut * NSCompositeSourceAtop * NSCompositeDestinationOver * NSCompositeDestinationIn * NSCompositeDestinationOut * NSCompositeDestinationAtop * NSCompositeXOR * NSCompositePlusDarker * NSCompositeHighlight * NSCompositePlusLighter * */ enum _NSCompositingOperation { NSCompositeClear, NSCompositeCopy, NSCompositeSourceOver, NSCompositeSourceIn, NSCompositeSourceOut, NSCompositeSourceAtop, NSCompositeDestinationOver, NSCompositeDestinationIn, NSCompositeDestinationOut, NSCompositeDestinationAtop, NSCompositeXOR, NSCompositePlusDarker, NSCompositeHighlight, NSCompositePlusLighter #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) , GSCompositeHighlight = 100 #endif }; typedef NSUInteger NSCompositingOperation; typedef int NSWindowDepth; /* Image interpolation */ typedef enum _NSImageInterpolation { NSImageInterpolationDefault, NSImageInterpolationNone, NSImageInterpolationLow, NSImageInterpolationHigh } NSImageInterpolation; /* * The following graphics context stuff is needed by inline functions, * so it must always be available even when compiling for MACOSX or OPENSTEP */ typedef enum _GSTextDrawingMode { GSTextFill, GSTextStroke, GSTextClip } GSTextDrawingMode; // We have to load this after the NSCompositingOperation are defined!!! #import /* * Window ordering */ typedef enum _NSWindowOrderingMode { NSWindowAbove, NSWindowBelow, NSWindowOut } NSWindowOrderingMode; /* * Window input state */ typedef enum _GSWindowInputState { GSTitleBarKey = 0, GSTitleBarNormal = 1, GSTitleBarMain = 2 } GSWindowInputState; /* Color spaces */ typedef enum _GSColorSpace { GSDeviceGray, GSDeviceRGB, GSDeviceCMYK, GSCalibratedGray, GSCalibratedRGB, GSCIELab, GSICC } GSColorSpace; @interface NSGraphicsContext : NSObject { /* Make the one public instance variable first in the object so that, if we * add or remove others, we don't necessarily need to recompile everything. */ @public const gsMethodTable *methods; @protected NSDictionary *context_info; NSMutableData *context_data; NSMutableArray *focus_stack; NSMutableSet *usedFonts; NSImageInterpolation _interp; BOOL _antialias; NSPoint _patternPhase; void *_graphicsPort; BOOL _isFlipped; NSCompositingOperation _compositingOperation; } + (BOOL) currentContextDrawingToScreen; + (NSGraphicsContext *) graphicsContextWithAttributes: (NSDictionary *)attributes; + (NSGraphicsContext *) graphicsContextWithWindow: (NSWindow *)aWindow; + (void) restoreGraphicsState; + (void) saveGraphicsState; + (void) setGraphicsState: (NSInteger)graphicsState; + (void) setCurrentContext: (NSGraphicsContext*)context; + (NSGraphicsContext*) currentContext; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) + (NSGraphicsContext *) graphicsContextWithBitmapImageRep: (NSBitmapImageRep *)bitmap; + (NSGraphicsContext *) graphicsContextWithGraphicsPort: (void *)port flipped: (BOOL)flag; #endif - (NSDictionary *) attributes; - (void *) graphicsPort; - (BOOL) isDrawingToScreen; - (void) flushGraphics; - (void) restoreGraphicsState; - (void) saveGraphicsState; - (void *) focusStack; - (void) setFocusStack: (void *)stack; - (void) setImageInterpolation: (NSImageInterpolation)interpolation; - (NSImageInterpolation) imageInterpolation; - (void) setShouldAntialias: (BOOL)antialias; - (BOOL) shouldAntialias; #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) - (NSPoint) patternPhase; - (void) setPatternPhase: (NSPoint)phase; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (NSCompositingOperation) compositingOperation; - (void) setCompositingOperation:(NSCompositingOperation) operation; - (BOOL) isFlipped; #endif @end APPKIT_EXPORT NSGraphicsContext *GSCurrentContext(void); #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) @interface NSGraphicsContext (GNUstep) + (void) setDefaultContextClass: (Class)defaultContextClass; - (id) initWithContextInfo: (NSDictionary*)info; /* * Focus management methods - lock and unlock should only be used by NSView * in it's implementation of lockFocus and unlockFocus. */ - (NSView*) focusView; - (void) lockFocusView: (NSView*)aView inRect: (NSRect)rect; - (void) unlockFocusView: (NSView*)aView needsFlush: (BOOL)flush; /* Private methods for printing */ - (void) useFont: (NSString *)fontName; - (void) resetUsedFonts; - (NSSet *) usedFonts; /* Private backend methods */ + (void) handleExposeRect: (NSRect)rect forDriver: (void *)driver; @end #endif /* * GNUstep drawing engine extensions - these are the methods actually * called when one of the inline PostScript functions (like PSlineto()) * is called. */ @interface NSGraphicsContext (Ops) /* ----------------------------------------------------------------------- */ /* Color operations */ /* ----------------------------------------------------------------------- */ - (void) DPScurrentalpha: (CGFloat*)a; - (void) DPScurrentcmykcolor: (CGFloat*)c : (CGFloat*)m : (CGFloat*)y : (CGFloat*)k; - (void) DPScurrentgray: (CGFloat*)gray; - (void) DPScurrenthsbcolor: (CGFloat*)h : (CGFloat*)s : (CGFloat*)b; - (void) DPScurrentrgbcolor: (CGFloat*)r : (CGFloat*)g : (CGFloat*)b; - (void) DPSsetalpha: (CGFloat)a; - (void) DPSsetcmykcolor: (CGFloat)c : (CGFloat)m : (CGFloat)y : (CGFloat)k; - (void) DPSsetgray: (CGFloat)gray; - (void) DPSsethsbcolor: (CGFloat)h : (CGFloat)s : (CGFloat)b; - (void) DPSsetrgbcolor: (CGFloat)r : (CGFloat)g : (CGFloat)b; - (void) GSSetPatterColor: (NSImage*)image; - (void) GSSetFillColorspace: (void *)spaceref; - (void) GSSetStrokeColorspace: (void *)spaceref; - (void) GSSetFillColor: (const CGFloat *)values; - (void) GSSetStrokeColor: (const CGFloat *)values; /* ----------------------------------------------------------------------- */ /* Text operations */ /* ----------------------------------------------------------------------- */ - (void) DPSashow: (CGFloat)x : (CGFloat)y : (const char*)s; - (void) DPSawidthshow: (CGFloat)cx : (CGFloat)cy : (int)c : (CGFloat)ax : (CGFloat)ay : (const char*)s; - (void) DPScharpath: (const char*)s : (int)b; - (void) appendBezierPathWithPackedGlyphs: (const char *)packedGlyphs path: (NSBezierPath*)aPath; - (void) DPSshow: (const char*)s; - (void) DPSwidthshow: (CGFloat)x : (CGFloat)y : (int)c : (const char*)s; - (void) DPSxshow: (const char*)s : (const CGFloat*)numarray : (int)size; - (void) DPSxyshow: (const char*)s : (const CGFloat*)numarray : (int)size; - (void) DPSyshow: (const char*)s : (const CGFloat*)numarray : (int)size; - (void) GSSetCharacterSpacing: (CGFloat)extra; - (void) GSSetFont: (void *)fontref; - (void) GSSetFontSize: (CGFloat)size; - (NSAffineTransform *) GSGetTextCTM; - (NSPoint) GSGetTextPosition; - (void) GSSetTextCTM: (NSAffineTransform *)ctm; - (void) GSSetTextDrawingMode: (GSTextDrawingMode)mode; - (void) GSSetTextPosition: (NSPoint)loc; - (void) GSShowText: (const char *)string : (size_t) length; - (void) GSShowGlyphs: (const NSGlyph *)glyphs : (size_t) length; - (void) GSShowGlyphsWithAdvances: (const NSGlyph *)glyphs : (const NSSize *)advances : (size_t) length; /* ----------------------------------------------------------------------- */ /* Gstate Handling */ /* ----------------------------------------------------------------------- */ - (void) DPSgrestore; - (void) DPSgsave; - (void) DPSinitgraphics; - (void) DPSsetgstate: (NSInteger)gst; - (NSInteger) GSDefineGState; - (void) GSUndefineGState: (NSInteger)gst; - (void) GSReplaceGState: (NSInteger)gst; /* ----------------------------------------------------------------------- */ /* Gstate operations */ /* ----------------------------------------------------------------------- */ - (void) DPScurrentflat: (CGFloat*)flatness; - (void) DPScurrentlinecap: (int*)linecap; - (void) DPScurrentlinejoin: (int*)linejoin; - (void) DPScurrentlinewidth: (CGFloat*)width; - (void) DPScurrentmiterlimit: (CGFloat*)limit; - (void) DPScurrentpoint: (CGFloat*)x : (CGFloat*)y; - (void) DPScurrentstrokeadjust: (int*)b; - (void) DPSsetdash: (const CGFloat*)pat : (NSInteger)size : (CGFloat)offset; - (void) DPSsetflat: (CGFloat)flatness; - (void) DPSsethalftonephase: (CGFloat)x : (CGFloat)y; - (void) DPSsetlinecap: (int)linecap; - (void) DPSsetlinejoin: (int)linejoin; - (void) DPSsetlinewidth: (CGFloat)width; - (void) DPSsetmiterlimit: (CGFloat)limit; - (void) DPSsetstrokeadjust: (int)b; /* ----------------------------------------------------------------------- */ /* Matrix operations */ /* ----------------------------------------------------------------------- */ - (void) DPSconcat: (const CGFloat*)m; - (void) DPSinitmatrix; - (void) DPSrotate: (CGFloat)angle; - (void) DPSscale: (CGFloat)x : (CGFloat)y; - (void) DPStranslate: (CGFloat)x : (CGFloat)y; - (NSAffineTransform *) GSCurrentCTM; - (void) GSSetCTM: (NSAffineTransform *)ctm; - (void) GSConcatCTM: (NSAffineTransform *)ctm; /* ----------------------------------------------------------------------- */ /* Paint operations */ /* ----------------------------------------------------------------------- */ - (void) DPSarc: (CGFloat)x : (CGFloat)y : (CGFloat)r : (CGFloat)angle1 : (CGFloat)angle2; - (void) DPSarcn: (CGFloat)x : (CGFloat)y : (CGFloat)r : (CGFloat)angle1 : (CGFloat)angle2; - (void) DPSarct: (CGFloat)x1 : (CGFloat)y1 : (CGFloat)x2 : (CGFloat)y2 : (CGFloat)r; - (void) DPSclip; - (void) DPSclosepath; - (void) DPScurveto: (CGFloat)x1 : (CGFloat)y1 : (CGFloat)x2 : (CGFloat)y2 : (CGFloat)x3 : (CGFloat)y3; - (void) DPSeoclip; - (void) DPSeofill; - (void) DPSfill; - (void) DPSflattenpath; - (void) DPSinitclip; - (void) DPSlineto: (CGFloat)x : (CGFloat)y; - (void) DPSmoveto: (CGFloat)x : (CGFloat)y; - (void) DPSnewpath; - (void) DPSpathbbox: (CGFloat*)llx : (CGFloat*)lly : (CGFloat*)urx : (CGFloat*)ury; - (void) DPSrcurveto: (CGFloat)x1 : (CGFloat)y1 : (CGFloat)x2 : (CGFloat)y2 : (CGFloat)x3 : (CGFloat)y3; - (void) DPSrectclip: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h; - (void) DPSrectfill: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h; - (void) DPSrectstroke: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h; - (void) DPSreversepath; - (void) DPSrlineto: (CGFloat)x : (CGFloat)y; - (void) DPSrmoveto: (CGFloat)x : (CGFloat)y; - (void) DPSstroke; - (void) DPSshfill: (NSDictionary *)shaderDictionary; - (void) GSSendBezierPath: (NSBezierPath *)path; - (void) GSRectClipList: (const NSRect *)rects : (int) count; - (void) GSRectFillList: (const NSRect *)rects : (int) count; /* ----------------------------------------------------------------------- */ /* Window system ops */ /* ----------------------------------------------------------------------- */ - (void) GSCurrentDevice: (void**)device : (int*)x : (int*)y; - (void) GSSetDevice: (void*)device : (int)x : (int)y; - (void) DPScurrentoffset: (int*)x : (int*)y; - (void) DPSsetoffset: (short int)x : (short int)y; /*-------------------------------------------------------------------------*/ /* Graphics Extensions Ops */ /*-------------------------------------------------------------------------*/ - (void) DPScomposite: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h : (NSInteger)gstateNum : (CGFloat)dx : (CGFloat)dy : (NSCompositingOperation)op; - (void) DPScompositerect: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h : (NSCompositingOperation)op; - (void) DPSdissolve: (CGFloat)x : (CGFloat)y : (CGFloat)w : (CGFloat)h : (NSInteger)gstateNum : (CGFloat)dx : (CGFloat)dy : (CGFloat)delta; - (void) GScomposite: (NSInteger)gstateNum toPoint: (NSPoint)aPoint fromRect: (NSRect)srcRect operation: (NSCompositingOperation)op fraction: (CGFloat)delta; - (BOOL) supportsDrawGState; - (void) GSdraw: (NSInteger)gstateNum toPoint: (NSPoint)aPoint fromRect: (NSRect)srcRect operation: (NSCompositingOperation)op fraction: (CGFloat)delta; - (void) GSDrawImage: (NSRect)rect : (void *)imageref; /* ----------------------------------------------------------------------- */ /* Postscript Client functions */ /* ----------------------------------------------------------------------- */ - (void) DPSPrintf: (const char *)fmt : (va_list)args; - (void) DPSWriteData: (const char *)buf : (unsigned int)count; @end /* ----------------------------------------------------------------------- */ /* NSGraphics Ops */ /* ----------------------------------------------------------------------- */ @interface NSGraphicsContext (NSGraphics) /**

Read raw pixels from the device and return the information as a bitmap. Pixels are read from the smallest device-pixel aligned rectangle containing rect (defined in the current graphics state and clipped to the current window, but not against the clipping path). If the resulting device rectangle is degenerate, Size will be (0,0) and Data will be nil, but the other entries in the dictionary will be filled in.

If the device does not support the operation, returns nil.

The returned dictionary contains at least the following keys:

DataAn NSData-instance with the image data. SizeAn NSValue/NSSize with the size in pixels of the returned image data. BitsPerSampleAn NSValue/unsigned int. SamplesPerPixelAn NSValue/unsigned int. ColorSpaceAn NSString with the name of the color space the data is in. HasAlphaAn NSValue/unsigned int. 0 if the returned image does not have an alpha channel, 1 if it does. MatrixAn NSAffineTransform-instance that contains the transform between current user space and image space for this image. */ - (NSDictionary *) GSReadRect: (NSRect)rect; /* Soon to be obsolete */ - (void) NSDrawBitmap: (NSRect) rect : (NSInteger) pixelsWide : (NSInteger) pixelsHigh : (NSInteger) bitsPerSample : (NSInteger) samplesPerPixel : (NSInteger) bitsPerPixel : (NSInteger) bytesPerRow : (BOOL) isPlanar : (BOOL) hasAlpha : (NSString *) colorSpaceName : (const unsigned char *const [5]) data; - (void) NSBeep; /* Context helper wraps */ - (void) GSWSetViewIsFlipped: (BOOL) flipped; - (BOOL) GSWViewIsFlipped; @end /* ----------------------------------------------------------------------- */ /* Printing Ops */ /* ----------------------------------------------------------------------- */ @interface NSGraphicsContext (Printing) - (void) beginPage: (int)ordinalNum label: (NSString*)aString bBox: (NSRect)pageRect fonts: (NSString*)fontNames; - (void) beginPrologueBBox: (NSRect)boundingBox creationDate: (NSString*)dateCreated createdBy: (NSString*)anApplication fonts: (NSString*)fontNames forWhom: (NSString*)user pages: (int)numPages title: (NSString*)aTitle; - (void) beginSetup; - (void) beginTrailer; - (void) endDocumentPages: (int)pages documentFonts: (NSSet*)fontNames; - (void) endHeaderComments; - (void) endPageSetup; - (void) endPrologue; - (void) endSetup; - (void) endSheet; - (void) endTrailer; - (void) printerProlog; - (void) showPage; @end @interface NSGraphicsContext (NSGradient) - (void) drawGradient: (NSGradient*)gradient fromCenter: (NSPoint)startCenter radius: (CGFloat)startRadius toCenter: (NSPoint)endCenter radius: (CGFloat)endRadius options: (NSUInteger)options; - (void) drawGradient: (NSGradient*)gradient fromPoint: (NSPoint)startPoint toPoint: (NSPoint)endPoint options: (NSUInteger)options; @end /* NSGraphicContext constants */ APPKIT_EXPORT NSString *NSGraphicsContextDestinationAttributeName; APPKIT_EXPORT NSString *NSGraphicsContextPDFFormat; APPKIT_EXPORT NSString *NSGraphicsContextPSFormat; APPKIT_EXPORT NSString *NSGraphicsContextRepresentationFormatAttributeName; /* Colorspace constants */ APPKIT_EXPORT NSString *GSColorSpaceName; APPKIT_EXPORT NSString *GSColorSpaceWhitePoint; APPKIT_EXPORT NSString *GSColorSpaceBlackPoint; APPKIT_EXPORT NSString *GSColorSpaceGamma; APPKIT_EXPORT NSString *GSColorSpaceMatrix; APPKIT_EXPORT NSString *GSColorSpaceRange; APPKIT_EXPORT NSString *GSColorSpaceComponents; APPKIT_EXPORT NSString *GSColorSpaceProfile; APPKIT_EXPORT NSString *GSAlternateColorSpace; APPKIT_EXPORT NSString *GSBaseColorSpace; APPKIT_EXPORT NSString *GSColorSpaceColorTable; #endif /* _NSGraphicsContext_h_INCLUDE */ gnustep-gui-0.24.0/Headers/AppKit/NSTextStorage.h0000664000076500007650000001557612036333132021402 0ustar brains99brains99/* NSTextStorage.h Copyright (C) 1996,1999 Free Software Foundation, Inc. Author: Daniel Böhringer Date: August 1998 Source by Daniel Böhringer integrated into GNUstep gui by Felipe A. Rodriguez Update: Richard Frith-Macdonald Documentation written from scratch by: Nicola Pero This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSTextStorage #define _GNUstep_H_NSTextStorage #import #import #import #import @class NSNotification; @class NSString; @class GSLayoutManager; @class NSFont; /* * When edit:range:changeInLength: is called, it takes a mask saying * what has been edited. The mask is NSTextStorageEditedAttributes * if the attributes have been changed, NSTextStorageEditedCharacters * if the characters have been changed, and * NSTextStorageEditedAttributes | NSTextStorageEditedCharacters if both * characters and attributes were edited. */ enum { NSTextStorageEditedAttributes = 1, NSTextStorageEditedCharacters = 2 }; /* * The NSTextStorage */ @interface NSTextStorage : NSMutableAttributedString { NSRange _editedRange; int _editedDelta; NSMutableArray *_layoutManagers; id _delegate; unsigned _editedMask; unsigned _editCount; } - (void) addLayoutManager: (GSLayoutManager*)obj; - (void) removeLayoutManager: (GSLayoutManager*)obj; - (NSArray*) layoutManagers; /* * This method is normally called between a beginEditing and an * endEditing message to record any changes which were made to the * receiver. It is automatically called by the NSTextStorage * primitives, so in other words, NSTextStorage calls it for you, and * you don't normally need to call this method. You might (a more * theoretical than practical option) need to subclass it and override * this method to take into account changes done. * * If the method is called outside a beginEditing/endEditing calls, it * calls processEditing immediately. As far as I understand, that would * happen if you modify the NSTextStorage without enclosing your changes * inside a beginEditing/endEditing calls. * * maks can be NSTextStorageEditedAttributes or * NSTextStorageEditedCharacters, or and | of the two. * * the old range is the range affected by the change in the string ... in the * original string. * * the changeInLength is, well, positive if you added characters, negative * if you removed characters. */ - (void) edited: (unsigned)mask range: (NSRange)old changeInLength: (int)delta; /* * This method is called to process the editing once it's finished. * Normally it is called by endEditing; but if you modify the NSTextStorage * without enclosing the modifications into a beginEditing/endEditing pair, * this method will be called directly by edited:range:changeInLength:. * * But in practice, what does this method do ? Well, it posts the * NSTextStorageWillProcessEditing notification. Then, it calls * fixAttributesAfterEditingRange:. Then, it posts the * NSTextStorageDidProcessEditing notification. Finally, it tells the * layout manager(s) about this change in the text storage by calling * textStorage:edited:range:changeInLength:invalidatedRange:. */ - (void) processEditing; /* * Start a set of changes to the text storage. All the changes are * recorded and merged - without any layout to be done. When you call * endEditing, the layout will be done in one single operation. * * In practice, you should call beginEditing before starting to modify * the NSTextStorage. When you are finished modifying it and you want * your changes to be propagated to the layout manager(s), you call * endEditing. * * If you don't enclose your changes into a beginEditing/endEditing pair, * it still works, but it's less efficient. */ - (void) beginEditing; /* * End a set of changes, and calls processEditing. */ - (void) endEditing; /* * The delegate can use the following methods when it receives a * notification that a change was made. The methods tell him what * kind of change was made. */ - (unsigned) editedMask; - (NSRange) editedRange; - (int) changeInLength; - (void) setDelegate: (id)delegate; - (id) delegate; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void) ensureAttributesAreFixedInRange: (NSRange)range; - (BOOL) fixesAttributesLazily; - (void) invalidateAttributesInRange: (NSRange)range; #endif /** Returns the string data stored by the receiver.
* For performance reasons (and OSX compatibility) this is actually * a proxy to the internal representation of the string.
* This proxy provides an immutable string interface, * but you must be aware that the underlying information may be modified * by the receiver at any point, so if you need a consistent/fixed * snapshot of the data (or if you are going to pass the string to other * code which expects to be working with a constant string), you should * copy the object returned by this method rather than simply retaining it. */ - (NSString*) string; @end /**** NSTextStorage delegate methods ****/ @interface NSObject (NSTextStorageDelegate) /* * The delegate is automatically registered to receive the * NSTextStorageWillProcessEditingNotification, and the * NSTextStorageDidProcessEditingNotification via these methods, so * once the notifications are sent, these methods of the delegate will * be invokes. In these methods the delegate can use editedMask, * editedRange, changeInLength to figure out what the actual change * is. */ - (void) textStorageWillProcessEditing: (NSNotification*)notification; - (void) textStorageDidProcessEditing: (NSNotification*)notification; @end @interface NSTextStorage (Scripting) /* * Attributes for string... */ - (NSFont*) font; - (void) setFont: (NSFont*)font; @end /**** Notifications ****/ /* The object of the notification is the NSTextStorage itself. */ APPKIT_EXPORT NSString *NSTextStorageWillProcessEditingNotification; APPKIT_EXPORT NSString *NSTextStorageDidProcessEditingNotification; #endif gnustep-gui-0.24.0/Headers/AppKit/NSDocumentController.h0000664000076500007650000001431711372462026022752 0ustar brains99brains99/* NSDocumentController.h The document controller class Copyright (C) 1999 Free Software Foundation, Inc. Author: Carl Lindberg Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSDocumentController #define _GNUstep_H_NSDocumentController #import #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) #import #import #import @class NSArray; @class NSError; @class NSMutableArray; @class NSURL; @class NSString; @class NSDocument; @class NSMenu; @class NSMenuItem; @class NSOpenPanel; @class NSWindow; @interface NSDocumentController : NSObject { @private NSMutableArray *_documents; NSMutableArray *_recent_documents; NSArray *_types; // from info.plist with key NSTypes NSTimeInterval _autosavingDelay; struct __controller_flags { unsigned int should_create_ui:1; unsigned int RESERVED:31; } _controller_flags; NSMenu *_recent_documents_menu; } + (id) sharedDocumentController; /*" document creation "*/ // doesn't create the windowControllers - (id) makeUntitledDocumentOfType: (NSString*)type; - (id) makeDocumentWithContentsOfFile: (NSString*)fileName ofType: (NSString*)type; // creates window controllers - (id) openUntitledDocumentOfType: (NSString*)type display: (BOOL)display; - (id) openDocumentWithContentsOfFile: (NSString*)fileName display: (BOOL)display; - (id) makeDocumentWithContentsOfURL: (NSURL*)url ofType: (NSString*)type; - (id) openDocumentWithContentsOfURL: (NSURL*)url display: (BOOL)display; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (id) makeDocumentForURL: (NSURL*)url withContentsOfURL: (NSURL*)contents ofType: (NSString*)type error: (NSError**)err; - (id) makeDocumentWithContentsOfURL: (NSURL*)url ofType: (NSString*)type error: (NSError**)err; - (id) makeUntitledDocumentOfType: (NSString*)type error: (NSError**)err; - (id) openDocumentWithContentsOfURL: (NSURL*)url display: (BOOL)flag error: (NSError**)err; - (id) openUntitledDocumentAndDisplay: (BOOL)flag error: (NSError**)err; - (BOOL) reopenDocumentForURL: (NSURL*)url withContentsOfURL: (NSURL*)contents error: (NSError**)err; - (BOOL) presentError: (NSError*)err; - (void) presentError: (NSError*)err modalForWindow: (NSWindow*)win delegate: (id)delegate didPresentSelector: (SEL)sel contextInfo: (void*)context; - (NSError*) willPresentError: (NSError*)err; #endif /*" With or without UI "*/ - (BOOL) shouldCreateUI; - (void) setShouldCreateUI: (BOOL)flag; /*" Actions "*/ - (IBAction) saveAllDocuments: (id)sender; - (IBAction) openDocument: (id)sender; - (IBAction) newDocument: (id)sender; - (IBAction) clearRecentDocuments: (id)sender; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (NSUInteger) maximumRecentDocumentCount; #endif /*" Recent Documents "*/ - (void) noteNewRecentDocument: (NSDocument*)aDocument; - (void) noteNewRecentDocumentURL: (NSURL*)anURL; - (NSArray*) recentDocumentURLs; /*" Open panel "*/ - (NSArray*) URLsFromRunningOpenPanel; - (NSArray*) fileNamesFromRunningOpenPanel; - (NSInteger) runModalOpenPanel: (NSOpenPanel*)openPanel forTypes: (NSArray*)openableFileExtensions; /*" Document management "*/ - (void) addDocument: (NSDocument*)document; - (void) removeDocument: (NSDocument*)document; - (BOOL) closeAllDocuments; - (void) closeAllDocumentsWithDelegate: (id)delegate didCloseAllSelector: (SEL)didAllCloseSelector contextInfo: (void*)contextInfo; - (BOOL) reviewUnsavedDocumentsWithAlertTitle: (NSString*)title cancellable: (BOOL)cancellable; - (void) reviewUnsavedDocumentsWithAlertTitle: (NSString*)title cancellable: (BOOL)cancellable delegate: (id)delegate didReviewAllSelector: (SEL)didReviewAllSelector contextInfo: (void*)contextInfo; - (NSArray*) documents; - (BOOL) hasEditedDocuments; - (id) currentDocument; - (NSString*) currentDirectory; - (id) documentForWindow: (NSWindow*)window; - (id) documentForFileName: (NSString*)fileName; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (id) documentForURL: (NSURL*)url; #endif /*" Menu validation "*/ - (BOOL) validateMenuItem: (NSMenuItem*)anItem; - (BOOL) validateUserInterfaceItem: (id )anItem; /*" Types and extensions "*/ - (NSString*) displayNameForType: (NSString*)type; - (NSString*) typeFromFileExtension: (NSString*)fileExtension; - (NSArray*) fileExtensionsFromType: (NSString*)type; - (Class) documentClassForType: (NSString*)type; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) /** Returns the first type found for which the application has an editor * role. */ - (NSString*) defaultType; /** Returns the names of the NSDocument subclasses handling documents * in this application. This will be nil or empty if this is not a document * based application. */ - (NSArray*) documentClassNames; - (NSString*) typeForContentsOfURL: (NSURL*)url error: (NSError**)err; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) /* Autosaving */ - (NSTimeInterval) autosavingDelay; - (void) setAutosavingDelay: (NSTimeInterval)autosavingDelay; #endif @end #endif // GS_API_MACOSX #endif // _GNUstep_H_NSDocumentController gnustep-gui-0.24.0/Headers/AppKit/NSViewController.h0000664000076500007650000000413611517263353022107 0ustar brains99brains99/* NSViewController.h Copyright (C) 2010 Free Software Foundation, Inc. This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSViewController #define _GNUstep_H_NSViewController #import #import #import #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) @class NSArray, NSBundle, NSPointerArray, NSView; @interface NSViewController : NSResponder { @private NSString *_nibName; NSBundle *_nibBundle; id _representedObject; NSString *_title; IBOutlet NSView *view; NSArray *_topLevelObjects; NSPointerArray *_editors; id _autounbinder; NSString *_designNibBundleIdentifier; struct ___vcFlags { unsigned int nib_is_loaded:1; unsigned int RESERVED:31; } _vcFlags; id _reserved; } - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil; - (void)setRepresentedObject:(id)representedObject; - (id)representedObject; - (void)setTitle:(NSString *)title; - (NSString *)title; - (void)setView:(NSView *)aView; - (NSView *)view; - (void)loadView; - (NSString *)nibName; - (NSBundle *)nibBundle; @end #endif // OS_API_VERSION #endif /* _GNUstep_H_NSViewController */ gnustep-gui-0.24.0/Headers/AppKit/AppKitExceptions.h0000664000076500007650000000623311352354326022120 0ustar brains99brains99/* 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __AppKit_AppKitExceptions_h__ #define __AppKit_AppKitExceptions_h__ #import #import @class NSString; APPKIT_EXPORT NSString *NSAbortModalException; APPKIT_EXPORT NSString *NSAbortPrintingException; APPKIT_EXPORT NSString *NSAppKitIgnoredException; APPKIT_EXPORT NSString *NSAppKitVirtualMemoryException; APPKIT_EXPORT NSString *NSBadBitmapParametersException; APPKIT_EXPORT NSString *NSBadComparisonException; APPKIT_EXPORT NSString *NSBadRTFColorTableException; APPKIT_EXPORT NSString *NSBadRTFDirectiveException; APPKIT_EXPORT NSString *NSBadRTFFontTableException; APPKIT_EXPORT NSString *NSBadRTFStyleSheetException; APPKIT_EXPORT NSString *NSBrowserIllegalDelegateException; APPKIT_EXPORT NSString *NSColorListIOException; APPKIT_EXPORT NSString *NSColorListNotEditableException; APPKIT_EXPORT NSString *NSDraggingException; APPKIT_EXPORT NSString *NSFontUnavailableException; APPKIT_EXPORT NSString *NSIllegalSelectorException; APPKIT_EXPORT NSString *NSImageCacheException; APPKIT_EXPORT NSString *NSNibLoadingException; APPKIT_EXPORT NSString *NSPPDIncludeNotFoundException; APPKIT_EXPORT NSString *NSPPDIncludeStackOverflowException; APPKIT_EXPORT NSString *NSPPDIncludeStackUnderflowException; APPKIT_EXPORT NSString *NSPPDParseException; APPKIT_EXPORT NSString *NSPasteboardCommunicationException; APPKIT_EXPORT NSString *NSPrintOperationExistsException; APPKIT_EXPORT NSString *NSPrintPackageException; APPKIT_EXPORT NSString *NSPrintingCommunicationException; APPKIT_EXPORT NSString *NSRTFPropertyStackOverflowException; APPKIT_EXPORT NSString *NSTIFFException; APPKIT_EXPORT NSString *NSTextLineTooLongException; APPKIT_EXPORT NSString *NSTextNoSelectionException; APPKIT_EXPORT NSString *NSTextReadException; APPKIT_EXPORT NSString *NSTextWriteException; APPKIT_EXPORT NSString *NSTypedStreamVersionException; APPKIT_EXPORT NSString *NSWindowServerCommunicationException; APPKIT_EXPORT NSString *NSWordTablesReadException; APPKIT_EXPORT NSString *NSWordTablesWriteException; #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) APPKIT_EXPORT NSString *GSWindowServerInternalException; #endif #endif /* __AppKit_AppKitExceptions_h__ */ gnustep-gui-0.24.0/Headers/AppKit/NSStepper.h0000664000076500007650000000275311276011274020551 0ustar brains99brains99/* NSStepper.h The stepper class Copyright (C) 2001 Free Software Foundation, Inc. Author: Pierre-Yves Rivaille Date: August 2001 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSStepper #define _GNUstep_H_NSStepper #import @interface NSStepper : NSControl { // Attributes } - (double)maxValue; - (void)setMaxValue: (double)maxValue; - (double)minValue; - (void)setMinValue: (double)minValue; - (double)increment; - (void)setIncrement: (double)increment; - (BOOL)autorepeat; - (void)setAutorepeat: (BOOL)autorepeat; - (BOOL)valueWraps; - (void)setValueWraps: (BOOL)valueWraps; @end #endif // _GNUstep_H_NSStepper gnustep-gui-0.24.0/Headers/AppKit/NSPasteboard.h0000664000076500007650000002012611642605215021206 0ustar brains99brains99/* NSPasteboard.h Class to transfer data to and from the pasteboard server Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Richard Frith-Macdonald This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSPasteboard #define _GNUstep_H_NSPasteboard #import #import #import #if defined(__cplusplus) extern "C" { #endif @class NSString; @class NSArray; @class NSData; @class NSFileWrapper; /** * Pasteboard contains string data as written by * [NSPasteboard-setString:forType:] or [NSPasteboard-setPropertyList:forType:] */ APPKIT_EXPORT NSString *NSStringPboardType; /** * Pasteboard contains color information */ APPKIT_EXPORT NSString *NSColorPboardType; /** * Pasteboard contains generic file content information (serialized) * as written by [NSPasteboard-writeFileContents:] or * [NSPasteboard-writeFileWrapper:] */ APPKIT_EXPORT NSString *NSFileContentsPboardType; /** * Pasteboard contains an array of filenames (serialized) * as written by [NSPasteboard-setPropertyList:forType:] */ APPKIT_EXPORT NSString *NSFilenamesPboardType; /** * Pasteboard contains font color information */ APPKIT_EXPORT NSString *NSFontPboardType; /** * Pasteboard contains ruler color information */ APPKIT_EXPORT NSString *NSRulerPboardType; /** * Pasteboard contains postscript code */ APPKIT_EXPORT NSString *NSPostScriptPboardType; /** * Pasteboard contains tabular text. */ APPKIT_EXPORT NSString *NSTabularTextPboardType; /** * Pasteboard contains text in rich text format. */ APPKIT_EXPORT NSString *NSRTFPboardType; /** * Pasteboard contains text in rich text format with additional info */ APPKIT_EXPORT NSString *NSRTFDPboardType; /** * Pasteboard contains a TIFF image */ APPKIT_EXPORT NSString *NSTIFFPboardType; /** * Pasteboard contains a link to data in some document */ APPKIT_EXPORT NSString *NSDataLinkPboardType; /** * Pasteboard contains general binary data */ APPKIT_EXPORT NSString *NSGeneralPboardType; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) /** * Pasteboard contains a PDF document */ APPKIT_EXPORT NSString *NSPDFPboardType; /** * Pasteboard contains a PICT diagram document */ APPKIT_EXPORT NSString *NSPICTPboardType; /** * Pasteboard contains a URL */ APPKIT_EXPORT NSString *NSURLPboardType; /** * Pasteboard contains HTML data */ APPKIT_EXPORT NSString *NSHTMLPboardType; /** * Pasteboard contains VCard (address book) data */ APPKIT_EXPORT NSString *NSVCardPboardType; /** * Pasteboard contains promised files */ APPKIT_EXPORT NSString *NSFilesPromisePboardType; #endif /** * The pasteboard used for drag and drop information. */ APPKIT_EXPORT NSString *NSDragPboard; /** * The pasteboard used search and replace editing operations. */ APPKIT_EXPORT NSString *NSFindPboard; /** * The pasteboard used for cutting and pasting font information. */ APPKIT_EXPORT NSString *NSFontPboard; /** * The general purpose pasteboard (mostly used for cut and paste) */ APPKIT_EXPORT NSString *NSGeneralPboard; /** * The pasteboard used for cutting and pasting ruler information. */ APPKIT_EXPORT NSString *NSRulerPboard; /** * Exception raised when communication with the pasteboard server fails. */ APPKIT_EXPORT NSString *NSPasteboardCommunicationException; @interface NSPasteboard : NSObject { NSString *name; // The name of this pasteboard. int changeCount; // What we think the current count is. id target; // Proxy to the object in the server. id owner; // Local pasteboard owner. BOOL useHistory; // Want strict OPENSTEP? } // // Creating and Releasing an NSPasteboard Object // + (NSPasteboard*) generalPasteboard; + (NSPasteboard*) pasteboardWithName: (NSString*)aName; + (NSPasteboard*) pasteboardWithUniqueName; - (void) releaseGlobally; // // Getting Data in Different Formats // + (NSPasteboard*) pasteboardByFilteringData: (NSData*)data ofType: (NSString*)type; + (NSPasteboard*) pasteboardByFilteringFile: (NSString*)filename; + (NSPasteboard*) pasteboardByFilteringTypesInPasteboard: (NSPasteboard*)pboard; + (NSArray*) typesFilterableTo: (NSString*)type; // // Referring to a Pasteboard by Name // - (NSString*) name; // // Writing Data // - (int) addTypes: (NSArray*)newTypes owner: (id)newOwner; - (int) declareTypes: (NSArray*)newTypes owner: (id)newOwner; - (BOOL) setData: (NSData*)data forType: (NSString*)dataType; - (BOOL) setPropertyList: (id)propertyList forType: (NSString*)dataType; - (BOOL) setString: (NSString*)string forType: (NSString*)dataType; - (BOOL) writeFileContents: (NSString*)filename; - (BOOL) writeFileWrapper: (NSFileWrapper*)wrapper; // // Determining Types // - (NSString*) availableTypeFromArray: (NSArray*)types; - (NSArray*) types; // // Reading Data // - (int) changeCount; - (NSData*) dataForType: (NSString*)dataType; - (id) propertyListForType: (NSString*)dataType; - (NSString*) readFileContentsType: (NSString*)type toFile: (NSString*)filename; - (NSFileWrapper*) readFileWrapper; - (NSString*) stringForType: (NSString*)dataType; @end /** * The NSPasteboardOwner informal protocal defines the messages that * the pasteboard system will send to a pasteboard owner if they are * implemented. These are needed to support lazy provision of * pasteboard data. */ @interface NSObject (NSPasteboardOwner) /** * This method is called by the pasteboard system when it does not have * the data that has been asked for ... the pasteboard owner should * supply the data to the pasteboard by calling -setData:forType: or one * of the related methods. */ - (void) pasteboard: (NSPasteboard*)sender provideDataForType: (NSString*)type; #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) /** * Implemented where GNUstep pasteboard extensions are required.
* This method is called by the pasteboard system when it does not have * the data that has been asked for ... the pasteboard owner should * supply the data to the pasteboard by calling -setData:forType: or one * of the related methods. */ - (void) pasteboard: (NSPasteboard*)sender provideDataForType: (NSString*)type andVersion: (int)version; #endif /** * This method is called by the pasteboard system when another object * takes ownership of the pasteboard ... it lets the previous owner * know that it is no longer required to supply data. */ - (void) pasteboardChangedOwner: (NSPasteboard*)sender; @end @interface NSPasteboard (GNUstepExtensions) + (NSString*) mimeTypeForPasteboardType: (NSString*)type; + (NSString*) pasteboardTypeForMimeType: (NSString*)mimeType; - (void) setChangeCount: (int)count; - (void) setHistory: (unsigned)length; @end #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) #import @interface NSURL (NSPasteboard) + (NSURL*) URLFromPasteboard: (NSPasteboard*)pasteBoard; - (void) writeToPasteboard: (NSPasteboard*)pasteBoard; @end #endif // // Return File-related Pasteboard Types // APPKIT_EXPORT NSString *NSCreateFileContentsPboardType(NSString *fileType); APPKIT_EXPORT NSString *NSCreateFilenamePboardType(NSString *fileType); APPKIT_EXPORT NSString *NSGetFileType(NSString *pboardType); APPKIT_EXPORT NSArray *NSGetFileTypes(NSArray *pboardTypes); #if defined(__cplusplus) } #endif #endif // _GNUstep_H_NSPasteboard gnustep-gui-0.24.0/Headers/AppKit/NSActionCell.h0000664000076500007650000000250512101306763021135 0ustar brains99brains99/* NSActionCell.h Abstract cell for target/action paradigm Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSActionCell #define _GNUstep_H_NSActionCell #import #import @interface NSActionCell : NSCell { // Attributes NSInteger _tag; id _target; SEL _action; NSView *_control_view; } @end #endif // _GNUstep_H_NSActionCell gnustep-gui-0.24.0/Headers/AppKit/NSButtonCell.h0000664000076500007650000001703411673147131021203 0ustar brains99brains99/* NSButtonCell.h The cell class for NSButton Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Ovidiu Predescu Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSButtonCell #define _GNUstep_H_NSButtonCell #import #import @class NSFont; @class NSSound; /** Type of button in an NSButton or NSButtonCell. * * NSMomentaryPushInButton * Default button type! Pushed in and lit when mouse is * down, pushed out and unlit when mouse is release. * NSPushOnPushOffButton * Used to show/store ON / OFF states. In when ON, out when OFF. * NSToggleButton * Like NSPushOnPushOffButton but images is changed for ON and * OFF state. * NSSwitchButton * A borderless NSToggleButton * NSRadioButton * A type of NSSwitchButton similar to a Microsoft Windows radio * button. * NSMomentaryChangeButton * Image of button changes on mouse down and then changes back * once released. * NSOnOffButton * Simple ON / OFF button. First click lights the button, * seconds click unlights it. * NSMomentaryLightButton * Like NSMomentaryPushInButton but button is not pushed * in on mouse down * * NSMomentaryLight * Same as NSMomentaryPushInButton. Has been depricated in Cocoa. * NSMomentaryPushButton * Same as NSMomentaryLightButton. Has been depricated in * Cocoa. * */ typedef enum _NSButtonType { NSMomentaryLightButton, NSPushOnPushOffButton, NSToggleButton, NSSwitchButton, NSRadioButton, NSMomentaryChangeButton, NSOnOffButton, NSMomentaryPushInButton, // These are old names NSMomentaryLight = NSMomentaryPushInButton, NSMomentaryPushButton = NSMomentaryLightButton } NSButtonType; typedef enum _NSBezelStyle { NSRoundedBezelStyle = 1, NSRegularSquareBezelStyle, NSThickSquareBezelStyle, NSThickerSquareBezelStyle, NSDisclosureBezelStyle, NSShadowlessSquareBezelStyle, NSCircularBezelStyle, NSTexturedSquareBezelStyle, NSHelpButtonBezelStyle, NSSmallSquareBezelStyle, NSTexturedRoundedBezelStyle, NSRoundRectBezelStyle, NSRecessedBezelStyle, NSRoundedDisclosureBezelStyle, // The next five no longer show up in the MacOSX documentation NSNeXTBezelStyle, NSPushButtonBezelStyle, NSSmallIconButtonBezelStyle, NSMediumIconButtonBezelStyle, NSLargeIconButtonBezelStyle } NSBezelStyle; typedef enum _NSGradientType { NSGradientNone, NSGradientConcaveWeak, NSGradientConcaveStrong, NSGradientConvexWeak, NSGradientConvexStrong } NSGradientType; @interface NSButtonCell : NSActionCell { // Attributes NSString *_altContents; NSImage *_altImage; NSString *_keyEquivalent; NSFont *_keyEquivalentFont; NSSound *_sound; NSUInteger _keyEquivalentModifierMask; NSInteger _highlightsByMask; NSInteger _showAltStateMask; float _delayInterval; float _repeatInterval; NSBezelStyle _bezel_style; NSGradientType _gradient_type; NSColor *_backgroundColor; // Think of the following as a BOOL ivars #define _buttoncell_is_transparent _cell.subclass_bool_one #define _image_dims_when_disabled _cell.subclass_bool_two #define _shows_border_only_while_mouse_inside _cell.subclass_bool_three #define _mouse_inside _cell.subclass_bool_four NSImageScaling _imageScaling; } // // Setting the Titles // - (NSString *)alternateTitle; - (void)setAlternateTitle: (NSString *)aString; - (void)setFont: (NSFont *)fontObject; - (void)setTitle: (NSString *)aString; - (NSString *)title; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (NSAttributedString *)attributedAlternateTitle; - (NSAttributedString *)attributedTitle; - (void)setAttributedAlternateTitle: (NSAttributedString *)aString; - (void)setAttributedTitle: (NSAttributedString *)aString; - (void)setTitleWithMnemonic: (NSString *)aString; - (NSString *)alternateMnemonic; - (NSUInteger)alternateMnemonicLocation; - (void)setAlternateMnemonicLocation: (NSUInteger)location; - (void)setAlternateTitleWithMnemonic: (NSString *)aString; #endif // // Setting the Images // - (NSImage *)alternateImage; - (NSCellImagePosition)imagePosition; - (void)setAlternateImage: (NSImage *)anImage; - (void)setImagePosition: (NSCellImagePosition)aPosition; #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (NSImageScaling)imageScaling; - (void)setImageScaling:(NSImageScaling)scaling; #endif // // Setting the Repeat Interval // - (void)getPeriodicDelay: (float *)delay interval: (float *)interval; - (void)setPeriodicDelay: (float)delay interval: (float)interval; // // Setting the Key Equivalent // - (NSString *)keyEquivalent; - (NSFont *)keyEquivalentFont; - (NSUInteger)keyEquivalentModifierMask; - (void)setKeyEquivalent: (NSString *)key; - (void)setKeyEquivalentModifierMask: (NSUInteger)mask; - (void)setKeyEquivalentFont: (NSFont *)fontObj; - (void)setKeyEquivalentFont: (NSString *)fontName size: (float)fontSize; // // Modifying Graphic Attributes // - (BOOL)isTransparent; - (void)setTransparent: (BOOL)flag; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (NSBezelStyle)bezelStyle; - (void)setBezelStyle: (NSBezelStyle)bezelStyle; - (BOOL)showsBorderOnlyWhileMouseInside; - (void)setShowsBorderOnlyWhileMouseInside: (BOOL)show; - (NSGradientType)gradientType; - (void)setGradientType: (NSGradientType)gradientType; - (BOOL)imageDimsWhenDisabled; - (void)setImageDimsWhenDisabled: (BOOL)flag; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (NSColor *) backgroundColor; - (void) setBackgroundColor: (NSColor *)color; - (void) drawBezelWithFrame: (NSRect)cellFrame inView: (NSView*)controlView; - (void) drawImage: (NSImage*)imageToDisplay withFrame: (NSRect)cellFrame inView: (NSView *)controlView; - (void) drawTitle: (NSAttributedString*)titleToDisplay withFrame: (NSRect)cellFrame inView: (NSView *)controlView; #endif // // Modifying Graphic Attributes // - (NSInteger)highlightsBy; - (void)setHighlightsBy: (NSInteger)mask; - (void)setShowsStateBy: (NSInteger)mask; - (void)setButtonType: (NSButtonType)buttonType; - (NSInteger)showsStateBy; // // Sound // #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void)setSound: (NSSound *)aSound; - (NSSound *)sound; #endif // // Mouse // #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void)mouseEntered: (NSEvent *)event; - (void)mouseExited: (NSEvent *)event; #endif @end #endif // _GNUstep_H_NSButtonCell gnustep-gui-0.24.0/Headers/AppKit/NSComboBox.h0000664000076500007650000000753012110024400020614 0ustar brains99brains99/* NSComboBox.h Copyright (C) 1999 Free Software Foundation, Inc. Author: Gerrit van Dyk Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSComboBox #define _GNUstep_H_NSComboBox #import #import @class NSArray; @class NSString; @class NSNotification; @interface NSComboBox : NSTextField { } - (BOOL) hasVerticalScroller; - (void) setHasVerticalScroller: (BOOL)flag; - (NSSize) intercellSpacing; - (void) setIntercellSpacing: (NSSize)aSize; - (CGFloat) itemHeight; - (void) setItemHeight: (CGFloat)itemHeight; - (NSInteger) numberOfVisibleItems; - (void) setNumberOfVisibleItems: (NSInteger)visibleItems; - (void) reloadData; - (void) noteNumberOfItemsChanged; - (BOOL) usesDataSource; - (void) setUsesDataSource: (BOOL)flag; - (void) scrollItemAtIndexToTop: (NSInteger)index; - (void) scrollItemAtIndexToVisible: (NSInteger)index; - (void) selectItemAtIndex: (NSInteger)index; - (void) deselectItemAtIndex: (NSInteger)index; - (NSInteger) indexOfSelectedItem; - (NSInteger) numberOfItems; /* These two methods can only be used when usesDataSource is YES */ - (id) dataSource; - (void) setDataSource: (id)aSource; /* These methods can only be used when usesDataSource is NO */ - (void) addItemWithObjectValue: (id)object; - (void) addItemsWithObjectValues: (NSArray *)objects; - (void) insertItemWithObjectValue: (id)object atIndex:(NSInteger)index; - (void) removeItemWithObjectValue: (id)object; - (void) removeItemAtIndex: (NSInteger)index; - (void) removeAllItems; - (void) selectItemWithObjectValue: (id)object; - (id) itemObjectValueAtIndex: (NSInteger)index; - (id) objectValueOfSelectedItem; - (NSInteger) indexOfItemWithObjectValue: (id)object; - (NSArray *) objectValues; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) /* text completion */ - (void) setCompletes: (BOOL)completes; - (BOOL) completes; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (BOOL) isButtonBordered; - (void) setButtonBordered:(BOOL)flag; #endif @end @interface NSObject (NSComboBoxDataSource) - (NSInteger) numberOfItemsInComboBox: (NSComboBox *)aComboBox; - (id) comboBox: (NSComboBox *)aComboBox objectValueForItemAtIndex:(NSInteger)index; - (NSUInteger) comboBox: (NSComboBox *)aComboBox indexOfItemWithStringValue: (NSString *)string; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) /* text completion */ - (NSString *) comboBox: (NSComboBox *)aComboBox completedString: (NSString *)aString; #endif @end @interface NSObject (NSComboBoxNotifications) - (void) comboBoxWillPopUp: (NSNotification *)notification; - (void) comboBoxWillDismiss: (NSNotification *)notification; - (void) comboBoxSelectionDidChange: (NSNotification *)notification; - (void) comboBoxSelectionIsChanging: (NSNotification *)notification; @end APPKIT_EXPORT NSString *NSComboBoxWillPopUpNotification; APPKIT_EXPORT NSString *NSComboBoxWillDismissNotification; APPKIT_EXPORT NSString *NSComboBoxSelectionDidChangeNotification; APPKIT_EXPORT NSString *NSComboBoxSelectionIsChangingNotification; #endif /* _GNUstep_H_NSComboBox */ gnustep-gui-0.24.0/Headers/AppKit/NSInterfaceStyle.h0000664000076500007650000000340211752027347022047 0ustar brains99brains99/* NSInterfaceStyle.h Copyright (C) 1999 Free Software Foundation, Inc. Author: Richard Frith-Macdonald Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSInterfaceStyle #define _GNUstep_H_NSInterfaceStyle #import #if defined(__cplusplus) extern "C" { #endif #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) #import @class NSResponder; @class NSString; typedef enum { NSNoInterfaceStyle = 0, NSNextStepInterfaceStyle = 1, NSMacintoshInterfaceStyle = 2, NSWindows95InterfaceStyle = 3, /* * GNUstep specific. Blame: Michael Hanni. */ GSWindowMakerInterfaceStyle = 4 } NSInterfaceStyle; APPKIT_EXPORT NSString *NSInterfaceStyleDefault; APPKIT_EXPORT NSInterfaceStyle NSInterfaceStyleForKey(NSString *key, NSResponder *responder); #endif // GS_API_MACOSX #if defined(__cplusplus) } #endif #endif // _GNUstep_H_NSInterfaceStyle gnustep-gui-0.24.0/Headers/AppKit/NSForm.h0000664000076500007650000000500012121417516020015 0ustar brains99brains99/* NSForm.h Form class, a matrix of text fields with labels Copyright (C) 1996 Free Software Foundation, Inc. Author: Ovidiu Predescu Date: March 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSForm #define _GNUstep_H_NSForm #import #import @class NSFormCell; @class NSFont; @interface NSForm : NSMatrix { BOOL _title_width_needs_update; } // // Laying Out the Form // - (NSFormCell*)addEntry:(NSString*)title; - (NSFormCell*)insertEntry:(NSString*)title atIndex:(NSInteger)index; - (void)removeEntryAtIndex:(NSInteger)index; - (void)setInterlineSpacing:(CGFloat)spacing; // // Finding Indices // - (NSInteger)indexOfCellWithTag:(NSInteger)aTag; - (NSInteger)indexOfSelectedItem; // // Modifying Graphic Attributes // - (void)setBezeled:(BOOL)flag; - (void)setBordered:(BOOL)flag; - (void)setTextAlignment:(NSTextAlignment)aMode; - (void)setTextFont:(NSFont*)fontObject; - (void)setTitleAlignment:(NSTextAlignment)aMode; - (void)setTitleFont:(NSFont*)fontObject; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (void) setTitleBaseWritingDirection: (NSWritingDirection)direction; - (void) setTextBaseWritingDirection: (NSWritingDirection)direction; #endif // // Getting a Cell // - (id)cellAtIndex:(NSInteger)index; // // Displaying a Cell // - (void)drawCellAtIndex:(NSInteger)index; // // Editing Text // - (void)selectTextAtIndex:(NSInteger)index; // // Resizing the Form // - (void)setEntryWidth:(float)width; // Private -(void) _setTitleWidthNeedsUpdate: (NSNotification*)notification; @end APPKIT_EXPORT NSString *_NSFormCellDidChangeTitleWidthNotification; #endif // _GNUstep_H_NSForm gnustep-gui-0.24.0/Headers/AppKit/NSGlyphGenerator.h0000664000076500007650000000426111352624326022060 0ustar brains99brains99/* -*-objc-*- NSGlyphGenerator.h Interfaces for glyph generation and storage. Copyright (C) 1996 Free Software Foundation, Inc. Author: H. N. Schaller Date: Jun 2006 - aligned with 10.4 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSGlyphGenerator #define _GNUstep_H_NSGlyphGenerator #import #import // define NSGlyph #import @class NSAttributedString; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) enum { NSShowControlGlyphs = 1, NSShowInvisibleGlyphs = 2, NSWantsBidiLevels = 4 }; @protocol NSGlyphStorage - (NSAttributedString*) attributedString; - (void) insertGlyphs: (const NSGlyph*)glyphs length: (NSUInteger)length forStartingGlyphAtIndex: (NSUInteger)glyph characterIndex: (NSUInteger)index; - (NSUInteger) layoutOptions; - (void) setIntAttribute: (NSInteger)tag value: (NSInteger)value forGlyphAtIndex: (NSUInteger)index; @end @interface NSGlyphGenerator : NSObject + (id) sharedGlyphGenerator; - (void) generateGlyphsForGlyphStorage: (id )storage desiredNumberOfCharacters: (NSUInteger)num glyphIndex: (NSUInteger*)glyph characterIndex: (NSUInteger*)index; @end #endif // MAC_OS_X_VERSION_10_3 #endif // _GNUstep_H_NSGlyphGenerator gnustep-gui-0.24.0/Headers/AppKit/NSUserDefaultsController.h0000664000076500007650000000417011354736316023604 0ustar brains99brains99/** NSUserDefaultsController Controller class for user defaults Copyright (C) 2006 Free Software Foundation, Inc. Author: Fred Kiefer Date: September 2006 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSUserDefaultsController #define _GNUstep_H_NSUserDefaultsController #import #import #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) @class NSUserDefaults; @class NSDictionary; @class NSMutableDictionary; @interface NSUserDefaultsController : NSController { NSUserDefaults* _defaults; NSDictionary* _initial_values; id _values; BOOL _applies_immediately; } + (id) sharedUserDefaultsController; - (id) initWithDefaults: (NSUserDefaults*)defaults initialValues: (NSDictionary*)initialValues; - (NSUserDefaults*) defaults; - (id) values; - (NSDictionary*) initialValues; - (void) setInitialValues: (NSDictionary*)values; - (BOOL) appliesImmediately; - (void) setAppliesImmediately: (BOOL)flag; - (void) revert: (id)sender; - (void) revertToInitialValues: (id)sender; - (void) save: (id)sender; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (BOOL) hasUnappliedChanges; #endif @end #endif // OS_API_VERSION #endif // _GNUstep_H_NSUserDefaultsController gnustep-gui-0.24.0/Headers/AppKit/NSTextView.h0000664000076500007650000006113412116340517020703 0ustar brains99brains99/* -*-objc-*- NSTextView.h Copyright (C) 1999, 2000, 2001, 2008 Free Software Foundation, Inc. Author: Fred Kiefer Date: September 2000, January 2008 Reformatted and cleaned up. Author: Nicola Pero Date: December 2000 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSTextView #define _GNUstep_H_NSTextView #import #import #import #import #import #import @class NSTimer; @class NSTextContainer; @class NSTextStorage; @class NSLayoutManager; @class NSRulerView,NSRulerMarker; enum _NSSelectionGranularity { NSSelectByCharacter = 0, NSSelectByWord = 1, NSSelectByParagraph = 2, }; typedef NSUInteger NSSelectionGranularity; /* TODO: this looks like a mosx extension, not a GNUstep extension. should double-check */ enum _NSSelectionAffinity { NSSelectionAffinityUpstream = 0, NSSelectionAffinityDownstream = 1, }; typedef NSUInteger NSSelectionAffinity; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) enum _NSFindPanelAction { NSFindPanelActionShowFindPanel = 1, NSFindPanelActionNext, NSFindPanelActionPrevious, NSFindPanelActionReplaceAll, NSFindPanelActionReplace, NSFindPanelActionReplaceAndFind, NSFindPanelActionSetFindString, NSFindPanelActionReplaceAllInSelection #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) , NSFindPanelActionSelectAll, NSFindPanelActionSelectAllInSelection #endif }; typedef NSUInteger NSFindPanelAction; #endif /* If several NSTextView:s are connected to one NSLayoutManager, some attributes are shared between them. This is done in two ways: storing the attributes in the NSLayoutManager, or storing a copy in each NSTextView and ensuring that the any changes are replicated in all of them. Persistant attributes (ie. attributes that are encoded and decoded) need to be stored in the NSTextView. Non-persistant attributes don't, and should therefore be stored in the NSLayoutManager to avoid problems. */ @interface NSTextView : NSText { /* These attributes are shared by all text views attached to a layout manager. Any changes must be replicated in all those text views. */ id _delegate; struct GSTextViewFlagsType { unsigned is_field_editor:1; unsigned is_editable:1; unsigned is_selectable:1; unsigned is_rich_text:1; unsigned imports_graphics:1; unsigned uses_font_panel:1; unsigned uses_ruler:1; unsigned is_ruler_visible:1; /* I don't know for sure that these are supposed to be shared, but it would be very awkward if they weren't. */ unsigned allows_undo:1; unsigned smart_insert_delete:1; unsigned continuous_spell_checking:1; /* End of shared attributes. */ unsigned draws_background:1; unsigned is_horizontally_resizable:1; unsigned is_vertically_resizable:1; /* owns_text_network is YES if we have created the whole network of text classes (and thus we are responsible to release them when we are released). owns_text_network in NO if the text network was assembled by hand, and the text storage owns everything - thus we need to release nothing. See -initWithFrame: for more comments about this. */ unsigned owns_text_network:1; /* multiple_textviews is YES if more than one NSTextView are sharing this layout manager. In this case, we need to keep the views in sync. */ unsigned multiple_textviews:1; /* These two really are shared, but they're cached, They must be updated whenever the delegate changes (including indirect changes). */ /* YES if delegate responds to `shouldChangeTextInRange:replacementString:' */ unsigned delegate_responds_to_should_change:1; /* YES if delegate responds to `textView:willChangeSelectionFromCharacterRange:toCharacterRange:' */ unsigned delegate_responds_to_will_change_sel:1; /* YES if a DnD operation controls the insertion point in this text view */ unsigned drag_target_hijacks_insertion_point:1; unsigned uses_find_panel:1; unsigned accepts_glyph_info:1; unsigned allows_document_background_color_change:1; } _tf; /* TODO: figure out whether these should be shared or not */ NSColor *_insertionPointColor; /* shared? */ NSDictionary *_selectedTextAttributes; /* shared? */ NSDictionary *_markedTextAttributes; /* shared? */ /* shared by all text views attached to one NSTextStorage */ NSInteger _spellCheckerDocumentTag; NSColor *_backgroundColor; NSSize _minSize; NSSize _maxSize; /* The following is the object used when posting notifications. It is usually `self' - but in the case of multiple textviews it is the firstTextView returned by the layout manager - which might or might not be `self'. This must *not* be retained. */ NSTextView *_notifObject; /* other members of the text network */ NSTextContainer *_textContainer; NSLayoutManager *_layoutManager; NSTextStorage *_textStorage; /* container inset and origin */ NSSize _textContainerInset; NSPoint _textContainerOrigin; /* TODO: move to NSLayoutManager? */ /* Probably not necessary; the insertion point is always drawn in the text view that is the first responder, so there shouldn't be any problems with keeping track of it locally. Still need to think hard about handling of it, though. */ //#if 0 /* Timer used to redraw the insertion point ... FIXME - think what happens with multiple textviews */ NSTimer *_insertionPointTimer; /* Blinking of the insertion point is controlled by the following ivar ... it is YES during the little period in which the insertion point should be drawn on screen, and NO during the following little period in which the insertion point should not be drawn */ BOOL _drawInsertionPointNow; //#endif /* Stores the insertion point rect - updated by updateInsertionPointStateAndRestartTimer: - we must make sure we call the method every time that the insertion point rect might need to be recomputed . */ NSRect _insertionPointRect; /* This is the character index a sequence of moves in one dimension (ie. up/down or left/right) started at. It is passed to the layout manager and is used when an NSTextView is deciding where to move. (Eg. NSLayoutManager tries to maintain the original horizontal position when moving up/down.) */ NSUInteger _originalInsertionPointCharacterIndex; /* * GSInsertionPointMovementDirection * 0=no information (_originalInsertionPointCharacterIndex undefined) * 1=horizontal * 2=vertical */ int _currentInsertionPointMovementDirection; /* Ivar to store the location where text is going to be inserted during * a DnD operation. */ NSUInteger _dragTargetLocation; /* Ivar used to implement coalescing of undo operations */ id _undoObject; /* TODO: Still need to figure out what "proper behavior" is when moving between two NSTextView:s, though. */ NSParagraphStyle *_defaultParagraphStyle; NSDictionary *_linkTextAttributes; NSRange _markedRange; // Text checking (spelling/grammar) NSTimer *_textCheckingTimer; NSRect _lastCheckedRect; } /** Returns the default typing attributes: black text, default paragraph style (as returned by [NSParagraphStyle defaultParagraphStyle]), and default user font and size (as returned by [NSFont userFontOfSize: 0.0]). GNUstep extension. */ +(NSDictionary *) defaultTypingAttributes; /**** Initializing ****/ /* This is sent each time a view is initialized. If you subclass you should ensure that you only register once. */ +(void) registerForServices; /* Designated Initializer. container may be nil. */ -(id) initWithFrame: (NSRect)frameRect textContainer: (NSTextContainer *)container; /* This variant will create the text network (NSTextStorage, NSLayoutManager, and a NSTextContainer). The network will be owned by the NSTextView; releasing it will release all parts of the network. */ -(id) initWithFrame: (NSRect)frameRect; /**** Text network management ****/ /* The set method should not be called directly, but you might want to override it. Gets or sets the text container for this view. Setting the text container marks the view as needing display. The text container calls the set method from its setTextView: method. */ -(NSTextContainer *) textContainer; -(void) setTextContainer: (NSTextContainer *)container; /* This method should be used instead of the primitive -setTextContainer: if you need to replace a view's text container with a new one leaving the rest of the text network intact. This method deals with all the work of making sure the view doesn't get deallocated and removing the old container from the layoutManager and replacing it with the new one. */ -(void) replaceTextContainer: (NSTextContainer *)newContainer; -(NSLayoutManager *) layoutManager; -(NSTextStorage *) textStorage; /* These two methods are for modifying the text programmatically. They don't ask the delegate are send any notifications, and they always work (ie. even if the text view isn't editable). (They are really from NSText, but redeclared here so they can be documented here.) */ - (void) replaceCharactersInRange: (NSRange)aRange withString: (NSString*)aString; /* If the text view isn't rich-text, the attributes of aString will be ignored and the typing attributed will be used. */ -(void) replaceCharactersInRange: (NSRange)aRange /* GNUstep extension. */ withAttributedString: (NSAttributedString *)aString; /*** Additional Font menu commands ***/ /* These complete the set of range: type set methods. to be equivalent to the set of non-range taking varieties. */ -(void) setAlignment: (NSTextAlignment)alignment range: (NSRange)range; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (NSParagraphStyle *) defaultParagraphStyle; - (void) setDefaultParagraphStyle: (NSParagraphStyle *)style; #endif -(void) setRulerVisible: (BOOL)flag; -(BOOL) usesRuler; -(void) setUsesRuler: (BOOL)flag; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (BOOL) usesFindPanel; - (void) setUsesFindPanel: (BOOL)flag; #endif -(BOOL) isContinuousSpellCheckingEnabled; /* mosx */ -(void) setContinuousSpellCheckingEnabled: (BOOL)flag; /* mosx */ -(BOOL) allowsUndo; /* mosx */ -(void) setAllowsUndo: (BOOL)flag; /* mosx */ -(BOOL) smartInsertDeleteEnabled; -(void) setSmartInsertDeleteEnabled: (BOOL)flag; /* These methods are like paste: (from NSResponder) but they restrict the acceptable type of the pasted data. They are suitable as menu actions for appropriate "Paste As" submenu commands. */ -(void) pasteAsPlainText: (id)sender; -(void) pasteAsRichText: (id)sender; /*** Dealing with user changes ***/ -(BOOL) shouldChangeTextInRange: (NSRange)affectedCharRange replacementString: (NSString *)replacementString; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (BOOL) shouldChangeTextInRanges: (NSArray *)ranges replacementStrings: (NSArray *)strings; #endif -(void) didChangeText; -(NSRange) rangeForUserTextChange; -(NSRange) rangeForUserCharacterAttributeChange; -(NSRange) rangeForUserParagraphAttributeChange; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (NSRange) rangeForUserCompletion; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (NSArray *) rangesForUserCharacterAttributeChange; - (NSArray *) rangesForUserParagraphAttributeChange; - (NSArray *) rangesForUserTextChange; #endif /*** Text container stuff ***/ /* The text container inset determines the padding that the view provides around the container. The text container is placed in a rectangle in the text view's bounds rectangle, inset by inset.width on the left and right edge and inset.height on the top and bottom edge. Thus, setting this to (3,5) will give a 3 unit border on the left edge of the text container, a 3 unit border on the right edge, a 5 unit border on the top edge, and a 5 unit border on the bottom edge. */ -(void) setTextContainerInset: (NSSize)inset; -(NSSize) textContainerInset; /* The text container's origin is the origin of the text container's coordinate system in the text view's coordinate system. It is determined from the current usage of the container, the container inset, and the view size. textContainerOrigin returns this point. {TODO: why describe how the origin is determined? atm, it's even incorrect} invalidateTextContainerOrigin is sent automatically whenever something changes that might cause the origin to move. You usually do not need to call it yourself. */ -(NSPoint) textContainerOrigin; -(void) invalidateTextContainerOrigin; /*** Sizing methods ***/ /* Sets the frame size of the view to desiredSize constrained within (effective) minimum size and maximum size, and to the directions in which the text view is resizable. */ -(void) setConstrainedFrameSize: (NSSize)desiredSize; -(void) setSelectedTextAttributes: (NSDictionary *)attributeDictionary; -(NSDictionary *) selectedTextAttributes; -(void) setInsertionPointColor: (NSColor *)color; -(NSColor *) insertionPointColor; /*** Marked range ***/ -(void) setMarkedTextAttributes: (NSDictionary *)attributeDictionary; -(NSDictionary *) markedTextAttributes; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (NSDictionary *) linkTextAttributes; - (void) setLinkTextAttributes: (NSDictionary *)attributeDictionary; #endif #ifdef GNUSTEP /*** Private, internal methods for (currently only) XIM support ***/ /* The implementations for these are empty in NSTextView. Backends can override these in a category. */ -(void) _updateInputMethodState; -(void) _updateInputMethodWithInsertionPoint: (NSPoint)insertionPoint; #endif @end /* These methods are implemented in NSTextView_actions.m. See the comment in that file for details on the split and which methods are for user/programmatic changes of the text. */ @interface NSTextView (UserActions) -(void) alignJustified: (id)sender; /* mosx */ -(void) turnOffKerning: (id)sender; -(void) tightenKerning: (id)sender; -(void) loosenKerning: (id)sender; -(void) useStandardKerning: (id)sender; -(void) turnOffLigatures: (id)sender; -(void) useStandardLigatures: (id)sender; -(void) useAllLigatures: (id)sender; -(void) raiseBaseline: (id)sender; -(void) lowerBaseline: (id)sender; -(void) toggleTraditionalCharacterShape: (id)sender; /* mosx */ -(void) transpose: (id)sender; /* not OPENSTEP */ -(void) toggleContinuousSpellChecking: (id)sender; /* mosx */ #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (void) outline: (id)sender; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (void) setBaseWritingDirection: (NSWritingDirection)direction range: (NSRange)range; - (void) toggleBaseWritingDirection: (id)sender; #endif @end @interface NSTextView (leftovers) /*** Fine display control ***/ /* Like -setNeedsDisplayInRect: (NSView), bit if flag is YES, won't do any layout. This means that it will only display the glyphs in rect that have already been laid out. */ -(void) setNeedsDisplayInRect: (NSRect)rect avoidAdditionalLayout: (BOOL)flag; -(BOOL) shouldDrawInsertionPoint; -(void) drawInsertionPointInRect: (NSRect)rect color: (NSColor *)color turnedOn: (BOOL)flag; /*** Pasteboard management ***/ -(NSString *) preferredPasteboardTypeFromArray: (NSArray *)availableTypes restrictedToTypesFromArray: (NSArray *)allowedTypes; /* mosx */ -(BOOL) readSelectionFromPasteboard: (NSPasteboard *)pboard; /* mosx */ -(BOOL) readSelectionFromPasteboard: (NSPasteboard *)pboard type: (NSString *)type; /* mosx */ -(NSArray *) readablePasteboardTypes; /* mosx */ -(NSArray *) writablePasteboardTypes; /* mosx */ -(BOOL) writeSelectionToPasteboard: (NSPasteboard *)pboard type: (NSString *)type; /* mosx */ -(BOOL) writeSelectionToPasteboard: (NSPasteboard *)pboard types: (NSArray *)types; /* mosx */ /* TODO: check that this belongs under pasteboard management */ -(id) validRequestorForSendType: (NSString *)sendType returnType: (NSString *)returnType; /* mosx */ /*** Drag and drop handling ***/ -(NSImage *) dragImageForSelectionWithEvent: (NSEvent *)event origin: (NSPoint *)origin; /* mosx */ -(NSDragOperation) dragOperationForDraggingInfo: (id )dragInfo type: (NSString *)type; /* mosx */ -(BOOL) dragSelectionWithEvent: (NSEvent *)event offset: (NSSize)mouseOffset slideBack: (BOOL)slideBack; /* mosx */ -(void) cleanUpAfterDragOperation; /* mosx */ /*** Selected range ***/ -(NSRange) selectionRangeForProposedRange: (NSRange)proposedCharRange granularity: (NSSelectionGranularity)gr; -(void) setSelectedRange: (NSRange)charRange; -(void) setSelectedRange: (NSRange)charRange affinity: (NSSelectionAffinity)affinity stillSelecting: (BOOL)stillSelectingFlag; /* Called by drawing routines to determine where to draw insertion point */ -(NSSelectionAffinity) selectionAffinity; -(NSSelectionGranularity) selectionGranularity; -(void) setSelectionGranularity: (NSSelectionGranularity)granularity; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (NSArray *) selectedRanges; - (void) setSelectedRanges: (NSArray *)ranges; - (void) setSelectedRanges: (NSArray *)ranges affinity: (NSSelectionAffinity)affinity stillSelecting: (BOOL)flag; #endif -(void) updateInsertionPointStateAndRestartTimer: (BOOL)restartFlag; /*** Spell checking ***/ -(NSInteger) spellCheckerDocumentTag; /*** Smart copy/paste/delete support ***/ - (NSRange) smartDeleteRangeForProposedRange: (NSRange)proposedCharRange; - (void) smartInsertForString: (NSString *)aString replacingRange: (NSRange)charRange beforeString: (NSString **)beforeString afterString: (NSString **)afterString; - (NSString *) smartInsertAfterStringForString: (NSString *)aString replacingRange: (NSRange)charRange; - (NSString *) smartInsertBeforeStringForString: (NSString *)aString replacingRange: (NSRange)charRange; #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (void) toggleSmartInsertDelete: (id)sender; #endif /** TODO: categorize */ -(NSDictionary *) typingAttributes; -(void) setTypingAttributes: (NSDictionary *)attrs; - (void) clickedOnLink: (id)link atIndex: (NSUInteger)charIndex; -(void) updateRuler; -(void) updateFontPanel; -(NSArray *) acceptableDragTypes; -(void) updateDragTypeRegistration; - (void) startSpeaking:(id) sender; - (void) stopSpeaking:(id) sender; #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) - (BOOL) acceptsGlyphInfo; - (void) setAcceptsGlyphInfo: (BOOL)flag; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (BOOL) allowsDocumentBackgroundColorChange; - (void) setAllowsDocumentBackgroundColorChange: (BOOL)flag; - (void) changeDocumentBackgroundColor: (id)sender; - (void) drawViewBackgroundInRect: (NSRect)rect; - (void) changeAttributes: (id)sender; - (void) complete: (id)sender; - (NSArray *) completionsForPartialWordRange: (NSRange)range indexOfSelectedItem: (NSInteger *)index; - (void) insertCompletion: (NSString *)word forPartialWordRange: (NSRange)range movement: (NSInteger)movement isFinal: (BOOL)flag; - (void) performFindPanelAction: (id)sender; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (void) breakUndoCoalescing; - (void) orderFrontLinkPanel: (id)sender; - (void) orderFrontListPanel: (id)sender; - (void) orderFrontTablePanel: (id)sender; #endif @end @interface NSTextView (GSTextViewSync) /* * This queries the NSLayoutManager to see if it is using multiple * text views, and saves this information in a flag, and caches the * first text view object. The NSLayoutManager needs to call this * method to update this information. */ -(void) _updateMultipleTextViews; /* For internal use. */ -(void) _syncTextViewsByCalling: (SEL)action withFlag: (BOOL)flag; -(void) _recacheDelegateResponses; /* NSLayoutManager will send this message to a text view when layout information for that text view has been invalidated. */ -(void) _layoutManagerDidInvalidateLayout; @end /* Note that all delegation messages come from the first text view of a layout manager. */ #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) @protocol NSTextViewDelegate #ifdef __OBJC2__ @optional #else @end @interface NSObject (NSTextViewDelegate) #endif -(void) textView: (NSTextView *)textView clickedOnCell: (id )cell inRect: (NSRect)cellFrame; -(void) textView: (NSTextView *)textView clickedOnCell: (id )cell inRect: (NSRect)cellFrame atIndex: (NSUInteger)charIndex; -(BOOL) textView: (NSTextView *)textView clickedOnLink: (id)link; -(BOOL) textView: (NSTextView *)textView clickedOnLink: (id)link atIndex: (NSUInteger)charIndex; -(void) textView: (NSTextView *)textView doubleClickedOnCell: (id )cell inRect: (NSRect)cellFrame; -(void) textView: (NSTextView *)textView doubleClickedOnCell: (id )cell inRect: (NSRect)cellFrame atIndex: (NSUInteger)charIndex; -(void) textView: (NSTextView *)view draggedCell: (id )cell inRect: (NSRect)rect event:(NSEvent *)event; -(void) textView: (NSTextView *)view draggedCell: (id )cell inRect: (NSRect)rect event: (NSEvent *)event atIndex: (NSUInteger)charIndex; -(NSRange) textView: (NSTextView *)textView willChangeSelectionFromCharacterRange: (NSRange)oldSelectedCharRange toCharacterRange: (NSRange)newSelectedCharRange; -(void) textViewDidChangeSelection: (NSNotification *)notification; /* If characters are changing, replacementString is what will replace the affectedCharRange. If attributes only are changing, replacementString will be nil. */ -(BOOL) textView: (NSTextView *)textView shouldChangeTextInRange: (NSRange)affectedCharRange replacementString: (NSString *)replacementString; -(BOOL) textView: (NSTextView *)textView doCommandBySelector: (SEL)commandSelector; -(NSUndoManager *) undoManagerForTextView: (NSTextView *)view; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (NSArray *) textView: (NSTextView *)textView completions: (NSArray *)words forPartialWordRange: (NSRange)range indexOfSelectedItem: (NSInteger *)index; - (NSString *) textView: (NSTextView *)textView willDisplayToolTip: (NSString *)tooltip forCharacterAtIndex: (NSUInteger)index; - (void) textViewDidChangeTypingAttributes: (NSNotification *)notification; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (BOOL) textView: (NSTextView *)textView shouldChangeTextInRanges: (NSArray *)ranges replacementStrings: (NSArray *)strings; - (NSRange) textView: (NSTextView *)textView willChangeSelectionFromCharacterRanges: (NSArray *)oldSelectedCharRanges toCharacterRanges: (NSArray *)newSelectedCharRanges; - (BOOL) textView: (NSTextView *)textView shouldChangeTypingAttributes: (NSDictionary *)oldAttribs toAttributes: (NSDictionary *)newAttribs; #endif @end #endif // GS_API_MACOSX /* NSOldNotifyingTextView -> the old view, NSNewNotifyingTextView -> the new view. The text view delegate is not automatically registered to receive this notification because the text machinery will automatically switch over the delegate to observe the new first text view as the first text view changes. */ APPKIT_EXPORT NSString *NSTextViewWillChangeNotifyingTextViewNotification; APPKIT_EXPORT NSString *NSTextViewDidChangeSelectionNotification; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) APPKIT_EXPORT NSString *NSTextViewDidChangeTypingAttributesNotification; #endif APPKIT_EXPORT NSString *NSOldSelectedCharacterRange; #endif /* _GNUstep_H_NSTextView */ gnustep-gui-0.24.0/Headers/AppKit/NSImageRep.h0000664000076500007650000001152512104255431020611 0ustar brains99brains99/* NSImageRep.h Abstract representation of an image. Copyright (C) 1996 Free Software Foundation, Inc. Written by: Adam Fedor Date: Feb 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSImageRep #define _GNUstep_H_NSImageRep #import #import #import #import #import @class NSString; @class NSArray; @class NSData; @class NSPasteboard; enum { NSImageRepMatchesDevice }; @interface NSImageRep : NSObject { // Attributes NSString* _colorSpace; NSSize _size; BOOL _hasAlpha; BOOL _isOpaque; NSInteger _bitsPerSample; NSInteger _pixelsWide; NSInteger _pixelsHigh; } // // Creating an NSImageRep // /** Returns a NSImageRep with the contents of filename. */ + (id)imageRepWithContentsOfFile:(NSString *)filename; /** Returns an array of newly allocated NSImageRep objects with the * contents of filename. */ + (NSArray *)imageRepsWithContentsOfFile:(NSString *)filename; + (id)imageRepWithPasteboard:(NSPasteboard *)pasteboard; + (NSArray *)imageRepsWithPasteboard:(NSPasteboard *)pasteboard; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) + (id)imageRepWithContentsOfURL:(NSURL *)anURL; + (NSArray *)imageRepsWithContentsOfURL:(NSURL *)anURL; #endif // // Checking Data Types // /** Returns NO. It is the subclass' responsibility to implement this method. *

See Also:

* * [NSBitmapImageRep+canInitWithData:] * */ + (BOOL)canInitWithData:(NSData *)data; + (BOOL)canInitWithPasteboard:(NSPasteboard *)pasteboard; /** Returns array produced by calling -imageUnfilteredFileTypes. */ + (NSArray *)imageFileTypes; + (NSArray *)imagePasteboardTypes; /** Returns nil. It is the subclass' responsibility to implement this method. *

See Also:

* * [NSBitmapImageRep+imageUnfilteredFileTypes] * */ + (NSArray *)imageUnfilteredFileTypes; + (NSArray *)imageUnfilteredPasteboardTypes; // // Setting the Size of the Image // /** Sets the size of the image to aSize. */ - (void)setSize:(NSSize)aSize; /** Returns the size of the image. */ - (NSSize)size; // // Specifying Information about the Representation // /** Returns the bits per sample of the receiver. *

See Also:

* * -setBitsPerSample: * */ - (NSInteger)bitsPerSample; - (NSString *)colorSpaceName; - (BOOL)hasAlpha; - (BOOL)isOpaque; - (NSInteger)pixelsHigh; - (NSInteger)pixelsWide; - (void)setAlpha:(BOOL)flag; /** Sets the number of bits for each component of a pixel. *

See Also:

* * -bitsPerSample * */ - (void)setBitsPerSample:(NSInteger)anInt; - (void)setColorSpaceName:(NSString *)aString; - (void)setOpaque:(BOOL)flag; - (void)setPixelsHigh:(NSInteger)anInt; - (void)setPixelsWide:(NSInteger)anInt; // // Drawing the Image // /** * Primitive method which must be overridden by subclasses to * perform their drawing. They should draw inside a rectangle * with an origin at (0, 0) and a size equal to the * receiver's size, and they should entirely fill this rectangle, * overwriting the destination alpha as well. */ - (BOOL)draw; - (BOOL)drawAtPoint:(NSPoint)aPoint; - (BOOL)drawInRect:(NSRect)aRect; #if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) - (BOOL) drawInRect: (NSRect)dstRect fromRect: (NSRect)srcRect operation: (NSCompositingOperation)op fraction: (CGFloat)delta respectFlipped: (BOOL)respectFlipped hints: (NSDictionary*)hints; #endif // // Managing NSImageRep Subclasses // + (Class)imageRepClassForData:(NSData *)data; + (Class)imageRepClassForFileType:(NSString *)type; + (Class)imageRepClassForPasteboardType:(NSString *)type; + (void)registerImageRepClass:(Class)imageRepClass; + (NSArray *)registeredImageRepClasses; + (void)unregisterImageRepClass:(Class)imageRepClass; @end APPKIT_EXPORT NSString *NSImageRepRegistryChangedNotification; #endif // _GNUstep_H_NSImageRep gnustep-gui-0.24.0/Headers/AppKit/NSSound.h0000664000076500007650000001514411357566652020234 0ustar brains99brains99/* NSSound.h Load, manipulate and play sounds Copyright (C) 2002, 2009 Free Software Foundation, Inc. Written by: Enrico Sersale , Stefan Bidigaray Date: Jul 2002, Jun 2009 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSSound #define _GNUstep_H_NSSound #import #import #import "GNUstepGUI/GSSoundSource.h" #import "GNUstepGUI/GSSoundSink.h" @class NSArray; @class NSData; @class NSMutableData; @class NSPasteboard; @class NSString; @class NSURL; @class NSThread; @class NSConditionLock; @class NSLock; /** Function used to retrieve all available playback devices. *

This function is the only way to retrieve possible playback * device identifiers understood by * [NSSound -setPlaybackDeviceIdentifier:].

*/ NSArray *PlaybackDeviceIdentifiers (void); @interface NSSound : NSObject { NSString *_name; NSData *_data; NSString *_playbackDeviceIdentifier; // Currently unused NSArray *_channelMapping; // Currently unused BOOL _onlyReference; id _delegate; id _source; id _sink; NSConditionLock *_readLock; NSLock * _playbackLock; BOOL _shouldStop; BOOL _shouldLoop; } // // Creating an NSSound // /** * Initalizes the receiver object with the contents of file located at path. * If byRef is set to YES only the name of the NSSound is encoded with * -encodeWithCoder:; if set to NO the data is encoded. *

See Also:

* * -initWithContentsOfURL:byReference: * -initWithData: * */ - (id)initWithContentsOfFile:(NSString *)path byReference:(BOOL)byRef; /** * Initializes the receiver object with the contents of the data located in * url. If byRef is set to YES only the name of the NSSound is encoded with * -encodeWithCoder:; if set to NO the data is encoded. *

See Also:

* * -initWithContentsOfFile:byReference: * -initWithData: * */ - (id)initWithContentsOfURL:(NSURL *)url byReference:(BOOL)byRef; /** * Initializes the receiver object with the contents of data with a * valid magic number. *

See Also:

* * -initWithContentsOfFile:byReference: * -initWithContentsOfURL:byReference: * */ - (id)initWithData:(NSData *)data; - (id)initWithPasteboard:(NSPasteboard *)pasteboard; // // Playing // /** Pauses audio playback. *

Returns NO if receiver could not be paused or is already paused, * and YES if receiver was successfully paused.

*/ - (BOOL)pause; /** Start audio playback. Playback is done asynchronously. *

Returns NO if receiver is already playing or if an error occurred, and * YES if receiver was started successfully.

*/ - (BOOL)play; /** Resume audio playback after a -pause. *

Returns NO if receiver is already playing or if an error occurred, and * YES if receiver was successfully restarted/resumed.

*/ - (BOOL)resume; /** Stop audio playback. *

Return YES if receiver was successfully stopped.

*

This method will close the playback device.

*/ - (BOOL)stop; /* Returns YES if receiver is playing and NO otherwise. */ - (BOOL)isPlaying; // // Working with pasteboards // + (BOOL)canInitWithPasteboard:(NSPasteboard *)pasteboard; + (NSArray *)soundUnfilteredPasteboardTypes; - (void)writeToPasteboard:(NSPasteboard *)pasteboard; // // Working with delegates // /** Returns the receiver's delegate */ - (id)delegate; /** Sets the receiver's delegate */ - (void)setDelegate:(id)aDelegate; // // Sound Information // + (id)soundNamed:(NSString *)name; /** Provides an array of file types that NSSound can understand. The returning * array may be directly passed to [NSOpenPanel -runModalForTypes:]. *

Built with libsndfile:

* wav, aiff, aifc, aif, au, snd, mat, mat4, mat5, paf, sf, voc, w64, * xi, caf, sd2, flac, ogg, oga *

Built without libsndfile:

* wav, aiff, aifc, aif, au, snd */ + (NSArray *)soundUnfilteredFileTypes; /** Returns the name of the receiver. Use -setName: to set the name. */ - (NSString *)name; /** Sets the receiver's name. Method -name will return aName. */ - (BOOL)setName:(NSString *)aName; #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) + (NSArray *)soundUnfilteredTypes; /** Returns the length, in seconds, of the receiver. */ - (NSTimeInterval)duration; /** Returns the volume of the receiver. * Volume will be between 0.0 and 1.0. */ - (float)volume; /** Sets the volume of the receiver. * Volume must be between 0.0 and 1.0. */ - (void)setVolume: (float)volume; /** Returns the current position of the audio playback. */ - (NSTimeInterval)currentTime; /** Sets the current time of the audio playback. */ - (void)setCurrentTime: (NSTimeInterval)currentTime; /** Returns the current loop property of the receiver. * YES indicates this NSSound will restart once it reaches the end, * otherwise NO. */ - (BOOL)loops; /** Sets the loop property of the receiver. * YES indicates this NSSound will restart once it reaches the end, * otherwise NO. */ - (void)setLoops: (BOOL)loops; - (NSString *)playbackDeviceIdentifier; - (void)setPlaybackDeviceIdentifier: (NSString *)playbackDeviceIdentifier; - (NSArray *)channelMapping; - (void)setChannelMapping: (NSArray *)channelMapping; #endif @end // // Methods Implemented by the Delegate // @interface NSObject (NSSoundDelegate) /** Method called when sound has finished playing. Currently this method * is not called. */ - (void)sound:(NSSound *)sound didFinishPlaying:(BOOL)aBool; @end @interface NSBundle (NSSoundAdditions) - (NSString *)pathForSoundResource:(NSString *)name; @end #endif // _GNUstep_H_NSSound gnustep-gui-0.24.0/Headers/AppKit/NSTokenField.h0000664000076500007650000000335611354736316021163 0ustar brains99brains99/* NSTokenField.h Token field control class for text entry Copyright (C) 2008 Free Software Foundation, Inc. Author: Gregory Casamento Date: 2008 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSTokenField #define _GNUstep_H_NSTokenField #import #import #import #import @class NSCharacterSet; @interface NSTokenField : NSTextField // Style... - (NSTokenStyle)tokenStyle; - (void)setTokenStyle:(NSTokenStyle)style; // Completion delay... + (NSTimeInterval)defaultCompletionDelay; - (NSTimeInterval)completionDelay; - (void)setCompletionDelay:(NSTimeInterval)delay; // Character set... + (NSCharacterSet *)defaultTokenizingCharacterSet; - (void)setTokenizingCharacterSet:(NSCharacterSet *)characterSet; - (NSCharacterSet *)tokenizingCharacterSet; @end; #endif // _GNUstep_H_NSTokenField gnustep-gui-0.24.0/Headers/AppKit/NSCachedImageRep.h0000664000076500007650000000357212104255431021704 0ustar brains99brains99/* NSCachedImageRep.h Cached image representation. Copyright (C) 1996 Free Software Foundation, Inc. Written by: Adam Fedor Date: Feb 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSCachedImageRep #define _GNUstep_H_NSCachedImageRep #import #import #import @class NSWindow; @interface NSCachedImageRep : NSImageRep { // Attributes NSRect _rect; NSWindow* _window; } // // Initializing an NSCachedImageRep // /** * GNUstep extension */ - (id) initWithSize: (NSSize)aSize pixelsWide: (NSInteger)pixelsWide pixelsHigh: (NSInteger)pixelsHigh depth: (NSWindowDepth)aDepth separate: (BOOL)separate alpha: (BOOL)alpha; - (id)initWithSize:(NSSize)aSize depth:(NSWindowDepth)aDepth separate:(BOOL)separate alpha:(BOOL)alpha; - (id)initWithWindow:(NSWindow *)aWindow rect:(NSRect)aRect; // // Getting the Representation // - (NSRect)rect; - (NSWindow *)window; @end #endif // _GNUstep_H_NSCachedImageRep gnustep-gui-0.24.0/Headers/AppKit/NSKeyValueBinding.h0000664000076500007650000001262312133060426022140 0ustar brains99brains99/** NSKeyValueBinding Interface declaration for key value binding Copyright (C) 2006 Free Software Foundation, Inc. Author: Fred Kiefer Date: June 2006 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSKeyValueBinding #define _GNUstep_H_NSKeyValueBinding #import #import #import #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) @class NSString; @class NSArray; @class NSDictionary; @interface NSObject (NSKeyValueBindingCreation) + (void) exposeBinding: (NSString *)key; - (NSArray *) exposedBindings; - (Class) valueClassForBinding: (NSString *)binding; - (void) bind: (NSString *)binding toObject: (id)controller withKeyPath: (NSString *)keyPath options: (NSDictionary *)options; - (void) unbind: (NSString *)binding; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (NSDictionary *) infoForBinding: (NSString *)binding; #endif @end @interface NSObject (NSPlaceholder) + (id) defaultPlaceholderForMarker: (id)marker withBinding: (NSString *)binding; + (void) setDefaultPlaceholder: (id)placeholder forMarker: (id)marker withBinding: (NSString *)binding; @end @interface NSObject (NSEditor) - (BOOL) commitEditing; - (void) discardEditing; #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (void) commitEditingWithDelegate: (id)delegate didCommitSelector: (SEL)didCommitSelector contextInfo: (void *)contextInfo; #endif @end @interface NSObject (NSEditorRegistration) - (void) objectDidBeginEditing: (id)editor; - (void) objectDidEndEditing: (id)editor; @end // Keys in options dictionary // binding values #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) // Keys in dictionary returned by infoForBinding APPKIT_EXPORT NSString *NSObservedObjectKey; APPKIT_EXPORT NSString *NSObservedKeyPathKey; APPKIT_EXPORT NSString *NSOptionsKey; // special markers APPKIT_EXPORT id NSMultipleValuesMarker; APPKIT_EXPORT id NSNoSelectionMarker; APPKIT_EXPORT id NSNotApplicableMarker; // Binding name constants APPKIT_EXPORT NSString *NSAlignmentBinding; APPKIT_EXPORT NSString *NSContentArrayBinding; APPKIT_EXPORT NSString *NSContentBinding; APPKIT_EXPORT NSString *NSContentObjectBinding; APPKIT_EXPORT NSString *NSContentValuesBinding; APPKIT_EXPORT NSString *NSEditableBinding; APPKIT_EXPORT NSString *NSEnabledBinding; APPKIT_EXPORT NSString *NSFontBinding; APPKIT_EXPORT NSString *NSFontNameBinding; APPKIT_EXPORT NSString *NSFontSizeBinding; APPKIT_EXPORT NSString *NSHiddenBinding; APPKIT_EXPORT NSString *NSSelectedIndexBinding; APPKIT_EXPORT NSString *NSSelectedObjectBinding; APPKIT_EXPORT NSString *NSSelectedTagBinding; APPKIT_EXPORT NSString *NSSelectionIndexesBinding; APPKIT_EXPORT NSString *NSTextColorBinding; APPKIT_EXPORT NSString *NSTitleBinding; APPKIT_EXPORT NSString *NSToolTipBinding; APPKIT_EXPORT NSString *NSValueBinding; //Binding options constants APPKIT_EXPORT NSString *NSAllowsEditingMultipleValuesSelectionBindingOption; APPKIT_EXPORT NSString *NSAllowsNullArgumentBindingOption; APPKIT_EXPORT NSString *NSConditionallySetsEditableBindingOption; APPKIT_EXPORT NSString *NSConditionallySetsEnabledBindingOption; APPKIT_EXPORT NSString *NSConditionallySetsHiddenBindingOption; APPKIT_EXPORT NSString *NSContinuouslyUpdatesValueBindingOption; APPKIT_EXPORT NSString *NSCreatesSortDescriptorBindingOption; APPKIT_EXPORT NSString *NSDeletesObjectsOnRemoveBindingsOption; APPKIT_EXPORT NSString *NSDisplayNameBindingOption; APPKIT_EXPORT NSString *NSDisplayPatternBindingOption; APPKIT_EXPORT NSString *NSHandlesContentAsCompoundValueBindingOption; APPKIT_EXPORT NSString *NSInsertsNullPlaceholderBindingOption; APPKIT_EXPORT NSString *NSInvokesSeparatelyWithArrayObjectsBindingOption; APPKIT_EXPORT NSString *NSMultipleValuesPlaceholderBindingOption; APPKIT_EXPORT NSString *NSNoSelectionPlaceholderBindingOption; APPKIT_EXPORT NSString *NSNotApplicablePlaceholderBindingOption; APPKIT_EXPORT NSString *NSNullPlaceholderBindingOption; APPKIT_EXPORT NSString *NSPredicateFormatBindingOption; APPKIT_EXPORT NSString *NSRaisesForNotApplicableKeysBindingOption; APPKIT_EXPORT NSString *NSSelectorNameBindingOption; APPKIT_EXPORT NSString *NSSelectsAllWhenSettingContentBindingOption; APPKIT_EXPORT NSString *NSValidatesImmediatelyBindingOption; APPKIT_EXPORT NSString *NSValueTransformerNameBindingOption; APPKIT_EXPORT NSString *NSValueTransformerBindingOption; #endif #endif // OS_API_VERSION #endif // _GNUstep_H_NSKeyValueBinding gnustep-gui-0.24.0/Headers/AppKit/NSPanel.h0000664000076500007650000001427512101306763020166 0ustar brains99brains99/* NSPanel.h Panel window class Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSPanel #define _GNUstep_H_NSPanel #import #import #if defined(__cplusplus) extern "C" { #endif @class NSString; enum { NSUtilityWindowMask = 16, NSDocModalWindowMask = 32, NSNonactivatingPanelMask = 128, NSHUDWindowMask = 8192 }; enum { NSOKButton = 1, NSCancelButton = 0 }; enum { NSAlertDefaultReturn = 1, NSAlertAlternateReturn = 0, NSAlertOtherReturn = -1, NSAlertErrorReturn = -2 }; // from MacOS X docs #define NSAlertDefault NSAlertDefaultReturn #define NSAlertAlternate NSAlertAlternateReturn #define NSAlertOther NSAlertOtherReturn #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) #define NS_ALERTDEFAULT NSAlertDefaultReturn #define NS_ALERTALTERNATE NSAlertAlternateReturn #define NS_ALERTOTHER NSAlertOtherReturn #define NS_ALERTERROR NSAlertErrorReturn #endif @interface NSPanel : NSWindow { // Think of the following as BOOL ivars #define _becomesKeyOnlyIfNeeded _f.subclass_bool_one #define _isFloatingPanel _f.subclass_bool_two #define _worksWhenModal _f.subclass_bool_three } // // Determining the Panel Behavior // - (BOOL)becomesKeyOnlyIfNeeded; - (BOOL)isFloatingPanel; - (void)setBecomesKeyOnlyIfNeeded:(BOOL)flag; - (void)setFloatingPanel:(BOOL)flag; - (void)setWorksWhenModal:(BOOL)flag; - (BOOL)worksWhenModal; @end // // Create an Attention Panel without Running It Yet // APPKIT_EXPORT id NSGetAlertPanel(NSString *title, NSString *msg, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, ...); #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) APPKIT_EXPORT id NSGetCriticalAlertPanel(NSString *title, NSString *msg, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, ...); APPKIT_EXPORT id NSGetInformationalAlertPanel(NSString *title, NSString *msg, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, ...); #endif // // Create and Run an Attention Panel // APPKIT_EXPORT NSInteger NSRunAlertPanel(NSString *title, NSString *msg, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, ...); #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) APPKIT_EXPORT NSInteger NSRunCriticalAlertPanel(NSString *title, NSString *msg, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, ...); APPKIT_EXPORT NSInteger NSRunInformationalAlertPanel(NSString *title, NSString *msg, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, ...); #endif #if OS_API_VERSION(GS_API_ONE, GS_API_ONE) APPKIT_EXPORT NSInteger NSRunLocalizedAlertPanel(NSString *table, NSString *title, NSString *msg, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, ...); #endif #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) // // New alert interface of Mac OS X // APPKIT_EXPORT void NSBeginAlertSheet(NSString *title, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, NSWindow *docWindow, id modalDelegate, SEL willEndSelector, SEL didEndSelector, void *contextInfo, NSString *msg, ...); APPKIT_EXPORT void NSBeginCriticalAlertSheet(NSString *title, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, NSWindow *docWindow, id modalDelegate, SEL willEndSelector, SEL didEndSelector, void *contextInfo, NSString *msg, ...); APPKIT_EXPORT void NSBeginInformationalAlertSheet(NSString *title, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, NSWindow *docWindow, id modalDelegate, SEL willEndSelector, SEL didEndSelector, void *contextInfo, NSString *msg, ...); APPKIT_EXPORT NSInteger GSRunExceptionPanel(NSString *title, NSException *exception, NSString *defaultButton, NSString *alternateButton, NSString *otherButton); #endif // // Release an Attention Panel // APPKIT_EXPORT void NSReleaseAlertPanel(id panel); #if defined(__cplusplus) } #endif #endif // _GNUstep_H_NSPanel gnustep-gui-0.24.0/Headers/AppKit/NSColorSpace.h0000664000076500007650000000417211352512421021151 0ustar brains99brains99/* NSColorSpace.h The color space class Copyright (C) 2007 Free Software Foundation, Inc. Author: H. Nikolaus Schaller Date: 2007 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSColorSpace #define _GNUstep_H_NSColorSpace #import #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) #import @class NSData; @class NSString; typedef enum _NSColorSpaceModel { NSUnknownColorSpaceModel = -1, NSGrayColorSpaceModel, NSRGBColorSpaceModel, NSCMYKColorSpaceModel, NSLABColorSpaceModel, NSDeviceNColorSpaceModel } NSColorSpaceModel; @interface NSColorSpace : NSObject { NSColorSpaceModel _colorSpaceModel; NSData *_iccData; void *_colorSyncProfile; } + (NSColorSpace *)deviceCMYKColorSpace; + (NSColorSpace *)deviceGrayColorSpace; + (NSColorSpace *)deviceRGBColorSpace; + (NSColorSpace *)genericCMYKColorSpace; + (NSColorSpace *)genericGrayColorSpace; + (NSColorSpace *)genericRGBColorSpace; - (NSColorSpaceModel)colorSpaceModel; - (void *)colorSyncProfile; - (NSData *)ICCProfileData; - (id)initWithColorSyncProfile:(void *)prof; - (id)initWithICCProfileData:(NSData *)iccData; - (NSString *)localizedName; - (int)numberOfColorComponents; @end #endif // MAC_OS_X_VERSION_10_4 #endif // _GNUstep_H_NSColorSpace gnustep-gui-0.24.0/Headers/AppKit/NSAnimation.h0000664000076500007650000002731512217645747021065 0ustar brains99brains99/* NSAnimation.h Created by Dr. H. Nikolaus Schaller on Sat Jan 07 2006. Copyright (c) 2007 Free Software Foundation, Inc. Author: Xavier Glattard (xgl) This file used to be part of the mySTEP Library. This file now 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSAnimation_ #define _GNUstep_H_NSAnimation_ #import #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) #import #import #import @class NSString; @class NSArray; @class NSMutableArray; @class NSNumber; @class NSRecursiveLock; /** These constants describe the curve of an animation, that is, the relative speed of an animation from start to finish. */ enum _NSAnimationCurve { NSAnimationEaseInOut = 0, // default NSAnimationEaseIn, NSAnimationEaseOut, NSAnimationLinear, NSAnimationSpeedInOut // GNUstep only }; typedef NSUInteger NSAnimationCurve; /** These constants indicate the blocking mode of an NSAnimation object when it is running. */ enum _NSAnimationBlockingMode { NSAnimationBlocking, NSAnimationNonblocking, NSAnimationNonblockingThreaded }; typedef NSUInteger NSAnimationBlockingMode; typedef float NSAnimationProgress; // Bezier curve parameters typedef struct __GSBezierDesc { float p[4]; // control points BOOL areCoefficientsComputed; float a[4]; // coefficients } _GSBezierDesc; // Rational Bezier curve parameters typedef struct __GSRationalBezierDesc { float w[4]; // weights float p[4]; // control points BOOL areBezierDescComputed; _GSBezierDesc n; // numerator _GSBezierDesc d; // denumerator } _GSRationalBezierDesc; // Animation curve parameters typedef struct __NSAnimationCurveDesc { float s,e; // start & end values float sg,eg; // start & end gradients _GSRationalBezierDesc rb; BOOL isRBezierComputed; } _NSAnimationCurveDesc; /** Posted when the current progress of a running animation reaches one of its progress marks. */ APPKIT_EXPORT NSString *NSAnimationProgressMarkNotification; /** Key used in the [NSNotification-userInfo] disctionary to access the current progress mark. */ APPKIT_EXPORT NSString *NSAnimationProgressMark; APPKIT_EXPORT NSString *NSAnimationTriggerOrderIn; APPKIT_EXPORT NSString *NSAnimationTriggerOrderOut; /** * Objects of the NSAnimation class manage the timing and progress of * animations in the user interface. The class also lets you link together * multiple animations so that when one animation ends another one starts. * It does not provide any drawing support for animation and does not directly * deal with views, targets, or actions. */ @interface NSAnimation : NSObject < NSCopying, NSCoding, GSAnimation > { // FIXME ... all these ivars should be hidden inside a pointer to an // FIXME ... opaque data structure, so that layout etc can be changed // FIXME ... without breaking binary compatibility. NSTimeInterval _duration; // Duration of the animation float _frameRate; // Wanted frame rate NSAnimationCurve _curve; // Id of progres->value function _NSAnimationCurveDesc _curveDesc; // The curve as a rat. Bezier NSAnimationProgress _curveProgressShift;// Shift used for switching // from a curve to an other NSAnimationProgress _currentProgress; // Progress of the animation /* GSIArray */ void *_progressMarks; // Array unsigned int _nextMark; // The next mark to be reached // = count if no next mark __strong NSNumber **_cachedProgressMarkNumbers; // Cached values used by unsigned _cachedProgressMarkNumberCount;// [-progressMarks] BOOL _isCachedProgressMarkNumbersValid; NSAnimation *_startAnimation, *_stopAnimation; // Animations used as NSAnimationProgress _startMark, _stopMark; // trigger, and marks NSAnimationBlockingMode _blockingMode; // Blocking mode GSAnimator *_animator; // The animator BOOL _isANewAnimatorNeeded; // Some parameters have changed... id _delegate; // The delegate, and the cached delegation methods... void (*_delegate_animationDidReachProgressMark)(id,SEL,NSAnimation*,NSAnimationProgress); float (*_delegate_animationValueForProgress )(id,SEL,NSAnimation*,NSAnimationProgress); void (*_delegate_animationDidEnd )(id,SEL,NSAnimation*); void (*_delegate_animationDidStop )(id,SEL,NSAnimation*); BOOL (*_delegate_animationShouldStart )(id,SEL,NSAnimation*); id _currentDelegate; // The delegate when the animation is running BOOL _isThreaded; NSRecursiveLock *_isAnimatingLock; } /** Adds the progress mark to the receiver. */ - (void) addProgressMark: (NSAnimationProgress)progress; /** Returns the blocking mode the receiver is next scheduled to run under. */ - (NSAnimationBlockingMode) animationBlockingMode; /** Returns the animation curve the receiver is running under. */ - (NSAnimationCurve) animationCurve; /** Clears linkage to another animation that causes the receiver to start. */ - (void) clearStartAnimation; /** Clears linkage to another animation that causes the receiver to stop. */ - (void) clearStopAnimation; /** Returns the current progress of the receiver. */ - (NSAnimationProgress) currentProgress; /** Returns the current value of the effect based on the current progress. */ - (float) currentValue; /** Returns the delegate of the receiver. */ - (id) delegate; /** Returns the duration of the animation, in seconds. */ - (NSTimeInterval) duration; /** Returns the frame rate of the animation. */ - (float) frameRate; /** Returns an NSAnimation object initialized with the specified duration and animation-curve values. */ - (id) initWithDuration: (NSTimeInterval)duration animationCurve: (NSAnimationCurve)curve; /** Returns a Boolean value that indicates whether the receiver is currently animating. */ - (BOOL) isAnimating; /** Returns the receiver's progress marks. */ - (NSArray*) progressMarks; /** Removes a progress mark from the receiver. A value that does not correspond to a progress mark is ignored.*/ - (void) removeProgressMark: (NSAnimationProgress)progress; /** Overridden to return the run-loop modes that the receiver uses to run the animation timer in. */ - (NSArray*) runLoopModesForAnimating; /** Sets the blocking mode of the receiver. The new blocking mode takes effect the next time the receiver is started. */ - (void) setAnimationBlockingMode: (NSAnimationBlockingMode)mode; /** Sets the receiver's animation curve. The new value affects the animation already in progress : the actual curve smoothly changes from the old curve to the new one. */ - (void) setAnimationCurve: (NSAnimationCurve)curve; /** Sets the current progress of the receiver. In the case of a forward jump the marks between the previous progress value and the new (excluded) progress value are ignored. In the case of a backward jump (rewind) the marks will be reached again. */ - (void) setCurrentProgress: (NSAnimationProgress)progress; /** Sets the delegate of the receiver. The new delegate takes effect the next time the receiver is started. */ - (void) setDelegate: (id)delegate; /** Sets the duration of the animation to a specified number of seconds. If the duration is changed while the animation is running the speed of the animation is not changed but the current progress value is (see [-setCurrentprogress]). The new value takes effect at the next frame. */ - (void) setDuration: (NSTimeInterval)duration; /** Sets the frame rate of the receiver. The new frame rate takes effect at the next frame. */ - (void) setFrameRate: (float)fps; /** Sets the receiver's progress marks to the values specified in the passed-in array. The new marks are t*/ - (void) setProgressMarks: (NSArray*)progress; /** Starts the animation represented by the receiver. If the animation is already running the method has no effect.*/ - (void) startAnimation; /** Starts running the animation represented by the receiver when another animation reaches a specific progress mark. */ - (void) startWhenAnimation: (NSAnimation*)animation reachesProgress: (NSAnimationProgress)start; /** Stops the animation represented by the receiver. If the animation is not running the method has no effect.*/ - (void) stopAnimation; /** Stops running the animation represented by the receiver when another animation reaches a specific progress mark. */ - (void) stopWhenAnimation: (NSAnimation*)animation reachesProgress: (NSAnimationProgress)stop; @end @interface NSAnimation (GNUstep) /** Returns the current value of the frame counter */ - (unsigned int) frameCount; /** Resets all stats */ - (void) resetCounters; /** Returns the current the actual (mesured) frame rate value */ - (float) actualFrameRate; @end @protocol NSAnimationDelegate #ifdef __OBJC2__ @optional #else @end @interface NSObject (NSAnimation) #endif /** NSAnimation delegate method. * Sent to the delegate when an animation reaches a specific progress mark. */ - (void) animation: (NSAnimation*)animation didReachProgressMark: (NSAnimationProgress)progress; /** NSAnimation delegate method. * Requests a custom curve value for the current progress value. */ - (float) animation: (NSAnimation*)animation valueForProgress: (NSAnimationProgress)progress; /** NSAnimation delegate method. * Sent to the delegate when the specified animation completes its run. */ - (void) animationDidEnd: (NSAnimation*)animation; /** NSAnimation delegate method. * Sent to the delegate when the specified animation is stopped before it completes its run. */ - (void) animationDidStop: (NSAnimation*)animation; /** NSAnimation delegate method. * Sent to the delegate just after an animation is started. */ - (BOOL) animationShouldStart: (NSAnimation*)animation; @end APPKIT_EXPORT NSString *NSViewAnimationTargetKey; APPKIT_EXPORT NSString *NSViewAnimationStartFrameKey; APPKIT_EXPORT NSString *NSViewAnimationEndFrameKey; APPKIT_EXPORT NSString *NSViewAnimationEffectKey; APPKIT_EXPORT NSString *NSViewAnimationFadeInEffect; APPKIT_EXPORT NSString *NSViewAnimationFadeOutEffect; /** * The NSViewAnimation class, a public subclass of NSAnimation, * offers a convenient way to animate multiple views and windows. * The animation effects you can achieve are limited to changes in * frame location and size, and to fade-in and fade-out effects. */ @interface NSViewAnimation : NSAnimation { NSArray *_viewAnimations; NSMutableArray *_viewAnimationDesc; } /** Returns an NSViewAnimation object initialized with the supplied information. */ - (id) initWithViewAnimations: (NSArray*)animations; /** Sets the dictionaries defining the objects to animate. */ - (void) setViewAnimations: (NSArray*)animations; /** Returns the array of dictionaries defining the objects to animate. */ - (NSArray*) viewAnimations; @end #endif /* OS_API_VERSION */ #endif /* _GNUstep_H_NSAnimation_ */ gnustep-gui-0.24.0/Headers/AppKit/NSPrintPanel.h0000664000076500007650000001215211600462053021171 0ustar brains99brains99/* NSPrintPanel.h Standard panel to query users for info on a print job Copyright (C) 1996,2004 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Modified for Printing Backend Support Author: Chad Hardin Date: June 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSPrintPanel #define _GNUstep_H_NSPrintPanel #import @class NSArray; @class NSMutableArray; @class NSSet; @class NSString; @class NSView; @class NSViewController; @class NSPrintInfo; enum { NSPPSaveButton = 3, NSPPPreviewButton = 4, NSFaxButton = 5, NSPPTitleField = 20, NSPPImageButton = 21, NSPPNameTitle = 22, NSPPNameField = 23, NSPPNoteTitle = 24, NSPPNoteField = 25, NSPPStatusTitle = 26, NSPPStatusField = 27, NSPPCopiesField = 28, NSPPPageChoiceMatrix = 29, NSPPPageRangeFrom = 30, NSPPPageRangeTo = 31, NSPPScaleField = 32, NSPPOptionsButton = 33, NSPPPaperFeedButton = 34, NSPPLayoutButton = 35, //The following are not actually in the OpenStep spec. //However, It is prudent to keep them here, I am just //making you aware of this fact. NSPPResolutionButton = 36, NSPPOptionOKButton = 40 }; #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) @protocol NSPrintPanelAccessorizing - (NSSet *) keyPathsForValuesAffectingPreview; - (NSArray *) localizedSummaryItems; @end enum { NSPrintPanelShowsCopies = 0x01, NSPrintPanelShowsPageRange = 0x02, NSPrintPanelShowsPaperSize = 0x04, NSPrintPanelShowsOrientation = 0x08, NSPrintPanelShowsScaling = 0x10, NSPrintPanelShowsPageSetupAccessory = 0x100, NSPrintPanelShowsPreview = 0x20000 }; typedef NSInteger NSPrintPanelOptions; APPKIT_EXPORT NSString *NSPrintPanelAccessorySummaryItemNameKey; APPKIT_EXPORT NSString *NSPrintPanelAccessorySummaryItemDescriptionKey; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) APPKIT_EXPORT NSString *NSPrintPhotoJobStyleHint; #endif @interface NSPrintPanel : NSPanel { id _panel; id _optionPanel; NSView *_accessoryView; NSString *_savePath; NSPrintInfo *_printInfo; NSMutableArray *_accessoryControllers; NSString *_jobStyleHint; NSString *_helpAnchor; NSPrintPanelOptions _options; int _picked; NSRange _pages; //this may also be removed } // // Creating an NSPrintPanel // + (NSPrintPanel *)printPanel; // // Customizing the Panel // #if OS_API_VERSION(GS_API_NONE, MAC_OS_X_VERSION_10_5) - (void)setAccessoryView:(NSView *)aView; - (NSView *)accessoryView; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (NSArray *) accessoryControllers; - (void) addAccessoryController: (NSViewController < NSPrintPanelAccessorizing >*)accessoryController; - (void) removeAccessoryController: (NSViewController < NSPrintPanelAccessorizing >*)accessoryController; - (NSString *) defaultButtonTitle; - (void) setDefaultButtonTitle: (NSString *)defaultButtonTitle; - (NSPrintPanelOptions) options; - (void) setOptions: (NSPrintPanelOptions)options; - (NSString *) helpAnchor; - (void) setHelpAnchor: (NSString *)helpAnchor; - (NSPrintInfo *) printInfo; - (NSInteger) runModalWithPrintInfo: (NSPrintInfo *)printInfo; #endif // // Running the Panel // - (NSInteger) runModal; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void) beginSheetWithPrintInfo: (NSPrintInfo *)printInfo modalForWindow: (NSWindow *)docWindow delegate: (id)delegate didEndSelector: (SEL)didEndSelector contextInfo: (void *)contextInfo; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) - (NSString *) jobStyleHint; - (void) setJobStyleHint: (NSString *)hint; #endif #if OS_API_VERSION(GS_API_NONE, MAC_OS_X_VERSION_10_5) // // Updating the Panel's Display // - (void)pickedButton:(id)sender; - (void)pickedAllPages:(id)sender; - (void)pickedLayoutList:(id)sender; // // Communicating with the NSPrintInfo Object // - (void)updateFromPrintInfo; - (void)finalWritePrintInfo; #endif @end // // Methods used by printing backend bundles that subclass NSPrintPanel // @interface NSPrintPanel (Private) /* Private method used by NSPrintOperation */ - (void) _setStatusStringValue: (NSString *)string; /*Private method for saving a print job as a file*/ - (BOOL) _getSavePath; @end #endif // _GNUstep_H_NSPrintPanel gnustep-gui-0.24.0/Headers/AppKit/NSMenuItem.h0000664000076500007650000002027512107547001020645 0ustar brains99brains99/* NSMenuItem.h The menu cell protocol and the GNUstep menu cell class. Copyright (C) 1996 Free Software Foundation, Inc. Author: David Lazaro Saz Date: Sep 1999 Author: Ovidiu Predescu Date: May 1997 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSMenuItem #define _GNUstep_H_NSMenuItem #import #import #import @class NSAttributedString; @class NSString; @class NSMenu; @class NSImage; /** * Specifies the methods that an object must implement if it is to be * placed in a menu as a menu item. The [NSMenuItem] class provides * a reference implementation suitable for most uses. */ @protocol NSMenuItem /**

Returns a seperator. This is just a blank menu item which serves to divide the menu into seperate parts.

*/ + (id) separatorItem; /**

Sets a flag that, when set to YES, objects of this class will use user defined key equivalents.

*/ + (void) setUsesUserKeyEquivalents: (BOOL)flag; /**

Returns a flag which indicates if the receiver will use user defined key equivalents.

*/ + (BOOL) usesUserKeyEquivalents; /**

Returns the action of the receiver.

*/ - (SEL) action; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) /**

Returns the menu item's title as an attributed string.

*/ - (NSAttributedString *)attributedTitle; #endif /**

Returns a boolean indicating if the receiver has a sub menu.

*/ - (BOOL) hasSubmenu; /**

Returns the image to be displayed in the receiver.

*/ - (NSImage*) image; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) /**

Returns the indentation level, a number between 0 and 15.

*/ - (NSInteger)indentationLevel; #endif /**

Initializes the receiver with aString as the title. The method called with the menu is selected is represented by aSelector. The key equivalent which can be used to invoke this menu item is represented by charCode.

*/ - (id) initWithTitle: (NSString*)aString action: (SEL)aSelector keyEquivalent: (NSString*)charCode; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (BOOL)isAlternate; #endif /**

Returns YES if the receiver is enabled.

*/ - (BOOL) isEnabled; /**

Returns a boolean indicating if the receiver is a separator.

*/ - (BOOL) isSeparatorItem; /**

Returns the key equivalent of the receiver.

*/ - (NSString*) keyEquivalent; /**

Returns the key equivalent mask.

*/ - (NSUInteger) keyEquivalentModifierMask; /**

Returns the menu to which this menu item is connected.

*/ - (NSMenu*) menu; /**

Returns the image to be displayed when the receiver is in the "Mixed" state.

*/ - (NSImage*) mixedStateImage; - (NSString*) mnemonic; - (NSUInteger) mnemonicLocation; /**

Returns the image to be displayed when the receiver is in the "Off" state.

*/ - (NSImage*) offStateImage; /**

Returns the image to be displayed when the receiver is in the "On" state.

*/ - (NSImage*) onStateImage; /**

Returns the object represented by the reciever.

*/ - (id) representedObject; /**

Sets the action as aSelector on the receiver.

*/ - (void) setAction: (SEL)aSelector; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (void) setAlternate: (BOOL)isAlternate; -(void) setAttributedTitle: (NSAttributedString *)title; #endif /**

Set the receiver to be enabled.

*/ - (void) setEnabled: (BOOL)flag; /**

Sets the image to be displayed in the receiver.

*/ - (void) setImage: (NSImage*)menuImage; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (void)setIndentationLevel: (NSInteger)level; #endif /**

Sets the key equivalent of the receiver.

*/ - (void) setKeyEquivalent: (NSString*)aKeyEquivalent; /**

Sets the modfier for the key equivalent. These masks indicate if the key equivalent requires ALT, Control or other key modifiers.

*/ - (void) setKeyEquivalentModifierMask: (NSUInteger)mask; /**

Sets the menu which this item belongs to. This method does not retain the object represented by menu.

*/ - (void) setMenu: (NSMenu*)menu; /**

Sets the image to be displayed when the receiver is in the "Mixed" state.

*/ - (void) setMixedStateImage: (NSImage*)image; - (void) setMnemonicLocation: (NSUInteger) location; /**

Sets the image to be displayed when the receiver is in the "Off" state.

*/ - (void) setOffStateImage: (NSImage*)image; /**

Sets the image to be displayed when the receiver is in the "On" state.

*/ - (void) setOnStateImage: (NSImage*)image; /**

Sets the object represented by the reciever to anObject.

*/ - (void) setRepresentedObject: (id)anObject; /**

Sets the state of the the receiver.

*/ - (void) setState: (NSInteger)state; /**

Sets the submenu of the receiver. This method does retain the submenu object.

*/ - (void) setSubmenu: (NSMenu*)submenu; /**

Sets the tag of the reciever as anInt.

*/ - (void) setTag: (NSInteger)anInt; /**

Sets the target as anObject on the receiver.

*/ - (void) setTarget: (id)anObject; /**

Sets the title of the menu, represented by aString.

*/ - (void) setTitle: (NSString*)aString; - (void) setTitleWithMnemonic: (NSString*)stringWithAmpersand; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (void) setToolTip: (NSString *)toolTip; #endif /**

Returns the state of the receiver.

*/ - (NSInteger) state; /**

Returns the attached submenu.

*/ - (NSMenu*) submenu; /**

Returns the tag of the receiver.

*/ - (NSInteger) tag; /**

Returns the target of the receiver.

*/ - (id) target; /**

Returns the menu's title.

*/ - (NSString*) title; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (NSString *) toolTip; #endif /**

Returns the user defined key equivalent modifier.

*/ - (NSUInteger) userKeyEquivalentModifierMask; /**

Returns the key equivalent defined by the users defaults.

*/ - (NSString*) userKeyEquivalent; @end @interface NSMenuItem : NSObject { NSMenu *_menu; NSString *_title; NSString *_keyEquivalent; NSUInteger _keyEquivalentModifierMask; NSUInteger _mnemonicLocation; NSInteger _state; NSImage *_image; NSImage *_onStateImage; NSImage *_offStateImage; NSImage *_mixedStateImage; id _target; SEL _action; NSInteger _tag; id _representedObject; NSMenu *_submenu; BOOL _enabled; BOOL _changesState; BOOL _isAlternate; char _indentation; // 0..15 NSString *_toolTip; } @end #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) @interface NSMenuItem (GNUstepExtra) - (void) setChangesState: (BOOL)flag; - (BOOL) changesState; @end #endif #endif // _GNUstep_H_NSMenuItem gnustep-gui-0.24.0/Headers/AppKit/NSSpeechSynthesizer.h0000664000076500007650000001215211354602172022600 0ustar brains99brains99/** NSSpeechSynthesizer abstract base class for speech synthesis Copyright (C) 2009 Free Software Foundation, Inc. Author: Gregory Casamento Date: Mar 2009 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSSpeechSynthesizer #define _GNUstep_H_NSSpeechSynthesizer #import // NSSpeechBoundary enumerated type... typedef enum { NSSpeechImmediateBoundary = 0, NSSpeechWordBoundary, NSSpeechSentenceBoundary } NSSpeechBoundary; // forward declarations... @class NSString, NSMutableDictionary, NSMutableArray, NSError; // Keys for properties... extern NSString *NSVoiceIdentifier; extern NSString *NSVoiceName; extern NSString *NSVoiceAge; extern NSString *NSVoiceGender; extern NSString *NSVoiceDemoText; extern NSString *NSVoiceLanguage; extern NSString *NSVoiceLocaleIdentifier; extern NSString *NSVoiceSupportedCharacters; extern NSString *NSVoiceIndividuallySpokenCharacters; // Values for gender extern NSString *NSVoiceGenderNeuter; extern NSString *NSVoiceGenderMale; extern NSString *NSVoiceGenderFemale; // values for speech mode extern NSString *NSSpeechModeText; extern NSString *NSSpeechModePhoneme; extern NSString *NSSpeechModeNormal; extern NSString *NSSpeechModeLiteral; // values for speech status... extern NSString *NSSpeechStatusOutputBusy; extern NSString *NSSpeechStatusOutputPaused; extern NSString *NSSpeechStatusNumberOfCharactersLeft; extern NSString *NSSpeechStatusPhonemeCode; // values for error extern NSString *NSSpeechErrorCount; extern NSString *NSSpeechErrorOldestCode; extern NSString *NSSpeechErrorOldestCharacterOffset; extern NSString *NSSpeechErrorNewestCode; extern NSString *NSSpeechErrorNewestCharacterOffset; // values for info extern NSString *NSSpeechSynthesizerInfoIdentifier; extern NSString *NSSpeechSynthesizerInfoVersion; // values for command delimiter extern NSString *NSSpeechCommandPrefix; extern NSString *NSSpeechCommandSuffix; // values for dictionaries. extern NSString *NSSpeechDictionaryLanguage; extern NSString *NSSpeechDictionaryModificationDate; extern NSString *NSSpeechDictionaryPronunciations; extern NSString *NSSpeechDictionaryAbreviations; extern NSString *NSSpeechDictionaryEntrySpelling; extern NSString *NSSpeechDictionaryEntryPhonemes; // class declaration... @interface NSSpeechSynthesizer : NSObject // init... - (id) initWithVoice: (NSString *)voice; // configuring speech synthesis - (BOOL) usesFeebackWindow; - (void) setUsesFeebackWindow: (BOOL)flag; - (NSString *) voice; - (void) setVoice: (NSString *)voice; - (float) rate; - (void) setRate: (float)rate; - (float) volume; - (void) setVolume: (float)volume; - (void) addSpeechDictionary: (NSDictionary *)speechDictionary; - (id) objectForProperty: (NSString *)property error: (NSError **)error; - (id) setObject: (id) object forProperty: (NSString *)property error: (NSError **)error; - (id) delegate; - (void) setDelegate: (id)delegate; // Getting information... + (NSArray *) availableVoices; + (NSDictionary *) attributesForVoice: (NSString *)voice; + (NSString *) defaultVoice; // Getting state... + (BOOL) isAnyApplicationSpeaking; // Synthesizing.. - (BOOL) isSpeaking; - (BOOL) startSpeakingString: (NSString *)text; - (BOOL) startSpeakingString: (NSString *)text toURL: (NSURL *)url; - (void) stopSpeaking; - (void) stopSpeakingAtBoundary: (NSSpeechBoundary)boundary; - (void) pauseSpeakingAtBoundary: (NSSpeechBoundary)boundary; - (void) continueSpeaking; - (NSString *) phonemesFromText: (NSString *)text; @end // Speech synthesizer delegate informal protocol... @interface NSObject (NSSpeechSynthesizerDelegate) - (void)speechSynthesizer: (NSSpeechSynthesizer *)sender didEncounterErrorAtIndex: (NSUInteger)index ofString: (NSString *)string message: (NSString *)error; - (void)speechSynthesizer: (NSSpeechSynthesizer *)sender didEncounterSyncMessage: (NSString *)error; - (void)speechSynthesizer: (NSSpeechSynthesizer *)sender didFinishSpeaking: (BOOL)success; - (void)speechSynthesizer: (NSSpeechSynthesizer *)sender willSpeakPhoneme: (short)phoneme; - (void) speechSynthesizer: (NSSpeechSynthesizer *)sender willSpeakWord: (NSRange)range ofString: (NSString *)string; @end #endif // _GNUstep_H_NSSpeechSynthesizer gnustep-gui-0.24.0/Headers/AppKit/NSRulerView.h0000664000076500007650000001230212107776031021045 0ustar brains99brains99/* -*-objc-*- NSRulerView.h The NSRulerView class. Copyright (C) 1999-2002 Free Software Foundation, Inc. Author: Michael Hanni Date: Feb 1999 Author: Fred Kiefer Date: Sept 2001 Author: Diego Kreutz (kreutz@inf.ufsm.br) Date: January 2002 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSRulerView #define _GNUstep_H_NSRulerView #import /* Declaring classes, rather than #including the full class header, * results in much faster compilations. */ @class NSScrollView; @class NSString; @class NSArray; @class NSRulerMarker; @class NSCoder; @class NSEvent; typedef enum { NSHorizontalRuler, NSVerticalRuler } NSRulerOrientation; @class GSRulerUnit; @interface NSRulerView : NSView { GSRulerUnit *_unit; NSScrollView *_scrollView; NSView *_clientView; // Not retained NSView *_accessoryView; CGFloat _originOffset; NSMutableArray *_markers; NSRulerOrientation _orientation; CGFloat _ruleThickness; CGFloat _reservedThicknessForAccessoryView; CGFloat _reservedThicknessForMarkers; /* Cached values. It's a little expensive to calculate them and they * change only when the unit or the originOffset is changed or when * clientView changes it's size or zooming factor. This cache is * invalidated by -invalidateHashMarks method. */ BOOL _cacheIsValid; float _markDistance; float _labelDistance; int _marksToBigMark; int _marksToMidMark; int _marksToLabel; float _UNUSED; float _unitToRuler; NSString *_labelFormat; } - (id) initWithScrollView:(NSScrollView *)aScrollView orientation:(NSRulerOrientation)o; + (void) registerUnitWithName:(NSString *)uName abbreviation:(NSString *)abbreviation unitToPointsConversionFactor:(CGFloat)conversionFactor stepUpCycle:(NSArray *)stepUpCycle stepDownCycle:(NSArray *)stepDownCycle; - (void) setMeasurementUnits: (NSString *)uName; - (NSString *) measurementUnits; - (void) setClientView: (NSView *)aView; - (NSView *) clientView; - (void) setAccessoryView: (NSView *)aView; - (NSView *) accessoryView; - (void) setOriginOffset: (CGFloat)offset; - (CGFloat) originOffset; - (void) setMarkers: (NSArray *)newMarkers; - (NSArray *) markers; - (void) addMarker: (NSRulerMarker *)aMarker; - (void) removeMarker: (NSRulerMarker *)aMarker; - (BOOL) trackMarker: (NSRulerMarker *)aMarker withMouseEvent: (NSEvent *)theEvent; - (void) moveRulerlineFromLocation: (CGFloat)oldLoc toLocation: (CGFloat)newLoc; - (void) drawHashMarksAndLabelsInRect: (NSRect)aRect; - (void) drawMarkersInRect: (NSRect)aRect; - (void) invalidateHashMarks; - (void) setScrollView:(NSScrollView *) scrollView; - (NSScrollView *) scrollView; - (void) setOrientation: (NSRulerOrientation)o; - (NSRulerOrientation) orientation; - (void) setReservedThicknessForAccessoryView: (CGFloat)thickness; - (CGFloat) reservedThicknessForAccessoryView; - (void) setReservedThicknessForMarkers: (CGFloat)thickness; - (CGFloat) reservedThicknessForMarkers; - (void) setRuleThickness: (CGFloat)thickness; - (CGFloat) ruleThickness; - (CGFloat) requiredThickness; - (CGFloat) baselineLocation; - (BOOL) isFlipped; @end /* * Methods Implemented by the client view ... FIXME/TODO: we currently * do not send all these messages to the client view ... while we * should! */ @interface NSObject (NSRulerViewClientView) - (void)rulerView: (NSRulerView *)aRulerView didAddMarker: (NSRulerMarker *)aMarker; - (void)rulerView: (NSRulerView *)aRulerView didMoveMarker: (NSRulerMarker *)aMarker; - (void)rulerView: (NSRulerView *)aRulerView didRemoveMarker: (NSRulerMarker *)aMarker; - (void)rulerView: (NSRulerView *)aRulerView handleMouseDown: (NSEvent *)theEvent; - (BOOL)rulerView: (NSRulerView *)aRulerView shouldAddMarker: (NSRulerMarker *)aMarker; - (BOOL)rulerView: (NSRulerView *)aRulerView shouldMoveMarker: (NSRulerMarker *)aMarker; - (BOOL)rulerView: (NSRulerView *)aRulerView shouldRemoveMarker: (NSRulerMarker *)aMarker; - (CGFloat)rulerView: (NSRulerView *)aRulerView willAddMarker: (NSRulerMarker *)aMarker atLocation: (CGFloat)location; - (CGFloat)rulerView: (NSRulerView *)aRulerView willMoveMarker: (NSRulerMarker *)aMarker toLocation: (CGFloat)location; - (void)rulerView: (NSRulerView *)aRulerView willSetClientView: (NSView *)newClient; @end #endif /* _GNUstep_H_NSRulerView */ gnustep-gui-0.24.0/Headers/AppKit/NSControl.h0000664000076500007650000001360012102166206020533 0ustar brains99brains99/* NSControl.h The abstract control class Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSControl #define _GNUstep_H_NSControl #import // for NSWritingDirection #import #import @class NSString; @class NSNotification; @class NSFormatter; @class NSCell; @class NSFont; @class NSEvent; @class NSTextView; @interface NSControl : NSView { // Attributes NSInteger _tag; id _cell; // id so compiler wont complain too much for subclasses BOOL _ignoresMultiClick; } // // Setting the Control's Cell // + (Class)cellClass; + (void)setCellClass:(Class)factoryId; - (id)cell; - (void)setCell:(NSCell *)aCell; // // Enabling and Disabling the Control // - (BOOL)isEnabled; - (void)setEnabled:(BOOL)flag; // // Identifying the Selected Cell // - (id)selectedCell; - (NSInteger)selectedTag; // // Setting the Control's Value // - (void) setDoubleValue: (double)aDouble; - (double) doubleValue; - (void) setFloatValue: (float)aFloat; - (float) floatValue; - (void) setIntValue: (int)anInt; - (int) intValue; #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (NSInteger) integerValue; - (void) setIntegerValue: (NSInteger)anInt; - (void) takeIntegerValueFrom: (id)sender; #endif - (void) setStringValue: (NSString *)aString; - (NSString *) stringValue; - (void) setObjectValue: (id)anObject; - (id) objectValue; - (void) setNeedsDisplay; // // Interacting with Other Controls // - (void) takeDoubleValueFrom: (id)sender; - (void) takeFloatValueFrom: (id)sender; - (void) takeIntValueFrom: (id)sender; - (void) takeStringValueFrom: (id)sender; - (void) takeObjectValueFrom: (id)sender; // // Formatting Text // - (NSTextAlignment)alignment; - (NSFont *)font; - (void)setAlignment:(NSTextAlignment)mode; - (void)setFont:(NSFont *)fontObject; - (void)setFloatingPointFormat:(BOOL)autoRange left:(NSUInteger)leftDigits right:(NSUInteger)rightDigits; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void)setFormatter:(NSFormatter*)newFormatter; - (id)formatter; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (NSWritingDirection)baseWritingDirection; - (void)setBaseWritingDirection:(NSWritingDirection)direction; #endif // // Managing the Field Editor // - (BOOL)abortEditing; - (NSText *)currentEditor; - (void)validateEditing; // // Resizing the Control // - (void)calcSize; - (void)sizeToFit; // // Displaying the Control and Cell // - (void)drawCell:(NSCell *)aCell; - (void)drawCellInside:(NSCell *)aCell; - (void)selectCell:(NSCell *)aCell; - (void)updateCell:(NSCell *)aCell; - (void)updateCellInside:(NSCell *)aCell; // // Target and Action // - (SEL)action; - (BOOL)isContinuous; - (BOOL)sendAction:(SEL)theAction to:(id)theTarget; - (NSInteger)sendActionOn:(NSInteger)mask; - (void)setAction:(SEL)aSelector; - (void)setContinuous:(BOOL)flag; - (void)setTarget:(id)anObject; - (id)target; // // Attributed string handling // #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (NSAttributedString *)attributedStringValue; - (void)setAttributedStringValue:(NSAttributedString *)attribStr; #endif // // Assigning a Tag // - (void)setTag:(NSInteger)anInt; - (NSInteger)tag; // // Activation // - (void)performClick:(id)sender; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (BOOL)refusesFirstResponder; - (void)setRefusesFirstResponder:(BOOL)flag; #endif // // Tracking the Mouse // - (void)mouseDown:(NSEvent *)theEvent; - (BOOL)ignoresMultiClick; - (void)setIgnoresMultiClick:(BOOL)flag; @end APPKIT_EXPORT NSString *NSControlTextDidBeginEditingNotification; APPKIT_EXPORT NSString *NSControlTextDidEndEditingNotification; APPKIT_EXPORT NSString *NSControlTextDidChangeNotification; // // Methods Implemented by the Delegate // @protocol NSControlTextEditingDelegate #ifdef __OBJC2__ @optional #else @end @interface NSObject (NSControlTextEditingDelegate) #endif - (BOOL) control: (NSControl *)control isValidObject:(id)object; - (BOOL) control: (NSControl *)control textShouldBeginEditing: (NSText *)fieldEditor; - (BOOL) control: (NSControl *)control textShouldEndEditing: (NSText *)fieldEditor; - (BOOL) control: (NSControl *)control didFailToFormatString: (NSString *)string errorDescription: (NSString *)error; - (void) control: (NSControl *)control didFailToValidatePartialString: (NSString *)string errorDescription: (NSString *)error; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (BOOL) control: (NSControl *)control textView: (NSTextView *)textView doCommandBySelector: (SEL)command; - (NSArray *) control: (NSControl *)control textView: (NSTextView *)textView completions: (NSArray *)words forPartialWordRange: (NSRange)charRange indexOfSelectedItem: (int *)index; #endif @end @interface NSObject (NSControlDelegate) - (void) controlTextDidBeginEditing: (NSNotification *)aNotification; - (void) controlTextDidEndEditing: (NSNotification *)aNotification; - (void) controlTextDidChange: (NSNotification *)aNotification; @end #endif // _GNUstep_H_NSControl gnustep-gui-0.24.0/Headers/AppKit/NSOpenPanel.h0000664000076500007650000000641512121417516021006 0ustar brains99brains99/* NSOpenPanel.h Standard panel for opening files Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Daniel Böhringer Date: August 1998 Source by Daniel Böhringer integrated into Scott Christley's preliminary implementation by Felipe A. Rodriguez Author: Nicola Pero Date: 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSOpenPanel #define _GNUstep_H_NSOpenPanel #import #import @class NSString; @class NSArray; @interface NSOpenPanel : NSSavePanel { BOOL _canChooseDirectories; BOOL _canChooseFiles; } // Accessing the NSOpenPanel shared instance + (NSOpenPanel *) openPanel; // Running an NSOpenPanel - (NSInteger) runModalForTypes: (NSArray *)fileTypes; - (NSInteger) runModalForDirectory: (NSString *)path file: (NSString *)name types: (NSArray *)fileTypes; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (NSInteger) runModalForDirectory: (NSString *)path file: (NSString *)name types: (NSArray *)fileTypes relativeToWindow: (NSWindow*)window; - (void) beginSheetForDirectory: (NSString *)path file: (NSString *)name types: (NSArray *)fileTypes modalForWindow: (NSWindow *)docWindow modalDelegate: (id)delegate didEndSelector: (SEL)didEndSelector contextInfo: (void *)contextInfo; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (void) beginForDirectory: (NSString *)absoluteDirectoryPath file: (NSString *)filename types: (NSArray *)fileTypes modelessDelegate: (id)modelessDelegate didEndSelector: (SEL)didEndSelector contextInfo: (void *)contextInfo; #endif - (NSArray *) filenames; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (NSArray *) URLs; #endif // Filtering Files - (BOOL) canChooseDirectories; - (BOOL) canChooseFiles; - (void) setCanChooseDirectories: (BOOL)flag; - (void) setCanChooseFiles: (BOOL)flag; #if OS_API_VERSION(MAC_OS_X_VERSION_10_1, GS_API_LATEST) - (void) setResolvesAliases: (BOOL)flag; - (BOOL) resolvesAliases; #endif - (BOOL) allowsMultipleSelection; - (void) setAllowsMultipleSelection: (BOOL)flag; @end #endif // _GNUstep_H_NSOpenPanel gnustep-gui-0.24.0/Headers/AppKit/NSSavePanel.h0000664000076500007650000002044612202222436020776 0ustar brains99brains99/* NSSavePanel.h Standard save panel for saving files Copyright (C) 1996, 1997 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Daniel Boehringer Date: August 1998 Source by Daniel Boehringer integrated into Scott Christley's preliminary implementation by Felipe A. Rodriguez This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSSavePanel #define _GNUstep_H_NSSavePanel #import #import #import @class NSString; @class NSURL; @class NSBrowser; @class NSButton; @class NSForm; @class NSTextField; @class NSView; enum { NSFileHandlingPanelCancelButton = NSCancelButton, NSFileHandlingPanelOKButton = NSOKButton, NSFileHandlingPanelImageButton, NSFileHandlingPanelTitleField, NSFileHandlingPanelBrowser, NSFileHandlingPanelForm, NSFileHandlingPanelHomeButton, NSFileHandlingPanelDiskButton, NSFileHandlingPanelDiskEjectButton }; @protocol NSOpenSavePanelDelegate #ifdef __OBJC2__ @optional #else @end @interface NSObject (NSOpenSavePanelDelegate) #endif - (BOOL)panel:(id)sender shouldEnableURL:(NSURL*)url; - (BOOL)panel:(id)sender validateURL:(NSURL*)url error:(NSError **)error; - (void)panel:(id)sender didChangeToDirectoryURL:(NSURL*)url; - (NSString *)panel:(id)sender userEnteredFilename:(NSString*)filename confirmed:(BOOL)flag; - (void)panel:(id)sender willExpand:(BOOL)expand; - (void)panelSelectionDidChange:(id)sender; // Deprecated in 10.6... - (BOOL)panel:(id)sender isValidFilename:(NSString*)filename; - (void)panel:(id)sender directoryDidChange:(NSString*)path; - (NSComparisonResult)panel:(id)sender compareFilename:(NSString*)name1 with:(NSString*)name2 caseSensitive:(BOOL)caseSensitive; - (BOOL)panel:(id)sender shouldShowFilename:(NSString*)filename; @end DEFINE_BLOCK_TYPE(GSSavePanelCompletionHandler, void, NSInteger); @interface NSSavePanel : NSPanel { NSView *_accessoryView; NSView *_bottomView; NSBrowser *_browser; NSForm *_form; NSButton *_okButton; NSTextField *_titleField; NSView *_topView; NSSize _originalMinSize; NSSize _originalSize; NSArray *_allowedFileTypes; NSString *_directory; NSString *_fullFileName; BOOL _treatsFilePackagesAsDirectories; BOOL _allowsOtherFileTypes; BOOL _canCreateDirectories; BOOL _canSelectHiddenExtension; BOOL _isExtensionHidden; BOOL _showsHiddenFiles; BOOL _delegateHasCompareFilter; BOOL _delegateHasShowFilenameFilter; BOOL _delegateHasValidNameFilter; BOOL _delegateHasUserEnteredFilename; BOOL _delegateHasDirectoryDidChange; BOOL _delegateHasSelectionDidChange; // YES when we stopped because the user pressed 'OK' BOOL _OKButtonPressed; NSMenu *_showsHiddenFilesMenu; GSSavePanelCompletionHandler _completionHandler; } /* * Getting the NSSavePanel shared instance */ + (NSSavePanel *) savePanel; /* * Customizing the NSSavePanel */ - (void) setAccessoryView: (NSView *)aView; - (NSView *) accessoryView; - (void) setTitle: (NSString *)title; - (NSString *) title; - (void) setPrompt: (NSString *)prompt; - (NSString *) prompt; #if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) - (void) setNameFieldStringValue:(NSString *)value; - (NSString *) nameFieldStringValue; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (void) setNameFieldLabel: (NSString *)label; - (NSString *) nameFieldLabel; - (void) setMessage: (NSString *)message; - (NSString *) message; #endif /* * Hidding extensions */ #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) - (void) setCanSelectHiddenExtension: (BOOL) flag; - (BOOL) canSelectHiddenExtension; - (BOOL) isExtensionHidden; - (void) setExtensionHidden: (BOOL) flag; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) - (BOOL) showsHiddenFiles; - (void) setShowsHiddenFiles: (BOOL) flag; #endif /* * Setting Directory and File Type */ - (void) setDirectory: (NSString *)path; #if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) - (void) setDirectoryURL: (NSURL*)url; #endif - (NSString *) requiredFileType; - (void) setRequiredFileType: (NSString *)fileType; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (void) setAllowedFileTypes: (NSArray *)types; - (void) setAllowsOtherFileTypes: (BOOL)flag; - (NSArray *) allowedFileTypes; - (BOOL) allowsOtherFileTypes; #endif - (void) setTreatsFilePackagesAsDirectories: (BOOL)flag; - (BOOL) treatsFilePackagesAsDirectories; - (void) validateVisibleColumns; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (void) setCanCreateDirectories: (BOOL)flag; - (BOOL) canCreateDirectories; #endif /* * Running the NSSavePanel */ - (NSInteger) runModal; - (NSInteger) runModalForDirectory: (NSString *)path file: (NSString *)filename; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (NSInteger) runModalForDirectory: (NSString *)path file: (NSString *)filename relativeToWindow: (NSWindow*)window; - (void) beginSheetForDirectory: (NSString *)path file: (NSString *)filename modalForWindow: (NSWindow *)docWindow modalDelegate: (id)delegate didEndSelector: (SEL)didEndSelector contextInfo: (void *)contextInfo; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) - (void) beginSheetModalForWindow:(NSWindow *)window completionHandler:(GSSavePanelCompletionHandler)handler; - (void) beginWithCompletionHandler:(GSSavePanelCompletionHandler)handler; #endif /* * Reading Save Information */ - (NSString *) directory; - (NSString *) filename; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (NSURL *) URL; - (BOOL) isExpanded; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST) - (NSURL *) directoryURL; #endif /* * Target and Action Methods */ - (void) ok: (id)sender; // target/action of panel's OK button. - (void) cancel: (id)sender; // target/action of panel's cancel button /* * Responding to User Input */ - (void) selectText: (id)sender; @end /* * Methods Implemented by the Delegate */ @interface NSObject (NSSavePanelDelegate) /** * The NSSavePanel sends this message just before the end of a * modal session for each file name displayed or selected * (including file names in multiple selections). The delegate * determines whether it wants the file identified by filename; * it returns YES if the file name is valid, or NO if the * NSSavePanel should stay in its modal loop and wait for the * user to type in or select a different file name or names. If * the delegate refuses a file name in a multiple selection, * none of the file names in the selection are accepted. */ - (BOOL) panel: (id)sender isValidFilename: (NSString*)filename; - (NSComparisonResult) panel: (id)sender compareFilename: (NSString *)filename1 with: (NSString *)filename2 caseSensitive: (BOOL)caseSensitive; /** Sent by NSSavePanel to check whether a file should be displayed in the panel or not. The filename argument is the complete path to the file. */ - (BOOL) panel: (id)sender shouldShowFilename: (NSString *)filename; - (NSString *)panel: (id)sender userEnteredFilename: (NSString *)fileName confirmed: (BOOL)okFlag; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void) panel: (id)sender willExpand: (BOOL)expanding; - (void) panelSelectionDidChange: (id)sender; - (void) panel: (id)sender directoryDidChange: (NSString *)path; #endif @end #endif /* _GNUstep_H_NSSavePanel */ gnustep-gui-0.24.0/Headers/AppKit/NSCollectionView.h0000664000076500007650000001162512134764617022065 0ustar brains99brains99/* -*-objc-*- NSCollectionView.h Copyright (C) 2013 Free Software Foundation, Inc. Author: Doug Simons (doug.simons@testplant.com) Frank LeGrand (frank.legrand@testplant.com) Date: February 2013 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSCollectionView #define _GNUstep_H_NSCollectionView #import #import #import #import @class NSCollectionViewItem; @class NSCollectionView; enum { NSCollectionViewDropOn = 0, NSCollectionViewDropBefore = 1, }; typedef NSInteger NSCollectionViewDropOperation; @protocol NSCollectionViewDelegate - (NSImage *)collectionView:(NSCollectionView *)collectionView draggingImageForItemsAtIndexes:(NSIndexSet *)indexes withEvent:(NSEvent *)event offset:(NSPointPointer)dragImageOffset; - (BOOL)collectionView:(NSCollectionView *)collectionView writeItemsAtIndexes:(NSIndexSet *)indexes toPasteboard:(NSPasteboard *)pasteboard; - (BOOL)collectionView:(NSCollectionView *)collectionView canDragItemsAtIndexes:(NSIndexSet *)indexes withEvent:(NSEvent *)event; - (NSDragOperation)collectionView:(NSCollectionView *)collectionView validateDrop:(id < NSDraggingInfo >)draggingInfo proposedIndex:(NSInteger *)proposedDropIndex dropOperation:(NSCollectionViewDropOperation *)proposedDropOperation; - (BOOL)collectionView:(NSCollectionView *)collectionView acceptDrop:(id < NSDraggingInfo >)draggingInfo index:(NSInteger)index dropOperation:(NSCollectionViewDropOperation)dropOperation; - (NSArray *)collectionView:(NSCollectionView *)collectionView namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropURL forDraggedItemsAtIndexes:(NSIndexSet *)indexes; @end @interface NSCollectionView : NSView // { NSArray *_content; IBOutlet NSCollectionViewItem *itemPrototype; NSMutableArray *_items; BOOL _allowsMultipleSelection; BOOL _isSelectable; NSIndexSet *_selectionIndexes; NSArray *_backgroundColors; IBOutlet id delegate; NSSize _itemSize; NSSize _maxItemSize; NSSize _minItemSize; CGFloat _tileWidth; CGFloat _verticalMargin; CGFloat _horizontalMargin; NSUInteger _maxNumberOfColumns; NSUInteger _maxNumberOfRows; NSUInteger _numberOfColumns; NSDragOperation _draggingSourceOperationMaskForLocal; NSDragOperation _draggingSourceOperationMaskForRemote; NSUInteger _draggingOnRow; NSUInteger _draggingOnIndex; } - (BOOL) allowsMultipleSelection; - (void) setAllowsMultipleSelection: (BOOL)flag; - (NSArray *) backgroundColors; - (void) setBackgroundColors: (NSArray *)colors; - (NSArray *)content; - (void)setContent:(NSArray *)content; - (id < NSCollectionViewDelegate >) delegate; - (void) setDelegate: (id < NSCollectionViewDelegate >)aDelegate; - (NSCollectionViewItem *) itemPrototype; - (void) setItemPrototype: (NSCollectionViewItem *)prototype; - (NSSize) maxItemSize; - (void) setMaxItemSize: (NSSize)size; - (NSUInteger) maxNumberOfColumns; - (void) setMaxNumberOfColumns: (NSUInteger)number; - (NSUInteger) maxNumberOfRows; - (void) setMaxNumberOfRows: (NSUInteger)number; - (NSSize) minItemSize; - (void) setMinItemSize: (NSSize)size; - (BOOL) isSelectable; - (void) setSelectable: (BOOL)flag; - (NSIndexSet *) selectionIndexes; - (void) setSelectionIndexes: (NSIndexSet *)indexes; - (NSRect) frameForItemAtIndex: (NSUInteger)index; - (NSCollectionViewItem *) itemAtIndex: (NSUInteger)index; - (NSCollectionViewItem *) newItemForRepresentedObject:(id)object; - (void) tile; - (void) setDraggingSourceOperationMask: (NSDragOperation)dragOperationMask forLocal: (BOOL)localDestination; - (NSImage *) draggingImageForItemsAtIndexes: (NSIndexSet *)indexes withEvent: (NSEvent *)event offset: (NSPointPointer)dragImageOffset; @end #endif /* _GNUstep_H_NSCollectionView */ gnustep-gui-0.24.0/Headers/AppKit/NSAttributedString.h0000664000076500007650000002734611536622212022431 0ustar brains99brains99/* -*-objc-*- NSAttributedString.h Categories which add capabilities to NSAttributedString Copyright (C) 1999 Free Software Foundation, Inc. Author: Richard Frith-Macdonald Date: July 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSAttributedString #define _GNUstep_H_NSAttributedString #import #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) #import #import #import // for NSWritingDirection #import #import #import @class NSTextAttachment; @class NSFileWrapper; @class NSString; @class NSDictionary; @class NSData; @class NSArray; @class NSURL; @class NSError; @class NSTextBlock; @class NSTextList; @class NSTextTable; /* Global NSString attribute names used in accessing the respective property in a text attributes dictionary. if the key is not in the dictionary the default value is assumed. */ APPKIT_EXPORT NSString *NSAttachmentAttributeName; APPKIT_EXPORT NSString *NSBackgroundColorAttributeName; APPKIT_EXPORT NSString *NSBaselineOffsetAttributeName; APPKIT_EXPORT NSString *NSCursorAttributeName; APPKIT_EXPORT NSString *NSExpansionAttributeName; APPKIT_EXPORT NSString *NSFontAttributeName; APPKIT_EXPORT NSString *NSForegroundColorAttributeName; APPKIT_EXPORT NSString *NSKernAttributeName; APPKIT_EXPORT NSString *NSLigatureAttributeName; APPKIT_EXPORT NSString *NSLinkAttributeName; APPKIT_EXPORT NSString *NSObliquenessAttributeName; APPKIT_EXPORT NSString *NSParagraphStyleAttributeName; APPKIT_EXPORT NSString *NSShadowAttributeName; APPKIT_EXPORT NSString *NSStrikethroughColorAttributeName; APPKIT_EXPORT NSString *NSStrikethroughStyleAttributeName; APPKIT_EXPORT NSString *NSStrokeColorAttributeName; APPKIT_EXPORT NSString *NSStrokeWidthAttributeName; APPKIT_EXPORT NSString *NSSuperscriptAttributeName; APPKIT_EXPORT NSString *NSToolTipAttributeName; APPKIT_EXPORT NSString *NSUnderlineColorAttributeName; APPKIT_EXPORT NSString *NSUnderlineStyleAttributeName; #if OS_API_VERSION(MAC_OS_X_VERSION_10_2, GS_API_LATEST) APPKIT_EXPORT NSString *NSGlyphInfoAttributeName; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) APPKIT_EXPORT NSString *NSPaperSizeDocumentAttribute; APPKIT_EXPORT NSString *NSLeftMarginDocumentAttribute; APPKIT_EXPORT NSString *NSRightMarginDocumentAttribute; APPKIT_EXPORT NSString *NSTopMarginDocumentAttribute; APPKIT_EXPORT NSString *NSBottomMarginDocumentAttribute; APPKIT_EXPORT NSString *NSHyphenationFactorDocumentAttribute; APPKIT_EXPORT NSString *NSDocumentTypeDocumentAttribute; APPKIT_EXPORT NSString *NSCharacterEncodingDocumentAttribute; APPKIT_EXPORT NSString *NSViewSizeDocumentAttribute; APPKIT_EXPORT NSString *NSViewZoomDocumentAttribute; APPKIT_EXPORT NSString *NSViewModeDocumentAttribute; APPKIT_EXPORT NSString *NSBackgroundColorDocumentAttribute; APPKIT_EXPORT NSString *NSCocoaVersionDocumentAttribute; APPKIT_EXPORT NSString *NSReadOnlyDocumentAttribute; APPKIT_EXPORT NSString *NSConvertedDocumentAttribute; APPKIT_EXPORT NSString *NSDefaultTabIntervalDocumentAttribute; APPKIT_EXPORT NSString *NSTitleDocumentAttribute; APPKIT_EXPORT NSString *NSCompanyDocumentAttribute; APPKIT_EXPORT NSString *NSCopyrightDocumentAttribute; APPKIT_EXPORT NSString *NSSubjectDocumentAttribute; APPKIT_EXPORT NSString *NSAuthorDocumentAttribute; APPKIT_EXPORT NSString *NSKeywordsDocumentAttribute; APPKIT_EXPORT NSString *NSCommentDocumentAttribute; APPKIT_EXPORT NSString *NSEditorDocumentAttribute; APPKIT_EXPORT NSString *NSCreationTimeDocumentAttribute; APPKIT_EXPORT NSString *NSModificationTimeDocumentAttribute; // DocumentType values APPKIT_EXPORT NSString *NSPlainTextDocumentType; APPKIT_EXPORT NSString *NSRTFTextDocumentType; APPKIT_EXPORT NSString *NSRTFDTextDocumentType; APPKIT_EXPORT NSString *NSMacSimpleTextDocumentType; APPKIT_EXPORT NSString *NSHTMLTextDocumentType; APPKIT_EXPORT NSString *NSDocFormatTextDocumentType; APPKIT_EXPORT NSString *NSWordMLTextDocumentType; // for HTML export APPKIT_EXPORT NSString *NSExcludedElementsDocumentAttribute; APPKIT_EXPORT NSString *NSTextEncodingNameDocumentAttribute; APPKIT_EXPORT NSString *NSPrefixSpacesDocumentAttribute; // for HTML import APPKIT_EXPORT NSString *NSBaseURLDocumentOption; APPKIT_EXPORT NSString *NSCharacterEncodingDocumentOption; APPKIT_EXPORT NSString *NSDefaultAttributesDocumentOption; APPKIT_EXPORT NSString *NSDocumentTypeDocumentOption; APPKIT_EXPORT NSString *NSTextEncodingNameDocumentOption; APPKIT_EXPORT NSString *NSTextSizeMultiplierDocumentOption; APPKIT_EXPORT NSString *NSTimeoutDocumentOption; APPKIT_EXPORT NSString *NSWebPreferencesDocumentOption; APPKIT_EXPORT NSString *NSWebResourceLoadDelegateDocumentOption; // special attributes APPKIT_EXPORT NSString *NSCharacterShapeAttributeName; APPKIT_EXPORT const unsigned NSUnderlineByWordMask; APPKIT_EXPORT NSString *NSSpellingStateAttributeName; APPKIT_EXPORT const unsigned NSSpellingStateSpellingFlag; APPKIT_EXPORT const unsigned NSSpellingStateGrammarFlag; // readFrom... attributes APPKIT_EXPORT NSString *NSCharacterEncodingDocumentOption; APPKIT_EXPORT NSString *NSBaseURLDocumentOption; APPKIT_EXPORT NSString *NSDefaultAttributesDocumentOption; APPKIT_EXPORT NSString *NSDocumentTypeDocumentOption; // initWithHTML... attributes APPKIT_EXPORT NSString *NSTextEncodingNameDocumentOption; APPKIT_EXPORT NSString *NSTimeoutDocumentOption; APPKIT_EXPORT NSString *NSWebPreferencesDocumentOption; APPKIT_EXPORT NSString *NSWebResourceLoadDelegateDocumentOption; APPKIT_EXPORT NSString *NSTextSizeMultiplierDocumentOption; /* Currently supported values for NSUnderlineStyleAttributeName. */ enum _NSUnderlineStyle { NSUnderlineStyleNone = 0x00, NSUnderlineStyleSingle = 0x01, NSUnderlineStyleThick = 0x02, NSUnderlineStyleDouble = 0x09 }; enum _NSUnderlinePattern { NSUnderlinePatternSolid = 0x0000, NSUnderlinePatternDot = 0x0100, NSUnderlinePatternDash = 0x0200, NSUnderlinePatternDashDot = 0x0300, NSUnderlinePatternDashDotDot = 0x0400 }; #endif #if OS_API_VERSION(GS_API_MACOSX, MAC_OS_X_VERSION_10_3) // Deprecated enum { GSNoUnderlineStyle = 0, NSSingleUnderlineStyle = 1, NSUnderlineStrikethroughMask }; #endif @interface NSAttributedString (AppKit) - (BOOL) containsAttachments; - (NSDictionary*) fontAttributesInRange: (NSRange)range; - (NSDictionary*) rulerAttributesInRange: (NSRange)range; - (NSUInteger) lineBreakBeforeIndex: (NSUInteger)location withinRange: (NSRange)aRange; - (NSRange) doubleClickAtIndex: (NSUInteger)location; - (NSUInteger) nextWordFromIndex: (NSUInteger)location forward: (BOOL)isForward; - (id) initWithRTF: (NSData*)data documentAttributes: (NSDictionary**)dict; - (id) initWithRTFD: (NSData*)data documentAttributes: (NSDictionary**)dict; - (id) initWithPath: (NSString*)path documentAttributes: (NSDictionary**)dict; - (id) initWithURL: (NSURL*)url documentAttributes: (NSDictionary**)dict; - (id) initWithRTFDFileWrapper: (NSFileWrapper*)wrapper documentAttributes: (NSDictionary**)dict; - (id) initWithHTML: (NSData*)data documentAttributes: (NSDictionary**)dict; - (id) initWithHTML: (NSData*)data baseURL: (NSURL*)base documentAttributes: (NSDictionary**)dict; - (NSData*) RTFFromRange: (NSRange)range documentAttributes: (NSDictionary*)dict; - (NSData*) RTFDFromRange: (NSRange)range documentAttributes: (NSDictionary*)dict; - (NSFileWrapper*) RTFDFileWrapperFromRange: (NSRange)range documentAttributes: (NSDictionary*)dict; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) + (NSArray *) textFileTypes; + (NSArray *) textPasteboardTypes; + (NSArray *) textUnfilteredFileTypes; + (NSArray *) textUnfilteredPasteboardTypes; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) + (NSArray *) textTypes; + (NSArray *) textUnfilteredTypes; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (NSData *) docFormatFromRange: (NSRange)range documentAttributes: (NSDictionary *)dict; - (id) initWithDocFormat: (NSData *)data documentAttributes: (NSDictionary **)dict; - (id) initWithHTML: (NSData *)data options: (NSDictionary *)options documentAttributes: (NSDictionary **)dict; - (NSUInteger) lineBreakByHyphenatingBeforeIndex: (NSUInteger)location withinRange: (NSRange)aRange; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (NSData *) dataFromRange: (NSRange)range documentAttributes: (NSDictionary *)dict error: (NSError **)error; - (NSFileWrapper *) fileWrapperFromRange: (NSRange)range documentAttributes: (NSDictionary *)dict error: (NSError **)error; - (id) initWithData: (NSData *)data options: (NSDictionary *)options documentAttributes: (NSDictionary **)dict error: (NSError **)error; - (id) initWithURL: (NSURL *)url options: (NSDictionary *)options documentAttributes: (NSDictionary **)dict error: (NSError **)error; - (NSInteger) itemNumberInTextList: (NSTextList *)list atIndex: (NSUInteger)location; - (NSRange) rangeOfTextBlock: (NSTextBlock *)block atIndex: (NSUInteger)location; - (NSRange) rangeOfTextList: (NSTextList *)list atIndex: (NSUInteger)location; - (NSRange) rangeOfTextTable: (NSTextTable *)table atIndex: (NSUInteger)location; #endif @end @interface NSMutableAttributedString (AppKit) - (void) superscriptRange: (NSRange)range; - (void) subscriptRange: (NSRange)range; - (void) unscriptRange: (NSRange)range; - (void) applyFontTraits: (NSFontTraitMask)traitMask range: (NSRange)range; - (void) setAlignment: (NSTextAlignment)alignment range: (NSRange)range; - (void) fixAttributesInRange: (NSRange)range; - (void) fixFontAttributeInRange: (NSRange)range; - (void) fixParagraphStyleAttributeInRange: (NSRange)range; - (void) fixAttachmentAttributeInRange: (NSRange)range; - (void) updateAttachmentsFromPath: (NSString *)path; - (BOOL) readFromURL: (NSURL *)url options: (NSDictionary *)options documentAttributes: (NSDictionary**)documentAttributes; #if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST) - (BOOL) readFromData: (NSData *)data options: (NSDictionary *)options documentAttributes: (NSDictionary **)documentAttributes; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST) - (BOOL) readFromData: (NSData *)data options: (NSDictionary *)options documentAttributes: (NSDictionary **)documentAttributes error: (NSError **)error; - (BOOL) readFromURL: (NSURL *)url options: (NSDictionary *)options documentAttributes: (NSDictionary **)documentAttributes error: (NSError **)error; - (void) setBaseWritingDirection: (NSWritingDirection)writingDirection range: (NSRange)range; #endif @end #endif #endif gnustep-gui-0.24.0/Headers/AppKit/NSDataLink.h0000664000076500007650000000764112023534215020613 0ustar brains99brains99/* NSDataLink.h Link between a source and dependent document Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSDataLink #define _GNUstep_H_NSDataLink #import #import #import @class NSString; @class NSArray; @class NSDate; @class NSDataLinkManager; @class NSSelection; @class NSPasteboard; typedef int NSDataLinkNumber; typedef enum _NSDataLinkDisposition { NSLinkInDestination, NSLinkInSource, NSLinkBroken } NSDataLinkDisposition; typedef enum _NSDataLinkUpdateMode { NSUpdateContinuously, NSUpdateWhenSourceSaved, NSUpdateManually, NSUpdateNever } NSDataLinkUpdateMode; APPKIT_EXPORT NSString *NSDataLinkFileNameExtension; @interface NSDataLink : NSObject { // Attributes @private // link info. NSDataLinkNumber linkNumber; NSDataLinkDisposition disposition; NSDataLinkUpdateMode updateMode; // info about the source. NSDate *lastUpdateTime; NSString *sourceApplicationName; NSString *sourceFilename; NSSelection *sourceSelection; id sourceManager; // info about the destination NSString *destinationApplicationName; NSString *destinationFilename; NSSelection *destinationSelection; id destinationManager; // types. NSArray *types; // other flags struct __linkFlags { unsigned appVerifies:1; unsigned broken:1; unsigned canUpdateContinuously:1; unsigned isDirty:1; unsigned willOpenSource:1; unsigned willUpdate:1; unsigned isMarker:1; } _flags; } // // Initializing a Link // - (id)initLinkedToFile:(NSString *)filename; - (id)initLinkedToSourceSelection:(NSSelection *)selection managedBy:(NSDataLinkManager *)linkManager supportingTypes:(NSArray *)newTypes; - (id)initWithContentsOfFile:(NSString *)filename; - (id)initWithPasteboard:(NSPasteboard *)pasteboard; // // Exporting a Link // - (BOOL)saveLinkIn:(NSString *)directoryName; - (BOOL)writeToFile:(NSString *)filename; - (void)writeToPasteboard:(NSPasteboard *)pasteboard; // // Information about the Link // - (NSDataLinkDisposition)disposition; - (NSDataLinkNumber)linkNumber; - (NSDataLinkManager *)manager; // // Information about the Link's Source // - (NSDate *)lastUpdateTime; - (BOOL)openSource; - (NSString *)sourceApplicationName; - (NSString *)sourceFilename; - (NSSelection *)sourceSelection; - (NSArray *)types; // // Information about the Link's Destination // - (NSString *)destinationApplicationName; - (NSString *)destinationFilename; - (NSSelection *)destinationSelection; // // Changing the Link // - (BOOL)break; - (void)noteSourceEdited; - (void)setUpdateMode:(NSDataLinkUpdateMode)mode; - (BOOL)updateDestination; - (NSDataLinkUpdateMode)updateMode; @end APPKIT_EXPORT NSString *NSDataLinkFilenameExtension; APPKIT_EXPORT NSString *NSDataLinkPboardType; #endif // _GNUstep_H_NSDataLink gnustep-gui-0.24.0/Headers/AppKit/NSBox.h0000664000076500007650000000710612036333132017647 0ustar brains99brains99/* NSBox.h Simple box view that can display a border and title Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSBox #define _GNUstep_H_NSBox #import #import @class NSString; @class NSColor; @class NSFont; /** Title positioning of an NSBox: * * NSNoTitle * NSAboveTop * NSAtTop * NSBelowTop * NSAboveBottom * NSAtBottom * NSBelowBottom * */ typedef enum _NSTitlePosition { NSNoTitle, NSAboveTop, NSAtTop, NSBelowTop, NSAboveBottom, NSAtBottom, NSBelowBottom } NSTitlePosition; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) typedef enum _NSBoxType { NSBoxPrimary=0, NSBoxSecondary, NSBoxSeparator, NSBoxOldStyle #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) , NSBoxCustom #endif } NSBoxType; #endif @interface NSBox : NSView { // Attributes id _cell; id _content_view; NSSize _offsets; NSRect _border_rect; NSRect _title_rect; NSBorderType _border_type; NSTitlePosition _title_position; NSBoxType _box_type; // Only used when the type is NSBoxCustom NSColor *_fill_color; NSColor *_border_color; CGFloat _border_width; CGFloat _corner_radius; BOOL _transparent; } // // Getting and Modifying the Border and Title // - (NSRect)borderRect; - (NSBorderType)borderType; - (void)setBorderType:(NSBorderType)aType; - (void)setTitle:(NSString *)aString; - (void)setTitleFont:(NSFont *)fontObj; - (void)setTitlePosition:(NSTitlePosition)aPosition; - (NSString *)title; - (id)titleCell; - (NSFont *)titleFont; - (NSTitlePosition)titlePosition; - (NSRect)titleRect; #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST) - (void)setTitleWithMnemonic:(NSString *)aString; - (NSBoxType)boxType; - (void)setBoxType:(NSBoxType)aType; #endif // // Setting and Placing the Content View // - (id)contentView; - (NSSize)contentViewMargins; - (void)setContentView:(NSView *)aView; - (void)setContentViewMargins:(NSSize)offsetSize; // // Resizing the Box // - (void)setFrameFromContentFrame:(NSRect)contentFrame; - (void)sizeToFit; #if OS_API_VERSION(GS_API_NONE, GS_API_NONE) -(NSSize) minimumSize; #endif #if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST) - (NSColor*)fillColor; - (void)setFillColor:(NSColor*)newFillColor; - (NSColor*)borderColor; - (void)setBorderColor:(NSColor*)newBorderColor; - (CGFloat)borderWidth; - (void)setBorderWidth:(CGFloat)borderWidth; - (CGFloat)cornerRadius; - (void)setCornerRadius:(CGFloat)cornerRadius; - (BOOL)isTransparent; - (void)setTransparent:(BOOL)transparent; #endif @end #endif // _GNUstep_H_NSBox gnustep-gui-0.24.0/Headers/AppKit/NSText.h0000664000076500007650000002232312152677030020050 0ustar brains99brains99/* -*-objc-*- NSText.h The text object Copyright (C) 1996 Free Software Foundation, Inc. Author: Scott Christley Date: 1996 Author: Felipe A. Rodriguez Date: July 1998 Author: Daniel Böhringer Date: August 1998 Author: Nicola Pero Date: December 2000 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_NSText #define _GNUstep_H_NSText /* * The NSText class is now an abstract class. When you allocate an * instance of NSText, an instance of NSTextView is always allocated * instead. * * But you can still subclass NSText to implement your own text * editing class not derived from NSTextView. NSText declares general * methods that a text editing object should have; it has some helper * methods which are simple wrappers around the real basic editing * methods. The real editing methods are not implemented in NSText, * which is why it is abstract. To make a working subclass, you need to * implement these methods, marked as "PRIMITIVE" below. * * The working subclass could potentially be implemented in absolutely * *any* way you want. I have been told that some versions of Emacs can * be embedded as an X subwindow inside alien widgets and windows - so * yes, potentially if you are able to figure out how to embed Emacs * inside the GNUstep NSView tree, you can write a subclass of NSText * which just uses Emacs. */ #import #import #import #import //#import @class NSAttributedString; @class NSData; @class NSNotification; @class NSString; @class NSColor; @class NSFont; typedef enum _NSTextAlignment { NSLeftTextAlignment = 0, NSRightTextAlignment, NSCenterTextAlignment, NSJustifiedTextAlignment, NSNaturalTextAlignment } NSTextAlignment; enum { NSIllegalTextMovement = 0, NSReturnTextMovement = 0x10, NSTabTextMovement = 0x11, NSBacktabTextMovement = 0x12, NSLeftTextMovement = 0x13, NSRightTextMovement = 0x14, NSUpTextMovement = 0x15, NSDownTextMovement = 0x16, NSCancelTextMovement = 0x17, NSOtherTextMovement = 0 }; enum { NSParagraphSeparatorCharacter = 0x2029, NSLineSeparatorCharacter = 0x2028, NSTabCharacter = 0x0009, NSFormFeedCharacter = 0x000c, NSNewlineCharacter = 0x000a, NSCarriageReturnCharacter = 0x000d, NSEnterCharacter = 0x0003, NSBackspaceCharacter = 0x0008, NSBackTabCharacter = 0x0019, NSDeleteCharacter = 0x007f, }; /* The following are required by the original openstep doc. */ enum { NSBackspaceKey = 8, NSCarriageReturnKey = 13, NSDeleteKey = 0x7f, NSBacktabKey = 25 }; @interface NSText : NSView { } /* * Getting and Setting Contents */ /* these aren't in OPENSTEP */ - (void) replaceCharactersInRange: (NSRange)aRange withRTF: (NSData*)rtfData; - (void) replaceCharactersInRange: (NSRange)aRange withRTFD: (NSData*)rtfdData; /* PRIMITIVE */ - (void) replaceCharactersInRange: (NSRange)aRange withString: (NSString*)aString; /* PRIMITIVE */ -(void) replaceCharactersInRange: (NSRange)aRange /* GNUstep extension */ withAttributedString: (NSAttributedString *)attrString; /* PRIMITIVE */ - (void) setString: (NSString*)aString; /* PRIMITIVE */ - (NSString*) string; /* * Old fashioned OpenStep methods (wrappers for the previous ones) */ - (void) replaceRange: (NSRange)aRange withString: (NSString*)aString; /* not OPENSTEP */ - (void) replaceRange: (NSRange)aRange withRTF: (NSData*)rtfData; - (void) replaceRange: (NSRange)aRange withRTFD: (NSData*)rtfdData; - (void) setText: (NSString*)aString; - (void) setText: (NSString*)aString range: (NSRange)aRange; /* not OPENSTEP */ - (NSString*) text; /* * Graphic attributes */ /* PRIMITIVE */ - (NSColor*) backgroundColor; /* PRIMITIVE */ - (BOOL) drawsBackground; /* PRIMITIVE */ - (void) setBackgroundColor: (NSColor*)color; /* PRIMITIVE */ - (void) setDrawsBackground: (BOOL)flag; /* * Managing Global Characteristics */ - (BOOL) importsGraphics; /* PRIMITIVE */ - (BOOL) isEditable; /* PRIMITIVE */ - (BOOL) isFieldEditor; /* PRIMITIVE */ - (BOOL) isRichText; /* PRIMITIVE */ - (BOOL) isSelectable; /* PRIMITIVE */ - (void) setEditable: (BOOL)flag; /* PRIMITIVE */ - (void) setFieldEditor: (BOOL)flag; /* PRIMITIVE */ - (void) setImportsGraphics: (BOOL)flag; /* PRIMITIVE */ - (void) setRichText: (BOOL)flag; /* PRIMITIVE */ - (void) setSelectable: (BOOL)flag; /* PRIMITIVE */ /* * Using the font panel */ - (void) setUsesFontPanel: (BOOL)flag; /* PRIMITIVE */ - (BOOL) usesFontPanel; /* PRIMITIVE */ /* * Managing the Ruler */ - (BOOL) isRulerVisible; /* PRIMITIVE */ - (void) toggleRuler: (id)sender; /* PRIMITIVE */ /* * Managing the Selection */ - (NSRange) selectedRange; - (void) setSelectedRange: (NSRange)range; /* * Responding to Editing Commands */ - (void) copy: (id)sender; /* PRIMITIVE */ - (void) copyFont: (id)sender; /* PRIMITIVE */ - (void) copyRuler: (id)sender; /* PRIMITIVE */ - (void) cut: (id)sender; - (void) delete: (id)sender; /* PRIMITIVE */ - (void) paste: (id)sender; /* PRIMITIVE */ - (void) pasteFont: (id)sender; /* PRIMITIVE */ - (void) pasteRuler: (id)sender; /* PRIMITIVE */ - (void) selectAll: (id)sender; /* * Managing Font */ - (void) changeFont: (id)sender; /* PRIMITIVE */ - (NSFont*) font; /* PRIMITIVE */ - (void) setFont: (NSFont*)font; /* PRIMITIVE */ - (void) setFont: (NSFont*)font range: (NSRange)aRange; /* PRIMITIVE */ /* Old OpenStep name for the same method. */ - (void) setFont: (NSFont*)font ofRange: (NSRange)aRange; /* * Managing Alignment */ - (NSTextAlignment) alignment; /* PRIMITIVE */ - (void) setAlignment: (NSTextAlignment)mode; /* PRIMITIVE */ - (void) alignCenter: (id)sender; /* PRIMITIVE */ - (void) alignLeft: (id)sender; /* PRIMITIVE */ - (void) alignRight: (id)sender; /* PRIMITIVE */ /* * Text colour */ - (void) setTextColor: (NSColor*)color range: (NSRange)aRange; /* PRIMITIVE */ /* not OPENSTEP */ - (void) setColor: (NSColor*)color ofRange: (NSRange)aRange; /* PRIMITIVE */ - (void) setTextColor: (NSColor*)color; /* PRIMITIVE */ - (NSColor*) textColor; /* PRIMITIVE */ /* * Text attributes */ - (void) subscript: (id)sender; /* PRIMITIVE */ - (void) superscript: (id)sender; /* PRIMITIVE */ - (void) underline: (id)sender; /* PRIMITIVE */ - (void) unscript: (id)sender; /* PRIMITIVE */ /* * Reading and Writing RTFD Files */ -(BOOL) readRTFDFromFile: (NSString*)path; /* PRIMITIVE */ -(BOOL) writeRTFDToFile: (NSString*)path atomically: (BOOL)flag; /* PRIMITIVE */ -(NSData*) RTFDFromRange: (NSRange)aRange; /* PRIMITIVE */ -(NSData*) RTFFromRange: (NSRange)aRange; /* PRIMITIVE */ /* * Sizing the Frame Rectangle */ - (BOOL) isHorizontallyResizable; /* PRIMITIVE */ - (BOOL) isVerticallyResizable; /* PRIMITIVE */ - (NSSize) maxSize; /* PRIMITIVE */ - (NSSize) minSize; /* PRIMITIVE */ - (void) setHorizontallyResizable: (BOOL)flag; /* PRIMITIVE */ - (void) setMaxSize: (NSSize)newMaxSize; /* PRIMITIVE */ - (void) setMinSize: (NSSize)newMinSize; /* PRIMITIVE */ - (void) setVerticallyResizable: (BOOL)flag; /* PRIMITIVE */ - (void) sizeToFit; /* PRIMITIVE */ /* * Spelling */ - (void) checkSpelling: (id)sender; /* PRIMITIVE */ - (void) showGuessPanel: (id)sender; /* * Scrolling */ - (void) scrollRangeToVisible: (NSRange)aRange; /* PRIMITIVE */ /* * Managing the Delegate */ - (id) delegate; /* PRIMITIVE */ - (void) setDelegate: (id)anObject; /* PRIMITIVE */ /* * NSChangeSpelling protocol */ - (void) changeSpelling: (id)sender; /* PRIMITIVE */ /* * NSIgnoreMisspelledWords protocol */ - (void) ignoreSpelling: (id)sender; /* PRIMITIVE */ /* not OPENSTEP */ @end @interface NSText (GNUstepExtensions) - (NSUInteger) textLength; /* PRIMITIVE */ @end /* Notifications */ APPKIT_EXPORT NSString *NSTextDidBeginEditingNotification; APPKIT_EXPORT NSString *NSTextDidEndEditingNotification; APPKIT_EXPORT NSString *NSTextDidChangeNotification; @interface NSObject (NSTextDelegate) - (BOOL) textShouldBeginEditing: (NSText*)textObject; /* YES means do it */ - (BOOL) textShouldEndEditing: (NSText*)textObject; /* YES means do it */ - (void) textDidBeginEditing: (NSNotification*)notification; - (void) textDidEndEditing: (NSNotification*)notification; - (void) textDidChange: (NSNotification*)notification; /* Any keyDown or paste which changes the contents causes this */ @end #endif // _GNUstep_H_NSText gnustep-gui-0.24.0/Headers/Cocoa/0000775000076500007650000000000012256227325016347 5ustar brains99brains99gnustep-gui-0.24.0/Headers/Cocoa/Cocoa.h0000664000076500007650000000261511455412557017553 0ustar brains99brains99/* Cocoa.h Cocoa compatible declarations. Not to be used in normal GNUstep code. Copyright (C) 2004 Free Software Foundation, Inc. Author: Fred Kiefer Date: 2004 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 Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_COCOA #define _GNUstep_H_COCOA #import #import #ifndef M_PI #define M_PI 3.1415926535897932384626433 #endif #if (!defined(__cplusplus) && !defined(__USE_ISOC99) && !defined(__bool_true_false_are_defined)) typedef BOOL bool; #define false NO #define true YES #endif #endif /* _GNUstep_H_COCOA */ gnustep-gui-0.24.0/README0000664000076500007650000000342011372062630014621 0ustar brains99brains991 README ******** The GNUstep gui library is a library of graphical user interface classes written completely in the Objective-C language; the classes are based upon Apple's Cocoa framwork (which came from the OpenStep specification). These classes include graphical objects such as buttons, text fields, popup lists, browser lists, and windows; there are also many associated classes for handling events, colors, fonts, pasteboards and images. 1.1 Initial reading =================== * The file `ANNOUNCE' contains a very brief overview of the library. It also tells you where to get the most recent version. * The file `NEWS' has the library's feature history. * The file `INSTALL' gives instructions for installing the library. 1.2 License =========== The GNUstep libraries and library resources are covered under the GNU Lesser Public License. This means you can use these libraries in any program (even non-free programs). If you distribute the libraries along with your program, you must make the improvements you have made to the libraries freely available. You should read the COPYING.LIB file for more information. All files in this package EXCEPT files in the `Tools' directories and subdirectories under this are covered under the GLPL. GNUstep tools, test programs, and other files are covered under the GNU General Public License. This means if you make changes to these programs, you cannot charge a fee, other than distribution fees, for others to use the program. You should read the COPYING file for more information. All files in the `Tools' directory are covered under the GPL. 1.3 How can you help? ===================== * Give us feedback! Tell us what you like; tell us what you think could be better. Send bug reports to . gnustep-gui-0.24.0/ColorPickers/0000775000076500007650000000000012256227331016344 5ustar brains99brains99gnustep-gui-0.24.0/ColorPickers/GSRGBColorPicker.m0000664000076500007650000000743411651651245021536 0ustar brains99brains99/* GSRGBColorPicker.m Copyright (C) 2000 Free Software Foundation, Inc. Author: Fred Kiefer Date: December 2000 Author: Alexander Malmberg Date: May 2002 This file is part of GNUstep. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "GSRGBColorPicker.h" @implementation GSRGBColorPicker - (id)initWithPickerMask:(int)aMask colorPanel:(NSColorPanel *)colorPanel { if (aMask & NSColorPanelRGBModeMask) { NSBundle *b; self = [super initWithPickerMask: aMask colorPanel: colorPanel]; if (!self) return nil; b = [NSBundle bundleForClass: [self class]]; numFields = 3; currentMode = NSColorPanelRGBModeMask; maxValue = 255; r_names[0] = NSLocalizedStringFromTableInBundle(@"Red",@"StandardPicker",b,@""); r_names[1] = NSLocalizedStringFromTableInBundle(@"Green",@"StandardPicker",b,@""); r_names[2] = NSLocalizedStringFromTableInBundle(@"Blue",@"StandardPicker",b,@""); names = r_names; sliders = r_sliders; fields = r_fields; values = r_values; return self; } RELEASE(self); return nil; } - (void)setColor:(NSColor *)color { CGFloat red, green, blue, alpha; NSColor *c; if (updating) return; updating = YES; c = [color colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; [c getRed: &red green: &green blue: &blue alpha: &alpha]; values[0] = red * 255; values[1] = green * 255; values[2] = blue * 255; [self _valuesChanged]; [(GSColorSliderCell *)[sliders[0] cell] _setColorSliderCellValues: red : green : blue]; [(GSColorSliderCell *)[sliders[1] cell] _setColorSliderCellValues: red : green : blue]; [(GSColorSliderCell *)[sliders[2] cell] _setColorSliderCellValues: red : green : blue]; [sliders[0] setNeedsDisplay: YES]; [sliders[1] setNeedsDisplay: YES]; [sliders[2] setNeedsDisplay: YES]; updating = NO; } -(void) _setColorFromValues { float red = values[0] / 255; float green = values[1] / 255; float blue = values[2] / 255; float alpha = [_colorPanel alpha]; NSColor *c = [NSColor colorWithCalibratedRed: red green: green blue: blue alpha: alpha]; [_colorPanel setColor: c]; [(GSColorSliderCell *)[sliders[0] cell] _setColorSliderCellValues: red : green : blue]; [(GSColorSliderCell *)[sliders[1] cell] _setColorSliderCellValues: red : green : blue]; [(GSColorSliderCell *)[sliders[2] cell] _setColorSliderCellValues: red : green : blue]; [sliders[0] setNeedsDisplay: YES]; [sliders[1] setNeedsDisplay: YES]; [sliders[2] setNeedsDisplay: YES]; } - (void) loadViews { [super loadViews]; [sliders[0] setMaxValue: 255]; [sliders[1] setMaxValue: 255]; [sliders[2] setMaxValue: 255]; [(GSColorSliderCell *)[sliders[0] cell] _setColorSliderCellMode: 1]; [(GSColorSliderCell *)[sliders[1] cell] _setColorSliderCellMode: 2]; [(GSColorSliderCell *)[sliders[2] cell] _setColorSliderCellMode: 3]; } @end gnustep-gui-0.24.0/ColorPickers/GSGrayColorPicker.m0000664000076500007650000000612311651651245022020 0ustar brains99brains99/* GSGrayColorPicker.m Copyright (C) 2001 Free Software Foundation, Inc. Author: Fred Kiefer Date: January 2001 Author: Alexander Malmberg Date: May 2002 This file is part of GNUstep. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "GSGrayColorPicker.h" #include @implementation GSGrayColorPicker - (id)initWithPickerMask:(int)aMask colorPanel:(NSColorPanel *)colorPanel { if (aMask & NSColorPanelGrayModeMask) { NSBundle *b; self = [super initWithPickerMask: aMask colorPanel: colorPanel]; if (!self) return nil; numFields = 1; currentMode = NSColorPanelGrayModeMask; maxValue = 100; b = [NSBundle bundleForClass: [self class]]; r_names[0] = NSLocalizedStringFromTableInBundle(@"White",@"StandardPicker",b,@""); names = r_names; sliders = r_sliders; fields = r_fields; values = r_values; return self; } RELEASE(self); return nil; } - (void)setColor:(NSColor *)color { CGFloat white, alpha; NSColor *c; if (updating) return; updating = YES; c = [color colorUsingColorSpaceName: NSCalibratedWhiteColorSpace]; [c getWhite: &white alpha: &alpha]; values[0] = white * 100; [self _valuesChanged]; updating = NO; } -(void) _setColorFromValues { float white = values[0] / 100; float alpha = [_colorPanel alpha]; NSColor *c = [NSColor colorWithCalibratedWhite: white alpha: alpha]; [_colorPanel setColor: c]; } - (void) loadViews { int i; GSHbox *hb; NSColorWell *well; [super loadViews]; [sliders[0] setMaxValue: 100]; [(GSColorSliderCell *)[sliders[0] cell] _setColorSliderCellMode: 0]; hb = [[GSHbox alloc] init]; [hb setAutoresizingMask: NSViewWidthSizable | NSViewMinYMargin]; for (i = 0; i < 7; i++) { well = [[NSColorWell alloc] initWithFrame: NSMakeRect(0, 0, 20, 20)]; [well setColor: [NSColor colorWithCalibratedWhite: (i / 6.0) alpha: 1.0]]; [well setBordered: NO]; //[well setTarget: self]; //[well setAction: @selector(takeColor:)]; [hb addView: well enablingXResizing: NO]; RELEASE(well); } [baseView putView: hb atRow: 0 column: 0 withXMargins: 0 yMargins: 4]; DESTROY(hb); } - (void) takeColor: (id) sender { [self setColor: [sender color]]; } @end gnustep-gui-0.24.0/ColorPickers/.cvsignore0000664000076500007650000000001610377004044020335 0ustar brains99brains99*.bundle *obj gnustep-gui-0.24.0/ColorPickers/GSGrayColorPicker.tiff0000664000076500007650000000733407557546257022541 0ustar brains99brains99II*ˆ ÿ ÿÿÿ$$$ÿ,,,ÿ555ÿ>>>ÿGGGÿOOOÿXXXÿaaaÿjjjÿrrrÿ{{{ÿ„„„ÿÿ•••ÿžžžÿ§§§ÿ°°°ÿ¸¸¸ÿÁÁÁÿÊÊÊÿÓÓÓÿÛÛÛÿäääÿíííÿöööÿÿÿÿÿÿ ÿÿÿ$$$ÿ,,,ÿ555ÿ>>>ÿGGGÿOOOÿXXXÿaaaÿjjjÿrrrÿ{{{ÿ„„„ÿÿ•••ÿžžžÿ§§§ÿ°°°ÿ¸¸¸ÿÁÁÁÿÊÊÊÿÓÓÓÿÛÛÛÿäääÿíííÿöööÿÿÿÿÿÿ ÿÿÿ$$$ÿ,,,ÿ555ÿ>>>ÿGGGÿOOOÿXXXÿaaaÿjjjÿrrrÿ{{{ÿ„„„ÿÿ•••ÿžžžÿ§§§ÿ°°°ÿ¸¸¸ÿÁÁÁÿÊÊÊÿÓÓÓÿÛÛÛÿäääÿíííÿöööÿÿÿÿÿÿ ÿÿÿ$$$ÿ,,,ÿ555ÿ>>>ÿGGGÿOOOÿXXXÿaaaÿjjjÿrrrÿ{{{ÿ„„„ÿÿ•••ÿžžžÿ§§§ÿ°°°ÿ¸¸¸ÿÁÁÁÿÊÊÊÿÓÓÓÿÛÛÛÿäääÿíííÿöööÿÿÿÿÿÿ ÿÿÿ$$$ÿ,,,ÿ555ÿ>>>ÿGGGÿOOOÿXXXÿaaaÿjjjÿrrrÿ{{{ÿ„„„ÿÿ•••ÿžžžÿ§§§ÿ°°°ÿ¸¸¸ÿÁÁÁÿÊÊÊÿÓÓÓÿÛÛÛÿäääÿíííÿöööÿÿÿÿÿ&&&ÿ&&&ÿ&&&ÿ&&&ÿ&&&ÿIIIÿIIIÿIIIÿIIIÿIIIÿjjjÿjjjÿjjjÿjjjÿjjjÿ~~~ÿ~~~ÿ~~~ÿ~~~ÿ~~~ÿ&&&ÿ&&&ÿ&&&ÿ&&&ÿ&&&ÿIIIÿIIIÿIIIÿIIIÿIIIÿjjjÿjjjÿjjjÿjjjÿjjjÿ~~~ÿ~~~ÿ~~~ÿ~~~ÿ~~~ÿ&&&ÿ&&&ÿ&&&ÿ&&&ÿ&&&ÿIIIÿIIIÿIIIÿIIIÿIIIÿjjjÿjjjÿjjjÿjjjÿjjjÿ~~~ÿ~~~ÿ~~~ÿ~~~ÿ~~~ÿ&&&ÿ&&&ÿ&&&ÿ&&&ÿ&&&ÿIIIÿIIIÿIIIÿIIIÿIIIÿjjjÿjjjÿjjjÿjjjÿjjjÿ~~~ÿ~~~ÿ~~~ÿ~~~ÿ~~~ÿ&&&ÿ&&&ÿ&&&ÿ&&&ÿ&&&ÿIIIÿIIIÿIIIÿIIIÿIIIÿjjjÿjjjÿjjjÿjjjÿjjjÿ~~~ÿ~~~ÿ~~~ÿ~~~ÿ~~~ÿŸŸŸÿŸŸŸÿŸŸŸÿŸŸŸÿŸŸŸÿ²²²ÿ²²²ÿ²²²ÿ²²²ÿ²²²ÿÉÉÉÿÉÉÉÿÉÉÉÿÉÉÉÿÉÉÉÿäääÿäääÿäääÿäääÿäääÿŸŸŸÿŸŸŸÿŸŸŸÿŸŸŸÿŸŸŸÿ²²²ÿ²²²ÿ²²²ÿ²²²ÿ²²²ÿÉÉÉÿÉÉÉÿÉÉÉÿÉÉÉÿÉÉÉÿäääÿäääÿäääÿäääÿäääÿŸŸŸÿŸŸŸÿŸŸŸÿŸŸŸÿŸŸŸÿ²²²ÿ²²²ÿ²²²ÿ²²²ÿ²²²ÿÉÉÉÿÉÉÉÿÉÉÉÿÉÉÉÿÉÉÉÿäääÿäääÿäääÿäääÿäääÿŸŸŸÿŸŸŸÿŸŸŸÿŸŸŸÿŸŸŸÿ²²²ÿ²²²ÿ²²²ÿ²²²ÿ²²²ÿÉÉÉÿÉÉÉÿÉÉÉÿÉÉÉÿÉÉÉÿäääÿäääÿäääÿäääÿäääÿŸŸŸÿŸŸŸÿŸŸŸÿŸŸŸÿŸŸŸÿ²²²ÿ²²²ÿ²²²ÿ²²²ÿ²²²ÿÉÉÉÿÉÉÉÿÉÉÉÿÉÉÉÿÉÉÉÿäääÿäääÿäääÿäääÿäääÿþ$f Gn¶@€ ÌÔ(R/home/pyr/gnustep/gnustep/core/gui/ColorPickers/GSGrayColorPicker.tiffCreated with The GIMPHHgnustep-gui-0.24.0/ColorPickers/GSHSBColorPicker.h0000664000076500007650000000255711023376255021532 0ustar brains99brains99/* GSHSBColorPicker.h Copyright (C) 2000 Free Software Foundation, Inc. Author: Fred Kiefer Date: December 2000 Author: Alexander Malmberg Date: May 2002 This file is part of GNUstep. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include "GSStandardColorPicker.h" @interface GSHSBColorPicker : GSStandardCSColorPicker { NSString *r_names[3]; NSSlider *r_sliders[3]; NSTextField *r_fields[3]; float r_values[3]; } -(void) _setColorFromValues; -(void) setColor:(NSColor *)color; @end gnustep-gui-0.24.0/ColorPickers/GSHSBColorPicker.m0000664000076500007650000000764111651651245021540 0ustar brains99brains99/* GSHSBColorPicker.m Copyright (C) 2000 Free Software Foundation, Inc. Author: Fred Kiefer Date: December 2000 Author: Alexander Malmberg Date: May 2002 This file is part of GNUstep. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "GSHSBColorPicker.h" @implementation GSHSBColorPicker - (id)initWithPickerMask:(int)aMask colorPanel:(NSColorPanel *)colorPanel { if (aMask & NSColorPanelHSBModeMask) { NSBundle *b; self = [super initWithPickerMask: aMask colorPanel: colorPanel]; if (!self) return nil; numFields = 3; currentMode = NSColorPanelHSBModeMask; b = [NSBundle bundleForClass: [self class]]; r_names[0] = NSLocalizedStringFromTableInBundle(@"Hue",@"StandardPicker",b,@""); r_names[1] = NSLocalizedStringFromTableInBundle(@"Saturation",@"StandardPicker",b,@""); r_names[2] = NSLocalizedStringFromTableInBundle(@"Brightness",@"StandardPicker",b,@""); names = r_names; sliders = r_sliders; fields = r_fields; values = r_values; return self; } RELEASE(self); return nil; } - (void)setColor:(NSColor *)color { CGFloat hue, saturation, brightness, alpha; NSColor *c; if (updating) return; updating = YES; c = [color colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; [c getHue: &hue saturation: &saturation brightness: &brightness alpha: &alpha]; values[0] = hue * 360; values[1] = saturation * 100; values[2] = brightness * 100; [self _valuesChanged]; [(GSColorSliderCell *)[sliders[0] cell] _setColorSliderCellValues: hue : saturation : brightness]; [(GSColorSliderCell *)[sliders[1] cell] _setColorSliderCellValues: hue : saturation : brightness]; [(GSColorSliderCell *)[sliders[2] cell] _setColorSliderCellValues: hue : saturation : brightness]; [sliders[0] setNeedsDisplay: YES]; [sliders[1] setNeedsDisplay: YES]; [sliders[2] setNeedsDisplay: YES]; updating = NO; } -(void) _setColorFromValues { float hue = values[0] / 360; float saturation = values[1] / 100; float brightness = values[2] / 100; float alpha = [_colorPanel alpha]; NSColor *c = [NSColor colorWithCalibratedHue: hue saturation: saturation brightness: brightness alpha: alpha]; [_colorPanel setColor: c]; [(GSColorSliderCell *)[sliders[0] cell] _setColorSliderCellValues: hue : saturation : brightness]; [(GSColorSliderCell *)[sliders[1] cell] _setColorSliderCellValues: hue : saturation : brightness]; [(GSColorSliderCell *)[sliders[2] cell] _setColorSliderCellValues: hue : saturation : brightness]; [sliders[0] setNeedsDisplay: YES]; [sliders[1] setNeedsDisplay: YES]; [sliders[2] setNeedsDisplay: YES]; } - (void) loadViews { [super loadViews]; [sliders[0] setMaxValue: 360]; [sliders[1] setMaxValue: 100]; [sliders[2] setMaxValue: 100]; [(GSColorSliderCell *)[sliders[0] cell] _setColorSliderCellMode: 8]; [(GSColorSliderCell *)[sliders[1] cell] _setColorSliderCellMode: 9]; [(GSColorSliderCell *)[sliders[2] cell] _setColorSliderCellMode: 10]; } @end gnustep-gui-0.24.0/ColorPickers/GSRGBColorPicker.tiff0000664000076500007650000000733207557546257022247 0ustar brains99brains99II*ˆ ÿÿÿÿ ÿ( ÿ0 ÿ8 ÿ@ÿHÿPÿXÿ`ÿhÿpÿyÿÿ‰ ÿ‘"ÿÿÿÿÿÿÿÿÿ©(ÿ±*ÿ¹,ÿÁ .ÿÉ 0ÿÑ 2ÿÙ 4ÿá 6ÿÿÿÿÿ ÿ( ÿ0 ÿ8 ÿ@ÿHÿPÿXÿ`ÿhÿpÿyÿÿ‰ ÿ‘"ÿÿÿÿÿÿÿÿÿ©(ÿ±*ÿ¹,ÿÁ .ÿÉ 0ÿÑ 2ÿÙ 4ÿá 6ÿÿÿÿÿ ÿ( ÿ0 ÿ8 ÿ@ÿHÿPÿXÿ`ÿhÿpÿyÿÿ‰ ÿ‘"ÿÿÿÿÿÿÿÿÿ©(ÿ±*ÿ¹,ÿÁ .ÿÉ 0ÿÑ 2ÿÙ 4ÿá 6ÿÿÿÿÿ ÿ( ÿ0 ÿ8 ÿ@ÿHÿPÿXÿ`ÿhÿpÿyÿÿ‰ ÿ‘"ÿÿÿÿÿÿÿÿÿ©(ÿ±*ÿ¹,ÿÁ .ÿÉ 0ÿÑ 2ÿÙ 4ÿá 6ÿÿÿÿÿ ÿ( ÿ0 ÿ8 ÿ@ÿHÿPÿXÿ`ÿhÿpÿyÿÿ‰ ÿ‘"ÿ™$ÿ¡&ÿ©(ÿ±*ÿ¹,ÿÁ .ÿÉ 0ÿÑ 2ÿÙ 4ÿá 6ÿÿÿÿÿ ÿ(ÿ0ÿÿÿÿÿÿÿÿÿ Hÿ Pÿ Xÿ`ÿhÿpÿyÿÿ‰ÿ‘ÿ™ÿ¡ÿ©ÿ±ÿ¹ÿÁ ÿÉ ÿÑ ÿÙ ÿ á ÿÿÿÿÿ ÿ(ÿ0ÿÿÿÿÿÿÿÿÿ Hÿ Pÿ Xÿ`ÿhÿpÿyÿÿ‰ÿ‘ÿ™ÿ¡ÿ©ÿ±ÿ¹ÿÁ ÿÉ ÿÑ ÿÙ ÿ á ÿÿÿÿÿ ÿ(ÿ0ÿÿÿÿÿÿÿÿÿ Hÿ Pÿ Xÿ`ÿhÿpÿyÿÿ‰ÿ‘ÿ™ÿ¡ÿ©ÿ±ÿ¹ÿÁ ÿÉ ÿÑ ÿÙ ÿ á ÿÿÿÿÿ ÿ(ÿ0ÿÿÿÿÿÿÿÿÿ Hÿ Pÿ Xÿ`ÿhÿpÿyÿÿ‰ÿ‘ÿ™ÿ¡ÿ©ÿ±ÿ¹ÿÁ ÿÉ ÿÑ ÿÙ ÿ á ÿÿÿÿÿ ÿ(ÿ0ÿ8ÿ @ÿ Hÿ Pÿ Xÿ`ÿhÿpÿyÿÿ‰ÿ‘ÿ™ÿ¡ÿ©ÿ±ÿ¹ÿÁ ÿÉ ÿÑ ÿÙ ÿ á ÿÿÿÿÿ ÿ(ÿ0ÿ8ÿ@ÿ Hÿ Pÿ Xÿ `ÿÿÿÿÿÿÿÿÿyÿÿ‰ÿ‘ÿ™ÿ¡ÿ©ÿ±ÿ¹ÿ Áÿ Éÿ Ñÿ Ùÿ áÿÿÿÿÿ ÿ(ÿ0ÿ8ÿ@ÿ Hÿ Pÿ Xÿ `ÿÿÿÿÿÿÿÿÿyÿÿ‰ÿ‘ÿ™ÿ¡ÿ©ÿ±ÿ¹ÿ Áÿ Éÿ Ñÿ Ùÿ áÿÿÿÿÿ ÿ(ÿ0ÿ8ÿ@ÿ Hÿ Pÿ Xÿ `ÿÿÿÿÿÿÿÿÿyÿÿ‰ÿ‘ÿ™ÿ¡ÿ©ÿ±ÿ¹ÿ Áÿ Éÿ Ñÿ Ùÿ áÿÿÿÿÿ ÿ(ÿ0ÿ8ÿ@ÿ Hÿ Pÿ Xÿ `ÿÿÿÿÿÿÿÿÿyÿÿ‰ÿ‘ÿ™ÿ¡ÿ©ÿ±ÿ¹ÿ Áÿ Éÿ Ñÿ Ùÿ áÿÿÿÿÿ ÿ(ÿ0ÿ8ÿ@ÿ Hÿ Pÿ Xÿ `ÿ hÿpÿyÿÿ‰ÿ‘ÿ™ÿ¡ÿ©ÿ±ÿ¹ÿ Áÿ Éÿ Ñÿ Ùÿ áÿþ$f Fn´@€ ÊÒ(R/home/pyr/gnustep/gnustep/core/gui/ColorPickers/GSRGBColorPicker.tiffCreated with The GIMPHHgnustep-gui-0.24.0/ColorPickers/GSHSBColorPicker.tiff0000664000076500007650000000733207557546257022251 0ustar brains99brains99II*ˆ ÿÿÿ4ÿÿiÿÿžÿÿÓÿöÿÿÁÿÿŒÿÿWÿÿ#ÿÿÿÿÿFÿÿ{ÿÿ¯ÿÿäÿäÿÿ¯ÿÿ{ÿÿFÿÿÿÿÿÿÿÿÿÿÿÿŒÿÿÁÿÿöÿÿÿÓÿÿžÿÿiÿÿ4ÿÿÿÿ4ÿÿiÿÿžÿÿÓÿöÿÿÁÿÿŒÿÿWÿÿ#ÿÿÿÿÿFÿÿ{ÿÿ¯ÿÿäÿäÿÿ¯ÿÿ{ÿÿFÿÿÿÿÿÿÿÿÿÿÿÿŒÿÿÁÿÿöÿÿÿÓÿÿžÿÿiÿÿ4ÿÿÿÿ4ÿÿiÿÿžÿÿÓÿöÿÿÁÿÿŒÿÿWÿÿ#ÿÿÿÿÿFÿÿ{ÿÿ¯ÿÿäÿäÿÿ¯ÿÿ{ÿÿFÿÿÿÿÿÿÿÿÿÿÿÿŒÿÿÁÿÿöÿÿÿÓÿÿžÿÿiÿÿ4ÿÿÿÿ4ÿÿiÿÿžÿÿÓÿöÿÿÁÿÿŒÿÿWÿÿ#ÿÿÿÿÿFÿÿ{ÿÿ¯ÿÿäÿäÿÿ¯ÿÿ{ÿÿFÿÿÿÿÿÿÿÿÿÿÿÿŒÿÿÁÿÿöÿÿÿÓÿÿžÿÿiÿÿ4ÿÿÿÿ4ÿÿiÿÿžÿÿÓÿöÿÿÁÿÿŒÿÿWÿÿ#ÿÿÿÿÿFÿÿ{ÿÿ¯ÿÿäÿäÿÿ¯ÿÿ{ÿÿFÿÿÿÿ#ÿÿWÿÿŒÿÿÁÿÿöÿÿÿÓÿÿžÿÿiÿÿ4ÿÿÿÿÿþ÷÷ÿýïïÿýççÿüßßÿü××ÿûÏÏÿÿÿÿÿÿÿÿÿú··ÿù°°ÿø¨¨ÿø  ÿ÷˜˜ÿ÷ÿöˆˆÿö€€ÿõxxÿõppÿôhhÿóaaÿóYYÿòQQÿòIIÿñAAÿñ99ÿð11ÿð))ÿï!!ÿÿÿÿÿþ÷÷ÿýïïÿýççÿüßßÿü××ÿûÏÏÿÿÿÿÿÿÿÿÿú··ÿù°°ÿø¨¨ÿø  ÿ÷˜˜ÿ÷ÿöˆˆÿö€€ÿõxxÿõppÿôhhÿóaaÿóYYÿòQQÿòIIÿñAAÿñ99ÿð11ÿð))ÿï!!ÿÿÿÿÿþ÷÷ÿýïïÿýççÿüßßÿü××ÿûÏÏÿÿÿÿÿÿÿÿÿú··ÿù°°ÿø¨¨ÿø  ÿ÷˜˜ÿ÷ÿöˆˆÿö€€ÿõxxÿõppÿôhhÿóaaÿóYYÿòQQÿòIIÿñAAÿñ99ÿð11ÿð))ÿï!!ÿÿÿÿÿþ÷÷ÿýïïÿýççÿüßßÿü××ÿûÏÏÿÿÿÿÿÿÿÿÿú··ÿù°°ÿø¨¨ÿø  ÿ÷˜˜ÿ÷ÿöˆˆÿö€€ÿõxxÿõppÿôhhÿóaaÿóYYÿòQQÿòIIÿñAAÿñ99ÿð11ÿð))ÿï!!ÿÿÿÿÿþ÷÷ÿýïïÿýççÿüßßÿü××ÿûÏÏÿûÇÇÿú¿¿ÿú··ÿù°°ÿø¨¨ÿø  ÿ÷˜˜ÿ÷ÿöˆˆÿö€€ÿõxxÿõppÿôhhÿóaaÿóYYÿòQQÿòIIÿñAAÿñ99ÿð11ÿð))ÿï!!ÿÿÿÿÿ###ÿ+++ÿ444ÿ===ÿFFFÿOOOÿWWWÿ```ÿÿÿÿÿÿÿÿÿ{{{ÿƒƒƒÿŒŒŒÿ•••ÿžžžÿ§§§ÿ¯¯¯ÿ¸¸¸ÿÁÁÁÿÊÊÊÿÓÓÓÿÛÛÛÿäääÿíííÿöööÿÿÿÿÿ###ÿ+++ÿ444ÿ===ÿFFFÿOOOÿWWWÿ```ÿÿÿÿÿÿÿÿÿ{{{ÿƒƒƒÿŒŒŒÿ•••ÿžžžÿ§§§ÿ¯¯¯ÿ¸¸¸ÿÁÁÁÿÊÊÊÿÓÓÓÿÛÛÛÿäääÿíííÿöööÿÿÿÿÿ###ÿ+++ÿ444ÿ===ÿFFFÿOOOÿWWWÿ```ÿÿÿÿÿÿÿÿÿ{{{ÿƒƒƒÿŒŒŒÿ•••ÿžžžÿ§§§ÿ¯¯¯ÿ¸¸¸ÿÁÁÁÿÊÊÊÿÓÓÓÿÛÛÛÿäääÿíííÿöööÿÿÿÿÿ###ÿ+++ÿ444ÿ===ÿFFFÿOOOÿWWWÿ```ÿÿÿÿÿÿÿÿÿ{{{ÿƒƒƒÿŒŒŒÿ•••ÿžžžÿ§§§ÿ¯¯¯ÿ¸¸¸ÿÁÁÁÿÊÊÊÿÓÓÓÿÛÛÛÿäääÿíííÿöööÿÿÿÿÿ###ÿ+++ÿ444ÿ===ÿFFFÿOOOÿWWWÿ```ÿiiiÿrrrÿ{{{ÿƒƒƒÿŒŒŒÿ•••ÿžžžÿ§§§ÿ¯¯¯ÿ¸¸¸ÿÁÁÁÿÊÊÊÿÓÓÓÿÛÛÛÿäääÿíííÿöööÿþ$f Fn´@€ ÊÒ(R/home/pyr/gnustep/gnustep/core/gui/ColorPickers/GSHSBColorPicker.tiffCreated with The GIMPHHgnustep-gui-0.24.0/ColorPickers/Swedish.lproj/0000775000076500007650000000000012256227331021077 5ustar brains99brains99gnustep-gui-0.24.0/ColorPickers/Swedish.lproj/StandardPicker.strings0000664000076500007650000000175010377004044025407 0ustar brains99brains99/*** Swedish.lproj/StandardPicker.strings updated by make_strings 2002-05-23 16:24:57 +0200 add comments above this one ***/ /*** Unmatched/untranslated keys ***/ /* File: GSCMYKColorPicker.m:47 */ /* Flag: untranslated */ "Cyan" = "Cyan"; /* File: GSCMYKColorPicker.m:48 */ /* Flag: untranslated */ "Magenta" = "Magenta"; /*** Strings from GSCMYKColorPicker.m ***/ /* File: GSCMYKColorPicker.m:50 */ "Black" = "Svart"; /* File: GSCMYKColorPicker.m:49 */ "Yellow" = "Gul"; /*** Strings from GSGrayColorPicker.m ***/ /* File: GSGrayColorPicker.m:50 */ "White" = "Vit"; /*** Strings from GSHSBColorPicker.m ***/ /* File: GSHSBColorPicker.m:49 */ "Brightness" = "Ljus"; /* File: GSHSBColorPicker.m:47 */ "Hue" = "Nyans"; /* File: GSHSBColorPicker.m:48 */ "Saturation" = "M\u00e4ttnad"; /*** Strings from GSRGBColorPicker.m ***/ /* File: GSRGBColorPicker.m:50 */ "Blue" = "Bl\ue5"; /* File: GSRGBColorPicker.m:49 */ "Green" = "G\u00f6n"; /* File: GSRGBColorPicker.m:48 */ "Red" = "R\u00f6d"; gnustep-gui-0.24.0/ColorPickers/GSWheelColorPicker.m0000664000076500007650000002441011651651245022161 0ustar brains99brains99/* GSWheelColorPicker.m Copyright (C) 2001 Free Software Foundation, Inc. Author: Fred Kiefer Date: Febuary 2001 Author: Alexander Malmberg Date: May 2002 This file is part of GNUstep. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #ifndef PI #define PI 3.141592653589793 #endif #include #include #include #include "GSStandardColorPicker.h" @interface GSColorWheelMarker : NSView { } @end @implementation GSColorWheelMarker : NSView -(BOOL) isOpaque { return YES; } -(void) drawRect: (NSRect)rect { NSRect bounds = [self bounds]; [[NSColor whiteColor] set]; NSRectFill(bounds); [[NSColor blackColor] set]; NSFrameRect(bounds); } @end @interface GSColorWheel : NSView { float hue, saturation, brightness; id target; SEL action; GSColorWheelMarker *marker; NSImage *image; } -(float) hue; -(float) saturation; -(void) regenerateImage; -(NSRect) markerRect; -(void) setHue: (float)h saturation: (float)s brightness: (float)brightness; -(void) setTarget: (id)t; -(void) setAction: (SEL)a; @end @implementation GSColorWheel -(id) initWithFrame: (NSRect)frame { self = [super initWithFrame: frame]; if (nil == self) { return nil; } [self setPostsFrameChangedNotifications: YES]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(_frameChanged:) name: NSViewFrameDidChangeNotification object: self]; return self; } -(void) _frameChanged: (id)sender { [self regenerateImage]; [marker setFrame: [self markerRect]]; } -(void) dealloc { [image release]; [[NSNotificationCenter defaultCenter] removeObserver: self]; [super dealloc]; } -(void) setTarget: (id)t { target = t; } -(void) setAction: (SEL)a { action = a; } -(float) hue { return hue; } -(float) saturation { return saturation; } -(NSRect) markerRect { NSRect frame = [self bounds]; float a,r,x,y,cr,cx,cy; cx = (frame.origin.x + frame.size.width) / 2; cy = (frame.origin.y + frame.size.height) / 2; cr = frame.size.width; if (cr > frame.size.height) cr = frame.size.height; cr = cr / 2 - 2; a = hue * 2 * PI; r = saturation * cr; x = cos(a) * r + cx; y = sin(a) * r + cy; return NSMakeRect(x-2,y-2,4,4); } -(void) setHue: (float)h saturation: (float)s brightness: (float)b { if (nil == marker) { marker = [[[GSColorWheelMarker alloc] initWithFrame: [self markerRect]] autorelease]; [self addSubview: marker]; } if (hue != h || saturation != s || brightness != b) { BOOL regenerate = (brightness != b); hue = h; saturation = s; brightness = b; if (regenerate) [self regenerateImage]; [marker setFrame: [self markerRect]]; [self setNeedsDisplay: YES]; } } -(void) regenerateImage { NSSize size = [self convertSizeToBase: [self bounds].size]; CGFloat cx, cy, cr; [image release]; image = nil; cx = (size.width) / 2; cy = (size.height) / 2; cr = size.width; if (cr > size.height) cr = size.height; cr = cr / 2 - 2; { NSUInteger width = size.width; NSUInteger height = size.height; NSUInteger bytesPerRow; NSBitmapImageRep *bmp; unsigned char *data; NSUInteger x, y; if (width < 1 || height < 1) return; bmp = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes: NULL pixelsWide: width pixelsHigh: height bitsPerSample: 8 samplesPerPixel: 4 hasAlpha: YES isPlanar: NO colorSpaceName: NSCalibratedRGBColorSpace bytesPerRow: 0 bitsPerPixel: 32]; bytesPerRow = [bmp bytesPerRow]; data = [bmp bitmapData]; for (y = 0; y < height; y++) { uint32_t *row = (uint32_t*)(data + (y * bytesPerRow)); for (x = 0; x < width; x++) { CGFloat dx, dy, dist; CGFloat h, s, v; CGFloat R, G, B, A; dx = x - cx; dy = cy - y; // compensate for flipped coordinates dist = sqrt(dx * dx + dy * dy); // calculate h,s,v from x,y { h = atan2(dy, dx) / 2.0 / PI; if (h < 0) h += 1; s = dist/cr; if (s > 1) s = 1; v = brightness; } // calculate R,G,B from h,s,v { int I = (int)(h * 6); CGFloat V = v; CGFloat S = s; CGFloat F = (h * 6) - I; CGFloat M = V * (1 - S); CGFloat N = V * (1 - S * F); CGFloat K = M - N + V; switch (I) { default: R = V; G = K; B = M; break; case 1: R = N; G = V; B = M; break; case 2: R = M; G = V; B = K; break; case 3: R = M; G = N; B = V; break; case 4: R = K; G = M; B = V; break; case 5: R = V; G = M; B = N; break; } } // calculate alpha { A = (cr - dist) + 0.5; if (A > 1) A = 1; if (A < 0) A = 0; } // premultiply color with alpha R *= A; G *= A; B *= A; // store pixel #if GS_WORDS_BIGENDIAN row[x] = ((uint32_t)(255 * R) << 24) | (((uint32_t)(255 * G)) << 16) | (((uint32_t)(255 * B)) << 8) | (((uint32_t)(255 * A))); #else row[x] = ((uint32_t)(255 * R)) | (((uint32_t)(255 * G)) << 8) | (((uint32_t)(255 * B)) << 16) | (((uint32_t)(255 * A)) << 24); #endif } } image = [[NSImage alloc] initWithSize: [self bounds].size]; [image addRepresentation: bmp]; [bmp release]; } } -(void) drawRect: (NSRect)rect { if (nil == image) { [self regenerateImage]; } [image drawInRect: [self bounds] fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0]; } -(BOOL) acceptsFirstMouse: (NSEvent *)theEvent { return YES; } -(BOOL) acceptsFirstResponder { return NO; } -(void) handleMouseAtPoint: (NSPoint)point { NSRect frame = [self bounds]; CGFloat cx, cy, cr, dx, dy, new_hue, new_saturation; cx = (frame.origin.x + frame.size.width) / 2; cy = (frame.origin.y + frame.size.height) / 2; cr = frame.size.width; if (cr > frame.size.height) cr = frame.size.height; cr = cr / 2 - 2; dx = point.x - cx; dy = point.y - cy; new_saturation = sqrt(dx * dx + dy * dy) / cr; if (new_saturation > 1) new_saturation = 1; new_hue = atan2(dy, dx) / 2.0 / PI; if (new_hue < 0) new_hue += 1; [self setHue: new_hue saturation: new_saturation brightness: brightness]; if (target) { [target performSelector: action withObject: self]; } } -(void) mouseDown: (NSEvent *)theEvent { if ([theEvent type] == NSLeftMouseDown) { [self handleMouseAtPoint: [self convertPoint: [theEvent locationInWindow] fromView: nil]]; } } -(void) mouseDragged: (NSEvent *)theEvent { if ([theEvent type] == NSLeftMouseDragged) { [self handleMouseAtPoint: [self convertPoint: [theEvent locationInWindow] fromView: nil]]; } } @end @interface GSWheelColorPicker: NSColorPicker { GSHbox *baseView; NSSlider *brightnessSlider; GSColorWheel *wheel; } - (void) sliderChanged: (id) sender; - (void) loadViews; @end @implementation GSWheelColorPicker - (void) dealloc { RELEASE(baseView); [super dealloc]; } - (id)initWithPickerMask:(int)aMask colorPanel:(NSColorPanel *)colorPanel { if (aMask & NSColorPanelWheelModeMask) return [super initWithPickerMask: aMask colorPanel: colorPanel]; RELEASE(self); return nil; } - (int)currentMode { return NSWheelModeColorPanel; } - (BOOL)supportsMode:(int)mode { return mode == NSWheelModeColorPanel; } - (NSView *)provideNewView:(BOOL)initialRequest { if (initialRequest) { [self loadViews]; } return baseView; } - (void)setColor:(NSColor *)color { CGFloat hue, saturation, brightness, alpha; NSColor *c; c = [color colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; [c getHue: &hue saturation: &saturation brightness: &brightness alpha: &alpha]; [(GSColorSliderCell *)[brightnessSlider cell] _setColorSliderCellValues: hue : saturation : brightness]; [brightnessSlider setNeedsDisplay: YES]; [brightnessSlider setFloatValue: brightness]; [wheel setHue: hue saturation: saturation brightness: brightness]; } - (void) loadViews { NSSlider *s; NSCell *c; baseView = [[GSHbox alloc] init]; [baseView setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)]; wheel = [[GSColorWheel alloc] init]; [wheel setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [wheel setTarget: self]; [wheel setAction: @selector(sliderChanged:)]; [baseView addView: wheel]; s = brightnessSlider = [[NSSlider alloc] initWithFrame: NSMakeRect(0,0,16,0)]; [s setAutoresizingMask: NSViewHeightSizable]; c = [[GSColorSliderCell alloc] init]; [s setCell: c]; RELEASE(c); [(GSColorSliderCell *)[s cell] _setColorSliderCellMode: 10]; [s setContinuous: YES]; [s setMinValue: 0.0]; [s setMaxValue: 1.0]; [s setTarget: self]; [s setAction: @selector(sliderChanged:)]; [[s cell] setBezeled: YES]; [baseView addView: brightnessSlider enablingXResizing: NO]; } - (void) sliderChanged: (id) sender { float brightness = [brightnessSlider floatValue]; float hue = [wheel hue]; float saturation = [wheel saturation]; float alpha = [_colorPanel alpha]; NSColor *c; [(GSColorSliderCell *)[brightnessSlider cell] _setColorSliderCellValues: hue : saturation : brightness]; [brightnessSlider setNeedsDisplay: YES]; c = [NSColor colorWithCalibratedHue: hue saturation: saturation brightness: brightness alpha: alpha]; [_colorPanel setColor: c]; } @end gnustep-gui-0.24.0/ColorPickers/GSNamedColorPicker.m0000664000076500007650000001355712102212557022142 0ustar brains99brains99/* GSNamedColorPicker.m Copyright (C) 2001 Free Software Foundation, Inc. Author: Fred Kiefer Date: January 2001 This file is part of GNUstep. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import @interface GSNamedColorPicker: NSColorPicker { NSView *baseView; NSComboBox *cb; NSBrowser *browser; NSColorList *currentList; NSMutableArray *lists; } - (void) loadViews; - (void) listSelected: (int)index; - (void) colorSelected: (id)sender; @end @implementation GSNamedColorPicker - (id) initWithPickerMask: (int)aMask colorPanel: (NSColorPanel *)colorPanel { if (aMask & NSColorPanelColorListModeMask) { self = [super initWithPickerMask: aMask colorPanel: colorPanel]; if (nil == self) return nil; lists = [[NSColorList availableColorLists] mutableCopy]; return self; } RELEASE(self); return nil; } - (void) dealloc { RELEASE(cb); RELEASE(browser); RELEASE(baseView); RELEASE(lists); [super dealloc]; } - (void) finishInstantiate { } - (void) attachColorList: (NSColorList *)colorList { [lists addObject: colorList]; [cb noteNumberOfItemsChanged]; } - (void) detachColorList: (NSColorList *)colorList { [lists removeObjectIdenticalTo: colorList]; [cb noteNumberOfItemsChanged]; } - (int) currentMode { return NSColorListModeColorPanel; } - (BOOL) supportsMode: (int)mode { return mode == NSColorListModeColorPanel; } - (NSView *) provideNewView: (BOOL)initialRequest { if (initialRequest) { [self loadViews]; } return baseView; } - (void) setColor: (NSColor *)color { NSColor *c = [color colorUsingColorSpaceName: NSNamedColorSpace]; NSString *list; NSString *name; NSUInteger index; if (c == nil) return; list = [c catalogNameComponent]; name = [c colorNameComponent]; // Select the correspondig entries in the lists index = [self comboBox: cb indexOfItemWithStringValue: list]; if (index == NSNotFound) return; [cb selectItemAtIndex: index]; index = [[currentList allKeys] indexOfObject: name]; if (index == NSNotFound) return; [browser selectRow: index inColumn: 0]; } - (void) loadViews { baseView = [[NSView alloc] initWithFrame: NSMakeRect(0, 0, 200, 110)]; [baseView setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)]; cb = [[NSComboBox alloc] initWithFrame: NSMakeRect(0, 85, 196, 20)]; [cb setAutoresizingMask: (NSViewWidthSizable | NSViewMinYMargin)]; [cb setUsesDataSource: YES]; [cb setDataSource: self]; [cb setDelegate: self]; [cb setEditable: NO]; [baseView addSubview: cb]; browser = [[NSBrowser alloc] initWithFrame: NSMakeRect(0, 5, 196, 75)]; [browser setDelegate: self]; [browser setMaxVisibleColumns: 1]; [browser setAllowsMultipleSelection: NO]; [browser setAllowsEmptySelection: NO]; [browser setHasHorizontalScroller: NO]; [browser setTitled: NO]; [browser setTakesTitleFromPreviousColumn: NO]; [browser setPath: @"/"]; [browser setTarget: self]; [browser setDoubleAction: @selector(colorSelected:)]; [browser setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)]; [baseView addSubview: browser]; } - (void) listSelected: (int)index { currentList = [lists objectAtIndex: index]; [browser loadColumnZero]; } - (void) colorSelected: (id)sender { NSCell *aCell; NSColor *col; aCell = [sender selectedCell]; col = [aCell representedObject]; [_colorPanel setColor: col]; } -(NSString *) browser: (NSBrowser *)sender titleOfColumn: (NSInteger)column { return nil; } -(void) browser: (NSBrowser *)sender createRowsForColumn: (NSInteger)column inMatrix: (NSMatrix *)matrix { int i; int count; NSBrowserCell *cell; NSColor *cl; NSArray *keys = [currentList allKeys]; NSString *name; count = [keys count]; //NSLog(@"In create with %@ %d", currentList, count); if (count) { [matrix addColumn]; for (i = 0; i < count; i++) { if (i > 0) [matrix addRow]; name = [keys objectAtIndex: i]; //cl = [currentList colorWithKey: name]; cl = [NSColor colorWithCatalogName: [currentList name] colorName: name]; cell = [matrix cellAtRow: i column: 0]; [cell setStringValue: name]; [cell setRepresentedObject: cl]; [cell setLeaf: YES]; } } } - (BOOL) browser: (NSBrowser*)sender selectRow: (NSInteger)row inColumn: (NSInteger)column { return NO; } - (void) browser: (NSBrowser *)sender willDisplayCell: (id)cell atRow: (NSInteger)row column: (NSInteger)column { } - (NSInteger) numberOfItemsInComboBox: (NSComboBox *)aComboBox { return [lists count]; } - (id) comboBox: (NSComboBox *)aComboBox objectValueForItemAtIndex: (NSInteger)index { return [(NSColorList*)[lists objectAtIndex: index] name]; } - (NSUInteger) comboBox: (NSComboBox *)aComboBox indexOfItemWithStringValue: (NSString *)string { return [lists indexOfObject: [NSColorList colorListNamed: string]]; } - (void) comboBoxSelectionDidChange: (NSNotification *)notification { [self listSelected: [cb indexOfSelectedItem]]; } @end gnustep-gui-0.24.0/ColorPickers/GSStandardColorPicker.m0000664000076500007650000002712411537161034022655 0ustar brains99brains99/* GSStandardColorPicker.m Copyright (C) 2001 Free Software Foundation, Inc. Author: Fred Kiefer Date: Febuary 2001 Author: Alexander Malmberg Date: May 2002 This file is part of GNUstep. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import #import "GSRGBColorPicker.h" #import "GSHSBColorPicker.h" #import "GSCMYKColorPicker.h" #import "GSGrayColorPicker.h" #import "GSStandardColorPicker.h" @implementation GSStandardColorPicker - (void) dealloc { RELEASE(pickers); RELEASE(pickerBox); RELEASE(pickerMatrix); RELEASE(baseView); [super dealloc]; } - (id)initWithPickerMask:(int)aMask colorPanel:(NSColorPanel *)colorPanel { if (aMask & (NSColorPanelRGBModeMask | NSColorPanelHSBModeMask | NSColorPanelCMYKModeMask | NSColorPanelGrayModeMask)) { NSColorPicker *picker; pickers = [[NSMutableArray alloc] init]; picker = [[GSGrayColorPicker alloc] initWithPickerMask: aMask colorPanel: colorPanel]; if (picker != nil) { [pickers addObject: picker]; RELEASE(picker); } picker = [[GSRGBColorPicker alloc] initWithPickerMask: aMask colorPanel: colorPanel]; if (picker != nil) { [pickers addObject: picker]; RELEASE(picker); } picker = [[GSCMYKColorPicker alloc] initWithPickerMask: aMask colorPanel: colorPanel]; if (picker != nil) { [pickers addObject: picker]; RELEASE(picker); } picker = [[GSHSBColorPicker alloc] initWithPickerMask: aMask colorPanel: colorPanel]; if (picker != nil) { [pickers addObject: picker]; RELEASE(picker); } currentPicker = [pickers lastObject]; return [super initWithPickerMask: aMask colorPanel: colorPanel]; } RELEASE(self); return nil; } - (int)currentMode { return [currentPicker currentMode]; } - (void)setMode:(int)mode { int i, count; if (mode == [self currentMode]) return; count = [pickers count]; for (i = 0; i < count; i++) { if ([[pickers objectAtIndex: i] supportsMode: mode]) { [pickerMatrix selectCellWithTag: i]; [self _showNewPicker: pickerMatrix]; [currentPicker setMode: mode]; break; } } } - (BOOL)supportsMode:(int)mode { return ((mode == NSGrayModeColorPanel) || (mode == NSRGBModeColorPanel) || (mode == NSCMYKModeColorPanel) || (mode == NSHSBModeColorPanel)); } - (void)insertNewButtonImage:(NSImage *)newImage in:(NSButtonCell *)newButtonCell { // Store the image button cell imageCell = newButtonCell; [super insertNewButtonImage: newImage in: newButtonCell]; } - (NSView *)provideNewView:(BOOL)initialRequest { if (initialRequest) { [self loadViews]; } return baseView; } - (NSImage *)provideNewButtonImage { return [currentPicker provideNewButtonImage]; } - (void)setColor:(NSColor *)color { [currentPicker setColor: color]; } - (void) loadViews { NSEnumerator *enumerator; id picker; NSButtonCell *cell; NSMutableArray *cells = [NSMutableArray new]; int i, count; // Initaliase all the sub pickers enumerator = [pickers objectEnumerator]; while ((picker = [enumerator nextObject]) != nil) [picker provideNewView: YES]; baseView = [[GSTable alloc] initWithNumberOfRows: 3 numberOfColumns: 1]; [baseView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [baseView setYResizingEnabled: NO forRow: 1]; [baseView setYResizingEnabled: NO forRow: 2]; // Prototype cell for the matrix cell = [[NSButtonCell alloc] initImageCell: nil]; [cell setButtonType: NSOnOffButton]; [cell setBordered: YES]; pickerMatrix = [[NSMatrix alloc] initWithFrame: NSMakeRect(0,0,0,0) mode: NSRadioModeMatrix prototype: cell numberOfRows: 0 numberOfColumns: 0]; RELEASE(cell); [pickerMatrix setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)]; [pickerMatrix setIntercellSpacing: NSMakeSize(1, 0)]; [pickerMatrix setAutosizesCells: YES]; count = [pickers count]; for (i = 0; i < count; i++) { cell = [[pickerMatrix prototype] copy]; [cell setTag: i]; picker = [pickers objectAtIndex: i]; [picker insertNewButtonImage: [picker provideNewButtonImage] in: cell]; [cells addObject: cell]; RELEASE(cell); } [pickerMatrix addRowWithCells: cells]; RELEASE(cells); [pickerMatrix setCellSize: NSMakeSize(1, 36)]; [pickerMatrix setTarget: self]; [pickerMatrix setAction: @selector(_showNewPicker:)]; pickerBox = [[NSBox alloc] init]; [pickerBox setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [baseView putView: pickerBox atRow: 0 column: 0 withMargins: 0]; [pickerBox setTitlePosition: NSNoTitle]; [pickerBox setBorderType: NSNoBorder]; [pickerBox setContentView: [currentPicker provideNewView: NO]]; [baseView putView: pickerMatrix atRow: 1 column: 0 withMargins: 0]; { NSBox *b = [[NSBox alloc] initWithFrame: NSMakeRect(0,0,0,2)]; [b setAutoresizingMask: NSViewWidthSizable]; [b setTitlePosition: NSNoTitle]; [b setBorderType: NSGrooveBorder]; [baseView putView: b atRow: 2 column: 0 withMinXMargin: 0 maxXMargin: 0 minYMargin: 4 maxYMargin: 0]; DESTROY(b); } } - (void) _showNewPicker: (id) sender { currentPicker = [pickers objectAtIndex: [sender selectedColumn]]; [currentPicker setColor: [_colorPanel color]]; [pickerBox setContentView: [currentPicker provideNewView: NO]]; // Show the new image [imageCell setImage: [[sender selectedCell] image]]; } @end @implementation GSStandardCSColorPicker - (void) dealloc { int i; for (i = 0; i < numFields; i++) { RELEASE(sliders[i]); RELEASE(fields[i]); } RELEASE(baseView); [super dealloc]; } - (int)currentMode { return currentMode; } - (BOOL)supportsMode:(int)mode { return currentMode == NSRGBModeColorPanel; } - (NSView *)provideNewView:(BOOL)initialRequest { if (initialRequest) { [self loadViews]; } return baseView; } - (void)setColor:(NSColor *)color { [self subclassResponsibility: _cmd]; } - (void) loadViews { int i; baseView = [[GSTable alloc] initWithNumberOfRows: numFields + 2 numberOfColumns: 2]; /* keep a single resizable but empty row at the bottom so it sucks up any extra space in the box that contains us */ for (i = 1; i < numFields + 2; i++) [baseView setYResizingEnabled: NO forRow: i]; [baseView setXResizingEnabled: YES forColumn: 0]; [baseView setXResizingEnabled: NO forColumn: 1]; [baseView setAutoresizingMask: NSViewWidthSizable | NSViewMinYMargin]; for (i = 0; i < numFields; i++) { NSSlider *s; NSCell *c; s = sliders[i] = [[NSSlider alloc] initWithFrame: NSMakeRect(0, 0, 0, 16)]; c = [[GSColorSliderCell alloc] init]; [s setCell: c]; RELEASE(c); [s setContinuous: YES]; [s setMinValue: 0.0]; [s setTitle: names[i]]; [s setTarget: self]; [s setAction: @selector(sliderChanged:)]; [[s cell] setBezeled: YES]; [s setAutoresizingMask: NSViewWidthSizable]; [baseView putView: s atRow: numFields - i column: 0 withMinXMargin: 0 maxXMargin: 0 minYMargin: 0 maxYMargin: i?6:2]; } if (maxValue) { NSTextField *tv; GSHbox *hb=[[GSHbox alloc] init]; tv=[[NSTextField alloc] init]; [tv setStringValue: @"0"]; [tv setEditable: 0]; [tv setFont: [NSFont userFontOfSize: 10.0]]; [tv setTextColor: [NSColor darkGrayColor]]; [tv setDrawsBackground: NO]; [tv setBordered: NO]; [tv setSelectable: NO]; [tv setBezeled: NO]; [tv sizeToFit]; [tv setAutoresizingMask: NSViewMaxXMargin]; [hb addView: tv]; DESTROY(tv); tv=[[NSTextField alloc] init]; [tv setIntValue: maxValue]; [tv setEditable: 0]; [tv setFont: [NSFont userFontOfSize: 10.0]]; [tv setTextColor: [NSColor darkGrayColor]]; [tv setDrawsBackground: NO]; [tv setBordered: NO]; [tv setSelectable: NO]; [tv setBezeled: NO]; [tv sizeToFit]; [tv setAutoresizingMask: NSViewMinXMargin]; [hb addView: tv]; DESTROY(tv); [hb setAutoresizingMask: NSViewWidthSizable]; [baseView putView: hb atRow: numFields + 1 column: 0 withMargins: 0]; DESTROY(hb); } else { NSTextField *tv; NSView *v; NSRect frame; tv=[[NSTextField alloc] init]; [tv setStringValue: @"0"]; [tv setEditable: 0]; [tv setFont: [NSFont userFontOfSize: 10.0]]; [tv setTextColor: [NSColor darkGrayColor]]; [tv setDrawsBackground: NO]; [tv setBordered: NO]; [tv setSelectable: NO]; [tv setBezeled: NO]; [tv sizeToFit]; frame=[tv frame]; DESTROY(tv); v = [[NSView alloc] initWithFrame: frame]; [baseView putView: v atRow: numFields + 1 column: 0 withMargins: 0]; DESTROY(v); } for (i = 0; i < numFields; i++) { NSTextField *f; f = fields[i] = [[NSTextField alloc] init]; [f setStringValue: @"255"]; /* just to get a good size */ [f setFont: [NSFont userFontOfSize: 10.0]]; [f sizeToFit]; [f setFrameSize: NSMakeSize([f frame].size.width * 1.5, [f frame].size.height)]; [f setDelegate: self]; [baseView putView: f atRow: numFields - i column: 1 withMinXMargin: 3 maxXMargin: 0 minYMargin: 0 maxYMargin: 0]; } } - (void) sliderChanged: (id) sender { int i; if (updating) return; updating = YES; for (i = 0; i < numFields; i++) { values[i] = [sliders[i] floatValue]; [fields[i] setIntValue: (int)values[i]]; } [self _setColorFromValues]; updating = NO; } -(void) controlTextDidChange: (NSNotification *)n { int i; if (updating) return; updating = YES; for (i = 0; i < numFields; i++) { values[i] = [fields[i] floatValue]; [sliders[i] setIntValue: (int)values[i]]; } [self _setColorFromValues]; updating = NO; } -(void) _valuesChanged { int i; for (i = 0; i < numFields; i++) { [fields[i] setIntValue: (int)values[i]]; [sliders[i] setIntValue: (int)values[i]]; } } -(void) _setColorFromValues { [self subclassResponsibility: _cmd]; } @end gnustep-gui-0.24.0/ColorPickers/Spanish.lproj/0000775000076500007650000000000012256227331021076 5ustar brains99brains99gnustep-gui-0.24.0/ColorPickers/Spanish.lproj/StandardPicker.strings0000664000076500007650000000162011325727723025414 0ustar brains99brains99/*** Spanish.lproj/StandardPicker.strings updated by make_strings 2002-05-23 16:24:57 +0200 add comments above this one ***/ /*** Strings from GSCMYKColorPicker.m ***/ /* File: GSCMYKColorPicker.m:50 */ "Black" = "Negro"; /* File: GSCMYKColorPicker.m:47 */ "Cyan" = "Cyan"; /* File: GSCMYKColorPicker.m:48 */ "Magenta" = "Magenta"; /* File: GSCMYKColorPicker.m:49 */ "Yellow" = "Amarillo"; /*** Strings from GSGrayColorPicker.m ***/ /* File: GSGrayColorPicker.m:50 */ "White" = "Blanco"; /*** Strings from GSHSBColorPicker.m ***/ /* File: GSHSBColorPicker.m:49 */ "Brightness" = "Brillo"; /* File: GSHSBColorPicker.m:47 */ "Hue" = "Tinte"; /* File: GSHSBColorPicker.m:48 */ "Saturation" = "Saturaci\U00F3n"; /*** Strings from GSRGBColorPicker.m ***/ /* File: GSRGBColorPicker.m:50 */ "Blue" = "Azul"; /* File: GSRGBColorPicker.m:49 */ "Green" = "Verde"; /* File: GSRGBColorPicker.m:48 */ "Red" = "Rojo"; gnustep-gui-0.24.0/ColorPickers/English.lproj/0000775000076500007650000000000012256227331021062 5ustar brains99brains99gnustep-gui-0.24.0/ColorPickers/English.lproj/StandardPicker.strings0000664000076500007650000000161110377004044025366 0ustar brains99brains99/*** English.lproj/StandardPicker.strings updated by make_strings 2002-05-23 16:24:57 +0200 add comments above this one ***/ /*** Strings from GSCMYKColorPicker.m ***/ /* File: GSCMYKColorPicker.m:50 */ "Black" = "Black"; /* File: GSCMYKColorPicker.m:47 */ "Cyan" = "Cyan"; /* File: GSCMYKColorPicker.m:48 */ "Magenta" = "Magenta"; /* File: GSCMYKColorPicker.m:49 */ "Yellow" = "Yellow"; /*** Strings from GSGrayColorPicker.m ***/ /* File: GSGrayColorPicker.m:50 */ "White" = "White"; /*** Strings from GSHSBColorPicker.m ***/ /* File: GSHSBColorPicker.m:49 */ "Brightness" = "Brightness"; /* File: GSHSBColorPicker.m:47 */ "Hue" = "Hue"; /* File: GSHSBColorPicker.m:48 */ "Saturation" = "Saturation"; /*** Strings from GSRGBColorPicker.m ***/ /* File: GSRGBColorPicker.m:50 */ "Blue" = "Blue"; /* File: GSRGBColorPicker.m:49 */ "Green" = "Green"; /* File: GSRGBColorPicker.m:48 */ "Red" = "Red"; gnustep-gui-0.24.0/ColorPickers/GSWheelColorPicker.tiff0000664000076500007650000000512407476503562022666 0ustar brains99brains99II* ZTRqTLª0)ª !ªˆ-6ª‡W`ªYPRf ¬ˆiÆÙt9ÿïSÿÿBÿÿ0ÿÿ ÿÿ1ÿÿGÿôWÿÞO†ÿz;YŽ2019db^qªmÆð†ÿÿwÿÿi$ÿÿV+ÿÿE/ÿÿ25ÿÿ/Fÿÿ*[ÿÿ$jÿþ{ÿ÷"ÿÎ\Ÿã2&.9}rRŽæ±0ÿÿªÿÿŸ'ÿÿ4ÿÿ‚=ÿÿpEÿÿ_IÿÿLOÿÿI`ÿÿCuÿÿ<ƒÿÿ1”ÿÿ& ÿþ­ÿä9³ÿ3/9iidqàÄ>ÿûÇÿÿ¼*ÿÿ±8ÿÿ¢Fÿÿ–Pÿÿ„Yÿÿs]ÿÿadÿÿ]uÿÿW‰ÿÿP—ÿÿC¦ÿÿ7²ÿÿ&ÀÿþÊÿÕNÀã3(29 7Æÿêÿÿà)ÿÿÓ=ÿÿÈLÿÿº\ÿÿ®gÿÿrÿÿwÿÿ{~ÿÿwŽÿÿp¡ÿÿg®ÿÿX¾ÿÿKÉÿÿ8Öÿÿ(àÿüêÿß{Üè@BUàç+ÿýù$ÿÿñ6ÿÿäKÿÿÚ[ÿÿÌmÿÿÁyÿÿ±…ÿÿ¢‹ÿÿ“ÿÿ‹£ÿÿƒµÿÿyÁÿÿhÐÿÿZÚÿÿEçÿÿ4ñÿüûÿô5ýÿÊÚyÿÜûÿìÿ0ÿöÿCÿýøZÿÿðlÿÿã€ÿÿØÿÿÉÿÿ»¥ÿÿª­ÿÿ¤¼ÿÿšÍÿÿÙÿÿ{æÿÿjðÿüTûÿöBÿÿé*ÿÿßÿÿšNªª°Ö7ÿÎÿÿÛÿ8ÿåÿLÿòÿdÿúüwÿÿôÿÿêÿÿܯÿÿϸÿÿ¾Áÿÿ¸Ðÿÿ«àÿÿëÿþˆ÷ÿùvýÿï^ÿÿåJÿÿØ1ÿÿÍÿÿ†ªª/1,9›ãÿ¸ÿ%ÿÅÿ?ÿÏÿSÿÜÿmÿæÿ‚ÿóÿšÿûü­ÿÿòÃÿÿèÐÿÿØÛÿÿÏèÿþ½õÿú¬üÿð”ÿÿæ€ÿÿÙfÿÿÎRÿÿÂ8ÿÿ·#ÿÿ¾DÿÿK:UU‚†|ª—ùÿ¥ÿ(ÿ²ÿBÿ½ÿWÿÊÿrÿÔÿ†ÿáÿ ÿìÿµÿ÷þÎÿñìÕÿÚÊÍÿóÖïÿõÈþÿë´ÿÿÞšÿÿÔ…ÿÿÆkÿÿ¼Vÿÿ¯;ÿÿ¤&ÿÿ©7ÿÿC+UU|€wª‚ÿÿŒÿ(ÿšÿCÿ¤ÿXÿ±ÿrÿ¼ÿ‡ÿÉÿ¢ÿÓÿ·ÿàÿÑÿÐáÌÿiloŽÛÖîÿÝÊÿÿÓ¶ÿÿÆ›ÿÿ»†ÿÿ®kÿÿ£Vÿÿ–<ÿÿŒ'ÿÿ“4ÿÿ=(UUŠˆªhòÿxÿ'ÿ…ÿAÿÿVÿœÿpÿ¦ÿ„ÿ³ÿžÿ½ÿ²ÿÌÿÎÿ×üäÿÓêîÿÖâüÿÇÆÿÿ¼±ÿÿ°—ÿÿ¥ƒÿÿ™iÿÿŽTÿÿ‚:ÿÿw%ÿÿ‡;ÿÿ>0UUSÛÿ\ÿ"ÿhÿ;ÿrÿOÿ~ÿhÿˆÿ|ÿ–ÿ—ÿ¥ÿ°ÿ¸ÿÐÿÃÿçÿÇúýÿÂæÿÿ³Èÿÿ¤¯ÿÿ’ÿÿ‡{ÿÿ{bÿÿrNÿÿe5ÿÿ[ ÿÿf4ãã.*99oÜSÿDÿÿPÿ4ÿYÿHÿfÿaÿtÿyÿ‡ÿ™ÿ—ÿ´ÿ§ÿÑÿ¯ÿèÿ³úýÿ¯æÿÿ£Ëÿÿ–²ÿÿ‚‘ÿÿswÿÿbZÿÿYGÿÿM.ÿÿCÿÿD)ªªt¯mÆ,óÿ1ÿ+ÿ=ÿAÿRÿcÿbÿ~ÿvÿžÿƒÿ¶ÿÿÓÿ–ÿèÿ™úýÿ–çÿÿÌÿÿ‚µÿÿq–ÿÿb|ÿÿMZÿÿ<@ÿÿ-$ÿÿ*ÿÿLGqq:H:UQóQÿÿ+ÿ0ÿFÿEÿgÿTÿÿeÿ ÿqÿ·ÿ|ÿÓÿ‚ÿèÿ„úýÿ‚çÿÿzÌÿÿp¶ÿÿb™ÿÿSÿÿ@_ÿÿ/Dÿÿ"ÿÿSRÿÿHqJq%ÿBÿ ÿKÿ3ÿkÿAÿ„ÿPÿ¢ÿZÿ¸ÿdÿÓÿiÿèÿjúýÿhçÿÿbÍÿÿZ·ÿÿMšÿÿ@‚ÿÿ.cÿÿJÿÿ6Oÿÿ'+UU&Ž;ŽÿXÿ#ÿmÿ0ÿ†ÿ>ÿ£ÿGÿ¹ÿOÿÔÿTÿèÿUúýÿTçÿÿNÍÿÿG·ÿÿ;›ÿÿ/„ÿÿfÿÿNÿÿrÆÆq9q)ÿÿÿˆÿ'ÿ¤ÿ/ÿºÿ6ÿÔÿ:ÿèÿ;úýÿ:çÿÿ5Íÿÿ/¸ÿÿ$œÿÿ†ÿÿ3ÿÿm‰ÆÆFŽfŽMÿªÿÿ¤ÿÿºÿ"ÿÔÿ%ÿèÿ&úýÿ%çÿÿ!Íÿÿ¸ÿÿžÿÿM©ÿÿ$8UUeª’ªªƒªGÿßÿ7ÿìÿ2úýÿ9ëÿÿ;Éîî-޵µb„——"$&&=UQU+UQU&TTU-QUU2@DD þæ  @î . @ D L (R/home/fred/GNUstep/Library/ColorPickers/GSWheelColorPicker.tiffCreated with The GIMPHHgnustep-gui-0.24.0/ColorPickers/GSCMYKColorPicker.tiff0000664000076500007650000000733407557546257022402 0ustar brains99brains99II*ˆ ÿÿÿÿöþýÿíþûÿåþúÿÜýøÿÔýöÿËýõÿÃýóÿºüñÿ²üðÿ©üîÿ ûìÿ˜ûëÿûéÿ‡ûçÿ~úæÿvúäÿmúâÿeúáÿ\ùßÿSùÝÿÿÿÿÿÿÿÿÿ:øØÿ1ø×ÿ)øÕÿ ÷Óÿ÷Òÿ÷ÐÿÿÿÿÿöþýÿíþûÿåþúÿÜýøÿÔýöÿËýõÿÃýóÿºüñÿ²üðÿ©üîÿ ûìÿ˜ûëÿûéÿ‡ûçÿ~úæÿvúäÿmúâÿeúáÿ\ùßÿSùÝÿÿÿÿÿÿÿÿÿ:øØÿ1ø×ÿ)øÕÿ ÷Óÿ÷Òÿ÷ÐÿÿÿÿÿöþýÿíþûÿåþúÿÜýøÿÔýöÿËýõÿÃýóÿºüñÿ²üðÿ©üîÿ ûìÿ˜ûëÿûéÿ‡ûçÿ~úæÿvúäÿmúâÿeúáÿ\ùßÿSùÝÿÿÿÿÿÿÿÿÿ:øØÿ1ø×ÿ)øÕÿ ÷Óÿ÷Òÿ÷ÐÿÿÿÿÿöþýÿíþûÿåþúÿÜýøÿÔýöÿËýõÿÃýóÿºüñÿ²üðÿ©üîÿ ûìÿ˜ûëÿûéÿ‡ûçÿ~úæÿvúäÿmúâÿeúáÿ\ùßÿSùÝÿÿÿÿÿÿÿÿÿ:øØÿ1ø×ÿ)øÕÿ ÷Óÿ÷Òÿ÷ÐÿÿÿÿÿöþýÿíþûÿåþúÿÜýøÿÔýöÿËýõÿÃýóÿºüñÿ²üðÿ©üîÿ ûìÿ˜ûëÿûéÿ‡ûçÿ~úæÿvúäÿmúâÿeúáÿ\ùßÿSùÝÿKùÜÿBøÚÿ:øØÿ1ø×ÿ)øÕÿ ÷Óÿ÷Òÿ÷ÐÿþöþÿþîýÿþæýÿýÝüÿýÕûÿÿÿÿÿÿÿÿÿü¼ùÿü´øÿü¬øÿü¤÷ÿû›÷ÿû“öÿû‹õÿû‚ôÿúzôÿúróÿújòÿùaòÿùYñÿùQðÿùIðÿø@ïÿø8ïÿø0îÿø(íÿ÷ìÿ÷ìÿ÷ëÿþöþÿþîýÿþæýÿýÝüÿýÕûÿÿÿÿÿÿÿÿÿü¼ùÿü´øÿü¬øÿü¤÷ÿû›÷ÿû“öÿû‹õÿû‚ôÿúzôÿúróÿújòÿùaòÿùYñÿùQðÿùIðÿø@ïÿø8ïÿø0îÿø(íÿ÷ìÿ÷ìÿ÷ëÿþöþÿþîýÿþæýÿýÝüÿýÕûÿÿÿÿÿÿÿÿÿü¼ùÿü´øÿü¬øÿü¤÷ÿû›÷ÿû“öÿû‹õÿû‚ôÿúzôÿúróÿújòÿùaòÿùYñÿùQðÿùIðÿø@ïÿø8ïÿø0îÿø(íÿ÷ìÿ÷ìÿ÷ëÿþöþÿþîýÿþæýÿýÝüÿýÕûÿÿÿÿÿÿÿÿÿü¼ùÿü´øÿü¬øÿü¤÷ÿû›÷ÿû“öÿû‹õÿû‚ôÿúzôÿúróÿújòÿùaòÿùYñÿùQðÿùIðÿø@ïÿø8ïÿø0îÿø(íÿ÷ìÿ÷ìÿ÷ëÿþöþÿþîýÿþæýÿýÝüÿýÕûÿýÍúÿýÅúÿü¼ùÿü´øÿü¬øÿü¤÷ÿû›÷ÿû“öÿû‹õÿû‚ôÿúzôÿúróÿújòÿùaòÿùYñÿùQðÿùIðÿø@ïÿø8ïÿø0îÿø(íÿ÷ìÿ÷ìÿ÷ëÿÿÿÿÿþþöÿþþíÿþþåÿýýÜÿýýÔÿýýËÿýýÃÿüüºÿüü²ÿÿÿÿÿÿÿÿÿûû˜ÿûûÿûû‡ÿúú~ÿúúvÿúúmÿúúeÿùù\ÿùùSÿùùKÿøøBÿøø:ÿøø1ÿøø)ÿ÷÷ ÿ÷÷ÿ÷÷ÿÿÿÿÿþþöÿþþíÿþþåÿýýÜÿýýÔÿýýËÿýýÃÿüüºÿüü²ÿÿÿÿÿÿÿÿÿûû˜ÿûûÿûû‡ÿúú~ÿúúvÿúúmÿúúeÿùù\ÿùùSÿùùKÿøøBÿøø:ÿøø1ÿøø)ÿ÷÷ ÿ÷÷ÿ÷÷ÿÿÿÿÿþþöÿþþíÿþþåÿýýÜÿýýÔÿýýËÿýýÃÿüüºÿüü²ÿÿÿÿÿÿÿÿÿûû˜ÿûûÿûû‡ÿúú~ÿúúvÿúúmÿúúeÿùù\ÿùùSÿùùKÿøøBÿøø:ÿøø1ÿøø)ÿ÷÷ ÿ÷÷ÿ÷÷ÿÿÿÿÿþþöÿþþíÿþþåÿýýÜÿýýÔÿýýËÿýýÃÿüüºÿüü²ÿÿÿÿÿÿÿÿÿûû˜ÿûûÿûû‡ÿúú~ÿúúvÿúúmÿúúeÿùù\ÿùùSÿùùKÿøøBÿøø:ÿøø1ÿøø)ÿ÷÷ ÿ÷÷ÿ÷÷ÿÿÿÿÿþþöÿþþíÿþþåÿýýÜÿýýÔÿýýËÿýýÃÿüüºÿüü²ÿüü©ÿûû ÿûû˜ÿûûÿûû‡ÿúú~ÿúúvÿúúmÿúúeÿùù\ÿùùSÿùùKÿøøBÿøø:ÿøø1ÿøø)ÿ÷÷ ÿ÷÷ÿ÷÷ÿþ$f Gn¶@€ ÌÔ(R/home/pyr/gnustep/gnustep/core/gui/ColorPickers/GSCMYKColorPicker.tiffCreated with The GIMPHHgnustep-gui-0.24.0/ColorPickers/GSGrayColorPicker.h0000664000076500007650000000256011023376255022012 0ustar brains99brains99/* GSGrayColorPicker.h Copyright (C) 2001 Free Software Foundation, Inc. Author: Fred Kiefer Date: January 2001 Author: Alexander Malmberg Date: May 2002 This file is part of GNUstep. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include "GSStandardColorPicker.h" @interface GSGrayColorPicker : GSStandardCSColorPicker { NSString *r_names[1]; NSSlider *r_sliders[1]; NSTextField *r_fields[1]; float r_values[1]; } -(void) _setColorFromValues; -(void) setColor:(NSColor *)color; @end gnustep-gui-0.24.0/ColorPickers/GSCMYKColorPicker.h0000664000076500007650000000256011023376255021653 0ustar brains99brains99/* GSCMYKColorPicker.h Copyright (C) 2001 Free Software Foundation, Inc. Author: Fred Kiefer Date: Febuary 2001 Author: Alexander Malmberg Date: May 2002 This file is part of GNUstep. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include "GSStandardColorPicker.h" @interface GSCMYKColorPicker : GSStandardCSColorPicker { NSString *r_names[4]; NSSlider *r_sliders[4]; NSTextField *r_fields[4]; float r_values[4]; } -(void) _setColorFromValues; -(void) setColor:(NSColor *)color; @end gnustep-gui-0.24.0/ColorPickers/GSColorSliderCell.h0000664000076500007650000000251011023376255021767 0ustar brains99brains99/* GSColorSliderCell.h Copyright (C) 2007 Free Software Foundation, Inc. Author: Fred Kiefer Date: December 2007 Author: Alexander Malmberg Date: May 2002 This file is part of GNUstep. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef GSColorSliderCell_h #define GSColorSliderCell_h #include @interface GSColorSliderCell : NSSliderCell { int mode; float values[3]; } -(void) _setColorSliderCellMode: (int)m; -(void) _setColorSliderCellValues: (float)a : (float)b : (float)c; @end #endif gnustep-gui-0.24.0/ColorPickers/French.lproj/0000775000076500007650000000000012256227331020676 5ustar brains99brains99gnustep-gui-0.24.0/ColorPickers/French.lproj/StandardPicker.strings0000664000076500007650000000163110377004044025204 0ustar brains99brains99/*** French.lproj/StandardPicker.strings updated by make_strings 2002-05-23 16:24:57 +0200 add comments above this one ***/ /*** Strings from GSCMYKColorPicker.m ***/ /* File: GSCMYKColorPicker.m:50 */ "Black" = "Noir"; /* File: GSCMYKColorPicker.m:47 */ "Cyan" = "Cyan"; /* File: GSCMYKColorPicker.m:48 */ "Magenta" = "Magenta"; /* File: GSCMYKColorPicker.m:49 */ "Yellow" = "Jaune"; /*** Strings from GSGrayColorPicker.m ***/ /* File: GSGrayColorPicker.m:50 */ "White" = "Luminosit\u00e9"; /*** Strings from GSHSBColorPicker.m ***/ /* File: GSHSBColorPicker.m:49 */ "Brightness" = "Luminosit\u00e9"; /* File: GSHSBColorPicker.m:47 */ "Hue" = "Teinte"; /* File: GSHSBColorPicker.m:48 */ "Saturation" = "Saturation"; /*** Strings from GSRGBColorPicker.m ***/ /* File: GSRGBColorPicker.m:50 */ "Blue" = "Bleu"; /* File: GSRGBColorPicker.m:49 */ "Green" = "Vert"; /* File: GSRGBColorPicker.m:48 */ "Red" = "Rouge"; gnustep-gui-0.24.0/ColorPickers/GSCMYKColorPicker.m0000664000076500007650000001102411651651245021655 0ustar brains99brains99/* GSCMYKColorPicker.m Copyright (C) 2001 Free Software Foundation, Inc. Author: Fred Kiefer Date: Febuary 2001 Author: Alexander Malmberg Date: May 2002 This file is part of GNUstep. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "GSCMYKColorPicker.h" @implementation GSCMYKColorPicker - (id)initWithPickerMask:(int)aMask colorPanel:(NSColorPanel *)colorPanel { if (aMask & NSColorPanelCMYKModeMask) { NSBundle *b; self = [super initWithPickerMask: aMask colorPanel: colorPanel]; if (!self) return nil; numFields = 4; currentMode = NSColorPanelCMYKModeMask; b = [NSBundle bundleForClass: [self class]]; r_names[0] = NSLocalizedStringFromTableInBundle(@"Cyan",@"StandardPicker",b,@""); r_names[1] = NSLocalizedStringFromTableInBundle(@"Magenta",@"StandardPicker",b,@""); r_names[2] = NSLocalizedStringFromTableInBundle(@"Yellow",@"StandardPicker",b,@""); r_names[3] = NSLocalizedStringFromTableInBundle(@"Black",@"StandardPicker",b,@""); names = r_names; sliders = r_sliders; fields = r_fields; values = r_values; maxValue = 100; return self; } RELEASE(self); return nil; } - (void)setColor:(NSColor *)color { CGFloat cyan, magenta, yellow, black, alpha; NSColor *c; if (updating) return; updating = YES; c = [color colorUsingColorSpaceName: NSDeviceCMYKColorSpace]; [c getCyan: &cyan magenta: &magenta yellow: &yellow black: &black alpha: &alpha]; values[0] = cyan * 100; values[1] = magenta * 100; values[2] = yellow * 100; values[3] = black * 100; [self _valuesChanged]; // FIXME: No way to store black in slider cell [(GSColorSliderCell *)[sliders[0] cell] _setColorSliderCellValues: cyan : magenta : yellow]; [(GSColorSliderCell *)[sliders[1] cell] _setColorSliderCellValues: cyan : magenta : yellow]; [(GSColorSliderCell *)[sliders[2] cell] _setColorSliderCellValues: cyan : magenta : yellow]; [(GSColorSliderCell *)[sliders[3] cell] _setColorSliderCellValues: cyan : magenta : yellow]; [sliders[0] setNeedsDisplay: YES]; [sliders[1] setNeedsDisplay: YES]; [sliders[2] setNeedsDisplay: YES]; [sliders[3] setNeedsDisplay: YES]; updating = NO; } -(void) _setColorFromValues { float cyan = values[0] / 100; float magenta = values[1] / 100; float yellow = values[2] / 100; float black = values[3] / 100; float alpha = [_colorPanel alpha]; NSColor *c = [NSColor colorWithDeviceCyan: cyan magenta: magenta yellow: yellow black: black alpha: alpha]; [_colorPanel setColor: c]; // FIXME: No way to store black in slider cell [(GSColorSliderCell *)[sliders[0] cell] _setColorSliderCellValues: cyan : magenta : yellow]; [(GSColorSliderCell *)[sliders[1] cell] _setColorSliderCellValues: cyan : magenta : yellow]; [(GSColorSliderCell *)[sliders[2] cell] _setColorSliderCellValues: cyan : magenta : yellow]; [(GSColorSliderCell *)[sliders[3] cell] _setColorSliderCellValues: cyan : magenta : yellow]; [sliders[0] setNeedsDisplay: YES]; [sliders[1] setNeedsDisplay: YES]; [sliders[2] setNeedsDisplay: YES]; [sliders[3] setNeedsDisplay: YES]; } - (void) loadViews { [super loadViews]; [sliders[0] setMaxValue: 100]; [sliders[1] setMaxValue: 100]; [sliders[2] setMaxValue: 100]; [sliders[3] setMaxValue: 100]; [(GSColorSliderCell *)[sliders[0] cell] _setColorSliderCellMode: 4]; [(GSColorSliderCell *)[sliders[1] cell] _setColorSliderCellMode: 5]; [(GSColorSliderCell *)[sliders[2] cell] _setColorSliderCellMode: 6]; [(GSColorSliderCell *)[sliders[3] cell] _setColorSliderCellMode: 7]; } @end gnustep-gui-0.24.0/ColorPickers/GNUmakefile0000664000076500007650000000476511335045223020425 0ustar brains99brains99# # ColorPickers makefile for GNUstep GUI # # Copyright (C) 2000 Free Software Foundation, Inc. # # Author: Fred Kiefer # Author: Alexander Malmberg # Date: May 2002 # # This file is part of the GNUstep GUI. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-gui GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES = ../gui.make include $(GNUSTEP_MAKEFILES)/common.make # The color picker bundle to be compiled BUNDLE_NAME = StandardPicker NamedPicker WheelPicker BUNDLE_INSTALL_DIR = $(GNUSTEP_LIBRARY)/ColorPickers ADDITIONAL_INCLUDE_DIRS += -I../Headers/Additions -I../Headers ADDITIONAL_LIB_DIRS += -L../Source/$(GNUSTEP_OBJ_DIR) -L../Models/$(GNUSTEP_OBJ_DIR) # The Objective-C source files to be compiled StandardPicker_OBJC_FILES = GSStandardColorPicker.m \ GSRGBColorPicker.m \ GSCMYKColorPicker.m \ GSHSBColorPicker.m \ GSGrayColorPicker.m \ GSColorSliderCell.m NamedPicker_OBJC_FILES = GSNamedColorPicker.m WheelPicker_OBJC_FILES = GSWheelColorPicker.m GSColorSliderCell.m # The class to load StandardPicker_PRINCIPAL_CLASS = GSStandardColorPicker NamedPicker_PRINCIPAL_CLASS = GSNamedColorPicker WheelPicker_PRINCIPAL_CLASS = GSWheelColorPicker # The Resource files to be copied into the app's resources directory StandardPicker_RESOURCE_FILES = GSRGBColorPicker.tiff \ GSHSBColorPicker.tiff \ GSGrayColorPicker.tiff \ GSCMYKColorPicker.tiff StandardPicker_LOCALIZED_RESOURCE_FILES = StandardPicker.strings StandardPicker_LANGUAGES = English French Spanish Swedish NamedPicker_RESOURCE_FILES = GSNamedColorPicker.tiff WheelPicker_RESOURCE_FILES = GSWheelColorPicker.tiff -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/bundle.make -include GNUmakefile.postamble gnustep-gui-0.24.0/ColorPickers/GSColorSliderCell.m0000664000076500007650000001323512227301004021765 0ustar brains99brains99/* GSStandardColorPicker.m Copyright (C) 2007 Free Software Foundation, Inc. Author: Fred Kiefer Date: December 2007 Author: Alexander Malmberg Date: May 2002 This file is part of GNUstep. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include "GSColorSliderCell.h" #define KNOB_WIDTH 6 @implementation GSColorSliderCell : NSSliderCell -(void) _setColorSliderCellMode: (int)m { mode = m; switch (mode) { case 0: case 1: case 2: case 3: case 10: [_titleCell setTextColor: [NSColor whiteColor]]; break; case 4: case 5: case 6: case 7: [_titleCell setTextColor: [NSColor blackColor]]; break; } [_titleCell setAlignment: NSLeftTextAlignment]; } -(void) _setColorSliderCellValues: (float)a : (float)b : (float)c { values[0] = a; values[1] = b; values[2] = c; if (mode == 8 || mode == 9) { if (c > 0.7) [_titleCell setTextColor: [NSColor blackColor]]; else [_titleCell setTextColor: [NSColor whiteColor]]; } } - (NSRect) knobRectFlipped: (BOOL)flipped { NSPoint origin; float floatValue = [self floatValue]; if (_isVertical && flipped) { floatValue = _maxValue + _minValue - floatValue; } floatValue = (floatValue - _minValue) / (_maxValue - _minValue); origin = _trackRect.origin; if (_isVertical == YES) { origin.y += (_trackRect.size.height - KNOB_WIDTH) * floatValue; return NSMakeRect (origin.x, origin.y, _trackRect.size.width, KNOB_WIDTH); } else { origin.x += (_trackRect.size.width - KNOB_WIDTH) * floatValue; return NSMakeRect (origin.x, origin.y, KNOB_WIDTH, _trackRect.size.height); } } - (void) drawKnob: (NSRect)knobRect { [[NSColor blackColor] set]; NSDrawButton(knobRect, knobRect); } -(void) drawBarInside: (NSRect)r flipped: (BOOL)flipped { float i, f; PSsetalpha(1); if (_isVertical) { for (i = 0; i < r.size.height; i += 1) { f = (0.5 + i) / r.size.height; if (flipped) { f = 1 - f; } switch (mode) { case 0: PSsetgray(f); break; case 1: PSsetrgbcolor(f, values[1], values[2]); break; case 2: PSsetrgbcolor(values[0], f, values[2]); break; case 3: PSsetrgbcolor(values[0], values[1], f); break; case 4: PSsetcmykcolor(f, values[1], values[2], 0); break; case 5: PSsetcmykcolor(values[0], f, values[2], 0); break; case 6: PSsetcmykcolor(values[0], values[1], f, 0); break; case 7: PSsetcmykcolor(values[0], values[1], values[2], f); break; case 8: PSsethsbcolor(f, values[1], values[2]); break; case 9: PSsethsbcolor(values[0], f, values[2]); break; case 10: PSsethsbcolor(values[0], values[1], f); break; } if (i + 1 < r.size.height) PSrectfill(r.origin.x, i + r.origin.y, r.size.width, 1); else PSrectfill(r.origin.x, i + r.origin.y, r.size.width, r.size.height - i); } } else { for (i = 0; i < r.size.width; i += 1) { f = (0.5 + i) / r.size.width; switch (mode) { case 0: PSsetgray(f); break; case 1: PSsetrgbcolor(f, values[1], values[2]); break; case 2: PSsetrgbcolor(values[0], f, values[2]); break; case 3: PSsetrgbcolor(values[0], values[1], f); break; case 4: PSsetcmykcolor(f, values[1], values[2], 0); break; case 5: PSsetcmykcolor(values[0], f, values[2], 0); break; case 6: PSsetcmykcolor(values[0], values[1], f, 0); break; case 7: PSsetcmykcolor(values[0], values[1], values[2], f); break; case 8: PSsethsbcolor(f, values[1], values[2]); break; case 9: PSsethsbcolor(values[0], f, values[2]); break; case 10: PSsethsbcolor(values[0], values[1], f); break; } if (i + 1 < r.size.width) PSrectfill(i, r.origin.y, 1, r.size.height); else PSrectfill(i, r.origin.y, r.size.width - i, r.size.height); } [_titleCell drawInteriorWithFrame: r inView: _control_view]; } } -(void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView *)controlView { _isVertical = (cellFrame.size.height > cellFrame.size.width); cellFrame = [self drawingRectForBounds: cellFrame]; cellFrame.origin.x -= 1; cellFrame.origin.y -= 1; cellFrame.size.width += 2; cellFrame.size.height += 2; _trackRect = cellFrame; [self drawBarInside: cellFrame flipped: [controlView isFlipped]]; [self drawKnob]; } - (CGFloat) knobThickness { return KNOB_WIDTH; } @end gnustep-gui-0.24.0/ColorPickers/GSNamedColorPicker.tiff0000664000076500007650000000733207710500712022632 0ustar brains99brains99II*ˆ Uqq8qqUUUUÆUªqƪªqªUU8ªªUUªªqUqªUUUªUUªUUUUªª8UƪÆqªUU88ªUUUUqâ8ªªqªUUqªÆUqqq8888qqUUq8§%Ûÿ§%Ûÿ§%Ûÿ§%Ûÿÿÿÿÿÿÿÿÿÿ§%Ûÿ§%Ûÿ§%Ûÿ§%Ûÿÿÿÿÿÿÿÿÿÿ§%Ûÿ§%Ûÿ§%Ûÿ§%Ûÿÿÿÿÿÿÿÿÿÿ§%Ûÿ§%Ûÿ§%Ûÿ§%Ûÿÿÿÿÿÿÿÿÿÿ§%Ûÿ§%Ûÿ§%Ûÿ§%Ûÿÿÿÿÿÿÿÿÿÿþ$f En´@€ ÊÒ(R/lin3/usr/src/gnustep/core/gui/ColorPickers/GSNamedColorPicker1.tiffCreated with The GIMPHHgnustep-gui-0.24.0/ColorPickers/GSStandardColorPicker.h0000664000076500007650000000411512013442034022633 0ustar brains99brains99/* GSStandardColorPicker.h Copyright (C) 2001 Free Software Foundation, Inc. Author: Fred Kiefer Date: Febuary 2001 Author: Alexander Malmberg Date: May 2002 This file is part of GNUstep. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef GSStandardColorPicker_h #define GSStandardColorPicker_h #include #include "GSColorSliderCell.h" @class GSTable, NSSlider, NSTextField; @class NSBox, NSButtonCell, NSMatrix; @protocol NSTextFieldDelegate; @interface GSStandardColorPicker: NSColorPicker { GSTable *baseView; NSBox *pickerBox; NSButtonCell *imageCell; NSMatrix *pickerMatrix; NSMutableArray *pickers; id currentPicker; } - (void) loadViews; - (void) _showNewPicker: (id) sender; @end @interface GSStandardCSColorPicker: NSColorPicker { GSTable *baseView;; int numFields; int currentMode; NSString **names; NSSlider **sliders; NSTextField **fields; float *values; int maxValue; BOOL updating; } - (void) sliderChanged: (id) sender; - (void) loadViews; -(void) _valuesChanged; /* subclasses should implement these and -init... */ -(void) _setColorFromValues; -(void) setColor:(NSColor *)color; @end #endif gnustep-gui-0.24.0/ColorPickers/GSRGBColorPicker.h0000664000076500007650000000255611023376255021527 0ustar brains99brains99/* GSRGBColorPicker.h Copyright (C) 2000 Free Software Foundation, Inc. Author: Fred Kiefer Date: December 2000 Author: Alexander Malmberg Date: May 2002 This file is part of GNUstep. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include "GSStandardColorPicker.h" @interface GSRGBColorPicker : GSStandardCSColorPicker { NSString *r_names[3]; NSSlider *r_sliders[3]; NSTextField *r_fields[3]; float r_values[3]; } -(void) _setColorFromValues; -(void) setColor:(NSColor *)color; @end gnustep-gui-0.24.0/TextConverters/0000775000076500007650000000000012256227311016742 5ustar brains99brains99gnustep-gui-0.24.0/TextConverters/RTF/0000775000076500007650000000000012256227312017376 5ustar brains99brains99gnustep-gui-0.24.0/TextConverters/RTF/.cvsignore0000664000076500007650000000005710377004044021375 0ustar brains99brains99*obj *.app *.debug *.profile .gdbinit *.bundle gnustep-gui-0.24.0/TextConverters/RTF/rtfGrammar.tab.h0000664000076500007650000001100111531021636022403 0ustar brains99brains99 /* A Bison parser, made by GNU Bison 2.4.1. */ /* Skeleton interface for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { RTFtext = 258, RTFstart = 259, RTFansi = 260, RTFmac = 261, RTFpc = 262, RTFpca = 263, RTFignore = 264, RTFinfo = 265, RTFstylesheet = 266, RTFfootnote = 267, RTFheader = 268, RTFfooter = 269, RTFpict = 270, RTFplain = 271, RTFparagraph = 272, RTFdefaultParagraph = 273, RTFrow = 274, RTFcell = 275, RTFtabulator = 276, RTFemdash = 277, RTFendash = 278, RTFemspace = 279, RTFenspace = 280, RTFbullet = 281, RTFlquote = 282, RTFrquote = 283, RTFldblquote = 284, RTFrdblquote = 285, RTFred = 286, RTFgreen = 287, RTFblue = 288, RTFcolorbg = 289, RTFcolorfg = 290, RTFunderlinecolor = 291, RTFcolortable = 292, RTFfont = 293, RTFfontSize = 294, RTFNeXTGraphic = 295, RTFNeXTGraphicWidth = 296, RTFNeXTGraphicHeight = 297, RTFNeXTHelpLink = 298, RTFNeXTHelpMarker = 299, RTFNeXTfilename = 300, RTFNeXTmarkername = 301, RTFNeXTlinkFilename = 302, RTFNeXTlinkMarkername = 303, RTFpaperWidth = 304, RTFpaperHeight = 305, RTFmarginLeft = 306, RTFmarginRight = 307, RTFmarginTop = 308, RTFmarginButtom = 309, RTFfirstLineIndent = 310, RTFleftIndent = 311, RTFrightIndent = 312, RTFalignCenter = 313, RTFalignJustified = 314, RTFalignLeft = 315, RTFalignRight = 316, RTFlineSpace = 317, RTFspaceAbove = 318, RTFstyle = 319, RTFbold = 320, RTFitalic = 321, RTFunderline = 322, RTFunderlineDot = 323, RTFunderlineDash = 324, RTFunderlineDashDot = 325, RTFunderlineDashDotDot = 326, RTFunderlineDouble = 327, RTFunderlineStop = 328, RTFunderlineThick = 329, RTFunderlineThickDot = 330, RTFunderlineThickDash = 331, RTFunderlineThickDashDot = 332, RTFunderlineThickDashDotDot = 333, RTFunderlineWord = 334, RTFstrikethrough = 335, RTFstrikethroughDouble = 336, RTFunichar = 337, RTFsubscript = 338, RTFsuperscript = 339, RTFtabstop = 340, RTFfcharset = 341, RTFfprq = 342, RTFcpg = 343, RTFOtherStatement = 344, RTFfontListStart = 345, RTFfamilyNil = 346, RTFfamilyRoman = 347, RTFfamilySwiss = 348, RTFfamilyModern = 349, RTFfamilyScript = 350, RTFfamilyDecor = 351, RTFfamilyTech = 352 }; #endif #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { /* Line 1676 of yacc.c */ #line 82 "rtfGrammar.y" int number; const char *text; RTFcmd cmd; /* Line 1676 of yacc.c */ #line 157 "rtfGrammar.tab.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif gnustep-gui-0.24.0/TextConverters/RTF/rtfScanner.h0000664000076500007650000000362111023376255021660 0ustar brains99brains99/* rtcScanner.h Copyright (C) 1999 Free Software Foundation, Inc. Author: Stefan Boehringer (stefan.boehringer@uni-bochum.de) Date: Dec 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef rtfScanner_h_INCLUDE #define rtfScanner_h_INCLUDE #include #if !defined(YES) typedef char BOOL; enum { NO, YES }; #endif typedef enum { NoError, LEXoutOfMemory, LEXsyntaxError } GSLexError; typedef struct _RTFscannerCtxt { int (*lgetchar)(void *); char pushbackBuffer[4]; // gaurantee 4 chars of pushback int pushbackCount; int streamPosition; int streamLineNumber; void *customContext; } RTFscannerCtxt; typedef struct { BOOL isEmpty; int parameter; int token; const char *name; } RTFcmd; typedef enum { GSRTFfamilyNil, GSRTFfamilyRoman, GSRTFfamilySwiss, GSRTFfamilyModern, GSRTFfamilyScript, GSRTFfamilyDecor, GSRTFfamilyTech } RTFfontFamily; void lexInitContext(RTFscannerCtxt *lctxt, void *customContext, int (*getcharFunction)()); /* external symbols from the grammer */ /*int GSRTFparse(void *ctxt, RTFscannerCtxt *lctxt);*/ int GSRTFparse(void *ctxt, void *lctxt); #endif gnustep-gui-0.24.0/TextConverters/RTF/RTFConsumer.m0000664000076500007650000007544111732762776021756 0ustar brains99brains99/* attributedStringConsumer.m Copyright (C) 1999 Free Software Foundation, Inc. Author: Stefan Böhringer (stefan.boehringer@uni-bochum.de) Date: Dec 1999 Author: Fred Kiefer Date: June 2000 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import "RTFConsumer.h" #import "RTFConsumerFunctions.h" #import "RTFProducer.h" /* we have to satisfy the scanner with a stream reading function */ typedef struct { const char *string; int position; int length; } StringContext; static void initStringContext (StringContext *ctxt, NSData *data) { ctxt->string = [data bytes]; ctxt->position = 0; ctxt->length = [data length]; } static int readString (StringContext *ctxt) { return ctxt->position < ctxt->length ? ctxt->string[ctxt->position++] : EOF; } // Hold the attributs of the current run @interface RTFAttribute: NSObject { @public BOOL changed; BOOL tabChanged; NSMutableParagraphStyle *paragraph; NSColor *fgColour; NSColor *bgColour; NSColor *ulColour; NSString *fontName; float fontSize; BOOL bold; BOOL italic; NSInteger underline; NSInteger strikethrough; int script; float real_fi, real_li; } - (NSFont*) currentFont; - (NSNumber*) script; - (NSNumber*) underline; - (NSNumber*) strikethrough; - (void) resetParagraphStyle; - (void) resetFont; - (void) addTab: (float)location type: (NSTextTabType)type; @end @implementation RTFAttribute - (id) init { [self resetFont]; [self resetParagraphStyle]; return self; } - (void) dealloc { RELEASE(paragraph); RELEASE(fontName); RELEASE(fgColour); RELEASE(bgColour); RELEASE(ulColour); [super dealloc]; } - (id) copyWithZone: (NSZone*)zone { RTFAttribute *new = (RTFAttribute *)NSCopyObject (self, 0, zone); new->paragraph = [paragraph mutableCopyWithZone: zone]; RETAIN(new->fontName); RETAIN(new->fgColour); RETAIN(new->bgColour); RETAIN(new->ulColour); return new; } - (NSFont*) currentFont { NSFont *font; NSFontTraitMask traits = 0; int weight; if (bold) { weight = 9; traits |= NSBoldFontMask; } else { weight = 5; traits |= NSUnboldFontMask; } if (italic) { traits |= NSItalicFontMask; } else { traits |= NSUnitalicFontMask; } font = [[NSFontManager sharedFontManager] fontWithFamily: fontName traits: traits weight: weight size: fontSize]; if (font == nil) { /* Before giving up and using a default font, we try if this is * not the case of a font with a composite name, such as * 'Helvetica-Light'. In that case, even if we don't have * exactly an 'Helvetica-Light' font family, we might have an * 'Helvetica' one. */ NSRange range = [fontName rangeOfString:@"-"]; if (range.location != NSNotFound) { NSString *fontFamily = [fontName substringToIndex: range.location]; font = [[NSFontManager sharedFontManager] fontWithFamily: fontFamily traits: traits weight: weight size: fontSize]; } if (font == nil) { NSDebugMLLog(@"RTFParser", @"Could not find font %@ size %f traits %d weight %d", fontName, fontSize, traits, weight); /* Last resort, default font. :-( */ font = [NSFont userFontOfSize: fontSize]; } } return font; } - (NSNumber*) script { return [NSNumber numberWithInt: script]; } - (NSNumber*) underline { if (underline != NSUnderlineStyleNone) return [NSNumber numberWithInteger: underline]; else return nil; } - (NSNumber*) strikethrough { if (strikethrough != NSUnderlineStyleNone) return [NSNumber numberWithInteger: strikethrough]; else return nil; } - (void) resetParagraphStyle { DESTROY(paragraph); paragraph = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; real_fi = real_li = 0.0; tabChanged = NO; changed = YES; } - (void) resetFont { NSFont *font = [NSFont userFontOfSize:12]; ASSIGN(fontName, [font familyName]); fontSize = 12.0; italic = NO; bold = NO; underline = NSUnderlineStyleNone; strikethrough = NSUnderlineStyleNone; script = 0; DESTROY(fgColour); DESTROY(bgColour); DESTROY(ulColour); changed = YES; } - (void) addTab: (float) location type: (NSTextTabType) type { NSTextTab *tab = [[NSTextTab alloc] initWithType: NSLeftTabStopType location: location]; if (!tabChanged) { NSArray *a; a = [[NSArray alloc] initWithObjects: tab, nil]; // remove all tab stops [paragraph setTabStops: a]; DESTROY(a); tabChanged = YES; } else { [paragraph addTabStop: tab]; } changed = YES; RELEASE(tab); } @end static BOOL classInheritsFromNSMutableAttributedString (Class c) { Class mutable = [NSMutableAttributedString class]; while (c != Nil) { if (c == mutable) { return YES; } c = [c superclass]; } return NO; } @interface RTFConsumer (Private) - (NSAttributedString*) parseRTF: (NSData *)rtfData documentAttributes: (NSDictionary **)dict class: (Class)class; - (NSDictionary*) documentAttributes; - (RTFAttribute*) attr; - (void) push; - (void) pop; - (void) appendString: (NSString*)string; - (void) appendHelpLink: (NSString*)fileName marker: (NSString *)markerName; - (void) appendHelpMarker: (NSString*)markerName; - (void) reset; @end @implementation RTFConsumer /* RTFConsumer is the principal class and thus implements this */ + (Class) classForFormat: (NSString *)format producer: (BOOL)flag { Class cClass = Nil; if (flag) { if (([format isEqual: NSRTFDTextDocumentType]) || ([format isEqual: @"com.apple.rtfd"]) || ([format isEqual: @"rtfd"])) { cClass = [RTFDProducer class]; } else if (([format isEqual: NSRTFTextDocumentType]) || ([format isEqual: @"public.rtf"]) || ([format isEqual: @"rtf"])) { cClass = [RTFProducer class]; } } else { if (([format isEqual: NSRTFDTextDocumentType]) || ([format isEqual: @"com.apple.rtfd"]) || ([format isEqual: @"rtfd"])) { cClass = [RTFDConsumer class]; } else if (([format isEqual: NSRTFTextDocumentType]) || ([format isEqual: @"public.rtf"]) || ([format isEqual: @"rtf"])) { cClass = [RTFConsumer class]; } } return cClass; } + (NSAttributedString*) parseFile: (NSFileWrapper *)wrapper options: (NSDictionary *)options documentAttributes: (NSDictionary **)dict error: (NSError **)error class: (Class)class { NSAttributedString *text = nil; if ([wrapper isRegularFile]) { RTFConsumer *consumer = [RTFConsumer new]; text = [consumer parseRTF: [wrapper regularFileContents] documentAttributes: dict class: class]; RELEASE(consumer); } else if ([wrapper isDirectory]) { NSDictionary *files = [wrapper fileWrappers]; NSFileWrapper *contents; RTFDConsumer* consumer = [RTFDConsumer new]; if ((contents = [files objectForKey: @"TXT.rtf"]) != nil) { [consumer setFiles: files]; text = [consumer parseRTF: [contents regularFileContents] documentAttributes: dict class: class]; } RELEASE(consumer); } return text; } + (NSAttributedString*) parseData: (NSData *)rtfData options: (NSDictionary *)options documentAttributes: (NSDictionary **)dict error: (NSError **)error class: (Class)class { RTFConsumer *consumer = [RTFConsumer new]; NSAttributedString *text; text = [consumer parseRTF: rtfData documentAttributes: dict class: class]; RELEASE(consumer); return text; } - (id) init { ignore = 0; result = nil; encoding = NSISOLatin1StringEncoding; documentAttributes = nil; fonts = nil; attrs = nil; colours = nil; _class = Nil; return self; } - (void) dealloc { RELEASE(fonts); RELEASE(attrs); RELEASE(colours); RELEASE(result); RELEASE(documentAttributes); [super dealloc]; } @end @interface RTFDConsumer (Private) - (void) appendImage: (NSString*) string; @end @implementation RTFDConsumer - (id) init { self = [super init]; files = nil; return self; } - (void) reset { [super reset]; [documentAttributes setValue: NSRTFDTextDocumentType forKey: NSDocumentTypeDocumentAttribute]; } - (void) dealloc { RELEASE(files); [super dealloc]; } - (void) setFiles: (NSDictionary*) theFiles { ASSIGN (files, theFiles); } + (NSAttributedString*) parseData: (NSData *)rtfData options: (NSDictionary *)options documentAttributes: (NSDictionary **)dict error: (NSError **)error class: (Class)class { NSAttributedString *str; NSFileWrapper *wrapper = [[NSFileWrapper alloc] initWithSerializedRepresentation: rtfData]; str = [self parseFile: wrapper options: options documentAttributes: dict error: error class: class]; RELEASE (wrapper); return str; } - (void) appendImage: (NSString*)string { int oldPosition = [result length]; NSRange insertionRange = NSMakeRange(oldPosition,0); if (!ignore) { NSString* fileName = [string stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]]; NSFileWrapper* wrapper = [files objectForKey: fileName]; if (wrapper != nil) { NSImage* image = [[NSImage alloc] initWithData: [wrapper regularFileContents]]; NSTextAttachment* attachment; RTFAttribute* attr = [self attr]; NSMutableDictionary* attributes = nil; NSMutableAttributedString* str = nil; if (image != nil) { [wrapper setIcon: image]; } attachment = [[NSTextAttachment alloc] initWithFileWrapper: wrapper]; if (attachment == nil) { NSLog(@"No attachment at %d", oldPosition); RELEASE(image); return; } attributes = [[NSMutableDictionary alloc] initWithObjectsAndKeys: [attr currentFont], NSFontAttributeName, attr->paragraph, NSParagraphStyleAttributeName, nil]; str = (NSMutableAttributedString*) [NSMutableAttributedString attributedStringWithAttachment: attachment]; [str addAttributes: attributes range: NSMakeRange (0, [str length])]; [result replaceCharactersInRange: insertionRange withAttributedString: str]; attr->changed = YES; RELEASE(attributes); RELEASE(attachment); RELEASE(image); } } } @end @implementation RTFConsumer (Private) - (NSDictionary*) documentAttributes { RETAIN(documentAttributes); return AUTORELEASE(documentAttributes); } - (void) reset { RTFAttribute *attr = [RTFAttribute new]; ignore = 0; DESTROY(result); if (classInheritsFromNSMutableAttributedString (_class)) { result = [[_class alloc] init]; } else { result = [[NSMutableAttributedString alloc] init]; } ASSIGN(documentAttributes, [NSMutableDictionary dictionary]); [documentAttributes setValue: NSRTFTextDocumentType forKey: NSDocumentTypeDocumentAttribute]; ASSIGN(fonts, [NSMutableDictionary dictionary]); ASSIGN(attrs, [NSMutableArray array]); ASSIGN(colours, [NSMutableArray array]); [attrs addObject: attr]; RELEASE(attr); } - (RTFAttribute*) attr { return [attrs lastObject]; } - (void) push { RTFAttribute *attr = [[attrs lastObject] copy]; [attrs addObject: attr]; RELEASE(attr); } - (void) pop { [attrs removeLastObject]; ((RTFAttribute*)[attrs lastObject])->changed = YES; } - (NSAttributedString*) parseRTF: (NSData *)rtfData documentAttributes: (NSDictionary **)dict class: (Class)class { CREATE_AUTORELEASE_POOL(pool); RTFscannerCtxt scanner; StringContext stringCtxt; char buffer[5]; // We read in the first few characters to find out which // encoding we have if ([rtfData length] < 10) { // Too short to be an RTF return nil; } [rtfData getBytes: buffer range: NSMakeRange(7, 3)]; if (strncmp(buffer, "mac", 3) == 0) { encoding = NSMacOSRomanStringEncoding; } else if (strncmp(buffer, "pc", 2) == 0) { // FIXME: Code page 437 kCFStringEncodingDOSLatinUS encoding = NSISOLatin1StringEncoding; } else if (strncmp(buffer, "pca", 3) == 0) { // FIXME: Code page 850 kCFStringEncodingDOSLatin1 encoding = NSISOLatin1StringEncoding; } else { encoding = NSISOLatin1StringEncoding; } // Reset this RFTConsumer, as it might already have been used! _class = class; [self reset]; initStringContext(&stringCtxt, rtfData); lexInitContext(&scanner, &stringCtxt, (int (*)(void*))readString); [result beginEditing]; NS_DURING GSRTFparse((void *)self, &scanner); NS_HANDLER NSLog(@"Problem during RTF Parsing: %@", [localException reason]); //[localException raise]; NS_ENDHANDLER [result endEditing]; RELEASE(pool); // document attributes if (dict) { *dict = [self documentAttributes]; } if (classInheritsFromNSMutableAttributedString (_class)) { RETAIN (result); AUTORELEASE (result); return result; } else { return AUTORELEASE ([[_class alloc] initWithAttributedString: result]); } } - (void) appendString: (NSString*)string { int oldPosition = [result length]; int textlen = [string length]; NSRange insertionRange = NSMakeRange(oldPosition,0); NSMutableDictionary *attributes; if (!ignore && textlen) { RTFAttribute* attr = [self attr]; [result replaceCharactersInRange: insertionRange withString: string]; if (attr->changed) { NSParagraphStyle *ps = [attr->paragraph copy]; attributes = [[NSMutableDictionary alloc] initWithObjectsAndKeys: [attr currentFont], NSFontAttributeName, ps, NSParagraphStyleAttributeName, nil]; DESTROY(ps); if ([attr underline]) { [attributes setObject: [attr underline] forKey: NSUnderlineStyleAttributeName]; } if ([attr strikethrough]) { [attributes setObject: [attr strikethrough] forKey: NSStrikethroughStyleAttributeName]; } if (attr->script) { [attributes setObject: [attr script] forKey: NSSuperscriptAttributeName]; } if (attr->fgColour != nil) { [attributes setObject: attr->fgColour forKey: NSForegroundColorAttributeName]; } if (attr->bgColour != nil) { [attributes setObject: attr->bgColour forKey: NSBackgroundColorAttributeName]; } if (attr->ulColour != nil) { [attributes setObject: attr->ulColour forKey: NSUnderlineColorAttributeName]; } [result setAttributes: attributes range: NSMakeRange(oldPosition, textlen)]; DESTROY(attributes); attr->changed = NO; } } } - (void) appendHelpLink: (NSString*)fileName marker: (NSString*)markerName { int oldPosition = [result length]; NSRange insertionRange = NSMakeRange(oldPosition,0); if (!ignore) { GSHelpLinkAttachment* attachment; RTFAttribute* attr = [self attr]; NSMutableDictionary* attributes = nil; NSMutableAttributedString* str = nil; attachment = [[GSHelpLinkAttachment alloc] initWithFileName: fileName markerName: markerName]; if (attachment == nil) { NSLog(@"No attachment at %d", oldPosition); return; } attributes = [[NSMutableDictionary alloc] initWithObjectsAndKeys: [attr currentFont], NSFontAttributeName, attr->paragraph, NSParagraphStyleAttributeName, nil]; str = (NSMutableAttributedString*) [NSMutableAttributedString attributedStringWithAttachment: attachment]; [str addAttributes: attributes range: NSMakeRange (0, [str length])]; [result replaceCharactersInRange: insertionRange withAttributedString: str]; attr->changed = YES; RELEASE(attributes); RELEASE(attachment); } } - (void) appendHelpMarker: (NSString*)markerName { int oldPosition = [result length]; NSRange insertionRange = NSMakeRange(oldPosition,0); if (!ignore) { GSHelpMarkerAttachment* attachment; RTFAttribute* attr = [self attr]; NSMutableDictionary* attributes = nil; NSMutableAttributedString* str = nil; attachment = [[GSHelpMarkerAttachment alloc] initWithMarkerName: markerName]; if (attachment == nil) { NSLog(@"No attachment at %d", oldPosition); return; } attributes = [[NSMutableDictionary alloc] initWithObjectsAndKeys: [attr currentFont], NSFontAttributeName, attr->paragraph, NSParagraphStyleAttributeName, nil]; str = (NSMutableAttributedString*) [NSMutableAttributedString attributedStringWithAttachment: attachment]; [str addAttributes: attributes range: NSMakeRange (0, [str length])]; [result replaceCharactersInRange: insertionRange withAttributedString: str]; attr->changed = YES; RELEASE(attributes); RELEASE(attachment); } } @end #undef IGNORE #define FONTS ((RTFConsumer *)ctxt)->fonts #define COLOURS ((RTFConsumer *)ctxt)->colours #define RESULT ((RTFConsumer *)ctxt)->result #define IGNORE ((RTFConsumer *)ctxt)->ignore #define TEXTPOSITION [RESULT length] #define DOCUMENTATTRIBUTES ((RTFConsumer*)ctxt)->documentAttributes #define ENCODING ((RTFConsumer *)ctxt)->encoding #define FILES ((RTFDConsumer*)ctxt)->files #define CTXT [((RTFConsumer *)ctxt) attr] #define CHANGED CTXT->changed #define PARAGRAPH CTXT->paragraph #define FONTNAME CTXT->fontName #define SCRIPT CTXT->script #define ITALIC CTXT->italic #define BOLD CTXT->bold #define UNDERLINE CTXT->underline #define STRIKETHROUGH CTXT->strikethrough #define FGCOLOUR CTXT->fgColour #define BGCOLOUR CTXT->bgColour #define ULCOLOUR CTXT->ulColour #define PAPERSIZE @"PaperSize" #define LEFTMARGIN @"LeftMargin" #define RIGHTMARGIN @"RightMargin" #define TOPMARGIN @"TopMargin" #define BUTTOMMARGIN @"ButtomMargin" /* we must implement from the rtfConsumerFunctions.h file (Supporting files) this includes the yacc error handling and output */ /* handle errors (this is the yacc error mech) */ void GSRTFerror (void *ctxt, void *lctxt, const char *msg) { /* [NSException raise:NSInvalidArgumentException format:@"Syntax error in RTF: %s", msg];*/ NSDebugLLog(@"RTFParser",@"Syntax error in RTF: %s", msg); } void GSRTFgenericRTFcommand (void *ctxt, RTFcmd cmd) { NSDebugLLog(@"RTFParser", @"encountered rtf cmd:%s", cmd.name); if (!cmd.isEmpty) NSDebugLLog(@"RTFParser", @" argument is %d\n", cmd.parameter); } //Start: we're doing some initialization void GSRTFstart (void *ctxt) { NSDebugLLog(@"RTFParser", @"Start RTF parsing"); } // Finished to parse one piece of RTF. void GSRTFstop (void *ctxt) { // close all open bolds et al. NSDebugLLog(@"RTFParser", @"End RTF parsing"); } void GSRTFopenBlock (void *ctxt, BOOL ignore) { if (!IGNORE) { [(RTFConsumer *)ctxt push]; } // Switch off any output for ignored block statements if (ignore) { IGNORE++; } } void GSRTFcloseBlock (void *ctxt, BOOL ignore) { if (ignore) { IGNORE--; } if (!IGNORE) { [(RTFConsumer *)ctxt pop]; } } void GSRTFmangleText (void *ctxt, const char *text) { NSData *data = [[NSData alloc] initWithBytes: (void*)text length: strlen(text)]; NSString *str = [[NSString alloc] initWithData: data encoding: ENCODING]; [(RTFConsumer *)ctxt appendString: str]; DESTROY(str); DESTROY(data); } void GSRTFunicode (void *ctxt, int uchar) { // Don't add the attachment character, this gets handled separatly if (uchar != (int)NSAttachmentCharacter) { unichar chars = uchar; NSString *str = [[NSString alloc] initWithCharacters: &chars length: 1]; [(RTFConsumer *)ctxt appendString: str]; DESTROY(str); } } void GSRTFregisterFont (void *ctxt, const char *fontName, RTFfontFamily family, int fontNumber) { NSString *fontNameString; NSNumber *fontId = [NSNumber numberWithInt: fontNumber]; if (!fontName || !*fontName) { [NSException raise: NSInvalidArgumentException format: @"Error in RTF (font omitted?), position:%d", TEXTPOSITION]; } // exclude trailing ';' from fontName if (';' == fontName[strlen(fontName)-1]) { fontNameString = [NSString stringWithCString: fontName length: strlen(fontName)-1]; } else { fontNameString = [NSString stringWithCString: fontName length: strlen(fontName)]; } [FONTS setObject: fontNameString forKey: fontId]; } void GSRTFfontNumber (void *ctxt, int fontNumber) { NSNumber *fontId = [NSNumber numberWithInt: fontNumber]; NSString *fontName = [FONTS objectForKey: fontId]; if (fontName == nil) { /* we're about to set an unknown font */ [NSException raise: NSInvalidArgumentException format: @"Error in RTF (referring to undefined font \\f%d), position:%d", fontNumber, TEXTPOSITION]; } else { if (![fontName isEqual: FONTNAME]) { ASSIGN(FONTNAME, fontName); CHANGED = YES; } } } // fontSize is in halfpoints according to spec void GSRTFfontSize (void *ctxt, int fontSize) { float size = halfpoints2points(fontSize); if (size != CTXT->fontSize) { CTXT->fontSize = size; CHANGED = YES; } } void GSRTFpaperWidth (void *ctxt, int width) { float fwidth = twips2points(width); NSMutableDictionary *dict = DOCUMENTATTRIBUTES; NSValue *val = [dict objectForKey: PAPERSIZE]; NSSize size; if (val == nil) { size = NSMakeSize(fwidth, 792); } else { size = [val sizeValue]; size.width = fwidth; } [dict setObject: [NSValue valueWithSize: size] forKey: PAPERSIZE]; } void GSRTFpaperHeight (void *ctxt, int height) { float fheight = twips2points(height); NSMutableDictionary *dict = DOCUMENTATTRIBUTES; NSValue *val = [dict objectForKey: PAPERSIZE]; NSSize size; if (val == nil) { size = NSMakeSize(612, fheight); } else { size = [val sizeValue]; size.height = fheight; } [dict setObject: [NSValue valueWithSize: size] forKey: PAPERSIZE]; } void GSRTFmarginLeft (void *ctxt, int margin) { float fmargin = twips2points(margin); NSMutableDictionary *dict = DOCUMENTATTRIBUTES; [dict setObject: [NSNumber numberWithFloat: fmargin] forKey: LEFTMARGIN]; } void GSRTFmarginRight (void *ctxt, int margin) { float fmargin = twips2points(margin); NSMutableDictionary *dict = DOCUMENTATTRIBUTES; [dict setObject: [NSNumber numberWithFloat: fmargin] forKey: RIGHTMARGIN]; } void GSRTFmarginTop (void *ctxt, int margin) { float fmargin = twips2points(margin); NSMutableDictionary *dict = DOCUMENTATTRIBUTES; [dict setObject: [NSNumber numberWithFloat: fmargin] forKey: TOPMARGIN]; } void GSRTFmarginButtom (void *ctxt, int margin) { float fmargin = twips2points(margin); NSMutableDictionary *dict = DOCUMENTATTRIBUTES; [dict setObject: [NSNumber numberWithFloat: fmargin] forKey: BUTTOMMARGIN]; } void GSRTFfirstLineIndent (void *ctxt, int indent) { NSMutableParagraphStyle *para = PARAGRAPH; float findent = twips2points(indent); CTXT->real_fi = findent; findent = CTXT->real_li + CTXT->real_fi; // for attributed strings only positiv indent is allowed if ((findent >= 0.0) && ([para firstLineHeadIndent] != findent)) { [para setFirstLineHeadIndent: findent]; CHANGED = YES; } } void GSRTFleftIndent (void *ctxt, int indent) { NSMutableParagraphStyle *para = PARAGRAPH; float findent = twips2points(indent); CTXT->real_li = findent; // for attributed strings only positiv indent is allowed if ((findent >= 0.0) && ([para headIndent] != findent)) { [para setHeadIndent: findent]; CHANGED = YES; } findent = CTXT->real_li + CTXT->real_fi; if ((findent >= 0.0) && ([para firstLineHeadIndent] != findent)) { [para setFirstLineHeadIndent: findent]; CHANGED = YES; } } void GSRTFrightIndent (void *ctxt, int indent) { NSMutableParagraphStyle *para = PARAGRAPH; float findent = twips2points(indent); // for attributed strings only positiv indent is allowed if ((findent >= 0.0) && ([para tailIndent] != findent)) { [para setTailIndent: -findent]; CHANGED = YES; } } void GSRTFtabstop (void *ctxt, int location) { float flocation = twips2points(location); if (flocation >= 0.0) { [CTXT addTab: flocation type: NSLeftTabStopType]; } } void GSRTFalignCenter (void *ctxt) { NSMutableParagraphStyle *para = PARAGRAPH; if ([para alignment] != NSCenterTextAlignment) { [para setAlignment: NSCenterTextAlignment]; CHANGED = YES; } } void GSRTFalignJustified (void *ctxt) { NSMutableParagraphStyle *para = PARAGRAPH; if ([para alignment] != NSJustifiedTextAlignment) { [para setAlignment: NSJustifiedTextAlignment]; CHANGED = YES; } } void GSRTFalignLeft (void *ctxt) { NSMutableParagraphStyle *para = PARAGRAPH; if ([para alignment] != NSLeftTextAlignment) { [para setAlignment: NSLeftTextAlignment]; CHANGED = YES; } } void GSRTFalignRight (void *ctxt) { NSMutableParagraphStyle *para = PARAGRAPH; if ([para alignment] != NSRightTextAlignment) { [para setAlignment: NSRightTextAlignment]; CHANGED = YES; } } void GSRTFspaceAbove (void *ctxt, int space) { NSMutableParagraphStyle *para = PARAGRAPH; float fspace = twips2points(space); if (fspace >= 0.0) { [para setParagraphSpacing: fspace]; CHANGED = YES; } } void GSRTFlineSpace (void *ctxt, int space) { NSMutableParagraphStyle *para = PARAGRAPH; float fspace = twips2points(space); if (space == 1000) { [para setMinimumLineHeight: 0.0]; [para setMaximumLineHeight: 0.0]; CHANGED = YES; } else if (fspace < 0.0) { [para setMaximumLineHeight: -fspace]; CHANGED = YES; } else { [para setMinimumLineHeight: fspace]; CHANGED = YES; } } void GSRTFdefaultParagraph (void *ctxt) { [CTXT resetParagraphStyle]; } void GSRTFstyle (void *ctxt, int style) { } void GSRTFdefaultCharacterStyle (void *ctxt) { [CTXT resetFont]; } void GSRTFaddColor (void *ctxt, int red, int green, int blue) { NSColor *colour = [NSColor colorWithCalibratedRed: red/255.0 green: green/255.0 blue: blue/255.0 alpha: 1.0]; [COLOURS addObject: colour]; } void GSRTFaddDefaultColor (void *ctxt) { [COLOURS addObject: [NSColor textColor]]; } void GSRTFcolorbg (void *ctxt, int color) { if ([COLOURS count] <= (unsigned int)color) { ASSIGN (BGCOLOUR, [NSColor whiteColor]); } else { ASSIGN (BGCOLOUR, [COLOURS objectAtIndex: color]); } CHANGED = YES; } void GSRTFcolorfg (void *ctxt, int color) { if ([COLOURS count] <= (unsigned int)color) { ASSIGN (FGCOLOUR, [NSColor blackColor]); } else { ASSIGN (FGCOLOUR, [COLOURS objectAtIndex: color]); } CHANGED = YES; } void GSRTFunderlinecolor (void *ctxt, int color) { if ([COLOURS count] <= (unsigned int)color) { ASSIGN (ULCOLOUR, [NSColor blackColor]); } else { ASSIGN (ULCOLOUR, [COLOURS objectAtIndex: color]); } CHANGED = YES; } void GSRTFsubscript (void *ctxt, int script) { script = (int) (-halfpoints2points(script) / 3.0); if (script != SCRIPT) { SCRIPT = script; CHANGED = YES; } } void GSRTFsuperscript (void *ctxt, int script) { script = (int) (halfpoints2points(script) / 3.0); if (script != SCRIPT) { SCRIPT = script; CHANGED = YES; } } void GSRTFitalic (void *ctxt, BOOL state) { if (state != ITALIC) { ITALIC = state; CHANGED = YES; } } void GSRTFbold (void *ctxt, BOOL state) { if (state != BOLD) { BOLD = state; CHANGED = YES; } } void GSRTFunderline (void *ctxt, BOOL state, NSInteger style) { if (state == NO) { style = NSUnderlineStyleNone; } if (UNDERLINE != style) { UNDERLINE = style; CHANGED = YES; } } void GSRTFstrikethrough (void *ctxt, NSInteger style) { if (STRIKETHROUGH != style) { STRIKETHROUGH = style; CHANGED = YES; } } void GSRTFstrikethroughDouble (void *ctxt) { const NSInteger style = NSUnderlineStyleDouble | NSUnderlinePatternSolid; if (STRIKETHROUGH != style) { STRIKETHROUGH = style; CHANGED = YES; } } void GSRTFparagraph (void *ctxt) { GSRTFmangleText(ctxt, "\n"); CTXT->tabChanged = NO; } void GSRTFNeXTGraphic (void *ctxt, const char *fileName, int width, int height) { [(RTFDConsumer *)ctxt appendImage: [NSString stringWithCString: fileName]]; } void GSRTFNeXTHelpLink (void *ctxt, int num, const char *markername, const char *linkFilename, const char *linkMarkername) { NSRange range; NSString *fileName = [NSString stringWithCString: linkFilename]; NSString *markerName = [NSString stringWithCString: linkMarkername]; range = [fileName rangeOfString: @";"]; if (range.location != NSNotFound) fileName = [fileName substringToIndex:range.location]; range = [markerName rangeOfString: @";"]; if (range.location == 0) markerName = nil; else if (range.location != NSNotFound) markerName = [markerName substringToIndex:range.location]; [(RTFDConsumer *)ctxt appendHelpLink: fileName marker: markerName]; } void GSRTFNeXTHelpMarker (void *ctxt, int num, const char *markername) { NSRange range; NSString *markerName = [NSString stringWithCString: markername]; range = [markerName rangeOfString: @";"]; if (range.location != NSNotFound) markerName = [markerName substringToIndex:range.location]; [(RTFDConsumer *)ctxt appendHelpMarker: markerName]; } gnustep-gui-0.24.0/TextConverters/RTF/GNUmakefile.preamble0000664000076500007650000000373011023376255023243 0ustar brains99brains99# GNUmakefile.preamble # # Copyright (C) 2001 Free Software Foundation, Inc. # # Author: Philippe C.D. Robert # # This file is part of GNUstep # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # # Makefile.preamble # # Project specific makefile variables, and additional # # Do not put any Makefile rules in this file, instead they should # be put into Makefile.postamble. # # # Flags dealing with compiling and linking # # Additional flags to pass to the preprocessor ADDITIONAL_CPPFLAGS += -Wall # Additional flags to pass to the Objective-C compiler ADDITIONAL_OBJCFLAGS += # Additional flags to pass to the C compiler ADDITIONAL_CFLAGS += #ADDITIONAL_CFLAGS += # Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS +=-I../../Headers/Additions -I../../Headers # Additional LDFLAGS to pass to the linker #ADDITIONAL_LDFLAGS += # Additional library directories the linker should search ADDITIONAL_LIB_DIRS += -L../../Source/$(GNUSTEP_OBJ_DIR) #ADDITIONAL_TOOL_LIBS += RTFConverter_BUNDLE_LIBS += -lgnustep-gui # # Flags dealing with installing and uninstalling # # Additional directories to be created during installation #ADDITIONAL_INSTALL_DIRS += # # Local configuration # gnustep-gui-0.24.0/TextConverters/RTF/GNUmakefile.postamble0000664000076500007650000000234611531021636023436 0ustar brains99brains99# GNUmakefile.postamble # # Copyright (C) 2001 Free Software Foundation, Inc. # # Author: Philippe C.D. Robert # # This file is part of GNUstep # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. BISON_FLAGS = -p GSRTF --output=rtfGrammar.tab.m --defines=rtfGrammar.tab.h BISON = BISON_SIMPLE=bison.simple bison # Rule not enabled because not every system has bison installed... # FIXME add configure check for bison? #rtfGrammar.tab.m: rtfGrammar.y # $(BISON) $(BISON_FLAGS) $< gnustep-gui-0.24.0/TextConverters/RTF/rtfGrammar.tab.m0000664000076500007650000027102611531021636022427 0ustar brains99brains99 /* A Bison parser, made by GNU Bison 2.4.1. */ /* Skeleton implementation for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "2.4.1" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 1 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* Using locations. */ #define YYLSP_NEEDED 0 /* Substitute the variable and function names. */ #define yyparse GSRTFparse #define yylex GSRTFlex #define yyerror GSRTFerror #define yylval GSRTFlval #define yychar GSRTFchar #define yydebug GSRTFdebug #define yynerrs GSRTFnerrs /* Copy the first part of user declarations. */ /* Line 189 of yacc.c */ #line 36 "rtfGrammar.y" /* The overall plan is to make this grammer universal in usage. Intrested buddies can implement plain C functions to consume what the grammer is producing. this way the rtf-grammer-tree can be converted to what is needed: GNUstep attributed strings, tex files, ... The plan is laid out by defining a set of C functions which cover all what is needed to mangle rtf information (it is NeXT centric however and may even lack some features). Be aware that some functions are called at specific times when some information may or may not be available. The first argument of all functions is a context, which is asked to be maintained by the consumer at whichever purpose seems appropriate. This context must be passed to the parser by issuing 'value = GSRTFparse(ctxt, lctxt);' in the first place. */ #import #include #include #include "rtfScanner.h" /* this context is passed to the interface functions */ typedef void *GSRTFctxt; // Two parameters are not supported by some bison versions. The declaration of // yyparse in the .c file must be corrected to be able to compile it. /*#define YYPARSE_PARAM ctxt, void *lctxt*/ #define YYLEX_PARAM lctxt /*#undef YYLSP_NEEDED*/ #define CTXT ctxt #define YYERROR_VERBOSE #define YYDEBUG 0 #include "RTFConsumerFunctions.h" /*int GSRTFlex (YYSTYPE *lvalp, RTFscannerCtxt *lctxt); */ int GSRTFlex(void *lvalp, void *lctxt); /* Line 189 of yacc.c */ #line 125 "rtfGrammar.tab.m" /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* Enabling the token table. */ #ifndef YYTOKEN_TABLE # define YYTOKEN_TABLE 0 #endif /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { RTFtext = 258, RTFstart = 259, RTFansi = 260, RTFmac = 261, RTFpc = 262, RTFpca = 263, RTFignore = 264, RTFinfo = 265, RTFstylesheet = 266, RTFfootnote = 267, RTFheader = 268, RTFfooter = 269, RTFpict = 270, RTFplain = 271, RTFparagraph = 272, RTFdefaultParagraph = 273, RTFrow = 274, RTFcell = 275, RTFtabulator = 276, RTFemdash = 277, RTFendash = 278, RTFemspace = 279, RTFenspace = 280, RTFbullet = 281, RTFlquote = 282, RTFrquote = 283, RTFldblquote = 284, RTFrdblquote = 285, RTFred = 286, RTFgreen = 287, RTFblue = 288, RTFcolorbg = 289, RTFcolorfg = 290, RTFunderlinecolor = 291, RTFcolortable = 292, RTFfont = 293, RTFfontSize = 294, RTFNeXTGraphic = 295, RTFNeXTGraphicWidth = 296, RTFNeXTGraphicHeight = 297, RTFNeXTHelpLink = 298, RTFNeXTHelpMarker = 299, RTFNeXTfilename = 300, RTFNeXTmarkername = 301, RTFNeXTlinkFilename = 302, RTFNeXTlinkMarkername = 303, RTFpaperWidth = 304, RTFpaperHeight = 305, RTFmarginLeft = 306, RTFmarginRight = 307, RTFmarginTop = 308, RTFmarginButtom = 309, RTFfirstLineIndent = 310, RTFleftIndent = 311, RTFrightIndent = 312, RTFalignCenter = 313, RTFalignJustified = 314, RTFalignLeft = 315, RTFalignRight = 316, RTFlineSpace = 317, RTFspaceAbove = 318, RTFstyle = 319, RTFbold = 320, RTFitalic = 321, RTFunderline = 322, RTFunderlineDot = 323, RTFunderlineDash = 324, RTFunderlineDashDot = 325, RTFunderlineDashDotDot = 326, RTFunderlineDouble = 327, RTFunderlineStop = 328, RTFunderlineThick = 329, RTFunderlineThickDot = 330, RTFunderlineThickDash = 331, RTFunderlineThickDashDot = 332, RTFunderlineThickDashDotDot = 333, RTFunderlineWord = 334, RTFstrikethrough = 335, RTFstrikethroughDouble = 336, RTFunichar = 337, RTFsubscript = 338, RTFsuperscript = 339, RTFtabstop = 340, RTFfcharset = 341, RTFfprq = 342, RTFcpg = 343, RTFOtherStatement = 344, RTFfontListStart = 345, RTFfamilyNil = 346, RTFfamilyRoman = 347, RTFfamilySwiss = 348, RTFfamilyModern = 349, RTFfamilyScript = 350, RTFfamilyDecor = 351, RTFfamilyTech = 352 }; #endif #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { /* Line 214 of yacc.c */ #line 82 "rtfGrammar.y" int number; const char *text; RTFcmd cmd; /* Line 214 of yacc.c */ #line 266 "rtfGrammar.tab.m" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif /* Copy the second part of user declarations. */ /* Line 264 of yacc.c */ #line 278 "rtfGrammar.tab.m" #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #elif (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) typedef signed char yytype_int8; #else typedef short int yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short int yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short int yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned int # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) # endif # endif # ifndef YY_ # define YY_(msgid) msgid # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(e) ((void) (e)) #else # define YYUSE(e) /* empty */ #endif /* Identity function, used to suppress warnings about constant conditions. */ #ifndef lint # define YYID(n) (n) #else #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int YYID (int yyi) #else static int YYID (yyi) int yyi; #endif { return yyi; } #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (YYID (0)) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (YYID (0)) #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 4 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 1300 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 100 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 34 /* YYNRULES -- Number of rules. */ #define YYNRULES 116 /* YYNRULES -- Number of states. */ #define YYNSTATES 168 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 352 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 98, 2, 99, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const yytype_uint16 yyprhs[] = { 0, 0, 3, 4, 5, 13, 15, 17, 19, 21, 23, 24, 27, 30, 33, 36, 39, 42, 43, 49, 50, 56, 57, 63, 64, 70, 71, 77, 78, 84, 85, 91, 92, 98, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 197, 199, 201, 203, 204, 205, 215, 216, 217, 230, 231, 232, 241, 246, 247, 250, 255, 262, 267, 268, 271, 274, 277, 280, 282, 284, 286, 288, 290, 292, 294, 299, 300, 303, 308 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int16 yyrhs[] = { 101, 0, -1, -1, -1, 98, 102, 4, 104, 105, 103, 99, -1, 5, -1, 6, -1, 7, -1, 8, -1, 89, -1, -1, 105, 126, -1, 105, 131, -1, 105, 115, -1, 105, 3, -1, 105, 106, -1, 105, 1, -1, -1, 98, 107, 105, 116, 99, -1, -1, 98, 108, 9, 105, 99, -1, -1, 98, 109, 10, 105, 99, -1, -1, 98, 110, 11, 105, 99, -1, -1, 98, 111, 12, 105, 99, -1, -1, 98, 112, 13, 105, 99, -1, -1, 98, 113, 14, 105, 99, -1, -1, 98, 114, 15, 105, 99, -1, 98, 1, 99, -1, 38, -1, 39, -1, 49, -1, 50, -1, 51, -1, 52, -1, 53, -1, 54, -1, 55, -1, 56, -1, 57, -1, 85, -1, 58, -1, 59, -1, 60, -1, 61, -1, 63, -1, 62, -1, 18, -1, 64, -1, 34, -1, 35, -1, 36, -1, 83, -1, 84, -1, 65, -1, 66, -1, 67, -1, 68, -1, 69, -1, 70, -1, 71, -1, 72, -1, 73, -1, 74, -1, 75, -1, 76, -1, 77, -1, 78, -1, 79, -1, 80, -1, 81, -1, 82, -1, 16, -1, 17, -1, 19, -1, 89, -1, -1, 117, -1, 120, -1, 123, -1, -1, -1, 98, 40, 3, 41, 42, 99, 118, 105, 119, -1, -1, -1, 98, 43, 46, 3, 47, 3, 48, 3, 99, 121, 105, 122, -1, -1, -1, 98, 44, 46, 3, 99, 124, 105, 125, -1, 98, 90, 127, 99, -1, -1, 127, 128, -1, 127, 98, 128, 99, -1, 127, 98, 128, 106, 3, 99, -1, 38, 130, 129, 3, -1, -1, 129, 86, -1, 129, 87, -1, 129, 88, -1, 129, 106, -1, 91, -1, 92, -1, 93, -1, 94, -1, 95, -1, 96, -1, 97, -1, 98, 37, 132, 99, -1, -1, 132, 133, -1, 31, 32, 33, 3, -1, 3, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 195, 195, 195, 195, 198, 199, 200, 201, 203, 206, 207, 208, 209, 210, 211, 212, 215, 215, 216, 216, 217, 217, 218, 218, 219, 219, 220, 220, 221, 221, 222, 222, 223, 231, 238, 245, 252, 259, 266, 273, 280, 287, 294, 301, 308, 315, 316, 317, 318, 319, 326, 327, 328, 329, 336, 343, 350, 357, 364, 371, 378, 385, 392, 399, 406, 413, 420, 421, 428, 435, 442, 449, 456, 463, 469, 470, 471, 472, 473, 474, 478, 479, 480, 481, 493, 493, 493, 508, 508, 508, 522, 522, 522, 531, 534, 535, 536, 537, 543, 547, 548, 549, 550, 551, 556, 557, 558, 559, 560, 561, 562, 570, 573, 574, 578, 583 }; #endif #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "RTFtext", "RTFstart", "RTFansi", "RTFmac", "RTFpc", "RTFpca", "RTFignore", "RTFinfo", "RTFstylesheet", "RTFfootnote", "RTFheader", "RTFfooter", "RTFpict", "RTFplain", "RTFparagraph", "RTFdefaultParagraph", "RTFrow", "RTFcell", "RTFtabulator", "RTFemdash", "RTFendash", "RTFemspace", "RTFenspace", "RTFbullet", "RTFlquote", "RTFrquote", "RTFldblquote", "RTFrdblquote", "RTFred", "RTFgreen", "RTFblue", "RTFcolorbg", "RTFcolorfg", "RTFunderlinecolor", "RTFcolortable", "RTFfont", "RTFfontSize", "RTFNeXTGraphic", "RTFNeXTGraphicWidth", "RTFNeXTGraphicHeight", "RTFNeXTHelpLink", "RTFNeXTHelpMarker", "RTFNeXTfilename", "RTFNeXTmarkername", "RTFNeXTlinkFilename", "RTFNeXTlinkMarkername", "RTFpaperWidth", "RTFpaperHeight", "RTFmarginLeft", "RTFmarginRight", "RTFmarginTop", "RTFmarginButtom", "RTFfirstLineIndent", "RTFleftIndent", "RTFrightIndent", "RTFalignCenter", "RTFalignJustified", "RTFalignLeft", "RTFalignRight", "RTFlineSpace", "RTFspaceAbove", "RTFstyle", "RTFbold", "RTFitalic", "RTFunderline", "RTFunderlineDot", "RTFunderlineDash", "RTFunderlineDashDot", "RTFunderlineDashDotDot", "RTFunderlineDouble", "RTFunderlineStop", "RTFunderlineThick", "RTFunderlineThickDot", "RTFunderlineThickDash", "RTFunderlineThickDashDot", "RTFunderlineThickDashDotDot", "RTFunderlineWord", "RTFstrikethrough", "RTFstrikethroughDouble", "RTFunichar", "RTFsubscript", "RTFsuperscript", "RTFtabstop", "RTFfcharset", "RTFfprq", "RTFcpg", "RTFOtherStatement", "RTFfontListStart", "RTFfamilyNil", "RTFfamilyRoman", "RTFfamilySwiss", "RTFfamilyModern", "RTFfamilyScript", "RTFfamilyDecor", "RTFfamilyTech", "'{'", "'}'", "$accept", "rtfFile", "$@1", "$@2", "rtfCharset", "rtfIngredients", "rtfBlock", "$@3", "$@4", "$@5", "$@6", "$@7", "$@8", "$@9", "$@10", "rtfStatement", "rtfNeXTstuff", "rtfNeXTGraphic", "$@11", "$@12", "rtfNeXTHelpLink", "$@13", "$@14", "rtfNeXTHelpMarker", "$@15", "$@16", "rtfFontList", "rtfFonts", "rtfFontStatement", "rtfFontAttrs", "rtfFontFamily", "rtfColorDef", "rtfColors", "rtfColorStatement", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 123, 125 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 100, 102, 103, 101, 104, 104, 104, 104, 104, 105, 105, 105, 105, 105, 105, 105, 107, 106, 108, 106, 109, 106, 110, 106, 111, 106, 112, 106, 113, 106, 114, 106, 106, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 116, 116, 116, 116, 118, 119, 117, 121, 122, 120, 124, 125, 123, 126, 127, 127, 127, 127, 128, 129, 129, 129, 129, 129, 130, 130, 130, 130, 130, 130, 130, 131, 132, 132, 133, 133 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 0, 0, 7, 1, 1, 1, 1, 1, 0, 2, 2, 2, 2, 2, 2, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 9, 0, 0, 12, 0, 0, 8, 4, 0, 2, 4, 6, 4, 0, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 4, 0, 2, 4, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 0, 2, 0, 0, 1, 0, 5, 6, 7, 8, 9, 10, 0, 16, 14, 77, 78, 52, 79, 54, 55, 56, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 46, 47, 48, 49, 51, 50, 53, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 57, 58, 45, 80, 0, 0, 15, 13, 11, 12, 0, 113, 95, 10, 0, 0, 0, 0, 0, 0, 0, 4, 33, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 116, 0, 112, 114, 0, 0, 94, 96, 0, 0, 82, 83, 84, 0, 0, 0, 0, 0, 0, 0, 0, 105, 106, 107, 108, 109, 110, 111, 100, 0, 0, 0, 0, 18, 20, 22, 24, 26, 28, 30, 32, 0, 0, 0, 97, 0, 0, 0, 0, 115, 99, 101, 102, 103, 104, 0, 0, 0, 0, 98, 0, 0, 91, 85, 0, 10, 10, 0, 0, 0, 0, 93, 87, 88, 10, 0, 90 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 2, 3, 63, 11, 12, 64, 71, 72, 73, 74, 75, 76, 77, 78, 65, 100, 101, 157, 163, 102, 165, 167, 103, 156, 162, 66, 82, 98, 133, 119, 67, 81, 94 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -114 static const yytype_int16 yypact[] = { -97, -114, 23, 20, -114, -2, -114, -114, -114, -114, -114, -114, 266, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, 90, -73, -114, -114, -114, -114, -71, -114, -114, -114, 21, 19, 29, 32, 18, 27, 17, -114, -114, 16, -13, 351, -114, -114, -114, -114, -114, -114, -114, -114, 13, -114, -114, 113, 8, -114, -114, -1, -9, -114, -114, -114, 436, 521, 606, 691, 776, 861, 946, 59, -114, -114, -114, -114, -114, -114, -114, -114, -77, 91, 49, 50, -114, -114, -114, -114, -114, -114, -114, -114, 110, 24, 181, -114, 111, 75, 115, 116, -114, -114, -114, -114, -114, -114, 22, 78, 76, 38, -114, 39, 173, -114, -114, 129, -114, -114, 175, 1031, 1116, 82, -114, -114, -114, -114, 1201, -114 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -114, -114, -114, -114, -114, 46, -113, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, -114, 87, -114, -114, -114, -114, -114 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -93 static const yytype_int16 yytable[] = { 68, 1, -17, 6, 7, 8, 9, 136, -19, -21, -23, -25, -27, -29, -31, -17, -17, -17, -17, 91, 145, 134, 135, 4, 5, 95, 79, 141, 80, 85, 84, 88, 90, -17, -17, -17, 69, -17, -17, 121, 86, 89, 122, 123, 87, 111, 95, 92, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, 96, 97, 10, -17, 70, 124, 68, 132, -17, 137, 138, 139, -17, -17, -19, -21, -23, -25, -27, -29, -31, -17, -17, -17, -17, 142, 143, 144, 140, 146, 93, 147, 83, 148, 149, 151, 150, 134, 152, -17, -17, -17, 69, -17, -17, 104, 105, 106, 107, 108, 109, 110, 153, 154, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, 155, 158, 161, -17, 70, 164, 68, 120, -17, 0, 0, 0, -17, -17, -19, -21, -23, -25, -27, -29, -31, -17, -17, -17, -17, 0, 159, 160, 112, 113, 114, 115, 116, 117, 118, 166, 0, 0, 0, -17, -17, -17, 0, -17, -17, 0, 0, 0, 0, 0, 0, 0, 0, 0, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, 13, 0, 14, -17, 0, 0, 0, 0, 0, 0, 0, 0, -17, -17, 0, 15, 16, 17, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 20, 21, 0, 22, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 13, 0, 14, 61, 0, 0, 0, 0, 0, 0, 0, 0, 62, -3, 0, 15, 16, 17, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 20, 21, 0, 22, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 13, 0, 14, 61, 0, 0, 0, 0, 0, 0, 0, 0, 99, -81, 0, 15, 16, 17, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 20, 21, 0, 22, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 13, 0, 14, 61, 0, 0, 0, 0, 0, 0, 0, 0, 62, 125, 0, 15, 16, 17, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 20, 21, 0, 22, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 13, 0, 14, 61, 0, 0, 0, 0, 0, 0, 0, 0, 62, 126, 0, 15, 16, 17, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 20, 21, 0, 22, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 13, 0, 14, 61, 0, 0, 0, 0, 0, 0, 0, 0, 62, 127, 0, 15, 16, 17, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 20, 21, 0, 22, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 13, 0, 14, 61, 0, 0, 0, 0, 0, 0, 0, 0, 62, 128, 0, 15, 16, 17, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 20, 21, 0, 22, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 13, 0, 14, 61, 0, 0, 0, 0, 0, 0, 0, 0, 62, 129, 0, 15, 16, 17, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 20, 21, 0, 22, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 13, 0, 14, 61, 0, 0, 0, 0, 0, 0, 0, 0, 62, 130, 0, 15, 16, 17, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 20, 21, 0, 22, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 13, 0, 14, 61, 0, 0, 0, 0, 0, 0, 0, 0, 62, 131, 0, 15, 16, 17, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 20, 21, 0, 22, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 13, 0, 14, 61, 0, 0, 0, 0, 0, 0, 0, 0, 62, -92, 0, 15, 16, 17, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 20, 21, 0, 22, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 13, 0, 14, 61, 0, 0, 0, 0, 0, 0, 0, 0, 62, -86, 0, 15, 16, 17, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 20, 21, 0, 22, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 0, 0, 0, 61, 0, 0, 0, 0, 0, 0, 0, 0, 62, -89 }; static const yytype_int16 yycheck[] = { 1, 98, 3, 5, 6, 7, 8, 120, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 3, 133, 98, 99, 0, 4, 38, 99, 3, 99, 10, 9, 13, 15, 34, 35, 36, 37, 38, 39, 40, 11, 14, 43, 44, 12, 32, 38, 31, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 98, 99, 89, 89, 90, 99, 1, 33, 3, 3, 46, 46, 98, 99, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 86, 87, 88, 3, 3, 99, 41, 71, 3, 3, 42, 99, 98, 47, 34, 35, 36, 37, 38, 39, 84, 85, 86, 87, 88, 89, 90, 99, 99, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 3, 48, 3, 89, 90, 99, 1, 96, 3, -1, -1, -1, 98, 99, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, -1, 156, 157, 91, 92, 93, 94, 95, 96, 97, 165, -1, -1, -1, 34, 35, 36, -1, 38, 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 1, -1, 3, 89, -1, -1, -1, -1, -1, -1, -1, -1, 98, 99, -1, 16, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, 35, 36, -1, 38, 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 1, -1, 3, 89, -1, -1, -1, -1, -1, -1, -1, -1, 98, 99, -1, 16, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, 35, 36, -1, 38, 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 1, -1, 3, 89, -1, -1, -1, -1, -1, -1, -1, -1, 98, 99, -1, 16, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, 35, 36, -1, 38, 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 1, -1, 3, 89, -1, -1, -1, -1, -1, -1, -1, -1, 98, 99, -1, 16, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, 35, 36, -1, 38, 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 1, -1, 3, 89, -1, -1, -1, -1, -1, -1, -1, -1, 98, 99, -1, 16, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, 35, 36, -1, 38, 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 1, -1, 3, 89, -1, -1, -1, -1, -1, -1, -1, -1, 98, 99, -1, 16, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, 35, 36, -1, 38, 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 1, -1, 3, 89, -1, -1, -1, -1, -1, -1, -1, -1, 98, 99, -1, 16, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, 35, 36, -1, 38, 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 1, -1, 3, 89, -1, -1, -1, -1, -1, -1, -1, -1, 98, 99, -1, 16, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, 35, 36, -1, 38, 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 1, -1, 3, 89, -1, -1, -1, -1, -1, -1, -1, -1, 98, 99, -1, 16, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, 35, 36, -1, 38, 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 1, -1, 3, 89, -1, -1, -1, -1, -1, -1, -1, -1, 98, 99, -1, 16, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, 35, 36, -1, 38, 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 1, -1, 3, 89, -1, -1, -1, -1, -1, -1, -1, -1, 98, 99, -1, 16, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, 35, 36, -1, 38, 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 1, -1, 3, 89, -1, -1, -1, -1, -1, -1, -1, -1, 98, 99, -1, 16, 17, 18, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 34, 35, 36, -1, 38, 39, -1, -1, -1, -1, -1, -1, -1, -1, -1, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, -1, -1, -1, 89, -1, -1, -1, -1, -1, -1, -1, -1, 98, 99 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 98, 101, 102, 0, 4, 5, 6, 7, 8, 89, 104, 105, 1, 3, 16, 17, 18, 19, 34, 35, 36, 38, 39, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 89, 98, 103, 106, 115, 126, 131, 1, 37, 90, 107, 108, 109, 110, 111, 112, 113, 114, 99, 99, 132, 127, 105, 9, 10, 11, 12, 13, 14, 15, 3, 31, 99, 133, 38, 98, 99, 128, 98, 116, 117, 120, 123, 105, 105, 105, 105, 105, 105, 105, 32, 91, 92, 93, 94, 95, 96, 97, 130, 128, 40, 43, 44, 99, 99, 99, 99, 99, 99, 99, 99, 33, 129, 98, 99, 106, 3, 46, 46, 3, 3, 86, 87, 88, 106, 3, 41, 3, 3, 99, 42, 47, 99, 99, 3, 124, 118, 48, 105, 105, 3, 125, 119, 99, 121, 105, 122 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ else \ { \ yyerror (ctxt, lctxt, YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ #define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (YYID (N)) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ } \ else \ { \ (Current).first_line = (Current).last_line = \ YYRHSLOC (Rhs, 0).last_line; \ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ while (YYID (0)) #endif /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT # if YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ (Loc).first_line, (Loc).first_column, \ (Loc).last_line, (Loc).last_column) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (&yylval, YYLEX_PARAM) #else # define YYLEX yylex (&yylval) #endif /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (YYID (0)) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value, ctxt, lctxt); \ YYFPRINTF (stderr, "\n"); \ } \ } while (YYID (0)) /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *ctxt, void *lctxt) #else static void yy_symbol_value_print (yyoutput, yytype, yyvaluep, ctxt, lctxt) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; void *ctxt; void *lctxt; #endif { if (!yyvaluep) return; YYUSE (ctxt); YYUSE (lctxt); # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # else YYUSE (yyoutput); # endif switch (yytype) { default: break; } } /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *ctxt, void *lctxt) #else static void yy_symbol_print (yyoutput, yytype, yyvaluep, ctxt, lctxt) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; void *ctxt; void *lctxt; #endif { if (yytype < YYNTOKENS) YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep, ctxt, lctxt); YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) #else static void yy_stack_print (yybottom, yytop) yytype_int16 *yybottom; yytype_int16 *yytop; #endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_reduce_print (YYSTYPE *yyvsp, int yyrule, void *ctxt, void *lctxt) #else static void yy_reduce_print (yyvsp, yyrule, ctxt, lctxt) YYSTYPE *yyvsp; int yyrule; void *ctxt; void *lctxt; #endif { int yynrhs = yyr2[yyrule]; int yyi; unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) , ctxt, lctxt); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyvsp, Rule, ctxt, lctxt); \ } while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) #else static YYSIZE_T yystrlen (yystr) const char *yystr; #endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) #else static char * yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; #endif { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return yystpcpy (yyres, yystr) - yyres; } # endif /* Copy into YYRESULT an error message about the unexpected token YYCHAR while in state YYSTATE. Return the number of bytes copied, including the terminating null byte. If YYRESULT is null, do not copy anything; just return the number of bytes that would be copied. As a special case, return 0 if an ordinary "syntax error" message will do. Return YYSIZE_MAXIMUM if overflow occurs during size calculation. */ static YYSIZE_T yysyntax_error (char *yyresult, int yystate, int yychar) { int yyn = yypact[yystate]; if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) return 0; else { int yytype = YYTRANSLATE (yychar); YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); YYSIZE_T yysize = yysize0; YYSIZE_T yysize1; int yysize_overflow = 0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; int yyx; # if 0 /* This is so xgettext sees the translatable formats that are constructed on the fly. */ YY_("syntax error, unexpected %s"); YY_("syntax error, unexpected %s, expecting %s"); YY_("syntax error, unexpected %s, expecting %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); # endif char *yyfmt; char const *yyf; static char const yyunexpected[] = "syntax error, unexpected %s"; static char const yyexpecting[] = ", expecting %s"; static char const yyor[] = " or %s"; char yyformat[sizeof yyunexpected + sizeof yyexpecting - 1 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) * (sizeof yyor - 1))]; char const *yyprefix = yyexpecting; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yycount = 1; yyarg[0] = yytname[yytype]; yyfmt = yystpcpy (yyformat, yyunexpected); for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; yyformat[sizeof yyunexpected - 1] = '\0'; break; } yyarg[yycount++] = yytname[yyx]; yysize1 = yysize + yytnamerr (0, yytname[yyx]); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; yyfmt = yystpcpy (yyfmt, yyprefix); yyprefix = yyor; } yyf = YY_(yyformat); yysize1 = yysize + yystrlen (yyf); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; if (yysize_overflow) return YYSIZE_MAXIMUM; if (yyresult) { /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ char *yyp = yyresult; int yyi = 0; while ((*yyp = *yyf) != '\0') { if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyf += 2; } else { yyp++; yyf++; } } } return yysize; } } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, void *ctxt, void *lctxt) #else static void yydestruct (yymsg, yytype, yyvaluep, ctxt, lctxt) const char *yymsg; int yytype; YYSTYPE *yyvaluep; void *ctxt; void *lctxt; #endif { YYUSE (yyvaluep); YYUSE (ctxt); YYUSE (lctxt); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); #else int yyparse (); #endif #else /* ! YYPARSE_PARAM */ #if defined __STDC__ || defined __cplusplus int yyparse (void *ctxt, void *lctxt); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /*-------------------------. | yyparse or yypush_parse. | `-------------------------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void *YYPARSE_PARAM) #else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; #endif #else /* ! YYPARSE_PARAM */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void *ctxt, void *lctxt) #else int yyparse (ctxt, lctxt) void *ctxt; void *lctxt; #endif #endif { /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: `yyss': related to states. `yyvs': related to semantic values. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs; YYSTYPE *yyvsp; YYSIZE_T yystacksize; int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ int yytoken; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; yytoken = 0; yyss = yyssa; yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); if (yystate == YYFINAL) YYACCEPT; goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token. */ yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: /* Line 1455 of yacc.c */ #line 195 "rtfGrammar.y" { GSRTFstart(CTXT); ;} break; case 3: /* Line 1455 of yacc.c */ #line 195 "rtfGrammar.y" { GSRTFstop(CTXT); ;} break; case 5: /* Line 1455 of yacc.c */ #line 198 "rtfGrammar.y" { (yyval.number) = 1; ;} break; case 6: /* Line 1455 of yacc.c */ #line 199 "rtfGrammar.y" { (yyval.number) = 2; ;} break; case 7: /* Line 1455 of yacc.c */ #line 200 "rtfGrammar.y" { (yyval.number) = 3; ;} break; case 8: /* Line 1455 of yacc.c */ #line 201 "rtfGrammar.y" { (yyval.number) = 4; ;} break; case 9: /* Line 1455 of yacc.c */ #line 203 "rtfGrammar.y" { (yyval.number) = 1; free((void*)(yyvsp[(1) - (1)].cmd).name); ;} break; case 14: /* Line 1455 of yacc.c */ #line 210 "rtfGrammar.y" { GSRTFmangleText(CTXT, (yyvsp[(2) - (2)].text)); free((void *)(yyvsp[(2) - (2)].text)); ;} break; case 17: /* Line 1455 of yacc.c */ #line 215 "rtfGrammar.y" { GSRTFopenBlock(CTXT, NO); ;} break; case 18: /* Line 1455 of yacc.c */ #line 215 "rtfGrammar.y" { GSRTFcloseBlock(CTXT, NO); ;} break; case 19: /* Line 1455 of yacc.c */ #line 216 "rtfGrammar.y" { GSRTFopenBlock(CTXT, YES); ;} break; case 20: /* Line 1455 of yacc.c */ #line 216 "rtfGrammar.y" { GSRTFcloseBlock(CTXT, YES); ;} break; case 21: /* Line 1455 of yacc.c */ #line 217 "rtfGrammar.y" { GSRTFopenBlock(CTXT, YES); ;} break; case 22: /* Line 1455 of yacc.c */ #line 217 "rtfGrammar.y" { GSRTFcloseBlock(CTXT, YES); ;} break; case 23: /* Line 1455 of yacc.c */ #line 218 "rtfGrammar.y" { GSRTFopenBlock(CTXT, YES); ;} break; case 24: /* Line 1455 of yacc.c */ #line 218 "rtfGrammar.y" { GSRTFcloseBlock(CTXT, YES); ;} break; case 25: /* Line 1455 of yacc.c */ #line 219 "rtfGrammar.y" { GSRTFopenBlock(CTXT, YES); ;} break; case 26: /* Line 1455 of yacc.c */ #line 219 "rtfGrammar.y" { GSRTFcloseBlock(CTXT, YES); ;} break; case 27: /* Line 1455 of yacc.c */ #line 220 "rtfGrammar.y" { GSRTFopenBlock(CTXT, YES); ;} break; case 28: /* Line 1455 of yacc.c */ #line 220 "rtfGrammar.y" { GSRTFcloseBlock(CTXT, YES); ;} break; case 29: /* Line 1455 of yacc.c */ #line 221 "rtfGrammar.y" { GSRTFopenBlock(CTXT, YES); ;} break; case 30: /* Line 1455 of yacc.c */ #line 221 "rtfGrammar.y" { GSRTFcloseBlock(CTXT, YES); ;} break; case 31: /* Line 1455 of yacc.c */ #line 222 "rtfGrammar.y" { GSRTFopenBlock(CTXT, YES); ;} break; case 32: /* Line 1455 of yacc.c */ #line 222 "rtfGrammar.y" { GSRTFcloseBlock(CTXT, YES); ;} break; case 34: /* Line 1455 of yacc.c */ #line 231 "rtfGrammar.y" { int font; if ((yyvsp[(1) - (1)].cmd).isEmpty) font = 0; else font = (yyvsp[(1) - (1)].cmd).parameter; GSRTFfontNumber(CTXT, font); ;} break; case 35: /* Line 1455 of yacc.c */ #line 238 "rtfGrammar.y" { int size; if ((yyvsp[(1) - (1)].cmd).isEmpty) size = 24; else size = (yyvsp[(1) - (1)].cmd).parameter; GSRTFfontSize(CTXT, size); ;} break; case 36: /* Line 1455 of yacc.c */ #line 245 "rtfGrammar.y" { int width; if ((yyvsp[(1) - (1)].cmd).isEmpty) width = 12240; else width = (yyvsp[(1) - (1)].cmd).parameter; GSRTFpaperWidth(CTXT, width);;} break; case 37: /* Line 1455 of yacc.c */ #line 252 "rtfGrammar.y" { int height; if ((yyvsp[(1) - (1)].cmd).isEmpty) height = 15840; else height = (yyvsp[(1) - (1)].cmd).parameter; GSRTFpaperHeight(CTXT, height);;} break; case 38: /* Line 1455 of yacc.c */ #line 259 "rtfGrammar.y" { int margin; if ((yyvsp[(1) - (1)].cmd).isEmpty) margin = 1800; else margin = (yyvsp[(1) - (1)].cmd).parameter; GSRTFmarginLeft(CTXT, margin);;} break; case 39: /* Line 1455 of yacc.c */ #line 266 "rtfGrammar.y" { int margin; if ((yyvsp[(1) - (1)].cmd).isEmpty) margin = 1800; else margin = (yyvsp[(1) - (1)].cmd).parameter; GSRTFmarginRight(CTXT, margin); ;} break; case 40: /* Line 1455 of yacc.c */ #line 273 "rtfGrammar.y" { int margin; if ((yyvsp[(1) - (1)].cmd).isEmpty) margin = 1440; else margin = (yyvsp[(1) - (1)].cmd).parameter; GSRTFmarginTop(CTXT, margin); ;} break; case 41: /* Line 1455 of yacc.c */ #line 280 "rtfGrammar.y" { int margin; if ((yyvsp[(1) - (1)].cmd).isEmpty) margin = 1440; else margin = (yyvsp[(1) - (1)].cmd).parameter; GSRTFmarginButtom(CTXT, margin); ;} break; case 42: /* Line 1455 of yacc.c */ #line 287 "rtfGrammar.y" { int indent; if ((yyvsp[(1) - (1)].cmd).isEmpty) indent = 0; else indent = (yyvsp[(1) - (1)].cmd).parameter; GSRTFfirstLineIndent(CTXT, indent); ;} break; case 43: /* Line 1455 of yacc.c */ #line 294 "rtfGrammar.y" { int indent; if ((yyvsp[(1) - (1)].cmd).isEmpty) indent = 0; else indent = (yyvsp[(1) - (1)].cmd).parameter; GSRTFleftIndent(CTXT, indent);;} break; case 44: /* Line 1455 of yacc.c */ #line 301 "rtfGrammar.y" { int indent; if ((yyvsp[(1) - (1)].cmd).isEmpty) indent = 0; else indent = (yyvsp[(1) - (1)].cmd).parameter; GSRTFrightIndent(CTXT, indent);;} break; case 45: /* Line 1455 of yacc.c */ #line 308 "rtfGrammar.y" { int location; if ((yyvsp[(1) - (1)].cmd).isEmpty) location = 0; else location = (yyvsp[(1) - (1)].cmd).parameter; GSRTFtabstop(CTXT, location);;} break; case 46: /* Line 1455 of yacc.c */ #line 315 "rtfGrammar.y" { GSRTFalignCenter(CTXT); ;} break; case 47: /* Line 1455 of yacc.c */ #line 316 "rtfGrammar.y" { GSRTFalignJustified(CTXT); ;} break; case 48: /* Line 1455 of yacc.c */ #line 317 "rtfGrammar.y" { GSRTFalignLeft(CTXT); ;} break; case 49: /* Line 1455 of yacc.c */ #line 318 "rtfGrammar.y" { GSRTFalignRight(CTXT); ;} break; case 50: /* Line 1455 of yacc.c */ #line 319 "rtfGrammar.y" { int space; if ((yyvsp[(1) - (1)].cmd).isEmpty) space = 0; else space = (yyvsp[(1) - (1)].cmd).parameter; GSRTFspaceAbove(CTXT, space); ;} break; case 51: /* Line 1455 of yacc.c */ #line 326 "rtfGrammar.y" { GSRTFlineSpace(CTXT, (yyvsp[(1) - (1)].cmd).parameter); ;} break; case 52: /* Line 1455 of yacc.c */ #line 327 "rtfGrammar.y" { GSRTFdefaultParagraph(CTXT); ;} break; case 53: /* Line 1455 of yacc.c */ #line 328 "rtfGrammar.y" { GSRTFstyle(CTXT, (yyvsp[(1) - (1)].cmd).parameter); ;} break; case 54: /* Line 1455 of yacc.c */ #line 329 "rtfGrammar.y" { int color; if ((yyvsp[(1) - (1)].cmd).isEmpty) color = 0; else color = (yyvsp[(1) - (1)].cmd).parameter; GSRTFcolorbg(CTXT, color); ;} break; case 55: /* Line 1455 of yacc.c */ #line 336 "rtfGrammar.y" { int color; if ((yyvsp[(1) - (1)].cmd).isEmpty) color = 0; else color = (yyvsp[(1) - (1)].cmd).parameter; GSRTFcolorfg(CTXT, color); ;} break; case 56: /* Line 1455 of yacc.c */ #line 343 "rtfGrammar.y" { int color; if ((yyvsp[(1) - (1)].cmd).isEmpty) color = 0; else color = (yyvsp[(1) - (1)].cmd).parameter; GSRTFunderlinecolor(CTXT, color); ;} break; case 57: /* Line 1455 of yacc.c */ #line 350 "rtfGrammar.y" { int script; if ((yyvsp[(1) - (1)].cmd).isEmpty) script = 6; else script = (yyvsp[(1) - (1)].cmd).parameter; GSRTFsubscript(CTXT, script); ;} break; case 58: /* Line 1455 of yacc.c */ #line 357 "rtfGrammar.y" { int script; if ((yyvsp[(1) - (1)].cmd).isEmpty) script = 6; else script = (yyvsp[(1) - (1)].cmd).parameter; GSRTFsuperscript(CTXT, script); ;} break; case 59: /* Line 1455 of yacc.c */ #line 364 "rtfGrammar.y" { BOOL on; if ((yyvsp[(1) - (1)].cmd).isEmpty || (yyvsp[(1) - (1)].cmd).parameter) on = YES; else on = NO; GSRTFbold(CTXT, on); ;} break; case 60: /* Line 1455 of yacc.c */ #line 371 "rtfGrammar.y" { BOOL on; if ((yyvsp[(1) - (1)].cmd).isEmpty || (yyvsp[(1) - (1)].cmd).parameter) on = YES; else on = NO; GSRTFitalic(CTXT, on); ;} break; case 61: /* Line 1455 of yacc.c */ #line 378 "rtfGrammar.y" { BOOL on; if ((yyvsp[(1) - (1)].cmd).isEmpty || (yyvsp[(1) - (1)].cmd).parameter) on = YES; else on = NO; GSRTFunderline(CTXT, on, NSUnderlineStyleSingle | NSUnderlinePatternSolid); ;} break; case 62: /* Line 1455 of yacc.c */ #line 385 "rtfGrammar.y" { BOOL on; if ((yyvsp[(1) - (1)].cmd).isEmpty || (yyvsp[(1) - (1)].cmd).parameter) on = YES; else on = NO; GSRTFunderline(CTXT, on, NSUnderlineStyleSingle | NSUnderlinePatternDot); ;} break; case 63: /* Line 1455 of yacc.c */ #line 392 "rtfGrammar.y" { BOOL on; if ((yyvsp[(1) - (1)].cmd).isEmpty || (yyvsp[(1) - (1)].cmd).parameter) on = YES; else on = NO; GSRTFunderline(CTXT, on, NSUnderlineStyleSingle | NSUnderlinePatternDash); ;} break; case 64: /* Line 1455 of yacc.c */ #line 399 "rtfGrammar.y" { BOOL on; if ((yyvsp[(1) - (1)].cmd).isEmpty || (yyvsp[(1) - (1)].cmd).parameter) on = YES; else on = NO; GSRTFunderline(CTXT, on, NSUnderlineStyleSingle | NSUnderlinePatternDashDot); ;} break; case 65: /* Line 1455 of yacc.c */ #line 406 "rtfGrammar.y" { BOOL on; if ((yyvsp[(1) - (1)].cmd).isEmpty || (yyvsp[(1) - (1)].cmd).parameter) on = YES; else on = NO; GSRTFunderline(CTXT, on, NSUnderlineStyleSingle | NSUnderlinePatternDashDotDot); ;} break; case 66: /* Line 1455 of yacc.c */ #line 413 "rtfGrammar.y" { BOOL on; if ((yyvsp[(1) - (1)].cmd).isEmpty || (yyvsp[(1) - (1)].cmd).parameter) on = YES; else on = NO; GSRTFunderline(CTXT, on, NSUnderlineStyleDouble | NSUnderlinePatternSolid); ;} break; case 67: /* Line 1455 of yacc.c */ #line 420 "rtfGrammar.y" { GSRTFunderline(CTXT, NO, NSUnderlineStyleNone); ;} break; case 68: /* Line 1455 of yacc.c */ #line 421 "rtfGrammar.y" { BOOL on; if ((yyvsp[(1) - (1)].cmd).isEmpty || (yyvsp[(1) - (1)].cmd).parameter) on = YES; else on = NO; GSRTFunderline(CTXT, on, NSUnderlineStyleThick | NSUnderlinePatternSolid); ;} break; case 69: /* Line 1455 of yacc.c */ #line 428 "rtfGrammar.y" { BOOL on; if ((yyvsp[(1) - (1)].cmd).isEmpty || (yyvsp[(1) - (1)].cmd).parameter) on = YES; else on = NO; GSRTFunderline(CTXT, on, NSUnderlineStyleThick | NSUnderlinePatternDot); ;} break; case 70: /* Line 1455 of yacc.c */ #line 435 "rtfGrammar.y" { BOOL on; if ((yyvsp[(1) - (1)].cmd).isEmpty || (yyvsp[(1) - (1)].cmd).parameter) on = YES; else on = NO; GSRTFunderline(CTXT, on, NSUnderlineStyleThick | NSUnderlinePatternDash); ;} break; case 71: /* Line 1455 of yacc.c */ #line 442 "rtfGrammar.y" { BOOL on; if ((yyvsp[(1) - (1)].cmd).isEmpty || (yyvsp[(1) - (1)].cmd).parameter) on = YES; else on = NO; GSRTFunderline(CTXT, on, NSUnderlineStyleThick | NSUnderlinePatternDashDot); ;} break; case 72: /* Line 1455 of yacc.c */ #line 449 "rtfGrammar.y" { BOOL on; if ((yyvsp[(1) - (1)].cmd).isEmpty || (yyvsp[(1) - (1)].cmd).parameter) on = YES; else on = NO; GSRTFunderline(CTXT, on, NSUnderlineStyleThick | NSUnderlinePatternDashDotDot); ;} break; case 73: /* Line 1455 of yacc.c */ #line 456 "rtfGrammar.y" { BOOL on; if ((yyvsp[(1) - (1)].cmd).isEmpty || (yyvsp[(1) - (1)].cmd).parameter) on = YES; else on = NO; GSRTFunderline(CTXT, on, NSUnderlineStyleSingle | NSUnderlinePatternSolid | NSUnderlineByWordMask); ;} break; case 74: /* Line 1455 of yacc.c */ #line 463 "rtfGrammar.y" { NSInteger style; if ((yyvsp[(1) - (1)].cmd).isEmpty || (yyvsp[(1) - (1)].cmd).parameter) style = NSUnderlineStyleSingle | NSUnderlinePatternSolid; else style = NSUnderlineStyleNone; GSRTFstrikethrough(CTXT, style); ;} break; case 75: /* Line 1455 of yacc.c */ #line 469 "rtfGrammar.y" { GSRTFstrikethrough(CTXT, NSUnderlineStyleDouble | NSUnderlinePatternSolid); ;} break; case 76: /* Line 1455 of yacc.c */ #line 470 "rtfGrammar.y" { GSRTFunicode(CTXT, (yyvsp[(1) - (1)].cmd).parameter); ;} break; case 77: /* Line 1455 of yacc.c */ #line 471 "rtfGrammar.y" { GSRTFdefaultCharacterStyle(CTXT); ;} break; case 78: /* Line 1455 of yacc.c */ #line 472 "rtfGrammar.y" { GSRTFparagraph(CTXT); ;} break; case 79: /* Line 1455 of yacc.c */ #line 473 "rtfGrammar.y" { GSRTFparagraph(CTXT); ;} break; case 80: /* Line 1455 of yacc.c */ #line 474 "rtfGrammar.y" { GSRTFgenericRTFcommand(CTXT, (yyvsp[(1) - (1)].cmd)); free((void*)(yyvsp[(1) - (1)].cmd).name); ;} break; case 85: /* Line 1455 of yacc.c */ #line 493 "rtfGrammar.y" { GSRTFopenBlock(CTXT, YES); ;} break; case 86: /* Line 1455 of yacc.c */ #line 493 "rtfGrammar.y" { GSRTFcloseBlock(CTXT, YES); ;} break; case 87: /* Line 1455 of yacc.c */ #line 494 "rtfGrammar.y" { GSRTFNeXTGraphic (CTXT, (yyvsp[(3) - (9)].text), (yyvsp[(4) - (9)].cmd).parameter, (yyvsp[(5) - (9)].cmd).parameter); ;} break; case 88: /* Line 1455 of yacc.c */ #line 508 "rtfGrammar.y" { GSRTFopenBlock(CTXT, YES); ;} break; case 89: /* Line 1455 of yacc.c */ #line 508 "rtfGrammar.y" { GSRTFcloseBlock(CTXT, YES); ;} break; case 90: /* Line 1455 of yacc.c */ #line 509 "rtfGrammar.y" { GSRTFNeXTHelpLink (CTXT, (yyvsp[(2) - (12)].cmd).parameter, (yyvsp[(4) - (12)].text), (yyvsp[(6) - (12)].text), (yyvsp[(8) - (12)].text)); ;} break; case 91: /* Line 1455 of yacc.c */ #line 522 "rtfGrammar.y" { GSRTFopenBlock(CTXT, YES); ;} break; case 92: /* Line 1455 of yacc.c */ #line 522 "rtfGrammar.y" { GSRTFcloseBlock(CTXT, YES); ;} break; case 93: /* Line 1455 of yacc.c */ #line 523 "rtfGrammar.y" { GSRTFNeXTHelpMarker (CTXT, (yyvsp[(2) - (8)].cmd).parameter, (yyvsp[(4) - (8)].text)); ;} break; case 98: /* Line 1455 of yacc.c */ #line 538 "rtfGrammar.y" { free((void *)(yyvsp[(5) - (6)].text));;} break; case 99: /* Line 1455 of yacc.c */ #line 543 "rtfGrammar.y" { GSRTFregisterFont(CTXT, (yyvsp[(4) - (4)].text), (yyvsp[(2) - (4)].number), (yyvsp[(1) - (4)].cmd).parameter); free((void *)(yyvsp[(4) - (4)].text)); ;} break; case 105: /* Line 1455 of yacc.c */ #line 556 "rtfGrammar.y" { (yyval.number) = RTFfamilyNil - RTFfamilyNil; ;} break; case 106: /* Line 1455 of yacc.c */ #line 557 "rtfGrammar.y" { (yyval.number) = RTFfamilyRoman - RTFfamilyNil; ;} break; case 107: /* Line 1455 of yacc.c */ #line 558 "rtfGrammar.y" { (yyval.number) = RTFfamilySwiss - RTFfamilyNil; ;} break; case 108: /* Line 1455 of yacc.c */ #line 559 "rtfGrammar.y" { (yyval.number) = RTFfamilyModern - RTFfamilyNil; ;} break; case 109: /* Line 1455 of yacc.c */ #line 560 "rtfGrammar.y" { (yyval.number) = RTFfamilyScript - RTFfamilyNil; ;} break; case 110: /* Line 1455 of yacc.c */ #line 561 "rtfGrammar.y" { (yyval.number) = RTFfamilyDecor - RTFfamilyNil; ;} break; case 111: /* Line 1455 of yacc.c */ #line 562 "rtfGrammar.y" { (yyval.number) = RTFfamilyTech - RTFfamilyNil; ;} break; case 115: /* Line 1455 of yacc.c */ #line 579 "rtfGrammar.y" { GSRTFaddColor(CTXT, (yyvsp[(1) - (4)].cmd).parameter, (yyvsp[(2) - (4)].cmd).parameter, (yyvsp[(3) - (4)].cmd).parameter); free((void *)(yyvsp[(4) - (4)].text)); ;} break; case 116: /* Line 1455 of yacc.c */ #line 584 "rtfGrammar.y" { GSRTFaddDefaultColor(CTXT); free((void *)(yyvsp[(1) - (1)].text)); ;} break; /* Line 1455 of yacc.c */ #line 2750 "rtfGrammar.tab.m" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (ctxt, lctxt, YY_("syntax error")); #else { YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) { YYSIZE_T yyalloc = 2 * yysize; if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) yyalloc = YYSTACK_ALLOC_MAXIMUM; if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yyalloc); if (yymsg) yymsg_alloc = yyalloc; else { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; } } if (0 < yysize && yysize <= yymsg_alloc) { (void) yysyntax_error (yymsg, yystate, yychar); yyerror (ctxt, lctxt, yymsg); } else { yyerror (ctxt, lctxt, YY_("syntax error")); if (yysize != 0) goto yyexhaustedlab; } } #endif } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval, ctxt, lctxt); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto yyerrorlab; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", yystos[yystate], yyvsp, ctxt, lctxt); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } *++yyvsp = yylval; /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #if !defined(yyoverflow) || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (ctxt, lctxt, YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: if (yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval, ctxt, lctxt); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp, ctxt, lctxt); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif /* Make sure YYID is used. */ return YYID (yyresult); } /* Line 1675 of yacc.c */ #line 596 "rtfGrammar.y" /* some C code here */ gnustep-gui-0.24.0/TextConverters/RTF/rtfScanner.m0000664000076500007650000003063611531021636021665 0ustar brains99brains99/* rtcScanner Copyright (C) 1999 Free Software Foundation, Inc. Author: Stefan Boehringer (stefan.boehringer@uni-bochum.de) Date: Dec 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include #include #include "rtfScanner.h" #include "rtfGrammar.tab.h" // <§> scanner types and helpers #define CArraySize(a) (sizeof(a)/sizeof((a)[0])-1) typedef struct { char *bf; int length, position, chunkSize; } DynamicString; typedef struct { const char *string; int token; } LexKeyword; GSLexError initDynamicString (DynamicString *string) { string->length = 0, string->position = 0, string->chunkSize = 128; string->bf = calloc(1, string->length = string->chunkSize); if (!string->bf) { return LEXoutOfMemory; } return NoError; } GSLexError appendChar (DynamicString *string, int c) { if (string->position == string->length) { if (!(string->bf = realloc(string->bf, string->length += string->chunkSize))) { return LEXoutOfMemory; } else { string->chunkSize <<= 1; } } string->bf[string->position++] = c; return NoError; } void lexInitContext (RTFscannerCtxt *lctxt, void *customContext, int (*getcharFunction)(void *)) { lctxt->streamLineNumber = 1; lctxt->streamPosition = lctxt->pushbackCount = 0; lctxt->lgetchar = getcharFunction; lctxt->customContext = customContext; } int lexGetchar (RTFscannerCtxt *lctxt) { int c; if (lctxt->pushbackCount) { lctxt->pushbackCount--; c = lctxt->pushbackBuffer[lctxt->pushbackCount]; } else { lctxt->streamPosition++; c = lctxt->lgetchar(lctxt->customContext); } if (c == '\n') { lctxt->streamLineNumber++; } return c; } void lexUngetchar (RTFscannerCtxt *lctxt, int c) { if (c == '\n') { lctxt->streamLineNumber--; } lctxt->pushbackBuffer[lctxt->pushbackCount++] = c; // no checking here } int lexStreamPosition (RTFscannerCtxt *lctxt) { return lctxt->streamPosition - lctxt->pushbackCount; } char *my_strdup (const char *str) { char *copy = str? malloc (strlen (str) + 1): 0; return !copy? 0: strcpy(copy, str); } int findStringFromKeywordArray(const char *string, const LexKeyword *array, int arrayCount) { int min, max, mid, cmp; const LexKeyword *currentKeyword; for (min = 0, max = arrayCount; min <= max; ) { mid = (min + max)>>1; currentKeyword = array + mid; if (!(cmp = strcmp (string, currentKeyword->string))) { return currentKeyword->token; } else if (cmp > 0) { min = mid + 1; } else { max = mid - 1; } } return 0; // couldn't find } // end <§> scanner types and helpers // <§> core scanner functions #define token(a) (a) // must be sorted LexKeyword RTFcommands[] = { {"NeXTGraphic",token(RTFNeXTGraphic)}, {"NeXTHelpLink",token(RTFNeXTHelpLink)}, {"NeXTHelpMarker",token(RTFNeXTHelpMarker)}, {"ansi", token(RTFansi)}, {"b", token(RTFbold)}, {"blue", token(RTFblue)}, {"bullet", token(RTFbullet)}, {"cb", token(RTFcolorbg)}, {"cell", token(RTFcell)}, {"cf", token(RTFcolorfg)}, {"colortbl", token(RTFcolortable)}, {"cpg", token(RTFcpg)}, {"dn", token(RTFsubscript)}, {"emdash", token(RTFemdash)}, {"emspace", token(RTFemspace)}, {"endash", token(RTFendash)}, {"enspace", token(RTFenspace)}, {"f", token(RTFfont)}, {"fcharset", token(RTFfcharset)}, {"fdecor", token(RTFfamilyDecor)}, {"fi", token(RTFfirstLineIndent)}, {"filename", token(RTFNeXTfilename)}, {"fmodern", token(RTFfamilyModern)}, {"fnil", token(RTFfamilyNil)}, {"fonttbl", token(RTFfontListStart)}, /* All footers are mapped on one entry */ {"footer", token(RTFfooter)}, {"footerf", token(RTFfooter)}, {"footerl", token(RTFfooter)}, {"footerr", token(RTFfooter)}, {"footnote", token(RTFfootnote)}, {"fprq", token(RTFfprq)}, {"froman", token(RTFfamilyRoman)}, {"fs", token(RTFfontSize)}, {"fscript", token(RTFfamilyScript)}, {"fswiss", token(RTFfamilySwiss)}, {"ftech", token(RTFfamilyTech)}, {"green", token(RTFgreen)}, /* All headers are mapped on one entry */ {"header", token(RTFheader)}, {"headerf", token(RTFheader)}, {"headerl", token(RTFheader)}, {"headerr", token(RTFheader)}, {"height", token(RTFNeXTGraphicHeight)}, {"i", token(RTFitalic)}, {"info", token(RTFinfo)}, {"ldblquote", token(RTFldblquote)}, {"li", token(RTFleftIndent)}, {"linkFilename",token(RTFNeXTlinkFilename)}, {"linkMarkername",token(RTFNeXTlinkMarkername)}, {"lquote", token(RTFlquote)}, {"mac", token(RTFmac)}, {"margb", token(RTFmarginButtom)}, {"margl", token(RTFmarginLeft)}, {"margr", token(RTFmarginRight)}, {"margt", token(RTFmarginTop)}, {"markername",token(RTFNeXTmarkername)}, {"paperh", token(RTFpaperHeight)}, {"paperw", token(RTFpaperWidth)}, {"par", token(RTFparagraph)}, {"pard", token(RTFdefaultParagraph)}, {"pc", token(RTFpc)}, {"pca", token(RTFpca)}, {"pict", token(RTFpict)}, {"plain", token(RTFplain)}, {"qc", token(RTFalignCenter)}, {"qj", token(RTFalignJustified)}, {"ql", token(RTFalignLeft)}, {"qr", token(RTFalignRight)}, {"rdblquote", token(RTFrdblquote)}, {"red", token(RTFred)}, {"ri", token(RTFrightIndent)}, {"row", token(RTFrow)}, {"rquote", token(RTFrquote)}, {"rtf", token(RTFstart)}, {"s", token(RTFstyle)}, {"sa", token(RTFspaceAbove)}, {"sl", token(RTFlineSpace)}, {"strike", token(RTFstrikethrough)}, {"striked1", token(RTFstrikethroughDouble)}, {"stylesheet",token(RTFstylesheet)}, {"tab", token(RTFtabulator)}, {"tx", token(RTFtabstop)}, {"u", token(RTFunichar)}, {"ul", token(RTFunderline)}, {"ulc", token(RTFunderlinecolor)}, {"uld", token(RTFunderlineDot)}, {"uldash", token(RTFunderlineDash)}, {"uldashd", token(RTFunderlineDashDot)}, {"uldashdd", token(RTFunderlineDashDotDot)}, {"uldb", token(RTFunderlineDouble)}, {"ulnone", token(RTFunderlineStop)}, {"ulth", token(RTFunderlineThick)}, {"ulthd", token(RTFunderlineThickDot)}, {"ulthdash", token(RTFunderlineThickDash)}, {"ulthdashd", token(RTFunderlineThickDashDot)}, {"ulthdashdd",token(RTFunderlineThickDashDotDot)}, {"ulw", token(RTFunderlineWord)}, {"up", token(RTFsuperscript)}, {"width", token(RTFNeXTGraphicWidth)} }; BOOL probeCommand (RTFscannerCtxt *lctxt) { int c = lexGetchar(lctxt); lexUngetchar (lctxt, c); if (isalpha(c)) { return YES; } return NO; } // According to spec a cmdLength of 32 is respected #define RTFMaxCmdLength 32 #define RTFMaxArgumentLength 64 GSLexError readCommand (RTFscannerCtxt *lctxt, YYSTYPE *lvalp, int *token) // the '\\' is already read { char cmdNameBf[RTFMaxCmdLength+1], *cmdName = cmdNameBf; char argumentBf[RTFMaxArgumentLength+1], *argument = argumentBf; int c, foundToken; lvalp->cmd.name = 0; // initialize while (isalpha (c = lexGetchar(lctxt))) { *cmdName++ = c; if (cmdName >= cmdNameBf + RTFMaxCmdLength) { return LEXsyntaxError; } } *cmdName = 0; if (!(foundToken = findStringFromKeywordArray(cmdNameBf, RTFcommands, CArraySize(RTFcommands)))) { if (!(lvalp->cmd.name = my_strdup(cmdNameBf))) { return LEXoutOfMemory; } *token = RTFOtherStatement; } else { *token = foundToken; } if (c == ' ') // this is an empty argument { lvalp->cmd.isEmpty = YES; } else if (isdigit(c) || c == '-') // we've found a numerical argument { do { *argument++ = c; if (argument >= argumentBf + RTFMaxArgumentLength) { return LEXsyntaxError; } } while (isdigit(c = lexGetchar(lctxt))); *argument = 0; if (c != ' ') { lexUngetchar(lctxt, c); // ungetc non-digit } // the consumption of the space seems necessary on NeXT but // is not according to spec lvalp->cmd.isEmpty = NO; lvalp->cmd.parameter = atoi(argumentBf); } else { lvalp->cmd.isEmpty = YES; lexUngetchar(lctxt, c); // ungetc non-whitespace delimiter } return NoError; } GSLexError readText (RTFscannerCtxt *lctxt, YYSTYPE *lvalp) { int c; DynamicString text; GSLexError error; if ((error = initDynamicString(&text))) { return error; } for (;;) { c = lexGetchar(lctxt); if (c == EOF || c == '{' || c == '}' || c == '\\') { lexUngetchar(lctxt, c); break; } else { // newline and cr are ignored if not quoted if (c != '\n' && c != '\r') { appendChar(&text, c); } } } appendChar(&text, 0); lvalp->text = text.bf; // release is up to the consumer return NoError; } // read in a character as two hex digit static int gethex(RTFscannerCtxt *lctxt) { int c = 0; int i; for (i = 0; i < 2; i++) { int c1 = lexGetchar(lctxt); if (!isxdigit(c1)) { lexUngetchar(lctxt, c1); break; } else { c = c * 16; if (isdigit(c1)) { c += c1 - '0'; } else if (isupper(c1)) { c += c1 - 'A' + 10; } else { c += c1 - 'a' + 10; } } } return c; } int GSRTFlex (YYSTYPE *lvalp, //YYLTYPE *llocp, RTFscannerCtxt *lctxt) /* provide value and position in the params */ { int c; int token = 0; char *cv; do { c = lexGetchar(lctxt); } while ( c == '\n' || c == '\r' ); // the listed characters are to be ignored switch (c) { case EOF: { token = 0; break; } case '{': { token = '{'; break; } case '}': { token = '}'; break; } case '\\': if (probeCommand(lctxt) == YES) { readCommand(lctxt, lvalp, &token); switch (token) { case RTFtabulator: c = '\t'; break; case RTFcell: c = '\t'; break; case RTFemdash: c = '-'; break; case RTFendash: c = '-'; break; case RTFbullet: c = '*'; break; case RTFlquote: c = '`'; break; case RTFrquote: c = '\''; break; case RTFldblquote: c = '"'; break; case RTFrdblquote: c = '"'; break; default: return token; } } else { c = lexGetchar(lctxt); switch (c) { case EOF: token = 0; return token; case '\'': // Convert the next two hex digits into a char c = gethex(lctxt); break; case '*': return RTFignore; case '|': case '-': case ':': // Ignore these characters c = lexGetchar(lctxt); break; case '_': c = '-'; break; case '~': c = ' '; break; case '\n': case '\r': return RTFparagraph; case '{': case '}': case '\\': // release is up to the consumer cv = calloc(1, 2); cv[0] = c; cv[1] = '\0'; lvalp->text = cv; token = RTFtext; return token; default: // fall through break; } } // else fall through to default: read text // no break default: lexUngetchar(lctxt, c); readText(lctxt, lvalp); token = RTFtext; break; } //*llocp = lctxt->position(); return token; } gnustep-gui-0.24.0/TextConverters/RTF/RTFProducer.m0000664000076500007650000010524112010277645021720 0ustar brains99brains99/* RTFProducer.m Writes out a NSAttributedString as RTF Copyright (C) 1999 Free Software Foundation, Inc. Author: Daniel Boehringer Date: November 1999 Modifications: Fred Kiefer Date: June 2000 Modifications: Axel Katerbau Date: April 2003 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #import #import #import #import "RTFProducer.h" // FIXME: Should be defined in a central place #define PAPERSIZE @"PaperSize" #define LEFTMARGIN @"LeftMargin" #define RIGHTMARGIN @"RightMargin" #define TOPMARGIN @"TopMargin" #define BUTTOMMARGIN @"ButtomMargin" #define HYPHENATIONFACTOR @"HyphenationFactor" #define VIEWSIZE @"ViewSize" #define VIEWZOOM @"ViewZoom" #define VIEWMODE @"ViewMode" #define points2twips(a) ((int)((a) * 20.0)) @interface RTFDProducer (Private) - (NSArray *)_attachments; - (NSDictionary *)_attributesOfLastRun; - (void)_setAttributesOfLastRun: (NSDictionary *)aDict; - (NSString *)_runStringForString: (NSString *)substring attributes: (NSDictionary *)attributes; - (NSString *)_ASCIIfiedString: (NSString *)string; - (NSString *)_headerString; - (NSString *)_trailerString; - (NSString *)_bodyString; - (NSString *)_RTFDStringFromAttributedString: (NSAttributedString *)aText documentAttributes: (NSDictionary *)dict inlineGraphics: (BOOL)inlineGraphics; @end @implementation RTFDProducer + (NSFileWrapper *)produceFileFrom: (NSAttributedString *)aText documentAttributes: (NSDictionary *)dict error: (NSError **)error { RTFDProducer *producer; NSData *encodedText; NSFileWrapper *wrapper; producer = [[self alloc] init]; encodedText = [[producer _RTFDStringFromAttributedString: aText documentAttributes: dict inlineGraphics: NO] dataUsingEncoding: NSASCIIStringEncoding]; // if ([aText containsAttachments]) if (YES) { NSMutableDictionary *fileDict; NSFileWrapper *txt; NSEnumerator *enumerator; NSFileWrapper *fileWrapper; fileDict = [NSMutableDictionary dictionary]; txt = [[NSFileWrapper alloc] initRegularFileWithContents: encodedText]; [fileDict setObject: txt forKey: @"TXT.rtf"]; RELEASE(txt); enumerator = [[producer _attachments] objectEnumerator]; while ((fileWrapper = [enumerator nextObject])) { NSString *filename; filename = [fileWrapper filename] ? [fileWrapper filename] : [fileWrapper preferredFilename]; filename = [filename lastPathComponent]; [fileDict setObject: fileWrapper forKey: filename]; } wrapper = [[NSFileWrapper alloc] initDirectoryWithFileWrappers: fileDict]; } else { wrapper = [[NSFileWrapper alloc] initRegularFileWithContents: encodedText]; } RELEASE(producer); return AUTORELEASE(wrapper); } + (NSData *)produceDataFrom: (NSAttributedString *)aText documentAttributes: (NSDictionary *)dict error: (NSError **)error { return [[self produceFileFrom: aText documentAttributes: dict error: error] serializedRepresentation]; } - (id)init { /* * maintain a dictionary for the used colours * (for rtf-header generation) */ colorDict = [[NSMutableDictionary alloc] init]; /* * maintain a dictionary for the used fonts * (for rtf-header generation) */ fontDict = [[NSMutableDictionary alloc] init]; attachments = [[NSMutableArray alloc] init]; ASSIGN(fgColor, [NSColor textColor]); ASSIGN(bgColor, [NSColor textBackgroundColor]); ASSIGN(ulColor, [NSColor textColor]); return self; } - (void)dealloc { RELEASE(text); RELEASE(fontDict); RELEASE(colorDict); RELEASE(docDict); RELEASE(attachments); RELEASE(fgColor); RELEASE(bgColor); RELEASE(ulColor); RELEASE(_attributesOfLastRun); [super dealloc]; } @end @implementation RTFProducer + (NSData *)produceDataFrom: (NSAttributedString *)aText documentAttributes: (NSDictionary *)dict error: (NSError **)error { RTFProducer *producer; NSData *data; producer = [[self alloc] init]; data = [[producer _RTFDStringFromAttributedString: aText documentAttributes: dict inlineGraphics: YES] dataUsingEncoding: NSASCIIStringEncoding]; RELEASE(producer); return data; } + (NSFileWrapper *)produceFileFrom: (NSAttributedString *)aText documentAttributes: (NSDictionary *)dict error: (NSError **)error { return AUTORELEASE([[NSFileWrapper alloc] initRegularFileWithContents: [self produceDataFrom: aText documentAttributes: dict error: error]]); } @end @implementation RTFDProducer (Private) - (NSArray *)_attachments { return attachments; } - (NSDictionary *)_attributesOfLastRun { return _attributesOfLastRun; } - (void)_setAttributesOfLastRun: (NSDictionary *)aDict; { ASSIGN(_attributesOfLastRun, aDict); } - (NSString *)fontTable { if ([fontDict count]) { NSMutableString *fontlistString; NSEnumerator *fontEnum; NSString *currFont; NSArray *keyArray; fontlistString = (NSMutableString *)[NSMutableString string]; keyArray = [fontDict allKeys]; keyArray = [keyArray sortedArrayUsingSelector: @selector(compare:)]; fontEnum = [keyArray objectEnumerator]; while ((currFont = [fontEnum nextObject])) { NSString *fontFamily; // ##FIXME: If we ever have more fonts to map to families, we should // use a dictionary if ([currFont isEqualToString: @"Symbol"]) { fontFamily = @"tech"; } else if ([currFont isEqualToString: @"Helvetica"]) { fontFamily = @"swiss"; } else if ([currFont isEqualToString: @"Courier"]) { fontFamily = @"modern"; } else if ([currFont isEqualToString: @"Times"]) { fontFamily = @"roman"; } else { fontFamily = @"nil"; } [fontlistString appendFormat: @"%@\\f%@ %@;", [fontDict objectForKey: currFont], fontFamily, currFont]; } return [NSString stringWithFormat: @"{\\fonttbl%@}\n", fontlistString]; } else { return @""; } } - (NSString *)colorTable { if ([colorDict count]) { NSMutableString *result; unsigned int count = [colorDict count]; id list[count]; NSEnumerator *keyEnum; id next; int i; keyEnum = [colorDict keyEnumerator]; while ((next = [keyEnum nextObject])) { NSNumber *cn; cn = [colorDict objectForKey: next]; list[[cn intValue] - 1] = next; } result = (NSMutableString *)[NSMutableString stringWithString: @"{\\colortbl;"]; for (i = 0; i < count; i++) { NSColor *color; color = [list[i] colorUsingColorSpaceName: NSCalibratedRGBColorSpace]; [result appendFormat: @"\\red%d\\green%d\\blue%d;", (short)([color redComponent] * 255), (short)([color greenComponent] * 255), (short)([color blueComponent] * 255)]; } [result appendString: @"}\n"]; return result; } else { return @""; } } - (NSString *)documentAttributes { if (docDict) { NSMutableString *result; NSValue *val; NSNumber *num; result = (NSMutableString *)[NSMutableString string]; if ((val = [docDict objectForKey: PAPERSIZE])) { NSSize size = [val sizeValue]; [result appendFormat: @"\\paperw%d\\paperh%d", (short)points2twips(size.width), (short)points2twips(size.height)]; } if ((num = [docDict objectForKey: LEFTMARGIN])) { [result appendFormat: @"\\margl%d", (short)points2twips([num floatValue])]; } if ((num = [docDict objectForKey: RIGHTMARGIN])) { [result appendFormat: @"\\margr%d", (short)points2twips([num floatValue])]; } if ((num = [docDict objectForKey: TOPMARGIN])) { [result appendFormat: @"\\margt%d", (short)points2twips([num floatValue])]; } if ((num = [docDict objectForKey: BUTTOMMARGIN])) { [result appendFormat: @"\\margb%d", (short)points2twips([num floatValue])]; } if ((val = [docDict objectForKey: VIEWSIZE])) { NSSize size = [val sizeValue]; [result appendFormat: @"\\vieww%d\\viewh%d", (short)points2twips(size.width), (short)points2twips(size.height)]; } if ((num = [docDict objectForKey: VIEWZOOM])) { float factor = [num floatValue]; [result appendFormat: @"\\viewscale%d", (short)factor]; } if ((num = [docDict objectForKey: VIEWMODE])) { int mode = [num intValue]; [result appendFormat: @"\\viewkind%d", (short)mode]; } if ((num = [docDict objectForKey: HYPHENATIONFACTOR])) { [result appendFormat: @"\\hyphauto1\\hyphfactor%d", (short)points2twips([num floatValue]) * 5]; } return result; } else { return @""; } } - (NSString *)_headerString /*" It is essential that before this method is called the method -_bodyString is called! "*/ { NSMutableString *result; // As 'ugly' as it seems but had to add \cocoartf to let Apple's RTF parser // grok paragraph spacing \saN. Should be no problem with other RTF parsers // as this command will be ignored. So this is for compatibility with OS X. result = (NSMutableString *)[NSMutableString stringWithString: @"{\\rtf1\\ansi\\ansicpg1252\\cocoartf102"]; [result appendString: [self fontTable]]; [result appendString: [self colorTable]]; [result appendString: [self documentAttributes]]; return result; } - (NSString *)_trailerString { return @"}"; } - (NSString *)fontToken: (NSString *)fontName { NSString *fCount; fCount = [fontDict objectForKey: fontName]; if (! fCount) { unsigned count = [fontDict count]; fCount = [NSString stringWithFormat: @"\\f%d", (short)count]; [fontDict setObject: fCount forKey: fontName]; } return fCount; } - (int)numberForColor: (NSColor *)color { unsigned int cn; NSNumber *num; num = [colorDict objectForKey: color]; if (! num) { cn = [colorDict count] + 1; [colorDict setObject: [NSNumber numberWithInt: cn] forKey: color]; } else { cn = [num intValue]; } return cn; } - (NSString *)paragraphStyle: (NSParagraphStyle *)paraStyle { NSMutableString *result; int twips; result = (NSMutableString *)[NSMutableString stringWithString: @"\\pard"]; if (! paraStyle) { return result; } // tabs { NSEnumerator *enumerator; NSTextTab *tab; enumerator = [[paraStyle tabStops] objectEnumerator]; while ((tab = [enumerator nextObject])) { switch ([tab tabStopType]) { case NSLeftTabStopType: // no tabkind emission needed break; case NSRightTabStopType: [result appendString: @"\\tqr"]; break; case NSCenterTabStopType: [result appendString: @"\\tqc"]; break; case NSDecimalTabStopType: [result appendString: @"\\tqdec"]; break; default: NSLog(@"Unknown tab stop type."); break; } [result appendString: [NSString stringWithFormat: @"\\tx%d", (short)points2twips([tab location])]]; } } switch ((int)[paraStyle baseWritingDirection]) { case NSWritingDirectionLeftToRight: // default -> nothing to emit break; case NSWritingDirectionRightToLeft: [result appendString: @"\\rtlpar"]; break; default: break; } // write first line indent and left indent twips = points2twips([paraStyle headIndent]); if (twips != 0) { [result appendFormat: @"\\li%d", (short)twips]; } twips = points2twips([paraStyle firstLineHeadIndent]) - twips; if (twips != 0) { [result appendFormat: @"\\fi%d", (short)twips]; } // right indent // this only works when doc attributes are given { NSNumber *rightMargin, *leftMargin; NSValue *paperSize; paperSize = [docDict objectForKey: PAPERSIZE]; rightMargin = [docDict objectForKey: RIGHTMARGIN]; leftMargin = [docDict objectForKey: LEFTMARGIN]; if (paperSize && leftMargin && rightMargin) { int rightMarginTwips; int leftMarginTwips; int tailIndentTwips; int paperWidthTwips; rightMarginTwips = points2twips([rightMargin floatValue]); leftMarginTwips = points2twips([leftMargin floatValue]); tailIndentTwips = points2twips([paraStyle tailIndent]); paperWidthTwips = points2twips([paperSize sizeValue].width); [result appendFormat: @"\\ri%d", (short)(paperWidthTwips - rightMarginTwips - leftMarginTwips - tailIndentTwips)]; } } twips = points2twips([paraStyle paragraphSpacing]); if (twips != 0) { [result appendFormat: @"\\sa%d", (short)twips]; } twips = points2twips([paraStyle minimumLineHeight]); if (twips != 0) { [result appendFormat: @"\\sl%d", (short)twips]; } twips = points2twips([paraStyle maximumLineHeight]); if (twips != 0) { [result appendFormat: @"\\sl-%d", (short)twips]; } switch ([paraStyle alignment]) { case NSRightTextAlignment: [result appendString: @"\\qr"]; break; case NSCenterTextAlignment: [result appendString: @"\\qc"]; break; case NSLeftTextAlignment: [result appendString: @"\\ql"]; break; case NSJustifiedTextAlignment: [result appendString: @"\\qj"]; break; default: [result appendString: @"\\ql"]; break; } return result; } - (NSString *)font: (NSFont *)font { NSString *fontName; NSFontTraitMask traits, traitsOfLastRun; NSMutableString *result; NSFont *fontOfLastRun; fontOfLastRun = [[self _attributesOfLastRun] objectForKey: NSFontAttributeName]; result = (NSMutableString *)[NSMutableString string]; // name fontName = [font familyName]; if ((! fontOfLastRun) || (! [fontName isEqualToString: [fontOfLastRun familyName]])) { [result appendString: [self fontToken: fontName]]; } // size if ((! fontOfLastRun) || ([font pointSize] != [fontOfLastRun pointSize])) { [result appendFormat: @"\\fs%d", (short)(int)([font pointSize] * 2)]; } // traits traits = [[NSFontManager sharedFontManager] traitsOfFont: font]; traitsOfLastRun = [[NSFontManager sharedFontManager] traitsOfFont: fontOfLastRun]; if ((traits & NSItalicFontMask) != (traitsOfLastRun & NSItalicFontMask)) { if (traits & NSItalicFontMask) { [result appendString: @"\\i"]; } else { [result appendString: @"\\i0"]; } } if ((traits & NSBoldFontMask) != (traitsOfLastRun & NSBoldFontMask)) { if (traits & NSBoldFontMask) { [result appendString: @"\\b"]; } else { [result appendString: @"\\b0"]; } } return result; } - (NSString *)_removeAttributesString: (NSDictionary *)attributesToRemove { NSMutableString *result; NSEnumerator *enumerator; NSString *attributeName; result = (NSMutableString *)[NSMutableString string]; enumerator = [attributesToRemove keyEnumerator]; while ((attributeName = [enumerator nextObject])) { if ([attributeName isEqualToString: NSParagraphStyleAttributeName]) { [result appendString: @"\\pard\\ql"]; } else if ([attributeName isEqualToString: NSForegroundColorAttributeName]) { [result appendString: @"\\cf0"]; } else if ([attributeName isEqualToString: NSBackgroundColorAttributeName]) { [result appendString: @"\\cb0"]; } else if ([attributeName isEqualToString: NSUnderlineStyleAttributeName]) { [result appendString: @"\\ulnone"]; } else if ([attributeName isEqualToString: NSSuperscriptAttributeName]) { [result appendString: @"\\nosupersub"]; } else if ([attributeName isEqualToString: NSBaselineOffsetAttributeName]) { NSNumber *value = [[self _attributesOfLastRun] objectForKey: NSBaselineOffsetAttributeName]; int svalue = (int)[value floatValue]; if (svalue >= 0) { [result appendString: @"\\up0"]; } else if (svalue < 0) { [result appendString: @"\\dn0"]; } } else if ([attributeName isEqualToString: NSLigatureAttributeName]) { [result appendString: @"\\zwnj"]; } else if ([attributeName isEqualToString: NSAttachmentAttributeName]) { } else if ([attributeName isEqualToString: NSFontAttributeName]) { } else if ([attributeName isEqualToString: NSLinkAttributeName]) { [result appendString: @"}}"]; } else { NSLog(@"(removal) Missing handling of '%@' attributes.", attributeName); // ##TODO: attributes missing e.g. NSKernAttributeName } } return result; } - (NSString *)_stringWithRTFCharacters: (NSString *)string { NSString *result; NSMutableData *resultData; unichar *buffer; int length, i; BOOL uc_flagged = NO; if (string == nil) { return nil; } length = [string length]; buffer = NSZoneCalloc([self zone], length, sizeof(unichar)); [string getCharacters: buffer]; resultData = [[NSMutableData alloc] initWithCapacity: (int)(length * 1.2)]; for (i = 0; i < length; i++) { unichar c; c = buffer[i]; if (c < 0x80) { // encoding found char ansiChar; ansiChar = (char)c; switch (ansiChar) { case '\\': [resultData appendBytes: "\\\\" length: 2]; break; case '\n': [resultData appendBytes: "\\par\n" length: 5]; break; case '\t': [resultData appendBytes: "\\tab " length: 5]; break; case '{': [resultData appendBytes: "\\{" length: 2]; break; case '}': [resultData appendBytes: "\\}" length: 2]; break; case '`': [resultData appendBytes: "\\lquote " length: 8]; break; case '\'': [resultData appendBytes: "\\rquote " length: 8]; break; default: [resultData appendBytes: &ansiChar length: 1]; break; } } else if (c < 0xFF) { char unicodeCommand[16]; snprintf(unicodeCommand, 16, "\\'%X", (short)c); unicodeCommand[15] = '\0'; [resultData appendBytes: unicodeCommand length: strlen(unicodeCommand)]; } else if (c == NSAttachmentCharacter) { [resultData appendBytes: "\\'AC}" length: 5]; } else { // write unicode encoding char unicodeCommand[16]; if (!uc_flagged) { // We don't supply an ANSI representation for Unicode characters [resultData appendBytes: "\\uc0 " length: 5]; uc_flagged = YES; } snprintf(unicodeCommand, 16, "\\u%d ", (short)c); unicodeCommand[15] = '\0'; [resultData appendBytes: unicodeCommand length: strlen(unicodeCommand)]; } } NSZoneFree([self zone], buffer); result = AUTORELEASE([[NSString alloc] initWithData: resultData encoding: NSASCIIStringEncoding]); RELEASE(resultData); return result; } - (NSString *)_ASCIIfiedString: (NSString *)string; { // workaround:converting non-ASCII chars NSData *lossyConversion; lossyConversion = [string dataUsingEncoding: NSASCIIStringEncoding allowLossyConversion: YES]; return AUTORELEASE([[NSString alloc] initWithData: lossyConversion encoding: NSASCIIStringEncoding]); } - (NSString *)_addAttributesString: (NSDictionary *)attributesToAdd { NSMutableString *result; NSEnumerator *enumerator; NSString *attributeName; result = (NSMutableString *)[NSMutableString string]; enumerator = [attributesToAdd keyEnumerator]; while ((attributeName = [enumerator nextObject])) { if ([attributeName isEqualToString: NSParagraphStyleAttributeName]) { [result appendString: [self paragraphStyle: [attributesToAdd objectForKey: NSParagraphStyleAttributeName]]]; } else if ([attributeName isEqualToString: NSFontAttributeName]) { [result appendString: [self font: [attributesToAdd objectForKey: NSFontAttributeName]]]; } else if ([attributeName isEqualToString: NSForegroundColorAttributeName]) { NSColor *color = [attributesToAdd objectForKey: NSForegroundColorAttributeName]; if (! [color isEqual: fgColor]) { [result appendFormat: @"\\cf%d", (short)[self numberForColor: color]]; } } else if ([attributeName isEqualToString: NSBackgroundColorAttributeName]) { NSColor *color = [attributesToAdd objectForKey: NSBackgroundColorAttributeName]; if (! [color isEqual: bgColor]) { [result appendFormat: @"\\cb%d", (short)[self numberForColor: color]]; } } else if ([attributeName isEqualToString: NSUnderlineColorAttributeName]) { NSColor *color = [attributesToAdd objectForKey: NSUnderlineColorAttributeName]; [result appendFormat: @"\\ulc%d", (short)[self numberForColor: color]]; } else if ([attributeName isEqualToString: NSUnderlineStyleAttributeName]) { NSInteger styleMask = [[attributesToAdd objectForKey: NSUnderlineStyleAttributeName] integerValue]; if ((styleMask & NSUnderlineByWordMask) == NSUnderlineByWordMask) { [result appendString: @"\\ulw"]; } if (styleMask == NSUnderlineStyleNone) { [result appendString: @"\\ulnone"]; } else if ((styleMask & NSUnderlineStyleDouble) == NSUnderlineStyleDouble) { [result appendString: @"\\uldb"]; } else if ((styleMask & NSUnderlineStyleThick) == NSUnderlineStyleThick) { if ((styleMask & NSUnderlinePatternDot) == NSUnderlinePatternDot) { [result appendString: @"\\ulthd"]; } else if ((styleMask & NSUnderlinePatternDash) == NSUnderlinePatternDash) { [result appendString: @"\\ulthdash"]; } else if ((styleMask & NSUnderlinePatternDashDot) == NSUnderlinePatternDashDot) { [result appendString: @"\\ulthdashd"]; } else if ((styleMask & NSUnderlinePatternDashDotDot) == NSUnderlinePatternDashDotDot) { [result appendString: @"\\ulthdashdd"]; } else // Assume NSUnderlinePatternSolid { [result appendString: @"\\ulth"]; } } else // Assume NSUnderlineStyleSingle { if ((styleMask & NSUnderlinePatternDot) == NSUnderlinePatternDot) { [result appendString: @"\\uld"]; } else if ((styleMask & NSUnderlinePatternDash) == NSUnderlinePatternDash) { [result appendString: @"\\uldash"]; } else if ((styleMask & NSUnderlinePatternDashDot) == NSUnderlinePatternDashDot) { [result appendString: @"\\uldashd"]; } else if ((styleMask & NSUnderlinePatternDashDotDot) == NSUnderlinePatternDashDotDot) { [result appendString: @"\\uldashdd"]; } else // Assume NSUnderlinePatternSolid { [result appendString: @"\\ul"]; } } } else if ([attributeName isEqualToString: NSSuperscriptAttributeName]) { NSNumber *value = [attributesToAdd objectForKey: NSSuperscriptAttributeName]; int svalue = [value intValue]; if (svalue > 0) { [result appendString: @"\\super"]; if (svalue > 1) { [result appendFormat: @"%d", (short)svalue]; } } else if (svalue < 0) { [result appendString: @"\\sub"]; if (svalue < -1) { [result appendFormat: @"%d", (short)-svalue]; } } } else if ([attributeName isEqualToString: NSBaselineOffsetAttributeName]) { NSNumber *value = [attributesToAdd objectForKey: NSBaselineOffsetAttributeName]; int svalue = (int)([value floatValue] * 2); if (svalue > 0) { [result appendFormat: @"\\up%d", (short)svalue]; } else if (svalue < 0) { [result appendFormat: @"\\dn%d", (short)-svalue]; } } else if ([attributeName isEqualToString: NSLigatureAttributeName]) { [result appendString: @"\\zwj"]; } else if ([attributeName isEqualToString: NSAttachmentAttributeName]) { NSTextAttachment *attachment; if ((attachment = [attributesToAdd objectForKey: NSAttachmentAttributeName])) { NSFileWrapper *attachmentFileWrapper; NSString *attachmentFilename; NSSize cellSize; if ([attachment isKindOfClass: [GSHelpLinkAttachment class]]) { GSHelpLinkAttachment *link = (GSHelpLinkAttachment *)attachment; [result appendString: @"{{\\NeXTHelpLink"]; [result appendString: @" \\markername "]; [result appendString: @";\\linkFilename "]; [result appendString: [link fileName]]; [result appendString: @";\\linkMarkername "]; [result appendString: [link markerName]]; [result appendString: @";}"]; } else if ([attachment isKindOfClass: [GSHelpMarkerAttachment class]]) { GSHelpMarkerAttachment *marker = (GSHelpMarkerAttachment *)attachment; [result appendString: @"{{\\NeXTHelpMarker"]; [result appendString: @" \\markername "]; [result appendString: [marker markerName]]; [result appendString: @";}"]; } else { attachmentFileWrapper = [attachment fileWrapper]; attachmentFilename = [attachmentFileWrapper filename]; if (! attachmentFilename) { attachmentFilename = [attachmentFileWrapper preferredFilename]; if (! attachmentFilename) { // If we do not have a proper filename, we set it // here, incrementing the number of unnamed attachment // so we do not overwrite existing ones. // FIXME: setting the filename extension to tiff // is not that great, but as we anyway append // \NeXTGraphic just after it makes sense... (without // the extension the file is not loaded) attachmentFilename = [NSString stringWithFormat: @"__unnamed_file_%d.tiff", unnamedAttachmentCounter++]; [attachmentFileWrapper setPreferredFilename: attachmentFilename]; } } /* if ([attachmentFilename respondsToSelector: @selector(fileSystemRepresentation)]) { const char *fileSystemRepresentation; fileSystemRepresentation = [attachmentFilename fileSystemRepresentation]; attachmentFilename = [self _encodedFilenameRepresentation: fileSystemRepresentation]; } else */ { attachmentFilename = [self _ASCIIfiedString: attachmentFilename]; } cellSize = [[attachment attachmentCell] cellSize]; [result appendString: @"{{\\NeXTGraphic "]; [result appendString: [attachmentFilename lastPathComponent]]; [result appendFormat: @" \\width%d \\height%d}", (short)points2twips(cellSize.width), (short)points2twips(cellSize.height)]; [attachmentFileWrapper setFilename: attachmentFilename]; [attachmentFileWrapper setPreferredFilename: attachmentFilename]; if (attachmentFileWrapper) [attachments addObject: attachmentFileWrapper]; } } } else if ([attributeName isEqualToString: NSLinkAttributeName]) { id dest = [attributesToAdd objectForKey: NSLinkAttributeName]; NSString *destString = @""; if ([dest isKindOfClass: [NSURL class]]) { destString = [dest absoluteString]; } else if ([dest isKindOfClass: [NSString class]]) { destString = [[NSURL URLWithString: dest] absoluteString]; } // NOTE: RTF control characters (backslash, curly braces) // will be escaped by -absoluteString, so the result is safe to // concatenate into the RTF stream [result appendString: [NSString stringWithFormat: @"{\\field{\\*\\fldinst HYPERLINK \"%@\"}{\\fldrslt ", destString]]; } else { NSLog(@"(addition) Missing handling of '%@' attributes.", attributeName); // ##TODO: attributes missing e.g. NSKernAttributeName } } return result; } - (NSString *)_runStringForString: (NSString *)string attributes: (NSDictionary *)attributes { NSMutableString *result; NSMutableDictionary *attributesToAdd, *attributesToRemove; NSEnumerator *enumerator; NSString *attributeName; result = (NSMutableString *)[NSMutableString stringWithCapacity: [string length] + 15]; attributesToAdd = [[NSMutableDictionary alloc] init]; attributesToRemove = [[self _attributesOfLastRun] mutableCopy]; // calculation of deltas enumerator = [attributes keyEnumerator]; while ((attributeName = [enumerator nextObject])) { id attributeValue; id attributeValueOfLastRun; attributeValue = [attributes objectForKey: attributeName]; attributeValueOfLastRun = [attributesToRemove objectForKey: attributeName]; if (attributeValueOfLastRun) { if ([attributeValueOfLastRun isEqual: attributeValue]) { [attributesToRemove removeObjectForKey: attributeName]; } else { [attributesToAdd setObject: attributeValue forKey: attributeName]; } } else { [attributesToAdd setObject: attributeValue forKey: attributeName]; } } [result appendString: [self _removeAttributesString: attributesToRemove]]; [result appendString: [self _addAttributesString: attributesToAdd]]; RELEASE(attributesToRemove); RELEASE(attributesToAdd); if ([result length]) { unichar c = [result characterAtIndex: [result length] - 1]; if ((c != '}') && (c != ' ')) { // ensure delimiter [result appendString: @" "]; } } [result appendString: [self _stringWithRTFCharacters: string]]; return result; } - (NSString *)_bodyString { NSString *string; NSMutableString *result; unsigned length; NSRange effectiveRange; string = [text string]; result = (NSMutableString *)[NSMutableString string]; length = [string length]; effectiveRange = NSMakeRange(0, 0); while (effectiveRange.location < length) { NSDictionary *attributes; CREATE_AUTORELEASE_POOL(pool); attributes = [text attributesAtIndex: effectiveRange.location longestEffectiveRange: &effectiveRange inRange: NSMakeRange(effectiveRange.location, length - effectiveRange.location)]; [result appendString: [self _runStringForString: [string substringWithRange: effectiveRange] attributes: attributes]]; effectiveRange = NSMakeRange(NSMaxRange(effectiveRange), 0); [self _setAttributesOfLastRun: attributes]; [pool drain]; } [self _setAttributesOfLastRun: nil]; // cleanup, should be unneccessary return result; } - (NSString *)_RTFDStringFromAttributedString: (NSAttributedString *)aText documentAttributes: (NSDictionary *)dict inlineGraphics: (BOOL)inlineGraphics { NSMutableString *output; NSString *headerString; NSString *trailerString; NSString *bodyString; ASSIGN(text, aText); ASSIGN(docDict, dict); output = (NSMutableString *)[NSMutableString string]; _inlineGraphics = inlineGraphics; /* * do not change order! (esp. body has to be generated first; builds context) */ bodyString = [self _bodyString]; trailerString = [self _trailerString]; headerString = [self _headerString]; [output appendString: headerString]; [output appendString: bodyString]; [output appendString: trailerString]; return output; } @end gnustep-gui-0.24.0/TextConverters/RTF/RTFConsumer.h0000664000076500007650000000315711337622222021722 0ustar brains99brains99/* rtfConsumer.h created by pingu on Fri 12-Nov-1999 Copyright (C) 1999 Free Software Foundation, Inc. Author: Stefan Böhringer (stefan.boehringer@uni-bochum.de) Date: Dec 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _rtfConsumer_h_INCLUDE #define _rtfConsumer_h_INCLUDE #include @class NSMutableDictionary; @class NSMutableArray; @class NSMutableAttributedString; @interface RTFConsumer: NSObject { @public NSStringEncoding encoding; NSMutableDictionary *documentAttributes; NSMutableDictionary *fonts; NSMutableArray *colours; NSMutableArray *attrs; NSMutableAttributedString *result; Class _class; int ignore; } @end @interface RTFDConsumer: RTFConsumer { NSDictionary* files; } - (void) setFiles: (NSDictionary*) theFiles; @end #endif gnustep-gui-0.24.0/TextConverters/RTF/GNUmakefile0000664000076500007650000000304011531021636021441 0ustar brains99brains99# GNUmakefile # # Copyright (C) 2001 Free Software Foundation, Inc. # # Author: Adam Fedor # # This file is part of GNUstep # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-gui include $(GNUSTEP_MAKEFILES)/common.make BUNDLE_NAME = RTFConverter BUNDLE_INSTALL_DIR =$(GNUSTEP_BUNDLES)/TextConverters RTFConverter_OBJC_FILES = \ rtfGrammar.tab.m RTFConsumer.m RTFProducer.m rtfScanner.m RTFConverter_PRINCIPAL_CLASS = RTFConsumer ifeq ($(GNUSTEP_TARGET_OS),mingw32) RTFConverter_BUNDLE_LIBS += -lgnustep-gui $(FND_LIBS) $(OBJC_LIBS) endif ifeq ($(GNUSTEP_TARGET_OS),cygwin) RTFConverter_BUNDLE_LIBS += -lgnustep-gui $(FND_LIBS) $(OBJC_LIBS) endif -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/bundle.make -include GNUmakefile.postamble gnustep-gui-0.24.0/TextConverters/RTF/RTFConsumerFunctions.h0000664000076500007650000001223411531021636023605 0ustar brains99brains99/* rtfConsumerFunctions.h created by pingu on Wed 17-Nov-1999 Copyright (C) 1999 Free Software Foundation, Inc. Author: Stefan Böhringer (stefan.boehringer@uni-bochum.de) Date: Dec 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* here we define the interface functions to grammer consumers */ #ifndef rtfConsumerFunctions_h_INCLUDE #define rtfConsumerFunctions_h_INCLUDE #include "rtfScanner.h" /* general statements: * measurement is usually in twips: one twentieth of a point (this is * about 0.01764 mm) a tabstop of 540 twips (as it occurs on NeXT) is * therefore about 0.95 cm */ #define halfpoints2points(a) ((a)/2.0) #define twips2points(a) ((a)/20.0) #define twips2mm(a) ((a)*0.01764) /* prepare the ctxt, or whatever you want */ void GSRTFstart(void *ctxt); /* seal the parsing process, the context or whatever you want */ void GSRTFstop(void *ctxt); /* * those pairing functions enclose RTFBlocks. Use it to capture the * hierarchical attribute changes of blocks. i.e. attributes of a * block are forgotten once a block is closed */ void GSRTFopenBlock(void *ctxt, BOOL ignore); void GSRTFcloseBlock(void *ctxt, BOOL ignore); /* handle errors */ void GSRTFerror(void *ctxt, void *lctxt, const char *msg); /* handle rtf commands not expicated in the grammer */ void GSRTFgenericRTFcommand(void *ctxt, RTFcmd cmd); /* go, handle text */ void GSRTFmangleText(void *ctxt, const char *text); void GSRTFunicode (void *ctxt, int uchar); /* * font functions */ /* get noticed that a particular font is introduced */ void GSRTFregisterFont(void *ctxt, const char *fontName, RTFfontFamily family, int fontNumber); /* change font number */ void GSRTFfontNumber(void *ctxt, int fontNumber); /* change font size in half points*/ void GSRTFfontSize(void *ctxt, int fontSize); /* set paper width in twips */ void GSRTFpaperWidth(void *ctxt, int width); /* set paper height in twips */ void GSRTFpaperHeight(void *ctxt, int height); /* set left margin in twips */ void GSRTFmarginLeft(void *ctxt, int margin); /* set right margin in twips */ void GSRTFmarginRight(void *ctxt, int margin); /* set top margin in twips */ void GSRTFmarginTop(void *ctxt, int margin); /* set buttom margin in twips */ void GSRTFmarginButtom(void *ctxt, int margin); /* set first line indent */ void GSRTFfirstLineIndent(void *ctxt, int indent); /* set left indent */ void GSRTFleftIndent(void *ctxt, int indent); /* set right indent */ void GSRTFrightIndent(void *ctxt, int indent); /* set tabstop */ void GSRTFtabstop(void *ctxt, int location); /* set center alignment */ void GSRTFalignCenter(void *ctxt); /* set justified alignment */ void GSRTFalignJustified(void *ctxt); /* set left alignment */ void GSRTFalignLeft(void *ctxt); /* set right alignment */ void GSRTFalignRight(void *ctxt); /* set space above */ void GSRTFspaceAbove(void *ctxt, int location); /* set line space */ void GSRTFlineSpace(void *ctxt, int location); /* set default paragraph style */ void GSRTFdefaultParagraph(void *ctxt); /* set paragraph style */ void GSRTFstyle(void *ctxt, int style); /* Add a colour to the colour table*/ void GSRTFaddColor(void *ctxt, int red, int green, int blue); /* Add the default colour to the colour table*/ void GSRTFaddDefaultColor(void *ctxt); /* set background colour */ void GSRTFcolorbg(void *ctxt, int color); /* set foreground colour */ void GSRTFcolorfg(void *ctxt, int color); /* set underline colour */ void GSRTFunderlinecolor(void *ctxt, int color); /* set default character style */ void GSRTFdefaultCharacterStyle(void *ctxt); /* set subscript in half points */ void GSRTFsubscript(void *ctxt, int script); /* set superscript in half points */ void GSRTFsuperscript(void *ctxt, int script); /* Switch bold mode on or off */ void GSRTFbold(void *ctxt, BOOL on); /* Switch italic mode on or off */ void GSRTFitalic(void *ctxt, BOOL on); /* Set the underline style */ void GSRTFunderline(void *ctxt, BOOL on, NSInteger style); /* Set the strikethrough style */ void GSRTFstrikethrough(void *ctxt, NSInteger style); /* new paragraph */ void GSRTFparagraph(void *ctxt); /* NeXTGraphic */ void GSRTFNeXTGraphic(void *ctxt, const char *fileName, int width, int height); /* NeXTHelpLink */ void GSRTFNeXTHelpLink(void *ctxt, int num, const char *markername, const char *linkFilename, const char *linkMarkername); /* NeXTHelpMarker */ void GSRTFNeXTHelpMarker(void *ctxt, int num, const char *markername); #endif gnustep-gui-0.24.0/TextConverters/RTF/rtfGrammar.y0000664000076500007650000004414511531021636021676 0ustar brains99brains99/* rtfGrammer.y Copyright (C) 1999 Free Software Foundation, Inc. Author: Stefan Böhringer (stefan.boehringer@uni-bochum.de) Date: Dec 1999 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* if processed using -p GSRTFP (as recommended) it will introduce the following global symbols: 'GSRTFPparse', `GSRTFPlex', `GSRTFPerror', `GSRTFPnerrs', `GSRTFPlval', `GSRTFPchar', `GSRTFPdebug */ /* we request for a reentrant parser */ %pure_parser %{ /* The overall plan is to make this grammer universal in usage. Intrested buddies can implement plain C functions to consume what the grammer is producing. this way the rtf-grammer-tree can be converted to what is needed: GNUstep attributed strings, tex files, ... The plan is laid out by defining a set of C functions which cover all what is needed to mangle rtf information (it is NeXT centric however and may even lack some features). Be aware that some functions are called at specific times when some information may or may not be available. The first argument of all functions is a context, which is asked to be maintained by the consumer at whichever purpose seems appropriate. This context must be passed to the parser by issuing 'value = GSRTFparse(ctxt, lctxt);' in the first place. */ #import #include #include #include "rtfScanner.h" /* this context is passed to the interface functions */ typedef void *GSRTFctxt; // Two parameters are not supported by some bison versions. The declaration of // yyparse in the .c file must be corrected to be able to compile it. /*#define YYPARSE_PARAM ctxt, void *lctxt*/ #define YYLEX_PARAM lctxt /*#undef YYLSP_NEEDED*/ #define CTXT ctxt #define YYERROR_VERBOSE #define YYDEBUG 0 #include "RTFConsumerFunctions.h" /*int GSRTFlex (YYSTYPE *lvalp, RTFscannerCtxt *lctxt); */ int GSRTFlex(void *lvalp, void *lctxt); %} %parse-param {void *ctxt} %parse-param {void *lctxt} %union { int number; const char *text; RTFcmd cmd; } /*

RTFtext values have to be freed */ %token RTFtext %token RTFstart %token RTFansi %token RTFmac %token RTFpc %token RTFpca %token RTFignore %token RTFinfo %token RTFstylesheet %token RTFfootnote %token RTFheader %token RTFfooter %token RTFpict %token RTFplain %token RTFparagraph %token RTFdefaultParagraph %token RTFrow %token RTFcell %token RTFtabulator %token RTFemdash %token RTFendash %token RTFemspace %token RTFenspace %token RTFbullet %token RTFlquote %token RTFrquote %token RTFldblquote %token RTFrdblquote %token RTFred %token RTFgreen %token RTFblue %token RTFcolorbg %token RTFcolorfg %token RTFunderlinecolor %token RTFcolortable %token RTFfont %token RTFfontSize %token RTFNeXTGraphic %token RTFNeXTGraphicWidth %token RTFNeXTGraphicHeight %token RTFNeXTHelpLink %token RTFNeXTHelpMarker %token RTFNeXTfilename %token RTFNeXTmarkername %token RTFNeXTlinkFilename %token RTFNeXTlinkMarkername %token RTFpaperWidth %token RTFpaperHeight %token RTFmarginLeft %token RTFmarginRight %token RTFmarginTop %token RTFmarginButtom %token RTFfirstLineIndent %token RTFleftIndent %token RTFrightIndent %token RTFalignCenter %token RTFalignJustified %token RTFalignLeft %token RTFalignRight %token RTFlineSpace %token RTFspaceAbove %token RTFstyle %token RTFbold %token RTFitalic %token RTFunderline %token RTFunderlineDot %token RTFunderlineDash %token RTFunderlineDashDot %token RTFunderlineDashDotDot %token RTFunderlineDouble %token RTFunderlineStop %token RTFunderlineThick %token RTFunderlineThickDot %token RTFunderlineThickDash %token RTFunderlineThickDashDot %token RTFunderlineThickDashDotDot %token RTFunderlineWord %token RTFstrikethrough %token RTFstrikethroughDouble %token RTFunichar %token RTFsubscript %token RTFsuperscript %token RTFtabstop %token RTFfcharset %token RTFfprq %token RTFcpg %token RTFOtherStatement %token RTFfontListStart // we assume token numbers to be sequential // \fnil | \froman | \fswiss | \fmodern | \fscript | \fdecor | \ftech // look at rtfScanner.h for enum definition %token RTFfamilyNil %token RTFfamilyRoman %token RTFfamilySwiss %token RTFfamilyModern %token RTFfamilyScript %token RTFfamilyDecor %token RTFfamilyTech %type rtfFontFamily rtfCharset rtfFontStatement /* let's go */ %% rtfFile: '{' { GSRTFstart(CTXT); } RTFstart rtfCharset rtfIngredients { GSRTFstop(CTXT); } '}' ; rtfCharset: RTFansi { $$ = 1; } | RTFmac { $$ = 2; } | RTFpc { $$ = 3; } | RTFpca { $$ = 4; } /* If it's an unknown character set, assume ansi. */ | RTFOtherStatement { $$ = 1; free((void*)$1.name); } ; rtfIngredients: /* empty */ | rtfIngredients rtfFontList | rtfIngredients rtfColorDef | rtfIngredients rtfStatement | rtfIngredients RTFtext { GSRTFmangleText(CTXT, $2); free((void *)$2); } | rtfIngredients rtfBlock | rtfIngredients error ; rtfBlock: '{' { GSRTFopenBlock(CTXT, NO); } rtfIngredients rtfNeXTstuff '}' { GSRTFcloseBlock(CTXT, NO); } /* may be empty */ | '{' { GSRTFopenBlock(CTXT, YES); } RTFignore rtfIngredients '}' { GSRTFcloseBlock(CTXT, YES); } | '{' { GSRTFopenBlock(CTXT, YES); } RTFinfo rtfIngredients '}' { GSRTFcloseBlock(CTXT, YES); } | '{' { GSRTFopenBlock(CTXT, YES); } RTFstylesheet rtfIngredients '}' { GSRTFcloseBlock(CTXT, YES); } | '{' { GSRTFopenBlock(CTXT, YES); } RTFfootnote rtfIngredients '}' { GSRTFcloseBlock(CTXT, YES); } | '{' { GSRTFopenBlock(CTXT, YES); } RTFheader rtfIngredients '}' { GSRTFcloseBlock(CTXT, YES); } | '{' { GSRTFopenBlock(CTXT, YES); } RTFfooter rtfIngredients '}' { GSRTFcloseBlock(CTXT, YES); } | '{' { GSRTFopenBlock(CTXT, YES); } RTFpict rtfIngredients '}' { GSRTFcloseBlock(CTXT, YES); } | '{' error '}' ; /* RTF statements start with a '\', have a alpha name and a number argument */ rtfStatement: RTFfont { int font; if ($1.isEmpty) font = 0; else font = $1.parameter; GSRTFfontNumber(CTXT, font); } | RTFfontSize { int size; if ($1.isEmpty) size = 24; else size = $1.parameter; GSRTFfontSize(CTXT, size); } | RTFpaperWidth { int width; if ($1.isEmpty) width = 12240; else width = $1.parameter; GSRTFpaperWidth(CTXT, width);} | RTFpaperHeight { int height; if ($1.isEmpty) height = 15840; else height = $1.parameter; GSRTFpaperHeight(CTXT, height);} | RTFmarginLeft { int margin; if ($1.isEmpty) margin = 1800; else margin = $1.parameter; GSRTFmarginLeft(CTXT, margin);} | RTFmarginRight { int margin; if ($1.isEmpty) margin = 1800; else margin = $1.parameter; GSRTFmarginRight(CTXT, margin); } | RTFmarginTop { int margin; if ($1.isEmpty) margin = 1440; else margin = $1.parameter; GSRTFmarginTop(CTXT, margin); } | RTFmarginButtom { int margin; if ($1.isEmpty) margin = 1440; else margin = $1.parameter; GSRTFmarginButtom(CTXT, margin); } | RTFfirstLineIndent { int indent; if ($1.isEmpty) indent = 0; else indent = $1.parameter; GSRTFfirstLineIndent(CTXT, indent); } | RTFleftIndent { int indent; if ($1.isEmpty) indent = 0; else indent = $1.parameter; GSRTFleftIndent(CTXT, indent);} | RTFrightIndent { int indent; if ($1.isEmpty) indent = 0; else indent = $1.parameter; GSRTFrightIndent(CTXT, indent);} | RTFtabstop { int location; if ($1.isEmpty) location = 0; else location = $1.parameter; GSRTFtabstop(CTXT, location);} | RTFalignCenter { GSRTFalignCenter(CTXT); } | RTFalignJustified { GSRTFalignJustified(CTXT); } | RTFalignLeft { GSRTFalignLeft(CTXT); } | RTFalignRight { GSRTFalignRight(CTXT); } | RTFspaceAbove { int space; if ($1.isEmpty) space = 0; else space = $1.parameter; GSRTFspaceAbove(CTXT, space); } | RTFlineSpace { GSRTFlineSpace(CTXT, $1.parameter); } | RTFdefaultParagraph { GSRTFdefaultParagraph(CTXT); } | RTFstyle { GSRTFstyle(CTXT, $1.parameter); } | RTFcolorbg { int color; if ($1.isEmpty) color = 0; else color = $1.parameter; GSRTFcolorbg(CTXT, color); } | RTFcolorfg { int color; if ($1.isEmpty) color = 0; else color = $1.parameter; GSRTFcolorfg(CTXT, color); } | RTFunderlinecolor { int color; if ($1.isEmpty) color = 0; else color = $1.parameter; GSRTFunderlinecolor(CTXT, color); } | RTFsubscript { int script; if ($1.isEmpty) script = 6; else script = $1.parameter; GSRTFsubscript(CTXT, script); } | RTFsuperscript { int script; if ($1.isEmpty) script = 6; else script = $1.parameter; GSRTFsuperscript(CTXT, script); } | RTFbold { BOOL on; if ($1.isEmpty || $1.parameter) on = YES; else on = NO; GSRTFbold(CTXT, on); } | RTFitalic { BOOL on; if ($1.isEmpty || $1.parameter) on = YES; else on = NO; GSRTFitalic(CTXT, on); } | RTFunderline { BOOL on; if ($1.isEmpty || $1.parameter) on = YES; else on = NO; GSRTFunderline(CTXT, on, NSUnderlineStyleSingle | NSUnderlinePatternSolid); } | RTFunderlineDot { BOOL on; if ($1.isEmpty || $1.parameter) on = YES; else on = NO; GSRTFunderline(CTXT, on, NSUnderlineStyleSingle | NSUnderlinePatternDot); } | RTFunderlineDash { BOOL on; if ($1.isEmpty || $1.parameter) on = YES; else on = NO; GSRTFunderline(CTXT, on, NSUnderlineStyleSingle | NSUnderlinePatternDash); } | RTFunderlineDashDot { BOOL on; if ($1.isEmpty || $1.parameter) on = YES; else on = NO; GSRTFunderline(CTXT, on, NSUnderlineStyleSingle | NSUnderlinePatternDashDot); } | RTFunderlineDashDotDot { BOOL on; if ($1.isEmpty || $1.parameter) on = YES; else on = NO; GSRTFunderline(CTXT, on, NSUnderlineStyleSingle | NSUnderlinePatternDashDotDot); } | RTFunderlineDouble { BOOL on; if ($1.isEmpty || $1.parameter) on = YES; else on = NO; GSRTFunderline(CTXT, on, NSUnderlineStyleDouble | NSUnderlinePatternSolid); } | RTFunderlineStop { GSRTFunderline(CTXT, NO, NSUnderlineStyleNone); } | RTFunderlineThick { BOOL on; if ($1.isEmpty || $1.parameter) on = YES; else on = NO; GSRTFunderline(CTXT, on, NSUnderlineStyleThick | NSUnderlinePatternSolid); } | RTFunderlineThickDot { BOOL on; if ($1.isEmpty || $1.parameter) on = YES; else on = NO; GSRTFunderline(CTXT, on, NSUnderlineStyleThick | NSUnderlinePatternDot); } | RTFunderlineThickDash { BOOL on; if ($1.isEmpty || $1.parameter) on = YES; else on = NO; GSRTFunderline(CTXT, on, NSUnderlineStyleThick | NSUnderlinePatternDash); } | RTFunderlineThickDashDot { BOOL on; if ($1.isEmpty || $1.parameter) on = YES; else on = NO; GSRTFunderline(CTXT, on, NSUnderlineStyleThick | NSUnderlinePatternDashDot); } | RTFunderlineThickDashDotDot { BOOL on; if ($1.isEmpty || $1.parameter) on = YES; else on = NO; GSRTFunderline(CTXT, on, NSUnderlineStyleThick | NSUnderlinePatternDashDotDot); } | RTFunderlineWord { BOOL on; if ($1.isEmpty || $1.parameter) on = YES; else on = NO; GSRTFunderline(CTXT, on, NSUnderlineStyleSingle | NSUnderlinePatternSolid | NSUnderlineByWordMask); } | RTFstrikethrough { NSInteger style; if ($1.isEmpty || $1.parameter) style = NSUnderlineStyleSingle | NSUnderlinePatternSolid; else style = NSUnderlineStyleNone; GSRTFstrikethrough(CTXT, style); } | RTFstrikethroughDouble { GSRTFstrikethrough(CTXT, NSUnderlineStyleDouble | NSUnderlinePatternSolid); } | RTFunichar { GSRTFunicode(CTXT, $1.parameter); } | RTFplain { GSRTFdefaultCharacterStyle(CTXT); } | RTFparagraph { GSRTFparagraph(CTXT); } | RTFrow { GSRTFparagraph(CTXT); } | RTFOtherStatement { GSRTFgenericRTFcommand(CTXT, $1); free((void*)$1.name); } ; rtfNeXTstuff: /* empty */ | rtfNeXTGraphic | rtfNeXTHelpLink | rtfNeXTHelpMarker ; /* NeXTGraphic (images) This is a Apple/NeXT extension. The format of the command is {{\NeXTGraphic attachment \widthN \heightN} string} and the string is ignored (on OS X it is always 0xAC). See the Section "RTF Files and Attributed Strings" in Apple's Attributed Strings Programming Guide. */ rtfNeXTGraphic: '{' RTFNeXTGraphic RTFtext RTFNeXTGraphicWidth RTFNeXTGraphicHeight '}' { GSRTFopenBlock(CTXT, YES); } rtfIngredients { GSRTFcloseBlock(CTXT, YES); } { GSRTFNeXTGraphic (CTXT, $3, $4.parameter, $5.parameter); }; /* NeXTHelpLink This is a NeXT extension. The format of the command is {{\NeXTHelpLinkN \markername markername; \linkFilename filename; \linkMarkername markername;} string} and the string is ignored (it is always 0xAC on NeXT). Note that the {\NeXTHelpLink } group may itself be preceded by other commands. */ rtfNeXTHelpLink: '{' RTFNeXTHelpLink RTFNeXTmarkername RTFtext RTFNeXTlinkFilename RTFtext RTFNeXTlinkMarkername RTFtext '}' { GSRTFopenBlock(CTXT, YES); } rtfIngredients { GSRTFcloseBlock(CTXT, YES); } { GSRTFNeXTHelpLink (CTXT, $2.parameter, $4, $6, $8); }; /* NeXTHelpMarker This is a NeXT extension. The format of the command is {{\NeXTHelpMarkerN \markername markername;} string} and the string is ignored (it is always 0xAC on NeXT). Note that the {\NeXTHelpLink } group may itself be preceded by other commands. */ rtfNeXTHelpMarker: '{' RTFNeXTHelpMarker RTFNeXTmarkername RTFtext '}' { GSRTFopenBlock(CTXT, YES); } rtfIngredients { GSRTFcloseBlock(CTXT, YES); } { GSRTFNeXTHelpMarker (CTXT, $2.parameter, $4); }; /* Font description */ rtfFontList: '{' RTFfontListStart rtfFonts '}' ; rtfFonts: | rtfFonts rtfFontStatement | rtfFonts '{' rtfFontStatement '}' | rtfFonts '{' rtfFontStatement rtfBlock RTFtext '}' { free((void *)$5);} ; /* the first RTFfont tags the font with a number */ /* RTFtext introduces the fontName */ rtfFontStatement: RTFfont rtfFontFamily rtfFontAttrs RTFtext { GSRTFregisterFont(CTXT, $4, $2, $1.parameter); free((void *)$4); } ; rtfFontAttrs: /* empty */ | rtfFontAttrs RTFfcharset | rtfFontAttrs RTFfprq | rtfFontAttrs RTFcpg | rtfFontAttrs rtfBlock ; rtfFontFamily: RTFfamilyNil { $$ = RTFfamilyNil - RTFfamilyNil; } | RTFfamilyRoman { $$ = RTFfamilyRoman - RTFfamilyNil; } | RTFfamilySwiss { $$ = RTFfamilySwiss - RTFfamilyNil; } | RTFfamilyModern { $$ = RTFfamilyModern - RTFfamilyNil; } | RTFfamilyScript { $$ = RTFfamilyScript - RTFfamilyNil; } | RTFfamilyDecor { $$ = RTFfamilyDecor - RTFfamilyNil; } | RTFfamilyTech { $$ = RTFfamilyTech - RTFfamilyNil; } ; /* Colour definition */ rtfColorDef: '{' RTFcolortable rtfColors '}' ; rtfColors: /* empty */ | rtfColors rtfColorStatement ; /* We get the ';' as RTFText */ rtfColorStatement: RTFred RTFgreen RTFblue RTFtext { GSRTFaddColor(CTXT, $1.parameter, $2.parameter, $3.parameter); free((void *)$4); } | RTFtext { GSRTFaddDefaultColor(CTXT); free((void *)$1); } ; /* some cludgy trailer dummyNonTerminal: '\\' { @1.first_line; } / * we introduce a @n to fix the lex attributes * / ; */ %% /* some C code here */ gnustep-gui-0.24.0/TextConverters/RTF/RTFProducer.h0000664000076500007650000000375511707267156021732 0ustar brains99brains99/* RTFProducer.h Writes out a NSAttributedString as RTF Copyright (C) 2000 Free Software Foundation, Inc. Author: Fred Kiefer Date: June 2000 Modifications: Axel Katerbau Date: April 2003 This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; see the file COPYING.LIB. If not, see or write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _GNUstep_H_RTFDProducer #define _GNUstep_H_RTFDProducer #include //#include "GSTextConverter.h" @class NSAttributedString; @class NSMutableDictionary; @class NSColor; @class NSFont; @class NSMutableParagraphStyle; @interface RTFDProducer: NSObject { @public NSAttributedString *text; NSMutableDictionary *fontDict; NSMutableDictionary *colorDict; NSDictionary *docDict; NSMutableArray *attachments; NSColor *fgColor; NSColor *bgColor; NSColor *ulColor; NSDictionary *_attributesOfLastRun; /*" holds the attributes of the last run to build the delta "*/ BOOL _inlineGraphics; /*" Indicates if graphics should be inlined. "*/ int unnamedAttachmentCounter; /*" Count the number of unnamed attachments so we can name them uniquely "*/ } @end @interface RTFProducer: RTFDProducer // Subclass with no special interface @end #endif gnustep-gui-0.24.0/TextConverters/GNUmakefile0000664000076500007650000000221511122715377021021 0ustar brains99brains99# # Makefile for TextConverters bundles # # Copyright (C) 2001 Free Software Foundation, Inc. # # Author: Adam Fedor # # This file is part of the GNUstep GUI Library. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-gui include $(GNUSTEP_MAKEFILES)/common.make # # The list of subproject directories # SUBPROJECTS = RTF include $(GNUSTEP_MAKEFILES)/aggregate.make gnustep-gui-0.24.0/gnustep-gui.spec.in0000664000076500007650000000142010714662576017505 0ustar brains99brains99Summary: The GNUstep gui library Release: 1 License: LGPL Group: Development/Libraries Source: ftp://ftp.gnustep.org/pub/gnustep/core/%{gs_name}-%{gs_version}.tar.gz Requires: gnustep-base >= 1.15.1 %description The GNUstep gui Library is a powerful library of graphical user interface classes written completely in the Objective-C language; the classes are based upon the OpenStep specification, and provide the user with a traditional nextstep-like look and feel. The classes include graphical objects such as windows, menus, buttons, text fields, popup lists, browsers, scrollviews, splitviews, fonts, colors, images, events, pasteboards,... This package includes development headers too. You need the corresponding backend library package (gnustep-back) to use this package. gnustep-gui-0.24.0/INSTALL0000664000076500007650000000460110711446641015000 0ustar brains99brains991 Installation ************** 1.1 Introduction ================ This file documents the installation of the GNUstep GUI Library, `gnustep-gui'. If you are installing this package as part of the GNUstep core package, read the file GNUstep-HOWTO for more complete instructions on how to install the entire GNUstep package (including this library). GNUstep-HOWTO is located at `http://www.gnustep.org' and in the gnustep-make package (which you should install first). You must have installed gnustep-base and gnustep-make before building this library. GNUstep Make version 2.0.0 or greater is required. GNUstep Base version 1.15.0 or greater is required. Other external libraries that you should have installed include: * tiff (REQUIRED) * jpeg (RECOMMENDED) * png (RECOMMENDED) * gif or ungif (OPTIONAL) * aspell (OPTIONAL) * cups (OPTIONAL) * audiofile (OPTIONAL) * portaudio, v19 which has several API changes previous version (OPTIONAL) Read the GNUstep-HOWTO for more information. After installing this library, install gnustep-back. 1.2 Configuration ================= Configuration is performed by running the `configure' program at a shell prompt. You may want to use some of the optional arguments to the `configure' program. Type `configure --help' for a list. GNUstep specific options are at the end of this list (if any). 1.3 Compilation =============== To compile this library, type make. After this is complete, type make install (make sure you are the root user). Some additional options you can use with make are `debug=yes' to make a debugging version of the library and `shared=no' to make a static version of the library. See the gstep-make package for more information on these options. 1.4 Installing ============== To install, type make install 1.5 Post Installation ===================== GNUstep gui comes with a tool called `make_services' which builds a list of installed applications and services. This list is used to find services for the services menu, for instance. This tool should be run after a new service or application is installed in the system. Theoretically, a workspace application, such as GWorkspace, should do this automatically. But this is not done at the current time. You might consider running this service automatically, perhaps in a login script, to make sure the service and application lists are updated regularly. gnustep-gui-0.24.0/ChangeLog.30000664000076500007650000141357610377004044015675 0ustar brains99brains992004-12-30 Quentin Mathe * Source/GSToolbarView.m: Modified to be more compliant with GNUstep coding standards. (-draggingEntered:): (-draggingUpdated:): Prevents the user to customize the toolbar when -allowsUserCustomization returns NO (bug #11393). * Source/NSToolbarItem.m: Modified to be more compliant with GNUstep coding standards. (-mouseDown:): Prevents the user to customize the toolbar when -allowsUserCustomization returns NO (bug #11393). 2004-12-23 05:38 Gregory John Casamento * Images/MagnifyGlass.tiff: Added. The NSColorPanel class uses this image. 2004-12-13 Quentin Mathe * Source/NSComboBoxCell.m: Modified the code to be clearer Renamed internal class GSFirstMouseTableView to GSComboBoxTableView Removed GSComboWindow _localSelection ivar which is not needed, because the user selection is now handled in -clickItem and not in -tableViewSelectionDidChange: which is now reserved to the internal (aka local) selection support. (-[GSComboWindow selectItem:]): Renamed the method name to -clickItem: (-[GSComboWindow clickItem:]): Reworked to the method to be used by the NSTableView (or NSBrowser) action to track the user clicks. (-[GSComboWindow validateSelection:]): Rewritten the method to handle itself the selection, the method updates now the cell object value and sends the action bound to the cell. (-selectItemAtIndex:): Updated the method to match the Cocoa specification which states that this method should adjust the selection in the combo box list but not simulate a user click. 2004-12-09 Fred Kiefer * Source/NSCursor.m (getStandardCursor()): If not standard cursor is available, try an image cursor with an image of the same name. * Images/common_OpenHandCursor.tiff * Images/common_ClosedHandCursor.tiff: New cursor image files by Fabien Vallon . * Images/GNUmakefile: Install the new files. * Images/nsmapping.strings: Register the new cursor files for the names used in NSCursor.m. 2004-11-11 Adam Fedor * Source/GSDragView.m ([GSDragView -_setCursor]): Initialize variable. * Source/NSMatrix.m: Rename vaguely-named macro. (Based on Patch #3499 from Patrick Middleton). 2004-11-11 Adam Fedor * Version: Add numeric value for runtime versioning. * Souce/GNUmakeifle: Add resource set install. * Source/GNUmakefile.postamble (Info-gnustep.plist): New target. 2004-11-11 Adam Fedor * Model/GMAppKit.m ([NSPopUpButton -encodeWithModelArchiver:]): More robust method for getting title (works on OPENSTEP, from George Fleischmann). 2004-11-11 Fred Kiefer * Headers/AppKit/NSMenu.h * Source/NSMenu.m (-setMain:): New internal method to set the main menu of an application. Uses code from [NSApplication setMainMenu:] plus a display call for the new main menu. * Source/NSApplication.m (-setMainMenu:): Use the new method on NSMenu to flag a menu as main and cleaned up the logic. 2004-11-11 15:08 Alexander Malmberg * Source/NSCell.m (-_setupTextWithFrame:inView:editor:): Reduce the maximum size. Explicitly set the size of the text view, and make it not resizable. * Source/NSLayoutManager.m (-rectArrayForGlyphRange: withinSelectedGlyphRange:inTextContainer:rectCount:): Fix check for whether the starting index is inside a line frag rect. * Source/NSTextView.m (-sizeToFit): Don't increase the size if we have no inset. (-updateInsertionPointStateAndRestartTimer:): Force the insertion point rect to be inside the text view. (-scrollRangeToVisible:): If we are a non-rich-text field editor, adjust the scrolling to make the auto-scrolling more useful. Fixes bug #9279. 2004-11-10 Matt Rice * Headers/Additions/GNUstepGUI/GSDisplayServer.h (-iconSize): New method declaration. (-iconTileImage): Ditto. * Source/GSDisplayServer.m (-resolutionForScreen:): Fix Typo in Docs. (-boundsForScreen:): Ditto. (-windowBounds:): Ditto. (-iconSize): Implement new method. (-iconTileImage): Ditto. * Source/NSApplication.m (NSAppIconView): Remove useWindowmakerIconBackground variable. (scaledIconSizeForSize): New function. ([NSAppIconView +initialize]): Dont set a default image here. Remove usage of GSUseWindowmakerIconBackground default. Use backend tile and scale it to the backend icon size. ([NSAppIconView -drawRect:]): Remove usage of useWindowmakerIconBackground. Draw cells with the backend icon size. ([NSAppIconView -setImage:]): Set the image to a scaled copy. setNeedsDisplay instead of drawing directly. ([NSApplication -_appIconInit]): Use backend icon size. * Source/NSWindow.m: Remove useWindowmakerIconBackground variable. (scaledIconSizeForSize): New function. ([NSMiniWindowView +initialize]): Remove usage of GSUseWindowmakerIconBackground default. Use backend tile image and scale it to the backend icon size. ([NSMiniWindowView -drawRect:]): Remove usage of useWindowmakerIconBackground. Draw cells with the backend iconSize. ([NSMiniWindowView -setImage:]): Set the image to a scaled copy. setNeedsDisplay instead of drawing directly. ([NSMiniWindowView -setTitle:]): setNeedsDisplay instead of drawing directly. ([NSWindow -miniaturize:]): Use backend icon size. * Documentation/GuiUser/DefaultsSummary.gsdoc: Remove docs for GSUseWindowmakerIconBackground. 2004-11-09 Adrian Robert * Source/NSTabView.m (-insertTabViewItem:): Update display. (-removeTabViewItem:): Same. (-selectTabViewItem:): Fix erroneous comment. (-selectTabViewItemAtIndex:) Check index in range. (-drawRect:) Don't try to select first tab if there are no tabs. * Source/NSColorList.m (-initWithNameFromFile:) Treat filename given as full path, not directory (but support this previous behavior in case apps are relying on it). Also, if fail to read file as an archive, try text format. (+loadAvavailableColorLists:) Adjust code for change to -initWithName:fromFile:. (-_readTextColorFile:) New utility method to support -initWithNameFromFile:. * Headers/AppKit/NSColorList.h: Document above changes. 2004-11-09 22:36 Alexander Malmberg * Source/GSInfoPanel.m (_value_from_info_plist_for_key): Rename to value_from_info_plist_for_key. (_nil_or_not_of_class): Rename to nil_or_not_of_class. Update callers. (-initWithDictionary:): Fix comment typo. * Source/NSAlert.m: Whitespace cleanups. * Source/NSPrinter.m: Whitespace cleanups. 2004-11-09 22:08 Alexander Malmberg * Source/GSHorizontalTypesetter.m (-layoutLineNewParagraph:): Implement NSLineBreakByClipping. Set outside_line_frag and dont_show attributes for every glyph. 2004-11-09 18:55 Alexander Malmberg * Source/NSPasteboard.m (+_pbs): Give gpbs a --GSStartupNotification argument. Listen for the notification and connect immediately if it arrives. Clarify the user message. Fixes bug #10876. 2004-11-08 Quentin Mathe * Source/NSButtonCell.m (-setImage:): Added overriden NSCell method in order to have the cell switched to an image cell (with the NSImageOnly position) when you call -setImage:. With the previous commit, when the cell is a text cell and you call -setImagePosition: after -setImage:, the cell image is released. 2004-11-07 Quentin Mathe * Source/NSCell.m (-type): Now returns NSNullCellType when the image value is nil and the cell type is NSImageCellType, in order to match the documented Cocoa behavior. * Source/NSButtonCell.m (-setImagePosition:): Finished to commit the patch (not fully applied) associated with the revision 1.90, the bug #10595 is now corrected. 2004-11-07 Quentin Mathe * Source/NSWindow.m (-constrainFrameRect:toScreen:): Modified the method to match the specification and the constraints used when the user moves/resizes the window with the cursor. That makes possible to have resizable windows which extends below the bottom of the screen as long as you can move them up to take back the resize control on the screen. (-setFrame:display:): Modified the method to remove the possibility to have the window title bar positioned over the top of the screen when using -gui window decorations. 2004-11-06 08:34 Gregory John Casamento * Source/GSNibTemplates.m: Removed nibInstantiate. This method should only be defined and used inside the GUI builder application according to specs. 2004-11-04 Adrian Robert * Documentation/GuiUser/KeyboardSetup.gsdoc: Describe the new "GSModifiersAreKeys" default. 2004-10-31 12:04 Gregory John Casamento * GNUmakefile.postamble: Removed the after-clean clean section which is attempting to remove directories which existed prior to the change which moved all of the headers. While this is not causing an issue on Linux, some other environments fail when attempting to "make distclean". 2004-10-30 Alex Perez * Headers/AppKit/NSImage.h (+_standardImageWithName:): New method. * Source/NSImage.m (+_standardImageWithName:): New method. * Source/NSWorkspace.m (_getImageForName:alternate:): Remove. Update callers to use +_standardImageWithName: instead. 2004-10-25 Quentin Mathe * Source/NSWorkspace.m: Moved the code which looks for the application icons in the method -iconForFile: to the method -appIconForApp:. As a side effect, it fix the bug introduced by my last commit which caused a nil exception when the application info.plist contains no NSIcon entry. 2004-10-24 Quentin Mathe * Source/NSWorkspace.m (-appIconForApp:): Fixed code to be more generic by using -[NSBundle pathForImageResource:]. Now the method works with NSIcon value not path based like "MyApplication.tiff". 2004-10-22 08:26 Gregory John Casamento * Source/NSStepperCell.m: Corrected issue with [NSStepperCell initWithCoder:] for encoding issue with gcc 3.4. * Header/AppKit/NSStepperCell.h: Took out defines which use the bitfields in NSCell.h. These now are BOOL variables. 2004-10-21 Fred Kiefer * Source/NSResponder.m (-initWithCoder:): Set missing default value for menu to nil. * Source/NSButtonCell.m (-initWithCoder:): Hack around Apple NIB bug and decode some of the flags. 2004-10-17 Gregory John Casamento * Source/NSCell.m: Added code to [NSCell initWithCoder:] which properly retains the formatter and menu. * Source/GSNibCompatibility.m: Changed comment. * Source/NSResponder.m: Added keyed archiving implementation in initWithCoder: * Source/NSTextView.m: Improved implementation of keyed coding for NSTextView. Also preparing to add details discovered about the flag settings. * Source/NSView.m: Improved NSView keyed decoding. Also made sure that [super initWithCoder:] is called in that method for both the keyed and non-keyed archiving (as it should be). * Source/NSWindow.m: Added implementation of undo: and redo: to NSWindow.m. 2004-10-17 Adrian Robert * Source/Functions.m (NSBestDepth): Check outarg exactMatch is non-null before setting. * Source/NSFont.m (getNSFont): Use defaultSize for 'fontSize' args of <0 as well as ==0; documented. 2004-10-11 Georg Fleischmann * Model/GMAppKit.m [-encodeWithModelArchiver:] remove title bar and resize bar from 'minSize'. 2004-10-15 07:33 Matt Rice * Source/NSApplication.m ([NSAppIconView -mouseDown:]): order front possibly obscured windows if not hidden. 2004-10-11 Fred Kiefer * Source/NSActionCell.m (-initWithCoder:): * Source/NSBitmapImageRep.m (-initWithCoder:): * Source/NSImage.m (-initWithCoder:): Implemented keyed decoding. * Source/NSMatrix.m (-initWithCoder:): Don't use methods to set the cell size and intercell spase, as this will change the frame. * Source/NSFormCell.m (-initWithCoder:): Set the string value later, as the decoding is super gets used for the title. * Source/NSButtonCell.m (-initWithCoder:): Set fields only when value is provided and fake NSImageLeft until flag decoding is there. 2004-10-08 22:08 Chad Hardin * Printing/GNUmakefile: Now goes in and build GSCUPS (Work in progress!) * Printing/GSCUPS/GNUmakefile: Added * Printing/GSCUPS/GNUmakefile.postamble: Added * Printing/GSCUPS/GNUmakefile.preamble: Added * Printing/GSCUPS/GSCUPSPageLayout.h: Added * Printing/GSCUPS/GSCUPSPageLayout.m: Added * Printing/GSCUPS/GSCUPSPrincipalClass.h: Added * Printing/GSCUPS/GSCUPSPrincipalClass.m: Added * Printing/GSCUPS/GSCUPSPrintInfo.h: Added * Printing/GSCUPS/GSCUPSPrintInfo.m: Added * Printing/GSCUPS/GSCUPSPrintOperation.h: Added * Printing/GSCUPS/GSCUPSPrintOperation.m: Added * Printing/GSCUPS/GSCUPSPrintPanel.h: Added * Printing/GSCUPS/GSCUPSPrintPanel.m: Added * Printing/GSCUPS/GSCUPSPrinter.h: Added * Printing/GSCUPS/GSCUPSPrinter.m: Added. GSCUPS is a work in progress. Some changes still need to be made to NSPrinter, NSPrinterInfo. Additionally, NSPrintPanel needs to be improved to take advantage of the new features that GSCUPS will provide. 2004-10-08 Fred Kiefer * Source/NSFormCell.m: (-initWithCoder:): * Source/NSMatrix.m: (-initWithCoder:): Implemented keyed decoding. * Source/NSColor.m: (-initWithCoder:): Corrected handling of alpha values (use 1 instead of 0) * Source/NSCell.m: (-initWithCoder:): Added some more flag handling and rearranged code. 2004-10-08 09:17 Chad Hardin * Printing/GSLPR/GSLPRPageLayout.m: Fixed a #define * Printing/GSLPR/GSLPRPrintInfo.m: Made it so the code calls NSPrinter's printerWithName rather than GSLPR's, because the former caches NSPrinter objects. * Printing/GSLPR/GSLPRPrinter.h: Moved a method out of a (Private) catagory and place it into the header file, directly into the class. * Printing/GSLPR/GSLPRPrinter.m: Simplified the class by taking out an unnecesary initializer. 2004-10-08 Chad Hardin * Printing/GSLPR/GSLPRPrintOperation: Removed useless #defines and did a minor format cleanup. * Printing/GSLPR/GSLPRPrinter.m: Took out a few PS specific methods so that they can be put into the parent class, NSPrinter. * Source/NSPrinter: Received PS specific methods from GSLPRPrinter so that they can be used by GSCUPS as well. Also removed some useless NSDebugs. 2004-10-05 Adam Fedor * Source/GNUmakefile.postamble (libgnustep-gui.def): Search for both T and R symbols to work with multiple mingw/cygwin flavors. 2004-10-01 Adam Fedor * Documentation/ReleaseNotes.gsdoc: Format fixes. * Source/DocMakefile (before-clean, after-clean): Move obj out of the way so it isn't removed when cleaning docs. 2004-10-01 Adam Fedor * Source/GNUmakefile.preamble: Add filter out flags for compilation of some files on Solaris. 2004-09-27 17:49 Alexander Malmberg * Source/GSServicesManager.m (NSPerformService): Check whether the service provider is remote by checking the class of the object. 2004-09-26 22:18 Alexander Malmberg * Source/NSTabViewItem.m (-drawLabel:inRect:): Adjust the label position to match the text height change (of 2004-09-21). 2004-09-25 Matt Rice * Source/NSScrollView.m: Remove corner view when we have one, but no vertical scroller. (Fixes #10501). 2004-09-24 Adam Fedor * Documentation/GNUmakefile.postamble: Clean up files properly * Source/DocMakefile: Fix up for moved files * Documentation/Gui/Gui.gsdoc, Documentation/GuiAdditions/GuiAdditions.gsdoc: Move up one level. 2004-09-24 Fred Kiefer * Headers/AppKit/NSControl.h Added new MacOSX delegate methods. * Source/NSControl.m (-validateEditing, -currentEditor, -abortEditing, -calcSize): Implemented these methods. (-mouseDown:): Use method to check if mouse is inside cell. 2004-09-24 Fred Kiefer * Source/NSMenuView.m (-setMenu:): Only call update when the new menu is not nil. * Source/NSMenu.m (-setMenuRepresentation:): Unset the menu of the old view. (-dealloc): Unset the menu of the view. (-initWithTitle:): Use setMenuRepresentation: to set the view. 2004-09-24 Adam Fedor * Version 0.9.4 * Documentation/General/OpenStepCompliance.gsdoc: Updates * Documentation/ReleaseNotes.gsdoc, Documentation/news.texi: Idem. 2004-09-24 Fred Kiefer * Source/NSView.m (-initWithCoder:): Added keyed decoding of "hidden" flag. * Source/NSCell.m (-initWithCoder:): Added the first bit of keyed flags decoding. Values provided by Adrian Robert . 2004-09-23 22:33 Alexander Malmberg * Source/NSTableView.m (-mouseDown:): Fix the check that detects when an unselected row is being dragged. 2004-09-23 18:01 Alexander Malmberg * Printing/GSLPR/GSLPRPrintOperation.m (-createContext): Always use the path from the info dictionary if it's set. 2004-09-21 23:57 Alexander Malmberg * Source/NSCursor.m (_getStandardCursor): Rename to getStandardCursor and make static and non-inlined. Update callers. * Source/NSTableView.m (computePeriod): Make static. 2004-09-21 18:53 Alexander Malmberg * Source/GSFontInfo.m (-defaultLineHeightForFont): Adjust line height calculation. * Source/NSButtonCell.m (-drawInteriorWithFrame:inView:): Always initialize imageRect and titleRect. Adjust the calculations to match the new line height. (-cellSize): Always initialize imageRect and titleRect. * Headers/AppKit/NSCell.h (-_drawImage:inFrame:isFlipped:): Remove. * Source/NSCell.m (-_drawImage:inFrame:isFlipped:): Remove. Move code back ... (-drawInteriorWithFrame:inView:): ... here. * Source/NSToolbarItem.m (+initialize): Remove. (+cellClass): Add. 2004-09-18 15:15 Alexander Malmberg * Source/GSServicesManager.m (_serviceFromAnyLocalizedTitle): Rename to serviceFromAnyLocalizedTitle and make static. * Source/tiff.m (NSTiffWarning): Log tiff warnings using NSDebugLLog instead of NSLog. 2004-09-17 Fred Kiefer * Source/NSTextFieldCell.m (-initWithCoder:): Moved special handling of action mask into non-keyed decoder branch. 2004-09-16 Fred Kiefer * Source/NSCell.m (-setStringValue:, -setFont:, -setImage:): Use method call to change cell type. (Readded this change) * Source/NSButtonCell.m (-setType:): Overwrite super method with empty implementation. Patch by Quentin Mathe . * Source/NSView.m (-initWithCoder:): Added the first bit of keyed flags decoding. 2004-09-16 Matt Rice * Source/NSTextFieldCell.m (+initialize): Bump class version. (-initWithCoder:): When decoding the previous version of NSTextFieldCell replace the old default _action_mask with the new default value. (Fixes #9609 for .gorm files) 2004-08-02 Adrian Robert * Documentation/Gui/Gui.gsdoc: Update to reflect slight rearrangement of material to initiate a GUI programming manual. This partially reverts a change that was accidentally undone earlier. 2004-09-13 Matt Rice * NSScrollView.h: Declare new ivar _cornerView and private method -_synchronizeCornerAndHeaderView * NSScrollView.m (tile): Call _synchronizeCornerAndHeaderView method from here. Replace local cornerView variable with _cornerView. (-setDocumentView:): Remove code to set the corner and header views. (-_synchronizeCornerAndHeaderView): Implement new method. * NSTableView.m (-setHeaderView:, -setCornerView:): call tile on the scroll view we're in. Remove comments and warnings for cases which are now implemented. 2004-09-12 Matt Rice * Headers/AppKit/NSCell.h (-_sendsActionOn:): New method. * Source/NSCell.m (-_sendsActionOn:): Implement it. * Source/NSTextFieldCell.m (-initTextCell:): Change _action_mask to a key press. * Source/NSTableView.m (-mouseDown:): Use _sendsActionOn: to only modify the object value and send the event to the cell if the cell works on mouse events. (Fixes #9609). 2004-09-12 Gregory John Casamento * Headers/NSDataLinkPanel.h: Added new attributes. * Source/NSDataLinkPanel.m: Implemented some methods. * Panels/English.lproj/GSDataLinkPanel.gorm: Updated graphics and added link to new ivar. * Source/NSDataLink.m: * Source/NSDataLinkManager.m: Code cleanup. 2004-09-11 Gregory John Casamento * Source/NSCell.m: Reverted previous change. The change was causing an issue where if the font was changed on an NSButtonCell which contains both an image and text. The title was being, incorrectly, reset to "title". * Source/NSDataLinkPanel.m: Renamed the shared variable to something more standard. 2004-09-09 Fred Kiefer * Source/NSCell.m (-setStringValue:, -setFont:, -setImage:): Use method call to change cell type. 2004-09-07 Adam Fedor * Source/GNUmakefile: Specify INTERFACE_VERSION explicitly. * Documentation/ReleaseNotes.gsdoc, Documentation/news.texi: Update for new release. 2004-09-05 Quentin Mathe * Headers/Additions/GNUstepGUI/GSToolbarView.h: Changed _heightFromLayout from unsigned int to float. * Source/GSToolbarView.m (-initWithFrame:displayMode:sizeMode:): Removed the local variable toolbarViewHeight to use the ivar _heightFromLayout in order to have a toolbar height which is not equal to zero when the toolbar is empty. (the toolbar height now matches initially the height associated with the selected size mode) (-_handleBackViewsFrame): Added a local variable newHeight to store the highest caculated height for a toolbar item in order to not have _heightFromLayout set to zero when the toolbar is empty (no toolbar items). * Source/GSToolbar.m (-setDelegate:, -_setDelegate:broadcast:, -setToolbarView:): Deactived the delegate synchronization with broadcast set to NO for the method -_setDelegate:broadcast: because it could produce strange segmentation faults or exceptions with Cocoa applications which haven't been written with this delegate synchronization behavior in mind. (-setSelectedItemIdentifier:, -_build, -_insertItemWithItemIdentifier:atIndex:broadcast:, -_setDelegate:broadcast:): Added the nil delegate check because a nil delegate could happen more easily without the delegate synchronization, moreover it wasn't handled correctly before. 2004-09-05 10:30 Matt Rice * Source/NSTableView.m: [NSTableView mouseDown:] removed code which copied and subsequently DESTROYs dataCell. This was causing a SIGSEGV. 2004-09-05 06:23 Matt Rice * Source/GSServicesManager.m: new method -activateIgnoringOtherApps: * Source/NSWorkspace.m (-launchApplication:showIcon:autolaunch:): call -activateIgnoringOtherApps: on the remote connection to an already running app. 2004-09-04 23:32 Alexander Malmberg * Source/GSHorizontalTypesetter.m (-layoutLineNewParagraph:): Pass the right glyph position to cells. * Headers/AppKit/NSTextAttachment.h: Clarify documentation. 2004-09-04 01:34 Alexander Malmberg * PrinterTypes/GNUmakefile, PrinterTypes/GNUmakefile.postamble: Revert removal of rules to install .ppd:s. * PrinterTypes/English.lproj/Generic-PostScript_Printer-Postscript.ppd: New file. * Printing/GSLPR/GNUmakefile: Set GNUSTEP_INSTALLATION_DIR. * Printing/GSLPR/GNUmakefile.preamble: Compile with -Wall. * Printing/GSLPR/GSLPRPrinter.m (+printerWithName:): Remove ppdContents variable. (+printersDictionary): Only warn once if a printer hasn't been set in the defaults. Change the type of the fallback printer to Generic-PostScript_Printer-Postscript. Check that the ppd for this printer is found. 2004-09-04 01:06 Alexander Malmberg * Source/GSToolbarView.m (-_insertionIndexAtPoint:): Remove spurious ';'. 2004-09-02 Quentin Mathe * Headers/AppKit/NSToolbarItem.h: Added GSMovableToolbarItemPboardType declaration. * Source/NSToolbarItem.m: Added the toolbar items rearranging possibility by implementing the dragging source methods. * Source/GSToolbar.m: Added or reworked some methods to support model updates without direct view effects to manipulate the toolbar items when a dragging session happens. * Source/GSToolbarView.m: Added the toolbar items rearranging possibility by implementing the dragging destination methods. And added a method -_insertionIndexAtPoint: to support the insertion index calculation based on the mouse location. 2004-09-01 Adam Fedor * Source/NSPrintInfo.m ([NSPrintInfo -paperSize]): Avoid returning a nil object return value into a struct. * Printing/GSLPR/GNUmakefile.preamble: Add Source/$(GNUSTEP_TARGET_DIR) includes * Tools/GNUmakefile.preamble: Likewise. 2004-09-02 00:17 Alexander Malmberg * Source/NSView.m (-replaceSubview:with:): Clarify documentation. (-scrollRectToVisible:): Implement correctly, patch from Andrew Ruder. Document. 2004-08-30 Quentin Mathe * Headers/AppKit/NSCell.h: * Source/NSCell.m: Make the code a bit more modular with a distinct private method to implement the image drawing (the text drawing is already located in a separate method), see -_drawImage:inFrame:isFlipped:, previously implemented in -drawInteriorWithFrame:inView: * Source/NSButtonCell.m: Moved code specific to NSButtonCell -drawInteriorWithFrame:inView: in a new method -_drawImage:inFrame:isFlipped to match the method added to NSCell. Also reverted the 2004-08-11 21:35 Alexander Malmberg commit to have identical margin between the border and the text with every image positions. Source/NSToolbarItem.m: Added -_drawImage:inFrame:isFlipped and _drawAttributedText:inFrame: to override the superclasses behavior, it permits to have the GSToolbarButtonCell layout not dependent on the NSButtonCell code. 2004-08-29 02:48 Matt Rice * Source/NSTableView.m (-draggingUpdated:): Return currentDragOperation. 2004-08-28 10:34 Gregory John Casamento * Source/GSNibTemplates.m: Added implementation of method shouldSwapClass to GSClassSwapper. This method checks for the implementation of isInInterfaceBuilder and returns whether or not the template should perform the class swap or whether it should retrieve the superclass. * Headers/Additions/GNUstepGUI/GSNibTemplates.h: Added declaration for -[GSClassSwapper shouldSwapClass]. 2004-08-23 17:29 Alexander Malmberg * Source/NSWindow.m (-setFrameFromString:): Don't change the size of the window if it isn't resizable. 2004-08-21 Fred Kiefer * Source/NSComboBoxCell.m (-completedString:): Handle a nil substring by returning nil directly without trying to find a match. Patch by Andreas Hoeschler . Changed data source error messages to consistent wording. 2004-08-13 Quentin Mathe * Source/NSComboBoxCell.m -(runModalPopUpWithComboBoxCell:): Remove the observer only for the variable onWindow, then it is not needed anymore to reset the table view delegate. (-deselectItemAtIndex:): Added a _localSelection flag, the result is now the method still triggers -[GSComboWindow tableViewSelectionDidChange:] call but the _localSelection variable in -validateSelection avoids to have -selectItemAtIndex: wrongly called. (-trackMouse:inRect:ofView:untilMouseUp:): Fixed broken combo box behavior introduced June 17 with version 1.27, which produced wrong tracking in the button cell and extra mouse down call in the NSComboBox superclass. Now the rewritten version is also documented. * Source/NSComboBox.m (-mouseDown:): Reverted the use of the variable clicked (that contributes to fix the bug explained above) and renamed it buttonClicked. * Headers/AppKit/NSComboBoxCell.h: Added the method -trackMouse:inRect:ofView:untilMouseUp to have the documentation generated for this overriden method , it shouldn't be needed( it is a temporary hack until we have the root problem corrected). 2004-08-12 01:42 Alexander Malmberg * Source/NSLayoutManager.m (-textStorage:edited:range:changeInLength:invalidatedRange:): Adjust the selected range even if there's no length change. Change the handling of the in/in case. Set the selected range using a text view if we have any attached. * Source/NSTextView.m (-insertText:): Don't set the selected range. (-setSelectedRange:affinity:stillSelecting:): Clamp the old range to the length of the text. * Source/NSTextView_actions.m (-deleteForward:, -deleteBackward:): Don't set the selected range. 2004-08-11 21:35 Alexander Malmberg * Source/NSButtonCell.m (-drawInteriorWithFrame:inView:): Move text back down by 2 points for NSImageAbove. 2004-08-10 02:01 Alexander Malmberg * Source/GSLayoutManager.m (-usedRectForTextContainer:): Fix the calculation of the used rectangle. 2004-08-10 00:47 Alexander Malmberg * Source/NSAttributedString.m (cache_init, cache_init_real): Add missing void:s. 2004-08-10 00:06 Alexander Malmberg * Source/GSHorizontalTypesetter.m: Formatting cleanups. (-_reuseSoftInvalidatedLayout): New method. Contains soft invalidated layout info handling, moved here from ... (-layoutLineNewParagraph:): ...here. Cache the imp for -advancementForGlyph: and send it directly to the fontInfo. 2004-08-09 21:45 Alexander Malmberg * Headers/Additions/GNUstepGUI/GSLayoutManager_internal.h: Add usedRect and usedRectValid fields to textcontainer_t. * Source/GSLayoutManager.m (-_doLayout): Set usedRectValid to NO when setting complete to YES. (-usedRectForTextContainer:): Optimize the calculation of the used rect. Use usedRect and usedRectValid. 2004-08-09 14:38 Alexander Malmberg * Headers/AppKit/NSWindow.h: _frame is the window frame. (+screenRectForFrameRect:styleMask:, +frameRectForScreenRect:styleMask:): New methods. * Source/GSDisplayServer.m (-window:::, -styleoffsets:::::): Update documentation. * Source/GSStandardWindowDecorationView.m (+screenOffsets::::forStyleMask:): Implement new method. * Source/GSWindowDecorationView.h (+screenRectForFrameRect:styleMask:, +frameRectForScreenRect:styleMask:): New methods. * Source/GSWindowDecorationView.m (+screenOffsets::::forStyleMask:, +screenRectForFrameRect:styleMask:, +frameRectForScreenRect:styleMask:): Implement them. * Source/NSWindow.m (+screenRectForFrameRect:styleMask:, +frameRectForScreenRect:styleMask:): Implement new methods. (-_initBackendWindow): Always update _wv's frame. 2004-08-08 Quentin Mathe * Source/NSComboBox.m: * Source/NSComboBoxCell.m: Fixed the class description markup errors which caused text truncations in the documentation. 2004-08-08 01:19 Chad Hardin * Source/NSPageLayout.m: Ensure that the units on the panel are set. Using -viewWithTag:, I had to make sure I called the view immediately above the view I was loking for. 2004-08-08 00:43 Chad Hardin * config.make.in: Added CUPS specific make variables. * configure: Regenerated. * configure.ac: Added code to detect the presence of cups for the new GSCUPS printing backend bundle. Detects cups but the GSCUPS bundle is not ready yet so it does not actually try to build anything related to cups. * Headers/AppKit/NSPrinter.h: * Source/NSPrinter.m: * Printing/GSLPR/GSLPRPrinter.m: NSPrinter no longer assumes it is PPD specific. However, it does include a catagory named PPDParsing, which the backend printing bundles can call to have a PPD file parsed and placed into NSPrinter's tables. All the PPD parsing code was taken out of GSLPRPrinter.m. Also, a lot of code format cleanup was done. * Printing/GSLPR/GSLPRPrintInfo.m: * Source/AppKit/NSPrintInfo.m: Moved initWithDictionary: code out of GSLPR's GSLPRPrintInfo implementation into here. * Printing/GSLPR/GSLPRPrincipalClass.h: Correct copyright. * Printing/GSLPR/GSLPRPrincipalClass.m: Correct copyright. * Printing/GSLPR/GSLPRPrintInfo.h: Fixed reference to NSPrintInfo. * Printing/GSLPR/GSLPRPrintOperation.h: Fixed referece to NSPrintOperation. * Printing/GSLPR/GSLPRPrinter.h: Fixed reference to NSPrinter. * Panels/English.lproj/GSPageLayout.gorm/objects.gorm: Increased the size of the panel's title and made it bold. * Printing/GNUmakefile: Added code to optionally build the (upcoming) GSCUPS printing backend bundle. Currently it's disabled. 2004-08-07 13:18 Alexander Malmberg * Source/NSTextView.m (-mouseDown:): Remove -containsAttachments call. 2004-08-06 14:13 Alexander Malmberg * Source/NSPasteboard.m (-pasteboard:provideDataForType:): Print a warning instead of crashing in NSMapFile handling. (+_pasteboardWithTarget:name:): Update the local changeCount. 2004-08-02 Adrian Robert * Documentation/GuiUser/DefaultsSummary.gsdoc: Clarify the role of NSGlobalDomain; explain that NSShowNonLocalizedStrings is a developer option (in absence of a document specifically documenting developer defaults, the doc will go here). 2004-08-02 16:32 Alexander Malmberg * Headers/AppKit/NSCell.h, Source/NSMenuView.m: Rename xDist and yDist to GSCellTextImageXDist and GSCellTextImageYDist. * Source/NSMenuItemCell.m: Rename xDist and yDist. (titleRectForBounds:): Reindent. * Source/NSButtonCell.m (-drawInteriorWithFrame:inView:, -cellSize): Adjust size calculations, make them more forgiving before clipping text, and make -cellSize and -drawInteriorWithFrame:inView: match each other again. Update xDist and yDist references. 2004-08-01 14:55 Alexander Malmberg * Source/GSStandardWindowDecorationView.m (-drawTitleBar): Fix the centering of the title. 2004-08-01 14:28 Alexander Malmberg * TextConverters/RTF/RTFProducer.m (-_addAttributesString:): Only add attachmentFileWrapper to the attachments array if it isn't nil. 2004-07-30 Adrian Robert * Documentation/GuiUser/GNUMakefile.postamble: Remove an unwanted level of hierarchy when installing GSdoc generated under Documentation/GuiUser. 2004-07-30 15:52 Alexander Malmberg * Headers/AppKit/NSGraphicsContext.h (-GSReadRect:): Document. * Source/NSBitmapImageRep.m (-initWithFocusedViewRect:): Update for new key names from GSReadRect:. * Source/NSGraphicsContext.m (-GSReadRect:): Return nil. 2004-07-29 Adrian Robert * Documentation/GuiUser/DefaultsSummary.gsdoc: Added some explanation of how to set defaults and description of domains, since this isn't readily accessible elsewhere. Also, documented NSShowNonLocalizedStrings default. 2004-07-28 Adam Fedor * PrinterTypes/: Remove PPD files * PrinterTypes/GNUmakefile: Don't install them. 2004-07-28 19:52 Alexander Malmberg * Source/GSWindowDecorationView.h, Source/GSWindowDecorationView.m (-setBackgroundColor:): New method. * Source/NSWindow.m (-setBackgroundColor:): Pass the call along to _wv. (-orderWindow:relativeTo:): Use -setFrame:display: to change the frame after contstraining it. (-constrainFrameRect:toScreen:): Fix the check of whether the bottom of the window is off the screen. (-_sendEvent:becomesKeyOnlyIfNeeded:): Clean up handling of GSAppKitWindowResized. (-initWithCoder:): Destroy _miniaturizedImage before setting it to the decoded image. 2004-07-27 Quentin Mathe * Headers/Additions/GNUstepGUI/GSToolbarView.h: * Source/GSToolbarView.m: * Source/NSToolbarItem.m: Moved static const and enum declarations from GSToolbarView.h to GSToolbarView.m and NSToolbarItem.m. * Source/NSWindow+Toolbar.m: Fixed non correct toolbar view visibility when [NSToolbar -setVisible:] is called before [NSWindow -setToolbar:](bug reported by Yen-Ju Chen ). 2004-07-24 22:47 Alexander Malmberg * Source/NSToolbarItem.m: Use the predefined variables instead of inline string literals for attribute names. ([GSToolbarButton -layout], [GSToolbarBackView -drawRect:], [GSToolbarBackView -layout]): Release attrStr/attrString. (-copyWithZone:): Return new, not self. 2004-07-23 01:54 Matt Rice * Documentation/GuiUser/DefaultsSummary.gsdoc: Document GSUseWindowmakerIconBackground. * Source/NSApplication.m ([NSAppIconView +initialize], [NSAppIconView -drawRect:]): If the GSUseWindowmakerIconBackground default is YES, do a clear composite of the background instead of using the tile. * Source/NSWindow.m ([NSMiniWindowView +initialize], [NSMiniWindowView -drawRect:]): Idem. 2004-07-22 04:46 Chad Hardin * Headers/AppKit/NSPageLayout.h: Changed to MVC and a whole new UI. * Headers/AppKit/NSPrintInfo.h: Format cleanup. * Headers/AppKit/NSPrintOperation.h: Format cleanup. * Headers/AppKit/NSPrintPanel.h: Format cleanup. * Headers/AppKit/NSPrinter.h: Format cleanup. * Panels/English.lproj/GSPageLayout.gorm/data.classes: New UI. * Panels/English.lproj/GSPageLayout.gorm/objects.gorm: New UI. * Printing/GSLPR/GSLPRPrintInfo.m: Format cleanup. * Printing/GSLPR/GSLPRPrintOperation.m: Format cleanup. * Printing/GSLPR/GSLPRPrintPanel.m: Format cleanup. * Printing/GSLPR/GSLPRPrinter.m: Format cleanup. * Source/GSEPSPrintOperation.m: Format cleanup. * Source/GSPDFPrintOperation.m: Format cleanup. * Source/GSPrintOperation.m: Format cleanup. * Source/GSPrinting.m: Format cleanup. * Source/NSPageLayout.m: Changed to MVS and a whole new UI. * Source/NSPrintInfo.m: Format cleanup. The big thing changed here is that NSPageLayout has a whole new UI and is MVC based. I have not yet implemented the ability to create and edit custom papers, that is next. 2004-07-22 00:18 Gregory John Casamento * Source/GSNibContainer.m: Corrected spelling mistake in comment. 2004-07-22 00:59 Alexander Malmberg * Source/GSStandardWindowDecorationView.m (-setDocumentEdited:, -setTitle:): Pass the calls along to super. 2004-07-21 19:53 Alexander Malmberg * Source/NSFontPanel.m (-_trySelectSize:updateSizeField:): Add updateSizeField argument. Update callers. 2004-07-20 01:24 Alexander Malmberg * Source/NSScroller.m (-rectForPart:): Use floor() instead of floorf(). 2004-07-18 Gregory John Casamento * Source/GSNibTemplates.m: Removed some commented out code. 2004-07-14 Adam Fedor * Documentation/General/OpenStepCompliance.gsdoc: Update. * Documentation/Gui/Gui.gsdoc: Add compliance and release links * Source/NSSavePanel.m: Remove extraneous ';' at end of some methods * Source/NSTableView.m: Idem. 2004-07-15 02:28 Alexander Malmberg * Source/NSBezierPath.m (point_on_curve): New function. (-_recalculateBounds): Rewrite. Calculate bounds analytically. 2004-07-13 02:54 Alexander Malmberg * Source/NSImageRep.m (+_imageRepsWithData:): New method. (+imageRepsWithContentsOfURL:): Use +_imageRepsWithData:. (+imageRepsWithContentsOfFile:): If the filename has no extension, use +_imageRepsWithData: to load it. 2004-07-13 01:15 Alexander Malmberg * Source/NSWindow.m (+_handleAutodisplay:, +_addAutodisplayedWindow:, +_removeAutodisplayedWindow:): New methods. Rename _handleWindowNeedsDisplay: to -_handleAutodisplay. ([NSWindow +initialize]): Don't initialize modes. (-dealloc, -orderWindow:relativeTo:): Use +_addAutodisplayedWindow: and +_removeAutodisplayedWindow: instead of adding/removing a runloop performer. 2004-07-13 00:23 Alexander Malmberg * Source/NSSound.m: Only declare the_server if HAVE_AUDIOFILE_H is defined. 2004-07-13 00:21 Alexander Malmberg * Headers/AppKit/NSMovieView.h: Make loopMode ivar an unsigned int. 2004-07-13 Serg Stoyan * Source/NSButtonCell.m: (_init): Set default values of _gradient_type and _image_dims_when_disabled. (drawGradientWithFrame:inView:): Implemented. Draws gradient according to the _gradient_type ivar value. (drawInteriorWithFrame:inView:): Call drawGradientWithFrame:inView if _gradient_type was set and cell is no highlighted. Dissolve image if cell is disabled and _image_dims_when_disabled was set. 2004-07-11 Gregory John Casamento * Source/GSNibTemplates.m: Added code to allow the switching of which version of the file gets encoded based on the value of the class variable "version". This is part of an experimental feature in .gorm files to allow Gorm.app to encode older versions of .gorm files for previous versions of GNUstep. 2004-07-11 Chad Hardin * Headers/AppKit/NSPageLayout.h: * Source/NSPageLayout.m: * Panels/English.lproj/GSPageLayout.gorm/data.classes: * Panels/English.lproj/GSPageLayout.gorm/objects.gorm: * Printing/GSLPR/GSLPRPageLayout.m: Completely redid NSPageLayout. It now takes full advantage of being GORM based (ie: connections rather than checking tags). Most of the functionality of NSPageLayout was split off and put into a controller object, GSPrintLayoutController. The panel itself is much improved, it even includes a preview display of the page dimensions. 2004-07-11 14:17 Alexander Malmberg * Source/NSLayoutManager.m (-drawGlyphsForGlyphRange:atPoint:): When printing, position each glyph explicitly. 2004-07-09 Chad Hardin * Source/GNUmakefile: * Headers/AppKit/NSPageLayout.h: * Source/NSPageLayout.m: * Headers/AppKit/NSPrintInfo.h: * Source/NSPrintInfo.m: * Headers/AppKit/NSPrintOperation.h: * Source/NSPrintOperation.m: * Headers/AppKit/NSPrintPanel.h: * Source/NSPrintPanel.m: * Headers/AppKit/NSPrinter.h: * Source/NSPrinter.m: Modifications for the backend printing bundle system. * Headers/Additions/GNUstepGUI/GSEPSPrintOperation.h: added. * Source/GSEPSPrintOperation.m: added. * Headers/Additions/GNUstepGUI/GSPDFPrintOperation.h: added. * Source/GSPDFPrintOperation.m: added. * Headers/Additions/GNUstepGUI/GSPrintOperation.h: added. * Source/GSPrintOperation.m: added. * Headers/Additions/GNUstepGUI/GSPrinting.h: added. * Source/GSPrinting.m: added. Split off the various PrintOperation classes. This makes is clear that the printing backend bundles subclass GSPrintOperation, not NSPrintOperation. Also, GSPDFPrintOperation will probably become large when implemented, this clarifies the class structure and prevent NSPrintOperation.m from become overly large and confusing. The GSPrinting class is helper for loading the proper printer backend bundle. * GNUMakefile: includes the Printing directory. * Printing: Added the printing bundles home directory. * Printing/GNUmakefile: added. * Printing/GSLPR: Added the first printing bundle. * Printing/GSLPR/GNUmakefile: added. * Printing/GSLPR/GNUmakefile.postamble: added. * Printing/GSLPR/GNUmakefile.preamble: added. * Printing/GSLPR/GSLPRPageLayout.h: added. * Printing/GSLPR/GSLPRPageLayout.m: added. * Printing/GSLPR/GSLPRPrincipalClass.h: added. * Printing/GSLPR/GSLPRPrincipalClass.m: added. * Printing/GSLPR/GSLPRPrintInfo.h: added. * Printing/GSLPR/GSLPRPrintInfo.m: added. * Printing/GSLPR/GSLPRPrintOperation.h: added. * Printing/GSLPR/GSLPRPrintOperation.m: added. * Printing/GSLPR/GSLPRPrintPanel.h: added. * Printing/GSLPR/GSLPRPrintPanel.m: added. * Printing/GSLPR/GSLPRPrintPrinter.h: added. * Printing/GSLPR/GSLPRPrintPrinter.m: added. Here it is, the first backend printing bundle, version one. The are very little code changes from the original source, bugs that may have been present there would have been carried over here. However, this is just the first round. This bundle uses GNUstep's original PageLayout and PrintPanel GORM panels, it does not have its own. Hence, it is very simple. The plan is for the future GSCUPS bundle to also use GNUstep's GORM panels, not for each bundle to have their own panels. 2004-07-09 Fred Kiefer * Source/NSPanel.m: * Source/NSAlert.m: Moved class GSAlertPanel and alert functions from NSPanel.m to NSAlert.m. 2004-07-08 Fred Kiefer * Source/GNUmakefile: * Source/NSMovieView.m: Added file forgotten in last commit. 2004-07-08 Fred Kiefer * Headers/AppKit/NSMovie.h: * Source/NSMovie.m: * Headers/AppKit/NSMovieView.h: * Source/NSMovieView.m: * Headers/AppKit/NSAlert.h: * Source/NSAlert.m: New MacOSX classes, implementation still empty. 2004-07-08 Serg Stoyan * Images/common_ArrowDownH.tiff: added. * Images/common_ArrowLeftH.tiff: added. * Images/common_ArrowRightH.tiff: added. * Images/common_ArrowUpH.tiff: added. * Source/NSScroller.m: (drawParts): Use added images. Cells now highlights also by NSContentsCellMask. 2004-07-07 Quentin Mathe * Source/GSToolbar.m: Fixed several segmentation faults which could occur when windows with a toolbar have been closed and new similar windows are initialized (bug #9535), rewritten validation support to be more clearer and efficient, and the toolbar notifications now correctly bundles the toolbar items in the notification dictionary (Patch by Ludovic Marcotte). * Source/GSToolbarView: * Source/NSToolbar.m: * Source/NSWindow+Toolbar.m: * Source/NSToolbarItem.m: Related changes and lot of memory leaks fixed permitting to have now the toolbar system properly deallocated when the toolbar is not anymore retained by the user and the toolbar view. Note: In order to observe the toolbar system being deallocated when you close a window, you need to have the option "Window released when closed" checked. Actual retain logic is strictly : - Superview in the view hierarchy retains toolbar view - Toolbar view retains toolbar - Toolbar view retains toolbar items view - Toolbar retains toolbar items And when a toolbar is based on NSToolbar class : - Windows retains toolbar view. * Source/NSView.m: Added a missing method call -viewWillMoveToSuperview: in -removeSubview: method (this missing method is used by the toolbar view). * Headers/Additions/GNUstepGUI/GSToolbar.h: * Headers/AppKit/NSToolbar.h: Moved the _window ivar from GSToolbar class to NSToolbar class. * Headers/AppKit/NSToolbarItem.h: Added a _tag ivar and other minor changes. 2004-07-07 01:23 Alexander Malmberg * Source/NSWindow+Toolbar.m: Properly convert window frames to content view frames and back. (-_toggleToolbarViewWithDisplay:): Move the old content view to the origin of the new content view. 2004-07-06 22:15 Alexander Malmberg * Headers/Additions/GNUstepGUI/GSDisplayServer.h: Add -handlesWindowDecorations. * Headers/AppKit/NSWindow.h: Document _frame ivar and add update for -gui-managed window decorations. (+minFrameWidthWithTitle:styleMask:): Change return type to float. * Source/GNUmakefile: Add GSWindowDecorationView.m and GSStandardWindowDecorationView.m . * Source/GSDisplayServer.m (-handlesWindowDecorations): Provide a default implementation. * Source/NSPanel.m (-sendEvent:): Reimplement using -_sendEvent:becomesKeyOnlyIfNeeded: . (setControl): Only call -setStringValue: on the cell if it doesn't respond to -setTitle: . * Source/NSWindow.m: Reorganize management of the top-level view. Implement -gui-managed window decorations. (-_sendEvent:becomesKeyOnlyIfNeeded:): New method. (-sendEvent:): Reimplement using -_sendEvent:becomesKeyOnlyIfNeeded: . * Source/GSWindowDecorationView.h, Source/GSWindowDecorationView.m, Source/GSStandardWindowDecorationView.m: New files. 2004-07-05 Gregory John Casamento * Source/NSToolbar.m: [NSToolbar _setWindow:] added logic to accept the NSWindowWillCloseNotification, since the toolbar will need to remove itself from the "toolbars" master array. Also added a method called [NSToolbar _handleNotification:] to do the actual removal. * Source/GSToolbar.m: [GSToolbar _setDelegate:] toolbar no longer retains it's delegate. This prevents the delegate from leaking. 2004-07-03 Fred Kiefer * Source/NSOutlineView.m: Moved private methods into separate category. Made (-_collectItemsStartingWith:into:) safe against nil parameter and simplified code. (_removeChildren:) new method as a helper in (-reloadItem:reloadChildren:). 2004-07-01 Fred Kiefer * Source/NSOutlineView.m (-reloadItem:reloadChildren:): Convert possible NSNull key to nil. 2004-06-28 Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibTemplates.h: Updated the GNUSTEP_NIB_VERSION. This constant defines the number used for the GSNibContainer objects' version. Also added a new topLevelObjects ivar to the GSNibContainer class and the method to retrieve it. * Source/GSNibTemplates.m: Move the private class GSNibItemCollector from NSBundleAdditions.m to GSNibTemplates.m. This helped clean up code and also facilitated the changes necessary for the new .gorm version. Also changed the signature of awakeWithContext: so it only takes the context dictionary as an argument and no longer requires the items to be passed in. Changed the awakeWithContext method to efficiently retain the objects. In initWithCoder: and encodeWithCoder: added new section for updated version. Added some logic to collect the top level items at that time so that version 0 and version 1 .gorm files load in a precisely equivalent manner. Also, updated a change made by Alex Malmberg which was causing the designated initializers to not be called. * Source/NSBundleAdditions.m: Moved class to GSNibTemplates as described above. Cleaned up implementation of +loadNibFile: externalNameTable:withZone:. * Source/NSNib.m: Removed some of the code which was there to collect top level items. Also cleaned up some of the code with the new implementation. 2004-06-28 Serg Stoyan * Headers/AppKit/NSScroller.h: Added _pendingKnobProportion ivar. * Source/NSScroller.m: (setFloatValue:knobProportion:): Implemented disabling of scroller when knob proportion equals to 1.0, and implemented pending knob proportion setting (fix disappearing of scroller parts when mouse button still held down). Set float value only if knob is not being dragged. (mouseDown): Redundant code removed. Call setFloatValue:knobProportion: if _pendingKnobProportion is not 0 or just update scroller otherwise. * Source/NSBrowser.m: (_createColumn): Set initial frame origin to -110,-110 to avoid appearing newly created column on top of exising. (updateScroller): Remove enabling/disabling scroller wrt last NSScroller changes. Rewrite floating value calculating code and avoid devide-by-zero case. Always update scroller values (scroller handle the case when it shouldn't update itself). 2004-06-28 Fred Kiefer * Headers/AppKit/NSCursor.h: Added more MacOSX methods for standard cursors. * Source/NSCursor.m: Implemented new standard cursors methods. (+setHiddenUntilMouseMoves:) added implementation. (+initialize) set isHiddenUntilMouseMoves to NO (was YES). * Source/NSApplication.m: (-nextEventMatchingMask:...dequeue:) when cursor is hidden until mouse move, call [NSCursor setHiddenUntilMouseMoves: NO] instead of [NSCursor unhide]. 2004-06-27 23:10 Alexander Malmberg * Source/GSNibTemplates.m: Replace calls to GSGetInstanceMethodNotInherited with calls to GSGetMethod. 2004-06-25 Gregory John Casamento * Source/GSNibCompatibility.m: Print a message when .gorm files are loaded which use the old templates contained here. The next major release should see the removal of these templates from GNUstep. The new templates have completely superceded these. * Source/NSTextView.m: Added call to register for types in initWithCoder: * Source/NSDataLinkPanel.m: Minor reformatting. 2004-06-26 Serg Stoyan * Source/NSBrowser.m: (updateScroller): Use _firstVisibleColumn to define visibility of scroller. Use _lastVisibleColumn to calculate knob proportion if last visible column and last loaded column is not the same. 2004-06-25 Serg Stoyan * Source/NSBrowser.m: (setPath:): Deselect all cells in first column before setting absolute path if first column's selection changed. (doClick:): Fix problem with deselection of already selected item. Update scroller after setting selection. 2004-06-24 Fred Kiefer * Source/NSTableView.m: (-noteNumberOfRowsChanged) corrected off by one error in (NSIndexSet -removeIndexesInRange:) call. 2004-06-23 Serg Stoyan * Source/NSBrowser.m: (frameOfColumn:): Fixed calculating of last visible column width when columns are separated. (drawRect:): Draw horizontal scroller border only when columns are separated. Fixed calculating of horizontal scroller width. 2004-06-22 Adrian Robert * Documentation/manual: Beginnings of programming manual for GUI like the one for Base but just focusing on the library itself (no Objective-C introduction). Structure copied from base manual. * Documentation/gnustep-gui.texi: Moved to manual/Introduction.texi. * Documentation/Gui/Introduction.gsdoc: Moved to manual/BasicClasses.texi. * Documentation/Gui/Gui.gsdoc: Updated to reflect above moves. * Documentation/General/OpenStepCompliance.gsdoc: Fix typos. * Documentation/GNUmakefile: Update to build manual and also be a little more parallel to base Documentation makefile. * Documentation/GNUmakefile.postamble: Remove stray backslash. 2004-06-21 Fred Kiefer * Source/NSTableView.m: * Source/NSOutlineView.m: (-_willDisplayCell:forTableColumn:row:) New method to abstract from differences in table and outline view. Used whenever the delegate gets informed by willDisplayCell:. (_setObjectValue:forTableColumn:row:) Check for correct method. 2004-06-20 Fred Kiefer * Source/NSTableView.m: (-mouseDown:) Set value after cell tracking. (_setObjectValue:forTableColumn:row:) Check for correct method. Patch by Matt Rice * Source/NSComboBoxCell.m: (-objectValue) Added this method, as the object value never gets set. 2004-06-19 Fred Kiefer * Source/GSDragView.m: (-_handleEventDuringDragging:) Get mouse location on periodic event. 2004-06-19 Fred Kiefer * Headers/Additions/GNUstepGUI/GSDisplayServer.h: Added new method (-findWindowAt:windowRef:excluding:). * Source/GSDisplayServer.m: Implemented (-dragInfo) with GSDragView. * Source/GNUmakefile: Added GSDragView.h. * Source/GSDragView.m: Implemented (-_windowAcceptingDnDunder:windowRef:) with new GSDisplayServer method. 2004-06-17 Fred Kiefer * Source/NSComboBoxCell.m: buttonCellFrameFromRect(), (-drawWithFrame:inView:), (-highlight:withFrame:inView:) and (-trackMouse:...untilMouseUp:): Made draw bettere when used in a flipped view. (-positionWithComboBoxCell:) position popup correctly for flipped view. 2004-06-16 Fred Kiefer * Source/NSTableView.m: (-mouseDown:) Added mouse tracking in the cell. * Source/NSComboBoxCell.m: (-trackMouse:...untilMouseUp:) Set _lastValidFrame [GSComboWindow positionWithComboBoxCell:] compute position based on _lastValidFrame not the frame from the control view. 2004-06-16 Fred Kiefer * Source/NSTableView.m: (-mouseDown:) Reordered code and simplified. (-textShouldEndEditing:) Get formatter from _editedCell not _cell. (-_unselectAllColumns) Clear the header view as well. 2004-06-15 Fred Kiefer * Source/NSComboBoxCell.m: (-copyWithZone:) Added missing method. 2004-06-11 Adam Fedor * Version 0.9.3 * Documentation/ReleaseNotes.gsdoc: New file * Documentation/GNUmakefile: generate ReleaseNotes. Update GuiUser make * Documentation/GuiUser/GNUmakefile: New file. * Source/DocMakefile: Remove GuiUser generation. 2004-06-09 Quentin Mathe * Source/NSComboBoxCell.m: Improved look, added constrained height and minor documentation change. * Source/NSComboBox.m: Added constrained height and minor documentation change. 2004-06-08 Fred Kiefer * Source/NSCell.m: (-drawWithFrame:inView:) * Source/NSFormCell.m: (-drawWithFrame:inView:) * Source/NSTableHeaderCell.m: (-drawWithFrame:inView:) * Source/NSTableView.m: (-drawRect:) * Source/NSColorWell.m: (-drawRect:) * Source/NSProgressIndicator.m: (+initialize, -drawRect:) * Source/NSScrollView.m: (-drawRect:) * Source/NSTabView.m: (-drawRect:) * Source/GSTitleView.m: (-drawRect:) * Source/NSBrowser.m: (-drawRect:, [GSBrowserTitleCell drawWithFrame:inView:]) Use GSDrawingFunction methods instead of NS functions. Also changed colour of progress indicatore. Patch by Nicolas Roard . 2004-06-07 Quentin Mathe * Source/NSComboBoxCell.m: Added complete documentation. * Source/NSComboBox.m: Minor documentation corrections. 2004-06-06 Quentin Mathe * Source/NSComboBox.m: Added complete documentation. 2004-06-04 Fred Kiefer * Headers/Additions/GNUstepGUI/GSDragView.h: * Source/GSDragView.m: New files with a backend neutral drag and drop implementation. * Source/GNUmakefile: Added GSDragView.m. * Source/NSPrintOperation.m: Use correct subclass for PDF operations. 2004-06-02 Riccardo Mottola David Ayers * Source/GSToolbar.m ([GSValidationManager-initWithWindow:): Move variable declarations to the beginning of the block. Format according to standards. 2004-06-01 Gregory John Casamento * configure.ac: added code to detect the presence of libaspell for the new implementation of GSspell. * configure: regenerated. * Tools/GSspell.m: Completely reimplemented the spell-checker code using aspell. This simplified the code tremendously. 2004-05-31 Fred Kiefer * Headers/Additions/GNUstepGUI/GSDrawFunctions.h: * Source/GSDrawFunctions.m: (-drawDarkButton::) New method. Changed all methods to return the interior rectangle. based on patch by Nicolas Roard . * Source/NSComboBoxCell.m: (-_selectCompleted) new method to handle completion of selection in data source case correctly. (-popUpForComboBoxCell:) use this method and also clear selection at the end, so a new popup starts without selection. (-selectItemAtIndex:) simplified and return when invalid index is given. (-_loadButtonCell) always use image name "NSComboArrow" and removed force arrow variable. * Images/nsmapping.strings: mapping "NSComboArrow" to "common_ComboBoxEllipsis". 2004-05-29 Quentin Mathe * Source/NSComboBoxCell.m: Fixed problems related to decoding an encoded combo box previous version (Bug reported by Gregory Casamento). 2004-05-29 Gregory John Casamento * Images/page_landscape.tiff: Removed the tags in the image which were causing warnings on load. * Images/page_portrait.tiff: same. * Images/common_ToolbarClippedItemsMark.tiff 2004-05-29 Quentin Mathe * Source/NSComboBox.m: * Headers/AppKit/NSComboBox.h: * Source/NSComboBoxCell.m: * Headers/AppKit/NSComboBoxCell.h: * Images/GNUmakefile: * Images/common_ComboBoxEllipsis.tiff: New rewritten combo box implementation (which can be called completion box now). Everything should work except the completion possibility which needs some layout manager and text view changes (patches to be commited by Alexander Malmberg). 2004-05-29 Quentin Mathe * Source/NSControl.m: Reverted to the previous version (1.61) because the 2004/05/23 changes changed the way an event can be caught by one responder definitively through the responder chain. * Source/GSToolbar.m: New way to catch mouse events with the validation system (Uses NSWindowDidUpdateNotification instead of events interception at the view level) and other minor changes. 2004-05-27 01:39 Alexander Malmberg * Source/NSImage.m (-size): Don't try to get the size if rep is nil. 2004-05-25 Fred Kiefer * Source/NSTableView.m: (-noteNumberOfRowsChanged) Made save against [_selectedRows lastIndex] returning NSNotFound. 2004-05-23 Quentin Mathe * Source/NSWindow.m: Added a method -_windowView which returns the root view (variable _wv) and replaced _contentView by _wv in the tracking implementation. * Source/NSControl.m: Modified to call the associated superclass method each time -mouseDown: is called to have the possibility to add behaviors to the related NSView method. Modifications needed to fully support toolbar validation mechanism. 2004-05-23 Quentin Mathe * Source/GSToolbarView.m: * Headers/GNUstepGUI/GSToolbarView.h: * Source/GSToolbar.m: * Headers/GNUstepGUI/GSToolbar.h: * Source/NSToolbar.m: * Headers/AppKit/NSToolbar.h: * Source/NSToolbarItem.m: * Headers/AppKit/NSToolbarItem.h: * Source/NSWindow+Toolbar.m: Last part in the validation implementation, border taken in account by the layout process, lot of memory leaks fixed, selected item possibility implemented and other minor improvements. 2004-05-18 Quentin Mathe * Source/GSToolbarView.m: Added color customization (default background color is now no color), part of the toolbar validation mechanism and other minor changes. * Headers/GNUstepGUI/GSToolbarView.h: Same. * Source/NSToolbarItem.m: Added part of the toolbar validation mechanism, new menuFormRepresentation implementation to have the menu item titles used as label with the text display mode and other minor changes. 2004-05-14 Adam Fedor * Source/NSDocumentController.m ([NSDocumentController -currentDirectory]): Conform to the documentation. (Fixes #7900). * Tools/gsnd/gsnd.m: Rename variables starting with _, indent lines properly (Fixes #7502). 2004-05-14 Serg Stoyan * Source/NSBrowser.m ([drawRect:]): use _bounds instead of rect for NSDrawGrayBezel(). * Source/NSSplitView.m ([adjustSubviews]): call setNeedsDisplay: after resizing subviews. 2004-05-04 Enrico Sersale * Source/NSWorkspace.m ([NSWorkspace -mountedRemovableMedia]): Doesn't consider a final empty line in mtab. 2004-05-12 16:50 Alexander Malmberg * Source/NSParagraphStyle.m (+defaultWritingDirectionForLanguage:): Implement. Patch from Christopher Culver. 2004-05-12 15:52 Alexander Malmberg * Source/GSLayoutManager.m (-_generateGlyphsForRun:at:): Use a properly typed function pointer for characterIsMember. 2004-05-08 Fred Kiefer * Header/Cocoa/Cocoa.h: New header file for Cocoa compatibility. Currently not installed. * Source/NSTableView.m: Implemented [selectColumnIndexes:byExtendingSelection:] and [selectRowIndexes:byExtendingSelection:]. * Source/NSDocument.m: Implemented [runModalSavePanelForSaveOperation:..contextInfo:], [saveDocumentWithDelegate:didSaveSelector:contextInfo:] and [saveToFile:..contextInfo:]. Added call to [prepareSavePanel] in [fileNameFromRunningSavePanelForSaveOperation:]. 2004-05-04 Enrico Sersale * Source/NSWindow.m ([NSWindow -sendEvent:]): Doesn't makeKeyAndOrderFront if _windowLevel == NSDesktopWindowLevel. 2004-04-27 Adam Fedor * Source/NSApplication.m ([NSAppIconView -drawRect:]): Draw dot when hidden. ([NSAppIconView -setImage:]): Use -drawRect: (-hide:,-unhideWithoutActivation:): Mark icon view as needing display. (based on patch from Rafael Herzog). 2004-04-27 Quentin mathe * Source/NSToolbarItem.m: Modified to have the action message sent by NSToolbarItem instances (not by GSToolbarButton instances) in order to match the Mac OS X behavior. (Bug reported by Ludovic Marcotte) 2004-04-16 15:33 Alexander Malmberg * Source/NSTableView.m (-dragImageForRows:event:dragImageOffset:): Autorelease the new image. 2004-04-14 00:36 Alexander Malmberg * Source/NSBrowser.m (-keyDown:): When the user selects a cell by typing a partial name, make sure all other cells are deselected. 2004-04-13 Quentin Mathe * Source/NSToolbarItem.m: * Headers/AppKit/NSToolbarItem.h: * Source/NSToolbar.m: * Headers/AppKit/NSToolbar.h: * Source/GSToolbar.m: * Headers/GNUstepGUI/GSToolbar.h: * Source/GSToolbarView.m: * Headers/GNUstepGUI/GSToolbarView.h: * Source/NSWindow+Toolbar.m: * Headers/AppKit/NSWindow+Toolbar.h: Added support for display mode and size mode and other minor changes. 2004-04-09 Kazunobu Kuriyama * Documentation/GuiUser/LanguageSetup.gsdoc: Added Korean stuff. (Thanks to Song Woo-il.) 2004-04-04 Gregory John Casamento * Headers/AppKit.h: Added NSNib.h to the #ifndef STRICT_OPENSTEP section of the headers. 2004-04-02 Quentin Mathe With the help of Fred Kiefer and Alexander Malmberg, the modifications below are mainly introduced to fix the fact -[NSCell performClick:] doesn't work correctly when the cell frame is not identical to the control frame which is displaying it : * Source/NSButton.m: Removed -performClick: method already present in the superclass NSControl. * Headers/AppKit/NSButton.h: Same. * Source/NSButtonCell.m: Replaced -performClick: method by -performClickWithFrame:inView: method which overrides new method with the same name in the superclass NSCell. * Headers/AppKit/NSButtonCell.h: Same * Source/NSCell.m: Added a method -performClickWithFrame:inView: to be used in place of -performClick: method which has been deprecated. * Headers/AppKit/NSCell.h: Same * Source/NSControl.m: Modified -performClick: method to use the new NSCell method -performClickWithFrame:inView:. * Source/NSPopUpButtonCell.m: Modified -performClickWithFrame:inView: to override the new method with the same name in the superclass NSCell. 2004-04-02 Quentin Mathe * Source/NSWindow+Toolbar.h: Moved into Headers/AppKit * Headers/AppKit/AppKit.h: Include NSWindow+Toolbar.h now * Source/GNUMakefile: Modified to reflect this change 2004-03-29 18:25 Alexander Malmberg * Source/NSTextView.m (-setSelectedRange:affinity:stillSelecting:): Always scroll to make the selection visible, and scroll to the right part of it. (Bug reported by Ludovic Marcotte.) 2004-03-27 Fred Kiefer * Header/AppKit/NSTableView.h: Added ivars _selectedColumns and _selectedRows to NSMutableIndexSet. * Source/NSTableView.m: * Source/NSOutlineView.m: Changed all the uses of these ivars and started to restructure the row selection code. Also removed some (not all) dead code. 2004-03-23 23:52 Alexander Malmberg * Headers/Additions/GNUstepGUI/GSToolbar.h, Headers/Additions/GNUstepGUI/GSToolbarView.h: Add missing includes to make the headers selfcontained. 2004-03-23 Quentin Mathe * Source/NSWindow.m: NSToolbar related methods removed. * Headers/AppKit/NSWindow.h: same (NSToolbar related ivars still present). 2004-03-22 18:06 Alexander Malmberg * Source/NSView.m (-lockFocusInRect:): Don't convert the clipping rect to the window's coordinate system; the clip is done in the view's coordinate system. Reported by Georg Fleischmann. (convert_rect_using_matrices): New function that (correctly) converts rectangles between views. (-convertRect:fromView:, -convertRect:toView:): Reimplement using convert_rect_using_matrices. Document. 2004-03-22 02:00 Georg Fleischmann * Source/NSAffineTransform.m (-rotationAngle): Correct the sign of the angle and wrap it so that it's always >=0 and <=360. 2004-03-22 01:13 Alexander Malmberg * Source/NSLayoutManager.m (-textStorage:edited:range:changeInLength:invalidatedRange:): Update layout_char, glyph_delta, and new_last_glyph only if it makes sense to do so and we need the value. Clarify and correct layout_char update. Add comments. 2004-03-14 19:42 Alexander Malmberg * Source/NSView.m (-hitTest:): Don't require that the point is inside our super view if we don't have a super view. 2004-03-14 19:29 Alexander Malmberg * Source/NSTableView.m (-mouseDown:): Send the action for simple clicks even if the selection changed. 2004-03-13 03:19 Alexander Malmberg * Source/NSLayoutManager.m (-textStorage:edited:range:changeInLength:invalidatedRange:): Handle the case where layout_char is inside the modified range explicitly to avoid accidentally causing the value to wrap around. (-drawGlyphsForGlyphRange:atPoint:): Remove dead (since the change 2003-11-01) code. Update comments. 2004-03-12 Quentin Mathe * Source/GSToolbarView.m: Bug fixes related to clipped items and more efficient code. * Headers/Additions/GNUstepGUI/GSToolbarView.h: Minor changes. * Source/NSToolbar.m: Refactored NSToolbar implementation, most part of the code has moved to GSToolbar. * Headers/AppKit/NSToolbar.h: Same. * Source/GSToolbar.m: New class which implements functionnality for the basic GNUstep toolbars with some bug fixes. * Headers/Additions/GNUstepGUI/GSToolbar.h: Header for the new basic GNUstep toolbar class. * Source/NSWindow+Toolbar.m: Bug fixes. * Source/NSWindow+Toolbar.h: Minor changes. 2004-03-12 15:30 Alexander Malmberg * Source/NSTableView.m (-mouseDown:): Send our action if we get a single, simple (no drag) click. 2004-03-08 19:19 Alexander Malmberg * Source/NSPageLayout.m (-readPrintInfo): Move declarations before statements. 2004-03-08 19:04 Alexander Malmberg * Source/NSComboBoxCell.m (-runModalPopUp): Don't make the popup the key window. 2004-03-08 Fred Kiefer * Header/AppKit/NSView.h: Added ivars _is_hidden, _in_live_resize and _focusRingType. * Source/NSView.m: (-canDraw) fully implemented. (-displayIfNeededInRectIgnoringOpacity:, -displayRectIgnoringOpacity:) use canDraw. (-setFocusRingType:, -focusRingType, -needsToDrawRect:, -isHidden, -setHidden:, -inLiveResize, -viewWillStartLiveResize, -viewDidEndLiveResize) implemented. (-canBecomeKeyView) use isHiddenOrHasHiddenAncestor instead of isHidden. 2004-03-07 Adam Fedor * Documentation/Gui/Gui.gsdoc: Use automatic indexing * Source/DocMakefile (AUTOGSDOC_HEADERS_GUI): Add NSNib, NSOpenGL NSOpenGLView. * Source/NSNib.m: Fix doc markup typo. 2004-03-06 Fred Kiefer * Source/NSActionCell.m: Removed methods -setFloatValue:, -setIntValue: and setDoubleValue: 2004-03-06 Fred Kiefer * Header/AppKit/NSSavePanel.h: Added some ivars for new methods. * Source/NSSavePanel.m: (-setDelegate:, -_selectTextInColumn:) implemented delegete calls on selection and directory change, based on patch by Fabien Vallon. Basic implementation for some of the new Cocoa methods. 2004-02-29 Gregory John Casamento * Source/NSToolbar.m: Added code in -[NSToolbar insertItemWithIdentifier:atIndex:] to properly handle when a system defined identifier is passed to the toolbar. 2004-03-01 Fred Kiefer * Header/AppKit/NSTableView.h: * Header/AppKit/NSSavePanel.h: * Source/NSTableView.m: * Source/NSSavePanel.m: Declared some more MacOSX 10.3 methods and added place holders for them. * Source/NSTextView.m: Implemented keyed unarchiving. 2004-02-29 Adam Fedor * Headers/AppKit/NSPageLayout.h: Update tags. * Images/GNUmakefile: Add page_landscape.tiff, page_portrait.tiff. * Panels/English.lproj/GSPageLayout.gorm: Update. * Source/NSPageLayout.m: Internationalize gui text. Update for gorm changes. (Patches from Fabien Vallon). 2004-02-28 Adam Fedor * Version 0.9.2 * Documentation/news.texi: Update. 2004-02-28 Gregory John Casamento * Source/NSToolbarItem.m: Corrected misspelling of Separator. * Images/common_ToolbarSeparatorItem.tiff: added, misspelled image file deleted * Images/GNUmakefile: Corrected. 2004-02-29 Fred Kiefer * Header/AppKit/NSApplication.h: Defined values for the constants NSRunStoppedResponse, NSRunAbortedResponse, NSRunContinuesResponse. * Source/NSOpenPanel.m: (-ok:) * Source/NSSavePanel.m: (-cancel:, -ok:) Use stopModalWithCode: with the approriate button code. * Source/NSSavePanel.m: (-runModalForDirectory:file:, -runModalForDirectory:file:relativeToWindow:) Removed the check for the pressed button and return the value of the model loop directly. * Source/NSBox.m: (-drawRect:) Blank out the title rectangle here and not delegate this to the title cell via the background colour. (-initWithFrame:) Use an NSCell instead of an NSTextFieldCell for the title, as setBackgroundColour: is no longer needed. 2004-02-28 Adam Fedor * configure.ac: Don't add CPPFLAGS to ADDITIONAL_INCLUDES, add ungif and X11 flags to GRAPHIC_... flags. 2004-02-26 Fred Kiefer * Source/NSApplication.m: (-beginSheet:...contextInfo:) Corrected signature of didEnd function. * Source/NSMenu.m: (-update) Tried to handle case for autoenabling correctly where a popup button doesn't have an action. * Source/NSBezierPath.m: (-contributionToContains:) * Source/NSStringDrawing.m: (cache_match()) Replaced random() with rand() to increase portability. 2004-02-24 Quentin Mathé committed by Gregory John Casamento * Headers/Additions/GNUstepGUI/GSToolbarView.h: Changes for new toolbar implementation. * Headers/AppKit/NSToolbar.h: same as above. * Headers/AppKit/NSToolbarItem.h: same... * GNUmakefile: Added new files * Source/NSButtonCell.m: Changes to improve the look of unbordered buttons. * Source/NSToolbar.m: Changes for new toolbar implementation. * Source/NSToolbarItem.m: same... * Source/NSWindow+Toolbar.[hm]: New category to localize changes for NSToolbar which need to reside in NSWindow. * Images/common_ToolbarClippedItemsMark.tiff: ">>" image to show that there are more items which are not being displayed. 2004-02-24 Fred Kiefer * Headers/Additions/GNUstepGUI/GSDrawFunctions.h: Corrected misnaming of method in last change. 2004-02-24 Fred Kiefer * Images/nsmapping.strings: Added definition for NSMenuMixedState. * Source/NSButtonCell.m: (-setButtonType:) * Source/NSMenuItemCell.m: (+initialize) * Source/NSMenuItem.m: (-initWithTitle:action:keyEquivalent:) Use image aliases instead of file names. * Source/GSNibCompatibility.m: Reenabled keyed archiver for NSWindowTemplate and added missing include. 2004-02-20 Fred Kiefer * Headers/AppKit/NSView.h: * Source/NSView.m: (+defaultFocusRingType, -setKeyboardFocusRingNeedsDisplayInRect:, -setFocusRingType:, -focusRingType, -setHidden:, -isHidden, -isHiddenOrHasHiddenAncestor, -wantsDefaultClipping, -needsToDrawRect:, -getRectsBeingDrawn:count:, -inLiveResize, -viewWillStartLiveResize, -viewDidEndLiveResize, -mouseDownCanMoveWindow, -dragPromisedFilesOfTypes:...event:, -canBecomeKeyView) Stubs for new MacOSX methods. 2004-02-17 00:18 Gregory John Casamento * Headers/NSNib.h: Improved documentation. 2004-02-15 20:56 Gregory John Casamento * Source/GSNibCompatibility.m: Removal of keyed archiver code in deprecated template NSWindowTemplate. I commented this out as we need to determine how to implement this with the keyed archiver changes in the new templates. 2004-02-15 Fred Kiefer * Source/NSLayoutManager.m: * Source/NSTextContainer.m: * Source/NSTextStorage.m: * Source/GSNibCompatibility.m: (NSWindowTemplate More keyed dearchiving. * Source/NSView.m: (-initWithCoder:) Don't keyed decode next responder, as this gets set by superview anyway. 2004-02-14 23:05 Gregory John Casamento * Source/NSNib.[hm]: Corrected previous issue with NSNib. Uncommented the code and cleaned up the implementation. 2004-02-14 22:56 Matt Rice Alexander Malmberg * Tools/gopen.m (main): Remove NSTask-based app launching code; always use [NSWorkspace -launchApplication:] to launch applications. 2004-02-14 Fred Kiefer * Source/NSOutlineView.m: (-reloadItem:reloadChildren:) Simplified and corrected code by inlining the method [_findItem:childIndex:ofParent:]. 2004-02-13 Fred Kiefer * Source/NSButtonCel.m: (-setObjectValue:, -objectValue) Implemented to set/return the state. (-mouseEntered:, -mouseExited:, -drawWithFrame:inView:) Partially added old showsBorderOnlyWhileMouseInside patch from Michael Hanni (mhanni@yahoo.com). * Headers/Additions/GNUstepGUI/GSDrawFunctions.h: * Source/GSDrawFunctions.m: New gradient border drawing method. 2004-02-12 Adam Fedor * Documentation/GuiUser/KeyboardSetup.gsdoc: Update. * Source/DocMakefile (GuiUser_AGSDOC_FILES): Add it. 2004-02-12 Fred Kiefer * Source/NSOutlineView.m: (-draggingUpdated:) Applied patch from Andreas Heppel (andreas.heppel@sysgo.com) to determine drag operation correctly. 2004-02-11 Fred Kiefer * Source/NSMatrix.m: (-setBackgroundColor:, -setCellBackgroundColor:, -setDrawsBackground:, -setDrawsCellBackground:) call setNeedsDisplay: to give better feedback on change. 2004-02-11 17:27 Alexander Malmberg * Headers/Additions/GNUstepGUI/GSServicesManager.h, Headers/Additions/GNUstepGUI/GSTitleView.h, Headers/AppKit/NSDrawer.h, Headers/AppKit/NSHelpManager.h, Headers/AppKit/NSMenuItem.h, Headers/AppKit/NSPrintOperation.h, Headers/AppKit/NSSpellProtocol.h, Headers/AppKit/NSTableColumn.h, Headers/AppKit/NSToolbar.h, Headers/AppKit/NSUserInterfaceValidation.h: Add missing forward declarations and includes to make all headers self-contained. 2004-02-11 Fred Kiefer * Source/NSMenuItemCell.m: (-drawBorderAndBackgroundWithFrame:inView:) Let GSDrawFunctions do the border drawing. Removed caching of colour class. * Source/NSImageCell.m: (-drawWithFrame:inView:) Let GSDrawFunctions do the border drawing. 2004-02-10 21:48 Alexander Malmberg * Headers/AppKit/NSFont.h: Add cachedScreenFont ivar. * Source/NSFont.m: Add GSFontMapKey class and use it to find fonts in globalFontMap. Replace newNameWithMatrix function with keyForFont. Update callers. (-initWithName:matrix:fix:screenFont:role:): Initialize cachedScreenFont. (-screenFont): Use cachedScreenFont. 2004-02-09 03:10 Alexander Malmberg * configure.ac: Check for X. Add --enable-ungif/--disable-ungif and --with-ungif-include/--with-ungif-library options. If the check for libungif fails and X was found, check for libungif again, including the X libraries. Patch from Kazunobu Kuriyama. * configure: Regenerate. 2004-02-08 20:56 Gregory John Casamento * Source/GSNibTemplates.m: Backout of NSNib modification. * Source/NSBundleAdditions.m: ditto. * Source/NSNib.m: Commented out some code and private class. 2004-02-09 Fred Kiefer * Source/NSLayoutManager.m (-drawGlyphsForGlyphRange:atPoint:) Replaced explicit colour setting. * Source/NSTabView.m: (-drawRect:) Use color constant instead of number in DPSsetgray(). 2004-02-08 Fred Kiefer * Headers/Additions/GNUstepGUI/GSDrawFunctions.h: Add two more methods. * Source/GSDrawFunctions.m: Evaluate colour names only ones per method. Corrected count in drawFramePhoto: and drawButton:. Added drawGrayBezel: and drawWhiteBezel:. * Source/NSButtonCell.m: (-drawWithFrame:inView:) use GSDrawFunctions to draw border. * Source/NSTabView.m * Source/NSTabViewItem.m * Source/NSBundleAdditions.m (NSNibConnector) Added keyed decoding. 2004-02-08 Fred Kiefer * Source/Function.m Corrected NSDrawWhiteBezel(), NSDrawDarkBezel() and NSDrawLightBezel() to be almost identical to their Cocoa counterparts. * Source/NSMenuItemCell.m * Source/NSPopUpButtonCell.m Corrected keyed decoding. 2004-02-08 01:36 Gregory John Casamento * Source/NSNib.m: Added implmentation for this class. * Headers/AppKit/NSNib.h: Added header for this class. * Source/GSNibTemplates.m: Modified awakeWithContext:topLevelItems: to use the NSNibOwner/NSNibTopLevelObjects entries. * Source/NSBundleAdditions.m: Added code to use NSNib to load and instantiate the .gorm file. NSNib now contains all of the .gorm loading code. NSNib currently does not support .gmodel loading. 2004-02-07 03:53 Alexander Malmberg * Source/NSTableView.m (-initWithCoder:): Remove an erroneous 'else' from the previous change. 2004-02-06 Fred Kiefer * Source/NSMenu.m (-dealloc) Clean up pointer from items to menu. * Source/NSMenuView.m (-update) Removed the setting of the menu for the title view. Patch by Quentin Mathé (gnustep-quentin@club-internet.fr) * Source/NSActionCell.m * Source/NSComboBoxCell.m * Source/NSTableColumn.m * Source/NSTableView.m * Source/NSTextField.m * Source/NSTextFieldCell.m Added keyed decoding. 2004-02-05 21:04 Alexander Malmberg * Source/GSTitleView.m: Fix declarations after statements. 2004-02-05 Fred Kiefer * Source/NSMenu.m * Source/NSMenuItem.m * Source/NSPopUpButtonCell.m Added keyed decoding. 2004-02-04 01:24 Alexander Malmberg * Source/NSView.m: Remove uses of the deprecated "casts as lvalues" gcc extension. 2004-02-03 23:38 Alexander Malmberg * Source/NSBitmapImageRep.m (+imageRepsWithFile:, _initFromWrasterFile:, _wrasterFileTypes): Remove obsolete libwraster image loading hack. Update callers. * Source/NSImageRep.m (+imageRepsWithContentsOfFile:): Remove uses of the removed NSBitmapImageRep methods. 2004-02-02 Fred Kiefer * Source/NSFont.m Try to get at least some font on keyed decoding. * Source/NSTextFieldCell.m * Source/NSImageCell.m * Source/NSImageView.m * Source/NSBox.m * Source/NSSplitView.m Added keyed decoding. 2004-02-01 Fred Kiefer * Source/NSTextFieldCell.m (-setBackgroundColor:, -setDrawsBackground:, setTextColor:) tell the control, that the cell did update. 2004-01-30 Fred Kiefer * Source/NSBrowser.m * Source/NSBrowserCell.m * Source/NSButtonCell.m * Source/NSCell.m * Source/NSClipView.m * Source/NSColor.m * Source/NSControl.m * Source/NSCursor.m * Source/NSFont.m * Source/NSProgressIndicator.m * Source/NSScroller.m * Source/NSScrollView.m * Source/NSView.m Added keyed decoding. 2004-01-26 Adam Fedor * /Headers/Additions/GNUstepGUI/GSHbox.h: Fix doc markup. * Headers/Additions/GNUstepGUI/GSTable.h: Idem. * Source/NSApplication.m: Idem. * Source/DocMakefile (GuiAdditions_AGSDOC_FILES): Add GuiAdditions.gsdoc 2004-01-26 Fred Kiefer * Source/NSPopUpButton.m (-setTitle:) Call [synchronizeTitleAndSelectedItem], this may as well belong into the cells setTitle: method instead. 2004-01-25 Fred Kiefer * Source/NSAffineTransform.m: Exchanged the code of appendTransform: and prePendTransform: to be Cocoa compatibile. (-concatenateWith:) replaced appendTransform: with prependTransform:. * Source/NSPrintOperation.m: (NSView -_displayPageInRect:atPlacement:withInfo:) Item. * Source/NSView.m (+initialize, -_rebuildCoordinates) Item. 2004-01-25 16:16 Alexander Malmberg * Source/NSStringDrawing.m: Big redesign. (cache_match, cache_lookup_string, cache_lookup_attributed_string, use_screen_fonts): New helper functions for caching layout information. (init_string_drawing, [NSAttributedString -drawAtPoint:], [NSAttributedString -drawInRect:], [NSAttributedString -size], [NSString -drawAtPoint:withAttributes:], [NSString -drawInRect:withAttributes:], [NSString -sizeWithAttributes:]): Reimplement using the cache system and the new helper functions. 2004-01-25 Fred Kiefer * Source/NSWindow.m (-orderWindow:relativeTo:): In OrderOut case cancle _handleWindowNeedsDisplay unconditional. (-close): Don't cancle _handleWindowNeedsDisplay as this gets done by the following [orderOut:] call. These changes adopt to a previous change in [_handeWindowNeedsDisplay:] to always resend itself. 2004-01-25 04:15 Alexander Malmberg * Source/NSLayoutManager.m (-invalidateDisplayForCharacterRange:, -textStorage:edited:range:changeInLength:invalidatedRange:): Adjust a few edge cases so that no work is done if there is no existing layout information. 2004-01-24 15:17 Gregory John Casamento * Headers/AppKit/NSDataLink.h: Added ivars. * Source/NSDataLink.m: Added implementation of some methods. 2004-01-23 21:32 Gregory John Casamento * Source/GSNibTemplates.m: Removal of some commented out test code. 2004-01-22 13:15 Alexander Malmberg * Source/NSFontPanel.m (-_initWithoutGModel): Use -setTitle: to set the titles of the buttons, not -setStringValue:. Patch from Matt Rice. 2004-01-22 13:09 Alexander Malmberg * Source/NSButton.m: Rename _nsbuttonCellClass to buttonCellClass and make it static. 2004-01-22 13:06 Alexander Malmberg * Source/NSActionCell.m (-encodeWithCoder:): Encode nil instead of the control view. 2004-01-22 13:04 Alexander Malmberg * Headers/Additions/GNUstepGUI/GSDrawFunctions.h: Add missing include guards. * Source/GSDrawFunctions.m: Correct misspellings and clarify the documentation. 2004-01-22 12:16 Alexander Malmberg * Model/GMAppKit.m ([NSFont +createObjectForModelUnarchiver:]): If there's no font of the decoded name, fall back to the system font of the decoded size. 2004-01-19 Kazunobu Kuriyama * GNUmakefile.postamble (after-distclean): Fix deletion of config.make. 2004-01-18 Adam Fedor * Source/GSDrawFunctions.m: New class. * Source/NSBox.m ([NSBox -drawRect:]): Use it. 2004-01-17 Serg Stoyan * Source/NSBrowser.m: (frameOfColumn:): Adjust horizontal position if browser doesn't have horizontal scroller. (tile): Adjust column height if browser doesn't have horizontal scroller. (drawRect:): Better handling of cases with and without horizontal scroller. 2004-01-16 Fred Kiefer * Headers/AppKit/NSImageView.h: Added ivars for traget and action. * Source/NSImageView.m: Implemented target and action handling and sending of the action when an image gets dropped on the view. Patch by Kazunobu Kuriyama (kazunobu.kuriyama@nifty.com) 2004-01-15 Serg Stoyan * Images/common_MiniWindowTile.m: New file. * Images/common_Tile.m: Updated. * Images/GNUmakefile: Added common_MiniWindowTile.tiff. * Source/NSWindow.m (NSMiniWindowView): (+initialize): Use common_MiniWindowTile.tiff (-drawRect:): Move imageCell down to avoid overlapping with title. (-setTitle:): Do not draw background; common_MiniWindowTile.tiff now has title background. * Source/GSTitleView.[hm]: Added closeButton and miniaturizeButton methods to access title buttons. Added initWithOwner: method. Comments added. Cleanup. (dealloc): Remove observer. Release textAttributes and titleColor. Don't release closeButton and miniaturizeButton. (setOwner:): Observe NSApplication activate/deactivate notifications. Add title buttons according to the window style mask. * Source/NSMenuView.m: (update): Use GSTitleView's initWithOwner: method. Cleanup. 2004-01-13 Serg Stoyan * Source/NSMenuView.m (trackWithEvent:): Changed checking for highlighted item. Old checking have a problems when _highlightedItemIndex changed after performActionForItemAtIndex:, for example when selecting "Close Window" in detached "Windows" submenu. 2004-01-12 Serg Stoyan * Source/GSTitleView.m (setOwner): Recognize class that responds to menuRepresentation method as NSMenu derived class. Fix for Gorm. Use isKindOfClass: instead of class names comparison. * Images/GNUmakefile: Added common_Miniaturize*.tiff to IMAGE_FILES. * Images/common_CloseBroken.tiff: Updated. * Images/common_CloseBrokenH.tiff: Added. * Images/common_WMClose.tiff: Deleted. * Images/common_WMCloseBroken.tiff: Ditto. * Source/NSApplication.m: (setImageForWindowsItem:): Use common_Close and common_CloseBroken images instead of removed common_WMClose and common_WMCloseBroken. 2004-01-11 Fred Kiefer * Source/GSTextStorage.m (_setAttributesFrom): Initialize range in the aRange.length==0 case. (Found by Andrew Ruder using valgrind.) This mirrors the patch to base/GSAttributedString.m. 2004-01-12 Serg Stoyan * Source/GSTitleView.m: (+height): return at least 23 pixels. (-mouseDown:): Make submenu torn off only after mouse released and if menu position changed(so submenu isn't made torn off just clicking on the title). 2004-01-11 Serg Stoyan * Headers/Additions/GNUstepGUI/GSTitleView.h: new file. * Source/GSTitleView.m: ditto. * Images/common_Close.tiff: updated for GSTitleView. * Images/common_CloseH.tiff: ditto. * Images/common_Miniaturize.tiff: new file. * Images/common_MiniaturizeH.tiff: ditto. * Source/NSMenuView.m: modified to use GSTitleView for menu title. NSMenuWindowTitleView class removed. 2004-01-10 18:53 Gregory John Casamento * Source/GSNibTemplates.m: The unarchiver was failing when decoding objects which contain references to themselves (e.g. NSTabView). When an object contains a class/item which refers to it's parent it should receive the new object and not the template. I modified the initWithCoder: method of GSClassSwapper to correct the issue. 2004-01-10 Adam Fedor * orderFront fixes * Source/NSWindow.m (-orderFront:): Remove NSApp isActive check. (-orderFrontRegardless): Update for special case (otherWin=-1) (-orderWindow:relativeTo:): Pass -1 for otherWin to backend if we're the current app. * Source/GSDisplayServer.m: Update documentations. * Source/NSApplication.m (-changeWindowsItem:title:filename:): Revert patch from 2003-10-20. 2004-01-10 16:36 Alexander Malmberg * Source/NSScrollView.m (-drawRect:): Indentation fixes after last patch. 2004-01-09 Serg Stoyan * Source/NSBrowser.m: (drawRect:) Cosmetic changes in drawing of column separators and horizontal scroller border. * Source/NSScrollView.m: (drawRect): Calculate separator line usning scoller frame. Remove header view counting cases. * Source/NSScroller.m: (drawKnobSlot): Always draw background. Even if there's no room for scroller parts. 2004-01-08 23:26 Alexander Malmberg * Source/NSBitmapImageRep+GIF.m: Re-#define Object across the include of gif_lib.h . (Reported by Stefan Kleine Stegemann.) 2004-01-08 19:41 Alexander Malmberg * configure.ac: Add a check for libungif. * configure, Headers/Additions/GNUstepGUI/config.h.in: Regenerate. * Source/GNUmakefile: Add NSBitmapImageRep+GIF.m. * Source/NSBitmapImageRep+GIF.m, Source/NSBitmapImageRep+GIF.h: New files with the GIF image loader. * Source/NSBitmapImageRep.m (+canInitWithData:) Check if the GIF loader can handle the data. (+imageUnfilteredFileTypes): Add ".gif". (+imageRepsWithData:, -initWithData:): Use the GIF loader to load GIF images. 2004-01-08 Fred Kiefer * Source/NSActionCell.m (-initWithCoder:) Don't decode the control view, as this may be a Gorm placeholder or otherwise invalid. * Source/GSDisplayServer.m: (-discardEventsMatchingMask:beforeEvent:), (getEventMatchingMask:beforeDate:inMode:dequeue:) Use function NSEventMaskFromType instead of explicit switch statement where a few entries where missing. 2004-01-08 01:24 Alexander Malmberg * Source/NSActionCell.m (-setObjectValue:): Change the argument type to id from 'NSString *'. 2004-01-08 00:47 Alexander Malmberg * configure.ac: Fail with a verbose error message if libjpeg or libpng can't be found. Add --disable-jpeg/--disable-png options that override this. * configure: Regenerate. * Source/GNUmakefile: Add NSBitmapImageRep+JPEG.m, NSBitmapImageRep+PNG.m, and NSBitmapImageRep+PNM.m . * Source/NSBitmapImageRep.m (+canInitWithData:) Check if one of the new loaders can handle the data. (+imageUnfilteredFileTypes): Include the types from the new loaders. (+imageRepsWithData:, -initWithData:): Use the new loaders to load images. * Source/NSBitmapImageRep+JPEG.m, Source/NSBitmapImageRep+JPEG.h, Source/NSBitmapImageRep+PNG.m, Source/NSBitmapImageRep+PNG.h, Source/NSBitmapImageRep+PNM.m, Source/NSBitmapImageRep+PNM.h: New files with image loaders for JPEG, PNG, and PNM. 2004-01-07 Fred Kiefer * Headers/Additions/GNUstepGUI/GSHbox.h: * Headers/Additions/GNUstepGUI/GSVbox.h: Cleaned up to remove compiler warnings. * Source/NSDataLinkPanel.m: Added include of GSGuiPrivate.h to remove compiler warning. * Source/NSPrintInfo.m: Removed unused global paperSizes. * Source/NSScroller.m: (-trackKnob:) Initialise presentEvent. 2004-01-06 23:39 Gregory John Casamento * Source/NSSpellServer.m: Documentation. * Headers/AppKit/NSSpellServer.h: Documentation. 2004-01-06 21:58 Gregory John Casamento * Source/NSAffineTransform.m: More documentation. 2004-01-07 02:51 Alexander Malmberg * Source/NSSplitView.m (-mouseDown:): Use an NSDebugLLog when we get an event in a subview area instead of an NSLog. 2004-01-04 02:32 Gregory John Casamento * Source/NSApplication.m: Documentation. * Source/NSAffineTransform.m: Documentation. 2004-01-03 23:36 Gregory John Casamento * Source/GSNibTemplates.m: Removed some uneeded includes. 2004-01-03 Ludovic Marcotte * Source/NSOutlineView.m: Started to fix the DnD code. Modified -mouseDown: to not select the row when clicking only on the expand/collapse image. Rewrote -noteNumberOfRowsChanged to correctly restore the list of selected rows after an expand/collapse operation. Also did some general cleanups. More to come on this class. 2004-01-03 19:00 Gregory John Casamento * Source/NSBundleAdditions.m: Removed some uneeded includes. 2004-01-01 23:22 Gregory John Casamento * Source/NSBundleAdditions.m: Moved the declaration of nibitems in loadNibFile:externalNameTable:withZone: so that it can be released if there is an exception. * Source/NSActionCell.m: Documentation. * Source/NSScreen.m: Documentation. 2003-12-31 01:07 Alexander Malmberg * KeyBindings/DefaultKeyBindings.dict: Uncomment the moveUpAndModifySelection: and moveDownAndModifySelection: entries. 2003-12-31 00:37 Alexander Malmberg * Source/NSTextView.m (-setSelectedRange:affinity:stillSelecting:): Make sure oldRange is always initialized. 2003-12-30 Fred Kiefer * Source/NSBundleAdditions.m (-pathForNibResource:) ignore extension "nib", so "gorm" or "gmodel" get used instead. 2003-12-30 Fred Kiefer * Headers/AppKit/NSAffineTransform.h: Corrected element names tX and TY of structure NSAffineTransformStruct to fit Cocoa naming. * Source/NSAffineTransform.m * Source/NSView.m (-_rebuildCoordinates) * Source/NSPrintOperation.m (-_displayPageInRect:atPlacement:withInfo:) Adopted to change of NSAffineTransformStruct elements. * Source/Function.m Implemented NSDrawWindowBackground(), NSDrawDarkBezel() and NSDrawLightBezel(). * Source/NSTableHeaderView.m (-drawRect:) Use NSDrawTiledRects() instead of DPS operations. 2003-12-30 00:48 Gregory John Casamento * Source/NSBundleAdditions.m: Added private class to collect top level items (controllers) which are instantiated in the .gorm file. This and the change to GSNibContainer provide a much cleaner way of retaining the top level items in the .gorm file without requiring a new special entry in the nameTable. * Source/GSNibContainer.[hm]: Renamed method awakeWithContext: to awakeWithContext:topLevelItems: to allow passing in the items collected. Also added code to add the GSNibItems which are in the archive to the instance of the private class which is created. 2003-12-29 20:43 Gregory John Casamento * Source/GSNibTemplates.m: removed extraneous retain in GSClassSwapper which was causing the retain counts of custom classes to be one too many. 2003-12-29 Adam Fedor * Source/NSApplication.m (-activateIgnoringOtherApps:): Change location of _inactive count calculation. * Documentation/gnustep-gui.texi: Move class documentation... * Headers/Additions/GNUstepGUI/GSHbox.h: ...to here. * Headers/Additions/GNUstepGUI/GSTable.h: and here. * Headers/Additions/GNUstepGUI/GSVbox.h: and here. 2003-12-28 19:33 Gregory John Casamento * Headers/AppKit/NSMenuItem.h: Added documentation for many of the methods in NSMenuItem. * Source/GSNibTemplates.m: Further refinements on the earlier memory leak fix. 2003-12-25 00:03 Gregory John Casamento * Source/NSDataLinkPanel.m: Changed to use the correct method to find and load the .gorm file for the panel. 2003-12-23 13:46 Gregory John Casamento * Source/GSNibTemplates.m: Added a loop which retains only the top level objects in the nameTable. Also added some conditions which prevent some of the special entries in the nametable from having awakeFromNib called unnecessarily. Added code which implements the NSTopLevelObjects undocumented feature which allows users to get the top level objects in an array so that they can be easily released. Tightened up memory management. * Source/NSBundleAdditions.m: Removed extra retain which was causing the container to leak. 2003-12-23 18:13 Alexander Malmberg * Source/NSWindow.m (-_handleWindowNeedsDisplay:): Disable flushing while displaying the window and flush after all displaying is done. 2003-12-06 14:03 Alexander Malmberg * Source/NSTextView.m (-readSelectionFromPasteboard:type:, NSTIFFPboardType): Send -setFileWrapper: to the attachment after setting the wrapper's icon to force an update of the attachment's image. Reported by Fabien Vallon. 2003-12-03 02:54 Alexander Malmberg * Source/GNUmakefile.postamble (after-clean): Add a missing ':'. Reported by Matt Rice. 2003-12-02 Adam Fedor * Source/GNUmakefile.postamble (libgnustep-gui.def): Generate at compile time using the proper dependencies. 2003-12-01 Serg Stoyan * Headers/AppKit/NSButton.h: Add setHighlightsBy: and setShowsStateBy: methods. * Source/NSButton.m: Implement setHighlightsBy: and setShowsStateBy: methods * Source/NSPanel.m: Removed TODO about message font size. (-sendEvent:): Cast self when compared with iconWindow to omit compiler warning. (-_initWithoutGModel): Center title vertically relatively to image. Some comments added. Use NSButton's setHighlightsBy for default button of altert panel. (-sizePanelToFit): Center message text horizontally. * Images/common_ret.tiff: Edit to be more NeXTish. * Images/common_retH.tiff: Ditto. 2003-11-29 Fred Kiefer * Source/NSWindow.m (+initialize) cache runloop modes. (-_handleWindowNeedsDisplay:) and (-orderWindow:relativeTo:) use cached modes. 2003-11-29 Fred Kiefer * Source/NSCell.m (-setTitleWithMnemonic:) use [setTitle:] instead of [setStringValue:]. (-mnemonic) use [title] instead of [stringValue]. 2003-11-28 Fred Kiefer * Source/NSBezierPath.m (-bezierPathByReversingPath) return create path not self. (-containsPoint) new implementation, that respects the winding rule. 2003-11-26 23:55 Alexander Malmberg * Source/NSWindow.m (-sendEvent:): Ignore most events sent to windows that have been ordered out. * Source/NSPanel.m (-sendEvent:): Synchronize with [NSWindow -sendEvent:]. 2003-11-26 23:54 Alexander Malmberg * Source/NSView.m (-autoscroll:): Document. 2003-11-26 15:00 Alexander Malmberg * Source/GSGuiPrivate.h: Fix GSGuiBundle() prototype. 2003-11-26 14:47 Alexander Malmberg * Headers/AppKit/NSApplication.h: Add -_windowWillDealloc:. * Source/NSApplication.m: Fix some prototypes. (-_windowWillDealloc:): Implement. * Source/NSWindow.m (-dealloc): Call -_windowWillDealloc: so NSApp can clear any unretained references to the window. 2003-11-25 17:16 Alexander Malmberg * Source/NSWindow.m (-orderWindow:relativeTo:): Start the window auto-display performer when a window is ordered in regardless of whether it needs display right now or not. 2003-11-23 Adam Fedor * Version 0.9.1 2003-11-22 Fred Kiefer * Source/NSBrowser.m (-tile) corrected computation of columnCount, so that at least one column gets diplayed, even when this is smaller than the minColumnwidth. * Source/NSMatrix.m (-drawRect:) corrected clipping of row2, here row1 had been tested. * Source/NSScrollView.m (-drawRect:) removed the saving of the context. 2003-11-22 15:07 Alexander Malmberg * Source/GSNibTemplates.m ([GSNibContainer -awakeWithContext:]): Don't release connections when enumerating them; they're owned by the array. Partial fix for bug #6354. 2003-11-19 21:53 Alexander Malmberg * Source/NSTextView.m (-sizeToFit): If we are horizontally resizable and the inset width is 0, increase our width by 1. 2003-11-19 17:06 Alexander Malmberg * Tools/GNUmakefile, Tools/example.m, Tools/exampleInfo.plist, Tools/md5Digest.m: Move example.service and md5Digest.app to usr-apps/examples/gui/ExampleService/. 2003-11-19 Adam Fedor * Window Focus fixes. * Source/NSApplication.m (-activateIgnoringOtherApps:): Make hidden_key key only if we have no key, make main key if neither, make menu key as last resort. (-deactivate): Resign main window. (Patches from Benhur Stein ). (-unhideWithoutActivation): Set hidden=no before ordering windows to avoid possible recursive loops. * Source/NSWindow.m (-sendEvent:)(NSLeftMouseDown): Activate app after ordering window front. (-sendEvent:)(GSAppKitWindowFocusIn): Don't make ourselves key if we're not the modal window. Remove check for app isHidden. 2003-11-19 03:17 Alexander Malmberg * Source/NSClipView.m (-autoscroll:): Reimplement correctly. * Source/NSTextView.m (-mouseDown:): When the mouse is outside the view, autoscroll smoothly using periodic events. 2003-11-18 21:43 Alexander Malmberg * Source/NSEvent.m (-description): Remove a stray , that was messing up a +stringWithFormat: call. Make eventTypes static. 2003-11-11 14:41 Gregory John Casamento * Source/NSApplication.m: (-targetForAction:): Added code to check the document of the main window as well. * NSToolbar.m: Additional implementation. * NSWindow.[hm]: Added some code for drawing the toolbar. * GSToolbarView.h: added initWithToolbar: method. 2003-11-07 15:28 Alexander Malmberg * Source/NSControl.m (-mouseDown:): Rewrite to use -setHighlighted: and the normal drawing mechanisms instead of trying to draw and flush manually. (Fixes a bunch of visual glitches.) 2003-11-07 14:42 Alexander Malmberg * Source/NSInputManager.m (-loadBindingsFromFile:): Handle errors directly instead of using (broken) exception code. 2003-11-01 18:19 Alexander Malmberg * Source/NSLayoutManager.m (-drawGlyphsForGlyphRange:atPoint:): If a range of glyphs has no color set, use the default text color (as returned by [NSColor textColor]) instead of assuming black. 2003-10-30 00:38 Alexander Malmberg * Source/NSImage.m (iterate_reps_for_types, repd_for_rep): Make static. * Source/NSStepperCell.m (DrawUpButton, DrawDownButton, HighlightUpButton, HighlightDownButton): Idem. * Source/NSPrintInfo.m: Make the "class variables" static. * Source/NSProgressIndicator.m: Idem. 2003-10-29 Bjorn Giesler * Source/externs.m: New MacOS 10.3 pasteboard types * Headers/AppKit/NSPasteboard.h: New MacOS 10.3 pasteboard types 2003-10-29 Richard Frith-Macdonald * Source/GSDisplayServer.m: ([-dealloc]) remove deallocated server from windowsmap to avoid segfault on app shuytdown ... fix suggested by benhur@inf.ufsm.br 2003-10-29 02:22 Alexander Malmberg * Source/GSServicesManager.m (-updateServicesMenu): Always enable an item with a submenu. 2003-10-28 Richard Frith-Macdonald * Source/NSSavePanel.m: Change to have entire window accept DnD. * Source/NSWindow.m: Fix to get whole window DnD working, also to enable propogation of drag events up the view hierarchy to the first drag-aware view ... Adam reports that this seems to be the behavior on MacOS-X too. 2003-10-28 Richard Frith-Macdonald * Source/NSOpenPanel.m: Allow users to type in an absolute path name. Support DnD of filename into panel. * Source/NSSavePanel.m: ditto. Also, if the name of a non-existent directory is typed in, provide a prompt to create the directory as in NeXTstep/OPENSTEP. 2003-10-27 Richard Frith-Macdonald * Source/GSServicesManager.m: Tidy last patch to match use of whitespace etc in GNUstep code. * Source/GSDisplayManager.m: (-getEventMatchingMask:beforeDate:inMode:dequeue:) fix incorrect termination ... should terminate when limit date has passed, irrespective of the state of any input sources. * Source/NSApplication.m: ([-runModalForWindow:]) wait for new events between calls to ([-runModalSession:]) ([-runModalSession:]) rewritten to handle multiple events, but only those events which are available ... ie don't wait for more. Requires latest base library from CVS to get modified/corrected runloop behavior. 2003-10-26 15:18 Alexander Malmberg Matt Rice * Source/NSFontManager.m (-availableFonts, -availableFontFamilies, availableMembersOfFontFamily:): Don't check delegate; always return all fonts. (-_includeFont:): Move... * Source/NSFontPanel.m (_includeFont:delegate:): Here. (-_familySelectionChanged:, reloadDefaultFontFamilies): Use that method to check with the delegate which fonts should be included in the font panel. (-_doPreview, -_fontForSelection:): Check that the face list isn't empty before accessing it. (-_getOriginalSize): Move to the Private category to match the @interface. 2003-10-25 16:52 Gregory John Casamento * Source/GSNibTemplates.m: initWithFrame is not supposed to be called on subclasses of NSControl as the designated initializer according to docs. Removed the call. * Source/GSNibCompatibility.[hm]: Added in the old templates for compatibility ONLY. This is so any of the older .gorms which use these templates can be loaded and used normally. * Source/NSOutlineView.m: Corrected a documentation issue. 2003-10-25 12:53 Matt Rice * Source/NSWorkspace.m (-_connectApplication:): Ignore the path to the application when extracting the port name. (Committed by Alexander Malmberg.) 2003-10-24 Richard Frith-Macdonald * Source/NSWorkspace.m: Change a few uses of '/' in strings to use stringByAppendingPatchComponent: * Tools/gopen.m: Fix to pass the full path of the file to the app being used to open it, so relative paths in the arguments work properly. 2003-10-21 Bjorn Giesler * Source/GSServicesManager.m: Fix NSPerformService() to work for any localised service name. 2003-10-21 Richard Frith-Macdonald * Source/GSServicesManager.m: Revert last modification in favour of a fix by ... Bjorn. 2003-10-20 Adam Fedor * Source/NSApplication.m (-changeWindowsItem:title:filename:): Use deminiaturize to get the window back. * Source/NSWindow.m (-deminiaturize:): Don't order out the miniwindow since it should be ordered out automatically. Fixes PR #5849. 2003-10-18 16:48 Gregory John Casamento * Source/NSOutlineView.m: Added full gsdoc documentation for this class. 2003-10-17 Richard Frith-Macdonald * Source/GSServicesManager.m: Make mapping of service names to their definitions include all available language variants so that NSPerformService() should work irrespective of the currently selected language preferences. Tested to ensure it still works for my selected english, but not yet to see if it actually fixes the bug. 2003-10-13 Adam Fedor * configure.ac: Simplify graphics libs lookup * config.make.in: Update. * Documentation/make_services.1: New file (from Martin Brecher) * Documentation/GNUmakefile: Install it. 2003-10-09 Adam Fedor * Tools/make_services.m: Add quiet option. 2003-10-07 23:38 Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibTemplates.m: Added setDeferFlag: and deferFlag declarations to GSWindowTemplate. 2003-10-07 14:32 Alexander Malmberg * Source/NSWindow.m (-miniaturize:): Check that the window is miniaturizable, visible, and not already miniaturized before trying to miniaturize it. (-deminiaturize:): Do nothing if the window isn't miniaturized. (Based on patch from Matt Rice.) 2003-10-05 Adam Fedor * Source/DocMakefile: Remove dependencies file when cleaning. 2003-10-03 Adam Fedor * configure.ac: Use -Wl for netbsd linker options. 2003-10-03 Benhur Stein * Source/NSWindow.m (-setFrameAutosaveName:): remove previous frame name from defaults; if there is a saved frame with the new name in defaults, set window frame to it, otherwise store current frame in defaults. 2003-10-03 Benhur Stein * Source/NSWindow.m (class variables, +initialize, +removeFrameUsingName:, -dealloc, -saveFrameUsingName:, -setFrameAutosaveName:): removed variable windowsLock 2003-10-02 David Ayers * Source/NSBrowser.m (-[NSBrowser setDelegate]): Set _passiveDelegate to YES for 'nil' delegate. Use GSObjCRuntime functions to get selector names. Update documentation. 2003-10-02 Andrew Ruder * Source/NSBrowser.m (-[NSBrowser setDelegate]): Check for nil object to allow unsetting the delegate. 2003-09-29 Adam Fedor * Version 0.9.0 2003-09-29 Fred Kiefer * Headers/Additions/GNUstepGUI/GSLayoutManager.h * Source/GSLayoutManager.m Added missing method [isValidGlyphIndex:]. 2003-09-29 Fred Kiefer * Source/NSBrowser.m Patch by Christopher Culver: Define empty [sizeToFit] method to override NSControl implementation. 2003-09-27 19:29 Gregory John Casamento * Source/GSNibContainer.m: [GSNibContainer awakeWithContext:] Added code to set the services and windows menus as designated in Gorm. Addresses Report #5205 2003-09-27 David Ayers * Source/NSCell.m (-compare:): Compare the stringValue of NSCell's rather than their contents directly. 2003-09-23 19:14 Alexander Malmberg * Source/NSWindow.m (-orderWindow:relativeTo:): Only force a display of the content view if we're being ordered _to_ the screen. 2003-09-23 19:11 Alexander Malmberg * Source/NSTextContainer.m (-dealloc): Set the text container of our text view, if any, to nil. 2003-09-22 Adam Fedor * Source/NSWindowController.m (-setWindow:): Set window's releaseWhenClosed when document is not nil. Add documentation. 2003-09-21 Fred Kiefer * Source/NSPopUpButtonCell.m Undid the tracking of changes for the menu item. Changed [dealloc] to not call clean up methods as these caused segmentation faults in GNUMail. 2003-09-21 15:15 Alexander Malmberg * Source/NSTextView.m (-readSelectionFromPasteboard:type:): Handle NSTIFFPboardType. Based on patch from Nicolas Roard. 2003-09-20 Adam Fedor * Source/NSWindowController.m ([NSWindowController -setDocument:]): Set window to releaseWhenClosed if document is not nil. * Source/NSApplication.m ([NSApplication -targetForAction:]): Revert last change. * Source/NSWindow.m ([NSWindow -performClose:]): Idem. 2003-09-19 Matt Rice * Source/NSApplication.m ([NSApplication -targetForAction:]): Check document of a document-based app before key window. * Source/NSWindow.m ([NSWindow -performClose:]): Close the document not self if there is a document associated with this window. 2003-09-19 Adam Fedor * Headers/Additions/GNUstepGUI/GSMethodTable.h: Change NSReadPixel to GSReadRect * Headers/AppKit/NSGraphicsContext.h, Source/NSGraphicsContext.m: Idem. * Headers/AppKit/NSGraphics.h (NSReadPixel): Move to... * Source/Functions.m (NSReadPixel): here. * Source/NSBitmapImageRep.m (-initWithFocusedViewRect:): Implement. 2003-09-16 Adam Fedor * GNUmakefile (SUBPROJECTS): Don't build Documentation by default. 2003-09-14 Fred Kiefer * Source/NSPopUpButtonCell.m Corrected bug in previous change. In [itemAtIndex:] the index 0 was handled wrong. 2003-09-14 Fred Kiefer * Source/NSPopUpButtonCell.m According to Gregory John Casamento the popup button does not change its enable state when the selected item does. To adopt this behaviour all setEnable: calls have been removed and one in [initWithCoder:] added that enables the popup for all old encodings. 2003-09-13 Gregory John Casamento * Source/NSPopUpButtonCell.m: Corrected minor problem which was causing a compilation error. 2003-09-13 Fred Kiefer * Source/NSMenu.m In [update] use [NSApplication targetForAction:to:from:] to be consistent with the [performActionForItemAtIndex:] implementation. * Source/NSPopUpButtonCell.m Undid last change. Rewrote [setMenu:] to make the popup button cell listen to change notifications of the menu. New method [itemChanged:] gets called when a menu item changes. Added hack to [initWithCoder:] to set menu correctly and read old menu items correctly. Check in [itemAtIndex:] that the index is vaild and return nil otherwise. 2003-09-07 Adam Fedor * Source/NSBitmapImageRep.m: Document. (+imageRepWithData:): Return empty array not nil on failure. (-TIFFRepresentation): Check for unsupported compression types. (-TIFFRepresentationUsingCompression:factor:): Idem. * Source/tiff.m (NSTiffGetInfo, NSTiffRead, NSTiffWrite): Better error checking. * Source/NSTableView.m (-draggingUpdated:sender): Support NSTableViewDropOn (patch from Björn Giesler ). 2003-09-06 Gregory John Casamento * Source/NSPopUpButtonCell.m: -drawInteriorWithFrame:inView: added setEnabled to enable the popup button cell. A previous change was causing all popup button cells to show up as disabled. 2003-09-06 22:53 Alexander Malmberg * Source/NSFont.m (getNSFont): Set the explicit-size bit in the role correctly. 2003-09-06 Gregory John Casamento * Images/common_Printer.tiff * Images/common_ToolbarSeperatorItem.tiff * Images/common_ToolbarShowColorsItem.tiff * Images/common_ToolbarShowFontsItem.tiff * Images/common_ToolbarSpaceItem.tiff * Source/NSToolbarItem.m: set the correct images and target/action information for all of the standard toolbar items. 2003-09-06 Fred Kiefer * Source/NSMenuItem.m Autorelease the [separatorItem]. 2003-09-06 Fred Kiefer * Source/NSMenuView.m In [itemChanged:] set if the cell is enabled like the item. * Source/NSMenuItemCell.m [setMenuItem:] enable/disable cell. [drawTitleWithFrame:inView:]no longer enable/disable cell. 2003-09-04 18:43 Alexander Malmberg * Headers/AppKit/NSWindow.h, Source/NSWindow.m: Change the return type of -initWithWindowRef: to id. 2003-09-02 Adam Fedor * Tools/gsnd/gsnd.m (main): Don't mess with file descriptors on MinGW. 2003-09-02 Adam Fedor * Source/libgnustep-gui.def: Update. 2003-09-01 Fred Kiefer * Source/NSAttributedString.m [readFromURL:options:documentAttributes:] corrected the handling to type "text", where [NSString alloc] was missing. * Source/NSBundleAdditions.m Removed unused global currentVersion. * Headers/AppKit/NSCell.h Corrected type of method _nonAutoreleasedTypingAttributes * Headers/AppKit/NSInputManager.h Added protocol NSTextInput to ivar _currentClient. * Headers/AppKit/NSTextFieldCell.h Removed uneeded and inconsistent method declarations. * Source/NSApplciation.m * Source/NSBezierPath.m * Source/NSClipView.m * Source/NSDocumentController.m * Source/NSInputManager.m * Source/NSMenuItem.m * Source/NSSavePanel.m * Source/NSTableView.m Removed new GCC 3.4 warnings from Alexander Malmbergs list. 2003-09-01 Fred Kiefer * Source/NSBitmapImageRep.m [canInitWithData:], [imageRepsWithData:] and [initWithData:] protect against data being nil. [imageRepsWithFile:] check if the file exists and only return an array when it contains objects. * Source/NSWorkspace.m New method [_saveImageFor:] used in all places in this file where an icon is created from a file name. New method [thumbnailForFile:] calculated the name of the corresponding FreeDeskTop.org thumbnail file for a given file name. This does not chack if this file exists!. In [iconForFile:] use this thumbnails if the user default GSUseFreedesktopThumbnails is YES. * Documentation/GuiUser/DefaultsSummary.gsdoc Documented the new user default value GSUseFreedesktopThumbnails. 2003-09-01 Gregory John Casamento * Source/GSNibTemplates.m: [GSNibContainer awakeWithContext:] was initializing mainMenu too late. It should be accessible from within awakeFromNib. 2003-08-31 Gregory John Casamento * Source/NSToolbarItem.m: Corrected code to instantiate button for toolbar items. 2003-08-30 Gregory John Casamento * Source/GSNibTemplates.m: [GSNibContainer awakeWithContext:] was not releasing the connections in the array after calling establishConnection. Once this is done, the connections are no longer needed. 2003-08-30 Fred Kiefer * Source/NSWindowController.m Changed [setWindow:] to manage the notification connection to the window. [initWithWindow:], [dealloc] and [_windowWillClose:] now use [setWindow:]. [setDocument:] now no longer retains the document, as this is already retaining the window controller. Simplified [loadWindow] by using the method [windowNibPath]. 2003-08-30 Gregory John Casamento * Source/GSNibTemplates.m: Added code to templates to conditionally call the designated initializer if and only if it is defined on the class which is being unarchived, not the parent classes. This is consistent with behaviour under OpenStep. 2003-08-29 Adam Fedor * Source/GNUmakefile.preamble (ADDITIONAL_OBJCFLAGS): Include target dir for config.h (disable-flattened). 2003-08-29 Adam Fedor * Tools/gsnd/gsnd.m (main): Reopen stderr. 2003-08-29 Gregory John Casamento * NSToolbarItem.[hm]: Implemented copyWithZone: for NSCopying, removed an unused flag and shortened the flag names which were somewhat long. Did some general cleanup. Implemented standard items. 2003-08-28 Gregory John Casamento * Source/GSNibTemplates.m: Removed an extra release which was causing a segfault. Added code to prevent calling the designated initializer when isInterfaceBuilder is defined. 2003-08-27 Adam Fedor * Tools/gsnd/gsnd.m (main): Set daemon flag when forking. 2003-08-26 Adam Fedor * Version 0.8.9 2003-08-23 Gregory John Casamento * GSNibTemplates.m: Minor corrections and bugfixes. 2003-08-23 Gregory John Casamento * Source/GNUmakefile: Added new header to the list. * Source/GSNibTemplates.m: Added assertion to GSClassSwapper to prevent it from being initialized with superClassName and className being the same. * Source/NSToolbar.m: Added some more code to properly implement this class. * Source/NSToolbarItem.m: Added code to implement this class. * Headers/AppKit/NSToolbar.h: Added flags declaration. * Headers/AppKit/NSToolbarItem.h: Added attributes. * Headers/Additions/GNUStepGUI/GSToolbarView.h: Private class which will be used to display the toolbar in the window. 2003-08-22 Adam Fedor * Tools/gsnd/gsnd.m (main): Close any open file descriptors so we can be a proper daemon. Fixes #4825 2003-08-22 Gregory John Casamento * Source/GSNibTemplates.[hm]: Added new template classes to a new file removed old templates and implemented GSClassSwapper, GSWindowTemplate, GSViewTemplate and etc.. to act as stand-in object in the interface builder application. * NSBundleAdditions.m: Removed old template classes and moved some of the hiddle classes to GSNibTemplates for better organization. 2003-08-20 Fred Kiefer * Source/NSWindow.m In [performClose:] call the method [shouldCloseWindowController:] on the document instead of [windowShouldClose:] 2003-08-20 Fred Kiefer * Source/NSMenuView.m In [itemChanged:] call [setNeedsDisplayForItemAtIndex:] so that changes get redisplayed. * Source/NSPopUpButtonCell.m Overall change to use method calls rather than direct ivar access. [setMenu:] also call [setMenuView:]. [removeItemWithTitle], [removeItemAtIndex] and [removeAllItems] make sure that the selected item ivar gets unset, when this is removed. [setMenuItem:] overwrite super method to set/unset the image. [selectItem:] no longer changes the image of this item. [synchronizeTitleAndSelectedItem] now works on the menu item not the selected item. [attachPopUpWithFrame:inView:] added listening for notifications. [dismissPopUp] remove listening for notifications. Added [performClickWithFrame:inView:] and [performClick:]. Further simplified [drawInteriorWithFrame:inView:]. [initWithCoder:] made sure that old stored objects still get read in correctly even if most ivars may be set wrong. * Source/NSPopUpButton.m In [keyDown:] removed setting and unsetting of notification listening, as this now gets handled in NSPopUpButtonCell. 2003-08-20 14:36 Alexander Malmberg * Source/GSFontInfo.m (+sharedEnumerator, +fontInfoForFontName:matrix:screenFont:): Assert that the backend classes have been set. * Source/NSBrowser.m (+initialize, -initWithFrame:): Don't create the shared title cell in +initialize. Creating the cell requires that the backend has been set up (by creating the shared application object). We can't assume that this has been done before +initialize is called. * Source/NSTextView.m (+initialize, -initWithFrame:textContainer:): Don't register for services in +initialize for the same reason: the shared application object might not have been created yet (also, note that calling +sharedApplication is unsafe; it will create a shared application object, but in some cases of the wrong class, which would lead to confusing errors later). 2003-08-20 14:08 Alexander Malmberg Clean up code to remove warnings issued by (what will become) gcc 3.4. * Model/GMArchiver.m, Source/GSFusedSilica.m, Source/GSFusedSilicaContext.m, Source/NSResponder.m: Don't return values from methods returning void. 2003-08-19 Adam Fedor * Source/NSImageRep.m ([NSImageRep +imageRepsWithContentsOfFile:]): Make sure extension is lowercase. Fixes #4750. 2003-08-18 Adam Fedor * Model/GNUmakefile (ADDITIONAL_INCLUDE_DIRS): Don't include ../Headers on non-gnu targets. 2003-08-17 Adam Fedor * Source/NSTableView.m ([NSTableView -textDidBeginEditing:]): Fix leak of dictionary object. ([NSTableView -textDidChange:]): Idem. ([NSTableView -textDidEndEditing:]): Idem. Fixes #4568. 2003-08-17 Adam Fedor * Source/NSImageCell.m ([NSImageCell -setObjectValue:]): Implement. 2003-08-17 Benhur Stein * NSBrowser.m: (-selectRow:inColumn:): cleanup (-loadedCellAtRow:column:): cleanup (-matrixInColumn:): return nil if column not in _browserColumns (-setPath:): cleanup; fix optimization for not loading columns that are already loaded (-setLastColumn:): return if column is not loaded; remove unnecessary call to setNeedsDisplay:; remove columns greater than _lastVisibleColumn instead of numberOfVisibleColumns; call scrollColumnToVisible instead of making it by hand. (-reloadColumn:): reselect previously selected cells by searching them in reloaded matrix, instead of by position (-scrollColumnToVisible:): removed test that assumed that if numberOfVisibleColums is enough to display all loaded columns, they are all displayed. This is not always the case now. (-tile): hack to garantee that all visible columns exist. Should fix the code that's before instead. (-doClick:): cleanup; removed drawing of matrix's cells (-moveLeft:): cleanup; move left from firstResponder instead of from selectedColumn (-moveRight:): cleanup; move right from firstResponder instead of from selectedColumn; removed call to doClick: (-_performLoadOfColumn:): change _lastColumnLoaded if necessary 2003-08-16 Matt Rice * Source/NSDocument.m ([NSDocument -init]): Check the count of the types array and uses Viewer and Editor NSRoles to set the default type. 2003-08-13 David Ayers * Headers/gnustep/gui/*.h/*.h.in: Remove headers moved in header reorganization on 2003-07-31. * Headers/Additions/GNUstepGUI/GSVersion.h: Remove generated file that should have been ignored by entry in .cvsignore. 2003-08-05 Martin Brecher * Documentation/gopen.1: New file. * Documentation/GNUmakefile: Install it. 2003-08-10 23:27 Alexander Malmberg * Headers/Additions/GNUstepGUI/GSFontInfo.h: Add new methods in GSFontEnumerator that return the default names of some standard fonts. * Source/GSFontInfo.m: Implement them. * Source/NSFont.m: Use them. 2003-08-07 Richard Frith-Macdonald * Documentation/GNUmakefile.postamble: Invoke Source/DocMakefile to clean reference documentation. 2003-08-02 Ludovic Marcotte * Modified NSPopUpButtonCell: -insertItemWithTitle: atIndex: so that we get our item count after removing a potential duplicated item value. 2003-08-01 Adam Fedor * Documentation/GNUmakefile.postamble (after-install): Install gsdoc docs in proper places. * Source/DocMakefile: Add GuiUser DOCUMENT * Images/GNUmakefile: Remove obsolete files. 2003-07-31 David Ayers * Created tag 'pre-header-reorg-20030731'. * Headers/Additions/GNUstepGUI: New directory. * Headers/AppKit: Ditto. * Headers/gnustep/gui: Obsoleted. * Headers/Additions/GNUstepGUI/GMAppKit.h: Moved here from Headers/gnustep/gui. * Headers/Additions/GNUstepGUI/GMArchiver.h: Ditto. * Headers/Additions/GNUstepGUI/GSDisplayServer.h: Ditto. * Headers/Additions/GNUstepGUI/GSFontInfo.h: Ditto. * Headers/Additions/GNUstepGUI/GSFusedSilica.h: Ditto. * Headers/Additions/GNUstepGUI/GSHbox.h: Ditto. * Headers/Additions/GNUstepGUI/GSHelpManagerPanel.h: Ditto. * Headers/Additions/GNUstepGUI/GSHorizontalTypesetter.h: Ditto. * Headers/Additions/GNUstepGUI/GSInfoPanel.h: Ditto. * Headers/Additions/GNUstepGUI/GSLayoutManager.h: Ditto. * Headers/Additions/GNUstepGUI/GSLayoutManager_internal.h: Ditto. * Headers/Additions/GNUstepGUI/GSMemoryPanel.h: Ditto. * Headers/Additions/GNUstepGUI/GSMethodTable.h: Ditto. * Headers/Additions/GNUstepGUI/GSNibTemplates.h: Ditto. * Headers/Additions/GNUstepGUI/GSPasteboardServer.h: Ditto. * Headers/Additions/GNUstepGUI/GSServicesManager.h: Ditto. * Headers/Additions/GNUstepGUI/GSTable.h: Ditto. * Headers/Additions/GNUstepGUI/GSTextConverter.h: Ditto. * Headers/Additions/GNUstepGUI/GSTrackingRect.h: Ditto. * Headers/Additions/GNUstepGUI/GSTypesetter.h: Ditto. * Headers/Additions/GNUstepGUI/GSVbox.h: Ditto. * Headers/Additions/GNUstepGUI/GSVersion.h: Ditto. * Headers/Additions/GNUstepGUI/GSVersion.h.in: Ditto. * Headers/Additions/GNUstepGUI/IMConnectors.h: Ditto. * Headers/Additions/GNUstepGUI/IMCustomObject.h: Ditto. * Headers/Additions/GNUstepGUI/IMLoading.h: Ditto. * Headers/Additions/GNUstepGUI/.cvsignore: Ditto. * Headers/AppKit/AppKit.h: Ditto. * Headers/AppKit/AppKitDefines.h: Ditto. * Headers/AppKit/AppKitExceptions.h: Ditto. * Headers/AppKit/DPSOperators.h: Ditto. * Headers/AppKit/NSActionCell.h: Ditto. * Headers/AppKit/NSAffineTransform.h: Ditto. * Headers/AppKit/NSApplication.h: Ditto. * Headers/AppKit/NSAttributedString.h: Ditto. * Headers/AppKit/NSBezierPath.h: Ditto. * Headers/AppKit/NSBitmapImageRep.h: Ditto. * Headers/AppKit/NSBox.h: Ditto. * Headers/AppKit/NSBrowser.h: Ditto. * Headers/AppKit/NSBrowserCell.h: Ditto. * Headers/AppKit/NSButton.h: Ditto. * Headers/AppKit/NSButtonCell.h: Ditto. * Headers/AppKit/NSCachedImageRep.h: Ditto. * Headers/AppKit/NSCell.h: Ditto. * Headers/AppKit/NSClipView.h: Ditto. * Headers/AppKit/NSColor.h: Ditto. * Headers/AppKit/NSColorList.h: Ditto. * Headers/AppKit/NSColorPanel.h: Ditto. * Headers/AppKit/NSColorPicker.h: Ditto. * Headers/AppKit/NSColorPicking.h: Ditto. * Headers/AppKit/NSColorWell.h: Ditto. * Headers/AppKit/NSComboBox.h: Ditto. * Headers/AppKit/NSComboBoxCell.h: Ditto. * Headers/AppKit/NSControl.h: Ditto. * Headers/AppKit/NSCursor.h: Ditto. * Headers/AppKit/NSCustomImageRep.h: Ditto. * Headers/AppKit/NSDataLink.h: Ditto. * Headers/AppKit/NSDataLinkManager.h: Ditto. * Headers/AppKit/NSDataLinkPanel.h: Ditto. * Headers/AppKit/NSDocument.h: Ditto. * Headers/AppKit/NSDocumentController.h: Ditto. * Headers/AppKit/NSDocumentFrameworkPrivate.h: Ditto. * Headers/AppKit/NSDragging.h: Ditto. * Headers/AppKit/NSDrawer.h: Ditto. * Headers/AppKit/NSEPSImageRep.h: Ditto. * Headers/AppKit/NSEvent.h: Ditto. * Headers/AppKit/NSFileWrapper.h: Ditto. * Headers/AppKit/NSFont.h: Ditto. * Headers/AppKit/NSFontManager.h: Ditto. * Headers/AppKit/NSFontPanel.h: Ditto. * Headers/AppKit/NSForm.h: Ditto. * Headers/AppKit/NSFormCell.h: Ditto. * Headers/AppKit/NSGraphics.h: Ditto. * Headers/AppKit/NSGraphicsContext.h: Ditto. * Headers/AppKit/NSHelpManager.h: Ditto. * Headers/AppKit/NSHelpPanel.h: Ditto. * Headers/AppKit/NSImage.h: Ditto. * Headers/AppKit/NSImageCell.h: Ditto. * Headers/AppKit/NSImageRep.h: Ditto. * Headers/AppKit/NSImageView.h: Ditto. * Headers/AppKit/NSInputManager.h: Ditto. * Headers/AppKit/NSInputServer.h: Ditto. * Headers/AppKit/NSInterfaceStyle.h: Ditto. * Headers/AppKit/NSLayoutManager.h: Ditto. * Headers/AppKit/NSMatrix.h: Ditto. * Headers/AppKit/NSMenu.h: Ditto. * Headers/AppKit/NSMenuItem.h: Ditto. * Headers/AppKit/NSMenuItemCell.h: Ditto. * Headers/AppKit/NSMenuView.h: Ditto. * Headers/AppKit/NSNibConnector.h: Ditto. * Headers/AppKit/NSNibDeclarations.h: Ditto. * Headers/AppKit/NSNibLoading.h: Ditto. * Headers/AppKit/NSOpenGL.h: Ditto. * Headers/AppKit/NSOpenGLView.h: Ditto. * Headers/AppKit/NSOpenPanel.h: Ditto. * Headers/AppKit/NSOutlineView.h: Ditto. * Headers/AppKit/NSPageLayout.h: Ditto. * Headers/AppKit/NSPanel.h: Ditto. * Headers/AppKit/NSParagraphStyle.h: Ditto. * Headers/AppKit/NSPasteboard.h: Ditto. * Headers/AppKit/NSPopUpButton.h: Ditto. * Headers/AppKit/NSPopUpButtonCell.h: Ditto. * Headers/AppKit/NSPrintInfo.h: Ditto. * Headers/AppKit/NSPrintOperation.h: Ditto. * Headers/AppKit/NSPrintPanel.h: Ditto. * Headers/AppKit/NSPrinter.h: Ditto. * Headers/AppKit/NSProgressIndicator.h: Ditto. * Headers/AppKit/NSResponder.h: Ditto. * Headers/AppKit/NSRulerMarker.h: Ditto. * Headers/AppKit/NSRulerView.h: Ditto. * Headers/AppKit/NSSavePanel.h: Ditto. * Headers/AppKit/NSScreen.h: Ditto. * Headers/AppKit/NSScrollView.h: Ditto. * Headers/AppKit/NSScroller.h: Ditto. * Headers/AppKit/NSSecureTextField.h: Ditto. * Headers/AppKit/NSSelection.h: Ditto. * Headers/AppKit/NSSlider.h: Ditto. * Headers/AppKit/NSSliderCell.h: Ditto. * Headers/AppKit/NSSound.h: Ditto. * Headers/AppKit/NSSpellChecker.h: Ditto. * Headers/AppKit/NSSpellProtocol.h: Ditto. * Headers/AppKit/NSSpellServer.h: Ditto. * Headers/AppKit/NSSplitView.h: Ditto. * Headers/AppKit/NSStepper.h: Ditto. * Headers/AppKit/NSStepperCell.h: Ditto. * Headers/AppKit/NSStringDrawing.h: Ditto. * Headers/AppKit/NSTabView.h: Ditto. * Headers/AppKit/NSTabViewItem.h: Ditto. * Headers/AppKit/NSTableColumn.h: Ditto. * Headers/AppKit/NSTable* HeaderCell.h: Ditto. * Headers/AppKit/NSTable* HeaderView.h: Ditto. * Headers/AppKit/NSTableView.h: Ditto. * Headers/AppKit/NSText.h: Ditto. * Headers/AppKit/NSTextAttachment.h: Ditto. * Headers/AppKit/NSTextContainer.h: Ditto. * Headers/AppKit/NSTextField.h: Ditto. * Headers/AppKit/NSTextFieldCell.h: Ditto. * Headers/AppKit/NSTextStorage.h: Ditto. * Headers/AppKit/NSTextView.h: Ditto. * Headers/AppKit/NSToolbar.h: Ditto. * Headers/AppKit/NSToolbarItem.h: Ditto. * Headers/AppKit/NSUserInterfaceValidation.h: Ditto. * Headers/AppKit/NSView.h: Ditto. * Headers/AppKit/NSWindow.h: Ditto. * Headers/AppKit/NSWindowController.h: Ditto. * Headers/AppKit/NSWorkspace.h: Ditto. * Headers/AppKit/PSOperators.h: Ditto. * configure.ac: Update to new header structure. * configure: Regenerated. * GNUmakefile.postamble: Remove handling of header-links and update to new header structure. * Source/GNUmakefile: Update to new header structure. Install gnustep specific headers in GNUstepGUI by splitting libgnustep-gui_HEADER_FILES into APPKIT_HEADERS and GUI_HEADERS. Include CompatibilityHeaders.make makefile fragement. * Source/GNUmakefile.preamble: Update to new header structure. * Source/CompatibilityHeaders.make: New file which installs dummy headers in the place of the old headers, warning about obsoleting the old location and includeing the header from its new location. * Source/GNUmakefile.postamble: Install AppKit Headers manually. * Source/*.[hm]: Update includes for new header structure. * Source/GSGuiPrivate.h: Moved here from Headers/gnustep/gui. * Source/GSFusedSilica.h: Ditto. * Source/nsimage-tiff.h: Ditto. * Tools/GNUmakefile.preamble: Update to new header structure. * Tools/example.m: Remove include of config.h. * ColorPickers/GNUmakefile: Update to new header structure. * ColorPickers/*.[hm]: Ditto. * TextConverters/RTF/GNUmakefile.preamble: Update to new header structure. * TextConverters/RTF/*.[hm]: Ditto. * Documentation/gnustep-gui.texi: Update to new header structure. * Documentation/Gui/Gui.gsdoc: Remmove gnustep additions. * Documentation/GuiAdditions/.cvsignore: New file. * Documentation/GuiAdditions/GNUmakefile: Ditto. * Documentation/GuiAdditions/GuiAdditions.gsdoc: Ditto. * Model/GNUmakefile: Update to new header structure. * GNUmakefile.postamble: Ditto. * Model/*.[hm]: Ditto. * Resources/GNUmakefile: Update to new header structure. * Source/DocMakefile: Update to new header structure. Added GuiAdditions to DOCUMENT_NAME. Split AUTOGSDOC_HEADERS into AUTOGSDOC_HEADERS_GUI and AUTOGSDOC_HEADERS_GUIADD. 2003-07-31 Michael Hanni * Source/NSBrowserCell.m (drawInteriorWithFrame:inView:): Remove unnecessary code to set the background of an image. * Source/NSButtonCell.m: ditto. * Source/NSMenuItemCell.m: remove usage of system image "common_3DArrowRightH" as it is unneeded. (drawImageWithFrame:inView:): remove unnecessary code to set the background of an image. (drawKeyEquivalentWithFrame:inView:): ditto. (drawStateImageWithFrame:inView:): ditto. * Source/NSScroller.m: remove usage of system images (common_ArrowUpH, common_ArrowDownH, common_ArrowLeftH, common_ArrowRightH) as they are unnecessary. (drawParts): reset HighlightsBy: code for all the cells, remove all the alternate images. * Source/NSTableHeaderCell.m (drawInteriorWithFrame:inView:): remove unnecessary call to set the background of an image. * Images/(common_ArrowUpH, common_ArrowDownH, common_ArrowLeftH, common_ArrowRightH).tiff: removed. 2003-07-31 Yen-Ju Chen * Documentation/Gui/LanguageSetup.gsdoc: Updated. 2003-07-27 17:53 Alexander Malmberg * Source/NSColor.m (+colorFromString:): Use NSScanner instead of sscanf to avoid problems on non-c locales. (initSystemColors): Make the creation of the system color list more robust. If entries are missing, add them. 2003-07-26 18:50 Alexander Malmberg * Source/NSView.m, Source/NSWindow.m: Make drawing debug logging more detailed. 2003-07-26 Fred Kiefer * Panel/English.proj/GSPageLayout.gorm/objects.gorm * Panel/English.proj/GSPrintPanel.gorm/objects.gorm Made all buttons non-continuous. 2003-07-26 Fred Kiefer * Headers/gnustep/gui/NSTableView.h Added new ivar _action. * Source/NSTableView.m Implemented methods [action] and [setAction:]. 2003-07-26 Fred Kiefer * Tools/gopen.m The option -a no longer starts the provided applciation directly, but uses this application to open the specified files. 2003-07-26 Fred Kiefer * Source/NSColorPicker.m Autorelease image returned by [provideNewButtonImage]. * Source/NSColorPanel.m * ColorPickers/GSStandardColorPicker.m In [_setupPickers] release cell array. * ColorPickers/GSNamedColorPicker.m Now basically working. * ColorPickers/GSNamedColorPicker.tiff Removed background of image. * ColorPickers/GNUmakefile Activate GSNamedColorPicker. 2003-07-26 Richard Frith-Macdonald * Source/NSApplication.m: Use NSInvocation to perform actions, so we can handle cases where the action method returns a non-id or misses an argument. * Source/NSResponder.m: ditto 2003-07-26 Fred Kiefer * Source/NSImage.m In [initWithIconHandle:] and [initWithBitmapHandle:] release the new bitmap image representation after adding it to the array. * Source/NSBitmapImageRep.m In [_initFromTIFFImage:number:] free the info returned by NSTiffGetInfo(). * Source/NSTableView.m In [sizeToFit] free isResizable. * Source/GSMemoryPanel.m In [update:] free the list returned by GSDebugAllocationClassList(). 2003-07-24 Adam Fedor * configure.ac: Fix setting ADDITIONAL_INCLUDE_... in audiofile section. 2003-07-23 Gregory John Casamento * Panels/GSSpellPanel.gorm: Added to replace old .gmodel * Source/NSSpellChecker.m: Updated to use .gorm file. 2003-07-23 Adam Fedor * Version 0.8.8 2003-07-23 Richard Frith-Macdonald * Source/DocMakefile: only remove directory containing 'stamp' for clean. 2003-07-23 22:23 Alexander Malmberg * Headers/gnustep/gui/NSResponder.h: Make _menu private. * Headers/gnustep/gui/NSMenuView.h: Add _attachedMenu ivar. * Source/NSMenuView.m: Use it. 2003-07-22 Adam Fedor * Source/NSOpenGLView.m ([NSOpenGLView -initWithFrame:]): Implemented (Patch from Damien Genet). 2003-07-22 Richard Frith-Macdonald * Documentation/GNUmakefile.postamble: Tweak for make update. * Source/DocMakefile: ditto * Headers/gnustep/gui/NSLayoutManager.h: documentation tweaks. * Headers/gnustep/gui/NSRulerMarker.h: ditto * Headers/gnustep/gui/NSText.h: ditto * Headers/gnustep/gui/NSTextContainer.h: ditto * Source/NSLayoutManager.m: ditto * Source/NSPopUpButtonCell.m: ditto * Source/NSTextContainer.m: ditto * Source/NSWorkspace.m: ditto * Source/NSFont.m: ditto * Source/NSOpenPanel.m: ditto * Source/NSPasteboard.m: ditto * Source/NSView.m: ditto * Source/NSBezierPath.m: ditto * Source/NSGraphicsContext.m: ditto * Headers/gnustep/gui/NSBezierPath.h: ditto * Headers/gnustep/gui/NSMenu.h: ditto 2003-07-22 Andrew Ruder * Source/NSWindow.m: Fix potential (unlikely) leak * Source/NSCursor.m: Fix memory leak; * Source/NSResponder.m: Fix memory leak; * Source/NSPrintPanel.m: Fix memory leak; 2003-07-21 Kazunobu Kuriyama * Documentation/Gui/LanguageSetup.gsdoc: Update. 2003-07-21 Andrew Ruder * Source/NSBundleAdditions.m: Fix memory leaks. 2003-07-21 Andrew Ruder * Source/GSMemoryPanel.m: Add dealloc method * Source/NSOutlineView.m: Efficiency tweak. * Headers/AppKit/NSComboBoxCell.h:Fix misplaced semicolon * Source/NSSelection.m: Fix memory leak * Source/NSComboBoxCell.m: Fix misplaced semicolon. * Source/NSPageLayout.m: Fix memory leak. * Source/NSMenuView.m: Fix memory leak. * Source/NSToolbar.m: Fix memory leak and tidy * Source/GSServicesManager.m: Clarify retain/release of timer. 2003-07-21 Richard Frith-Macdonald * Source/NSFileWrapper.m: Tidy initialisation and fix leak in dealloc. * Source/NSTextAttachment.m: ditto. * Source/NSGraphicsContext.m: Memory leak fixes (suggested by Andrew Ruder) and initialisation tidyups. * Source/NSInputManager.m: ditto * Source/NSOpenPanel.m: ditto * Source/NSDocument.m: minor tidyup in init and add some documentation * Source/NSDocumentController.m: add some documentation 2003-07-19 Adam Fedor * GNUmakefile: Build Documentation if doc=yes (yes by default). * Tools/gsnd/GNUmakefile.postamble: Linke in pthreads if not already linked in (non-mingw targets only). * Tools/gsnd/portaudio/pa_unix_oss/pa_unix_oss.c: On OpenBSD include soundcard.h. * Panels/English.proj: Replace GSPageLayout.gorm and GSPrintPanel.gorm with updated GOrm dirs. Make Options button non-continuous. * Panels/GNUmakefile.postamble (after-install): Install the gorm dirs. 2003-07-19 Fred Kiefer * Source/NSPopUpButtonCell.m Added methods [init], [objectValue], [setObjectValue:], [setImage:]. In [initTextCell:pullsDown:] create the menu first, so that the first item gets entered to it. In [setPullsDown:] and [setAltersStateOfSelectedItem] set the values that depend on these flags. In [insertItemWithTitle:atIndex:] remove duplicates. [selectItem:] the used image now depends on the arrow position. Removed [drawWithFrame:inView:] and rewrote [drawInteriorWithFrame:inView:]. 2003-07-18 Fred Kiefer * Headers/gnustep/gui/NSControl.h * Source/NSControl.m New MacOSX methods [formatter], [setFormatter:], [attributedStringValue], [setAttributedStringValue:]. 2003-07-16 Adam Fedor * Documentation/Gui/LanguageSetup.gsdoc: Updated with changes from Yen-Ju Chen and (Kazunobu Kuriyama.) 2003-07-16 Fred Kiefer * TextConverters/RTF/rtfGrammer.y Free the name for RTFOtherStatement. * TextConverters/RTF/rtfGrammer.tab.c Regenerated. 2003-07-15 Fred Kiefer * TextConverters/RTF/RTFConsumerFunctions.h Added function GSRTFunicode(). * TextConverters/RTF/RTFConsumer.m Added method [RTFConsumer appendString:] with code coming from GSRTFmangleText(). Use this in GSRTFmangleText() and new function GSRTFunicode(). Corrected GSRTFmangleText() to convert the input from NSISOLatin1StringEncoding, as this is what our current RTF exporter produces. * TextConverters/RTF/rtfScanner.c Define RTFunichar token. * TextConverters/RTF/rtfGrammer.y Added rule to read unicode character from RTF input. * TextConverters/RTF/rtfGrammer.tab.c * TextConverters/RTF/rtfGrammer.tab.h Regenerated. 2003-07-14 Richard Frith-Macdonald * Headers/gnustep/gui/GSServicesManager.h: removed a function * Headers/gnustep/gui/NSApplication.h: and added it here so it's public. Also fixed some argument name missmatches. * Source/GSServicesManager.m: Some fixes for recent changes to DO in base library ... also make listener even safer. * Source/NSPasteboard.m: Improve documentation and change pasteboards to always be sent over DO bycopy. * Tools/example.m: Set error response to nil when there is no error. 2003-07-12 18:20 Alexander Malmberg * Headers/gnustep/gui/NSTextView.h, Source/NSTextView.m: Add -_updateInputMethodState and -_updateInputMethodWithInsertionPoint: methods. Call them in suitable places. Minor cleanups in comments. 2003-07-12 Gregory John Casamento * Source/NSMatrix.m: -[NSMatrix keyCell] failed to check if the _cells array is initialized before accessing it. This was causing a core dump when unarchiving. 2003-07-10 03:37 Alexander Malmberg * Source/NSStringDrawing.m, Source/NSTextView.m: Adjust "really large" sizes to ensure accuracy to a whole point. 2003-07-10 Benhur Stein * Source/NSSavePanel.m: added new private method _compareFilename:with:. Use it in _selectCellName:. In [-browser:createRowsForColumn:inMatrix:]: use self as context to sortedArrayUsingFunction:context: * Source/NSOpenPanel.m (-_selectCellName:): use new [NSSavePanel _compareFilename:with:] method. * This fixes bug #4255 2003-07-05 Adam Fedor * configure.ac: Add openbsd flags like freebsd. * Documentation/Gui/DefaultsSummary.gsdoc: Move backend defaults to back/Documentation/Back/DefaultsSummary.gsdoc. 2003-07-05 18:02 Alexander Malmberg * Source/NSLayoutManager.m (-textStorage:edited:range:changeInLength:invalidatedRange:): Improve behavior of the adjustments to the selected range. 2003-07-05 17:20 Alexander Malmberg * Source/NSAttributedString.m (-fixParagraphStyleAttributeInRange:): Handle paragraphs with a paragraph style set for a part of it but not the first character correctly. * Source/NSFont.m (getNSFont): Retain/autorelease when returning a cached instance to make the retain status of the instance correct. 2003-07-05 16:07 Alexander Malmberg * Source/NSFont.m (-initWithCoder:): Make sure that the returned font has a correct retain count on all paths. 2003-07-04 Richard Frith-Macdonald * Source/NSPasteboard.m: Add code to set protocols for proxy objects. and dum my class implementations to let protocols work with old compilers. * Headers/AppKit/GSPasteboard.h: Add missing method of owner. 2003-07-03 01:43 Alexander Malmberg * Source/NSFont.m (getNSFont): Only update the cache when the font has the default size. 2003-07-02 16:38 Alexander Malmberg * Source/NSFont.m: (Mostly) rewrite handling of standard fonts to provide better behavior, especially when only some fonts are set in the defaults. Updated documentation. 2003-07-01 Serg Stoyan * Source/NSBrowser.m (_createColumn): Set border type of column's scroll view according to _separateColumns flag. 2003-06-29 20:15 Alexander Malmberg * Source/NSWorkspace.m (-launchApplication:showIcon:autolaunch:): Add a missing '@'. 2003-06-29 17:37 Alexander Malmberg * Source/NSStringDrawing.m (-drawAtPoint:, -drawAtRect:, -size): Automatically turn off screen fonts in the layout manager if the ctm for the current context isn't the identity matrix (possibly flipped vertically). 2003-06-28 Richard Frith-Macdonald * Tools/make_services.m: Alter format of filter info. * Tools/example.m: Added an example filter. * Tools/md5Digest.m: Example filter user. * Source/GSServicesManager.m: tweak for filters. * Source/NSPasteboard.m: more documentation 2003-06-27 Richard Frith-Macdonald * Source/NSPasteboard.m: Documented all methods, fixed minor bugs writing fiels to pastebaords, implemented ([+typesFilterableTo:]) wrote (partial implementation ...) the unimplemented filters stuff. * Source/GSServicesManager.m: helpers for filters. * Headers/AppKit/GSPasteboard.h: Removed unused methods, added documentation. 2003-06-26 Ludovic Marcotte * Fixed the transparency of Images/common_ret.tiff * Source/NSOutlineView (-setDataSource:) Modified to allow a nil data source. 2003-06-26 Fred Kiefer * Headers/gnustep/gui/GSLayoutManager.h Changed ivars cached_pos and cached_cpos to unsigned. * Headers/gnustep/gui/GSLayoutManager_internal.h Changed element char_offset of structure glyph_t to unsigned. * Source/GSLayoutManager.m (_glyphDumpRuns, helpers::generateRunsToCharacter:, helpers::generateGlyphsUpToCharacter:, helpers::generateGlyphsUpToGlyph:, helpers::glyphForCharacter:index:positions::, getGlyphs:range:, characterRangeForGlyphRange:actualGlyphRange:, glyphRangeForCharacterRange:actualCharacterRange:, invalidateGlyphsForCharacterRange:changeInLength:actualCharacterRange:, insertTextContainer:atIndex:): Removed compiler warning about signed/unsigned comparision. 2003-06-25 Fred Kiefer * Source/NSImage.m (initWithPasteboard:): * Source/NSView.m (dragFile:fromRect:slideBack:event:): Corrected handling of pasteboard data of type NSFilenamesPboardType. 2003-06-24 01:05 Alexander Malmberg * Source/NSTabViewItem.m (-drawLabel:inRect:): Update for change in the behavior of -drawAtPoint:. Use -drawInRect: instead. 2003-06-23 19:03 Alexander Malmberg * Source/NSStringDrawing.m (-drawAtPoint:): Place the text correctly when the view isn't flipped. 2003-06-23 Fred Kiefer * Source/NSPanel.m Commented out unused variables WTitleHeight, ScrollMinSize, MessageMinHeight. * Source/NSTabView.m (selectNextTabViewItem:): * Source/NSTableView.m (selectAll:): * Source/NSTextStorage.m (edited:range:changeInLength:, processEditing): * Source/GSTextStorage.m (replaceCharactersInRange:withString:) * Source/tiff.m (NSTIFFRead, NSTIFFWrite, CheckAndCorrectColormap): * Source/GSTable.m (_updateForNewFrameSize:) * Source/NSTextView.m (changeFont:): Removed compiler warning about signed/unsigned comparision. * Source/GSHorizontalTypesetter.m Changed element char_index of structure glyph_cache_t to unsigned. 2003-06-22 Richard Frith-Macdonald * Source/NSWorkspace.m: Implement autolaunch flag and add documentation describing hwo GNUstep and MacOS-X actually handle launching ... hopefully more clearly than the somewhat misleading MacOS-X documentation. 2003-06-22 Fred Kiefer * Headers/gnustep/gui/NSInputManager.h Changed ivar _abortFlags to unsigned. Changed all modifier parameters to unsigned. * Source/NSInputManager.m (initWithName:host:): Removed compiler warning about signed/unsigned comparision. Adopted to changes in header. * Headers/gnustep/gui/GSLayoutManager.h Changed ivars layout_glyph and layout_char to unsigned. * Headers/gnustep/gui/GSLayoutManager_internal.h Changed elements glyph_length and char_length of structure glyph_run_head_t to unsigned. * Source/NSLayoutManager.m (rectArrayForGlyphRange:...rectCount:, glyphRangeForBoundingRect:inTextContainer:, _insertionPointRectForCharacterIndex:textContainer:): Removed compiler warning about signed/unsigned comparision. * Source/NSMatrix.m (selectAll:) Removed compiler warning about signed/unsigned comparision. * Source/NSPageLayout.m (initWithContentRect:...screen:, readPrintInfo) Removed compiler warning about signed/unsigned comparision. * Headers/gnustep/gui/NSPopUpButtonCell.h Changed ivar _selectedItem to type (id ). * Source/NSPopUpButtonCell.m (insertItemWithTitle:atIndex:, selectItemAtIndex:, selectItemWithTitle:, setTitle:) Corrected type of local variable. * Source/NSPrintInfo.m In [+initPrintInfoDefaults] initialize variable printer with nil. * Source/NSPrintOperation.m (_print) Removed compiler warning about signed/unsigned comparision. * Source/NSPrintPanel.m Added missing include for GSGuiPrivate.h. (initWithContentRect:...screen:, updateFromPrintInfo) Removed compiler warning about signed/unsigned comparision. 2003-06-21 Adam Fedor * Source/NSOutlineView.m ([NSOutlineView -drawRow:clipRect:]): Add delegate method call. Patch from Yen-Ju Chen * Source/NSView.m (-menuForEvent:): Add note about this method being discouraged. 2003-06-20 Adam Fedor * Source/NSFont.m ([NSFont -initWithCoder:]): Use NSFont not isa to call class methods. 2003-06-20 Adam Fedor * Source/DocMakefile (after-all): Check if Gui exists before removing. 2003-06-20 Adam Fedor * Version 0.8.7 2003-06-21 David Ayers * PrinterTypes/GNUmakefile.postamble: Add -f option to rm in uninstall of resource files. 2003-06-17 Adam Fedor * GNUmakefile (SUBPROJECTS): Add Documentation 2003-06-17 Adam Fedor * Source/NSDocumentController.m: Add GSGuiPrivate header for localization. * Source/NSSavePanel.m: Idem. 2003-06-17 Fred Kiefer * Headers/gnustep/gui/GSDisplayServer.h Changes style parameter of [stylewindow:style:] and [styleoffsets:::::] to unsigned, to be consistent with the other style methods. * Source/GSDisplayServer.m Adopted to changes in header. 2003-06-15 16:26 Alexander Malmberg * Source/GSHorizontalTypesetter.m: Use NSIsEmptyRect instead of comparing for equality with NSZeroRect. (-layoutLineNewParagraph:): Handle text containers with no area. 2003-06-15 14:57 Alexander Malmberg * configure.ac: Don't add GNUSTEP_HDIR/GNUSTEP_LDIR to ADDITIONAL_INCLUDE_DIRS/ADDITIONAL_LIB_DIRS. configure: Regenerate. 2003-06-15 02:35 Alexander Malmberg * Headers/gnustep/gui/GSNibTemplates.h, Source/NSBundleAdditions.m: Remove unused GSFontProxy class. 2003-06-08 David Ayers * Headers/gnustep/gui/IMConnectors.h: Change syntax of include <> to "" for local headers. Change base/ to gnustep/base/ in includes. Change AppKit/GSFiles.h to gnustep gnustep/gui/GSFiles.h includes. * Source/Functions.m, Source/GSDisplayServer.m, Source/GSFontInfo.m, Source/GSFusedSilica.m, Source/GSFusedSilicaContext.m, Source/GSHbox.m, Source/GSHelpManagerPanel.m, Source/GSInfoPanel.m, Source/GSKeyBindingAction.m, Source/GSKeyBindingTable.m, Source/GSLayoutManager.m, Source/GSMemoryPanel.m, Source/GSServicesManager.m, Source/GSSimpleLayoutManager.m, Source/GSSlideView.h Source/GSSlideView.m, Source/GSTable.m, Source/GSTextStorage.h Source/GSTextStorage.m, Source/GSTrackingRect.m, Source/GSTypesetter.m, Source/GSVbox.m, Source/NSActionCell.m, Source/NSAffineTransform.m, Source/NSApplication.m, Source/NSAttributedString.m, Source/NSBezierPath.m, Source/NSBitmapImageRep.m, Source/NSBox.m, Source/NSBrowser.m, Source/NSBrowserCell.m, Source/NSBundleAdditions.m, Source/NSButton.m, Source/NSButtonCell.m, Source/NSCachedImageRep.m, Source/NSCell.m, Source/NSClipView.m, Source/NSColor.m, Source/NSColorList.m, Source/NSColorPanel.m, Source/NSColorPicker.m, Source/NSColorWell.m, Source/NSComboBox.m, Source/NSComboBoxCell.m, Source/NSControl.m, Source/NSCursor.m, Source/NSCustomImageRep.m, Source/NSDataLink.m, Source/NSDataLinkManager.m, Source/NSDataLinkPanel.m, Source/NSDocument.m, Source/NSDocumentController.m, Source/NSDrawer.m, Source/NSEPSImageRep.m, Source/NSEvent.m, Source/NSFileWrapper.m, Source/NSFont.m, Source/NSFontManager.m, Source/NSFontPanel.m, Source/NSForm.m, Source/NSFormCell.m, Source/NSGraphicsContext.m, Source/NSHelpManager.m, Source/NSHelpPanel.m, Source/NSImage.m, Source/NSImageCell.m, Source/NSImageRep.m, Source/NSImageView.m, Source/NSInputManager.m, Source/NSInputServer.m, Source/NSInterfaceStyle.m, Source/NSLayoutManager.m, Source/NSMatrix.m, Source/NSMenu.m, Source/NSMenuItem.m, Source/NSMenuItemCell.m, Source/NSMenuView.m, Source/NSOpenGLContext.m, Source/NSOpenGLPixelFormat.m, Source/NSOpenGLView.m, Source/NSOpenPanel.m, Source/NSOutlineView.m, Source/NSPageLayout.m, Source/NSPanel.m, Source/NSParagraphStyle.m, Source/NSPasteboard.m, Source/NSPopUpButton.m, Source/NSPopUpButtonCell.m, Source/NSPrintInfo.m, Source/NSPrintOperation.m, Source/NSPrintPanel.m, Source/NSPrinter.m, Source/NSProgressIndicator.m, Source/NSResponder.m, Source/NSRulerMarker.m, Source/NSRulerView.m, Source/NSSavePanel.m, Source/NSScreen.m, Source/NSScrollView.m, Source/NSScroller.m, Source/NSSecureTextField.m, Source/NSSelection.m, Source/NSSlider.m, Source/NSSliderCell.m, Source/NSSound.m, Source/NSSpellChecker.m, Source/NSSpellServer.m, Source/NSSplitView.m, Source/NSStepper.m, Source/NSStepperCell.m, Source/NSStringDrawing.m, Source/NSTabView.m, Source/NSTabViewItem.m, Source/NSStepperCell.m, Source/NSStringDrawing.m, Source/NSTabView.m, Source/NSTabViewItem.m, Source/NSTableColumn.m, Source/NSTableHeaderCell.m, Source/NSTableHeaderView.m, Source/NSTableView.m, Source/NSText.m, Source/NSTextAttachment.m, Source/NSTextContainer.m, Source/NSTextField.m, Source/NSTextFieldCell.m, Source/NSTextStorage.m, Source/NSTextView.m, Source/NSTextView_actions.m, Source/NSToolbar.m, Source/NSToolbarItem.m, Source/NSView.m, Source/NSWindow.m, Source/NSWindowController.m, Source/NSWorkspace.m, Source/externs.m, Source/linking.m, Source/tiff.m: Ditto. 2003-06-08 Kazunobu Kuriyama * configure.ac: Add --with-audiofile-include and --with-audiofile -library options 2003-06-11 Dirk Latterman * Source/NSActionCell.m (-setObjectValue:): Implemented. 2003-06-11 15:34 Alexander Malmberg * Headers/gnustep/gui/GSFontInfo.h, Source/GSFontInfo.m: Add -appendBezierPathWithGlyphs:count:toBezierPath: method. * Source/NSBezierPath.m: Use it to implement the glyph methods. 2003-06-09 Gregory John Casamento * Headers/gnustep/gui/NSDataLinkPanel.h: Added ivar declarations for the data link panel. * Source/NSDataLinkPanel.m: Added some implementations for panel methods. * Source/NSDataLinkManager.m: Manages the data links for an application. added implementation for some methods. * Headers/gnustep/gui/NSFontPanel.h: Added topView and bottomView and sizes for use by accessory view code. * Source/NSFontPanel.m: Added implementation for _getOriginalSize and also for sertAccessoryView. Previously the setAccessoryView method was causing the accessory view to overlay the content view of the window. * Panels/GNUmakefile: added GSDataLinkPanel.gorm in the makefile. * Source/NSBundleAdditions.m: Skeletal implementation of GSObjectData class. 2003-06-09 Alexander Malmberg committed by: Gregory Casamento * Headers/gnustep/gui/NSFont.h: Added ivar to hold font role to represent preferred fonts (e.g. system, user, & tooltip fonts) * Source/NSFont.m: Added roles and modified code to properly encode and decode fonts such that an intelligent default is selected if the specified font is unavailable and also unarchives as the correct preferred font if one of the predefined roles is selected. 2003-06-08 Fred Kiefer * Source/NSBitmapImageRep.m In [initWithBitmapDataPlanes:...bitsPerPixel:], [getBitmapDataPlanes:] and [copyWithZone:] changed type of i to unsigned int. * Source/NSBrowser.m (-setPath:, pathToColumn:, -addColumn): Removed compiler warning about signed/unsigned comparision. * Source/NSComboBoxCell.m (-completedString:): ditto. * Source/NSFontPanel.m (-setPanelFont:isMultiple:, -_trySelectSize:, -_familySelectionChanged:, -browser:...column:) : ditto * Source/NSFontmanager.m (-availableFonts, -availableFontNamesWithTraits:, -availableMembersOfFontFamily:, -convertFont:, convertWeight:ofFont:, -fontWithFamily:traits:weight:size:, -fontNamed:hasTraits:): ditto. [setSelectedFont:isMultiple:] and [fontMenu:] changed menuItem to type (id ). 2003-06-05 16:42 Alexander Malmberg * Source/NSMenu.m: Check the types of all defaults values before using them. 2003-06-05 Adam Fedor * GMAppKit.m (-initWithModelUnarchiver:): #ifdef out ivar assignment when compiling nib2gmodel. 2003-06-04 23:02 Alexander Malmberg * Source/NSCell.m (-_setupTextWithFrame:inView:editor:): Use a (much) larger maximum size for the field editor. 2003-05-26 Adam Fedor * Source/NSApplication.m (gsapp_user_bundles): New function (-_init): Use it. * Documentation/Gui/DefaultsSummary.gsdoc: Update. 2003-05-25 Adam Fedor * Version 0.8.6 2003-05-22 18:07 Alexander Malmberg * Tools/make_services (addExtensionsForApplication): Parse NSExtensions dictionary correctly. Based on patch from Jeff Teunissen. 2003-05-22 Fred Kiefer * Source/NSFontPanel.m [_familySelectionChanged:] removed unused local variable. * Headers/gnustep/gui/NSWorkspace.h Added new MacOSX methods. * Source/NSWorkspace.m Basic implemention of [activeApplication] and [launchedApplications]. * Source/NSApplication.m In [finishLaunching] and [replyToApplicationShouldTerminate:] use [NSWorkspace activeApplication] to get application information. 2003-05-20 22:50 Alexander Malmberg * Tools/make_services.m (scanDynamic): Skip anything with a .service extension. 2003-05-18 00:00 Alexander Malmberg * Headers/gnustep/gui/DPSOperators.h, Headers/gnustep/gui/PSOperators.h, Headers/gnustep/gui/GSMethodTable.h, Headers/gnustep/gui/NSGraphicsContext.h, Source/NSGraphicsContext.m: Add shfill operator. 2003-05-15 Richard Frith-Macdonald * Source/GSInfoPanel.m: Draw authors in the order they occur in the info.plist 2003-05-14 Serg Stoyan * Source/NSMenuView.m (-setFont:): Set cell height at least to 20 pixels. 2003-05-13 20:19 Alexander Malmberg * Source/NSButton.m (-setState:, -setNextState): Mark the view as needing display, don't force a display. * Source/NSWindow.m (-_terminateBackendWindow): Set _windowNum to 0 so the window will be recreated the next time it is needed. 2003-05-12 17:30 Alexander Malmberg * Source/NSView.m (-lockFocusInRect:): Don't save the clipping path in the gstate if one is allocated since it depends on the rectangle focus is locked in. 2003-05-11 Richard Frith-Macdonald * Source/NSWorkspace.m: Add support for generic application icon. Reduce private method name pollution a little. * Images/common_UnknownApplication.tiff: copied from WM ... * Images/common_UnknownTool.tiff: similar image for unix cmd-line tools. * Source/NSApplication.m: Add some user info to the launch notification (provided by urbanek@host.sk). 2003-05-05 Michael Hanni * Source/NSTabView.m: implemented selectTabViewItemWithIdentifier:. 2003-05-05 22:48 Alexander Malmberg * Headers/gnustep/gui/GSLayoutManager.h, Source/GSLayoutManager.m, Source/GSHorizontalTypesetter.m: Detect and handle gaps in the soft invalidated layout information. 2003-05-02 Adam Fedor * Documentation/Gui/GNUmakefile: Remove GNUSTEP_MAKEFILES. * Source/DocMakefile: Idem. 2003-05-02 Fred Kiefer * TextConverters/RTF/RTFProducer.h * TextConverters/RTF/RTFProducer.m New implemtation by Axel "Mikesch" Katerbau (axel@objectpark.org) with small changes from me. RTF output now support much more attributes and even Unicode characters. * Source/NSBezierPath.m Moved code from [bezierPathWithOvalInRect:] and [bezierPathWithRect:] to [appendBezierPathWithOvalInRect:] and [appendBezierPathWithRect:] and implemented the former with a call to the later. Preliminary implemetation for [appendBezierPathWithGlyph:inFont:] and [appendBezierPathWithGlyphs:count:inFont:]. * Source/NSFont.m: Preliminary implemetation for NSConvertGlyphsToPackedGlyphs(). 2003-05-01 21:48 Alexander Malmberg * Source/NSScroller.m (-acceptsFirstResponder): Implement to return NO. 2003-05-01 20:02 Alexander Malmberg * Source/NSInputManager.m (-loadBindingsWithName:): Update for file system layout changes. * Source/NSTextView.m (-drawRect:): Draw the background correctly. 2003-04-30 Richard Frith-Macdonald * Source/NSScrollView.m: ([scrollWheel:]) enable horizontal scrolling with shift key. 2003-04-28 18:35 Alexander Malmberg * Headers/gnustep/gui/NSTextContainer.h: Documented. * Source/NSTextContainer.m: Cleanups. Mon Apr 28 13:14:15 2003 Nicola Pero * Source/NSApplication.m ([NSApplication -targetForAction:]): If this is a document-based application, check if the key window's document responds to the action; if it does, use it. 2003-04-28 Nicola Pero * Resources/GNUmakefile (gui-resources_RESOURCE_FILES_INSTALL_DIR): Define using the full relative path. 2003-04-27 Adam Fedor * Source/GSServicesManager.m (+newWithApplication:) Change Services to Library/Services. * Source/NSWorkspace.m (+initilize): Idem. * Tools/make_services.m (main): Idem. 2003-04-27 Adam Fedor * Updates for filesystem change. * GNUmakefile (GNUSTEP_MAKEFILES): Remove * ColorPickers/GNUmakefile, Documentation/GNUmakefile, Images/GNUmakefile, KeyBindings/GNUmakefile, Model/GNUmakefile, Panels/GNUmakefile, Panels/GNUmakefile.postamble, PrinterTypes/GNUmakefile, PrinterTypes/GNUmakefile.postamble, Source/GNUmakefile, TextConverters/GNUmakefile, Tools/GNUmakefile: Idem and update install locations. * Resources/GNUmakefile: Update for change in resource-set.make * configure.ac: Replace $GNUSTEP_SYSTEM_ROOT/Makefiles with $GNUSTEP_MAKEFILES. Replace Libraries with Library/Libraries. Replace Headers with Library/Headers. * Source/NSImage.m (+initialize, +imageNamed:): Use +pathForLibraryResource:ofType:inDirectory. * Source/NSPrintInfo (+initPrintInfoDefaults): Idem. * Source/NSPrinter.m (getFile): Idem. * Source/NSSound.m (+initialize, +soundNamed:): Idem. * Source/NSView.m (-_loadPrinterProlog): Idem. * Source/NSPageLayout.m (-initWithContentRect:styleMask:backing:defer:screen:): Use GSGuiBundle to get resources. * Source/NSPrintPanel.m ( -initWithContentRect:styleMask:backing:defer:screen:): Idem. * Source/NSSpellChecker.m ([NSSpellChecker -init]): Idem. 2003-04-27 Michael Hanni * Source/NSPopUpButtonCell.m (drawWithFrame:inView:): added a call to the NSMenuItemCell's calcSize method to place the image correctly when we are making a temp item. Fixes regression prompted by changes on 2003-04-17. 2003-04-27 Fred Kiefer * Source/GSFontInfo.m Removed creation of fontDictionary from [init] method. This now gets done on demand in [afmDictionary]. * Source/NSFontPanel.m: [_familySelectionChanged:] made the call to [_trySelectSize:] safer against none existing fonts. This used to result in a NaN being displayed as font size. 2003-04-25 Benhur Stein * Source/NSRulerView.m: Removed unused macro BASE_LINE_LOCATION. (setMeasurementUnits:, setClientView:, setOriginOffset:): Add call to invalidateHashMarks, remove call to setNeedsDisplay:. (invalidateHashMarks): Add call to setNeedsDisplay:. (drawHashMarksAndLabelsInRect:): Changed calculation of location of zero hash mark. Changed use of _zeroLocation ivar into zeroLocation local variable. Limited display of hashs and marks to baseline. * Headers/gnustep/gui/NSRulerView.h: Renamed unused ivar _zeroLocation to _UNUSED. 2003-04-26 Fred Kiefer * Source/NSControl.m Removed [becomeFirstResponder] and [resignFirstResponder] as the handling of [showFirstResponder] is still unclear. * Source/NSMenuView.m Moved the computation of the cell size into the method [setFont:] and use this in [init]. Added call to [setNeedsSizing:] in [setHorizontalEdgePadding:]. In [locationForSubmenu:] check for the interface style of the submenu. Also cleaned up up coding style and comments in the whole file. * Headers/gnustep/gui/NSParagraphStyle.h Added new ivar and methods from MacOSX to handle writing directions. * Source/NSParagraphStyle.m Implemented handling of writing directions. These are needed for the upcoming new RTFProducer. 2003-04-26 Richard Frith-Macdonald * Source/NSWindow.m: ([setFrameFromString:]) try to adjust sensibly for changes to screen size. ([constrainFrameRect:toScreen:]) bugfix for positioning when the window origin is negative. * Tools/make_services.m: Ignore illegal (null) file extension spec. 2003-04-26 Fred Kiefer * Source/NSPanel.m Use controlBackgroundColor instead of lightGrayColor. Patch by Matt Rice (matt@vespertine.pc.ashlandfiber.net). * Headers/gnustep/gui/NSGraphics.h * Source/externs.m Added NSPatternColorSpace. * Source/NSColor.m [GSPatternColor colorSpaceName] uses NSPatternColorSpace. Corrected [blendedColorWithFraction:ofColor:], where self and aColor where exchanged and alpha handling was missing. * Source/NSWindow.m Removed unused local variable in [sendEvent:]. * Source/NSSliderCell.m Basic implementation of the tick mark methods. Added en-/decoding for tick marks. [setKnobThickness:], [setNumberOfTickMarks:] and [setTickMarkPosition:] now update the control. 2003-04-25 Richard Frith-Macdonald * Source/NSSavePanel.m: Track window resizing and adjust browser columns to match. Use larger minimum width. 2003-04-21 Serg Stoyan * Source/NSMenuView.m: (mouseDown:): Generate periodic events every 0.01 seconds. 2003-04-17 Serg Stoyan * Source/NSMenuItemCell.m: (setMenuView:): Removed setting image position and _mcell_belongs_to_popupbutton ivar for popup button cell. (calcSize): Removed code from setMenuView placed here. 2003-04-13 Michael Hanni * Images/common_WMCloseBroken.tiff,common_WMClose.tiff: remove background of image. Mon Apr 14 14:24:27 2003 Nicola Pero * Headers/gnustep/gui/AppKit.h: Include NSDocument.h 2003-04-14 Serg Stoyan * Source/NSApplication.m: (setImageForWindowsItem:): Do not add "X" image if window has no close button. 2003-04-13 Michael Hanni * Source/NSProgressIndicator.m: revert last change. * Source/NSInterfaceStyle.m: revert last change. * Headers/NSInterfaceStyle.h: revert last change. 2003-04-13 Michael Hanni Multiple outstanding commits. * ColorPickers/GSWheelColorPicker.m: (mouseDown:): Implemented new event loop that really speeds things up on slow machines. * Source/NSScroller.m: (init): Decreased periodic delay for scroller buttons. (trackKnob:): Implemented new event loop to improve speed. Added code to "snap" back the scroller when you release the alternate key in mid-scroll (modeled after OS 4.2 behavior.) (trackScrollButtons:): Removed event loop as we weren't using it anyways. * Source/NSFontPanel.m: (_trySelectSize:): Put size textfield update code here, make sure column is loaded. (_familySelectionChanged:): Call _trySelectSize: to update the size column just like we do for the face browser. * Source/NSProgressIndicator.m: (drawRect:): Implement GSGtkInterfaceStyle for NSProgressIndicatorInterfaceStyle. * Source/NSInterfaceStyle.m: added GSGtkInterfaceStyle. * Headers/NSInterfaceStyle.h: ditto. 2003-04-13 Michael Hanni * Source/NSPopUpButton.m: (mouseDown:): Beep and return if menu items array is empty. (keyDown:): ditto. * Source/NSPopUpButtonCell.m: (removeAllItems:): Revert last change. Really remove all items. (drawWithFrame:inView:): Draw temporary cell if no items in menu. 2003-04-12 Serg Stoyan * Source/NSPopUpButtonCell.m: (removeAllItems): Leave item at index 0 with empty title. 2003-04-11 Michael Hanni * Source/NSApplication.m: (updateWindowsItem:): call to sizeToFit removed. NSMenuItemCell manipulation removed which the cell makes internally anyways. * Source/NSMenuView.m: (- update:): if we are a popup bail out before messing around with titleview buttons. (isOpaque): method added. We are opaque after all. 2003-04-11 Serg Stoyan * Source/NSPopUpButton.m: (mouseDown): Set menu view's highlightedItemIndex to lastSelectedItem if result index is -1. Comments added. * Source/NSApplication.m: (setImageForWindowsItem:): implemented. (changeWindowsItem:title:filename:): call setImageForWindowsItem: added. TODO: removed from comment. 2003-04-10 Serg Stoyan * Source/NSPopUpButton.m: (mouseDown): Get selected item index from _cell. Set NSMenuView selected item if selection changed, revert to old if unchanged or menu item disabled. * Source/NSPopUpButtonCell.m: (selectItem:): Remove image from old selected item and add image to new selected item only if image is not set by user. 2003-04-10 Pierre-Yves Rivaille * Source/NSWindow.m ([-sendEvent:], case NSRightMouseDown): removed code to display the menu. This is now done by [NSView -rightMouseDown:]. * Source/NSView.m: overrides -menu, changes -rightMouseDown: to display the menu, documents -menu, -menuForEvent: and +defaultMenu. 2003-04-10 Richard Frith-Macdonald * Source/GSServicesManager.m: on opening file, only activate for document based applications as suggested by Alexander. * Source/NSWorkspace.m: ([_connectApplication:]) fix to handle retries and timeouts correctly. 2003-04-10 01:53 Alexander Malmberg * Source/GSLayoutManager.m (-_generateGlyphs_char_r::::::): Fix updating of glyph counts in some rare cases. Minor cleanups. 2003-04-09 Richard Frith-Macdonald * Headers/gnustep/gui/GSServicesManager.h: Expost file open methods. * Source/GSServicesManager.m: Tidy file opening methods. * Source/NSApplication.m: Use methods from GSServicesManager Activate NSApp when opening a file. Use NSDocumentController if the app delegate won't open a file. Remove temporary files once they are opened. 2003-04-09 Serg Stoyan * Source/NSMenuView.m: return back horizontal menu code. (sizeToFit): ditto. Take into account title view's width when calculating horizontal menu frame. (innerRect): ditto. (rectOfItemAtIndex:): ditto. Take into account title view's width when calculating placement of menu item in horizontal menu. (locationForSubmenu:): ditto. (setWindowFrameForAttachingToRect:): ditto. (encodeWithCoder:): ditto. (initWithCoder:): ditto. (setHorizontal:): added. (isHorizontal): added. ([NSMenuWindowTitleView mouseDown]): Event loop changed to Michael Hanni's version. * Headers/NSMenuView.h: (setHorizontal:): added. (isHorizontal): added. * Source/NSWindow.m: (orderWindow:): Display content view before backend window ordering. 2003-04-09 00:38 Alexander Malmberg * Source/NSView.m (-setNeedsDisplay:, -setNeedsDisplayInRect:): Clean up, fix a potential issue when subclassing and thread-safety, and clarify the documentation. (Based on discussion with David Ayers and Pierre-Yves Rivaille.) 2003-04-08 15:33 Alexander Malmberg * Source/NSTextView.m (-mouseDown:): Rewrite mouse tracking loop. 2003-04-08 02:12 Alexander Malmberg * Source/NSApplication.m: Note which thread is the -gui thread. * Source/NSView.m (-setNeedsDisplay:, -setNeedsDisplayInRect:): If the current thread isn't the -gui thread, perform the call in the main thread instead. 2003-04-07 13:05 Alexander Malmberg * Source/NSFont.m (-initWithName:matrix:fix:screenFont:): Release all memory if the fontInfo can't be created. 2003-04-07 11:56 Alexander Malmberg * TextConverters/RTF/rtfGrammer.y: Add error recovery rules. * TextConverters/RTF/rtfGrammer.tab.c: Rebuild. * TextConverters/RTF/RTFConsumer.m: Change uses of autoreleased objects to retain/release explicitly instead. (GSRTFError): Try to recover from errors instead of raising an exception. 2003-04-06 19:56 Alexander Malmberg * Source/NSWindow.m: Make sure -_handleWindowNeedsDisplay: is run on every runloop iteration so -setNeedsDisplay* can be used safely from methods invoked by -performSelector:target:argument:order:modes:. 2003-04-06 15:10 Alexander Malmberg * Source/GSLayoutManager.m (-_generateGlyphsUpToCharacter:): Make sure that all editing of the text storage has been processed before trying to generate glyhps for it. 2003-04-05 12:58 Alexander Malmberg * Source/NSFontPanel.m (-_initWithoutGModel): Make preview active by default. 2003-04-05 Richard Frith-Macdonald * Headers/gnustep/gui/NSAttributedString.h: * Headers/gnustep/gui/NSDocumentController.h: * Headers/gnustep/gui/NSGraphicsContext.h: * Headers/gnustep/gui/NSResponder.h: * Headers/gnustep/gui/NSStringDrawing.h: * Headers/gnustep/gui/NSTextView.h: * Headers/gnustep/gui/NSWindow.h: Fixes to allow compliation of apps with STRICT_OPENSTEP defined. This does *NOT* mean I've checked that STRICT_OPENSTEP is defined where it should be, just that I've stopped it preventing compilation. 2003-03-28 Serg Stoyan * Source/NSMenuView.m: (displayTransient:): Call [self sizeToFit] before caclulating locations. 2003-04-04 02:46 Alexander Malmberg * Source/NSTextView.m: Misc. cleanups. (-dealloc): Remove the delegate from the notification center for the notifications we added it for. 2003-04-03 20:28 Alexander Malmberg * Headers/gnustep/gui/GSLayoutManager_internal.h, Source/GSLayoutManager.m: When stepping forward at the end of the glyph runs, correctly handle the case where the current run is extended. 2003-04-02 15:26 Alexander Malmberg * Source/GSHorizontalTypesetter.m: Tweak glyph caching parameters to increase performance. 2003-04-01 Willem Rein Oudshoorn * Source/NSMenuView.m (NSMenuWindowTitleView): reformatted one line to conform to coding standards * Source/NSMenu.m: renamed ivar _changed to _needsSizing. ([NSMenu -sizeToFit]): Changed call [_view update] to [_view sizeToFit] ([NSMenu -displayTransient]): call [NSMenuView-update] to ensure that the menuView knows it belongs to a transient menu. ([NSMenu -closeTransient]): call [NSMenuView-update] to ensue that the menuView knows it is not transient anymore. * Headers/gnustep/gui/NSMenu.h: renamed ivar _changed to _needsSizing. 2003-04-01 Richard Frith-Macdonald * Source/NSApplication.m: ensure that application initialisation is performed in the main thread. 2003-03-31 Adam Fedor * Source/NSWindow.m (-becomeKeyWindow): Set initialFirstResponder. (-display): Remove this code from here. 2003-03-31 Adam Fedor * Source/NSButtonCell.m, Source/NSCell.m, Source/NSMenuItem.m: Add GSCategories.h 2003-03-30 19:14 Alexander Malmberg * Source/NSScroller.m (-trackKnob:): Wrap each iteration of the loop in an autorelease pool. * Source/NSTextView.m: Correct the name of the delegate method -textView:shouldChangeTextInRange:replacementString: (was missing the textView: part). 2003-03-30 Willem Rein Oudshoorn * Source/NSMenuView.m: Reformatted to comply to coding standards * Source/NSMenu.m: Reformatted to comply to coding standards 2003-03-28 21:08 Alexander Malmberg * Source/NSTableView.m (mouseDown:): Wrap each iteration of the mouse tracking loop in an autorelease pool to avoid using huge amounts of memory if the button is held down a long time. 2003-03-28 Serg Stoyan * Source/NSMenuView.m: (attachSubmenuForItemAtIndex:): Documentation comment moved to NSMenuView.h. (indexOfItemAtPoint:): ditto. (locationForSubmenu:): ditto. (trackWithEvent:): ditto. (setWindowFrameForAttachingToRect:): Removed "move menu to the screen" TODO since it is out of this method scope. * Headers/NSMenuView.m: Added documentation for almost all methods. Cleanup. 2003-03-27 23:52 Alexander Malmberg * Source/NSMatrix.m (-setSelectionFrom:to:anchor:highlight:): Update the selection related ivars after changing the selection. 2003-03-27 Serg Stoyan * Source/NSMenuView.m: ([NSMenuWindowTitleView createButton:]): Made imageSize an ivar and removed declaration. Made rect setting with NSMakeRect(). ([NSMenuWindowTitleView addCloseButton:]): Added button location update. (initWithFrame:): Title adding moved int update method. (setWindowFrameForAttachingToRect:): Title removing moved into update method. Call update instead sizeToFit. * Source/NSMenu.m: (initWithTitle:): Create NSMenuView with NSZeroRect frame. (insertItem:atIndex): removed [menu update] call, because itemChanged: calls it. (removeItemAtIndex:): ditto. (sizeToFit:): Added NSMenuView update. Removed [_view sizeToFit], beacuse [_view update] calls it. Don't set window's origin if size less than 1 (window is just created). (display): Removed [self update] call (sizeToFit calls it). Reformatting. Do not call setGeometry if menu is owned by popup. (close): Removed [self update] call. (closeTransient): ditto. 2003-03-18 Benhur Stein * Fix mouse tracking in NSMatrix * Headers/gnustep/gui/NSMatrix.h: Change _keyCell ivar to _reserved1. * Source/NSMatrix.m (-_setKeyRow:column:): New method (-_selectCell:atRow:column:): Use it. (-setSelectionFrom:to:anchor:highlight:): Rewrite. (-highlightCell:atRow:column:): Simplify (-_mouseDownNonListMode:): Fix tracking. (-_mouseDownListMode:theEvent): New method. (-mouseDown:): Use previous methods. 2003-03-25 Serg Stoyan * Source/NSMenuView.m (setWindowFrameForAttachingToRect:):Compute frame if number of items > 0 instead of > 1 (fixes size problem when there is 1 item in popup button's menu). (sizeToFit): optimized and fixed offsets calculation. * Source/NSMenuItemCell.m (imageRectForBounds:): removed pad adding between state image and title image and text, because [NSMenuView sizeToFit] does this. (titleRectForBounds:): ditto. 2003-03-25 Michael Hanni * Source/NSMenuView.m (-trackWithEvent:): reset highlighted items in a submenu that we leave for a supermenu. (setWindowFrameForAttachingToRect:): call sizeToFit only if cell's frame changed. 2003-03-24 Adam Fedor * Merge from 0.8.5 branch 2003-03-23 Serg Stoyan * Source/NSMenuView.m: Removed horizontal menu related code. (setHorizontal:): Removed. (isHorizontal:): Removed. (_addLeftBorderOffsetToRect): Removed isHorizontal parameter. (setMenu:): Place [self setNeedsSizing: YES] before [self update]. (update): Removed title view removal, because it's not always known owner of menu at this point. Remove title view creating. (sizeToFit:): Reformatting. (innerRect:): Idem. (setWindowFrameForAttachingToRect:onScreen:preferredEdge:popUpSelectedItem:): Title view removal code placed here, because this is only place where non-titled menu can appear. (initWithFrame:): Removed comment about _leftBorderOffset for popups, because we use _leftBorderOffset for regular and popups now. Title view creating added. (rectOfItemAtIndex:): Removed comment about _leftBorderOffset for popups. (indexOfItemAtPoint:): Idem. Add left border offset for popups too. Correct calling of _addLeftBorderOffsetToRect. (setNeedsDisplayForItemAtIndex:): Idem. (rightMouseDown:): Ddded comment. * Headers/NSMenuView.h (setHorizontal:): Removed. (isHorizontal:): Removed. 2003-03-22 Willem Rein Oudshoorn * Source/NSMenu.m ([NSMenu -display]): Added optimization of Michael Hanni to only resize menu view when actually displayed. ([NSMenu -setTitle:]): Idem ([NSMenu -sizeToFit:]): Fixed problem with jumping menus when items are added. ([NSMenu -display:]): added optimization of Michael Hanni to resize only once. Also fixed race condition bug in getting menu location. ([NSMenu -displayTransient]): Added optimization of M. Hanni, removed resetting position to (0, 0). * Source/NSMenuView.m (-initWithFrame:): Removed creation of titleView ([NSMenuView -setMenu:]): call update to handle new situation ([NSMenuView -update]): Removed call to _menu update, handle the adding/removing of the title view. ([NSMenuView -sizeToFit]): reformatted to conform to coding standard, handle missing titleView. ([NSMenuView -setWindowFrameForAttachingToRect:onScreen:preferredEdge:popUpSelectedItem:]): Reformatted to conform to coding standard. Removed the code that removed the titleView. That is handled by update. ([NSMenuView -drawRect:]): Reformatted to conform to coding standards. ([NSMenuWindowTitleView -init]): Reformatted to conform to coding standards. ([NSMenuWindowTitleView -dealloc]): new method to prevent leaking the close button. ([NSMenuWindowTitleView -titleSize]): Reformatted to conform to coding standard ([NSMenuWindowTitleView -drawRect:]): idem ([NSMenuWindowTitleView -mouseDown:]): idem ([NSMenuWindowTitleView -createButton]): idem 2003-03-20 David Ayers * Source/NSCell.m ([NSCell encodeWithCoder:]): Reinsert encoding of isContinuous to insure backward compatiblity of archives. 2003-03-20 Serg Stoyan * Source/NSMenuView.m (sizeToFit): Removed setting _leftBorderOffset to 0 for popup menus. Set menuBarHeight to title view height only if it's not popup menu. Added recalculation of key equivalent offset for popup menu. (setWindowFrameForAttachingToRect:onScreen:preferredEdge:popUpSelectedItem:): Remove title view. Take into account left top border while calculating screenFrame. (drawRect:): Draw left top dark gray border for all types of menus with NSDrawTiledRects(). 2003-03-19 Fred Kiefer * Headers/gnustep/gui/NSMenu.h Removed method [_rightMouseDisplay:] as this is now private. * Source/NSMenu.m Implemented [popUpContextMenu:withEvent:forView:] using [_rightMouseDisplay:]. * Source/NSApplication.m In [rightMouseDown:] use [popUpContextMenu:withEvent:forView:]. * Source/NSMenu.m In [sendEvent:] use [popUpContextMenu:withEvent:forView:]. 2003-03-19 Fred Kiefer * Source/NSBitmapImageRep.m In [imageUnfilteredFileTypes] add the tiff entries always to the front of the list. As the standard GNUstep images are in this format, this will speed up image loading. * Headers/gnustep/gui/NSCell.h Removed ivar is_continuous, this is now handled by the action mask. Decreased size of the image_position ivar. Added two more subclass ivar to reuse the freed space. Flagged all methods that are new in MacOSX and added a few more of this. * Source/NSCell.m Added new MacOSX methods [title], [setTitle:], [controlSize], [setControlSize:], [controlTint], [setControlTint:] and [highlightColorWithFrame:inView:]. Rewrote [isContinuous], [setContinuous:] and [trackMouse:...untilMouseUp:] to work via the _action_mask. 2003-03-18 Serg Stoyan * Source/NSMenuView.m ([NSMenuTitleView titleSize]): Added. ([NSMenuTitleView drawRect:]): Switch to using titleSize:. Declaration of attr variable moved to class declaration. ([NSMenuTitleView init]): Added to initialize attr variable. (sizeToFit): Count missed state image offset. Do not add padding when there's no key equivalent. Handle situations when tile view wider than menu items, when there's no menu items and so on. (Side efect: menu of application in Gorm resizes correctly while changing title, adding shorcut etc.). Using [NSMenuTitleView titleSize] now for correct determination of menu title's text width. 2003-03-17 Serg Stoyan * Source/NSMenuView.m (sizeToFit): 15 extra pixels added only for submenus. Extra _horizontalEdgePad removed. Made cleanup. (createButton): uses [NSButton setRefusesFirstResponder: YES] to avoid drawing dotted rectangle. * Images/common_Close.tiff: Changed to look and feel like WindowMaker's close button. * Images/common_CloseH.tiff: ditto. * Images/common_3DArrowDown.tiff: Corrected position of light and dark sides of triangle. 2003-03-17 Fred Kiefer * Source/NSControl.m Added method [acceptsFirstResponder], which asks the cell if it accepts first responder. Added [becomeFirstResponder] and [resignFirstResponder] that redraw if the cell may change apprearance. * Source/NSButton.m * Source/NSStepper.m Removed the method [acceptsFirstResponder] as NSControls version is now used. 2003-03-07 Willem Rein Oudshoorn * Source/NSMenu.m: ([-_updateUserDefaults:]) Do not store location for attached menus. * Source/NSMenuView.m ([NSMenuWindowTitleView -drawRect:]): Centre drawing of title instead of using fixed offset. 2003-03-07 Richard Frith-Macdonald * Source/NSMenu.m: ([-_updateUserDefaults:]) restore saved menu location functionality (was only working for torn off menus). * Source/NSWindow: ([-miniaturise:]) order the counterpart window in so that it gets drawn properly. 2003-03-06 Willem Rein Oudshoorn * Source/NSMenuView.m: Added NSMenuTitleView (moved from NSMenu). ([NSMenuView -detachSubmenu]): Removed setting highlighting. ([NSMenuView -attachSubmenuForItemAtIndex:]) added logging. ([NSMenuView -update]): Handle _titleView. ([NSMenuView -sizeToFit]): Take titleView into account ([NSMenuView -performActionWithHighlightingForItemAtIndex:]): restore old highlighting. ([NSMenuView -trackWithEvent:]): Rewritten. ([NSMenuView -mouseDown:]): Only restore menu position when needed. ([NSMenuView -rightMouseDown:theEvent]): On menus treat as ordinary mouse down to avoid rightclick menus on menus. * Source/NSMenu.m (NSView): Moved NSMenuWindowTitleView to NSMenuView. Added comments. Added -_updateUserDefaults:, -_menuMoved: methods to track moving menus. Renamed -_setTornOff: to -setTornOff:, -isFollowTransient to -isTransient. ([NSMenu -initWithTitle:]): Remove some old comments, remove reference to titleView, listen to window move notification and enqueued move notification. ([NSMenu -attachedMenu]): Adjusted for renamed ivar. ([NSMenu -sizeToFit]): Remove references to titleView ([NSMenu -setTornOff:]): Remove references to titleView, call update to NSMenuView instead. ([NSMenu -isPartlyOffScreen]): Do not depend in removed ivar. ([NSMenu -_performMenuClose:]): adjust to renamed methods, will force synchronization of userdefaults. ([NSMenu -displayTransient]): Removed references to _titleView, remember the highlighted index to restore with -closeTransient. ([NSMenu -close]): remove references to _titleview, use methods instead of relying on ivars. added call to update on menu representation. ([NSMenu -closeTransient]): Remove references to _titleView, restore highlighted index. Call update on menu representantation. ([NSMenu -shiftOnScreen]): Rewrote to move in x and y direction simultanuously. ([NSMenuWindowTitleView -acceptsFirstMouse:]): Removed useless code to set menuview for itemCells. * Headers/gnustep/gui/NSMenuView.h: added ivar _titleView. (moved from NSMenu). * Headers/gnustep/gui/NSMenu.h: Added NSMenuView protocol, added documentation to NSMenu class. (MSMenu): Removed ivar _titleView, _isPartlyOffScreen, added ivar _oldHighlightedIndex. Renamed method -isFollowTransient to -isTransient. Removed method -nestedCheckOffScreen 2003-03-05 17:07 Alexander Malmberg * Source/NSLayoutManager.m (-drawGlyphsForGlyphRange:atPoint:): Use the focused view as the control view instead of the text container's text view (it might not have one). 2003-03-03 19:26 Alexander Malmberg * Source/GSLayoutManager.m (-usedRectForTextContainer:): Don't add the extra line frag rect. * Source/NSTextView.m (-sizeToFit): Add the extra line frag rect when computing the size of the view. (-scrollRangeToVisible:): Reimplement using the new insertion point positioning methods. 2003-03-03 16:17 Alexander Malmberg * Source/GSHorizontalTypesetter.m (-layoutGlyphsInLayoutManager: inTextContainer:startingAtGlyphIndex:previousLineFragmentRect: nextGlyphIndex:numberOfLineFragments:): Change type of a variable holding a character index to int (was char, would overflow and break things). 2003-03-03 14:52 Alexander Malmberg * Headers/gnustep/gui/GSTypesetter.h, Source/GSTypesetter.m: Removed -relayoutGlyphsInLayoutManager:glyphRange:lineFragmentRect: textContainer:previousLineFragmentRect:. It was broken by design, and a working soft invalidation system is now in place. * Headers/gnustep/gui/GSLayoutManager.h, Source/GSLayoutManager.m: Add and implement -typesetter and -setTypesetter:. * Source/GSTextStorage.m (-setAttributes:range:): Handle zero-length attribute changes correctly. 2003-03-02 Ludovic Marcotte * Source/NSComboBoxCell.m: Modified so that we no longer retain the dataSource. This would create a retain loop and prevent anything using it to be released properly. 2003-03-01 Fred Kiefer * Source/NSTextView_actions.m Use method calls instead of some of the direct references to NSLayoutManager ivar. General clean up. * Source/NSApplication.m Added support to print a file in [finishLaunching]. Use safer way to call selector in [beginSheet:...contextInfo:]. * Source/GSSlideView.m In [drawRect:]use the frame of the view, not the given rect. 2003-02-26 17:09 Alexander Malmberg * Source/NSLayoutManager.m (-glyphRangeForBoundingRect:inTextContainer:): Fix the horizontal intersection checks. 2003-02-26 00:47 Alexander Malmberg * Source/GSLayoutManager.m (-_generateRunsToCharacter:): Optimize the run structure by merging with an existing run instead of creating a new run under some circumstances. 2003-02-25 17:38 Alexander Malmberg * Source/NSLayoutManager.m (-textStorage:edited:range:changeInLength:invalidatedRange:): Fix handling of trailing text containers when soft-invalidating. 2003-03-24 Adam Fedor * Version: 0.8.5 2003-03-24 Adam Fedor * Source/NSBox.m (-sizeToFit): Set frame to calculated size when content view has no subviews. 2003-03-18 17:54 Alexander Malmberg * Source/NSFont.m, Source/NSStringDrawing.m, Headers/gnustep/gui/NSStringDrawing.h: Change to an implementation that uses the text system. 2003-03-07 Richard Frith-Macdonald * Source/NSWindow: ([-miniaturise:]) order the counterpart window in so that it gets drawn properly. 2003-03-04 Adam Fedor * Headers/gnustep/gui/GMAppKit.h, GMArchiver.h, IMConnectors.h, IMCustomObject.h, IMLoading.h, NSNibConnector.h: Change #import to #include * Model/Controller.[h,m], GMAppKit.m, GMArchiveObjects.m, GMArchiver.m, IBClasses.[hm], IMConnectors.h, IMLoading.m, Translator.[hm], nib2gmodel.m, test.m: Idem. * Tools/gsnd/portaudio/pa_unix_oss/pa_unix_oss.c: Fixes for FreeBSD. 2003-02-24 Adam Fedor * Version: 0.8.4 2003-02-24 15:24 Alexander Malmberg * Source/GSLayoutManager.m (-invalidateGlyphsForCharacterRange: changeInLength:actualCharacterRange:): Set the next character index correctly after the run-merge optimization. 2003-02-24 03:49 Alexander Malmberg * Source/GSLayoutManager.m (-_glyphForCharacter:index:positions::): Fix handling of the case where the exact glyph is found during the binary search. * Source/NSLayoutManager.m (-drawBackgroundForGlyphRange:atPoint:): Check that a range has a background color before checking that there are rectangles for it (since ranges practically always have rectangles, and very rarely a background color). 2003-02-24 00:02 Alexander Malmberg * Source/NSParagraphStyle.m: Implement -isEqual: and -hash. 2003-02-23 13:30 Alexander Malmberg * Source/NSWindow (-update): Don't redisplay the window. 2003-02-22 Benhur Stein * Source/NSView.m (-displayIfNeededInRectIgnoringOpacity:): Disable and re-enable flushing here. (-displayRectIgnoringOpacity:): And here. * Source/NSWindow.m ([NSWindow -display]): Instead of here. ([NSWindow -update]): And here. 2003-02-23 01:59 Alexander Malmberg * Headers/gnustep/gui/GSLayoutManager_internal.h, Source/GSLayoutManager.m, Source/NSLayoutManager.m: Use num_linefrags to tell whether layout has started for a text container or not, instead of tracking the status separately. 2003-02-22 12:29 Alexander Malmberg * Source/NSApplication.m (-sendEvent:): Only bring up the main menu if the there is no window for the event. * Source/NSPopUpButton.m: Implement -menuForEvent: to always return nil to indicate that we don't have a context menu. 2003-02-22 02:34 Alexander Malmberg * Headers/gnustep/gui/GSLayoutManager.h: Declare -layoutManager:didCompleteLayoutForTextContainer:atEnd: so it's visible (to gcc and to delegate implementers). * Source/GSHorizontalTypesetter.m, Source/NSLayoutManager.m: Make sure the extra line frag is always set when we reach the end (ie. even after soft-invalidated layout information has been used up to the end). 2003-02-21 Serg Stoyan * Source/NSApplication.m (-activateIgnoringOtherApps:): Remove main menu display. (-sendEvent:): Check first if right button down. (-setMainMenu:): Don't set menu title. Remove menu display. * Source/NSMenu.m (-init): Default title is process name. (-initWithTitle:): Observe NSApplicationWillBecomeActiveNotification. (_showOnActivateApp:): New. (-display): Set geometry only if not set. (-setGeometry): New. * Source/NSPopUpButton.m (-mouseDown:): Send event to NSApp. 2003-02-19 Adam Fedor * Source/NSPrintOperation.m (-_print): Remove locale change (now handled correctly in backend stream context. * Source/NSScrollView.m (-initWithFrame:): Change default border to none. 2003-02-19 15:06 Alexander Malmberg * Headers/gnustep/gui/GSLayoutManager_internal.h, Source/GSLayoutManager.m: Optimize run_for_glyph_index() by caching the last run. Optimize allocation of line frags. * Source/NSLayoutManager.m (-textStorage:edited:range:changeInLength:invalidatedRange:): Fix clearing of soft-invalidated information if there's an invalidation and we don't have layout past the invalidated range. 2003-02-19 03:09 Alexander Malmberg * Source/GSLayoutManager.m (-_glyphForCharacter:index:positions::): Use binary search to find the index of the character in the run. (-setLocation:forStartOfGlyphRange:): Start the search for the line frag from the back, as the line frag we're searching will often be the last one (always with GSHorizontalTypesetter). 2003-02-19 00:31 Alexander Malmberg * Headers/gnustep/gui/GSLayoutManager.h, Source/GSHorizontalTypesetter.m, Source/GSLayoutManager.m: Optimize reuse of soft-invalidated layout a bit in a common case. 2003-02-19 00:10 Alexander Malmberg * Source/GSLayoutManager.m (-invalidateGlyphsForCharacterRange: changeInLength:actualCharacterRange:): Correct the condition for splitting the initial run. 2003-02-18 21:24 Alexander Malmberg * Headers/gnustep/gui/GSLayoutManager.h, Source/GSLayoutManager.m: Add basic interface that lets the typesetter access soft-invalidated layout information. * Source/GSHorizontalTypesetter.m (-layoutLineNewParagraph:): Use the soft-invalidated information to avoid rebuilding the layout (when possible). * Source/NSLayoutManager.m: Fix edge case in soft invalidation. 2003-02-18 Fred Kiefer * TextConverters/RTF/RTFProducer.m [colorTable] corrected the output of the colour table, by using a C array instead of an NSMutableArray. * TextConverters/RTF/RTFConsumer.m GSRTFcolorfg(), GSRTFcolorbg(), GSRTFlineSpace(), GSRTFspaceAbove() set the state of the context to changed, so that new attributes get used. 2003-02-18 18:03 Alexander Malmberg * Headers/gnustep/gui/GSLayoutManager_internal.h, Source/GSLayoutManager.m, Source/NSLayoutManager.m: Implement handling of soft-invalidated line frags. Soft-invalidate layout information for glyphs after an edited range in NSLayoutManager. 2003-02-18 01:23 Alexander Malmberg * Headers/gnustep/gui/GSLayoutManager_internal.h, Source/GSLayoutManager.m: Many minor cleanups and optimizations. Much commenting. * Source/GSHorizontalTypesetter.m (-layoutGlyphsInLayoutManager: inTextContainer:startingAtGlyphIndex:previousLineFragmentRect: nextGlyphIndex:numberOfLineFragments:): Determine the initial value for newParagraph correctly. * Source/NSLayoutManager.m (-textStorage:edited:range:changeInLength:invalidatedRange:): Don't invalidate all layout on each change. Now, all layout information for glyphs before the change will be reused. (Layout for glyphs after the change is still invalidated, until I finish the soft invalidation.) * Source/GSTextStorage.m (-setAttributes:range:): Call -edited:range:changeInLength: with the range that was changed (and not the range attributes could be merged for). 2003-02-17 21:25 Alexander Malmberg * Headers/gnustep/gui/GSLayoutManager.h, Headers/gnustep/gui/GSLayoutManager_internal.h, Source/GSLayoutManager.m (-invalidateGlyphsForCharacterRange: changeInLength:actualCharacterRange:): Set the prev pointer correctly when splitting a run. Add sanity checks to catch try to catch glyph structure corruption early. (-textStorage:edited:range:changeInLength:invalidatedRange:): Clean up layout invalidation. 2003-02-17 02:16 Alexander Malmberg * Headers/gnustep/gui/GSLayoutManager.h, Source/GSLayoutManager.m: Add some framework support for caching the last accessed run. 2003-02-17 02:08 Alexander Malmberg * Source/NSLayoutManager.m (-rectArrayForGlyphRange: withinSelectedGlyphRange:inTextContainer:rectCount:, -_insertionPointRectForCharacterIndex:textContainer:, -drawGlyphsForGlyphRange:atPoint:): Optimize by using a binary instead of linear search for the line frag. More cleanups and comments. 2003-02-16 22:37 Alexander Malmberg * Source/NSLayoutManager.m: Commenting and cleanups. (-glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:): Handle the case where the point is on a line, but not inside a line frag rect, better. 2003-02-16 17:48 Alexander Malmberg * Headers/gnustep/gui/GSHorizontalTypesetter.h, Source/GSHorizontalTypesetter.m: Store the line frags array as an ivar instead of allocating and freeing it everytime -layoutLineNewParagraph: is called. 2003-02-16 15:51 Alexander Malmberg * Source/NSLayoutManager.m: Bring back the old implementation of -rulerMarkersForTextView:paragraphStyle:ruler:. Sun Feb 16 14:54:50 2003 Nicola Pero * Source/NSSplitView.m ([-mouseDown:]): Corrected offset used in delegate calls. For example, in a splitview with a single divider, the offset used was 1, while it should be 0. 2003-02-16 Richard Frith-Macdonald * Source/NSMenu.m: Upon creation of bWindow, set its level to pop up window level, so right click brings up the menu above panels etc. Sun Feb 16 04:13:46 2003 Nicola Pero * Source/NSSplitView.m ([-mouseDown:]): Fixed calling delegate method to constrain split position. Patch By Enrico Sersale, with changes. 2003-02-16 04:14 Alexander Malmberg * Headers/gnustep/gui/GSLayoutManager.h, Source/GSLayoutManager.m: Add methods for setting and getting the extra line fragment information. * Source/GSHorizontalTypesetter.m (-layoutLineNewParagraph:): Set the extra line fragment information as required. * Source/NSLayoutManager.m: Use the extra line fragment information to position the insertion point properly when it's placed after the last character in the text. 2003-02-15 18:22 Alexander Malmberg * Headers/gnustep/gui/NSTextView.h, Source/NSLayoutManager.m, Source/NSTextView.m: Change the way the text view is told about layout invalidation. Change NSTextView to update its state as late as possible before displaying, and make sure it's updated when it's resized. 2003-02-15 18:11 Alexander Malmberg * Source/NSParagraphStyle.m ([NSMutableParagraphStyle -copyWithZone:]): Add calls to GSDebugAllocationAdd/ GSDebugAllocationRemove when swizzling the class to keep the allocation counts valid. 2003-02-15 18:04 Alexander Malmberg * Source/NSSpellChecker.m (-_launchSpellCheckerForLanguage:): Don't printf-expand the error message twice (might cause a crash if 'language' contains a "%"). Sat Feb 15 13:26:03 2003 Nicola Pero * Headers/gnustep/gui/AppKit.h: Include NSRulerView.h and NSRulerMarker.h, reported missing by Benhur Stein. 2003-02-14 17:47 Alexander Malmberg * Headers/gnustep/gui/NSTextView.h, Source/NSTextView.m, Source/NSTextView_actions.m: Keep track of the original index of a sequence of moves in one dimension. Pass it to the layout manager when moving the insertion point to prevent drifting. * Source/GSHorizontalTypesetter.m (-layoutLineNewParagraph:): Fix an edge case in tab handling. Also, if tabs occur and the paragraph style has no more tab stops, act as if there were tabs every 100 points. * Source/NSLayoutManager.m (-characterIndexMoving:fromCharacterIndex: originalCharacterIndex:distance:): When moving vertically, return the index of the character nearest the target horizontally. 2003-02-13 01:01 Alexander Malmberg * TextConverters/RTF/rtfGrammer.y (rtfCharset): Treat unknown character sets as ANSI. TextConverters/RTF/rtfGrammer.tab.c, TextConverters/RTF/rtfGrammer.tab.h: Regenerate. * TextConverters/RTF/RTFConsumer.m: Fix handling of the indentation control words: \fi, \li, and \ri. (GSRTFmangleText): Set the paragraph style attribute to a copy of the working NSMutableParagraphStyle so later changes won't affect the attributes of this text. 2003-02-13 00:52 Alexander Malmberg * Source/GSHorizontalTypesetter.m (-layoutLineNewParagraph:): Implement basic handling of tabs. 2003-02-12 Fred Kiefer * Source/GSSlideView.h * Source/GSSlideView.m Moved over from X11 backend. * Source/GNUmakefile Added new file GSSlideView.m. * Source/GSDisplayServer.m Use GSSlideView to implement image sliding. 2003-02-11 17:53 Alexander Malmberg * Source/NSScrollView.m (-setBorderType:): Call -tile to make the change visible. * Source/NSBrowser.m (-_createColumn): Set the border of the created scroll view explicitly. 2003-02-11 16:33 Alexander Malmberg * Source/NSAttributedString.m (-fixAttachmentAttributeInRange:): Update end index when a character is deleted. * Source/NSTextStorage.m (-processEditing): Make sure we always give a valid range and delta to the layout managers. * Source/NSTextView.m (-setSelectedRange:affinity:stillSelecting:): Clamp the selected range to the text storage's length. 2003-02-10 Richard Frith-Macdonald * Source/NSBrowser.m: Rewrote and documented the ([-setPath:]) method to fix the distinction between absolute and relative paths and to improve performance somewhat. 2003-02-10 15:14 Alexander Malmberg Based on patches from Jeff Teunissen: * Source/NSWindow.m (GSAllWindows): Check that windowmaps isn't NULL before calling NSAllMapTableValues. * Source/NSScroller.m: Change size check so the knob and arrows are visible until there's absolutely no space left for them. Draw the knob slot with the window's background color when the knob isn't visible for consistency with OPENSTEP. * Source/NSApplication.m (-setApplicationIconImage:): Update all windows that have the old app icon as their mini window image so they use the new app icon. 2003-02-10 15:09 Alexander Malmberg * Source/GSLayoutManager.m, Source/NSLayoutManager.m, Source/NSTextView.m: Many minor bug and behavior fixes to get the text system to work with several text containers attached to one layout manager. 2003-02-09 21:08 Alexander Malmberg * Source/GSLayoutManager.m: Clean up old debugging code, whitespace, and error handling. (-_doLayout): Track next glyph index correctly if we have multiple text containers. * Source/NSLayoutManager.m (-rectArrayForGlyphRange: withinSelectedGlyphRange:inTextContainer:rectCount:, -_insertionPointRectForCharacterIndex:textContainer:): Fix handling of glyphs that aren't nominally spaced. 2003-02-09 18:34 Alexander Malmberg * Source/GSHorizontalTypesetter.m (-breakLineByWordWrappingBefore:): Return correct index when breaking at a control glyph. 2003-02-09 18:02 Alexander Malmberg * Headers/gnustep/gui/GSLayoutManager_internal.h, Source/GSLayoutManager.m, Source/NSLayoutManager.m: Add -_didInvalidateLayout method that is called whenever any layout information has been invalidated. Use it in NSLayoutManager to resize text views. 2003-02-09 15:23 Alexander Malmberg * Source/NSTextView_actions.m: Fix several movement actions (used to move from the wrong end of the selected range, or mixed glyphs and characters). 2003-02-09 14:48 Alexander Malmberg * Source/GSHorizontalTypesetter.m: Make the main method reentrant by having it allocate a temporary instance to handle calls when it is already in use. 2003-02-09 Fred Kiefer * Source/NSColorList.m [_loadAvailableColorLists] check if a directory exists before looking for a colour list in it. 2003-02-08 22:56 Alexander Malmberg * Source/NSTextView_actions.m (-lowerBaseline:): Change the correct attribute. (-turnOffLigatures:, -useStandardLigatures:): Correct the attribute changes. 2003-02-08 22:53 Alexander Malmberg * Source/GSFontInfo.m (-defaultLineHeightForFont), Source/GSHorizontalTypesetter.m (-layoutLineNewParagraph:): Improve calculation of line height and make it match the baseline calculation when typesetting. 2003-02-08 22:29 Alexander Malmberg * Source/NSWindow.m (-sendEvent:): On right mouse down, check if the view that is hit has a pop-up menu, and if so, display it instead of sending the event to the view. Based on patch from Matt Rice. 2003-02-08 17:51 Alexander Malmberg * Headers/gnustep/gui/NSLayoutManager.h, Source/NSLayoutManager.m: Add -characterIndexMoving:fromCharacterIndex:originalCharacterIndex: distance: method. * Source/NSTextView.m: Keep track of the selection affinity. * Source/NSTextView_actions.m: Use the new method and affinity handling to reimplement the insertion point movement actions. 2003-02-07 17:47 Alexander Malmberg * Source/GSTextStorage.m (-setAttributes:range:): Fix memory leak. 2003-02-05 Richard Frith-Macdonald * Source/libgnustep-gui.def: Regenerated * ColorPickers/GNUmakefile: add local library paths * Source/GSLayoutManager.m: Use rand() rather than random() as it is portable to mingw32. Wed Feb 5 04:56:45 2003 Serg Stoyan * Source/NSMenuItemCell.m ([-drawKeyEquivalentWithFrame:inView:]): Do not draw the key equivalent if we are owned by a popup, and are drawing the small popup image. Wed Feb 5 04:42:16 2003 Serg Stoyan * Source/NSPrintOperation.m ([-_printOperationDidRun:success: contextInfo:]): Fixed calling the delegate method. 2003-02-03 02:49 Alexander Malmberg * Headers/gnustep/gui/NSLayoutManager.h, Source/NSLayoutManager.m: Add -insertionPointRectForCharacterIndex:inTextContainer: method. * Source/NSTextView.m (-updateInsertionPointStateAndRestartTimer:): Use it. 2003-02-02 Fred Kiefer * Source/NSTextField.m Only accept first mouse when editable. 2003-02-02 02:31 Alexander Malmberg * Source/NSTextView.m, Source/NSTextView_actions.m: Clarify comments about user attribute changing now that I've figured out a way for it to work. Rewrite the actions to match. 2003-02-02 Fred Kiefer * Source/NSWindow.m Rewrote all the toolbar methods. Implemented [zoom:]. Extracted new method [_terminateBackendWindow] from [dealloc] and use it to implement one shot windows in the orderOut case of [orderWindow:relativeTo:]. Removed frame restriction from [setFrameFromString:] as this gets done in [setFrame:display:]. Use [NSScreen visibleFrame] here and in [stringWithSavedFrame]. Implemented [cascadeTopLeftFromPoint:]. Removed unused and empty methods [performHide:] and [performUnhide:]. 2003-02-01 15:09 Alexander Malmberg * Source/NSTextView.m (-shouldChangeTextInRange:replacementString:): Allow changes even if we're not the first responder. (-didChangeText): If we're not the first responder, end the editing session. 2003-02-01 13:52 Alexander Malmberg * Source/GSHorizontalTypesetter.m (-layoutLineNewParagraph:): Fix sign problem with descender. Sat Feb 1 05:34:09 2003 Benhur Stein , Nicola Pero The focus is now expected to have been locked on the control view before cell's drawXXXWithFrame:inView: and similar methods are called. This makes drawing much more efficient. * Source/NSApplication.m ([NSAppIconView -setImage:]): Lock/unlock focus if it can draw. * Source/NSBrowser.m ([GSBrowserTitleCell -drawWithFrame:inView:]): Do not lock/unlock focus. ([-displayColumn:]): Lock/unlock focus before drawing. ([-doClick:]): Lock/unlock focus. * Source/NSBrowserCell.m ([-drawInteriorWithFrame:inView:]): Do not lock/unlock focus. * Source/NSButtonCell.m ([-drawWithFrame:inView:]): Do not lock/unlock focus. ([-drawInteriorWithFrame:inView:]): Do not lock unlock focus. * Source/NSCell.m ([-drawInteriorWithFrame:inView:]): Do not lock/unlock focus. ([-drawWithFrame:inView:]): Do not lock/unlock focus. ([-performClick:]): Lock/unlock focus. * Source/NSComboBoxCell.m ([-_didClickInRect:ofView:]): Lock/unlock focus. * Source/NSControl.m ([-mouseDown:]): Lock/unlock focus. * Source/NSFormCell.m ([-drawWithFrame:inView:]): Do not lock/unlock focus. * Source/NSImageCell.m ([-drawInteriorWithFrame:inView:]): Do not lock/unlock focus. ([-drawWithFrame:inView:]): Do not lock/unlock focus. * Source/NSMatrix.m ([-deselectAllCells]): Mark the cell as needing redisplay, but do not redraw immediately. ([-_selectCell:atRow:column:]): Same change. ([-setSelectionFrom:to:anchor:highlight:]): Same change. ([-highlightCell:atRow:column:]): Lock/unlock focus. ([-_mouseDownNonListMode:]): Lock/unlock focus, flush window, select cell better. ([-mouseDown:]): Lock/unlock focus; removed 2 flush windows. ([-performKeyEquivalent:]): Lock/unlock focus; flush window. ([-_altModifier:]): Added a displayIfNeeded call. ([-keyDown:]): Same change. ([-_move:]): Always deselect all cells in before selecting new ones. Do not display cell immediately, but mark it for redisplay. Removed a few flush windows. Commented out unclear code. ([-_shiftModifier:]): Lock/unlock focus. ([-_setState:highlight:startIndex:endIndex:]): Do not flush the window. ([_setState:highlight:startIndex:endIndex:]): Do not display the cell directly; mark it as needing redisplay. ([-drawCellAtRow:column:]): Do not lock/unlock focus. ([-highlightCell:atRow:column:]): Do not lock/unlock focus. ([-_drawCellAtRow:column:]): Do not lock/unlock focus. * Source/NSMenuItemCell.m ([-drawBorderAndBackgroundWithFrame:inView:]): Do not lock/unlock focus. ([-drawInteriorWithFrame:inView:]): Do not lock/unlock focus. * Source/NSOutlineView.m ([-editColumn:columnIndexrow:rowIndexwithEvent:theEventselect:flag]): Lock/unlock focus. * Source/NSPopUpButtonCell.m ([-drawInteriorWithFrame:inView:]): Do not lock/unlock focus. * Source/NSScroller.m ([-trackScrollButtons:]): Lock/unlock focus. * Source/NSSlider.m ([-mouseDown:]): Lock/unlock focus. ([-trackKnob:knobRect:]): Lock/unlock focus. * Source/NSSliderCell.m ([-drawInteriorWithFrame:inView:]): Do not lock/unlock focus. * Source/NSStepper.m ([-mouseDown:]): Lock/unlock focus. * Source/NSStepperCell.m ([-drawInteriorWithFrame:inView:]): Do not lock/unlock focus. ([-highlight:highlightupButton:upButtonwithFrame:frameinView: controlView]): Do not lock/unlock focus. * Source/NSTextFieldCell.m ([-drawInteriorWithFrame:inView:]): Do not lock/unlock focus. * Source/NSTableHeaderCell.m ([-drawInteriorWithFrame:inView:]): Do not lock/unlock focus. ([-drawWithFrame:inView:]): Do not lock/unlocks focus. * Source/NSTableHeaderView.m ([-drawRect:]): Do not lock/unlock focus while drawing. ([-mouseDown:]): Lock/unlock focus. * Source/NSWindow.m ([NSMiniWindowView -setImage:, -setTitle:]): Lock focus if can draw rather than checking _window != nil. 2003-02-01 03:26 Alexander Malmberg * Source/GSLayoutManager.m (-removeTextContainerAtIndex:): Set textcontainers to NULL after freeing it. Clean up some other malloc-stuff. * Source/NSTextContainer.m (-replaceLayoutManager:): Remove the containers from the correct layout manager. 2003-01-31 Fred Kiefer * Headers/AppKit/GSDisplayServer.h New interface [restrictWindow:toImage:]. * Source/GSDisplayServer.m Empty implementation for this. 2003-01-31 23:20 Alexander Malmberg * Source/GSLayoutManager.m (-_generateGlyphsForRun:at:): Add handling of NSAttachmentCharacter. 2003-01-31 21:59 Alexander Malmberg * Headers/gnustep/gui/GSLayoutManager.h, Headers/gnustep/gui/GSLayoutManager_internal.h, Source/GSLayoutManager.m: Implement [GSLayoutManager -setAttachmentSize:forGlyphRange:]. * Source/NSLayoutManager.m (-drawGlyphsForGlyphRange:atPoint:): Implement drawing of attachments. * Headers/gnustep/gui/NSFont.h: Add GSAttachmentGlyph to mark attachments in a glyph context. * Source/GSHorizontalLayoutManager.m: Cleanups and comments. (-layoutLineNewParagraph:): Rewrite line height and baseline handling. Implement typesetting of attachments. * Headers/gnustep/gui/NSTextAttachment.h: Add documentation. * Source/NSTextAttachment.m (-cellFrameForTextContainer: proposedLineFragment:glyphPosition:characterIndex:): Return the correct position. Thu Jan 30 16:31:16 2003 Nicola Pero * Source/GNUmakefile (NSMenuItem.m_FILE_FLAGS): Use -Wno-protocol when compiling NSMenuItem.m Thu Jan 30 16:19:56 2003 Nicola Pero * TextConverters/RTF/RTFConsumer.m ([RTFConsumer +parseData:documentAttributes:]): Method removed. ([RTFConsumer +parseFile:documentAttributes:]): Method removed. ([RTFDConsumer +parseData:documentAttributes:class:]): New method, replacing +parseData:documentAttribute:. Thu Jan 30 05:12:21 2003 Serg Stoyan * Headers/gnustep/gui/NSMenuItem.h: NSMenuItem protocol conforms to NSObject protocol. * Source/NSBundleAdditions.m ([-instantiateObject:]): Added missing cast. * Source/NSImage.m ([-dissolveToPoint:fromRect:fraction:]): Added missing variable initializer. ([-_bestRep:withBpsMatch:]): The same. * Source/NSImageRep.m ([-drawAtPoint:]): Added missing variable initializer. * Source/NSSplitView.m ([-mouseDown:]): The same. * Source/NSStringDrawing.m (drawRun): Fixed compiler warning. * Source/NSTableHeaderCell.m ([-setHighlighted:flag]): New method. * Source/NSTableHeaderView.m ([-drawRect:]): Removed calls to setBackgroundColor:. ([-mouseDown:]): Use setHighlighted:, not setBackgroundColor:, to highlight a header cell. * Source/NSTableView.m ([-mouseDown:]): Added missing variable initializer. * Headers/gnustep/gui/NSView.h: Added declaration of lockFocusInRect: * Source/NSView.m ([-lockFocusInRect:]): Added missing variable initializer. * Source/NSWindow.m: Include NSToolbar.h Thu Jan 30 04:55:12 2003 Nicola Pero * Headers/gnustep/gui/NSToolbar.h: Declaration of GNUstepPrivate category moved here from NSToolbar.m. * Source/NSToolbar.m: Removed GNUstepPrivate category @interface. * Source/NSWindow.m ([-setToolbar:]): Added missing cast. Thu Jan 30 04:39:47 2003 Nicola Pero * Source/NSWindowController.m ([-dealloc]): Release the window, do not autorelease it. Thu Jan 30 03:57:42 2003 Serg Stoyan * Source/NSMenuView.m ([-sizeToFit]): Removed the additional 17 pixels from menu view title size, they have no reason to be used, and don't look good. Thu Jan 30 02:55:17 2003 Nicola Pero * Source/NSScrollView.m ([-scrollPageDown:], [-scrollPageUp:]): Do not mark rulers as needing redisplay. ([-scrollWheel:]): Do not scroll header view; do not mark rulers as needing redisplay. Thu Jan 30 02:51:49 2003 Benhur Stein * Source/NSScrollView.m ([-_doScroll:]): Do not scroll header view; do not mark rulers as needing redisplay. ([-reflectScrolledClipView:]): Mark the rulers as needing redisplay. Do not constrain the scrollpoint of the header view. 2003-01-29 21:14 Alexander Malmberg * Source/GSLayoutManager.m (-setTextStorage:): Tell our text containers about the change. * Source/NSTextContainer.m (-setLayoutManager:): Tell our text view about the change. * Source/NSTextView.m: Guard in a few places where _layoutManager might be nil. 2003-01-29 16:01 Alexander Malmberg * Source/GSHorizontalTypesetter.m (-layoutLineNewParagraph:): Place baseline higher (in relation to the line height). * Source/NSLayoutManager.m (-textStorage:edited:range:changeInLength: invalidatedRange:): Fix selection range adjustment when the entire selection is removed. 2003-01-29 01:40 Alexander Malmberg * Headers/gnustep/gui/NSTextView.h, Source/NSTextView.m: Implement basic drawing of insertion point. 2003-01-28 Fred Kiefer * TextConverters/RTF/RTFConsumer.m In [copyWithZone:] use mutable copy of prargraph style. 2003-01-28 23:29 Alexander Malmberg * Source/NSTextView.m (-setConstrainedFrameSize:) Fix calculation of the effective minimum size. (-sizeToFit): Use maximum x and y of used rect to calculate size, not the used rect's own size. 2003-01-28 22:54 Alexander Malmberg * Source/NSLayoutManager.m (-textStorage:edited:range:changeInLength: invalidatedRange:): Add code to adjust the selected range after each change. 2003-01-28 22:20 Alexander Malmberg * Source/NSTextView.m (-initWithFrame:textContainer:): Make the default text container inset (2,0). 2003-01-28 20:02 Alexander Malmberg * Source/GSHorizontalTypesetter: Set proper used rect for line frag rects. * Source/GSLayoutManager.m (-usedRectForTextContainer:): Return sane value if there are no line frag rects in the text container. 2003-01-28 17:55 Alexander Malmberg * Source/GSLayoutManager.m (-layoutLineNewParagraph:): Try to make sure each container gets at least one line frag rect. * Source/NSTextView: Avoid making calls to the layout manager with invalid arguments. 2003-01-28 17:40 Alexander Malmberg * Source/GSHorizontalTypesetter.m, Source/GSLayoutManager.m: Whitespace cleanups and comments. * Source/NSLayoutManager.m: (-rectArrayForGlyphRange: withinSelectedGlyphRange:inTextContainer:rectCount:): Give better error message for an invalid glyph range. 2003-01-27 16:13 Alexander Malmberg * Source/NSLayoutManager.m (-setHyphenationFactor:): Fix format string. * Source/NSTextView.m (-mouseDown:): Handle empty text views. (-drawRect:): Always draw glyphs' backgrounds (even when not drawing the text view's background). Mon Jan 27 04:01:32 2003 Nicola Pero * Source/NSScroller.m ([-mouseDown:]): When the knob slot if clicked, do not set the new float value and send the action if the float value has not changed. Mon Jan 27 03:16:22 2003 Benhur Stein Patch with minor changes by Nicola: * Source/NSScroller.m ([-testPart:]): The point to test is now assumed to be in the window's coordinates. ([-mouseDown:], [-trackScrollButtons:]): Updated calls to -testPart:. ([-drawArrow:highlight:]): Highlight the cell according to the argument. ([-trackKnob:]): Do not set the new float value and send the action if the float value has not changed. Mon Jan 27 01:21:11 2003 Nicola Pero * Source/GSLayoutManager.m (GET_GLYPH): Removed argument, and updated all callers, to get it to compile. 2003-01-27 00:01 Alexander Malmberg * Source/NSLayoutManager.m (-drawBackgroundForGlyphRange:atPoint:): Draw background for the selected range. 2003-01-26 21:16 Alexander Malmberg * Source/NSLayoutManager.m (-textStorage:edited:range:changeInLength:invalidatedRange:): Tell the text views to resize when their text has changed. 2003-01-26 21:08 Alexander Malmberg * Source/NSLayoutManager.m (-glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:): Try harder to always return a valid glyph index. 2003-01-26 20:41 Alexander Malmberg * Headers/gnustep/gui/NSTextView.h: Don't use protocol forward declarations. 2003-01-26 20:35 Alexander Malmberg * Source/NSTextView.m: Make sure the typing attributes are always a mutable dictionary we can modify. 2003-01-26 20:30 Alexander Malmberg * Source/NSCell.m: Add missing includes. 2003-01-26 20:24 Alexander Malmberg * Headers/gnustep/gui/NSMenu.h: Add missing class declaration so the header is self-contained. 2003-01-26 19:17 Alexander Malmberg * Headers/gnustep/gui/GSFontInfo.h, Headers/gnustep/gui/NSFont.h, Headers/gnustep/gui/NSLayoutManager.h, Headers/gnustep/gui/NSText.h, Headers/gnustep/gui/NSTextContainer.h, Headers/gnustep/gui/NSTextStorage.h, Headers/gnustep/gui/NSTextView.h, Source/GNUmakefile, Source/GSFontInfo.m, Source/GSTextStorage.m, Source/NSFont.m, Source/NSLayoutManager.m, Source/NSParagraphStyle.m, Source/NSSecureTextField.m, Source/NSText.m, Source/NSTextContainer.m, Source/NSTextStorage.m, Source/NSTextView.m, Headers/gnustep/gui/GSHorizontalTypesetter.h, Headers/gnustep/gui/GSLayoutManager.h, Headers/gnustep/gui/GSLayoutManager_internal.h, Headers/gnustep/gui/GSTypesetter.h, Source/GSHorizontalTypesetter.m, Source/GSLayoutManager.m, Source/GSTypesetter.m, Source/NSTextView_actions.m: Merge in text-system-branch with the new implementation of the text system. 2002-12-13 02:00 Alexander Malmberg * Headers/gnustep/gui/NSText.h, Headers/gnustep/gui/NSTextView.h, Source/NSText.m, Source/NSTextView.m: Moved ivars from NSText to NSTextView. Added or updated documentation for many methods. Marked primitive and non-openstep methods. * Source/GSHorizontalTypesetter.m, Source/GSLayoutManager.m, Source/GSTextStorage.m, Source/NSTextContainer.m, Source/NSTextStorage.m: Cleaned up includes. 2002-12-01 13:27 Alexander Malmberg * Headers/gnustep/gui/GSLayoutManager_internal.h, Source/GSLayoutManager.m: Clean ups. Remove some old stuff. Add some more comments. 2002-11-26 16:37 Alexander Malmberg * Headers/gnustep/gui/GSTypesetter.h, Source/GSTypesetter.m, Source/GSHorizontalTypesetter.m: Remove -baselineOffsetInLayoutManager:glyphIndex: method. Cleanups. Changed to conform to coding standards. 2002-11-26 16:29 Alexander Malmberg * Source/NSLayoutManager.m: Changed to conform to coding standards. Cleanups. 2002-11-26 15:41 Alexander Malmberg * Headers/gnustep/gui/GSLayoutManager_internal.h, Source/GSLayoutManager.m: Changed to conform to coding standards. Cleanups. Moved some more NSTextView references to NSLayoutManager. Use _run_cache_attributes::, _run_copy_attributes::, and _run_free_attributes: methods instead of functions. (-_run_cache_attributes::): Ask typesetter for font to use and call -substituteFontForFont:. * Source/NSLayoutManager.m: Moved NSTextView references here. 2002-11-26 12:52 Alexander Malmberg * Headers/gnustep/gui/GSFontInfo.h, Headers/gnustep/gui/NSFont.h, Source/GSFontInfo.m, Source/NSFont.m: Add proper handling of screen/printer fonts. Changes the backend GSFontInfo interface. 2002-11-24 20:58 Alexander Malmberg * Headers/gnustep/gui/NSMenu.h: Declare NSMutableArray. 2002-11-24 01:10 Alexander Malmberg * Source/NSSpellChecker (-_launchSpellCheckerForLanguage:): Don't pass the error message through printf expansion twice. 2002-11-24 00:56 Alexander Malmberg * Source/GSFontInfo.m (-defaultLineHeightForFont): Round the linegap to whole points. 2002-11-23 22:55 Alexander Malmberg * Source/NSSecureTextField: Update to work with new text system. 2002-11-23 22:30 Alexander Malmberg * Headers/gnustep/gui/NSTextContainer.h, Headers/gnustep/gui/NSTextStorage.h Source/NSTextStorage.m: Use GSLayoutManager instead of NSLayoutManager in these classes. 2002-11-23 21:40 Alexander Malmberg * Source/NSParagraphStyle ([NSMutableParagraphStyle -copyWithZone:]): Implement. 2002-11-23 21:31 Alexander Malmberg * Headers/gnustep/gui/GSHorizontalTypesetter.h, Headers/gnustep/gui/GSLayoutManager.h, Headers/gnustep/gui/GSLayoutManager_internal.h, Headers/gnustep/gui/GSTypesetter.h, Source/GSHorizontalTypesetter.m, Source/GSLayoutManager.m, Source/GSTypesetter.m, Headers/gnustep/gui/NSLayoutManager.h, Source/GNUmakefile, Source/NSLayoutManager.m: Add the new text system. 2002-11-23 18:45 Alexander Malmberg * Source/NSTextContainer: Implement -lineFragmentRectForProposedRect: sweepDirection:movementDirection:remainingRect:. 2003-01-26 18:54 Alexander Malmberg * Headers/gnustep/gui/NSParagraphStyle.h, Headers/gnustep/gui/NSTextStorage.h, Source/NSParagraphStyle.m, Source/NSTextAttachment.m: Clean up the includes. 2003-01-26 18:46 Alexander Malmberg * Headers/gnustep/gui/NSGraphics.h, Headers/gnustep/gui/NSGraphicsContext.h, Source/NSGraphicsContext, Source/NSWindow.m: Clean up some prototypes. 2003-01-20 Adam Fedor * Headers/gnustep/gui/NSImage.m (NSImageCacheMore): New enum and ivar. * Source/NSImage.m (-setCacheMode:): New method. (-cacheMode): Idem. (-compositeToPoint:fromRect:operation:): If printing, composite from source image, not cache. (-dissolveToPoint:fromRect:fraction:): Idem. (-drawRepresentation:inRect:): Correct background rectfill for flipped views. (-bestRepresentationForDevice:): Rewrite. Close to being correct. Tue Jan 21 00:39:52 2003 Serg Stoyan * Source/NSMenu.m ([-performKeyEquivalent:]): Only perform the higlighting if the item is enabled. * Source/NSMenuView.m ([-performActionWithHighlightingForItemAtIndex:]): Run the run loop for a fraction of a second before executing the action, so that the highlighted item is displayed. Do not remove the highlighted item if a popup menu. * Source/NSPopUpButton.m ([-mouseDown:]): Leave the selection unchanged if the item which was selected is disabled. ([-performKeyEquivalent:]): Mark the popup button as needing redisplay if the key equivalent is performed. Mon Jan 20 00:37:39 2003 Nicola Pero * Source/NSWorkspace.m ([NSWorkspace +initialize]): Wrap in an exception handler so we are sure to release the lock. 2003-01-14 Adam Fedor * Source/NSSound.m ([NSSound +gsnd]): Rename daemon to gnustep_sndd * Tools/gsnd/GNUmakefile: Idem. Thu Jan 9 05:17:22 2003 Nicola Pero * Source/NSApplication.m ([-_appIconInit]): If no app icon has been set, set GNUstep as the applicationIcon by calling setApplicationIconImage: so that the default image gets also registered with name NSApplicationIconImage. 2003-01-08 Fred Kiefer * Source/NSTextView.m Changed all the internal methods ([replaceCharacterRange:withString:], [setFont:range:], [setTextColor:range:], [setalignment:range:], [replaceRange:withAttributedString:], [setAtrributes:range:]) not to call [shouldChangeTextInRange:replacementString:], so that they can be called for a non editable text view. Added this call to the methods: [insertText:], [transpose:], [changeColor:], [alignCenter:], [alignLeft:], [alignRight:], [alignJustified:], [readSelectionFromPasteboard:type:]. * Source/NSCell.m In [selectWithFrame:...length:] removed duplicate setting of delegate. * Source/NSBrowserCell.m Use method calls in [initWithCoder:] to get fontification correct. * Source/NSClipView.m Use method calls in [initWithCoder:] so opaque flag is set correctly. Tue Dec 31 16:30:32 2002 Nicola Pero * Model/GNUmakefile: Build gmodel bundle when GUI_LIB is gnu, not when it's not (Suggestion by Pete French ). Mon Dec 30 18:29:41 2002 Nicola Pero * Model/GNUmakefile: Updated all checks for library-combo. Sun Dec 29 12:27:35 2002 Gregory John Casamento * Headers/gnustep/gui/GSNibTemplates.h: Added declaration for class GSFontProxy. * Source/NSBundleAdditions.m: Added definition for class GSFontProxy. This class handles the fall back which is necessary when unarchiving NSFont when the specified font is unavailable. Modified unarchiving code to use the new class when unarchiving. * Headers/gnustep/gui/NSToolbarItem.h: Corrected spelling of NSToolbarFlexibleSpaceItemIdentifier. * Source/NSToolbarItem.m: Did some initial work on the default toolbar items. * Source/externs.m: Corrected spelling of NSToolbarFlexibleSpaceItemIdentifier. Sat Dec 28 01:42:40 2002 Nicola Pero * Source/NSWindow.m ([-_initBackendWindow:]): Fixed code resetting then restoring the drag types for a deferred window -- there was a small confusion where NSArray and NSCountedSet were used interchangeably, while they are not. Drag&drop now works with deferred windows for me. Wed Dec 25 17:01:51 2002 Nicola Pero * Headers/gnustep/gui/NSText.h ([-setFont:range:]): Declare. * Source/NSTextView.m ([-setFont:ofRange:]): Renamed to setFont:range:. * Source/NSText.m ([-setFont:range:]): New method. ([-setFont:ofRange:]): Call the new method. 2002-12-23 Fred Kiefer * Headers/gnustep/gui/NSComboBoxCell.h Removed unused ivars and added one to store the popup while open. * Source/NSComboBoxCell.m Moved popup positioning to GSComboWindow, rewrote popup size code to respect numberOfItems and to adopt the used matrix. New methods for the cell to popup interaction. Corrected the encoding code of NSComboBoxCell. [objectValues] now correctly warns in the data source case. New method [stringValueAtIndex:]. Hack in [_didClick:] to get setting of values working. 2002-12-22 Gregory John Casamento * Source/NSToolbar.m: Added some of the code needed to add/remove toolbar items. 2002-12-10 Adam Fedor * Source/NSView.m ([NSView -lockFocusInRect:]): Check for window iff not printing. ([NSView -unlockFocusNeedsFlush:]): Idem. ([NSView -displayIfNeededInRectIgnoringOpacity:]): Idem. ([NSView -displayRectIgnoringOpacity:]): Idem. 2002-12-10 Fred Kiefer * Source/NSImageView.m Use [mouseDown:] instead of [mouseDragged:] to start dragging as the later only works when the view is not first responder. 2002-12-05 Adam Fedor * Source/GSSimpleLayoutManager.m ([GSSimpleLayoutManager -setNeedsDisplayForLineRange:inTextContainer:]): Make sure view exists before trying to get range (Solaris limitation). 2002-12-04 Adam Fedor * Source/GSSimpleLayoutManager.m ([GSSimpleLayoutManager -textStorage:edited:range:changeInLength:invalidatedRange:]): Make sure view exists before trying to get range (Solaris limitation). * Source/NSPrintOperation.m: Update for change in GSSetLocale. 2002-12-04 Adam Fedor * Headers/gnustep/gui/DPSOperators.h (DPSPrintf): Remove inline attribute which caused compiler errors on FreeBSD (patch from Pete French ). 2002-12-05 Fred Kiefer * Source/NSBitmapImageRep.m In [TIFFRepresentationUsingCompression:factor:] set extraSamples and correct compression type if 0. * Source/NSImageView.m Implement dragging of images. 2002-12-02 Adam Fedor * Model/GMAppKit.m, Model/GMArchiver.m, Model/IBClasses.m, Model/IMConnectors.m, Model/IMCustomObject.m, Model/IMLoading.m, Model/Translator.m: Include model headers from gnustep/gui not AppKit. * Model/GNUmakefile: Install headers in gnustep/gui 2002-11-29 Richard Frith-Macdonald * Model/IMConnectors.m: Update ivar setting code. 2002-11-27 Richard Frith-Macdonald * Source/NSBundleAdditions.m: Quick hack for setting ivars. 2002-11-27 Adam Fedor * Source/NSTabView.m ([NSTabView -selectedTabViewItem]): Check that the array count is > 0 2002-11-24 Adam Fedor * Tools/example.m: Include NSProcessInfo.h 2002-11-24 Fred Kiefer * Headers/gnustep/gui/NSSavePanel.h * Headers/gnustep/gui/NSOpenPanel.h * Source/NSSavePanel.m * Source/NSOpenPanel.m Added new MacOSX methods. 2002-11-24 Fred Kiefer * Source/NSBezierPath.m Corrected [GSBezierPath appendBezierPath:] to check the class of the parameter and to keep the isFlat flag in sync. * TextConverters/RTF/RTFConsumer.m GSRTFregisterFont() handle fontnames with and without trailing ';'. * TextConverters/RTF/rtfGrammer.y Documented how to compile with recent bison releases. Removed one conflict and an unneeded terminal. Allow for additional blocks in font definition. * TextConverters/RTF/rtfGrammer.tab.h Regenerated with bison 1.35 * TextConverters/RTF/rtfGrammer.tab.c Regenerated with bison 1.35 and corrected yyparse declaration. * TextConverters/RTF/rtfScanner.c Redefined GSRTFlex() without location parameter. Some cleanup against compiler warnings. 2002-11-21 Adam Fedor * Version: 0.8.3 2002-11-21 Fred Kiefer * Source/NSGraphicsContext.m Rewrote [GSSendBezierPath:] to send the full path to the backend. Code comes from [NSBezierPath _doPath]. * Source/NSBezierPath.m Replaces [_doPath] with calls to [NSGraphicsContext GSSendBezierPath:]. Added optimisation methods [appendBezierPath:] and [transformUsingAffineTransform:] on GSBezierPath. 2002-11-18 Gregory John Casamento * Source/NSBundleAdditions.m: Added some logic in the initWithCoder method to handle different gorm file versions. Even though there is only one version currently, we need this in place. * Headers/gnustep/gui/GSNibTemplates.h: Added #define for GNUSTEP_NIB_VERSION. 2002-11-17 Fred Kiefer * Source/NSCell.m * Source/NSButtonCell.m * Source/NSMenuItemCell.m * Source/NSOutlineView.m * Source/NSPopUpButtonCell.m * Source/NSSplitView.m Removed unneeded includes. * Source/NSRulerView.m Rewrote [drawHashMarksAndLabelsInRect:] to use string drawing and bezier path code instead of direct PS operations. 2002-11-16 Frederic De Jaeger * Source/NSOpenGLPixelFormat.m, Source/NSOpenGLContext.m, Source/NSOpenGLView.m, Headers/AppKit/NSOpenGL.h, Headers/AppKit/NSOpenGLView.h: New files. * Source/Makefile: Updated accordingly. * Headers/AppKit/GSDisplayServer.h (glContextClass, glPixelFormatClass): New methods. * Source/GSDisplayServer.m: Implement. 2002-11-15 Adam Fedor * Model/GMAppKit.m ([NSColor -encodeWithModelArchiver:]): Encode named colors. ([NSColor +createObjectForModelUnarchiver:]): Decode them. 2002-11-13 Adam Fedor * Model/IMLoading.m ([GMModel -objects]): New. ([GMModel -connections]): Idem. 2002-11-12 Adam Fedor * Headers/gnustep/gui/AppKit.h: Add NSDocumentController. * Source/NSSavePanel.m ([NSSavePanel -ok:]): Display filename (with extension) if replacing. 2002-11-12 20:40 Alexander Malmberg * Source/NSTableView (-setDataSource:): Allow nil data source. 2002-11-10 Fred Kiefer * Source/GSSimpleLayoutManager.m * Source/NSOutlineView.m Removed compiler warnings by correcting method names. * Source/NSBezierPath.m * Source/NSOpenPanel.m * Source/NSStringDrawing.m Corrected includes to speed up compilation. 2002-11-10 Fred Kiefer * Source/GSComboSupport.h * Source/GSComboSupport.m Removed files. * GNUmakefile Removed GSComboSupport.m * Source/NSComboBoxCell.m Moved all ComboBox code to here to make further changes easier. * Headers/gnustep/gui/NSSound.h: Prefixed all ivars with underscore * Source/NSSound.m Adopted to change in header and simplified [copyWithZone:] and [initWithCoder:]. 2002-11-09 Richard Frith-Macdonald * Source/NSDocumentController.m: Don't try to store NSURL objects in defaults system. 2002-11-08 Adam Fedor * Source/NSSavePanel.m ([NSSavePanel -_shouldShowExtension:isDir:]): Filter regular files also. * Source/NSMenu.m ([NSMenuPanel -canBecomeKeyWindow]): Return YES only if we are the main menu. * Source/NSWindow.m ([NSWindow -sendEvent:]) (FocusIn): If we are the main menu, try to find another window to become key. 2002-11-07 Fred Kiefer * Source/NSCell.m in [initImageCell:] and [initTextCell:] set the default menu. In all [XXXValue] methods try to get the value from the objectValue first and use [stringValue] instead of accessing the contents directly. Removed AUTORELEASE calls from [attributedStringValue] and similar places. In [cellSize] use [attributedStringValue] to get the string to size. In [drawInteriorWithFrame:inView:] use [attributedStringValue] to get the string to draw. This make the method [_drawText:inFrame:] obsolete for this class, but subclasses still use it. New method [_setupTextWithFrame:inView:editor:] with the common text view setup from [editWithFrame:inView:editor:delegate:event:] and [selectWithFrame:inView:editor:delegate:start:length:]. Calls to [setFont:] and [setAlignment:] switch the cell to NSTextCellType. * Source/NSButtonCell.m Removed all direct usage of ivar _contents. Implemented [attributedAlternateTitle] and use this in [cellSize] and [drawInteriorWithFrame:inView:]. * Headers/gnustep/gui/NSDragging.h: Added some new MacOSX values to NSDragOperation and some new methods. 2002-11-06 Adam Fedor * Source/NSTableView.m ([NSTableView -drawRow:clipRect:]):Swapped sides of while statement && operator to check for _numberOfColumns first. ([NSTableView -drawGridInClipRect:]): Idem. Also remove some unused variables. ([NSTableView -mouseDown:]): Select the drag row if it's not currently selected. Simplify some code (do all selecting in one place). (-mouseDown2:): Remove commented out method. ([NSTableView -draggingUpdated:sender]): scrollRowToVisible if we are dragging near edges of view. 2002-11-02 Lyndon Tremblay * NSTableView.m ([NSTableView -columnAtPoint:]): Swapped sides of while statement && operator to check for _numberOfColumns first. 2002-11-01 Lyndon Tremblay * Source/NSBitmapImageRep.m ([NSBitmapImageRep -draw]): Cast argument 11 for NSDrawBitmap() to remove warning. 2002-11-04 Adam Fedor * Source/NSWorkspace.m ([NSWorkspace -_workspaceApplication]): Change default to GWorkspace. 2002-11-02 Adam Fedor * Source/NSWindowController.m (-setDocument:): Remove window's setReleasedWhenClosed when doc is not nil. (-setWindow:): Idem. (Pointed out by Stefan Urbanek). 2002-11-02 Adam Fedor * Source/NSParagraphStyle.m (-compare:): Correct the comparision of NSTextTabs. * Source/NSScrollView.m (-tile:): Add a call to setNeedsDisplay. * Source/NSRulerMarker.h: Correct a mispelling in a method name makerLocation to markerLocation. * Source/NSTextView.m: Idem. (-rulerView:didAddMarker:) Create a new NSTextTab corresponding to the marker. (-rulerView:handleMouseDown:) Ask rulerview to track a new marker, instead of simply adding a new marker * Source/NSRulerView.m: Remove some unused macros. (-_verifyReservedThicknessForMarkers, _rulerRect, _markersRect, -markerAtPoint:): New private. (-trackMarker:withMouseEvent:): Implement. (-mouseDown:) Track marker if click was on marker, or asks client to handle if click was on ruler area. * Source/NSRulerMarker.m: -trackMouse:adding:): Implement. (Patches from Benhur Stein ). 2002-11-01 Adam Fedor * Source/NSApplication.m (-finishLaunching): Instantiate an NSDocumentController if this is a doc-based app. (-targetForAction:): Check if NSDocumentController responds to action if this is a doc-based app. * Source/NSDocument.m (-close): Rewrite to deal with removing objects from array while enumerating. * Source/NSDocumentController.m (-closeAllDocuments): Idem. (-sharedDocumentController): Don't set ourselves as the app delegate. (-isDocumentBasedApplication): Method for NSApplication. * Source/NSWindow.m (-sendEvent:): Retain _lastView just in case it's a temporary view. 2002-10-31 Gregory John Casamento * Source/NSBundleAdditions.m: +[loadNibFile:externalNameTable:withZone:]: Added logic to load .gorm directories and also maintained backwards compatibility with .gorm files. 2002-10-29 Pierre-Yves Rivaille * Source/NSSplitView.m ([NSSplitView -resizeSubviewsWithOldSize:]): Move code from setFrame: & resizeWithOldSuperviewSize: to resizeSubviewsWithOldSize:. * Source/NSColorPanel.m ([NSColorPanel _initWithoutGModel]): make the window a little bit higher. Some ColorPickers would not fit. * ColorPickers/GSCMYKColorPicker.tiff: * ColorPickers/GSGrayColorPicker.tiff: * ColorPickers/GSHSBColorPicker.tiff: * ColorPickers/GSRGBColorPicker.tiff: resize so that the image fits within the NSButton. (only blank area was removed) 2002-10-29 Richard Frith-Macdonald * Headers/gnustep/gui/GSMethodTable.h: * Headers/gnustep/gui/PSOperators.h: Add const qualifier to PSPrintf and PSWriteData argument types to match all other declatrations. * Headers/gnustep/gui/NSMenu.h: Add and document validation protocol. * Headers/gnustep/gui/NSMenuItem.h: Add some documentation and tidy. 2002-10-28 Adam Fedor * Source/NSTextView.m (-drawRect:): Don't draw insertion point when printing. * PrinterTypes/GSProlog.ps: New file. * Source/NSView.m (-_loadPrinterProlog): New. (beginPage:...): Use it. 2002-10-28 Adam Fedor * Source/NSScreen.m (-visibleFrame): Don't include dock with NexT/WindowMaker styles (patch from Stefan ). 2002-10-28 Adam Fedor * Source/NSPrintOperation.m (-cleanUpOperation): Order out print panel. (-_runOperation): Use autorelease pool around operation. (-init): Create a proper, unique temp print file. (-deliverResult): Implement for previewing, spooling. * Source/NSPrintPanel.m (-runModel): Don't order self out. (-_setStatusStringValue:) New private method. 2002-10-28 Richard Frith-Macdonald * Source/NSTextField.m: ([-dealloc]) morph self to be an NSTextView so that when dealloc is re-called, any subclass dealloc methods don't get re-called. * Source/NSTableView.m: Memory leak fix added as suggested by Stefan Urbanek. NOTE ... selection code looks very inefficient, perhaps we should look into whether it is worth optimising? 2002-10port-Yves Rivaille * Source/NSMenuView.m ([NSMenuView -trackWithEvent:]): new tracking code. The menu feels snappier now (at least for me). * Source/NSColorWell.m ([-activate:], [-deactivate]) register/unregister for NSColorPanelColorChangedNotification. ([NSColorWell _takeColorFromPanel:]): new method to prevent endless loop when setting the well's color from the color panel. ([NSColorWell -initWithCoder:]): register for NSColorPboardType. * Source/NSColorPanel.m ([NSColorPanel -_bottomWellAction:]): called when hitting one of the well at the bottom of the panel. Previous behaviour would not send a NSColorPanelColorChangedNotification. ([NSColorPanel -initWithCoder:]): update bottom wells construction to call _bottomWellAction: instead of takeColorFrom:. 2002-10-26 Adam Fedor * Source/NSOutlineView.m (-drawRow:clipRect:): Release imageCell (patch from Stefan ). 2002-10-25 Adam Fedor * Source/NSApplication.m: Remove some NSDebugLogs. * Source/NSDocument.m (-fileNameFromRunningSavePanelForSaveOperation:): Set directory to the currentDirectory if no fileName is set. Localize. (-fileAttributesToWriteToFile:ofType:saveOperation:): Stub implement. * Source/NSDocumentController.m: Document. (+sharedDocumentController): Proper allocation/init. Set ourselves as the application delegate if there isn't one already. (-init): Retrieve list of recent documents. (-reviewUnsavedDocumentsWithAlertTitle:cancellable:): Save current directory. Localize. (-currentDirectory): Rewrite according to docs. * Source/NSOpenPanel.m (-runModalForTypes:): Use nil for directory. * Source/NSSavePanel.m (_setupForDirectory:file:): Use current directory if nil, otherwise keep the old one. (-runModal): Pass nil for directory. 2002-10-25 Mirko Viviani * configure.ac: fixed header/ldflags for freebsd. 2002-10-21 Adam Fedor * Source/GSFontInfo.m (+encodingForRegistry:encoding:): Remove. Tue Oct 22 02:13:55 2002 Nicola Pero * Resources/GNUmakefile (string): Renamed to after-strings so that it works with the new gnustep-make strings targets. 2002-10-21 Richard Frith-Macdonald * Source/NSView.m: Key view code ... complete rewrite to match MacOS-X implementation. Fix coding bug in rewrite. * Source/NSTextField.m: don't use _nextKeyView * Source/NSMatrix.m: don't use _nextKeyView Mon Oct 21 01:17:41 2002 Nicola Pero * Source/NSView.m ([-setNextKeyView:], [-setPreviousKeyView:]): Rewritten the way the next/previous key view chain is managed, to fix problem when a next/previous key view is replaced with a new one (Patch by Caba Conti modified). 2002-10-20 Richard Frith-Macdonald * Headers/gnustep/gui/NSComboBox.h: Add APPKIT_EXPORT and make layout a bit more consistent. * Source/NSTextView.m: ([-dealloc]) remove unneeded RETAIN() Fixes for beugs reported by Caba Conti. 2002-10-18 Adam Fedor * Documentation/announce.texi: Fix grammer. * Try to fix focus interaction with WindowMaker. * Source/NSApplication.m ([NSIconWindow -canBecomeKeyWindow]): Revert 2002-10-08 change. (-appIconInit): Don't set input focus to app icon. (-_windowWillClose:): Idem. * Source/NSMenu.m: New class NSMenuPanel (_createWindow): Use it. * Source/NSWindow.m (-_lossOfKeyOrMainWindow): Make sure menu window doesn't get key except as a last resort. (-sendEvent: (GSAppKitWindowFocusIn)): Don't become key if app is hidden. * Source/NSPanel.m (-sendEvent:): Same as change to NSWindow on 2002-10-03. * Source/NSDocument.m (-init): Set default file type. Tue Oct 15 02:36:32 2002 Nicola Pero * Source/NSApplication.m (initialize_gnustep_backend): Get the GSBackend class using NSClassFromString() rather than NSBundle's -classNamed: to make it more robust on platforms - eg MS Windows - which have unclear problems with dynamic loading. 2002-10-14 Adam Fedor * Version: 0.8.2 * Documentation/news.texi: Update. Mon Oct 14 02:24:45 2002 Nicola Pero * Source/NSSavePanel.m (browser:createRowsForColumn:inMatrix:): Fixed last change which had broken the GSFileBrowserHideDotFiles option. 2002-10-13 Gregory John Casamento * Headers/GSNibTemplates.h: Added parentClassName member to templates so that the parent of the custom class could be stored. * Source/NSBundleAdditions.m: Made necessary modfications to the template implementations to use the parent class name 2002-10-13 Richard Frith-Macdonald * Source/NSSavePanel.m: ([--browser:createRowsForColumn:inMatrix:]) Don't try to read .hidden file for processing unless it exists. * Source/DocMakefile: New makefile for building documentation without having to build binaries. Also add flag for macros template. * Source/GNUmakefile: Removed documentation building rules. * Documentation/GNUmakefile: Use DocMakefile * Source/NSWindow.m: Slight documentation update/addition. * Source/NSView.m: ditto. * Source/NSToolbar.m: ditto. * Source/NSTextView.m: ditto. * Source/NSMatrix.m: ditto. * Source/NSLayoutManager.m: ditto. 2002-10-11 Adam Fedor * Headers/gnustep/gui/NSOpenPanel.h: Move comments to source file as autogsdoc. * Headers/gnustep/gui/NSSavePanel.h: Idem. * Source/NSOpenPanel.m: Document. * Source/NSSavePanel.m: Idem. * Source/NSBrowser.m: Change NSDebugLog to NSDebugLLog (or remove). * Source/NSButtonCell.m, Source/NSCell.m, Source/NSControl.m, Source/NSEvent.m, Source/NSFontManager.m, Source/NSFontPanel.m, Source/NSImageCell.m, Source/NSMatrix.m, Source/NSMenu.m, Source/NSMenuItem.m, Source/NSResponder.m, Source/NSRulerView.m, Source/NSScrollView.m, Source/NSSplitView.m, Source/NSStepper.m, Source/NSTableHeaderView.m, Source/NSWindow.m: Idem. Fri Oct 11 15:10:42 2002 Nicola Pero * Headers/gnustep/gui/AppKit.h: Include AppKit/NSFileWrapper.h (Reported by Ludovic Marcotte ). Fri Oct 11 01:37:57 2002 Nicola Pero * TextConverters/RTF/RTFConsumer.m ([RTFAttribute -currentFont]): If the font can't be found in the usual ways, try to get it as a composite font name like 'FontFamily-Face' (Patch by Georg Fleischmann modified). Fri Oct 11 01:15:55 2002 Nicola Pero * Source/NSFont.m (getNSFont): If fontWithName:size: returns nil, try various approximations to get a font. Fri Oct 11 01:02:24 2002 Nicola Pero Patch by Georg Fleischmann : * Source/NSFont.m ([NSFont -initWithName:matrix:fix:]): Release self and return nil if the font info is nil. This makes [NSFontManager -convertFont:...] work. Thu Oct 10 19:56:29 2002 Nicola Pero * Source/NSScrollView.m ([-scrollPageUp:]): Implemented. ([-scrollPageDown:]): Implemented. ([-pageUp:]): Implemented. ([-pageDown:]): Implemented. * Source/NSTextView.m ([-pageDown:]): Implemented. ([-pageUp:]): Implemented. (Patch by David Ayers ). Thu Oct 10 19:16:40 2002 Nicola Pero * Source/NSFontManager.m ([NSFontManager -fontMenu:]): Use 't' as key equivalent for the font panel. (Patch by David Ayers ). 2002-10-10 Fred Kiefer * Source/NSBezierPath.m Handle seting of an empty dash in [setLineDash:count:phase:]. [_doPath] now always sends the dash pattern, even when empty. 2002-08-30 Georg Fleischmann * Source/NSWindow.m ([-constrainFrameRect]): Move window inside screen, if window top is below screen. 2002-10-09 Adam Fedor * Source/NSApplication (hide:): Don't setinputfocus to the icon window. * Source/NSWindow.m (-sendEvent:) (GSAppKitWindowFocusIn): If we're not visible, don't try to become main/key. 2002-10-08 Adam Fedor * Fix window focus problems. * Source/NSApplication.m ([NSIconWindow -canBecomeKeyWindow]): return YES. (-finishLaunching): Don't make main menu key. ([NSApplication -deactivate]): Don't setinputfocus to the icon window. * Add Quartz-like interface and overridable passing of colorspaces and fonts to backend. * Headers/gnustep/gui/NSFont.h (_fontRef): New ivar. * Source/NSFont (-fontRef): New method. (GSSetFont): Use it. * Source/GSFontInfo (-matrix): New method. * Headers/gnustep/gui/GSFusedSilica.h: New header * Headers/gnustep/gui/GSFusedSilicaContext.h: Idem. * GSFusedSilica.m: New file. * GSFusedSilicaContext.m: Idem. Tue Oct 8 19:15:24 2002 Nicola Pero * Source/NSSecureTextField.m: Mostly rewritten. Main changes - NSCoding protocol methods moved to the cell; implemented encoding; do not share the secure text field globally, just create one each time; create the secure text field in setupFieldEditorAttributes: and removed most other hacks. Init methods of the secure text view rewritten to be simpler. Do not register the secure text view for services. Should no longer crash with the new internals. * Headers/gnustep/gui/NSSecureTextField.h: Prefix ivars with underscore. Add setEchosBullets: and echosBullets methods to the textfield as well as the cell. Tue Oct 8 18:46:45 2002 Nicola Pero * Source/NSTextContainer.m ([-replaceLayoutManager:]): Retain the layout manager, then release it at the end; refresh the layout manager cached by the textview; do not set the layout manager's text storage manually. * Source/NSTextStorage.m ([-removeLayoutManager:]): Set the argument's text storage to nil before removing it from the array. 2002-10-08 Gregory John Casamento * Headers/GSNibTemplates.h: Added new template class. * Source/NSBundleAdditions.m: Added implementation for new template class. Improved some of the existing classes. 2002-10-08 Fred Kiefer * Headers/gnustep/gui/NSButtonCell.h Adoped the enums NSButtonType and NSBezelStyle to the new MacOSX names. * Source/NSButtonCell.m [setButtonType:] use those new names. Corrected [cellAttribute:] and [setCellAttribute:] to use the right tests. [performClick:] now play the sound, if provided. 2002-10-07 Adam Fedor * Source/NSBrowser.m (-frameOfColumn:, -tile): Change distance between columns from 1 to 2. (Patch from Serg Stoyan ) * Source/NSGraphicsContext.m (-GSSetFillColorspace:):Take void * argument (-GSSetStrokeColorspace:): Idem. (-GSSetFont:): Idem. 2002-10-06 Gregory John Casamento * Source/NSBundleAdditions.m: Implemented the following classes: NSWindowTemplate, NSViewTemplate, NSControlTemplate, NSTextTemplate, NSTextViewTemplate, NSMenuTemplate, GSClassSwapper. These classes are used to allow the .gorm files to have placeholders for custom classes defined by the developer. This is similar to the approach used in OPENSTEP 4.2/Mach and MOSX. * Headers/gnustep/gui/NSNibLoading.h: Removed declarations for classes which should be considered private to GNUstep. * Headers/gnustep/gui/GSNibTemplates.h: Moved GSNibContainer, GSNibItem, GSCustomView here. Added declarations for new template classes. 2002-10-04 Adam Fedor * Source/NSBrowser.m: Implement non-separated columns. (-setSeparatesColumns:): Remove borders if not separated. (-setTitled:): Return without chaging if we are not separated. (-frameOfColumn:): Compute properly with{out} separation. (-tile): Idem. (-initWithFrame:): Set maxVisibleColumns to 3. (-drawRect:): Draw properly with{out} separation. (Patch from Serg Stoyan ). 2002-10-03 Adam Fedor * Headers/gnustep/gui/NSWindow.h: New _lastView ivar. * Source/NSWindow.m (-sendEvent:): Use it instead of _lastDragView to remember mouseDown view. 2002-10-02 Richard Frith-Macdonald * Source/NSWorkspace.m: ([-getInfoForFile:application:type:]) Make an exception for directories without file extensions ... never return plain type for them even if apps claim to open them. Wed Oct 2 11:26:21 2002 Nicola Pero * Source/NSTextView.m ([-shouldChangeTextInRange:replacementString:]): Immediately return NO if not editable; do not send out textShouldBeginEditing: and textDidBeginEditingNotification unless the textview is already first responder (Patch by David Ayers ). 2002-10-02 Richard Frith-Macdonald * Source/NSWorkspace.m: ([-getInfoForFile:application:type:]) Try to return a plain file type for directories which are openable by some app. 2002-10-01 Adam Fedor * Tools/gsnd/portaudio/pa_unix_oss/pa_unix_oss.c (PaHost_WatchDogProc): usleep can have a void return (Modified patch from Charles Philip Chan). * Source/NSBrowserCell.m (-drawInteriorWithFrame:inView:): Use NSCompositeSourceOver. Tue Oct 1 17:07:25 2002 Nicola Pero * Source/GSSimpleLayoutManager.h (_lineLayoutInformation): Renamed to _lineLayoutInfo. * Source/GSSimpleLayoutManager.m: Updated for change. Tue Oct 1 16:58:36 2002 Nicola Pero * Source/NSTextView.m ([NSTextView -moveToEndOfLine:]): Fixed moving to the end of 'one before the last' line. ([NSTextView -moveToEndOfParagraph:]): Idem. Tue Oct 1 16:40:29 2002 Nicola Pero * Source/GSSimpleLayoutManager.m ([-glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:]): Fix the insertion point positioning when clicking beyond the last character of a line in an NSTextView, or before the first one; special care to be used for the last line in the textview (Originated by a patch by David Ayers , modified by me). 2002-09-27 Richard Frith-Macdonald * Source/NSFont.m: Rewrote code dealing with creation and destruction of font objects to remove holes in the original caching scheme and to optimimise font creation/destruction somewhat. All font objects should now be handled by the cache, no matter how they are created. 2002-09-27 Richard Frith-Macdonald * Source/NSFont.m: Replace caching code which never released fonts with a cache which only holds fonts as long as something is using them. 2002-09-26 Fred Kiefer * Headers/gnustep/gui/NSBrowserCell.h Removed all references to coding. * Source/NSBundleAdditions.m Moved add on methods. * Source/NSImage.m Moved method [NSBundle pathForImageResource:] to here. * Source/NSSound.m Moved method [NSBundle pathForSoundResource:] to here. * Source/NSButton.m Removed the coder methods as they were just super calls. Wed Sep 25 03:37:27 2002 Nicola Pero * Headers/gnustep/gui/NSInterfaceStyle.h: Put include guards in the canonical form, by swapping them with #ifndef STRICT_OPENSTEP; this arrangement is more efficient when the file is included multiple times with GCC. Wed Sep 25 03:30:35 2002 Nicola Pero * Headers/gnustep/gui/GSGuiPrivate.h: Redefine both _() and NSLocalizedString() to be wrappers for GSGuiLocalizedString() (Idea from Stefan Urbanek ). * Source/NSApplication.m: Use _() and NSLocalizedString() everywhere for localized strings, instead of GSGuiLocalizedString(). (NSAppKitUncaughtExceptionHandler): Small rearrangement of code to make it easier for make_strings to parse localization calls. * Source/NSDocument.m: Include GSGuiPrivate.h, and localize strings (from a patch by Stefan Urbanek ). * Resources/GNUmakefile: Completely rewritten to use resource-set.make to install the files; added experimental 'strings' target which runs make_strings and updates the Localizable.strings files. * Resources/English.lproj/Localizable.strings: Updated using make strings. * Resources/Italian.lproj/Localizable.strings: Updated using make strings, then manually updated all translations; added missing ones. Tue Sep 24 16:32:30 2002 Nicola Pero After discussions with David Ayers: * Source/NSCell.m ([-editWithFrame:inView:editor:delegate:event:]): Do not perform an immediate display of the textfield. ([-selectWithFrame:inView:editor:delegate:start:length:]): Idem. * Source/NSTextField.m ([-becomeFirstResponder]): If the text field accepts first responder status, select its text. ([-mouseDown:]): If not selectable, pass the mouse down to super. If selectable, and _text_object is not nil, pass the mouse down to the _text_object. Else, try to get first responder status, and to start editing. Tue Sep 24 03:29:55 2002 Nicola Pero * Source/NSSplitView.m: Cache the default notification center for the whole class. * Source/NSTextStorage.m: Idem. Tue Sep 24 03:14:12 2002 Nicola Pero * Source/NSTextField.m ([-dealloc]): Implemented (Reported missing by David Ayers). * Source/NSDrawer.m ([-dealloc]): Remove the delegate from the notification center. * Source/NSMatrix.m ([-dealloc]): Idem. * Source/NSSplitView.m ([-dealloc]): Idem. * Source/NSTableView.m ([-dealloc]): Idem. * Source/NSTextStorage.m ([-dealloc]): Idem. * Source/NSWindow.m ([-dealloc]): Idem. * Source/NSToolbar.m ([GSToolbarButton -dealloc]): New method. ([NSToolbar -dealloc]): New method. Mon Sep 23 15:23:23 2002 Nicola Pero * Source/NSApplication.m (initialize_gnustep_backend): Improved error messages. Try to be as descriptive and verbose as possible about what exactly went wrong when loading the backend fails. 2002-09-22 Fred Kiefer * Source/NSBrowser.m Removed unused ivar _numberOfRows from NSBrowserColumn. Made GSBrowserTitleCell a subclass of NSTableHeaderCell. Corrected [scrollColumnToVisible:], so that the column becomes visible but not always last. Adopted [scrollViaScroller:] to this change. Inlined most private methods and optimized the code. Reorganized [_performLoadOfColumn:] to remove code duplication. Set the title of a column here and not each time when drawing. 2002-09-22 16:33 Alexander Malmberg * Source/NSTextView.m (-initWithFrame:textContainer:): Set uses_font_panel and uses_ruler to NO while initializing and back to YES when we're done. 2002-09-22 16:26 Alexander Malmberg * Source/NSFontPanel.m (-init): Set sane defaults _before_ trying to set values for the current font. Move code to select a certain size in the size browser to -_trySelectSize:. Update the size in the preview and the browser when the size text field changes. Mark private variables and constants as static. 2002-09-22 01:23 Alexander Malmberg * Headers/gnustep/gui/NSView.h, Source/NSPanel.m, Source/NSText.m, Source/NSTextField.m, Source/NSView.m, Source/NSWindow.m: Add -needsPanelToBecomeKey method to NSView and override it to return YES in NSText and NSTextField. Use it in NSPanel to handle becomesKeyOnlyIfNeeded properly. 2002-09-21 18:54 Gregory John Casamento * Source/NSOutlineView.m corrected preprocessor error messages. * Source/NSToolbar.m corrected preprocessor error messages. 2002-09-21 17:48 Alexander Malmberg * Source/NSFontPanel.m (-_familySelectionChanged:, score_difference): If an exact match for the wanted weight and traits can't be found, score all faces in the new family and select the one that differs the least. 2002-09-19 Richard Frith-Macdonald * Source/GNUmakefile: Set flags to generate documentation using templates. 2002-09-18 Pierre-Yves Rivaille * Source/NSSplitView.m ([NSSplitView -initWithCoder:]): set _never_displayed_before to YES. * Source/NSFont.m: rearrange the last change to make it look like other classes' initWithCoder/encodeWithCoder * Source/NSTextView.m: do not call _blink directly (suggested by Nicola Pero). * Source/NSButtonCell.m ([NSButtonCell -drawInteriorWithFrame:inView:]): if the button is NSImageOnly, draw the dotted frame at the right location. 2002-09-16 19:28 Alexander Malmberg * Source/NSFont (+initialize, -initWithCoder:, -encodeWithCoder:): Encode and decode matrixExplicitlySet, and guess its value when loading old encoded objects. 2002-09-16 19:05 Alexander Malmberg * Source/NSWindow.m (-close): Retain and release self to make sure it isn't deallocated until we're done. 2002-09-15 Fred Kiefer * Source/NSStringDrawing.m drawRun() now correctly flags that it wants some temporary memory allocated. The old behaviour resulted in a memory leak. * Headers/gnustep/gui/NSBrowser.h Declare new MacOSX method [drawTitleOfColumn:inRect:]. Removed unused ivar _browserCellClass. Replaced ivar _titleCell with a static variable used for all browsers. * Source/NSBrowser.m Use _lastColumnLoaded instead of _lastVisibleColumn in [selectAll:]. Implemented MacOSX [drawTitleOfColumn:inRect:]. Optimized [matrixInColumn:] and use it where suitable. Moved calls to [_adjustMatrixOfColumn:] inside of [_performLoadOfColumn:]. 2002-09-15 Pierre-Yves Rivaille * Source/NSMenuView.m: New private method [NSMenuView -_itemCell] in newly created GNUstepPrivate category. * Source/NSMenu.m: Add GNUstepPrivate interface of NSMenuView. [NSMenu -_setOwnedByPopUp:]: update itemCells' menuView (fix NSPopUpButtonCell-decoding problem). * Source/NSPopUpButtonCell.m ([NSPopUpButtonCell -synchronizeTitleAndSelectedItem]): Fix "mouseUp outside of menu" problem. Now the previous selected item stay selected. ([NSPopUpButtonCell -initWithCoder:]): Set the selectedItem properly. 2002-09-15 13:17 Alexander Malmberg * Source/NSImage.m (compositeToPoint:fromRect:operation:,, dissolveToPoint:fromRect:fraction:): Don't un-flip coordinates when drawing in flipped views. 2002-09-14 13:35 Alexander Malmberg * Source/NSFontPanel.m: Break -browser:selectRow:inColumn: into three selection changed methods and set them as the action of the respective browser. Fri Sep 13 09:36:06 2002 Nicola Pero * Headers/gnustep/gui/NSNibDeclarations.h: Added include guards. 2002-09-11 Pierre-Yves Rivaille * Source/NSText.m ([NSText -initWithCoder:]): Retain the decoded background color. * Source/NSTextView.m : multiple location: don't ignore textContainer's inset ([NSTextView -initWithCoder:]) ([NSTextView -encodeWithCoder:]) Encode caret color, textContainer's size and whether the textContainer has widthTracksTextView or heightTracksTextView set. ([NSTextView -sizeToFit]) Change width (height) only if is_horizontally_resizable (is_vertically_resizable). ([NSTextView -scrollRangeToVisible:]) scrolls to the first char of the range. ([NSTextView -invalidateTextContainerOrigin]): Don't ignore inset, set the origin so that the justification is preserved even if the textContainer's width is larger that the textview's width. ([NSTextView -updateInsertionPointStateAndRestartTimer:]): update and place the insertion point properly. ([NSTextView -moveDown:]) & ([NSTextView -moveUp:]): Don't ignore inset. Make insertion point visible. * Source/NSTextField.m ([NSTextField -acceptsFirstResponder:]): responds NO if the editing is still in progrss. * Source/NSLayoutManager.m ([NSLayoutManager -drawBackgroundForGlyphRange:atPoint:]): Don't ignore textContainer's inset. * Source/GSSimpleLayoutManager.m Replaced [-drawLinesInLineRange:] with [-drawLinesInLineRange:atPoint:]. Replaced [-drawSelectionAsRangeNoCaret:] with [-drawSelectionAsRangeNoCaret:atPoint:]. Those replacements make it easier to take inset into account. ([-lineFragmentUsedRectForGlyphAtIndex:effectiveRange:]) ([-locationForGlyphAtIndex:]) ([-boundingRectForGlyphRange:inTextContainer:]) ([-rectForCharacterIndex:]) ([-setNeedsDisplayForLineRange:inTextContainer:]): Various fixes. ([-textStorage:edited:range:changeInLength:invalidatedRange:]) Update insertion point if needed (useful when alignment changes). ([-rebuildForRange:delta:inTextContainer:]): Update layout mechanism. * Source/NSCell.m ([NSCell -highlight:withFrame:inView:]): Ask the control to draw the background if we are not opaque. ([NSCell -editWithFrame:inView:editor:delegate:event:]): ([NSCell -selectWithFrame:inView:editor:delegate:start:length:]): ([NSCell -endEditing:]): instantiate (and remove) the textview so that it can be scrolled. 2002-09-09 Adam Fedor * configure.ac: Switch to disaple gsnd. 2002-09-07 Adam Fedor * Source/NSBrowser.m: Convert comments for gsdoc. (-selectRow:inColumn:): Call delegate -browser:selectRow:inColumn:. (-setPath:): Call delegate -browser:selectCellWithString:inColumn:. (-doClick:): Do not call the above methods. (-initWithCoder:): Set _isLoaded to NO. * Source/NSSavePanel.m (-_browser:selectCellWithString:inColumn): Rename from -browser:selectCellWithString:inColumn. (_setupForDirectory:file:) Use it. * Source/NSOpenPanel.m (-browser:selectCellWithString:inColumn): Remove. * Source/NSWindow.m ([NSWindow -performClose:]): Don't close if a modal session is going and we aren't the modal window. 2002-09-07 Fred Kiefer * Source/NSApplication.m Release the invocation in [detachDrawingThread:toTarget:withObject:] not in the helper method. (Patch by David Ayers ). * Headers/gnustep/gui/NSPasteboard.h * Source/externs.m Define NSHTMLPboardType. * Headers/gnustep/gui/GSTextConverter.h Define protocol for method [classForFormat:producer:]. * Headers/gnustep/gui/NSTextAttachment.h Moved NSAttributedString text attachment method declarations to here. * Headers/gnustep/gui/NSAttributedString.h Define new MacOSX methods. * Source/NSAttributedString.m Implemented [textFileTypes], [textPasteboardTypes], [textUnfilteredFileTypes], [textUnfilteredPasteboardTypes]. * Source/NSMenu.m * Source/NSTextView.m Corrected includes. 2002-09-06 Adam Fedor * Headers/gnustep/gui/NSPrintInfo.h: Add print option. * Source/NSPrintOperation.m ([-_printPaginateWithInfo:knowsRange:): Use it. (-_rectForPage:info:xpage:ypage:): Correct xpage/ypage calc. (-_adjustPagesFirst:last:info:): Likewise. * Source/NSStringDrawing.m (setupSpecialRun): Set base. * Source/NSSound.m (-getDataFromFileAtPath:): Use fileSystemRepresentation. * Source/NSView.m (-beginPage:label:bBox:fonts:): Use lossyCString. 2002-09-06 Fred Kiefer * Headers/gnustep/gui/NSColorPanel.h * Source/NSColorPanel.m Moved the method [NSApplication orderFrontColorPanel:] to here. * Headers/gnustep/gui/NSHelpPanel.h * Source/NSHelpPanel.m Moved the method [NSApplication orderFrontHelpPanel:] to here. * Headers/gnustep/gui/NSDataLinkPanel.h * Source/NSDataLinkPanel.m Moved the method [NSApplication orderFrontDataLinkPanel:] to here. * Headers/gnustep/gui/NSPageLayout.h * Source/NSPageLayout.m Moved the method [NSApplication runPageLayout:] to here. * Headers/gnustep/gui/NSApplication.h Removed methods that belong to other files. Added types and method definitions for MacOSX. * Source/NSApplication.m Implemented [detachDrawingThread:toTarget:withObject:]. [sendAction:to:from:] now uses [targetForAction:to:from:]. Removed moved methods. [orderFrontStandardAboutPanel:] now calles [orderFrontStandardInfoPanelWithOptions:] so that subclasses only have to overwritte this. Split up parts of [terminate:] into [replyToApplicationShouldTerminate:]. Thu Sep 5 11:39:58 2002 Nicola Pero * Source/NSTextView.m ([-updateInsertionPointStateAndRestartTimer:]): Make sure we start the on/off/on/off blinking sequence from the on, so that we give immediate feedback to the user as to where the insertion point is (Patch by David Ayers ). 2002-08-30 Adam Fedor * Version: 0.8.1 * Documentation/GNUmakefile: Set dir for reference documentation * Documentation/GNUmakefile.postamble: New file. 2002-08-30 00:11 Alexander Malmberg * Source/NSBezierPath.m (-appendBezierPath:): Handle curves correctly. (-appendBezierPathWithArcFromPoint:toPoint:radius:): Fix numerical stability issue by clamping dx1 and dx2 manually. 2002-08-29 Richard Frith-Macdonald * Source/GSDisplayServer.m: * Source/NSApplication.m: * Source/NSFont.m: * Source/NSInterfaceStyle.m: * Source/NSTableColumn.m: Documentation fixups ... correct gsdoc markup etc. 2002-08-28 Fred Kiefer * Source/NSBezierPath.m Implemented [appendBezierPathWithArcFromPoint:toPoint:radius:] with code from Alexander Malmberg . 2002-08-27 Adam Fedor * Source/NSBrowser.m (-tile): Set horizontal scroller frame only if we have one. 2002-08-26 Adam Fedor * Model/GMAppKit.m (-initWithModelUnarchiver:): Don't add ourselves to the superview if we are the contentView of an NSBox. * Tools/example.m ([ExampleServices -openURL:userData:error:]): Get browser from defualts. Use mozilla if none. (Modified patch from Stefan Urbanek). 2002-08-24 Adam Fedor * Source/NSGraphicsContext.m: More documentation. * Source/NSWindow.m (-sendEvent:): Remember mouseDown view and send mouseUp to this view (not firstResponder). * Model/test.m: Fix so it reads in gmodel from command line. * Source/GNUmakefile: Correct docs so they are built in Documentation/Gui directory * Source/GNUmakefile.postamble: Extra rules for building docs. * Documentation/Gui: New directory for docs. * Documentation/gsdoc: Remove. 2002-08-23 02:39 Alexander Malmberg * Source/NSImage.m (-lockFocusOnRepresentation:): Use a compositerect to clear the alpha channel if the background color isn't opaque. 2002-08-16 Adam Fedor * Source/NSGraphicsContext.m: Define colorspace constants 2002-08-15 Adam Fedor * configure.ac: Add NetBSD header/ldflag support (Patch from Peter Cooper). Cleanup freebsd support. * Headers/gnustep/gui/GSDisplayServer.h: Replace APPKIT_DECLARE with APPKIT_EXPORT. * Headers/gnustep/gui/NSGraphics.h: Idem. * Headers/gnustep/gui/NSGraphicsContext.h: Idem. * Headers/gnustep/gui/NSPanel.h: Idem. Fri Aug 9 12:12:18 2002 Georg Fleischmann * Source/NSWindow.m ([-setFrameFromString:]), ([-stringWithSavedFrame]): Don't flip coordinates to make it compatible with OpenStep. 2002-08-05 Pierre-Yves Rivaille * Source/NSSplitView.m [NSplitView -setFrame:]: adjust the subviews. [NSSplitView -resizeWithOldSuperviewSize:]: send the splitview's old size not the superview's old size to [NSSplitView -_adjustSubviews:] [NSSplitView -displayIfNeededInRectIgnoringOpacity:] [NSSplitView -displayRectIgnoringOpacity:] set _never_displayed_before before calling _adjustSubviews. It could lead to a loop, if the delegate was calling -display. 2002-08-03 Pierre-Yves Rivaille * Source/NSView.m ([NSView -replaceSubview:withSubview]): The replacing subview was not inserted at the old subview's location. 2002-08-02 Adam Fedor * Merge changes from 0.8.0 into main branch. 2002-08-02 Pierre-Yves Rivaille * Source/NSTabView.m ([NSTabView -initWithCoder:]): Set _selected ivar based on _selected_item value. 2002-08-01 Adam Fedor * configure.ac: Check for recent version of audiofile 2002-07-31 Adam Fedor * Headers/gnustep/gui/AppKit.h: Add NSSound. * Source/GNUmakefile (AUTOGSDOC_HEADERS): Idem. * Tools/gsnd/GNUmakefile (GNUSTEP_INSTALLATION_DIR): Add. 2002-07-30 Adam Fedor * configure.ac: Check for autofile header/libs. * Source/NSBundleAdditions.m (pathForSoundResource:): New. * Source/NSSound.m: New file * Headers/gnustep/gui/NSSound.h: Idem. * Tools/gsnd: New server tool. (Implementation from Enrico Sersale). 2002-07-18 Gregory John Casamento * NSBundleAdditions.m: (-[awakeWithContext:]) Corrected a problem in this method which was preventing awakeFromNib from being called on NSOwner. I have confirmed that this is the correct behavior on OPENSTEP 4.2/Mach. 2002-07-18 Gregory John Casamento * Source/NSOutlineView.m: Removed an extraneous NSLog. * Tools/GSspell.m: Changed registration of spell checker to AmericanEnglish. * Tools/GSspellInfo.plist: Changed .plist to reflect the new name. The spell checker was registering itself for simply "English" and was not being started when a request to check spelling in a document was being issued. It should work now. 2002-08-01 Adam Fedor * Version:0.8.0 Tue Jul 30 11:07:45 2002 Nicola Pero Patch by David Ayers (), modified: * Source/NSTextView.m ([-_syncTextViewsByCalling:withFlag:]): Compute the imp for each different textview, not just once for all, so that we should be able to manage the case where they are of different NSTextView subclasses. (NSTEXTVIEW_SYNC): Removed the argument; just use _cmd as the selector; updated all users. 2002-07-26 Adam Fedor * Source/NSStringDrawing.m (setupSpecialRun): Set run width (patch from Nicholas Roard). * Source/NSPrintInfo.m (+initPrintInfoDefaults): Add missing ';' Thu Jul 25 12:51:52 2002 Nicola Pero * Source/NSApplication.m ([+sharedApplication]): Rewritten; documented verbosely the method. ([-init]): Rewritten code checking, setting and managing NSApp; documented verbosely the method. 2002-07-22 Adam Fedor * Source/NSImageCell.m (-setImage:): Check if non-nil. Make sure size is not 0. Mon Jul 22 12:50:34 2002 Nicola Pero * Source/NSApplication.m (initialize_gnustep_backend): Remove useless instruction in loop looking for the backend. (Patch by David David Relson ). 2002-07-20 Adam Fedor * Source/NSWindow.m (-_initDefaults): Set background to windowBackgroundColor. 2002-07-19 Adam Fedor * Source/NSImage.m (-lockFocusOnRepresentation:): Make sure newly created cache image is valid. * Source/NSCursor.m (backgroundColorHint:): Remove extra NSLog. 2002-07-17 Adam Fedor * Version: 0.7.9 * Documentation/news.texi: Update * Documentation/gsdoc/*: Updated from source files. * Source/NSWorkspace.m: Comment fix. Wed Jul 17 15:24:54 2002 Nicola Pero * Headers/gnustep/gui/NSTextView.h ([-becomeKeyWindow]): Declare. Wed Jul 17 15:23:28 2002 Nicola Pero Patch from David Ayers : * Source/NSTextView.m ([-becomeKeyWindow]): Implemented. * Source/NSWindow.m ([-becomeKeyWindow]): Set the _f.is_key flag immediately after checking it. Tue Jul 16 19:40:04 2002 Nicola Pero * Source/NSWindow.m ([-cacheImageInRect:]): Intersect the rectangle with the window view frame, not the content view frame. ([-restoreCachedImage]): Draw in the window view, not in the content view. Mon Jul 15 15:55:21 2002 Nicola Pero * Source/NSWindow.m ([NSWindow +initialize]): Removed left-over NSLog call. 2002-07-14 Adam Fedor * Headers/gnustep/gui/NSTabView.h: Add missing method. 2002-07-14 Gregory John Casamento * Source/NSTableView.m: [-NSTableView _editNextEditableCellAfterRow:column:] corrected a problem with the loop which seeks the next editable cell. It was using incorrect values in the call to isCellEditable in the second for which was causing an exception to be thrown. * Source/NSOutlineView.m: ([-editColumn:row:withEvent:select:]) corrected a problem in this method which was causing the cell to be drawn incorrectly when editing a column other than the outline column. Fri Jul 12 12:55:17 2002 Nicola Pero Patch from Benhur Stein : * Headers/gnustep/gui/NSWindow.h (_cachedImage, _cachedImageOrigin): New instance variables. * Source/NSWindow.m ([-dealloc]): Release _cachedImage if needed. ([-display]): Invoke discardCachedImage. ([-cacheImageInRect:]): Implemented. ([-discardCachedImage]): Implemented. ([-restoreCachedImage]): Implemented. Fri Jul 12 11:49:50 2002 Nicola Pero Patch from Jeff Teunissen : * Source/NSMatrix.m ([-selectAll:]): Do nothing when in radio mode. 2002-07-11 Adam Fedor * Source/NSMenu.m (-_createWindow): Set to NOT work when in modal loop. * Images/common_RadioOff.tiff * Images/common_RadioOn.tiff * Images/common_outlineCollapsed.tiff * Images/common_outlineExpanded.tiff * Images/common_outlineUnexpandable.tiff: Transparency fixes (From deek@d2dc.net). 2002-07-11 Pierre-Yves Rivaille * Source/NSButtonCell.m ([-isOpaque]): New behaviour that is more consistent with our look and feel * Source/NSMatrix.m ([-drawCellAtRow:column:]): Draws matrix's background if needed and make the opaque ancestor redraw if the matrix is not opaque. ([-_drawCellAtRow:column:]): New private method to avoid looping ([-drawRect:]): Use _drawCellAtRow:column instead of drawCellAtRow:column. * Source/GSSimpleLayoutManager.m ([-rebuildForRange:delta:inTextContainer:]): Empty lines are not fixed height anymore. The height does now depend on the current font or on the current paragraph's settings. 2002-07-11 Gregory John Casamento * Source/NSOutlineView.m: ([-editColumn:row:withEvent:select:]) Needed to override this method in NSOutlineView since attempting to edit a cell in an NSOutlineView was causing a crash. Also, NSTableView's version of this method does not draw the button image correctly. * Source/NSTableView.m: Added a new methods [-_objectValueForTableColumn:row:] and [-_setObjectValue: forTableColumn:row:] to both this class and to NSOutlineView to allow more code reuse between the NSOutlineView and NSTableView. Mon Jul 8 13:55:13 2002 Nicola Pero * Source/NSSavePanel.m ([-createRowsForColumn:]): Removed usage of nested function which was causing the library not to compile on some platforms. (compareFilenames): New static function doing the same. 2002-07-05 Adam Fedor * Images/common_ArrowDown.tiff: Transparency fix. * Images/common_ArrowDownH.tiff: Idem. * Images/common_ArrowLeft.tiff: Idem. * Images/common_ArrowLeftH.tiff: Idem. * Images/common_ArrowRight.tiff: Idem. * Images/common_ArrowRightH.tiff: Idem. * Images/common_ArrowUp.tiff: Idem. * Images/common_ArrowUpH.tiff: Idem. (From deek@d2dc.net.) * Source/NSFont.h: Add documentation. * Source/NSImage.m (-compositeToPoint:fromRect:operation:): Log exception. (-dissolveToPoint:fromRect:fraction:): Idem. * Documentation/gsdoc/DefaultsSummary.gsdoc: Update. 2002-07-04 Fred Kiefer * Source/NSColor.m Changed initSystemColors() and [defaultsDidChange:] so that setting a system colour in the defaults file works again. Tue Jul 2 17:01:25 2002 Nicola Pero * Source/GNUmakefile (libgnustep-gui_HEADER_FILES): Removed - temporarily? - NSValidatedUserInterfaceItem.h - because that file does not exist on CVS at the moment. Tue Jul 2 16:52:28 2002 Nicola Pero Suggestion by Fred Kiefer, David Ayers : * Source/NSTextView.m ([-resignKeyWindow]): New method - if needed draw the insertion point, then stop blinking. * Headers/gnuste/gui/NSTextView.h: Declare the method. 2002-06-30 Fred Kiefer * Headers/gnustep/gui/NSToolbarItem.h Corrected #include so that it compiles. 2002-06-30 Gregory John Casamento * Headers/gnustep/gui/NSWindow.h: Added declaration for NSToolbar in NSWindow. * Headers/gnustep/gui/AppKit.h: Added #include lines for new header files in the AppKit.h file. * Source/NSWindow.m: Added code foe setToolbar method. * Source/GNUmakefile: Added NSToolbar and NSToolbarItem classes and headers to the makefile. * Source/NSOutlineView.m: Added dealloc for NSOutlineView to prevent memory leaks. * Source/NSSecureTextField.m: Removed some extraneous comments which were left from before I implemented the class. * Source/externs.m: Added notification constants for NSToolbar. * Source/NSToolbar.m: Added skeleton for implementation. * Source/NSToolbarItem.m: Added skeleton for implementation. * Headers/gnustep/gui/NSToolbar.h: Added. * Headers/gnustep/gui/NSToolbarItem.h: Added. 2002-06-28 Richard Frith-Macdonald * Source/NSWindow.m: ([-flushWindow]) don't flush context for non-retained windows unless flushing is enabled. Actually I'm not sure about this ... according to the documentation this method should never flush non-retained windows anyway. Thu Jun 27 11:49:57 2002 Nicola Pero * Source/NSTextField.m ([-textDidEndEditing:]): Set _text_object to nil too before posting the NSControlTextDidEndEditing notification. 2002-06-27 Richard Frith-Macdonald * Source/NSWorkspace.m: Fix error in testing base path for app. Wed Jun 26 17:50:39 2002 Nicola Pero * Source/NSTextField.m ([-textDidEndEditing:]): Post the NSControlTextDidEndEditingNotification *after* we end editing, not before! * Source/NSMatrix.m ([-textDidEndEditing:]): Idem. * Source/NSTableView.m ([-textDidEndEditing:]): Idem. 2002-06-24 Richard Frith-Macdonald * Source/NSWorkspace.m: Comitted Jeffs latest attemtpt at handling lookup of apps by name correctly ... but rewritten somewhat to remove one assumption I thought was unwarrented, and to try to conform to what the MacOS-X implementation actually does rather than what the MacOS-X documentation says it should do. Mon Jun 24 13:17:37 2002 Nicola Pero Originated by a patch/suggestion by Serg Stoyan , rewritten by myself. * Source/GSSimpleLayoutManager.m (defaultFontHeight): New static inline function computing the height of the user font of the default size. ([-boundingRectForGlyphRange:inTextContainer:]): Use defaultFontHeight() instead of hardcoded 12. ([-lineFragmentRectForGlyphAtIndex:effectiveRange:]): Idem. ([-rectForCharacterIndex:]): Idem. ([-rebuildForRange:delta:inTextContainer:]): Idem. ([-rebuildForRange:delta:inTextContainer:]): Idem. * Source/NSTextView.m ([-updateInsertionPointStateAndRestartTimer:]): Removed unused code setting font size to 12 if it was 0. Sat Jun 22 17:26:18 2002 Nicola Pero * Source/NSMenuView.m ([-itemAdded:]): Fixed highlighting of cells. Sat Jun 22 16:46:59 2002 Nicola Pero * Headers/gnustep/gui/NSInputManager.h ([-loadBindingsFromFile:]): Made it a public method. * Source/NSInputManager.m ([-initWithName:host:]): Changed the way in which keybindings loading is controlled via user defaults, now simpler and more powerful. Hopefully this is the final version. * Documentation/gsdoc/DefaultsSummary.gsdoc: Documented the keybinding defaults. * Documentation/gsdoc/DefaultsSummary.html: Regenerated. Sat Jun 22 15:19:31 2002 Nicola Pero * Headers/gnustep/gui/NSAffineTransform.h (rotationAngle): Instance variable removed. Optimize for case of unrotated views. * Source/NSAffineTransform.m ([+transform]): Do not set rotationAngle. ([+new]): Do not set rotationAngle. ([-appendTransform:]): Do not recompute rotationAngle. ([-init]): Do not set rotationAngle. ([-initWithTransform:]): Do not set rotationAngle. ([-prependTransform:]): Do not compute rotationAngle. ([-rotateByDegrees:]): Do not compute rotationAngle. ([-makeIdentityMatrix]): Do not set rotationAngle. ([-rotateByRadians:]): Do not compute the angle in degrees; do not compute rotationAngle. ([-setTransformStruct:]): Do not set rotationAngle. ([-scaleTo::]): Optimize out the case of rotated transforms. ([-setFrameRotation:]): Always call -rotationAngle. ([-rotationAngle]): Always compute rotationAngle. ([-concatenateWithMatrix:]): Do not set rotationAngle. ([-boundingRectFor:result:]): Always compute rotationAngle. Sat Jun 22 15:06:44 2002 Nicola Pero * Source/NSAffineTransform.m ([-isRotated]): Rewritten - efficient implementation by simply checking that the cross matrix elements are not 0. Sat Jun 22 14:59:36 2002 Nicola Pero * Source/NSAffineTransform.m ([-set]): Removed code to create a float[6] matrix which is no longer used. Sat Jun 22 14:53:27 2002 Nicola Pero * Headers/gnustep/gui/NSAffineTransform.h ([-rotateByAngle:]): Method removed. * Source/NSAffineTransform.m Idem. * Source/NSAffineTransform.m ([-setFrameRotation:]): Use rotateByDegrees:, not rotateByAngle: Sat Jun 22 14:52:19 2002 Nicola Pero * Source/NSView.m ([-rotateByAngle:]): Use -rotateByDegrees:, not -rotateByAngle:, to rotate the affine transform. Sat Jun 22 14:46:35 2002 Nicola Pero * Headers/gnustep/gui/NSAffineTransform.h ([+matrixFrom:]): Method removed. * Source/NSAffineTransform.m: Idem. Sat Jun 22 14:34:15 2002 Nicola Pero * Source/NSView.m ([-_rebuildCoordinates]): Use -invert, not -inverse, to invert a NSAffineTransform. Sat Jun 22 14:26:06 2002 Nicola Pero * Headers/gnustep/gui/NSAffineTransform.h, * Source/NSAffineTransform.m ([-scaleBy::]): Method removed. Better use the standard scaleXBy:yBy: instead. 2002-06-22 Adam Fedor * Source/NSApplication.m (-finishLaunching): Revert last change. 2002-06-21 Adam Fedor * Source/NSApplication.m (-finishLaunching): Use makeKeyWindow not becomeKeyWindow. * Source/NSWindow.m (-canBecomeKeyWindow): Conform to docs. don't check if visible or miniaturized. (-canBecomeMainWindow): Idem for miniaturized only. (-makeKeyWindow): Check if visible, miniaturized. (-makeMainWindow): Idem. Wed Jun 19 15:54:39 2002 Georg Fleischmann * Source/NSMenu.m ([-performActionForItemAtIndex:]): Select item for any kind of popup action. 2002-06-17 Richard Frith-Macdonald * Source/NSWorkspace.m: Vague attempt to improve locating of apps 2002-06-15 Gregory John Casamento * Source/NSOutlineView.m a number of improvements: -setDataSource now uses the CHECK_REQUIRED macro to check for required methods instead of iterating over a list of strings. -expandItem:expandChildren: corrected bug which prevented the method from working correctly when expandChildren is YES. -collapseItem:collapseChildren: corrected bug which prevented the method from working correctly when expandChildren is YES. 2002-06-12 Alexander Malmberg * Source/GSServicesManager.m (-rebuildServicesMenu): Disable auto- enabling while updating the menu. 2002-06-12 Alexander Malmberg * Source/GSServicesManager.m (-loadServices): Only update timestamp when the file has changed. (-rebuildServicesMenu): Correctly remove the old menu items. Tue Jun 11 14:11:22 2002 Nicola Pero Patch by Jeff Teunissen with changes by myself: * TextConverters/RTF/RTFConsumer.h (GSTextConsumer): Added ivar _class. * TextConverters/RTF/RTFConsumer.m: Changed everywhere to support the caller specifying the type of class it needs to be produced. * Headers/gnustep/gui/GSTextConverter.h: Added a class argument to have the text converter save the results of parsing into attributed strings of different classes depending on the case. * Source/NSAttributedString.m: When parsing using the text converters, have them create attributed strings of our own class. Tue Jun 11 13:35:41 2002 Nicola Pero * TextConverters/RTF/GNUmakefile.preamble (ADDITIONAL_CPPFLAGS): Use -Wall when compiling. 2002-06-10 Adam Fedor * Version 0.7.8 * Documentation/news.texi: Update 2002-06-11 Alexander Malmberg * Source/GSServicesManager.m, Headers/gnustep/gui/GSServicesManager.h: Fix handling of NSMenuItem:s (were being handled as NSCell:s in many places; this broke submenus of the services menu). 2002-06-10 Georg Fleischmann * Source/NSControl.m ([NSControl -mouseDown:]): Set NSPeriodicMask for continuous cells, and 0 otherwise. 2002-06-10 Georg Fleischmann * Model/GMAppKit.m ([NSCell -encodeWithModelArchiver:]): Restore sendActionMask. 2002-06-10 Alexander Malmberg * Source/GSServicesManager.m (-performService:...): Create and use a local copy of the NSPasteboard. 2002-06-08 Alexander Malmberg * Source/NSWindow.m (-_initDefaults): Make _miniaturizedImage default to the application icon. 2002-06-08 Alexander Malmberg * Source/GSServicesManager.m (-doService:): Only try to write/read selection if the send/return type isn't nil. Fix calls to NSRunAlertPanel() so they don't do printf() expansion on the message twice. Thu Jun 6 08:29:42 2002 Nicola Pero * Source/NSScroller.m ([NSScroller -setFrame:]): Do not add scroller arrows if they aren't already there (Patch by Jeff Teunissen). Thu Jun 6 07:23:59 2002 Nicola Pero * Source/NSApplication.m ([NSApplication -terminate:]): Send the -applicationShouldTerminate: messages from self, instead of from the sender of -terminate: (Patch by Jeff Teunissen). 2002-06-06 Richard Frith-Macdonald * Source/NSBundleAdditions.m: patch by Jeff Teunissen to log loading only as debug. WWed Jun 5 14:09:04 2002 Nicola Pero * Source/GSKeyBindingAction.h: Cleaned syntax of #endif to remove compiler warnings. 2002-06-03 Adam Fedor * Source/GSDisplayServer.m (-beep): New method. * Source/NSGraphicsContext.m (-NSBeep): Use it. 2002-06-02 Alexander Malmberg Add basic color picker bundles: the wheel color picker and the standard rgb/hsb/cmyk/gray picker. * GNUmakefile: Add ColorPickers subproject. * ColorPickers/: New files. Sun May 26 13:46:58 2002 Nicola Pero * Source/NSMatrix.m ([-_privateFrame:mode:numberOfRows:numberOfColumns:]): Do not make the cell size integers. Any approximation is a loss of information, and by approximating without reason at this stage we are downgrading the information we pass to the backend - information which the backend can use to render better. A longer explanation of why this change is appropriate in the source code. ([-_rebuildLayoutAfterResizing]): New method with code taken from -resizeWithOldSuperviewSize:; rewritten not to compute changes incrementally, and not to round up sizes without reason. ([-setFrame:], [-setFrameSize:]): New methods. ([-resizeWithOldSuperviewSize:]): Removed. 2002-05-17 Georg Fleischmann * gui/Source/GSSimpleLayoutManager.m ([-lineLayoutIndexForPoint:]): cast the count of _lineLayoutInformation to integer in MAX(). test if max is zero. ([-glyphRangeForLineLayoutRange:]): test if count of _lineLayoutInformation is zero. ([-drawLinesInLineRange:]): test if count of _lineLayoutInformation is zero (Modification by Nicola). Wed May 22 13:02:02 2002 Nicola Pero * Source/Functions.m (NSHighlightRect): Do not flush the window. * Source/NSSplitView.m ([-mouseDown:]): Replace manual calls to PS composite operators with NSHighlightRect; manually flush the window after highlighting the appropriate rects. * Source/NSTableHeaderView.m: Everywhere, added a flush window after each call to NSHighlightRect. Tue May 21 16:54:20 2002 Nicola Pero * Source/NSBrowser.m ([-setPath:]): Fixed bug - column variable which was declared unsigned instead of int (Patch by Andreas Bohne ). 2002-05-17 Fred Kiefer * Source/NSMenuView.m [rectOfItemAtIndex:] for horizontal orientation set items from left to right. [locationForSubmenu:] for horizontal orientation set submenu below the item in self. 2002-05-13 Georg Fleischmann * gui/Source/NSPrintOperation.m [NSPrintOperation(GSEPSPrintOperation) -createContext:]: add local autorelease pool to remove autorelease of context. 2002-05-13 Fred Kiefer * Source/NSColor.m In initSystemColors() and systemColorWithName() replaced implementation of system colours with named colours from a stored colour list. Added conversion cache for named colours. This allows easy configuration of system colours while keeping the same performance. * Source/NSFont.m Moved the caching of fonts from [initWithName:matrix:] to [fontWithName:matrix:] so that unneeded fonts are no longer created. In [labelFontSize], [smallSystemFontSize] and [systemFontSize] get values from defaults if available. In getNSFont() removed hard coded 12, will be relaced by default for NSUserFontSize. Sun May 12 10:08:34 2002 Nicola Pero * Headers/gnustep/gui/NSTextView.h: Removed ivar _tvf.is_in_dealloc. * Source/NSTextView.m ([-dealloc]): Set the textStorage to nil when releasing it; run the other dealloc cleanups during the recursive invocation rather than during the first invocation; use the _textStorage ivar instead of _tvf.is_in_dealloc. (Patch by Alexander Malmberg ). 2002-05-11 Richard Frith-Macdonald * Source/NSStringDrawing.m: drawRun() use GSFromUnicode() API for conversion. Fri May 10 11:24:38 2002 Nicola Pero * Source/NSRulerView.m ([NSRulerView -dealloc]): Do not release the scrollview (Suggested by Benhur Stein ). 2002-05-07 Adam Fedor * Source/NSFont.m (-initWithName:matrix:): If matrix is ident, set matrixExplicitlySet to NO (-set): If the focus view is flipped and matrix not set, set our flipped font equivalent. 2002-05-06 Adam Fedor * Source/NSGraphicsContext.m: More documentation. * Source/NSStringDrawing.m (drawRun): stroke the underline. 2002-05-02 Adam Fedor * configure.ac: Update to autoconf 2.53 from configure.in * configure, Headers/gnustep/gui/config.h.in: Regenerate. * Headers/gnustep/gui/config.h.bot: Remove. 2002-05-01 Adam Fedor * Source/NSView.m (-resizeWithOldSuperviewSize:): Check object before getting struct. (Solaris limitation). 2002-04-30 Adam Fedor * Version: 0.7.7 * Documentation/news.texi: Update * NEWS: Regen. Fri Apr 26 12:45:07 2002 Gregory John Casamento * Source/NSOutlineView.m: Added a patch by Alex Malmberg to correct behavior of the NSOutlineView when the outline column is not in the leftmost position. Wed Apr 24 10:54:47 2002 Nicola Pero * Model/GMAppKit.m ([NSMenuItem -initWithModelUnarchiver:]): Do not set submenu if it's nil; decode target in normal place. (Suggestion by Georg Fleischmann ). 2002-04-23 Adam Fedor * Source/GSDisplayServer.m (mouseLocationOnScreen:window:): New * Source/NSScreen.m (screenNumber): New. * Source/NSWindow.m (mouseLocationOutsideOfEventStream): Use them. * Tools/gpbs.m: Remove. 2002-04-22 Adam Fedor * Headers/gnustep/gui/GSDisplayServer.h: Add attribute strings. New window::: method. * Headers/gnustep/gui/NSWindow.h: Add screen ivar plus some extra reserved ivars. * Source/GSDisplayServer.m: Add attribute strings. (window::::): New (window:::): Implement in terms of window:::: * Source/NSWindow.m: (defaultDepthLimit): Implement. (dealloc): Release _screen. (_initBackendWindow:): Interface change: pass frame rect to window server window creation (not content rect). Pass screen number. (initWithContentRect:...): Save screen, depthLimit; (canStoreColor): Check depthLimit correctly. (deepestScreen): Return screen. (screen): Idem. Sun Apr 21 12:57:36 2002 Nicola Pero * Model/GMAppKit.m ([NSWindow -encodeWithModelArchiver:]): If not on gnustep-gui, always add NSTitledWindowMask to non NSBorderless windows to work around a bug in OpenStep (patch by Georg Fleischmann with changes). Sun Apr 21 11:44:01 2002 Nicola Pero * Source/libgnustep-gui.def: Added __objc_class_name_NSOutlineView. 2002-04-19 Richard Frith-Macdonald * Tools/gpbs.m: If given -NSHost specification for the current host, ignore it and use the standard name. 2002-04-18 Ludovic Marcotte * Source/NSOutlineView.m and Headers/gnustep/gui/NSOutlineView.h: Fixed some issues with the delegate methods. Thu Apr 18 11:14:22 2002 Nicola Pero * Headers/gnustep/gui/AppKitDefines.h (APPKIT_DECLARE): Updated Windows DLL import/export #define machinery to the new gnustep-make conventions. 2002-04-17 Pierre-Yves Rivaille * Source/NSMenuItem.m: ([NSMenuItem -initWithCoder:], [NSMenuItem -encodeWithCoder:]) New encoding scheme. With the new scheme, menus can be loaded properly from a gorm file. 2002-04-16 Richard Frith-Macdonald * Source/NSPasteboard.m: Improve logging on server startup. Tue Apr 16 11:55:30 2002 Nicola Pero * Tools/gpbs.m (main): Fixed typo in log message - use gpbs, not gdnc, as log prefix. 2002-04-14 Adam Fedor * Headers/gnustep/gui/NSGraphicsContext.h (GSCurrentDevice): Change from DPScurrentgcdrawable. (GSSetDevice): Change from DPSsetgcdrawable. * Headers/gnustep/gui/DPSOperators.h: Idem. * Headers/gnustep/gui/GSMethodTable.h: Idem. * Headers/gnustep/gui/PSOperators.h: Idem. * Source/NSGraphicsContext.m: * Headers/gnustep/gui/GSDisplayServer.h: Remove findwindow::::. * Source/GSDisplayServer.m: Likewise. 2002-04-11 Adam Fedor * Headers/gnustep/gui/config.h.bot: New define if rint missing * Source/NSBrowser.m: Use it. * Source/NSRulerView.m: Idem. * Source/NSMatrix.m: Idem. * Source/NSClipView.m: Idem. Thu Apr 11 22:51:09 2002 Nicola Pero * Source/NSButtonCell.m ([-cellSize]): Use more space around bezeled/bordered buttons not containing only an image so that they get more pleasantly autosized without manual intervention. * Source/GSMemoryPanel.m ([-init]): Do not manually adjust the button size. Thu Apr 11 22:15:51 2002 Nicola Pero * Headers/gnustep/gui/NSAttributedString.h: Do not #include the whole , but rather use the minimum @class and #include needed to have it parsed - so that everything compiles faster. * Headers/gnustep/gui/NSProgressIndicator.h: Added missing @class and #include directives. * Headers/gnustep/gui/NSTextStorage.h: Added missing #include. * Headers/gnustep/gui/NSTextView.m: Added missing @class. * Source/GSComboSupport.m: Added missing #includes. * Source/GSInfoPanel.m: Idem. * Source/GSServicesManager.m: Idem. * Source/NSApplication.m: Idem. * Source/NSBox.m: Idem. * Source/NSBrowser.m: Idem. * Source/NSBrowserCell.m: Idem. * Source/NSBundleAdditions.m: Idem. * Source/NSButtonCell.m: Idem. * Source/NSCell.m: Idem. * Source/NSColorPanel.m: Idem. * Source/NSColorPicker.m: Idem. * Source/NSColorWell.m: Idem. * Source/NSComboBoxCell.m: Idem. * Source/NSControl.m: Idem. * Source/NSFontPanel.m: Idem. * Source/NSHelpManager.m: Idem. * Source/NSLayoutManager.m: Idem. * Source/NSMatrix.m: Idem. * Source/NSMenu.m: Idem. * Source/NSMenuItem.m: Idem. * Source/NSMenuView.m: Idem. * Source/NSOpenPanel.m: Idem. * Source/NSOutlineView.m: Idem. * Source/NSProgressIndicator.m: Idem. * Source/NSSavePanel.m: Idem. * Source/NSScroller.m: Idem. * Source/NSScrollView.m: Idem. * Source/NSSpellChecker.m: Idem. * Source/NSStepper.m: Idem. * Source/NSTableColumn.m: Idem. * Source/NSTableHeaderView.m: Idem. * Source/NSTableView.m: Idem. * Source/NSText.m: Idem. * Source/NSTextField.m: Idem. * Source/NSTextFieldCell.m: Idem. * Source/NSTextView.m: Idem. * Source/NSWindow.m: Idem. * Source/NSMatrix.m ([-dealloc]): End editing if while editing. Thu Apr 11 16:20:54 2002 Nicola Pero * Headers/gnustep/gui/NSResponder.h: Include NSObject.h, not NSCoder.h; declare @class NSCoder. Thu Apr 11 15:37:31 2002 Nicola Pero * Source/GSTextStorage.m ([GSTextStorage -sanity]): Renamed to -_sanity, and changed so that we always compile this in so that regression testcases can use it. Thu Apr 11 08:54:16 2002 Nicola Pero * Source/GSTable.m ([+new]): New method working around a bug in OSX ... with this, except for #include fixups, the box code works on OSX. (Suggested by Helge Hess). 2002-04-10 Adam Fedor * Headers/gnustep/gui/config.h.bot: New file implements RINT defs. * Headers/gnustep/gui/config.h.in: Regen. * Source/NSBrowser.m: Remove RINT defs. * Source/NSRulerView.m: Likewise. * Headers/gnustep/gui/AppKitExceptions.h: Add GNUstep exception. * Source/externs.m: Idem. * Headers/gnustep/gui/DPSOperators.h: Remove currentgstate, gstate * Headers/gnustep/gui/PSOperators.h: Idem. * Headers/gnustep/gui/GSMethodTable.h: Idem. * Headers/gnustep/gui/NSGraphicsContext.h: Idem. * Source/NSGraphicsContext.m: Idem. Redefine subclassResponsibility to throw our own exception. * Headers/gnustep/gui/GSDisplayServer.h: Prefix functions with APPKIT_DECLARE. Fix windowbacking def. * Source/libgnustep-gui.def: Add GSDisplayServer. Tue Apr 9 23:04:43 2002 Nicola Pero * Source/GSTable.m ([-setFrame:], [-setFrameSize:]): New methods. ([-resizeWithOldSuperviewSize:]): Removed; code moved into -_updateForNewFrameSize:. ([-_updateForNewFrameSize:]): New method. Everywhere: use [super setFrameSize:xxx], not [self setFrameSize:xxx] to set the frame size after autoresizing operations. * Source/GSTable.m ([-lockFocusInRect:, -unlockFocusNeedsFlush:]): Removed. Tue Apr 9 22:28:12 2002 Nicola Pero Patch by Alexander Malmberg : * Source/NSScroller.m ([-setFloatValue:knobProportion:]): Make sure we mark the scroller knob slot as needing redisplay. 2002-04-08 Ludovic Marcotte * Source/NSMenuView.m (-dealloc): Modified the dealloc method so that we remove the menu view from the menu list of observers. We could otherwise receive notifications on a dealloc'ed object and segfault. 2002-04-06 Adam Fedor * Source/NSView.m (-_cleanupPrinting): Private method to cleanup after an exception. * Source/NSPrintOperation.m (-_runOperation): Use it. 2002-04-03 Fred Kiefer * Images/common_RightTabStop.tiff * Images/common_LeftTabStop.tiff * Images/common_CenterTabStop.tiff * Images/common_DecimalTabStop.tiff * Images/GNUmakefile Added new icons for tab stop display in ruler views and install them from the make file. * Source/NSRulerView.m Added method [mouseDown:]. Added safety check for unchanged client view in [setClientView:]. In [drawHashMarksAndLabelsInRect:] use [NSFont smallSystemFontSize] instead of hard coded size. * Source/NSRulerMarker.m Corrected [drawRect:]. * Source/NSTextView.m In [updateRuler] set the client view of the ruler view. 2002-04-05 Adam Fedor * Source/NSApplication.m (initialize_gnustep_backend): Better debugging info. * Source/NSPrintOperation.m ([NSPrintOperation -destroyContext]): Remove old context method. 2002-04-06 Pierre-Yves Rivaille * Source/NSOutlineView.m ([NSOutlineView -performDragOperation:]): Fixed issue on drag'n'drop. Fri Apr 5 00:13:41 2002 Nicola Pero * TextConverters/RTF/GNUmakefile.preamble (ADDITIONAL_LIB_DIRS): Fixed typo so that it compiles again. 2002-04-03 Fred Kiefer * Source/NSRulerView.m Added handling for missing rint function, copied over from NSBrowser. * Source/NSTextView.m Made [updateRuler] save against missing rulers. 2002-04-02 Adam Fedor * Documentation/gsdoc/DefaultsSummary.gsdoc: Update. * Documentation/gsdoc/Gui.gsdoc: Idem. * Headers/gnustep/gui/NSAffineTransform.h: Tidy for autogsdoc. * Headers/gnustep/gui/NSButtonCell.h: Idem. * Headers/gnustep/gui/NSCell.h: Idem. * Headers/gnustep/gui/NSClipView.h: Idem. * Headers/gnustep/gui/NSFont.h: Idem. * Headers/gnustep/gui/NSFontManager.h: Idem. * Headers/gnustep/gui/NSOutlineView.h: Idem. * Headers/gnustep/gui/NSRulerView.h: Idem. * Headers/gnustep/gui/NSSavePanel.h: Idem. * Source/GSHbox.m: Idem. * Source/GSVbox.m: Idem. * Source/NSCachedImageRep.m: Idem. * Source/NSCell.m: Idem. * Source/NSClipView.m: Idem. * Source/NSDocument.m: Idem. * Source/NSFont.m: Idem. * Source/NSFontManager.m: Idem. * Source/NSFontPanel.m: Idem. * Source/NSFormCell.m: Idem. * Source/NSGraphicsContext.m: Idem. * Source/NSHelpManager.m: Idem. * Source/NSImage.m: Idem. * Source/NSPanel.m: Idem. * Source/NSRulerView.m: Idem. * Source/NSStepperCell.m: Idem. * Source/NSText.m: Idem. 2002-04-02 Adam Fedor * Source/NSGraphicsContext.m (-GSDefineGState): Document new definition of method. * Source/NSWindow.m ([NSWindow -_initBackendWindow:]): Change to match new def. * Source/NSView.m ([NSView -lockFocusInRect:]): Idem. 2002-04-02 Pierre-Yves Rivaille * Source/NSTableView.m ([NSTableView -scrollRowToVisible:]): ([NSTableView -scrollColumnToVisible:]): Bugfix in getting the visibleRect. Tue Apr 2 10:28:46 2002 Nicola Pero * Source/NSButtonCell.m ([-setSound:]): Retain the sound. ([-dealloc]): Release it. * Source/NSTableView.m ([-dealloc]): Abort editing. Tue Apr 2 09:40:48 2002 Nicola Pero * Headers/gnustep/gui/NSApplication.h: Tidied up some #include and @class machinery for efficiency. * Headers/gnustep/gui/NSDocument.h: Idem. * Headers/gnustep/gui/NSDragging.h: Idem. * Headers/gnustep/gui/NSImage.h: Idem. * Headers/gnustep/gui/NSImageRep.h: Idem. * Headers/gnustep/gui/NSMenu.h: Idem. * Headers/gnustep/gui/NSMenuItem.h: Idem. * Headers/gnustep/gui/NSWindowController.h: Idem. * Headers/gnustep/gui/NSWorkspace.h: Idem. * Source/NSApplication.m: Added missing #includes. * Source/NSComboBox.m: Idem. * Source/NSCustomImageRep.m: Idem. * Source/NSEPSImageRep.m: Idem. * Source/NSFontManager.m: Idem. * Source/Functions.m: Idem. * Source/NSHelpManager.m: Idem. * Source/NSMenu.m: Idem. * Source/NSMenuItem.m: Idem. * Source/NSMenuItemCell.m: Idem. * Source/NSPopUpButtonCell.m: Idem. * Source/NSResponder.m: Idem. * Source/NSSpellChecker.m: Idem. * Source/NSSplitView.m: Idem. * Source/NSTableHeaderView.m: Idem. * Source/NSText.m: Idem. * Source/NSWindow.m: Idem, plus removed unused one. * Source/NSInputManager.m: Include AppKit/NSGraphics.h, not AppKit/NSApplication.h, for NSBeep (). 2002-04-01 Gregory Casamento * Source/NSOutlineView.m Added methods to implement autosaving of expandedItems. 2002-04-01 Adam Fedor * Source/NSApplication.m (-init): Retain the server and default context. (-dealloc): Release server and context. * Source/NSGraphicsContext.m (+restoreGraphicsState): Implement. (+saveGraphicsState): Likewise. ( destroyContext): Remove. (-restoreGraphicsState): Implement. (-saveGraphicsState): Likewise. Add some documentation. * Source/NSWindow.m ([NSWindow -dealloc]): Check for context before undefining gstate. ([NSWindow -miniaturize:]): Don't create miniwindow if server can't handle it. * Source/GSDisplayServer.m (-appOwnsMiniwindow): Implement. 2002-04-01 Gregory Casamento * Source/NSOutlineView.m Replaced dictionaries w/ NSMapTable. NSDictionary required items of the NSOutlineView to implement the NSCopying protocol which is incorrect. * Headers/gnustep/gui/NSOutlineView.h Replaced dictionaries in class declaration. 2002-03-31 Fred Kiefer * Source/Window.m [setFrame:display:] do nothing if the frame after all the corrections did not change from its current extend. In [makeKeyWindow] and [makeMainWindow] do nothing if the window is already key/main. 2002-03-31 Pierre-Yves Rivaille * Source/NSMatrix.m : Use integer coordinates for _cellSize when autoresizing. * Source/NSBox.m ([NSBox -calcSizesAllowingNegative:]) (case NSAtBottom & case NSAtTop): Use integer coordinates and small cosmetic changes. * Source/NSOutlineView.m ([NSOutlineView -initWithCoder:]): Bugfix. * Source/NSClipView.m ([NSClipView -constrainScrollPoint:]): Make sure the difference between old position and new position is an integer vector. * Source/NSTableView.m ([NSTableView -initWithCoder:]): Bugfix. 2002-03-30 Adam Fedor * gui/Model/GMAppKit.m (-encodeWithModelArchiver:): Encode an empty array rather than crash. * gui/Model/GMArchiveObjects.m (-colorSpaceName): Implement for NSObject to to work around a bug in MacOSX 10.1.x * gui/Model/GNUmakefile: Include libgmodel with building nib2gmodel. * gui/Model/IBClasses.m: Fix debug for compiling on Darwin. 2002-03-29 Pierre-Yves Rivaille * Source/NSTableView.m ([NSTableView -encodeWithCoder:]): ([NSTableView -initWithCoder:]): encodes _allowsColumnReordering. * Source/NSTableView.m (computeNewSelection): fixed bug when updating selection. * Source/NSTableColumn.m ([NSTableColumn -encodeWithCoder:]): ([NSTableColumn -initWithCoder:]): new encoding scheme (fixes a bug when decoding a tableview) Thu Mar 28 11:08:56 2002 Nicola Pero Patches by Jeff Teunissen : * Source/NSWorkspace.m ([-homeDirectoryImage]): New method. ([-iconForFile:]): Use the new method to return an image for NSHomeDirectory(). * Images/GNUmakefile (IMAGE_FILES): Added Common_HomeDirectory.tiff. * Images/common_HomeDirectory.tiff: New image created by simply putting common_Home.tiff over common_Folder.tiff. 2002-03-27 Adam Fedor * Splitup backend into Server and Graphics Contexts. Revise list of graphics operators for better functionality. * Headers/gnustep/gui/GSDisplayServer.h: New file. * Headers/gnustep/gui/DPSOperators.h: Revised set of operators. * Headers/gnustep/gui/PSOperators.h: Likewise. * Headers/gnustep/gui/GSMethodTable.h: Likewise. * Headers/gnustep/gui/NSGraphics.h: Un-inline/revise functions. * Headers/gnustep/gui/NSGraphicsContext.h: Update for MacOSX compatibility, move server methods to GSDisplayServer, Revise list of operators. * Source/GSDisplayServer.m: New file. * Source/Functions.m: Move uninlined functions from NSGraphics.h here. * Source/NSAffineTransform.m (-set): Update to new method. * Source/NSApplication.m: Load gnustep-back backend by default. Update for new server class. * Source/NSCursor: Use new methods from server. * Source/NSEvent.m: Likewise. * Source/NSFont.m: Likewise. * Source/NSImageRep.m: Likewise. * Source/NSScreen.m: Likewise. * Source/NSView.m: Likewise. * Source/NSWindow.m: Likewise. * Source/NSWorkspace.m: Likewise. * Source/NSGraphicsContext.m: Move server methods, revised list of operators Thu Mar 28 03:43:49 2002 Nicola Pero * Source/libgnustep-gui.def: Removed __objc_class_name_GSTransparentView. 2002-03-27 Gregory John Casamento * Source/NSOutlineView.m make more efficient for large sets of items * Headers/gnustep/gui/NSOutlineView.h Added new ivar to cache item level information. 2002-03-26 Pierre-Yves Rivaille * Source/NSBundleAdditions.m ([NSNibOutletConnector -establishConnection]): Only capitalize the first letter of the outlet in order to have the accessor method's name. * Source/NSTableView.m ([NSTableView initWithCoder:]): Use @"NSTableView" insted of NSStringFromClass([self class]) when looking for version. Call -tile to set up everything properly. * Source/NSScrollView.m ([NSScrollView encodeWithCoder:] & [NSScrollView initWithCoder:]): Encode/decode _hasHeaderView, _hasCornerView & _headerClipView. Don't recreate cornerView & headerView at decoding time, because they are encoded by NSView anyway. Tue Mar 26 14:33:24 2002 Nicola Pero * Source/GSTable.m: Removed GSTransparentView and replaced it with a simple NSView. * Headers/gnustep/gui/GSTable.h: Idem. 2002-03-24 Adam Fedor * Source/NSStringDrawing.m (drawRun): Use new unicode functions for string conversion (patch from yjchen@ms7.url.com.tw). Mon Mar 25 00:12:05 2002 Nicola Pero * Source/GSSimpleLayoutManager.m ([-setNeedsDisplayForLineRange:inTextContainer:]): Fixed typo introduced by me in last change (reported by Alexander Malmberg). 2002-03-23 Adam Fedor * Version: 0.7.6 Sat Mar 23 21:49:10 2002 Gregory John Casamento * Source/NSOutlineView.m: Minor cleanup. Removed some unecessary NSLog statements. Sat Mar 23 11:34:10 2002 Gregory John Casamento * Headers/gnustep/gui/NSOutlineView.h: Added dictionary to speed up generation of the _items list. Also, this keeps the outline view from being updated without an explicit call to reloadData. * Source/NSOutlineView.m: Implemented -[NSOutlineView reloadItem:] and -[NSOutlineView reloadItem:reloadChildren:] and improved -[NSOutlineView reloadData] Fri Mar 22 13:09:03 2002 Nicola Pero * Headers/gnustep/gui/NSRulerView.h: Merged new code from Diego Kreutz (kreutz@inf.ufsm.br). * Source/NSRulerView.m: Class contributed by Diego Kreutz (kreutz@inf.ufsm.br). I did some minor changes. Fri Mar 22 11:40:44 2002 Nicola Pero * Model/IMLoading.m: Include AppKit/NSNibLoading.h for awakeFromNib. Fri Mar 22 11:35:20 2002 Nicola Pero * Source/GSSimpleLayoutManager.m ([GSSimpleLayoutManager -setNeedsDisplayForLineRange:inTextContainer:]): Check that the whole range of lines, not just the first one, is in the range we know about (Suggestion from Alexander Malmberg). 2002-03-22 Richard Frith-Macdonald * Tools/exampleInfo.plist: Fix illegal character in plist ... use unicode escape. Bug reported by Yen-Ju Chen 2002-03-22 Pierre-Yves Rivaille * Source/NSOutlineView.h Moved NSOutlineViewDropOnItemIndex from enum to int. * Source/NSOutlineView.m: Drag'n'drop support. * Source/NSTableView.m ([NSTableView -selectRow:byExtendingSelection:]): rowIndex == _numberOfRows was not catched as invalid. * Source/NSTableView.m ([NSTableView -draggingUpdated:sender]): Less NSLog. * Source/NSTableHeaderView.m ([NSTableHeaderView -mouseDown:]): fixed drawing issue. 2002-03-21 Pierre-Yves Rivaille * Source/NSEvent.m ([NSEvent +startPeriodicEventsAfterDelay:withPeriod:]): ([NSEvent +_registerRealTimer:]): The first periodic event is sent after delay seconds. It was incorrectly sent after delay+period seconds. * Source/NSScroller.m ([NSScroller -drawParts]): Set the scrollbuttons to send actions on mouseDown instead of mouseUp. Changed the initial delay (to reflect NSEvent changes) and the period so that it feels smoother. 2002-03-20 Richard Frith-Macdonald * configure.in: Use info from make package, and look in GNUstep directories first for versions of libraries and headers to use. * configure: regenerate 2002-03-19 Adam Fedor * Source/NSWindow.m ([NSWindow -sendEvent:]): In resize event, get new origin from event location field. * Source/GSFontInfo.m ([GSFontInfo +encodingForRegistry:encoding:]): Handle big5 encoding (patch from Yen-Ju Chen) * Documentation/news.texi: Update. Mon Mar 18 16:00:34 2002 Nicola Pero * Source/NSTableView.m ([-draggingUpdated:sender]): Make the gui compile again. 2002-03-17 Pierre-Yves Rivaille * Source/GSTextStorage.m ([GSTextStorage -replaceCharactersInRange:withString:]): Only keep attribute #0 when removing it would remove all attributes. (patch by Alexander Malmberg) * Source/NSTableView.m ([NSTableView -deselectAll:]): Fix bug. * Source/NSTableView.m : initial drag'n'drop support. 2002-03-14 Richard Frith-Macdonald * Headers/AppKit/NSGraphicsContext.h: Add NSWindowDepth typedef and reposition STRICT_OPENSTEP. Really needs someone who actually wants to use this option to submit patches though. Mon Mar 11 15:05:02 2002 Nicola Pero * Source/libgnustep-gui.def (__objc_class_name_GSGlyphLocation,__objc_class_name_GSLineLayoutInfo, __objc_class_name_GSRunStorage, __objc_class_name__GSRunSearchKey, __objc_class_name_GSTextContainerLayoutInfo): Removed (Suggested by Fred Kiefer). 2002-03-10 Richard Frith-Macdonald * Source/NSPasteboard.m: Start gpbs for other server automatically. Improve log messages. * Tools/gpbs.m copied in fron gpbs. 2002-03-09 Richard Frith-Macdonald * Source/NSPasteboard.m: Use NSHost to look for alternative servers. * Tools/gpbs.m: Use -NSHost to specify alternative server names. Sat Mar 9 12:22:05 2002 Adam Fedor * Source/GSSimpleLayoutManager.m: Check that object is not nil before asking for width (assigning structs from nil objects crashes Solaris). Several locations. 2002-03-06 Richard Frith-Macdonald * Source/NSScrollView.m: Go through adding checks to avoid crashes where _contentView has been set to nil through removal of the subview. Thu Mar 7 08:29:25 2002 Nicola Pero * Source/NSScrollView.m ([-dealloc]): Use DESTROY, not TEST_RELEASE, fixing the segmentation fault on deallocating. Thu Mar 7 08:15:21 2002 Nicola Pero * Source/NSCell.m ([-initTextCell:]): Use system font, not user font. ([-initImageCell:]): Idem. ([-setType:]): Idem. (Patch from Stefan Urbanek ). 2002-03-06 Richard Frith-Macdonald * Source/GSTextStorage.m: Applied fix for left-over attributes at end of string. Patch supplied by Alexander Malmberg . Reformatting to conform to GNUstep standards, and optimisation by me. * Source/NSView.m: -dealloc remove subviews from this view as suggested by Nicola. 2002-03-05 Gregory John Casamento * Source/NSOutlineView.m modified to the methods which make calls to the datasource to retrieve children starting from zero instead of one. 2002-03-04 Gregory John Casamento & Pierre-Yves Rivaille * Source/NSTableView.m added methods to handle posting of notifications as well as methods to handle making appropriate delegate calls. Also made necessary changes in other methods ([NSTableView mouseDown:], [NSTableView selectAll], etc...) to use them. (PYR) * Source/NSOutlineView.m overrode notification methods and delegate methods defined in NSTableView. (GJC) This was done as a collaborative effort to ensure that NSOutlineView is more maintainable and benefits from updates made to NSTableView. Also made changes to increase spacing between "knob" and text * Images/common_outlineUnexpandable.tiff lightened image to make it stand out more when an item cannot be expanded. (GJC) 2002-03-04 Richard Frith-Macdonald * Headers/AppKit/NSEvent.h: Modify to support MacOS-X documented API (rather than just the currently implemented one). * Source/NSEvent.m: ditto. 2002-03-04 Pierre-Yves Rivaille * Source/NSTableView.m ([NSTableView -superviewFrameChanged:]): fix a bug when resizing a tableview with autoresizesAllColumnsToFit set to YES. Mon Mar 4 09:09:02 2002 Nicola Pero * Source/NSSavePanel.m: Do not include AppKit/IMLoading.h. 2002-03-04 Richard Frith-Macdonald * Source/NSSavePanel.m: Hack around accessory view addition/removal code - fix a few bugs and simplify by relying more on autoresizing and less on manual computation of resizing values. Now works with ProjectCentre on my system. 2002-03-03 Gregory Casamento * Images/common_outlineUnexpandable.tiff added. * Images/GNUmakefile modified to install images * Source/NSOutlineView.m modified to use new images. Also made several fixes which should now make NSOutlineView usable. The graphics used are consistent with the look of the outline view in the OPENSTEP Interface Builder classes tab. 2002-03-02 Gregory Casamento * Images/common_outlineExpanded.tiff added. * Images/common_outlineCollapsed.tiff added. * Images/GNUmakefile modified to install images * Source/NSOutlineView.m modified to use new images 2002-03-01 Richard Frith-Macdonald * Headers/AppKit/NSEvent.h: Rename 'middle' mouse to 'other' as MacOS-X has caught up with the functionality but not adopted our names. Add -buttonNumber. Add conditional compilation for strict openstep to exclude new methods. * Headers/AppKit/NSResponder.h: ditto * Source/Functions.m: ditto * Source/GSComboSupport.m: ditto * Source/NSApplication.m: ditto * Source/NSCell.m: ditto * Source/NSControl.m: ditto * Source/NSEvent.m: ditto. Also added lots of documentation, a couple of fixmes, and several bugfixes (wrong exceptions being raised etc). * Source/NSMenuView.m: ditto * Source/NSResponder.m: ditto * Source/NSTextView.m: ditto * Source/NSWindow.m: ditto 2002-03-01 Michael Hanni First cut at improving NSPopUpButton/Cell. * Source/NSMenuItemCell.m ([drawBorderAndBackgroundWithFrame:inView:]): Remove special popupbutton case. ([drawInteriorWithFrame:inView:]): ditto. * Headers/NSMenuView.h: added _leftBorderOffset int. * Source/NSMenuView.m: added static function _addLeftBorderOffsetToRect() ([initWithFrame:]): init left offset value to 1 (default for a menu.) ([sizeToFit]): change left offset value to 0 if we are a popup. Use this value to set the correct frame size. Before when the menuview was sizeToFit'ed the menuWindow was resized by an additional pixel when we were a popupbutton. ([innerRect]): use left offset value to return the correct rect. ([rectOfItemAtIndex:]): ditto. ([indexOfItemAtPoint:]): use _addLeftBorderOffsetToRect() to correct the rect we use to calculate the event area for a menuItemCell in a normal menu. ([setNeedsDisplayForItemAtIndex:]): ditto. ([drawRect:]): Modified to not draw a border line on the left side if we are a popup. * Source/NSPopUpButtonCell.m: added some comments for further fixes. ([drawWithFrame:inView:]): removed all the code in favor of having the NSMenuItemCell of the selected item draw the popupbuttoncell. ([drawInteriorWithFrame:inView:]): removed everything but the responder status code (this is still a FIXME). 2002-03-01 Pierre-Yves Rivaille * Source/NSBundleAdditions.m ([GSNibItem -initWithCoder:]): ([GSNibItem -encodeWithCoder:]): new encoding (support for autoresizingMask). ([GSNibItem +initialize]): ([GSCustomView +initialize]): new methods, set the version number. * Headers/gnustep/gui/NSNibLoading.h: new autoresizingMask ivar in GSNibItem. 2002-02-28 Pierre-Yves Rivaille * Headers/gnustep/gui/NSEvent.h: new element in event_data union, provides support for deltaX, deltaY and deltaZ. * Source/NSEvent.m ([NSEvent +mouseEventWithType:location:modifierFlags:timestamp: windowNumber:context:deltaX:deltaY:deltaZ:]): new method : support for creating event with deltaX, deltaY and deltaZ. ([NSEvent -delta{X, Y, Z}]): methods implemented. ([NSEvent -description]): ([NSEvent -initWithCoder:]): ([NSEvent -encodeWithCoder:]): suppor for deltaX, deltaY and deltaZ * Source/NSResponder.m ([NSResponder -scrollWheel:]): implementation. * Source/NSScrollView.m ([NSScrollView -scrollWheel:]): implementation, does scroll the document view. Thu Feb 28 16:47:58 2002 Nicola Pero * Tools/make_services.m: Use 'Applications' not 'Apps'. Thu Feb 28 16:02:09 2002 Nicola Pero * Source/Functions.m: Never include NSCStringText.h. Removed old obsolete text string functions declared in NSCStringText.h. * Source/libgnustep-gui.def: Removed __objc_class_name_NSCStringText. 2002-02-27 Adam Fedor * Source/NSApplication.m ([NSApplication -init]): Create our NSGraphicsContext here (moved from backend initialization) - much more appealing. Thu Feb 28 14:19:00 2002 Nicola Pero * Headers/gnustep/gui/NSText.h: Added the special key enum containing NSBackspaceKey which used to be in NSCStringText.h. Wed Feb 27 23:50:42 2002 Nicola Pero * Source/GSKeyBindingTable.m ([-bindKey:toAction:]): Implemented support for describing multi-stroke keybindings using arrays as keys. * Source/GSKeyBindingTable.h ([-bindKey:toAction:]): Now accepts an id as key. Wed Feb 27 23:27:21 2002 Nicola Pero * Source/GSKeyBindingTable.m ([-bindKey:toAction:]): Modified so that adding new multi-stroke keybindings with the same prefix doesn't discard all previous keybindings with the same prefix. Wed Feb 27 23:16:47 2002 Nicola Pero * Source/NSTextView.m ([-drawRect:]): Always clear the whole rect using the the background color before drawing the new glyphs. This makes sure we always clear away old glyphs. This fixes the bug when deleting the last character in a text field. 2002-02-27 Fred Kiefer * Source/GSSimpleLayoutManager.m [_relocLayoutArray:offset:floatTrift:Change a NSLog() call to NSDebugLog(). * Source/NSLayoutManager.m Implemented extra line fragment methods. * Source/NSTextView.m Implemented [moveToBeginningOfParagraph:] and [moveToEndOfParagraph:]. * KeyBindings/DefaultKeyBindings.dict Uncommented HOME and END. Wed Feb 27 19:58:12 2002 Nicola Pero * Source/NSCStringText.m: Obsolete file removed. * Headers/gnustep/gui/NSCStringText.h: Obsolete file removed. * Source/GNUmakefile (libgnustep-gui_OBJC_FILES): Removed NSCStringText.m. (libgnustep-gui_HEADER_FILES): Removed NSCStringText.h. Wed Feb 27 18:59:54 2002 Nicola Pero * Headers/gnustep/gui/NSInputManager.h (_insertControlKeystrokes): New ivar. * Source/NSInputManager.m ([-initWithName:host:]): Read the user default GSInsertControlKeystrokes and save it. * Source/NSInputManager.m ([-handleKeyboardEvents:client:]): When inserting literally a keystroke, if GSInsertControlKeystrokes is NO, and this is a control keystroke, beep but don't insert it. Beep when a function key not bound to anything is pressed. Wed Feb 27 18:57:50 2002 Nicola Pero * Source/NSResponder.m ([-insertText:]): Added. Wed Feb 27 18:54:43 2002 Nicola Pero * Headers/gnustep/gui/NSTextStorage.h: Documented. 2002-02-27 Pierre-Yves Rivaille * Source/NSSplitView.m ([NSSplitView -mouseDown:]): Tweaked the drawing code and the event code, so that everything is displayed more smoothly and faster. 2002-02-27 Fred Kiefer * Source/NSTextView.m Added method [copySelection] and [pasteSelection] to put the selected text in special pasteboard. The first gets called by [setSelectedRange:affinity:stillSelecting:] while the later is bound to [middleMouseUp:]. (This is hard coded, could the key binding code handle this?) 2002-02-27 Fred Kiefer Patch from Alexander Malmberg : * Source/NSGraphicsContext.m [graphicsContextWithAttributes] always autorelease the context. Moved the unsetting of the current context from [dealloc] to [destroyContext] otherwise the current context can never be freed. * Source/NSApplication.m Removed some now unneeded FIXME. Wed Feb 27 01:03:58 2002 Gregory Casamento * Source/NSOutlineView.m implemented indentation and enabled collapsing of items in the outline view. Tue Feb 26 19:08:38 2002 Nicola Pero Patch by Michael Hanni modified - * Source/NSTabView.m ([-selectTabViewItem:]): Set the frame of the new selected view to content rect. Tue Feb 26 18:26:53 2002 Nicola Pero Patch from Alexander Malmberg : * Source/NSFont.m ([+fontWithName:size:]): If size is 0, use NSUserFontSize instead. 2002-02-26 Fred Kiefer * Source/NSImage.m [setSize:] recache representations if size changes. [recache] throw old caches away as size may have changed. * Source/NSCachedImageRep.m [GSCacheW _initDefaults] set window not to be released when closed. As NSApp now closes all windows on terminate. * Source/NSApplication.m [NSIconWindow orderWindow:relativeTo:] don't complain about order out if application is closing. Mon Feb 25 17:53:19 2002 Nicola Pero * Source/NSMenuItemCell.m ([-initWithCoder:]): Added code to decode old version as well, since it is used by the popup button cell. 2002-02-25 Adam Fedor * Source/NSGraphicsContext.m (_postExternalEvent:) Removed, not used. * Source/NSInterfaceStyle.m: Updated comments. * Source/NSScroller.m (-setFloatValue:): Don't update if the new float is the same as our current value. (-setFloatValue:knobProportion:): Likewise. 2002-02-18 Willem Rein Oudshoorn * gui/Source/NSImage.m ([NSImage -initWithSize:]): removed the round size down temporary fix. ([NSImage -setSize:]): removed the round size down temporary fix. Mon Feb 25 14:51:56 2002 Nicola Pero * Source/NSSavePanel.m (createRowsForColumn:): Use GSFileBrowserHideDotFiles rather than GSSavePanelHideDotFiles as user defaults. Mon Feb 25 13:58:49 2002 Nicola Pero * Source/NSWindow.m ([-sendEvent:]): Hand the NSFlagsChanged event to the _firstResponder flagsChanged: method. Mon Feb 25 13:04:12 2002 Nicola Pero * Source/NSInputManager.m ([+describeKeyStroke:withModifiers:]): Output NumericPad-, not Numeric-, for a numeric pad key. * Source/NSInputManager.m ([-handleKeyboardEvents:client:]): Do not discard the NumericPad modifier flag when looking up keystrokes. Remove shift from flags when the keystroke is not a function key. Do not output function keys literally if they are not bound to anything. * Source/GSKeyBindingTable.m ([-bindKey:toAction:]): Simplified - do not insert keybindings twice - with and without shift - if they are not function keys. Simplified comparisons and updates for this change. Fixed memory leak when overriding keybindings. Mon Feb 25 02:16:32 2002 Nicola Pero Rewritten the input manager keybinding engine to be a full blown keybinding engine - new features include actions composed of array of selectors, multi-stroke keybindings, abort and quote keybindings. * Source/NSInputManager.m: Rewritten most of the engine to be much more powerful. * Headers/gnustep/gui/NSInputManager.h: Changes in ivars, lots of comments, new public and private methods. * Source/GSKeyBindingAction.h: New auxiliary file. * Source/GSKeyBindingAction.m: New auxiliary file. * Source/GSKeyBindingTable.h: New auxiliary file. * Source/GSKeyBindingTable.m: New auxiliary file. * GNUmakefile: Compile the new files. Sun Feb 24 17:32:37 2002 Nicola Pero * Headers/gnustep/gui/NSResponder.h: Put the optional methods in an informal protocol. Sun Feb 24 11:33:21 2002 Nicola Pero * Source/NSSaverPanel.m: Do not assume that NSFileManager -directoryContentsAtPath: returns a NSMutableArray. Sun Feb 24 11:30:33 2002 Nicola Pero * Source/NSSavePanel.m ([-browser:createRowsForColumn:inMatrix:]): Do not display files starting with . if the user has set GSSavePanelHideDotFiles to YES (Patch by Martin Brecher with lots of changes by myself). 2002-02-24 Richard Frith-Macdonald * Source/NSLayoutManager.m: More changes to glyph code - store glyphs and their attributes in the same array, store gaps as ranges rather than simple indexs. Update comments. Still not working and turned off using #if Sat Feb 23 22:07:09 2002 Gregory Casamento * Source/NSOutlineView.m: More improvements. Expansion of items is now partially supported. Sat Feb 23 20:51:31 2002 Georg Fleischmann * Source/NSBezierPath.m ([+bezierPath]): Return autoreleased object. Sat Feb 23 11:28:32 2002 Gregory Casamento * Headers/gnustep/gui/AppKit.h: Added NSOutlineView header * Headers/gnustep/gui/NSOutlineView.h: Added additional ivars and corrected methods for delegate and data source. * Source/NSOutlineView.m: Added lots of new code to handle the outline view. * Source/externs.m: Added definitions for notifications. Sat Feb 23 12:20:28 2002 Nicola Pero Patch by Alexander Malmberg - * Source/NSMenu.m ([-initWithTitle:]): Show torn off menus upon receiving the NSApplicationDidFinishLaunching notification, not the NSApplicationWillFinishLaunching one. Sat Feb 23 12:11:44 2002 Nicola Pero Patches by Alexander Malmberg with many changes - * Source/NSMenuView.m ([-setMenu:]): Do not retain menu. ([-dealloc]): Do not release menu. * Source/NSMenuItemCell.m ([-setMenuView:]): Do not retain the menu view. ([-dealloc]): Do not release the menu view. ([-copyWithZone:]): Set the menuView of the new cell to nil. * Source/NSMenuItemCell.m ([+initialize]): Set version to 2. ([-encodeWithCoder:]): Do not encode the menu view. ([-initWithCoder:]): Do not decode the menu view. Retain the decoded menu item. Do not bother with decoding old versions since this is unused when encoding/decoding menus anyway. :-) * Source/NSMenuView.m ([-dealloc]): Set the menuView of all the menu item cells to nil before releasing them. * Source/NSMenuView.m ([-initWithCoder:]): Set the menu view of all the menu item cells to self after decoding. Sat Feb 23 01:28:15 2002 Nicola Pero * Source/NSTableView.m ([-editColumn:row:withEvent:select:]): Call stringValue on the _editedCell before setting up _textObject, not after, to prevent a spurious validation from messing up the text to edit. This fixes the bug when moving with TAB between different edited cells. * Source/NSTableView.m ([-textDidEndEditing:]): Release the _editedCell *before* setting it to nil :-). Fri Feb 22 22:55:51 2002 Nicola Pero Patches by Alexander Malmberg : * Source/NSApplication.m ([-dealloc]): Set the main menu and the window menu to nil, so that we don't try updating them later on in the shutdown process. * Source/NSWindow.m ([-dealloc]): Fixed so that it doesn't discard the autosaved frame. Fri Feb 22 21:03:19 2002 Nicola Pero * Headers/gnustep/gui/NSApplication.h (_runLoopPool): Store the main run loop autorelease pool in a ivar. * Source/NSApplication.m ([-run]): Use the _runLoopPool rather than a local pool. Also, check for recursive invocation, and enclose into an autorelease pool the last instructions. ([-terminate:]): Destroy the _runLoopPool; enclose destruction of NSApp into yet another autorelease pool. Fri Feb 22 18:22:48 2002 Nicola Pero * Source/NSApplication.m ([-terminate:]): Use an autorelease pool. Thu Feb 21 23:29:50 2002 Nicola Pero * Headers/gnustep/gui/NSWindow.h (_originalResponder): Ivar removed. * Source/NSWindow.m ([-sendEvent:]): Send key up to the first responder, not to the original responder. ([-dealloc]): Do not release _originalResponder. ([-_initDefaults]): Do not set _originalResponder. Thu Feb 21 11:01:43 2002 Nicola Pero * Source/NSApplication.m ([-changeWindowsItem:title:filename:]): Only exit if the item exists with the same title as the one we would add, otherwise, remove the old one and add it again to permit changing window titles. Fixed case of window being changed from having a title to having no title. Wed Feb 20 20:57:32 2002 Michael Hanni * Source/NSApplication.m ([-changeWindowsItem:]): If the item in question already exists we abort further processing. * Source/NSTabView.m: ([-mouseDown:]): New method to fix problems with NSSplitView interaction. ([-hitTest:]): Removed. Wed Feb 20 19:15:58 2002 Nicola Pero * Headers/gnustep/gui/GSMemoryPanel.h: New file. * Source/GSMemoryPanel.m: New file. * Source/GNUmakefile: Compile, install the new files. * Source/GSInfoPanel.m: If the user clicks on the application icon, open the memory panel (idea by Richard Frith-Macdonald). Wed Feb 20 12:36:05 2002 Nicola Pero * Model/GMAppKit.m ([NSBox -subviewsForModel]): New method fixing problems with subviews of NSBox objects. 2002-02-20 Richard Frith-Macdonald * Source/NSLayoutManager.m: Lots of changes to glyph code, including new logging function ... still doesn't work though ... so turned off. 2002-02-19 Pierre-Yves Rivaille * Source/NSTableView.m ([-setAutosaveTableColumns:]): sets the flag before trying to load from defaults. (patch by Alexander Malmberg ) Tue Feb 19 11:46:31 2002 Nicola Pero * Source/NSTextView.m ([-dealloc]): RETAIN self before destroying the text network. (Suggestion by Alexander Malmberg ). 2002-02-18 Gregory John Casamento * Source/NSWindow.m ([NSWindow -close]): Changes made earlier would not compile w/ gcc < 3.0. 2002-02-18 Pierre-Yves Rivaille * Source/NSTableHeaderView.m ([NSTableHeaderView -mouseDown:]): The tableHeaderCell is now redrawn when column reordering is on. 2002-02-18 Pierre-Yves Rivaille * Source/NSWindow.m ([NSWindow -close]): ignore the call if the window is already closed. 2002-02-17 Pierre-Yves Rivaille * Source/NSApplication.m ([NSApplication -terminate:]): send a close message to all the windows. Thu Feb 14 10:45:48 2002 Nicola Pero Michael Hanni * Source/NSMenuItemCell.m ([-drawStateImageWithFrame:inView:]): Exit as soon as possible if we have no state image to draw. ([-imageRectForBounds:]), ([-titleRectForBounds:]): Do not pad for the state image if the state image has no width. * Source/NSPopUpButtonCell.m ([-insertItemWithTitle:atIndex:]): Set the On and Mixed image of the new menu item to nil. ([-selectItem:]): Do not call setChangesState: NO on the selected menu item. 2002-02-13 Richard Frith-Macdonald * Source/GSTextStoarge.m: Add GSIMap option for minor performance improvement. * Tools/make_services.m: Use correct user root. Noticed that this tool needs fixing to use the correct paths as provided by the NSSearchPathsForDirectoriesInDomains() function. * Source/NSSpellServer.m: Use NSSearchPathsForDirectoriesInDomains() 2002-02-13 Pierre-Yves Rivaille * Source/NSTableHeaderCell.m: New drawing code, support for highlighted cells. * Source/NSTableHeaderView.m: support for drawing highlighted column, support for NSTableView mouseDownInHeaderOfTableColumn: and didClickTableColumn: delegate messages. * Source/NSTableView.m: rewrite of -mouseDown method. rewrite of selection handling to fully support the specs new tableView:didClickTableColumn: and tableView:mouseDownInHeaderOfTableColumn delegate messages [NSTableView -setHighlightedTableColumn:] [NSTableView -highlightedTableColumn]: methods implemented. * Headers/gnustep/gui/NSTableView.h: new _highlightedTableColumn ivar. 2002-02-12 Richard Frith-Macdonald * Source/NSBundleAdditions.m: Fix dumb error in my last modification. (bug report by Stephen brandon). Mon Feb 11 14:39:03 2002 Nicola Pero Updated for change in semantics of -string method of NSMutableAttributedString. * Source/NSButtonCell.m ([-setAttributedAlternateTitle:]): Copy the string before using it. * Source/NSCell.m ([-stringValue]): Copy the string before returning it. ([-mnemonic]): Copy the string before using it. * Source/NSMatrix.m ([-validateEditing]): Copy the text before using it. * Source/NSTableView.m ([-validateEditing]): Copy the text before using it. * Source/NSTextField.m ([-validateEditing]): Copy the text before using it. Mon Feb 11 14:30:35 2002 Nicola Pero * Source/NSLayoutManager.m ([-textContainerChangedTextView:]): Update _firstTextView even if there is a single text view. * Source/NSTextContainer.m ([-setTextView:]): Always inform the layout manager that the textview is changed. 2002-02-11 Richard Frith-Macdonald * Source/NSBundleAdditions.m: ([loadNibFile:externalNameTable:withZone:]) fix so that, if given a name with a .nib extension, try correctly to use a .gorm or .gmodel. 2002-02-10 Michael Hanni * Source/NSMenuView.m ([-drawRect:]): make this more efficent, only redraw cells that we clip. Mon Feb 11 00:35:19 2002 Nicola Pero * Source/NSLayoutManager.m ([-dealloc]): Modified to work for objects which have not been -init. Sun Feb 10 23:53:51 2002 Nicola Pero * Source/GSSimpleLayoutManager.m ([-textContainerForGlyphAtIndex:effectiveRange:]): Return nil if no text container was set. * Source/NSLayoutManager.m ([-firstTextView]): Always return _firstTextView. ([-removeTextContainerAtIndex:]): Set _firstTextView to nil if we removed the last text container. * Source/NSTextView.m ([-buildUpTextNetwork:]): Updated setup sequence for the fixes in the layout manager - bound the layout manager and the text storage before creating the text container. 2002-02-09 Pierre-Yves Rivaille * Source/GSFontInfo.m: ([GSFontInfo -defaultLineHeightForFont]): descender is substracted not added to ascender to give the lineHeight 2002-02-09 Richard Frith-Macdonald * Source/NSWindow.m: ([performMiniaturize:]) patch to check style mask by Jeff Teunissen added. Method documented. Fri Feb 8 02:46:15 2002 Nicola Pero * Source/NSTextView.m ([-moveWordBackward:]): Simplified. ([-moveWordForward:]): Simplified. ([-moveWordForwardAndModifySelection:]): New method, implemented. ([-moveWordBackwardAndModifySelection:]): New method, implemented. * Source/NSAttributedString.m ([-nextWordFromIndex:forward:]): Rewritten, fixing crashes. * KeyBindings/DefaultKeyBindings.dict: Uncommented Alternate-Shift-LeftArrow and Alternate-Shift-RightArrow, and bound to moveWordBackwardAndModifySelection: and moveWordForwardAndModifySelection:. Wed Feb 6 17:12:35 2002 Nicola Pero * Source/GSSimpleLayoutManager.m ([-invalidateGlyphsForCharacterRange:changeInLength: actualCharacterRange:]): Removed. ([-drawBackgroundForGlyphRange:atPoint:]): Moved to NSLayoutManager.m. ([+setSelectionWordGranularitySet:]): Removed. Code moved into +initialize. Wed Feb 6 14:12:51 2002 Nicola Pero * Source/NSLayoutManager.m: Removed old unused unfinished layout code. * Headers/gnustep/gui/NSLayoutManager.h: Removed the corresponding declarations. 2002-02-06 Richard Frith-Macdonald * Source/NSWindow.m: ([-sendEvent:]) handle mouse down in window if no view accepts it. ([-mouseDown:]) implement to quietly ignore event. * Source/GSTextStorage.h: additional ivar * Source/GSTextStorage.m: hand out a proxy to our internal storage, to avoid either copying it (inefficient) or exposing the mutable string (unsafe). Wed Feb 6 02:30:09 2002 Nicola Pero * Source/GSSimpleLayoutManager.m ([-rebuildForRange:delta:inTextContainer:]): Removed workaround for bug in NSString. Use a fake used rect width of 1 when building the fake line fragment for no text, so that the insertion point is displayed in that case. Build a fake line fragment at the end of text if there is a newline ending the text. This hack fixes the problems with typing enter at the end of text. Tue Feb 5 10:26:32 2002 Nicola Pero * Source/NSTextView.m ([-moveBackwardAndModifySelection:]): New method. ([-moveForwardAndModifySelection:]): New method. * KeyBindings/DefaultKeyBindings.dict: Uncommented binding of the new methods to Shift-LeftArrow and Shift-RightArrow. Sun Feb 3 11:53:13 2002 Nicola Pero * Source/NSTextView.m ([-transpose:]): New method. Bound to Control-t. * Headers/gnustep/gui/NSTextView.h: Declare transpose:. Removed category. * KeyBindings/DefaultKeyBindings.dict: List rewritten to reflect the OpenStep keybindings. Work in progress - many keybindings commented out for now, but this is the list of keybindings we eventually want to get to. 2002-02-03 Fred Kiefer , Richard * Source/NSView.m: ([removeSubview:]) call ([setNeedsDisplay:NO]) in the subview so that, if subsequently added to another view, and marked for display, the area needing display will be updated to parent views correctly. * Source/NSWindow.m: ([orderWindow:relativeTo:]) fix to restart automatic update events correctly when a window which was ordered out is ordered back in again. 2002-02-02 Fred Kiefer * Source/NSImage.m Corrected [TIFFRepresentation], was calling the wrong NSBitmapImageRep method. * Source/NSFontManager.m [orderFrontFontPanel:] no longer sets the selected font on the panel, as this gets done by the panel itself. * Headers/gnustep/gui/NSFontPanel.h New ivars for traits, weight and a future preview string. * Source/NSFontPanel.m [reloadDefaultFontFamilies] load the family browser and redisplay the selected font. [setPanelFont:isMultiple:] load the face browser, store font weight and traits and display font name in preview only if no preview string is set. [_initWithoutGModel] made the set button the default button. Split most code from [_togglePreview:] into separate method [_doPreview], which is called, when the preview state should not change. In [_doPreview] only display font name if preview string is not set. [browser:selectRow:inColumn:], when selecting a family select a face with the same weight and traits as the originaly selected. When selecting a face, store its weight and traits. 2002-02-01 Richard Frith-Macdonald * Source/NSBezierPath.m: * Source/NSLayoutManager.m: * Source/GSTextStorage.m: Use new GSI API from latest CVS base * library. 2002-01-31 Pierre-Yves Rivaille * Source/NSCell.m * Headers/gnustep/gui/NSCell.h : new [NSCell -setHighlighted:] method 2002-01-30 Adam Fedor * Version: 0.7.5 * Documentation/announce.texi: Update. * Documentation/news.texi: Likewise. 2002-01-28 Willem Rein Oudshoorn * gui/Source/NSImage.m ([NSImage -initWithSize:]): round the size down ([NSImage -setSize:]): round the size down Tue Jan 29 10:59:04 2002 Nicola Pero * GNUmakefile.postamble (configure): Rule removed. It was causing problems on systems without autoconf. (gui.make, config.make): Do not depend on configure. 2002-01-25 Adam Fedor * Documentation/gsdoc/GNUmakefile: Remove autogsdoc processing * Source/GNUmakefile: Moved to here. * Headers/gnustep/gui/GSHbox.h, GSVbox.h, NSAffineTransform.h, NSApplication.h, NSBezierPath.h, NSBitmapImageRep.h, NSBrowser.h, NSBrowserCell.h, NSCell.h, NSColorWell.h, NSDataLink.h, NSDataLinkManager.h, NSDataLinkPanel.h, NSForm.h, NSHelpPanel.h, NSImage.h, NSLayoutManager.h, NSMatrix.h, NSParagraphStyle.h, NSPasteboard.h, NSPopUpButtonCell.h, NSProgressIndicator.h, NSSavePanel.h, NSSelection.h, NSStepperCell.h, NSText.h, NSTextFieldCell.h: Sync interface/impl declarations for autogsdoc. * Source/GSTable.m, NSAffineTransform.m, NSApplication.m, NSBitmapImageRep.m, NSGraphicsContext.m, NSSlider.m, NSTableHeaderView.m, NSText.m: Likewise. * Headers/gnustep/gui/NSEvent.h: Two new AppKit events. * Source/NSWindow.m ([NSWindow -sendEvent:]): Implement response for GSAppKitWindowLeave event. 2002-01-24 Adam Fedor * Source/NSBundleAdditions.m ([NSBundle +loadNibFile:externalNameTable:withZone:]): If file extension is nib, replace it with gmodel. * Documentation/announce.texi: Update. * Documentation/install.texi: Likewise. * Documentation/news.texi: Likewise. * Documentation/todo.texi: Likewise. 2002-01-23 Adam Fedor * Source/NSInterfaceStyle.m (NSInterfaceStyleForKey): Use default style if no key for style is located. Don't cache key in this case. * Source/NSMenu.m (-nestedSetFrameOrigin:aPoint): Use locationForSubmenu to get submenu location. * Source/NSMenuView.m (-locationForSubmenu:): Fix location of submenu for GSWindowMakerInterfaceStyle. 2002-01-22 Richard Frith-Macdonald * Source/NSWorkspace.h: new ivar * Source/NSWorkspace.m: Many tidyups and little fixes, major change to -getBestApp... so that it picks the best available app rather than just the one specifed by the user as 'best'. This means you can always use it to get an app even if the user has set no preference. Fixed uninitialised variable in first version of this mod and made user preferences override declared types opened by apps. Keep track of launched applications so we can tell whether we need to launch a new one or just talk to an existing one. 2002-01-21 Adam Fedor * Source/NSApplication.m (-deactivate): Don't hide modal windows. (-runModalSession:): Handle WM events (like resize) for any window right away. 2002-01-21 Richard Frith-Macdonald * Headers/Appkit/NSGraphicsContext.h: new method to slide image across screen between windows. * Source/NSGraphicsContext.m: dummy implementation * Source/NSWorkspace.m: Use new method. Mon Jan 21 11:47:27 2002 Nicola Pero * Source/NSMenuItem.m ([-setSubmenu:]): When raising an exception that the submenu already has a supermenu, print titles of both submenu and supermenu. * Source/NSMenuItem.m: For the whole class: access variable _title. 2002-01-20 Richard Frith-Macdonald * Source/NSWindow.m: ([-sendEvent:]) check to see that an old drag view is still in the current window before sending a dragging message to it ... if it has been removed, don't send the message. 2002-01-20 Richard Frith-Macdonald * Source/NSWindow.m: ([-sendEvent:]) use ASSIGN() and DESTROY() to update _lastDragView so we don't run into problems if something deallocates it. Added some debug logging. Fixed bug in logic of drag entry/update. Restructured a little to improve readability. Thu Jan 17 18:16:08 2002 Nicola Pero * Source/NSTextView.m ([-_blink:]): Fixed declaration - should take a single NSTimer * argument. Thu Jan 17 00:03:46 2002 Nicola Pero * Source/NSSlider.m ([-mouseDown:]): Do nothing if the slider is disabled. Wed Jan 16 23:45:32 2002 Nicola Pero * Source/NSApplication.m (NSAbortModalException): Removed declaration - suggested by Stephen Brandon. 2002-01-15 Ludovic Marcotte * Source/NSParagraphStyle.m ([NSParagraphStyle -encodeWithCoder:]) fixed the index used for our locations and type arrays from count to it. 2002-01-15 Adam Fedor * Source/NSApplication.m (-finishLaunching): Make main menu key when there is no other key or main window. (-runModalSession:): Update main menu. (-targetForAction:): Search fixes. Return nil if in modal session and key window does not respond to action. * Source/NSWindow.m (-sendEvent:): Only check cursor rects if isCursorRectsEnabled. 2002-01-10 Adam Fedor * Source/NSPopUpButton.m (-keyDown:): Handle obscure case of user opening menu with key and selecting with mouse. Upon key selection, get selected index from menuView highlightedItemIndex. 2002-01-10 Richard Frith-Macdonald * Source/NSPasteboard.m: Improve handling of -NSHost user default so we don't try to start a local pasteboard server when what we actually want is to connect to a remote one. * Source/NSWorkspace.m: Use -NSHost default to control connection to a remote workspace application. Should we use the remote application to launch new apps if possible? For now, try to launch the apps locally but have them display on the remote host by passing the -NSHost default to them. 2002-01-09 Adam Fedor * Source/NSApplication.m (_NSAppKitUncaughtExceptionHandler): Use non-graphical handler when it is a WindowServer exception. * Source/NSWindow.m (-orderWindow:relativeTo:): Constrain only titled windows and only when not already visible. * Source/NSWindow.m (-constrainFrameRect:toScreen:): Don't constrain height less than minimum size. (setFrame:display:): constrain frame on a resize. * TextConverters/RTF/GNUmakefile.preamble: Look for library in Source. Wed Jan 9 12:07:58 2002 Nicola Pero * configure.in: Abort with an error if GNUSTEP_SYSTEM_ROOT is not set. (AC_CONFIG_AUX_DIR): Call to set ac_aux_dir to $GNUSTEP_SYSTEM_ROOT/Makefiles. * configure: Regenerated. * config.guess: Removed. * config.sub: Removed. * install-sh: Removed. Tue Jan 8 16:23:08 2002 Nicola Pero * Resources/English.lproj/Localizable.strings: Removed 'Windows'. * Resources/Italian.lproj/Localizable.strings: Idem. Tue Jan 8 14:30:26 2002 Nicola Pero * Source/NSInputManager.m ([-bindKey:toAction:]): Allow a "" action to specify no keybinding - can be used to disable a previous keybinding. Tue Jan 8 13:58:11 2002 Nicola Pero * Tools/exampleInfo.plist: Added German translation of service strings (Patch by Martin Brecher ). Mon Jan 7 17:35:30 2002 Nicola Pero * Headers/gnustep/gui/NSApplication.h (_windows_menu): Changed to be an NSMenu * instead of a NSMenuItem *. This is more logical since often the windows menu is set before the main menu is created. * Source/NSApplication.m: Updated for change in ivar. ([-setWindowsMenu:]), ([-setMainMenu:]): Simplified a lot. All code dependent on the name of the 'Windows' menu was removed as too complex and unreliable when the application is translated. All applications are now required to create the Windows menu themselves, and to call setWindowsMenu: to have it used. Mon Jan 7 16:05:19 2002 Nicola Pero * Source/NSApplication.m ([-setMainMenu:]): Only manually set a new windows menu if no one was already set. When looking manually for a Windows menu, look both for translated and untranslated 'Windows' menu items. Translate it if not yet translated. ([-setWindowsMenu:]): If no translated 'Windows' menu item could be found, try and look for an untranslated one. Translate it if found. Sun Jan 6 13:56:53 2002 Nicola Pero * Source/NSSpellChecker.m ([-_launchSpellCheckerForLanguage:]): Updated for change in GSServicesManager's ivars. Sun Jan 6 11:16:30 2002 Nicola Pero * Headers/gnustep/gui/GSServicesManager.h: Prefixed all ivars with underscores. * Source/GSServicesManager.m: Idem. Sun Jan 6 10:49:49 2002 Nicola Pero * Source/GSServicesManager.m ([-rebuildServicesMenu]): If the key equivalent can not be found under the language used for the menu item, use the default key equivalent if any. * Tools/exampleInfo.plist: Added service names in Italian. Thu Jan 3 07:35:42 2002 Nicola Pero * Source/NSTextView.m ([-mouseDown:]): Implemented activation of links. (Patch written with Ludovic Marcotte ). * Source/NSTextView.m ([-mouseDown:]): Only use the code for clicks on attachments on the first click. Tue Jan 1 21:06:32 2002 Nicola Pero * Source/NSScrollView.m ([-tile]): Allocate space for the rulers (Adapted from a patch from Diego Luis Kreutz ). Tue Jan 1 20:57:07 2002 Nicola Pero * Source/NSScrollView.m ([-tile]): Rewritten to be simpler to understand. Tue Jan 1 13:36:56 2002 Nicola Pero * Source/NSView.m ([-resizeWithOldSuperviewSize:]): Removed all traces of the obsolete code for managing the bounds. Tidied code. 2001-12-29 Richard Frith-Macdonald * Source/GSServicesManager.m: ([GSListener -forwardInvocation:]) method implemented to forward to service provider or app delegate. Tue Dec 25 09:54:21 2001 Nicola Pero * Source/NSButtonCell.m ([-drawInteriorWithFrame:inView:]): Draw the background color. Tue Dec 25 09:23:24 2001 Nicola Pero * Source/NSScrollView.m ([-_doScroll:]): Mark the horizontal and vertical ruler as needing redisplay if needed. ([-setHorizontalRulerView:]): Add/remove the new horizontal ruler as a subview; set _hasHorizontalRule to NO if the new horizontal ruler is nil; tile if rulers are visible. ([-setHasVerticalRuler:]): Similar changes. ([-setHasHorizontalRuler:]): Rewritten. In particular, use the class specified in +rulerViewClass when creating the new ruler. ([-setVerticalRulerView:]): Similar changes. (Patches from Diego Luis Kreutz modified). 2001-12-24 Fred Kiefer * Source/NSTextView.m [dragOperationForDraggingInfo:type:] added NSDragOperationCopy to the valid drag actions. 2001-12-23 Fred Kiefer * Source/NSTextView.m Added some NSResponder methods with empty code to keep the NSInputManager quiet. * Source/NSApplication.m [initialize] retain the gui bundle and added an auto release pool as this might be called without one installed. 2001-12-23 Fred Kiefer * Source/NSTextView.m [writeSelectionToPasteboard:types:] corrected C binary operator short cut logic that prevented us froam adding more than one string type to the pasteboard. Remember that || wont evaluate the second operand if the first is true. Fri Dec 21 18:50:17 2001 Nicola Pero * Headers/gnustep/gui/GSGuiPrivate.h: New file. * GNUmakefile (SUBPROJECTS): Added Resources. * Resources/GNUmakefile: New file. * Resources/Italian.lproj/Localizable.strings: New file. * Resources/English.lproj/Localizable.strings: New file. * Source/NSApplication.m ([+initialize]): Create the gnustep-gui bundle used for loading localized messages. (GSGuiBundle): New function. * Source/NSApplication: Localized most messages in this file. This is experimental. Fri Dec 21 14:37:45 2001 Nicola Pero * GNUmakefile (SUBPROJECTS): Added KeyBindings. 2001-12-20 Adam Fedor * Images/common_noCursor.tiff: New image from deek@d2dc.net. 2001-12-21 Fred Kiefer * Source/NSView.m Implemented dragFile:fromRect:slideBack:event:]. Moved code from [dragImage:...slideBack:] to NSWindow and call this. * Source/NSWindow.m New Implemantion of [dragImage:...slideBack:]. Replaced call to [NSGraphicContext _postExternalEvents:] with [NSDragInfo postDragEvent:]. Replaced most [NSScreen mainScreen] with [self screen]. * Headers/gnustep/gui/NSGraphicContext.h Removed method [_postExternalEvents:]. Added method [GSResolutionForScreen:]. * Headers/gnustep/gui/NSGraphic.h * Headers/gnustep/gui/GSMethodTable.h Added GSResolutionForScreen. * Source/NSGraphicContext.m Implemented [GSResolutionForScreen:] with code from NSScreen. * Source/NSScreen.m [deviceDescription] call new function GSResolutionForScreen. Wed Dec 19 17:55:25 2001 Nicola Pero * Source/NSTextView.m ([NSTextView -moveToEndOfLine:]): Fixed typo in my last commit. Tue Dec 18 22:13:31 2001 Nicola Pero * Source/NSTextView.m ([-moveToEndOfLine:]): Fixed problems with empty lines by carefully checking for special cases. * Source/NSLayoutManager.m ([-lineFragmentRectForGlyphAtIndex:effectiveRange:]): Fixed setting effective range. ([-lineFragmentUsedRectForGlyphAtIndex:effectiveRange:]): Idem. ([-textContainerForGlyphAtIndex:effectiveRange:]): Idem. 2001-12-19 Fred Kiefer * Source/NSApplication.m [setMainMenu:] set the title of the main menu window, so the window manager can display it.We could do this also for all other menus, but those wont show up in the window manager. * Tools/gopen.m Removed the redefinition of NSRunAlertPanel() as NSWOrkspace no longer uses this, 2001-12-18 Pierre-Yves Rivaille * Source/NSWindow.m ([NSWindow -setTitleWithRepresentedFilename:]): ([NSWindow -setTitle:]): ([NSWindow -_initBackendWindow:]): changed cString into lossyCString during DPStitlewindow calls * Source/NSBrowser.m: NSBrowserColumn: new methods initWithCoder & encodeWithCoder, it now complies to NSCoding [NSBrowser -initWithCoder:] & [NSBrowser -encodeWithCoder:]: major update to previous implementation. It is now usable with Gorm and should not generate memory leaks anymore. Mon Dec 17 23:54:35 2001 Nicola Pero * Source/NSInputManager.m: New class which loads key binding files and process keys basing on loaded key bindings. * Headers/gnustep/gui/NSInputManager.h: Updated. Removed methods deprecated in apple doc - there is no point in trying to be compatible with internal deprecated methods of a foreign system. * Source/NSResponder.m ([-interpretKeyEvents:]): Pass the key events to the current input manager. ([+initialize]): Added call to NSInputManager to have it init itself. * KeyBindings/: New directory. * KeyBindings/GNUmakefile: New file. * KeyBindings/DefaultKeyBindings.dict: New file. * Documentation/gsdoc/GNUmakefile (Gui_GSDOC_FILES): Added DefaultsSummary.gsdoc. * Documentation/gsdoc/DefaultsSummary.gsdoc: Documented the GSDefaultKeyBindings and GSCustomKeyBindings options. * Documentation/gsdoc/DefaultsSummary.html: Regenerated. 2001-12-17 Pierre-Yves Rivaille * Source/NSButtonCell.m ([NSButtonCell -drawInteriorWithFrame:inView:]) removed the code that drew the background (osx doesn't draw background) * Source/NSProgressIndicator.m ([NSProgressIndicator +initialize]): retain the fillColour. 2001-12-17 Adam Fedor * Source/*m: Add basic markup for autogsdoc generation. (various locations): Remove semi-colon at end of method names. NSSliderCell.m, NSSlider.m, NSTableColumn.m, NSView.m, NSWindow.m: Add documentation formerly in gsdoc files to comments. * Headers/gnustep/gui/NSColorList.h, NSPageLayout.h, NSPrintInfo.h, NSPrintOperation.h, NSPrinter.h, NSView.h: Correct method types, remove unused markup. * Documentation/gsdoc/GNUmakefile: Add variables for autmatic document generatation via autgsdoc. * Documentation/gsdoc/*gsdoc, *html: Update. Sat Dec 15 09:12:44 2001 Nicola Pero Patches from Ludovic Marcotte modified by myself. * Source/NSTextView.m ([-moveToBeginningOfDocument:]): Implemented. ([-moveToBeginningOfLine:]): Idem. ([-moveToEndOfDocument:]): Idem. ([-moveToEndOfLine:]): Idem. ([-moveWordBackward:]): Idem. ([-moveWordForward:]): Idem. ([-selectLine:]): Idem. 2001-12-12 Adam Fedor * Source/NSCursor: New cache dictionary. (-greenArrowCursor): New method. (-initWithImage:foregroundColorHint:backgroundColorHint:hotSpot:): Implement. 2001-12-09 Willem Rein Oudshoorn * Source/NSWindow.m (GSPerformVoidDragSelector): rewritten to not rely on category on NSObject (GSPerformDragSelector): rewritten to not rely on category on NSObject ([NSWindow -sendEvent:]): fixed bug in handling of informal draggingDestination protocol * Headers/AppKit/NSWindow.h (NSCoding>): added instance variable _lastDragOperationMask * Source/GNUmakefile (libgnustep-gui_OBJC_FILES): Removed obsolete NSObjectProtocols.m file Tue Dec 11 00:08:38 2001 Nicola Pero * Source/NSCell.m ([-setStringValue:]): Use a NSDebugMLLog to warn for attempts to use nil value, not NSWarnLog, as suggested by Wim Oudshoorn . 2001-12-09 Fred Kiefer * Source/NSApplication.m [NSIconWindow _initDefaults] set the title of the icon window, so the window manager can display it. 2001-12-07 Fred Kiefer * Source/NSWorkspace.m [_workspaceApplication] renamed defaults key for Workspace application to GSWorkspaceApplication. * Documentation/gsdoc/DefaultsSummary.gsdoc Documented NSWorkspace defaults entry GSWorkspaceApplication and the new xgps defaults entry GSFontMask. 2001-12-07 Adam Fedor * Source/NSImage.m (-drawRepresentation:inRect:): Draw background even when alpha == 0. * Source/NSApplication.m (-sendEvent:): Simplify NSDebugLog. * Documentation/gsdoc/DefaultsSummary.gsdoc: Update * Documentation/gsdoc/Gui.gsdoc: Remove NSDPSContext. 2001-12-07 Pierre-Yves Rivaille * Headers/gnustep/gui/NSTableColumn.h: * Source/NSTableColumn.m: changed the initWithIdentifier return type from NSTableColumn* to id. It prevents warning when subclassing and is consistent with the docs. * Headers/gnustep/gui/NSTableView.h: renamed ivar _del_editable to _dataSource_editable. Previously the delegate was responsible for tableView:setObjectValue:forTableColumn:row:, whereas it is now the dataSource that is responsible for it (it conforms with the docs) * Source/NSTableView.m: [setDelegate:], [setDataSource:] and [validateEditing] changed to conform to previous change * Source/NSTableView.m (quick_sort_internal) : fixed typo Wed Dec 5 11:04:14 2001 Nicola Pero * Source/NSPrintInfo.m ([+initPrintInfoDefaults]): Commented out debugging log which wouldn't compile. Wed Dec 5 10:55:13 2001 Nicola Pero * Source/NSClipView.m ([-setBackgroundColor:]): If the color is changed, mark the clipview as needing redisplay. ([-setDrawsBackground:]): If the flag is changed, mark the clipview as needing redisplay. * Source/NSText.m ([-setBackgroundColor:]): Mark the text as needing redisplay if the color is changed. If we are not a field editor, change the background color of the enclosing scrollview too. ([-setDrawsBackground:]): Mark the text as needing redisplay if the flag is changed. If we are not a field editor, change the flag for the enclosing scrollview too. 2001-12-02 Adam Fedor * Model/GMAppKit.m ([NSMenuItem -initWithModelUnarchiver:]): Check if target is a menu. * Source/NSCursor.m: Make class variables for arrow and ibeam cursor. 2001-11-30 Willem Rein Oudshoorn * Source/NSCursor.m (backgroundColorHint:): added FIXME comment * Images/GNUmakefile (IMAGE_FILES): added DnD cursors * Headers/gnustep/gui/NSBitmapImageRep.h (NSImageRep): removed unused instance variable 2001-12-03 Laurent Julliard * Source/NSTableHeaderView.m (-initWithCoder:, decodeWithCoder:): minimal decoding/encoding methods 2001-12-02 Gregory Casamento * Source/NSTableView.m -[NSTableView superviewFrameChanged:] Added a check to prevent exception when column count is reduced to zero. This change is consistent with behaviour observed on OPENSTEP4.2/Mach. 2001-12-02 Fred Kiefer * Source/NSWorkspace.m [findApplications] use hardcoded @GNUSTEP_INSTALL_PREFIX only for non-GNUstep foundation library. * Source/NSPasteboard.m [_pbs] use hardcoded @GNUSTEP_INSTALL_PREFIX only for non-GNUstep foundation library. * Source/NSImage.m [initialize] and [imageNamed:] use hardcoded @GNUSTEP_INSTALL_LIBDIR only for non-GNUstep foundation library. * Source/NSPrintInfo.m [initPrintInfoDefaults] use hardcoded @GNUSTEP_INSTALL_LIBDIR only for non-GNUstep foundation library. Sun Dec 2 08:54:36 2001 Nicola Pero * Source/NSAttributedString.m ([NSMutableAttributedString -fixParagraphStyleAttributeInRange:]): Fixes, particularly for case in which a style is not found at the beginning of paragraph. (Bug reported by Ludovic Marcotte ). 2001-12-02 Gregory Casamento * Tools/gopen.m Modified to eliminate the output of "No application for extension 'app'" when launching an application using gopen. The code now checks to see if an app is being launched first, then, if not, attempts to open the file. It's also slightly more efficient to check for an app first before calling -[NSWorkspace openFile:]. 2001-12-01 Fred Kiefer * Source/NSWorkspace.m Moved all private methods into seperate category. New method [_connectApplication:], use this in [openFile:...] and [launchApplication:...]. Implemented [openTempFile:]. New method [_workspaceApplication] used to implement [performFileOperation:...] and [selectFile:inFileViewerRootedAtPath:]. * Source/NSApplication.m [finishLaunching] and [terminate:] send workspace notification with the shared workspace as object. Sat Dec 1 10:10:58 2001 Nicola Pero * GNUmakefile.postamble (gui.make): Depend on configure. (config.make): Idem. Sat Dec 1 09:33:39 2001 Nicola Pero * GNUmakefile.postamble (after-distclean): Remove gui.make as well. (gui.make): New target. (config.make): New target. (configure): New target. Sat Dec 1 09:13:26 2001 Nicola Pero * Headers/gnustep/gui/NSButtonCell.h (NSGradientType): Fixed typo (Bug fix by Jay McCarthy ). Fri Nov 30 12:58:45 2001 Nicola Pero * Source/NSCell.m ([-setStringValue:]): Use NSWarnMLog to warn for nil string values rather than raising an exception (Suggestion by richard). 2001-11-28 Adam Fedor * Source/GSServicesManager.m (-rebuildServices): Use userLanguages method rather than getting NSLanguages default. * Documentation/gsdoc/DefaultsSummary.gsdoc: New file. * Documentation/gsdoc/Gui.gsdoc: Include it. 2001-11-27 Adam Fedor * Source/NSClipView.m: Treat _documentView as a convienience ivar. Don't release/retain or encode it. (-initWithCoder:): Get _documentView from subview array. * Source/NSTabView.m (-encodeWithCoder:): Conditionally encode delegate. (-initWithCoder:): Don't retain delegate. 2001-11-26 Fred Kiefer * Headers/gnustep/gui/NSWindow.h Added some new MacOSX methods and ivars to support them. Changed order of methods. * Source/NSWindow.m Implemented new methods. * Headers/gnustep/gui/NSWindowController.h Added some new MacOSX methods. * Headers/gnustep/gui/NSDocumentFrameworkPrivate.h Removed methods now public. * Source/NSWindowController.m Implemented new methods and renamed some old which are now public. * Source/NSDocument.m Adopted to name changes of NSWindowController methods. * Headers/gnustep/gui/NSNibLoading.h New extension method [pathForNibResource:]. * Source/NSBundleAdditions.m Extracted new method [pathForNibResource:] for NSWindowController. * Headers/gnustep/gui/NSWorkspace.h Added some new MacOSX methods. Changed order of methods. Made ivars out of some class variables. * Source/NSWorkspace.m A lot of cleanup. Implemented the new methods. [openFile:XXX] no longer show alert panels, as this should be done by the caller. [launchApplication:XXX] now checks if the application is already running. 2001-11-25 Gregory John Casamento * Tools/gopen.m made some enhancements to make the gopen tool behave more like the "open" tool under OPENSTEP/MOSX. 2001-11-24 Fred Kiefer * Headers/gnustep/gui/NSTextView.h Added protocol NSTextInput to NSTextView. Added some new MacOSX methods. * Source/NSTextView.m Corrected memory management in rulerview methods. Implemented update ruler. Dummy implementation for new spell checking methods. Implementation of new drag methods, use these in the dragging protocol methods. Moved the NSTextInput methods into the main category. Implemented some of them. * Source/NSLayoutManager.m Implemented [rulerMarkersForTextView:...ruler:]. * Headers/gnustep/gui/NSPasteboard.h Added extension methods for NSURL. * Source/NSPasteboard.m Implemented extension methods for NSURL. * Headers/gnustep/gui/NSView.h Added some new MacOSX methods. Changed order of methods. * Source/NSView.m Implemented those new methods. Call new methods from the subview handling methods. 2001-11-23 Fred Kiefer * Headers/gnustep/gui/NSTableView.h * Source/NSTableView.m Added some additional MacOSX methods. * Headers/gnustep/gui/NSTextField.h * Source/NSTextField.m Added and implemented some methods for the handling of richt text. * Source/extern.m Added notifications from NSTextStorage * Headers/gnustep/gui/NSTextStorage.h * Source/NSTextStorage.m Added some new methods that allow for lazy fixing of attributes in subclasses. * Source/NSTextView.m Added code to rulerview delegate methods. Thu Nov 22 00:58:12 2001 Nicola Pero * GNUmakefile (CVS_MODULE_NAME): Define. 2001-11-21 Laurent Julliard * Source/NSBrowser.m (-initWithCoder:): colCount and _firstVisible Column must always be decoded. Bug fixed (thanks to Adam Fedor) 2001-11-20 Laurent Julliard * Source/NSComboBoxCell.m (-setNumberOfVisibleItems): max number of items tested on wrong variable. Corrected 2001-11-19 Adam Fedor * Headers/gnustep/gui/NSGraphicsContext.h: Add usedFonts ivar. New methods for caching used fonts. * Source/NSGraphicsContect.m (-useFont): Moved from NSFont. (-resetUsedFonts, -usedFonts): Likewise. * Source/NSFont.m (+useFont:): Use them. * Source/NSView.m (-endDocument): Likewise. * Model/GMArchiver.m (-decodeSelectorWithName:): Use correct 0 value. 2001-11-18 Gregory John Casamento * Tools/gopen.m: added a tool which works like the OPENSTEP 4.2/Mach "open" command to the tools directory. 2001-11-15 Laurent Julliard * Source/NSBrowser.m: NSBrowser encoder and decoder added 2001-11-12 Fred Kiefer * Source/NSFontManager.m Reorganised the handling of the font enumerator. New [_includeFont:] is only called from here. Corrected [availableMembersOfFontFamily:] and [fontNamed:hasTraits:]. * Headers/gnustep/gui/GSFontInfo.h: Adopted GSFontEnumerator to changes on NSFontManager. * Source/GSFontInfo.m: Changed GSFontEnumerator so that only [enumerateFontsAndFamilies] must be subclassed. 2001-11-11 Fred Kiefer * Source/NSTabView.m In [selectTabViewItem:] corrected setting the first responder of the tab view. 2001-11-09 Adam Fedor * Source/NSView.m (-addSubview:): Raise exception on adding nil subview or superview of view. (-addSubview:positioned:relativeTo:): Likewise. (-beginDocument): Change NSLog to exception. Thu Nov 8 23:30:47 2001 Nicola Pero * Source/NSMatrix.m ([-sizeToFit]): Reverted last change. * Source/NSBrowser.m ([-_performLoadOfColumn:]): Do not call sizeToFit on the matrix, just set the cellSize to the result of calling -cellSize on the first browsercell in the matrix. 2001-11-08 Adam Fedor * Simple printing/pagination implementation * Headers/gnustep/gui/NSGraphicsContext.h: Add some constants * Source/NSFont.m (+useFont:): Same font name in static NSSet (+resetUsedFonts): Implement (+usedFonts): Likewise. * Source/NSGraphicsContext.m (+defaultContextWithInfo:) Depreciated, calls +graphicsContextWithAttributes:. (+graphicsContextWithAttributes:): Creates default context class. (+useFont:): Removed. * Source/NSPrintInfo.m (-setOrienatation:) Set paper size accordingly. (-setPaperName:): Likewise. (-setPaperSize:): Set orientation. (+initPrintInfoDefaults): Rewrite. * Source/NSPrintOperation.m (-_setupPrintInfo): New private. (-_printPaginateWithInfo:knowsRange:): Likewise. (-_rectForPage:info:): Likewise. (-_adjustPagesFirst:last:info:): Likewise. (-_print): Rewrite for pagination, printing. ([NSView -_displayPageInRect:atPlacement:withInfo:]): New private. ([NSView -_endSheet): Likewise. * Source/NSPrintPanel.m: Fix layout settings. * Source/NSView.m (-printJobTitle): Implement. (-locationOfPrintRect:, beginPage:label:bBox:fonts:, beginPageSetupRect:placement:, beginPrologueBBox:..., beginSetup, beginTrailer, endHeaderComments, endPrologue, endSetup, endPage, endTrailer, beginDocument, beginPageInRect:atPlacement:, endDocument): Likewise. 2001-11-08 Laurent Julliard * Headers/gnustep/gui/NSGraphics.h * Source/Functions.m * Source/NSImageCell.m: NSDrawFramePhoto added. Needed by the ImageView inspector in Gorm 2001-11-06 Pierre-Yves Rivaille * Source/NSTableView.m ([-sizeToFit]): replaced floorf with floor suggestion from Stephen Brandon 2001-11-03 Fred Kiefer * Source/NSMenu.m In [performActionForItemAtIndex:] select the item of the popup before sending the action. * Headers/gnustep/gui/NSSplitView.h Removed unused ivar _splitCursor. Added some MacOSX methods. Moved extension methods to separate category. * Source/NSSplitView.m Adopted to changes in header. Dummy implementation of new methods. Changed incudes. In [mouseDown:] also check for new delegate methods. [_adjustSubviews:] now takes the old size as an argument to hand it on to delegate. Changed all places that call this. En-/decode the image instead of the cursor. * Headers/gnustep/gui/NSTabView.h Renamed all ivars and added some new MacOSX methods. Added two new unsupported NSTabViewType values. * Source/NSTabView.m Adopted to changes in header. Use [insertTabViewItem:atIndex:] in [addTabViewItem:]. Corrected [selectNextTabViewItem:] and [selectPreviousTabViewItem:]. In [selectTabViewItem:] set the first responder of the tab view. Other small cleanup. 2001-11-03 Fred Kiefer * Headers/gnustep/gui/NSSpellChecker.h Added [guessesForWord:]. * Source/NSSpellChecker.m Implement [guessesForWord:] and use it in [browser:createRowsForColumn:inMatrix:]. Don't create the server in [init], but check it before each use. Check if ther server proxy exists before all method calls that return a NSRange. In [checkSpellingOfString:...wordCount:] don't call [updateSpellingPanelWithMisspelledWord:]. Beep in this method, when the string is empty. [_findNext:], [_ignore:] and [_correct:] now use [[NSApp sendAction:to:from:] instead of explicit responder. * Source/NSTextView.m Adopted implemtantion of [checkSpelling:] to changes in NSSpellChecker. [updateSpellingPanelWithMisspelledWord:] is now called from here. gnustep-gui-0.24.0/NEWS0000664000076500007650000006230312256227272014454 0ustar brains99brains991 NEWS ****** The currently released version of the library is `0.24.0'. 1.1 Noteworthy changes in version `0.24.0' ========================================== New features include: * Require newer base release as we moved the -replaceObject:withObject: of NSKeyedUnarchiver there. * Support for newer releases of the gif library. * NSTabView is now flipped. * Theme improvements and changes to image mapping. Many bugfixes. 1.2 Noteworthy changes in version `0.23.1' ========================================== This is a bugfix release, primarily to deal with coding/archiving issues. 1.3 Noteworthy changes in version `0.22.0' ========================================== New features include: * This version is binary incompatible with previous versions due to the change of NSNotFound in GNUstep base. * Support for drawing the GUI with a scale factor, for high-DPI monitors. * Character panel * Color picker "Magnifier" tool, for grabbing the color of arbitrary parts of the screen Many NSImage improvements (Mac OS X 10.6 drawing methods, better selection of image reps, better support for icons). Many bugfixes, including in Xib loading, printing, and NSView geometry. 1.4 Noteworthy changes in version `0.20.0' ========================================== A new stable release. Many improvments with Nib loading, documents and document controllers. Fixed many drawing issues, particularly ones related to flipping. Much improved theming. 1.5 Noteworthy changes in version `0.19.0' ========================================== This is an (unstable) copy of the 0.18.0 release 1.6 Noteworthy changes in version `0.18.0' ========================================== A new stable release that has had many improvements. Many new Mac OS X methods (10.5 and newer) were added. Many Windows specific improvements were made (particularly with the use of the Windows theme). There is also better compatibility with Mac OS X in terms of usage of NSInteger and other definitions. 1.7 Noteworthy changes in version `0.17.1' ========================================== * New Mac OS X 10.5 methods in NSFont * Add live resize in NSSplitView 1.8 Noteworthy changes in version `0.17.0' ========================================== * New Mac OS X 10.5 methods in many classes * Toolbars have been completely rewritten and improved. * Several improvements for Garbage Collection 1.9 Noteworthy changes in version `0.16.0' ========================================== * Nib loading refractored and improved. * Added support for autosaving in NSDocuments * NSWindowController made a subclass of NSResponder * NSTokenField and netokenFiledCell classes added. 1.10 Noteworthy changes in version `0.14.0' =========================================== * New class NSGlyphGenerator for glyph generation * NSSplitView implemented setAutosaveName: * NSOpenGLView added some Mac OS X 10.3 methods * Manu bug fixes. 1.11 Noteworthy changes in version `0.13.2' =========================================== * Printing works a little better now. * NSPopUpButtonCell - object encoding was changed * NSTextView - several updates and Mac OS X methods added * NSWindow - devince interaction was changed. You need to use gnustep-back 0.13.2 with this version * New class NSSegmentedCell. * NSDrawer was implemented. 1.12 Noteworthy changes in version `0.13.1' =========================================== * NSMenu - Added more MacOS X methods and an ivar. * Added support for hiding views. * Added Key-Value bindings implementation (NSKeyValueBinding) with support in several classes (NSControl, NSTextField, NSView, etc). * Added some MacOS X 10.4 methods to NSTableView. * Changed the NSCursor hot point to 0,0 for MacOS X compatibility. 1.13 Noteworthy changes in version `0.13.0' =========================================== This is an unstable release. There may be backward compatibility issues with previous releases of the gui library. * Switched to use LGPL 3 and GPL 3. * Added new methods from Mac OS X 10.4 for NSDragging, NSFontDescriptor, NSAttributedString, NSImageView, NSStringDrawing, NSParagraphStyle, NSView, NSCell, NSActionCell, NSAlert, NSApplication, NSBitmapImageRep, NSBox, NSColor, NSColorSpace, NSComboBox, NSComboBoxCell, NSDocumentController, NSEvent, NSScreen, NSFont, NSFontManager, NSFormCell, NSForm, NSWindow, NSTextField, NSTextFieldCell. Some ivar names were changed also. * Moved Postscript printing methods from NSView to NSGraphicsContext. * Rewrote the NSView drawing mechanism to always use [displayRectIgnoringOpacity:inContext]. * Report more controls as being flipped. (NSTextField, NSTableHeaderView, NSSlider, NSProgressIndicator, NSButton) NSTabView is still missing. * In NSAffineTransform use optimized primitive methods from base. * Add font attribute fixing to NSAttributedString. To allow for the output of glyphs not present in the current font. * Optimized the validation of edited cells. * Implementation of special connectors for Key-Value binding. * Base library version 1.15.1 is required for this release 1.14 Noteworthy changes in version `0.12.0' =========================================== It has been a long time since the last release and many things have been added and changed, including new classes, new ivars, and new methods. * Lots of improvements to the NSBitmapImage subclasses thanks to Mark Tracy * GSTheme and other classes were added to improve support of theming. * Added new methods from Mac OS X 10.4 for NSControl, NSResponder, NSDocument, NSPrintOperation, NSWindowController, NSCell, NSMenuItem, NSView. Some ivar names were changed also. * Added new ivars for NSMenuItem, NSPrintOperation, NSTableView, NSDrawer, NSScrollView. * New classes from Mac OS X 10.4 and earlier were added including NSLevelIndicator, NSObjectController, NSUserDefaultsController, NSKeyValueBinding, NSArrayController, NSController. * NSSpellServer and NSAffineTransform was moved to GNUstep base for Mac OS X compatibility. 1.15 Noteworthy changes in version `0.11.0' =========================================== * Added support for keyed encoding in all gui classes. * Added mechanism to allow for dynamic extension of model loading mechanism * Implemented glue code in GSNibCompatibility for classes such as NSIBObjectData, NSClassSwapper, etc. to facilitate nib loading. 1.16 Noteworthy changes in version `0.10.3' =========================================== * Horizontal menus now work * Better support for tracking active applications. 1.17 Noteworthy changes in version `0.10.2' =========================================== Mostly bug fixes. 1.18 Noteworthy changes in version `0.10.1' =========================================== GNUstep now uses v19 of portaudio for the sound daemon. Version v19 hasn't been officially released, but it is still used in several distributions (SuSE, etc) as v18 is very old. 1.19 Noteworthy changes in version `0.10.0' =========================================== This release is binary incompatible with previous releases. The interface version of the library has changed so that apps, tools and libraries that use the base library need to be recompiled to use this new version. * Model loading supports window auto-positioning * Keyed encoding is supported in many classes. 1.20 Noteworthy changes in version `0.9.5' ========================================== * Beginnings of CUPS interface were added. * Added new control colors and methods from 10.3 version of Cocoa. * Added new font methods from 10.3 version of Cocoa. * NSApplication -runModalSession behavior changed. * You can find the GUI library's version using the Info.plist 1.21 Noteworthy changes in version `0.9.4' ========================================== * The printing classes have been completely reorganized to accommodate different native printing systems (Thanks to Chad Hardin). * PPD files have been moved to a separate package. * NSToolbar now allows rearranging items. * NSScroller, NSScrollView has a new ivar. * Some improvement of NSDataLink classes. 1.22 Noteworthy changes in version `0.9.3' ========================================== * Spell checker reimplemented using libaspell * New NSComboBox implementation * NSToolbar much improved * Binary incompatibilites from ivar additions in NSView and subclasses. 1.23 Noteworthy changes in version `0.9.2' ========================================== * Working NSToolbar implementation * New Mac OS X methods in NSView and other classes * Fixed some sheet handling problems. * Integrated gif, jpg, and png handling in front-end. * Added overridable button and frame drawing functions * Add some keyed decode/encoding to some classes * NSStringDrawing redesigned. * Much improved loading of gorm files 1.24 Noteworthy changes in version `0.9.1' ========================================== * NSWindow - DnD works on whole window and events are propogated up to first DnD aware view. * Absolute paths and DnD works in OpenPanels. 1.25 Noteworthy changes in version `0.9.0' ========================================== Improvements in various classes, include NSPopUpButton, NSBitmapImageRep, NSMenu, NSToolbar. Added support for thumbnail images in NSWorkspace. 1.26 Noteworthy changes in version `0.8.9' ========================================== Note that many headers have moved to new locations (both in the package and when installed), so it is possible, although not likely that some applications may not compile because they cannot find the right header. * New Language Setup documentation. 1.27 Noteworthy changes in version `0.8.8' ========================================== * Updated LanguageSetup documentation * Improved RTF reader (unicode support, etc). 1.28 Noteworthy changes in version `0.8.7' ========================================== * NSBezierPath glyph methods implemented (depends on backend). * NSDataLink[Panel/Manager] - some implementation * Added default to load user-defined bundles (GSAppKitUserBundles default). 1.29 Noteworthy changes in version `0.8.6' ========================================== Updated to install in new locations based on changes in gnustep-make 1.7.0. * New implementation of RTF producer (from Axel "Mikesch" Katerbau) * Speed improvements, especially in tracking mouses movements. * Lots of menu improvements. 1.30 Noteworthy changes in version `0.8.5' ========================================== Bug fixes. NSStringDrawing now uses text system implementation. 1.31 Noteworthy changes in version `0.8.4' ========================================== This release features a brand new text and layout system thanks to Alexander Malmberg. Other improvements include: * Various display optimizations. * Default border to NSScrollView changed * Printing fixes. * NSToolbar partially implemented. 1.32 Noteworthy changes in version `0.8.3' ========================================== * Additions for Gorm support. * Alpha support for OpenGL * Better ruler support - dragging of tab markers. * Document support, recent files, etc. * Simple printing to printer and print previewing. * Window focus fixes * Key view handling rewritten. 1.33 Noteworthy changes in version `0.8.2' ========================================== * Handle fonts that aren't found better. * Implement pageUp/Down. * Some window focusing problems fixed. * Quartz-like interface partially implemented. * NSSecureTextField partially rewritten. More secure. * NSBrowser: implement non-separate columns * Fix firstResponder status in text fields. 1.34 Noteworthy changes in version `0.8.1' ========================================== * Handle scaled curves correctly. * Handle alpha channel with images correctly * NSWindow frame string save without flipping coordinates. * NSSound implemented. gssnd sound server. * Spell checker starts correctly now. 1.35 Noteworthy changes in version `0.8.0' ========================================== 1.36 Noteworthy changes in version `0.7.9' ========================================== * NSTableView, NSOutlineView improvements. * Menus no longer work in modal loop. * Skeleton implementation of NSToolBar 1.37 Noteworthy changes in version `0.7.8' ========================================== * Wheel color picker, standard color picker (bundles) added. * System colors now use named colors. Easier configuration 1.38 Noteworthy changes in version `0.7.7' ========================================== The graphics/window interface was completely revamped. Window functions were split into a separate class, GSDisplayServer, and many PS and DPS functions were removed that were never implemented. However, new functionality was added to make things faster and eventually implement Quartz compatibility. In addition, the old backends, xgps and xdps were depreciated in favor of a new backend, simply named back, which can be configured for a variety of window server and graphics implementations, and also allow for improved code sharing. In addition there is now a window server backend for Windows computers, although it is in a very alpha state. Other improvements: * Mutliple screens are now handled properly (untested) * Better autolayout with GSTable and subclasses. * NSOutlineView much improved. 1.39 Noteworthy changes in version `0.7.6' ========================================== * NSOutlineView implemented. * Improvements to NSTableView, NSPopUpButton, NSTextView, NSFontPanel * Scroll wheel support. * Fully-functional keybindings, including multi-stroke keybindings. * Memory panel available from Info Panel. 1.40 Noteworthy changes in version `0.7.5' ========================================== * Drag and drop and image sliding much improved. * Better handling of remote startup/display. * Some localization. * Keybinding support. * Text handling improvements. * New gopen command (like MacOSX open command). * Implemented simple pagination and printing of views. * Support for rulers. * Spell checking support. * Blinking insertion point. * New NSStepper class. * Implemented NSOutlineView, NSSelection, NSInputManager. * Near rewrite of Menu handling code. * Gmodel code compiled as a separate bundle. 1.41 Noteworthy changes in version `0.7.0' ========================================== * Much improvement in NSBrowser, NSMatrix, NSPopUpButton, combo boxes. * NSTextAttachement implemented, many other text improvements. * Fonts cached in the frontend. * Changes so that backend can be loaded as a bundle at runtime. * simpler, faster compilation and installation. * NSColorWell works. 1.42 Noteworthy changes in version `0.6.7' ========================================== * App Icons can support documents dropped using DnD. * Added color conversions, working color picker and panel. * Almost complete rewrite of NSBezierPath * Loads of improvements to Text classes. * NSImage, NSButton, NSCell, etc, implemented many missing methods. * ...and even more changes to the Text classes. * Starting implementation of printing. * Scrollview fixes. * Implemented deferred windows. * NSTableView implemented. * Implemented object value and formatter support in NSCell * Support middle mouse button. 1.43 Noteworthy changes in version `0.6.6' ========================================== * Window hints for motif and generic window managers. * Major improvements to the text handling classes (NSText, NSTextView, etc) * Pasting of fonts and rulers. * Much better RTF handling * DnD for NSColorWell * Much improved NSSplitView * New classes - NSColorPanel, NSTableView * NSScreen rewritten with full support for all methods and functions. * Can use image reading routines from WindowMaker if available to read a variety of image formats besides TIFF. * Many fixes to get the AppKit to work better with WindowMaker. * Much better gmodel support (particularly with nibs translated from NeXT or OPENSTEP 4.2). * Muh improved font classes and font support. In addition both the xgps and xdps backends have seen some large efficiency improvements. Much better font support. The xdps backend itself has seen speed improvements by at least a factor of 4. Note however, that the xdps backend is still considered experimental and you may have to deal with many problems in order to get it working. We recommend sticking with the xgps backend (the default) for now. 1.44 Noteworthy changes in version `0.6.5' ========================================== Many of the basic GUI classes have been vastly improved or rewritten, thanks to Nicola Pero and many others. * New Info Panel support * New NSBezierPath * Rewrite of several classes including Cell and Button classes. * Rewrite of NSBrowser, NSSavePanel, menus, text classes, NSTableHeader. * RTF Parser * Implemented image caching. * Implemented editing in Forms, Matricies. * New autolayout classes GSHBox, GSTable, and GSVBox. * Almost all back-end classes have been removed and code incorporated in a DPS-like graphics context structure. * Better keyboard handling. * NSHelpManager, NSComboBox, ProgressIndicator written. In addition a preliminary version of an Interface Builder (Gorm) has been written, thanks to Richard Frith-Macdonald 1.45 Noteworthy changes in version `0.6.0' ========================================== A Huge amount of progress, although a lot still needs to be done. It's usable for a large base of moderately simple apps. Several NeXT/OpenStep apps and libraries have been ported with little changes. * Drag and Drop support fleshed out but not completed. * NSText and related classes rewritten. Basic functionality but much needs to be done to finish them off. * nib2gmodel app works with MacOS-X * Work done in minimizing the backend which allowed a lot of functionality to move to the GNU library. * Menu code rewritten. * PopupButtons now work. * Many new images * Basic functionality for NSTabView * Much better lockFocus support in NSView. Flipped views handled. * Rewrite of NSSavePanel and NSOpenPanel * Several fixes that at least double the speed of the gui. 1.46 Noteworthy changes in version `0.5.5' ========================================== Too extensive to list. * A lot of rewritting has been done to the classes, with general cleanup of coordinate conversion code, etc. 1.47 Noteworthy changes in version `0.5.0' ========================================== * NSBrowser and NSBrowserCell have been implemented. There is one odd display artifact; lists which are smaller than the browser column area have the list justified to the bottom of the column versus the top of the column. This is actually an issue with NSMatrix and will be remedied when flip views are implemented. * Two important optimizations that speed up the displaying of views and flushing of windows have been implemented. Only the views that need display and those that produce visible effects on the screen receive the -drawRect: message. Flushing of windows occurs only in rectangles that get displayed not in the whole window. * Rotation and scaling of views have been finally implemented. The code requires backend support for changing the state of the graphics context accordingly. * NSScrollView and NSClipView have been implemented. The current implemented behavior is to call the document view to display the exposed region. Copying on scroll will be supported soon, at least on Solaris DPS, where it seems the Postscript language has provisions for copying drawn regions of screen. Hopefully DGS will also have this facility by the end of the year. * NSScroller has been completely reworked to gain speed by using timer events. * NSSlider has been implemented. Thanks to Frank Knobloch for supporting this and the NSScrollView implementation. * NSBox has been implemented. * The library has been ported to work under Solaris with the native DPS and the NeXT/Apple's Portable Distributed Objects (PDO) environment. * The library has been integrated with the makefile package so we now benefit from all of the features the makefile package gives us, especially the possibility to build shared libraries on various systems and having different types (debug and profile) of the library compiled at the same time. * NSCell is able to continuosly send the action to the target while the user is tracking the mouse. * Several cleanups and as usual, many bug fixes. 1.48 Noteworthy changes in version `0.3.0' ========================================== * Completely reworked the menu class. The NSMenu class is now inherited from NSObject and using the new implementation menus have been implemented for the XDPS backend (they have the look and feel of the NeXTStep menus!). * NSRunLoop has been integrated with NSApplication. Using this capability time events have been implemented to NSEvent class. These events allow several improvements in the interaction between user and the graphic interface. * NSMatrix has been reworked, it is now conforming to the OpenStep specification and it knows all the selection modes. It uses time events to enhance the drawing speed during mouse drags. * The initial implementation of NSForm has been made although it has not been tested yet. * NSPrinter has been implemented though it was not throughly tested; thanks to Simon Frankau. * Configure script has been changed to detect the underlaying Foundation library. The currently supported libraries are gnustep-base and libFoundation. * Several cleanups have been made in a lot of classes: the retain/release policy has been fixed, the cell classes correctly implement the NSCopying protocol and many others. 1.49 Noteworthy changes in version `0.2.0' ========================================== * Additional NSImage and NSImageRep class work. Incorporated common images for use with controls that were designed by Andrew Lindesay. * Fill out implementation of NSColorWell class. * Fill out implementation of NSColorList class. * Cleaned up the header files and added missing headers, methods, categories, and protocols; thanks to Simon Frankau for much of this work. Major reorganization of header files. Types and constants were moved in the files they belong. Each header file includes only the headers it really needs. Use `@class' to forward class definitions instead of including the corresponding class file. * Completely reworked the NSFont and NSFontManager classes so that NSUserDefaults is used for getting defaults and list of known fonts are maintained. * Initial implementation of NSCursor class. * Almost complete implementation of NSButton and NSButtonCell class. Buttons can now display images and/or text, handles all of the OpenStep button types and styles. * Fill out implementation of NSScroller class. * Put in underlying support for optimizing drawing; flushing of windows, backing store, and only display when needed. * Many bug fixes and minor enhancements. 1.50 Noteworthy changes in version `0.1.1' ========================================== * Almost complete implementation of the PXKMenu and PXKMenuCell classes. * Fill out implementation of NSFont and NSFontManager. * Fill out implementation of NSColor including color spaces other than RGB. Now maintains the common colors as global variables. * Integration with the Display Ghostscript System. This is mainly related to using the header files in the DPSclient library for defining the PostScript operator functions. * Initial documentation set. * Initial implementation of NSImage, NSImageRep, and NSImageRep subclass classes based upon work by Adam Fedor. * Now requires the TIFF library for reading, writing, and manipulating tiff files and images. 1.51 Noteworthy changes in version `0.1.0' ========================================== * Integration of the GNUstep X/DPS GUI Backend. This has finally produced a set of core code with can display on X/Windows. Much of the X/Windows code has been written by Pascal Forget and integration efforts have been lead by Scott Christley . * Some major directory reorganization for the new naming guidelines. Headers previously in AppKit and DPSClient directories have been moved to gnustep/gui and gnustep/dps directores and symbol links are created for the AppKit and DPSClient directories. This should allow both GNUstep and other OpenStep implementations to reside on the same machine without conflicts. Also see the `ChangeLog' file for more detail. gnustep-gui-0.24.0/GNUmakefile.postamble0000664000076500007650000000512311374270443020007 0ustar brains99brains99# -*-makefile-*- # GNUmakefile.postamble # # Project specific makefile rules # # Copyright (C) 1997 Free Software Foundation, Inc. # # Author: Scott Christley # # This file is part of the GNUstep GUI Library. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # Uncomment the targets you want. # The double colons (::) are important, do not make them single colons # otherwise the normal makefile rules will not be performed. # # Things to do before compiling # before-all:: # Things to do after compiling # after-all:: # # The following rule is important mainly for packaging, because in that case # you install into a fake system tree, and the directory is not there. # $(DESTDIR)$(GNUSTEP_MAKEFILES)/Additional: $(MKDIRS) $(DESTDIR)$(GNUSTEP_MAKEFILES)/Additional # Things to do before installing before-install:: $(DESTDIR)$(GNUSTEP_MAKEFILES)/Additional $(INSTALL_DATA) gui.make \ $(DESTDIR)$(GNUSTEP_MAKEFILES)/Additional/gui.make # Things to do after installing # after-install:: # Things to do before uninstalling before-uninstall:: rm -f $(DESTDIR)$(GNUSTEP_MAKEFILES)/Additional/gui.make # Things to do after uninstalling # after-uninstall:: # Things to do before cleaning # before-clean:: # Things to do after cleaning #after-clean:: # cd Headers ; cd gnustep ; cd gui ; rm -f *~ # cd Headers ; cd gnustep ; \ # if [ -d dps ]; then \ # cd dps ; rm -f *~; \ # fi # NOTE: the gnustep/gui directories don't exist anymore. # Things to do before distcleaning # before-distclean:: # Things to do after distcleaning after-distclean:: rm -f config.status config.log config.cache TAGS config.make gui.make gui.make: gui.make.in Version configure ./configure config.make: config.make.in configure ./configure # Things to do before checking # before-check:: # Things to do after checking # after-check:: .PHONY: gnustep-gui-0.24.0/COPYING0000664000076500007650000010451410711446641015006 0ustar brains99brains99 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . gnustep-gui-0.24.0/config/0000775000076500007650000000000012256227332015213 5ustar brains99brains99gnustep-gui-0.24.0/config/icu.m40000664000076500007650000000203011605125765016234 0ustar brains99brains99AC_DEFUN([AC_CHECK_ICU], [ ok=no if test -z "$ICU_CONFIG"; then AC_PATH_PROG(ICU_CONFIG, icu-config, no) fi if test "$ICU_CONFIG" = "no" ; then echo "Could not find the icu-config script." echo "Please ensure that it is in your path." echo "See http://site.icu-project.org/ for help." else ICU_VERSION=`$ICU_CONFIG --version` AC_MSG_CHECKING(for ICU >= $1) found=`expr $ICU_VERSION \>= $1` if test "$found" = "1" ; then AC_MSG_RESULT(yes) ok=yes AC_MSG_CHECKING(ICU_LIBS) ICU_LIBS=`$ICU_CONFIG --ldflags-libsonly` AC_MSG_RESULT($ICU_LIBS) AC_MSG_CHECKING(ICU_LDFLAGS) ICU_LDFLAGS=`$ICU_CONFIG --ldflags-searchpath` AC_MSG_RESULT($ICU_LDFLAGS) else ICU_LIBS="" ICU_LDFLAGS="" ## Either perform custom action or print error message ifelse([$3], ,echo "can't find ICU >= $1 (got $ICU_VERSION)",) fi AC_SUBST(ICU_LIBS) fi if test $ok = yes; then ifelse([$2], , :, [$2]) else ifelse([$3], , AC_MSG_ERROR([Library requirements (ICU) not met.]), [$3]) fi ]) gnustep-gui-0.24.0/config/pkg.m40000664000076500007650000000412312074530717016240 0ustar brains99brains99 dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not) dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page dnl also defines GSTUFF_PKG_ERRORS on error AC_DEFUN(PKG_CHECK_MODULES, [ succeeded=no if test -z "$PKG_CONFIG"; then AC_PATH_PROG(PKG_CONFIG, pkg-config, no) fi if test "$PKG_CONFIG" = "no" ; then echo "pkg-config script not be found" ## We don't want the user to see this warning ## echo "*** The pkg-config script could not be found. Make sure it is" ## echo "*** in your path, or set the PKG_CONFIG environment variable" ## echo "*** to the full path to pkg-config." ## echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then AC_MSG_CHECKING(for $2) if $PKG_CONFIG --exists "$2" ; then AC_MSG_RESULT(yes) succeeded=yes AC_MSG_CHECKING($1_CFLAGS) $1_CFLAGS=`$PKG_CONFIG --cflags "$2"` AC_MSG_RESULT($$1_CFLAGS) AC_MSG_CHECKING($1_LIBS) $1_LIBS=`$PKG_CONFIG --libs "$2"` AC_MSG_RESULT($$1_LIBS) else $1_CFLAGS="" $1_LIBS="" ## If we have a custom action on failure, don't print errors, but ## do set a variable so people can do so. $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` ifelse([$4], ,echo $$1_PKG_ERRORS,) fi AC_SUBST($1_CFLAGS) AC_SUBST($1_LIBS) else echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." echo "*** See http://www.freedesktop.org/software/pkgconfig" fi fi if test $succeeded = yes; then ifelse([$3], , :, [$3]) else ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4]) fi ]) gnustep-gui-0.24.0/ChangeLog.20000664000076500007650000075472310377004044015675 0ustar brains99brains992001-11-02 Adam Fedor * Source/NSSavePanel.m (-_resetDefaults): Set directory only if nil (otherwise keep the current directory). 2001-11-02 Fred Kiefer * Headers/gnustep/gui/NSSlider.h * Headers/gnustep/gui/NSSliderCell.h * Source/NSSlider.m * Source/NSSliderCell.m Added methods to handle ticks with a dummy implementation. * Source/NSTextView.m Added include for NSScrollView to avoid compiler warning. [_blink] don't call [NSApp updateWindows], just redisplay our window. [mouseDown:] replaces all [_window flushWindow] with [self displayIfNeeded]. * Headers/gnustep/gui/NSGraphicsContext.h Added APPKIT_DECLARE for GSCurrentContext(). * Headers/gnustep/gui/NSGraphics.h Replaced APPKIT_EXPORT with APPKIT_DECLARE for all functions and added some missing APPKIT_DECLARE. * Headers/gnustep/gui/NSPanel.h Added APPKIT_DECLARE for all functions. Wed Oct 31 01:23:16 2001 Nicola Pero Implemented blinking insertion point (Work done with Ludovic Marcotte ). * Headers/gnustep/gui/NSTextView.h (_drawInsertionPoint): New ivar. (_insertionPointTimer): New ivar. * Source/NSTextView.m ([-initWithFrame:textContainer:]): Set selected range to 0, 0. ([-initWithCoder:]): Set selected range to 0, 0. ([-_blink]): New method. ([-dealloc]): Invalidate then destroy the insertion point blinking timer. ([-shouldDrawInsertionPoint]): Don't draw the insertion point if we are not first responder. ([-setEditable:]): Start/stop insertion point blinking. ([-setSelectedRange:affinity:stillSelecting:]): Stop the insertion point blinking if the selected range is not of zero length. ([-updateInsertionPointStateAndRestartTimer:]): Start/stop blinking as appropriate. ([-becomeFirstResponder]): Start blinking if appropriate. ([-resignFirstResponder]): Stop blinking if appropriate. ([-drawRect:]): Only draw the insertion point if we are in the `on' phase of blinking. ([-becomeKeyWindow]), ([-resignKeyWindow]): Removed. ([-_illegalMovement:]): Stop blinking if appropriate. 2001-10-29 Pierre-Yves Rivaille * Headers/gnustep/gui/NSTableView.h: * Source/NSTableView.m: [-sizeLastColumnToFit], [-sizeToFit], [-setAutoresizesAllColumnToFit], [-autoresizesAllColumnsToFit] implementation sizeToFit now behaves like OS4.2 (it did not) Various changes for speed improvements ([-drawRect], [-updateCell]) New internal method ([-superviewFrameChanged:]) called by NSClipView (conforms to OS4.2) [-initWithCoder]: support for previously archived NSTableView * Source/NSClipView.m: [-dealloc] and [-setDocumentView:] Support for NSTableView superviewFrameChanged method 2001-10-28 Pierre-Yves Rivaille * Source/NSStepper.m: * Source/NSStepperCell.m: Major rewrite so that it behaves properly Now NSStepper does not contain a textfield anymore and can be linked to any control using the take*ValueFrom: methods Thu Oct 25 16:42:00 2001 Gregory John Casamento * Source/NSSelection.m implemented bodies of methods for NSSelection. The behaviour implemented is identical to that observed when testing NSSelection under OPENSTEP with the exception that I have replaced the word "NeXT" with "GNUstep" in the selection marker descriptions. * Source/NSOutlineView.m implelemented a skeletal version of this class to be filled in later. * Headers/NSOutlineView.h created a skeletal version of this header to be filled in later. * Headers/AppKit.h added #include for NSOutlineView.h. * Source/GNUmakefile added reference to NSOutlineView.h and NSOutlineView.m Wed Oct 24 11:01:33 2001 Nicola Pero * Source/NSBrowser.m ([NSBrowser -_getTitleOfColumn:]): Make sure we never return nil. (Suggestion by Ludovic Marcotte ) 2001-10-24 Pierre-Yves Rivaille * Source/NSButtonCell.m ([NSButtonCell -_init]): set the alternate title and the keyEquivalent to @"" (by default this was nil) Tue Oct 23 04:16:57 2001 Nicola Pero Patch by Ludovic Marcotte : * Source/NSTextView.m ([-mouseDown:]): Check if the click was on a text attachment cell only if the text storage contains text attachments, rather than only if the text view imports graphics. Tue Oct 23 15:06:57 2001 Nicola Pero Patch by Ludovic Marcotte : * Source/NSOpenPanel.m ([-_selectTextInColumn:]): Updated calls to setStringValue: for last change. * Source/NSSavePanel.m ([NSSavePanel -selectText:]): Idem. Tue Oct 23 10:32:18 2001 Nicola Pero * Source/NSCell.m ([-setStringValue:]): Check with an assertion that the string value is not nil - for Mac OS-X compatibility. (Suggested by Ludovic Marcotte ). Mon Oct 22 01:10:24 2001 Nicola Pero * Source/NSWindow.m ([NSWindow -dealloc]): Remove all subviews from this window before releasing them. This fixes crashes when some views were deallocated after the window. 2001-10-21 Fred Kiefer * Source/NSScrollView.m Implemented [setRulerViewClass:] and preset to NSRulerView. Cache the scrollerWidth in a class var, use this in all methods. Use _sizeForBorderType() from NSCell to determine the border size in all methods that handle borderType. Replaced all uses of AUTORELEASE with explicit RELEASE calls. In [setContentView:] don't RETAIN the content view, as this is handled by the normal subview mechanism. (Don't RELEASE it in [dealloc] and [removeSubview:]) Added dummy method [scrollWheel:]. Implemented the ruler methods, but this are still not handled in [tile] and [drawRect:]. * Header/gnustep/gui/NSScroller.h Added some MacOSX methods. * Source/NSScroller.m Dummy implementation for those methods. Thu Oct 18 16:21:37 2001 Nicola Pero * Source/NSClipView.m ([-dealloc]): Remove us from observing the document view notifications. (Suggestion by Ludovic Marcotte ) * Source/NSTextContainer.m ([-dealloc]): Remove us from observing the text view notifications. (Suggestion by Ludovic Marcotte ) 2001-10-17 Adam Fedor * Source/NSMenuItemCell.m (calcSize): Set size to 0 if image does not exist. Wed Oct 17 04:30:25 2001 Nicola Pero * Source/NSTabView.m ([NSTabView -dealloc]): Do not release the selected tab view item (Patch by Ludovic Marcotte ). Wed Oct 17 18:18:54 2001 Nicola Pero * Source/NSTableView.m ([-setDataSource:]): Do not release the old data source; do not retain the new one. ([-dealloc]): Do not release the data source. (Suggested by Ludovic Marcotte ) * Source/NSTableView.m ([-initWithCoder:]): Do not retain the data source when decoding it. 2001-10-16 Adam Fedor * GNUmakefile.postamble (before-install): Remove extra / * TextConverters/RTF/GNUmakefile: Add BUNDLE_LIBS on mingw32/cygwin (bug report from stephen@brandonitconsulting.co.uk). * Source/NSMenuItemCell.m (calcSize): Check that images exist before asking for their size (assigning structs from nil objects crashes Solaris). * Make sure classes are linked in when shared=no * Source/linking.m: New file. * Source/extern.m (__objc_gui_force_linking): Linking function. 2001-10-16 Pierre-Yves Rivaille * Source/NSTableView.m ([selectColumn:byExtendingSelection]): Do not send NSTableViewSelectionDidChangeNotification when selection is not changed (was not always working with flag=NO) * Source/NSTableView.m ([selectRow:byExtendingSelection]): Likewise 2001-10-15 Adam Fedor * Headers/gnustep/gui/DPSOperators.h: New functions DPSPrintf, DPSWriteData * Headers/gnustep/gui/GSMethodTable.h: Likewise. * Headers/gnustep/gui/NSGraphicsContext.h: Likewise. * Source/NSGraphicsContext.m: Implement. * Headers/gnustep/gui/NSPageLayout.h: Change some ivars. * Headers/gnustep/gui/NSPrintOperation.h: Add an ivar. * Headers/gnustep/gui/NSPrintPanel.h: Remove outlets, use tags instead. * Panels/GNUmakefile: Add GSPageLayout gorm files. * Source/NSPageLayout.m: Rewrite (set NSPrintInfo, use gorm files). * Source/NSPrintOperation.m (_print): Start of implementation. Use NSView to add PS headers, etc. * Source/NSPrintPanel.m: Rewrite using tags not outlets. Document. * Documentation/gsdoc/NSPrintPanel.gsdoc: Regenerate * Documentation/gsdoc/NSPageLayout.gsdoc: Likewise. * Model/GNUmakefile: Add OBJC_LIB to DEPENDS_UPON line. * Source/NSFontPanel.m (init): setBecomesKeyOnlyIfNeeded to YES. 2001-10-14 Fred Kiefer * Source/NSPopUpButtonCell.m Added methods [setAction:] and [setTarget:], which call the super implementation and also update the menu. Thu Oct 11 13:53:22 2001 Nicola Pero * Source/NSMatrix.m ([-setTarget:]): Do not retain the target (patch by Ludovic Marcotte ) * Source/NSMatrix.m ([-textShouldEndEditing:]): Access _target ivar directly. 2001-10-08 Adam Fedor * Source/NSPrintOperation (_runOperation): New internal method. (runOperation): Use it. (-runOperationModalForWindow:delegate:didRunSelector:contextInfo:): Implement. (-createContext): Use our context if already created. Set the path from the NSPrintInfo object if available. * Source/NSPrintPanel.m (beginSheetWithPrintInfo:modalForWindow:delegate:didEndSelector: contextInfo:): Implement. Remove coding methods. Mon Oct 8 14:50:44 2001 Nicola Pero * Tools/wgetopt.h: New file copied from base/Testing/wgetopt.h. * Tools/example.m: Include wgetopt.h. * Tools/gpbs.m: Include wgetopt.h. Mon Oct 8 15:05:34 2001 Nicola Pero * Source/NSWindowController.m ([-setDocument:]): Set the window to be released when closed if document is non nil, and not to be if document is nil. ([-loadWindow]): Idem after loading the nib. ([-initWithWindow:]): Call setDocument: nil. * Source/NSWindowController.m ([-_windowWillClose:]): Do nothing if the window is not to be released when closed (suggestion by Ludovic Marcotte ). 2001-10-08 Fred Kiefer * Source/NSPopUpButtonCell.m [insertItemWithTitle:atIndex:] don't set the action and target for the item, so it will use the action from the popup button. 2001-10-08 Fred Kiefer * Headers/gnustep/gui/NSMenu.h Replace ivar _isBeholden_byPopup with _popUpButtonCell. Change method [_setOwnedByPopUp:] to take an NSPopUpButtonCell instead of a Bool. * Source/NSMenu.m Adopted to changes in header. In [update] check for popup buttons also the action of the popup itself, if there is non for the item. In [performActionForItemAtIndex:] if we are owned by a popup button, send this action, if the menu item does not have an action. * Source/NSPopUpButtonCell.m Changed all calls to [NSMenu _setOwnedByPopUp:] and added missing one in [setMenu:]. 2001-10-08 Fred Kiefer * Headers/gnustep/gui/NSScreen.h Added method [resetScreens]. * Source/NSScreen.m Removed function _screenNumbers. Moved class method to front. Use [screens] in method [mainScreen]. Cache screens in mehtod [screens]. Use the context from NSApp instead of the current context in all calls. In [deepestScreen] replace NSScreen by self. Added method [resetScreens]. 2001-10-06 Adam Fedor * Headers/gnustep/gui/NSPrintPanel.h: Define ivars. * Panels/GNUmakefile: add GSPrintPanel.gorm * Source/NSPrintPanel.m: Implement. * Source/NSPopUpButtonCell.m (initWithCoder:): Make menu owned by popup. * Source/NSPrintOperation.m (-initWithView:insideRect:toData:printInfo:): set showPanel to YES. * Source/NSView.m (displayRectIgnoringOpacity:): Move unlockFocus after drawing subviews (fix from georg@vhf.de). * Source/libgnustep-gui.def: Remove NSMenuWindow. * Model/GNUmakefile (libgmodel_BUNDLE_LIBS): New var. (fix suggested by stephen@brandonitconsulting.co.uk). 2001-10-06 Fred Kiefer * Header/gnustep/gui/NSCell.h Added enumerator NSControlSize. * Header/gnustep/gui/NSProgressIndicator.h Prefixed all ivars with an underscore and added ivars for indeterminate progress. Added some constant definitions and control size and tint methods. * Source/NSProgressIndicator.m Adopted to changes in header and added some code for displaying indeterminate progress. * Header/gnustep/gui/NSRulerMarker.h * Header/gnustep/gui/NSRulerView.h Added copyright notice and defined some ivars. * Source/NSRulerMarker.m * Source/NSRulerView.m Some basic implementation of these classes. * Source/GNUmakefile Compile NSRulerMarker and NSRulerView. * Source/NSAttributedString.m Protected all initXXX methods so that for empty input nil will be returned. Sat Oct 6 17:23:49 2001 Nicola Pero * Source/NSWindowController.m ([-initWithWindowNibName:owner:]): Raise and exception on nil nib name or on nil owner. ([-init]): Call initWithWindow: rather than initWithWindowNibName: because the latter can't accept a nil argument. ([-initWithWindow:]): Assign to self the result of [super init]. 2001-10-03 Adam Fedor * Headers/gnustep/gui/NSNibLoading.h: New GSCustomView class. * Source/NSBundleAdditions.m: Implement it. 2001-10-02 Adam Fedor * Source/NSWindow.m (-orderWindow:relativeTo:): setFrame: to the new constrained rect (if changed). 2001-09-28 Fred Kiefer * Header/gnustep/gui/NSPopupButton.h Removed all ivars and cleaned up the rest. * Source/NSPopupButton.m Removed the specific coding code. [mouseDown:] and [keyDown:] don't send notification, as this is done by the cell. Also don't send our action, as the action of the menu item is already send. Changed call order of [dismissPopUp] and [synchronizeTitleAndSelectedItem]. In [keyDown:] send item action via [NSMenu performActionForItemAtIndex:] * Header/gnustep/gui/NSPopupButtonCell.h Removed unneeded ivars. * Source/NSPopupButtonCell.m In [encodeWithCoder:] and [initWithCoder:] also encode the menu. * Testing Removed this directory. * Tools/Functions.m Removed this file. * Tools/GNUmakefile Removed references to Functions.m Wed Sep 26 23:04:57 2001 Nicola Pero * Source/NSFileWrapper.m ([-writeToFile:atomically:updateFilenames:]): Use only the last part of the path when saving it into the filename (patch by Ludovic Marcotte ). 2001-09-25 Adam Fedor * Source/NSView.m: Add viewIsPrinting "class" variable. (-lockFocusInRect:): Add special code when printing (-unlockFocusNeedsFlush:): Likewise. (-dataWithEPSInsideRect:): Set/reset viewIsPrinting. 2001-09-16 Georg Fleischmann * Source/NSPrintOperation.m [NSPrintOperation -destroyContext:]: remove context from the context list. Otherwise we will never get dealloced. [NSPrintOperation -_print:]: use displayRectIgnoringOpacity to avoid drawing of our ancestors. [GSEPSPrintOperation -createContext:]: create a context. [GSEPSPrintOperation -deliverResult:]: add contents of written file to data object. 2001-09-24 Fred Kiefer * Header/gnustep/gui/NSWindow.h Added three BOOL flags for subclasses. * Header/gnustep/gui/NSPanel.h Defined additional window masks. Removed all unneeded ivars and replaced the others by the superclass additional flags. * Source/NSPanel.m Implemented coding for NSPanel. For GSAlertPanel reoranised the initXXX code. Moved the GModel methods into a separate category, removing [createObjectForModelUnarchiver:] as this was (incorrectly) duplication code from the super class. Implemented NSBeginAlertSheet(), NSBeginCriticalAlertSheet() and NSBeginInformationalAlertSheet(). 2001-09-23 Fred Kiefer * Source/NSMenu.m [insertItem:atIndex:] set the menu of the item after the insert notification has been send. [initWithCoder:] send change notifications as one block. 2001-09-23 Fred Kiefer * Source/GSSimpleLayoutManager.m [GSSimpleLayoutManager boundingRectForGlyphRange:inTextContainer:]: Use lineFragmentRect instead of usedRect, so that the full line gets cleared. This still is not correct for all cases. * Header/gnustep/gui/NSPageLayout.h Removed ivar _new added ivar _accessoryView. Added sheet method. * Source/NSPageLayout.m Small layout improvements. * Tools/.cvsignore Ignore all services. * Model/.cvsignore Ignore the bundle * TextConverter/RTF/.cvsignore New file to ingore all temporary files. 2001-09-20 Fred Kiefer * Source/NSMenu.m [initWithCoder:] make sure the supermenu of a submenu is nil before adding it to an item. This resolves drag problem for "format" menu in Gorm. Mon Sep 17 11:17:46 2001 Nicola Pero * Documentation/gnustep-gui.texi (Keyboard Modifiers): Updated for the change in xgps/xdps, where we now use Mode_switch as default for ALTERNATE if Alt_R is not on the keyboard. 2001-09-17 Fred Kiefer * Header/gnustep/gui/NSApplication.h Added some new MacOSX methods. * Source/NSApplication.m Dummy implementation for [hideOtherApplications:] and [unhideAllApplications:]. Simple implementation for [runModalForWindow:relativeToWindow:], [endSheet:] and [beginSheet:...]. Removed various uneeded [update] and [sizeToFit] calls for menu operations. * Header/gnustep/gui/NSSavePanel.h Added some new MacOSX methods. Removed ivar _selfHasShowExtensionFilter. * Source/NSSavePanel.m Implemented [URL]. New methods [_setupForDirectory:file:] and [_shouldShowExtension:isDir:]. Removed check for extension filter in [init]. Simplified [runModalForDirectory:file:]. Implemented [runModalForDirectory:...relativeToWindow:] and [beginSheetForDirectory:...]. In [browser:createRowsForColumn:inMatrix:] allways call [_shouldShowExtension:isDir:]. * Header/gnustep/gui/NSOpenPanel.h Added some new MacOSX methods. * Source/NSOpenPanel.m Implemented [URLs]. New method [_setupForDirectory:file:]. Simplified [runModalForDirectory:file:types:]. Implemented [runModalForDirectory:...relativeToWindow:] and [beginSheetForDirectory:...]. Declare all needed private methods from NSSavePanel. * Header/gnustep/gui/NSAttributedString.h Added method [NSMutableAttributedString readFromURL:options:documentAttributes:]. * Source/NSAttributedString.m Implemented [readFromURL:options:documentAttributes:]. In [applyFontTraits:range:] use [NSFontManager convertFont:toHaveTrait:] instead of explicit font creation. 2001-09-16 Adam Fedor * Source/NSImage.m (-initByReferencingFile:): set archiveByName. * Source/NSPopUpButtonCell.m (-encodeWithCoder:): Implement (-initWithCoder:): Likewise. 2001-09-15 Fred Kiefer * Source/NSMenuItemCell.m Added [dealloc]. In [setMenuView:], if the menu belongs to a popup set the ivar _mcell_belongs_to_popupbutton. * Source/NSPopupButtonCell.m Removed additional method on NSMenuItemCell. Removed code in [insertItemWithTitle:atIndex:] to set the NSMenuItemCell to belong to a popup. Simplified [attachPopUpWithFrame:inView:] and [selectItem:] * Header/gnustep/gui/NSMenuView.h Removed [_setCellSize:]. * Source/NSMenuView.m Added [dealloc]. [setWindowFrameForAttachingToRect:...] now expects the screenRect to be the frame of the cell to attach to. Removed [_setCellSize:]. 2001-09-12 Fred Kiefer * Source/NSMenu.m Remove function title_height(), replaced calls to it with [NSMenuView menuBarHeight]. [setSubmenu:forItem:] moved code to [NSMenuItem setSubmenu]. [update] use _changedMessagesEnabled to prevent recursion. [sizeToFit] call [setNeedsDisplay:] instead of [display]. [locationForSubmenu:] moved code to [NSMenuView locationForSubmenu:]. Added [NSMenuWindowTitleView rightMouseDown:], so the main menu is not shown in a menu. * Source/NSMenuItem.m Call [NSMenu itemChange:] in all setXX methods. [setSubmenu:] set the title of the submenu to our title. * Header/gnustep/gui/NSMenuView.h Removed ivar meunv_menu and reuse _menu from NSResponder. Renamed all the ivars. * Source/NSMenuView.m Adopted to changes in header. [menuBarHeight] use code from title_height(). Added dummy [initAsTearOff]. Added a lot of code to support horizontal menus, still unfinished. [setHighlightedItemIndex:] don't display items only mark them as needing display. [locationForSubmenu:] moved code from NSMenu to here. [mouseDown:] simplified code. 2001-09-09 Michael Hanni * Source/Functions.m (NSDrawButton): rearrange the order of coloring to take into account the nature of NSDrawTiledRects; fixes visual irregularities (most noticeably in NSMenu). 2001-09-08 Michael Hanni * Source/NSBrowser.m (-matrixInColumn:): Return nil if caller requests column '-1'. Allows NSSave/OpenPanel to function. Hacky though, why are we requesting column '-1' anyways? 2001-09-06 Adam Fedor * Source/NSView.m (-lockFocusInRect:): Switch back to gsave/grestore syntax, use rectclip instead of rectviewclip. (-unlockFocusWithFlush:): Likewise. 2001-09-03 Adam Fedor * Source/tiff.m (NSTiffWrite): Set EXTRASAMPLES even if 0. 2001-09-02 Adam Fedor * Source/NSView.m (-lockFocusInRect:) Properly mark the save object. Do a rectviewclip in (sortof) the right place. 2001-08-31 Georg Fleischmann * Source/NSView.m [NSView lockFocusInRect:]: DPSsave(ctxt) added [NSView unlockFocusWithFlush:]: DPSrestore(ctxt) added * Headers/gnustep/gui/DPSOperators.h DPSrestore() and DPSsave(): new * Headers/gnustep/gui/GSMethodTable.h DPSrestore and DPSsave added * Headers/gnustep/gui/NSGraphicsContext.h -DPSrestore and -DPSsave added * Source/NSGraphicsContext.m [NSGraphicContext _inittializeMethodTable]: DPSrestore and DPSsave added [NSGraphicsContext DPSrestore]: new [NSGraphicsContext DPSsave]: new 2001-09-01 Adam Fedor * Source/NSImage.m ([NSImage -initWithCoder:]): Create _reps array before adding representations. * Source/tiff.m (NSTiffWrite): Archive alpha info. 2001-09-01 Fred Kiefer * Headers/gnustep/gui/NSMenuItemCell.h Removed ivars mcell_highlighted and mcell_has_submenu. Renamed all ivars. * Source/NSMenuItemCell.m Replaced use of mcell_highlighted with _cell.is_highlighted. Removed this ivar and mcell_has_submenu from the coding methods. Removed method [highlight:withFrame:inView:]. in [drawBorderAndBackgroundWithFrame:inView:] moved duplicated out of if clause. in [calcSize] use cached arrow image for submenu sizing and changed image size code. Change all composite operators from NSCompositeCopy to NSCompositeSourceOver. Use the cached colour if it is computed otherwise ignore it. In [drawWithFrame:inView:] allways call [drawBorderAndBackgroundWithFrame:inView:] and check for border there. Moved lockfocus calls down one level. In [drawInteriorWithFrame:inView:] removed some of the checks already done in [drawWithFrame:inView:]. Replaced all the highlight/state logic with the one used in NSButtonCell. 2001-08-31 Adam Fedor * Source/NSBitmapImageRep.m (-encodeWithCoder:): Encode data correctly. * Source/tiff.m (NSTiffWrite): Fix type, use ==. Fri Aug 31 12:06:24 2001 Nicola Pero * Source/GSSimpleLayoutManager.m ([_GNULineLayoutInfo -description]): Print the usedRect. 2001-08-30 Adam Fedor * Source/NSImage.m (-initWithCoder:): Fix encode typo. * Source/tiff.m (NSTiffWrite): Don't set JPEG quality if not doing JPEG compression Thu Aug 30 18:23:08 2001 Nicola Pero * Source/NSBitmapImageRep.m ([+canInitWithData:]): Do not call NSTiffClose if the image is NULL (Suggested by Ludovic Marcotte ). Thu Aug 30 10:30:22 2001 Nicola Pero * Source/NSTableColumn.m ([-dataCellForRow:]): Return [self dataCell], rather than nothing. 2001-08-28 Fred Kiefer * Source/NSMenu.m [insertItemWithTitle:...atIndex:] autorelease the return value. [mouseDown:] when we create the location directory, autorelease it. In [_locationKey] and [display] remove unneeded checks for popup. In [copyWithZone:] set the autoenable property before adding items. * Source/NSPopUpButtonCell.m In [insertItemWithTitle:atIndex:] use action and target from the cell for menu item. 2001-08-27 Fred Kiefer * Headers/gnustep/gui/NSMenuItem.h Changed includes. Defined new method [userKeyEquivalentModifierMask]. Removed all the methods definitions from NSMenuItem. Dropped the mi prefix of the ivars. Removed ivar for backend. * Source/NSMenuItem.m Adopted to changes in header. Implemented class for separator. Exchanged role of the methods [init] and [initWithTitle:...]. Simplified [setTitle:] and [setKeyEquivalent:]. Implemented [userKeyEquivalentModifierMask] and [setTitleWithMnemonic]. Reimplemented [copyWithZone:] to use NSCopyObject(). * Source/NSMenu.m Cache the notification center. Simplified all the item handling methods, e.g [insertItem:atIndex:], [insertItemWithTitle:...], [removeItemAtIndex:], [indexOfItemWithSubmenu:]. Implemented [setMenuRepresentation:], [isEqual:] and [copyWithZone:]. Wed Aug 22 10:16:42 2001 Nicola Pero * Source/NSTableView.m ([-_autosaveTableColumns]): Use "NSTableView Columns %@" rather than "Table Columns %@" as key in the user defaults to be consistent with NSWindow, which uses "NSWindow Frame %@". ([-_autoloadTableColumns]): Idem. 2001-08-22 Fred Kiefer * Headers/gnustep/gui/NSMenu.h Made method [_rightMouseDisplay:] public. * Headers/gnustep/gui/NSResponder.h Added method [scrollWheel:]. * Source/NSResponder.m Added dummy implementation of [scrollWheel:]. Moved menu display code in [rightMouseDown:] to NSApplication. * Source/NSApplication.m Implemented [rightMouseDown:] with code from NSResponder. * Source/NSWindow.m Cache the default notification center. In [sendEvent:] handle case of NSScrollWheel event. * Source/NSMenu.m Removed class NSMenuWindow, use aconfigured NSPanel instead. New method [_createWindow] to create this. Removed unused ivars of NSMenuWindowTitleView and renamed the methods. Corrected the create/retain logic of the button handling methods, the old code kept on creating buttons which where never released. [NSMenu _setTornOff:] now calls addCloseButton or releaseCloseButton. Replaced [NSMenuWindowTitleView titleHeight] with inline function title_height(). * Headers/gnustep/gui/NSTableView.h Check in of this file was forgotten. Tue Aug 21 19:38:00 2001 Nicola Pero * Headers/gnustep/gui/NSTableView.h: Added ivars for autosaving of table columns. * Source/NSTableView.m ([-autosaveName]): Implemented. ([-autosaveTableColumns]): Implemented. ([-setAutosaveName:]): Implemented. ([-setAutosaveTableColumns:]): Implemented. ([-_autoloadTableColumns]): New method. ([-_autosaveTableColumns]): New method. ([-moveColumn:toColumn:]): Invoke _autosaveTableColumns. ([-dealloc]): Release _autosaveName if needed. Remove self from observing notifications about column resizings. (Patches by Marko Mikulicic mostly rewritten) Tue Aug 21 18:28:39 2001 Nicola Pero * Source/NSTableView.m ([-moveColumn:toColumn:]): Use the cached notification center. 2001-08-21 Adam Fedor * Source/NSAttributedString.m (converter_bundles): New function to find bundles that do text conversion. (converter_class): Use it. * Source/GNUmakefile: Update to remove Parsers files * TextConverters/RTF/*: New files moved from Source/Parsers. Builds bundle for RTF text conversion. 2001-08-21 Pierre-Yves * Source/NSTableColumn.m * Headers/gnustep/gui/NSTableColumn.h added MOSX method [NSTableColumn -dataCellForRow:] * Source/NSTableView.m : various change to take [-dataCellForRow] into account, including [NSTableView -updateCell:] redefined, now only redraw the part of the table that uses the updated cell. * Source/NSTableView.m : redefinition of [-setFrame:]: it now calls [self sizeToFit] 2001-08-20 Pierre-Yves Rivaille * Source/NSStepper.m * Headers/gnustep/gui/NSStepper.h new NSStepper class, basic implementation * Source/NSStepperCell.m * Headers/gnustep/gui/NSStepperCell.h new NSStepperCell class, basic implementation * Source/GNUmakefile : NSStepper and NSStepperCell addition * Headers/gnustep/gui/AppKit.h : NSStepper.h and NSStepperCell.h addition 2001-08-20 Pierre-Yves Rivaille * Source/NSBrowser.m ([NSBrowser -_performLoadOfColumn:]): improved performance when loading previously unloaded column with a passive delegate * Source/NSMatrix.m ([NSMatrix -sizeToFit]): This method now assumes that all cells have the same size (this is what specification says). If it is not the case, weird behaviour can happen ... Performance is better when loading large matrices. 2001-08-19 Adam Fedor * Source/NSTextView.m (-setSelectedRange:affinity:stillSelecting:): Prevent NSTextView from asking a text storage of zero length for attributes (Patch from georg@vhf.de). 2001-08-20 Fred Kiefer * Headers/gnustep/gui/NSMenu.h Moved the declaration of NSMenuWindow and NSMenuWindowTitleView into the file NSMenu.m, making this private classes. Removed unused ivars and renamed the remaining ivars to fit the GNUstep sheme of underscore prefixes. Added new method [popUpContextMenu:withEvent:forView:]. Made the methods [_ownedByPopUp] and [_setOwnedByPopUp:] public. * Source/NSMenu.m Adopted to changes in the header file. * Source/NSMenuView.m In [setWindowFrameForAttachingToRect:...popUpSelectedItem:] replaced reference to NSMenuWindow with NSWindow. 2001-08-18 Fred Kiefer * Headers/gnustep/gui/GSTextConverter.h New file with two protocols for text converters. * Source/GNUmake Install GSTextConverter.h. * Source/NSAttributedString.m Include GSTextConverter.h. New function converter_class() to load the class for a given text converter format. Use this function in the RTF methods and use new protocol there. * Source/Parser/RTFProducer.h Renamed RTFProducer into RTFDProducer, with new subclass RTFProducer. Both implement the protocol GSTextProducer. * Source/Parser/RTFProducer.m Renamed methods to fit the GSTextProducer protocol. Adopted to changes in header. Implementation for RTFProducer. * Source/Parser/rtfConsumer.h RTFConsumer implements the protocol GSTextConsumer. New subclass RTFDConsumer. * Source/Parsers/attributedStringConsumer.m Renamed methods to fit the GSTextConsumer protocol. Adopted to changes in header. Perliminary implementation for RTFDConsumer. 2001-08-18 Fred Kiefer * Headers/gnustep/gui/NSInputServer.h Declaration of this class and of the protocols NSInputServerMouseTracker and NSInputServiceProvider. * Headers/gnustep/gui/NSInputManager.h Declaration of this class and of the protocol NSTextInput. * Source/NSInputServer.m Dummy implementation. * Source/NSInputManager.m Dummy implementation. * Source/GNUmake Install NSInputServer.h + NSInputManager.h and compile NSInputServer.m + NSInputManager.m. 2001-08-15 Fred Kiefer * Source/NSImageRep.m [initialize] removed obsolete check for default setting of ImageComposition. In [copyWithZone:] copy the colour space, it might be mutable. * Source/Functions.m NSEventMaskFromType() added case of NSScrollWheel. Impelemented missing NSShowSystemInfoPanel(). * Source/GSServicesManager.m Implemented missing NSUpdateDynamicServices(). 2001-08-13 Pierre-Yves Rivaille * Source/NSTableView.m * Source/NSTableHeaderView.m * Headers/gnustep/gui/NSTableHeaderView.h New implementation of column resizing. Implementation of column reordering. 2001-08-13 Pierre-Yves Rivaille * Source/NSSavePanel.m ([-runModalForDirectory:file:]) * Source/NSOpenPanel.m ([-runModalForDirectory:file:types:]) Moved functionality from NSOpenPanel to NSSavePanel: the "ok" button is shown as enabled or not at the beginning depending on whether the given file is valid. * Source/NSPopUpButton.m ([-keyDown:]): send selected item related action when using the keyboard. * Source/Functions.m Esthetic corrections to NSDrawGrayBezel and NSDrawWhiteBezel Sun Aug 12 05:46:32 2001 Nicola Pero * Source/NSBezierPath.m ([-appendBezierPathWithArcWithCenter:radius:startAngle:endAngle: clockwise:]): If the bezier path had already some elements, draw a line from the current point to the start point of the arc. (Patch from Georg Fleischmann). Sun Aug 12 04:25:20 2001 Nicola Pero * Source/NSTextView.m ([-replaceCharactersInRange:withString:]): If the textview supports rich text and the text storage is empty, use the attributes from the typing attributes when inserting the new string. Sun Aug 12 03:42:30 2001 Nicola Pero * Source/NSImage.m ([NSImage -setName:]): Fixed bug in last change - btw change not documented in ChangeLog - make sure we don't accidentally release self when removing it from the dictionary of names. That was crashing apps with an icon on startup. 2001-08-12 Fred Kiefer * Headers/gnustep/gui/NSImageCell.h Removed already inherited protocols. * Source/NSImageCell.m Removed [initImageCell:], [dealloc], [cellSizeForBounds:] and [copyWithZone:], which where only super calls. In [drawWithFrame:inView:] lockFocus only around drawing code and check for invalid window. In [drawInteriorWithFrame:inView:] lockFocus only around drawing code, check for invalid window, use NSCompositeSourceOver instead of NSCompositeCopy and show first responder state. Sat Aug 11 07:41:45 2001 Nicola Pero * Source/NSMatrix.m ([NSMatrix -getRow:column:forPoint:]): Fixed case of no rows or no columns in the matrix; return NO and set row and column to -1 if needed. Sat Aug 11 07:41:44 2001 Nicola Pero * Source/NSMatrix.m ([NSMatrix -getRow:column:forPoint:]): Consider points on the boundaries of cells to be inside cells. (Patch from Georg Fleischmann ). 2001-08-11 Fred Kiefer * Headers/gnustep/gui/NSImage.h Added declaration of [compositeToPoint:fromRect:operation:fraction:], [compositeToPoint:operation:fraction:], [drawAtPoint:fromRect:operation:fraction:] and [drawInRect:fromRect:operation:fraction:] * Source/NSImage.m Dummy implementation of new methods. [dissolveToPoint:fromRect:fraction:] Move the drawing rectangle to the origin of the image rep before the intersection of the two rects. [TIFFRepresentationUsingCompression:factor:] and [TIFFRepresentation] call method on NSBitmapImageRep. List explicit flag settings in [init]. Moved background drawing to [drawRepresentation:inRect:]. Restructured [_doImageCache] and [_cacheForRep:]. * Source/NSBitmapImageRep.m Implemented [TIFFRepresentationOfImageRepsInArray] and [TIFFRepresentationOfImageRepsInArray:usingCompression:factor:] Fri Aug 10 11:00:00 2001 Nicola Pero * Source/Parsers/attributedStringConsumer.m (GSRTFcolorbg): set color to white if index is out of bounds. Fri Aug 10 10:59:00 2001 Georg Fleischmann * Source/Parsers/attributedStringConsumer.m (GSRTFcolorfg): set color to black if index is out of bounds. Tue Aug 7 05:08:01 2001 Nicola Pero * Testing/GNUmakefile: Simplified, removed unused bloat, removed all references to the test applications which are no longer there. * Testing/GNUmakefile.postamble (after-distclean): Do nothing. * Testing/README: New file saying that this directory is obsolete. 2001-08-06 Fred Kiefer * Headers/gnustep/gui/NSApplication.h Removed [showHelp:] and [activateContextHelpMode:] as they are declared in NSHelpManager.h * Source/NSApplication.m Removed [showHelp:] and [activateContextHelpMode:] as they are implemented in NSHelpManager.m. Use [showHelp:] in old method []. * Source/NSHelpManager.m In [NSApplication showHelp:] added a check for the existence of the help file. * Headers/gnustep/gui/GSHelpManagerPanel.h Added Header, changed includes and removed [init] method. * Source/GSHelpManagerPanel.m Added Header, changed includes, small restructuring of [init] and removed [isFloatingPanel]. 2001-08-04 Fred Kiefer * Headers/gnustep/gui/NSGraphicsContext.h Added new class methods [currentContextDrawingToScreen], [graphicsContextWithAttributes:], [graphicsContextWithWindow:], [restoreGraphicsState], [saveGraphicsState], [setGraphicsState:] and new instance methods [attributes], [flushGraphics] and [graphicsPort]. * Source/NSGraphicsContext.m Dumy implementations for new class methods and implementations for new instance methods. * Headers/gnustep/gui/NSFormCell.h Delcare the methods [attributedTitle], [setAttributedTitle:] and [setTitleWithMnemonic:]. Removed methods already declared for super classes. * Source/NSFormCell.m Implemented the new methods and [titleWidth:]. In method [titleWidth] use [cellSize] to compute the width. In [drawWithFrame:inView:] lock focus only if there is something to draw. 2001-08-03 Gregory John Casamento * Panels/SpellPanel.gmodel Made changes to nextKeyView so that the user can tab between the buttons * Source/NSBrowser.m [NSBrowser keyDown:] added check after call to [NSBrowser selectedColumn] so that the rest of the method is skipped if the value is -1 (no column selected). This was producing a segmentation fault. * Source/NSTextView.m [NSTextView checkSpelling:] to call [NSSpellChecker checkSpellingOfString: startingAt:language:wrap: inSpellDocumentWithTag:wordCount:] so that the spell document tag can easily be passed in. * Source/NSSpellChecker.m modified calls [NSSpellChecker _findNext:], [NSSpellChecker _ignore:] & [NSSpellChecker _correct] to get the first responder from the mainWindow instead of getting the text view directly. This is consistent with behavior observed under OPENSTEP4.2 and allows the document being checked to be anywhere on the responder chain. 2001-08-02 Adam Fedor * Headers/gnustep/gui/NSApplication.h: Remove duplicate NSOpenStepRoorDirectory decl. * Headers/gnustep/gui/nsimage-tiff.h: Use TIFF defined types for variables. * Source/tiff.m: Likewise. * Model/GNUmakefile: Add -lobjc to ...LIBRARIES_DEPEND. * Tools/example.m: Don't use certain signals and fork on MINGW. 2001-08-01 Fred Kiefer * Headers/gnustep/gui/NSEvent.h Decalre to support copying. Added event type NSScrollWheel and mask NSScrollWheelMask. Declare methods mouseLocation and deltaX...deltaZ. * Source/NSEvent.m Added [copyWithZone:], [mouseLocation] and dummy implemntation of [deltaX], [deltaY] and [deltaZ]. * Headers/gnustep/gui/NSFontPanel.h Declare method [reloadDefaultFontFamilies]. * Source/NSFontPanel.m Implement [reloadDefaultFontFamilies] and use it in [init]. 2001-07-31 Fred Kiefer * Headers/gnustep/gui/NSDrawer.h New header file for NSDrawer class. * Headers/gnustep/gui/AppKit.h Include NSDrawer.h. * Source/NSDrawer.m Dummy implementation of NSDrawer class. * Source/externs.m Notification strings for NSDrawer. * Source/GNUmake Install NSDrawer.h and compile NSDrawer.m. 2001-07-31 Adam Fedor * Convert libgmodel to a bundle to remove the semi-recursive gui<->gmodel dependancy * gui.make.in (GUI_LIBS): Remove -lgmodel * Model/GNUmakefile: Compile libgmodel as a bundle. * Source/NSBundleAdditions.m (gmodel_class): New function. ([NSBundle +loadNibFile:externalNameTable:withZone:]): Use it. * Source/NSSpellChecker.m (-init): Use NSBundle method to find model file. 2001-07-30 Adam Fedor * Fixes to compile shared (DLL) on Windows. * GNUmakefile.postamble (header-links): Add rules for MingW target. * configure.in: Check for rint. * Source/GNUmakefile: Add dll def file. * Source/GNUmakefile.postamble: Rule to make dll def file. * Source/GNUmakefile.preamble: Add libobjc depend for Windows targets. * Headers/gnustep/gui/AppKitDefines.h: New file. * Headers/gnustep/gui/*: Change extern to APPKIT_EXPORT. * Headers/gnustep/gui/config.h.in: Regenerate using autoheader. * Source/NSAffineTransform.m: Use pi consistantly. * Source/NSBrowser.m: Define rint if we don't have it. 2001-07-30 Georg Fleischmann * gui/Source/NSWindow.m [NSWindow orderWindow:relativeTo:]: constrain added [NSWindow initWithContentRect:styleMask:backing:defer:screen:] and [NSWindow setFrame:]: constrain removed 2001-07-28 Fred Kiefer * Headers/gnustep/gui/NSUserInterfaceValidation.h New header file with protocols NSValidatedUserInterfaceItem and NSUserInterfaceValidations. * Headers/gnustep/gui/AppKit.h Include NSUserInterfaceValidation.h. * Source/GNUmake Install NSUserInterfaceValidation.h. * Headers/gnustep/gui/NSDocument.h Added declarations for new methods in specification. Some of this where already present in the code. * Source/NSDocument.m Added dummy implementation for the new delegate operations. Corrected [initWithContentsOfURL:ofType:], the alert was shown un success. Implemented [removeWindowController:] and [validateUserInterfaceItem:]. * Headers/gnustep/gui/NSDocumentController.h Added declarations for new methods in specification ([noteNewRecentDocument:], [validateUserInterfaceItem:], [closeAllDocumentsWithDelegate:didCloseAllSelector:contextInfo:], [reviewUnsavedDocumentsWithAlertTitle:...contextInfo:]). * Source/NSDocumentController.m Commented out unused static variables. Dummy implementation of new methods. In [openDocumentWithContentsOfFile:display:] call [noteNewRecentDocument:]. In [openDocumentWithContentsOfURL:display:] only call [noteNewRecentDocumentURL:] when document is not nil. Implemented [noteNewRecentDocument:]. 2001-07-27 Georg Fleischmann * gui/Source/NSWindow.m [NSWindow initWithContentRect:styleMask:backing:defer:screen:]: constrain frame rect to screen 2001-07-24 Gregory John Casamento * Source/NSSpellChecker.m cleaned up some of the NSLog statements which were producing debug output. Corrected the behavior of [NSSpellChecker _correct:], [NSSpellChecker _learn:], & [NSSpellChecker _forget:]. * Source/NSSpellServer.m removed debugging statements. [NSSpellServer _isWord:inDictionary:caseSensitive:] added logic to search ignoredword list. [NSSpellServer _findMisspelledWordInString:language: ignoredWords:wordCount:countOnly:] Added logic to allow access to the ignored word list maintained by the spell checker. * Tools/GSspell.m implemented a working spell checker which depends on the ispell spell checker. 2001-07-23 Fred Kiefer * Headers/gnustep/gui/NSCursor.h Prefixed ivars with underscore. Added missing method [initWithImage:foregroundColorHint:backgroundColorHint:hotSpot]. * Source/NSCursor.m Adopted to changes in header. Extracted new method [_computeCid] from [setImage]. Use [set] in [pop] and [push]. Implemented coding protocol. Cache the class and use it for standard cursor and in [pop]. 2001-07-23 Pierre-Yves Rivaille * Source/NSPopUpItemCell.m (-drawInteriorWithFrame:inView:): updates to have a cuter displaying of NSPopUpButton * Source/NSMenuItemCell.m (-imageRectForBounds:): idem (-drawBorderAndBackgroundWithFrame:inView:): idem (-drawInteriorWithFrame:inView:): idem 2001-07-23 Pierre-Yves Rivaille * Source/NSFontPanel.m (_initWithoutGModel): call setMinColumnWidth on familyBrowser and on faceBrowser (they were not displayed) 2001-07-23 Pierre-Yves Rivaille * Source/NSBrowser.h: Add instance variables to support alphanumerical keys. Add GNUstepExtensions category with alpahnumerical-key-related methods (acceptsAlphaNumericalKeys, setAcceptsAlphaNumericalKeys:, sendsActionOnAlphaNumericalKeys, setSendsActionOnAlphaNumericalKeys:) * Source/NSBrowser.m: Add GNUstepExtensions category methods (-initWIthFrame:): initialization of the alphanumerical-key-related instance variables. (-dealloc): TEST_RELEASE a keyDown internal object (-keyDown): support for alphanumerical keys (-selectRow:inColumn:): when calling [matrix cellAtRow:column:], column should be 0 (not column) Fri Jul 20 10:18:58 2001 Nicola Pero * Source/NSWindowController.m ([-initWithWindowNibName:owner:]): Use ASSIGN. ([-initWithWindow:]): Idem. Fri Jul 20 09:57:38 2001 Nicola Pero * Source/NSWindow.m ([-setWindowController:]): Do not RETAIN the window controller. Reported by Jonathan B. Leffert . 2001-07-19 Georg Fleischmann * gui/Source/GSSimpleLayoutManager.m [GSSimpleLayoutManager boundingRectForGlyphRange:inTextContainer:]: no inversion of rect.width (width - rect.size.width) 2001-07-17 Adam Fedor * Source/NSTableView.m (-addTableColumn:): Remove redundant mallocs. (-dealloc): Release backgroundColor. (-encodeWithCoder:): Implement. (-initWithCoder:): Likewise. * Source/NSTableColumn.m (-encodeWithCoder:): New method. (-initWithCoder:): Likewise. 2001-07-17 Pierre-Yves Rivaille * Source/NSPanel.m ([GSAlertPanel -initWithContentRect:styleMask:backing;defer:screen]): remove previous key view chain implementation. * Source/NSPanel.m ([GSAlertPanel -setTitle:message:def:alt:other]): new key view chain initialization code. Mon Jul 16 11:19:28 2001 Nicola Pero * Source/NSView.m ([-adjustPageHeightNew:top:bottom:limit:]): Restructured code to work around internal bug in 2.91.66 GCC compiler. ([-adjustPageWidthNew:left:right:limit:]): Idem. 2001-07-11 Adam Fedor * configure.in: Add PROG_CC check 2001-07-08 Adam Fedor * Merge from 0.7.0. Tue Jul 3 18:46:38 2001 Nicola Pero * Source/NSMenu.m ([NSMenuWindowTitleView -drawRect:]): Cache the title attributes used when drawing. * Source/NSPopUpButton.m ([-mouseDown:]): Trivial rearrangement to spare two method calls. Fri Jun 29 11:18:44 2001 Nicola Pero * Headers/gnustep/gui/AppKit.h: Include NSWindowController.h (suggested by Jonathan B. Leffert ). Mon Jun 25 11:47:50 2001 Gregory John Casamento * Panels/SpellPanel.gmodel changed value of hidesOnDeactivate to YES so that the spell panel will hide itself when the app is no longer selected. This is consistent w/ behavior under OPENSTEP. Mon Jun 25 10:55:03 2001 Nicola Pero * Headers/gnustep/gui/AppKit.h: Removed useless @class directives. Mon Jun 25 10:35:32 2001 Nicola Pero * Headers/gnustep/gui/GSVersion.h.in: New file. * Headers/gnustep/gui/AppKit.h: Include GSVersion.h. * configure.in (AC_OUTPUT): Added Headers/gnustep/gui/GSVersion.h. * configure: Regenerated. * Source/GNUmakefile (libgnustep-gui_HEADER_FILES): Added GSVersion.h Mon Jun 25 09:59:43 2001 Nicola Pero * Headers/gnustep/gui/AppKit.h: Do not include NSLayoutManager.h, NSTextContainer.h and NSTextStorage.h if STRICT_OPENSTEP is defined (suggested by Pascal Bourguignon ). 2001-06-23 Gregory John Casamento * Source/NSSpellChecker.m updated to use the guesses browser. Delegate methods implemented to fill in the guesses for the current misspelled word. 2001-06-20 Gregory John Casamento * Source/NSSpellChecker.m implementation * Source/NSSpellServer.m implementation * Tools/GSspell.m for the GSspell.service. * Panel/SpellPanel.gmodel also added for the spell checker gui. Sat Jun 16 15:19:29 2001 Nicola Pero * Source/NSCell.m ([-performClick:]): Call setNextState: also when we have no control view. Sat Jun 16 14:53:05 2001 Nicola Pero Patches by Pierre-Yves Rivaille . * Source/NSBrowser.m ([-keyDown:]): Added missing return - in the case that TAB was pressed. * Source/NSCell.m ([-performClick:]): Call setNextState:. * Source/NSFontPanel.m ([-_initWithoutGModel]): Use defer=YES when initializing the panel. Set up the next key view chain. Set the initial first responder to be the Set button. ([-fieldEditor:forObject:]): New method. * Source/NSPanel.m ([GSAlertPanel -initWithContentRect:styleMask:backing:defer:screen:]): Set up the next key view chain. 2001-07-08 Adam Fedor * Version: 0.7.0 2001-07-08 Mirko Viviani * Source/NSSavePanel.m ([NSSavePanel -ok:]): do browser click after resetting the text field. * Source/NSOpenPanel.m ([NSOpenPanel -ok:]): do not allow selecting a non existent file. * Source/GSSimpleLayoutManager.m ([GSSimpleLayoutManager -lineFragmentRectForGlyphAtIndex:effectiveRange:]): check for zero line layout. ([GSSimpleLayoutManager -locationForGlyphAtIndex:]): likewise. ([GSSimpleLayoutManager -boundingRectForGlyphRange:inTextContainer:]): likewise. ([GSSimpleLayoutManager -rectForCharacterIndex:]): likewise. ([GSSimpleLayoutManager -lineLayoutIndexForGlyphIndex:]): likewise. * configure.in: Fixed FreeBSD library path. 2001-07-03 Adam Fedor * Documentation/*: Update. * configure.in: Check for tiff and jpeg and zlib with tiff * config.make.in: Add ADDTIONAL_DEPENDS for libs * Source/GNUmakefile.preamble: Use it. 2001-07-05 Mirko Viviani * Source/NSComboBoxCell.m ([NSComboBoxCell -initTextCell:]): use -1 for selectedItem. ([NSComboBoxCell -deselectItemAtIndex:]): likewise. ([NSComboBoxCell -objectValueOfSelectedItem]): likewise. ([NSComboBoxCell -selectItemWithObjectValue:]): likewise. ([NSComboBoxCell -selectItemAtIndex:]): likewise. Post the notification only if the item change. * Source/NSTextView.m ([NSTextView -becomeKeyWindow]): make sure that the cursor is not displayed when the window become key. ([NSTextView -resignKeyWindow]): likewise. ([NSTextView -shouldDrawInsertionPoint]): check for key window. * Source/NSWindow.m ([NSWindow -setDefaultButtonCell:]): set modifier mask to 0. * Source/NSMatrix.m ([NSMatrix -_selectCell:atRow:column:]): scroll the cell to visible when the matrix is inside a scrollView. ([NSMatrix -textDidEndEditing:]): for NSReturn, call performKeyEquivalent: on the window to perform the action of default button. * Source/NSSavePanel.m ([NSSavePanel -selectText:]): remove unused code (selectCellWithString:): execute a full search. ([NSSavePanel -ok:]): fixed the value of the form cell after clicking with a selected cell. * Source/NSOpenPanel.m ([NSOpenPanel -controlTextDidChange:]): execute a full search. ([NSOpenPanel -ok:]): fixed the value of the form cell after clicking with a selected cell. * Source/NSBrowser.m ([NSBrowser -setPath:]): fixed to work with local path name. * Source/NSButton.m ([NSButton -becomeFirstResponder]): disable window key equivalent for default button cell. ([NSButton -resignFirstResponder]): likewise but enable. 2001-06-26 Adam Fedor * Source/NSMatrix.m (-updateCell:): Revert last change. 2001-06-20 Adam Fedor * Source/NSMatrix.m (-_selectCell:atRow:column:): Don't drawCell if we have no window yet (suggestion from jan.trembulak@ales.as) * Source/NSWindow.m (-dealloc): Free our backend only if we're not still defered. (-miniaturize:): Make sure we're not deferred. (-setDocumentEdited:): Set only if we're not deferred. 2001-06-18 Adam Fedor * Source/NSMatrix.m (-updateCell:): Call abortEditing. 2001-06-16 Fred Kiefer * Source/NSImage.m [compositeToPoint:fromRect:operation:] Move the drawing rectangle to the origin of the image rep before the intersection of the two rects. Now drag&drop in Gorm should display the DragView again. 2001-06-15 Adam Fedor * Version: snapshot release 0.6.9 2001-06-14 Mirko Viviani * Source/NSWindow.m ([NSWindow -setDefaultButtonCell:]): set button key equivalent to '\r'. * Source/NSBrowser.m ([NSBrowser -initWithFrame:]): removed debug. Patches from Pierre-Yves Rivaille * Source/NSPanel.m ([GSAlertPanel -initWithContentRect:styleMask: backing:defer:screen:]): set key view chain. * Source/NSCell.m ([NSCell -performClick:]): set next cell state. * Source/NSBrowser.m ([NSBrowser -keyDown:]): fixed tab selection. Wed Jun 13 02:36:44 2001 Nicola Pero * Source/NSBitmapImageRep.m ([+imageRepsWithData:]): Replaced [self class] with self. ([+imageUnfilteredFileTypes]): add extensions directly rather than using a temporary array. ([+imageRepsWithFile:]): As a temporary bug fix, evaluate extension manually: if it is `tiff' or `tif', use libtiff; otherwise, try backend code. 2001-06-11 Mirko Viviani * Source/NSSavePanel.m ([NSSavePanel -_initWithoutGModel]): do not set the max number of columns for the browser. * Source/NSBrowser.m ([NSBrowser -tile]): control column width and recalculate number of visible columns. ([NSBrowser -setMaxVisibleColumns:]): moved code in -tile. ([NSBrowser -displayAllColumns]): removed redundant methods. ([NSBrowser -initWithFrame:]): set _minColumnWidth to 100.0 ([NSBrowser -numberOfVisibleColumns]): fixed. Return the number or _visible_ columns. (not number of all loaded columns) ([NSBrowser -scrollColumnToVisible:]): use -numberOfVisibleColumns instead of _maxVisibleColumns that could be 0. ([NSBrowser -updateScroller]): likewise. ([NSBrowser -scrollViaScroller:]): likewise. ([NSBrowser -_unloadFromColumn:]): likewise. Removed all the fprintf() debug. Sun Jun 10 21:54:10 2001 Nicola Pero * Source/NSBrowser.m ([-_unloadFromColumn:]): Remove the column from the superview when we destroy it. ([-resizeSubviewsWithOldSize:]): Do not invoke super's implementation. Sun Jun 10 20:29:08 2001 Nicola Pero * Source/NSCell.m ([-cellAttribute:]), ([-setCellAttribute:to:]): Readded default label with the action that if debugging is enabled, we print out a message saying the the attribute requested is not supported. 2001-06-10 Fred Kiefer * Source/NSComboBox.m Added [setDelegate:] method. * Headers/gnustep/gui/NSComboBoxCell.h * Source/NSComboBoxCell.m * Source/GSComboSupport.h * Source/GSComboSupport.m Reformated, simplified and corrected many methods. Sat Jun 9 05:51:48 2001 Nicola Pero * Source/NSCell.m ([-cellAttribute:]), ([-setCellAttribute:to:]): Removed unused default label at the end of statement. Sat Jun 9 04:04:46 2001 Nicola Pero * gui.make: Moved to gui.make.in. * gui.make.in: New file with code from gui.make; (GNUSTEP_GUI_VERSION, GNUSTEP_GUI_MAJOR_VERSION), (GNUSTEP_GUI_MINOR_VERSION, GNUSTEP_GUI_SUBMINOR_VERSION): New variables set up at configure time. * configure.in: Source ./Version and substitute the new version variables; generate gui.make from gui.make.in. * configure: Regenerated. Sat Jun 9 02:54:37 2001 Nicola Pero * Source/NSTextView.m (NSTEXTVIEW_SYNC): Use full selector as argument to the macro to prevent warning/problems with new compilers. Updated all calling code. 2001-06-08 Fred Kiefer * Source/NSBitmapImageRep.m Moved code to create the _imageData into [initWithBitmapDataPlanes:...] and corrected [copyWithZone:] * Source/NSEPSImageRep.m Implemented canInitWithData:, imageUnfilteredFileTypes and imageUnfilteredPasteboardTypes. 2001-06-07 Fred Kiefer * Source/NSImageRep.m Corrected some methods on this class so that subclasses may use them. Moved all the class methods to the front of the file. * Source/NSBitmapImageRep.m Removed methods implemented by superclass. * Headers/gnustep/gui/NSEPSImageRep.h: * Source/NSEPSImageRep.m Added some basic implementation for this class. 2001-06-07 Fred Kiefer * Source/NSTextAttachment.m Removed the copyWithZone: method as this has been fixed on GSTextStorage. Changed NSLeftMouseUp to the correct NSLeftMouseDown. (Fix by Ludovic Marcotte , who is the fist user of NSTextAttachment) 2001-06-07 Richard Frith-Macdonald * Source/GSAttributedString.m: When caching attribute dictionaries we make an immutable copy of the dictionary with shallow copy. 2001-06-06 Adam Fedor * Source/NSBox.m ([NSBox -minimumSize]): New method. * Headers/gnustep/gui/NSBox.h: Declare it. 2001-06-06 Fred Kiefer * Source/NSTextAttachment.m Added copyWithZone: to NSTextAttachment to let it work as a attribute in a NSAttributedString. This may be just a temporary work around. * Source/NSStringDrawing.m Corrected drawing code for text attachments. Wed Jun 6 05:38:28 2001 Nicola Pero * Source/NSPopUpButtonCell.m ([-stringValue]): Added - this method was missing (problem found by Gregory Casamento). 2001-06-05 Fred Kiefer * Headers/AppKit/NSTextAttachment.h * Source/NSTextAttachment.m Added missing methods. * Source/NSStringDrawing.m Added drawing code for text attachments (Still untested, as there is a problem with unicode characters in NSAttributedString) * Source/NSTextView.m Implemented some basic handling for mouse down on attachment cell. 2001-06-02 Mirko Viviani * Source/NSMatrix.m ([NSMatrix -mouseDown:]): set highlight in list mode matrix. Use _selectCell: to select the cell. ([NSMatrix -_setState:highlight:startIndex:endIndex:]): fixed cell selection/display. Check for selectionByRect. ([NSMatrix -setSelectionFrom:to:anchor:highlight:]): removed code for selectionByRect. Set dotted outline and last selected cell. ([NSMatrix -_shiftModifier:]): implement shift selection. ([NSMatrix -_altModifier:]): implement alt selection. ([NSMatrix -keyDown:]): use _shiftSelection: and _altSelection to implement full keyboard selection. ([NSMatrix -_selectCell:atRow:column:]): redisplay previous dotted cell. Set cell highlight in list mode matrix. 2001-05-25 Adam Fedor * Source/NSApplication.m (initialize_gnustep_backend): Use runtime (NSBundle) to find backend if not BACKEND_BUNDLE. 2001-05-24 Adam Fedor * Source/NSApplication.m (initialize_gnustep_backend): Check if bundle loading actually worked. * Source/NSBundleAdditions.m ([NSApplication -_deactivateVisibleWindow:]): New method. ([GSNibContainer -awakeWithContext:]): Use it when app is not active. 2001-05-21 Fred Kiefer * Source/NSFont.m Cache all the fonts so we can returend a cached on if the same font is required twice, this makes some of the caching in xdps obsolte. 2001-05-19 Fred Kiefer * Headers/gnustep/gui/NSBezierPath.h * Source/NSBezierPath.m Added ivars and implementation for dashes. * Source/GSTextStorage.h * Source/GSTextStorage.m Extracted the interface definition into a separate file. * Source/NSStringDrawing.m Integrated patches from Frederic to seed up drawing. 2001-05-13 Fred Kiefer * Headers/gnustep/gui/NSPasteboard.h * Source/externs.m Added some missing pasteboard types. * Headers/gnustep/gui/NSView.h * Source/NSView.m Added missing methods from MacOS X specification. * Source/NSStringDrawing.m Corrected bug in setupChunk() that showed formats for the wrong range of characters. 2001-05-13 Mirko Viviani * configure.in: added /usr/local/include and /usr/local/lib for FreeBSD. Use ADDITIONAL_LIB_DIRS instead of ADDITIONAL_LD_FLAGS. * config.make.in (ADDITIONAL_LIB_DIRS): renamed. * config.guess: new file. * config.sub: new file. * install-sh: new file. * Source/NSSavePanel.m ([NSSavePanel -setDelegate:]): check for -panel: userEnteredFilename:confirmed: ([NSSavePanel -ok:]): call delegate method -panel:userEnteredFilename: confirmed: (MacOS X). Run an alert panel if the filename already exists ([NSSavePanel -browser:selectCellWithString:inColumn:]): removed keyboard handling. * Headers/gnustep/gui/NSSavePanel.h: added ivar. * Source/NSBrowserCell.m ([NSBrowserCell -highlightColorInView:]): return the highlight color of the cell. (Mac OS X) ([NSBrowserCell -drawInteriorWithFrame:inView:]): use highlight color from previous method. * Headers/gnustep/gui/NSBrowserCell.h: added method. * Source/NSMatrix.m ([NSMatrix -_mouseDownNonListMode:]): when tracking the mouse use cell's +prefersTrackingUntilMouseUp ([NSMatrix -_move:]): new private method. Fixed deselection of cells in NSRadioModeMatrix and NSListModeMatrix. ([NSMatrix -moveUp:]): use _move: to reduce maintance. ([NSMatrix -moveDown:]): likewise. ([NSMatrix -moveLeft:]): likewise. ([NSMatrix -moveRight:]): likewise. ([NSMatrix -getRow:column:ofCell:]): if cell does not exist set row and column to -1. ([NSMatrix -mouseDown:]): does not select and highlight a cell at the same time. Ensure that only a cell at a time has the dotted outile. * Source/NSBrowser.m ([NSBrowser -addColumn]): load a column and scroll if necessary. ([NSBrowser -doClick:]): rearranged for the new -addColumn ([NSBrowser -setPath:]): likewise and removed additional redisplay. ([NSBrowser -_createColumn]): method to create a new NSBrowserColumn. ([NSBrowser -setMaxVisibleColumns:]): use _createColumn ([NSBrowser -initWithFrame:]): likewise. ([NSBrowser -doClick:]): fixed selection problems. ([NSBrowser -selectRow:inColumn:]): fixed cell selection and perform load of column if cell is not a leaf. ([NSBrowser -loadColumnZero]): use -addColumn to load column zero. ([NSBrowser -setLastColumn:]): check for min value of column. ([NSBrowser -reloadColumn:]): check with _lastColumnLoaded instead in the column browser. ([NSBrowser -moveLeft:]): fixed an index out of bound exception when it was selected the first column. ([NSBrowser -moveRight:]): does nothing if multiple cells are selected or if the cell is a leaf. 2001-05-12 Fred Kiefer * Headers/gnustep/gui/NSFont.h * Source/NSFontManager.m Made [NSFont fontInfo] a public method to use it in the backend. * Headers/gnustep/gui/NSGraphicsContext.h * Source/NSGraphicsContext.m New methods to set and use a font. * Source/NSFont.m New implementation of [useFont] and [set] which call methods on the context. 2001-05-11 Adam Fedor * configure.in: Check for tiffio.h. Add path to include dirs * config.make.in: New file * Source/GNUmakefile: Include config.make 2001-05-07 Adam Fedor * Source/NSApplication.m (_NSAppKitUncaughtExceptionHandler): Abort when debug buttons is pressed (so gdb can do a bt). 2001-05-06 Adam Fedor * Source/NSBundleAdditions.m ([NSNibOutletConnector -establishConnection]): Test for non-NULL sel (patch suggested by Raphael Sebbe ). 2001-05-08 Fred Kiefer * Headers/gnustep/gui/NSTabViewItem.h * Source/NSTabViewItem.m Adopted to programming standard. In [drawLabel:inRect:] use string drawing method instead of PSshow(). * Source/NSMenu.m For NSMenuWindowTitleView [drawRect:] use string drawing method instead of PSshow(). 2001-05-05 Mirko Viviani * Source/NSSavePanel.m ([NSSavePanel -browser:createRowsForColumn: inMatrix:]): do not treat a file package a directory with an empty extension. * Source/NSMatrix.m ([NSMatrix -_mouseDownNonListMode:]): retain the currentEvent. Fix to prevent theEvent to become nil. Do not allow empty selection in NSRadioModeMatrix. 2001-05-05 Fred Kiefer * Headers/AppKit/GSMethodTable.h: * Headers/gnustep/gui/NSGraphics.h * Headers/gnustep/gui/NSGraphicsContext.h * Source/Functions.m * Source/NSGraphicsContext.m Made all the button, bezel and groove methods functions again. 2001-05-04 Richard Frith-Macdonald * Source/NSCursor.m: Corrected illegal use of reserved word (id) as method argument ... gcc-3 doesn't allow it. * Source/GSServicesManager.m: GSContactApplication() fix to return our own listener if contacting self. NSPerformService() commented, tidied, and fixed to cope with case where the service provider is this app. 2001-05-03 Adam Fedor * Model/GMArchiver.m: Add defs for RETAIN, etc when not defined (i.e. for OPENSTEP). * Model/IMLoading.m (-loadIMFile:...): Comment out when compiling nib2gmodel. * gnustep-gui.spec.in: Fix source location * gnustep-gui-debug.spec.in: Likewise. * Documentation/gsdoc/NSWindow.gsdoc: Docs for [de]miniaturize. 2001-05-01 Fred Kiefer * Headers/gnustep/gui/NSFont.h * Source/NSFont.m Added some methods for font size and one function for glyphs from the MacOS X specification. * Headers/gnustep/gui/NSGraphics.h * Source/Functions.m Added missing functions and some dummy implementations. * Headers/gnustep/gui/NSPanel.h * Source/NSPanel.m Added missing functions and some dummy implementations. 2001-04-30 Fred Kiefer * Source/NSGraphicsContext.m Implemented the button, bezel and groove drawing with NSDrawTiledRects. The old implemention is still here. It should be deleted later on. 2001-04-30 Fred Kiefer * Headers/gnustep/gui/GSMethodTable.h * Headers/gnustep/gui/NSGraphics.h Added GSWViewIsFlipped and changed GSWSetViewIsFlipped_. * Headers/gnustep/gui/NSGraphicsContext.h Use same interface for optimisation methods, as in the subclasses. * Source/Functions.m Moved the old text functions from backend to here. * Source/NSView.m Call GSWSetViewIsFlipped instead of GSWViewIsFlipped. * Source/NSGraphicsContext.m Moved implementation of drawing functions from xgps backend to here. Corrected some of them. 2001-04-28 Fred Kiefer * Source/NSColor.m: Undid last change as this is now obsolete after Richards changes in base. Wed Apr 25 22:31:34 2001 Nicola Pero * Source/NSTableView.m ([-noteNumberOfRowsChanged]): Added code which checks that the old range of selected rows is still valid - ie, it still falls inside the table - and if not, the code rearranges it to fit into the table. 2001-04-23 Mirko Viviani * Source/NSMatrix.m ([NSMatrix -_mouseDownNonListMode:]): does not performSelector is the mouse goes up in cell. 2001-04-22 Georg Fleischmann * gui/Source/GSTextStorage.m: ([GSTextStorage.m replaceCharactersInRange:withString:]) recalculate effective range after removing attributes. 2001-04-23 Fred Kiefer * Source/NSColor.m: [initialize] call [NSUserDefaults standardUserDefaults] as a workaround for the setlocal() problem. Otherwise colorFromString: will fail later on for the system colours. * Source/NSColorPanel.m: Added an [init] method, use this in [sharedColorPanel]. Replaced reference to GMModel, with more general call on NSBundle. (This is commented out, but some time in the futur we might use NIB files) * Source/NSFontPanel.m: Also replaced GMModel with NSBundle in [init]. 2001-04-22 Richard Frith-Macdonald * Source/NSColorList.m: ([_loadAvailableColorLists]) Fixed bug causing system color list to not be loaded ... was using == for NSString comparison where isEqual was needed. Also reformatted to conform to coding standards. * Source/NSColor.m: ([defaultsDidChange:]) Fixed to record plist defaults values as strings ... so colorFromString works to set system colors. 2001-04-18 Richard Frith-Macdonald * Source/GSServicesManager.m: Save the name of the port on which we register services, and use it when we are looking for a service to see if we can handle it ourself. Should make it possible for an application to provide services to itsself. Also tidied to use memory management macros. Wed Apr 18 00:14:33 2001 Nicola Pero * Model/IMConnectors.m: Use #import rather than #include. ([IMControlConnector -establishConnection]): Do not retain target when setting it directly. 2001-04-18 Georg Fleischmann * Model/IMConnectors.m ([IMOutletConnector -establishConnection:]): Do not retain destination when setting it directly. 2001-04-16 Adam Fedor * Source/NSWindow.m (-miniaturize:): Set visible flag to NO. 2001-04-16 Mirko Viviani * Source/NSButtonCell.m ([NSButtonCell -drawInteriorWithFrame: inView:]): fix mask if cell is highlighted and it isn't in off state. * Source/NSCell.m ([NSCell -trackMouse:inRect:ofView:untilMouseUp:]): set next cell state and send action after -stopTracking: * Source/NSBrowser.m ([NSBrowser -keyDown:]): does nothing for arrow up and down. ([NSBrowser -moveUp:]): removed. ([NSBrowser -moveDown:]): removed. ([NSBrowser -_performLoadOfColumn:]): fix matrix creation, enable matrix autoscroll. ([NSBrowser -_performLoadOfColumn:]): implemented reusesColumns. * Source/NSMatrix.m ([NSMatrix -keyDown:]): implemented keyboard navigation. ([NSMatrix -moveUp:]): likewise. ([NSMatrix -moveDown:]): likewise. ([NSMatrix -moveLeft:]): likewise. ([NSMatrix -moveRight:]): likewise. ([NSMatrix -performClick:]): implemented. ([NSMatrix -mouseDown:]): scroll rect only if autoscroll is enabled, do not hightlight a cell directly but use the matrix method. Now it handles only NSListModeMatrix mode to reduce complexity introduced by other modes. ([NSMatrix -_mouseDownNonListMode:]): fixed. ([NSMatrix -highlightCell:atRow:column:]): enable the cell dotted outline. ([NSMatrix -drawCellAtRow:column:]): likewise. ([NSMatrix -drawRect:]): removed drawing of dotted outline. Rewritten due to changes in -getRow:column:forPoint: ([NSMatrix -getRow:column:forPoint:]): set row and column to -1 if point is not inside a cell. ([NSMatrix -_selectCell:atRow:column:]): use mnemonic value for cell state, does not enable dotted outline and check for nil aCell. ([NSMatrix -selectTextAtRow:column:]): likewise. ([NSMatrix -_setState:highlight:startIndex:endIndex:]): use matrix highlightCell: method and mnemonic for cell state. ([NSMatrix -deselectAllCells]): likewise. ([NSMatrix -selectAll:]): likewise. ([NSMatrix -setSelectionFrom:to:anchor:highlight:]): likewise. ([NSMatrix -performKeyEquivalent:]): select next cell state. 2001-04-15 Adam Fedor * Source/NSView.m (_invalidateCoordinates): release the gstate. (-releaseGState): Don't reset _allocate_gstate flag. (modified patch from Georg Fleischmann ). * Documentation/gsdoc/NSView.gsdoc: Document gstate methods. 2001-04-14 Adam Fedor * Source/NSImage.m ([NSImage -compositeToPoint:fromRect:operation:]): intersect fromRect with image rect to get proper composite rect. 2001-03-27 Frederic De Jaeger * Tools/Functions.m: remove some dummy functions that are useless now. * Source/NSWindow.m: remove GSWraps.h * Source/NSView.m: idem * Source/NSScreen.m: removed declaration of GSWindowDepthForScreen and GSAvailableDepthsForScreen. include AppKit/NSView.h * Source/NSGraphicsContext.m ([NSGraphicsContext +_initializeMethodTable]): fill the gsMethodTable with the address of the new methods Dummy implementation of all the following functions : NSEraseRect NSHighlightRect NSRectClip NSRectClipList NSRectFill NSRectFillList NSRectFillListWithGrays NSDrawButton NSDrawGrayBezel NSDrawBezel NSDrawGroove NSDrawTiledRects NSDrawWhiteBezel NSDottedFrameRect NSFrameRect NSFrameRectWithWidth NSReadPixel NSCopyBitmapFromGState NSCopyBits NSDrawBitmap NSBeep GSWDefineAsUserObj GSWViewIsFlipped GSWindowDepthForScreen GSAvailableDepthsForScreen +initializeBackend * Source/NSApplication.m: (initialize_gnustep_backend): load the backend bundle if it is compiled with -DBACKEND_BUNDLE and initialize it. By defaults, only loads libgnustep-xgps, can be overrident with the GSBackend default. Only initialize the backend otherwise. * Source/GNUmakefile.preamble (ADDITIONAL_CPPFLAGS): add -DBACKEND_BUNDLE=1 in case we want the backend as a bundle. * Source/GNUmakefile (libgnustep-gui_HEADER_FILES): remove GSWraps.h, add GStype.h * Headers/AppKit/NSGraphicsContext.h: NSGraphicsContext(Ops) add some methods that implements some functions of NSGraphics. declare +initializeBackend. * Headers/AppKit/NSGraphics.h (NSEraseRect): Replace declaration of a bunch of backend dependant functions by inline definition of stubs that call the new method define in NSGraphicsContext.m. The call is done with a cached address of the method. * Headers/AppKit/GSWraps.h: removed. * Headers/AppKit/GSMethodTable.h: include AppKit/GStype.h, add method that correspond to functions that are define in AppKit/NSGraphics.h Thu Apr 12 15:09:34 2001 Nicola Pero * Model/GMArchiver.m ([GMUnarchiver -initForReadingWithPropertyList:]): Retain the namesToObjects dictionary ([GMUnarchiver -dealloc]): Implemented. Thu Apr 12 15:07:19 2001 Nicola Pero * Model/IMCustomObject.m: Replaced #import with #include. 2001-04-10 Fred Kiefer * Headers/gnustep/gui/NSComboBox.h * Headers/gnustep/gui/NSComboBoxCell.h * Source/NSComboBox.m * Source/NSComboBoxCell.m Added aditional methods for text completion * Source/externs.m Added notifiaction strings from NSComboBox.m * Source/NSComboBox.m * Source/NSTextField.m * Source/NSImageView.m Corrected the handling of the cellClass so that every subclass of NSControl, that uses a cell, has its own implementaion of [cellClass] and [setCellClass]. * Source/NSSlider.m [initWithFrame:] removed superflous [setCell:] call, as this gets done in the super implementation. Fri Apr 6 23:39:52 2001 Nicola Pero * Source/NSSavePanel.m (createRowsForColumn:): Use the public NSFileManager API to enumerate the contents of a directory, rather than using private internals methods of the GNUstep base library. 2001-03-26 Jonathan Gapen * Model/IMLoading.m: Find system library path with NSSearchPathForDirectoriesInDomains() instead of env vars. 2001-03-23 Mirko Viviani * Source/NSCell.m ([NSCell -drawInteriorWithFrame:inView:]): do not check if the control that owns the cell is the first responder. Thu Mar 22 22:13:16 2001 Nicola Pero * Tools/Functions.m (NSDottedFrameRect): Added empty implementation to make the Tools compile. 2001-03-22 Adam Fedor * Version: 0.6.8 2001-03-22 Mirko Viviani * Source/NSBrowser.m ([NSBrowser -_unloadFromColumn:]): fix index out of bound (patch by Enrico Sersale ) 2001-03-22 Mirko Viviani * Source/NSButtonCell.m ([NSButtonCell -setCellAttribute:to:]): implemented. ([NSButtonCell -cellAttribute:]): implemented. * Source/NSPopUpButton.m ([NSPopUpButton -keyDown:]): implemented keyboard selection. ([NSPopUpButton -resignFirstResponder]): implemented. ([NSPopUpButton -resignKeyWindow]): implemented. * Source/NSPopUpButtonCell.m ([NSPopUpButtonCell -drawInteriorWithFrame:inView:]): from -drawWithFrame:inView: * Source/NSButton.m ([NSButton -becomeFirstResponder]): set cell first responder. ([NSButton -resignFirstResponder]): likewise. ([NSButton -becomeKeyWindow]): likewise. ([NSButton -resignKeyWindow]): likewise. * Source/NSBrowserCell.m ([NSBrowserCell -drawInteriorWithFrame: inView:]): draw correct dotted box. * Source/NSBrowser.m ([NSBrowser -becomeFirstResponder]): make first responder the latest column. ([NSBrowser -acceptsFirstResponder]): accepts first responder status. ([NSBrowser -keyDown:]): handle tabs to select next/previous key view. ([NSBrowser -moveRight:]): make browser column the first responder. ([NSBrowser -moveUp:]): likewise. ([NSBrowser -moveDown:]): likewise. ([NSBrowser -moveLeft:]): likewise. ([NSBrowser -_unloadFromColumn:]): remove columns from superview and array. ([NSBrowser -_remapColumnSubviews:]): set the correct first responder. * Source/NSWindow.m ([NSWindow -sendEvent:]): retain/release first responder for keyUp/keyDown events. Discard NSLeftMouseDown for closed windows. ([NSWindow -dealloc]): release _originalResponder * Source/NSView.m ([NSView -removeSubview:]): remove next responder. * Source/NSCell.m ([NSCell -setUpFieldEditorAttributes:]): clear selected range. ([NSCell -editWithFrame:inView:editor:delegate:event:]): redisplay textObject after invoking mouseDown: ([NSCell -drawInteriorWithFrame:inView:]): draw dotted-line outline when first responder. ([NSCell -setCellAttribute:to:]): implemented. * Source/NSTextView.m ([NSTextView -moveUp:]): don't call _illegalMovement: for the text field editor. ([NSTextView -moveDown:]): likewise. ([NSTextView -moveLeft:]): likewise. ([NSTextView -moveRight:]): likewise. * Source/NSTextField.m ([NSTextField -textDidEndEditing:]): fixed return/tab/backtab text movement code. * Headers/gnustep/gui/NSGraphics.h: added NSDottedFrameRect prototype. * Headers/gnustep/gui/NSMatrix.h: added ivars for dotted frame rect. * Source/NSMatrix.m ([NSMatrix -selectCell:]): implemented. ([NSMatrix -_selectCell:atRow:column:]): new method. ([NSMatrix -selectCellAtRow:column:]): call _selectCell:atRow:column: ([NSMatrix -selectCellWithTag:]): likewise. ([NSMatrix -selectAll:]): Do not select disabled or editable cells. ([NSMatrix -textDidEndEditing:]): fixed return/tab/backtab text movement code. ([NSMatrix -_selectNextSelectableCellAfterRow:column:]): don't select disabled cells. ([NSMatrix -_selectPreviousSelectableCellBeforeRow:column:]): likewise. ([NSMatrix -_privateFrame:mode:numberOfRows:numberOfColumns:]): set dottedRow and dottedColumn. ([NSMatrix -insertRow:withCells:]): likewise. ([NSMatrix -removeColumn:]): likewise. ([NSMatrix -removeRow:]): likewise. ([NSMatrix -mouseDown:]): likewise and discard disabled cells. ([NSMatrix -drawRect:]): set shows cell first responder. ([NSMatrix -becomeFirstResponder]): draw dotted box for cell. ([NSMatrix -resignFirstResponder]): likewise. ([NSMatrix -becomeKeyWindow]): likewise. ([NSMatrix -resignKeyWindow]): likewise. ([NSMatrix -_setNeedsDisplayDottedCell]): likewise. ([NSMatrix -selectTextAtRow:column:]): set shows cell first responder. ([NSMatrix -setState:atRow:column:]): likewise. Deselect previous selected cell in radio mode. * Source/NSSavePanel.m (createRowsForColumn:): use _gsSavePanelCompare: and check extension against _requiredFileType and not "app", "bundle", etc. ([NSString -_gsSavePanelCompare:]): filename compare. ([NSSavePanel -_initWithoutGModel]): set key view for keyboard interaction. ([NSSavePanel -keyDown:]): removed. ([NSSavePanel -controlTextDidEndEditing:]): removed. * Source/NSOpenPanel.m ([NSOpenPanel -_shouldShowExtension:isDir:]): added isDir argument. 2001-03-21 Richard Frith-Macdonald * Source/NSColor.m: Change archiving/unarchiving of colors to avoid storing private subclasses in archive. Fixed bug in unarchiving that caused crashes when retrieving old archives. Tidied source a little to ret rid of some contraventions of coding standards (long lines etc). 2001-03-21 Fred Kiefer * Headers/gnustep/gui/NSColor.h Made NSColor an abstract class, without ivars. * Source/NSColor.m Define concret subclasses of NSColor and moved code into this subclasses. * Source/NSColorList.m Corrected two errors in [writeToFile:] introduced by the last changes. * Source/NSBezierPath.m [containsPoint:] corrected and simplified a bit, but this still needs a complete rework. 2001-03-19 Jonathan Gapen * Headers/gnustep/gui/NSPrinter.h: Prefix instance vars w/underscore. * Source/NSPrinter.m: Remove (the now) extraneous cString usage, and prefix instance vars with underscore. Sun Mar 18 15:58:43 2001 Nicola Pero * Tools/GNUmakefile (GNUSTEP_MAKE_SERVICES): Define it to tell gnustep-make to use the local make_services. Fri Mar 16 23:41:10 2001 Nicola Pero * GNUmakefile.postamble ($(INSTALL_ROOT_DIR)/$(GNUSTEP_MAKEFILES)/Additional): New target; create the directory. (before-install): Do not create the directory but depend on the new target. * Images/GNUmakefile.postamble: Idem for $(imagedir). * PrinterTypes/GNUmakefile.postamble: Idem for $(INSTALL_DIR). * GNUmakefile: Removed `-' in front of include of GNUmakefile.postamble. * Images/GNUmakefile: Idem. * Model/GNUmakefile: Idem. * Panels/GNUmakefile: Idem. * PrinterTypes/GNUmakefile: Idem. * Tools/GNUmakefile: Idem for preamble and postamble. * Panels/GNUmakefile: Moved all targets, rules to Panels/GNUmakefile.postamble. Removed $(prefix). * Panels/GNUmakefile.postamble: Rewritten, simplified all rules. * PrinterTypes/GNUmakefile.postamble (before-install): Merged loop to create directories with the one in after-install; only create the directories if they do not exist. (after-install): Merged code from before-install; do installation in a single shell jump rather than two. Standardized installation of header files: * Source/GNUmakefile: (libgnustep-gui_HEADER_FILES_INSTALL_DIR): Change it from / to /AppKit. (libgnustep-gui_HEADER_FILES): Removed the AppKit in front of all of them. (libgnustep-gui_HEADER_FILES_DIR): Changed to ../Headers/AppKit * Source/GNUmakefile.preamble (ADDITIONAL_INSTALL_DIRS): Removed. * Source/GNUmakefile.postamble: Do not create ./$(GNUSTEP_OBJ_DIR)/Parsers if it alread exists. * Source/GNUmakefile.preamble: Commented out all empty code. * Tools/GNUmakefile.preamble: Idem. * Tools/GNUmakefile.postamble: Idem. Tue Mar 13 20:37:34 2001 Nicola Pero * Source/GSFontInfo.m ([+encodingForRegistry:encoding:]): Updated encoding names for change in the base library; for example, use NSISOArabic rather than NSArabic. 2001-03-09 Gregory John Casamento * Model/GMAppKit.m NSClipView ([-encodeWithModelArchiver:] and [-initWithModelUnarchiver:]): Added checks to make sure that the object responds to drawsBackground/setDrawsBackground to prevent nib2gmodel from crashing when running on OPENSTEP4.2. NSSecureTextFieldCell - Added methods to support archiving and unarchiving this class. * Source/GMAppKit.h Added category for archiving/unarchiving of NSSecureTextFieldCell * Source/AppKit.h Added #include and added forward declarations for both NSSecureTextFieldCell and NSSecureTextField. Wed Mar 7 16:11:19 2001 Nicola Pero * Source/NSBezierPath.m ([-appendBezierPathWithArcWithCenter: radius:startAngle:endAngle:clockwise:]): Rewritten and fixed the way angles are managed - should be consistent with postscript now (patch by Georg Fleischmann with little change of mine). 2001-03-05 Adam Fedor * Source/tiff.m (NSTiffError): Fix declaration. (NSTiffWarning, NSTiffHandleRead, NSTiffHandleWrite): Likewise. (Patch from Jeff Teunissen ). Thu Mar 1 04:15:53 2001 Nicola Pero * Source/NSBezierPath.m ([-appendBezierPathWithArcWithCenter: radius:startAngle:endAngle:clockwise:]): Little simplification in the computation of F. Thu Mar 1 04:10:54 2001 Georg Fleischmann * Source/NSBezierPath.m ([-appendBezierPathWithArcWithCenter: radius:startAngle:endAngle:clockwise:]): several fixes to make it work 2001-02-22 Adam Fedor * Documentation/news.texi: Update * Documentation/install.texi: Likewise. * INSTALL, NEWS, etc, regenerate. Wed Feb 21 11:30:48 2001 Nicola Pero * Headers/gnustep/gui/AppKit.h: Commented out extra token after the #endif directive. 2001-02-19 Fred Kiefer * Headers/gnustep/gui/NSDragging.h Corrected the values for NSDragOperation and all methods returning an operation mask. * Source/NSColorPanel.m [_initWithoutGModel] set target and action for the main colour well. 2001-02-19 Fred Kiefer * Source/NSWindow.m [_initBackendWindow:] corrected the registration of drag types, when a window gets realized. We have to use a copy here, as the original will get changed. 2001-02-18 Richard Frith-Macdonald * Source/NSColorWell.m: Tidied a little, and made changes to conform to macOS-X documentation and observed NeXTstep behavior. Of note - 1. colorwell should not deactivate when panel is closed. 2. setting color of an active well should set the color of the panel (though it should not raise it). * Source/NSColorPanel.m: Minor tidy. * Images/common_ColorSwatch.tiff: Updated to same size as NeXTstep color swatch. Sun Feb 18 13:35:55 2001 Nicola Pero * Source/NSClipView.m ([-setBoundsOrigin:]): Make rect to copy integral before copying. Sat Feb 17 19:07:33 2001 Nicola Pero * Source/NSClipView.m ([-acceptsFirstResponder]): Call the documentview's acceptsFirstResponder. ([-becomeFirstResponder]): Fixed. 2001-02-14 Fred Kiefer * Source/NSColorWell.m: Added methods to handle target and action. * Headers/gnustep/gui/NSColorWell.h: Added ivars for action and target. 2001-02-13 Adam Fedor * Version: 0.6.7 2001-02-11 Adam Fedor * Source/NSApplication.m ([NSApplication -init]): Don't set our uncaught exception handler until after the back-end is initialized (at least). 2001-02-09 Richard Frith-Macdonald * Source/NSApplication.m: NSAppIconView modified to support the opening of any documents dropped on the appicon using DnD. Fri Feb 9 18:07:13 2001 Nicola Pero * Source/NSTableView.m ([-noteNumberOfRowsChanged]): Fix for nil superview on Solaris, where you can't assign 0 to structs (solution suggested by Adam Fedor). 2001-02-08 Richard Frith-Macdonald * Headers/gnustep/gui/NSWindow.h: Added a GNUstep specific window level for the desktop (to work in conjunction with Window Maker) and changed the deprectated dock window level to match the value in MacOS-X beta. Thu Feb 8 19:17:25 2001 Nicola Pero * Headers/gnustep/gui/AppKit.h: Include NSSecureTextField.h. 2001-02-08 Richard Frith-Macdonald * Source/NSWindow.m: Center title in miniwindow view. Wed Feb 7 21:44:41 2001 Nicola Pero * Source/NSBrowser.m ([-reloadColumn:]): Save the selected cells in the column, then restore them after reloading the column. Wed Feb 7 20:21:36 2001 Nicola Pero * Source/NSSplitView.m ([-_adjustSubviews]): New method so that we avoid posting notifications if the delegate is doing the resizing. ([-adjustSubviews]): Do not post notifications so it can be called by the delegate method. ([-resizeWithOldSuperviewSize:]): Call _adjustSubviews: rather than adjustSubviews:. * Headers/gnustep/gui/NSSplitView.h (_never_displayed_before): New ivar. * Source/NSSplitView.m ([-initWithFrame:]): Set _never_displayed_before to YES. ([-displayRectIgnoringOpacity:]), ([-displayIfNeededInRectIgnoringOpacity:]): New methods. Adjust subviews the first time ever the split view is displayed. ([-addSubview:positioned:relativeTo:]), ([-addSubview:]): Removed. * Source/NSFontPanel.m ([-_initWithoutGModel]): Removed hack to set sizes of splitview's subviews right - no longer needed. 2001-02-07 Richard Frith-Macdonald * Source/NSWindow.m: Modified miniwindow view drawing to make titles in miniwindows look like NeXT ones. 2001-02-06 Richard Frith-Macdonald * Source/NSMenuView.m: ([-mouseDown:]) modified code for checking and repositioning of window to cope with situation where the window changes its size as a result of the mouse down action. 2001-02-04 Fred Kiefer * Source/NSColor.m In [supportMaxColorSpaces] added conversions from RGB to CMYK. In [colorUsingColorSpaceName:device:] added conversion from named colour. * Source/NSColorPanel.m Reimplemented without using a GModel file. * Headers/gnustep/gui/NSColor.h: Removed the color panel enumerators. * Headers/gnustep/gui/NSColorPanel.h: Added the color panel enumerators and corrected them. Adopted the ivars to the new implementation. Fri Feb 2 21:16:32 2001 Nicola Pero * Source/NSTableView.m ([-selectRow:byExtendingSelection:]): Fixed selecting the only row in a single row table (patch by Pierre-Yves Rivaille modified). * Source/NSTableView.m ([-selectColumn:byExtendingSelection:]): The same for columns. 2001-01-30 Adam Fedor * Tools/GNUmakefile: Don't make gbps since it conflicts with gpbs in the backend. * gnustep-gui.spec.in: Add requires gnustep-base 2001-01-29 Adam Fedor * Source/NSPrintOperation.m ([NSPrintOperation -runOperation]): Reset the locale to POSIX so numbers get printed correctly. Mon Jan 29 20:49:57 2001 Nicola Pero * Source/NSSplitView.m ([-mouseDown:]): Post the NSSplitViewDidResizeSubviewsNotification and the NSSplitViewWillResizeSubviewsNotification as appropriate. Mon Jan 29 20:19:59 2001 Nicola Pero * Source/NSTableView.m ([-mouseDown:]): Unselect an already selected row only when shift is pressed. ([-columnAtPoint:]): Fix for point precisely on the first column boundary. (Patches by Pierre-Yves Rivaille ). Mon Jan 29 19:04:53 2001 Nicola Pero * GNUmakefile.postamble (after-install): Install gui.make in $(GNUSTEP_MAKEFILES)/Additional/gui.make. * gui.make: New file extracted from gnustep make package. * GNUmakefile: Include local gui.make. * Documentation/GNUmakefile: Idem. * Documentation/gsdoc/GNUmakefile: Idem. * Images/GNUmakefile: Idem. * Model/GNUmakefile: Idem. * Panels/GNUmakefile: Idem. * PrinterTypes/GNUmakefile: Idem. * Source/GNUmakefile: Idem. * Testing/GNUmakefile: Idem. * Tools/GNUmakefile: Idem. * Source/GNUmakefile (libgnustep-gui_HEADER_FILES_INSTALL_DIR): Dont' install into xxx/Headers/gnustep/AppKit/ but simply into xxx/Headers/AppKit. * Source/GNUmakefile.preamble (ADDITIONAL_INSTALL_DIRS): Create zzz/Headers/AppKit rather than zzz/Headers/gnustep/AppKit. * Model/GNUmakefile.postamble (after-distclean): Remove GNUmakefile.local. * Panels/GNUmakefile.postamble: Idem. * Source/GNUmakefile.postamble: Idem. * Testing/GNUmakefile.postamble: Idem. * Tools/GNUmakefile.postamble: Idem. Sun Jan 28 21:30:39 2001 Nicola Pero * Source/NSClipView.m ([-setFrame:]), ([-setFrameOrigin:]), ([-setFrameSize:]): Update bounds origin. Sun Jan 28 20:20:42 2001 Nicola Pero * Source/NSClipView.m ([-viewFrameChanged:]): Invoke reflectScrolledClipView: to update the scrollers. Sun Jan 28 16:53:16 2001 Nicola Pero * Source/NSView.m ([-mouse:inRect:]): Use NSMouseInRect. Sun Jan 28 16:15:05 2001 Nicola Pero * Headers/gnustep/gui/NSSplitView.h: Added delegate method splitView:constrainSplitPosition:ofSubviewAt:. * Source/NSSplitView.m ([-mouseDown:]): Implemented asking delegate for splitView:constrainSplitPosition:ofSubviewAt:. 2001-01-28 Jonathan Gapen * Source/GSServicesManager.m: Standardized finding GNUstep paths by using NSSearchPathForDirectoriesInDomains() * Source/NSColorList.m: Ditto. * Source/NSPrinter.m: Ditto. * Source/NSWorkspace.m: Ditto. Sun Jan 28 01:37:53 2001 Nicola Pero * Source/NSClipView.m ([-setDocumentView:]): Bug fix: recompute flipped flag and invalidate coordinates immediately after setting the new document view. * Source/NSBrowser.m ([-_adjustMatrixOfColumn:]): As a consequence, removed hack introduced with last change: no longer needed. Sat Jan 27 13:46:44 2001 Nicola Pero * Source/NSBrowser.m ([-_adjustMatrixOfColumn:]): Fixed position of matrix (from a patch by Wim Oudshoorn ). Sat Jan 27 11:56:33 2001 Nicola Pero * Source/NSApplication.m (_NSAppKitUncaughtExceptionHandler): When aborting, simply reraise the exception which gets then managed by the base library exception handler. Sat Jan 27 11:33:35 2001 Nicola Pero * Source/NSColorWell.m ([-acceptsFirstMouse:]): Added. 2001-01-27 Richard Frith-Macdonald * Tools/gpbs.m: Cope better with nil pasteboard owners. Fri Jan 26 22:36:21 2001 Nicola Pero * Source/NSBrowser.m (NSBR_VOFFSET): Changed from 3 to 2. ([-titleHeight]): Return 21. * Source/NSFontPanel.m (_setFloatValue): New function to avoid displaying .00000 for floats. ([-browser:selectRow:inColumn:]), ([-setPanelFont:isMultiple:]): Use it. ([-_initWithoutGModel]): Completely rewritten sizes; fixed autoresizing masks; use a GSBrowserTitleCell to draw the size column title; added trick to make splitview sizes right; set min size. ([-browser:titleOfColumn:]), ([-browser:numberOfRowsInColumn:]), ([-browser:selectRow:inColumn:]): Tiny speed up. ([splitView:constrainMinCoordinate:maxCoordinate:ofSubviewAt:]): New method. * Source/NSSplitView.m ([-initWithFrame:]): Set _autoresizes_subviews to NO. ([-isFlipped]): Return YES as per spec. ([-adjustSubviews]), ([-drawRect:]), ([-mouseDown:]): Updated for flipped coordinates. ([-drawDividerInRect:]): Fixed bug in drawing dimple with flipped coordinates. 2001-01-26 Richard Frith-Macdonald * Source/NSLayoutManager.m: when doing conversions between glyph and character indices, support the index immediately beyond the end of the glyphs/characters without raising an exception. 2001-01-22 Richard Frith-Macdonald * Source/NSLayoutManager.m: loads of glyph changes - added some implementation notes. Implemented gaps in the glyphs stream. I think all glyph methods are implemented now (probably). Really needs someone elses eye casting over it, to try to catch any obvious bugs. 2001-01-20 Fred Kiefer * Source/NSBezierPath.m Corrected some bugs. Opimized the concret subclass to use a GSIArray. Sun Jan 21 14:10:52 2001 Nicola Pero * Source/NSClipView.m ([-setBoundsOrigin:]): Rewritten/fixed scrolling so that it only copies from visible bits. Sat Jan 20 23:38:03 2001 Nicola Pero Patches by Alexander Malmberg , modified: * Source/NSMenu.m ([NSMenuWindowTitleView -titleHeight]): New method. ([NSMenu -initWithTitle:]): Use the new method to compute menu title height. ([NSMenu -sizeToFit]): Idem. * Source/NSMenuView.m ([+menuBarHeight]): Compute from the font height. ([-initWithFrame:]): Compute cellSize from the font size. 2001-01-20 Fred Kiefer * Headers/gnustep/gui/NSBezierPath.h Added missing methods and changed the ivars. * Source/NSBezierPath.m Almost complete rewrite. The abstract class implements now most of the methods leaving only 9 methods to the concrete class. (And the hit test should also go into the abstract class) Simplified and corrected most methods. * Source/NSAffineTransform.m [transformBezierPath:] autorelease the returned object. 2001-01-20 Richard Frith-Macdonald * Source/NSLayoutManager.m: Reorganize and tidy up glyph code in preparation for handling gaps in the glyh stream. Fri Jan 19 17:22:24 2001 Nicola Pero * GNUmakefile: Added RPM_DISABLE_RELOCATABLE and PACKAGE_NEEDS_CONFIGURE. * gnustep-gui.spec.in, gnustep-gui-debug.spec.in: New files. * gnustep-gui.spec: Removed. Wed Jan 17 19:51:57 2001 Nicola Pero * Source/NSTableHeaderView.m ([-mouseDown:]): Fixed bug in resizing (patch by Pierre-Yves Rivaille slightly modified). Tue Jan 16 12:01:28 2001 Nicola Pero * Source/NSApplication.m (_NSAppKitUncaughtExceptionHandler): Fixed logging exception when no graphics context exist. Tue Jan 16 11:54:30 2001 Nicola Pero * Source/NSAffineTransform.m ([-takeMatrixFromTransform:]): New method to get quickly the matrix from another transform. * Headers/gnustep/gui/NSAffineTransform.h: Added corresponding declaration. * Source/NSView.m ([-_rebuildCoordinates]): Use it to spare a couple of method calls per invocation. * Source/NSBrowser.m ([-pathToColumn:]): Bug fix - stop computing path as soon as a column with no selected cells in it is found. * Headers/gnustep/gui/NSClipView.h: Added ivar to cache whether we are opaque or not. * Source/NSClipView.m ([-isOpaque]): Returne cached info. ([-setDrawsBackground:]), ([-setBackgroundColor:]): Update opaque cache info. * Source/NSClipView.m ([-setDocumentView:]): As a safety check, update _rFlags.flipped_view before setting the bounds. ([-setBoundsOrigin:]): Use [self documentVisibleRect] to get the document view area to be redrawn when redrawing everything. * Source/NSScrollView.m ([-tile]): Removed reflectScrolledClipView call in excess. * Source/NSView.m ([-_rebuildCoordinates]): Use _frame.height, not _bounds.height when flipping coordinates. * Source/NSView.m: Cache the default notification center for the whole class. * Source/NSView.m ([-resizeWithOldSuperviewSize:]): Bug fix - removed hackish code which manually attempted to `restore' bounds after setFrame: updated them. This fixes the rubbish drawn when resizing a textview inside a scrollview - a bug which escaped debugging attempts for more than one year I think. I am glad it's fixed now. Tue Jan 16 11:47:58 2001 Nicola Pero * Source/NSMenu.m ([NSMenuWindowTitleView -drawRect:]): Fixed bug - exposed rect being confused with bounds (patch by Malmberg ). 2001-01-15 Richard Frith-Macdonald * Headers/gnustep/gui/NSLayoutManager.h: New _endCharIndex ivar to keep track of last char converted to glyph. * Source/NSLayoutManager.m: More glyph handling code implemented. Sat Jan 13 22:16:45 2001 Nicola Pero * Source/GSSimpleLayoutManager.m ([-glyphIndexForPoint: inTextContainer:fractionOfDistanceThroughGlyph:]): Check that fraction pointer is non NULL before using it. * Source/GSSimpleLayoutManager.m ([-_charIndexForInsertionPointMovingFromY:bestX:up: textContainer:]): New method implemented. * Headers/gnustep/gui/NSLayoutManager.h: Added it. * Source/NSLayoutManger.m: Added it with void implementation. * Headers/gnustep/gui/NSTextView.h: New insertion point ivar which stores the insertion point rectangle. Ivar for stable cursor up/down changed to a float. * Source/NSTextView.m: Use everywhere the new ivar for the insertion point rect rather than computing it each time; use everywhere [_textStorage length] rather than [self textLength]. * Source/NSTextView.m ([-alignment]): Simplified for non rich text. * Source/NSTextView.m ([-updateInsertionPointStateAndRestartTimer:]): Implemented. ([-setSelectedRange:affinity:stillSelecting:]): Invoke [-updateInsertionPointStateAndRestartTimer:]. ([-insertText:insertString]), ([-deleteBackward:]), ([-deleteForward:]), ([-moveLeft:]), ([-moveRight:]): Removed code to remember position of cursor; now it is done automatically by [-updateInsertionPointStateAndRestartTimer:]. ([-moveDown:]), ([-moveUp:]): Fixed - rewritten to use the new private NSLayoutManager code. ([-rectForCharacterIndex:]), ([-rectForInsertionPointAtIndex:]): Removed. 2001-01-13 Richard Frith-Macdonald * Source/GSTextStorage.m: Fixed bug initialising from an empty attributed string, and fixed bug replacing characters in range, when an attribute range location is the same s the location of the replaced characters. Sat Jan 13 12:24:55 2001 Nicola Pero * Source/NSApplication.m (_NSAppKitUncaughtExceptionHandler): Attempt at making the meaning of the panel more clear for end users by adding the word `Error' to the message title. 2001-01-12 Fred Kiefer * Tools/Functions.m Undid last change and removed Function GSWSetMatrix(). Thu Jan 11 22:09:57 2001 Nicola Pero * Source/NSTextView.m ([-deleteBackward:]), ([-deleteForward:]): Completely rewritten. ([-deleteRange:backspace:]): Removed. ([-delete:]): wrap [-deleteForward:]. 2001-01-11 Richard Frith-Macdonald * Headers/gnustep/gui/NSLayoutManager.h: Remove some unused ivars. * Source/NSLayoutManager.m: Initial hacks for glyph management - should have no effect on execution so far. Wed Jan 10 21:19:23 2001 Nicola Pero * Source/NSApplication.m ([+initialize]): Save the default exception handler before setting a new one. (_NSAppKitUncaughtExceptionHandler): Reset the exception handler to the default exception handler during execution, to prevent very annoying recursive calls. Wed Jan 10 19:42:22 2001 Nicola Pero * Source/GSTextStorage.m ([-length]): Added for speed. * Source/GSTextStorage.m: Prefixed ivars with underscore. Tue Jan 9 11:24:32 2001 Nicola Pero * Tools/Functions.m: Include AppKit/DPSOperators.h so it compiles again. 2001-01-08 Richard Frith-Macdonald * Source/NSApplication.m: exception handler - check that graphics context exists and if it doesn't, simply log an error rather than trying to rujn an alert panel. 2001-01-08 Fred Kiefer * Source/NSColor.m In [supportMaxColorSpaces] corrected converions from RGB to HSB. * Source/NSFontPanel.m [_initWithoutGModel] make the size label non-selectable. * Headers/gnustep/gui/GSWraps.h: Removed function GSWSetMatrix(). 2001-01-08 Fred Kiefer * Headers/gnustep/gui/NSAffineTransform.h: * Source/NSAffineTransform.m Added new GS methods [concatenateWithMatrix:] and [deltaPointInMatrixSpace:] to avoid the creation of a new NSAffineTransform in the backend. * Source/NSScroller.m [setTarget:] don't retain target to avoid retain cycle in NSScrollView. [initWithCoder:] release target after decoding. * Source/NSColorWell.m In [dealloc] call [deactivate] for active colour wells. * Source/NSColorPanel.m Better interaction with the current colour picker. [setTarget:] don't retain target. In [sharedColorPanel] the picker mode is used only to create the panel, not each time the panel is shown. Show the alpha value multiplied by 100. * Source/NSPageLayout.m * Source/NSPrintOperation.m Small improvements. Sun Jan 7 03:28:14 2001 Nicola Pero * Source/GSSimpleLayoutManager.m ([-textStorage:edited:range:changeInLength:invalidatedRange:]), ([-invalidateLayoutForCharacterRange:isSoft:actualCharacterRange:]): Invoke [NSTextView -invalidateTextContainerOrigin]. * Source/NSLayoutManager.m ([-textContainerChangedTextView:]): Implemented. * Source/NSTextContainer.m ([-setTextView:]): Call [NSLayoutManager -textContainerChangedTextView:] if appropriate; do not remove frame change notifications for the old text view. * Source/NSTextView.m ([-initWithFrame:textContainer:]): Set min size to zero; do not modify existing text container flags; removed unused call to sizeToFit. ([-setHorizontallyResizable:]), ([-setVerticallyResizable:]): Removed most code. ([-setConstrainedFrameSize:]): Implemented. ([-sizeToFit]): Rewritten completely to use [-setConstrainedFrameSize:]. ([-setTextContainer:]): Do not set the text container size. ([-invalidateTextContainerOrigin]): Implemented. ([-setFieldEditor:]): Set non horizontally nor vertically resizable. 2001-01-03 Richard Frith-Macdonald * Source/NSFont.m: Minor optimisations - caching class and defaults. Copy font name rather than just retaining - to ensure that it's not a mutable string that gets changed. Ensure that fonts are encoded as the base class. * Source/NSTextView.m: ([-setTypingAttributes:]) update font panel and ruler ([-readSelectionFromPasteboard:type:]) update typing attributes. ([-updateFontPanel]) use font info from typing attributes. 2000-12-28 Fred Kiefer * Headers/gnustep/gui/NSButtonCell.h: Corrected definition of NSBezelStyle. * Source/NSButtonCell.m Simplified mask definition in [drawInteriorWithFrame:inView:] and [cellSize]. * Headers/gnustep/gui/NSColor.h: Prefixed all ivars with underscores, removed unneded ivars and added some missing methods and types. * Headers/gnustep/gui/NSColorPrivate.h: Removed * Source/GNUmakefile: Removed reference of NSColorPrivate.h * Source/externs.m Added notifiaction string from NSColor.m * Source/NSColor.m Added missing methods, restructured all the private methods, so there are no changing methods left. Made systemColorWithName() a function and optimized system color retrival. 2000-12-27 Richard Frith-Macdonald * Source/NSAttributedString.m: ([-doubleClickAtIndex:]), Fixed infinite loop. Added code to cope with double click on the space between words. * Source/GSSimpleLayoutManager.m: Implemented ([-glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:]) * Source/NSTextView.m: ([-selectionRangeForProposedRange:granularity]) Re-implemented word selection using ([-doubleClickAtIndex:]) ([-mouseDown:]) creatre proposed range for selection by merging old selection range with new location. Modified ([-characterIndexForPoint:]) to take into account where the character/glyph was clicked on. 2000-12-24 Fred Kiefer * Headers/gnustep/gui/NSButton.h: Added some missing methods. * Headers/gnustep/gui/NSButtonCell.h: Added some missing methods and some ivars. * Source/NSButton.m Delegate all the new methods to the cell. Replaced all calls to [display] with [setNeedsDisplay:] excuding those in [setState:] and [setNextState:]. Removed the initXXX methods, as they were doublicated code from super. * Source/NSButtonCell.m Dummy implementation for new methods. 2000-12-24 Fred Kiefer * Headers/gnustep/gui/NSImageRep.h: * Headers/gnustep/gui/NSBitmapImageRep.h: Added some missing methods. * Source/NSImage.m Implemented [initWithBitmapHandle:], [initWithIconHandle:] and [initWithContentsOfURL:]. [copyWithZone:] dont copy cached image reps. Allways use [self representations], so that the representation is loaded if needed. * Source/NSImageRep.m Implemented [imageRepWithContentsOfURL:] and [imageRepsWithContentsOfURL:]. In [imageRepsWithContentsOfFile:] get all possible reps. * Source/NSBitmapImageRep.m Dummy implementation for new methods. * Headers/gnustep/gui/NSControl.h: Added some missing methods. * Source/NSControl.m Implemented [refusesFirstResponder] and [setRefusesFirstResponder:]. Changed [setEnabled:], [setAlignment:], [setFont:] and all [setXXValue:] methods to conform to the spec. Removed the [copyWithZone:] method. * Headers/gnustep/gui/NSBox.h: Added some missing methods. * Source/NSBox.m Implemented [setTitleWithMnemonic:]. * Headers/gnustep/gui/NSApplication.h: Added ivar _default_context to store the graphic context used for events, which is not switched while printing. * Source/NSApplication.m Use the _default_context for all events and in dealloc. 2000-12-23 Fred Kiefer * Headers/gnustep/gui/NSImage.h: Prefixed all ivars with underscores, made fileName an ivar of NSImage and added some missing methods. * Headers/gnustep/gui/NSImageRep.h: * Headers/gnustep/gui/NSCachedImageRep.h: * Headers/gnustep/gui/NSBitmapImageRep.h: * Headers/gnustep/gui/NSCustomImageRep.h: Prefixed all ivars with underscores. * Source/NSImage.m Adopted to changes in header file. General cleanup. Removed obsolete backend declarations. Move ivar fileName from GSRepDate to NSImage, as it is used only once. This simplifies [_useFromFile:] and [_loadImageFilenames]. Implemented [compositeToPoint:fromRect:operation:] and [dissolveToPoint:fromRect:fraction:] by calling the corresponding function. Now the operator given to this methods is really used! * Source/NSImageRep.m * Source/NSCustomImageRep.m Adopted to changes in header file. * Source/NSCachedImageRep.m Adopted to changes in header file. Removed methods [drawAtPoint:] and [drawInRect:] so that the super implementation gets used. In method [initWithSize:depth:separate:alpha:] store alpha and bitspersample. * Source/NSBitmapImageRep.m Adopted to changes in header file. Moved code from [TIFFRepresentation] to [TIFFRepresentationUsingCompression:factor:] and call this. * Source/NSCell.m In [drawInteriorWithFrame:inView:] use NSCompositeSourceOver as the operator for imag composition not NSCompositeCopy. This replacement may be necessary in other parts of the GUI as well!!!! Sat Dec 23 15:43:24 2000 Nicola Pero * Source/NSTextView.m ([-setSelectedRange:affinity: stillSelecting:]): Rewritten setting typing attributes for insertion point. ([-updateFontPanel]): Rewritten case of insertion point. ([-alignment]), ([-insertText:insertString]): Access typing attributes to avoid copying the dictionary. 2000-12-23 Richard Frith-Macdonald * Source/NSAttributedString.m: ([-doubleClickAtIndex:]), ([-lineBreakBeforeIndex:withinRange:]), ([-nextWordFromIndex:forward:]) cope with apostrophes and hyphens within words. Fri Dec 22 21:40:58 2000 Nicola Pero * Headers/gnustep/gui/NSTextView.h: Added ivar to store the original selected range. * Source/NSTextView.m ([-initWithFrame:textContainer:]): Init original selected range. ([-setSelectedRange:affinity:stillSelecting:]): Rewritten, implemented delegate notifications etc. ([-mouseDown:]): Use setSelectedRange:affinity:stillSelecting: rather than setSelectedRange:, to produce delegate notifications etc. ([-setDelegate:]): Check if delegate reponds to textView:willChangeSelectionFromCharacterRange:toCharacterRange:. Fri Dec 22 20:05:13 2000 Nicola Pero * Source/NSTextView.m ([-setSelectedRange:]): Simply wrap [-setSelectedRange:affinity:stillSelecting:]; all code moved there. ([-mouseDown:]): Implemented shift click. Fri Dec 22 19:20:00 2000 Nicola Pero * Source/externs.m: Added NSOldSelectedCharacterRange. * Headers/gnustep/gui/NSTextView.h: Remove ivar for selection affinity; added ivar related to delegate. * Source/NSTextView.m ([-resignFirstResponder]): Rewritten deleting insertion point; do not flush the window. ([-drawRect:]): Don't flush the window when drawing insertion point. ([-drawInsertionPointInRect:color:turnedOn:]): Don't flush the window. ([-drawInsertionPointAtIndex:color:turnedOn:]): Removed. Code moved to the new method ([-rectForInsertionPointAtIndex:]). ([-selectionAffinity]): Return NSSelectionAffinityDownstream. Thu Dec 21 19:46:45 2000 Nicola Pero * Headers/gnustep/gui/NSWindow.h: New ivar _futureFirstResponder. * Source/NSWindow.m ([-makeFirstResponder:]): Set ivar _futureFirstResponder. ([-_futureFirstResponder]): New method. * Headers/gnustep/gui/NSLayoutManager.h: Added ivars for synchronization of textviews. Added ivar to mark when editing has began in the group of associated textviews. * Source/NSTextView.m: Use the synchronization ivars in the layout manager instead of the static ones used before. * Source/NSLayoutManager.m ([-addTextContainer:]), ([-insertTextContainer:atIndex:]), ([-removeTextContainerAtIndex:]): Set ivars for cache; call _updateMultipleTextViews for all our textviews. ([-layoutManagerOwnsFirstResponderInWindow:]): Implemented. * Source/NSTextView.m ([-_updateMultipleTextViews]), ([-setDelegate:]): Cache if delegate responds to shouldChangeTextInRange:replacementString:. ([-shouldChangeTextInRange:replacementString:]): Implemented. ([-resignFirstResponder]): Implemented check for multiple textviews using the new _futureFirstResponder: private API in NSWindow; clear editing flag. ([-becomeFirstResponder:]): Do not ask the delegate or post notifications. ([-mouseDown:]): No need to attempt to make us first responder - the window does it for us. * Source/NSCell.m ([-acceptsFirstResponder]): Access ivar refuses first responder. * Source/NSButton.m ([-acceptsFirstResponder]): Accept first responder iff we are enabled; key equivalents play no role here. Thu Dec 21 00:19:54 2000 Nicola Pero * Source/NSTextView.m ([-scrollRangeToVisible:]): Bug fix: use range argument, not selected range. * Source/NSTextView.m: Access some ivars directly. Wed Dec 20 19:39:21 2000 Nicola Pero * Source/NSText.m, Source/NSTextView.m: Most code from NSText was merged into NSTextView. * Source/NSText.h, Source/NSTextView.h: Moved many ivars from NSText to NSTextView. Wed Dec 20 15:23:22 2000 Nicola Pero * Source/NSText.m ([-setDelegate:]): Simplified. * Source/NSTextView.m ([-setDelegate:]), ([-_updateMultipleTextViews]): Set up NSText notifications too. Wed Dec 20 00:38:54 2000 Nicola Pero * Source/NSText.m ([-insertNewline:sender]): Do not call [+newlineString]. ([-didChangeText]), ([+newlineString]): Removed. ([-selectedRange]), ([-setSelectedRange:]): Moved to NSTextView.m; merged the two ([-setSelectedRange:]). Tue Dec 19 21:13:50 2000 Nicola Pero Committed first code for sharing attributes between NSTextViews with the same layout manager. Non tested yet - and not complete. * Headers/gnustep/gui/NSTextView.h: Added a flag to keep track of the case multiple text views. Added an ivar to cache the firstTextView object to use in notifications. * Source/NSTextView.m: ([-_updateMultipleTextViews]), ([-_syncTextViewsByCalling:withFlag:]): New methods. ([-replaceTextContainer:]), ([-setTextContainer:]): Call _updateMultipleTextViews:. ([-setEditable:]), ([-setRichText:]), ([-setImportsGraphics:]), ([-setSelectable:]), ([-setUsesFontPanel:]), ([-setFieldEditor:]), ([-setUsesRuler:]), ([-setRulerVisible:]): Rewritten to share attributes - if needed - with the other NSTextViews. ([-didChangeText]): Post the firstTextView as notif object if needed. ([-setDelegate:]): Rewritten completely to share the delegate if needed. * Source/NSTextView.m ([-string]): Moved from NSText.m. Tue Dec 19 17:53:35 2000 Nicola Pero * Headers/gnustep/gui/NSTextView.h: Moved some flags from NSText.h. * Source/NSTextView.m: Updated for the change in flag name. * Source/NSText.m ([-initWithCoder:]), ([-encodeWithCoder:]): Code for the flags moved to NSTextView.m. ([-initWithFrame:]), ([-textContainerInset]), ([-textContainerOrigin]), ([-textContainer]), ([-setTextContainer:]): Removed. ([-initWithFrame:textContainer:]): Code moved to NSTextView.m. * Source/NSTextView.m ([-backgroundColor]), ([-setBackgroundColor:]), ([-setDrawsBackground:]), ([-drawsBackground]), ([-isEditable]), ([-isSelectable]), ([-isFieldEditor]), ([-usesFontPanel]), ([-isRichText]), ([-importsGraphics]), ([-isRulerVisible]): Removed. Tue Dec 19 00:43:17 2000 Nicola Pero * Source/NSText.m: Made an abstract class always allocating instances of the NSTextView subclass. * Source/NSTextView.m ([-initWithFrame:]), ([-dealloc]), ([-initWithCoder:]), ([-buildUpTextNetwork:]), ([-replaceCharactersInRange:withString:]): Began to move code from superclass. 2000-11-18 Richard Frith-Macdonald * Source/GSTextStorage.m: ([-setAttributes:range:]) fix for the case where we set the same attributes in a range as already exist in a range that overlaps the start of the one we give. 2000-12-17 Georg Fleischmann * Source/NSView.m ([NSView -setFrameSize:]): scale bounds, if necessary * Source/NSView.m ([NSView -scaleUnitSquareSize:]): scale from bounds instead of frame (like OpenStep) Sun Dec 17 14:32:11 2000 Nicola Pero * Source/NSCell.m ([-_nonAutoreleasedTypingAttributes]): New method replacing ([-_typingAttributes]), to reduce the number of concurrent typing dictionaries allocated. ([-attributedStringValue]), ([-_sizeText:]), ([-_drawText:inFrame:]): Updated for the new method. Sat Dec 16 22:45:32 2000 Nicola Pero * Source/NSLayoutManager.m ([GSTextContainerLayoutInfo -dealloc]): Release the text container. ([NSLayoutManager -setTextStorage:]): Do not retain the text storage. * Source/NSTextContainer.m ([-dealloc]): Implemented. ([-setLayoutManager:]): Do not retain the layout manager. * Headers/gnustep/gui/NSText.h: Added flags owns_text_network and is_in_dealloc. * Source/NSText.m ([NSText -initWithFrame:]): Release self to break the retain cycle. ([NSText -dealloc]): Manage the very special case in which we own the text network. ([-encodeWithCoder:]): Do not encode the other text classes. ([-initWithCoder:]): Always build up the text network; added release self as in [-initWithFrame:]. ([-setTextContainer:]): Do not retain the text objects. ([-buildUpTextNetwork:]): Rewritten. * Source/NSTextView.m ([-replaceTextContainer:]): Do not retain the text container. 2000-12-16 Fred Kiefer * Headers/gnustep/gui/NSApplication.h: Prefixed all ivars with underscores, removed unneeded ivars and added some missing methods. * Source/NSApplication.m Adopted to changes in header file. [initialize] Cache the notification center and the NSAutoreleasePool class for the whole file. [finishLaunching] set the image before starting the icon view. Recognize file to open with flag @"NSOpen" beside @"GSFilePath". [dealloc] now also destoys the graphic context. [stop:] now stops the run loop, which may be restarted (but this will still reload the NIB file!). [setApplicationIconImage:] check if the _app_icon_window is there before setting its image. [orderFrontDataLinkPanel:] and [orderFrontHelpPanel:] moved the error message into the corresponding files. [terminate:] now directly stops the program with exit(0). Also did some general cleanup of code. * Source/NSDataLinkPanel.m * Source/NSHelpPanel.m Moved the "not implemented yet" Panel to the shared instance method of those two classes. Sat Dec 16 16:36:03 2000 Nicola Pero * Headers/gnustep/gui/NSCell.h: Modified ivars to reduce memory consumption. String attributes are now stored in a font ivar, three bits for alignment and wraps, and a bit to tell us if _contents is a simple string or an attributed string. Removed _typingAttributes. * Source/NSCell ([-initImageCell:]), ([-initTextCell:]), ([-dealloc]), ([-copyWithZone:]), ([-encodeWithCoder:]), ([-initWithCoder:]), ([-alignment]), ([-setAlignment:]), ([-font]), ([-setFont:]), ([-wraps]), ([-setWraps:]), ([-setUpFieldEditorAttribute:]): Updated for the new ivars. ([-doubleValue]), ([-intValue]), ([-floatValue]), ([-stringValue]), ([-mnemonic]), ([-cellSize]), ([-drawInteriorWithFrame:]), ([-editWithFrame:inView:editor:delegate:event]): Updated for the case when we keep an attributed string in _contents. ([-setObjectValue:]), ([-setStringValue:]), ([-setType:]): Set the _cell.contents_is_attributed_string flag. ([-setAttributedStringValue:]), ([-attributedStringValue]): Rewritten. ([-_typingAttributes]): Create from attributes stored in the cell. ([-_drawAttributedText:inFrame:]): New method. ([-_drawText:inFrame:]): Modified to avoid recomputing the dictionary. * Source/NSFormCell.m ([-cellSize]): Paranoia set of flag for attributed string to NO in tweaked case of computing size with no contents. * Source/NSCell.m ([-isEntryAcceptable:]): Call the formatter's [-getObjectValue:forString:errorDescription:] rather than [-isPartialStringValid:newEditingString:errorDescription:]. * Source/NSFormCell.m ([-copyWithZone:]): Implemented (from a suggestion by Georg Fleischmann). Fri Dec 15 21:40:49 2000 Nicola Pero * Headers/gnustep/gui/NSTextStorage.h: Prefixed all ivars with underscores. * Source/NSTextStorage.m: Updated for ivar name change. ([-processEditing]): Fixed invalidated range passed to NSLayoutManagers. Wed Dec 13 16:02:24 2000 Nicola Pero * Source/NSAttributedString.m: Optimizations: cache class pointers; replaced static functions wordBreakCSet (), wordCSet () and attachmentString () with static cached constants. ([-initWithPath:documentAttributes:]): Fixed little memory leak. Wed Dec 13 03:51:40 2000 Nicola Pero * Source/NSText.m ([-setAlignment:range:]): Fixed memory leak. Tue Dec 12 23:50:04 2000 Nicola Pero * Headers/gnustep/gui/NSParagraphStyle.h: Prefixed all ivars with underscores. * Source/NSParagraphStyle.m: Updated for ivar name change. Tue Dec 12 21:07:56 2000 Nicola Pero * Source/NSMenuItemCell.m ([-drawInteriorWithFrame:inView:]), ([-drawWithFrame:inView:]): Bug fix: do nothing in deferred windows. Tue Dec 12 19:18:08 2000 Nicola Pero * Source/NSButtonCell.m ([-copyWithZone:]): Do not deep-copy ivars, only retain them if not nil. * Source/NSCell.m ([-copyWithZone:]): Do not deep-copy ivars. * Source/NSTextFieldCell.m ([-copyWithZone:]): Do not deep-copy ivars. * Source/NSFormCell.m ([-initTextCell:]): Left align text. * Source/NSTextField.m ([-selectText:]): Bug fix for the recent change in [NSActionCell -stringValue]. * Source/NSMatrix.m ([-selectTextAtRow:column:]): Idem. 2000-12-07 Fred Kiefer * Headers/gnustep/gui/NSCell.h: Remove float formating ivars, as they were never used. * Headers/gnustep/gui/NSActionCell.h: Removed all methods, as they are defined for super class. * Headers/gnustep/gui/NSAffineTransform.h: Added NSCoding Protocol and moved extension methods into seperate interface. * Source/NSCell.m Moved the initialisation of the _typingAttributes from the init method to its first use. * Source/NSActionCell.m Remove initialisation and copy method, as this were mere super calls. Added getter methods with validation. * Source/NSAffineTransform.m Added coding methods. 2000-12-07 Fred Kiefer * Headers/gnustep/gui/NSCell.h: Added missing ivars and rearranged them all. * Headers/gnustep/gui/NSPopupButtonCell.h: Remove now unneeded ivar _menu. * Headers/gnustep/gui/NSImageCell.h: Moved typedefinitions to here from NSImageView.h * Headers/gnustep/gui/NSImageView.h: Removed type definitions. * Source/NSCell.m Implemented a load of missing methods and adopted all subclasses to this changes. (Including copying and coding) This breaks archived cells! * Source/NSActionCell.m * Source/NSBrowser.m * Source/NSBrowserCell.m * Source/NSButtonCell.m * Source/NSComboBoxCell.m * Source/NSFormCell.m * Source/NSImageCell.m * Source/NSMenuItemCell.m * Source/NSPopupButtonCell.m * Source/NSTableHeaderCell.m * Source/NSTextFieldCell.m Adopted to changes in NSCell. * Source/NSFont.m Made all predefined fonts redefinable and removed #ifdef. * Source/NSHelpManager.m [contextHelpForKey:] replaced nil by NULL to avoid compiler warning. * Source/NSParagraphStyle.m Removed super calls from coding methods to avoid compiler warning. Wed Dec 6 19:37:33 2000 Georg Fleischmann * Source/NSTabView.m ([NSTabView -drawRect:]): using aRect (bounds) instead of rect to draw Thu Nov 23 11:18:27 2000 Nicola Pero * Documentation/gsdoc/NSView.gsdoc: Documented drawRect:. * Documentation/gsdoc/NSView.html: Regenerated. Thu Nov 23 10:50:48 2000 Nicola Pero * Documentation/gsdoc/Introduction.gsdoc: Removed email tag which was causing gsdoc tool to abort. * Documentation/gsdoc/NSTableColumn.gsdoc: Added complete documentation about NSTableColumn. * Documentation/gsdoc/Introduction.html: Regenerated. * Documentation/gsdoc/NSTableColumn.html: Idem. Thu Nov 23 09:47:21 2000 Georg Fleischmann * Source/NSTabViewItem.m ([NSTabViewItem -setView:]): TEST_RELEASE() removed, since ASSIGN() manages retain/release. 2000-11-21 Fred Kiefer * Headers/gnustep/gui/NSPrintOperation.h: * Source/NSPrintOperation.m: Split up in three classes added primitiv printing in file * Source/NSPageLayout.m: Added more graphical elements, any functionality is still missing. * Source/GSInfoPanel.m: Use system fonts, not explicit names. Tue Nov 14 23:45:56 2000 Adam Fedor * Source/NSScrollView.m (reflectScrolledClipView:): Check for contentView before getting frame. 2000-11-13 Fred Kiefer * Headers/gnustep/gui/NSPrintInfo.h: Added NSCopying protocol. * Source/NSPrintInfo.m: Added method [copyWithZone:]. * Source/NSView.m: Implemented [print:], [fax:], [dataWithEPSInsideRect:] and [writeEPSInsideRect:toPasteboard:]. * Source/NSWindow.m: Implemented [print:], [fax:], [dataWithEPSInsideRect:]. * Headers/gnustep/gui/NSPrintOperation.h: Added ivars and PDF operations. * Source/NSPrintOperation.m: Started implementation of printing. 2000-11-13 Richard Frith-Macdonald * Source/GSTextStorage.m: partial rewrite to cache/unique dictionaries and to coalesce adjacent regions of string with the same attributes when setting attributes. 2000-11-12 Fred Kiefer * Headers/gnustep/gui/IMLoading.h: * Model/IMLoading.m: Removed NSBundle extension methods. * Source/NSApplication.m: [finishLaunching] removed uneeded call to loadGModel:owner: as this gets done in loadNibNamed:owner:. * Source/NSBundleAdditions.m: [loadNibNamed:owner:] removed unused local variable file. 2000-11-12 Fred Kiefer * Source/GSSimpleLayoutManager.m: Renamed the ivars of _GNULineLayoutInfo to correspond to those of GSLineLayoutInfo. Call a few more abstract methods. Added AutoreleasePool in [rebuildForRange:delta:inTextContainer:] to free up memory. Thu Nov 9 09:49:07 2000 Nicola Pero * Source/GSInfoPanel.m ([GSInfoPanel -initWithDictionary:]): Use Helvetica-Bold rather than Helvetica-BoldOblique for titles. 2000-11-06 Adam Fedor * Documentation: Move tmpl.texi files to texi and update GNUmakefile 2000-11-06 Fred Kiefer * Source/GSSimpleLayoutManager.m: Get the fragmentRect used for layout from the text container * Source/NSText.m: In [setVerticallyResizable:] and [setHorizontallyResizable:] set the size of the text conatainer. Mon Nov 6 17:02:27 2000 Nicola Pero * Documentation/GNUmakefile, Documentation/gsdoc/GNUmakefile: Install the documentation in the appropriate subdirectories of Documentation/Developers/Gui. 2000-11-05 Adam Fedor * Source/NSScreen.m (+mainScreen): Make the mainScreen a shared instance. * Source/NSClipView.m (-setBoundsOrigin:): If our documentView is focused, translate the PS context to the new bounds. 2000-11-05 Fred Kiefer * Headers/gnustep/gui/NSClipView.h: * Headers/gnustep/gui/NSScrollView.h: Added method to set backgound drawing. * Model/GMAppKit.m: Store new ivar for NSClipView * Source/NSScrollView.m: Hand on background drawing to content view. In [setContentView:] call setDocumentView:. * Source/NSClipView.m: Added dealloc method. Implemented [drawsBackground] and [setDrawsBackground:]. In [setDocumentView:] get the background drawing from the document view. [drawRect:] and [isOpaque] check the background drawing. Corrected [constrainScrollPoint:] to respect the documentFrame origin. Implemented [autoscroll:] * Source/NSTextContainer.m: In [setWidthTracksTextView:] and [setHeightTracksTextView:] make sure that the view post changes and that notifications are only send once. * Source/NSText.m: Moved all sizeToFit calls after text changes to the layout manager. * Source/GSSimpleLayoutManager.m: Call size to fit on view after layout changes. 2000-10-24 Fred Kiefer * Source/GSSimpleLayoutManager.m: Removed some 300 lines * Source/NSLayoutManager.m: Added simple glyph character mapping methods * Source/NSText.m: Set the TextConatainer to track its view again. But switch this of if the view is scrollable. 2000-10-31 Richard Frith-Macdonald * Source/GSServicesManager.m: Use new GSObjCClass() function from NSObjCRuntime.h * Source/GSTextStorage.m: Avoid static variable initialisation with @selector() as it doesn't work with Apple runtime. * Source/NSAttributedString.m: ditto * Source/NSMatrix.m: ditto * Source/NSStringDrawing.m: ditto * Source/NSView.m: ditto * Source/NSWindow.m: ditto 2000-10-24 Fred Kiefer * Source/GSSimpleLayoutManager.m: _GNULineLayoutInfo has new ivar usedRect. Simplified the code a bit. * Source/NSText.m: [buildUpTextNetwork:] The text container no longer tracks its view by default. [initWithFrame:textContainer:] the view is no longer resizable by default. * Source/NSTextContainer.m: [setContainerSize:] only informs layout manager if really changed. * Source/Parser/attributedStringConsumer.m Use NSASCIIStringEncoding instead of NSLatin1StringEncoding for RTF 2000-10-21 Michael Hanni * Source/NSTabView.m: ([-dealloc:]) updated. ([-removeTabViewItem:]) updated to not crash when a tabViewItem which had been the selected tab is dealloc'ed. * Source/NSTabViewItem.m: ([-dealloc:]) implemented. 2000-10-20 Richard Frith-Macdonald * Source/NSClipView.m: ([-viewFrameChanged:]) fix test for when to redraw entire area becaause document view is smaller than clipview. Suggested by benhur@inf.UFSM.br 2000-10-19 Michael Hanni * Source/NSTabView.m: a few bugfixes. * Source/NSTabViewItem.m: fixed a few memory leaks. 2000-10-17 Fred Kiefer * Headers/gnustep/gui/NSPageLayout.h: Added some ivars * Headers/gnustep/gui/NSPrintInfo.h: Prefixed ivar with underscore. * Source/NSPrintInfo.m: Change references to ivar info to _info. [initPrintInfoDefaults] now works if there is no PrinterAdmin resource. * Source/NSPageLayout.m: Some basic implementation * Source/NSApplication.m: [runPageLayout:] use real panel. 2000-10-15 Adam Fedor * Source/NSWindow.m (-orderWindow:relativeTo:): Set visible flag immediately. _didDeminiaturize: New method. (-sendEvent:): Handle GSAppKitWindowMiniaturize an GSAppKitWindowFocusIn events. 2000-10-12 Fred Kiefer * Source/Parser/attributedStringConsumer.m Improved the memory handling in diverse methods. Fri Oct 13 16:50:23 2000 Nicola Pero * Tools/GNUmakefile: Include GNUmakefile.local.service if present. Fri Oct 13 10:48:05 2000 Nicola Pero * Source/GSSimpleLayoutManager.m: Prefixed ivar lineLayoutInformation with underscore to keep the gui to compile. 2000-10-12 Fred Kiefer * Headers/gnustep/gui/NSLayoutManager.h: Added some missing methods and move comments to .m file. Other clean ups. * Headers/gnustep/gui/NSDocumentFrameworkPrivate.h: Removed unneeded method _removeDocument. * Source/NSDocument.m: In [close] use removeDocument instead of _removeDocument. [initWithContentsOfFile:ofType:] call [self init] instead of [super init]. * Source/NSDocumentController.m: Use explicit Private interface. * Source/NSLayoutManager.m: Added comments from .h file. Return a GSSimpleLayoutManager from [allocWithZone]. Removed all compiler warnings. * Source/NSText.m: Use NSLayoutManager instead of GSSimpleLayoutManager. * Source/NSStringDrawing.m: Started reorganising the code. Wed Oct 11 10:51:56 2000 Nicola Pero * Source/NSApplication.m ([-run]), ([-runModalSession:]): Reverted last changes in autorelease pool code. In particular, switched back to creating and releasing an autorelease pool at each loop for modal sessions. 2000-10-09 Richard Frith-Macdonald * Source/GSTextStorage.m: ([-setAttributes:range:]): Fixed obscure bug - use ASSIGNCOPY rather than ASSIGN to prevent mutable dictionaries being placed in attributed string. 2000-10-09 Fred Kiefer * Source/GSTextStorage.m: (_setup()): corrected a problem from the last change Removed obsolete super calls in GSTextInfo coding methods. * Source/NSAttributedString.m: Small correction in [fixParagraphStyleAttributeInRange] 2000-10-08 Richard Frith-Macdonald * Source/GSTextStorage.m: Removed some dependencies on private classes of base library. 2000-10-02 Fred Kiefer * Source/NSWindow.m: ([_initBackendWindow]): always redisplay _wv ([setFrame:display:]): set the frame of _wv directly if deferred. These changes make the save panel usable again. * Source/NSStringDrawing.m: Convert glyphs to font encoding in drawRun(). Removed unused code. 2000-10-01 Fred Kiefer * Header/gnustep/gui/NSText.h: Moved ivar _textContainer from NSTextView to here. * Header/gnustep/gui/NSTextView.h: Removed ivar _textContainer. Added some delegate messages. Two new NSTextView like methods for text container handling. * Source/NSText.m: Moved the text container handling from NSTextView to here and corrected it. * Source/NSTextView.m: Use text container implementation from super class. * Source/NSLayoutManager.m: Implemented [firstTextView]. * Source/GSSimpleLayoutManager.h: Removed additional method [setFirstTextView] * Source/GSSimpleLayoutManager.m: Switched to use the text container for size information. Implemented [textContainerChangedGeometry]. * Source/NSTextContainer.m: In [setTextView] let the text view send frame changed notifications. Check text view in [_textViewFrameChanged:]. Don't add observer if text view is nil in [setHeightTracksTextView:] and [setWidthTracksTextView:] * Source/NSView.m: In [display] check if the _visibleRect is still valid. 2000-09-28 Adam Fedor * Source/NSGraphicsContext.m (-_addDragTypes:toWindow:): Change to take window object, since window number may not exist for deferred win. (-_removeDragTypes:fromWindow:):Likewise. (-_dragTypesForWindow:): Likewise. * Source/NSView.m: Change calling of above methods. * Source/NSWindow.m (-_initBackendWindow:): Reset the drag types if the window was deferred. Also reset title, min/max size, etc. (-setTitle:): Set only if we have a windowNum (-setMinimumSize:): Likewise. (-setMaximumSize:): Likewise. 2000-09-27 Adam Fedor * Implementation of deferred windows (with the help of mirko.viviani@rccr.cremona.it) * Source/NSClipView.m (-setBoundsOrigin:): Make sure window is not deferred before attempting to draw. * Source/NSMenu.m (-init): Defer window. * Source/NSView.m (-lockFocusInRect:): Don't lock if window is deferred. (-unlockFocus): Likewise. * Source/NSWindow.m (_initBackendWindow:): New method. (-initWithContentRect:styleMask:backing:defer:screen:): Use it if not deferring. (-orderWindow:relativeTo:): Create window if deferred. * Source/tiff.m (NSTiffRead): For PHOTOMETRIC_PALETTE, don't free colormap tables, they are owned by libtiff. 2000-09-26 Lyndon Tremblay * Source/NSMenu.m ([NSMenu -itemWithTitle:]): Use -isEqualToString: instead of -isEqual: ([NSMenu -performKeyEquivalent:]): Likewise. ([NSMenu -performActionForItemAtIndex:]): Use NSApp instead of sharedApplication. ([NSMenu -display]): Avoids calling NSMakePoint() ([NSMenu -displayTransient]): Cache contentView. ([NSMenu -closeTransient]): Likewise. * Source/NSApplication.m ([NSAppIconView -mouseDown:]): Use NSApp instead of [NSApplication sharedApplication]. ([NSApplication -init]): Avoid variables getting set twice. ([NSApplication -sendEvent:]): Cache NSEvent type. * Source/NSMenu.m ([NSMenu -initWithTitle:]): Also removed a bunch of message calls. Also removed variables getting set twice. ([NSMenu -insertItemWithTitle:action:keyEquivalent:atIndex:]): Message cleanup. * Source/NSApplication.m ([NSApplication +initialize]): Override Foundation's uncaught exception handler. ([NSApplication -init]): Save a few objc message calls. ([NSApplication -run]): Likewise. Also cache [NSDate distantFuture]. Also using GC macros. ([NSApplication -runModalSession:]): Also save message calls, and GC support. Also eliminates creating an ARP each loop, only once. * Headers/AppKit/NSPanel.h (NSAlert*): #defines to comply with MacOS X [apparently]. * Source/NSApplication.m (_NSAppKitUncaughtExceptionHandler): Added to show unhandled exceptions to the user in a cleaner way, providing an option to ignore or debug [future use]. Tue Sep 26 09:36:07 2000 Nicola Pero * NSControl.m ([-copyWithZone:]): Fixed memory problem (found by Frederic De Jaeger). 2000-09-22 Lyndon Tremblay * Source/NSBundleAdditions.m ([+loadNibFile:externalNameTable:withZone:]): access NSOwner from infoDict only when necessary, notify of loading nib. * Model/GMAppKit.m: Removed silly emacs C++ mode tag. * Model/IMLoading.m: Likewise. 2000-09-19 Richard Frith-Macdonald * Source/GSTextStorage.m: ([-string]) fix to return autoreleased copy rather than internal data - pointed out by Fred. * Source/NSText.m: ([-string]) don't copy 2000-09-13 Fred Kiefer * Source/GSSimpleLayoutManager.m: * Source/GSSimpleLayoutManager.h: New file extracted from NSText.m. This class is now a subclass of NSLayoutManager and uses a similar interface. * Source/GNUmakefile: Include new file GSSimpleLayoutManager.m * Header/gnustep/gui/NSText.h: Two new NSTextView like methods. * Source/NSText.m: Removed GSSimpleLayoutManager code and use new interface to it. * Source/NSTextView.m: [initWithFrame:] switch of the creation of a NSLayoutManager. 2000-09-16 Adam Fedor * Headers/gnustep/gui/NSWindowController.h: Add copyright notice. Protect with #ifdef's. 2000-09-14 Mirko Viviani * Source/NSPanel.m ([GSAlertPanel -initWithContentRect:styleMask:backing:defer:screen:]): set alternate return image. * Source/NSOpenPanel.m ([NSOpenPanel -controlTextDidEndEditing:]): removed. * Source/NSSavePanel.m ([NSSavePanel -controlTextDidEndEditing:]): repost currentEvent. ([NSSavePanel -_initWithoutGModel]): removed form cell action, set _okButton image. ([NSSavePanel -_performReturn:]): removed. * Images/common_retH.tiff: new file. * Images/GNUmakefile (IMAGE_FILES): update. Thu Sep 14 14:01:10 2000 Nicola Pero * Source/NSMatrix.m ([-textDidBeginEditing:]), ([-textDidChange:]), ([-textDidEndEditing:]): : Fixed memory leak. 2000-09-13 Mirko Viviani * Source/NSBrowser.m ([NSBrowser -_performLoadOfColumn:]): fixed intercell space values. * Source/NSText.m ([NSText -keyDown:]): removed forward for illegal text field events. * Source/NSSavePanel.m ([NSSavePanel -controlTextDidEndEditing:]): implemented for text field movement. ([NSSavePanel -_performReturn:]): new private method. ([NSSavePanel -_initWithoutGModel]): set form cell action to _performReturn: * Source/NSOpenPanel.m ([NSOpenPanel -controlTextDidEndEditing:]): call super. ([NSOpenPanel -_selectCellName:]):, ([NSOpenPanel -controlTextDidChange:]): enable okButton if there is text in the text field. ([NSOpenPanel -ok:]): returns if nothing selected. * Tools/gpbs.m ([PasteboardEntry -lostOwnership]): removed workaround. 2000-09-13 Fred Kiefer * Source/GSFontInfo.m: [encodingForRegistry:encoding:] added more encodings Tue Sep 12 22:53:22 2000 Nicola Pero * Model/GMAppKit.m ([NSMenuItem -initWithModelUnarchiver:]): Updated, fixed code for the recent changes in NSMenu, NSMenuItem. ([NSMenu -initWithModelUnarchiver:]): Idem. 2000-09-11 Mirko Viviani * Source/NSText.m ([NSText -moveLeft:sender]): deselect text that starts at the beginning of the line. 2000-09-11 Mirko Viviani * Source/NSBrowser.m ([NSBrowser -_performLoadOfColumn:]): set intercell spacing to 0. * Source/NSMatrix.m ([NSMatrix -mouseDown:]): in NSRadioModeMatrix deselect the previous selected cell only if the cell is valid. 2000-09-10 Mirko Viviani * Tools/gpbs.m ([PasteboardEntry -lostOwnership]): workaround to avoid core dump due to NSConnection bug. * Source/NSWindow.m ([NSWindow -keyDown:]): discard and do not perform key equivalent for null character events. Triggered return key for default button cell. ([NSWindow -defaultButtonCell]), ([NSWindow -setDefaultButtonCell:]), ([NSWindow -disableKeyEquivalentForDefaultButtonCell]), ([NSWindow -enableKeyEquivalentForDefaultButtonCell]): implemented. ([NSWindow -dealloc]): release _defaultButtonCell * Headers/AppKit/NSWindow.h: added ivar and flag. * Source/NSOpenPanel.m ([NSOpenPanel -controlTextDidEndEditing:]), ([NSOpenPanel -controlTextDidChange:]), ([NSOpenPanel -ok:]): implemented keyboard navigation. ([NSOpenPanel -runModalForDirectory:file:types:]): do not allow branch selection if can't choose directories. ([NSOpenPanel -_selectTextInColumn:]), ([NSOpenPanel -_selectCellName:]): new private methods. ([NSOpenPanel -filenames]): change for choose dirs. * Source/NSText.m ([NSText -keyDown:]): forwards text field illegal events to the next responder. * Source/NSBrowser.m ([NSBrowser -moveUp:]), ([NSBrowser -moveDown:]), ([NSBrowser -moveLeft:]), ([NSBrowser -moveRight:]), ([NSBrowser -keyDown:]): implemented keyboard navigation ([NSBrowser -selectedCell]), ([NSBrowser -selectedCells]), ([NSBrowser -columnOfMatrix:]), ([NSBrowser -selectedColumn]): changed return value from NSNotFound to -1 to conforms to NSMatrix ([NSBrowser -doClick:]): fix for new return values, added support for multiple and branch selection. ([NSBrowser -setLastColumn:]): mark column titles need display ([NSBrowser -_getTitleOfColumn:]): fix for multiple selection. * Source/NSCell.m ([NSCell -setState:]): bug fix: set value to NSOnState if someone try to set NSMixedState in a two state cell. ([NSCell -performClick:]): do not perform click if the cell is disabled. * Source/NSMatrix.m ([NSMatrix -_privateFrame:mode:numberOfRows:numberOfColumns:]), ([NSMatrix -deselectAllCells]), ([NSMatrix -deselectSelectedCell]), ([NSMatrix -selectAll:]): bug fix: set _selectRow and _selectColumn to -1 when no cells are selected ([NSMatrix -performKeyEquivalent:]): saves _selectedRow and _selectedColumn. ([NSMatrix -getRow:column:ofCell:]): check for null values for row and column. ([NSMatrix -selectCellAtRow:column:]): deselect the current selection only in NSRadioModeMatrix mode. ([NSMatrix -mouseDown:]): use the new code also for NSRadioModeMatrix and fix for this mode. * Source/NSSavePanel.m ([NSSavePanel -selectCellWithString:]): select text of the cell and enable okButton. ([NSSavePanel -controlTextDidChange:]): implemented. ([NSSavePanel -controlTextDidEndEditing:]): removed. ([NSSavePanel -browser:createRowsForColumn:inMatrix:]): follows symbolic links. ([NSSavePanel -_initWithoutGModel]): set browser doubleAction to performClick: of the _okButton. Set _okButton as default window button. Disable _okButton. ([NSSavePanel -browser:selectCellWithString:inColumn:]), ([NSSavePanel -selectText:]), ([NSSavePanel -keyDown:]): implemented keyboard navigation. ([NSSavePanel -runModalForDirectory:file:]): enable _okButton if filename is valid. ([NSSavePanel -_selectTextInColumn:]), ([NSSavePanel -_selectText:]), ([NSSavePanel -_selectCellName:]): new private methods. Sun Sep 10 23:33:55 2000 Nicola Pero * Source/NSTextView.m ([-initWithFrame:textContainer:]): Fixed the setting of the text view as the text container's text view (patch prepared in cooperation with Georg Fleischman ). Sun Sep 10 23:07:45 2000 Nicola Pero * Source/NSMatrix.m ([-initWithCoder:]), ([-encodeWithCoder:]): Implemented. Sun Sep 10 16:49:50 2000 Nicola Pero * Headers/gnustep/gui/NSMatrix.h: Prefixed all ivars with underscore. * Source/NSMatrix.m: Updated for change in ivars. * Source/NSForm.m ([-calcSize]): Idem. Sun Sep 10 16:17:36 2000 Nicola Pero * Source/NSTableColumn.m ([-initWithIdentifier:]): Made column editable by default. * Source/NSTableHeaderView.m ([-mouseDown:]): Do not start resizing if the column is not resizable. * Source/NSTableView.m ([-mouseDown:]): Do not start editing if the column is not editable. Fri Sep 8 18:42:10 2000 Nicola Pero * Source/NSWindow.m ([-setFrame:display:]): Call [-constrainFrameRect:toScreen:] before resizing. ([-constrainFrameRect:toScreen:]): Rewritten to be compliant with specs. ([-initWithContentRect:styleMask:backing:defer:screen:]): Do not set maximum size as the size of the screen. 2000-09-08 Richard Frith-Macdonald * Source/NSMenu.m: ([-setSupermenu:]) don't retain supermenu. * Source/NSMenuItem.m: ([-setSubmenu:]) set target and action for handling submenu, and set supermenu for submenu. ([-setMenu:]) if item has a submenu, set supermenu for submenu of item, and set target to be the new menu, so clicking on this item will raise the submenu. 2000-09-08 Fred Kiefer * Source/NSText.m: Changed varius places to make more consistent. Thu Sep 7 21:46:33 2000 Nicola Pero * Source/NSTableColumn.m ([-setWidth:]): Post the old width in the notification user info. * Source/NSTableView.m ([-mouseDown:]): Fixed clicking on the table with shift pressed when multiple selection is not allowed. ([-_selectColumn:modifiers:]): Idem for clicks on the table header view. ([-removeTableColumn:]): Rearrange selection if needed. ([-moveColumn:toColumn:]): Implemented. ([-sizeLastColumnToFit]): Allow shrinking last column if needed. Thu Sep 7 17:47:46 2000 Nicola Pero * Source/NSStringDrawing.m ([NSAttributedString -drawInRect:]): Use NSRectClip as a temporary workaround for the fact that the string is to be drawn only inside rect. Thu Sep 7 17:01:58 2000 Nicola Pero * Headers/gnustep/gui/NSTableHeaderView.h: Added ivar for resized column. * Source/NSTableHeaderView.m ([-setTableView:]): Initialize resized column ivar. ([-resizedColumn:]): Implemented. ([-mouseDown:]): Implemented resizing of columns. * Headers/gnustep/gui/NSTableView.h: Added ivar for allowing column resizing. * Source/NSTableView.m ([-allowsColumnResizing]), ([-setAllowsColumnResizing:]): Implemented. ([-initWithFrame:]): Allow column resizing by default. ([-_userResizedTableColumn:leftWidth:rightWidth:]): New private method. Thu Sep 7 14:56:47 2000 Nicola Pero * Source/NSSplitView.m ([-mouseDown:]): Removed periodic events. Do not ask window to track mouse moved events. Only accept left mouse dragged and left mouse up events during dragging. Thu Sep 7 02:56:25 2000 Nicola Pero * Source/NSApplication.m ([-_windowWillClose:notification]): Use NSDebugLog instead of NSLog to log asking to delegate whether to terminate app. Wed Sep 6 16:44:30 2000 Nicola Pero * Source/NSBrowser.m: Cache scrollerWidth in the whole class; removed empty view from NSBrowserColumn. ([-_unloadFromColumn:]): Use nil instead of empty view. ([-setDelegate:]): Do not retain delegate. ([-pathToColumn:]): Fixed memory leak. Wed Sep 6 14:51:36 2000 Nicola Pero * Model/GMAppKit.m ([NSWindow -initWithModelUnarchiver:]): Updated code for the new NSWindow ivars. Tue Sep 5 23:13:21 2000 Nicola Pero * Source/NSControl.m ([-objectValue]), ([-takeObjectValueFrom:]), ([-setObjectValue:]): Implemented. * Headers/gnustep/gui/NSControl.h: Added declarations of the new methods. Tue Sep 5 18:52:57 2000 Nicola Pero * Headers/gnustep/gui/NSWindow.h, Source/NSWindow.m: Prefixed all ivars with underscores. * Source/NSApplication.m ([NSIconWindow -_initDefaults]): Updated for change in NSWindow's ivars. * Source/NSMenu.m ([NSMenuWindow -_initDefaults]), ([NSMenuWindow -moveToPoint:]): Idem. * Source/NSView.m ([-lockFocusInRect:]), ([-unlockFocusNeedsFlush:]): Idem. Tue Sep 5 17:55:17 2000 Nicola Pero * Source/NSTextContainer.m ([-setHeightTracksTextView:]), ([-setWidthTracksTextView:]): Register for notifications if we need. ([-setTextView:]): Only remove us from notifications regarding the old text view; register for notifications only if we need. ([-_textViewFrameChanged:]): Don't track height if we only need to track width and vice versa. Tue Sep 5 03:04:41 2000 Nicola Pero * Source/NSApplication.m ([-terminate:]): Post NSApplicationWillTerminateNotification. ([-setDelegate:]): Register the delegate for NSApplicationWillTerminateNotification. Tue Sep 5 00:31:50 2000 Nicola Pero * Source/NSClipView.m ([-encodeWithCoder:]), ([-initWithCoder:]): Implemented. * Source/NSScroller.m ([-encodeWithCoder:]), ([-initWithCoder:]): Implemented. * Source/NSScrollView.m ([-initWithCoder:]): Fixed typos; support headerview, cornerview; tile after decoding. 2000-09-03 Fred Kiefer * Headers/gnustep/gui/NSTypesetter.h: New file. * Source/NSSimpleHorizontalTypesetter.m: As above. Added some basic implementation. * Source/NSTextView.m Use more implementation from super to make this class temporary working Mon Sep 4 03:53:06 2000 Nicola Pero * Source/NSButton.m ([-keyDown:]): Updated for fix in generation of key events in the backend. * Source/NSMatrix.m ([-keyDown:]): Idem. * Source/NSResponder.m ([-interpretKeyEvents:]): Idem. * Source/NSWindow.m ([-keyDown:]): Idem. 2000-09-03 Fred Kiefer * Source/GSFontInfo.m: [weightForString:] added "black" * Source/NSAttributesString.m: Corrected bug in [nextWordFromIndex:forward:] Sun Sep 3 21:20:25 2000 Nicola Pero * Source/NSSliderCell.m ([-init]): Create titleCell. ([-drawKnob]), ([-drawKnob:]): Access control_view ivar. Sun Sep 3 20:57:32 2000 Nicola Pero * Source/NSBrowser.m ([-drawRect:]): Simplifications; do not lock focus before drawing scroller border. * Source/NSScroller.m Cache scrollBarColor. ([-drawRect:]): Only redraw the interested parts using a little cache. ([-drawKnobSlot]): Cache rect. ([-setFrameSize:]), ([-setFrame:]), ([-setArrowsPosition:]), ([-setEnabled:]): Invalidate little cache. * Headers/gnustep/gui/NSScroller.h: Added ivar for caching rects. * Source/NSSlider.m (_floatValueForMousePoint): New inline function replacing [-_floatValueForMousePointknobRect:]. ([-trackKnob:knobRect:]), ([-mouseDown:]): Use the new inline function. ([-trackKnob:knobRect:]): Tiny caching. ([-mouseDown:]): Use flag for flipped. * Source/NSTableView.m ([-drawRect:]): Only fill background in rect argument. * Source/NSBrowser.m ([-_performLoadOfColumn:]): Release matrix sooner. * Source/NSCell.m ([-dealloc]): Use NSDeallocateObject. * Source/NSSavePanel.m ([-browser:createRowsForColumn:inMatrix:]): Use an autorelease pool; avoid creating the column if it is void. * Source/NSTableHeaderCell.m ([-drawWithFrame:inView:]): Fixed typo: self, not super. 2000-09-02 Fred Kiefer * Source/GSFontInfo.m: Added missing RETAINs. * Source/NSBrowser.m * Source/NSFontPanel.m * Source/NSLayoutManager.m * Source/NSMenu.m * Source/NSMenuItemCell.m * Source/NSMenuView.m * Source/NSPanel.m * Source/NSStringDrawing.m * Source/NSTableHeaderCell.m * Source/NSTabView.m * Source/NSText.m: Changed system fonts of size 12 to 0. This will use Nicolas font cache and keep font sizes consistent when changed. 2000-09-01 Fred Kiefer * Headers/gnustep/gui/GSFontInfo.h: * Source/GSFontInfo.m: Added class methods [weightForString:], [stringForWeight:] and [encodingForRegistry:encoding:] to be used in subclasses. Sat Sep 2 01:34:19 2000 Nicola Pero * Source/NSFont.m ([+boldSystemFontOfSize:]), ([+systemFontOfSize:]), ([+userFixedPitchFontOfSize:]), ([+userFontOfSize:]): Cache font of size 0. (setNSFont): Mark caches as needing to be recomputed. Fri Sep 1 22:34:55 2000 Nicola Pero * Source/NSBrowser.m ([-_performLoadOfColumn:]): Fixed memory leak. Fri Sep 1 13:02:45 2000 Nicola Pero * Source/NSTableView.m ([-textDidEndEditing:]): Implemented Tab, Shift+Tab. ([-_editPreviousEditableCellBeforeRow:column:]), ([-_editPreviousEditableCellBeforeRow:column:]): New private methods. (_isCellSelectable): New private inline function. Fri Sep 1 12:01:36 2000 Georg Fleischmann * Source/NSTabView.m ([-drawRect:]): Redraw using bounds instead of rect. Fri Sep 1 00:56:05 2000 Nicola Pero * Source/NSColorPanel.m ([+dragColor:withEvent:fromView:]): Fixed event coordinate. 2000-08-31 Fred Kiefer * Headers/gnustep/gui/NSFont.h: Removed method -widths, as this is no longer needed. * Headers/gnustep/gui/GSFontInfo.h: Removed ivar and method widths. Changed ivar weigth to type int and added ivars traits and mostCompatibleStringEncoding. * Source/NSFont.m: Removed method -widths * Source/GSFontInfo.m: Removed method -widths. Changed [weigth], [mostCompatibleStringEncoding] and [traits] to return the ivars. Set those in [init] to the default values. Thu Aug 31 00:30:15 2000 Nicola Pero * Source/NSSavePanel.m ([-_initWithoutGModel]): Fixed setting of min size. ([-_getOriginalSize]): Fixed getting content size. ([-setAccessoryView:]): Updated, fixed. Wed Aug 30 19:36:19 2000 Nicola Pero * Source/NSForm.m ([-insertEntry:atIndex:]): Moved some code to ([putCell:atRow:column:]). ([-putCell:atRow:column:]): New method. (patch prepared in cooperation with Georg Fleischmann ) Wed Aug 30 13:07:06 2000 Nicola Pero * Headers/gnustep/gui/NSMatrix.h: Added ivar for key cell; added declaration of ([-setKeyCell:]). * Source/NSMatrix.m ([-keyCell]), ([-setKeyCell:]): Implemented. ([-selectText:]): Select keyCell if appropriate. ([-keyDown:]): Select text if the key is enter. Wed Aug 30 12:07:46 2000 Nicola Pero * Source/NSSavePanel.m ([-_initWithoutGModel]): Set browser's double action and target so that double clicking on an entry opens it. Tue Aug 29 20:07:23 2000 Nicola Pero Implemented object value and formatter support in NSCell and controls. * Headers/gnustep/gui/NSCell.h: Added ivars for formatter, object value and a new flag to cache whether the cell has a valid object value or not. * Source/NSCell.m ([-dealloc]), ([-copyWithZone:]): Added object value and formatter. ([-setFormatter:]), ([-formatter]): Implemented. ([-setIntValue:]), ([-setFloatValue:]), ([-setDoubleValue:]): Rewritten, updated. ([-setObjectValue:]): Rewritten, updated. ([-hasValidObjectValue]), ([-objectValue]): Implemented. ([-editWithFrame:inView:editor:delegate:event:]): Use string provided by formatter. ([-encodeWithCoder:]): Added formatter, object value. ([-initWithCoder:): Added formatter, object value; recompute has_valid_object_value flag. * Headers/gnustep/gui/NSControl.h: Added declaration of methods implemented by the delegate for validation using a formatter. * Source/NSTextField.m ([-validateEditing]): Added validation using NSFormatter. ([-textShouldEndEditing:]): Added validation of object value. ([-textDidChange:]): Skeleton and some code for validation while typing. * Source/NSMatrix.m ([-validateEditing]), ([-textShouldEndEditing:]), ([-textDidChange:]): Same changes as in Source/NSTextField.m. * Source/NSTableView.m ([-validateEditing]), ([-textShouldEndEditing:]): Idem. * Source/NSMatrix.m ([-drawCell:]): Implemented. * Source/NSMatrix.m, Source/NSTextField: Cache the default notification center for the whole class. * Source/NSTableView.m ([-mouseDown:]): Double clicking starts editing only if row is selected. 2000-08-26 Georg Fleischmann * gui/Source/NSApplication.m ([-NSApplication run]): Don't update menu for NSPeriodic and NSMouseMoved events. 2000-08-27 Fred Kiefer * Source/NSFontPanel.m: Changed to tags for all subviews to prepare for the switch to gmodel. ([-panelConvertFont:]): corrected to not return nil. * Header/gnustep/gui/NSFontPanel.h: Removed ivars for subviews. * Source/NSFontManager.m ([-convertWeight:ofFont:]): Better conversion. * Source/NSView.m: ([-viewWithTag:]): Corrected bug in optimisation for first sub-level. * Header/gnustep/gui/NSLayoutManager.h * Source/NSLayoutManager.m: Started cleanup of code. * Source/NSTextStorage.c ([-edited:range:changeInLength:]), ([-processEditing]): Corrected reported range. Sun Aug 27 19:11:59 2000 Nicola Pero * Source/NSTableView.m ([-initWithFrame:]): Bug fix in initialization of selecting/editing ivars. Sat Aug 26 22:55:55 2000 Nicola Pero * Source/NSText.m: Cache the default notification center for the whole class. Sat Aug 26 19:25:17 2000 Nicola Pero Implemented selection of rows and columns in NSTableView: * Headers/gnustep/gui/NSTableView.h: Added ivars for selection of rows and columns. * Source/NSTableView.m ([-initWithFrame:]): Initialize the selection ivars. ([-dealloc]): Release the selected row and column arrays. ([-setAllowsMultipleSelection:]), ([-allowsMultipleSelection]), ([-setAllowsEmptySelection:]), ([-allowsEmptySelection]), ([-setAllowsColumnSelection]), ([-allowsColumnSelection]), ([-numberOfSelectedColumns]), ([-numberOfSelectedRows]), ([-selectedRow]), ([-selectedColumn]), ([-isColumnSelected:]), ([-isRowSelected:]), ([-selectedColumnEnumerator]), ([-selectedRowEnumerator]): ([-selectRow:byExtendingSelection:]), ([-selectColumn:byExtendingSelection:]), ([-deselectColumn:]), ([-deselectRow:]), ([-deselectAll:sender]), ([-selectAll:]), ([-highlightSelectionInClipRect:]): Implemented. ([-mouseDown:]): Manage selection. ([-drawRect:]): Draw selection. (_deselectRowsInRange), (_selectionChange), (_selectRowsInRange), (_insertNumberInSelectionArray): New internal functions. ([-_selectColumn:modifiers:]): New method; ([-_setSelectingColumns:]): New internal method. * Source/NSTableHeaderView.m ([-mouseDown:]): Implemented simple selection of columns; some code for dragging. * Source/NSTableView.m: Cache the default notification center for the whole class. ([-isOpaque]): Added method. 2000-08-25 Adam Fedor * GMAppKit.m ([NSTextView -encodeWithModelArchiver:]): Test if object responds to allowsUndo. 2000-08-25 Fred Kiefer * Source/Parser/RTFProducer.m ([-runStringForString:attributes:paragraphStart:]): Improved output of bold/italic formating. * Source/Parser/rtfScanner.c Corrected function gethex(). 2000-08-19 Georg Fleischmann * gui/Source/NSView.m ([NSView -removeSubview:]): check if any superview of the first responder is the view to be removed 2000-08-15 Georg Fleischmann * gui/Source/NSText.m ([NSText -sizeToFit:]): 'else' removed to allow resize of height and width (scanRange()): line 1032: +1 to avoid infinite loop for single character line 1011, 1047: '>' instead of '>=' Thu Aug 17 08:51:45 2000 Adam Fedor * Headers/gnustep/gui/NSLayoutManager.h: Add hyphenation prototypes (patch from Jeff Teunissen ). 2000-08-07 Adam Fedor * Merge 0.6.6 branch into main. 2000-08-03 Richard Frith-Macdonald * Headers/gnustep/gui/NSEvent.h: Support middle mouse button * Headers/gnustep/gui/NSResponder.h: ditto * Source/Functions.m: ditto * Source/GSComboSupport.m: ditto * Source/NSApplication.m: ditto * Source/NSCell.m: ditto * Source/NSControl.m: ditto * Source/NSEvent.m: ditto * Source/NSGraphicsContext.m: ditto * Source/NSMenuView.m: ditto * Source/NSResponder.m: ditto * Source/NSWindow.m: ditto 2000-07-30 Richard Frith-Macdonald * Source/NSBundleAdditions.m: patch by borgheron@yahoo.com to simplify loading of gmodel files. 2000-08-06 Adam Fedor * Version 0.6.6 released. Sun Aug 6 18:43:13 2000 Nicola Pero * Source/NSBrowser.m ([NSBrowser -doClick:]): Removed safety check which was preventing subclasses of NSBrowserCell to work properly with a browser. Sat Aug 5 02:03:24 2000 Nicola Pero * Source/NSTextFieldCell.m ([NSTextFieldCell -initTextCell:]): Reverted last change - do not draw background by default. 2000-08-04 Adam Fedor * Source/NSWorkspace.m ([_GSWorkspaceCenter -postNotification:]): Add user default "GSLogWorkspaceTimeout" to log rather than raise an exception during remote notification. 2000-08-03 Adam Fedor * Source/NSWindow.m (-setFrameFromString:): Don't set display flag if window not visible. * Source/NSBezierPath.m (-initWithCoder): Don't call super. (encodeWithCoder:): Likewise. 2000-08-02 Adam Fedor * Version: Update version number * Documentation/announce.tmpl.texi: Update * Documentation/readme.tmpl.texi: Likewise. * Documentation/news.tmpl.texi: Likewise. * Documentation/todo.tmpl.texi: Likewise. * ANNOUNCE, BUGS, NEWS, README: Regenerate 2000-08-2 Fred Kiefer * Source/NSText.m Changed the handling of the selection. The selection now only gets drawn inside of drawRect: otherwise it is just flaged as needing a redraw. 2000-08-01 Adam Fedor * Source/NSWindow.m ([NSMiniWindow -mouseDown:]): Use NSWindow's -deminiaturize. 2000-07-31 Fred Kiefer * Source/NSBundleAdditions.m Removed super calls in coding for GSNibContainer and GSNibItem to remove compiler warnings * Source/NSTextFieldCell.m [initTextCell:] switch drawsBackground on. * Source/NSText.m [initWithFrame:] switch drawsBackground on. 2000-07-31 Richard Frith-Macdonald * Source/NSColor.m: ([-description]) corrected to remove quotes from string listing color components. problem reported by Benhur Stein 2000-07-31 Fred Kiefer * Source/NSTextView.m Use [drawRect:] from super. * Source/NSText.m Added method [undrawSelectionAsRange:], this only shows the cursor if [shouldDrawInsertionPoint] is YES. In [mouseDown:] only make first responder if editable. Also increase the proposed range to include the last character into the selection. 2000-07-30 Adam Fedor * Source/NSBundleAdditions.m (+loadNibFile:externalNameTable:withZone:): Read as gmodel if it has proper extension. (-loadNibFile:externalNameTable:withZone:): Fix a few bugs in determining proper extension. (patch from Gregory Casamento ). Sun Jul 30 01:33:15 2000 Nicola Pero * Source/NSText.m ([NSText -moveRight:]): ([NSText -moveLeft:]), ([NSText -moveUp:]), ([NSText -moveDown:]): Tidied; removed call to selectionRangeForProposedRange:granularity:. ([NSText -selectionRangeForProposedRange:granularity:]): Tidied, fixed some bugs showing upon selecting text by words and deleting text. 2000-07-01 Fred Kiefer * Source/NSFileWrapper.m [initWithPath:] always store full pathname in filename. This may be wrong but now it is consistent in this file. [writeToFile:atomically:updateFilenames:] set attributes for normal files. * Source/NSAttributedString.m [fixAttributesInRange:] added fix of attachments Thu Jul 20 16:00:14 2000 Nicola Pero * Source/NSApplication.m ([-init]): Enclosed all initialization into an autorelease pool as per specifications; moved initialize_gnustep_backend () here so it is enclosed in the autorelease pool too. 2000-07-19 Adam Fedor * Source/NSApplication.m (+sharedApplication): Initialize backend here instead of NSApplicationMain(). * Source/NSGraphicContext.m (+waitAllContexts): New method. * Documentation/news.tmpl.texi: Update. * Documentation/todo.tmpl.texi: Update. 2000-07-16 Adam Fedor * GNUmakefile: Make PrinterTypes subdir. * PrinterTypes/GNUmakefile: New file to install ppd files. * PrinterTypes/GNUmakefile.postamble: Likewise. * Source/NSPrinter.m (getFile): Use NSBundle methods. (+printerTypes): Simplify with use of NSBundle methods. 2000-07-14 Adam Fedor * Source/NSApplication.m (-run): Do appIconInit here so NSApp can be set-up without showing icon. 2000-07-06 Richard Frith-Macdonald * Source/GNUmakefile: Install GSFontInfo.h 2000-07-04 Richard Frith-Macdonald * Source/GSServicesManager.m: Update port name servr for revised API compatible with MacOS-X 2000-07-03 Richard Frith-Macdonald * Tools/gpbs.m: Fix for OPENSTEP complient DO 2000-07-01 Fred Kiefer * Source/NSFileWrapper.m Corrected decoding and added a RETAIN in [initWithSerializedRepresentation:] * Source/Parser/RTFProducer.m * Source/Parser/RTFProducer.h * Source/Parser/attributedStringConsumer.m * Source/Parser/rtfConsumer.h Added new methods to read/write RTFD and resturctured the methods for RTF. * Source/NSAttributedString.m Use new RTFD methods 2000-07-01 Fred Kiefer * Source/NSFileWrapper.m Implemented coding and replaced [initWithSerializedRepresentation:] and [serializedRepresentation] to use it. * Source/NSText.m Changed Font/Ruler pasting to use an Archiver * Source/NSTextView.m [setAllowsUndo:] and [allowsUndo] now use ivar 2000-06-29 Adam Fedor * Source/NSText.m (-setFont:): Return if font==nil. * Source/NSTextView.m (setAllowsUndo:, allowsUndo): Stub implementation. * Source/Functions.m (NSApplicationMain): Call NSProcessInfo initialization if GS_PASS_ARGUMENTS. * Tools/example.m: Likewise. * Tools/gpbs.m: Likewise. * Tools/make_services.m: Likewise. * Tools/set_show_services.m: Likewise. Tue Jun 27 19:35:54 2000 Nicola Pero * Source/NSButton.m ([-allowsMixedState]): Implemented. ([-setAllowsMixedState:]): Idem ([-setNextState]): Idem. * Headers/AppKit/NSButton.h: Added corresponding declarations. 2000-06-26 Fred Kiefer * Source/NSFileWrapper.m Added a crude implemention for [initWithSerializedRepresentation:] and [serializedRepresentation]. Also scattered some AUTORELEASE and RELEASE statements. * Source/NSPasteboard.m [readFileContentsType:toFile:] and [writeFileContents:] now use file wrappers to use the same format as the new methods. * Source/NSText.m Turn on NSFileContentsPboardType in [readablePasteboardTypes]. 2000-06-26 Richard Frith-Macdonald * Source/NSAttributedString.m: attachmentString() - retain newly created string. 2000-06-26 Fred Kiefer * Headers/AppKit/NSTextAttachment.h * Source/NSTextAttachment.m * Source/NSAttributedString.m Added a basic implementation for NSTextAttachment and NSTextAttachmentCell and use it in NSAttributedString. * Source/GNUmakefile Include new file NSTextAttachment.m * Source/NSText.m Changed the font and ruler pasting and removed some other FIXMEs * Headers/AppKit/NSPasteboard.h * Source/NSPasteboard.m Added two missing methods for file wrapper 2000-06-25 Fred Kiefer * Source/Parser/attributedStringConsumer.m * Source/Parser/rtfConsumerFunctions.h * Source/Parser/rtfScanner.c * Source/Parser/rtfGrammer.y Added support for RTF special characters and extra paragraph attributes * Source/Parser/RTFProducer.m * Source/Parser/RTFProducer.h New files for RTF output, code comes partly from Source/NSAttributedString * Source/GNUmakefile Include new file Parser/RTFProducer.m until it gets its own bundle * Source/NSAttributedString.m Moved RTF output code to Source/Parser/RTFProducer.m Corrected [fixParagraphStyleAttributeInRange:] and removed all the location < 0 checks as location is unsigned. * Source/NSFontManager.m Allow for a loosier conversion in [fontWithFamily:traits:weight:size:] Wed Jun 21 19:42:12 2000 Nicola Pero * NSCell.m ([-objectValue]): Placeholder implementation returning the same as stringValue. Alpha implementation of editing in NSTableView. * Source/NSTableView.m ([-setDelegate:]): Check whether delegate is editable. ([-drawRow:clipRect:]): Don't draw over the edited cell. ([-mouseDown:]): Added editing. ([-abortEditing]): Implemented. ([-currentEditor]): Idem. ([-validateEditing]): Idem. ([-editedRow]): Idem. ([-editedColumn]): Idem. ([-textDidBeginEditing:]): Idem. ([-textDidEndEditing:]): Idem. ([-textShouldBeginEditing:]): Idem. ([-textShouldEndEditing:]): Idem. ([-textDidChange:]): Idem. Tue Jun 20 20:22:34 2000 Nicola Pero * Headers/AppKit/NSTableView.h: Added editing related ivars. Mon Jun 19 19:16:15 2000 Nicola Pero * Source/NSText.m ([-selectionRangeForProposedRange:granularity:]): Fixed crash when moving past the end of text. 2000-06-16 Adam Fedor * Source/GSFontInfo.m (-mutableCopyWithZone:): New method. 2000-06-19 Fred Kiefer * Headers/gnustep/gui/GMAppKit.h * Model/GMAppKit.m Added archiving of NSText and NSTextView 2000-06-17 Fred Kiefer * Source/Parser/attributedStringConsumer.m * Source/Parser/rtfConsumer.h * Source/Parser/rtfConsumerFunctions.h * Source/Parser/rtfScanner.h * Source/Parser/rtfScanner.y * Source/Parser/rtfGrammer.y Extended support for RTF. Added underline, script, colour and tailindent. Fri Jun 16 21:05:49 2000 Nicola Pero * Source/NSText.m ([NSText -scrollRangeToVisible:aRange]): Don't try scrolling an ancestor clipview if we are field editors. Fri Jun 16 19:32:11 2000 Nicola Pero Implemented double-click on NSTableView header and not editable cells. * Headers/AppKit/NSTableView.h: Added ivars _clickedRow, _clickedColumn, _target; added declaration of private method below. * Source/NSTableView.m ([-setTarget:]): Implemented. ([-target]): Idem. ([-clickedColumn]): Idem. ([-clickedRow]): Idem. ([-mouseDown:]): Implemented double-click to send double action when cell is not editable. ([-_sendDoubleActionForColumn:]): New private method for use by NSTableHeaderView. * Source/NSTableHeaderView.m ([-mouseDown:]): Implemented double-click. * Source/NSTableView.m ([-scrollColumnToVisible:]): Tiny fix for coordinate change. ([-scrollRowToVisible:]): Idem. 2000-06-16 Fred Kiefer * Source/Parser/attributedStringConsumer.m * Source/Parser/rtfConsumer.h * Source/Parser/rtfConsumerFunctions.h * Source/Parser/rtfScanner.h * Source/Parser/rtfScanner.y * Source/Parser/rtfGrammer.y Extended support for RTF. It is possible to read in the OpenStep specification now! * Source/NSAttributedString.m Use new RTF interface in initWithRTF:documentAttributes: (Will change once more if we use a separat bundle) Implemented attributedStringWithAttachment: * Source/NSTextStorage.m Corrected problem in processEditing. The change range got to big after repeated adding at the end. * Source/NSText.m Made setAlignment:range: save against missing paragraph style Fri Jun 16 18:59:44 2000 Nicola Pero * Source/NSTableView.m ([NSTableView -scrollRowToVisible:]): Don't need to constrainScrollPoint before calling scrollToPoint. ([-scrollColumnToVisible:]): Idem. * Source/NSView.m ([-scrollPoint:]): Idem. ([-scrollRectToVisible:]): Idem. ([-scrollPoint:]): Don't send reflectScrolledClipView to the clipview's superview. Fri Jun 16 10:18:29 2000 Nicola Pero * Source/NSTableView.m ([-scrollColumnToVisible:]): Updated for last changes in scrollview code. Thu Jun 15 20:29:13 2000 Nicola Pero * Source/NSView.m ([-scrollRectToVisible:]): Don't need to send reflectScrolledClipView to the clipview's superview. This is done automatically by the clipview. Thu Jun 15 20:09:55 2000 Nicola Pero * Source/NSScrollView.m ([-reflectScrolledClipView:]): If needed, scroll the header view too. Thu Jun 15 15:25:32 2000 Nicola Pero * Source/NSTableView.m ([-columnAtPoint:]): Fixed fatal typo. Tue Jun 13 19:36:37 2000 Nicola Pero * Source/NSTableView.m ([-scrollRowToVisible:]): Implemented. ([-scrollColumnToVisible:]): Implemented. Tue Jun 13 17:22:24 2000 Nicola Pero * Source/NSCell.m ([-copyWithZone:]): Copy all cell's attributes [bug reported by Frederic De Jaeger]; simplified. 2000-06-11 Jonathan Gapen * Headers/gnustep/gui/NSTypesetter.h: New file. * Source/NSTypesetter.m: Skeleton implementation from Apple docs. * Source/NSSimpleHorizontalTypesetter.m: As above. 2000-06-11 Fred Kiefer * Headers/gnustep/gui/NSFont.h: * Headers/gnustep/gui/GSFontInfo.h: * Source/NSFont.m: * Source/GSFontInfo.m: Added some support for glyph layout * Source/NSText.m: updateFontPanel isMultiple was set wrong 2000-06-10 Fred Kiefer * Headers/gnustep/gui/NSDocument.h: * Headers/gnustep/gui/NSDocumentController.h: * Headers/gnustep/gui/NSDocumentFrameworkPrivate.h: Added header, replaced import with include * Source/NSDocument.m: Added header, replaced import, retain, release... Rewrote the saveXX methods Rename saveFileType to fileTypeFromLastRunSavePanel * Source/NSDocumentController.m: Added header, replaced import, retain, release... Added methods for handling of last recent documents. Made addDocument and removeDocument public. * Source/NSAttributedString.m: Added header. RTFHeaderStringWithContext: convert colour to RGB 2000-06-07 Adam Fedor * Model/IMLoading.m ([GMModel -_makeConnections]): Call awakeFromNib if object doesn't respond to awakeFromModel (patch from Gregory Casamento ). 2000-05-04 Georg Fleischmann * gui/Model/GMAppKit.m ([NSWindow -createObjectForModelUnarchiver:]): use self instead of NSWindow class to allow creation of subclasses of NSWindow 2000-06-03 Richard Frith-Macdonald * Source/NSAttributedString.m: ([-setAlignment:range:]) retain/release problem fixed. Thu Jun 1 21:50:34 2000 Nicola Pero * Source/NSScrollView.m ([NSScrollView -tile]): Fixed position of corner view when there is no horizontal scrollview; fixed position of parts when there is a header view but not a horizontal scrollview. 2000-05-24 Georg Fleischmann * gui/Model/GMAppKit.m ([NSScrollView(GMArchiverMethods) -initWithModelUnarchiver:]): select selected cells in matrix too 2000-05-20 Fred Kiefer * Headers/gnustep/gui/NSTextView.h: Corrected signature for [smartInsertForString:...] * Source/NSAttributedString.m: [setAlignment:range:] allwas use a mutableCopy * Headers/gnustep/gui/NSText.h: * Source/NSText.m: * Source/NSTextView.m: Reorganised all the Copy and Paste code. Added some implementation. 2000-05-23 Adam Fedor * Source/NSImage.m ([NSImage +imageNamed:]): Check for nil extension. 2000-05-12 Georg Fleischmann * Model/GMAppKit.m ([NSScrollView(GMArchiverMethods) -initWithModelUnarchiver:]): move unarchiving of backgroundColor behind documentView 2000-05-20 Fred Kiefer * Headers/gnustep/gui/NSText.h: * Source/NSAttributedString.m: * Source/NSText.m: * Source/NSTextView.m: Improved the handling of character and paragraph attributes on NSText and added basic implementations for these methods on NSTextView. Some ivars on NSText have been replaced by values in [ typingAttributes]. 2000-05-17 Jonathan Gapen * Model/GMAppKit.m: NSButton methods removed; all NSButton attributes are actually stored in an associated NSButtonCell. Eliminate (de)archiving of NSTextField attributes that duplicate attributes of its associated NSTextFieldCell. NSMenuItem [encodeWithModelArchiver:] Do not encode images when the item has a submenu. (Patch from Nicola Pero.) (De)archive autoresizing mask in NSPopUpButton. (De)archive border attribute of NSColorWell. 2000-05-13 Fred Kiefer * Headers/gnustep/gui/NSText.h: * Headers/gnustep/gui/NSTextView.h: * Source/NSText.m: * Source/NSTextView.m: Made NSTextView use the ivars of its super class and added some new ivars to NSText. Adopted both implementations to this. Added some missing method declarations to NSTextView. This is only the start of the rearangement of this classes. 2000-05-09 Richard Frith-Macdonald * gui/Source/NSTabView.m: General tidyup, minro fixes, and implemented ([-takeSelectedTabViewItemFromSender:]) 2000-05-09 Georg Fleischmann * gui/Source/NSTabView.m ([-initWithFram:]): retain tab_font ([-dealloc]): new method. 2000-05-07 Fred Kiefer * Source/NSAttributedString.m: RTFBodyStringWithContext: Corrected output of subscript * Source/Parsers/attributedStringConsumer.m: GSRTFsubscript, GSRTFsuperscript: Change interpretation of super/subscript parameter * Source/NSStringDrawing.m: Corrected baseline for font with different point size. Added primitiv support for super/subscript as baseline change of 3 points. The baseline correction is only done for the current chunk not for the whole line. 2000-05-06 James Dessart * Documentation/gsdoc/NSWindow.gsdoc : * Documentation/gsdoc/NSWindow.html : Added some very basic documentation. 2000-05-04 Fred Kiefer * Source/NSText.m: Always use the most appropriate RTF* method and other small internal improvements * Source/NSAttributedString.m: Corrected lineBreakBeforeIndex:withinRange: and reorganised the initWithRTF* methods. * Headers/gnustep/gui/NSAttributedString.h: Moved two methods from NSTextAttachment.h here * Headers/gnustep/gui/NSTextAttachment.h: Moved two methods into NSAttributedString.h Thu May 4 19:11:48 2000 Nicola Pero * Source/NSPanel.m ([GSAlertPanel -initWithContentRect:styleMask:backing:defer:screen:]): Fixed position of the panel title, so that it is displayed again. 2000-04-29 Richard Frith-Macdonald * Source/NSFont.m: ([-initWithCoder:]) corrected retain/release error. 2000-04-28 Richard Frith-Macdonald * Source/NSWorkspace.m: Fixed bug setting preferred application/icon. 2000-04-27 Jonathan Gapen * Headers/gnustep/gui/NSColorWell.h: Add ivar, prepend underscores. * Images/common_ColorSwatch.tiff: New file. * Images/GNUmakefile: Update. * Model/IMLoading.m: Bugfix in [+loadGModelNamed:owner:] to invoke [+bundleForClass:] with a class, not an object. * Panels/ColorPanel.gmodel: Add attributes to make a color panel become key only as needed, and make it a floating panel. * Source/NSColorPanel.m: Use above image for color dragging. * Source/NSColorWell.m: Updates for proper (de)activation. 2000-04-25 Adam Fedor * Source/NSScreen.m (-deviceDescription): Use autoreleased dictionary. (+mainScreen): Autorelease screen. (+screens): Likewise. (-isEqual:): Implement. 2000-04-25 Richard Frith-Macdonald Patch by Gregory John Casamento edited to conform to standards. Adds improved colorspace support. Files modified - Headers/gnustep/gui/NSGraphics.h, Headers/gnustep/gui/NSScreen.h, Source/Functions.m, Source/NSScreen.m, Source/externs.m, Tools/Functions.m 2000-04-25 Adam Fedor * Source/NSView.m (-_updateBoundsMatrix): New method from common code in other methods. (-setFrame:): Use it. Also check if frame actually changed before doing something. (-scaleUnitSquareToSize): Use it. (-setBounds): Likewise. (-setBoundsSize:): Likewise. (-resizeWithOldSuperviewSize:) Likewise. Also use setFrame to actually set the frame (This is apparently what OpenStep 4.2 does). 2000-04-24 Adam Fedor * Source/NSFont.m (-isEqual:): Implement. (hash): Likewise. * Documentation/gsdoc/DPSOperators.gsdoc: New file. 2000-04-24 Fred Kiefer * Parser/*: Updated the parser to support more of the RTF specification * NSAttributedString.m: Use new parser * NSText.m: Small improvements on formatting 2000-04-23 Fred Kiefer * GSTextStorage.m: Corrections in replaceCharactersInRange:withString: 2000-04-20 Adam Fedor * Headers/gnustep/gui/GSMethodTable.h: Added methods to get current server device (X display) and current window device (X window). * Headers/gnustep/gui/DPSOperators.h: Likewise * Headers/gnustep/gui/NSGraphicsContext.h: Likewise * Headers/gnustep/gui/PSOperators.h: Likewise * Source/NSGraphicsContext.m: Likewise * Source/NSBrowser.m (-setDelegate:): browser:willDisplayCell:atRow:column: is only required for a passive browser delegate. * Source/NSFont.m (-fontInfo): New private method. * Source/NSFontManager.m (-traitsOfFont): Use it. (-weightOfFont): Likewise. 2000-04-18 Adam Fedor * Hooks for using backend libraries to read images. * Source/NSBitmapImageRep.m (-_initFromWrasterFile:number:): New stub for backends. (+imageRepsWithFile:): New method. (+_wrasterFileTypes): New stub for backend. (+imageFileTypes): Include wraster file types. * Source/NSImageRep.m (+imageRepsWithContentsOfFile:): Check/use if rep implements +imageRepsWithFile. * Headers/gnustep/gui/nsimage-tiff.h: Add field for associated alpha. * Source/tiff.m: Set it. 2000-04-17 Jonathan Gapen * Headers/gnustep/gui/NSColorPanel.h: New ivars for panel objects. * Panels/ColorPanel.gmodel: New file. * Panels/GNUmakefile: Add above file. * Source/NSApplication.m: [-orderFrontColorPanel:] Implement. * Source/NSColorPanel.m: Rough draft implementation. * Source/NSColorWell.m: Add drag 'n drop methods. 2000-04-16 Adam Fedor * Source/tiff.m (NSTiffGetInfo): Getting alpha info requires two parameters! 2000-04-14 Richard Frith-Macdonald * Source/NSSliderCell.m: Fix stupid mistake in last mod. * Headers/AppKit/NSView.h: Fix incorrect comments about resize mask. 2000-04-13 Adam Fedor * Source/NSApplication.m ([NSAppIconView -setImage:]): Remove extra lock/unlock focus. ([NSApplication -finishLaunching]): More specific error information. * Source/NSWindow.m (-setFrameOrigin:): Don't re-display. (-setFrameTopLeftPoint): Likewise. (_initDefaults): Set needs_display flag. * Source/NSBitmapImageRep.m (-_initFromImage:number:): Use new Tiff routines, log message and return nil rather than raise exception. * Source/tiff.m (NSTiffGetInfo): Tidy, get alpha info correctly. (NSTiffRead): Bug fixes, particularly reading planar images. (NSTiffError): New function. (NSTiffWarning): Likewise. (NSTiffGetImageCount): Likewise. 2000-04-13 Richard Frith-Macdonald * Source/NSMenu.m: ([-_setOwnedBypopUp:]) set correct window level for popup menu windows. * Source/NSApplication.m: ([-beginModalSessionForWindow:]) set correct window level for panels now that WindowMaker supports it. * Source/NSSliderCell.m: Minor tidyups 2000-04-12 Jonathan Gapen * Model/GMAppKit.m: Added methods for NSSliderCell. * Model/IMLoading.m: Use [-pathExtension] rather than [-hasSuffix] to check for gmodel filename extension. * Source/NSSliderCell.m: Tweaked drawing code to account for border/bezel and to draw the title cell properly. 2000-04-10 Richard Frith-Macdonald * Documentation/gsdoc/GNUmakefile: New file to build documentation * AppKit.gsdoc: renamed to Gui.gsdoc to reflect GNUstep name for library rather than NeXT/Apple trademarked one. Updated links in the other documentation files. 2000-04-08 James Dessart * Documentation/gsdoc/NSSlider.gsdoc: Made corrections to class description * Documentation/gsdoc/NSSliderCell.gsdoc: Basic documentation (added in mid-March) * Documentation/gsdoc/NSView.gsdoc: Start of basic documentation * Documentation/gsdoc/NSSlider.html: For users who cannot compile gsdoc * Documentation/gsdoc/NSSliderCell.html: For users who cannot compile gsdoc * Documentation/gsdoc/NSView.html: For users who cannot compile gsdoc 2000-04-07 Jonathan Gapen * Source/NSWindow.m: Update [-performClose:] to check send [-windowWillClose:] message to window controller's document. * Source/NSWindowController.m: Add copyright notice, update to GC-compatible RETAIN/ASSIGN macros, re-format. * Source/NSWorkspace.m: [-getInfoForFile:application:type:] Implement. 2000-04-06 Adam Fedor * Source/GSFontInfo.m: allFonts returns GSFontInfo objects. [-pointSize]: Implement. 2000-04-02 15:00 Fred Kiefer * NSAttributedString.m: Improved RTF output and corrections in the formating methods 2000-04-01 18:00 Fred Kiefer * Source/NSText.m: Now really uses a text storage instead of an attributed string (old patch missed this) * Source/NSAttributedString: Use NSFileWrapper to write RTF 2000-03-31 Adam Fedor * Headers/gnustep/gui/NSFont.h: Conform to NSCopying. * Source/NSFont.m ([NSFont -copyWithZone:]): Implement. * Source/GSFontInfo.m: (-copyWithZone:): Likewise 2000-03-31 Jonathan Gapen * Model/GMAppKit.m: Re-organize NSCell's [-initWithModelUnarchiver:] to unarchive each cell type appropriately. Changed NSPanel [+createObjectForModelUnarchiver:] so that it correctly creates an object for NSPanel subclasses. 2000-03-27 Adam Fedor * Changes to use "helper" class for getting backend font information rather than poseAs classes. * Headers/gnustep/gui/NSFont.h: New ivar. * Headers/gnustep/gui/NSFontManager.h: New ivar. * Source/NSFont.m: Changes to use GSFontInfo classes for getting font information. * Source/NSFontManager.m: Likewise for GSFontEnumerator. * Source/GSFontInfo.m: New file. 2000-03-27 Nicola Pero * Source/NSTableView.m ([-tile]): Access ivar _frame. 2000-03-25 Jonathan Gapen * Headers/gnustep/gui/NSColorPicker.h: Added ivar. * Headers/gnustep/gui/NSImage.h: Added setFlipped/isFlipped methods. * Source/NSBundleAdditions.m: Fixed bug in checking filename extension. ([-pathForImageResource:]) * Source/NSColorPicker.m: Implement. ([-initWithPickerMask:colorPanel:] [-colorPanel] [-insertNewButtonImage:in:] [-provideNewButtonImage:]) * Source/NSImage.m: Initialize _flags.flipDraw in [-initWithSize:] 2000-03-24 Jonathan Gapen * Source/NSFileWrapper.m: First implementation of NSFileWrapper * Headers/gnustep/gui/NSFileWrapper.h: Added ivars and enum 2000-03-21 22:00 Fred Kiefer * Source/NSText.m: Changed to use a text storage instead of an attributed string. * Source/NSTextStorage.m: Removed unnecessary method, changes of the delegate now don't trigger processEditing * Source/GSTextStorage.m: The two basic operations call ([-edited:range:changeInLength:]) 2000-03-22 Richard Frith-Macdonald Patch from jagapen@whitewater.chem.wisc.edu * Model/IMLoading.m: new method ([+loadGModelNamed:owner:]) * Headers/AppKit/IMGmodel.h: ditto * Source/NSApplication.m: Use new method. Sun Mar 19 22:26:55 2000 Nicola Pero * Model/GMAppKit.m ([NSApplication -initWithModelUnarchiver:]): RETAIN the decoded windows. * Source/NSClipView.m ([-viewFrameChanged:]): If the document view does not cover all our area, fill the remaining space with background color. * Source/NSTableView.m ([-noteNumberOfRowsChanged]): Implemented. 2000-03-19 Richard Frith-Macdonald * Source/GSTextStorage.m: ([setAttributes:range:]) make sure attributes are set when old range starts at start of new range. 2000-03-19 Richard Frith-Macdonald Fixes fromFred Kiefer - * Headers/gnustep/gui/NSResponder.h: prefix ivars with underscore and add new _menu ivar. * Source/NSResponder.m: Change ivars and add support for Apples menu methods. * Source/NSWindow.m: update for change to responder ivar names. * Source/NSInterfaceStyle.m: ditto * Source/NSText.m: Establish cursor on starting edit. 2000-03-18 Richard Frith-Macdonald * Source/NSSplitView.m: ([-mouseDown:]) only highlight/unhighlight divider when actually necessary. Fri Mar 17 23:33:40 2000 Nicola Pero First alpha implementation of NSTableView. Mouse interaction not yet implemented, with the exception of scrolling. * Source/NSScrollView.m: Added NSTableView support. ([-_doScroll:]): If we have a header view, scroll the header view too. ([-tile]): Added code to tile header clip view and corner view if we have them. ([-drawRect:]): Added code for the case we have a header view and/or a corner view; fixed drawing of border. ([-setDocumentView:]): Added code to check if the document view responds to the methods cornerView and headerView, as per macosx NSTableView spec, and to manage the various cases. * Headers/AppKit/NSScrollView.h: New ivars _hasCornerView, _hasHeaderView, _headerClipView. * Source/NSTableColumn.m ([-setWidth:]): Invoke [-tile] in the table view. * Source/NSTableHeaderCell.m ([-initTextCell:]): Set bezeled as yes; set font. ([-drawWithFrame:inView:]): New method; draw a gray bezel border. * Source/NSTableHeaderView.m ([-columnAtPoint:]): Implemented. ([-headerRectOfColumn:]): Rewritten. ([-drawRect:]): Rewritten. * Source/NSTableView.m: [Re]Written from scratch. * Headers/AppKit/NSTableView.h: Idem. * Source/externs.m: Added NSTableView notifications. * Headers/AppKit/AppKit.h: Added NSTableView.h, NSTableHeaderView.h, NSTableHeaderCell.h. 2000-03-17 Richard Frith-Macdonald * Headers/gnustep/gui/NSGraphics.h: Removed the inclusion of PSOps that was messing up Functions.m in the Tools area. Thu Mar 16 13:15:00 2000 Richard Frith-Macdonald * Source/NSText.m: Fixes by Fred Kiefer for rich text display. * Source/NSTextView.m: ditto * Source/NSFontManager.m: bugfixes - check for nil fonts. * Headers/AppKit/NSResponder.h: additional macOS-X methods declared Wed Mar 15 02:41:04 2000 Nicola Pero * Source/GSUtil.m: Removed file; it was duplicating [NSString -sizeWithAttributes:]. * Source/GSUtil.h: Idem. * Source/GNUmakefile: Idem. * Source/NSButtonCell.m ([-drawInteriorWithFrame:inView:]): Invoke [NSString -sizeWithAttributes:] instead of GSUtil_sizeOfMultilineStringWithFont(); ([-cellSize]): Idem. * Source/NSCell.m ([-cellSize]): Idem; updated for the change so that the @"" string gets simply the height of the font. ([-_drawText:title:cellFrame]): Idem, plus rewritten vertical centering of text. * Source/NSCell.m ([-setObjectValue:]): Temporary implementation working only with strings, images, and numbers. This is needed by the forthcoming NSTableView. 2000-03-11 Adam Fedor * Headers/gnustep/gui/NSText.h: Add missing methods. * Source/NSCachedImageRep.m: Remove ImageCompositing dwrite and centralize in backend (Now use GraphicCompositing to turn on alpha drawing/compositing). * Source/NSSlider.m ([NSSlider -initWithFrame:]): set continuous as specified in OpenStep docs. * Source/NSWindow.m (-center): Remove modification already taken care of in backend. Sat Mar 11 06:32:00 2000 Richard Frith-Macdonald * Source/NSStringDrawing.m: Fix error in handling extent of paragraph styles. Sat Mar 11 05:54:00 2000 Richard Frith-Macdonald * Source/NSPanel.m: Completely reformatted and added some fixes for errors in positioning/sizing the panel. Fri Mar 10 17:42:00 2000 Richard Frith-Macdonald * Source/NSWindow.m: Reverted last change to NSWindow as they left it unable to compile and the intended modification to the center method seemed bogus - it would have left the window positioned 17.5 pixels below the center of the screen. and I don't think that that is what is desired. Fri Mar 10 13:36:00 2000 Richard Frith-Macdonald * Source/NSCell.m: fixed formatting to be consistent and conform to GNU standards. * Source/NSButtonCell.m: ditto. 2000-03-10 Pascal J. Bourguignon * Source/GSUtil.m: A new file where to put utility functions used by the classes. For now, only contains the GSUtil_sizeOfMultilineStringWithFont() function. * Source/NSCell.m: * Source/NSButtonCell.m : Updated -cellSize to process multiline string value. This should improve greately the behaviour of NSTextField and consequently of the NSPanel building functions. Updated -[NSCell _drawText:inFrame:] and -[NSButtonCell drawInteriorWithFrame:inView:] to handle properly multiline strings. * Source/NSPanel.m: Added the following features to GSAlertPanel private subclass of NSPanel: - fit the height of the panel according to the height of the message, in addition to the width. - when the final size for the panel is much too big respective to the screen, it is reduced, and the message is put in a scroll view. - made the attention panel stay visible when the application is deactivated as manded by the OpenStep specifications. - more than one attention panel can be run simultaneously, without the later invocation stealing the panel of the former one. * Source/NSWindow.m: Moved constant invocation of the method -[NSParagraphStyle attribute:atIndex:effectiveRange:] outside of loops and removed firstLine variable in -drawAtPoint: and in -size. Made -center take into account the title bar height so that windows as high as the screen would be centered at y=0 instead of y=title bar height/2. * Testing/NSPanelTest: Also, I've added a NSPanelTest application in core/Testing, that will show how nice have become the Alert panels... Fri Mar 10 12:42:44 2000 Nicola Pero * Source/NSSplitView.m ([-mouseDown:]): Fixed bug. Fri Mar 10 10:48:00 2000 Richard Frith-Macdonald * Documentation/gsdoc/NSView.gsdoc: Added a little documentation for methods for removing subviews from a view. Fri Mar 10 09:35:00 2000 Richard Frith-Macdonald * Source/NSView.m: Make ([removeSubview:]) public. * Headers/AppKit/NSView.h: ditto Fri Mar 10 06:46:00 2000 Richard Frith-Macdonald * Source/NSView.m: Added ([_removeSubview:]) and make all subview removals use it. Modify addition of subviews to invalidate the subview coordinates. * Source/NSScrollView.m: Use _removeSubview * Headers/AppKit/NSView.h: tidyup and add new method. Fri Mar 10 02:12:34 2000 Nicola Pero * Source/NSSplitView.m ([-mouseDown:]): Better management of the case a subview passed mouse down to next responder so the splitview got it - made log message milder and do not redraw the splitview. ([-mouseDown:]): Fixed bug causing hard misbehaviour when the mouse drags starting exactly on the borderline between the divider and a subview. Thu Mar 9 23:32:36 2000 Nicola Pero * Model/GMAppKit.m ([NSView -subviewsForModel]): Fixed fatal problem for encoding editable textfields in gmodels: do not encode Apple's private class _NSKeyboardFocusClipView. Thu Mar 9 19:42:17 2000 Nicola Pero * Source/NSSplitView.m ([-adjustSubviews]): Fixed bug in calculation of frames; patch by Björn Giesler . Wed Mar 8 23:19:08 2000 Nicola Pero * Source/NSPopUpButton.m ([-sizeToFit]): Invoke super's implementation. * Source/NSPopUpButton.m ([-synchronizeTitleAndSelectedItem]): Removed call to sizeToFit. * Source/NSPopUpButtonCell.m ([-cellSize]): Implemented. Wed Mar 08 20:56:00 2000 Richard Frith-Macdonald * Source/NSFontPanel.m: A few bug fixes and tidyups. Wed Mar 08 17:09:00 2000 Richard Frith-Macdonald * Source/NSWindow.m: ([-setLevel:]) implemented. Wed Mar 08 115:4500 2000 Richard Frith-Macdonald Removed a fixup that should no longer be needed now that the coordinate stuff is fixed - NB you need to update your copy of WindowMaker to the latest CVS code because that contains some coordinate handling bug fixes that we need. * Source/NSPopPupButton.m: Removed workaround for bad coordinates. * Source/NSPopPupButtonCell.m: ditto. Wed Mar 08 13:15:00 2000 Richard Frith-Macdonald * Source/NSWindow.m: Final (I hope) coordinate handling fixes to use proper frame coordinates and offsets now that support is in backend and WindowMaker bugs are fixed. Wed Mar 08 07:44:00 2000 Richard Frith-Macdonald * Source/NSText.m: Fixes by Fred Kiefer for rich text display. * Source/NSStringDrawing.m: ditto * Headers/AppKit/NSText.h: ditto * Headers/AppKit/NSStringDrawing.h: ditto Tue Mar 07 11:00:00 2000 Richard Frith-Macdonald * Source/NSWindow.m: Changes throughout to use correct offsets for differences between content rect and frame coordinates. Base coordinate system is that of the content rect, so conversions between screen and base coordinates are required except for borderless windows (where the frame rect is the same as the content rect). Tue Mar 07 06:24:00 2000 Richard Frith-Macdonald * Source/NSApplication.m: ([activateIgnoringOtherApps]) order key window to front when activating app. Tue Mar 7 03:23:55 2000 Nicola Pero Warning: the gmodel format was changed by this fix - and it is going to be changing for a while. If you are using CVS be sure to be always creating and running gmodels with the same CVS version. * Model/GMAppKit.m ([NSPopUpButton +createObjectForModelUnarchiver:]): Tidied. ([NSPopUpButton -encodeWithModelArchiver:]): Encode isEnabled, tag, target, action. Code untested. ([NSPopUpButton -initWithModelUnarchiver:]): Bug fix - do not invoke super's implementation. Removed useless call to synchronizeTitleAndSelectedItem. Decode isEnabled, tag, target, action. Tidied. Mon Mar 06 20:09:00 2000 Richard Frith-Macdonald * Headers/gnustep/gui/GSMethodTable.h: Added method to set titlebar. * Headers/gnustep/gui/DPSOperators.h: ditto * Headers/gnustep/gui/NSGraphicsContext.h: ditto * Headers/gnustep/gui/PSOperators.h: ditto * Source/NSGraphicsContext.m: ditto * Source/NSWindow.m: Make calls to DPSsetinputstate() to set the titlebar for the window on change of key/main/normal state. Mon Mar 06 10:36:00 2000 Richard Frith-Macdonald * Source/NSWindow.m: Various tidyups by Fred kiefer and myself. scrapped private class methods for querying window map in favour of more efficient function based lookup. * Source/NSApplication.m: ditto * Source/NSMenu.m: ditto * Source/NSText.m: Tidyups by Fred. * Headers/AppKit/NSText.h: ditto. * Headers/AppKit/NSWindow.h tidyup. * Headers/AppKit/NSGraphics.h new functions. Sun Mar 5 23:39:33 2000 Nicola Pero * Source/NSButtonCell.m ([-setPeriodicDelay:interval:]): Bug fix: do not set the cell as being continuous. This was also causing Model/GMAppKit.m to make all buttoncells continuous upon decoding. * Model/GMAppKit.m ([NSCell -initWithModelUnarchiver:]): Temporary commented out line setting cell's action mask so things go on working. Better solution coming soon. Sun Mar 5 01:51:52 2000 Nicola Pero * Model/GMAppKit.m ([NSPanel -encodeWithModelArchiver:]): Cleaned, simplified by invoking super's implementation; removed all code pertaining to super leaving only the part specific to this subclass. ([NSPanel -initWithModelUnarchiver:]): Idem. ([NSSavePanel -encodeWithModelArchiver:]): Idem. ([NSSavePanel -initWithModelUnarchiver:]): Idem. Sun Mar 5 01:19:21 2000 Nicola Pero * Source/NSMenu.m ([NSMenu -indexOfItem:]): Bug fix: return -1 if the item is not in the menu. This was crashing the popup button on selectItemWithTitle: nil. Sat Mar 4 20:39:02 2000 Nicola Pero * Model/GMAppKit.m ([NSWindow -initWithModelUnarchiver:]): OrderFrontRegardless the window if it is visible, so that visible windows from the main gmodel - which is loaded before the app is activated - are ordered front correctly. This is not yet a complete solution - see comment in the source. Sat Mar 4 18:34:47 2000 Nicola Pero Fixed major problem with creating gmodels from nibs on MACOSX. * Model/GMArchiver.m ([GMArchiver -encodeRect:withName:]): Force the string identifying the rect to be in the OPENSTEP format. MACOSX NSStringFromRect is - incredible - not OPENSTEP compliant, so we don't use NSStringFromRect at all and make it by hand. * Model/GMArchiver.m ([GMArchiver -encodeSize:withName:]): Idem. * Model/GMArchiver.m ([GMArchiver -encodePoint:withName:]): Idem. Sat Mar 04 06:57:00 2000 Richard Frith-Macdonald * Source/NSWindow.m: Patch be Fred Kiefer - switch miniaturize and performMiniatuize methods, make a few other methods conform to MacOS-X spec exactly. Fri Mar 03 05:36:00 2000 Richard Frith-Macdonald * Source/NSMenu.m:([NSMenuWindowTitleView -drawRect:]) fixed to draw contents in bounds rather than given rect. Fri Mar 3 02:25:24 2000 Nicola Pero * Source/NSWindow.m ([-performZoom:]), ([-zoom:]): Added methods with trivial implementation - so that code ported from macosx does not crash. Thu Mar 2 03:16:18 2000 Nicola Pero Added basic support to create and run gmodels from macosx nibs: * Model/GMAppKit.m ([NSApplication -encodeWithModelArchiver:]): Basic patch to allow creation of working gmodel from macosx nibs with menus: do not encode at all the apple specific NSMenuPanel objects. Thanks to raphael_sebbe@mac.com for testing this patch. * Model/GMAppKit.m ([NSImage +createObjectForModelUnarchiver:]): Bug fix: don't crash when decoding images with a nil name. * Source/NSApplication.m ([-setMainMenu:]): In gmodels created from macosx nibs, the windows submenu is called "Window", not "Windows". Patched code to recognize "Window" as identifying the windows submenu too. * Model/GMAppKit.m ([NSImage +createObjectForModelUnarchiver:]): When asked for anything which is not known, return GNUstepMenuImage [and not the radio button image as we did before]. * Images/nsmapping.strings: Added AppleMenuImage, NSMenuArrow, NSMenuCheckMark. * Images/GNUstepMenuImage.tiff: New file obtained by resizing GNUstep.tiff. Anybody with a better understanding of image manipulation feel free to replace GNUstepMenuImage.tiff with a better one. * Images/GNUmakefile: Added GNUstepMenuImage.tiff Wed Mar 01 16:21:00 2000 Richard Frith-Macdonald * Headers/gnustep/gui/NSWindow.h: New style values added for app iconwindow and miniwindows. New ivar added for miniwindow counterpart. New method ([-counterpart]) * Source/NSApplication.m: Create the iconwindow usig the new style. * Source/NSWindow.m: Many modifications to support miniwindow counterparts and create miniwindows when required (when a window is miniaturised). Tue Feb 29 16:34:49 2000 Nicola Pero * Documentation/gsdoc/Introduction.gsdoc: New file - beginning of a short overview/introduction of the GNUstep GUI API. Tue Feb 29 07:04:00 2000 Richard Frith-Macdonald * Source/NSFontManager.m: fixes and tiyups - mostly from Fred Keifer. Mon Feb 28 15:37:00 2000 Richard Frith-Macdonald * Documentation/gsdoc: Added skeleton documentation for the OpenStep/MacOS-X appkit classes in the gsdoc subdirectory. Mon Feb 28 06:42:00 2000 Richard Frith-Macdonald Font fixes - mostly from Fred Keifer. * Source/NSText.m: Use font manager. * Source/NSFontManager.m: some menu improvments. * Source/NSFontPanel.m: Correect setting of font and correct preview code for when there is no 'set' font Fri Feb 25 16:20:00 2000 Richard Frith-Macdonald * Headers/AppKit/NSWindow.h: added has_closed flag * Source/NSWindow.m: made close/deallocation sequence more robust * Source/NSApplication.m: improve removal of windows from menus on close. 2000-02-25 Adam Fedor * Source/NSCursor.m ([NSCursor -setImage:]): Implement. Fri Feb 25 07:07:00 2000 Richard Frith-Macdonald * Source/NSWorkspace.m: Removed a little unused code and fixed a minor portabilitym problem with path usage. Tue Feb 22 17:51:52 2000 Nicola Pero Still much to do in the font classes, but thanks to Fred Kiefer things are starting to work. Contributed by Fred Kiefer : * Headers/AppKit/NSFontManager.h: Fixed typo in ivar name. * Source/NSFontManager.m: More work on this class. * Source/NSFontPanel.m: Almost complete rewrite. * Headers/AppKit/NSFontPanel.h: Idem. Mon Feb 21 14:40:00 2000 Richard Frith-Macdonald * Source/NSWindow.m: ([-close]) remove spurious retain. * Source/NSApplication.m: ([-run]) do startup stuff inside an autorelease pool and release it before main loop. Tue Jan 25 14:52:27 2000 Nicola Pero Contributed by Fred Kiefer: * Source/NSFontManager.m: Almost complete rewrite. * Source/NSFontPanel.m: Begun work of fixing, rewriting. * Headers/AppKit/NSFontManager.h: Corresponding rewrite. * Headers/AppKit/NSFontPanel.h: Idem. 2000-02-17 Adam Fedor * Version: 0.6.5 released. 2000-02-16 Adam Fedor * gnustep-gui.spec: Newfile 2000-02-15 Adam Fedor * configure.in: Fix test for rintf 2000-02-14 Adam Fedor * Version: Update version number * Documentation/announce.tmpl.texi: Update * Documentation/readme.tmpl.texi: Likewise. * Documentation/news.tmpl.texi: Likewise. * Documentation/todo.tmpl.texi: Likewise. * ANNOUNCE, BUGS, NEWS, README: Regenerate Mon Feb 14 13:23:00 2000 Richard Frith-Macdonald * Source/NSLayoutManager.m: Tidied and simplified by removing inefficient scanner class and using NSScanner instead. * Source/NSText.m: ditto. * Source/NSTextView.m: fix a couple of bugs that were causing crash in text network demo - lets the demo run a while longer before crashing. 2000-02-13 Adam Fedor * Source/NSAffineTransform (-transformBezierPath:): Implement. (from Enrico Sersale ). Mon Feb 14 00:59:33 2000 Nicola Pero * Source/NSApplication.m ([-orderFrontStandardAboutPanel:]): Fixed typo/bug. Reported by Fred Kiefer Sun Feb 13 22:24:54 2000 Nicola Pero This fixes a bug; the same bug that produced those little white vertical lines at the bottom of windows with editable textfields when windows were ordered out then in after editing. * Source/NSView.m ([-removeFromSuperviewWithoutNeedingDisplay]), ([-removeFromSuperview]): Ask the window to take first responder status in our place if we are. Important: this is done *before* any other action is undertaken, because changing first responder invokes -resignFirstResponder:, which should be allowed to assume that the view is normally placed in the view hierarchy. Sun Feb 13 19:20:00 2000 Enrico Sersale * Source/NSBezierPath.m: ([-copyWithZone:]) implemented. Sat Feb 12 21:16:00 2000 Nicola Pero * Source/NSBrowser.m ([-loadColumnZero]), ([-reloadColumn:]): Adjust frame of column after loading it. Sat Feb 12 20:27:00 2000 Richard Frith-Macdonald * Source/NSView.m: ([setNeedsDisplayInRect:]) change to ensure that superviews are always marked as needing display when we are. * Source/NSPopUpButton.m: ([-encodeWithCoder:]) ([-initWithCoder:]) implemented for Gorm. Sat Feb 12 19:47:14 2000 Nicola Pero * Source/NSPopUpButton.m ([-selectItem:]): Bug fix: Update menu knowledge of the selected item. ([-selectItemWithTitle:]), ([-selectItemAtIndex:]), ([-selectItem:]): Bug fix: Invoke synchronizeTitleAndSelectedItem to update what is displayed. Sat Feb 12 18:11:32 2000 Nicola Pero * Source/NSWindow.m ([-setContentView:]): When expanding the new content view to cover the whole window, do it using the nice way, resizeWithOldSuperviewSize:, which allows the view to reorganize its subviews for the new size. Sat Feb 12 17:53:00 2000 Richard Frith-Macdonald * Source/NSMenu.m: Replace non-working archiving code with drastically simplified code that does work in the normal case, but doesn't deal with non-standard menu representations. This lets Gorm work with menus. * Source/NSMenuItem.m: Don't archive parent menu. Fri Feb 11 20:18:10 2000 Enrico Sersale * Source/NSBezierPath.m: ([-transformUsingAffineTransform:]) implement. 2000-02-09 Adam Fedor * Documentation/announce.tmpl.texi: Update. * Documentation/news.tmpl.texi: Likewise. * Documentation/readme.tmpl.texi: Likewise. Thu Feb 10 00:56:08 2000 Nicola Pero * Source/NSText.m ([-keyDown:]): Implemented NSDeleteFunctionKey, which was unimplemented - problem reported by Jory van Zessen. Simple superficial improvements to make NSText just a little faster: * Source/NSText.m: Changed everywhere [self selectedRange] simply to selected_range. ([-moveCursorUp:]), ([-moveCursorLeft:]): Return at once if cursor is already at the beginning of text. ([-moveCursorDown:]), ([-moveCursorRight:]): Return at once if cursor is already at the end of text. Wed Feb 09 18:59:02 2000 Enrico Sersale * Source/NSBezierPath.m Headers/gnustep/gui/NSBezierPath.h : Rewritten conforming to MacOS-X implementation details. Tue Feb 8 17:22:05 2000 Nicola Pero * Model/GMAppKit.m ([NSMenuItem -initWithModelUnarchiver:]): Fix for having GNUstep load gmodels created from OPENSTEP NIBs. NSMenu internals are slightly different in GNUstep and OPENSTEP; OPENSTEP stores an item submenu as the item target, while GNUstep stores it in a special mi_submenu ivar. This patch, for GNUstep only, sets the submenu ivar from the target for items which have a submenu. 2000-02-07 Adam Fedor * configure.in: Add check for rintf. * Source/NSBrowser.m: Use rint i no rintf. * Source/NSApplication.m: Convert NSDebugLog to NSDebugLLog for various NSEvent debugs. * Source/NSMenuItemCell.m ([NSMenuItemCell -calcSize]): Make sure anImage exists before getting size (methods with nil receivers returning structs segfaults on Solaris). Mon Feb 7 18:55:29 2000 Nicola Pero * Source/NSMatrix.m ([-mouseDown:]): Pass mouse down to super if we have no cells. Mon Feb 7 03:06:36 2000 Nicola Pero This bug was crashing GNUstep while I was doing experiments with the Save Panel's code. It wasn't easy to find. * Source/NSMatrix.m ([-putCell:atRow:column:]): Fixed bug. If we are putting a new cell precisely in _selectedRow, _selectedColumn, we have to update _selectedCell, otherwise it remains pointing to the released cell! ([-insertRow:withCells:]): Update _selectedRow if needed. ([-insertColumn:withCells:]): Update _selectedColumn if needed. Sun Feb 6 8:52:00 2000 Richard Frith-Macdonald * Source/GSInfoPanel.m: Make newly created panel appear in center of screen. Sun Feb 6 05:50:20 2000 Nicola Pero * Documentation/gnustep-gui.tmpl.texi (Window Manager): Added a tiny section recommending to set "Click Window To Focus" in the window manager configuration. Also, improved the section on the Standard Info Panel. Sat Feb 5 03:02:04 2000 Nicola Pero * Source/NSWindow.m ([-orderWindow:relativeTo:]): Fixed a quite serious bug appearing twice, in two for loops. It was messing window ordering, causing the app to freeze under certain circumstances. Fri Feb 4 18:35:59 2000 Nicola Pero * Source/GSInfoPanel.m ([-initWithDictionary:]): Use Helvetica-Bold instead of Helvetica-BoldOblique [for now]. Thu Feb 3 17:24:00 2000 Richard Frith-Macdonald * Source/NSMenu.m: ([NSMenuWindowTitleView -mouseDown:]) fix memory allocation error when setting new menu location frame info. Thu Feb 3 02:56:10 2000 Enrico Sersale * Source/NSBezierPath.m Partially rewritten, fixed, added a concrete class ([-setCachesBezierPath:]): Implemented using NSImage. Thu Feb 3 03:45:08 2000 Nicola Pero * Source/NSButtonCell.m ([-drawInteriorWithFrame:inView:]): NSImageAbove, NSImageBelow: Rewritten. In these cases now we determine the space taken by the text; then all the remaining space is given to the image, which is centered in it. Thu Feb 3 02:20:29 2000 Nicola Pero * Source/NSButtonCell.m ([-cellSize]): Bug fix: typo would prevent button with both image and text, image above/below text, to size correctly. Wed Feb 2 06:56:33 2000 Nicola Pero With a hack the library is now able to pop up popupbuttons in the right position, correcting at run time bugs in the window frame code. This was hard. * Source/NSPopUpButtonCell.m (_convertBaseToScreen_with_fix): Added private function to do the conversion right, automatically fixing window frame origin bugs. * Source/NSPopUpButtonCell.m ([-attachPopUpWithFrame:inView:]): Use the above mentioned function to perform the coordinate conversion right. * Source/NSPopUpButton.m ([-mouseDown:]): Idem. Tue Feb 1 00:46:42 2000 Nicola Pero * Headers/AppKit/NSMenuItem.h: Removed unused ivar mi_hasSubmenu. * Source/NSMenuItem.m ([-init]): Removed reference to the unused ivar. Mon Jan 31 00:24:17 2000 Nicola Pero Rewritten, fixed, NSPopUpButton appearance. NB: When the button popups in the wrong position, that is a bug elsewhere. * Headers/AppKit/NSMenuItemCell.h: Added ivar _mcell_belongs_to_popupbutton. * Source/NSMenuItemCell.m ([-imageRectForBounds:]): In the special case _mcell_belongs_to_popupbutton == YES and there is an image, draw it at the extreme right. * Source/NSPopUpButtonCell.m: Added private method [NSMenuItemCell -setBelongsToPopUpButton:]. ([+initialize]): Added method. We are now caching the two standard images. ([-addItemWithTitle:]): Simplified. ([-insertItemWithTitle:atIndex:]): Set image position to right, and set cell to belong to popup button. ([-selectItem:]): Invoke setChangesState: NO and set proper image after setting state of any item. ([-selectItemAtIndex:]): Made code readable. ([-drawWithFrame:inView:]): Set background of image. * Source/NSMenuItemCell.m ([-calcSize]): Bug fix: don't move the image to the left if a valid image position has been already set. * Source/NSMenuView.m ([-setMenuItemCell:forItemAtIndex:]): Bug fix: Connect new cell to menuItem and menu so that it works. * Source/NSApplication.m ([-orderFrontStandardAboutPanelWithOptions:]): Display 'Info' in the title. 2000-01-28 Adam Fedor * Source/NSBrowser.m ([NSBrowser -_performLoadOfColumn:]): Don't release columns's columnMatrix, the column will do it. 2000-01-26 Adam Fedor * Source/NSGraphicsContext.m ([NSGraphicsContext +setCurrentContext:]): Retain (assign) the new context (fix suggested by Jonathan Gapen ) * gui/Model/GMAppkit.m ([NSMenuItem -encodeWithModelArchiver:]): Check to see if object responds to various selectors before invoking them. Wed Jan 26 06:50:14 2000 Nicola Pero Fixed mixed state stuff so that it is exactly as in macosx [untested]: * Headers/AppKit/NSCell.h: Turned _cell.state into a normal int; changed NSMixedState to -1. * Source/NSCell.m ([-setState:]): Rewritten, mixed state support. Wed Jan 26 02:03:25 2000 Nicola Pero * Documentation/gnustep-gui.tmpl.texi (Standard Info Panel): Added documentation for [NSApplication -orderFrontInfoPanel:] and [NSApplication -orderFrontInfoPanelWithOptions:]. Mon Jan 24 23:45:30 2000 Nicola Pero Implemented a standard Info Panel for GNUstep. To make everyone happy, both -orderFrontStandardAboutPanel: and -orderFrontStandardInfoPanel: are available; one displays 'About' in the title, and the other displays 'Info'; they are otherwise identical. GNUstep recommends using the 'Info' version. * Source/GNUmakefile (libgnustep-gui_OBJC_FILES): Added GSInfoPanel. (libgnustep-gui_HEADER_FILES): Idem. * Source/GSInfoPanel.m: New class. * Headers/AppKit/GSInfoPanel.h: New class. * Headers/AppKit/NSApplication.h: Added ivar _infoPanel, declaration of new methods. * Source/NSApplication.m ([-orderFrontStandardInfoPanelWithOptions:]): New method, implemented. ([-orderFrontStandardInfoPanel:]): Idem. ([-orderFrontStandardAboutPanel:]): Idem. ([-orderFrontStandardAboutPanelWithOptions:]): Idem. ([-dealloc]): Added release of _infoPanel. Mon Jan 24 04:01:55 2000 Nicola Pero * Source/NSApplication.m ([-orderFrontHelpPanel:]), ([-orderFrontColorPanel:]), ([-orderFrontDataLinkPanel:]), ([-runPageLayout:]): Display an alert panel informing that the corresponding panel has not been implemented yet. 2000-01-21 Adam Fedor * Headers/gnustep/gui/NSGraphicsContext.m: Change NSCompositeData... to NSCompositeDestination... Sat Jan 22 00:23:31 2000 Nicola Pero * Source/NSButtonCell.m ([-_init]): Updated for change in superclass' defaults: set text align to center. Sat Jan 22 00:05:08 2000 Nicola Pero Contributed by Fred Kiefer, with changings of mine: * Source/NSCell.m: Reordered methods. ([+defaultMenu]): New method, void implementation. ([-initTextCell:]): Set default text alignment to NSNaturalTextAlignment. ([-cellSize]): Fixed returned size when cell is of type NSImageCellType but no image set. ([-cellSizeForBounds:]): Semi-implemented. ([-titleRectForBounds:]): Implemented. ([-setType:]): Set standard font and title if of type text, and nil image if of type image [macosx]. ([-allowsMixedState]): New method, implemented. ([-setAllowsMixedState]): New method, implemented. ([-nextState]): New method, implemented. ([-setNextState]): New method, implemented. ([-image]): Return nil if cell is not of type image. ([-hasValidObjectValue]), ([-objectValue]), ([-setObjectValue:]): Added methods but real implementation still to do. ([-takeObjectValueFrom:]): Added method. ([-wraps]), ([-setWraps:]): Implemented [though wrapping is not implemented at all]. ([-setImportsGraphics:]), ([-importsGraphics]), ([-setAllowsEditingTextAttributes:]), ([-attributedStringValue]), ([-setAttributedStringValue:]): Added methods with void implementation. ([-editWithFrame:inView:editor:delegate:event:]): Use titleRectForBounds. ([-selectWithFrame:inView:editor:delegate:event:]): Use titleRectForBounds. ([-setEntryType:]): Set also cell to text type. ([-menu]), ([-menuForEvent:inRect:ofView:]), ([-setMenu:]), ([-setSendsActionOnEndEditing:]), ([-sendsActionOnEndEditing]): ([-formatter]), ([-setFormatter:]): Added method with void implementation. ([-acceptsFirstResponder]): Refined. ([-setMnemonicLocation:]), ([-mnemonic]), ([-mnemonicLocation]), ([-setTitleWithMnemonic:]), ([-showsFirstResponder]), ([-setShowsFirstResponder:]), ([-acceptsFirstResponder]), ([-refusesFirstResponder]), ([-setRefusesFirstResponder:]): Added methods with more or less trivial or void implementations. ([-initWithCoder:]), ([-encodeWithCoder:]): Updated for new bits _cell.allows_mixed_state and _cell.wraps. * Headers/gnustep/gui/NSCell.h: Added wraps and allows_mixed_state bits to the _cell struct. Fri Jan 21 01:22:08 2000 Nicola Pero Contributed by Fred Kiefer, with changings of my own: * Source/NSMatrix.m ([-deselectAllCells]): Bug fix: set _selectedCell to nil and _selectedRow and _selectedColumn to 0. ([-deselectSelectedCell]): Deselect all cells but without redrawing, as in macosx. ([-selectAll:]): Make the selected cell the last cell in the matrix, not the first. ([-selectCellAtRow:column:]): Deselect all cells and redisplay if argument row or column is -1; select text of selected cell if cell selectable. ([-sendDoubleAction]): If the selected cell is disabled, do nothing [macosx]. ([-setSelectionFrom:to:anchor:highlight:]): Moved three lines of code for cleaness; initialize some variables to zero to stop compiler complaints. ([-textDidBeginEditing:]): Pass all the notification user info when posting the new notification. ([-textDidEndEditing:]): Idem. ([-textDidChange:]): Idem, plus send textDidChange: to the selected cell too [macosx]. ([-mouseDown:]): Simplified sending of actions. Fri Jan 21 01:22:08 2000 Nicola Pero * Headers/AppKit/NSCell.h: Added comment to deprecate use of the macosx methods -acceptsFirstResponder, -refusesFirstResponder, -setRefusesFirstResponder:, and to warn about the fact that GNUstep does not have mnemonics in its interface. Fri Jan 21 00:44:37 2000 Nicola Pero Contributed by Fred Kiefer: * Headers/AppKit/NSCell.h: Added the NSCellAttribute NSCellAllowsMixedState as in macosx; added declarations of the macosx methods not in the OpenStep specifications. 2000-01-18 Adam Fedor * Source/NSCachedImageRep.m: Make "ImageCompositing" on by default. * Souce/NSImageRep.m: Likewise. Mon Jan 17 21:15:00 2000 Enrico Sersale * Source/NSBezierPath.m (-elementTypeAtIndex:associatedPoints:]): Changed to set the associatedPoints correctly. Mon Jan 17 6:32:00 1999 Richard Frith-Macdonald * Source/NSBundleAdditions.m: Catch exceptions when loading nib so we simply return YES or NO. Fix suggested by karl@nfox.com Sun Jan 16 8:57:00 1999 Richard Frith-Macdonald * Source/NSWindow.m: Don't log DnD stuff unless NSDragging logging is requested using '--GNU-Debug=NSDragging' Sat Jan 15 11:55:00 1999 Richard Frith-Macdonald * Source/NSBrowser.m: Don't permit scrolling by negative values. Sat Jan 15 07:29:37 2000 Nicola Pero * Source/NSSavePanel.m ([-_initWithoutGModel]): Tidyup for readability; use a NSButton for the application icon. Fri Jan 14 07:03:14 2000 Nicola Pero * Source/NSSliderCell.m ([-isFlipped]): Fixed typo, this method was called 'isFliped'. Fri Jan 14 04:33:21 2000 Nicola Pero Work to improve appearance. * Source/NSBox.m ([-sizeToFit]): More space around title. ([-calcSizesAllowingNegative:]): idem. * Source/NSBrowserCell.m ([-drawInteriorWithFrame:inView:]): Skip 2 points from left border before drawing text. * Source/NSButtonCell.m ([-cellSize]): Changed space between borders and contents if needed; fixed font height. ([-drawInteriorWithFrame:inView:]): When drawing both image and text, add space between image and border. * Source/NSCell.m ([-cellSize]): Fixed font height; removed additional height; added space between border and contents if needed. ([NSCell -editWithFrame:inView:editor:delegate:event:]): Added spacing between border and contents. ([-selectWithFrame:inView:editor:delegate:start:length:]): idem. ([-drawInteriorWithFrame:inView:]): Added spacing between border and contents. * Source/NSFormCell.m ([-cellSize]): Use super's cellSize. ([-cellSize]), ([-drawingRectForBounds:]), ([-drawWithFrame:inView:]): Changed spacing between title and editable field to 3. * Source/NSForm.m ([-initWithFrame:mode:cellClass:numberOfRows:numberOfColumns:]), ([-initWithFrame:mode:prototype:numberOfRows:numberOfColumns:]): Added methods to set the standard interline spacing to 4 during initialization. * Source/NSPanel.m (GSAlertPanel): Added ivar originalSize, updated encoding/decoding methods. ([GSAlertPanel -initWithContentRect:styleMask:backing:defer:screen:]): Fixed autoresizingMask and position of messageField, changed autoresizingMask of titleField to suit our needs. ([GSAlertPanel -setTitle:message:def:alt:other:]): Implemented advanced automatic resizing of buttons and of the panel. All buttons are made of a same size computed to be comfortable for all, and panel is resized whenever needed to display long messages or big buttons. * Source/NSPopUpButtonCell.m ([-drawWithFrame:inView:]): Skip 5 points from left side before drawing text. * Source/NSSavePanel.m ([-_initWithoutGModel]): Fixed heights of buttons and of the form; fixed position of title. Code to have NSForm's editable fields aligned in a row. This was tricky. * Headers/AppKit/NSForm.h: Added ivar _title_width_needs_update. * core/gui/Source/NSForm.m ([-insertEntry:atIndex:]): We observe each added cell for messages _NSFormCellDidChangeTitleWidth. ([-removeEntryAtIndex:]): Remove notification for removed cell. ([-dealloc]): Added method to remove self from notification center. ([-_setTitleWidthNeedsUpdate:]): Added private method invoke by the notification center. ([-drawRect:]): Added method; needs to invoke calcSize if needed before drawing. ([-setValidateSize:]): Added method. ([-calcSize]): Added method. * Headers/AppKit/NSFormCell.h: Changed ivar name; added declaration of notification _NSFormCellDidChangeTitleWidthNotification. * Source/NSFormCell.m ([-initTextCell:]): Minor optimizations. ([-setTitleWidth:]): Fixed bug. ([-calcDrawInfo:]): New method. ([-setTitle:]), ([-setTitleFont:]), ([-setTitleWidth:]): Post notification _NSFormCellDidChangeTitleWidthNotification. ([-initWithCoder:]), ([-encodeWithCoder:]): Implemented. * Source/externs.m: Added _NSFormCellDidChangeTitleWidthNotification. Thu Jan 13 20:37:00 1999 Richard Frith-Macdonald * Source/NSMenu.m: minor tidyups and fixes for Gorm * Source/NSMenuView.m: minor coding fixes * Source/NSBundleAdditions.m: support for setting main menu from nib. Mon Jan 10 00:32:44 2000 Nicola Pero * Headers/AppKit/NSView.h: Prefixed all ivars with underscores; removed old unused ivar. * Source/NSApplication.m: Updated for ivar name change. * Source/NSBox.m: idem. * Source/NSBrowser.m: idem. * Source/NSButton.m: idem. * Source/NSClipView.m: idem. * Source/NSColorWell.m: idem. * Source/NSControl.m: idem. * Source/NSMatrix.m: idem. * Source/NSMenu.m: idem. * Source/NSMenuView.m: idem. * Source/NSPopUpButton.m: idem. * Source/NSProgressIndicator.m: idem. * Source/NSScroller.m: idem. * Source/NSScrollView.m: idem. * Source/NSSlider.m: idem. * Source/NSSplitView.m: idem. * Source/NSTabView.m: idem. * Source/NSTableHeaderView.m: idem. * Source/NSTableView.m: idem. * Source/NSTextField.m: idem. * Source/NSTextView.m: idem. * Source/NSView.m: idem. * Source/NSWindow.m: idem. * Model/GMAppKit.m: idem. * Source/NSApplication.m ([NSAppIconView -drawRect:]): Fixed bug in app icon images drawing. * Source/NSBrowser.m ([-_performLoadOfColumn:]): Tiny tidy ups. * Source/NSColor.m ([+colorFromString:]): Fixed typo. * Source/NSScroller.m ([-drawRect:]): Fixed bug: should fill _bounds, not _frame. * Source/NSTableView.m: Some code added. * Source/NSText.m: Access ivars _frame, _bounds, _window directly. * Source/NSWindow.m ([-sendEvent:]), ([-setFrame:display:]), ([-orderWindow:relativeTo:]), ([-becomeKeyWindow]): Access ivar window_num. * Source/GSTable.m ([-resizeWithOldSuperviewSize:]): Don't access ivar _frame directly, so that the class can be easily ported to other OpenStep implementations. Sun Jan 9 15:20:00 1999 Richard Frith-Macdonald * Source/GSTextStorage.m: ([-attributesAtIndex:effectiveRange:]) fixed illegal parameter - reported by jagapen@whitewater.chem.wisc.edu Sat Jan 8 23:50:38 2000 Nicola Pero * Source/NSColorList.m: Implemented reading available color lists from disk. ([+_loadAvailableColorLists]): New private method to defer scanning of standard directories and loading available color lists till really needed. Related changings and fixes in the whole class. Sat Jan 8 02:40:12 2000 Nicola Pero * Headers/AppKit/NSColorList.h: Prefixed ivars with underscores, changed names. * Source/NSColorList.m: Class rewritten; untested. Fri Jan 7 20:30:00 2000 Richard Frith-Macdonald * Source/NSResponder.m: Changed _rightMouseDisplay to take the event as a parameter. * Source/NSMenu.m: Implemented ([-_rightMouseDisplay:]) with various minor supporting changes. * Source/NSMenuView.m: Lots of messing with mouse tracking in support of right-mouse menu popup and somewhat smoother operation. Fri Jan 7 18:09:15 2000 Nicola Pero * Headers/AppKit/NSBrowser.h: Fixed typo. * Headers/AppKit/NSText.h: Tiny check in enum. * Source/NSCell.m ([-initImageCell:]), ([-initTextCell:]): Minor optimization: do not initialize variables already initialized by allocation. * Headers/AppKit/NSCell.h: Changed _cell.is_enabled to _cell.is_disabled, so that it does not need initialization. * Source/NSActionCell.m ([-setEnabled:]): Updated for the changing. * Source/NSButtonCell.m ([-textColor]): idem. * Source/NSCell.m: idem. * Source/NSComboBoxCell.m ([-_didClick:]): idem. * Source/NSMenuItemCell.m ([-drawTitleWithFrame:inView:]): idem. * Source/NSBrowserCell.m ([-initTextCell:]), ([-initImageCell:]): Further optimization: initialize everything directly without invoking super's initialization; do not initialize variables already initialized by allocation. * Source/NSButtonCell.m ([-_init]): Tiny optm. * Headers/AppKit/NSControl.h: Added ivar _ignoresMultiClick. * Source/NSControl.m ([-setIgnoresMultiClick:]), ([-ignoresMultiClick]): Implemented. ([-mouseDown:]): Added ignoresMultiClick support. * Source/NSCell.m ([-trackMouse:inRect:ofView:untilMouseUp:]): Bug fix: honour the argument of untilMouseUp:. * Source/NSControl.m ([-mouseDown:]): Invoke the cell's +prefersTrackingUntilMouseUp to decide if it's the case to track mouse until up. * Source/NSMatrix.m ([-_mouseDownNonListMode:]), ([-mouseDown:]): Invoke cell mouse tracking with untilMouseUp: NO. * Source/NSMatrix.m ([-sendDoubleAction]): Fixed. ([-sendAction]): Fixed. ([-sendAction:to:]): Use _action, _target. ([-mouseDown:]): Rewritten double/multi-click support. Fri Jan 7 16:40:00 2000 Richard Frith-Macdonald * Source/NSWindow.m: Removed spurious code for setting menu window locations. * Source/NSMenu.m: Implemented 'correct' save/restore of menu locations conforming to MacOS-X implementation details. Fri Jan 7 10:32:00 2000 Richard Frith-Macdonald * Source/Functions.m: NSApplicationMain() added suggestions from karl@nfox.com to destroy application before exit and log if the info file contains an invalid class. Fri Jan 7 8:37:00 2000 Richard Frith-Macdonald * Source/NSApplication.m: ([-finishLoading]) add support for loading main nib. * Source/Functions.m: NSApplicationMain() trivial update to make use of NSPrincipalClass info. Wed Jan 5 20:04:00 2000 Richard Frith-Macdonald * Source/NSMenuView.m: Changes to mouse tracking loop to provide more sophisticated handling of opening/closing of submenus in an attempt to mimic the behavior of NeXTstep. Wed Jan 5 16:27:00 2000 Richard Frith-Macdonald * Source/NSMenuItem.m: minor fixes and tidying. * Source/NSMenuView.m: reverted to previous version - last change broke much more than it fixed. Also tidied coding style a bit and fixed a couple of encode/decode bugs. Mon Jan 3 18:35:00 2000 Richard Frith-Macdonald * Source/NSBundleAdditions.m: Added ([-awakeWithContext:]) method for nib containers to wake up a newly unarchived nib. 2000-01-03 Adam Fedor * Source/NSBitmapImageRep.m ([NSBitmapImageRep -draw]): Use size of image when passing rect to NSDrawBitmap. Sun Jan 2 20:20:00 2000 Richard Frith-Macdonald * Source/NSApplication.m: Fixes for focusm handling. * Source/NSWindow.m: ditto Fri Dec 31 17:28:00 1999 Richard Frith-Macdonald * Source/NSSlider.m: ([drawRect:]) minor drawing fix to ensure that the slider knob is drawn in the correct place. Fri Dec 31 10:49:00 1999 Richard Frith-Macdonald * Source/NSBundleAdditions.m: When decoding nib container, check for a 'NSVisible' array, and order the windows it contains to the front. Wed Dec 29 7:11:00 1999 Richard Frith-Macdonald * Source/NSSliderCell.m: Fix so that setting and taking values from the cell work properly - removed unused ivar. * Headers/AppKit/NSSliderCell.h: removed unused ivar. 1999-12-29 David Lazaro Changed name of function so GNUstep GUI library can be linked again. * Source/tiff.m (NSTiffWrite): Changed name of NSWriteTiff to NSTiffWrite. * Source/libgnustep-gui.def: Same change here. 1999-12-28 Adam Fedor * Source/NSBitmapImageRep.m ([NSBitmapImageRep -initWithBitmapDataPlanes:...]): Move check for opaqueness to here from backend. * Headers/gnustep/gui/DPSOperators.h: New operators colorimage and alphaimage. * Headers/gnustep/gui/NSGraphicsContext.h: Likewise. * Source/NSGraphicsContex.m: Add stubs. * Source/NSBitmapImageRep.m (-draw): Implement using NSDrawBitmap. * Source/NSCachedImageRep.m: Conditional use of PScomposite functions for drawing methods (set user default "ImageCompositing" to YES for this to work). Tue Dec 28 15:58:00 1999 Richard Frith-Macdonald Initial hack of support for encoding/decoding images - untested. * Source/NSBitmapImageRep.m: Code for writing tiffs etc. * Source/NSImage.m: Archiving support and tifying. * Source/NSImageRep.m: Archiving support and tifying. * Source/tiff.m: modifications for compression and for writing. * Headers/gnustep/gui/NSBitmapImageRep.h: tidy and support writing. * Headers/gnustep/gui/NSImage.h: ditto * Headers/gnustep/gui/NSImageRep.h: ditto * Headers/gnustep/gui/nsimage-tiff.h: ditto 1999-12-24 David Lazaro * Source/NSMenuView.m ([NSMenuView -trackWithEvent:]): Added hysteresis to the item selection code. Wed Dec 22 12:04:00 1999 Richard Frith-Macdonald * Source/NSImage.m: When creating an off-screen cache, fill with the background color (so having multiple caches for different backgrounds will work). Set 'NSImageDoesCaching' to 'YES' by default - we do image caching as standard now. Wed Dec 22 10:08:00 1999 Richard Frith-Macdonald * Source/NSWindow.m: ([-sendEvent:]) reset _lastDragView on exit from a view or on completion of dragging operation. This ensures that if you do two drags into the same view, the view gets two draggingEntered messages (one for each session). Wed Dec 22 5:24:00 1999 Richard Frith-Macdonald * Source/NSPanel.m: Fixed image display in alert panel. Tue Dec 21 01:25:00 1999 Enrico Sersale * Added Source/NSBezierPath.m and Headers/AppKit/NSBezierPath.h Mon Dec 20 16:45:00 1999 Richard Frith-Macdonald * Source/NSView.m: Fix removal of view from window such that we reset the windows first responder if any of the removed views in first responder (avoid crash iv views subsequently deallocated). * Source/NSBundleAdditions.m: Removed excess release of bundle data. * Source/NSPanel.m: Call ([-sizeToFit]) for fields in alert panels so they are big enough for their contents. Mon Dec 20 11:00:00 1999 Richard Frith-Macdonald * Source/NSSavePanel.m: Use symbolic constants for resize mask. * Source/NSBrowser.m: size the matrix to fit when it is created. Sat Dec 18 16:05:46 1999 Nicola Pero * Headers/AppKit/NSSplitView.h: Prefixed ivars with underscores; changed widths' type from int to float; removed method -setDividerThickNess:. * Source/NSSplitView.m: Updated for ivar name change; access ivars directly. ([-dividerThickness]): Return 6, our default dividerThickness. ([-setDividerThickness:]): Removed method. Subclasses need to ovverride -dividerThickness to do this (or else use the GNUstep extension -setDimpleImage:resetDividerThickness:). ([-initWithFrame:]): invoke dividerThickness to set the ivar _dividerWidth, used everywhere else when needed. Changed things so that overriding dividerThickness should actually work; untested. ([-initWithCoder:]), ([-encodeWithCoder:]): Fixed. Tempor. commented out lines about encoding/decoding of dimple image (which is anyway a GNUstep extension) till encoding/decoding of images is implemented. Sat Dec 18 5:38:00 1999 Richard Frith-Macdonald * Source/NSView.m: ([-initWithCoder:]) small optimisation and consistency check when decoding and adding subviews. Fri Dec 17 23:44:53 1999 Nicola Pero * Headers/AppKit/NSBox.h: Prefixed ivars with underscores. * Source/NSBox.m: Updated for ivar name change. * Source/NSBox.m ([-initWithCoder:]): Set the first subview as the content view; make sure that _title_rect and _border_rect are automatically computed on decoding. ([-encodeWithCoder:]): Do not encode the content view, which is already encoded by NSView; do not encode title_rect and border_rect. ([-drawRect:]): Tiny semplification. ([-sizeToFit]): Access directly super_view ivar. ([-setFrameFromContentFrame:]): idem. * Source/NSMatrix.m ([-getRow:column:forPoint:]): Bug fix: manage the case of no rows, no columns. * Source/NSSavePanel.m ([-browser:selectCellWithString:inColumn:]): Now that setNeedsDisplay: works, use it instead of display. * Source/NSTextField.m ([-initWithCoder:]): Added setting of delegate. * Source/NSView.m ([-initWithCoder:]): Don't invoke self's -addSubview: to set the subviews, because NSBox overrides that method to do another job. Interesting bit to reflect upon btw. Fri Dec 17 12:03:00 1999 Richard Frith-Macdonald * Source/NSWindow.m: Remove some inefficient code that was calling ([content_view superview]) when we now have the _wv ivar. * Source/NSView.m: Fix another autodisplay problem - when an opaque subview was being set as needing display AND another non-overlapping subview was set for display, the opaque subview didn't get redrawn. * Source/NSPopUpButton.m: removed an NSLog 1999-12-16 Adam Fedor * New RTF parser from Stefan Bðhringer . May not work because of incomplete implementation of NSFontManager and others. * Source/Parsers/attributedStringConsumer.m New file. * Source/Parsers/rtfScanner.c: Likewise. * Source/Parsers/rtfGrammer.y: Likewise. * Source/NSFontManager.m: Stubs for some unimplemented functions. Thu Dec 16 04:09:20 1999 Nicola Pero * Headers/AppKit/NSControl.h: Prefixed ivars with underscore; added declaration of copyWithZone:. * Source/NSControl.m: Updated for change in ivar names; ([-drawCellInside:]): Fixed bug. * Source/NSButton.m: Updated for change in control ivar names. * Source/NSPopUpButton.m: idem. * Source/NSSecureTextField.m: idem. * Source/NSSlider.m: idem. * Source/NSTextField.m: idem. * Source/NSScroller.m ([-drawRect:]): Fill also the space between the knobslot and the frame. * Source/NSScrollView.m: Access ivars bounds, borderType directly. * Source/NSView.m ([-removeFromSuperview]): Access ivar frame directly. Wed Dec 15 17:15:00 1999 Richard Frith-Macdonald * Source/NSCell.m: encode/decode some missing ivars. * Source/NSButtonCell.m: encode/decode some missing ivars. Wed Dec 15 15:25:00 1999 Richard Frith-Macdonald * Source/NSWindow.m: ([-setFrameAutosaveName:]) bugfix for setting a nil name (and removing the old name). * Source/NSMenu.m: ([-close]) close attached menus too. ([-display]) display attached menus too. Wed Dec 15 11:13:00 1999 Richard Frith-Macdonald * Source/NSResponder.m: Don't try to encode/decode next responder - this info should be reconstructed by subclasses. * Source/NSWindow.m: Remove code to save/restore next responder in order to defeat NSResponder archiving. * Source/NSView.m: Rewrite encoding/decoding. Tue Dec 14 19:40:12 1999 Nicola Pero * Source/NSBrowserCell.m: Tiny tidings in initialization; ([-drawInteriorWithFrame:inView:]): Rewritten so that alternateImage is correctly supported. If the cell is of type NSImageCellType, and alternate image is set, it is drawn instead of the standard image when the cell is highlighted. Untested. * Source/NSCell.m ([-_init]): Removed method; code moved to ([-initTextCell:]),([-initImageCell:]); redundancies removed. Tue Dec 14 19:07:00 1999 Richard Frith-Macdonald * Source/NSApplication.m: modal session fixes (and tidying) suggested by georg@mondoshawan.unix.cslab.tuwien.ac.at Tue Dec 14 16:51:00 1999 Richard Frith-Macdonald * Source/NSWindow.m: ([-becomeKeyWindow]) Don't ask the backend to make us key unless we are visible. ([-orderWindow:relativeTo:]) ask backned to make us key when we order in (if we should be key that is). Tue Dec 14 11:15:00 1999 Richard Frith-Macdonald * Headers/AppKit/NSMenuitemCell.h: Removed implementation cache ivars and added an ivar for temporary storage of background color. * Source/NSMenuItemCell.m: Removed draw implementation caching to decrease memory footprint, but added color and image class caching which will more than compensate in performance. Also added use of highlight version of menu arrow. * Source/NSImage.m: minor image caching fixes and more debug statements. 1999-12-13 * Source/NSWindow.m (-_processResizeEvent): Add DPScurrentgstate so DPS server knows we updated the backing buffer. Mon Dec 13 20:00:29 1999 Nicola Pero * Headers/AppKit/NSBrowserCell.h: Removed two ivars. * Source/NSBrowserCell.m: Made allocation/deallocation faster; added untested alternateImage support. Mon Dec 13 16:06:36 1999 Nicola Pero * Headers/AppKit/NSActionCell.h: Added ivar _control_view. * Headers/AppKit/NSBrowserCell.h: Use two bits to store two BOOL. * Headers/AppKit/NSButtonCell.h: Use a bit to store a BOOL. * Headers/AppKit/NSCell.h: Moved ivar _control_view to NSActionCell. Packed more ivars into the bitfield. Added two bits in the bitfield for subclass use. Removed unused ivar _cell_size. * Headers/AppKit/NSFormCell.h: Use a bit to store a BOOL. * Headers/AppKit/NSTextFieldCell.h: Use two bits for two BOOL. * Source/NSActionCell.m ([-drawWithFrame:inView:]): Added method, per spec. * core/gui/Source/NSButtonCell.m: Updated. * Source/NSBrowser.m: Tiny optms in GSBrowserTitleCell. * Source/NSBrowserCell.m: Updated. * Source/NSButtonCell.m: Updated. * Source/NSCell.m ([NSCell -setControlView:]): Removed, this method should not exist. Moved actual implementation of ([-controlView]) to NSActionCell, as per spec. Moved any reference to _control_view to NSActionCell; in ([-performClick:]), invoke [self controlView]. * Source/NSControl.m ([-setCell:]): Updated. * Source/NSFormCell.m: Updated. * Source/NSImageCell.m: idem. * Source/NSMenuItemCell.m: idem. * Source/NSPopUpButtonCell.m: idem. * Source/NSTableHeaderCell.m: idem. * Source/NSTextFieldCell.m: idem. * Headers/AppKit/NSColorWell.h: Removed unused ivar. * Headers/AppKit/NSScroller.h: Removed unused ivar. * Headers/AppKit/NSView.h: Removed unused ivar needs_display. Mon Dec 13 03:51:30 1999 Nicola Pero Cell optimizations: use a bitfield in NSCell to reduce memory consumption; access cell ivars directly while drawing; minor speed tricks here and there for cells; browser cells do not create any longer an auxiliary cell each, thus hugely reducing time and memory required to create browser cells. To my great delight some things are much faster now. * Headers/AppKit/NSActionCell.h: Prefixed all ivars with underscores. * Headers/AppKit/NSBrowserCell.h: Removed unused ivar. * Headers/AppKit/NSButtonCell.h: Prefixed all ivars with underscores; removed unused ivar. * Headers/AppKit/NSCell.h: Introduced a bitfield; prefixed all ivars with underscores. * Headers/AppKit/NSSliderCell.h: Removed unused ivar. * Source/NSActionCell.m: Optimizations. * NSBrowserCell.m: Important optimizations, rewritten. ([-setTextFieldCell:]), ([-setBranchImageCell:]), ([-setHighlightBranchImageCell:]): Removed unused private methods. * Source/NSButtonCell.m: Updated. * Source/NSCell.m: Important optimizations. * Source/NSComboBoxCell.m: Updated. * Source/NSFormCell.m: Optimizations. * Source/NSImageCell.m: Optimizations. * Source/NSMenuItemCell.m: Updated. * Source/NSPopUpButtonCell.m: Updated; ([-dismissPopUp]): Use GNUstep close menu method. * Source/NSSliderCell.m: Tiny optimization. * Source/NSTableHeaderCell.m: Updated. * Source/NSTextFieldCell.m: Updated. * Source/NSBox.m: Updated for new way of getting border sizes. * Source/NSBrowser.m: idem. * Source/NSSlider.m: Minor optimization. gnustep-gui-0.24.0/Resources/0000775000076500007650000000000012256227325015722 5ustar brains99brains99gnustep-gui-0.24.0/Resources/Esperanto.lproj/0000775000076500007650000000000012256227325021007 5ustar brains99brains99gnustep-gui-0.24.0/Resources/Esperanto.lproj/Localizable.strings0000664000076500007650000004443412235010125024635 0ustar brains99brains99/* Translator: Ingolf Jandt, * Date: April 2006 */ /*** Esperanto.lproj/Localizable.strings updated by make_strings 2013-10-28 21:50:27 +0100 add comments above this one ***/ /*** Keys found in multiple places ***/ /* File: ../Source/GSPrintOperation.m:157 */ /* File: ../Source/NSSavePanel.m:1381 */ /* File: ../Source/NSSavePanel.m:1392 */ "Dismiss" = "Forĵetu"; /* File: ../Source/GSNibLoading.m:182 */ /* Comment: Info */ /* Flag: untranslated */ /* File: ../Source/NSApplication.m:2878 */ /* Comment: Title of the Info Panel */ /* File: ../Source/NSMenu.m:236 */ /* Comment: Info */ /* Flag: unmatched */ /* File: ../Source/NSMenu.m:259 */ /* Flag: untranslated */ /* File: ../Source/NSMenu.m:302 */ /* Comment: Info */ /* Flag: unmatched */ "Info" = "Info"; /* File: ../Source/GSNibLoading.m:165 */ /* Comment: Quit */ /* Flag: untranslated */ /* File: ../Source/NSApplication.m:3442 */ /* File: ../Source/NSApplication.m:4207 */ /* Flag: untranslated */ /* File: ../Source/NSDocumentController.m:1049 */ "Quit" = "Finu"; /* File: ../Source/NSAlert.m:384 */ /* Flag: untranslated */ /* File: ../Source/NSDocument.m:474 */ /* File: ../Source/NSDocument.m:815 */ /* File: ../Source/NSDocument.m:1660 */ /* File: ../Source/NSDocumentController.m:955 */ /* File: ../Source/NSDocumentController.m:987 */ /* Flag: untranslated */ /* File: ../Source/NSSavePanel.m:318 */ /* File: ../Source/NSSavePanel.m:1330 */ /* Flag: untranslated */ /* File: ../Source/NSSavePanel.m:1403 */ /* Flag: untranslated */ "Cancel" = "Rezignu"; /* File: ../Source/NSDocument.m:474 */ /* File: ../Source/NSDocument.m:815 */ /* File: ../Source/NSDocument.m:1183 */ /* File: ../Source/NSSavePanel.m:435 */ /* File: ../Source/NSSavePanel.m:1327 */ /* File: ../Source/NSSavePanel.m:1366 */ /* File: ../Source/NSSavePanel.m:1379 */ /* File: ../Source/NSSavePanel.m:1390 */ /* Flag: untranslated */ /* File: ../Source/NSSavePanel.m:1401 */ /* Flag: untranslated */ "Save" = "Konservu"; /* File: ../Source/NSDocument.m:1179 */ /* File: ../Source/NSSavePanel.m:855 */ /* Flag: unmatched */ "Save As" = "Konservu kiel"; /* File: ../Source/NSDocument.m:1658 */ /* File: ../Source/NSDocument.m:1660 */ /* File: ../Source/NSFontPanel.m:696 */ /* Flag: untranslated */ "Revert" = "Malfaru"; /* File: ../Source/GSPrintOperation.m:155 */ /* File: ../Source/NSFontPanel.m:706 */ /* Flag: untranslated */ "Preview" = "AntaÅ­viso"; /* File: ../Source/GSHelpManagerPanel.m:101 */ /* Flag: untranslated */ /* File: ../Source/NSAlert.m:1830 */ /* File: ../Source/NSPrintOperation.m:678 */ /* Flag: untranslated */ /* File: ../Source/NSPrintPanel.m:408 */ /* Flag: untranslated */ /* File: ../Source/NSSavePanel.m:334 */ /* Flag: untranslated */ "OK" = "OK"; /* File: ../Source/Functions.m:85 */ /* Flag: untranslated */ /* File: ../Source/NSApplication.m:951 */ /* Flag: unmatched */ "Cannot load the main model file '%@'" = "Malpovas ÅarÄi Åefan model-dosieron '%@'"; /* File: ../Source/NSAlert.m:389 */ /* Flag: untranslated */ /* File: ../Source/NSDocument.m:474 */ "Don't Save" = "Forĵetu"; /* File: ../Source/NSDocumentController.m:963 */ /* File: ../Source/NSDocumentController.m:1013 */ /* Flag: untranslated */ "You have unsaved documents" = "Vi havas malkonservitajn dokumentojn"; /* File: ../Source/NSDocumentController.m:964 */ /* File: ../Source/NSDocumentController.m:1006 */ /* Flag: untranslated */ "Review Unsaved" = "Rigardu ree"; /* File: ../Source/NSDocumentController.m:966 */ /* File: ../Source/NSDocumentController.m:1008 */ /* Flag: untranslated */ "Quit Anyway" = "Tamen finu"; /* File: ../Source/GSCharacterPanel.m:154 */ /* Flag: untranslated */ /* File: ../Source/NSFontPanel.m:738 */ /* Flag: untranslated */ "Character Panel" = "Character Panel"; /* File: ../Source/GSCharacterPanel.m:173 */ /* Flag: untranslated */ /* File: ../Source/NSPageLayout.m:959 */ /* Flag: untranslated */ "Name" = "Name"; /* File: ../Source/GSHelpManagerPanel.m:70 */ /* Flag: untranslated */ /* File: ../Source/NSHelpPanel.m:154 */ /* Flag: untranslated */ "Help" = "Help"; /* File: ../Source/GSInfoPanel.m:187 */ /* Flag: untranslated */ /* File: ../Source/GSInfoPanel.m:482 */ /* Flag: untranslated */ "Current theme" = "Current theme"; /* File: ../Source/GSTextFinder.m:332 */ /* Flag: untranslated */ /* File: ../Source/GSTextFinder.m:381 */ /* Flag: untranslated */ "Not found" = "Not found"; /* File: ../Source/GSThemePanel.m:193 */ /* Flag: untranslated */ /* File: ../Source/GSThemePanel.m:234 */ /* Flag: untranslated */ "Revert default theme" = "Revert default theme"; /* File: ../Source/GSThemePanel.m:197 */ /* Flag: untranslated */ /* File: ../Source/GSThemePanel.m:229 */ /* Flag: untranslated */ "Make this the default theme" = "Make this the default theme"; /* File: ../Source/NSAttributedString.m:1060 */ /* Comment: Error description */ /* Flag: untranslated */ /* File: ../Source/NSAttributedString.m:1083 */ /* Comment: Error description */ /* Flag: untranslated */ "Could not create data for type." = "Could not create data for type."; /* File: ../Source/NSColorPanel.m:245 */ /* Flag: untranslated */ /* File: ../Source/NSToolbarItem.m:1076 */ /* Flag: untranslated */ "Colors" = "Colors"; /* File: ../Source/NSDocument.m:1109 */ /* Flag: untranslated */ /* File: ../Source/NSPrintPanel.m:350 */ /* Flag: untranslated */ "File Type" = "File Type"; /* File: ../Source/NSPageLayout.m:739 */ /* Flag: untranslated */ /* File: ../Source/NSPageLayout.m:741 */ /* Flag: untranslated */ "(none)" = "(none)"; /* File: ../Source/NSPageLayout.m:967 */ /* Flag: untranslated */ /* File: ../Source/NSPageLayout.m:1038 */ /* Flag: untranslated */ /* File: ../Source/NSPrintPanel.m:630 */ /* Flag: untranslated */ /* File: ../Source/NSPrintPanel.m:676 */ /* Flag: untranslated */ "Unknown" = "Unknown"; /* File: ../Source/NSPrintPanel.m:643 */ /* Flag: untranslated */ /* File: ../Source/NSPrintPanel.m:774 */ /* Flag: untranslated */ /* File: ../Source/NSPrintPanel.m:781 */ /* Flag: untranslated */ "Manual" = "Manual"; /* File: ../Source/NSSavePanel.m:251 */ /* Flag: untranslated */ /* File: ../Source/NSSavePanel.m:434 */ /* Flag: untranslated */ "Name:" = "Name:"; /* File: ../Source/NSSavePanel.m:1315 */ /* Flag: untranslated */ /* File: ../Source/NSSavePanel.m:1323 */ /* Flag: untranslated */ "Use .%@" = "Use .%@"; /*** Unmatched/untranslated keys ***/ /* File: ../Source/GSCharacterPanel.m:182 */ /* Flag: untranslated */ "Code Point" = "Code Point"; /* File: ../Source/GSCharacterPanel.m:191 */ /* Flag: untranslated */ "Unicode Block" = "Unicode Block"; /* File: ../Source/GSInfoPanel.m:339 */ /* Flag: untranslated */ "Release: " = "Release: "; /* File: ../Source/GSInfoPanel.m:396 */ /* Flag: untranslated */ "Copyright Information Not Available" = "Copyright Information Not Available"; /* File: ../Source/GSInfoPanel.m:451 */ /* Flag: untranslated */ "Author: " = "Author: "; /* File: ../Source/GSInfoPanel.m:455 */ /* Flag: untranslated */ "Authors: " = "Authors: "; /* File: ../Source/GSTextFinder.m:408 */ /* Flag: untranslated */ "%d replaced" = "%d replaced"; /* File: ../Source/GSThemeDrawing.m:188 */ /* Flag: untranslated */ "?" = "?"; /* File: ../Source/GSThemeInspector.m:141 */ /* Flag: untranslated */ "Version: %@" = "Version: %@"; /* File: ../Source/GSThemePanel.m:115 */ /* Flag: untranslated */ "Themes" = "Themes"; /* File: ../Source/GSToolbarView.m:894 */ /* Flag: untranslated */ "Customize Toolbar" = "Customize Toolbar"; /* File: ../Source/NSAlert.m:2000 */ /* Flag: untranslated */ "Alert" = "Alert"; /* File: ../Source/NSAlert.m:2001 */ /* Flag: untranslated */ "No information" = "No information"; /* File: ../Source/NSApplication.m:304 */ /* Flag: unmatched */ "Can't find backend context" = "Malpovas trovi backend-kontekston"; /* File: ../Source/NSApplication.m:4197 */ /* Flag: untranslated */ "Show" = "Show"; /* File: ../Source/NSApplication.m:4203 */ /* Flag: untranslated */ "Hide" = "Hide"; /* File: ../Source/NSAttributedString.m:762 */ /* Comment: Error description */ /* Flag: untranslated */ "No data specified for data loading." = "No data specified for data loading."; /* File: ../Source/NSAttributedString.m:863 */ /* Comment: Error description */ /* Flag: untranslated */ "Could not load data." = "Could not load data."; /* File: ../Source/NSAttributedString.m:927 */ /* Comment: Error description */ /* Flag: untranslated */ "Could not load data from URL." = "Could not load data from URL."; /* File: ../Source/NSAttributedString.m:1033 */ /* Comment: Error description */ /* Flag: untranslated */ "No type specified for data." = "No type specified for data."; /* File: ../Source/NSColorPanel.m:309 */ /* Flag: untranslated */ "Opacity" = "Opacity"; /* File: ../Source/NSColorSpace.m:137 */ /* Comment: color space */ /* Flag: untranslated */ "unknown" = "unknown"; /* File: ../Source/NSColorSpace.m:139 */ /* Comment: color space */ /* Flag: untranslated */ "Grayscale" = "Grayscale"; /* File: ../Source/NSColorSpace.m:141 */ /* Comment: color space */ /* Flag: untranslated */ "RGB" = "RGB"; /* File: ../Source/NSColorSpace.m:143 */ /* Comment: color space */ /* Flag: untranslated */ "CMYK" = "CMYK"; /* File: ../Source/NSColorSpace.m:145 */ /* Comment: color space */ /* Flag: untranslated */ "LAB" = "LAB"; /* File: ../Source/NSColorSpace.m:147 */ /* Comment: color space */ /* Flag: untranslated */ "DeviceN" = "DeviceN"; /* File: ../Source/NSDocumentController.m:1692 */ /* Flag: untranslated */ "Clear List" = "Clear List"; /* File: ../Source/NSFontPanel.m:241 */ /* Flag: untranslated */ "Multiple fonts selected" = "Multiple fonts selected"; /* File: ../Source/NSFontPanel.m:553 */ /* Flag: untranslated */ "Font Panel" = "Font Panel"; /* File: ../Source/NSFontPanel.m:578 */ /* Flag: untranslated */ "Font preview" = "Font preview"; /* File: ../Source/NSFontPanel.m:639 */ /* Flag: untranslated */ "Size" = "Size"; /* File: ../Source/NSFontPanel.m:719 */ /* Flag: untranslated */ "Set" = "Set"; /* File: ../Source/NSFontPanel.m:810 */ /* Flag: untranslated */ "NoFamily" = "NoFamily"; /* File: ../Source/NSFontPanel.m:818 */ /* Flag: untranslated */ "NoFace" = "NoFace"; /* File: ../Source/NSFontPanel.m:1138 */ /* Flag: untranslated */ "Family" = "Family"; /* File: ../Source/NSFontPanel.m:1142 */ /* Flag: untranslated */ "Typeface" = "Typeface"; /* File: ../Source/NSMenu.m:260 */ /* Flag: untranslated */ "Services" = "Services"; /* File: ../Source/NSOpenPanel.m:92 */ /* Flag: untranslated */ "Open" = "Open"; /* File: ../Source/NSPageLayout.m:960 */ /* Flag: untranslated */ "Dimensions" = "Dimensions"; /* File: ../Source/NSPageLayout.m:961 */ /* Flag: untranslated */ "Orientation" = "Orientation"; /* File: ../Source/NSPageLayout.m:962 */ /* Flag: untranslated */ "Scale" = "Scale"; /* File: ../Source/NSPageLayout.m:963 */ /* Flag: untranslated */ "Top Margin" = "Top Margin"; /* File: ../Source/NSPageLayout.m:964 */ /* Flag: untranslated */ "Bottom Margin" = "Bottom Margin"; /* File: ../Source/NSPageLayout.m:965 */ /* Flag: untranslated */ "Left Margin" = "Left Margin"; /* File: ../Source/NSPageLayout.m:966 */ /* Flag: untranslated */ "Right Margin" = "Right Margin"; /* File: ../Source/NSPageLayout.m:1016 */ /* Flag: untranslated */ "Portrait" = "Portrait"; /* File: ../Source/NSPageLayout.m:1020 */ /* Flag: untranslated */ "Landscape" = "Landscape"; /* File: ../Source/NSPrintOperation.m:677 */ /* Flag: untranslated */ "Error" = "Error"; /* File: ../Source/NSPrintOperation.m:677 */ /* Flag: untranslated */ "Printing error: %@" = "Printing error: %@"; /* File: ../Source/NSPrintPanel.m:145 */ /* Flag: untranslated */ "Print Panel" = "Print Panel"; /* File: ../Source/NSPrintPanel.m:179 */ /* Flag: untranslated */ "1 up" = "1 up"; /* File: ../Source/NSPrintPanel.m:179 */ /* Flag: untranslated */ "2 up" = "2 up"; /* File: ../Source/NSPrintPanel.m:179 */ /* Flag: untranslated */ "4 up" = "4 up"; /* File: ../Source/NSPrintPanel.m:179 */ /* Flag: untranslated */ "6 up" = "6 up"; /* File: ../Source/NSPrintPanel.m:180 */ /* Flag: untranslated */ "8 up" = "8 up"; /* File: ../Source/NSPrintPanel.m:407 */ /* Flag: untranslated */ "Sorry" = "Sorry"; /* File: ../Source/NSPrintPanel.m:407 */ /* Flag: untranslated */ "Faxing of print file not implemented" = "Faxing of print file not implemented"; /* File: ../Source/NSSavePanel.m:242 */ /* Flag: untranslated */ "Show Hidden Files" = "Show Hidden Files"; /* File: ../Source/NSSavePanel.m:277 */ /* Flag: untranslated */ "Home" = "Home"; /* File: ../Source/NSSavePanel.m:293 */ /* Flag: untranslated */ "Mount" = "Mount"; /* File: ../Source/NSSavePanel.m:309 */ /* Flag: untranslated */ "Unmount" = "Unmount"; /* File: ../Source/NSSavePanel.m:1314 */ /* Flag: untranslated */ "You have used the extension '.%@'.\nThe standard extension is '.%@'.'" = "You have used the extension '.%@'.\nThe standard extension is '.%@'.'"; /* File: ../Source/NSSavePanel.m:1322 */ /* Flag: untranslated */ "You cannot save this document with extension '.%@'.\nThe required extension is '.%@'." = "You cannot save this document with extension '.%@'.\nThe required extension is '.%@'."; /* File: ../Source/NSSavePanel.m:1794 */ /* Flag: untranslated */ "Reading Directory " = "Reading Directory "; /* File: ../Source/NSSpellChecker.m:731 */ /* Flag: untranslated */ "Guess" = "Guess"; /* File: ../Source/NSTextView.m:651 */ /* Flag: untranslated */ "Cut" = "Cut"; /* File: ../Source/NSTextView.m:652 */ /* Flag: untranslated */ "Copy" = "Copy"; /* File: ../Source/NSTextView.m:653 */ /* Flag: untranslated */ "Paste" = "Paste"; /* File: ../Source/NSTextView.m:5894 */ /* Flag: untranslated */ "No Suggestions" = "No Suggestions"; /* File: ../Source/NSToolbarItem.m:949 */ /* Flag: untranslated */ "Separator" = "Separator"; /* File: ../Source/NSToolbarItem.m:991 */ /* Flag: untranslated */ "Space" = "Space"; /* File: ../Source/NSToolbarItem.m:1021 */ /* Flag: untranslated */ "Flexible Space" = "Flexible Space"; /* File: ../Source/NSToolbarItem.m:1099 */ /* Flag: untranslated */ "Fonts" = "Fonts"; /* File: ../Source/NSToolbarItem.m:1122 */ /* Flag: untranslated */ "Customize" = "Customize"; /* File: ../Source/NSToolbarItem.m:1145 */ /* Flag: untranslated */ "Print..." = "Print..."; /* File: ../Source/NSWindow.m:5317 */ /* Flag: untranslated */ "Hide Toolbar" = "Hide Toolbar"; /* File: ../Source/NSWindow.m:5319 */ /* Flag: untranslated */ "Show Toolbar" = "Show Toolbar"; /*** Strings from ../Source/GSPrintOperation.m ***/ /* File: ../Source/GSPrintOperation.m:156 */ "Problem running the preview application '%@' perhaps you need to set your NSPreviewApp user default" = "Problemo ruli antaÅ­montrilon '%@'. Eble la 'default'-agordo NSPreviewApp devas ÄustiÄi"; /*** Strings from ../Source/NSApplication.m ***/ /* File: ../Source/NSApplication.m:138 */ "Abort" = "Rezignu"; /* File: ../Source/NSApplication.m:323 */ "Backend at path %@ doesn't contain the GSBackend class" = "Back-end ĉe %@ ne enhavas GSBackend-klason"; /* File: ../Source/NSApplication.m:311 */ "Can't create NSBundle object for backend at path %@" = "Malpovas kreari NSBundle-objekton por back-end ĉe %@"; /* File: ../Source/NSApplication.m:316 */ "Can't load object file from backend at path %@" = "Malpovas ÅarÄi objekt-dosieron ĉe %@"; /* File: ../Source/NSApplication.m:135 */ "Critical Error in %@" = "Krita eraro en %@"; /* File: ../Source/NSApplication.m:141 */ "Debug" = "Erarserĉu"; /* File: ../Source/NSApplication.m:1198 */ "Problem during launch app notification: %@" = "Problemo dum lanĉo de app-notifiko: %@"; /* File: ../Source/NSApplication.m:304 */ "Unable to find backend %@" = "Ne trovis back-end %@"; /* File: ../Source/NSApplication.m:972 */ "[NSApplication -init] called more than once" = "[NSApplication -init] vokiÄis plurfoje"; /* File: ../Source/NSApplication.m:3315 */ "reported exception - %@" = "raportis escepton - %@"; /*** Strings from ../Source/NSBitmapImageRep.m ***/ /* File: ../Source/NSBitmapImageRep.m:1645 */ "CCITTFAX3 Compression" = "CCITTFAX3-kunpremado"; /* File: ../Source/NSBitmapImageRep.m:1646 */ "CCITTFAX4 Compression" = "CCITTFAX4-kunpremado"; /* File: ../Source/NSBitmapImageRep.m:1648 */ "JPEG Compression" = "JPEG-kunpremado"; /* File: ../Source/NSBitmapImageRep.m:1647 */ "LZW Compression" = "LZW-kunpremado"; /* File: ../Source/NSBitmapImageRep.m:1649 */ "NEXT Compression" = "NEXT-kunpremado"; /* File: ../Source/NSBitmapImageRep.m:1644 */ "No Compression" = "Neniu kunpremado"; /* File: ../Source/NSBitmapImageRep.m:1651 */ "Old JPEG Compression" = "malnova JPEG-kunpremado"; /* File: ../Source/NSBitmapImageRep.m:1650 */ "PackBits Compression" = "PackBits-kunpremado"; /*** Strings from ../Source/NSDocument.m ***/ /* File: ../Source/NSDocument.m:1659 */ "%@ has been edited. Are you sure you want to undo changes?" = "%@ redaktiÄis. Ĉu vi certas ke vi volas malfari Åangojn?"; /* File: ../Source/NSDocument.m:473 */ "%@ has changed. Save?" = "%@ ÅanÄiÄis. Konservu?"; /* File: ../Source/NSDocument.m:814 */ "Can't create backup file. Save anyways?" = "Malpovas krei savkopian dosieron. Tamen konservu?"; /* File: ../Source/NSDocument.m:472 */ "Close" = "Fermu"; /* File: ../Source/NSDocument.m:142 */ "Could not load URL %@." = "Malpovas ÅarÄi URL %@."; /* File: ../Source/NSDocument.m:119 */ "Could not load file %@." = "Malpovas ÅarÄi dosieron %@."; /* File: ../Source/NSDocument.m:813 */ "File Error" = "Dosiera eraro"; /* File: ../Source/NSDocument.m:141 */ /* File: ../Source/NSDocument.m:118 */ "Load failed" = "ÅœarÄi malsukcesis"; /* File: ../Source/NSDocument.m:1180 */ "Save To" = "Konservu ĉe"; /* File: ../Source/NSDocument.m:569 */ "Untitled-%d" = "malnomita-%d"; /*** Strings from ../Source/NSDocumentController.m ***/ /* File: ../Source/NSDocumentController.m:1056 */ "Power Off" = "MalÅaltu"; /*** Strings from ../Source/NSSavePanel.m ***/ /* File: ../Source/NSSavePanel.m:1368 */ "No" = "Ne"; /* File: ../Source/NSSavePanel.m:1403 */ "Replace" = "Anstatauigu"; /* File: ../Source/NSSavePanel.m:1380 */ "The directory '%@' could not be created." = "La dosierujo '%@' ne povis kreiÄi."; /* File: ../Source/NSSavePanel.m:1367 */ "The directory '%@' does not exist, do you want to create it?" = "La dosierujo '%@' ne ekzistas. Ĉu vi volas krej Äin?"; /* File: ../Source/NSSavePanel.m:1402 */ "The file '%@' in '%@' exists. Replace it?" = "La dosiero '%@' en '%@' jam eksistas. AnstataÅ­iÄu?"; /* File: ../Source/NSSavePanel.m:1391 */ "The path '%@' is not a directory." = "'%@' ne estas dosierujo."; /* File: ../Source/NSSavePanel.m:1368 */ "Yes" = "Jes"; gnustep-gui-0.24.0/Resources/German.lproj/0000775000076500007650000000000012256227325020260 5ustar brains99brains99gnustep-gui-0.24.0/Resources/German.lproj/Localizable.strings0000664000076500007650000004107412235010125024103 0ustar brains99brains99/* Translator: Ingolf Jandt * Date: April 2006 * Translator: Fred Kiefer * Date: Febuary 2009 * Additional translations: Wolfgang Lux * Date: January 2011 */ /*** German.lproj/Localizable.strings updated by make_strings 2013-10-28 21:49:54 +0100 add comments above this one ***/ /*** Keys found in multiple places ***/ /* File: ../Source/GSPrintOperation.m:157 */ /* File: ../Source/NSSavePanel.m:1381 */ /* File: ../Source/NSSavePanel.m:1392 */ "Dismiss" = "Verwerfen"; /* File: ../Source/GSNibLoading.m:182 */ /* Comment: Info */ /* File: ../Source/NSApplication.m:2878 */ /* Comment: Title of the Info Panel */ /* File: ../Source/NSMenu.m:259 */ "Info" = "Information"; /* File: ../Source/GSNibLoading.m:165 */ /* Comment: Quit */ /* File: ../Source/NSApplication.m:3442 */ /* File: ../Source/NSApplication.m:4207 */ /* File: ../Source/NSDocumentController.m:1049 */ "Quit" = "Beenden"; /* File: ../Source/NSDocument.m:474 */ /* File: ../Source/NSDocument.m:815 */ /* File: ../Source/NSDocument.m:1183 */ /* File: ../Source/NSSavePanel.m:435 */ /* File: ../Source/NSSavePanel.m:1327 */ /* File: ../Source/NSSavePanel.m:1366 */ /* File: ../Source/NSSavePanel.m:1379 */ /* File: ../Source/NSSavePanel.m:1390 */ /* File: ../Source/NSSavePanel.m:1401 */ "Save" = "Speichern"; /* File: ../Source/NSAlert.m:384 */ /* File: ../Source/NSDocument.m:474 */ /* File: ../Source/NSDocument.m:815 */ /* File: ../Source/NSDocument.m:1660 */ /* File: ../Source/NSDocumentController.m:955 */ /* File: ../Source/NSDocumentController.m:987 */ /* File: ../Source/NSSavePanel.m:318 */ /* File: ../Source/NSSavePanel.m:1330 */ /* File: ../Source/NSSavePanel.m:1403 */ "Cancel" = "Abbrechen"; /* File: ../Source/GSHelpManagerPanel.m:101 */ /* File: ../Source/NSAlert.m:1830 */ /* File: ../Source/NSPrintOperation.m:678 */ /* File: ../Source/NSPrintPanel.m:408 */ /* File: ../Source/NSSavePanel.m:334 */ "OK" = "Ok"; /* File: ../Source/NSAlert.m:389 */ /* File: ../Source/NSDocument.m:474 */ "Don't Save" = "Nicht speichern"; /* File: ../Source/GSPrintOperation.m:155 */ /* File: ../Source/NSFontPanel.m:706 */ "Preview" = "Vorschau"; /* File: ../Source/NSDocument.m:1658 */ /* File: ../Source/NSDocument.m:1660 */ /* File: ../Source/NSFontPanel.m:696 */ "Revert" = "Zur\U00FCcksetzen"; /* File: ../Source/NSColorPanel.m:245 */ /* File: ../Source/NSToolbarItem.m:1076 */ "Colors" = "Farben"; /* File: ../Source/NSPageLayout.m:967 */ /* File: ../Source/NSPageLayout.m:1038 */ /* File: ../Source/NSPrintPanel.m:630 */ /* File: ../Source/NSPrintPanel.m:676 */ "Unknown" = "Unbekannt"; /* File: ../Source/GSHelpManagerPanel.m:70 */ /* File: ../Source/NSHelpPanel.m:154 */ "Help" = "Hilfe"; /* File: ../Source/NSDocument.m:1109 */ /* File: ../Source/NSPrintPanel.m:350 */ "File Type" = "Dateityp"; /* File: ../Source/GSCharacterPanel.m:173 */ /* File: ../Source/NSPageLayout.m:959 */ "Name" = "Name"; /* File: ../Source/GSCharacterPanel.m:154 */ /* File: ../Source/NSFontPanel.m:738 */ "Character Panel" = "Zeichenauswahl"; /*** Unmatched/untranslated keys ***/ /* File: ../Source/NSPrintPanel.m:179 */ /* Flag: untranslated */ "2 up" = "2 up"; /* File: ../Source/NSPrintPanel.m:179 */ /* Flag: untranslated */ "4 up" = "4 up"; /* File: ../Source/NSPrintPanel.m:179 */ /* Flag: untranslated */ "6 up" = "6 up"; /* File: ../Source/NSPrintPanel.m:179 */ /* Flag: untranslated */ "1 up" = "1 up"; /* File: ../Source/NSPrintPanel.m:180 */ /* Flag: untranslated */ "8 up" = "8 up"; /* File: ../Source/NSSavePanel.m:277 */ /* Flag: untranslated */ "Home" = "Home"; /* File: ../Source/NSSavePanel.m:293 */ /* Flag: untranslated */ "Mount" = "Mount"; /* File: ../Source/NSSavePanel.m:309 */ /* Flag: untranslated */ "Unmount" = "Unmount"; /*** Strings from ../Source/Functions.m ***/ /* File: ../Source/Functions.m:85 */ "Cannot load the main model file '%@'" = "Kann Haupt-Model-Datei \U00BB%@\U00AB nicht laden"; /*** Strings from ../Source/GSCharacterPanel.m ***/ /* File: ../Source/GSCharacterPanel.m:182 */ "Code Point" = "Code Point"; /* File: ../Source/GSCharacterPanel.m:191 */ "Unicode Block" = "Unicode Block"; /*** Strings from ../Source/GSInfoPanel.m ***/ /* File: ../Source/GSInfoPanel.m:451 */ "Author: " = "Autor: "; /* File: ../Source/GSInfoPanel.m:455 */ "Authors: " = "Autoren: "; /* File: ../Source/GSInfoPanel.m:396 */ "Copyright Information Not Available" = "Copyright Information nicht verf\U00FCgbar"; /* File: ../Source/GSInfoPanel.m:482 */ /* File: ../Source/GSInfoPanel.m:187 */ "Current theme" = "Aktuelles Thema"; /* File: ../Source/GSInfoPanel.m:339 */ "Release: " = "Release: "; /*** Strings from ../Source/GSPrintOperation.m ***/ /* File: ../Source/GSPrintOperation.m:156 */ "Problem running the preview application '%@' perhaps you need to set your NSPreviewApp user default" = "Vorschau-Anwendung \U00BB%@\U00AB kann nicht ausgef\U00FChrt werden. Vielleicht muss der Default-Eintrag NSPreviewApp gesetzt werden"; /*** Strings from ../Source/GSTextFinder.m ***/ /* File: ../Source/GSTextFinder.m:408 */ "%d replaced" = "%d ersetzt"; /* File: ../Source/GSTextFinder.m:381 */ /* File: ../Source/GSTextFinder.m:332 */ "Not found" = "Nicht gefunden"; /*** Strings from ../Source/GSThemeDrawing.m ***/ /* File: ../Source/GSThemeDrawing.m:188 */ "?" = "?"; /*** Strings from ../Source/GSThemeInspector.m ***/ /* File: ../Source/GSThemeInspector.m:141 */ "Version: %@" = "Version: %@"; /*** Strings from ../Source/GSThemePanel.m ***/ /* File: ../Source/GSThemePanel.m:229 */ /* File: ../Source/GSThemePanel.m:197 */ "Make this the default theme" = "Zum Standard Thema machen"; /* File: ../Source/GSThemePanel.m:234 */ /* File: ../Source/GSThemePanel.m:193 */ "Revert default theme" = "Standard Thema wiederherstellen"; /* File: ../Source/GSThemePanel.m:115 */ "Themes" = "Themen"; /*** Strings from ../Source/GSToolbarView.m ***/ /* File: ../Source/GSToolbarView.m:894 */ "Customize Toolbar" = "Toolbar anpassen"; /*** Strings from ../Source/NSAlert.m ***/ /* File: ../Source/NSAlert.m:2000 */ "Alert" = "Hinweis"; /* File: ../Source/NSAlert.m:2001 */ "No information" = "Keine Information"; /*** Strings from ../Source/NSApplication.m ***/ /* File: ../Source/NSApplication.m:138 */ "Abort" = "Abbrechen"; /* File: ../Source/NSApplication.m:323 */ "Backend at path %@ doesn't contain the GSBackend class" = "Backend bei %@ enth\U00E4lt keine GSBackend-Klasse"; /* File: ../Source/NSApplication.m:311 */ "Can't create NSBundle object for backend at path %@" = "Kann kein NSBundle-Objekt f\U00FCr Backend bei %@ erstellen"; /* File: ../Source/NSApplication.m:316 */ "Can't load object file from backend at path %@" = "Kann Objekt-Datei des Backends bei %@ nicht laden"; /* File: ../Source/NSApplication.m:135 */ "Critical Error in %@" = "Kritischer Fehler in %@"; /* File: ../Source/NSApplication.m:141 */ "Debug" = "Debug"; /* File: ../Source/NSApplication.m:4203 */ "Hide" = "Ausblenden"; /* File: ../Source/NSApplication.m:1198 */ "Problem during launch app notification: %@" = "Problem beim Starten von App-Notifikation: %@"; /* File: ../Source/NSApplication.m:4197 */ "Show" = "Anzeigen"; /* File: ../Source/NSApplication.m:304 */ "Unable to find backend %@" = "Backend %@ nicht gefunden"; /* File: ../Source/NSApplication.m:972 */ "[NSApplication -init] called more than once" = "[NSApplication -init] mehrfach aufgerufen"; /* File: ../Source/NSApplication.m:3315 */ "reported exception - %@" = "meldet Ausnahme - %@"; /*** Strings from ../Source/NSAttributedString.m ***/ /* File: ../Source/NSAttributedString.m:1060 */ /* Comment: Error description */ /* File: ../Source/NSAttributedString.m:1083 */ /* Comment: Error description */ "Could not create data for type." = "F\U00FCr den Typ konnten keine Daten erzeugt werden."; /* File: ../Source/NSAttributedString.m:927 */ /* Comment: Error description */ "Could not load data from URL." = "Die Daten konnten nicht vom URL geladen werden."; /* File: ../Source/NSAttributedString.m:863 */ /* Comment: Error description */ "Could not load data." = "Die Daten konnten nicht geladen werden."; /* File: ../Source/NSAttributedString.m:762 */ /* Comment: Error description */ "No data specified for data loading." = "Es wurden keine Daten zum Laden angegeben."; /* File: ../Source/NSAttributedString.m:1033 */ /* Comment: Error description */ "No type specified for data." = "F\U00FCr die Daten wurde kein Typ angegeben."; /*** Strings from ../Source/NSBitmapImageRep.m ***/ /* File: ../Source/NSBitmapImageRep.m:1645 */ "CCITTFAX3 Compression" = "CCITTFAX3-Kompression"; /* File: ../Source/NSBitmapImageRep.m:1646 */ "CCITTFAX4 Compression" = "CCITTFAX4-Kompression"; /* File: ../Source/NSBitmapImageRep.m:1648 */ "JPEG Compression" = "JPEG-Kompression"; /* File: ../Source/NSBitmapImageRep.m:1647 */ "LZW Compression" = "LZW-Kompression"; /* File: ../Source/NSBitmapImageRep.m:1649 */ "NEXT Compression" = "NEXT-Kompression"; /* File: ../Source/NSBitmapImageRep.m:1644 */ "No Compression" = "Keine Kompression"; /* File: ../Source/NSBitmapImageRep.m:1651 */ "Old JPEG Compression" = "alte JPEG-Kompression"; /* File: ../Source/NSBitmapImageRep.m:1650 */ "PackBits Compression" = "PackBits-Kompression"; /*** Strings from ../Source/NSColorPanel.m ***/ /* File: ../Source/NSColorPanel.m:309 */ "Opacity" = "Deckkraft"; /*** Strings from ../Source/NSColorSpace.m ***/ /* File: ../Source/NSColorSpace.m:143 */ /* Comment: color space */ "CMYK" = "CMYK"; /* File: ../Source/NSColorSpace.m:147 */ /* Comment: color space */ "DeviceN" = "DeviceN"; /* File: ../Source/NSColorSpace.m:139 */ /* Comment: color space */ "Grayscale" = "Graustufen"; /* File: ../Source/NSColorSpace.m:145 */ /* Comment: color space */ "LAB" = "LAB"; /* File: ../Source/NSColorSpace.m:141 */ /* Comment: color space */ "RGB" = "RGB"; /* File: ../Source/NSColorSpace.m:137 */ /* Comment: color space */ "unknown" = "unbekannt"; /*** Strings from ../Source/NSDocument.m ***/ /* File: ../Source/NSDocument.m:1659 */ "%@ has been edited. Are you sure you want to undo changes?" = "%@ wurde ge\U00E4ndert. Wollen Sie die \U00C4nderungen wirklich verwerfen?"; /* File: ../Source/NSDocument.m:473 */ "%@ has changed. Save?" = "%@ ge\U00E4ndert. Speichern?"; /* File: ../Source/NSDocument.m:814 */ "Can't create backup file. Save anyways?" = "Kann Backup-Datei nicht anlegen. Dennoch Speichern?"; /* File: ../Source/NSDocument.m:472 */ "Close" = "Schlie\U00DFen"; /* File: ../Source/NSDocument.m:142 */ "Could not load URL %@." = "Konnte URL %@ nicht laden"; /* File: ../Source/NSDocument.m:119 */ "Could not load file %@." = "Konnte Datei %@ nicht laden."; /* File: ../Source/NSDocument.m:813 */ "File Error" = "Dateifehler"; /* File: ../Source/NSDocument.m:141 */ /* File: ../Source/NSDocument.m:118 */ "Load failed" = "Laden fehlgeschlagen"; /* File: ../Source/NSDocument.m:1179 */ "Save As" = "Speichern als"; /* File: ../Source/NSDocument.m:1180 */ "Save To" = "Speichern in"; /* File: ../Source/NSDocument.m:569 */ "Untitled-%d" = "unbenannt-%d"; /*** Strings from ../Source/NSDocumentController.m ***/ /* File: ../Source/NSDocumentController.m:1692 */ "Clear List" = "Liste l\U00F6schen"; /* File: ../Source/NSDocumentController.m:1056 */ "Power Off" = "Aus"; /* File: ../Source/NSDocumentController.m:1008 */ /* File: ../Source/NSDocumentController.m:966 */ "Quit Anyway" = "Dennoch beenden"; /* File: ../Source/NSDocumentController.m:1006 */ /* File: ../Source/NSDocumentController.m:964 */ "Review Unsaved" = "Ansehen"; /* File: ../Source/NSDocumentController.m:1013 */ /* File: ../Source/NSDocumentController.m:963 */ "You have unsaved documents" = "Sie haben ungespeicherte Dokumente"; /*** Strings from ../Source/NSFontPanel.m ***/ /* File: ../Source/NSFontPanel.m:1138 */ "Family" = "Familie"; /* File: ../Source/NSFontPanel.m:553 */ "Font Panel" = "Schriftartauswahl"; /* File: ../Source/NSFontPanel.m:578 */ "Font preview" = "Voransicht"; /* File: ../Source/NSFontPanel.m:241 */ "Multiple fonts selected" = "Mehrere Schriftarten ausgew\U00E4hlt"; /* File: ../Source/NSFontPanel.m:818 */ "NoFace" = "KeinStil"; /* File: ../Source/NSFontPanel.m:810 */ "NoFamily" = "KeineFamilie"; /* File: ../Source/NSFontPanel.m:719 */ "Set" = "Setzen"; /* File: ../Source/NSFontPanel.m:639 */ "Size" = "Gr\U00F6sse"; /* File: ../Source/NSFontPanel.m:1142 */ "Typeface" = "Stil"; /*** Strings from ../Source/NSMenu.m ***/ /* File: ../Source/NSMenu.m:260 */ "Services" = "Dienste"; /*** Strings from ../Source/NSOpenPanel.m ***/ /* File: ../Source/NSOpenPanel.m:92 */ "Open" = "\U00D6ffnen"; /*** Strings from ../Source/NSPageLayout.m ***/ /* File: ../Source/NSPageLayout.m:741 */ /* File: ../Source/NSPageLayout.m:739 */ "(none)" = "(keine)"; /* File: ../Source/NSPageLayout.m:964 */ "Bottom Margin" = "Unterer Rand"; /* File: ../Source/NSPageLayout.m:960 */ "Dimensions" = "Dimensionen"; /* File: ../Source/NSPageLayout.m:1020 */ "Landscape" = "Querformat"; /* File: ../Source/NSPageLayout.m:965 */ "Left Margin" = "Linker Rand"; /* File: ../Source/NSPageLayout.m:961 */ "Orientation" = "Orientierung"; /* File: ../Source/NSPageLayout.m:1016 */ "Portrait" = "Hochformat"; /* File: ../Source/NSPageLayout.m:966 */ "Right Margin" = "Rechter Rand"; /* File: ../Source/NSPageLayout.m:962 */ "Scale" = "Schriftgrad"; /* File: ../Source/NSPageLayout.m:963 */ "Top Margin" = "Oberer Rand"; /*** Strings from ../Source/NSPrintOperation.m ***/ /* File: ../Source/NSPrintOperation.m:677 */ "Error" = "Fehler"; /* File: ../Source/NSPrintOperation.m:677 */ "Printing error: %@" = "Druckerfehler: %@"; /*** Strings from ../Source/NSPrintPanel.m ***/ /* File: ../Source/NSPrintPanel.m:407 */ "Faxing of print file not implemented" = "Faxen ist nicht implementiert"; /* File: ../Source/NSPrintPanel.m:781 */ /* File: ../Source/NSPrintPanel.m:774 */ /* File: ../Source/NSPrintPanel.m:643 */ "Manual" = "Manuell"; /* File: ../Source/NSPrintPanel.m:145 */ "Print Panel" = "Druckfenster"; /* File: ../Source/NSPrintPanel.m:407 */ "Sorry" = "Entschuldigung"; /*** Strings from ../Source/NSSavePanel.m ***/ /* File: ../Source/NSSavePanel.m:434 */ /* File: ../Source/NSSavePanel.m:251 */ "Name:" = "Name:"; /* File: ../Source/NSSavePanel.m:1368 */ "No" = "Nein"; /* File: ../Source/NSSavePanel.m:1794 */ "Reading Directory " = "Lese Verzeichnis "; /* File: ../Source/NSSavePanel.m:1403 */ "Replace" = "\U00DCberschreiben"; /* File: ../Source/NSSavePanel.m:242 */ "Show Hidden Files" = "Versteckte Dateien anzeigen"; /* File: ../Source/NSSavePanel.m:1380 */ "The directory '%@' could not be created." = "Das Verzeichnis \U00BB%@\U00AB konnte nicht erstellt werden."; /* File: ../Source/NSSavePanel.m:1367 */ "The directory '%@' does not exist, do you want to create it?" = "Das Verzeichnis \U00BB%@\U00AB existiert nicht. Wollen Sie es anlegen?"; /* File: ../Source/NSSavePanel.m:1402 */ "The file '%@' in '%@' exists. Replace it?" = "Die Datei \U00BB%@\U00AB in \U00BB%@\U00AB existiert bereits. \U00DCberschreiben?"; /* File: ../Source/NSSavePanel.m:1391 */ "The path '%@' is not a directory." = "\U00BB%@\U00AB ist kein Verzeichnis."; /* File: ../Source/NSSavePanel.m:1323 */ /* File: ../Source/NSSavePanel.m:1315 */ "Use .%@" = ".%@ verwenden"; /* File: ../Source/NSSavePanel.m:1368 */ "Yes" = "Ja"; /* File: ../Source/NSSavePanel.m:1322 */ "You cannot save this document with extension '.%@'.\nThe required extension is '.%@'." = "Sie k\U00F6nnen das Dokument nicht mit der Erweiterung \U00BB.%@\U00AB speichern.\nDie notwendige Erweiterung ist \U00BB.%@\U00AB."; /* File: ../Source/NSSavePanel.m:1314 */ "You have used the extension '.%@'.\nThe standard extension is '.%@'.'" = "Sie haben die Erweiterung \U00BB.%@\U00AB benutzt.\nDie Standarderweiterung ist \U00BB.%@\U00AB."; /*** Strings from ../Source/NSSpellChecker.m ***/ /* File: ../Source/NSSpellChecker.m:731 */ "Guess" = "Raten"; /*** Strings from ../Source/NSTextView.m ***/ /* File: ../Source/NSTextView.m:652 */ "Copy" = "Kopieren"; /* File: ../Source/NSTextView.m:651 */ "Cut" = "Ausschneiden"; /* File: ../Source/NSTextView.m:5894 */ "No Suggestions" = "Kein Vorschlag"; /* File: ../Source/NSTextView.m:653 */ "Paste" = "Einf\U00FCgen"; /*** Strings from ../Source/NSToolbarItem.m ***/ /* File: ../Source/NSToolbarItem.m:1122 */ "Customize" = "Anpassen"; /* File: ../Source/NSToolbarItem.m:1021 */ "Flexible Space" = "Flexibler Zwischenraum"; /* File: ../Source/NSToolbarItem.m:1099 */ "Fonts" = "Schriften"; /* File: ../Source/NSToolbarItem.m:1145 */ "Print..." = "Drucken..."; /* File: ../Source/NSToolbarItem.m:949 */ "Separator" = "Trennlinie"; /* File: ../Source/NSToolbarItem.m:991 */ "Space" = "Zwischenraum"; /*** Strings from ../Source/NSWindow.m ***/ /* File: ../Source/NSWindow.m:5317 */ "Hide Toolbar" = "Toolbar ausblenden"; /* File: ../Source/NSWindow.m:5319 */ "Show Toolbar" = "Toolbar anzeigen"; gnustep-gui-0.24.0/Resources/Spanish.lproj/0000775000076500007650000000000012256227325020454 5ustar brains99brains99gnustep-gui-0.24.0/Resources/Spanish.lproj/Localizable.strings0000664000076500007650000004073512235010125024302 0ustar brains99brains99/*** Spanish.lproj/Localizable.strings updated by make_strings 2013-10-28 21:50:46 +0100 add comments above this one ***/ /*** Keys found in multiple places ***/ /* File: ../Source/GSNibLoading.m:182 */ /* Comment: Info */ /* File: ../Source/NSApplication.m:2878 */ /* Comment: Title of the Info Panel */ /* File: ../Source/NSMenu.m:259 */ "Info" = "Informaci\U00F3n"; /* File: ../Source/GSNibLoading.m:165 */ /* Comment: Quit */ /* File: ../Source/NSApplication.m:3442 */ /* File: ../Source/NSApplication.m:4207 */ /* File: ../Source/NSDocumentController.m:1049 */ "Quit" = "Salir"; /* File: ../Source/GSCharacterPanel.m:173 */ /* File: ../Source/NSPageLayout.m:959 */ "Name" = "Nombre"; /* File: ../Source/NSAlert.m:384 */ /* File: ../Source/NSDocument.m:474 */ /* File: ../Source/NSDocument.m:815 */ /* File: ../Source/NSDocument.m:1660 */ /* File: ../Source/NSDocumentController.m:955 */ /* File: ../Source/NSDocumentController.m:987 */ /* File: ../Source/NSSavePanel.m:318 */ /* File: ../Source/NSSavePanel.m:1330 */ /* File: ../Source/NSSavePanel.m:1403 */ "Cancel" = "Cancelar"; /* File: ../Source/NSAlert.m:389 */ /* File: ../Source/NSDocument.m:474 */ "Don't Save" = "No Guardar"; /* File: ../Source/NSDocument.m:474 */ /* File: ../Source/NSDocument.m:815 */ /* File: ../Source/NSDocument.m:1183 */ /* File: ../Source/NSSavePanel.m:435 */ /* File: ../Source/NSSavePanel.m:1327 */ /* File: ../Source/NSSavePanel.m:1366 */ /* File: ../Source/NSSavePanel.m:1379 */ /* File: ../Source/NSSavePanel.m:1390 */ /* File: ../Source/NSSavePanel.m:1401 */ /* Flag: untranslated */ "Save" = "Guardar"; /* File: ../Source/GSHelpManagerPanel.m:101 */ /* File: ../Source/NSAlert.m:1830 */ /* File: ../Source/NSPrintOperation.m:678 */ /* File: ../Source/NSPrintPanel.m:408 */ /* File: ../Source/NSSavePanel.m:334 */ "OK" = "Bien"; /* File: ../Source/GSPrintOperation.m:157 */ /* File: ../Source/NSSavePanel.m:1381 */ /* File: ../Source/NSSavePanel.m:1392 */ "Dismiss" = "Despedir"; /* File: ../Source/NSColorPanel.m:245 */ /* File: ../Source/NSToolbarItem.m:1076 */ "Colors" = "Colores"; /* File: ../Source/NSDocument.m:1658 */ /* File: ../Source/NSDocument.m:1660 */ /* File: ../Source/NSFontPanel.m:696 */ "Revert" = "Revertir"; /* File: ../Source/NSPageLayout.m:967 */ /* File: ../Source/NSPageLayout.m:1038 */ /* File: ../Source/NSPrintPanel.m:630 */ /* File: ../Source/NSPrintPanel.m:676 */ "Unknown" = "Desconocido"; /* File: ../Source/GSHelpManagerPanel.m:70 */ /* File: ../Source/NSHelpPanel.m:154 */ "Help" = "Ayuda"; /* File: ../Source/GSPrintOperation.m:155 */ /* File: ../Source/NSFontPanel.m:706 */ "Preview" = "Vista Previa"; /* File: ../Source/GSCharacterPanel.m:154 */ /* File: ../Source/NSFontPanel.m:738 */ "Character Panel" = "Panel de Caracteres"; /* File: ../Source/NSDocument.m:1109 */ /* File: ../Source/NSPrintPanel.m:350 */ "File Type" = "Tipo de Archivo"; /*** Unmatched/untranslated keys ***/ /* File: ../Source/GSToolbarView.m:894 */ /* Flag: untranslated */ "Customize Toolbar" = "Personalizar Barra de Herramientas"; /* File: ../Source/NSAlert.m:2001 */ /* Flag: untranslated */ "No information" = "No hay informaci\U00F3n"; /* File: ../Source/NSApplication.m:4197 */ /* Flag: untranslated */ "Show" = "Mostrar"; /* File: ../Source/NSApplication.m:4203 */ /* Flag: untranslated */ "Hide" = "Ocultar"; /* File: ../Source/NSSavePanel.m:242 */ /* Flag: untranslated */ "Show Hidden Files" = "Mostrar archivos ocultos"; /* File: ../Source/NSSavePanel.m:277 */ /* Flag: untranslated */ "Home" = "Carpeta Personal"; /* File: ../Source/NSSavePanel.m:293 */ /* Flag: untranslated */ "Mount" = "Montar"; /* File: ../Source/NSSavePanel.m:309 */ /* Flag: untranslated */ "Unmount" = "Desmontar"; /* File: ../Source/NSTextView.m:651 */ /* Flag: untranslated */ "Cut" = "Cortar"; /* File: ../Source/NSTextView.m:652 */ /* Flag: untranslated */ "Copy" = "Copiar"; /* File: ../Source/NSTextView.m:653 */ /* Flag: untranslated */ "Paste" = "Pegar"; /* File: ../Source/NSTextView.m:5894 */ /* Flag: untranslated */ "No Suggestions" = "No hay sugerencias"; /*** Strings from ../Source/Functions.m ***/ /* File: ../Source/Functions.m:85 */ "Cannot load the main model file '%@'" = "No se puede leer el archivo del m\U00F3delo principal '%@'"; /*** Strings from ../Source/GSCharacterPanel.m ***/ /* File: ../Source/GSCharacterPanel.m:182 */ "Code Point" = "C\U00F3digo"; /* File: ../Source/GSCharacterPanel.m:191 */ "Unicode Block" = "Bloque Unicode"; /*** Strings from ../Source/GSInfoPanel.m ***/ /* File: ../Source/GSInfoPanel.m:451 */ "Author: " = "Autor: "; /* File: ../Source/GSInfoPanel.m:455 */ "Authors: " = "Autores: "; /* File: ../Source/GSInfoPanel.m:396 */ "Copyright Information Not Available" = "Informaci\U00F3n no disponible"; /* File: ../Source/GSInfoPanel.m:482 */ /* File: ../Source/GSInfoPanel.m:187 */ "Current theme" = "Tema Actual"; /* File: ../Source/GSInfoPanel.m:339 */ "Release: " = "Versi\U00F3n: "; /*** Strings from ../Source/GSPrintOperation.m ***/ /* File: ../Source/GSPrintOperation.m:156 */ "Problem running the preview application '%@' perhaps you need to set your NSPreviewApp user default" = "Problema con la aplicaci\U00F3n de vista previa '%@' talvez usted necesite establecer NSPreviewApp para su usuario"; /*** Strings from ../Source/GSTextFinder.m ***/ /* File: ../Source/GSTextFinder.m:408 */ "%d replaced" = "%d reemplazado(s)"; /* File: ../Source/GSTextFinder.m:381 */ /* File: ../Source/GSTextFinder.m:332 */ "Not found" = "No se encontro"; /*** Strings from ../Source/GSThemeDrawing.m ***/ /* File: ../Source/GSThemeDrawing.m:188 */ "?" = "?"; /*** Strings from ../Source/GSThemeInspector.m ***/ /* File: ../Source/GSThemeInspector.m:141 */ "Version: %@" = "Versi\U00F3n: %@"; /*** Strings from ../Source/GSThemePanel.m ***/ /* File: ../Source/GSThemePanel.m:229 */ /* File: ../Source/GSThemePanel.m:197 */ "Make this the default theme" = "Hacer este el tema por defecto"; /* File: ../Source/GSThemePanel.m:234 */ /* File: ../Source/GSThemePanel.m:193 */ "Revert default theme" = "Regresar al tema por defecto"; /* File: ../Source/GSThemePanel.m:115 */ "Themes" = "Temas"; /*** Strings from ../Source/NSAlert.m ***/ /* File: ../Source/NSAlert.m:2000 */ "Alert" = "Alerta"; /*** Strings from ../Source/NSApplication.m ***/ /* File: ../Source/NSApplication.m:138 */ "Abort" = "Abortar"; /* File: ../Source/NSApplication.m:323 */ "Backend at path %@ doesn't contain the GSBackend class" = "El backend en la ruta %@ no contiene la clase GSBackend"; /* File: ../Source/NSApplication.m:311 */ "Can't create NSBundle object for backend at path %@" = "No se puede crear el objeto NSBundle para el backend en la ruta %@"; /* File: ../Source/NSApplication.m:316 */ "Can't load object file from backend at path %@" = "No se puede leer el archivo desde el backend en la ruta %@"; /* File: ../Source/NSApplication.m:135 */ "Critical Error in %@" = "Error Cr\U00EDtico en %@"; /* File: ../Source/NSApplication.m:141 */ "Debug" = "Depurar"; /* File: ../Source/NSApplication.m:1198 */ "Problem during launch app notification: %@" = "Problema durante la notificaci\U00F3n de aplicaci\U00F3n iniciada: %@"; /* File: ../Source/NSApplication.m:304 */ "Unable to find backend %@" = "Incapaz de encontrar el backend %@"; /* File: ../Source/NSApplication.m:972 */ "[NSApplication -init] called more than once" = "[NSApplication -init] llamada m\U00E1s de una vez"; /* File: ../Source/NSApplication.m:3315 */ "reported exception - %@" = "excepci\U00F3n reportada - %@"; /*** Strings from ../Source/NSAttributedString.m ***/ /* File: ../Source/NSAttributedString.m:1060 */ /* Comment: Error description */ /* File: ../Source/NSAttributedString.m:1083 */ /* Comment: Error description */ "Could not create data for type." = "No se puede crear el dato para el tipo."; /* File: ../Source/NSAttributedString.m:927 */ /* Comment: Error description */ "Could not load data from URL." = "No se pueden leer los datos desde la URL."; /* File: ../Source/NSAttributedString.m:863 */ /* Comment: Error description */ "Could not load data." = "No se pueden leer los datos."; /* File: ../Source/NSAttributedString.m:762 */ /* Comment: Error description */ "No data specified for data loading." = "No hay datos especificados en la informaci\U00F3n le\U00EDda."; /* File: ../Source/NSAttributedString.m:1033 */ /* Comment: Error description */ "No type specified for data." = "No hay un tipo especificado para el dato."; /*** Strings from ../Source/NSBitmapImageRep.m ***/ /* File: ../Source/NSBitmapImageRep.m:1645 */ "CCITTFAX3 Compression" = "Compresi\U00F3n CCITTFAX3"; /* File: ../Source/NSBitmapImageRep.m:1646 */ "CCITTFAX4 Compression" = "Compresi\U00F3n CCITTFAX4"; /* File: ../Source/NSBitmapImageRep.m:1648 */ "JPEG Compression" = "Compresi\U00F3n JPEG"; /* File: ../Source/NSBitmapImageRep.m:1647 */ "LZW Compression" = "Compresi\U00F3n LZW"; /* File: ../Source/NSBitmapImageRep.m:1649 */ "NEXT Compression" = "Compresi\U00F3n NEXT"; /* File: ../Source/NSBitmapImageRep.m:1644 */ "No Compression" = "Sin Compresi\U00F3n"; /* File: ../Source/NSBitmapImageRep.m:1651 */ "Old JPEG Compression" = "Antigua Compresi\U00F3n JPEG"; /* File: ../Source/NSBitmapImageRep.m:1650 */ "PackBits Compression" = "Compresi\U00F3n PackBits"; /*** Strings from ../Source/NSColorPanel.m ***/ /* File: ../Source/NSColorPanel.m:309 */ "Opacity" = "Opacidad"; /*** Strings from ../Source/NSColorSpace.m ***/ /* File: ../Source/NSColorSpace.m:143 */ /* Comment: color space */ "CMYK" = "CMYK"; /* File: ../Source/NSColorSpace.m:147 */ /* Comment: color space */ "DeviceN" = "DispositivoN"; /* File: ../Source/NSColorSpace.m:139 */ /* Comment: color space */ "Grayscale" = "Escala de Grises"; /* File: ../Source/NSColorSpace.m:145 */ /* Comment: color space */ "LAB" = "LAB"; /* File: ../Source/NSColorSpace.m:141 */ /* Comment: color space */ "RGB" = "RGB"; /* File: ../Source/NSColorSpace.m:137 */ /* Comment: color space */ "unknown" = "desconocido"; /*** Strings from ../Source/NSDocument.m ***/ /* File: ../Source/NSDocument.m:1659 */ "%@ has been edited. Are you sure you want to undo changes?" = "%@ ha sido editado. \U00BFEsta seguro de querer revertir los cambios?"; /* File: ../Source/NSDocument.m:473 */ "%@ has changed. Save?" = "%@ ha cambiado. \U00BFGuardar?"; /* File: ../Source/NSDocument.m:814 */ "Can't create backup file. Save anyways?" = "No se puede crear el archivo de respaldo. \U00BFGuardar de cualquier forma?"; /* File: ../Source/NSDocument.m:472 */ "Close" = "Cerrar"; /* File: ../Source/NSDocument.m:142 */ "Could not load URL %@." = "No se puede leer la URL %@."; /* File: ../Source/NSDocument.m:119 */ "Could not load file %@." = "No se puede leer el archivo %@."; /* File: ../Source/NSDocument.m:813 */ "File Error" = "Error de Archivo"; /* File: ../Source/NSDocument.m:141 */ /* File: ../Source/NSDocument.m:118 */ "Load failed" = "Lectura fallida"; /* File: ../Source/NSDocument.m:1179 */ "Save As" = "Guardar Como"; /* File: ../Source/NSDocument.m:1180 */ "Save To" = "Guardar Para"; /* File: ../Source/NSDocument.m:569 */ "Untitled-%d" = "Sin nombre-%d"; /*** Strings from ../Source/NSDocumentController.m ***/ /* File: ../Source/NSDocumentController.m:1692 */ "Clear List" = "Limpiar Lista"; /* File: ../Source/NSDocumentController.m:1056 */ "Power Off" = "Desconectar"; /* File: ../Source/NSDocumentController.m:1008 */ /* File: ../Source/NSDocumentController.m:966 */ "Quit Anyway" = "Salir de Cualquier Forma"; /* File: ../Source/NSDocumentController.m:1006 */ /* File: ../Source/NSDocumentController.m:964 */ "Review Unsaved" = "Revisi\U00F3n sin Guardar"; /* File: ../Source/NSDocumentController.m:1013 */ /* File: ../Source/NSDocumentController.m:963 */ "You have unsaved documents" = "Usted tiene documentos sin guardar"; /*** Strings from ../Source/NSFontPanel.m ***/ /* File: ../Source/NSFontPanel.m:1138 */ "Family" = "Fuente"; /* File: ../Source/NSFontPanel.m:553 */ "Font Panel" = "Fuentes"; /* File: ../Source/NSFontPanel.m:578 */ "Font preview" = "Vista Previa"; /* File: ../Source/NSFontPanel.m:241 */ "Multiple fonts selected" = "Varias fuentes seleccionadas"; /* File: ../Source/NSFontPanel.m:818 */ "NoFace" = "No hay estilo"; /* File: ../Source/NSFontPanel.m:810 */ "NoFamily" = "No hay fuente"; /* File: ../Source/NSFontPanel.m:719 */ "Set" = "Aplicar"; /* File: ../Source/NSFontPanel.m:639 */ "Size" = "Tama\U00F1o"; /* File: ../Source/NSFontPanel.m:1142 */ "Typeface" = "Estilo"; /*** Strings from ../Source/NSMenu.m ***/ /* File: ../Source/NSMenu.m:260 */ "Services" = "Servicios"; /*** Strings from ../Source/NSOpenPanel.m ***/ /* File: ../Source/NSOpenPanel.m:92 */ "Open" = "Abrir"; /*** Strings from ../Source/NSPageLayout.m ***/ /* File: ../Source/NSPageLayout.m:741 */ /* File: ../Source/NSPageLayout.m:739 */ "(none)" = "(ninguno)"; /* File: ../Source/NSPageLayout.m:964 */ "Bottom Margin" = "Margen Inferior"; /* File: ../Source/NSPageLayout.m:960 */ "Dimensions" = "Dimensiones"; /* File: ../Source/NSPageLayout.m:1020 */ "Landscape" = "Horizontal"; /* File: ../Source/NSPageLayout.m:965 */ "Left Margin" = "Margen Izquierdo"; /* File: ../Source/NSPageLayout.m:961 */ "Orientation" = "Orientaci\U00F3n"; /* File: ../Source/NSPageLayout.m:1016 */ "Portrait" = "Vertical"; /* File: ../Source/NSPageLayout.m:966 */ "Right Margin" = "Margen Derecho"; /* File: ../Source/NSPageLayout.m:962 */ "Scale" = "Escala"; /* File: ../Source/NSPageLayout.m:963 */ "Top Margin" = "Margen Superior"; /*** Strings from ../Source/NSPrintOperation.m ***/ /* File: ../Source/NSPrintOperation.m:677 */ "Error" = "Error"; /* File: ../Source/NSPrintOperation.m:677 */ "Printing error: %@" = "Error de impresi\U00F3n: %@"; /*** Strings from ../Source/NSPrintPanel.m ***/ /* File: ../Source/NSPrintPanel.m:179 */ "1 up" = "1 p\U00E1gina"; /* File: ../Source/NSPrintPanel.m:179 */ "2 up" = "2 p\U00E1ginas"; /* File: ../Source/NSPrintPanel.m:179 */ "4 up" = "4 p\U00E1ginas"; /* File: ../Source/NSPrintPanel.m:179 */ "6 up" = "6 p\U00E1ginas"; /* File: ../Source/NSPrintPanel.m:180 */ "8 up" = "8 p\U00E1ginas"; /* File: ../Source/NSPrintPanel.m:407 */ "Faxing of print file not implemented" = "El faxeo de archivos no esta implementado"; /* File: ../Source/NSPrintPanel.m:781 */ /* File: ../Source/NSPrintPanel.m:774 */ /* File: ../Source/NSPrintPanel.m:643 */ "Manual" = "Manual"; /* File: ../Source/NSPrintPanel.m:145 */ "Print Panel" = "Panel de Impresi\U00F3n"; /* File: ../Source/NSPrintPanel.m:407 */ "Sorry" = "Error"; /*** Strings from ../Source/NSSavePanel.m ***/ /* File: ../Source/NSSavePanel.m:434 */ /* File: ../Source/NSSavePanel.m:251 */ "Name:" = "Nombre:"; /* File: ../Source/NSSavePanel.m:1368 */ "No" = "No"; /* File: ../Source/NSSavePanel.m:1794 */ "Reading Directory " = "Leyendo Directorio "; /* File: ../Source/NSSavePanel.m:1403 */ "Replace" = "Remplazar"; /* File: ../Source/NSSavePanel.m:1380 */ "The directory '%@' could not be created." = "El directorio '%@' no se pudo crear."; /* File: ../Source/NSSavePanel.m:1367 */ "The directory '%@' does not exist, do you want to create it?" = "El directorio '%@' no existe, \U00BFquiere crearlo?"; /* File: ../Source/NSSavePanel.m:1402 */ "The file '%@' in '%@' exists. Replace it?" = "El archivo '%@' en '%@' existe. \U00BFRemplazarlo?"; /* File: ../Source/NSSavePanel.m:1391 */ "The path '%@' is not a directory." = "La ruta '%@' no es un directorio."; /* File: ../Source/NSSavePanel.m:1323 */ /* File: ../Source/NSSavePanel.m:1315 */ "Use .%@" = "Usar .%@"; /* File: ../Source/NSSavePanel.m:1368 */ "Yes" = "Si"; /* File: ../Source/NSSavePanel.m:1322 */ "You cannot save this document with extension '.%@'.\nThe required extension is '.%@'." = "Usted no puede guardar este documento con la extensi\U00F3n '.%@'.\nLa extensi\U00F3n requerida es '.%@'."; /* File: ../Source/NSSavePanel.m:1314 */ "You have used the extension '.%@'.\nThe standard extension is '.%@'.'" = "Usted ha puesto la extensi\U00F3n '.%@'.\nLa extensi\U00F3n esperada es '.%@'.'"; /*** Strings from ../Source/NSSpellChecker.m ***/ /* File: ../Source/NSSpellChecker.m:731 */ "Guess" = "Sugerencias"; /*** Strings from ../Source/NSToolbarItem.m ***/ /* File: ../Source/NSToolbarItem.m:1122 */ "Customize" = "Modificar"; /* File: ../Source/NSToolbarItem.m:1021 */ "Flexible Space" = "Espacio Flexible"; /* File: ../Source/NSToolbarItem.m:1099 */ "Fonts" = "Fuentes"; /* File: ../Source/NSToolbarItem.m:1145 */ "Print..." = "Imprimir..."; /* File: ../Source/NSToolbarItem.m:949 */ "Separator" = "Separador"; /* File: ../Source/NSToolbarItem.m:991 */ "Space" = "Espacio"; /*** Strings from ../Source/NSWindow.m ***/ /* File: ../Source/NSWindow.m:5317 */ "Hide Toolbar" = "Ocultar Barra"; /* File: ../Source/NSWindow.m:5319 */ "Show Toolbar" = "Mostrar Barra"; gnustep-gui-0.24.0/Resources/English.lproj/0000775000076500007650000000000012256227325020440 5ustar brains99brains99gnustep-gui-0.24.0/Resources/English.lproj/Localizable.strings0000664000076500007650000003703512235010125024265 0ustar brains99brains99/*** English.lproj/Localizable.strings updated by make_strings 2013-10-28 21:48:14 +0100 add comments above this one ***/ /*** Keys found in multiple places ***/ /* File: ../Source/GSNibLoading.m:182 */ /* Comment: Info */ /* File: ../Source/NSApplication.m:2878 */ /* Comment: Title of the Info Panel */ /* File: ../Source/NSMenu.m:259 */ "Info" = "Info"; /* File: ../Source/GSNibLoading.m:165 */ /* Comment: Quit */ /* File: ../Source/NSApplication.m:3442 */ /* File: ../Source/NSApplication.m:4207 */ /* File: ../Source/NSDocumentController.m:1049 */ "Quit" = "Quit"; /* File: ../Source/NSAlert.m:384 */ /* File: ../Source/NSDocument.m:474 */ /* File: ../Source/NSDocument.m:815 */ /* File: ../Source/NSDocument.m:1660 */ /* File: ../Source/NSDocumentController.m:955 */ /* File: ../Source/NSDocumentController.m:987 */ /* File: ../Source/NSSavePanel.m:318 */ /* File: ../Source/NSSavePanel.m:1330 */ /* File: ../Source/NSSavePanel.m:1403 */ "Cancel" = "Cancel"; /* File: ../Source/NSAlert.m:389 */ /* File: ../Source/NSDocument.m:474 */ "Don't Save" = "Don't Save"; /* File: ../Source/NSDocument.m:474 */ /* File: ../Source/NSDocument.m:815 */ /* File: ../Source/NSDocument.m:1183 */ /* File: ../Source/NSSavePanel.m:435 */ /* File: ../Source/NSSavePanel.m:1327 */ /* File: ../Source/NSSavePanel.m:1366 */ /* File: ../Source/NSSavePanel.m:1379 */ /* File: ../Source/NSSavePanel.m:1390 */ /* File: ../Source/NSSavePanel.m:1401 */ "Save" = "Save"; /* File: ../Source/GSHelpManagerPanel.m:101 */ /* File: ../Source/NSAlert.m:1830 */ /* File: ../Source/NSPrintOperation.m:678 */ /* File: ../Source/NSPrintPanel.m:408 */ /* File: ../Source/NSSavePanel.m:334 */ "OK" = "OK"; /* File: ../Source/GSPrintOperation.m:157 */ /* File: ../Source/NSSavePanel.m:1381 */ /* File: ../Source/NSSavePanel.m:1392 */ "Dismiss" = "Dismiss"; /* File: ../Source/GSPrintOperation.m:155 */ /* File: ../Source/NSFontPanel.m:706 */ "Preview" = "Preview"; /* File: ../Source/NSDocument.m:1658 */ /* File: ../Source/NSDocument.m:1660 */ /* File: ../Source/NSFontPanel.m:696 */ "Revert" = "Revert"; /* File: ../Source/NSColorPanel.m:245 */ /* File: ../Source/NSToolbarItem.m:1076 */ "Colors" = "Colors"; /* File: ../Source/NSPageLayout.m:967 */ /* File: ../Source/NSPageLayout.m:1038 */ /* File: ../Source/NSPrintPanel.m:630 */ /* File: ../Source/NSPrintPanel.m:676 */ "Unknown" = "Unknown"; /* File: ../Source/GSHelpManagerPanel.m:70 */ /* File: ../Source/NSHelpPanel.m:154 */ "Help" = "Help"; /* File: ../Source/NSDocument.m:1109 */ /* File: ../Source/NSPrintPanel.m:350 */ "File Type" = "File Type"; /* File: ../Source/GSCharacterPanel.m:173 */ /* File: ../Source/NSPageLayout.m:959 */ "Name" = "Name"; /* File: ../Source/GSCharacterPanel.m:154 */ /* File: ../Source/NSFontPanel.m:738 */ "Character Panel" = "Character Panel"; /*** Strings from ../Source/Functions.m ***/ /* File: ../Source/Functions.m:85 */ "Cannot load the main model file '%@'" = "Cannot load the main model file '%@'"; /*** Strings from ../Source/GSCharacterPanel.m ***/ /* File: ../Source/GSCharacterPanel.m:182 */ "Code Point" = "Code Point"; /* File: ../Source/GSCharacterPanel.m:191 */ "Unicode Block" = "Unicode Block"; /*** Strings from ../Source/GSInfoPanel.m ***/ /* File: ../Source/GSInfoPanel.m:451 */ "Author: " = "Author: "; /* File: ../Source/GSInfoPanel.m:455 */ "Authors: " = "Authors: "; /* File: ../Source/GSInfoPanel.m:396 */ "Copyright Information Not Available" = "Copyright Information Not Available"; /* File: ../Source/GSInfoPanel.m:482 */ /* File: ../Source/GSInfoPanel.m:187 */ "Current theme" = "Current theme"; /* File: ../Source/GSInfoPanel.m:339 */ "Release: " = "Release: "; /*** Strings from ../Source/GSPrintOperation.m ***/ /* File: ../Source/GSPrintOperation.m:156 */ "Problem running the preview application '%@' perhaps you need to set your NSPreviewApp user default" = "Problem running the preview application '%@' perhaps you need to set your NSPreviewApp user default"; /*** Strings from ../Source/GSTextFinder.m ***/ /* File: ../Source/GSTextFinder.m:408 */ "%d replaced" = "%d replaced"; /* File: ../Source/GSTextFinder.m:381 */ /* File: ../Source/GSTextFinder.m:332 */ "Not found" = "Not found"; /*** Strings from ../Source/GSThemeDrawing.m ***/ /* File: ../Source/GSThemeDrawing.m:188 */ "?" = "?"; /*** Strings from ../Source/GSThemeInspector.m ***/ /* File: ../Source/GSThemeInspector.m:141 */ "Version: %@" = "Version: %@"; /*** Strings from ../Source/GSThemePanel.m ***/ /* File: ../Source/GSThemePanel.m:229 */ /* File: ../Source/GSThemePanel.m:197 */ "Make this the default theme" = "Make this the default theme"; /* File: ../Source/GSThemePanel.m:234 */ /* File: ../Source/GSThemePanel.m:193 */ "Revert default theme" = "Revert default theme"; /* File: ../Source/GSThemePanel.m:115 */ "Themes" = "Themes"; /*** Strings from ../Source/GSToolbarView.m ***/ /* File: ../Source/GSToolbarView.m:894 */ "Customize Toolbar" = "Customize Toolbar"; /*** Strings from ../Source/NSAlert.m ***/ /* File: ../Source/NSAlert.m:2000 */ "Alert" = "Alert"; /* File: ../Source/NSAlert.m:2001 */ "No information" = "No information"; /*** Strings from ../Source/NSApplication.m ***/ /* File: ../Source/NSApplication.m:138 */ "Abort" = "Abort"; /* File: ../Source/NSApplication.m:323 */ "Backend at path %@ doesn't contain the GSBackend class" = "Backend at path %@ doesn't contain the GSBackend class"; /* File: ../Source/NSApplication.m:311 */ "Can't create NSBundle object for backend at path %@" = "Can't create NSBundle object for backend at path %@"; /* File: ../Source/NSApplication.m:316 */ "Can't load object file from backend at path %@" = "Can't load object file from backend at path %@"; /* File: ../Source/NSApplication.m:135 */ "Critical Error in %@" = "Critical Error in %@"; /* File: ../Source/NSApplication.m:141 */ "Debug" = "Debug"; /* File: ../Source/NSApplication.m:4203 */ "Hide" = "Hide"; /* File: ../Source/NSApplication.m:1198 */ "Problem during launch app notification: %@" = "Problem during launch app notification: %@"; /* File: ../Source/NSApplication.m:4197 */ "Show" = "Show"; /* File: ../Source/NSApplication.m:304 */ "Unable to find backend %@" = "Unable to find backend %@"; /* File: ../Source/NSApplication.m:972 */ "[NSApplication -init] called more than once" = "[NSApplication -init] called more than once"; /* File: ../Source/NSApplication.m:3315 */ "reported exception - %@" = "reported exception - %@"; /*** Strings from ../Source/NSAttributedString.m ***/ /* File: ../Source/NSAttributedString.m:1060 */ /* Comment: Error description */ /* File: ../Source/NSAttributedString.m:1083 */ /* Comment: Error description */ "Could not create data for type." = "Could not create data for type."; /* File: ../Source/NSAttributedString.m:927 */ /* Comment: Error description */ "Could not load data from URL." = "Could not load data from URL."; /* File: ../Source/NSAttributedString.m:863 */ /* Comment: Error description */ "Could not load data." = "Could not load data."; /* File: ../Source/NSAttributedString.m:762 */ /* Comment: Error description */ "No data specified for data loading." = "No data specified for data loading."; /* File: ../Source/NSAttributedString.m:1033 */ /* Comment: Error description */ "No type specified for data." = "No type specified for data."; /*** Strings from ../Source/NSBitmapImageRep.m ***/ /* File: ../Source/NSBitmapImageRep.m:1645 */ "CCITTFAX3 Compression" = "CCITTFAX3 Compression"; /* File: ../Source/NSBitmapImageRep.m:1646 */ "CCITTFAX4 Compression" = "CCITTFAX4 Compression"; /* File: ../Source/NSBitmapImageRep.m:1648 */ "JPEG Compression" = "JPEG Compression"; /* File: ../Source/NSBitmapImageRep.m:1647 */ "LZW Compression" = "LZW Compression"; /* File: ../Source/NSBitmapImageRep.m:1649 */ "NEXT Compression" = "NEXT Compression"; /* File: ../Source/NSBitmapImageRep.m:1644 */ "No Compression" = "No Compression"; /* File: ../Source/NSBitmapImageRep.m:1651 */ "Old JPEG Compression" = "Old JPEG Compression"; /* File: ../Source/NSBitmapImageRep.m:1650 */ "PackBits Compression" = "PackBits Compression"; /*** Strings from ../Source/NSColorPanel.m ***/ /* File: ../Source/NSColorPanel.m:309 */ "Opacity" = "Opacity"; /*** Strings from ../Source/NSColorSpace.m ***/ /* File: ../Source/NSColorSpace.m:143 */ /* Comment: color space */ "CMYK" = "CMYK"; /* File: ../Source/NSColorSpace.m:147 */ /* Comment: color space */ "DeviceN" = "DeviceN"; /* File: ../Source/NSColorSpace.m:139 */ /* Comment: color space */ "Grayscale" = "Grayscale"; /* File: ../Source/NSColorSpace.m:145 */ /* Comment: color space */ "LAB" = "LAB"; /* File: ../Source/NSColorSpace.m:141 */ /* Comment: color space */ "RGB" = "RGB"; /* File: ../Source/NSColorSpace.m:137 */ /* Comment: color space */ "unknown" = "unknown"; /*** Strings from ../Source/NSDocument.m ***/ /* File: ../Source/NSDocument.m:1659 */ "%@ has been edited. Are you sure you want to undo changes?" = "%@ has been edited. Are you sure you want to undo changes?"; /* File: ../Source/NSDocument.m:473 */ "%@ has changed. Save?" = "%@ has changed. Save?"; /* File: ../Source/NSDocument.m:814 */ "Can't create backup file. Save anyways?" = "Can't create backup file. Save anyways?"; /* File: ../Source/NSDocument.m:472 */ "Close" = "Close"; /* File: ../Source/NSDocument.m:142 */ "Could not load URL %@." = "Could not load URL %@."; /* File: ../Source/NSDocument.m:119 */ "Could not load file %@." = "Could not load file %@."; /* File: ../Source/NSDocument.m:813 */ "File Error" = "File Error"; /* File: ../Source/NSDocument.m:141 */ /* File: ../Source/NSDocument.m:118 */ "Load failed" = "Load failed"; /* File: ../Source/NSDocument.m:1179 */ "Save As" = "Save As"; /* File: ../Source/NSDocument.m:1180 */ "Save To" = "Save To"; /* File: ../Source/NSDocument.m:569 */ "Untitled-%d" = "Untitled-%d"; /*** Strings from ../Source/NSDocumentController.m ***/ /* File: ../Source/NSDocumentController.m:1692 */ "Clear List" = "Clear List"; /* File: ../Source/NSDocumentController.m:1056 */ "Power Off" = "Power Off"; /* File: ../Source/NSDocumentController.m:1008 */ /* File: ../Source/NSDocumentController.m:966 */ "Quit Anyway" = "Quit Anyway"; /* File: ../Source/NSDocumentController.m:1006 */ /* File: ../Source/NSDocumentController.m:964 */ "Review Unsaved" = "Review Unsaved"; /* File: ../Source/NSDocumentController.m:1013 */ /* File: ../Source/NSDocumentController.m:963 */ "You have unsaved documents" = "You have unsaved documents"; /*** Strings from ../Source/NSFontPanel.m ***/ /* File: ../Source/NSFontPanel.m:1138 */ "Family" = "Family"; /* File: ../Source/NSFontPanel.m:553 */ "Font Panel" = "Font Panel"; /* File: ../Source/NSFontPanel.m:578 */ "Font preview" = "Font preview"; /* File: ../Source/NSFontPanel.m:241 */ "Multiple fonts selected" = "Multiple fonts selected"; /* File: ../Source/NSFontPanel.m:818 */ "NoFace" = "NoFace"; /* File: ../Source/NSFontPanel.m:810 */ "NoFamily" = "NoFamily"; /* File: ../Source/NSFontPanel.m:719 */ "Set" = "Set"; /* File: ../Source/NSFontPanel.m:639 */ "Size" = "Size"; /* File: ../Source/NSFontPanel.m:1142 */ "Typeface" = "Typeface"; /*** Strings from ../Source/NSMenu.m ***/ /* File: ../Source/NSMenu.m:260 */ "Services" = "Services"; /*** Strings from ../Source/NSOpenPanel.m ***/ /* File: ../Source/NSOpenPanel.m:92 */ "Open" = "Open"; /*** Strings from ../Source/NSPageLayout.m ***/ /* File: ../Source/NSPageLayout.m:741 */ /* File: ../Source/NSPageLayout.m:739 */ "(none)" = "(none)"; /* File: ../Source/NSPageLayout.m:964 */ "Bottom Margin" = "Bottom Margin"; /* File: ../Source/NSPageLayout.m:960 */ "Dimensions" = "Dimensions"; /* File: ../Source/NSPageLayout.m:1020 */ "Landscape" = "Landscape"; /* File: ../Source/NSPageLayout.m:965 */ "Left Margin" = "Left Margin"; /* File: ../Source/NSPageLayout.m:961 */ "Orientation" = "Orientation"; /* File: ../Source/NSPageLayout.m:1016 */ "Portrait" = "Portrait"; /* File: ../Source/NSPageLayout.m:966 */ "Right Margin" = "Right Margin"; /* File: ../Source/NSPageLayout.m:962 */ "Scale" = "Scale"; /* File: ../Source/NSPageLayout.m:963 */ "Top Margin" = "Top Margin"; /*** Strings from ../Source/NSPrintOperation.m ***/ /* File: ../Source/NSPrintOperation.m:677 */ "Error" = "Error"; /* File: ../Source/NSPrintOperation.m:677 */ "Printing error: %@" = "Printing error: %@"; /*** Strings from ../Source/NSPrintPanel.m ***/ /* File: ../Source/NSPrintPanel.m:179 */ "1 up" = "1 up"; /* File: ../Source/NSPrintPanel.m:179 */ "2 up" = "2 up"; /* File: ../Source/NSPrintPanel.m:179 */ "4 up" = "4 up"; /* File: ../Source/NSPrintPanel.m:179 */ "6 up" = "6 up"; /* File: ../Source/NSPrintPanel.m:180 */ "8 up" = "8 up"; /* File: ../Source/NSPrintPanel.m:407 */ "Faxing of print file not implemented" = "Faxing of print file not implemented"; /* File: ../Source/NSPrintPanel.m:781 */ /* File: ../Source/NSPrintPanel.m:774 */ /* File: ../Source/NSPrintPanel.m:643 */ "Manual" = "Manual"; /* File: ../Source/NSPrintPanel.m:145 */ "Print Panel" = "Print Panel"; /* File: ../Source/NSPrintPanel.m:407 */ "Sorry" = "Sorry"; /*** Strings from ../Source/NSSavePanel.m ***/ /* File: ../Source/NSSavePanel.m:277 */ "Home" = "Home"; /* File: ../Source/NSSavePanel.m:293 */ "Mount" = "Mount"; /* File: ../Source/NSSavePanel.m:434 */ /* File: ../Source/NSSavePanel.m:251 */ "Name:" = "Name:"; /* File: ../Source/NSSavePanel.m:1368 */ "No" = "No"; /* File: ../Source/NSSavePanel.m:1794 */ "Reading Directory " = "Reading Directory "; /* File: ../Source/NSSavePanel.m:1403 */ "Replace" = "Replace"; /* File: ../Source/NSSavePanel.m:242 */ "Show Hidden Files" = "Show Hidden Files"; /* File: ../Source/NSSavePanel.m:1380 */ "The directory '%@' could not be created." = "The directory '%@' could not be created."; /* File: ../Source/NSSavePanel.m:1367 */ "The directory '%@' does not exist, do you want to create it?" = "The directory '%@' does not exist, do you want to create it?"; /* File: ../Source/NSSavePanel.m:1402 */ "The file '%@' in '%@' exists. Replace it?" = "The file '%@' in '%@' exists. Replace it?"; /* File: ../Source/NSSavePanel.m:1391 */ "The path '%@' is not a directory." = "The path '%@' is not a directory."; /* File: ../Source/NSSavePanel.m:309 */ "Unmount" = "Unmount"; /* File: ../Source/NSSavePanel.m:1323 */ /* File: ../Source/NSSavePanel.m:1315 */ "Use .%@" = "Use .%@"; /* File: ../Source/NSSavePanel.m:1368 */ "Yes" = "Yes"; /* File: ../Source/NSSavePanel.m:1322 */ "You cannot save this document with extension '.%@'.\nThe required extension is '.%@'." = "You cannot save this document with extension '.%@'.\nThe required extension is '.%@'."; /* File: ../Source/NSSavePanel.m:1314 */ "You have used the extension '.%@'.\nThe standard extension is '.%@'.'" = "You have used the extension '.%@'.\nThe standard extension is '.%@'.'"; /*** Strings from ../Source/NSSpellChecker.m ***/ /* File: ../Source/NSSpellChecker.m:731 */ "Guess" = "Guess"; /*** Strings from ../Source/NSTextView.m ***/ /* File: ../Source/NSTextView.m:652 */ "Copy" = "Copy"; /* File: ../Source/NSTextView.m:651 */ "Cut" = "Cut"; /* File: ../Source/NSTextView.m:5894 */ "No Suggestions" = "No Suggestions"; /* File: ../Source/NSTextView.m:653 */ "Paste" = "Paste"; /*** Strings from ../Source/NSToolbarItem.m ***/ /* File: ../Source/NSToolbarItem.m:1122 */ "Customize" = "Customize"; /* File: ../Source/NSToolbarItem.m:1021 */ "Flexible Space" = "Flexible Space"; /* File: ../Source/NSToolbarItem.m:1099 */ "Fonts" = "Fonts"; /* File: ../Source/NSToolbarItem.m:1145 */ "Print..." = "Print..."; /* File: ../Source/NSToolbarItem.m:949 */ "Separator" = "Separator"; /* File: ../Source/NSToolbarItem.m:991 */ "Space" = "Space"; /*** Strings from ../Source/NSWindow.m ***/ /* File: ../Source/NSWindow.m:5317 */ "Hide Toolbar" = "Hide Toolbar"; /* File: ../Source/NSWindow.m:5319 */ "Show Toolbar" = "Show Toolbar"; gnustep-gui-0.24.0/Resources/French.lproj/0000775000076500007650000000000012256227325020254 5ustar brains99brains99gnustep-gui-0.24.0/Resources/French.lproj/Localizable.strings0000664000076500007650000004175112235010125024101 0ustar brains99brains99/* * Translator: Philippe Roussel * Date: March 2009 */ /*** French.lproj/Localizable.strings updated by make_strings 2013-10-28 21:50:06 +0100 add comments above this one ***/ /*** Keys found in multiple places ***/ /* File: ../Source/GSHelpManagerPanel.m:101 */ /* File: ../Source/NSAlert.m:1830 */ /* File: ../Source/NSPrintOperation.m:678 */ /* File: ../Source/NSPrintPanel.m:408 */ /* File: ../Source/NSSavePanel.m:334 */ "OK" = "OK"; /* File: ../Source/GSNibLoading.m:182 */ /* Comment: Info */ /* File: ../Source/NSApplication.m:2878 */ /* Comment: Title of the Info Panel */ /* File: ../Source/NSMenu.m:259 */ "Info" = "Info"; /* File: ../Source/GSNibLoading.m:165 */ /* Comment: Quit */ /* File: ../Source/NSApplication.m:3442 */ /* File: ../Source/NSApplication.m:4207 */ /* File: ../Source/NSDocumentController.m:1049 */ "Quit" = "Quitter"; /* File: ../Source/GSPrintOperation.m:157 */ /* File: ../Source/NSSavePanel.m:1381 */ /* File: ../Source/NSSavePanel.m:1392 */ "Dismiss" = "Abandonner"; /* File: ../Source/NSAlert.m:384 */ /* File: ../Source/NSDocument.m:474 */ /* File: ../Source/NSDocument.m:815 */ /* File: ../Source/NSDocument.m:1660 */ /* File: ../Source/NSDocumentController.m:955 */ /* File: ../Source/NSDocumentController.m:987 */ /* File: ../Source/NSSavePanel.m:318 */ /* File: ../Source/NSSavePanel.m:1330 */ /* File: ../Source/NSSavePanel.m:1403 */ "Cancel" = "Annuler"; /* File: ../Source/NSAlert.m:389 */ /* File: ../Source/NSDocument.m:474 */ "Don't Save" = "Fermer sans enregistrer"; /* File: ../Source/NSDocument.m:474 */ /* File: ../Source/NSDocument.m:815 */ /* File: ../Source/NSDocument.m:1183 */ /* File: ../Source/NSSavePanel.m:435 */ /* File: ../Source/NSSavePanel.m:1327 */ /* File: ../Source/NSSavePanel.m:1366 */ /* File: ../Source/NSSavePanel.m:1379 */ /* File: ../Source/NSSavePanel.m:1390 */ /* File: ../Source/NSSavePanel.m:1401 */ "Save" = "Enregistrer"; /* File: ../Source/GSHelpManagerPanel.m:70 */ /* File: ../Source/NSHelpPanel.m:154 */ "Help" = "Aide"; /* File: ../Source/GSPrintOperation.m:155 */ /* File: ../Source/NSFontPanel.m:706 */ "Preview" = "Aper\U00E7u"; /* File: ../Source/NSDocument.m:1658 */ /* File: ../Source/NSDocument.m:1660 */ /* File: ../Source/NSFontPanel.m:696 */ "Revert" = "R\U00E9tablir"; /* File: ../Source/NSColorPanel.m:245 */ /* File: ../Source/NSToolbarItem.m:1076 */ "Colors" = "Couleurs"; /* File: ../Source/NSPageLayout.m:967 */ /* File: ../Source/NSPageLayout.m:1038 */ /* File: ../Source/NSPrintPanel.m:630 */ /* File: ../Source/NSPrintPanel.m:676 */ "Unknown" = "Inconnu"; /* File: ../Source/NSDocument.m:1109 */ /* File: ../Source/NSPrintPanel.m:350 */ "File Type" = "Type de fichier"; /* File: ../Source/GSCharacterPanel.m:173 */ /* File: ../Source/NSPageLayout.m:959 */ "Name" = "Nom"; /* File: ../Source/GSCharacterPanel.m:154 */ /* Flag: untranslated */ /* File: ../Source/NSFontPanel.m:738 */ /* Flag: untranslated */ "Character Panel" = "Character Panel"; /* File: ../Source/GSTextFinder.m:332 */ /* Flag: untranslated */ /* File: ../Source/GSTextFinder.m:381 */ /* Flag: untranslated */ "Not found" = "Not found"; /*** Unmatched/untranslated keys ***/ /* File: ../Source/GSCharacterPanel.m:182 */ /* Flag: untranslated */ "Code Point" = "Code Point"; /* File: ../Source/GSCharacterPanel.m:191 */ /* Flag: untranslated */ "Unicode Block" = "Unicode Block"; /* File: ../Source/GSInfoPanel.m:339 */ /* Flag: untranslated */ "Release: " = "Release: "; /* File: ../Source/GSTextFinder.m:408 */ /* Flag: untranslated */ "%d replaced" = "%d replaced"; /* File: ../Source/GSToolbarView.m:894 */ /* Flag: untranslated */ "Customize Toolbar" = "Customize Toolbar"; /* File: ../Source/NSAlert.m:2001 */ /* Flag: untranslated */ "No information" = "No information"; /* File: ../Source/NSApplication.m:4197 */ /* Flag: untranslated */ "Show" = "Show"; /* File: ../Source/NSApplication.m:4203 */ /* Flag: untranslated */ "Hide" = "Hide"; /* File: ../Source/NSFontPanel.m:810 */ /* Flag: untranslated */ "NoFamily" = "NoFamily"; /* File: ../Source/NSFontPanel.m:818 */ /* Flag: untranslated */ "NoFace" = "NoFace"; /* File: ../Source/NSFontPanel.m:1142 */ /* Flag: untranslated */ "Typeface" = "Typeface"; /* File: ../Source/NSPrintPanel.m:179 */ /* Flag: untranslated */ "6 up" = "6 up"; /* File: ../Source/NSPrintPanel.m:179 */ /* Flag: untranslated */ "1 up" = "1 up"; /* File: ../Source/NSPrintPanel.m:179 */ /* Flag: untranslated */ "2 up" = "2 up"; /* File: ../Source/NSPrintPanel.m:179 */ /* Flag: untranslated */ "4 up" = "4 up"; /* File: ../Source/NSPrintPanel.m:180 */ /* Flag: untranslated */ "8 up" = "8 up"; /* File: ../Source/NSPrintPanel.m:407 */ /* Flag: untranslated */ "Faxing of print file not implemented" = "Faxing of print file not implemented"; /* File: ../Source/NSSavePanel.m:242 */ /* Flag: untranslated */ "Show Hidden Files" = "Show Hidden Files"; /* File: ../Source/NSSavePanel.m:277 */ /* Flag: untranslated */ "Home" = "Home"; /* File: ../Source/NSSavePanel.m:293 */ /* Flag: untranslated */ "Mount" = "Mount"; /* File: ../Source/NSSavePanel.m:309 */ /* Flag: untranslated */ "Unmount" = "Unmount"; /* File: ../Source/NSSavePanel.m:1314 */ /* Flag: untranslated */ "You have used the extension '.%@'.\nThe standard extension is '.%@'.'" = "You have used the extension '.%@'.\nThe standard extension is '.%@'.'"; /* File: ../Source/NSSavePanel.m:1322 */ /* Flag: untranslated */ "You cannot save this document with extension '.%@'.\nThe required extension is '.%@'." = "You cannot save this document with extension '.%@'.\nThe required extension is '.%@'."; /* File: ../Source/NSSpellChecker.m:731 */ /* Flag: untranslated */ "Guess" = "Guess"; /* File: ../Source/NSTextView.m:651 */ /* Flag: untranslated */ "Cut" = "Cut"; /* File: ../Source/NSTextView.m:652 */ /* Flag: untranslated */ "Copy" = "Copy"; /* File: ../Source/NSTextView.m:653 */ /* Flag: untranslated */ "Paste" = "Paste"; /* File: ../Source/NSTextView.m:5894 */ /* Flag: untranslated */ "No Suggestions" = "No Suggestions"; /* File: ../Source/NSToolbarItem.m:949 */ /* Flag: untranslated */ "Separator" = "Separator"; /*** Strings from ../Source/Functions.m ***/ /* File: ../Source/Functions.m:85 */ "Cannot load the main model file '%@'" = "Impossible de charger le fichier mod\U00E8le principal '%@'"; /*** Strings from ../Source/GSInfoPanel.m ***/ /* File: ../Source/GSInfoPanel.m:451 */ "Author: " = "Auteur: "; /* File: ../Source/GSInfoPanel.m:455 */ "Authors: " = "Auteurs: "; /* File: ../Source/GSInfoPanel.m:396 */ "Copyright Information Not Available" = "Informations de Copyright Non Disponibles"; /* File: ../Source/GSInfoPanel.m:482 */ /* File: ../Source/GSInfoPanel.m:187 */ "Current theme" = "Th\U00E8me actuel"; /*** Strings from ../Source/GSPrintOperation.m ***/ /* File: ../Source/GSPrintOperation.m:156 */ "Problem running the preview application '%@' perhaps you need to set your NSPreviewApp user default" = "Probl\U00E8me lors du lancement de l'application de pr\U00E9visualisation '%@', peut-\U00EAtre devriez-vous d\U00E9finir la valeur de NSPreviewApp"; /*** Strings from ../Source/GSThemeDrawing.m ***/ /* File: ../Source/GSThemeDrawing.m:188 */ "?" = "?"; /*** Strings from ../Source/GSThemeInspector.m ***/ /* File: ../Source/GSThemeInspector.m:141 */ "Version: %@" = "Version: %@"; /*** Strings from ../Source/GSThemePanel.m ***/ /* File: ../Source/GSThemePanel.m:229 */ /* File: ../Source/GSThemePanel.m:197 */ "Make this the default theme" = "Utiliser ce th\U00E8me par d\U00E9fault"; /* File: ../Source/GSThemePanel.m:234 */ /* File: ../Source/GSThemePanel.m:193 */ "Revert default theme" = "Revenir au th\U00E8me par d\U00E9fault"; /* File: ../Source/GSThemePanel.m:115 */ "Themes" = "Th\U00E8mes"; /*** Strings from ../Source/NSAlert.m ***/ /* File: ../Source/NSAlert.m:2000 */ "Alert" = "Attention"; /*** Strings from ../Source/NSApplication.m ***/ /* File: ../Source/NSApplication.m:138 */ "Abort" = "Interrompre"; /* File: ../Source/NSApplication.m:323 */ "Backend at path %@ doesn't contain the GSBackend class" = "Le backend de chemin %@ ne contient pas la classe GSBackend"; /* File: ../Source/NSApplication.m:311 */ "Can't create NSBundle object for backend at path %@" = "Impossible de cr\U00E9er une instance de NSBundle pour le backend de chemin %@"; /* File: ../Source/NSApplication.m:316 */ "Can't load object file from backend at path %@" = "Impossible de charger le fichier objet du backend de chemin %@"; /* File: ../Source/NSApplication.m:135 */ "Critical Error in %@" = "Erreur critique dans %@"; /* File: ../Source/NSApplication.m:141 */ "Debug" = "D\U00E9boguer"; /* File: ../Source/NSApplication.m:1198 */ "Problem during launch app notification: %@" = "Probl\U00E8me lors de la notification du lancement de l'application : %@"; /* File: ../Source/NSApplication.m:304 */ "Unable to find backend %@" = "Impossible de trouver le backend %@"; /* File: ../Source/NSApplication.m:972 */ "[NSApplication -init] called more than once" = "[NSApplication -init] appell\U00E9e plus d'une fois"; /* File: ../Source/NSApplication.m:3315 */ "reported exception - %@" = "Exception signal\U00E9e - %@"; /*** Strings from ../Source/NSAttributedString.m ***/ /* File: ../Source/NSAttributedString.m:1060 */ /* Comment: Error description */ /* File: ../Source/NSAttributedString.m:1083 */ /* Comment: Error description */ "Could not create data for type." = "Impossible de cr\U00E9er des donn\U00E9es pour ce type."; /* File: ../Source/NSAttributedString.m:927 */ /* Comment: Error description */ "Could not load data from URL." = "Impossible de charger des donn\U00E9es depuis l'URL."; /* File: ../Source/NSAttributedString.m:863 */ /* Comment: Error description */ "Could not load data." = "Impossible de charger les donn\U00E9es."; /* File: ../Source/NSAttributedString.m:762 */ /* Comment: Error description */ "No data specified for data loading." = "Pas de donn\U00E9es sp\U00E9cifi\U00E9es."; /* File: ../Source/NSAttributedString.m:1033 */ /* Comment: Error description */ "No type specified for data." = "Aucun type pr\U00E9cis\U00E9 pour les donn\U00E9es."; /*** Strings from ../Source/NSBitmapImageRep.m ***/ /* File: ../Source/NSBitmapImageRep.m:1645 */ "CCITTFAX3 Compression" = "Compression CCITTFAX3"; /* File: ../Source/NSBitmapImageRep.m:1646 */ "CCITTFAX4 Compression" = "Compression CCITTFAX4"; /* File: ../Source/NSBitmapImageRep.m:1648 */ "JPEG Compression" = "Compression JPEG"; /* File: ../Source/NSBitmapImageRep.m:1647 */ "LZW Compression" = "Compression LZW"; /* File: ../Source/NSBitmapImageRep.m:1649 */ "NEXT Compression" = "Compression NEXT"; /* File: ../Source/NSBitmapImageRep.m:1644 */ "No Compression" = "Pas de compression"; /* File: ../Source/NSBitmapImageRep.m:1651 */ "Old JPEG Compression" = "Ancienne compression JPEG"; /* File: ../Source/NSBitmapImageRep.m:1650 */ "PackBits Compression" = "Compression PackBits"; /*** Strings from ../Source/NSColorPanel.m ***/ /* File: ../Source/NSColorPanel.m:309 */ "Opacity" = "Opacit\U00E9"; /*** Strings from ../Source/NSColorSpace.m ***/ /* File: ../Source/NSColorSpace.m:143 */ /* Comment: color space */ "CMYK" = "CMYK"; /* File: ../Source/NSColorSpace.m:147 */ /* Comment: color space */ "DeviceN" = "DeviceN"; /* File: ../Source/NSColorSpace.m:139 */ /* Comment: color space */ "Grayscale" = "Niveaux de gris"; /* File: ../Source/NSColorSpace.m:145 */ /* Comment: color space */ "LAB" = "LAB"; /* File: ../Source/NSColorSpace.m:141 */ /* Comment: color space */ "RGB" = "RGB"; /* File: ../Source/NSColorSpace.m:137 */ /* Comment: color space */ "unknown" = "inconnu"; /*** Strings from ../Source/NSDocument.m ***/ /* File: ../Source/NSDocument.m:1659 */ "%@ has been edited. Are you sure you want to undo changes?" = "%@ a \U00E9t\U00E9 modifi\U00E9. Etes-vous s\U00FBr de vouloir annuler les modifications ?"; /* File: ../Source/NSDocument.m:473 */ "%@ has changed. Save?" = "%@ a \U00E9t\U00E9 modifi\U00E9. Enregistrer ?"; /* File: ../Source/NSDocument.m:814 */ "Can't create backup file. Save anyways?" = "Impossible de cr\U00E9er le fichier de sauvegarde. Enregistrer quand m\U006Dme ?"; /* File: ../Source/NSDocument.m:472 */ "Close" = "Fermer"; /* File: ../Source/NSDocument.m:142 */ "Could not load URL %@." = "Impossible de charger l'URL %@."; /* File: ../Source/NSDocument.m:119 */ "Could not load file %@." = "Impossible de charger le fichier %@."; /* File: ../Source/NSDocument.m:813 */ "File Error" = "Erreur fichier"; /* File: ../Source/NSDocument.m:141 */ /* File: ../Source/NSDocument.m:118 */ "Load failed" = "Erreur lors du chargement"; /* File: ../Source/NSDocument.m:1179 */ "Save As" = "Enregistrer sous"; /* File: ../Source/NSDocument.m:1180 */ "Save To" = "Enregistrer une copie sous"; /* File: ../Source/NSDocument.m:569 */ "Untitled-%d" = "SansTitre-%d"; /*** Strings from ../Source/NSDocumentController.m ***/ /* File: ../Source/NSDocumentController.m:1692 */ "Clear List" = "Vider la liste"; /* File: ../Source/NSDocumentController.m:1056 */ "Power Off" = "Eteindre"; /* File: ../Source/NSDocumentController.m:1008 */ /* File: ../Source/NSDocumentController.m:966 */ "Quit Anyway" = "Quitter sans enregistrer"; /* File: ../Source/NSDocumentController.m:1006 */ /* File: ../Source/NSDocumentController.m:964 */ "Review Unsaved" = "Passer en revue"; /* File: ../Source/NSDocumentController.m:1013 */ /* File: ../Source/NSDocumentController.m:963 */ "You have unsaved documents" = "Certains documents ne sont pas sauvegard\U00E9s"; /*** Strings from ../Source/NSFontPanel.m ***/ /* File: ../Source/NSFontPanel.m:1138 */ "Family" = "Famille"; /* File: ../Source/NSFontPanel.m:553 */ "Font Panel" = "Choix d'une police"; /* File: ../Source/NSFontPanel.m:578 */ "Font preview" = "Aper\U00E7u"; /* File: ../Source/NSFontPanel.m:241 */ "Multiple fonts selected" = "Plusieurs polices s\U00E9lectionn\U00E9es"; /* File: ../Source/NSFontPanel.m:719 */ "Set" = "Appliquer"; /* File: ../Source/NSFontPanel.m:639 */ "Size" = "Taille"; /*** Strings from ../Source/NSMenu.m ***/ /* File: ../Source/NSMenu.m:260 */ "Services" = "Services"; /*** Strings from ../Source/NSOpenPanel.m ***/ /* File: ../Source/NSOpenPanel.m:92 */ "Open" = "Ouvrir"; /*** Strings from ../Source/NSPageLayout.m ***/ /* File: ../Source/NSPageLayout.m:741 */ /* File: ../Source/NSPageLayout.m:739 */ "(none)" = "(aucun)"; /* File: ../Source/NSPageLayout.m:964 */ "Bottom Margin" = "Marge basse"; /* File: ../Source/NSPageLayout.m:960 */ "Dimensions" = "Dimensions"; /* File: ../Source/NSPageLayout.m:1020 */ "Landscape" = "Paysage"; /* File: ../Source/NSPageLayout.m:965 */ "Left Margin" = "Marge gauche"; /* File: ../Source/NSPageLayout.m:961 */ "Orientation" = "Orientation"; /* File: ../Source/NSPageLayout.m:1016 */ "Portrait" = "Portrait"; /* File: ../Source/NSPageLayout.m:966 */ "Right Margin" = "Marge droite"; /* File: ../Source/NSPageLayout.m:962 */ "Scale" = "Echelle"; /* File: ../Source/NSPageLayout.m:963 */ "Top Margin" = "Marge haute"; /*** Strings from ../Source/NSPrintOperation.m ***/ /* File: ../Source/NSPrintOperation.m:677 */ "Error" = "Erreur"; /* File: ../Source/NSPrintOperation.m:677 */ "Printing error: %@" = "Erreur d'impression: %@"; /*** Strings from ../Source/NSPrintPanel.m ***/ /* File: ../Source/NSPrintPanel.m:781 */ /* File: ../Source/NSPrintPanel.m:774 */ /* File: ../Source/NSPrintPanel.m:643 */ "Manual" = "Manuel"; /* File: ../Source/NSPrintPanel.m:145 */ "Print Panel" = "Impression"; /* File: ../Source/NSPrintPanel.m:407 */ "Sorry" = "D\U00E9sol\U00E9"; /*** Strings from ../Source/NSSavePanel.m ***/ /* File: ../Source/NSSavePanel.m:434 */ /* File: ../Source/NSSavePanel.m:251 */ "Name:" = "Nom:"; /* File: ../Source/NSSavePanel.m:1368 */ "No" = "Non"; /* File: ../Source/NSSavePanel.m:1794 */ "Reading Directory " = "Lecture du r\U00E9pertoire "; /* File: ../Source/NSSavePanel.m:1403 */ "Replace" = "Remplacer"; /* File: ../Source/NSSavePanel.m:1380 */ "The directory '%@' could not be created." = "Impossible de cr\U00E9er le r\U00E9pertoire '%@'."; /* File: ../Source/NSSavePanel.m:1367 */ "The directory '%@' does not exist, do you want to create it?" = "Le r\U00E9pertoire '%@' n'existe pas, voulez-vous le cr\U00E9er ?"; /* File: ../Source/NSSavePanel.m:1402 */ "The file '%@' in '%@' exists. Replace it?" = "Le fichier '%@' existe dans '%@'. Voulez-vous le remplacer ?"; /* File: ../Source/NSSavePanel.m:1391 */ "The path '%@' is not a directory." = "Le chemin '%@' n'est pas un r\U00E9pertoire."; /* File: ../Source/NSSavePanel.m:1323 */ /* File: ../Source/NSSavePanel.m:1315 */ "Use .%@" = "Utiliser .%@"; /* File: ../Source/NSSavePanel.m:1368 */ "Yes" = "Oui"; /*** Strings from ../Source/NSToolbarItem.m ***/ /* File: ../Source/NSToolbarItem.m:1122 */ "Customize" = "Personnaliser"; /* File: ../Source/NSToolbarItem.m:1021 */ "Flexible Space" = "Espace souple"; /* File: ../Source/NSToolbarItem.m:1099 */ "Fonts" = "Polices"; /* File: ../Source/NSToolbarItem.m:1145 */ "Print..." = "Imprimer..."; /* File: ../Source/NSToolbarItem.m:991 */ "Space" = "Espace"; /*** Strings from ../Source/NSWindow.m ***/ /* File: ../Source/NSWindow.m:5317 */ "Hide Toolbar" = "Cacher la barre d'outils"; /* File: ../Source/NSWindow.m:5319 */ "Show Toolbar" = "Afficher la barre d'outils"; gnustep-gui-0.24.0/Resources/GNUmakefile0000664000076500007650000000460111537371647020005 0ustar brains99brains99# # Resources makefile for gnustep-gui # Copyright (C) 2001, 2002 Free Software Foundation, Inc. # # Written by: Nicola Pero # Date: December 2001, September 2002 # # This file is part of the GNUstep GUI Library. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-gui GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../gui.make include $(GNUSTEP_MAKEFILES)/common.make include ../Version libgnustep-gui_INTERFACE_VERSION=$(GNUSTEP_GUI_MAJOR_VERSION).$(GNUSTEP_GUI_MINOR_VERSION) RESOURCE_SET_NAME = gui-resources gui-resources_INSTALL_DIR = $(GNUSTEP_LIBRARY)/Libraries/gnustep-gui/Versions/$(libgnustep-gui_INTERFACE_VERSION)/Resources gui-resources_LANGUAGES = English Italian Lojban Esperanto German French Spanish gui-resources_LOCALIZED_RESOURCE_FILES = Localizable.strings include $(GNUSTEP_MAKEFILES)/resource-set.make # The following code is so that by typing 'make strings', all the # Localizable.strings files are updated for the new localizable # strings in the source code. If we had the localized resources in # the Source directory, this would be supported automatically by # gnustep-make (but it would parse all files all the times ... which # will be reasonable when more than two files actually contain # something to translate :-) # The list of OBJC_FILES containing localizable strings strings_OBJC_FILES = \ NSApplication.m \ NSDocument.m # The list of HEADER_FILES containing localizable strings strings_HEADER_FILES = after-strings:: make_strings -L "$(gui-resources_LANGUAGES)" \ $(addprefix ../Source/,$(strings_OBJC_FILES)) \ $(addprefix ../Headers/Additions/GNUstepGUI/,$(strings_HEADER_FILES)) gnustep-gui-0.24.0/Resources/Lojban.lproj/0000775000076500007650000000000012256227325020254 5ustar brains99brains99gnustep-gui-0.24.0/Resources/Lojban.lproj/Localizable.strings0000664000076500007650000004624012235010125024077 0ustar brains99brains99/*** Lojban.lproj/Localizable.strings updated by make_strings 2013-10-28 21:50:17 +0100 add comments above this one ***/ /*** Keys found in multiple places ***/ /* File: ../Source/GSPrintOperation.m:157 */ /* Flag: untranslated */ /* File: ../Source/NSSavePanel.m:1381 */ /* Flag: untranslated */ /* File: ../Source/NSSavePanel.m:1392 */ /* Flag: untranslated */ "Dismiss" = "e'i nai"; /* File: ../Source/GSNibLoading.m:182 */ /* Comment: Info */ /* Flag: untranslated */ /* File: ../Source/NSApplication.m:2878 */ /* Comment: Title of the Info Panel */ /* Flag: untranslated */ /* File: ../Source/NSMenu.m:259 */ /* Flag: untranslated */ "Info" = "Info"; /* File: ../Source/GSNibLoading.m:165 */ /* Comment: Quit */ /* Flag: untranslated */ /* File: ../Source/NSApplication.m:3442 */ /* Flag: untranslated */ /* File: ../Source/NSApplication.m:4207 */ /* Flag: untranslated */ /* File: ../Source/NSDocumentController.m:1049 */ /* Flag: untranslated */ "Quit" = "fanmo"; /* File: ../Source/NSDocument.m:118 */ /* Flag: untranslated */ /* File: ../Source/NSDocument.m:141 */ /* Flag: untranslated */ "Load failed" = "na'e tcidu"; /* File: ../Source/NSDocument.m:474 */ /* Flag: untranslated */ /* File: ../Source/NSDocument.m:815 */ /* Flag: untranslated */ /* File: ../Source/NSDocument.m:1183 */ /* Flag: untranslated */ /* File: ../Source/NSSavePanel.m:435 */ /* Flag: untranslated */ /* File: ../Source/NSSavePanel.m:1327 */ /* Flag: untranslated */ /* File: ../Source/NSSavePanel.m:1366 */ /* Flag: untranslated */ /* File: ../Source/NSSavePanel.m:1379 */ /* Flag: untranslated */ /* File: ../Source/NSSavePanel.m:1390 */ /* Flag: untranslated */ /* File: ../Source/NSSavePanel.m:1401 */ /* Flag: untranslated */ "Save" = "Save"; /* File: ../Source/NSAlert.m:384 */ /* Flag: untranslated */ /* File: ../Source/NSDocument.m:474 */ /* Flag: untranslated */ /* File: ../Source/NSDocument.m:815 */ /* Flag: untranslated */ /* File: ../Source/NSDocument.m:1660 */ /* Flag: untranslated */ /* File: ../Source/NSDocumentController.m:955 */ /* Flag: untranslated */ /* File: ../Source/NSDocumentController.m:987 */ /* Flag: untranslated */ /* File: ../Source/NSSavePanel.m:318 */ /* Flag: untranslated */ /* File: ../Source/NSSavePanel.m:1330 */ /* Flag: untranslated */ /* File: ../Source/NSSavePanel.m:1403 */ /* Flag: untranslated */ "Cancel" = "Cancel"; /* File: ../Source/NSDocument.m:1658 */ /* Flag: untranslated */ /* File: ../Source/NSDocument.m:1660 */ /* Flag: untranslated */ /* File: ../Source/NSFontPanel.m:696 */ /* Flag: untranslated */ "Revert" = "Revert"; /* File: ../Source/GSPrintOperation.m:155 */ /* Flag: untranslated */ /* File: ../Source/NSFontPanel.m:706 */ /* Flag: untranslated */ "Preview" = "Preview"; /* File: ../Source/GSHelpManagerPanel.m:101 */ /* Flag: untranslated */ /* File: ../Source/NSAlert.m:1830 */ /* Flag: untranslated */ /* File: ../Source/NSPrintOperation.m:678 */ /* Flag: untranslated */ /* File: ../Source/NSPrintPanel.m:408 */ /* Flag: untranslated */ /* File: ../Source/NSSavePanel.m:334 */ /* Flag: untranslated */ "OK" = "OK"; /* File: ../Source/NSAlert.m:389 */ /* Flag: untranslated */ /* File: ../Source/NSDocument.m:474 */ /* Flag: untranslated */ "Don't Save" = "na'e ciska"; /* File: ../Source/NSDocumentController.m:963 */ /* Flag: untranslated */ /* File: ../Source/NSDocumentController.m:1013 */ /* Flag: untranslated */ "You have unsaved documents" = "You have unsaved documents"; /* File: ../Source/NSDocumentController.m:964 */ /* Flag: untranslated */ /* File: ../Source/NSDocumentController.m:1006 */ /* Flag: untranslated */ "Review Unsaved" = "Review Unsaved"; /* File: ../Source/NSDocumentController.m:966 */ /* Flag: untranslated */ /* File: ../Source/NSDocumentController.m:1008 */ /* Flag: untranslated */ "Quit Anyway" = "Quit Anyway"; /* File: ../Source/GSCharacterPanel.m:154 */ /* Flag: untranslated */ /* File: ../Source/NSFontPanel.m:738 */ /* Flag: untranslated */ "Character Panel" = "Character Panel"; /* File: ../Source/GSCharacterPanel.m:173 */ /* Flag: untranslated */ /* File: ../Source/NSPageLayout.m:959 */ /* Flag: untranslated */ "Name" = "Name"; /* File: ../Source/GSHelpManagerPanel.m:70 */ /* Flag: untranslated */ /* File: ../Source/NSHelpPanel.m:154 */ /* Flag: untranslated */ "Help" = "Help"; /* File: ../Source/GSInfoPanel.m:187 */ /* Flag: untranslated */ /* File: ../Source/GSInfoPanel.m:482 */ /* Flag: untranslated */ "Current theme" = "Current theme"; /* File: ../Source/GSTextFinder.m:332 */ /* Flag: untranslated */ /* File: ../Source/GSTextFinder.m:381 */ /* Flag: untranslated */ "Not found" = "Not found"; /* File: ../Source/GSThemePanel.m:193 */ /* Flag: untranslated */ /* File: ../Source/GSThemePanel.m:234 */ /* Flag: untranslated */ "Revert default theme" = "Revert default theme"; /* File: ../Source/GSThemePanel.m:197 */ /* Flag: untranslated */ /* File: ../Source/GSThemePanel.m:229 */ /* Flag: untranslated */ "Make this the default theme" = "Make this the default theme"; /* File: ../Source/NSAttributedString.m:1060 */ /* Comment: Error description */ /* Flag: untranslated */ /* File: ../Source/NSAttributedString.m:1083 */ /* Comment: Error description */ /* Flag: untranslated */ "Could not create data for type." = "Could not create data for type."; /* File: ../Source/NSColorPanel.m:245 */ /* Flag: untranslated */ /* File: ../Source/NSToolbarItem.m:1076 */ /* Flag: untranslated */ "Colors" = "Colors"; /* File: ../Source/NSDocument.m:1109 */ /* Flag: untranslated */ /* File: ../Source/NSPrintPanel.m:350 */ /* Flag: untranslated */ "File Type" = "File Type"; /* File: ../Source/NSPageLayout.m:739 */ /* Flag: untranslated */ /* File: ../Source/NSPageLayout.m:741 */ /* Flag: untranslated */ "(none)" = "(none)"; /* File: ../Source/NSPageLayout.m:967 */ /* Flag: untranslated */ /* File: ../Source/NSPageLayout.m:1038 */ /* Flag: untranslated */ /* File: ../Source/NSPrintPanel.m:630 */ /* Flag: untranslated */ /* File: ../Source/NSPrintPanel.m:676 */ /* Flag: untranslated */ "Unknown" = "Unknown"; /* File: ../Source/NSPrintPanel.m:643 */ /* Flag: untranslated */ /* File: ../Source/NSPrintPanel.m:774 */ /* Flag: untranslated */ /* File: ../Source/NSPrintPanel.m:781 */ /* Flag: untranslated */ "Manual" = "Manual"; /* File: ../Source/NSSavePanel.m:251 */ /* Flag: untranslated */ /* File: ../Source/NSSavePanel.m:434 */ /* Flag: untranslated */ "Name:" = "Name:"; /* File: ../Source/NSSavePanel.m:1315 */ /* Flag: untranslated */ /* File: ../Source/NSSavePanel.m:1323 */ /* Flag: untranslated */ "Use .%@" = "Use .%@"; /*** Unmatched/untranslated keys ***/ /* File: ../Source/Functions.m:85 */ /* Flag: untranslated */ "Cannot load the main model file '%@'" = "Cannot load the main model file '%@'"; /* File: ../Source/GSCharacterPanel.m:182 */ /* Flag: untranslated */ "Code Point" = "Code Point"; /* File: ../Source/GSCharacterPanel.m:191 */ /* Flag: untranslated */ "Unicode Block" = "Unicode Block"; /* File: ../Source/GSInfoPanel.m:339 */ /* Flag: untranslated */ "Release: " = "Release: "; /* File: ../Source/GSInfoPanel.m:396 */ /* Flag: untranslated */ "Copyright Information Not Available" = "Copyright Information Not Available"; /* File: ../Source/GSInfoPanel.m:451 */ /* Flag: untranslated */ "Author: " = "Author: "; /* File: ../Source/GSInfoPanel.m:455 */ /* Flag: untranslated */ "Authors: " = "Authors: "; /* File: ../Source/GSPrintOperation.m:156 */ /* Flag: untranslated */ "Problem running the preview application '%@' perhaps you need to set your NSPreviewApp user default" = "zo'e nabmi le samru'e gy. %@ gy. do nitcu cu jarpu'i la gy. NSPreviewApp gy. defaults gy."; /* File: ../Source/GSTextFinder.m:408 */ /* Flag: untranslated */ "%d replaced" = "%d replaced"; /* File: ../Source/GSThemeDrawing.m:188 */ /* Flag: untranslated */ "?" = "?"; /* File: ../Source/GSThemeInspector.m:141 */ /* Flag: untranslated */ "Version: %@" = "Version: %@"; /* File: ../Source/GSThemePanel.m:115 */ /* Flag: untranslated */ "Themes" = "Themes"; /* File: ../Source/GSToolbarView.m:894 */ /* Flag: untranslated */ "Customize Toolbar" = "Customize Toolbar"; /* File: ../Source/NSAlert.m:2000 */ /* Flag: untranslated */ "Alert" = "Alert"; /* File: ../Source/NSAlert.m:2001 */ /* Flag: untranslated */ "No information" = "No information"; /* File: ../Source/NSApplication.m:135 */ /* Flag: untranslated */ "Critical Error in %@" = "la gy. %@ gy. srera."; /* File: ../Source/NSApplication.m:138 */ /* Flag: untranslated */ "Abort" = "spofu"; /* File: ../Source/NSApplication.m:141 */ /* Flag: untranslated */ "Debug" = "faksre'i"; /* File: ../Source/NSApplication.m:304 */ /* Flag: untranslated */ "Unable to find backend %@" = "na'e facki la gy. backend %@ gy."; /* File: ../Source/NSApplication.m:311 */ /* Flag: untranslated */ "Can't create NSBundle object for backend at path %@" = "finti fe le sibdai gy. NSBundle gy. le datnyveiste gy. %@ gy."; /* File: ../Source/NSApplication.m:316 */ /* Flag: untranslated */ "Can't load object file from backend at path %@" = "na'e tcidu fe le datnyvei la gy. backend %@ gy."; /* File: ../Source/NSApplication.m:323 */ /* Flag: untranslated */ "Backend at path %@ doesn't contain the GSBackend class" = "gy. backend %@ gy. kunti gy. GSBackend gy."; /* File: ../Source/NSApplication.m:972 */ /* Flag: untranslated */ "[NSApplication -init] called more than once" = "clacpe fe gy. [NSApplication -init] gy. du'eroi"; /* File: ../Source/NSApplication.m:1198 */ /* Flag: untranslated */ "Problem during launch app notification: %@" = "zo'e nabmi le samru'e cu notci gy. %@ gy."; /* File: ../Source/NSApplication.m:3315 */ /* Flag: untranslated */ "reported exception - %@" = "le nafmupli gy. %@ gy."; /* File: ../Source/NSApplication.m:4197 */ /* Flag: untranslated */ "Show" = "Show"; /* File: ../Source/NSApplication.m:4203 */ /* Flag: untranslated */ "Hide" = "Hide"; /* File: ../Source/NSAttributedString.m:762 */ /* Comment: Error description */ /* Flag: untranslated */ "No data specified for data loading." = "No data specified for data loading."; /* File: ../Source/NSAttributedString.m:863 */ /* Comment: Error description */ /* Flag: untranslated */ "Could not load data." = "Could not load data."; /* File: ../Source/NSAttributedString.m:927 */ /* Comment: Error description */ /* Flag: untranslated */ "Could not load data from URL." = "Could not load data from URL."; /* File: ../Source/NSAttributedString.m:1033 */ /* Comment: Error description */ /* Flag: untranslated */ "No type specified for data." = "No type specified for data."; /* File: ../Source/NSBitmapImageRep.m:1644 */ /* Flag: untranslated */ "No Compression" = "na'e jdika"; /* File: ../Source/NSBitmapImageRep.m:1645 */ /* Flag: untranslated */ "CCITTFAX3 Compression" = "le djika gy. CCITTFAX3 gy."; /* File: ../Source/NSBitmapImageRep.m:1646 */ /* Flag: untranslated */ "CCITTFAX4 Compression" = "le jdika gy. CCITTFAX4 gy."; /* File: ../Source/NSBitmapImageRep.m:1647 */ /* Flag: untranslated */ "LZW Compression" = "le jdika gy. LZW gy."; /* File: ../Source/NSBitmapImageRep.m:1648 */ /* Flag: untranslated */ "JPEG Compression" = "le jdika gy. JPEG gy."; /* File: ../Source/NSBitmapImageRep.m:1649 */ /* Flag: untranslated */ "NEXT Compression" = "le jdika gy. NEXT gy."; /* File: ../Source/NSBitmapImageRep.m:1650 */ /* Flag: untranslated */ "PackBits Compression" = "le jdika gy. PackBits gy."; /* File: ../Source/NSBitmapImageRep.m:1651 */ /* Flag: untranslated */ "Old JPEG Compression" = "le jdika le clare'i gy. JPEG gy."; /* File: ../Source/NSColorPanel.m:309 */ /* Flag: untranslated */ "Opacity" = "Opacity"; /* File: ../Source/NSColorSpace.m:137 */ /* Comment: color space */ /* Flag: untranslated */ "unknown" = "unknown"; /* File: ../Source/NSColorSpace.m:139 */ /* Comment: color space */ /* Flag: untranslated */ "Grayscale" = "Grayscale"; /* File: ../Source/NSColorSpace.m:141 */ /* Comment: color space */ /* Flag: untranslated */ "RGB" = "RGB"; /* File: ../Source/NSColorSpace.m:143 */ /* Comment: color space */ /* Flag: untranslated */ "CMYK" = "CMYK"; /* File: ../Source/NSColorSpace.m:145 */ /* Comment: color space */ /* Flag: untranslated */ "LAB" = "LAB"; /* File: ../Source/NSColorSpace.m:147 */ /* Comment: color space */ /* Flag: untranslated */ "DeviceN" = "DeviceN"; /* File: ../Source/NSDocument.m:119 */ /* Flag: untranslated */ "Could not load file %@." = "na'e tcidu le datnyvei gy. %@. gy."; /* File: ../Source/NSDocument.m:142 */ /* Flag: untranslated */ "Could not load URL %@." = "na'e tcidu la gy. URL %@ gy."; /* File: ../Source/NSDocument.m:472 */ /* Flag: untranslated */ "Close" = "fanmo"; /* File: ../Source/NSDocument.m:473 */ /* Flag: untranslated */ "%@ has changed. Save?" = "la gy. %@ gy. cenba .i do ciska mo"; /* File: ../Source/NSDocument.m:569 */ /* Flag: untranslated */ "Untitled-%d" = "nae-cmene-%d"; /* File: ../Source/NSDocument.m:813 */ /* Flag: untranslated */ "File Error" = "le datnyvei srera"; /* File: ../Source/NSDocument.m:814 */ /* Flag: untranslated */ "Can't create backup file. Save anyways?" = "na'e finti fe fukdat'i .i do ciska mo"; /* File: ../Source/NSDocument.m:1179 */ /* Flag: untranslated */ "Save As" = "ciska fi ma"; /* File: ../Source/NSDocument.m:1180 */ /* Flag: untranslated */ "Save To" = "ciska fe mo"; /* File: ../Source/NSDocument.m:1659 */ /* Flag: untranslated */ "%@ has been edited. Are you sure you want to undo changes?" = "la gy. %@ gy. cenba .i do xruti le cenba mo?"; /* File: ../Source/NSDocumentController.m:1056 */ /* Flag: untranslated */ "Power Off" = "ganlo"; /* File: ../Source/NSDocumentController.m:1692 */ /* Flag: untranslated */ "Clear List" = "Clear List"; /* File: ../Source/NSFontPanel.m:241 */ /* Flag: untranslated */ "Multiple fonts selected" = "Multiple fonts selected"; /* File: ../Source/NSFontPanel.m:553 */ /* Flag: untranslated */ "Font Panel" = "Font Panel"; /* File: ../Source/NSFontPanel.m:578 */ /* Flag: untranslated */ "Font preview" = "Font preview"; /* File: ../Source/NSFontPanel.m:639 */ /* Flag: untranslated */ "Size" = "Size"; /* File: ../Source/NSFontPanel.m:719 */ /* Flag: untranslated */ "Set" = "Set"; /* File: ../Source/NSFontPanel.m:810 */ /* Flag: untranslated */ "NoFamily" = "NoFamily"; /* File: ../Source/NSFontPanel.m:818 */ /* Flag: untranslated */ "NoFace" = "NoFace"; /* File: ../Source/NSFontPanel.m:1138 */ /* Flag: untranslated */ "Family" = "Family"; /* File: ../Source/NSFontPanel.m:1142 */ /* Flag: untranslated */ "Typeface" = "Typeface"; /* File: ../Source/NSMenu.m:260 */ /* Flag: untranslated */ "Services" = "Services"; /* File: ../Source/NSOpenPanel.m:92 */ /* Flag: untranslated */ "Open" = "Open"; /* File: ../Source/NSPageLayout.m:960 */ /* Flag: untranslated */ "Dimensions" = "Dimensions"; /* File: ../Source/NSPageLayout.m:961 */ /* Flag: untranslated */ "Orientation" = "Orientation"; /* File: ../Source/NSPageLayout.m:962 */ /* Flag: untranslated */ "Scale" = "Scale"; /* File: ../Source/NSPageLayout.m:963 */ /* Flag: untranslated */ "Top Margin" = "Top Margin"; /* File: ../Source/NSPageLayout.m:964 */ /* Flag: untranslated */ "Bottom Margin" = "Bottom Margin"; /* File: ../Source/NSPageLayout.m:965 */ /* Flag: untranslated */ "Left Margin" = "Left Margin"; /* File: ../Source/NSPageLayout.m:966 */ /* Flag: untranslated */ "Right Margin" = "Right Margin"; /* File: ../Source/NSPageLayout.m:1016 */ /* Flag: untranslated */ "Portrait" = "Portrait"; /* File: ../Source/NSPageLayout.m:1020 */ /* Flag: untranslated */ "Landscape" = "Landscape"; /* File: ../Source/NSPrintOperation.m:677 */ /* Flag: untranslated */ "Error" = "Error"; /* File: ../Source/NSPrintOperation.m:677 */ /* Flag: untranslated */ "Printing error: %@" = "Printing error: %@"; /* File: ../Source/NSPrintPanel.m:145 */ /* Flag: untranslated */ "Print Panel" = "Print Panel"; /* File: ../Source/NSPrintPanel.m:179 */ /* Flag: untranslated */ "1 up" = "1 up"; /* File: ../Source/NSPrintPanel.m:179 */ /* Flag: untranslated */ "2 up" = "2 up"; /* File: ../Source/NSPrintPanel.m:179 */ /* Flag: untranslated */ "6 up" = "6 up"; /* File: ../Source/NSPrintPanel.m:179 */ /* Flag: untranslated */ "4 up" = "4 up"; /* File: ../Source/NSPrintPanel.m:180 */ /* Flag: untranslated */ "8 up" = "8 up"; /* File: ../Source/NSPrintPanel.m:407 */ /* Flag: untranslated */ "Sorry" = "Sorry"; /* File: ../Source/NSPrintPanel.m:407 */ /* Flag: untranslated */ "Faxing of print file not implemented" = "Faxing of print file not implemented"; /* File: ../Source/NSSavePanel.m:242 */ /* Flag: untranslated */ "Show Hidden Files" = "Show Hidden Files"; /* File: ../Source/NSSavePanel.m:277 */ /* Flag: untranslated */ "Home" = "Home"; /* File: ../Source/NSSavePanel.m:293 */ /* Flag: untranslated */ "Mount" = "Mount"; /* File: ../Source/NSSavePanel.m:309 */ /* Flag: untranslated */ "Unmount" = "Unmount"; /* File: ../Source/NSSavePanel.m:1314 */ /* Flag: untranslated */ "You have used the extension '.%@'.\nThe standard extension is '.%@'.'" = "You have used the extension '.%@'.\nThe standard extension is '.%@'.'"; /* File: ../Source/NSSavePanel.m:1322 */ /* Flag: untranslated */ "You cannot save this document with extension '.%@'.\nThe required extension is '.%@'." = "You cannot save this document with extension '.%@'.\nThe required extension is '.%@'."; /* File: ../Source/NSSavePanel.m:1367 */ /* Flag: untranslated */ "The directory '%@' does not exist, do you want to create it?" = "na'e zasti le datnyvei gy. %@ gy. .i do finti mo"; /* File: ../Source/NSSavePanel.m:1368 */ /* Flag: untranslated */ "No" = "nago'i"; /* File: ../Source/NSSavePanel.m:1368 */ /* Flag: untranslated */ "Yes" = "go'i"; /* File: ../Source/NSSavePanel.m:1380 */ /* Flag: untranslated */ "The directory '%@' could not be created." = "na'e finti le datnyveiste gy. %@ gy."; /* File: ../Source/NSSavePanel.m:1391 */ /* Flag: untranslated */ "The path '%@' is not a directory." = "ne'e datnyveiste la gy. %@ gy."; /* File: ../Source/NSSavePanel.m:1402 */ /* Flag: untranslated */ "The file '%@' in '%@' exists. Replace it?" = "zasti le datnyvei gy. %@ gy. la gy. %@ gy. .i do basti mo"; /* File: ../Source/NSSavePanel.m:1403 */ /* Flag: untranslated */ "Replace" = "basti"; /* File: ../Source/NSSavePanel.m:1794 */ /* Flag: untranslated */ "Reading Directory " = "Reading Directory "; /* File: ../Source/NSSpellChecker.m:731 */ /* Flag: untranslated */ "Guess" = "Guess"; /* File: ../Source/NSTextView.m:651 */ /* Flag: untranslated */ "Cut" = "Cut"; /* File: ../Source/NSTextView.m:652 */ /* Flag: untranslated */ "Copy" = "Copy"; /* File: ../Source/NSTextView.m:653 */ /* Flag: untranslated */ "Paste" = "Paste"; /* File: ../Source/NSTextView.m:5894 */ /* Flag: untranslated */ "No Suggestions" = "No Suggestions"; /* File: ../Source/NSToolbarItem.m:949 */ /* Flag: untranslated */ "Separator" = "Separator"; /* File: ../Source/NSToolbarItem.m:991 */ /* Flag: untranslated */ "Space" = "Space"; /* File: ../Source/NSToolbarItem.m:1021 */ /* Flag: untranslated */ "Flexible Space" = "Flexible Space"; /* File: ../Source/NSToolbarItem.m:1099 */ /* Flag: untranslated */ "Fonts" = "Fonts"; /* File: ../Source/NSToolbarItem.m:1122 */ /* Flag: untranslated */ "Customize" = "Customize"; /* File: ../Source/NSToolbarItem.m:1145 */ /* Flag: untranslated */ "Print..." = "Print..."; /* File: ../Source/NSWindow.m:5317 */ /* Flag: untranslated */ "Hide Toolbar" = "Hide Toolbar"; /* File: ../Source/NSWindow.m:5319 */ /* Flag: untranslated */ "Show Toolbar" = "Show Toolbar"; gnustep-gui-0.24.0/Resources/Italian.lproj/0000775000076500007650000000000012256227325020430 5ustar brains99brains99gnustep-gui-0.24.0/Resources/Italian.lproj/Localizable.strings0000664000076500007650000004207012235010125024250 0ustar brains99brains99/* Translator: Nicola Pero * Date: September 2002 * Translator: Maurizio Boriani * Date: April 2006 * Translator: Riccardo Mottola */ /*** Italian.lproj/Localizable.strings updated by make_strings 2013-10-28 21:50:39 +0100 add comments above this one ***/ /*** Keys found in multiple places ***/ /* File: ../Source/NSDocument.m:474 */ /* File: ../Source/NSDocument.m:815 */ /* File: ../Source/NSDocument.m:1183 */ /* File: ../Source/NSSavePanel.m:435 */ /* File: ../Source/NSSavePanel.m:1327 */ /* File: ../Source/NSSavePanel.m:1366 */ /* File: ../Source/NSSavePanel.m:1379 */ /* File: ../Source/NSSavePanel.m:1390 */ /* File: ../Source/NSSavePanel.m:1401 */ "Save" = "Salva"; /* File: ../Source/NSAlert.m:384 */ /* File: ../Source/NSDocument.m:474 */ /* File: ../Source/NSDocument.m:815 */ /* File: ../Source/NSDocument.m:1660 */ /* File: ../Source/NSDocumentController.m:955 */ /* File: ../Source/NSDocumentController.m:987 */ /* File: ../Source/NSSavePanel.m:318 */ /* File: ../Source/NSSavePanel.m:1330 */ /* File: ../Source/NSSavePanel.m:1403 */ "Cancel" = "Cancella"; /* File: ../Source/GSNibLoading.m:182 */ /* Comment: Info */ /* File: ../Source/NSApplication.m:2878 */ /* Comment: Title of the Info Panel */ /* File: ../Source/NSMenu.m:259 */ "Info" = "Info"; /* File: ../Source/GSNibLoading.m:165 */ /* Comment: Quit */ /* File: ../Source/NSApplication.m:3442 */ /* File: ../Source/NSApplication.m:4207 */ /* File: ../Source/NSDocumentController.m:1049 */ "Quit" = "Esci"; /* File: ../Source/GSPrintOperation.m:157 */ /* File: ../Source/NSSavePanel.m:1381 */ /* File: ../Source/NSSavePanel.m:1392 */ "Dismiss" = "Dismetti"; /* File: ../Source/GSPrintOperation.m:155 */ /* File: ../Source/NSFontPanel.m:706 */ "Preview" = "Anteprima"; /* File: ../Source/GSHelpManagerPanel.m:101 */ /* File: ../Source/NSAlert.m:1830 */ /* File: ../Source/NSPrintOperation.m:678 */ /* File: ../Source/NSPrintPanel.m:408 */ /* File: ../Source/NSSavePanel.m:334 */ "OK" = "OK"; /* File: ../Source/NSAlert.m:389 */ /* File: ../Source/NSDocument.m:474 */ "Don't Save" = "Non salvare"; /* File: ../Source/NSDocument.m:1658 */ /* File: ../Source/NSDocument.m:1660 */ /* File: ../Source/NSFontPanel.m:696 */ "Revert" = "Ritorna a com'era prima"; /* File: ../Source/GSHelpManagerPanel.m:70 */ /* File: ../Source/NSHelpPanel.m:154 */ "Help" = "Aiuto"; /* File: ../Source/NSColorPanel.m:245 */ /* File: ../Source/NSToolbarItem.m:1076 */ "Colors" = "Colori"; /* File: ../Source/NSPageLayout.m:967 */ /* File: ../Source/NSPageLayout.m:1038 */ /* File: ../Source/NSPrintPanel.m:630 */ /* File: ../Source/NSPrintPanel.m:676 */ "Unknown" = "Sconosciuto"; /* File: ../Source/NSPrintPanel.m:643 */ /* Flag: untranslated */ /* File: ../Source/NSPrintPanel.m:774 */ /* Flag: untranslated */ /* File: ../Source/NSPrintPanel.m:781 */ /* Flag: untranslated */ "Manual" = "Manual"; /* File: ../Source/NSSavePanel.m:1315 */ /* Flag: untranslated */ /* File: ../Source/NSSavePanel.m:1323 */ /* Flag: untranslated */ "Use .%@" = "Use .%@"; /* File: ../Source/NSDocument.m:1109 */ /* File: ../Source/NSPrintPanel.m:350 */ "File Type" = "Tipo Archivio"; /* File: ../Source/GSCharacterPanel.m:173 */ /* File: ../Source/NSPageLayout.m:959 */ "Name" = "Nome"; /* File: ../Source/GSCharacterPanel.m:154 */ /* File: ../Source/NSFontPanel.m:738 */ "Character Panel" = "Pannello Caratteri"; /*** Unmatched/untranslated keys ***/ /* File: ../Source/GSCharacterPanel.m:182 */ /* Flag: untranslated */ "Code Point" = "Code Point"; /* File: ../Source/GSCharacterPanel.m:191 */ /* Flag: untranslated */ "Unicode Block" = "Unicode Block"; /* File: ../Source/GSInfoPanel.m:339 */ /* Flag: untranslated */ "Release: " = "Release: "; /* File: ../Source/NSAttributedString.m:762 */ /* Comment: Error description */ /* Flag: untranslated */ "No data specified for data loading." = "No data specified for data loading."; /* File: ../Source/NSAttributedString.m:863 */ /* Comment: Error description */ /* Flag: untranslated */ "Could not load data." = "Could not load data."; /* File: ../Source/NSAttributedString.m:1033 */ /* Comment: Error description */ /* Flag: untranslated */ "No type specified for data." = "No type specified for data."; /* File: ../Source/NSColorPanel.m:309 */ /* Flag: untranslated */ "Opacity" = "Opacity"; /* File: ../Source/NSColorSpace.m:147 */ /* Comment: color space */ /* Flag: untranslated */ "DeviceN" = "DeviceN"; /* File: ../Source/NSDocumentController.m:1692 */ /* Flag: untranslated */ "Clear List" = "Clear List"; /* File: ../Source/NSFontPanel.m:241 */ /* Flag: untranslated */ "Multiple fonts selected" = "Multiple fonts selected"; /* File: ../Source/NSFontPanel.m:553 */ /* Flag: untranslated */ "Font Panel" = "Font Panel"; /* File: ../Source/NSFontPanel.m:578 */ /* Flag: untranslated */ "Font preview" = "Font preview"; /* File: ../Source/NSFontPanel.m:719 */ /* Flag: untranslated */ "Set" = "Set"; /* File: ../Source/NSFontPanel.m:810 */ /* Flag: untranslated */ "NoFamily" = "NoFamily"; /* File: ../Source/NSFontPanel.m:818 */ /* Flag: untranslated */ "NoFace" = "NoFace"; /* File: ../Source/NSFontPanel.m:1142 */ /* Flag: untranslated */ "Typeface" = "Typeface"; /* File: ../Source/NSOpenPanel.m:92 */ /* Flag: untranslated */ "Open" = "Apri"; /* File: ../Source/NSPageLayout.m:961 */ /* Flag: untranslated */ "Orientation" = "Orientation"; /* File: ../Source/NSPageLayout.m:962 */ /* Flag: untranslated */ "Scale" = "Scale"; /* File: ../Source/NSPrintPanel.m:179 */ /* Flag: untranslated */ "2 up" = "2 up"; /* File: ../Source/NSPrintPanel.m:179 */ /* Flag: untranslated */ "4 up" = "4 up"; /* File: ../Source/NSPrintPanel.m:179 */ /* Flag: untranslated */ "6 up" = "6 up"; /* File: ../Source/NSPrintPanel.m:179 */ /* Flag: untranslated */ "1 up" = "1 up"; /* File: ../Source/NSPrintPanel.m:180 */ /* Flag: untranslated */ "8 up" = "8 up"; /* File: ../Source/NSPrintPanel.m:407 */ /* Flag: untranslated */ "Sorry" = "Sorry"; /* File: ../Source/NSSavePanel.m:242 */ /* Flag: untranslated */ "Show Hidden Files" = "Show Hidden Files"; /* File: ../Source/NSSavePanel.m:277 */ /* Flag: untranslated */ "Home" = "Home"; /* File: ../Source/NSSavePanel.m:1314 */ /* Flag: untranslated */ "You have used the extension '.%@'.\nThe standard extension is '.%@'.'" = "You have used the extension '.%@'.\nThe standard extension is '.%@'.'"; /* File: ../Source/NSSavePanel.m:1322 */ /* Flag: untranslated */ "You cannot save this document with extension '.%@'.\nThe required extension is '.%@'." = "You cannot save this document with extension '.%@'.\nThe required extension is '.%@'."; /* File: ../Source/NSSavePanel.m:1368 */ /* Flag: untranslated */ "No" = "No"; /* File: ../Source/NSSavePanel.m:1794 */ /* Flag: untranslated */ "Reading Directory " = "Reading Directory "; /* File: ../Source/NSSpellChecker.m:731 */ /* Flag: untranslated */ "Guess" = "Guess"; /* File: ../Source/NSTextView.m:651 */ /* Flag: untranslated */ "Cut" = "Cut"; /* File: ../Source/NSTextView.m:652 */ /* Flag: untranslated */ "Copy" = "Copy"; /* File: ../Source/NSTextView.m:653 */ /* Flag: untranslated */ "Paste" = "Paste"; /* File: ../Source/NSTextView.m:5894 */ /* Flag: untranslated */ "No Suggestions" = "No Suggestions"; /* File: ../Source/NSToolbarItem.m:949 */ /* Flag: untranslated */ "Separator" = "Separator"; /* File: ../Source/NSToolbarItem.m:991 */ /* Flag: untranslated */ "Space" = "Space"; /* File: ../Source/NSToolbarItem.m:1021 */ /* Flag: untranslated */ "Flexible Space" = "Flexible Space"; /* File: ../Source/NSToolbarItem.m:1099 */ /* Flag: untranslated */ "Fonts" = "Fonts"; /* File: ../Source/NSToolbarItem.m:1122 */ /* Flag: untranslated */ "Customize" = "Customize"; /* File: ../Source/NSToolbarItem.m:1145 */ /* Flag: untranslated */ "Print..." = "Print..."; /* File: ../Source/NSWindow.m:5317 */ /* Flag: untranslated */ "Hide Toolbar" = "Hide Toolbar"; /* File: ../Source/NSWindow.m:5319 */ /* Flag: untranslated */ "Show Toolbar" = "Show Toolbar"; /*** Strings from ../Source/Functions.m ***/ /* File: ../Source/Functions.m:85 */ "Cannot load the main model file '%@'" = "Non \U00E8 possibile caricare il model file principale '%@'"; /*** Strings from ../Source/GSInfoPanel.m ***/ /* File: ../Source/GSInfoPanel.m:451 */ "Author: " = "Autore: "; /* File: ../Source/GSInfoPanel.m:455 */ "Authors: " = "Autori: "; /* File: ../Source/GSInfoPanel.m:396 */ "Copyright Information Not Available" = "Informazioni di Copyright non disponibili"; /* File: ../Source/GSInfoPanel.m:482 */ /* File: ../Source/GSInfoPanel.m:187 */ "Current theme" = "Tema corrente"; /*** Strings from ../Source/GSPrintOperation.m ***/ /* File: ../Source/GSPrintOperation.m:156 */ "Problem running the preview application '%@' perhaps you need to set your NSPreviewApp user default" = "Errore nell'esecuzione dell'applicazione Anteprima '%@' Dovresti impostare l'applicativo predefinito in NSPreviewApp defaults"; /*** Strings from ../Source/GSTextFinder.m ***/ /* File: ../Source/GSTextFinder.m:408 */ "%d replaced" = "%d rimpiazzati"; /* File: ../Source/GSTextFinder.m:381 */ /* File: ../Source/GSTextFinder.m:332 */ "Not found" = "Non trovato"; /*** Strings from ../Source/GSThemeDrawing.m ***/ /* File: ../Source/GSThemeDrawing.m:188 */ "?" = "?"; /*** Strings from ../Source/GSThemeInspector.m ***/ /* File: ../Source/GSThemeInspector.m:141 */ "Version: %@" = "Versione: %@"; /*** Strings from ../Source/GSThemePanel.m ***/ /* File: ../Source/GSThemePanel.m:229 */ /* File: ../Source/GSThemePanel.m:197 */ "Make this the default theme" = "Imposta come tema predefinito"; /* File: ../Source/GSThemePanel.m:193 */ /* File: ../Source/GSThemePanel.m:234 */ "Revert default theme" = "Ripristina tema predefinito"; /* File: ../Source/GSThemePanel.m:115 */ "Themes" = "Temi"; /*** Strings from ../Source/GSToolbarView.m ***/ /* File: ../Source/GSToolbarView.m:894 */ "Customize Toolbar" = "Personalizza barra strumenti"; /*** Strings from ../Source/NSAlert.m ***/ /* File: ../Source/NSAlert.m:2000 */ "Alert" = "Attenzione"; /* File: ../Source/NSAlert.m:2001 */ "No information" = "Nessuna informazione"; /*** Strings from ../Source/NSApplication.m ***/ /* File: ../Source/NSApplication.m:138 */ "Abort" = "Interrompi"; /* File: ../Source/NSApplication.m:323 */ "Backend at path %@ doesn't contain the GSBackend class" = "Il backend a %@ non contiene la classe GSBackend"; /* File: ../Source/NSApplication.m:311 */ "Can't create NSBundle object for backend at path %@" = "Impossibile a creare l'oggetto NSBundle per il backend a %@"; /* File: ../Source/NSApplication.m:316 */ "Can't load object file from backend at path %@" = "Impossibile caricare il file oggetto dal backend a %@"; /* File: ../Source/NSApplication.m:135 */ "Critical Error in %@" = "Errore critico in %@"; /* File: ../Source/NSApplication.m:141 */ "Debug" = "Debugga"; /* File: ../Source/NSApplication.m:4203 */ "Hide" = "Nascondi"; /* File: ../Source/NSApplication.m:1198 */ "Problem during launch app notification: %@" = "Problema durante il lancio dell'applicazione: %@"; /* File: ../Source/NSApplication.m:4197 */ "Show" = "Mostra"; /* File: ../Source/NSApplication.m:304 */ "Unable to find backend %@" = "Non si riesce a trovare il backend %@"; /* File: ../Source/NSApplication.m:972 */ "[NSApplication -init] called more than once" = "[NSApplication -init] chiamata pi\U00F9 di una volta"; /* File: ../Source/NSApplication.m:3315 */ "reported exception - %@" = "riportata una exception - %@"; /*** Strings from ../Source/NSAttributedString.m ***/ /* File: ../Source/NSAttributedString.m:1060 */ /* Comment: Error description */ /* File: ../Source/NSAttributedString.m:1083 */ /* Comment: Error description */ "Could not create data for type." = "Impossibile generare i dati per il tipo dati."; /* File: ../Source/NSAttributedString.m:927 */ /* Comment: Error description */ "Could not load data from URL." = "Impossibile caricare dati dall'URL."; /*** Strings from ../Source/NSBitmapImageRep.m ***/ /* File: ../Source/NSBitmapImageRep.m:1645 */ "CCITTFAX3 Compression" = "Compressione CCITTFAX3"; /* File: ../Source/NSBitmapImageRep.m:1646 */ "CCITTFAX4 Compression" = "Compressione CCITTFAX4"; /* File: ../Source/NSBitmapImageRep.m:1648 */ "JPEG Compression" = "Compressione JPEG"; /* File: ../Source/NSBitmapImageRep.m:1647 */ "LZW Compression" = "Compressione LZW"; /* File: ../Source/NSBitmapImageRep.m:1649 */ "NEXT Compression" = "Compressione NEXT"; /* File: ../Source/NSBitmapImageRep.m:1644 */ "No Compression" = "Non compresso"; /* File: ../Source/NSBitmapImageRep.m:1651 */ "Old JPEG Compression" = "Vecchia compressione JPEG"; /* File: ../Source/NSBitmapImageRep.m:1650 */ "PackBits Compression" = "Compressione PackBits"; /*** Strings from ../Source/NSColorSpace.m ***/ /* File: ../Source/NSColorSpace.m:143 */ /* Comment: color space */ "CMYK" = "CMYK"; /* File: ../Source/NSColorSpace.m:139 */ /* Comment: color space */ "Grayscale" = "Scala di grigi"; /* File: ../Source/NSColorSpace.m:145 */ /* Comment: color space */ "LAB" = "LAB"; /* File: ../Source/NSColorSpace.m:141 */ /* Comment: color space */ "RGB" = "RGB"; /* File: ../Source/NSColorSpace.m:137 */ /* Comment: color space */ "unknown" = "sconosciuto"; /*** Strings from ../Source/NSDocument.m ***/ /* File: ../Source/NSDocument.m:1659 */ "%@ has been edited. Are you sure you want to undo changes?" = "%@ \U00E8 stato modificato. Sei sicuro che vuoi annullare i cambiamenti?"; /* File: ../Source/NSDocument.m:473 */ "%@ has changed. Save?" = "%@ \U00E8 cambiato. Salvare?"; /* File: ../Source/NSDocument.m:814 */ "Can't create backup file. Save anyways?" = "Non si pu\U00F2 create un file di backup. Lo devo salvare lo stesso?"; /* File: ../Source/NSDocument.m:472 */ "Close" = "Chiudi"; /* File: ../Source/NSDocument.m:142 */ "Could not load URL %@." = "Non \U00E8 stato possibile caricare lo URL %@."; /* File: ../Source/NSDocument.m:119 */ "Could not load file %@." = "Non \U00E8 stato possibile caricare il file %@."; /* File: ../Source/NSDocument.m:813 */ "File Error" = "Errore con un file"; /* File: ../Source/NSDocument.m:141 */ /* File: ../Source/NSDocument.m:118 */ "Load failed" = "Caricamento non riuscito"; /* File: ../Source/NSDocument.m:1179 */ "Save As" = "Salva con nome"; /* File: ../Source/NSDocument.m:1180 */ "Save To" = "Salva in"; /* File: ../Source/NSDocument.m:569 */ "Untitled-%d" = "Senza-Titolo-%d"; /*** Strings from ../Source/NSDocumentController.m ***/ /* File: ../Source/NSDocumentController.m:1056 */ "Power Off" = "Spegni"; /* File: ../Source/NSDocumentController.m:1008 */ /* File: ../Source/NSDocumentController.m:966 */ "Quit Anyway" = "Esci comunque"; /* File: ../Source/NSDocumentController.m:964 */ /* File: ../Source/NSDocumentController.m:1006 */ "Review Unsaved" = "Rivisita documenti non salvati"; /* File: ../Source/NSDocumentController.m:1013 */ /* File: ../Source/NSDocumentController.m:963 */ "You have unsaved documents" = "Ci sono documenti non salvati"; /*** Strings from ../Source/NSFontPanel.m ***/ /* File: ../Source/NSFontPanel.m:1138 */ "Family" = "Famiglia"; /* File: ../Source/NSFontPanel.m:639 */ "Size" = "Dimensione"; /*** Strings from ../Source/NSMenu.m ***/ /* File: ../Source/NSMenu.m:260 */ "Services" = "Servizi"; /*** Strings from ../Source/NSPageLayout.m ***/ /* File: ../Source/NSPageLayout.m:739 */ /* File: ../Source/NSPageLayout.m:741 */ "(none)" = "(nessuno)"; /* File: ../Source/NSPageLayout.m:964 */ "Bottom Margin" = "Margine Inferiore"; /* File: ../Source/NSPageLayout.m:960 */ "Dimensions" = "Dimensioni"; /* File: ../Source/NSPageLayout.m:1020 */ "Landscape" = "Orizzontale"; /* File: ../Source/NSPageLayout.m:965 */ "Left Margin" = "Margine Sinistro"; /* File: ../Source/NSPageLayout.m:1016 */ "Portrait" = "Verticale"; /* File: ../Source/NSPageLayout.m:966 */ "Right Margin" = "Margine Destro"; /* File: ../Source/NSPageLayout.m:963 */ "Top Margin" = "Margine Superiore"; /*** Strings from ../Source/NSPrintOperation.m ***/ /* File: ../Source/NSPrintOperation.m:677 */ "Error" = "Errore"; /* File: ../Source/NSPrintOperation.m:677 */ "Printing error: %@" = "Errore di stampa: %@"; /*** Strings from ../Source/NSPrintPanel.m ***/ /* File: ../Source/NSPrintPanel.m:407 */ "Faxing of print file not implemented" = "Invio fax stampa non implementato"; /* File: ../Source/NSPrintPanel.m:145 */ "Print Panel" = "Pannello Stampa"; /*** Strings from ../Source/NSSavePanel.m ***/ /* File: ../Source/NSSavePanel.m:293 */ "Mount" = "Monta"; /* File: ../Source/NSSavePanel.m:434 */ /* File: ../Source/NSSavePanel.m:251 */ "Name:" = "Nome:"; /* File: ../Source/NSSavePanel.m:1403 */ "Replace" = "Sostituisci"; /* File: ../Source/NSSavePanel.m:1380 */ "The directory '%@' could not be created." = "La directory '%@' non puo' essere creata."; /* File: ../Source/NSSavePanel.m:1367 */ "The directory '%@' does not exist, do you want to create it?" = "La directory '%@' non esiste, la vuoi creare?"; /* File: ../Source/NSSavePanel.m:1402 */ "The file '%@' in '%@' exists. Replace it?" = "Il file '%@' in '%@' esiste. Vuoi sostituirlo?"; /* File: ../Source/NSSavePanel.m:1391 */ "The path '%@' is not a directory." = "Il percorso non '%@' non è una directory."; /* File: ../Source/NSSavePanel.m:309 */ "Unmount" = "Smonta"; /* File: ../Source/NSSavePanel.m:1368 */ "Yes" = "Sì"; gnustep-gui-0.24.0/gui.make.in0000664000076500007650000000303611023376255016000 0ustar brains99brains99# -*-makefile-*- # gui.make # # Makefile flags and configs to build with the gui library. # # Copyright (C) 2001 Free Software Foundation, Inc. # # Author: Nicola Pero # Based on code originally in the gnustep make package # # 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 Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. ifeq ($(GUI_MAKE_LOADED),) GUI_MAKE_LOADED=yes ifeq ($(GUI_LIB),gnu) GNUSTEP_GUI_VERSION = @GNUSTEP_GUI_VERSION@ GNUSTEP_GUI_MAJOR_VERSION = @GNUSTEP_GUI_MAJOR_VERSION@ GNUSTEP_GUI_MINOR_VERSION = @GNUSTEP_GUI_MINOR_VERSION@ GNUSTEP_GUI_SUBMINOR_VERSION = @GNUSTEP_GUI_SUBMINOR_VERSION@ GUI_LDFLAGS = GUI_LIBS = -lgnustep-gui GUI_DEFINE = -DGNU_GUI_LIBRARY=1 GNUSTEP_DEFINE = -DGNUSTEP endif endif # GUI_MAKE_LOADED gnustep-gui-0.24.0/configure.ac0000664000076500007650000005143312243761171016242 0ustar brains99brains99# configure.in for GNUstep GUI library # Process this file with autoconf to produce a configure script. # # Copyright (C) 1996-2011 Free Software Foundation, Inc. # # Author: Adam Fedor # # This file is part of the GNUstep GUI frontend (AppKit). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 3 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # builtin(include, config/icu.m4)dnl builtin(include, config/pkg.m4)dnl AC_INIT AC_CONFIG_SRCDIR([Source/NSApplication.m]) # If GNUSTEP_MAKEFILES is undefined, try to use gnustep-config to determine it. if test -z "$GNUSTEP_MAKEFILES"; then GNUSTEP_MAKEFILES=`gnustep-config --variable=GNUSTEP_MAKEFILES 2>&5` fi if test -z "$GNUSTEP_MAKEFILES"; then AC_MSG_ERROR([You must have the gnustep-make package installed and set up the GNUSTEP_MAKEFILES environment variable to contain the path to the makefiles directory before configuring!]) fi #-------------------------------------------------------------------- # Use config.guess, config.sub and install-sh provided by gnustep-make #-------------------------------------------------------------------- AC_CONFIG_AUX_DIR($GNUSTEP_MAKEFILES) AC_CONFIG_HEADER(Headers/Additions/GNUstepGUI/config.h) #-------------------------------------------------------------------- # Determine the host, build, and target systems #-------------------------------------------------------------------- AC_CANONICAL_TARGET([]) #-------------------------------------------------------------------- # Add target OS directories as necessary #-------------------------------------------------------------------- CONFIG_SYSTEM_INCL="$CPPFLAGS" CONFIG_SYSTEM_LIB_DIR="$LDFLAGS" case "$target_os" in freebsd* | openbsd* ) CPPFLAGS="$CPPFLAGS -I/usr/local/include" LDFLAGS="$LDFLAGS -L/usr/local/lib";; netbsd*) CPPFLAGS="$CPPFLAGS -I/usr/pkg/include" LDFLAGS="$LDFLAGS -Wl,-R/usr/pkg/lib -L/usr/pkg/lib";; esac AC_PATH_X # Added for checking the existence of ungif. Note that # -gui uses the API of the underlying window system ONLY IF # it is definitely necessary. #-------------------------------------------------------------------- # The following is so that headers and custom libraries # in the GNUstep root are used before the standard ones #-------------------------------------------------------------------- # # It looks like we ought to source the whole GNUstep.sh here, and even # ask it to output all variables! That way we have access to (eg) # GNUSTEP_SYSTEM_HEADERS below. # GNUSTEP_SH_EXPORT_ALL_VARIABLES=yes . "$GNUSTEP_MAKEFILES/GNUstep.sh" unset GNUSTEP_SH_EXPORT_ALL_VARIABLES # For backwards compatibility, define GNUSTEP_SYSTEM_HEADERS from # GNUSTEP_SYSTEM_ROOT if not set yet. if test x"$GNUSTEP_SYSTEM_HEADERS" = x""; then GNUSTEP_SYSTEM_HEADERS="$GNUSTEP_SYSTEM_ROOT/Library/Headers" fi if test x"$GNUSTEP_SYSTEM_LIBRARIES" = x""; then GNUSTEP_SYSTEM_LIBRARIES="$GNUSTEP_SYSTEM_ROOT/Library/Libraries" fi if test "$GNUSTEP_IS_FLATTENED" = no; then clean_target_os=`$GNUSTEP_MAKEFILES/clean_os.sh $target_os` clean_target_cpu=`$GNUSTEP_MAKEFILES/clean_cpu.sh $target_cpu` obj_dir=$clean_target_cpu/$clean_target_os GNUSTEP_LDIR=$GNUSTEP_SYSTEM_LIBRARIES/$obj_dir GNUSTEP_HDIR=$GNUSTEP_SYSTEM_HEADERS/$LIBRARY_COMBO else GNUSTEP_LDIR=$GNUSTEP_SYSTEM_LIBRARIES GNUSTEP_HDIR=$GNUSTEP_SYSTEM_HEADERS fi CPPFLAGS="$CPPFLAGS -I$GNUSTEP_HDIR" LDFLAGS="$LDFLAGS -L$GNUSTEP_LDIR/$LIBRARY_COMBO -L$GNUSTEP_LDIR" #-------------------------------------------------------------------- # Find the compiler #-------------------------------------------------------------------- AC_PROG_CC AC_PROG_CPP AC_CHECK_LIB(m, main) AC_CHECK_FUNCS(rint rintf atan2f) #-------------------------------------------------------------------- # Support for determining mountpoints #-------------------------------------------------------------------- AC_CHECK_HEADERS(mntent.h) AC_CHECK_HEADERS(sys/mntent.h) AC_CHECK_MEMBER(struct mntent.mnt_dir,[AC_DEFINE(MNT_MEMB,mnt_dir,mntent structure member name)],,[#include ]) AC_CHECK_MEMBER(struct mntent.mnt_mountp,[AC_DEFINE(MNT_MEMB,mnt_mountp,mntent structure member name)],,[#include ]) AC_FUNC_GETMNTENT AC_CHECK_FUNCS(getmntinfo) #-------------------------------------------------------------------- # Simple way to add a bunch of paths to the flags #-------------------------------------------------------------------- AC_ARG_WITH(include-flags, [ --with-include-flags=FLAGS specify all include flags at once], include_flags="$withval", include_flags="no") if test ${include_flags} != "no"; then CPPFLAGS="$CPPFLAGS ${include_flags}" CONFIG_SYSTEM_INCL="$CONFIG_SYSTEM_INCL ${include_flags}" fi AC_ARG_WITH(library-flags, [ --with-library-flags=FLAGS specify all library flags at once], library_flags="$withval", library_flags="no") if test ${library_flags} != "no"; then LDFLAGS="$LDFLAGS ${library_flags}" CONFIG_SYSTEM_LIB_DIR="$CONFIG_SYSTEM_LIB_DIR ${library_flags}" fi #-------------------------------------------------------------------- # Find JPEG #-------------------------------------------------------------------- GRAPHIC_CFLAGS= GRAPHIC_LFLAGS= AC_ARG_ENABLE(jpeg, [ --disable-jpeg Disable JPEG support],, enable_jpeg=yes) if test $enable_jpeg = yes; then AC_ARG_WITH(jpeg_library, [ --with-jpeg-library=DIR JPEG library file are in DIR], , with_jpeg_library=) AC_ARG_WITH(jpeg_include, [ --with-jpeg-include=DIR JPEG include files are in DIR], , with_jpeg_include=) if test -n "$with_jpeg_library"; then with_jpeg_library="-L$with_jpeg_library" fi if test -n "$with_jpeg_include"; then with_jpeg_include="-I$with_jpeg_include" fi CPPFLAGS="$with_jpeg_include ${CPPFLAGS}" LDFLAGS="$with_jpeg_library ${LDFLAGS}" AC_CHECK_HEADERS(jpeglib.h, have_jpeg=yes, have_jpeg=no) if test "$have_jpeg" = yes; then AC_CHECK_LIB(jpeg, jpeg_destroy_decompress) else ac_cv_lib_jpeg_jpeg_destroy_decompress=no fi if test "$ac_cv_lib_jpeg_jpeg_destroy_decompress" = yes; then GRAPHIC_LFLAGS="$with_jpeg_library $GRAPHIC_LFLAGS" GRAPHIC_CFLAGS="$with_jpeg_include $GRAPHIC_CFLAGS" else echo "GNUstep requires libjpeg to support JPEG images, but this library" echo "can't be found. If you really want to compile GNUstep without" echo "JPEG support, pass the --disable-jpeg option to ./configure." echo "Note that this isn't recommended. For more information, see:" echo "http://gnustep.made-it.com/BuildGuide/index.html#JPEG" AC_MSG_ERROR([libjpeg not found.]) fi fi #-------------------------------------------------------------------- # Find TIFF #-------------------------------------------------------------------- AC_ARG_WITH(tiff_library, [ --with-tiff-library=DIR TIFF library file are in DIR], , with_tiff_library=) AC_ARG_WITH(tiff_include, [ --with-tiff-include=DIR TIFF include files are in DIR], , with_tiff_include=) if test -n "$with_tiff_library"; then with_tiff_library="-L$with_tiff_library" fi if test -n "$with_tiff_include"; then with_tiff_include="-I$with_tiff_include" fi CPPFLAGS="$with_tiff_include ${CPPFLAGS}" LDFLAGS="$with_tiff_library ${LDFLAGS}" AC_CHECK_LIB(z, main) AC_CHECK_HEADER(tiffio.h, have_tiff=yes, have_tiff=no) if test "$have_tiff" = yes; then AC_CHECK_LIB(tiff, TIFFReadScanline) if test "$ac_cv_lib_tiff_TIFFReadScanline" = yes; then GRAPHIC_LFLAGS="$with_tiff_library $GRAPHIC_LFLAGS" GRAPHIC_CFLAGS="$with_tiff_include $GRAPHIC_CFLAGS" else have_tiff=no fi fi if test "$have_tiff" = no; then AC_MSG_WARN(Cannot find libtiff header and/or library) echo "* The GUI library reqiures the TIFF library" echo "* Use --with-tiff-library to specify the tiff library" echo "* directory if it is not in the usual place(s)" echo "* You may also have to specify --with-jpeg-library if the jpeg" echo "* library is needed by tiff", AC_MSG_ERROR(gnustep-gui will not compile without tiff) fi #-------------------------------------------------------------------- # Find PNG #-------------------------------------------------------------------- AC_ARG_ENABLE(png, [ --disable-png Disable PNG support],, enable_png=yes) if test $enable_png = yes; then # use libpng-config if available AC_CHECK_PROG(HAVE_LIBPNG_CONFIG, [libpng-config], yes) if test "$HAVE_LIBPNG_CONFIG" = "yes"; then PNG_CFLAGS="`libpng-config --I_opts`" PNG_LDFLAGS="`libpng-config --ldflags`" CPPFLAGS="${CPPFLAGS} $PNG_CFLAGS" LDFLAGS="$PNG_LDFLAGS ${LDFLAGS}" AC_CHECK_HEADERS(png.h) AC_CHECK_LIB(png, png_sig_cmp) if test "$ac_cv_search_png_sig_cmp" != no; then GRAPHIC_CFLAGS="$PNG_CFLAGS $GRAPHIC_CFLAGS" GRAPHIC_LFLAGS="$PNG_LDFLAGS $GRAPHIC_LFLAGS" AC_DEFINE([HAVE_LIBPNG], [1]) fi else AC_MSG_WARN([Can't find libpng-config, guessing required headers and libraries.]) AC_CHECK_HEADERS(png.h) AC_CHECK_LIB(png, png_sig_cmp) fi if test "$ac_cv_lib_png_png_sig_cmp" = no && test "$ac_cv_search_png_sig_cmp" = no; then echo "GNUstep requires libpng to support PNG images, but this library" echo "can't be found. If you really want to compile GNUstep without" echo "PNG support, pass the --disable-png option to ./configure." echo "Note that this isn't recommended." AC_MSG_ERROR([libpng not found.]) fi fi #-------------------------------------------------------------------- # Find additional image libs #-------------------------------------------------------------------- AC_ARG_ENABLE(ungif, [ --disable-ungif Disable libungif-based GIF support],, enable_ungif=yes) AC_ARG_ENABLE(libgif, [ --enable-libgif Enable libgif-based GIF support],, enable_libgif=no) if test "${enable_libgif}" = yes; then enable_ungif=no fi have_ungif=no if test "${enable_ungif}" = yes; then AC_CHECK_LIB(ungif, DGifOpen) if test "${ac_cv_lib_ungif_DGifOpen}" = yes; then have_ungif=yes fi if test "${with_x}" != no && test "${ac_cv_lib_ungif_DGifOpen}" = no; then orig_CPPFLAGS="${CPPFLAGS}" orig_LDFLAGS="${LDFLAGS}" orig_LIBS="${LIBS}" AC_MSG_NOTICE([Checking if ungif is linked against -lX11]) # This implies either that ungif is not installed at all, or that it # explicitly refers to the symbols defined in X11. Now see if the latter # is the case. CPPFLAGS="${CPPFLAGS} -I${ac_x_includes}" LDFLAGS="${LDFLAGS} -L${ac_x_libraries}" LIBS="${LIBS} -lX11" AC_CHECK_LIB(ungif, DGifCloseFile) if test "${ac_cv_lib_ungif_DGifCloseFile}" = no; then # This indicates ungif is not installed at all. The flags reverts to # the orignal value. CPPFLAGS="${orig_CPPFLAGS}" LDFLAGS="${orig_LDFLAGS}" LIBS="${orig_LIBS}" else # This indicates ungif actually refers to the X11's symbols. We modify # the flags so that -gui gets linked against the X11 library to support # ungif. AC_MSG_NOTICE([-gui will be linked against -lX11 to support ungif images]) GRAPHIC_CFLAGS="-I${ac_x_includes} $GRAPHIC_CFLAGS" GRAPHIC_LFLAGS="-L${ac_x_libraries} $GRAPHIC_LFLAGS" have_ungif=yes fi fi fi if test "$have_ungif" = no -o "${enable_libgif}" = yes; then AC_CHECK_LIB(gif, DGifOpen) if test "${with_x}" != no && test "${ac_cv_lib_gif_DGifOpen}" = no; then orig_CPPFLAGS="${CPPFLAGS}" orig_LDFLAGS="${LDFLAGS}" orig_LIBS="${LIBS}" AC_MSG_NOTICE([Checking if libgif is linked against -lX11]) # This implies either that libgif is not installed at all, or that it # explicitly refers to the symbols defined in X11. Now see if the latter # is the case. CPPFLAGS="${CPPFLAGS} -I${ac_x_includes}" LDFLAGS="${LDFLAGS} -L${ac_x_libraries}" LIBS="${LIBS} -lX11" AC_CHECK_LIB(gif, DGifCloseFile) if test "${ac_cv_lib_gif_DGifCloseFile}" = no; then # This indicates libgif is not installed at all. The flags reverts to # the orignal value. CPPFLAGS="${orig_CPPFLAGS}" LDFLAGS="${orig_LDFLAGS}" LIBS="${orig_LIBS}" else # This indicates libgif actually refers to the X11's symbols. We modify # the flags so that -gui gets linked against the X11 library to support # libgif. AC_MSG_NOTICE([-gui will be linked against -lX11 to support libgif images]) GRAPHIC_CFLAGS="-I${ac_x_includes} $GRAPHIC_CFLAGS" GRAPHIC_LFLAGS="-L${ac_x_libraries} $GRAPHIC_LFLAGS" fi fi fi # QuantizeBuffer was removed from giflib in version 4.2 but was reintroduced # in the 5.0 release with a new name. If this function is not present # we disable the support to create gif image representations. AC_CHECK_FUNCS(QuantizeBuffer) AC_CHECK_FUNCS(GifQuantizeBuffer) #-------------------------------------------------------------------- # Find ImageMagick #-------------------------------------------------------------------- AC_ARG_ENABLE(imagemagick, [ --enable-imagemagick Enable ImageMagick support]) AS_IF([test "x$enable_imagemagick" = "xyes"], [ PKG_CHECK_MODULES([IMAGEMAGICK], [MagickCore], [ GRAPHIC_CFLAGS="$IMAGEMAGICK_CFLAGS $GRAPHIC_CFLAGS" GRAPHIC_LFLAGS="$IMAGEMAGICK_LIBS $GRAPHIC_LFLAGS" AC_DEFINE([HAVE_IMAGEMAGICK], [1], [Have ImageMagick]) ], [AC_DEFINE([HAVE_IMAGEMAGICK], [0], [Don't have ImageMagick])]) ]) #-------------------------------------------------------------------- # Check for International Components for Unicode # See DEPENDENCIES POLICY at the start of thsi file. #-------------------------------------------------------------------- HAVE_ICU=0 AC_ARG_ENABLE(icu, [ --disable-icu Disable International Components for Unicode],, enable_icu=yes) AC_ARG_ENABLE(icu-config, [ --disable-icu-config Do not use the icu-config script to check for ICU.],, enable_icu_config=yes) AC_ARG_WITH(icu-library, [ --with-icu-library=PATH library path for ICU libraries (only checked if not using icu-config)], icu_libdir="$withval", icu_libdir="no") if test $enable_icu = yes; then if test "$enable_icu_config" = "yes"; then AC_CHECK_ICU(4.0, have_icu=yes, have_icu=no) else have_icu=no; AC_CHECKING([for libicu (icu-config disabled)]) if test "$icu_libdir" != "no"; then ICU_LDFLAGS="-L$icu_libdir"; fi saved_LDFLAGS="$LDFLAGS"; LDFLAGS="$LDFLAGS $LIBS $ICU_LDFLAGS -licui18n -licuuc -licudata -lm" AC_TRY_LINK([],[], have_icu="yes", have_icu="no"); LDFLAGS="$saved_LDFLAGS"; ICU_LIBS="-licui18n -licuuc -licudata -lm" fi if test "$have_icu" = "yes"; then AC_MSG_RESULT(yes) AC_CHECK_HEADERS(unicode/uchar.h unicode/ustring.h) GRAPHIC_LFLAGS="$ICU_LDFLAGS $ICU_LIBS $GRAPHIC_LFLAGS" HAVE_ICU=1 else AC_MSG_RESULT(no) AC_MSG_WARN([The International Components for Unicode (ICU) development headers and libraries do not appear to be available on this system.]) fi fi AC_SUBST(HAVE_ICU) #-------------------------------------------------------------------- # Check for the spelling lib, for the built-in spell checker... # Note: you might want to disable aspell on MacOSX, as it linkes in # Apple's libobjc.A, screwing up the links to the GNU libobjc. #-------------------------------------------------------------------- AC_ARG_ENABLE(aspell, [ --disable-aspell Disable aspell for spellchecker],, enable_aspell=yes) if test "$enable_aspell" = yes; then AC_CHECK_LIB(aspell, new_aspell_document_checker) fi if test "${ac_cv_lib_aspell_new_aspell_document_checker}" = yes; then AC_CHECK_HEADERS(aspell.h) AC_DEFINE(HAVE_ASPELL,1,[Define if you have the aspell header]) fi #-------------------------------------------------------------------- # Check for ICNS library. #-------------------------------------------------------------------- AC_CHECK_LIB(icns, icns_read_family_from_file) #-------------------------------------------------------------------- # NSSound #-------------------------------------------------------------------- AC_ARG_ENABLE(sound, [ --disable-sound Disable sound],, enable_sound=yes) # Initialize to nothing... BUILD_SOUND= # Check for the headers... AC_CHECK_HEADERS(sndfile.h, have_sndfile=yes, have_sndfile=no) AC_CHECK_HEADERS(ao/ao.h, have_ao=yes, have_ao=no) # Only if we have both... if test $have_sndfile = yes -a $have_ao = yes -a $enable_sound = yes; then BUILD_SOUND="sound" fi AC_SUBST(BUILD_SOUND) #-------------------------------------------------------------------- # NSSpeechSynthesizer #-------------------------------------------------------------------- AC_ARG_ENABLE(speech, [ --disable-speech Disable speech server],, enable_speech=yes) BUILD_SPEECH= # has flite, for speech synthesis. AC_CHECK_LIB(flite, new_utterance, have_speech=yes, have_speech=no) AC_CHECK_HEADERS(flite/flite.h) if test $have_speech = yes -a $enable_speech = yes; then BUILD_SPEECH="speech say" fi AC_SUBST(BUILD_SPEECH) #-------------------------------------------------------------------- # Find CUPS #-------------------------------------------------------------------- GSCUPS_CFLAGS= GSCUPS_LDFLAGS= GSCUPS_LIBS= GSCUPS_DATADIR= BUILD_GSCUPS=NO AC_ARG_ENABLE(cups, [ --disable-cups Disable cups printing support],, enable_cups=yes) if test $enable_cups = yes; then BUILD_GSCUPS=YES AC_CHECK_PROG(have_cups, cups-config, yes, no) if test $have_cups = no; then echo "Could not find cups-config program, cups printing support will not be built." enable_cups=no BUILD_GSCUPS=NO else GSCUPS_CFLAGS=`cups-config --cflags` GSCUPS_LDFLAGS=`cups-config --ldflags` GSCUPS_LIBS=`cups-config --libs` GSCUPS_DATADIR=`cups-config --datadir` orig_CPPFLAGS="${CPPFLAGS}" orig_LDFLAGS="${LDFLAGS}" CPPFLAGS="$GSCUPS_CFLAGS ${CPPFLAGS}" LDFLAGS="$GSCUPS_LDFLAGS ${LDFLAGS}" AC_CHECK_HEADERS(cups/cups.h, have_cups=yes, have_cups=no) if test "$have_cups" = no; then enable_cups=no BUILD_GSCUPS=NO echo "Could not find cups.h, cups printing support will not be built." fi AC_CHECK_LIB(cups, cupsServer, have_cups=yes, have_cups=no) if test "$have_cups" = no; then enable_cups=no BUILD_GSCUPS=NO echo "Could not find the cups library, cups printing support will not be built." fi CPPFLAGS="${orig_CPPFLAGS}" LDFLAGS="${orig_LDFLAGS}" fi fi AC_SUBST(GSCUPS_CFLAGS) AC_SUBST(GSCUPS_LDFLAGS) AC_SUBST(GSCUPS_LIBS) AC_SUBST(GSCUPS_DATADIR) AC_SUBST(BUILD_GSCUPS) #-------------------------------------------------------------------- # Check for -Wdeclaration-after-statement #-------------------------------------------------------------------- AC_MSG_CHECKING(whether the compiler supports -Wdeclaration-after-statement) saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wdeclaration-after-statement" AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],HAS_W_DECL_AFTER_STATEMENT=yes,HAS_W_DECL_AFTER_STATEMENT=no) CFLAGS="$saved_CFLAGS" AC_MSG_RESULT($HAS_W_DECL_AFTER_STATEMENT) if test x"$HAS_W_DECL_AFTER_STATEMENT" = x"yes"; then WARN_FLAGS="-Wall -Wdeclaration-after-statement" else WARN_FLAGS=-Wall fi AC_SUBST(WARN_FLAGS) #-------------------------------------------------------------------- # Record the version #-------------------------------------------------------------------- AC_MSG_CHECKING(for the version of gnustep-gui we are compiling) if test -f "Version"; then . ./Version fi AC_MSG_RESULT($GNUSTEP_GUI_VERSION) AC_SUBST(GNUSTEP_GUI_VERSION) AC_SUBST(GNUSTEP_GUI_MAJOR_VERSION) AC_SUBST(GNUSTEP_GUI_MINOR_VERSION) AC_SUBST(GNUSTEP_GUI_SUBMINOR_VERSION) CONFIG_SYSTEM_INCL="$CONFIG_SYSTEM_INCL $GRAPHIC_CFLAGS" CONFIG_SYSTEM_LIB_DIR="$CONFIG_SYSTEM_LIB_DIR $GRAPHIC_LFLAGS" AC_SUBST(CONFIG_SYSTEM_LIB_DIR) AC_SUBST(CONFIG_SYSTEM_INCL) AC_SUBST(cross_compiling) #-------------------------------------------------------------------- # Configure #-------------------------------------------------------------------- AH_BOTTOM([ /* Define for those who don't have rintf and/or rint */ #ifndef HAVE_RINTF #define rintf rint #endif #ifndef HAVE_RINT #define DEFINE_RINT_IF_MISSING \ static double rint(double a) \ { \ return (floor(a+0.5)); \ } #else #define DEFINE_RINT_IF_MISSING #endif ]) AC_CONFIG_FILES([config.make gui.make Headers/Additions/GNUstepGUI/GSVersion.h]) AC_OUTPUT gnustep-gui-0.24.0/GNUmakefile0000664000076500007650000000375011547653254016035 0ustar brains99brains99# # Top level makefile for GNUstep GUI Library # # Copyright (C) 1997 Free Software Foundation, Inc. # # Author: Scott Christley # # This file is part of the GNUstep GUI Library. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. ifeq ($(GNUSTEP_MAKEFILES),) GNUSTEP_MAKEFILES := $(shell gnustep-config --variable=GNUSTEP_MAKEFILES 2>/dev/null) endif ifeq ($(GNUSTEP_MAKEFILES),) $(error You need to set GNUSTEP_MAKEFILES before compiling!) endif PACKAGE_NAME = gnustep-gui export PACKAGE_NAME RPM_DISABLE_RELOCATABLE=YES PACKAGE_NEEDS_CONFIGURE = YES SVN_MODULE_NAME = gui SVN_BASE_URL = svn+ssh://svn.gna.org/svn/gnustep/libs GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=gui.make include $(GNUSTEP_MAKEFILES)/common.make include ./Version # Don't build docs by default doc=no # # The list of subproject directories # SUBPROJECTS = \ Source \ Images \ Sounds \ Model \ Tools \ Panels \ PrinterTypes \ TextConverters \ ColorPickers \ KeyBindings \ Resources \ Printing \ Themes \ Tests # Build and install sounds, if sound support is present. SUBPROJECTS += $(BUILD_SOUNDS) ifeq ($(doc), yes) SUBPROJECTS += Documentation endif -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/aggregate.make include GNUmakefile.postamble gnustep-gui-0.24.0/BUGS0000664000076500007650000000062110770101221014413 0ustar brains99brains991 TODO ****** 1.1 Bugs in the GUI library =========================== The following classes are currently unimplemented or unfinished to such a degree to be unusable. * NSFontDescriptor * NSColorSpace * NSSearchField and NSSearchFieldCell Classes that need work (well every class needs work!) * NSTableView and NSOutlineView * NSProgressIndicator * All the Text classes gnustep-gui-0.24.0/Images/0000775000076500007650000000000012256227334015155 5ustar brains99brains99gnustep-gui-0.24.0/Images/common_3DArrowDown.tiff0000664000076500007650000000230611576466755021531 0ustar brains99brains99MM*6€à$ *¿Õ`<ÿBaphx…Eà‘XÔb†Ä€2lz;  (->F(=RSÐa.tiffCreated with The GIMPHH€Ÿï0ü„BaP¸d6 /Ggb¶ CãQ¸ØœmA/vƒ„>Ö¿c’¹Xà§{ ªT·_MWƒæ3, BJ`tX@&×  ä€A`¼” ”‚œP`Ñ;Ø– [ÂJ$ "ôÖ•¬š´­þÀ §‘dî„•B¯ô¨ªHªÎØÓüjN¿Å  Í *À À ]þgV0ð×ê8q+ž†€k®I ƒ ëý¬:fáOñÐ6ÀÜl¨I,€'ñ…\ÂÙ?À HêS4hŽ£&ò-Ú~`>0ñàBÿ€J ­¦M¨€§ñI\Å«?Áäìó#ˆ w¨0nØG$d‚%‡ør b ¢qüL@‰ö–RÜ€ëœó#X0z³`¨O€"òøeYâ°À~€#H ¶@¨&$³Ðeqœ‡ p$A.'ñF ` ÷"¡¡H‹gùè9~@)¥à L¡¢«ä.€ V ðcHõ˜õb)… ˆ‚mÑV]Ÿë0…AP•ò4* ÀåSb_€`!&œ‡‰ ðh€ Rc!ÉüR€u…¾Š¤™þ5•` þv€!Àn]èØ¢ †¹T ă~¥‚©U&a`sá X¢ •è ¿Ç¢ÓüÈ+ÊŠÂ@»Õû=Ÿ ÙW«Æù4šQ?È„"{üJ$¿Äá`£üŠ Èåò»¬¶aþK„ŸÒK,^2J%OúdGe_¯Øoóáéþ ˆ/ñ0”Zÿò$Ñ×yçßo BÃøŽ gaX 4²\ÿ4ñx¼n_ª ª¸æ¢°jÀiêÊú”…XŠ"x¼‡aЊÇ2 ³p‹3rôÄ «ÖöŒ/aý½£Pö† ¨á k)p\gù"HÇøX©á@ŸàX&A0"AhÖ?åÑnläÑ.YàÀ09hzÊb˜†IþFdÑþ+ŠÃ1þ¨†oļ4BÞ²£ VEOh¼‚çð¿<Ó¼ó?Ãø¬%ä(ð:Ë9xŒøÎ‰¢n'àý ø@ÌŒ‚Éù&HEùRS‡ù2K2Œ¦“dÁh‹bÈÒù¢VW•ÅÉþI’% þ#‚‰þl«&ÝÍïC+=Ïóà»iZ“ͧ<“Äöå‘\’¤¡6­â)üAQÿJRÄnãÈhâÐJ ÔØO4T™'JQNbÕÒ¡?’ÀÌ:]bh¨àøHò;‘‡øŽ#‰ùfYÏÀÊ<Ÿá‹52-¼?feüQ=Z³ìV‹ñý˜Ï9¡üNVÙx^çøæ9¯`<ð;uÒ´(rŸ÷uà=^gøÜèâ F ŸÀø}³õK)J’‘fd r4axnXÖ{aþG…)þ;ޤQþ `©þ†!Û$ÊCôáÁ·“¬û>fÙµ§L‹yø* 6áco“„ÙFü ïØLšE,4† þ?†Ýœê§SÔj#˜báø4Æ`Ûøž+·mfÜJPyC0²Pý†‹s8Tà˜$Ú‹¹x³Áz4Ëx/Îy·|{g÷º.Oý²=ŸæT“ÄéL!¸„ˆaxaÏiZgIÑuΣÕõÝ€Ü €Øþ @° àz]¢Ÿ H«d?Þ…nØ1† æm‚ PyO0›E @°ÿ ËÞBHG^Áí{¯t-eð½—À{  Á‡ðÂC‡Þ`0;í£ºL»Ýcªq-zG^Ï¢xk°ÅH?ƒDW``;RúsÈ©o;a($…aþBº ì#ð4Z86èÛ·¨O a w ð’/qý Ô~†Ðà^‹X?…P¨oÀ „è6?—cõtn”êX•%Çø{u À– [CdŸÁ®+ÅX±ÃA˜fnO éeƒLmñŽ1F¨ÿâNðx…£tp˜-¸í ¦Dy„‘îÂÓ#3£<~ Á$#3uµ-†8ÍïË„pŠâ ÿˆÍ4/ïgDš^ÔÉÐæ àþ ðO@¥e0iŠóè ðÎ ÀÈþ Àª€„Ó‚?€Ð «ðˆ ²V/ØÈò%E†0ÂÃ#\C€qL…P\Ó“Wô…½Bï4WÀW.ãø+RºTÖ)xþ¦"D=-±|,Ehÿ‚Ížˆü"Ù01²D2‚å, »¢ÀÙzN©2Ôjptžø8‚ùâtñð6Ê(¥ ,ú€²¦€Ïó+@èf7Á(øà0hY£Pnñd+Ø ~¢ ¾×ÞÀøá:(ïI)"±"–µ‹K)]±ðÙò Á˜4‡ø¸ê¥…áü š3ô­.J¯@ù%­-©j X;);Uj½VžSÒ­ÏQý(gĨ•Sþ´ÐB` hdDÈŒ€:Gð†°´A¶ ˆ\€°sHï>6.Å]ÚJÀ þjÍ`*µqüÂGÂÐU ü3†l¹" Kð¨ƒi3ޤ:+ú?ê]¦µàÚËA=°ª–ÊyÕ©éWe^Šp }ʪÐ?ƒ-¾¸T1Ü4Lœh)à&/Á þ @Šðâ»Âñ`þÆ¿‰‘ÀÚcø` áš÷‚· `ü!¿A9Gýÿ´ø &:Å-„NháÊÙ`ª±œÜ3ØO0§B3%63{]À€0¡5Eدãb Aü°þ`åsI9†ÑáäëÏh6~Î’t9U<•°eYÓx>QeÉIX"άƒû1a›ƒo³*'Õ£U²õ®?‚ì.•kà €  ‰e‰¾P¹W.(¸ÿ+%’.³Ê”B uÙV¢Õ·=¡T§tœÛVx팱¶´ÖœÛºpV-Øh·Û˜n–Þ#‡ÿ'å";”(gyIV‘ø`?€XW`’Œ¡6𗯮¿À:{q˜þ ”à ˜ È€–Ôí=kĸ§ÚÖÈ8u͵mxÖžÜpqéSÈ+)¾­Fït"l:y_-æ\ús!yÌ‚Ì~E¨¼€ Ï €»pÃè4ãú¶/?‚Mm @|¼ˆ™˜à,ïâ3ǬñkgÅòÖÜìYwpJnϹ9g€ƒÿµ™nÛ™°ýÀQ›°r®ê9¸æßÜSdxïÞ®‡{]q@õȸß*ãüƒâä·eŠþw®mœèjçžÚ‚°æQ˜mö ž¼f}תÓâ€öÝÏö{®í̯-áÀ/{€"‘Käïž!æÿË»E†£âtí:ë®.úí¶û/F«ì(ûªÆ·nBÂïÄüÌE/hÍ…Þ&jÞOÖýÐ<÷!þ÷þé.ú-ð/Ëj€8ýPYÁüpVÁ@HÓ+dìDÓÎÆô©>蟬ĬÏX7ÀÊÔÃÚÝ,ÐEMÚZ%¬fFb{ˆü;o.dÅÁüàÄ .B@7Å€ƒ aý ðXàrP¶Ì¸·þžéÄûȲŸ­Hà 5ŽÜöLÐÍŒÙMæ{ЦÀ²¥`°¥p« ïvæ@¦¤O„-b/ÍÒfÑ,v‘2èüÊþÛÌ&”ÏM ‹#+ZÜÁþ jeOÎOOhN¡þNå2{Q _kHLˆCoÛD Ä€ Oˆ,¦_|ÏÑšvŒípúJÂÜOS.Gnàünà=nàÕ1beà¼ÝÀNqä ¡jd¥Ñ|„JN Œc?¯pƒ6ñŽ’+êb€èº€3 (¸Û`8îHŸƒñŽD .H¸P’¸dç qÆS-Þqf`Þ@·áýŠb ËÌ¥©›Èýæõ¬ýïp@¡þÏìÂ#> Bm… ¨¶‹ vÿѼõ {!Ì4¸K"DIñÝÍå 1…òH_Ù$ ȼèNnò_ÿÁÿ&Òqd'‘ƒB¢ ÂÃ>ñàrîo-®nÜÇW(1S ÊÔð,ý Û"С#Hüq©ž…Ä9L¼Ç $Áÿ`‹r¼Àžê !2RÁ%1ë%Cäb‚C>«Ž)ŽlÀo4sJæïŒRÒ‚Ý0+*òøpòû#'¹0§0’²LjV|23 C~ ó $vGhà&b©%®R ÒÃ0¯,‚âÂbý8üÓG;NoH¥ ñ¼àÅ"r”ý3ͳi¢CˆHD®á+#Ü>¹´Î²q1à múÀî3üöÎY2ÔPE9îd/€u.`hEÁýAd_åð @TN3Ë61Zîg*q VÍp>²nÓ$\òY%À “4z? £,S/F´ÁþF/“´EàgA~EëÊk ROY³Ð_t^²¢Þg…ñCñ. Ã…DRp1.)9Rà`"b d² eFóM°?Tt3ï9cKk?Dî NeRœ³ÕB$LïšjÌhŬcKh@ÖWE´¿L"B ¢‚‚Bè G˜?4ÙFÔp3 €@“ŒAüŽÔê’€±h{ÓOòòé E ¦-P²¬é0´@*´Q9U”À\ a `À `x `> ` ` oì ã:~uEF‘„ý `@€#US9°ŸéûC Y0PF¤PÎv“#'âÔ‡lcUó“%Õ#LBL‚TÎ `uZ: `$•³Mt ÷`À €P•Ãe¡ý4ãåhpP “¨C^u ÐÊÕ5‡_TÁ_€¢B bÂv V/u²¢$`”ãaâ %8ÏèB’}$Aþ #‚„KÍ^k<d€dÕ‹Xõ’ A `æ `S"u©ZÕÀF–FÕhvŠ í+ DoUgiÊOGõ…Kµö‘ŽÊ `Ò `’ `V `+l":ÖÑ@à!€.®m€ ^ÆõPXLßnÖð”Æ `â `ª `v `Kk÷ qwP$6oA*àÀU\aÃX  ö® ` `z `M-"b“«u7ˆ$ xà+  =y ¢ 6`Ú `” `›`B׃xw‹{â /usr/home/michael/Sandbox/GNUstep/core/gui/Images/common_Folder.tiffCreated with The GIMPPaint.NET v3.5.5HHþ0/z EüB/ôjr(1X=Rgnustep-gui-0.24.0/Images/common_UnknownApplication.tiff0000664000076500007650000002254007657426464023243 0ustar brains99brains99II*$  +-Dr$ I^(((u<<<–BBA©b`^·xwtÅ~~zÔ€€{Þ‚€{ã»·°î¹¶­ó·µª÷°±¥ú¬­¢ü·¹ªý³µ¥ý¬­œþ §’þœŸŠþŽ{þRRBþíKn888\\Z»ffd  àªª¦í««¨îííéýììçþîîéþííèþìëçþëêåþééáþççÞþååÜþââÙþÞÞÕþÜÜÓþÙÙÏþ×ÔÊþÓÐÅþÎÍÀþÉʽþÇÉ»ÿÀôÿ¸ºªÿ°²¢ÿ¥¬˜ÿ¢¤ÿ“•ÿQSCÿÿ! þ//)¸$ˆˆˆÒÁÁÁòæææùûûúþýýûÿüüúÿüüúÿûûøÿúû÷ÿùùõÿøøôÿ÷÷òÿõöðÿõõðÿòñëþïïéþííçþììçþêêåþéèâþææÞþããÛþááØþÜÝÔþÛØÌþÕÕÊþÓÓÇþÐÐÃþ¿¿±þ¶¶¥ÿ°±Ÿÿ£§Žÿ”˜ÿ’•ÿ ¢Šÿ˜˜ÿUUCÿÿÿ ú'''„ÿÿþÿþþýÿûûúþúûúþúúùþùùøþüüúÿûûøÿúû÷ÿùúöÿøøõÿ÷÷òÿõöðÿôöïÿòñëþïïéþííçþììçþëêæþéèãþææàþääÜþââØþÝÞÓþÚØËþÓÓÇþË̼þÁ²þ²³£þ©©šÿ›œ‹ÿŒzÿƒmÿz}eÿ–˜ÿ¢£ŒÿWWEÿÿ!"ÿú(((†ûûûþûûúþùù÷þ÷÷õþøøöþùú÷þüüùÿûüùÿûûøÿúúõÿ÷øóÿõõïÿîîçÿääÚÿÐÐÅþÀÁ·þ­¯£þžž’þŽŽƒþ€rþll_þYYNþLLBþ;;0þ**!þþþ&ÿ%ÿ#ÿ!ÿÿÿˆ‰ÿêéãÿ¯±Ÿÿ[WIÿÿ%&ÿú(((†ûûúþööôþììçþÝÝÓþËÍÂþ¹¼¯þ©¬ÿ’”†ÿ~~qÿfg[ÿQSHÿ*%9ÿCÿBÿ@ÿ>ÿ <ÿ :ÿ 8ÿ 6ÿ 4ÿ 2ÿ0ÿ.ÿ,ÿ*ÿ(ÿ'ÿ%ÿ#ÿ!ÿÿÿ˜™•ÿìëäÿ¯±Ÿÿ[XIÿ""ÿ()ÿ ú(((†üûúÿææàÿgg_þUÿSÿQÿOÿMÿKÿIÿGÿEÿDÿBÿ@ÿ>ÿ=ÿ=ÿ<ÿ 9ÿ 5ÿ1ÿ0ÿ.ÿ,ÿ*ÿ)ÿ'ÿ%ÿ#ÿ!ÿÿÿ™™–ÿîìçÿ²³¡ÿZZJÿ$$ÿ++ÿ !ú(((†üüúÿîîéÿ`_\þUÿSÿQÿOÿMÿKÿIÿIÿJÿ Iÿ Gÿ Eÿ Fÿ$Oÿ92_ÿ>8aÿ2,Wÿ"Hÿ<ÿ 4ÿ.ÿ,ÿ+ÿ)ÿ'ÿ%ÿ#ÿ!ÿÿÿš™–ÿîíçÿ±´¡ÿ\[Kÿ&&ÿ..ÿ#%ú(((†ùù÷þëëåþ__[þUÿSÿQÿOÿMÿLÿQÿ- ]ÿ>3iÿH>oÿMDrÿOFrÿQItÿic†ÿ&&*ÿ105ÿDBNÿHE[ÿ84Uÿ$ Fÿ:ÿ 5ÿ 2ÿ .ÿ(ÿ%ÿ#ÿ!ÿÿÿšš—ÿîîèÿ²µ£ÿ`^Nÿ((ÿ21!ÿ&(ú(((†üüúÿîïèÿ^^YþUÿSÿQÿOÿNÿ Tÿ8,cÿOIeÿ?>Fÿÿ ÿÿÿÿÿÿ  ÿ''*ÿFEOÿKI]ÿ?=Yÿ64Rÿ.-Jÿ >ÿ /ÿ%ÿ#ÿ!ÿÿÿœ›˜ÿîîéÿµ·¦ÿbaPÿ++ÿ44$ÿ()ù(((†ûûúÿïïéÿ``[þUÿSÿQÿPÿ Uÿ:-eÿNHdÿ/.3ÿ ÿÿÿÿÿÿÿÿ  ÿÿ444ÿWWZÿcbkÿRQ\ÿBAKÿ;:Lÿ=ÿ'ÿ#ÿ!ÿÿÿœœ™ÿíîèÿ¶¶¦ÿbbQÿ--ÿ67(ÿ88%ý"((&†øøöþððéÿ`_[þUÿSÿQÿ Uÿ5&cÿMFdÿ1/6ÿ  ÿÿÿÿÿÿÿÿÿ&&'ÿqqrÿÿžžžÿ€€ÿ<yÿÿÿÿÿÿÿÿÿÿÿÿÿ001ÿ®®®ÿüüüÿüüüÿüüüÿ÷÷÷ÿ¾¾¾ÿ558ÿ?>Yÿ +ÿ#ÿ!ÿÿÿšÿññêÿÀÀ¯ÿiiUÿ@@0ÿZZEÿ__Gÿ#$ÿ8((&†÷÷õþììåþ\\UþVÿTÿ WÿRD}ÿÿÿÿÿÿÿÿÿÿÿÿÿ,,-ÿ«««ÿüüüÿüüüÿüüüÿüüüÿßßßÿNNPÿBA\ÿ +ÿ#ÿ!ÿ ÿÿžšÿòòìÿÁÁ±ÿjkWÿEE4ÿacKÿbgLÿ&'ÿ H((&†úú÷ÿííçÿZZWþVÿTÿ XÿSF~ÿÿÿÿÿÿÿÿÿÿÿÿ ÿ556ÿ¯¯¯ÿüüüÿüüüÿüüüÿüüüÿêêêÿPPQÿCC]ÿ ,ÿ#ÿ"ÿ ÿÿ££ŸÿòóîÿÁôÿnp\ÿKK9ÿeiQÿjoSÿ**ÿ H&&&†÷÷ôþîîæÿZZSþVÿTÿ XÿUGÿÿÿÿÿÿ ÿjjlÿ¦¦¦ÿ±±±ÿ¶¶¶ÿ½½½ÿ¾¾¾ÿÌÌÌÿìììÿüüüÿüüüÿüüüÿüüüÿòòòÿJJJÿGGaÿ -ÿ$ÿ"ÿ ÿÿ««§ÿòóîÿÃŶÿrt_ÿQR>ÿotZÿsw[ÿ// ÿ H&&&†ö÷óþìîåÿ[[XþVÿTÿ XÿTF~ÿÿÿÿÿÿÿ“““ÿêêêÿ÷÷÷ÿøøøÿúúúÿûûûÿûûûÿüüüÿüüüÿüüüÿüüüÿüüüÿöööÿ;;;ÿJJbÿ0ÿ$ÿ"ÿ ÿÿ­­©ÿóóîÿÆÈ·ÿwybÿRVAÿty^ÿ{|bÿ21$ÿ3&&&†ùùõÿìíæÿZZTþVÿTÿ WÿPB{ÿÿÿÿÿÿÿ•••ÿïïïÿûûûÿûûûÿûûûÿûûûÿûûûÿüüüÿüüüÿüüüÿüüüÿüüüÿààáÿÿJJaÿ1ÿ$ÿ"ÿ ÿÿ¯¯«ÿóôïÿÈÊ»ÿw{eÿU\Eÿzcÿ€iÿ54%ÿ$&&&†ùùõÿìíçÿ[[SþVÿTÿ VÿI:vÿ$#)ÿÿÿÿÿÿ“““ÿíííÿûûûÿûûûÿûûûÿûûûÿûûûÿûûûÿüüüÿüüüÿüüüÿûûûÿœœÿÿKK`ÿ4ÿ$ÿ"ÿ ÿÿ±°­ÿôôðÿËÌ¿ÿw|hÿW]Fÿƒiÿ††pÿ78'ÿ$&&&†ööòþîìæÿ\\TþVÿTÿUÿ>.nÿ:6Eÿ  ÿÿÿÿÿÿìììÿûûûÿûûûÿûûûÿûûûÿûûûÿûûûÿüüüÿüüüÿüüüÿèèèÿVVVÿ ÿKJ^ÿ7ÿ%ÿ"ÿ ÿÿ±±­ÿõõðÿÎÎÀÿ~kÿ\`IÿЉnÿŠŽxÿ;<*ÿ$&&&†ööòþìíæÿY[TþVÿTÿTÿ6&hÿUNjÿ.-1ÿÿÿÿÿŽŽŽÿëëëÿûûûÿûûûÿûûûÿûûûÿûûûÿûûûÿüüüÿüüüÿïïïÿ˜˜™ÿ&&(ÿÿJJ\ÿ9ÿ%ÿ"ÿ ÿÿ´´°ÿõõðÿÑÑÁÿƒ…lÿ_dLÿŽŒoÿ”|ÿ45$ÿ$&&&†øøôÿêëåÿ\\VþVÿTÿUÿ<,lÿ@SÿE@TÿE@SÿEATÿIEWÿQN_ÿ_\mÿtq‚ÿ€}Žÿ|y‰ÿhfuÿVTcÿKIXÿFDRÿCAOÿCANÿBAMÿ@?Kÿ66Cÿ-,Cÿ3ÿ%ÿ"ÿ ÿÿÔÔÑÿööóÿ××Éÿ„‡qÿbgNÿ‘•}ÿ–™‚ÿ??/ý$&&&†ööñÿéèàÿ\\VþVÿUÿSÿ Wÿ-aÿ6&fÿ6'eÿ5'cÿ4'aÿ3'_ÿ2'^ÿ1'\ÿ1'Zÿ0'Yÿ0'Wÿ/'Vÿ.'Tÿ-'Sÿ,'Qÿ,'Oÿ+'Nÿ*'Lÿ)&Iÿ" Cÿ6ÿ*ÿ$ÿ"ÿ ÿÿÕÕÒÿøøôÿÙÙÌÿ„‡qÿbgNÿ‘•}ÿ—›ƒÿ¤&&&†ööòÿóóîÿ½½ºþ©©¦þ¤¥¡þ¢¢Ÿþ£¢Ÿÿ˜˜•ÿÿ‰ÿŒ‹ˆÿˆˆ…ÿ‡‡ƒÿ„…ÿ|þ~~{þ||yþyyvþrrpþppoþoonþnnlþmnkþlljþkkhþiigþhhfþffdþbb`þedcÿccaÿaa_ÿ``^ÿääàÿøøôÿÚÚÎÿ„nÿaeMÿ”yÿ†Œtý/&&&†øøôÿøøôÿøøóÿôôðþôôðþôôðþ÷÷óÿ÷÷óÿö÷òÿö÷òÿööóÿõöñÿõöñÿõöñÿòòíþòóîþòòîþòòíþñòíþòòíþññíþññëþñðêþïïêþîîéþìíçþëìæþëìæþêêäþêêãÿééáÿççÝÿææÜÿááÙÿààÖÿØ×Ìÿ‚lÿ]bJÿ”zÿ|kú&&%†ôôðþ÷÷óÿôôðþôôðþõôðþôôðþ÷÷óÿ÷÷óÿö÷òÿööòÿööôÿõöòÿõöòÿõõñÿòòíþóóíþóòíþòóíþñòíþòòîþñòîþòñìþòðêþïðêþîîèþííçþììçþëëçþêèäþëêäÿçéàÿçæÞÿääÛÿààÖÿÜÛÎÿÙÖÍÿ~iÿ]aIÿ‹xÿz{jú&&&†ôôðþ÷÷óÿôôïþôôïþóóîþóóïþõöóÿõöòÿõöòÿööòÿööòÿõöñÿôõñÿõõñÿòóîþòóîþñòîþòòíþñòíþñòíþñòîþñðëþñïêþïïêþíîèþííèþììèþêêæþéèãþëêãÿèéáÿçæÞÿääÛÿààÖÿÝÜÐÿ×ÖËÿzzdÿ]`Hÿ†‰qÿvvdú N««ªì°°­ð°°¬ð®­ªð¬¬©ð¿¾º÷ÄĺÿÈÉ¿ÿÍÍÄÿÐÐÇÿÔÔÊÿØØÎÿÝÝÓÿããÙÿååÜþççßþêêãþììæþìíçþîîèþîîéþïïéþîîéþííçþííçþììçþìëæþééãþççßþêêâÿééàÿååÜÿââÙÿßÞ×ÿÜÜÓÿÖÖÈÿmmXÿSU?ÿnrYÿZZEú"""ÊÈ»ÿÅǸÿÁÄ´ÿ¸¼«ÿ³·¦ÿ¯±¡ÿ¨¨˜ÿ°°¡ÿÓÓÉþÜÜÓþÐÐÄþÊʾþÉɾþÄĹþÀÀµþ¼¼¯þ´´¥þ¶¶¥þ··¨þ¬¬œþ¤¤•þžþ]^NþKK>ÿqsbÿmm^ÿ~~kÿ””€ÿ™š†ÿvxcÿNP<þSTCýFG>Ýwe¨¨žÿ¤¤›ÿ­¬¥ÿµµªÿÁµÿÈȽÿÈȽÿÛÛÔÿÜÜÖþÖ×ÏþÏÐÆþÌÌÁþÓÓÇþÓÓÈþÕÕÉþÛÛÐþÕÕÉþÜÜÑþääÛþââØþääÛþâàÚþ]^OþJK7ÿ¢¦ÿx|gÿ|fÿ––‚ÿ™š„þnq^ë//)˜``XßNNEÚMJCÜJG>ãGE<èCB6ëB@2õ]]Kÿ@B/þ>?-þ;<*þ99'þ88&þ88'þ88'þ88'þ99)þ99)þ77(þ55'þ66(þ54(þ!!þ%&ÿhjVÿilUþfjTõ11*±8D`_S÷--þ00 þ00 þ**þ%%þ!!þþ þ þþ þ þ þ þ&&ÿfdYõ k 8WUNÐiiUþWWFþDD6þ88-þ,,#þ$%þþþ þþþ þþ,, þMM>þhhVÿkkYþ/QQP«ÁÁ»òÔÔËþ·¸¥ÿ‚jÿ¤¤Œþ««”þ¬¬•þªª—þžž‹þ†ŠnþinRþQQ;þ::)þ12#þ01"þ34"þ>?+þ[[Fþ{{gþmm^ÿII9þ''û<<7û,*"êHE9ß970¼?““ÚîîéþòñìÿñðëÿííçÿèèáÿààØÿÝÝÔþââÙþéèàþèèáþááÙþÒÒÆþ¬­þ~~iþXXEþ>>,þ-.þ$$þþ þ þ ÿ ÿÿ;=,ÿeÿˆ‹rÿ„„nþWWNÒ ssrБ‘ãÖÖÓúÜÜÙüÚÚ×üïïëþõõñÿññìþððëþððëþïïèþîîæþííçþëëåþêêãþççßþâáÙþØØÎþÈȸþ´´¦þ¢¢þ‹‹yþtt`ÿ::)ÿDC0þlmUý\YKã))"”& $AA"""444™443™331™330™887š0--™--*™--'™**$™''"™$$!™""™™™™!!þ00æ$ Lî$:%@$P%X%(R/brains99/Source/gnu/gnustep/core/gui/Images/common_UnknownApplication.tiffcreated with The GIMPHHgnustep-gui-0.24.0/Images/common_Printer.tiff0000664000076500007650000002246610470252743021032 0ustar brains99brains99II*$ÀÀÈÿ¾¾Æÿ““›ÿŸŸ§ÿ??@DÞßãÿÆÆÈÿ³³³ÿ©©«ÿ’’”ÿ‚‚„ÿ²²´ÿÙØÝÿ??@DÛÚàÿÌËÑÿ¦¥­ÿÚÚâÿØÙÞÿØÙÞÿßàâÿ??@DÝÞàÿÚÛßÿ»¼¾ÿªª¨ÿ©ª¥ÿŸŸÿ´´²ÿßßÝÿððîÿìììÿææèÿããåÿââäÿäãèÿ??@DÊÉÏÿ·¶¼ÿ¢¡©ÿ¢ «ÿ  ¬ÿÙØÞÿØØÜÿàßâÿ÷÷÷ÿéèíÿ––˜ÿ££¥ÿ££¥ÿ××ÙÿÕÕ×ÿ½½½ÿ©©«ÿ©©©ÿ  žÿ³³±ÿããáÿõõóÿóóñÿïïíÿììêÿæææÿáááÿÝÝÝÿÙÙÛÿ××ÙÿÔÔÖÿààâÿÓÒ×ÿqpvÿ  ªÿÙØÞÿø÷üÿñðõÿõõ÷ÿòòôÿîîîÿôôôÿÏÏÏÿ¢¢¢ÿpppÿOOOÿoooÿ¥¥¥ÿ´´´ÿåååÿûûùÿùùùÿøøöÿòòòÿîîìÿêêèÿääâÿááßÿÛÛÙÿ×××ÿÖÖÖÿÓÓÓÿÿSSUÿUUWÿyzÿwwÿœ ªææèÿââäÿâââÿãããÿëëéÿôôòÿïïíÿîîîÿïïïÿììîÿŸÿ””–ÿllnÿ¢¢¤ÿûûûÿùùûÿóóóÿóóõÿíííÿéééÿäääÿßßßÿÜÜÜÿÙÙÙÿÿQQQÿkkkÿ———ÿ¤¤¤ÿ¨¨¨ÿ””–ÿhhjÿKJOÿnmsÿ¼»¿ÌææèÿääæÿäääÿàààÿÜÜÚÿÚÚØÿÖÖÔÿÚÚØÿàààÿíííÿîîðÿîîðÿèèêÿååçÿ¹¹»ÿŽŽÿ335ÿžž ÿÌÌÎÿììîÿèèèÿãããÿÞÞÞÿ”””ÿ[[[ÿuuuÿŽŽŽÿ£££ÿ©©©ÿ©©©ÿ©©§ÿ””’ÿ}}}ÿNNPÿ'&+ÿÙÙÛÿèèèÿåååÿäääÿãããÿßßßÿÜÜÜÿÙÙÙÿÕÕÕÿÐÐÐÿÍÍÍÿÈÈÈÿÍÍÍÿÔÔÔÿèèèÿêêêÿîîîÿæææÿßßßÿ³³³ÿŒŒŒÿ222ÿkkkÿ’’’ÿGGGÿmmmÿÿ¤¤¤ÿ¨¨¨ÿ©©©ÿ©©©ÿ}}}ÿhhfÿIIGÿ@@@ÿ,,.ÿÿ‚‚„ÿ}}}ÿµµµÿÍÍÍÿàààÿàààÿÜÜÜÿØØØÿÓÓÓÿÐÐÐÿËËËÿÈÈÈÿÃÃÃÿ¾¾¾ÿ¼¼¼ÿÂÂÂÿÉÉÉÿäääÿèèèÿêêêÿÄÄÄÿ¾¾¾ÿuuuÿZZZÿCCCÿ999ÿ111ÿpppÿpppÿ~~~ÿOOOÿ???ÿ775ÿ..,ÿ---ÿ""$ÿÿÔÔÖÿdddÿ\\\ÿwwwÿ”””ÿ«««ÿÛÛÛÿÙÙÙÿÔÔÔÿÎÎÎÿÌÌÌÿÅÅÅÿÁÁÁÿ¿¿¿ÿ»»»ÿ¸¸¸ÿ¶¶¶ÿ²²²ÿ»»»ÿÄÄÄÿÿzzzÿmmmÿhhhÿgggÿhhhÿiiiÿ\\\ÿHHHÿBBBÿ111ÿ000ÿ)))ÿÿ""$ÿ&&(ÿÿÕÔÙÿ‰‰‰ÿ999ÿZZZÿuuuÿrrrÿhhhÿ   ÿ¸¸¸ÿÎÎÎÿÊÊÊÿÅÅÅÿÂÂÂÿ¼¼¼ÿºººÿ···ÿµµµÿ´´´ÿ°°°ÿ•••ÿfffÿ^^^ÿhhhÿiiiÿbbbÿ^^^ÿHHHÿ<<<ÿ444ÿ222ÿ&&&ÿÿ%%%ÿ,,,ÿ,,.ÿ(',ÿÿÔÓØÿ™™›ÿ888ÿ[[[ÿuuuÿrrrÿvvvÿsssÿjjjÿwwwÿÿÄÄÄÿÀÀÀÿ¼¼¼ÿ¹¹¹ÿ···ÿ´´´ÿ­­­ÿ˜˜˜ÿuuuÿeeeÿZZZÿ\\\ÿUUUÿDDDÿ666ÿ666ÿ,,,ÿ"""ÿ&&&ÿ+++ÿ///ÿ+++ÿ***ÿ))+ÿ*).ÿÿÓÒ×ÿ™™›ÿ777ÿIIIÿGGGÿLLLÿ<<<ÿvvvÿwwwÿxxxÿmmmÿ```ÿgggÿ‚‚‚ÿ···ÿµµµÿ´´´ÿ¢¢¢ÿ|||ÿbbbÿZZZÿIIIÿ???ÿ999ÿ666ÿ)))ÿ"""ÿ)))ÿ333ÿ111ÿ///ÿ...ÿ---ÿ+++ÿ))+ÿ(',ÿ ÿÓÒ×ÿ˜˜šÿ668ÿaacÿÿvvvÿWWWÿGGGÿYYYÿ===ÿhhhÿvvvÿxxxÿ^^^ÿHHHÿ\\\ÿ{{{ÿoooÿUUUÿGGGÿ:::ÿ222ÿ000ÿ$$$ÿ)))ÿ000ÿ333ÿ222ÿ111ÿ...ÿ---ÿ---ÿ**(ÿ**(ÿ)))ÿ'')ÿ ÿÓÒ×ÿ——™ÿ88:ÿcceÿ“““ÿ“““ÿˆˆˆÿ}}}ÿtttÿTTTÿFFFÿZZZÿKKKÿKKKÿxxxÿXXXÿIIIÿOOOÿFFFÿ222ÿ***ÿ$$$ÿ+++ÿ666ÿ555ÿ333ÿ222ÿ222ÿ///ÿ///ÿ+++ÿ+++ÿ**(ÿ((&ÿ(((ÿ&&(ÿ ÿÒÑÖÿ——™ÿ99;ÿddfÿ•••ÿ™™™ÿ™™™ÿ–––ÿÿ†††ÿ|||ÿrrrÿUUUÿHHHÿ[[[ÿJJJÿ˜˜˜ÿ|||ÿbbbÿ;;;ÿ111ÿ222ÿ777ÿ666ÿ666ÿ333ÿ222ÿ111ÿ...ÿ///ÿ---ÿ+++ÿ((&ÿ''%ÿ'''ÿ%%'ÿ ÿÒÑÖÿ™™›ÿ88:ÿ^^`ÿ™™™ÿ˜˜˜ÿ˜˜˜ÿ™™™ÿ™™™ÿ———ÿ•••ÿ‘‘‘ÿ†††ÿ~~~ÿtttÿ]]]ÿ˜˜˜ÿ˜˜˜ÿuuuÿ:::ÿ222ÿ333ÿ555ÿ666ÿ222ÿ111ÿ111ÿ///ÿ///ÿ,,,ÿ)))ÿ***ÿ)))ÿ((&ÿ%%%ÿ'')ÿÿ–—œÿ‚ƒˆÿ•”™ÿ——™ÿ999ÿ+++ÿIIIÿÿ˜˜˜ÿ˜˜˜ÿ˜˜˜ÿ˜˜˜ÿ———ÿ™™™ÿ˜˜˜ÿ˜˜˜ÿ•••ÿhhhÿ˜˜˜ÿ———ÿrrrÿ:::ÿ222ÿ222ÿ777ÿ555ÿ444ÿ222ÿ111ÿ///ÿ,,,ÿ,,,ÿ++-ÿ)))ÿ'''ÿ&&&ÿ&&(ÿ$$&ÿÿ€…ÿjkoÿQRVÿQRVÿRSWÿQQSÿvvxÿ„„„ÿQQQÿ„„„ÿ‰‰‰ÿPPPÿfffÿ˜˜˜ÿ˜˜˜ÿšššÿ———ÿ———ÿ™™™ÿ˜˜˜ÿlllÿ˜˜˜ÿ˜˜˜ÿrrrÿ888ÿ222ÿ000ÿ555ÿ333ÿ111ÿ111ÿ...ÿ---ÿ,,,ÿ,,,ÿ((*ÿ((*ÿ))+ÿ "ÿÿ ÿÿTSXÿSRWÿSSUÿ[[]ÿddfÿllnÿssuÿssuÿµµµÿ´´´ÿçççÿÝÝÝÿÌÌÌÿ«««ÿŒŒŒÿYYYÿvvvÿÿ˜˜˜ÿ———ÿ™™™ÿ˜˜˜ÿlllÿ–––ÿ™™™ÿtttÿ777ÿ111ÿ222ÿ555ÿ444ÿ111ÿ000ÿ///ÿ///ÿ++-ÿ++-ÿ))+ÿÿÿ ÿÿ56;ÿJJRÿzzƒÿgflÿbbdÿkkmÿtttÿqqqÿºººÿ···ÿóóóÿñññÿíííÿêêêÿèèèÿãããÿßßßÿÙÙÙÿËËËÿ³³³ÿ›››ÿ~~~ÿ[[[ÿfffÿ———ÿ˜˜˜ÿkkkÿšššÿ–––ÿsssÿ888ÿ000ÿ///ÿ333ÿ111ÿ111ÿ///ÿ---ÿ,,,ÿ&&(ÿÿÿ ÿ#"'ÿ76<ÿZ[`ÿ__gÿhhrÿwv{ÿ™™›ÿ½½¿ÿÜÜÜÿúúúÿööôÿööôÿóóóÿñññÿìììÿéééÿæææÿäääÿàààÿÚÚÚÿØØØÿÐÐÐÿÉÉÉÿ···ÿªªªÿ|||ÿHHHÿgggÿlllÿ˜˜˜ÿ˜˜˜ÿsssÿ666ÿ111ÿ000ÿ222ÿ111ÿ000ÿ---ÿ'')ÿÿÿ ÿ98=ÿKJOÿ_^dÿedlÿlltÿìëñÿüüþÿûûýÿúúúÿ÷÷÷ÿ÷÷õÿóóñÿòòðÿïïïÿìììÿèèèÿåååÿâââÿßßßÿÝÝÝÿÙÙÙÿÖÖÖÿÒÒÒÿÈÈÈÿ²²²ÿ¥¥¥ÿiiiÿ„„„ÿQQQÿ———ÿ™™™ÿsssÿ444ÿ///ÿ///ÿ111ÿ+++ÿ%%%ÿ##%ÿÿ(',ÿ87<ÿ]\aÿcbhÿlkqÿöö÷ÿÕÖÛÿ÷÷ùÿúúúÿöööÿøøøÿòòðÿññïÿîîîÿëëíÿççéÿääæÿâââÿÝÝÝÿÛÛÛÿØØØÿÒÒÒÿ¿¿¿ÿŽŽŽÿDDDÿ;;;ÿHHHÿaaaÿ)))ÿ———ÿ˜˜˜ÿtttÿ444ÿ---ÿ,,,ÿ%&(ÿ#$&ÿÿ89=ÿJKOÿ^_dÿghmÿqrwÿÕÔÙÿððòÿ÷÷ùÿôôôÿôôôÿðððÿíííÿììîÿääæÿããåÿßßßÿÛÛÛÿÎÎÎÿ¸¸¸ÿqqqÿ777ÿCCCÿYYYÿeeeÿvvvÿvvvÿnnnÿfffÿƒƒƒÿaaaÿ..0ÿ))+ÿ""$ÿ&'+ÿ89=ÿ[\aÿabgÿhhpÿöõöÿéèíÿððòÿòòòÿïïïÿëëëÿèèèÿæææÿÞÞÞÿÍÍÍÿ›››ÿLLJÿDDBÿNNLÿggeÿttrÿ€€~ÿÿ’’’ÿ———ÿuuuÿbbdÿEEGÿ..0ÿÿ9:>ÿIJNÿ^_dÿghmÿ•ÿ×ÖÛÿïïñÿîîðÿììîÿääæÿÉÉËÿ||~ÿ<<>ÿIIKÿQQQÿ```ÿ|||ÿŽŽŽÿ———ÿ‡‡‡ÿvvvÿbbdÿLLNÿJJLÿLKPÿXW\ÿZY_ÿa`fÿfglÿnnvÿ}}…ÿÅÆËÿçèíÿäåéÿ‘•ÿBCGÿUVZÿbcgÿbcgÿ^]bÿUTYÿwwyÿ˜˜šÿvvxÿGGIÿMMOÿRQVÿXW\ÿ[Z`ÿa`hÿgfnÿonvÿ|{ƒÿÄÄÊÿopuÿjjrÿiiqÿmmuÿqqyÿrqyÿjiqÿa`fÿYX^ÿdciÿ[Z_ÿ_^dÿ^]cÿdciÿjiqÿut|ÿ}ˆÿÃÃÉÿ††ÿ‰‰•ÿžž¤ÿedlÿedjÿgfnÿnmuÿvu}ÿЉ‘ÿÎÏÔÿÌÍÒÿåæëÿ÷øýÿõõýÿ••ÿýüÿÿûûýÿ÷÷ùÿôôöÿññóÿíîòÿìíñÿ¦§¬ÿÍÍÕÿüýÿÿýüÿÿüûÿÿùùûÿøøúÿöööÿõõõÿòòòÿðððÿíîðÿèéëÿÁÂÆÿÐÐØÿúûÿÿûúÿÿúúüÿøøøÿöööÿõõõÿóóóÿññïÿïïíÿêêêÿêêìÿæåêÿ²²ºÿüýÿÿúùþÿúúúÿøøøÿööôÿóóóÿñññÿïïïÿëëéÿêêêÿæææÿççéÿ¸·¼ÿ˜˜ ÿýþÿÿùøýÿùùùÿõõõÿõõóÿóóóÿñññÿíííÿìììÿèèèÿäääÿââäÿÏÎÓÿ–– ÿÍÎÓÿø÷üÿööøÿôôôÿôôòÿðððÿîîîÿëëëÿèèèÿäääÿäääÿáááÿÞÞàÿ£¢¨ÿÍÍÕÿø÷ýÿõõ÷ÿôôôÿññïÿîîîÿîîîÿèèèÿççåÿååãÿààÞÿßßßÿÜÜÞÿ¶µ»ÿ••ÿúùÿÿòòôÿñññÿïïíÿíííÿéééÿèèæÿååãÿââàÿÞÞÜÿÛÛÛÿÛÛÝÿØ×Üÿ““ÿåäêÿòòôÿîîîÿîîìÿêêêÿèèèÿäääÿâââÿáááÿÝÝÝÿÜÜÜÿÙÙÛÿ×ÖÛÿ°¯µÿ““ÿÌËÑÿôôöÿïïïÿëëéÿêêêÿåååÿäääÿâââÿÜÜÜÿÜÜÜÿØØØÿ××ÙÿÖÖØÿ¶µºÿ“’šÿõôùÿììîÿêêêÿèèèÿäääÿãããÿßßßÿÝÝÛÿÙÙ×ÿÙÙ×ÿÖÖÖÿÓÓÓÿÓÓÕÿ“’šÿûúÿÿëëíÿçççÿåååÿãããÿßßßÿÝÝÝÿÚÚØÿÚÚØÿÕÕÓÿÕÕÓÿÔÔÔÿÔÔÖÿ°¯´ÿ‘‘™ÿÊËÐÿçæëÿèèêÿäääÿàààÿßßßÿÜÜÜÿÙÙ×ÿØØÖÿÖÖÖÿÓÓÓÿÒÒÔÿÐÐÒÿÂÁÆÿ’’œÿ¬¬´ÿõôúÿâáæÿßßáÿààâÿÜÜÞÿÙÙÛÿÙÙÛÿÕÕ×ÿ²²´ÿ´³¸ÿ˜—œÿááäÿðñöÿâãèÿßàäÿ¸¹½ÿ¸·½ÿœ¢ÿððñÿÓÓÖÿððñÿþ00Ú$ Dâ$@$&%.%(R/home/heron/Development/gnustep/core/gui/Images/common_Printer.tiffHHgnustep-gui-0.24.0/Images/common_Root_Sparc.tiff0000664000076500007650000002230206711564111021445 0ustar brains99brains99MM*$ÜÜÜÜÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýýýÿôôôÿìììÿçççÿãããÿÜÜÜÿÔÔÔÿÐÐÐÿÌÌÌÿÆÆÆÿÁÁÁÿ¾¾¾ÿ¼¼¼ÿ¸¸¸ÿµµµÿ³³³ÿ±±±ÿ±±±ÿ°°°ÿ°°°ÿÿ222¼¼¼¼þþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþþþþþüüüþøøøþôôôþïïïþêêêþèèèþåååþâââþßßßþÝÝÝþÛÛÛþÚÚÚþÙÙÙþÙÙÙþÙÙÙþÙÙÙþÙÙÙþÙÙÙþÿ111¼¼¼¼ÿÿÿÿþþþþþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþþþþþüüüþøøøþôôôþïïïþêêêþèèèþåååþâââþßßßþÝÝÝþÛÛÛþÚÚÚþÙÙÙþÙÙÙþÙÙÙþÙÙÙþÙÙÙþÙÙÙþÿ111¼¼¼¼ÿÿÿÿÄÄÄþÄÄÄþÂÂÂþ¼¼¼þ¶¶¶þ®®®ÿ¤¤¤þœœœþ———þ“““þ”””ÿþþŽŽŽþþŠŠŠÿ†††ÿþþ~~~þ}}}þ|||þ}}}ÿxxxþvvvþtttþtttþ|||þ………þ‘‘‘ÿžžžþ§§§þ°°°þ²²²þÿ111¼¼¼¼ÿÿÿÿ•ª•ÿŸŸŸÿŸŸŸÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€Š€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ111¼¼¼¼ÿÿÿÿŸŸŸÿŸŸŸÿŸŸŸÿ$ÿ//Hÿ//Jÿ11Jÿ22Lÿ33Mÿ44Qÿ77Rÿ88Vÿ;;Yÿ<<[ÿ==\ÿ>>_ÿ@@`ÿ@@`ÿ@@`ÿ>>_ÿ==^ÿ==[ÿ<>_ÿ@@aÿAAcÿAAcÿAAcÿ@@aÿ>>_ÿ>>^ÿ==[ÿ99Yÿ77Uÿ66Rÿ44Pÿ22Lÿ11Jÿ//Hÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ...¼¼¼¼ÿÿÿÿŸŸŸÿŸŸŸÿŸŸŸÿ$ÿ//Jÿ11Jÿ11Kÿ33Mÿ44Pÿ77Rÿ88Uÿ;;Yÿ<<[ÿ>>_ÿ@@aÿBBdÿBBeÿCCeÿBBeÿBBdÿAAaÿ@@`ÿ>>^ÿ;;Zÿ88Vÿ77Tÿ66Qÿ22Mÿ11Kÿ11Jÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ...¼¼¼¼ÿÿÿÿŸŸŸÿŸŸŸÿŸŸŸÿ%ÿ11Lÿ22Lÿ33Mÿ44Pÿ77Rÿ88Vÿ;;Yÿ==^ÿ@@`ÿBBdÿCCfÿFFiÿGGjÿGGkÿGGjÿFFjÿEEhÿCCeÿAAcÿ>>_ÿ<>^ÿ<<[ÿ99Yÿ77Tÿ66Qÿ44PÿŠ€Šÿÿÿÿÿÿÿÿÿÿÿÿÿÿ***¼¼¼¼ÿÿÿÿ•ª•ÿŸŸŸÿŸŸŸÿ(ÿ33Oÿ66Qÿ66Rÿ77Uÿ99Wÿ<<[ÿ>>^ÿAAcÿCCeÿFFjÿHHmÿKKrÿLLsÿLLsÿLLsÿLLrÿJJoÿHHmÿFFjÿCCeÿ@@`ÿ==^ÿ<<[ÿ88Uÿ77Rÿ66Qÿ€Š€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ)))ººº¼ÿÿÿÿª•ªÿŸŸŸÿŸŸŸÿ(ÿ44Qÿ66Rÿ77Tÿ99Wÿ;;Zÿ==^ÿ@@`ÿCCeÿEEhÿHHnÿKKpÿMMuÿOOwÿPPxÿPPxÿOOwÿLLtÿKKrÿHHnÿFFiÿBBdÿ@@`ÿ==^ÿ;;Wÿ88Uÿ77TÿŠ€Šÿÿÿÿÿÿÿÿÿÿÿÿÿÿ'''···¼ÿÿÿÿŸŸŸÿŸŸŸÿŸŸŸÿ)ÿ66Rÿ77Tÿ88Uÿ;;Yÿ<<[ÿ>>_ÿAAaÿCCfÿFFjÿJJoÿLLsÿPPxÿQQyÿQQzÿQQzÿQQyÿOOwÿLLsÿJJpÿGGkÿCCeÿAAcÿ>>_ÿ;;Zÿ88Vÿ88Uÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ$$$²²²¼ÿÿÿÿª•ªÿŸŸŸÿŸŸŸÿ*ÿ77Tÿ88Vÿ99Wÿ;;Zÿ==\ÿ@@aÿBBdÿFFiÿHHmÿLLrÿOOuÿRRzÿTT}ÿTT~ÿTT~ÿTT}ÿQQyÿOOwÿLLsÿHHnÿEEhÿBBdÿ@@aÿ<<[ÿ;;Yÿ99VÿŠ€Šÿÿÿÿÿÿÿÿÿÿÿÿÿÿ"""¯¯¯¼þþþÿ•ª•ÿŸŸŸÿŸŸŸÿ*ÿ77Tÿ88Vÿ99Wÿ<<[ÿ==^ÿAAaÿBBeÿFFiÿHHmÿLLsÿOOwÿRR|ÿTT~ÿUUÿUUÿTT~ÿQQzÿPPwÿMMsÿJJnÿFFhÿCCeÿAAaÿ==\ÿ;;Yÿ99Wÿ€Š€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ªªª¼ôôôÿŸŸŸÿŸŸŸÿŸŸŸÿ*ÿ77Tÿ88Vÿ99Wÿ<<[ÿ==^ÿAAaÿBBeÿFFiÿHHmÿLLsÿOOwÿRR|ÿTT~ÿUUÿUUÿTT~ÿQQzÿPPwÿMMtÿJJnÿFFiÿCCeÿAAaÿ==\ÿ;;Yÿ99Wÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ§§§¼ïïïÿ•ª•ÿŸŸŸÿŸŸŸÿ*ÿ77Tÿ88Vÿ99Wÿ;;Zÿ==\ÿ@@aÿBBdÿFFiÿHHmÿLLrÿOOuÿRRzÿTT~ÿTT~ÿTT~ÿTT}ÿQQyÿOOwÿLLsÿHHnÿEEhÿBBdÿ@@aÿ<<[ÿ;;Yÿ99Vÿ€Š€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ£££¼æææÿª•ªÿŸŸŸÿŸŸŸÿ)ÿ66Rÿ88Uÿ99Vÿ;;Yÿ<<[ÿ@@`ÿAAcÿEEhÿGGkÿKKpÿMMtÿQQyÿRRzÿRR|ÿRR|ÿRRzÿPPxÿMMtÿKKrÿHHmÿEEfÿBBcÿ@@`ÿ<<[ÿ99Wÿ88VÿŠ€Šÿÿÿÿÿÿÿÿÿÿÿÿÿÿ   ¼áááÿ•ª•ÿŸŸŸÿŸŸŸÿ)ÿ66Qÿ77Tÿ88Uÿ99Yÿ<<[ÿ>>_ÿAAaÿCCfÿFFiÿJJoÿLLrÿOOwÿPPxÿQQyÿQQyÿPPxÿMMuÿLLsÿJJoÿGGjÿCCeÿAAaÿ>>_ÿ;;Yÿ88Vÿ88Uÿ€Š€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿœœœ¼ÚÚÚÿŸŸŸÿŸŸŸÿŸŸŸÿ(ÿ44Pÿ66Qÿ66Rÿ88Uÿ99Wÿ<<\ÿ>>_ÿBBcÿCCfÿGGkÿJHnÿLLsÿMMtÿMMtÿMMtÿMMsÿKKpÿHHnÿGGkÿCCfÿ@@aÿ>>^ÿ<<[ÿ99Vÿ77Tÿ66Rÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ™™™¼ÒÒÒÿŸŸŸÿŸŸŸÿŸŸŸÿ'ÿ22Mÿ33Oÿ44Pÿ66Rÿ88Uÿ99Yÿ<<[ÿ>>_ÿAAcÿCCfÿEEiÿHHmÿHHnÿJJnÿJJnÿHHmÿFFjÿEEhÿCCfÿAAaÿ==\ÿ;;Zÿ99Wÿ66Rÿ44Pÿ33Oÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ———¼ÐÐÐÿŸŸŸÿŸŸŸÿŸŸŸÿ%ÿ11Lÿ22Lÿ33Mÿ44Pÿ77Rÿ88Vÿ;;Yÿ==^ÿ@@`ÿBBdÿCCfÿFFiÿGGjÿGGkÿGGjÿFFjÿEEhÿCCeÿAAcÿ>>_ÿ<>^ÿ@@`ÿAAcÿBBdÿBBdÿBBdÿAAcÿ@@`ÿ>>_ÿ==\ÿ;;Zÿ88Vÿ66Tÿ44Qÿ22Lÿ11Kÿ11JÿŠ€Šÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ”””¼ÊÊÊÿŸŸŸÿŸŸŸÿŸŸŸÿ ÿ$ÿ%ÿ%ÿ'ÿ(ÿ)ÿ*ÿ,ÿ-ÿ.ÿ/ÿ 1ÿ 1ÿ 1ÿ 1ÿ 1ÿ/ÿ.ÿ.ÿ,ÿ*ÿ)ÿ(ÿ%ÿ%ÿ$ÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ”””¼ÈÈÈÿôéôÿîîîÿîîîÿÿšššÿ–––ÿ”””ÿŒŒŒÿ‡‡‡ÿ€€€ÿzzzÿsssÿoooÿjjjÿhhhÿdddÿcccÿcccÿcccÿeeeÿiiiÿkkkÿoooÿuuuÿ}}}ÿ‚‚‚ÿ‡‡‡ÿ‘‘‘ÿ–––ÿšššÿáÜáÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ”””¼ÈÈÈÿþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþþþþþÿÿÿÿþþþÿøøøÿðððÿíííÿãããþßßßþÝÝÝþÞÞÞÿÞÞÞÿÞÞÞÿßßßÿáááÿäääþêêêþïïïþôôôþýýýþÿÿÿÿþþþþþþþþþþþþþþþþøíøÿ ÿ”””¼ÈÈÈÿþþþþþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþÿÿÿÿþþþÿøøøþôôôþïïïþêêêþèèèþèèèÿâââþßßßþÝÝÝþÛÛÛþÚÚÚþÙÙÙþÛÛÛÿÙÙÙþÙÙÙþÙÙÙþÙÙÙþ ÿŒŽŽ¼¹¾¾ÿþþþþþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþþþþþüüüþøøøþôôôþïïïþêêêþèèèþåååþâââþßßßþÝÝÝþÛÛÛþÚÚÚþÙÙÙþÙÙÙþÙÙÙþÙÙÙþÙÙÙþÙÙÙþ ÿ Ïÿ$$$þ$$$þ$$$þ###þ###þ$$$ÿ"""þ!!!þ þþÿþþþþÿÿþþþþþÿ þ þ þ þ þ þ ÿ þ þ þ þ'''ÿ?111111111tpt¿†Œ†ÿþŽŽŽþÿ‹‹‹þ‰‰‰þ‡‡‡ÿƒƒƒþ}}}þyyyþsssÿmmmÿ___ÿQQQþJJJþBBBþ;;;ÿ000þ+++þ&&&þ!!!þþþþ þ þ ÿÿ¿?~~ËËËÿ¿¿¿þ¿¿¿þÁÁÁÿ¼¼¼þºººþ¸¸¸ÿ³³³ÿ¨¨¨þ¢¢¢þ•••þ‹‹‹þyyyÿeeeþYYYþPPPÿ???þ000þ(((þ!!!þÿþþþþþÿÿ666ÿA,Aÿ,A,ÿ666ÿ666ÿ,A,ÿA,Aÿ,ÿÿÿ ÿÿÿ ÿ ÿÿ ÿÿÿ,A,ÿAAAÿ666ÿ666ÿAAAÿ,A,ÿ,ÿÿ ÿ ÿÿ ÿ ÿ ÿÿÿÿÿ###?^^^^^^]]]]]]\\\YYYWWWTTTŒ‡‡ÿojjÿ_j_ÿe[eÿFFFÿC>>ÿ>99ÿ444ÿ###ÿÿÿÿÿ  íõìììì¼  ?###?•••¿ËËËÿËËËÿÊÊÊÿÊÊÊÿÈÈÈÿÆÆÆÿÃÃÃÿÁÁÁÿ¼¼¼ÿ¹¹¹ÿ³³³ÿ¯¯¯ÿ¥¥¥ÿžžžÿ™™™ÿ”””ÿŒŒŒÿ†††ÿ‚‚‚ÿÿzzzÿwwwÿejeÿdidÿrrrÿrrrÿrrrÿy~yÿ õ$$$ÿ6A6ÿ6A6ÿA,Aÿ,A,ÿ6A6ÿ666ÿ,A,ÿAAAÿ666ÿ666ÿAAAÿ,A,ÿ,A,ÿ6A6ÿ666ÿ666ÿAAAÿ666ÿ666ÿ6A6ÿ,A,ÿ666ÿ6A6ÿ6A6ÿ666ÿAAAÿ,A,ÿ666ÿÿ°°°°ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿûûûÿøøøÿôôôÿðððÿìììÿèèèÿãããÿßßßÿÚÚÚÿÖÖÖÿÒÒÒÿÍÍÍÿÉÉÉÿÆÆÆÿÃÃÃÿ¾¾¾ÿ¼¼¼ÿ¹¹¹ÿ···ÿ´´´ÿ³³³ÿ±±±ÿ±±±ÿ°°°ÿ°°°ÿ¯¯¯ÿ¯¯¯ÿ¯¯¯ÿ¯¯¯ÿ¯¯¯ÿ¯¯¯ÿ$$$°žžž°àààÿÜÜÜÿÜÜÜÿÜÜÜÿÛÛÛÿÛÛÛÿÚÚÚÿÚÚÚÿÙÙÙÿ×××ÿÖÖÖÿÕÕÕÿÒÒÒÿÑÑÑÿÏÏÏÿÌÌÌÿÈÈÈÿÆÆÆÿÂÂÂÿ¾¾¾ÿ¼¼¼ÿ¸¸¸ÿ´´´ÿ¯¯¯ÿ¬¬¬ÿ¨¨¨ÿ¤¤¤ÿ¢¢¢ÿžžžÿ›››ÿ™™™ÿ–––ÿ”””ÿ‘‘‘ÿÿÿŽŽŽÿŒŒŒÿ‹‹‹ÿ‹‹‹ÿŠŠŠÿŠŠŠÿŠŠŠÿŠŠŠÿŠŠŠÿ```ÿ ÎÏ©àÿ¨¨¨ÿÜÜÜÿÜÜÜÿÜÜÜÿÜÜÜÿÛÛÛÿÛÛÛÿÚÚÚÿÚÚÚÿÙÙÙÿ×××ÿÕÕÕÿÔÔÔÿÑÑÑÿÏÏÏÿÌÌÌÿÊÊÊÿÆÆÆÿÃÃÃÿÀÀÀÿ¼¼¼ÿ¸¸¸ÿ´´´ÿ¯¯¯ÿ¬¬¬ÿ¨¨¨ÿ¤¤¤ÿ   ÿžžžÿšššÿ˜˜˜ÿ•••ÿ“““ÿ‘‘‘ÿÿŽŽŽÿŒŒŒÿ‹‹‹ÿ‹‹‹ÿŠŠŠÿŠŠŠÿŠŠŠÿŠŠŠÿŠŠŠÿŠŠŠÿ~m†ÿ%ÿÌžáÿuBÿ²²²ÿÜÜÜÿÜÜÜÿÜÜÜÿ¥¥¥ÿKKKÿÛÛÛÿÚÚÚÿ®®®ÿÑÑÑÿÕÕÕÿÔÔÔÿÑÑÑÿ²²²ÿ»»»ÿÊÊÊÿÆÆÆÿÃÃÃÿÀÀÀÿ›››ÿ™™™ÿ´´´ÿ¯¯¯ÿ¬¬¬ÿ¨¨¨ÿ¤¤¤ÿ   ÿžžžÿšššÿ˜˜˜ÿ•••ÿ“““ÿ‘‘‘ÿÿŽŽŽÿŒŒŒÿ‹‹‹ÿ‹‹‹ÿŠŠŠÿŠŠŠÿŠŠŠÿŠŠŠÿŠŠŠÿ“€šÿ°‹¾ÿ ÿÆšÙÿc2uÿrH€ÿ²²²ÿÜÜÜÿÜÜÜÿKKKÿ^^^ÿ¤¤¤ÿÔÔÔÿÿ~~~ÿ}}}ÿ“““ÿ¨¨¨ÿÿ}}}ÿ˜˜˜ÿiiiÿxxxÿªªªÿxxxÿŽŽŽÿ´´´ÿ¯¯¯ÿ¬¬¬ÿ¨¨¨ÿ¤¤¤ÿ   ÿžžžÿšššÿ˜˜˜ÿ•••ÿ“““ÿÿÿŽŽŽÿŒŒŒÿ‹‹‹ÿ‹‹‹ÿŠŠŠÿŠŠŠÿŠŠŠÿŠŠŠÿ“€šÿ°‹¾ÿxEŠÿ#e'ÿÉÜÿi4|ÿc2uÿrH€ÿ²²²ÿÜÜÜÿÜÜÜÿ¤¤¤ÿÛÛÛÿÚÚÚÿÀÀÀÿÑÑÑÿÕÕÕÿÔÔÔÿÑÑÑÿÏÏÏÿÌÌÌÿÊÊÊÿÆÆÆÿÃÃÃÿÀÀÀÿ¼¼¼ÿ¸¸¸ÿ´´´ÿ¯¯¯ÿ¬¬¬ÿ¨¨¨ÿ¤¤¤ÿ   ÿžžžÿšššÿ˜˜˜ÿ•••ÿ“““ÿÿÿŽŽŽÿŒŒŒÿ‹‹‹ÿ‹‹‹ÿŠŠŠÿŠŠŠÿŠŠŠÿ“€šÿ°‹¾ÿxEŠÿo8‚ÿ ÿÉÜÿi4|ÿc2uÿo8‚ÿrH€ÿ²²²ÿÜÜÜÿÛÛÛÿÛÛÛÿÚÚÚÿÙÙÙÿ×××ÿÕÕÕÿÔÔÔÿÑÑÑÿÏÏÏÿÌÌÌÿÊÊÊÿÆÆÆÿÃÃÃÿÀÀÀÿ¼¼¼ÿ¸¸¸ÿ´´´ÿ¯¯¯ÿ¬¬¬ÿ¨¨¨ÿ¤¤¤ÿ   ÿžžžÿšššÿ˜˜˜ÿ•••ÿ“““ÿ‘‘‘ÿÿŽŽŽÿŒŒŒÿ‹‹‹ÿ‹‹‹ÿŠŠŠÿŠŠŠÿ“€šÿ°‹¾ÿxEŠÿo8‚ÿo8‚ÿÿÆšÙÿc2uÿW,hÿc2uÿc2uÿrH€ÿ²²²ÿÛÛÛÿÚÚÚÿÙÙÙÿÙÙÙÿÖÖÖÿÕÕÕÿÔÔÔÿÑÑÑÿÏÏÏÿÌÌÌÿÊÊÊÿÆÆÆÿÂÂÂÿÀÀÀÿ¼¼¼ÿ¸¸¸ÿ´´´ÿ¯¯¯ÿ¬¬¬ÿ¨¨¨ÿ¤¤¤ÿ   ÿžžžÿšššÿ˜˜˜ÿ•••ÿ“““ÿ‘‘‘ÿÿŽŽŽÿŒŒŒÿŒŒŒÿ‹‹‹ÿ‹‹‹ÿ“€šÿ°‹¾ÿxEŠÿo8‚ÿo8‚ÿo8‚ÿ ÿÉÜÿi4|ÿc2uÿi4|ÿi4|ÿc2uÿrH€ÿ²²²ÿÚÚÚÿÙÙÙÿ×××ÿÖÖÖÿÕÕÕÿÒÒÒÿÑÑÑÿÏÏÏÿÌÌÌÿÈÈÈÿÆÆÆÿÂÂÂÿ¾¾¾ÿ¼¼¼ÿ¸¸¸ÿ´´´ÿ¯¯¯ÿ¬¬¬ÿ¨¨¨ÿ¤¤¤ÿ¢¢¢ÿžžžÿ›››ÿ˜˜˜ÿ•••ÿ”””ÿ‘‘‘ÿÿÿŽŽŽÿŒŒŒÿ‹‹‹ÿ“›ÿ°‹¾ÿxEŠÿo8‚ÿo8‚ÿo8‚ÿo8‚ÿ ÿÉÜÿi4|ÿc2uÿi4|ÿi4|ÿc2uÿo8‚ÿd;sÿ---ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ°‹¾ÿ‰\™ÿo8‚ÿo8‚ÿo8‚ÿo8‚ÿo8‚ÿ  ÿpirÚÚÚÜßäçòÙ¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾šÚÛÝáæêìû 00$ª$$²$º(R ü€' ü€'gnustep-gui-0.24.0/Images/common_Unknown.tiff0000664000076500007650000000460206711564111021034 0ustar brains99brains99MM*¼€ P8$ „BaP¸d6ˆDbQ8qV,ÿ‹cr©5Çã‘é –A‘JdÒIÕHcÞ_ê«ãþòÇ£¸ðW»íñUOÃa0ø'7“2O÷UþüÌ?ßy·û<ÿTht'ö–‰Gjq[î2—‰Äë¨×ÌuŠÅéXš6ò‹²¢ï¯® ÚUàOðç5þ†è?Ô7ûϬÿmv_ì>ãýûßÊe¸T{ûÿ‹Šòq0{ÛîÏ—fºZcºÿoëLñû0û»èçüåä†)þpAùÏŸäüžÐ‹4Î0«èý©/òûC #hÛ7jîÓ¾ïB ¨+ÎÄ´%D÷¹`¼eÀ1.—1ÉþVLJùן礄”Ò)þÒŸÏKıS×(ðúÎù#JSÊļª3\ÄŽRêü½?Œ;ÊœGùõ3ŸäŒÔ‹iþBNl"”Çø;ÀALô™3ë°í1äÙþ6ЇùOCÈí3ôô<ô[c'Ãуk)®ÍÒÞ±ÉùóMŸçm=?›Gù…QŸå]L“•IþKÕ‡øÑWÀC=e>OÆÝlUÉþz×™÷DÉ4¼£ID’¹a,TÌÎ}煜γóé’–¶­ D6ÉþQ[‡øMoÀP©R™·)þnÝùÙuŸç½Üï<B‹)>4¬ª¤Êëì²ß°m„K0ÑŒ0~åþ ÖC9þlá‡ù•‡Ÿæ$”¸©þ=cø£ÀB¦<Y þ:d‡ùÓŸç~UMS—ÆËWëYØp àÛʼIšI™¢'f…2oh–Ý»\O Êni‡ù!§Ÿæ¦¤–ú¬håÓšºéþslù}±ÀðM˜è.5ÿyØ”£s{©Ö׸îq43»çí®SÝ·{¬yŸç“Ü-q]Lš¸ýÅŸüXýZZu±·ÂpÇÇ-`nÏÆëzg­»æ‘Fv¥è•—o,»2Í×ó¦ú{ëšó’=©þ^÷ù¡ÝŸå—}…á¸3)\äB†Dyúõ,Lã.K×Þé15´„¾ÀK£–^À°qiþ-ü¸UñŸâwÌŽßIþb}‡þ˜nNDü‰#<òÚûìúù¬bÞ×—üWœH€M\@V÷Ñȹj-Mޱþå‡ÁnxÌåÿÁRš1 Àÿ€@u«•fHBª°Œ‹L¹2 î¾ 6Õên\ûÓæ¤G·¨bÞ²Žz­¥ü†X|z! ÿ?Àæ©!þ¢@ÿ Q,…œ?ĬQâ²*ñiÇø˜‹CüREÒ–ý¡¹K‚oô¥FHz¡áãt­çðãâ+6ˆÇ%B×ãÌyM)®* Ũµ¡T\‹Ñ•ë:(ÆÛá³ÄtšE”¨ÞcŒ‘ÒLˆÉ,?Ä™áZNñ)'Ýë¿Rô–*)Jœ†…ÎvD"vëÒƒÊIrº‡ m$Nh2&Mô‡f¬ÃÜÁbìd-LS¤u0¿}Í5gT¥TrRp½6þþ‡òM²0ÿ S#aþ+çDPŠA‚vPñ;Çûµ#ü+ÏQþçÃè}C>~ñ™?Çø£ Qº8=#ÌÌŒ;ø Òj·,XTË®*Â>ŠñqEáœ9çD>ÑØîãÄE!âf’ñaI܃e 5g¬·0[hcÈšÔ=dšj$rä°ŒâÔ¨+%Ä]A“Ò‚SÑj1?Æ`ÿhƒxŽêÜ»©XTÄ…¼’оL=ŒÎŠnÐxy8'ä*Ôæ£ ˆö$Ur° •®P‹'Öûb Že,­w;…6ªó:Qðòªª¬Ú %g±žYÆ”JâCu‰@Q±‹æFÉg@¯~iÕ?*–?Æ™h‰–•àÞ¥…€IUæ6)¤ÿ%l–%6l·SÇDR2ël¿š:X‹Öîu Z›Së©£EÊfÒÈËDÀu§mÓVÜg‡rÄh¹ÖÁ:²¡ßJ¬Åš:Û±œvÎëUð²»Êû¥qm ï¤&¿¿—˜`Aè¡O6W»G-ƒ…›»¶ñt Ûr0ø’ÀCüM`SªuÝcXBÓb×3;I"ïµÉw.™PêhXL¥“8táÖ¾ØpèéÃuBÕ,.Y%[Ǫª[ÓT“‚PˆöãËb ²D«|݇Ç5Ù.ÝÜ©»<ÉÇFE7žÕ”KñqLµY£1\ëŠrtA˘¡jýÝñ±£é%Æé™42ë¡ ²ÔbÐ1“Aç­ Uóå¢S ãRfÍ1©8°=»ãœd÷’¶¡ÓÙ•¶\¬ÁŠînf½ïqç¿w£}öS*°Kð±Ú¸5ÙCü@ìÑþ6…’ƒ<_«ñ§«Æ\×´'_ß k—åe Ç¥MÔܼ?ÄVéô„D`Ö‡ø‰ÞSP_õκ\ñWÛ 3|U_±fü)»•wê×v4ø³áQf-î‘Óš…E;ƒ h üg^F–£qq¢œ¦sµ¿ÃýÉ^(múuÔ^³p|à®Õî&ߘüƒäòÍ€¬àGm¬ 4°ànËÐÈ–\g€AZ ”rÒ Vz  N8æši¦ÁLÖ™d@²L8¾ùá7 ÊAt0 ‚ŠXã¨U©â9~y,á½t‡xäƸà‘@xæ³Ac°ÅüsÈ©¹&W‡ ŽÔáÜΦf˜€Ù`ŽzÀkÜ •f3˜dŠr¸± {œIP°Ò þn©¥€ú¤ï~Á‡ i§>è§^¸ãp€tv ôÄø™¾ýæÌEþ™æ’'9äe<£I&*úˆYËáŸK®8SN-˜Ád‘Æ@Pžy±šK.9€\òˆv<ÈŠ{öýð+þåíuÅ$l5ËàBè`at1]®†e†™b6› €Õ{[@‹à–fY>Gf†Kùg3]·¨ñÇ[‚€B(ôbnñ™gå“/>P“'N6ÇavPuÕ›šñãV€ˆ‘0×í!;@bÖ$ˆÛ!¤€¼ö°‹#üK 9>p@ã÷°½ñed|»•0Þ°Š=ô0‰a·†Å0«|È}€ÿ0…1Ü€[Üñ÷|npË áÈ?8ÙiðÓ€Ð\œ ÈÀà?`V!ˆ>•©÷ºÛ½ “=Q‡Z4᳘¡/^qŒµPÛÀ8#ícB‡Î*ÊÃ~ð#Ñ Ç˸‘ Fq§ðÑŠñ<Æ4¦°„ ¨<à€ÈLœ¸†Ýþ€ýøè ‚vÂÈ„Lyî×o,#†ø ™ÈV=.q‚ã—¡@íä– :!z˨òÒ ¼ø‘@vÇ/1'ôc x£ÅØ S˜Àxƾ€ôcÜ‚hCep° ‚ @~ RMHA{9o Ç?PA€\` ¨ %za:îºÐ®±‰©xؘ€`dÂ`MA‡NoÊ»••ÿÌÔêøw'pŽWub×xF Îð†oãF””*P@ÜIèD':€-laxÇ¡BA$–Æï $RÀKByy#¸ 3€ì` Þ$`Fá@#šPàâgü8<Çue{Íë Å¿ÞôQ¼,ê=AATff«¨Å|k€8Q?þ1W*âï¥' V±‚]ücÛ:à Ö0 t£‰žØÃ…ï@ p BHø7lq“º,bЃÁ)¨G×~G&2…bý´íâ‰w½ @1¿=‚DàÔMVv;VϘZ™ÀöRgÃJ«„”àЂ,ð/yÿ` ý˜@yKMˆ¯E€–a¹®w-D w/x¡K Ä  ºÑ!ÉŠÿøÂ*zX»Z¬3Ê,NÜ¢ìN×§CìTê£L½u¬“õhE½ „ VëxÄ{h‰0p€˜‘A 1èÃà‡&¬T¾‡€øÀ¹Üð Ž‚ˆ,)v%$‰ÐeÖÊ%Vç†Ð©º s¸Ã¶ŠÕ­Ññ*)ÇÆÀ±=â*S¡`娩 À@V>á€~kÀ èÛ}¹¬!fðUŒ Q»ñ,#cT\Âet“Ò»U§:ø)ÕwŠÅ¯_Ph…*L~ØšªDÃG3 ‚Àüᘮ˜uÕ TßÐs@*P¬;Üa €tCF ²ø‰Ab ZHǧ>”EL}Q]Èüë-±Î»DUœ"úq‚à _#Í.Q¡=˜"s˜S&0¦PŒ¢ e¤lí:È€(À Zea’C]âz¦¨÷E§¾ëßû: *1--¾\ŸG €pâxUz7I†)L`«ŠP"üá kø@ñ€0ÇíNõqO|_¯KXÒAºÐEkîg‰Ã]ôú—\ùu6àlÃÀ?ܱ_kL’@ØÉ–"Ã…@¼Kä°$@ ~€ à€3¨€ ÌŽ&& ÕØXüãD \oκaÝìŒÃ^²†¨L«u>ß{«Ös€»Þeãç¶ñ€wÖ°ø¼$£á&à⋉>Óµ¯ 8üã ï9d n¾3l´ûÜèp3¿Ágï{£]L+Î~Û;“‰c¦@!c™Ó Î`þQÂ;(<Àp7|â?0©¿Ýþž9¤½|ä6]œÂ nýÌœëNÓÒd•¥ ´á@ —Àÿ–i ;ÐXc!•×  8 ¯\JCL>¶ç³¥ž@źýˆ#a}nboC{á•ívvVb7VاðlK LøƒM÷³?1½D%÷4Vµ÷f5nv+Ï¢eîp w[ÿñlw¶)õ³*VõQ4„ØÇgvlc  øƒ]CÀhµ,€Qd™ ‰ðn\nÑi%1ÅÀFîô,ÏÒ@/6i€0©?øw2ø Ó`\‚ ÷ƒ@Êt)´] 4øƒCx¢N„f@Xä0ÐòöI§å6ñrõ  U²0·ñYd ½Æx0„[øp U€& Øg\ÄZx…€0Â&P@uŒ@s:`4€@í§7H¯ð{û°/ûtB‹ó_qW/ò a5-·ø"‘ˆˆ(®äeø>¤e8€'\‚ørÆxŒîxK†8F ¸±ØgH6S:ø)v…ºe æÂâÂ4ŽENäFKà,€‡?í—,â8—*ÞÀo°Þ¨ôvn¶ %¤äµ`Šˆ¤X½!½#‰8p¼4q<»I«äL;ýG ÔF t€¬ä*JQJïÓkÁ€ d@ €>@€Yú®w3XHF[B*€ð÷Bÿ%_Š'ó]dóŠë³˜ z_áŠcý<þJ€Ûª·ŒË…&‡€çð<?ÕÏäC¹®Àz[:ðrˆX}— àÁ~žÜ,¦mŸ2=h¢ €ƒˆ4Ÿàˆ¦ òU—oû*À¸`þD( <&0=€&$Öˆ1þ €ñþ*€0â˜_á€eˆ'äGD¨IþÃø$¢³)¬žÌ̉Ÿáiü<B  Gñ8q¶ žJ–ŸáÈ6€ø ( °¸ ¾™1'ðÀLÀØz´«Èg€-b9ª§øšE‚(µGñ@`Š·5¶à(%€ žðV€€c ´»þt`¸ˆ¹ŸâÐMÇñrà —2ñºx xt V"i€ñbä“__!Gø*ЊJaælŒ ±ZÚ æ ‰¸ìÆýb™ dx‚@ p~gp@$FÍܘŸê`u fhö4h t.h|„(=RSb.tiff$ $ gnustep-gui-0.24.0/Images/common_ToolbarSeparatorItem.tiff0000664000076500007650000002253610020266424023477 0ustar brains99brains99II*$ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþ00æ$ Qî$@%@$N%V%(R/home/heron/Development/gnustep/core/gui/Images/common_ToolbarSeperatorItem.tiffCopyright FSFHHgnustep-gui-0.24.0/Images/common_TabDownUnSelectedToSelectedJunction.tiff0000664000076500007650000000131012224735723026373 0ustar brains99brains99II*d€?àOð oº[@s §ˆDbQ82±T¬‚ $1 G/øL.ŠJb‘hÄL£’,’ ‡J§PYdìF(ŽHdjÕZ´;•OgQ¨äÒFêoº€,6c‘¥Uçôþ‰F«Ä+4‰|Æg5P+”kôaXçn×èf.š_õ •R­a¹N˜Œe“ü"€ذ~WÀÊŠ…b£ü½—(s@ ,âQI‹ÎØ‹F#ý ¢Hú¼V,RØW¨¸ùNF"O§`e¾ôO¢ÀóÒ÷Q©Õez›U®ÕúOýX¼Ñìm1ªÕh`RÙX+È–J»l²À U»µàp¸œlìžÅ䂺í—úÕb4ë»)Ó¸î»ï ´¹F3Jh—åüh½ê¼ï6,éÒo*ñ\J ãPèA“K‚®ø¸n+wE‰Úþ ^ Lf²@[NV(=RHH/home/ericwa/guitest/Images/common_TabDownUnSelectedToSelectedJunction.tiffCreated with The GIMPgnustep-gui-0.24.0/Images/.cvsignore0000664000076500007650000000002110377004044017137 0ustar brains99brains99.xvpics Makefile gnustep-gui-0.24.0/Images/common_Right.tiff0000664000076500007650000000124206671771360020462 0ustar brains99brains99II*èÿUUUÿÿªªªÿUUUÿUUUÿÿªªªÿªªªÿªªªÿUUUÿUUUÿÿªªªÿªªªÿªªªÿªªªÿªªªÿÿÿÿÿÿªªªÿªªªÿªªªÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿÿ   Šà’š(R€ü '€ü 'gnustep-gui-0.24.0/Images/common_RightH.tiff0000664000076500007650000000124206360217724020564 0ustar brains99brains99II*èÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿPPPÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿPPPÿPPPÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿPPYÿPPPÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ   Šà’š(R€ü '€ü 'gnustep-gui-0.24.0/Images/common_ArrowLeftH.tiff0000664000076500007650000000157611576466755021445 0ustar brains99brains99MM*2€ P8$ªÁ Ð…\* ‡@â;þ‡D㸴nDŸð   $ ):B(=RSfa.tiffCreated with The GIMPHH€ P8$ „BaP²¨T'aq8¤V' @ ÀR-EÀ HeR¸T(€`„²m — Ì¢o?Š@ F Ð)P˜Á@—©u8-6ŸQªV@ ô¢ëUJá Ÿìu;,F‘k¥ÛbT›…¸?&€[­ÄpP€×ÚQVÿha.à ÈkŠŸ•D@À‹›•D{6b훨gsמW/£¸ã/XýFÄën×üe6»ão›yeÊß¼•ﮜ ¶Ñjâqhuë‹“8‡Sª.|~­Óêõ¨tZ?³—Î粞ý_1™Í|²)$š}ë†C£QÈ÷ˆ'` $$ PXJ$nv(=RSb.tiffCreated with The GIMP$ $ gnustep-gui-0.24.0/Images/GNUstep.tiff0000664000076500007650000001202011560331667017351 0ustar brains99brains99MM*.€ P8$ „BaP¸(ê<Œ bxn o¨¾å¶`mƆJeR¹d¶]/àEÈJ˜NaN˜º¤“ΨT:$¤•9@ÈtZdé{G@ÖÔÚ¥V%¡àe:µvš­ž`mºõ–e¥#6ke696@ÓvÛ*Fnº^n‰(¾õBS@Ë7ü%éO-aa˜¿áàXœ…ÚxÈfq÷Èúéh&³Z8[ÿM^3j@ ½ev±jZô›86™ÿ^}n@Íà·¿¦«+{N$mmVò@NeZñz\m=è—×-»Så+§ßñïKß ‰ç–L€ _·ÃÕÂŽþ@7Ö–š}Þï.ÿ€T† »öö¿¬!ӀĄ=OdýÁ,{ä¾²; dL' > €ï€TL‚1€¼«SƵ †jEDBÇ™ÑèÈ$ 'Ë¿0°Zy!òÙHΔÂ7(à+ ¼£KM˜/ÉÒ„¶ÚJküªJà<…K““I‘¬nþGsrÛ™Ñü‚Å1\:ÎË4`ÃÆl¢ PôÛ@¯1ïÄéŠ E´®ÂðÊPƒÈ`ŠâÌ´º‰%A°zü OÔ¥KTJ#þKÀ0ºu ZS/­6•;¨–ÙÖÕºXò)ï8ˆ˜9à£`U–Zë‰n˶¡8H¸ÌØ6rä¬`¨¦µàb#L-³m#mÓx7άРÍfÝ+R35mjòË ÂésØD– ø+5>­˜AÆQ¢™.§%6% 3õê²á”*»ˆ(dŽ=~×ö.¢àKæ Ï,¸â˜2å€)—€6e‘¡“8Ù›ß+šó•*¡.|ú)虢nΕv¬—3%jå©€­@Ø€­ÚJ€Ú[.l€¥³ÓÀ½>ÈT…vÜ›4þCû oa½€>ü|ð™Žg3üHrñ€³Ç€‡$œ®ç7gš74ƒ 00 % <F0%‚Š(=RS’Š/home/deek/public_html/GNUstep2.tiffLogo (C) Free Software Foundation, Inc. Made with The GIMP.HH€ P8$ „BaP¸d6ˆDbQ8¤V-ŒFcQ¸äv=HdR9$–M'”JeR¹d¶]@Áð0¬ 3@ð0Ôâ…&P0Tc@ßP7´ ãv@ÝP7$ ÍqÕ nx®|KìV;%–Íg´ZmV»d$<Šàcx:¶Ù˜Ð6 “jÕ o{Î ‡ÄbqX¼dL?Œ dˆrÆæaŽè’¸³ªP7þkM§ÔjuZ¹lÎ3• f}fÖD™ª lÚþÛ}¿àpxR°Ä “9@Åœ>d©©G@Öð7G7­×ìvq4(6v¼VjÌÿYÔ<~¿g·ÝÀǰ?<}ïüa˜]ø}¿0 ­`º1 d4 µÒO gL ª" d*ÂÐëXUÃ(­D‘+Ä d¢ÄÑk‚e cbeEѬlÃÅ:åFñë®ç CgH’*A DÚï#IZö ±›)Ê€ h»*ËÉFްŒ»1ÀŠ5 d„É5ƒ‚K?ódäᇊ€Sœõ )(v™ÝŨ²6”7Ât]$—.ÈIÓ(‚¾S4ê4£€J7SÕ,ŠI cºÁSUˆ0P™ê5[YÈ«  fÅiL líw_ÌŒ²RØè ÕE‹eÍ”hR J]™ÊàŽ„6µ9›ès1[pX^š ÍL†£s½Ž:[]—<%:W“†0Á÷µõSA?}µ4xE`-Z;PØ3B pv‡ÖpR=â 9Žx®5_‘¨é¥XºŒä-Ž XþLaˆ•æ.$b™Š'`™¶uiáÆv„ß!Ÿè–Ýú_ùÝÜ^.v^ˆ§\h˧ëÕÒ]x-ªêë; â P•Ïc UÒlì[j0îQ¿¹€Fì[ÍÂL6{vüŒî -&Lð€ÑÃÙ•êÏoün߸ÓÂç$¼­[W F¿Íð…Xô±ÑÒußYsJ)ÀÖgÇ\=ˆ×VÓÙ#Qõ]Ê+ÖWä—| þ çJ€¿uãõ|õŠ ù€çÊ´*yy¯wåZ`w´~왾Y^·Äˆw–ßÜpãD}: V¿Ç÷üžÅÂþ€‘ûij7g<~êùW8þ€@@P>àB é¥ÿ@×þü—`p‚@HÁT×àtî ±ƒŠ:aIj BR£…@/BÓÞ’„ÐÌ„B† áÀÐìõ§r^!¤A Ùƒ hŒÜI;(äø…âbÞ*•ÎhÓG‘B.DF 5#±ŒàÄÈ#@‹Ìn*H® ¬p²4ÆˆÖÆ†\yÚ>¨a £¬uŽì–(vˆÌѺ Hr@È(¤ÊÅ\‘ZJÈ1#dăfzÂPL˜“2=›©L<©//éiJ)E&™Ð–P–„@Å쮕ÒÁ›9|ôÁ-CŸyu(àãaS,ùœYŽà+Ó]KÆ~fÀ“l±4Ðæ¤¯”<1NV'ÚI.G†pÎ)’Û‡ñzzÆÈ äí˜óY§™üE%zpO©Üê§*¤’Å¢rè4»œm†0øÆ I!®ˆÎøÖ@…!Æ’ n@¥ÍŸtM·Kà‡0&|DÒª%;ÝKçpÎ ˜ò‘M§mm  ¢FªXBä½@¥táÝIÀ1im6¥MZŽßÂUYÞ®‡n@–…U¦ïß*‡ƒȸí2õŠ«TÇr;«€uÌŠòSkdÔ¨MüWÐ=ìd nWšõUÜØ$±@nØÒ ˆ±°Õ-ÿû,•™" ´2û'2ð†´LÐ=³R€@³öþÄb÷Sù­Ö®G[7ÄmÁ TÚVØ4n³uä¤ÛÛYªuP!@PëqàmT„R.®}ƒ!îwwÈE»7AÿP™ÏC ~?—Ž@×·6ï€WÌ„S:k{#µˆuTéôh@Â]ø¶°hZàP0AŽQÓEÛôêcÊ0‘0‚屃oͶzÍÍn‚,âÇQ‘¡žHoØÏâ ×”2Ž1sx¢¹WB…›^XË8iêáÀ‡ EuW)f%÷„cÜ} ÷ü`•›sröÀ¢×à’}³fZÏ,þS zˆàÎú A¯»ày¼+çEæMƯ5 º·_@ém.Ä.àF»×€ƒÜËM³ÆŸ\7Jê\C©§uS:¹2xƒ[½a¬YŽUÆd/OV=pÌ-Å>´é.Žê~®ítH‰D>ÎYéõ±¶;´v–ÓÛ @¬–ÅÑ›EbÙ`Ÿf,Ѱd Âí­{· Š–2Çüm^(ŽÐÝ –¾”[‹HŽ!Žm½æ©²æ*«Îâ ïíþ§«+ÀxD^©ìþ ÁÔÍY^•q©‘k‹e8‚òÖuDŠì$û¿w?Vu<ìmo¹æp·ôÒpJu÷)Ztº˜ âAF¨ç(æK2 GIIι˜«û©t‰=⑻ˢ¥=3: D÷Ÿ7·‡ôÔ¹?‰½lªu"w†z²¦ž%fz黥0w!ì)“§Þ‚W4fŸiíjzlY¶TK,Ä>Ñ?¦w4K2ÏÜÎå«—siß{òæ“›™Yß:¯‰E²ÉcÀ„[efpkÄy$)t©æ#‹Àï;ç1’(HÈéýAî’(‚J#5àϰö'²Bèxjp[ý÷^ììg &m£7Âò?÷FØ­B|_ægÉzßSê›ÿÎͨµN«î}ÓU²më÷ëòþcQïd9ï„d -¹ÏÛûŒd*Kð´/ /JoÏîÿõD­MFÿ0/($MÈ*«ä(GjȦÃP- ”€¢bòÄJ}…¬m°-âÌ~…¾~åG®NiÐCB\ЧÔHǤ¨iðW‚X{@{‡¼J‡ˆxÆw°l$ǘSgž/¤å Âep"@á*ÎPgLÉæ7 p˜#Lfv "¸GjQG04d°© ¢0tRtGHU‡bà B$rC,r¥ˆYpR`Û ÂÅÂmDÂåõðð ÌÌnÅ^o)Z\Ïþ\Ñ" † j jåÏpð,£&L᥷‚âJ¶«¦~éE‹Ðí£ÞíC~±X`ag1mÀí`ql@QT8A k:”ñbh«DAM¨A‘r9¡àq•æV±œé$-£±æ/FI† Æ;&TCѨ>ÿbÿ€%%ÿ­[[ÿÒŽŽÿÞ––ÿËPPÿ¨ÿxÿQÿGñfNNª™Žmll×^^^ÿ………ÿÏÏÏÿ­­­ÿŽŽŽÿhhhÿXXXÿOOOÿ777ÿ ÿ q vvv‘‘‘)‘‘‘öhbbþU66ÿ[ÿyÿ¥NNÿÈŠŠÿÁQQÿ—ÿl ÿP ÿIÿe''ÿEEê†qq÷[YYÿVVVÿ   ÿ›››ÿÿjjjÿVVVÿKKKÿ999ÿ---ÿ---*vvvœœœœœœŸyyyïYYYÿL66ÿUÿoÿ˜77ÿœ,,ÿ~!!ÿu,,ÿp))ÿSÿJÿS ÿxXXÿZUUÿNNNÿ’’’ÿ|||ÿiiiÿ>>>ÿ(((ÿ(((ÿ333ÿHHHÿHHH*‡‡‡‡‡‡‹‹‹¿sssöWWWÿG99ÿOÿqÿeÿ{88ÿ“^^ÿ„OOÿGÿ*ÿ0ÿZKKÿYUUÿvvvÿÉÉÉÿfffÿCCCÿ,,,ÿ...ÿAAAÿXXXþnnnönnn)‡‡‡‡‡‡‡‡‡‡‡‡   UŽŽŽÌ|||ÿaaaÿIDDÿB$$ÿ7ÿp44ÿf--ÿQ/-ÿ|xsÿ‘މÿXTRÿ866ÿWVVÿ‚‚‚ÿŠŠŠÿ¥¥¥ÿ<<<ÿ444ÿOOOÿqqqÿöÌ"‡‡‡‡‡‡‡‡‡   ŽŽŽ"‰‰‰•ÿkjjÿTOOÿ;22ÿN&&ÿCÿ1ÿG:8ÿ~}zÿ˜–“ÿOOMÿkkkÿ¦¦¦ÿÿoooÿ&&&ÿ111ÿDDD•qqq*)"GP@GP@GP@‡‡‡‡‡‡‡‡‡*އ‡‡ÿrrrÿVVVÿL;;ÿ@ÿ4ÿ.ÿ332ÿedbÿƒ‚ÿ‰Šˆÿ…†„ÿ|}|ÿ___ÿ'''ÿ:::ÿIII€GP@GP@ GP@–––+”””•ŽŽŽÿxxxÿd``ÿRDDÿA..ÿ1)(ÿ""!ÿ.-,ÿSSQÿ|ÿŠŠˆÿdedÿ@@@ÿ&&&ÿEEEÿVVV€››››››ªŽŽŽ½‚‚‚êpppÿ]]]ÿPPPÿDDDÿÿÿPPNÿ€}ÿedcÿGFEÿ)))ÿMMMÿbbb€¢¢¢¡¡¡/———¡Ô„„„ÔxxxÜhhhÿ%%%ÿ///ÿ**)ÿ443ÿpomÿˆ‡„ÿCCBÿSSSÿccc‚¢¢¢ttt+tttÿDDDÿfffÿSSSÿ ÿÿihgÿ’‘ŽÿXXWÿ777€AAA+AAAÿšššÿ£££ÿeeeÿ...ÿ,,,ÿÿIHFÿˆ‡…ÿrqoê777Ž777+777ÿ»»»ÿµµµÿÿYYYÿÿ ÿÿEDBÿyxuÿ€}ãDDDª†††ª†††777+???•RRRÿ¾¾¾ÿÄÄÄÿšššÿXXXÿÿÿÿ!! ÿPONÿvtsÿjjhÿ^^^ÿ``_•hhf€XXW€EEEU™™™™™™777UBBBÿxxxÿ±±±ÿÁÁÁÿ”””ÿIIIÿÿÿÿÿÿ:99ÿtsqÿlljÿ}}{ÿ……ƒÿlmkÿTTTÆaaaG™™™™™™777UEEEÿŠŠŠÿÿÿ€€€ÿRRRÿÿ ÿÿÿÿÿ<;:ÿØÖÒÿÄÅÁÿÀÁ¾ÿœ›ÿnonÿZZZÜooo+ooo777UBBBÿyyyÿ///ÿÿ888ÿ>>>ÿÿ222ÿUUUÿaaaÿXXXÿ???ÿBB@ÿÜÚÖÿÅÆÃÿÁ¾ÿÀÁ¾ÿ‘ÿ===ÿoooÿooo*)))U888ÿÿ„„„ÿDDDÿQQQÿ]]]ÿ!!!ÿ:::ÿbbbÿhhhq]]]•HHHÿ776ÿ¤£ ÿËËÇÿÎÎËÿËËÉÿ¿¿¿ÿ›››ÿRRRÿRRR*!!!U666ÿœœœÿ‹‹‹ÿˆˆˆÿqqqÿMMMÿ777ÿGGGÿgggªqqq3lll€[[Zÿ:::ÿDDCÿuusÿ¬«©ÿÊÊÈÿÆÆÄÿœœ›ÿGGGÿfff¸ppp9>>>UDDDÿaaaÿuuuÿsssÿWWWÿ;;;ÿ;;;ÿVVVÿfffUwwwrrr@fffªSSSÿ666ÿ===ÿYYWÿzzxÿ~~|ÿ\\\ÿTTTÿhhh•ppp*eeeS[[[ú+++ÿUUUÿ888ÿ...ÿ666ÿ>>>üeeeîeee(ooo9jjj°WWWÌ>>>÷)))ÿ221ÿ==<ÿ888ögggÌggg"sssBmmmÐTTTÿ<<<ÿ222ÿ444ÿAAAÿWWWñtttªtttwwwwwwU\\\¿NNNñGGGÿLLLñ^^^¿wwwUwwwrrr+rrrÿcccÿ[[[ÿ\\\ÿfffÿrrrÔnnnªlllÿkkkªrrrrrr*ccc*[[[*\\\*fff*rrr#nnnlll*kkk™™™™™™™™™™™™þ00æ$ Xî$F%@$\%d%(R/home/heron/Development/gnustep/core/gui/Images/common_ToolbarCustomizeToolbarItem.tiffCreated with The GIMPHHgnustep-gui-0.24.0/Images/common_TabUnSelectedRight.tiff0000664000076500007650000000115412224735723023061 0ustar brains99brains99II*€&R÷1œà !P¸d6ˆDŠ¥a™dÆb I„&#DbjÁ›¡®Ù@-Y @ž\€Ž$²¤>G 31#Ûe–€j­Ø©©­7…ŒÚ­vªÿO&*CIŒÎ ¤CŒÉÔúu n-ìCê½b)±ŒEšB6©*‘ʵ–Yˆ™Š…b¢d“aØ–öKµÞÏ ´±–VÛu§UÂÞ".G3‘gq&³L5w eÉH+hZòÝ¢·Ç\²] ~••§Tª5&Ç?4ÖÍuÄÄÑÙê®’ÌÒLÙ3ç´Îh½œÏq0øXU¦×0ðns(—O¨¥µLÎÿ!6cÚÕŸþ·ÿÝ €€þ  ;V@ (=RHH/home/ericwa/guitest/Images/common_TabUnSelectedRight.tiffCreated with The GIMPgnustep-gui-0.24.0/Images/common_ArrowDownH.tiff0000664000076500007650000000202211576466755021445 0ustar brains99brains99MM*F€*Ÿê° ƒ` "«ö*À0X …¢p—ü^%ŠÂ#1¸yV;ÅÀª9)—Eñ¨|   08 =NV(=RSúa.tiffCreated with The GIMPHH€^`` „BaP¸d6= ¥`¦!ŒFbår¨é#R9$AØ ÁФðÂK/˜AÊ µŒª=LgQ‡°«B ¦pbwG‡i˜QT uФà *ßp©P«ªÕ ªµd8ª<€› ÂzU¿bRàGm˜UjHÅœão§8;qH`æ2DU¯d…PÑXÇCª!…[þ^U)¹˜iMV®˜Ç@P¶’Q Ð'z º¦ÔQõMàHá¶V!ðƒ¤ªØVܦ®Qxlsׂ©$¶¼•k|Ï5˪aCyÝwW¯Tíw6ÝïÇÅäÛJºÝ‰§ãBʶ@Y+l¾º*ˆ~’ˆ%Y)¬©°ÈÉ´ ¡ŽŒ‡%Y‘ ¬Æ¼(‡›XS!â¬3 ¡Ðì?E&P¡fYVF¸ªz•f„r¾—@Šƒ—eX!£"¨D¨8FU·’dšõn´¬Ä„1Vp0h$$ äì^$› (=RSb.tiffCreated with The GIMP$ $ gnustep-gui-0.24.0/Images/NSComboArrow.tiff0000664000076500007650000000046206766011534020346 0ustar brains99brains99II*xÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ p"*(R€ü '€ü 'gnustep-gui-0.24.0/Images/common_ret.tiff0000664000076500007650000000123611557362504020175 0ustar brains99brains99II*4ÿÿÿÿUÿÿÿÿÿÿÿUÿUÿÿÿÿÿUÿUÿÿÿÿÿÿÿÿÿUÿÿÿÿUÿÿÿÿªÿÿÿÿªÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿªÿÿÿÿÿÿ   *:,PX()1>`Rcommon_ret.tiffCreated with The GIMPHHImageMagick 6.6.2-6 2010-09-17 Q16 http://www.imagemagick.orggnustep-gui-0.24.0/Images/nsmapping.strings0000664000076500007650000000375612173247260020575 0ustar brains99brains99/* This file maps the old OPENSTEP and GNUstep names of the images to the standard theme image names (declared as constants in GSTheme.h) or icon names (declared as constants in their related header). For now, the GNUstep names also represent the actual file names in the Images directory. As a result, this mapping is also used to access the image files at loading time. In the long run, the images could just be renamed to the standard theme image names (without breaking compatibility with existing applications and themes, since NSImage checks this mapping in +imageNamed:). The format is the "strings" format and content is trivial. */ /* We do not remap the application icon to GNUstep */ /* GNUstep = NSApplicationIcon; */ common_SwitchOff = GSSwitch; NSSwitch = GSSwitch; common_SwitchOn = GSSwitchSelected; NSHighlightedSwitch = GSSwitchSelected; common_RadioOff = GSRadio; NSRadioButton = GSRadio; common_RadioOn = GSRadioSelected; NSHighlightedRadioButton = GSRadioSelected; GNUstepMenuImage = GSApplicationMenuIcon; AppleMenuImage = GSApplicationMenuIcon; common_3DArrowRight = GSMenuArrow; NSMenuArrow = GSMenuArrow; common_2DCheckMark = GSMenuSelected; NSMenuCheckmark = GSMenuSelected; common_2DDash = GSMenuMixed; NSMenuMixedState = GSMenuMixed; common_ComboBoxEllipsis = GSComboArrow; NSComboArrow = GSComboArrow; common_ClosedHandCursor = GSClosedHandCursor; common_OpenHandCursor = GSOpenHandCursor; common_copyCursor = GSDragCopyCursor; common_linkCursor = GSDragLinkCursor; common_noCursor = GSOperationNotAllowedCursor; /* Toolbar images */ common_ToolbarCustomizeToolbarItem = NSToolbarCustomizeToolbarItemImage; common_Printer = NSToolbarPrint; common_ToolbarShowColorsItem = NSToolbarShowColors; common_ToolbarShowFontsItem = NSToolbarShowFonts; /* Misc. */ common_ToolbarShowColorsItem = NSColorPanel; common_Root_PC = NSComputer; GSStop = NSStopProgressTemplate; common_ToolbarShowFontsItem = NSFontPanel; common_Folder = NSFolder; common_Info = NSInfo; gnustep-gui-0.24.0/Images/common_Miniaturize.tiff0000664000076500007650000000164011571210127021667 0ustar brains99brains99II*Hÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþ  & L.z@@˜(R/home/multix/gnustep-cvs/devmodules/core/gui/Images/common_Miniaturize.tiffCreated with The GIMPHHgnustep-gui-0.24.0/Images/common_noCursor.tiff0000664000076500007650000000137607410527366021224 0ustar brains99brains99II*têÿþÿþÿþÿþÿþÿíòÿþèÿþÿþÿõöÿþàÿþÿþÿùúÿþôÿþÿþÿþÿþôÿþÿþÿýúøÿþÿþÿòðÿþÿýþôÿþÿòèÿþÿþøÿþÿòôÿþÿþøÿþÿþøÿþÿöôÿþÿúøÿþÿþøÿþÿúôÿþÿöøÿþÿþøÿþÿþôÿþÿòøÿþÿþèÿþÿòôÿþÿúðÿþÿòÿþøÿþÿýúÿþôÿþÿþÿþÿþôÿþÿþÿýöÿþàÿþÿþÿùòÿþèÿþÿþÿõêÿþÿþÿþÿþÿþÿíþR€ IZI¤@lîö(R/home/deek/Source/GNUstep/Libraries/core/gui/Images/common_noCursor.tiffCopyright (C) 2001 Jeff Teunissen Created with the GIMP.HHgnustep-gui-0.24.0/Images/common_ProgressSpinning_2.tiff0000664000076500007650000001047611271671115023136 0ustar brains99brains99II*ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿ‹‹‹ÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿ‹‹‹ÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþ  Ú Lâ@.6(R/home/fred/GNUstep/Patches/GS_NSProgresIndie/common_ProgressSpinning_2.tiffHHgnustep-gui-0.24.0/Images/common_Root_PC.tiff0000664000076500007650000002230206711564111020677 0ustar brains99brains99MM*$ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýýýÿêêêÿÜÜÜÿÒÒÒÿÊÊÊÿ¼¼¼ÿ­­­ÿ¥¥¥ÿžžžÿ“““ÿ‰‰‰ÿ„„„ÿÿwwwÿrrrÿoooÿkkkÿjjjÿiiiÿiiiÿ333ÿ222þþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþþþþþüüüþøøøþôôôþïïïþêêêþèèèþåååþâââþßßßþÝÝÝþÛÛÛþÚÚÚþÙÙÙþÙÙÙþÙÙÙþÙÙÙþÙÙÙþÙÙÙþMMMÿ111ÿÿÿÿþþþþþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþþþþþüüüþøøøþôôôþïïïþêêêþèèèþåååþâââþßßßþÝÝÝþÛÛÛþÚÚÚþÙÙÙþÙÙÙþÙÙÙþÙÙÙþÙÙÙþÙÙÙþMMMÿ111ÿÿÿÿÄÄÄþÄÄÄþÂÂÂþ¼¼¼þ¶¶¶þ®®®ÿ¤¤¤þœœœþ———þ“““þ”””ÿþþŽŽŽþþŠŠŠÿ†††ÿþþ~~~þ}}}þ|||þ}}}ÿxxxþvvvþtttþtttþ|||þ………þ‘‘‘ÿžžžþ§§§þ°°°þ²²²þMMMÿ111ÿÿÿÿ•ª•ÿŸŸŸÿŸŸŸÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€Š€ÿÿÿÿÿÿÿÿÿÿÿÿÿMMMÿ111ÿÿÿÿŸŸŸÿŸŸŸÿŸŸŸÿ$ÿ//Hÿ//Jÿ11Jÿ22Lÿ33Mÿ44Qÿ77Rÿ88Vÿ;;Yÿ<<[ÿ==\ÿ>>_ÿ@@`ÿ@@`ÿ@@`ÿ>>_ÿ==^ÿ==[ÿ<>_ÿ@@aÿAAcÿAAcÿAAcÿ@@aÿ>>_ÿ>>^ÿ==[ÿ99Yÿ77Uÿ66Rÿ44Pÿ22Lÿ11Jÿ//Hÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿLLLÿ...ÿÿÿÿŸŸŸÿŸŸŸÿŸŸŸÿ$ÿ//Jÿ11Jÿ11Kÿ33Mÿ44Pÿ77Rÿ88Uÿ;;Yÿ<<[ÿ>>_ÿ@@aÿBBdÿBBeÿCCeÿBBeÿBBdÿAAaÿ@@`ÿ>>^ÿ;;Zÿ88Vÿ77Tÿ66Qÿ22Mÿ11Kÿ11Jÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿLLLÿ...ÿÿÿÿŸŸŸÿŸŸŸÿŸŸŸÿ%ÿ11Lÿ22Lÿ33Mÿ44Pÿ77Rÿ88Vÿ;;Yÿ==^ÿ@@`ÿBBdÿCCfÿFFiÿGGjÿGGkÿGGjÿFFjÿEEhÿCCeÿAAcÿ>>_ÿ<>^ÿ<<[ÿ99Yÿ77Tÿ66Qÿ44PÿŠ€ŠÿÿÿÿÿÿÿÿÿÿÿÿÿJJJÿ***ÿÿÿÿ•ª•ÿŸŸŸÿŸŸŸÿ(ÿ33Oÿ66Qÿ66Rÿ77Uÿ99Wÿ<<[ÿ>>^ÿAAcÿCCeÿFFjÿHHmÿKKrÿLLsÿLLsÿLLsÿLLrÿJJoÿHHmÿFFjÿCCeÿ@@`ÿ==^ÿ<<[ÿ88Uÿ77Rÿ66Qÿ€Š€ÿÿÿÿÿÿÿÿÿÿÿÿÿJJJÿ)))|||ÿÿÿÿª•ªÿŸŸŸÿŸŸŸÿ(ÿ44Qÿ66Rÿ77Tÿ99Wÿ;;Zÿ==^ÿ@@`ÿCCeÿEEhÿHHnÿKKpÿMMuÿOOwÿPPxÿPPxÿOOwÿLLtÿKKrÿHHnÿFFiÿBBdÿ@@`ÿ==^ÿ;;Wÿ88Uÿ77TÿŠ€ŠÿÿÿÿÿÿÿÿÿÿÿÿÿHHHÿ'''vvvÿÿÿÿŸŸŸÿŸŸŸÿŸŸŸÿ)ÿ66Rÿ77Tÿ88Uÿ;;Yÿ<<[ÿ>>_ÿAAaÿCCfÿFFjÿJJoÿLLsÿPPxÿQQyÿQQzÿQQzÿQQyÿOOwÿLLsÿJJpÿGGkÿCCeÿAAcÿ>>_ÿ;;Zÿ88Vÿ88Uÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿGGGÿ$$$mmmÿÿÿÿª•ªÿŸŸŸÿŸŸŸÿ*ÿ77Tÿ88Vÿ99Wÿ;;Zÿ==\ÿ@@aÿBBdÿFFiÿHHmÿLLrÿOOuÿRRzÿTT}ÿTT~ÿTT~ÿTT}ÿQQyÿOOwÿLLsÿHHnÿEEhÿBBdÿ@@aÿ<<[ÿ;;Yÿ99VÿŠ€ŠÿÿÿÿÿÿÿÿÿÿÿÿÿFFFÿ"""gggþþþÿ•ª•ÿŸŸŸÿŸŸŸÿ*ÿ77Tÿ88Vÿ99Wÿ<<[ÿ==^ÿAAaÿBBeÿFFiÿHHmÿLLsÿOOwÿRR|ÿTT~ÿUUÿUUÿTT~ÿQQzÿPPwÿMMsÿJJnÿFFhÿCCeÿAAaÿ==\ÿ;;Yÿ99Wÿ€Š€ÿÿÿÿÿÿÿÿÿÿÿÿÿEEEÿ ]]]ôôôÿŸŸŸÿŸŸŸÿŸŸŸÿ*ÿ77Tÿ88Vÿ99Wÿ<<[ÿ==^ÿAAaÿBBeÿFFiÿHHmÿLLsÿOOwÿRR|ÿTT~ÿUUÿUUÿTT~ÿQQzÿPPwÿMMtÿJJnÿFFiÿCCeÿAAaÿ==\ÿ;;Yÿ99Wÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿCCCÿXXXïïïÿ•ª•ÿŸŸŸÿŸŸŸÿ*ÿ77Tÿ88Vÿ99Wÿ;;Zÿ==\ÿ@@aÿBBdÿFFiÿHHmÿLLrÿOOuÿRRzÿTT~ÿTT~ÿTT~ÿTT}ÿQQyÿOOwÿLLsÿHHnÿEEhÿBBdÿ@@aÿ<<[ÿ;;Yÿ99Vÿ€Š€ÿÿÿÿÿÿÿÿÿÿÿÿÿBBBÿOOOæææÿª•ªÿŸŸŸÿŸŸŸÿ)ÿ66Rÿ88Uÿ99Vÿ;;Yÿ<<[ÿ@@`ÿAAcÿEEhÿGGkÿKKpÿMMtÿQQyÿRRzÿRR|ÿRR|ÿRRzÿPPxÿMMtÿKKrÿHHmÿEEfÿBBcÿ@@`ÿ<<[ÿ99Wÿ88VÿŠ€ŠÿÿÿÿÿÿÿÿÿÿÿÿÿAAAÿJJJáááÿ•ª•ÿŸŸŸÿŸŸŸÿ)ÿ66Qÿ77Tÿ88Uÿ99Yÿ<<[ÿ>>_ÿAAaÿCCfÿFFiÿJJoÿLLrÿOOwÿPPxÿQQyÿQQyÿPPxÿMMuÿLLsÿJJoÿGGjÿCCeÿAAaÿ>>_ÿ;;Yÿ88Vÿ88Uÿ€Š€ÿÿÿÿÿÿÿÿÿÿÿÿÿ@@@ÿCCCÚÚÚÿŸŸŸÿŸŸŸÿŸŸŸÿ(ÿ44Pÿ66Qÿ66Rÿ88Uÿ99Wÿ<<\ÿ>>_ÿBBcÿCCfÿGGkÿJHnÿLLsÿMMtÿMMtÿMMtÿMMsÿKKpÿHHnÿGGkÿCCfÿ@@aÿ>>^ÿ<<[ÿ99Vÿ77Tÿ66Rÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿ@@@ÿ<<<ÒÒÒÿŸŸŸÿŸŸŸÿŸŸŸÿ'ÿ22Mÿ33Oÿ44Pÿ66Rÿ88Uÿ99Yÿ<<[ÿ>>_ÿAAcÿCCfÿEEiÿHHmÿHHnÿJJnÿJJnÿHHmÿFFjÿEEhÿCCfÿAAaÿ==\ÿ;;Zÿ99Wÿ66Rÿ44Pÿ33Oÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿ>>>ÿ999ÐÐÐÿŸŸŸÿŸŸŸÿŸŸŸÿ%ÿ11Lÿ22Lÿ33Mÿ44Pÿ77Rÿ88Vÿ;;Yÿ==^ÿ@@`ÿBBdÿCCfÿFFiÿGGjÿGGkÿGGjÿFFjÿEEhÿCCeÿAAcÿ>>_ÿ<>^ÿ@@`ÿAAcÿBBdÿBBdÿBBdÿAAcÿ@@`ÿ>>_ÿ==\ÿ;;Zÿ88Vÿ66Tÿ44Qÿ22Lÿ11Kÿ11JÿŠ€Šÿÿÿÿÿÿÿÿÿÿÿÿÿ===ÿ333ÊÊÊÿŸŸŸÿŸŸŸÿŸŸŸÿ ÿ$ÿ%ÿ%ÿ'ÿ(ÿ)ÿ*ÿ,ÿ-ÿ.ÿ/ÿ 1ÿ 1ÿ 1ÿ 1ÿ 1ÿ/ÿ.ÿ.ÿ,ÿ*ÿ)ÿ(ÿ%ÿ%ÿ$ÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿ<<<ÿ222ÈÈÈÿôéôÿîîîÿîîîÿÿšššÿ–––ÿ”””ÿŒŒŒÿ‡‡‡ÿ€€€ÿzzzÿsssÿoooÿjjjÿhhhÿdddÿcccÿcccÿcccÿeeeÿiiiÿkkkÿoooÿuuuÿ}}}ÿ‚‚‚ÿ‡‡‡ÿ‘‘‘ÿ–––ÿšššÿáÜáÿÿÿÿÿÿÿÿÿÿÿÿÿ<<<ÿ222ÈÈÈÿþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþþþþþÿÿÿÿþþþÿøøøÿðððÿíííÿãããþßßßþÝÝÝþÞÞÞÿÞÞÞÿÞÞÞÿßßßÿáááÿäääþêêêþïïïþôôôþýýýþÿÿÿÿþþþþþþþþþþþþþþþþøíøÿ<<<ÿ222ÈÈÈÿþþþþþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþÿÿÿÿþþþÿøøøþôôôþïïïþêêêþèèèþèèèÿâââþßßßþÝÝÝþÛÛÛþÚÚÚþÙÙÙþÛÛÛÿÙÙÙþÙÙÙþÙÙÙþÙÙÙþ<<<ÿ#((¹¾¾ÿþþþþþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþþþþþüüüþøøøþôôôþïïïþêêêþèèèþåååþâââþßßßþÝÝÝþÛÛÛþÚÚÚþÙÙÙþÙÙÙþÙÙÙþÙÙÙþÙÙÙþÙÙÙþ<<<ÿÀBEEÿ^^^þ^^^þ^^^þ^^^þ^^^þ___ÿ]]]þ]]]þ[[[þZZZþ[[[ÿXXXþUUUþTTTþQQQþQQQÿOOOÿJJJþIIIþFFFþDDDþBBBþCCCÿ@@@þ???þ===þ===þ<<<þ<<<þ>>>ÿ;;;þ;;;þ;;;þ;;;þLLLÿ?111111111tpt¿†Œ†ÿþŽŽŽþÿ‹‹‹þ‰‰‰þ‡‡‡ÿƒƒƒþ}}}þyyyþsssÿmmmÿ___ÿQQQþJJJþBBBþ;;;ÿ000þ+++þ&&&þ!!!þþþþþþÿÿ¿?~~ËËËÿ¿¿¿þ¿¿¿þÁÁÁÿ¼¼¼þºººþ¸¸¸ÿ³³³ÿ¨¨¨þ¢¢¢þ•••þ‹‹‹þyyyÿeeeþYYYþPPPÿ???þ000þ(((þ!!!þÿþþþ þ þÿÿ666ÿA,Aÿ,A,ÿ666ÿ666ÿ,A,ÿA,Aÿ,ÿÿÿ ÿÿÿ ÿ ÿÿ ÿÿÿ,A,ÿAAAÿ666ÿ666ÿAAAÿ,A,ÿ,ÿÿ ÿ ÿÿ ÿ ÿ ÿÿÿÿÿ###?^^^^^^]]]]]]\\\YYYWWWTTTŒ‡‡ÿojjÿ_j_ÿe[eÿFFFÿC>>ÿ>99ÿ444ÿ###ÿÿÿÿÿ050¿     ?###?•••¿ËËËÿËËËÿÊÊÊÿÊÊÊÿÈÈÈÿÆÆÆÿÃÃÃÿÁÁÁÿ¼¼¼ÿ¹¹¹ÿ³³³ÿ¯¯¯ÿ¥¥¥ÿžžžÿ™™™ÿ”””ÿŒŒŒÿ†††ÿ‚‚‚ÿÿzzzÿwwwÿejeÿdidÿrrrÿrrrÿrrrÿy~yÿGSG¿$$$ÿ6A6ÿ6A6ÿA,Aÿ,A,ÿ6A6ÿ666ÿ,A,ÿAAAÿ666ÿ666ÿAAAÿ,A,ÿ,A,ÿ6A6ÿ666ÿ666ÿAAAÿ666ÿ666ÿ6A6ÿ,A,ÿ666ÿ6A6ÿ6A6ÿ666ÿAAAÿ,A,ÿ666ÿ6A6ÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþýýýþñññþäääþÙÙÙþÏÏÏÿÂÂÂþ¹¹¹ÿ­­­þ¤¤¤þœœœþ”””þŽŽŽþ………þ€€€þ|||þxxxþvvvþyyyþ»»»ÿ»»»ÿ»»»ÿ»»»ÿ»»»ÿ»»»ÿ»»»ÿ»»»ÿ»»»ÿ»»»ÿ»»»ÿ»»»ÿ»»»ÿ»»»ÿ­­­ÿvvvþhhhþhhhþeeeþþþþþþþþþþþþþþþþþþþþþôôôþéééþßßßÿÊÊÊþÀÀÀþ¸¸¸þ²²²þ¬¬¬þ¨¨¨þ¤¤¤þ¡¡¡þŸŸŸþžžžþþþþœœœþœœœþœœœþœœœþÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿ»»»ÿïïïÿÕÕÕÿÕÕÕÿ___þþþþþþþþþþþþþþþþþþþþþûûûþìììþÞÞÞþËËËþÁÁÁþ¸¸¸þ±±±þ¬¬¬þ§§§þ¤¤¤þ¡¡¡þŸŸŸþžžžþþþœœœþœœœþœœœþœœœþþÿkkkÿkkkÿEEEÿEEEÿEEEÿ777ÿ***ÿ***ÿ777ÿEEEÿEEEÿEEEÿWWWÿkkkÿ»»»ÿïïïÿÕÕÕÿÕÕÕÿPPPþppppppþþþþþþþþþþþþþþþþþþþþþþþþïïïþàààþÎÎÎþÂÂÂþ¸¸¸þ±±±þ®®®ÿ§§§þ£££þ¡¡¡þŸŸŸþžžžþŸŸŸÿŸŸŸÿœœœþœœœþþþþÿkkkÿkkkÿuuuÿuuuÿkkkÿ^^^ÿQQQÿQQQÿ^^^ÿkkkÿkkkÿkkkÿkkkÿkkkÿ»»»ÿïïïÿÕÕÕÿÕÕÕÿ===þWWWWWWþþþþþþþþþþþþþþþþþþþþþþþþòòòþãããþÏÏÏþÄÄÄþºººþ²²²þ¬¬¬þ§§§þ£££þ¡¡¡þŸŸŸþžžžþþþžžžÿœœœþþþþÿkkkÿkkkÿQQQÿQQQÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿ»»»ÿïïïÿÕÕÕÿÕÕÕÿ...þEEEEEEþþþþþþþþþþþþþþþþþþþþÿÿÿÿóóóþäääþÏÏÏþÄÄÄþºººþ²²²þ¬¬¬þ§§§þ£££þ¡¡¡þŸŸŸþžžžþþŸŸŸÿœœœþœœœþþþþÿLLLÿLLLÿLLLÿLLLÿLLLÿLLLÿLLLÿLLLÿLLLÿLLLÿLLLÿLLLÿLLLÿLLLÿªªªÿïïïÿÕÕÕÿÕÕÕÿ$$$þ;;;;;;þþþþþþþþþþþþþþþþþþþþþþþþóóóþäääþÏÏÏþÄÄÄþºººþ²²²þ¬¬¬þ§§§þ£££þ¡¡¡þŸŸŸþžžžþþþœœœþœœœþþþþÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿ»»»ÿïïïÿÕÕÕÿÕÕÕÿþ444444þþþþþþþþþþþþþþþþþþþþþþþþïïïþàààþÎÎÎþÂÂÂþ¸¸¸þ±±±þ®®®ÿ§§§þ£££þ¡¡¡þŸŸŸþžžžþŸŸŸÿŸŸŸÿœœœþœœœþþþþÿkkkÿjjjÿtttÿtttÿtttÿtttÿtttÿtttÿtttÿtttÿtttÿtttÿtttÿkkkÿ»»»ÿïïïÿÕÕÕÿÕÕÕÿþ333333þþþþþþþþþþþþþþþþþþþþûûûþìììþÞÞÞþËËËþÁÁÁþ¸¸¸þ±±±þ¬¬¬þ§§§þ¤¤¤þ¡¡¡þŸŸŸþžžžþþþœœœþœœœþœœœþœœœþþÿkkkÿeeeÿ```ÿ```ÿ```ÿ```ÿ```ÿ```ÿ```ÿ```ÿ```ÿ```ÿeeeÿkkkÿ»»»ÿïïïÿÕÕÕÿÕÕÕÿÿ333333þþþþþþþþþþþþþþþþþþþþôôôþéééþßßßÿÊÊÊþÀÀÀþ¸¸¸þ²²²þ¬¬¬þ¨¨¨þ¤¤¤þ¡¡¡þŸŸŸþžžžþþþþœœœþœœœþœœœþœœœþÿkkkÿcccÿcccÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿkkkÿ»»»ÿïïïÿÕÕÕÿÕÕÕÿÿ333PPPÿþþþþþþþþþþ þ þ þ þþþþþþþþþþþþþ333þ333þ333þ333þ333þ333þ333þ333þ333þ666ÿ333þ333þ333þ333þ[[[þAAAþþþþ 00$ª$$²$º(R ü€' ü€'gnustep-gui-0.24.0/Images/common_StepperUpHighlighted.tiff0000664000076500007650000000063212227054647023473 0ustar brains99brains99II*`€* P8$TU?áP¸d0«†ÄapøL5Àt{Ãb‘­¡ˆCÂW‚Â3ŸU³ý¡”EaH2„)ï&˜ÃN\¾s kÁWóø”TU¤RiT°þ  FBˆ@X2:(HH/home/ericwa/gnustep/core/gui/Images/common_StepperUpHighlighted.tiffCreated with GIMPgnustep-gui-0.24.0/Images/common_Dimple.tiff0000664000076500007650000000301611576470225020614 0ustar brains99brains99MM*P€WúÖ€ "À @˜ÿ€ @°TEŸä,$€à[üˆ€#-:)þY‡€( :BGX`(=RS¬a.tiffCreated with The GIMPHH€ P8 ~€ Xb078˜g€ üH`g@'‘H[ à)Bã¢è$‚Çc°¸#üG@ Àß…G%0öP  Oa@pPÿ€ao×óàó~?FÑp¥ š6©Àôy¿ÁÀp¸Ö`ð*ãÌå~;DÔxÛ›Û h„_ÀÀ6ð¿« XP¸û;ÀNë€H/½€$ˆº„° €'þS, Ÿà`r€ÿ¾À/wóÝ:¶å𶼞•¿Â žËh ÊîoðFö=~^Ú u²¸€ €Ÿ> ¿Â{°>åtû`p<Ÿçè| oØš Å'€ Ï›bÈ2Kšê€ Qü´Îz€'(lÀb Ѓp ‹æ ‹hÈ. còî?«\Ÿ18t&±d)¡¬ €Äj‚¤t¾àxrî§€p €Pj™r`'Ïà;(Êr¨-Ç'û Ù¿Rë(Ü)èâ} Òš“L_ŸË˜AÂgô«( $NòØÃéâ|ŸÉò€{'jIplÀ )9‚@';-›f8 z\­æôϽeœ‰¦’2Õ5€ VŽ«-^(UÝ¥¯¹€N áXõL¤ê‚Gý#)ö‚ܧ@ ®l‡ÏJÕƒ'èJ`4ðdêГª¤±ªFŸgñâš#¨ž—°ÐH Gð8ƒ‡ø1GcæÙµÖ’# m¡¸Hb5(BAPàéþ ßV]dàIêµhÀÀ0Ф$Aˆ(e¹™ú ßcf\ëÄüŸ=ôès†`l0èª&‚¦@B—a@F\æ Ò•¨È3:ù#&áž#håp)Z((^(J:ƒ @ƒ“…c-OˆùôläælI‡†! †%ƒaˆ* Êêœà)˜ã6˜ v„¤( ¢ªhDÀÈ(1>Ð=RSb.tiffCreated with The GIMP$ $ ImageMagick 6.6.2-6 2010-09-17 Q16 http://www.imagemagick.orggnustep-gui-0.24.0/Images/common_StepperDown.tiff0000664000076500007650000000063412227054647021657 0ustar brains99brains99II*j€*Ÿð8$ U@•P¸d6…BË@¤P¡„¿áˆ4ü1hÑŒDUH|1ÈÓÆ¡jsETÂy«%0Ô‰‰RóaCb¨a½|ä‡NáÉõÚÒƒ‡Raq­6O¨Bbµ:¥Nþ  =LŠ@b<D(ÿÿÿÿgÿÿÿÿg/home/ericwa/gnustep/core/gui/Images/common_StepperDown.tiffCreated with GIMPgnustep-gui-0.24.0/Images/common_DocsFolder.tiff0000664000076500007650000001073011466771424021432 0ustar brains99brains99II*†P8$ „BaP¸d6ˆD`æø¡ýl¶\¿‹%’úþ%HdR9$„o'©åKôz=*þ2 /ñp¸lÿˆÅKé,ö}? Ib†óü©N¿I$Sñ¸Ø€þІoàH,¿€ãú v½_žÉÆãúýr¹^?¦Ã³øt9"?ÄBCüH ¿ì»åöb”ÊÒédóü˜K,¿ÆñËü> ¿Ç¢ÓüÈ+ÊŠÂ@»Õû=Ÿ ÙW«Æù4šQ?È„"{üJ$¿Äá`£üŠ Èåò»¬¶aþK„ŸÒK,^2J%OúdGe_¯Øoóáéþ ˆ/ñ0”Zÿò$Ñ×yçßo BÃøŽ gaX 4²\ÿ4ñx¼n_ª ª¸æ¢°jÀiêÊú”…XŠ"x¼‡aЊÇ2 ³p‹3rôÄ «ÖöŒ/aý½£Pö† ¨á k)p\gù"HÇøX©á@ŸàX&A0"AhÖ?åÑnläÑ.YàÀ09hzÊb˜†IþFdÑþ+ŠÃ1þ¨†oļ4BÞ²£ VEOh¼‚çð¿<Ó¼ó?Ãø¬%ä(ð:Ë9xŒøÎ‰¢n'àý ø@ÌŒ‚Éù&HEùRS‡ù2K2Œ¦“dÁh‹bÈÒù¢VW•ÅÉþI’% þ#‚‰þl«&ÝÍïC+=Ïóà»iZ“ͧ<“Äöå‘\’¤¡6­â)üAQÿJRÄnãÈhâÐJ ÔØO4T™'JQNbÕÒ¡?’ÀÌ:]bh¨àøHò;‘‡øŽ#‰ùfYÏÀÊ<Ÿá‹52-¼?feüQ=Z³ìV‹ñý˜Ï9¡üNVÙx^çøæ9¯`<ð;uÒ´(rŸ÷uà=^gøÜèâ F ŸÀø}³õK)J’‘fd r4axnXÖ{aþG…)þ;ޤQþ `©þ†!Û$ÊCôáÁ·“¬û>fÙµ§L‹yø* 6áco“„ÙFü ïØLšE,4† þ?†Ýœê§SÔj#˜báø4Æ`Ûøž+·mfÜJPyC0²Pý†‹s8Tà˜$Ú‹¹x³Áz4Ëx/Îy·|{g÷º& Ͳ=ŸæT“ÄéL!¸„ˆaxaÏiZgIÑuΣÕõÝ€Ü €Øþ @° àz]¢Ÿ H«d?Þ…nØ1† æm‚ PyO0›E @°ÿ ËÞBHG^Áí{¯t-eð½—À{ !…˜?€9G@¬™ vÚ+Gt™wºÇTþâBô޽ŸDÀÖ `,Š0ˆ¨ÀÀv¥ôç‘RÞvÂPI Ãü,…uAØFàh ´plÑ·oPžÂèá$,^ãú¨ö'zÂôX Áü‚Œc?°ômHÓlP¹ï>/ÜêX%Çø{u À– [CdŸÁ®*E(«A˜fnO éeƒLmñŽ1F¨ÿâNðx…£\m˜-¸ç ¦Dv„‘âÂÓ#3£${ Á$#3uµ-†8ÍWâDÔp,áVŒcþrNYÈ<'@ÿÓ¬…@IdÒô ÆN‡0`ðo€zÄø)ƒLT 3€3‚°2?ƒ0* á4àà4€*ü",•‹Áv2øª ,1†"4Šd*‚昚¸ÿ¥ êw7 ³¹wÁZ™S±M‡õ8!ém‹áb+Gø´lô@á?ÁH(~`8€S¨äæªUNr š¬?Àýhàà §Ãÿ€!¶QDø§h •4‚™ZAÃ1¾ GÀ€DH€Õƒt‹!^Áð…ýö¾ð.À€¿€™ÑGJWJ©M±ôѬYJgL¬µ–f Á¤?ÅÀ·U(D/àdчø6˜Õb­ñGkꥱ¶VºØ@ýd€µ’PJ)LœhF DÀ$”`'=¡‘"1ü.þÖÞ‰°´A¶ ˆ\€°uH’² êÉYRÕ€ þjÍ`*µqüÂGÂÐU ü3†l¹" KÎФ‡òìñ Û\9Õ;*²^œÃà|Û<Tª…QS`!aÝrˆ·[NÆ 1¶€@\ë€?H1l¾`pd8"½!Kà§q½éÇ#øLˆò?†ÀÚcø` áš÷‚· `ü!¿A€€îˆ@#мèH\4Ρþ ÁùŒ…\Ì™ÁY±™¬ÌÝl„–qGW•ʸŸ.*WðBå1üO,‡¥!GãÐô?ÆÑ(ØGŠþBÐl´Ö£dõà²ôru5±þ5p5#ü ´Aþ0†^dÕUJEñC«óÒÖO6ÛÕÆ^Y–Ïeíwü„Õb¾C aˆ5òÀCøƒ•Í€´³MÊUzÉ,­!pþ`üâ$­k3…©È:^«ÝUJF¡þ7„ØùŒoUê ZÃ1_llY,H­øƒýʹpÉGªBÉd‹¬ò¥‚]v¶ÕÚíAKŠè¸Àÿ,êúså9)32Ï“u >Lƹ8ÓåCüzrÕ`*§ ÙöÏ“ 1þyÀÿÜîÙÎ|? ³;Xí ¯%C lá.%_]…)€töã°™CNÂ|äFƒÀKµüó“ Ó¢ðiÙÇøßíUHdÈ‚är÷uÎPYÝÓ`M ¥0“ê@.d@&¸‚‘þ|F *ÜDxÝBí©ÄÜtùZ¤#<ÂÇ7!¢ð€I$€P~íÀ` Ðêæp½xþ 5Ð%òò tÈþ ²ª¯Ï€F° [øVÈQ Ȉÿ*/ºÕ;ºg5XãúZœa !þ(¾ÃMB†/¼?ÂáG …ÑÌ•R°ÿŸœ a¡þˆ A„„IøwRw‹\K ÿË¢âÉ&’Áü­+ÔkÒðçNxœÁhg¡þ ˜œ°¯ŒÆER¶Aïfîƒjã®>ážÉÈáâù¬È°Tᛡþ°`ákr  Ú0Î~ mv$IìŸ „¸~=Ãà£âtëx«À^Ÿxüpœ¶AüÌÈ €Üœ¨¶aHìàhªAšài|1!þh« 'â~¾œ€ÆÐáþ„ráHU¡þ˜œÈPáÙ£ä~¬AüŒGq ŒHq @tþ ð’ÑC4¹ÕìÆ!¼œ€\ïi2ëfA*œ€6Al ¨aïšáÔœŽéÈåf—A2œ€Îxå† IÈÈ€åêÝk;â~ * À„lI,H1”ÑœÄ EI÷éB·©À@Äl!"ªPLœ€s¯®øËd †M‹²FÁ$G é0÷qè‘ì>A@'àÆDÀ€èQúv‘þˆö‰ga)FŠ”¨¨« Ûþò ªAÖʦÈœ€j iȪ`ï#åÀ±FœÁMa:iÈÍæá¼iÉ 1éo0b¢~ZeðЙ'Gi'ü1"®*Ϫ•JÖÊ ¡gÂÍêÊá½)ꤜ€M$¢+f R áþ²¼ªAG€ÚiÈ ±ÛIÈ€c&0P rÜ>@À'êp€èµ rê‹1¬þ ª(‰À•( )*/²ø ë˜=²ìÀg1kdÁ¸ªmÐÜÌé¾&á«2òÙ3-V s8>@€'à  &Ù’ð‹´hò2Òû0JÞ÷Rú¹ŠcÚ DæÄì.^ µ2j© éÈÃWç/2Œ:³Œáú©È ✀ðb¥T ÈË®caþ,3LÆÍ#b `@'ïb .è³Äè qDç>†XZ3êeíôưÀ aþ(Ëd4 ©S 󴜓’œ“þœ{%rNœ€ùa`y Aß)Íaî>AÖ+Çdv€mF´Þè­pO(Ÿ/Tzû³oH Q>¤øPîS4Žª^_f>*´«pZ›IÌ5ðïœÐ最f IÈ po5R:á(‰ÉéÈÝÔªœÁ¯T£äB¼SЄ\ÕXEà²ìJDãOTùH¥3NaüZåhu¦@°¦LO<à.@D^Z\Ö. J¤Aöœ¯Án)ÈáLœ€ìnÈD éÈÑU8 Ⱦáçòc"n>AT+ÔÞEàgU dÊÁü½¦°pÓìeà½HͲ „ðÞåñPuv6r_¦¥2¡ƒ„O6öO6 ábuGbª¦Ö0>A+Õæaüʶ<D]5I8N€R-fTŽVkœ«Ä뢽 lƬh½.‚v€èåŽ]*2NabÖ„àíh£ä b¼à&Aü'c̪ÊópèTÛ ¶v¹ÖoQ˜bÖgjÆlkd@à$ œ€ AÈþtVåhv„œHÆ `–+ÀYa¶•cÔÛ)Vœy>ç26¶è6v€Ÿ)kÚ½5ììwj"©m Þ«!’ a `ô `¶ aôWAn–,òbn `V+ÀP•Ãd WFCâŠÉÁp¦-oú§)Þ̶Áf‘˜ÀDÏlêœ, a `åoÂputV†ÃˆB `+ÀBSˆ×¤)5*h„ ’8(D½×²æõ^d_w¯mVØ« Â"b ‚bâ´^Â!þ·üá{€!þ¸ 9¯yÌÈ aê/€7{0ß¡þ DoTÿ^¶À²†ö¶Ëx*!’ývÞ a `Ò `“t×ó~âPâ zb """" #‡fB2Ö X€àåˆm¼ÎAeˆíÖaç‰mÔXœ>Aª/€.®áñ¼ÆæõLHLõƒ‹n!™sb `ª `v `K~¸T XX3à `L `Œ `Ì a aL aŒ aÌ+1¼ùbÆ.àÏ¡þ Ù>Aj/€ UT®áa€7Ѐ «WØ A oè @{ŽÂb˜VC?y‚Œâ ‚—8+À–`À`< :`6 ¢ B ¢S¼ `”¹O•”,/usr/home/michael/Sandbox/GNUstep/core/gui/Images/common_Folder.tiffCreated with The GIMPPaint.NET v3.5.5HHþ0/Ú E\¢/TÊÒ(1¸=Rgnustep-gui-0.24.0/Images/common_3DArrowRight.tiff0000664000076500007650000000243211576466755021677 0ustar brains99brains99MM*<€åP¬„Ba/ð« ‚ÁáPÈ”"ƒ@¡°¨œ2)„`ñGüBE’Ãb±È &.3DL(=RSÚa.tiffCreated with The GIMPHH€ŸâÓˆi2«|àd6ˆDbQ0þ&{ \³ëåtÀxE$R9ü¾EwÛ‚4Õn¹$Ök À÷ÐŒ ªÀ —«Io4›Raóˆ`Ô@[†ÀT,£©Þl•˺•I¦CYL ,€ÀKýø¬+ÞkåÓÖ¿"°€,d°:T€ àˆDÿ«À+ZÐþ»Ä/7»ì@¤>“%ðYüç®À µf;#@‡å/Ñ $3”€  ã°ŸêjòedDàhR/ `cŒÃ$Ul©·ù«š•AïÑ –b«X×oä2µ±xÔð{¢0$);(S´±| Vn([„Ó€˜ †À ìyþy%!øA•çRÿ=p*ˆ Ÿçøw€¹øG¡OK¯ "gø€ t†«ÄÜJ‡5QB_€‚j€„…çp¡@ Ï¡±«NGØT¦†‡ñp ¸¥ÄÏúlvÀJ Ȇ'ñz §˰¬R€@-€brÀ‚` Ž’Bˆ¡þÛ,#f`Ê @ЩT*–ægðš ,ùv` g%Î(qÿŠ bjŸp´(†§ð²ê¡þ}€%0W%à0»FÒBÄ@ÃðwjcljŒDmT‡ gy>u¡:¬WÀh*E¼É!ÀSá ˜]Qèi·uÞ‰á8\À‘À§á«×úF„À: ±Zȶš   ÄT…ÌÔ(1>Ü=RSb.tiff$ $ ImageMagick 6.6.2-6 2010-09-17 Q16 http://www.imagemagick.orggnustep-gui-0.24.0/Images/common_outlineCollapsed.tiff0000664000076500007650000000163007513431717022707 0ustar brains99brains99II*ÉñýtýËþóùþáùþ©ËþQtñùý"ýËýÿþÑÿþœÿþ‚ÿþˆÿþ”ÿþkËþ "ùùýËþùÿþšÿþ~ÿþ~ÿþ~ÿþ~ÿþ|ÿþoÿþ&Ëùýýtýÿþšÿþ~ÿþ~ÿþ~ÿþ~ÿþ~ÿþ~ÿþ|ÿþ;ÿþtýýýËþÑÿþ~ÿþ~ÿþ~ÿþ~ÿþ~ÿþ~ÿþ~ÿþ~ÿþfÿþËýýþóùþœÿþ~ÿþ~ÿþ~ÿþ~ÿþ~ÿþ~ÿþ~ÿþ~ÿþwÿþùýýþáùþ‚ÿþ~ÿþ~ÿþ~ÿþ~ÿþ~ÿþ~ÿþ~ÿþ~ÿþ]ÿþùýýþ©Ëþˆÿþ~ÿþ~ÿþ~ÿþ~ÿþ~ÿþ~ÿþ~ÿþ~ÿþÿþËýýþQtþ”ÿþ|ÿþ~ÿþ~ÿþ~ÿþ~ÿþ~ÿþ~ÿþ`ÿþÿþtýùþkËþoÿþ|ÿþ~ÿþ~ÿþ~ÿþ~ÿþ`ÿþÿþËùùþ "þ&Ëþ;ÿþfÿþwÿþ]ÿþÿþÿþËþ"ùîtþËþùþùþËþtñÉþö€ ?þI>@ˆ(R/Local/Libraries/Resources/Images/common_outlineCollapsed.tiffCopyright (C) 2001 Jeff Teunissen Created with the GIMP.HHgnustep-gui-0.24.0/Images/common_MiniWindowTile.tiff0000664000076500007650000004054610001461145022274 0ustar brains99brains99II*@¹¹Ãÿ¬¬¸ÿ¬¬¸ÿ««·ÿ««·ÿ««·ÿ««·ÿªª¶ÿªª¶ÿªª¶ÿªª¶ÿ©©µÿ©©µÿ©©µÿ¨¨µÿ¨¨µÿ¨¨´ÿ¨¨´ÿ¨¨´ÿ¨¨³ÿ¨¨³ÿ¨¨³ÿ¨¨³ÿ§§³ÿ§§²ÿ§§²ÿ¦¦²ÿ¦¦²ÿ¦¦²ÿ¦¦²ÿ¥¥²ÿ¥¥²ÿ¥¥±ÿ¥¥±ÿ¥¥±ÿ¤¤±ÿ¤¤°ÿ¤¤°ÿ££°ÿ££°ÿ££°ÿ££¯ÿ££¯ÿ££¯ÿ££¯ÿ££®ÿ¢¢®ÿ¢¢®ÿ¢¢®ÿ¢¢­ÿ¡¡­ÿ¡¡­ÿ¡¡­ÿ¡¡­ÿ  ­ÿ  ­ÿ  ­ÿ  ¬ÿŸŸ¬ÿŸŸ¬ÿŸŸ¬ÿŸŸ¬ÿžž«ÿ&'/ÿ««·ÿ::Bÿ::Bÿ::Bÿ99Aÿ99Aÿ99Aÿ89@ÿ89@ÿ78?ÿ78?ÿ78?ÿ67>ÿ67>ÿ67>ÿ56>ÿ56>ÿ56>ÿ45=ÿ45=ÿ34;ÿ34;ÿ34;ÿ33;ÿ33;ÿ33;ÿ12:ÿ12:ÿ12:ÿ019ÿ019ÿ019ÿ008ÿ008ÿ//7ÿ//7ÿ//7ÿ..6ÿ..6ÿ..6ÿ-.5ÿ-.5ÿ-.5ÿ,,4ÿ,,4ÿ+,4ÿ+,4ÿ+,4ÿ*+2ÿ*+2ÿ*+2ÿ)*1ÿ)*1ÿ)*1ÿ))1ÿ))1ÿ'(0ÿ'(0ÿ'(0ÿ&'/ÿ&'/ÿ&'/ÿ&'/ÿÿ©©¶ÿ88@ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¨¨´ÿ66>ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¨¨³ÿ44<ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¦¦²ÿ119ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¥¥²ÿ//7ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¤¤°ÿ--5ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ££¯ÿ++3ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¢¢®ÿ))1ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¡¡­ÿ''/ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿŸŸ¬ÿ$$,ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ££±ÿ¢¢°ÿ¡¡¯ÿ¡¡®ÿ  ­ÿ  ­ÿŸŸ­ÿžž¬ÿ«ÿ«ÿœœªÿœœ©ÿ››¨ÿ››¨ÿšš¨ÿ™™§ÿ˜˜¦ÿ——¥ÿ——¥ÿ––¤ÿ––¤ÿ••£ÿ••£ÿ””¢ÿ““¡ÿ’’ ÿ‘‘ ÿ‘‘ ÿŸÿžÿÿÿŽŽœÿ›ÿŒŒ›ÿ‹‹šÿ‹‹šÿ‹‹™ÿŠŠ˜ÿ‰‰—ÿ‰‰—ÿˆˆ—ÿ‡‡–ÿ††•ÿ……”ÿ……”ÿ……“ÿ„„’ÿƒƒ’ÿƒƒ’ÿ‚‚‘ÿÿ€€ÿ€€ÿ€€ŽÿŽÿ~~ÿ}}Œÿ}}Œÿ||‹ÿOPWÿÿÿÿÿÿÿÿÿÿ¢¢°ÿ¡¡¯ÿ¡¡®ÿ  ­ÿ  ­ÿŸŸ­ÿžž¬ÿ«ÿœœªÿœœªÿœœ©ÿ››¨ÿšš¨ÿšš¨ÿ™™§ÿ˜˜¦ÿ——¥ÿ——¥ÿ––¤ÿ––¤ÿ••£ÿ””¢ÿ””¢ÿ““¡ÿ’’ ÿ‘‘ ÿ‘‘ ÿŸÿžÿÿŽŽœÿŽŽœÿ›ÿŒŒ›ÿ‹‹šÿ‹‹šÿ‹‹™ÿŠŠ˜ÿ‰‰—ÿˆˆ—ÿˆˆ—ÿ‡‡–ÿ††•ÿ……”ÿ……”ÿ……“ÿ„„’ÿƒƒ’ÿ‚‚‘ÿ‚‚‘ÿÿ€€ÿ€€Žÿ€€ŽÿŽÿ~~ÿ}}Œÿ}}Œÿ||‹ÿ{{ŠÿNOVÿÿÿÿÿÿÿÿÿÿ¡¡¯ÿ¡¡®ÿ  ­ÿŸŸ­ÿŸŸ­ÿžž¬ÿ«ÿœœªÿœœªÿœœ©ÿ››¨ÿšš¨ÿšš¨ÿ™™§ÿ˜˜¦ÿ——¥ÿ––¤ÿ––¤ÿ––¤ÿ••£ÿ””¢ÿ””¢ÿ““¡ÿ’’ ÿ‘‘ ÿŸÿŸÿžÿÿŽŽœÿŽŽœÿ›ÿŒŒ›ÿ‹‹šÿ‹‹™ÿ‹‹™ÿŠŠ˜ÿ‰‰—ÿˆˆ—ÿˆˆ—ÿ‡‡–ÿ††•ÿ……”ÿ……“ÿ……“ÿ„„’ÿƒƒ’ÿ‚‚‘ÿ‚‚‘ÿÿ€€ÿ€€ŽÿŽÿŽÿ~~ÿ}}Œÿ||‹ÿ||‹ÿ{{Šÿzz‰ÿMNVÿÿÿÿÿÿÿÿÿÿ¡¡®ÿ  ­ÿŸŸ­ÿŸŸ­ÿžž¬ÿ«ÿœœªÿœœ©ÿœœ©ÿ››¨ÿšš¨ÿ™™§ÿ™™§ÿ˜˜¦ÿ——¥ÿ––¤ÿ––¤ÿ––¤ÿ••£ÿ””¢ÿ““¡ÿ““¡ÿ’’ ÿ‘‘ ÿŸÿŸÿžÿÿŽŽœÿ›ÿ›ÿŒŒ›ÿ‹‹šÿ‹‹™ÿ‹‹™ÿŠŠ˜ÿ‰‰—ÿˆˆ—ÿ‡‡–ÿ‡‡–ÿ††•ÿ……”ÿ……“ÿ……“ÿ„„’ÿƒƒ’ÿ‚‚‘ÿÿÿ€€ÿ€€ŽÿŽÿŽÿ~~ÿ}}Œÿ||‹ÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿLMTÿÿÿÿÿÿÿÿÿÿ  ­ÿŸŸ­ÿžž¬ÿžž¬ÿ«ÿœœªÿœœ©ÿœœ©ÿ››¨ÿšš¨ÿ™™§ÿ˜˜¦ÿ˜˜¦ÿ——¥ÿ––¤ÿ––¤ÿ––¤ÿ••£ÿ””¢ÿ““¡ÿ““¡ÿ’’ ÿ‘‘ ÿŸÿžÿžÿÿŽŽœÿ›ÿ›ÿŒŒ›ÿ‹‹šÿ‹‹™ÿŠŠ˜ÿŠŠ˜ÿ‰‰—ÿˆˆ—ÿ‡‡–ÿ‡‡–ÿ††•ÿ……”ÿ……“ÿ„„’ÿ„„’ÿƒƒ’ÿ‚‚‘ÿÿÿ€€ÿ€€ŽÿŽÿ~~ÿ~~ÿ}}Œÿ||‹ÿ{{Šÿ{{Šÿzz‰ÿzz‰ÿyyˆÿKLSÿÿÿÿÿÿÿÿÿÿŸŸ­ÿžž¬ÿžž¬ÿ«ÿœœªÿœœ©ÿ››¨ÿ››¨ÿšš¨ÿ™™§ÿ˜˜¦ÿ˜˜¦ÿ——¥ÿ––¤ÿ––¤ÿ––¤ÿ••£ÿ””¢ÿ““¡ÿ’’ ÿ’’ ÿ‘‘ ÿŸÿžÿžÿÿŽŽœÿ›ÿŒŒ›ÿŒŒ›ÿ‹‹šÿ‹‹™ÿŠŠ˜ÿŠŠ˜ÿ‰‰—ÿˆˆ—ÿ‡‡–ÿ††•ÿ††•ÿ……”ÿ……“ÿ„„’ÿ„„’ÿƒƒ’ÿ‚‚‘ÿÿ€€ÿ€€ÿ€€ŽÿŽÿ~~ÿ~~ÿ}}Œÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿzz‰ÿyyˆÿxx‡ÿJKSÿÿÿÿÿÿÿÿÿÿžž¬ÿ«ÿ«ÿœœªÿœœ©ÿ››¨ÿ››¨ÿšš¨ÿ™™§ÿ˜˜¦ÿ——¥ÿ——¥ÿ––¤ÿ––¤ÿ••£ÿ••£ÿ””¢ÿ““¡ÿ’’ ÿ’’ ÿ‘‘ ÿŸÿžÿÿÿŽŽœÿ›ÿŒŒ›ÿŒŒ›ÿ‹‹šÿ‹‹™ÿŠŠ˜ÿ‰‰—ÿ‰‰—ÿˆˆ—ÿ‡‡–ÿ††•ÿ††•ÿ……”ÿ……“ÿ„„’ÿƒƒ’ÿƒƒ’ÿ‚‚‘ÿÿ€€ÿ€€ÿ€€ŽÿŽÿ~~ÿ}}Œÿ}}Œÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿzz‰ÿyyˆÿxx‡ÿxx‡ÿIJRÿÿÿÿÿÿÿÿÿÿ«ÿ«ÿœœªÿœœ©ÿ››¨ÿšš¨ÿšš¨ÿ™™§ÿ˜˜¦ÿ——¥ÿ——¥ÿ––¤ÿ––¤ÿ••£ÿ””¢ÿ””¢ÿ““¡ÿ’’ ÿ‘‘ ÿ‘‘ ÿŸÿžÿÿÿŽŽœÿ›ÿŒŒ›ÿ‹‹šÿ‹‹šÿ‹‹™ÿŠŠ˜ÿ‰‰—ÿ‰‰—ÿˆˆ—ÿ‡‡–ÿ††•ÿ……”ÿ……”ÿ……“ÿ„„’ÿƒƒ’ÿƒƒ’ÿ‚‚‘ÿÿ€€ÿ€€Žÿ€€ŽÿŽÿ~~ÿ}}Œÿ}}Œÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿzz‰ÿyyˆÿxx‡ÿww†ÿww†ÿHIQÿÿÿÿÿÿÿÿÿÿœœªÿœœªÿœœ©ÿ››¨ÿšš¨ÿšš¨ÿ™™§ÿ˜˜¦ÿ——¥ÿ––¤ÿ––¤ÿ––¤ÿ••£ÿ””¢ÿ””¢ÿ““¡ÿ’’ ÿ‘‘ ÿ‘‘ ÿŸÿžÿÿŽŽœÿŽŽœÿ›ÿŒŒ›ÿ‹‹šÿ‹‹šÿ‹‹™ÿŠŠ˜ÿ‰‰—ÿˆˆ—ÿˆˆ—ÿ‡‡–ÿ††•ÿ……”ÿ……”ÿ……“ÿ„„’ÿƒƒ’ÿ‚‚‘ÿ‚‚‘ÿÿ€€ÿ€€Žÿ€€ŽÿŽÿ~~ÿ}}Œÿ||‹ÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿzz‰ÿyyˆÿxx‡ÿww†ÿvv…ÿvv…ÿHHPÿÿÿÿÿÿÿÿÿÿœœªÿœœ©ÿ››¨ÿšš¨ÿ™™§ÿ™™§ÿ˜˜¦ÿ——¥ÿ––¤ÿ––¤ÿ––¤ÿ••£ÿ””¢ÿ““¡ÿ““¡ÿ’’ ÿ‘‘ ÿŸÿŸÿžÿÿŽŽœÿŽŽœÿ›ÿŒŒ›ÿ‹‹šÿ‹‹™ÿ‹‹™ÿŠŠ˜ÿ‰‰—ÿˆˆ—ÿˆˆ—ÿ‡‡–ÿ††•ÿ……”ÿ……“ÿ……“ÿ„„’ÿƒƒ’ÿ‚‚‘ÿ‚‚‘ÿÿ€€ÿ€€ŽÿŽÿŽÿ~~ÿ}}Œÿ||‹ÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿyyˆÿyyˆÿxx‡ÿww†ÿvv…ÿvv…ÿuu…ÿGGOÿÿÿÿÿÿÿÿÿÿœœ©ÿ››¨ÿšš¨ÿ™™§ÿ™™§ÿ˜˜¦ÿ——¥ÿ––¤ÿ––¤ÿ––¤ÿ••£ÿ””¢ÿ““¡ÿ““¡ÿ’’ ÿ‘‘ ÿŸÿžÿžÿÿŽŽœÿ›ÿ›ÿŒŒ›ÿ‹‹šÿ‹‹™ÿ‹‹™ÿŠŠ˜ÿ‰‰—ÿˆˆ—ÿ‡‡–ÿ‡‡–ÿ††•ÿ……”ÿ……“ÿ……“ÿ„„’ÿƒƒ’ÿ‚‚‘ÿÿÿ€€ÿ€€ŽÿŽÿŽÿ~~ÿ}}Œÿ||‹ÿ{{Šÿ{{Šÿzz‰ÿzz‰ÿyyˆÿyyˆÿxx‡ÿww†ÿvv…ÿuu…ÿuu…ÿtt„ÿFGNÿÿÿÿÿÿÿÿÿÿ››¨ÿšš¨ÿ™™§ÿ˜˜¦ÿ˜˜¦ÿ——¥ÿ––¤ÿ––¤ÿ––¤ÿ••£ÿ””¢ÿ““¡ÿ’’ ÿ’’ ÿ‘‘ ÿŸÿžÿžÿÿŽŽœÿ›ÿ›ÿŒŒ›ÿ‹‹šÿ‹‹™ÿŠŠ˜ÿŠŠ˜ÿ‰‰—ÿˆˆ—ÿ‡‡–ÿ‡‡–ÿ††•ÿ……”ÿ……“ÿ„„’ÿ„„’ÿƒƒ’ÿ‚‚‘ÿÿÿ€€ÿ€€ŽÿŽÿ~~ÿ~~ÿ}}Œÿ||‹ÿ{{Šÿ{{Šÿzz‰ÿzz‰ÿyyˆÿxx‡ÿxx‡ÿww†ÿvv…ÿuu…ÿuu…ÿtt„ÿttƒÿEFMÿÿÿÿÿÿÿÿÿÿšš¨ÿ™™§ÿ˜˜¦ÿ˜˜¦ÿ——¥ÿ––¤ÿ––¤ÿ••£ÿ••£ÿ””¢ÿ““¡ÿ’’ ÿ’’ ÿ‘‘ ÿŸÿžÿÿÿŽŽœÿ›ÿŒŒ›ÿŒŒ›ÿ‹‹šÿ‹‹™ÿŠŠ˜ÿŠŠ˜ÿ‰‰—ÿˆˆ—ÿ‡‡–ÿ††•ÿ††•ÿ……”ÿ……“ÿ„„’ÿ„„’ÿƒƒ’ÿ‚‚‘ÿÿ€€ÿ€€ÿ€€ŽÿŽÿ~~ÿ~~ÿ}}Œÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿzz‰ÿyyˆÿxx‡ÿxx‡ÿww†ÿvv…ÿuu…ÿtt„ÿtt„ÿttƒÿss‚ÿDDLÿÿÿÿÿÿÿÿÿÿ™™§ÿ˜˜¦ÿ——¥ÿ——¥ÿ––¤ÿ––¤ÿ••£ÿ••£ÿ””¢ÿ““¡ÿ’’ ÿ‘‘ ÿ‘‘ ÿŸÿžÿÿÿŽŽœÿ›ÿŒŒ›ÿ‹‹šÿ‹‹šÿ‹‹™ÿŠŠ˜ÿ‰‰—ÿ‰‰—ÿˆˆ—ÿ‡‡–ÿ††•ÿ††•ÿ……”ÿ……“ÿ„„’ÿƒƒ’ÿƒƒ’ÿ‚‚‘ÿÿ€€ÿ€€ÿ€€ŽÿŽÿ~~ÿ}}Œÿ}}Œÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿzz‰ÿyyˆÿxx‡ÿww†ÿww†ÿvv…ÿuu…ÿtt„ÿtt„ÿttƒÿss‚ÿrrÿCDLÿÿÿÿÿÿÿÿÿÿ˜˜¦ÿ——¥ÿ——¥ÿ––¤ÿ––¤ÿ••£ÿ””¢ÿ””¢ÿ““¡ÿ’’ ÿ‘‘ ÿ‘‘ ÿŸÿžÿÿŽŽœÿŽŽœÿ›ÿŒŒ›ÿ‹‹šÿ‹‹šÿ‹‹™ÿŠŠ˜ÿ‰‰—ÿ‰‰—ÿˆˆ—ÿ‡‡–ÿ††•ÿ……”ÿ……”ÿ……“ÿ„„’ÿƒƒ’ÿƒƒ’ÿ‚‚‘ÿÿ€€ÿ€€Žÿ€€ŽÿŽÿ~~ÿ}}Œÿ}}Œÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿzz‰ÿyyˆÿxx‡ÿww†ÿww†ÿvv…ÿuu…ÿtt„ÿttƒÿttƒÿss‚ÿrrÿqq€ÿBCJÿÿÿÿÿÿÿÿÿÿ——¥ÿ––¤ÿ––¤ÿ––¤ÿ••£ÿ””¢ÿ””¢ÿ““¡ÿ’’ ÿ‘‘ ÿŸÿŸÿžÿÿŽŽœÿŽŽœÿ›ÿŒŒ›ÿ‹‹šÿ‹‹™ÿ‹‹™ÿŠŠ˜ÿ‰‰—ÿˆˆ—ÿˆˆ—ÿ‡‡–ÿ††•ÿ……”ÿ……”ÿ……“ÿ„„’ÿƒƒ’ÿ‚‚‘ÿ‚‚‘ÿÿ€€ÿ€€Žÿ€€ŽÿŽÿ~~ÿ}}Œÿ||‹ÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿzz‰ÿyyˆÿxx‡ÿww†ÿvv…ÿvv…ÿuu…ÿtt„ÿttƒÿttƒÿss‚ÿrrÿqq€ÿpp€ÿBBJÿÿÿÿÿÿÿÿÿÿ––¤ÿ––¤ÿ––¤ÿ••£ÿ””¢ÿ““¡ÿ““¡ÿ’’ ÿ‘‘ ÿŸÿŸÿžÿÿŽŽœÿ›ÿ›ÿŒŒ›ÿ‹‹šÿ‹‹™ÿ‹‹™ÿŠŠ˜ÿ‰‰—ÿˆˆ—ÿ‡‡–ÿ‡‡–ÿ††•ÿ……”ÿ……“ÿ……“ÿ„„’ÿƒƒ’ÿ‚‚‘ÿ‚‚‘ÿÿ€€ÿ€€ŽÿŽÿŽÿ~~ÿ}}Œÿ||‹ÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿyyˆÿyyˆÿxx‡ÿww†ÿvv…ÿvv…ÿuu…ÿtt„ÿttƒÿss‚ÿss‚ÿrrÿqq€ÿpp€ÿpp€ÿ@AIÿÿÿÿÿÿÿÿÿÿ––¤ÿ––¤ÿ••£ÿ””¢ÿ““¡ÿ““¡ÿ’’ ÿ‘‘ ÿŸÿžÿžÿÿŽŽœÿ›ÿ›ÿŒŒ›ÿ‹‹šÿ‹‹™ÿŠŠ˜ÿŠŠ˜ÿ‰‰—ÿˆˆ—ÿ‡‡–ÿ‡‡–ÿ††•ÿ……”ÿ……“ÿ……“ÿ„„’ÿƒƒ’ÿ‚‚‘ÿÿÿ€€ÿ€€ŽÿŽÿŽÿ~~ÿ}}Œÿ||‹ÿ{{Šÿ{{Šÿzz‰ÿzz‰ÿyyˆÿyyˆÿxx‡ÿww†ÿvv…ÿuu…ÿuu…ÿtt„ÿttƒÿss‚ÿss‚ÿrrÿqq€ÿpp€ÿooÿooÿ?@Hÿÿÿÿÿÿÿÿÿÿ––¤ÿ••£ÿ””¢ÿ““¡ÿ’’ ÿ’’ ÿ‘‘ ÿŸÿžÿžÿÿŽŽœÿ›ÿŒŒ›ÿŒŒ›ÿ‹‹šÿ‹‹™ÿŠŠ˜ÿŠŠ˜ÿ‰‰—ÿˆˆ—ÿ‡‡–ÿ††•ÿ††•ÿ……”ÿ……“ÿ„„’ÿ„„’ÿƒƒ’ÿ‚‚‘ÿÿÿ€€ÿ€€ŽÿŽÿ~~ÿ~~ÿ}}Œÿ||‹ÿ{{Šÿ{{Šÿzz‰ÿzz‰ÿyyˆÿxx‡ÿxx‡ÿww†ÿvv…ÿuu…ÿuu…ÿtt„ÿttƒÿss‚ÿrrÿrrÿqq€ÿpp€ÿooÿooÿoo~ÿ??Gÿÿÿÿÿÿÿÿÿÿ••£ÿ””¢ÿ““¡ÿ’’ ÿ’’ ÿ‘‘ ÿŸÿžÿÿÿŽŽœÿ›ÿŒŒ›ÿŒŒ›ÿ‹‹šÿ‹‹™ÿŠŠ˜ÿ‰‰—ÿ‰‰—ÿˆˆ—ÿ‡‡–ÿ††•ÿ††•ÿ……”ÿ……“ÿ„„’ÿƒƒ’ÿƒƒ’ÿ‚‚‘ÿÿ€€ÿ€€ÿ€€ŽÿŽÿ~~ÿ~~ÿ}}Œÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿzz‰ÿyyˆÿxx‡ÿxx‡ÿww†ÿvv…ÿuu…ÿtt„ÿtt„ÿttƒÿss‚ÿrrÿrrÿqq€ÿpp€ÿooÿoo~ÿoo~ÿnn}ÿ>>Fÿÿÿÿÿÿÿÿÿÿ””¢ÿ““¡ÿ’’ ÿ‘‘ ÿ‘‘ ÿŸÿžÿÿÿŽŽœÿ›ÿŒŒ›ÿ‹‹šÿ‹‹šÿ‹‹™ÿŠŠ˜ÿ‰‰—ÿ‰‰—ÿˆˆ—ÿ‡‡–ÿ††•ÿ……”ÿ……”ÿ……“ÿ„„’ÿƒƒ’ÿƒƒ’ÿ‚‚‘ÿÿ€€ÿ€€ÿ€€ŽÿŽÿ~~ÿ}}Œÿ}}Œÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿzz‰ÿyyˆÿxx‡ÿww†ÿww†ÿvv…ÿuu…ÿtt„ÿtt„ÿttƒÿss‚ÿrrÿqq€ÿqq€ÿpp€ÿooÿoo~ÿoo~ÿnn}ÿmm|ÿ=>Eÿÿÿÿÿÿÿÿÿÿ““¡ÿ’’ ÿ‘‘ ÿ‘‘ ÿŸÿžÿÿŽŽœÿŽŽœÿ›ÿŒŒ›ÿ‹‹šÿ‹‹šÿ‹‹™ÿŠŠ˜ÿ‰‰—ÿˆˆ—ÿˆˆ—ÿ‡‡–ÿ††•ÿ……”ÿ……”ÿ……“ÿ„„’ÿƒƒ’ÿ‚‚‘ÿ‚‚‘ÿÿ€€ÿ€€Žÿ€€ŽÿŽÿ~~ÿ}}Œÿ}}Œÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿzz‰ÿyyˆÿxx‡ÿww†ÿww†ÿvv…ÿuu…ÿtt„ÿttƒÿttƒÿss‚ÿrrÿqq€ÿqq€ÿpp€ÿooÿoo~ÿnn}ÿnn}ÿmm|ÿll|ÿ<=Dÿÿÿÿÿÿÿÿÿÿ’’ ÿ‘‘ ÿŸÿŸÿžÿÿŽŽœÿŽŽœÿ›ÿŒŒ›ÿ‹‹šÿ‹‹™ÿ‹‹™ÿŠŠ˜ÿ‰‰—ÿˆˆ—ÿˆˆ—ÿ‡‡–ÿ††•ÿ……”ÿ……“ÿ……“ÿ„„’ÿƒƒ’ÿ‚‚‘ÿ‚‚‘ÿÿ€€ÿ€€ŽÿŽÿŽÿ~~ÿ}}Œÿ||‹ÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿzz‰ÿyyˆÿxx‡ÿww†ÿvv…ÿvv…ÿuu…ÿtt„ÿttƒÿttƒÿss‚ÿrrÿqq€ÿpp€ÿpp€ÿooÿoo~ÿnn}ÿnn}ÿmm|ÿll|ÿkk{ÿ;ÿÿÿÿÿÿÿÿÿÿ›ÿŒŒ›ÿ‹‹šÿ‹‹™ÿ‹‹™ÿŠŠ˜ÿ‰‰—ÿˆˆ—ÿˆˆ—ÿ‡‡–ÿ††•ÿ……”ÿ……“ÿ……“ÿ„„’ÿƒƒ’ÿ‚‚‘ÿ‚‚‘ÿÿ€€ÿ€€ŽÿŽÿŽÿ~~ÿ}}Œÿ||‹ÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿyyˆÿyyˆÿxx‡ÿww†ÿvv…ÿvv…ÿuu…ÿtt„ÿttƒÿttƒÿss‚ÿrrÿqq€ÿpp€ÿpp€ÿooÿoo~ÿnn}ÿnn}ÿmm|ÿll|ÿkk{ÿjjzÿjjzÿiiyÿiixÿhhwÿhhwÿggwÿffvÿ55=ÿÿÿÿÿÿÿÿÿÿŒŒ›ÿ‹‹šÿ‹‹™ÿ‹‹™ÿŠŠ˜ÿ‰‰—ÿˆˆ—ÿ‡‡–ÿ‡‡–ÿ††•ÿ……”ÿ……“ÿ……“ÿ„„’ÿƒƒ’ÿ‚‚‘ÿÿÿ€€ÿ€€ŽÿŽÿŽÿ~~ÿ}}Œÿ||‹ÿ{{Šÿ{{Šÿzz‰ÿzz‰ÿyyˆÿyyˆÿxx‡ÿww†ÿvv…ÿuu…ÿuu…ÿtt„ÿttƒÿss‚ÿss‚ÿrrÿqq€ÿpp€ÿpp€ÿooÿoo~ÿnn}ÿmm|ÿmm|ÿll|ÿkk{ÿjjzÿjjzÿiiyÿiixÿhhwÿggwÿggwÿffvÿeeuÿ44<ÿÿÿÿÿÿÿÿÿÿ‹‹šÿ‹‹™ÿŠŠ˜ÿŠŠ˜ÿ‰‰—ÿˆˆ—ÿ‡‡–ÿ‡‡–ÿ††•ÿ……”ÿ……“ÿ„„’ÿ„„’ÿƒƒ’ÿ‚‚‘ÿÿÿ€€ÿ€€ŽÿŽÿ~~ÿ~~ÿ}}Œÿ||‹ÿ{{Šÿ{{Šÿzz‰ÿzz‰ÿyyˆÿxx‡ÿxx‡ÿww†ÿvv…ÿuu…ÿuu…ÿtt„ÿttƒÿss‚ÿrrÿrrÿqq€ÿpp€ÿooÿooÿoo~ÿnn}ÿmm|ÿmm|ÿll|ÿkk{ÿjjzÿiiyÿiiyÿiixÿhhwÿggwÿggwÿffvÿeeuÿddtÿ34;ÿÿÿÿÿÿÿÿÿÿ‹‹™ÿŠŠ˜ÿŠŠ˜ÿ‰‰—ÿˆˆ—ÿ‡‡–ÿ††•ÿ††•ÿ……”ÿ……“ÿ„„’ÿ„„’ÿƒƒ’ÿ‚‚‘ÿÿ€€ÿ€€ÿ€€ŽÿŽÿ~~ÿ~~ÿ}}Œÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿzz‰ÿyyˆÿxx‡ÿxx‡ÿww†ÿvv…ÿuu…ÿtt„ÿtt„ÿttƒÿss‚ÿrrÿrrÿqq€ÿpp€ÿooÿooÿoo~ÿnn}ÿmm|ÿll|ÿll|ÿkk{ÿjjzÿiiyÿiiyÿiixÿhhwÿggwÿffvÿffvÿeeuÿddtÿccsÿ23:ÿÿÿÿÿÿÿÿÿÿŠŠ˜ÿ‰‰—ÿ‰‰—ÿˆˆ—ÿ‡‡–ÿ††•ÿ††•ÿ……”ÿ……“ÿ„„’ÿƒƒ’ÿƒƒ’ÿ‚‚‘ÿÿ€€ÿ€€ÿ€€ŽÿŽÿ~~ÿ}}Œÿ}}Œÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿzz‰ÿyyˆÿxx‡ÿww†ÿww†ÿvv…ÿuu…ÿtt„ÿtt„ÿttƒÿss‚ÿrrÿqq€ÿqq€ÿpp€ÿooÿoo~ÿoo~ÿnn}ÿmm|ÿll|ÿll|ÿkk{ÿjjzÿiiyÿiixÿiixÿhhwÿggwÿffvÿffvÿeeuÿddtÿccsÿccsÿ12:ÿÿÿÿÿÿÿÿÿÿ‰‰—ÿˆˆ—ÿˆˆ—ÿ‡‡–ÿ††•ÿ……”ÿ……”ÿ……“ÿ„„’ÿƒƒ’ÿƒƒ’ÿ‚‚‘ÿÿ€€ÿ€€Žÿ€€ŽÿŽÿ~~ÿ}}Œÿ}}Œÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿzz‰ÿyyˆÿxx‡ÿww†ÿww†ÿvv…ÿuu…ÿtt„ÿttƒÿttƒÿss‚ÿrrÿqq€ÿqq€ÿpp€ÿooÿoo~ÿnn}ÿnn}ÿmm|ÿll|ÿkk{ÿkk{ÿjjzÿiiyÿiixÿiixÿhhwÿggwÿffvÿeeuÿeeuÿddtÿccsÿccsÿccsÿ019ÿÿÿÿÿÿÿÿÿÿˆˆ—ÿˆˆ—ÿ‡‡–ÿ††•ÿ……”ÿ……”ÿ……“ÿ„„’ÿƒƒ’ÿ‚‚‘ÿ‚‚‘ÿÿ€€ÿ€€Žÿ€€ŽÿŽÿ~~ÿ}}Œÿ||‹ÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿzz‰ÿyyˆÿxx‡ÿww†ÿvv…ÿvv…ÿuu…ÿtt„ÿttƒÿttƒÿss‚ÿrrÿqq€ÿpp€ÿpp€ÿooÿoo~ÿnn}ÿnn}ÿmm|ÿll|ÿkk{ÿkk{ÿjjzÿiiyÿiixÿhhwÿhhwÿggwÿffvÿeeuÿeeuÿddtÿccsÿccsÿbbrÿbbrÿ/08ÿÿÿÿÿÿÿÿÿÿ‡‡–ÿ‡‡–ÿ††•ÿ……”ÿ……“ÿ……“ÿ„„’ÿƒƒ’ÿ‚‚‘ÿ‚‚‘ÿÿ€€ÿ€€ŽÿŽÿŽÿ~~ÿ}}Œÿ||‹ÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿyyˆÿyyˆÿxx‡ÿww†ÿvv…ÿvv…ÿuu…ÿtt„ÿttƒÿss‚ÿss‚ÿrrÿqq€ÿpp€ÿpp€ÿooÿoo~ÿnn}ÿmm|ÿmm|ÿll|ÿkk{ÿjjzÿjjzÿiiyÿiixÿhhwÿhhwÿggwÿffvÿeeuÿddtÿddtÿccsÿccsÿbbrÿbbrÿaaqÿ//7ÿÿÿÿÿÿÿÿÿÿ‡‡–ÿ††•ÿ……”ÿ……“ÿ„„’ÿ„„’ÿƒƒ’ÿ‚‚‘ÿÿÿ€€ÿ€€ŽÿŽÿŽÿ~~ÿ}}Œÿ||‹ÿ{{Šÿ{{Šÿzz‰ÿzz‰ÿyyˆÿyyˆÿxx‡ÿww†ÿvv…ÿuu…ÿuu…ÿtt„ÿttƒÿss‚ÿss‚ÿrrÿqq€ÿpp€ÿooÿooÿoo~ÿnn}ÿmm|ÿmm|ÿll|ÿkk{ÿjjzÿiiyÿiiyÿiixÿhhwÿggwÿggwÿffvÿeeuÿddtÿddtÿccsÿccsÿbbrÿaaqÿaaqÿ``pÿ..6ÿÿÿÿÿÿÿÿÿÿ††•ÿ……”ÿ……“ÿ„„’ÿ„„’ÿƒƒ’ÿ‚‚‘ÿÿÿ€€ÿ€€ŽÿŽÿ~~ÿ~~ÿ}}Œÿ||‹ÿ{{Šÿ{{Šÿzz‰ÿzz‰ÿyyˆÿxx‡ÿxx‡ÿww†ÿvv…ÿuu…ÿuu…ÿtt„ÿttƒÿss‚ÿrrÿrrÿqq€ÿpp€ÿooÿooÿoo~ÿnn}ÿmm|ÿll|ÿll|ÿkk{ÿjjzÿiiyÿiiyÿiixÿhhwÿggwÿggwÿffvÿeeuÿddtÿccsÿccsÿccsÿbbrÿaaqÿaaqÿ``pÿ__oÿ,-5ÿÿÿÿÿÿÿÿÿÿ……”ÿ……“ÿ„„’ÿƒƒ’ÿƒƒ’ÿ‚‚‘ÿÿ€€ÿ€€ÿ€€ŽÿŽÿ~~ÿ~~ÿ}}Œÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿzz‰ÿyyˆÿxx‡ÿxx‡ÿww†ÿvv…ÿuu…ÿtt„ÿtt„ÿttƒÿss‚ÿrrÿrrÿqq€ÿpp€ÿooÿoo~ÿoo~ÿnn}ÿmm|ÿll|ÿll|ÿkk{ÿjjzÿiiyÿiixÿiixÿhhwÿggwÿffvÿffvÿeeuÿddtÿccsÿccsÿccsÿbbrÿaaqÿ``pÿ``pÿ__oÿ^^nÿ,,4ÿÿÿÿÿÿÿÿÿÿ……“ÿ„„’ÿƒƒ’ÿƒƒ’ÿ‚‚‘ÿÿ€€ÿ€€Žÿ€€ŽÿŽÿ~~ÿ}}Œÿ}}Œÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿzz‰ÿyyˆÿxx‡ÿww†ÿww†ÿvv…ÿuu…ÿtt„ÿtt„ÿttƒÿss‚ÿrrÿqq€ÿqq€ÿpp€ÿooÿoo~ÿoo~ÿnn}ÿmm|ÿll|ÿkk{ÿkk{ÿjjzÿiiyÿiixÿiixÿhhwÿggwÿffvÿeeuÿeeuÿddtÿccsÿccsÿccsÿbbrÿaaqÿ``pÿ``pÿ__oÿ^^nÿ^^nÿ++3ÿÿÿÿÿÿÿÿÿÿ„„’ÿƒƒ’ÿ‚‚‘ÿ‚‚‘ÿÿ€€ÿ€€Žÿ€€ŽÿŽÿ~~ÿ}}Œÿ}}Œÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿzz‰ÿyyˆÿxx‡ÿww†ÿww†ÿvv…ÿuu…ÿtt„ÿttƒÿttƒÿss‚ÿrrÿqq€ÿqq€ÿpp€ÿooÿoo~ÿnn}ÿnn}ÿmm|ÿll|ÿkk{ÿkk{ÿjjzÿiiyÿiixÿhhwÿhhwÿggwÿffvÿeeuÿeeuÿddtÿccsÿccsÿccsÿbbrÿaaqÿ``pÿ__oÿ__oÿ^^nÿ^^nÿ]]mÿ*+2ÿÿÿÿÿÿÿÿÿÿƒƒ’ÿ‚‚‘ÿ‚‚‘ÿÿ€€ÿ€€ŽÿŽÿŽÿ~~ÿ}}Œÿ||‹ÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿzz‰ÿyyˆÿxx‡ÿww†ÿvv…ÿvv…ÿuu…ÿtt„ÿttƒÿttƒÿss‚ÿrrÿqq€ÿpp€ÿpp€ÿooÿoo~ÿnn}ÿnn}ÿmm|ÿll|ÿkk{ÿjjzÿjjzÿiiyÿiixÿhhwÿhhwÿggwÿffvÿeeuÿddtÿddtÿccsÿccsÿbbrÿbbrÿaaqÿ``pÿ__oÿ__oÿ^^nÿ^^nÿ]]mÿ\\lÿ)*1ÿÿÿÿÿÿÿÿÿÿ‚‚‘ÿÿÿ€€ÿ€€ŽÿŽÿŽÿ~~ÿ}}Œÿ||‹ÿ{{Šÿ{{Šÿzz‰ÿzz‰ÿyyˆÿyyˆÿxx‡ÿww†ÿvv…ÿvv…ÿuu…ÿtt„ÿttƒÿss‚ÿss‚ÿrrÿqq€ÿpp€ÿpp€ÿooÿoo~ÿnn}ÿmm|ÿmm|ÿll|ÿkk{ÿjjzÿjjzÿiiyÿiixÿhhwÿggwÿggwÿffvÿeeuÿddtÿddtÿccsÿccsÿbbrÿaaqÿaaqÿ``pÿ__oÿ^^nÿ^^nÿ^^nÿ]]mÿ\\lÿ\\lÿ()0ÿÿÿÿÿÿÿÿÿÿÿÿ€€ÿ€€ŽÿŽÿ~~ÿ~~ÿ}}Œÿ||‹ÿ{{Šÿ{{Šÿzz‰ÿzz‰ÿyyˆÿyyˆÿxx‡ÿww†ÿvv…ÿuu…ÿuu…ÿtt„ÿttƒÿss‚ÿss‚ÿrrÿqq€ÿpp€ÿooÿooÿoo~ÿnn}ÿmm|ÿmm|ÿll|ÿkk{ÿjjzÿiiyÿiiyÿiixÿhhwÿggwÿggwÿffvÿeeuÿddtÿccsÿccsÿccsÿbbrÿaaqÿaaqÿ``pÿ__oÿ^^nÿ^^nÿ^^nÿ]]mÿ\\lÿ[[kÿ[[kÿ'(0ÿÿÿÿÿÿÿÿÿÿ€€ÿ€€ÿ€€ŽÿŽÿ~~ÿ~~ÿ}}Œÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿzz‰ÿyyˆÿxx‡ÿxx‡ÿww†ÿvv…ÿuu…ÿuu…ÿtt„ÿttƒÿss‚ÿrrÿrrÿqq€ÿpp€ÿooÿooÿoo~ÿnn}ÿmm|ÿll|ÿll|ÿkk{ÿjjzÿiiyÿiiyÿiixÿhhwÿggwÿffvÿffvÿeeuÿddtÿccsÿccsÿccsÿbbrÿaaqÿ``pÿ``pÿ__oÿ^^nÿ^^nÿ^^nÿ]]mÿ\\lÿ[[kÿ[[kÿZZjÿ&'/ÿÿÿÿÿÿÿÿÿÿ€€ÿ€€ŽÿŽÿ~~ÿ}}Œÿ}}Œÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿzz‰ÿyyˆÿxx‡ÿww†ÿww†ÿvv…ÿuu…ÿtt„ÿtt„ÿttƒÿss‚ÿrrÿrrÿqq€ÿpp€ÿooÿoo~ÿoo~ÿnn}ÿmm|ÿll|ÿll|ÿkk{ÿjjzÿiiyÿiixÿiixÿhhwÿggwÿffvÿffvÿeeuÿddtÿccsÿccsÿccsÿbbrÿaaqÿ``pÿ``pÿ__oÿ^^nÿ^^nÿ]]mÿ]]mÿ\\lÿ[[kÿZZjÿZZjÿYYjÿ&&.ÿÿÿÿÿÿÿÿÿÿ€€ŽÿŽÿ~~ÿ}}Œÿ}}Œÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿzz‰ÿyyˆÿxx‡ÿww†ÿww†ÿvv…ÿuu…ÿtt„ÿtt„ÿttƒÿss‚ÿrrÿqq€ÿqq€ÿpp€ÿooÿoo~ÿoo~ÿnn}ÿmm|ÿll|ÿkk{ÿkk{ÿjjzÿiiyÿiixÿiixÿhhwÿggwÿffvÿeeuÿeeuÿddtÿccsÿccsÿccsÿbbrÿaaqÿ``pÿ__oÿ__oÿ^^nÿ^^nÿ]]mÿ]]mÿ\\lÿ[[kÿZZjÿZZjÿYYjÿXXiÿ%%-ÿÿÿÿÿÿÿÿÿÿŽÿ~~ÿ}}Œÿ||‹ÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿzz‰ÿyyˆÿxx‡ÿww†ÿvv…ÿvv…ÿuu…ÿtt„ÿttƒÿttƒÿss‚ÿrrÿqq€ÿqq€ÿpp€ÿooÿoo~ÿnn}ÿnn}ÿmm|ÿll|ÿkk{ÿkk{ÿjjzÿiiyÿiixÿhhwÿhhwÿggwÿffvÿeeuÿeeuÿddtÿccsÿccsÿbbrÿbbrÿaaqÿ``pÿ__oÿ__oÿ^^nÿ^^nÿ]]mÿ\\lÿ\\lÿ[[kÿZZjÿYYjÿYYjÿXXiÿXXhÿ$$,ÿÿÿÿÿÿÿÿÿÿ~~ÿ}}Œÿ||‹ÿ||‹ÿ{{Šÿzz‰ÿzz‰ÿyyˆÿyyˆÿxx‡ÿww†ÿvv…ÿvv…ÿuu…ÿtt„ÿttƒÿss‚ÿss‚ÿrrÿqq€ÿpp€ÿpp€ÿooÿoo~ÿnn}ÿnn}ÿmm|ÿll|ÿkk{ÿjjzÿjjzÿiiyÿiixÿhhwÿhhwÿggwÿffvÿeeuÿddtÿddtÿccsÿccsÿbbrÿbbrÿaaqÿ``pÿ__oÿ^^nÿ^^nÿ^^nÿ]]mÿ\\lÿ\\lÿ[[kÿZZjÿYYjÿXXiÿXXiÿXXhÿWWgÿ#$+ÿÿÿÿÿÿ¡¡¯ÿXYaÿXY`ÿWW_ÿVW^ÿUV]ÿTU\ÿST\ÿRS[ÿQRYÿQQYÿOPXÿNOWÿNOVÿMMUÿLMTÿKLSÿJKRÿIJRÿHIQÿGHOÿGGOÿEFNÿDEMÿDDLÿCCKÿBCJÿABIÿ@AHÿ?@Hÿ>?Gÿ=>Eÿ==Eÿ;ÿ56>ÿ45=ÿ34;ÿ33;ÿ12:ÿ019ÿ008ÿ//7ÿ..6ÿ-.5ÿ,,4ÿ+,4ÿ*+2ÿ)*1ÿ))1ÿ'(0ÿ&'/ÿ&&.ÿ%%-ÿ$$,ÿ#$+ÿ""*ÿÿ¡¡¯ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþ@@æ@ Rî@@A@@VA^A(R/usr/home/stoyan/new/GNUstep/CVS.build/core/gui/Images/common_MiniWindowTile.tiffCreated with The GIMPHHgnustep-gui-0.24.0/Images/common_ProgressSpinning_5.tiff0000664000076500007650000001047611271671115023141 0ustar brains99brains99II*ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþ  Ú Lâ@.6(R/home/fred/GNUstep/Patches/GS_NSProgresIndie/common_ProgressSpinning_5.tiffHHgnustep-gui-0.24.0/Images/common_LeftTabStop.tiff0000664000076500007650000000110407453703040021556 0ustar brains99brains99II*ÿÿÿÿÿÿþæ 0î@4<(R/lin3/home/fred/GNUstep/common_LeftTabStop.tiffCreated with The GIMPHHgnustep-gui-0.24.0/Images/common_TabSelectedLeft.tiff0000664000076500007650000000115212224735723022371 0ustar brains99brains99II*€ P8$ „BΧ(2 ?á18¤MùãO÷kÉÖŠÈb '«jÀ ‚A"˜@ÝX& ?Þ¯§˜p±]LhPI#ÆM(•K%Ô9ƒ±Û5 „§/7tõt½ Ó(OêàZ«UjÙ}j†ÿ´NžïIòÑsf˜ºî@¥ÖÃc²Ü"‰•Xf.š_àµÄ^¤O·ãìê5RŒ Ëâ¤1|tk%b²f¢Œ%ë=!po|2ÕhµÑAÕŠ¥`¦U)Ä @ƒ½à^¯»3¹ÞîBûÅìﯫî Üëä‚ ØÎG›Ï°>d*Óºƒ<ž ín¼êÁ þ  8T@ (=RHH/home/ericwa/guitest/Images/common_TabSelectedLeft.tiffCreated with The GIMPgnustep-gui-0.24.0/Images/common_ArrowUp.tiff0000664000076500007650000000175611576466755021027 0ustar brains99brains99MM*B€ P8Uþ«Á!P·ø …A•`¨‚C`ø\J#ŽFcè$z1‹À£R8M,Š    ,4 :JR(=RSÖa.tiffCreated with The GIMPHH€ P8$ ƒˆ nD6ˆD`‹x&%ŒF`b v#7£R9$t"À×`4–]ðqˆ¡/œD@¬–NhPaÀ€:c\(‡¶šdæ‹G‰RiuYREÛTðþ¹ ò2g‰W› ,¶Ùnø²Ú^JE/pzó”—¹À»Ö }¡à0Xì.‡ŠÆY°y æJ÷^Åìjª>0qÃ𠪀øç8þ¡”€ Üt¦WNv ¶öêËn%Û­ç ¿àÉ+΀ä1±’yׄ ØÈ ãËx Ø èû.~¨qt¤ˆùž@WÒ{s܇ЀVÿ"¨V! (äBx: öƒŒà1 "C@L ­æþCˆŒ€P'€„JŒ b6 )¢ç`Ñ ÀS#B¸’2z $$ ÀÈZ$|Þæ(=RSb.tiffCreated with The GIMP$ $ gnustep-gui-0.24.0/Images/common_CenterTabStop.tiff0000664000076500007650000000110607453703040022106 0ustar brains99brains99II*ÿÿÿÿÿÿÿÿþæ 2î @6>(R/lin3/home/fred/GNUstep/common_CenterTabStop.tiffCreated with The GIMPHHgnustep-gui-0.24.0/Images/common_Tile.tiff0000664000076500007650000001351010001452020020246 0ustar brains99brains99MM*µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµVµµ´´³²±±°¯®®­¬«ªª©¨§§¦¥¤££¢¡  Ÿžœ›šš™˜—––•”““’‘ŽŒŒ‹Š‰‰ˆUµµ´³²±±°¯®­­¬«ªª©¨§¦¦¥¤££¢¡ ŸŸžœ›š™™˜—––•”““’‘ŽŒŒ‹Š‰ˆˆ‡Sµµ³²±°°¯®­­¬«ª©©¨§¦¦¥¤£¢¢¡ ŸŸžœœ›š™™˜—–••”“’’‘ŽŒ‹‹Š‰ˆˆ‡†Rµµ²±°°¯®­¬¬«ª©©¨§¦¥¥¤£¢¢¡ Ÿžžœœ›š™˜˜—–••”“’‘‘ŽŽŒ‹‹Š‰ˆ‡‡†…Qµµ±°¯¯®­¬¬«ª©¨¨§¦¥¥¤£¢¡¡ Ÿžžœ››š™˜˜—–•””“’‘‘ŽŽŒ‹ŠŠ‰ˆ‡‡†…„Pµµ°¯®®­¬««ª©¨¨§¦¥¤¤£¢¡¡ Ÿžœ››š™˜——–•””“’‘ŽŒ‹ŠŠ‰ˆ‡††…„ƒOµµ¯®®­¬««ª©¨§§¦¥¤¤£¢¡  Ÿžœ›šš™˜——–•”““’‘ŽŒŒ‹Š‰‰ˆ‡††…„ƒ‚Nµµ®­­¬«ªª©¨§§¦¥¤££¢¡  Ÿžœ›šš™˜—––•”““’‘ŽŒŒ‹Š‰‰ˆ‡†……„ƒ‚‚Mµµ­­¬«ª©©¨§¦¦¥¤££¢¡ ŸŸžœ›š™™˜—––•”“’’‘ŽŒ‹‹Š‰ˆˆ‡†……„ƒ‚Kµµ¬¬«ª©©¨§¦¦¥¤£¢¢¡ ŸŸžœœ›š™™˜—–••”“’’‘ŽŽŒ‹‹Š‰ˆ‡‡†…„„ƒ‚€Jµµ¬«ª©¨¨§¦¥¥¤£¢¢¡ Ÿžžœœ›š™˜˜—–••”“’‘‘ŽŽŒ‹ŠŠ‰ˆ‡‡†…„„ƒ‚€€Iµµ«ª©¨¨§¦¥¤¤£¢¡¡ Ÿžžœ››š™˜˜—–•””“’‘‘ŽŒ‹ŠŠ‰ˆ‡††…„ƒƒ‚€€~Gµµª©¨§§¦¥¤¤£¢¡¡ Ÿžœ››š™˜——–•””“’‘ŽŒ‹Š‰‰ˆ‡††…„ƒ‚‚€~}Fµµ©¨§§¦¥¤££¢¡  Ÿžœ›šš™˜——–•”““’‘ŽŒŒ‹Š‰‰ˆ‡†……„ƒ‚‚€~}}Dµµ¨§¦¦¥¤££¢¡ ŸŸžœ›šš™˜—––•”““’‘ŽŒŒ‹Š‰ˆˆ‡†……„ƒ‚€~~}}|Cµµ§¦¦¥¤£¢¢¡ ŸŸžœ›š™™˜—––•”“’’‘ŽŒ‹‹Š‰ˆˆ‡†…„„ƒ‚€~}}}|{Bµµ¦¥¥¤£¢¢¡ Ÿžžœœ›š™™˜—–••”“’’‘ŽŽŒ‹‹Š‰ˆ‡‡†…„„ƒ‚€€~}}}|{{@µµ¥¥¤£¢¡¡ Ÿžžœ››š™˜˜—–••”“’‘‘ŽŽŒ‹ŠŠ‰ˆ‡‡†…„ƒƒ‚€€~}}}|{zz?µµ¤¤£¢¡¡ Ÿžœ››š™˜˜—–•””“’‘‘ŽŒ‹ŠŠ‰ˆ‡††…„ƒƒ‚€~}}}|{zyy>µµ¤£¢¡  Ÿžœ›šš™˜——–•””“’‘ŽŒ‹Š‰‰ˆ‡††…„ƒ‚‚€~}}||{zyyx<µµ£¢¡  Ÿžœ›šš™˜—––•”““’‘ŽŒŒ‹Š‰‰ˆ‡†……„ƒ‚‚€~~}}||{zyxxw;µµ¢¡ ŸŸžœ›š™™˜—––•”““’‘ŽŒŒ‹Š‰ˆˆ‡†……„ƒ‚€~~}}|{{zyxxwv9µµ¡ ŸŸžœœ›š™™˜—–••”“’’‘ŽŒ‹‹Š‰ˆˆ‡†…„„ƒ‚€~}}}|{{zyxwwvu7µµ Ÿžžœœ›š™˜˜—–••”“’‘‘ŽŽŒ‹‹Š‰ˆ‡‡†…„„ƒ‚€€~}}}|{zzyxwwvut6µµŸžžœ››š™˜˜—–•””“’‘‘ŽŽŒ‹ŠŠ‰ˆ‡‡†…„ƒƒ‚€€~}}}|{zzyxwvvuts4µµžœ››š™˜——–•””“’‘ŽŒ‹ŠŠ‰ˆ‡††…„ƒƒ‚€~}}}|{zyyxwvvutsr3µµœ›šš™˜——–•”““’‘ŽŒŒ‹Š‰‰ˆ‡††…„ƒ‚‚€~}}||{zyyxwvuutsrr1µµœ›šš™˜—––•”““’‘ŽŒŒ‹Š‰‰ˆ‡†……„ƒ‚‚€~~}}||{zyxxwvuutsrqq/µµœ›š™™˜—––•”“’’‘ŽŒ‹‹Š‰ˆˆ‡†……„ƒ‚€~~}}|{{zyxxwvuttsrqqp.µµœ›š™™˜—–••”“’’‘ŽŽŒ‹‹Š‰ˆ‡‡†…„„ƒ‚€~}}}|{{zyxwwvuttsrqppo,µµ›š™˜˜—–••”“’‘‘ŽŽŒ‹ŠŠ‰ˆ‡‡†…„„ƒ‚€€~}}}|{zzyxwwvutssrqppon+µµš™˜˜—–•””“’‘‘ŽŒ‹ŠŠ‰ˆ‡††…„ƒƒ‚€€~}}}|{zzyxwvvutssrqpoonm)µµ™˜——–•””“’‘ŽŒ‹Š‰‰ˆ‡††…„ƒ‚‚€~}}}|{zyyxwvvutsrrqpoonml'µµ˜——–•”““’‘ŽŒŒ‹Š‰‰ˆ‡†……„ƒ‚‚€~}}||{zyyxwvuutsrrqponnmlk&µµ—––•”““’‘ŽŒŒ‹Š‰ˆˆ‡†……„ƒ‚€~~}}||{zyxxwvuutsrqqponnmlkj$µµ––•”“’’‘ŽŒ‹‹Š‰ˆˆ‡†…„„ƒ‚€~}}}|{{zyxxwvuttsrqqponmmlkjj"µµ••”“’’‘ŽŽŒ‹‹Š‰ˆ‡‡†…„„ƒ‚€€~}}}|{{zyxwwvuttsrqpponmmlkjii!µµ•”“’‘‘ŽŽŒ‹ŠŠ‰ˆ‡‡†…„ƒƒ‚€€~}}}|{zzyxwwvutssrqpponmllkjiihµµ”“’‘‘ŽŒ‹ŠŠ‰ˆ‡††…„ƒƒ‚€~}}}|{zyyxwvvutssrqpoonmllkjihhgµµ“’‘ŽŒ‹Š‰‰ˆ‡††…„ƒ‚‚€~}}||{zyyxwvvutsrrqpoonmlkkjihhgfµµ’‘ŽŒŒ‹Š‰‰ˆ‡†……„ƒ‚‚€~~}}||{zyxxwvuutsrrqponnmlkkjihggfeµµ‘ŽŒŒ‹Š‰ˆˆ‡†……„ƒ‚€~~}}|{{zyxxwvuttsrqqponnmlkjjihggfedµµŽŒ‹‹Š‰ˆˆ‡†…„„ƒ‚€~}}}|{{zyxwwvuttsrqqponmmlkjjihgffedcµµŽŽŒ‹‹Š‰ˆ‡‡†…„„ƒ‚€€~}}}|{zzyxwwvutssrqpponmmlkjiihgffedccµµŽŒ‹ŠŠ‰ˆ‡‡†…„ƒƒ‚€€~}}}|{zzyxwvvutssrqpoonmllkjiihgfeedcccµµŒ‹ŠŠ‰ˆ‡††…„ƒƒ‚€~}}}|{zyyxwvvutsrrqpoonmllkjihhgfeedccbbµµŒŒ‹Š‰‰ˆ‡††…„ƒ‚‚€~}}||{zyyxwvuutsrrqponnmlkkjihhgfeddccbbaµµŒ‹Š‰ˆˆ‡†……„ƒ‚‚€~~}}||{zyxxwvuutsrqqponnmlkjjihggfeddccbaa`µµ‹Š‰ˆˆ‡†……„ƒ‚€~~}}|{{zyxxwvuttsrqqponmmlkjjihggfedcccbaa`_µµŠ‰ˆ‡‡†…„„ƒ‚€~}}}|{{zyxwwvuttsrqpponmmlkjiihgffedcccba``_^µµ‰ˆ‡‡†…„ƒƒ‚€€~}}}|{zzyxwwvutssrqpponmllkjiihgfeedcccba``_^^ µµˆ‡††…„ƒƒ‚€€~}}}|{zzyxwvvutssrqpoonmllkjihhgfeedcccba`__^^] µµ‡††…„ƒ‚‚€~}}}|{zyyxwvvutsrrqpoonmlkkjihhgfeddccbba`__^^]\ µµ†……„ƒ‚‚€~~}}||{zyyxwvuutsrrqponnmlkkjihggfeddccbaa`_^^^]\\µµ……„ƒ‚€~~}}||{zyxxwvuutsrqqponnmlkjjihggfedcccbaa`_^^^]\[[µµ„„ƒ‚€~}}}|{{zyxxwvuttsrqqponmmlkjjihgffedcccba``_^^^]\[[Zµµ„ƒ‚€€~}}}|{zzyxwwvuttsrqpponmmlkjiihgffedcccba``_^^]]\[ZZYµµƒ‚€€~}}}|{zzyxwwvutssrqpponmllkjiihgfeedcccba`__^^]]\[ZZYXµµ‚€~}}}|{zyyxwvvutssrqpoonmllkjihhgfeedccbba`__^^]\\[ZYYXWµµ€~}}||{zyyxwvuutsrrqpoonmlkkjihhgfeddccbba`_^^^]\\[ZYXXWTµµVUSRQPONLKJHGEDCA@?=<:875420/-+*(&%#"  µ@@  æ@ (14@H./tiffs/tile.tiff_ab.tif.tiffHH@(#)ImageMagick 4.0.4 98/04/01 cristy@sympatico.org""##$$%%&&&&''(())))**++++,,,,--..////0000112233334444555566667788889999::::;;;;<<====>>>>????@@@@AABBBBCCCCDDDDEEEEFFGGGGHHHHIIJJJJKKLLMMMMNNNNOOOOQQQQRRRRSSTTUUVVWWWWXXXXXXXXYYZZ[[\\]]^^__``aabbccddeeffgghhiiiijjkkllmmnnooooppqqrrssttttuuvvwwxxyyzz{{||}}~~€€€€‚‚ƒƒ„„…………††‡‡ˆˆ‰‰ŠŠ‹‹‹‹ŒŒŽŽ‘‘’’““””••––——˜˜™™šš››œœœœžžŸŸ  ¡¡¡¡¢¢££¤¤¥¥¦¦§§§§¨¨©©ªªÿÿ""$$$$%%&&''(())))**++++,,,,--....//0000112233334444555566777788889999::::;;<<<<====>>>>????@@AAAABBBBCCCCDDDDEEFFFFGGGGHHHHIIJJKKKKLLMMMMNNOOOOPPPPQQRRRRSSTTUUVVWWWWWWYYYYXXXXYYZZ[[\\]]^^__``aabbccddeeffgghhiiiijjkkllmmnnooooppqqrrssttttuuvvwwxxyyzz{{||}}~~€€€€‚‚ƒƒ„„…………††‡‡ˆˆ‰‰ŠŠ‹‹‹‹ŒŒŽŽ‘‘’’““””••––——˜˜™™šš››œœœœžžŸŸ  ¡¡¡¡¢¢££¤¤¥¥¦¦§§§§¨¨©©ªªÿÿ**++,,--..//000011112233444455556677888899::::;;;;<<====>>>>????@@@@AABBBBCCCCDDDDEEEEFFGGGGHHHHIIIIJJJJKKLLLLMMMMNNNNOOOOPPQQRRRRSSSSTTUUVVVVWWWWXXYYYYZZ[[\\\\]]^^__gg``aahhiijjjjkkllmmnnooppqqrrssttuuvvwwwwxxyyzz{{||||}}~~€€€€‚‚ƒƒ„„…………††‡‡ˆˆ‰‰ŠŠ‹‹ŒŒŽŽŽŽ‘‘’’’’““””••––————˜˜™™šš››››œœžžŸŸ    ¡¡¢¢££¤¤¥¥¦¦§§¨¨¨¨©©ªª««¬¬­­­­®®¯¯°°±±±±²²³³´´µµ¶¶¶¶··ÿÿgnustep-gui-0.24.0/Images/common_UnknownTool.tiff0000664000076500007650000002253207657460434021711 0ustar brains99brains99II*$  +-Dr$ I^'''u<<<–AA@©a_]·wvsÅ}}yÔzÞz㺶¯î¸µ¬ó¶´©÷¯°¤ú«¬¡ü¶¸©ý²´¤ý«¬›þŸ¦‘þ›ž‰þzþQQAþíKn777[[Y»eecŸŸœà©©¥íªª¨îììèýëëæþííèþììçþëêæþêéäþèèàþææÝþääÛþááØþÝÝÔþÛÛÒþØØÎþÖÓÉþÒÏÄþÍÌ¿þÈɼþÇÉ»ÿÀôÿ¸ºªÿ°²¢ÿ¥¬˜ÿ¢¤ÿ“•ÿQSCÿÿ þ..(¸$‡‡‡ÒÀÀÀòåååùúúùþýýûÿüüúÿüüúÿûûøÿúû÷ÿùùõÿøøôÿ÷÷òÿõöðÿõõðÿñðêþîîèþììæþëëæþééäþèçáþååÝþââÚþàà×þÛÜÓþÚ×ËþÔÔÉþÒÒÆþÏÏÂþ¾¾°þ¶¶¥ÿ°±Ÿÿ£§Žÿ”˜ÿ’•ÿ ¢Šÿ˜˜ÿUUCÿÿÿ ú&&&„ÿÿþÿþþýÿúúùþùúùþùùøþøø÷þüüúÿûûøÿúû÷ÿùúöÿøøõÿ÷÷òÿõöðÿôöïÿñðêþîîèþììæþëëæþêéåþèçâþååßþããÛþáá×þÜÝÒþÙ×ÊþÒÒÆþÊË»þÀÁ±þ±²¢þ©©šÿ›œ‹ÿŒzÿƒmÿz}eÿ–˜ÿ¢£ŒÿWWEÿÿ!"ÿú'''†úúúþúúùþøøöþööôþ÷÷õþøùöþüüùÿûüùÿûûøÿúúõÿ÷øóÿõõïÿîîçÿääÚÿÏÏÄþ¿À¶þ¬®¢þ‘þ‚þ~qþkk^þXXMþKKAþ::/þ)) þþþ&ÿ%ÿ#ÿ!ÿÿÿˆ‰ÿêéãÿ¯±Ÿÿ[WIÿÿ%&ÿú'''†úúùþõõóþëëæþÜÜÒþÊÌÁþ¸»®þ©¬ÿ’”†ÿ~~qÿfg[ÿQSHÿ*%9ÿCÿBÿ@ÿ>ÿ <ÿ :ÿ 8ÿ 6ÿ 4ÿ 2ÿ0ÿ.ÿ,ÿ*ÿ(ÿ'ÿ%ÿ#ÿ!ÿÿÿ˜™•ÿìëäÿ¯±Ÿÿ[XIÿ""ÿ()ÿú'''†üûúÿææàÿff^þL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿ™™–ÿîìçÿ²³¡ÿZZJÿ$$ÿ++ÿ ú'''†üüúÿîîéÿ_^[þL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿš™–ÿîíçÿ±´¡ÿ\[Kÿ&&ÿ..ÿ"$ú'''†øøöþêêäþ^^ZþL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿšš—ÿîîèÿ²µ£ÿ`^Nÿ((ÿ21!ÿ%'ú'''†üüúÿîïèÿ]]XþL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿœ›˜ÿîîéÿµ·¦ÿbaPÿ++ÿ44$ÿ'(ù'''†ûûúÿïïéÿ__ZþL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿœœ™ÿíîèÿ¶¶¦ÿbbQÿ--ÿ67(ÿ77$ý"''%†÷÷õþððéÿ_^ZþL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿœœ˜ÿîíèÿ´·£ÿcbNÿ..!ÿ==,ÿAA,ÿÆ''%†÷÷õþììåþ]^ZþL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿœœ™ÿðïêÿ´¹£ÿecNÿ00#ÿCC0ÿEE1ÿ þ''%†ûûùÿïïèÿ\]VþL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿœ™ÿððêÿ¸º§ÿceQÿ44%ÿGH4ÿLN8ÿÿ$''%†ûûøÿïïéÿ[\VþL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿžšÿññëÿ¼¾¬ÿegSÿ::)ÿOQ<ÿVW@ÿ ÿ$''%†ö÷ôþëëåþ[[UþL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿšÿññêÿÀÀ¯ÿiiUÿ@@0ÿZZEÿ__Gÿ#$ÿ8''%†ööôþëëäþ[[TþL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿžšÿòòìÿÁÁ±ÿjkWÿEE4ÿacKÿbgLÿ&'ÿ H''%†úú÷ÿííçÿYYVþL>yÿL>yÿþÒÿþÒÿþÒÿþÒÿþÒÿL>yÿL>yÿL>yÿ›“´ÿþÒÿ›“´ÿL>yÿL>yÿL>yÿL>yÿþÒÿþÒÿsh–ÿL>yÿL>yÿþÒÿ›“´ÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿ££ŸÿòóîÿÁôÿnp\ÿKK9ÿeiQÿjoSÿ**ÿ H%%%†ööóþîîæÿYYRþL>yÿL>yÿ‡~¥ÿ®¨Ãÿÿÿÿÿ®¨Ãÿ‡~¥ÿL>yÿL>yÿ›“´ÿêéïÿ‡~¥ÿêéïÿ›“´ÿL>yÿL>yÿþÒÿÖÓáÿ®¨ÃÿÖÓáÿsh–ÿL>yÿÿÿÿÿþÒÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿ««§ÿòóîÿÃŶÿrt_ÿQR>ÿotZÿsw[ÿ// ÿ H%%%†õöòþìîåÿZZWþL>yÿL>yÿL>yÿ‡~¥ÿÿÿÿÿ‡~¥ÿL>yÿL>yÿ‡~¥ÿÿÿÿÿ‡~¥ÿL>yÿ‡~¥ÿÿÿÿÿ‡~¥ÿþÒÿÿÿÿÿL>yÿL>yÿþÒÿÿÿÿÿL>yÿÿÿÿÿþÒÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿ­­©ÿóóîÿÆÈ·ÿwybÿRVAÿty^ÿ{|bÿ21$ÿ3%%%†ùùõÿìíæÿYYSþL>yÿL>yÿL>yÿ‡~¥ÿÿÿÿÿ‡~¥ÿL>yÿL>yÿ‡~¥ÿÿÿÿÿ‡~¥ÿL>yÿ‡~¥ÿÿÿÿÿ‡~¥ÿþÒÿÿÿÿÿL>yÿL>yÿþÒÿÿÿÿÿL>yÿÿÿÿÿþÒÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿ¯¯«ÿóôïÿÈÊ»ÿw{eÿU\Eÿzcÿ€iÿ54%ÿ$%%%†ùùõÿìíçÿZZRþL>yÿL>yÿL>yÿ‡~¥ÿÿÿÿÿ‡~¥ÿL>yÿL>yÿ‡~¥ÿÿÿÿÿ‡~¥ÿL>yÿ‡~¥ÿÿÿÿÿ‡~¥ÿþÒÿÿÿÿÿL>yÿL>yÿþÒÿÿÿÿÿL>yÿÿÿÿÿþÒÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿ±°­ÿôôðÿËÌ¿ÿw|hÿW]Fÿƒiÿ††pÿ78'ÿ$%%%†õõñþîìæÿ[[SþL>yÿL>yÿL>yÿ‡~¥ÿÿÿÿÿ‡~¥ÿL>yÿL>yÿ‡~¥ÿÿÿÿÿ‡~¥ÿL>yÿ‡~¥ÿÿÿÿÿ‡~¥ÿþÒÿÿÿÿÿL>yÿL>yÿþÒÿÿÿÿÿL>yÿÿÿÿÿþÒÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿ±±­ÿõõðÿÎÎÀÿ~kÿ\`IÿЉnÿŠŽxÿ;<*ÿ$%%%†õõñþìíæÿXZSþL>yÿL>yÿL>yÿ‡~¥ÿÿÿÿÿ‡~¥ÿL>yÿL>yÿ_S‡ÿÖÓáÿÖÓáÿL>yÿÖÓáÿÖÓáÿ_S‡ÿsh–ÿÿÿÿÿ›“´ÿsh–ÿêéïÿ®¨ÃÿL>yÿÿÿÿÿþÒÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿ´´°ÿõõðÿÑÑÁÿƒ…lÿ_dLÿŽŒoÿ”|ÿ45$ÿ$%%%†øøôÿêëåÿ[[UþL>yÿL>yÿL>yÿ‡~¥ÿÿÿÿÿ‡~¥ÿL>yÿL>yÿL>yÿL>yÿþÒÿÿÿÿÿþÒÿL>yÿL>yÿL>yÿL>yÿÿÿÿÿÿÿÿÿ‡~¥ÿL>yÿL>yÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿL>yÿL>yÿL>yÿ´´°ÿõõñÿÑÑÄÿ…‡qÿ`eMÿvÿ’{ÿ11 ÿ$%%%†øøóÿêêãÿ]]VþL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿ´´±ÿõöñÿÓÓÆÿ†‰tÿcgOÿ“”zÿ‘–~ÿ44"ÿ$%%%†óóïþêéäÿZ[RþL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿÌÌÈÿööñÿÔÔÇÿ†ˆrÿchOÿ’•yÿ•–€ÿ76$ÿ$%%%†÷÷óÿêéäÿ\\UþL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿÓÒÏÿööòÿÖÖÈÿ‡ŠsÿbfNÿ“–yÿ——‚ÿ:8%ÿ$%%%†ööòÿééâÿ[[XþL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿL>yÿÔÔÑÿööóÿ××Éÿ„‡qÿbgNÿ‘•}ÿ–™‚ÿ>>.ý$%%%†ööñÿéèàÿ[[UþVÿUÿSÿ Wÿ-aÿ6&fÿ6'eÿ5'cÿ4'aÿ3'_ÿ2'^ÿ1'\ÿ1'Zÿ0'Yÿ0'Wÿ/'Vÿ.'Tÿ-'Sÿ,'Qÿ,'Oÿ+'Nÿ*'Lÿ)&Iÿ" Cÿ6ÿ*ÿ$ÿ"ÿ ÿÿÕÕÒÿøøôÿÙÙÌÿ„‡qÿbgNÿ‘•}ÿ—›ƒÿ¤%%%†ööòÿóóîÿ¼¼¹þ¨¨¥þ£¤ þ¡¡žþ£¢Ÿÿ˜˜•ÿÿ‰ÿŒ‹ˆÿˆˆ…ÿ‡‡ƒÿ„…ÿ~~{þ}}zþ{{xþxxuþqqoþoonþnnmþmmkþlmjþkkiþjjgþhhfþggeþeecþaa_þedcÿccaÿaa_ÿ``^ÿääàÿøøôÿÚÚÎÿ„nÿaeMÿ”yÿ…‹sý/%%%†øøôÿøøôÿøøóÿóóïþóóïþóóïþ÷÷óÿ÷÷óÿö÷òÿö÷òÿööóÿõöñÿõöñÿõöñÿññìþñòíþññíþññìþðñìþññìþððìþððêþðïéþîîéþííèþëìæþêëåþêëåþééãþêêãÿééáÿççÝÿææÜÿááÙÿààÖÿØ×Ìÿ‚lÿ]bJÿ”zÿ{€jú%%$†óóïþ÷÷óÿóóïþóóïþôóïþóóïþ÷÷óÿ÷÷óÿö÷òÿööòÿööôÿõöòÿõöòÿõõñÿññìþòòìþòñìþñòìþðñìþññíþðñíþñðëþñïéþîïéþííçþììæþëëæþêêæþéçãþëêäÿçéàÿçæÞÿääÛÿààÖÿÜÛÎÿÙÖÍÿ~iÿ]aIÿ‹xÿyziú%%%†óóïþ÷÷óÿóóîþóóîþòòíþòòîþõöóÿõöòÿõöòÿööòÿööòÿõöñÿôõñÿõõñÿñòíþñòíþðñíþññìþðñìþðñìþðñíþðïêþðîéþîîéþìíçþììçþëëçþééåþèçâþëêãÿèéáÿçæÞÿääÛÿààÖÿÝÜÐÿ×ÖËÿzzdÿ]`Hÿ†‰qÿuudú Nªª©ì°°¬ð°°«ð­¬©ð««¨ð¾½¹÷ÄĺÿÈÉ¿ÿÍÍÄÿÐÐÇÿÔÔÊÿØØÎÿÝÝÓÿããÙÿääÛþææÞþééâþëëåþëìæþííçþííèþîîèþííèþììæþììæþëëæþëêåþèèâþææÞþêêâÿééàÿååÜÿââÙÿßÞ×ÿÜÜÓÿÖÖÈÿmmXÿSU?ÿnrYÿYYDú!!!ÊÈ»ÿÅǸÿÁÄ´ÿ¸¼«ÿ³·¦ÿ¯±¡ÿ¨¨˜ÿ°°¡ÿÒÒÈþÛÛÒþÏÏÃþÉɽþÈȽþÃøþ¿¿´þ»»®þ³³¤þµµ¤þ¶¶§þ««›þ££”þœŒþ\]MþKK>ÿqsbÿmm^ÿ~~kÿ””€ÿ™š†ÿvxcÿMO;þRSBýEF=Ýwe¨¨žÿ¤¤›ÿ­¬¥ÿµµªÿÁµÿÈȽÿÈȽÿÛÛÔÿÛÛÕþÕÖÎþÎÏÅþËËÀþÒÒÆþÒÒÇþÔÔÈþÚÚÏþÔÔÈþÛÛÐþããÚþáá×þããÚþáßÙþ\]NþJK7ÿ¢¦ÿx|gÿ|fÿ––‚ÿ˜™ƒþmp^ë..(˜__WßMMDÚLIBÜIF=ãFD;èBA5ëA?1õ]]Kÿ?A.þ=>,þ:;)þ88&þ77%þ77&þ77&þ77&þ88(þ88(þ66'þ44&þ55'þ43'þ þ%&ÿhjVÿhkTþeiSõ00)±8D_^R÷,,þ//þ//þ))þ$$þ þþ þþþþþ þ þ&&ÿecXõ k 8VTMÐhhTþVVEþCC5þ77,þ++"þ#$þþþ þþþ þþ++þLL=þhhVÿjjXþ/PPO«ÀÀºòÓÓÊþ·¸¥ÿ‚jÿ££‹þªª“þ««”þ©©–þŠþ…‰mþhmQþPP:þ99(þ01"þ/0!þ23!þ=>*þZZEþzzfþmm^ÿHH8þ&&û;;6û+)!êGD8ß86/¼?’’ÚííèþòñìÿñðëÿííçÿèèáÿààØÿÜÜÓþááØþèçßþççàþààØþÑÑÅþ«¬œþ}}hþWWDþ==+þ,-þ##þþ þ þ ÿ ÿÿ;=,ÿeÿˆ‹rÿƒƒmþVVMÒ rrqÐãÕÕÒúÛÛØüÙÙÖüîîêþõõñÿððëþïïêþïïêþîîçþííåþììæþêêäþééâþææÞþáàØþ××ÍþÇÇ·þ³³¥þ¡¡þŠŠxþtt`ÿ::)ÿCB/þklTý[XJã((!”& $AA!!!333™333™330™330™776š0--™--*™--'™**$™''!™$$!™!!™™™™ þ00æ$ Eî$4%@$J%R%(R/brains99/Source/gnu/gnustep/core/gui/Images/common_UnknownTool.tiffcreated with The GIMPHHgnustep-gui-0.24.0/Images/common_CloseH.tiff0000664000076500007650000000162010000314455020535 0ustar brains99brains99II*Hÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿaeaÿaeaÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿaeaÿaeaÿÿÿÿÿÿÿÿÿaeaÿaeaÿaeaÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿaeaÿaeaÿaeaÿÿÿÿÿÿÿÿÿÿÿÿÿaeaÿaeaÿaeaÿÿÿÿÿÿÿÿÿaeaÿaeaÿaeaÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿaeaÿaeaÿaeaÿaeaÿaeaÿaeaÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿaeaÿaeaÿaeaÿaeaÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿaeaÿaeaÿaeaÿaeaÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿaeaÿaeaÿaeaÿaeaÿaeaÿaeaÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿaeaÿaeaÿaeaÿÿÿÿÿÿÿÿÿaeaÿaeaÿaeaÿÿÿÿÿÿÿÿÿÿÿÿÿaeaÿaeaÿaeaÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿaeaÿaeaÿaeaÿÿÿÿÿÿÿÿÿaeaÿaeaÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿaeaÿaeaÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþ  & ;.j@@€ˆ(R/usr/home/stoyan/Projects/GNUstep/Icons/common_CloseH.tiffCreated with The GIMPHHgnustep-gui-0.24.0/Images/common_ProgressSpinning_7.tiff0000664000076500007650000001047611271671115023143 0ustar brains99brains99II*ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþ  Ú Lâ@.6(R/home/fred/GNUstep/Patches/GS_NSProgresIndie/common_ProgressSpinning_7.tiffHHgnustep-gui-0.24.0/Images/common_HelpCursor.tiff0000664000076500007650000000247210510150334021454 0ustar brains99brains99II*ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿC­éûâŠÿÿÿÿÿÿÿÿ½Oÿÿÿÿÿÿÿÿ“ÿ¥ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿöÿÿÿÿÿÿÿÿÿÈÿÿÿÿÿÿÿÿåÜ#ÿÿÿÿÿÿÿÿä×ÿÿÿÿÿÿÿÿÆÿÿÿÿÿÿÿÿÿÿúÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþæ %î@*2(R/home/richard/common_HelpCursor.tiffCreated with The GIMPHHgnustep-gui-0.24.0/Images/common_DownArrowSmall.tiff0000664000076500007650000000063006750443351022312 0ustar brains99brains99II*2ò(h°àý‡`ˆ@T# *t؈Tý«Ž.|Tÿaã   M$r™)ˆ(=R/usr/home/michael/Sandbox/GNUstep/core/gui/Images/common_DownArrowSmall.tiffCreated with The GIMPHHgnustep-gui-0.24.0/Images/common_TabSelectedToUnSelectedJunction.tiff0000664000076500007650000000140012224735723025543 0ustar brains99brains99II* €?àOõ¹@ç0”Ì! 6ˆDbPô‚}' oõb©Y@ ÅDNM'Ebå‘ùyþÑt4\ñØü<õ¹“‹õ"in¢WÉeH°Y.h·&O'ƒÈ54‰™š­vªÝhO¨(Œª-—Ì\ï'%:P‰¼Ào6|$Â0‡bk«£üH.€Ì&›64³Ç¨`êÑJæ ºÁ¯Åü=^'IÏ÷CIÚçs<ÐÈ•¢QSj³ú1œ>èº Ä‚ð”ÓdÙìšDTL’KŘL)v\äŸiƒÐ9´gðÊ騻@,×+Ý〔qèsp 2Sœ<@é(”ÍØ¼»l"fY'ÖIœjˆ”@¡Y¡HŸÖÙ½¯r µfbÜd Ü!0|3¡ÄÒ&í@HpÌ”¤~Wƒ$ >_ÿ@@`ÿ@@`ÿ@@`ÿ>>_ÿ==^ÿ==[ÿ<>_ÿ@@aÿAAcÿAAcÿAAcÿ@@aÿ>>_ÿ>>^ÿ==[ÿ99Yÿ77Uÿ66Rÿ44Pÿ22Lÿ11Jÿ//Hÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ...ääääÿÿÿÿŸŸŸÿŸŸŸÿŸŸŸÿ$ÿ//Jÿ11Jÿ11Kÿ33Mÿ44Pÿ77Rÿ88Uÿ;;Yÿ<<[ÿ>>_ÿ@@aÿBBdÿBBeÿCCeÿBBeÿBBdÿAAaÿ@@`ÿ>>^ÿ;;Zÿ88Vÿ77Tÿ66Qÿ22Mÿ11Kÿ11Jÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ...ääääÿÿÿÿŸŸŸÿŸŸŸÿŸŸŸÿ%ÿ11Lÿ22Lÿ33Mÿ44Pÿ77Rÿ88Vÿ;;Yÿ==^ÿ@@`ÿBBdÿCCfÿFFiÿGGjÿGGkÿGGjÿFFjÿEEhÿCCeÿAAcÿ>>_ÿ<>^ÿ<<[ÿ99Yÿ77Tÿ66Qÿ44PÿŠ€Šÿÿÿÿÿÿÿÿÿÿÿÿÿÿ***ääääÿÿÿÿ•ª•ÿŸŸŸÿŸŸŸÿ(ÿ33Oÿ66Qÿ66Rÿ77Uÿ99Wÿ<<[ÿ>>^ÿAAcÿCCeÿFFjÿHHmÿKKrÿLLsÿLLsÿLLsÿLLrÿJJoÿHHmÿFFjÿCCeÿ@@`ÿ==^ÿ<<[ÿ88Uÿ77Rÿ66Qÿ€Š€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ)))ääääÿÿÿÿª•ªÿŸŸŸÿŸŸŸÿ(ÿ44Qÿ66Rÿ77Tÿ99Wÿ;;Zÿ==^ÿ@@`ÿCCeÿEEhÿHHnÿKKpÿMMuÿOOwÿPPxÿPPxÿOOwÿLLtÿKKrÿHHnÿFFiÿBBdÿ@@`ÿ==^ÿ;;Wÿ88Uÿ77TÿŠ€Šÿÿÿÿÿÿÿÿÿÿÿÿÿÿ'''ãããäÿÿÿÿŸŸŸÿŸŸŸÿŸŸŸÿ)ÿ66Rÿ77Tÿ88Uÿ;;Yÿ<<[ÿ>>_ÿAAaÿCCfÿFFjÿJJoÿLLsÿPPxÿQQyÿQQzÿQQzÿQQyÿOOwÿLLsÿJJpÿGGkÿCCeÿAAcÿ>>_ÿ;;Zÿ88Vÿ88Uÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ$$$áááäÿÿÿÿª•ªÿŸŸŸÿŸŸŸÿ*ÿ77Tÿ88Vÿ99Wÿ;;Zÿ==\ÿ@@aÿBBdÿFFiÿHHmÿLLrÿOOuÿRRzÿTT}ÿTT~ÿTT~ÿTT}ÿQQyÿOOwÿLLsÿHHnÿEEhÿBBdÿ@@aÿ<<[ÿ;;Yÿ99VÿŠ€Šÿÿÿÿÿÿÿÿÿÿÿÿÿÿ"""àààäþþþÿ•ª•ÿŸŸŸÿŸŸŸÿ*ÿ77Tÿ88Vÿ99Wÿ<<[ÿ==^ÿAAaÿBBeÿFFiÿHHmÿLLsÿOOwÿRR|ÿTT~ÿUUÿUUÿTT~ÿQQzÿPPwÿMMsÿJJnÿFFhÿCCeÿAAaÿ==\ÿ;;Yÿ99Wÿ€Š€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÞÞÞäúúúÿŸŸŸÿŸŸŸÿŸŸŸÿ*ÿ77Tÿ88Vÿ99Wÿ<<[ÿ==^ÿAAaÿBBeÿFFiÿHHmÿLLsÿOOwÿRR|ÿTT~ÿUUÿUUÿTT~ÿQQzÿPPwÿMMtÿJJnÿFFiÿCCeÿAAaÿ==\ÿ;;Yÿ99Wÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÜÜÜäøøøÿ•ª•ÿŸŸŸÿŸŸŸÿ*ÿ77Tÿ88Vÿ99Wÿ;;Zÿ==\ÿ@@aÿBBdÿFFiÿHHmÿLLrÿOOuÿRRzÿTT~ÿTT~ÿTT~ÿTT}ÿQQyÿOOwÿLLsÿHHnÿEEhÿBBdÿ@@aÿ<<[ÿ;;Yÿ99Vÿ€Š€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÛÛÛäõõõÿª•ªÿŸŸŸÿŸŸŸÿ)ÿ66Rÿ88Uÿ99Vÿ;;Yÿ<<[ÿ@@`ÿAAcÿEEhÿGGkÿKKpÿMMtÿQQyÿRRzÿRR|ÿRR|ÿRRzÿPPxÿMMtÿKKrÿHHmÿEEfÿBBcÿ@@`ÿ<<[ÿ99Wÿ88VÿŠ€ŠÿÿÿÿÿÿÿÿÿÿÿÿÿÿÚÚÚäóóóÿ•ª•ÿŸŸŸÿŸŸŸÿ)ÿ66Qÿ77Tÿ88Uÿ99Yÿ<<[ÿ>>_ÿAAaÿCCfÿFFiÿJJoÿLLrÿOOwÿPPxÿQQyÿQQyÿPPxÿMMuÿLLsÿJJoÿGGjÿCCeÿAAaÿ>>_ÿ;;Yÿ88Vÿ88Uÿ€Š€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿØØØäðððÿŸŸŸÿŸŸŸÿŸŸŸÿ(ÿ44Pÿ66Qÿ66Rÿ88Uÿ99Wÿ<<\ÿ>>_ÿBBcÿCCfÿGGkÿJHnÿLLsÿMMtÿMMtÿMMtÿMMsÿKKpÿHHnÿGGkÿCCfÿ@@aÿ>>^ÿ<<[ÿ99Vÿ77Tÿ66Rÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ×××äíííÿŸŸŸÿŸŸŸÿŸŸŸÿ'ÿ22Mÿ33Oÿ44Pÿ66Rÿ88Uÿ99Yÿ<<[ÿ>>_ÿAAcÿCCfÿEEiÿHHmÿHHnÿJJnÿJJnÿHHmÿFFjÿEEhÿCCfÿAAaÿ==\ÿ;;Zÿ99Wÿ66Rÿ44Pÿ33Oÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÖÖÖäìììÿŸŸŸÿŸŸŸÿŸŸŸÿ%ÿ11Lÿ22Lÿ33Mÿ44Pÿ77Rÿ88Vÿ;;Yÿ==^ÿ@@`ÿBBdÿCCfÿFFiÿGGjÿGGkÿGGjÿFFjÿEEhÿCCeÿAAcÿ>>_ÿ<>^ÿ@@`ÿAAcÿBBdÿBBdÿBBdÿAAcÿ@@`ÿ>>_ÿ==\ÿ;;Zÿ88Vÿ66Tÿ44Qÿ22Lÿ11Kÿ11JÿŠ€Šÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÕÕÕäêêêÿŸŸŸÿŸŸŸÿŸŸŸÿ ÿ$ÿ%ÿ%ÿ'ÿ(ÿ)ÿ*ÿ,ÿ-ÿ.ÿ/ÿ 1ÿ 1ÿ 1ÿ 1ÿ 1ÿ/ÿ.ÿ.ÿ,ÿ*ÿ)ÿ(ÿ%ÿ%ÿ$ÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÕÕÕäéééÿôéôÿîîîÿîîîÿÿšššÿ–––ÿ”””ÿŒŒŒÿ‡‡‡ÿ€€€ÿzzzÿsssÿoooÿjjjÿhhhÿdddÿcccÿcccÿcccÿeeeÿiiiÿkkkÿoooÿuuuÿ}}}ÿ‚‚‚ÿ‡‡‡ÿ‘‘‘ÿ–––ÿšššÿáÜáÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿîîîôñññÿþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþþþþþÿÿÿÿþþþÿøøøÿðððÿíííÿãããþßßßþÝÝÝþÞÞÞÿÞÞÞÿÞÞÞÿßßßÿáááÿäääþêêêþïïïþôôôþýýýþÿÿÿÿþþþþþþþþþþþþþþþþøíøÿ ÿäääîéééÿþþþþþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþÿÿÿÿþþþÿøøøþôôôþïïïþêêêþèèèþèèèÿâââþßßßþÝÝÝþÛÛÛþÚÚÚþÙÙÙþÛÛÛÿÙÙÙþÙÙÙþÙÙÙþÙÙÙþ ÿ÷÷÷úíîîÿþþþþþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþþþþþüüüþøøøþôôôþïïïþêêêþèèèþåååþâââþßßßþÝÝÝþÛÛÛþÚÚÚþÙÙÙþÙÙÙþÙÙÙþÙÙÙþÙÙÙþÙÙÙþ ÿ Ïÿ$$$þ$$$þ$$$þ###þ###þ$$$ÿ"""þ!!!þ þþÿþþþþÿÿþþþþþÿ þ þ þ þ þ þ ÿ þ þ þ þ'''ÿ?111111111tpt¿†Œ†ÿþŽŽŽþÿ‹‹‹þ‰‰‰þ‡‡‡ÿƒƒƒþ}}}þyyyþsssÿmmmÿ___ÿQQQþJJJþBBBþ;;;ÿ000þ+++þ&&&þ!!!þþþþ þ þ ÿÿ¿?ÍÍÍÍêêêÿæææþæææþæææÿäääþäääþãããÿáááÿÉÉÉþ¢¢¢þ•••þ‹‹‹þyyyÿeeeþYYYþPPPÿ???þ000þ(((þ!!!þÿþþþþþÿÿ666ÿA,Aÿ,A,ÿ666ÿ666ÿ,A,ÿA,Aÿ,ÿÿÿ ÿÿÿ ÿ ÿÿ ÿÿÿ,A,ÿAAAÿ666ÿ666ÿAAAÿ,A,ÿ,ÿÿ ÿ ÿÿ ÿ ÿ ÿÿÿÿÿ###?^^^^^^]]]]]]\\\YYYWWWTTTŒ‡‡ÿojjÿ_j_ÿe[eÿFFFÿC>>ÿ>99ÿ444ÿ###ÿÿÿÿÿ  íõìììì¼  ?###?ÖÖÖæêêêÿêêêÿêêêÿêêêÿéééÿèèèÿçççÿæææÿäääÿãããÿáááÿàààÿÇÇÇÿžžžÿ™™™ÿ”””ÿŒŒŒÿ†††ÿ‚‚‚ÿÿzzzÿwwwÿejeÿdidÿrrrÿrrrÿrrrÿy~yÿ õ$$$ÿ6A6ÿ6A6ÿA,Aÿ,A,ÿ6A6ÿ666ÿ,A,ÿAAAÿ666ÿ666ÿAAAÿ,A,ÿ,A,ÿ6A6ÿ666ÿ666ÿAAAÿ666ÿ666ÿ6A6ÿ,A,ÿ666ÿ6A6ÿ6A6ÿ666ÿAAAÿ,A,ÿ666ÿÿ°°°°ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿûûûÿøøøÿôôôÿðððÿìììÿèèèÿãããÿßßßÿÚÚÚÿÖÖÖÿÒÒÒÿÍÍÍÿÉÉÉÿÆÆÆÿÃÃÃÿ¾¾¾ÿ¼¼¼ÿ¹¹¹ÿ···ÿ´´´ÿ³³³ÿ±±±ÿ±±±ÿ°°°ÿ°°°ÿ¯¯¯ÿ¯¯¯ÿ¯¯¯ÿ¯¯¯ÿ¯¯¯ÿ¯¯¯ÿ$$$°žžž°àààÿÜÜÜÿÜÜÜÿÜÜÜÿÛÛÛÿÛÛÛÿÚÚÚÿÚÚÚÿÙÙÙÿ×××ÿÖÖÖÿÕÕÕÿÒÒÒÿÑÑÑÿÏÏÏÿÌÌÌÿÈÈÈÿÆÆÆÿÂÂÂÿ¾¾¾ÿ¼¼¼ÿ¸¸¸ÿ´´´ÿ¯¯¯ÿ¬¬¬ÿ¨¨¨ÿ¤¤¤ÿ¢¢¢ÿžžžÿ›››ÿ™™™ÿ–––ÿ”””ÿ‘‘‘ÿÿÿŽŽŽÿŒŒŒÿ‹‹‹ÿ‹‹‹ÿŠŠŠÿŠŠŠÿŠŠŠÿŠŠŠÿŠŠŠÿ```ÿ ÎÏ©àÿ¨¨¨ÿÜÜÜÿÜÜÜÿÜÜÜÿÜÜÜÿÛÛÛÿÛÛÛÿÚÚÚÿÚÚÚÿÙÙÙÿ×××ÿÕÕÕÿÔÔÔÿÑÑÑÿÏÏÏÿÌÌÌÿÊÊÊÿÆÆÆÿÃÃÃÿÀÀÀÿ¼¼¼ÿ¸¸¸ÿ´´´ÿ¯¯¯ÿ¬¬¬ÿ¨¨¨ÿ¤¤¤ÿ   ÿžžžÿšššÿ˜˜˜ÿ•••ÿ“““ÿ‘‘‘ÿÿŽŽŽÿŒŒŒÿ‹‹‹ÿ‹‹‹ÿŠŠŠÿŠŠŠÿŠŠŠÿŠŠŠÿŠŠŠÿŠŠŠÿ~m†ÿ>IÿÌžáÿuBÿ²²²ÿÜÜÜÿÜÜÜÿÜÜÜÿ¥¥¥ÿKKKÿÛÛÛÿÚÚÚÿ®®®ÿÑÑÑÿÕÕÕÿÔÔÔÿÑÑÑÿ²²²ÿ»»»ÿÊÊÊÿÆÆÆÿÃÃÃÿÀÀÀÿ›››ÿ™™™ÿ´´´ÿ¯¯¯ÿ¬¬¬ÿ¨¨¨ÿ¤¤¤ÿ   ÿžžžÿšššÿ˜˜˜ÿ•••ÿ“““ÿ‘‘‘ÿÿŽŽŽÿŒŒŒÿ‹‹‹ÿ‹‹‹ÿŠŠŠÿŠŠŠÿŠŠŠÿŠŠŠÿŠŠŠÿ“€šÿ°‹¾ÿ>IÿÆšÙÿc2uÿrH€ÿ²²²ÿÜÜÜÿÜÜÜÿKKKÿ^^^ÿ¤¤¤ÿÔÔÔÿÿ~~~ÿ}}}ÿ“““ÿ¨¨¨ÿÿ}}}ÿ˜˜˜ÿiiiÿxxxÿªªªÿxxxÿŽŽŽÿ´´´ÿ¯¯¯ÿ¬¬¬ÿ¨¨¨ÿ¤¤¤ÿ   ÿžžžÿšššÿ˜˜˜ÿ•••ÿ“““ÿÿÿŽŽŽÿŒŒŒÿ‹‹‹ÿ‹‹‹ÿŠŠŠÿŠŠŠÿŠŠŠÿŠŠŠÿ“€šÿ°‹¾ÿxEŠÿ#e'ÿÉÜÿi4|ÿc2uÿrH€ÿ²²²ÿÜÜÜÿÜÜÜÿ¤¤¤ÿÛÛÛÿÚÚÚÿÀÀÀÿÑÑÑÿÕÕÕÿÔÔÔÿÑÑÑÿÏÏÏÿÌÌÌÿÊÊÊÿÆÆÆÿÃÃÃÿÀÀÀÿ¼¼¼ÿ¸¸¸ÿ´´´ÿ¯¯¯ÿ¬¬¬ÿ¨¨¨ÿ¤¤¤ÿ   ÿžžžÿšššÿ˜˜˜ÿ•••ÿ“““ÿÿÿŽŽŽÿŒŒŒÿ‹‹‹ÿ‹‹‹ÿŠŠŠÿŠŠŠÿŠŠŠÿ“€šÿ°‹¾ÿxEŠÿo8‚ÿ>IÿÉÜÿi4|ÿc2uÿo8‚ÿrH€ÿ²²²ÿÜÜÜÿÛÛÛÿÛÛÛÿÚÚÚÿÙÙÙÿ×××ÿÕÕÕÿÔÔÔÿÑÑÑÿÏÏÏÿÌÌÌÿÊÊÊÿÆÆÆÿÃÃÃÿÀÀÀÿ¼¼¼ÿ¸¸¸ÿ´´´ÿ¯¯¯ÿ¬¬¬ÿ¨¨¨ÿ¤¤¤ÿ   ÿžžžÿšššÿ˜˜˜ÿ•••ÿ“““ÿ‘‘‘ÿÿŽŽŽÿŒŒŒÿ‹‹‹ÿ‹‹‹ÿŠŠŠÿŠŠŠÿ“€šÿ°‹¾ÿxEŠÿo8‚ÿo8‚ÿ>IÿÆšÙÿc2uÿW,hÿc2uÿc2uÿrH€ÿ²²²ÿÛÛÛÿÚÚÚÿÙÙÙÿÙÙÙÿÖÖÖÿÕÕÕÿÔÔÔÿÑÑÑÿÏÏÏÿÌÌÌÿÊÊÊÿÆÆÆÿÂÂÂÿÀÀÀÿ¼¼¼ÿ¸¸¸ÿ´´´ÿ¯¯¯ÿ¬¬¬ÿ¨¨¨ÿ¤¤¤ÿ   ÿžžžÿšššÿ˜˜˜ÿ•••ÿ“““ÿ‘‘‘ÿÿŽŽŽÿŒŒŒÿŒŒŒÿ‹‹‹ÿ‹‹‹ÿ“€šÿ°‹¾ÿxEŠÿo8‚ÿo8‚ÿo8‚ÿ>IÿÉÜÿi4|ÿc2uÿi4|ÿi4|ÿc2uÿrH€ÿ²²²ÿÚÚÚÿÙÙÙÿ×××ÿÖÖÖÿÕÕÕÿÒÒÒÿÑÑÑÿÏÏÏÿÌÌÌÿÈÈÈÿÆÆÆÿÂÂÂÿ¾¾¾ÿ¼¼¼ÿ¸¸¸ÿ´´´ÿ¯¯¯ÿ¬¬¬ÿ¨¨¨ÿ¤¤¤ÿ¢¢¢ÿžžžÿ›››ÿ˜˜˜ÿ•••ÿ”””ÿ‘‘‘ÿÿÿŽŽŽÿŒŒŒÿ‹‹‹ÿ“›ÿ°‹¾ÿxEŠÿo8‚ÿo8‚ÿo8‚ÿo8‚ÿ>IÿÉÜÿi4|ÿc2uÿi4|ÿi4|ÿc2uÿo8‚ÿd;sÿ---ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿ°‹¾ÿ‰\™ÿo8‚ÿo8‚ÿo8‚ÿo8‚ÿo8‚ÿ>IÿpirÚ>Iÿ>Iÿ>Iÿ>Iÿ>Iÿ>Iÿ>Iÿ>Iÿ¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾š>Iÿ>Iÿ>Iÿ>Iÿ>Iÿ>Iÿ>Iÿ>Iÿ 00$ª$$²$º(R ü€' ü€'gnustep-gui-0.24.0/Images/common_TabSelectedRight.tiff0000664000076500007650000000117412224735723022560 0ustar brains99brains99II**€?àOóAÄкL¤$p6ˆDbQ8z±T¬ ÅH¤v=‡E£ð ÔÊN/Ô€º‰^6Lb(£U®Õ²­\¶_2M"o0Í”a)˜F°à ?B'VŠWøUÖ e¨¥³ tF¡›5YGû%.M®ÌâôèÑQþI/g²êåvD‡:£öýÿ$´€$@hsê?%“ÒJcS†5–È]h1|$7 2Y'ÖOúÒˆ”@¡YfÃùï%¯Ó¨7ý Â5¡ À©ñ%hŽêp5*¤øà2ïÚy ®?mÁq©’gþ(^è]=ŪGC›¹½öÉŸÐèô¹-O"+ÊŽêÀ&£‹½Ðh´šmÖ%êö8™PñX¤V  þ $ 9,f@"(=RHH/home/ericwa/guitest/Images/common_TabSelectedRight.tiffCreated with The GIMPgnustep-gui-0.24.0/Images/common_ToolbarClippedItemsMark.tiff0000664000076500007650000000417411711647260024124 0ustar brains99brains99MM*È€ P8$ „BaP¸d6ˆDbQ8¤V-ŒFcQ¸ä4g3@Ìñ8ü C‘Ça«¸š‘Cå)t a(•BB09˜J›€%3©äA¡Î`³¸ö1…Sé}B•K·`u*D.¥ZW*Ԥ̂ï‘`lØ]–Mg´Úç6àœhZ VÈUÒíx^€Èíúáy¹_lÐ, J»".7¸~G'ƒ«ÔpñZ–3ŸÐhtZ=&—M§Ð@@¦ 3®Àâê(=RSòJ/Users/ericw/common_ToolbarClippedItemsMarkx1.tiffHH€ P8$ „BaP¸d6ˆDbQ8¤V-ŒFcQ¸äv=HdR9$–M'”JeR¹d¶]/˜LfS9¤Öm7œNgS¹äö}? PhT:%G¤RiTºe6O¨TjU:¥V­W¬VkUºåv½_°XlV;%–Íg´ZmV»e¶Ýo¸\nW;¤4~ÜÀ07ýÖ”Ž`l8šÖ ’`mø:ýA@Ï02œ =CÀÜö0Œ ß7@Øð4 •œ h¬¤ |@Óˆª¶ Ÿt0]òµŸñº‰˜š”‘ w¸3Þ–ÕíjàÈj`ïèËIhq&CÝÏ'—{@Ò°4\ ×W@Ï3 ¾À–øGʇˆˆO: z¸èЏ:ÈÀû;h^H¤ÿ¦û‚ˆ2 z=ObvªàûäŒ(îƒ/(.pÔ8—À¨@(˜‚Á' GtS bô) esø±º\"Ãèu ‡š! PZwªá t*pÂkJIh aİžH$‘¨à«„²¨,EÈÛÈ6r ¡*l6ˆúªYÏ϶‹GâÎ>ãl(.nõëݨOÛnò‚jŽÒ{žèå 8S@~‚PdåRÃ*Á¯EòHYy´|R)Öø’ÈòkÂx`€Ä«à`J ›rb<¨ƒÑthñÖß\î T/Zm*á‡rwüêÄõ¼7x‰G÷_[nùÈ.¬ýõ¦š¯ìQ ¬5èW½µ¿^Ÿ¨ä=o•á Z±m±ÊµÑÖÛ_"6tÚ»|úˆƒã|/½ì¸B.ÓðÈ*à­Ã­ùHHÜpâáÀ ª³ yø¬a@weYȾ¬ÁÈ+¯ƒ$ Pº¨,CœG`žAÖ¬2Sðº*à¨BÜÀWÀMÂè^CSýJðØð<³€U"~nÄ ”Pzíˆä5*:Ø—_ø|àð½Âª˜¡ FD)c€@Ädql…·€lÈ!‰„m±ñRUÀr© Š…0Þ¸HŽ„4§é@ŽÓñe…É"¬ÃKç¡<1À$Yf„35¢uˆ– J ®b#Àz gQ©4«¥ 085€@„ÌZ,À ‡#Z9Šòä‘L€À[Ùlé.gÌÉ­5æÄÙ›SnnMÙ½7ç@ pH,„¡pÈl:ˆÄ¢qH¬Z/ŒÆ£qÈìz? ȤrI,šO(”Ê¥rÉlº_0˜Ì¦sI¬Úo8œÎ§sÉìú@ Ð¨tJ-H¤Ò©tÊm:ŸP¨ÔªuJ­Z¯X¬Ö«uÊíz¿`°Ø¬vK-šÏh´Ä` PP( 30úPPdl(=RSt/Users/ericw/common_ToolbarClippedItemsMarkx4.tiff$ $ gnustep-gui-0.24.0/Images/common_DimpleHoriz.tiff0000664000076500007650000000301611576470225021630 0ustar brains99brains99MM*P€WúÖ€ "À @˜ÿ€ @°TEŸä,$€à[üˆ€#-:)þY‡€( :BGX`(=RS¬a.tiffCreated with The GIMPHH€ P8 ~€ Xb078˜g€ üH`g@'‘H[ à)Bã¢è$‚Çc°¸#üG@ Àß…G%0öP  Oa@pPÿ€ao×óàó~?FÑp¥ š6©Àôy¿ÁÀp¸Ö`ð*ãÌå~;DÔxÛ›Û h„_ÀÀ6ð¿« XP¸û;ÀNë€H/½€$ˆº„° €'þS, Ÿà`r€ÿ¾À/wóÝ:¶å𶼞•¿Â žËh ÊîoðFö=~^Ú u²¸€ €Ÿ> ¿Â{°>åtû`p<Ÿçè| oØš Å'€ Ï›bÈ2Kšê€ Qü´Îz€'(lÀb Ѓp ‹æ ‹hÈ. còî?«\Ÿ18t&±d)¡¬ €Äj‚¤t¾àxrî§€p €Pj™r`'Ïà;(Êr¨-Ç'û Ù¿Rë(Ü)èâ} Òš“L_ŸË˜AÂgô«( $NòØÃéâ|ŸÉò€{'jIplÀ )9‚@';-›f8 z\­æôϽeœ‰¦’2Õ5€ VŽ«-^(UÝ¥¯¹€N áXõL¤ê‚Gý#)ö‚ܧ@ ®l‡ÏJÕƒ'èJ`4ðdêГª¤±ªFŸgñâš#¨ž—°ÐH Gð8ƒ‡ø1GcæÙµÖ’# m¡¸Hb5(BAPàéþ ßV]dàIêµhÀÀ0Ф$Aˆ(e¹™ú ßcf\ëÄüŸ=ôès†`l0èª&‚¦@B—a@F\æ Ò•¨È3:ù#&áž#håp)Z((^(J:ƒ @ƒ“…c-OˆùôläælI‡†! †%ƒaˆ* Êêœà)˜ã6˜ v„¤( ¢ªhDÀÈ(1>Ð=RSb.tiffCreated with The GIMP$ $ ImageMagick 6.6.2-6 2010-09-17 Q16 http://www.imagemagick.orggnustep-gui-0.24.0/Images/GNUstepMenuImage.tiff0000664000076500007650000000114610074367046021147 0ustar brains99brains99II*Pxœ•ÐAKÂ`ÇñŸën4±Kx‘¨ƒÌáEébwYƒ žºõb:d30„: { ¦b ÄN!½€ØÁÄû=Â"k†þáÏžñݳ ˜›M:#‹vH¢Wz KzÃß9¤+ÚŠ¹'æÎéöÇÞy´är9(ŠI’>4M»h6›ÏÜV¨KÛ ÎA§Óiš³õh4‚a.OézQó»S«ÕDwOG«t®ëŠÎ§½h/‘Hˆï˜ëÚí6²Ùì÷õp8ÝíG{år­Vë¿ãÑëõDwGÇ«t¶m‹î„n–í¦Ó),ËL´»L×ï÷‘ÏçE÷’ÉdôF£±‘L&!Ë2t]m‚ @±X­è>i­P( ^¯#NǾ›ïû¨V«³ó8Q7ûñªª¢R© T*!•Ja<c0Àqxž‡0 £GM¾%[s#þ.²€  6@GV^(=R/home/aperez/GNUstep-small.tiffHHgnustep-gui-0.24.0/Images/common_RightTabStop.tiff0000664000076500007650000000110607453703040021743 0ustar brains99brains99II*ÿÿÿÿÿÿþæ 1î @6>(R/lin3/home/fred/GNUstep/common_RightTabStop.tiffCreated with The GIMPHHgnustep-gui-0.24.0/Images/common_ArrowUpH.tiff0000664000076500007650000000201611576466755021125 0ustar brains99brains99MM*D€ P8©þVÁ!P¢«ýW … ʰTˆÀá°H|f' ‹Ä ‘¸ŒvŒÅ£Wüf8”K Qh   .6 <LT(=RSöa.tiffCreated with The GIMPHH€ P8$ ƒD%[‚ˆDbQ8Uo $Å#Q¸äª"7`b5[z;'”AJ« »U‘¥38áT`gÁÆ*¶„Ò}*²€X;-V6ŸÒeC€"9U²)T¢«\(ˆ¶bšœø«L§E**ìtª6hÓj®«ÙceR' ªØ(œÙ dí°žá|ˆc+i¡)WÄBmPfhçðù®.•ŽÈdoÙLµ'1š¸â1@ e—A|¿f÷'NW7S*€ àýVÂÜ€`þqÂ*ßÔ’©H­ÎA jµu{…˜ t`n­·.SÍçö Ý>¬žüèv|PNàco*À Ï\ ˆ«^ÜÀ`WꃳéV~¢‚¨¸oú .•e"$*¿gAHyìÐ*\+•eb*€ ¸Cè‰àô•gÚ3€ÄRŠ Y2‚ ®ç Æhœ.¹Hðžê6(eŒr6 ¤Œ€.*ŠÀS'£¢¸«’Â8z $$ àè\$šþ(=RSb.tiffCreated with The GIMP$ $ gnustep-gui-0.24.0/Images/common_TabUnSelectedJunction.tiff0000664000076500007650000000136212224735723023576 0ustar brains99brains99II*œ€:[ΗúÁd–ZÎhˆDbQ8‚A>‹ÌGú±T¬ˆ ÖLf"Ìîw&”R´R]‹F#QÈx= ˆ:í”ÕÄ3hR©d¾1ŒÆßëº`äðy&ñ@ËH³]¶YnvªÝ‹ ‰Ò&t¶:îœä¨Ä*qF«]ª€?ÜOåë¢V¢–Ã×W°üÿVªÕ ¥®^3N§Ó²hs5o&Ø©VV8ÌðsK°ÒêªÑˆgH(’; ¹§ßˆ¯õu5ÿPÍGèÑ™P¬Tfw@¶ô»²Ùí4lÞΪÆYh4'÷ÿ4ÈZ/.W»ÇgRÙuáîG3fpð378tT* kørþ/hN¡S©¥»EnLOÅ ÐÐ6òö;/r j»«ƒÀ?0H…!X4‡œì,"/>A–ly¢“%,`@,fÂIÄ(‰'Fɘ6ãØf=IhAÍ-PœN‰3¦!šÐ’ËòO¿oé3=±Ü·g|œL¼d€g!ȯóšçIRÊ$€€þ – >žÜ@”†Ž(=RHH/home/ericwa/guitest/Images/common_TabUnSelectedJunction.tiffCreated with The GIMPgnustep-gui-0.24.0/Images/common_copyCursor.tiff0000664000076500007650000000055107402765730021554 0ustar brains99brains99II*„ $h°`þƒ‡ &l¸þ#†`´(á#FŠ.À8ac…L&^’Љ’‡N–*Bì´AÓJœ!ÇÀ£'€”Yƒ$Ë#_‚Q£‰R¬t‰|Y‹—8~ÚJóUKU#k­ u3Ô¯^®f•¨ J„¯' >  #F€|=R/home/wim/pixmaps/copy_cursor.tiffgnustep-gui-0.24.0/Images/common_TabDownSelectedToUnSelectedJunction.tiff0000664000076500007650000000130612224735723026400 0ustar brains99brains99II*b€+JÀ „AJeRœ&oº[@\LÿƒÀ øäv2 b‘gûA¦Ç½ÝXÔz] H¢±uÛvy9P‰l¾|…”ä²p u°æŽOgðñèÐz BÏù´¡Ìð¤CéT¸MÿVªÕ un¸ó¼À‘ÿ5›ÎgvXrM§Ôji¥\¬‘ë5.‚ÿAb@÷{t<°qÜ,zc#‹—ó@tÉÒn¸hcý]§âPOöŽ´p/1äÁæ†3£^*'úE@Œœ 'P'ƒÌ&=´+]ÒéÕÀŸV/ìk5ÈàV)èyà ¼Ï{¿àðゲHíþEqã­®Þ7Ãôºiw`^ƒP%‡à !8–¼©#ôê¡«² ÿáx‚ €sèŸð낷΄âBIyÒo0üK¡èþ \ Ld°@ZLT(=RHH/home/ericwa/guitest/Images/common_TabDownSelectedToUnSelectedJunction.tiffCreated with The GIMPgnustep-gui-0.24.0/Images/common_ProgressIndeterminate_3.tiff0000664000076500007650000000376611271671115024146 0ustar brains99brains99II*È™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™þŽ Q”@Àæî(/home/fred/GNUstep/Patches/GS_NSProgresIndie/common_ProgressIndeterminate_3.tiffHHgnustep-gui-0.24.0/Images/common_CloseBrokenH.tiff0000664000076500007650000000164410000561761021710 0ustar brains99brains99II*Hÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿaeaÿaeaÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿaeaÿaeaÿÿÿÿÿÿÿÿÿaeaÿaeaÿaeaÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿaeaÿaeaÿaeaÿÿÿÿÿÿÿÿÿÿÿÿÿaeaÿaeaÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿaeaÿaeaÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿaeaÿaeaÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿaeaÿaeaÿÿÿÿÿÿÿÿÿÿÿÿÿaeaÿaeaÿaeaÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿaeaÿaeaÿaeaÿÿÿÿÿÿÿÿÿaeaÿaeaÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿaeaÿaeaÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþ  & P.~@@”œ(R/usr/home/stoyan/new/GNUstep/CVS.build/core/gui/Images/common_CloseBrokenH.tiffCreated with The GIMPHHgnustep-gui-0.24.0/Images/page_portrait.tiff0000664000076500007650000002246610056113104020662 0ustar brains99brains99II*$???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿçííÿçîîÿçïïÿçííÿèèèÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿ???ÿ€???ÿêêêÿëëëÿëëëÿêêêÿêêêÿëëëÿëëëÿëëëÿìììÿëëëÿëëëÿêêêÿêêêÿêêêÿëëëÿëëëÿêêêÿëëëÿêêêÿëëëÿëëëÿëëëÿëëëÿëëëÿëëëÿêêêÿêêêÿêêêÿêêêÿêêêÿ???ÿ @???ÿêêêÿêêêÿéééÿêêêÿêêêÿåååÿéééÿìììÿãããÿìììÿìììÿìììÿìììÿìììÿçççÿêêêÿìììÿéééÿëëëÿéééÿìììÿéééÿêêêÿëëëÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿ???ÿ @???ÿçôôÿ˜¥¥ÿŽ››ÿÛèèÿèõõÿ¹ÆÆÿ«¸¸ÿ¬¹¹ÿ¡®®ÿ£°°ÿ®»»ÿ¾ËËÿ³ÀÀÿ·ÃÃÿÂÏÏÿ±½½ÿÁÎÎÿ¹ÆÆÿ·ÄÄÿ¶ÃÃÿ¬¹¹ÿ¨µµÿ ­­ÿ°½½ÿ»ÈÈÿæóóÿê÷÷ÿéööÿéööÿéööÿ???ÿ @???ÿðššÿÓ~~ÿÍxxÿì——ÿñœœÿàŠŠÿÙ„„ÿÎzzÿà‹‹ÿÆrrÿÉttÿÙ„„ÿÔÿÔ||ÿåÿÕ}}ÿÛƒƒÿÜ„„ÿÚ‚‚ÿÞ††ÿÙÿÖ~~ÿÒzzÿÕ}}ÿÛƒƒÿñ™™ÿò™™ÿñ™™ÿñ™™ÿñ™™ÿ???ÿ @???ÿÿ©©ÿÿ««ÿÿ««ÿÿ®®ÿÿµµÿÿ··ÿÿ··ÿÿ››ÿÿ©©ÿÿ¦¦ÿÿ¨¨ÿÿ©©ÿÿ««ÿÿ¹¹ÿÿ¹¹ÿÿººÿÿººÿÿººÿÿººÿÿººÿÿººÿÿººÿÿººÿÿººÿÿººÿÿ¹¹ÿÿ¹¹ÿÿ¹¹ÿÿ¹¹ÿÿ¹¹ÿ???ÿ @???ÿÿ÷÷ÿÿööÿÿððÿÿúúÿÿÿÿÿÿÿÿÿÿÿÿÿÿååÿÿùùÿÿüüÿÿýýÿÿþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿòøøÿøþþÿúÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿÿÿÿÿÿÿÿÿçççÿÑÑÑÿáááÿßßßÿÕÕÕÿãããÿßßßÿéééÿØØØÿÝÝÝÿÓÓÓÿòòòÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿOOOÿ¿¿¿ÿÂÂÂÿ¿¿¿ÿºººÿ¹¹¹ÿµµµÿ´´´ÿ¯¯¯ÿåååÿOOOÿÿÿÿÿÿÿÿÿñññÿáááÿìììÿêêêÿåååÿìììÿáááÿåååÿÖÖÖÿÏÏÏÿÍÍÍÿéééÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿOOOÿÄÄÄÿÁÁÁÿ¿¿¿ÿ¿¿¿ÿºººÿ···ÿµµµÿ´´´ÿÓÓÓÿOOOÿÿÿÿÿÿÿÿÿçççÿÝÝÝÿÓÓÓÿèèèÿæææÿäääÿðððÿÐÐÐÿàààÿâââÿïïïÿÏÏÏÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿOOOÿ¹¹¹ÿ¿¿¿ÿ¿¿¿ÿ¬¬¬ÿ¢¢¢ÿµµµÿ¹¹¹ÿ···ÿ°°°ÿOOOÿÿÿÿÿÿÿÿÿçççÿéééÿåååÿÝÝÝÿäääÿôôôÿäääÿèèèÿßßßÿßßßÿåååÿßßßÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿOOOÿ•••ÿ£££ÿªªªÿÿŽŽŽÿšššÿ˜˜˜ÿ›››ÿÿOOOÿÿÿÿÿÿÿÿÿâââÿæææÿßßßÿ×××ÿÏÏÏÿêêêÿÛÛÛÿÝÝÝÿÍÍÍÿÖÖÖÿØØØÿ×××ÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿOOOÿšššÿŽŽŽÿÿ‹‹‹ÿ“““ÿ‘‘‘ÿ‘‘‘ÿ†††ÿ†††ÿOOOÿÿÿÿÿÿÿÿÿÛÛÛÿáááÿÓÓÓÿéééÿÓÓÓÿñññÿÔÔÔÿÛÛÛÿäääÿáááÿòòòÿåååÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿOOOÿ£££ÿŒŒŒÿŒŒŒÿÿ˜˜˜ÿšššÿ   ÿŽŽŽÿÿOOOÿÿÿÿÿÿÿÿÿÙÙÙÿéééÿðððÿ×××ÿàààÿ×××ÿÔÔÔÿÔÔÔÿÝÝÝÿæææÿßßßÿÝÝÝÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿOOOÿ˜˜˜ÿÿŒŒŒÿÿ‰‰‰ÿ‰‰‰ÿ‹‹‹ÿ†††ÿŒŒŒÿOOOÿÿÿÿÿÿÿÿÿäääÿãããÿíííÿØØØÿØØØÿÚÚÚÿÑÑÑÿÙÙÙÿßßßÿëëëÿäääÿ×××ÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿÿÿÿÿÿÿÿÿèèèÿÞÞÞÿóóóÿÝÝÝÿÑÑÑÿåååÿÖÖÖÿÞÞÞÿÞÞÞÿðððÿîîîÿåååÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿåååÿÛÛÛÿÖÖÖÿÛÛÛÿùùùÿãããÿáááÿÎÎÎÿáááÿãããÿòòòÿÙÙÙÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿæææÿÙÙÙÿÐÐÐÿàààÿÛÛÛÿÜÜÜÿÕÕÕÿíííÿêêêÿØØØÿÜÜÜÿâââÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿäääÿäääÿÞÞÞÿëëëÿâââÿÝÝÝÿÜÜÜÿòòòÿâââÿßßßÿäääÿïïïÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿüüüÿèèèÿåååÿóóóÿñññÿùùùÿéééÿåååÿðððÿôôôÿðððÿ÷÷÷ÿêêêÿÿÿÿÿÿÿÿÿâââÿîîîÿÐÐÐÿÙÙÙÿáááÿÙÙÙÿÝÝÝÿìììÿàààÿæææÿØØØÿãããÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿøøøÿØØØÿÈÈÈÿåååÿÍÍÍÿäääÿÝÝÝÿÅÅÅÿÍÍÍÿÏÏÏÿÃÃÃÿìììÿÊÊÊÿÿÿÿÿÿÿÿÿåååÿÓÓÓÿäääÿØØØÿÖÖÖÿßßßÿôôôÿÒÒÒÿÔÔÔÿÚÚÚÿíííÿíííÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿêêêÿîîîÿïïïÿòòòÿìììÿãããÿôôôÿØØØÿÓÓÓÿèèèÿæææÿïïïÿÿÿÿÿÿÿÿÿßßßÿÓÓÓÿÔÔÔÿÎÎÎÿÒÒÒÿàààÿóóóÿìììÿëëëÿðððÿõõõÿ÷÷÷ÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÒÒÒÿÑÑÑÿâââÿ÷÷÷ÿéééÿÏÏÏÿÞÞÞÿáááÿÖÖÖÿÜÜÜÿÚÚÚÿìììÿÿÿÿÿÿÿÿÿÝÝÝÿÐÐÐÿÝÝÝÿÌÌÌÿØØØÿÎÎÎÿìììÿÿÿÿÿÿÿÿÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿüüüÿÚÚÚÿàààÿÛÛÛÿ×××ÿØØØÿÒÒÒÿìììÿéééÿàààÿÔÔÔÿÛÛÛÿÜÜÜÿÿÿÿÿÿÿÿÿáááÿåååÿÝÝÝÿÚÚÚÿÝÝÝÿÖÖÖÿìììÿãããÿØØØÿËËËÿÜÜÜÿäääÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿøøøÿÈÈÈÿèèèÿÜÜÜÿÚÚÚÿÓÓÓÿßßßÿóóóÿöööÿãããÿÍÍÍÿÏÏÏÿ×××ÿÿÿÿÿÿÿÿÿéééÿãããÿñññÿéééÿåååÿèèèÿâââÿëëëÿäääÿïïïÿàààÿâââÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿøøøÿ×××ÿæææÿÆÆÆÿàààÿêêêÿöööÿãããÿØØØÿØØØÿ×××ÿØØØÿéééÿÿÿÿÿÿÿÿÿßßßÿÓÓÓÿäääÿÛÛÛÿÙÙÙÿÕÕÕÿÕÕÕÿàààÿÜÜÜÿëëëÿÐÐÐÿÖÖÖÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿúúúÿÌÌÌÿÖÖÖÿÉÉÉÿÌÌÌÿäääÿòòòÿÝÝÝÿÊÊÊÿÔÔÔÿºººÿÕÕÕÿÓÓÓÿÿÿÿÿÿÿÿÿéééÿØØØÿÇÇÇÿÕÕÕÿìììÿáááÿâââÿàààÿáááÿÇÇÇÿàààÿÎÎÎÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿþþþÿæææÿèèèÿîîîÿóóóÿöööÿéééÿæææÿêêêÿúúúÿðððÿãããÿæææÿÿÿÿÿÿÿÿÿæææÿÛÛÛÿíííÿôôôÿÝÝÝÿßßßÿãããÿÝÝÝÿÚÚÚÿâââÿéééÿÝÝÝÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿüüüÿÐÐÐÿÌÌÌÿÁÁÁÿÊÊÊÿàààÿËËËÿÝÝÝÿÑÑÑÿäääÿçççÿºººÿÌÌÌÿÿÿÿÿÿÿÿÿØØØÿÎÎÎÿàààÿëëëÿÜÜÜÿÜÜÜÿÐÐÐÿÏÏÏÿ×××ÿÙÙÙÿêêêÿ×××ÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿþþþÿÔÔÔÿÔÔÔÿôôôÿâââÿãããÿØØØÿÒÒÒÿßßßÿ×××ÿÝÝÝÿáááÿðððÿÿÿÿÿÿÿÿÿÙÙÙÿÎÎÎÿÓÓÓÿÓÓÓÿßßßÿ×××ÿÚÚÚÿÎÎÎÿÖÖÖÿÊÊÊÿòòòÿÓÓÓÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿþþþÿáááÿàààÿýýýÿôôôÿèèèÿÕÕÕÿÏÏÏÿ×××ÿäääÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿçççÿàààÿâââÿçççÿÜÜÜÿÜÜÜÿäääÿâââÿßßßÿÝÝÝÿÛÛÛÿÝÝÝÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿüüüÿÒÒÒÿÑÑÑÿÕÕÕÿÑÑÑÿÚÚÚÿÕÕÕÿ÷÷÷ÿÌÌÌÿÕÕÕÿõõõÿÇÇÇÿçççÿÿÿÿÿÿÿÿÿãããÿÙÙÙÿÔÔÔÿëëëÿÙÙÙÿáááÿàààÿÜÜÜÿÙÙÙÿÛÛÛÿÓÓÓÿæææÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿýýýÿåååÿãããÿìììÿÜÜÜÿãããÿæææÿöööÿßßßÿàààÿóóóÿâââÿîîîÿÿÿÿÿÿÿÿÿãããÿÐÐÐÿØØØÿãããÿßßßÿÛÛÛÿÝÝÝÿÑÑÑÿáááÿÕÕÕÿÚÚÚÿÜÜÜÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿüüüÿ×××ÿÖÖÖÿßßßÿÜÜÜÿßßßÿÙÙÙÿ÷÷÷ÿËËËÿéééÿñññÿÝÝÝÿÈÈÈÿÿÿÿÿÿÿÿÿåååÿÛÛÛÿßßßÿÛÛÛÿßßßÿâââÿóóóÿ×××ÿòòòÿãããÿâââÿØØØÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿüüüÿÝÝÝÿÜÜÜÿÜÜÜÿÙÙÙÿÝÝÝÿÙÙÙÿ÷÷÷ÿÉÉÉÿÝÝÝÿòòòÿÖÖÖÿæææÿÿÿÿÿÿÿÿÿÜÜÜÿØØØÿÚÚÚÿÙÙÙÿæææÿÕÕÕÿçççÿÚÚÚÿÖÖÖÿàààÿÛÛÛÿåååÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿüüüÿÞÞÞÿäääÿãããÿäääÿèèèÿåååÿìììÿÛÛÛÿÞÞÞÿÝÝÝÿãããÿôôôÿÿÿÿÿÿÿÿÿÞÞÞÿÙÙÙÿÕÕÕÿÖÖÖÿÝÝÝÿÒÒÒÿØØØÿÑÑÑÿÕÕÕÿðððÿèèèÿÚÚÚÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿùùùÿÌÌÌÿÚÚÚÿÔÔÔÿÞÞÞÿäääÿÚÚÚÿàààÿáááÿÔÔÔÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿáááÿÛÛÛÿÚÚÚÿÙÙÙÿÝÝÝÿßßßÿÛÛÛÿÍÍÍÿÛÛÛÿõõõÿêêêÿÖÖÖÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ???ÿ @???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ @€                               @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@þ00Ú$ Câ$@$&%.%(R/home/heron/Development/gnustep/core/gui/Images/page_portrait.tiffHHgnustep-gui-0.24.0/Images/common_StepperUp.tiff0000664000076500007650000000062412227054647021333 0ustar brains99brains99II*d€* P8$TU?áP¸d0«Á¢PøL*FQAb‘ Ô~{D ‡Êx·ÆàjPÉåT{JdP"¸Ö¢“Ì¢°"âV0GM(kƒƒE ´ºe6œ€€þ  ;F‚@\6>(HH/home/ericwa/gnustep/core/gui/Images/common_StepperUp.tiffCreated with GIMPgnustep-gui-0.24.0/Images/common_ToolbarShowColorsItem.tiff0000664000076500007650000002253607726372062023660 0ustar brains99brains99II*$& &\\‘$ ‘½)½Ý'Ýò%òýýýýò#òÝ'ݽ(½‘ #‘\\& & r.rÈKÈñSñÿPÿÿIÿÿ@ÿÿ8ÿÿ/ ÿÿ' ÿÿ"%ÿÿ".ÿÿ 7ÿÿ?ÿÿHÿÿPÿñRñÈJÈr.r   ’F ’ímíÿoÿÿhÿÿaÿÿZ#ÿÿS$ÿÿI&ÿÿB'ÿÿ8+ÿÿ1+ÿÿ,/ÿÿ,7ÿÿ(Aÿÿ(Iÿÿ&Rÿÿ$Yÿÿ!`ÿÿgÿÿnÿímí’ G’   |F|ííÿ…ÿÿ~ÿÿx"ÿÿr%ÿÿk)ÿÿd,ÿÿ\/ÿÿT2ÿÿL2ÿÿB2ÿÿ95ÿÿ69ÿÿ3Aÿÿ3Lÿÿ3Sÿÿ/\ÿÿ.cÿÿ*jÿÿ'qÿÿ#xÿÿÿÿ…ÿíí| G| **Ê} Êþ˜þÿ“ÿÿ"ÿÿ‡&ÿÿ+ÿÿ{/ÿÿt3ÿÿm6ÿÿe7ÿÿ^;ÿÿV<ÿÿM<ÿÿB<ÿÿ=Aÿÿ=Lÿÿ=Uÿÿ<]ÿÿ9dÿÿ6mÿÿ4tÿÿ0zÿÿ,ÿÿ(ˆÿÿ#Žÿÿ”ÿþ™þÊ~Ê**Z?Zò¥òÿ¨ÿÿ¢ÿÿ%ÿÿ–+ÿÿ‘/ÿÿŠ4ÿÿ…8ÿÿ~<ÿÿv?ÿÿpCÿÿhDÿÿ_GÿÿXGÿÿMGÿÿGLÿÿGWÿÿG^ÿÿEgÿÿCoÿÿ@vÿÿ=~ÿÿ9…ÿÿ5‹ÿÿ1’ÿÿ,—ÿÿ&žÿÿ!£ÿÿ¨ÿò¥òZ?ZjPjö´öÿ¶ÿÿ±!ÿÿ«(ÿÿ¥.ÿÿŸ3ÿÿ™8ÿÿ”>ÿÿAÿÿ‡Eÿÿ€IÿÿyLÿÿqNÿÿiQÿÿaRÿÿXRÿÿRWÿÿRaÿÿRhÿÿNqÿÿLyÿÿI€ÿÿF‡ÿÿBŽÿÿ>•ÿÿ9šÿÿ4¡ÿÿ/¥ÿÿ)«ÿÿ#±ÿÿ¶ÿöµöjQjjUjúÄúÿÃÿÿ¾!ÿÿ¹)ÿÿ´0ÿÿ®6ÿÿ©;ÿÿ¢AÿÿœFÿÿ–KÿÿOÿÿŠSÿÿƒVÿÿ{XÿÿsYÿÿk]ÿÿb]ÿÿ]aÿÿ]jÿÿ[sÿÿYzÿÿV‚ÿÿS‰ÿÿO‘ÿÿK˜ÿÿGÿÿB£ÿÿ<©ÿÿ6¯ÿÿ1´ÿÿ*¹ÿÿ#¿ÿÿÄÿúÆújUjZMZöÎöÿÑÿÿÌ!ÿÿÇ(ÿÿÂ0ÿÿ½7ÿÿ·>ÿÿ²Dÿÿ¬Jÿÿ¦Oÿÿ Tÿÿ™Xÿÿ“\ÿÿŒ_ÿÿ„bÿÿ}cÿÿsfÿÿlfÿÿhlÿÿgsÿÿd}ÿÿc„ÿÿ`Œÿÿ]”ÿÿY›ÿÿU¡ÿÿP¦ÿÿJ­ÿÿE²ÿÿ?¸ÿÿ8¾ÿÿ1Ãÿÿ*Èÿÿ$ÍÿÿÒÿöÏöZNZ*&*òÖòÿÞÿÿÙ!ÿÿÔ(ÿÿÏ/ÿÿÊ7ÿÿÅ=ÿÿÀEÿÿºLÿÿµRÿÿ¯Wÿÿ©]ÿÿ£aÿÿœeÿÿ•hÿÿŽjÿÿ†nÿÿ~oÿÿuqÿÿrtÿÿo}ÿÿn†ÿÿlŽÿÿi–ÿÿfÿÿb¤ÿÿ^©ÿÿX°ÿÿSµÿÿL»ÿÿFÁÿÿ?Æÿÿ8Ëÿÿ1Ñÿÿ*Ôÿÿ#ÛÿÿàÿòØò*&*ʾ Êÿëÿÿæÿÿá)ÿÿÝ0ÿÿØ7ÿÿÒ>ÿÿÍFÿÿÈMÿÿÃSÿÿ¾Zÿÿ¸`ÿÿ³eÿÿ¬jÿÿ¦nÿÿŸsÿÿ—vÿÿxÿÿˆxÿÿ~xÿÿy~ÿÿyˆÿÿxÿÿu˜ÿÿs ÿÿo¦ÿÿk¬ÿÿf³ÿÿa¹ÿÿ[¿ÿÿUÄÿÿMÉÿÿGÎÿÿ?Óÿÿ8Ùÿÿ1Þÿÿ)ãÿÿ!èÿÿìÿÊ¿Ê|{|þ÷þÿóÿÿî&ÿÿé-ÿÿä7ÿÿß=ÿÿÛEÿÿÖNÿÿÑVÿÿË[ÿÿÆaÿÿÁhÿÿ¼nÿÿ¶tÿÿ¯xÿÿ©{ÿÿ¡ÿÿ™‚ÿÿ’ƒÿÿˆƒÿÿƒˆÿÿƒ’ÿÿ‚šÿÿ¢ÿÿ|ªÿÿx¯ÿÿtµÿÿn¼ÿÿiÂÿÿcÈÿÿ\ÌÿÿVÒÿÿN×ÿÿFÜÿÿ?áÿÿ7æÿÿ/ëÿÿ'ðÿÿôÿþùþ|||  êííÿþÿÿû#ÿÿö*ÿÿò4ÿÿì;ÿÿçEÿÿãLÿÿÞSÿÿÙ]ÿÿÔdÿÿÏjÿÿÉpÿÿÄwÿÿ¿{ÿÿ¸ÿÿ²…ÿÿ«‰ÿÿ£Šÿÿ›Žÿÿ’Žÿÿ“ÿÿœÿÿ‹¤ÿÿ‰«ÿÿ…³ÿÿ¹ÿÿ|ÀÿÿvÅÿÿqÊÿÿkÐÿÿdÕÿÿ]ÚÿÿUàÿÿMåÿÿEéÿÿ=ïÿÿ5óÿÿ,ùÿÿ$ýÿÿÿÿêíí ‰’’óÿÿøÿÿþÿ(ÿÿþ0ÿÿú8ÿÿõBÿÿðJÿÿëSÿÿæZÿÿâaÿÿÜkÿÿ×sÿÿÒyÿÿÍ~ÿÿÇ…ÿÿŠÿÿ»Žÿÿµ“ÿÿ®•ÿÿ¥˜ÿÿ˜ÿÿ˜žÿÿ—¥ÿÿ”®ÿÿ‘µÿÿ޼ÿÿŠÂÿÿ…ÈÿÿÎÿÿyÓÿÿrÙÿÿkÞÿÿcãÿÿ\éÿÿSíÿÿJòÿÿC÷ÿÿ:üÿÿ1ÿÿþ)ÿÿøÿÿóÿÿ‰ ’’Öííëÿÿðÿ"ÿõÿ,ÿúÿ4ÿÿÿ>ÿÿýGÿÿøPÿÿóXÿÿîaÿÿéhÿÿåqÿÿàzÿÿÚÿÿÕ†ÿÿÐŒÿÿÊ’ÿÿĘÿÿ¾›ÿÿ·Ÿÿÿ¯ ÿÿ§£ÿÿ¢¨ÿÿ ¯ÿÿž¸ÿÿ›¿ÿÿ—Åÿÿ’ËÿÿŒÑÿÿ†×ÿÿ€ÜÿÿyâÿÿqçÿÿjëÿÿaðÿÿZõÿÿPúÿÿHÿÿÿ?ÿÿú6ÿÿõ-ÿÿð$ÿÿëÿÿÖííarrÞÿÿãÿÿèÿ&ÿìÿ0ÿòÿ:ÿöÿCÿüÿLÿÿþVÿÿü^ÿÿögÿÿòoÿÿíwÿÿèÿÿãˆÿÿÞÿÿÙ•ÿÿÓ›ÿÿΡÿÿÈ¥ÿÿÁ©ÿÿ¹©ÿÿ±­ÿÿ­±ÿÿ©ºÿÿ¨Áÿÿ¤ÈÿÿŸÏÿÿšÔÿÿ”ÛÿÿŽàÿÿ‡åÿÿêÿÿxïÿÿoôÿÿhùÿÿ_þÿÿVÿÿüLÿÿöCÿÿò;ÿÿì2ÿÿè(ÿÿãÿÿÞÿÿarr£È ÈÕÿÿÚÿ ÿàÿ*ÿäÿ4ÿêÿ=ÿîÿGÿôÿQÿøÿZÿýÿcÿÿþlÿÿúuÿÿõ~ÿÿð…ÿÿëÿÿæ–ÿÿáÿÿÜ£ÿÿÖ©ÿÿÑ­ÿÿʲÿÿôÿÿ¹µÿÿ´ºÿÿ´Äÿÿ²Ëÿÿ®Ñÿÿ©×ÿÿ¢Þÿÿœãÿÿ•èÿÿŽíÿÿ…òÿÿ}öÿÿuýÿÿmÿÿýdÿÿøZÿÿôQÿÿîHÿÿê>ÿÿä5ÿÿà,ÿÿÚ"ÿÿÕÿÿ£ ÈÈ&&½ññÍÿÿÑÿ$ÿ×ÿ-ÿÜÿ7ÿáÿAÿæÿLÿìÿTÿðÿ^ÿöÿfÿúÿqÿþÿyÿÿýƒÿÿøŒÿÿó”ÿÿîÿÿê¤ÿÿä«ÿÿß±ÿÿÙ·ÿÿÓ»ÿÿÌ¿ÿÿÃÀÿÿ¾Äÿÿ½ÎÿÿºÕÿÿ¶Ûÿÿ±áÿÿ«çÿÿ£ëÿÿœñÿÿ“õÿÿŒûÿÿƒÿÿþzÿÿúqÿÿöhÿÿð_ÿÿìUÿÿæKÿÿáBÿÿÜ8ÿÿ×.ÿÿÑ%ÿÿÍÿÿ½ññ&&C\\¿ÿÿÄÿÿÉÿ&ÿÎÿ0ÿÓÿ;ÿÙÿEÿÝÿNÿãÿXÿçÿaÿìÿlÿñÿuÿöÿ~ÿüÿˆÿÿÿ‘ÿÿüšÿÿ÷¢ÿÿò«ÿÿí³ÿÿèºÿÿâÀÿÿÝÅÿÿÖÉÿÿÃÀÿÿ½ÎÿÿÇÛÿÿÆìÿÿ¿äÿÿ¹êÿÿ²ïÿÿªóÿÿ¡ùÿÿ™þÿÿÿÿüˆÿÿö~ÿÿñuÿÿìlÿÿçbÿÿãYÿÿÝOÿÿÙEÿÿÓ;ÿÿÎ1ÿÿÉ'ÿÿÄÿÿ¿ÿÿC\\e‘‘¶ÿÿ¼ÿÿÁÿ*ÿÆÿ4ÿËÿ=ÿÐÿGÿÔÿQÿÛÿ[ÿßÿeÿåÿoÿéÿxÿíÿ‚ÿóÿŒÿ÷ÿ•ÿýÿŸÿÿþ§ÿÿú°ÿÿõ¹ÿÿðÁÿÿêÈÿÿåÍÿÿßÑÿÿßÑÿÿÖÝÿÿÑãÿÿÆìÿÿÆìÿÿ¿òÿÿ¸÷ÿÿ°üÿÿ§ÿÿýžÿÿ÷”ÿÿó‹ÿÿí‚ÿÿéyÿÿåpÿÿßeÿÿÛ\ÿÿÔQÿÿÐGÿÿË>ÿÿÆ4ÿÿÁ+ÿÿ¼ ÿÿ¶ÿÿe‘‘}½ ½­ÿÿ²ÿ ÿ·ÿ+ÿ¾ÿ4ÿÂÿ>ÿÇÿIÿÌÿUÿÑÿ]ÿÖÿgÿÛÿqÿáÿ{ÿæÿ†ÿëÿÿïÿ™ÿôÿ¢ÿùÿ¬ÿþÿµÿÿý¿ÿÿùÇÿÿôÏÿÿîÖÿÿèÛÿÿèÛÿÿèÛÿÿÛùÿÿÛùÿÿÎöÿÿÆúÿÿ¾þÿþµÿÿù¬ÿÿô¢ÿÿï˜ÿÿëÿÿæ…ÿÿá{ÿÿÛrÿÿÖhÿÿÑ_ÿÿÌUÿÿÇJÿÿÂ?ÿÿ¾5ÿÿ·+ÿÿ²"ÿÿ­ÿÿ} ½½ŠÝ Ý¥ÿÿ©ÿ#ÿ¯ÿ-ÿ³ÿ7ÿ¹ÿAÿ¿ÿJÿÄÿUÿÈÿ^ÿÍÿhÿÓÿuÿØÿ~ÿÝÿˆÿâÿ’ÿçÿœÿìÿ¦ÿñÿ°ÿöÿºÿûÿÃÿÿÿÌÿÿüÖÿÿ÷ÞÿÿòåÿÿèÛÿÿÛùÿÿÛùÿüØöüÿÔþÿÿËÿÿûÃÿÿö¹ÿÿñ°ÿÿì¥ÿÿç›ÿÿâ’ÿÿ݈ÿÿØÿÿÓuÿÿÍjÿÿÈ`ÿÿÄUÿÿ¿Jÿÿ¹Aÿÿ³8ÿÿ¯.ÿÿ©$ÿÿ¥ÿÿŠ ÝÝò òœÿÿ ÿ#ÿ¦ÿ-ÿªÿ7ÿ°ÿCÿµÿNÿ»ÿWÿÀÿ_ÿÅÿhÿÉÿuÿÏÿÿÔÿ‰ÿÙÿ•ÿÞÿŸÿäÿ¨ÿèÿ²ÿîÿ¼ÿòÿÆÿøÿÐÿýÿÚÿÿþåÿÿúìÿÿóñÿÿîõÿÿêüÿÿâÿÿýÙÿÿøÏÿÿòÅÿÿî¼ÿÿè³ÿÿä¨ÿÿÞžÿÿÙ”ÿÿÔ‰ÿÿÏÿÿÉuÿÿÅjÿÿÀaÿÿ»XÿÿµNÿÿ°Cÿÿª9ÿÿ¦/ÿÿ $ÿÿœÿÿòò‹ý ý’ÿÿ—ÿ#ÿœÿ-ÿ¢ÿ7ÿ¦ÿCÿ«ÿNÿ°ÿXÿ¶ÿcÿ»ÿkÿÁÿuÿÆÿÿËÿ‰ÿÏÿ•ÿÔÿŸÿÛÿ©ÿàÿ´ÿäÿÀÿêÿÉÿïÿÓÿóÿÝÿúÿæÿþÿñÿÿýùÿÿ÷þÿþîÿÿúäÿÿóÜÿÿïÒÿÿêÉÿÿä¾ÿÿà´ÿÿÛ©ÿÿÔžÿÿÏ”ÿÿˉÿÿÆÿÿÁuÿÿ»lÿÿ¶dÿÿ°Yÿÿ«Nÿÿ¦Cÿÿ¢9ÿÿœ/ÿÿ—$ÿÿ’ÿÿ‹ýý‚ý ýˆÿÿŽÿ#ÿ“ÿ-ÿ˜ÿ7ÿžÿCÿ£ÿNÿ¨ÿXÿ­ÿcÿ²ÿkÿ¶ÿuÿ¼ÿÿÁÿ‰ÿÇÿ•ÿËÿŸÿÐÿ©ÿÖÿ´ÿÜÿÀÿáÿÉÿæÿÓÿêÿÝÿïÿæÿôÿñÿúÿûÿúùÿÿôîÿÿïäÿÿêÜÿÿæÒÿÿáÉÿÿܾÿÿÖ´ÿÿЩÿÿËžÿÿÇ”ÿÿÁ‰ÿÿ¼ÿÿ¶uÿÿ²lÿÿ­dÿÿ¨Yÿÿ£NÿÿžCÿÿ˜9ÿÿ“/ÿÿŽ$ÿÿˆÿÿ‚ýýsò òÿÿƒÿ#ÿ‰ÿ-ÿÿ7ÿ“ÿCÿ˜ÿNÿÿWÿ¢ÿ_ÿ¨ÿhÿ­ÿuÿ²ÿÿ¸ÿ‰ÿ¼ÿ•ÿÁÿŸÿÆÿ¨ÿËÿ²ÿÑÿ¼ÿÖÿÆÿÛÿÐÿßÿÚÿåÿæÿìÿñÿñÿûÿñùÿÿìîÿÿåäÿÿßÙÿÿÛÏÿÿÖÅÿÿѼÿÿ˳ÿÿƨÿÿÁžÿÿ¼”ÿÿ¸‰ÿÿ²ÿÿ­uÿÿ¨jÿÿ¢aÿÿXÿÿ˜Nÿÿ“Cÿÿ9ÿÿ‰/ÿÿƒ$ÿÿÿÿsòòaÝ Ýuÿÿzÿ#ÿÿ-ÿ…ÿ7ÿ‰ÿAÿŽÿJÿ“ÿUÿ˜ÿ^ÿžÿhÿ¢ÿuÿ¨ÿ~ÿ­ÿˆÿ±ÿ’ÿ¶ÿœÿ»ÿ¦ÿÁÿ°ÿÆÿºÿÊÿÃÿÏÿÌÿÖÿÙÿÞÿæÿåÿñÿéÿûÿéùÿÿåîÿÿÞäÿÿÖØÿÿÏËÿÿÊÃÿÿƹÿÿÁ°ÿÿ»¥ÿÿ¶›ÿÿ±’ÿÿ­ˆÿÿ¨ÿÿ¢uÿÿžjÿÿ˜`ÿÿ“UÿÿŽJÿÿ‰Aÿÿ…8ÿÿ.ÿÿz$ÿÿuÿÿa ÝÝJ½ ½jÿÿoÿ ÿuÿ+ÿzÿ4ÿÿ>ÿ„ÿIÿ‡ÿUÿŽÿ]ÿ“ÿgÿ˜ÿqÿžÿ{ÿ¢ÿ†ÿ¦ÿÿ«ÿ™ÿ°ÿ¢ÿµÿ¬ÿ¹ÿ¶ÿÀÿÂÿÇÿÎÿÏÿÛÿÖÿæÿÛÿñÿàÿûÿàùÿÿÛîÿÿÖäÿÿÏÚÿÿÇÍÿÿÀÁÿÿ¹µÿÿµ¬ÿÿ°¢ÿÿ«˜ÿÿ¦ÿÿ¢…ÿÿž{ÿÿ˜rÿÿ“hÿÿŽ_ÿÿ‡Uÿÿ„Jÿÿ?ÿÿz5ÿÿu+ÿÿo"ÿÿjÿÿJ ½½3‘‘_ÿÿdÿÿiÿ*ÿoÿ4ÿtÿ=ÿxÿGÿ}ÿQÿ‚ÿ[ÿˆÿeÿŒÿoÿ‘ÿxÿ–ÿ‚ÿ›ÿŒÿŸÿ•ÿ¤ÿŸÿ©ÿ¨ÿ°ÿ¶ÿ¹ÿÃÿÁÿÐÿÈÿÛÿÍÿèÿÑÿñÿÔÿûÿÔùÿÿÑïÿÿÍåÿÿÈÚÿÿÁÏÿÿ¹Âÿÿ°¶ÿÿ©¨ÿÿ¤žÿÿŸ”ÿÿ›‹ÿÿ–‚ÿÿ‘yÿÿŒpÿÿˆeÿÿ‚\ÿÿ}QÿÿxGÿÿt>ÿÿo4ÿÿi+ÿÿd ÿÿ_ÿÿ3‘‘\\UÿÿZÿÿ_ÿ&ÿdÿ0ÿhÿ;ÿmÿEÿsÿNÿwÿXÿ{ÿaÿÿlÿ†ÿuÿŠÿ~ÿŽÿˆÿ“ÿ‘ÿšÿžÿ¢ÿ«ÿ«ÿ·ÿ³ÿÆÿºÿÐÿÀÿÝÿÅÿêÿÉÿôÿÊÿûÿÊùÿÿÉñÿÿÅèÿÿÀÛÿÿºÏÿÿ³Äÿÿ«·ÿÿ¢«ÿÿšÿÿ“‘ÿÿŽˆÿÿŠ~ÿÿ†uÿÿlÿÿ{bÿÿwYÿÿsOÿÿmEÿÿh;ÿÿd1ÿÿ_'ÿÿZÿÿUÿÿ\\ &&EññOÿÿSÿ$ÿWÿ-ÿ]ÿ7ÿaÿAÿfÿLÿkÿTÿpÿ^ÿuÿfÿyÿqÿ}ÿyÿƒÿ…ÿŒÿ’ÿ”ÿ¡ÿÿ­ÿ¤ÿºÿ«ÿÆÿ±ÿÑÿ·ÿàÿ»ÿêÿ¿ÿôÿÀÿûÿÀùÿÿ¿ñÿÿ»èÿÿ·Þÿÿ±Ðÿÿ«Åÿÿ¤ºÿÿ¬ÿÿ” ÿÿŒ’ÿÿƒ…ÿÿ}zÿÿyqÿÿuhÿÿp_ÿÿkUÿÿfKÿÿaBÿÿ]8ÿÿW.ÿÿS%ÿÿOÿÿEññ &&0È ÈBÿÿHÿ ÿMÿ*ÿQÿ4ÿVÿ=ÿ[ÿGÿ_ÿQÿcÿZÿgÿcÿmÿnÿuÿzÿ~ÿ‡ÿ…ÿ•ÿÿ¡ÿ–ÿ¯ÿÿºÿ£ÿÆÿ©ÿÓÿ­ÿàÿ²ÿêÿ´ÿôÿµÿûÿµùÿÿ´ñÿÿ²èÿÿ­Þÿÿ©Òÿÿ£Åÿÿºÿÿ–¯ÿÿ¡ÿÿ…”ÿÿ~ˆÿÿuzÿÿmoÿÿgdÿÿcZÿÿ_Qÿÿ[HÿÿV>ÿÿQ5ÿÿM,ÿÿH"ÿÿBÿÿ0 ÈÈrr7ÿÿ;ÿÿ@ÿ&ÿEÿ0ÿJÿ:ÿNÿCÿSÿLÿXÿVÿ_ÿbÿgÿoÿoÿ}ÿwÿŠÿÿ—ÿˆÿ¤ÿÿ°ÿ•ÿºÿ›ÿÉÿ¡ÿÔÿ¥ÿàÿ©ÿêÿ©ÿôÿ­ÿûÿ­ùÿÿ©ñÿÿ©èÿÿ¥Þÿÿ¡Óÿÿ›Èÿÿ•ºÿÿ°ÿÿˆ¤ÿÿ–ÿÿwŠÿÿo}ÿÿgpÿÿ_cÿÿXVÿÿSLÿÿNCÿÿJ;ÿÿE2ÿÿ@(ÿÿ;ÿÿ7ÿÿrr'íí0ÿÿ4ÿ"ÿ8ÿ,ÿ<ÿ4ÿAÿ>ÿHÿKÿPÿWÿXÿeÿaÿrÿhÿÿqÿŒÿzÿ™ÿÿ¦ÿ†ÿ°ÿŒÿ¾ÿ’ÿÊÿ˜ÿÔÿ›ÿàÿŸÿêÿ ÿôÿ£ÿûÿ£ùÿÿ ñÿÿŸèÿÿ›Þÿÿ˜Óÿÿ’ÉÿÿŒ½ÿÿ†°ÿÿ¥ÿÿz™ÿÿqŒÿÿh€ÿÿasÿÿXeÿÿPXÿÿHKÿÿA?ÿÿ<6ÿÿ8-ÿÿ4$ÿÿ0ÿÿ'íí’’#ÿÿ'ÿÿ,ÿ(ÿ2ÿ1ÿ8ÿ>ÿBÿMÿJÿZÿSÿgÿZÿuÿaÿÿkÿŽÿsÿ›ÿyÿ¦ÿ~ÿ²ÿ…ÿÀÿŠÿÊÿŽÿÔÿ“ÿàÿ•ÿêÿ˜ÿôÿ˜ÿûÿ˜ùÿÿ˜ñÿÿ•èÿÿ“ÞÿÿŽÓÿÿŠÉÿÿ…¾ÿÿ~²ÿÿy¥ÿÿsšÿÿkÿÿaÿÿZtÿÿShÿÿJ[ÿÿBMÿÿ8?ÿÿ22ÿÿ,)ÿÿ'ÿÿ#ÿÿ ’’  ííÿÿ#ÿ&ÿ*ÿ4ÿ4ÿBÿ;ÿOÿEÿ]ÿLÿiÿSÿvÿ]ÿ‚ÿdÿÿjÿ›ÿpÿ§ÿwÿ´ÿ{ÿÀÿÿÊÿ…ÿÔÿ‰ÿàÿŠÿêÿŽÿôÿŽÿûÿŽùÿÿŽñÿÿŠèÿÿ‰Þÿÿ…ÓÿÿÉÿÿ{¾ÿÿw´ÿÿp¦ÿÿjšÿÿdÿÿ]‚ÿÿSwÿÿLjÿÿE^ÿÿ;Pÿÿ4Cÿÿ*5ÿÿ#(ÿÿÿÿíí ||þþÿ)ÿ&ÿ6ÿ-ÿDÿ7ÿQÿ=ÿ^ÿEÿlÿNÿwÿVÿ…ÿ[ÿÿaÿœÿhÿ©ÿnÿ´ÿtÿÀÿxÿÊÿ{ÿÔÿÿàÿ‚ÿêÿƒÿôÿƒÿûÿƒùÿÿƒñÿÿ‚èÿÿÞÿÿ{ÓÿÿxÉÿÿt¾ÿÿn´ÿÿh©ÿÿa›ÿÿ[ÿÿV…ÿÿNwÿÿElÿÿ=_ÿÿ7Rÿÿ-Dÿÿ&7ÿÿ+ÿÿþþ || ÊÊÿ,ÿÿ9ÿ)ÿFÿ0ÿSÿ7ÿ`ÿ>ÿlÿFÿzÿMÿ†ÿSÿ‘ÿZÿžÿ`ÿ©ÿeÿ´ÿjÿÀÿnÿÊÿsÿÔÿvÿàÿxÿêÿxÿôÿxÿûÿxùÿÿxñÿÿxèÿÿvÞÿÿsÓÿÿnÉÿÿj¾ÿÿe´ÿÿ`©ÿÿZÿÿSÿÿM…ÿÿFzÿÿ>mÿÿ7aÿÿ0Sÿÿ)Gÿÿ:ÿÿ-ÿÿ ÊÊ**ò,òÿ<ÿ!ÿHÿ(ÿVÿ/ÿ`ÿ7ÿpÿ=ÿ{ÿEÿ†ÿLÿ”ÿRÿŸÿWÿ©ÿ]ÿ´ÿaÿÀÿeÿÊÿhÿÔÿjÿàÿnÿêÿoÿôÿqÿûÿqùÿÿoñÿÿnèÿÿjÞÿÿhÓÿÿeÉÿÿa¾ÿÿ]´ÿÿW©ÿÿRžÿÿL“ÿÿE…ÿÿ={ÿÿ7oÿÿ/bÿÿ(Wÿÿ!Hÿÿ=ÿÿ-òò**ZZö:öÿKÿ!ÿWÿ(ÿcÿ0ÿpÿ7ÿ{ÿ>ÿ‡ÿDÿ•ÿJÿŸÿOÿ©ÿTÿ´ÿXÿÀÿ\ÿÊÿ_ÿÔÿbÿàÿcÿêÿfÿôÿfÿûÿfùÿÿfñÿÿcèÿÿbÞÿÿ_Óÿÿ\ÉÿÿX¾ÿÿT´ÿÿO©ÿÿJžÿÿD”ÿÿ>‡ÿÿ7{ÿÿ0qÿÿ(dÿÿ!XÿÿKÿÿ;ööZZjjúKúÿXÿ!ÿeÿ)ÿpÿ0ÿ}ÿ6ÿ‰ÿ;ÿ•ÿAÿŸÿFÿ©ÿKÿ´ÿOÿÀÿSÿÊÿVÿÔÿXÿàÿYÿêÿ]ÿôÿ]ÿûÿ]ùÿÿ]ñÿÿYèÿÿXÞÿÿVÓÿÿSÉÿÿO¾ÿÿK´ÿÿF©ÿÿAžÿÿ;”ÿÿ6‰ÿÿ0|ÿÿ)qÿÿ!fÿÿYÿÿJúújjj jöWöÿeÿ!ÿqÿ(ÿ~ÿ.ÿ‰ÿ3ÿ•ÿ8ÿŸÿ>ÿ©ÿAÿ´ÿEÿÀÿIÿÊÿLÿÔÿNÿàÿQÿêÿRÿôÿRÿûÿRùÿÿRñÿÿQèÿÿNÞÿÿLÓÿÿIÉÿÿE¾ÿÿA´ÿÿ>©ÿÿ8žÿÿ3”ÿÿ.‰ÿÿ(~ÿÿ!qÿÿfÿÿWöö jjZ Zò_òÿtÿÿÿ%ÿ‰ÿ+ÿ•ÿ/ÿŸÿ4ÿ©ÿ8ÿ´ÿ<ÿÀÿ?ÿÊÿCÿÔÿDÿàÿGÿêÿGÿôÿGÿûÿGùÿÿGñÿÿGèÿÿDÞÿÿCÓÿÿ?Éÿÿ<¾ÿÿ8´ÿÿ4©ÿÿ/žÿÿ+”ÿÿ%‰ÿÿÿÿtÿÿaòò!ZZ** Ê\Êþ~þÿ‰ÿ"ÿ•ÿ&ÿŸÿ+ÿ©ÿ/ÿ´ÿ3ÿÀÿ6ÿÊÿ7ÿÔÿ;ÿàÿ<ÿêÿ<ÿôÿ<ÿûÿ<ùÿÿ<ñÿÿ<èÿÿ;Þÿÿ7Óÿÿ6Éÿÿ3¾ÿÿ/´ÿÿ+©ÿÿ&žÿÿ"”ÿÿ‰ÿÿ~þþ \ÊÊ**|>|ííÿ•ÿÿŸÿ"ÿ©ÿ%ÿ´ÿ)ÿÀÿ,ÿÊÿ/ÿÔÿ2ÿàÿ2ÿêÿ2ÿôÿ5ÿûÿ5ùÿÿ2ñÿÿ2èÿÿ2Þÿÿ/Óÿÿ,Éÿÿ)¾ÿÿ%´ÿÿ"©ÿÿžÿÿ”ÿÿíí>||  ’U’í”íÿ©ÿÿ´ÿÿÀÿ#ÿÊÿ$ÿÔÿ&ÿàÿ'ÿêÿ+ÿôÿ+ÿûÿ+ùÿÿ+ñÿÿ'èÿÿ&Þÿÿ$Óÿÿ#Éÿÿ¾ÿÿ´ÿÿ©ÿÿ’íí U’’ rLrÈÈñµñÿÊÿÿÔÿÿàÿÿêÿ ÿôÿ ÿûÿ ùÿÿ ñÿÿèÿÿÞÿÿÓÿÿÉÿÿ³ññÈÈLrr&&\H\ ‘x‘½¦½ÝÊÝòçòýùý÷ýýäòòÉÝݤ½½ w‘‘H\\&&þ00æ$ Rî$@%@$N%V%(R/home/heron/Development/gnustep/core/gui/Images/common_ToolbarShowColorsItem.tiffCopyright FSFHHgnustep-gui-0.24.0/Images/common_TabUnSelectedToSelectedJunction.tiff0000664000076500007650000000141612224735723025552 0ustar brains99brains99II*®€9 OõR™Bg9i 6ˆDbP÷ãõø€€oõZ©V‡3WkÕà’Èd2°ÔN]~Ì@)£ýý6«JÈxe¾áo¹—Ô7;š*–Ká³ìÎj­U«@0ùÔò$€b1˜‡öK)”çc±˜ÒØ”V/¿_ïÀ ÁX±ˆUba–«]ª¶?ÞFûãžVѲC_Ø0 ÿr8\€ë&ã;¥ ‰Ôúv[æCO·óäŸógøÚëv€,&>­/ ®×‹¶je4™ ßîv†öA â\’fV:'rÈÉ…B±Qf€è/'ðÝüW«ûðŸääk·úcÍÔ¾w#Øïy;ÀC“G7«•ªïd7ÜðŠ" ¢™€ Hë»%{ú?éqþAâ ª*Aîü~ŸÀ^WAO쉊B˜¤Â€@ *½Nã¼öCètCÀ±2ÂðÌ7ÁoóÁDQ$dà!çaÒv-YƒÇ'©èz€LDïA°j›¹ªk§Lrˆ´m$±FøfætU-¥Èþ ¨ H°ø@¥˜ (=RHH/home/ericwa/guitest/Images/common_TabUnSelectedToSelectedJunction.tiffCreated with The GIMPgnustep-gui-0.24.0/Images/common_Diamond.tiff0000664000076500007650000000066607002671655020764 0ustar brains99brains99II*T $ÿàþ†4lÐàüC†€?*ƒ1„‹I`¸@QñG'T¼øñ¥–Æ¿ªô)RÅ0+lBÿ™£DËœ5Eìyâ>  9F&€$L¦®(=R/home/humasect/gstep/core/gui/Images/common_Diamond.tiffGNUstep NSSecureTextFieldCell DiamondHHgnustep-gui-0.24.0/Images/common_MiniaturizeH.tiff0000664000076500007650000000123411557362504022011 0ustar brains99brains99II*(ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRÿRÿRÿRÿRÿRÿRÿRÿRÿRÿÿÿÿÿRÿRÿRÿRÿRÿRÿRÿRÿRÿRÿÿÿÿÿRÿRÿRÿRÿRÿRÿRÿRÿRÿRÿÿÿÿÿRÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRÿÿÿÿÿRÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRÿÿÿÿÿRÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRÿÿÿÿÿRÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRÿÿÿÿÿRÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRÿÿÿÿÿRÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRÿÿÿÿÿRÿRÿRÿRÿRÿRÿRÿRÿRÿRÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ    8U NV()1>^Rcommon_MiniaturizeH.tiffCreated with The GIMPHHImageMagick 6.6.2-6 2010-09-17 Q16 http://www.imagemagick.orggnustep-gui-0.24.0/Images/common_OpenHandCursor.tiff0000664000076500007650000000364610155711774022304 0ustar brains99brains99MM*ì ÿ ÿ ÿ ÿ ÿçççÿçççÿ ÿ ÿ ÿ ÿçççÿçççÿ ÿ ÿóóóÿóóóÿÿçççÿçççÿ ÿ ÿçççÿóóóÿÿ ÿóóóÿóóóÿÿóóóÿóóóÿ ÿ ÿÿóóóÿçççÿÿóóóÿóóóÿÿóóóÿóóóÿ ÿÿÝÝÝÿ ÿ ÿçççÿóóóÿÿóóóÿóóóÿÿóóóÿóóóÿÿçççÿóóóÿ ÿ ÿ ÿÿóóóÿóóóÿÿÿÿÿÿÿÿÿóóóÿÿÿÿÿóóóÿÿóóóÿóóóÿ ÿ ÿçççÿçççÿÿ ÿóóóÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿóóóÿÿÿÿÿçççÿ ÿ ÿçççÿÿÿÿÿçççÿÿóóóÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿóóóÿÿÿçççÿÿÿÿÿóóóÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿóóóÿ ÿÿóóóÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿçççÿ ÿ ÿçççÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿóóóÿÿÿçççÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿçççÿ ÿÿçççÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿóóóÿÿÿóóóÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿóóóÿ ÿ ÿóóóÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿóóóÿ ÿ ÿçççÿóóóÿóóóÿóóóÿóóóÿçççÿ ÿ Žä–ž(R ü€' ü€'gnustep-gui-0.24.0/Images/common_Mount.tiff0000664000076500007650000000243011557362504020502 0ustar brains99brains99II*º€ P8$ „BaP¸d6ˆDbQ8SÞ'ŽR €¹ C†„Ž Ø¤6= ‘I ’py¾ U  1ÿ7¼Màõÿ ¤àN“T úýžSàŽ ŠGP »ìnÏà@`tº)9ÀÛôC\„@ûdy œ?ÝæÙäúJÀœæˆú´LOéÎ8h¿ "b@ ¬d%"‡àpÀèëC%Tß ¸» “Çõ0KÀœ†{î˜:šÁSá•™”9Åã`‚=àî-{ \Ät¬ÏM§M%ý1qoµ úoc„†a…øŒV3;»ÞEœbo«¹7 Åîë®MÀ›æ>œD­IaC€äð¼\â ò•ï[@œ5m#LuÀ  aúÓ@Ð*´Ò¾©ì7 Cpú}´Æ‘õ…€#1 ˆEŒ„®'Êæ F1ç¼àó Ç1âµ gü1 Çñ ³º"–qz¸›ã$£DPÔ;JÐó[+Ê«´³,C0ÈŽZIÈ:âmŒIärd ,c³X% ôgJ ´å:Ó´ñ=äý9γ¼ó=Ï   GÓL%Ó* ¸›Cê­Ek4©þ,8Ÿˆ+K ‰úp•L¦k-fž¨à(JÀÌ—€˜[ÒÈ*âk‹ò˜ˆþzœIêÆ‚ÉIéü} §Ùô³V5M_ZÛ]op°æ>éù`‰åÍŠ‚.&¨»M AyKg§`€kžFɸX( áó…€ ‡Ö‘‰‰€ž-†Ö â8ÀÄØ"‰uwȉ¹¤-Æ€bS GÂga@ [€@ ˆÕ'¶tùî1p×»[ècÐøD×Ö‘d–rpg‹YHhTYdz¦MO:ýBÕÊýTŸ[ tk“¶ÅWágÈ6øíäks”›™‚ÆR»çþ­ÚwƒÏr)‰ýÄ£¬Õyô|Õ<%p³\ƒXÛtmú^â³ñ‚pe öPräiÀfÖ <õ}ÅÓè:õNÓ\•~†Ú=Rcommon_Mount.tiffHHImageMagick 6.6.2-6 2010-09-17 Q16 http://www.imagemagick.orggnustep-gui-0.24.0/Images/common_ProgressIndeterminate_6.tiff0000664000076500007650000000376611271671115024151 0ustar brains99brains99II*È™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™þŽ Q”@Àæî(/home/fred/GNUstep/Patches/GS_NSProgresIndie/common_ProgressIndeterminate_6.tiffHHgnustep-gui-0.24.0/Images/common_ImageFolder.tiff0000664000076500007650000001406011466771424021564 0ustar brains99brains99II*:€ P8$ „BaP¸d6ˆD`æø¡ýl¶\¿‹%’úþ%HdR9$„o'©åKôz=*þ2 /ñp¸lÿˆÅKé,ö}? Ib†óü©N¿I$Sñ¸Ø€þІoàH,¿€ãú v½_žÉÆãúýr¹^?¦Ã³øt9"?ÄBCüH ¿ì»åöb”ÊÒédóü˜K,¿ÆñËü> ¿Ç¢ÓüÈ+ÊŠÂ@»Õû=Ÿ ÙW«Æù4šQ?È„"{üJ$¿Äá`£üŠ Èåò»¬¶aþK„ŸÒK,^2J%OúdGe_¯Øoóáéþ ˆ/ñ0”Zÿò$Ñ×yçßo BÃøŽ gaX 4²\ÿ4ñx¼n_ª ª¸æ¢°jÀiêÊú”…XŠ"x¼‡aЊÇ2 ³p‹3rôÄ «ÖöŒ/aý½£Pö† ¨á k)p\gù"HÇøX©á@ŸàX&A0"AhÖ?åÑnläÑ.YàÀ09hzÊb˜†IþFdÑþ+ŠÃ1þ¨†oļ4BÞ²£ VEOh¼‚çð¿<Ó¼ó?Ãø¬%ä(ð:Ë9xŒøÎ‰¢n'àý ø@ÌŒ‚Éù&HEùRS‡ù2K2Œ¦“dÁh‹bÈÒù¢VW•ÅÉþI’% þ#‚‰þl«&ÝÍïC+=Ïóà»iZ“ͧ<“Äöå‘\’¤¡6­â)üAQÿJRÄnãÈhâÐJ ÔØO4T™'JQNbÕÒ¡?’ÀÌ:]bh¨àøHò;‘‡øŽ#‰ùfYÏÀÊ<Ÿá‹52-¼?feüQ=Z³ìV‹ñý˜Ï#x~Æ `UŸÇÆråq]Y†A€tðÀí×JСÈFÝ×€õyŸãp_¥ *àeöÏÔu,¥*JE™üA1ÈÑ…á¸}cYíçùF§øî:‘Gø( ‚§øf‡l“)CÓ‡ ÞN³ìùšfyæ"òˆô8ŸÆy‚^Ÿç¹ì{ç<”} B§ù¦eøÒ'øþuº‰ÿ©Þ§gªaˆ<‡àÐ9€W„?âx®ãµá›‰(IAäA ÂÉCö-ÌáPd‚`“j.åâÏ îS-à¿9ñƒ Äðþ¶˜å¡^žYÔ›ÿ©þYøÕýÝbpœ?Á´G …Ö®•Ô>àC·v­QÛ;grîÃp.cø5À4?èwê| `z¬ÿyÆ»·Æƒ™¶Aê½pFm€!Ãü+/xi ¡¬3a8 áD ÃÐþBåYAà;Çøé‰Cü_DÑþ$"€ÿ ‘Lƒˆ¬?ÁÌY2@ö…ȼa‚`LáV27`îÇøâJ¨2QþÐÿãü5‚Ø/c¼Á¢=°0ž}9äT·°”B°ÿ !]GƒÐv‡ø-(ÆúmÛì9nÁ@¸Š!ÇøÌÊø{Aè?Æô©h-ˆ \?Ãܱ\TJ£a"$GøŸ—CüVKÓ, ÿ s H†2æ@ÿ3,êÀø?Ä$Ñãjñj%D`þ €¶ †¸õ#Üz aÆ™TQ<+¥”j 1¶?Æ8Å£üCˆA8?Áâ’2N}´ hÛèz ŒdSÁ?ÆxÂc£è|þ2(€ÿTLß„°–?ÁMŽA·ê=+ex̤CügRX™†])âê–LÙž#©ƒú„lĆºmHÿ4ìŠJ|?ÆÀÈ:s€4ǪŠÇøg`d`USiÁÀhUøDY+‚íÔŠ¡P¢Ãaa’8#ðhÈUÍ<)5¡ÿ[[è‘JÜrWQþ ëÃ* $Î+þìAfp ØT8Àÿ–.PÒ1cÇøÉ²CüiYQþ4lÅŠ±šÎ,uÒÿ_û¬±dÆ„kM0¦ >µNññûkÝTâ©cú¥ZS1¾ GÀ€Uˆ€ÕƒuûŠö„(ˆ‹Ü!ð.À€¿€™Öɪá[ëu׺á¨ü6oÿƒb?ÂéàBöð{ïEê"âÚTJ¡¹}ÇøÕ¿Wæý‹ü?ƶöizìŒM|?ÆÁ͹¾^ ñ)±íë½¹ìè ›Ÿ€N6©YLáqÿ†@.×ÃAn:a†Çq>Dç³8'ÀK¤ÕÁ| ßL…˦«pQÔ¢=YA£˜ˆüN‰±L?¬¨ÒØsÀcŒqþ0øD¹—b†ñCÃÇþÇa5왃Î,S 9¶¨\1ñÞ4…À·!°Fqá­¤j¶è%åFȤkËðq‘Ïþ†PçøÓËãS!u™)¼òg×p ÁÌ(aü.Åx¬Ãb Aü°þ`ås.Î".hóëViEÒ‘–?ј¸úÌ öRpNo-ç½­*¥nO„M¯-H(ÊÞÀ!œðovàW¾þÊ{Æuîï¾á[Ý|(ƒ©áNH-qýÏÃ1_lm+:ȨΣP‰Á6(̵b£ %’.³Ê”B u€ÕzAÜ;ø½öCüTûYa,‚¹ÎÙçhxÿÈažt{L¼ø<dAÉ1À}Kv¶•µ98úY÷?ò]œ?À'ÙÛ[dD}Ñþ)D@q«à-¯s°€hþ` c¢JêÀþâWƒ›˜SéíÔcø&U#€8@˜ò x£¨õŒÔ$¨P‹h> ÉK ïO ðÏ€?ƒú&‚jïœã"ïæüdÒPIŽØ÷¯„æozï@­+)Šc!š®Ä^Åð /ÌE¤^ /Ü$² ~x@àú€>Ëv8P–À’·€”âò lè@Êœ€æ:ÁZÈ‚ÐÀЍ®Ê ¢ Ð̵¦ÊCbï†úpÜà½(°‹Dáþ÷#·ê˜Æ2ü1Pþ½àï ïM˜÷nOï ”©N îÀ¯àd„^ð{âºàe `ÌVÅ1>ÅLP>\õü¨¨.@`ü¢‡¬¸àñaþl¥jZØ!„uÄ™(¤ŠÜdÆ à®àÛðįÃúî>í%ÈFŽ‘¤ï¤Å4ùNèï¬úÌ—ÁþQÀŽ@”Áü  FÈ`<o,BH¢ù 1XÑELVÇ…†£âv@Ú›ü_€ÞÑX¡â z×ìËøžqbÀh& ]J 2(© ÎQàI#1 Éù…,µ@|ìª;ñ³ÅÔ½ Æ•$°ôŒhÊÖáþÁd÷€òâü‚(&€8ý'’}(ürzÁ@Hàßáý'Rš‚Aü!zìÈÌÁ[*îá!»+gè~ÌÜÍèÎDM µ,±’Á#*É£Z¢Ê/.6Bî,¨Ú0.´Kã%0.'&Ÿ%þ%¡žnjÞÔ 2n@€Ò¶`„r}1r|3Ó!'Á E)è'h&›h&” 0!þÓH£hS&|aþsY*«\¶ ‰äiNìAþ¡ï7u7í7aÿ7ó|÷83ˆs3ŽóŽòÿ9“:žSœ3¨ó¬³°Sµ;3ƒ9AþÕAâáÞÈ‘<¨ˆèµó´$ = €wÁý>'>ýÁüŽw3üލò‚á `ˆÁÁ@ª*¢ò3).) åS@¡Á+¬ºô$6Àz&à® *& ¦á6` DKÁ(Ášá0,ÌXàA@®ûájOh!¼—xË¡\Â~á…5Ah¬’ÁŽþá’~ao@ `Œ@dkÎb§xŠô&Ý"ZeðÈ4\ôÇLG~2˜·3ÿꌜ‰Æ©ð­Xù%éUÒÔáEOhÒtº:wpÜ5 êáR®á.×!€Ká::mô`” u!0ξRÉr³DbžaN”jDžáZKˆzË¡fÄšÁˆhTÁ¦èN Aþš)6@`;àjƒcK¢A&¶ƒ)€3Y(ÿ)à8àÊÄ*Ž? È©KpÄ!¢jÇþðq³/I#e`eÇK ˜P w"  §¨Aþ¡6F¡ æaBÀ¡2„¼!rój´jÁ]4AL æAfJ\ Àat†4”v}AáoHaþa0 ˜ƒ¶ pzëº;à\%ওK´¼!À  &êUšÉh4èâ ŒCZÌ@©•¢ÄŒFÁTaÁ-i05"+H¬Àhæ1°ñeÀä ƒ¾€Á" Ð ç" ®’¡á,. _¤¼aVëáŽÓD!¼Ë¡È¡Ú”!—GvÛG~4pA~¸t º¡‡H)tV`® ¨ÄÀx&à|Q™qñ˜€\'x° X‚?  rïÓs¯Ò<Çmg‹p7Ю2³ÞÌN*r¬Ëȸƒö¦‹À¸ÀÌK¡ HÄàÕ.@î '® `‚„8 räo!\a™ õja¸ÌÐÒÁèöÔaË8!ìAþê”áÚr áÄáþÁÒ~a¶lÌ`Ø Aþ {K@„äÒr"@j]@xâësB$¬T)ÐÀo8ý14R×L×VÜ$æENrOöSp£Ç¤ ˜=4sJ˜D¤æ;K¡çþÀæ5 î ±„¼ƒàšeÔ \Æ æ*ru!‚‰Á¦qv!ØËªn¡Î’¡ÅbîAÖæï'4¡€QaF!u@–Aüª#…K È 6 ÀÆ;`ñ…Çf ƒ·…J.¡aácZAz…¼¡þ¡ŸEa¦p¶¸ºÙs@Á[Fä'¤ `¢. „ÅÔ`bHhp xÊG@Dw`TõžîÙ§Â`Àb›ND\ð´NŒFùÑ© ¶Åñ?q›äM?ìñDÈMDÔ-<Ôº Àªr â ÒC¬Ã¶ ºp ò ²Sº#¶ `¡¬ È¹¡.âf!,öEaÄÌΩÞ!ŒQ`Ð  º6ÀsxÀè°%Ô ZH\™œZN^gŒV\$^`À`{Oµ Zˆ.NãÛ¶¯ÈüÛsu„L jÝ1Æ-·ñϸ-:Ô;Y`$ ³¬@¥K@ô F2 à²hàð Ñ„¡ vàð 2B §j‚ƒá4#a ¥TŒ²àÖ± ä @¾jóÉàœ£ €…jš”´Õ‚Ÿì\Hx"êXn1Y 2@n;ûH!ÀX<Á;OËhjZìàeûj2<8o³ wàŸQËÄ:Œ˜MC©ŠÄ`"”T& @°hàà g@½Àâ fŽ à´1 ò ’R€ü Aþá…€ü „.àÔB᜞4 áRà àÐà– ²B÷4´û.€*5ÀA´ >2 Lÿ"äj€$îà<ˆgÍ¢ Ð6@ Ò˜ >(ø©öbÑI¬W(ġ¸ÀDÍ£Äí²Ñ¢B¢ô'Šü à´hà­Ó›d 2R @Ð’Â ä.  ØàáÊ$¾‰@¡L)aZ¡Ub§ÞárU¾/ã!@# Á™àª ½L)Ô´ûì`e‡XHNÂê€orÀN¼Ù‚>%8’1ÔB–r Ù½~£‚††µÐl‡è†û¨ÙÝÁþ€ AÉÑ€Â"b ‚/4& à¹% ¤ D/ìââ `Ê. ¬ &2 ØÊ ÀÜž Áª$vÆN!þÁbôPfê\ô>£RA^…À„Ä&o ®ÀØoÀ¼¢àN #¶ ±% D ì¯$ @ ÐíÚÂ~‚*à Fûž”Þ˜oÀ+ÄÝÞ]€` a `Ò `’ `V `* ` `\ÀĬ œ Ê. €Ìc —û# 'þ Ú‘ ´% Ai VÇDÆÁZžá<ÍöáPå~éî^5! dãý›H?ÌCÃürk-?ÄæBSüDa#¿Ãåò+ü:^"G ñwüþ“Iå™H\_†@gùLDÃðˆ „Wø fIÑrsŒœ«'ÉIJpœœ'ʤÒGù(Í%‰ò1œ’ÿ"š,¤CY9þH8_åcé±þdEŸçÄÊ-þƒN#ŸéBYþ‹RaŠdÓý©¤•©÷úJ—ž“é'ù€†(¤žÿšŠðñœ–ÿ Iã,NµXÛJ@raÔ° ÆAN`äÕÕÒtœÃ'ÉÄÒp´œ'U¶õŠÑÓ­µ[†Ÿ¨šÿJvc™…þQ@œßåÄYýþkJ¡Ÿç„Ú)þP‹éNËÅ "ޤâ=”D¡þ9³'øÔL¿ƒ(BŸâ8áˆìö£x®ƒc[J <‘Ú(«I+²”€ñ€F`H= è6 ©8”“‰©8t“„ 8ë;t’”²dY'Iò„£)Jr¤«+IÈ/usr/home/michael/Sandbox/GNUstep/core/gui/Images/common_Folder.tiffCreated with The GIMPPaint.NET v3.5.5HHþ0/2 E´ú/¬"*(1=Rgnustep-gui-0.24.0/Images/common_2DCheckMark.tiff0000664000076500007650000001005011615731441021406 0ustar brains99brains99MM*Ìÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¶ 5¾ôÄ (RS‡s”" \/home/david/Pictures/GNUstep/common_2DCheckMark.tiffGNUstep 2D check markHH”appl mntrRGB XYZ Ù  acspAPPLapplöÖÓ-appl descodscmxVcprtÐ8wtptrXYZgXYZ0bXYZDrTRCXchadh,bTRCXgTRCXdescGeneric RGB ProfileGeneric RGB Profilemluc ptBR&ôfrFU(zhTWBitIT(XnbNO&€koKR¦deDE,¼svSE&€zhCNèjaJPþptPO&nlNL(>esES&fiFI(fplPL,ŽruRU"ºarEG&ÜenUS&daDK.(Perfil RGB GenéricoProfil générique RVBu( RGB ‚r_icÏðProfilo RGB genericoGenerisk RGB-profilÇ|¼ RGB Õ¸\Ó Ç|Allgemeines RGB-Profilfn RGB cÏðe‡NöN‚, RGB 0×0í0Õ0¡0¤0ëPerfil RGB genéricoAlgemeen RGB-profielYleinen RGB-profiiliUniwersalny profil RGB1I89 ?@>D8;L RGBEDA *91JA RGB 'D9'EGeneric RGB ProfileGenerel RGB-beskrivelsetextCopyright 2007 Apple Inc., all rights reserved.XYZ óRÏXYZ tM=îÐXYZ Zu¬s4XYZ (Ÿ¸6curvÍsf32 BÞÿÿó&’ý‘ÿÿû¢ÿÿý£ÜÀl€ P8$ „BaP¸d6 ‹àaÈžÇFcQ¸äƒFÀÆ0²ì I”Je@¬ Õ<@Ñ2¹¤Ö›™ ïø­•&Ô:$ <Æ\p0õ4-@Ô°9ä }ª€0L ûO°F‚7}R{fWàAÒÃo9 a¸Éº¸^aŠèF38¯X8@êÅ´*à ËV-Âd`€*ö'Y@ìp+vK%#$¨ß=’ÀØÑ”„ ã§Èƒ o8]g:l4ôJ2¸·X= A ¨À”ü8H>±Š jhÊ2õ®YàÍØ“™-ɧ} Böƒ¡às5g]>;ðw¼ ä„i Zhjr£)*“¾hI¸„hÉà­ˆVÂk aT †¦hë !F’esES&fiFI(fplPL,ŽruRU"ºarEG&ÜenUS&daDK.(Perfil RGB GenéricoProfil générique RVBu( RGB ‚r_icÏðProfilo RGB genericoGenerisk RGB-profilÇ|¼ RGB Õ¸\Ó Ç|Allgemeines RGB-Profilfn RGB cÏðe‡NöN‚, RGB 0×0í0Õ0¡0¤0ëPerfil RGB genéricoAlgemeen RGB-profielYleinen RGB-profiiliUniwersalny profil RGB1I89 ?@>D8;L RGBEDA *91JA RGB 'D9'EGeneric RGB ProfileGenerel RGB-beskrivelsetextCopyright 2007 Apple Inc., all rights reserved.XYZ óRÏXYZ tM=îÐXYZ Zu¬s4XYZ (Ÿ¸6curvÍsf32 BÞÿÿó&’ý‘ÿÿû¢ÿÿý£ÜÀlgnustep-gui-0.24.0/Images/common_ComboBoxEllipsis.tiff0000664000076500007650000000132010056121401022570 0ustar brains99brains99II*ÈîÌDÿ ™ wÿ w"îÌDÿ ™ wÿ wþš ¢@ÀÀÈ(Rcommon_ComboBoxEllipsis.tiffHHgnustep-gui-0.24.0/Images/common_CloseBroken.tiff0000664000076500007650000000164410000561412021571 0ustar brains99brains99II*Hÿaeaÿaeaÿÿaeaÿÿaeaÿaeaÿÿaeaÿaeaÿÿÿaeaÿaeaÿÿÿaeaÿaeaÿÿaeaÿaeaÿÿaeaÿÿaeaÿaeaÿÿþ  & O.~@@”œ(R/usr/home/stoyan/new/GNUstep/CVS.build/core/gui/Images/common_CloseBroken.tiffCreated with The GIMPHHgnustep-gui-0.24.0/Images/common_SwitchOff.tiff0000664000076500007650000000330411615731441021270 0ustar brains99brains99MM*Œ€?àOð „BaP¸d(­sÀß긠ŒE⊷4l3Å£29 7ŠGàr,¶5”*åP)dºm “ǤY¼ö 9”ÎÕr)ôÞ2¡Q(²ê<Î'<¥Í©´šJa:•Ô*²Zf‡[–×f•«fÄÿ‡•œöZ´È«o˜†m“èv I~„ÈÐ(1Ø=RSêœ/home/pingi/Download/gstep-Quellen/core/gui/Images/common_SwitchOff.tiffHHPaint.NET v3.5.5€?àOð „BaP¸d6ˆDbQ8¤V-Š¿£@Ät‚F$R9$–M'”J`¢¹`­/ÀåS9¤Öm7”Œç@tö œPhT:$¨G0©PÊ8OÑjU:¤¦£BAPúl6¡WªØlV8r2 ƒë“*uBÉo¸UPða *Õ®Ã+÷åÂen“Ÿà˜uÞy…Þ︺”Ê4þ²@ ‰QÃS-•ì®3=4ÇFò@+Õ>/—ˆæaxˆV+?¯’æâ´qý&—ÔD5P­d']°àDöQIÐÎy>‹naû¸Nö¿àôw(¦<-ìK¦>V×Ô¶éº^8.‡!£ˆ ½@_¶Q݆ó'ü=nwÉŸúD¶›fÓà†>H;œƒººâü¢.+Žg'ú Ð ÀË †:ÎÀZíÊ$»;é 8ñBª«ÌȲh{Ô=r§¡0ƒË Âo´J Æˆsö¥?«`„FI‹Á¬ºm¡°R{.ú ÂH,(ŒI ¤H¾Ê¨<2ì¥ðë'-1 )¢ò¬l±DïDTõ½¦[a0 ²„‘2"Ó4¯Hmš‘:S€9O,LÏ*P4Š¢Ë(T”ä<“õ4³ºG;PéÅ‚ËpÜ»#QÓÃJ¤T¤pê:ÓRųtŒƒS«ÄçAÌ´+ëP$Ôº¶õZV°õ}%PÖMõ`R"w%×HmxÍX0%a:Ù¶uhŠVÔÌ9d¢[W_Zv…‹CPˆ%KÔód]l"6Ó§hÊVz+Q8Wb\G·B)u9¶âQxUÖú%EÉ—³NÌSÒ%÷yJÖ˜k…€VˆZÔÞ’_å:]øCìc€§Å $×M¸›ß‚_·óŸwZ˜ÓLf›™¢—¦L™â°ô“ʯكŸØÎ5‘›¦¹Ì#Ö¸B'ˆ»z"o£Fx¾YxåHÅQ’éÊ¡!j±­‡Xë¯Ô÷\ë0öQ^êZý¼Œ`*íÊ8M»Œì4Â7 ZûrǸi Ž«ÜûÒɾm;ž[ªæÜûÂn¸Ç„m¼S=ÆLzš$™r)¿1cÑœ••³Ùœo,ˆ‡Ý+ø¢ô¡÷OÏ7·ÂõŠÊSý—mÚ`Ý·cÜR<7u›÷”7}ßâ~ gáø—·am@‚°žOGòµúæ‚®¾—Yê<9E¬þ×uîDd2 ü^OÉ[ìw¯Ó÷ô(?3ø~ˆaûûŸûÆ%úÿˆn GûX° †<<z *‚ò<©¬´(=RS¼/home/ericwa/host/common_SwitchOff4x.tiff$ $ gnustep-gui-0.24.0/Images/common_TabDownSelectedRight.tiff0000664000076500007650000000113212224735723023402 0ustar brains99brains99II*€?à@j­Z„BaP¸d62 @¸™ÿ Eà°xtv<ˆD¢‘fƒMŽ{º! ÅR²?/†HbqWú펻‘‡Dh\²]0  eR›þK'n¶À¡X©=–ÐcÃÑ ô…Ÿóy<ìuŸT£´:-1Wåö%æy€ #Öo9Ì-–ÐR­X­&”ip œ¼j½To”*#üâït ”Éb¨6Gú»<)èq` œvýW¬¿Ò*`àa:èô°ìæy] Ñhá;8NVi«Öëö;©^jµÏèJ|He‡}Ûn9|Ètf/ àk¶Nçv?þ þ =D@üîö(=RHH/home/ericwa/guitest/Images/common_TabDownSelectedRight.tiffCreated with The GIMPgnustep-gui-0.24.0/Images/common_UpAndDownArrowSmall.tiff0000664000076500007650000000066406750443351023251 0ustar brains99brains99II*J È0ÿC $xˆPT#úW`¸P¡ÃŠHÕàx±&Jœ(A’°Ác$Š“ @ô‘¢¨Ž+}È  4  R<Ž™A¤¬(=R/usr/home/michael/Sandbox/GNUstep/core/gui/Images/common_UpAndDownArrowSmall.tiffCreated with The GIMPHHgnustep-gui-0.24.0/Images/common_ProgressIndeterminate_1.tiff0000664000076500007650000000376611271671115024144 0ustar brains99brains99II*È™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™þŽ Q”@Àæî(/home/fred/GNUstep/Patches/GS_NSProgresIndie/common_ProgressIndeterminate_1.tiffHHgnustep-gui-0.24.0/Images/common_Desktop.tiff0000664000076500007650000000653411557362504021022 0ustar brains99brains99II*ì € P8$ „BaP¸d6ˆDbQ8¤V-ŒFcQ¸äv*  ® ='”Je@ øB€8(DúÇ@‡Ë½îÿƒHÏ ñ†õvòºe6˜!Ì& ÇPH62=]á7È:€Ag’úh o6¸ R#^¼žF«ñÞè)=^ˆ'Ý:ý…‡Àð y‚Â7è2¿ßÂðñd™€÷£¹r7ÀÀ$`ä˜N'7ÛîçÓéîå^€_s#åä‚t`8R™þ² ˜ß€0 ï*wf_­0ƒÍÚö4ZH`(~>Á@–0˜R0‚A@°Aœð€ܠóáÔ°¾ŸÅkÒúáÀ ?gÀ  `ClC g‹¶ÿ¢À"?ˆ` —! hg乨y w€ ‘Ê{€Éð‡q@1ª+Gx “€‰æv ÜH€€‰,€€`:S¸LIú&¼Hþ¾`!î|‡Áä@™±´ÌŠ€ÀÉ&~‚Gqì*'‡©^’$ÈÄ‹#É2\›'Ê2œ«+Ë1L¸Ç©ðžÇ¡nLôj"¨àYÊ ‚‡˜'79ò;Ètu=O¢À€Ià)ú}›‡Yì9µ]W¡ô€2wÀ©žGXÌíŸU…}_ PI‚§èy¢)ÚzŽõg×à G…nxÆwƒpåh[•u  x.H‚g‰ÒH;teº°‘( ,Gõ䟷‘Ú@ GeÖƒ@)€ eg9Ö;qöŠH8¡i¢yœ‡ |ƒç‰T3•€‰R§Ô„çé¡`@` à„ÕL}gQî9ƘZ)†€èláâq@08-×¢è GÙ®X!!ð(Û ¸Eˆ§È †pðØDfÙºg™ö€BÚú"²x}ºf¨Wî.UZ„ ¨FGÁà;'ÉòrŸñIñ:p:ê œlî ‚»0$í(Ù·ièá-‚A`-iòØ ""€}˜g!à g±ø‚@`z €yœÀ@ ~…¼2G¡Žž 0p~À‚ü(‘mvg@jDÀp€†Ÿç©yÙ ìxäèØ †`JjJÇØàH NCè~0̲`—þàaîáIŠáWª ÀRKÈ+…>uÿ'º”ÒÜ ãùÀ’÷ ;þPÉ"¶ÂŠþ‰Ly1æj€(¤ ýRIˆ`~²ú>¨üdå)Àè2üp…†z!𢉣¤yްjAxV„7€ð$ àVŠc)& m)Á³ `ª)ƒ¦¤AŒ3¢p , Ž–Ö=a€ö:•{‡Ì%ÿ˜`a€€Ð"ÁÓè½TSC`kB­IˆÿJ`Ã0$"ˆCô~áØ9‘@öñFuêà@È#gÒEÎ7WÐßC”t !Ì7IX‚€xÞ@„ R ¦ ?d˜XZKã–¦’øg'¤=ðÎ7Œá¦4‡@¾£ËШ €BÏ>Âè˜O¾ý’±@ÿ€dÀyµ6è–ŒïúF`‰c§Ö Án!Ì:¥èÖ¸t*â¬í}X£bÌZJq~1À|d9òa¡”Ù&îWëW®IñÇÎâÆã 5ÐØÃ#cÙa¢ ÿŠà, €œ©Šò¹*Ë8È…p* ŸðÌÛÐ 0)PÌzŽ´X9Ƽ³cæXTáTˆ†Lm ¡Ð0†pϲÂ@,@C}@PÞ€Oâ IFƒ`Z­Žú:ÚÏЀV!33Z(!L–5ÀÌó¤ = úQ÷rxŽËL8Çé8o¬ífA`,oð,óþV×wAƒPT (¬‘·³ªÅÚÐ Gˆ‡«Üyo'ºî†cdpñÐ0ÆxͽÁf)€¦~ÖÛËy‘½p4€øRˆ=Ãã™êNµö¦²@M™r ßC\jÞ¡–2õXZ¦  ~€Á¼ÀŽµÊ¼th0G€ïW²‘Àž£ l*¸`è"À ‰€ 3é,C1æ=R™»/² Ã8p:隬,ÓY Î@Þ=zcþ ëH#¹%ê:ƒï€aæÍÄ 8Ï9Ÿ@,B¢9G4GƒdÀ€ø`:GˆçXqÍVŽ!s$ÝÕÆû¡Ð` $þ§D"DFE£çGØt ÂL*ã˜ø ±’…K~Õ8Ì;‡%ƒn÷g€= î^£Ô‘­ A&øÈ•ÚÛ;@(Ò{ÒH4EûH%ðÃ6ÍY7GÝ—£tk^à¯èlÜW›¹ýR2Ð`\­ðäÎL9‰ô€ªš“H¬/À¡æ†ŠŠ¡þ°ŸH6åBaÂÐA¤ÍÎô ÏN~N„Öïü"ï®gr†Èt¨kjö2Á j‡E䬤¦h¥Äž°²Á ÏBáúÝ€ ¬¦úR"Í !Ü© €ÇÞ† ®Áôz¶ß„¦”ª*Jhd†aÚÁܶÊïî Î.Öû â*Þ Pа¤HAâW¯*†"Ï¥`…(tAØEÊ+L Á(f€<Š ØaÆ0:á¯(¨³Ž~¦èpù®ìà6˨.Ä@ÁêW«€hŽà”øêK¶ˆˆh?âô(FD0ÏŽóA¨ Ì € @i\$!¿Á­àhHû.¦@hV-ŒFcQ¸äv=‹¨ Â7øÈX9?_Àùúû€e²°$ò H ÙØî6Y"`ýüÿJé©`œn¹†{m¬)Š£Ëp@Þ±”RAg´ZmV¸ŠH-0 ]Ÿ¯§Ì¥úþ¹@`P2úøzÀ¯—jD óv¼`â­ÇuÐÉi3ë4qf ×Á@ëF'lÔjuV›sü`'ÑeP*}"L T‡ãîaGÝSÀ8ÜÞí´6›íì»Q£›#‹1(oÁ P›u«ðx|Z×ÛÆû2ÀÀs+Åéúý¢¿æT©müyöK~0+þîkáÐtž‡š° ìjLˆåÒ"X²î =Rcommon_Desktop.tiffg _ …HHImageMagick 6.6.2-6 2010-09-17 Q16 http://www.imagemagick.orggnustep-gui-0.24.0/Images/common_ArrowLeft.tiff0000664000076500007650000000156011576466755021326 0ustar brains99brains99MM*2€ P8$UÁ Ð…\* ‡@â;þ‡D㸴nDŸð   $ ):B(=RSXa.tiffCreated with The GIMPHH€ P8$ „BaP°T'a‘8¤V&€€¤Z=…@ 8 Je@¢M€¹¤ZZY&dóYä0!`Ìö‡ pZO‚RitÚ…V~=(€ú­B~H'Àzí>¿¢Yhöx•Õ=ŸÀ  –ßG 5Þy± /ÓÑ…Ì5ÁÏ@À‹‰šˆ*v „÷%LÊehø¼n?5GÂÝ1ûý„‚ÒOo7»î¦iqÃ]µÒ»e§g*ÚÛ¶ò =ŠÉ»Þ+ªç?R¦S¸ÑîES—ŸÐh{®|No9õb’Ù|ÆgډȤ’iG‚G<Þx|F$$ BJJ$ `h(=RSb.tiffCreated with The GIMP$ $ gnustep-gui-0.24.0/Images/page_landscape.tiff0000664000076500007650000002246610056113104020750 0ustar brains99brains99II*$???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿ???ÿ€???ÿéêêÿèííÿèîîÿèîîÿéééÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿ???ÿ @???ÿêêêÿìììÿñññÿìììÿêêêÿîîîÿîîîÿïïïÿïïïÿîîîÿíííÿïïïÿíííÿîîîÿíííÿíííÿíííÿîîîÿîîîÿïïïÿîîîÿíííÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿêêêÿ???ÿ @???ÿìööÿ×ááÿ¬¶¶ÿÔÞÞÿëõõÿ¾ÈÈÿÄÎÎÿ»ÅÅÿ¹ÃÃÿÉÓÓÿÌÖÖÿÅÏÏÿÐÚÚÿÇÑÑÿÐÚÚÿÊÔÔÿÊÔÔÿÇÑÑÿÅÏÏÿ»ÅÅÿÆÐÐÿÓÝÝÿèòòÿêôôÿéóóÿéóóÿéóóÿéóóÿéóóÿéóóÿéóóÿéóóÿéóóÿéóóÿéóóÿéóóÿéóóÿéóóÿéóóÿéóóÿéóóÿ???ÿ @???ÿñ»»ÿà©©ÿ½‡‡ÿߨ¨ÿñººÿÕŸŸÿÌ––ÿЙ™ÿÊ““ÿÃÿÑššÿÆŽŽÿÛ  ÿÓ——ÿÒ••ÿÔ˜˜ÿÕ˜˜ÿÒ••ÿΑ‘ÿÊÿÌÿÚžžÿï³³ÿï³³ÿï²²ÿï²²ÿï²²ÿïµµÿ︸ÿ︸ÿ︸ÿ︸ÿ︸ÿ︸ÿð··ÿð··ÿð··ÿð··ÿñ··ÿð··ÿð··ÿ???ÿ @???ÿÿ½½ÿÿ±±ÿÿ³³ÿÿ±±ÿÿÀÀÿÿÃÃÿÿ²²ÿÿ££ÿÿ³³ÿÿ±±ÿÿ±±ÿÿººÿÿËËÿÿÍÍÿÿÍÍÿÿÍÍÿÿÍÍÿÿÍÍÿÿÍÍÿÿÍÍÿÿÍÍÿÿÌÌÿÿÌÌÿÿÌÌÿÿÌÌÿÿÌÌÿÿÌÌÿÿÅÅÿÿÃÃÿÿÃÃÿÿÃÃÿÿÃÃÿÿÃÃÿÿÃÃÿÿÄÄÿÿÆÆÿÿÅÅÿÿÅÅÿÿÅÅÿÿÅÅÿÿÅÅÿ???ÿ @???ÿÿÿÿÿÿûûÿÿõõÿÿøøÿÿÿÿÿÿÿÿÿÿúúÿÿððÿÿôôÿÿôôÿÿôôÿÿùùÿÿþþÿÿþþÿÿþþÿÿþþÿÿþþÿÿþþÿÿþþÿÿþþÿÿþþÿÿþþÿÿþþÿÿþþÿÿþþÿÿþþÿÿþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿÿÿÿÿÿÿÿÿçççÿÑÑÑÿáááÿßßßÿÕÕÕÿãããÿßßßÿéééÿØØØÿÝÝÝÿÓÓÓÿÿÿÿÿÿÿÿÿåååÿÛÛÛÿÖÖÖÿÛÛÛÿùùùÿãããÿáááÿÎÎÎÿáááÿãããÿòòòÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿOOOÿ¿¿¿ÿÂÂÂÿ¿¿¿ÿºººÿ¹¹¹ÿµµµÿ´´´ÿ¯¯¯ÿåååÿOOOÿÿÿÿÿÿÿÿÿñññÿáááÿìììÿêêêÿåååÿìììÿáááÿåååÿÖÖÖÿÏÏÏÿÍÍÍÿÿÿÿÿÿÿÿÿæææÿÙÙÙÿÐÐÐÿàààÿÛÛÛÿÜÜÜÿÕÕÕÿíííÿêêêÿØØØÿÜÜÜÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿOOOÿÄÄÄÿÁÁÁÿ¿¿¿ÿ¿¿¿ÿºººÿ···ÿµµµÿ´´´ÿÓÓÓÿOOOÿÿÿÿÿÿÿÿÿçççÿÝÝÝÿÓÓÓÿèèèÿæææÿäääÿðððÿÐÐÐÿàààÿâââÿïïïÿÿÿÿÿÿÿÿÿäääÿäääÿÞÞÞÿëëëÿâââÿÝÝÝÿÜÜÜÿòòòÿâââÿßßßÿäääÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿOOOÿ¹¹¹ÿ¿¿¿ÿ¿¿¿ÿ¬¬¬ÿ¢¢¢ÿµµµÿ¹¹¹ÿ···ÿ°°°ÿOOOÿÿÿÿÿÿÿÿÿçççÿéééÿåååÿÝÝÝÿäääÿôôôÿäääÿèèèÿßßßÿßßßÿåååÿÿÿÿÿÿÿÿÿâââÿîîîÿÐÐÐÿÙÙÙÿáááÿÙÙÙÿÝÝÝÿìììÿàààÿæææÿØØØÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿOOOÿ•••ÿ£££ÿªªªÿÿŽŽŽÿšššÿ˜˜˜ÿ›››ÿÿOOOÿÿÿÿÿÿÿÿÿâââÿæææÿßßßÿ×××ÿÏÏÏÿêêêÿÛÛÛÿÝÝÝÿÍÍÍÿÖÖÖÿØØØÿÿÿÿÿÿÿÿÿåååÿÓÓÓÿäääÿØØØÿÖÖÖÿßßßÿôôôÿÒÒÒÿÔÔÔÿÚÚÚÿíííÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿOOOÿšššÿŽŽŽÿÿ‹‹‹ÿ“““ÿ‘‘‘ÿ‘‘‘ÿ†††ÿ†††ÿOOOÿÿÿÿÿÿÿÿÿÛÛÛÿáááÿÓÓÓÿéééÿÓÓÓÿñññÿÔÔÔÿÛÛÛÿäääÿáááÿòòòÿÿÿÿÿÿÿÿÿßßßÿÓÓÓÿÔÔÔÿÎÎÎÿÒÒÒÿàààÿóóóÿìììÿëëëÿðððÿõõõÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿOOOÿ£££ÿŒŒŒÿŒŒŒÿÿ˜˜˜ÿšššÿ   ÿŽŽŽÿÿOOOÿÿÿÿÿÿÿÿÿÙÙÙÿéééÿðððÿ×××ÿàààÿ×××ÿÔÔÔÿÔÔÔÿÝÝÝÿæææÿßßßÿÿÿÿÿÿÿÿÿÝÝÝÿÐÐÐÿÝÝÝÿÌÌÌÿØØØÿÎÎÎÿìììÿÿÿÿÿÿÿÿÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿOOOÿ˜˜˜ÿÿŒŒŒÿÿ‰‰‰ÿ‰‰‰ÿ‹‹‹ÿ†††ÿŒŒŒÿOOOÿÿÿÿÿÿÿÿÿäääÿãããÿíííÿØØØÿØØØÿÚÚÚÿÑÑÑÿÙÙÙÿßßßÿëëëÿäääÿÿÿÿÿÿÿÿÿáááÿåååÿÝÝÝÿÚÚÚÿÝÝÝÿÖÖÖÿìììÿãããÿØØØÿËËËÿÜÜÜÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿOOOÿÿÿÿÿÿÿÿÿèèèÿÞÞÞÿóóóÿÝÝÝÿÑÑÑÿåååÿÖÖÖÿÞÞÞÿÞÞÞÿðððÿîîîÿÿÿÿÿÿÿÿÿéééÿãããÿñññÿéééÿåååÿèèèÿâââÿëëëÿäääÿïïïÿàààÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿåååÿÛÛÛÿÖÖÖÿÛÛÛÿùùùÿãããÿáááÿÎÎÎÿáááÿãããÿòòòÿÿÿÿÿÿÿÿÿßßßÿÓÓÓÿäääÿÛÛÛÿÙÙÙÿÕÕÕÿÕÕÕÿàààÿÜÜÜÿëëëÿÐÐÐÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿæææÿÙÙÙÿÐÐÐÿàààÿÛÛÛÿÜÜÜÿÕÕÕÿíííÿêêêÿØØØÿÜÜÜÿÿÿÿÿÿÿÿÿéééÿØØØÿÇÇÇÿÕÕÕÿìììÿáááÿâââÿàààÿáááÿÇÇÇÿàààÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿüüüÿèèèÿåååÿóóóÿñññÿùùùÿéééÿåååÿðððÿôôôÿðððÿ÷÷÷ÿÿÿÿÿÿÿÿÿäääÿäääÿÞÞÞÿëëëÿâââÿÝÝÝÿÜÜÜÿòòòÿâââÿßßßÿäääÿÿÿÿÿÿÿÿÿæææÿÛÛÛÿíííÿôôôÿÝÝÝÿßßßÿãããÿÝÝÝÿÚÚÚÿâââÿéééÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿøøøÿØØØÿÈÈÈÿåååÿÍÍÍÿäääÿÝÝÝÿÅÅÅÿÍÍÍÿÏÏÏÿÃÃÃÿìììÿÿÿÿÿÿÿÿÿâââÿîîîÿÐÐÐÿÙÙÙÿáááÿÙÙÙÿÝÝÝÿìììÿàààÿæææÿØØØÿÿÿÿÿÿÿÿÿØØØÿÎÎÎÿàààÿëëëÿÜÜÜÿÜÜÜÿÐÐÐÿÏÏÏÿ×××ÿÙÙÙÿêêêÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿêêêÿîîîÿïïïÿòòòÿìììÿãããÿôôôÿØØØÿÓÓÓÿèèèÿæææÿÿÿÿÿÿÿÿÿåååÿÓÓÓÿäääÿØØØÿÖÖÖÿßßßÿôôôÿÒÒÒÿÔÔÔÿÚÚÚÿíííÿÿÿÿÿÿÿÿÿÙÙÙÿÎÎÎÿÓÓÓÿÓÓÓÿßßßÿ×××ÿÚÚÚÿÎÎÎÿÖÖÖÿÊÊÊÿòòòÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÒÒÒÿÑÑÑÿâââÿ÷÷÷ÿéééÿÏÏÏÿÞÞÞÿáááÿÖÖÖÿÜÜÜÿÚÚÚÿÿÿÿÿÿÿÿÿßßßÿÓÓÓÿÔÔÔÿÎÎÎÿÒÒÒÿàààÿóóóÿìììÿëëëÿðððÿõõõÿÿÿÿÿÿÿÿÿçççÿàààÿâââÿçççÿÜÜÜÿÜÜÜÿäääÿâââÿßßßÿÝÝÝÿÛÛÛÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿüüüÿÚÚÚÿàààÿÛÛÛÿ×××ÿØØØÿÒÒÒÿìììÿéééÿàààÿÔÔÔÿÛÛÛÿÿÿÿÿÿÿÿÿÝÝÝÿÐÐÐÿÝÝÝÿÌÌÌÿØØØÿÎÎÎÿìììÿÿÿÿÿÿÿÿÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿãããÿÙÙÙÿÔÔÔÿëëëÿÙÙÙÿáááÿàààÿÜÜÜÿÙÙÙÿÛÛÛÿÓÓÓÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿøøøÿÈÈÈÿèèèÿÜÜÜÿÚÚÚÿÓÓÓÿßßßÿóóóÿöööÿãããÿÍÍÍÿÏÏÏÿÿÿÿÿÿÿÿÿáááÿåååÿÝÝÝÿÚÚÚÿÝÝÝÿÖÖÖÿìììÿãããÿØØØÿËËËÿÜÜÜÿÿÿÿÿÿÿÿÿãããÿÐÐÐÿØØØÿãããÿßßßÿÛÛÛÿÝÝÝÿÑÑÑÿáááÿÕÕÕÿÚÚÚÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿøøøÿ×××ÿæææÿÆÆÆÿàààÿêêêÿöööÿãããÿØØØÿØØØÿ×××ÿØØØÿÿÿÿÿÿÿÿÿéééÿãããÿñññÿéééÿåååÿèèèÿâââÿëëëÿäääÿïïïÿàààÿÿÿÿÿÿÿÿÿåååÿÛÛÛÿßßßÿÛÛÛÿßßßÿâââÿóóóÿ×××ÿòòòÿãããÿâââÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿúúúÿÌÌÌÿÖÖÖÿÉÉÉÿÌÌÌÿäääÿòòòÿÝÝÝÿÊÊÊÿÔÔÔÿºººÿÕÕÕÿÿÿÿÿÿÿÿÿßßßÿÓÓÓÿäääÿÛÛÛÿÙÙÙÿÕÕÕÿÕÕÕÿàààÿÜÜÜÿëëëÿÐÐÐÿÿÿÿÿÿÿÿÿÜÜÜÿØØØÿÚÚÚÿÙÙÙÿæææÿÕÕÕÿçççÿÚÚÚÿÖÖÖÿàààÿÛÛÛÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿþþþÿæææÿèèèÿîîîÿóóóÿöööÿéééÿæææÿêêêÿúúúÿðððÿãããÿÿÿÿÿÿÿÿÿéééÿØØØÿÇÇÇÿÕÕÕÿìììÿáááÿâââÿàààÿáááÿÇÇÇÿàààÿÿÿÿÿÿÿÿÿÞÞÞÿÙÙÙÿÕÕÕÿÖÖÖÿÝÝÝÿÒÒÒÿØØØÿÑÑÑÿÕÕÕÿðððÿèèèÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿüüüÿÐÐÐÿÌÌÌÿÁÁÁÿÊÊÊÿàààÿËËËÿÝÝÝÿÑÑÑÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿæææÿÛÛÛÿíííÿôôôÿÝÝÝÿßßßÿãããÿÝÝÝÿÚÚÚÿâââÿéééÿÿÿÿÿÿÿÿÿáááÿÛÛÛÿ»»»ÿ®®®ÿ¾¾¾ÿÖÖÖÿêêêÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ???ÿ @???ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ???ÿ @???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ???ÿ @€                                          @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@þ00Ú$ Dâ$@$&%.%(R/home/heron/Development/gnustep/core/gui/Images/page_landscape.tiffHHgnustep-gui-0.24.0/Images/common_TabUnSelectedLeft.tiff0000664000076500007650000000115612224735723022700 0ustar brains99brains99II*€ P8$ „AlÆx3¿ß8LV-…Ãañ•À¿1y$"3ˆ?ÜÒ° Ñæô4ÚM9,ÖN/ €Ðˆ5þÚl¶€3)¤ÖŒrÒ@ªcý¾Þo€YÌÖu'ŠF€X(? Ðæui­%ËK¦ÀÀ*ÕZ¶É%“Cp »nÀ €Á·É,Ö€ÓýÒäs^/Y…{½ž÷[»ý¶à´™lÜ|[0àôO÷†”êtº¦6<ì'LÂÊñ,v+[ e4¶ÃQháÿj§·À:®Þºä¼·û•Òé²LN4b(ˆº]³Éíêu`SyÌîzÿpeÀ,Ö†sÄÿøoüVHþ  :X@(=RHH/home/ericwa/guitest/Images/common_TabUnSelectedLeft.tiffCreated with The GIMPgnustep-gui-0.24.0/Images/common_SliderHoriz.tiff0000664000076500007650000000147312230120052021617 0ustar brains99brains99II*ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ]ÿÿÿÿÿÿªÿªÿªÿªÿªÿªÿ]ÿÿÿªÿªÿªÿªÿªÿªÿªÿ]ÿÿÿÿÿÿªÿªÿªÿªÿªÿªÿ]ÿÿÿªÿªÿªÿªÿªÿªÿªÿ]ÿÿÿÿÿÿªÿªÿªÿªÿªÿªÿ]ÿÿÿªÿªÿªÿªÿªÿªÿªÿ]ÿÿÿÿÿÿªÿªÿªÿªÿªÿªÿ]ÿÿÿªÿªÿªÿªÿªÿªÿªÿ]ÿÿÿÿÿÿªÿªÿªÿªÿªÿªÿ]ÿÿÿªÿªÿªÿªÿªÿªÿªÿ]ÿÿÿÿÿÿªÿªÿªÿªÿªÿªÿ]ÿÿÿªÿªÿªÿªÿªÿªÿªÿ]ÿÿÿÿÿÿªÿªÿªÿªÿªÿªÿ]ÿÿÿªÿªÿªÿªÿªÿªÿªÿ]ÿÿÿÿÿÿªÿªÿªÿªÿªÿªÿ]ÿÿÿªÿªÿªÿªÿªÿªÿªÿ]ÿÿÿÿÿÿªÿªÿªÿªÿªÿªÿ]ÿÿÿªÿªÿªÿªÿªÿªÿªÿ]ÿÿÿÿÿÿªÿªÿªÿªÿªÿªÿ]ÿÿÿªÿªÿªÿªÿªÿªÿªÿ]ÿÿÿÿÿÿªÿªÿªÿªÿªÿªÿ]ÿÿÿªÿªÿªÿªÿªÿªÿªÿ]ÿÿÿÿ]ÿ]ÿ]ÿ]ÿ]ÿ]ÿ]ÿ]ÿªÿ]ÿ]ÿ]ÿ]ÿ]ÿ]ÿ]ÿ]ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþ =þ@îö(RHH/home/ericwa/gnustep/core/gui/Images/common_SliderHoriz.tiffgnustep-gui-0.24.0/Images/common_Nibble.tiff0000664000076500007650000000232211560331667020573 0ustar brains99brains99MM*b€?àOð „Ba@d¿áØTVR*”ŸêåZºÄáñi$b5I¡’KÇ@©¦V)˧PYDÎ3‚NèQyüêMA¡ÒaTzU L =T’Y¨°(=RS¸|/usr/home/michael/Sandbox/core/gui/Images/common_Nibble.tiffCreated with The GIMPHH€?àOð „BaP¸d6ˆDbQ1üTÂŒbpø7HdR8ˆÎLgJ`ñ©$;-˜LfR7ôÔ-œÓ¸\²c/™ÐhT8@ÚŒeÒaóé…¨S(•: |@0XLú%R’S¡•VÍ$ ‘,дd®U«¢vYŠ{Q³Þd "!ˆÓ`EP{…Ê¿3»B¬—¬d@€C 2‚Y1¬/ sÄ@éwŒnvR*”£Ðܼ?@R âa8¼ö¶§ÑÃ4°í>§5ÖkµÛ~εÌÀ³u ÖëyßC8-T#sÅÎñô—‡.·§ç:Ç-ÔÓhvÜ-Çk·Œél¼O½Šóyï>žþÙ¨÷pî•zÈP* +Ï“ä³ïk˜ì,o2Òµ­ ˆe5°"ë)°Bî€kêþÀÌ ÝBHL(–¹¨<e²`“+»q ¬0² Їèº1GŒ`‘¬I0f”%QÌ„êÀɉû#ŸéÀZ'’"? k)ŸêI—'ËÔ‹¾’̼ô;²üÄÆË³̡̳<Ô˜Í3\Ü‘M³|ä‰Î3œìû½ó¼r€€, f 6n¤À ¼ºÂ(=RSÊ/home/ericwa/host/Desktop/tiffs/common_Nibble-x4.tiffCreated with The GIMP$ $ gnustep-gui-0.24.0/Images/common_StepperDownHighlighted.tiff0000664000076500007650000000063612227054647024022 0ustar brains99brains99II*b€*Ÿð8$ U@ Ð¸"C€"Q#Äl=`VÄZk1`ŒV´zÿ~­œï÷:Ùû&ƒK_r¨<~ Å`Ȧ²xÕ‡Ã!â­G¤Bbtºe.þ  HDŒ@Y4<(HH/home/ericwa/gnustep/core/gui/Images/common_StepperDownHighlighted.tiffCreated with GIMPgnustep-gui-0.24.0/Images/common_linkCursor.tiff0000664000076500007650000000057107402765730021541 0ustar brains99brains99II*” $h°àý‡&l¸ðþ#† `´(1B‰3h4€q9FüDq“¤>_ÿ@@`ÿ@@`ÿ@@`ÿ>>_ÿ==^ÿ==[ÿ<>_ÿ@@aÿAAcÿAAcÿAAcÿ@@aÿ>>_ÿ>>^ÿ==[ÿ99Yÿ77Uÿ66Rÿ44Pÿ22Lÿ11Jÿ//Hÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿLLLÿ...ÿÿÿÿŸŸŸÿŸŸŸÿŸŸŸÿ$ÿ//Jÿ11Jÿ11Kÿ33Mÿ44Pÿ77Rÿ88Uÿ;;Yÿ<<[ÿ>>_ÿ@@aÿBBdÿBBeÿCCeÿBBeÿBBdÿAAaÿ@@`ÿ>>^ÿ;;Zÿ88Vÿ77Tÿ66Qÿ22Mÿ11Kÿ11Jÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿLLLÿ...ÿÿÿÿŸŸŸÿŸŸŸÿŸŸŸÿ%ÿ11Lÿ22Lÿ33Mÿ44Pÿ77Rÿ88Vÿ;;Yÿ==^ÿ@@`ÿBBdÿCCfÿFFiÿGGjÿGGkÿGGjÿFFjÿEEhÿCCeÿAAcÿ>>_ÿ<>^ÿ<<[ÿ99Yÿ77Tÿ66Qÿ44PÿŠ€ŠÿÿÿÿÿÿÿÿÿÿÿÿÿJJJÿ***ÿÿÿÿ•ª•ÿŸŸŸÿŸŸŸÿ(ÿ33Oÿ66Qÿ66Rÿ77Uÿ99Wÿ<<[ÿ>>^ÿAAcÿCCeÿFFjÿHHmÿKKrÿLLsÿLLsÿLLsÿLLrÿJJoÿHHmÿFFjÿCCeÿ@@`ÿ==^ÿ<<[ÿ88Uÿ77Rÿ66Qÿ€Š€ÿÿÿÿÿÿÿÿÿÿÿÿÿJJJÿ)))|||ÿÿÿÿª•ªÿŸŸŸÿŸŸŸÿ(ÿ44Qÿ66Rÿ77Tÿ99Wÿ;;Zÿ==^ÿ@@`ÿCCeÿEEhÿHHnÿKKpÿMMuÿOOwÿPPxÿPPxÿOOwÿLLtÿKKrÿHHnÿFFiÿBBdÿ@@`ÿ==^ÿ;;Wÿ88Uÿ77TÿŠ€ŠÿÿÿÿÿÿÿÿÿÿÿÿÿHHHÿ'''vvvÿÿÿÿŸŸŸÿŸŸŸÿŸŸŸÿ)ÿ66Rÿ77Tÿ88Uÿ;;Yÿ<<[ÿ>>_ÿAAaÿCCfÿFFjÿJJoÿLLsÿPPxÿQQyÿQQzÿQQzÿQQyÿOOwÿLLsÿJJpÿGGkÿCCeÿAAcÿ>>_ÿ;;Zÿ88Vÿ88Uÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿGGGÿ$$$mmmÿÿÿÿª•ªÿŸŸŸÿŸŸŸÿ*ÿ77Tÿ88Vÿ99Wÿ;;Zÿ==\ÿ@@aÿBBdÿFFiÿHHmÿLLrÿOOuÿRRzÿTT}ÿTT~ÿTT~ÿTT}ÿQQyÿOOwÿLLsÿHHnÿEEhÿBBdÿ@@aÿ<<[ÿ;;Yÿ99VÿŠ€ŠÿÿÿÿÿÿÿÿÿÿÿÿÿFFFÿ"""gggþþþÿ•ª•ÿŸŸŸÿŸŸŸÿ*ÿ77Tÿ88Vÿ99Wÿ<<[ÿ==^ÿAAaÿBBeÿFFiÿHHmÿLLsÿOOwÿRR|ÿTT~ÿUUÿUUÿTT~ÿQQzÿPPwÿMMsÿJJnÿFFhÿCCeÿAAaÿ==\ÿ;;Yÿ99Wÿ€Š€ÿÿÿÿÿÿÿÿÿÿÿÿÿEEEÿ ]]]ôôôÿŸŸŸÿŸŸŸÿŸŸŸÿ*ÿ77Tÿ88Vÿ99Wÿ<<[ÿ==^ÿAAaÿBBeÿFFiÿHHmÿLLsÿOOwÿRR|ÿTT~ÿUUÿUUÿTT~ÿQQzÿPPwÿMMtÿJJnÿFFiÿCCeÿAAaÿ==\ÿ;;Yÿ99Wÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿCCCÿXXXïïïÿ•ª•ÿŸŸŸÿŸŸŸÿ*ÿ77Tÿ88Vÿ99Wÿ;;Zÿ==\ÿ@@aÿBBdÿFFiÿHHmÿLLrÿOOuÿRRzÿTT~ÿTT~ÿTT~ÿTT}ÿQQyÿOOwÿLLsÿHHnÿEEhÿBBdÿ@@aÿ<<[ÿ;;Yÿ99Vÿ€Š€ÿÿÿÿÿÿÿÿÿÿÿÿÿBBBÿOOOæææÿª•ªÿŸŸŸÿŸŸŸÿ)ÿ66Rÿ88Uÿ99Vÿ;;Yÿ<<[ÿ@@`ÿAAcÿEEhÿGGkÿKKpÿMMtÿQQyÿRRzÿRR|ÿRR|ÿRRzÿPPxÿMMtÿKKrÿHHmÿEEfÿBBcÿ@@`ÿ<<[ÿ99Wÿ88VÿŠ€ŠÿÿÿÿÿÿÿÿÿÿÿÿÿAAAÿJJJáááÿ•ª•ÿŸŸŸÿŸŸŸÿ)ÿ66Qÿ77Tÿ88Uÿ99Yÿ<<[ÿ>>_ÿAAaÿCCfÿFFiÿJJoÿLLrÿOOwÿPPxÿQQyÿQQyÿPPxÿMMuÿLLsÿJJoÿGGjÿCCeÿAAaÿ>>_ÿ;;Yÿ88Vÿ88Uÿ€Š€ÿÿÿÿÿÿÿÿÿÿÿÿÿ@@@ÿCCCÚÚÚÿŸŸŸÿŸŸŸÿŸŸŸÿ(ÿ44Pÿ66Qÿ66Rÿ88Uÿ99Wÿ<<\ÿ>>_ÿBBcÿCCfÿGGkÿJHnÿLLsÿMMtÿMMtÿMMtÿMMsÿKKpÿHHnÿGGkÿCCfÿ@@aÿ>>^ÿ<<[ÿ99Vÿ77Tÿ66Rÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿ@@@ÿ<<<ÒÒÒÿŸŸŸÿŸŸŸÿŸŸŸÿ'ÿ22Mÿ33Oÿ44Pÿ66Rÿ88Uÿ99Yÿ<<[ÿ>>_ÿAAcÿCCfÿEEiÿHHmÿHHnÿJJnÿJJnÿHHmÿFFjÿEEhÿCCfÿAAaÿ==\ÿ;;Zÿ99Wÿ66Rÿ44Pÿ33Oÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿ>>>ÿ999ÐÐÐÿŸŸŸÿŸŸŸÿŸŸŸÿ%ÿ11Lÿ22Lÿ33Mÿ44Pÿ77Rÿ88Vÿ;;Yÿ==^ÿ@@`ÿBBdÿCCfÿFFiÿGGjÿGGkÿGGjÿFFjÿEEhÿCCeÿAAcÿ>>_ÿ<>^ÿ@@`ÿAAcÿBBdÿBBdÿBBdÿAAcÿ@@`ÿ>>_ÿ==\ÿ;;Zÿ88Vÿ66Tÿ44Qÿ22Lÿ11Kÿ11JÿŠ€Šÿÿÿÿÿÿÿÿÿÿÿÿÿ===ÿ333ÊÊÊÿŸŸŸÿŸŸŸÿŸŸŸÿ ÿ$ÿ%ÿ%ÿ'ÿ(ÿ)ÿ*ÿ,ÿ-ÿ.ÿ/ÿ 1ÿ 1ÿ 1ÿ 1ÿ 1ÿ/ÿ.ÿ.ÿ,ÿ*ÿ)ÿ(ÿ%ÿ%ÿ$ÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿ<<<ÿ222ÈÈÈÿôéôÿîîîÿîîîÿÿšššÿ–––ÿ”””ÿŒŒŒÿ‡‡‡ÿ€€€ÿzzzÿsssÿoooÿjjjÿhhhÿdddÿcccÿcccÿcccÿeeeÿiiiÿkkkÿoooÿuuuÿ}}}ÿ‚‚‚ÿ‡‡‡ÿ‘‘‘ÿ–––ÿšššÿáÜáÿÿÿÿÿÿÿÿÿÿÿÿÿ<<<ÿ222ÈÈÈÿþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþþþþþÿÿÿÿþþþÿøøøÿðððÿíííÿãããþßßßþÝÝÝþÞÞÞÿÞÞÞÿÞÞÞÿßßßÿáááÿäääþêêêþïïïþôôôþýýýþÿÿÿÿþþþþþþþþþþþþþþþþøíøÿ<<<ÿ222ÈÈÈÿþþþþþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþÿÿÿÿþþþÿøøøþôôôþïïïþêêêþèèèþèèèÿâââþßßßþÝÝÝþÛÛÛþÚÚÚþÙÙÙþÛÛÛÿÙÙÙþÙÙÙþÙÙÙþÙÙÙþ<<<ÿ#((¹¾¾ÿþþþþþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþþþþþüüüþøøøþôôôþïïïþêêêþèèèþåååþâââþßßßþÝÝÝþÛÛÛþÚÚÚþÙÙÙþÙÙÙþÙÙÙþÙÙÙþÙÙÙþÙÙÙþ<<<ÿÀBEEÿ^^^þ^^^þ^^^þ^^^þ^^^þ___ÿ]]]þ]]]þ[[[þZZZþ[[[ÿXXXþUUUþTTTþQQQþQQQÿOOOÿJJJþIIIþFFFþDDDþBBBþCCCÿ@@@þ???þ===þ===þ<<<þ<<<þ>>>ÿ;;;þ;;;þ;;;þ;;;þLLLÿ?111111111tpt¿†Œ†ÿþŽŽŽþÿ‹‹‹þ‰‰‰þ‡‡‡ÿƒƒƒþ}}}þyyyþsssÿmmmÿ___ÿQQQþJJJþBBBþ;;;ÿ000þ+++þ&&&þ!!!þþþþþþÿÿ¿?~~ËËËÿ¿¿¿þ¿¿¿þÁÁÁÿ¼¼¼þºººþ¸¸¸ÿ³³³ÿ¨¨¨þ¢¢¢þ•••þ‹‹‹þyyyÿeeeþYYYþPPPÿ???þ000þ(((þ!!!þÿþþþ þ þÿÿ666ÿA,Aÿ,A,ÿ666ÿ666ÿ,A,ÿA,Aÿ,ÿÿÿ ÿÿÿ ÿ ÿÿ ÿÿÿ,A,ÿAAAÿ666ÿ666ÿAAAÿ,A,ÿ,ÿÿ ÿ ÿÿ ÿ ÿ ÿÿÿÿÿ###?^^^^^^]]]]]]\\\YYYWWWTTTŒ‡‡ÿojjÿ_j_ÿe[eÿFFFÿC>>ÿ>99ÿ444ÿ###ÿÿÿÿÿ050¿     ?###?•••¿ËËËÿËËËÿÊÊÊÿÊÊÊÿÈÈÈÿÆÆÆÿÃÃÃÿÁÁÁÿ¼¼¼ÿ¹¹¹ÿ³³³ÿ¯¯¯ÿ¥¥¥ÿžžžÿ™™™ÿ”””ÿŒŒŒÿ†††ÿ‚‚‚ÿÿzzzÿwwwÿejeÿdidÿrrrÿrrrÿrrrÿy~yÿGSG¿$$$ÿ6A6ÿ6A6ÿA,Aÿ,A,ÿ6A6ÿ666ÿ,A,ÿAAAÿ666ÿ666ÿAAAÿ,A,ÿ,A,ÿ6A6ÿ666ÿ666ÿAAAÿ666ÿ666ÿ6A6ÿ,A,ÿ666ÿ6A6ÿ6A6ÿ666ÿAAAÿ,A,ÿ666ÿ6A6ÿ ññ ññ ññ ññ ññ ññ ññ ññ ññ ññòòññññññòòòòññññïñåñÝñÓòÉñ¾ñ³ñ©ñŸñ –ñ Œò ƒñ yñ sñ lò eò `ñ[òVñRòOñLñJñHñGñFñFñEñ y ññ¢þ¢þ¢þ¢þ¢þ¢þ¡þ¡þŸþžþþœþšþ™þ—þ ”þ”ÿ þ þ Šþ †þ „þ €þ ~þ {þ wþ tþ qþ nþ lþ kÿ gþ dþ bþ `þdþcþ ]þ ]þ [þ [þ Zþ Zþ ZþEú{ññ¢þ¢þ¢þ¢þ¢þ¢þ¡þ¡þŸþžþžþþšþ™þ—þ •þ “þ þ þ Šþ ˆþ „þ €þ ~þ {þ wþ tþ qþ nþ jþ hþ gþ dþ bþ `þYX”þ-,vþJIˆþŠŠµþnmŸþgešþ Zþ Zþ Zþ<þåñ¢þ¢þ¢þ¢þ¢þ¢þ¡þ¡þŸþŸþžþŸÿšþ™þ—þ •þ•ÿ þ þ Šþ ˆþ „þ €þ ~þ {þ wþ tþ qþ nþ jþ jÿ eþ dþ bþ `þ aÿ\÷Y÷VøS÷S÷JñQøOøQ÷Q÷Fò¦ò¤ÿ¢þ¢þ¢þ¢þ¢þ¢þ¡þŸþŸþžþþšþ™þ—þ˜ÿ “þ þ þ Šþ ˆþ „þ €þ ~þ {þ ‚û ‹ø ‚÷ }ø xø wô ~ô €ø f÷ cø _÷ lû lþ ^þ ]þ [þ [þ Zþ Zþ Zþ ZþBò mñ¢þ¢þ¢þ¢þ¢þ¢þ¡þ¡þŸþŸþžþþšþ™þ—þËøÇøÂø»÷·øÈõ²ø­ø¨ø™ø “ø‰ÿ …þ |þ rÿ mþ jþ hþ eþ cþ bþ `þ ^þ ^þ ]þ [þ [þ Zþ Zþ Zþ Zþ9õLñ¢þ¢þ¢þ¢þäøãøãøá÷áøôôÕøÔøÓøÐøÎø³û˜ÿ”þ•ÿ þ þ Šþ‰ÿ ƒþ €þ }þ yþ wþ sþ oþ mþ jþ jÿ eþ cþ bþ _þ ^þ ]þ ]þ [þ [þ Zþ Zþ Zþ Zþ,ù hôÛõõõÞøÞøÞø™ÿšþšþšþšþþŸþžþþšþ™þ—þ ”þ ’þ þ þ Šþ †þ ƒþ €þ }þ yþ wþ uÿ oþ mþ jþ hþ eþ<:„þ’’¼þgežþJI‰þXX’þ}|«þQP‹þvt¤þnmžþnmŸþ32wþ Zþ#ý Zx¬÷¢þ¢þ¢þ¢þ¢þ¢þ¡þ¡þŸþžþžþœþšþ™þ—þ ”þ ’þ þ þ Šþ †þ ƒþ €þ }þ yþ wþ sþ oþ mþ jþ jÿ eþ cþ bþ `þ ^þ ]þ ]þ [þ&$nþ Zþ Zþ Zþ Zþ!þ'yFòFòFòFòFòFòFòFòCòCòBòBòAó?ó>ó>ô=ô:õ8õ6ö5ö4÷1ø/ø,ù+ú)ú'û&û$ü#ü"ý!ýýþþþþþþþþþþþþ 00$ª$$²$º(R ü€' ü€'gnustep-gui-0.24.0/Images/common_LibraryFolder.tiff0000664000076500007650000001047411466771424022153 0ustar brains99brains99II*F€ P8$ „BaP¸d6ˆD`æø¡ýl¶\¿‹%’úþ%HdR9$„o'©åKôz=*þ2 /ñp¸lÿˆÅKé,ö}? Ib†óü©N¿I$Sñ¸Ø€þІoàH,¿€ãú v½_žÉÆãúýr¹^?¦Ã³øt9"?ÄBCüH ¿ì»åöb”ÊÒédóü˜K,¿ÆñËü> ¿Ç¢ÓüÈ+ÊŠÂ@»Õû=Ÿ ÙW«Æù4šQ?È„"{üJ$¿Äá`£üŠ Èåò»¬¶aþK„ŸÒK,^2J%OúdGe_¯Øoóáéþ ˆ/ñ0”Zÿò$Ñ×yçßo BÃøŽ gaX 4²\ÿ4ñx¼n_ª ª¸æ¢°jÀiêÊú”…XŠ"x¼‡aЊÇ2 ³p‹3rôÄ «ÖöŒ/aý½£Pö† ¨á k)p\gù"HÇøX©á@ŸàX&A0"AhÖ?åÑnläÑ.YàÀ09hzÊb˜†IþFdÑþ+ŠÃ1þ¨†oļ4BÞ²£ VEOh¼‚çð¿<Ó¼ó?Ãø¬%ä(ð:Ë9xŒøÎ‰¢n'àý ø@ÌŒ‚Éù&HEùRS‡ù2K2Œ¦“dÁh‹bÈÒù¢VW•ÅÉþI’% þ#‚‰þl«&ÝÍïC+=Ïóà»iZ“ͧ<“Äöå‘\’¤¡6­â)üAQÿJRÄnãÈhâÐJ ÔØO4T™'JQNbÕÒ¡?’ÀÌ:]bh¨àøHò;‘‡øŽ#‰ùfYÏÀÊ<Ÿá‹52-¼?feüQ=Z³ìV‹ñý˜Ï9¡üNVÙx^çøæ9¯`<ð;uÒ´(rŸ÷uà=^gøÜèâ F ŸÀø}³õK)J’‘fd r4axnXÖ{aþG…)þ;ޤQþ `©þ†!Û$ÊCôáÁ·“¬û>fÙµ§L‹yø* 6áco“„ÙFü ïØLšE,4† þ?†Ýœê§SÔj#˜báø4Æ`Ûøž+·mfÜJPyC0²Pý†‹s8Tà˜$Ú‹¹x³Áz4Ëx/Îy·|{g÷º.Oý²=ŸæT“ÄéL!¸„ˆaxaÏiZgIÑuΣÕõÝ€Ü €Øþ @° àz]¢Ÿ H«d?Þ…nØ1† æm‚ PyO0›E @°ÿ ËÞBHG^Áí{¯t-eð½—À{  Á‡ðÂC‡Þ`0;í£ºL»Ýcªq-zG^Ï¢xk°ÅH?ƒDW``;RúsÈ©o;a($…aþBº ì#ð4Z86èÛ·¨O a w ð’/qý Ô~†Ðà^‹X?…P¨oÀ „è6?—cõtn”êX•%Çø{u À– [CdŸÁ®+ÅX±ÃA˜fnO éeƒLmñŽ1F¨ÿâNðx…£tp˜-¸í ¦Dy„‘îÂÓ#3£<~ Á$#3uµ-†8ÍïË„pŠâ ÿˆÍ4/ïgDš^ÔÉÐæ àþ ðO@¥e0iŠóè ðÎ ÀÈþ Àª€„Ó‚?€Ð «ðˆ ²V/ØÈò%E†0ÂÃ#\C€qL…P\Ó“Wô…½Bï4WÀW.ãø+RºTÖ)xþ¦"D=-±|,Ehÿ‚Ížˆü"Ù01²D2‚å, »¢ÀÙzN©2Ôjptžø8‚ùâtñð6Ê(¥ ,ú€²¦€Ïó+@èf7Á(øà0hY£Pnñd+Ø ~¢ ¾×ÞÀøá:(ïI)"±"–µ‹K)]±ðÙò Á˜4‡ø¸ê¥…áü š3ô­.J¯@ù%­-©j X;);Uj½VžSÒ­ÏQý(gĨ•Sþ´ÐB` hdDÈŒ€:Gð†°´A¶ ˆ\€°sHï>6.Å]ÚJÀ þjÍ`*µqüÂGÂÐU ü3†l¹" Kð¨ƒi3ޤ:+ú?ê]¦µàÚËA=°ª–ÊyÕ©éWe^Šp }ʪÐ?ƒ-¾¸T1Ü4Lœh)à&/Á þ @Šðâ»Âñ`þÆ¿‰‘ÀÚcø` áš÷‚· `ü!¿A9Gýÿ´ø &:Å-„NháÊÙ`ª±œÜ3ØO0§B3%63{]À€0¡5Eدãb Aü°þ`åsI9†ÑáäëÏh6~Î’t9U<•°eYÓx>QeÉICàA_8Qkx#SM W„7Tò-öeÁÐ^éxCèI/!œ5€» ¥Zø`(bYbEo€ÔîUˆJ.?ÁJÉd‹¬ò¥‚]vU¨µmÏhU)Ý'öÕž;c,m­5§6 d4þ+„ c\ÄŒñDÇøß Œ1,Lw-ç¬ ±¡ ºEPyæBŒ:"ñl"º[Àà ÑüÀ»”e °?„¸•}uø¦ÓÛŒÇðL çáÀ@^Dh<¶§ië^AȹÖ¶Aýí«kÊ0ŒöåCú±E‰Tú®¼ðm‹ ?ÇøØåÃÌfþ9Åèè<»ñ˜(yÀÔ^^D LÌpwñùãÞ9%³ä¹knx»Êå4©Ì4x±ÃÇ–›Ó„0¨g#$] ¶_΀B×@(?ñ´,9àÜœðm .xA†Bô@ä<(Eàö/f+ îµËŠ˸Ð"¸ð> þ’ÏŠï ïm²ÁϨ«ŽRžÍ@¬,Àû«v·Ì.Þ Ö;[Ž]]0ZÖåÏæþ°r/Oéu ìøÀà  DŠ/‰Þž š¹ ´X`:>'NÓ®øä°<Ûp@úʾÂH¬kvûŒ/-âÃÃÛÎ\a#ÙpÝ õBô ­píäöàÂü¶ ˆ€ Ðÿ1À‡ü@t2¶Nþú­<ðO°“áþ€iúÌJÌêÔ2 ÊÔÃÚÞLÐEDóÕ °eðkðâÏ€}ðí@0ö@€Òû€„q11tÑ}! E KlË‹péîœPJ‹)úÔŒ0ÃPÊÌÄLîŠÍ ØÍ‘I pÝÛƒ‘]ðQdö-b/ÍäfÑØv‘ÞèüÊþÛÌ&”ϳ *‹#+16ì2è Æ †TÕPÕrN†^Nå2fÑ·Ð_".] pë1R*"bÀZeðÈ\òG$GhÁQ7 Ð2¬)T¬L·ª 1¢è°Tèk€Q„æÕRS ¼eçV޲% ñT+²/±a#r:@Šb€èº€3*h¸Û`9 |ŸƒñJ·Òd¸Q>¸dç2N­Z’अèü W(q½(Û) )Qa#0  á `3à  &ØR®‹hºhñéR_+òbÃK€Íä RË ÍVOXßåðf'¸Éõ…ñ. ¼Òå(²çRí"Òó)“V `¬ `,3ï„ .êÓlêÀq6áüusñ:2³*ÔäS!1³'Æe3ǼÇ™è\CŠV L¼Ç 4ò!:ò÷5‘É)²î @H `3àŠ¸â˜ê¡üóÍ=­¥-1Ó†D“0e…£!Ö{’ƒ4Ÿ4DÆ¥gÁ9Ã" jE%5QK.” ñq)1Ç/Pí)"Â#ƒ‹33æpóëEñ4I„3¤„$Jè´Q 0žÅLbγ :Ô T;3·G`xº(u7€hEÁýHd^ H_ÄDã>3ŽS44Å®V“@ÔkHDäç@õ0¢ÅÌé0ý0s $]@pÓ“S5[5ôA”{#ABÄ^tˆPËÊk S3Reó•?¥ëJÈý$LÆJE* 8TÁF‘ `€*€ñà`4mMn]G4Ý5ÔáGÈO&5$³ôÎãÄé&ô£9HûDèü¸‰ †¬ÆŒZÆ ƒ DÍ`€ AÉRõ2 a `ËO"åÁ>ÛY®]Yo7;5¤.1µ¬1µ¤ãGà^`À`uKòº€²{ÒÙP””DÔ¸ñxbÕl¼ dÆ4Àß à%R¡ÿX…SÂB ‚ôr!qZ/$òZU¡ZsV @îŒÕ¥ZV,ŒÕ¹TE>€#\5¿Rt)ÉûJmY9¡ÿ]ñ|v€žíôõ^”÷elcTÄ__u-S’ a `ô `¶ `ua"‚ts@µ9 Õ=)4ß5Õº@P•Ãd I EÀ/·.6(1=Rgnustep-gui-0.24.0/Images/common_ArrowRightH.tiff0000664000076500007650000000170211576466755021617 0ustar brains99brains99MM*B€*Ÿå` „B ¯ø1T„ÂaqtB% ˆÁâ°PN3ŽÆ#ñ¸lŠ5ŽB£Hø–Áà    ,4 :JR(=RSªa.tiffCreated with The GIMPHH€^`X«!P¸d6ˆDbQ«þì 8DN=D¢°÷°äO*ßrd¶!#‰<P½Vý—Nd3ü”ÎSÍçT8|òXç@ å\Z‰C£N]@Ha§Ë*4JV¯ ¬Äëv¼aÓl4Zu®é@ ‹UºÇn†Ò ·KmBûx‰Þ®wYußm€ À?†ÃÇ›@ú­‘ Èdd ‹ŽZEÍQx¥[B™ÐÎW`B­½ ÔjhkЦÇe9ÚvÛxþ¯[¯n÷ý›K§ÐpâyÃz)ÉåCry\¾?¡ÊÄâñ½{gF‚¾N¸Tÿ;ÅܰÜ.^·¢ue³Ú}Þ{uv­XÔøáßjÿGô) R˜ù²-Ú| (Nó‰¦I¢lœANzH“% T"ë"èÊ6üBìz‚ ë:–  $$ ”œZ$O²º(=RSb.tiffCreated with The GIMP$ $ gnustep-gui-0.24.0/Images/common_HelpLink.tiff0000664000076500007650000000057611510333651021105 0ustar brains99brains99MM*Œ€ P8$ `?àD ˆA¡/÷øü°`pÈ:#‰Å@ I z=@ãP¸l~!‹I’eì¦ €‚JÀÈz 0‘ÉG³Yt q*Áè)¤Ú]GN§ú] ‰7œÒc´XDREL“ÓªRÚå*½ŒXëvZä&Yk¶\nP8  ^ ª„fn(=RSvHHgnustep-gui-0.24.0/Images/common_RadioOn.tiff0000664000076500007650000002024611616136526020737 0ustar brains99brains99MM*üòþYþ£þÏþÚþÈþ“þ>þ þõö<þ·þÿþÿþýþëþÖþÂþ­þhþþùú<þÏþÿþÿþ¨þSþþþþAþeþ>þ þýþþ·þÿþìþ[þW\ýÀù÷ýÀþWZþþýýþþYþÿþÿþ[ýŒéÿýŒþýrýxý þ£þÿþ¨þW\áÿþWZýWýáýRþÏþýþSýÀáÿýÀýýÿýÓþÚþëþý÷áÿý÷ýùÿþÈþÖþý÷áÿý÷ý.ùÿþ“þÂþýÀáÿýÀý•ùÿþ>þ­þAþWZáÿý\õÿþ þhþeþýŒéÿýŒý¤ùÿýžþþþ>þþþWZýÀù÷ýÀý\ý¤õÿý úþ ýýrýWýýý.ý•ñÿýlýöýýxýáåÿýlùòý ýRýÓñÿýžý õæ€ 6îI$ônv(RS~‡s”†è/Local/Libraries/Resources/Images/common_RadioOn.tiffCopyright (C) 2001 Jeff Teunissen Created with the GIMP.HH”appl mntrRGB XYZ Ù  acspAPPLapplöÖÓ-appl descodscmxVcprtÐ8wtptrXYZgXYZ0bXYZDrTRCXchadh,bTRCXgTRCXdescGeneric RGB ProfileGeneric RGB Profilemluc ptBR&ôfrFU(zhTWBitIT(XnbNO&€koKR¦deDE,¼svSE&€zhCNèjaJPþptPO&nlNL(>esES&fiFI(fplPL,ŽruRU"ºarEG&ÜenUS&daDK.(Perfil RGB GenéricoProfil générique RVBu( RGB ‚r_icÏðProfilo RGB genericoGenerisk RGB-profilÇ|¼ RGB Õ¸\Ó Ç|Allgemeines RGB-Profilfn RGB cÏðe‡NöN‚, RGB 0×0í0Õ0¡0¤0ëPerfil RGB genéricoAlgemeen RGB-profielYleinen RGB-profiiliUniwersalny profil RGB1I89 ?@>D8;L RGBEDA *91JA RGB 'D9'EGeneric RGB ProfileGenerel RGB-beskrivelsetextCopyright 2007 Apple Inc., all rights reserved.XYZ óRÏXYZ tM=îÐXYZ Zu¬s4XYZ (Ÿ¸6curvÍsf32 BÞÿÿó&’ý‘ÿÿû¢ÿÿý£ÜÀl€ P8$ „BaP¸HDXJ$Å QˆŒ ¾ oˆòû’Èå0)D M.L&39¤Öm7œLâPHäN=ž‚``è.‡Ïà`xôV/= o˜ʧU¼åP'½l$–JÀE’sg´ZmSºT 4R aJ»Üï0+Œ “¢@€té»°ð7¤Çâ nìvVV±{š žµhtVˆ´…½@ƒ7°~‡ z¸âv¿h³@ ´ ãXÈe€¸çâò`YLÍg; Ðhú]0³Q¹]6°1 AÀÄÐ=wg© ‘@ª™¸¦¿ÎàÀ¸Ü8#Ê9xYŒ5zè¼ð Ò M8 `Ó^…HX…Î䂽ÍúÞ€Z¢…ºÈ*¡ C ‹æq oÓîù8LK±ºœ\‚"í3XØ Pz A¤ê*QD|É> øÝ±/r>Žºà ž¢KzÝÄHHDϤ,K,^éÆ.ÀÛn‡"äМ(½)? ‹˜¯„Xö¡r8¦ @RŠÏRJþIˆ;øÈ¾ÏËêá7j„ÂËi´º;RûÅ3 Aú-q¬›H¾Í1û#,=í#+k«I4‹(ÓË 9ÃmôKCÈ4L²§Ñ¨eHƒqÚ bÈ´S¨˜Óh¦/Ãùª JZ„´ìYÑð5_X€í!U Š„0ùÝ•Wµš{?¶€1Jب‚›2&BiY•ñ" g¸€X~àÀ¨™Ÿçö$â‡øâ8‘ýY ‹zVúŽÁ xjÊÙM¦ç È•Ö´À€áa*#Þɽ’_VU9\H ~€º( éxA¥„Fœ„ZˆD ê€Ø«à´Á¤çÞ¼yl‘ͱœÆþÌo›I»³›çfÜvŸ»‰÷bòB}»]õTÿÎ.]ÿ!õãC˜À׌ˆ™ &ÖZ`ßhºœÌf}k@c͆?<#}^ ô€¸#Ó‚ _Thvµ°~v‡·l{½Éêx÷‡‰Ïßœæo„h—^)vgyzxcY5W»@È”ÿ@°¬K#"žÈ Úvœ >ÒUSÄXˆ’ÇI±Š—ÈŸÉ8¸1ëÕ!ÿì‹ÿÈ´ÿh4ÿÀÐ €@)í!Ô^ƇðôCÐt@ÑÐ4`€Ñ0LS H,1œP!n*”’OHBC$pr½Ã¨£ÓùåÔ„ÒÍŸQd g?äö‡à)‡@„2ÃÐÈbAi€×BÚZÄIŠ&!sÅ蛊BpkEQ®ÜGê×F r‘QŒ}=Ų®Ðg¾rcQ qÀ[1–@ÆÉŽv#è!GÐ|dl É [uˆèºA#Æ8’BP^IQzׇÚ-#ò€¦ŠÑH$˜q’2Âfì¹^ò€5 0€@³4!ŒìY7Ö@£Éòv#ì(KЖ&oó Æ1Фd‚#DFÌÑ$,&€°3LÄHGŒŸ±Æghf'Q©ÒY $ÌÈËR/HÐ>±î^…˜'ÀssìÌi‘?Ë+Ü” jŠ #fŒÒšgð꽨Ã6 ,Œ3]“»x3]»(‹mâU¾5,@‚º“&1ÔR@Èá{Cà"RÐx )€{snnP ltàϧCNGÓˆ3(å¸CSå'ÇȘëBL-uе…¹¿a ÒRöQK‡ÃDè 3¡ž'‰§ü¯cK~šù@ê*‹R.4çWh£üSxQ@¼@RÔÝ‹Æ8BzðZÐ8›‰‚ï, »n&ŒÛ»¹ôžî@Â^2 òÒ/Ó!'Çø¨õBŠz…ã}†šš!cÚ'nx˜2÷@È{Ða}e'y f|XçÈ;Ý\Þ1ªè€¨ä`ò|ú¡Që'¯¯ö>6„ûP°ÖÀ&â ’B. ¯¬fm á|>¬*Ö7  205{ù ÿÓ´Pð¡LðïûO¶àš/"ü Lüào n €ŒŽ–p,oÜf‰Î£àq"\< M–º¢go¦h¡üëA0뎼ì àŽÈìÎЀ«êt'BpvLLèΓá†Ûͼ̀V p8ïÀ‚€ïL1F¶®ZåîbæŽkîlç.vç©:ÊïʰÀ¯ÎÄËþé! á~øÈæÒB|nðÆèT>hæúù¡Öaaö ô a¡àP°æÎ áÌ© 0ðrΰKù A‹a‹ LÆ IZÆÂïØ=â°–r#ŽaaóÀhÚ!4Úm©.lé ÏàÎQdGP UàU°Â®&€­Ü1€(.Žæ•iÊœîð<&Hú*ÆgÄNæÓÀ2ÍBmFÔ ‹XÕJêÕÀºñÀëêüíH1"ÉQ‡‹£Ì;dÆG$ UEžÞÇÞ¥#ú‹DÁ Ñü ÌïL0ÏløÏà÷ð¼‘vÒËê‘°Í „×øÐ\ ëøé/Ý N—{Açv¨—‰Wf‹|ˆ©KwsÈ©T Œ×c¡ùq—xà“©´·kî·kë„xI„vì!.,Àé.æîfØ¿•¹{±@ ~']sêÿ‡ k :ˆ·Œ{5†Ú ¨Âˆ¸ µ6L° vÄË ØOgëö¸l”é.êÉUŒ¿öÿü€«á‚*„•‰°¾øzuÊ•}âw‹‡WˆØ¾µ8$€W’ˆ§]i÷P,g¸œá!à‰¡ÅXΓ7î0¿–hÖ#L‚v˜ÖuËŒ þÄÙ¸¼¨×ň¸Í«QŽ'[Ž˜8{8 èËþËŒ[…A½XÍÜË«Š±X4eù FuH ’ ‘ËS„8ÄjøÈ€yn€H‹“v§]Š 3oë±Kú¸mݘ«„±K”Xµ•fa• •øÝ’À¾ùšj–a’‡Z¿HÌœŒ¸«eÙ>±­n¸®qèÇU¹bXë“X;‚jÀùê¨øÊu·Ì ÷v{‹‹*-uú{gm‚É1•9Úµ—¼›7ÁxèšcB•: kÊ3q· èÉŽÄ @@Ò  Ú @Îú(=RS ‡s”/home/ericwa/host/switchon.tiff$ $ ”appl mntrRGB XYZ Ù  acspAPPLapplöÖÓ-appl descodscmxVcprtÐ8wtptrXYZgXYZ0bXYZDrTRCXchadh,bTRCXgTRCXdescGeneric RGB ProfileGeneric RGB Profilemluc ptBR&ôfrFU(zhTWBitIT(XnbNO&€koKR¦deDE,¼svSE&€zhCNèjaJPþptPO&nlNL(>esES&fiFI(fplPL,ŽruRU"ºarEG&ÜenUS&daDK.(Perfil RGB GenéricoProfil générique RVBu( RGB ‚r_icÏðProfilo RGB genericoGenerisk RGB-profilÇ|¼ RGB Õ¸\Ó Ç|Allgemeines RGB-Profilfn RGB cÏðe‡NöN‚, RGB 0×0í0Õ0¡0¤0ëPerfil RGB genéricoAlgemeen RGB-profielYleinen RGB-profiiliUniwersalny profil RGB1I89 ?@>D8;L RGBEDA *91JA RGB 'D9'EGeneric RGB ProfileGenerel RGB-beskrivelsetextCopyright 2007 Apple Inc., all rights reserved.XYZ óRÏXYZ tM=îÐXYZ Zu¬s4XYZ (Ÿ¸6curvÍsf32 BÞÿÿó&’ý‘ÿÿû¢ÿÿý£ÜÀlgnustep-gui-0.24.0/Images/common_SliderVert.tiff0000664000076500007650000000104412230120052021436 0ustar brains99brains99II*ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿªªªªªªªªªª]ÿÿªªªªªªªªªª]ÿÿªªªªªªªªªª]ÿÿªªªªªªªªªª]ÿÿªªªªªªªªªª]ÿÿªªªªªªªªªª]ÿÿªªªªªªªªªª]ÿ]]]]]]]]]]]]ÿÿÿÿÿÿÿÿÿÿÿÿªÿÿªªªªªªªªªª]ÿÿªªªªªªªªªª]ÿÿªªªªªªªªªª]ÿÿªªªªªªªªªª]ÿÿªªªªªªªªªª]ÿÿªªªªªªªªªª]ÿÿªªªªªªªªªª]]]]]]]]]]]]]]þ <è@ Øà(HH/home/ericwa/gnustep/core/gui/Images/common_SliderVert.tiffgnustep-gui-0.24.0/Images/common_ProgressSpinning_1.tiff0000664000076500007650000001047611271671115023135 0ustar brains99brains99II*ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþ  Ú Lâ@.6(R/home/fred/GNUstep/Patches/GS_NSProgresIndie/common_ProgressSpinning_1.tiffHHgnustep-gui-0.24.0/Images/common_TabDownUnSelectedLeft.tiff0000664000076500007650000000110012224735723023515 0ustar brains99brains99II*ê€`Oð „BaP¸d6ˆD`Ç£ý!EŒt+ŠâP’™T§E£ôlxLdpy,žF^œ?ÔS°Q…"y”Jk3”ÅÒI$^1˜O´YV'¥1Xh9T«Di1Šq& {1Ø,3yÌíD¥C•ë\ŽÇKŠ€ÁÑ:ÕuˆSI/õ¾¬U+/øuÞ3-½Ì1xÈf ¨Úr‘,r=æâB²HíþEoc©ŽŠQlì@±ÀòƒCÉë¡rÓƒü¬Üî¡©”ýÿþ ä >ì*@áÔÜ(=RHH/home/ericwa/guitest/Images/common_TabDownUnSelectedLeft.tiffCreated with The GIMPgnustep-gui-0.24.0/Images/LogoGNUstep.tiff0000664000076500007650000024453010753155146020206 0ustar brains99brains99II*H !&()))))(&!  ')))))))))))))))))))))' ()))))))))))))))))))))))))))))()))))))))))))))))))))))))))))))))))))&)))))))))))))))))))))))))))))))))))))))))'))))))))))))))))))))))))))))))))))))))))))))))) ))))))))))))))))))))))))))))))))))))))))))))))))))) ()))))))))))))))))))))))))))))))))))))))))))))))))))))(%)))))))))))))))))))))))))))))))))))))))))))))))))))))))))&))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) &)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))'))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))" %)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))& ')))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))( ()))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))(()))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ())))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))  ())))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ) ) ) ) ) ) ( ')))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))$$$)$$$)$$$)###)###)###)###)###)###)###)""")""")""")""")!!!) ))))))))))))))))))))))$))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))$$$)$$$)###)###)###)###)###)###)###)""")""")""")""")""")""")!!!) ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))$$$)###)###)###)###)###)###)###)""")""")""")""")""")""")""")""")!!!)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))###)###)###)###)###)###)###)""")""")""")""")""")""")""")""")""")""") )))))))) ))))))))))))  )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))###)###)###)###)###)###)""")""")""")""")""")""")""")""")""")""")!!!)!!!) )))))))))))))))))))%)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))###)###)###)###)###)""")""")""")""")""")""")""")""")""")""")!!!)!!!)!!!)!!!))))))))))))))))))) ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))###)###)###)###)###)""")""")""")""")""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!))))))))))))))))))  )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))###)###)###)###)""")""")""")""")""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!) )))))))))))))))))  #)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))###)###)###)""")""")""")""")""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!)!!!) )))))))))))))))))  ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))###)###)""")""")""")""")""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) )))))))) ))))))))  &))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))###)""")""")""")""")""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ))))))))))))))))  )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))""")""")""")""")""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) )))))))) )))))))  ')))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))""")""")""")""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) )))))))))))))))  ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))""")""")""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) ))))))))) ))))))  &))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))""")""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) ))))))))))))))))  )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))""")""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) )))))))))))) )))))  !)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) ))))))))))))))))))  ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) )))))))))))))))))))  ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) )))))))))))))))) ))))  %))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) )))))))))))))))))))))   )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))""")!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) ))))))))))))))))))))))  )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) )))))))))))))))))))) )))  !)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) ))))))))))))))))))))))))  ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) )))))))))))))))))))))))))   ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) ))))))))))))))))))))))))))  ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))!!!)!!!)!!!) ) ) ) ) ) ) ) ))))))))))))))))))))))))) ))  ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))!!!)!!!) ) ) ) ) ) ) ) ))))))))))))))))))))))))))))  '))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))!!!) ) ) ) ) ) ) ) )))))))))))))))))))))))))))))  ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ) ) ) ) ) ) ) ))))))))))))))))))))))))))))))   ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ) ) ) ) ) ) )))))))))))))))))))))))))))))))  ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ) ) ) ) ) ))))))))))))))))))))))))))))))) )  ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ) ) ) ) )))))))))))))))))))))))))))))))) )  ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ) ) ) ))))))))))))))))))))))))))))))))) )  ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ) ) ) ))))))))))))))))))))))))))))))))))  ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ) ) )))))))))))))))))))))))))))))))))))  ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ) ))))))))))))))))))))))))))))))))))))  ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) )))))))))))))))))))))))))))))))))))))  ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))  )))))))))))))))))))))))))))))))))))) )$$$)$$$)$$$)$$$)$$$)###)###)###)###)###)###)###)""")""")""")""")""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) )))))))))))))))))))))))))))))))))))))))  )))))))))))))))))))))))))))))))))))) )$$$)$$$)$$$)$$$)###)###)###)###)###)###)###)""")""")""")""")""")""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) ))))))))))))))))))))))))))))))))))))))))  )))))))))))))))))))))))))))))))))))) )$$$)$$$)$$$)###)###)###)###)###)###)###)""")""")""")""")""")""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) )))))))))))))))))))))))))))))))))))))))))  )))))))))))))))))))))))))))))))))))) )$$$)$$$)###)###)###)###)###)###)###)""")""")""")""")""")""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) ))))))))))))))))))))))))))))))))))))))))) )  )))))))))))))))))))))))))))))))))))) )$$$)###)###)###)###)###)###)###)""")""")""")""")""")""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) )))))))))))))))))))))))))))))))))))))))))) )  )))))))))))))))))))))))))))))))))))) )###)###)###)###)###)###)###)""")""")""")""")""")""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) ))))))))))))))))))))))))))))))))))))))))))) )  )))))))))))))))))))))))))))))))))))) )###)###)###)###)###)###)""")""")""")""")""")""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) )))))))))))))))))))))))))))))))))))))))))))))   )))))))))))))))))))))))))))))))))))) )###)###)###)###)###)""")""")""")""")""")""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) ))))))))))))))))))))))))))))))))))))))))))))))  )))))))))))))))))))))))))))))))))))) )###)###)###)###)""")""")""")""")""")""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) )))))))))))))))))))))))))))))))))))))))))))))))  $))))))))))))))))))))))))))))))))))) )###)###)###)""")""")""")""")""")""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) ))))))))))))))))))))))))))))))))))))))))))))))))  ))))))))))))))))))))))))))))))))))) )###)###)""")""")""")""")""")""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) ))))))))))))))))))))))))))))))))))))))))))))))) ))  ))))))))))))))))))))))))))))))))))) )###)###)""")""")""")""")""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) )))))))))))))))))))))))))))))))))))))))))))))))) ))   ))))))))))))))))))))))))))))))))))))###)""")""")""")""")""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) )))))))))))))))))))))))))))))))))))))))))))))))))))  ()))))))))))))))))))))))))))))))))))""")""")""")""")""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) ))))))))))))))))))))))))))))))))))))))))))))))))))))  )))))))))))))))))))))))))))))))))))""")""")""")""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) )))))))))))))))))))))))))))))))))))))))))))))))))))))  )))))))))))))))))))))))))))))))))))""")""")""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) ))))))))))))))))))))))))))))))))))))))))))))))))))))))  )))))))))))))))))))))))))))))))))))""")""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) )))))))))))))))))))))))))))))))))))))))))))))))))))))))  !))))))))))))))))))))))))))))))))))""")""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) ))))))))))))))))))))))))))))))))))))))))))))))))))))))))  ))))))))))))))))))))))))))))))))))""")""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) )))))))))))))))))))))))))))))))))))))))))))))))))))))))))  ()))))))))))))))))))))))))))))))))""")""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) )))))))))))))))))))))))))))))))))))))))))))))))))))))))))  )))))))))))))))))))))))))))))))))""")""")!!!)!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) ))))))))))))))))))))))))))))))))))))))))))))))))))))) )))))   )))))))))))))))))))))))))))))))))""")!!!)!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))  "))))))))))))))))))))))))))))))))!!!)!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))  ))))))))))))))))))))))))))))))))!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))  $)))))))))))))))))))))))))))))))!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))  )))))))))))))))))))))))))))))))!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))  "))))))))))))))))))))))))))))))!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))  ))))))))))))))))))))))))))))))!!!)!!!)!!!) ) ) ) ) ) ) ) )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))  )))))))))))))))))))))))))))))!!!)!!!) ) ) ) ) ) ) ) ))))))))))))))))))))))))))))))))))))))))))))))))))))))))) )))))))))  '))))))))))))))))))))))))))))!!!) ) ) ) ) ) ) ) )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))  )))))))))))))))))))))))))))) ) ) ) ) ) ) ) ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))   ))))))))))))))))))))))))))) ) ) ) ) ) ) )))))))))))))))))))))))))))))))))))))))))))))))))))))))))) )))))))))))   &)))))))))))))))))))))))))) ) ) ) ) ) ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))  )))))))))))))))))))))))))) ) ) ) ) )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))  ))))))))))))))))))))))))) ) ) ) ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) )))))))))))))  )))))))))))))))))))))))) ) ) ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ))))))))))))))   % ) ) )))))))))))))))))))) ) ) ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))  )))))))))))))))))))))) )!!!)!!!)!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))  ))))))))))))))))))))))))!!!)!!!)!!!)!!!)!!!) ) ) ) ) ) ) ) ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))  ))))))))))))))))))))))))) )!!!)!!!) ) ) ) ) ) ) ) )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))  ))))))))))))))))))))))))))) ) ) ) ) ) ) ) ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))  )))))))))))))))))))))))))))) ) ) ) ) ) )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))  )))))))))))))))))))))))))))))) ) ) ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) )))))))))))))))))))))  )))))))))))))))))))) )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ))))))))))))))))))))))  ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))  ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) )))))))))))))))))))))))))  )))))))))))))))))))))))) ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))  )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ))))))))))))))))))))))))))))  ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))  ))))))))))))))))))))))))))))) )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))  ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))  )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) ))))))))))))))))))))))))))))))))))))  )))))))))))))))))))))))))))))))))))) ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))  ))))))))))))))))))))))))))))))))))))))) ))))))))))))))))))))))))))))))) ))))))))))))))))))))))))))))))))))))))))))  ))))))))))))))))))))))))))))))))))))))))))) ))))))))))))))))))))))) ))))))))))))))))))))))))))))))))))))))))))))))  "$%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& & & &&&&& & & & &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&         &))%   #'(   '))))))%    % ( ())))))))))))( ))))))&)) ))'#)))))($#())))()))))))%)) ))) ) #)))( !))))!)))))& ))&)) )) ) ) %)))  #)))% ))"%))  )) &)) )) (  % %))( )))# ))!))) ))  &)) ))    $ !))(  ))) ))!!))' ))&)) ))"  # )))   ))) ))!'))# )) &)) ))))))(()))))))'))   !" ))!))) )) &))))   ))&    ))!"))( )) &))))   %))    ))!&))# )) &)))) $   )))    ))!))) )) &)))) ('(  ))!   ))!))( )) &)))) ' & ( ))  ))! $))$ )) &)))) && "  ))  ))! ()) )) &)))) )& ) "))  ))! ))( )) &))))  )& ) ")) ))! #))$ )) &)))) ) & & ))  ))!  ()) )) &))))& & )) ))))))))))))))))))))))! ))( )) &))))' '$$ ))#))))))))))))))))))))))! #))$ )) &)))) !))() ))) ))) ))!  ()) )) &)))) $))   ))# ))! ))( )) $))))  ))(  ))) ))! "))% )) !))")))   &))"  #))& ))!  ()))) ))())) ))) ))) ))! ))))) ))$ ))) %%%)&%%%%%&&! ))) )))  ))! !))%!))  )))))" )  $))) )))" ))!  ())()) "))# ()) (  %)))#)))#  ))! )))))  )))! %))$     "))))! ()))! ))! !))))! )))% ())(  #$))&  ()))))$"()))))  ))!  ()))# ))))' "()))(  & ' #  !()))))))))))))   ))! )))# ())))))))))"   ) ' )  #'))))))("     "$! &)))))(  ) ( (          '!) &       %                      þ€¤æH ,îHI0I@>>ºûÿÿÿÖ@@@¸YYYÿVVVÿYYYÿ,,,€===±WWWÿJJJÿUUUÿFFFøÿÿÿÿøLLLæUUUÿIIIÿWWWÿ999¥HWWWúYYYÿXXXþ øÿÿÿÿÿ+++éYYYÿYYYÿWWWüHg$$$Ìêÿÿÿÿÿÿüê,,,Øt(ÿÿÿÿÿÿÿÿÿÿÿÿÿP HHHHHHHHHHHHHþ00æ$ Qî$@%@$N%V%(R/home/heron/Development/gnustep/core/gui/Images/common_ToolbarShowFontsItem.tiffCopyright FSFHHgnustep-gui-0.24.0/Images/common_ColorSwatch.tiff0000664000076500007650000000140207244010033021607 0ustar brains99brains99II*Hÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ   ê@òú(R€ü '€ü 'gnustep-gui-0.24.0/Images/NSRatingLevelIndicator.tiff0000664000076500007650000001143410562371653022346 0ustar brains99brains99II*ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€€€ÿÿÿ€€€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€€€ÿ€€€ÿÿÿÿÿÿÿÿÿÿÿÿÿ€€€ÿÿÿ€€€ÿÿÿÿÿÿÿÿÿÿ€€€ÿ€€€ÿÀÀÀÿÿÿÿ€€€ÿÿÿÿÿÿÿ€€€ÿÿÿ€€€ÿÿÿÿ€€€ÿÿÿÿ€€€ÿÿÿÿÿ@@@ÿÿÿÿ€€€ÿÿÿ```ÿÿÿÿÿÿ€€€ÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÀÀÀÿÿÿÿ@@@ÿÿÿÿÿÿÿÿÿÿÿÿ@@@ÿÿÿÿÿÿÿÿÿÿÿÿÿ€€€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ@@@ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€€€ÿÿÿÿÿÿÿÿÿÿÿ@@@ÿÿÿÿÿÿÿÿÿÿ@@@ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€€€ÿÿÿÿÿÿÿÿÿ@@@ÿ€€€ÿÿÿÿÿÿÿÿÿ@@@ÿÿÿÿ@@@ÿÿÿÿÿÿÿ€€€ÿÿÿ€€€ÿ€€€ÿÿÿÿÿÿ€€€ÿ€€€ÿ€€€ÿÿÿÿÿÿÿÿÿÿ€€€ÿÿÿ€€€ÿÿÿÿÿÿÿ@@@ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€€€ÿÿÿ€€€ÿÿÿÿÿÿÿÿÿÿ€€€ÿ€€€ÿ€€€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€€€ÿÿÿ€€€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€€€ÿ€€€ÿ€€€ÿ€€€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþæ 6î@$,(Rs‡è 4/home/fred/GNUstep/Images/NSRatingLevelIndicator.tiffHH èapplmntrRGB XYZ Ö&acspAPPLöÖÓ-appl¡£&“¬@.WÀÒ†(¡$rXYZ,gXYZ@bXYZTwtpthchad|,rTRC¨gTRC¸bTRCÈvcgtØndinì>desc ,ddscm þmmod (cprt ¸-XYZ h <¤ ìXYZ kg¬Y%ÈXYZ #d¢qXYZ óRÏsf32 BÞÿÿó&’ý‘ÿÿû¢ÿÿý£ÜÀlcurvÍcurvÍcurvÍvcgt !$')+-/135689;<>?ABDEFHIJKLMOPQRSTUVWXYZ[\\]^_`abcddefghiijklmmnopqqrstuuvwxyyz{||}~€‚‚ƒ„……†‡ˆˆ‰ŠŠ‹ŒŽ‘’’“”••–——˜™šš›œœžžŸ ¡¡¢££¤¥¥¦§§¨©©ª««¬­­®¯¯°±±²³³´µµ¶··¸¹¹º»»¼½½¾¿¿ÀÁÁÂÃÃÄÅÅÆÇÇÈÉÉÊËËÌÍÍÎÏÏÐÑÑÒÓÔÔÕÖÖרÙÙÚÛÜÝÝÞßàáâããäåæçèéëìíîïñòôö÷úüÿ !$')+-/135689;<>?ABDEFHIJKLMOPQRSTUVWXYZ[\\]^_`abcddefghiijklmmnopqqrstuuvwxyyz{||}~€‚‚ƒ„……†‡ˆˆ‰ŠŠ‹ŒŽ‘’’“”••–——˜™šš›œœžžŸ ¡¡¢££¤¥¥¦§§¨©©ª««¬­­®¯¯°±±²³³´µµ¶··¸¹¹º»»¼½½¾¿¿ÀÁÁÂÃÃÄÅÅÆÇÇÈÉÉÊËËÌÍÍÎÏÏÐÑÑÒÓÔÔÕÖÖרÙÙÚÛÜÝÝÞßàáâããäåæçèéëìíîïñòôö÷úüÿ !#%')+-/0235689:<=>?ABCDEGHIJKLMNOPQRSTUVVWXYZ[\\]^_`aabcdeefghiijkllmnoopqrrstuuvwxxyzz{|}}~€€‚‚ƒ„……†‡‡ˆ‰ŠŠ‹ŒŒŽ‘‘’““”•––—˜˜™š››œžŸŸ ¡¡¢£¤¤¥¦¦§¨¨©ªª«¬¬­®®¯°°±²³³´µµ¶··¸¹ºº»¼¼½¾¾¿ÀÁÁÂÃÃÄÅÅÆÇÈÈÉÊÊËÌÍÍÎÏÐÑÑÒÓÔÕÕÖרÙÚÛÛÜÝÞßàáâãåæçèéëìîðñóöøûÿndin6“3W P£ˆõ' OP T9@@® "&*/4:?EKRY`gnv~‡‘›¦²¾ËÙè÷,AVm† ¼Ù÷8Z¥ÌõJw¦× ?u¬æ!^žá'p½ bºuØ > ¨  ƒ õ i á \ Û ] änü%¿^¨T¹q-ì¯v@á¶lM1 !!÷"ë#â$Ý%Ü&Þ'å(ñ*+,:-].„/®0Ú23:4n5¦6â8!9e:¬;ù=J> ?ûAYBºDE‡FòHaIÕKLLÇNGOÌQVRåTyVW³YW[\°^d`aÙcše_g(höjÉl¡nparGt1vx yù{ê}ÝÓ̃ɅˇщߋóŽ2’]”–Ç™›>zŸµ¡ï¤*¦d¨ŸªÙ­¯L±‡³Ã¶¸>º|¼¸¾ðÁ$ÃRÅ|Ç ÉÀËÛÍóÐÒÔÖ ØÚÛüÝßß¹áˆãLåæ´èWéíëwìôîfïÍñ)òyó¾ô÷ö"÷>øMùLú=ûûóüºýtþ"þÇÿeÿÿ "&*/4:?EKRY`gnv~‡‘›¦²¾ËÙè÷,AVm† ¼Ù÷8Z¥ÌõJw¦× ?u¬æ!^žá'p½ bºuØ > ¨  ƒ õ i á \ Û ] änü%¿^¨T¹q-ì¯v@á¶lM1 !!÷"ë#â$Ý%Ü&Þ'å(ñ*+,:-].„/®0Ú23:4n5¦6â8!9e:¬;ù=J> ?ûAYBºDE‡FòHaIÕKLLÇNGOÌQVRåTyVW³YW[\°^d`aÙcše_g(höjÉl¡nparGt1vx yù{ê}ÝÓ̃ɅˇщߋóŽ2’]”–Ç™›>zŸµ¡ï¤*¦d¨ŸªÙ­¯L±‡³Ã¶¸>º|¼¸¾ðÁ$ÃRÅ|Ç ÉÀËÛÍóÐÒÔÖ ØÚÛüÝßß¹áˆãLåæ´èWéíëwìôîfïÍñ)òyó¾ô÷ö"÷>øMùLú=ûûóüºýtþ"þÇÿeÿÿ* #,4<CJQZblv‚™¦´ÃÓãõ.CXoˆ£Áà"EhŽµÞ 8ižÖMŠÉIŒÑ`ªöE˜îI©  x è [ Ó N Ì M Ò Z æv ¥DæŒ5àŽ>ó­m3ѧ^?# ÷è Þ!Ø"×#Ù$ß%è&ô()*0+K,h-ˆ.¬/Ô1273s4´5ú7C89Ù;&»T½h¿|ÁŽÃžÅ«ÇµÉ¹Ë·Í­ÏшÓlÕL×%ØöÚ¿Ü€Þ8ßèá‘ã3äÍæ_çééiêßìIí¥îóð3ñfòó¨ô¹õÀö¼÷­ø’ùjú3úîûœü>üÖýgýóþ{þÿÿ€ÿÿdesc Color LCDmluc itITÄfrFRBØnbNOesES,fiFI>ptPTNzhTWfjaJPtnlNL‚deDE˜koKR ¨enUS´svSEÆdaDKÖzhCN òLCD coloriÉcran à cristaux liquides couleurFarge-LCDLCD colorVäri-LCDLCD colorido_i‚rm²fv˜oy:Vh0«0é0ü LCDKleuren-LCDFarb-LCDÎì·ì LCDColor LCDFärg-LCDLCD-farveskærm_i‚r LCDmmodœ ¶i›€textCopyright Apple Computer, Inc., 2005gnustep-gui-0.24.0/Images/common_GSFolder.tiff0000664000076500007650000001025011466771424021050 0ustar brains99brains99II*²€ P8$ „BaP¸d6ˆD`æø¡ýl¶\¿‹%’úþ%HdR9$„o'©åKôz=*þ2 /ñp¸lÿˆÅKé,ö}? Ib†óü©N¿I$Sñ¸Ø€þІoàH,¿€ãú v½_žÉÆãúýr¹^?¦Ã³øt9"?ÄBCüH ¿ì»åöb”ÊÒédóü˜K,¿ÆñËü> ¿Ç¢ÓüÈ+ÊŠÂ@»Õû=Ÿ ÙW«Æù4šQ?È„"{üJ$¿Äá`£üŠ Èåò»¬¶aþK„ŸÒK,^2J%OúdGe_¯Øoóáéþ ˆ/ñ0”Zÿò$Ñ×yçßo BÃøŽ gaX 4²\ÿ4ñx¼n_ª ª¸æ¢°jÀiêÊú”…XŠ"x¼‡aЊÇ2 ³p‹3rôÄ «ÖöŒ/aý½£Pö† ¨á k)p\gù"HÇøX©á@ŸàX&A0"AhÖ?åÑnläÑ.YàÀ09hzÊb˜†IþFdÑþ+ŠÃ1þ¨†oļ4BÞ²£ VEOh¼‚çð¿<Ó¼ó?Ãø¬%ä(ð:Ë9xŒøÎ‰¢n'àý ø@ÌŒ‚Éù&HEùRS‡ù2K2Œ¦“dÁh‹bÈÒù¢VW•ÅÉþI’% þ#‚‰þl«&ÝÍïC+=Ïóà»iZ“ͧ<“Äöå‘\’¤¡6­â)üAQÿJRÄnãÈhâÐJ ÔØO4T™'JQNbÕÒ¡?’ÀÌ:]bh¨àøHò;‘‡øŽ#‰ùfYÏÀÊ<Ÿá‹52-¼?feüQ=Z³ìV‹ñý˜Ï9¡üNVÙx^çøæ9¯`<ð;uÒ´(rŸ÷uà=^gøÜèâ F ŸÀø}³õK)J’‘fd r4axnXÖ{aþG…)þ;ޤQþ `©þ†!Û$ÊCôáÁ·“¬û>fÙµ§L‹yø* 6áco“„ÙFü ïØLšE,4† þ?†Ýœê§SÔj#˜báø4Æ`Ûøž+·mfÜJPyC0²Pý†‹s8Tà˜$Ú‹¹x³Áz4Ëx/Îy·|{g÷º.Oý²=ŸæT“ÄéL!¸„ˆaxaÏiZgIÑuΣÕõÝ€Ü €Øþ @° àz]¢Ÿ H«d?Þ…nØ1† æm‚ PyO0›E @°ÿ ËÞBHG^Áí{¯t-eð½—À{  Á‡ðÂC‡Þ`0;í£ºL»Ýcªq-zG^Ï¢xk°ÅH?ƒDW``;RúsÈ©o;a($…aþBº ì#ð4Z86èÛ·¨O a w ð’/qý Ô~†Ðà^‹X?…P¨oÀ „è6?—cõtn”êX•%Çø{u À– [CdŸÁ®+ÅX±ÃA˜fnO éeƒLmñŽ1F¨ÿâNðx…£tp˜-¸í ¦Dy„‘îÂÓ#3£<~ Á$#3uµ-†8ÍïË„pŠâ ÿˆÍ4/ïgDš^ÔÉÐæ àþ ðO@¥e0iŠóè ðÎ ÀÈþ Àª€„Ó‚?€Ð «ðˆ ²V/ØÈò%E†0ÂÃ#\C€qL…P\Ó“Wô…½Bï4WÀW.ãø+RºTÖ)xþ¦"D=-±|,Ehÿ‚Ížˆü"Ù01²D2‚å, »¢ÀÙzN©2Ôjptžø8‚ùâtñð6Ê(¥ ,ú€²¦€Ïó+@èf7Á(øà0hY£Pnñd+Ø ~¢ ¾×ÞÀøá:(ïI)"±"–µ‹K)]±ðÙò Á˜4‡ø¸ê¥…áü š3ô­.J¯@ù%­-©j X;);Uj½VžSÒ­ÏQý(gĨ•Sþ´ÐB` hdDÈŒ€:Gð†°´A¶ ˆ\€°sHï>6.Å]ÚJÀ þjÍ`*µqüÂGÂÐU ü3†l¹" Kð¨ƒi3ޤ:+ú?ê]¦µàÚËA=°ª–ÊyÕ©éWe^Šp }ʪÐ?ƒ-¾¸T1Ü4Lœh)à&/Á þ @Šðâ»Âñ`þÆ¿‰‘ÀÚcø` áš÷‚· `ü!¿A9Gýÿ´ø &:Å-„NháÊÙ`ª±œÜ3ØO0§B3%63{]À€0¡5Eدãb Aü°þ`åsI9†ÑáäëÏh6~Î’t9U<•°eYÓx>QeÉIX"άƒû1a›ƒo³*'Õ£U²õ®?‚ì.•kà €  ‰e‰¾P¹W.(¸ÿ+%’.³Ê”B uÙV¢Õ·=¡T§tœÛVx팱¶´ÖœÛºpV-Øh·Û˜nÒzÀÎkOš±˜¯ŽZ÷£ð8À4°®Á%C lá.%_]~)€töã1ü(9À8A0‘-©Úz׉qN'µ­pë;jÚñ¬#=¸àþãÒ§VS}Zݾ¦ ä €èÜÀ0ÿÜ€?Àvà8€2pµ€@vv| ±ü@ç$@ ݸ áôñý[˜Á&¶„ >^D LÌpwñãÕ¸µ³âùknuü»¸%7dÜœ„3ÀAÿÚ µ¾Í€Û™øp—Á  »ü?‡Ý€ÿžü€Nì&Ìøwµ×\‹õ®?Ô>!þKv(¯ê:ÎÙÁÞ²®q¹í¨+`öy†ßapɺ7/Õÿäüo‹ýÿ¯øþŸÐy0² o()Þž Œû0 ¹ ´X`:>'NÓ®´âïÆÛoÊõʾÂÒ¬kvä,.ýÏàÌÄLÞ$ò_OöþÏó°Fÿ@!!þYpZP` Õ`Ì `ÂH¶ ˆ€ Ðw°~À‡ü@t2¶Nºõ­<ì`“áþ€iúÌJÌöã| ­L=­ÒÍTO jÄ_OÐÅ ®ï€€ðÕ pÙ aË áþ°äþ‚B .B@7°ñ ƒ!ý°zàrP$¶Ì¸·þžéÄýH²Ÿ­Hà 5¡ü¸Œ:å,ÐÍ€¨Æ îÍ õ¯÷ ÛqFñLà-b"MÒðGiÁý ÊþÛÌ&”Ïc*‹#+ ¯pÜÁþ jeMÖݤòN¡þNå2E®iñ¡ÑE‘¨áÍèÜC*$…¦_|ϾvŒí,ûÊÂÜOiNG®RýîRåNmTN†^ ÍÜçÞ@2ÞÐÇñŸÏ“q«   ñV"*b€èº€3!¨¸Û`8îHŸƒñND .H¸P´¸dç ÙÅ2Ýçf ä hüï22[ P] 2  û&²"  &ØR"‹hºhñif·²4ÃK€ä²3„!€u-Aü„]>óò H_ÄDã:.VÝÆdZåi%2ª¥rúÝNФQa3Èβw'2v`Öq=w=”9 a—C>b÷„^sò@(EëÊk S@e32åób^²ªÑºèý6†õ 8T#'Pþð``𢨠à@bT2ù3ÓC³Ö”­ Æ pè$TðÀcHÀdEÒ„â@À¸ Zf³U:É?ÄLï²jÌhŬb/Où@ AÈî`"B ¢ ‚2»Jt©7¢.Áþµ!Kb>à&Aü'KÔW"è G½$ôoM”oPöbÔâ¼ dÆ3ÉL à%IõO“ÂB ‚ Un+ €—X!þ µ‰Xu‹X€ªáãYu&a•Yñ³q¢$ X5-R 8fŸ´ Õ‡24xðúv€žé¡ü¼«ÃE¡þèÔ¾Eõ_I4ýPbB bBâÄ6B¢XÐÞµ›7”¬ÿQµ£%âB \6@ Ä“2>1V‡ úªe?µ‡UäÐöÔð5]Vâ a `ä `– `\ `7_¢bðähñL¾±®Ô©=Áôô>t±KU!I4¢$ BSŽÞî2€èEcÀ’8(D¼ÕвõED_dµb•f a `æ `œ `X `& ` t˜!Ò·/C+ é&¦ƒ,!$Kó-8Û>åDTGJ5$"@6î«À FõSÖ®±¦öµ[]îäï!’ùÀ¢ " "b¶Õt¢€êàà1Ì`oP‡ DÍ÷$¹`‚^‚" ¢b¶Ñtb7Mx¢ƒfÀ>ªàÀUZÁ”ö€ îÕh A ` `z `L `, ` ` t—|¢¼÷Ðõ| =} ¢ 6`Ú `” `›_"×Å|—ÍâF /usr/home/michael/Sandbox/GNUstep/core/gui/Images/common_Folder.tiffCreated with The GIMPPaint.NET v3.5.5HHþ0/ª E,r/$š¢(1ˆ=Rgnustep-gui-0.24.0/Images/common_ProgressSpinning_6.tiff0000664000076500007650000001047611271671115023142 0ustar brains99brains99II*þþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿþþþÿ‹‹‹ÿÿÿÿÿÿÿÿÿ‹‹‹ÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿ‹‹‹ÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþ  Ú Lâ@.6(R/home/fred/GNUstep/Patches/GS_NSProgresIndie/common_ProgressSpinning_6.tiffHHgnustep-gui-0.24.0/Images/common_MusicFolder.tiff0000664000076500007650000001106411501642572021612 0ustar brains99brains99II*>€ P8$ „BaP¸d6ˆD`æø¡ýl¶\¿‹%’úþ%HdR9$„o'©åKôz=*þ2 /ñp¸lÿˆÅKé,ö}? Ib†óü©N¿I$Sñ¸Ø€þІoàH,¿€ãú v½_žÉÆãúýr¹^?¦Ã³øt9"?ÄBCüH ¿ì»åöb”ÊÒédóü˜K,¿ÆñËü> ¿Ç¢ÓüÈ+ÊŠÂ@»Õû=Ÿ ÙW«Æù4šQ?È„"{üJ$¿Äá`£üŠ Èåò»¬¶aþK„ŸÒK,^2J%OúdGe_¯Øoóáéþ ˆ/ñ0”Zÿò$Ñ×yçßo BÃøŽ gaX 4²\ÿ4ñx¼n_ª ª¸æ¢°jÀiêÊú”…XŠ"x¼‡aЊÇ2 ³p‹3rôÄ «ÖöŒ/aý½£Pö† ¨á k)p\gù"HÇøX©á@ŸàX&A0"AhÖ?åÑnläÑ.YàÀ09hzÊb˜†IþFdÑþ+ŠÃ1þ¨†oļ4BÞ²£ VEOh¼‚çð¿<Ó¼ó?Ãø¬%ä(ð:Ë9xŒøÎ‰¢n'àý ø@ÌŒ‚Éù&HEùRS‡ù2K2Œ¦“dÁh‹bÈÒù¢VW•ÅÉþI’% þ#‚‰þl«&ÝÍïC+=Ïóà»iZ“ͧ<“Äöå‘\’¤¡6­â)üAQÿJRÄnãÈhâÐJ ÔØO4T™'JQNbÕÒ¡?’ÀÌ:]bh¨àøHò;‘‡øŽ#‰ùfYÏÀÊ<Ÿá‹52-¼?feüQ=Z³ìV‹ñý˜Ï9¡üNVÙx^çøæ9¯`<ð;uÒ´(rŸ÷uà=^gøÜèâ F ŸÀø}³õK)J’‘fd r4axnXÖ{aþG…)þ;ޤQþ `©þ†!Û$ÊCôáÁ·“¬û>fÙµ§L‹yø* 6áco“„ÙFü ïØLšE,4† þ?†Ýœê§SÔj#˜báø4Æ`Ûøž+·mfÜJPyC0²Pý†‹s8Tà˜$Ú‹¹x³Áz4Ëx/Îy·|{g÷º.Oý²=ŸæT“ÄéL!¸„ˆaxaÏiZgIÑuΣÕõÝ€Ü €Øþ @° àz]¢Ÿ H«d?Þ…nØ1† æm‚ PyO0›E @°ÿ ËÞBHG^Áí{¯t-eð½—À{  Á‡ðÂC‡Þ`0;í£ºL»Ýcªq-zG^Ï¢xk°ÅH?ƒDW``;RúsÈ©o;a($…aþBº ì#ð4Z86èÛ·¨O a w ð’/qý Ô~†Ðà^‹X?…P¨oÀ „è6?—cõtn”êX•%Çø{u À– [CdŸÁ®+ÅX±ÃA˜fnO éeƒLmñŽ1F¨ÿâNðx…£tp˜-¸í ¦Dy„‘îÂÓ#3£<~ Á$#3uµ-†8ÍïË„pŠâ ÿˆÍ4/ïgDš^ÔÉÐæ àþ ðO@¥e0iŠóè ðÎ ÀÈþ Àª€„Ó‚?€Ð «ðˆ ²V/ØÈò%E†0ÂÃ#\C€qL…P\Ó“Wô…½Bï4WÀW.ãø+RºTÖ)xþ¦"D=-±|,Ehÿ‚Ížˆü"Ù01²D2‚å, »¢ÀÙzN©2Ôjptžø8‚ùâtñð6Ê(¥ ,ú€²¦€Ïó+@èf7Á(øà0hY£Pnñd+Ø ~¢ ¾×ÞÀøá:(ïI)"±"–µ‹K)]±ðÙò Á˜4‡ø¸ê¥…áü š3ô­.J¯@ù%­-©j X;);Uj½VžSÒ­ÏQý(gĨ•Sþ´ÐB` hdDÈŒ€:Gð†°´A¶ ˆ\€°sHï>6.Å]ÚJÀ þjÍ`*µqüÂGÂÐU ü3†l¹" Kð¨ƒi3ޤ:+ú?ê]¦µàÚËA=°ª–ÊyÕ©éWe^Šp }ʪÐ?ƒ-¾¸T1Ü4Lœh)à&/Á þ @Šðâ»Âñ`þÆ¿‰‘ÀÚcø` áš÷‚· `ü!¿A9Gýÿ´ø &:Å-„NháÊÙ`ª±œÜ3ØO0§B3%63{]À€0¡5Eدãb Aü°þ`åsI9†ÑáäëÏh6~Î’t9U<•°eYÓx>QeÉIX"ĪÍB¾À8^AÎçàà —’Å$OL½kà» ¥Zø`(bYbEo€ÔîUˆJ.?ÁJÉd‹¬ò¥‚]vU¨µmÏhU)Ý'öÕž;c,m­5§6îŸÜf€ƒÐ;x@ðüòÞY˹håü˘ó>lÀ2`üfv° À,€+°IFPÈøK‰W×_Š`=¼ü&Ps€p‚` /"4[S´õ¯ã\gk[ áÙ¶ÕµäF{r!ýX‡ðKKãœs"ª|@§ynýè wÑÿßa€ïýø ø_@‡‰æÀH€âäQx @£’@(?và0?‡ÐhÇõl8^ˆšÚ€ùy531ÀYßÅçcã–ÏŽå­¹Û2îà”Ò¦ƒP4|y¨&øCü üQþ~G‡ù^ æwï›à{÷y6¼×š€Ëª5ùˆ/Þ×\P=r.7à¸ÿxø‡ù-Û⿲ìÛg{j¹Èg¶ ¬9€Vaü ÀÇÀåÂ;þp€R!þà=¡þðùný"ùðúBð$ð$ÎlÐ0â¼éâÏÇ »E†£âtí:ìî:ý­¶ýïp«ì(þjÆ·j K|ÎÎj? ^mïúÿàkoýhð 0/梳À #ä®kâ¼¶ ˆ€ з °¾À‡ ü@t2¶NÔöí<í¯t“áþ€iúÌJÌêÔ2 ¨£"úŽ]§`Ђ‘B€voÀI0 °!c"q$ð¢cåâàaë€ ~ 0j@7 ±I  ƒ¡ý0ºàrPZ¶Ì¸·þžéÄþˆ²Ÿ­Hà 4·ÌÊÈ\ç®júOŽù0ŽÝq‚ãEÈF‰Ð/±¨ðŸð¬æaÏbIà€vaýgiÈþÌ í¼ÂiL÷ph (²2°ëáþäþ j]`Dk=å,’ %-`j5Q €e!²ðPùGnQ5qµ"ñ30«Ð$…¦_|Ï$RBvŒðbý •JÈþ°jÂîI€22Ñö=rfpÀloôæOåo oO €9 Ð Àa(æB bà!..zq«*@ àb²nñªRµ"ñ*H+ªò´Q­*ï.’¼a„$Šb€èº€3-¨¸Ûr‡&)ø?ãÊ&+„=±~ DæÍTO$êS@(år{Q  E,`V6!¤€á/Ã:ó/2á› 10$áÿ,¡þ³Hñ©*²Ã"­a®bñÀ#à  &ØRâ‹hºhñÖ ‹|Ôk}/K€Òû/íP VOXÞåðñîó„2#"ø²f“J-ƈÀP.¡üè¡þ‘²ñ²1²0¥4SSma0ð”„1<@ô€rî…>n„èÇW7J2 ÊÔÌÌÔäS8ÆXÕmèfFb_¬¼ÎjyÃã=³žùA¤òó1+áýaüïAµk°¥lÐ jDÀ!'Bó4€4Ñ«2»#1²ñ²Ô¬µJS1"ÁÊ'D ±ùB3æ²'3¢?L$^u8@(EëÊk S9^ Æ_G‡À™ôê_?%ñV†õ 8@TÎ{+³Ó"Õ…u÷ñ®Ò®t)J´–¬¶ ¯‡‘˜ò…B1<âI[ÀÀb–.D]7N0 €Õ¦jßú_éT$LHïÆjÌhŬb ,vŽkIT—_µ VsÓEHïŽôq&VˆGµÆýa‘ aÅé1ˆÝh² ¹<Hà&Aü'bö32oxpèUd•Öˉ^ÿæ-e«ÀÆLbÅË>µz@* €°¬îkg³_³E9Õ%ö˜.Ñ7 !BãpÃW(§ab3[ZâH€#k­bô¿%ÉúZìÖeç26Í'h î´Ëʼ5ÂçÖc[â©nq4`"bSÔ•¬vá÷o‘·=SG4¯—iã+p`[x÷y1œh“À7yñ¹'àP•Ãd IEã%hpPH ¾¦U@÷N¼V×áü@4õuÀvd A `ä `– `\ `7 Áuovû3Ð'÷‡xvW’ø@Mz ï²'àBSˆÜp-7d¥¨B #‚„KÍ|«<Y}WØ€ AÉvÂ"b ‚bâO³ ØåÒzÓExU'÷‡yéû",X5®cRâºx(J­øà¡¡þNãÛƒÊO[–ã}×ánÀ¢ " "b¸j `!ŽbbóE‡¸ˆ1£Hö#6ÁÞæ4ž,.®~¢Æõ pºLßnRª¹`—f `â `ª `v `K†xÖ XÚ$o²æ!Oð¬òz³j!ý Áû•YYû"aäæµªå¡ã>bS*àÀUr¡Ã„˜L¸Û…Bb "¢ÂÂb˜Ø3øý ÁŸù°æ´æ™·¿ À°@“>ðž0ü ;yàÚ `” `š `t sà @š9¦B2@b¬ùÿ 01 æ!‰bø /usr/home/michael/Sandbox/GNUstep/core/gui/Images/common_Folder.tiffCreated with The GIMPPaint.NET v3.5.5HHþ0/6 E¸þ/°&.(1=Rgnustep-gui-0.24.0/Images/common_ToolbarSpaceItem.tiff0000664000076500007650000002253207726372062022605 0ustar brains99brains99II*$þ00æ$ Mî$<%@$J%R%(R/home/heron/Development/gnustep/core/gui/Images/common_ToolbarSpaceItem.tiffCopyright FSFHHgnustep-gui-0.24.0/Images/common_outlineExpanded.tiff0000664000076500007650000000151407513431717022532 0ustar brains99brains99II*ÎÉñýtýËþóùþáùþ©ËþQtñùý"ýËýÿþÑÿþœÿþ‚ÿþˆÿþ”ÿþkËþ "ùùýËþùÿþFÿþÿþÿþÿþGÿþ{ÿþoÿþ&ËùýýtýÿþFÿþÿþjþ þ þ jþdÿþ{ÿþ;ÿþtýýýËþÑÿþÿþjñþ?jþÿþfÿþËýýþóùþœÿþÿþ ñþ þÕÿþwÿþùýýþáùþ‚ÿþÿþ ñý þýÿþ]ÿþùýýþ©ËþˆÿþGÿþ jñýjýÿþÿþËýýþQtþ”ÿþ{ÿþdÿþ?jþ ü ýjýÿþ°ÿþÿþtýùþkËþoÿþ{ÿþÿþÕÿþýüÿþ°ÿþÿþËùùþ "þ&Ëþ;ÿþfÿþwÿþ]ÿþÿþÿþËþ"ùîtþËþùþùþËþtñÉþ¬€ >´Iò@Æ<D(R/Local/Libraries/Resources/Images/common_outlineExpanded.tiffCopyright (C) 2001 Jeff Teunissen Created with the GIMP.HHgnustep-gui-0.24.0/Images/common_ProgressIndeterminate_4.tiff0000664000076500007650000000376611271671115024147 0ustar brains99brains99II*È™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™þŽ Q”@Àæî(/home/fred/GNUstep/Patches/GS_NSProgresIndie/common_ProgressIndeterminate_4.tiffHHgnustep-gui-0.24.0/Images/common_2DDash.tiff0000664000076500007650000000100207014354703020432 0ustar brains99brains99II*Ìÿÿÿÿÿÿÿÿÿÿÿÿÿÿª  0²â$Äòú(R/home/david/Pictures/GNUstep/common_2DDash.tiffGNUstep 2D dashHHgnustep-gui-0.24.0/Images/common_TabDownSelectedLeft.tiff0000664000076500007650000000106412224735723023223 0ustar brains99brains99II*à€?àOð oº[@s §ˆDbQ8“tÆCQ€´rÿ„Âá°ø¤–M%‹®€QÉA †C¤ó9:±T¬Å v>­U«@3J$š-–ÇÝM÷P†ÌaÑjQ6{J1>Ð(U:äS+–¿Ô åý×jI•Xf.š_ôºm>£j¼ uš ó]½Èf2Ký[‡±WÊÞhO¢ÀóÒçL§T1ØlF(¥Œ¿fäÙ –S-‚‘è¦xun'ZÐê¤úÍv²ÇäryX&â»þ Ú <â@ØÊÒ(=RHH/home/ericwa/guitest/Images/common_TabDownSelectedLeft.tiffCreated with The GIMPgnustep-gui-0.24.0/Images/MagnifyGlass.tiff0000664000076500007650000001044610162520054020405 0ustar brains99brains99II*3 ] z€ € ]< 7 °ÝâÄÔ Êçå °O ™é  Du+ 7 ¬î " ‘ä j u* Yï¹  ™ê <u+ Hà § 7ñ u+ tñ \ ¬ Àu+ × Ô.Ø u* €þ )Rø 4i&Dîk`ÿ8  Qæ`ÿ P $òXû,Z!@ê s8â iu+ lü;¼ ¯u+¾ ç Uð `u+ Pù{ ½Øu*(È÷w& ºË?u+0 × ÿwk*ÿ;4ÿs &ÊÝju+wÖô1,úŽ~*ÿ„v'ÿ,' î† l Ôì ¦…² • ± ë Ô ‰|?8ú„u'ÿˆy(ÿIAÿ* X ™ º¿ ¿ ™ e+ ™?8úŽ~*ÿˆy(ÿ;4ô  |?8ú„u'ÿ‹|)ÿULÿ¦ ™?8úŽ~*ÿ‹|)ÿIAù · |?8ú„u'ÿ}*ÿaVÿ ¼. ™?8úŽ~*ÿ}*ÿSJý Ê |?8úp%ÿ82ÿ1+ÿ‘ ™! ú@9ÿƒt'ÿ Ô+ Z Î(# õ~ %Q þ  æ î@(RMagnifyGlass.tiffCreated with The GIMPHHgnustep-gui-0.24.0/Images/common_RadioOff.tiff0000664000076500007650000001053611616136526021076 0ustar brains99brains99MM*ÖòþYþ£þÏþÚþÈþ“þ>þ þõö<þ·þÿþÿþýþëþÖþÂþ­þhþþùú<þÏþÿþÿþ¨þSþþþþAþeþ>þ þýþþ·þÿþìþ[þîþþýýþþYþÿþÿþ[Þýrýxý þ£þÿþ¨þÞýWýáýRþÏþýþSÙýýÿýÓþÚþëþÙýùÿþÈþÖþÙý.ùÿþ“þÂþÙý•ùÿþ>þ­þAþáýõÿþ þhþeþáý¤ùÿýžþþþ>þþþñýý¤õÿý úþ ýýrýWýýý.ý•ñÿýlýöýýxýáåÿýlùòý ýRýÓñÿýžý õ´€ 7¼IôÎ>F(RSN>/Local/Libraries/Resources/Images/common_RadioOff.tiffCopyright (C) 2001 Jeff Teunissen Created with the GIMP.HH€ P8$ „BaP¸HDXJ$Å QˆŒ ¾ oˆòû’Èå0)D M.L&39¤Öm7œLâPHäN=ž‚``è.‡Ïà`xôV/= o˜ʧU¼åP'½l$–JÀE’sg´ZmSºT 4R aJ»Üï0+Œ “¢@€té»°ð7¤Çâ nìvVV±{š žµhtVˆ´…½@ƒ7°~‡ z¸âv¿h³@ ´ ãXÈe€¸çâò`YLÍg; Ðhú]0³Q¹]6°1 AÀÄÐ=wg© ‘@ª™¸¦¿ÎàÀ¸Ü8#Ê9xYŒ5zè¼ð Ò M8 `Ó^…HX…Î䂽ÍúÞ€Z¢…ºÈ*¡ C ‹æq oÓîù8LK±ºœ\‚"í3XØ Pz A¤ê*QD|É> øÝ±/r>Žºà ž¢KzÝÄHHDϤ,K,^éÆ.ÀÛn‡"äМ(½)? ‹˜¯„Xö¡r8¦ @RŠÏRJþIˆ;øÈ¾ÏËêá7j„ÂËi´º;RûÅ3 Aú-q¬›H¾Í1û#,=í#+k«I4‹(ÓË 9ÃmôKCÈ4L²§Ñ¨eHƒqÚ bÈ´S¨˜Óh¦/Ãùª JZ„´ìYÑð5_X€í!U Š„0ùÝ•Wµš{?¶€1Jب‚›2&BiY•ñ" q]Ë^40ì`ƒ­êX[ê;Ÿ¨{+b–›žƒ"WZÓ…„¨{&öH}YTåq HLã ÐcM ‡Ök}?Ýõš 8¹tCýš3ù•g^0j bd$›Yhƒ} fês1˜ Ý©gèužqYÚ¹ól€!ù³Û8"sGÌb BJ&Æ*_ f~£âõ¦³kh.9„Ü”ä|l©ÞјÑÕTþò€ª& yê—h½Çñ[ïûÿ„cˆ%¶ƒû)øu“°}v× oÕD½¢ {’*Ìéšè–›;iÆt>OF´€Wœ¾Œœ}ú‡ßcÙmÕw$P H b+cèfLY {²âÇõÕOäþ ÔZ‡ì¨'Zz@(ý§«Ú¬®Ì˜‘$þt (fd_A¤ h2·Üí_Œ&èt²8—îþ\Lu®$‚hL=‡œ)p‰°w¸OT‹nRÄ+©2bðH8 *À|ˆEŒ£ÊýÀLI/<D ]ShñL{Žè¬; {,aÞ¯p¡ DÍf€ZúWêA1/"!ÆÓClq >:÷ø¼$*£Ê>B¡æ;dízðî¥ãº½Tnd,÷ Â.H¿P«QíÆé- |L‰ÀNN0'ÀtNŽä?GÈø:e@é2¬xÈBú¸Èó Ž1=âHŽ C5"™+%æk$®$ÌP¦@ó, Ç +h•3LtÈì^ò`L¤(8LE4’0Z_ÌÌt¦$Æ™3*fIÐ'3Ÿ»×šc–zY§Q™$E)¶BZ‘œ-9•F©Ë9èA¤$±Â9Ú@Ýs¹Ä¸¹­=G(ã£CŽk8l4µ R„¹’+ÈÉM‡5—К\€\LuôH ‚lf`¦Dk ú|7ÇAL‚Òfñ¬”„”!aÄk¥õN˜6YŒé¥7 ‚® ÖA"¸î•Œr ºÌ6èÅNLÍÕdA¨—@“L¨è=T¯N4—S*r l%« ‚œ¸˜ýOÆøÜ±Cr¬öŒ'ýnŒ-” ŸA!éÂQUîÎ(™NA%¡€šÒji%0ò¬ƒkÚѯP‡­dÔ’åˆL:²ìž•Ãúógn6‰“ºÁ‚›Œ l Ãâæ‹5®€Ö±cqJ6ûmuˆ3·pD9·Ûoî á$NÜ[iA4î‹3Li^Ñ¥k†½ÕnoÝ‚ •E©A+Þ ÅÝ#e× `P]qÁLîqv6÷ +£gýó s胾w1YeRÀlš8œiA–!@à rõíXÎÅC8fb×lï´a²ö\ ¸ÓÈe26ocÒy$墀ã"Œ ©Ë‹±7& ÜWw€_Ÿá ƒf­ú c‚²Ìy³ÈO#ƒ|Ì Á¦i˜ØÝ1‡›ÆOcð*€@—± UÖ^*îW£fa¸6~f= Á托ˆNëš>0~pc#JYVÜ Èu¾i€r<úþ¯AcêeM2(8º¬äyÝ5°x¿ÖBÿ;úŒ@›uóŸî@ù»üp1©óÃZ—SëV³87Ñ@ó#Ó)§­F.ѺÖ'Á?ˆóÖç¼ Ý<Ô:¦xû áé: ·@*Ùz°Þ‡cFNñ#z L÷ D ¾g…‡ã˜ÐÊw Ð;’shI—‘ ;&­AµÃÆÖõ›HbïsÌvÓ9B ©gÙVõfR_à—wjŒ‹»·)ÔäzrÑé¬už•<Êõ#µàOã ±~+*šè3Xät¿1ä-—‚ÍŽ»? ¾œ.÷ɱ9£^t APdÜ÷,‰)©:À¯Ó3Ft—z ÞíCxcvѬÅÿ2¨‰$‰6Ú®R…Ʊ•Bð.Ã9èdq½¤"øP‹£4uÍÁâçÆ žà6<€Ø£¯ruP€$ `\átº@‡¾ìýåUiM8G ¬ v‚5†W±^4\õÎ6åbUoq ­GÜJ¬™O¹Ù+Àý!¢è¶‹£ð sóÁÌ£Sœ@`}QÜ2|Ó÷.Љ)ÁIæW1>z¸ŸÕ.PåJv î`ÖO¬ žèçäò†R0Ž\v pR+†¯ È é P¨Í@hݧ"šm% ®¢±¨ý&Ö!b‚æ§¼@Æ"g¥r$pnÆÏ ÈDu‰œ§*´ÈímSB÷/dM%ˬ0<‹j`UD •æl,C"gT~âzé£íJ‰‡ò¹K@´LÏ“¢Êm  ÚNdÁð; 1HEÇJaf8"C†ÈŠ®¢±Šz§¬›Kª‡¤Žéܧ0(Á.Á²!LÒQ:Ì 0ŠïEzyg¸… qÈ dšgþlñ¥«PbÒÄϤ!I¦ÁìžÖ«§'ÈV„ëÃ']*§ù(À¹Ryè§$‘ú‘ñ2V‘°z+”™Ñl§31*s"ÑîÖÌÁ¬± §2ÜØ¨Žu²äoÖýqêyèî„2u‚*" ~èî‰Ë”¦S ” ܦ@!6 !1‘zlé¦â´Áëá70)­R€à^rì‰S ŽSVŽ©œ‰“R‰Hó!‚"ôÉ‹9¨“8¨’‰’ZŽçùó¡Áø‹!á`:È—/œu³©.©A;'÷;“ >m šÊ.ž³7«£rÒþùÃ8g?ê”Z“óXŽS;4ù@#'ù6¡ø…‘Ôµ(üš‰R±´T• J”Ñ¥80à'(l³ñ>Óä”UGSGˆ“5G/§‹-÷+Rôô*Â÷-gc Tf»@S?R.t±?'.ç4'¥)g¨qkS8O2ÈMMí/g«B4¦ƒR…3RˆŠ‘#’W%B4ØzˆY1õM´£Ë‚ @@ !$V@ çFN(=RSV/home/ericwa/host/switchoff.tiff$ $ gnustep-gui-0.24.0/Images/common_outlineUnexpandable.tiff0000664000076500007650000000142007513431717023404 0ustar brains99brains99II*ŽÉñýMý‡ýžý‡ý[ý ñùýý‡ýªýmý&ýý ýýþùùý‡ý¢þLþªþªþªþKþþþTùýýMýªþLþªþGþ þ þ7þ$þþ[þMýýý‡ýmþªþGñý ýþ!þ‡ýýýžý&þªþ ñýýrþ þ¦ýýý‡ýþªþ ñý ý§þ-þ¦ýýý[ý þKþ7ñýGýªþ€þ‡ýýý ýþþ$ý ýý ýGýªýAþªþMýùýþþýýrý§ýªýAþªþ‡ùöþTþ[þ!þ þ-þ€þªþ‡þùîMþ‡þ¦þ¦þ‡þMñÉþl€ BtI¶@†(R/Local/Libraries/Resources/Images/common_outlineUnexpandable.tiffCopyright (C) 2001 Jeff Teunissen Created with the GIMP.HHgnustep-gui-0.24.0/Images/common_ClosedHandCursor.tiff0000664000076500007650000000364610172515303022601 0ustar brains99brains99MM*ì ÿ ÿ ÿ ÿ ÿ ÿ ÿçççÿçççÿÿçççÿçççÿÿçççÿçççÿ ÿ ÿ ÿçççÿÿÿÿÿóóóÿÿÿÿÿÿÿÿÿóóóÿÿÿÿÿóóóÿÿÝÝÝÿ ÿÿóóóÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿóóóÿóóóÿ ÿ ÿÿóóóÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿóóóÿ ÿ ÿçççÿóóóÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿóóóÿ ÿ ÿóóóÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿóóóÿ ÿ ÿóóóÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿçççÿ ÿ ÿçççÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿóóóÿÿÿçççÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿçççÿ ÿÿçççÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿóóóÿÿÿóóóÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿóóóÿ ÿ ÿóóóÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿóóóÿ ÿ ÿçççÿóóóÿóóóÿóóóÿóóóÿçççÿ ÿ Žä–ž(R ü€' ü€'gnustep-gui-0.24.0/Images/common_ProgressIndeterminate_2.tiff0000664000076500007650000000376611271671115024145 0ustar brains99brains99II*È™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™þŽ Q”@Àæî(/home/fred/GNUstep/Patches/GS_NSProgresIndie/common_ProgressIndeterminate_2.tiffHHgnustep-gui-0.24.0/Images/common_3DArrowUp.tiff0000664000076500007650000000223611576466755021210 0ustar brains99brains99MM*4€ P2«ýVÂ@X;ýþ„B¡€tB„Åb1ˆj9 C¤2  +"(=RS¨a.tiffHH€ P8$ („ÕÇP âˆDbPRªTi .xœv=(…€uPH˜Æ#ò¸ñU&ÿ5ªÀ/÷hpnK'PrhxÑ„,`åü¥—gt¸Q:0꣠~v@2XSX€˜Œ«]¿×µ§ò˜[¯Jʪ )‚« @Ÿãé@,{ŒHª6,@‡èñ\Å/À„@¦S€KXX‰UJÿÍ«›å†kîúY`0À]ç ¥2 <¿FÊí\þ $@FKm¿e*)%·úyØo`=!ïñ˜’t žÈ¨L¥Ÿá×ðÍ\Έ»AÁ$ÞþQ€Œ`5xTO€KÏô¨öUž(™þªÇù攀%‚¼*‰Çñ0'Ø~XHñþ€è:€ Ò5ƒªt#`q&Œ |‘敯`5À ¯‰  è}“àAü@€C´:xŽ ÞàFEñvÆð¥Ÿáä:ñ€,j ‚HYü0•Ƽ€  €08'Z"$‚ aºŸäiXª³‡øt`T³6ˆ¨!€àkŸã9Xa¸àúGCˆWƒ@;"€«øŠ "UŽªõ§øZˆ€ Ö„@"ÖkÃZëÕKÑ ÷Ñä,çr `‡ç‘@\’uê@„c‰„ç°–à#Š qRnŸF©à|ŸÖ“f‘`€&kÁ°ªžæÂšÀ9ûu"Ã0{CHv8„)¶à_ˆ˜NæÐþƒÅê †*}Ž–(=RSb.tiff$ $ gnustep-gui-0.24.0/Images/common_ProgressSpinning_3.tiff0000664000076500007650000001047611271671115023137 0ustar brains99brains99II*ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþ  Ú Lâ@.6(R/home/fred/GNUstep/Patches/GS_NSProgresIndie/common_ProgressSpinning_3.tiffHHgnustep-gui-0.24.0/Images/GSStop.tiff0000664000076500007650000000062510503104074017175 0ustar brains99brains99MM* Ð Ð þæ¯(=R€* @ª ‚ÁàИd" ‡Â¢PØ3€Å£HœF9 FbïøüBÿèI˜D ÒÉt¢U!’Ì€GüÚW-—Σ“ÉôòsQ%3ùuE QêQTªyU¦Piº&ŸK¨Sf5˱a­Wl”(b¯_«Tl·:ôÖ—Fª\+6ªuÚãb¶]g·{–·h¾^oÖ›¥¯‰Ãd1øÜ–W)€ gnustep-gui-0.24.0/Images/GNUmakefile0000664000076500007650000001155712227054647017243 0ustar brains99brains99# # Images makefile for GNUstep GUI Library # Copyright (C) 2009-2010 Free Software Foundation, Inc. # # Author: Nicola Pero # Date: September 2009 # # 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 Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-gui GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../gui.make include $(GNUSTEP_MAKEFILES)/common.make include ../Version RESOURCE_SET_NAME = Images Images_INSTALL_DIR = $(GNUSTEP_LIBRARY)/Images Images_RESOURCE_FILES = \ GNUstep.tiff \ GNUstepMenuImage.tiff \ GSSearch.tiff \ GSStop.tiff \ LogoGNUstep.tiff \ MagnifyGlass.tiff \ NSAddTemplate.tiff\ NSComboArrow.tiff \ NSRatingLevelIndicator.tiff \ common_2DCheckMark.tiff \ common_2DDash.tiff \ common_3DArrowDown.tiff \ common_3DArrowLeft.tiff \ common_3DArrowRight.tiff \ common_3DArrowRightH.tiff \ common_3DArrowUp.tiff \ common_ArrowDown.tiff \ common_ArrowDownH.tiff \ common_ArrowLeft.tiff \ common_ArrowLeftH.tiff \ common_ArrowRight.tiff \ common_ArrowRightH.tiff \ common_ArrowUp.tiff \ common_ArrowUpH.tiff \ common_CenterTabStop.tiff \ common_Close.tiff \ common_CloseBroken.tiff \ common_CloseBrokenH.tiff \ common_CloseH.tiff \ common_ClosedHandCursor.tiff \ common_ColorSwatch.tiff \ common_ComboBoxEllipsis.tiff \ common_DecimalTabStop.tiff \ common_Desktop.tiff \ common_Diamond.tiff \ common_Dimple.tiff \ common_DimpleHoriz.tiff \ common_DocsFolder.tiff \ common_DownloadFolder.tiff \ common_DownArrowSmall.tiff \ common_Folder.tiff \ common_GSFolder.tiff \ common_HelpCursor.tiff \ common_HelpLink.tiff \ common_Home.tiff \ common_HomeDirectory.tiff \ common_ImageFolder.tiff \ common_Info.tiff\ common_LeftTabStop.tiff \ common_LibraryFolder.tiff \ common_MiniWindowTile.tiff \ common_Miniaturize.tiff \ common_MiniaturizeH.tiff \ common_MusicFolder.tiff \ common_Mount.tiff \ common_Nibble.tiff \ common_OpenHandCursor.tiff \ common_Printer.tiff \ common_RadioOff.tiff \ common_RadioOn.tiff \ common_Right.tiff \ common_RightH.tiff \ common_RightTabStop.tiff \ common_Root_Apple.tiff \ common_Root_PC.tiff \ common_Root_SGI.tiff \ common_Root_Sparc.tiff \ common_Root_Sparc2.tiff \ common_SliderHoriz.tiff \ common_SliderVert.tiff \ common_StepperDown.tiff \ common_StepperDownHighlighted.tiff \ common_StepperUp.tiff \ common_StepperUpHighlighted.tiff \ common_SwitchOff.tiff \ common_SwitchOn.tiff \ common_TabDownSelectedLeft.tiff \ common_TabDownSelectedRight.tiff \ common_TabDownSelectedToUnSelectedJunction.tiff \ common_TabDownUnSelectedJunction.tiff \ common_TabDownUnSelectedLeft.tiff \ common_TabDownUnSelectedRight.tiff \ common_TabDownUnSelectedToSelectedJunction.tiff \ common_TabSelectedLeft.tiff \ common_TabSelectedRight.tiff \ common_TabSelectedToUnSelectedJunction.tiff \ common_TabUnSelectedToSelectedJunction.tiff \ common_TabUnSelectedJunction.tiff \ common_TabUnSelectedLeft.tiff \ common_TabUnSelectedRight.tiff \ common_Tile.tiff \ common_ToolbarClippedItemsMark.tiff \ common_ToolbarCustomizeToolbarItem.tiff \ common_ToolbarSeparatorItem.tiff \ common_ToolbarShowColorsItem.tiff \ common_ToolbarShowFontsItem.tiff \ common_ToolbarSpaceItem.tiff \ common_Unknown.tiff \ common_UnknownApplication.tiff \ common_UnknownTool.tiff \ common_Unmount.tiff \ common_UpAndDownArrowSmall.tiff \ common_copyCursor.tiff \ common_linkCursor.tiff \ common_noCursor.tiff \ common_outlineCollapsed.tiff \ common_outlineExpanded.tiff \ common_outlineUnexpandable.tiff \ common_ret.tiff \ common_retH.tiff \ common_ProgressIndeterminate_1.tiff \ common_ProgressIndeterminate_2.tiff \ common_ProgressIndeterminate_3.tiff \ common_ProgressIndeterminate_4.tiff \ common_ProgressIndeterminate_5.tiff \ common_ProgressIndeterminate_6.tiff \ common_ProgressSpinning_1.tiff \ common_ProgressSpinning_2.tiff \ common_ProgressSpinning_3.tiff \ common_ProgressSpinning_4.tiff \ common_ProgressSpinning_5.tiff \ common_ProgressSpinning_6.tiff \ common_ProgressSpinning_7.tiff \ common_ProgressSpinning_8.tiff \ nsmapping.strings \ page_landscape.tiff \ page_portrait.tiff include $(GNUSTEP_MAKEFILES)/resource-set.make gnustep-gui-0.24.0/Images/common_SwitchOn.tiff0000664000076500007650000000422011615731441021130 0ustar brains99brains99MM*þ€?àOð „BaP¸d(­sÀß긠UŒCcQE\28æŽbQÈ´jM Ê@ cýA/­¦R¤Š$“Î@¬®Z T0 ~C#ŠÁãP-CUC'“âþBÔ”i­!W%‚ÒêÔ…‚w*–UjðjÍ ùKCÊÓE\Ú8ƒXªöZ¦Çf¶ª”¨ÍÊév‰Òo1‹ýb{µÁp88Uà G›â¬8Êr‘däÙh~½f±Aô)֒瘻怪 ²µ:„k´ÙšüåÉm÷¸¦ïc½áòauˬJäçåtcÓZ^¥×†@@è Hðö8@(1H=RSZh/home/pingi/Download/gstep-Quellen/core/gui/Images/common_SwitchOn.tiffHHPaint.NET v3.5.5€?àOð „BaP¸d6ˆDbQ8¤V-Š¿£@Ät‚F$R9$–M'”J`¢¹`­/ÀåS9¤Öm7”Œç@tö œPhT:$¨G0©PÊ8OÑjU:¤¦£BAPúl6¡WªØlV8r2 ƒë“*uBÉo¸UPða *Õ®Ã+÷å¨ dçø0¦w†Þaw»î6¥?,¢#TD±ËezÝŽÐM²¬žR–§à¢¹˜ŽnŠ…c4;9-þ €‰ÑÇôšU‚¬ˆk¡[NËiÇ‰í »ˆ”èg<ŸA•0bÄ;áBxŽ7#½Ãa9püˆ[ç—L!ÜÀª×ÃÚàPþï½£ÉeQ·ôeÀy”ƒè1®ƒ=Ï‚ì§ìêôϾÎ;”=ˆƒtÞP‡@è+ Ö¾I <§Â- ' ¡îs g!æ sCB !bí ï¬J±Dï"6ó…¯I­ÅèqºƒhTh…ÆÈ4pƒGQÚŠü4¯Úþ†Ïü‡@h, †œˆ0ë'ILÔBúB’‰¢Pº• ËÚ/€Ê%%®Ó:ÛMJ ؈ÅIìX‡EÈ,`†Ã¯j-¡~cÁÎa\ó“ÛÂæÔŠrT)¡rÚ'À†|N×¥¼i]º'Ô_º®¨ÚËó"Õ¾FÄùˆ’”"ia-+–XÆXß¹§šš AMý•=·ˆà֣߂Š. >7œù^ƒç€Ä9öºµÔ¢¡§„¯Ú·¸2Ä»üuOùÖ§] I4l°ÕÜCvŽBàckï„<†7 kž˜Â^Ól!Î(8„“Ÿ¼FŠdÃÈ^æ"ê׆p*7xÄâüe}ïýø®¸†#”i"ñ}GƬDAôëB%ŸDBd>Cê Æ¸‡a´k¼‚¼V2AC¤Œ*‘ñUÉ‹$‰¨" <<F )Nb<x€(=RSˆ/home/ericwa/host/common_SwitchOn4x.tiff$ $ gnustep-gui-0.24.0/Images/common_Info.tiff0000664000076500007650000000151412116740302020261 0ustar brains99brains99II* € P8$ „BaP¸d6ˆDbQ8¤V-ŒFcQ¸äv=HdR9$–M'”JeR¹d¶]/˜Ld@8ú¬ o™”ö}@ÖsX;²W¯§ôºd!7ÃÕð2•6­KpÀÃÐ÷¼ W°LœP0ì=±ØmRä\ é1@Óö»¤¨1:ÀËP7„ MÝpX<& ‡ÄbqX¼f6B ‰ m vV £ÀË2< 0@Ô9m$U€Ž¡ê(K‹ÀÏP3Ä F^5øaœ KÆÌð4Öîêmî`[xž ‡âd(ÿ`U@ʰ6” V@Ð{({ê½zõt¼ ‹¾¿àëH.Öu=xÜÄ Ò‚¨xò‘ÛÓ Fª& f| Æ (,‡Hî>P{T3(s~ Ós `Ê× MdDĨ´‰ÄÈѱ#P‡;¨_1e¡Ëú9ÇŒRÆ,¨p¬•r+  fò&é R<œÁ4(æ‡Fhb„…†’²ºdO c  Bz´ò SR£ JÚ~ÌÉi”†¨yÜ–(¶Û eÒ1 g$ò˜B¨‹hâøQi“ú" €ؼ Sý*«“~ f"@ f FÁèÊšèvžU}u]וí}_Ø …a¬(þ00þ 6@<D(=R/home/ericwa/gnustep/core/gui/Images/common_Info.tiffNHNHgnustep-gui-0.24.0/Images/common_Root_Apple.tiff0000664000076500007650000002230206711564111021436 0ustar brains99brains99MM*$ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýýýÿêêêÿÜÜÜÿÒÒÒÿÊÊÊÿ¼¼¼ÿ­­­ÿ¥¥¥ÿžžžÿ“““ÿ‰‰‰ÿ„„„ÿÿwwwÿrrrÿoooÿkkkÿjjjÿiiiÿiiiÿ'''ÿ222þþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþþþþþüüüþøøøþôôôþïïïþêêêþèèèþåååþâââþßßßþÝÝÝþÛÛÛþÚÚÚþÙÙÙþÙÙÙþÙÙÙþÙÙÙþÙÙÙþÙÙÙþ;;;ÿ111ÿÿÿÿþþþþþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþþþþþüüüþøøøþôôôþïïïþêêêþèèèþåååþâââþßßßþÝÝÝþÛÛÛþÚÚÚþÙÙÙþÙÙÙþÙÙÙþÙÙÙþÙÙÙþÙÙÙþ;;;ÿ111ÿÿÿÿÄÄÄþÄÄÄþÂÂÂþ¼¼¼þ¶¶¶þ®®®ÿ¤¤¤þœœœþ———þ“““þ”””ÿþþŽŽŽþþŠŠŠÿ†††ÿþþ~~~þ}}}þ|||þ}}}ÿxxxþvvvþtttþtttþ|||þ………þ‘‘‘ÿžžžþ§§§þ°°°þ²²²þ;;;ÿ111ÿÿÿÿ•ª•ÿŸŸŸÿŸŸŸÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ€Š€ÿÿÿÿÿÿÿÿÿÿÿÿÿ999ÿ111ÿÿÿÿŸŸŸÿŸŸŸÿŸŸŸÿ$ÿ//Hÿ//Jÿ11Jÿ22Lÿ33Mÿ44Qÿ77Rÿ88Vÿ;;Yÿ<<[ÿ==\ÿ>>_ÿ@@`ÿ@@`ÿ@@`ÿ>>_ÿ==^ÿ==[ÿ<>_ÿ@@aÿAAcÿAAcÿAAcÿ@@aÿ>>_ÿ>>^ÿ==[ÿ99Yÿ77Uÿ66Rÿ44Pÿ22Lÿ11Jÿ//Hÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿ777ÿ...ÿÿÿÿŸŸŸÿŸŸŸÿŸŸŸÿ$ÿ//Jÿ11Jÿ11Kÿ33Mÿ44Pÿ77Rÿ88Uÿ;;Yÿ<<[ÿ>>_ÿ@@aÿBBdÿBBeÿCCeÿBBeÿBBdÿAAaÿ@@`ÿ>>^ÿ;;Zÿ88Vÿ77Tÿ66Qÿ22Mÿ11Kÿ11Jÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿ777ÿ...ÿÿÿÿŸŸŸÿŸŸŸÿŸŸŸÿ%ÿ11Lÿ22Lÿ33Mÿ44Pÿ77Rÿ88Vÿ;;Yÿ==^ÿ@@`ÿBBdÿCCfÿFFiÿGGjÿGGkÿGGjÿFFjÿEEhÿCCeÿAAcÿ>>_ÿ<>^ÿ<<[ÿ99Yÿ77Tÿ66Qÿ44PÿŠ€Šÿÿÿÿÿÿÿÿÿÿÿÿÿ222ÿ***ÿÿÿÿ•ª•ÿŸŸŸÿŸŸŸÿ(ÿ33Oÿ66Qÿ66Rÿ77Uÿ99Wÿ<<[ÿ>>^ÿAAcÿCCeÿFFjÿHHmÿKKrÿLLsÿLLsÿLLsÿLLrÿJJoÿHHmÿFFjÿCCeÿ@@`ÿ==^ÿ<<[ÿ88Uÿ77Rÿ66Qÿ€Š€ÿÿÿÿÿÿÿÿÿÿÿÿÿ///ÿ)))|||ÿÿÿÿª•ªÿŸŸŸÿŸŸŸÿ(ÿ44Qÿ66Rÿ77Tÿ99Wÿ;;Zÿ==^ÿ@@`ÿCCeÿEEhÿHHnÿKKpÿMMuÿOOwÿPPxÿPPxÿOOwÿLLtÿKKrÿHHnÿFFiÿBBdÿ@@`ÿ==^ÿ;;Wÿ88Uÿ77TÿŠ€Šÿÿÿÿÿÿÿÿÿÿÿÿÿ---ÿ'''vvvÿÿÿÿŸŸŸÿŸŸŸÿŸŸŸÿ)ÿ66Rÿ77Tÿ88Uÿ;;Yÿ<<[ÿ>>_ÿAAaÿCCfÿFFjÿJJoÿLLsÿPPxÿQQyÿQQzÿQQzÿQQyÿOOwÿLLsÿJJpÿGGkÿCCeÿAAcÿ>>_ÿ;;Zÿ88Vÿ88Uÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿ***ÿ$$$mmmÿÿÿÿª•ªÿŸŸŸÿŸŸŸÿ*ÿ77Tÿ88Vÿ99Wÿ;;Zÿ==\ÿ@@aÿBBdÿFFiÿHHmÿLLrÿOOuÿRRzÿTT}ÿTT~ÿTT~ÿTT}ÿQQyÿOOwÿLLsÿHHnÿEEhÿBBdÿ@@aÿ<<[ÿ;;Yÿ99VÿŠ€Šÿÿÿÿÿÿÿÿÿÿÿÿÿ(((ÿ"""gggþþþÿ•ª•ÿŸŸŸÿŸŸŸÿ*ÿ77Tÿ88Vÿ99Wÿ<<[ÿ==^ÿAAaÿBBeÿFFiÿHHmÿLLsÿOOwÿRR|ÿTT~ÿUUÿUUÿTT~ÿQQzÿPPwÿMMsÿJJnÿFFhÿCCeÿAAaÿ==\ÿ;;Yÿ99Wÿ€Š€ÿÿÿÿÿÿÿÿÿÿÿÿÿ%%%ÿ ]]]ôôôÿŸŸŸÿŸŸŸÿŸŸŸÿ*ÿ77Tÿ88Vÿ99Wÿ<<[ÿ==^ÿAAaÿBBeÿFFiÿHHmÿLLsÿOOwÿRR|ÿTT~ÿUUÿUUÿTT~ÿQQzÿPPwÿMMtÿJJnÿFFiÿCCeÿAAaÿ==\ÿ;;Yÿ99Wÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿ###ÿXXXïïïÿ•ª•ÿŸŸŸÿŸŸŸÿ*ÿ77Tÿ88Vÿ99Wÿ;;Zÿ==\ÿ@@aÿBBdÿFFiÿHHmÿLLrÿOOuÿRRzÿTT~ÿTT~ÿTT~ÿTT}ÿQQyÿOOwÿLLsÿHHnÿEEhÿBBdÿ@@aÿ<<[ÿ;;Yÿ99Vÿ€Š€ÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿOOOæææÿª•ªÿŸŸŸÿŸŸŸÿ)ÿ66Rÿ88Uÿ99Vÿ;;Yÿ<<[ÿ@@`ÿAAcÿEEhÿGGkÿKKpÿMMtÿQQyÿRRzÿRR|ÿRR|ÿRRzÿPPxÿMMtÿKKrÿHHmÿEEfÿBBcÿ@@`ÿ<<[ÿ99Wÿ88VÿŠ€ŠÿÿÿÿÿÿÿÿÿÿÿÿÿÿJJJáááÿ•ª•ÿŸŸŸÿŸŸŸÿ)ÿ66Qÿ77Tÿ88Uÿ99Yÿ<<[ÿ>>_ÿAAaÿCCfÿFFiÿJJoÿLLrÿOOwÿPPxÿQQyÿQQyÿPPxÿMMuÿLLsÿJJoÿGGjÿCCeÿAAaÿ>>_ÿ;;Yÿ88Vÿ88Uÿ€Š€ÿÿÿÿÿÿÿÿÿÿÿÿÿÿCCCÚÚÚÿŸŸŸÿŸŸŸÿŸŸŸÿ(ÿ44Pÿ66Qÿ66Rÿ88Uÿ99Wÿ<<\ÿ>>_ÿBBcÿCCfÿGGkÿJHnÿLLsÿMMtÿMMtÿMMtÿMMsÿKKpÿHHnÿGGkÿCCfÿ@@aÿ>>^ÿ<<[ÿ99Vÿ77Tÿ66Rÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ<<<ÒÒÒÿŸŸŸÿŸŸŸÿŸŸŸÿ'ÿ22Mÿ33Oÿ44Pÿ66Rÿ88Uÿ99Yÿ<<[ÿ>>_ÿAAcÿCCfÿEEiÿHHmÿHHnÿJJnÿJJnÿHHmÿFFjÿEEhÿCCfÿAAaÿ==\ÿ;;Zÿ99Wÿ66Rÿ44Pÿ33Oÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ999ÐÐÐÿŸŸŸÿŸŸŸÿŸŸŸÿ%ÿ11Lÿ22Lÿ33Mÿ44Pÿ77Rÿ88Vÿ;;Yÿ==^ÿ@@`ÿBBdÿCCfÿFFiÿGGjÿGGkÿGGjÿFFjÿEEhÿCCeÿAAcÿ>>_ÿ<>^ÿ@@`ÿAAcÿBBdÿBBdÿBBdÿAAcÿ@@`ÿ>>_ÿ==\ÿ;;Zÿ88Vÿ66Tÿ44Qÿ22Lÿ11Kÿ11JÿŠ€Šÿÿÿÿÿÿÿÿÿÿÿÿÿÿ333ÊÊÊÿŸŸŸÿŸŸŸÿŸŸŸÿ ÿ$ÿ%ÿ%ÿ'ÿ(ÿ)ÿ*ÿ,ÿ-ÿ.ÿ/ÿ 1ÿ 1ÿ 1ÿ 1ÿ 1ÿ/ÿ.ÿ.ÿ,ÿ*ÿ)ÿ(ÿ%ÿ%ÿ$ÿ………ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ222ÈÈÈÿôéôÿîîîÿîîîÿÿšššÿ–––ÿ”””ÿŒŒŒÿ‡‡‡ÿ€€€ÿzzzÿsssÿoooÿjjjÿhhhÿdddÿcccÿcccÿcccÿeeeÿiiiÿkkkÿoooÿuuuÿ}}}ÿ‚‚‚ÿ‡‡‡ÿ‘‘‘ÿ–––ÿšššÿáÜáÿÿÿÿÿÿÿÿÿÿÿÿÿÿ222ÈÈÈÿþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþþþþþÿÿÿÿþþþÿøøøÿðððÿíííÿãããþßßßþÝÝÝþÞÞÞÿÞÞÞÿÞÞÞÿßßßÿáááÿäääþêêêþïïïþôôôþýýýþÿÿÿÿþþþþþþþþþþþþþþþþøíøÿÿ222ÈÈÈÿþþþþþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþÿÿÿÿþþþÿøøøþôôôþïïïþêêêþèèèþèèèÿâââþßßßþÝÝÝþÛÛÛþÚÚÚþÙÙÙþÛÛÛÿÙÙÙþÙÙÙþÙÙÙþÙÙÙþÿ#((¹¾¾ÿþþþþþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþÿÿÿÿþþþþþþþþþþþþþþþþþþþþüüüþøøøþôôôþïïïþêêêþèèèþåååþâââþßßßþÝÝÝþÛÛÛþÚÚÚþÙÙÙþÙÙÙþÙÙÙþÙÙÙþÙÙÙþÙÙÙþÿ Ï244ÿFFFþFFFþFFFþEEEþEEEþFFFÿBBBþAAAþ???þ===þ===ÿ777þ555þ222þ...þ---ÿ***ÿ$$$þ"""þþþþÿþþþþþþÿþþþþLLLÿ?111111111tpt¿†Œ†ÿþŽŽŽþÿ‹‹‹þ‰‰‰þ‡‡‡ÿƒƒƒþ}}}þyyyþsssÿmmmÿ___ÿQQQþJJJþBBBþ;;;ÿ000þ+++þ&&&þ!!!þþþþþþÿÿ¿?~~ËËËÿ¿¿¿þ¿¿¿þÁÁÁÿ¼¼¼þºººþ¸¸¸ÿ³³³ÿ¨¨¨þ¢¢¢þ•••þ‹‹‹þyyyÿeeeþYYYþPPPÿ???þ000þ(((þ!!!þÿþþþ þ þÿÿ666ÿA,Aÿ,A,ÿ666ÿ666ÿ,A,ÿA,Aÿ,ÿÿÿ ÿÿÿ ÿ ÿÿ ÿÿÿ,A,ÿAAAÿ666ÿ666ÿAAAÿ,A,ÿ,ÿÿ ÿ ÿÿ ÿ ÿ ÿÿÿÿÿ###?^^^^^^]]]]]]\\\YYYWWWTTTŒ‡‡ÿojjÿ_j_ÿe[eÿFFFÿC>>ÿ>99ÿ444ÿ###ÿÿÿÿÿ050¿     ?###?•••¿ËËËÿËËËÿÊÊÊÿÊÊÊÿÈÈÈÿÆÆÆÿÃÃÃÿÁÁÁÿ¼¼¼ÿ¹¹¹ÿ³³³ÿ¯¯¯ÿ¥¥¥ÿžžžÿ™™™ÿ”””ÿŒŒŒÿ†††ÿ‚‚‚ÿÿzzzÿwwwÿejeÿdidÿrrrÿrrrÿrrrÿy~yÿGSG¿$$$ÿ6A6ÿ6A6ÿA,Aÿ,A,ÿ6A6ÿ666ÿ,A,ÿAAAÿ666ÿ666ÿAAAÿ,A,ÿ,A,ÿ6A6ÿ666ÿ666ÿAAAÿ666ÿ666ÿ6A6ÿ,A,ÿ666ÿ6A6ÿ6A6ÿ666ÿAAAÿ,A,ÿ666ÿ6A6ÿÿÿÿÿþþþþÿÿÿÿþþþþÿÿÿÿþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþÿÿÿÿÿÿÿÿþþþþÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþÿÿÿÿþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿþþþþÿÿÿÿÿÿÿÿþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþÿÿÿÿþþþþÿÿÿÿþþþþÿÿÿÿÿÿÿÿþþþþÿÿÿÿÿÿÿÿÜÜÜÿÚÚÚþÙÙÙþÛÛÛÿÚÚÚÿÙÙÙÿ×××ÿÔÔÔþÓÓÓþÒÒÒÿÐÐÐÿuuuÿÉÉÉþÇÇÇÿÂÂÂþ¿¿¿þ»»»þ¸¸¸ÿ´´´ÿ®®®þ¬¬¬ÿ§§§ÿ£££ÿœœœþšššÿ–––ÿþ‹‹‹þˆˆˆþ‡‡‡ÿþuuuÿÿ}}}ÿ|||ÿwwwþvvvþwwwÿuuuÿtttÿrrrþsssÿsssÿsssÿBBBÿÿÿÿÿÚÚÚþÚÚÚþÙÙÙþÙÙÙþØØØþÖÖÖþ×××ÿÔÔÔþÓÓÓþÒÒÒÿÐÐÐÿpppÿÉÉÉþÇÇÇÿÂÂÂþ¿¿¿þ»»»þ¸¸¸ÿ´´´ÿ®®®þ¬¬¬ÿ§§§ÿ£££ÿœœœþšššÿ–––ÿþ‹‹‹þˆˆˆþ‡‡‡ÿþpppÿÿ}}}ÿxxxþwwwþxxxÿwwwÿuuuÿtttÿrrrþqqqþsssÿsssÿ===ÿþþþþÚÚÚþÚÚÚþÙÙÙþÙÙÙþØØØþÖÖÖþ×××ÿÔÔÔþÓÓÓþÒÒÒÿÐÐÐÿbbbþÉÉÉþZZZÿeeeÿeeeÿeeeÿeeeÿeeeÿeeeÿeeeÿeeeÿeeeÿeeeÿeeeÿeeeÿeeeÿeeeÿˆˆˆþ‡‡‡ÿþbbbþÿ}}}ÿxxxþwwwþcccÿKKKÿKKKÿcccÿrrrþqqqþqqqþqqqþ222þÿÿÿÿÚÚÚþÚÚÚþÙÙÙþ9€,ÿ9€,ÿÖÖÖþ×××ÿÔÔÔþÓÓÓþÒÒÒÿÐÐÐÿPPPþÉÉÉþZZZÿÂÂÂþ¿¿¿þ»»»þ¸¸¸ÿ´´´ÿ®®®þ¬¬¬ÿ§§§ÿ£££ÿœœœþšššÿ–––ÿþ‹‹‹þóóóÿ‡‡‡ÿþPPPþÿ***ÿ***ÿ***ÿ***ÿ***ÿ***ÿ***ÿ***ÿ***ÿ***ÿqqqþ***ÿÿÿÿÿÚÚÚþÚÚÚþÙÙÙþ€ ÿ€ ÿÖÖÖþ×××ÿÔÔÔþÓÓÓþÒÒÒÿÐÐÐÿ<<<þÉÉÉþÇÇÇÿÇÇÇÿÇÇÇÿÇÇÇÿÇÇÇÿÇÇÇÿÇÇÇÿÇÇÇÿÇÇÇÿÇÇÇÿÇÇÇÿÇÇÇÿÇÇÇÿÇÇÇÿÇÇÇÿóóóÿ‡‡‡ÿþ<<<þÿ}}}ÿxxxþwwwþcccÿKKKÿKKKÿcccÿrrrþqqqþqqqþqqqþÿûûûþÚÚÚþÚÚÚþÙÙÙþÙÙÙþØØØþÖÖÖþ×××ÿÔÔÔþÓÓÓþÒÒÒÿÐÐÐÿ+++þÉÉÉþÇÇÇÿÂÂÂþ¿¿¿þ»»»þ¸¸¸ÿ´´´ÿ®®®þ¬¬¬ÿ§§§ÿ£££ÿœœœþšššÿ–––ÿþ‹‹‹þˆˆˆþ‡‡‡ÿþ+++þÿ}}}ÿxxxþwwwþxxxÿtttþsssþrrrþrrrþqqqþqqqþqqqþþòòòÿÜÜÜÿÚÚÚþoooÿoooÿoooÿoooÿ×××ÿÔÔÔþÓÓÓþÒÒÒÿÐÐÐÿ ÿÉÉÉþÇÇÇÿÂÂÂþ¿¿¿þ»»»þ¸¸¸ÿ´´´ÿ®®®þ¬¬¬ÿ§§§ÿ£££ÿœœœþšššÿ–––ÿþ‹‹‹þˆˆˆþ‡‡‡ÿþ ÿÿ}}}ÿxxxþwwwþxxxÿtttþsssþrrrþrrrþqqqþqqqþqqqþ ÿëëëÿÜÜÜÿÜÜÜÿÙÙÙþÛÛÛÿÚÚÚÿÙÙÙÿÕÕÕþÔÔÔþÔÔÔÿÒÒÒÿÐÐÐÿÿÉÉÉþÇÇÇÿÂÂÂþ¿¿¿þ»»»þ¸¸¸ÿ´´´ÿ®®®þ¬¬¬ÿ§§§ÿ£££ÿœœœþšššÿ–––ÿþ‹‹‹þˆˆˆþ‡‡‡ÿþÿÿ}}}ÿxxxþwwwþxxxÿwwwÿuuuÿtttÿrrrþqqqþsssÿsssÿÿèèèÿ###þ%%%ÿ###þ%%%ÿ###þ###þ###þ%%%ÿ%%%ÿ%%%ÿ###þ###þ%%%ÿ%%%ÿ###þ###þ###þ%%%ÿ###þ###þ%%%ÿ###þ!!!þ###ÿ!!!þ!!!þ###ÿ!!!þ!!!þ!!!þ###ÿ###ÿ!!!þ!!!þ###ÿ###ÿ###ÿ!!!þ!!!þ!!!þ###ÿ!!!þ###ÿ!!!þÿ222þ222þ222þ444ÿ444ÿ333ÿ111þ000þ222ÿ111ÿ111ÿ---þ...ÿ+++þ,,,ÿ(((þ)))ÿ(((ÿ'''ÿ$$$ÿ###ÿ"""ÿ ÿÿÿÿþÿþÿþÿÿÿþþÿÿÿþþþÿ 00$ª$$²$º(R ü€' ü€'gnustep-gui-0.24.0/Images/common_TabDownUnSelectedJunction.tiff0000664000076500007650000000134012224735723024422 0ustar brains99brains99II*†€`Oð „BaP¸d6ˆCŠ¥dF,Õkµ_îøà!'Ò ð44 Äâ±hƒhĤI ŽK'ÁåRÈc¡®Ù›ç°èà‰ ‡B9Ì*w<…'Sè7úÝnÑ&TI`L¦ÂiõUÌäŸÎÜŠEv”RÉN¡SµVŠÞk$“J!ö8‹’ÎÿµÛ#ó@è¨T¼WH^ZÆYLf@“y¤zµ] +ÝãËCÊ…b£ü“¯(ªEÐѼœ-EÚ.˜L¦…î ¹Ç Ä‚ð ¹XÈï2»èuJ÷«-À24XÞ`:?Øë¶8Ìðs]ep¨Ähÿïq ÀÖèºü¿·úµVV²ˆ3Rƒ†2`]›&ZÊ[˜° î;ÏþòmËv„2Éò€Z™ Ä£ì‡ÂûÂ]Å Ë$2Å” ‚ÇtDQAÈ„K B€ Òo'ù`Y+ƒ8à@Æ«º¼(þ € BˆÊ@}px(=RHH/home/ericwa/guitest/Images/common_TabDownUnSelectedJunction.tiffCreated with The GIMPgnustep-gui-0.24.0/Images/common_ArrowDown.tiff0000664000076500007650000000177011576466755021346 0ustar brains99brains99MM*D€_ê° ƒ`  ö‚€`°($@ UÄ ïø°5ŠB#ø|r$‡ÈdqØÜzY Ê   .6 ;LT(=RSàa.tiffCreated with The GIMPHH€`` „BaP¸d6=`¦!ŒFbåpé#R9$AØ ÁÉà„–]/ƒ” ¯ú:2€D‡ð:0šAÈt! CHy”¨Y–Ñ .z€„TŒ@Šƒ—`£-¹ºƒ„`c#.ðåHˆÐ@ƒœ â$$ ÊÒ\$ƒèð(=RSb.tiffCreated with The GIMP$ $ gnustep-gui-0.24.0/Images/common_ProgressSpinning_8.tiff0000664000076500007650000001047611271671115023144 0ustar brains99brains99II*ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿ‹‹‹ÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþ  Ú Lâ@.6(R/home/fred/GNUstep/Patches/GS_NSProgresIndie/common_ProgressSpinning_8.tiffHHgnustep-gui-0.24.0/Images/common_ArrowRight.tiff0000664000076500007650000000166211576466755021514 0ustar brains99brains99MM*>€_ê° „B_ðb¨ ˆBá0Ø|F!ŠA`Ñ(¼N7†C£@ä3‰Iä(¬‚   (0 6FN(=RSša.tiffCreated with The GIMPHH€`X!P¸d6ˆDbQ'ü-Ø2pˆœv=‰ÅaÏ`Èž>ä¹dFEx  xû-œJåñÙ!œ§›NhQ ÜÎ.€À -[M–:€Â9N–T'5*¥ZXŽÖ©ÎxæX(–¨‹¤a.-6ËÒ#G‚ܬS«´~ñqºÓï²ÆØÌ`àc×¼I´/€ f6:Ø·ä¤9kS/ hCò¹Ébìh7¡z=$âåTÖkešüVÊ…¦Ôj¡[´;=‡Ð÷›ÜÅÃ'ÞÇqù>/“Âáñ<>ªÿz¡uh]}¬ãµ+·\;NüNÉf´yl6ÊåV¯¤õ=µîjI¥üh{ìþ‚ç´Hšb™¦©¼ä$i*N”Àèú^‹£(Ú¿¤ ƒÂp¢V€€$$ „ŒV$D¢ª(=RSb.tiffCreated with The GIMP$ $ gnustep-gui-0.24.0/Images/common_Info.svg0000664000076500007650000000456012116740302020134 0ustar brains99brains99 image/svg+xml i gnustep-gui-0.24.0/Images/common_HomeDirectory.tiff0000664000076500007650000001516407450614124022160 0ustar brains99brains99II*áþnµµ¸þXX^¿ííþ6?þ¦¿ŽŽ”þdlaÿ..6ÿ"")¾íõþnþ¦¿’‘˜ÿ65?þ*)2þ¿?éþ6?þn¸¸»þlkuþ:9Dÿ"!(ÿ$ÿ݉þ6?þ¦¿—–žÿLKYÿ0/9ÿÿ= ÿd+ÿ+ ÿÝ‘þn(¼»¿þšš¢ÿDBOÿ%$+ÿ'ÿE ÿd+ÿd+ÿd+ÿJþéþnµµ¸þIILþ6?þn0¿¿Ãÿ{y†þ86Aÿ&%-ÿ2ÿM!ÿd+ÿd+ÿd+ÿd+ÿa(þGÿõþ6?þ¦¿•ÿhhpÿ..6¿?Å54ÿ?åþnþ¦8¿¤£¬ÿQO^ÿ;:EÿÿE ÿX&ÿd+ÿd+ÿd+ÿa(þ`(þ`(þ_'þ4 þýþn¸¸»ÿ‘–ÿ,*3ÿ! 'ÿ ?ùÑ54??ljº·Øÿš—²ÿñþn\ÅÄÉÿŒ‹šÿWVfÿ+*3ÿ2ÿM!ÿd+ÿd+ÿd+ÿ`'þ_'þ]&þ^&þ]&þ]&þVJÿ„wsþ¹¹¼ÿ`_gÿH46ÿN'ÿH"ÿ õÙ54??’©¿©¦Äÿ™–±ÿš—²ÿ›˜´ÿ[Yiÿýþ6?þ¦d¿¯®¹ÿ“‘¡ÿFDQÿ*ÿ= ÿd+ÿd+ÿd+ÿd+ÿ^&þ]&þ\&þ\&þ\&þ\&þ‚zþ¿²®ÿ•”›ÿ98Dþ>**ÿN'ÿ‚7"ÿy4 ÿY$þ õáljº·Øÿª§Åÿš—²ÿ”ÿhftÿNMTÿ”ÿywŒÿGGHÿ³²¾ÿheyÿ1/9ÿ2ÿE ÿd+ÿd+ÿd+ÿ`(þ^&þ\&þ^(ÿ[%þ[%þ[%þœzþ¼¼¿ÿsr}ÿ20:ÿ2ÿN'ÿ…9#ÿ‚7"ÿz4 ÿn/ÿS"þ õå’©¿š—²ÿ™–²þƒ–ÿhftÿNMTÿ›˜´ÿ›˜´ÿŽŒ¥ÿwuŠÿÿ31;ÿ= ÿX&ÿd+ÿd+ÿd+ÿ_'þ]&þ[%þ[%þ]'ÿZ%þ{SHþ¿±®ÿœ›£ÿhgpÿ&$,ÿN'ÿi0!ÿ6!ÿ‚7"ÿz4 ÿz4 ÿz4 ÿs1ÿ>þñåþ ywŒÿ›˜´ÿhftÿ›˜´ÿ”’¬ÿˆ†žÿmk~ÿNM[ÿ+*2ÿÿ](ÿY&ÿ](ÿd+ÿ^'þ[%þZ%þZ%þZ%þ\'ÿžƒ{ÿÀÀÄÿœ¥þ97BÿC/0ÿN'ÿ…9#ÿ6!ÿz4 ÿz4 ÿz4 ÿz4 ÿs1ÿm-þi+þ<þñá65=ÿ›˜´ÿˆ†žÿwuŠÿcbsÿEDPÿ+*2ÿ#ÿH!ÿV%ÿV%ÿV%ÿ^'þZ%þZ%þY%þY$þzSGþ›yþÂÂÇÿonxþ=;Gÿ2ÿi0!ÿ‚7"ÿz4 ÿz4 ÿz4 ÿz4 ÿt1ÿs1ÿj,þi+þi+þg+þ: þñéþ6?þn:9AÿJIVÿYWgÿ=;Fÿÿ6ÿE ÿV%ÿV%ÿV%ÿW%ÿZ%þY$þY$þX$þ›yþ¼¯«þª¨³ÿCANÿ*)1þN'ÿ…9#ÿ6!ÿ|5 ÿz4 ÿz4 ÿ{4 ÿr/þl,þk,þj+þi+þg+þg*þ\&ÿ) ¾ññþnÔÓÛÿÇÅÕÿ‡„œÿ<:Eÿÿÿ4ÿV%ÿV%ÿV%ÿV%ÿW%ÿZ&ÿZ&ÿX$þmHEþƒ{ÿÇÇÍÿ”’£ÿGESÿ2ÿi0!ÿ‚8"ÿ6!ÿz4 ÿz4 ÿ{4 ÿt0þr/þn-þl,þj,þi+þh+þi,ÿf*þe)þLþ ñýþnþ¦¿¼»Èÿª¨¼ÿcatÿ=;Gÿ4ÿU.#ÿR#ÿR#ÿT$ÿX$þV#þU#þV#þV#þV#þyzþ¾±­ÿ´³¿ÿ€~‹ÿ109ÿN'ÿe.ÿ€7!ÿ~6 ÿ{4 ÿ{4 ÿ{4 ÿs/þp.þo-þm-þl,$þj,þi+þh+þg*þg+ÿe)þf+ÿIþñÕÔÝÿ²¯Åÿ~…ˆÿ97Bÿ¿D&!ÿV%ÿR#ÿR#ÿR#ÿR#ÿU#þU#þU#þU#þU#þœ‚{ÿÌÌÒÿ¸·ÄÿPN]þ2ÿN'ÿ…9#ÿ|5 ÿ|5 ÿ|5 ÿ|5 ÿz4ÿu1þp.þo.þn-þ/m-þl,þk,þi+þg*þf*þe)þc(þc(þa(þGþñ ZXhÿELEÿ ùGÿR#ÿR#ÿR#ÿR#ÿS"þS"þT"þvQFþ³©¯þÎÍÕÿ‰ˆ—ÿSQaþN'ÿi0!ÿ€7!ÿ€7!ÿ~6 ÿ|5 ÿx3ÿv2ÿs1ÿp.þp.þn-þm-þl,þk,þj,þi+þh*þe)þd)þc(þb(þa(þ`'þ(þíí…7 þQ!þQ!þR!þR!þR!þ˜€xþ×Ùâþ¿½Ìþ[XiÿS?CÿN'ÿ‚8"ÿ€7!ÿ|5 ÿ|5 ÿ|5 ÿz4ÿt1ÿt1ÿq.þp.þo-þn-þm-þk,þj,þi+þh+þg*þf*þe+ÿb(þa(þ`'þa)ÿ^&þ% ÿíí„6 þP þR#ÿP!þ™zÿÒÑÙÿ‘ ÿ\Ykþ2ÿi0!ÿ‚8"ÿ~6 ÿ|5 ÿ|5 ÿ|5 ÿ|5 ÿv2ÿs1ÿp.þp.þq0ÿn-þm-þl,þk,þj+þi+þg+þf*þe*þf+ÿb(þ`'þ_'þ^'þ_(ÿ\%þ ÿíí6þrOEþº®«þÅÃÓþ’¡þ:8DþN'ÿ‚8"ÿ‚8"ÿ|5 ÿ|5 ÿx2þv1þv1þt0þq/þp.þp.þo.þn-þm-þl,þk,þj+þi+þg*þg*þf*þd)þc)þb(þ`'þ_'þ_(ÿ\&þ\%þ[%þ þíñþnÎÍÔÿœ›£ÿdatÿ)ÿ2ÿN!ÿšA(ÿ|5 ÿ|5 ÿz4ÿv1þs/þr/þq/þp.þo.þn-þn-þm-þl,þk,þj+þi+þh+þg*þf*þe)þd)þb(þb(þb)ÿ^&þ_(ÿ[%þ[%þZ$þ7 þ íõÉÇ×þ–”¥þ97Bÿ6þR!þKþJþL ÿ<%ÿ|5 ÿt0þr/þq/þq/þp.þo.þo-þm-þm-þl,þk,þj,þj+þh+þg*þf*þg+ÿf+ÿc)þb(þc)ÿ_'þa(ÿ_(ÿ]'ÿZ$þY$þX$þ4 þíõÿ? |3þIþIþHþJÿ€5þd*þr/þr/þq/þp.þo.þn-þn-þm-þl,þk,þj,þi+þi+þg*þf*þg,ÿf+ÿc)þb(þa(þa)ÿ_'þ^&þ_'ÿ[%þ[&ÿZ%ÿW#þV#þ1 þíív1þGþGþGþHÿ~4þh+þq/þp.þo.þn-þm-þm-þl,þk,þj+þi+þh+þg*þf*þf)þe)þc)þb(þa(þ`'þ_'þ^&þ]&þ[%þZ$þ]CnÿY%ÿX%ÿU#þT"þ þ?íí{r/þEþEþGÿFÿ‚7"ÿl,þo.þn-þm-þm-þl,þk,þj,þi+þh+þg*þf*þe)þe)þc)þb(þa(þ`'þ_'þ^&þ]&þ\%þ[%þ\&ÿ]Cnÿþ ÿ]CnÿV$ÿU$üÿþéíwm-þCþCþCþBþŠ:$ÿn.þm-þm-þl,þk,þj,þi+þj-ÿj,ÿf*þg+ÿf+ÿe+ÿb(þb(þ`'þ_'þ^'þ]&þ\%þ[%þZ$þY$þ]CnÿþÿþDÿþÿ]CnÿQ!þ§cOÿn ÿþÿíísh*þAþAþ@þ@þ†8!þm-þl,þk,þl-ÿk-ÿh+þg*þh,ÿe*þd)þc)þb(þa(þc)ÿ`'þ^&þ^&þ\%þ[%þZ$þY$þX#þ]CnÿþÿþDÿþÿþDÿþ ÿ]Cnÿ§cOÿn ÿþÿííob(þ?þ?þ?þY$þt1ÿk,þj,þi+þi+þg*þf*þh,ÿg+ÿf+ÿe*ÿc*ÿ`'þ_'þ^'þ`(ÿ^'ÿ[%þZ$þY$þX#þW#þ]CnÿþÿþDÿþüÿþÿþDÿþÿ]Cnÿn ÿþÿíík\&þ=þ=þ=þp.þe*þi+þh+þh*þg*þf*þe)þd)þe*ÿd*ÿb)ÿ_'þ^'þ`(ÿ^(ÿ]'ÿZ%þY$þZ&ÿW#þV#þ]CnÿþÿþDÿþÿþÿþÿþÿþÿþDÿþÿn ÿþÿíígV#þ< þ; þ; þn.ÿd)þi,ÿg*þf*þe)þd)þc(þb(þa'þ`'þ_'þ`(ÿ\&þ]'ÿ[%þZ$þY$þW#þV#þU"þ]CnÿþÿþDÿþÿþÿþÿþÿþÿþÿþÿþDÿþÿþÿíícO þ: þ: þ;ÿt1ÿc)þf*þe)þd)þc(þb(þa'þ`'þ_'þ^&þ_(ÿ\%þ[%þZ$þY$þX$þW#þU"þT"þ]CnÿþÿþDÿþÿþÿþÿþÿþÿþÿþÿþÿþÿþDÿþÿ]Cnÿñí_Iþ8 þ8 þ7 þz4 ÿc)þf+ÿe+ÿb(þa(þ`'þ_'þ^&þ_(ÿ\%þ[%þZ$þ[&ÿZ&ÿW#þX%ÿU"þ_'þ]CnÿþÿþDÿþÿþ±ÿþ±ÿþ±ÿþ±ÿþ±ÿþ±ÿþ±ÿþ±ÿþ±ÿþ±ÿþDÿþÿ]Cnÿõí[Eÿ6 þ6 þ6 þw2ÿc)þb(þa(þ`'þ_'þ^&þ]&þ_(ÿ[%þZ%þY$þZ&ÿY%ÿV#þ\'ÿZ&ÿS#ÿ]CnÿþÿþDÿþÿþ±ÿþ±ÿþ±ÿþ±ÿþ±ÿþ±ÿþ±ÿþ±ÿþ±ÿþ±ÿþ±ÿþ±ÿþDÿþÿ]CnÿùíW>þ5 þ5 þ\%þk-ÿd*ÿa'þ`'þ_'þ^&þ]&þ^'ÿ[%þY$þX$þY%ÿX%ÿa)ÿX$þGÿEþ]Cnÿþÿ"ÿ ÿ ÿ ÿ ÿ ÿþÿþÿþÿþÿþÿþ3ÿ ÿ ÿ ÿ ÿ ÿþÿ]Cnÿýí_9 þ3 þ3 þX#þb*ÿ`'þ_'þ^&þ_(ÿ\%þ]'ÿZ$þY$þX#þW#þ`'þS#ÿ?þGÿQ!þP þO þ1 ÿ ÿþfÿþwÿqhTÿqhTÿþfÿþ ÿ;Bÿ;"ÿqBTÿþÿþfÿþfÿþDÿþfÿ ÿñí_5 þ2 þ1 þT"þ_'þ^&þ_(ÿ^(ÿ[%þ\'ÿY$þX$þ\&þY$þS#ÿ?þLþQ!þP þ@þ/ þÿÉ ÿþfÿþïÿþïüÿþïÿþ ÿ;"ÿ;"ÿqBÿþÿþïÿþïÿþÂÿþïÿ ÿñíS1 þ0 þ2 ÿs/þ`)ÿ\%þ[%þZ%þY$þX$þa(þY$þGÿFþS"þR!þQ!þ@þ"ÿ äÉþŠþe ÿþfÿþïÿþïÿþÂÿþïÿþ ÿ;Bÿ;BÿqBTÿþÿþïÿþÂÿþïÿþïÿ ÿñíK. þ/ þ1 ÿg*þ]&þZ%þZ$þX$þa(þS#ÿBÿFþS"þR!þQ!þ2 ÿÿ ä®þ‚þ`þ<þ ÿþfÿþïÿþÂÿþïÿþïÿþ ÿ;"ÿ;"TÿqBÿþÿþÂÿþïÿþÂÿþÂÿ ÿñí?+ þ. þ>þg+ÿ]'ÿ_(ÿ[&ÿS#ÿ@þNþT"þU#ÿR!þ0 þÿÉþ‹þzþ[þ:þþ þ ÿþfüÿþïÿþÂÿþïÿþ ÿ;Bÿ;"ÿqBTÿþÿþÂÿþïÿþïÿþïÿ ÿñí7( ÿ&þEÿh,ÿ[&ÿGÿGþW$ÿT"þS"þAþ" ÿÿÉþþrþKþ.þþ þùÿ ÿþfÿþfÿþfÿþfÿ"ÿ ÿqBÿqBTÿqBÿ ÿ;hTÿþfÿþfÿþfÿ ÿñí/! ÿ ÿ;ÿV$ÿIÿU"þT"þV$ÿ1 þ" ÿ ä®þ‰þsþNþ,þþþñÿ ÿqhTÿþfÿþÂÿþf ÿBÿBÿ²•¡ÿþªÿþÂÿ;hÿþfÿþÂÿþfÿ"ÿ ÿñí' ÿ ÿP"ÿ]&þT"þV$ÿ3 ÿÿɰþ…þiþIþ+þþþéÿ ÿ ÿþfÿþf ÿ;hTÿ;hTÿqhTÿþªÿ²Ç¡ÿþfÿqhTÿ;hTÿþf ÿ;BÿqhTÿ ÿñí¿ ÿS"ÿBþ" ÿÿÌþ‹þqþUþ;þ%þþþÞÿ;BÿþÂÿ;BTÿþÂÿ;hTÿþÂÿ;Bÿ;Bÿþªÿq•Tÿ;BTÿ;hÿ;hTÿBÿ ÿñí:Æ) á ä®þƒþaþ=þ&þþ þþå#qhTÿqhTÿ;Bÿ;"ÿBÿ;Bÿ;Bÿ"ÿ;BÿþÂÿ;Bÿþªÿ;hÿþf ÿ;hTÿq•¡ÿq•TÿþÂÿqh¡ÿq•¡ÿqhTÿ²•¡ÿýñýþ þQmþJþMþ:þ þþþýþ0/ø€ NN@dl(R/home/deek/Source/GNUstep/Libraries/core/gui/Images/common_HomeDirectory.tiffCreated with The GIMPHHgnustep-gui-0.24.0/Images/common_ProgressIndeterminate_5.tiff0000664000076500007650000000376611271671115024150 0ustar brains99brains99II*È™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™™þŽ Q”@Àæî(/home/fred/GNUstep/Patches/GS_NSProgresIndie/common_ProgressIndeterminate_5.tiffHHgnustep-gui-0.24.0/Images/GSSearch.tiff0000664000076500007650000000063010503104074017451 0ustar brains99brains99MM* Ð Ð þæ²(=R€* @ª ‚ÁàИd" ‡Â¢PØ„V'ŠEâјäb†?Ã29’FÈÏøìn=.ƒJŸã餦C ™MÓi\¶5?„Éç’ÉxeBŸRb4Š,f™0 QhS)õIJ¨Fg3Z¤~B°?ÈÖ:%f›E«J(T+þ¸?Ê·;-FÍw».e[}Æ÷u¬^p0›ýÀrº`ì÷ˆÎãŠÆbðY,†O#—Ëfp0gnustep-gui-0.24.0/Images/common_Unmount.tiff0000664000076500007650000000241211557362504021045 0ustar brains99brains99II*ª€ P8$ „BaP¸d6ˆDbQ8SÞ'ŽR €¹ C†„Ž Ø¤6= ‘I ’py¾ U  1ÿ7¼Màõÿ ¤àN“T úýžSàŽ ŠGP »ìnÏà@`tº)9ÀÛôC\„@ûdy œ?ÝæÙäúJÀœæˆú´LOéÎ8h¿ "b@ ¬d%"‡àpÀèëC%Tß ¸» “Çõ0KÀœ†{î˜:šÁSá•™”9Åã`‚=àî-{ \Ät¬ÏM§M%ý1qoµ úoc„†a…øŒV3;»ÞEœbo«¹7 Åîë®MÀ›æ>œD­IaC€äð¼\â ò•ï[@œ5m#LuÀ  aúÓ@Ð*´Ò¾©ì7 Cpú}´Æ‘õ…€#1 ˆEŒ„®'Êæ F1ç¼àó Ç1âµ gü1 Çñ ³º"–qz¸›ã$£DPÔ;JÐó[+Ê«´³,C0ÈŽZIÈ:âmŒIärd ,c³X% ôgJ ´å:Ó´ñ=äý9γ¼ó=Ï   GÓL%Ó* ¸›Cê­Ek4©þ,8Ÿˆ+K ‰úp•L¦k-fž¨à(JÀÌ—€˜[ÒÈ*âk‹ò˜ˆþzœIêÆ‚É@ΫÈpš5½VV§Ø;cà.Ÿ–ž\ب"âj‹´Ú”¶qêpV±€)á´l›Œˆ` "$QÈj&xmÁZ€ˆâ?ÿ`Š%ÕÛ"&æ·‰N œ  [€@ß¡Z"<šf-aY[õR=„M}`Î7g'xµ…Eœ{0ŠdÔó¯Éà̘.;S½^|ë€Ú7â•þ1-ÎRnf nïŸú`0VËôˆ“ï8”#¹þÇ¡ÇIÁ”+ÙA˧› ƒá–ß~îhVêŸß©à’"ˆ›Öƒ² lü`œâ®@¶qéhŸÙh ßÍ$¼}øžfÁˆãè1âü¾ø¸˜Šx-ðB{—ÁòóÕàˆ*õ{£ÏÈ€™žbVäAB€¹ñv ÂÖ æ¥=Ì=Rcommon_Unmount.tiffHHImageMagick 6.6.2-6 2010-09-17 Q16 http://www.imagemagick.orggnustep-gui-0.24.0/Images/common_Close.tiff0000664000076500007650000000161610000314455020432 0ustar brains99brains99II*Hÿaeaÿaeaÿÿaeaÿÿaeaÿaeaÿÿaeaÿaeaÿÿaeaÿaeaÿÿaeaÿaeaÿÿaeaÿaeaÿÿaeaÿaeaÿÿÿaeaÿaeaÿÿÿaeaÿaeaÿÿaeaÿaeaÿÿaeaÿaeaÿÿaeaÿaeaÿÿaeaÿaeaÿÿaeaÿaeaÿÿaeaÿÿaeaÿaeaÿÿþ  & :.h@@~†(R/usr/home/stoyan/Projects/GNUstep/Icons/common_Close.tiffCreated with The GIMPHHgnustep-gui-0.24.0/Images/common_retH.tiff0000664000076500007650000000163607762567116020322 0ustar brains99brains99II*`ÿÿÿÿUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿUUUÿUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿUUUÿÿÿÿÿUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿUUUÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿªªªÿÿÿÿÿÿÿÿÿÿªªªÿªªªÿªªªÿªªªÿªªªÿªªªÿªªªÿªªªÿªªªÿªªªÿÿÿÿÿÿªªªÿÿªªªÿþ > 2Fx@XŽ–(R/usr/home/stoyan/Projects/GNUstep/common_ret.tiffCreated with The GIMPHHgnustep-gui-0.24.0/Images/common_TabDownUnSelectedRight.tiff0000664000076500007650000000111212224735723023703 0ustar brains99brains99II*ò€`Oð „BaP¸d6ˆCŠ¥dF,ƒ ¡˜)rE¤TÀ ÀÂuDâ±h€89H$RI4¢*–C!ÑH‹ ]Ð@$j$J)9…†‚ |s!‘Édôi] ž'ô œUªõšÛþ‚»¡Ñaö´î4 +Qçøì–["!°H<8&,ÕÛTZõ-—Ö£õ ¥NóG‡Û€ê墽b”ä!Ôªe;R›U°ð²™T§ƒËasš¬&]0ÅÌô¸6±0Ÿçæ»HJë}¹b¦UÞòÿäA Û./þ ì ?ô4@êÜä(=RHH/home/ericwa/guitest/Images/common_TabDownUnSelectedRight.tiffCreated with The GIMPgnustep-gui-0.24.0/Images/common_DecimalTabStop.tiff0000664000076500007650000000111007453703040022217 0ustar brains99brains99II*æ™/ÿÿÿÿÿþæ 3î"@8@(R/lin3/home/fred/GNUstep/common_DecimalTabStop.tiffCreated with The GIMPHHgnustep-gui-0.24.0/Images/common_3DArrowRightH.tiff0000664000076500007650000000243211576466274022003 0ustar brains99brains99MM*:€_åPT„Ba%PVÿ…Áá0È”"ŠB¡PøÌ&/Å#ðhT $B  081NV(1>^=RS$a.tiffCreated with The GIMPHHImageMagick 6.6.2-6 2010-09-17 Q16 http://www.imagemagick.org€‚Àèå V€ÂÇøˆDbQ8¤Prÿ `«€2u2.謖M'‹Ã„ ³ü, .‚(§ÛHpë“Îg2˜xéÞ8u?ÄðЪ¸˜´Ó‰Õ6!<‡p`vó!=°à²˜¦|±§ÔéÕ@R×læxÕæYy‘Þ¢ ì.¦«Þ«ÁûÖɳZ-LèƒÆ/R‹¤Ôý‚ Æ=@3]Ó¶{\$å¤ ~Š…·A±þ¹üT˜Å(ÍTv˜;û ¼M£$8é¯BHƒN-á³øöÛ )îcÁØ)¡À1Ø—‘›ŒÊ Î9­Š O€€jv‡x„à)Ü •`î[É $¦p€u§t‡CÀ©7?qB"fˆ§Yypà w‚ĸGÆŒ$8€¢èlv§€~À)ä €yHtŠØ@`ªð¥ ‰bAg%-©¦˜~gÖtŒOsT]‚$0^l$³bJ矡Iè/ãZ`q†’!‰”²¿‚(>f{ G@Ô@aÅd^/óògǰ˜v í8sµ`aV‘BÍ(«lg§°žwŠ,c ìöZ'ôlÙR/ž‚Éä#¡H~ÅW–…ðþ¿Yh{f—øl¹«…S–†Hþ’\3[ðŸàŠ •`q2ZšCò™x¾éRX„Æ(A†š—€'hÂ4Žxw&áŠr‚ È@Ypbªj œ‡ (=RSb.tiff$ $ gnustep-gui-0.24.0/Images/common_ProgressSpinning_4.tiff0000664000076500007650000001047611271671115023140 0ustar brains99brains99II*þþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿÿÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿÿÿÿÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿþþþÿ‹‹‹ÿþ  Ú Lâ@.6(R/home/fred/GNUstep/Patches/GS_NSProgresIndie/common_ProgressSpinning_4.tiffHHgnustep-gui-0.24.0/ChangeLog0000664000076500007650000250415712256227272015541 0ustar brains99brains992013-12-24 Richard Frith-Macdonald * Version: bump to 0.24.0 2013-12-23 Fred Kiefer * Update release notes to prepare for upcoming release. 2013-12-13 Fred Kiefer * Source/GSXibLoader.m: Handle changed keys for XIB 4.6 format. Based on patch by Marcian Lytwyn . * Source/GSXibLoader.m (-parser:...): Warn about unsupported XIB 5 format. 2013-12-13 Fred Kiefer * Source/NSTableView.m (-numberOfRows): Return the current number of rows not the internal cached value. Replace some occurences of int with NSInteger and unsigned with NSUInteger. 2013-12-08 Fred Kiefer * Source/NSClipView.m (-setBounds:, -setBoundsSize:): Use -setNeedsDisplay: to redraw areas no longer covered by the document view. 2013-12-07 Fred Kiefer * Source/NSClipView.m (-setDocumentView:): Don't take the background colour from the document view. Patch by Jeff Teunissen . 2013-12-07 Fred Kiefer * Source/GSThemeDrawing.m (-drawScrollViewRect:inView:): Use the scrollview bounds instead of the scroller frame for drawing the border. Patch by Jeff Teunissen . 2013-12-06 Fred Kiefer * Source/NSBitmapImageRep+JPEG.m: Remove CYGWIN specific define as it is no longer needed. I leave the code for this in for a while. Patch by Sebastian Reitenbach . 2013-12-03 Fred Kiefer * Source/NSClipView.m (-setBounds:, -setBoundsSize:): Mark the documentView as needing redisplay. Fixes #40776. Based on patch by Jeff Teunissen . 2013-12-03 Fred Kiefer * Source/GSThemeDrawing.m (-drawScrollViewRect:inView:): Use NSRectFill() instead of line drawing to get sharper separator lines. * Source/GSThemeDrawing.m (-drawScrollerRect:...): Don't fill with window background colour. * Source/NSScroller.m (-drawRect:): Draw only the knob slot when disabled. * Source/NSScroller.m (-mouseDown:): Don't handle mouse down event when disabled. 2013-12-02 Fred Kiefer * Source/NSScroller.m (-drawKnobSlot): Draw the slot even when the scroller is disabled. 2013-12-01 Fred Kiefer * Source/Functions.m (NSFrameRectWithWidth): Use one pixel width if a value of 0 is given. Fixes bug #40760 * Source/NSScroller.m: Move disable check out of -rectForPart:. Fixes bug #40761. 2013-12-01 Fred Kiefer * Headers/Additions/GNUstepGUI/GSModelLoaderFactory.h, * Source/GSModelLoaderFactory.m: Add new method +supportedTypes. * Source/NSBundleAdditions.m: Use this new method to implement NIB resource detection on top of the base methods instead of doing it here. 2013-11-24 Fred Kiefer * Source/NSGradient.m: Rearrange code to avoid duplicate saveGraphicsState calls. 2013-11-24 Fred Kiefer * Source/NSBitmapImageRep+GIF.m: Add define missing in libgif 5.0. 2013-11-24 Fred Kiefer * Source/NSBrowser.m (-selectionIndexPaths): Actually do the correction. 2013-11-23 Fred Kiefer * Source/NSBrowser.m (-selectionIndexPaths): Correct off by one error in last change. Detected by Sebastian Reitenbach . 2013-11-23 Fred Kiefer * configure.ac: Detect new GifQuantizeBuffer function. * configure: regenerate * Source/NSBitmapImageRep+GIF.m: Try to handle quantize again for libgif 5.0. 2013-11-22 Fred Kiefer * configure.ac: Try to improve the ICU detection. * configure: regenerate * Headers/AppKit/NSTrackingArea.h * Source/NSTrackingArea.m: Remove compiler warnings. * Headers/AppKit/NSBrowser.h, * Source/NSBrowser.m: Add a few new Cocoa methods. 2013-11-22 German Arias * NSWindow.m (-sendEvent:): Set _lastPoint only for mouse entered events. If not, in some cases (i.e. display contextual menus), this sets the wrong point for the event. 2013-11-08 Riccardo Mottola * Source/NSBitmapImageRep+GIF.m: Adapt for newer libgif versions of EGifOpen and renamed GifMakeMapObject. 2013-11-05 Eric Wasylishen * Source/GSThemeDrawing.m (-highlightTableViewSelectionInClipRect:...): Use color named @"highlightedTableRowBackgroundColor", if present in the theme, to fill the selected row background. * Source/GSThemeDrawing.m (-drawTableViewRow:clipRect:inView:): When the row/column is selected, if the cell is a NSTextFieldCell, set the text color to @"highlightedTableRowTextColor" before drawing the cell (only if the theme defines that color). 2013-11-03 Sebastian Reitenbach * Source/NSSpellChecker.m int -> NSInteger transition 2013-11-01 Fred Kiefer * Source/GSServicesManager.m: Call the more modern NSDocumentController methods to open documents. * Resources/English.lproj/Localizable.strings * Resources/Esperanto.lproj/Localizable.strings * Resources/French.lproj/Localizable.strings * Resources/German.lproj/Localizable.strings * Resources/Italian.lproj/Localizable.strings * Resources/Lojban.lproj/Localizable.strings * Resources/Spanish.lproj/Localizable.strings Regenerate string files. 2013-10-27 Fred Kiefer * Source/GSHorizontalTypesetter.m (-layoutLineNewParagraph:): Only adjust max_line_height to minimumLineHeight if it isn't zero. 2013-10-26 Fred Kiefer * Source/NSTextView.m (-mouseDown:): Use container origin for attachment cells. 2013-10-26 Fred Kiefer * Source/NSMenuView.m (-heightForItem:): Use -menuItemCellForItemAtIndex: to protect against an index being to big. This happens when the menu does not send notifications and a non-existing item gets highlighted. * Source/NSMenuView.m (-menuItemCellForItemAtIndex:): Protect against negative index values. 2013-10-20 Fred Kiefer * Source/NSBitmapImageRep+PNG.m: Better cleanup on error. * Source/NSBitmapImageRep.m (_set_bit_value): Correct error in bit operation. This should allow the code to work with 16 bit images. 2013-10-17 Eric Wasylishen * Images/common_SliderHoriz.tiff: * Images/common_SliderVert.tiff: Bake in the control background color because the NSSliderCell now draws these without filling with [NSColor controlBackgroundColor] first. 2013-10-17 Fred Kiefer * Headers/AppKit/NSFileWrapper.h, * Source/NSFileWrapper.m: Add some OSX 10.6 methods. 2013-10-15 Eric Wasylishen * Source/GSThemeDrawing.m: * Source/GSThemeTools.m: * Headers/Additions/GNUstepGUI/GSTheme.h: Small refactor: most uses of -[GSTheme fillRect:withTiles:background:] use [NSColor clearColor], so add a version without the background: param. 2013-10-15 Eric Wasylishen * Source/GSThemeDrawing.m: * Headers/Additions/GNUstepGUI/GSTheme.h: Add methods -menuSubmenuHorizontalOverlap and -menuSubmenuVerticalOverlap wrapping user defaults GSMenuSubmenuHorizontalOverlap and GSMenuSubmenuVerticalOverlap * Source/NSMenuView.m (-locationForSubmenu:): Offset calculations by -[GSTheme menuSubmenuHorizontalOverlap] and -[GSTheme menuSubmenuVerticalOverlap] 2013-10-15 Eric Wasylishen * Source/GSThemePrivate.h: * Source/GSTheme.m: Add GSStringFromImageFrameStyle * Source/GSThemeDrawing.m (-drawBorderForImageFrameStyle:...): Use GSStringFromImageFrameStyle to get tiles, if present 2013-10-15 Eric Wasylishen * Source/GSThemeDrawing.m (-drawColorWellBorder:...): Draw inner border using part GSColorWellInnerBorder * Source/GSTheme.m: * Headers/Additions/GNUstepGUI/GSTheme.h: Add GSColorWellInnerBorder part name 2013-10-15 Eric Wasylishen * Source/GSThemePrivate.h: * Source/GSThemeTools.m: * Source/GSThemeDrawing.m: Add explicit isFlipped: param to -[GSDrawTiles contentRectForRect:] 2013-10-15 Eric Wasylishen * Headers/Additions/GNUstepGUI/GSTheme.h: Remove GSScrollViewBottomCorner part name, instead themes should just provide a part called NSScrollView. Add -scrollViewScrollersOverlapBorders method. * Source/GSTheme.m: Remove GSScrollViewBottomCorner part name. * Source/GSThemeDrawing.m: Add -scrollViewScrollersOverlapBorders. * Source/GSThemeDrawing.m (-drawBrowserRect:...): If -scrollViewScrollersOverlapBorders is enabled, fill the browser background with the NSScrollView tile. * Source/GSThemeDrawing.m (-drawScrollViewRect:...): If -scrollViewScrollersOverlapBorders is enabled, fill the scroll view background with the NSScrollView tile. * Source/NSScroller.m (-rectForPart:): Change the meaning of the GSScrollerKnobOvershoot default so the knob only overlaps the buttons by this much (rather than both ends of the track). Turns out this is more useful for themes. * Source/NSScrollView.m (-tile): Add support for -[GSTheme scrollViewScrollersOverlapBorders] * Source/NSBrowser.m (-tile): Add support for -[GSTheme scrollViewScrollersOverlapBorders] and -[GSTheme scrollViewUseBottomCorner] The overall point of these additions is to support NSScrollView and NSBrowser looking like: http://jesseross.com/clients/gnustep/ui/concepts/ 2013-10-15 Eric Wasylishen * Source/NSTableView.m (-tile): Check the GSScrollViewNoInnerBorder user default to see whether to expand the corner view by 1pt or not. * Source/GSThemeDrawing.m (-drawTableHeaderRect:inView:): Remove special case which reduced the width of the last column header by 1pt. I don't see any reason for doing that and it looks better to me without the gap, and more uniform for themeing. 2013-10-15 Eric Wasylishen * Source/NSButtonCell.m: * Source/NSMenuItemCell.m: Make a shared -themeControlState in NSButtonCell and eliminate duplicated code. * Source/NSPopUpButtonCell.m: Add private declaration for -[NSButtonCell themeControlState] 2013-10-15 Eric Wasylishen * ColorPickers/GSColorSliderCell.m (-drawBarInside:flipped:): Set alpha to 1 before drawing because the current value could be not 1, and PSsetrgbcolor doesn't set it. 2013-10-15 Eric Wasylishen * Headers/Additions/GNUstepGUI/GSTheme.h: Add -tabViewContentRectForBounds: method. * Source/GSThemeDrawing.m: * Source/NSTabView.m: Move the -contentRect implementation to GSTheme so we can delegate to GSDrawTiles, if used. 2013-10-15 Eric Wasylishen * Source/NSTabViewItem.m (-drawLabel:inRect:): Center label vertically inside the tab. 2013-10-15 Eric Wasylishen * Source/NSTabView.m (-initWithCoder:): Make non-keyed archives call -selectTabViewItem: to select the current tab at unarchiving time (keyed archives were already doing this.) Comment: "N.B.: As a side effect, this discards the subview frame and sets it to [self contentRect]. This is desirable because the subview frame will be different depending on whether the arcive is from Cocoa or GNUstep, and which GNUstep theme was active at save time. However, it does mean that the tab view contents should be prepared to resize slightly." The immediate need for this is tab views were changed to use flipped coordinates, so the subview frames stored in existing archives are now in the wrong coordinate system. This is essentially the same idea as NSScrollView calling -tile at the end of -initWithCoder: so I hope it makes sense for tab views too. 2013-10-14 Eric Wasylishen * Source/GSThemeDrawing.m (-tabHeightForType:): Check for nil before calling -size on an NSImage, for systems where this corrupts the stack. 2013-10-14 Eric Wasylishen * Source/GSThemeDrawing.m: Change stepper drawing methods to use images. The stepper is too small to make decomposing it in to border + bezel + arrow worthwhile; it's simpler to just use images. * Images/GNUmakefile: * Images/common_StepperDown.tiff: * Images/common_StepperDownHighlighted.tiff: * Images/common_StepperUp.tiff: * Images/common_StepperUpHighlighted.tiff: Add stepper images 2013-10-14 Eric Wasylishen * Headers/Additions/GNUstepGUI/GSTheme.h: Add three new theme control state: GSThemeFirstResponderState, GSThemeHighlightedFirstResponderState, and GSThemeSelectedFirstResponderState. This lets themes draw custom first responder tiles, if the desired effect can't be accomplished by drawing on top of an existing button. * Source/GSThemeDrawing.m (-drawFocusFrame:inRect:): Use tiles named "NSFocusRing" if available, else draw dotted rect. * Source/GSTheme.m: * Source/NSButtonCell.m: Use new GSTheme*FirstResponderState states 2013-10-14 Eric Wasylishen * Source/GSThemeDrawing.m (-drawTableViewBackgroundInClipRect:...): Add support for drawing striped table backgrounds, using the colors returned by [NSColor controlAlternatingRowBackgroundColors]. Currently not used because -[NSTableView usesAlternatingRowBackgroundColors] is hardcoded to return NO. 2013-10-13 Eric Wasylishen * Source/NSSliderCell.m (-drawKnob:): Don't fill the knob with a background color before drawing the cell. Seems pointless - GNUstep's default knob image is opaque, but filling with a solid color prevents transparent knob images from looking good. 2013-10-13 Eric Wasylishen * Panels/English.lproj/GSPageLayout.gorm: * Panels/Spanish.lproj/GSPageLayout.gorm: Minor visual tweaks: Turn off "draws background" on the portrait/landscape matrix so it looks better with themes. Remove 0.5 point offsets on some views on the second and third tabs to eliminate blurring. 2013-10-13 Eric Wasylishen * Headers/Additions/GNUstepGUI/GSTheme.h: * Source/GSTheme.m: Add GSProgressIndicatorBezel part name * Source/GSThemeDrawing.m (-drawProgressIndicatorBezel:withClip:): Use GSProgressIndicatorBezel to draw bezel if available. 2013-10-12 Eric Wasylishen * Source/GSThemeTools.m (-initWithNinePatchImage:): Parse the "optiacal bounds" metadata in 9-patch images. It's stored in the layoutRect ivar but not used otherwise. See "Optical bounds layout" section of: http://developer.android.com/about/versions/android-4.3.html * Source/GSThemePrivate.h (GSDrawTiles): Add layoutRect ivar 2013-10-11 Eric Wasylishen * Source/NSColorWell.m (-drawRect:): Remove incorrect intersection with clipping rect that was causing artifacts when scrolling a list of color wells in Thematic. 2013-10-11 Eric Wasylishen * Source/GSThemeTools.m: Fix unflipped/flipped coordinates bug in the 9-patch content rect parsing code. Add some comments. Simplify contentRectForRect: implementation. * Source/GSThemeDrawing.m (-browserHeaderDrawingRectForCell:...): Use -contentRectForRect: to get the content rect instead of incorrectly reading from ivar. Fixes broken text positioning in browser header with Nesedah theme. 2013-10-09 German Arias * NSWindow.m (-sendEvent:): Fix last commit. 2013-10-09 German Arias * NSWindow.m (-sendEvent:): Only send events mouse entered if the cursor rectangles are valid. 2013-10-09 German Arias * NSWindow.m (-sendEvent:): Set _lastPoint after update the cursor. 2013-10-08 Eric Wasylishen * Source/GSThemeDrawing.m: * Source/GSTheme.m: * Headers/Additions/GNUstepGUI/GSTheme.h: Add part names for themeing bottom tabs. 2013-10-08 Eric Wasylishen * Source/GSThemeDrawing.m (-drawBoxInClipRect:...): * Source/NSBox.m (-calcSizesAllowingNegative): Special case for box type NSBoxSeparator to draw a centered line 2013-10-08 Eric Wasylishen * Source/NSTabView.m: Fix incorrect content rect now that view is flipped. 2013-10-08 Eric Wasylishen * Source/GSTheme.m (-tilesNamed:state:): Interpret .9.png files as NinePatch=YES. If a tile isn't listed in GSThemeTiles in the plist, try to find it in the ThemeTiles directory anyway. This lets you avoid declaring tiles in the info plist. 2013-10-08 Eric Wasylishen * Source/GSThemeDrawing.m (NSBox): If drawing with theme tiles, use actual clipping to clip a hole in the border, so we can avoid filling anything with the background color. * Source/NSBox.m (-isOpaque:): change to NO. 2013-10-08 Eric Wasylishen * Source/NSTabView.m: Uncomment - (BOOL) isFlipped { return YES; } * Source/GSThemeDrawing.m: Change tab drawing to assume flipped coordinates 2013-10-08 Eric Wasylishen * Source/GSThemeDrawing.m: Rewrite tab drawing code to be more organized, lay out the images in a straightforward way, and allow themeing the fill part of the tab between the end images. The output is almost pixel-identical to the old code (only some unnoticable 1-pixel differences in where shadows end). It's also organized so that adding support for left and right tabs should be easy. * Headers/Additions/GNUstepGUI/GSTheme.h: Add some part names * Images/common_Tab*.tiff: Tweak to work with the new layout code. All top images are now the same size, as are all bottom images. * Images/GNUmakefile: * Images/common_TabUnSelectToSelectedJunction.tiff: Renamed to Images/common_TabUnSelectedToSelectedJunction.tiff * Source/GSThemePrivate.h: * Source/GSTheme.m: Add GSStringFromTabViewType utility function 2013-10-07 Eric Wasylishen * Source/GSThemeDrawing.m (-drawTableViewGridInClipRect:inView:): Clean up grid drawing code; use rect fills to avoid blurriness. 2013-10-07 Eric Wasylishen * Headers/Additions/GNUstepGUI/GSTheme.h: * Source/GSThemeDrawing.m: * Source/NSPopUpButtonCell.m: Remove -[GSTheme drawBorderAndBackgroundForPopUpButtonCell: withFrame:inView:state:] which I added recently, and just use -[GSTheme drawButton:in:view:style:state]. This way, NSPopUpButtonCell automatically supports all of the different NSBezelStyles. 2013-10-07 Eric Wasylishen * Source/GSTitleView.m: Use the GSTheme -setName:forElement:temporary: mechanism to bind the menu close button's cell to the name GSMenuCloseButton, so themes can provide a custom border for this button. 2013-10-06 Eric Wasylishen * Documentation/GuiUser/DefaultsSummary.gsdoc: * Headers/Additions/GNUstepGUI/GSTheme.h: * Source/GSThemeDrawing.m: * Source/NSScroller.m: Add defaults GSScrollerScrollsByPage and GSScrollerArrowsSameEnd to allow customizing scroller behaviour beyond the combinations provided by NSInterfaceStyle. 2013-10-04 Eric Wasylishen * Source/NSColor.m: * Source/NSColorWell.m: Move code to draw the black and white triangles background for transparent colors to -[NSColor drawSwatchInRect:]. 2013-10-03 Eric Wasylishen * Headers/Additions/GNUstepGUI/GSTheme.h: * Source/GSThemeDrawing.m: * Source/NSBrowser.m: * Source/NSTableHeaderCell.m: Add custom color names tableHeaderTextColor and browserHeaderTextColor for table and browser headers. 2013-10-03 Eric Wasylishen * Source/NSMenuItemCell.m: If the cell is highlighted, draw the arrow using NSHighlightedMenuArrow (if available). 2013-10-03 Eric Wasylishen * Source/GSThemeDrawing.m: Use new -[GSDrawTiles themeMargins] to get the margins for draw tiles. * Source/GSThemePrivate.h: * Source/GSThemeTools.m: Get the 9-patch content rect support working from end-to-end. 2013-10-03 Eric Wasylishen * Headers/Additions/GNUstepGUI/GSTheme.h: * Source/GSTheme.m: * Source/GSThemeDrawing.m: * Source/NSBox.m: Factor out -[NSBox drawRect:] to GSTheme method -drawBoxInClipRect:boxType:borderType:inView:. Add a tiles name GSBoxBorder for themeing the box border. 2013-10-03 Eric Wasylishen * Source/NSSliderCell.m: Support themeing the circular slider with the image @"common_CircularSlider". Draw the dimple with @"common_Dimple" instead of an NSBezierPath. 2013-10-02 Eric Wasylishen * Headers/Additions/GNUstepGUI/GSTheme.h: * Source/GSTheme.m: Declare GSSliderHorizontalTrack and GSSliderVerticalTrack part names for themeing the background of NSSlider * Source/GSThemeDrawing.m: Add new drawSliderBorderAndBackground:frame:inCell:isHorizontal: method to draw the slider border and background. * Source/GSThemePrivate.h: * Source/GSThemeTools.m: Add a -size method on GSDrawTiles which returns the total original size of the tiles, so we can easily compute a rect that scales the tiles in only one dimension. * Source/NSSliderCell.m: Override _drawBorderAndBackgroundWithFrame: to call new GSTheme method. Also, tweak the knob drawing code; the knob is now centered and drawn at its native size. This still looks correct with the default slider sizes create by Gorm. 2013-10-02 Eric Wasylishen * Source/NSMenuView.m (heightForItem:, yOriginForItem:): Accept negative item indicies, which are passed in when opening the preferences window in TextEdit. Need to investigate further why that is happening. 2013-10-02 Eric Wasylishen * Headers/Additions/GNUstepGUI/GSTheme.h: * Source/GSTheme.m: * Source/GSThemeDrawing.m: * Source/NSPopUpButtonCell.m: Add a theme part GSPopUpButton so NSPopUpButtonCell can be drawn with a different background than NSMenuItemCell. 2013-10-02 Eric Wasylishen * Source/NSMenuView.m: Read the menu item/menu bar/separator height from GSTheme. * Headers/Additions/GNUstepGUI/GSTheme.h: * Source/GSThemeDrawing.m: Add -menuBarHeight, -menuItemHeight, -menuSeparatorHeight. Corresponding defaults are GSMenuBarHeight, GSMenuItemHeight, GSMenuSeparatorHeight 2013-09-29 Eric Wasylishen * Headers/Additions/GNUstepGUI/GSTheme.h: * Source/NSScrollView.m: * Source/GSThemeDrawing.m: * Source/GSTheme.m: Add GSScrollViewUseBottomCorner default, which themes can set to NO to leave a square gap in the bottom- left (or bottom-right) corner where the horizontal and vertical scrollers meet. 2013-09-29 Eric Wasylishen * Source/NSBrowser.m: Fix some position calculations from the last commit 2013-09-29 Eric Wasylishen * Source/NSBrowser.m: * Source/GSThemeDrawing.m: * Headers/Additions/GNUstepGUI/GSTheme.h: Add GSBrowserUseBezels user default. Themes can set it to NO to prevent NSBrowser from drawing any bezels, even if separatesColumns is set to YES. 2013-09-29 Eric Wasylishen * Source/NSBrowser.m: Small refactoring to simplify code. Remove update logic from -setSeparatesColumns: and just use -tile. Tested by toggling "separates columns" flag in Gorm. 2013-09-29 Eric Wasylishen * Source/NSBrowser.m: Change NSBR_COLUMN_SEP and NSBR_VOFFSET macros to static floats. Cache the values in +initialize and when GSThemeDidActivateNotification is sent, by calling the new GSTheme methods. * Source/GSThemeDrawing.m: * Headers/Additions/GNUstepGUI/GSTheme.h: Add -browserColumnSeparation and -browserVerticalPadding methods which access user defaults GSBrowserColumnSeparation and GSBrowserVerticalPadding. These determine the padding between browser columns, and the vertical padding between the bottom scroller, contents, and headers. 2013-09-29 Fred Kiefer * Source/NSImage.m: Better protection against representation being nil. 2013-09-29 German Arias * Source/GSAutocompleteWindow.m (-computePosition): Check the scrollview style to display the autocomplete window. 2013-09-28 Eric Wasylishen * Source/GSTheme.m: * Source/GSTitleView.m: * Source/GSThemeDrawing.m: * Headers/Additions/GNUstepGUI/GSTheme.h: Add GSMenuTitleBackground theme tile for themeing the background of GSTitleView. NOTE: I removed some code that was in -[GSTitleView drawRect:] for drawing with a different style when the GSTitleView is NOT owned by an NSMenu, but by an NSWindow/NSPanel (_ownedByMenu == NO). If needed, this can be added back, but it doesn't appear to ever be used in gnustep-gui - GSTitleView is only created in one place, with NSMenu as the owner. 2013-09-28 Eric Wasylishen * Source/NSCell.m (-highlight:withFrame:inView:): Remove call to [controlView displayRect: cellFrame]; There was a comment saying it should be removed, and when combined with the -[NSButtonCell isOpaque] change, it was casuing scroller buttons to stay "stuck" down. * Source/NSBrowser.m (-isOpaque): * Source/NSButtonCell.m (-isOpaque): * Source/NSColorWell.m (-isOpaque): Force -isOpaque to return NO, because it's possible to make all of these controls semitransparent with theme tiles. This was visible with the Narcissus theme (svn://svn.gna.org/svn/etoile/trunk/Etoile/Themes/Narcissus.theme) 2013-09-28 Eric Wasylishen * Source/GSThemeDrawing.m: Add GSScrollerDefaultWidth user default so non-code themes can change -[GSTheme defaultScrollerWidth] 2013-09-28 Eric Wasylishen * Source/NSScroller.m: Add GSScrollerKnobOvershoot default which allows themes to make the scroller knob overlap the scroller buttons by a specified amount. 2013-09-27 German Arias * Source/NSMenuView.m (-locationForSubmenu:): Don't change the location of submenu if menu is horizontal and style is NSMacintoshInterfaceStyle. 2013-09-27 Fred Kiefer * Source/NSBrowserCell.m (-drawInteriorWithFrame:inView:): Don't draw string when editing. * Source/NSBrowserCell.m (-titleRectForBounds:): Implement to exactly match calculation in -drawInteriorWithFrame:inView:. 2013-09-27 German Arias * Source/NSMenuView.m (- _trackWithEvent:startingMenuView:): If menu is owned by a popup and theme process events, close it if user press a modifier key. 2013-09-26 German Arias * Source/GSThemeMenu.m (-displayPopUpMenu:withCellFrame:...): Revert last change, this don't prevent users open two or more popups at same time. * Source/NSPopUpButtonCell.m (-trackMouse:inRect:ofView:untilMouseUp:): Don't check here if theme process events, this avoid NSMenuView process correctly the events. * Source/NSMenuView.m (- _trackWithEvent:startingMenuView:): Ignore the first mouse up if is a popup and theme process events. 2013-09-24 German Arias * Source/GSThemeMenu.m (-displayPopUpMenu:withCellFrame:...): If the PopUp (pulldown) is currently displayed and the theme process events, allow user close it by clicking over the PopUp button. 2013-09-23 Ivan Vucica * Source/NSImage.m: Missing -retain inside the method -compositeToPoint:fromRect:operation:fraction: caused a crash inside Opal backend. * Source/NSImage.m: Missing -retain inside the method -drawInRect:fromRect:... caused a crash inside Opal backend. 2013-09-22 16:52-EDT Gregory John Casamento * Headers/AppKit/NSTableView.h: Add formal protocols for NSTableViewDelegate and NSTableViewDataSource. 2013-09-22 15:59-EDT Gregory John Casamento * Headers/AppKit/NSAnimation.h: Add NSAnimationDelegate. 2013-09-18 18:17-EDT Gregory John Casamento * Headers/AppKit/AppKit.h: Add NSTrackingArea.h * Headers/AppKit/NSTrackingArea.h: Add interface for NSTrackingArea * Source/GNUmakefile: Add NSTrackingArea.[hm] to makefile. * Source/NSTrackingArea.m: Add implementation for NSTrackingArea 2013-09-17 Riccardo Mottola * Source/NSSplitView.m Silence more warnings. 2013-09-17 16:36-EDT Gregory John Casamento * Headers/AppKit/NSWindow.h: Add declaration to remove "attachedSheet" from protocol. Add declaration to add delegate methods to NSObject. Some methods in NSWindow call these on self. 2013-09-17 Ivan Vucica * Source/NSLayoutManager.m: advancementbuf[0] was not being filled. Most backends, including cairo, ignore advancements, so the bug was not immediately apparent until opal backend started using the advancements. 2013-09-17 16:36-EDT Gregory John Casamento * Headers/AppKit/NSMenu.h: Add NSMenuDelegate * Headers/AppKit/NSWindow.h: Add NSWindowDelegate 2013-09-17 Riccardo Mottola * Source/NSAnimation.m Warning fix. 2013-09-16 Fred Kiefer * Source/NSBrowser.m (-setPath:): Fixed a bug where setting the path to "/" would not deselect the cells. Based on patch by Frank Le Grand 2013-09-13 Riccardo Mottola * Source/NSBitmapImageRep+GIF.m (-_initBitmapFromGIF:): Prepare for additional argument to function DGifOpen in newer libgif versions. 2013-08-30 Fred Kiefer * Source/NSAttributedString.m (-fixFontAttributeInRange:): In the absence of a NSFontAttributeName attribute, use a default font to prevent the substitution from stopping. This fixes a bug where unicode characters would not get the proper font substitution. Patch by: Frank Le Grand 2013-08-30 Fred Kiefer * Headers/Additions/GNUstepGUI/GSDisplayServer.h * Source/GSDisplayServer.m: Add new method -_printEventQueue. * Source/NSWindow.m (-_checkCursorRectangles:forEvent:): Replace hack with proper functions that handle cursor rectangles. 2013-08-27 Fred Kiefer * Source/NSCursor.m (-mouseEntered:, -mouseExited:): Add better debug output. * Source/NSWindow.m (-_checkCursorRectangles:forEvent:): Add hack that updates cursor rectangles more correctly. 2013-08-19 Fred Kiefer * Headers/AppKit/NSTreeController.h, * Headers/AppKit/NSTreeNode.h: Add method declarations to these files. * Headers/AppKit/AppKit.h, * Source/GNUmakefile: Include new files. * Source/NSObjectController.m (+initialize, -selection): Get basic binding example working. * Source/NSTreeController.m: Minimal implementation. * Source/NSTreeNode.m: Full implementation of this class. 2013-08-17 Fred Kiefer * Headers/AppKit/NSStatusBar.h, * Source/NSStatusBar.m: Add new class implementation. * Headers/AppKit/AppKit.h: Add new header for NSStatusBar.h * Source/GNUmakefile: Add new class. * Headers/AppKit/NSStatusItem.h, * Source/NSStatusItem.m: Add code by Nikolaus Schaller , reformatted and simplified. 2013-08-12 Lubos Dolezel * Headers/AppKit/NSSavePanel.h, * Source/NSSavePanel.m: beginSheetModalForWindow: and beginWithCompletionHander: implementations 2013-08-08 16:27-EDT Gregory John Casamento * Headers/AppKit/AppKit.h: Add new header for NSStatusItem.h * Headers/AppKit/NSStatusItem.h: Placeholder header. * Source/NSStatusItem.m: Add new class implementation. * Source/GNUmakefile: Add new class. 2013-07-22 Quentin Mathe * Source/NSImage.m (+_pathForImageNamed:, +_pathForSystemImageNamed:type:, +_pathForThemeImageNamed:type:, +_resourceNameForImageNamed:type:): Fixed missing theme images if not listed in the theme bundle Info.plist. Theme bundles that contain theme images named using either GNUstep or OPENSTEP names now work properly again (bug introduced in r36836). Finished to clean and reduce duplication in the image searching code related to -_pathForImageNamed:. * Images/nsmapping.strings: Updated documentation. 2013-07-18 German A. Arias * Source/NSPopUpButtonCell.m (-attachPopUpWithFrame:inView:): Revert last change. * Source/GSThemeMenu.m (-displayPopUpMenu:withCellFrame:...): Add here the code. This place is more appropriate. 2013-07-17 German A. Arias * Source/NSPopUpButtonCell.m (-attachPopUpWithFrame:inView:): Ensure the window responds when run in modal and should process events. 2013-07-15 Riccardo Mottola * Images/nsmapping.strings Do not remap GNUstep image itself. 2013-07-15 Riccardo Mottola * Headers/Additions/GNUstepGUI/GSTheme.h * Source/GSTheme.m Add license to the Theme properties. 2013-07-11 German A. Arias * Source/NSMenu.m (-displayTransient): Push an arrow cursor when display transient menus, to not use the current cursor. 2013-07-08 Fred Kiefer * Headers/Additions/GNUstepGUI/GSDisplayServer.h * Source/GSDisplayServer.m: Add new method -setIgnoreMouse:: with empty implementation. * Source/NSWindow.m (-setIgnoresMouseEvents:): Use this new method. 2013-07-08 German A. Arias * Source/NSMenuView.m (_trackWithEvent:startingMenuView:): Ignore the first mouse up if is a transient menu and style is NSWindows95InterfaceStyle. 2013-07-07 German A. Arias * Headers/AppKit/NSCursor.h: * Source/NSCursor.m (-init, -push, -pop): Revert last commit. 2013-07-07 German A. Arias * Headers/AppKit/NSCursor.h: Add _windowNum and _cursorRect. * Source/NSCursor.m (-init, -push, -pop): Store at cursor object the rect and the window where this is displayed. So the next time the app request push this cursor, it can compare if currently is displayed for that rect in that window. To prevent duplicate the cursor. 2013-07-07 Fred Kiefer * Source/NSImageRep.m (-guiDrawInRect:...fraction:): Readd special handling for printing as suggested by Eric Wasylishen . 2013-07-04 Quentin Mathe * Headers/Additions/GNUstepGUI/GSTheme.h: * Source/GSTheme.m: Added new theme image constant image names. * Source/NSImage.m (+imageNamed:, +_reloadCachedImages, +_pathForImageNamed:): Added support for providing custom theme control images in the same way that we support it for tiles. We now support a GSThemeImages section in the theme Info.plist for all the images stored inside a ThemeImages directory of the theme bundle. 2013-07-04 Richard Frith-Macdonald * config.make.in: Fix error in order of link/include directories * configure.ac: Change variable names for match make system * configure: regenerate * Source/NSView.m: trivial comment format changes 2013-07-03 Eric Wasylishen * Source/Functions.m: * Headers/AppKit/NSGraphics.h: Add NSDrawThreePartImage 2013-07-02 German A. Arias * Source/NSCursor.m (-push): Revert last change. 2013-07-02 German A. Arias * Source/NSCursor.m (-push): If the cursor is the current cursor, don't set it again. * Source/NSWindow.m (-sendEvent:): Don't update the cursor if the window isn't the key window. 2013-06-22 German A. Arias * Source/NSComboBoxCell.m (-initWithContentRect:...): Fix memory leak in GSComboWindow. 2013-06-20 German A. Arias * Source/GNUmakefile: Remove GSAutocompleteWindow.h, isn't necessary add this here. * Source/GSAutocompleteWindow.m: Add NSScreen header. 2013-06-19 German A. Arias * Source/GSAutocompleteWindow.h: * Source/GSAutocompleteWindow.m: Add. * Source/GNUmakefile: Add new files. * Source/NSTextView.m (-rangeForUserCompletion, -complete:, -completionsForPartialWordRange:indexOfSelectedItem:, -insertCompletion:forPartialWordRange:movement:isFinal:): Implement methods for autocomplete. 2013-06-02 German A. Arias * Headers/AppKit/NSText.h: Add NSCancelTextMovement and NSOtherTextMovement for compatibility with Cocoa. 2013-05-27 German A. Arias * Tools/say/GNUmakefile: Fix flag. 2013-05-17 Sebastian Reitenbach * Source/NSParagraphStyle.m bump version, and fix decoder 2013-05-14 German A. Arias * Source/NSFormCell.m: Add method -resetCursorRect:inView:. 2013-05-13 Fred Kiefer * Source/GSNibLoading.m: Remove method [NSKeyedUnarchiver -replaceObject:withObject:] which was moved to base. 2013-05-11 Fred Kiefer * Source/NSColorPanel.m (-_magnify:): Use a local auto release pool in loop. 2013-05-06 German A. Arias * Source/NSSearchFieldCell.m: Add method -resetCursorRect:inView: and an inline method to handle correctly the mouse cursor. 2013-04-24 05:23-EDT Gregory John Casamento * Headers/AppKit/NSPopover.h: correct delegate method for popoverShouldClose: * Headers/AppKit/NSWindow.h: add convertRectToScreen: and convertRectFromScreen: methods. * Source/NSPopover.m: Correct delegate method for popoverShouldClose:. Changes to align popover window with rect it is being placed relative to. * Source/NSWindow.m: implementation of convertRectToScreen: and convertRectFromScreen: methods. 2013-04-23 Fred Kiefer * Source/GSXibLoader.m: Add -replaceObject:withObject: method. 2013-04-21 Fred Kiefer * Headers/AppKit/NSPopover.h, * Source/NSPopover.m: Adjust to GNUstep coding standards. * Source/externs.m: Move new strings to here. 2013-04-21 Fred Kiefer * Headers/AppKit/AppKit.h: Add NSCollectionView.h and NSCollectionViewItem.h. 2013-04-21 Fred Kiefer * Source/NSCollectionView.m (-_moveUpAndExpandSelection:): Correct the comparision. Bug reported by Gregory John Casamento * Headers/AppKit/NSPopover.h: Add missing import. * Source/GSXibLoader.m: Disable NSCustomView hack again. * Headers/AppKit/NSApplication.h: Replace GSAppDelegateProtocol with NSApplicationDelegate. * Source/NSApplication.m: Adjust documentation to this replacement. 2013-04-21 09:26-EDT Gregory John Casamento * Headers/AppKit/AppKit.h: Add NSPopover.h to set of files included. * Headers/AppKit/NSApplication.h: Add NSApplicationDelegate. Inherit from GSAppDelegateProtocol. * Headers/AppKit/NSPopover.h: NSPopover header. * Source/GNUmakefile: Added NSPopover.[hm] * Source/GSXibLoader.m: Translate NSCustomView to NSView when unarchiving. * Source/NSPopover.m: Skeletal implementation of NSPopover.m. 2013-04-21 Fred Kiefer * Source/NSTableView.m (-selectedColumnIndexes, -selectedRowIndexes): Return an autoreleased copy of the corresponding ivar. Returning a reference to the ivar leads to issues (and behavior different from Cocoa) when iterating thru the indexsets if at a time they would be being altered. Patch by Frank LeGrand (flegrand@testplant.com). * Source/GNUmakefile: Add NSCollectionViewItem. * Headers/AppKit/NSCollectionView.h, * Headers/AppKit/NSCollectionViewItem.h, * Source/NSCollectionViewItem.m, * Source/NSCollectionView.m: Bring closer to the GNUstep coding standard. 2013-04-17 23:54-EDT Gregory John Casamento * Headers/AppKit/NSCollectionView.h * Headers/AppKit/NSCollectionViewItem.h * Source/GNUmakefile * Source/NSCollectionViewItem.m * Source/NSCollectionView.m: Added NSCollectionView and NSCollectionViewItem classes from testplant branch. Made changes to original patch to conform to coding standards, NSCoding for non-keyed archiving and moved instances of float/integer to CGFloat and NSInteger/NSUInteger as appropriate. Patch by Doug Simons (dsimons@testplant.com) and Frank LeGrand (flegrand@testplant.com). 2013-04-15 Fred Kiefer * Headers/AppKit/NSKeyValueBinding.h, * Source/externs.m: Additional binding name NSContentValuesBinding. * Source/NSPopUpButton.m: Add KVB for NSContentValuesBinding. Patch by Marcian Lytwyn * Source/NSArrayController.m: Encode/decode clearsFilterPredicateOnInsertion. 2013-04-06 Eric Wasylishen * Source/GSTheme.m: * Source/NSImage.m: Revert previous commit and write a much cleaner implementation that fixes the same bug. I removed the step in theme activation where we call +[NSImage _setImagePath:name:] on each image in the theme, and instead modified +[NSImage _pathForImageNamed:] to also search the theme images directory. When a GSTheme activates now, it only calls +[NSImage _reloadCachedImages] which checks all NSImage cached by name and reloads any whose path has changed. 2013-04-06 Eric Wasylishen * Source/GSTheme.m: * Source/NSImage.m: Allow themes to override only a "base" image like common_3DArrowRight and have images that map to it (NSMenuArrow) automatically update. 2013-04-03 Fred Kiefer * Tools/speech/GSSpeechSynthesizer.m: Use object_getClass() instead of isa. Make exitIfUnneeded: a class method. Reformat code. 2013-04-03 Fred Kiefer * Source/NSBitmapImageRep+GIF.m (-_bitmapIsGIF:): Prepare for additional argument to function DGifOpen in newer libgif versions. 2013-03-28 Richard Frith-Macdonald Make release * Version 0.23.1 * Update release notes 2013-03-20 Fred Kiefer * Source/GSToolTips.m (+initialize): Set the level of the tool tip window to NSPopUpMenuWindowLevel. Change suggested by Wolfgang Lux 2013-03-18 Fred Kiefer * Tests/gui/NSImage/basic.m: Add basic tests for NSImage. * Tests/gui/NSCell/basic.m: Extend basic tests for NSCell. * Source/NSImage.m: Try to correct keyed encoding/decoding. Add incomplete isEqual: method. 2013-03-17 Fred Kiefer * Source/NSViewController.m: Retain the view. * Source/NSOutline.m(-drawRow:clipRect:): The selected cell shows its first responder state. Patch by Frank LeGrand 2013-03-17 Fred Kiefer * Source/NSEvent.m, * Source/NSParagraphStyle.m: Use NSInteger instead of enumerator type name for decoding and encoding. * Header/AppKit/NSFontPanel.h, * Header/AppKit/NSOpenPanel.h, * Header/AppKit/NSDataLinkPanel.h, * Source/NSDataLinkPanel.m, * Header/AppKit/NSForm.h, * Source/NSForm.m, * Header/AppKit/NSHelpPanel.h, * Source/NSHelpPanel.m, * Source/NSColorPanel.m: Remove unused encoding/decoding methods. * Source/NSCustomImageRep.m, * Source/NSEPSImageRep.m, * Source/NSMovie.m, * Source/NSRulerMarker.m, * Source/NSColorList.m: Flag missing keyed encoding/decoding. 2013-03-15 Fred Kiefer * Source/NSTableView.m: Use new method -_isCellSelectableColumn:row:, that checks the cells selectable state, in -mouseDown:. 2013-03-10 Fred Kiefer * Source/GSNibLoading.m (NSCustomView -nibInstantiateWithCoder:): Re-add call to -replaceObject:withObject: on decoder, but this time in the right place. 2013-03-09 Eric Wasylishen * Images/GNUmakefile: * Images/nsmapping.strings: * Images/common_Info.svg: * Images/common_Info.tiff: Add NSInfo image. 2013-03-08 Fred Kiefer * Tests/gui/NSSavePanel/setDelegate_reload.m: Rewrite to remove use of @defs(). Base on idea by Wolfgang Lux 2013-03-08 Fred Kiefer * Source/NSTableColumn.m (-initWithCoder:): Make columns non-editable by default. * Source/NSTableView.m (-editColumn:...select:): Make editing here independ of the datasource. * Source/NSTableView.m: Split -_isCellEditableColumn:row: in two methods and ignore the cell isEditable state in -mouseDown:. 2013-03-08 Fred Kiefer * Headers/AppKit/NSTextView.h: Make NSTextViewDelegate a formal protocol. 2013-03-08 Fred Kiefer * configure.ac: Correct change for libpng. Patch by Sebastian Reitenbach * configure: Regenerated. 2013-03-08 Fred Kiefer * Source/NSBezierPath.m (-elementAtIndex:associatedPoints:): Fix handling of close element. Patch by Bluna Ratimonkey . 2013-03-05 Fred Kiefer * Source/GSHorizontalTypesetter.m: Change floats into CGFloats to stop infinite loop. 2013-03-04 Fred Kiefer * configure.ac: Use CPPFLAGS instead of CFLAGS for libpng. Patch by Sebastian Reitenbach * configure: Regenerated. 2013-03-04 Fred Kiefer * Source/NSBezierPath.m: Implement keyed coding and complete keyed decoding. Patch by Christopher Armstrong * Source/NSBezierPath.m: Rewrote -elementAtIndex:associatedPoints: to return a point for NSClosePathBezierPathElement. And adjust all callers to make use of that point. Complete non-keyed coding and decoding. * Tests/gui/NSBezierPath/basic.m: Add basic tests for NSBezierPath. 2013-03-02 Sebastian Reitenbach * Source/NSMenuItemCell.m * Headers/AppKit/NSMenuItemCell.h float -> CGFloat transitions * ColorPickers/GSColorSliderCell.m more float -> CGFloat transitions * Headers/AppKit/NSOutlineView.h int -> NSInteger transitions for NSOutlineView protocol 2013-03-01 Richard Frith-Macdonald * Version ... bump subminor number in preparation for next release. 2013-03-01 Richard Frith-Macdonald Make release * Version 0.23.0 * Update release notes 2013-02-28 Eric Wasylishen * Source/GSPDFPrintOperation.m: Update -_print and -deliverResult to match GSEPSPrintOperation to get the class to at least partly working. Output is appearing up-side-down for me though. 2013-02-23 Fred Kiefer * Source/NSWindow.m (-setDelegate:): Don't unregister delegate notifications if same delegate is set twice. Patch by Doug Simons 2013-02-22 Fred Kiefer * Source/NSWindow.m (-initWithCoder:), * Source/NSBitmapImageRep.m (-_convertToFormatBitsPerSample:...): Correct problem found by valgrind. 2013-02-22 Fred Kiefer * Source/GSToolTips.m * Source/NSProgressIndicator.m * Source/NSTextView.m: Add the timers for NSModalPanelRunLoopMode as well. 2013-02-22 Fred Kiefer * Source/NSTabView.m (-minimumSize, -contentRect): Make the values here consistent with the code in GSThemeDrawing. * Source/GSThemeDrawing.m (-drawTabViewRect:...): Remove useless line of code. 2013-02-21 Riccardo Mottola * Source/NSParagraphStyle.m Encode and decode lineBreakMode with NSInteger and not NSLineBreakMode 2013-02-21 Fred Kiefer * Source/NSBitmapImageRep+PNG.m (-_PNGRepresentationWithProperties:): Revert last change and don't use png_info_init_3() on PNG >= 1.5. 2013-02-21 Riccardo Mottola * Source/NSBitmapImageRep+PNG.m Define png_sizeof() to allow compilation on 1.6. 2013-02-19 Fred Kiefer * Tools/make_services.m (main, CheckDirectory) Improve the last fix by using newer method. 2013-02-19 Quentin Mathe * Source/NSTableView.m (-_drawDropIndicator, -_setDropOperationAndRow:usingPositionInRow:atPoint:, -draggingUpdated:): Cleaned code a bit more. 2013-02-19 Quentin Mathe * Source/NSTableView.m (-draggingUpdated:): Don't update the drop row and operation if the drop target hasn't changed (this prevents to overwrite a custom drop row and operation set by the user in -tableView:handleValidateDrop:proposedRow:proposedOperation:). 2013-02-19 Quentin Mathe * Source/NSTableView.m (-draggingUpdated:): Extracted drop indicator drawing into a new method -_drawDropIndicator. 2013-02-19 Quentin Mathe * Source/NSTableView.m (-draggingUpdated:): Modularized the first part of the method into several smaller methods -_dropRowFromQuarterPosition:, -_setDropOperationAndRow:usingPositionInRow:atPoint: and _scrollRowAtPointToVisible:. 2013-02-18 Riccardo Mottola * Tools/make_services.m (main) Check Library directory before checking and attempting to create Services subdir 2013-02-18 Fred Kiefer * Source/GSDragView.m * Source/NSTextView.m Fix compiler warnings reported by Sebastian Reitenbach 2013-02-17 German A. Arias * Resources/Spanish.lproj/Localizable.strings: Translations. 2013-02-17 Fred Kiefer * Headers/AppKit/NSScrollView.h * Headers/AppKit/NSScroller.h * Headers/AppKit/NSSlider.h * Headers/AppKit/NSSliderCell.h * Headers/AppKit/NSTableColumn.h * Headers/AppKit/NSTableHeaderView.h * Headers/AppKit/NSTableView.h * Headers/AppKit/NSTextContainer.h * Headers/AppKit/NSTextTable.h * Source/NSScrollView.m * Source/NSScroller.m * Source/NSSlider.m * Source/NSSliderCell.m * Source/NSTableColumn.m * Source/NSTableHeaderView.m * Source/NSTableView.m * Source/NSTextBlock.m * Source/NSTextContainer.m * Source/NSTextTable.m More CGFloat, NSUInteger and NSInteger changes. 2013-02-17 Fred Kiefer * Headers/AppKit/NSGraphicsContext.h * Headers/AppKit/NSWindow.h * Source/NSActionCell.m * Source/NSBrowser.m * Source/NSCell.m * Source/NSEvent.m * Source/NSImageRep.m * Source/NSMatrix.m * Source/NSMenuItem.m * Source/NSParagraphStyle.m * Source/NSRulerMarker.m * Source/NSRulerView.m * Source/NSSegmentedCell.m * Source/NSView.m * Source/NSWindow.m: Correct coding/decoding after type changes. 2013-02-17 Fred Kiefer * Source/NSBezierPath.m: More keyed decoding. 2013-02-17 Fred Kiefer * Headers/AppKit/NSBrowser.h * Headers/AppKit/NSClipView.h * Headers/AppKit/NSComboBox.h * Headers/AppKit/NSComboBoxCell.h * Headers/AppKit/NSForm.h * Headers/AppKit/NSFormCell.h * Headers/AppKit/NSParagraphStyle.h * Source/NSAttributedString.m * Source/NSBrowser.m * Source/NSClipView.m * Source/NSComboBox.m * Source/NSComboBoxCell.m * Source/NSForm.m * Source/NSFormCell.m * Source/NSParagraphStyle.m More CGFloat, NSUInteger and NSInteger changes. 2013-02-16 Fred Kiefer * Headers/AppKit/NSDragging.h * Headers/AppKit/NSInputManager.h * Headers/AppKit/NSLayoutManager.h * Headers/AppKit/NSRulerView.h * Headers/AppKit/NSText.h * Headers/AppKit/NSTextView.h * Source/NSInputManager.m * Source/NSLayoutManager.m * Source/NSText.m * Source/NSTextView.m * Source/NSTextView_actions.m More CGFloat, NSUInteger and NSInteger changes. 2013-02-16 Fred Kiefer * Headers/Additions/GNUstepGUI/GSWindowDecorationView.h * Headers/AppKit/NSBitmapImageRep.h * Headers/AppKit/NSForm.h * Headers/AppKit/NSImage.h * Headers/AppKit/NSMenuItem.h * Headers/AppKit/NSRulerMarker.h * Headers/AppKit/NSRulerView.h * Headers/AppKit/NSSegmentedCell.h * Headers/AppKit/NSSegmentedControl.h * Headers/AppKit/NSWindow.h * Source/GSStandardWindowDecorationView.m * Source/GSWindowDecorationView.m * Source/NSBitmapImageRep.m * Source/NSForm.m * Source/NSImage.m * Source/NSMenuItem.m * Source/NSRulerMarker.m * Source/NSRulerView.m * Source/NSSegmentedCell.m * Source/NSSegmentedControl.m * Source/NSWindow.m More CGFloat, NSUInteger and NSInteger changes. 2013-02-14 Quentin Mathe * Headers/AppKit/NSTableView.h * Source/NSTableView.m * Source/NSOutline.m (-_dataCellForTableColumn:row:, -preparedCellAtColumn:row:): Replaced _dataCellForTableColumn:row: by -preparedCellAtColumn:row: new public method from Mac OS X 10.5. 2013-02-14 Fred Kiefer * Source/GSXibLoader.m (GSXibKeyedUnarchiver -_preProcessXib:): Release the document. Patch by Doug Simons * Source/GSXibLoader.m: Fix a problem where owner, firstResponder and application were put in the list of top-level objects, creating a retain-cycle. * Source/NSViewController.m: Fix a problem where view controllers did not release their top-level objects as expected. * Source/NSWindowController.m: Fix a problem where window controllers did not release their top-level objects as expected. Changes made in occordance with https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/CocoaNibs.html Patch by Jonathan Gillaspie 2013-02-14 Fred Kiefer * Source/GSDragView.m * Source/GSSlideView.m * Source/NSApplication.m Resolve clang warnings about wrong format specifiers for NSLog. Patch by Sebastian Reitenbach 2013-02-13 Fred Kiefer * Source/GSXibLoader.m: Resolve memory leak for GSXibElement. 2013-02-13 Fred Kiefer * Headers/AppKit/NSEvent.h * Source/NSEvent.m * Source/GSDragView.m * Source/GSTitleView.m * Source/NSComboBoxCell.m * Source/NSInputManager.m * Source/NSMatrix.m * Source/NSMenuView.m * Source/NSRulerMarker.m * Source/NSScroller.m * Source/NSSlider.m * Source/NSSliderCell.m * Source/NSTableHeaderView.m * Source/NSTableView.m: Change NSEvent to CGFloat, NSUInteger and NSInteger. 2013-02-10 Fred Kiefer * Headers/AppKit/NSSplitView.h * Source/NSSplitView.m: Change to CGFloat, NSUInteger and NSInteger. Patch partly by Sebastian Reitenbach 2013-02-08 Fred Kiefer * Sound/SndfileSource.m (dataRead): Remove unused variable range. Patch by Sebastian Reitenbach 2013-02-08 Fred Kiefer * Headers/AppKit/NSPageLayout.h * Source/NSPageLayout.m: Change int to NSInteger. Patch by Sebastian Reitenbach 2013-02-08 Fred Kiefer * Resources/English.lproj/Localizable.strings * Resources/Esperanto.lproj/Localizable.strings * Resources/French.lproj/Localizable.strings * Resources/German.lproj/Localizable.strings * Resources/Italian.lproj/Localizable.strings * Resources/Lojban.lproj/Localizable.strings * Resources/Spanish.lproj/Localizable.strings Regenerate string files. Translations are still missing. 2013-02-07 Riccardo Mottola * Source/NSSavePanel.m (initWithoutGModel): Add tooltips to buttons. 2013-02-06 Quentin Mathe * Source/NSView.m (-encodeWithCoder:): Fixed to encode the superview conditionally as Cocoa does (Apple discusses superview encoding as a use case for conditional encoding in the Archiving related documentation). View can now be archived (or copied) without having to remove the view from its hierarchy before archiving it. 2013-02-05 Fred Kiefer * Headers/Additions/GNUstepGUI/GSMethodTable.h * Headers/AppKit/DPSOperators.h * Headers/AppKit/NSCachedImageRep.h * Headers/AppKit/NSGraphicsContext.h * Headers/AppKit/NSImageRep.h * Headers/AppKit/PSOperators.h * Source/Functions.m * Source/NSAffineTransform.m * Source/NSCachedImageRep.m * Source/NSGraphicsContext.m: Change DPS/PS functions to CGFloat and NSInteger. 2013-02-05 David Chisnall * Source/NSMenu.m: When displaying the horizontal menu, set the title of the main menu to the name of the application, not the name of the process, if the info bundle contains an application name. * Source/NSSavePanel.m: Fix the NSBrowser delegate methods in NSSavePanel to have the correct types. 2013-02-01 Fred Kiefer * Source/NSBezierPath.m: Started the implementation of keyed encoding and decoding. 2013-02-01 Fred Kiefer * Headers/AppKit/NSBezierPath.h * Source/GSThemeTools.m * Source/NSBezierPath.m * Source/NSGraphicsContext.m * Source/NSLayoutManager.m: More NSInteger/NSUInteger/CGFloat cleanup 2013-01-30 Fred Kiefer * Headers/AppKit/NSBrowser.h * Headers/AppKit/NSFontPanel.h * Headers/AppKit/NSMatrix.h * Headers/AppKit/NSTableView.h * Source/NSBrowser.m * Source/NSFontPanel.m * Source/NSMatrix.m: Small fixes to last change. 2013-01-30 David Chisnall * ColorPickers/GSNamedColorPicker.m * Headers/Additions/GNUstepGUI/GSDisplayServer.h * Headers/AppKit/NSArrayController.h * Headers/AppKit/NSBrowser.h * Headers/AppKit/NSControl.h * Headers/AppKit/NSMatrix.h * Headers/AppKit/NSTableView.h * Headers/AppKit/NSToolbar.h * Source/GSDisplayServer.m * Source/GSDragView.m * Source/GSLayoutManager.m * Source/GSMemoryPanel.m * Source/GSNibLoading.m * Source/GSTheme.m * Source/GSToolTips.m * Source/GSXibLoader.m * Source/NSActionCell.m * Source/NSAlert.m * Source/NSApplication.m * Source/NSBrowser.m * Source/NSButtonCell.m * Source/NSCell.m * Source/NSColor.m * Source/NSColorList.m * Source/NSComboBoxCell.m * Source/NSControl.m * Source/NSEvent.m * Source/NSFontPanel.m * Source/NSGraphicsContext.m * Source/NSHelpManager.m * Source/NSHelpPanel.m * Source/NSMatrix.m * Source/NSNibBindingConnector.m * Source/NSOutlineView.m * Source/NSPrintPanel.m * Source/NSSearchFieldCell.m * Source/NSTableView.m * Source/NSTextView.m * Source/NSWindow.m * Source/NSWorkspace.m * Tools/make_services.m: Fix all current compiler warnings on FreeBSD/x86-64. 2013-01-30 Fred Kiefer * Source/externs.m: Change predefined colour values to CGFloat. 2013-01-29 Fred Kiefer * Headers/AppKit/NSCell.h * Headers/AppKit/NSColor.h * Headers/AppKit/NSGraphics.h * Headers/AppKit/NSView.h * Source/Functions.m * Source/GSThemeDrawing.m * Source/GSTitleView.m * Source/NSApplication.m * Source/NSCell.m * Source/NSView.m: More NSInteger/NSUInteger/CGFloat cleanup 2013-01-29 Fred Kiefer * Headers/AppKit/NSApplication.h * Source/NSApplication.m: NSInteger/NSUInteger cleanup * Source/externs.m: Add NSAppKitVersionNumber. 2013-01-27 Fred Kiefer * Headers/Additions/GNUstepGUI/GSWindowDecorationView.h * Headers/AppKit/NSActionCell.h * Headers/AppKit/NSAlert.h * Headers/AppKit/NSGraphics.h * Headers/AppKit/NSPanel.h * Headers/AppKit/NSWindow.h * Source/GSStandardWindowDecorationView.m * Source/GSToolTips.m * Source/GSWindowDecorationView.m * Source/NSActionCell.m * Source/NSAlert.m * Source/NSDrawer.m * Source/NSPanel.m * Source/NSWindow.m: First set of NSInteger/NSUInteger cleanup in gui. 2013-01-27 Fred Kiefer * Source/NSTextContainer.m (lineFragmentRectForProposedRect:...): Prevent negative width/height from being returned. Bug found by unit test from Nikolaus Schaller . 2013-01-25 12:58-EST Gregory John Casamento * Source/NSPopUpButtonCell.m: Revert previous change. 2013-01-24 19:45-EST Gregory John Casamento * Source/NSPopUpButtonCell.m: remove _popUpItemAction: from -insertItemWithTitle:atIndex:. 2013-01-19 Fred Kiefer * Headers/AppKit/NSTextContainer.h, * Source/NSTextContainer.m, * Source/GSHorizontalTypesetter.m: Correct the definition of NSLineMovementDirection. * Headers/AppKit/NSFont.h * Source/NSFont.m: Add a few missing 10.4 methods. * Header/AppKit/NSLayoutManager.h, * Source/NSLayoutManager.m: Add one 10.5 method. 2013-01-13 Wolfgang Lux * configure.ac: * Headers/Additions/GNUstepGUI/config.h.in: Add check whether giflib defines QuantizeBuffer. * Source/NSBitmapImageRep+GIF.m (_GIFRepresentationWithProperties:errorMessage:): Disable when QuantizeBuffer is not available. * configure: Regenerated. 2013-01-13 Wolfgang Lux * configure.ac: * config/pkg.m4: Explicitly include pkg.m4 to make sure that the PKG_CHECK_MODULES macro is defined. * configure: Regenerated. 2013-01-06 Fred Kiefer * Source/NSStringDrawing.m(is_size_match): Disable matches where one has size information, but the other hasn't. 2012-12-31 Fred Kiefer * Source/NSView.m (-_rebuildCoordinates): Check if the flipped state of the view has changed. Call this method all the times instead of checking _coordinates_valid. This change allows views to dynamically change their flipped state. 2012-12-31 Fred Kiefer * Source/NSFont.m (-setInContext:): Remove usage of matrixExplicitlySet. Patch by Derek Fawcus . * Source/NSFont.m: Remove all other usages of matrixExplicitlySet. 2012-12-30 Fred Kiefer * Headers/Additions/GNUstepGUI/GSLayoutManager_internal.h: Make -_invalidateEverything visible. * Source/GSLayoutManager.m (-invalidateGlyphsForCharacterRange:...): Call -_invalidateEverything when the whole character range is invalidated. * Source/NSStringDrawing.m: Remove workarounds for full layout invalidation. Move initialisation check into cache_lock(). Extract size match code in function. Put #ifdef around all statistics code. Use same LARGE_SIZE value as Apple does. Make the methods taking options the main ones. * Source/GSHorizontalTypesetter.m (-fullJustifyLine::, -rightAlignLine::, -centerAlignLine::): Don't align when the line width is bigger than 1e7. 2012-12-26 Fred Kiefer * Headers/AppKit/NSOpenGL.h, * Source/NSOpenGLPixelFormat.m: NSOpenGLPixelFormat directly implements initWithCoder so that it may marshall the pixel attributes prior to initWithAttributes:. Change the getValues:... method to take an int argument instead of long. GLint is mapped to int on most systems. * Source/NSOpenGLContext.m: Use the format decoding to decode an OpenGL context. Patch by Clint Smullen . * Source/GSLayoutManager.m: Small cleanup in glyph code. 2012-12-23 Fred Kiefer * Source/NSFont.m (-initWithName:...): Move replacement name into separate method -_replacementFontName and add replacement for "Helvetica-" prefix. * Header/AppKit/NSLayoutManager.h: Add some 10.5 methods. * Source/NSLayoutManager.m: Simple implementations for these new methods. 2012-12-16 Fred Kiefer * Source/NSFontPanel.m (-_initWithoutGModel): Fix font panel size background color - this broke when theme colors were added. * Source/GSCharacterPanel.m: Compile in -[NSApplication orderFrontCharacterPalette:] and do nothing instead of throwing a run-time exception. * Source/NSTextView.m (-_stopInsertionTimer, -_startInsertionTimer): Extract this helper methods from -updateInsertionPointStateAndRestartTimer:. * Source/NSTextView.m (-cleanUpAfterDragOperation): Add cleanup code to cleanUpAfterDragOperation. Gets invoked from concludeDragOperation:. Fix drag and drop of file objects. Based on patches by Marcian Lytwyn 2012-12-10 Riccardo Mottola * Source/NSMenuItemCell.m (titleRectForBounds) Add a special case for popup buttons, akin imageRectForBounds 2012-12-08 Fred Kiefer * Source/NSViewController.m: Add missing #import for NSArray. 2012-11-12 Wolfgang Lux * Source/NSDocument.m (-_runSavePanelForSaveOperation:): Set save panel accessory view before calling -prepareSavePanel: to allow clients to modify the accessory view. Furthermore, don't call -prepareSavePanel: if -runModalSavePanel:withAccessoryView: is overridden. 2012-11-05 Fred Kiefer * Source/NSApplication.m (-_openFiles): Protect agains empty arguments. Patch by LuboÅ¡ Doležel 2012-10-31 Fred Kiefer * Source/NSTabView.m (-dealloc): Reset _selected to nil at top of dealloc. * Source/NSBox.m(-drawRect:, -initWithCoder:): Implement transparent handling for custom boxes. Patch by Marcian Lytwyn * Source/NSTabView.m (-selectTabViewItem:): Remove duplicated code. * Source/NSTabView.m (-removeTabViewItem:): Retain the item while removing it. 2012-10-26 German A. Arias * Source/GSThemeMenu.m (-setMenu:forWindow:): Revert last change. After a different test I notice this really work. I don't know why my first test didn't work. 2012-10-25 German A. Arias * Source/GSThemeMenu.m (-setMenu:forWindow:): Remove any possible old menu before set the new menu. Because in its previous place (before if statement) doesn't work. 2012-10-18 23:19-EDT Gregory John Casamento * Source/NSButtonCell.m: Correct issues when decoding a .gorm file with key equivalent. Make sure that the image is properly set. 2012-10-17 08:15-EDT Gregory John Casamento * Source/GSThemeDrawing.m: Changes per discussion with Fred. Added check to make sure the image is not overriden. 2012-10-16 17:22-EDT Gregory John Casamento * Headers/Additions/GNUstepGUI/GSTheme.h: Add declaration for method setKeyEquivalent:forButtonCell: * Source/GSThemeDrawing.m: Add implementation for method setKeyEquivalent:forButtonCell: * Source/NSButtonCell.m: Add call to new method. 2012-10-15 18:02-EDT Gregory John Casamento * Source/NSButtonCell.m: Implementation for change request bug#37233. Button should now show the return image "common_ret" and "common_retH" when return/enter is the key equivalent. 2012-10-14 Fred Kiefer * Source/GSThemeDrawing.m (-drawTabViewRect:...selectedItem:), * Source/NSTabView.m (-drawRect:): Move the select logic from theme into normal code. 2012-10-13 Fred Kiefer * Headers/AppKit/NSBox.h, * Source/NSBox.m: Add 10.5 methods for custom drawn boxes. * Source/GSXibLoader.m (IBObjectContainer nibInstantiate): Check whether the object responds to setToolTip: before calling it. Merge changes from testplant branch: * Headers/AppKit/NSTabViewItem.h: Declare tooltip methods. * Source/NSTabViewItem.m: Move tooltip methods to correct category. * Headers/AppKit/NSTextStorage.h, * Source/NSTextStorage.m: Add font/setFont methods to NSTextStorage Patch by Marcian Lytwyn * NSWindow.m (-center): Center on the main screen if window is off screen. Patch by Doug Simons 2012-10-12 Fred Kiefer * Source/NSComboBoxCell.m (-textDidChange:): Handle nil string from delegate completed string processing Patch by Marcian Lytwyn 2012-10-12 Fred Kiefer * Source/GSToolTips.m: Use separate view to draw tooltip text. Patch by Marcian Lytwyn 2012-10-12 Fred Kiefer * Source/GSInfoPanel.m (value_from_info_plist_for_key): Use NSBundle method to get the info dictionary. Patch by: LuboÅ¡ Doležel 2012-10-10 Wolfgang Lux * Source/NSView.m (addTrackingRect:owner:userData:assumeInside:): Remove translation of tracking rectangle coordinates, which is no longer needed (and incorrect). 2012-10-07 02:12-EDT Gregory John Casamento * Headers/AppKit/NSTabView.h * Source/GSXibLoader.m * Source/NSTabView.m: Merge changes from TestPlant branch 2012-10-06 Wolfgang Lux * Source/NSWindow.m (-_checkTrackingRectangles:forEvent:): Tracking rectangles now use the coordinate system of their views, as they do under Cocoa. * Source/GSToolTips.h (-rebuild): Remove. * Source/GSToolTips.m (-rebuild): Remove. * Source/NSView.m (-_rebuildCoordinates): No need to recompute tool tip tracking rectangles. * Source/GSToolTips.m (GSTTProvider): Remove view rectangles from GSTTProvider class. They are no longer used. 2012-10-04 Wolfgang Lux Improve keyboard navigation by automatically computing a key view loop for a window (and tab view item). This implicit key view is created when a window is made key and does not have an explicit key view loop, which is detected by checking the initial first responder of the window. * Source/NSViewPrivate.h: New header declaring auxiliary key view loop methods. * Source/NSWindow.m (-becomeKeyWindow, -recalculateKeyViewLoop): * Source/NSView.m (-_setUpKeyViewLooopWithNextKeyView:, -_recursiveSetUpKeyViewLoopWithNextKeyView:, -_viewWillMoveToWindow:, cmpFrame()): * Source/NSControl.m (-_setUpKeyViewLoopWithNextKeyView:): * Source/NSTabView.m (-dealloc, -selectTabViewItem:, -setNextKeyView:, _setUpKeyViewLoopWithNextKeyView:): Implement code to automatically recalculate the key view loop of a window. * Headers/AppKit/NSTabView.h: Add new member to maintain the original next key view of a tab view. 2012-10-04 Wolfgang Lux * Source/NSClipView.m (-setDocumentView:, -setNextKeyView:): Adjust key view loop when adding a new document view. 2012-10-03 Wolfgang Lux * Source/NSWindow.m (titleWithRepresentedFilename, -_hasTitleWithRepresentedFilename, -setTitleWithRepresentedFilename, -orderWindow:relativeTo:, -setExcludedFromWindowsMenu:): * Source/NSApplication.m (-updateWindowsItem:, -setWindowsMenu:): Abbreviate home directory in window titles. 2012-09-21 Wolfgang Lux * Source/NSCursor.m (+initialize, +pop, -push, -set): Fix memory management for cursors. In particular prevent the current cursor from being deallocated when client code releases the last reference to it. 2012-09-21 Wolfgang Lux * Source/NSApplication.m (-targetForAction:, _targetForAction:window:, _targetForAction:keyWindow:mainWindow:): Make sure actions can be sent to the dialog window of a modal session even if another panel (with worksWhenModal=YES) is key window. 2012-09-13 German A. Arias * Source/GSToolTips.m (-_endDisplay): Set NSZeroRect as frame before order out the tooltip window. This prevents ugly rectangles in some desktops. * Source/GSDragView.m (-_clearupWindow): Set NSZeroRect as frame before order out the GSRawWindow. This prevents ugly rectangles in some desktops. 2012-09-13 German A. Arias * Source/NSCursor.m (-set): Set an standard cursor image (GSArrowCursor) if there is no image available. 2012-09-11 00:08-EDT Gregory John Casamento Merged from the TestPlant brach. Changes by Marcian Llytwyn * Headers/AppKit/NSTableView.h: Add _isValidating * Source/NSCell.m (+initialize): Expose title binding. * Source/NSOpenPanel.m (-runModal): Use _directory if it is set. * Source/NSTableView.m (-validateEditing): Check _isValidating to prevent recursive calls into validateEditing. * Source/NSTabView.m (-initWithCoder:): Set _selected_item to NSNotFound. * Source/NSView.m (-addSubview:): Do not throw an exception when adding a nil subview, just ignore it. This matches behavior on Cocoa. 2012-09-04 Wolfgang Lux * Source/NSSavePanel.m (-ok:): Restore ability to create nested directories, which was removed without reason during the last change of NSSavePanel. 2012-09-03 22:35-EDT Gregory John Casamento * Source/GSXibLoader.m: Remove test code. 2012-09-03 21:37-EDT Gregory John Casamento * Source/GSXibLoader.m: Changes by Marcian Lyttwyn to correct issue with when a xib contains an array instead of a dictionary in flattenedProperties. Changes by myself to implement custom class cell support so that the cell class changes along with the control class when unarchiving. 2012-09-03 Wolfgang Lux * Source/NSWindow.m (_screenForFrame:): Fix bug where this method was returning nil when the frame had zero width or height. This could destroy a valid screen attribute of a window. 2012-09-02 German A. Arias * Source/GSToolTips.m (_timedOut:): Don't display the tooltip window (GSTTPanel) if the tooltip is nil or is an empty string. 2012-09-02 13:56-EDT Gregory John Casamento * Source/GSXibLoader.m: Correct issue with reuse of enumerator. 2012-08-31 16:33-EDT Gregory John Casamento * Source/GSXibLoader.m: Cover case where there are no changes. 2012-08-31 15:01-EDT Gregory John Casamento Original changes by Marcian Lytwyn merged from gnustep_testplant_branch. * Headers/AppKit/NSSavePanel.h * Source/NSSavePanel.m: Added implementation for directory method from 10.6. 2012-08-31 12:09-EDT Gregory John Casamento * Source/GSXibLoader.m: Add _preProcessXib: method to perform custom class substitutions when loading a XIB file. * Source/GSXibLoading.m: Add stub classes for IBNSLayoutConstraint and IBNSLayoutConstant so that these can now be loaded. 2012-08-27 11:44-EDT Gregory John Casamento * Headers/AppKit/NSTabViewItem.h: Add _toolTip ivar. * Source/NSTabViewItem.m: Add setToolTip:/toolTip methods. These methods were added in 10.6. 2012-08-17 Fred Kiefer Merged changes from gnustep_testplant_branch branch. * Source/NSImage.m (-initWithCoder:): Adopt to coding standard. * Source/NSScreen.m (-description): Simplify code. * Source/NSWindow.m (-screen): Only recompute the screen if the frame isn't fully covered by the current screen. * Headers/AppKit/NSFontPanel.h: Import NSTextField to have the NSTextFieldDelegate protocol defined. * Headers/AppKit/NSControl.h: remove the three now duplicated methods from NSControlTextEditingDelegate. 2012-08-14 Marcian Lytwyn * Source/NSImage.m (-initWithCoder:): Fix bug in last commit. * Source/NSWindow.m (- 2012-06-28 Marcian Lytwyn * ColorPickers/GSNamedColorPicker.m GSNamedColorPicker needs to conform to NSTtextFieldDelegate * ColorPickers/GSStandardColorPicker.h GSStandardCSColorPicker needs to conform to NSTextFieldDelegate 2012-06-27 Marcian Lytwyn * Source/NSWindow.m - Fix [NSWindow screen] method according to documented behavior (return screen that window show up the most or nil). Fix [NSWindow setFrameFromString] to account for possible nil screen on input frame and throw window on main screen in this case. This is to fix an issue with windows not properly showing up when moved to another monitor during multi-monitor usage and then the extra monitor(s) are removed. * Source/NSScreen.m - Added -description method for more information. 2012-06-27 Marcian Lytwyn *** NSOpenSavePanelDelegate *** * Headers/AppKit/NSSavePanel.h - Added NSOpenSavePanelDelegate protocol definition * Source/NSSavePanel.m - Qualify delegate method(s) with id *** NSControlTextEditingDelegate *** * Headers/AppKit/NSControl.h - Added NSControlTextEditingDelegate protocol definition * Headers/AppKit/NSTextField.h - Added NSTextFieldDelegate protocol definition * Source/NSTextField.m - Qualify delegate method(s) with id * Headers/AppKit/NSFontPanel.h - NSFontPanel assigns itself as a delegate to a NSTextField object and must declare that it conforms to NSTextFieldDelegate protocol. Added a forward declaration for NSTextFieldDelegate and added NSTextFieldDelegate on class interface definition. 2012-08-10 Richard Frith-Macdonald * Source/NSColorList.m: * Source/NSSavePanel.m: * Source/NSFileWrapper.m: * Source/NSDocumentController.m: * Tools/GSspell.m: Use new method for creating intermediate directories rater than depending on incorrect behavior of the old method. 2012-08-07 Fred Kiefer * TextConverters/RTF/RTFProducer.m (-_addAttributesString:): Correctly handle NSUnderlineStyleNone. This fixes bug #37043. * Headers/AppKit/NSOpenGL.h, * Source/NSOpenGLContext.m: New 10.6 methods to get/set the CGLContextObj. 2012-08-06 Riccardo Mottola * Source/GSServicesManager.m Do not call openFile: if only one file is supplied, as noted in 10.3 release notes. (Thanks to Wolfgang for looking it up) 2012-08-06 Riccardo Mottola * Source/NSApplication.m * Source/GSServicesManager.m Implement openFiles: delegate 2012-07-31 Wolfgang Lux * Source/NSTextView_actions.m (-yank:): Don't call -insertText: at all when the kill buffer is empty. 2012-07-31 Wolfgang Lux * Source/NSApplication.m (-run): Also catch and eventually handle exceptions that are thrown in code executed by the run loop itself. 2012-07-31 Wolfgang Lux * Source/GSHorizontalTypesetter.m (-layoutGlyphsInLayoutManager:...): Rethrow exception which isn't handled (and possibly can't be handled in any reasonable way). 2012-07-24 06:30-EDT Gregory John Casamento * Source/NSImage.m: -[NSImage initWithCoder:] an extension to the previous change. If the URL doesn't load then try to load the image in the NSURL as a "named" image in resources so that the developer of the app has a way to provide this image. 2012-07-20 14:06-EDT Gregory John Casamento * Source/NSImage.m: -[NSImage initWithCoder:] Some XIB files have image representations encoded via NSURL. When this happens it causes the XIB not to be loaded at all since the image rep fails to load and causes the xib loading process to fail. 2012-07-05 Quentin Mathe * Headers/AppKit/NSNibDeclarations.h: Fixed recent Clang warnings when compiling applications about IBOutlet and IBAction being already defined. 2012-06-29 Fred Kiefer * Source/NSWorkspace.m (-_openUnknown:): New method that starts an operation system specific application for files or URL that could not be handled by GNUstep applications. Based on patch by Julian Mayer . * Source/NSWorkspace.m (-openFile:withApplication:andDeactivate:, -openTempFile:, -openURL:): Use this new method. * Documentation/GuiUser/DefaultsSummary.gsdoc: Document the new setting GSUnknownFileTool that allows to define a default application. 2012-06-23 Fred Kiefer * Source/NSFontDescriptor.m: Small consistency updates. 2012-06-15 German A. Arias * Source/GSWindowDecorationView.m (-changeWindowHeight:): Revert last change while found the real problem. 2012-06-13 Eric Wasylishen * Source/NSSplitView.m (adjustSubviews): Use centerScanRect to give subviews pixel-aligned frames. 2012-06-07 German A. Arias * Source/GSToolTips.m (_timedOut:): Use the font size specified in user defaults. 2012-06-07 German A. Arias * Source/GSWindowDecorationView.m (-changeWindowHeight:): Use an intermediate frame before call -layout. This fix bugs #36419 and #36586. 2012-06-05 Wolfgang Lux * Tests/gui/TextSystem/deallocation.m: Add new test to verify proper deallocation of text network elements. 2012-06-05 Wolfgang Lux * Source/GSLayoutManager.m (-dealloc): Set layout manager of every text container to nil to avoid dangling pointer in case the text container is retained elsewhere. * Source/NSTextStorage.m (-dealloc): Set text storage of every layout manager to nil to avoid dangling pointer in case the layout manager is retained elsewhere. 2012-06-03 Wolfgang Lux * Source/NSTextView.m (-performUndo): Update text storage directly when undoing text changes. 2012-06-03 Wolfgang Lux * Tools/GSspell.m (-spellerForLanguage:): Force aspell to return suggested words with UTF-8 encoding. 2012-05-21 Marcian Lytwyn * Source/GSXibLoader.m: Added NSMenu (XibCompatibility) category with method: _isMainMenu Added NSMenu (XibCompatibility) category implementation. Modified setting main menu in awake:inContainer:withContext: Fixes bug #36427 Committed by: gcasa 2012-05-07 Fred Kiefer * Headers/AppKit/NSInterfaceStyle.h: Remove GSNativeInterfaceStyle. * Source/NSComboBoxCell.m (-encodeWithCoder:, -initWithCoder:): Add a few more keyed coding values. Fixes bug #36426. 2012-05-05 Fred Kiefer * Source/GSXibLoader.m: Add some (currently unused) helper code for class substitution in flattenedProperties. 2012-04-24 Fred Kiefer * Source/NSPasteboard.m (NSURL-writeToPasteboard:): Revert the last change. * Source/NSWorkspace.m (-openURL:): Declare the URL pasteboard type here. Change suggested by Wolfgang Lux . 2012-04-24 Fred Kiefer * Source/NSPasteboard.m (NSURL-writeToPasteboard:): Declare the type. Patch by Andreas Schik . 2012-04-19 Riccardo Mottola * configure * configure.ac libpng-config: get I_opts and not the whole cflags, which break debug builds 2012-04-10 Fred Kiefer * Source/NSTabView.m (+initialize): Increase version number. * Source/NSTabView.m (-encodeWithCoder:, -decodeWithCoder:): Clean up last patch. 2012-04-10 Sebastian Reitenbach * Source/NSTabView.m * Headers/AppKit/NSTabView.h some int/NSInteger to NSUInteger changes to better match return values of methods 2012-04-06 12:26 theraven * libs/gui/trunk/Headers/AppKit/NSColorWell.h, libs/gui/trunk/Headers/AppKit/NSPrinter.h, libs/gui/trunk/Headers/AppKit/PSOperators.h: Add explicit return types to a couple of methods and __attribute__((unused)) to some functions with empty bodies so people don't get compiler warnings from importing AppKit.h 2012-04-02 Fred Kiefer * Source/NSMenuItem.m (GSMenuSeparator -classForCoder): Add missing method to get separator coding correct. 2012-03-28 Fred Kiefer * Tests/gui/NSSavePanel/setDelegate_reload.m, * Tests/gui/NSView/NSView_autoresize_and_rounding.m, * Tests/gui/NSView/NSView_bounds_scale.m, * Tests/gui/NSView/NSView_visibleRect.m: Mark all failing tests as dashed hopes to prepare for Jenkins. 2012-03-27 Eric Wasylishen * Source/NSCell.m (_updateFieldEditor:): Fix what I presume is a typo. The "if (nil == _contents) { contents = @""; }" blocks were dead code because the contents variable would later be set to nil if _contents was nil. This was causing an exception when starting editing an empty text field loaded from a xib. 2012-03-26 Eric Wasylishen * Headers/AppKit/NSSplitView.h: * Source/NSSplitView.m: Add support for splitView:shouldAdjustSizeOfSubview: delegate method. 2012-03-26 Eric Wasylishen * Images: Add NSAddTemplate.tiff * Images/GNUmakefile: Update 2012-03-26 Eric Wasylishen * Source/GSToolTips.m (-mouseEntered:): When calling the owner's view:stringForToolTip:point:userData: method, make the point relative to the view's coordinate system (tested on OS X) instead of relative to the tracking rect (as before.) * Source/GSToolTips.m (-_timedOut:): Fix a crash caused by invalidating the timer and then using its userInfo object. 2012-03-22 Eric Wasylishen * Source/NSAttributedString.m (-initWithData:options:documentAttributes:error:): Set NSCharacterEncodingDocumentAttribute in the documentAttributes dict when reading plain text. 2012-03-22 Eric Wasylishen * TextConverters/RTF/RTFConsumer.m: Set NSDocumentTypeDocumentAttribute 2012-03-22 Eric Wasylishen * Source/NSAttributedString.m (-initWithData:options:documentAttributes:error:): Fixes for TextEdit. If no type is provided, assume plain text. If no encoding is provided, assume UTF-8 unless a UTF-16 BOM is detected. 2012-03-22 Eric Wasylishen * Source/GSThemeDrawing.m (-toolbarBorderColor): Change default to [NSColor darkGrayColor] * Source/NSToolbar.m (-initWithIdentifier:): Call [self setShowsBaselineSeparator: YES] by default so the toolbar has a bottom border. 2012-03-12 Fred Kiefer * Headers/AppKit/NSKeyValueBinding.h, * Source/externs.m: Additional binding names. * Source/GSBindingHelpers.h, * Source/NSKeyValueBinding.m: Additional helper methods. * Source/NSObjectController.m: Use helper methods. * Source/NSArrayController.m: Signal when the arranged objects change. * Source/NSTableColumn.m, * Source/NSTableView.m: First attempt at support for content binding. 2012-03-09 Eric Wasylishen * Source/NSTableView.m: * Source/GSNibLoading.m: Move -[coder setClassName: @"_NSCornerView" forClass: [GSTableCornerView class]] call from -[NSTableView initWithCoder:] to GSNibLoading, because corner views can be encountered before hitting -[NSTableView initWithCoder:] 2012-03-09 Eric Wasylishen * Source/NSClipView.m: Re-enable copy-on-scroll 2012-03-09 Eric Wasylishen * Source/NSWindow.m: Only invoke -prepareForDragOperation: if the most recent -draggingEntered: or -draggingUpdated: call returned something other than NSDragOperationNone. * Source/NSOutlineView.m (-draggingUpdated:): Save the drag operation value returned from the data source in a static variable. Previously it was fetched once and then discarded, so all drags were being mistakenly permitted. 2012-03-08 Fred Kiefer * Source/NSObjectController.m: Complete encoding/decoding methods. * Headers/AppKit/NSArrayController.h, * Source/NSArrayController.m: Add some implementation to this class. 2012-03-05 Eric Wasylishen * Source/NSMenuItemCell.m (-titleRectForBounds:): Attempted fix for bug 35702. Don't use [_menuView imageAndTitleWidth] or _titleWidth in calculating the size to put the title in. In other words, -titleRectForBounds: will now return the available space for the title, rather than the rect that the title text is predicted to use up. 2012-02-29 10:31-EST Gregory John Casamento * Headers/AppKit/NSTreeController.h * Headers/AppKit/NSTreeNode.h * Source/NSTreeController.m: Add tree controller skeleton. 2012-02-29 10:25-EST Gregory John Casamento * Source/GNUmakefile: Add GSXibLoading.m file to GNUmakefile. * Source/GSXibLoading.m: Add some classes which I found are relevant to Xib loading: IBAccessibilityAttribute, IBUserDefinedRuntimeAttributesPlaceholder. 2012-02-28 Eric Wasylishen * Source/NSPrintPanel.m: Add file type chooser (PDF, PostScript) to save panel 2012-02-27 Eric Wasylishen * Source/NSMenuItemCell.m (-titleRectForBounds:): Keep title rect inside cell bounds, to prevent drawing text outside of a NSPopUpButtonCell which has a label that is too long to fit. 2012-02-27 Fred Kiefer * Source/NSWindowController.m (-initWithWindow:): Set the owner to self and only call setDocument: if we have an actual window. 2012-02-24 Eric Wasylishen * Headers/AppKit/NSImageRep.h: Add comment clarifying that -draw is a primitive method which subclasses should override. 2012-02-20 Fred Kiefer * Source/NSWindow.m (-setFrameFromString:): Correct bug in handling of in-window menus. 2012-02-19 Wolfgang Lux * Source/NSOpenPanel.m (-beginSheetForDirectory:..., -beginForDirectory:...): Replace calls to -_setupForTypes: by -setAllowedFileTypes:, as the former was removed from the super class NSSavePanel. 2012-02-19 Wolfgang Lux * Source/NSMenu.m (-performActionForItemAtIndex:): Revert change from r34642. The action of a pop up menu item once again is chosen in preference to the action of the pop up button itself. This is how it has always worked on OS X. * Source/NSPopUpButtonCell.m (_popUpItemAction): Fix sender of the pop up button's action. It is now the pop up button itself and not the pop up button cell. 2012-02-18 Fred Kiefer * Headers/AppKit/NSGraphicsContext.h: Extend the enumerator NSCompositingOperation with the GNUstep specifc value GSCompositeHighlight. * Source/Functions.m (NSHighlightRect): Use GSCompositeHighlight instead of NSCompositeHighlight. 2012-02-16 Eric Wasylishen * Headers/AppKit/NSGraphics.h: Add missing declaration for NSFrameRectWithWidthUsingOperation 2012-02-15 Fred Kiefer * Source/NSBitmapImageRep.m (-_convertToFormatBitsPerSample:...bitsPerPixel:): Correct handling of black data. 2012-02-08 Richard Frith-Macdonald * Source/NSPasteboard.m: Use an NSMapTable to store pasteboards so we don't have to do the nasty retain count hack to deallocate them. Fix encoding so that filter meta-pasteboards are sent to gpbs by reference rather than bycopy. Add special proxy to avoid data objects being copied to/from pasteboard server when created by filters. * Tools/make_services.m: Fix buggy initialisation of 'verbose' setting. Add check/warning if filter service has non-filename send types. 2012-02-08 Fred Kiefer * Source/NSPasteboard.m (+pasteboardByFilteringFile:): Correct typo in Richard's change. * Source/NSPasteboard.m (-pasteboard:provideDataForType:): Use the file name directly instead of reading the file contents. * Source/NSImageRep.m (+imageRepsWithContentsOfFile:, +imageFileTypes): Start working on filter service support for images. 2012-02-08 Richard Frith-Macdonald * Source/NSPasteboard.m: ([+pasteboardByFilteringFile:]) fixed to specify source as file names, not file contents. 2012-02-03 Adam Fedor * Bump version 2012-02-03 Eric Wasylishen * Headers/AppKit/NSOutlineView.h: * Source/NSOutlineView.m: Add support for outlineView:dataCellForTableColumn:item: delegate method * Headers/AppKit/NSTableView.h: * Source/NSTableView.m: Add support for tableView:dataCellForTableColumn:row: delegate method 2012-02-03 Adam Fedor * Version 0.22.0 * Update release notes 2012-02-01 Riccardo Mottola * Source/GSThemePanel: centerScanRect button to avoid blurring 2012-02-01 Fred Kiefer * Source/GSThemeInspector.m: Add missing include. 2012-02-01 Fred Kiefer * Source/NSBitmapImageRep.m (-initWithFocusedViewRect:): Return nil if the image data is empty. This could lead to an exception alter on. * Source/NSImage.m (-TIFFRepresentationUsingCompression:factor:, -TIFFRepresentation): Deal with -initWithFocusedViewRect: returning nil. 2012-02-01 Fred Kiefer * Source/NSMenu.m (-setMain:): Rearrange code to avoid duplicate menu for in-window menu themes. 2012-02-01 Fred Kiefer * Source/GSThemeInspector.m (-update:): Don't get the frame from a non-existing view. 2012-01-30 Eric Wasylishen * Source/NSImageCell.m (-drawInteriorWithFrame:inView:): Only draw at 50% opacity if no bezel is set for cocoa compatibility. 2012-01-30 Eric Wasylishen * Images/common_ToolbarClippedItemsMark.tiff: Revert to older version because 48x48 scaled version looks too big. Also add high-DPI version. 2012-01-30 Eric Wasylishen * Source/GNUmakefile: Remove GSGhostscriptImageRep from the build * Source/NSImageRep.m: Remove GSGhostscriptImageRep * configure.ac: Disable ImageMagic by default * configure: Regenerate 2012-01-28 Fred Kiefer * Source/NSMenu.m (-setMain:): Remove the in-window menu when switching to a theme without that. 2012-01-27 Fred Kiefer * Images/common_ToolbarClippedItemsMark.tiff: Revert to an older version, scaled up to 48x48. 2012-01-26 Fred Kiefer * Source/NSMenu.m (-performActionForItemAtIndex:): Check for the popup button cell and its action, before checking for the item action. This caused a problem due to NIB decoding changes. 2012-01-26 Fred Kiefer * Source/NSTextView.m (-updateRuler): Replace last change with one that checks whether the text view is the client view of the ruler and only sets the markers in that case. 2012-01-25 Doug Simons * Source/NSTextView.m (-updateRuler): Call setClientView: before calling setMarkers: to fix a problem when a textView's text is set or changed when the textView is not the first responder, such as at windowControllerDidLoadNib: time. 2012-01-25 Eric Wasylishen * Source/NSImage.m (+imageNamed:): Don't try to look up path if called with nil (just return nil). 2012-01-25 Eric Wasylishen * Source/NSClipView.m: Disable copy-on-scroll until after release 2012-01-25 Eric Wasylishen * Source/NSClipView.m (-constrainScrollPoint:): Revert last change until after the release. 2012-01-24 Fred Kiefer * Source/NSSecureTextField.m: Add GSSimpleSecureGlyphGenerator and use this to generate the bullet glyphs. 2012-01-23 Eric Wasylishen * Source/NSClipView.m (-constrainScrollPoint:): Restore old code which correctly rounded the scroll point to an integer point in device-space. It seems the correct code was commented out in 2002, perhaps as a performance optimisation? 2012-01-23 Fred Kiefer * Source/NSToolbarFrameworkPrivate.h, * Headers/AppKit/NSMatrix.h: Remove duplicated method declarations. * TextConverters/RTF/RTFProducer.h: Change docDict to NSDictionary. * Source/GSTheme.m, * Source/GSWindowDecorationView.m: Add missing type cast. * Headers/AppKit/NSCell.h, * Source/NSCell.m, * Source/NSButtonCell.m: Change _contents to id. * Source/GSNibLoading.m: Add missing import. * Source/NSPasteboard.m: Declare release as oneway. * Source/GSNibLoader.m: Change class to NSKeyedUnarchiver. * Source/GSXibLoader.m: Use correct printf type specifier. * Headers/AppKit/NSBitmapImageRep.h, * Source/NSBitmapImageRep.m: Change _imageData to NSData. Fix clang compiler warnings as reported by Sebastian Reitenbach . 2012-01-21 Eric Wasylishen * Source/NSView.m (-setBounds:, -setBoundsOrigin:, -setBoundsSize:): Revert a portion of r32955 which I committed last april but I now see was a mistake, and I just discovered is breaking the copy-on-scroll behaviour of NSClipView - we end up always redrawing the entire visible portion of the document view right now. In r32955 I added [self setNeedsDisplay: YES] calls to these methods even though these are documented explicitly as not marking the view for needing display. Approved by Fred for commit during the code freeze. 2012-01-20 German Arias * Source/GSInfoPanel.m (-initWithDictionary:): Fix bug #35335. 2012-01-19 Fred Kiefer * Source/NSCell.m (-setStringValue:, setObjectValue:): Always use ASSIGNCOPY for the contents. This fixes memory leak of last commit. 2012-01-19 Riccardo Mottola *Source/NSCell.m: Add missing autoreleases. 2012-01-19 Riccardo Mottola *Source/NSCell.m: Copy contents before setting it [setObjectValue] 2012-01-18 Fred Kiefer * Headers/AppKit/NSImageView.h, * Source/NSImageView.m: Protect image drag with new ivar that gets set via a new GNUstep extension method. 2012-01-15 Eric Wasylishen * Source/NSImageCell.m (-drawInteriorWithFrame:inView:): Draw image with 50% opacity if the cell is disabled 2012-01-15 Eric Wasylishen * Source/NSTableColumn.m (-initWithIdentifier:): Make data cell editable by default. 2011-01-14 Richard Frith-Macdonald * Source/GSTheme.m: * Source/NSImage.m: Attempt to get image support working as documented again ... restore code in GSTheme to set up new named images on activation and restore originals on deactivation (rather than doing everything in a notification handler at the wrong point). Honor +imageClass as the class to load new images again. Hopefully this will get the windows and gnome themes working again (though I dn't use either). 2011-01-14 Richard Frith-Macdonald * Source/GSTheme.m: Clean up and simplify theme switching based on defaults system values. 2012-01-12 Fred Kiefer * Source/GSStandardWindowDecorationView.m (-mouseDown:): Pass the event on to the super implementation if we don't handle it. 2012-01-11 Fred Kiefer * Source/NSImage.m (+_clearFileTypeCaches): Use DESTROY instead of RELEASE. Patch by Philippe Roussel . 2012-01-10 Eric Wasylishen * Source/NSImage.m: Remove duplicate #import * Source/NSImage.m: Correct _clearFileTypeCaches notification method to take a NSNotification* parameter. * Soure/NSImage.m (themeDidActivate:): Move to a class method, and move the GSThemeDidActivateNotification subscription to +[NSImage initialize]. Now the +_themeDidActivate: updates all images by looking at all the values in nameDict. This should function exactly the same as before, but seems to be quite a bit faster due to fewer notifications being sent (?) * Source/NSImage.m (+imageNamed:): Remove redundant fetch from nameDict pointed out by Fred 2012-01-10 Eric Wasylishen * Source/NSImage.m (+pathForImageNamed:): Add underscore and move to private category. Also remove use of lock as it is unnecessary * Source/NSImage.m: (-themeDidActivate:): Extract method _resetAndUseFromFile:. Don't reset _size if flags.sizeWasExplicitlySet was true. 2012-01-10 Eric Wasylishen * Source/NSOpenPanel.m: Rewrite/simplify selection handling, fix bug reported by Riccardo where OK button is disabled when selecting directories after selecting a file. 2012-01-10 Eric Wasylishen * Source/GSGhostscriptImageRep.m: Add missing ASSIGN 2012-01-09 Eric Wasylishen * Source/GSTheme.m: Remove code which sets and unsets images on theme activation/deactivation. * Source/NSImage.m (+imageNamed:): Factor out code for finding the path for a name to a separate method, +pathForImageNamed. The code is unchanged otherwise, except for fixing the retrieval of images from the theme bundle, which was broken. * Source/NSImage.m (-setName:): Remove code for creating theme proxy. Subscribe/unscribe to theme change notification when the receiver is added/removed from the name dictionary. * Source/NSImage.m (-themeDidActivate:): Method called in response to a GSThemeDidActivateNotification on images with a name set. It does a path lookup in the same way that +imageNamed: would, and checks if the path has changed due to the theme change. If it has, all reps are discarded and the image at the new path is loaded. This avoids the need for the theme proxy objects. 2012-01-09 Fred Kiefer * Source/NSImage.m (+imageUnfilteredFileTypes, +imageFileTypes, +imageUnfilteredPasteboardTypes, +imagePasteboardTypes, +initialize, +_clearFileTypeCaches): Cache the file type results for the image reps and clear the cache when these change. 2012-01-03 Fred Kiefer * Source/NSPrinter.m (-loadPPDAtPath:...inclusionSet:): Raise an exception if PPD file cannot be read. 2012-01-01 Wolfgang Lux * Source/NSLayoutManager.m (-characterIndexMoving:...): Fix two incorrect comparisons which were causing range exceptions when moving the cursor up in the first line and down in the last line of a NSTextView, respectively. 2011-12-31 Eric Wasylishen * Source/NSPrintOperation.m (_print): Fix read of uninitialized variable, which was breaking printing of wrap-to-page mode in TextEdit. TODO: Run the printing code through valgrind, there is a lot of suspicious code. 2011-12-29 Wolfgang Lux * Source/NSTextView.m(-initWithFrame:textContainer:, -setFieldEditor:): Change the default text container inset to (0,0) to reduce blank space around text. 2011-12-29 Wolfgang Lux * Source/NSLayoutManager.m (-_insertionPointRectFor..., -insertionPintRect...): Get the insertion point rectangle right for character index 0. 2011-12-29 Wolfgang Lux * Source/NSTextView.m (-resizeSubviewsWithOldSize:): Adjust minimum and maximum sizes to ensure that the minimum size is not greater than the current size and the maximum size is not smaller than the current size. 2011-12-27 German Arias * Resources/Spanish.lproj/Localizable.strings: Update. 2011-12-22 Fred Kiefer * Source/NSTextView.m (-setFieldEditor:): Use different values for both cases. 2011-12-22 Eric Wasylishen * Source/NSSavePanel.m (-browser:createRowsForColumn:inMatrix:): Set icon size based on cell's cellSize 2011-12-22 Fred Kiefer * Source/NSPrintOperation.m (-_print): Remove unused variable. * Source/GSLayoutManager.m (-_generateRunsToCharacter:): Remove unused variable. * Source/NSToolbar.m (-initWithCoder:): Don't call non-exisiting super method. * Source/GSNibLoading.m (-nibInstantiate): Add type cast for toolbar. * TextConverters/RTF/RTFProducer.m (-_addAttributesString:): Use destString instead of dest when writing the NSLinkAttributeName. 2011-12-20 Eric Wasylishen * Source/NSBrowserCell.m (-drawInteriorWithFrame:inView:): Restore code to draw the background when the cell is highligted 2011-12-18 Eric Wasylishen * Source/NSSavePanel.m (-browser:createRowsForColumn:inMatrix:): Set file icons on browser cells in the open/save panels. 2011-12-18 Eric Wasylishen * Source/NSBrowserCell.m (-drawInteriorWithFrame:inView:): When highlighted, use -image if -alternateImage is nil. 2011-12-18 Eric Wasylishen * Source/NSTableView.m (-_isCellEditableColumn:row:): Tweak criteria for determining cell editability:: - the delegate (if present) must say YES - and the cell itself must return YES for isEditable - and the table column must return YES for isEditable Previously you could edit cells that returned NO for isEditable if the column they were in was editable. 2011-12-18 Eric Wasylishen * Source/NSTableHeaderView.m (-initWithCoder:): Remove unneeded "_tableView = nil" which was causing a problem with my xib file. 2011-12-18 Eric Wasylishen * Source/NSBrowserCell.m (-image, -setImage:): Override NSCell implementation so these methods work without requiring the cell to be an image cell. * Source/NSBrowserCell.m (-drawInteriorWithFrame:inView:): Don't draw background. Remove -(void) isOpaque { return YES; }. Also pixel-align images and use modern -drawInRect: method. 2011-12-18 Fred Kiefer * Source/NSOutlineView.m (-_openItem:): Changed i fron NSUInteger to NSInteger. 2011-12-17 Fred Kiefer * Headers/AppKit/NSSliderCell.h * Headers/AppKit/NSLevelIndicator.h * Headers/AppKit/NSButtonCell.h * Headers/AppKit/NSButton.h * Headers/AppKit/NSMenuItem.h * Headers/AppKit/NSLevelIndicatorCell.h * Headers/AppKit/NSSlider.h * Headers/AppKit/NSTabView.h * Headers/AppKit/NSCell.h * Headers/AppKit/NSDrawer.h * Source/NSSliderCell.m * Source/NSLevelIndicator.m * Source/NSButtonCell.m * Source/NSButton.m * Source/NSMenu.m * Source/NSMenuItem.m * Source/NSLevelIndicatorCell.m * Source/NSComboBoxCell.m * Source/NSToolbarItem.m * Source/NSSlider.m * Source/NSTabView.m * Source/NSCell.m * Source/NSWindow.m * Source/NSDocumentController.m * Source/NSTableView.m * Source/NSOutlineView.m * Source/NSParagraphStyle.m * Source/NSPopUpButtonCell.m * Source/NSView.m * Source/NSDrawer.m * Source/GSNibLoading.m * Source/GSXibLoader.m * Source/GSToolbarView.m * Source/GSTheme.m * Source/GSThemeDrawing.m * ColorPickers/GSNamedColorPicker.m: Replace some occurences of int with NSInteger and unsigned with NSUInteger. This allows to recompile gui on 64 bit systems after the change to NSNotFound in base. 2011-12-16 Riccardo Mottola * Panels/English.lproj/GSPrintPanel.gorm Tweaked positions and removed fractionary ones. 2011-12-15 Eric Wasylishen * Headers/AppKit/NSTextView.h: Change _dragTargetLocation to NSUInteger because NSNotFound no longer fits in unsigned int on 64-bit 2011-12-15 Eric Wasylishen * Source/NSPrintPanel.m: Move _finalWritePrintInfo: call to the end of _pickedButton:. This fixes the save and preview buttons for me. 2011-12-14 Eric Wasylishen * Source/NSPrinter.m: * Source/NSPrintOperation.m: * Source/NSPageLayout.m: * Source/NSPrintInfo.m: * Headers/AppKit/NSPrintInfo.h: Migrate printing code to CGFloat or double. * Source/NSTextView.m: Rewrite -adjustPageHeightNew:top:bottom:limit: 2011-12-14 Eric Wasylishen * Source/NSImageCell.m: if drawing on a view use -centerScanRect: to pixel align the drawing rect. 2011-12-02 German Arias * Source/NSAlert.m (-_setupPanel): Verify if there is error information to be displayed. 2011-12-02 Wolfgang Lux * Source/NSTextView.m (-buildUpTextNetwork:): * Source/NSTextContainer.m (-initWithContainerSize): * Source/NSStringDrawing.m (init_string_drawing): Reinstate Fred's change with the additional correction to the string drawing code he proposed on the mailing list. 2011-12-01 Eric Wasylishen * Source/NSTextView.m (-_scheduleTextCheckingInVisibleRectIfNeeded): Check for nil before sending -rectValue to avoid crash 2011-11-28 Gregory Casamento * Source/NSTextView.m (-buildUpTextNetwork:): * Source/NSTextContainer.m (-initWithContainerSize:): revert previous change by Fred since it was causing labels and textfields to also be shifted which is not correct. 2011-11-28 Fred Kiefer * Source/NSPopUpButtonCell.m (-initWithCoder:): If no selection index is given select the first item. This should fix bug #34923. 2011-11-28 Fred Kiefer * Source/NSTextView.m (-buildUpTextNetwork:): Move setting the default line framgent padding from here ... * Source/NSTextContainer.m (-initWithContainerSize:): ... to here. 2011-11-28 Fred Kiefer * Source/NSOpenGLView.m (-_frameChanged:): Don't send -reshape before -prepareOpenGL. Patch by Julian Mayer . 2011-11-28 Fred Kiefer * Headers/AppKit/AppKit.h: Add NSColorSpace.h. This fixes bug #34913. 2011-11-28 Gregory Casamento * Source/NSTextView.m: Add code to set the default of 5.0 in the -buildUpTextNetwork method. * Source/NSTextContainer.m: In -lineFragmentForProposedRect:... add _lineFragmentPadding to min and subtract from max to shift the line fragment rectangle. * Source/NSLayoutManager.m: In -insertionPointRectForCharacterIndex:.. add the padding to the initial position of the insertion point so that before there is anything in the text container, the cursor is sitting at the correct position. 2011-11-25 20:27 theraven * libs/gui/trunk/Headers/AppKit/NSApplication.h: NSAutoreleasePool* -> id in NSApplication.h, so the header can be used in ARC code (which prohibits explicit references to NSAutoreleasePool). 2011-11-18 Eric Wasylishen * Images/nsmapping.strings: Add a few more mappings, including toolbar images 2011-11-18 Eric Wasylishen * Source/GSNibLoading.m: * Source/NSToolbar.m: * Source/GSToolbarCustomizationPalette.m: * Source/GSToolbarView.m: * Source/NSToolbarItem.m: * Source/NSToolbarFrameworkPrivate.h: * Headers/AppKit/NSToolbar.h: Implement -initWithCoder: for NSToolbar. This required a bit more work that usual because toolbars created with -initWithCoder can operate without a delegate. 2011-11-17 Riccardo Mottola * Source/NSButtonCell.m: Minor compiler compatibility. 2011-11-16 Quentin Mathe Improved the menu theming to support some common menu look variations. Fixed bug #34792 too. * Headers/Additions/GNUstepGUI/GSTheme.h * Source/GSThemeDrawing.m (-menuBackgroundColor, -menuItemBackgroundColor, -menuBorderColor -menuBorderColorForEdge:isHorizontal:, -drawsBorderForMenuItemCell:state:isHorizontal:, -drawTitleForMenuItemCell:withFrame:inView:state:isHorizontal:, -menuSeparatorInset): Added. (-menuBarBackgroundColor, -menuBarBorderColor): Added but not yet used. (-menuSeparatorColor): Renamed -menuSeparatorItemColor. * Source/NSMenuItemCell.m (-backgroundColor:): Changed to get the background color from -menuItemBackgroundColor. (-themeControlState): Added. (-drawTitleWithFrame:inView:): Moved drawing code to GSTheme. Made separator menu item themable, by moving the drawing code from NSMenuItemCell to a new method in GSThemeDrawing. 2011-11-13 Fred Kiefer * Source/NSImage.m (-bestRepresentationForDevice:): Fix last change for the case where there are no representations for the image. 2011-11-13 Fred Kiefer * Source/NSUserDefaultsController.m ([GSUserDefaultsHelper-valueForKey:]) Use a marker for values being nil. This should fix bug #34790. 2011-11-11 Eric Wasylishen * Source/NSImage.m (-bestRepresentationForDevice:): When all other matching criteria fail, use the first image instead of the last (arbitrary, but seems to match cocoa.) 2011-11-11 Eric Wasylishen * Source/NSAlert.m: Use NSImageScaleProportionallyUpOrDown on app icon button cell. 2011-11-11 Eric Wasylishen * Source/NSImage.m (-setScalesWhenResized:): Disable this method as it is currently broken on the cairo backend. * Source/NSApplication.m (-setApplicationIconImage:): Don't use call -setScalesWhenResized:, because if it worked as it is supposed to, it would scale all icon reps down to 48x48, making large icon sizes useless. 2011-11-11 Eric Wasylishen * Source/GSInfoPanel.m: Fix app icon button size at 48x48 and use NSImageScaleProportionallyUpOrDown. This prevents icons with large sizes (e.g. 512x512 pixel) from making the info panel really big. 2011-11-11 Eric Wasylishen * Headers/AppKit/NSImageCell.h: * Headers/AppKit/NSCell.h: Move NSImageScaling constants to NSCell * Source/NSImageCell.m: * Source/NSCell.m: Refactor the image scaling logic to a private method in NSCell, -_scaleImageWithSize:toFitInSize:scalingType: which can be share by NSImageCell, NSButtonCell, and any other cell classes that need it. * Source/NSButtonCell.m: * Headers/AppKit/NSButtonCell.h: Implement -imageScaling and -setImageScaling methods. * Source/GSThemeDrawing.m: * Headers/Additions/GNUstepGUI/GSTheme.h: Remove the -drawImage:inButtonCell:withFrame:position: API intended to let themes substitute images right before drawing, as IMHO it's the wrong place to hook in new images (by the time this method was caleld, sizing/positionging was already done). 2011-11-11 Fred Kiefer * Source/GSXibLoader.m: Better handling for flattened properties to set the tool tips of an object. 2011-11-07 Fred Kiefer * Source/NSKeyValueBinding.m ([GSKeyValueBinding-transformValue:withOptions:]): Don't use @"" when no null placeholder is defined. 2011-11-07 Fred Kiefer * Source/NSColorWell.m (-objectValue, -setObjectValue:, -takeObjectValueFrom:): Add these missing methods. 2011-11-06 Eric Wasylishen * Source/NSBitmapImageRep+PNG.m: HACK: PNG can not represent 72DPI exactly. If the pixels-per-meter value is near 72DPI, assume it is exactly 72 DPI. Note that the same problem occurrs at 144DPI, or 288DPI... so don't use PNG for resolution independent graphics. 2011-11-06 Fred Kiefer * Source/NSPopUpButtonCell.m (-insertItemWithTitle:atIndex:): Set the action on the menu item to -_popUpItemAction:. 2011-11-05 Fred Kiefer * Headers/Additions/GNUstepGUI/GSXibLoading.h, * Source/GSXibLoader.m: Add decoding of class IBInitialTabViewItemAttribute. 2011-11-04 Richard Frith-Macdonald * Source/GSInfoPanel.m: Tolerate 'Authors' being a string containing a single author as well as an array. 2011-11-03 Fred Kiefer * Source/NSTabView.m: Add some bindings for NSTabView. 2011-11-01 Eric Wasylishen * Source/NSColorPanel.m: Always send action and colorChanged: when the color changes. NSColorPanel is always "continuous" for now... to support -isContinuous == NO, we need to augment the API between the color panel and the pickers so they can send a message when the mouse is released. * Source/NSTextView.m: Change typing attributes in response to colorChanged: 2011-11-01 Eric Wasylishen * Source/NSView.m: centerScanRect patch from Sebastian Reitenbach. Note that this makes the NSView autoresizing and rounding test pass, but the new centerScanRect test I just added fail. 2011-11-01 Eric Wasylishen * Tests/gui/NSView/NSView_autoresize_and_rounding.m: Add centerScanRect test 2011-10-31 Fred Kiefer * Tests/gui/NSSavePanel/setDelegate_reload.m: Switch the save panel to not show hidden files and remove ".svn" from the expected results. This file was never present in an exported directory and will no longer exist with SVN 1.7. 2011-10-31 Fred Kiefer * Source/NSPopUpButtonCell.m (-_popUpItemAction:): Inform bindings of the control view that the value has changed. 2011-10-31 Fred Kiefer * Source/GSNibLoading.m ([NSNibConnector-nibInstantiate]): Add this method. * Source/GSXibLoader.m ([IBBindingConnection-nibInstantiate): Instantiate the connector. 2011-10-31 Fred Kiefer * Source/NSPopUpButton.m, * Source/NSMatrix.m, * Source/NSControl.m: Remove useless KVB code. 2011-10-31 Gregory Casamento * Source/NSTableColumn.m: (+initialize, -initWithCoder:, -encodeWithCoder:): Updated version to 3. Added encoding for sort descriptor in encodeWithCoder:, added decoding for version 3 to initWithCoder: 2011-10-28 Quentin Mathe * Headers/Additions/GNUstepGUI/GSTheme.h: * Source/GSTheme.m: * Source/GSThemeDrawing.m (-menuSeparatorItemColor, -drawSeparatorItemForMenuItemCell:withFrame:inView:isHorizontal:): * Source/NSMenuItemCell.m (-drawSeparatorItemWithFrame:inView:): Made separator menu item themable, by moving the drawing code from NSMenuItemCell to a new method in GSThemeDrawing. 2011-10-27 Fred Kiefer * Source/NSBitmapImageRep.m (+imageRepWithData:): Add missing AUTORELEASE. 2011-10-26 Eric Wasylishen * Source/NSCell.m: Read/write NSLineBreakMode from the bits masked off by 0xE00 in NSCellFlags2. The previous location they were being read/written from was giving bogus values such as 7. 2011-10-25 Eric Wasylishen * Source/GSThemeDrawing.m: Draw a question mark centered in the bezel for NSHelpButtonBezelStyle 2011-10-25 Eric Wasylishen * Source/NSBitmapImageRep.m: * Source/NSColor.m: * Source/GSThemeTools.m: * Source/NSGraphicsContext.m: * Headers/AppKit/NSColor.h: * Headers/AppKit/NSGraphicsContext.h: * ColorPickers/GSGrayColorPicker.m: * ColorPickers/GSCMYKColorPicker.m: * ColorPickers/GSWheelColorPicker.m: * ColorPickers/GSRGBColorPicker.m: * ColorPickers/GSHSBColorPicker.m: Migrate float to CGFloat in NSColor 2011-10-25 Fred Kiefer * Headers/Additions/GNUstepGUI/GSXibLoading.h, * Source/GSXibLoader.m: Integrate method used in Gorm. 2011-10-24 Fred Kiefer * Source/NSBox.m (-initWithCoder:): Rearrange order of keyed decoding. * Source/GSNibLoading.m: Warn about missing custom resources. * Headers/Additions/GNUstepGUI/GSXibLoading.h: Add class IBToolTipAttribute. * Source/GSXibLoader.m: Add decoding of type "boolean". Fix decoding of "real", "integer" and "dictionary". Add handling of flattenedProperties to determine which windows should be visible. Store all top level obejcts in array. 2011-10-17 Fred Kiefer * Source/GSXibLoader.m (-objectForXib:): Add type "real" and handle empty strings. 2011-10-15 Fred Kiefer * Source/NSScrollView.m (-encodeWithCoder:, -initWithCoder:): Correct keyed encoding and decoding of flags. NIB files created from GNUstep will need to be recreated. Should fix bug #34498. 2011-10-11 Fred Kiefer * Source/NSColor.m: Add alpha handling to keyed-coding/decoding. Should fix bug #34501. 2011-10-11 Fred Kiefer * Source/NSTextView.m(currentVersion, -encodeWithCoder:, -initWithCoder:): Archive missing attributes in non-keyed mode. This required updating the NSTextView version to 4. Should fix bug #33884. 2011-10-06 Fred Kiefer * Source/NSImage.m (-lockFocusOnRepresentation:): Draw the representation into the new cache. Use NSRectFillUsingOperation instead of PScompositerect. * Source/NSImage.m (-drawRepresentation:inRect:): Use DPS operations instead of PS operations. 2011-10-06 Fred Kiefer * Source/NSProgressIndicator.m (-encodeWithCoder:, initWithCoder:) The flag isDisplayedWhenStopped is stored negated. 2011-10-04 Fred Kiefer * Headers/AppKit/NSBezierPath.h, * Source/NSBezierPath.m: Rewrote NSBezierPath to allow subclasses. 2011-10-04 Fred Kiefer * Headers/AppKit/NSApplication.h, * Headers/AppKit/NSPasteboard.h, * Headers/AppKit/NSInterfaceStyle.h, * Headers/AppKit/NSGraphics.h: Bracket in 'extern "C"' for C++. Patch by Julian Mayer . 2011-10-04 Richard Frith-Macdonald * Headers/AppKit/NSPanel.h: Bracket in 'extern "C"' for C++ 2011-10-03 Fred Kiefer * Source/NSView.m (-initWithCoder:): Don't decode super view. * Headers/Additions/GNUstepGUI/GSXibLoading.h: Add class IBBindingConnection. * Source/GSXibLoader.m: Implement IBBindingConnection. * Source/GSXibLoader.m (-objectForXib:): Return a previously decoded object instead of a new one if available. 2011-10-01 Fred Kiefer * Source/NSMenuView.m (-_trackWithEvent:startingMenuView:, -trackWithEvent:): Started rewrite that simplifies menu tracking code. 2011-10-01 Fred Kiefer * Source/NSMenuView.m, * Source/GSThemeMenu.m, * Source/GSWindowDecorationView.m: Rewrite of the in-window menu handling. 2011-09-12 German Arias * Source/GSThemeMenu.m (-setMenu:forWindow:): Improvements to menu in window. 2011-09-12 Fred Kiefer * Source/NSControl.m (+initialize, -valueForKey:, -setValue:forKey:): Add support for the bindings NSFontNameBinding and NSFontSizeBinding. 2011-09-09 Eric Wasylishen * Source/NSImage.m (_cacheForRep:): Don't assume rep is non-nil. This should fix locking focus on an image with no representations. 2011-09-08 Gregory Casamento * Source/NSImage.m: Correction for call to function NSEqualSizes. It was mistyped as "NSSizesEqual" which was producing a link-time error. 2011-09-08 Eric Wasylishen * Source/NSImage.m: Throw an exception if you attempt to lock focus on an image with size (0, 0) * Source/NSCachedImageRep.m: Throw an exception if you attempt to create a cached image rep with a size of (0, 0). 2011-09-07 Eric Wasylishen * Source/NSFontPanel.m: Add a tooltip on the character panel button 2011-09-07 Eric Wasylishen * Source/NSSpellChecker.m: Use NSLog rather than a popup alert when the spell server can't be contacted; otherwise the user may be spammed with a series of popups if automatic spellchecking (underlining) is turned on, but the current language isn't set. 2011-09-07 Eric Wasylishen * Source/GSCharacterPanel.m: Implement -[NSApplication orderFrontCharacterPalette:] * Source/NSFontPanel.m: Use NSApplication method to order front character palette 2011-09-07 Eric Wasylishen * Source/NSImageCell.m (-drawInteriorWithFrame:inView:): Simplify a bit bit by using -[NSImage drawInRect:fromRect:operation:fraction:respectFlipped:hints:] * Source/NSCell.m (-drawInteriorWithFrame:inView:): Switch from -[NSImage compositeToPoint...] to -[NSImage drawInRect:fromRect:operation:fraction:respectFlipped:hints:] 2011-09-07 Eric Wasylishen * Source/NSOpenPanel.m: Use the NSSavePanel _allowedFileTypes ivar in place of the _fileTypes ivar. Replace calls to _setupForTypes: with -setAllowedFileTypes:. * Headers/AppKit/NSOpenPanel.h: Remove now unused _fileTypes ivar * Source/NSSavePanel.m: Treat directories whose names have extensions in the _allowedFileTypes array as file packages. Previously, we only relied on -[NSWorkspace isFilePackageAtPath:], to determine if a director is a file package, which only considers the info.plists of installed applications. 2011-09-06 Eric Wasylishen * Source/NSView.m (_setNeedsDisplayInRect_real:): Enlarge (if necessary) _invalidRect so it lies on integral device pixels. 2011-08-31 Fred Kiefer * Source/NSApplication.m (-setApplicationIconImage): Ignore this call when the image is nil. 2011-08-29 Eric Wasylishen * Source/NSCachedImageRep.m: Restore the implementation of -draw because libart/xlib need it. 2011-08-28 Christopher Armstrong * Source/GSHorizontalTypesetter.m: Split declaration of struct GSHorizontalTypesetter_glyph_cache_s and struct GSHorizontalTypesetter_line_frag_s from their typedefs to compile under clang. 2011-08-26 Fred Kiefer * Source/NSImage.m ( _loadFromFile): Correct last commit. * Source/NSImage.m ( _loadFromData): Use similar check here. 2011-08-25 Riccardo Mottola * Source/NSImage.m ( _loadFromFile): Check that the array of reps is populated, not just non-nil. 2011-08-20 Eric Wasylishen * Source/NSImage.m (-setSize:): Don't invalidate the cache anymore, because we now cache the entire representation and not the rep scaled to the image's size. 2011-08-19 Eric Wasylishen * Source/NSImage.m: Reinstate use of the cached image rep, but only on backends supporting GSdraw: (cairo). This means we don't have to create a window for every call to draw an image, and gives me a 5-10x speedup for image drawing. * Source/NSCachedImageRep.m: Implement private method -nativeDrawInRect:.. which is called by NSImageRep's -drawInRect:fromRect:..., and efficiently draw the cached rep using GSdraw:. Also make some changes so cached image reps can have a DPI != 72. * Headers/AppKit/NSCachedImageRep.h: New private init method that lets you specify diferent pixel size and point size. 2011-08-18 Eric Wasylishen * Headers/AppKit/NSImageRep.h: Add -drawInRect:fromRect:operation:fraction:respectFlipped:hints: method * Source/NSImage.m: * Source/NSImageRep.m: Refactor drawing code from NSImage to NSImageRep. This should cause no functionlity change, but it lets NSImageRep subclasses implement more efficient versions of -drawInRect:fromRect:... method that don't involve the wasteful drawing the image in a temporary offscreen window and then drawing from there on to the destination surface. 2011-08-17 Eric Wasylishen * Source/Functions.m (NSDrawNinePartImage): Pixel-align drawing rect using -[NSView centerScanRect] 2011-08-15 Eric Wasylishen * Source/Functions.m (NSDrawNinePartImage): Bugfix when drawing with not enough space 2011-08-15 Eric Wasylishen * Source/Functions.m (NSDrawNinePartImage): Bugfix in flipped drawing code 2011-08-15 Eric Wasylishen * Source/Functions.m: * Headers/AppKit/NSGraphics.h: NSDrawNinePartImage implementation 2011-08-15 Eric Wasylishen * Headers/Additions/GNUstepGUI/GSTheme.h: New GSThemeMargins struct. Rename buttonBorderForCell:style:state: to buttonMarginsForCell:style:state: and return the top/bottom/left/right margins instead of just two values. (This is a theme API break.) * Source/GSThemeDrawing.m: Implement buttonMarginsForCell:style:state:. Also reduce the top and left margin of the default button by 1 pt, to better reflect the button's appearance. * Source/GSGuiPrivate.h: Add a GSRoundTowardsNegativeInfinity function * Source/NSButtonCell.m (-drawImage:withFrame:inView:): Round the image position down and to the right, as this seems to look the best. * Source/NSButtonCell.m (-cellSize): Call new buttonMarginsForCell: method * Source/NSButtonCell.m (-drawingRectForBounds:): Call new buttonMarginsForCell: method 2011-08-15 Eric Wasylishen * Source/NSImage.m (GSResolutionOfImageRep): Specify behaviour when the rep has a size of zero, or is a vector rep. Prevent division by 0. 2011-08-15 Eric Wasylishen * Source/NSImage.m (-nativeDrawInRect:...): Deal with a zero rep size * Source/NSCustomImageRep.m: - Don't retain the delegate (matching OS X) - Remove unnecessary flip checks from -drawAtPoint: and -drawInRect: to match the code in NSImageRep - Fix a mistake when setting the ctm scale factor 2011-08-11 10:57 theraven * libs/gui/trunk/Tools/speech/GSSpeechEngine.h: Move the +defaultSpeechServer method into a category interface, to silence a clang warning. 2011-08-11 Fred Kiefer * Source/NSView.m (-setBoundsSize:): Adjust the origin as well. 2011-08-04 Fred Kiefer * Source/NSMenu.m (+initialize): Don't create the default menu zone as we never use it and a change in base made this an expensive operation. 2011-08-02 Eric Wasylishen * Images/common_RadioOn.tiff: * Images/common_RadioOff.tiff: Add high-dpi versions 2011-08-02 Eric Wasylishen * Source/GSLayoutManager.m: * Source/GSHorizontalTypesetter.m: * Headers/Additions/GNUstepGUI/GSLayoutManager_internal.h: * Headers/Additions/GNUstepGUI/GSLayoutManager.h: Store glyph advances in the runs in GSLayoutManager. Extend the NSGlyphStorage protocol to support a case where the glyph generator provides the glyph advances. I'm hoping to use this in the future to implement (optional) glyph generators which are wrappers around HarfBuzz or the ICU OpenType layout engine. 2011-08-02 Eric Wasylishen * Images/common_SwitchOff.tiff: * Images/common_SwitchOn.tiff: * Images/common_2DCheckMark.tiff: Add a few more high-res images 2011-08-01 Eric Wasylishen * Documentation/news.texi: * Documentation/ReleaseNotes.gsdoc: Add some documentation on new features in gui 2011-07-30 Eric Wasylishen * Source/NSScreen.m (-userSpaceScaleFactor): Use the DPI from the display server instead of ignoring it and assuming 72. The X11 server was changed to always return 72 for now, so there is no change in behaviour on X. On Windows we do use the system DPI/scale factor now. 2011-07-25 Riccardo Mottola * configure.ac: * configure: Check for png with CHECK and not SEARCH lib to avoid position problems in the linker flags (windows is sesnitive) 2011-07-24 Fred Kiefer * Source/NSAnimation.m (NSViewAnimation -dealloc): Use DESTROY instead of RELEASE as _viewAnimationDesc to prevent segmentation fault in super call. * Source/NSWindow.m (-setFrame:display:animate:): Use NSViewAnimation instead of local blocking code. * Source/NSWindow.m (-animationResizeTime:): Use abs() in all directions. 2011-07-23 Fred Kiefer * Tests/gui/NSView/NSView_visibleRect.m: New test. * Tests/gui/NSView/scrollRectToVisible.m: Use an NSWindow. 2011-07-23 Fred Kiefer * Source/NSView.m (autoresize): Handle negative flexible space. Patch by Tim Schmielau * Tests/gui/NSView/NSView_bounds_scale.m: More detailed testing. * Source/NSMenuItem.m, * Source/NSPageLayout.m, * Source/NSTextField.m, * Source/NSViewController.m: Add missing #import. * Source/NSSegmentedCell.m: Declare missing methods. 2011-07-21 Eric Wasylishen * Source/GSToolTips.m (-_timedOut:): Guard against nil tooltip string 2011-07-21 Eric Wasylishen * Source/NSButtonCell.m (-title): Return @"" instead of nil * Source/NSButtonCell.m (-alternateTitle): Return @"" instead of nil * Source/NSButtonCell.m (-attributedAlternateTitle): Use [self alternateTitle] instead of accessing _altContents directly to guard against _altContents being nil * Source/NSButtonCell.m (-attributedTitle): Don't return nil. Use [self title] instead of accessing _contents directly to guard against _contents being nil * Source/NSButtonCell.m (-keyEquivalent): Return @"" instead of nil * Source/NSButtonCell.m (-encodeWithCoder): For keyEquivelant and alternateTitle, now that the methods never return nil, instead of checking if they return nil to decide whether to encode them, check if the string length is > 0. * Source/NSToolbarItem.m (-label): Return @"" instead of nil. * Source/NSCell.m (-stringValue): Return @"" instead of nil * Source/NSCell.m (-attributedStringValue): Don't return nil. Use [self stringValue] instead of accessing _contents directly to guard against _contents being nil. 2011-07-20 Eric Wasylishen * Source/NSTextView.m (-view:stringForToolTip:point:userData:): Ensure this returns an NSString, even if NSToolTipAttributeName is set to something else (it calls -description on the value). 2011-07-19 Eric Wasylishen * Source/GSGhostscriptImageRep.m: Search for gs by enumerating directories in PATH rather than calling 'which'. Also search for gswin32c.exe for Windows. 2011-07-15 Eric Wasylishen * Source/NSImage.m: Implement -[NSImage drawInRect:fromRect:operation:fraction:respectFlipped:hints:] 2011-07-15 Eric Wasylishen * Source/NSImage.m (-nativeDrawInRect:...): Fix two bugs demonstrated in GSTest: - drawing an image in a flipped view with -drawInRect:... wasn't working, and - drawing a vector rep in a dest rect larger than the point size of the rep was resulting in blurry output. 2011-07-15 Eric Wasylishen * configure.ac: * configure: Fix the ICU test so the library search path and flags are added to GRAPHIC_LFLAGS; this fixes the build on Windows 2011-07-15 Eric Wasylishen * Source/NSColorPanel.m: Remove code for generating a dynamic magnifying glass cursor; it flickers on X11. 2011-07-15 Richard Frith-Macdonald * Source/GSGuiPrivate.h: remove reference to obsolete preface.h 2011-07-14 Eric Wasylishen * Source/NSOutlineView.m: Allow collapsing or expanding multiple rows at a time using the arrow keys 2011-07-14 Fred Kiefer * Source/NSSound.m * Source/GSWindowDecorationView.m * Source/NSMatrix.m * Source/NSBitmapImageRep.m * Source/NSForm.m * Source/GSHorizontalTypesetter.m * Source/NSMovie.m * Source/NSFontDescriptor.m * Source/NSImage.m * Source/NSScrollView.m * Source/NSCell.m * Source/NSBrowserCell.m * Source/GSDragView.m * Source/NSDocument.m: Replace direct use of the isa pointer with a call to object_getClass(). 2011-07-13 Eric Wasylishen * Source/NSColorPanel.m: Make a magnifying glass cursor when using the magnifying glass color picker. back/x11 isn't displaying the cursor at the moment. 2011-07-13 German Arias * Resources/Spanish.lproj/Localizable.strings: More strings. * Source/GSCharacterPanel.m: Added missign internationalization. 2011-07-12 Eric Wasylishen * Source/GSImageMagickImageRep.m: Don't call DestroyImage on a NULL image 2011-07-12 Eric Wasylishen * Source/GSImageMagickImageRep.m: Log warnings from ImageMagick instead of giving up. 2011-07-12 Eric Wasylishen * Source/GSGuiPrivate.h: New rounding rounding function GSRoundTowardsInfinity which is simply floor(x+0.5) * Source/NSBrowser.m: * Source/NSSliderCell.m: * Source/NSButtonCell.m: * Source/NSClipView.m: * Source/NSOutlineView.m: * Source/NSRulerView.m: Switch rint[f] to GSRoundTowardsInfinity 2011-07-11 Eric Wasylishen * Source/GSGhostscriptImageRep.m: Only invoke 'which' once. 2011-07-11 Eric Wasylishen * Source/GSGhostscriptImageRep.m: Change to NSLog, only log a warning the first time invoking ghostscript throws an exception, and log a message if it returns a nonzero exit status. 2011-07-11 Eric Wasylishen * Source/GSGhostscriptImageRep.m: Add NSWarnLog to execption handlers to print a message when finding or invoking Ghostscript fails. 2011-07-11 Fred Kiefer * Source/NSImage.m (-nativeDrawInRect:...): Compute the rep size after the nil test. 2011-07-11 Fred Kiefer * Source/NSDocumentController.m (-dealloc), * Source/NSWindow.m (-dealloc), * Source/NSLayoutManager.m (-dealloc): Unbind key bindings. 2011-07-11 Eric Wasylishen * Source/NSColorPanel.m (-_magnify:): Preliminary implementation 2011-07-10 Eric Wasylishen * Source/NSMenuView.m (-_trackWithEvent:): Fix for the bug where the highlighted menu item can be offset from the mouse pointer location when menu windows are moved by the window manager. See detailed comment in the code for more info. 2011-07-10 Eric Wasylishen * Source/GSGhostscriptImageRep.m: Remove hardcoded path to gs executable. First try GSGhostscriptExecutablePath default, then try running "$SHELL -c which gs" to get the path. 2011-07-08 Eric Wasylishen * Source/NSView.m (-resizeWithOldSuperviewSize:): Factor out autoresizing logic into a function. Add an extra code path to handle when the flexible space is 0, which behaves like the old version of the code (it divides the available space evenly). 2011-07-08 Eric Wasylishen * Tests/gui/NSView/NSView_autoresize_and_rounding.m: Tweak the test so it doesn't try to set the window size to {0,0} 2011-07-08 Eric Wasylishen * Tests/gui/NSView/NSView_autoresize_and_rounding.m: Add some more test cases for when the view's width is 0 2011-07-07 Eric Wasylishen * Headers/AppKit/NSView.h: * Source/NSView.m (-resizeWithOldSuperviewSize): Pixel-align view frame when autoresizing. 2011-07-03 Fred Kiefer * Source/NSView.m (-resizeWithOldSuperviewSize): Reimplement to resize proportionally as Cocoa does. 2011-07-07 Eric Wasylishen * Source/GSCharacterPanel.m: Double click inserts character into main window 2011-07-07 Eric Wasylishen * Source/GSCharacterPanel.m (-characterForRow:): Fix off-by-1 error 2011-07-06 Eric Wasylishen * Tests/gui/NSView/NSView_autoresize_and_rounding.m: More autoresizing test cases 2011-07-06 Eric Wasylishen * Tests/gui/NSView/NSView_autoresize_and_rounding.m: Add a test for NSView autoresizing and rounding 2011-07-06 Eric Wasylishen * configure: * Source/NSFontPanel.m: * Source/GNUmakefile: * Source/GSCharacterPanel.m: * configure.ac: * Headers/Additions/GNUstepGUI/GSCharacterPanel.h: * Headers/Additions/GNUstepGUI/config.h.in: * ChangeLog: * config: * config/icu.m4: Add a new character picker panel. It's accessible via a button in the font panel. 2011-07-03 Eric Wasylishen * Source/GSDisplayServer.m: * Headers/Additions/GNUstepGUI/GSDisplayServer.h: Add a new API for taking screenshots: -contentsOfScreen:inRect: 2011-07-03 Eric Wasylishen * Source/NSTextView.m: Use respectFraction: YES when deciding whether to do a word selection upon a right click 2011-07-03 Eric Wasylishen * TextConverters/RTF/RTFProducer.m: Writing of NSLinkAttributeName; reading is still to be implemented. 2011-07-03 Eric Wasylishen * Source/NSMenuView.m: Allow any mouse up (left/right/other) to choose a menu item. 2011-07-02 Eric Wasylishen * Source/NSTextView.m (-_updateState:): Invalidate cursor rects so the cursor rects over links, for example, are updated when text is edited. 2011-07-03 Fred Kiefer * Source/NSLayoutManager.m (-drawGlyphsForGlyphRange:atPoint:, -drawUnderlineForGlyphRange:...:): Add support for for link attributes. 2011-07-03 Riccardo Mottola * Source/NSSliderCell.m: Circular sliders never return the maximum value, tested on Apple. 2011-07-02 15:33-EDT Gregory John Casamento * Source/NSTableView.m: Modifications to initWithCoder: and encodeWithCoder: to handle _sortDescriptors in .gorm files. 2011-07-02 Riccardo Mottola * Source/NSSliderCell.m: Fix tick marks with circular sliders. 2011-06-29 Eric Wasylishen * Source/NSOutlineView.m: Implement left arrow key moving selection to parent node when the current item is collapsed. 2011-06-29 15:41 David Chisnall * libs/gui/trunk/Source/GSTextStorage.m, libs/gui/trunk/Source/NSBitmapImageRep.m: Small GC fixups. Make sure that we're actually using GC-tracked memory when we think that we are. 2011-06-29 15:39 David Chisnall * libs/gui/trunk/Headers/AppKit/NSEvent.h, libs/gui/trunk/Headers/AppKit/NSMatrix.h: Fix AppKit headers to allow inclusion in ARC mode. Since ARC requires the non-fragile ABI, a better solution would be to simply not expose any of these ivars with the non-fragile ABI. 2011-06-28 Eric Wasylishen * Headers/Additions/GNUstepGUI/GSImageMagickImageRep.h: * Source/GNUmakefile: * Source/NSImageRep.m: * Source/GSImageMagickImageRep.m: * configure.ac: New ImageMagick-based NSBitmapImageRep subclass 2011-06-28 Fred Kiefer * Source/GSDragView.m (-init): Set the window background colour to clear. * Headers/AppKit/NSAffineTransform.h, * Headers/AppKit/NSView.h, * Source/NSAffineTransform.m, * Source/NSPrintOperation.m, * Source/NSView.m: Use CGFlaot instead of float. * Tests/gui/NSView/NSView_bounds_scale.m: New test file that currently fails. 2011-06-26 Eric Wasylishen * Source/GSGhostscriptImageRep.m: * Headers/Additions/GNUstepGUI/GSGhostscriptImageRep.h: * Source/GNUmakefile: * Source/NSImageRep.m: New image rep which attempts to invoke Ghostscript to rasterize PS/EPS/PDF images. It needs some polishing but basically works. 2011-06-26 Wolfgang Lux * Source/NSTextView_actions.m (-deleteToEndOfParagraph:): Implement method, which was introduced in OS X 10.3. 2011-06-26 Wolfgang Lux * Source/NSTextView_actions.m (-deleteToEndOfLine:): Fix implementation to work in the same way as under Emacs and OS X. In particular, the action now deletes the newline character when the insertion point is at the end of a line. 2011-06-22 Fred Kiefer * Headers/AppKit/NSPrintPanel.h: Add missing APPKIT_EXPORT for new strings. Bug point out by Bluna Ratimonkey . 2011-06-19 Fred Kiefer * Headers/AppKit/NSOpenPanel.h * Headers/AppKit/NSSavePanel.h * Source/NSSavePanel.m * Source/NSOpenPanel.m: Change all the runModal:... methods to return an NSInteger. 2011-06-19 Eric Wasylishen * Source/NSTextView.m (-scrollRangeToVisible:): Fix to support scrolling to the empty range at the end of a document (i.e. {[string length], 0}). This fixes the scrolling when you repeatedly hit RETURN in TextEdit to create new pages (in wrap to page mode). 2011-06-19 Fred Kiefer * Source/NSButtonCell.m (-setTitle:, -setAttributedTitle:, -setAlternateImage:, -setImagePosition:): Update the control to reflect the changes. 2011-06-19 Fred Kiefer * Source/NSDocumentController.m (-_openRecentDocument:): Use most current method to display document. 2011-06-19 Fred Kiefer * Source/NSView.m (-setBounds:, -setBoundsSize:): Rewrite of this methods plus a few helpers. We pass now all the frame/bounds test cases. * Source/NSView.m (-_viewWillMoveToWindow:): Move the invalidation of the coordinate transformations and the cursor rects before the window test. Remove calls to coordinate invalidation from other places. 2011-06-16 Eric Wasylishen * common_ArrowDown.tiff: * common_ArrowRight.tiff: * common_ArrowUp.tiff: * common_3DArrowDown.tiff: * common_ArrowDownH.tiff: * common_ArrowLeft.tiff: * common_ArrowLeftH.tiff: * common_3DArrowLeft.tiff: * common_ArrowUpH.tiff: * common_3DArrowUp.tiff: * common_ArrowRightH.tiff: * common_3DArrowRight.tiff: Ensure both sub-images have the same colorspace 2011-06-16 Eric Wasylishen * Images/common_3DArrowRightH.tiff: Add high-res version 2011-06-15 Eric Wasylishen * Headers/AppKit/NSImageCell.h: * Source/NSImageCell.m: Add support for NSImageScaleProportionallyUpOrDown 2011-06-14 Eric Wasylishen * Source/NSImage.m: Use -bestRepresentationForRect:context:hints: in -guiDrawInRect:... as well. 2011-06-15 Fred Kiefer * Source/NSSegmentedCell.m (-initWithCoder:): Protect against selected segment being -1. 2011-06-14 Eric Wasylishen * Source/NSImage.m: Implement -bestRepresentationForRect:context:hints:, which chooses the smallest rep larger than or equal to the provided size. Modify -nativeDrawInRect:... to use the above method for choosing a rep. 2011-06-14 Eric Wasylishen * Source/NSImage.m (-guiDrawInRect:...): Handle dstRect with a zero size 2011-06-14 Eric Wasylishen * Source/NSImage.m: Remove unnecessary DPSgsave/DPSgrestore I added earlier in -nativeDrawInRect:... and replace them with saving/restoring the transformation matrix. The DPSgsave/DPSgrestore were causing problems when drawing images with a non-rectangular clipping area. 2011-06-14 Eric Wasylishen * Source/NSImage.m: Tidy the -composite*/-dissolve* methods 2011-06-13 Eric Wasylishen * Source/NSTextView.m (-scrollRangeToVisible:): Work with ranges outside the receiver (in a situation with multiple NSTextView's connected to a layout manager) 2011-06-13 Eric Wasylishen * Source/NSView.m (-scrollRectToVisible:): Work when the receiver isn't partially visible in the clip view. 2011-06-13 Eric Wasylishen * Source/NSImage.m: Completely overhaul the best rep selection. It should now be very close to the algorithm described in the cocoa drawing guide, and fixes numerous bugs with the old code. 2011-06-14 Fred Kiefer * Source/NSFileWrapper.m: Add keyed coding. 2011-06-13 Eric Wasylishen * Source/NSBitmapImageRep.m: Reduce floating-point error in the expression which computes image point size using DPI and pixel size (for TIFF images.) 2011-06-13 Eric Wasylishen * Source/NSImageRep.m (-description): Implement -description to aid debugging. 2011-06-13 Fred Kiefer * Source/NSPrintInfo.m: Add keyed coding. 2011-06-13 Fred Kiefer * Source/NSTextView.m: Add methods -_becomeRulerClient and -_resignRulerClient to set self as the ruler client and to resign from that. These get called when self becomes first responder or resigns from first responder. 2011-06-11 Fred Kiefer * Headers/AppKit/NSPrintInfo.h, * Source/externs.m: Add new MacOSX strings for NSPrintInfo. 2011-06-11 Fred Kiefer * Headers/AppKit/NSWorkspace.h, * Source/NSWorkspace.m: Add a few MacOSX methods with dummy implementations. * Source/externs.m: Add new notification strings for NSWorkspace. 2011-06-11 Fred Kiefer * Headers/AppKit/NSKeyValueBinding.h * Source/NSPopUpButton.m * Source/NSMatrix.m * Source/NSLayoutManager.m * Source/NSTextView.m * Source/NSDocumentController.m * Source/externs.m: Add a few key value bindings. 2011-06-10 Fred Kiefer * Source/NSBitmapImageRep+ICNS.m: Remove comment about libicns being GPL, it is now LGPL 2.1. 2011-06-10 Fred Kiefer * Source/NSTextView_actions.m (-moveLeftAndModifySelection:, -moveRightAndModifySelection:, -moveWordLeft:, -moveWordLeftAndModifySelection:, -moveWordRight:, -moveWordRightAndModifySelection:, -setBaseWritingDirection:range:): Add basic implementation for these methods. 2011-06-09 13:49-EDT Gregory John Casamento * Source/GSTheme.m: Move notifications handling code to setTheme: instead and add code which deactivates the notifications and then starts listening again after activate is called. 2011-06-09 13:43-EDT Gregory John Casamento * Source/GSTheme.m: Move call to listen to default changes to activate instead of +initialize. 2011-06-07 07:40-EDT Gregory John Casamento * Source/NSMenuItem.m: Remove temporary fix. 2011-06-06 Fred Kiefer * Source/externs.m: Correct the strings for NSPrintPanel. * Source/NSAttributedString.m (-setBaseWritingDirection:range:): Add proper implementation for this method. * Source/NSTextView_actions.m (-insertContainerBreak:) (-insertLineBreak): Add this methods. 2011-06-05 Fred Kiefer * Headers/AppKit/NSPrintPanel.h, * Source/NSPrintPanel.m: Add newer methods and ivars for these. * Source/NSPrintOperation.m: User newer NSPrintPanel interfaces. * Source/externs.m: Define a few strings for NSPrintPanel. 2011-06-04 Wolfgang Lux * Source/NSApplication.m (-_init, -finishLaunching): Create the app icon in NSApplication -_init as suggested by Fred. 2011-06-04 Wolfgang Lux * Source/Functions.m (NSApplicationMain): * Source/NSApplication.m (-finishLaunching): Revert to creating the app icon in finishLaunching, since existing applications that do not use NSApplicationMain otherwise won't get an app icon. 2011-06-03 00:55-EDT Gregory John Casamento * Source/GSThemeMenu.m: Revert last change, since it will, per discussion with Fred, cause issues. * Source/NSMenuItem.m: Temporary fix for crash. 2011-06-02 16:17-EDT Gregory John Casamento * Source/GSThemeMenu.m: Use NSArchiver to copy menu instead of copy. Add comment to explain why this is done. The copy method causes all of the NSMenu instances to share NSMenuItems. This appears to be causing a crash when the menu updates. 2011-06-02 Wolfgang Lux * Source/NSApplication.m (-finishLaunching): Move creation of the app icon from here ... * Source/NSApplication.m (-_appIconInit): * Source/Functions.m (NSApplicationMain): ... to here so that applications get a proper app icon under WindowMaker even when their main nib contains visible at launch time windows. 2011-05-31 Riccardo Mottola * Images/common_Miniaturize.tiff Revert image but with correct dpi of 72. 2011-05-31 Wolfgang Lux * Source/NSWindow.m (-orderWindow:relativeTo:): Take care of hide on deactivate windows. * Source/NSWindow.m (-setHidesOnDeactivate:): Hide/unhide receiver when the flag is changed and the application is not active. * Source/NSWindow.m (-_isWindowInactive:, _setWindow:inactivate:): New private NSApplication category to support management of hide on deactivate windows. * Source/NSApplication.m (-deactivate): Fix order of actions when hiding inactive windows. 2011-05-31 Wolfgang Lux * Source/NSImage.m (-bestRepresentationForDevice): Prefer returning an image representation whose size matches the image size exactly. * Source/NSImage.m (-_bestRep:withBpsMatch:): Fix test confusing bits per sample and bits per pixel. 2011-05-29 20:34-EDT Gregory John Casamento * Source/GNUmakefile: Remove NSManagedObjectContext.[hm] from compile * Source/NSManagedObjectContext.h * Source/NSManagedObjectContext.m: Delete * Source/NSObjectController.m: Remove #import and add @class declaration. 2011-05-29 Fred Kiefer * Source/NSButtonCell.m (-drawImage:withFrame:inView:): Use rint instead of round. 2011-05-27 14:08 David Chisnall * libs/gui/trunk/Source/NSMenu.m: Don't create a zone in GC mode (detected at run time). This avoids a warning when starting GUI apps in GC mode, but should have no real effect on functionality. 2011-05-27 12:42 David Chisnall * Source/Functions.m, * Source/NSAnimation.m, * Source/NSApplication.m, * Source/NSAttributedString.m, * Source/NSBitmapImageRep.m, * Source/NSComboBoxCell.m, * Source/NSFileWrapper.m, * Source/NSInputManager.m, * Source/NSPrinter.m, * Source/NSProgressIndicator.m, * Source/NSWindow.m, * TextConverters/RTF/RTFProducer.m, * Tools/GSspell.m, * Tools/make_services.m, * Tools/set_show_service.m: Turn release messages sent to autorelease pools into drain messages. No functionality change in non-GC mode, in GC mode it invokes a quick GC pass to try to delete the short-lived objects. Also deleted some [pool release] lines just before exit() or return-from-main statements. These cause objects to be swapped in and destructors to be run to no benefit (the OS will reclaim this memory without requiring stuff to be swapped in when the process exits). 2011-05-27 Fred Kiefer * Headers/AppKit/NSSplitView.h * Source/NSSplitView.m: Declare a few MacOSX 10.5 methods and make the background transparent by default. 2011-05-26 Eric Wasylishen * Source/NSImage.m (-nativeDrawInRect:...): Fix drawing images with a source rect smaller than the entire image. This was a mistake left by my last commit to this method. 2011-05-25 Eric Wasylishen * Source/NSLayoutManager.m: * Source/NSGraphicsContext.m: * Headers/AppKit/DPSOperators.h: * Headers/AppKit/NSGraphicsContext.h: * Headers/Additions/GNUstepGUI/GSMethodTable.h: New GSShowGlyphsWithAdvances, which replaces GSShowGlyphs as the primitive text drawing method. (used by -[NSLayoutManager drawGlyphsForGlyphRange:atPoint:]) Requires r33121 in -back. Note that the advances aren't actually used by -back yet so text output should be unchanged. 2011-05-25 Eric Wasylishen * Source/NSComboBoxCell.m: Correct positioning of popup window when a scale factor is in use. 2011-05-25 Eric Wasylishen * Source/NSLayoutManager.m: Add a FIXME note 2011-05-25 11:19 David Chisnall * libs/gui/trunk/Source/NSBezierPath.m, libs/gui/trunk/Source/NSFont.m, libs/gui/trunk/Source/NSParagraphStyle.m: Change direct references to the isa pointer to calls to object_getClass(). In discussion with Steve Naroff (before he left Apple) it was decided that the isa pointer should be regarded as an implementation detail and not part of the language, so direct references to it are deprecated (on OS X). This gives the runtime a bit more freedom to do secret isa-swizzling tricks. 2011-05-23 Fred Kiefer * Tools/say/GNUmakefile * Tools/say/say.m: Clean these up a bit to correctly compile wiht gcc 4.6. 2011-05-22 Fred Kiefer * Headers/AppKit/NSControl.h: * Source/NSControl.m (-takeIntegerValueFrom:, -setIntegerValue:) (-integerValue): Add OSX 10.5 methods. 2011-05-19 Fred Kiefer * Headers/AppKit/NSView.h, * Source/NSView.m (-setSubviews:): New method. Code by Banlu Kemiyatorn . 2011-05-18 Fred Kiefer * Source/NSBitmapImageRep+ICNS.h * Source/NSBitmapImageRep+ICNS.m: New method to load all the images from file. Plus a few additional changes. * Source/NSBitmapImageRep.m (+imageRepsWithData:): Use new ICNS method to get all images from file. * Source/NSBitmapImageRep.m (+imageRepWithData:): Use -initWithData: instead of +imageRepsWithData:. 2011-05-15 Fred Kiefer * Source/NSView.m (-removeFromSuperview): Use removeFromSuperviewWithoutNeedingDisplay. * Source/GSWindowDecorationView.m: Add method [NSWindow -_clearContentView] to avoid recursion when removing the content view. * Source/GSWindowDecorationView.m: Replace the method -removeSubview: with -willRemoveSubview:. * Source/NSScrollView.m: Dito. * Source/NSClipView.m (-initWithCoder:): Use -removeFromSuperview instead of -removeSubview:. * Source/NSMenu.m (-setMenuRepresentation:): Dito. * Source/NSColorPanel.m (-setAccessoryView:): Dito. 2011-05-15 Eric Wasylishen * Source/NSTextView.m: Use pointing hand cursor for links 2011-05-14 Eric Wasylishen * Source/NSTableHeaderView.m: Use resize cursors 2011-05-14 Eric Wasylishen * Source/NSTextView.m: Use IBeam cursor if selectable 2011-05-14 Eric Wasylishen * Source/NSSplitView.m: Use resize cursors 2011-05-14 Fred Kiefer * Source/NSPrintOperation.m: Add an extra context save and restore at the sheet level. This is a partial fix for bug #32845. 2011-05-12 Fred Kiefer * Source/GSXibLoader.m: Add support for the "array" and "dictionary" elements found in newer XIB files (Version >= 8). 2011-05-11 Eric Wasylishen * Source/Functions.m: For functions which set the fill or stroke color as part of their implementation, save/restore the graphics state so that the user's fill/stroke color isn't overwritten. See the PixelExactDrawing test in GSTest for an example. 2011-05-07 Eric Wasylishen * Source/NSButtonCell.m (-drawImage:withFrame:inView:): Align the point at which the image is drawn to the nearest pixel. r32895 which reimplemented -[NSImage composite..] methods on top of -[NSImage draw...] methods means that drawing images with -compositeToPoint: no longer pixel-aligns the image automatically. The new behaviour matches Cocoa, however. 011-05-07 Eric Wasylishen * Source/NSView.m (-convertPoint:toView:): Correct this method; it was applying the transforms backwards :-( 2011-05-05 Eric Wasylishen * Tests/gui/NSView/NSView_frame_bounds.m: Add some more tests of setBoundsSize:. They are currently failing (but pass on OS X). 2011-05-04 Eric Wasylishen * Images: Add a few more high-res images (arrows) 2011-05-03 Eric Wasylishen * Source/NSScreen.m: Use -userSpaceScaleFactor to calculate NSDeviceResolution * Source/NSImage.m: Implement -_bestRep:withResolutionMatch: * Images/common_Dimple.tiff: * Images/common_3DArrowRight.tiff: Add to these images a second 'page' at 4x the original resolution which I drew. If you use GSScaleFactor > 1 then the high resolution version of these images should be used. 2011-05-01 Eric Wasylishen * Images: Ensure all images have their DPI metadata set to 72. 2011-05-01 Eric Wasylishen * Source/NSLayoutManager.m (-characterIndexMoving:fromCharacterIndex:originalCharacterIndex:distance:): Rework this method to suport moving the insertion point between text containers, for both left/right and up/down movements. However, it will only have this behaviour when distance == 0. This is part of what is needed to support moving the insertion point between text views in, e.g., TextEdit when using the multi-page view. 2011-04-30 Eric Wasylishen * Source/NSView.m (-updateBoundsMatrix): Fix a bug where updateBoundsMatrix would refuse to restore a view's scale to its original value, after a modified bounds rect had been set. * Source/NSView.m (-setBounds:, -setBoundsOrigin:, -setBoundsSize:): Call [self setNeedsDisplay: YES]; at the ends of these methods. While the Cocoa docs explicitly say that calling these methods won't mark the view as needing redisplay, this doesn't seem to be true in practice. 2011-04-29 Eric Wasylishen * Source/NSOutlineView.m: Implement -keyDown: to expand/contract items. 2011-04-29 Eric Wasylishen * Source/NSTextView.m (-mouseDown:): Add support for making selections with the mouse which span multiple text views * Source/NSTextView.m (-setSelectedRange:affinity:stillSelecting:): Replace the complex display invalidation code with two calls to -[NSLayoutManager invalidateDisplayForCharacterRange:], which will take care to invalidate all necessary text views. 2011-04-29 Eric Wasylishen * Source/NSTextView.m (-setTypingAttributes:) Guard against nil layout manager 2011-04-28 Eric Wasylishen * Source/NSPopUpButtonCell.m: Override -representedObject and -setRepresentedObject: with implementations that delegate the call to [self selectedItem] (the NSMenuItem). 2011-04-27 Eric Wasylishen * Source/NSTextView.m (-selectionRangeForProposedRange:granularity:): Remove a special case which caused this method to refuse to expand a range {[string length], 0}. This was why the align left/center/right menu items didn't work in Ink when the insertion point was at the end of a document. The behaviour should match OS X now. 2011-04-26 Eric Wasylishen * Headers/AppKit/NSSavePanel.h: * Source/NSSavePanel.m: Implement -setNameFieldStringValue:, -nameFieldStringValue, -setNameFieldLabel:, -nameFieldLabel. 2011-04-26 Eric Wasylishen * Source/NSTextView.m (-setRulersVisible:): Create a horizontal ruler on the scroll view if needed - this seems to be the OS X behaviour. 2011-04-21 Eric Wasylishen * Source/NSImage.m (-nativeDrawInRect:...): Fix a bug in my recent change here which mis-positioned images. 2011-04-21 Eric Wasylishen * Source/tiff.m: * Source/nsimage-tiff.h: * Source/NSBitmapImageRep.m: Read DPI metadata in TIFF files and use this to set the point size of the image rep 2011-04-20 Eric Wasylishen * Source/NSImage.m (-nativeDrawInRect:...): Make the cache window large enough so that detail is preserved when drawing using a scale factor larger than 1. This change should only improve output quality but not affect image drawing otherwise. 2011-04-20 Eric Wasylishen * Source/NSBitmapImageRep+PNG.m: Read DPI metadata in PNG files and use this to set the point size of the image rep 2011-04-19 Eric Wasylishen * ColorPickers/GSWheelColorPicker.m: Choose the color wheel bitmap size by converting the bounds rect to window base coordinates 2011-04-19 Eric Wasylishen * Source/NSScreen.m: Read -userSpaceScaleFactor from the GSScaleFactor user default. * Source/GSWindowDecorationView.m: Apply -[NSScreen userSpaceScaleFactor] in +frameRectForContentRect and +contentRectForFrameRect, as well as setting a scaled bounds size in -layout. 2011-04-18 Eric Wasylishen * Source/NSWindow.m: Remove unnecessary FIXMEs related to user space scale factor * Source/NSAppliation.m: Correct app icon sizing which was mixing up window frame coordinates and user space coordinates * Source/NSCachedImageRep.m: Add NSUnscaledWindowMask to the window used internally 2011-04-18 Eric Wasylishen * Source/NSScreen.m (-userSpaceScaleFactor): Temporarily fix the scale factor at 1.0 until the remaining parts of the high DPI patch are committed. 2011-04-18 Eric Wasylishen * Source/NSImage.m (-compositeToPoint:fromRect:operation:fraction:): New simple implementation which calls -drawAtPoint:fromRect:operation:fraction:. Also respects the user space scale factor. * Source/NSImage.m (-guiDrawInRect:fromRect:operation:fraction): Remove a special case which called -compositeToPoint:..., which would cause an infinite loop when combined with the above change. Also avoid using -drawRepresentation:inRect: because -drawInRect:... is supposed to fill the destination rect regardless of the setting of -scalesWhenResized. This is a change borrowed from -nativeDrawInRect:... 2011-04-19 Fred Kiefer * Source/NSMenu.m (-_organizeMenu): Move some code around to avoid a compiler warning. 2011-04-19 Fred Kiefer * Source/NSViewController.m (-loadView): Retain the topLevelObjects. 2011-04-18 Eric Wasylishen * Source/NSMenuView.m (-setWindowFrameForAttachingToRect:...): This method mixed user space and window base coordinates in some places, which I fixed. 2011-04-18 Eric Wasylishen * Source/NSView.m (-_rebuildCoordinates): Remove assumption that the window content view's superview's transformation matrix is the identity matrix. * Source/NSView.m (-convertPoint..., convertRect..., convertSize...): Rewrite these methods to remove the same assumption as above, and also call -_matrixToWindow/-_matrixFromWindow rather than accessing ivars directly. 2011-04-18 Eric Wasylishen * Source/GSStandardWindowDecorationView.m: Use bounds rect instead of frame rect when laying out the window parts (title bar, etc). 2011-04-18 Fred Kiefer * Source/GSXibLoader.m: Rewrote the handling of the data element. This no longer gets treated as the "root" element of the XIB file. Correct reference handling. A reference may now be decoded before the actual object. 2011-04-17 Eric Wasylishen * configure.ac: Copy the -Wdeclaration-after-statement test from base. Also adds -Wall. 2011-04-14 Adam Fedor * Version: Bump version. 2011-04-14 Adam Fedor * Version 0.20.0 2011-04-10 04:45-EDT Gregory John Casamento * Source/GSThemeMenu.m: added method - (BOOL) menuShouldShowIcon * Source/NSMenu.m: Call menuShouldShowIcon so that the theme can determine if it should show the app icon. * Headers/Additions/GNUstepGUI/GSTheme.m: add declaration for menuShouldShowIcon. 2011-04-09 Fred Kiefer * Source/tiff.m, * Source/NSLayoutManager.m: Replace objc_free and objc_realloc with free and realloc. * Source/NSToolbar.m [-_build]: Correct type cast. * Source/GSTextFinder.m [-performFindPanelAction:withTextView:]: Use correct format for NSInteger. Fixes warnings reported by clang. 2011-04-08 Nicola Pero * GNUmakefile (SUBPROJECTS): Added Tests, so that 'make check' top-level does run the tests. * Tests/GNUmakefile: Use rules.make instead of test-tool.make. (TEST_TOOL_NAMES): Variable removed. 2011-03-31 Riccardo Mottola * Source/NSWorkspace.m Redefine statfs only for netbsd >= 3 2011-03-30 Fred Kiefer * Headers/AppKit/NSTableView.h, * Headers/AppKit/NSOutlineView.h, * Source/NSOutlineView.m (-namesOfPromisedFilesDroppedAtDestination:): Correct declaration of data source methods and the implementation in NSOutlineView. 2011-03-29 Riccardo Mottola * Source/NSParagraphStyle.m * Source/NSMatrix.m Added missing import. 2011-03-29 German Arias * Source/NSApplication.m (-hide:): Minimize all windows if the AppIcon is suppressed. 2011-03-29 Richard Frith-Macdonald * Source/GSTextStorage.m: Use pointer sized integers in union for 64bit safety. 2011-03-28 Fred Kiefer * Tests/gui/NSSavePanel/setDelegate_reload.m: Switch the save panel to show hidden files as this is no longer the default. * Tests/gui/NSCell/basic.m: Basic create, coding and copy tests copied from base. 2011-03-28 Riccardo Mottola * Source/NSSearchFieldCell.m, * Source/NSTextView.m: Remove c99-ism * Source/NSSpeechSynthesizer.m: Add missing import 2011-03-25 German Arias * Panels/Spanish.lproj/GSDataLinkPanel.gorm: * Panels/Spanish.lproj/GSPageLayout.gorm: * Panels/Spanish.lproj/GSToolbarCustomizationPalette.gorm: * Panels/Spanish.lproj/GSPrintPanel.gorm: * Panels/Spanish.lproj/GSFindPanel.gorm: Tweak size of some elements for improve the presentation. 2011-03-19 Eric Wasylishen * Source/NSPrintPanel.m: * Panels/Spanish.lproj/GSPrintPanel.gorm: * Panels/English.lproj/GSPrintPanel.gorm: Tweak the print panel to allow the user to choose the printer 2011-03-18 Nicola Pero * Documentation/GNUmakefile (DOCUMENT_TEXT_NAME, TOP_DOC_FILES): Fixed names of files to generate; for example, INSTALL instead of install. 2011-03-17 Fred Kiefer * Source/NSMenuView.m (-_trackWithEvent:): Use _trackWithEvent: instead of trackWithEvent: to have just one mouse capture call. 2011-03-17 Fred Kiefer * Source/NSOutlineView.m (-namesOfPromisedFilesDroppedAtDestination:), * Source/NSTableView.m (-namesOfPromisedFilesDroppedAtDestination:): Implement this drag and drop support method. 2011-03-16 Fred Kiefer * Source/NSComboBoxCell.m: Correct imports. 2011-03-16 Fred Kiefer * Source/NSOutlineView.m (-_didChangeSortDescriptors:), * Source/NSTableView.m (-_didChangeSortDescriptors:): Send the message to the data source not the delegate. 2011-03-16 06:30-EDT Gregory John Casamento * Source/GSThemeMenu.m: Use copy in setMenu:forWindow: instead of NSArchiver. 2011-03-14 Fred Kiefer * ColorPickers/GSNamedColorPicker.m * Source/NSBrowser.m * Source/NSPanel.m * Source/NSOpenPanel.m * Source/GSDisplayServer.m * Source/NSFormCell.m * Source/NSBitmapImageRep.m * Source/NSForm.m * Source/GSVbox.m * Source/NSSavePanel.m * Source/GSMemoryPanel.m * Source/NSScroller.m * Source/NSMenuView.m * Source/NSSecureTextField.m * Source/NSHelpPanel.m * Source/NSSegmentedCell.m * Source/NSStepperCell.m * Source/NSColorPanel.m * Source/NSDataLinkPanel.m * Source/GSTable.m * Source/NSBrowserCell.m * Source/GSHbox.m: Correct issues with missing or incorrect self tests in initXXX methods pointed out by static analyser. 2011-03-14 Fred Kiefer * Printing/GSCUPS/GSCUPSPrinter.m (+printerWithName:) Autorelease the dummy printer. * Source/NSWorkspace.m (-iconForFile:): Remove unused code. * Source/NSComboBoxCell.m: Remove the old browser based implementation after testing the new one for seven years. 2011-03-14 Eric Wasylishen * Source/NSMenuItemCell.m: Add missing -retain for key equivalent modifier strings 2011-03-14 Eric Wasylishen * Headers/AppKit/NSSavePanel.h: Add OS 10.6 #ifdef around new showsHiddenFiles methods 2011-03-14 Eric Wasylishen * Source/NSTextView.m: Add a message in the context menu if there are no spelling suggestions 2011-03-14 Fred Kiefer * Source/NSMenuItemCell.m: Make key equivalent modifier string user adjustable by getting them from the defaults. * Documentation/GuiUser/DefaultsSummary.gsdoc: Document the new equivalent modifier strings and remove the now obsolete documentation for GSFileBrowserHideDotFiles. 2011-03-14 Fred Kiefer * Source/NSSavePanel.m (-_initWithoutGModel): Use an image view instead of a button to display the application icon. That way icons get scaled correctly. Patch by Philippe Roussel . 2011-03-14 Nicola Pero * Resources/GNUmakefile (gui-resources_RESOURCE_FILES_INSTALL_DIR): Removed. * Source/GNUmakefile (libgui-resources_RESOURCE_FILES_INSTALL_DIR): Removed. 2011-03-14 Eric Wasylishen * Source/NSLayoutManager.m: Don't draw spelling underlines when printing 2011-03-14 Eric Wasylishen * Source/NSTextView.m: Attempt to add pagination support so lines aren't cut in half when printing 2011-03-13 Eric Wasylishen * Source/NSTextView.m: Tweaks to last commit 2011-03-13 Eric Wasylishen * Source/NSLayoutManager.m: Clear temporary attributes on the modified range when informed of a change in the text storage * Source/NSTextView.m: Add a context menu with spelling suggestions and cut/copy/paste 2011-03-13 Eric Wasylishen * Source/NSSavePanel.m: * Headers/AppKit/NSSavePanel.h: Implement -showsHiddenFiles and -setShowsHiddenFiles:. Add a context menu to the browser to allow toggling this setting. NOTE: It defaults to not showing hidden files, and no longer uses the GSFileBrowserHideDotFiles user default. 2011-03-13 Eric Wasylishen * Source/NSPrintPanel.m: * Printing/GSCUPS/GSCUPSPrintOperation.m: * Printing/GSLPR/GSLPRPrintOperation.m: Allow saving a print job as a PDF. 2011-03-13 Wolfgang Lux * Source/NSSpellChecker.m (-_findNext:, -_learn:, -_forget:, -_ignore:, -_guess:, -_correct:, -_switchDictionary:, -_highlightGuess:): Change action methods to return no result. 2011-03-13 Wolfgang Lux * Source/NSSpellChecker.m (-init, -dealloc): Fix nasty retain/release error, which could crash applications after changing the spell checker language in the spelling panel. 2011-03-13 Fred Kiefer * Source/NSWorkspace.m (-iconForFile:): Remove unused local variable. * Source/GSGormLoading.m (gmodel_class): Remove useless assignment. * Source/NSTextBlock.m (-drawBackgroundWithFrame:...layoutManager:): Use the correct variables. * Source/NSRulerMarker.m (-trackMouse:adding:): Remove unused variable. * ColorPickers/GSNamedColorPicker.m (-setColor:): Add missing implementation. * ColorPickers/GSStandardColorPicker.m (-_showNewPicker:), * Source/GSToolbarCustomizationPalette.m (-layout), * Source/NSTableView.m (-sizeToFit), * Source/NSApplication.m (-finishLaunching), * Source/GSGormLoading.m (GSNibContainer-awakeWithContext:), * Source/NSMenu.m (-sizeToFit), * Source/NSSplitView.m (-mouseDown:), * Source/NSBrowser.m (-setLastColumn:), * Source/NSPrintOperation.m (-deliverResult): Removed dead assignments found by static code analyser. 2011-03-12 Fred Kiefer * Source/NSMatrix.m (_shiftModifier:): Use correct column index for old cell. * Headers/AppKit/NSCursor.h * gui/Source/NSCursor.m: Add Mac 10.6 methods and implement keyed coding/decoding properly. * Images/nsmapping.strings: Add mappings for some new cursors. 2011-03-11 Eric Wasylishen * Source/NSLayoutManager.m: * Source/externs.m: * Source/NSTextView.m: * Headers/AppKit/NSAttributedString.h: * Headers/AppKit/NSTextView.h: Implement continuous spell checking 2011-03-11 Fred Kiefer * ColorPickers/GSStandardColorPicker.m * Source/GSToolbarCustomizationPalette.m * Source/GSServicesManager.m * Source/NSSpellChecker.m: Fix dead initialisation found by static analyser. 2011-03-10 Fred Kiefer * TextConverters/RTF/RTFConsumer.m * Source/GSNibLoading.m * Source/NSInputManager.m * Source/NSEPSImageRep.m * Model/GMArchiver.m * Tools/set_show_service.m * Tools/GSspell.m: Fix memory leaks found by static analyser. 2011-03-10 Fred Kiefer * Headers/Additions/GNUstepGUI/GSTitleView.h, * Headers/AppKit/NSProgressIndicator.h: Remove unused ivars found by static analyser. 2011-03-09 Wolfgang Lux * Source/NSPopUpButtonCell.m (-dealloc): Stop observing notifications from the button's menu to prevent obscure crashes later. 2011-03-09 Wolfgang Lux * Source/NSMatrix.m (_altModifier:): Fix swapped macro arguments, which could lead to a wrong selection and potentially a crash when extending the selection with the alt modifier key. 2011-03-09 Wolfgang Lux * Source/NSTableHeaderCell.m (-initTextCell:): Don't wrap text in table view headers by default. This partially fixes #30020. 2011-03-08 Eric Wasylishen * Source/NSLayoutManager.m: Implement temporary attributes * Header/AppKit/NSLayoutManager.h: Add a _temporaryAttributes ivar 2011-03-07 Fred Kiefer * Source/NSGraphicsContext.m (+saveGraphicsState): Release the stack, as it is retained in the thread dictionary. Leak found by static code analyser. 2011-03-07 Fred Kiefer * gui/Headers/Additions/GNUstepGUI/GSDisplayServer.h * gui/Source/GSDisplayServer.m * gui/Source/NSCursor.m: Change the way the image for the cursor gets passed on to the backend. The old way could only work for 8 bit data. 2011-03-07 Fred Kiefer * Headers/AppKit/NSKeyValueBinding.h * Source/externs.m: Add a few more binding names. * Source/NSPopUpButton.m: Implement NSSelectedTagBinding. 2011-03-07 Fred Kiefer * Source/NSWindow.m * Source/NSObjectController.m * Source/NSControl.m * Source/NSMenuItem.m * Source/NSKeyValueBinding.m * Source/NSTextField.m * Source/NSView.m: Release the key value binding as it will be retained in the binding table. Leak found by static code analyser. 2011-03-06 Fred Kiefer * Source/NSMatrix.m (-_privateFrame:...numberOfColumns): Change the init helper method to conform with the Objective-C conventions, * Source/GSGormLoading.m (GSNibItem-initWithCoder:): Retain the shared application before returning it. * Source/NSDataLink.m: Correct the init methods to return a retained object. * Source/NSAnimation.m: Implement the copy and coding methods. * Source/NSImageView.m (-cut:): Use the correct copy method. Fixed issues spotted by the static code analysis. 2011-03-05 Richard Frith-Macdonald * Source/NSHelpManager.m: * Source/GSServicesManager.m: * Source/NSBundleAdditions.m: * Source/NSSpellChecker.m: Avoid calls to non-standard method. 2011-03-05 Fred Kiefer * Source/GSNibLoading.m (NSCustomView): Correct implementation of -initWithCoder: and remove -awakeAfterUsingCoder:. * Source/NSSound.m: Remove method -awakeAfterUsingCoder:. * Source/NSWindow.m (-_captureMouse:, -_releaseMouse:) Add some debug log code here to simplify debugging these methods. 2011-03-04 Fred Kiefer * Headers/AppKit/PSOperators.h * Source/NSFontPanel.m * Source/NSSound.m * Source/NSTextAttachment.m * Source/NSOpenGLPixelFormat.m * Source/GSThemeOpenSavePanels.m * Source/NSTableHeaderCell.m * Source/GSTypesetter.m * Source/NSAlert.m * Source/NSOpenPanel.m * Source/NSImageCell.m * Source/NSManagedObjectContext.h * Source/GSGormLoader.m * Source/NSText.m * Source/NSTokenField.m * Source/NSParagraphStyle.m * Source/NSManagedObjectContext.m * Source/GNUmakefile * Source/NSTableHeaderView.m * Source/NSTextTable.m * Source/NSTextBlock.m * Source/NSFontManager.m * Source/NSFormCell.m * Source/NSLevelIndicator.m * Source/NSMatrix.m * Source/NSTextTableBlock.m * Source/NSObjectController.m * Source/NSOpenGLView.m * Source/NSDataLinkManager.m * Source/GSThemeInspector.m * Source/GSStandardWindowDecorationView.m * Source/NSInputServer.m * Source/NSSplitView.m * Source/NSImageRep.m * Source/NSBezierPath.m * Source/GSTextStorage.h * Source/GSNibLoading.m * Source/NSResponder.m * Source/NSColorWell.m * Source/GSTextStorage.m * Source/NSForm.m * Source/NSApplication.m * Source/GSGuiPrivate.h * Source/NSComboBox.m * Source/NSMovieView.m * Source/NSSavePanel.m * Source/NSMovie.m * Source/GSThemeMenu.m * Source/NSMenuItemCell.m * Source/NSPrinter.m * Source/NSPasteboard.m * Source/NSTextContainer.m * Source/NSButtonImageSource.h * Source/GSToolbarCustomizationPalette.h * Source/NSFontDescriptor.m * Source/GSTrackingRect.m * Source/NSCursor.m * Source/NSPrintOperation.m * Source/GSSlideView.h * Source/NSControl.m * Source/NSInterfaceStyle.m * Source/NSDocumentFrameworkPrivate.h * Source/NSTokenFieldCell.m * Source/GSSlideView.m * Source/NSOpenGLContext.m * Source/NSInputManager.m * Source/NSRulerMarker.m * Source/NSToolbarItemGroup.m * Source/NSProgressIndicator.m * Source/NSLevelIndicatorCell.m * Source/NSTextStorage.m * Source/NSFileWrapper.m * Source/NSDocumentController.m * Source/NSDrawer.m * Source/NSCustomImageRep.m * Source/NSMenuView.m * Source/NSHelpPanel.m * Source/NSComboBoxCell.m * Source/NSSegmentedCell.m * Source/NSStepperCell.m * Source/NSDataLink.m * Source/tiff.m * Source/NSScrollView.m * Source/NSEPSImageRep.m * Source/NSUserDefaultsController.m * Source/NSSegmentedControl.m * Source/GSTable.m * Source/NSKeyValueBinding.m * Source/NSTextList.m * Source/NSEvent.m * Source/NSController.m * Source/NSSelection.m * Source/NSTextField.m * Source/GSToolTips.h * Source/NSToolbarFrameworkPrivate.h * Source/NSAnimation.m * Source/NSSpeechSynthesizer.m: Replace #include -> #import * Source/NSParagraphStyle.m: Use GSClassSwizzle. 2011-03-02 Fred Kiefer * Source/NSImage.m: Remove the -awakeAfterUsingCoder: method as this method was incorrectly implemented and * Source/NSTextAttachment.m (NSTextAttachmentCell-setAttachment:): Release the created icon after setting it as image. 2011-02-28 Richard Frith-Macdonald * Source/NSBitmapImageRep.m: * Source/NSBitmapImageRep+GIF.m: * Source/NSBitmapImageRep+JPEG.m: * Source/tiff.m: Avoid obsolete OBJC_... macros 2011-02-28 Riccardo Mottola * Source/GSLayoutManager.m * Source/GSKeyBindingTable.m Replace objc_malloc with malloc for structures. 2011-02-24 13:15 David Chisnall * libs/gui/trunk/Source/NSDocumentController.m: Comment out unused function. * libs/gui/trunk/Source/NSFontManager.m: Change unsigned int -> int, so that loops terminate with termination condition, rather than SegV * libs/gui/trunk/Source/NSLayoutManager.m: Remove some tests that are always true (NSRange.length > 0 - NSUIntegers are always > 0). * libs/gui/trunk/Source/NSTextBlock.m: Remove some more comparisons testing unsigned values are < 0. * libs/gui/trunk/Source/GSServicesManager.m: get_imp() -> class_getMethodImplementation() (GCC runtime function -> standard runtime function) * libs/gui/trunk/Source/GSTheme.m: More unsigned < 0 tests. * libs/gui/trunk/Source/NSTextView.m: Rename HUGE -> GSHUGE to remove conflict with standard library #define. * libs/gui/trunk/Model/IMLoading.m: Add __attribute__((unused)) on __dummyFunctionForLinking(). 2011-02-22 Eric Wasylishen * Source/NSMenuView.m (-_trackWithEvent:): Quick fix for recent menu tracking changes: release the mouse before invoking the menu's action. 2011-02-22 Eric Wasylishen * Source/externs.m: * Headers/AppKit/NSAttributedString.h: Add NSStrikethroughStyleAttributeName * TextConverters/RTF: Add support for reading and writing underline and strikethrough. 2011-02-22 Eric Wasylishen * Source/NSLayoutManager.m: * Headers/AppKit/NSLayoutManager.h: Preliminary implementation of underlining 2011-02-21 Fred Kiefer * Source/NSMenuView.m (-trackWithEvent:): Rewrite that uses mouse capture to ensure we get mouse events outside our windows. Patch by Christopher Armstrong 2011-02-20 Fred Kiefer * Source/NSWindow.m, * Source/NSControl.m, * ColorPickers/GSStandardColorPicker.m, * ColorPickers/GSWheelColorPicker.m, * Source/GSXibLoader.m: Fix memory leaks found by analyser. 2011-02-20 Fred Kiefer * Headers/Additions/GNUstepGUI/GSFusedSilica.h, * Source/GSFusedSilicaContext.h, * Source/GSFusedSilicaContext.m, * Source/GSFusedSilica.m: Remove these files as they are obsolete now. The Opal library is a more complete replacement for CoreGraphics. * Source/GNUmakefile, * Source/DocMakefile, * Source/NSFont.m: Remove references to GSFusedSilica. 2011-02-20 Fred Kiefer * Source/NSScreen.m, * Source/NSWindow.m, * Source/NSToolbar.m, * Source/NSScroller.m, * Source/NSTextView.m: Remove direct usage of isa. * Source/GSBindingHelpers.h: Replace #include with #import. 2011-02-19 Richard Frith-Macdonald * Tests/GNUmakefile: Run/clean tests * Tests/gui: Imported from testsuite 2011-02-15 Fred Kiefer * Headers/Additions/GNUstepGUI/GSDisplayServer.h, * Source/GSDisplayServer.m (-recolorcursor:::, -recolorcursor:::) (-setcursor:, -freecursor:): New backend methods replacing -setcursorcolor:::. * Source/NSCursor.m, * Source/GSDragView.m: Use new cursor methods. 2011-02-15 Fred Kiefer * Source/NSWindow.m (-setContentView:): Revert Wolfgangs change and add a different solution as explained in his mail. 2011-02-14 Wolfgang Lux * Source/NSApplication.m (-_initDefaults): * Source/NSWindow.m (-_initDefaults): Add user default to allow placing app icons and mini windows at normal window level. This is particularly convenient with some window managers (*cough*, kwin) where application and pop up menus are obscured by dock level windows. 2011-02-14 Wolfgang Lux * Source/NSWindow.m (-setContentView:): Fix bug where a stray view could leak when changing the content view of a window. This view then could make the title bar buttons inaccessible when -gui handles window decorations. 2011-02-14 Wolfgang Lux * Source/NSTabViewItem.m (-init, -initWithItemIdentifier:): Create a default content view for new tab view items. Compatible with Apple. 2011-02-14 Fred Kiefer * Source/NSOutlineView.m (-editColumn:...select:): Bring closer to the new code in [-drawRow:clipRect:]. * Source/GSInfoPanel.m (-initWithDictionary:): Protect against icon being nil. 2011-02-14 Fred Kiefer * Source/NSCursor.m, * Source/GSDragView.m, * Source/GSMemoryPanel.m: Fix Use-after-release found by static analyser. 2011-02-10 German Arias * Source/GSGormLoader.m (+initialize): Load the app icon here, at launch time, since GSGormLoader is initialized before call -finishLaunching in NSApp (In non document-based apps that load a gorm file at launch). So the windows and panels at initial gorm file don't show the app icon (bug #31039). 2011-02-10 German Arias * Source/GSGormLoading.m (-awakeWithContext:): Call directly the method -orderFront: on visible windows, since this works fine here, instead put these windows into _inactive list. This solve the problem of menu in window in non document-based apps and the problem with the outlet "initialFirstResponder" on gorm files. 2011-02-09 Fred Kiefer * Source/GSInfoPanel.m, * Source/GSTextStorage.m, * Source/GSThemeInspector.m, * Source/NSBrowser.m, * Source/NSImage.m, * Source/NSMenuView.m, * Source/NSPageLayout.m, * Source/NSSpellChecker.m, * Source/NSStringDrawing.m, * Source/NSTableHeaderView.m, * Source/NSTableView.m, * Source/NSWindow.m, * Tools/gclose.m, * Tools/make_services.m: Remove dead assignments found by static code analysis. 2011-02-09 Richard Frith-Macdonald * Source/NSEvent.m: Avoid unneccessary creation/destruction of NSDate instances during periodic events. 2011-02-08 Riccardo Mottola * Source/NSBitmapImageRep+PNG.m: Tweak png.h header order to avoid problems on some systems. 2011-02-08 Riccardo Mottola * Source/NSBitmapImageRep+PNG.m: Cleaned up includes so that compilation without PNG works again. * configure.ac: Use libpng-config to determine the correct includes and libraries. * configure: regenerated. 2011-02-07 Fred Kiefer * Printing/*: Clean up all the header includes. 2011-01-31 Fred Kiefer * Headers/AppKit/NSBrowser.h, * Source/NSBrowser.m: Add method -scrollRowToVisible:inColumn: 2011-01-29 Fred Kiefer * Source/NSBitmapImageRep+PNG.m (_initBitmapFromPNG:): Use function to check whether gamma is valid. Patch by Thomas Klausner. 2011-01-27 Wolfgang Lux * Source/NSApplication.m (-terminate:): Send message to the document controller to let the user review any unsaved changes in its managed documents before asking the application delegate whether its okay to terminate the application. This matches Cocoa's documented and implemented behavior. * Source/NSApplication.m (-terminate): Move call to GSRemoveIcon from here ... * Source/NSApplication.m (-replyToApplicationShouldTerminate:): ... to here to ensure that the app icon is removed from the icon manager even when the delegate delays application termination. 2011-01-26 Wolfgang Lux * Headers/AppKit/NSWindow.h: Add missing declaration of the -isZoomed method. 2011-01-24 Wolfgang Lux * Source/NSWindowController.m (-_windowDidLoad): Move code to set the autosave name of the window's frame from here ... * Source/NSWindowController.m (-setWindow:): ... to here to match Cocoa behavior (cf. Apple's AppKit release notes for OS X 10.5). 2011-01-24 Doug Simons * Source/NSSearchFieldCell.m (-trackMouse:inRect:ofView:untilMouseUp:): Pass mouseDown event to the field editor when click is in the field, to select at the correct point in the text. 2011-01-24 Wolfgang Lux * Source/NSWindow.m (-setFrameFromString:, -stringWithSavedFrame): Do not include an in-window menu in a window's saved frame either. 2011-01-24 Fred Kiefer * Headers/AppKit/NSViewController.h, * Source/NSViewController.m: Add loading of NIB. * Headers/AppKit/NSObjectController.h: Use version constant names. 2011-01-24 Wolfgang Lux * Source/NSWindow.m (-setFrameFromString:, -stringWithSavedFrame): Merge change from the testplant_1 branch: Do not include the toolbar in a window's saved frame. Makes saving and restoring window frame sizes independent of whether the toolbar is present at the time when the frame is saved or restored. Patch by Doug Simons 2011-01-24 German Arias * Source/NSMenuView.m (-trackWithEvent:): Fixed problems with transient menus and PopUp (pulls-down) with Windows95 interface style. 2011-01-20 Wolfgang Lux * Source/NSColorList.m (+availableColorLists): Make sure the system colors are set up properly before computing the available color lists. Fixes an issue where the returned list would either be empty or contain two instances of the system color list. 2011-01-20 Richard Frith-Macdonald * Source/NSWorkspace.m: check on-disk cache at regular intervals ... somehow that got lost at some point. Also tidy up a few coding standards violations which crept in. 2011-01-19 Doug Simons * Source/NSSearchFieldCell.m (-_openPopup:): Switch to use an actual NSPopUpButtonCell when popping up the menu. Handle selected item in search menu properly. (-_searchForRecent:): Display and select search text after user selects a recent search term. (-drawWithFrame:inView:, -textDidChange:, -clearSearch:): Only show cancel button when field is not empty. 2011-01-17 Wolfgang Lux * Source/NSApplication.m (-sendEvent:): * Source/NSMenu.m (-performKeyEquivalent:): Look up key equivalents in the Services menu only after traversing the rest of the main menu to avoid accidentally shadowing key equivalents in the application's own menus. 2011-01-17 Wolfgang Lux * ColorPickers/GSWheelColorPicker.m (-regenerateImage): Fix to correctly display color wheel image on big endian machines. 2011-01-16 00:32-EST Gregory John Casamento * Source/NSApplication.m: Added overide for orderWindow:relativeTo: in NSIconWindow. Check for GSSuppressAppIcon and order the window ONLY if the app icon window is supposed to be displayed, otherwise do not do anything with it. I observed issues with this functionality while testing the GNOME theme the app icon would periodically show even when the default mentioned above was set to YES. 2011-01-15 23:50-EST Gregory John Casamento * Source/NSMenuView.m: Fix to previous change to [NSMenuView trackWithEvent:]. Assign attachedMenu to local variable and test for nil prior to entering the code to close the menu when tracking the mouse for normal menus. Previous version of this code was causing menu items owned by pull downs (NSPopUpButton) to close prior to mouse up event. 2011-01-15 German Arias * Source/NSWindow.m: * Source/NSSavePanel.m: Reverted latest changes. * Source/NSMenuView.m: Added the appropriate code to close the menu after select an option, but before do the instructions of the selected option. * Headers/AppKit/NSApplication.h: * Source/NSApplication.m: Save the main window when the app is hidden or when is deactivated. 2011-01-15 Wolfgang Lux * Source/NSColorWell.m (-activate:): Deactivate an active color well when the user closes the color panel. 2011-01-15 Wolfgang Lux * Headers/AppKit/NSColorList.h: * Headers/AppKit/NSColorPanel.h: * Source/NSColorList.m (-insertColor:key:atIndex:, -removeColorWithKey:, -setColorForKey:): * Source/NSColorPanel.m (-setColor:): * Source/NSColorWell.m (-activate:): * Source/NSWindow.m (-initWithContentRect:styleMask:backing:defer:): * Source/externs.m(NSColorListDidChangeNotification, NSColorPanelColorDidChangeNotification): Rename notifications to match Cocoa (and OpenStep). 2011-01-15 Wolfgang Lux * Source/NSApplication.m (-rightMouseDown:): * Source/NSApplication.m (-_dockMenu): Provide a default context menu for application icons when using Macintosh or Windows 95 style menus. Inspired by OS X, the menu contains items to hide or show the application, to terminate the application, an item for each window present in the application's window menu, and the items of the dock menu returned by the application delegate. * Headers/AppKit/NSApplication.h: Update documentation to note that the -applicationDockMenu: delegate method now may be called on GNUstep. * Resources/English.lproj/Localizable.strings: * Resources/German.lproj/Localizable.strings: Update. Also add a few more German translations. 2011-01-15 Wolfgang Lux * Source/NSApplication.m (-changeWindowsItem:title:filename): Insert window menu items strictly at the bottom of the menu, keeping only items with actions -performMiniaturize: and -performClose: beneath them. This allows having additional items at the top of the menu and works better for window menus that follow the Mac OS X UI guidelines and have miniaturize and zoom commands at the top and arrange in front below them. 2011-01-09 21:58-EST Gregory John Casamento * Source/NSSavePanel.m: (-_initWithoutGModel): added code near the and to close the current menu when in Win95 mode. If this doesn't happen the menu remains open and allows the user to drag the window around while the menu remains in it's old position. 2011-01-09 German Arias * Source/NSApplication.m (-activateIgnoringOtherApps:): If we have menu in window, set a main window when unhide. * Source/NSWindow.m (-resignMainWindow): Close the menu in window if resign main window. 2011-01-08 German Arias * Source/NSMenuView.m (-trackWithEvent:): Close the menu in window if user press a modifier key. And improvements for don't lose the mouse tracking in a menu in window. 2011-01-06 German Arias * Source/NSMenuView.m (-locationForSubmenu:, -trackWithEvent:): Fixed the tracking of mouse at horizontal menu. 2011-01-04 Doug Simons * Source/NSSearchFieldCell.m: Fix cancel button to correctly clear the field and send action. Fix -textDidChange: to correctly send action rather than popping up the menu on each keystroke (when sendsWholeSearchString is false). 2011-01-04 Wolfgang Lux * Source/tiff.m (NSTiffWrite): Fix long standing bug where incorrect data was written out for RGB images if bits per sample != 8. 2011-01-03 Wolfgang Lux * Source/GNUmakefile: * Headers/Additions/GNUstepGUI/GSHelpAttachment.h: * Source/GSHelpAttachment.m: Introduce new classes GSHelpLinkAttachment and GSHelpMarkerAttachment to implement help links and markers in RTF documents. * TextConverters/RTF/rtfGrammar.y: * TextConverters/RTF/RTFConsumerFunctions.h: * TextConverters/RTF/RTFConsumer.m (-addHelpLink:marker:, -addHelpMarker:, GSRTFNeXTHelpLink, GSRTFNeXTHelpMarker): Create attachments for help links and markers in RTF documents. * TextConverters/RTF/RTFProducer.m (-_addAttributesString:): Properly write out help links and markers to RTF documents. * TextConverters/RTF/rtfGrammar.tab.h: * TextConverters/RTF/rtfGrammar.tab.c: Regenerated. * Images/GNUmakefile: * Images/common_HelpLink.tiff: New icon for help link attachments. * Source/NSFileWrapper.m (-icon): Bug fix: Don't return a default icon for a wrapper without a file name. 2011-01-03 Wolfgang Lux * TextConverters/RTF/rtfGrammar.y: * TextConverters/RTF/rtfScanner.c (RTFCommands): Extend and modify grammar to handle \NeXTHelpLink and \NeXTHelpMarker commands possibly used in old RTF documents generated on NeXTstep/OpenStep. 2011-01-03 Wolfgang Lux * TextConverters/RTF/rtfGrammar.y: * TextConverters/RTF/RTFConsumerFunctions.h: * TextConverters/RTF/RTFConsumer.m (GSRTFerror): Upgrade to compile with more recent bison versions. * TextConverters/RTF/GNUmakefile: * TextConverters/RTF/GNUmakefile.postamble: * TextConverters/RTF/rtfGrammar.y: * TextConverters/RTF/rtfScanner.c: Correct spelling (rtfGrammer->rtfGrammar). * TextConverters/RTF/GNUmakefile.postamble: Update rationale why bison rule is (still) not enabled. * TextConverters/RTF/rtfGrammar.tab.h: * TextConverters/RTF/rtfGrammar.tab.c: Regenerated. 2011-01-03 Wolfgang Lux * Source/NSMatrix.m (-setEnabled:): Implement method. It enables or disables all cells as in Cocoa. 2011-01-01 Wolfgang Lux * Source/NSTextAttachment.m (-trackMouse:inRect:ofView:...): Call the deprecated OpenStep delegate methods if the delegate does not implement the new Mac OS X methods. 2011-01-01 Wolfgang Lux * Source/NSTextView.m (-mouseDown:): Add missing conversion from character indexes to glyph indexes when computing an attachment cell's frame. 2011-01-01 Wolfgang Lux * Source/NSLayoutManager.m (attachmentSize): Prevent potential null pointer dereference. 2011-01-01 Wolfgang Lux * Source/NSTextStorage.m (-removeLayoutManager:): Avoid potential crash when text network is owned by a text view. 2010-12-31 Fred Kiefer * Source/GSToolbarView.m (initSystemExtensionsColors): Remove this function and the NSColor extensions as these no longer get used. The colours for NSToolbar are handled by GSTheme. 2010-12-30 Wolfgang Lux * Source/NSMenuView.m (-locationForSubmenu:): Fix submenu placement for WindowMaker interface style (it was off by 1 pixel). 2010-12-30 Wolfgang Lux * Source/NSMenuView.m (-trackWithEvent:): Make pop up menus in Macintosh menu style behave more similar to OS X. In particular, when the user clicks the button, the menu stays open until the next click. 2010-12-30 Wolfgang Lux * Source/NSMenuView.m (-update): Don't use a title bar for menus in Macintosh interface style. * Source/NSMenuView.m (_executeItemAtIndex:removeSubmenu:): End menu tracking in Macintosh and Windows95 interface styles when the user clicks on a submenu item. * Source/NSMenu.m (-displayTransient): Place the top left edge of a menu at the mouse position when displaying a context menu in Macintosh and Windows95 interface styles to prevent a user from accidentally selecting the first menu item. * Source/NSMenu.m (-shiftOnScreen): Don't move the main menu bar in Macintosh interface style. 2010-12-30 Wolfgang Lux * Source/NSToolbar.m (-runCustomizationPalette:): * Source/NSWindow.m (-validateUserInterfaceItem:): Don't show the customization palette if user customization is disabled. 2010-12-30 Fred Kiefer * Source/NSLayoutManager.m: Add code to handle temporary attributes. This code is taken from NSAttributedString and the two core methods are still missing. 2010-12-29 12:31-EST Gregory John Casamento * Source/NSMenuItemCell.m: Implement drawing a line in the menu separator item for the Windows95 and Mac modes. 2010-12-29 Wolfgang Lux * Source/NSTextView.m (-_updateDragTargetLocation:operation:, -draggingEntered:, -draggingUpdated:, -draggingExited:, -prepareForDragOperation:): Rewrite implementation so that the target view is scrolled even when it does not accept the drag operation. This is useful, e.g., when a subclass considers parts of the text read only and does not accept a drop in those regions. 2010-12-29 Wolfgang Lux * configure.ac: * Headers/Additions/GNUstepGUI/config.h.in: Add test for getmntinfo(3). * Source/NSWorkspace.m (-mountedLocalVolumePaths): Provide more portable implementation based on getmntinfo(3), which is available on many systems. Also a Solaris compatibility fix. * Source/NSWorkspace.m (-getFileSystemInfoForPath:...): Tentative implementation for system with a statfs system call. * configure: Regenerated. 2010-12-29 Wolfgang Lux * Source/NSWorkspace.m(GSWorkspacePreferencesChanged, -init, -findApplications, -setBestApp:inRole:forExtension:, -setBestIcon:forExtension:, -setBestApp:inRole:forScheme:, _workspacePreferencesChanged:): Introduce (private) workspace notification to propagate changes of the application or icon associated with a file type and URL scheme, respectively. 2010-12-29 Wolfgang Lux * Source/NSDocument.m (-runModalSavePanel:withAccessoryView:): Make sure the file name displayed in the panel has a valid extension. 2010-12-27 16:51-EST Gregory John Casamento * Source/GSThemeMenu.m: Changes for compiling with older compilers. * Source/GSWindowDecorationView.m: Move the view up a little. * Source/NSMenuItemCell.m: Experimental changes for drawing separator items. 2010-12-27 Fred Kiefer * Source/NSSearchField.m, * Source/NSSearchFieldCell.m: Some coding standard changes. 2010-12-27 Fred Kiefer * Source/GSDragView.m: Check whether the drag source supports methods before calling them. 2010-12-27 Nicola Pero * Source/NSGraphicsContext.m ([-subclassResponsibility:]): Use sel_getName instead of sel_get_name. 2010-12-27 Nicola Pero * Source/NSBezierPath.m ([-encodeWithCoder:], [-initWithCoder:]): Explicitly encode/decode NSBezierPathElement as 'int' to work across compiler versions. * Source/NSBox.m ([-encodeWithCoder:], [-initWithCoder:]): Same for NSBorderType and NSTitlePosition. * Source/NSEvent.m ([-encodeWithCoder:], [-initWithCoder:]): Same for NSEventType. * Source/NSFileWrapper.m ([-encodeWithCoder:], [-initWithCoder:]): Same for GSFileWrapperType. * Source/NSImageCell.m ([-encodeWithCoder:], [-initWithCoder:]): Same for NSImageAlignment, NSImageFrameStyle, NSImageScaling, * Source/NSParagraphStyle.m ([-initWithCoder:], [-encodeWithCoder:]): Same for NSTextAlignment, NSLineBreakMode and NSTextTabType. * Source/NSResponder.m ([-encodeWithCoder:], [-initWithCoder:]): Same for NSInterfaceStyle. * Source/NSScrollView.m ([-encodeWithCoder:], [-initWithCoder:]): Same for NSBorderType. * Source/NSTabView.m ([-encodeWithCoder:], [-initWithCoder:]): Same for NSTabViewType. * Source/NSTabViewItem.m ([-encodeWithCoder:], [-initWithCoder:]): Same for NSTabState. * Source/NSWindow.m ([-encodeWithCoder:], [-initWithCoder:]): Same for NSBackingStoreType. 2010-12-27 02:12-EST Gregory John Casamento * Source/GSThemeMenu.m: Added implementation for updateAllWindowsWithMenu:, updateMenu:forWindow:, altered implementation for setMenu:forWindow:, added private method _setMenu: to set the current menu on the window. * Source/GSWindowDecorationView.m: Changes to layout * Source/NSMenu.m: Only call the method updateAllWindowsWithMenu: when NSMenuInterfaceStyle = NSWindows95InterfaceStyle. * Source/NSMenuView.m: Change to -update so that it does not render the top bar of the menu if NSMenuInterfaceStyle = NSWindows95InterfaceStyle. 2010-12-23 Fred Kiefer * Source/NSEvent.m (-deltaX, -deltaY, -deltaZ): Don't raise an exception when called on the wrong type of event. 2010-12-22 Fred Kiefer * Headers/AppKit/NSView.h, * Source/NSView.m: Add the 10.5 coordinate transformation methods. 2010-12-22 Fred Kiefer * Headers/AppKit/NSDragging.h, * Headers/AppKit/NSTableView.h, * Headers/Additions/GNUstepGUI/GSDragView.h, * Source/NSImageView.m, * Source/NSColorWell.m, * Source/NSSavePanel.m, * Source/NSTextView.m, * Source/NSToolbarItem.m, * Source/NSTableView.m, * Source/GSDragView.m: Correct the definition of NSDragOperation and all its usages. 2010-12-17 Doug Simons * Source/NSSearchFieldCell.m: Set search menu 'ownedByPopup' to make it work on Windows. 2010-12-14 Riccardo Mottola * Source/NSWorkspace.m * Images/GNUmakefile * Images/common_MusicFolder.tiff Added icon for the Music folder. 2010-12-13 Fred Kiefer * Headers/Additions/GNUstepGUI/GSLayoutManager_internal.h, * Headers/Additions/GNUstepGUI/GSLayoutManager.h, * Source/GSLayoutManager.m (-intAttribute:forGlyphAtIndex:) (-setIntAttribute:value:forGlyphAtIndex:): Implement glyph attribute handling. 2010-12-13 Jonathan Gillaspie * Source/NSMenuView.m: Prevent trying to retrieve a menuCell that is out of range. 2010-12-09 Wolfgang Lux * Source/NSMatrix.m (-setState:atRow:column:): Fix bug where the old selected cell wasn't properly deselected when the matrix's mode is NSRadioMatrixMode. 2010-12-09 Wolfgang Lux * Source/NSLayoutManager.m (-rectArrayForGlyphRange:...): Clip the rectangle computed for the last line to the line fragment's used rectangle if the line doesn't end with a newline (or other invisible character). This better matches Apple's implementation. 2010-12-07 Riccardo Mottola * Images/common_SwitchOff.tiff * Images/common_SwitchOn.tiff Match NeXT 15x15 dimension and tweak the check alpha. 2010-12-07 Wolfgang Lux * Source/NSApplication.m (-finishLaunching): Don't make an invisible window main window when the application has no main window. 2010-12-07 Wolfgang Lux * Source/NSWindow.m (-sendEvent:): Allow any window that responds YES to -worksWhenModal to become key in a modal session. 2010-12-06 Riccardo Mottola * Source/NSWorkspace.m * Images/common_Desktop.tiff * Images/GNUmakefile Added handling of a Desktop icon (and added the icon itself). 2010-11-27 Gregory John Casamento * Source/GSThemeDrawing.m: Added methods to draw NSTableView header and view. * Source/NSTableView.m: Added call in to drawing methods in GSTheme. * Headers/Additions/GNUstepGUI/GSTheme.h: Added declaration for new method. 2010-11-27 Gregory John Casamento * Source/GSThemeDrawing.m: Added methods to draw NSTableHeaderView drawTableHeaderRect:inView:. * Source/NSTableHeaderView.m: Added call in to drawing methods in GSTheme. * Headers/Additions/GNUstepGUI/GSTheme.h: Added declaration for new method. 2010-11-27 Riccardo Mottola * Source/GSThemeDrawing.m: Revert color well thickness. If desired, this should go in a theme. 2010-11-27 Wolfgang Lux * Source/NSDocument.m (-setPrintInfo:): Record old print info with the document's undo manager (if there is one) as in Cocoa. 2010-11-26 Gregory John Casamento * Source/GSThemeDrawing.m: Added methods to draw NSTableHeaderCell view. * Source/NSTableHeaderCell.m: Added call in tableHeaderCellDrawingRectForBounds: to drawing methods in GSTheme. * Headers/Additions/GNUstepGUI/GSTheme.h: Added declaration for new method. 2010-11-26 Gregory John Casamento * Source/GSThemeDrawing.m: Added methods to draw NSSliderCell view. * Source/NSSliderCell.m: Added call in drawKnobInCell:... and drawBarInside:.. to drawing methods in GSTheme. * Headers/Additions/GNUstepGUI/GSTheme.h: Added declaration for new method. 2010-11-26 Gregory John Casamento * Source/GSThemeDrawing.m: Added method to draw NSScrollView view. * Source/NSScrollView.m: Added call in drawRect: to new drawing method in GSTheme. * Headers/Additions/GNUstepGUI/GSTheme.h: Added declaration for new method. 2010-11-26 Gregory John Casamento * Source/GSThemeDrawing.m: Added method to draw NSBrowser view. * Source/NSMenuView.m: Added call in drawRect: to new drawing method in GSTheme. * Headers/Additions/GNUstepGUI/GSTheme.h: Added declaration for new method. 2010-11-26 Gregory John Casamento * Source/GSThemeDrawing.m: Added method to draw NSBrowser view. * Source/NSBrowser.m: Added call in drawRect: to new drawing method in GSTheme. * Headers/Additions/GNUstepGUI/GSTheme.h: Added declaration for new method. 2010-11-26 Gregory John Casamento * Source/GSThemeDrawing.m: Added method to draw NSScroller view. * Source/NSScroller.m: Added call in drawRect: to new drawing method in GSTheme. * Headers/Additions/GNUstepGUI/GSTheme.h: Added declaration for new method. 2010-11-26 Gregory John Casamento * Source/GSThemeDrawing.m: Added method to draw tab view. * Source/NSTabView.m: Added call in drawRect: to new drawing method in GSTheme. * Headers/Additions/GNUstepGUI/GSTheme.h: Added declaration for new method. 2010-11-26 Wolfgang Lux * Source/NSWindow.m (-performClose:): Do not discard close requests for a window in a modal session when the window has -worksWhenModal==YES. 2010-11-22 Wolfgang Lux * Source/NSTextView_actions.m (-deleteBackward:): Add missing assignment to update the typing attributes. 2010-11-16 Doug Simons * Source/GSThemeDrawing.m: Make border of NSColorWell smaller to more closely match Cocoa metrics. This makes a big difference in small color wells. 2010-11-16 Doug Simons * Source/NSDrawer.m: Ensure drawer is visible if parent window became visible since the drawer was opened. 2010-11-13 Riccardo Mottola * Images/common_DownloadFolder.tiff * Images/GNUmakefile Added new icon * Source/NSWorkspace.m Cache folders and their assdociation with icon names in dictionaries. 2010-11-11 Riccardo Mottola * Images/common_ImageFolder.tif * Images/common_DocsFolder.tif * Images/GNUmakefile Added new icons * Source/NSWorkspace.m Handling of icons for folders of type document, image, system and library. 2010-11-11 Riccardo Mottola * Images/common_LibraryFolder.tif * Images/common_GSFolder.tif * Images/GNUmakefile Added new icons 2010-11-03 Fred Kiefer * Headers/Additions/GNUstepGUI/GSTheme.h: Add method doesProcessEventsForPopUpMenu to avoid compiler warnings. * Headers/AppKit/NSLayoutManager.h, * Source/NSLayoutManager.m: Change a few "unsigned int" into NSUInteger to avoid compiler warnings. * Source/NSTextView.m (firstRectForCharacterRange:): Adopt to these changes. 2010-11-03 Fred Kiefer * Source/NSWindow.m (-validRequestorForSendType:returnType:): Don't forward this method if the delegate is a NSResponder. Patch by Georg Fleischmann . 2010-11-03 Quentin Mathe * Source/NSPopUpButtonCell.m (-initWithCoder:): Fixed broken selection with keyed unarchiver. -selectMenuItem: was given a nil item because the menu was not yet unarchived. Removed setAutoenableItems: and -setEnabled: use to match Cocoa doc and IB behavior. By default, -autoenableItems is YES and is archived by the menu. A popup can be disabled and archived as such. 2010-11-02 Jonathan Gillaspie * Source/NSView.m: Added some basic santity checkts that the views are in windows when converting rectangles. 2010-10-31 Quentin Mathe * Source/NSOpenPanel.m (-runModal): Added. NSOpenPanel overrides NSSavePanel version to take in account -allowedFileTypes as documented in Cocoa. 2010-10-30 German Arias * Documentation/GNUmakefile: Changes in some files names to correspond with the files provided in the Documentation directory. 2010-10-29 Doug Simons * Source/GSThemeMenu.m * Source/NSPopUpButtonCell.m Added theme method to identify themes that handle event processing for PopUp (and PullDown) menus. Use that to prevent duplicate event handling in NSPopUpButtonCell. This fixes a problem with actions getting sent twice on Windows with the WinUXTheme. 2010-10-25 Doug Simons * Source/GSToolbarCustomizationPalette.m: GSToolbarCustomizationView needs to retain its list of palette items. 2010-10-24 Riccardo Mottola * Source/NSTextView.m Fixed some c99-isms 2010-10-22 David Chisnall * Source/NSTextView.m * Source/GSToolTips.h * Source/GSToolTips.m Fixed the point argument to -view:stringForToolTip:point:userData: (should be relative to the tracking rectangle, was relative to the window). Added support for displaying tooltips from NSToolTipAttributeName attributes in NSTextView. 2010-10-20 German Arias * Resources/Spanish.lproj/Localizable.strings: Added translation for string "Separator". 2010-10-19 Doug Simons * Source/NSPasteboard.m: Changed lock to recursive to prevent deadlock issue (at least on Windows). Also added missing lock on one access to the dictionary. Improved +generalPasteboard to retain instance as long as possible (previously it would get released with each autorelease pool, which happened multiple times on each call to [NSMenu update] for just one example). 2010-10-18 Wolfgang Lux * Headers/AppKit/NSWorkspace.h: * Source/NSWorkspace.m (urlPrefsPath, urlPreferences, +initialize, -openURL:, -findApplications, -infoForScheme:, -getBestAppInRole:forScheme:, -setBestApp:inRole:forScheme:, -_scheme:role:app:): Add methods to manage the user's preferred applications for URL schemes to NSWorkspace. 2010-10-17 Fred Kiefer * Source/NSMenuView.m: Revert the WinUX theme specific patch Doug put in some time ago. 2010-10-16 Wolfgang Lux * Source/NSWorkspace.m (-_iconForExtension:): Fix bug where the user's preferred applications were ignored because the code did attempt to look them up in the wrong place. 2010-10-13 Fred Kiefer * Headers/Cocoa/Cocoa.h: Add one more protection around definition of BOOL. 2010-10-13 Wolfgang Lux * Source/NSApplication.m (-finishLaunching): Open a new document in a document based application when the delegate responds YES to applicationShouldOpenUntitledFile: but does not implement applicationOpenUntitledFile:. 2010-10-08 Wolfgang Lux * Source/NSWindowController.m (-window): Send windowControllerWillLoadNib: and windowControllerDidLoadNib: to the owner of the nib, since this is what Apple seems to do and since this behavior is more useful when a non-document class uses a window controller. 2010-09-27 Quentin Mathe Fixed NSOutlineView to use incremental loading as Mac OS X does. You can now use an outline view to browse a big tree structure e.g. a filesystem. Previously in such a case, NSOutlineView was attempting to traverse the entire directory structure on -reloadData. * Source/NSOutlineView.m (-reloadData:): Removed a redundant _loadDictionaryStartingWith:atLevel: call, _openItem: now does it. (-_loadDictionaryStartingWith:atLevel:): Modified to load the children only if the item is expanded. (_openItem:): Modified to call _loadDictionaryStartingWith:atLevel: when the item children are not loaded. 2010-09-25 Wolfgang Lux * Source/NSFontManager.m (-orderFrontFontPanel:): Add method to NSApplication in a new category to make the standard font panel toolbar item work. 2010-09-24 Fred Kiefer * Source/NSButton.m (-keyDown:): Remove unused code found by static analyser. * Source/NSColor.m (-colorUsingColorSpace:): Add missing break statements. * Source/NSColor.m (initSystemColors): Remove unused variable. 2010-09-24 Fred Kiefer * Source/NSView.m (-_viewWillMoveToWindow:): When calling [-releaseGState] make sure to keep the value of _allocate_gstate. 2010-09-16 Fred Kiefer * Source/NSView.m (-resizeWithOldSuperviewSize): Remove unneeded local varibales. * Source/NSView.m (-bitmapImageRepForCachingDisplayInRect:): Create the image rep with [-initWithFocusedViewRect:], that way it will better map to the following -cacheDisplayInRect:... call. Also don't leak the image. * Source/NSView.m (-cacheDisplayInRect:...): Don't leak the image rep. * Source/NSView.m (-_subtreeDescriptionWithPrefix:): Don't leak the returned string. 2010-09-15 German Arias * Panels/Spanish.lproj/GSPrintPanel.gorm: Changed the width of a label. 2010-09-15 Eric Wasylishen * Source/NSParagraphStyle.m: * Source/NSPopUpButton.m: * Source/NSMenuItemCell.m: * Source/NSFont.m: Fix more unsigned int / ints that should be NSUInteger/NSInteger 2010-09-15 Eric Wasylishen * Source/GSTextStorage.m: Fix an unisgned->NSUInteger 2010-09-15 Fred Kiefer * Source/NSView.m (-releaseGState): Check if the window and it's gstate exist before undefining the gstate. Patch by Georg Fleischmann . * Source/NSView.m (-_viewWillMoveToWindow:): Call [-releaseGState]. 2010-09-13 Riccardo Mottola * Source/NSBitmapImageRep+JPEG.m: remove useless double statement * Source/tiff.m: remove unused variable and assignment 2010-09-12 German Arias * Panels/Spanish.lproj/GSFindPanel.gorm: Fixed a misspelling. * Source/NSFontPanel: Changed the width of size's column to permit a correct internationalization (in other languages "size" is written with more than 4 characters). 2010-09-12 Fred Kiefer * Source/NSApplication.m (+detachDrawingThread:...): Correct the creation of the NSInvocation. * Source/NSTableView.m (-mouseDown:): Free the auto release pool and the create object when returning out of the method. * Source/NSButtonCell.m (-encodeWithCoder:): Free the temporary NSButtonImageSource. * Source/NSCachedImageRep.m (-draw): Free the temporary NSBitmapImageRep. * Source/NSComboBoxCell.m (-initWithContentRect:...): Free the NSScrollView, the NSTableColumn and the NSCell. * Source/NSComboBoxCell.m (-textDidChange:): Free the temporary string. * Source/NSDataLinkPanel.m (+sharedDataLinkPanel): Free the controller but keep the panel. * Source/NSImage.m (-initWithIconHandle:, -initWithBitmapHandle:): Restructure initialisation order. * Source/NSLayoutManager.m (-rulerMarkersForTextView:...): Don't leak the created marker. * Source/NSMenu.m (-copyWithZone:): Don't leak the copied menu items. * Source/GSThemeInspector.m (-update:): Release the views after adding them to the hierarchy. * Source/GSToolbarView.m (initSystemExtensionsColors): Don't leak the colors dictionary. * Source/GSToolbarCustomizationPalette.m (-paletteItemsWithToolbarItems:): Release the copied toolbar items. 2010-09-09 Eric Wasylishen * Source/GSTheme.m: * Source/NSMenu.m: * Source/NSWindow.m: * Source/NSObjectController.m: * Source/NSImageView.m: * Source/NSResponder.m: * Source/NSApplication.m: * Source/NSComboBox.m: * Source/NSTextView.m: * Source/NSDocumentController.m: * Source/NSDocument.m: Replace sel_eq with sel_isEqual 2010-09-06 German Arias * Panels/Spanish.lproj/GSFindPanel.gorm: Fixed a misspelling. 2010-09-06 German Arias * Panels/Spanish.lproj/GSFindPanel.gorm: * Resources/Spanish.lproj/Localizable.strings: Added find panel in spanish. 2010-09-03 Quentin Mathe * Headers/AppKit/NSView.h: * Source/NSView.m: * Source/NSClipView.m: * Source/NSScrollView.m: * Source/NSSplitView.m: Replaced _rFlags.flipped_view use with -isFlipped and deprecated _rFlagsType.flipped_view. Still needs some work to automatically invalidate coordinates when the flipping changes e.g. between two drawing sessions. 2010-09-02 Doug Simons * Source/NSPopUpButtonCell.m: Fix problem with pull-down menu not allowing same item to be selected twice in a row. Also correct setAltersStateOfSelectedItem: to work as described in the Cocoa docs (states were reversed). 2010-08-30 Doug Simons * Source/NSPopUpButtonCell.m: Fix problem of pulldown action not being called with correct cell selected (possibly only a problem for Mac nib files?). * Source/NSMenuView.m: Fix problem of pulldown action getting invoked twice on Windows. 2010-08-30 Wolfgang Lux * Source/NSTableView.m (computeNewSelection): Fix bug where the _selectedRow attribute could be updated incorrectly. 2010-08-29 Fred Kiefer * Headers/AppKit/NSLayoutManager.h, * Source/NSLayoutManager.m: Correction of the declarations for the methods to handle temporary attributes. 2010-08-29 Fred Kiefer * Source/GSGModelLoader.m: Add hack to get GModel loading working again. * Source/GSGormLoader.m: Remove an astray semicolon. 2010-08-27 Wolfgang Lux * Source/NSOutlineView.m (-collapseItem:collapseChildren:, -expandItem:expandChildren:, -reloadItem:reloadChildren:, -_closeItem:, -_openItem:, -removeChildren:): Update the selected row indexes after collapsing or expanding an item. This fixes bug #29892. * Source/NSOutlineView.m (-_noteNumberOfRowsChangedBelowItem:by:): New helper method. * Source/NSOutlineView.m (-collapseItem:collapseChildren:): Collapse children before their parent item. Necessary to ensure that the selected row indexes are valid when a notification is posted. 2010-08-25 Eric Wasylishen * KeyBindings/DefaultKeyBindings.dict: Uncomment some key bindings which are now implemented. (e.g. Shift-Home, Shift-End) 2010-08-23 Eric Wasylishen * ColorPickers/GSWheelColorPicker.m: Rewrite to draw the HSV wheel in a bitmap. This gives a pretty large performance improvement. * Source/NSColorPanel.m: Set a sensible min and max size for the color panel. 2010-08-19 Wolfgang Lux * Source/NSOutlineView.m (-mouseDown): If the alt modifier is pressed when the user expands or collapses an item expand or collapse all children of the item as well. 2010-08-19 Wolfgang Lux * Source/NSDocument.m (-svaveToFile:saveOperation:delegate:..., -saveToURLofType:forSaveOperation:...): Update the document controller's recent document list. This means that the user will find her fresh documents in that list after saving them. 2010-08-16 Wolfgang Lux * Headers/AppKit/NSDocument.h: * Source/NSDocument.m: Change result type of method -saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo: from BOOL to void. This fixes an incompatibility with Cocoa where this method has no result (as any other method receiving a callback selector). 2010-08-15 Wolfgang Lux * Source/NSTextField.m (-selectText:): Add special case to preserve the current X selection when editing is started with a mouse click. * Source/NSSpellChecker.m (-awakeFromNib): Make the spell panel a utility window like the font and color panels. * Source/NSPopUpButtonCell.m (-selectItem): Fix bug caused by the fix for #30025, which made it impossible to programmatically change the selected item of some pop up buttons. * Source/NSComboBoxCell.m (-runLoopWithComboBoxCell:): Dismiss the combo box's list without changing the selection when the user presses Escape. 2010-08-13 Riccardo Mottola * Source/NSMatrix.m cleaned up code 2010-08-11 Wolfgang Lux * Source/NSComboBox.m (-textView:doCommandBySelector:): New override to pop up the combo box's list when the user presses the down arrow key. * Source/NSComboBoxCell.m (_performClickWithFrame:inView:): Remember the cell's control view. 2010-08-10 Fred Kiefer * Source/NSPopUpButtonCell.m (-setPullsDown:): Call synchronizeTitleAndSelectedItem to display the correct item. * Source/NSPopUpButtonCell.m (-setMenu:): Listen to notifications from the menu to call synchronizeTitleAndSelectedItem, when the menu items change. 2010-08-10 Fred Kiefer * Source/GSTextStorage.m: Follow Richard's changes to GSAttributedString in base. 2010-08-09 Wolfgang Lux * Source/NSApplication.m (-arrangeInFront:): Only order non-miniaturized windows front. 2010-08-09 Wolfgang Lux * Source/NSTextView.m (-draggingEntered:, -draggingUpdated): Fix an incorrect range check which prevented the user from copying or moving the current selection immediately before itself with a DnD operation. 2010-08-03 Eric Wasylishen * Source/NSColorPanel.m: * Source/NSFontPanel.m: Make the NSColorPanel and NSFontPanel use NSUtilityWindowMask. Also remove the NSMiniaturizableWindowMask from NSFontPanel. This makes the panels behave as they do on Mac OS. Feel free to revert/discuss if you disagree with this.. :-) 2010-08-03 Eric Wasylishen * Source/NSPanel.m: Override -initWithContentRect:styleMask:backing:defer: so that if NSUtilityWindowMask is part of the style mask, we can set the panel to be a floating panel (which is the definition of NSUtilityWindowMask, in addition to making the panel have a thin title bar.) 2010-08-03 Riccardo Mottola * Source/NSScrollView.m : added documentation for scroller hiding. 2010-08-03 17:21-EDT Gregory John Casamento * Source/GSTheme.m: remove forward declaration for _setArchiveByName from NSImage category. * Source/NSImage.m: Added code in _setImage:forName: to archive by name instead. 2010-08-02 Wolfgang Lux * Source/NSTextView.m (-validateUserInterfaceItem:, -performFindPanelAction:): Implement find panel support. * Source/GNUmakefile: * Source/GSTextFinder.h: * Source/GSTextFinder.m: * Panels/GNUmakefile: * Panels/English.lproj/GSFindPanel.gorm: New text finder and associated find panel. * Source/NSTextView.m(currentVersion, -initWithTextView:, -encodeWithCoder:, -initWithCoder:): Archive the uses find panel attribute. This required updating the NSTextView version to 3. 2010-08-02 Fred Kiefer * Source/NSButton.m, * Source/NSMenu.m: Add missing #import. 2010-07-27 Wolfgang Lux * Source/NSMenuView.m (-setWindowFrameForAttachingToRect:...): Better placement of pull down menus. If there is not enough room at the preferred edge display the menu at the opposite edge. 2010-07-26 Wolfgang Lux * Source/NSMenuView.m (-trackWithEvent:): * Source/NSMenu.m (-shiftOnScreen): Correctly handle the cases where a menu is partially off screen on the top and the left side of the screen, respectively. This fixes bug #30439. 2010-07-26 Fred Kiefer * Source/NSInputManager.m: Use NSDeleteCharacter for the backspace key. 2010-07-26 Fred Kiefer * Source/NSWindow.m (-keyDown:): Correction of last change. 2010-07-25 Eric Wasylishen * Source/NSSplitView.m (-adjustSubviews): Call setFrame: on subviews rather than setFrameSize: followed by setFrameOrigin:, so that the subviews never have an inconsistent frame (old origin + new size). This was messing up cases with NSOpenGLView's inside split views, (e.g. usr-apps/examples/gui/MyGL) because the NSOpenGLView, when notified of its size changing, was using the invalid origin. 2010-07-25 Fred Kiefer * Source/NSBrowser.m, * Source/NSInputManager.m, * Source/NSMatrix.m, * Source/NSWindow.m: Add support for backtab character. 2010-07-22 19:35-EDT Gregory John Casamento * Source/GSTheme.m: Call method _setArchiveByName: with YES so that images loaded by a theme will not be persisted as image data, but rather as references. This will avoid an issue with saving theme images when saving files in Gorm while a theme is loaded. * Source/NSImage.m: Added method _setArchiveByName:. 2010-07-15 Fred Kiefer * Source/NSMenuView.m (-setWindowFrameForAttachingToRect...): Resize the menu view if needed. This should correct part of bug #30025. 2010-07-09 Wolfgang Lux * Source/NSPopUpButtonCell.m (-setMenuView:): Override super class method so that the button's appearance is not inadvertently changed when the menu view is set. 2010-06-23 Wolfgang Lux * Source/NSMenuView.m (-sizeToFit): Correctly take into account that the first item of a pull down menu is not visible. * Source/NSMenuView.m (-setHorizontal:): Ensure that the layout is recomputed after changing the view from vertical to horizontal and vice versa. 2010-06-22 Doug Simons * Source/NSButton.m: * Source/NSMatrix.m: * Source/NSMenu.m: Further change to performKeyEquivalent: methods to take Shift key into account for control keys (such as Return and Tab) as well as function keys, and to honor keyEquivalentModifierMask for cells in a matrix that implement that method. Also, ignore key events with zero length (such as the Windows key) which was previously triggering actions on objects with no keyEquivalent. 2010-06-22 Wolfgang Lux * Source/NSPopUpButtonCell.m (-initTextCell:pullsDown:, -initWithCoder:, -_currentArrowImage:, -attachPopUpWithFrame:inView:): Swap meaning of NSMinYEdge and NSMaxYEdge to match their use in Cocoa. Recall that pop up buttons use flipped geometry. 2010-06-22 Wolfgang Lux * Source/NSMenuView.m (-rectOfItemAtIndex:, -setWindowFrameForAttachingToRect:onScreen:preferredEdge:...): * Source/NSPopUpButtonCell.m (-attachPopUpWithFrame:inView:): Don't display the first item of a pull down menu, which holds its title, and fix the attachment of pull down menus to their button. * Source/NSPopUpButtonCell.m (-title:): Implement to return the title of the menu. * Source/NSPopUpButtonCell.m (-setTitle): Fix implementation to actually change the title of a pull down menu. * Source/NSPopUpButtonCell.m (-selectItem:): Prevent exception when a horizontal menu does not have a selected item. 2010-06-21 Wolfgang Lux * Source/NSSliderCell.m (-closestTickMarkValueToValue:, -rectOfTickMarkAtIndex:, -tickMarkValueAtIndex:): Fix tick mark related calculations to correctly take into account that the first and last tick marks conincide with the minimum and maximum values. 2010-06-18 Wolfgang Lux * Source/NSAttributedString.m (-initWithData:options:documentAttributes:error:): Attempt to auto detect the document type if it wasn't specified by the caller. Currently works for RTF and HTML documents. * Source/NSAttributedString.m (-initWithURL:documentAttributes:, -initWithURL:options:documentAttributes:error:): Add base URL to the document importing options only if it is not nil. 2010-06-15 Wolfgang Lux * Source/NSMenu.m (-performKeyEquivalent:): Fix Doug's previous change to ignore the shift key except when a function key is pressed, as documented by Apple. * Source/NSButton.m (-performKeyEquivalent): Fix to trigger only when command, alternate, and control keys match the modifier mask exactly, as documented by Apple. 2010-06-08 Doug Simons * Source/NSMenu.m: Fix menu key equivalents to only trigger when the exact modifiers are held down. Previously, an item would activate even when additional modifiers were held down (e.g. typing Ctrl-Alt-x would activate a menu item whose key equivalent was Ctrl-x). 2010-06-07 Doug Simons * Source/NSMenuItem.m: Implement NSUserKeyEquivalents default for providing custom key equivalents for menu items based on their title. 2010-06-05 Nicola Pero * Source/GSWindowDecorationView.m ([-removeSubview:]): Uncommented the method, fixing moving the content view from one window to another one. 2010-06-01 Wolfgang Lux * Source/NSApplication.m (-finishLaunching): Do not attempt to open an untitled document in a document based application that does not define an editor type. 2010-06-01 Quentin Mathe Fixed many drawing issues (many ones being related to the flipping). In particular, fixed -[NSImage drawXXX] methods to work exactly as Cocoa and improve the drawing performance in some cases (the last two points only holds with Cairo backend). Eliminated as many flipping checks as possible. Warning: Untested with the winlib backend. * Headers/AppKit/NSGraphicsContext.h: * Source/NSGraphicsContext.m: (-supportsDrawGState, -GSdraw:toPoint:fromRect:operation:fraction:): Added (see also the Backend Changelog). * Source/NSImage.m (-drawInRect:fromRect:operation:fraction:): Moved the previous implementation to -guiDrawInRect:fromRect:operation:fraction: and rewritten as a switch that checks -supportsDrawState. (-guiDrawInRect:fromRect:operation:fraction:): New method identical to the old -drawInRect:fromRect:operation:fraction:. (-nativeDrawInRect:fromRect:operation:fraction:): Added. New method that leverages the backend as much possible and implement semantic that exactly matches Cocoa. (-drawRepresentation:inRect:): Removed flipping check. * Source/NSImageRep.m (-drawInPoint:, -drawInRect:): Removed the flipping checks. * Source/NSImageCell.m (-drawInteriorWithFrame:inView:): Fixed -drawInRect:fromRect:operation:fraction use as Apple doc suggests it rather than using a negative height trick which doesn't work anymore (at least with Cairo) and has never worked on Mac OS X. * Source/NSView.m (-scrollRect:by:): Ajusted to do the copy bits on the window gstate rather than the view gstate. Required now that Cairo NSCopyBits/compositeGState won't compensate the flipping when copyOnSelf is YES. Moreover -scrollRect:by: was broken previously when the view wass not flipped (at least for Cairo). Finally NSCopyBits() behaves in another way on Mac OS X when the view gstate is used instead of the window gstate. By using the window gstate, we can more easily change how NSCopyBits() handles the view gstate to match Cocoa. * Source/NSClipView.m (-setBoundsOrigin:): Turned off dubious code that should probably be removed. 2010-06-01 Wolfgang Lux * Source/NSDocumentController.m (-_setupOpenPanel): Disable directory selection in open panels, which is useless since document file packages are shown as plain files in the panel. 2010-06-01 Wolfgang Lux * Source/NSAlert.m: Fix NSAlert implementation so that buttons are assigned tags starting with NSAlertFirstButtonReturn, except if the panel was created with the backward compatibility method +alertWithMessageText:defaultButton:... Also assign appropriate key equivalents to buttons in panels created with the old OpenStep alert panel functions. 2010-06-01 Fred Kiefer * Headers/AppKit/NSOutlineView.h, * Source/NSOutlineView.m: Add -parentForItem: and -frameOfOutlineCellAtRow:. Use the later in -drawRow:clipRect:. Change methods to use NSInteger and CGFloat. 2010-05-31 Wolfgang Lux * Source/NSWindow.m (-dealloc): Avoid a race with some lame window managers, which could lead to a crash when a window is closed and deallocated while a tool tip is visible. 2010-05-31 Wolfgang Lux * Source/NSDocumentController.m (-_openableFileExtensions, -typeFromFileExtension:): * Source/NSDocument.m (-_runSavePanelForSaveOperation:, -changeSaveType:, -fileNameExtensionForType:saveOperation:): Implement support for document types with a wild card extension. 2010-05-31 David Wetzel * Source/NSViewController.m * Headers/AppKit/NSViewController.h New files fixes #29822 2010-05-31 Wolfgang Lux * Source/NSWindowController.m (-setDocumentEdited:, -setWindow:): Avoid loading the controller's nib prematurely if the document edited status is changed. 2010-05-30 Wolfgang Lux * Source/NSFont.m (-initWithCoder:): Fixed keyed decoding to fall back to a standard font only if the named font was not found. 2010-05-30 Wolfgang Lux * Source/NSTextView.m (NSTextViewUndoObject, -performUndo:, -shouldChangeTextInRange:replacementString:): Select text restored by an undo operation and set insertion point to the end of the changed text after a redo operation. 2010-05-30 Wolfgang Lux * Source/NSTextView.m (-initWithFrame:, -initWithFrame:textContainer:): Ensure a more consistent initial setup of a new text view and its text container. 2010-05-30 Wolfgang Lux * Source/NSTextView.m (-initWithCoder:, -initWithTextView:, -encodeWithCoder:): Fix decoding and encoding of a few text view flags, which did not match Cocoa. * Source/NSTextView.m (-initWithCoder:): Replace a completely bogus workaround to set up the text network of a text view loaded from a .nib file with a clean solution. 2010-05-30 Wolfgang Lux * Source/NSTextContainer.m (-init:, -initWithCoder:): Use more reasonable initial container size. * Source/NSTextContainer.m (-initWithCoder:): Better decoding of text container flags. 2010-05-30 Wolfgang Lux * Source/NSLayoutManager.m (-encodeWithCoder:, -initWithCoder:): Make layout manager attributes and flags persistent when using a keyed archiver, i.e., saving or loading a .nib file. 2010-05-29 12:00-EDT Gregory John Casamento * Source/NSSplitView.m: In mouseDown: initialize p and op to NSZeroPoint to prevent compiler warning. 2010-05-29 11:35-EDT Gregory John Casamento * Source/NSBitmapImageRep+PNG.m: Reverting change which removed check for setjmp. This was causing a compilation error. 2010-05-29 Wolfgang Lux * Headers/Additions/GNUstepGUI/GSNibLoading.h: * Source/NSButtonCell.m: * Source/NSMatrix.m: * Source/NSScrollView.m: * Source/NSTableView.m: Correct serious nib loading bug on big endian machines by testing GS_WORDS_BIGENDIAN instead of WORDS_BIGENDIAN. 2010-05-29 01:34-EDT Gregory John Casamento * Source/GSXibLoader.m: Took out interface definitions and moved them. * Headers/Additions/GNUstepGUI/GSXibLoading.h: New file which contains the definitions for the new classes defined in GSXibLoader.m. This change will allow those classes to be used by applications such as Gorm. 2010-05-25 Riccardo Mottola * Source/NSBitmapImageRep+PNG.m Skip libpng's check for setjmp. I hope we are indeed correct. 2010-05-24 Fred Kiefer * Source/NSTextView.m (-_characterIndexForPoint:respectFraction:): Move and declare this method to keep gcc 2.95 quite. 2010-05-24 Fred Kiefer * Source/GSSimpleLayoutManager.m: Remove obsolete file. * Source/NSBitmapImageRep+PNG.m, * Source/NSBitmapImageRep+JPEG.m, * Source/NSColorPicker.m, * Source/NSMenu.m, * Source/NSScreen.m: Remove gcc 2.95 warnings reported by Riccardo Mottola . * Source/externs.m * Source/Functions.m * Source/GSAnimator.m * Source/GSHelpManagerPanel.m * Source/GSEPSPrintOperation.m * Source/GSFusedSilica.m * Source/GSFusedSilicaContext.h * Source/GSFusedSilicaContext.m * Source/GSLayoutManager.m * Source/GSPrinting.m * Source/GSPrintOperation.m * Source/GSInfoPanel.m * Source/GSKeyBindingAction.h * Source/GSKeyBindingAction.m * Source/GSKeyBindingTable.h * Source/GSKeyBindingTable.m * Source/GSServicesManager.m * Source/NSColorList.m * Source/NSBox.m * Source/NSAttributedString.m * Source/NSWorkspace.m * Source/NSBitmapImageRep+PNG.h * Source/NSWindow.m * Source/NSClipView.m * Source/NSBitmapImageRep.m * Source/NSApplication.m * Source/NSCachedImageRep.m * Source/NSButtonImageSource.h * Source/NSButtonImageSource.m * Source/NSBitmapImageRep+GIF.h * Source/NSBitmapImageRep+GIF.m * Source/NSTabViewItem.m * Source/NSBitmapImageRep+JPEG.h * Source/NSBitmapImageRep+PNM.h * Source/NSBitmapImageRep+PNM.m * Source/NSTabView.m * Source/NSArrayController.m * Source/NSBrowserCell.m * Source/NSBitmapImageRep+ICNS.h * Source/NSBitmapImageRep+ICNS.m * Source/NSView.m: Replace #include -> #import 2010-05-21 Doug Simons * Source/GSToolbarView.m: * Source/NSToolbarItem.m: Make toolbar resizing behavior match the Cocoa behavior for dividing extra space between flexible spaces and other flexible items. Ensure custom view items are resized properly, taking minSize into account. 2010-05-20 04:14-EDT Gregory John Casamento * Headers/Additions/GNUstepGUI/GSTheme.h: Added method displayPopUpMenu:... to handle the display of the popup menus for themes. * Source/GSThemeMenu.m: Added default implementation. * Source/NSPopUpButtonCell.m: Call the displayPopUpMenu:... method in the method attachPopUpWithFrame:inView:. 2010-05-19 Quentin Mathe * Headers/AppKit/NSColorPicking.h: Removed Protocol.h import to eliminate potential return type conflicts, between -(unsigned int)hash from Object and -(NSUInteger)hash from NSObject, when the receiver is of type (id). 2010-05-19 Riccardo Mottola * Source/GSVbox.m, * Source/GSHbox.m: Changed header include to import 2010-05-17 Fred Kiefer * Source/NSToolbarItem.m (-setView:): Only set the min/max size of the toolbar item when it was zero. 2010-05-17 04:36-EDT Gregory John Casamento * Source/NSApplication.m: Attempt to open files from the command line, if possible in -finishLaunching. This matches the behavior seen on OpenStep and on Mac OS X/Cocoa. 2010-05-16 Quentin Mathe * Source/Functions.m: * Source/NSApplication.m (-finishLaunching): Moved the main Nib file loading from -finishLaunching to NSApplicationMain() to match Cocoa behavior/documentation. This makes easier to implement a custom AppKit main that works with both Cocoa and GNUstep. 2010-05-15 Wolfgang Lux * Source/GSNibLoading.m (-nibInstantiate): Fix bug where a window was ignoring its autosaved frame when loaded from a .nib file. 2010-05-15 Wolfgang Lux * Source/NSFontManager.m (-fontMenu): Remove key equivalents that conflict with standard key equivalents. 2010-05-15 Wolfgang Lux * Source/NSAlert.m: * Source/NSDrawer.m: * Source/NSHelpPanel.m: * Source/NSPrintPanel.m: Propagate the change of NSWindow's designated initializer to all affected subclasses. 2010-05-14 Wolfgang Lux * Source/GSGormLoading.m (-awakeWithContext): Add support for a recent documents menu. 2010-05-14 Wolfgang Lux * Source/NSDocumentController.m (-_openRecentDocument:): Give the application delegate a chance to open the document. This makes the recent documents menu available to non-document based applications as documented and implemented by Apple. 2010-05-13 Fred Kiefer * Source/NSToolbarItem.m (-_isFlexibleSpace): Simplify this method. * Source/GSToolbarView.m: Clean up toolbar item resizing, this now allows for resizable item other than flexible space. If there are flexible items and flexible space the items will be expanded first. 2010-05-13 Wolfgang Lux * Source/GSNibLoading.m (-nibInstantiateWithOwner:topLeveObjects:, -initWithCoder:, -dealloc): Don't send -awakeFromNib to an NSApplication proxy (nor any other proxy) and do not record it in the top level array either. Identification of proxy objects is based on their object IDs. 2010-05-13 Wolfgang Lux * Source/GSNibLoading.m (-nibInstantiateWithOwner:topLeveObjects:): Make sure all objects are instantiated before establishing any connections. This fixes an issue where, e.g., a generic shared document controller instance is created before a custom instance defined in the nib file. 2010-05-12 18:48-EDT Gregory John Casamento * Headers/Additions/GNUstepGUI/GSTheme.h: Added method rightMouseMenu:forEvent: to allow theming of transient and context menus. * Source/GSThemeMenu.m: Implementation of method rightMouseMenu:forEvent: to allow theming of transient and context menus. * Source/NSMenu.m: use the theming code implemented above instead of rendering the menu directly. 2010-05-12 Wolfgang Lux * Source/NSWindow.m: Fix a rather long standing incompatibility and make -initWithContentRect:styleMask:backing:defer: the designated initializer of NSWindow. 2010-05-12 Wolfgang Lux * Source/GSNibLoading.m (-nibInstantiateWithOwner:topLevelObjects:): Next attempt at getting .nib file loading right. Make sure that -nibInstantiate is sent to all loaded objects and also make sure that -awakeFromNib is sent to the nib's owner. 2010-05-12 Wolfgang Lux * Source/NSDocumentController.m (-init, -maximumRecentDocumentCount, -noteNewRecentDocumentURL:): Make number of remembered recent documents configurable with a user preference and fix a bug where one extra document was remembered. 2010-05-12 Wolfgang Lux * Source/GSXibLoader.m (-awakeData:withContext:): Fix bug where some objects from the xib file were not sent an -awakeFromNib message. 2010-05-12 Wolfgang Lux * Headers/AppKit/NSMenu.h: * Source/NSMenu.m (-_initWithCoder:, -dealloc, -_name, -_setName:, -awakeFromNib): Add a private name attribute to menus to identify special purpose menus. Fixes a bug where the services, windows, and recent documents menu were defunct when loading the menu from a .nib file. 2010-05-12 Wolfgang Lux * Headers/AppKit/NSDocumentController.h: * Source/NSDocumentFrameworkPrivate.h: * Source/NSDocumentController.m (-_recentDocumentsMenu, -_setRecentDocumentsMenu:, -_updateRecentDocumentsMenu): Add an attribute to NSDocumentController to maintain the recent documents menu. Make the methods to access that menu available to other classes in -gui. 2010-05-12 Wolfgang Lux * Source/GSNibLoading.m (-nibInstantiateWithOwner:topLevelObjects:): Fix bug where some objects from the nib file were not sent an -awakeFromNib message. 2010-05-11 Fred Kiefer * Headers/Additions/GNUstepGUI/GSTheme.h: * Source/GSThemeDrawing.m: Remove compiler warning for NSBrowser header cell drawing. 2010-05-10 Adam Fedor * Clarify unstable release documentation 2010-05-09 Adam Fedor * Version 0.19.0 Unstable Release 2010-05-09 Adam Fedor * Version 0.18.0 2010-05-09 Richard Frith-Macdonald * Source/GSTheme.m: ([-deactivate]) unload current theme images before restoring previous theme images to avoid conflict with image names. * Source/NSImage.m: Add some comments. 2010-05-08 Fred Kiefer * Source/NSWindow.m (-dealloc): Use DESTROY instead of RELEASE. 2010-05-07 Wolfgang Lux * Source/GSWindowDecorationView.m (-layout): Fix a regression where a window's content view was improperly resized when toggleToolbarShown: makes its toolbar visible again. 2010-05-02 Fred Kiefer * Headers/AppKit/NSSavePanel.h, * Source/NSSavePanel.m: Add method directoryURL. Fixes bug #29735. 2010-05-02 Fred Kiefer * TextConverters/RTF/RTFProducer.m (-_stringWithRTFCharacters:): Remove extra space after \'xx characters accidentially introduced with last change. 2010-05-01 Fred Kiefer * TextConverters/RTF/RTFProducer.m (-_runStringForString:attributes:): Only add a delimiter when needed. * TextConverters/RTF/RTFProducer.m (-_stringWithRTFCharacters:): Only add the \uc0 flag when needed. Use \'AC as attachment character. 2010-05-01 Wolfgang Lux * TextConverters/RTF/rtfGrammer.y: Ignore the string parameter of a \NeXTGraphic command like OS X does. Fixes bug #29633. * TextConverters/RTF/rtfGrammer.tab.c: Regenerated. 2010-04-28 Adam Fedor * configure, configure.ac, Headers/Additions/GNUstepGUI/config.h.in, Source/NSSliderCell.m: Check for atan2f function (not present on old Solaris systems for instance). 2010-04-24 Doug Simons * Source/NSOutlineView.m: Fix occasional exception while dragging. 2010-04-24 Doug Simons * Source/NSWindow.m: Handle nil view passed to _checkTrackingRectangles:forEvent: (this prevents a crash in Windows, e.g. when clicking the toolbar overflow widget). 2010-04-24 Doug Simons * Headers/AppKit/NSMenu.h: * Source/NSMenu.m: * Source/NSMenuItem.m: Rebuild in-window menus only when needed on Windows. Also fixed notifying a menu item's menu only when a property value actually changes. 2010-04-23 Eric Wasylishen * Source/NSMenuItem.m: Fix for bug 29635 (NSMenuItem -initWithCoder: should set modifier mask to 0 if NSKeyEquivModMask not defined) 2010-04-23 Jonathan Gillaspie * Source/NSWindowController.m: Fixed a problem where controller marks the window as loaded even when the nib failed to load. 2010-04-23 Jonathan Gillaspie * Headers/AppKit/NSGraphics.h: NSBeep() - Don't crash when a graphics context isn't available (eg - from a subthread). 2010-04-23 Wolfgang Lux * Source/NSAlert.m (NSRunAlertPanel): Fix incorrect return code when called in a non-gui application. 2010-04-20 Doug Simons * Headers/Additions/GNUstepGUI/GSWindowDecorationView.h: Update header to eliminate warning. 2010-04-20 Doug Simons * Source/NSWindow.m: * Source/GSWindowDecorationView.m: Fix problems with in-window menus sometimes overlapping toolbars or toolbars overlapping window contents. 2010-04-19 Doug Simons * Source/NSMatrix.m: Honor sendsActionOnEndEditing setting when editing ended by something other than return. 2010-04-18 Eric Wasylishen * Source/NSBrowser.m: * Source/GSTheme.m: * Source/GSThemeDrawing.m: * Headers/Additions/GNUstepGUI/GSTheme.h: Factor out browser header drawing to GSTheme. 2010-04-18 Eric Wasylishen * Source/NSScrollView.m: Add a new default, GSScrollViewNoInnerBorder, which can be set to YES so themes can disable drawing of the inner border lines in NSScrollView. These only look good with a NeXT style theme, so most non-NeXT-like themes (WinUX, etc.) will want to set GSScrollViewNoInnerBorder to YES. 2010-04-16 Riccardo Mottola * Source/GSToolbarCustomizationPalette.m * Source/GSToolbarView.m removed c99isms 2010-04-15 Eric Wasylishen * Source/NSSegmentedCell.m: Fix some situations in initWithCoder: where the _selected_segment ivar and the selected state of items in the _items array could be out of sync leading to weirdly behaving segmented controls loaded from nibs. 2010-04-14 Wolfgang Lux * Source/NSTextField.m (-textDidEndEditing:): When editing of a text field ends after pressing the Return key and no (other) view has become first responder make the text field itself first responder by selecting its text just like this is done after pressing Tab and Shift-Tab. 2010-04-14 Riccardo Mottola * Source/NSWindow.m : removed c99-isms 2010-04-13 Doug Simons * Headers/Additions/GNUstepGUI/GSToolbarView.h: * Source/GSToolbarView.m: * Source/GSToolbarCustomizationPalette.m: * Source/NSToolbar.m: * Source/NSToolbarItem.m: Fix numerous issues with toolbar customization, including: fix crash when customization palette closed; make customization palette a floating panel centered below toolbar; rewrote dragging code to work well; layout toolbar items when added to toolbar; resize customization palette to fit items; etc. 2010-04-13 Jonathan Gillaspie * Source/GSToolTips.m: Use a single retained window for tooltips instead of a newly created one each time. This significantly reduces interaction with MS-Windows callbacks. 2010-04-12 Fred Kiefer * Source/NSBitmapImageRep+JPEG.m (-_JPEGRepresentationWithProperties:errorMessage:): Use the correct size for the structure in memset. Patch by Philippe Roussel . 2010-04-10 Eric Wasylishen * Headers/AppKit/NSWindow.h * Source/NSWindow.m: Fix delivery of rightMouseDragged: and otherMouseDragged: messages. These weren't working because right/otherMouseDragged: would be called on the _lastView ivar, which was only set on mouse down. I replace the _lastView ivar with _lastLeftMouseDownView, _lastRightMouseDownView, and _lastOtherMouseDownView. Behaviour now matches OS X as far as I can tell. 2010-04-10 Fred Kiefer * Source/linking.m * Source/GSDisplayServer.m * Source/NSWorkspace.m * Source/NSButtonCell.m * Source/NSSplitView.m * Source/GSNibLoading.m * Source/NSCursor.m * Source/NSScroller.m * Source/NSOutlineView.m * Source/GSToolbarView.m * Source/GSPDFPrintOperation.m * Source/GSThemePanel.m * Source/NSImage.m * Source/NSTableView.m * Source/GSDragView.m: Remove compiler warnings detected by clang and reported by David Chisnall . 2010-04-09 David Ayers * Headers/AppKit/NSSound.h: Import NSBundle.h for category declaration. 2010-04-08 Jonathan Gillaspie * Source/GSToolTips.m: Prevent Windows API callback from crashing when displaying tooltips. 2010-04-07 Fred Kiefer * Headers/Cocoa/Cocoa.h: One more forgotten header file changed from #include into #import. 2010-04-07 Fred Kiefer * Headers/Additions/GNUstepGUI/GSHbox.h * Headers/Additions/GNUstepGUI/GSHelpManagerPanel.h * Headers/Additions/GNUstepGUI/GSLayoutManager_internal.h * Headers/Additions/GNUstepGUI/GSTypesetter.h * Headers/Additions/GNUstepGUI/GSAnimator.h * Headers/Additions/GNUstepGUI/GSWindowDecorationView.h * Headers/Additions/GNUstepGUI/GSTextConverter.h * Headers/Additions/GNUstepGUI/GSPrintOperation.h * Headers/Additions/GNUstepGUI/GSServicesManager.h * Headers/Additions/GNUstepGUI/GSVbox.h * Headers/Additions/GNUstepGUI/GSHorizontalTypesetter.h * Headers/Additions/GNUstepGUI/GMAppKit.h * Headers/Additions/GNUstepGUI/GSTable.h * Headers/Additions/GNUstepGUI/GSMemoryPanel.h * Headers/Additions/GNUstepGUI/GSMethodTable.h * Headers/Additions/GNUstepGUI/GSDisplayServer.h * Headers/Additions/GNUstepGUI/GSToolbarView.h * Headers/Additions/GNUstepGUI/GSTheme.h * Headers/Additions/GNUstepGUI/GSPDFPrintOperation.h * Headers/Additions/GNUstepGUI/GSLayoutManager.h * Headers/Additions/GNUstepGUI/GSDragView.h * Headers/Additions/GNUstepGUI/IMLoading.h * Headers/Additions/GNUstepGUI/IMConnectors.h * Headers/Additions/GNUstepGUI/GSPasteboardServer.h * Headers/Additions/GNUstepGUI/GSInfoPanel.h * Headers/Additions/GNUstepGUI/GSTitleView.h * Headers/Additions/GNUstepGUI/GSTrackingRect.h * Headers/Additions/GNUstepGUI/GSEPSPrintOperation.h * Headers/Additions/GNUstepGUI/GSPrinting.h * Headers/Additions/GNUstepGUI/GMArchiver.h * Headers/Additions/GNUstepGUI/IMCustomObject.h * Printing/GSCUPS/GSCUPSPrinter.m * Model/GMArchiver.m * Model/GMAppKit.m * Source/NSAlert.m * Source/GSMemoryPanel.m: Final set of #include -> #import replacement in additional headers. 2010-04-06 Fred Kiefer * ColorPickers/GSWheelColorPicker.m, * Source/NSTableHeaderView.m, * Source/NSStringDrawing.m, * Source/NSWorkspace.m: Remove some stupid compiler warnings. 2010-04-05 Fred Kiefer * Source/GSGModelLoader.m, * Source/GSXibLoader.m: Avoid compiler warnings from old compilers. 2010-04-05 Doug Simons * Source/NSView.m: Fix the worst problems with key view chain. There should only be a single next key view, ever, although possibly multiple previous key views. 2010-04-05 Doug Simons * Source/NSWindow.m: Fix crash caused by close being called recursively. 2010-04-05 Doug Simons * Source/NSDrawer.m: Fix problem with drawer window being shown prematurely. 2010-04-04 German Arias * Panels/Spanish.lproj/GSPageLayout.gorm: Translations of some strings. 2010-03-31 Fred Kiefer * Source/NSStringDrawing.m * Headers/AppKit/NSWindowController.h * Headers/AppKit/NSTokenField.h * Headers/AppKit/NSWorkspace.h * Headers/AppKit/NSWindow.h * Headers/AppKit/NSTextFieldCell.h * Headers/AppKit/NSTextContainer.h * Headers/AppKit/NSToolbar.h * Headers/AppKit/NSTokenFieldCell.h * Headers/AppKit/NSToolbarItemGroup.h * Headers/AppKit/NSTextStorage.h * Headers/AppKit/NSTextView.h * Headers/AppKit/NSToolbarItem.h * Headers/AppKit/NSUserDefaultsController.h * Headers/AppKit/NSUserInterfaceValidation.h * Headers/AppKit/NSTextField.h * Headers/AppKit/NSView.h: Final part of #include -> #import replacement in official headers. 2010-03-31 Fred Kiefer * Headers/AppKit/NSSound.h * Headers/AppKit/NSTextAttachment.h * Headers/AppKit/NSTableHeaderCell.h * Headers/AppKit/NSScreen.h * Headers/AppKit/NSSliderCell.h * Headers/AppKit/NSText.h * Headers/AppKit/NSTableHeaderView.h * Headers/AppKit/NSSplitView.h * Headers/AppKit/NSResponder.h * Headers/AppKit/NSTableColumn.h * Headers/AppKit/NSSavePanel.h * Headers/AppKit/NSSearchFieldCell.h * Headers/AppKit/NSScroller.h * Headers/AppKit/NSRulerMarker.h * Headers/AppKit/NSSearchField.h * Headers/AppKit/NSTabViewItem.h * Headers/AppKit/NSRulerView.h * Headers/AppKit/NSSecureTextField.h * Headers/AppKit/NSSegmentedCell.h * Headers/AppKit/NSSlider.h * Headers/AppKit/NSStringDrawing.h * Headers/AppKit/NSScrollView.h * Headers/AppKit/NSSpellProtocol.h * Headers/AppKit/NSTabView.h * Headers/AppKit/NSSegmentedControl.h * Headers/AppKit/NSTableView.h * Headers/AppKit/NSSelection.h * Headers/AppKit/NSSpellChecker.h * Headers/AppKit/NSSpeechSynthesizer.h * Headers/Additions/GNUstepGUI/GSSoundSource.h * Headers/Additions/GNUstepGUI/GSSoundSink.h * Source/NSButtonCell.m * Source/NSTextFieldCell.m * Source/NSTableColumn.m * Source/GSTitleView.m * Source/NSOutlineView.m * Source/NSPageLayout.m * Source/NSTabViewItem.m * Source/NSRulerView.m * Source/NSMenuView.m * Source/NSSecureTextField.m * Source/GSThemeDrawing.m * Source/NSToolbarItem.m * Source/NSPrintInfo.m * Source/NSCell.m * Source/NSTableView.m * Source/GSDragView.m * Source/GSToolTips.m: Yet another set of #include -> #import replacement. 2010-03-31 00:02-EDT Gregory John Casamento * Source/NSTableView.m: Add nil check to make sure that the nil values set for certain keys don't get set since they are normally set by connections later in the nib loading process. I'm not sure why IB includes these when they're set to nil. 2010-03-30 Fred Kiefer * Headers/AppKit/NSNib.h: Make NSNibOwner and NSNibTopLevelObjects available only for version > 10.3. * Source/NSWindowController.m, * Source/NSPageLayout.m, * Source/GSGModelLoader.m, * Source/NSDataLinkPanel.m, * Source/NSPrintPanel.m, * Source/NSSpellChecker.m: Use NSNibOwner instead of @"NSOwner". Remove the hard coded "gorm" extension. Try to use higher level NIB loading methods where possible. 2010-03-30 Wolfgang Lux * Source/NSWindow.m (-sendEvent:): Remove a stray semicolon, which made NSWindow ignore all GSAppKitWindowLeave events. This was the cause for, e.g., somewhat too sticky tooltips. * Source/GSGormLoading.m: * Source/GSNibLoading.m: Attempt to improve a possibly misleading comment about releasing top level objects of a gorm/nib file. 2010-03-28 Fred Kiefer * Headers/AppKit/NSPopUpButtonCell.h * Headers/AppKit/NSPanel.h * Headers/AppKit/NSOpenPanel.h * Headers/AppKit/NSParagraphStyle.h * Headers/AppKit/NSObjectController.h * Headers/AppKit/NSOpenGLView.h * Headers/AppKit/NSPrinter.h * Headers/AppKit/NSPrintOperation.h * Headers/AppKit/NSPageLayout.h * Headers/AppKit/NSOutlineView.h * Headers/AppKit/NSOpenGL.h * Headers/AppKit/NSPrintInfo.h * Headers/AppKit/NSPrintPanel.h * Headers/AppKit/NSPasteboard.h: Some more #include -> #import replacement. 2010-03-28 Fred Kiefer * Headers/AppKit/NSNib.h, * Source/externs.m: Define new string constants NSNibOwner and NSNibTopLevelObjects. * Source/NSBundleAdditions.m, * Source/NSNib.m: Use these constants. * Source/GSNibLoading.m, * Source/GSGormLoading.m, * Source/GSXibLoader.m: Rewrite of top level objects handling to fit documentations as cited by Wolfgang Lux . 2010-03-28 Fred Kiefer * Source/NSPasteboard.m (-writeObjects:): Add a return statement to avoid a compiler warning. 2010-03-27 Wolfgang Lux * Headers/AppKit/NSResponder.h (-scrollToBeginningOfDocument:, -scrollToEndOfDocument:): * Source/NSScrollView.m (-scrollToBeginningOfDocument:, -scrollToEndOfDocument:): * Source/NSTextView_actions.m (-scrollToBeginningOfDocument:, -scrollToEndOfDocument:): Implement additional NSResponder action methods. * Source/NSAttributedString.m (-nextWordFromIndex:forward:): Move to the next end of a word rather than the beginning of the next word so users can quickly navigate to either end of words. * Source/NSTextView.m (-setSelectedRange:affinity:stillSelecting:): * Source/NSTextView_actions.m (-deleteForward:, -deleteBackward:, -deleteToEndOfLine:): Usability improvements: When setting the cursor to the beginning of a line, set the typing attributes to the attributes of the first character of that line rather than the preceding newline. When deleting text, set the typing attributes to those of the first deleted character rather than those of the character preceding the deleted range. * Source/NSTextView.m (-mouseDown:): Allow shift-clicking to shrink the current selection. Comes handy when you accidentally select a few characters too much. * Source/NSTextView.m (-performDragOperation:): Select pasted text after a DnD operation. * Source/NSWindowController.m (-synchronizeWindowTitleWithDocumentName): Show a document's represented file name also when its display name is equal to the last path component of the file name, since that is what NSDocument uses by default for compatibility with OS X. * Source/NSWindowController.m (-_windowWillClose:): Extend lifetime of the window controller to the end of the current event cycle to prevent crashes due to a premature release after the latest nib loading changes. 2010-03-27 David Chisnall * Source/NSWindow.m * Source/GSNibLoading.m * Source/NSSavePanel.m * Source/NSPasteboard.m * Source/NSInterfaceStyle.m * Source/NSGraphicsContext.m * Source/GSToolTips.m * Source/NSView.m * Headers/AppKit/AppKitDefines.h * Headers/AppKit/NSWindow.h * Headers/AppKit/NSResponder.h * Headers/AppKit/NSView.h Removed all uses of @defs() from -gui, so it now compiles cleanly with the non-fragile ABI. All ivars that must be accessed from other classes are now wrapped in PACKAGE_SCOPE. With clang, this expands to @package, with GCC it expands to @public. 2010-03-25 Riccardo Mottola * Source/GSXibLoader.m, * Source/NSView.m : removed c99-isms 2010-03-25 Fred Kiefer * Headers/AppKit/NSImageCell.h * Headers/AppKit/NSLevelIndicator.h * Headers/AppKit/NSMatrix.h * Headers/AppKit/NSMenu.h * Headers/AppKit/NSLayoutManager.h * Headers/AppKit/NSInputServer.h * Headers/AppKit/NSImageRep.h * Headers/AppKit/NSMovieView.h * Headers/AppKit/NSMovie.h * Headers/AppKit/NSHelpManager.h * Headers/AppKit/NSMenuItemCell.h * Headers/AppKit/NSInterfaceStyle.h * Headers/AppKit/NSMenuItem.h * Headers/AppKit/NSInputManager.h * Headers/AppKit/NSLevelIndicatorCell.h * Headers/AppKit/NSMenuView.h * Headers/AppKit/NSHelpPanel.h * Headers/AppKit/NSImage.h * Headers/AppKit/NSKeyValueBinding.h * Source/NSPopUpButtonCell.m * Source/GSWindowDecorationView.m * Source/NSPopUpButton.m * Source/NSHelpManager.m * Source/NSToolbar.m * Source/GSToolbarCustomizationPalette.m * Source/GSTitleView.m * Source/NSMenuView.m * Source/NSCell.m: Some more #include -> #import replacement. 2010-03-25 Fred Kiefer * Source/GSNibLoading.m (NSIBObjectData-nibInstantiateWithOwner:topLevelObjects:): Loop over _names instead of _objects. 2010-03-25 Fred Kiefer * Headers/AppKit/NSController.h * Headers/AppKit/NSGlyphGenerator.h * Headers/AppKit/NSGradient.h * Headers/AppKit/NSGraphicsContext.h * Headers/AppKit/NSPopUpButton.h * Headers/AppKit/NSShadow.h * Source/NSPopUpButtonCell.m * Source/NSGlyphGenerator.m * Source/NSPopUpButton.m * Source/NSMenu.m * Source/NSGradient.m * Source/GSHorizontalTypesetter.m * Source/NSTextView.m * Source/NSShadow.m * Source/NSPrintPanel.m * Source/NSSpellChecker.m * Source/NSDocument.m: Yet another bit of #include -> #import replacement. Replace includes of Foundation.h. 2010-03-24 Fred Kiefer * Headers/AppKit/NSColorList.h * Headers/AppKit/NSBox.h * Headers/AppKit/NSFontManager.h * Headers/AppKit/NSFormCell.h * Headers/AppKit/NSButtonCell.h * Headers/AppKit/NSColorPicker.h * Headers/AppKit/NSClipView.h * Headers/AppKit/NSDataLinkManager.h * Headers/AppKit/NSBitmapImageRep.h * Headers/AppKit/NSBezierPath.h * Headers/AppKit/NSGraphics.h * Headers/AppKit/NSColorWell.h * Headers/AppKit/NSApplication.h * Headers/AppKit/NSForm.h * Headers/AppKit/NSComboBox.h * Headers/AppKit/NSButton.h * Headers/AppKit/NSColor.h * Headers/AppKit/NSCachedImageRep.h * Headers/AppKit/NSColorSpace.h * Headers/AppKit/NSFontDescriptor.h * Headers/AppKit/NSCursor.h * Headers/AppKit/NSControl.h * Headers/AppKit/NSFont.h * Headers/AppKit/NSFileWrapper.h * Headers/AppKit/NSDragging.h * Headers/AppKit/NSDocumentController.h * Headers/AppKit/NSColorPicking.h * Headers/AppKit/NSDrawer.h * Headers/AppKit/NSCustomImageRep.h * Headers/AppKit/NSComboBoxCell.h * Headers/AppKit/NSDataLink.h * Headers/AppKit/NSColorPanel.h * Headers/AppKit/NSEPSImageRep.h * Headers/AppKit/NSDataLinkPanel.h * Headers/AppKit/NSEvent.h * Headers/AppKit/NSBrowserCell.h * Headers/AppKit/NSDocument.h * Headers/AppKit/NSBrowser.h * Headers/AppKit/NSFontPanel.h * Source/NSPanel.m * Source/NSColor.m * Source/NSColorSpace.m * Source/NSColorPanel.m: Another bit of #include -> #import replacement. 2010-03-24 Doug Simons * Source/GSToolTips.m: Use NSPanel instead of NSWindow for the tooltip (helps resolve an occasional crash on Windows). 2010-03-24 Fred Kiefer * Headers/AppKit/AppKitExceptions.h, * Headers/AppKit/NSAttributedString.h, * Headers/AppKit/NSBezierPath.h, * Headers/AppKit/DPSOperators.h, * Headers/AppKit/NSArrayController.h, * Headers/AppKit/NSAnimation.h, * Source/NSBrowser.m, * Source/NSAffineTransform.m, * Source/GSTheme.m, * Source/NSBezierPath.m, * Source/GSThemeTools.m, * Source/NSGraphicsContext.m: Next bit of #include -> #import replacement. 2010-03-23 Fred Kiefer * Headers/AppKit/NSUserInterfaceValidation.h * Headers/AppKit/NSControl.h * Headers/AppKit/NSMenuItem.h * Headers/AppKit/NSCell.h * Headers/AppKit/NSView.h * Source/NSActionCell.m * Source/NSControl.m * Source/NSMenuItem.m * Source/NSSegmentedCell.m * Source/NSCell.m * Source/NSView.m: Change tag to NSInteger. Patch by Anibal Rindisbacher . 2010-03-23 Fred Kiefer * Source/NSTextContainer.m (-replaceLayoutManager:): Retain the text storage while replacing the layout manager. See last patch. 2010-03-23 Fred Kiefer * Source/GSXibLoader.m: Try to be a bit closer to the current NIB loading code. * Source/NSTextView.m (-replaceTextContainer:): Retain the text storage, the last change in buildUpTextNetwork: made this more volatile. 2010-03-22 Fred Kiefer * Source/GSGormLoading.m (-awakeWithContext:): Add old NIB loading keys to context. Bug pointed out by Wolfgang Lux . * Source/GSNibLoading.m: Retain the NSApp and fix other memory issues. 2010-03-22 Fred Kiefer * Headers/Additions/GNUstepGUI/GSModelLoaderFactory.h, * Source/GSModelLoaderFactory.m, * Source/GSGormLoader.m, * Source/GSXibLoader.m, * Source/GSNibLoader.m: New method dataForFile: on GSModelLoader and its subclasses. * Source/NSNib.m: Use this new method to load NIB files. * Source/NSBundleAdditions.m: Use NSNib for NIB loading. * Source/GSNibLoading.m: Correctly handle top level objects and clean up dealloc for most classes here. 2010-03-22 Fred Kiefer * Source/NSDocument.m (-close): Retain and autorelease self before removing from the document controller. This will keep the document valid until the window is completely closed. 2010-03-20 Eric Wasylishen * Source/NSSearchFieldCell.m: Move subscription to NSTextDidChangeNotification from -editWithFrame:... to -selectWithFrame:... The reason for this is -editWithFrame:... is not always called when the field starts being edited. (This seems odd but matches OS X behaviour). -selectWithFrame: is always called, however. This fixes the bug where NSSearchField doesn't send action messages while the user is typing, when it is supposed to. 2010-03-20 Fred Kiefer * Source/NSTextView.m (-buildUpTextNetwork:): Prevent retain cycle by storing reference to retained text storage in ivar. * gui/Source/GSNibLoader.m (-loadModelData:externalNameTable:withZone:): Use an auto release pool while loading a NIB file. * gui/Source/GSNibLoading.m (NSKeyedUnarchiver-replacementClassForClassName:): Check for class level replacement as well. 2010-03-20 Fred Kiefer * gui/Headers/AppKit/NSNib.h, * gui/Headers/AppKit/NSNibConnector.h, * gui/Headers/AppKit/NSNibLoading.h, * gui/Headers/Additions/GNUstepGUI/GSModelLoaderFactory.h, * gui/Headers/Additions/GNUstepGUI/GSInstantiator.h, * gui/Headers/Additions/GNUstepGUI/GSNibLoading.h, * gui/Source/GSXibLoader.m, * gui/Source/GSNibLoader.m, * gui/Source/GSNibLoading.m, * gui/Source/GSModelLoaderFactory.m, * gui/Source/NSBundleAdditions.m: Clean up includes. * gui/Source/NSNib.m: Add loading of NIB files via URL. 2010-03-19 Fred Kiefer * Source/NSButtonCell.m, * Source/NSMenuItem.m: Remove include of GSCategories.h, as this file no longer exists. 2010-03-18 Fred Kiefer * Source/NSBitmapImageRep+JPEG.m: Put cinfo into a defined state before using it. Patch by Vincent Richomme . 2010-03-17 Fred Kiefer * Source/NSTextView.m (-readSelectionFromPasteboard:type:): Fix potential memory leak for colour pasting. 2010-03-16 Eric Wasylishen * Source/NSSliderCell.m: * Headers/AppKit/NSSliderCell.h: Initial implementation of circular sliders. I need to refactor NSSliderCell drawing code out to GSTheme some time soon. 2010-03-16 German Arias * Resources/French.lproj/Localizable.strings: Added patch by Philippe Roussel. 2010-03-16 Fred Kiefer * Source/NSEvent.m: Handle type flagsChanged correctly. 2010-03-15 Fred Kiefer * Source/GSXibLoader.m: Correct the decoding of the element. Use the GSNibLoaging method to set the main menu. 2010-03-15 Fred Kiefer * Source/NSCursor.m (-initWithCoder:): Retain self, when using a predefined cursor. * Source/NSClipView.m (-initWithCoder:): Undo Greg's hack to retain the cursor. * Source/NSView.m (-initWithCoder:), * Source/NSTextView.m (-initWithCoder:): Small improvements for keyed decoding. 2010-03-15 Fred Kiefer * Source/NSTextView.m (-replaceTextContainer:): Retain self not the layout manager during container replacement. 2010-03-15 Fred Kiefer * Source/NSView.m (-description): Add some useful output to the decription method. * Source/NSView.m (-initWithCoder:): Decode the NSBounds value. * Source/NSView.m (-beginPageInRect:atPlacement:): Avoid compiler warning. 2010-03-14 Eric Wasylishen * Source/NSOpenGLView.m: Add an -initWithCoder: implementation which subscribes to the frame change notifications like -init. Without this addition, NSOpenGLViews loaded from nibs weren't resizing properly. Note: it should also probably set a pixel format, but I didn't add that because it was causing an error. 2010-03-15 Fred Kiefer * Source/GSXibLoader.m: New file with basic XIB format loading. * Source/GNUmakefile: Add new file. 2010-03-13 German Arias * Source/NSSpellChecker.m: Added missing internationalisation. * Resources/Spanish.lproj/Localizable.strings: Spanish translation to string "Guess". 2010-03-13 German Arias * Resources/Spanish.lproj/Localizable.strings: Spanish translation to title "Print Panel". 2010-03-13 German Arias * Source/NSPrintPanel.m: Set the title of the panel (Print Panel), because the panel show the title "window" even when gorm file have other title. 2010-03-13 Fred Kiefer * Source/NSWindow.m (-_borderView), * Source/NSView.m (-_subtreeDescription): Add two Cocoa debug helper methods. 2010-03-13 Fred Kiefer * Source/NSBundleAdditions.m (NSNibOutletConnector -establishConnection): Undo the last change to this method, as it should not retain the assign value. 2010-03-12 Doug Simons * Source/NSTextView.m: (-readSelectionFromPasteboard:type:): Set insertion point _after_ pasted text, don't select it. 2010-03-12 Doug Simons * Source/NSTextView.m: (-mouseDown:): Only try to drag text if the user starts by dragging the mouse. A simple click within the selection will now set the insertion point. * Source/NSView.m: (-setNeedsDisplayInRect:): Avoid unnecessary work when invalid rectangle is empty. 2010-03-11 Doug Simons * Source/NSClipView.m: Call isFlipped rather than accessing flag directly (fixes a problem with view loaded from a nib). 2010-03-11 Wolfgang Lux * Source/NSCell.m (-_drawEditorWithFrame:inView:): Fix some optimistic coding which expected the controlView argument to always be a subclass of NSControl and was causing a crash in AddressManager.app. 2010-03-09 Doug Simons * Source/NSMenu.m: Protect changedMessagesEnabled flag against getting stuck off if exceptions occur during update. * Source/NSApplication.m: Update menu after modal session, and when the key or main window has changed. 2010-03-07 Richard Frith-Macdonald * Source/NSAlert.m: Cope gracefully with being called from an non-gui applications (ie where NSApp is not initialized). * Tools/gopen.m: Print same warning as OSX if item to open is not a URL and the named fiel does not exist. 2010-03-05 Richard Frith-Macdonald * Source/NSWorkspace.m: update NSTask header * Source/NSPasteboard.m: ditto * Source/GSTheme.m: Rewrite method replacement code to use new runtime API... turns out to be rather simpler than using the old API. Add safety measure for themes which load non-standard images. 2010-03-04 Fred Kiefer * Headers/AppKit/AppKit.h, * Headers/AppKit/NSAlert.h, * Headers/AppKit/NSActionCell.h, * Headers/AppKit/NSCell.h, * Source/NSAlert.m, * Source/NSAffineTransform.m, * Source/NSCell.m: Clean up includes. * Source/NSActionCell.m: Add method integerValue. 2010-02-27 23:32-EST Gregory John Casamento * Headers/Additions/GNUstepGUI/GSTheme.h: Add category to allow overriding of classes used for save/open panels. * Source/GNUmakefile: Build new category. * Source/GSThemeOpenSavePanels.m: Implementation of methods -savePanelClass and -openPanelClass. * Source/NSOpenPanel.m: Modifications to use class from current theme. * Source/NSSavePanel.m: Modifications to use class from current theme. 2010-02-26 Wolfgang Lux * Tools/GSspell.m (-createBundleAtPath:languages:, -removeBundleAtPath:, -synchronizeLanguages, main): Maintain a small bundle in the user's Services directory to automatically vend the supported languages besides AmericanEnglish. 2010-02-26 Richard Frith-Macdonald * Source/GSServicesManager.m: NSUpdateDynamicServices() ask workspace to rebuild cache of application information so the update from cache is actually loading the latest data. * Source/NSLayoutManager.m: Fix for insertion point of empty document. Not sure this is ever needed in normal use. 2010-02-25 22:37-EST Gregory John Casamento * Source/NSClipView.m: Correction for crash. 2010-02-25 Riccardo Mottola * Source/NSDrawer.m: removed c99-isms * Source/GSTitleView.m: removed c99-isms 2010-02-24 Richard Frith-Macdonald * Source/NSPasteboard.m: remove obsolete code for setting up invocation. 2010-02-24 Fred Kiefer * Source/NSPopUpButtonCell.m (-setObjectValue:): Synchronise the title. 2010-02-24 Riccardo Mottola * Source/NSBrowser.m, * Source/NSMatrix.m: use controlColor for the background to match Cocoa behaviour. 2010-02-22 Wolfgang Lux * Source/NSButtonCell.m (-setImagePosition): Never call NSCell's -setType: to change the cell's type, as this could eventually reset the button's image or title. Neither of this is desirable as it prevents temporarily hiding the image or title by changing the image position. 2010-02-22 Wolfgang Lux * Tools/GSspell.m (-spellServer:findMisspelledWord...): Check misspelled words reported by aspell against the user dictionaries so that the current document's ignored words are not returned back to the spell checker. 2010-02-21 Fred Kiefer * Headers/Additions/GNUstepGUI/GSDisplayServer.h: Check for "#if !NO_GNUSTEP" instead of "#ifndef NO_GNUSTEP" as base has changed this to always being defined. 2010-02-20 Fred Kiefer * Headers/AppKit/NSFont.h, * Headers/Additions/GNUstepGUI/GSFontInfo.h, * Source/GSFontInfo.m, * Source/NSAffineTransform.m, * Source/externs.m, * Source/NSFont.m: Adopt to the fact that NSAffineTransform now uses a matrix of CGFloats. 2010-02-20 Fred Kiefer * Headers/AppKit/NSAttributedString.h, * Source/NSAttributedString.m, * Source/GSNibLoading.m, * Headers/AppKit/NSScroller.h, * Source/NSScroller.m, * Headers/Additions/GNUstepGUI/GSGormLoading.h, * Source/GSGormLoading.m, * Source/NSSearchField.m, * Headers/Additions/GNUstepGUI/GSLayoutManager.h, * Source/NSColor.m: Make the signatures of methods consistent between headers and implementation files. 2010-02-20 Fred Kiefer * Source/GSGuiPrivate.h: Include preface.h from base. * Source/NSImageCell.m, * Source/NSTableHeaderView.m, * Source/NSWorkspace.m, * Source/NSTextBlock.m, * Source/NSButtonCell.m, * Source/NSClipView.m, * Source/NSSplitView.m, * Source/NSBezierPath.m, * Source/NSApplication.m, * Source/NSMenuItemCell.m, * Source/NSTextContainer.m, * Source/NSBitmapImageRep+GIF.m, * Source/NSTextView.m, * Source/NSBitmapImageRep+JPEG.m, * Source/NSComboBoxCell.m, * Source/tiff.m, * Source/GSServicesManager.m, * Source/NSCell.m, * Source/NSBrowserCell.m, * Source/NSView.m, * Source/NSBitmapImageRep+ICNS.m, * Source/NSAnimation.m, * Tools/set_show_service.m, * Tools/make_services.m: Fix up includes to make gui compile again with latest base. 2010-02-20 Wolfgang Lux * Tools/GSspell.m: Rewrite to support multiple languages. The spell server at runtime detects aspell's installed dictionaries and publishes each supported language. * Source/NSSpellChecker.m (-_popuplateDictionaryPulldown:): Sort dictionaries in the pop up menu. Note: At present, users or an administrator must manually update the Info.plist file of GSspell.service to really be able to use languages besides American English. 2010-02-20 Wolfgang Lux * Source/NSSpellChecker.m (-awakeFromNib): Set becomesKeyOnlyIfNeeded panel attribute to YES. * Panels/English.lproj/GSSpellPanel.gorm: * Panels/Spanish.lproj/GSSpellPanel.gorm: Fix attribute settings for the guess list browser: There is just one column, the browser therefore needs no horizontal scroller, and it makes no sense to enable multiple selection (which in addition would prevent the browser from working when the spell panel is not key). 2010-02-20 Wolfgang Lux * Source/NSColorPanel.m (-_initWithoutGModel): * Source/NSFontPanel.m (-_initWithoutGModel): Set becomesKeyOnlyIfNeeded panel attribute to YES. * ColorPickers/GSWheelColorPicker.m (-acceptsFirstMouse:, acceptsFirstResponder): Accept first mouse, so that the color wheel can be used when the Color panel is not key window. * Source/NSTextField.m (-needsPanelToBecomeKey): * Source/NSTextView.m (-needsPanelToBecomeKey): Return YES also if a text field or view is selectable but not editable. Primarily makes the combo box in the color list picker usable if the Color panel is not first responder. In addition, this change ensures that the standard key equivalents Cmd-C and Cmd-A (Copy and Select All) will work as expected after clicking selectable text in a window that is not key. 2010-02-20 Wolfgang Lux * TextConverters/RTF/RTFConsumer.h: Add encoding attribute to RTFConsumer. * TextConverters/RTF/RTFConsumer.m (initStringContext, readString, -init, -parseRTF:documentAttributes:class:, GSRTFmangleText): Convert characters to Unicode only after all hex-escapes, which use the document's code page, have been expanded. Fixes an issue where some non-ASCII characters in RTF documents created on Mac OS (X) got mixed up. * TextConverters/RTF/RTFProducer.m (-_headerString): Fix RTF header to use code page 1252 instead of 10000. Fixes an issue where some RTF readers would assume our encoding is Mac OS Roman and hence mix up some non-ASCII characters in our documents. 2010-02-20 Wolfgang Lux * Source/NSTextView.m (-writeSelectionToPasteboard:types:): Add forgotten test to apply smart insert and delete during drag and drop only when selection granularity is select by word. 2010-02-18 17:21-EST Gregory John Casamento * Source/NSWindow.m: Remove private menu - (void) _menuUpdate, since it was causing performance issue on windows as the menu was updating each time through the runloop. 2010-02-17 Fred Kiefer * Source/NSApplication.m (gnustep_backend_framework): Replace base extension method with standard one. * Source/NSCell.m (-setTitleWithMnemonic:): Replace base extension method with standard one. * Headers/AppKit/NSCell.h: * Source/NSCell.m (-takeIntegerValueFrom:, -setIntegerValue:) (-integerValue): Add OSX 10.5 methods. 2010-02-15 Fred Kiefer * Source/NSTextView.m (-replaceTextContainer:): Implement this missing method. * Source/NSTextContainer.m (-setTextView:): Adjust the container size to the new view. * Source/GSHorizontalTypesetter.m (-layoutLineNewParagraph:): Better break condition for loop. 2010-02-15 Wolfgang Lux * Source/NSSpellChecker.m (_findNext:, _ignore:, _correct:): Send messages down to the responder chain of the main window only, to avoid spell checking the Spelling panel's own text field. * Tools/GSspell.m (uniLength, -spellServer:findMisspelledWord...): Fix up the returned range when the checked string contains non-ASCII characters. 2010-02-15 Wolfgang Lux * Source/NSTextView.m (-setSelectedRange:affinity:stillSelecting:): Update the typing attributes of a rich text view also if the selected range has a non-zero length. Fixes a problem where, e.g., corrections from the spell panel could use wrong attributes. 2010-02-14 Quentin Mathe * Source/GSDragView.m (-_handleDrag:slidePoint:): Fixed to create a GSAppKitDraggingDrop event with a valid location. 2010-02-12 Eric Wasylishen * Source/NSMenu.m: Make the background color of NSMenuPanel clear * Source/GSThemeDrawing.m: in drawBackgroundForMenuView:withFrame:dirtyRect:horizontal:, when not using tiles, fill the background of the menu with the window background color. Now themes can draw semitransparent menus, and they work properly. 2010-02-12 19:44-EST Gregory John Casamento * Source/NSBrowser.m: Make sure that the matrix used in the browser draws its cell backgrounds properly. 2010-02-12 Eric Wasylishen * Source/NSMenuView.m (-isOpaque): Return NO from isOpaque, so -[GSThemeDrawing drawBackgroundForMenuView:withFrame:dirtyRect:horizontal:] can draw semitransparent menus if the theme author wishes. 2010-02-12 Eric Wasylishen * Source/GSThemeDrawing.m: Make the window border color customizable 2010-02-12 Eric Wasylishen * Headers/Additions/GNUstepGUI/GSTheme.h: * Source/GSTheme.m: * Source/GSThemeDrawing.m: Allow themeing NSColorWell. The part names is GSColorWell 2010-02-12 Eric Wasylishen * Source/GSThemeDrawing.m: Allow customization of window title text color for key/normal/main windows. New color names are: keyWindowFrameTextColor normalWindowFrameTextColor mainWindowFrameTextColor 2010-02-12 German Arias * Source/GSTitleView.m: Search in theme colors: GSMenuBar and GSMenuBarTitle (both GSThemeNormalState). If not present, set black and white respectively. 2010-02-12 Wolfgang Lux * Source/NSTextView_actions.m (killBuffer, -deleteToEndOfLine:, -yank:): Implement the NSText kill buffer; -deleteToEndOfLine: saves the deleted text to the kill buffer, -yank: inserts the contents of the kill buffer. * KeyBindings/DefaultKeyBindings.dict: Enable the keybinding for the yank: command. 2010-02-12 Wolfgang Lux * Source/NSTextView.m (-_characterIndexForPoint:respectFraction:): Fix issue where the insertion point was put at the end of the last but one line when the user clicks in or below the last line with the mouse and the last line is empty. * Source/NSLayoutManager.m (-characterIndexMoving:...): Add extra test to allow moving downward into an empty last line. Fixes #15893. * Source/NSLayoutManager.m (-_insertionPointRect...:textContainer:): Add special case for end of text. Fixes an issue where the insertion point is not set correctly when the last line ends with an invisible character (e.g., a tab). 2010-02-12 Wolfgang Lux * Source/NSAttributedString.m: * Source/NSDocument.m: Fix a whole bunch of potential crashers where the error return parameter was written to without a null pointer check. 2010-02-11 Eric Wasylishen * NSTableHeaderView.m: * GSThemeDrawing.m: Move code in NSTableHeaderView which leaves a 1pt gap underneath table headers to GSThemeDrawing, since it only looks decent with a NeXT-like theme. This fixes the misalignment between the table corner and the table headers visible in the Narcissus theme. 2010-02-11 Nicola Pero * Source/GNUmakefile.postamble: Removed obsolete manual dependency rule. Dependencies of object files on header files are automatically computed by gnustep-make, so this rule was superfluous. 2010-02-11 Nicola Pero * Source/GNUmakefile: Do not try including the non-existing GNUmakefile.local file. * ColorPickers/GNUmakefile: Same change. * Documentation/GNUmakefile: Same change. * Model/GNUmakefile: Same change. * Panels/GNUmakefile: Same change. * PrinterTypes/GNUmakefile: Same change. * Tools/GNUmakefile: Same change, plus do not try including the non-existing GNUmakefile.local.service file either. * Model/GNUmakefile.postamble (after-distclean): Do not remove the non-existing GNUmakefile.local file. * Source/GNUmakefile.postamble (after-distclean): Same change. * Tools/GNUmakefile.postamble (after-distclean): Do not remove the non-existing GNUmakefile.local and GNUmakefile.local.service files. * Documentation/GNUmakefile: Do not include aggregate.make twice. * KeyBindings/GNUmakefile (after-uninstall): Remove the $(GNUSTEP_LIBRARY)/KeyBindings directory if empty. * Model/GNUmakefile: Do not include library.make when GUI_LIB = gnu. 2010-02-11 Riccardo Mottola * Source/NSWindow.m: revert accidental commit 2010-02-10 Riccardo Mottola * Source/NSSavePanel.m: Do not draw Form background. * Source/NSMatrix.m: drawsBackground and drawsCellBackground default to NO, to match Cocoa behaviour (and improve theming) 2010-02-10 Eric Wasylishen * Source/NSScrollView.m (-scrollWheel:): Respond to horizontal scrolling. 2010-01-14 Doug Simons * Source/NSDrawer.m: Make drawers work, including: - implement drawer sliding (by resizing, since window ordering can't be controlled cleanly) - properly handle top and bottom drawers as well as left and right - keep track of _latestParentFrame for efficiency, and speed up timer for better responsiveness - bring parent window to front when drawer is clicked - keep drawer positioned properly when window is miniaturized and deminiaturized 2010-01-14 Doug Simons * Source/NSView.m (-dealloc): Remove subviews AFTER next/previous key views have been cleaned up, in case any subviews were in the view chain. 2010-02-09 Richard Frith-Macdonald * Source/GSTextStorage.m: Restore return of proxy to user code. Add comments so we know we should be doing that. * Headers/AppKit/NSTextStorage.h: Document the behavior of the -string method. 2010-02-07 Eric Wasylishen * ColorPickers/GSWheelColorPicker.m: Make the brightness slider for the wheel picker continuous. 2010-02-07 Eric Wasylishen * Source/GSThemeDrawing.m (-drawTitleBarRect:forStyleMask:state:andTitle:): Draw window title bar with image tiles, if available 2010-02-07 Eric Wasylishen * Source/GSTheme.m: * Source/GSThemePrivate.h: * Source/GSThemeDrawing.m (-drawBorderType:frame:view:): Draw borders using image tiles, if available. 2010-02-07 Eric Wasylishen * Source/NSPopUpButtonCell.m (-selectItem:): Mark the previously selected item as needing display. This fixes the 'popup' indicators not being erased. 2010-02-07 Riccardo Mottola * Source/NSToolbarItem.m (_isFlexibleSpace): use proper class check instead of quick and dirty size check for flexible space property. Otherwise items are not allowed to have differing minimum and maximum sizes. 2010-02-06 Quentin Mathe Fixed table header/content random disappearance with unarchived table views. * Source/NSTableView.m (-initWithCoder:): Fixed _columnsOrigin to be always initialized by calling -tile with non-keyed unarchiving. Until now, in case no method that invokes -tile was called before the display, the table header view was not drawing the table header cells but just an empty black stroked rect, since -columnAtPoint: was returning invalid values. This was rarely visible since you usually set a data source with an outlet and -setDataSource: calls -tile. Also fixed a _columnOrigins memory with keyed unarchiving. (-initWithCoder:, -encodeWithCoder:): Added double action keyed archiving. * Source/NSScrollView.m (-initWithCoder:): Fixed to only decode the flags we really encode, otherwise we read random memory and the flags are then incorrect. This can prevent the table header/content to be drawn in a table view enclosed in a scroll view, and also result in keyed archiving exceptions complaning about some NaN rect values. 2010-02-05 16:26-EST Gregory John Casamento * Headers/Additions/GNUstepGUI/GSWindowDecorationView.h: Added declarations for hasMenu/hasToolbar methods. * Source/GSWindowDecorationView.m: Added methods to check if a menu/ toolbar are present. 2010-02-03 Quentin Mathe * Source/NSWindow.m (-sendEvent:): Fixed button action which were sent to the button itself when the target is the first responder. We don't give anymore the first responder status to a button on a click. 2010-02-01 Eric Wasylishen * Source/NSStepperCell.m: Correct clamping behaviour as I did to NSSliderCell earlier. 2010-02-01 Eric Wasylishen * Source/GSThemeDrawing.m: Preliminary support for themeing the window resize bar with tiles. 2010-02-01 Eric Wasylishen * Source/GSTheme.m: * Source/GSThemeDrawing.m: * Source/NSButtonCell.m * Headers/Additions/GNUstepGUI/GSTheme.h: Add a new theme state, GSThemeDisabledState. 2010-01-31 Eric Wasylishen * Source/GSTheme.m: * Source/GSThemeDrawing.m: * Headers/Additions/GNUstepGUI/GSTheme.h: Use theme tiles (if available) to draw progress bars. New tile name: GSProgressIndicatorBarDeterminate 2010-01-31 Eric Wasylishen * Source/GSThemeDrawing.m: Use theme tiles (if available) to draw segmented controls, chosen based on the segment style constant, and falling back to drawing buttons if the segment tiles are not available. 2010-01-29 Eric Wasylishen * Source/GSTheme.m: * Source/GSThemeDrawing.m: * Headers/Additions/GNUstepGUI/GSTheme.h: Use theme tiles (if available) to draw menu backgrounds and items. New tile names: GSMenuHorizontalBackground GSMenuVerticalBackground GSMenuHorizontalItem GSMenuVerticalItem 2010-01-29 22:14-EST Gregory John Casamento * Headers/Additions/GNUstepGUI/GSTheme.h: Added new method declaration for updateAllWindowsWithMenu: * Source/GSThemeMenu.m: Added default implementation of updateAllWindowsWithMenu: * Source/NSMenu.m: Added call to updateAllWindowsWithMenu: on current theme. 2010-01-29 Eric Wasylishen * Source/NSTableHeaderCell.m: * Source/GSTheme.m: * Source/NSTableHeaderView.m: * Source/GSThemeDrawing.m: * Headers/Additions/GNUstepGUI/GSTheme.h: Use theme tiles (if available) to draw table headers. New tile names are GSTableHeader and GSTableCorner. 2010-01-29 Eric Wasylishen * Source/GSThemeDrawing.m (-cellForScrollerKnobSlot:): If there are tiles available, set the button cell as bordered so the tiles are used in drawing the scroller slot. 2010-01-29 Eric Wasylishen * Source/GSTheme.m: * Source/GSThemeDrawing.m: * Source/GSThemePrivate.h: Add GSStringFromBezelStyle and GSStringFromSegmentStyle functions which return the string name of the style constant for buttons and segmented controls. In -[GSThemeDrawing drawButton:view:style:state], use GSStringFromBezelStyle to try to get tiles for the specified bezel style, falling back to the normal NSButton tiles if the fancy tiles aren't present. 2010-01-28 Eric Wasylishen * Headers/AppKit/NSPanel.h: Added panel style constants NSNonactivatingPanelMask and NSHUDWindowMask 2010-01-28 Eric Wasylishen * Source/NSSegmentedCell.m: NSSegmentItem should be enabled by default 2010-01-28 Eric Wasylishen * Source/GSThemeDrawing.m: * Source/NSSegmentedCell.m: * Source/NSSegmentedControl.m: * Headers/AppKit/NSSegmentedCell.h: * Headers/AppKit/NSSegmentedControl.h: * Headers/Additions/GNUstepGUI/GSTheme.h: Add GSTheme method for NSSegmentedCell drawing. Implemented segmentStyle and setSegmentStyle: methods. 2010-01-28 Eric Wasylishen * Source/NSButtonCell.m -isOpaque: Return NO if the button cell has a bezel style set. This is consistent with OS X, and fixes drawing glitches seen in the GSTest NSButton test. 2010-01-28 Eric Wasylishen * Headers/AppKit/NSButtonCell.h: Correct a typo: NSTexturedRoundBezelStyle should be NSTexturedRoundedBezelStyle 2010-01-28 Eric Wasylishen * Headers/Additions/GNUstepGUI/GSTheme.h: * Source/NSTableHeaderCell.m: * Source/GSThemeDrawing.m: Factor out table header cell drawing into a new GSTheme method, -drawTableHeaderCell:withFrame:inView:state: 2010-01-27 Eric Wasylishen * Headers/Additions/GNUstepGUI/GSTheme.h: * Source/NSMenuView.m: * Source/GSThemeDrawing.m: Create a new GSTheme method for drawing the background of NSMenuView, -drawBackgroundForMenuView:withFrame:dirtyRect:horizontal: 10-01-27 Eric Wasylishen * Source/GSThemeDrawing.m: Undo an accidental commit of some testing code in r29416 2010-01-28 Wolfgang Lux * Source/NSApplication.m (-_windowWillClose:, -_lastWindowClosed:): Send -applicationShouldTerminateAfterLastWindowClosed: to the delegate only after a short delay so that all observers can process the NSWindowWillCloseNotification. This ensures that a modified document associated with the closed window has been closed before -terminate: is called and therefore the user isn't asked twice whether she wants to save the unsaved changes. 2010-01-28 Wolfgang Lux * Source/GSIconManager.m (GSGetIconFrame): Don't touch icon positions when the icon manager is not used, so that any icon placement performed by the user does not get lost when a miniwindow is deminiaturized. 2010-01-27 Wolfgang Lux * Source/NSTextView.m (smartLeftChars, smartRightChars, +initialize, -copy:, -smartDeleteRangeForPropsoedRange:, -smartInsertAfterString..., -smartInsertBeforeString..., -readSelectionFromPasteboard:type:, -writablePasteboardTypes, -writeSelectionToPasteboard:types:, -performDragOperation:, -dragSelectionWithEvent:offset:slideBack:) * Source/NSTextView_actions.m (-deleteForward:, -deleteBackward:): Implement smart insert and delete and use it when cutting, copying, pasting, and deleting full words. Note: I have changed NSTextView initialization to enable smart insert and delete by default, since this is the default on OS X. (It is even documented, though in a maybe obscure place, cf. "Text Editing Programming Guide for Cocoa: Subclassing NSTextView".) However, this means that support for this feature will be somewhat inconsistent. Smart insert and delete is enabled for text views created programmatically (including the field editor), but not for text views loaded from existing nib files. * Source/NSTextView.m (-toggleSmartInsertDelete:): Implement missing method introduced in Mac OS X 10.5. 2010-01-27 Eric Wasylishen * Source/GSThemeDrawing.m (-buttonBorderForCell:style:state:): Use the new contentRect when calculating the border for tiles 2010-01-27 Eric Wasylishen * Source/GSThemeTools.m: Correct implementation of contentRectForRect: 2010-01-27 Eric Wasylishen * Source/GSThemeTools.m: * Source/GSThemePrivate.m: Added a contentRect feature to GSDrawTiles. Previously, GSDrawTiles assumed that the rect the user would draw in was exactly the center middle rect; i.e. the return value of the xxStlyeFillRect: methods was the center middle rect scaled to fit inside the drawing rect. Now this can be customized in Nine Patch tiles; see the diagrams at: http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch 2010-01-27 Fred Kiefer * Source/NSColor.m: (-hash): Don't use a dynamic union, as clang doesn't support this. Patch by Niels Grewe . 2010-01-27 Fred Kiefer * Source/NSAttributedString.m (-rangeOfTextTable:atIndex:): Add implementation for this method, done during LindauSTEP. 2010-01-27 Quentin Mathe * Headers/GNUstepGUI/GSTheme.h: * Source/GSThemeDrawing.m: (-titleViewClassForMenuView:): Added the possibility to customize the title view with this new method. * Source/NSMenuView.m (-update): Modified to loop uk the title view class through the active theme rather than just using GSTitleView. 2010-01-27 Quentin Mathe * Source/NSApplication.m (-_postAndSendEvent:): Added. * Source/GSDragView (-_sendLocalEvent:action:position:timestamp:toWindow:): Dispatch drag events -[NSApp _postAndSendEvent:] to match Mac OS X behavior. 2010-01-26 Eric Wasylishen * Source/NSView.m (-setHidden:): When hiding a view, we need to call -setNeedsDisplay:YES on the superview, rather than self 2010-01-26 Eric Wasylishen * Source/NSView.m (-setHidden:): Fix un-hiding of hidden views, loaded from nib's, with subviews. The subview coordinates just need to be invalidated when the view is unhidden. 2010-01-24 03:07-EST Gregory John Casamento * Source/NSWindow.m: Uncomment updateMenu:.. method call in -[NSWindow update] method. 2010-01-23 Eric Wasylishen * Source/NSColorWell.m: Add a minimum distance which you need to drag the color from a well before it is treated as a drag. TODO: Unify this with the dragging threshold in other parts of gui and make a user default called GSDragThreshold, maybe? 2010-01-23 Eric Wasylishen * Source/GSWindowDecorationView.m: In drawRect:, clear the window background before getting the theme to draw its background. This makes windows with semitransparent background colors work properly. NOTE: While the clear operation is very fast, we may want to only do it if the window background colour has an alpha value of < 1. 2010-01-23 Eric Wasylishen * Source/NSMenuView.m: For horizontal menus, treat clicking in the 8 pixels of padding to the left of the first menu item as activating the first menu item. This lets you open the application menu with a Macintosh-syle menu bar when the mouse is on the top-left pixel of the screen. 2010-01-23 18:41-EST Gregory John Casamento * Headers/Additions/GNUstepGUI/GSTheme.h: Add updateMenu:forWindow: * Source/GSThemeMenu.m: Add default implementation of new method. * Source/GSWindowDecorationView.m: Add code to use value returned from menuHeightForWindow:. * Source/NSWindow.m: initWithContentRect:.. call setMenu: here so that the menu is added immediately when the window is created. Also add code to update menus. 2010-01-20 German Arias * Resources/Spanish.lproj/Localizable.strings: Added translation to "Opacity". * ColorPickers/Spanish.lproj/StandardPicker.strings: Corrected the file path in the commentary. 2010-01-20 Riccardo Mottola * Source/NSWindow: do not process GSAppKitWindowLeave events for closed windows 2010-01-19 13:49-EST Gregory John Casamento * Source/NSMenu.m: Allow menus attached to popups to come up in Windows95 mode. 2010-01-19 Fred Kiefer * Source/NSMenu.m (-initWithCoder:): Use YES as default value for AutoenablesItems. 2010-01-18 Riccardo Mottola * Source/NSImage.m: _useFromFile: make extension checking case insensitive 2010-01-17 01:04-EST Gregory John Casamento * Source/NSWindow.m: Temporarily revert previous change for debugging. 2010-01-16 Quentin Mathe * Source/NSTableView.m (-_selectColumn:modifiers:): Rewrote to be simpler, support selection by range as Cocoa does and to remove the toggle selection behavior when a column is clicked twice. This toggle behavior was in conflict with the ability to change the sort direction by clicking in an already selected column header. 2010-01-16 14:55-EST Gregory John Casamento * Source/NSWindow.m: Don't use the flags for key/main window tracking. These flags are getting out of sync due to different behavior on different backends. Also, it's better to keep the state in one place instead of keeping them in sync. I changed all of the instances of _f.is_key to [self isKeyWindow] and all of the instances of _f.is_main to [self isMainWindow] and those methods now check with NSApp to determine if the current window is main. I realize this is slower than the previous method of using flags, but it is also more resilient and reliable when the backend sends extra events. This corrects the issue on Windows where we were losing the main window and had two windows marked as "main". 2010-01-16 Quentin Mathe Finished to implement the NSTable/OutlineView sort descriptor support. More changes are needed to get proper sorting support (e.g. visual feedback). * Headers/NSTableView.h: Added _sortDescriptors ivar. (-tableView:sortDescriptorsDidChange:): Declared. * Source/NSTableView.m (-_clickTableColumn:, -_didChangeSortDescriptors:): Added. (-_initDefaults, -dealloc): Modified to initialize/release _sortDescriptors ivar. (-initWithCoder:, -encodeWithCoder:): Modified to support archiving the sort descriptors. (-setSortSelectors:, -sortSelectors): Implemented. * Source/NSTableHeaderView.m (-mouseDown:): Modified to now call -_clickTableColumn which prepares the sort descriptors among other things. -_didClickTableColumn: will be called by -_clickTableColumn:. * Headers/NSOutlineView.h (-outlineView:sortDescriptorsDidChange:, -outlineView:didClickTableColumn:): Declared. * Source/NSOutlineView.m (-_didClickTableColumn:, -_didChangeSortDescriptors:): Added overriden NSTableView methods. 2010-01-15 German Arias * Source/NSImage.m: Changes to fix bug #28580. 2010-01-15 13:08-EST Gregory John Casamento * Headers/Additions/GNUstepGUI/GSTheme.h: Added method to call back menuHeightForWindow: * Source/GSThemeMenu.m: Added default implementation of menuHeightForWindow:. Default implementation returns NSMenuView menuBarHeight. * Source/GSWindowDecorationView.m: Use menuHeightForWindow: instead of getting it directly from the menu view. 2010-01-14 Doug Simons * Source/NSWindow.m (-_initBackendWindow): Raise an exception instead of crashing (at least on Windows) when we fail to obtain a window from the back end. 2010-01-14 07:08-EST Gregory John Casamento * Source/NSApplication.m: For hide: perform miniaturizeAll: on Windows, since hiding the app causes it to be inaccessible on that platform. 2010-01-14 04:07-EST Gregory John Casamento * Source/NSToolbarFrameworkPrivate.h: Correct include for new location of GSWidnowDecorationView.h. 2010-01-14 03:19-EST Gregory John Casamento * Source/GSWindowDecorationView.h: Removed from here since I moved it to the GNUstepGUI headers. 2010-01-13 15:49-EST Gregory John Casamento * Headers/Additions/GNUstepGUI/GSTheme.h: Added methods to support adding menus and processing commands from windows, if appropriate. * Headers/Additions/GNUstepGUI/GSWindowDecorationView.h: Added new methods for menu and toolbar flags. * Headers/AppKit/NSInterfaceStyle.h: Added new interface style. * Source/GNUmakefile: Added header. * Source/GSStandardWindowDecorationView.m: Change include to include header in new location. * Source/GSThemeMenu.m: Default theme implementation for Menus. * Source/GSWindowDecorationView.m: Add the setHasMenu:/setHasToolbar: flags. * Source/NSWindow.m: Use the theme to set the menu instead of setting it directly. 2010-01-11 Wolfgang Lux * Source/NSDocument.m (-writeSafelyToURL:ofType:...): Ensure proper working of autosaving for subclasses that override -writeWithBackupToFile:ofType:saveOperation. * Source/NSProgressIndicator.m (-setDisplayedWhenStopped:): Fix incorrect assignment which made this method a no-op. 2010-01-11 Fred Kiefer * Resources/Italian.lproj/Localizable.strings: Regenerate this file and add escaping of non-ASCII characters. 2010-01-11 Quentin Mathe * Source/NSOutlineView.m (-editColumn:row:withEvent:select:): Fixed broken cell editability by replicating NSTableView changes r25091. 2010-01-11 Fred Kiefer * TextConverters/RTF/RTFConsumer.m (RTFDConsumer-appendImage:): Flag the attributes as being changed. This prevents the next appended string from getting that attachment attribute. * TextConverters/RTF/RTFConsumer.m (GSRTFunicode): Don't append the attachment character. * Source/NSAttributedString.m (-fixAttachmentAttributeInRange:): Keep the local copy of string up to date. 2010-01-09 Wolfgang Lux * Source/NSTextView.m (-performDragOperation:): Fix a bug that prevented changing the color of the selected text of a text view via drag and drop. 2010-01-08 Riccardo Mottola * Source/NSScroller: init scrollerWidth to 0.0, so that GSTheme can properly override it. 2010-01-06 Fred Kiefer * TextConverters/RTF/RTFConsumer.m (RTFDConsumer-appendImage:): Set the icon of the file wrapper to the image. 2010-01-05 Fred Kiefer * TextConverters/RTF/RTFConsumer.m (-parseRTF:...class:): Try to determine the encoding of the RTF data. 2010-01-05 03:39-EST Gregory John Casamento * Source/NSMenu.m: Do not show the menu at the top of the screen in NSWindows95InterfaceStyle mode. 2010-01-04 00:25-EST Gregory John Casamento * Source/GSWindowDecorationView.[hm]: Addition of ivars to track if a toolbar or menu is present in the window decorations. Modified code to set these to YES/NO. 2010-01-04 Riccardo Mottola * Source/GSWindowDecorationView.m: When adding a toolbar take in account the possibly existing in-window menu. When removing the in-window menu take care of shifitng the toolbar view up. 2010-01-03 German Arias * Source/NSPrintPanel.m, * Source/NSPrintOperation.m, * Source/GSThemeInspector.m: Added missing internationalisation, now is completed (or so I hope). * Resources/Spanish.lproj/Localizable.strings: More strings in spanish (with this the translation to spanish is finished). 2010-01-03 Fred Kiefer * Resources/English.lproj/Localizable.strings: Regenerate this file. * Resources/German.lproj/Localizable.strings: Regnerate and add some translations. 2010-01-03 German Arias * Panels/Spanish.lproj/GSPageLayout.gorm/objects.gorm, * Panels/Spanish.lproj/GSPrintPanel.gorm/objects.gorm: Changed some strings. 2010-01-03 German Arias * Source/GSInfoPanel.m: Added missing internationalisation. * Source/GSThemePanel.m: Added missing internationalisation. * Source/NSHelpPanel.m: Added missing internationalisation. * Resources/Spanish.lproj/Localizable.strings: More strings in spanish. 2010-01-03 German Arias * Source/NSPrintPanel.m: Added missing internationalisation. * Resources/Spanish.lproj/Localizable.strings: More strings in spanish. 2010-01-03 German Arias * Source/NSPageLayout.m: Added missing internationalisation. * Resources/Spanish.lproj/Localizable.strings: More strings in spanish. 2010-01-03 German Arias * Source/NSFontPanel.m: Added missing internationalisation. * Resources/Spanish.lproj/Localizable.strings: More strings in spanish. 2010-01-03 German Arias * Resources/Spanish.lproj/Localizable.strings: More strings in spanish. 2010-01-02 German Arias * Source/NSOpenPanel.m: Reverted some previous changes, added GSGuiPrivate.h. * Source/NSColorPanel.m: Added GSGuiPrivate.h. * Source/NSDocument.m: Added missing internationalisation. * Resources/Spanish.lproj/Localizable.strings: More strings on spanish. 2010-01-02 Fred Kiefer * Source/NSColorPanel.m, * Source/NSOpenPanel.m, * Source/NSSavePanel.m: Add missing internationalisation. 2009-12-31 Eric Wasylishen * Source/NSShadow.m, Headers/AppKit/NSShadow.h: Added NSShadow implementation; doesn't actually draw anything yet. 2009-12-31 German Arias * ColorPickers/Spanish.lproj/StandardPicker.strings, * Resources/Spanish.lproj/Localizable.strings: Fixed incorrect characters. 2009-12-31 German Arias * Resources/Spanish.lproj/Localizable.strings: Added. * Resources/GNUmakefile: Added Spanish language. 2009-12-30 German Arias * Panels/Spanish.lproj/GSDataLinkPanel.gorm, * Panels/Spanish.lproj/GSPageLayout.gorm, * Panels/Spanish.lproj/GSToolbarCustomizationPalette.gorm, * Panels/Spanish.lproj/GSPrintPanel.gorm, * Panels/Spanish.lproj/GSSpellPanel.gorm: Added. * Panels/GNUmakefile: Added Spanish language. 2009-12-30 German Arias * ColorPickers/Spanish.lproj/StandardPicker.strings: Added. 2009-12-29 Fred Kiefer * Headers/AppKit/NSImageView.h: Clean up. * Source/NSImageView.m: Clean up and addition of cut/copy/paste methods, based on code by Nikolaus Schaller . 2009-12-27 Quentin Mathe * Headers/NSTableView.h * Source/NSTableView.m (-columnIndexesInRect:): Added new Mac OS 10.5 method. 2009-12-26 Riccardo Mottola * Source/NSTextView.m: Corrected multi-line string constant * Source/NSCell.m: Corrected c99-ism 2009-12-23 Wolfgang Lux * Source/NSTextView.m (-dealloc, -breakUndoCoalescing, -shouldChangeTextInRange:replacementString:): Implement coalescing of undo actions for typing events. * Source/NSTextView.m (-selectedRange): Prevent crash when the receiver has no layout manager. 2009-12-23 Wolfgang Lux * Source/NSTableView.m (-mouseDown:): A single click into a cell of an unselected row can now change the cell's state even when the table view allows dragging. 2009-12-22 17:31-EST Gregory John Casamento * Source/NSCell.m: Corrected documentation in GUI to reflect that this does nothing in the default implementation, according to spec. 2009-12-22 Wolfgang Lux * Source/NSWindow.m (-validateUserInterfaceItem): * Source/NSWindow.m (-validateMenuItem): Generalize user interface validation for NSWindow. * Source/NSWindow.m (-undo:, -redo:): Use the first responder's undo manager if available. Avoids the need for overriding these methods in any responder class which supports undo/redo and is compatible with OS X. 2009-12-22 Wolfgang Lux * Source/NSAlert.m (makeScrollViewWithRect): * Source/NSAlert.m (-sizePanelToFit): If the message text is too wide to fit into the panel wrap its text to the scroll view's width. * Source/NSAlert.m (-sizePanelToFit): Limit the width and height of an alert panel to 60% of the screen's width and height, respectively. 2009-12-21 Wolfgang Lux * Source/NSScrollView.m (-isOpaque): Fix bug where an NSScrollView incorrectly claimed to be opaque while its clip view is not. * Source/NSOpenPanel.m (-setCanChooseDirectories): Reset the current selection of an open panel when directory selection is disabled. This prevents bogus directories being returned from the next modal session of the panel. * Source/NSSavePanel.m (-resetDefaults): Also reset the allowsOtherFileTypes attribute to its default when a fresh save panel is requested. 2009-12-21 Fred Kiefer * Source/GSIconManager.h, * Source/GSIconManager.m: New files. Allows to get icon placement from separate process. * Source/GNUmakefile: Add new file. * Source/NSWindow.m, * Source/NSApplication.m: Move icon handling into new file. Patch by German Arias . 2009-12-20 Eric Wasylishen * Source/NSColorWell.m: Draw a black-and-white pattern behind transparent color swatches. 2009-12-20 Eric Wasylishen * Source/NSColor.m: -[GSRGBColor isEqual:] was ignoring the alpha channel when testing equality. 2209-12-20 Eric Wasylishen * Source/NSColorWell.m * Source/GSThemeDrawing.m * Source/NSColorPanel.m * Headers/AppKit/NSColorWell.h: Finish NSColorWell interaction tweaks: - activation of the now happens on mouseUp, not mouseDown - non-bordered NSColorWells can't be activated by clicking - non-bordered NSColorWells start a drag operation upon mouseDown - disabled NSColorWells don't accept colours being dropped on them - dropping a colour on the well inside the NSColorPanel now also updates the active NSColorWell Also moved the static variable for keeping track of where the mouseDown occurred to an instance variable. 2009-12-21 Fred Kiefer * Source/NSTableColumn.m (-initWithCoder:, -encodeWithCoder:): Add the keyed encoding/decoding code for Quentin's extensions. 2009-12-20 Eric Wasylishen * Source/NSSliderCell.m: Some more changes to NSSliderCell to get BezierPathLab working, and a test suite in tests/testsuite/gui/NSSliderCell. Set the doubleValue to 0 in -init, unarchive the @"NSValue" key and set the floatValue to it when unarchiving, adjust setObjectValue: so that when minValue > maxValue, the slider cell takes its value to be minValue. Also override setContinuous: and isContinuous to use NSLeftMouseDraggedMask rather than NSPeriodicMask, which makes the continuous setting of sliders in Nibs work properly in GNUstep. 2009-11-24 David Chisnall * Source/NSApplication.m: Replaced two superfluous NSInvocation construction occurrences with direct calls to the IMP in question. 2009-12-19 Eric Wasylishen * Source/NSBezierPath.m: Change default flatness to 0.6 matching OS X 2009-12-19 Fred Kiefer * Source/NSCell.m (-setStringValue:): Remove optimisation for simple string case. Now -setObjectValue: is called in most cases. * Source/NSButtonCell.m (-attributedTitle, -setAttributedTitle:, -title, -setTitle:): Replace calls to super implementation with a simple local implementation. * Source/NSSliderCell.m: Remove most of the value setter methods, as they just duplicated super class behaviour. Move the setContinues: call into the init method. 2009-12-19 Fred Kiefer * Headers/AppKit/NSTextTable.h, * Source/NSTextTable.m, * Source/NSTextBlock.m, * Source/NSTextTableBlock.m: First attempt at implementing these classes. Code mostly by Nikolaus Schaller . 2009-12-11 Eric Wasylishen * Source/NSSliderCell.m: Rework the handling of maxValue and minValue. The cell's value is now clamped to the permisible range when it is set, rather than in floatValue, matching OS X behaviour. setMinValue: and setMaxValue: also clamp the current value. Also make NSSliderCell continuous by default when unarchived (matches OS X). 2009-12-17 Quentin Mathe * Source/NSTableView.m (-setDropRow:dropOperation:, -draggingUpdated): Corrected to support a drop on root with -1 as the drop row as explained in Cocoa documentation. 2009-12-17 Wolfgang Lux * Source/GSThemeDrawing.m (-drawProgressIndicator:withBounds:...): Prevent division by zero exception if no images are available for a spinning or indeterminate progress indicator. * Source/NSProgressIndicator.m (-setIndeterminate): Ensure that a running animation is stopped when an indeterminate indicator is changed into a determinate one. 2009-12-17 Wolfgang Lux * Source/NSComboBoxCell.m (-drawInteriorWithFrame:inView:): Fix bug where the field editor of an edited combo box cell overlaps the cell's ellipsis button. * Source/NSComboBoxCell.m (-endEditing): Make sure the pop up window is closed when editing ends. * Source/NSComboBoxCell.m (-validateSelection): Remove obsolete workaround code. 2009-12-17 Wolfgang Lux * Source/NSCell.m (-wraps, -setWraps:, -setLineBreakMode:, -initWithCoder:): Phase out the wraps cell attribute since it is implied by the lineBreakMode attribute. Note that with this change cells now wrap by default, as has always been the case on OS X. * Source/NSBrowserCell.m (-initTextCell:, -initImageCell:): * Source/NSTableColumn.m (-initWithIdentifier): Set default line break mode to NSLineBreakByTruncatingTail as on OS X. * Source/NSCell.m (-setUpFieldEditorAttributes:): Set the typing attributes of the field editor so that it uses the same paragraph style and in particular the same line break mode as the edited cell. This fixes an inconsistency where wrapped text would be displayed in a single line during editing. 2009-12-17 Wolfgang Lux * Source/NSCell.m (-_setupTextWithFrame:inView:editor:delegate:range): * Source/NSCell.m (-endEditing:): Properly set up the field editor and its text container to handle cells whose text is wrapped, cells which truncate their text, and cells with scrollable contents, respectively, and prepare the field editor and its enclosing clip view to be resizable. Use a clip view only when necessary. * Source/NSCell.m (-_drawEditorWithFrame:inView:): Auxiliary method to update the frame of a cell's editor when the cell has been resized or moved. * Source/NSCell.m (-_setInEditing:): Helper method that allows control views to flag their edited cell. * Source/NSCell.m (-drawInteriorWithFrame:inView): * Source/NSTextFieldCell.m (-drawInteriorWithFrame:inView): Do not draw the interior of an edited cell. * Source/NSTableView.m (-moveColumn:toColumn:): Update the column index of the edited cell if necessary. * Source/NSControl.m (-drawRect:): * Source/NSTableView.m (-drawRow:clipRect:): * Source/NSOutlineView.m (-drawRow:clipRect): Remove obsolete workarounds to prevent an edited cell from being drawn twice. The preceding changes also should fix #22678. 2009-12-16 Wolfgang Lux * Source/NSTextFieldCell.m (-drawInteriorWithFrame:inView:): Override method and use drawInRect: to draw the string of the text field so that long text can be wrapped. 2009-12-16 Wolfgang Lux * Source/NSOpenPanel.m (-_selectTextInColumn:, _selectCellName:, -controlTextDidChange:): Do a better job on validating the OK button. This makes it possible again to use the open panel for choosing directories. Also replaces the previous fix for bug #25471, which did not really work. * Source/NSBrowser.m (-doClick:): Fix NSBrowser so that branch cells are really deselected when multiple selection is enabled and allowsBranchSelection is set to NO. Also replace the workaround for bug #18881 by a better fix. 2009-12-15 Wolfgang Lux * Source/NSSavePanel.m (-ok:): Avoid the bogus warning that was shown when the panel requires a file type extension and the user has entered a file name without an extension. * Source/NSSavePanel.m (-filename): Do not replace an existing file type extension if allowsOtherFileTypes is set. * Source/NSSavePanel.m (-runModalForDirectory:file, -runModalForDirectory:file:relativeToWindow:, -beginSheetForDirectory:file:modalForWindow:modalDelegate:...): Initially enable the panel's OK button if a file name is provided to the modal session. 2009-12-15 Riccardo Mottola * Source/NSOutlineView.m: removed c99-isms 2009-12-11 Eric Wasylishen * Source/GSThemeTools.m: Correct the destination rect coordinates in scaleFillRect:, and the image slicing in initWithNinePatchImage: 2009-12-12 Eric Wasylishen * Source/NSBitmapImageRep.m: * Source/GSThemeTools.m: Change the colorAtX:y: and related methods in NSBitmapImageRep to use flipped coordinates, matching OS X. colorAtX:0 y:0 now returns the top-left pixel instead of the bottom left. 2009-12-12 Fred Kiefer * Source/NSApplication (-setWindowsMenu:): Only add windows that are either visible or miniaturized. 2009-12-11 13:09-EST Gregory John Casamento * Source/GSNibLoader.m: Added logging to help debugging of issues with nib loading. * Source/NSTextContainer.m: -[NSTextContainer initWithCoder:] removed call to unarchive the textview to prevent a leak. Also don't set the textview as the text container. Currently we just get the contents of the text container and rebuild it in NSTextView.m. 2009-12-10 Quentin Mathe * Headers/AppKit/NSKeyValueBinding.h: * Source/externs.m: * Source/NSWindow.m (+initialize, -bind:toObject:withKeyPath:options:): Added NSWindow 'title' binding. 2009-12-08 Quentin Mathe * Source/NSTableColumn.m (-dealloc): Fixed missing release for _sortDescriptorPrototype ivar. 2009-12-08 Quentin Mathe * Headers/NSTableColumn.h: * Source/NSTableColumn.m: Added all new table column methods and constants up to Mac OS X 10.6. These new additions remain to be fully implemented and the archiving code to be updated. 2009-12-08 Hans Baier * Source/NSColorWell.m (-mouseDragged:, -mouseDown:): Applied patch from Eric Wasylishen to activate it on click inside the colored rectangle (same behavior as in OS X) 2009-12-06 Quentin Mathe * Source/NSOutlineView.m (-draggingUpdated:): Fixed drop above as a child in the previous row (when this row is an empty parent). (-drawDropAboveIndicatorWithDropItem:atRow:childDropIndex:): Fixed the drop above indicator drawing when the level doesn't match the previous row. Done by including an extra row parameter which makes possible to remove the row computation code that appears to partially duplicate -parentRowForRow:atLevel:andReturnChildIndex:. 2009-12-05 Quentin Mathe * Source/NSTableView.m (-_startDragOperationWithEvent:): Modified to call -canDragRowsWithIndexes:atPoint: as expected. 2009-12-05 Quentin Mathe * Source/NSOutlineView.m (-draggingUpdated): Further simplified. Wrote detailed code documentation since the overall behavior is pretty complex. Fixed to compute the vertical and horizontal positions correctly when the view is scrolled. Fixed out of bounds exception when the pointer moves into the empty area below the rows (was trying to auto-expand the root item). Implemented drop on root indicator in addition to drop on row and drop drop above (works the same as Mac OS X). (-isExpandable:): Modified to always return NO when the item is nil (as Mac OS X does). (-drawDropAboveIndicatorWithDropItem:childDropIndex:, -drawDropOnRootIndicator, -drawDropOnWithDropItem:, -parentRowForRow:atLevel:andReturnChildIndex:): New methods extracted from -draggingUpdated. 2009-11-30 Richard Frith-Macdonald * Source/NSOutlineView.m: Improve DnD allowing drop on items as well as inside them. Attempt to mimix OSX behavior. Simplify code. Use triangular images similar to OSX appearance. Doubtless needs more polishing. 2009-11-29 Wolfgang Lux * Source/NSView.m (-dealloc): Fix bug where -dealloc could break the key view chain. * Source/NSSavePanel.m (-ok:): Present a warning when the user has entered a filename with a wrong extension. 2009-11-29 Richard Frith-Macdonald * Source/NSOutlineView.m: Improve display of insertion point for DnD Add auto-expand/collapse while dragging over expandable items. 2009-11-28 Richard Frith-Macdonald * Source/GSNibLoading.m: Fix/improve handling of main menu to be more intelligent about moving the 'quit' item and 'info' submenu. 2009-11-27 Richard Frith-Macdonald * Source/NSSplitView.m: Correct the storing of the splitter locations in the defaults system (the autosave mechanism) ... was using NSNumber keys which was causing this to fail. 2009-11-26 Richard Frith-Macdonald * Source/NSTableView.m: ([-noteNumberOfRowsChanged]) fixed to redraw the rectangle in the superview if the receiver shrinks. 2009-11-25 Wolfgang Lux * Source/NSCell.m (-_updateFieldEditor:): Don't write back unchanged strings to the field editor. Should prevent the editor's selection from changing when -validateEditing is called. * Source/NSCell.m (-setAttributedStringValue:): Consider the attributed string a valid object if the cell has no formatter. * Source/NSTextField.m (-textDidEndEditing:): Fix bug in textDidEndEditing:. Patch by Doug Simons . 2009-11-20 Richard Frith-Macdonald * Source/GSTheme.m: * Headers/Additions/GNUstepGUI/GSTheme.h: Added support for overriding methods in any class by implementing a corresponding method in your GSTheme subclass. 2009-11-19 Richard Frith-Macdonald * Source/GSTheme.m: * Source/NSMenuItemCell.m: * Source/GSThemeDrawing.m: * Source/NSScrollView.m: * Headers/Additions/GNUstepGUI/GSTheme.h: Separate cache control from normal fetching of tiles and colors. 2009-11-19 Richard Frith-Macdonald * Headers/Additions/GNUstepGUI/GSTheme.h: Improve documentation of -activate and -deactivate 2009-11-16 Richard Frith-Macdonald * Source/NSMenuItemCell.m: * Source/GSThemeDrawing.m: * Headers/Additions/GNUstepGUI/GSTheme.h: Removed duplicate theming methods... The ([-arrowImageForMenuItemCell]) method seems to have duplicated the ([-imageNamed:]) method (for the @"NSMenuItem" image) and the ([-backgroundColorForMenuItemCell:state:]) method seemed to have duplicated the ([colorNamed:state:cache]) method. We must not introduce extra APIs for getting images and colors or things will get unmaintainable. 2009-11-16 Fred Kiefer * Source/NSSlider.m: Clean up. * Source/NSSliderCell.m: Remove isFlipped method, correct copyWithZone:, clean up. 2009-11-16 Fred Kiefer * Source/NSCell.m (-setObjectValue:, -setStringValue:): Handle a value of nil identically in both cases. * Source/NSActionCell.m (-setObjectValue:, -setStringValue:): Only mark the cell for redraw when there is no editor. 2009-11-16 Fred Kiefer * Source/NSTextView.m (-validateUserIntefaceItem:): Move this method over from NSTextView_actions.m as the compiler is expecting it here. Add a few more actions. 2009-11-15 Fred Kiefer * Source/NSTextView.m (-validateUserIntefaceItem:): Remove the dummy implementation of this method as there is now a proper one in NSTextView_actions.m. 2009-11-15 Fred Kiefer * Source/NSButtonCell.m: Change default value for keyEquivalentModifierMask to 0. Add keyed decoding and encoding of keyEquivalentModifierMask. * Source/NSSearchFieldCell.m, * Source/NSSpellChecker.m: Add explicit keyEquivalentModifierMask setting. * Source/NSInputManager.m: Add handling of escape character to call cancelOperation: * Source/NSTextField.m: Fix textDidEndEditing: to send action when sendsActionOnEndEditing is set. Patch by Douglas Simons . 2009-11-14 Wolfgang Lux * Source/NSWindow.m (-sendEvent:): Always shift keyboard focus to the next and previous key view, respectively, upon receiving Ctrl-Tab and Ctrl-Shift-Tab keyboard events. * Source/NSTextView_actions.m (-validateMenuItem:, -validateUserIntefaceItem:): Implement menu and user interface item validation for NSTextView. The list of validated actions is incomplete but at least includes all items from a standard Edit menu. * Source/NSCell.m(-_setupTextWithFrame:inView:editor:delegate:range:, -_updateFieldEditor): * Source/NSActionCell.m (-setObjectValue:, -setStringValue:): Fix NSActionCell implementation so that -setObjectValue: and -setStringValue: have an effect while the cell is edited. 2009-11-14 Hans Baier * Source/GSThemeDrawing.m: fix bug introduced in last commit (progress bar fills the whole area) 2009-11-14 Hans Baier * Headers/Additions/GNUstepGUI/GSTheme.h, * Source/GSThemeDrawing.m: Factor out drawing of progress indicator's bezel and bar 2009-11-14 Hans Baier * Headers/Additions/GNUstepGUI/GSTheme.h, * Source/GSThemeDrawing.m, * Source/NSMenuItemCell.m: Make the menu arrow image themeable 2009-11-12 Fred Kiefer * Source/NSImage.m (-copyWithZone:): Set the name of the copy to nil, not that of the original image. 2009-11-12 Richard Frith-Macdonald * Source/NSImage.m: fixup copy/dealloc handling of named images 2009-11-12 Fred Kiefer * Source/NSWindow.m: Implement isZommed. Move the call to windowWillResize:toSize: from setFrame:display into setFrameFromString:. 2009-11-09 Fred Kiefer * Headers/Additions/GNUstepGUI/GSTheme.h, * Source/GSThemeDrawing.m, * Source/NSProgressIndicator.m: Move initialiation and drawing into GSTheme. 2009-11-09 Fred Kiefer * Headers/Additions/GNUstepGUI/GSTheme.h, * Source/GSThemeDrawing.m, * Source/NSColorWell.m: Move colour well border drawing into GSTheme. This change makes the dragable area of the well a bit smaller. 2009-11-09 Fred Kiefer * Headers/Additions/GNUstepGUI/GSTheme.h, * Source/GSThemeDrawing.m, * Source/NSTableView.m: Move corner view drawing into GSTheme. * Source/NSTextFieldCell.m: White space changes. * Headers/AppKit/NSTableHeaderCell.h, * Source/NSTableHeaderCell.m: Add new 10.3 methods. 2009-11-09 Fred Kiefer * Source/NSControl.m, * Headers/AppKit/NSStepper.h, * Headers/AppKit/NSStepperCell.h, * Source/NSStepper.m: White space changes and cleanup. * Source/NSStepperCell.m, * Headers/Additions/GNUstepGUI/GSTheme.h, * Source/GSThemeDrawing.m: Move stepper drawing code into GSTheme. 2009-11-09 Richard Frith-Macdonald * Source/NSScroller.m: make offset of buttons inside scroller adjustable for theming. 2009-11-08 Fred Kiefer * Source/NSActionCell.m, * Source/NSAffineTransform.m White space changes and cleanup. * Headers/AppKit/NSAnimation.h: Change to new MacOSX type definitions. * Source/NSAnimation.m: Remove externs and white space changes. * Source/externs.m: Move externs from NSAnimation to here. 2009-11-08 Fred Kiefer * Source/NSApplication.m (-finishLaunching): Only activate the application if it isn't hidden. * Source/Functions.m (NSConvertGlobalToWindowNumber, NSConvertWindowNumberToGlobal): Add a slightly better implementation. 2009-11-05 Wolfgang Lux * Source/NSDocumentController.m (+initialize): Don't ignore types without an associated document class. * Source/NSDocument.m (+readableTypes, +writableTypes): * Source/NSDocumentController.m(-_readableTypesForClass:, -_writableTypesForClass:): Add the exportable types to the writable types. Rename private NSDocumentController methods. * Source/NSDocument.m (-_addItemsToSpaButtonFromArray, -changeSaveType, _runSavePanelForSaveOperation): Save panel accessory pop up now allows the user to select one of the exportable types for NSSaveToOperation. * KeyBindings/DefaultKeyBindings.dict: Enable Ctrl-l key binding and add Ctrl-o key binding as in Emacs and Cocoa. * Source/NSTextView_actions.m (-insertNewlineIgnoringFieldEditor:, -insertTabIgnoringFieldEditor): Implement NSResponder methods. * Source/NSWindow.m (-dealloc): Release the toolbar without updating the window's geometry and thus avoid calling the delegate during deallocation. * Source/NSAlert.m (NSBeginAlertSheet, NSBeginCriticalAlertSheet, NSBeginInformationalAlertSheet): Call the didEndSelector after the sheet has been closed. 2009-11-04 Fred Kiefer * Source/NSColor.m (GSRGBColor -getComponents:): Correct alpha_component passing. 2009-11-03 Fred Kiefer * Source/NSColor.m (-colorUsingColorSpace): Support more color spaces. * Source/NSColorSpace.m (COLORSPACE): Initialize the static variable. 2009-11-03 Fred Kiefer * Source/GSThemeDrawing.m: Add more includes to apeace Riccardo's compiler. 2009-11-03 Fred Kiefer * Source/Functions.m (NSConvertGlobalToWindowNumber, NSConvertWindowNumberToGlobal): Add dummy implementation. 2009-11-02 Fred Kiefer * Source/NSApplication.m (-nextEventMatchingMask:...): Only set the current event when dequeuing and never return the null_event. 2009-11-02 Fred Kiefer * Source/GSTheme.m: Remove some compiler warnings. * Source/NSMenuItemCell.m, * Source/GSToolbarView.m, * Source/GSThemeDrawing.m, * Headers/Additions/GNUstepGUI/GSTheme.h: New theme methods for toolbar and menu item drawing. 2009-11-01 Fred Kiefer * Source/NSImage.m: Switch to the new shared composite and dissolve code. 2009-10-29 Fred Kiefer * Source/NSProgressIndicator.m: Correct flipped drawing. 2009-10-28 Fred Kiefer * Source/NSProgressIndicator.m: Fill more methods. 2009-10-27 Fred Kiefer * Headers/AppKit/NSProgressIndicator.h, * Source/NSProgressIndicator.m: Add missing OSX 10.5 methods and use the pattern colour patch by Uli Kusterer . * Images/common_ProgressSpinning_?.tiff * Images/common_ProgressIndeterminate_?.tiff New image files by Uli Kusterer . * Images/GNUmakefile: Add the new images. 2009-10-27 Thomas Gamper * Source/GSDisplayServer.m * Headers/Additions/GNUstepGUI/GSDisplayServer.h: Add cursor position setter (setMouseLocation:onScreen:). 2009-10-25 Fred Kiefer * Source/NSGradient.m (-drawInRect:angle:): Correct the math by adding a call to abs(). 2009-10-23 Fred Kiefer * Headers/AppKit/NSGraphicsContext.h, * Source/NSGraphicsContext.m: Define empty gradient methods. * Source/NSGradient.m: Use these methods. * Source/NSColor.m (-colorUsingColorSpace): Don't use isEqual: on color space. 2009-10-23 Fred Kiefer * Source/NSGradient.m: Add context savig/restore and first attempt at geometry maths. 2009-10-23 Riccardo Mottola * Headers/AppKit/NSBezierPath.h: added some documentation 2009-10-22 Riccardo Mottola * Images/common_3DArrowRightH.tiff: Made background transparent, allows for better theming 2009-10-22 Nicolas Roard * Source/GSThemeTools.m: Switched back extracting the individual images in GSDrawTiles, fixing the problem with the matrix style and allowing the nine patch style to work. 2009-10-21 Fred Kiefer * Source/NSColor.m (-colorUsingColorSpace): Add some dummy implementation for this method. * Source/NSColorSpace.m: Correct indention. * Header/AppKit/NSGradient.h, * Source/NSGradient.m: New files implementing the gui part of colour gradients. * Headers/AppKit/AppKit.h: Add include for NSGradient.h * Source/GNUmakefile: Add new files. 2009-10-20 Wolfgang Lux * Source/NSDocumentController.m(-openDocumentWithContentsOfURL:display:, -openDocumentWithContentsOfURL:display:error:): Call -noteNewRecentDocument: instead of -noteNewRecentDocumentURL:. * Source/NSDocumentController.m (-_updateOpenRecentMenu): Fix an off by one error which would crash programs with an open recent menu. 2009-10-19 Riccardo Mottola * Source/GSWindowDecorationView.h: add method declaration so that certain compilers pick up the correct signature 2009-10-19 Richard Frith-Macdonald * Source/GSThemeTools.m: Fix broken drawing due to error in the ([-validateTilesSizeWithImage:]) method. Fix broken ([-drawCornersRect:]) too. 2009-10-19 Richard Frith-Macdonald * Source/GSThemeTools.m: Fix last changes to compile again (variable declarations not at startof block only work on some compilers). * Source/GSTheme.m: Functions for working with fill style names. * Source/NSApplication.m: Fixup to show suppressed icon when app is deactivated. Fix uninitialisaed variable causing crashes on failing to use document controller to open an untitled document. Drop non-standard method (which didn't work) for determining whether we have a document based app. * Source/NSDocumentController.m: Rewrite code for determining whether the current app is document based. Cache singleton information in static variables rether than ivars. 2009-10-19 Nicolas Roard * Source/GSTheme.m: * Source/GSThemeTools.m: * Source/GSThemePrivate.h: Added the 'NinePatch' drawing style, and modified GSDrawTiles to save the corresponding nine images from an original image, instead of only remembering the rects... The other styles need to be modified accordingly in a future patch. 2009-10-18 Richard Frith-Macdonald * Source/GSTheme.m: * Source/GSThemeTools.m: * Source/GSThemeDrawing.m: * Source/GSThemePrivate.h: * Headers/Additions/GNUstepGUI/GSTheme.h: Allow theme to control how interior of tiled rect is filled. 2009-10-18 Nicolas Roard * Source/GSTheme.m, * Source/GSThemeTools.m, * Source/GSThemePrivate.h, * Headers/Additions/GNUstepGUI/GSTheme.h: Refactoring of GSDrawTiles, splitting fillRect:withTiles:background:fillStyle: in smaller methods, letting GSDrawTiles be in charge of its own drawing. Also added a 'nine patch' init method, to create a GSDrawTiles from a specially crafted image (see comments). 2009-10-17 Wolfgang Lux * Source/NSApplication.m (-_windowWillClose:): When using MS Windows style menus terminate an application by default when its last window is closed. In addition, fix a bug where the application was not terminated when the last window is closed while the application is in the background. 2009-10-17 Wolfgang Lux * Source/NSApplication.m (-finishLaunching): Open a new document by default when a document based application is started and there is no file to open. 2009-10-17 Richard Frith-Macdonald * Source/NSWindow.m: * Source/NSApplication.m: * Headers/AppKit/NSEvent.h: Changes to unhide app when a suppressed app icon is deminiaturised. Code conditional on defining MINI_ICON to 1 in NSApplication.m Currently doesn't work because the backend is not notifying the gui when a window is deminiaturised :-( 2009-10-17 Richard Frith-Macdonald * Source/NSApplication.m: Make GSSuppressAppIconhide the icon window (leave it ordered out) rather than making it not exist at all. Add new default GSBackgroundApp for an application which should not display the window at all. * Soure/NSWindow.m: Don't order any windows in if this is a background application. * Source/NSEvent.m: fix missing comma causing comple fail. 2009-10-17 Sheldon Gill * Source/NSApplication.m: centralise GSGuiBundle() routine 2009-10-16 Sheldon Gill * Source/NSEvent.m: add default for unknown events * Source/NSApplication.m: Move saving defaultExceptionHandler to when it is required (in _init) rather than early in +[initialize] 2009-10-13 Fred Kiefer * Source/GSTextStorage.m (-initWithCoder:): Display the warning only when we load an old .gorm file. 2009-10-12 Fred Kiefer * Source/NSScroller.m (-mouseDown:): In NSWindows95InterfaceStyle don't track the knob 2009-10-12 Fred Kiefer * Source/NSApplication.m (-runModalForWindow:, -runModalSession:): Use NSModalPanelRunLoopMode instead of NSDefaultRunLoopMode. 2009-10-12 Fred Kiefer * Source/NSScroller.m: Handle NSMacintoshInterfaceStyle the same as NSNextStepInterfaceStyle. 2009-10-12 Fred Kiefer * Source/NSColor.m (-hash): Turned Richards specific hash method into a generic one. 2009-10-12 Fred Kiefer * Source/NSColor.m: Remove special proxy handling introduced in last change. 2009-10-11 Richard Frith-Macdonald * Source/GSTheme.m: Implement -description for proxies. * Source/NSColor.m: Fix theme activation to recache catalogue colors. Write code to unique catalogue color instances. Add locking to make catalogue colors thread-safe. 2009-10-11 Fred Kiefer * Source/GSStandardWindowDecorationView.m (-resizeWindowStartingWithEvent:): restructure event handling code and add periodic event. 2009-10-11 Richard Frith-Macdonald * Source/NSApplication.m: ([stopModalWithCode:]) correct the check to see if a modal session is running. This fixes the breakage caused by the recent change sending -stopModal to invisible windows (like open panels ordered out at the end of their modal loop). 2009-10-11 Fred Kiefer * Source/GSStandardWindowDecorationView.m (-dealloc): Remove from the notification centre. 2009-10-10 Fred Kiefer * Source/GSStandardWindowDecorationView.m, * Headers/Additions/GNUstepGUI/GSTheme.h, * Source/GSThemeDrawing.m: Move all the window border drawing code into GSTheme. 2009-10-10 Fred Kiefer * Source/NSEvent.m, * Source/NSImage.m, * Source/GSTextStorage.m: Remove usage of NSDeallocateObject. 2009-10-10 Fred Kiefer * Source/NSApplication.m (-endModalSession:): Bring the window of the next modal session to the front. * Source/NSApplication.m (-runModalSession:): Better check whether the current session window is gone. * Source/NSPrintPanel.m (-_pickedButton:): Remove bogus log statement. 2009-09-27 Richard Frith-Macdonald * Source/NSImage.m: ([-setName:]) fix bug which was removing the wrong name when given an image which already had a name. Make named images thread-safe using a lock. Add private method to update names on theme change. * Source/GSTheme.m: Use new method to update theme images. 2009-09-26 Fred Kiefer * Source/NSApplication.m (-setApplicationIconImage:, -finishLaunching): Move the set name code to finishLaunching, as the image called NSApplicationIcon should stay the same all the time. 2009-09-26 Fred Kiefer * Source/NSTextContainer.m (init): Add this method as suggested by Derek Fawcus . 2009-09-21 Fred Kiefer * Source/NSWindow.m (+standardWindowButton:forStyleMask:): Add support for toolbar button. * Source/NSWindow.m (-toggleToolbarShown:): Reorder the code. * Source/NSToolbar.m (_setVisible:broadcast:): Add code to really make the toolbar visible. * Source/NSToolbar.m (_window): New helper method for this. 2009-09-19 Fred Kiefer * Source/GSHorizontalTypesetter.m (-_cacheMoveTo:): Use default paragraph style when none is set. 2009-09-19 Fred Kiefer * Headers/Additions/GNUstepGUI/GSTextConverter.h, * TextConverters/RTF/RTFConsumer.m, * TextConverters/RTF/RTFProducer.h, * TextConverters/RTF/RTFProducer.m, * Source/NSAttributedString.m: Unify the text converter handling. * Headers/AppKit/NSAttributedString.h, * Source/NSAttributedString.m (-itemNumberInTextList:atIndex:, -rangeOfTextBlock:atIndex:, -rangeOfTextList:atIndex:): Correct interface and add implementation for these methods. 2009-09-16 Fred Kiefer * Source/GSToolbarView.m (-drawRect:): Also correct the only use of this method. 2009-09-16 Hans Baier * Headers/Additions/GNUstepGUI/GSTheme.h, * Source/GSThemeDrawing.m: fix typo in method name: drawToobarRect -> drawToolbarRect 2009-09-14 Hans Baier * Headers/AppKit/NSWorkspace.h, * Source/NSWorkspace.m: ([-launchAppWithBundleIdentifier:]) add method and dummy implementation 2009-09-14 Fred Kiefer * Source/NSScroller.m, * Headers/AppKit/NSScroller.h: Add new 10.5 methods and change implementation to be similar to the currentApple one. Remove the left over caching code that didn't do anything useful anymore. 2009-09-14 Hans Baier * Headers/AppKit/NSWorkspace.h: add NSWorkspaceLaunchoptions 2009-09-12 Riccardo Mottola * Images/common_Mount.tiff * Images/common_Unmount.tiff Newly recreated true-color artwork. 2009-09-10 Richard Frith-Macdonald * Source/NSApplication.m: ([-setApplicationIconImage:]) ensure that the new image has its name set to NSApplicationIcon * Source/NSImage: ([+imageNamed:]) fixed bug exposed by recent change of nsmappings.strings file. The old code was using the mapped names as the image names which meant that a subsequent ([-setName:]) using the unmapped name would not effect the image retrieved by later calls to ([+imageNamed:]). 2009-09-09 Fred Kiefer * Source/NSView.m (-_lockFocusInContext:inRect:): Correct the handling of renewgstate. * Source/GSFontInfo.m (GSFontEnumerator-availableFontDescriptors): Retain the generated list of font descriptors. 2009-09-07 Fred Kiefer * Headers/AppKit/NSMenuItem.h: Let the protocol NSMenuItem conform to NSValidatedUserInterfaceItem. Patch by Quentin Mathe . 2009-09-07 Fred Kiefer * Source/NSScrollView.m (-initWithCoder:): Don't add the vertical scroller directly into the subviews. Call tile to position all subviews correctly. Based on patch by Quentin Mathe . 2009-09-07 Fred Kiefer * Headers/AppKit/NSSearchFieldCell.h: Add version #ifdef's. * Source/NSSearchFieldCell.m (-encodeWithCoder:, -initWithCoder:): Correct encoding/decoding of maximumRecents. Based on patch by Quentin Mathe . 2009-09-06 Fred Kiefer * Source/NSPopUpButton.m (-selectedTag): Return the tag of the selected item. Patch by Douglas Simons . 2009-09-04 Nicola * Images/GNUmakefile: Rewritten using the standard resource-set.make instead of duplicating resource installation code in every makefile. resource-set.make also has a lots of additional features and provides robust, portable code. * Sounds/GNUmakefile: Same change. * Themes/GNUmakefile: Same change (this should also fix installing gnustep-gui on Sun Solaris 7). * Images/GNUmakefile.postamble: Removed. * Sounds/GNUmakefile.postamble: Removed. * Themes/GNUmakefile.postamble: Removed. 2009-09-01 19:45-EDT Gregory John Casamento * Images/common_ToolbarCustomizeToolbarItem.tiff: Minor cleanup 2009-09-01 Richard Frith-Macdonald * Source/GSToolTips.m: fix bug #25907 by ensuring windows is fully displayed before we draw to it, and we then flush our drawing. * Source/NSMenu.m: fix bug #27344 by telling the menu view that it needs resizing every time we change menu title (or items). 2009-08-31 Quentin Mathe * Images/nsmapping.strings: Added NSApplicationIcon to ensure -imageNamed: returns a non-nil image even when -[NSApplication finishLaunching] hasn't been called. The behavior is now the same than Cocoa. 2009-08-28 17:32-EDT Gregory John Casamento * Images/common_DimpleHoriz.tiff: Add * Images/common_DimpleH.tiff: Remove * Images/GNUmakefile: Copy new image. * Source/GSThemeDrawing.m: Correct image name. 2009-08-28 17:19-EDT Gregory John Casamento * Images/common_DimpleH.tiff: Horizontal image for dimple. This image is not different from the vertical dimple for the default theme. It's here so that it can be overriden by a theme, if needed. * Images/GNUmakefile: Add new image. * Source/GSThemeDrawing.m: Modify code in cellForScrollerKnob to use common_Dimple.tiff or common_DimpleH.tiff depending on the orientation of the scroller. 2009-08-28 Richard Frith-Macdonald * Source/GSTheme.m: Fixes to properly restore previous common images when a theme is deactivated. * Source/NSImage.m: Fix imageNamed to always return proxy. 2009-08-27 Richard Frith-Macdonald * Source/NSImage.m: Image naming fixes so that setting nil as a name works (so themes can replace/override system images). * Source/GSTextStorage.m: Fix incorrect return of proxy to user code. 2009-08-26 18:53-EDT Gregory John Casamento * Source/libgnustep-gui.def: Export GSTheme class. 2009-08-25 Richard Frith-Macdonald * Source/GSTheme.m: * Headers/Additions/GNUstepGUI/GSTheme.h: Add methods for changing the classes used for loading images and color lists so that themes may dynamically update both in response to external events (eg. integration with a native theming mechanism of the system the application is running on). * Source/NSBrowser.m: * Source/NSSound.m: * Source/GSDisplayServer.m: * Source/NSParagraphStyle.m: * Source/NSAttributedString.m: * Source/NSFontManager.m: * Source/NSButtonCell.m: * Source/NSColor.m: * Source/NSToolbar.m: * Source/NSFont.m: * Source/NSTabViewItem.m: * Source/NSDocumentController.m: * Source/NSTableView.m: * Source/NSView.m: * Source/NSDocument.m: * Documentation/GuiUser/DefaultsSummary.gsdoc: * Headers/AppKit/NSAttributedString.h: * Headers/AppKit/NSButtonCell.h: * Headers/AppKit/NSBitmapImageRep.h: Fix argument name/type info for documentation, plus a markup error, plus minor syntax errors reported by autogsdoc (semicolon within a method implementation ... gcc is sloppy and ignores it, but clang may be stricter ... best to fix). 2009-08-24 Fred Kiefer * Source/NSAttributedString.m (-fixFontAttributeInRange:): Fix compiler warning. * Source/NSHelpManager.m (NSApplication-showHelp:): Fix compiler warning. 2009-08-23 17:35-EDT Gregory John Casamento * Sounds/Frog.wav: New sound. * Sounds/GNUmakefile: Add new sound. * Sounds/Submarine.wav: New sound 2009-08-23 Fred Kiefer * Headers/Additions/GNUstepGUI/GSFontInfo.h, * Headers/AppKit/NSFontDescriptor.h, * Source/NSFontDescriptor.m, * Source/NSFontManager.m, * Source/NSFont.m, * Source/GSFontInfo.m: Add better support for font descriptor. Requires a recompile of the backend. 2009-08-23 14:23-EDT Gregory John Casamento * Headers/Additions/GNUstepGUI/GSTheme.h: Add image parameter, * Source/GSThemeDrawing.m: Add image parameter. Correctly handle disabled buttons. * Source/NSButtonCell.m: Change to use new signature. 2009-08-23 14:05-EDT Gregory John Casamento * Headers/Additions/GNUstepGUI/GSTheme.h: Added new method declaration for drawButtonCell:... * Source/GSThemeDrawing.m: Added implementation for new method. The purpose of the method is to allow the theme to override images with native images which may be theme dependent. * Source/NSButtonCell.m: Use the new method. 2009-08-23 Doug Simons * Source/GSHorizontalTypesetter.m: Remove unlock and log the exception, but don't rethrow it. * Source/GSLayoutManager.m: return a zero length range in -(NSRange)glyphRangeForCharacterRange:actualCharacterRange: when charRange has a length and a location of 0. Added by Gregory John Casamento 2009-08-23 17:16-BST David Chisnall * Tools/sound/GSOSSSoundSink.m: Added OSS sound back end 2009-08-23 11:50-EDT Gregory John Casamento * Tools/sound/GNUmakefile: Fix circular dependency issue. Added _INCLUDE_DIRS and _LIB_DIRS for each entry so that it can build when GNUstep is not installed. 2009-08-23 03:52-EDT Gregory John Casamento * configure: Regenerate * configure.ac: Added --disable-sound option. 2009-08-23 03:45-EDT Gregory John Casamento * config.make.in: Add BUILD_SOUNDS * configure: Regenerate * configure.ac: Add BUILD_SOUNDS and checks for libraries. * GNUmakefile: Add to subprojects, if BUILD_SOUNDS is present. 2009-08-23 00:18-EDT Gregory John Casamento * GNUmakefile: Add themes directory * Themes/GNUmakefile: New makefile * Themes/GNUmakefile.postamble: Makefile to copy themes. 2009-08-22 Stefan Bidigaray * configure.ac: Updated * Headers/Additions/GNUstepGUI/GSSoundSink.h * Headers/Additions/GNUstepGUI/GSSoundSource.h: Added * Headers/AppKit/NSSound.h: Added new methods * Sound/SndfileSource.m * Sound/AudioOutputSink.m: Added * Source/NSSound.m: Implementation using new bundle based playback. * Tools/gsnd: Removed 2009-08-22 19:49-EDT Gregory John Casamento * Headers/Additions/GNUstepGUI/GSTheme.h: Add methods for drawing stepper cell here. * Source/GSThemeDrawing.m: Implementations for stepper cell functions. * Source/NSStepperCell.m: Use new stepper cell functions. 2009-08-21 Fred Kiefer * Source/NSMenuItemCell.m (-drawStateImageWithFrame:inView:, -drawTitleWithFrame:inView:): Remove specific drawing code, use general code instead. * Source/NSMenuItemCell.m (-drawingRectForBounds:): Add call to calcSize. 2009-08-21 Fred Kiefer * Source/NSBitmapImageRep+ICNS.m: Redefine icns_size_t to int, as this needs to be a 32 bit integer and on 64 bit systems long uses 64 bits. 2009-08-19 00:57-EDT Gregory John Casamento * Source/NSTextView.m: Don't add the text storage if it's nil in initWithCoder: 2009-08-16 15:14-EDT Gregory John Casamento * Source/NSTextStorage.m: Correct spelling of header file. 2009-08-16 Fred Kiefer * Source/NSView.m (-initWithFrame:, -initWithCoder:) Set _post_frame_changes and _post_bounds_changes to YES by default. Patch by Quentin Mathe . 2009-08-16 Fred Kiefer * Source/NSTextStorage.m (-replacementObjectForPortCoder:): Added this method as suggested by Richard. 2009-08-15 17:17-EDT Gregory John Casamento * Tools/say/GNUmakefile * Tools/speech/GNUmakefile: Makefile corrections. 2009-08-12 18:26-EDT Gregory John Casamento * Source/NSDrawer.m: Changed - (void) stopTimer. Fixed to prevent a crash when the drawer is opened/closed and then the window is then closed causing a double release. 2009-08-12 Fred Kiefer * Source/NSTextStorage.m (-classForCoder, -initWithCoder:, -encodeWithCoder:): Encode this class and not the concrete one. Also call super encoding/decoding methods as they are correct in base now. * Source/GSTextStorage.m (-classForPortCoder, -encodeWithCoder:, -replacementObjectForPortCoder:): Remove these methods. 2009-08-10 23:25-EDT Gregory John Casamento * Sounds/Basso.wav * Sounds/Hero.wav * Sounds/Ping.wav * Sounds/Pop.wav * Sounds/Sosumi.wav * Sounds/Tink.wav: Added new sound files. * Sounds/GNUmakefile: Copy sound files. 2009-08-08 23:26-EDT Gregory John Casamento * Source/NSMenuItem.m: encodeWithCoder: only encode the NSSubitems key if the menu is not owned by a popup. This avoids an assertion error when loading the resulting nib into InterfaceBuilder. 2009-08-08 13:06-EDT Gregory John Casamento * Source/NSTextView.m: initWithCoder: change to use text storage more directly to allow the handling of attributed strings. 2009-08-08 03:06-EDT Gregory John Casamento * Source/GSTextStorage.m: In initWithCoder: don't overwrite the contents of the text storage by attempting to unarchive when the unarchiver is keyed. * Source/NSTextView.m: In initWithCoder: retrieve the contents of the text storage for display in the text view. 2009-08-06 01:42-EDT Gregory John Casamento * Source/NSTextView.m: initWithCoder: temporarily remove decoding of NSTextContainer since it is causing a crash when editing a text view's that was loaded from a nib file. 2009-08-04 Fred Kiefer * Headers/AppKit/NSToolbarItem.h: Move the _flags to the class GSToolbarBackView in NSToolbarItem.m. * Source/NSToolbarItem.m: More clean up of code. 2009-08-02 10:15-EDT Gregory John Casamento * Headers/AppKit/NSWindow.h * Source/NSApplication.m * Source/NSWindow.m: Added ivar for attached sheet back. 2009-08-01 20:28-EDT Gregory John Casamento * config.make.in: Change to include BUILD_SPEECH in output * configure: Regenerated * configure.ac: Check for flite library and flite.h header. * Tools/GNUmakefile: Add ${BUILD_SPEECH} to subproject list. * Tools/say/GNUmakefile * Tools/say/say.m: Say utility * Tools/speech/FliteSpeechEngine.m: * Tools/speech/GNUmakefile * Tools/speech/GSSpeechEngine.[hm] * Tools/speech/GSSpeechServer.[hm] * Tools/speech/GSSpeechSynthesizer.[hm]: Speech synthesis engine implementation using flite. * Tools/speech/main.m: main for the server application. Speech code by David Chisnall Changes to makefiles and config by Gregory Casamento. 2009-08-01 17:49-EDT Gregory John Casamento * Sounds/GNUmakefile: Change makefile to copy wav files. 2009-08-01 17:47-EDT Gregory John Casamento * Sounds/Basso.ogg: Deleted.. * Sounds/Basso.wav: Added * Sounds/Blow.ogg: Deleted.. * Sounds/Blow.wav: Added * Sounds/Bottle.ogg: Deleted * Sounds/Bottle.wav: Added * Sounds/Glass.ogg: Deleted * Sounds/Glass.wav: Added. Changed sounds to .wav instead of .ogg. 2009-08-01 12:22-EDT Gregory John Casamento * GNUmakefile * Sounds/Basso.ogg * Sounds/Blow.ogg * Sounds/Bottle.ogg * Sounds/Glass.ogg: Add new sounds. * Sounds/GNUmakefile * Sounds/GNUmakefile.postamble: Add sounds directory and makefiles. 2009-07-31 Adam Fedor * Version 0.17.1 2009-07-30 15:43-EDT Gregory John Casamento * Source/GSThemeTools.m: -[GSThemeTools drawRoundBezel:withColor:] add code to draw highlights for rounded buttons to give them a better 3D look. 2009-07-28 Fred Kiefer * Source/NSDocument.m (-setFileName:): Set the file name to the absolute file path. Patch by Jonathan Gillaspie . 2009-07-27 12:18-EDT Gregory John Casamento * Headers/AppKit/NSWindow.h: Comment out _attachedSheet ivar. * Source/NSAlert.m: Change code to use hightlightWithLevel: method in resetWindow method. * Source/NSApplication.m: Stub out setAttachedSheet method. * Source/NSWindow.m: Remove new ivar for next release and stub out attachedSheet method. 2009-07-26 Fred Kiefer * Headers/AppKit/NSFontDescriptor.h, * Headers/AppKit/NSFont.h: Add missing interface method from 10.5. * Source/NSFontDescriptor.m, * Source/NSFont.m: Small fixes for font descriptor handling. 2009-07-25 22:54-EDT Gregory John Casamento * Source/NSAlert.m: Offset color by less in -resetWindow. Remove redundant logic for calling the "didEnd" method in the NSBeginSheet... functions. * Source/NSApplication.m: Add code to reset parent window in beginSheet:... method. Also added check to make sure the modalDelegate is not nil. 2009-07-25 20:54-EDT Gregory John Casamento * Source/NSAlert.m: Remove category for setAttachedSheet method. * Source/NSApplication.m: Added private category to add setAttachedSheet: to NSWindow. Modified beginSheet:... method to call the new method with the sheet that is associated with it. 2009-07-25 20:25-EDT Gregory John Casamento * Source/NSAlert.m: GSAlertSheet - removed unecessary parentWindow and container ivars in interface declaration. Removed uneeded accessors for parentWindow and contentRect. Added check in frameFromParentWindowFrame to check to see if parent is initialized prior to using it. Removed NSBox in the init.. method since it could cause issues with drawing. Added code to lighten the color of the background of the sheet relative to the parent window. 2009-07-24 Fred Kiefer * Source/NSTextView.m (-initWithCoder:, -setTextContainer:): Attempt to resolve the memory issues when coding a text container. 2009-07-21 15:06-EDT Gregory John Casamento * Headers/AppKit/NSFontDescriptor.h: Correct mispelling pointed out by David Chisnall. 2009-07-17 Fred Kiefer * Source/NSPrintOperation.m: Add include needed for Windows. 2009-07-16 Fred Kiefer * Source/NSPrintOperation.m (-_printPaginateWithInfo:knowsRange:, -_print): Try to handle not set print information more graceful. 2009-07-14 Fred Kiefer * Source/NSPrintOperation.m (-_printPaginateWithInfo:knowsRange:): Use scale 1.0 if none is given. Patch by Georg Fleischmann . 2009-07-13 14:12-EDT Gregory John Casamento * Source/NSAlert.m: Implementation of GSAlertSheet. * Source/NSApplication.m: Change order in which setWindowParent: and runModalForWindow: are called in beginSheet:... method. * Source/NSDrawer.m: Remove notifications when drawer is closed in dealloc. 2009-07-06 Fred Kiefer * Source/NSTableView.m (-_editPreviousEditableCellBeforeRow:column:, -_editNextEditableCellAfterRow:column:): Comment out the loop around of the last change. This leads to wrong results, when the table view isn't the only view in the window. 2009-07-06 Fred Kiefer * Source/NSView.m (-_setNeedsDisplayInRect_real:) Set the window views as needing display, even when the invalidated rectangle didn't change. 2009-07-05 Fred Kiefer * Source/NSTableView.m (-_editPreviousEditableCellBeforeRow:column:, -_editNextEditableCellAfterRow:column:): Try to handle all cases of changing the current edited cell correctly. 2009-07-05 Riccardo Mottola * Source/NSTableHeaderView.m Removed c99-ism 2009-07-05 Fred Kiefer * Source/NSTableView.m (_editPreviousEditableCellBeforeRow:column:): Compare row against _numberOfRows not _numberOfColumns. Patch by Tim Schmielau . 2009-06-30 Nicolas Roard * Source/NSTableHeaderView.m: Apply patch from Eric Wasylishen , add live resize and live moving for table columns if GSUseGhostResize is set to NO. 2009-06-28 23:46-EDT Gregory John Casamento * Source/NSTextView.m (-initWithCoder:): Retain the text container and storage to prevent a crash since both are autoreleased by the archiver. 2009-06-29 Fred Kiefer * Headers/AppKit/NSKeyValueBinding.h, * Source/externs.m: Add NSContentObjectBinding. * Source/NSObjectController.m: Add more implementation to this class. Patch by Andy Balholm . 2009-06-28 Fred Kiefer * Headers/AppKit/AppKit.h : Addd NSFontDescriptor.h. 2009-06-22 Fred Kiefer * Source/NSUserDefaultsController.m (-initWithCoder:): Retain the shared controller before returning it. 2009-06-22 Fred Kiefer * Source/NSKeyValueBinding.m (GSKeyValueBinding+initialize): Correc the setup of the map tables. * Source/NSKeyValueBinding.m (GSKeyValueBinding+unbindAllForObject): Use a copy of the keys for the enumerator. 2009-06-05 18:21-EDT Gregory John Casamento * Headers/AppKit/NSSpeechSynthesizer.h: * Source/NSSpeechSynthesizer.m: Implementation of NSSpeechSynthesizer. Patch by David Chisnall 2009-06-02 Fred Kiefer * Source/NSDocument.m (-runModalSavePanelForSaveOperation:...): Check whether there is a returned save panel, this wont be the case when the user cancels the save operation. 2009-05-31 Fred Kiefer * Source/NSApplication.m (detachDrawingThread:toTarget:withObject:): Replace a call to a now longer existing extension on NSInvocation with the correct method calls. 2009-05-31 Fred Kiefer * Source/GSDisplayServer.m (+initialize, -_setWindowOwnedByServer:(), -dealloc): Set the windowmaps variable in the initialize method and protect all usages. 2009-05-23 22:17-EDT Gregory John Casamento * Source/NSWorkspace.m: Improve handling of CFBundleType... constants in the private method _extIconForApp:info:. 2009-05-23 11:48-EDT Gregory John Casamento * Source/GSStandardWindowDecorationView.m: Live window resize changes for when using GNUstep decorations in resizeWindowStartingWithEvent:. * Source/NSLayoutManager.m: Unarchive the text containers into an array in initWithCoder:. * Source/NSTextContainer.m: Get the layout manager in initWithCoder:. * Source/NSTextView.m: Changes to include text container from nib file into the nib loading process in initWithCoder:. 2009-05-22 Nicolas Roard Add a live resize for splitviews. Users can revert to the old behaviour by doing: defaults write NSGlobalDomain GSUseGhostResize YES * Source/NSSplitView.m: Added live resize of splitviews 2009-05-14 Riccardo Mottola * Source/NSApplication.m: fixed allocation of Mutable array instead of Array 2009-05-14 14:15-EDT Gregory John Casamento * Headers/AppKit/NSWindow.h: Added ivar to contain attachedSheet. * Source/NSAlert.m: New class GSSheetPanel. Initial changes for sheet implementation. * Source/NSWindow.m: Added code to return value of new ivar. 2009-05-10 Adam Fedor * Version 0.17.0 2009-05-02 Fred Kiefer * Source/NSMenu.m (-_updateUserDefaults:): Fix small memory leak. * Source/GSTitleView.m (+height: Get height from NSMenuView. * Source/GSTitleView.m (-addCloseButtonWithAction:, -addMiniaturizeButtonWithAction:): Get buttons from NSWindow. * Source/GSTitleView.m: Clean up a bit. 2009-04-27 Fred Kiefer * Source/NSBezierPath.m (-appendBezierPathWithRoundedRect:xRadius: yRadius:): Small rearangment of code. Patch by Fred Morcos 2009-04-25 Fred Kiefer * Headers/AppKit/NSBezierPath.h, * Source/NSBezierPath.m (+bezierPathWithRoundedRect:xRadius:yRadius:, -appendBezierPathWithRoundedRect:xRadius:yRadius:): New 10.5 methods. Patch by Fred Morcos 2009-04-24 Richard Frith-Macdonald * Source/NSColorWell.m: Only send action if color changes ... fix for bug #26277 2009-04-19 00:46-EDT Gregory John Casamento * Headers/AppKit/NSSearchFieldCell.h: Give the values assigned in Cocoa to the enum. Patch by: doug@riverrock.org * Source/NSSearchFieldCell.m: Implemented search menu template and recent items. Patch by: doug@rivverrock.org * Source/NSSearchField.m: Call cell methods to use search menu. Patch by: doug@riverrock.org 2009-04-19 00:23-EDT Gregory John Casamento * Source/NSApplication.m: Make certain that a sheet is always placed above the window it's supposed to appear relative to. Change to runModalForWindow:relativeToWindow:. 2009-04-18 23:21-EDT Gregory John Casamento * Source/NSScrollView.m: If the scrollview has scrollers, don't pay attention to the hidden flag in nib loading. * Source/NSTableView.m: if the table has a cornerview, don't pay attention to the hidden flag in nib loading. NOTE: In both instances it appears that Cocoa sets the hidden flag when autohide is set to true. GNUstep handles this case differently, so it's okay to ignore this flag when the scroller is in an NSScrollView. 2009-04-16 16:05-EDT Gregory John Casamento * Source/NSAlert.m: Revert last change. 2009-04-16 15:02-EDT Gregory John Casamento * Source/NSAlert.m: Order front regardless to prevent reported cases of problems when sheets/panels bring up additional sheets/panels. 2009-04-14 21:24-EDT Gregory John Casamento * Source/GSHorizontalTypesetter.m: Use thread dictionary to hold the instance of the typesetter for that thread. * Source/NSStringDrawing.m: Add locks to methods to prevent modification of static variables by separate threads from causing applications to get glyph generation errors. NOTE: These changes based on suggestions/ideas from Doug Simons . 2009-04-12 15:16-EDT Gregory John Casamento * Source/GSWindowDecorationView.m: initialize offsets to prevent negative value warnings suggested by Doug. 2009-04-12 15:11-EDT Gregory John Casamento * Source/NSSearchFieldCell.m: Correct issue displaying images for search field. Fix in initWithCoder: to reset image names. 2009-04-11 Fred Kiefer * Source/NSPopUpButtonCell.m (-_popUpItemAction:): New method used by Apple NIB files. Patch by Doug Simons . 2009-04-10 15:30-EDT Gregory John Casamento * Source/NSApplication.m: Follow the NSApplication responder chain. 2009-04-10 15:00-EDT Gregory John Casamento * Source/NSSplitView.m: Set subviews to resize when loaded from the nib. * Source/NSView.m: Partial revert of previous change. 2009-04-10 14:27-EDT Gregory John Casamento * Source/NSView.m: Autoresize subviews since it is not pulling it from the nib correctly. Will come back and fix this issue. 2009-04-10 14:05-EDT Gregory John Casamento * Source/NSSplitView.m: Autoresize subviews when loaded from the nib. 2009-04-10 14:03-EDT Gregory John Casamento * Source/NSTabView.m: Autoresize subviews when loaded from the nib and set the mask to the make height and width resizable when the tab is selected. 2009-04-10 13:31-EDT Gregory John Casamento * Source/NSDrawer.m: Correction for NSDrawer issues with draw temporarily showing up above the window and not syncing with window position. 2009-04-10 10:24-EDT Gregory John Casamento * Source/NSAlert.m: in the method _initWithoutGModel add a call to setLevel: to set the level to NSModalPanelWindowLevel. This was not previously being done and was causing alert panels to get lost behind other application windows. 2009-04-10 01:32-EDT Gregory John Casamento * Source/NSMenuView.m: Removed adjustment to Y coords in the setWindowFrame... method. This adjustment is only supposed to be done when a popup is under "restrictive screen conditions" which is currently unimplemented. 2009-04-10 01:15-EDT Gregory John Casamento * Source/NSMenuView.m: In the method - (void) setWindowFrameForAttachingToRect:... test if the view is flipped and make the adjustment. 2009-04-10 00:53-EDT Gregory John Casamento * Source/NSMenuView.m: In the method - (void) setWindowFrameForAttachingToRect:... changed how popup/pulldown buttons handle the preferred edge. Per Cocoa documentation, the selected cell should always show up over the button for popups. For pull down menus, the preferred edge is relevant. This is also apparent from testing under Cocoa. 2009-04-09 22:55-EDT Gregory John Casamento * Source/NSRulerMarker.m: Changes suggested by Doug Simons for allowing markers to be set on an NSMouseDown event. 2009-04-07 22:21-EDT Gregory John Casamento * Source/NSDocumentController.m: Return default type if the URL is not a file URL and the call to typeFromFileExtension: returns nil in typeForContentsOfURL:. 2009-04-07 18:43-EDT Gregory John Casamento * Headers/AppKit/NSSpeechSynthesizer.h: Added _module ivar. * Source/NSDrawer.m: Don't set the timer since it eats a lot of CPU. * Source/NSPasteboard.m: Retain the path since it's autoreleased. * Source/NSTextView.m: Set the textview to allow undos by default. 2009-04-07 Fred Kiefer * Source/NSAlert.m (NSBeginAlertSheet, NSBeginCriticalAlertSheet, NSBeginInformationalAlertSheet): Correct the calling of delegate methods. This should fix #26101. 2009-04-07 Fred Kiefer * Headers/AppKit/NSSplitView.h (-maxPossiblePositionOfDividerAtIndex:, -minPossiblePositionOfDividerAtIndex:, -setPosition:ofDividerAtIndex:): New MacOSX 10.5 methods. * Source/NSSplitView.m: Basic implementation of these methods. * Headers/AppKit/NSSplitView.h: Add ivars, will break binary compatibility. * Source/NSSplitView.m (-isPaneSplitter, -setIsPaneSplitter:): Implement these methods. 2009-04-07 Sergii Stoian * Source/NSSplitView.m (-mouseDown:): When checking if divider position also check orientaion for _isVertical == NO situation. This fix avoids situation when split view is vertical, postion changed but method exists after next 'else if' check. 2009-03-26 Fred Kiefer * Source/NSView.m (-setNeedsDisplay:, -setNeedsDisplayInRect:): Warn about the GNUstep secondary thread behaviour not being portable to Cocoa. * Source/NSApplication.m (-nextEventMatchingMask:untilDate:inMode:dequeue:): Use distantPast instead of distantFuture as default of expiration. 2009-03-25 Fred Kiefer * Source/NSGraphicsContext.m (-restoreGraphicsState, -saveGraphicsState:) Try to deal with the case when there is no current context. May happen in secondard threads. Fixes #25943. 2009-03-25 Fred Kiefer * Source/NSTextView.m (-initWithFrame:textContainer:, -initWithCoder:): Set values for minSize, maxSize, horizontallyResizable and verticallyResizable consistently. * Source/NSTextView.m (-encodeWithCoder:) : Release the temporary shared data object. 2009-03-23 12:13-EDT Gregory John Casamento * Source/NSSpeechSynthesizer.[hm]: Add code to tell the developer that certain methods need to be overriden. 2009-03-23 02:36-EDT Gregory John Casamento * Headers/AppKit/AppKit.h: Add include for NSSpeechSynthesizer.h * Headers/AppKit/NSSpeechSynthesizer.h: Declarations. * Source/GNUmakefile: Add new files. * Source/NSSpeechSynthesizer.m: Add initial skeleton for NSSpeechSynthesizer class. 2009-03-22 23:57-EDT Gregory John Casamento * Panels/English.lproj/GSToolbarCustomizationPalette.gorm: Add connection to _doneButton outlet. * Source/GSToolbarCustomizationPalette.m: Added code in init to set the state of the size checkbox. 2009-03-21 12:27-EDT Gregory John Casamento * Panels/English.lproj/GSToolbarCustomizationPalette.gorm: Added size: method to class in gorm file. Added connection to size: method from the switch. * Source/GSToolbarCustomizationPalette.m: Added size: method implementation. * Source/NSToolbar.m: Added code to save and load sizeMode attribute for toolbar. 2009-03-21 12:13-EDT Gregory John Casamento * Panels/English.lproj/GSToolbarCustomizationPalette.gorm: Changed formatting. Added text field and buttons. * Source/GSToolbarCustomizationPalette.m: Added reset button and done button. * Source/NSToolbarFrameworkPrivate.h: Added _resetConfig method. * Source/NSToolbar.m: Added _resetConfig method. 2009-03-21 09:57-EDT Gregory John Casamento * Panels/English.lproj/GSToolbarCustomizationPalette.gorm: Add Default item to popup and make the connection to the show: method to allow setting the toolbar display mode. * Source/GSToolbarCustomizationPalette.m: Enable changing of text, text & icon, icon only on the toolbar. * Source/NSToolbar.m: Change _build method to load the displayMode setting. 2009-03-20 Richard Frith-Macdonald * Tools/gopen.m: Extend to open URLs as well as files. * Source/GSServicesManager.m: * Source/NSSworkspace.m: Additions so that any app using a document controller can open a URL (also any app where its delegate implements -application:openURL:). 2009-03-20 Fred Kiefer * Source/NSOutlineView.m (-drawRow:clipRect:): Changed order of expresions in condition to avoid possible access to uninitialized memory. * Source/NSScrollView.m (-initWithCoder:): Don't set _hasCornerView. * Source/GSNibLoading.m (NSClassSwapper-initWithCoder:): Don't reference freed memory. 2009-03-18 Richard Frith-Macdonald * Source/NSWorksace.m: ([openURL:]) fix to open some app which supports the URL scheme. 2009-03-18 Fred Kiefer * Source/NSView.m (-beginPageInRect:atPlacement:): Add parentheses to stop compiler from complaining. 2009-03-16 03:29-EDT Gregory John Casamento * Source/GSToolbarView.m: Added code to save the configuration when deleting an item as well as saving an item. * Source/NSToolbarFrameworkPrivate.h: removed old _loadConfig method added new methods to track changes to toolbars. * Source/NSToolbar.m: Added check for items already in the toolbar, removed calls to _loadConfig which were commented out, implemented setConfigurationFromDictionary: as described in the documentation, changed _build to get dictionary from defaults if it's there. Implemented new method _containsItemWithIdentifier: and _itemsFromConfig. 2009-03-16 01:22-EDT Gregory John Casamento * Source/GSToolbarView.m: Call the _insertItemWithItemIdentifier:.. method to add items when they are not being dragged from within the toolbar and are being added from the palette. * Source/NSToolbarItem.m: Added information to the description to help with debugging. 2009-03-15 18:37-EDT Gregory John Casamento * Source/NSScrollView.m: Fix for infinite notification loop which happens with some nib files. 2009-03-15 22:09-EDT Gregory John Casamento * Source/NSScrollView.m: Use the flags in initWithCoder: 2009-03-15 20:28-EDT Gregory John Casamento * Source/NSScrollView.m: Added more flags for nib loading. 2009-03-15 15:09-EDT Gregory John Casamento * Source/NSScrollView.m: Remove FIXME comment and provided an explaination for why a cast wasn't used. Added nonDynamic flag as well as other flags from the nib file. 2009-03-15 Fred Kiefer * Source/GSInfoPanel.m: Use setTitle: instead of setStringValue: for theme button. 2009-03-13 01:01-EDT Gregory John Casamento * Source/GSToolbarView.m: * Source/NSToolbar.m: Partial fix for toolbar drag and drop issues. 2009-03-12 19:47-EDT Gregory John Casamento * Source/NSPrintOperation.m: Correct issues with handling of rectangle passed back from rectForPage: callback in NSView subclasses. This rect should override existing calculations when it is passed in. * Source/NSView.m: Change to use NSPrintPaperBounds if and only if aRect is passed in as a blank rect. Previously the code was using the NSPrintPaperBounds value and ignoring the passed in value. 2009-03-11 Richard Frith-Macdonald * Source/NSMatrix.m: GC fixups ... change code that was attempting to use the old GSAtomicMallocZone() function. 2009-03-11 Fred Kiefer * Source/NSApplication.m (-setApplicationIconImage:): Copy the new application image before assigning the name "NSApplicationIcon" to it. This solves bug #25793. 2009-03-05 Fred Kiefer * Resources/GNUmakefile: Add French localisation. * Resources/French.lproj/Localizable.strings: New localisation file. Patch by Philippe Roussel . 2009-03-04 Xavier Glattard * Headers/NSView.h, Source/NSView.m: Add a flag 'ignoresBacking' that indicates the receiver do not draw on the backing store, and so prevent the backing store to be flushed by [-unlocFocus:] * Headers/NSView.h, Source/NSView.m, Source/externs.m: Define NSViewGlobalFrameDidChangeNotification that should be catched by NSOpenGLView (To Do) * Headers/NSOpenGL.h, Headers/NSOpenGLView.h: Some improvements, compatibility and/or bug fix. NSOpenGLView catches NSViewGlobalFrameDidChangeNotification. 2009-03-02 Fred Kiefer * Source/NSSliderCell.m, * Source/NSTableHeaderView.m, * Source/NSWindow.m, * Source/GSStandardWindowDecorationView.m, * Source/NSControl.m, * Source/NSScroller.m, * Source/NSTextView.m, * Source/NSComboBoxCell.m, * Source/NSStepperCell.m, * Source/NSCell.m: Replace nil with [NSDate distantFuture] in calls to nextEventMatchingMask:...dequeue:. 2009-03-01 20:17-EST Gregory John Casamento * Source/NSApplication.m: Fix bug #24643. Application icon is no stored correctly. 2009-03-01 Fred Kiefer * Resources/English.lproj/Localizable.strings: Regenerate this file. * Resources/German.lproj/Localizable.strings: Regnerate and add translation and escaping of non-ASCII characters. * Source/NSColor.m * Source/NSColorSpace.m * Source/NSPrintInfo.m * Source/NSAlert.m, * Source/NSWindow.m, * Source/GSPrintOperation.m, * Source/GSInfoPanel.m, * Source/GSNibLoading.m, * Source/NSToolbarItem.m, * Source/NSAttributedString.m, * Source/NSMenu.m: Add include of GSGuiPrivate.h for correct localization. * Source/NSAttributedString.m: Better handling of localization of error strings. 2009-02-26 00:35-EST Gregory John Casamento * Source/GSLayoutManager.m: do not return (0,0) when a zero length range is passed into glyphRangeForCharacterRange: actualCharacterRange:. Tests on Mac OS X indicate that this is a valid case. * Source/GSNibLoading.m: Fixed some memory leaks. * Source/NSRulerMarker.m: Use the bounds of the containing view instead of markersRect. I will revisit if the _markersRect method needs to be corrected, but this code seems to correct problems observed when dragging markers in and out of the rulerView. 2009-02-23 Fred Kiefer * Source/NSSavePanel.m (-directory): Optimize last change. 2009-02-22 Fred Kiefer * Source/NSButtonCell.m: Changed all title methods to use the super string value methods and redefine the local string value methods to work with the object value. Patch by Matt Rice . * Source/GSThemeDrawing.m (-cellForScrollerKnobSlot:): Use setTitle: instead of setStringValue:. 2009-02-20 12:08-EST Gregory John Casamento * Source/GSToolbarCustomizationPalette.m: Look up default items before calling the delegate like in NSToolbar.m. This was causing an exception which prevented the panel from showing. 2009-02-18 Richard Frith-Macdonald * Source/GSServicesManager.m: Clean up update of services menu, removing useless check and obsolete code. 2009-02-18 Fred Kiefer * Source/NSApplication.m (NSAppIconView-setImage:): Protect against the item being nil. 2009-02-18 02:45-EST Gregory John Casamento * Source/GSNibLoading.m: Rollback of previous change. Found a minor problem. * Source/NSDrawer.m: Improvements to NSDrawer handling. 2009-02-17 23:09-EST Gregory John Casamento * Source/GSNibLoading.m: use the new code committed to NSMenu to lay out the menu when vertical. Get rid of the duplicate code here. * Source/NSDrawer.m: set the child window position when opening. * Source/NSMatrix.m: -_selectCell:atRow:column: Check to make sure the selectedRow and selectedColumn are > -1. This check is done elsewhere and was not done here. This was causing a crash. 2009-02-17 Fred Kiefer * Source/NSImageView.m (-initWithFrame:): Set non-editable as default. Fixes #25484. 2009-02-17 Fred Kiefer * Source/NSMenu.m (-_organizeMenu): Try to better switch between Apple menu layout and ours. 2009-02-17 Fred Kiefer * Source/NSRulerView.m (+initialize): Correct version to be an integer. 2009-02-16 Adam Fedor * configure.ac: Look for libpng/png.h * Source/NSBitmapImageRep+PNG.m: Use found loction of png.h (Fixes #24111). 2009-02-16 Riccardo Mottola * Source/NSCell.m (-setStringValue): Try to fix bugs in last change. Optimize in case of common string and check for nil. 2009-02-16 Fred Kiefer * Source/NSCell.m (-setStringValue:, -setObjectValue:): Try to fix bugs in last change. 2009-02-15 22:21-EST Gregory John Casamento * Source/NSOpenPanel.m: Corrects bug #25471. Only enable the OK button when a file the application can open is selected. 2009-02-15 19:38-EST Gregory John Casamento * Source/NSCell.m: Change to implement 10.3 and later behavior for the method setStringValue: as documented in Apple's documentation for the method. This behavior was observed on Cocoa under Mac OS 10.5. 2009-02-12 Riccardo Mottola * Source/NSSavePanel.m: Return autoreleased copy of the directory string 2009-02-12 Richard Frith-Macdonald * Tools/make_services.m: Fix error parsing CFBundleURLTypes 2009-02-11 Richard Frith-Macdonald * Tools/make_services.m: Check applications for CFBundleURLTypes (see http://developer.apple.com/documentation/MacOSX/conceptual/BPRuntimeConfig/Articles/PListKeys.html) * Source/NSWorkspace.m: ([-openURL:]) try to open non-file URLs using an app found based on CFBundleURLTypes, and if that fails try to use any available 'OpenURL' service. 2009-02-11 Richard Frith-Macdonald * Source/GSTheme.m: Fix typo in include * Source/NSTableView.m: Fix to compile with GC (reported by Lu Liyi) 2009-02-11 00:49-EST Gregory John Casamento * Source/NSBundleAdditions.m: -[NSNibOutletConnector establishConnection] report exceptions when establishing a connection, but don't fail to load. 2009-02-10 Fred Kiefer * Source/NSToolbarFrameworkPrivate.h: Add method _setCustomizationPaletteIsRunning:. * Source/NSToolbar.m: (-runCustomizationPalette:): Code to run customization palette. * Source/NSToolbarItem.m (-copyWithZone:): Try to copy the view. * Source/GSToolbarCustomizationPalette.h * Source/GSToolbarCustomizationPalette.m: New files. * GNUmakefile: Add new files. * Panels/English.lproj/GSToolbarCustomizationPalette.gorm * Panels/English.lproj/GSToolbarCustomizationPalette.gorm/data.info * Panels/English.lproj/GSToolbarCustomizationPalette.gorm/data.classes * Panels/English.lproj/GSToolbarCustomizationPalette.gorm/objects.gorm * Panels/GNUmakefile: Add new panel. This is a stripped down version of the toolbar customization branch by Quentin Mathe . 2009-02-08 Richard Frith-Macdonald * Source/GSThemePrivate.h: * Source/GSTheme.m: * Source/NSImage.m: Move/rename new proxy code to GSTheme.m and declare it in GSThemePrivate.h so that all code in the GUI can use it (we will need to allow other resources to automatically update to the current theme, not just images). 2009-02-09 20:16-EST Gregory John Casamento * Source/NSToolbar.m: (-windowDidUpdate:): Automatically update the toolbar on every window update. This makes sure that no matter what window an event happens in the toolbar gets properly updated for ALL windows. 2009-02-08 Wolfgang Lux * Source/NSWorkspace.m (-findApplications): Retain cached path of make_services tool. * Tools/GSspell.m (-init): Initialize language configuration variable used by the aspell checker. This prevents a crash of the spelling server during its initialization. * Source/NSSavePanel.m (-browser:createRowsForColumn:inMatrix:): Make sure the contents of the initial directory is always shown. This should fix bug #25363. 2009-02-08 Richard Frith-Macdonald * Source/NSImage.m: Fix missing header. 2009-02-08 Fred Kiefer * Source/NSBundleAdditions.m (NSNibOutletConnector -establishConnection): Use KVC call setValue:forKey: to establish the outlet connection. This will result in ivars being properly retained. 2009-02-08 Richard Frith-Macdonald * Source/NSImage.m: WARNING ... this change may have unforseen consequences. Named images are replaced by proxies to the images so that all image drawing the the gui updates instantly when the theme changes. It's possible that sme code uses the image in an unexpected way that the proxy does not support ... plase look out for that and report any problems so I can fix them. 2009-02-08 01:17-EST Gregory John Casamento * Source/NSApplication.m: Added code to handle exceptions in -[NSApplication run]. Rudimentary implementation of default NSExceptionHandlerMask. 2009-02-07 Fred Kiefer * Headers/Additions/GNUstepGUI/GSTheme.h, * Source/GSTheme.m (-drawToobarRect:frame:borderMask:): New method for toolbar view drawing * Source/GSToolbarView.m (-drawRect:): Use new theme method. Clean up use of colours. 2009-02-07 Richard Frith-Macdonald * Source/GSThemeTools.m: Add a few checks for tile sizes * Source/GSTheme.m: Limit icon size to 48x48 2009-02-06 Richard Frith-Macdonald * Source/GSTheme.m: * Source/GSThemeTools.m: * Source/GSThemePrivate.h: Improve tiling for matrix and for rectangles in flipped views. 2009-02-04 17:51-EST Gregory John Casamento * Source/NSWindow.m: Correct compilation error. 2009-02-04 Richard Frith-Macdonald * Source/NSApplication.m: Don't attempt to set app icon until creating the window (if we are going to create it). Fix size checks when setting image to cope if window does not exist (was previously the normal case) to avoid streams of X errors on most systems and segmentation fault on sparc. 2009-02-04 01:53-EST Gregory John Casamento * Source/GSNibLoader.m: Correct the message to indicate an issue loading a nib, not a gorm, file. * Source/GSNibLoading.m: Uncomment the release in the dealloc method. * Source/NSApplication.m: Restrict the icon size to the size of the miniwindow if it's larger, but don't expand it, if it's smaller. * Source/NSLayoutManager.m: -initWithCoder: Initialize when loading a nib in the same way that we initialize when loading a gorm file. 2009-02-03 Fred Kiefer * Source/NSCell.m (-_sendActionFrom:): New helper method for action sending. 2009-02-03 Fred Kiefer * Source/GSNibLoading.m (NSButtonImageSource -initWithCoder:): Add missing retain of the named image. 2009-02-03 Richard Frith-Macdonald * Source/NSTextContainer.m: Add some frame size checks. * Source/NSScrollView.m: ditto * Source/NSHelpPanel.m: Make sure we create with a reasonable size. 2009-02-01 Fred Kiefer * Source/NSTextView.m (-dragSelectionWithEvent:...): Correct computation of attachment cell frame. * Source/NSParagraphStyle.m (NSMutableParagraphStyle -setParagraphStyle:): Set only existing text blocks and text lists. 2009-01-31 Richard Frith-Macdonald * Source/GSDisplayServer.m: Fix typo * Headers/Additions/GNUstepGUI/GSDisplayServer.h: ditto * Source/NSWindow.m: ditto * Source/GSTheme.m: Make color handling more efficient * Headers/Additions/GNUstepGUI/GSTheme.h: ditto * Source/GSThemeDrawing.m: ditto * Source/NSScrollView.m: ditto 2009-01-31 Richard Frith-Macdonald * Source/GSToolTips.m: Fix retain/release problem. * Source/NSToolbar.m: Add exception handler round unsafe code. 2009-01-30 Richard Frith-Macdonald * Source/GSThemeTools.m: Add checks to prevent problems in the case where the control being drawn is actually smaller than the tiles used. * Headers/AppKit/NSScreen.h: * Source/NSScreen.m: Cache device description dictionary ... when debugging the problem with theme tools (which caused a loop to repeatedly composite the tile image instead of doing it once), I noticed that almost every time I stopped the app in gdb, it was in the process of creating a device description, strongly suggesting that this is actually quite a time consuming part of drawing images. 2009-01-30 Richard Frith-Macdonald * Source/NSApplication.m: Try to get behavior to match MacOS-X by moving call to -updateWindows to be done before getting the next event. Updating is done only if it was flagged as needing to be done since the last update, but if we are in NSDefaultRunLoopMode or NSModalRunLoopMode we automatically set the flag before handling each event ... so unless the application explicitly turns it off, it's always done in these modes. Might fix #25384 * Source/NSView.m: Invalidate tracking rects when they are removed from the view. Might fix #25385 2009-01-29 Fred Kiefer * Source/NSParagraphStyle.m: Fix all copying code to handle textBlocks and textLists correctly. 2009-01-29 Fred Kiefer * Headers/Additions/GNUstepGUI/GSDisplayServer.h (-setPartentWindow:forChildWindow:), * Source/GSDisplayServer.m (-setPartentWindow:forChildWindow:): New method. * Source/NSWindow.m (-setParentWindow:, -_initBackendWindow): Use this new method. * Source/NSPopUpButtonCell.m (-attachPopUpWithFrame:inView:, -dismissPopUp): Use child window mechanism for the popup menu. 2009-01-28 Fred Kiefer * Source/NSWindow.m (GSWindowWithNumber): Protect against windowmaps not being set. 2009-01-27 15:28-EST Gregory John Casamento * Source/GSNibLoading.m: Temporarily comment out the release of connections until we find the cause of some current crashes. This will be reverted ASAP. * Source/NSDrawer.m: Don't slide the window out, just appear where it needs to be. 2009-01-27 Fred Kiefer * Headers/AppKit/NSAttributedString.h: Add missing MacOSX methods. * Source/NSAttributedString.m: Rewrote data loading and add setting of NSError. * Headers/AppKit/NSLayoutManager.h (-attachmentSizeForGlyphAtIndex:, showAttachmentCell:inRect:characterIndex:): Declare these missing methods. * Source/NSLayoutManager.m: Implement and use them. * Source/NSTextView.m (-dragSelectionWithEvent:...): Use layout manager attachment methods. 2009-01-26 Fred Kiefer * Source/NSAttributedString.m (-dataFromRange:..., -fileWrapperFromRange:...): Basic implementation. 2009-01-25 Richard Frith-Macdonald * Source/NSMenu.m: Keep the main menu in the main window (or visible if there is no main menu) when using microsoft style menus. * Source/NSWindow.m: If the main windows closes and it contains the main menu, unset the menu. 2009-01-25 11:51-EST Gregory John Casamento * Source/NSMenuView.m: Return from the trackWithEvent: method if the indexOfActionToExecute is -1. 2009-01-25 Richard Frith-Macdonald * Source/GSWindowDecorationView.m: * Source/NSMenu.m: * Source/NSWindow.m: * Source/NSToolbarFrameworkPrivate.h: Tweaks to allow setting of a menu in a window (and unsetting it) repeatedly as you switch between themes. 2009-01-25 Fred Kiefer * Source/NSDocumentController.m (-_nameForHumanReadableType:): Also look at CFBundleTypeName. 2009-01-25 06:47-EST Gregory John Casamento * Source/NSMenuView.m: Refactor code which executes the action of a menu item at a given index into a separate method to make it easier to override this behavior when necessary. Added method _executeItemAtIndex:removeSubmenu:. 2009-01-25 Fred Kiefer * TextConverters/RTF/RTFProducer.m (RTFDProducer -produceFileFrom:...): Always create a directory, even for simple RTF files. 2009-01-25 Fred Kiefer * Source/NSDocument.m (-runModalSavePanelForSaveOperation:...): Correct the name of the selector being tested. 2009-01-24 Fred Kiefer * Source/NSDocumentController.m (-validateUserInterfaceItem:): Show newDocument: only if there is a default type. 2009-01-23 Richard Frith-Macdonald * Source/NSWindow.m: ignore invalid rects when checking tracking rectangles. 2009-01-23 Fred Kiefer * Source/NSMenuView.m: Convert between the window and the view coordinate system. * Source/NSDocument.m (dataOfType:error:): Call dataRepresentationofType: when that method was overriden. * Source/NSDocument.m (writeToURL:ofType:error:): Use dataOfType:error: instead of dataRepresentationofType:. 2009-01-22 Fred Kiefer * Source/GSWindowDecorationView.m: Add handling of in-window menu. Simplify code for toolbar handling. * Source/NSToolbarFrameworkPrivate.h: Publish ne methods. * Source/NSWindow.m (-setMenu:): Set the menu as in-window menu. * Source/NSMenuView.m: Set the frame width to the screen width in setHorizontal: and not in sizeToFit. 2009-01-21 Richard Frith-Macdonald * Source/NSOutlineView.m: Don't ask if the topmost item is expandable. On MacOS-X the delegate is not asked ... we just assume that it is. Fix for bug #25369 2009-01-20 Wolfgang Lux * Source/NSImage.m (-compositeToPoint:fromRect:operation:, -compositeToPoint:fromRect:operation:fraction:, -dissolveToPoint:fromRect:fraction:): Fix invalid return statements between NS_DURING and NS_HANDLER. 2009-01-19 Fred Kiefer * Source/NSAnimation.m (-_gs_startAnimationInOwnLoop): Use an auto release pool inside of the loop. * Source/NSAnimation.m: A bit of reformatting and clean up. 2009-01-18 Fred Kiefer * Headers/Additions/GNUstepGUI/GSAnimator.h: Remove unneeded ivar. * Source/GSAnimator.m: Remove retain cycle with NSAnimation and simplify implementation. * Source/NSAnimation.m: Replace NSDebugFLLog with NSDebugMLLog. 2009-01-18 Wolfgang Lux * Source/NSMenu.m (-update, -setAutoenablesItems:, initWithCoder): Revert NSMenu changes from r27569. * Source/NSMenu.m (-update): Improve menu item validation by falling back to -validateUserInterfaceItem: if the validator doesn't respond to -validateMenuItem:. * Source/NSToolbarItem.m (-validate): Fix broken implementation. * Source/NSToolbarItem.m (-validateMenuItem:) Add implementation to validate menu items in text only representation and in an overflow menu. * Source/GSToolbarView.m (-overflowMenu): Validate each toolbar item before adding a menu item to an overflow menu. Also rename method to make its purpose clear. * Source/NSApplication.m (-targetForAction:to:from:): Make sure toolbar items are validated w.r.t. the responder chain of their respective window. * Source/NSApplication.m (-_targetForAction:keyWindow:mainWindow:): Helper method to consolidate target look up in the responder chain. * Source/NSWindow.m (-initWithContentRect:..., -setContentView:): Include a window's decoration view in its responder chain so that dynamic target look up works for toolbar items. 2009-01-17 Wolfgang Lux * Source/NSDocument.m (-windowForSheet): Return nil if the document has no window controllers. * Source/NSWindow.m (-undoManager, -dealloc): Create an undo manager for a window when necessary. * Source/NSWindow.m (-sendEvent:): Don't activate an application upon a single click into a miniwindow. 2009-01-16 12:04-EST Gregory John Casamento * Source/NSMenuItem.m: Retain the GSMenuSeparator instance if the menu item is a separator since we want to make sure the object isn't prematurely released. 2009-01-16 Richard Frith-Macdonald * Source/NSAnimation.m: _gs_startAnimationInOwnLoop hopefully fixed bug #25327 2009-01-12 Richard Frith-Macdonald * Source/NSTextStorage.m: Change to use new GC finalization API. 2009-01-12 10:25-EST Gregory John Casamento * Source/GSNibLoading.m: More documentation. 2009-01-12 Fred Kiefer * Source/NSButtonCell.m (-initWithCoder:): Replace the key equivalent when it was set wrongly by Gorm. Patch by Wolfgang Lux . 2009-01-11 20:49-EST Gregory John Casamento * Source/GSNibLoading.m: Reorganization and simplification of nib loading logic in NSIBObjectData. Also documentation for NSIBObjectData and NSClassSwapper. 2009-01-10 15:49-EST Gregory John Casamento * Source/NSToolbarItem.m: Added _sendAction: method to send the action with the NSToolbarItem instance as the sender when the toolbar item is represented by an NSMenuItem. 2009-01-09 23:09-EST Gregory John Casamento * Source/NSMenu.m: Correction to previous change. Update when setAutoenableItems: value is changed. Altered update to enable menu items when autoenable is not being performed. 2009-01-09 22:53-EST Gregory John Casamento * Source/NSMenuItemCell.m: encode menu item in encodeWithCoder: method. * Source/NSMenu.m: Add code to handle NSNoAutoenable * Source/NSPopUpButtonCell.m: Decode/encode selected index * Source/NSPrintInfo.m: Set orientation after the page size is known, since it has no effect when done earlier. 2009-01-09 Richard Frith-Macdonald * Source/NSColorWell.m: Fix bug #25278 after checking behavior on MacOS 2009-01-09 Fred Kiefer * Headers/AppKit/NSWindow+Toolbar.h, * Source/NSWindow+Toolbar.m: Remove these file and move all code ... * Headers/AppKit/NSWindow.h, * Source/NSWindow.m: ... to here. * Source/NSToolbarFrameworkPrivate.h, * Headers/AppKit/AppKit.h, * Source/GNUmakefile: Remove references to these files. * Source/NSToolbar.m (-_toolbarView): Create the toolbar view here and not in [NSWindow setToolbar:]. 2009-01-08 Richard Frith-Macdonald * Source/GSTheme.m: Fix nil pointer exception. * Source/NSScrollView.m: Fix to notice theme activation and support themed color for separators. 2009-01-07 Fred Kiefer * Source/NSWindow+Toolbar.m, * Source/NSToolbar.m, * Source/GSToolbarView.m: Revert the relationship between NSToolbar and GSToolbarView, now the toolbar retains the view. 2009-01-07 Richard Frith-Macdonald * Source/GSTheme.m: * Source/GSThemeDrawing.m: * Headers/Additions/GNUstepGUI/GSTheme.h: Add support for setting color of named parts. 2009-01-06 Fred Kiefer * Source/GSWindowDecorationView.m: No longer adjust the size of the content view, when a toolbar is added, removed or resized. 2009-01-06 Richard Frith-Macdonald * Source/GSTheme.m: * Source/NSScroller.m: * Source/GSThemeDrawing.m: * Headers/Additions/GNUstepGUI/GSTheme.h: Extend element naming API to support temporary elements ... ones which are 'owned' by a particular theme instance and automatically removed when the theme deactivates. Changed scroller code to use this for the shared scroller parts. 2009-01-05 Fred Kiefer * Headers/AppKit/NSController.h, * Source/NSController.m: Add one 10.4 method. * Headers/AppKit/NSUserDefaultsController.h: Add one 10.4 method. * Source/NSUserDefaultsController.m: Fully implement class. 2009-01-05 Richard Frith-Macdonald * Source/NSScroller.m: Fixup/reorganisation of setting names for components parts of scroller for theming. * Source/GSThemeDrawing.m: Fix memory leak spotted by Fred. 2009-01-05 Richard Frith-Macdonald * Headers/Additions/GNUstepGUI/GSTheme.h: * Source/GSTheme.m: * Source/NSButtonCell.m: * Source/NSScroller.m: * Source/GSThemeDrawing.m: Add methods to name specific elements in the gui so that we can locate resources for them and so that override methods can handle them specially. Change tile image lookup for improved consistency/simplicity and to use new naming. Add naming of component parts of a scroller. 2009-01-04 18:32-EST Gregory John Casamento * Source/GSToolbarView.m: Use ASSIGN as suggested. This corrects the crash and fixes the leak caused by the previous change. 2009-01-04 16:45-EST Gregory John Casamento * Source/GSToolbarView.m: Correct crash in toolbar, since the static constant was being released. 2009-01-04 Fred Kiefer * Source/NSDocumentController.m: Check only shouldCreateUI before callin makeWindowControllers. This is the behaviour reported for Cocoa. 2009-01-03 Fred Kiefer * Source/GSWindowDecorationView.m: Adopt the window size when adding or removing a toolbar, not the size of the content view. 2009-01-02 Fred Kiefer * Source/NSWindow+Toolbar.m: Move window toolbar code from here ... * Source/GSWindowDecorationView.m: ... to here. * Source/NSToolbarFrameworkPrivate.h: Declare new window decoration view toolbar handling methods. * Source/NSToolbar.m: Use them. 2009-01-02 Fred Kiefer * Headers/Additions/GNUstepGUI/GSToolbarView.h: Remove now unneeded include of NSToolbar.h * Source/NSToolbarFrameworkPrivate.h: New header file with shared toolbar classes extensions. * Source/NSWindow+Toolbar.m, * Source/NSToolbar.m * Source/NSToolbarItem.m * Source/GSToolbarView.m: Use this new header file. 2009-01-02 Fred Kiefer * Source/NSWindow+Toolbar.m, * Source/NSToolbar.m: Rewrote interaction with GSToolbarView. * Source/NSToolbar.m (_toolbarItemForIdentifier:): Fix memory leak. * Headers/Additions/GNUstepGUI/GSToolbarView.h, * Source/GSToolbarView.m: General cleanup of code. 2009-01-02 Richard Frith-Macdonald * Source/NSButtonCell.m: Fix to use the backgroundColor method when drawing a borderless button. * Source/NSScroller.m: * Source/GSThemeDrawing.m: * Headers/Additions/GNUstepGUI/GSTheme.h: Add in slightly modified version of Christopher Armstrong's code for theming for NSScroller. 2009-01-02 Richard Frith-Macdonald * Headers/Additions/GNUstepGUI/GSTheme.h: * Source/GSThemePanel.m: * Source/GSTheme.m: Simplify +initialize. Set name properly on initialisation. Hide private instance variables to make it easy to add new ones later. Refrain from displaying backup versions of themes in selection panel. 2009-01-01 Fred Kiefer * Headers/Additions/GNUstepGUI/GSToolbar.h, * Source/GSToolbar.m: Remove. * Source/GNUmakefile: Remove these files. * Headers/AppKit/NSToolbar.h, * Source/NSToolbar.m: Add code from GSToolbar plus some 10.4 methods. * Headers/Additions/GNUstepGUI/GSToolbarView.h, * Headers/AppKit/NSToolbarItem.h, * Source/GSToolbarView.m, * Source/NSWindow+Toolbar.m, * Source/NSToolbarItem.m: Change GSToolbar into NSToolbar. 2009-01-01 Fred Kiefer * Headers/Additions/GNUstepGUI/GSToolbar.h, * Source/GSToolbar.m, * Source/NSToolbar.m: Remove unused initializer. * Source/GSToolbarView.m: Remove method _setToolbar:, code is now in setToolbar:. * Source/NSWindow+Toolbar.m (-setToolbar:): Adopt to changes in GSToolbarView. 2009-01-01 Richard Frith-Macdonald * Headers/Additions/GNUstepGUI/GSTheme.h: * Source/GSTheme.m: New method to allow the name of a theme to be set rather than being derived from the bundle name. This needed by Thematic.app (and perhaps also if we want to support arbitrary names in future). 2008-12-31 Fred Kiefer * Source/NSWindow+Toolbar.m (-setToolbar:): Clean up the toolbar view of the old toolbar. 2008-12-31 Fred Kiefer * Source/NSMenu.m * Source/NSPopUpButton.m, * Source/NSTextView.m, * Source/GSNibLoading.m: Add type casts to keep compiler happy. 2008-12-31 Fred Kiefer * Headers/Additions/GNUstepGUI/GSLayoutManager.h: Add some 10.5 methods. * Source/GSLayoutManager.m: Implement them. 2008-12-31 Fred Kiefer * Headers/AppKit/NSWindow.h: Use one of the spare ivars for toolbar. * Headers/AppKit/NSToolbar.h: Remove window ivar. * Source/NSWindow.m (-dealloc:): Unset the toolbar. * Source/NSWindow+Toolbar.m: Start to rewrite * Source/GSToolbar.m: Remove unused method declarations. * Source/GSToolbarView.m: Remove unused methods. * Source/NSToolbar.m: Remove all window related methods. Simplify the rest of the code. 2008-12-31 Fred Kiefer * Source/NSWindow.m (-validateMenuItem:): Add validation for toolbar toggle method. 2008-12-30 Fred Kiefer * Source/NSPrintOperation.m (_setupPrintInfo): Initialize viewPageRange before calling knowsPageRange:. 2008-12-30 Fred Kiefer * Headers/Additions/GNUstepGUI/GSToolbar.h (-_toolbars): Remove. * Source/NSWindow+Toolbar.m: Add [GSToolbar _toolbars] declaration here. * Source/GSToolbar.m, * Source/NSToolbar.m: Simplify by adding helper methods and removing dead code. * Headers/AppKit/NSToolbarItemGroup.h, * Source/NSToolbarItemGroup.m: New files. * Source/GNUmakefile: Add new files. * Headers/AppKit/NSToolbarItem.h: Add 10.5 methods and constants. * Source/NSToolbarItem.m: New methods and general rewrite. 2008-12-29 Richard Frith-Macdonald * Source/GSInfoPanel.m: Update name of current theme when it changes. * Source/GSThemeInspector.m: Display theme version number. 2008-12-29 Richard Frith-Macdonald * Source/NSBrowser.m: * Source/NSPopUpButtonCell.m: * Source/NSBox.m: * Source/NSComboBoxCell.m: * Source/NSScrollView.m: * Headers/Additions/GNUstepGUI/GSTheme.h: Make code clearer by removing function and replacing it with method call so you can see what's actually going on and also be a little more efficient. 2008-12-29 Richard Frith-Macdonald * Source/NSHelpManager.m: Allow the GSHelpViewer user default to control how application help is displayed. * Documentation/GuiUser/DefaultsSummary.gsdoc: Document the new user default. * Headers/Additions/GNUstepGUI/GSTheme.h: New notifications and method to obtain system colors. * Source/GSTheme.m: Move stuff out into separate files. Add new notifications for activation/deactivations. Implement new method to provide system colors, making it easy for subclasses to replace the standard mechanism for dealing with colors. * Source/GSThemeInspector.m: The inspector for viewing a theme. * Source/GSThemePanel.m: The panel for viewing/selecting themes. * Source/GSThemeTools.m: Low level drawing tools. * Source/GSThemeDrawing.m: Methods for drawing control. * Source/GSThemePrivate.h: Internal API * Source/GNUmakefile: Changes to build new theme files. * Source/NSColor.m: Use new API for obtaining color list. 2008-12-28 Fred Kiefer * Source/NSWindow.m: Remove left over traces of toolbar handling. * Headers/AppKit/NSWindow+Toolbar.h: Move some private methods from here ... * Source/NSWindow+Toolbar.m: ... to here. * Source/NSToolbarItem.m, * Source/GSToolbar.m, * Source/NSToolbar.m: White space clean up. 2008-12-28 Riccardo Mottola * Source/NSClipView.m: removed C99-ism 2008-12-28 Richard Frith-Macdonald * Source/NSApplication.m: Add tiny bit of diagnostic logging for locating backend bundle. 2008-12-26 Fred Kiefer * Source/NSAttributedString.m (-initWithData:..., -initWithURL:...): Basic implementation. * Source/NSAttributedString.m (NSMutableAttributedString-readFromData:...): Implement. 2008-12-26 Fred Kiefer * Source/NSDocumentController.m: Remove now unused override helper method. * Headers/AppKit/NSDocument.h: Change to use NSUInteger and NSInteger. Add new 10.5 method * Source/NSDocument.m: Implement all Cocoa methods of this class and clean up the rest of the implementation. 2008-12-25 Fred Kiefer * Headers/AppKit/NSMenuItem.h: Declare to implement interface NSValidatedUserInterfaceItem. * Headers/AppKit/NSDocumentController.h: Change to use NSUInteger and NSInteger. * Source/NSDocumentController.m: Implement all Cocoa methods of this class and clean up the rest of the implementation. Partly using code by Nikolaus Schaller . 2008-12-21 Adam Fedor * Version 0.16.0 2008-12-21 Wolfgang Lux * Source/NSTextView.m (-draggingUpdated:): Avoid redundant call to -scrollPoint: when scrolling diagonally. * Source/NSTextView.m: Fix inconsistent naming of (private) NSTextStorage category. * Source/NSTextView_actions.m (-centerSelectionInVisibleArea): Replace the provisional implementation by a correct one. * Source/NSTextView_actions.m (-transpose): Fix implementation to really match the implementation of Emacs' transpose command. 2008-12-20 22:13-EST Gregory John Casamento * Source/GSNibLoading.m: Read objects/accessibility and oids maps if we are in a gui builder so that data is accessible. * Source/NSActionCell.m: Don't archive target/action if they have no values. * Source/NSMenu.m: Only archive as "_NSMainMenu" if it has no parent and is not owner by a popup. * Source/NSPopUpButtonCell.m: Archive the default menu item which will show when this popup is displayed. 2008-12-20 Wolfgang Lux * Source/NSTextView.m (-shouldChangeTextInRange:replacementString:): Fix a crash during undo/redo when a text storage is shared among multiple text views and some of these views are closed by recording the undo/redo operations for the text storage rather than the text view. 2008-12-20 Wolfgang Lux * Source/NSApplication.m (-sendEvent:): Attempt to perform key equivalents in the key window before the main menu as on OS X. 2008-12-19 Nicola Pero * All GNUmakefiles: removed GNUSTEP_CORE_SOFTWARE=YES and added PACKAGE_NAME=gnustep-gui. * GNUmakefile: Export PACKAGE_NAME to reduce chances of a problem if a GNUmakefile in a subdirectory is missing it. 2008-12-18 Nicola Pero * All GNUmakefiles: added GNUSTEP_CORE_SOFTWARE=YES at the beginning. * GNUmakefile: Export GNUSTEP_CORE_SOFTWARE to reduce chances of a problem if a GNUmakefile in a subdirectory is missing it. 2008-12-17 21:20-EST Gregory John Casamento * Source/GSNibLoading.m: Remove change which resets the bounds in NSCustomView as it was not needed and caused issues in some cases. 2008-12-16 Richard Frith-Macdonald * Source/NSWorkspace.m: Restore priority in lookup for Editors error in last change pointed out by David Ayers. 2008-12-16 19:41-EST Gregory John Casamento * Source/GSNibLoading.m: Correct issue with setting next key view and previous key view. * Source/NSView.m: Comment out frame/bounds matrix calculation since they are done when needed. 2008-12-16 17:23-EST Gregory John Casamento * Source/GSNibLoading.m: Changes to initialize bounds in NSCustomView. 2008-12-16 16:41-EST Gregory John Casamento * Source/NSView.m: Add back in matrix initialization. 2008-12-16 Wolfgang Lux * Source/NSTextView.m (-draggingUpated:): Scroll during dragging if the mouse pointer is close to the border of the view's visible rectangle. * Source/GSDragView.m (-handleEventDuringDragging:): Periodically send -draggingUpdated: messages to the dragging destination. 2008-12-16 Richard Frith-Macdonald * Source/NSWorkspace.m: Fix problem failing to recognise path extension where the role is blank. 2008-12-16 Fred Kiefer * Source/NSButtonCell.m (-setImage:): Call super implementation to make sure the button gets redrawn. * Source/NSWindow.m (-setContentView:): Don't do anything when setting the same view again. 2008-12-16 13:58-EST Gregory John Casamento * Source/GSNibLoading.m: Make the log into debug in awakeFromNib * Source/NSApplication.m: Allow modal to end multiple times, per spec there is no exception for doing this. * Source/NSPasteboard.m: Allow multiple threads in pasteboard communication. 2008-12-16 Fred Kiefer * Source/NSImage.m (-drawRepresentation:inRect:, -lockFocusOnRepresentation:): Draw the background colour even when it is the clear colour. (Fixes issue on xlib backend) 2008-12-15 21:29-EST Gregory John Casamento * Images/common_ToolbarCustomizeToolbarItem.tiff * Images/GNUmakefile: Add new image for toolbar customization. 2008-12-15 19:49-EST Gregory John Casamento * Source/GSNibLoading.m: remove extraneous awakeFromNib call in nibInstantiateWithOwner:topLevelObjects:. 2008-12-15 18:37-EST Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibLoading.h: Added methods to header which were added during refactoring. * Source/GSNibLoading.m: Corrections to NSCustomView, refactoring. Changes to initialization logic to call awakeFromNib. * Source/NSBundleAdditions.m: Cleanup to move code to the nib loading code. * Source/NSClipView.m: Added assertion to guarantee that no NSCustomView is unarchived at time of initWithCoder: being called. 2008-12-15 Fred Kiefer * Source/NSMenuItemCell.m (-_keyEquivalentString): Ignore function keys as key equivalents. 2008-12-15 Fred Kiefer * Source/NSImage.m: White space changes and general clean up. * Source/NSImage.m (-removeRepresentation:): Remove also cached representations for the current one. * Source/NSImage.m (-_cacheForRep:): Don't invalidate a valid cached representation. * Source/NSImage.m: Move some code from _doImageCache: to lockFocusOnRepresentation: 2008-12-14 Wolfgang Lux * Source/NSDocument.m (-addWindowController:,-removeWindowController:): * Source/NSWindowController.m (-setDocumentEdited): * Source/NSWindow.m (-_startBackendWindow): Ensure that new windows properly show their document edited status. 2008-12-14 Wolfgang Lux * Source/NSDocumentFrameworkPrivate.h: * Source/NSApplication.m(-finishLaunching): * Source/NSDocumentController.m (-setAutosavingDelay:, -reopenDocumentForURL:withContentsOfURL:error:, -_autosaveDirectory, -autosaveDocuments:, -reopenAutosavedDocuments, -recordAutosavedDocument:): * Source/NSDocument.m (-initForURL:withContentsOfURL:ofType:error, -writeWithBackupToFile:ofType:saveOperation:, -writeSafelyToURL:ofType:forSaveOperation:error:, -revertDocumentToSaved:, close, -setAutosavedContentsFileURL:, -autosaveDocumentsWithDelegate:didAutosaveSelector:contextInfo:, -_removeAutosavedContentsFile): Implement document autosaving. 2008-12-14 Wolfgang Lux * Source/NSSavePanel.m (-browserDidScroll:): Perform column validation whenever the browser is scrolled, since only the contents of the visible columns is validated. 2008-12-13 Fred Kiefer * Source/NSImage.m: Reorganize the image caching code to make it easier to understand and change. 2008-12-12 19:36-EST Gregory John Casamento * Source/NSOutlineView.m: Added change suggested by Doug in bug #25078. This should fix the problem in SVN. 2008-12-12 Fred Kiefer * Source/NSBrowser.m (-drawTitle:inRect:ofColumn:, -dealloc): Replaced the last fix here with a slightly better one that removes the ownership of the shared titlecell as soon as it isn't needed any more. The old code caused redundant redraws. 2008-12-12 02:04-EST Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibLoading.h: Added new method nibInstantiateWithCoder: to do the initialization normally done in NSView when not in IB/Gorm. * Source/GSNibLoading.m: Added implementation of new method and also re-wrote part of NSCustomView. * Source/NSView.m: Added an NSAssert to assure that no subview ever decoded is an NSCustomView. 2008-12-12 Fred Kiefer * Source/NSBitmapImageRep.m (-_convertToFormatBitsPerSample:...): Made the code a bit more tolerant on matching colour spaces during image conversion. 2008-12-10 02:31-EST Gregory John Casamento * Source/GSNibLoading.m: Change code which adds subviews to use an enumerator. 2008-12-10 01:54-EST Gregory John Casamento * Source/GSNibLoading.m: Add back code with adds in subviews from the custom view. 2008-12-10 01:37-EST Gregory John Casamento * Source/GSNibLoading.m: (-[NSCustomView initWithCoder:]) replace with real object and also replace in the coder. 2008-12-09 23:26-EST Gregory John Casamento * Source/GSGormLoading.m: (-[GSNibItem initWithCoder:]) initialize NSApplication and subclasses using sharedApplication. 2008-12-09 Wolfgang Lux * Source/NSTextView_actions.m (-centerSelectionInVisibleArea:): Provide a provisional implementation. * Source/NSSavePanel.m (-setAllowedFileTypes:): Change extension of the file name if the current extension is no longer allowed. 2008-12-08 Fred Kiefer * Headers/AppKit/NSTextFieldCell.h: Declare new private method _drawBackgroundWithFrame:inView:. * Source/NSTextFieldCell.m: Change drawInteriorWithFrame:inView: into _drawBorderAndBackgroundWithFrame:inView:. And moved some code into _drawBackgroundWithFrame:inView:. Remove some minor optimisations to simplify code. * Source/NSTextFieldCell.m (-initWithCoder:): Correct memory leak and improve decoding. * Source/NSTextFieldCell.m (-encodeWithCoder:): Encode bezel style. * Source/NSTableHeaderView.m (-_drawBorderAndBackgroundWithFrame:inView:), * Source/NSBrowser.m (GSBrowserTitleCell -_drawBorderAndBackgroundWithFrame:inView:): Use _drawBackgroundWithFrame:inView:. 2008-12-07 22:50-EST Gregory John Casamento * Source/NSTableView.m: Switch to the alternate highlighting color only when the background is white. 2008-12-07 22:30-EST Gregory John Casamento * Source/NSTableView.m: Change highlighting color so that it shows on both white and grey backgrounds. 2008-12-07 Fred Kiefer * Source/NSWindowController.m (-initWithWindow:, -initWithWindowNibPath:owner:, -initWithWindowNibName:owner:, -initWithCoder:): Made all initialisation methods a bit safer. Solves bug #25004. * Source/NSCachedImageRep.m(-draw): Don't draw an empty rect. Fixes the remaining issue of #22282. 2008-12-07 Wolfgang Lux * Source/NSTextView.m (-mouseDown:): Start drag operation only after a single click into the selected range. 2008-12-07 Richard Frith-Macdonald * Source/NSSound.m: * Source/NSWorkspace.m: * Source/NSPasteboard.m: Use new method to locate tool executables which handles the addition of .exe extenstion for mingw. 2008-12-06 Wolfgang Lux * Source/NSSavePanel.m (-_shouldShowExtension:isDir:, -browser:createRowsForColumn:inMatrix:): * Source/NSOpenPanel.m (-_shouldShowExtension:isDir:): The panels now use the information provided by NSWorkspace in order to identify file packages. 2008-12-06 Wolfgang Lux * Source/NSSavePanel.m (-_reloadBrowser:, -setRequiredFileType:, -setAllowedFileTypes:, -setTreatsFilePackagesAsDirectories:): * Source/NSOpenPanel.m (-_setupForTypes:, -setCanChooseFiles:) -runModal..., -beginSheet...): Update the panels' browser when the list of visible file extensions is changed programmatically. 2008-12-06 Wolfgang Lux * Headers/AppKit/NSSavePanel.h: * Source/NSSavePanel.m (-requiredFileType, -setRequiredFileType:, -allowedFileTypes, -setAllowedFileTypes:, -filename, -_resetDefaults, -_shouldShowExtension:isDir:): * Source/NSDocument.m (-changeSaveType:, -fileNameFromRunningSavePanelForSaveOperation:): Implement support for document types with multiple allowed file extensions. * Source/NSDocument.m (-writeWithBackuptoFile:ofType:saveOperation:): Bug fix: Do not modify the file name argument. 2008-12-06 Wolfgang Lux * Source/NSSavePanel.m (-ok, -cancel:, -_setDefaultDirectory:, -_updateDefaultDirectory:, -_setupForDirectory:file:): * Source/NSOpenPanel.m (-ok:): * Source/NSDocumentController.m (-currentDirectory) (-reviewUnsavedDocumentsWithAlertTitle:cancelable:): Make open and save panels consistently start up in the last used directory by default. 2008-12-06 Wolfgang Lux * Headers/AppKit/NSDocument.h: * Source/NSDocument.m (-isDocumentEdited, updateChangeCount:, hasUnautosavedChanges, changeWasDone): Fix bug where a document would appear unmodified after saving the document, undoing a number of changes, and then making an equal number of changes. * Source/NSDocument.m (-revertDocumentToSaved:): Reset the undo manager after reverting a document. 2008-12-06 Wolfgang Lux * Source/NSDocument.m (-undo:, -redo:, -validateMenuItem:): Move implementation from here ... * Source/NSWindow.m (-undo:, -redo:, -validateMenuItem:): ... to here. Also validate close, miniaturize, and zoom actions. 2008-12-06 Richard Frith-Macdonald * Source/NSSound.m: * Source/NSWorkspace.m: * Source/NSPasteboard.m: * Source/GNUmakefile.preamble: Remove code which would not locate tools properly and fixup. 2008-12-03 22:38-EST Gregory John Casamento * Source/GSNibLoading.m: Check to make sure the menu has more than 0 entries in _setMain:. 2008-12-03 17:23-EST Gregory John Casamento * Source/NSDocumentController.m: Fixed fileExtensionFromType:, bug #24894 2008-12-03 01:38-EST Gregory John Casamento * Source/GSInfoPanel.m: -[GSInfoPanel initWithDictionary:] don't show authors in the info panel if there are none given in the dictionary. 2008-12-03 01:11-EST Gregory John Casamento * Source/NSApplication.m: Always resize icon to 48x48 so that icons larger than this will display correctly. Change made in setApplicationIconImage:. 2008-12-02 23:55-EST Gregory John Casamento * Source/GSNibLoading.m: Added some new methods to address bug #24985. * Source/NSMenu.m: Removed some spaces after a close brace. 2008-12-02 19:45-EST Gregory John Casamento * Source/NSApplication.m: Fix for bug #24785. 2008-12-02 Richard Frith-Macdonald * Source/NSBrowser.m: fix uninitialised variable. * Source/GNUmakefile: * PrinterTypes/GNUmakefile: * Documentation/GuiUser/GNUmakefile: * Documentation/GNUmakefile: * Documentation/General/GNUmakefile: * Resources/GNUmakefile: * Panels/GNUmakefile: * GNUmakefile: * Printing/GSLPR/GNUmakefile: * ColorPickers/GNUmakefile: * Model/GNUmakefile: * Tools/GNUmakefile: * Tools/gsnd/GNUmakefile: * Images/GNUmakefile: Fix bug #24672 * Tools/make_services.m: Fix bug #24990 ... was reporting debug output which should only have appeared when running in verbose mode. 2008-12-02 02:31-EST Gregory John Casamento * Source/GSNibLoading.m * Source/NSButtonCell.m * Source/NSNibAXAttributeConnector.m * Source/NSNibAXRelationshipConnector.m * Source/NSNibBindingConnector.m * Source/NSNib.m * Source/NSProgressIndicator.m: Change to use new headers. 2008-12-02 02:07-EST Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibCompatibility.h: Remove * Headers/Additions/GNUstepGUI/GSNibTemplates.h: Remove * Source/GNUmakefile: Update to reference new files. * Source/GSGormLoader.m: Change to reference the * Source/GSGormLoading.m: New gorm loading file. * Source/GSNibCompatibility.m: Removed. * Source/GSNibLoader.m: Reference the new file. * Source/GSNibLoading.m: New file containing the nib loading logic. * Source/GSNibTemplates.m: Removed. 2008-12-02 01:21-EST Gregory John Casamento * Source/GSNibCompatibility.m: Fix for bug #24979. Change in initWithCoder: for NSCustomView to return the real object directly and call nibInstantiate. Change to prevent double instantiation of NSApplication. 2008-12-02 Gregory John Casamento * Source/NSSecureTextField.m: Added initWithCoder: method which turns on bullets by default. 2008-11-30 Wolfgang Lux * install.sh: Fix header syntax and provide default for make command argument. 2008-11-30 Richard Frith-Macdonald * Source/GSLayoutManager.m: Fix uninitialised variable ... but is the fix correct? 2008-11-29 00:40-EST Gregory John Casamento * Source/GSNibCompatibility.m: Added back in _root assignment in -[NSIBObjectData initWithCoder:]. It's removal caused an issue with loading some nibs. 2008-11-28 15:20-EST Gregory John Casamento * Source/GSNibCompatibility.m: Correct issue when loading into Gorm. NSClassSwapper should check to see if it's in the gui builder and return the appropriate class. 2008-11-27 10:07-EST Gregory John Casamento * Source/GSNibCompatibility.m: Corrected issue with using generic cells on some controls. 2008-11-27 Richard Frith-Macdonald * NSSound.m: * NSWorkspace.m: * NSPasteboard.m: Cope with daemons being installed in any domain, not just system. 2008-11-27 01:27-EST Gregory John Casamento * Source/NSWorkspace.m: [NSWorkspace getInfoForFile:application:type:] appName output parameter is set to nil if no application is found. 2008-11-27 00:48-EST Gregory John Casamento * Source/GSNibCompatibility.m: Minor correction to previous change. 2008-11-26 21:09-EST Gregory John Casamento * Source/GSNibCompatibility.m: Correct bug #24780. There was an issue in NSClassSwapper when decoding classes which use cells from nib files. * Source/NSSecureTextField.m: Encode in encodeWithCoder and decodeWithCoder: a key for storing the bool _echosBullets. 2008-11-26 Wolfgang Lux * Source/NSTextView.m (-undoReplaceCharactersInRange:..., -shouldChangeTextInRange:replacementString:): Improve implementation of undo and register redo operations. 2008-11-26 16:27-EST Gregory John Casamento * Headers/AppKit/NSWindow.h: Declaration for attachedSheet. * Source/NSWindow.m: Added skeleton implementation of attachedSheet. 2008-11-25 Wolfgang Lux * Source/NSAttributedString.m (-doubleClickAtIndex:): Double clicking on a white space character also selects the surrounding white space as on OS X. 2008-11-24 Wolfgang Lux * Headers/AppKit/NSTextView.h: Rename and change types of attributes related to drag and drop. * Source/NSTextView.m: Improve implementation of drag and drop so that an ongoing drag operation no longer changes the target view's current selection. * Source/NSTextView.m (-_characterIndexForPoint:respectFraction:): Always return a valid index. * Source/NSTextView.m (-mouseDown:): Omit check for valid index after calling _characterIndexForPoint:... * Source/NSTextView.m (-initWithCoder:): Avoid code duplication. 2008-11-23 18:56-EST Gregory John Casamento * Headers/AppKit/NSLayoutManager.h: Declarations for new methods to handle temporary attributes. * Source/GSNibCompatibility.m: Corrections to nib loading logic. * Source/NSLayoutManager.m: Skeleton implementations of new methods to handle temporary attributes. 2008-11-23 Fred Kiefer * Source/NSControl.m (-initWithCoder:): For keyed decoding make sure there always is a cell. 2008-11-23 Wolfgang Lux * Source/NSTextView.m (-mouseDown:): Allow click into the current selection to start a drag operation. * Source/NSTextView.m (-draggingSourceOperationMaskForLocal:): Implement. * Source/NSTextView.m (-draggingEntered:, draggingUpdated): Set drag operation to NSDragOperationNone while text is dragged onto itself. * Source/NSTextView.m (-performDragOperation:): When performing a local drag operation delete the dragged text at its original location unless a copy operation was forced by the user. * Source/NSTextView.m (-readSelectionFromPasteboard:type:): Select dropped text. * Source/NSTextView.m (-updateDragTypeRegistration): Register drag types for non-rich text NSTextViews, too. 2008-11-22 20:46-EST Gregory John Casamento * Source/GSNibCompatibility.m: Further improvements to nib loading logic. 2008-11-21 23:12-EST Gregory John Casamento * Source/GSNibCompatibility.m: Remove calls to designated initializers for nib files. 2008-11-21 01:12-EST Gregory John Casamento * Source/GSNibTemplates.m: Remove calls to designated initializers for gorm files as per documentation. 2008-11-20 Wolfgang Lux * Source/NSWindow.m (-miniaturize:): Revert the previous change correcting bug #24707. A better fix for this is now in -back. 2008-11-19 Fred Kiefer * Source/NSCachedImageRep.m(-draw): Add hack to draw on a scaled context. 2008-11-17 Fred Kiefer * Source/NSBezierPath.m: (-windingCountAtPoint:) Return 0 when the path is empty. 2008-11-17 Fred Kiefer * Source/NSApplication.m (-finishLaunching): Split up final notification sending into method _didFinishLaunching to allow supclasses to go between these calls. 2008-11-17 Fred Kiefer * Source/NSImage.m (-bestRepresentationForDevice:): Get the device desription from the window. 2008-11-16 Fred Kiefer * Source/NSView.m (-setBounds:, -setBoundsSize:): Fixed bug in last change not getting the _boundsMatrix correct. 2008-11-15 Wolfgang Lux * Source/NSSavePanel.m (-_setupForDirectory:file:): Abort editing for the file name's text cell before setting the passed in file name. * Source/NSDocument.m (-runModalSavePanel:withAccessoryView:): When the document has been saved already pass its file name to the save panel like on Mac OS X. * Source/NSControl.m (-drawRect): Make sure the cell's control view is always set up. 2008-11-14 Fred Kiefer * Source/NSScrollView.m (-setContentView:): Replaced last change with one inside of setContentView:. * Source/NSView.m (-setFrame:): One more adjustment for bounds transformation. 2008-11-14 00:40-EST Gregory John Casamento * Source/NSScrollView.m: Correct issue with tableviews when loading nib files, corrected bug #24782. 2008-11-13 Fred Kiefer * Source/NSView.m (-setBounds:, -setBoundsSize:, -setFrame:, -setFrameSize): Some more adjustments on the bounds transformation. 2008-11-12 05:31-EST Gregory John Casamento * Source/GSNibCompatibility.m: Conditionally call setToolTip if it exists when doing establishConnection on an NSIBHelpConnector. * Source/NSDocumentController.m: Correction to prevent exception when NSDocumentClass isn't specified. This does not cause an issue on Mac OS X. 2008-11-11 Fred Kiefer * Source/NSView.m (-setBoundsOrigin:, -setBoundsRotation:, -translateOriginToPoint:, -scaleUnitSquareToSize:, -rotateByAngle:): Reimplemented correctly. * Source/NSView.m (-_computeScale): New method. * Source/NSView.m (-_updateBoundsMatrix:, -setBounds:, -setBoundsSize:): Small changes. 2008-11-09 10:24-EST Saso Kiselkov Committed by: Gregory John Casamento * Source/NSSecureTextField.m: Patch to make bullets output when setEchosBullets is set to yes in NSSecureTextField. Corrects bug #19761. 2008-11-08 10:09-EST Gregory John Casamento * Source/NSDocument.m: Correction for bug#24758, add name and type information to the object before reading the file so that it is available during the readFile:ofType: method call. 2008-11-06 Fred Kiefer * Source/NSBitmapImageRep.m (-_convertToFormatBitsPerSample:...): Filled with some more code. The conversion within the same colour space and be between black/white and RGB should now be correct and faster. 2008-11-05 Wolfgang Lux * Source/NSWorkspace.m (-isFilePackageAtPath:): Provide a working implementation. * Source/NSApplication.m (-targetForAction:forWindow:): Make NSApplication's responder chain for action messages consistent with Apple's documentation and the Mac OS X implementation. * Headers/AppKit/NSAlert.h: * Source/NSAlert.m (-beginSheetModalForWindow:...): Pass correct arguments to the didEndSelector. * Source/NSAlert.m (-_setupPanel): Fix swapping of title and informative message text in NSAlerts. Also supply a default title "Alert" if none is set. * Source/NSAlert.m (-addButonWithTitle:): Determine key equivalent of NSAlert buttons from their localized titles. * Source/NSAlert.m (-_initWithoutGModel): * Source/NSSavePanel.m (-_initWithoutGModel): Fix key view loop so that all buttons become reachable with the Tab key. Make Escape key equivalent of the Cancel button of NSSavePanel. * Source/NSButton.m (-keyDown): * Source/NSPopUpButton.m (-keyDown): Trigger action only after pressing the Space key. 2008-11-01 21:35-EDT Gregory John Casamento * Source/NSWindow.m: Reverted a previous change to miniaturize. This should correct bug #24707. 2008-10-31 Fred Kiefer * Source/GSNibCompatibility.m: Define the needed GSIARRAY constants, this helps against valgrind complaining. 2008-10-31 Fred Kiefer * Source/NSBitmapImageRep+ICNS.m (icns_get_image32_with_mask_from_family): Protect against buffer overfow detected by valgrind. 2008-10-29 Fred Kiefer * Source/NSBrowser.m (-drawTitle:inRect:ofColumn:, -dealloc): Set and unset the ownership of the shared title cell. Patch by Matt Rice . 2008-10-24 Fred Kiefer * Source/NSMenu.m (-indexOfItemWithTarget:andAction:): Compare the target for identity not equality. * Source/NSWindowController.m (+initialize, -initWithCoder:,-encodeWithCoder:): Add encoding and decoding, just calling super. Patch by Wolfgang Lux . * Source/NSApplication.m (-targetForAction:forWindow:): New helper method. Don't stop at the window itself, when going up the responder chain. * Source/NSApplication.m (-targetForAction:): Use the new helper method. 2008-10-23 Fred Kiefer * Headers/AppKit/NSWindowController.h: Make a subclass of NSResponder. * Source/NSWindowController.m (-setWindow:): Manage the responder chain. Patch by Wolfgang Lux . 2008-10-21 Adam Fedor * Source/NSBitmapImageRep+JPEG.m: Fix broken boolean definition. 2008-10-20 Fred Kiefer * Source/GSWindowDecorationView.h, * Source/GSWindowDecorationView.m (-contentRectForFrameRect:styleMask:, -frameRectForContentRect:styleMask): New instance methods. * Source/NSWindow.m: Use these new methods. 2008-10-19 Riccardo Mottola * Source/GSServicesManager.m: dont unreigster non existent named port 2008-10-18 19:06-EDT Gregory John Casamento * Source/NSWindow.m: Remove code in stringWithSavedFrame which was causing a crash due to issues in NSToolbar described in bug#24601. 2008-10-18 Riccardo Mottola * Source/NSWorkspace.m: Removed c99-ism 2008-10-17 Fred Kiefer * Source/NSWindow.m (+initialize, -startBackendWindow:): Move the initialization of windowmaps to initialize. 2008-09-17 18:15-EDT Gregory John Casamento * Source/GSInfoPanel.m: Minor correction in initWithDictionary to display url properly, if it is not specified in the dictionary passed or if the dictionary is nil. 2008-09-17 17:52-EDT Gregory John Casamento * Source/NSWorkspace.m: Exclude list of reserved mount names from the results returned by -mountedLocalVolumePaths. 2008-09-14 13:18-EDT Gregory John Casamento * install.sh: Adding install script for use by compile-all. 2008-09-08 Fred Kiefer * Source/GSInfoPanel.m (-keyDown:, -copy:): Added functionality to copy the text content of the info panel to the pasteboard. Fixes #23831. 2008-09-08 Fred Kiefer * Source/NSSavePanel.m (-browser:createRowsForColumn:inMatrix:): Use flushWindow instead of [GSCurrentContext() flushGraphics]. Should fix #24200. 2008-09-08 Fred Kiefer * Headers/AppKit/NSCell.h: Move _sizeForBorderType to GSTheme.h * Headers/Additions/GNUstepGUI/GSTheme.h (-sizeForBorderType:, -drawBorderType:frame:view:, -sizeForImageFrameStyle:, -drawBorderForImageFrameStyle:frame:view:), * Source/GSTheme.m: New methods. * Source/NSCell.m (-cellSize, -drawingRectForBounds:, -_drawBorderAndBackgroundWithFrame:inView:), * Source/NSImageCell.m (-cellSize, -drawingRectForBounds:, -_drawBorderAndBackgroundWithFrame:inView:): Use new GSTheme methods. * Source/NSPopUpButtonCell.m: Include GSTheme.h * Source/NSButtonCell.m: Moved gradient drawing method to GSTheme and call it from _drawBorderAndBackgroundWithFrame:inView:. * Source/GSTheme.m (-drawGradientBorder:inRect:withClip:): New method. 2008-09-07 Fred Kiefer * Source/NSBitmapImageRep+ICNS.m: Corrected last change. 2008-09-06 Fred Kiefer * Source/NSBitmapImageRep+ICNS.m: Change the incosistently named constants not only in the usage but also in the definition. 2008-09-03 21:13-EDT Gregory John Casamento * Source/NSBitmapImageRep+ICNS.m: Correct minor issue with constant name. 2008-09-03 Fred Kiefer * Source/NSBitmapImageRep.m (+imageUnfilteredFileTypes): Always enable icns format. * Source/NSBitmapImageRep+ICNS.m: Add drop in replacement code for libicns and clean up loading code. 2008-08-30 13:33-EDT Gregory John Casamento * ChangeLog * Images/GNUmakefile: Remove reference to Images copyright file reference since they images are now under the GPL. 2008-08-30 13:32-EDT Gregory John Casamento * Images/GNUmakefile * Source/GSNibTemplates.m 2008-08-21 Yavor Doganov (tiny change) * Source/GNUmakefile.preamble (LIBRARIES_DEPEND_UPON): Unconditionally link against $(OBJC_LIBS) on all platforms to avoid undefined symbols. Reported by Funda Wang (bug #24109). 2008-08-21 Richard Frith-Macdonald * Source/NSBezierPath.m: ([transformUsingAffineTransform:]) corrected code which was casting an array of items of one type to be an array of items of another type whose size differs on 64bit machines. 2008-08-15 Fred Kiefer * Source/NSWindow.m (-makeKeyAndOrderFront:): Unhide the application. * Source/NSApplication.m (-hide:, -unhideWithoutActivation): Better handling for miniaturized windows. Patch by Hubert Chathi . 2008-08-13 22:20-EDT Gregory John Casamento * Source/NSApplication.m: Removed icns string addition to rely on NSImage code to find the image. 2008-08-13 01:17-EDT Gregory John Casamento * Source/GSInfoPanel.m * Source/NSWorkspace.m * Tools/make_services.m: Added support for CF keys so that icons and document associations from document oriented apps written for Mac OS X can be ported more easily. 2008-08-12 21:53-EDT Gregory John Casamento * Source/NSApplication.m: Add logic to load the icns if it's specified as the icon file for an application. * Source/NSBitmapImageRep+ICNS.m: Limit the size of the representation to the 48x48 version. 2008-08-12 00:52-EDT Gregory John Casamento * configure: Regenerated file * configure.ac: Added check for libicns. (http://icns.sourceforge.net/) * Headers/Additions/GNUstepGUI/config.h.in * Source/GNUmakefile: Added new files * Source/NSBitmapImageRep+ICNS.h: Header for ICNS category * Source/NSBitmapImageRep+ICNS.m: Implementation if ICNS reading logic. * Source/NSBitmapImageRep.m: Add support for the ICNS file format so that GNUstep can read Mac OS X icon files. Uses the libicns library available from sourceforge. 2008-08-11 Fred Kiefer * Source/NSWindow.m (-endEditingFor:): Change the first responder first to avoid recusion. 2008-08-09 Fred Kiefer * Headers/AppKit/NSGraphics.h: Add NSSetFocusRingStyle and type definition. * Source/Functions.m (NSSetFocusRingStyle): Add dummy implementation. Code by Nikolaus Schaller . 2008-08-08 Adam Fedor * Source/NSBitmapImageRep+JPEG.m: Handle patched jpeg library found on CYGWIN. 2008-08-07 18:23-EDT Gregory John Casamento * Headers/AppKit/NSTokenFieldCell.h * Headers/AppKit/NSTokenField.h: Headers for new class. * Source/GNUmakefile * Source/NSDocumentController.m: Added code to handle the CF keys as well as the NS keys for document oriented apps. * Source/NSTokenFieldCell.m * Source/NSTokenField.m: Start of implementation for this class. 2008-08-02 Fred Kiefer * Source/NSScrollView.m (-initWithCoder:): Handle non-retained ivars correctly. * Source/NSWindowController.m (-loadWindow): Release the loaded window once, as it got retained by the NIB loading mechanism. 2008-07-13 Fred Kiefer * Source/NSGlyphGenerator.m (-generateGlyphsForGlyphStorage:...): Add fallback glyph when no glyph can be found for current character. 2008-07-13 Fred Kiefer * Source/GSLayoutManager.m: Protect all access to the glyph arrays. 2008-07-12 Fred Kiefer * Source/GSLayoutManager.m (-_glyphForCharacter:index:positions::), * Source/NSGlyphGenerator.m (-generateGlyphsForGlyphStorage:...): Add some more protection against inconsistent state. 2008-07-12 Fred Kiefer * Source/NSSavePanel.m (-ok:): Standardize path before checking for existance. 2008-07-08 16:15-EDT Gregory John Casamento * Source/NSMenu.m: Beginning of support for windows style menus on the top of the window. * Source/NSWindow.m: Added code in the method -setFrameFromString: to make certain the window doesn't go out of bounds if the screen size changes. 2008-07-02 Fred Kiefer * Headers/AppKit/NSPopUpButton.h, * Source/NSPopUpButton.m (-selectItemWithTag:): Add MacOS 10.4 method. 2008-06-17 Fred Kiefer * Source/NSClipView.m (_scrollToPoint:): New method for adjusted scrolling. * Source/NSScrollView.m: Use this new method. Patch by Benhur Stein . 2008-06-14 Adam Fedor * Version 0.14.0 2008-06-12 Adam Fedor * Source/NSCachedImageRep.m, Source/NSMenuItem.m, Source/tiff.m: Fix incorrect commits 2008-06-08 Adam Fedor * Revert library license version to 2 until applications can be converted. 2008-06-09 Fred Kiefer * Source/NSWindow.m (-sendEvent:): Make the implemenation of the method prepareForDragOperation: non mandatory. 2008-06-09 Fred Kiefer * Source/NSTableView.m: Indentation changes. * Source/NSTextFieldCell.m ([-drawInteriorWithFrame:inView:]): Move editing check from here to ... * Source/NSControl.m (-drawRect:): ... here. 2008-06-02 Fred Kiefer * Source/GSNibCompatibility.m (NSWindowTemplate-initWithCoder:): Use default maxSize for window if none is given in the NIB file. * Source/NSButtonCell.m (-drawInteriorWithFrame:inView:): Adjust the image position if either the image or the text doesn't exist. 2008-05-28 Fred Kiefer * Source/NSMenuItem.m (-setKeyEquivalent:): Warn about incompatibility with MacOSX. 2008-05-27 Fred Kiefer * Source/GSTheme.m (-tilesNamed:cache:): Make sure local variable is initialized before using it. 2008-05-25 Nicola Pero * Documentation/GNUmakefile.postamble (after-install): Use GNUSTEP_DOC instead of GNUSTEP_DOCUMENTATION and GNUSTEP_DOC_MAN instead of GNUSTEP_DOCUMENTATION_MAN. 2008-05-24 10:54-EDT Gregory John Casamento * Headers/AppKit/NSWindow.h: Minor cleanup and spacing. * Source/GSNibTemplates.m: Removed call to designated init, since this is handled by the initWithCoder method in NSWindow.m. * Source/NSWindow.m: Correction for calling the designated initializer. Fix for bug#23336. 2008-05-21 Fred Kiefer * Source/NSAttributedString.m (-_substituteFontFor:font:fromList:): Limit the amount of character sets we cache. 2008-05-20 Fred Kiefer * Source/NSTableColumn.m (-initWithCoder:): Handle NSIsEditable. 2008-05-19 Fred Kiefer * Source/NSButtonCell.m (-encodeWithCoder:, -initWithCoder:): Correctly encode and decode image position in the keyed encoding case. 2008-05-19 Fred Kiefer * Source/NSGraphicsContext.m (-alloc, -allocWithZone:) New methods, use them in graphicsContextWithAttributes:. * Source/NSWindow.m: (-_startBackendWindow): New method for shared backend creation. Create the NSGraphicsContext as not autoreleased. Use that method in initWithWindowRef: and _initBackendWindow. * Source/NSWindow.m: (-dealloc): Remove last hack and make a bit safer against reentry. * Source/NSWindow.m (-_terminateBackendWindow): Reorder statements. * Source/NSWindow.m (-initWithContentRect:...screen:): Warn about second call to this method. 2008-05-14 21:55-EDT Gregory John Casamento * Source/GSLayoutManager.m: Changed unsigned int to NSUInteger per Fred Kiefer's suggestion. This corrects a crash which was detected on 64 bit systems. 2008-05-15 Fred Kiefer * Source/NSWindow.m: (-dealloc): Try to better cope with the circular reference between the window and the context. 2008-05-14 Richard Frith-Macdonald * Source/NSDocumentController.m: Cope with bad values in NSRecentItems 2008-05-13 Fred Kiefer * Headers/AppKit/NSGlyphGenerator.h, * Source/NSGlyphGenerator.m: New file. * Source/GNUmakefile: Add new files. * Headers/Additions/GNUstepGUI/GSLayoutManager_internal.h: More efficient memory usage for glyph runs. * Headers/Additions/GNUstepGUI/GSLayoutManager.h: Add ivar for glyph generator and some MacOSX methods. * Source/GSLayoutManager.m: Use objc_malloc, objc_free and objc_realloc. Move glyph generation into seperate class. Add documentation. General cleanup. Implement some of the additional methods. * Source/NSLayoutManager.m: Adopt to changes in super class. 2008-05-13 Richard Frith-Macdonald * Source/NSOpenPanel.m: * Source/NSSavepanel.m: Add code to handle the fact of ms-windows disk drives (multiple roots) by creating a pseudo-root directory with all the disk drives inside it. 2008-05-08 21:04-EDT Gregory John Casamento * Source/NSWindow.m: (-(void)miniaturize: (id)sender): Change to prevent miniwindow from disappearing. Apparently uneccessary [self orderOut: self] was causing this issue. 2008-05-08 Adam Fedor * Source/NSBitmapImageRep+JPEG.m: Define HAVE_BOOLEAN to avoid problem with jmorecfg.h header on mingw. 2008-05-07 Adam Fedor * Source/NSSplitView.m (-adjustSubviews): Just return if there are no subviews. 2008-05-07 Fred Kiefer * Source/NSWindow.m (-_terminateBackendWindow, -_initBackendWindow, -initWithWindowRef:): Break the retain cycle of the context keeping a reference to the window. * Source/NSCachedImageRep.m: Better checks for super calls returning nil. 2008-05-03 Fred Kiefer * Source/NSControl.m (-mouseDownFlags): Add old NeXT method, no longer present, but needed for backward compatibility. 2008-05-03 Fred Kiefer * Source/NSTableView.m (-selectRow:byExtendingSelection:, -selectColumn:byExtendingSelection:, -rectOfColumn:, -rectOfRow:): Don't raise an exception for invalid indexes. 2008-05-01 Fred Kiefer * Source/NSTableColumn.m (-initWithIdentifier:, -initWithCoder:): Check for self becoming nil. * Source/NSTableView.m (-columnWithIdentifier:): Allow the column identifier to be nil. 2008-04-28 Fred Kiefer * Source/NSTableHeaderView.m (-mouseDown:): Use new variable mouse_sensitivity (value 4) to determine whether the click is on a column border. Patch by Andreas Höschler . * Source/NSTableHeaderView.m (-initWithFrame:, -initWithCoder:): Check for nil return from super call. 2008-04-27 18:42-EDT Gregory John Casamento * Source/NSWindow.m: Change to correct issue with NSWindow placement when toolbar is present. 2008-04-25 18:16-EDT Gregory John Casamento * Source/GSNibTemplates.m: Correct [GSNibTemplates deferredWindows] to properly return the deferredWindows ivar. 2008-04-08 Fred Kiefer * Source/NSOpenGLView.m (-openGLContext): Fix memory leak introduced by last change. 2008-04-08 Fred Kiefer * Source/NSBezierPath.m (+drawPackedGlyphs:atPoint:): Use fill instead of stroke to draw the glyphs. 2008-04-07 Fred Kiefer * Source/NSFont.m (NSConvertGlyphsToPackedGlyphs): Store the glyph count in the first byte. * Source/NSBezierPath.m (-appendBezierPathWithPackedGlyphs): Send this method on to the graphics context. * Headers/AppKit/NSGraphicsContext.h, * Source/NSGraphicsContext.m (-appendBezierPathWithPackedGlyphs:path:): New method. 2008-04-04 Fred Kiefer * Headers/Additions/GNUstepGUI/GSFontInfo.h, * Source/GSFontInfo.m: New method glyphForCharacter:. * Source/GSFontInfo.m (-glyphIsEncoded:): Code based on coveredCharacterSet. * Source/NSFont.m (_defaultGlyphForChar:): New private method that matches Cocoa. * Source/GSLayoutManager.m (-_findSafeBreakMovingBackwardFrom:, -_findSafeBreakMovingForwardFrom:, -_generateGlyphsForRun:at:): Moved code from the art backend to here. Rewrote it in the process. 2008-04-04 Fred Kiefer * Source/NSScrollView.m: Correct indentation. Small cleanups. * Source/NSScrollView.m (-setDrawsBackground:): Set setCopiesOnScroll:. 2008-04-02 Nicola Pero * Source/NSSplitView.m ([-adjustSubviews]): Fixed the slow drift of the divider when the window is resized multiple times, due to a historical 'floor' call, now pointless. 2008-04-01 Nicola Pero Implemented -setAutosaveName: for NSSplitView. * Headers/AppKit/NSSplitView.h ([-setAutosaveName:], [autosaveName]): New methods. New instance variable _autosaveName. * Source/NSSplitView.m ([-_autosaveSubviewProportions]): New method. ([-mouseDown:]): Invoke _autosaveSubviewProportions at the end of the tracking. ([-adjustSubviews]): Rewritten to support loading autosaved subview proportions as well as proportionally resizing current ones. ([-autosaveName], [-setAutosaveName:]): New methods. ([-dealloc]): Release the new ivar. ([-encodeWithCoder:]): Encode autosaveName using NSAutosaveName key. ([-initWithCoder:]): If the NSAutosaveName key is set, decode it. 2008-04-01 Nicola Pero * Source/NSSplitView.m ([-adjustSubviews]): Removed unused variable and a few unnecessary method calls. 2008-03-31 Xavier Glattard * Source/NSOpenGLView.m: Use _lockFocusInContext:withRect instead of canDraw. Some changes to be closer to the specifications. 2008-03-31 Fred Kiefer * Headers/AppKit/NSOpenGLView.h: Add MacOS 10.3 method. * Source/NSOpenGLView.m: Clean up. Use canDraw instead of lockFocusInRect: as the entry point for context attachment. 2008-03-29 Fred Kiefer * Source/NSApplication.m (-terminate:): Initialize termination as NSTerminateNow. 2008-03-28 Xavier Glattard * Source/NSKeyValueBinding.m : turns a [setValue:forKey:] into a [setValue:forKeyPath:] -- needed to bind to any NSControler 'selection.a_key' 2008-03-26 Richard Frith-Macdonald * Source/NSApplication.m: fixed termination type code and added comments to avoid confusion. 2008-03-20 Nicola Pero * Source/NSTextFieldCell.m ([-drawInteriorWithFrame:inView:]): If the control view is in an editing mode, do nothing. This fixes problems with transparency or anti-aliased fonts when selecting or editing textfields. 2008-03-20 Nicola Pero * Source/NSButtonCell.m ([-cellSize]): Restored horizontal space around text in autosized bezeled/bordered buttons not containing only an image so that the autosizing is correct again. 2008-03-19 Adam Fedor * Version 0.13.2 2008-03-17 21:00-EST Gregory John Casamento * Source/NSView.m: Changes to beginPage:... and endPage to correct issues with blank space at the top of the page when printing. 2008-03-16 Riccardo Mottola * Source/NSApplication.m : changed terminate type to BOOL since it is one and the value froma delegate got wrongly casted 2008-03-11 Fred Kiefer * Source/NSBitmapImageRep.m (-_premultiply, _unpremultiply): Optimized a bit. * Source/NSBitmapImageRep.m (-draw): Premultiply the image before drawing. 2008-03-08 Fred Kiefer * Source/NSToolbarItem.m (-_setSelected:): Undo last hack and add a slightly better on. 2008-03-08 Fred Kiefer * Source/NSToolbarItem.m (GSToolbarButton-sendAction:to:): Add a recursion break hack. Needs to be cleaned up. 2008-03-08 Fred Kiefer * Source/NSOutlineView.m (-_initOutlineDefaults): New helper method extracting code from initWithFrame: and initWithCoder:. * Source/NSOutlineView.m (-itemAtRow:): Return nil for invalid row numbers. Patch by Quentin Mathe . 2008-03-05 Richard Frith-Macdonald * Source/NSWindow.m: deminiaturize window in -makeKeyAndOrderFront: (bug #22444) as I tested and confirmed that implicit deminiaturisation is done here on MacOSX. 2008-03-05 Richard Frith-Macdonald * Tools/make_services.m: Standardise paths to avoid error reports when two paths point to the same app. 2008-03-04 Fred Kiefer * Source/NSCell.m (-performClickWithFrame:inView:): Call sendAction:to: on control even when there is no action. 2008-03-01 Fred Kiefer * Source/NSKeyValueBinding.m (-observeValueForKeyPath:ofObject:change:context:): Ignore calls with empty change information. 2008-03-01 Nicola Pero * Source/NSImageCell.m (scaleProportionally): Fixed NSScaleProportionally to scale images down, but never up. Bug reported by Herb Otto . * Headers/AppKit/NSImageCell.h: Documented the whole class. 2008-02-26 Richard Frith-Macdonald * Source/GSToolTips.m: Fix bug #22421 2008-02-25 Fred Kiefer * Source/NSBitmapImageRep.m (-_premultiply, _unpremultiply): Flag the format as changed. Add fast path for 8 bit images. * Source/NSBitmapImageRep.m (-_convertToFormatBitsPerSample:...bitsPerPixel:) New helper method for image conversion. Not fully working. 2008-02-18 Fred Kiefer * Source/NSMenuView.m: Change to better respect the size of the popup when displaying the menu. Reworked patch by Matt Rice . 2008-02-18 Fred Kiefer * Source/NSPopUpButtonCell.m: Change version for encoding. Set preferred edge and arrow position when decoding old gorm files. New helper method for Gorm. 2008-02-17 Fred Kiefer * Source/NSMenuView.m: White space cleanup. 2008-02-16 20:43-EST Gregory John Casamento * Source/NSCell.m: Correction for bug#22332. * Source/NSSegmentedCell.m: * Source/NSSegmentedControl.m: Set up default values in init methods. 2008-02-16 Fred Kiefer * Source/NSTableColumn.m (-initWithIdentifier:): Set _width to 100 and _min_width to 10. Patch by Quentin Mathe . 2008-02-12 Adam Fedor * Source/GSFusedSilicaContext.m: Make sure to allocate a mutable dictionary. 2008-02-12 Fred Kiefer * Source/NSFont.m (-initWithName:matrix:fix:screenFont:role:): Add fallback for more missing standard fonts (LucidaGrande). 2008-02-11 Fred Kiefer * Source/NSView.m (-_viewWillMoveToWindow:, -_viewWillMoveToSuperview:): New methods with code from viewWillMoveToWindow: and viewWillMoveToSuperview:. The later are now empty to allow subclasses not to call the super implementation. * Source/NSWindow.m: Use these new methods in place of the old ones. 2008-02-08 Fred Kiefer * Images/LogoGNUstep.tiff: New files * Images/GNUmakefile: Install new files. * Source/GSInfoPanel.m (-initWithDictionary:): Add background logo. Old patch by Nicolas Roard * Source/NSBitmapImageRep.m : Flag all created bitmaps as having or not having pre-muliplied alpha. * Source/NSBitmapImageRep.m (-setColor:atX:y:, -colorAtX:y:, -setPixel:atX:y:, -getPixel:atX:y:): Correct to handle most formats correctly. * Source/NSBitmapImageRep.m (-_premultiply, _unpremultiply): New helper methods. * Source/NSBitmapImage+PNG.m: Mark PNG images as not using pre-muliplied alpha. 2008-02-07 Fred Kiefer * Headers/AppKit/NSMenu.h, * Source/NSMenu.m (-_owningPopUp): New helper method. * Source/NSMenuView.m (-setWindowFrameForAttachingToRect:...popUpSelectedItem:): Special case for popups that don't use an item from the list. * Source/NSPopUpButtonCell.m (-setUsesItemFromMenu:): Create a menu item for the title. * Source/NSPopUpButtonCell.m (-setTitel:): Use the menu item, when not using an item from the menu. Reworked patch by Matt Rice . 2008-02-04 Fred Kiefer * Images/common_3DArrowLeft.tiff, * Images/common_3DArrowUp.tiff: New files * Images/GNUmakefile: Install new files. * Source/NSMenuView.m (-setWindowFrameForAttachingToRect:...popUpSelectedItem:): Implement preferred edge handling. * Source/NSPopUpButtonCell.m: Rewrote handling of preferred edge, arrow possition and pull down flag. 2008-02-04 Fred Kiefer * Source/GSHorizontalTypesetter.m (-breakLineByWordWrappingBefore:): Treat CJK characters as words. Patch by Yen-Ju Chen . 2008-02-03 Fred Kiefer * Source/NSButtonCell.m (-_drawBorderAndBackgroundWithFrame:inView:): Add direct check if the mouse is inside the cellFrame. 2008-02-02 Fred Kiefer * Source/NSTableHeaderCell.m, * Source/NSBrowser.m (GSBrowserTitleCell): Move border drawing into _drawBorderAndBackgroundWithFrame:inView:. * Source/NSBrowser.m (-setAllowsEmptySelection, -setAllowsMultipleSelection): Propagate changes on to matrixes. * Headers/AppKit/NSBrowser.h, * Source/NSBrowser.m: Stronger typing of variables. * Source/NSBrowser.m (-drawRect:): Don't draw window background colour. * Source/NSMatrix.m (-drawCellAtRow:column:): Don't call displayRect: when there is no background drawing. * Source/NSMatrix.m (-_drawCellAtRow:column:): Remove this method and replace call to it with -drawCellAtRow:column:. 2008-02-01 Fred Kiefer * Printing/GSCUPS/GSCUPSPrintInfo.m (-defaultPrinter): Use other CUPS functions to determine the default printer. Patch by Mark Tracy . 2008-01-26 Fred Kiefer * Source/NSTextView.m (-copySelection, -pasteSelection): Add new X secondary selection behaviour. See http://www.freedesktop.org/wiki/Specifications/ClipboardsWiki 2008-01-19 Fred Kiefer * Source/GSFontInfo.m: * Source/NSFontDescriptor.m, * Source/NSTextBlock.m, * Source/NSWindow.m: Add imports to avoid warnings on Windows. * Source/NSMenu.m (-_organizeMenu): Change type of appItem to avoid compiler warning on Windows. 2008-01-19 Fred Kiefer * Headers/Additions/GNUstepGUI/GSDisplayServer.h (-setWindowdevice:forContext:), * Source/GSDisplayServer.m (-setWindowdevice:forContext:): New method replacing windowdevice:. * Headers/AppKit/NSGraphicsContext.h, * Source/NSGraphicsContext.m: Add new MacOSX methods and ivars. * Source/NSWindow.m (-_processResizeEvent): Simplified with new GSDisplayServer method. * Source/NSWindow.m (-_initBackendWindow, -initWithWindowRef:): Moved device interaction into backend. Requires corresponding change in backend! 2008-01-18 14:39-EST Gregory John Casamento * Headers/Additions/GNUstepGUI/GSTheme.h * Source/GSTheme.m * Source/NSSegmentedCell.m: Moved drawing code to GSTheme. 2008-01-16 Fred Kiefer * Source/GSDragView.m (-_updateAndMoveImageToCorrectPosition): Add missing "!" in mask for local call. Patch by Andreas Schik . 2008-01-14 09:37-EST Gregory John Casamento * Headers/AppKit/NSSegmentedCell.h * Source/NSSegmentedCell.m: Removed _previous_segment, since it was redundant. 2008-01-14 09:17-EST Gregory John Casamento * Headers/AppKit/NSSegmentedControl.h * Source/NSSegmentedCell.m * Source/NSSegmentedControl.m: Correct tabbing. 2008-01-14 Fred Kiefer * Source/NSKeyValueBinding.m (+getBinding:forObject:): Correct bug in last change. 2008-01-13 Fred Kiefer * Source/GSBindingHelpers.h, * Source/NSKeyValueBinding.m: Add reverse value change methods. * Source/NSControl.m (-sendAction:to:): Send value change for binding. 2008-01-08 22:35-EST Gregory John Casamento * Headers/AppKit/NSSegmentedCell.h: Added rect ivar to cache frame. * Source/NSBundleAdditions.m: Minor formatting changes. * Source/NSController.m: Added ivars to encodeWithCoder:. * Source/NSNibBindingConnector.m: Added ivars to encodeWithCoder:. * Source/NSSegmentedCell.m: Changes to fully implement rendering of the cell. * Source/NSSegmentedControl.m: Changes to fully implement control. 2008-01-08 09:42-EST Gregory John Casamento * Source/NSSegmentedCell.m: Code to draw and render text in segments. 2008-01-07 Fred Kiefer * Source/NSSegmentedCell.m: Added a bit more code. 2008-01-07 09:33-EST Gregory John Casamento * Headers/AppKit/AppKit.h * Headers/AppKit/NSSegmentedCell.h * Headers/AppKit/NSSegmentedControl.h * Source/GNUmakefile * Source/NSSegmentedCell.m * Source/NSSegmentedControl.m: Added initial implementation of NSSegmentedCell/NSSegmentedControl. 2008-01-07 Fred Kiefer * Headers/AppKit/NSTextView.h, * Source/NSTextView_actions.m, * Source/NSTextView.m: Add MacOSX methods and ivars. * Source/externs.m: Add NSTextView notification. 2008-01-05 15:25-EST Gregory John Casamento * Headers/AppKit/NSDrawer.h: Added new ivars. * Source/NSDrawer.m: Addition implementation of NSDrawer. Corrected drag problem. Added border. 2008-01-04 Fred Kiefer * Source/NSTextContainer.m: Replace tabs with spaces. * Source/GSHorizontalTypesetter.m (-_getProposedRectFor:withLineHeight:) Extract proposed rect generation into separate method. * Source/GSLayoutManager.m (-_doLayoutToGlyph:, _doLayoutToContainer:): Implement based on code from _doLayout. * Source/GSLayoutManager.m (-_doLayout): Implement via _doLayoutToContainer:. * Source/NSTextView.m (-setHorizontallyResizable:, -setVerticallyResizable:): Set the width/height of the text container to max size, when resizable. 2008-01-03 Fred Kiefer * Headers/AppKit/NSStringDrawing.h: Include GSVersionMacros.h before using these macros. 2008-01-03 Fred Kiefer * Headers/AppKit/NSTextList.h, * Headers/AppKit/NSTextTable.h: New files. * Headers/AppKit/AppKit.h: Add these. * Source/NSTextList.m, * Source/NSTextTable.m, * Source/NSTextBlock.m, * Source/NSTextTableBlock.m: New files * Source/GNUmakefile: Add new source file. 2008-01-01 Adam Fedor * Version 0.13.1 2007-12-30 16:31-EST Gregory John Casamento * Headers/AppKit/PSOperators.h: Added dummy implementations for PSwindowlist and PScountwindowlist. 2007-12-30 12:30-EST Gregory John Casamento * Headers/AppKit/PSOperators.h: Added dummy PSWait method. * Source/GSNibCompatibility.m: Added warning when loading nib that has nil in some keys. 2007-12-30 Fred Kiefer * Source/NSFont.m (-initWithCoder:): Add missing RETAIN. 2007-12-25 Fred Kiefer * Headers/AppKit/NSMenu.h: * Source/NSMenu.m: Add MacOSX methods and delegate ivar. 2007-12-23 Fred Kiefer * Source/NSMenuItem.m: Add KVB for enable. * Source/NSPopUpButton.m: Add KVB for selectedIndex. 2007-12-22 Fred Kiefer * Source/NSView.m (-visibleRect:, -setHidden:, -hitTest:): Full support for hidding. * Source/NSWindow.m (-_checkCursorRectangles:forEvent:, -_checkTrackingRectangles:forEvent:): Ignore hidden views. 2007-12-19 Richard Frith-Macdonald * Tools/gopen.m: slight tidyup, improve comments,no functional changes. * Documentation/gopen.1: correct the derscription of the -a option to say that this opens the specified application when used without a file to open. 2007-12-17 Adam Fedor * Tools/GNUmakefile, configure.ac: Don't try to run make_services if we are cross-compiling. 2007-12-17 Fred Kiefer * Source/NSTableView.m (-setDataSource:): Make the data source method tableView:objectValueForTableColumn:row: optional. * Source/externs.m: Define some arbitray values for KVB markers. 2007-12-15 Fred Kiefer * Source/NSControl.m (-bind:...options:): Correct value binding. * Source/NSImage.m (+imageNamed:): Don't release, autorelease the image. 2007-12-15 Fred Kiefer * Source/NSTextField.m: Move some KVB to NSControl, add binding for text colour. * Source/NSControl.m: Add some bindings from NSTextField plus NSValueBinding. 2007-12-13 Fred Kiefer * Source/GSBindingHelpers.h, * Source/NSKeyValueBinding.m: Rewrote KVB to use separate binding class. * Source/NSTextField.m, * Source/NSView.m: Use it here. 2007-12-12 Fred Kiefer * Source/NSNibBindingConnector.m (-establishConnection): Swap destination and source. * Source/NSKeyValueBinding.m: Started rework. 2007-12-12 Fred Kiefer * Source/NSKeyValueBinding.m (GSBindingUnbindAll): Return if table doesn't exist. 2007-12-11 Fred Kiefer * Headers/AppKit/NSKeyValueBinding.h, * Source/GSBindingHelpers.h, * Source/NSKeyValueBinding.m: Basic key value binding implementation. * Source/GNUmakefile: Add new source file. * Source/externs.m: Variables for key binding. * Source/NSTextField.m, * Source/NSView.m: Class specific key bindings. Patch by Chris Farber . 2007-12-10 Fred Kiefer * Source/NSColor.m (-numberOfComponents, -getComponents:): Raise exception when called on abstract class. Increase teh values returned by real numberOfComponents by one to count in alpha. * Source/NSColor.m (+colorWithColorSpace:components:count:): Basic implementation. * Source/NSColor.m (-setFill, -setStroke:): Convert to NSDeviceRGBColorSpace first. * Source/NSColor.m (GSRGBColor-setFill, GSRGBColor-setStroke:): Actual implementation. 2007-12-10 Fred Kiefer * ColorPickers/GSColorSliderCell.h, * ColorPickers/GSColorSliderCell.m: New files split off from GSStandardColorPicker.h and GSStandardColorPicker.m. * ColorPickers/GNUmakefile: Add the new files. * ColorPickers/GSStandardColorPicker.h, * ColorPickers/GSStandardColorPicker.m: Remove split off code. * ColorPickers/GSRGBColorPicker.m, * ColorPickers/GSHSBColorPicker.m, * ColorPickers/GSColorSliderCell.m: Add support for dynamically displayed colour changes. 2007-12-09 Fred Kiefer * Documentation/gclose.1, * Documentation/gcloseall.1, * Documentation/set_show_service.1: New man pages by Dennis Leeuw * Documentation/GNUmakefile: Add the new man page files. 2007-12-08 Fred Kiefer * Source/NSControl.m (-mouseDown:): Forward event, if not enabled. * Source/NSTextField.m (-mouseDown:): Send event to next responder not to super, if not selectable or disabled. * ColorPickers/GSStandardColorPicker.m (GSColorSliderCell): Corrected to work with horizontal and vertial views and for flipped ones. * ColorPickers/GSWheelColorPicker.m: Replace GSWheelColorSliderCell with GSColorSliderCell. 2007-12-07 Fred Kiefer * Source/NSTableView.m (-initWithCoder:): Don't create a header view, if there is none decoded. * Source/NSScrollView.m (-_synchronizeHeaderAndCornerView): Don't show corner view if there is no header view. * Source/NSPopUpButtonCell.m (-setMenu:): Select an emtry from the new menu. 2007-12-07 Richard Frith-Macdonald * Source/GSServicesManager.m: Fixup to add/remove menu items when the available items have changed. 2007-12-06 Fred Kiefer * Source/NSView.m (-initWithCoder:): Handle NSFrameSize. 2007-12-03 Fred Kiefer * Source/NSMenuItem.m (-initWithCoder:): Set state directly, otherwise the items gets into changesStatus mode. 2007-12-03 Fred Kiefer * Source/NSView.m (-bitmapImageRepForCachingDisplayInRect:): Don't cache the image here. * Source/NSView.m (-cacheDisplayInRect:toBitmapImageRep:): Lock focus on the current view. * Source/NSApplication.m (-finishLaunching): Make sure we have a designated main window. 2007-12-02 Fred Kiefer * Source/NSBezierPath.m (-encodeWithCoder:, -initWithCoder:): Corrected some of the encoding problems reported by Christopher Wojno . * Headers/AppKit/NSTableView.h: Add missing new data source method. * Source/NSTableView.m (-encodeWithCoder:, -initWithCoder:): Better decoding of header view, corner view and drag masks. * Source/NSTableView.m (-_indexSetToArray:) New helper method. * Source/NSTableView.m (-_startDragOperationWithEvent:, -dragImageForRowsWithIndexes:...offset:, -_isDraggingSource, _writeRows:toPasteboard:): Support for new dragging methods. 2007-12-01 Fred Kiefer * Headers/AppKit/NSTableView.h * Source/NSTableView.m: Add MacOSX 10.4 methods. 2007-11-30 Fred Kiefer * Source/NSImage.m (-drawInRect:fromRect:operation:fraction:): Tread a zero source rectangle as the full image and clip to the image bounds. 2007-11-30 Richard Frith-Macdonald * Source/NSClipView.m: ([scrollToPoint]) reset cursor rectangles when view is scrolled. 2007-11-29 Richard Frith-Macdonald * Source/NSWindowController.m: * Source/GSDisplayServer.m: * Source/NSBox.m: * Source/NSFontManager.m: * Source/GSLayoutManager.m: * Source/NSWindow.m: * Source/NSLayoutManager.m: * Source/NSPrinter.m: * Source/NSPasteboard.m: * Source/NSToolbar.m: * Source/NSFont.m: * Source/NSOutlineView.m: * Source/NSTextView.m: * Source/GSToolbar.m: * Source/tiff.m: * Source/NSDataLinkPanel.m: * Source/NSTableView.m: * Source/NSSpellChecker.m: * Printing/GSLPR/GSLPRPrinter.m: * Tools/gcloseall.m: * Tools/gclose.m: Update includes to add NSEnumerator where needed and remove use of the deprecated Foundation/NSUtilities.h header. 2007-11-29 Richard Frith-Macdonald * Source/GSToolTips.m: Fix for #20861 2007-11-29 Richard Frith-Macdonald * Source/NSView.m: Call ([resetCursorRects]) whenever view frame or bounds are changed. 2007-11-29 Richard Frith-Macdonald * Source/NSCursor.m: ([-initWithImage:]) changed to use a hot point at 0,0 rather than 0,15 for MacOS-X compatibility ... the coordinate system of a cursor is flipped according to the MacOS-X docs. 2007-11-27 Fred Kiefer * Source/NSApplication.m (-replyToApplicationShouldTerminate:): Check wheter the application is still running to prevent cycles. * Source/GSNibCompatibility.m (NSCustomObject-awakeFromNib): Call awakeFromNib on the instantiated object. * Source/GSNibCompatibility.m (NSCustomView-nibInstantiate): Move subviews to instantiated view. * Source/Functions.m (NSDrawBitmap): Remove compiler warning. 2007-11-24 12:38-EST Gregory John Casamento * Source/GSNibCompatibility.m: Call awakeFromNib later in the nib unarchiving process. 2007-11-22 Fred Kiefer * Source/NSNibBindingConnector.m: Completed implementation. * Source/NSTableView.m (-_initDefaults): New method for shared default settings. * Source/NSTableView.m (-initWithFrame:, initWithCoder:): Use this new method. * Source/NSGraphicsContext.m (-GSDrawImage::): Moved implemenation to back. 2007-11-22 Fred Kiefer * Headers/AppKit/NSGraphics.h: Make NSDrawBitmap a real function. * Source/Functions.m (NSDrawBitmap): Implement via NSBitmapImageRep and GSDrawImage::. * Source/NSGraphicsContext.m (-GSDrawImage::): Implement via NSDrawBitmap::::::. To be subclassed in backends. * Source/NSBitmapImageRep.m (-draw): Use GSDrawImage:: for drawing. 2007-11-11 Fred Kiefer * Source/NSCell.m (-initWithCoder:): Correct keyed decoding of setSendsActionOnEndEditing. * Source/tiff.m: Change mode field of chandle_t to char. Bugs reported by gcc 4.2 2007-11-09 Adam Fedor * Version 0.13.0 2007-11-05 Fred Kiefer * Source/NSFont.m (-initWithName:matrix:fix:screenFont:role:): Add fallback for missing standard fonts. 2007-11-03 Fred Kiefer * Source/NSControl.m, * Source/NSMenuItem.m (-initWithCoder:, -encodeWithCoder:): Better support for keyed encoding (Tag, separator,...). 2007-11-01 Fred Kiefer * Source/NSBrowser.m (+initialize): Create titleCell here to have it available for browsers loaded from Gorm files. * Source/NSBrowser.m (GSBrowserTitleCell): Add method drawingRectForBounds: and correct drawWithFrame:inView:. * Source/NSBrowser.m (-displayAllColumns, -displayColumn:): Mark for redraw. 2007-11-01 Fred Kiefer * Source/NSTableView.m (-draggingUpdated:): Use currentDropOperation instead of NSTableViewDropAbove. * Source/NSDocument.m (-windowForSheet): Return nil instead of mainWindow, when there is no associated window. Patches by Wolfgang Lux . 2007-10-30 Adam Fedor * gnustep-gui.spec.in: Change Copyright to License. 2007-10-29 Fred Kiefer * COPYING: Add GPL file. * Change all files to use GPL 3 and LGPL 3. * Prepare for next release. 2007-10-28 01:44-EDT Gregory John Casamento * Source/NSTableView.m: reverted change to validateEditing to correct crashes. 2007-10-27 Fred Kiefer * Source/NSTableHeaderView.m (-drawRect:): Switch drawing cases for flipping. * Source/NSTableView.m (GSTableCornerView): Made flipped and adjust drawing code. 2007-10-11 Fred Kiefer * Source/NSDocument.m (-setPrintInfo:, -runPageLayout:): Move updateChangeCount: call from one method to the other. * Source/NSPageLayout.m (-okButtonClicked:, -cancelButtonClicked:): Use standard button return codes. * Source/NSTableView.m (-validateEditing): Initialize newObjectValue with nil. Patches by Wolfgang Lux . 2007-10-06 23:03-EDT Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibCompatibility.h * Source/GNUmakefile: Added new classes. * Source/NSNibAXAttributeConnector.m * Source/NSNibAXRelationshipConnector.m * Source/NSNibBindingConnector.m: Implementation of special connectors for Key-Value binding. * Source/NSSplitView.m: Added code for keyed coding 2007-10-02 Fred Kiefer * Source/NSWindow.m (-deminiaturize:, -miniaturize:): Try to handle the case better, where GNUstep manages the mini window and the window decoration itself. Based on patch by Stefan Bidigaray . 2007-10-02 Fred Kiefer * Source/NSPopUpButtonCell.m (-cellSize): Don't return zero size, when there are no items. Based on patch by Andreas Höschler . 2007-10-01 Fred Kiefer * Source/NSDocument.m (-setFileName:, -fileURL:, -setUndoManager: -writeToURL:...error:): Small fixes of previous changes. Patch by Wolfgang Lux . 2007-09-30 Fred Kiefer * Source/NSWindow.m (-cascadeTopLeftFromPoint:): Adopt the resulting next point to visible screen. Based on patch by Wolfgang Lux . 2007-09-13 Fred Kiefer * Source/NSTableView.m (-validateEditing): Set object value to nil, when formatting the string failed. * Source/NSActionCell.m (-intValue): Check flag in_editing before validating the editing. 2007-09-12 Fred Kiefer * Source/NSToolbarItem.m (GSToolbarButtonCell-drawInteriorWithFrame:inView:): Made working for a flipped view. 2007-09-11 Fred Kiefer * Source/NSSplitView.m (-displayRectIgnoringOpacity:inContext:): Implement this method instead of the two old display methods. 2007-09-11 Fred Kiefer * Source/NSTextView.m (-drawRect:, -rectForCharacterRange:, -firstRectForCharacterRange:): Protect againt layoutmanager being nil. * Source/NSTableView.m (-validateEditing): Use setStringValue: when converting the string failed. * Source/NSTableView.m (-mouseDown:): Don't interrupt editing another cell, if the current string isn't valid. Patches partly by Andreas Höschler . 2007-09-10 Fred Kiefer * Source/NSPopUpButtonCell.m (-insertItemWithTitle:atIndex:): Select new item when there isn't any selection. 2007-09-10 Fred Kiefer * Source/NSTableHeaderView.m, * Source/NSSlider.m, * Source/NSProgressIndicator.m, * Source/NSButton.m (-isFlipped): Add fliiping. * Source/NSTableHeaderView.m (-drawRect:): Adjust for flipping. * Source/NSTabView.m: Mark as needing an isFlipped method. 2007-09-09 Fred Kiefer * Source/NSWindow.m (-makeKeyAndOrderFront:): Use orderFrontRegardless instead of orderFront:. Patch by Yen-Ju Chen 2007-09-09 Fred Kiefer * Headers/AppKit/NSTextField.h: * Headers/AppKit/NSTextFieldCell.h: * Source/NSTextField.m, * Source/NSTextFieldCell.m: Add new MacOSX 10.3 methods and constants. 2007-09-09 Fred Kiefer * Headers/AppKit/NSBitmapImageRep.h, * Headers/AppKit/NSResponder.h: Correct conditional compilation. * Headers/AppKit/NSWindow.h: Add new MacOSX 10.4 methods and constants. * Source/NSWindow.m: Basic implementation of new methods. * Source/GSStandardWindowDecorationView.m (-initWithFrame:window:): Get buttons from NSWindow. * Source/NSClipView.m, * Source/NSColorPanel.m, * Source/NSColorWell.m, * Source/NSComboBoxCell.m, * Source/NSDataLinkPanel.m, * Source/NSMatrix.m, * Source/NSMenuItemCell.m, * Source/NSPopUpButton.m: * Source/NSPopUpButtonCell.m: * Source/NSPanel.m: * Source/NSSavePanel.m: * Source/NSScrollView.m, * Source/NSScroller.m, * Source/NSTabView.m, * Source/NSTextField.m, * Source/GSInfoPanel.m, * Source/GSDragView.m, * Source/GSTitleView.m, * Source/GSToolTips.m, * Source/NSButton.m: Clean up includes. 2007-09-07 Fred Kiefer * Source/NSFontManager.m (-convertFont:toHaveTrait:, -convertFont:toNotHaveTrait:): Handle NSUnboldFontMask and NSUnitalicFontMask correctly. * Source/NSFontManager.m (-fontWithFamily:traits:weight:size:) Be more tolerant with traits set wrongly by backends. 2007-09-06 Fred Kiefer * Headers/AppKit/NSCell.h: Add ivar in_editing, which gets set, during the editing/selection of the cell. * Source/NSCell.m (-_setupTextWithFrame:..., endEditing:): Set/ clear the in_editing flag. * Source/NSActionCell.m (-objectValue, -attributedStringValue, -intValue, -floatValue, -doubleValue, -stringValue): Check flag in_editing before validating the editing. 2007-09-05 Nicolas Roard * Source/NSView.m (-scrollRect:by:): reversed the coordinates of destPoint (substract instead of add), to match OSX behaviour. * Source/NSClipView.m (-setBoundsOrigin): reversed the coordinates of the call to scrollRect:by:, to match OSX behaviour. 2007-09-05 Fred Kiefer * Source/NSWindow.m (-sendEvent:, -selectKeyViewFollowingView:, -selectKeyViewPrecedingView:, -selectNextKeyView:, -selectPreviousKeyView:): Handle case when makeFirstResonder: fails. 2007-09-05 Fred Kiefer * Source/NSLayoutManager.m (-glyphIndexForPoint:...fractionOfDistanceThroughGlyph:): Don't ignore invisible glyphs. * Source/NSTextView.m (-_characterIndexForPoint:respectFraction:): New helper method. * Source/NSTextView.m (-characterIndexForPoint:): Correct to use screen coordinates. * Source/NSTextView.m (-draggingEntered:, -draggingUpdated:, -mouseDown:): Use new helper method. * Source/NSAlert.m (-_setupPanel): Check count of buttons. * Source/NSDocument.m (-setFileName:, -setFileURL:): Set url and file name always together. * Source/NSDocument.m (-dataOfType:error:, -fileWrapperOfType:error:, -readFromFileWrapper:ofType:error:, -readFromURL:ofType:error:, -writeSafelyToURL:...error:, -writeToURL:ofType:error:, -writeToURL:...error:, -printOperationWithSettings:error:): Set error to nil. Patches by Wolfgang Lux . 2007-09-04 Fred Kiefer * Source/NSActionCell.m (-objectValue, -attributedStringValue): Add validation of editing. 2007-08-31 Fred Kiefer * Source/NSWindow.m (-makeFirstResponder:): When parameter is nil, set self as first responder and return YES. * Source/NSCell.m (-isEntryAcceptable:): Accept empty strings. * Source/NSTableView.m (-validateEditing): Check if delegate supports method, before calling it. * Source/NSTextField.m (-validateEditing): Accept empty strings. Patches partly by Andreas Höschler . 2007-08-29 Fred Kiefer * Headers/AppKit/NSCell.h: Export more private drawing methods. * Source/NSCell.m (-_drawAttributedString): New helper method to get the attributed string which should be drawn. * Source/NSCell.m (-drawInteriorWithFrame:inView:): Use this method. * Source/NSSecureTextFieldCell.m: Implement -_drawAttributedString instead of -drawInteriorWithFrame:. * Headers/AppKit/NSFormCell.h, * Headers/AppKit/NSForm.h: Add MacOSX 10.4 methods. * Source/NSForm.m: Implement these methods. * Source/NSFormCell.m: Implement these methods. Rewrote drawing code. Remove the color change notification handling. 2007-08-28 Fred Kiefer * Source/NSApplication.m (-_windowWillClose:): Don't call resignKey on the window. Reorganise the code some more and add comments. * Source/NSWindow.m (-_lossOfKeyOrMainWindow): Check all windows whether they could take key or main status. 2007-08-28 Fred Kiefer * Source/NSCell.m (+initialize): Increase version number. * Source/NSCell.m (-initWithCoder:): Correct values for the decoded action mask, as they changed on 2007-08-03. Fixes bug #20884. 2007-08-24 22:33-EDT Gregory John Casamento * Source/NSButtonCell.m: Added code in encodeWithCoder: to allow encoding previous versions of the object to the archive. 2007-08-22 Fred Kiefer * Headers/AppKit/NSFontPanel.h: Add MacOSX 10.3 constants. 2007-08-21 Fred Kiefer * Source/NSAttributedString.m (-fixFontAttributeInRange:): Ignore characters below 31. Patch by Yen-Ju Chen 2007-08-20 Fred Kiefer * Source/NSWindow.m (-sendEvent:): For the left mouse down case make sure that the affected view is still valid after activating the application and making the window key. 2007-08-20 Fred Kiefer * Source/NSInputManager.m (-handleKeyboardEvents:client:): Set the isFunctionKey boolean correctly. This was needed as the NSFunctionKeyMask value doesn't fit in the first byte. 2007-08-19 21:18-EDT Gregory John Casamento * Source/NSController.m * Source/NSObjectController.m: Remove calls to debug method. 2007-08-19 Fred Kiefer * Source/NSButton.m ([performKeyEquivalent:]): Only test for modal window when it isn't nil. 2007-08-16 Fred Kiefer * Headers/AppKit/NSFontManager.h, * Source/NSFontManager.m: Add MacOSX 10.3 methods and constants. * Source/NSWindow.m (-setHasShadow:): Add backend call. 2007-08-14 23:24-EDT Gregory John Casamento * Source/NSManagedObjectContext.h * Source/NSManagedObjectContext.m: Add managed object context. 2007-08-14 23:22-EDT Gregory John Casamento * Headers/AppKit/NSController.h: Added new ivar. * Headers/AppKit/NSObjectController.h: Added new ivar. * Source/GNUmakefile: Added NSManagedObjectContext.[hm]. * Source/NSController.m: Add keys for nib encoding/decoding. * Source/NSObjectController.m: Add keys for nib encoding/decoding. 2007-08-15 Fred Kiefer * Headers/Additions/GNUstepGUI/GSDisplayServer.h (-setShadow::), * Source/GSDisplayServer.m (-setShadow::): Add new method for shadow. 2007-08-12 Fred Kiefer * Source/NSAttributedString.m (-_substituteFontWithName:font:): Let the font manager handle the font convertion. * Source/NSPrintOperation.m (_print): Don't adjust page when page range is known. 2007-08-09 Fred Kiefer * Source/NSAttributedString.m (-fixFontAttributeInRange:): First attempt at font attribute fixing. 2007-08-08 Fred Kiefer * Headers/AppKit/NSFont.h: Add MacOSX 10.4 methods and constants. * Source/NSFont.m: Add MacOSX 10.4 methods. Remove NSFontDescriptor code. * Source/NSFont.m (+initialize): Read in preferred fonts from user defaults. * Headers/AppKit/NSFontDescriptor.h: Clean up includes. * Source/NSFontDescriptor.m: New file, split out from NSFont.m. * Source/externs.m: Moved NSFontDescriptor strings to here. * GNUMakefile: Add NSFontDescriptor.m 2007-08-08 Fred Kiefer * Headers/AppKit/NSScreen.h: Add method userSpaceScaleFactor. * Source/NSScreen.m: Implement userSpaceScaleFactor. Correct mainScreen. Listen to NSApplicationDidChangeScreenParametersNotification. Get default menu height from NSMenuView. General cleanup. 2007-08-07 Fred Kiefer * Source/NSButtonCell.m (-initWithCoder:), * Source/NSMenuItem.m (-initWithCoder:): Adopt to changed values for _keyEquivalentModifierMask. These have changed through the NSEvent.h change. 2007-08-03 Fred Kiefer * Source/NSView.m (-displayIfNeededInRectIgnoringOpacity:): Correct spelling in comment. * Headers/AppKit/NSLevelIndicatorCell.h: Add ivar for cell frame. * Source/NSLevelIndicator.m (-rectOfTickMarkAtIndex:, -cellSize): Implement. Patch by Christopher Elsmore . 2007-08-03 Fred Kiefer * Headers/AppKit/NSDocumentController.h, * Source/NSDocumentController.m (-maximumRecentDocumentCount): Add missing method. * Headers/AppKit/NSEvent.h, * Source/NSEvent.m: Add MacOSX 10.4 methods and constants. Resort event types to be binary compatible to MacOSX. * Source/Functions.m (NSEventMaskFromType): Remove. * Source/NSWindow.m (-sendEvent:): Handle new event types. 2007-08-03 Richard Frith-Macdonald * Source/NSWorkspace.m: ([-launchedApplications]) complete and tidy code to check existence of launched apps. Revert code to check for apps that are not responding ... MacOS-X reports hung apps, so we should do the same. 2007-08-02 Richard Frith-Macdonald * Source/NSWorkspace.m: ([-launchedApplications]) check that each app is still responding if it's more than 30 seconds since the last check. If possible, check that processes still exist. 2007-07-31 Fred Kiefer * Headers/AppKit/NSColorPanel.h: Add constant for NSCrayonModeColorPanel. * Headers/AppKit/NSComboBox.h, * Source/NSComboBox.m: Add MacOSX 10.3 methods. * Headers/AppKit/NSComboBoxCell.h, * Source/NSComboBoxCell.m: Add MacOSX 10.3 methods. 2007-07-31 Fred Kiefer * Headers/AppKit/NSColorSpace.h, * Source/NSColorSpace.m: New files. * GNUMakefile: Add NSColorSpace. * Headers/AppKit/NSColor.h, * Source/NSColor.m: Add MacOSX 10.4 methods. Code mostly by Nikolaus Schaller . 2007-07-28 Fred Kiefer * Headers/AppKit/NSBrowser.h, * Source/NSBrowser.m: Add MacOSX 10.3 methods and constants. * Source/externs.m: Define new string constant. 2007-07-27 Fred Kiefer * Headers/AppKit/NSBox.h, * Source/NSBox.m: Add methods and ivar for box type and encode/decode it. 2007-07-26 Fred Kiefer * Headers/AppKit/NSBitmapImageRep.h, * Source/NSBitmapImageRep.m: Add MacOSX 10.4 methods and constants. Code mostly by Nikolaus Schaller . * Source/externs.m: Enable new string constant. 2007-07-25 Fred Kiefer * Headers/AppKit/NSApplication.h: Correct comment. * Source/NSApplication.m: Add error presenting methods. 2007-07-24 Fred Kiefer * Headers/AppKit/NSApplication.h, * Source/NSApplication.m: Add MacOSX 10.4 method declarations. * Source/externs.m: Define new string constant. 2007-07-23 Fred Kiefer * Headers/AppKit/NSAnimation.h: Remove unneeded includes. * Headers/Additions/GNUstepGUI/GSAnimator.h: Correct line endings. * Source/GSAnimator.m: Correct line endings and coding style. 2007-07-23 Fred Kiefer * Headers/AppKit/NSCell.h, * Source/NSCell.m, * Source/NSActionCell.m (-setControlView:): Add MacOSX 10.4 method. * Headers/AppKit/NSAlert.h, * Source/NSAlert.m (+alertWithError:): Add MacOSX 10.4 method. 2007-07-18 Fred Kiefer * Headers/AppKit/NSPrintInfo.h, * Source/NSPrintInfo.m (-imageablePageBounds, -localizedPaperName): New MacOSX method. Plus some general clean up. * Source/NSPrinter.m (-stringListForKey:inTable:, -isKey:inTable:): Don't raise exception on missing table. * Source/NSPrinter.m (-statusForTable:) Add check for corrct class. 2007-07-09 Fred Kiefer * Source/NSAffineTransform.m (-rectInMatrixSpace:, -translateToPoint:, -makeIdentityMatrix): Use optimized primitive methods from base. * Source/NSAffineTransform.m (-scaleTo::): Try to handle rotation case better. * Source/NSView.m (-scaleUnitSquareToSize:): Adjust origin too and handle rotation case. * Source/NSView.m (-setBounds:, setBoundsOrigin:): Try to handle rotation case better. 2007-07-04 Fred Kiefer * Source/NSCell.m (-encodeWithCoder:): Try to better key encode the contents of the cell. 2007-07-04 Fred Kiefer * Source/NSPrintOperation.m (NSView-_displayPageInRect:withInfo:), * Source/NSView.m (-_rebuildCoordinates, -initWithFrame:, -initWithCoder:, -dealloc, -_updateBoundsMatrix, -setBounds:, -setBoundsOrigin:, -setBoundsRotation:, -boundsRotation, -_lockFocusInContext:inRect:): Create _boundsMatrix only when needed and protect all uses of it. * Source/NSView.m (-initWithCoder:): Remove call to setFrameOrigin: on frame matrix. 2007-07-04 Fred Kiefer * Source/NSTextField.m (-isFlipped): Report the text field as being flipped. 2007-06-29 Fred Kiefer * Source/NSSecureTextFieldCell (-drawInteriorWithFrame:): Add some support for bullet echoing and a comment on the missing bits. 2007-06-28 Fred Kiefer * Source/NSView.m (-_lockFocusInContext:inRect:): Ignore the frame origin when computing the clip area. 2007-06-27 Fred Kiefer * Source/NSView.m (-setBoundsRotation:): Ignore the frame origin when computing the bounds. * Source/NSView.m (-drawPageBorderWithSize:): Remove test code accidentally introduced in last change. 2007-06-26 Fred Kiefer * Headers/AppKit/NSView.h: Add new MacOSX methods. * Source/NSView.m: Basic implementation of new MacOSX methods. Rewrote all the display* methods to use the new method [displayRectIgnoringOpacity:inContext] and made them more consistent. Add some documentation for the display mechanism. * Source/GSPDFPrintOperation.m (-_print), * Source/GSEPSPrintOperation.m (-_print), * Source/NSPrintOperation.m (NSView-_displayPageInRect:withInfo:): Use new method [NSView displayRectIgnoringOpacity:inContext:]. * Source/NSView.m (-endPage): Add DPSgrestore() call. 2007-06-23 10:43-EDT Gregory John Casamento * Headers/AppKit/NSObjectController.h * Source/NSObjectController.m: Changed "class" to "aClass" to avoid issues with ObjC++ compilation in both the header and the .m file for consistency. This change was suggested by Rob Burns and he provided a short patch via IRC. 2007-06-22 Richard Frith-Macdonald * Source/NSView.m: When setting frame and bounds, refrain from doing anything if the values set are the same as the of values. When setting frame size or rotation, update the bounds too (attempt to fix bug #20057). 2007-06-18 Fred Kiefer * Headers/AppKit/NSAttributedString.h: Add new MacOSX methods and constants. * Source/NSAttributedString.m: Basic implementation of new methods. * Source/externs.m: Define new string constants. * Headers/AppKit/NSImageView.h: Add new MacOSX methods. * Source/NSImageView.m: Basic implementation of new methods. * Headers/AppKit/NSStringDrawing.h: Add new MacOSX methods. * Source/NSStringDrawing.m: Basic implementation of new methods. * Headers/AppKit/NSParagraphStyle.h: Add new MacOSX methods. * Source/NSParagraphStyle.m: Implementation of new methods. Code by Nikolaus Schaller . * Headers/AppKit/NSTextStorage.h, * Source/NSText.m, * Source/GSLayoutManager.m, * Source/NSLayoutManager.m, * Source/GSStandardWindowDecorationView.m, * Source/GSHorizontalTypesetter.m, * Source/NSMenuItemCell.m, * Source/GSTitleView.m, * Source/NSTextView_actions.m, * Source/NSTextView.m, * Source/NSToolbarItem.m: Clean up includes. 2007-06-18 Fred Kiefer * Headers/AppKit/NSGraphicsContext.h: Declare new printing methods. * Source/NSGraphicsContext.m: Implement Postscript printing methods. * Source/NSPrintOperation.m: Move _endSheet method into NSView. * Source/NSView.m: Use printing methods from NSGraphicsContext. 2007-06-07 Sergii Stoian * Source/NSBrowser.m: ([drawWithFrame:inView:]) Pass inset rect by 1 to drawInteriorWithFrame:. * Source/NSSavePanel.m: ([_initWithoutGModel]) Change propeties of buttons: remove setting buttons type (by default NSMomentaryPushInButton); refuse first responder for buttons. Set setImageDimsWhenDisabled:NO to image button. Cleanup. 2007-06-03 Richard Frith-Macdonald * Source/NSOpenPanel.m: In -filenames append name to directory using the standard method rather than by concatenating them joined by a slash. Might fix bug #19929 but even if it doesn't cure that, it certainly fixes an error. 2007-05-28 Richard Frith-Macdonald * Source/NSView.m: ([scrollRect:by:]) restrict scrolled rectangle to the bounds of the view. 2007-05-23 Fred Kiefer * Source/NSPrintOperation.m (-runOperationModalForWindow:...contextInfo:, -_printOperationDidRun:returnCode:contextInfo:) Only set and use GSModalRunDelegate and GSModalRunSelector values when not nil. 2007-05-17 Richard Frith-Macdonald * Source/NSFont.m: Revert incorrect matrix equality test change. 2007-05-16 Richard Frith-Macdonald * Headers/AppKit/NSFontDescriptor.h: tidied indentation etc. * Source/NSFont.m: Tidied for coding standards. Fixed memory leak. Fixed error in matrix equality test. 2007-05-16 Riccardo Mottola * Headers/AppKit/NSFontDescriptor.h : added from mgstep * Source/NSFont.* : added font descriptor related methods and NSFontDescriptor implementation * GNUMakefile: added NSFontDescriptor 2007-05-16 Richard Frith-Macdonald * Source/NSTextAttachment.m: For MacOS-X compatibility, don't call ([-setAttachment:]) on the cell if the cell class doesn't implement it. 2007-05-10 Riccardo Mottola * Source/NSAnimation.m: removed some C99-isms * Source/NSBitmapImageRep+GIF.m : removed some C99-isms * Source/NSDocument.m : removed some C99-isms 2007-05-10 Richard Frith-Macdonald * Source/NSAnimation.m: removed some C99-isms and simplified by removing attempt to avoid locking when in single threaded mode. * Headers/AppKit/NSAnimation.h: added an ivar and FIXME comments. 2007-05-08 Riccardo Mottola * Source/NSAnimation.m: removed some C99-isms 2007-04-29 Fred Kiefer * Source/NSButtonCell.m * Source/NSMenuItemCell.m: Whitespace cleanup. 2007-04-27 Fred Kiefer * Headers/AppKit/NSDragging.h: Added a few MacOSX 10.2 methods * Source/GSDragView.m: (-_handleDrag:slidePoint:): Call new MacOSX method on destionation when available. Patch by Yen-Ju Chen 2007-04-27 Fred Kiefer * Source/NSTableView.m (-editColumn::row:withEvent:select:): Set the background colour of the text object and make it draw its background. 2007-04-24 Fred Kiefer * Source/NSTableView.m (-noteNumberOfRowsChanged): Handle the case correctly where an empty selection is not allowed and now there are rows available. 2007-04-13 Adam Fedor * Version: Bump version 2007-04-13 Adam Fedor * Version 0.12.0 * Source/NSAnimation.m: Remove unused and incorrect include. 2007-04-12 Xavier Glattard * Headers/AppKit/NSAnimation.h * Source/NSAnimation.m * Headers/Additions/GNUstepGUI/GSAnimator.h * Source/GSAnimator.m - attempt to follow GNU coding standards - implementation of NSAnimationBlockingMode and NSAnimationNonBlockingThreaded modes - fix some bugs and incompatibilities with Cocoa - Add some more documentation 2007-04-11 Richard Frith-Macdonald * Source/NSView.m: When transforming a size ensure that the resulting height is positive. Is this correct behavior? It should reproduce the old (incorrect ... ie differing from MacOS-X) behavior of NSAffineTransform. 2007-04-09 21:20-EDT Gregory John Casamento * Source/NSAnimation.m: Removed static INLINE declaration from nsanimation_progressMarkSorter function so that it will compile properly on versions of gcc prior to 4.1.2. 2007-04-10 Fred Kiefer * Source/NSClipView.m (-setBoundsOrigin:): Use NSView method scrollRect:by:. * Source/NSPrintOperation.m (NSView -_displayPageInRect:atPlacement:withInfo:): Release the temporary matrixes. * Source/GSEPSPrintOperation.m (_print): Call endPage on the view. 2007-04-05 Xavier Glattard * Headers/AppKit/NSAnimation.h * Source/NSAnimation.m * Headers/Additions/GNUstepGUI/GSAnimator.h * Source/GSAnimator.m Implementation of NSAnimation and NSViewAnimation classes : - only NSAnimationNonBlocking mode is implemented - runLoopModesForAnimating is not used GSAnimator class is in alpha stage : interface may be changed See gnustep-examples/GSTest for demos. 2007-04-04 Fred Kiefer * Headers/AppKit/NSWindow.h: Reuse one reserved ivar as the graphics context. * Source/NSWindow.m (-_terminateBackendWindow, -_initBackendWindow, -initWithWindowRef:, -graphicsContext, -flushWindow, -_processResizeEvent): Set and use context from ivar. * Source/NSImage.m (-drawInRect:fromRect:operation:fraction:): make sure to use the right graphic context. * Source/NSView.m (-releaseGState): Use context from window. * Source/NSView.m (-_lockFocusInContext:inRect:, -unlockFocusNeedsFlush:) Set context to current when locking focus and pop it when unlocking. 2007-04-02 Richard Frith-Macdonald * Headers/AppKit/NSAlert.h: Tidied. * Source/NSAlert.m: Tidied to more standard gnustep style and added code to perform gui operations in the main appkit thread where someone tries to use alerts from another thread. 2007-03-26 Richard Frith-Macdonald * Source/NSAttributedString.m: Wrap excessively long lines * Source/externs.m: Add new attributed string constants * Headers/AppKit/NSAttributedString.h: Add constants from current MacOS-X 2007-03-23 Richard Frith-Macdonald * Source/NSAffineTransform.m: Simplify code slightly. 2007-03-23 Fred Kiefer * Source/NSCell.m (-drawWithFrame:inView:): Extract helper methods for border and focus drawing. * Source/NSButtonCell.m: Override the border drawing method. * Source/NSMenuItemCell.m: Override the border drawing method and set default focus ring to none. * Source/NSPopupButtonCell.m: Set default focus ring to default. 2007-03-23 Sergii Stoian * Source/NSAlert.m: (-_initWithoutGModel): Set selected text background color to [NSColor controlLightHighlightColor]. 2007-03-23 Fred Kiefer * Source/NSView.m: Replace calls to the now deprecated methods on NSAffineTransform with correct ones. 2007-03-22 Fred Kiefer * Source/NSButtonCell.m (-drawWithFrame:inView:), * Source/NSCell.m (-drawWithFrame:inView:): Respect focus ring style when drawing first responder state. * Source/NSBrowserCell.m (-drawInteriorWithFrame:inView:), * Source/NSPopupButtonCell.m (-drawInteriorWithFrame:inView:), * Source/NSImageCell.m (-drawInteriorWithFrame:inView:): Don't draw focus ring. 2007-03-22 Richard Frith-Macdonald * Source/NSAffineTransform.m: Avoid accessing internals of the base library class directly. Mark many methods as deprecated. * Headers/AppKit/NSAffineTransform.h: Mark gnustep extensions as deprecated. Perhaps we don't want to deprecate all of them though need feedback on that. 2007-03-21 Fred Kiefer * Source/NSView.m (-gState): Generate a gstate if one is needed and none has been set up to now. 2007-03-19 Fred Kiefer * Source/NSPrintOperation.m (NSView -_endSheet, NSView -_displayPageInRect:atPlacement:withInfo:): Get graphics context from the print operation. * Source/NSView.m (-_lockFocusInContext:inRect:): When not set, get graphics context either from window or from the print operation. * Source/NSView.m (-lockFocusInRect, -lockFocusIfCanDraw): Don't set the graphics context. * Source/NSView.m: For all print methods get the context from the print operation. 2007-03-17 Fred Kiefer * Source/NSView.m (-setBoundsRotation:): Adjust _bounds ivar to the rotation. * Source/NSView.m (-translateOriginToPoint:, -rotateByAngle:): Implemented via setBoundsOrigin: and rotateByAngle:. * Source/NSView.m (-_lockFocusInContext:inRect:): For rotated views compute the actual clip region instead of using _bounds. 2007-03-17 Nicola Pero * GNUmakefile.postamble (before-uninstall): Uninstall gui.make. * Panels/GNUmakefile.postamble (after-uninstall): Fixed uninstall target. * Source/CompatibilityHeaders.make (after-install): Use ECHO_NOTHING and END_ECHO. (after-uninstall): New target that uninstalls the compatibility headers. 2007-03-12 Fred Kiefer * Source/NSAffineTransform.m: Set _isIdentity for all methods changing the matrix of the affine transform. 2007-03-11 Fred Kiefer * Source/NSApplication.m (-abortModal): Call stopModalWithCode: to make this mehtod work when not inside the modal loop. * Source/GSToolbarView.m (-_takeInAccountFlexibleSpaces): Don't call methods that return astructures on nil as this fails on Solaris. * Source/NSTableColumn.m (-setWidth:): Add self tothe notifiaction. * Source/NSComboBoxCell.m (-_selectCompleted): Don't change selection if no match is found. * Source/NSMenuItemCell.m (-drawImageWithFrame:inView:): Use [drawImage:withFrame:inView:] to do the drawing. Patches by Andreas Höschler . 2007-03-09 Nicola Pero Updated gnustep-gui to use versioned library resources. * Source/NSApplication.m ([+initialize]): Use bundleForLibrary:version: to get the correct version of the gnustep-gui resources. * Source/GNUmakefile: Install resources in versioned directory. * Resources/GNUmakefile: Same change. * Panels/GNUmakefile.postamble: Same change. 2007-03-09 Sergii Stoian * Source/GSSlideView.m: (- _slideFrom:to:): Calcuate number of steps wrt image size. * Source/GSDragView.m: (- slideDraggedImageTo:): Ditto. 2007-03-08 Fred Kiefer * Headers/AppKit/NSResponder.h: Move _rFlags from here ... * Headers/AppKit/NSView.h: ... to here. * Headers/AppKit/NSWindow.h: Add views_need_display * Source/NSWindow.m: Use _f.views_need_display instead of _rFlags. 2007-03-08 Fred Kiefer * Source/NSImage.m (-TIFFRepresentation, -TIFFRepresentationUsingCompression:factor:): If there is no bitmap representation create one and store it. Idea by Renaud Molla . 2007-03-08 Fred Kiefer * Source/NSDocument.m (-fileNameFromRunningSavePanelForSaveOperation:): Add remaining change by Wolfgang Lux. This corrects a potential mismatch between the document type and the type specified in the panel. 2007-03-08 Fred Kiefer * Headers/AppKit/NSTabView.h: Correct NSTabViewType enumerator to match values from Apple. * Source/NSTabView.m (-encodeWithCoder:, -initWithCoder:): Adopt to new enum values. 2007-03-07 Fred Kiefer * Source/NSPrintPanel.m: The modal loop which displays the print panel is now left with either NSOKButton or NSCancelButton (cf. the documentation of NSPrintPanel's -runModal: and -beginSheetWithPrintInfo:modalForWindow:delegate:didEndSelector:contextInfo:). * Source/NSPrintOperation.m: The callback passed to the print panel's beginSheet... method had a wrong signature (and also was misspelled). In addition, the code of the callback did retrieve its own callback from the print dictionary in a wrong way (was asking for a pointer to a selector while a selector was saved). * Source/NSDocument.m: The callback of -runModalPrintOperation:delegate:didRunSelector:contextInfo: method has a different signature than the one passed to the print operation's -runOperationModalForWindow:delegate:didRunSelector:contextInfo: method. This means NSDocument needs some adapter code and also has to save the delegate and selector passed to runModalPrintOperation... in some place. * Headers/AppKit/NSDocument.h: Since there can be at most one print dialog for a document, add two private instance variables to NSDocument for that purpose. Patch by Wolfgang Lux . 2007-03-07 Richard Frith-Macdonald * Source/NSPasteboard.m: Launch gpbs with --auto option so that it shuts down again when all connections are closed. 2007-03-06 Nicola Pero * Source/GSServicesManager.m ([+newWithApplication:]): If the base library returns an empty User Library path, try using a default one. 2007-03-06 Fred Kiefer * Source/NSBox.m (-initWithFrame:): Set content view via the method setContentView: to be independent of super class implementation of addSubview: * Headers/AppKit/NSWindow.h, * Source/NSWindow.m: Add method graphicsContext. * Headers/AppKit/NSView.h, * Source/NSView.m: Add MacOS 10.4 methods. * Source/NSView.m (addSubview:): Implement via addSubview:positioned:relativeTo:. Optimize the later method for the otherView = nil case. * Source/NSView.m (dragPromisedFilesOfTypes:..., mouseDownCanMoveWindow, scrollRect:by:, scrollClipView:toPoint:, getRectsBeingDrawn:count:, needsToDrawRect:): Implement. * Source/NSView.m (registerForDraggedTypes:) Change order of removeDragTypes and addDragTypes, so that overlapping drag types get handled correctly. * Source/NSView.m (_enclosingClipView): New helper method. * Source/NSView.m (enclosingScrollView, scrollRectToVisible:, scrollPoint:): Optimize. * Source/NSView.m (displayRectIgnoringOpacity:): Move unlockFocusNeedsFlush closer to lockFocusInRect. * Source/NSView.m (_lockFocusInContext:inRect:): New main focus locking method. Clip only when wantsDefaultClipping returns YES. * Source/NSView.m (releaseGState): Set _allocate_gstate to 0 to switch off private gState. * Source/NSView.m (_invalidateCoordinates): Call renewGState instead of releaseGState. * Source/NSView.m (initWithFrame:): Use value from super init call and don't set pre-set ivars. 2007-03-06 Richard Frith-Macdonald * Source/GSServicesManager.m: * Source/NSWorkspace.m: Fix usage of NSSearchPathForDirectoriesInDomains() to match new filesystem support changes. 2007-03-04 Richard Frith-Macdonald * Source/NSSpellServer.m: deleted * Source/GNUmakefile: remove NSSpellServer.m * Source/NSSpellChecker.m: include NSSpellServer.h from base * Headers/AppKit/NSSpellServer.h: deleted * Headers/AppKit/AppKit.h remove NSSpellServer.h Moved NSSpellServer to base for macos-x compatibility. 2007-03-03 14:51-EST Gregory John Casamento * Source/NSDocument.m: Added change suggested by Wolfgang Lux. This corrects a potential mismatch between the document type and the type specified in the panel. 2007-02-28 Fred Kiefer * Source/NSScrollView.m (-keyDown:, -scrollLineUp:, -scrollLineDown:): New methods. * Source/NSTextView_actions.m (-scrollLineDown:, -scrollLineUp:, -scrollPageDown:, -scrollPageUp:): Implement methods based on scroll view. * KeyBindings/DefaultKeyBindings.dict: Change control-up and and page up to be scrollPageUp: and control-down and page down to be scrollPageDown:. pageDown: and pageUp: can now be reached via control-pageup and alt-pageup resp. control-pagedown and alt-pagedown. Patch by Wolfgang Lux . 2007-02-28 Fred Kiefer * Headers/AppKit/NSScrollView.h: Add ivar _autohidesScrollers. Move private method to implementation file. * Source/NSScrollView.m (-init): Remove as this is the same as in the super class. * Source/NSScrollView.m (-autohidesScrollers, -setAutohidesScrollers:, -reflectScrolledClipView:): Add support for auto hidding of scrollers. * Source/NSScrollView.m (-initWithCoder:): Decode the value for _autohidesScrollers. 2007-02-28 Nicola Pero * configure.ac: Use gnustep-config to set GNUSTEP_MAKEFILES if not set. * GNUmakefile: Same change. * configure: Regenerated. 2007-02-27 Fred Kiefer * Panels/GSPrintPanel, * Panels/GSPageLayout: Updated to new Gorm format and made elements transparent. Patch by Ingolf Jandt . 2007-02-27 Fred Kiefer * Source/NSClipView.m (-initWithFrame:): Replace the wrong initialise [init]. * Source/NSClipView.m (-viewFrameChanged:, -documentVisibleRect, -dealloc): Simplified methods. * Source/NSClipView.m (-setDocumentView:): Remove only notifications that get added here. * Source/NSClipView.m (-setBounds:): Add method. 2007-02-27 Nicola Pero * Source/GNUmakefile.preamble (GNUSTEP_INSTALL_PREFIX): Variable removed as it could not work with custom filesystem layouts. (GNUSTEP_TOOLS_NO_DESTDIR): New variable. (ADDITIONAL_CPPFLAGS): Pass GNUSTEP_TOOLS_NO_DESTDIR, not GNUSTEP_INSTALL_PREFIX. * Source/NSPasteboard.m ([+_pbs]): Use GNUSTEP_TOOLS_NO_DESTDIR instead of GNUSTEP_INSTALL_PREFIX. * Source/NSSound.m ([+gsnd]): Same change. * Source/NSWorkspace.m ([-findApplications]): Same change. 2007-02-27 Nicola Pero * gnustep-gui-debug.spec.in: Obsolete file removed. * GNUmakefile (CVS_MODULE_NAME): Do not set (exports should be done from subversion now). * Documentation/GNUmakefile.postamble (after-install): Use MKINSTALLDIRS, not MKDIRS, to create installation directories. 2007-02-27 Fred Kiefer * Source/NSTabView.m (-initWithFrame:): Set _selected_item to NSNotFound. * Source/NSTabView.m (-selectNextTabViewItem:, -selectPreviousTabViewItem:): Handle _selected_item being NSNotFound correctly. Patch by Wolfgang Lux . 2007-02-26 Richard Frith-Macdonald * Source/NSLayoutManager.m: ([drawGlyphsForGlyphRange:atPoint:]) Implement selected text color ... use the value set in the textview or if that is not supplied, fall back to selectedTextColor. Fix ([drawBackgroundForGlyphRange:atPoint:]) to use ([textViewForBeginningOfSelection]) to determine selected text color. 2007-02-22 Matt Rice * Source/NSAlert.m (-_initWithoutGModel): Add missing nil at end of call to -dictionaryWithObjectsAndKeys: 2007-02-22 Sergii Stoian * Source/NSWindow.m: (_lossOfKeyOrMainWindow): Add sanity checks. Optimize. * Source/NSLayoutManager.m: (-drawBackgroundForGlyphRange:atPoint): Use the text view's selected text attributes. Remove TODO. * Source/NSAlert.m: (-_initWithoutGModel): Set selected text background color to white. Now we can see selection of message text. 2007-02-21 Sergii Stoian * Source/NSAlert.m: (-_initWithoutGModel): Make buttons refuse first responder to avoid drawing dashed frame and protec from selecting potentially dangerous buttons by accident. (-_makeButtonWithRect:): Change style of button from NSMomentaryPushButton to NSMomentaryPushInButton. 2007-02-20 Fred Kiefer * Source/NSAlert.m: (-_initWithoutGModel): Set the message field to not draw its background. * Source/NSTabViewItem.m: Whitespace changes to conform to coding standards. * Source/NSTabViewItem.m (-drawLabel:inRect:): Moved drawing of background into NSTabView. Only there do we know, how to adjust the rectangle correcty. * Source/NSTabViewItem.m (-initWithCoder:): Autorelease some ivars that don't get retained to prevent memory leak. * Source/NSTabView.m (-insertTabViewItem:atIndex:, -removeTabViewItem:): Adjust selection, if needed. * Source/NSTabView.m (-minimumSize, -contentRect, -encodeWithCoder:, -initWithCoder:): Handle more type cases. * Source/NSTabView.m (-drawRect:): Rewrote to simplify and correct code. Moved drawing of the label background to here. 2007-02-19 Enrico Sersale * Source/NSAlert.m: (-_initWithoutGModel): added [setImageDimsWhenDisabled: NO} to not show the application icon dimmed. 2007-02-19 Fred Kiefer * Source/NSMatrix.m (cellFrameAtRow:column:, drawRect:, getRow:column:forPoint:): Removed special handling for non-flipped case. Patch by Andreas Höschler . 2007-02-18 Fred Kiefer * Source/NSDocument.m (runModalSavePanel:withAccessoryView:): Only set accessory view when not nil. Workaround for bug #19031. 2007-02-16 Richard Frith-Macdonald * Source/NSMenuItemCell.m: fixup glitch with drawing of horizontal menu items overwriting menu border. * Source/NSMenuView.m: use menubar font size to calculate menubar height. * Source/GSInfoPanel.m: send theme panel action for click on theme. 2007-02-16 Sergii Stoian * Headers/AppKit/NSTextView.h: Enable disabled insertion point blinking code. * Source/NSTextView.m: (drawRect:): Draw insertion point using _drawInsertionPointNow ivar. Cleanup code. (_blink:): Enable disabled insertion point blinking code. (updateInsertionPointStateAndRestartTimer:): Implement insertion point blinking. Remove TODO. 2007-02-15 Nicola Pero * configure.ac: Source GNUstep.sh then use GNUSTEP_SYSTEM_HEADERS and GNUSTEP_SYSTEM_LIBRARIES if available rather than using hardcoded paths. * configure: Regenerated. 2007-02-14 Sergii Stoian * Source/NSMenuView.m: (menuBarHeight): Fix calculation. Set minimum height to 22. (setFont:): Fix calculation default cell size. * Source/NSLayouManager.m: (_insertionPointRectForCharacterIndex:textContainer:): Use default font height for insertion point height if there is no characters. (insertionPointRectForCharacterIndex:inTextContainer:): Remove insertion point rectangle correction. 2007-02-14 Nicola Pero * Source/GNUmakefile (libgui-resources_INSTALL_DIR): New variable for newer gnustep-makes. * Resources/GNUmakefile (gui-resources_INSTALL_DIR): Same change. 2007-02-09 Adam Fedor * TextConverters/RTF/GNUmakefile.preamble: Add BUNDLE_LIBS. * Source/NSImage.m: Move documentation from here. * Header/AppKit/NSImage.h: To here. * Headers/AppKit/NSImageRep.h, : Add documentation. (patch #5714). 2007-02-09 Fred Kiefer * Source/GNUmakefile: Install header file NSKeyValueBinding.h. 2007-02-07 Fred Kiefer * Image/NSRatingLevelIndicator.tiff, * Headers/AppKit/NSLevelIndicatorCell.h, * Headers/AppKit/NSLevelIndicator.h, * Source/NSLevelIndicator.m, * Source/NSLevelIndicatorCell.m: Add MacOS 10.4 classes. * Headers/AppKit/AppKit.h: Publish the MacOS 10.4 classes. * Source/GNUmakefile: Compile and install new classes and image. Code by Nikolaus Schaller . 2007-02-06 Matt Rice * Source/NSBrowser.m (-doClick:): Don't reselect the selected cells. Fixes bug #18881 * Source/NSMatrix.m (-_selectPreviousSelectableCellBeforeRow:column): Update _selectedCells for the new selection. (-_selectNextSelectableCellAfterRow:column:): Ditto. 2007-02-05 Matt Rice * Headers/AppKit/NSOutlineView.h: Update documentation. 2007-02-05 Matt Rice * Source/NSTableView.m (-_numRows): New quasi private method. (-noteNumberOfRowsChanged:): Call _numRows instead of data source method. * Source/NSOutlineView.m (-noteNumberOfRowsChanged:): Don't override supers. (-_numRows): Implement. (-collapseItem:collapseChildren:): Remove use of _selectedObjects. (-expandItem:expandChildren:): Ditto. (-_removeChildren:): Ditto. (-initWithFrame:): Don't initialize _selectedObjects. (-initWithCoder:): Ditto. * Headers/AppKit/NSOutlineView.h: Mark _selectedObjects as unused. 2007-02-05 Matt Rice * Source/NSOutlineView.m (-mouseDown:): Check item expandability before expanding or collapsing. 2007-02-05 Fred Kiefer * Headers/AppKit/NSMenuItem.h: Add MacOS 10.3 methods and additional ivars. * Source/NSMenuItem.m: Implement MacOS 10.3 methods. * Source/NSMenuItem.m (-dealloc, -encodeWithCoder:, -initWithCoder:, -copyWithZone): Handle new ivars. 2007-02-04 Matt Rice * Source/NSTableView (-mouseDown:): Release oldSelectedRows. Mark done as yes instead of returning early, and avoid sending action multiple times. 2007-02-04 Matt Rice * Source/NSTableView (-mouseDown:): Compute the selection immediately instead of at the end of the loop. 2007-02-04 Richard Frith-Macdonald * Source/NSImageView.m: fix minor error in dragging offset. 2007-02-04 Matt Rice * Source/NSTableView.m (-mouseDown:): Return early after tracking a cell which prefersTrackingUntilMouseUp. * Source/NSPopUpButtonCell.m (+prefersTrackingUntilMouseUp:): Return yes. (-trackMouse:inRect:ofView:untilMouseUp:): Return yes or no depending on whether the mouse went up inside the menu or not. Fixes bug #18946 2007-01-31 Richard Frith-Macdonald * Source/GSFontInfo.m: * Source/NSFont.m: * Headers/Additions/GNUstepGUI/GSFontInfo.h: Add stubs for numberOfGlyphs and coveredCharacterSet 2007-01-30 Fred Kiefer * Source/NSCell.m (-_setupTextWithFrame:inView:editor:delegate:range:, -endEditing:): Revert to always use a clip view, but with different size. 2007-01-29 Matt Rice * Source/NSTableView.m: Revert previous patch. 2007-01-28 Matt Rice * Source/NSTableView.m (-textDidEndEditing:): Handle NSIllegalTextMovement. * Source/NSTableView.m (-textDidEndEditing:): Add missing break to previous commit. 2007-01-27 Fred Kiefer * Headers/AppKit/NSMenuItemCell.h: Remove ivar _backgroundColor. Add ivar _needs_display. * Source/NSMenuItemCell.m (-drawingRectForBounds:): Move push in adjustment to here. * Source/NSMenuItemCell.m (-drawBorderAndBackgroundWithFrame:): Draw the background here and not in [drawInteriorWithFrame:inView:] * Source/NSMenuItemCell.m (-backgroundColor:, -tag, -setNeedsDisplay:, -needsDisplay): New methods. * Source/NSMenuItemCell.m (-setMenuItem:, -setHighlighted:, -init): Mark as needing sizing. * Source/NSMenuItemCell.m (-setMenuView:): Switch off border and move image to left side for horizontal menus. * Source/NSMenuItemCell.m (-titleRectForBounds:, -imageRectForBounds:): Add a few more calls to [calcSize]. * Source/NSMenuItemCell.m (-drawTitleWithFrame:inView:): Remove setting of enable state. * Source/NSMenuItemCell.m (-drawInteriorWithFrame:inView:): Add call to separator drawing. Share more of the code between horizontal and vertical menus. * Source/NSMenuItemCell.m (-_keyEquivalentString): Determine string to display for key equivalent. Code by Nikolaus Schaller . 2007-01-25 Fred Kiefer * Source/NSButtonCell.m (-encodeWithCoder:, -initWithCoder:): Corrected coding and decoding of bezel style. * Source/GSTheme.m (-drawCircularBezel:withColor:, -drawRoundBezel:withColor:) New methods to draw bezel. Code by Nikolaus Schaller . * Source/GSTheme.m (-buttonBorderForStyle:state:, -drawButton:view:style:state:): Handle some of the bezel styles. 2007-01-24 Richard Frith-Macdonald * Headers/AppKit/NSButtonCell.h: Fix documentation error. * Headers/AppKit/NSMenu.h: Tidy a litte, fix errors in documentation markup, fix some documentation cross references. 2007-01-24 Stefan Bidigaray * Headers/AppKit/NSMenu.h: Add documentation (patch #5705). 2007-01-23 Fred Kiefer * Source/NSTableView.m (-selectAll:, -deselectAll:) Call [setNeedsDisplay:], if something was changed. 2007-01-23 Fred Kiefer * Headers/AppKit/NSBox.h: * Headers/AppKit/NSButtonCell.h: Add documentation for NSTitlePosition and NSButtonType. Patch by . * Source/GSTheme.m (-buttonBorderForStyle:state:): Removed unused variable. 2007-01-23 Fred Kiefer * Headers/Additions/GNUstepGUI/GSTheme.h, * Source/GSTheme.m (-buttonBorderForStyle:state:): New method to determine the button border size. * Headers/Additions/GNUstepGUI/GSTheme.h (-drawButton:...state:), * Source/GSTheme.m (-drawButton:view:style:state:): Don't return a result. * Source/NSCell.m (-drawInteriorWithFrame:inView:, -drawWithFrame:inView:): Bring drawing of focus ring inline with the one in NSButtonCell. * Headers/AppKit/NSButtonCell.h: Add MacOS 10.4 methods and additional ivars and changed enumerator values. * Source/NSButtonCell.m: Implemented new methods. * Source/NSButtonCell.m (-setButtonType:): Use new enumerator values. * Source/NSButtonCell.m (-_init): Use method call to set button type. * Source/NSButtonCell.m (-drawInteriorWithFrame:inView:, -drawWithFrame:inView:): Use new methods for the drawing. * Source/NSButtonCell.m (-cellSize, -drawingRectForBounds:): Use new theme method to determine border size. * Source/NSButtonCell.m (-encodeWithCoder:, -initWithCoder:): Encode/decode new and previously missing ivars. * Source/NSMenuItemCell.m (-drawingRectForBounds:): Moved old super class code to here. * Source/NSToolbarItem.m (GSToolbarButtonCell -drawImage:withFrame:inView:): Renamed method to match with superclass change and simplified implementation. 2007-01-23 Matt Rice * Source/NSWindow.m (-_lossOfKeyOrMainWindow): Use GSOrderedWindows. 2007-01-19 Sergii Stoian * Source/GSTheme.m (-drawButton:view:style:state:): Call [drawButton:withClip:] instead of [drawGreyBezel:withClip:] if state is highlighted (e.g. scroller buttons). 2007-01-19 Fred Kiefer * Source/NSPopUpButton.m (-keyDown:): Handle selection of first entry correctly. Patch by Phillipe Roussel 2007-01-19 Richard Frith-Macdonald * Source/NSDocument.m: fix include path (bug #18829) 2007-01-18 Adam Fedor * Source/NSBitmapImageRep+PNM.m ([NSBitmapImageRep -_initBitmapFromPNM:errorMessage:]): Check for invalid image size. 2007-01-18 Fred Kiefer * Source/NSCell.m (-setFloatingPointFormat:left:right:): Basic implementation. * Source/NSCell.m (-setUpFieldEditorAttributes:, _setupTextWithFrame:inView:editor:delegate:range:, endEditing:, editWithFrame:...event:, selectWithFrame:...length:): Changed to handle more text attributes and non-scrolling text. * Source/NSCell.m (-setScrollable:): If switched on, switch wraps off. * Headers/AppKit/NSCell.h: Corrected version number for some methods. * Headers/AppKit/NSControl.h: Add MacOS 10.4 methods. * Source/NSControl.m: Implement new MacOS 10.4 methods. * Source/NSControl.m (-mouseDown): Once more removed action mask fiddling. This time there is protection that the control itself does not go away. * Source/NSControl.m (-textDidBeginEditing:, -textDidChange:, -textDidEndEditing:): Extracted code to be shared between subclasses. * Source/NSTextField.m, * Source/NSTableView.m, * Source/NSMatrix.m (-textDidBeginEditing:, -textDidChange:, -textDidEndEditing:): Call shared super code. 2007-01-17 Fred Kiefer * Headers/AppKit/NSResponder.h: Add MacOS 10.4 methods. * Source/NSResponder.m: Implement new MacOS 10.4 methods. * Headers/AppKit/NSDocumentFrameworkPrivate.h: Remove. * Source/NSDocumentFrameworkPrivate.h: Add. * Source/GNUmakefile: Don't install NSDocumentFrameworkPrivate.h. * Headers/AppKit/NSDocument.h: Add MacOS 10.4 methods and additional ivars. Rename ivars to adopt to coding standards. * Source/NSDocument.m: Implement new MacOS 10.4 methods adopted to changes of ivar names. * Headers/AppKit/NSDocument.h: Add MacOS 10.4 methods and additional ivars. Rename ivars to adopt to coding standards. * Source/NSDocument.m: Adopt include of NSDocumentFrameworkPrivate.h. Implement new MacOS 10.4 methods and adopt to changes of ivar names. * Headers/AppKit/NSDocumentController.h: Add MacOS 10.4 methods and additional ivars. Rename ivars to adopt to coding standards. Fix includes. * Source/NSDocumentController.m: Adopt include of NSDocumentFrameworkPrivate.h. Implement new MacOS 10.4 methods and adopt to changes of ivar names. * Headers/AppKit/NSWindowController.h: Rename ivars to adopt to coding standards. * Source/NSWindowController.m: Adopt include of NSDocumentFrameworkPrivate.h. Adopt to changes of ivar names. * Headers/AppKit/NSPrintOperation.h: Add MacOS 10.4 methods and additional ivars. Rename ivars to adopt to coding standards. * Source/NSPrintOperation.m: Implement new MacOS 10.4 methods and adopt to changes of ivar names. * Source/GSPrintOperation.m, * Source/GSEPSPrintOperation.m, * Printing/GSLPR/GSLPRPrintOperation.m, * Printing/GSCUPS/GSCUPSPrintOperation.m: Adopt to changes in super class. * Headers/AppKit/NSCell.h: Add MacOS 10.4 methods and additional ivars. Store the state in two bits only. Rename ivar to adopt to coding standards. Move mnemonic_location into flags. * Source/NSCell.m: Implement new MacOS 10.3 and 10.4 methods and adopt to changes of ivar names. Add encoding and decoding of new ivars and improve keyed coding and decoding. * Headers/AppKit/NSColor.h: Adopt values of NSControlTint enumerator to Cocoa values. * Headers/AppKit/NSParagraphstyle.h: Add protection against double inclusion. * Source/GSServicemanager.m, * Source/NSAttributedString.m, * Source/NSView.m, * Source/NSApplication.m: Correct includes to avoid compiler warnings. 2007-01-14 Stefan Bidigaray * Source/NSWindow.m: * Source/NSBitmapImageRep.m: * Headers/AppKit/NSBitmapImageRep.h: * Headers/AppKit/NSApplication.h: * Headers/AppKit/NSView.h: Document various bits and pieces, mostly typedefs. 2007-01-13 Matt Rice * Source/NSMatrix.m (_selectCell:atRow:column:): Call setNextState when in Track or Highlight mode. (-keyDown:): Call -selectCellAtRow:column: in Track or Highlight mode. 2006-12-28 Matt Rice * Source/NSTextFieldCell.m (-drawInteriorWithFrame:): Draw disabled cell background with controlBackgroundColor. * Source/NSCell.m (-drawInteriorWithFrame:): Draw disabled cell text with disabledControlTextColor. * Source/NSSecureTextFieldCell (-drawInteriorWithFrame:): Draw disabled cell with controlBackgroundColor. * Source/NSTableView.m (rectOfColumn:): Use the height of the rows, not the bounds. 2006-12-27 Richard Frith-Macdonald * Headers/Additions/GNUstepGUI/GSTheme.h: Store images in dictionary. * Source/GSTheme.m: Improve handling of named images. * Source/NSButtonImageSource.[hm]: Partial implementation of classes to handle standard images in buttons (support theming etc). 2006-12-21 Fred Kiefer * Headers/AppKit/NSWindow.h Added missing delegate methods. * Source/NSResponder.m (-undoManager): Forward method to next responder. * Source/NSWindow.m (-undoManager): Try to get an undo manager from delegate or document. * Source/NSTextView.m (-shouldChangeTextInRange:replacementString:): Added basic support for undo. 2006-12-19 Fred Kiefer * Headers/AppKit/NSObjectController.h * Headers/AppKit/NSUserDefaultsController.h * Headers/AppKit/NSKeyValueBinding.h * Headers/AppKit/NSArrayController.h * Headers/AppKit/NSController.h * Source/NSObjectController.m * Source/NSUserDefaultsController.m * Source/NSArrayController.m * Source/NSController.m: New files added as basic support for controllers. Mostly not implemented. * Source/GNUmakefile * Source/externs.m: Add these new classes and helper variables. 2006-12-18 Saso Kiselkov * Source/NSAlert.m: Left align long alert messages. 2006-12-11 Adam Fedor * Documentation/manual/: File and node name fixes. 2006-12-09 Mark Tracy * Source/NSBitmapImageRep.m: Autogsdoc comments 2006-12-08 Richard Frith-Macdonald * Source/NSInputManager.m: Use help function key to enter context help mode rather than inserting it into the text. 2006-12-06 Matt Rice * Source/NSTextView.m: Don't update the selection when dragging a NSColorPboardType. 2006-12-03 Adam Fedor * Documentation/manual/: New AppKit manual. 2006-11-28 Mark Tracy Belated update to change log (these went in with svn revision 24140). * Source/externs.m: Added definitions for NSBitmapImage properties key strings * Source/tiff.m: Added implementation of NSTiffIsCodecConfigured(codec) * Source/ngimage-tiff.h: Added declaration of NSTiffIsCodecConfigured(codec) * Source/NSBitmapImageRep+GIF.h: Added declaration of _GIFRepresentationWithProperties:errorMessage: * Source/NSBitmapImage+GIF.m: Added implementation of _GIFRepresentationWithProperties:errorMessage: and static int gs_gif_output(*file, *buffer, len) * Source/NSBitmapImage+GIF.m (_initBitmapFromGIF:errorMessage:): Changed loop to terminate after the first image block is found. Added parsing of graphic control blocks to support transparency. If transparency is found, adds an alpha channel. Saves the color table in _properties. * Source/NSBitmapImage+PNG.h: Added declaration of _PNGRepresentationWithProperties: * Source/NSBitmapImage+PNG.m: Added implementation of _PNGRepresentationWithProperties: and static void writer_func(png_struct, data, length) * Source/NSBitmapImage+PNG.m: (_initBitmapFromPNG:): Added experimental support for the property NSImageGamma * Source/NSBitmapImage+JPEG.h: Replaced declaration of representationUsingType:properties with declaration of _JPEGRepresentationWithProperties:errorMessage: and removed category (JPEGWriting) * Source/NSBitmapImage+JPEG.m: Renamed representationUsingType:properties as _JPEGRepresentationWithProperties:errorMessage: and reworked it significantly to support alpha stripping, error messages, and NSImageProgressive property. NSImageCompressionFactor now is 0-255 instead of 100-0 quality factor. Returns a real error message instead of crashing. * Source/NSBitmapImage+JPEG.m: (_initBitmapFromJPEG:errorMessage:) Added support for NSImageProgressive property. * Headers/AppKit/NSBitmapImageRep.h: Added extern declarations for the properties key strings. Added declaration for NSMutableDictionary * _properties. Added NSImageJPEG2000FileType to the NSImageFileType enum. * Source/NSBitmapImageRep.m: (canCompressUsing:): Changed to use the new NSTiffIsCodecConfigured(codec) instead of a static list. * Source/NSBitmapImageRep.m: (getTIFFCompressionTypes:count:): Changed to use the new NSTiffIsCodecConfigures(codec) instead of a static list. * Source/NSBitmapImageRep.m: (_localFromCompressionType:): Changed from an instance method to a class method. * Source/NSBitmapImageRep.m: (_CompressionTypeFromLocal:): Changed from an instance method to a class method. * Source/NSBitmapImageRep.m: (TIFFRepresentationUsingCompression:factor:): Changed to use new implementation of _localFromCompressionType: * Source/NSBitmapImageRep.m: (initFromTIFFImage:number:): Changed to use new implementation of _CompressionTypeFromLocal: and added support for NSImageCompressionMethod and NSImageCompressionFactor properties * Source/NSBitmapImageRep.m: (initWithBitmapDataPlanes:pixelsWide: pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar: colorSpaceName:bytesPerRow:bitsPerPixel:): Changed to initialize _properties dictionary * Source/NSBitmapImageRep.m: (dealloc:): Changed to release _properties * Source/NSBitmapImageRep.m: (setProperty:withValue:) Implemented functional code in place of TODO: * Source/NSBitmapImageRep.m: (valueForProperty:) Implemented functional code in place of TODO: * Source/NSBitmapImageRep.m: (representationUsingType:properties:): Implemented working code in place of TODO: It supports writing PNG, TIFF, GIF and JPEG, with stubs for BMP and JPEG-2000. * Source/NSBigmapImageRep.m: (representationOfImageRepsInArray: usingType:properties:): Incomplete implementation in place of TODO: 2006-11-24 Matt Rice * Source/NSWindowController.m (_windowDidLoad:): Pass an NSZeroPoint to cascadeTopLeftFromPoint: on the first call. 2006-11-23 Matt Rice * Source/NSTableView.m (_trackCellAtColumn:row:withEvent:): Remove check for column editablity. 2006-11-21 Matt Rice * Source/NSWindow.m (sendEvent:): Fix dragging for views which accept dragging with subviews which accept dragging. 2006-11-20 Matt Rice * Source/NSTextView_actions.m: Change cursor movement implementations when collapsing a selection. * Source/NSParagraphStyle.m (-setBaseWritingDirection:): Add comment. * Source/NSAttributedString: Add and remove characters in the word break character set. * KeyBindings/DefaultKeyBindings.dict: Change control-f and control-b to moveForward: and moveBackward: 2006-11-19 Richard Frith-Macdonald * Source/NSAffineTransform.m: * Headers/AppKit/NSAffineTransform.h: Remove basic implementation (now in base for MacOS-X compatibility) retaining gui specific methods and GNUstep extensions (to deprecate?) * Source/NSImage.m: * Source/NSStringDrawing.m: * Source/NSView.m: Update to use transformStruct accessor method rather than trying to work with the affine transform ivars directly. 2006-11-18 Richard Frith-Macdonald * Source/NSScrollView.m: Adjust corner view when scroller is on right. 2006-11-17 Richard Frith-Macdonald * Source/GSTheme.m: * Source/NSButtonCell.m: * Source/NSScrollView.m: * Headers/Additions/GNUstepGUI/GSTheme.h: Merge in theme changes for scrollviews and cleaner button drawing api. 2006-11-16 Adam Fedor * Model/GMAppKit.m ([NSImage +createObjectForModelUnarchiver:]): Allow loading of images from the owners bundle (patch from Georg Fleischmann. 2006-11-15 Nicola Pero Notice: you should now use 'make DESTDIR=/tmp/xxx install' if you want to relocate all the installation into /tmp/xxx/ * Makefile.postamble: Use DESTDIR instead of INSTALL_ROOT_DIR everywhere. * ColorPickers/GNUmakefile: (GNUSTEP_INSTALLATION_DOMAIN): Use GNUSTEP_INSTALLATION_DOMAIN instead of GNUSTEP_INSTALLATION_DIR. * Documentation/GNUmakefile: Same change. * Documentation/General/GNUmakefile: Same change. * Documentation/GuiUser/GNUmakefile: Same change. * Images/GNUmakefile: Same change. * Model/GNUmakefile: Same change. * Panels/GNUmakefile: Same change. * PrinterTypes/GNUmakefile: Same change. * Resources/GNUmakefile: Same change. * Source/GNUmakefile: Same change. * Tools/GNUmakefile: Same change. * Tools/gsnd/GNUmakefile: Same change. * Printing/GSLPR/GNUmakefile (GNUSTEP_INSTALLATION_DOMAIN): Same change, plus set GNUSTEP_INSTALLATION_DOMAIN before common.make and not after. * Panels/GNUmakefile.postamble: Fixed all install/uninstall targets that were failing to create the install directories properly. Also, added ECHO macros so that 'make messages=yes' works properly. 2006-11-12 Matt Rice * Source/NSTableView.m (-noteNumberOfRowsChanged:): Post selection is and did change notifications if changing the selected rows. * Source/NSSliderCell.m (-copyWithZone:): Make a little clearer. * Source/NSMatrix.m (-_rebuildLayoutAfterResize): Don't change the intercell spacing if not autosizing cells. 2006-11-11 Matt Rice * Source/NSSliderCell.m: Implement copyWithZone:. 2006-11-10 Matt Rice * Source/NSOutlineView.m: Handle rowAtPoint: returning -1. * Source/NSTableView.m (drawRect:): Only call -highlightSelectionInClipRect: and -drawGridInClipRect: once. (-drawGridInClipRect:): Constrain the vertical grid line to the last row drawn in the rect. 2006-11-10 Matt Rice * Source/NSTableView.m (rowAtPoint:): Return -1 if the point is under the last row. (mouseDown:): Handle rowAtPoint: returning -1. (rectOfRows:): Ditto. 2006-11-10 Matt Rice * Source/NSTableView.m (mouseDown:): Rename some local variables to be less ambiguous. 2006-11-10 Matt Rice * Headers/AppKit/NSTableView.h: Add ivar for verticalMotionCanBeginDrag. * Source/NSTableView.m: Implement verticalMotionCanBeginDrag bump class version. * Source/NSTextView_actions.m: Fix method name from previous changes. * KeyBindings/DefaultKeyBindings.dict: Add new key bindings. * ChangeLog: Add to description of a previous change. 2006-11-09 Matt Rice * Source/NSTableView.m (selectContiguousRegion): Remove usage of offsets. 2006-11-08 Matt Rice * Source/NSTableView.m: Implement keyboard navigation/selection. Fixes bug #11942. (-selectRow:byExtendingSelection:): Update _clickedRow. (-mouseDown:): Ditto. * Source/NSSlider.m (keyDown:): Call supers implementation if we don't use the key stroke. 2006-11-07 Matt Rice * Source/NSTableView.m: Whitespace changes to conform to coding standards. 2006-11-07 Matt Rice * Source/NSTableView.m (-mouseDown): Only call editWithFrame: from a double click. Don't track cells from a mouse dragged. Add comments. 2006-11-06 Matt Rice * Source/NSTextView_actions.m: Fix keyboard movement scrolling when selecting text off the bottom or right of the visible area. 2006-11-06 Matt Rice * Source/NSTextView_actions.m: Remove hack from previous patch. 2006-11-06 Richard Frith-Macdonald * Source/GSDisplayServer.m: Improve documentation of window ordering * Source/NSWindow.m: ditto * Source/NSApplication.m: Fix minor bug with cleanup on termination when the appicon was suppressed. * Source/NSAttributedString.m: * Source/NSClipView.m: * Source/NSApplication.m: * Source/NSImage.m: * Headers/AppKit/NSSound.h: * Headers/AppKit/NSTextAttachment.h: * Headers/AppKit/NSPopUpButtonCell.h: * Headers/AppKit/NSPanel.h: * Headers/AppKit/NSTableHeaderCell.h: * Headers/AppKit/NSSpellServer.h: * Headers/AppKit/NSAlert.h: * Headers/AppKit/NSColorList.h: * Headers/AppKit/NSWindowController.h: * Headers/AppKit/NSScreen.h: * Headers/AppKit/NSOpenPanel.h: * Headers/AppKit/NSSliderCell.h: * Headers/AppKit/NSImageCell.h: * Headers/AppKit/NSAffineTransform.h: * Headers/AppKit/NSText.h: * Headers/AppKit/AppKitDefines.h: * Headers/AppKit/NSParagraphStyle.h: * Headers/AppKit/NSBox.h: * Headers/AppKit/AppKitExceptions.h: * Headers/AppKit/NSTableHeaderView.h: * Headers/AppKit/NSAttributedString.h: * Headers/AppKit/NSWorkspace.h: * Headers/AppKit/NSPopUpButton.h: * Headers/AppKit/NSFontManager.h: * Headers/AppKit/NSFormCell.h: * Headers/AppKit/NSMenu.h: * Headers/AppKit/NSMatrix.h: * Headers/AppKit/NSWindow.h: * Headers/AppKit/NSLayoutManager.h: * Headers/AppKit/NSButtonCell.h: * Headers/AppKit/NSColorPicker.h: * Headers/AppKit/NSActionCell.h: * Headers/AppKit/NSImageView.h: * Headers/AppKit/NSOpenGLView.h: * Headers/AppKit/NSDataLinkManager.h: * Headers/AppKit/NSClipView.h: * Headers/AppKit/NSSplitView.h: * Headers/AppKit/NSBitmapImageRep.h: * Headers/AppKit/NSInputServer.h: * Headers/AppKit/NSTextFieldCell.h: * Headers/AppKit/NSImageRep.h: * Headers/AppKit/NSBezierPath.h: * Headers/AppKit/NSGraphics.h: * Headers/AppKit/NSResponder.h: * Headers/AppKit/NSColorWell.h: * Headers/AppKit/NSApplication.h: * Headers/AppKit/NSForm.h: * Headers/AppKit/NSWindow+Toolbar.h: * Headers/AppKit/NSTableColumn.h: * Headers/AppKit/NSNib.h: * Headers/AppKit/NSComboBox.h: * Headers/AppKit/NSMovieView.h: * Headers/AppKit/NSButton.h: * Headers/AppKit/NSSavePanel.h: * Headers/AppKit/NSColor.h: * Headers/AppKit/NSMovie.h: * Headers/AppKit/NSCachedImageRep.h: * Headers/AppKit/NSStepper.h: * Headers/AppKit/NSPrinter.h: * Headers/AppKit/NSHelpManager.h: * Headers/AppKit/NSMenuItemCell.h: * Headers/AppKit/NSPasteboard.h: * Headers/AppKit/DPSOperators.h: * Headers/AppKit/AppKit.h: * Headers/AppKit/NSTextContainer.h: * Headers/AppKit/NSNibDeclarations.h: * Headers/AppKit/NSToolbar.h: * Headers/AppKit/NSSearchFieldCell.h: * Headers/AppKit/NSCursor.h: * Headers/AppKit/NSPrintOperation.h: * Headers/AppKit/NSControl.h: * Headers/AppKit/NSInterfaceStyle.h: * Headers/AppKit/NSMenuItem.h: * Headers/AppKit/NSScroller.h: * Headers/AppKit/NSDocumentFrameworkPrivate.h: * Headers/AppKit/NSInputManager.h: * Headers/AppKit/NSRulerMarker.h: * Headers/AppKit/NSProgressIndicator.h: * Headers/AppKit/NSGraphicsContext.h: * Headers/AppKit/NSFont.h: * Headers/AppKit/NSTextStorage.h: * Headers/AppKit/NSSearchField.h: * Headers/AppKit/NSOutlineView.h: * Headers/AppKit/NSPageLayout.h: * Headers/AppKit/NSTextView.h: * Headers/AppKit/NSFileWrapper.h: * Headers/AppKit/NSTabViewItem.h: * Headers/AppKit/PSOperators.h: * Headers/AppKit/NSDragging.h: * Headers/AppKit/NSDocumentController.h: * Headers/AppKit/NSColorPicking.h: * Headers/AppKit/NSDrawer.h: * Headers/AppKit/NSCustomImageRep.h: * Headers/AppKit/NSRulerView.h: * Headers/AppKit/NSMenuView.h: * Headers/AppKit/NSSecureTextField.h: * Headers/AppKit/NSNibLoading.h: * Headers/AppKit/NSHelpPanel.h: * Headers/AppKit/NSComboBoxCell.h: * Headers/AppKit/NSToolbarItem.h: * Headers/AppKit/NSImage.h: * Headers/AppKit/NSSlider.h: * Headers/AppKit/NSStepperCell.h: * Headers/AppKit/NSStringDrawing.h: * Headers/AppKit/NSOpenGL.h: * Headers/AppKit/NSDataLink.h: * Headers/AppKit/NSScrollView.h: * Headers/AppKit/NSColorPanel.h: * Headers/AppKit/NSEPSImageRep.h: * Headers/AppKit/NSSpellProtocol.h: * Headers/AppKit/NSTabView.h: * Headers/AppKit/NSDataLinkPanel.h: * Headers/AppKit/NSPrintInfo.h: * Headers/AppKit/NSUserInterfaceValidation.h: * Headers/AppKit/NSPrintPanel.h: * Headers/AppKit/NSCell.h: * Headers/AppKit/NSEvent.h: * Headers/AppKit/NSTableView.h: * Headers/AppKit/NSBrowserCell.h: * Headers/AppKit/NSNibConnector.h: * Headers/AppKit/NSSelection.h: * Headers/AppKit/NSTextField.h: * Headers/AppKit/NSSpellChecker.h: * Headers/AppKit/NSView.h: * Headers/AppKit/NSDocument.h: * Headers/AppKit/NSBrowser.h: * Headers/AppKit/NSFontPanel.h: * Headers/Additions/GNUstepGUI/GSTable.h: Update to use current version macros and fix a few documentation errors. 2006-11-06 Matt Rice * Source/NSTextView_actions.m: Implement some undocumented key binding actions. 2006-11-06 Matt Rice * Source/NSTextView_actions.m: * Source/NSOpenPanel.m: * Source/GSLayoutManager.m: * Source/NSLayoutManager.m: * Source/NSSavePanel.m: * Source/NSTextView.m: * Source/NSStringDrawing.m: * Headers/Additions/GNUstepGUI/GSLayoutManager_internal.h: * Headers/AppKit/NSTextView.h: Remove underscores from category names as they can confuse the debugger. 2006-11-05 Matt Rice * Source/NSSlider.m (-keyDown:): Implement, Fixes bug #14000. * Source/NSSliderCell.m (-trackMouse:...): Fix allows tick marks only mouse tracking. 2006-11-05 Matt Rice * Source/NSColorPanel.m: Implement -worksWhenModal:. Fixes bug #9417. 2006-11-02 Matt Rice * Source/NSTableView (_editNextCellAfterRow:inColumn:): Wrap around when number of rows is exceeded. 2006-11-02 Richard Frith-Macdonald * Source/GSTheme.m: * Source/GSInfoPanel.m: Merge in changes from theme branch... Support tiling when drawing button cells. Make theme panel link visible, as someone suggested that having it totally hidden was not so good. Perhaps make it more explicit in future? 2006-11-01 Matt Rice * Source/NSTableView.m: (-editColumn:row:withEvent:select:): Raise when passed an unselected row. (-textDidEndEditing:): Handle NSReturnTextMovement. (_editNextCellAfterRow:inColumn:): New private method. 2006-11-01 Matt Rice * Source/NSTableView.m: Add new private methods. (-mouseDown:): Reorganize and don't track cells until dragging has been ruled out. * Source/NSCell.m (trackMouse:inRect:ofView:untilMouseUp:): Handle events no longer in the queue. * Source/GSDragView.m: Change NSLog to NSDebugLLog. 2006-10-31 Matt Rice * Tools/gopen.m * Source/NSView.m * Source/GSPDFPrintOperation.m * Source/NSHelpManager.m * Source/GSHelpManagerPanel.m: Add missing includes. 2006-10-31 Richard Frith-Macdonald * Source/NSWorkspace.m: add missing include 2006-10-30 Matt Rice * Source/NSComboBoxCell.m (validateSelection): Test for invalid row. 2006-10-28 Adam Fedor * Source/NSApplication.m (initialize_gnustep_backend): Use GSBackend class directly when backend is compiled as a library. (Partial fix for Bug #16453, see also gnustep-back). 2006-10-27 Matt Rice * Source/NSAlert.m: Add GSRunExceptionPanel function and GSExceptionPanel class. * Headers/AppKit/NSPanel.h: Declare GSRunExceptionPanel. * Source/NSApplication.m (_NSAppKitUncaughtExceptionHandler): Use GSRunExceptionPanel. 2006-10-27 Matt Rice * Source/NSTableView.m (-setFrame:,-setFrameSize:): Use documentVisibleRect. Shrink if table is larger than needed height. fixes bug #18117. (-drawBackgroundInClipRect:): Draw the background. * Source/NSClipView.m (-documentVisibleRect:): Return the clip views visible rect converted to the document views coordinate system. 2006-10-24 Matt Rice * Source/NSApplication.m (NSAppIcon -mouseDown:): Call unhide: regardless of whether we're hidden or not. 2006-10-22 Matt Rice * Source/NSTableView.m (-mouseDown:): Check for empty selection. when adding to the current selection. Fixes bug #15261. 2006-10-21 Matt Rice * Headers/AppKit/NSGraphics.h: Add GSOrderedWindows function. * Source/NSApplication.m (NSAppIconView -mouseDown:): Use GSOrderedWindows. (NSApplication -deactivate): Ditto. (-hide:): Ditto. (-unhideWithoutActivation:): Ditto. (-makeWindowsPerform:inOrder): Ditto. (-orderedWindows:): Ditto. (-windowWillClose:): Ditto. * Source/GSDisplayServer.m: Implement -windowlist. * Source/NSWindow.m (NSCountWindowList,NSWindowList): Use -windowlist. (GSOrderedWindows): Initial implementation. 2006-10-21 11:30-EDT Matt Rice * Source/NSTableView.m: If the tableview is smaller than it's clipview, then resize it so that it fits. Corrects bug#9608 and bug#18073. Patch committed by: Gregory Casamento 2006-10-19 21:17-EDT Gregory John Casamento * Source/NSMenuItemCell.m: Correct menu highlighting issue found by applying changes suggested by Jeff Teunissen. This change causes the menu to use the correct text color when highlighted. (minor change) 2006-10-19 Richard Frith-Macdonald * Headers/Additions/GNUstepGUI/GSTheme.h: * Source/GSTheme.m: Have tile filling method return rect of central tile area. * Source/NSView.m: Fixup indentation problems. 2006-10-19 01:45-EDT Gregory John Casamento * Source/NSView.m: Applied patch from Banlu Kemiyatorn. Corrects issue with detection of events in a rotated view. 2006-10-16 20:53-EDT Gregory John Casamento * Source/NSFont.m: Apply slightly modified version of patch from Jeff Teunissen deek@d2dc.net to setNSFont(). Setting a font should set its size. (minor change) * Source/NSImage.m: Set the alpha on the background when printing. 2006-10-15 11:23-EDT Mark Tracy * Source/NSPageLayout.m: NSPageLayout was setting a default page scale of 100 cause: pageScale factor is displayed as percentage fix: pageScale*100 sent to textfield and textfield/100 stored in pageScale. NSPageLayout had different limits on scaling than NSPrintPanel fix: adjust formatter max. * Source/NSPrintOperation.m: NSPrintOperation would loop randomly if a custom view replies YES to -knowsPageRange cause: -_printPaginateWithInfo did not initialize info->pageScale, info->xpages, info->ypages fix: in -_printPaginateWithInfo set default pageScale=1.0 outside conditional fix: in -_print set xpages and ypages from viewPageRange as reported by custom view. * Source/NSView.m: -beginDocument was misplacing subviews when generating PostScript for printing fix: force regeneration of coordinates. Patch Applied by Gregory Casamento 2006-10-15 Richard Frith-Macdonald * Source/NSBrowser.m: * Source/NSSound.m: * Source/NSTextAttachment.m: * Source/NSPopUpButtonCell.m: * Source/NSPanel.m: * Source/NSImageCell.m: * Source/NSSliderCell.m: * Source/GSGormLoader.m: * Source/NSParagraphStyle.m: * Source/NSFormCell.m: * Source/NSMenu.m: * Source/NSWindow.m: * Source/NSButtonCell.m: * Source/NSImageView.m: * Source/NSActionCell.m: * Source/NSDataLinkManager.m: * Source/NSClipView.m: * Source/NSBitmapImageRep.m: * Source/NSTextFieldCell.m: * Source/NSColorWell.m: * Source/GSTextStorage.m: * Source/NSApplication.m: * Source/NSTableColumn.m: * Source/GSVbox.m: * Source/NSNib.m: * Source/NSCachedImageRep.m: * Source/NSPrinter.m: * Source/NSTextContainer.m: * Source/GSNibLoader.m: * Source/GSNibCompatibility.m: * Source/GSTrackingRect.m: * Source/NSSearchFieldCell.m: * Source/NSControl.m: * Source/GSHbox.m: * Source/NSProgressIndicator.m: * Source/GSModelLoaderFactory.m: * Source/NSTextStorage.m: * Source/NSTextView.m: * Source/NSDocumentController.m: * Source/NSMenuView.m: * Source/NSSecureTextField.m: * Source/NSComboBoxCell.m: * Source/NSImage.m: * Source/NSStepperCell.m: * Source/NSDataLink.m: * Source/NSScrollView.m: * Source/NSBundleAdditions.m: * Source/NSCell.m: * Source/GSTable.m: * Source/NSTableView.m: * Source/NSBrowserCell.m: * Source/NSSelection.m: * Source/NSTextField.m: * Source/NSView.m: * Source/NSDocument.m: Fixup some minor coding standard violations ... add white space. * Headers/Additions/GNUstepGUI/GSTheme.h: * Source/GSTheme.m: Add control for caching of tiles. Add another fill style for tiling. Make fill style names avoid possible name clashes by using GS prefix. 2006-10-12 Richard Frith-Macdonald * Source/NSImageView.m: Fix error in initial drag position. * Source/GSTheme.m: Improve display of current theme information. 2006-10-11 Nicola Pero * GNUmakefile (GNUSTEP_INSTALLATION_DOMAIN): Use GNUSTEP_INSTALLATION_DOMAIN instead of GNUSTEP_INSTALLATION_DIR. 2006-10-09 Richard Frith-Macdonald * Documentation/GuiAdditions.gsdoc: * Documentation/Gui.gsdoc: * Documentation/GuiUser/KeyboardSetup.gsdoc: * Documentation/GuiUser/LanguageSetup.gsdoc: * Documentation/GuiUser/DefaultsSummary.gsdoc: * Documentation/ReleaseNotes.gsdoc: * Documentation/General/OpenStepCompliance.gsdoc: Update dtd version 2006-10-08 23:47-EDT Gregory John Casamento * Images/GNUmakefile: Copy GSStop.tiff and GSSearch.tiff to the installation directory. They were previously missing. 2006-10-07 10:20-EDT Gregory John Casamento * Source/GSNibCompatibility.m: Implement init in NSIBHelpConnector. 2006-10-07 10:13-EDT Gregory John Casamento * Source/GSNibCompatibility.m: Implement establishConnection in NSIBHelpConnector. 2006-10-07 10:02-EDT Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibCompatibility.h: Declaration for NSIBHelpConnector ivars and methods. * Source/GSNibCompatibility.m: Implemented NSIBHelpConnector. * Source/NSBundleAdditions.m: Added check to initWithCoder so that values aren't decoded, if there's no value in the coder. 2006-10-06 Richard Frith-Macdonald * Source/GSTrackingRect.m: Allow reset rect to another value. * Source/GSToolTips.m: Improve handling of tips in rects other than the main one. 2006-10-06 Richard Frith-Macdonald * Source/GSToolTips.h: Remove some ivars * Source/GSToolTips.m: Move ivars to be static variables for common use by all tool tips. Cancel an in-progress tooltip when a new one starts. 2006-10-04 Richard Frith-Macdonald * Source/GSToolTips.h: create tool tip wondow fully on screen * Source/GSToolTips.m: ditto * Source/NSView.m: very minor tooltip efficiency tweak. * Version: Bump to 0.12 for next 2006-10-04 Enrico Sersale * Source/NSView.m: In -setToolTip: sets the has_tooltips flag. 2006-10-04 Richard Frith-Macdonald * Source/NSWindow.m: Add help key support for context help. * NSToolbarItem.m: Implement tool tips. * GSToolTips.m: Use correct font. 2006-10-02 20:41-EDT Gregory John Casamento * Resources/Esperanto.lproj/Localizable.strings * Resources/German.lproj/Localizable.strings * Resources/Italian.lproj/Localizable.strings * Resources/Lojban.lproj/Localizable.strings: Correct grammar in localization bundles as well. 2006-10-02 Richard Frith-Macdonald * Source/GNUmakefile: Add GSToolTips.[hm] * Source/NSWindow.m: Add private tooltip functionality. * Source/GSToolTips.h: Interface to let views and windows handle tips. * Source/GSToolTips.m: ToolTip implementation ... main part. * Source/NSView.m: Use GSToolTips to implement tool tips. * Headers/AppKit/NSResponder.h: Add a flag for views with tool tips. Basic implementation of tool tip help. 2006-10-02 Nicola Pero * configure.ac: Check the new variable GNUSTEP_IS_FLATTENED, and default to yes. * configure: Regenerated. * Source/GSTheme.m: Worked arond a compiler bug that would abort compilation on GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7). Avoid [NSMutableSet set] as the compiler is confusing +(id)set with -(void)set. 2006-10-02 08:19-EDT Gregory John Casamento * Source/NSDocumentController.m: Correct grammar in reviewUnsavedDocumentsWithAlertTitle:... "Quit Anyways" should be "Quit Anyway". 2006-10-01 Richard Frith-Macdonald * Source/GSTrackingRect.m: * Source/NSView.m: * Headers/AppKit/NSView.h: Fix tracking rect bug ... the owner of the rectangle should not be retained by a tracking rect (but should be retained by a cursor rect). Updated documentation to clearly state what mis retained. 2006-10-01 Richard Frith-Macdonald * Source/GSTheme.m: Add rudimentary inspector. Make themes in panel be in alphabetical order except for the default theme (always first in the list). Allow setting of default theme for application. * Source/NSHelpManager.m: Implement context help cursor. * Source/NSHelpPanel.m: Implement simple fallback help panel display for systems where no rtf/rtfd viewing application is installed. * Source/NSResponder.m: Tweak context help * Source/NSCursor.m: tidied a little * Images/GNUmakefile: Install context help cursor * Images/common_HelpCursor.tiff: add context help cursor 2006-09-30 Richard Frith-Macdonald * Source/NSColor.m: Remove debug log message. * Source/GSInfoPanel.m: Open theme handling panel. * Source/GSTheme.m: Rudimentary theme handling panel. * Headers/Additions/GNUstepGUI/GSTheme.h: A few more methods. Start adding a panel to allow selection of themes in a running app. 2006-09-29 Richard Frith-Macdonald * Source/NSWindow.m: If ordering out a deferred window which was never ordered in, there is nothing to do. * Source/NSMenu.m: (_organize) when switching from horizontal to vertical menu, attempt to restore contents fo the app menu to the main menu in a reasonable manner. * Source/NSHelpManager.m: Use the help file specified in Info.plist * Headers/Additions/GNUstepGUI/GSTheme.h: * Source/GSTheme.m: Add -authors and -icon methods. Support loading from an absolute path. 2006-09-28 Richard Frith-Macdonald * Source/GSTheme.m: Update main menu on theme activation. * Source/NSMenu.m: ([setMain:]) handle change of interface style. * Source/NSInterfaceStyle.m: Observe/handle theme activation. * Headers/AppKit/NSMenu.h: remove internal method from public header * Headers/Additions/GNUstepGUI/GSTheme.h: add -infoDictionary method and documentation. 2006-09-26 Richard Frith-Macdonald * Source/NSWorkspace.m: Use png in preference to tiff. * Source/NSMenu.m: Remove unused extension from icon names. * Source/NSSplitView.m: ditto * Source/NSOutlineView.m: ditto * Source/NSTabView.m: ditto 2006-09-25 Matt Rice * Source/NSTableView.m (_shouldEditTableColumn:row:): Dont invert delegate return value. 2006-09-24 Richard Frith-Macdonald * Headers/Additions/GNUstepGUI/GSDisplayServer.h: * Source/GSDisplayServer.m: Revert unnecessary addition to api * Source/NSWindow.m: Use ([flushwindowrect::]) for expose events. * Source/GSDragView.m: Don't drop expose events. 2006-09-23 Matt Rice * Source/NSTableView.m (_isCellEditableColumn:row:): Allow delegate to limit editablility of editable columns. 2006-09-23 Richard Frith-Macdonald * Source/GSWindowDecorationView.m: comment out dubious change. * Source/GSDisplayServer.m: Add method for expose events * Source/NSWindow.m: Handle expose events. * Headers/AppKit/NSEvent.h: Add expose event type. * Headers/Additions/GNUstepGUI/GSDisplayServer.h: Add method for expose events. 2006-09-22 Richard Frith-Macdonald * Headers/AppKit/NSColorList.h: Add documentation. * Source/NSColorList.m: Fix ([-writeToFile:]) to work as specified by Apple's documentation. 2006-09-22 Richard Frith-Macdonald * Headers/Additions/GNUstepGUI/GSDrawFunctions.h: * Headers/Additions/GNUstepGUI/GSTheme.h: * Source/GSDrawFunctions.m: * Source/GSTheme.m: Renamed file. * Source/NSBrowser.m: * Source/NSTableHeaderCell.m: * Source/GSWindowDecorationView.m: * Source/NSImageCell.m: * Source/NSBox.m: * Source/GNUmakefile: * Source/NSFormCell.m: * Source/NSButtonCell.m: * Source/NSColorWell.m: * Source/NSColor.m: * Source/NSMenuItemCell.m: * Source/GSTitleView.m: * Source/NSProgressIndicator.m: * Source/DocMakefile: * Source/NSComboBoxCell.m: * Source/NSStepperCell.m: * Source/NSScrollView.m: * Source/NSTabView.m: * Source/NSCell.m: * Source/NSTableView.m: * Documentation/GuiAdditions.gsdoc: Update for rename of 'GSDrawFunctions to GSTheme. Change all class based access to drawing methods to go via current instance. Remove all class based versions of drawing methods. 2006-09-22 Richard Frith-Macdonald * Source/GSWindowDecorationView.m: Merge in theme branch changes. * Source/NSColorList.m: Cooperate with NSColor to change system color list when a new theme is activated. * Source/GSDrawFunctions.m: Merge in theme branch changes. Reorganize, add theme loading functionality, add image tiling methods. * Source/NSButtonCell.m: Merge in theme branch changes. * Source/NSColor.m: Take notice of themes changing the system color list and interface with NSColorList to make the chanes and then send out the notification to tell all observers. * Source/GSTitleView.m: call instance method rather than class method * Source/DocMakefile: Document theme changes * Source/NSTabView.m: call instance method rather than class method * Documentation/GuiAdditions.gsdoc: link to theme documentation * Documentation/General/GNUmakefile: make theme documentation * Headers/AppKit/NSWindow.h: improve comments * Headers/Additions/GNUstepGUI/GSDrawFunctions.h: reorganize 2006-09-21 Matt Rice * Source/NSTextFieldCell.m (-setEnabled:): Revert previous patch. 2006-09-20 Matt Rice * Source/NSTextField.m (-mouseDown:): Check if the control is disabled. (bug #13916) (-acceptFirstResponder:): Return no if disabled. (-acceptFirstMouse:): Ditto. * Source/NSTextFieldCell.m (-setEnabled:): Reset the string value to an empty string if disabling. 2006-09-20 Richard Frith-Macdonald * Source/GSWindowDecorationView.m: ([removeSubview:]) override to check for removal of the window's content view and handle that case so that the window knows the content view has gone. 2006-09-17 Matt Rice * Source/NSDocument.m (-initWithContentsOfFile:ofType:): Set the file name and type before attempting to read the document. 2006-09-17 Fred Kiefer * Source/NSTableView.m (-_isCellEditableColumn:row:): Correced error in last patch, pointed out by David Ayers . 2006-09-17 Fred Kiefer * Images/GSSearch.tiff, * Images/GSStop.tiff: New icons for the NSSearchButtonCell by Nikolaus Schaller . 2006-09-17 Fred Kiefer * Source/NSTableView.m: Changed _isCellEditable into a method [_isCellEditableColumn:row:] and use this everywhere. Have this new method check, if the table column is editable and only when not ask the delegate wether the cell should be editable. The matches the Cocoa behaviour as reported by Quentin Mathe . * Source/NSTableView.m (-editColumn:row:withEvent:select:): Allow selection of cell, even when the data source is not editable. * Source/NSTableView.m (-mouseDown:): Abort editing. * Source/NSOutlineView.m (-editColumn:row:withEvent:select:): Similar changes to super class, plus some code reordering and correction. 2006-09-16 Richard Frith-Macdonald * Source/NSColor.m: Fix memory leak (bug #17769) 2006-09-13 00:28-EDT Gregory John Casamento * Headers/AppKit/NSDrawer.h: Added ivars to support implementation. * Source/GSNibCompatibility.m: Moved comments to top, for gcc < 3.0 compilation. * Source/NSDrawer.m: Added GSDrawerWindow implementation and implementation of some methods in NSDrawer to interact with the window. 2006-09-12 Richard Frith-Macdonald * Source/GSWindowDecorationView.m: Simplify/rewrite to have the view always match the window frame so that the window base coordinate system has its origin at the bottom left corner of the window frame. * Headers/AppKit/NSWindow.h: Improve documentation * Headers/Additions/GNUstepGUI/GSDisplayServer.h: ditto 2006-09-06 Richard Frith-Macdonald * Headers/AppKit/NSWindow.h: Add some documentation about what frame management methods should do. Remove some bogus additional methods for messing with frames. * Source/NSWindow.m: ([cascadeTopLeftFromPoint:]) implement to match MacOS-X specification. Remove unused additional frame methods. * Source/GSWindowDecorationView.h: * Source/GSWindowDecorationView.m: * Source/GSStandardWindowDecorationView.m: Remove unused/unnecessary methods and simplify. NB. These fixups require corresponding fixups in the backend. 2006-09-05 Richard Frith-Macdonald * Source/NSBitmapImageRep+JPEG.m: Fix declaration position causing compile failure on older compilers. Make more consistent with coding (indentation and white space usage) standards. 2006-09-04 00:23 Nicolas Roard * Source/NSBitmapImageRep+JPEG.m: Added JPEG writing support to NSBitmapImageRep. Only handles RGB images (NS*RGBColorSpace). You can specify the compression ratio by using the NSImageCompressionFactor key in the properties dictionary. 2006-09-03 12:12-EDT Gregory John Casamento * Source/GSStandardWindowDecorationView.m: Put back RELEASE to prevent memory leak. * Source/NSControl.m: Reverted last change. * Source/NSWindow.m: Added autogsdoc comments to methods. 2006-08-31 00:21-EDT Gregory John Casamento * Source/GSStandardWindowDecorationView.m: Correct issue in initWithFrame:window: that was causing a crash when the window was closed. * Source/NSControl.m: Reinstated fix from Fred Kiefer for mouseDown: simplification and refactoring. 2006-08-29 Adam Fedor * Documentation/ReleaseNotes.gsdoc: Updates. 2006-08-28 00:00-EDT Gregory John Casamento * Version 0.11.0 2006-08-26 22:30-EDT Gregory John Casamento * Source/GSNibLoader.m: loadModelData:... Remove TEST_RELEASE from handler block. * Source/NSColor.m: initWithCoder: retain autoreleased instances of NSColor to prevent double release when the pool is cleared. * Source/NSControl.m: initWithCoder: retain cell to prevent double release when the pool is cleared. * Source/NSFont.m: initWithCoder: retain autoreleased instances of NSFont to prevent double release when the pool is cleared. 2006-08-26 18:25-EDT Gregory John Casamento * Source/NSTableView.m: initWithCoder: minor cleanup. * Source/NSTextFieldCell.m: Retain text/background colors to prevent crash. 2006-08-26 10:01-EDT Gregory John Casamento * Source/GSNibCompatibility.m: In [NSIBObjectData initWithCoder:] clean up the buildMap calls. In NSCustomResource retain the resource that is returned to prevent a crash. Add dealloc method to NSCustomObject. * Source/NSClipView.m: In initWithCoder: retain and release documentView before removing it from the view and resetting it as the document view. This ensures that the view will not be deallocated. * Source/NSScrollView.m: Retain the contentView before exchanging it and then release to prevent the view from being deallocated in initWithCoder: * Source/NSTableView.m: Replace call to "new" with alloc/init for NSTableHeaderView in initWithCoder: * Source/NSView.m: in initWithCoder: keyed coding don't release the subs array since it's already autoreleased. This was causing a crash. 2006-08-21 Fred Kiefer * Source/NSBrowser.m (-encodeWithCoder:): Moved variable declaration to the beginning of the block to not break old compilers deliberately. 2006-08-20 12:14-EDT Gregory John Casamento * Source/NSApplication.m: Remove keys from initWithCoder: and encodeWithCoder:. * Source/NSCell.m: Initialize the cell based on content in initWithCoder:. * Source/NSFormCell.m: Removed unnecessary decoding of NSContents key in initWithCoder: since it is already done in NSCell.m. * Source/NSMatrix.m: initWithCoder:/encodeWithCoder: added autosizesCells flag and clear flags which are not used prior to encoding. * Source/NSPopUpButtonCell.m: Implemented encoding in encodeWithCoder:. 2006-08-19 15:56-EDT Gregory John Casamento * Source/NSBrowser.m: Added comment in encodeWithCoder:. 2006-08-19 10:33-EDT Gregory John Casamento * Source/NSBrowserCell.m: Improved encoding and decoding in encodeWithCoder: and initWithCoder: * Source/NSBrowser.m: Improved encoding and decoding in encodeWithCoder: and initWithCoder: * Source/NSScrollView.m: Improved encoding and decoding in encodeWithCoder: and initWithCoder: 2006-08-17 00:54-EDT Gregory John Casamento * Source/NSButtonCell.m: Improvements in both initWithCoder: and encodeWithCoder: utilize the setCellAttribute:to: method and the cellAttribute: method to determine settings when saving to a keyed archive. 2006-08-16 00:53-EDT Gregory John Casamento * Source/NSTabView.m: Corrections in initWithCoder: and encodeWithCoder: to properly encode items and tabview orientation. 2006-08-15 01:02-EDT Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibCompatibility.h: Added oids method. * Images/common_Printer.tiff: Replaced old printer icon with one created from the PrefsIcon_SelectSpooler_Tile.jpg image on the website. * Source/GSNibCompatibility.m: Added oids method to get the map. 2006-08-13 16:18-EDT Gregory John Casamento * Source/NSCell.m: Conditionally encode the formatter in encodeWithCoder:. * Source/NSMenu.m: Change in encodeWithCoder: to add NSName to the menu with "_NSMainMenu" as the value so that IB will display the menu properly when loading. * Source/NSTableView.m: Conditionally encode datasource, delegate, target and action in encodeWithCoder: 2006-08-13 13:05-EDT Gregory John Casamento * Source/NSControl.m: Rolling back previous change to mouseDown: until it can be determined why it is causing some apps to crash. 2006-08-12 18:37-EDT Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibCompatibility.h: Added NSPSMatrix placeholder class. * Source/GSNibCompatibility.m: Added dummy implementation of NSPSMatrix placeholder class. * Source/NSOutlineView.m: Eliminated empty if conditional in encodeWithCoder:. * Source/NSProgressIndicator.m: Added code to initWithCoder: to properly unarchive. Also implemented encodeWithCoder: and added GNUstep specific keys for information that GNUstep uses, but IB doesn't. All GNUstep specific keys should be prefixed with GS*. * Source/NSTableColumn.m: Implemented encodeWithCoder:. * Source/NSTableView.m: Fixes in encodeWithCoder: to correct issues during load in InterfaceBuilder. 2006-08-11 Fred Kiefer * Source/NSView.m (displayIfNeededInRect:): Check for needs_display == YES, instead of NO. * Headers/AppKit/AppKit.h: Added missing header files and moved the non-OpenStep ones inside the #ifdef. * Source/NSTableView.m (-sizeLastColumnToFit): Don't clamp the value of the new column width, as the column those this by itself, and rely on the automatic tiling 2006-08-11 Fred Kiefer * Source/NSSlider.m (mouseDown:, trackKnob:knobRect:, _floatValueForMousePoint()): Moved all track related code to cell class. * Source/NSSliderCell.m (_floatValueForMousePoint(), trackMouse:...untilMouseUp:): Code previously in the NSSlider class. Reworked slightly to be more similar to [NSCell trackMouse:... untilMouseUp:]. 2006-08-11 01:50-EDT Gregory John Casamento * Source/GSNibCompatibility.m: Assign copies of the parameters to setClassName: and setExtension:. * Source/NSActionCell.m: Encode contro view, since it may be needed by IB in encodeWithCoder: * Source/NSButtonCell.m: Unarchive controlview for debugging purposes in initWithCoder: * Source/NSCell.m: Addecomment. 2006-08-10 Fred Kiefer * Source/NSControl.m (mouseDown:): Simplified code to no longer fiddle with the cells action mask nor to capture the mouse. 2006-08-09 02:28-EDT Gregory John Casamento * Source/NSButtonCell.m: Correct encoding of repeat and delay in encodeWithCoder: since they are encoded as integers. 2006-08-09 01:44-EDT Gregory John Casamento * Source/NSFont.m: Correct issue with size encoding in encodeWithCoder: and initWithCoder:. Properly encode/decode as a float. * Source/NSImageCell.m: Implement encodeWithCoder:. * Source/NSImage.m: Comment out code in encodeWithCoder: which encodes reps until can determine how to properly encode images. * Source/NSImageView.m: implement encoding in encodeWithCoder: * Source/NSScrollView.m: Don't encode headerClipView if it's nil. * Source/NSTextView.m: Properly encode background color in NSTextViewSharedData. * Source/NSView.m: Encoding corrections in initWithCoder: and encodeWithCoder:. 2006-08-08 21:33-EDT Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibCompatibility.h * Source/GSNibCompatibility.m: Fix for window size issue caused by previous change. * Source/NSBitmapImageRep.m * Source/NSBox.m * Source/NSButtonCell.m * Source/NSCachedImageRep.m * Source/NSImage.m * Source/NSTabViewItem.m * Source/NSTabView.m * Source/NSTextFieldCell.m: Added encoding in encodeWithCoder: 2006-08-09 Fred Kiefer * Headers/AppKit/NSStepper.h * Headers/AppKit/NSStepperCell.h: Removed private method declarations. * Source/NSStepper.m: Moved code from mouseDown: method to the cell method trackMouse:...untilMouseUp:. Also moved the _increment and _decrement methods to the cell class. * Source/NSStepperCell.m: Rewrote mouse tracking to be more similar to NSCell's implementation and not use any direct drawing. Do not use hard coded colour values in the drawing methods, implemented keyed encoding and cleaned up the rest of the class. * Source/NSCell.m (trackMouse:...untilMouseUp:): Moved initialisation of periodCount out of the loop. In the old version the value stayed always 0. 2006-08-07 Fred Kiefer * Source/NSCell.m (-setBezeled:, -setBordered:): Switch border off, if setBezeled: is called and visa versa, independent of the actual parameter setting. This matches documented Cocoa behaviour. 2006-08-06 00:30-EDT Gregory John Casamento * Source/GSNibCompatibility.m: Correction in nibInstantiate for window frame. * Source/NSActionCell.m * Source/NSButtonCell.m * Source/NSCell.m * Source/NSComboBoxCell.m * Source/NSControl.m * Source/NSMatrix.m * Source/NSTableView.m * Source/NSTextContainer.m * Source/NSTextStorage.m * Source/NSTextView.m: Encoding in encodeWithCoder:. 2006-08-05 09:08-EDT Gregory John Casamento * Source/NSMenu.m: encodeWithCoder: encode items and title of menu. 2006-08-05 08:43-EDT Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibCompatibility.h * Source/GSNibCompatibility.m: Changed visibleWindows to an Array, as it should be. * Source/NSView.m: Avoid encoding of super_view in encodeWithCoder: if it is the contentView of the window. 2006-07-21 Fred Kiefer * Source/NSTextView.m (-setTypingAttributes:): Make sure to keep the main parts of the old attributes, if they are not provided by the new ones. 2006-07-18 23:11-EDT Gregory John Casamento * Source/GSNibCompatibility.m: Added category on NSView and _fixSubviews method to correct window and superview after loading the nib file. The _fixSubviews method is called in nibInstantiate. * Source/GSNibTemplates.m: More helpful error message for when decoding fails due to the user attempting to load a version of GSNibContainer that the container doesn't know about in initWithCoder: 2006-07-17 Enrico Sersale * Headers/AppKit/NSHelpManager.h: * Source/NSHelpManager.m: added -setContextHelp:forObject: as specified in Apple docs; -setContextHelp:withObject: deprecated. 2006-07-16 Enrico Sersale * Headers/Additions/GNUstepGUI/GSHelpManagerPanel.h: added -buttonAction: method. * Source/GSHelpManagerPanel.m: implemented -buttonAction:. added a button to close the panel and changed the style mask of the window to NSTitledWindowMask | NSResizableWindowMask. 2006-07-15 Enrico Sersale * Headers/AppKit/AppKit.h: added NSHelpManager.h. * Headers/AppKit/NSHelpManager.h: declaration for new method -pathForHelpResource: * Source/NSHelpManager.m: implemented -pathForHelpResource: in the NSBundle category. -pathForHelpResource: looks for help files giving the priority to localized resources. -showHelp: looks for rtfd files too. * Source/GSHelpManagerPanel.m: various fixes to avoid a crash when quitting and to resize correctly the NSTextView. 2006-07-14 01:17 Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibCompatibility.h: * Source/GSNibCompatibility.m: Added method initWithWindow:.. to initialize the template from an actual window instance. 2006-07-10 00:12 Gregory John Casamento * Source/NSSplitView.m: Keyed encoding changes in initWithCoder: 2006-07-09 10:50 Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibTemplates.h: Declaration for new methods: visibleWindows, deferredWindows, & customClasses. * Source/GSNibTemplates.m: Simplification of awakeFromContext: code due to new gorm format changes. Also, changes to init to initialize the new ivars, dealloc to release them and modifications to initWithCoder: and encodeWithCoder: to decode and encode the new data. Added new methods: visibleWindows, deferredWindows, & customClasses. * Source/NSView.m: Minor cleanup. 2006-07-06 21:35 Gregory John Casamento * Source/NSBrowser.m: * Source/NSClipView.m: * Source/NSScrollView.m: * Source/NSTableView.m: Copy some initialization code from initWithFrame: to initWithCoder. * Source/NSView.m: Remove from initWithCoder: a call to initWithFrame: according to the documentation normal objects in a nib should not have thier initWithFrame: method called at the time they are unarchived. Also, copy some initialization code here. 2006-07-04 Richard Frith-Macdonald * Source/NSSpellServer.m: * Source/NSAlert.m: * Source/NSWindowController.m: * Source/GSDisplayServer.m: * Source/NSWorkspace.m: * Source/GSLayoutManager.m: * Source/NSWindow.m: * Source/NSLayoutManager.m: * Source/GSStandardWindowDecorationView.m: * Source/GSTextStorage.m: * Source/GSHorizontalTypesetter.m: * Source/NSColor.m: * Source/NSPasteboard.m: * Source/NSMenuItem.m: * Source/NSPageLayout.m: * Source/NSOutlineView.m: * Source/NSTextView.m: * Source/NSBitmapImageRep+JPEG.m: * Source/NSComboBoxCell.m: * Source/NSToolbarItem.m: * Source/NSImage.m: * Source/NSDataLink.m: * Source/GSServicesManager.m: * Source/NSPrintPanel.m: * Source/NSEvent.m: * Source/GSDragView.m: * Model/GMArchiver.m: * Model/IMConnectors.m: * Tools/GSspell.m: Tweaks to avoid spurious warnings in recent gcc-4.1 and a few casts etc to deal with a few real issues when working on 64bit cpus. 2006-07-02 Fred Kiefer * Source/NSTextView.m (-rulerView:didMoveMarker:, -rulerView:didRemoveMarker:, -rulerView:didAddMarker:): Removed a compiler warning by adding a type cast. * Source/NSTextView.m (-initWithCoder:) Removed unused variables. * Source/NSTextView.m (NSTextViewSharedData -dealloc) Call super dealloc. * Source/NSApplication.m (-initWithCoder:) Set delegate only when the keyed decoder contains it. * Source/NSSlider.m (-trackKnob:knobRect:, mouseDown:) Don't draw explicitly, as this gets handled automatically by the cell. * Source/NSOutlineView.m (-editColumn:row:withEvent:select:) Moved the lockFocus call right around the image cell drawing, as it is only needed here. 2006-06-25 12:40 Gregory John Casamento * Source/GSNibCompatibility.m: Added NSDecimalNumberPlaceholder class implementation to decode NSDecimalNumber instances in nib files. 2006-06-25 00:26 Gregory John Casamento * Source/GSNibCompatibility.m: in -[NSIBObjectData instantiateWithOwner:topLevelObjects:] properly initialize the NSWindowTemplate and fill in the topLevelObjects array. 2006-06-20 20:58 Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibCompatibility.h: Added declarations for classes and names methods and change return type for objects method. * Source/GSNibCompatibility.m: Properly return the pointer in objects method and also add methods for names, and classes maps in the nib file. * Source/NSDocument.m: Refuse to write a file for a type which isn't native. If the class method isNativeType: returns YES, then write the file in writeToFile:ofType:saveOperation:. * Source/NSSliderCell.m: Make the cell non-bordered in initWithCoder: 2006-06-18 14:38 Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibCompatibility.h: Added NSIBHelpConnector declaration. * Source/GSNibCompatibility.m: Added skeleton implementation of NSIBHelpConnector. 2006-06-17 20:39 Gregory John Casamento * Source/GSNibCompatibility.m: Resize window to window rect size in nibInstantiate. 2006-06-17 10:52 Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibCompatibility.h: Removed unecessary ivar. * Source/GSNibCompatibility.m: Remove some uneeded code. Added code to translate a class properly NSClassSwapper when the class has a replacement registered with the current NSKeyedUnarchiver. 2006-06-15 00:51 Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibCompatibility.h: Added new method declarations. * Source/GSNibCompatibility.m: Added isInterfaceBuilder method here. * Source/NSDocument.m: Added code to prevent the popup from showing blank when the fileType is set to a non-Editor type. 2006-06-11 Fred Kiefer * Source/NSTextView_actions.m (-deleteToEndOfLine:): New method based on patch by Andreas Höschler . * KeyBindings/DefaultKeyBindings.dict: Enable Control-k. 2006-06-09 Fred Kiefer * Source/NSView.m (-discardCursorRects) * Source/NSWindow.m (-invalidateCursorRectsForView:): Updated version of patch for improved handling of cursor rects to fix bug #5871. Patch by Mircea Trache . 2006-06-08 00:00 Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibContainer.h: Minor cleanup. * Source/GSNibCompatibility.m: Added exception similar to the one for NSWindow to classes here, which don't implement non-keyed coding. * Source/GSNibTemplates.m: Added initial objects for GSCustomClass, NSDeferred, NSVisible names in name table. * Source/NSWindow.m: Added corrected exception text. 2006-06-04 13:30 Gregory John Casamento * Headers/AppKit/NSDrawer.h: Added ivar _contentSize to header. * Source/NSDrawer.m: Implemented keyed and non-keyed encoding. 2006-06-04 12:28 Gregory John Casamento * Source/GSTrackingRect.m: Encode, if not a keyed archiver. * Source/NSApplication.m: Added coding * Source/NSDataLink.m: Added coding * Source/NSDataLinkManager.m: Added coding * Source/NSNib.m: Made comment use "TODO_NIB" instead of TODO, so that it can be pulled later. * Source/NSParagraphStyle.m: Added TODO_NIB. * Source/NSSelection.m: Added coding. * Source/NSSound.m: Added TODO_NIB * Source/NSTextAttachment.m: Added TODO_NIB. 2006-06-04 01:09 Gregory John Casamento * Source/GSHbox.m: Implemented keyed coding. * Source/GSNibCompatibility.m: Added private method to help better decode keys/values in the nib data structures. * Source/GSTable.m: Implemented keyed coding. * Source/GSTextStorage.m: Added code to skip existing coding method contents, if the coder is a keyed coder. * Source/GSVbox.m: Implemented keyed coding. * Source/NSMenuView.m: Added code to skip coding, if it is a keyed coder. * Source/NSPanel.m: Added comment indicating that the call to the superclass initWithCoder method should throw an exception per documentation. * Source/NSPrinter.m: Added if to skip the coder logic, if using a keyed coder. * Source/NSStepper.m: Removed dummy initWithCoder:/encodeWithCoder: methods since they only called the superclass. * Source/NSWindow.m: Added exception called for in the documentation if NSWindow initWithCoder:/encodeWithCoder: is called with a keyed archiver. 2006-06-03 Fred Kiefer * Source/NSPrinter.m (-interpretQuotedValue:, -gethex:): Better error reporting on non-hexadecimal substring. Ignore "<<" sequence as this is valid as part of a PS command string. 2006-06-01 00:13 Gregory John Casamento * Headers/AppKit/NSDocumentFrameworkPrivate.h: Addition of new private methods to manage file types. * Headers/AppKit/NSDocument.h: New ivar _saveType. * Source/NSDocumentController.m: Implementation of new private methods. * Source/NSDocument.m: Changed writeWithBackupToFile:ofType: saveOperation: to use new methods to get the human readable filetypes to be listed in the dropdown in the savepanel and to properly retrieve the extension for the specified filetype and apply it to the backup filename and filename being saved. Also modified changeSaveType: to update the save panel's requiredFileType when the type is changed. 2006-05-21 Richard Frith-Macdonald * Source/NSApplication.m: Implement MacOS-X behavior (as determined by experimentation) of sending ([performKeyEquivalent:]) to main menu and to the key window. This differs from the old behavior of sending to all windows and means that popup/pulldown menus on windows other than the key window now cannot be activated using key equivalents. 2006-05-30 00:53 Gregory John Casamento * Source/NSDocument.m: Implemented accessory view logic when the document can save more than one filetype. 2006-05-29 Richard Frith-Macdonald * Source/NSApplication.m: Revert last change which broke menu key equivalents for off-screen windows. * Source/NSOpenPanel.m: Fix handling CR key equivalent (bug #16688) so that panel only takes action when it is active. * Source/NSSavePanel.m: ditto Fix done by disabling the ok button when the panel is not active, but what about if other panels have similar bugs ... shouldn't there be some automatic mechanism to stop buttons (but not menu items) from responding to key equivalents when a window is not the key window? * Source/NSButton.m: ([performKeyEquivalent:]) return NO if blocked by a modal window as per macos-x documentation. 2006-05-29 00:58 Gregory John Casamento * Source/NSApplication.m: Correction for bug#16688. * Source/NSDocumentController.m: Changed comment for currentDirectory. * Source/NSDocument.m: Removed "FIXME" since it is inaccurate. The signature of the method is the same as in the documentation. 2006-05-27 Fred Kiefer * Source/NSView.m (-discardCursorRects, -removeCursorRect:cursor:) * Source/NSWindow.m (-invalidateCursorRectsForView:, -resetCursorRects): Improved handling of cursor rects to fix bug #5871. * Source/NSCursor.m (-mouseExited:): Set the default cursor, when the cursor was set on enter. Patch by Mircea Trache . 2006-05-23 Fred Kiefer * Source/NSTabView.m (-tabViewItemAtPoint:, -mouseDown:): Moved conversion of point with view transformation into the mouseDown: method to be compatible with Cocoa. Patch by Andreas Höschler . 2006-05-20 18:25 Gregory John Casamento * Source/GSNibCompatibility.m * Source/NSButtonCell.m: Merged additional changes from NibCompatibility. NOTE: All changes which were merged from the NibCompatilibility branch are tagged at the end with [NibCompatibility]. 2006-05-20 18:11 Gregory John Casamento * ChangeLog * Documentation/ReleaseNotes.gsdoc * Headers/Additions/GNUstepGUI/GSNibCompatibility.h * Headers/Additions/GNUstepGUI/GSNibTemplates.h * Headers/AppKit/NSNib.h * Source/GNUmakefile * Source/GSNibCompatibility.m * Source/NSActionCell.m * Source/NSBundleAdditions.m * Source/NSButtonCell.m * Source/NSCell.m * Source/NSClipView.m * Source/NSColorWell.m * Source/NSLayoutManager.m * Source/NSMatrix.m * Source/NSMenuItem.m * Source/NSNib.m * Source/NSOutlineView.m * Source/NSPopUpButtonCell.m * Source/NSScroller.m * Source/NSScrollView.m * Source/NSSecureTextField.m * Source/NSSliderCell.m * Source/NSStepperCell.m * Source/NSTableView.m * Source/NSTextContainer.m * Source/NSTextField.m * Source/NSTextView.m * Source/NSView.m: Merged nib loading code from NibCompatibility. 2006-05-15 21:55 Gregory John Casamento * Source/GSNibCompatibility.m: Streamlined previous change. [NibCompatibility] 2006-05-15 00:54 Gregory John Casamento * Source/GSNibCompatibility.m: Add title mask if window has a title in the archive. * Source/NSPopUpButtonCell.m: Clear and reset the menu in the popup button cell initWithCoder: method. [NibCompatibility] 2006-05-14 20:58 Gregory John Casamento * Source/GSNibCompatibility.m: Added autosaveName. [NibCompatibility] 2006-05-10 23:55 Gregory John Casamento * Source/NSButtonCell.m * Source/NSCell.m * Source/NSMatrix.m: Improved initWithCoder: nib support. [NibCompatibility] 2006-05-09 22:48 Gregory John Casamento * Source/NSStepperCell.m: Implemented keyed coding. [NibCompatibility] 2006-05-07 22:36 Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibCompatibility.h: Added _originalClassName member. * Source/GSNibCompatibility.m: use new member in instantiateRealObject:withClassName: to allow auto-substitution of cell classes. * Source/NSSecureTextField.m: Remove code to copy properties. [NibCompatibility] 2006-05-07 20:29 Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibCompatibility.h: Addition of flags fields for the window. * Source/GSNibCompatibility.m: Improvments to NSWindowTemplate. * Source/NSScrollView.m: Changed unsigned int to unsigned long in initWithCoder: * Source/NSSecureTextField.m: code to copy the text field cell. * Source/NSTextField.m: Changed if and added a comment in initWithCoder: [NibCompatibility] 2006-05-07 11:07 Gregory John Casamento * Source/GSNibCompatibility.m: Removed kludge in nibInstantiate:owner: method and added a category for NSNibControlConnector to reformat the method name. [NibCompatibility] 2006-05-07 10:52 Gregory John Casamento * Source/GSNibCompatibility.m * Source/NSActionCell.m * Source/NSCell.m * Source/NSSliderCell.m: Changes and improvements to handling of cells for nib decoding. [NibCompatibility] 2006-05-06 13:09 Gregory John Casamento * Source/NSBundleAdditions.m: Unarchive destination before source. * Source/NSOutlineView.m: Proper initialization of outline view in initWithCoder: * Source/NSTableView.m: Rearrangement of keys in initWithCoder: [NibCompatibility] 2006-05-05 00:41 Gregory John Casamento * Source/NSTextView.m: Completion of code in initWithCoder: for keyed unarchiving. [NibCompatibility] 2006-05-03 22:43 Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibCompatibility.h: Make NSIBObjectData conform to GSNibContainer protocol. * Headers/Additions/GNUstepGUI/GSNibContainer.h: New protocol. * Headers/Additions/GNUstepGUI/GSNibTemplates.h: Use new protocol as protocol for the GSNibContainer object. * Source/GNUmakefile: Add GSNibContainer.h to makefile. * Source/GSNibCompatibility.m: Implement GSNibContainer methods, skeleton implementation for some. * Source/NSScrollView.m: Correct issue with horiz/vert scroller. * Source/NSTextView.m: More keyed archiving changes. [NibCompatibility] 2006-05-03 01:00 Gregory John Casamento * Source/NSLayoutManager.m * Source/NSTextContainer.m * Source/NSTextView.m: Improved keyed unarchiving for these classes. [NibCompatibility] 2006-04-30 17:12 Gregory John Casamento * Source/GSNibCompatibility.m: Addition of keyMap to NSKeyedUnarchiver in a category. * Source/NSScrollView.m: Change to re-align view only if scroller is present. * Source/NSTextView.m: Changed initWithCoder: * Source/NSView.m: Changed the order of initialization so that the view has it's frame prior to the unarchiving of subviews. [NibCompatibility] 2006-04-26 22:34 Gregory John Casamento * Source/NSTableView.m: Correction for header view. [NibCompatibility] 2006-04-24 22:02 Gregory John Casamento * Source/GSNibCompatibility.m: Implementation of NSButtonImageSource. * Source/NSButtonCell.m: Code to compensate for image encoding anomalies in nibs. * Source/NSScrollView.m: Changes to properly decode scrollview attributes and border settings. * Source/NSTableView.m: Changes to properly set height of cornerview. [NibCompatibility] 2006-04-18 19:54 Gregory John Casamento * Source/NSTableView.m: Corrected code in setHeaderView: to properly set the table view into the header view if it has a "setTableView:" method. [NibCompatibility] 2006-04-18 00:55 Gregory John Casamento * Source/NSScrollView.m: Corrections for keyed decoding of border style and other settings. * Source/NSTableView.m: Some cleanup of keyed coding. [NibCompatibility] 2006-04-15 23:07 Gregory John Casamento * Source/GSNibCompatibility.m: Changed order of decoding. * Source/NSScroller.m: Properly set the horiz/vert flags * Source/NSScrollView.m: Corrections to keyed decoding and contentView handing. * Source/NSTableView.m: Corrections to keyed decoding. Use of a struct to decode. [NibCompatibility] 2006-04-15 02:41 Gregory John Casamento * Source/NSScrollView.m: initWithCoder: modify position of clipView due to differences in OSX vs. GNUstep. [NibCompatibility] 2006-04-15 02:26 Gregory John Casamento * Source/GSNibCompatibility.m: Comment on _NSHeaderView. * Source/NSScrollView.m: Corrected issue with content view and keyed coding. * Source/NSTableView.m: Added additional initialization logic in keyed coder. [NibCompatibility] 2006-04-14 00:02 Gregory John Casamento * Source/GSNibCompatibility.m: Changed ordering to allow views to be properly initialized. [NibCompatibility] 2006-04-11 23:45 Gregory John Casamento * Headers/AppKit/NSNib.h * Source/NSNib.m: Added keyed coding. [NibCompatibility] 2006-04-09 23:14 Gregory John Casamento * Source/GSModelLoaderFactory.m: Fixed a problem with pathForNibResource: [NibCompatibility] 2006-04-09 20:37 Gregory John Casamento * Headers/Additions/GNUstepGUI/GSModelLoaderFactory.h * Source/GSGormLoader.m * Source/GSModelLoaderFactory.m * Source/GSNibLoader.m * Source/NSNib.m: Refactoring to make NSNib use the new model loading framework. [NibCompatibility] 2006-02-18 08:36 Gregory John Casamento * Source/GSNibCompatibility.m: Changed aDecoder to coder in NSIBObjectData encoderWithCoder: also added code to throw an exception if a coder does not support keyed coding. [NibCompatibility] 2006-01-25 22:31 Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibCompatibility.h * Source/GSModelLoaderFactory.m: Fixes to work with gcc 3.x [NibCompatibility] 2006-01-16 00:58 Gregory John Casamento * Source/GSNibCompatibility.m: Minor changes in initWithCoder: * Source/NSClipView.m: Added logic to check flags in initWithCoder: * Source/NSOutlineView.m: Added initial changes for keyed coding. * Source/NSScrollView.m: Added logic to check flags. * Source/NSTableView.m: Added logic to check for old grid flag in initWithCoder: [NibCompatibility] 2006-01-14 09:28 Gregory John Casamento * Source/NSTableView.m: Corrected bits used for columnResizing flag in initWithCoder: and encodeWithCoder: [NibCompatibility] 2006-01-14 08:58 Gregory John Casamento * Source/NSTableView.m: Implemented encodeWithCoder: for NSTableView. [NibCompatibility] 2006-01-14 08:29 Gregory John Casamento * Source/GSNibCompatibility.m: [NSIBObjectData objectForName:] return nil, if the object is not in the array. * Source/NSTableView.m: implement decoding of flags in initWithCoder: [NibCompatibility] 2006-01-13 00:29 Gregory John Casamento * Source/NSColorWell.m: Added keyed coding support in initWithCoder: and encodeWithCoder: [NibCompatibility] 2006-01-11 01:26 Gregory John Casamento * Source/NSSliderCell.m: Encode NSValue for compatibility with Cocoa. [NibCompatibility] 2006-01-11 01:02 Gregory John Casamento * Source/GSNibCompatibility.m: Changes to NSViewTemplate. * Source/NSSliderCell.m: Addition of code to handle slider to both initWithCoder: and encodeWithCoder: * Source/NSTextField.m: Removed unecessary empty if conditional. [NibCompatibility] 2006-01-10 00:12 Gregory John Casamento * Source/GSNibCompatibility.m: Rearranged order of unarchiving in [NSIBObjectData initWithCoder:]. * Source/NSView.m: Added "NSSuperview" to encodeWithCoder: [NibCompatibility] 2006-01-09 19:38 Gregory John Casamento * Source/GSNibCompatibility.m: Rearrange order of unarchiving in [NSIBObjectData initWithCoder:] so that NSClassSwapper unarchives and replaces itself correctly. * Source/NSView.m: Move subview initialization to after the decoding section for both keyed/serial archiving in initWithCoder: [NibCompatibility] 2006-01-08 14:01 Gregory John Casamento * Source/NSMenuItem.m: initWithCoder: added code to decode NSSubmenu key so that menus are properly constructed. [NibCompatibility] 2006-01-08 13:53 Gregory John Casamento * Source/GSNibCompatibility.m: Removed forwardInvocation from NSClassSwapper. * Source/NSMenuItem.m: Added implementation of keyed coding to NSMenu initWithCoder: [NibCompatibility] 2006-01-07 10:38 Gregory John Casamento * Source/GSNibCompatibility.m: Encoding for NSIBObjectData, and for NSWindowTemplate. Implementation of NSClassSwapper. [NibCompatibility] 2006-01-01 21:02 Gregory John Casamento * Headers/Additions/GNUstepGUI/GSInstantiator.h: Protocol and private method for instantiation. * Headers/Additions/GNUstepGUI/GSNibCompatibility.h: Added new header * Source/GNUmakefile: Added new header to makefile. * Source/GSNibCompatibility.m: Added nibInstantiation support. * Source/NSBundleAdditions.m: Addition of instantiateWithInstantiator: [NibCompatibility] 2006-01-01 14:36 Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibCompatibility.h: Added NSCustomResource. * Source/GSNibCompatibility.m: Added NSCustomResource. * Source/GSNibLoader.m: Calls keyed archiver with "IB.objectdata" key. [NibCompatibility] 2006-01-01 09:27 Gregory John Casamento * Headers/Additions/GNUstepGUI/GSModelLoaderFactory.h: Added declaration for priority method. * Headers/Additions/GNUstepGUI/GSNibCompatibility.h: Added awakeWithContext method. * Source/GSGModelLoader.m: Added priority method. * Source/GSGormLoader.m: Added priority method * Source/GSModelLoaderFactory.m: Implemented sorting by priority * Source/GSNibCompatibility.m: use ASSIGN in initWithCoder: * Source/GSNibLoader.m: Added priority method * Source/NSBundleAdditions.m: Removed AUTORELEASE, since the loader itself is autoreleased by the factory. [NibCompatibility] 2005-12-31 17:25 Gregory John Casamento * Source/GSNibCompatibility.m: Added code to properly initialize the maptables. [NibCompatibility] 2005-12-31 16:10 Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibCompatibility.h: Added awakeWithContext: * Source/GNUmakefile: Added GSNibLoader.m * Source/GSGormLoader.m: Changed some log output * Source/GSNibCompatibility.m: Added awakeWithContext: * Source/GSNibLoader.m: Loader for .nib files. [NibCompatibility] 2005-12-31 11:49 Gregory John Casamento * Headers/Additions/GNUstepGUI/GSModelLoaderFactory.h: Removed protocol. * Source/GSGModelLoader.m: * Source/GSGormLoader.m: Removed initialize method * Source/GSModelLoaderFactory.m: Renamed abstract class to GSModelLoader. Added code in initialize to register all subclasses of GSModelLoader. * Source/NSBundleAdditions.m: Make changes to use new abstract class name. [NibCompatibility] 2005-12-31 01:31 Gregory John Casamento * Source/GNUmakefile: Added new classes. * Source/NSBundleAdditions.m: Changes to use new model loader factory and loaders. * Source/GSModelLoaderFactory.h * Source/GSModelLoaderFactory.m: Handles model loading in dynamic way. Allows registration of additional classes to handle loading of guis. * Source/GSGormLoader.m: Loader for .gorm files. * Source/GSGModelLoader.m: Loader for .gmodel files. [NibCompatibility] 2005-12-31 Matt Rice * Source/NSTableView.m (-mouseDown:): Copy the selected cell before tracking mouse, add comment. (patch previously reverted 2005-05-30) (-mouseDown:): Check for pointer equality in addition to isEqual: which doesn't work with nil. (fix for bug #15316) 2005-12-30 00:49 Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibCompatibility.h * Source/GSNibCompatibility.m: NSCustomView changes. [NibCompatibility] 2005-12-29 00:39 Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibCompatibility.h * Source/GSNibCompatibility.m: NSClassSwapper, NSCustomView, and NSCustomObject. [NibCompatibility] 2005-12-27 20:51 Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibCompatibility.h: * Source/GSNibCompatibility.m: Addition of classes for true OSX nib compatibility. [NibCompatibility] 2006-05-12 Nicolas Roard * TextConverters/RTF/RTFProducer.h: * TextConverters/RTF/RTFProducer.m: Fixed the RTFD generation when the attachments do not have filenames. It is now possible to write RTFD documents with pasted images. 2006-05-12 Fred Kiefer * Documentation/GuiUser/DefaultsSuppary.gsdoc, * Source/NSApplication.m (-finishLaunching): Changed GSDontShowAppIcon to GSSuppressAppIcon. 2006-05-12 Nicolas Roard * TextConverters/RTF/RTFConsumer.m: reorganized -appendImage: in the RTFDConsumer class to compile with gcc 2.95 and declared the method in a private category. 2006-05-12 Nicolas Roard * TextConverters/RTF/RTFProducer.m: fixed the saving of the embedded files by using -lastPathComponent * TextConverters/RTF/rtfGrammer.tab.c: * TextConverters/RTF/rtfGrammer.y: modified the parser to be more flexible (and thus it can now read rtfd produced by gnustep) 2006-05-11 Nicolas Roard * TextConverters/RTF: added support for reading RTFD documents * TextConverters/RTF/rtfScanner.c: * TextConverters/RTF/rtfGrammer.y: * TextConverters/RTF/rtfGrammer.tab.h: * TextConverters/RTF/rtfGrammer.tab.c: modified the parser and the grammar to parse \NeXTGraphic and the associated \width and \height although \width and \height are not used to set the image size. * TextConverters/RTF/RTFConsumerFunctions.h: * TextConverters/RTF/RTFConsumer.h: * TextConverters/RTF/RTFConsumer.m: modified the RTFDConsumer class so that it holds a list of the files in the rtfd, added an appendImage: method which wrap the files and set an attachment cell with the image. Also added the RTFNeXTGraphic() function called by the parser. 2006-05-11 Richard Frith-Macdonald * Source/NSBundleAdditions.m: ([loadNibNamed:owner:]) add comments 2006-05-11 Fred Kiefer * Headers/AppKit/NSDragging.h, * Source/NSColorWell.m, * Source/NSImageView.m, * Source/NSOutlineView.m, * Source/NSSavePanel.m, * Source/NSTableView.m, * Source/NSTextView.m, * Source/NSApplication.m (-draggingEntered:, -draggingUpdated:): Changed return value to NSDragOperation. 2006-05-10 Fred Kiefer * Source/NSApplication.m (-finishLaunching): Don't display the application icon window if the GSDontShowAppIcon is set to YES. Patch by Saso Kiselkov . * Documentation/GuiUser/DefaultsSuppary.gsdoc: Document GSDontShowAppIcon. * Source/GSDragView.m: Resorted method definitions to remove compiler warnings. 2006-05-10 Richard Frith-Macdonald * Source/NSBundleAdditions.m: ([loadNibNamed:owner:]) if the NIB can't be found in the owners bundle, try the main bundle of the application. Fixes loading where the files owner is in a library, framework or bundle, but the Gorm/NIB file is in the application resources. I'm not sure this is the correct order, perhaps we should try the main bundle first and the library/framework only if the rersource is not in the main bundle. 2006-05-06 Fred Kiefer * Resources/Esperanto.lproj/Localizable.string, * Resources/German.lproj/Localizable.string: New string translations. Patch by Ingolf Jandt . * Resources/GNUmakefile: Added new languages. 2006-05-06 Fred Kiefer * Source/NSTableView.m (-_editNextEditableCellAfterRow:column:, _editPreviousEditableCellBeforeRow:column:) Select the new row before editing a cell. * Source/NSComboBoxCell.m (GSComboWindow -validateSelection): Removed the didChangeText call on the textObject. Patches by Andreas Höschler . 2006-05-05 Richard Frith-Macdonald * Source/NSWindow.m: ([-makeFirstResponder:]) fixed for nil argument. * Headers/AppKit/NSWindow.h: documented method. 2006-05-03 Fred Kiefer * Headers/Additions/GNUstepGUI/GSDisplayServer.h (-nativeWindow:::::): Added new method. * Source/GSDisplayServer.m (-nativeWindow:::::): Implemented this method as subclassResponsibility. * Source/NSWindow.m (-initWithWindowRef:], -windowRef): Implemented these methods to wrap native window into GNUstep windows. 2006-05-01 Richard Frith-Macdonald * Source/NSMatrix..m: ([performKeyEquivalent:]) Check modifier flags of cells when determining whether to perform their key equivalents. * Source/NSMenu.m: ([performKeyEquivalent:]) Use key equivalent modifier mask as suggested by Fred, rather than original hard-coded command modifier. 2006-04-30 Richard Frith-Macdonald * Source/NSMenu.m: ([performKeyEquivalent:]) Ignore key eqivalents other than carriage return if the command key is not pressed. 2006-04-30 David Ayers * ColorPickers/GSNamedColorPicker.m ([-browser:selectRow:inColumn:]): Return NO as default value. 2006-04-29 Richard Frith-Macdonald * Source/NSWindow.m: ([-performKeyEquivalent:]) revert last change as it broke things because I accidentally faileds to commit corresponding NSMenu fix, and because I'm not sure it should be doing it anyway. 2006-04-28 Richard Frith-Macdonald * Source/NSApplication.m: ([-sendEvent:]) try key equivalents for every key down, not just command modifiers ... consistent with MacOS-X and allows carriage return as a button/menu key. * Source/NSWindow.m: ([-performKeyEquivalent:]) only pass on to our views if this is the key window (NSMenu overrides this). 2006-04-27 Sergii Stoian * Source/NSMenuView.m (-rectOfItemAtIndex:): Delete origin.x fiddling code because it's not correct. The code wich draws heavy line have to update _leftBorderOffset instead. (-drawRect:): Always draw dark gray upper and left border. 2006-04-24 Fred Kiefer * Source/NSDocumentController.m (-makeUntitledDocumentOfType:): Set the type of the new document. Patch by Saso Kiselkov . 2006-04-09 12:25 Gregory John Casamento * Tools/gopen.m: Streamline gopen code. 2006-04-09 12:28 Gregory John Casamento * Tools/gopen.m: Streamline gopen code. 2006-04-06 Adam Fedor * Tools/gcloseall.m: Include NSProcessInfo.h. Fixes bug #16212. 2006-03-31 Richard Frith-Macdonald * Source/NSMenuView.m: ([-rectOfItemAtIndex:]) fixup origin of rectangle to avoid overwriting dark line at left of menu. * Source/NSMenu.m: make transient main menu shitf on screen. fix bug #15935 2006-03-30 Richard Frith-Macdonald * Source/GSMemoryPanel.m: Extend to allow snapshots of the memory to be taken so we can compare memory at different points in time. Simplify code and fix bug where re-ordering sort in table would also change table contents. 2006-03-26 Maurizio Boriani * Resources/Italian.lproj/Localizable.string: Add missing translations. * Resources/Lojban.lproj/Localizable.string: New, lojban strings translation. 2006-03-28 20:21 Gregory John Casamento * Tools/gopen.m: Added back code in to launch the application properly with the -a option. 2006-03-26 12:52 Gregory John Casamento * Headers/AppKit/NSPopUpButtonCell.h: Refactored header, added documentation * Source/NSNib.m: Added documentation. * Source/NSPopUpButtonCell.m: Improved documentation. 2006-03-26 Fred Kiefer * Headers/AppKit/NSSearchFieldCell.h: * Headers/AppKit/NSSearchField.h: * Source/NSSearchField.m: * Source/NSSearchFieldCell.m: Added headers and basic implementation for these classes based on code by Nikolaus Schaller . * Source/GNUmakefile: Handle these new classes. 2006-03-24 Fred Kiefer * Source/NSStepperCell.m: Rewrote all button drawing functions to use new helper function DrawLightButton to honour colour settings. Based on patch idea by Ingolf Jandt . * Source/NSStepperCell.m (-highlight:upButton:withFrame:inView:): Simplified to use [drawWithFrame:inView:]. * Source/NSColorPanel.m (-_initWithoutGModel): Enable colour wells in bottom list. 2006-03-20 Richard Frith-Macdonald * Source/NSMenuView.m: ([-rectOfItemAtIndex:]) remove unused code and tidy a bit (problem pointed out by Matt Rice). 2006-03-19 Nicolas Roard * Source/NSSliderCell.m: * Source/NSTabView.m: * Images/common_SliderHoriz.tiff: * Images/common_SliderVert.tiff: * Images/common_SwitchOff.tiff: * Images/common_SwitchOn.tiff: * Images/common_TabDownSelectedLeft.tiff: * Images/common_TabDownSelectedRight.tiff: * Images/common_TabDownSelectedToUnSelectedJunction.tiff: * Images/common_TabDownUnSelectedJunction.tiff: * Images/common_TabDownUnSelectedLeft.tiff: * Images/common_TabDownUnSelectedRight.tiff: * Images/common_TabDownUnSelectedToSelectedJunction.tiff: * Images/common_TabSelectedLeft.tiff: * Images/common_TabSelectedRight.tiff: * Images/common_TabSelectedToUnSelectedJunction.tiff: * Images/common_TabUnSelectedJunction.tiff: * Images/common_TabUnSelectedLeft.tiff: * Images/common_TabUnSelectedRight.tiff: * Images/common_TabUnSelectToSelectedJunction.tiff: Updated images for the sliders, tabviews and switch buttons. They are now transparent; the background is thus filled in the code using [NSColor controlBackgroundColor]. That way the current color scheme is followed. Thanks to Ingolf Jandt for the images. 2006-03-13 Adam Fedor * Version 0.10.3 2006-03-12 Fred Kiefer * Source/GNUmakefile: * Source/GNUmakefile.preamble: * Source/GNUmakefile.postamble: Install header file Cocoa.h. 2006-03-08 Richard Frith-Macdonald * Source/GSServicesManager.m: avoid use of deprecated method. 2006-03-05 Richard Frith-Macdonald * Source/NSScreen.m: ([-visibleFrame]) fix to work when using mac style horizontal menu. 2006-03-01 Richard Frith-Macdonald * Source/NSMenuView.m: ([-rectOfItemAtIndex:]) Fix bug #15934 by removing some bogus code left over from incorporating horizontal menu. 2006-02-24 Quentin Mathe * Source/GSToolbar.m: Fixed mismatched method return type between header and implementation. * Source/GSToolbarView.m: Updated code to reference some external classes lazily with NSClassFromString. These fixes avoids some compiler warnings. 2006-02-22 23:03 Gregory John Casamento * Source/NSScreen.m: Correction for visibleFrame, spelling of NSInterfaceStyle was incorrect. 2006-02-22 Richard Frith-Macdonald * Source/GSPrintOperation.m: trap exceptions launching previwer * Documentation/GuiUser/DefaultsSuppary.gsdoc: mention GSLPRPrinters * Printing/GSLPR/GSLPRPrinter.m: If we set up default printer config because there was nothing in the user defaults system, save the new config so we don't have to do it again next time. 2006-02-06 Fred Kiefer * Source/NSMatrix.m (-deselectAllCells): Allow empty selection, when there are no cells. Patch by Georg Fleischmann . * Source/NSPopupButtonCell.m (-synchronizeTitleAndSelectedItem): Don't set selection index to 0, if apopup button doesn't have a selection. Patch by Andreas Höschler . 2006-02-05 Richard Frith-Macdonald * Source/NSMenuView.m: ([-sizeToFit]) Fix bug #15631 ([-locationForSubmenu:]) for horizontal root menus, make successive submenus be positioned with top left corner next to item in parent. * Source/NSApplication.m: Pass info in hide/unhide notifications. 2006-02-04 Richard Frith-Macdonald * Source/NSMenu.m: * Source/NSApplication.m: * Source/NSMenuItemCell.m: * Headers/AppKit/NSMenuItemCell.h: Tidyups suggested by Fred. More ideas welcome. * Source/NSMenuView.m: When tracking mouse for horizontal MacOS-X style menu, ignore an immediate mouse up and continue tracking until something is clicked on. This is the behavior of MacOS-X and windows. 2006-02-04 Richard Frith-Macdonald * Source/NSMenu.m: * Source/NSApplication.m: * Source/NSMenuItemCell.m: * Source/NSMenuView.m: * Headers/AppKit/NSMenuView.h: * Headers/AppKit/NSMenu.h: * Headers/AppKit/NSMenuItemCell.h: Add support for horizontal main menu (as in MacOS-X) very heavily based on the WildMenus bundle by Michael Hanni, but any errors in the integration are entirely mine. Horizontal menus are activated by setting the 'NSMenuInterfaceStyle' user default to 'NSMacintoshInterfaceStyle'. 2006-02-03 Quentin Mathe * Source/NSToolbarItem.m (-[GSToolbarButtonCell setImagePosition:]): New method to override NSButtonCell behavior. It should be the last commit needed to correct bug #15112 (reported by Wolfgang Sourdeau). Precisely it eliminates the default title set with separator or space toolbar items and the image release with toolbar items which include one (both issues occurs when NSToolbarDisplayModeLabelnOnly is set). 2006-02-03 Quentin Mathe * Source/NSButtonCell.m (-setImagePosition:): Fixed the title lost (reset to the default one) which was wrongly occuring when the image position is switched to 'NSNoImage' (partial fix for bug #15112, based on an NSCell patch by Wolfgang Sourdeau). 2006-02-03 Richard Frith-Macdonald * Source/NSWorkspace.m: In GSLaunched() be more defensive and don't assume that the values which should be present in the notification userinfo dictionry really are there. * Source/NSApplication.m: Code more defensively setting up notification info. Honor the NSWindow -canHide method when hiding the application. * Source/GSServicesManager.m: Improve handling of incoming messages, prohibit remote processes from calling private methods. * Source/NSWindow.m: * Source/NSWindowController.m: * Source/NSDataLinkManager.m: * Source/NSTextView.m: * Source/NSDocumentController.m: * Source/NSDataLink.m: * Source/NSView.m: * Source/NSDocument.m: Revert harmless but stupid changes made last night when I was too tired. 2006-02-02 Richard Frith-Macdonald * Source/NSWorkspace.m: remove an app from list of launched apps if we can't contact it. * Source/NSApplication.m: ([hideOtherApplications:]) implemented. ([unhideAllApplications:]) implemented. Send did hide and did unhide notifications to the workspace center so the workspace manager knows about them. Honor the NSWindow-canHide method when deactivating apps. * Source/NSWindow.m: Fix accessor methods which return a BOOL to do the right thing when they are accessing a bit in a bitfield. * Source/NSWindowController.m: ditto * Source/NSDataLinkManager.m: ditto * Source/NSTextView.m: ditto * Source/NSDocumentController.m: ditto * Source/NSDataLink.m: ditto * Source/NSView.m: ditto * Source/NSDocument.m: ditto Are these changes nneded? The compiler seemed to be casting bitfield values to char as things other than 1 or 0 ... but I was tired when looking at this and it seems unlikely. 2006-02-01 Richard Frith-Macdonald * Source/NSApplication.m: Send activation/deactivation notifications to workspace center too ... so workspace manager will know about it. * Source/NSWorkspace.m: Change internal method to launch applications so that it never asks the workspace manager to do it ... that should be handled by the public methods instead. Simplify a little to take advantage of change to NSApplication. 2006-01-27 Richard Frith-Macdonald * Source/NSApplication.m: pass more informative user info in notifications. * Source/NSWorkspace.m: Implement filesystem based fallback mechanisms for tracking launched and active appplications when there is no workspace manager process to do it. Try to be consistent about asking workspace manager application to perform tasks for us if it exists. * Tools/gscloseall.m: Test tool to iterate through launched apps and terminate them all. * Tools/GNUmakefile: * Tools/GNUmakefile.preamble: Build new utility. 2006-01-26 00:01 Gregory John Casamento * Source/NSScrollView.m: Temporary fix to scrollview. 2006-01-22 Fred Kiefer * Source/NSPopupButtonCell.m (-synchronizeTitleAndSelectedItem): Only select an item if one is highlighted. * Source/Functions.m: NSFrameRectWithWidthUsingOperation() new function from Cocoa. NSFrameRectWithWidth() different implementation, no longer using stroke. 2006-01-20 Fred Kiefer * Source/NSTableHeaderCell.m: Simplified code by letting the super classes do their job. 2006-01-14 Richard Frith-Macdonald * Source/NSWindow.m: minor fixups for 64bit cpu support. 2006-01-09 06:25 Gregory John Casamento * Source/NSNib.m: Correction for bug#15348. Removed uneeded append in initWithNibNamed: 2006-01-08 Fred Kiefer * Source/NSTableView.m (-initWithFrame:) Use different intercell spacing. Patch by Andreas Höschler . 2006-01-04 Fred Kiefer * Source/NSSliderCell.m (-knobRectFlipped,-knobThickness -drawInteriorWithFrame:inView:, -setKnobThickness:): Protect against knob image being nil. Fixes Solaris problem reported by . 2005-12-22 Adam Fedor * Version 0.10.2 2005-12-15 Quentin Mathe * Source/NSToolbarItem.m: (-[GSToolbarButton layout]): Don't set button based items width to their label width when NSToolbarDisplayModeIconOnly is active (based on patch by Wolfgang Sourdeau, partial fix for bug #15112). Removed superfuous code which substracted label height to button width in NSToolbarDisplayModeIconOnly case. (-initWithItemIdentifier:): Removed logical operator 'not' wrongly used with GSToolbarSeparatorItemIdentifier class identity test, it prevented any separator items to be inited therefore used (patch by Wolfgang Sourdeau, partial fix for bug #15112). 2005-12-05 fabien * Source/NSCursor.m: Improved documentation * Source/NSFontManager.m: Improved documentation * Source/NSFontPanel.m: Improved documentation * Source/NSMatrix.m: Improved documentation * Source/NSPanel.m: Improved documentation 2005-12-04 Fabien VALLON * Source/NSColorPanel.m: Improved documentation, various cleanups * Source/NSColor.m: Improved documentation * Source/NSClipView.m: Improved documentation * Source/NSColorWell.m: Improved documentation * Source/NSControl.m: Improved documentation 2005-12-04 Richard Frith-Macdonald * Source/GSServicesManager.m: Implement use of NSUseRunningCopy 2005-11-29 Fabien VALLON * Source/NSCachedImageRep.m : Improved documentation * Source/NSCell.m : Improved documentation 2005-11-29 Fred Kiefer * Source/NSTabView.m (-minimumSize): Filled in some code. * Source/NSTextField.m (-validateEditing, -textDidChange:): Check is delegate responds to selector before calling it. Patch by Andreas Höschler 2005-11-25 fabien * Source/NSBox.m: Improved documentation * Source/NSCell.m: Documentation : closed the ref tag for -setType: * Source/NSBrowser.m: Improved documentation, various cleanups. * Source/NSBrowserCell.m: Improved documentation. * Source/NSButton.m: Improved documentation. * Source/NSButtonCell.m: Improved documentation. 2005-11-24 12:33 Gregory John Casamento * Source/NSCell.m: Added documentation for setType:. 2005-11-24 fabien * Source/NSMatrix.m: Improved documentation, various cleanups * Source/NSOpenPanel.m: Improved documentation * Source/NSPageLayout.m: Improved documentation * Source/NSPopUpButton.m: Improved documentation * Source/NSSavePanel.m: Improved documentation * Source/NSScrollView.m: Improved documentation * Source/NSTexField.m: Improved documentation * Source/NSFont.m: Improved documentation, various cleanups * Source/NSImage.m: Improved documentation, various cleanups * Source/NSScroller.m: Improved documentation, various cleanups 2005-11-22 Richard Frith-Macdonald * Headers/Additions/GNUstepGUI/GSDrawFunctions.h: * Source/GSDrawFunctions.h: Make drawing methods go via theme engine. 2005-11-22 fabien * Source/NSCell.m : Improved documentation * Source/NSControl.m : Improved documentation * Source/NSCustomImageRep.m : Improved documentation * Source/NSFontPanel.m : Improved documentation * Source/NSForm.m : Improved documentation * Source/NSFormCell.m : Improved documentation * Source/NSImage.m : Improved documentation * Source/NSMatrix.m : Improved documentation 2005-11-21 fabien * Source/NSButton.m : Improved documentation * Source/NSButtonCell.m : Improved documentation * Source/NSCachedImageRep.m : Improved documentation * Source/NSCell.m : Improved documentation * Source/NSClipView.m : Improved documentation * Source/NSColor.m : Improved documentation * Source/NSColorPanel.m : Improved documentation * Source/NSColorWell.m : Improved documentation 2005-11-21 Fred Kiefer * Source/NSSliderCell.m (-drawInteriorWithFrame:inView:): Allow the knob image to resize. Patch by Georg Fleischmann * Source/NSTextField: (textView:doCommandBySelector:) new method to pass on the request to the delegate, if possible. 2005-11-21 Richard Frith-Macdonald * Source/NSPasteboard.m: Turn off warning message about launching gpbs ... now that we use host-local connections and expect the pastebaord server to be private to the user, there is no real reason why it shouldn't be routinely launched on demand. 2005-11-20 Richard Frith-Macdonald * Source/GSServicesManager.m: GSContactApplication() Fix bug launching application ... if it's not available in the services bundle, locate application by name (from the port). 2005-11-18 fabien * Source/NSSliderCell.m: Improved documentation * Source/NSTextField.m: Improved documentation * Source/NSTextFieldCell.m: Improved documentation * Source/NSSavePanel.m: Improved documentation * Source/NSOpenPanel.m: Improved documentation * Source/NSApplication.m: Improved documentation * Source/NSBitmapImageRep.m: Improved documentation * Source/NSBox.m: Improved documentation * Source/NSBrowserCell.m: Improved documentation 2005-11-17 fabien * Source/NSControl.m : Improved documentation * Source/NSCustomImageRep.m : Improved documentation * Source/NSFontPanel.m : Improved documentation * Source/NSForm.m : Improved documentation * Source/NSFormCell.m : Improved documentation * Source/NSSlider.m : Improved documentation 2005-11-16 fabien * Source/NSColorPanel.m : Improved documentation * Source/NSColorWell.m : Improved documentation 2005-11-16 Richard Frith-Macdonald * Source/GSEPSPrintOperation.m: * Source/GSHelpManagerPanel.m: * Source/GSHorizontalTypesetter.m: * Source/GSLayoutManager.m: * Source/GSNibCompatibility.m: * Source/GSNibTemplates.m: * Source/GSPDFPrintOperation.m: * Source/GSPrintOperation.m: * Source/GSPrinting.m: * Source/GSSlideView.m: * Source/GSTable.m: * Source/GSToolbar.m: * Source/NSAlert.m: * Source/NSApplication.m: * Source/NSBezierPath.m: * Source/NSBitmapImageRep+PNM.m: * Source/NSBox.m: * Source/NSBrowser.m: * Source/NSBrowserCell.m: * Source/NSBundleAdditions.m: * Source/NSCell.m: * Source/NSColor.m: * Source/NSColorList.m: * Source/NSColorWell.m: * Source/NSCustomImageRep.m: * Source/NSDataLink.m: * Source/NSDataLinkManager.m: * Source/NSDataLinkPanel.m: * Source/NSDocument.m: * Source/NSForm.m: * Source/NSGraphicsContext.m: * Source/NSHelpManager.m: * Source/NSImage.m: * Source/NSLayoutManager.m: * Source/NSMatrix.m: * Source/NSNib.m: * Source/NSOpenGLPixelFormat.m: * Source/NSOpenGLView.m: * Source/NSOutlineView.m: * Source/NSPageLayout.m: * Source/NSPrintInfo.m: * Source/NSPrintOperation.m: * Source/NSPrintPanel.m: * Source/NSPrinter.m: * Source/NSResponder.m: * Source/NSRulerView.m: * Source/NSSelection.m: * Source/NSSpellChecker.m: * Source/NSSpellServer.m: * Source/NSSplitView.m: * Source/NSStepper.m: * Source/NSTabView.m: * Source/NSTableView.m: * Source/NSTextView.m: * Source/NSTextView_actions.m: * Source/NSToolbarItem.m: * Source/NSView.m: * Source/NSWindow.m: * Source/NSWorkspace.m: Fix some common coding style violations ... should have no effect other than improving readability. 2005-11-15 fabien * Source/NSColor.m : Improved documentation, various cleanups. 2005-11-09 fabien * Source/NSCell.m : Improved documentation 2005-11-08 fabien * Source/NSBox.m : Improved documentation * Source/NSBrowser.m : Ditto * Source/NSBrowserCell.m : Ditto * Source/NSButton.m : Ditto 2005-11-06 Fred Kiefer * Source/NSImage.m (-bestRepresentationForDevice:): Get the device description from the current context, not via NSScreen, as we cannot be sure about the screen order. * Source/NSApplication.m (-_init): Make sure the default context has properly set attributes. 2005-11-03 Fred Kiefer * Source/NSBrowser.m (-setPath:): Corrected memory management bug 14901. 2005-11-02 Nicolas Roard * Headers/Additions/GNUstepGUI/GSDrawFunctions.h, * Source/GSDrawFunctions.m (+[theme],+[setTheme:]): New accessor methods. 2005-10-30 Adam Fedor * Documentation/General/OpenStepCompliance.gsdoc: Updates. 2005-10-25 Richard Frith-Macdonald * Source/NSColorList.m: ([writeTofile:]) return NO if there is no known directory to write to. 2005-10-23 Richard Frith-Macdonald * Source/NSWindow.m: ([setExcludedFromWindowsMenu:]) when a window is excluded, remove it from the windows menu. Fixes bug #14008 2005-10-22 Richard Frith-Macdonald * Tools/make_services.m: Update to use NSSearchPathForDirectoriesInDomains() more extensively so that we get all the directories we should using the new configuration information, rather than the default set. 2005-10-20 Fred Kiefer * Source/GSTitleView.m: Corrected last change the signature of [rightMouseDown:] had been changed instead of [menuForEvent:]. 2005-10-20 Fred Kiefer * Header/NSInputManager.h * Source/GSTitleView.m * Source/NSColor.m * Source/NSImageCell.m * Source/NSResponder.m * Source/NSSavePanel.m * Source/NSTabView.m * Source/NSTableHeaderView.m * Source/NSMenuView.m Removed compiler warnings from gcc 4.0.2. 2005-10-18 Fred Kiefer * Source/NSApplication.m (-terminate:): Call NSDocumentControllers review unsaved code only when this is a document based application. 2005-10-17 Fred Kiefer * Source/NSSavePanel.m (-performDragOperation:): Set file name and directory to allow dragging of files, not just directories. 2005-10-14 Fred Kiefer * Source/NSRulerView.m (-drawHashMarksAndLabelsInRect:): For vertical rulers use ruler thickness to position labels. Patch by Saso Kiselkov . 2005-10-09 Richard Frith-Macdonald * Source/GSServicesManager.m: Improve handling of port registration to ensure each application listens on a well known port and the port name is readable. If multiple copies of an app are running, name the extra copies AppCopy1 AppCoppy2 etc. * Source/NSWorkspace.m: Use advertised port name for the app name so that other apps can contact it. Implement ([-extendPowerOffBy:]) to ask workspace application. * Tools/gclose.m: Triavial utility ... counterpart for gopen ... close doen an application.Saso Kiselkov * Tools/GNUmakefile: build gclose 2005-10-08 Richard Frith-Macdonald * Source/NSWorkspace.m: Provide private method to post a notification to the local workspace center, using the shared workspace app as the notification object. Fix handling of incoming notifications so that they use the new method and are therefore posted locally with the correct notification object. * Source/GSServicesManager.m: Make applications respond to the terminate: method sent from another app, but send a power off notification first, on the assumption that a terminate sent by a remote process is a power off or session manager shutdown or some similar event indicating that the process is likely to be forcably killed if it doesn't close down gracefully. 2005-10-05 Fred Kiefer * Source/NSCell.m (-setObjectValue:, -setStringValue:): When no formatter is present, the object value is always valid. Also allow attributed strings to be passed through. Based on patches by Saso Kiselkov and Andreas Hoeschler . 2005-09-19 Adam Fedor * Version 0.10.1 2005-09-10 17:02 Gregory John Casamento * Source/externs.m: Added constants for data link. * Source/NSDataLink.m: Removed NSDataLinkFilenameExtension constant. * Source/NSDataLinkManager.m: Added implementation for addLinkAsMarker:at:, addLinkPreviouslyAt:fromPasteboard:at:. 2005-09-10 Adam Fedor * configure.ac: Check for libgib if libungif is not found. Fixes Bug #14454. 2005-08-25 Richard Frith-Macdonald * Source/NSView.m: ([_viewDidMoveToWindow]) Implemented and used to send notification to subviews as we should. 2005-08-22 14:36 Gregory John Casamento * Source/NSInterfaceStyle.m: -[GSInterfaceStyle defaultsDidChange:] correction for val variable. Previously this was the enumerated type NSInterfaceStyle. This caused some alighnment issues on 64bit platforms. I have also tested this change on i386/Linux. 2005-08-17 Adam Fedor * configure.ac: Check for v19 of portaudio. 2005-08-17 Enrico Sersale * Tools/gsnd/gsnd.m: updated to use libportaudio v19. * Tools/gsnd/gsnd.m: in main(): uses NSTask to create a daemon. 2005-08-17 Serg Stoyan * Source/NSBrowser.m: (tile): Fix calculating columns width for unseparated columns. * Source/NSSplitView.m: (mouseDown:): Don't try to resize subviews if divider positon wasn't changed. * Source/NSPopUpButtonCell.m: (trackMouse:inRect:ofView:untilMouseUp:): Dismiss the popup after mouse tracking done. This is for the cases when mouse up event occurs outside of popup. 2005-07-27 Adam Fedor * Source/GNUmakefile.postamble (Info-gnustep.plist): Depend on ../Version. * Source/NSOutlineView.m ([NSOutlineView -rowForItem:]): Declare var at beginning of block for gcc2 (Fixes Bug #13936). 2005-07-25 22:28 Gregory John Casamento * Source/NSOutlineView.m: Make [NSOutlineView rowForItem:] return -1 as per specs, instead of NSNotFound. 2005-07-22 Adam Fedor * Version 0.10.0 2005-07-21 08:33 Gregory John Casamento * Source/GSNibTemplates.m: in GSWindowTemplate initWithCoder:, temporarily retain, then release (after setting back into the window) the content view to prevent it from being inadvertantly deallocated. 2005-07-17 Adam Fedor * Source/NSApplication.m (gnustep_backend_path, gnustep_backend_framework, gnustep_backend_bundle): New functions. (initialize_gnustep_backend): Support versioning of backend bundle. 2005-07-17 Adam Fedor * Documentation/Gui.gsdoc, Documentation/GuiAdditions.gsdoc Documentation/ReleaseNotes.gsdoc, Documentation/readme.texi Documentation/GuiUser/DefaultsSummary.gsdoc Documentation/GuiUser/KeyboardSetup.gsdoc Documentation/GuiUser/LanguageSetup.gsdoc, Source/NSView.m: Fix some documentation errors. 2005-07-12 Richard Frith-Macdonald * Source/NSApplication.m: (_NSAppKitUncaughtExceptionHandler) As there was no other feedback to the recent email thread on this, I've removed the option to try to 'ignore' the exception ... since it would most likely result in a random crash (possibly with loss of data etc) at a later point. 2005-07-09 Adrian Robert * Source/NSSavePanel.m (-ok:): Set _fullFileName before invoking delegate -panel:userEnteredFilename:confirmed: so it is given the current filename to process. 2005-07-09 Fred Kiefer * Headers/AppKit/NSGraphicsContext.h, * Source/NSGraphicsContext.m: Added new methods [-GScomposite:toPoint:fromRect:operation:fraction:] and [-GSSetPatterColor:]. * Source/NSImage.m (-compositeToPoint:...fraction:): Implemented. * Source/NSColor.m (GSPatternColor -set): Implemented. 2005-07-04 Adam Fedor * Documentation/ReleaseNotes.gsdoc: Update. 2005-07-01 Adam Fedor * Documentation/Gui.gsdoc, Documentation/GuiAdditions.gsdoc, Documentation/ReleaseNotes.gsdoc, Documentation/gopen.1, Documentation/make_services.1, Documentation/General/OpenStepCompliance.gsdoc, Documentation/GuiUser/DefaultsSummary.gsdoc, Documentation/GuiUser/KeyboardSetup.gsdoc, Documentation/GuiUser/LanguageSetup.gsdoc, Model/Controller.h, Model/Controller.m, Model/test.m, PrinterTypes/GSProlog.ps, Printing/GSCUPS/GNUmakefile.postamble, Printing/GSCUPS/GNUmakefile.preamble, Printing/GSLPR/GNUmakefile.postamble, Printing/GSLPR/GNUmakefile.preamble, Tools/GNUmakefile.postamble, Tools/GNUmakefile.preamble, Tools/wgetopt.h, Tools/gsnd/GNUmakefile.postamble, Tools/gsnd/GNUmakefile.preamble: Add/fix copyright/licenses. 2005-07-01 Richard Frith-Macdonald * Source/NSApplication.m: (_NSAppKitUncaughtExceptionHandler) Call [NSApp run] to re-enter runloop if we are told to ignore the exception. Not sure this is right though ... probably the option to ign ore should be removed. 2005-06-28 Richard Frith-Macdonald * Source/NSScrollView.m: ([-initWithFrame:) create a hidden horizontal ruler for MacOS-X and OPENSTEP compatibility. Fix bug #13310 * Source/NSRulerView.m: ([-dealloc]) Don't release _clientView as we don't own it. Fixes bug #13382 2005-06-22 Fred Kiefer * Source/NSMenu.m (-setGeometry): Use [NSWindow setFrameFromString:] when possible to position the menu windows relative to the screen size. (-isPartlyOffScreen_OFFSCREEN, -setGeometry, -shiftOnScreen) Use current screen and visibleFrame of screen instead of frame. 2005-06-18 Fred Kiefer * Source/NSColor.m (+colorFromString:): Make sure the scanner is always released. Fixes bug reported by Benhur Stein . 2005-06-17 Adam Fedor * Source/NSPopUpButtonCell.m (-setObjectValue:): Use respondsToSelector. 2005-06-16 Fabien Vallon * Source/NSProgressIndicator.m: setAnimationDelay: fix typo * Headers/AppKit/NSProgressIndicator: ditto 2005-06-06 Richard Frith-Macdonald * Source/NSWorkspace.m: ([-mountedLocalVovumePaths]) implemented for mingw as a listing of all device names. Implement for unix using getmntent. * configure.ac: add checks for getmntent variations. Tested on debian, may need tweaks for others. 2005-06-06 Adrian Robert * Headers/AppKit/NSApplication.h * Headers/AppKit/NSEvent.h * Source/GSServicesManager.m * Source/NSApplication.m * Source/NSFont.m: Filled in various GSdoc. 2005-06-04 08:11 Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibTemplates.h: Minor update to constant name. * Source/GSNibTemplates.m: Use new constant name, and move call to autoPositionWindow: outside of class name check. 2005-06-04 07:36 Gregory John Casamento * Headers/Additions/GNUstepGUI/GSNibTemplates.h: Constants for new autoposition scheme, declaration for setAutoPositionMask:, autoPositionMask and autoPositionWindow: methods. * Source/GSNibTemplates.m: Code in [GSWindowTemplate initWithCoder:] to handle new version. Also new method autoPositionWindow: to handle window placement. 2005-05-30 Fred Kiefer * Source/NSPopupButtonCell.m (-dealloc) Corrected previous fix to only dismiss the popup, when it is actualy visible. This caused a problem with the window deallocation mechanism, when the window containing the popup button was closed. 2005-05-30 Fred Kiefer * Source/NSTableView.m (-mouseDown): No longer copy the cell, as this was causing trouble in GNUmail and Gworkspace. * Source/NSComboBox.m (-trackMouse:inRect:ofView:untilMouseUp:): Only mark the cellframe as needing redraw. Patch by Matt Rice . 2005-05-27 Adam Fedor * Source/NSAffineTransform.m (matrix_multiply): New function. (appendTransform:, prependTransform:, rotateByRadians:, scaleBy:, scaleXBy:yBy:, translateXBy:yBy:, concatenateWithMatrix:): Use it. (rotateByDegrees:) Use rotateByRadians:. Fixes bug #13181. 2005-05-27 Fred Kiefer * Source/NSPopupButtonCell.m (-dealloc) Dismiss the popup. This is to make sure the removed popup no longer gets notifications. may happen when the cell gets deallocated without closing the popup. 2005-05-26 Fred Kiefer * Source/NSTableView.m (-mouseDown): Replaced use of _sendsActionOn: with a check if the value did change after the cell did track the mouse. Also use a copy of the cell, that way other cells are not affected by changes in the tracked cell. Patch based on code by Matt Rice . 2005-05-25 Adam Fedor * Update FSF Address. 2005-05-23 Fred Kiefer * Source/NSAlert.m (-_setupPanel): New method. (-runModal, -beginSheetModalForWindow:...contextInfo:) Use this new method. 2005-05-22 Fred Kiefer * Source/NSView.m (-display) * Source/NSCell.m (-drawWithFrame:inView:) * Source/NSBrowserCell.m (-drawWithFrame:inView:) * Source/NSImageCell.m (-drawWithFrame:inView:) * Source/NSMenuItemCell.m (-drawWithFrame:inView:) * Source/NSTableHeaderCell.m (-drawWithFrame:inView:): Removed check for window existence. This should already have been checked by a surrounding canDraw call. Fixes bug #13140. 2005-05-22 Fred Kiefer * Source/NSComboBox.m (-cellSize) Added simple implementation of this method to get sizeToFit working. (GSComboWindow -layoutWithComboBoxCell:) Don't subtract the width of the scroller from the popup item size, increase the popup width instead. 2005-05-20 Fred Kiefer * Source/NSWindow.m (-center, -constrainFrameRect:toScreen:) Use screen visibleFrame instead of frame. * Source/NSWindow.m (-animationResizeTime:, -setFrame:display:animate:) Implemented this methods. 2005-05-20 Fred Kiefer * Headers/AppKit/NSResponder.h: Added new MacOSX methods. * Source/NSResponder.m (-encodeWithCoder:, initWithCoder:) Handle NSNextResponder for keyed encoding. * Source/NSResponder.m * Source/NSApplication.m * Source/NSWindow.m * Source/NSView.m * Source/NSControl.m: Implemented shouldBeTreatedAsInkEvent:. 2005-05-19 Fred Kiefer * Source/NSImageCell.m (-setObjectValue:) Nil parameter now unsets image. This resolves bug #13046. 2005-05-02 23:45 Gregory John Casamento * Source/GSNibTemplates.m: added condition to all of the templates so that the designated init is not called when the className and the superClass are equivalent. 2005-05-01 17:09 Adrian Robert * Source/GSNibTemplates.m: [GSWindowTemplate initWithCoder:] changed so designated initializer is called with content frame. 2005-04-30 Adrian Robert * Headers/AppKit/NSFont.h: Add 'cachedFlippedFont' ivar. * Source/NSFont.m: Cache font for drawing in flipped views in manner analogous to font for screen drawing. 2005-04-28 Adam Fedor * configure.ac: More complete check for portaudio * Tools/gsnd/gsnd.m: Fix portaudio include 2005-04-27 Adrian Robert * Headers/AppKit/NSApplication.h: Add app_is_launched ivar. * Source/NSApplication.m (-run): Only go through launch process and call -finishLaunching on first call. (-replyToApplicationShouldTerminate:) Unhide mouse on app exit. 2005-04-25 Adam Fedor * configure.ac: Check for lib portaudio * Tools/gsnd/GNUmakefile: Use lib portaudo. * Tools/gsnd/portaudio: Remove portaudio files. * Documentation/install.texi: Updates. 2005-04-25 00:02 Gregory John Casamento * Source/GSNibTemplates.m: [GSClassSwapper initWithObject: className:superClassName:] removed assertion which prevents using the same class name for both arguments. Also cleaned up some commented out code. 2006-04-19 Adam Fedor * configure: Add arg to disable aspell (for use on Mac OS X). * Source/NSBitmapImageRep+JPEG.m: Add workaround so that INT32 is not redefined on MingW by jmorecfg.h (Suggestion from Issac Trotts). 2005-04-17 Fred Kiefer * Source/NSPopupButton.m (-keyDown:) Removed unneeded code. (-_handleNotification:): Moved method from here ... * Source/NSPopupButtonCell.m: ... to here. (-dismissPopUp, -attachPopUpWithFrame:inView:): Dis-/Connect self, not the control view, with notification centre. Fixes bug #12680. (-synchronizeTitleAndSelectedItem): Update the control view. (-trackMouse:inRect:ofView:untilMouseUp:): Removed unneeded code. (-attachPopUpWithFrame:inView:): Set the selected item to highlighted. 2005-04-17 Fred Kiefer * Source/NSColor.m: Implemented the missing keyed encoding methods. 2005-04-11 10:24 Gregory John Casamento * Source/GSNibTemplates.m: Correction for minor leak in GSClassSwapper dealloc method. 2005-04-09 Fred Kiefer * Source/NSColor.m: Implemented most keyed encoding methods. * Source/NSFont.m: Implemented simple keyed encoding. 2005-04-08 Fred Kiefer * Source/NSView.m (-addSubview:positioned:relativeTo:): Don't increase index for subview added at the end. Based on patch by Matthias Hengartner . 2005-04-03 14:53 Gregory John Casamento * Source/NSCustomImageRep.m: Allow drawing if the delegate is set since the size may not have been set as of yet. This behavior is consistent with that observed on OPENSTEP4.2/Mach. This fix corrects bug #12412. 2005-04-03 Richard Frith-Macdonald * Headers/AppKit/NSTextView.h: Keep track of whether we are acting as a target for a DnD operation, and what the selected range was before the operation began. * Source/NSTextView.m: Display insertion point during DnD operation Fixes bug #9788 2005-04-02 Richard Frith-Macdonald * Source/NSTableView.m: ([-mouseDown:]) tweak vertical image offset because view is flipped. Still not sure this code is correct ... which coordinate system is the image offset supplied by ([-dragImageForRows:event:dragImageOffset:]) supposed to be in? 2005-04-01 Adam Fedor * Headers/AppKit/NSDataLinkManager.h, Source/NSDataLinkManager.m: Re-add the changes from 2005-03-05. 2005-04-01 Richard Frith-Macdonald * Source/GSDragView.m: when dragging, use the mouse offset to adjust the initial position of the dragged image. Modified internally to pass the original position of the image so that slideback can slide to that position rather than the position the mouse started from. This makes no difference if the initial mouse offset was zero, but does have an effect if the drag was initiated by a mouse move at a location offset from the original mouse down. Exposed a couple of methods for subclasses. * Source/NSColorPanel.m: Set image position for DnD so that color swatch is centered on the mouse position. * Source/NSImageView.m: ditto * Source/NSTableView.m: ([-mouseDown:]) after calling the ([-dragImageForRows:event:dragImageOffset:]) method, use the returned offset to position the center of the image relative to the mouse pointer .. I *think* that's what the apple documentation of the method means. 2005-03-30 Adam Fedor * Version 0.9.5 * Headers/AppKit/NSDataLinkManager.h, Source/NSDataLinkManager.m: Partially revert 2005-03-05 patch for this release. 2005-03-29 Adrian Robert * Source/NSWorkspace.m (-_extIconForApp:info:): Check filename is not empty string before passing to [NSBunder -pathForImageResource:]. 2005-03-29 Adrian Robert * Source/NSGraphicsContext.m: Undeprecate DPSxshow, DPSyshow, DPSxyshow, DPSashow, DPSwidthshow, and DPSawidthshow. 2005-03-29 Richard Frith-Macdonald * Source/GSDragView.m: * Headers/Additions/GNUstepGUI/GSDragView.h: Minor tweaks to ease subclassing. 2005-03-28 Richard Frith-Macdonald * Source/GSDragView.m: Fix a few bugs exposed by windows port and tidy/add comments to clarify operation. When initiating DnD session, take offset argument into account rather than ignoring it. * Headers/Additions/GNUstepGUI/GSDragView.h: Improve comments and change offset to be NSSize rather thgan NSPoint. 2005-03-21 Adam Fedor * Tools/gsnd/portaudio/pa_unix_oss/pa_unix_oss.c: Fix for FreeBSD FTBFS (Fixes Bug #12316). Strip DOS CRs. 2005-03-21 Adam Fedor * configure.ac: Check for libgif * Source/NSBitmapImageRep+GIF.m: Support libgif * Source/NSBitmapImageRem.m: Idem. (Fixes Bug #12362). 2005-03-19 Adam Fedor * Headers/AppKit/DPSOperators.h, Headers/AppKit/NSGraphics.h: Modify selectors to play nice with C++ compiler. * Headers/AppKit/NSAffineTransform.h, Headers/AppKit/NSFontManager.h, Headers/AppKit/NSPageLayout.h: Modify arg name for same purpose. * Source/NSAffineTransform.m, Source/NSFontManager.m, Source/NSPageLayout.m: Modify to match header. (Patch from Francis Franklin, with some modifications). 2005-03-14 Fred Kiefer * Source/NSMatrix.m: ([_renewRows:columns:rowSpace:colSpace:]) Corrected last patch so that the open panel works again. Initialize all new cells, not just the requested ones. 2005-03-14 Richard Frith-Macdonald * Source/NSMatrix.m: ([removeRow:]) set column counts to zero if all rows are removed ([removeColumn:]) set row counts to zero if all columns are removed ([_renewRows:columns:rowSpace:colSpace:]) initialise all columns of any newly created rows (up to _maxCols) rather than just the number specified by the method argument. Otherwise we get uninitialised columns in the matrix which will cause a crash when they are used. Fixes bug #12299 2005-03-13 Richard Frith-Macdonald * Headers/AppKit/NSGraphics.h: Fix prototype for stricter compiler. * Source/Functions.m: ditto Deal with bug #12296 2005-03-10 Nicola Pero * Headers/AppKit/AppKitDefines.h (GS_EXPORT): Use extern, not __declspec(dllexport), on mingw 2005-03-10 Nicola Pero * configure.ac: Fixed setting variable when libjpeg can't be found. * configure: Regenereated. 2005-03-07 Fred Kiefer * Header/AppKit/NSCell.h: Moved NSControlSize definition to ... * Header/AppKit/NSColor.h: ... here and added NSMiniControlSize. For NSControlTint added NSBlueControlTint and NSGraphiteControlTint. * Header/AppKit/NSFont.h (+menuBarFontOfSize:, +systemFontSizeForControlSize:, -numberOfGlyphs, -coveredCharacterSet, -fontDescriptor): New MacOSX 10.3 methods. * Source/NSFont.m: Added dummy implementations for the new methods. 2005-03-05 Adrian Robert * Source/NSApplication.m (-_windowDidResignKey:) Unhide mouse. 2005-03-05 Adrian Robert * Source/NSScroller.m (-checkSpaceForParts, -rectForPart:) Calculate buttonsWidth variable dynamically based on +scrollerWidth (supports width override by subclass). 2005-03-05 10:53 Gregory John Casamento * Headers/AppKit/NSDataLink.h * Headers/AppKit/NSDataLinkManager.h: Added some ivars * Source/Functions.m: Changed the NSLinkFrameThickness() function to return 1 instead of 1.5. * Source/NSDataLink.m: Implemented several methods. * Source/NSDataLinkManager.m: Implemented several methods. * Source/NSDataLinkPanel.m: Change version from 1 to 0. * Source/NSSelection.m: Change version from 1 to 0, corrected but in initWithCoder:. 2005-03-03 Adam Fedor * configure.ac: Disable gsnd on darwin * Tools/GNUmakefile.preamble (GSspell_TOOL_LIBS): Add lib depends. 2005-02-27 Adrian Robert * Source/NSApplication.m (-runModalForWindow:) Clarify gsdoc explaining why we don't follow Apple docs here. (Corrects gsdoc from change on 2005-01-26, which itself documented a code change on 2005-01-18.) 2005-02-26 18:04 Alexander Malmberg * Headers/Additions/GNUstepGUI/GSServicesManager.h: Include the NSMenuItem.h header instead of forward declaring the NSMenuItem protocol. 2005-02-23 Fred Kiefer * Header/AppKit/NSColor.h (-alternateSelectedControlColor, -alternateSelectedControlTextColor, -secondarySelectedControlColor, controlAlternatingRowBackgroundColors): New MacOSX system colour methods. * Source/NSColor.m (-alternateSelectedControlColor, -alternateSelectedControlTextColor, -secondarySelectedControlColor, controlAlternatingRowBackgroundColors): Implemented the new methods. (initSystemColors): Added default values for new system coloure methods 2005-02-21 Fred Kiefer * Source/NSCell.m (-initWithCoder): * Source/NSButtonCell.m (-initWithCoder): * Source/NSBrowser.m (-initWithCoder): Small improvements on keyed decoding of flags. 2005-02-19 Fred Kiefer * Source/NSSavePanel.m (-_setDefaultDirectory): New method to get default directory from user defaults (NSDefaultOpenDirectory). (-_resetDefaults): Use it for setting of default directory. (-_setupForDirectory:file:): Use the new method here as well if no path is provided. Cleaned up this method. (-cancel:) Don't clean up filename and set directory to current. (-ok:) Don't set _OKButtonPressed. * Source/NSOpenPanel.m (-ok:): Don't set _OKButtonPressed. (-_setupForDirectory:file:): Removed code duplicating super class implementation. This fixes most of bug #7900. 2005-02-14 Fred Kiefer * Source/NSPopupButton.m (-mouseDown:): Moved code from here ... * Source/NSPopupButtonCell.m (-trackMouse:inRect:ofView:untilMouseUp:): ... to here. This fixes bug #9824. 2005-02-14 Richard Frith-Macdonald * Source/GSTitleView.m (-mouseDown:): Post an NSWindowDidMoveNotification at end of method if window was dragged. Fixes bug #11906 2005-02-12 Fred Kiefer * Headers/Additions/GNUstepGUI/GSDisplayServer.h (-setalpha::): Declare. * Source/GSDisplayServer.m (-setalpha::): New method for window alpha setting, with empty default implementation. * Source/NSWindow.m (-setAlphaValue:): Implemented alpha setting via display server. (-_initDefaults): Set _alphaValue to 1.0. 2005-02-12 Fred Kiefer * Model/GMAppKit.m (NSButtonCell-initWithModelUnarchiver:): Resorted code to work around AppKit change on button type handling. Patch by Georg Fleischmann 2005-02-12 Fred Kiefer * Source/NSAffineTransform.m (-boundingRectFor:result:): Further corrections on last change. 2005-02-11 Fred Kiefer * Source/NSAffineTransform.m (-boundingRectFor:result:): Corrected algorithm to compute bounding box for transformed rectangle (Code based on Cairo). This fixes bug #11562. 2005-02-08 Matt Rice * Source/NSApplication.m (-changeWindowsItem:title:filename:): If the window can become key, use makeKeyAndOrderFront: as the action. (-updateWindowsItem:, -setWindowsMenu): Compare the title to what it would be if there was a represented filename, not the filename. * Source/NSApplication.m (-orderWindow:relativeTo:): Ditto. (-setExcludedFromWindowsMenu): Ditto. 2005-02-08 Fred Kiefer * Source/NSSecureTextField.m (-drawInteriorWithFrame:inView:): Draw the background colour of the cell. 2005-02-07 Fred Kiefer * Source/NSTableView.m (-expandItem:expandChildren:, collapseItem:collapseChildren:): Added a call to setNeedsDisplay:, so the new status will be shown correctly. (_openItem:): Removed setNeedsDisplay: call as all callers do it already. 2005-02-05 15:42 Gregory John Casamento * Headers/AppKit/NSDataLinkManager.h: Moved NSDataLinkManager delegate methods to an informal protocol NSDataLinkManagerDelegate. * Source/Functions.m: Implemented NSFrameLinkRect() to draw the frames around source and destination links. * Source/NSBundleAdditions.m: Modified -description method in NSNibConnector to display the source, destination and label for the connection. This makes it easier to debug. * Source/NSDataLink.m: Implemented a few private methods. * Source/NSDataLinkManager.m: Implemented -breakAllLinks. 2005-02-03 10:54 Alexander Malmberg * Source/NSImage.m (min, max): Rename to ... (gs_min, gs_max): ... this. Update callers. 2005-01-28 21:58 Gregory John Casamento * Source/NSColorWell.m: [NSColorWell mouseDown:] prevent use of the colorwell when it's disabled. 2005-01-28 17:57 Alexander Malmberg * Source/NSImageCell.m (-drawInteriorWithFrame:inView:): If our view is flipped, flip the image. 2005-01-26 Adrian Robert * Source/NSApplication.m (-beginModalSessionforWindow:): Center panels only if they are not already up, matching OS X Panther; document. (-runModalForWindow:, -runModalSession:): Clarify documentation. 2005-01-25 01:05 Alexander Malmberg * Source/NSImageCell.m (-drawInteriorWithFrame:inView:): Use -drawInRect:fromRect:operation:fraction: to draw the image. 2005-01-25 00:29 Alexander Malmberg * Headers/AppKit/NSImage.h (-drawAtPoint:fromRect:fraction:) (-drawInRect:fromRect:operation:fraction:): Document. * Source/NSImage.m -drawAtPoint:fromRect:fraction:) (-drawInRect:fromRect:operation:fraction:): Implement. (min, max): New functions. (-drawRepresentation:inRect:): Save the gstate before drawing and restore it afterwards. Fixes bug #11712. 2005-01-24 16:57 Alexander Malmberg * Source/NSPopUpButtonCell.m (-synchronizeTitleAndSelectedItem): For non-pulldowns, make sure the selected item and the highlighted item are the same. 2005-01-24 Quentin Mathe * Source/GSToolbarView.m (initSystemExtensionsColors()): Removed spurious 'else' (introduced with revision 1.11) which prevented toolbar colors loading code to be executed (Fix the white toolbar background bug reported by Riccardo Mottola). 2005-01-24 Adrian Robert * Source/NSSavePanel.m (-_shouldShowExtension:isDir:, -setRequiredFileType:, -requiredFileType, -filename): For filename display filtering, handle case where _requiredFileType is unset or set to nil or "" by allowing any extension (including none), as specified in Apple docs, instead of allowing no extensions, as it was. Document. 2005-01-24 00:48 Alexander Malmberg * Source/NSImageCell.m (-drawInteriorWithFrame:inView:): Draw the image using the right size, but don't scale it. Work around bug #11712. 2005-01-22 Adrian Robert * Source/NSFontManager.m (-fontWithFamily:traits:weight:size:) Corrected logic in fallback approximate trait search for weight 5 or 6 (regular) fonts. Font w/approximate traits but originally-requested weight will now be found. 2005-01-21 21:43 Alexander Malmberg Various whitespace cleanups, comment type fixes, and changes to avoid warnings from recent versions of gcc. * Headers/Additions/GNUstepGUI/GSToolbar.h (-_toolbars): Declare. * Source/NSWindow+Toolbar.m: Remove conflicting declaration of [NSToolbar -_toolbars]. * Headers/Additions/GNUstepGUI/GSServicesManager.h, Source/GSServicesMananger.m (-item2title:, -validateMenuItem:): Adjust argument types. * Headers/AppKit/NSMenu.h (-validateMenuItem:): Adjust argument type. * Source/NSTextView.m (-sizeToFit): Don't use size uninitialized if neither resizable flags is set. (-insertText:): Adjust argument type. * Headers/AppKit/NSResponder.h, Source/NSResponder.m (-insertText:): Adjust argument type. Document. * Headers/AppKit/NSView.h: Change type of ivar _window to NSWindow *. * Source/GSTitleView.m (-mouseDown:): Always initialize startWindowOrigin. * Source/NSApplication.m (-setApplicationIconImage:): Add casts to avoid warnings. * Source/NSCell.m (-cellSize): Add default: case. * Source/NSPasteboard.m ([GSFiltered -pasteboard:provideDataForType:]): Detect and warn if we can't find a filter that will get us the desired type. * Source/NSProgressIndicator.m: Comment out unused variable 'images'. * Source/NSBezierPath.m: Declare GSBezierPath fully before using it. (-bezierPathByFlatteningPath, -bezierPathByReversingPath): Make sure variables are always initialized. * Source/NSMenuView.m, * Source/NSPrintOperation.m, * Source/NSSplitView.m, * Source/NSTableHeaderView.m: Make sure variables are always initialized. * Source/NSBox.m, * Source/NSImageview.m, * Source/NSText.m, * Source/NSTextStorage.m: Add missing includes. * Source/GSKeyBindingTable.m, * Source/GSLayoutManager.m, * Source/NSBitmapImageRep+PNM.m, * Source/NSBundleAdditions.m, * Source/NSLayoutManager.m, * Source/nsimage-tiff.h, * Source/tiff.m, * Headers/Additions/GNUstepGUI/GSDisplayServer.h, * Source/GSDisplayServer.m: Change signedness of various variables. * Source/NSPanel.m (-sendEvent:): Remove. * Source/NSWindow.m (-becomesKeyOnlyIfNeeded): New method. (-_sendEvent:becomesKeyOnlyIfNeeded:): Remove. Move code ... (-sendEvent:): ... here. Use -becomesKeyOnlyIfNeeded instead of the argument. 2005-01-21 Quentin Mathe * Source/GSToolbarView.m: * Headers/Additions/GNUstepGUI/GSToolbarView.h: Renamed the NSColor(Extensions) category with the more descriptive name NSColor(GSToolbarViewAdditions). This modification permits GNUMail compilation with recent Darwin linker versions which prevented it because GNUMail has a NSColor category identically named "Extensions". 2005-01-20 Fred Kiefer * Source/NSTableView.m (-rowAtPoint:): If the heigh of the table is incorrect and because of this the row would be greater than the number of rows, return a usable number. 2005-01-18 17:06 Alexander Malmberg * Source/NSWindow.m (-initWithContentRect:styleMask:backing:defer:screen:): Assert that the shared application instance has been created instead of just calling NSLog. Make the message clearer. 2005-01-18 16:53 Alexander Malmberg * Source/NSCell.m (-setUpFieldEditorAttributes:): Clear the text object's string. * Source/NSControl.m (-setDoubleValue:, -setFloatValue:) (-setIntValue:, -setStringValue:, -setObjectValue:): If the receiver was being edited when the method was called, make it the first responder after changing the value. (-abortEditing): Don't clear the text object's string. * Source/NSMatrix.m (-abortEditing): Don't clear the text object's string. * Source/NSTableView.m (-abortEditing): Ditto. * Source/NSTextField.m (-abortEditing): Ditto. 2005-01-18 16:39 Alexander Malmberg * Source/NSBitmapImageRep.m (-TIFFRepresentationUsingCompression:factor:): Don't use pointer comparisons to compare strings. Handle both device and calibrated colorspaces. Warn if the colorspace isn't recognized. 2005-01-18 15:50 Alexander Malmberg * Source/NSApplication.m (-runModalSession:): Don't order the window to the front or make it the key/main window. 2005-01-18 15:46 Alexander Malmberg * Source/NSApplication.m (-finishLaunching): Don't attempt to open an untitled file if we were autolaunched. 2005-01-18 14:16 Alexander Malmberg * Source/NSAffineTransform.m (pi): Correct the rounding. 2005-01-18 Matt Rice * Source/NSTextView.m (setSelectedRange:): Do not make the selected text visible. (-didChangeText,-checkSpelling:): Make the selected text visible. * Source/NSTextView_actions.m (_moveTo:select:): Ditto. * Source/NSCell.m (-setUpFieldEditorAttributes:): Ditto. (-selectWithFrame:inView:editor:delegate:start:length:): Ditto. * Source/NSComboBoxCell (-validateSelection:,-textDidChange:): Ditto. 2005-01-18 14:09 Alexander Malmberg * Source/Functions.m (NSDottedFrameRect, NSFrameRectWithWidth): Draw the frame inside the given rectangle. (NSDrawTiledRects): Remove documentation. * Headers/AppKit/NSGraphics.h (NSDottedFrameRect, NSFrameRect) (NSFrameRectWithWidth, NSDrawTiledRects): Add new documentation. 2005-01-17 Adrian Robert * Source/NSWindow.m (-sendEvent:becomesKeyOnlyIfNeeded:): Give mouseDragged events to _lastView rather than view (if exists) underneath mouse. 2005-01-17 Adrian Robert * Source/NSApplication.m (-nextEventMatchingMask:untilDate:inMode:dequeue:): Check that event is not 'null_event' before using it to unhide mouse. 2005-01-17 Fred Kiefer * Source/NSBrowserCell.m (-setType:): New method, does nothing to allow image and text at once (MacOSX 10.2 behaviour). (-drawInteriorWithFrame:inView:): Draw an image or alternate image, if provided and draw the text as well. 2005-01-16 Fred Kiefer * Images/common_ClosedHandCursor.tiff: Replaced by new image files by Fabien Vallon . 2005-01-16 Fred Kiefer * TextConverters/RTF/RTFProducer.m (-_stringWithRTFCharacters:): Output "\uc0" so that other applications know we don't write ANSI representations of Unicode characters. 2005-01-16 Fred Kiefer * Printing/GSCUPS/GSCUPSPrinter.m (+printerNames): Add dummy printer to list, if no printers are found. 2005-01-16 06:39 Gregory John Casamento * Source/NSDocument.m: In validateMenuItem: added code to properly set the undo/redo title and disable the menus when appropriate. 2005-01-15 05:59 Gregory John Casamento * Source/NSDocument.m: Added undo:/redo: here. Smarter use of the responder chain. * Source/NSWindow.m: Removed undo:/redo: here. 2005-01-14 16:11 Alexander Malmberg * Headers/AppKit/NSSavePanel.h (-panel:shouldShowFilename:): Document. * Source/NSSavePanel.m (-setDelegate:): Call -validateVisibleColumns. Whitespace cleanups. (-browser:isColumnValid:): Give the delegate the complete path to each file. Fixes bug #10553. 2005-01-14 09:25 Gregory John Casamento * Source/NSDocument.m: Minor change. The init method now sets the flag to YES so that when a undoManager is needed, it's instantiated. 2005-01-14 05:50 Gregory John Casamento * Source/NSDocument.m: corrected undoManager call in NSDocument. 2005-01-13 Adam Fedor * Source/GNUmakefile.preamble: Extend FILTER_OUT flag to all sparc architectures. 2005-01-12 16:40 Alexander Malmberg * Headers/AppKit/NSBezierPath.h (-windingCountAtPoint:): Mark as a GNUstep extension. 2005-01-12 00:47 Alexander Malmberg * Source/GSStandardWindowDecorationView.m (-initWithFrame:window:): Create a paragraph style with line-breaking-by-clipping and use it for window titles. 2005-01-12 00:41 Alexander Malmberg * Printing/GSCUPS/GSCUPSPrinter.h (GSCUPSDummyPrinterName): New variable. * Printing/GSCUPS/GSCUPSPrinter.m (GSCUPSDummyPrinterName): New variable. (+printerWithName:): Warn and return a dummy printer when requested. * Printing/GSCUPS/GSCUPSPrintInfo.m (defaultPrinter): If there's no default CUPS printer set, return a dummy printer. Fixes bug #10916. 2005-01-11 23:50 Alexander Malmberg * Headers/AppKit/NSBezierPath.h (NSWindingRule) (-containsPoint): Document. (-windingCountAtPoint:): New method. * Source/NSBezierPath.m: Remove some trailing whitespace. (PI): Correct rounding. (contribution, -contributionToContains:): Remove. (winding_line, winding_curve): New functions. (-windingCountAtPoint:): New method. (-containsPoint:): Use -windingCountAtPoint: instead of -contributionToContains:. Don't flatten the path. 2005-01-09 Matt Rice * Source/NSTableHeaderCell.m (-drawInteriorWithFrame:inView:): Use the correct background/highlight colors and NSCompositeSourceOver for image cells. (-setHighlighted): Use controlHighlightColor instead of controlColor. gnustep-gui-0.24.0/PrinterTypes/0000775000076500007650000000000012256227325016420 5ustar brains99brains99gnustep-gui-0.24.0/PrinterTypes/English.lproj/0000775000076500007650000000000012256227325021136 5ustar brains99brains99gnustep-gui-0.24.0/PrinterTypes/English.lproj/Generic-PostScript_Printer-Postscript.ppd0000664000076500007650000002723410377004044031203 0ustar brains99brains99*PPD-Adobe: "4.3" *% *% For information on using this, and to obtain the required backend *% script, consult http://www.linuxprinting.org/ *% *% This file is published under the GNU General Public License *% *% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with *% all programs and environments which use PPD files for dealing with *% printer capability information. The printer must be configured with the *% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This *% file and "foomatic-rip" work together to support PPD-controlled printer *% driver option access with arbitrary free software printer drivers and *% printing spoolers. *% *% To save this file on your disk, wait until the download has completed *% (the animation of the browser logo must stop) and then use the *% "Save as..." command in the "File" menu of your browser or in the *% pop-up manu when you click on this document with the right mouse button. *% DO NOT cut and paste this file into an editor with your mouse. This can *% introduce additional line breaks which lead to unexpected results. *% *% You may save this file as 'Generic-PostScript_Printer-Postscript.ppd' *% *% *FormatVersion: "4.3" *FileVersion: "1.1" *LanguageVersion: English *LanguageEncoding: ISOLatin1 *PCFileName: "POSTSCRI.PPD" *Manufacturer: "Generic" *Product: "(PostScript Printer)" *cupsVersion: 1.0 *cupsManualCopies: True *cupsModelNumber: 2 *cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip" *%pprRIP: foomatic-rip other *ModelName: "Generic PostScript Printer" *ShortNickName: "Generic P.S. Printer Postscript" *NickName: "Generic PostScript Printer Foomatic/Postscript (recommended)" *PSVersion: "(3010.000) 550" *PSVersion: "(3010.000) 651" *PSVersion: "(3010.000) 652" *PSVersion: "(3010.000) 653" *PSVersion: "(3010.000) 704" *PSVersion: "(3010.000) 705" *PSVersion: "(3010.000) 800" *LanguageLevel: "3" *ColorDevice: True *DefaultColorSpace: RGB *FileSystem: False *Throughput: "1" *LandscapeOrientation: Plus90 *TTRasterizer: Type42 *VariablePaperSize: False *FoomaticIDs: Generic-PostScript_Printer Postscript *FoomaticRIPCommandLine: "level=%D; printf "%%!\n%%%% %%%%\n%C&qu&& ot;; if (( $level > 0 )); then if (( $level < 99 )); then level=&& " -dLanguageLevel=$level"; else level=""; fi; gs -&& q -dPARANOIDSAFER -dNOPAUSE -dBATCH -sDEVICE=pswrite$level%A%Z -sOutpu&& tFile=- -; else cat; fi" *End *OpenGroup: General/General *OpenUI *PageSize/Page Size: PickOne *OrderDependency: 100 AnySetup *PageSize *DefaultPageSize: Letter *PageSize Letter/US Letter: "<>setpagedevice" *PageSize A4/A4: "<>setpagedevice" *PageSize 11x17/11x17: "<>setpagedevice" *PageSize A3/A3: "<>setpagedevice" *PageSize A5/A5: "<>setpagedevice" *PageSize B5/B5 (JIS): "<>setpagedevice" *PageSize Env10/Envelope #10: "<>setpagedevice" *PageSize EnvC5/Envelope C5: "<>setpagedevice" *PageSize EnvDL/Envelope DL: "<>setpagedevice" *PageSize EnvISOB5/Envelope B5: "<>setpagedevice" *PageSize EnvMonarch/Envelope Monarch: "<>setpagedevice" *PageSize Executive/Executive: "<>setpagedevice" *PageSize Legal/US Legal: "<>setpagedevice" *CloseUI: *PageSize *OpenUI *PageRegion: PickOne *OrderDependency: 100 AnySetup *PageRegion *DefaultPageRegion: Letter *PageRegion Letter/US Letter: "<>setpagedevice" *PageRegion A4/A4: "<>setpagedevice" *PageRegion 11x17/11x17: "<>setpagedevice" *PageRegion A3/A3: "<>setpagedevice" *PageRegion A5/A5: "<>setpagedevice" *PageRegion B5/B5 (JIS): "<>setpagedevice" *PageRegion Env10/Envelope #10: "<>setpagedevice" *PageRegion EnvC5/Envelope C5: "<>setpagedevice" *PageRegion EnvDL/Envelope DL: "<>setpagedevice" *PageRegion EnvISOB5/Envelope B5: "<>setpagedevice" *PageRegion EnvMonarch/Envelope Monarch: "<>setpagedevice" *PageRegion Executive/Executive: "<>setpagedevice" *PageRegion Legal/US Legal: "<>setpagedevice" *CloseUI: *PageRegion *DefaultImageableArea: Letter *ImageableArea Letter/US Letter: "0 0 612 792" *ImageableArea A4/A4: "0 0 595 842" *ImageableArea 11x17/11x17: "0 0 792 1224" *ImageableArea A3/A3: "0 0 842 1191" *ImageableArea A5/A5: "0 0 421 595" *ImageableArea B5/B5 (JIS): "0 0 516 729" *ImageableArea Env10/Envelope #10: "0 0 297 684" *ImageableArea EnvC5/Envelope C5: "0 0 459 649" *ImageableArea EnvDL/Envelope DL: "0 0 312 624" *ImageableArea EnvISOB5/Envelope B5: "0 0 499 709" *ImageableArea EnvMonarch/Envelope Monarch: "0 0 279 540" *ImageableArea Executive/Executive: "0 0 522 756" *ImageableArea Legal/US Legal: "0 0 612 1008" *DefaultPaperDimension: Letter *PaperDimension Letter/US Letter: "612 792" *PaperDimension A4/A4: "595 842" *PaperDimension 11x17/11x17: "792 1224" *PaperDimension A3/A3: "842 1191" *PaperDimension A5/A5: "421 595" *PaperDimension B5/B5 (JIS): "516 729" *PaperDimension Env10/Envelope #10: "297 684" *PaperDimension EnvC5/Envelope C5: "459 649" *PaperDimension EnvDL/Envelope DL: "312 624" *PaperDimension EnvISOB5/Envelope B5: "499 709" *PaperDimension EnvMonarch/Envelope Monarch: "279 540" *PaperDimension Executive/Executive: "522 756" *PaperDimension Legal/US Legal: "612 1008" *OpenUI *Duplex/Double-Sided Printing: PickOne *FoomaticRIPOption Duplex: enum CmdLine C *OrderDependency: 130 AnySetup *Duplex *DefaultDuplex: Notcapable *Duplex DuplexNoTumble/Long Edge (Standard): "%% FoomaticRIPOptionSetting: Duplex=DuplexNoTumble" *FoomaticRIPOptionSetting Duplex=DuplexNoTumble: "<</Duplex true&& /Tumble false>>setpagedevice\n" *End *Duplex DuplexTumble/Short Edge (Flip): "%% FoomaticRIPOptionSetting: Duplex=DuplexTumble" *FoomaticRIPOptionSetting Duplex=DuplexTumble: "<</Duplex true /&& Tumble true>>setpagedevice\n" *End *Duplex None/Off: "%% FoomaticRIPOptionSetting: Duplex=None" *FoomaticRIPOptionSetting Duplex=None: "<</Duplex false>>s&& etpagedevice\n" *End *Duplex Notcapable/Not capable: "%% FoomaticRIPOptionSetting: Duplex=Notcapable" *FoomaticRIPOptionSetting Duplex=Notcapable: "" *CloseUI: *Duplex *OpenUI *Resolution/Resolution: PickOne *FoomaticRIPOption Resolution: enum CmdLine C *OrderDependency: 110 AnySetup *Resolution *DefaultResolution: default *Resolution default/Printer Default: "%% FoomaticRIPOptionSetting: Resolution=default" *FoomaticRIPOptionSetting Resolution=default: "" *Resolution 150x150dpi/150 DPI: "%% FoomaticRIPOptionSetting: Resolution=150x150dpi" *FoomaticRIPOptionSetting Resolution=150x150dpi: "<</HWResolutio&& n[150 150]>>setpagedevice\n" *End *Resolution 300x300dpi/300 DPI: "%% FoomaticRIPOptionSetting: Resolution=300x300dpi" *FoomaticRIPOptionSetting Resolution=300x300dpi: "<</HWResolutio&& n[300 300]>>setpagedevice\n" *End *Resolution 600x600dpi/600 DPI: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi" *FoomaticRIPOptionSetting Resolution=600x600dpi: "<</HWResolutio&& n[600 600]>>setpagedevice\n" *End *Resolution 1200x600dpi/1200x600 DPI: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi" *FoomaticRIPOptionSetting Resolution=1200x600dpi: "<</HWResoluti&& on[1200 600]>>setpagedevice\n" *End *Resolution 1200x1200dpi/1200 DPI: "%% FoomaticRIPOptionSetting: Resolution=1200x1200dpi" *FoomaticRIPOptionSetting Resolution=1200x1200dpi: "<</HWResolut&& ion[1200 1200]>>setpagedevice\n" *End *Resolution 2400x600dpi/2400x600 DPI: "%% FoomaticRIPOptionSetting: Resolution=2400x600dpi" *FoomaticRIPOptionSetting Resolution=2400x600dpi: "<</HWResoluti&& on[2400 600]>>setpagedevice\n" *End *Resolution 2400x1200dpi/2400x1200 DPI: "%% FoomaticRIPOptionSetting: Resolution=2400x1200dpi" *FoomaticRIPOptionSetting Resolution=2400x1200dpi: "<</HWResolut&& ion[2400 1200]>>setpagedevice\n" *End *Resolution 2400x2400dpi/2400 DPI: "%% FoomaticRIPOptionSetting: Resolution=2400x2400dpi" *FoomaticRIPOptionSetting Resolution=2400x2400dpi: "<</HWResolut&& ion[2400 2400]>>setpagedevice\n" *End *CloseUI: *Resolution *CloseGroup: General *OpenGroup: Miscellaneous/Miscellaneous *OpenUI *PreFilter/GhostScript pre-filtering: PickOne *FoomaticRIPOption PreFilter: enum CmdLine D *OrderDependency: 100 AnySetup *PreFilter *DefaultPreFilter: No *PreFilter EmbedFonts/Embed GhostScript fonts only: "%% FoomaticRIPOptionSetting: PreFilter=EmbedFonts" *FoomaticRIPOptionSetting PreFilter=EmbedFonts: "99" *PreFilter Level1/Convert to PS level 1: "%% FoomaticRIPOptionSetting: PreFilter=Level1" *FoomaticRIPOptionSetting PreFilter=Level1: "1" *PreFilter Level2/Convert to PS level 2: "%% FoomaticRIPOptionSetting: PreFilter=Level2" *FoomaticRIPOptionSetting PreFilter=Level2: "2" *PreFilter No/No pre-filtering: "%% FoomaticRIPOptionSetting: PreFilter=No" *FoomaticRIPOptionSetting PreFilter=No: "0" *CloseUI: *PreFilter *CloseGroup: Miscellaneous *% Generic boilerplate PPD stuff as standard PostScript fonts and so on *DefaultFont: Courier *Font AvantGarde-Book: Standard "(001.006S)" Standard ROM *Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM *Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM *Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM *Font Bookman-Demi: Standard "(001.004S)" Standard ROM *Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM *Font Bookman-Light: Standard "(001.004S)" Standard ROM *Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM *Font Courier: Standard "(002.004S)" Standard ROM *Font Courier-Bold: Standard "(002.004S)" Standard ROM *Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM *Font Courier-Oblique: Standard "(002.004S)" Standard ROM *Font Helvetica: Standard "(001.006S)" Standard ROM *Font Helvetica-Bold: Standard "(001.007S)" Standard ROM *Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM *Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM *Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM *Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM *Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM *Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM *Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM *Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM *Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM *Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM *Font Palatino-Bold: Standard "(001.005S)" Standard ROM *Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM *Font Palatino-Italic: Standard "(001.005S)" Standard ROM *Font Palatino-Roman: Standard "(001.005S)" Standard ROM *Font Symbol: Special "(001.007S)" Special ROM *Font Times-Bold: Standard "(001.007S)" Standard ROM *Font Times-BoldItalic: Standard "(001.009S)" Standard ROM *Font Times-Italic: Standard "(001.007S)" Standard ROM *Font Times-Roman: Standard "(001.007S)" Standard ROM *Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM *Font ZapfDingbats: Special "(001.004S)" Standard ROM gnustep-gui-0.24.0/PrinterTypes/GNUmakefile.postamble0000664000076500007650000000470311023376255022461 0ustar brains99brains99# -*-makefile-*- # GNUmakefile.postamble # # Copyright (C) 1997 Free Software Foundation, Inc. # # Author: Scott Christley # # This file is part of the GNUstep GUI Library. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # # GNUmakefile.postamble # # Project specific makefile rules # # Uncomment the targets you want. # The double colons (::) are important, do not make them single colons # otherwise the normal makefile rules will not be performed. # # Things to do before compiling # before-all:: # Things to do after compiling # after-all:: $(PPD_INSTALL_DIR): $(MKDIRS) $(PPD_INSTALL_DIR) # Things to do before installing before-install:: $(PPD_INSTALL_DIR) # Things to do after installing after-install:: for dirs in $(RESOURCE_DIRS); do \ if [ ! -d $(PPD_INSTALL_DIR)/$$dirs ]; then \ $(MKDIRS) $(PPD_INSTALL_DIR)/$$dirs ; \ fi; \ $(INSTALL_DATA) $$dirs/*ppd $(PPD_INSTALL_DIR)/$$dirs/ ; \ done; \ for file in $(RESOURCE_FILES); do \ $(INSTALL_DATA) $$file $(RES_INSTALL_DIR) ; \ done # Things to do before uninstalling before-uninstall:: for file in $(RESOURCE_DIRS); do \ rm -rf $(PPD_INSTALL_DIR)/$$file ; \ done for file in $(RESOURCE_FILES); do \ rm -f $(RES_INSTALL_DIR)/$$file ; \ done # Things to do after uninstalling # after-uninstall:: # Things to do before cleaning # before-clean:: # Things to do after cleaning # after-clean:: # Things to do before distcleaning # before-distclean:: # Things to do after distcleaning # after-distclean:: # Things to do before checking # before-check:: # Things to do after checking # after-check:: gnustep-gui-0.24.0/PrinterTypes/GSProlog.ps0000664000076500007650000000033510377004044020452 0ustar brains99brains99%%LanguageLevel defines %% %% Copyright (C) 2005, Free Software Foundation, Inc. %% /_GSsetalpha { pop } bind def /setalpha where {pop /GSsetalpha /setalpha load def} {/GSsetalpha /_GSsetalpha load def} ifelse gnustep-gui-0.24.0/PrinterTypes/GNUmakefile0000664000076500007650000000277611335045223020476 0ustar brains99brains99# # Images makefile for GNUstep GUI Library # Copyright (C) 1997 Free Software Foundation, Inc. # # Author: Scott Christley # Date: September 1997 # # This file is part of the GNUstep GUI Library. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. PACKAGE_NAME = gnustep-gui GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../gui.make include $(GNUSTEP_MAKEFILES)/common.make include ../Version RES_INSTALL_DIR = $(GNUSTEP_LIBRARY)/PostScript PPD_INSTALL_DIR = $(GNUSTEP_LIBRARY)/PostScript/PPD RESOURCE_DIRS = English.lproj RESOURCE_FILES = GSProlog.ps -include GNUmakefile.preamble # We don't actually build anything in this directory so # just include the common makefile rules include $(GNUSTEP_MAKEFILES)/rules.make include GNUmakefile.postamble gnustep-gui-0.24.0/KeyBindings/0000775000076500007650000000000012256227335016157 5ustar brains99brains99gnustep-gui-0.24.0/KeyBindings/DefaultKeyBindings.dict0000664000076500007650000000526211435261511022534 0ustar brains99brains99{ /* -*-c-*- */ /* Function keys */ "UpArrow" = "moveUp:"; "DownArrow" = "moveDown:"; "LeftArrow" = "moveLeft:"; "RightArrow" = "moveRight:"; "Control-UpArrow" = "scrollPageUp:"; "Control-DownArrow" = "scrollPageDown:"; "Control-LeftArrow" = "moveToBeginningOfLine:"; "Control-RightArrow" = "moveToEndOfLine:"; "Control-Shift-LeftArrow" = "moveToBeginningOfLineAndModifySelection:"; "Control-Shift-RightArrow" = "moveToEndOfLineAndModifySelection:"; "Control-Shift-UpArrow" = "moveToBeginningOfDocumentAndModifySelection:"; "Control-Shift-DownArrow" = "moveToEndOfDocumentAndModifySelection:"; "Alternate-UpArrow" = ("moveUp:", "moveWordBackward:"); "Alternate-DownArrow" = ("moveDown:", "moveWordForward:"); "Alternate-LeftArrow" = "moveWordBackward:"; "Alternate-RightArrow" = "moveWordForward:"; "Shift-UpArrow" = "moveUpAndModifySelection:"; "Shift-DownArrow" = "moveDownAndModifySelection:"; "Shift-LeftArrow" = "moveBackwardAndModifySelection:"; "Shift-RightArrow" = "moveForwardAndModifySelection:"; "Alternate-Shift-UpArrow" = ("moveUpAndModifySelection:", "moveWordBackwardAndModifySelection:"); "Alternate-Shift-DownArrow" = ("moveDownAndModifySelection:", "moveWordForwardAndModifySelection:"); "Alternate-Shift-LeftArrow" = "moveWordBackwardAndModifySelection:"; "Alternate-Shift-RightArrow" = "moveWordForwardAndModifySelection:"; "Control-Alternate-UpArrow" = ("pageUp:", "moveWordBackward:"); "Control-Alternate-DownArrow" = ("pageDown:", "moveWordForward:"); "Delete" = "deleteForward:"; "Home" = "moveToBeginningOfParagraph:"; "Control-Home" = "moveToBeginningOfDocument:"; "Shift-Home" = "moveToBeginningOfParagraphAndModifySelection:"; "End" = "moveToEndOfParagraph:"; "Control-End" = "moveToEndOfDocument:"; "Shift-End" = "moveToEndOfParagraphAndModifySelection:"; "PageUp" = "scrollPageUp:"; "PageDown" = "scrollPageDown:"; "Shift-PageDown" = "pageDownAndModifySelection:"; "Shift-PageUp" = "pageUpAndModifySelection:"; "Control-PageDown" = "pageDown:"; "Control-PageUp" = "pageUp:"; "Alternate-PageDown" = "pageDown:"; "Alternate-PageUp" = "pageUp:"; /* Emacs Control keybindings */ "Control-a" = "moveToBeginningOfLine:"; "Control-b" = "moveBackward:"; "Control-d" = "deleteForward:"; "Control-e" = "moveToEndOfLine:"; "Control-f" = "moveForward:"; "Control-h" = "deleteBackward:"; "Control-l" = "centerSelectionInVisibleArea:"; "Control-k" = "deleteToEndOfLine:"; "Control-n" = "moveDown:"; "Control-o" = ( "insertNewlineIgnoringFieldEditor:", "moveBackward:" ); "Control-p" = "moveUp:"; "Control-t" = "transpose:"; "Control-v" = "pageDown:"; "Control-y" = "yank:"; } gnustep-gui-0.24.0/KeyBindings/GNUmakefile0000664000076500007650000000251511335045223020223 0ustar brains99brains99# # Copyright (C) 2001 Free Software Foundation, Inc. # # Author: Nicola Pero # # This file is part of the GNUstep GUI Library. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING.LIB. # If not, see or write to the # Free Software Foundation, 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. include $(GNUSTEP_MAKEFILES)/common.make include $(GNUSTEP_MAKEFILES)/rules.make $(GNUSTEP_LIBRARY)/KeyBindings: $(MKINSTALLDIRS) $@ after-install:: $(GNUSTEP_LIBRARY)/KeyBindings $(INSTALL_DATA) DefaultKeyBindings.dict \ $(GNUSTEP_LIBRARY)/KeyBindings/ after-uninstall:: rm -f $(GNUSTEP_LIBRARY)/KeyBindings/DefaultKeyBindings.dict -rmdir $(GNUSTEP_LIBRARY)/KeyBindings gnustep-gui-0.24.0/config.make.in0000664000076500007650000000074312165225114016456 0ustar brains99brains99# -*-makefile-*- # Extra make variables for gui library # CONFIG_SYSTEM_INCL += @CONFIG_SYSTEM_INCL@ CONFIG_SYSTEM_LIB_DIR += @CONFIG_SYSTEM_LIB_DIR@ ADDITIONAL_DEPENDS = @LIBS@ # Build speech and sound. BUILD_SPEECH=@BUILD_SPEECH@ BUILD_SOUND=@BUILD_SOUND@ # CUPS GSCUPS_CFLAGS = @GSCUPS_CFLAGS@ GSCUPS_LDFLAGS = @GSCUPS_LDFLAGS@ GSCUPS_LIBS = @GSCUPS_LIBS@ GSCUPS_DATADIR = @GSCUPS_DATADIR@ BUILD_GSCUPS = @BUILD_GSCUPS@ # Cross compilation CROSS_COMPILING = @cross_compiling@